<% // объявляем переменные для использования в шаблоне if (window.price.renew.response != undefined) { var tierGroups = window.kl.groupBy(window.price.renew.response, product => product.tierName); var isPriceLoaded = tierGroups["standard"] && tierGroups[window.getPromotableTierName()]; } %> <% function renderPriceButton(tier, tierName) { %> <% if (isPriceLoaded) { %>

<%= BuySwitchLabel %>

<% for (const [index, offer] of tierGroups[tierName].flatMap(x => x.offers).entries()) { %>
checked <% } %> >
<% } %>

<%= BuySwitchDescription %>

<% for (const [index, offer] of tierGroups[tierName].flatMap(x => x.offers).entries()) { %> <% var buttonVisible = index == 0 ? "block" : "none" %> <% } %>
<% } else { %> <% } %> <% if (window.external.isTryAvailable(tier)) { %> <% } %> <% } %>
<% if (window.getPromotableTier() == window.getPlusTier()) { %> <% } %> <% if (window.getPromotableTier() == window.getPremiumTier()) { %> <% } %>

<%= SellScreenHeader %>

<%= StandardHeader %>

<%= StandardDescription %>

<%= StandardBulletHeader1 %>

<%= StandardBulletDescription1 %>

<%= StandardBulletHeader2 %>

<%= StandardBulletDescription2 %>

<%= StandardBulletHeader3 %>

<%= StandardBulletDescription3 %>

<% renderPriceButton(window.external.GetStandardTier(), "standard"); %>

<%= PlusHeader %>

<%= PlusDescription %>

<%= PlusBulletHeader1 %>

<%= PlusBulletHeader2 %>

<%= PlusBulletDescription2 %>

<%= PlusBulletHeader3 %>

<%= PlusBulletDescription3 %>

<%= PlusBulletHeader4 %>

<%= PlusBulletDescription4 %>

<% renderPriceButton(window.external.GetPlusTier(), "plus"); %>

<%= PremiumHeader %>

<%= PremiumDescription %>

<%= PremiumBulletHeader1 %>

<%= PremiumBulletHeader2 %>

<%= PremiumBulletDescription2 %>

<%= PremiumBulletHeader3 %>

<%= PremiumBulletDescription3 %>

<%= PremiumBulletHeader4 %>

<%= PremiumBulletDescription4 %>

<% renderPriceButton(window.external.GetPremiumTier(), "premium"); %>