PageSourceSearch

https://www.avast.com/etc.clientlibs/avast/clientlibs/generated/co…box.min.c469dbad04c54d8e93c8583fc0922d60.js

js avast.com collected 2026-09-24 06:40:04 UTC 17,144 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunkaem_maven_archetype=self.webpackChunkaem_maven_archetype||[]).push([[2405],{296:function(e,t,r){r.d(t,{A:function(){return n}});var i=r(7800);function n(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var i,n,s,c,a=[],o=!0,u=!1;try{if(s=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;o=!1}else for(;!(o=(i=s.call(r)).done)&&(a.push(i.value),a.length!==t);o=!0);}catch(e){u=!0,n=e}finally{try{if(!o&&null!=r.return&&(c=r.return(),Object(c)!==c))return}finally{if(u)throw n}}return a}}(e,t)||(0,i.A)(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}},816:function(e,t,r){r.d(t,{A:function(){return n}});var i=r(2284);function n(e){var t=function(e){if("object"!=(0,i.A)(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=(0,i.A)(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==(0,i.A)(t)?t:t+""}},1482:function(e,t,r){r.d(t,{z:function(){return i}});var i=function(e){var t="smbpb-".concat(e);return{get:function(){return JSON.parse(sessionStorage.getItem(t)||"{}")},set:function(r){sessionStorage.setItem(t,JSON.stringify(r)),window.dispatchEvent(new CustomEvent("smbpb:sync",{detail:{sessionId:e,data:r,type:"storage"}}))},setGroupSelection:function(t,r){var i=this.get();i.groupSelections=i.groupSelections||{},i.groupSelections[t]=r,this.set(i),window.dispatchEvent(new CustomEvent("smbpb:group-selection",{detail:{groupId:t,selectedIndex:r,sessionId:e}}))},getGroupSelection:function(e){var t;return(null===(t=this.get().groupSelections)||void 0===t?void 0:t[e])||0}}}},2284:function(e,t,r){function i(e){return i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},i(e)}r.d(t,{A:function(){return i}})},2581:function(e,t,r){r.d(t,{l:function(){return l},r:function(){return u}});var i="--price_actual-fs-vert",n="--price_actual-lh-vert",s=function(e){var t=e.classList.contains("c-smb-pbg")?".c-smbpb .c-price .c-price__grid":".c-price .c-price__grid";return Array.from(e.querySelectorAll(t)).filter(function(e){var t=e.closest(".c-smbpb");return t&&!t.closest(".c-smb-pbg--hide, .c-smbpb--hide")})},c=function(e){e&&e.style&&(e.style.removeProperty(i),e.style.removeProperty(n),e.removeAttribute("data-shrink-step"))},a=function(e,t,r,a){c(e);var o=s(e);if(o.length)for(var u=a?26:34,l=a?34:44,p=window.getComputedStyle(r),d=parseInt(p.getPropertyValue(i).trim(),10)||u,b=parseInt(p.getPropertyValue(n).trim(),10)||l,m=function(){return o.every(function(e){return e.offsetWidth<=t})},f=0;f<7&&!m();f++)d=Math.max(20,d-2),b=Math.max(26,b-2),e.style.setProperty(i,"".concat(d,"px")),e.style.setProperty(n,"".concat(b,"px")),e.setAttribute("data-shrink-step",f<6?f:"max")},o=function(e,t,r,i){var n=e.closest(".c-priceboxsmbstickywidget");if(n&&!n.classList.contains("c-priceboxsmbstickywidget--expanded"))return 168;var s=window.getComputedStyle(e),c=t?window.getComputedStyle(t):null,a=t?c.getPropertyValue("--smb-pbg-box-width"):e.offsetWidth,o=s.getPropertyValue("--smbpb_box-pad"),u=t?c.getPropertyValue("--smb-pbg-boxes"):"",l=t?c.getPropertyValue("--smb-pbg-grid-gap"):"",p=t?c.getPropertyValue("display"):"",d=t&&"grid"===p,b=parseFloat(a),m=parseFloat(o),f=parseFloat(u),h=parseFloat(l);if(!isNaN(b)&&1===b&&r){var v=i?r.offsetWidth/2-16:r.offsetWidth;!d||isNaN(f)||isNaN(h)?d||(b=parseFloat(v)):b=(v-(f-1)*h)/f}return isNaN(b)||isNaN(m)?null:b-2*m},u=function(e){var t=e.querySelector(".c-price__grid"),r=e.closest(".c-smbpb"),i=e.closest(".c-smbpb__table-col-end"),n=i?window.getComputedStyle(i):null,u=n&&"contents"!==n.getPropertyValue("display");if(t&&r){var l=r.closest(".c-smb-pbg");if(l&&l.classList.contains("c-smb-pbg--vertical-prices"))!function(e,t,r){e.classList.remove("c-smb-pbg--vertical-prices"),c(e);var i=t.closest(".c-smb-pbg__groups-wrap"),n=o(t,e,i,r);if(null!=n){if(s(e).some(function(e){return e.offsetWidth>n})){e.classList.add("c-smb-pbg--vertical-prices");var u=t.querySelector(".c-price");u&&a(e,n,u,r)}}else e.classList.add("c-smb-pbg--vertical-prices")}(l,r,u);else if(!r.closest(".c-smb-pbg--hide, .c-smbpb--hide")){r.classList.remove("c-smbpb--vertical-prices");var p=r.closest(".c-smb-pbg__groups-wrap"),d=o(r,l,p,u),b=t.offsetWidth;if(e.setAttribute("data-width",e.offsetWidth),null==p||p.setAttribute("data-group-width",Math.round(100*p.offsetWidth)/100),t.setAttribute("data-allowed-width",Math.round(100*d)/100),t.setAttribute("data-price-grid-width",Math.round(100*b)/100),null!=d)if(b>d){var m=l||r;m.classList.add(l?"c-smb-pbg--vertical-prices":"c-smbpb--vertical-prices"),a(m,d,e,u)}else r.classList.remove("c-smbpb--vertical-prices"),c(r)}}},l=function(e){var t=e.querySelector(".c-price");if(t){var r;u(t);var i=function(){clearTimeout(r),r=setTimeout(function(){return u(t)},50)};return window.addEventListener("resize",i),function(){window.removeEventListener("resize",i),clearTimeout(r)}}}},2901:function(e,t,r){r.d(t,{A:function(){return s}});var i=r(816);function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,(0,i.A)(n.key),n)}}function s(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}},3029:function(e,t,r){function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,{A:function(){return i}})},3145:function(e,t,r){function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,i=Array(t);r<t;r++)i[r]=e[r];return i}r.d(t,{A:function(){return i}})},4467:function(e,t,r){r.d(t,{A:function(){return n}});var i=r(816);function n(e,t,r){return(t=(0,i.A)(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}},6844:function(e,t,r){var i=r(4467),n=r(3029),s=r(2901),c=r(296),a=r(1482),o=r(2581);function u(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
1t%2?u(Object(r),!0).forEach(function(t){(0,i.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):u(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var p,d={findPricePerDevice:function(e,t){if(null==e||!e.length)return 0;for(var r=0;r<e.length;r++){var i;if(t<e[r][0])return(null===(i=e[r-1])||void 0===i?void 0:i[1])||e[0][1]}return e[e.length-1][1]},formatPrice:function(e,t){var r=t.currencySymbol,i=t.priceFormat,n=t.decimalSeparator,s=t.thousandSeparator,a=t.precision,o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],u=Number.isFinite(Number(a))?Number(a):2,l=Math.pow(10,u),p=(Math.round(e*l)/l).toFixed(u).split("."),d=(0,c.A)(p,2),b=d[0],m=d[1],f=b.replace(/\B(?=(\d{3})+(?!\d))/g,s),h=m?"".concat(f).concat(n).concat(m):f;return o?i?i.replace("#p",function(){return h}).replace("#c",function(){return r}):"".concat(r).concat(h):h},calculatePricing:function(e,t,r){var i=e.currencySymbol,n=e.decimalSeparator,s=e.discountAsNumber,c=e.maintenance,a=e.precision,o=e.priceFormat,u=e.prices,l=e.futurePrices,p={currencySymbol:i,decimalSeparator:n,thousandSeparator:e.thousandSeparator,precision:a,priceFormat:o},b="true"===e.useInstallments?3:1,m=s?Number(s):0,f=c?Number(c)/12:1,h=d.findPricePerDevice(u,t),v=h*(1-m),y=h/f,g=v/f,P=h*t/b,S=v*t/b,w=d.findPricePerDevice(l,t)*t/b,N=r>0?Math.round((m>0?S:P)/r/f*10)/10:0;return{pricePerDevicePerYearWithCurrency:d.formatPrice(y,p,!0),pricePerDevicePerYearDiscountedWithCurrency:d.formatPrice(g,p,!0),totalPrice:d.formatPrice(P,p),totalPriceDiscounted:d.formatPrice(S,p),totalFuturePriceWithCurrency:d.formatPrice(w,p,!0),fakePricePerDeviceWithCurrency:d.formatPrice(N,p,!0),buyUrl:d.buildBuyUrl(e,t)}},buildBuyUrl:function(e,t){var r=e.link,i=e.productId;return r.replace("{PID}",i).replace("{QUANT}",t).replace(/\{[a-zA-Z]+\}/g,"")}},b=(p=new DOMParser,function(e){return e?p.parseFromString(e,"text/html").body.innerHTML||"":e}),m=function(){return(0,s.A)(function e(t){(0,n.A)(this,e),this.element=t,this.sessionId=t.dataset.sessionId,this.storage=(0,a.z)(this.sessionId),this.entitlements={},this.init()},[{key:"init",value:function(){try{this.loadEntitlements(),this.setupForm(),this.bindEvents(),this.restoreFromStorage(),this.updatePricing(),this.setupVerticalPricingWatcher(),window.addEventListener("smbpb:sync",this.onExternalSync.bind(this)),this.element.classList.remove("c-smbpb--nojs")}catch(e){console.error("SMB PriceBox init failed:",e),this.showError("Component initialization failed")}}},{key:"loadEntitlements",value:function(){var e=this.element.parentElement.querySelector('template[type="entitlements"]'),t=JSON.parse(e.content.childNodes[0].nodeValue.replaceAll(/\n/g,""));this.entitlements=t.reduce(function(e,t){var r,i=l(l(l({},t),t.productJsonString),{},{basePriceNote:""});if(i.instructions=b(i.instructions),i.priceNote=b(i.priceNote),i.discountLabelText=i.discountAsNumber>0?b(i.discountLabelText):"",i.subscriptionText=b(i.subscriptionText),i.billingText=b(i.billingText),i.vatText=b(i.vatText),r=i.discountAsNumber>0?(null==i?void 0:i["basePriceNote".concat(i.maintenance)])||"":i.basePriceNoteUndiscounted||"",i.basePriceNote=b(r),i.prices&&"string"==typeof i.prices&&""!==i.prices.trim())try{i.prices=Object.entries(JSON.parse(i.prices)).map(function(e){var t=(0,c.A)(e,2),r=t[0],i=t[1];return[Number(r),Number(i)]}).sort(function(e,t){return e[0]-t[0]})}catch(n){console.warn("Failed to parse prices for entitlement",i.sku,n),i.prices=[]}else i.prices=[];if(i.futurePrices&&"string"==typeof i.futurePrices&&""!==i.futurePrices.trim())try{i.futurePrices=Object.entries(JSON.parse(i.futurePrices)).map(function(e){var t=(0,c.A)(e,2),r=t[0],i=t[1];return[Number(r),Number(i)]}).sort(function(e,t){return e[0]-t[0]})}catch(n){console.warn("Failed to parse future prices for entitlement",i.sku,n),i.futurePrices=[]}else i.futurePrices=[];return e[i.sku]=i,e},{})}},{key:"setupForm",value:function(){var e=this.element.id;this.devicesInput=this.element.querySelector('[name="'.concat(e,'-devices-select"]')),this.fakeDevicesInput
1=this.element.querySelector('[name="'.concat(e,'-devices-select-mock"]')),this.minDevices=Number(this.devicesInput.min),this.maxDevices=Number(this.devicesInput.max),this.yearsSelect=this.element.querySelector('[name="'.concat(e,'-years-select"]')),this.button=this.element.querySelector('[data-placeholder="cta"] a');var t=Object.values(this.entitlements)[0];this.devicesInput&&t&&(this.devicesInput.value||(this.devicesInput.value=t.minQuantity))}},{key:"bindEvents",value:function(){var e,t;null===(e=this.devicesInput)||void 0===e||e.addEventListener("input",this.onDevicesChange.bind(this)),null===(t=this.yearsSelect)||void 0===t||t.addEventListener("change",this.onYearsChange.bind(this))}},{key:"onDevicesChange",value:function(e){var t=Number(e.target.value),r=Number(e.target.min);isNaN(t)&&(e.target.value=r),this.saveToStorage(),this.updatePricing(),this.runVerticalPriceLayoutDetection()}},{key:"onYearsChange",value:function(){this.saveToStorage(),this.updatePricing(),this.runVerticalPriceLayoutDetection()}},{key:"runVerticalPriceLayoutDetection",value:function(){var e=this.element.querySelector(".c-price");e&&(0,o.r)(e)}},{key:"saveToStorage",value:function(){var e={devices:Number(this.devicesInput.value),sku:this.yearsSelect.value};this.storage.set(e)}},{key:"restoreFromStorage",value:function(){var e=this.storage.get();void 0!==e.devices&&null!==e.devices&&(this.devicesInput.value=e.devices),e.sku&&(this.yearsSelect.value=e.sku)}},{key:"buildSubscriptionNote",value:function(e,t){var r=e.discountAsNumber>0,i=1===Number(e.vat),n=[],s=function(e){return e?'<span class="info-wrap"><span class="info-text">'.concat(e,'</span>&nbsp;<span class="info-icon"></span></span>'):""};if(r){var c=e.billingText;c&&t&&(c=c.replace(/\{full_price\}/g,function(){return t.totalFuturePriceWithCurrency})),i?(n.push(e.vatText),n.push(c),n.push(s(e.subscriptionText))):(n.push(c),n.push(s(e.subscriptionText)))}else i?(n.push(e.vatText),n.push(s(e.subscriptionText))):n.push(s(e.subscriptionText));return n.filter(function(e){return e&&e.trim()}).join(" ")}},{key:"onExternalSync",value:function(e){e.detail.sessionId===this.sessionId&&(this.restoreFromStorage(),this.updatePricing())}},{key:"updateContent",value:function(e,t){var r,i,n=this.element.querySelector(e);n&&(t?(n.innerHTML=t,null===(r=n.parentElement)||void 0===r||r.classList.remove("c-smbpb--hide-slot")):(n.textContent="",null===(i=n.parentElement)||void 0===i||i.classList.add("c-smbpb--hide-slot")))}},{key:"updateDiscountLabelStyle",value:function(e,t){var r=this.element.querySelector(e);if(r)if(t)r.classList.remove(r.dataset.cmpStyle),r.classList.add(t),r.dataset.lastStyle=t;else{r.classList.add(r.dataset.cmpStyle);var i=r.dataset.lastStyle;i&&r.classList.remove(i)}}},{key:"updatePricing",value:function(){var e,t,r=Number(this.devicesInput.value),i=Number((null===(e=this.fakeDevicesInput)||void 0===e?void 0:e.value)||0),n=this.yearsSelect.value,s=this.entitlements[n];if(s){var c,a;if(1===Object.keys(this.entitlements).length?null===(c=this.yearsSelect.closest(".c-smbpb__select-set"))||void 0===c||c.classList.add("c-smbpb--hide-slot"):null===(a=this.yearsSelect.closest(".c-smbpb__select-set"))||void 0===a||a.classList.remove("c-smbpb--hide-slot"),this.updateContent('[data-placeholder="instructions"]',s.instructions),this.updateContent('[data-placeholder="priceNote"]',s.priceNote),this.updateContent('[data-placeholder="discountLabel"]',s.discountLabelText),this.updateDiscountLabelStyle('[data-placeholder="discountLabel"]',s.discountLabelStyle),r<this.minDevices||r>this.maxDevices){var o,u=this.element.querySelector(".c-smbpb__device-limit"),l=(u?u.innerHTML:"Select {min}-{max} devices").replace("{min}",this.minDevices).replace("{max}",this.maxDevices);return this.showError(l),void(null===(o=this.button)||void 0===o||o.setAttribute("disabled","disabled"))}this.hideError(),null===(t=this.button)||void 0===t||t.removeAttribute("disabled");var p=d.calculatePricing(s,r,i);this.updateCTAButton(p.buyUrl,s,p,r),this.updatePriceDisplay(p,s)}}},{key:"updateCTAButton",value:function(e,t,r,i){if(this.button){var n=t.sku.includes("-")?t.sku.split("-").slice(0,2).join("-"):t.sku;this.button.href=e,this.button.dataset.productId=n,this.button.dataset.quantity=i,this.button.dataset.campaign=t.campaignCode,this.button.dataset.maintenance=t.maintenance,this.button.dataset.currency=t.currency,this.button.dataset.price=t.discountAsNumber>0?r.totalPriceDiscounted:r.totalPrice}}},{key:"updatePriceDisplay",value:function(e,t){var r=this.element.querySelector('[data-placeholder="fullPrice"]'),i=this.element.querySelector(".c-price__full"),n=this.element.querySelector('[data-placeholder="actualPrice"]'),s=this.element.querySelector('[data-placeholder="pricePeriod"]'),c=this.element.querySelector('[data-placeholder="basePriceNote"]');if("show"==this.element.dataset.pricing&&this.updateContent('[data-placeholder="subscriptionNote"]',this.buildSubscriptionNote(t,e)),r&&t.discountAsNumber>0?(r.innerHTML=b(e.totalPrice),i.classList.remove("c-smbpb--hide-slot")):r&&(r.innerHTML="",i.classList.add("c-smbpb--hide-slot")),n&&(n.innerHTML=b(t.discountAsNumber>0?e.totalPriceDiscounted:e.totalPrice)),s&&(s.innerHTML=t.pricePeriod),c){var a;a=c.hasAttribute("data-use-mock")?e.fakePricePerDeviceWithCurrency:t.discountAsNumber>0?e.pricePerDevicePerYearDiscountedWithCurrency:e.pricePerDevicePerYearWithCurrency,c.innerHTML=t.basePriceNote.replace(/\{base-price\}/g,function(){return b(a)})}}},{key:"showError",value:function(e){var t=this.element.querySelector(".c-smbpb__device-limit");t&&(t.innerHTML=b(e)),this.element.classList.add("c-smbpb--alert")}},{key:"hideError",value:function(){this.element.classList.remove("c-smbpb--alert")}},{key:"setupVerticalPricingWatcher",value:function(){this._verticalPricingCleanup=(0,o.l)(this.element)}},{key:"destroy",value:function(){var e;null===(e=this._verticalPricingCleanup)||void 0===e||e.call(this)}}])}();window.aCompUtils.onDomLoad(function(){document.querySelectorAll('.c-smbpb[data-pricing="show"]').forEach(function(e){new m(e)})})},7800:function(e,t,r){r.d(t,{A:function(){return n}});var i=r(3145);function n(e,t){if(e){if("string"==typeof e)return(0,i.A)(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?(0,i.A)(e,t):void 0}}}},function(e){e(e.s=6844)}]);

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.