<?php

$appUrlParts = parse_url(env('APP_URL', 'http://localhost'));
$viteDevServerHost = ($appUrlParts['scheme'] ?? 'http') . '://' . ($appUrlParts['host'] ?? 'localhost');
$viteDevServerPort = env('VITE_DEV_SERVER_PORT', '5173');

return [
    'from_email' => env('SITE_FROM_EMAIL', 'sales@mtc.co.uk'),
    'contact_email' => env('SITE_CONTACT_EMAIL', 'sales@mtc.co.uk'),
    'shop_email' => env('SITE_SHOP_EMAIL', 'sales@mtc.co.uk'),

    'address' => [
        'location' => env('SITE_ADDRESS_LOCATION', '1 Example Street'),
        'address_1' => env('SITE_ADDRESS_ADDRESS_1', 'Example'),
        'address_2' => env('SITE_ADDRESS_ADDRESS_2', 'Example'),
        'city' => env('SITE_ADDRESS_CITY', 'Dundee'),
        'county' => env('SITE_ADDRESS_COUNTY', 'Scotland'),
        'country' => env('SITE_ADDRESS_COUNTRY', 'United Kingdom'),
        'postcode' => env('SITE_ADDRESS_POSTCODE', 'AA1 AA1'),
        'reg_no' => env('SITE_ADDRESS_REG_NO', '999999'),
        'gphc_no' => env('SITE_ADDRESS_GPHC_NO', '999999'),
    ],
    'phone_number' => env('SITE_PHONE_NUMBER', '01234 567899'),

    'trustpilot_api_business_id' => env('TRUSTPILOT_API_BUSINESS_ID', ''),
    'trustpilot_template_id' => env('TRUSTPILOT_TEMPLATE_ID', ''),
    'trustpilot_url' => env('TRUSTPILOT_URL', ''),
    'trustpilot_bcc_email' => env('TRUSTPILOT_BCC_EMAIL', ''),

    'tnx_prefix' => env('SITE_TRANSACTION_PREFIX', 'MTC'),

    'gtm_id' => env('SITE_GTM_ID', ''),

    'vite_dev_server_port' => $viteDevServerPort,
    'vite_dev_server_url' => $viteDevServerHost . ':' . $viteDevServerPort,
    'vite_dev_server' => filter_var(env('VITE_DEV_SERVER', false), FILTER_VALIDATE_BOOLEAN),
];
