@php
$countries ??= collect();
$showCountryFlagNextLang = (config('settings.localization.show_country_flag') == 'in_next_lang');
$showCountrySpokenLang = config('settings.localization.show_country_spoken_languages');
$showCountrySpokenLang = str_starts_with($showCountrySpokenLang, 'active');
$supportedLanguages = $showCountrySpokenLang ? getCountrySpokenLanguages() : getSupportedLanguages();
$supportedLanguagesExist = (is_array($supportedLanguages) && count($supportedLanguages) > 1);
$isLangOrCountryCanBeSelected = ($supportedLanguagesExist || $showCountryFlagNextLang);
// Check if the Multi-Countries selection is enabled
$multiCountryIsEnabled = false;
$multiCountryLabel = '';
if ($showCountryFlagNextLang) {
if (!empty(config('country.code'))) {
if ($countries->count() > 1) {
$multiCountryIsEnabled = true;
}
}
}
$countryName = config('country.name');
$countryFlag32Url = config('country.flag32_url');
$countryFlagImg = $showCountryFlagNextLang
? ''
: null;
@endphp
@if ($isLangOrCountryCanBeSelected)
{{-- Language & Country Selector --}}