{% extends '@App/base.html.twig' %}
{% block content %}
{% if isMobile %}
<figure class="mt-[10px] lg:mt-[40px]">
{% include '@App/shared/ui/backButton/backButton.html.twig' %}
{# {% include '@App/components/header/header.html.twig' with {#}
{# title: true#}
{# } %}#}
{% for message in app.flashes('password_reset_success') %}
{% include '@App/shared/ui/modal/modalLinkSuccess.html.twig' with {
email: message
} %}
{% endfor %}
{% for message in app.flashes('password_reset_link_success') %}
{% include '@App/shared/ui/modal/modalSuccess.html.twig' with {
email: message
} %}
{% endfor %}
<div
class="text-[20px] font-medium uppercase text-white text-center max-w-max md:max-w-[600px] {% if companyStyles.titleTextAlign == 'center' %}mx-auto{% else %}md:mx-auto{% endif %}"
style="{{ inlineStyles(app.request.get('companyInner'), constant('App\\Constants\\SettingConstants::TITLE_STYLES')) }}"
>{% trans from 'main' %}Оберіть оператора{% endtrans %}</div>
<div class="mt-[14px] p-[18px] max-w-max md:max-w-[600px] mx-auto rounded-[24px] bg-white">
<div class="flex flex-col gap-[16px]">
{% for item in operators %}
<div class="rounded-[16px] p-[18px] {% if item.active %}{% else %} opacity-60 pointer-events-none {% endif %} border border-[#E2E2E9] bg-[#F7F7FA]">
{% if item.connectionError or item.isServerActive == false %}
<div>
{% else %}
<a href="{{ path('operator_tariff_page',{slug:item.slug}) }}" >
{% endif %}
<div class="flex items-center content-start gap-[16px]">
<div>
<svg class="w-[48px] h-[48px]">
{% if item.type == operatorLifecellType() %}
<use href="{{ asset('build/sprite.svg#lifecell_rebrending') }}"></use>
{% elseif item.type == operatorVodafoneType() %}
<use href="{{ asset('build/sprite.svg#vodafone') }}"></use>
{% else %}
<use href="{{ asset('build/sprite.svg#kyivstar_logo') }}"></use>
{% endif %}
</svg>
</div>
<div class="text-[24px] text-[#1B2028] font-medium">{{ item.name }}</div>
</div>
<hr class="h-px my-[8px] bg-[#E2E2E9] border-0 ">
<p class="text-[14px] font-medium text-[#5B5B5B] leading-tight mb-[8px]">
{{ item.description }}
</p>
<div class="flex w-full justify-between items-center">
{% if item.connectionError or item.isServerActive == false %}
<p class="text-[14px] font-semibold" style="color: red">
{{ 'operator.tariff.unavailable'|trans({'%operator%': item.name}, 'main') }}
</p>
{% else %}
<p class="text-[14px] font-semibold" style="color: {{ companyStyles.linkTextColor }}">
{% trans from 'main' %}Обрати тариф та Купити eSIM{% endtrans %}
</p>
<div class="text-white bg-[#EDEDF1] hover:bg-gray-200 focus:ring-4 focus:outline-none focus:ring-gray-50 font-medium rounded-full text-sm p-[12px] text-center inline-flex items-center hover:ease-in duration-150">
<svg class="w-4 h-4" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 17 11">
<path fill-rule="evenodd" clip-rule="evenodd" fill="{{ companyStyles.linkTextColor }}" d="M11.6814 10.5123L16.316 5.87774C16.6004 5.59334 16.6004 5.13224 16.316 4.84784L11.6814 0.213299C11.397 -0.0711002 10.9359 -0.0711003 10.6515 0.213299C10.3671 0.497698 10.3671 0.958799 10.6515 1.2432L14.0429 4.63455L1.23606 4.63454C0.833861 4.63454 0.507813 4.96059 0.507813 5.36279C0.507813 5.76499 0.833861 6.09104 1.23606 6.09104L14.0429 6.09104L10.6515 9.48239C10.3671 9.76679 10.3671 10.2279 10.6515 10.5123C10.9359 10.7967 11.397 10.7967 11.6814 10.5123Z"/>
</svg>
</div>
{% endif %}
</div>
{% if item.connectionError or item.isServerActive == false %}
</div>
{% else %}
</a>
{% endif %}
{% if item.tariffs is not empty and item.connectionError is empty %}
<div id="accordion-collapse" data-accordion="keep">
<h2 id="accordion-collapse-heading-{{ item.type }}" class="peer">
<button type="button" class="js--accordionBtn group text-[14px] mt-[6px] flex items-center justify-start w-full font-semibold text-gray-500 gap-3" data-accordion-target="#accordion-collapse-body-{{ item.type }}" aria-expanded="false" aria-controls="accordion-collapse-body-{{ item.type }}">
<span class="pointer-events-none">{% trans from 'main' %}Доступні тарифні плани{% endtrans %}</span>
<svg data-accordion-icon class="pointer-events-none w-3 h-3 group-aria-expanded:rotate-0 rotate-180 shrink-0 transition ease-in-out duration-150" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 10 6">
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 5 5 1 1 5"/>
</svg>
</button>
</h2>
<div id="accordion-collapse-body-{{ item.type }}" class="mt-[14px] peer-[.open]:block hidden" aria-labelledby="accordion-collapse-heading-{{ item.type }}">
{% for tarif in item.tariffs %}
<div>
{% if item.connectionError or item.isServerActive == false %}
<div>
{% else %}
<a href="{{ path('tariff_selected_page', {'tariff': tarif.id}) }}">
{% endif %}
<p class="font-medium text-[16px] hover:underline transition ease-in-out duration-150" style="color: {{ companyStyles.linkTextColor }}">{{ tarif.name }}</p>
{% if item.type == operatorLifecellType() %}
<p class="text-[#5B5B5B] font-medium text-[13px]">{% trans from 'tarif_choice' %}Після покупки та активації можно обрати один з тарифних планів: Вільний Лайф/Просто Лайф/Platinum Лайф/Шкільний Лайф/Смарт Лайф/Потужний/Вільний Лайф. Регіон/Дзвінкий БЕЗМЕЖ/Смарт/Сім’я/Ґаджет Смарт/Ґаджет Планшет/Ґаджет Роутер{% endtrans %}</p>
{% else %}
<p class="text-[#5B5B5B] font-medium text-[13px]">{% trans from 'main' %}Ціна з пакетом послуг на перші 4 тижні{% endtrans %} {{ tarif.price }}₴</p>
<p class="text-[#5B5B5B] font-medium text-[13px]">{% trans from 'main' %}Абонплата{% endtrans %} {{ tarif.subscription }}{% if item.type == operatorLifecellType() %}{% else %}₴ {% trans from 'main' %}за 4 тижні{% endtrans %}{% endif %}</p>
{% endif %}
{% if item.connectionError or item.isServerActive == false %}
</div>
{% else %}
</a>
{% endif %}
{% set currentCompany = app.request.get('companyInner') %}
{% if tarif.promoImage is not empty and (tarif.promoImageCompanies is empty or currentCompany in tarif.promoImageCompanies) %}
<div class="[&_img]:max-w-full [&_img]:max-h-[96px] [&_img]:object-fill [&_img]:rounded-[10px]">
{% if tarif.promoImageUrl %}
<a href="{{ tarif.promoImageUrl }}" target="_blank" rel="noopener noreferrer" class="block mt-[8px]">
{{ sonata_media(tarif.promoImage, 'reference') }}
</a>
{% else %}
<div class="mt-[8px]">
{{ sonata_media(tarif.promoImage, 'reference') }}
</div>
{% endif %}
</div>
{% endif %}
</div>
{% if loop.length >= 1 and not loop.last %}
<hr class="h-px my-[12px] bg-[#E2E2E9] border-0 ">
{% endif %}
{% endfor %}
</div>
</div>
{% endif %}
</div>
{% endfor %}
</div>
<a href="{{ path('how_it_works') }}" class="font-medium text-[16px] text-center block hover:underline mt-[30px]" style="color: {{ companyStyles.linkTextColor }}">{% trans from 'main' %}Як працює eSIM?{% endtrans %}</a>
<a href="{% if is_granted('ROLE_FRONT_USER') %}{{ path('profile_page') }}{% else %}{{ path('login_locale') }}{% endif %}" class="font-medium text-[#C6252A] text-[16px] text-center block hover:underline mt-[25px]">
{# {% trans from 'main' %}Історія Ваших покупок eSIM{% endtrans %}#}
{% include '@App/shared/ui/button/button.html.twig' with {
text: 'Історія Ваших покупок eSIM'|trans({}, 'main'),
} %}
</a>
<p class="text-[#909299] text-center mt-[26px] font-medium text-[12px]">{% trans from 'main' %}Якщо Ви вже купували eSІM у нас, реєструвалися та не встигли купити eSIM або хочете купити ще, залогіньтесь до власної історії покупок.{% endtrans %}</p>
{% if faqs is defined and faqs is not empty %}
<button data-modal="#modal_faq" class="js--modal hover:underline transition ease-in-out duration-150 w-full block text-center p-[12px] h-[48px] bg-transparent border rounded-[10px] border-none font-semibold text-[16px] mt-[25px] focus:outline-none" style="color: {{ companyStyles.linkTextColor }}">{% trans from 'tarif_choice' %}Поширені питаня та відповіді{% endtrans %}</button>
{% endif %}
</div>
</figure>
{% else %}
{% include '@App/pages/main/main_web.html.twig' %}
{% endif %}
{% endblock %}