<?php
    $socialSiteName = $settings->site_name ?? config('app.name', 'Savanna Courier');
    $socialTitle = $previewTitle ?? (($settings->site_title ?? null) ?: $socialSiteName);
    $socialDescription = $previewDescription ?? (($settings->description ?? null) ?: ($socialSiteName . ' is a global logistics service provider offering premium shipping, courier, and tracking services worldwide.'));
    $socialImagePath = 'temp/custom/images/social-preview.png';
    $socialImageVersion = '20260520';
    $siteRoot = rtrim((string) ($settings->site_address ?? ''), '/');

    if ($siteRoot === '') {
        $siteRoot = rtrim(url('/'), '/');
    }

    if (! preg_match('/^https?:\/\//i', $siteRoot)) {
        $siteRoot = 'https://' . ltrim($siteRoot, '/');
    }

    $siteRoot = preg_replace('/^http:\/\//i', 'https://', $siteRoot);
    $socialUrl = $previewUrl ?? ($siteRoot . (request()->getPathInfo() === '/' ? '/' : request()->getPathInfo()));
    $socialImage = $previewImage ?? ($siteRoot . '/' . $socialImagePath . '?v=' . $socialImageVersion);
    $socialImageAlt = $previewImageAlt ?? ($socialSiteName . ' social preview');
?>

<link rel="canonical" href="<?php echo e($socialUrl); ?>" />
<meta property="og:type" content="website" />
<meta property="og:site_name" content="<?php echo e($socialSiteName); ?>" />
<meta property="og:title" content="<?php echo e($socialTitle); ?>" />
<meta property="og:description" content="<?php echo e($socialDescription); ?>" />
<meta property="og:url" content="<?php echo e($socialUrl); ?>" />
<meta property="og:image" content="<?php echo e($socialImage); ?>" />
<meta property="og:image:secure_url" content="<?php echo e($socialImage); ?>" />
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="<?php echo e($socialImageAlt); ?>" />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:title" content="<?php echo e($socialTitle); ?>" />
<meta name="twitter:description" content="<?php echo e($socialDescription); ?>" />
<meta name="twitter:image" content="<?php echo e($socialImage); ?>" />
<?php /**PATH /home/purecarg/public_html/resources/views/partials/social-preview-meta.blade.php ENDPATH**/ ?>