1function updateCookiesPromoCode(promoCode){$.post("/hosting/clearPromocodeCookies_ajax/",{code:promoCode},()=>{},"json")}function checkValidPromoCode(promoCode){return $.ajax({type:"GET",url:"/hosting/checkPromoCode_ajax",data:{promocode:promoCode,plan:7336,period:12}})}function getCookiesPromoCode(){return $.ajax({type:"GET",url:"/hosting/getPromocodeCookies_ajax/",data:{}})}function applyPromoCode(promoCode){$("#hosting-form__promocode").val(promoCode).trigger("input"),initCheckPromoCode(promoCode)}async function initPromoCode(){const cookiesPromoCodeResponse=await getCookiesPromoCode(),cookiesPromoCode=await JSON.parse(cookiesPromoCodeResponse).js.code,currentPromoCode=getQueryVariable("utm_term");if(currentPromoCode?(SW.order.data.savedPromoCode=currentPromoCode,SW.order.save()):cookiesPromoCode&&(SW.order.data.savedPromoCode=cookiesPromoCode,SW.order.save()),!currentPromoCode&&cookiesPromoCode){applyPromoCode(cookiesPromoCode);return}if(currentPromoCode)if(currentPromoCode===cookiesPromoCode)applyPromoCode(currentPromoCode);else{const promoCodeIsValidResponse=await checkValidPromoCode(currentPromoCode),currentPromoCodeIsValid=await JSON.parse(promoCodeIsValidResponse).js.valid;currentPromoCodeIsValid?(applyPromoCode(currentPromoCode),updateCookiesPromoCode(currentPromoCode)):currentPromoCode&&!currentPromoCodeIsValid&&cookiesPromoCode&&applyPromoCode(cookiesPromoCode)}}initPromoCode();function initCheckPromoCode(code){$(".service-plan").not(".js-cheap-vds").each(function(){const $self=$(this),planId=$(this).find("[name='reg_planType']").val();if($self.find(".js-select-tariff").length){refreshReadySolutionPromoPrice($self,code,planId);return}$.getJSON("/hosting/checkPromoCode_ajax",{promocode:code,plan:planId,period:12},function(response){try{if(response.js.valid&&response.js.data.rate_rub)if($self.hasClass("js-vh-tariff-card"))updateHostingTariffPromoPrice($self,+response.js.data.rate_rub);else{const currentPanel=$self.find(".select-panel").find(":selected"),currentPanelPrice=currentPanel.length!==0?currentPanel.data("price"):0,totalPrice=+response.js.data.rate_rub+currentPanelPrice,monthPriceSpan=$self.find(".div_select > span");$self.find(".div_select em").remove(),$("<em/>",{class:"lightgreen"}).text(totalPrice).insertAfter(monthPriceSpan),location.pathname==="/vds/free/"&&$(".ISP_prise_span").css("display","none"),monthPriceSpan.addClass("through"),$self.find(".price__per_day-text").text(printPrice(totalPrice*12/365,"day"))}}catch{}})}),$(".vds-ui-card").each(function(){const self=$(this);$(this).find("[name='reg_planType']").data("promocode",code).attr("data-promocode",code).trigger("input")}),$(document).trigger("vds:constructor-promocode",[{code}])}function refreshReadySolutionPromoPrice(card,code,planId){const $card=$(card),previousRequest=$card.data("promocodeRequest");previousRequest?.abort&&previousRequest.abort(),$card.data("promocode",code);const request=$.getJSON("/hosting/checkPromoCode_ajax",{promocode:code,plan:planId,period:12},function(response){const rateRub=response?.js?.valid?Number(response?.js?.data?.rate_rub):null;$card.data("promoMonthlyPrice",Number.isFinite(rateRub)?rateRub:null),$card.trigger("vds:promocode-price-updated")});$card.data("promocodeRequest",request)}$(document).on("vds:promocode-plan-changed",".service-plan",function(event,{planId}){const $card=$(this),promocode=$card.data("promocode");promocode&&refreshReadySolutionPromoPrice($card,promocode,planId)});function updateHostingTariffPromoPrice(tariffCard,newPrice){const price=$(tariffCard).find(".js-tariff-card-price"),biggerPrice=$(tariffCard).find(".js-tariff-bigger-price");$(tariffCard).find(".js-tariff-sale-value").text("- "+Math.abs(parseInt(price.text().replace(/\s/g,""))-newPrice)+" \u20BD/\u043C\u0435\u0441."),biggerPrice.text(price.text()+" \u20BD/\u043C\u0435\u0441."),price.text(newPrice.toLocaleString()),setPriceValuesVisibility(tariffCard,!0)}function setPriceValuesVisibility(tariffCard,isVisible){const biggerPrice=$(tariffCard).find(".js-tariff-bigger-price"),saleValue=$(tariffCard).find(".js-tariff-sale-value");biggerPrice.toggleClass("visually-hidden",!isVisible),saleValue.toggleClass("visually-hidden",!isVisible)}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.