@claspo/components 1.10.28-pnc1 → 1.10.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- const t={DESKTOP:"desktop",MOBILE:"mobile"};function e(e){return Object.values(t).map(t=>({type:"GROUP",propPath:["adaptiveStyles",t],children:e}))}const n="cl-";function o(t){return n+t}function r(t){return"cl-"+t}function i(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find(t=>t.element===n)}function s(t=[]){return t.map(t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)}))}const a={name:"SysConsentComponent",componentType:"CONSENT",version:"1.0.0",contextMenuModel:e([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:e([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{height:{hide:!0}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:e([{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"label"}]},{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"label",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!0}]},{type:"CONTROL",name:"MULTIPLE_INPUT_SIZE",element:"input",params:{inputType:"CHECKBOX"}},{type:"CONTROL",name:"BACKGROUND",element:"input",elementProp:"markerStyleAttributes",params:{label:"DOCUMENT_CHECKBOX_BACKGROUND_DEFAULT_TITLE",property:"defaultBackground"}},{type:"CONTROL",name:"BACKGROUND",element:"input",elementProp:"markerStyleAttributes",params:{label:"DOCUMENT_CHECKBOX_BACKGROUND_SELECTED_TITLE",property:"selectedBackground"}},{type:"CONTROL",name:"BORDERS",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"BOX_SHADOW",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}])},events:{dispatch:[],listen:[]},i18nPropPaths:["content,label"],i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"text",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!1}]}]},i18n:{en:{"control,validation,validationErrors,REQUIRED":"Accept consent to subscribe","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},ru:{"control,validation,validationErrors,REQUIRED":"Примите соглашение для подписки","content,label":'Я даю согласие на обработку своих персональных данных и ознакомлен с <a href="https://example.com/termsofuse" target="_blank">условиями использования сервиса</a>'},uk:{"control,validation,validationErrors,REQUIRED":"Прийміть угоду для підписки","content,label":'Я даю згоду на обробку своїх персональних даних та ознайомлений з <a href="https://example.com/termsofuse" target="_blank">умовами використання сервісу</a>'},es:{"control,validation,validationErrors,REQUIRED":"Aceptar el consentimiento para suscribirse","content,label":'Doy mi consentimiento para el procesamiento de mis datos personales y he leído y acepto los <a href="https://example.com/termsofuse" target="_blank">Términos de uso</a>'},de:{"control,validation,validationErrors,REQUIRED":"Zustimmung zum Abonnement akzeptieren","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},fr:{"control,validation,validationErrors,REQUIRED":"Accepter le consentement pour s'abonner","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},it:{"control,validation,validationErrors,REQUIRED":"Accetti il consenso per iscriversi","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},pt:{"control,validation,validationErrors,REQUIRED":"Aceitar consentimento para subscrever","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},ro:{"control,validation,validationErrors,REQUIRED":"Acceptați consimțământul pentru abonare","content,label":'Sunt de acord cu prelucrarea datelor mele personale și am citit și accept <a href="https://example.com/termsofuse" target="_blank">Termenii de utilizare</a>'},bg:{"control,validation,validationErrors,REQUIRED":"Приемете съгласието, за да се абонирате","content,label":'Съгласен съм с обработката на личните ми данни и прочетох и приемам <a href="https://example.com/termsofuse" target="_blank">Условията за ползване</a>'},cs:{"control,validation,validationErrors,REQUIRED":"Pro odběr přijměte souhlas","content,label":'Souhlasím se zpracováním mých osobních údajů a přečetl jsem si a přijímám <a href="https://example.com/termsofuse" target="_blank">Podmínky použití</a>'},el:{"control,validation,validationErrors,REQUIRED":"Αποδέχεστε τη συναίνεση στην εγγραφή","content,label":'Συναινώ στην επεξεργασία των προσωπικών μου δεδομένων και έχω διαβάσει και αποδέχομαι τους <a href="https://example.com/termsofuse" target="_blank">Όρους Χρήσης</a>'},nl:{"control,validation,validationErrors,REQUIRED":"Accepteer toestemming om u te abonneren","content,label":'Jeg giver samtykke til behandlingen af mine personlige data, og jeg har læst og accepterer <a href="https://example.com/termsofuse" target="_blank">Brugervilkår</a>'},pl:{"control,validation,validationErrors,REQUIRED":"Wyraź zgodę, aby zasubskrybować","content,label":'Wyrażam zgodę na przetwarzanie moich danych osobowych oraz zapoznałem się i akceptuję <a href="https://example.com/termsofuse" target="_blank">Warunki użytkowania</a>'},sv:{"control,validation,validationErrors,REQUIRED":"Acceptera samtycke för att prenumerera","content,label":'Jag samtycker till behandlingen av mina personuppgifter och jag har läst och accepterar <a href="https://example.com/termsofuse" target="_blank">Användarvillkor</a>'},tr:{"control,validation,validationErrors,REQUIRED":"Abone olmak için onayı kabul edin","content,label":'Kişisel verilerimin işlenmesine izin veriyorum ve <a href="https://example.com/termsofuse" target="_blank">Kullanım Koşulları</a>\'nı okudum ve kabul ediyorum.'},ar:{"control,validation,validationErrors,REQUIRED":"قبول الموافقة على الاشتراك","content,label":'أوافق على معالجة بياناتي الشخصية وقد قرأت وأوافق على <a href="https://example.com/termsofuse" target="_blank"> شروط الاستخدام </a>'},zh:{"control,validation,validationErrors,REQUIRED":"接受同意订阅","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},da:{"control,validation,validationErrors,REQUIRED":"Accepter samtykke til at abonnere","content,label":'Jeg giver samtykke til behandlingen af ​​mine personoplysninger, og jeg har læst og accepterer <a href="https://example.com/termsofuse" target="_blank">Vilkår for brug</a>'},he:{"control,validation,validationErrors,REQUIRED":"קבלו הסכמה להירשם","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},fi:{"control,validation,validationErrors,REQUIRED":"Anna suostumus tilaukseen","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},hi:{"control,validation,validationErrors,REQUIRED":"सदस्यता लेने के लिए सहमति स्वीकार करें","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},hr:{"control,validation,validationErrors,REQUIRED":"Prihvatite privolu za pretplatu","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},hu:{"control,validation,validationErrors,REQUIRED":"Az előfizetéshez való hozzájárulás elfogadása","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},id:{"control,validation,validationErrors,REQUIRED":"Terima persetujuan untuk berlangganan","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},ja:{"control,validation,validationErrors,REQUIRED":"サブスクリプションへの同意を承諾","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},ko:{"control,validation,validationErrors,REQUIRED":"구독하려면 동의 수락","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},no:{"control,validation,validationErrors,REQUIRED":"Godta samtykke for å abonnere","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},sk:{"control,validation,validationErrors,REQUIRED":"Udeľte súhlas s odberom","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},sl:{"control,validation,validationErrors,REQUIRED":"Sprejmite soglasje za naročnino","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},sr:{"control,validation,validationErrors,REQUIRED":"Prihvatite saglasnost za pretplatu","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'}},props:{content:{label:'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},control:{name:"consentId",defaultValue:!1,validation:{required:!0,validationErrors:{REQUIRED:"Accept consent to subscribe"}}},adaptiveStyles:(l=[{element:"host",styleAttributes:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,width:"100%",minWidth:null,height:"auto",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"input",styleAttributes:{borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"rgb(68, 68, 68)",borderBottomWidth:"1px",borderBottomColor:"rgb(68, 68, 68)",borderLeftWidth:"1px",borderLeftColor:"rgb(68, 68, 68)",borderRightWidth:"1px",borderRightColor:"rgb(68, 68, 68)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},markerStyleAttributes:{inputSize:"22px",inputToTextGapSize:"13px",defaultBackground:"rgb(255, 255, 255)",selectedBackground:"var(--cl-schema-accent, rgb(255, 255, 255))"},classes:""},{element:"label",styleAttributes:{color:"var(--cl-schema-text, rgb(68, 68, 68))",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"14px",textShadow:"none"},classes:""}],Object.values(t).reduce((t,e)=>Object.assign(t,{[e]:s(l)}),{desktop:[],mobile:[]}))},metaDescription:{icon:"/SysConsentComponent/assets/img/component-icon.svg",label:{en:"Data processing and terms of use",ru:"Обработка данных и условия использования",uk:"Обробка даних та умови використання",es:"Tratamiento de datos y condiciones de uso",fr:"Traitement des données et conditions d'utilisation",de:"Datenverarbeitung und Nutzungsbedingungen",it:"Trattamento dei dati e condizioni d'uso",pt:"Processamento de dados e termos de utilização",ro:"Prelucrarea datelor și condițiile de utilizare",bg:"Обработка на данни и условия за ползване",cs:"Zpracování dat a podmínky použití",el:"Επεξεργασία δεδομένων και όροι χρήσης",nl:"Gegevensverwerking en gebruiksvoorwaarden",pl:"Przetwarzanie danych i warunki użytkowania",sv:"Databehandling och användarvillkor",tr:"Veri işleme ve kullanım koşulları",ar:"معالجة البيانات وشروط الاستخدام",zh:"数据处理和使用条款",da:"Databehandling og brugsbetingelser",he:"עיבוד נתונים ותנאי השימוש"}},syncEnabled:!0,stylesImitationEnabled:!0};var l;const c="validationStatusChanged",d="touchedStatusChanged";class h{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){var e;const n=t||document;return Math.max(n.documentElement.clientWidth,(null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)}static height(t){var e;const n=t||document;return Math.max(n.documentElement.clientHeight,(null===(e=n.defaultView)||void 0===e?void 0:e.innerHeight)||0)}static scrollbarWidth(t){var e;const n=t||document;return((null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)-n.documentElement.clientWidth}}function u(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}var p=Array.prototype.concat,m=Array.prototype.slice,g=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var r=t[n];u(r)?e=p.call(e,m.call(r)):e.push(r)}return e};g.wrap=function(t){return function(){return t(g(arguments))}};const b=g;var f={},v=Object.hasOwnProperty,y=Object.create(null);for(var E in f)v.call(f,E)&&(y[f[E]]=E);var O={to:{},get:{}};function S(t,e,n){return Math.min(Math.max(e,t),n)}O.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=O.get.hsl(t),n="hsl"):(e=O.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},O.get.rgb=function(t){if(!t)return null;var e,n,o,r=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var i=2*n;r[n]=parseInt(e.slice(i,i+2),16)}o&&(r[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)r[n]=parseInt(e[n]+e[n],16);o&&(r[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(e[n+1],0);e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:v.call(f,e[1])?((r=f[e[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?r[3]=.01*parseFloat(e[4]):r[3]=parseFloat(e[4]))}for(n=0;n<3;n++)r[n]=S(r[n],0,255);return r[3]=S(r[3],0,1),r},O.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,S(parseFloat(e[2]),0,100),S(parseFloat(e[3]),0,100),S(isNaN(n)?1:n,0,1)]}return null},O.to.rgb=function(){var t=b(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},O.to.hsl=function(){var t=b(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const T=O,k={},A={};for(const t of Object.keys(k))A[k[t]]=t;const C={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(C)){if(!("channels"in C[t]))throw new Error("missing channels property: "+t);if(!("labels"in C[t]))throw new Error("missing channel labels property: "+t);if(C[t].labels.length!==C[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=C[t];delete C[t].channels,delete C[t].labels,Object.defineProperty(C[t],"channels",{value:e}),Object.defineProperty(C[t],"labels",{value:n})}C.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,r=Math.min(e,n,o),i=Math.max(e,n,o),s=i-r;let a,l;i===r?a=0:e===i?a=(n-o)/s:n===i?a=2+(o-e)/s:o===i&&(a=4+(e-n)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(r+i)/2;return l=i===r?0:c<=.5?s/(i+r):s/(2-i-r),[a,100*l,100*c]},C.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let r,i,s;if(0===n)return s=255*o,[s,s,s];r=o<.5?o*(1+n):o+n-o*n;const a=2*o-r,l=[0,0,0];for(let t=0;t<3;t++)i=e+1/3*-(t-1),i<0&&i++,i>1&&i--,s=6*i<1?a+6*(r-a)*i:2*i<1?r:3*i<2?a+(r-a)*(2/3-i)*6:a,l[t]=255*s;return l};const R=C;function _(t,e){return function(n){return e(t(n))}}function x(t,e){const n=[e[t].parent,t];let o=R[e[t].parent][t],r=e[t].parent;for(;e[r].parent;)n.unshift(e[r].parent),o=_(R[e[r].parent][r],o),r=e[r].parent;return o.conversion=n,o}const I={};Object.keys(R).forEach(t=>{I[t]={},Object.defineProperty(I[t],"channels",{value:R[t].channels}),Object.defineProperty(I[t],"labels",{value:R[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(R);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(R[t]);for(let r=o.length,i=0;i<r;i++){const r=o[i],s=e[r];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(r))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,r=0;r<t;r++){const t=o[r];null!==e[t].parent&&(n[t]=x(t,e))}return n}(t);Object.keys(e).forEach(n=>{const o=e[n];I[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),I[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)})});const w=I,L=["keyword","gray","hex"],N={};for(const t of Object.keys(w))N[[...w[t].labels].sort().join("")]=t;const P={};function M(t,e){if(!(this instanceof M))return new M(t,e);if(e&&e in L&&(e=null),e&&!(e in w))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof M)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=T.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=w[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=w[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=D(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in N))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=N[o];const{labels:r}=w[this.model],i=[];for(n=0;n<r.length;n++)i.push(t[r[n]]);this.color=D(i)}if(P[this.model])for(o=w[this.model].channels,n=0;n<o;n++){const t=P[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}M.prototype={toString(){return this.string()},string(t){let e=this.model in T.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return T.to[e.model](n)},round(t){return t=Math.max(t||0,0),new M([...this.color.map(j(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new M([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(w)){if(L.includes(t))continue;const{channels:e}=w[t];M.prototype[t]=function(...e){return this.model===t?new M(this):e.length>0?new M(e,t):new M([...U(w[this.model][t].raw(this.color)),this.valpha],t)},M[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=D(n,e)),new M(o,t)}}function j(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function U(t){return Array.isArray(t)?t:[t]}function D(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const B=M;function F(t,e){Object.keys(e).forEach(n=>{t.style[n]=e[n]})}function V(t,e,n){const o=function(t,e){let n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("var(")&&(n=function(t){const e=String(t).match(/var\([^,]+,\s*(rgb(?:a)?\([^)]+\))\)/);return e&&e[1]?e[1]:null}(n)||void 0),n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=B(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function W(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:r,marginLeft:i,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(i,10)+parseInt(s,10),height:n+parseInt(r,10)+parseInt(o,10)}}function z(t,e,n,o,r){switch(t.position){case"top":return{left:`${H(e,n,o,r)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${H(e,n,o,r)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${$(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${$(0,t)}px`}}}function H(t,e,n,o){let r=n?t.x+t.width/2-e.width/2:t.x;return r<0&&(r=0),r+e.width>h.width(o)&&(r-=r+e.width-h.width(o)),r}function $(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function G(t){const{element:e,html:n,appendHtml:o}=t,r=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach(e=>t.removeAttribute(e)),Array.from(t.attributes).forEach(e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)}),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}}),e.body.innerHTML}(n);o?e.innerHTML+=r:e.innerHTML=r}const Q="cl-tooltip-text-styles",K=`\n .cl-tooltip-text {\n z-index: ${Number.MAX_SAFE_INTEGER};\n width: max-content;\n height: fit-content;\n visibility: hidden;\n background-color: white;\n color: #000;\n border: 1px solid rgb(194, 194, 194);\n border-radius: 5px;\n padding: 5px 10px;\n position: fixed;\n max-width: 300px;\n max-height: 100vh;\n box-shadow: 0 1px 5px rgba(0,0,0,.28);\n font-size: 14px;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:before {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 13px);\n border-width: 12px;\n border-style: solid;\n border-color: rgb(194, 194, 194) transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:after {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:before {\n content: "";\n position: absolute;\n top: -24px;\n left: calc(50% - 9px);\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent rgb(194, 194, 194) transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:after {\n content: "";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n`;function q(t,e,n,o){o=o||document;let r=null;t&&(t.classList.add("invalid"),t.setAttribute("aria-invalid","true")),e&&(e.style.visibility="visible"),e&&(e.onmouseenter=()=>{(function(t){if((t=t||document).head.querySelector(`#${Q}`))return;const e=document.createElement("style");e.setAttribute("id",Q),G({element:e,html:K}),t.head.appendChild(e)})(o),r=function(t){const e="cl-overlay-tooltip-text",n=document.getElementById(e)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==t&&(n.textContent=t,n.style=null),n.id||(n.id=e),n}(n),o.body.append(r),r.style.visibility="visible",function(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:r}=t,i=function(t,e,n,o,r,i){const s=function(t,e,n,o,r){const i=function(t,e,n,o){const r=h.width(o),{right:i}=t.getBoundingClientRect(),s=r-n-i-h.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:W(e).width,availableSpaceToTheLeftSideOfTheTrigger:i-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,r),s=function(t,e,n,o){const r=h.height(o),{top:i,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:W(e).height,availableSpaceAboveTriggerElem:i-n,availableSpaceBelowTriggerElem:r-s-n}}(t,e,n,r);let a="undefined";const l={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:i.availableSpaceToTheRightSideOfTheTrigger>=i.contentWidth,left:i.availableSpaceToTheLeftSideOfTheTrigger>=i.contentWidth};if(l.top?a="top":l.bottom?a="bottom":l.right?a="right":l.left&&(a="left"),o&&l[o]&&(a=o),"undefined"===a){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,i.availableSpaceToTheRightSideOfTheTrigger,i.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?a="bottom":t===s.availableSpaceAboveTriggerElem?a="top":t===i.availableSpaceToTheRightSideOfTheTrigger?a="right":t===i.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},s),i),{position:a})}(t,e,n,o,i=i||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)F(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),F(e,{"margin-bottom":"0px"});else if("bottom"===t.position)F(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),F(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";F(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:z(s,t.getBoundingClientRect(),e.getBoundingClientRect(),r,i),position:s.position}}(e,n,o,"top",!0,r);n.setAttribute("cl-tooltip-position",i.position),F(n,i.coordinates)}({triggerElement:e,tooltipElement:r,htmlDocumentObject:o})},e.onmouseleave=()=>{r&&(r.remove(),function(t){const e=(t=t||document).head.querySelector(`#${Q}`);e&&e.remove()}(o))})}function J(t){return[t.getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter(t=>!!t)}function X(t,e){return e.reduce((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null},null)}const Y="VIEW",Z="CONTAINER",tt="INPUT",et="BUTTON",nt="CONSENT",ot="COLUMN";var rt,it;(it=rt||(rt={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",it.REQUEST="REQUEST",it.DISPATCH_EVENT="DISPATCH_EVENT",it.GO_TO_VIEW="GO_TO_VIEW",it.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",it.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",it.SHOW_WIDGET="SHOW_WIDGET",it.OPEN_LINK="OPEN_LINK",it.CLOSE_WIDGET="CLOSE_WIDGET",it.CLICK="CLICK";const st=rt;var at,lt;class ct{static sortActions(t){const e={[st.CLOSE_WIDGET]:-1,[st.OPEN_LINK]:-2,[st.SHOW_WIDGET]:1,[st.SUBSCRIBE_CONTACT]:2,[st.REQUEST]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0)}constructor(t,e){this.config=t,this.actions=ct.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,n){this.state=t;const o=n(),i=o.getAttribute(r("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,i)}),this.listener=t=>{const e=t.composedPath().filter(t=>t instanceof HTMLElement&&t.getAttribute(r("type")));let n=0;for(;e[n]&&e[n].getAttribute(r("id"))!==i;){let t=e[n].getAttribute(r("type"));if(ct.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;n++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach(t=>{t.addEventListener("click",this.listener)})}async execute(){var t,e,n,o;try{for(var r,i=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise(function(o,r){!function(t,e,n,o){Promise.resolve(o).then(function(e){t({value:e,done:n})},e)}(o,r,(e=t[n](e)).done,e.value)})}}}(this.eventsQueue);!(t=(r=await s.next()).done);i=!0){o=r.value,i=!1;const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{i||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach(t=>{t.removeEventListener("click",this.listener)}),this.targetElements=[])}}ct.IGNORING_VIEW_ENTRY_TYPES=[et,nt,tt],(lt=at||(at={})).CLICK="CLICK",lt.COMPONENT_EVENT="COMPONENT_EVENT";class dt{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,n){var o;const i=null===(o=n())||void 0===o?void 0:o.getAttribute(r("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,i)}),this.componentEmitterListener=e.on(this.config.eventName,()=>{this.actions.forEach(e=>e.execute(t.getState(),this.config.params))})}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class ht{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map(t=>this.actionFactory.get(t));switch(e.forEach(t=>this.actionRegister.register(t)),t.type){case at.CLICK:return new ct(t,e);case at.COMPONENT_EVENT:return new dt(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class ut{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class pt{constructor(){this.listeners=pt.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach(o=>o(e,t,n)),Object.values(this.listeners["*"]).forEach(o=>o(e,t,n))}on(t,e){const n=ut.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=pt.createDefaultListenersState()}}pt.createDefaultListenersState=()=>({"*":{}});const mt=pt,gt=(t,e,n,o)=>{const r=EventTarget.prototype,{addEventListenerBase:i,addEventListener:s}=r;(i||s).call(t,e,n,o)};class bt{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class ft extends mt{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",({isMobileEnv:t})=>{this._isMobile=t,this.emit(ft.changeEventName,this._isMobile)})}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(ft.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(ft.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}ft.changeEventName="CHANGE";const vt=ft;class yt{static set(t,e){const n=t[yt.accumulatorPropertyName]||{};t[yt.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[yt.accumulatorPropertyName]).forEach(n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""})}}yt.accumulatorPropertyName="clStyleAttributes";const Et=yt;var Ot,St;(St=Ot||(Ot={})).BUILT_IN="BUILT_IN",St.DETACHED="DETACHED",St.FLOATING_BOX="FLOATING_BOX",St.FLOATING_BAR="FLOATING_BAR",St.LAUNCHER="LAUNCHER",St.CONTENT_LOCKER="CONTENT_LOCKER";class Tt{static applyHostStyles(t,e,n=null,o){var r,i,s;const a=null===(i=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find(t=>"CLICK"===t.type);a&&(null===(s=a.actions)||void 0===s?void 0:s.length)&&(e.style.cursor="pointer"),t!==Y&&t!==Z&&t!==ot||(e.style.display=o===Ot.CONTENT_LOCKER&&t===Y?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class kt{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class At{constructor(t,e,n,o,r,i){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach(n=>{var o,r,i,s,a;const l=null===(r=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===r?void 0:r.find(t=>t.element===n),c=(null===(i=e.styles)||void 0===i?void 0:i.find(t=>t.element===n))||{},d=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})}),Promise.all([...this.envUrlMaps[t].entries()].map(([e,n])=>this.httpClient.execute({url:n.originalSVGResourceURL}).then(t=>t.text()).then(o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))).then(()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)}).catch(t=>{console.error(t),kt.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)})}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)}),this.themeSubscription=this.documentModel.on("THEME_UPDATE",t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)}),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let o=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach(t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var r;o=o.replace(`var(--${r=n,`cl-schema-${r}`})`,e[n])}),`url('data:image/svg+xml,${encodeURIComponent(o)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const Ct=new class{execute({url:t,method:e="GET",body:n=null,headers:o,abortSignal:r}){const i={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,i)}};function Rt(t,e){return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})}class _t{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,t=>"_"+t).toUpperCase()}}class xt{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var It;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",t.LEAD_PROGRESS="LEAD_PROGRESS"}(It||(It={}));const wt=It;class Lt{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(wt.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(wt.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new xt(this.onCounterStateUpdate)}}}const Nt=(...t)=>{let e=t.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:[]}),{});return{get:t=>e[t],clear:()=>Nt(...t)}},Pt=Nt,Mt="props",jt="shared",Ut="environment";function Dt(t,e,n,o){const r=t=>{let i=function(t){return t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host||null:t}(t);return i&&(o&&"function"==typeof o?o(i.getAttribute(e)):(null===(s=null==i?void 0:i.getAttribute)||void 0===s?void 0:s.call(i,e))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var s};return r(t)}const Bt="SUBMIT";function Ft(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach(n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o}),t):t}const Vt=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class Wt extends Vt{constructor(t,e={},n){super(t,Object.assign(Object.assign({},n),{detail:e}))}}var zt,Ht,$t;function Gt(t){if(null!=t&&""!==t)return"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t)}!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(zt||(zt={})),($t=Ht||(Ht={})).STATIC="STATIC",$t.DATA_LAYER="DATA_LAYER",$t.URL_QUERY_PARAMS="URL_QUERY_PARAMS",$t.JS_API_VARIABLE="JS_API_VARIABLE",$t.COOKIE="COOKIE",$t.LOCAL_STORAGE="LOCAL_STORAGE";class Qt{constructor(t,e){this.configService=t,this.registry=e}resolveValue(t,e){if(!(null==t?void 0:t.enabled)||!t.sourceType||this.configService.getConfig("renderMode")===zt.UPDATING)return;const n=function(t,e,n,o){if(!e)return;if(e===Ht.STATIC)return Gt(null==n?void 0:n.value);const r=t.getSource(e);if(!r)return;const i=r.getValue(o);return Gt("function"==typeof(null==i?void 0:i.processor)?i.processor(r,Object.assign({id:o},n)):null==i?void 0:i.value)}(this.registry,t.sourceType,t.config,e);if(void 0===n)return;const o=n.trim();return""===o?void 0:o}}class Kt extends HTMLElement{constructor(){var t;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 0,this.construct=()=>{let t;const e=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let s=new Wt("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:e,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=Pt(Mt,jt,Ut),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach(t=>null==t?void 0:t.off())}},this.state=new bt({}),this.componentEventEmitter=new mt,this.componentResourceManager=new Lt(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new ht(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,t=>{this.model.props=t,this.observers.get(Mt).forEach(e=>e(this.prevProps,t)),this.prevProps=t;const e=this.getHostElement(),n=r("floating");t.floating&&!e.getAttribute(n)?e.setAttribute(n,"true"):!t.floating&&e.getAttribute(n)&&e.removeAttribute(n)}),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,t=>{Object.assign(this.model,t)}),this.documentModel.on("SHARED_UPDATE_ALL",()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(jt).forEach(t=>t(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new At(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),Ct),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(vt.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(Ut).forEach(e=>e(this.prevEnvironment,t)),this.prevEnvironment=t})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")}))},this.attachHandlers=()=>{this.getHandlers().map(t=>this._handlerFactory.get(t)).map(t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this))).forEach(t=>t())},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.postpone())},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.release())},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===zt.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===zt.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(Mt).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(jt).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(Ut).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter(t=>!t.hasAttribute(r("component")))],this.getElement=(t,e)=>this.getElements().find(n=>e?n.getAttribute(r("element"))===t&&n.id===e:n.getAttribute(r("element"))===t),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const n=this.getElements();if(!n.length)return;const o=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach(t=>{const e=t.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach(n=>{n.element===e&&(Ft(n,t),o=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===e&&(Ft(n,t),r=!0)}),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))}),n}(t,e),s=r("type"),a="element-styles";let l=this.getRootElement().querySelector(`style[${s}="${a}"]`);l||(l=document.createElement("style"),l.setAttribute(s,a),this.getRootElement().appendChild(l)),G({element:l,html:""}),n.forEach(t=>{let e=t.getAttribute(r("element"));const n=this.getEnvironment();let s=i(o,n,e);if(s){if(this.resizeListener.isMobile()){const t=i(o,"desktop",e);t&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(s),l)}}),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,n)=>{var o,i;const s=[];"host"===(e=Kt._resolveTogglableStylesForElementModel(e)).element&&(Tt.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let a=e.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const t=new Image;t.src=l[1],gt(t,"load",()=>{this.componentResourceManager.getPending().decrement()}),gt(t,"error",()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()})}const c=Object.assign(Object.assign({},e),{styleAttributes:Rt(e.styleAttributes,s)});if(Et.set(t,c),this._setClassAttributes(t,e),n){if(e.hoverStyleAttributes){let o=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),r=`flip-up-animation-${e.element}`;let i=this.getRootElement().querySelector(`#${r}`);i||(i=document.createElement("style"),i.id=r,t.appendChild(i)),G({element:i,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,e.element,o,`:not(.${r("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(n,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(t,e,n)}},this.applySharedClassesToElementModel=t=>function(t,e,o=!1){let r=t;return(r.classes||"").split(" ").filter(t=>t.startsWith(n)).forEach(t=>{var n;const i=null===(n=e.textClasses)||void 0===n?void 0:n[t];if(!i)return;let s=function(t,e){return{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),e?t.mobileStyleAttributes:{}),placeholderStyleAttributes:Object.assign(Object.assign({},t.placeholderStyleAttributes),e?t.mobilePlaceholderStyleAttributes:{})}}(i,o);s.styleAttributes.fontFamily||(i.isHeader&&e.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.headerFontFamily})})),!i.isHeader&&e.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:e.textFontFamily})}))),r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},r.placeholderStyleAttributes),s.placeholderStyleAttributes)})}),r.styleAttributes.fontFamily||(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:e.textFontFamily})})),r}(t,this.documentModel.getShared(),this.resizeListener.isMobile()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,n,o="",i)=>{const s=Object.keys(n).reduce((t,e)=>t+` ${_t.camelCaseToDashCase(e)}: ${n[e]}${i?" !important;":";"}`,"");G({element:t,html:`[${r("element")}="${e}"]${o} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{G({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,r,i;e.linkColor&&G({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&G({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=e.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=e.linkParams)||void 0===i?void 0:i.removeUnderline)&&G({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(t,e)=>{Array.from(t.classList).filter(t=>t!==o("hovered")&&t!==o("focused")).forEach(e=>{e.startsWith(n)&&t.classList.remove(e)});const r=((t.getAttribute("class")||"")+" "+e.classes).trim();t.setAttribute("class",r)},this.getParentComponent=()=>Dt(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(r("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:Dt(this.parentNode,r("path"),void 0,t=>1===(null==t?void 0:t.split(",").length))},this.getWidgetLanguages=()=>J(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>X(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.getAutofillValue=()=>{var t;const e=this.getModel();return new Qt(this.services.config,this.services.context.getRegistry()).resolveValue(null===(t=e.props.control)||void 0===t?void 0:t.autofill,e.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(t,e)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=t?e:void 0,t&&this.services.context.updateRecord(this.getModel().id,{value:e})},this.addContextRecord=()=>{var t,e;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(t=this.getValidatedAutofillValue())&&void 0!==t?t:n.props.control.defaultValue||"",viewIndex:null===(e=n.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.props)}})},this.getContextRecordLabel=t=>{var e,n,o,r,i,s;const a=t.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(r=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find(t=>"label"===t.element))||void 0===o?void 0:o.params)||void 0===r?void 0:r.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(i=t.content)||void 0===i?void 0:i.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(s=t.control)||void 0===s?void 0:s.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find(t=>t.category===Bt);n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:st.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(t=this.constructor.define)||void 0===t?void 0:t.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then(()=>{this.attachHandlers()});const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}Kt._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach(t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=Kt._resolveTogglableStyles(e[t]))}),e},Kt._resolveTogglableStyles=t=>{const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach(t=>{t in e&&(e[t]=e[n]?e[t]:o)}),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const qt=Kt,Jt=Symbol("required");var Xt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(t);r<o.length;r++)e.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(t,o[r])&&(n[o[r]]=t[o[r]])}return n};function Yt(){}const Zt="pending",te="valid",ee="invalid";class ne extends qt{constructor(){super(...arguments),this._createControl=(t={},...e)=>{const{element:n}=t,o=Xt(t,["element"]),r=this.getProps(),i=this.getModel(),s=Object.assign(Object.assign(Object.assign({},r.control),{componentId:i.id,viewIdx:i.path[0]}),o),a=this.getAutofillValue();void 0!==a&&(s.defaultValue=a);const l=this.services.form,c=[s,n,...e],d=l.hasControl(r.control.name)?l.updateControl(...c):l.registerControl(...c);return void 0!==a&&d.getValue()===a&&this._validateAutofilledValue(d),d},this._validateAutofilledValue=t=>{t.validate({silent:!0}).then(e=>{e||t.markAsTouched(),this.syncAutofillContextRecord(e,t.getValue())})},this.createControlWithValidation=(t=[],e={})=>{const{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:r=Yt,invalidCallback:i=Yt,pendingCallback:s=Yt,elementToListen:a=n,validationMap:l={},listenStatusChange:c=!0}=e,d=Xt(e,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!t||!Array.isArray(t))throw new Error("Validators should be an array");const h=this.getProps().control.validation,u=(null==h?void 0:h.validator)?l[h.validator]:void 0,p=t.some(t=>t[Jt]),m=!!(null==h?void 0:h.required),g=m||p,b=[...t];m&&!p&&b.unshift(function(t="REQUIRED"){const e=e=>{let n;switch(typeof e){case"string":n=e&&e.length>0;break;case"boolean":n=e;break;case"number":n=!isNaN(e);break;default:n=!!e}return{isValid:n,errorKey:n?null:t}};return e[Jt]=!0,e}()),u&&b.push(u);const f=this._prepareAsyncValidators(b),v=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,f);return c&&this._handleControlStatusChange(Object.assign({control:v,element:a,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:r,invalidCallback:i,pendingCallback:s},d)),v},this._prepareAsyncValidators=(t=[])=>t.reduce((t,e,n)=>"function"!=typeof e?(console.warn(`Validator ${n} should be a function, so it will be skipped`),t):(t[`custom_${n}`]=async(...t)=>{const n=await Promise.resolve(e(...t));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},t),{}),this._handleControlStatusChange=t=>{t.control.on(c,e=>{this._handleValidationStatus(t,e)}),t.control.on(d,()=>{let e=Zt;switch(!0){case t.control.pending:e=Zt;break;case t.control.valid:e=te;break;default:e=ee}this._handleValidationStatus(t,e)})},this._handleValidationStatus=(t,e)=>{const{control:n,element:o,tooltipElement:r,validCallback:i,invalidCallback:s,errorMessageMapper:a,pendingCallback:l}=t,c=this.services.config,d=this.manifest.i18n;switch(e){case te:(function(t,e){t&&(t.classList.remove("invalid"),t.setAttribute("aria-invalid","false")),e&&(e.style.visibility="hidden")})(o,r),i&&i();break;case ee:if(n.touched){const t=n.getErrorKeys();if(!t)break;const e=t[0];let i=function(t,e,n){const o=X(e,J(t));if(!o)return n;const r=o.translations,i=Object.keys(r).find(t=>t.includes(n));return i?r[i]:n}(c,d,e);a&&(i=a(e,i)),q(o,r,i,this.htmlDocumentObject),s&&s()}break;case Zt:n.touched&&(function(t,e){e&&(e.style.visibility="hidden"),t&&t.classList.contains("invalid")&&(t.classList.remove("invalid"),t.removeAttribute("aria-invalid"))}(o,r),l&&l())}}}}const oe=new Map;oe.set("checkboxSize","inputSize"),oe.set("checkboxToTextGapSize","inputToTextGapSize");const re=oe;function ie(t){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ie(t)}function se(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function ae(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?se(Object(n),!0).forEach(function(e){pe(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):se(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function le(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,me(o.key),o)}}function ce(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ce=function(){return!!t})()}function de(){return de="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=he(t)););return t}(t,e);if(o){var r=Object.getOwnPropertyDescriptor(o,e);return r.get?r.get.call(arguments.length<3?t:n):r.value}},de.apply(null,arguments)}function he(t){return he=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},he(t)}function ue(t,e){return ue=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ue(t,e)}function pe(t,e,n){return(e=me(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function me(t){var e=function(t){if("object"!=ie(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ie(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ie(e)?e:e+""}var ge=function(){function t(){var e;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return pe(e=function(t,e,n){return e=he(e),function(t,e){if(e&&("object"==ie(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ce()?Reflect.construct(e,n||[],he(t).constructor):e.apply(t,n))}(this,t,[].concat(o)),"updateCheckmark",function(t){var n,o=e.getRootElement().querySelector(".checkmark");t?(o.classList.add("checkmark-checked"),n=e.getCheckmarkStyleAttributes("selectedBackground")):(o.classList.remove("checkmark-checked"),n=e.getCheckmarkStyleAttributes("defaultBackground")),o.style.background="".concat(n),o.style["backdrop-filter"]=e.getCheckmarkStyleAttributes("backdropFilter")}),pe(e,"getInputAdaptiveStyles",function(){var t=e.getProps(),n=e.getEnvironment();return t.adaptiveStyles[n].filter(function(t){return"input"===t.element})}),pe(e,"getCheckmarkStyleAttributes",function(t){var n=e.getInputAdaptiveStyles();return n.length&&n[0].markerStyleAttributes?t?n[0].markerStyleAttributes[t]:n[0].markerStyleAttributes:n.length&&n[0].checkmarkStyleAttributes?t?n[0].checkmarkStyleAttributes[t]:n[0].checkmarkStyleAttributes.checkboxSize||n[0].checkmarkStyleAttributes.inputSize?n[0].checkmarkStyleAttributes:ae({inputSize:"22px",inputToTextGapSize:"16px"},n[0].checkmarkStyleAttributes):t?e.defaultCheckmarkStyleAttributes[t]:e.defaultCheckmarkStyleAttributes}),pe(e,"registerLabelControl",function(t){var n=e.getProps(),o="".concat(n.control.name,"_label");if(!e.services.form.hasControl(o)){var r={name:o,defaultValue:t};e.services.form.registerControl(ae(ae({},r),{},{componentId:e.getModel().id,viewIdx:e.getModel().path[0]}),null)}}),pe(e,"setStylesVariables",function(t){var n=e.getCheckmarkStyleAttributes();Object.keys(n).forEach(function(e){var o=re.get(e)||e;t.style.setProperty("--".concat(o),n[e])})}),pe(e,"manifest",a),pe(e,"defaultCheckmarkStyleAttributes",{inputSize:"22px",inputToTextGapSize:"13px",selectedBackground:"rgb(255,255,255)",defaultBackground:"rgb(255,255,255)",backdropFilter:"none"}),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ue(t,e)}(t,ne),function(t,e){return e&&le(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;!function(t,e,n){var o=de(he(t.prototype),"connectedCallback",n);return"function"==typeof o?function(t){return o.apply(n,t)}:o}(t,0,this)([]),this.getRootElement().innerHTML+="\n ".concat('\n<style>\n.main-container {\n height: 100%;\n}\n\n.label-with-input-container {\n height: 100%;\n display: flex;\n flex-direction: row;\n}\n\n.input-with-tooltip {\n position: relative;\n display: flex;\n align-items: baseline;\n height: 100%;\n width: 100%;\n}\n\n.invalid {\n border: 1px solid #ff0000 !important;\n}\n\n.input-tooltip {\n visibility: hidden;\n position: absolute;\n right: -10px;\n top: -10px;\n z-index: 1;\n border-radius: 100%;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Chrome/Safari/Opera */\n -khtml-user-select: none; /* Konqueror */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n}\n\ninput {\n -moz-appearance:none;\n -webkit-appearance:none;\n -o-appearance:none;\n width: 24px;\n height: 24px;\n padding: 0 10px;\n margin: 0;\n}\n\n/* The container */\n.checkmark-container {\n display: block;\n position: relative;\n height: 25px;\n width: 25px;\n cursor: pointer;\n font-size: 22px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n/* Hide the browser\'s default checkbox */\n.checkmark-container input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n/* Create a custom checkbox */\n.checkmark {\n position: absolute;\n top: 0;\n left: 0;\n height: var(--inputSize, 22px);\n width: var(--inputSize, 22px);\n display: flex;\n align-items: center;\n justify-content: center;\n padding-bottom: 2px;\n}\n\n.checkmark:after {\n content: "";\n position: absolute;\n display: none;\n}\n\n.checkmark-checked:after {\n display: block;\n}\n\n.checkmark-container .checkmark:after {\n width: 9px;\n height: 14px;\n border: solid #000000;\n border-width: 0 3px 3px 0;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n}\n\n.label {\n margin: auto auto auto var(--inputToTextGapSize, 18px);\n flex: 1;\n height: auto;\n min-height: 10px;\n}\n\ninput:focus ~ .checkmark.focus-outline-defined {\n outline: var(--clFocusOutline);\n}\n\n</style>\n ','\n <div class="main-container">\n <div class="label-with-input-container">\n <div class="input-with-tooltip">\n <label class="checkmark-container">\n <input type="checkbox"\n name="fname"\n aria-labelledby="cl-consent-label">\n <span cl-element="input" class="checkmark"></span>\n </label>\n <div class="input-tooltip" aria-hidden="true">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label"\n id="cl-consent-label">\n </div>\n </div>\n </div>\n </div>\n ');var n=this.getRootElement(),o=n.querySelector(".checkmark"),r=this.createControlWithValidation([],{element:n.querySelector("input"),validCallback:function(){o.classList.contains("invalid")&&o.classList.remove("invalid")},invalidCallback:function(){o.classList.contains("invalid")||o.classList.add("invalid")}});r.on("valueChanged",function(t){e.updateCheckmark(t)}),this.updateCheckmark(!!r.getValue()),this.observeProps(function(t,n){e.applyAutoAdaptiveStyles(n.adaptiveStyles),G({element:e.getRootElement().querySelector(".label"),html:n.content.label}),e.registerLabelControl(n.content.label);var o,r=e.getRootElement().querySelector('input[type="checkbox"]');r&&r.setAttribute("aria-required",String(!(null===(o=n.control)||void 0===o||null===(o=o.validation)||void 0===o||!o.required))),e.setStylesVariables(e.getHostElement());var i=e.getRootElement().querySelector(".checkmark-container");i.style.width=e.getCheckmarkStyleAttributes("inputSize"),i.style.height=e.getCheckmarkStyleAttributes("inputSize"),function(t){let e=null;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=V(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=V(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=V(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=V(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(e.getElement("input"))})}}])}();pe(ge,"define",{name:"sys-consent",model:a.name,manifest:a});export{ge as default};window.clComponentClass_SysConsentComponent=ge;
1
+ const e={DESKTOP:"desktop",MOBILE:"mobile"};function t(t){return Object.values(e).map(e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t}))}const n="cl-";function o(e){return n+e}function r(e){return"cl-"+e}function i(e,t,n){var o;return null===(o=null==e?void 0:e[t])||void 0===o?void 0:o.find(e=>e.element===n)}function s(e=[]){return e.map(e=>Object.assign(Object.assign({},e),{styleAttributes:Object.assign({},e.styleAttributes)}))}const a={name:"SysConsentComponent",componentType:"CONSENT",version:"1.0.0",contextMenuModel:t([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:t([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host",params:{height:{hide:!0}}},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:t([{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"label"}]},{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"label",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!0}]},{type:"CONTROL",name:"MULTIPLE_INPUT_SIZE",element:"input",params:{inputType:"CHECKBOX"}},{type:"CONTROL",name:"BACKGROUND",element:"input",elementProp:"markerStyleAttributes",params:{label:"DOCUMENT_CHECKBOX_BACKGROUND_DEFAULT_TITLE",property:"defaultBackground"}},{type:"CONTROL",name:"BACKGROUND",element:"input",elementProp:"markerStyleAttributes",params:{label:"DOCUMENT_CHECKBOX_BACKGROUND_SELECTED_TITLE",property:"selectedBackground"}},{type:"CONTROL",name:"BORDERS",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"BOX_SHADOW",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"BORDER_RADIUS",elementProp:"styleAttributes",element:"input"},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}])},events:{dispatch:[],listen:[]},i18nPropPaths:["content,label"],i18nPropertyPaneModel:{content:[{type:"CONTROL",name:"INSERT_BLOCK",params:[{element:"text",label:"DOCUMENT_TEXT",isLinkAvailable:!0,origin:!1}]}]},i18n:{en:{"control,validation,validationErrors,REQUIRED":"Accept consent to subscribe","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},ru:{"control,validation,validationErrors,REQUIRED":"Примите соглашение для подписки","content,label":'Я даю согласие на обработку своих персональных данных и ознакомлен с <a href="https://example.com/termsofuse" target="_blank">условиями использования сервиса</a>'},uk:{"control,validation,validationErrors,REQUIRED":"Прийміть угоду для підписки","content,label":'Я даю згоду на обробку своїх персональних даних та ознайомлений з <a href="https://example.com/termsofuse" target="_blank">умовами використання сервісу</a>'},es:{"control,validation,validationErrors,REQUIRED":"Aceptar el consentimiento para suscribirse","content,label":'Doy mi consentimiento para el procesamiento de mis datos personales y he leído y acepto los <a href="https://example.com/termsofuse" target="_blank">Términos de uso</a>'},de:{"control,validation,validationErrors,REQUIRED":"Zustimmung zum Abonnement akzeptieren","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},fr:{"control,validation,validationErrors,REQUIRED":"Accepter le consentement pour s'abonner","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},it:{"control,validation,validationErrors,REQUIRED":"Accetti il consenso per iscriversi","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},pt:{"control,validation,validationErrors,REQUIRED":"Aceitar consentimento para subscrever","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},ro:{"control,validation,validationErrors,REQUIRED":"Acceptați consimțământul pentru abonare","content,label":'Sunt de acord cu prelucrarea datelor mele personale și am citit și accept <a href="https://example.com/termsofuse" target="_blank">Termenii de utilizare</a>'},bg:{"control,validation,validationErrors,REQUIRED":"Приемете съгласието, за да се абонирате","content,label":'Съгласен съм с обработката на личните ми данни и прочетох и приемам <a href="https://example.com/termsofuse" target="_blank">Условията за ползване</a>'},cs:{"control,validation,validationErrors,REQUIRED":"Pro odběr přijměte souhlas","content,label":'Souhlasím se zpracováním mých osobních údajů a přečetl jsem si a přijímám <a href="https://example.com/termsofuse" target="_blank">Podmínky použití</a>'},el:{"control,validation,validationErrors,REQUIRED":"Αποδέχεστε τη συναίνεση στην εγγραφή","content,label":'Συναινώ στην επεξεργασία των προσωπικών μου δεδομένων και έχω διαβάσει και αποδέχομαι τους <a href="https://example.com/termsofuse" target="_blank">Όρους Χρήσης</a>'},nl:{"control,validation,validationErrors,REQUIRED":"Accepteer toestemming om u te abonneren","content,label":'Jeg giver samtykke til behandlingen af mine personlige data, og jeg har læst og accepterer <a href="https://example.com/termsofuse" target="_blank">Brugervilkår</a>'},pl:{"control,validation,validationErrors,REQUIRED":"Wyraź zgodę, aby zasubskrybować","content,label":'Wyrażam zgodę na przetwarzanie moich danych osobowych oraz zapoznałem się i akceptuję <a href="https://example.com/termsofuse" target="_blank">Warunki użytkowania</a>'},sv:{"control,validation,validationErrors,REQUIRED":"Acceptera samtycke för att prenumerera","content,label":'Jag samtycker till behandlingen av mina personuppgifter och jag har läst och accepterar <a href="https://example.com/termsofuse" target="_blank">Användarvillkor</a>'},tr:{"control,validation,validationErrors,REQUIRED":"Abone olmak için onayı kabul edin","content,label":'Kişisel verilerimin işlenmesine izin veriyorum ve <a href="https://example.com/termsofuse" target="_blank">Kullanım Koşulları</a>\'nı okudum ve kabul ediyorum.'},ar:{"control,validation,validationErrors,REQUIRED":"قبول الموافقة على الاشتراك","content,label":'أوافق على معالجة بياناتي الشخصية وقد قرأت وأوافق على <a href="https://example.com/termsofuse" target="_blank"> شروط الاستخدام </a>'},zh:{"control,validation,validationErrors,REQUIRED":"接受同意订阅","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},da:{"control,validation,validationErrors,REQUIRED":"Accepter samtykke til at abonnere","content,label":'Jeg giver samtykke til behandlingen af ​​mine personoplysninger, og jeg har læst og accepterer <a href="https://example.com/termsofuse" target="_blank">Vilkår for brug</a>'},he:{"control,validation,validationErrors,REQUIRED":"קבלו הסכמה להירשם","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},fi:{"control,validation,validationErrors,REQUIRED":"Anna suostumus tilaukseen","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},hi:{"control,validation,validationErrors,REQUIRED":"सदस्यता लेने के लिए सहमति स्वीकार करें","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},hr:{"control,validation,validationErrors,REQUIRED":"Prihvatite privolu za pretplatu","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},hu:{"control,validation,validationErrors,REQUIRED":"Az előfizetéshez való hozzájárulás elfogadása","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},id:{"control,validation,validationErrors,REQUIRED":"Terima persetujuan untuk berlangganan","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},ja:{"control,validation,validationErrors,REQUIRED":"サブスクリプションへの同意を承諾","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},ko:{"control,validation,validationErrors,REQUIRED":"구독하려면 동의 수락","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},no:{"control,validation,validationErrors,REQUIRED":"Godta samtykke for å abonnere","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},sk:{"control,validation,validationErrors,REQUIRED":"Udeľte súhlas s odberom","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},sl:{"control,validation,validationErrors,REQUIRED":"Sprejmite soglasje za naročnino","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},sr:{"control,validation,validationErrors,REQUIRED":"Prihvatite saglasnost za pretplatu","content,label":'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'}},props:{content:{label:'I consent to the processing of my personal data and I have read and I do accept <a href="https://example.com/termsofuse" target="_blank">Terms of Use</a>'},control:{name:"consentId",defaultValue:!1,validation:{required:!0,validationErrors:{REQUIRED:"Accept consent to subscribe"}}},adaptiveStyles:(l=[{element:"host",styleAttributes:{paddingTop:"0px",paddingBottom:"0px",paddingLeft:"0px",paddingRight:"0px",_paddingEnabled:!1,width:"100%",minWidth:null,height:"auto",marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1},classes:""},{element:"input",styleAttributes:{borderTopStyle:"solid",borderRightStyle:"solid",borderBottomStyle:"solid",borderLeftStyle:"solid",borderTopWidth:"1px",borderTopColor:"rgb(68, 68, 68)",borderBottomWidth:"1px",borderBottomColor:"rgb(68, 68, 68)",borderLeftWidth:"1px",borderLeftColor:"rgb(68, 68, 68)",borderRightWidth:"1px",borderRightColor:"rgb(68, 68, 68)",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none"},markerStyleAttributes:{inputSize:"22px",inputToTextGapSize:"13px",defaultBackground:"rgb(255, 255, 255)",selectedBackground:"var(--cl-schema-accent, rgb(255, 255, 255))"},classes:""},{element:"label",styleAttributes:{color:"var(--cl-schema-text, rgb(68, 68, 68))",textAlign:"start",lineHeight:"120%",fontWeight:"400",fontSize:"14px",textShadow:"none"},classes:""}],Object.values(e).reduce((e,t)=>Object.assign(e,{[t]:s(l)}),{desktop:[],mobile:[]}))},metaDescription:{icon:"/SysConsentComponent/assets/img/component-icon.svg",label:{en:"Data processing and terms of use",ru:"Обработка данных и условия использования",uk:"Обробка даних та умови використання",es:"Tratamiento de datos y condiciones de uso",fr:"Traitement des données et conditions d'utilisation",de:"Datenverarbeitung und Nutzungsbedingungen",it:"Trattamento dei dati e condizioni d'uso",pt:"Processamento de dados e termos de utilização",ro:"Prelucrarea datelor și condițiile de utilizare",bg:"Обработка на данни и условия за ползване",cs:"Zpracování dat a podmínky použití",el:"Επεξεργασία δεδομένων και όροι χρήσης",nl:"Gegevensverwerking en gebruiksvoorwaarden",pl:"Przetwarzanie danych i warunki użytkowania",sv:"Databehandling och användarvillkor",tr:"Veri işleme ve kullanım koşulları",ar:"معالجة البيانات وشروط الاستخدام",zh:"数据处理和使用条款",da:"Databehandling og brugsbetingelser",he:"עיבוד נתונים ותנאי השימוש"}},syncEnabled:!0,stylesImitationEnabled:!0};var l;const c="validationStatusChanged",d="touchedStatusChanged";class h{static size(e){return{width:this.width(e),height:this.height(e)}}static width(e){var t;const n=e||document;return Math.max(n.documentElement.clientWidth,(null===(t=n.defaultView)||void 0===t?void 0:t.innerWidth)||0)}static height(e){var t;const n=e||document;return Math.max(n.documentElement.clientHeight,(null===(t=n.defaultView)||void 0===t?void 0:t.innerHeight)||0)}static scrollbarWidth(e){var t;const n=e||document;return((null===(t=n.defaultView)||void 0===t?void 0:t.innerWidth)||0)-n.documentElement.clientWidth}}function u(e){return!(!e||"string"==typeof e)&&(e instanceof Array||Array.isArray(e)||e.length>=0&&(e.splice instanceof Function||Object.getOwnPropertyDescriptor(e,e.length-1)&&"String"!==e.constructor.name))}var p=Array.prototype.concat,m=Array.prototype.slice,g=function(e){for(var t=[],n=0,o=e.length;n<o;n++){var r=e[n];u(r)?t=p.call(t,m.call(r)):t.push(r)}return t};g.wrap=function(e){return function(){return e(g(arguments))}};const b=g;var f={},v=Object.hasOwnProperty,y=Object.create(null);for(var E in f)v.call(f,E)&&(y[f[E]]=E);var O={to:{},get:{}};function S(e,t,n){return Math.min(Math.max(t,e),n)}O.get=function(e){var t,n;return"hsl"===e.substring(0,3).toLowerCase()?(t=O.get.hsl(e),n="hsl"):(t=O.get.rgb(e),n="rgb"),t?{model:n,value:t}:null},O.get.rgb=function(e){if(!e)return null;var t,n,o,r=[0,0,0,1];if(t=e.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=t[2],t=t[1],n=0;n<3;n++){var i=2*n;r[n]=parseInt(t.slice(i,i+2),16)}o&&(r[3]=parseInt(o,16)/255)}else if(t=e.match(/^#([a-f0-9]{3,4})$/i)){for(o=(t=t[1])[3],n=0;n<3;n++)r[n]=parseInt(t[n]+t[n],16);o&&(r[3]=parseInt(o+o,16)/255)}else if(t=e.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)r[n]=parseInt(t[n+1],0);t[4]&&(t[5]?r[3]=.01*parseFloat(t[4]):r[3]=parseFloat(t[4]))}else{if(!(t=e.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(t=e.match(/^(\w+)$/))?"transparent"===t[1]?[0,0,0,0]:v.call(f,t[1])?((r=f[t[1]])[3]=1,r):null:null;for(n=0;n<3;n++)r[n]=Math.round(2.55*parseFloat(t[n+1]));t[4]&&(t[5]?r[3]=.01*parseFloat(t[4]):r[3]=parseFloat(t[4]))}for(n=0;n<3;n++)r[n]=S(r[n],0,255);return r[3]=S(r[3],0,1),r},O.get.hsl=function(e){if(!e)return null;var t=e.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(t){var n=parseFloat(t[4]);return[(parseFloat(t[1])%360+360)%360,S(parseFloat(t[2]),0,100),S(parseFloat(t[3]),0,100),S(isNaN(n)?1:n,0,1)]}return null},O.to.rgb=function(){var e=b(arguments);return e.length<4||1===e[3]?"rgb("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+")":"rgba("+Math.round(e[0])+", "+Math.round(e[1])+", "+Math.round(e[2])+", "+e[3]+")"},O.to.hsl=function(){var e=b(arguments);return e.length<4||1===e[3]?"hsl("+e[0]+", "+e[1]+"%, "+e[2]+"%)":"hsla("+e[0]+", "+e[1]+"%, "+e[2]+"%, "+e[3]+")"};const T=O,k={},A={};for(const e of Object.keys(k))A[k[e]]=e;const C={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const e of Object.keys(C)){if(!("channels"in C[e]))throw new Error("missing channels property: "+e);if(!("labels"in C[e]))throw new Error("missing channel labels property: "+e);if(C[e].labels.length!==C[e].channels)throw new Error("channel and label counts mismatch: "+e);const{channels:t,labels:n}=C[e];delete C[e].channels,delete C[e].labels,Object.defineProperty(C[e],"channels",{value:t}),Object.defineProperty(C[e],"labels",{value:n})}C.rgb.hsl=function(e){const t=e[0]/255,n=e[1]/255,o=e[2]/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=i-r;let a,l;i===r?a=0:t===i?a=(n-o)/s:n===i?a=2+(o-t)/s:o===i&&(a=4+(t-n)/s),a=Math.min(60*a,360),a<0&&(a+=360);const c=(r+i)/2;return l=i===r?0:c<=.5?s/(i+r):s/(2-i-r),[a,100*l,100*c]},C.hsl.rgb=function(e){const t=e[0]/360,n=e[1]/100,o=e[2]/100;let r,i,s;if(0===n)return s=255*o,[s,s,s];r=o<.5?o*(1+n):o+n-o*n;const a=2*o-r,l=[0,0,0];for(let e=0;e<3;e++)i=t+1/3*-(e-1),i<0&&i++,i>1&&i--,s=6*i<1?a+6*(r-a)*i:2*i<1?r:3*i<2?a+(r-a)*(2/3-i)*6:a,l[e]=255*s;return l};const R=C;function x(e,t){return function(n){return t(e(n))}}function _(e,t){const n=[t[e].parent,e];let o=R[t[e].parent][e],r=t[e].parent;for(;t[r].parent;)n.unshift(t[r].parent),o=x(R[t[r].parent][r],o),r=t[r].parent;return o.conversion=n,o}const I={};Object.keys(R).forEach(e=>{I[e]={},Object.defineProperty(I[e],"channels",{value:R[e].channels}),Object.defineProperty(I[e],"labels",{value:R[e].labels});const t=function(e){const t=function(e){const t=function(){const e={},t=Object.keys(R);for(let n=t.length,o=0;o<n;o++)e[t[o]]={distance:-1,parent:null};return e}(),n=[e];for(t[e].distance=0;n.length;){const e=n.pop(),o=Object.keys(R[e]);for(let r=o.length,i=0;i<r;i++){const r=o[i],s=t[r];-1===s.distance&&(s.distance=t[e].distance+1,s.parent=e,n.unshift(r))}}return t}(e),n={},o=Object.keys(t);for(let e=o.length,r=0;r<e;r++){const e=o[r];null!==t[e].parent&&(n[e]=_(e,t))}return n}(e);Object.keys(t).forEach(n=>{const o=t[n];I[e][n]=function(e){const t=function(...t){const n=t[0];if(null==n)return n;n.length>1&&(t=n);const o=e(t);if("object"==typeof o)for(let e=o.length,t=0;t<e;t++)o[t]=Math.round(o[t]);return o};return"conversion"in e&&(t.conversion=e.conversion),t}(o),I[e][n].raw=function(e){const t=function(...t){const n=t[0];return null==n?n:(n.length>1&&(t=n),e(t))};return"conversion"in e&&(t.conversion=e.conversion),t}(o)})});const w=I,L=["keyword","gray","hex"],N={};for(const e of Object.keys(w))N[[...w[e].labels].sort().join("")]=e;const P={};function M(e,t){if(!(this instanceof M))return new M(e,t);if(t&&t in L&&(t=null),t&&!(t in w))throw new Error("Unknown model: "+t);let n,o;if(null==e)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(e instanceof M)this.model=e.model,this.color=[...e.color],this.valpha=e.valpha;else if("string"==typeof e){const t=T.get(e);if(null===t)throw new Error("Unable to parse color from string: "+e);this.model=t.model,o=w[this.model].channels,this.color=t.value.slice(0,o),this.valpha="number"==typeof t.value[o]?t.value[o]:1}else if(e.length>0){this.model=t||"rgb",o=w[this.model].channels;const n=Array.prototype.slice.call(e,0,o);this.color=D(n,o),this.valpha="number"==typeof e[o]?e[o]:1}else if("number"==typeof e)this.model="rgb",this.color=[e>>16&255,e>>8&255,255&e],this.valpha=1;else{this.valpha=1;const t=Object.keys(e);"alpha"in e&&(t.splice(t.indexOf("alpha"),1),this.valpha="number"==typeof e.alpha?e.alpha:0);const o=t.sort().join("");if(!(o in N))throw new Error("Unable to parse color from object: "+JSON.stringify(e));this.model=N[o];const{labels:r}=w[this.model],i=[];for(n=0;n<r.length;n++)i.push(e[r[n]]);this.color=D(i)}if(P[this.model])for(o=w[this.model].channels,n=0;n<o;n++){const e=P[this.model][n];e&&(this.color[n]=e(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}M.prototype={toString(){return this.string()},string(e){let t=this.model in T.to?this:this.rgb();t=t.round("number"==typeof e?e:1);const n=1===t.valpha?t.color:[...t.color,this.valpha];return T.to[t.model](n)},round(e){return e=Math.max(e||0,0),new M([...this.color.map(j(e)),this.valpha],this.model)},alpha(e){return void 0!==e?new M([...this.color,Math.max(0,Math.min(1,e))],this.model):this.valpha},lighten(e){const t=this.hsl();return t.color[2]+=t.color[2]*e,t},darken(e){const t=this.hsl();return t.color[2]-=t.color[2]*e,t}};for(const e of Object.keys(w)){if(L.includes(e))continue;const{channels:t}=w[e];M.prototype[e]=function(...t){return this.model===e?new M(this):t.length>0?new M(t,e):new M([...U(w[this.model][e].raw(this.color)),this.valpha],e)},M[e]=function(...n){let o=n[0];return"number"==typeof o&&(o=D(n,t)),new M(o,e)}}function j(e){return function(t){return function(e,t){return Number(e.toFixed(t))}(t,e)}}function U(e){return Array.isArray(e)?e:[e]}function D(e,t){for(let n=0;n<t;n++)"number"!=typeof e[n]&&(e[n]=0);return e}const B=M;function F(e,t){Object.keys(t).forEach(n=>{e.style[n]=t[n]})}function V(e,t,n){const o=function(e,t){let n=getComputedStyle(e)[t]||e.style.getPropertyValue(t);if(n&&n.includes("var(")&&(n=function(e){const t=String(e).match(/var\([^,]+,\s*(rgb(?:a)?\([^)]+\))\)/);return t&&t[1]?t[1]:null}(n)||void 0),n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(t,n);if(o){const t=B(o).alpha(.5).string();return e.classList.add("focus-outline-defined"),e.style.setProperty("--clFocusOutline",`3px solid ${t}`),t}return null}function W(e){const{width:t,height:n}=e.getBoundingClientRect(),{marginBottom:o,marginTop:r,marginLeft:i,marginRight:s}=window.getComputedStyle(e);return{width:t+parseInt(i,10)+parseInt(s,10),height:n+parseInt(r,10)+parseInt(o,10)}}function z(e,t,n,o,r){switch(e.position){case"top":return{left:`${H(t,n,o,r)}px`,top:e.availableSpaceAboveTriggerElem-e.contentHeight-e.verticalOffset+"px"};case"bottom":return{left:`${H(t,n,o,r)}px`,bottom:e.availableSpaceBelowTriggerElem-e.contentHeight-e.verticalOffset+"px"};case"left":return{left:e.availableSpaceToTheLeftSideOfTheTrigger-t.width-e.contentWidth-e.horizontalOffset+"px",top:`${$(0,e)}px`};case"right":return{right:e.availableSpaceToTheRightSideOfTheTrigger-e.contentWidth-e.horizontalOffset+"px",top:`${$(0,e)}px`}}}function H(e,t,n,o){let r=n?e.x+e.width/2-t.width/2:e.x;return r<0&&(r=0),r+t.width>h.width(o)&&(r-=r+t.width-h.width(o)),r}function $(e,t){let n=t.availableSpaceAboveTriggerElem;return t.contentHeight>t.availableSpaceBelowTriggerElem&&(n-=t.contentHeight-t.availableSpaceBelowTriggerElem),n}function G(e){const{element:t,html:n,appendHtml:o}=e,r=function(e){if(null==e)return"";if("string"!=typeof e)return String(e);if(""===e)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(e))return e;const t=(new DOMParser).parseFromString(e,"text/html");return t.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach(e=>e.remove()),t.querySelectorAll("*").forEach(e=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach(t=>e.removeAttribute(t)),Array.from(e.attributes).forEach(t=>{t.name.startsWith("on")&&e.removeAttribute(t.name)}),"A"===e.tagName||"AREA"===e.tagName){const t=e.getAttribute("href");t&&(t.startsWith("javascript:")||t.startsWith("data:"))&&e.removeAttribute("href")}if("IMG"===e.tagName||"IFRAME"===e.tagName){const t=e.getAttribute("src");t&&(t.startsWith("javascript:")||t.startsWith("data:text/html"))&&e.removeAttribute("src")}if("FORM"===e.tagName){const t=e.getAttribute("action");t&&t.startsWith("javascript:")&&e.removeAttribute("action")}}),t.body.innerHTML}(n);o?t.innerHTML+=r:t.innerHTML=r}const Q="cl-tooltip-text-styles",K=`\n .cl-tooltip-text {\n z-index: ${Number.MAX_SAFE_INTEGER};\n width: max-content;\n height: fit-content;\n visibility: hidden;\n background-color: white;\n color: #000;\n border: 1px solid rgb(194, 194, 194);\n border-radius: 5px;\n padding: 5px 10px;\n position: fixed;\n max-width: 300px;\n max-height: 100vh;\n box-shadow: 0 1px 5px rgba(0,0,0,.28);\n font-size: 14px;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:before {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 13px);\n border-width: 12px;\n border-style: solid;\n border-color: rgb(194, 194, 194) transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='top']:after {\n content: "";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:before {\n content: "";\n position: absolute;\n top: -24px;\n left: calc(50% - 9px);\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent rgb(194, 194, 194) transparent;\n }\n\n .cl-tooltip-text[cl-tooltip-position='bottom']:after {\n content: "";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: 12px;\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n`;function q(e,t,n,o){o=o||document;let r=null;e&&(e.classList.add("invalid"),e.setAttribute("aria-invalid","true")),t&&(t.style.visibility="visible"),t&&(t.onmouseenter=()=>{(function(e){if((e=e||document).head.querySelector(`#${Q}`))return;const t=document.createElement("style");t.setAttribute("id",Q),G({element:t,html:K}),e.head.appendChild(t)})(o),r=function(e){const t="cl-overlay-tooltip-text",n=document.getElementById(t)||document.createElement("div");return n.classList.add("cl-tooltip-text"),n.textContent!==e&&(n.textContent=e,n.style=null),n.id||(n.id=t),n}(n),o.body.append(r),r.style.visibility="visible",function(e){const{triggerElement:t,tooltipElement:n,offset:o=10,htmlDocumentObject:r}=e,i=function(e,t,n,o,r,i){const s=function(e,t,n,o,r){const i=function(e,t,n,o){const r=h.width(o),{right:i}=e.getBoundingClientRect(),s=r-n-i-h.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:W(t).width,availableSpaceToTheLeftSideOfTheTrigger:i-n,availableSpaceToTheRightSideOfTheTrigger:s}}(e,t,n,r),s=function(e,t,n,o){const r=h.height(o),{top:i,bottom:s}=e.getBoundingClientRect();return{verticalOffset:n,contentHeight:W(t).height,availableSpaceAboveTriggerElem:i-n,availableSpaceBelowTriggerElem:r-s-n}}(e,t,n,r);let a="undefined";const l={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:i.availableSpaceToTheRightSideOfTheTrigger>=i.contentWidth,left:i.availableSpaceToTheLeftSideOfTheTrigger>=i.contentWidth};if(l.top?a="top":l.bottom?a="bottom":l.right?a="right":l.left&&(a="left"),o&&l[o]&&(a=o),"undefined"===a){const e=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,i.availableSpaceToTheRightSideOfTheTrigger,i.availableSpaceToTheLeftSideOfTheTrigger);e===s.availableSpaceBelowTriggerElem?a="bottom":e===s.availableSpaceAboveTriggerElem?a="top":e===i.availableSpaceToTheRightSideOfTheTrigger?a="right":e===i.availableSpaceToTheLeftSideOfTheTrigger&&(a="left")}return Object.assign(Object.assign(Object.assign({},s),i),{position:a})}(e,t,n,o,i=i||document);return function(e,t){const{marginBottom:n,marginTop:o}=window.getComputedStyle(t);if("top"===e.position)F(t,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),F(t,{"margin-bottom":"0px"});else if("bottom"===e.position)F(t,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),F(t,{"margin-top":"0px"});else{const e=(parseInt(n,10)+parseInt(o,10))/2+"px";F(t,{"margin-top":e,"margin-bottom":e})}}(s,t),{coordinates:z(s,e.getBoundingClientRect(),t.getBoundingClientRect(),r,i),position:s.position}}(t,n,o,"top",!0,r);n.setAttribute("cl-tooltip-position",i.position),F(n,i.coordinates)}({triggerElement:t,tooltipElement:r,htmlDocumentObject:o})},t.onmouseleave=()=>{r&&(r.remove(),function(e){const t=(e=e||document).head.querySelector(`#${Q}`);t&&t.remove()}(o))})}function J(e){return[e.getConfig("appearanceLanguage"),e.getConfig("browserLanguage"),"en"].filter(e=>!!e)}function X(e,t){return t.reduce((t,n)=>{if(t)return t;const o=function(e,t){if(!e)return null;if(t[e])return{translations:t[e],language:e};const n=function(e){return e.includes("-")?e.split("-")[0].toLowerCase():e.includes("_")?e.split("_")[0].toLowerCase():e}(e);return t[n]?{translations:t[n],language:n}:null}(n,e);return o||null},null)}const Y="VIEW",Z="CONTAINER",ee="INPUT",te="BUTTON",ne="CONSENT",oe="COLUMN";var re,ie;(ie=re||(re={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",ie.REQUEST="REQUEST",ie.DISPATCH_EVENT="DISPATCH_EVENT",ie.GO_TO_VIEW="GO_TO_VIEW",ie.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",ie.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",ie.SHOW_WIDGET="SHOW_WIDGET",ie.OPEN_LINK="OPEN_LINK",ie.CLOSE_WIDGET="CLOSE_WIDGET",ie.CLICK="CLICK";const se=re;var ae,le;class ce{static sortActions(e){const t={[se.CLOSE_WIDGET]:-1,[se.OPEN_LINK]:-2,[se.SHOW_WIDGET]:1,[se.SUBSCRIBE_CONTACT]:2,[se.REQUEST]:3},n=e=>void 0!==t[e.type]?t[e.type]:0;return[...e].sort((e,t)=>n(e)>n(t)?-1:n(e)<n(t)?1:0)}constructor(e,t){this.config=e,this.actions=ce.sortActions(t),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(e,t,n){this.state=e;const o=n(),i=o.getAttribute(r("id"));this.actions.forEach(e=>{var t;return null===(t=e.setInitiatorComponentId)||void 0===t?void 0:t.call(e,i)}),this.listener=e=>{const t=e.composedPath().filter(e=>e instanceof HTMLElement&&e.getAttribute(r("type")));let n=0;for(;t[n]&&t[n].getAttribute(r("id"))!==i;){let e=t[n].getAttribute(r("type"));if(ce.IGNORING_VIEW_ENTRY_TYPES.includes(e))return;n++}this.eventsQueue.push({event:e}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((o.shadowRoot||o).querySelectorAll(this.config.relativeSelector)):[o],this.targetElements.forEach(e=>{e.addEventListener("click",this.listener)})}async execute(){var e,t,n,o;try{for(var r,i=!0,s=function(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,n=e[Symbol.asyncIterator];return n?n.call(e):(e="function"==typeof __values?__values(e):e[Symbol.iterator](),t={},o("next"),o("throw"),o("return"),t[Symbol.asyncIterator]=function(){return this},t);function o(n){t[n]=e[n]&&function(t){return new Promise(function(o,r){!function(e,t,n,o){Promise.resolve(o).then(function(t){e({value:t,done:n})},t)}(o,r,(t=e[n](t)).done,t.value)})}}}(this.eventsQueue);!(e=(r=await s.next()).done);i=!0){o=r.value,i=!1;const{event:e}=o;for(const t of this.actions)if(!await t.execute(this.state.getState(),e))break}}catch(e){t={error:e}}finally{try{i||e||!(n=s.return)||await n.call(s)}finally{if(t)throw t.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach(e=>{e.removeEventListener("click",this.listener)}),this.targetElements=[])}}ce.IGNORING_VIEW_ENTRY_TYPES=[te,ne,ee],(le=ae||(ae={})).CLICK="CLICK",le.COMPONENT_EVENT="COMPONENT_EVENT";class de{constructor(e,t){this.config=e,this.actions=t,this.componentEmitterListener=null}activate(e,t,n){var o;const i=null===(o=n())||void 0===o?void 0:o.getAttribute(r("id"));this.actions.forEach(e=>{var t;return null===(t=e.setInitiatorComponentId)||void 0===t?void 0:t.call(e,i)}),this.componentEmitterListener=t.on(this.config.eventName,()=>{this.actions.forEach(t=>t.execute(e.getState(),this.config.params))})}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class he{constructor(e,t){this.actionFactory=e,this.actionRegister=t}get(e){const t=e.actions.map(e=>this.actionFactory.get(e));switch(t.forEach(e=>this.actionRegister.register(e)),e.type){case ae.CLICK:return new ce(e,t);case ae.COMPONENT_EVENT:return new de(e,t);default:throw new Error(`Not supported handler type ${e.type}`)}}}class ue{static generate(){let e,t="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(t+="-"),e=Math.floor(16*Math.random()).toString(16).toUpperCase(),t+=e;return t}}class pe{constructor(){this.listeners=pe.createDefaultListenersState()}emit(e,t,n=null){const o=this.listeners[e];o&&Object.values(o).forEach(o=>o(t,e,n)),Object.values(this.listeners["*"]).forEach(o=>o(t,e,n))}on(e,t){const n=ue.generate(),o=this.listeners[e];return o?o[n]=t:this.listeners[e]={[n]:t},{off:()=>{var t,o;(null===(o=null===(t=this.listeners)||void 0===t?void 0:t[e])||void 0===o?void 0:o[n])&&delete this.listeners[e][n]}}}destroy(){this.listeners=pe.createDefaultListenersState()}}pe.createDefaultListenersState=()=>({"*":{}});const me=pe,ge=(e,t,n,o)=>{const r=EventTarget.prototype,{addEventListenerBase:i,addEventListener:s}=r;(i||s).call(e,t,n,o)};class be{constructor(e){this.state=e||{}}getState(){return this.state}setState(e){this.state=Object.assign(Object.assign({},this.state),e)}destroy(){}}class fe extends me{constructor(e,t){super(),this.config=t,this.handleMobileBreakpoint(e.getShared().mobileBreakpointWidth),e.on("ENVIRONMENT_UPDATE",({isMobileEnv:e})=>{this._isMobile=e,this.emit(fe.changeEventName,this._isMobile)})}handleMobileBreakpoint(e){this.mobileBreakpointWidth=e;const t=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${t})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(fe.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(e){this._isMobile=e.matches,this.emit(fe.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}fe.changeEventName="CHANGE";const ve=fe;class ye{static set(e,t){const n=e[ye.accumulatorPropertyName]||{};e[ye.accumulatorPropertyName]=Object.assign(Object.assign({},n),t.styleAttributes),Object.keys(e[ye.accumulatorPropertyName]).forEach(n=>{n.includes("--")?e.style.setProperty(n,t.styleAttributes[n]||""):e.style[n]=t.styleAttributes[n]?t.styleAttributes[n]:""})}}ye.accumulatorPropertyName="clStyleAttributes";const Ee=ye;var Oe,Se;(Se=Oe||(Oe={})).BUILT_IN="BUILT_IN",Se.DETACHED="DETACHED",Se.FLOATING_BOX="FLOATING_BOX",Se.FLOATING_BAR="FLOATING_BAR",Se.LAUNCHER="LAUNCHER",Se.CONTENT_LOCKER="CONTENT_LOCKER";class Te{static applyHostStyles(e,t,n=null,o){var r,i,s;const a=null===(i=null===(r=null==n?void 0:n.props)||void 0===r?void 0:r.handlers)||void 0===i?void 0:i.find(e=>"CLICK"===e.type);a&&(null===(s=a.actions)||void 0===s?void 0:s.length)&&(t.style.cursor="pointer"),e!==Y&&e!==Z&&e!==oe||(t.style.display=o===Oe.CONTENT_LOCKER&&e===Y?"flex":"inline-flex",t.style.position="relative"),t.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(e=""){this.styles=`${this.styles} ${e}`}getStyles(){return this.styles}}class ke{static log(e){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(e)):console.error(e)}}class Ae{constructor(e,t,n,o,r,i){this.hostElement=t,this.documentModel=e,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=r,this.httpClient=i,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(e){const t=String(e||"");if(t.includes("url")){const[e,n]=t.split("(")[1].split(")");return{url:e.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(e){const t=this.getPropsCb();return t.backgroundDynamicInlineSVGElements[e].forEach(n=>{var o,r,i,s,a;const l=null===(r=null===(o=t.adaptiveStyles)||void 0===o?void 0:o[e])||void 0===r?void 0:r.find(e=>e.element===n),c=(null===(i=t.styles)||void 0===i?void 0:i.find(e=>e.element===n))||{},d=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(a=null==l?void 0:l.styleAttributes)||void 0===a?void 0:a.background),h=this.parseBackground(d);h.url&&this.envUrlMaps[e].set(n,{originalSVGResourceURL:h.url,inlineSvgString:null,positionOptions:h.positionOptions})}),Promise.all([...this.envUrlMaps[e].entries()].map(([t,n])=>this.httpClient.execute({url:n.originalSVGResourceURL}).then(e=>e.text()).then(o=>{this.envUrlMaps[e].set(t,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))).then(()=>{var t;const n=this.getSharedCb();return Object.keys((null===(t=n.theme)||void 0===t?void 0:t.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[e].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[e].get("host"),n.cssVars)}).catch(e=>{console.error(e),ke.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${e}`)})}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",e=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),e)}),this.themeSubscription=this.documentModel.on("THEME_UPDATE",e=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),e.schema)}),this}_applyHostElementBackgroundFromCssVars(e,t){e&&t&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(e,t))}_applyHostElementBackgroundFromTheme(e,t){e&&t&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(e,t))}_buildBackgroundUrlFromCssVars(e,t){const n=e.inlineSvgString.trim().replace("var(--cl-schema-accent)",t["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${e.positionOptions}`}_buildBackgroundUrlFromTheme(e,t){const n=e.inlineSvgString.trim();let o=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach(e=>{const n=function(e=""){return e.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(e[1]);var r;o=o.replace(`var(--${r=n,`cl-schema-${r}`})`,t[n])}),`url('data:image/svg+xml,${encodeURIComponent(o)}')${e.positionOptions}`}off(){var e,t;null===(e=this.schemaSubscription)||void 0===e||e.off(),null===(t=this.themeSubscription)||void 0===t||t.off()}}const Ce=new class{execute({url:e,method:t="GET",body:n=null,headers:o,abortSignal:r}){const i={method:t,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:r};return n&&(i.body="string"==typeof n?n:JSON.stringify(n)),fetch(e,i)}};function Re(e,t){return Object.keys(e).filter(e=>!t.includes(e)).reduce((t,n)=>Object.assign(Object.assign({},t),{[n]:e[n]}),{})}class xe{static camelCaseToDashCase(e){return e.replace(/[A-Z]/g,e=>"-"+e.toLowerCase())}static camelCaseToUpperSnakeCase(e){return e.replace(/[A-Z]/g,e=>"_"+e).toUpperCase()}}class _e{constructor(e){this._count=0,this.onUpdateCb=e}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var Ie;!function(e){e.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",e.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",e.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",e.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",e.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",e.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",e.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",e.LEAD_PROGRESS="LEAD_PROGRESS"}(Ie||(Ie={}));const we=Ie;class Le{constructor(e,t,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=e=>{0===e&&this.systemEventEmitter.emit(we.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=e=>{this.isStaticEntryModule?this.systemEventEmitter.emit(we.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${e}`):this.counters.pending.decrement()},this.componentId=e,this.systemEventEmitter=t,this.isStaticEntryModule=n,this.counters={pending:new _e(this.onCounterStateUpdate)}}}const Ne=(...e)=>{let t=e.reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:[]}),{});return{get:e=>t[e],clear:()=>Ne(...e)}},Pe=Ne,Me="props",je="shared",Ue="environment";function De(e,t,n,o){const r=e=>{let i=function(e){return e instanceof DocumentFragment||(null==e?void 0:e.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?e.host||null:e}(e);return i&&(o&&"function"==typeof o?o(i.getAttribute(t)):(null===(s=null==i?void 0:i.getAttribute)||void 0===s?void 0:s.call(i,t))===n)?i:i&&i.parentNode&&r(i.parentNode)||null;var s};return r(e)}const Be="SUBMIT";function Fe(e,t){return t?(e.classes=`${e.classes||""} ${t.classes||""}`.trim(),Object.keys(t).forEach(n=>{if("element"===n||"classes"===n)return;const o=t[n];o&&"object"==typeof o&&!Array.isArray(o)?e[n]=Object.assign(Object.assign({},e[n]||{}),o):e[n]=o}),e):e}const Ve=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class We extends Ve{constructor(e,t={},n){super(e,Object.assign(Object.assign({},n),{detail:t}))}}var ze,He,$e;function Ge(e){if(null!=e&&""!==e)return"string"==typeof e?e:"object"==typeof e?JSON.stringify(e):String(e)}!function(e){e.STATIC="STATIC",e.UPDATING="UPDATING"}(ze||(ze={})),($e=He||(He={})).STATIC="STATIC",$e.DATA_LAYER="DATA_LAYER",$e.URL_QUERY_PARAMS="URL_QUERY_PARAMS",$e.JS_API_VARIABLE="JS_API_VARIABLE",$e.COOKIE="COOKIE",$e.LOCAL_STORAGE="LOCAL_STORAGE";class Qe{constructor(e,t){this.configService=e,this.registry=t}resolveValue(e,t){if(!(null==e?void 0:e.enabled)||!e.sourceType||this.configService.getConfig("renderMode")===ze.UPDATING)return;const n=function(e,t,n,o){if(!t)return;if(t===He.STATIC)return Ge(null==n?void 0:n.value);const r=e.getSource(t);if(!r)return;const i=r.getValue(o);return Ge("function"==typeof(null==i?void 0:i.processor)?i.processor(r,Object.assign({id:o},n)):null==i?void 0:i.value)}(this.registry,e.sourceType,e.config,t);if(void 0===n)return;const o=n.trim();return""===o?void 0:o}}class Ke extends HTMLElement{constructor(){var e;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 0,this.construct=()=>{let e;const t=this.getAttribute(r("id")),n=this.getWidgetContainerNode();if(!n)throw new Error("Widget container not found in construct");const o=n.closest(`[${r("widget-id")}]`);let i;o&&(i=o.getAttribute(r("widget-id")));let s=new We("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(r("path")),id:t,widgetId:i},{bubbles:!0,composed:!0});this.dispatchEvent(s),e=s.detail.props,Object.assign(this,e),this.observers=Pe(Me,je,Ue),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(e){this.subscriptions.push(e)}off(){this.subscriptions.forEach(e=>null==e?void 0:e.off())}},this.state=new be({}),this.componentEventEmitter=new me,this.componentResourceManager=new Le(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new he(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,e=>{this.model.props=e,this.observers.get(Me).forEach(t=>t(this.prevProps,e)),this.prevProps=e;const t=this.getHostElement(),n=r("floating");e.floating&&!t.getAttribute(n)?t.setAttribute(n,"true"):!e.floating&&t.getAttribute(n)&&t.removeAttribute(n)}),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,e=>{Object.assign(this.model,e)}),this.documentModel.on("SHARED_UPDATE_ALL",()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(je).forEach(e=>e(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new Ae(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),Ce),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(ve.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const e=this.getEnvironment();this.observers.get(Ue).forEach(t=>t(this.prevEnvironment,e)),this.prevEnvironment=e})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")}))},this.attachHandlers=()=>{this.getHandlers().map(e=>this._handlerFactory.get(e)).map(e=>()=>e.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this))).forEach(e=>e())},this.postponeHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach(e=>e.postpone())},this.releaseHandlers=()=>{var e;null===(e=this.handlers)||void 0===e||e.forEach(e=>e.release())},this.getProps=()=>{var e;return null===(e=this.getModel())||void 0===e?void 0:e.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===ze.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===ze.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=e=>{this.observers.get(Me).push(e),e(null,this.prevProps)},this.observeShared=e=>{this.observers.get(je).push(e),e(this.getShared())},this.observeEnvironment=e=>{this.observers.get(Ue).push(e),e(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${r("element")}]`)).filter(e=>!e.hasAttribute(r("component")))],this.getElement=(e,t)=>this.getElements().find(n=>t?n.getAttribute(r("element"))===e&&n.id===t:n.getAttribute(r("element"))===e),this.applyAutoAdaptiveStyles=(e,t)=>{if(!e&&!t)return;const n=this.getElements();if(!n.length)return;const o=function(e,t){if(!t)return e||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(e||{desktop:[],mobile:[]}));return t.forEach(e=>{const t=e.element;let o=!1,r=!1;n.desktop&&n.desktop.forEach(n=>{n.element===t&&(Fe(n,e),o=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===t&&(Fe(n,e),r=!0)}),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(e))),!r&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(e)))}),n}(e,t),s=r("type"),a="element-styles";let l=this.getRootElement().querySelector(`style[${s}="${a}"]`);l||(l=document.createElement("style"),l.setAttribute(s,a),this.getRootElement().appendChild(l)),G({element:l,html:""}),n.forEach(e=>{let t=e.getAttribute(r("element"));const n=this.getEnvironment();let s=i(o,n,t);if(s){if(this.resizeListener.isMobile()){const e=i(o,"desktop",t);e&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),s.styleAttributes)}))}this.applyStylesToElement(e,this.applySharedClassesToElementModel(s),l)}}),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(e,t={})=>{if(!e||!e.style)return!1;for(const[n,o]of Object.entries(t))e.style[n]=o;return!0},this.applyStylesToElement=(e,t,n)=>{var o,i;const s=[];"host"===(t=Ke._resolveTogglableStylesForElementModel(t)).element&&(Te.applyHostStyles(this.model.type,e,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(o=this.model.props.backgroundDynamicInlineSVGElements)||void 0===o?void 0:o.desktop)||"mobile"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let a=t.styleAttributes.background,l=a&&a.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&l){this.componentResourceManager.getPending().increment();const e=new Image;e.src=l[1],ge(e,"load",()=>{this.componentResourceManager.getPending().decrement()}),ge(e,"error",()=>{this.componentResourceManager.onResourceLoadFailure(e.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()})}const c=Object.assign(Object.assign({},t),{styleAttributes:Re(t.styleAttributes,s)});if(Ee.set(e,c),this._setClassAttributes(e,t),n){if(t.hoverStyleAttributes){let o=Object.assign({},t.hoverStyleAttributes);if("FILL_UP"===t.hoverAnimationType){e.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",e.style.overflow="hidden";const n=e.tagName.toLowerCase(),r=`flip-up-animation-${t.element}`;let i=this.getRootElement().querySelector(`#${r}`);i||(i=document.createElement("style"),i.id=r,e.appendChild(i)),G({element:i,html:`\n ${n}::before {\n content: '';\n background: ${o.background};\n position: absolute;\n left: 0;\n top: ${e.getBoundingClientRect().height}px;\n height: ${e.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),o=Object.assign(Object.assign({},t.hoverStyleAttributes),{background:"transparent",position:"relative"})}o.borderTopWidth&&"0px"!==o.borderTopWidth||delete o.borderTopColor,o.borderBottomWidth&&"0px"!==o.borderBottomWidth||delete o.borderBottomColor,o.borderLeftWidth&&"0px"!==o.borderLeftWidth||delete o.borderLeftColor,o.borderRightWidth&&"0px"!==o.borderRightWidth||delete o.borderRightColor,this._addStylesToStyleElement(n,t.element,o,`:not(.${r("no-hover")}):hover`,!0)}t.placeholderStyleAttributes&&this._addStylesToStyleElement(n,t.element,t.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(n,this.getShared()),this.stylesAppliedToElement(e,t,n)}},this.applySharedClassesToElementModel=e=>function(e,t,o=!1){let r=e;return(r.classes||"").split(" ").filter(e=>e.startsWith(n)).forEach(e=>{var n;const i=null===(n=t.textClasses)||void 0===n?void 0:n[e];if(!i)return;let s=function(e,t){return{styleAttributes:Object.assign(Object.assign({},e.styleAttributes),t?e.mobileStyleAttributes:{}),placeholderStyleAttributes:Object.assign(Object.assign({},e.placeholderStyleAttributes),t?e.mobilePlaceholderStyleAttributes:{})}}(i,o);s.styleAttributes.fontFamily||(i.isHeader&&t.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:t.headerFontFamily})})),!i.isHeader&&t.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:t.textFontFamily})}))),r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},r.placeholderStyleAttributes),s.placeholderStyleAttributes)})}),r.styleAttributes.fontFamily||(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},r.styleAttributes),{fontFamily:t.textFontFamily})})),r}(e,this.documentModel.getShared(),this.resizeListener.isMobile()),this.getModel=()=>this.model,this._addStylesToStyleElement=(e,t,n,o="",i)=>{const s=Object.keys(n).reduce((e,t)=>e+` ${xe.camelCaseToDashCase(t)}: ${n[t]}${i?" !important;":";"}`,"");G({element:e,html:`[${r("element")}="${t}"]${o} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(e,t)=>{G({element:e,html:`[cl-type] {font-family:${t.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(e,t)=>{var n,o,r,i;t.linkColor&&G({element:e,html:`a {color: ${t.linkColor}}, a:visited {color: ${t.linkColor}}`,appendHtml:!0}),(null===(n=t.linkParams)||void 0===n?void 0:n.color)&&G({element:e,html:`a {color: ${null===(o=t.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(r=t.linkParams)||void 0===r?void 0:r.color}}`,appendHtml:!0}),(null===(i=t.linkParams)||void 0===i?void 0:i.removeUnderline)&&G({element:e,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(e,t)=>{Array.from(e.classList).filter(e=>e!==o("hovered")&&e!==o("focused")).forEach(t=>{t.startsWith(n)&&e.classList.remove(t)});const r=((e.getAttribute("class")||"")+" "+t.classes).trim();e.setAttribute("class",r)},this.getParentComponent=()=>De(this.parentNode,r("element"),"host"),this.getWidgetContainerNode=()=>{const e=null==this?void 0:this.getAttribute(r("path"));return 1===(null==e?void 0:e.split(",").length)?this.parentNode:De(this.parentNode,r("path"),void 0,e=>1===(null==e?void 0:e.split(",").length))},this.getWidgetLanguages=()=>J(this.services.config),this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=e=>X(e,this.getWidgetLanguages()),this.stylesAppliedToElement=(e,t,n)=>{},this.updateContext=()=>{var e;const t=this.getModel();this.services.context.updateRecord(t.id,{label:this.getContextRecordLabel(t.props),viewIndex:null===(e=t.path)||void 0===e?void 0:e[0]})},this.getAutofillValue=()=>{var e;const t=this.getModel();return new Qe(this.services.config,this.services.context.getRegistry()).resolveValue(null===(e=t.props.control)||void 0===e?void 0:e.autofill,t.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(e,t)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=e?t:void 0,e&&this.services.context.updateRecord(this.getModel().id,{value:t})},this.addContextRecord=()=>{var e,t;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(e=this.getValidatedAutofillValue())&&void 0!==e?e:n.props.control.defaultValue||"",viewIndex:null===(t=n.path)||void 0===t?void 0:t[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.props)}})},this.getContextRecordLabel=e=>{var t,n,o,r,i,s;const a=e.control.name;if(["email","first_name","last_name"].includes(a))return a.toUpperCase();if((null===(t=e.content)||void 0===t?void 0:t.label)&&(null===(r=null===(o=null===(n=e.adaptiveStyles)||void 0===n?void 0:n.desktop.find(e=>"label"===e.element))||void 0===o?void 0:o.params)||void 0===r?void 0:r.enabled)){const t=(new DOMParser).parseFromString(e.content.label,"text/html");return this.capitalizeFirstLetter(t.body.textContent||"")}return(null===(i=e.content)||void 0===i?void 0:i.placeholder)?this.capitalizeFirstLetter(e.content.placeholder):(null===(s=e.control)||void 0===s?void 0:s.integrationName)?this.capitalizeFirstLetter(e.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=e=>e.charAt(0).toUpperCase()+e.slice(1),this.getContextRecordExampleValue=e=>{var t;switch(null===(t=e.control)||void 0===t?void 0:t.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(e)}},this.completeSubmitAction=e=>{const t=e||{},n=this.services.actionRegister.getRegisteredActions().find(e=>e.category===Be);n?null==n||n.execute(void 0,void 0,!0,t):this.services.actionFactory.get({type:se.REQUEST}).execute(void 0,void 0,!0,t)},this.getHandlers=()=>{var e;return(null===(e=this.getProps())||void 0===e?void 0:e.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(e="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${e?`/${e}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(e=this.constructor.define)||void 0===e?void 0:e.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then(()=>{this.attachHandlers()});const e=document.createElement("style");e.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(e)}disconnectedCallback(){var e;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(e=this.mergeTagsProcessor)||void 0===e||e.destroy()}}Ke._resolveTogglableStylesForElementModel=e=>{const t=Object.assign({},e);return Object.keys(t).forEach(e=>{e.toLowerCase().includes("styleattributes")&&(t[e]=Ke._resolveTogglableStyles(t[e]))}),t},Ke._resolveTogglableStyles=e=>{const t=Object.assign({},e),n=(e,n,o)=>{n in t&&(e.forEach(e=>{e in t&&(t[e]=t[n]?t[e]:o)}),delete t[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),t};const qe=Ke,Je=Symbol("required");var Xe=function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&Object.prototype.propertyIsEnumerable.call(e,o[r])&&(n[o[r]]=e[o[r]])}return n};function Ye(){}const Ze="pending",et="valid",tt="invalid";class nt extends qe{constructor(){super(...arguments),this._createControl=(e={},...t)=>{const{element:n}=e,o=Xe(e,["element"]),r=this.getProps(),i=this.getModel(),s=Object.assign(Object.assign(Object.assign({},r.control),{componentId:i.id,viewIdx:i.path[0]}),o),a=this.getAutofillValue();void 0!==a&&(s.defaultValue=a);const l=this.services.form,c=[s,n,...t],d=l.hasControl(r.control.name)?l.updateControl(...c):l.registerControl(...c);return void 0!==a&&d.getValue()===a&&this._validateAutofilledValue(d),d},this._validateAutofilledValue=e=>{e.validate({silent:!0}).then(t=>{t||e.markAsTouched(),this.syncAutofillContextRecord(t,e.getValue())})},this.createControlWithValidation=(e=[],t={})=>{const{element:n=this.getElement("input"),tooltipElement:o=this.getRootElement().querySelector(".input-tooltip"),validCallback:r=Ye,invalidCallback:i=Ye,pendingCallback:s=Ye,elementToListen:a=n,validationMap:l={},listenStatusChange:c=!0}=t,d=Xe(t,["element","tooltipElement","validCallback","invalidCallback","pendingCallback","elementToListen","validationMap","listenStatusChange"]);if(o&&(o.style.visibility="hidden"),!e||!Array.isArray(e))throw new Error("Validators should be an array");const h=this.getProps().control.validation,u=(null==h?void 0:h.validator)?l[h.validator]:void 0,p=e.some(e=>e[Je]),m=!!(null==h?void 0:h.required),g=m||p,b=[...e];m&&!p&&b.unshift(function(e="REQUIRED"){const t=t=>{let n;switch(typeof t){case"string":n=t&&t.length>0;break;case"boolean":n=t;break;case"number":n=!isNaN(t);break;default:n=!!t}return{isValid:n,errorKey:n?null:e}};return t[Je]=!0,t}()),u&&b.push(u);const f=this._prepareAsyncValidators(b),v=this._createControl({element:n,validation:{validator:"custom",required:g}},void 0,f);return c&&this._handleControlStatusChange(Object.assign({control:v,element:a,tooltipElement:o,configService:this.services.config,i18n:this.manifest.i18n,validCallback:r,invalidCallback:i,pendingCallback:s},d)),v},this._prepareAsyncValidators=(e=[])=>e.reduce((e,t,n)=>"function"!=typeof t?(console.warn(`Validator ${n} should be a function, so it will be skipped`),e):(e[`custom_${n}`]=async(...e)=>{const n=await Promise.resolve(t(...e));return"object"==typeof n&&"isValid"in n?Object.assign(Object.assign({},n),{errorKey:n.isValid?null:n.errorKey}):{isValid:!1,errorKey:"INVALID_VALIDATOR_RESPONSE"}},e),{}),this._handleControlStatusChange=e=>{e.control.on(c,t=>{this._handleValidationStatus(e,t)}),e.control.on(d,()=>{let t=Ze;switch(!0){case e.control.pending:t=Ze;break;case e.control.valid:t=et;break;default:t=tt}this._handleValidationStatus(e,t)})},this._handleValidationStatus=(e,t)=>{const{control:n,element:o,tooltipElement:r,validCallback:i,invalidCallback:s,errorMessageMapper:a,pendingCallback:l}=e,c=this.services.config,d=this.manifest.i18n;switch(t){case et:(function(e,t){e&&(e.classList.remove("invalid"),e.setAttribute("aria-invalid","false")),t&&(t.style.visibility="hidden")})(o,r),i&&i();break;case tt:if(n.touched){const e=n.getErrorKeys();if(!e)break;const t=e[0];let i=function(e,t,n){const o=X(t,J(e));if(!o)return n;const r=o.translations,i=Object.keys(r).find(e=>e.includes(n));return i?r[i]:n}(c,d,t);a&&(i=a(t,i)),q(o,r,i,this.htmlDocumentObject),s&&s()}break;case Ze:n.touched&&(function(e,t){t&&(t.style.visibility="hidden"),e&&e.classList.contains("invalid")&&(e.classList.remove("invalid"),e.removeAttribute("aria-invalid"))}(o,r),l&&l())}}}}const ot=new Map;ot.set("checkboxSize","inputSize"),ot.set("checkboxToTextGapSize","inputToTextGapSize");const rt=ot;function it(e){return it="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},it(e)}function st(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,o)}return n}function at(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?st(Object(n),!0).forEach(function(t){pt(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):st(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function lt(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,mt(o.key),o)}}function ct(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(ct=function(){return!!e})()}function dt(){return dt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var o=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=ht(e)););return e}(e,t);if(o){var r=Object.getOwnPropertyDescriptor(o,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},dt.apply(null,arguments)}function ht(e){return ht=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},ht(e)}function ut(e,t){return ut=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},ut(e,t)}function pt(e,t,n){return(t=mt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mt(e){var t=function(e){if("object"!=it(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=it(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==it(t)?t:t+""}var gt=function(){function e(){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return pt(t=function(e,t,n){return t=ht(t),function(e,t){if(t&&("object"==it(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,ct()?Reflect.construct(t,n||[],ht(e).constructor):t.apply(e,n))}(this,e,[].concat(o)),"updateCheckmark",function(e){var n,o=t.getRootElement().querySelector(".checkmark");e?(o.classList.add("checkmark-checked"),n=t.getCheckmarkStyleAttributes("selectedBackground")):(o.classList.remove("checkmark-checked"),n=t.getCheckmarkStyleAttributes("defaultBackground")),o.style.background="".concat(n),o.style["backdrop-filter"]=t.getCheckmarkStyleAttributes("backdropFilter")}),pt(t,"getInputAdaptiveStyles",function(){var e=t.getProps(),n=t.getEnvironment();return e.adaptiveStyles[n].filter(function(e){return"input"===e.element})}),pt(t,"getCheckmarkStyleAttributes",function(e){var n=t.getInputAdaptiveStyles();return n.length&&n[0].markerStyleAttributes?e?n[0].markerStyleAttributes[e]:n[0].markerStyleAttributes:n.length&&n[0].checkmarkStyleAttributes?e?n[0].checkmarkStyleAttributes[e]:n[0].checkmarkStyleAttributes.checkboxSize||n[0].checkmarkStyleAttributes.inputSize?n[0].checkmarkStyleAttributes:at({inputSize:"22px",inputToTextGapSize:"16px"},n[0].checkmarkStyleAttributes):e?t.defaultCheckmarkStyleAttributes[e]:t.defaultCheckmarkStyleAttributes}),pt(t,"registerLabelControl",function(e){var n=t.getProps(),o="".concat(n.control.name,"_label");if(!t.services.form.hasControl(o)){var r={name:o,defaultValue:e};t.services.form.registerControl(at(at({},r),{},{componentId:t.getModel().id,viewIdx:t.getModel().path[0]}),null)}}),pt(t,"setStylesVariables",function(e){var n=t.getCheckmarkStyleAttributes();Object.keys(n).forEach(function(t){var o=rt.get(t)||t;e.style.setProperty("--".concat(o),n[t])})}),pt(t,"manifest",a),pt(t,"defaultCheckmarkStyleAttributes",{inputSize:"22px",inputToTextGapSize:"13px",selectedBackground:"rgb(255,255,255)",defaultBackground:"rgb(255,255,255)",backdropFilter:"none"}),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ut(e,t)}(e,nt),function(e,t){return t&&lt(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e}(e,[{key:"connectedCallback",value:function(){var t=this;!function(e,t,n){var o=dt(ht(e.prototype),"connectedCallback",n);return"function"==typeof o?function(e){return o.apply(n,e)}:o}(e,0,this)([]),this.getRootElement().innerHTML+="\n ".concat('\n<style>\n/* The host height reaches the checkbox row through flex sizing, not height:100%:\n in a quirks-mode document (the dashboard preview iframes are about:blank, some\n customer pages have no doctype) WebKit resolves that percentage past the\n auto-height host against the enclosing flex column, so in Safari the consent\n grew to the column and pushed everything below it out of the view.\n min-height:0 lets the boxes clamp to a host smaller than the label, as\n height:100% did. The chain only works while the host stays display:flex. */\n:host {\n display: flex;\n flex-direction: column;\n}\n\n/* an author :host display beats the user-agent [hidden] rule */\n:host([hidden]) {\n display: none;\n}\n\n.main-container {\n display: flex;\n flex-direction: column;\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.label-with-input-container {\n display: flex;\n flex-direction: row;\n flex: 1 1 auto;\n min-height: 0;\n}\n\n.input-with-tooltip {\n position: relative;\n display: flex;\n align-items: baseline;\n align-self: stretch;\n width: 100%;\n}\n\n.invalid {\n border: 1px solid #ff0000 !important;\n}\n\n.input-tooltip {\n visibility: hidden;\n position: absolute;\n right: -10px;\n top: -10px;\n z-index: 1;\n border-radius: 100%;\n width: 20px;\n height: 20px;\n display: flex;\n justify-content: center;\n align-items: center;\n -webkit-touch-callout: none; /* iOS Safari */\n -webkit-user-select: none; /* Chrome/Safari/Opera */\n -khtml-user-select: none; /* Konqueror */\n -moz-user-select: none; /* Firefox */\n -ms-user-select: none; /* Internet Explorer/Edge */\n user-select: none;\n}\n\ninput {\n -moz-appearance:none;\n -webkit-appearance:none;\n -o-appearance:none;\n width: 24px;\n height: 24px;\n padding: 0 10px;\n margin: 0;\n}\n\n/* The container */\n.checkmark-container {\n display: block;\n position: relative;\n height: 25px;\n width: 25px;\n cursor: pointer;\n font-size: 22px;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n}\n\n/* Hide the browser\'s default checkbox */\n.checkmark-container input {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n}\n\n/* Create a custom checkbox */\n.checkmark {\n position: absolute;\n top: 0;\n left: 0;\n height: var(--inputSize, 22px);\n width: var(--inputSize, 22px);\n display: flex;\n align-items: center;\n justify-content: center;\n padding-bottom: 2px;\n}\n\n.checkmark:after {\n content: "";\n position: absolute;\n display: none;\n}\n\n.checkmark-checked:after {\n display: block;\n}\n\n.checkmark-container .checkmark:after {\n width: 9px;\n height: 14px;\n border: solid #000000;\n border-width: 0 3px 3px 0;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n}\n\n.label {\n margin: auto auto auto var(--inputToTextGapSize, 18px);\n flex: 1;\n height: auto;\n min-height: 10px;\n}\n\ninput:focus ~ .checkmark.focus-outline-defined {\n outline: var(--clFocusOutline);\n}\n\n</style>\n ','\n <div class="main-container">\n <div class="label-with-input-container">\n <div class="input-with-tooltip">\n <label class="checkmark-container">\n <input type="checkbox"\n name="fname"\n aria-labelledby="cl-consent-label">\n <span cl-element="input" class="checkmark"></span>\n </label>\n <div class="input-tooltip" aria-hidden="true">\n <svg width="26" height="26" viewBox="0 0 26 26" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true">\n <path d="M1.5 13.0604C1.5 19.4116 6.6481 24.5605 13.0075 24.5605C19.353 24.5605 24.5 19.4107 24.5 13.0604C24.5 6.70865 19.3531 1.55909 13.0075 1.55908C6.64806 1.55908 1.5 6.7077 1.5 13.0604ZM12.9775 17.9668C12.7032 17.9668 12.4807 17.7443 12.4807 17.47C12.4807 17.1956 12.7032 16.9732 12.9775 16.9732C13.2519 16.9732 13.4743 17.1956 13.4743 17.47C13.4743 17.7443 13.2519 17.9668 12.9775 17.9668ZM12.9775 13.4764C12.7032 13.4764 12.4807 13.254 12.4807 12.9796L12.4807 8.48924C12.4807 8.21487 12.7032 7.99245 12.9775 7.99245C13.2519 7.99245 13.4743 8.21487 13.4743 8.48924L13.4743 12.9796C13.4743 13.254 13.2519 13.4764 12.9775 13.4764Z" fill="#FF0000" stroke="white" stroke-width="2"></path>\n </svg>\n </div>\n <div cl-element="label"\n cl-inline-edit="content, label"\n class="label"\n id="cl-consent-label">\n </div>\n </div>\n </div>\n </div>\n ');var n=this.getRootElement(),o=n.querySelector(".checkmark"),r=this.createControlWithValidation([],{element:n.querySelector("input"),validCallback:function(){o.classList.contains("invalid")&&o.classList.remove("invalid")},invalidCallback:function(){o.classList.contains("invalid")||o.classList.add("invalid")}});r.on("valueChanged",function(e){t.updateCheckmark(e)}),this.updateCheckmark(!!r.getValue()),this.observeProps(function(e,n){t.applyAutoAdaptiveStyles(n.adaptiveStyles),G({element:t.getRootElement().querySelector(".label"),html:n.content.label}),t.registerLabelControl(n.content.label);var o,r=t.getRootElement().querySelector('input[type="checkbox"]');r&&r.setAttribute("aria-required",String(!(null===(o=n.control)||void 0===o||null===(o=o.validation)||void 0===o||!o.required))),t.setStylesVariables(t.getHostElement());var i=t.getRootElement().querySelector(".checkmark-container");i.style.width=t.getCheckmarkStyleAttributes("inputSize"),i.style.height=t.getCheckmarkStyleAttributes("inputSize"),function(e){let t=null;const n=e,o=["transparent","initial"];e&&(e.style.borderColor&&!o.includes(e.style.borderColor)&&(parseFloat(e.style.borderWidth)||parseFloat(e.style.borderBottomWidth))&&(t=V(n,e,"borderColor")),!t&&e.style.getPropertyValue("--borderBottomColor")&&!o.includes(e.style.getPropertyValue("--borderBottomColor"))&&parseFloat(e.style.getPropertyValue("--borderBottomWidth"))&&(t=V(n,e,"--borderBottomColor")),t||!e.style.backgroundColor||o.includes(e.style.backgroundColor)||(t=V(n,e,"backgroundColor")),t||!e.style.color||o.includes(e.style.color)||(t=V(n,e,"color")),t||n.classList.remove("focus-outline-defined"))}(t.getElement("input"))})}}])}();pt(gt,"define",{name:"sys-consent",model:a.name,manifest:a});export{gt as default};window.clComponentClass_SysConsentComponent=gt;
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see SysPromoCodeComponent.js.LICENSE.txt */
2
- const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const o="VIEW",i="CONTAINER",r="INPUT",s="BUTTON",l="CONSENT",a="COLUMN";var c,d;(d=c||(c={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",d.REQUEST="REQUEST",d.DISPATCH_EVENT="DISPATCH_EVENT",d.GO_TO_VIEW="GO_TO_VIEW",d.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",d.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",d.SHOW_WIDGET="SHOW_WIDGET",d.OPEN_LINK="OPEN_LINK",d.CLOSE_WIDGET="CLOSE_WIDGET",d.CLICK="CLICK";const u=c;var h,p;class m{static sortActions(t){const e={[u.CLOSE_WIDGET]:-1,[u.OPEN_LINK]:-2,[u.SHOW_WIDGET]:1,[u.SUBSCRIBE_CONTACT]:2,[u.REQUEST]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0)}constructor(t,e){this.config=t,this.actions=m.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,o){this.state=t;const i=o(),r=i.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,r)}),this.listener=t=>{const e=t.composedPath().filter(t=>t instanceof HTMLElement&&t.getAttribute(n("type")));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==r;){let t=e[o].getAttribute(n("type"));if(m.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;o++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((i.shadowRoot||i).querySelectorAll(this.config.relativeSelector)):[i],this.targetElements.forEach(t=>{t.addEventListener("click",this.listener)})}async execute(){var t,e,n,o;try{for(var i,r=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise(function(o,i){!function(t,e,n,o){Promise.resolve(o).then(function(e){t({value:e,done:n})},e)}(o,i,(e=t[n](e)).done,e.value)})}}}(this.eventsQueue);!(t=(i=await s.next()).done);r=!0){o=i.value,r=!1;const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{r||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach(t=>{t.removeEventListener("click",this.listener)}),this.targetElements=[])}}m.IGNORING_VIEW_ENTRY_TYPES=[s,l,r],(p=h||(h={})).CLICK="CLICK",p.COMPONENT_EVENT="COMPONENT_EVENT";class g{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,o){var i;const r=null===(i=o())||void 0===i?void 0:i.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,r)}),this.componentEmitterListener=e.on(this.config.eventName,()=>{this.actions.forEach(e=>e.execute(t.getState(),this.config.params))})}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class f{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map(t=>this.actionFactory.get(t));switch(e.forEach(t=>this.actionRegister.register(t)),t.type){case h.CLICK:return new m(t,e);case h.COMPONENT_EVENT:return new g(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class b{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class v{constructor(){this.listeners=v.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach(o=>o(e,t,n)),Object.values(this.listeners["*"]).forEach(o=>o(e,t,n))}on(t,e){const n=b.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=v.createDefaultListenersState()}}v.createDefaultListenersState=()=>({"*":{}});const y=v,E=(t,e,n,o)=>{const i=EventTarget.prototype,{addEventListenerBase:r,addEventListener:s}=i;(r||s).call(t,e,n,o)};class C{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class O extends y{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",({isMobileEnv:t})=>{this._isMobile=t,this.emit(O.changeEventName,this._isMobile)})}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(O.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(O.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}O.changeEventName="CHANGE";const T=O;class S{static set(t,e){const n=t[S.accumulatorPropertyName]||{};t[S.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[S.accumulatorPropertyName]).forEach(n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""})}}S.accumulatorPropertyName="clStyleAttributes";const A=S;var P,_;(_=P||(P={})).BUILT_IN="BUILT_IN",_.DETACHED="DETACHED",_.FLOATING_BOX="FLOATING_BOX",_.FLOATING_BAR="FLOATING_BAR",_.LAUNCHER="LAUNCHER",_.CONTENT_LOCKER="CONTENT_LOCKER";class x{static applyHostStyles(t,e,n=null,r){var s,l,c;const d=null===(l=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===l?void 0:l.find(t=>"CLICK"===t.type);d&&(null===(c=d.actions)||void 0===c?void 0:c.length)&&(e.style.cursor="pointer"),t!==o&&t!==i&&t!==a||(e.style.display=r===P.CONTENT_LOCKER&&t===o?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class R{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class w{constructor(t,e,n,o,i,r){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=i,this.httpClient=r,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach(n=>{var o,i,r,s,l;const a=null===(i=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===i?void 0:i.find(t=>t.element===n),c=(null===(r=e.styles)||void 0===r?void 0:r.find(t=>t.element===n))||{},d=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),u=this.parseBackground(d);u.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:u.url,inlineSvgString:null,positionOptions:u.positionOptions})}),Promise.all([...this.envUrlMaps[t].entries()].map(([e,n])=>this.httpClient.execute({url:n.originalSVGResourceURL}).then(t=>t.text()).then(o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))).then(()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)}).catch(t=>{console.error(t),R.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)})}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)}),this.themeSubscription=this.documentModel.on("THEME_UPDATE",t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)}),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let o=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach(t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var i;o=o.replace(`var(--${i=n,`cl-schema-${i}`})`,e[n])}),`url('data:image/svg+xml,${encodeURIComponent(o)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const N=new class{execute({url:t,method:e="GET",body:n=null,headers:o,abortSignal:i}){const r={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:i};return n&&(r.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,r)}};function I(t,e){return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})}class L{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,t=>"_"+t).toUpperCase()}}class M{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var k;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",t.LEAD_PROGRESS="LEAD_PROGRESS"}(k||(k={}));const D=k;class j{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(D.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(D.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new M(this.onCounterStateUpdate)}}}const U=(...t)=>{let e=t.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:[]}),{});return{get:t=>e[t],clear:()=>U(...t)}},H=U,B="props",F="shared",V="environment";function W(t,e,n,o){const i=t=>{let r=function(t){return t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host||null:t}(t);return r&&(o&&"function"==typeof o?o(r.getAttribute(e)):(null===(s=null==r?void 0:r.getAttribute)||void 0===s?void 0:s.call(r,e))===n)?r:r&&r.parentNode&&i(r.parentNode)||null;var s};return i(t)}const G="SUBMIT";function z(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach(n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o}),t):t}const $={DESKTOP:"desktop",MOBILE:"mobile"};function K(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find(t=>t.element===n)}function Z(t=[]){return t.map(t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)}))}function Q(t){const{element:e,html:n,appendHtml:o}=t,i=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach(e=>t.removeAttribute(e)),Array.from(t.attributes).forEach(e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)}),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}}),e.body.innerHTML}(n);o?e.innerHTML+=i:e.innerHTML=i}const Y=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class q extends Y{constructor(t,e={},n){super(t,Object.assign(Object.assign({},n),{detail:e}))}}var X,J,tt;function et(t){if(null!=t&&""!==t)return"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t)}!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(X||(X={})),(tt=J||(J={})).STATIC="STATIC",tt.DATA_LAYER="DATA_LAYER",tt.URL_QUERY_PARAMS="URL_QUERY_PARAMS",tt.JS_API_VARIABLE="JS_API_VARIABLE",tt.COOKIE="COOKIE",tt.LOCAL_STORAGE="LOCAL_STORAGE";class nt{constructor(t,e){this.configService=t,this.registry=e}resolveValue(t,e){if(!(null==t?void 0:t.enabled)||!t.sourceType||this.configService.getConfig("renderMode")===X.UPDATING)return;const n=function(t,e,n,o){if(!e)return;if(e===J.STATIC)return et(null==n?void 0:n.value);const i=t.getSource(e);if(!i)return;const r=i.getValue(o);return et("function"==typeof(null==r?void 0:r.processor)?r.processor(i,Object.assign({id:o},n)):null==r?void 0:r.value)}(this.registry,t.sourceType,t.config,e);if(void 0===n)return;const o=n.trim();return""===o?void 0:o}}class ot extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 0,this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const i=o.closest(`[${n("widget-id")}]`);let r;i&&(r=i.getAttribute(n("widget-id")));let s=new q("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:r},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=H(B,F,V),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach(t=>null==t?void 0:t.off())}},this.state=new C({}),this.componentEventEmitter=new y,this.componentResourceManager=new j(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new f(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,t=>{this.model.props=t,this.observers.get(B).forEach(e=>e(this.prevProps,t)),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)}),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,t=>{Object.assign(this.model,t)}),this.documentModel.on("SHARED_UPDATE_ALL",()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(F).forEach(t=>t(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new w(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),N),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(T.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(V).forEach(e=>e(this.prevEnvironment,t)),this.prevEnvironment=t})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")}))},this.attachHandlers=()=>{this.getHandlers().map(t=>this._handlerFactory.get(t)).map(t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this))).forEach(t=>t())},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.postpone())},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.release())},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===X.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===X.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(B).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(F).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(V).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter(t=>!t.hasAttribute(n("component")))],this.getElement=(t,e)=>this.getElements().find(o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const o=this.getElements();if(!o.length)return;const i=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach(t=>{const e=t.element;let o=!1,i=!1;n.desktop&&n.desktop.forEach(n=>{n.element===e&&(z(n,t),o=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===e&&(z(n,t),i=!0)}),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))}),n}(t,e),r=n("type"),s="element-styles";let l=this.getRootElement().querySelector(`style[${r}="${s}"]`);l||(l=document.createElement("style"),l.setAttribute(r,s),this.getRootElement().appendChild(l)),Q({element:l,html:""}),o.forEach(t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let r=K(i,o,e);if(r){if(this.resizeListener.isMobile()){const t=K(i,"desktop",e);t&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),r.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(r),l)}}),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var i,r;const s=[];"host"===(e=ot._resolveTogglableStylesForElementModel(e)).element&&(x.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.desktop)||"mobile"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],E(t,"load",()=>{this.componentResourceManager.getPending().decrement()}),E(t,"error",()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()})}const c=Object.assign(Object.assign({},e),{styleAttributes:I(e.styleAttributes,s)});if(A.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let i=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let r=this.getRootElement().querySelector(`#${o}`);r||(r=document.createElement("style"),r.id=o,t.appendChild(r)),Q({element:r,html:`\n ${n}::before {\n content: '';\n background: ${i.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),i=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}i.borderTopWidth&&"0px"!==i.borderTopWidth||delete i.borderTopColor,i.borderBottomWidth&&"0px"!==i.borderBottomWidth||delete i.borderBottomColor,i.borderLeftWidth&&"0px"!==i.borderLeftWidth||delete i.borderLeftColor,i.borderRightWidth&&"0px"!==i.borderRightWidth||delete i.borderRightColor,this._addStylesToStyleElement(o,e.element,i,`:not(.${n("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(o,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(o,this.getShared()),this.stylesAppliedToElement(t,e,o)}},this.applySharedClassesToElementModel=e=>function(e,n,o=!1){let i=e;return(i.classes||"").split(" ").filter(e=>e.startsWith(t)).forEach(t=>{var e;const r=null===(e=n.textClasses)||void 0===e?void 0:e[t];if(!r)return;let s=function(t,e){return{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),e?t.mobileStyleAttributes:{}),placeholderStyleAttributes:Object.assign(Object.assign({},t.placeholderStyleAttributes),e?t.mobilePlaceholderStyleAttributes:{})}}(r,o);s.styleAttributes.fontFamily||(r.isHeader&&n.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.headerFontFamily})})),!r.isHeader&&n.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),s.placeholderStyleAttributes)})}),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(e,this.documentModel.getShared(),this.resizeListener.isMobile()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,o,i="",r)=>{const s=Object.keys(o).reduce((t,e)=>t+` ${L.camelCaseToDashCase(e)}: ${o[e]}${r?" !important;":";"}`,"");Q({element:t,html:`[${n("element")}="${e}"]${i} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&Q({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&Q({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=e.linkParams)||void 0===r?void 0:r.removeUnderline)&&Q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,o)=>{Array.from(n.classList).filter(t=>t!==e("hovered")&&t!==e("focused")).forEach(e=>{e.startsWith(t)&&n.classList.remove(e)});const i=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",i)},this.getParentComponent=()=>W(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:W(this.parentNode,n("path"),void 0,t=>1===(null==t?void 0:t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter(t=>!!t);var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null},null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.getAutofillValue=()=>{var t;const e=this.getModel();return new nt(this.services.config,this.services.context.getRegistry()).resolveValue(null===(t=e.props.control)||void 0===t?void 0:t.autofill,e.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(t,e)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=t?e:void 0,t&&this.services.context.updateRecord(this.getModel().id,{value:e})},this.addContextRecord=()=>{var t,e;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(t=this.getValidatedAutofillValue())&&void 0!==t?t:n.props.control.defaultValue||"",viewIndex:null===(e=n.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.props)}})},this.getContextRecordLabel=t=>{var e,n,o,i,r,s;const l=t.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(i=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find(t=>"label"===t.element))||void 0===o?void 0:o.params)||void 0===i?void 0:i.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(r=t.content)||void 0===r?void 0:r.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(s=t.control)||void 0===s?void 0:s.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find(t=>t.category===G);n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:u.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then(()=>{this.attachHandlers()});const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ot._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach(t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ot._resolveTogglableStyles(e[t]))}),e},ot._resolveTogglableStyles=t=>{const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach(t=>{t in e&&(e[t]=e[n]?e[t]:o)}),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const it=ot;function rt(t){return Object.values($).map(e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t}))}const st={name:"SysPromoCodeComponent",componentType:"PROMO_CODE",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:rt([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:rt([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:rt([{type:"CONTROL",name:"PRIZE_SETTINGS",propPath:["content","prize"],params:{linkedGamifiedComponentType:"PRIZE_BASED_GAMING"},displayCondition:function(t){return!!t.prizePool||t.documentUtils.findComponentsByTypes(t.views,["PRIZE_BASED_GAMING"]).some(function(e){return e.path[0]<t.component.path[0]})}},{type:"TEXT",params:{text:"DOCUMENT_CLICK_COMPONENT_TO_COPY_TO_CLIPBOARD",type:"SECONDARY"}},{type:"CONTROL",name:"SWITCH",propPath:["content","countAsTargetAction"],params:{label:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_LABEL",boldLabel:!0,tooltip:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_TOOLTIP"},displayCondition:function(t){return"INFORMER"===t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["content","autoRedeem"],params:{label:"i18n_DOCUMENT_AUTO_REDEEM_LABEL",boldLabel:!0,tooltip:"i18n_DOCUMENT_AUTO_REDEEM_TOOLTIP",getValueMapper:{undefined:!0,true:!0,false:!1}},displayCondition:function(t){var e;return"SHOPIFY"===(null===(e=t.editorConfig)||void 0===e||null===(e=e.userContext)||void 0===e?void 0:e.registrationType)}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text"}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"PROMOCODE_ICON",propPath:["styles","[element=icon]","styleAttributes"],params:{visibleDisplayValue:"flex"}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"HOVER_ANIMATION",propPath:["styles","[element=text]","hoverStyleAttributes"],params:{animationTypeProp:{propPath:["styles","[element=text]","hoverAnimationType"]}}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}])},autoContrast:[{slave:{element:"text",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"icon",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","iconContrastEnabled"]}],i18nPropPaths:["content,text"],props:{styles:[{element:"text",styleAttributes:{borderTopStyle:"dashed",borderRightStyle:"dashed",borderBottomStyle:"dashed",borderLeftStyle:"dashed",borderTopWidth:"2px",borderTopColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderBottomWidth:"2px",borderBottomColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderLeftWidth:"2px",borderLeftColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderRightWidth:"2px",borderRightColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none",background:"transparent"},hoverStyleAttributes:{}},{element:"icon",styleAttributes:{display:"flex",position:"static",marginLeft:"10px",right:"5px",color:"var(--cl-schema-accent, rgb(68, 68, 68))","--clPromocodeIconWidth":"18px","--clPromocodeIconHeight":"18px"}}],adaptiveStyles:(lt=[{element:"host",styleAttributes:{width:"auto",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"20px",paddingRight:"20px",_paddingEnabled:!0,color:"var(--cl-schema-accent, rgb(68, 68, 68))",textAlign:"center",lineHeight:"120%",fontWeight:"500",fontSize:"18px",textShadow:"none"},classes:""}],Object.values($).reduce((t,e)=>Object.assign(t,{[e]:Z(lt)}),{desktop:[],mobile:[]})),content:{text:"PROMO_10",iconContent:0,iconContrastEnabled:!0,textContrastEnabled:!0,autoRedeem:!0}},metaDescription:{icon:"/SysPromoCodeComponent/assets/img/component-icon.svg",label:{en:"Promo code",ru:"Промокод",uk:"Промокод",es:"Código promocional",fr:"Code promo",de:"Gutscheincode",it:"Codice promozionale",pt:"Código promocional",ro:"Cod promoțional",bg:"Промоционален код",cs:"Promo kód",el:"Κωδικός προσφοράς",nl:"Promotiecode",pl:"Kod promocyjny",sv:"Rabattkod",tr:"Promosyon kodu",ar:"الرمز الترويجي",zh:"促销码",da:"Kampagnekode",he:"קוד קידום",fi:"Alennuskoodi",hi:"प्रोमो कोड",hr:"Promotivni kod",hu:"Promo kód",id:"Kode promo",ja:"プロモコード",ko:"프로모션 코드",no:"Kampanjekode",sk:"Propagačný kód",sl:"Promocijska koda",sr:"Promo kod"}},syncEnabled:!0,stylesImitationEnabled:!0};var lt;function at(t){if("function"!=typeof document.execCommand)return Promise.reject(new Error("copyToClipboard: document.execCommand is not available"));const e=document.getSelection();if(!e)return Promise.reject(new Error("copyToClipboard: the document has no selection"));const n=function(t){const e=[];for(let n=0;n<t.rangeCount;n+=1)e.push(t.getRangeAt(n));return e}(e),o=function(t){const e=document.createElement("span");return e.textContent=t,e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.opacity="0",e.style.pointerEvents="none",e.style.whiteSpace="pre",e.style.textTransform="none",e.style.setProperty("user-select","text"),e.style.setProperty("-webkit-user-select","text"),e}(t);try{document.body.appendChild(o);const n=document.createRange();return n.selectNodeContents(o),e.removeAllRanges(),e.addRange(n),String(e)!==t?Promise.reject(new Error("copyToClipboard: the text could not be selected")):document.execCommand("copy")?Promise.resolve():Promise.reject(new Error("copyToClipboard: the copy command failed"))}catch(t){return Promise.reject(t)}finally{o.remove(),e.removeAllRanges(),n.forEach(t=>e.addRange(t))}}const ct={en:"Copied!",ru:"Скопировано!",uk:"Скопійовано!",es:"Copiado!",de:"Kopiert!",fr:"Copié!",it:"Copiato!",pt:"Copiado!",ro:"Copiat!",bg:"Копирано!",cs:"Zkopírováno!",el:"Αντιγράφηκε!",nl:"Gekopieerd!",pl:"Skopiowane!",sv:"Kopierade!",tr:"Kopyalandı!",ar:"نسخ!",hu:"Másolva!"},dt=['\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24">\n <path d="M7.9,9.5L0,3.8c1.2-1.6,3.4-2,5.1-0.9l8.5,6l3.1-2.2c-1.2-2-0.6-4.6,1.3-5.9c2-1.4,4.8-0.9,6.2,1.1 c1.4,2,0.9,4.8-1.1,6.3c-1.4,1-3.1,1.1-4.6,0.3l-3.8,2.7l3.8,2.7c1.4-0.7,3.2-0.6,4.6,0.3c2,1.4,2.5,4.2,1.1,6.3 c-1.4,2-4.2,2.5-6.2,1.1c-1.9-1.4-2.5-3.9-1.3-5.9l-4-2.7H7.4l3-1.7L7.9,9.5z M22.8,17.9c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3 c0,1.3,1,2.3,2.3,2.3C21.8,20.2,22.8,19.2,22.8,17.9z M22.8,4.5c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3s1,2.3,2.3,2.3 C21.8,6.8,22.8,5.8,22.8,4.5z" fill="currentColor"/>\n </svg>\n ','\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none">\n <path d="M10.5278 12.0003L0.0870176 20.5846C0.0276258 20.6336 0.021828 20.72 0.0784574 20.7716C0.735083 21.3673 4.70771 24.1658 13.7643 14.862L15.2546 16.1708C15.0272 16.728 14.9013 17.3393 14.9013 17.9815C14.9013 20.571 16.9449 22.667 19.47 22.667C21.9952 22.667 24.0391 20.571 24.0391 17.9815C24.0391 15.392 21.9952 13.2961 19.47 13.2961C18.5938 13.2961 17.7758 13.5487 17.0811 13.9867L14.8192 12.0003L17.0811 10.0137C17.7761 10.4516 18.5941 10.7043 19.47 10.7043C21.9952 10.7043 24.0391 8.60803 24.0391 6.01913C24.0391 3.43022 21.9952 1.33366 19.47 1.33366C16.9449 1.33366 14.9013 3.42965 14.9013 6.01913C14.9013 6.66132 15.0272 7.27265 15.2546 7.82986L13.764 9.13947C4.70771 -0.164618 0.735083 2.63335 0.0784574 3.22909C0.021828 3.28093 0.0276258 3.36677 0.0870176 3.41606L10.5278 12.0003ZM19.47 15.7884C20.6518 15.7886 21.6087 16.7696 21.6087 17.9815C21.6087 19.1934 20.6518 20.1747 19.47 20.1747C18.2885 20.1747 17.3317 19.1934 17.3317 17.9815C17.3317 16.7696 18.2885 15.7884 19.47 15.7884ZM19.47 3.82625C20.6518 3.82625 21.6087 4.80725 21.6087 6.01913C21.6087 7.231 20.6518 8.21229 19.47 8.21229C18.2885 8.21229 17.3317 7.231 17.3317 6.01913C17.3317 4.80725 18.2885 3.82625 19.47 3.82625Z" fill="currentColor"/>\n </svg>\n '],ut=['\n <svg width="16" height="18" viewBox="0 0 16 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 0H10C11.6569 0 13 1.34315 13 3V12C13 13.6569 11.6569 15 10 15H3C1.34315 15 0 13.6569 0 12V3C0 1.34314 1.34315 0 3 0ZM3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H10C10.5523 13 11 12.5523 11 12V3C11 2.44772 10.5523 2 10 2H3Z" fill="currentColor"/>\n <path d="M3 15C3 16.6569 4.34315 18 6 18H13C14.6569 18 16 16.6569 16 15V6C16 4.34315 14.6569 3 13 3V5C13.5523 5 14 5.44772 14 6V15C14 15.5523 13.5523 16 13 16H6C5.44772 16 5 15.5523 5 15H3Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M10.8 1H2.2C1.53726 1 1 1.53726 1 2.2V12.8C1 13.4627 1.53726 14 2.2 14H10.8C11.4627 14 12 13.4627 12 12.8V2.2C12 1.53726 11.4627 1 10.8 1ZM2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 2C0 0.89543 0.895431 0 2 0H11C12.1046 0 13 0.895431 13 2V13C13 14.1046 12.1046 15 11 15H2C0.89543 15 0 14.1046 0 13V2Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 16C3 17.1046 3.89543 18 5 18H14C15.1046 18 16 17.1046 16 16V5C16 3.89543 15.1046 3 14 3V13C14 14.6569 12.6569 16 11 16H3ZM3 15V5C3 3.89543 3.89543 3 5 3H13V13C13 14.1046 12.1046 15 11 15H3Z" fill="currentColor"/>\n </svg>\n '];var ht="12px",pt="14px";const mt="\n .cl-promo-code-tooltip-container {\n z-index: ".concat(String(Number.MAX_SAFE_INTEGER),";\n padding: 10px;\n display: inline-block;\n position: fixed;\n background: #000;\n opacity: 1;\n border: 2px solid #FFF;\n border-radius: 5px;\n max-height: fit-content;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: ").concat(ht,";\n border-style: solid;\n border-color: black transparent transparent transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:before {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 15px);\n border-width: ").concat(pt,";\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:after {\n content: \"\";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: ").concat(ht,";\n border-style: solid;\n border-color: transparent transparent black transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:before {\n content: \"\";\n position: absolute;\n top: -28px;\n left: calc(50% - 11px);\n border-width: ").concat(pt,";\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n");class gt{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){var e;const n=t||document;return Math.max(n.documentElement.clientWidth,(null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)}static height(t){var e;const n=t||document;return Math.max(n.documentElement.clientHeight,(null===(e=n.defaultView)||void 0===e?void 0:e.innerHeight)||0)}static scrollbarWidth(t){var e;const n=t||document;return((null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)-n.documentElement.clientWidth}}function ft(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}var bt=Array.prototype.concat,vt=Array.prototype.slice,yt=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var i=t[n];ft(i)?e=bt.call(e,vt.call(i)):e.push(i)}return e};yt.wrap=function(t){return function(){return t(yt(arguments))}};const Et=yt;var Ct={},Ot=Object.hasOwnProperty,Tt=Object.create(null);for(var St in Ct)Ot.call(Ct,St)&&(Tt[Ct[St]]=St);var At={to:{},get:{}};function Pt(t,e,n){return Math.min(Math.max(e,t),n)}At.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=At.get.hsl(t),n="hsl"):(e=At.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},At.get.rgb=function(t){if(!t)return null;var e,n,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(e.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Ot.call(Ct,e[1])?((i=Ct[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=Pt(i[n],0,255);return i[3]=Pt(i[3],0,1),i},At.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,Pt(parseFloat(e[2]),0,100),Pt(parseFloat(e[3]),0,100),Pt(isNaN(n)?1:n,0,1)]}return null},At.to.rgb=function(){var t=Et(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},At.to.hsl=function(){var t=Et(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const _t=At,xt={},Rt={};for(const t of Object.keys(xt))Rt[xt[t]]=t;const wt={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(wt)){if(!("channels"in wt[t]))throw new Error("missing channels property: "+t);if(!("labels"in wt[t]))throw new Error("missing channel labels property: "+t);if(wt[t].labels.length!==wt[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=wt[t];delete wt[t].channels,delete wt[t].labels,Object.defineProperty(wt[t],"channels",{value:e}),Object.defineProperty(wt[t],"labels",{value:n})}wt.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,i=Math.min(e,n,o),r=Math.max(e,n,o),s=r-i;let l,a;r===i?l=0:e===r?l=(n-o)/s:n===r?l=2+(o-e)/s:o===r&&(l=4+(e-n)/s),l=Math.min(60*l,360),l<0&&(l+=360);const c=(i+r)/2;return a=r===i?0:c<=.5?s/(r+i):s/(2-r-i),[l,100*a,100*c]},wt.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let i,r,s;if(0===n)return s=255*o,[s,s,s];i=o<.5?o*(1+n):o+n-o*n;const l=2*o-i,a=[0,0,0];for(let t=0;t<3;t++)r=e+1/3*-(t-1),r<0&&r++,r>1&&r--,s=6*r<1?l+6*(i-l)*r:2*r<1?i:3*r<2?l+(i-l)*(2/3-r)*6:l,a[t]=255*s;return a};const Nt=wt;function It(t,e){return function(n){return e(t(n))}}function Lt(t,e){const n=[e[t].parent,t];let o=Nt[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),o=It(Nt[e[i].parent][i],o),i=e[i].parent;return o.conversion=n,o}const Mt={};Object.keys(Nt).forEach(t=>{Mt[t]={},Object.defineProperty(Mt[t],"channels",{value:Nt[t].channels}),Object.defineProperty(Mt[t],"labels",{value:Nt[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(Nt);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(Nt[t]);for(let i=o.length,r=0;r<i;r++){const i=o[r],s=e[i];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(i))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,i=0;i<t;i++){const t=o[i];null!==e[t].parent&&(n[t]=Lt(t,e))}return n}(t);Object.keys(e).forEach(n=>{const o=e[n];Mt[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),Mt[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)})});const kt=Mt,Dt=["keyword","gray","hex"],jt={};for(const t of Object.keys(kt))jt[[...kt[t].labels].sort().join("")]=t;const Ut={};function Ht(t,e){if(!(this instanceof Ht))return new Ht(t,e);if(e&&e in Dt&&(e=null),e&&!(e in kt))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Ht)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=_t.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=kt[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=kt[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=Vt(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in jt))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=jt[o];const{labels:i}=kt[this.model],r=[];for(n=0;n<i.length;n++)r.push(t[i[n]]);this.color=Vt(r)}if(Ut[this.model])for(o=kt[this.model].channels,n=0;n<o;n++){const t=Ut[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Ht.prototype={toString(){return this.string()},string(t){let e=this.model in _t.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return _t.to[e.model](n)},round(t){return t=Math.max(t||0,0),new Ht([...this.color.map(Bt(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new Ht([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(kt)){if(Dt.includes(t))continue;const{channels:e}=kt[t];Ht.prototype[t]=function(...e){return this.model===t?new Ht(this):e.length>0?new Ht(e,t):new Ht([...Ft(kt[this.model][t].raw(this.color)),this.valpha],t)},Ht[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=Vt(n,e)),new Ht(o,t)}}function Bt(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function Ft(t){return Array.isArray(t)?t:[t]}function Vt(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const Wt=Ht;function Gt(t,e){Object.keys(e).forEach(n=>{t.style[n]=e[n]})}function zt(t,e,n){const o=function(t,e){let n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("var(")&&(n=function(t){const e=String(t).match(/var\([^,]+,\s*(rgb(?:a)?\([^)]+\))\)/);return e&&e[1]?e[1]:null}(n)||void 0),n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=Wt(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function $t(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(r,10)+parseInt(s,10),height:n+parseInt(i,10)+parseInt(o,10)}}function Kt(t,e,n,o,i){switch(t.position){case"top":return{left:`${Zt(e,n,o,i)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${Zt(e,n,o,i)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${Qt(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${Qt(0,t)}px`}}}function Zt(t,e,n,o){let i=n?t.x+t.width/2-e.width/2:t.x;return i<0&&(i=0),i+e.width>gt.width(o)&&(i-=i+e.width-gt.width(o)),i}function Qt(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function Yt(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=t,r=function(t,e,n,o,i,r){const s=function(t,e,n,o,i){const r=function(t,e,n,o){const i=gt.width(o),{right:r}=t.getBoundingClientRect(),s=i-n-r-gt.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:$t(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,i),s=function(t,e,n,o){const i=gt.height(o),{top:r,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:$t(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-s-n}}(t,e,n,i);let l="undefined";const a={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:r.availableSpaceToTheRightSideOfTheTrigger>=r.contentWidth,left:r.availableSpaceToTheLeftSideOfTheTrigger>=r.contentWidth};if(a.top?l="top":a.bottom?l="bottom":a.right?l="right":a.left&&(l="left"),o&&a[o]&&(l=o),"undefined"===l){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?l="bottom":t===s.availableSpaceAboveTriggerElem?l="top":t===r.availableSpaceToTheRightSideOfTheTrigger?l="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(l="left")}return Object.assign(Object.assign(Object.assign({},s),r),{position:l})}(t,e,n,o,r=r||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)Gt(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),Gt(e,{"margin-bottom":"0px"});else if("bottom"===t.position)Gt(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),Gt(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";Gt(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:Kt(s,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:s.position}}(e,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",r.position),Gt(n,r.coordinates)}Number.MAX_SAFE_INTEGER;const qt="PRIZE_POOL_UPDATED",Xt="REQUEST_PRIZE_POOL";var Jt,te,ee,ne,oe,ie;function re(t){return re="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},re(t)}function se(){var t,e,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function r(n,o,i,r){var a=o&&o.prototype instanceof l?o:l,c=Object.create(a.prototype);return le(c,"_invoke",function(n,o,i){var r,l,a,c=0,d=i||[],u=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return r=e,l=0,a=t,h.n=n,s}};function p(n,o){for(l=n,a=o,e=0;!u&&c&&!i&&e<d.length;e++){var i,r=d[e],p=h.p,m=r[2];n>3?(i=m===o)&&(a=r[(l=r[4])?5:(l=3,3)],r[4]=r[5]=t):r[0]<=p&&((i=n<2&&p<r[1])?(l=0,h.v=o,h.n=r[1]):p<m&&(i=n<3||r[0]>o||o>m)&&(r[4]=n,r[5]=o,h.n=m,l=0))}if(i||n>1)return s;throw u=!0,o}return function(i,d,m){if(c>1)throw TypeError("Generator is already running");for(u&&1===d&&p(d,m),l=d,a=m;(e=l<2?t:a)||!u;){r||(l?l<3?(l>1&&(h.n=-1),p(l,a)):h.n=a:h.v=a);try{if(c=2,r){if(l||(i="next"),e=r[i]){if(!(e=e.call(r,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,l<2&&(l=0)}else 1===l&&(e=r.return)&&e.call(r),l<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),l=1);r=t}else if((e=(u=h.n<0)?a:n.call(o,h))!==s)break}catch(e){r=t,l=1,a=e}finally{c=1}}return{value:e,done:u}}}(n,i,r),!0),c}var s={};function l(){}function a(){}function c(){}e=Object.getPrototypeOf;var d=[][o]?e(e([][o]())):(le(e={},o,function(){return this}),e),u=c.prototype=l.prototype=Object.create(d);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,le(t,i,"GeneratorFunction")),t.prototype=Object.create(u),t}return a.prototype=c,le(u,"constructor",c),le(c,"constructor",a),a.displayName="GeneratorFunction",le(c,i,"GeneratorFunction"),le(u),le(u,i,"Generator"),le(u,o,function(){return this}),le(u,"toString",function(){return"[object Generator]"}),(se=function(){return{w:r,m:h}})()}function le(t,e,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}le=function(t,e,n,o){function r(e,n){le(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[e]=n:(r("next",0),r("throw",1),r("return",2))},le(t,e,n,o)}function ae(t,e,n,o,i,r,s){try{var l=t[r](s),a=l.value}catch(t){return void n(t)}l.done?e(a):Promise.resolve(a).then(o,i)}function ce(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,fe(o.key),o)}}function de(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(de=function(){return!!t})()}function ue(t,e,n,o){var i=he(pe(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function he(){return he="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=pe(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},he.apply(null,arguments)}function pe(t){return pe=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},pe(t)}function me(t,e){return me=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},me(t,e)}function ge(t,e,n){return(e=fe(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function fe(t){var e=function(t){if("object"!=re(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=re(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==re(e)?e:e+""}!function(t){t.MANUAL="MANUAL",t.SHOPIFY="SHOPIFY"}(Jt||(Jt={})),(te||(te={})).PERCENT_CHANCE="PERCENT_CHANCE",function(t){t.DISCOUNT_PERCENTAGE="DISCOUNT_PERCENTAGE",t.CUSTOM="CUSTOM",t.PROMOCODE="PROMOCODE"}(ee||(ee={})),function(t){t.STATIC="STATIC",t.UNIQUE="UNIQUE",t.NO_CODE="NO_CODE"}(ne||(ne={})),function(t){t.PERCENTAGE="PERCENTAGE",t.FIXED_AMOUNT="FIXED_AMOUNT"}(oe||(oe={})),function(t){t.SHOPIFY_UNAVAILABLE="SHOPIFY_UNAVAILABLE",t.DISCOUNT_NOT_FOUND="DISCOUNT_NOT_FOUND",t.EXPIRED="EXPIRED",t.NOT_STARTED="NOT_STARTED",t.UNSUPPORTED_DISCOUNT="UNSUPPORTED_DISCOUNT",t.NOT_CLASPO_OWNED="NOT_CLASPO_OWNED",t.NO_AVAILABLE_CODES="NO_AVAILABLE_CODES",t.BATCH_FAILED="BATCH_FAILED"}(ie||(ie={}));var be="lastPromoCode",ve=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ge(e=function(t,e,n){return e=pe(e),function(t,e){if(e&&("object"==re(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,de()?Reflect.construct(e,n||[],pe(t).constructor):e.apply(t,n))}(this,t),"connectToPrizePool",function(){if(e.isStaticRenderMode()){var t=e.getProps().content.prize,n=t&&(t.id||t.options||"FIXED"===t.model)?t:e.findPoolPublishedByEarlierGame();return n?(e.prizePool=e.services.prizePoolFactory.get(n,e.getModel().id),e.componentResourceManager.getPending().increment(),e.showPendingLoader(),e.prizePool.load().then(function(){return e.prizePool.claimCode()}).then(function(){return e.prizePool.getPrize()}).then(function(t){e.componentResourceManager.getPending().decrement(),e.hidePendingLoader(),(null==t?void 0:t.codeType)!==ne.NO_CODE?e.applyPrizePoolPrize(t):e.getHostElement().style.display="none"},function(t){console.error("SysPromoCodeComponent: prize pool unavailable, the widget stays hidden",t)})):(e.applyPrizePoolPrize(null),Promise.resolve())}e.prizePoolSubscription=e.services.eventEmitter.on(qt,function(){var t,n=(t=se().m(function t(n){var o,i,r;return se().w(function(t){for(;;)switch(t.n){case 0:if(o=n.componentId,i=n.prizePool,e.getModel().id===o){t.n=1;break}return t.a(2);case 1:return e.prizePool=e.services.prizePoolFactory.get(i,e.getModel().id),r=e,t.n=2,e.prizePool.getPrize();case 2:r.applyPrizePoolPrize.call(r,t.v);case 3:return t.a(2)}},t)}),function(){var e=this,n=arguments;return new Promise(function(o,i){var r=t.apply(e,n);function s(t){ae(r,o,i,s,l,"next",t)}function l(t){ae(r,o,i,s,l,"throw",t)}s(void 0)})});return function(t){return n.apply(this,arguments)}}()),setTimeout(function(){e.services.eventEmitter.emit(Xt,e.getModel().id)})}),ge(e,"findPoolPublishedByEarlierGame",function(){var t,n,o,i=null===(t=e.getModel().path)||void 0===t?void 0:t[0],r=Object.values((null===(n=(o=e.services.context).getRecordsMap)||void 0===n?void 0:n.call(o))||{}).filter(function(t){var e;return"prizePoolId"===(null==t||null===(e=t.value)||void 0===e?void 0:e.id)&&!!t.value.value}).filter(function(t){return Number.isInteger(t.value.viewIndex)&&t.value.viewIndex<i}).sort(function(t,e){return e.value.viewIndex-t.value.viewIndex});return r.length?{id:r[0].value.value}:null}),ge(e,"showPendingLoader",function(){var t=e.getElement("text"),n=null==t?void 0:t.querySelector(".promocode-asyncLoader");t&&n&&(n.style.color=t.style.color,t.classList.add("cl-promocode-loading"))}),ge(e,"hidePendingLoader",function(){var t;null===(t=e.getElement("text"))||void 0===t||t.classList.remove("cl-promocode-loading")}),ge(e,"applyPrizePoolPrize",function(t){e.prizePoolCode=(null==t?void 0:t.value)||null,e.renderCode(e.getProps()),e.emitPromoCodeShownOnce()}),ge(e,"emitPromoCodeShownOnce",function(){var t;if(!e.promoCodeShownEmitted){var n=e.getResolvedCode()||e.getProps().content.text;n&&(e.promoCodeShownEmitted=!0,e.services.eventEmitter.emit(D.PROMO_CODE_SHOWN,{code:n,autoRedeem:!1!==(null===(t=e.getProps())||void 0===t||null===(t=t.content)||void 0===t?void 0:t.autoRedeem)}))}}),ge(e,"renderTooltip",function(t){var n=e.getTranslationsMap(ct).translations;e.tooltipContainerElement=document.createElement("div"),e.tooltipContainerElement.classList.add("cl-promo-code-tooltip-container");var o=document.createElement("div");o.style.padding="5px",o.style.color="#fff",o.innerText=n,e.tooltipContainerElement.append(o),e.htmlDocumentObject.body.appendChild(e.tooltipContainerElement),e.firstTooltipTimer=setTimeout(function(){Yt({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject}),e.boundOnScrollHandler=function(){return Yt({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject})},document.addEventListener("scroll",e.boundOnScrollHandler,!0),e.secondTooltipTimer=setTimeout(function(){e.removeScrollListener(),e.tooltipContainerElement.style.transition="0.15s",e.tooltipContainerElement.style.top="".concat(t.getBoundingClientRect().top+window.pageYOffset,"px"),e.tooltipContainerElement.style.opacity="0",e.thirdTooltipTimer=setTimeout(function(){e.destroyTooltip()},150)},1500)})}),ge(e,"getTooltipTopPosition",function(t,e,n){var o=t.getBoundingClientRect();return"".concat(o.top-e.height-n+window.pageYOffset,"px")}),ge(e,"getTooltipLeftPosition",function(t,e){var n=t.getBoundingClientRect();return"".concat(n.left+n.width/2-e.width/2+window.pageXOffset,"px")}),ge(e,"destroyTooltip",function(){e.tooltipContainerElement&&(e.tooltipContainerElement.remove(),e.tooltipContainerElement=null)}),ge(e,"clearTooltipTimers",function(){clearTimeout(e.firstTooltipTimer),clearTimeout(e.secondTooltipTimer),clearTimeout(e.thirdTooltipTimer)}),ge(e,"removeScrollListener",function(){document.removeEventListener("scroll",e.boundOnScrollHandler,!0)}),ge(e,"mapStyleControlValuesToInnerContent",function(){var t=e.getElement("text"),n=t?t.querySelector(".".concat(e.inlineEditPromocodeClass)):null;t&&n&&(n.style.whiteSpace=e.isByContentWidth?"nowrap":"",n.style.minWidth="20px",n.style.width="max-content",n.style.minHeight=t.style.fontSize,n.style.textAlign=t.style.textAlign,n.style.lineHeight=t.style.lineHeight,n.style.fontWeight=t.style.fontWeight,n.style.fontSize=t.style.fontSize,n.style.textShadow=t.style.textShadow,n.style.letterSpacing=t.style.letterSpacing,n.style.fontFamily=t.style.fontFamily)}),ge(e,"mapAlignValueToTextElementContent",function(t){"center"===t.style.textAlign&&(t.style.justifyContent="center"),"start"===t.style.textAlign&&(t.style.justifyContent="flex-start"),"end"===t.style.textAlign&&(t.style.justifyContent="flex-end")}),ge(e,"handleSafariHeightIssue",function(){var t=e.getHostElement();"auto"===t.style.height&&(t.style.height="fit-content")}),ge(e,"storeStrokeTopWidthAsCssVar",function(){var t=e.getElement("host"),n=e.getElement("text");t.style.setProperty("--clStrokeForIconWidth",n.style.borderTopWidth||0)}),ge(e,"destroyExistingIcon",function(){var t=e.getRootElement().querySelector('[cl-element="icon"]');t&&t.remove()}),ge(e,"showIconIfAny",function(t,n){var o=n.content.iconContent,i=parseFloat(o),r=!isNaN(i);if(e.destroyExistingIcon(),null!=o){if(r){var s=(n.styles?"absolute"===n.styles.find(function(t){return"icon"===t.element}).styleAttributes.position:"absolute"===n.adaptiveStyles[e.getEnvironment()].find(function(t){return"icon"===t.element}).styleAttributes.position)?dt[i]:ut[i],l=document.createElement("span");l.classList.add("promocode-icon"),l.setAttribute("cl-element","icon"),Q({element:l,html:s}),t.appendChild(l)}else{var a=document.createElement("img");a.src=o,a.classList.add("promocode-icon"),a.setAttribute("cl-element","icon"),t.appendChild(a)}e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}}),ge(e,"addTooltipStyles",function(){if(!e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId))){var t=document.createElement("style");t.setAttribute("id",e.tooltipStylesId),Q({element:t,html:mt}),e.htmlDocumentObject.head.appendChild(t)}}),ge(e,"removeTooltipStyles",function(){var t=e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId));t&&t.remove()}),ge(e,"_handleContextRecord",function(t){t.key===be&&e.renderCode(e.getProps())}),ge(e,"getResolvedCode",function(){if(e.prizePoolCode)return e.prizePoolCode;var t=e.services.context.getKVMap().promoCode;if(t)return t;var n=e.services.context.getRecord(be);return n&&n.value.viewIndex<e.getModel().path[0]&&n.value.value||null}),ge(e,"renderCode",function(t){var n=e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass)),o=e.getResolvedCode();e.applyInlineEditability(n,!o),o?n.innerText=o:Q({element:n,html:t.content.text})}),ge(e,"applyInlineEditability",function(t,n){n?t.setAttribute(e.inlineEditAttributeName,e.inlineEditAttributeValue):t.removeAttribute(e.inlineEditAttributeName)}),ge(e,"checkWidthMode",function(t){var n,o=e.getEnvironment(),i=null===(n=t.adaptiveStyles[o])||void 0===n||null===(n=n.find(function(t){return"host"===t.element}))||void 0===n?void 0:n.styleAttributes.width;e.isByContentWidth="auto"===i,e.isByContainerWidth="100%"===i}),ge(e,"manifest",st),ge(e,"tooltipContainerElement",void 0),ge(e,"firstTooltipTimer",void 0),ge(e,"secondTooltipTimer",void 0),ge(e,"thirdTooltipTimer",void 0),ge(e,"boundOnScrollHandler",void 0),ge(e,"contextSubscriptions",[]),ge(e,"prizePool",null),ge(e,"prizePoolSubscription",null),ge(e,"prizePoolCode",null),ge(e,"promoCodeShownEmitted",!1),ge(e,"tooltipStylesId","cl-promo-code-tooltip-styles"),ge(e,"inlineEditPromocodeClass","cl--inline--edit"),ge(e,"inlineEditAttributeName","cl-inline-edit"),ge(e,"inlineEditAttributeValue","content, text"),ge(e,"isByContainerWidth",!1),ge(e,"isByContentWidth",!1),e.getRootElement().innerHTML="\n <style>".concat("\n/* .text takes the host height through flex, not height:100%: in a quirks-mode document (customer\n pages with no doctype) WebKit resolves that percentage past the auto-height host against the\n enclosing view, so the code box grew over the content below it. */\n:host {\n display: flex;\n flex-direction: column;\n}\n\n.text {\n outline: none;\n min-height: 20px;\n cursor: pointer;\n width: 100%;\n flex: 1 1 auto;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.promocode-icon {\n top: calc(((var(--clPromocodeIconHeight) / 2) * -1) - var(--clStrokeForIconWidth));\n width: var(--clPromocodeIconWidth);\n height: var(--clPromocodeIconHeight);\n}\n\n.promocode-icon svg {\n display: flex;\n width: 100%;\n height: auto;\n}\n\nbutton.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n}\n\n.cl--inline--edit {\n overflow-wrap: break-word;\n max-width: 100%;\n}\n\n/* The spinner shown while the prize pool is being resolved and its code claimed. Same shape, size\n and rotation as the one SysButton shows during a submit, so the two read as one product. It\n centres on .text, which is already position: relative, and takes its colour from that\n element's own text colour - set in showPendingLoader, because the colour is an inline style the\n SDK writes per widget theme and no stylesheet here can know it. */\n.promocode-asyncLoader {\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n width: 20px;\n height: 20px;\n margin: -10px 0 0 -10px;\n z-index: 1;\n pointer-events: none;\n}\n\n.text.cl-promocode-loading .promocode-asyncLoader {\n display: block;\n}\n\n/* The code itself is hidden rather than removed, so the component keeps the width it will have once\n the real code lands and nothing reflows around it when the spinner stops. The decorative stroke\n icons stay - they are the ticket, not the code. */\n.text.cl-promocode-loading .cl--inline--edit {\n visibility: hidden;\n}\n\n.promocode-asyncLoader .spinner--icon {\n width: 20px;\n height: 20px;\n transform-origin: center;\n animation: cl-promocode-spinner-rotate 0.8s linear infinite;\n}\n\n.promocode-asyncLoader .spinner--icon .path {\n stroke: currentColor;\n stroke-linecap: round;\n stroke-dasharray: 24 32;\n}\n\n@keyframes cl-promocode-spinner-rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n",'</style>\n <button class="text" cl-element="text">\n <span class="').concat(e.inlineEditPromocodeClass,'" ').concat(e.inlineEditAttributeName,'="').concat(e.inlineEditAttributeValue,'"></span>\n <span class="promocode-asyncLoader" aria-hidden="true">\n <svg class="spinner--icon" viewBox="0 0 18 18" aria-hidden="true">\n <circle class="path" cx="9" cy="9" r="5" fill="none" stroke-width="2"></circle>\n </svg>\n </span>\n </button>'),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&me(t,e)}(t,it),function(t,e){return e&&ce(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;ue(t,"connectedCallback",this,3)([]),this.addTooltipStyles();var n=this.getElement("text"),o=n.querySelector("[".concat(this.inlineEditAttributeName,'="').concat(this.inlineEditAttributeValue,'"]'));this.contextSubscriptions=[this.services.context.on("RECORD_ADDED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_UPDATED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_DELETED",this._handleContextRecord.bind(this))],this.isStaticRenderMode()&&n.addEventListener("click",function(t){t.stopPropagation(),function(t){const e=String(t).trim().replace(/<br\s*\/?>/gi," "),n=navigator.clipboard;return(null==n?void 0:n.writeText)?function(){var t;return"null"===(null!==(t=window.origin)&&void 0!==t?t:window.location.origin)}()?at(e).catch(()=>n.writeText(e)):n.writeText(e).catch(()=>at(e)):at(e)}(o.textContent).then(function(){e.destroyTooltip(),e.clearTooltipTimers(),e.removeScrollListener(),e.renderTooltip(n)}).catch(function(t){return console.error("SysPromoCodeComponent couldn't write to clipboard",t)}),e.services.trackingService.send("FormClick_[Name]"),e.services.trackingService.trackClick({countAsTargetAction:e.getProps().content.countAsTargetAction}),e.services.trackingService.trackTargetAction(e.getProps().content.countAsTargetAction)}),this.observeProps(function(t,o){e.applyAutoAdaptiveStyles(o.adaptiveStyles,o.styles),e.checkWidthMode(o),e.renderCode(o),e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent(),e.showIconIfAny(n,o),e.storeStrokeTopWidthAsCssVar(),e.handleSafariHeightIssue(),function(t){let e=null;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=zt(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=zt(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=zt(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=zt(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(e.getElement("text"))}),this.observeShared(function(){e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent()}),this.observeEnvironment(function(){e.handleSafariHeightIssue(),e.mapStyleControlValuesToInnerContent()}),this.connectToPrizePool()}},{key:"disconnectedCallback",value:function(){ue(t,"disconnectedCallback",this,3)([]),this.destroyTooltip(),this.clearTooltipTimers(),this.removeScrollListener(),this.removeTooltipStyles(),this.contextSubscriptions.forEach(function(t){return t.off()}),this.prizePoolSubscription&&(this.prizePoolSubscription.off(),this.prizePoolSubscription=null)}}])}();ge(ve,"define",{name:"sys-promo-code",model:st.name,manifest:st});export{ve as default};window.clComponentClass_SysPromoCodeComponent=ve;
2
+ const t="cl-";function e(e){return t+e}function n(t){return"cl-"+t}const o="VIEW",i="CONTAINER",r="INPUT",s="BUTTON",l="CONSENT",a="COLUMN";var c,d;(d=c||(c={})).SUBSCRIBE_CONTACT="SUBSCRIBE_CONTACT",d.REQUEST="REQUEST",d.DISPATCH_EVENT="DISPATCH_EVENT",d.GO_TO_VIEW="GO_TO_VIEW",d.GO_TO_PREVIOUS_VIEW="GO_TO_PREVIOUS_VIEW",d.GO_TO_NEXT_VIEW="GO_TO_NEXT_VIEW",d.SHOW_WIDGET="SHOW_WIDGET",d.OPEN_LINK="OPEN_LINK",d.CLOSE_WIDGET="CLOSE_WIDGET",d.CLICK="CLICK";const u=c;var h,p;class m{static sortActions(t){const e={[u.CLOSE_WIDGET]:-1,[u.OPEN_LINK]:-2,[u.SHOW_WIDGET]:1,[u.SUBSCRIBE_CONTACT]:2,[u.REQUEST]:3},n=t=>void 0!==e[t.type]?e[t.type]:0;return[...t].sort((t,e)=>n(t)>n(e)?-1:n(t)<n(e)?1:0)}constructor(t,e){this.config=t,this.actions=m.sortActions(e),this.listener=null,this.targetElements=[],this.eventsQueue=[],this.state=null,this.postponed=!1}activate(t,e,o){this.state=t;const i=o(),r=i.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,r)}),this.listener=t=>{const e=t.composedPath().filter(t=>t instanceof HTMLElement&&t.getAttribute(n("type")));let o=0;for(;e[o]&&e[o].getAttribute(n("id"))!==r;){let t=e[o].getAttribute(n("type"));if(m.IGNORING_VIEW_ENTRY_TYPES.includes(t))return;o++}this.eventsQueue.push({event:t}),this.postponed||this.execute()},this.targetElements=this.config.relativeSelector?Array.from((i.shadowRoot||i).querySelectorAll(this.config.relativeSelector)):[i],this.targetElements.forEach(t=>{t.addEventListener("click",this.listener)})}async execute(){var t,e,n,o;try{for(var i,r=!0,s=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t="function"==typeof __values?__values(t):t[Symbol.iterator](),e={},o("next"),o("throw"),o("return"),e[Symbol.asyncIterator]=function(){return this},e);function o(n){e[n]=t[n]&&function(e){return new Promise(function(o,i){!function(t,e,n,o){Promise.resolve(o).then(function(e){t({value:e,done:n})},e)}(o,i,(e=t[n](e)).done,e.value)})}}}(this.eventsQueue);!(t=(i=await s.next()).done);r=!0){o=i.value,r=!1;const{event:t}=o;for(const e of this.actions)if(!await e.execute(this.state.getState(),t))break}}catch(t){e={error:t}}finally{try{r||t||!(n=s.return)||await n.call(s)}finally{if(e)throw e.error}}this.eventsQueue=[]}postpone(){this.postponed=!0}release(){this.postponed=!1,this.execute()}destroy(){this.listener&&this.targetElements.length&&(this.targetElements.forEach(t=>{t.removeEventListener("click",this.listener)}),this.targetElements=[])}}m.IGNORING_VIEW_ENTRY_TYPES=[s,l,r],(p=h||(h={})).CLICK="CLICK",p.COMPONENT_EVENT="COMPONENT_EVENT";class g{constructor(t,e){this.config=t,this.actions=e,this.componentEmitterListener=null}activate(t,e,o){var i;const r=null===(i=o())||void 0===i?void 0:i.getAttribute(n("id"));this.actions.forEach(t=>{var e;return null===(e=t.setInitiatorComponentId)||void 0===e?void 0:e.call(t,r)}),this.componentEmitterListener=e.on(this.config.eventName,()=>{this.actions.forEach(e=>e.execute(t.getState(),this.config.params))})}destroy(){this.componentEmitterListener&&this.componentEmitterListener.off()}}class f{constructor(t,e){this.actionFactory=t,this.actionRegister=e}get(t){const e=t.actions.map(t=>this.actionFactory.get(t));switch(e.forEach(t=>this.actionRegister.register(t)),t.type){case h.CLICK:return new m(t,e);case h.COMPONENT_EVENT:return new g(t,e);default:throw new Error(`Not supported handler type ${t.type}`)}}}class b{static generate(){let t,e="";for(let n=0;n<32;n++)8!==n&&12!==n&&16!==n&&20!==n||(e+="-"),t=Math.floor(16*Math.random()).toString(16).toUpperCase(),e+=t;return e}}class v{constructor(){this.listeners=v.createDefaultListenersState()}emit(t,e,n=null){const o=this.listeners[t];o&&Object.values(o).forEach(o=>o(e,t,n)),Object.values(this.listeners["*"]).forEach(o=>o(e,t,n))}on(t,e){const n=b.generate(),o=this.listeners[t];return o?o[n]=e:this.listeners[t]={[n]:e},{off:()=>{var e,o;(null===(o=null===(e=this.listeners)||void 0===e?void 0:e[t])||void 0===o?void 0:o[n])&&delete this.listeners[t][n]}}}destroy(){this.listeners=v.createDefaultListenersState()}}v.createDefaultListenersState=()=>({"*":{}});const y=v,E=(t,e,n,o)=>{const i=EventTarget.prototype,{addEventListenerBase:r,addEventListener:s}=i;(r||s).call(t,e,n,o)};class C{constructor(t){this.state=t||{}}getState(){return this.state}setState(t){this.state=Object.assign(Object.assign({},this.state),t)}destroy(){}}class O extends y{constructor(t,e){super(),this.config=e,this.handleMobileBreakpoint(t.getShared().mobileBreakpointWidth),t.on("ENVIRONMENT_UPDATE",({isMobileEnv:t})=>{this._isMobile=t,this.emit(O.changeEventName,this._isMobile)})}handleMobileBreakpoint(t){this.mobileBreakpointWidth=t;const e=Number.isInteger(this.mobileBreakpointWidth)?`${this.mobileBreakpointWidth}px`:this.mobileBreakpointWidth;this.mediaQueryList=window.matchMedia(`(max-width: ${e})`),this.mediaQueryList.addListener(this.listener.bind(this)),this._isMobile=this.mediaQueryList.matches,this.emit(O.changeEventName,this._isMobile)}isMobile(){return this.config.forceMobileEnv||this._isMobile}listener(t){this._isMobile=t.matches,this.emit(O.changeEventName,this._isMobile)}destroy(){super.destroy(),this.mediaQueryList.removeListener(this.listener.bind(this))}}O.changeEventName="CHANGE";const T=O;class S{static set(t,e){const n=t[S.accumulatorPropertyName]||{};t[S.accumulatorPropertyName]=Object.assign(Object.assign({},n),e.styleAttributes),Object.keys(t[S.accumulatorPropertyName]).forEach(n=>{n.includes("--")?t.style.setProperty(n,e.styleAttributes[n]||""):t.style[n]=e.styleAttributes[n]?e.styleAttributes[n]:""})}}S.accumulatorPropertyName="clStyleAttributes";const A=S;var x,P;(P=x||(x={})).BUILT_IN="BUILT_IN",P.DETACHED="DETACHED",P.FLOATING_BOX="FLOATING_BOX",P.FLOATING_BAR="FLOATING_BAR",P.LAUNCHER="LAUNCHER",P.CONTENT_LOCKER="CONTENT_LOCKER";class w{static applyHostStyles(t,e,n=null,r){var s,l,c;const d=null===(l=null===(s=null==n?void 0:n.props)||void 0===s?void 0:s.handlers)||void 0===l?void 0:l.find(t=>"CLICK"===t.type);d&&(null===(c=d.actions)||void 0===c?void 0:c.length)&&(e.style.cursor="pointer"),t!==o&&t!==i&&t!==a||(e.style.display=r===x.CONTENT_LOCKER&&t===o?"flex":"inline-flex",e.style.position="relative"),e.style.boxSizing="border-box"}constructor(){this.styles="/* common styles */ *, *:before, *:after { box-sizing: border-box; font-family: inherit; }"}setStyles(t=""){this.styles=`${this.styles} ${t}`}getStyles(){return this.styles}}class R{static log(t){window.scriptLog09u8y9?scriptLog09u8y9("ERROR","RUNTIME_ERROR",new Error(t)):console.error(t)}}class _{constructor(t,e,n,o,i,r){this.hostElement=e,this.documentModel=t,this.getSharedCb=n,this.getPropsCb=o,this.getEnvCb=i,this.httpClient=r,this.schemaSubscription=null,this.themeSubscription=null,this.envUrlMaps={desktop:new Map,mobile:new Map}}parseBackground(t){const e=String(t||"");if(e.includes("url")){const[t,n]=e.split("(")[1].split(")");return{url:t.replace(/['"]+/g,""),positionOptions:n.replace(";","")}}return{url:null,positionOptions:null}}apply(t){const e=this.getPropsCb();return e.backgroundDynamicInlineSVGElements[t].forEach(n=>{var o,i,r,s,l;const a=null===(i=null===(o=e.adaptiveStyles)||void 0===o?void 0:o[t])||void 0===i?void 0:i.find(t=>t.element===n),c=(null===(r=e.styles)||void 0===r?void 0:r.find(t=>t.element===n))||{},d=(null===(s=null==c?void 0:c.styleAttributes)||void 0===s?void 0:s.background)||(null===(l=null==a?void 0:a.styleAttributes)||void 0===l?void 0:l.background),u=this.parseBackground(d);u.url&&this.envUrlMaps[t].set(n,{originalSVGResourceURL:u.url,inlineSvgString:null,positionOptions:u.positionOptions})}),Promise.all([...this.envUrlMaps[t].entries()].map(([e,n])=>this.httpClient.execute({url:n.originalSVGResourceURL}).then(t=>t.text()).then(o=>{this.envUrlMaps[t].set(e,Object.assign(Object.assign({},n),{inlineSvgString:o}))}))).then(()=>{var e;const n=this.getSharedCb();return Object.keys((null===(e=n.theme)||void 0===e?void 0:e.schema)||{}).length>0?this._applyHostElementBackgroundFromTheme(this.envUrlMaps[t].get("host"),n.theme.schema):this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[t].get("host"),n.cssVars)}).catch(t=>{console.error(t),R.log(`Failed to load/apply backgroundDynamicInlineSVGElements[${this.getPropsCb().backgroundDynamicInlineSVGElements}] ${t}`)})}on(){return this.schemaSubscription=this.documentModel.on("COLOR_SCHEMA_UPDATE",t=>{this._applyHostElementBackgroundFromCssVars(this.envUrlMaps[this.getEnvCb()].get("host"),t)}),this.themeSubscription=this.documentModel.on("THEME_UPDATE",t=>{this._applyHostElementBackgroundFromTheme(this.envUrlMaps[this.getEnvCb()].get("host"),t.schema)}),this}_applyHostElementBackgroundFromCssVars(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromCssVars(t,e))}_applyHostElementBackgroundFromTheme(t,e){t&&e&&(this.hostElement.style.background=this._buildBackgroundUrlFromTheme(t,e))}_buildBackgroundUrlFromCssVars(t,e){const n=t.inlineSvgString.trim().replace("var(--cl-schema-accent)",e["cl-schema-accent"]);return`url('data:image/svg+xml,${encodeURIComponent(n)}')${t.positionOptions}`}_buildBackgroundUrlFromTheme(t,e){const n=t.inlineSvgString.trim();let o=n;return[...n.matchAll(/var\(--cl-schema-([^)]+)\)/g)].forEach(t=>{const n=function(t=""){return t.replace(/var\(\s*(--[^,\s)]+).*\)/,"$1").replace("--cl-schema-","")}(t[1]);var i;o=o.replace(`var(--${i=n,`cl-schema-${i}`})`,e[n])}),`url('data:image/svg+xml,${encodeURIComponent(o)}')${t.positionOptions}`}off(){var t,e;null===(t=this.schemaSubscription)||void 0===t||t.off(),null===(e=this.themeSubscription)||void 0===e||e.off()}}const L=new class{execute({url:t,method:e="GET",body:n=null,headers:o,abortSignal:i}){const r={method:e,headers:Object.assign({"Content-Type":"text/plain"},o||{}),credentials:"same-origin",body:null,signal:i};return n&&(r.body="string"==typeof n?n:JSON.stringify(n)),fetch(t,r)}};function I(t,e){return Object.keys(t).filter(t=>!e.includes(t)).reduce((e,n)=>Object.assign(Object.assign({},e),{[n]:t[n]}),{})}class N{static camelCaseToDashCase(t){return t.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}static camelCaseToUpperSnakeCase(t){return t.replace(/[A-Z]/g,t=>"_"+t).toUpperCase()}}class M{constructor(t){this._count=0,this.onUpdateCb=t}increment(){this._count++,this.onUpdateCb(this.count())}decrement(){this._count>0&&this._count--,this.onUpdateCb(this.count())}count(){return this._count}}var k;!function(t){t.TOO_MANY_REQUESTS="TOO_MANY_REQUESTS",t.COMPONENT_RESOURCES_LOADED="COMPONENT_RESOURCES_LOADED",t.FAILED_TO_LOAD_COMPONENT_RESOURCE="FAILED_TO_LOAD_COMPONENT_RESOURCE",t.SUBMIT_REQUEST_STARTED="SUBMIT_REQUEST_STARTED",t.SUBMIT_REQUEST_FINISHED="SUBMIT_REQUEST_FINISHED",t.SUBMIT_REQUEST_ERROR_WITHOUT_VIEW="SUBMIT_REQUEST_ERROR_WITHOUT_VIEW",t.PROMO_CODE_SHOWN="PROMO_CODE_SHOWN",t.LEAD_PROGRESS="LEAD_PROGRESS"}(k||(k={}));const j=k;class D{constructor(t,e,n){this.getPending=()=>this.counters.pending,this.onCounterStateUpdate=t=>{0===t&&this.systemEventEmitter.emit(j.COMPONENT_RESOURCES_LOADED,this.componentId)},this.onResourceLoadFailure=t=>{this.isStaticEntryModule?this.systemEventEmitter.emit(j.FAILED_TO_LOAD_COMPONENT_RESOURCE,`Failed to load: ${t}`):this.counters.pending.decrement()},this.componentId=t,this.systemEventEmitter=e,this.isStaticEntryModule=n,this.counters={pending:new M(this.onCounterStateUpdate)}}}const H=(...t)=>{let e=t.reduce((t,e)=>Object.assign(Object.assign({},t),{[e]:[]}),{});return{get:t=>e[t],clear:()=>H(...t)}},B=H,V="props",U="shared",F="environment";function W(t,e,n,o){const i=t=>{let r=function(t){return t instanceof DocumentFragment||(null==t?void 0:t.nodeType)===Node.DOCUMENT_FRAGMENT_NODE?t.host||null:t}(t);return r&&(o&&"function"==typeof o?o(r.getAttribute(e)):(null===(s=null==r?void 0:r.getAttribute)||void 0===s?void 0:s.call(r,e))===n)?r:r&&r.parentNode&&i(r.parentNode)||null;var s};return i(t)}const G="SUBMIT";function z(t,e){return e?(t.classes=`${t.classes||""} ${e.classes||""}`.trim(),Object.keys(e).forEach(n=>{if("element"===n||"classes"===n)return;const o=e[n];o&&"object"==typeof o&&!Array.isArray(o)?t[n]=Object.assign(Object.assign({},t[n]||{}),o):t[n]=o}),t):t}const $={DESKTOP:"desktop",MOBILE:"mobile"};function K(t,e,n){var o;return null===(o=null==t?void 0:t[e])||void 0===o?void 0:o.find(t=>t.element===n)}function Z(t=[]){return t.map(t=>Object.assign(Object.assign({},t),{styleAttributes:Object.assign({},t.styleAttributes)}))}function Q(t){const{element:e,html:n,appendHtml:o}=t,i=function(t){if(null==t)return"";if("string"!=typeof t)return String(t);if(""===t)return"";if(!/<\/?([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>/.test(t))return t;const e=(new DOMParser).parseFromString(t,"text/html");return e.querySelectorAll('script, style, link[rel="stylesheet"], meta[http-equiv]').forEach(t=>t.remove()),e.querySelectorAll("*").forEach(t=>{if(["onclick","onload","onerror","onmouseover","onfocus","onblur","onkeyup","onkeydown","onchange","onsubmit","onmouseenter","onmouseleave","onmouseout","oncontextmenu","ondrag","ondrop"].forEach(e=>t.removeAttribute(e)),Array.from(t.attributes).forEach(e=>{e.name.startsWith("on")&&t.removeAttribute(e.name)}),"A"===t.tagName||"AREA"===t.tagName){const e=t.getAttribute("href");e&&(e.startsWith("javascript:")||e.startsWith("data:"))&&t.removeAttribute("href")}if("IMG"===t.tagName||"IFRAME"===t.tagName){const e=t.getAttribute("src");e&&(e.startsWith("javascript:")||e.startsWith("data:text/html"))&&t.removeAttribute("src")}if("FORM"===t.tagName){const e=t.getAttribute("action");e&&e.startsWith("javascript:")&&t.removeAttribute("action")}}),e.body.innerHTML}(n);o?e.innerHTML+=i:e.innerHTML=i}const Y=Object.getPrototypeOf(document.createEvent("CustomEvent")).constructor;class q extends Y{constructor(t,e={},n){super(t,Object.assign(Object.assign({},n),{detail:e}))}}var J,X,tt;function et(t){if(null!=t&&""!==t)return"string"==typeof t?t:"object"==typeof t?JSON.stringify(t):String(t)}!function(t){t.STATIC="STATIC",t.UPDATING="UPDATING"}(J||(J={})),(tt=X||(X={})).STATIC="STATIC",tt.DATA_LAYER="DATA_LAYER",tt.URL_QUERY_PARAMS="URL_QUERY_PARAMS",tt.JS_API_VARIABLE="JS_API_VARIABLE",tt.COOKIE="COOKIE",tt.LOCAL_STORAGE="LOCAL_STORAGE";class nt{constructor(t,e){this.configService=t,this.registry=e}resolveValue(t,e){if(!(null==t?void 0:t.enabled)||!t.sourceType||this.configService.getConfig("renderMode")===J.UPDATING)return;const n=function(t,e,n,o){if(!e)return;if(e===X.STATIC)return et(null==n?void 0:n.value);const i=t.getSource(e);if(!i)return;const r=i.getValue(o);return et("function"==typeof(null==r?void 0:r.processor)?r.processor(i,Object.assign({id:o},n)):null==r?void 0:r.value)}(this.registry,t.sourceType,t.config,e);if(void 0===n)return;const o=n.trim();return""===o?void 0:o}}class ot extends HTMLElement{constructor(){var o;super(),this.skipGameBlur=!0,this.isAutofillValidated=!1,this.validatedAutofillValue=void 0,this.construct=()=>{let t;const e=this.getAttribute(n("id")),o=this.getWidgetContainerNode();if(!o)throw new Error("Widget container not found in construct");const i=o.closest(`[${n("widget-id")}]`);let r;i&&(r=i.getAttribute(n("widget-id")));let s=new q("cl-props-request",{nodeName:this.nodeName,path:this.getAttribute(n("path")),id:e,widgetId:r},{bubbles:!0,composed:!0});this.dispatchEvent(s),t=s.detail.props,Object.assign(this,t),this.observers=B(V,U,F),this.subscriptions=new class{constructor(){this.subscriptions=[]}push(t){this.subscriptions.push(t)}off(){this.subscriptions.forEach(t=>null==t?void 0:t.off())}},this.state=new C({}),this.componentEventEmitter=new y,this.componentResourceManager=new D(this.model.id,this.services.eventEmitter,this.isStaticRenderMode()),this.mergeTagsProcessor=this.services.mergeTagsProcessorFactory.create(),this._actionFactory=this.services.actionFactory,this._handlerFactory=new f(this._actionFactory,this.services.actionRegister),this.prevProps=this.model.props,this.prevEnvironment=this.getEnvironment(),this.documentModel.on(`COMPONENT_PROPS_UPDATE_${this.model.id}`,t=>{this.model.props=t,this.observers.get(V).forEach(e=>e(this.prevProps,t)),this.prevProps=t;const e=this.getHostElement(),o=n("floating");t.floating&&!e.getAttribute(o)?e.setAttribute(o,"true"):!t.floating&&e.getAttribute(o)&&e.removeAttribute(o)}),this.documentModel.on(`COMPONENT_UPDATE_${this.model.id}`,t=>{Object.assign(this.model,t)}),this.documentModel.on("SHARED_UPDATE_ALL",()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles),this.observers.get(U).forEach(t=>t(this.getShared()))}),this.model.props.backgroundDynamicInlineSVGElements&&(this.colorSchemaListener=new _(this.documentModel,this.getHostElement(),()=>this.getShared(),()=>this.model.props,()=>this.getEnvironment(),L),this.colorSchemaListener.apply(this.getEnvironment()).then(()=>{this.subscriptions.push(this.colorSchemaListener.on())})),this.prevProps.adaptiveStyles&&this.subscriptions.push(this.resizeListener.on(T.changeEventName,()=>{this.applyAutoAdaptiveStyles(this.prevProps.adaptiveStyles,this.prevProps.styles);const t=this.getEnvironment();this.observers.get(F).forEach(e=>e(this.prevEnvironment,t)),this.prevEnvironment=t})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_READY_TO_PLAY",()=>{this.skipGameBlur||this.getHostElement().classList.add("cl-game-spotlight-component")})),this.subscriptions.push(this.services.eventEmitter.on("GAME_PHASE_COMPLETED",()=>{this.skipGameBlur||this.getHostElement().classList.remove("cl-game-spotlight-component")}))},this.attachHandlers=()=>{this.getHandlers().map(t=>this._handlerFactory.get(t)).map(t=>()=>t.activate(this.state,this.componentEventEmitter,this.getHostElement.bind(this))).forEach(t=>t())},this.postponeHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.postpone())},this.releaseHandlers=()=>{var t;null===(t=this.handlers)||void 0===t||t.forEach(t=>t.release())},this.getProps=()=>{var t;return null===(t=this.getModel())||void 0===t?void 0:t.props},this.getShared=()=>this.documentModel.getShared(),this.getEnvironment=()=>this.resizeListener.isMobile()?"mobile":"desktop",this.isStaticRenderMode=()=>this.services.config.getConfig("renderMode")===J.STATIC,this.isUpdatingRenderMode=()=>this.services.config.getConfig("renderMode")===J.UPDATING,this.getRootElement=()=>this.shadowRoot?this.shadowRoot:this,this.getHostElement=()=>this,this.observeProps=t=>{this.observers.get(V).push(t),t(null,this.prevProps)},this.observeShared=t=>{this.observers.get(U).push(t),t(this.getShared())},this.observeEnvironment=t=>{this.observers.get(F).push(t),t(null,this.getEnvironment())},this.getElements=()=>[this.getHostElement(),...Array.from(this.getRootElement().querySelectorAll(`[${n("element")}]`)).filter(t=>!t.hasAttribute(n("component")))],this.getElement=(t,e)=>this.getElements().find(o=>e?o.getAttribute(n("element"))===t&&o.id===e:o.getAttribute(n("element"))===t),this.applyAutoAdaptiveStyles=(t,e)=>{if(!t&&!e)return;const o=this.getElements();if(!o.length)return;const i=function(t,e){if(!e)return t||{desktop:[],mobile:[]};const n=JSON.parse(JSON.stringify(t||{desktop:[],mobile:[]}));return e.forEach(t=>{const e=t.element;let o=!1,i=!1;n.desktop&&n.desktop.forEach(n=>{n.element===e&&(z(n,t),o=!0)}),n.mobile&&n.mobile.forEach(n=>{n.element===e&&(z(n,t),i=!0)}),!o&&n.desktop&&n.desktop.push(JSON.parse(JSON.stringify(t))),!i&&n.mobile&&n.mobile.push(JSON.parse(JSON.stringify(t)))}),n}(t,e),r=n("type"),s="element-styles";let l=this.getRootElement().querySelector(`style[${r}="${s}"]`);l||(l=document.createElement("style"),l.setAttribute(r,s),this.getRootElement().appendChild(l)),Q({element:l,html:""}),o.forEach(t=>{let e=t.getAttribute(n("element"));const o=this.getEnvironment();let r=K(i,o,e);if(r){if(this.resizeListener.isMobile()){const t=K(i,"desktop",e);t&&(r=Object.assign(Object.assign({},r),{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),r.styleAttributes)}))}this.applyStylesToElement(t,this.applySharedClassesToElementModel(r),l)}}),this._addLinkColor(l,this.getShared())},this.registerComponentResourceManagement=()=>{this.viewResourceManager.registerComponent(this.model.id,this.componentResourceManager)},this.applyStyles=(t,e={})=>{if(!t||!t.style)return!1;for(const[n,o]of Object.entries(e))t.style[n]=o;return!0},this.applyStylesToElement=(t,e,o)=>{var i,r;const s=[];"host"===(e=ot._resolveTogglableStylesForElementModel(e)).element&&(w.applyHostStyles(this.model.type,t,null,this.layoutType),("desktop"===this.getEnvironment()&&(null===(i=this.model.props.backgroundDynamicInlineSVGElements)||void 0===i?void 0:i.desktop)||"mobile"===this.getEnvironment()&&(null===(r=this.model.props.backgroundDynamicInlineSVGElements)||void 0===r?void 0:r.mobile))&&(this.colorSchemaListener.apply(this.getEnvironment()),s.push("background")));let l=e.styleAttributes.background,a=l&&l.match(/url\("([^"]*)"\)/);if(this.manifest.waitForResourcesLoad&&a){this.componentResourceManager.getPending().increment();const t=new Image;t.src=a[1],E(t,"load",()=>{this.componentResourceManager.getPending().decrement()}),E(t,"error",()=>{this.componentResourceManager.onResourceLoadFailure(t.src),this.isUpdatingRenderMode&&this.componentResourceManager.getPending().decrement()})}const c=Object.assign(Object.assign({},e),{styleAttributes:I(e.styleAttributes,s)});if(A.set(t,c),this._setClassAttributes(t,e),o){if(e.hoverStyleAttributes){let i=Object.assign({},e.hoverStyleAttributes);if("FILL_UP"===e.hoverAnimationType){t.style.boxShadow="inset 0px 0px 0px 0px rgb(0, 0, 0, 0)",t.style.overflow="hidden";const n=t.tagName.toLowerCase(),o=`flip-up-animation-${e.element}`;let r=this.getRootElement().querySelector(`#${o}`);r||(r=document.createElement("style"),r.id=o,t.appendChild(r)),Q({element:r,html:`\n ${n}::before {\n content: '';\n background: ${i.background};\n position: absolute;\n left: 0;\n top: ${t.getBoundingClientRect().height}px;\n height: ${t.getBoundingClientRect().height}px;\n width: 100%;\n z-index: -10;\n }\n ${n}:hover::before {\n top: 0;\n transition: 0.3s;\n }\n `}),i=Object.assign(Object.assign({},e.hoverStyleAttributes),{background:"transparent",position:"relative"})}i.borderTopWidth&&"0px"!==i.borderTopWidth||delete i.borderTopColor,i.borderBottomWidth&&"0px"!==i.borderBottomWidth||delete i.borderBottomColor,i.borderLeftWidth&&"0px"!==i.borderLeftWidth||delete i.borderLeftColor,i.borderRightWidth&&"0px"!==i.borderRightWidth||delete i.borderRightColor,this._addStylesToStyleElement(o,e.element,i,`:not(.${n("no-hover")}):hover`,!0)}e.placeholderStyleAttributes&&this._addStylesToStyleElement(o,e.element,e.placeholderStyleAttributes,"::placeholder"),this._addFontStylesToStyleElement(o,this.getShared()),this.stylesAppliedToElement(t,e,o)}},this.applySharedClassesToElementModel=e=>function(e,n,o=!1){let i=e;return(i.classes||"").split(" ").filter(e=>e.startsWith(t)).forEach(t=>{var e;const r=null===(e=n.textClasses)||void 0===e?void 0:e[t];if(!r)return;let s=function(t,e){return{styleAttributes:Object.assign(Object.assign({},t.styleAttributes),e?t.mobileStyleAttributes:{}),placeholderStyleAttributes:Object.assign(Object.assign({},t.placeholderStyleAttributes),e?t.mobilePlaceholderStyleAttributes:{})}}(r,o);s.styleAttributes.fontFamily||(r.isHeader&&n.headerFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.headerFontFamily})})),!r.isHeader&&n.textFontFamily&&(s=Object.assign(Object.assign({},s),{styleAttributes:Object.assign(Object.assign({},s.styleAttributes),{fontFamily:n.textFontFamily})}))),i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),s.styleAttributes),placeholderStyleAttributes:Object.assign(Object.assign({},i.placeholderStyleAttributes),s.placeholderStyleAttributes)})}),i.styleAttributes.fontFamily||(i=Object.assign(Object.assign({},i),{styleAttributes:Object.assign(Object.assign({},i.styleAttributes),{fontFamily:n.textFontFamily})})),i}(e,this.documentModel.getShared(),this.resizeListener.isMobile()),this.getModel=()=>this.model,this._addStylesToStyleElement=(t,e,o,i="",r)=>{const s=Object.keys(o).reduce((t,e)=>t+` ${N.camelCaseToDashCase(e)}: ${o[e]}${r?" !important;":";"}`,"");Q({element:t,html:`[${n("element")}="${e}"]${i} { ${s} }`,appendHtml:!0})},this._addFontStylesToStyleElement=(t,e)=>{Q({element:t,html:`[cl-type] {font-family:${e.textFontFamily||"inherit"}}`,appendHtml:!0})},this._addLinkColor=(t,e)=>{var n,o,i,r;e.linkColor&&Q({element:t,html:`a {color: ${e.linkColor}}, a:visited {color: ${e.linkColor}}`,appendHtml:!0}),(null===(n=e.linkParams)||void 0===n?void 0:n.color)&&Q({element:t,html:`a {color: ${null===(o=e.linkParams)||void 0===o?void 0:o.color}}, a:visited {color: ${null===(i=e.linkParams)||void 0===i?void 0:i.color}}`,appendHtml:!0}),(null===(r=e.linkParams)||void 0===r?void 0:r.removeUnderline)&&Q({element:t,html:"a {text-decoration: none}, a:visited {text-decoration: none}",appendHtml:!0})},this._setClassAttributes=(n,o)=>{Array.from(n.classList).filter(t=>t!==e("hovered")&&t!==e("focused")).forEach(e=>{e.startsWith(t)&&n.classList.remove(e)});const i=((n.getAttribute("class")||"")+" "+o.classes).trim();n.setAttribute("class",i)},this.getParentComponent=()=>W(this.parentNode,n("element"),"host"),this.getWidgetContainerNode=()=>{const t=null==this?void 0:this.getAttribute(n("path"));return 1===(null==t?void 0:t.split(",").length)?this.parentNode:W(this.parentNode,n("path"),void 0,t=>1===(null==t?void 0:t.split(",").length))},this.getWidgetLanguages=()=>{return[(t=this.services.config).getConfig("appearanceLanguage"),t.getConfig("browserLanguage"),"en"].filter(t=>!!t);var t},this.getPreferredWidgetLanguage=()=>this.getWidgetLanguages()[0],this.getTranslationsMap=t=>function(t,e){return e.reduce((e,n)=>{if(e)return e;const o=function(t,e){if(!t)return null;if(e[t])return{translations:e[t],language:t};const n=function(t){return t.includes("-")?t.split("-")[0].toLowerCase():t.includes("_")?t.split("_")[0].toLowerCase():t}(t);return e[n]?{translations:e[n],language:n}:null}(n,t);return o||null},null)}(t,this.getWidgetLanguages()),this.stylesAppliedToElement=(t,e,n)=>{},this.updateContext=()=>{var t;const e=this.getModel();this.services.context.updateRecord(e.id,{label:this.getContextRecordLabel(e.props),viewIndex:null===(t=e.path)||void 0===t?void 0:t[0]})},this.getAutofillValue=()=>{var t;const e=this.getModel();return new nt(this.services.config,this.services.context.getRegistry()).resolveValue(null===(t=e.props.control)||void 0===t?void 0:t.autofill,e.id)},this.getValidatedAutofillValue=()=>this.isAutofillValidated?this.validatedAutofillValue:void 0,this.syncAutofillContextRecord=(t,e)=>{this.isAutofillValidated=!0,this.validatedAutofillValue=t?e:void 0,t&&this.services.context.updateRecord(this.getModel().id,{value:e})},this.addContextRecord=()=>{var t,e;const n=this.getModel();this.services.context.addRecord(n.id,{recordKey:n.id,id:n.props.control.name,label:this.getContextRecordLabel(n.props),value:null!==(t=this.getValidatedAutofillValue())&&void 0!==t?t:n.props.control.defaultValue||"",viewIndex:null===(e=n.path)||void 0===e?void 0:e[0],sourceId:"FORM",initialData:{fallbackValue:"",exampleValue:this.getContextRecordExampleValue(n.props)}})},this.getContextRecordLabel=t=>{var e,n,o,i,r,s;const l=t.control.name;if(["email","first_name","last_name"].includes(l))return l.toUpperCase();if((null===(e=t.content)||void 0===e?void 0:e.label)&&(null===(i=null===(o=null===(n=t.adaptiveStyles)||void 0===n?void 0:n.desktop.find(t=>"label"===t.element))||void 0===o?void 0:o.params)||void 0===i?void 0:i.enabled)){const e=(new DOMParser).parseFromString(t.content.label,"text/html");return this.capitalizeFirstLetter(e.body.textContent||"")}return(null===(r=t.content)||void 0===r?void 0:r.placeholder)?this.capitalizeFirstLetter(t.content.placeholder):(null===(s=t.control)||void 0===s?void 0:s.integrationName)?this.capitalizeFirstLetter(t.control.integrationName).replace(new RegExp("_","g")," "):void 0},this.capitalizeFirstLetter=t=>t.charAt(0).toUpperCase()+t.slice(1),this.getContextRecordExampleValue=t=>{var e;switch(null===(e=t.control)||void 0===e?void 0:e.name){case"email":return"myemail@example.com";case"first_name":return"Maria";case"last_name":return"Taylor";default:return this.getContextRecordLabel(t)}},this.completeSubmitAction=t=>{const e=t||{},n=this.services.actionRegister.getRegisteredActions().find(t=>t.category===G);n?null==n||n.execute(void 0,void 0,!0,e):this.services.actionFactory.get({type:u.REQUEST}).execute(void 0,void 0,!0,e)},this.getHandlers=()=>{var t;return(null===(t=this.getProps())||void 0===t?void 0:t.handlers)&&this.getProps().handlers.length?[...this.getProps().handlers]:[]},this.assets=(t="")=>`${this.services.config.getConfig("staticResourcesUrl").replace(/\/$/,"")}/${this.manifest.name}/assets${t?`/${t}`:""}`,this.attachShadow({mode:"open"}),this.manifest=this.manifest||(null===(o=this.constructor.define)||void 0===o?void 0:o.manifest)}connectedCallback(){this.construct(),this.registerComponentResourceManagement(),Promise.resolve().then(()=>{this.attachHandlers()});const t=document.createElement("style");t.textContent='\n :host(.cl-game-spotlight-component)::after {\n content: "";\n position: absolute;\n background-size: 100% 100%;\n background-repeat: no-repeat;\n overflow: visible;\n \n backdrop-filter: blur(4px);\n \n inset: -30px;\n mask-image: \n linear-gradient(to bottom, transparent, grey 30px, grey calc(100% - 30px), transparent),\n linear-gradient(to right, transparent, grey 30px, grey calc(100% - 30px), transparent);\n mask-composite: intersect;\n -webkit-mask-composite: source-in; /* for Chrome/Safari */\n \n transition: opacity 0.35s ease;\n pointer-events: auto;\n }\n ',this.getRootElement().prepend(t)}disconnectedCallback(){var t;this.observers.clear(),this.subscriptions.off(),this.state.destroy(),this.componentEventEmitter.destroy(),null===(t=this.mergeTagsProcessor)||void 0===t||t.destroy()}}ot._resolveTogglableStylesForElementModel=t=>{const e=Object.assign({},t);return Object.keys(e).forEach(t=>{t.toLowerCase().includes("styleattributes")&&(e[t]=ot._resolveTogglableStyles(e[t]))}),e},ot._resolveTogglableStyles=t=>{const e=Object.assign({},t),n=(t,n,o)=>{n in e&&(t.forEach(t=>{t in e&&(e[t]=e[n]?e[t]:o)}),delete e[n])};return n(["marginTop","marginBottom","marginLeft","marginRight"],"_marginEnabled","0px"),n(["paddingTop","paddingBottom","paddingLeft","paddingRight"],"_paddingEnabled","0px"),e};const it=ot;function rt(t){return Object.values($).map(e=>({type:"GROUP",propPath:["adaptiveStyles",e],children:t}))}const st={name:"SysPromoCodeComponent",componentType:"PROMO_CODE",version:"1.0.0",events:{dispatch:[],listen:[]},contextMenuModel:rt([{type:"CONTROL",name:"COMPONENT_OPERATIONS"},{type:"CONTROL",name:"BRING_BACK_FORWARD",element:"host",elementProp:"styleAttributes",elementSubProp:"zIndex"},{type:"CONTROL",name:"FOCUS_PARENT_COMPONENT"}]),floatingControlsModel:rt([{type:"CONTROL",name:"SIZE",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"MARGIN",elementProp:"styleAttributes",element:"host"},{type:"CONTROL",name:"CONTAINER_PADDING",elementProp:"styleAttributes",element:"host"}]),propertyPaneModel:{content:rt([{type:"CONTROL",name:"PRIZE_SETTINGS",propPath:["content","prize"],params:{linkedGamifiedComponentType:"PRIZE_BASED_GAMING"},displayCondition:function(t){return!!t.prizePool||t.documentUtils.findComponentsByTypes(t.views,["PRIZE_BASED_GAMING"]).some(function(e){return e.path[0]<t.component.path[0]})}},{type:"TEXT",params:{text:"DOCUMENT_CLICK_COMPONENT_TO_COPY_TO_CLIPBOARD",type:"SECONDARY"}},{type:"CONTROL",name:"SWITCH",propPath:["content","countAsTargetAction"],params:{label:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_LABEL",boldLabel:!0,tooltip:"i18n_DOCUMENT_COUNT_AS_TARGET_ACTION_TOOLTIP"},displayCondition:function(t){return"INFORMER"===t.widgetType}},{type:"CONTROL",name:"SWITCH",propPath:["content","autoRedeem"],params:{label:"i18n_DOCUMENT_AUTO_REDEEM_LABEL",boldLabel:!0,tooltip:"i18n_DOCUMENT_AUTO_REDEEM_TOOLTIP",getValueMapper:{undefined:!0,true:!0,false:!1}},displayCondition:function(t){var e;return"SHOPIFY"===(null===(e=t.editorConfig)||void 0===e||null===(e=e.userContext)||void 0===e?void 0:e.registrationType)}},{type:"CONTROL",name:"SIZE",element:"host",elementProp:"styleAttributes",params:{width:{options:["fixed","fill","hug"]},height:{options:["fixed","fill","hug"]}}},{type:"CONTROL",name:"TEXT_PARAMS",params:[{element:"text"}]},{type:"CONTROL",name:"BACKGROUND",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"PROMOCODE_ICON",propPath:["styles","[element=icon]","styleAttributes"],params:{visibleDisplayValue:"flex"}},{type:"CONTROL",name:"BORDERS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BOX_SHADOW",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"BORDER_RADIUS",propPath:["styles","[element=text]","styleAttributes"]},{type:"CONTROL",name:"HOVER_ANIMATION",propPath:["styles","[element=text]","hoverStyleAttributes"],params:{animationTypeProp:{propPath:["styles","[element=text]","hoverAnimationType"]}}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"text",params:{indentationType:"PADDING"}},{type:"CONTROL",name:"INDENTATION",elementProp:"styleAttributes",element:"host",params:{indentationType:"MARGIN"}}])},autoContrast:[{slave:{element:"text",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","textContrastEnabled"]},{slave:{element:"icon",elementProp:"styleAttributes",elementSubProp:"color"},master:{element:"text",elementProp:"styleAttributes",elementSubProp:"background"},enabledPropPath:["content","iconContrastEnabled"]}],i18nPropPaths:["content,text"],props:{styles:[{element:"text",styleAttributes:{borderTopStyle:"dashed",borderRightStyle:"dashed",borderBottomStyle:"dashed",borderLeftStyle:"dashed",borderTopWidth:"2px",borderTopColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderBottomWidth:"2px",borderBottomColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderLeftWidth:"2px",borderLeftColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderRightWidth:"2px",borderRightColor:"var(--cl-schema-accent, rgb(68, 68, 68))",borderTopLeftRadius:"0px",borderTopRightRadius:"0px",borderBottomLeftRadius:"0px",borderBottomRightRadius:"0px",boxShadow:"none",background:"transparent"},hoverStyleAttributes:{}},{element:"icon",styleAttributes:{display:"flex",position:"static",marginLeft:"10px",right:"5px",color:"var(--cl-schema-accent, rgb(68, 68, 68))","--clPromocodeIconWidth":"18px","--clPromocodeIconHeight":"18px"}}],adaptiveStyles:(lt=[{element:"host",styleAttributes:{width:"auto",minWidth:null,height:"auto",minHeight:null,marginTop:"0px",marginBottom:"0px",marginLeft:"0px",marginRight:"0px",_marginEnabled:!1}},{element:"text",styleAttributes:{paddingTop:"10px",paddingBottom:"10px",paddingLeft:"20px",paddingRight:"20px",_paddingEnabled:!0,color:"var(--cl-schema-accent, rgb(68, 68, 68))",textAlign:"center",lineHeight:"120%",fontWeight:"500",fontSize:"18px",textShadow:"none"},classes:""}],Object.values($).reduce((t,e)=>Object.assign(t,{[e]:Z(lt)}),{desktop:[],mobile:[]})),content:{text:"PROMO_10",iconContent:0,iconContrastEnabled:!0,textContrastEnabled:!0,autoRedeem:!0}},metaDescription:{icon:"/SysPromoCodeComponent/assets/img/component-icon.svg",label:{en:"Promo code",ru:"Промокод",uk:"Промокод",es:"Código promocional",fr:"Code promo",de:"Gutscheincode",it:"Codice promozionale",pt:"Código promocional",ro:"Cod promoțional",bg:"Промоционален код",cs:"Promo kód",el:"Κωδικός προσφοράς",nl:"Promotiecode",pl:"Kod promocyjny",sv:"Rabattkod",tr:"Promosyon kodu",ar:"الرمز الترويجي",zh:"促销码",da:"Kampagnekode",he:"קוד קידום",fi:"Alennuskoodi",hi:"प्रोमो कोड",hr:"Promotivni kod",hu:"Promo kód",id:"Kode promo",ja:"プロモコード",ko:"프로모션 코드",no:"Kampanjekode",sk:"Propagačný kód",sl:"Promocijska koda",sr:"Promo kod"}},syncEnabled:!0,stylesImitationEnabled:!0};var lt;function at(t){if("function"!=typeof document.execCommand)return Promise.reject(new Error("copyToClipboard: document.execCommand is not available"));const e=document.getSelection();if(!e)return Promise.reject(new Error("copyToClipboard: the document has no selection"));const n=function(t){const e=[];for(let n=0;n<t.rangeCount;n+=1)e.push(t.getRangeAt(n));return e}(e),o=function(t){const e=document.createElement("span");return e.textContent=t,e.setAttribute("aria-hidden","true"),e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.opacity="0",e.style.pointerEvents="none",e.style.whiteSpace="pre",e.style.textTransform="none",e.style.setProperty("user-select","text"),e.style.setProperty("-webkit-user-select","text"),e}(t);try{document.body.appendChild(o);const n=document.createRange();return n.selectNodeContents(o),e.removeAllRanges(),e.addRange(n),String(e)!==t?Promise.reject(new Error("copyToClipboard: the text could not be selected")):document.execCommand("copy")?Promise.resolve():Promise.reject(new Error("copyToClipboard: the copy command failed"))}catch(t){return Promise.reject(t)}finally{o.remove(),e.removeAllRanges(),n.forEach(t=>e.addRange(t))}}const ct={en:"Copied!",ru:"Скопировано!",uk:"Скопійовано!",es:"Copiado!",de:"Kopiert!",fr:"Copié!",it:"Copiato!",pt:"Copiado!",ro:"Copiat!",bg:"Копирано!",cs:"Zkopírováno!",el:"Αντιγράφηκε!",nl:"Gekopieerd!",pl:"Skopiowane!",sv:"Kopierade!",tr:"Kopyalandı!",ar:"نسخ!",hu:"Másolva!"},dt=['\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24">\n <path d="M7.9,9.5L0,3.8c1.2-1.6,3.4-2,5.1-0.9l8.5,6l3.1-2.2c-1.2-2-0.6-4.6,1.3-5.9c2-1.4,4.8-0.9,6.2,1.1 c1.4,2,0.9,4.8-1.1,6.3c-1.4,1-3.1,1.1-4.6,0.3l-3.8,2.7l3.8,2.7c1.4-0.7,3.2-0.6,4.6,0.3c2,1.4,2.5,4.2,1.1,6.3 c-1.4,2-4.2,2.5-6.2,1.1c-1.9-1.4-2.5-3.9-1.3-5.9l-4-2.7H7.4l3-1.7L7.9,9.5z M22.8,17.9c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3 c0,1.3,1,2.3,2.3,2.3C21.8,20.2,22.8,19.2,22.8,17.9z M22.8,4.5c0-1.3-1-2.3-2.3-2.3c-1.3,0-2.3,1-2.3,2.3s1,2.3,2.3,2.3 C21.8,6.8,22.8,5.8,22.8,4.5z" fill="currentColor"/>\n </svg>\n ','\n <svg xmlns="http://www.w3.org/2000/svg" width="25" height="24" viewBox="0 0 25 24" fill="none">\n <path d="M10.5278 12.0003L0.0870176 20.5846C0.0276258 20.6336 0.021828 20.72 0.0784574 20.7716C0.735083 21.3673 4.70771 24.1658 13.7643 14.862L15.2546 16.1708C15.0272 16.728 14.9013 17.3393 14.9013 17.9815C14.9013 20.571 16.9449 22.667 19.47 22.667C21.9952 22.667 24.0391 20.571 24.0391 17.9815C24.0391 15.392 21.9952 13.2961 19.47 13.2961C18.5938 13.2961 17.7758 13.5487 17.0811 13.9867L14.8192 12.0003L17.0811 10.0137C17.7761 10.4516 18.5941 10.7043 19.47 10.7043C21.9952 10.7043 24.0391 8.60803 24.0391 6.01913C24.0391 3.43022 21.9952 1.33366 19.47 1.33366C16.9449 1.33366 14.9013 3.42965 14.9013 6.01913C14.9013 6.66132 15.0272 7.27265 15.2546 7.82986L13.764 9.13947C4.70771 -0.164618 0.735083 2.63335 0.0784574 3.22909C0.021828 3.28093 0.0276258 3.36677 0.0870176 3.41606L10.5278 12.0003ZM19.47 15.7884C20.6518 15.7886 21.6087 16.7696 21.6087 17.9815C21.6087 19.1934 20.6518 20.1747 19.47 20.1747C18.2885 20.1747 17.3317 19.1934 17.3317 17.9815C17.3317 16.7696 18.2885 15.7884 19.47 15.7884ZM19.47 3.82625C20.6518 3.82625 21.6087 4.80725 21.6087 6.01913C21.6087 7.231 20.6518 8.21229 19.47 8.21229C18.2885 8.21229 17.3317 7.231 17.3317 6.01913C17.3317 4.80725 18.2885 3.82625 19.47 3.82625Z" fill="currentColor"/>\n </svg>\n '],ut=['\n <svg width="16" height="18" viewBox="0 0 16 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 0H10C11.6569 0 13 1.34315 13 3V12C13 13.6569 11.6569 15 10 15H3C1.34315 15 0 13.6569 0 12V3C0 1.34314 1.34315 0 3 0ZM3 2C2.44772 2 2 2.44772 2 3V12C2 12.5523 2.44772 13 3 13H10C10.5523 13 11 12.5523 11 12V3C11 2.44772 10.5523 2 10 2H3Z" fill="currentColor"/>\n <path d="M3 15C3 16.6569 4.34315 18 6 18H13C14.6569 18 16 16.6569 16 15V6C16 4.34315 14.6569 3 13 3V5C13.5523 5 14 5.44772 14 6V15C14 15.5523 13.5523 16 13 16H6C5.44772 16 5 15.5523 5 15H3Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M10.8 1H2.2C1.53726 1 1 1.53726 1 2.2V12.8C1 13.4627 1.53726 14 2.2 14H10.8C11.4627 14 12 13.4627 12 12.8V2.2C12 1.53726 11.4627 1 10.8 1ZM2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path fill-rule="evenodd" clip-rule="evenodd" d="M2.2 0C0.984974 0 0 0.984973 0 2.2V12.8C0 14.015 0.984973 15 2.2 15H10.8C12.015 15 13 14.015 13 12.8V2.2C13 0.984974 12.015 0 10.8 0H2.2Z" fill="currentColor"/>\n <path d="M4 15V15.8C4 16.4627 4.53726 17 5.2 17H13.8C14.4627 17 15 16.4627 15 15.8V5.2C15 4.53726 14.4627 4 13.8 4H12.9492V3H13.8C15.015 3 16 3.98497 16 5.2V15.8C16 17.015 15.015 18 13.8 18H5.2C3.98497 18 3 17.015 3 15.8V15H4Z" fill="currentColor"/>\n </svg>\n ','\n <svg width="17" height="18" viewBox="0 0 17 18" fill="currentColor" xmlns="http://www.w3.org/2000/svg">\n <path d="M0 2C0 0.89543 0.895431 0 2 0H11C12.1046 0 13 0.895431 13 2V13C13 14.1046 12.1046 15 11 15H2C0.89543 15 0 14.1046 0 13V2Z" fill="currentColor"/>\n <path fill-rule="evenodd" clip-rule="evenodd" d="M3 16C3 17.1046 3.89543 18 5 18H14C15.1046 18 16 17.1046 16 16V5C16 3.89543 15.1046 3 14 3V13C14 14.6569 12.6569 16 11 16H3ZM3 15V5C3 3.89543 3.89543 3 5 3H13V13C13 14.1046 12.1046 15 11 15H3Z" fill="currentColor"/>\n </svg>\n '];var ht="12px",pt="14px";const mt="\n .cl-promo-code-tooltip-container {\n z-index: ".concat(String(Number.MAX_SAFE_INTEGER),";\n padding: 10px;\n display: inline-block;\n position: fixed;\n background: #000;\n opacity: 1;\n border: 2px solid #FFF;\n border-radius: 5px;\n max-height: fit-content;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:after {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 5px);\n margin-left: -8px;\n margin-top: -2px;\n border-width: ").concat(ht,";\n border-style: solid;\n border-color: black transparent transparent transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='top']:before {\n content: \"\";\n position: absolute;\n top: 100%;\n left: calc(50% - 15px);\n border-width: ").concat(pt,";\n border-style: solid;\n border-color: white transparent transparent transparent;\n }\n \n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:after {\n content: \"\";\n position: absolute;\n top: -22px;\n left: calc(50% - 4px);\n margin-left: -5px;\n margin-bottom: -2px;\n border-width: ").concat(ht,";\n border-style: solid;\n border-color: transparent transparent black transparent;\n }\n\n .cl-promo-code-tooltip-container[cl-tooltip-position='bottom']:before {\n content: \"\";\n position: absolute;\n top: -28px;\n left: calc(50% - 11px);\n border-width: ").concat(pt,";\n border-style: solid;\n border-color: transparent transparent white transparent;\n }\n");class gt{static size(t){return{width:this.width(t),height:this.height(t)}}static width(t){var e;const n=t||document;return Math.max(n.documentElement.clientWidth,(null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)}static height(t){var e;const n=t||document;return Math.max(n.documentElement.clientHeight,(null===(e=n.defaultView)||void 0===e?void 0:e.innerHeight)||0)}static scrollbarWidth(t){var e;const n=t||document;return((null===(e=n.defaultView)||void 0===e?void 0:e.innerWidth)||0)-n.documentElement.clientWidth}}function ft(t){return!(!t||"string"==typeof t)&&(t instanceof Array||Array.isArray(t)||t.length>=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}var bt=Array.prototype.concat,vt=Array.prototype.slice,yt=function(t){for(var e=[],n=0,o=t.length;n<o;n++){var i=t[n];ft(i)?e=bt.call(e,vt.call(i)):e.push(i)}return e};yt.wrap=function(t){return function(){return t(yt(arguments))}};const Et=yt;var Ct={},Ot=Object.hasOwnProperty,Tt=Object.create(null);for(var St in Ct)Ot.call(Ct,St)&&(Tt[Ct[St]]=St);var At={to:{},get:{}};function xt(t,e,n){return Math.min(Math.max(e,t),n)}At.get=function(t){var e,n;return"hsl"===t.substring(0,3).toLowerCase()?(e=At.get.hsl(t),n="hsl"):(e=At.get.rgb(t),n="rgb"),e?{model:n,value:e}:null},At.get.rgb=function(t){if(!t)return null;var e,n,o,i=[0,0,0,1];if(e=t.match(/^#([a-f0-9]{6})([a-f0-9]{2})?$/i)){for(o=e[2],e=e[1],n=0;n<3;n++){var r=2*n;i[n]=parseInt(e.slice(r,r+2),16)}o&&(i[3]=parseInt(o,16)/255)}else if(e=t.match(/^#([a-f0-9]{3,4})$/i)){for(o=(e=e[1])[3],n=0;n<3;n++)i[n]=parseInt(e[n]+e[n],16);o&&(i[3]=parseInt(o+o,16)/255)}else if(e=t.match(/^rgba?\(\s*([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)(?=[\s,])\s*(?:,\s*)?([+-]?\d+)\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)){for(n=0;n<3;n++)i[n]=parseInt(e[n+1],0);e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}else{if(!(e=t.match(/^rgba?\(\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*,?\s*([+-]?[\d\.]+)\%\s*(?:[,|\/]\s*([+-]?[\d\.]+)(%?)\s*)?\)$/)))return(e=t.match(/^(\w+)$/))?"transparent"===e[1]?[0,0,0,0]:Ot.call(Ct,e[1])?((i=Ct[e[1]])[3]=1,i):null:null;for(n=0;n<3;n++)i[n]=Math.round(2.55*parseFloat(e[n+1]));e[4]&&(e[5]?i[3]=.01*parseFloat(e[4]):i[3]=parseFloat(e[4]))}for(n=0;n<3;n++)i[n]=xt(i[n],0,255);return i[3]=xt(i[3],0,1),i},At.get.hsl=function(t){if(!t)return null;var e=t.match(/^hsla?\(\s*([+-]?(?:\d{0,3}\.)?\d+)(?:deg)?\s*,?\s*([+-]?[\d\.]+)%\s*,?\s*([+-]?[\d\.]+)%\s*(?:[,|\/]\s*([+-]?(?=\.\d|\d)(?:0|[1-9]\d*)?(?:\.\d*)?(?:[eE][+-]?\d+)?)\s*)?\)$/);if(e){var n=parseFloat(e[4]);return[(parseFloat(e[1])%360+360)%360,xt(parseFloat(e[2]),0,100),xt(parseFloat(e[3]),0,100),xt(isNaN(n)?1:n,0,1)]}return null},At.to.rgb=function(){var t=Et(arguments);return t.length<4||1===t[3]?"rgb("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+")":"rgba("+Math.round(t[0])+", "+Math.round(t[1])+", "+Math.round(t[2])+", "+t[3]+")"},At.to.hsl=function(){var t=Et(arguments);return t.length<4||1===t[3]?"hsl("+t[0]+", "+t[1]+"%, "+t[2]+"%)":"hsla("+t[0]+", "+t[1]+"%, "+t[2]+"%, "+t[3]+")"};const Pt=At,wt={},Rt={};for(const t of Object.keys(wt))Rt[wt[t]]=t;const _t={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"}};Math.pow(6/29,3);for(const t of Object.keys(_t)){if(!("channels"in _t[t]))throw new Error("missing channels property: "+t);if(!("labels"in _t[t]))throw new Error("missing channel labels property: "+t);if(_t[t].labels.length!==_t[t].channels)throw new Error("channel and label counts mismatch: "+t);const{channels:e,labels:n}=_t[t];delete _t[t].channels,delete _t[t].labels,Object.defineProperty(_t[t],"channels",{value:e}),Object.defineProperty(_t[t],"labels",{value:n})}_t.rgb.hsl=function(t){const e=t[0]/255,n=t[1]/255,o=t[2]/255,i=Math.min(e,n,o),r=Math.max(e,n,o),s=r-i;let l,a;r===i?l=0:e===r?l=(n-o)/s:n===r?l=2+(o-e)/s:o===r&&(l=4+(e-n)/s),l=Math.min(60*l,360),l<0&&(l+=360);const c=(i+r)/2;return a=r===i?0:c<=.5?s/(r+i):s/(2-r-i),[l,100*a,100*c]},_t.hsl.rgb=function(t){const e=t[0]/360,n=t[1]/100,o=t[2]/100;let i,r,s;if(0===n)return s=255*o,[s,s,s];i=o<.5?o*(1+n):o+n-o*n;const l=2*o-i,a=[0,0,0];for(let t=0;t<3;t++)r=e+1/3*-(t-1),r<0&&r++,r>1&&r--,s=6*r<1?l+6*(i-l)*r:2*r<1?i:3*r<2?l+(i-l)*(2/3-r)*6:l,a[t]=255*s;return a};const Lt=_t;function It(t,e){return function(n){return e(t(n))}}function Nt(t,e){const n=[e[t].parent,t];let o=Lt[e[t].parent][t],i=e[t].parent;for(;e[i].parent;)n.unshift(e[i].parent),o=It(Lt[e[i].parent][i],o),i=e[i].parent;return o.conversion=n,o}const Mt={};Object.keys(Lt).forEach(t=>{Mt[t]={},Object.defineProperty(Mt[t],"channels",{value:Lt[t].channels}),Object.defineProperty(Mt[t],"labels",{value:Lt[t].labels});const e=function(t){const e=function(t){const e=function(){const t={},e=Object.keys(Lt);for(let n=e.length,o=0;o<n;o++)t[e[o]]={distance:-1,parent:null};return t}(),n=[t];for(e[t].distance=0;n.length;){const t=n.pop(),o=Object.keys(Lt[t]);for(let i=o.length,r=0;r<i;r++){const i=o[r],s=e[i];-1===s.distance&&(s.distance=e[t].distance+1,s.parent=t,n.unshift(i))}}return e}(t),n={},o=Object.keys(e);for(let t=o.length,i=0;i<t;i++){const t=o[i];null!==e[t].parent&&(n[t]=Nt(t,e))}return n}(t);Object.keys(e).forEach(n=>{const o=e[n];Mt[t][n]=function(t){const e=function(...e){const n=e[0];if(null==n)return n;n.length>1&&(e=n);const o=t(e);if("object"==typeof o)for(let t=o.length,e=0;e<t;e++)o[e]=Math.round(o[e]);return o};return"conversion"in t&&(e.conversion=t.conversion),e}(o),Mt[t][n].raw=function(t){const e=function(...e){const n=e[0];return null==n?n:(n.length>1&&(e=n),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(o)})});const kt=Mt,jt=["keyword","gray","hex"],Dt={};for(const t of Object.keys(kt))Dt[[...kt[t].labels].sort().join("")]=t;const Ht={};function Bt(t,e){if(!(this instanceof Bt))return new Bt(t,e);if(e&&e in jt&&(e=null),e&&!(e in kt))throw new Error("Unknown model: "+e);let n,o;if(null==t)this.model="rgb",this.color=[0,0,0],this.valpha=1;else if(t instanceof Bt)this.model=t.model,this.color=[...t.color],this.valpha=t.valpha;else if("string"==typeof t){const e=Pt.get(t);if(null===e)throw new Error("Unable to parse color from string: "+t);this.model=e.model,o=kt[this.model].channels,this.color=e.value.slice(0,o),this.valpha="number"==typeof e.value[o]?e.value[o]:1}else if(t.length>0){this.model=e||"rgb",o=kt[this.model].channels;const n=Array.prototype.slice.call(t,0,o);this.color=Ft(n,o),this.valpha="number"==typeof t[o]?t[o]:1}else if("number"==typeof t)this.model="rgb",this.color=[t>>16&255,t>>8&255,255&t],this.valpha=1;else{this.valpha=1;const e=Object.keys(t);"alpha"in t&&(e.splice(e.indexOf("alpha"),1),this.valpha="number"==typeof t.alpha?t.alpha:0);const o=e.sort().join("");if(!(o in Dt))throw new Error("Unable to parse color from object: "+JSON.stringify(t));this.model=Dt[o];const{labels:i}=kt[this.model],r=[];for(n=0;n<i.length;n++)r.push(t[i[n]]);this.color=Ft(r)}if(Ht[this.model])for(o=kt[this.model].channels,n=0;n<o;n++){const t=Ht[this.model][n];t&&(this.color[n]=t(this.color[n]))}this.valpha=Math.max(0,Math.min(1,this.valpha)),Object.freeze&&Object.freeze(this)}Bt.prototype={toString(){return this.string()},string(t){let e=this.model in Pt.to?this:this.rgb();e=e.round("number"==typeof t?t:1);const n=1===e.valpha?e.color:[...e.color,this.valpha];return Pt.to[e.model](n)},round(t){return t=Math.max(t||0,0),new Bt([...this.color.map(Vt(t)),this.valpha],this.model)},alpha(t){return void 0!==t?new Bt([...this.color,Math.max(0,Math.min(1,t))],this.model):this.valpha},lighten(t){const e=this.hsl();return e.color[2]+=e.color[2]*t,e},darken(t){const e=this.hsl();return e.color[2]-=e.color[2]*t,e}};for(const t of Object.keys(kt)){if(jt.includes(t))continue;const{channels:e}=kt[t];Bt.prototype[t]=function(...e){return this.model===t?new Bt(this):e.length>0?new Bt(e,t):new Bt([...Ut(kt[this.model][t].raw(this.color)),this.valpha],t)},Bt[t]=function(...n){let o=n[0];return"number"==typeof o&&(o=Ft(n,e)),new Bt(o,t)}}function Vt(t){return function(e){return function(t,e){return Number(t.toFixed(e))}(e,t)}}function Ut(t){return Array.isArray(t)?t:[t]}function Ft(t,e){for(let n=0;n<e;n++)"number"!=typeof t[n]&&(t[n]=0);return t}const Wt=Bt;function Gt(t,e){Object.keys(e).forEach(n=>{t.style[n]=e[n]})}function zt(t,e,n){const o=function(t,e){let n=getComputedStyle(t)[e]||t.style.getPropertyValue(e);if(n&&n.includes("var(")&&(n=function(t){const e=String(t).match(/var\([^,]+,\s*(rgb(?:a)?\([^)]+\))\)/);return e&&e[1]?e[1]:null}(n)||void 0),n&&n.includes("rgb")&&(!(n.split("rgb").length>2)||n.includes("#")))return n}(e,n);if(o){const e=Wt(o).alpha(.5).string();return t.classList.add("focus-outline-defined"),t.style.setProperty("--clFocusOutline",`3px solid ${e}`),e}return null}function $t(t){const{width:e,height:n}=t.getBoundingClientRect(),{marginBottom:o,marginTop:i,marginLeft:r,marginRight:s}=window.getComputedStyle(t);return{width:e+parseInt(r,10)+parseInt(s,10),height:n+parseInt(i,10)+parseInt(o,10)}}function Kt(t,e,n,o,i){switch(t.position){case"top":return{left:`${Zt(e,n,o,i)}px`,top:t.availableSpaceAboveTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"bottom":return{left:`${Zt(e,n,o,i)}px`,bottom:t.availableSpaceBelowTriggerElem-t.contentHeight-t.verticalOffset+"px"};case"left":return{left:t.availableSpaceToTheLeftSideOfTheTrigger-e.width-t.contentWidth-t.horizontalOffset+"px",top:`${Qt(0,t)}px`};case"right":return{right:t.availableSpaceToTheRightSideOfTheTrigger-t.contentWidth-t.horizontalOffset+"px",top:`${Qt(0,t)}px`}}}function Zt(t,e,n,o){let i=n?t.x+t.width/2-e.width/2:t.x;return i<0&&(i=0),i+e.width>gt.width(o)&&(i-=i+e.width-gt.width(o)),i}function Qt(t,e){let n=e.availableSpaceAboveTriggerElem;return e.contentHeight>e.availableSpaceBelowTriggerElem&&(n-=e.contentHeight-e.availableSpaceBelowTriggerElem),n}function Yt(t){const{triggerElement:e,tooltipElement:n,offset:o=10,htmlDocumentObject:i}=t,r=function(t,e,n,o,i,r){const s=function(t,e,n,o,i){const r=function(t,e,n,o){const i=gt.width(o),{right:r}=t.getBoundingClientRect(),s=i-n-r-gt.scrollbarWidth(o);return{horizontalOffset:n,contentWidth:$t(e).width,availableSpaceToTheLeftSideOfTheTrigger:r-n,availableSpaceToTheRightSideOfTheTrigger:s}}(t,e,n,i),s=function(t,e,n,o){const i=gt.height(o),{top:r,bottom:s}=t.getBoundingClientRect();return{verticalOffset:n,contentHeight:$t(e).height,availableSpaceAboveTriggerElem:r-n,availableSpaceBelowTriggerElem:i-s-n}}(t,e,n,i);let l="undefined";const a={bottom:s.availableSpaceBelowTriggerElem>=s.contentHeight,top:s.availableSpaceAboveTriggerElem>=s.contentHeight,right:r.availableSpaceToTheRightSideOfTheTrigger>=r.contentWidth,left:r.availableSpaceToTheLeftSideOfTheTrigger>=r.contentWidth};if(a.top?l="top":a.bottom?l="bottom":a.right?l="right":a.left&&(l="left"),o&&a[o]&&(l=o),"undefined"===l){const t=Math.max(s.availableSpaceBelowTriggerElem,s.availableSpaceAboveTriggerElem,r.availableSpaceToTheRightSideOfTheTrigger,r.availableSpaceToTheLeftSideOfTheTrigger);t===s.availableSpaceBelowTriggerElem?l="bottom":t===s.availableSpaceAboveTriggerElem?l="top":t===r.availableSpaceToTheRightSideOfTheTrigger?l="right":t===r.availableSpaceToTheLeftSideOfTheTrigger&&(l="left")}return Object.assign(Object.assign(Object.assign({},s),r),{position:l})}(t,e,n,o,r=r||document);return function(t,e){const{marginBottom:n,marginTop:o}=window.getComputedStyle(e);if("top"===t.position)Gt(e,{"margin-top":`${parseInt(o,10)+parseInt(n,10)}px`}),Gt(e,{"margin-bottom":"0px"});else if("bottom"===t.position)Gt(e,{"margin-bottom":`${parseInt(n,10)+parseInt(o,10)}px`}),Gt(e,{"margin-top":"0px"});else{const t=(parseInt(n,10)+parseInt(o,10))/2+"px";Gt(e,{"margin-top":t,"margin-bottom":t})}}(s,e),{coordinates:Kt(s,t.getBoundingClientRect(),e.getBoundingClientRect(),i,r),position:s.position}}(e,n,o,"top",!0,i);n.setAttribute("cl-tooltip-position",r.position),Gt(n,r.coordinates)}Number.MAX_SAFE_INTEGER;const qt="PRIZE_POOL_UPDATED",Jt="REQUEST_PRIZE_POOL";function Xt(t){return Xt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xt(t)}function te(){var t,e,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function r(n,o,i,r){var a=o&&o.prototype instanceof l?o:l,c=Object.create(a.prototype);return ee(c,"_invoke",function(n,o,i){var r,l,a,c=0,d=i||[],u=!1,h={p:0,n:0,v:t,a:p,f:p.bind(t,4),d:function(e,n){return r=e,l=0,a=t,h.n=n,s}};function p(n,o){for(l=n,a=o,e=0;!u&&c&&!i&&e<d.length;e++){var i,r=d[e],p=h.p,m=r[2];n>3?(i=m===o)&&(a=r[(l=r[4])?5:(l=3,3)],r[4]=r[5]=t):r[0]<=p&&((i=n<2&&p<r[1])?(l=0,h.v=o,h.n=r[1]):p<m&&(i=n<3||r[0]>o||o>m)&&(r[4]=n,r[5]=o,h.n=m,l=0))}if(i||n>1)return s;throw u=!0,o}return function(i,d,m){if(c>1)throw TypeError("Generator is already running");for(u&&1===d&&p(d,m),l=d,a=m;(e=l<2?t:a)||!u;){r||(l?l<3?(l>1&&(h.n=-1),p(l,a)):h.n=a:h.v=a);try{if(c=2,r){if(l||(i="next"),e=r[i]){if(!(e=e.call(r,a)))throw TypeError("iterator result is not an object");if(!e.done)return e;a=e.value,l<2&&(l=0)}else 1===l&&(e=r.return)&&e.call(r),l<2&&(a=TypeError("The iterator does not provide a '"+i+"' method"),l=1);r=t}else if((e=(u=h.n<0)?a:n.call(o,h))!==s)break}catch(e){r=t,l=1,a=e}finally{c=1}}return{value:e,done:u}}}(n,i,r),!0),c}var s={};function l(){}function a(){}function c(){}e=Object.getPrototypeOf;var d=[][o]?e(e([][o]())):(ee(e={},o,function(){return this}),e),u=c.prototype=l.prototype=Object.create(d);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,c):(t.__proto__=c,ee(t,i,"GeneratorFunction")),t.prototype=Object.create(u),t}return a.prototype=c,ee(u,"constructor",c),ee(c,"constructor",a),a.displayName="GeneratorFunction",ee(c,i,"GeneratorFunction"),ee(u),ee(u,i,"Generator"),ee(u,o,function(){return this}),ee(u,"toString",function(){return"[object Generator]"}),(te=function(){return{w:r,m:h}})()}function ee(t,e,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}ee=function(t,e,n,o){function r(e,n){ee(t,e,function(t){return this._invoke(e,n,t)})}e?i?i(t,e,{value:n,enumerable:!o,configurable:!o,writable:!o}):t[e]=n:(r("next",0),r("throw",1),r("return",2))},ee(t,e,n,o)}function ne(t,e,n,o,i,r,s){try{var l=t[r](s),a=l.value}catch(t){return void n(t)}l.done?e(a):Promise.resolve(a).then(o,i)}function oe(t,e){for(var n=0;n<e.length;n++){var o=e[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,de(o.key),o)}}function ie(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(ie=function(){return!!t})()}function re(t,e,n,o){var i=se(le(1&o?t.prototype:t),e,n);return 2&o&&"function"==typeof i?function(t){return i.apply(n,t)}:i}function se(){return se="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,e,n){var o=function(t,e){for(;!{}.hasOwnProperty.call(t,e)&&null!==(t=le(t)););return t}(t,e);if(o){var i=Object.getOwnPropertyDescriptor(o,e);return i.get?i.get.call(arguments.length<3?t:n):i.value}},se.apply(null,arguments)}function le(t){return le=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},le(t)}function ae(t,e){return ae=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},ae(t,e)}function ce(t,e,n){return(e=de(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function de(t){var e=function(t){if("object"!=Xt(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=Xt(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==Xt(e)?e:e+""}var ue="lastPromoCode",he=function(){function t(){var e;return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),ce(e=function(t,e,n){return e=le(e),function(t,e){if(e&&("object"==Xt(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}(t,ie()?Reflect.construct(e,n||[],le(t).constructor):e.apply(t,n))}(this,t),"connectToPrizePool",function(){if(e.isStaticRenderMode()){var t=e.getProps().content.prize,n=t&&(t.id||t.options||"FIXED"===t.model)?t:e.findPoolPublishedByEarlierGame();return n?(e.prizePool=e.services.prizePoolFactory.get(n,e.getModel().id),e.componentResourceManager.getPending().increment(),e.showPendingLoader(),e.prizePool.load().then(function(){return e.prizePool.claimCode()}).then(function(){return e.prizePool.getPrize()}).then(function(t){e.componentResourceManager.getPending().decrement(),e.hidePendingLoader(),e.applyPrizePoolPrize(t)},function(t){console.error("SysPromoCodeComponent: prize pool unavailable, the widget stays hidden",t)})):(e.applyPrizePoolPrize(null),Promise.resolve())}e.prizePoolSubscription=e.services.eventEmitter.on(qt,function(){var t,n=(t=te().m(function t(n){var o,i,r;return te().w(function(t){for(;;)switch(t.n){case 0:if(o=n.componentId,i=n.prizePool,e.getModel().id===o){t.n=1;break}return t.a(2);case 1:return e.prizePool=e.services.prizePoolFactory.get(i,e.getModel().id),r=e,t.n=2,e.prizePool.getPrize();case 2:r.applyPrizePoolPrize.call(r,t.v);case 3:return t.a(2)}},t)}),function(){var e=this,n=arguments;return new Promise(function(o,i){var r=t.apply(e,n);function s(t){ne(r,o,i,s,l,"next",t)}function l(t){ne(r,o,i,s,l,"throw",t)}s(void 0)})});return function(t){return n.apply(this,arguments)}}()),setTimeout(function(){e.services.eventEmitter.emit(Jt,e.getModel().id)})}),ce(e,"findPoolPublishedByEarlierGame",function(){var t,n,o,i=null===(t=e.getModel().path)||void 0===t?void 0:t[0],r=Object.values((null===(n=(o=e.services.context).getRecordsMap)||void 0===n?void 0:n.call(o))||{}).filter(function(t){var e;return"prizePoolId"===(null==t||null===(e=t.value)||void 0===e?void 0:e.id)&&!!t.value.value}).filter(function(t){return Number.isInteger(t.value.viewIndex)&&t.value.viewIndex<i}).sort(function(t,e){return e.value.viewIndex-t.value.viewIndex});return r.length?{id:r[0].value.value}:null}),ce(e,"showPendingLoader",function(){var t=e.getElement("text"),n=null==t?void 0:t.querySelector(".promocode-asyncLoader");t&&n&&(n.style.color=t.style.color,t.classList.add("cl-promocode-loading"))}),ce(e,"hidePendingLoader",function(){var t;null===(t=e.getElement("text"))||void 0===t||t.classList.remove("cl-promocode-loading")}),ce(e,"applyPrizePoolPrize",function(t){e.prizePoolCode=(null==t?void 0:t.value)||null,e.renderCode(e.getProps()),e.emitPromoCodeShownOnce()}),ce(e,"emitPromoCodeShownOnce",function(){var t;if(!e.promoCodeShownEmitted){var n=e.getResolvedCode()||e.getProps().content.text;n&&(e.promoCodeShownEmitted=!0,e.services.eventEmitter.emit(j.PROMO_CODE_SHOWN,{code:n,autoRedeem:!1!==(null===(t=e.getProps())||void 0===t||null===(t=t.content)||void 0===t?void 0:t.autoRedeem)}))}}),ce(e,"renderTooltip",function(t){var n=e.getTranslationsMap(ct).translations;e.tooltipContainerElement=document.createElement("div"),e.tooltipContainerElement.classList.add("cl-promo-code-tooltip-container");var o=document.createElement("div");o.style.padding="5px",o.style.color="#fff",o.innerText=n,e.tooltipContainerElement.append(o),e.htmlDocumentObject.body.appendChild(e.tooltipContainerElement),e.firstTooltipTimer=setTimeout(function(){Yt({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject}),e.boundOnScrollHandler=function(){return Yt({triggerElement:t,tooltipElement:e.tooltipContainerElement,htmlDocumentObject:e.htmlDocumentObject})},document.addEventListener("scroll",e.boundOnScrollHandler,!0),e.secondTooltipTimer=setTimeout(function(){e.removeScrollListener(),e.tooltipContainerElement.style.transition="0.15s",e.tooltipContainerElement.style.top="".concat(t.getBoundingClientRect().top+window.pageYOffset,"px"),e.tooltipContainerElement.style.opacity="0",e.thirdTooltipTimer=setTimeout(function(){e.destroyTooltip()},150)},1500)})}),ce(e,"getTooltipTopPosition",function(t,e,n){var o=t.getBoundingClientRect();return"".concat(o.top-e.height-n+window.pageYOffset,"px")}),ce(e,"getTooltipLeftPosition",function(t,e){var n=t.getBoundingClientRect();return"".concat(n.left+n.width/2-e.width/2+window.pageXOffset,"px")}),ce(e,"destroyTooltip",function(){e.tooltipContainerElement&&(e.tooltipContainerElement.remove(),e.tooltipContainerElement=null)}),ce(e,"clearTooltipTimers",function(){clearTimeout(e.firstTooltipTimer),clearTimeout(e.secondTooltipTimer),clearTimeout(e.thirdTooltipTimer)}),ce(e,"removeScrollListener",function(){document.removeEventListener("scroll",e.boundOnScrollHandler,!0)}),ce(e,"mapStyleControlValuesToInnerContent",function(){var t=e.getElement("text"),n=t?t.querySelector(".".concat(e.inlineEditPromocodeClass)):null;t&&n&&(n.style.whiteSpace=e.isByContentWidth?"nowrap":"",n.style.minWidth="20px",n.style.width="max-content",n.style.minHeight=t.style.fontSize,n.style.textAlign=t.style.textAlign,n.style.lineHeight=t.style.lineHeight,n.style.fontWeight=t.style.fontWeight,n.style.fontSize=t.style.fontSize,n.style.textShadow=t.style.textShadow,n.style.letterSpacing=t.style.letterSpacing,n.style.fontFamily=t.style.fontFamily)}),ce(e,"mapAlignValueToTextElementContent",function(t){"center"===t.style.textAlign&&(t.style.justifyContent="center"),"start"===t.style.textAlign&&(t.style.justifyContent="flex-start"),"end"===t.style.textAlign&&(t.style.justifyContent="flex-end")}),ce(e,"handleSafariHeightIssue",function(){var t=e.getHostElement();"auto"===t.style.height&&(t.style.height="fit-content")}),ce(e,"storeStrokeTopWidthAsCssVar",function(){var t=e.getElement("host"),n=e.getElement("text");t.style.setProperty("--clStrokeForIconWidth",n.style.borderTopWidth||0)}),ce(e,"destroyExistingIcon",function(){var t=e.getRootElement().querySelector('[cl-element="icon"]');t&&t.remove()}),ce(e,"showIconIfAny",function(t,n){var o=n.content.iconContent,i=parseFloat(o),r=!isNaN(i);if(e.destroyExistingIcon(),null!=o){if(r){var s=(n.styles?"absolute"===n.styles.find(function(t){return"icon"===t.element}).styleAttributes.position:"absolute"===n.adaptiveStyles[e.getEnvironment()].find(function(t){return"icon"===t.element}).styleAttributes.position)?dt[i]:ut[i],l=document.createElement("span");l.classList.add("promocode-icon"),l.setAttribute("cl-element","icon"),Q({element:l,html:s}),t.appendChild(l)}else{var a=document.createElement("img");a.src=o,a.classList.add("promocode-icon"),a.setAttribute("cl-element","icon"),t.appendChild(a)}e.applyAutoAdaptiveStyles(n.adaptiveStyles,n.styles)}}),ce(e,"addTooltipStyles",function(){if(!e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId))){var t=document.createElement("style");t.setAttribute("id",e.tooltipStylesId),Q({element:t,html:mt}),e.htmlDocumentObject.head.appendChild(t)}}),ce(e,"removeTooltipStyles",function(){var t=e.htmlDocumentObject.head.querySelector("#".concat(e.tooltipStylesId));t&&t.remove()}),ce(e,"_handleContextRecord",function(t){t.key===ue&&e.renderCode(e.getProps())}),ce(e,"getResolvedCode",function(){if(e.prizePoolCode)return e.prizePoolCode;var t=e.services.context.getKVMap().promoCode;if(t)return t;var n=e.services.context.getRecord(ue);return n&&n.value.viewIndex<e.getModel().path[0]&&n.value.value||null}),ce(e,"renderCode",function(t){var n=e.getElement("text").querySelector(".".concat(e.inlineEditPromocodeClass)),o=e.getResolvedCode();e.applyInlineEditability(n,!o),o?n.innerText=o:Q({element:n,html:t.content.text})}),ce(e,"applyInlineEditability",function(t,n){n?t.setAttribute(e.inlineEditAttributeName,e.inlineEditAttributeValue):t.removeAttribute(e.inlineEditAttributeName)}),ce(e,"checkWidthMode",function(t){var n,o=e.getEnvironment(),i=null===(n=t.adaptiveStyles[o])||void 0===n||null===(n=n.find(function(t){return"host"===t.element}))||void 0===n?void 0:n.styleAttributes.width;e.isByContentWidth="auto"===i,e.isByContainerWidth="100%"===i}),ce(e,"manifest",st),ce(e,"tooltipContainerElement",void 0),ce(e,"firstTooltipTimer",void 0),ce(e,"secondTooltipTimer",void 0),ce(e,"thirdTooltipTimer",void 0),ce(e,"boundOnScrollHandler",void 0),ce(e,"contextSubscriptions",[]),ce(e,"prizePool",null),ce(e,"prizePoolSubscription",null),ce(e,"prizePoolCode",null),ce(e,"promoCodeShownEmitted",!1),ce(e,"tooltipStylesId","cl-promo-code-tooltip-styles"),ce(e,"inlineEditPromocodeClass","cl--inline--edit"),ce(e,"inlineEditAttributeName","cl-inline-edit"),ce(e,"inlineEditAttributeValue","content, text"),ce(e,"isByContainerWidth",!1),ce(e,"isByContentWidth",!1),e.getRootElement().innerHTML="\n <style>".concat("\n/* .text takes the host height through flex, not height:100%: in a quirks-mode document (customer\n pages with no doctype) WebKit resolves that percentage past the auto-height host against the\n enclosing view, so the code box grew over the content below it. */\n:host {\n display: flex;\n flex-direction: column;\n}\n\n.text {\n outline: none;\n min-height: 20px;\n cursor: pointer;\n width: 100%;\n flex: 1 1 auto;\n display: flex;\n align-items: center;\n position: relative;\n}\n\n.promocode-icon {\n top: calc(((var(--clPromocodeIconHeight) / 2) * -1) - var(--clStrokeForIconWidth));\n width: var(--clPromocodeIconWidth);\n height: var(--clPromocodeIconHeight);\n}\n\n.promocode-icon svg {\n display: flex;\n width: 100%;\n height: auto;\n}\n\nbutton.focus-outline-defined:focus {\n outline: var(--clFocusOutline);\n}\n\n.cl--inline--edit {\n overflow-wrap: break-word;\n max-width: 100%;\n}\n\n/* The spinner shown while the prize pool is being resolved and its code claimed. Same shape, size\n and rotation as the one SysButton shows during a submit, so the two read as one product. It\n centres on .text, which is already position: relative, and takes its colour from that\n element's own text colour - set in showPendingLoader, because the colour is an inline style the\n SDK writes per widget theme and no stylesheet here can know it. */\n.promocode-asyncLoader {\n display: none;\n position: absolute;\n top: 50%;\n left: 50%;\n width: 20px;\n height: 20px;\n margin: -10px 0 0 -10px;\n z-index: 1;\n pointer-events: none;\n}\n\n.text.cl-promocode-loading .promocode-asyncLoader {\n display: block;\n}\n\n/* The code itself is hidden rather than removed, so the component keeps the width it will have once\n the real code lands and nothing reflows around it when the spinner stops. The decorative stroke\n icons stay - they are the ticket, not the code. */\n.text.cl-promocode-loading .cl--inline--edit {\n visibility: hidden;\n}\n\n.promocode-asyncLoader .spinner--icon {\n width: 20px;\n height: 20px;\n transform-origin: center;\n animation: cl-promocode-spinner-rotate 0.8s linear infinite;\n}\n\n.promocode-asyncLoader .spinner--icon .path {\n stroke: currentColor;\n stroke-linecap: round;\n stroke-dasharray: 24 32;\n}\n\n@keyframes cl-promocode-spinner-rotate {\n 100% {\n transform: rotate(360deg);\n }\n}\n",'</style>\n <button class="text" cl-element="text">\n <span class="').concat(e.inlineEditPromocodeClass,'" ').concat(e.inlineEditAttributeName,'="').concat(e.inlineEditAttributeValue,'"></span>\n <span class="promocode-asyncLoader" aria-hidden="true">\n <svg class="spinner--icon" viewBox="0 0 18 18" aria-hidden="true">\n <circle class="path" cx="9" cy="9" r="5" fill="none" stroke-width="2"></circle>\n </svg>\n </span>\n </button>'),e}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&ae(t,e)}(t,it),function(t,e){return e&&oe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}(t,[{key:"connectedCallback",value:function(){var e=this;re(t,"connectedCallback",this,3)([]),this.addTooltipStyles();var n=this.getElement("text"),o=n.querySelector("[".concat(this.inlineEditAttributeName,'="').concat(this.inlineEditAttributeValue,'"]'));this.contextSubscriptions=[this.services.context.on("RECORD_ADDED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_UPDATED",this._handleContextRecord.bind(this)),this.services.context.on("RECORD_DELETED",this._handleContextRecord.bind(this))],this.isStaticRenderMode()&&n.addEventListener("click",function(t){t.stopPropagation(),function(t){const e=String(t).trim().replace(/<br\s*\/?>/gi," "),n=navigator.clipboard;return(null==n?void 0:n.writeText)?function(){var t;return"null"===(null!==(t=window.origin)&&void 0!==t?t:window.location.origin)}()?at(e).catch(()=>n.writeText(e)):n.writeText(e).catch(()=>at(e)):at(e)}(o.textContent).then(function(){e.destroyTooltip(),e.clearTooltipTimers(),e.removeScrollListener(),e.renderTooltip(n)}).catch(function(t){return console.error("SysPromoCodeComponent couldn't write to clipboard",t)}),e.services.trackingService.send("FormClick_[Name]"),e.services.trackingService.trackClick({countAsTargetAction:e.getProps().content.countAsTargetAction}),e.services.trackingService.trackTargetAction(e.getProps().content.countAsTargetAction)}),this.observeProps(function(t,o){e.applyAutoAdaptiveStyles(o.adaptiveStyles,o.styles),e.checkWidthMode(o),e.renderCode(o),e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent(),e.showIconIfAny(n,o),e.storeStrokeTopWidthAsCssVar(),e.handleSafariHeightIssue(),function(t){let e=null;const n=t,o=["transparent","initial"];t&&(t.style.borderColor&&!o.includes(t.style.borderColor)&&(parseFloat(t.style.borderWidth)||parseFloat(t.style.borderBottomWidth))&&(e=zt(n,t,"borderColor")),!e&&t.style.getPropertyValue("--borderBottomColor")&&!o.includes(t.style.getPropertyValue("--borderBottomColor"))&&parseFloat(t.style.getPropertyValue("--borderBottomWidth"))&&(e=zt(n,t,"--borderBottomColor")),e||!t.style.backgroundColor||o.includes(t.style.backgroundColor)||(e=zt(n,t,"backgroundColor")),e||!t.style.color||o.includes(t.style.color)||(e=zt(n,t,"color")),e||n.classList.remove("focus-outline-defined"))}(e.getElement("text"))}),this.observeShared(function(){e.mapAlignValueToTextElementContent(e.getElement("text")),e.mapStyleControlValuesToInnerContent()}),this.observeEnvironment(function(){e.handleSafariHeightIssue(),e.mapStyleControlValuesToInnerContent()}),this.connectToPrizePool()}},{key:"disconnectedCallback",value:function(){re(t,"disconnectedCallback",this,3)([]),this.destroyTooltip(),this.clearTooltipTimers(),this.removeScrollListener(),this.removeTooltipStyles(),this.contextSubscriptions.forEach(function(t){return t.off()}),this.prizePoolSubscription&&(this.prizePoolSubscription.off(),this.prizePoolSubscription=null)}}])}();ce(he,"define",{name:"sys-promo-code",model:st.name,manifest:st});export{he as default};window.clComponentClass_SysPromoCodeComponent=he;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claspo/components",
3
- "version": "1.10.28-pnc1",
3
+ "version": "1.10.28",
4
4
  "description": "",
5
5
  "scripts": {
6
6
  "prebuild": "rm -rf out",
@@ -18,8 +18,8 @@
18
18
  "node": ">=18.16.0"
19
19
  },
20
20
  "dependencies": {
21
- "@claspo/common": "7.5.14-pnc1",
22
- "@claspo/renderer": "18.14.0-pnc2"
21
+ "@claspo/common": "7.5.11",
22
+ "@claspo/renderer": "18.13.0"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@babel/core": "^7.27.4",