@abtasty/countdown 3.12.3 → 3.12.4-2
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.
- package/dist/form.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(){"use strict";const t=()=>Object.prototype.hasOwnProperty.call(top,"ABTastyEditor"),e=()=>{const t=!!document.getElementById("ABTastyPreviewBar"),e=location.href.includes("ab_project=preview");return t||e},n=t=>new Function(`try {\n\t\t${t}\n\t} catch (error) {\n\t\treturn null;\n\t}`)(),o=()=>encodeURIComponent(DATA.spNoTrim?window.location.href.replace(window.location.origin,""):`${window.location.pathname}`),i=()=>!t()&&(e()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),s=()=>window.ABTasty&&!0===window.ABTasty.consentReady,a=()=>{const{type:t}=DATA;return`${PACKAGE.replace("@abtasty/","")}${t?`_${t}`:""}`},r=()=>{const t=a();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`.split("-").join(" ")},c=()=>`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,l=n=>{const o=(()=>{if(t()||e())return!1;const n=ABTasty.getTestsOnPage()[TEST_ID];return!!n&&Object.keys(n.targetings.qaParameters).length>0})(),i=window.document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(o||i){const t=r();window.console.log(`%c${t} - ${o?"QA":"Debug"} Mode for campaign ${TEST_ID} %c ${n}`,"background-color: #D6FF01; color: #3100be; padding: 3px 0 3px 10px; border-radius: 5px 0 0 5px; font-weight: bold;","background-color: #3100be; color: white; padding: 3px 10px 3px 0; border-radius: 0 5px 5px 0;")}},d=t=>{const e={promise:null,resolve:null,reject:null,name:t};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e},u=(t,e)=>{const n=e?[]:null;if("string"!=typeof t||!t.trim().length)return n;const[o,i,s]=t.split("[]").map(t=>t.trim()),a=Boolean(s)?s:t,r=i?document.querySelector(o)?.[i]:document;return r?e?[...r.querySelectorAll(a)]:r.querySelector(a):n},h=t=>u(t,!1),m=t=>u(t,!0),y=(t,e)=>{const n={childList:!0,subtree:!0,attributes:!0},o=()=>i.disconnect(),i=new MutationObserver(()=>{const n=h(e);return n&&!o()&&t(n)});return{clear:o,observe:t=>{const e=document.querySelector("body")||document.documentElement,o=t??e;i.observe(o,n)}}},g=()=>{},b=(e,n)=>{const o=h(e),i={selector:e,clear:g,observe:g};if(o)return setTimeout(()=>n(o),0),i;if(t())return setTimeout(()=>b(e,n),1e3),i;if(e.includes("[]"))return((t,e)=>{const[n,o]=e.split("[]").map(t=>t.trim()),i=h(n),s=i?.[o],{clear:a,observe:r}=y(t,e),c=()=>{const n=h(e);return n&&!l()&&t(n)},l=()=>{a(),i?.removeEventListener("load",c)},d=()=>{r(s),"iframe"===i?.localName&&i.addEventListener("load",c)};return d(),{selector:e,clear:l,observe:d}})(n,e);const{clear:s,observe:a}=y(n,e);return a(),{selector:e,clear:s,observe:a}};function p(t,e){const n=t.parentElement||t.getRootNode().host;return e(t)||!n?t:p(n,e)}const w=e=>{t()||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())},v=(t,e)=>[...m(e)].some(n=>{const[o,,i]=e.split("[]"),s=i??o;return n===t||!!t.closest(s)});let f=!1;class T{constructor(){this.targets=[],this.existingTargets=[],this.inViewportTargets=[],this.visibilityObserver=null,this.mutationObserver=null,this.mouseOverEvent=null,this.scrollEvent=null,this.onTransitionEnd=null,this.onIframeLoad=null}transitionOverHandler(t){const e=[t,"transitionend",this.checkElements.bind(this),!0];return this.getEvents(...e)}intersectionHandler(t){t.forEach(t=>{t.isIntersecting?(this.existingTargets.forEach(e=>{e.element.isSameNode(t.target)&&(this.inViewportTargets.push(e),this.mouseOverEvent.start(),this.scrollEvent.start(),this.onTransitionEnd.start())}),this.checkElements()):this.inViewportTargets=this.inViewportTargets.filter(e=>!e.element.isSameNode(t.target)||(this.mouseOverEvent.clear(),this.scrollEvent.clear(),this.onTransitionEnd.clear(),!1))})}startVisibilityObserver(t){const e={root:t,rootMargin:"0px",threshold:.01};return this.visibilityObserver??=new IntersectionObserver(this.intersectionHandler.bind(this),e),this.visibilityObserver}startMutationObserver(t){return this.mutationObserver??=new MutationObserver(this.checkElements.bind(this)),this.mutationObserver.observe(t,{attributes:!0,childList:!0,subtree:!0}),this.mutationObserver}onMouseOver({target:t,path:e}){const n=this.inViewportTargets.find(({element:n,selector:o})=>{if(n.isSameNode(t))return!0;const[i,,s]=o.split("[]"),a=s??i,r=[...t.querySelectorAll(a)];if(r.length&&r.includes(n))return!0;if(e.includes(n))return!0;if(!t.parentElement?.children?.length)return;const c=[...t.parentElement.children],l=c.findIndex(e=>e.isSameNode(t)),d=c.filter((t,e)=>e>l);if(d.length){if(d.includes(n))return!0;if(d.some(t=>[...t.querySelectorAll(a)].includes(n)))return!0}return!1});if(n&&this.isElementVisible(n.element)){const{selector:t,element:e,uniqueId:o}=n,i=this.targets.find(e=>e.selector===t&&e.uniqueId===o);i&&i.resolve(e),this.clear(t,o)}}getEvents(t,...e){return{start:()=>t?.addEventListener(...e),clear:()=>t?.removeEventListener(...e)}}mouseOverHandler(t){const e=[t,"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?"touchmove":"mouseover",t=>{const e=t.composedPath(),{target:n}=t;setTimeout(()=>this.onMouseOver({target:n,path:e}),50)},!0];return this.getEvents(...e)}scrollEventHandler(t){const e=[t,"scroll",(n=this.checkElements.bind(this),()=>{f||(f=!0,setTimeout(()=>{n(),f=!1},100))}),{passive:!0}];var n;return this.getEvents(...e)}isElementVisible(t){return this.isElementOpaque(t)&&this.isElementTopmost(t)}isElementOpaque(t){return"HTML"===p(t,t=>"0"===window.getComputedStyle(t).opacity).nodeName}isElementTopmost(t){const e=t.getBoundingClientRect(),n=[[e.left,e.top],[e.right,e.top],[e.left,e.bottom],[e.right,e.bottom],[e.left+e.width/2,e.top],[e.left+e.width/2,e.bottom],[e.left,e.height/2],[e.right,e.height/2],[e.left+e.left/2,e.height/2]];let o=!1,i=0;for(;!o&&i<n.length;){const e=t.getRootNode()?.elementFromPoint(...n[i]);o=t===e||e?.contains(t)||t.contains(e),i+=1}return o}checkElements(){this.targets.forEach(({selector:t,uniqueId:e})=>{const n=h(t),[o,,i]=t.split("[]"),s=i??o;n&&!this.existingTargets.find(t=>t.element.matches(s)&&t.uniqueId===e)&&(this.existingTargets.push({element:n,selector:t,uniqueId:e}),this.visibilityObserver.observe(n))}),this.existingTargets=this.existingTargets.filter(({selector:t,element:e})=>!(!h(t)||!e.isConnected)||(e&&this.visibilityObserver.unobserve(e),!1)),this.inViewportTargets=this.inViewportTargets.filter(({selector:t,element:e,uniqueId:n})=>{const[o,,i]=t.split("[]"),s=i??o;if(e.matches(s)&&this.isElementVisible(e)){const o=this.targets.find(e=>e.selector===t&&e.uniqueId===n);return o&&o.resolve(e),this.clear(t,n),!1}return!0})}onLoadIframe(t){const e=[t.defaultView.frameElement,"load",()=>this.watch(selector,resolve,uniqueId).bind(this),{passive:!0}];return this.getEvents(...e)}watch(t,e,n){this.targets.push({selector:t,resolve:e,uniqueId:n});const{clear:o}=b(t,t=>{o();const e=t.getRootNode({composed:!0}),n="body"in e?e.body:document;this.mouseOverEvent=this.mouseOverHandler(e),this.scrollEvent=this.scrollEventHandler(e),this.onTransitionEnd=this.transitionOverHandler(e),e.defaultView?.frameElement&&(this.onIframeLoad=this.onLoadIframe(e),this.onIframeLoad.start()),this.startVisibilityObserver(e),this.startMutationObserver(n),this.checkElements()})}clear(t,e){[this.targets,this.existingTargets,this.inViewportTargets]=[this.targets,this.existingTargets,this.inViewportTargets].map(n=>n.filter(({selector:n,uniqueId:o})=>n!==t&&o!==e));const n=h(t);n&&this.visibilityObserver?.unobserve(n),0===this.targets.length&&(this.mutationObserver?.disconnect(),this.onIframeLoad?.clear()),0===this.inViewportTargets.length&&(this.mouseOverEvent?.clear(),this.scrollEvent?.clear(),this.onTransitionEnd?.clear())}}const x="remove",C="rebuild",S="update",A="ABTastyData";class E{constructor({triggerEvent:t,triggerSelector:e,triggerDelay:n,triggerTarget:o}){this.event=t,this.selector=Boolean(e)?e:"body",this.target="string"==typeof o?h(e):o,this.delay=1e3*n,this.triggerElements=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.promises=[],this.visibilityObservers=[],this.socialProofStore={},this.elementWaiters=[]}async onElementVisible({promise:t,resolve:e}){const n=d(`${this.event}DomReady`);this.promises.push(n);const{clear:o}=b(this.selector,()=>{const t=new T;this.visibilityObservers.push(t),t.watch(this.selector,e,c())});return this.elementWaiters.push(o),t}onPageLoad({promise:t,resolve:e}){const n=()=>"complete"===document.readyState;if(!n()){const o=["readystatechange",()=>n()&&e(!0),{passive:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}return e(!0),t}onClick({promise:t,resolve:e}){const n=({isTrusted:t,target:n})=>{if(t)return(n.isEqualNode(this.target)||v(n,this.selector))&&e(!0)},{clear:o}=b(this.selector,t=>{o();const e=document.createElement("style");e.id=`Click_${c()}`;const[i,,s]=this.selector.split("[]"),a=s??i;e.innerHTML=`${a} {\n\t\t\t\tcursor: pointer !important;\n\t\t\t\tpointer-events: all !important;\n\t\t\t}`;const r=t.getRootNode();("head"in r?r.head:r).appendChild(e),this.triggerElements.push(e);const l=["click",n,{passive:!0,capture:!0}];this.eventsListeners.push([r,...l]),r.addEventListener(...l)});return this.elementWaiters.push(o),t}onHover({promise:t,resolve:e}){const n=({isTrusted:t,target:n})=>{if(t)return(this.target?n.isEqualNode(this.target):v(n,this.selector))&&e(!0)},{clear:o}=b(this.selector,t=>{const e=t.getRootNode(),o="body"in e?e.body:[...e.childNodes].find(e=>e.contains(t)),i=["mouseenter",n,{passive:!0,capture:!0}];this.eventsListeners.push([o,...i]),o.addEventListener(...i)});return this.elementWaiters.push(o),t}onExitIntent({promise:t,resolve:e}){const n=["mouseleave",({isTrusted:t,clientY:n})=>{t&&n<=0&&e(!0)},{passive:!0}],{clear:o}=b("html",t=>{o(),this.eventsListeners.push([t,...n]),t.addEventListener(...n)});return t}onReengage({promise:t,resolve:e}){const n=this.delay;let o=n;const i=[...document.querySelectorAll("*:empty")].map(t=>t.contentDocument||t.shadowRoot).filter(t=>t),s=[({isTrusted:t})=>{t&&(o=n)},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(t=>{[document,...i].forEach(e=>{this.eventsListeners.push([e,t,...s]),e.addEventListener(t,...s)})});const a=setInterval(()=>{o<=0?e(!0):o-=100},100);return this.intervals.push(a),t}onCustomTrigger({promise:t,resolve:e}){const{triggerEventCustomScript:n,tagIsSafeEval:o}=DATA,i=o&&DATA_JS?.triggerEventCustomScript,s="function"==typeof i?()=>new Promise(t=>i(t)):new Function(`return new Promise(async resolve => {${n}})`);return s().then(t=>t&&e(!0)),t}onScrollUp({promise:t,resolve:e}){let n=0;const o=["scroll",({isTrusted:t})=>{t&&(window.scrollY<n?e(!0):n=window.scrollY)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}onScrollPercentReached({promise:t,resolve:e}){const{triggerEventScrollPercent:n}=DATA,o=["scroll",({isTrusted:t})=>{if(!t)return;const o=(()=>{const{documentElement:t,body:e}=document,n=t.scrollTop||e.scrollTop,o=t.scrollHeight||e.scrollHeight;return Math.trunc(n/(o-t.clientHeight)*100,10)})();n<o&&e(!0)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}checkSocialProofConditions(t,e,n,o){const i=(()=>{let t;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S?.USER?.accountIdentifier?.length?t=window.ABTASTY_S.USER.accountIdentifier:"function"==typeof window.ABTasty?.getAccountSettings?t=window.ABTasty.getAccountSettings().identifier:window.ABTasty?.accountSettings&&(t=window.ABTasty.accountSettings.identifier),t):t})(),{viewInterval:s,spNoTrim:a}=DATA;if(this.socialProofStore.hasOwnProperty(t))n(this.socialProofStore[t])?o(`${this.socialProofStore[t][s]}`):o(!1);else if(t&&i){const r=e=>(this.socialProofStore[t]=e,o(!!n(e)&&`${e[s]}`));fetch(`https://api-social-proof.abtasty.com/clients/${i}/metrics/${e}?key=${t}${a?"&noTrim=true":""}`).then(t=>t.ok&&t.json()).then(r).catch(()=>l("Failed to fetch datas from server."))}else o(!1)}getSocialProofDatas({promise:t,resolve:e},i,s=!1){const{productKey:a,keyType:r}=(()=>{const{socialProofContentType:t,productKeyProvider:e,pathToProductKey:i,customJSProductKey:s,productSKU:a,tagIsSafeEval:r}=DATA,{pathToProductKey:c,customJSProductKey:l}=r&&DATA_JS||{};if(2===t)return{productKey:o(),keyType:"url"};{let r=null,d="sku";switch(e){case"ABTastyProductKey":r=window.ABTastyProductKey;break;case"pathToProductKey":r="function"==typeof c?c():n(`return ${i};`);break;case"customJSProductKey":r="function"==typeof l?l():n(s);break;case"productSKU":r=a}return r||3!==t||(r=o(),d="url"),{productKey:r,keyType:d}}})(),{viewInterval:c,triggerSocialProofMinVisitors:d,triggerSocialProofMinPurchases:u,triggerSocialProofMinPageViews:h}=DATA,m={pv:h,i:u,"v-pv":d}[i];return[typeof c,typeof m].includes("undefined")&&e(!1),s&&!a&&(l("Not able to find ABTastyProductKey, impossible to call the API, read documentation for more informations:\n\t\t\t\thttps://support.abtasty.com/hc/en-us/articles/4710919241628-Widgets-List#h_84c04344-c655-4e5e-b9ab-d26a798ad9b0"),e(!1)),this.checkSocialProofConditions(a,"v-pv"===i&&"sku"===r?"v-i":i,t=>{const e=void 0!==t[c]&&t[c]>=m;return e||l(`Widget will not be shown, Social Proof API returned ${t[c]} while ${m} are required`),e},e),t}onConsent({promise:t,resolve:e}){if(!s()){const n=["abtasty_consentValid",()=>e(!0)];return this.eventsListeners.push(n),window.addEventListener(...n),t}return e(!0),t}onTrackingSent({promise:t,resolve:e}){const{triggerEventTrackingSent:n}=DATA;let o=localStorage.getItem(A);const i=()=>JSON.parse(o)?.ActionTracking?.some(({name:t})=>t===n),s=["storage",({key:t,newValue:n})=>{t===A&&(o=n,i()&&e(!0))},{passive:!0,capture:!0}];return o&&i()?e(!0):(()=>{this.eventsListeners.push([window,...s]),window.addEventListener(...s)})(),t}onMinPagesViewed({promise:t,resolve:e}){const{triggerEventMinPagesViewed:n}=DATA;let o=localStorage.getItem(A);const i=()=>n<=(o?JSON.parse(o)?.VisitedPages?.length:0),s=["storage",({key:t,newValue:n})=>{t===A&&(o=n,i()&&e(!0))},{passive:!0,capture:!0}];return o&&i()?e(!0):(()=>{this.eventsListeners.push([window,...s]),window.addEventListener(...s)})(),t}onRageClick({promise:t,resolve:e}){const{triggerEventRageClickQuantity:n,triggerEventRageClickDelay:o}=DATA;let i=0,s=!1;const a=["click",({isTrusted:t})=>{if(t&&(i+=1,i>=n&&e(!0),!s)){s=!0;const t=setTimeout(()=>{i=0,s=!1},o);this.timeouts.push(t)}},{passive:!0,capture:!0}],r=t=>{this.eventsListeners.push([t,...a]),t.addEventListener(...a)},{clear:c}=b("iframe []contentDocument[] body > *",()=>{const t=document.getElementsByTagName("iframe");for(const e of t){"contentDocument"in e&&"body"in e.contentDocument&&r(e.contentDocument);const t=()=>r(e.contentDocument);e.addEventListener("load",t),this.eventsListeners.push([e,"onIframeLoad",t])}});return this.elementWaiters.push(c),r(document),t}clear(){this.triggerElements=this.triggerElements.filter(t=>(t.remove(),!1)),this.eventsListeners=this.eventsListeners.filter(t=>{const[e,...n]=t;return e&&n.length>1&&e.removeEventListener(...n),!1}),this.timeouts=this.timeouts.filter(t=>(clearTimeout(t),!1)),this.intervals=this.intervals.filter(t=>(clearInterval(t),!1));const t=c();return this.visibilityObservers=this.visibilityObservers.filter(e=>(e.clear(this.selector,t),!1)),this.promises=this.promises.filter(t=>(t.resolve(!1),!1)),this.elementWaiters=this.elementWaiters.filter(t=>(t(),!1)),this}async isTriggered(){this.clear();const t=d(this.event);this.promises.push(t);const e={consent:()=>this.onConsent(t),direct:()=>!0,pageLoad:()=>this.onPageLoad(t),click:()=>this.onClick(t),exitIntent:()=>this.onExitIntent(t),reengage:()=>this.onReengage(t),elementVisible:()=>this.onElementVisible(t),script:()=>this.onCustomTrigger(t),hover:()=>this.onHover(t),scrollUp:()=>this.onScrollUp(t),scrollPercent:()=>this.onScrollPercentReached(t),rageClick:()=>this.onRageClick(t),minPagesViewed:()=>this.onMinPagesViewed(t),trackingSent:()=>this.onTrackingSent(t),socialProofPurchases:()=>this.getSocialProofDatas(t,"i",!0),socialProofPageViews:()=>this.getSocialProofDatas(t,"pv"),socialProofVisitors:()=>this.getSocialProofDatas(t,"v-pv")},n=!Object.prototype.hasOwnProperty.call(e,this.event)||await e[this.event]();return n&&this.clear(),"reengage"!==this.event&&this.delay?n&&await(async()=>{const t=d(`${this.event}Delay`);this.promises.push(t);const e=setTimeout(()=>{t.resolve(!0),this.clear()},this.delay);return this.timeouts.push(e),t.promise})():n}}const k="display",L="closing",P="validation",I="ABTastyWidgets",B=`${I}Temporary`;class D{constructor({displayRecurrence:t,closingRecurrence:e,validationRecurrence:n},o){this.displayRecurrence=parseFloat(t),this.closingRecurrence=parseFloat(e),this.validationRecurrence=parseFloat(n),this.onSetCallback=o,this.widgetName=a(),this.uniqueId=c(),this.recurrenceKey=`${this.widgetName}_${this.uniqueId}`,this.isListeningStorageEvent=this.listenStorageEvent(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}onStorage({key:t}){const e=localStorage.getItem(B),n=sessionStorage.getItem(I);"ABTastyData"===t&&!e&&n&&localStorage.setItem(B,n)}listenStorageEvent(){return this.isListeningStorageEvent||window.addEventListener("storage",this.onStorage.bind(this)),!0}getGivenRecurrenceStorageParsed(t){try{const e=t.getItem(I);return JSON.parse(e)}catch(e){return t.removeItem(I),!1}}getSessionRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}getLocalRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}removeGivenStorage(t,e){const{[this.recurrenceKey]:n,...o}=e;return Object.entries(o).length?(t.setItem(I,JSON.stringify(o)),o):(t.removeItem(I),!1)}removeSessionRecurrenceStorage(){const t=this.getSessionRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.sessionStorage,t)}removeLocalRecurrenceStorage(){const t=this.getLocalRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.localStorage,t)}getSessionRecurrence(){const t=this.getSessionRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}getLocalRecurrence(){const t=this.getLocalRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}getCurrentRecurrence(){if(this.pendingRecurrence)return this.pendingRecurrenceValue;const t=this.getSessionRecurrence(),e=this.getLocalRecurrence();return t||e||{type:!1}}isOver(){const t=localStorage.getItem(B),e=!(!t||!t.includes(this.recurrenceKey))||this.getSessionRecurrence();t&&(sessionStorage.setItem(I,t),localStorage.removeItem(B));const n=this.getLocalRecurrence(),o=(n?parseFloat(n.stamp):0)<(new Date).getTime();return o&&this.removeLocalRecurrenceStorage(),!this.pendingRecurrence&&o&&!this.getLocalRecurrence()&&!e}setRecurrence(t,n){0!==t&&(window.removeEventListener("storage",this.onStorage.bind(this)),this.isListeningStorageEvent=!1);const o=this.getTypeOfStorage(t);if(e()||!o&&"object"!=typeof o)return!1;const{storageString:i,storageMethod:a}=o,r=this.getStamp(t),c={type:n,stamp:r},{type:l}=this.getCurrentRecurrence(),d=async()=>{if(!s()){this.pendingRecurrence=!0,this.pendingRecurrenceValue=c;const t=new E({triggerEvent:"consent"});await t.isTriggered(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}const t=this.getSessionRecurrence(),e=this.getLocalRecurrence();let n;"session"===i?t?n=this.removeSessionRecurrenceStorage():(this.removeLocalRecurrenceStorage(),n=this.getSessionRecurrenceStorageParsed()):"local"===i&&(e?n=this.removeLocalRecurrenceStorage():(this.removeSessionRecurrenceStorage(),n=this.getLocalRecurrenceStorageParsed()));const o=n?{[this.recurrenceKey]:c,...n}:{[this.recurrenceKey]:c};a.setItem(I,JSON.stringify(o)),this.onSetCallback&&"function"==typeof this.onSetCallback&&this.onSetCallback()};if(!a)return!1;if(l&&n!==P)if(n===L&&l!==P)d();else{if(n!==k||l===P||l===L)return!1;d()}else d();return r}setDisplayRecurrence(){const t=k;this.setRecurrence(this.displayRecurrence,t)}setClosingRecurrence(){const t=L;this.setRecurrence(this.closingRecurrence,t)}setValidationRecurrence(){const t=P;this.setRecurrence(this.validationRecurrence,t)}getStamp(t){return(new Date).getTime()+864e5*t}getTypeOfStorage(t){return!(isNaN(t)||t<0||0!==t&&!t)&&(t>0?{storageString:"local",storageMethod:window.localStorage}:0===t&&{storageString:"session",storageMethod:window.sessionStorage})}}class N{constructor(t,e,n){this.isWidgetApplied=t,this.callback=e,this.shouldUpdate=n,this.triggerIframeTarget=null,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.tagRollbackEventParams=["abtasty_resetActionTracking",this.onTagRollback.bind(this)],this.onCampaignLaunchedEventParams=["abtasty_executedCampaign",this.onCampaignLaunched.bind(this)]}decisionHandler(t){const e=!t&&this.isWidgetApplied(),n=e?this.shouldUpdate&&S:C;return n?(this.clearWatcher(),this.callback(n,!t,e),this.watch(),this):this}onCampaignLaunched({detail:{campaignId:t}}){t===TEST_ID&&(this.callback(C,!1),this.watch())}onTagRollback({target:t}){return this.clearWatcher(t),this.callback(x,!1,!0),window.addEventListener(...this.onCampaignLaunchedEventParams),this}observerHandler(t){return i()?t.some(t=>["removedNodes","addedNodes"].some(e=>t[e]&&t[e].length))?this.decisionHandler():this:this.callback(x,!1)}watch(e,n){if(t())return this;if(this.clearWatcher(e),window.removeEventListener(...this.onCampaignLaunchedEventParams),document.addEventListener(...this.tagRollbackEventParams),n?.includes("[]contentDocument[]")){const t=n.split("[]")[0].trim(),{clear:e}=b(t,t=>{e(),this.triggerIframeTarget=t,t.addEventListener("load",this.decisionHandler.bind(this))})}const o=e?.defaultView?.frameElement;o&&this.triggerIframeTarget!==o&&o.addEventListener("load",this.decisionHandler.bind(this));const{clear:i}=b("body",t=>{i();const n=e?.body||e||t;this.observer.observe(n,{childList:!0,subtree:!0})});return this}clearTriggerElementWatcher(){this.triggerIframeTarget?.removeEventListener("load",this.decisionHandler.bind(this))}clearWatcher(t){return document.removeEventListener(...this.tagRollbackEventParams),this.observer.disconnect(),this.clearTriggerElementWatcher(),t?.defaultView?.frameElement?.removeEventListener("load",this.decisionHandler.bind(this)),this}}const _=/.+\/([^.]+)\.(otf|ttf)$/,R=["socialProofPurchases","socialProofPageViews","socialProofVisitors"];class O{constructor(e,n){this.children=void 0,this.uniqueId=`${c()}${n?`_${n}`:""}`,this.widgetName=a(),this.prettyName=r(),this.recurrenceParams=(()=>{const{displayRecurrence:e,closingRecurrence:n,validationRecurrence:o}=DATA,i=!e&&!n&&!o;if(t()||i)return!1;const s={everytime:()=>-1,session:()=>0,once:()=>395,day:t=>DATA[`${t}_day`],week:t=>7*DATA[`${t}_week`],month:t=>30.5*DATA[`${t}_month`]},a={};return e&&(a.displayRecurrence=s[e]("displayRecurrence")),n&&(a.closingRecurrence=s[n]("closingRecurrence")),o&&(a.validationRecurrence=s[o]("validationRecurrence")),a})(),this.triggerParams=(e=>{let{triggerEvent:n}=DATA;const{triggerEventClick:o,triggerEventHover:i,triggerEventReengageDelay:s,socialProofContentType:a,triggerEventElementVisible:r,triggerEventDelay:c}=DATA;if(t()||!n&&!a)return!1;const l={click:()=>o,hover:()=>i,elementVisible:()=>r},d=Object.prototype.hasOwnProperty.call(l,n)?l[n]():"body",u="reengage"===n?s:c;return a&&(n=[,"socialProofPurchases","socialProofPageViews","socialProofVisitors"][a]),{triggerEvent:n,triggerSelector:d,triggerDelay:u,triggerTarget:e}})(e),this.recurrence=!!this.recurrenceParams&&new D(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new E(this.triggerParams),this.shouldUpdate=!!this.triggerParams&&R.includes(this.triggerParams.triggerEvent),this.pageWatcher=new N(this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=(()=>{const{isOncePerPageTrigger:t,triggerEvent:e}=DATA;return!e||!["click","hover","scrollUp","script"].includes(e)||t})(),this.basicClassName=`ab_widget_container_${this.widgetName}`,this.widgetContainerId=`${this.basicClassName}_${this.uniqueId}`,this.contentClassName=`${this.basicClassName}_content`,this.overlayClassName=`${this.basicClassName}_overlay`,this.closeButtonClassName=`${this.basicClassName}_close_button`,this.hideClassName=`ab_hide_${this.uniqueId}`,this.rootElement=null,this.domElement=this.getDom(),this.hasBeenShown=!1,this.closedByUser=!1,this.websiteFocusedElement=null,this.elementsWaiters=[]}clearGivenClearables(){for(const t of this.elementsWaiters)t.clear();this.elementsWaiters=[]}isWidgetApplied(){return this.domElement?.isConnected&&this.domElement.ownerDocument?.defaultView}removeOldDomElement(){const t=this.rootElement?.getElementById(this.widgetContainerId);return t?.remove(),this}async insert(){if(this.isWidgetApplied())return!1;const t=["free"];"drawer"===DATA.layout&&DATA.customTarget&&t.push("drawer");const e=t.includes(DATA.layout);return new Promise(t=>{const{elementReferrer:n="body",referrerInsertType:o="beforeend"}=e?DATA:{},i=b(n,e=>{this.elementsWaiters=this.elementsWaiters.filter(t=>t.selector!==n),this.rootElement=e.getRootNode(),this.removeOldDomElement(),this.domElement.appendChild(this.styleElement),t(e.insertAdjacentElement(o,this.domElement))});this.elementsWaiters.push(i)}).then(()=>this)}remove(){this.trigger&&this.trigger.clear(),this.pageWatcher.clearWatcher(this.rootElement);for(const t of this.elementsWaiters)[DATA.elementReferrer,"body"].includes(t.selector)&&t.clear();return this.domElement?.isConnected&&this.domElement.remove(),this.hasOncePerPageTrigger?this.pageWatcher.watch(this.rootElement):t()||this.init().then(({response:t})=>t?this.show():this),this}show(){const{layout:e,overlay:n=!0}=DATA;return t()||this.hasBeenShown&&this.hasOncePerPageTrigger||window.ABTastyEvent(`${this.prettyName} displayed`,null,TEST_ID),this.closedByUser=!1,this.websiteFocusedElement=document.activeElement,setTimeout(()=>{this.domElement.classList.remove(this.hideClassName),t()||"popin"!==e||!0!==n||this.domElement.querySelector('input[type="text"], textarea, a, button')?.focus()},50),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,this.pageWatcher.watch(this.rootElement),this}hide(e=!0){return!t()&&this.hasBeenShown&&e&&window.ABTastyEvent(`${this.prettyName} closed`,null,TEST_ID),e&&(this.pageWatcher.clearWatcher(this.rootElement),this.closedByUser=!0),this.domElement.classList.add(this.hideClassName),!t()&&this.websiteFocusedElement?.isConnected&&this.websiteFocusedElement.focus(),this}async init(e){const n=t(),o=i(),s=this.trigger?.promises?.length,a=!this.recurrence||this.recurrence.isOver();if(!n&&!o||s||!a)return{container:this,response:!1};this.pageWatcher.watch(this.rootElement||document,this.triggerParams.triggerSelector);const r=n||!this.trigger||this.trigger&&await this.trigger.isTriggered();this.pageWatcher.clearTriggerElementWatcher();const c={container:this,response:r};return r?(await this.insert(),this.addCloseEvent(),n||e||this.hasBeenShown||void 0===this.children||"function"!=typeof this.children.refreshContent||this.children.refreshContent(r),c):c}onPageChange(t,e,n){const o=()=>this.init().then(({response:t})=>{t?this.show():this.hide(!1)});e||(this.hasBeenShown=!1,n&&this.domElement.remove(),this.trigger&&this.trigger.clear());const i={[x]:()=>n?this.remove():this.pageWatcher.watch(this.rootElement),[C]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch(this.rootElement):n||this.insert().then(t=>t.show()).catch(this.pageWatcher.watch):o()},[S]:()=>{this.hasBeenShown?this.pageWatcher.watch():o()}};"function"==typeof i[t]&&i[t]()}addCloseEvent(...e){const{closeButton:n,overlay:o,overlayClickable:i,layout:s,animationDuration:a=1e3}=DATA,r=[];if(void 0!==o&&!0!==o||!0!==i||"popin"!==s||r.push(`.${this.overlayClassName}`),void 0!==n&&n&&r.push(`.${this.closeButtonClassName}`),!r.length)return this;const c=this.domElement.querySelectorAll(r.join(", "));if(!c.length)return this;const l=t=>{const e="click"===t.type,n="keyup"===t.type&&"Escape"===t.code&&t.isTrusted;(e||n)&&(w(t),this.recurrence&&this.recurrence.setClosingRecurrence(),this.hide(!0),setTimeout(()=>this.remove(),1.05*a))},d=["click",l,{once:!0,capture:!0}];e.push(...c);for(const n of e)t()&&(n.dataset.abtastyActionnable="true"),n.removeEventListener(...d),n.addEventListener(...d);return window.removeEventListener("keyup",l,{once:!0}),window.addEventListener("keyup",l,{once:!0}),this}getDom(){const{closeButton:t,layout:e,overlayClickable:n,overlay:o=!0}=DATA,i=document.createElement("div");return i.className=`${this.basicClassName} ${this.hideClassName}`,i.id=this.widgetContainerId,["popin","bannerTop","bannerBottom"].includes(e)&&(i.role="dialog","popin"===e&&!0===o&&(i.ariaModal="true")),i.innerHTML=`\n\t\t\t${"popin"===e&&!0===o?`<div ${n?'aria-label="Close dialog"':""} class="${this.overlayClassName}"></div>`:""}\n\t\t\t<div class="${this.contentClassName}">\n\t\t\t${t?`<button class="${this.closeButtonClassName}" aria-label="Close dialog"><svg viewBox="0 0 16 16">\n\t<defs><path id="prefix__a" d="M12 4.991L11.009 4 8 7.009 4.991 4 4 4.991 7.009 8 4 11.009 4.991 12 8 8.991 11.009 12 12 11.009 8.991 8z"></path></defs>\n\t<g><use xlink:href="#prefix__a"></use></g>\n</svg></button>`:""}\n\t\t\t</div>`,i}loadFont(t,e){if(!t||"inherit"===t||!/otf|ttf/g.test(e))return;const n=document.createElement("style"),o=e.match(_)?e.match(_)[1]:"";n.innerHTML=`@font-face { font-family: '${t}_${o}'; src: url('${e}'); font-display: swap; }`;const i=this.rootElement?.head||document.head;i?.appendChild(n)}getStyleTag(e="",n=DATA){const{noStyles:o,layout:i}=n,{backgroundColor:s,isBackgroundImage:a,backgroundImage:r,backgroundSize:c,backgroundPosition:l,backgroundRepeat:d,borderColor:u,borderRadius:h,borderWidth:m,textColor:y,textAlign:g,fontName:b,fontStyle:p,fontSize:w,isTitle:v,titleTextAlign:f,titleTextColor:T,titleFontName:x,titleFontStyle:C,titleFontSize:S,overlay:A,overlayColor:E,dropShadow:k,dropShadowColor:L,dropShadowBlur:P,containerMargin:I,containerPadding:B,closeButton:D,closeButtonPosition:N,closeButtonSize:R,closeButtonBorderRadius:O,closeButtonBorderWidth:W,closeButtonBorderColor:j,closeButtonColor:V,closeButtonBackgroundColor:M,buttonsAlign:q,buttonsBorderWidth:F,buttonsBorderColor:H,buttonsBorderRadius:z,buttonsBackgroundColor:U,buttonsTextColor:K,buttonsFontName:G,buttonsFontStyle:J,buttonsFontSize:Y,secondLink:Q,secondLinkBorderWidth:X,secondLinkBorderColor:Z,secondLinkBorderRadius:tt,secondLinkBackgroundColor:et,secondLinkTextColor:nt,secondLinkFontName:ot,secondLinkFontStyle:it,secondLinkFontSize:st,animation:at,animationDuration:rt,animationBehaviour:ct,animationSlideDirection:lt}=o?{}:n,dt=document.createElement("style");t()&&dt.setAttribute("abtasty-script-added","true"),this.loadFont(b,p),this.loadFont(x,C),this.loadFont(G,J),this.loadFont(ot,it);const ut=`background: ${["string"==typeof s?s:"rgba(255, 255, 255, 1)",a&&"string"==typeof r&&r.length?`url(${r})`:"",a&&"string"==typeof l&&"100% 100%"!==c?l:"0 0",a&&"string"==typeof c?`/ ${c}`:"/ auto",a&&d&&!["cover","100% 100%"].includes(c)?"repeat":"no-repeat"].join(" ").trim()};`,ht="number"==typeof m&&m>0,mt=`border: ${[ht?`${m}px`:"unset",ht?"solid":"",ht&&"string"==typeof u&&u.length?u:""].join(" ").trim()};`,yt=void 0!==h?`border-radius: ${h}px;`:"",gt=void 0!==y?`color: ${y}; fill: ${y}; -webkit-text-fill-color: ${y};`:"",bt=void 0!==g?`text-align: ${g};`:"",pt=b&&"inherit"!==b?`font-family:${b}_${p.match(_)?p.match(_)[1]:""};`:p||"",wt=w?`font-size: ${w}px;`:"",vt=void 0!==k&&k?`box-shadow: 0 5px ${P}px 0 ${L};`:"",ft=I instanceof Array&&1===I.length&&I[0],Tt=ft?`margin: ${ft.top}px ${ft.right}px ${ft.bottom}px ${ft.left}px;`:"",xt=ft?`margin: calc(${ft.top}px * 0.5) calc(${ft.right}px * 0.5) calc(${ft.bottom}px * 0.5) calc(${ft.left}px * 0.5);`:"",Ct=B instanceof Array&&1===B.length&&B[0],St=Ct?`padding: ${Ct.top}px ${Ct.right}px ${Ct.bottom}px ${Ct.left}px;`:"",At=Ct?`padding: calc(${Ct.top}px * 0.5) calc(${Ct.right}px * 0.5) calc(${Ct.bottom}px * 0.5) calc(${Ct.left}px * 0.5);`:"",Et=void 0!==F&&F?`border-width: ${F}px; border-style: solid;`:"",$t=[H,F].every(t=>void 0!==t)&&F?`border-color: ${H};`:"",kt=void 0!==z?`border-radius: ${z}px;`:"",Lt=void 0!==U?`background-color: ${U};`:"",Pt=void 0!==K?`color: ${K}; fill: ${K}; -webkit-text-fill-color: ${K};`:"",It=G&&"inherit"!==G?`font-family:${G}_${J.match(_)?J.match(_)[1]:""};`:J||"",Bt=Y?`font-size: ${Y}px;`:"",Dt="number"==typeof X?`border-width: ${X}px; border-style: solid;`:"",Nt=[Z,X].every(t=>void 0!==t)&&X?`border-color: ${Z};`:"",_t=void 0!==tt?`border-radius: ${tt}px;`:"",Rt=void 0!==et?`background-color: ${et};`:"",Ot=void 0!==nt?`color: ${nt}; fill: ${nt}; -webkit-text-fill-color: ${nt};`:"",Wt=ot&&"inherit"!==ot?`font-family:${ot}_${it.match(_)?it.match(_)[1]:""};`:it||"",jt=st?`font-size: ${st}px;`:"",Vt="popin"!==i||void 0!==A&&!0!==A?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==E?E:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),Mt="number"==typeof R?R:16,qt=Mt/2,Ft=o||void 0!==D&&D?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===N?`bottom: calc(100% + ${qt}px)`:`top: ${qt}px`)+";",`right: ${qt}px;`,"width: auto;","height: auto;","background: none;","border: none;","cursor: pointer;","padding: 0;","margin: 0;","line-height: 0;","z-index: 9;","number"==typeof O?`border-radius: ${O}px;`:"","number"==typeof W&&W>0?`border: ${W}px solid ${void 0!==j?j:"rgba(57, 57, 57, 1)"};`:"","string"==typeof M?`background-color: ${M};`:"","}",`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} svg {`,"pointer-events: none;",`width: ${Mt}px;`,`height: ${Mt}px;`,"string"==typeof V?`fill: ${V};`:"","}"].join(""):"",Ht=v&&"string"==typeof T?[`#${this.widgetContainerId} .${this.contentClassName} > * h1, `,`#${this.widgetContainerId} .${this.contentClassName} > * h2, `,`#${this.widgetContainerId} .${this.contentClassName} > * h3, `,`#${this.widgetContainerId} .${this.contentClassName} > * h4, `,`#${this.widgetContainerId} .${this.contentClassName} > * h5, `,`#${this.widgetContainerId} .${this.contentClassName} > * h6 {`,`color: ${T}; fill: ${T}; -webkit-text-fill-color: ${T};`,void 0!==f?`text-align: ${f};`:"",x&&"inherit"!==x?`font-family:${x}_${C.match(_)?C.match(_)[1]:""};`:C||"",S?`font-size: ${S}px;`:"","}"].join(""):"";let zt="";if("string"==typeof at){const e=(rt/1e3).toFixed(2),n=["top","bottom"].includes(lt),o=Number(n),i=[(["top","left"].includes(lt)?"-":"")+"100vmax",this.translateValues?this.translateValues[o]:"0"];n&&i.reverse(),zt={none:[`.${this.hideClassName} {`,"opacity: 0 !important;","}"],fade:[`.${this.hideClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} {`,`transition: opacity ${e}s ${ct};`,"}","@media (prefers-reduced-motion: reduce) {",`#${this.widgetContainerId} {`,"transition: unset;","}","}"],slide:[`.${this.hideClassName} .${this.overlayClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} .${this.overlayClassName} {`,`transition: opacity ${e}s ${ct};`,"}",`.${this.hideClassName} .${this.contentClassName} {`,`transform: translate(${i.join(", ")}) !important;`,"}",`#${this.widgetContainerId} .${this.contentClassName} {`,`transition: transform ${e}s ${ct};`,"}","@media (prefers-reduced-motion: reduce) {",`#${this.widgetContainerId} .${this.overlayClassName},`,`.${this.hideClassName} .${this.contentClassName},`,`#${this.widgetContainerId} .${this.contentClassName} {`,"transition: unset;","}","}"]}[t()&&!ABTASTY_S.WIDGETS.animationChanged?"none":at].join("")}const Ut=[`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,`margin-${"fill"===q?"top":"left"}: 8px;`,Dt,Nt,_t,Rt,Ot,Wt,jt,"}",`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,Ot,Wt,jt,"}"];return dt.textContent=[`#${this.widgetContainerId} style { display: none; }`,`.${this.hideClassName} {`,"pointer-events: none;","}",`#${this.widgetContainerId} {`,"opacity: 1;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,ut,yt,mt,gt,bt,vt,Tt,pt,wt,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,gt,bt,pt,wt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",St,pt,wt,"}",`#${this.widgetContainerId} .${this.contentClassName} a {`,"text-decoration: underline;","}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a, `,`#${this.widgetContainerId} .${this.contentClassName} button {`,"text-decoration: none;","box-sizing: border-box;","display: inline-block;",Et,$t,kt,Lt,Pt,It,Bt,"}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a *:not(.second_link span), `,`#${this.widgetContainerId} .${this.contentClassName} button:not([class*="close_button"], [class*="csatEmojiButton"]) * {`,Pt,It,Bt,"}",...Q?Ut:[],"@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,xt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,At,"}","}",Vt,Ft,Ht,zt,`${e}`].join(""),dt}}const W=["top: 0;","top: 50%;","bottom: 0;"],j=["left: 0;","left: 50%;","right: 0;"],V=t=>1===t?"-50%":0,M=()=>{if(Array.isArray(DATA.popinPosition)){const{popinPosition:[{x:t,y:e}]}=DATA,n=`translate(${V(e)}, ${V(t)});`;return`${W[t]}${j[e]}transform: ${n}`}return"left: 50%;top: 50%;transform: translate(-50%, -50%);"},q=()=>"autoWidth"in DATA&&!0===DATA.autoWidth,F=()=>{if(q())return"width: auto; height: auto; min-width: fit-content;";const{popinPercentWidth:t,popinPixelsWidth:e,widthUnit:n,autoHeight:o,popinPercentHeight:i,popinPixelsHeight:s,heightUnit:a}=DATA;return`width: ${"px"===n?e:t}${n};height: ${o?"auto":`${"px"===a?s:i}${a}`};`};class H extends O{constructor(){super(),this.translateValues=Object.values(DATA.popinPosition[0]).map(t=>V(t)),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:t,zindexCustom:e,widthUnit:n}=DATA,o="string"!=typeof DATA.overlay&&DATA.overlay;return[`#${this.widgetContainerId} {`,"position: fixed;","top: 0;","left: 0;","width: 100%;","height: 100%;",`z-index: ${"custom"===t?e:t};`,"background: none;","pointer-events: "+(o?"all":"none"),"}",`#${this.widgetContainerId} .${this.overlayClassName} {`,"position: absolute;","z-index: -1;","top: 0;","left: 0;","width: 100%;","height: 100%;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: absolute;",M(),F(),"pointer-events: all","}",`${q()?"":[`#${this.widgetContainerId} .${this.contentClassName} > div {`,"height: 100%;","overflow: auto;","box-sizing: border-box;","}"].join("")}`,`${!q()&&["px","em"].includes(n)?["@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,"max-width: 94vw;","}","}"].join(""):""}`].join("")}}class z extends O{constructor(){super(),this.position="string"==typeof DATA.layout&&"bannerTop"===DATA.layout?"top":"bottom",this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:t,zindexCustom:e}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;",`${this.position}: 0;`,"left: 0;","width: 100%;","height: auto;",`z-index: ${"custom"===t?e:t};`,"background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}class U extends O{constructor(t,e){super(t,e),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){return[`#${this.widgetContainerId} {`,"width: auto;","height: auto;","margin: 0;","padding: 0;","background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}const K=()=>{const{layout:t}=DATA;let e;switch(t){case"popin":e=new H;break;case"bannerTop":case"bannerBottom":e=new z;break;case"free":e=new U;break;default:e=new O}return e};var G=/.+\/([^.]+)\.(otf|ttf)$/,J=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"popin",n=DATA,o=n.layout,i=n.inlineLayoutContent,s=DATA.image;return t&&s!=="".concat("https://widgets-images.abtasty.com/","widgets-default-image.png")?'<div class="countdown_'.concat(e,'_img_container">\n\t\t\t\t<img src="').concat(s,'" class="abtasty-countdown-image ').concat("popin"===o||"free"===o&&!i?"abtasty-countdown-image-popin-layout":"",'">\n\t\t\t</div>'):""},Y=["day","hour","minute","second"],Q="line";const X=window.ABTASTY_S?.USER?.lang?ABTASTY_S.USER.lang.split("_")[0]:navigator.language.substring(0,2)||"en",Z=["fr","en","de","es","ja"].indexOf(X)>-1?X:"en",tt=DATA.contentChosenLanguage,et="default"===tt?Z:tt,nt=(t,e,n="long")=>{const o={style:"unit",unit:t,unitDisplay:n};return new Intl.NumberFormat(et,o).format(e)};function ot(t){return ot="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},ot(t)}function it(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=st(t))||e){n&&(t=n);var o=0,i=function(){};return{s:i,n:function(){return o>=t.length?{done:!0}:{done:!1,value:t[o++]}},e:function(t){throw t},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return a=t.done,t},e:function(t){r=!0,s=t},f:function(){try{a||null==n.return||n.return()}finally{if(r)throw s}}}}function st(t,e){if(t){if("string"==typeof t)return at(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?at(t,e):void 0}}function at(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);n<e;n++)o[n]=t[n];return o}function rt(t){var e=function(t){if("object"!=ot(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ot(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ot(e)?e:e+""}var ct=function(){return e=function t(e){var n=e.parentContainer;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.parentContainer=n,this.testId=TEST_ID,this.container=this.createContainer(),this.digitElements={},this.textElements={},this.timerElements={},this.timeLoop=null,this.maxWidth=0,this.previewTime=172799,this.fonts=[]},n=[{key:"remove",value:function(){var t=this,e=DATA.animationDuration;setTimeout(function(){return t.parentContainer.remove()},1.05*e)}},{key:"getCountdownClock",value:function(){return this.container.querySelector(".abtasty-countdown-clock")}},{key:"onBlurOrMouseLeave",value:function(t){var e=t.type,n=this.getCountdownClock();n&&(n.ariaLive="off");var o="mouseleave"===e?"mouseenter":"focus";this.container.addEventListener(o,this.onFocusOrMouseEnter.bind(this),{passive:!0,once:!0})}},{key:"onFocusOrMouseEnter",value:function(t){var e=t.type,n=this.getCountdownClock();n&&(n.ariaLive="polite");var o="mouseenter"===e?"mouseleave":"blur";this.container.addEventListener(o,this.onBlurOrMouseLeave.bind(this),{passive:!0,once:!0})}},{key:"addAriaEvents",value:function(t){for(var e=0,n=["mouseenter","focus"];e<n.length;e++){var o=n[e];t.addEventListener(o,this.onFocusOrMouseEnter.bind(this),{passive:!0,once:!0})}}},{key:"addCloseEvent",value:function(e){var n=this;e&&e.addEventListener("click",function(e){w(e),t()||n.parentContainer.recurrence.setClosingRecurrence(),n.parentContainer.hide(),n.remove()},{capture:!0,passive:!1})}},{key:"addRedirectionEvent",value:function(e){var n=this;!t()&&e&&e.addEventListener("click",function(){var t=DATA,e=t.autoHide,o=t.timeHide;e&&setTimeout(function(){n.parentContainer.hide(),n.remove()},1e3*o),n.parentContainer.recurrence.setValidationRecurrence()},{useCapture:!0,once:!0})}},{key:"createContainer",value:function(){var t=DATA,e=t.linkType,n=t.redirectionUrl,o=t.openInNewTab,i=document.createElement(e&&e.includes("widget")?"a":"div");switch(i.classList.add("abtasty-countdown"),e){case"widget":i.href=n,i.target=o?"_blank":"_self",this.addRedirectionEvent(i);break;case"widgetClose":i.href="#",i.dataset.abtastyActionnable="true",this.addCloseEvent(i)}return this.addAriaEvents(i),i}},{key:"insert",value:function(t,e){return t.insertAdjacentElement(e,this.container),this}},{key:"setText",value:function(t){var e,n,o=DATA,i=o.layoutType,s=o.displayElapsedElements,a=o.layout,r=o.endSettings,c={day:DATA.customDaysLabel,hour:DATA.customHoursLabel,minute:DATA.customMinutesLabel,second:DATA.customSecondsLabel},l=DATA.timeUnitLengthFormat,d=it(Y);try{for(d.s();!(e=d.n()).done;){var u=e.value,h=this.timerElements[u],m=String(t[u]).padStart(2,"0"),y=nt(u,m,l).match(/([\d,.]+)\s*(.+)/),g=y?y[1]:m,b=y?y[2]:u;if(DATA.customTexts&&u in c&&(b=c[u]),s||(h.dataset.timeEnd=0===t[u]?"true":"false"),"textDigits"===i)h.textContent="".concat(g," ").concat(b);else{var p=this.digitElements[u],w=this.textElements[u];p.textContent=g.toString().padStart(2,"0"),w.textContent=b,this.maxWidth<p.offsetWidth&&(this.maxWidth=p.offsetWidth,p.style.minWidth="".concat(this.maxWidth,"px")),p.style.minWidth="".concat(this.maxWidth,"px")}}}catch(t){d.e(t)}finally{d.f()}[null,"",r].includes(this.parentContainer.domElement.ariaLabel)&&["popin","bannerTop","bannerBottom"].includes(a)&&(this.parentContainer.domElement.ariaLabel=(n=this.parentContainer.domElement.querySelectorAll(".abtasty-countdown-clock, .abtasty-countdown-top-message"),function(t){if(Array.isArray(t))return at(t)}(n)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(n)||st(n)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map(function(t){return t.textContent.replace(/\s+/g," ")},"").join("").trim())}},{key:"onTimeEnd",value:function(){var t,e=DATA,n=e.endSettings,o=e.layout;clearInterval(this.timeLoop);var i=this.getCountdownClock();if(i&&(i.ariaLive="off"),"hideWidget"===n)return this.parentContainer.hide(),void(this.parentContainer.domElement.style.display="none");var s,a=it(this.container.querySelectorAll(".abtasty-countdown-elm-time"));try{for(a.s();!(s=a.n()).done;)s.value.removeAttribute("data-time-end")}catch(t){a.e(t)}finally{a.f()}["popin","bannerTop","bannerBottom"].includes(o)&&(this.parentContainer.domElement.ariaLabel=DATA.endMessage);for(var r={endText:!0,endCountdown:["showText","showTextAndButton"].includes(n),endButton:["hideCountdownAndShowTextAndButton","showTextAndButton"].includes(n)},c=["abtasty-countdown-".concat(n),"abtasty-countdown-finish"],l=0,d=Object.keys(r);l<d.length;l++){var u=d[l],h="abtasty-countdown-".concat(u),m=r[u]?"show":"hide";c.push("".concat(h,"-").concat(m))}(t=this.container.classList).add.apply(t,c)}},{key:"setCountdown",value:function(){var e=new Date,n=function(e,n){switch(e.type){case"global":return e.timestamp-n.getTime();case"local":if(t())return e.previewTimestamp-n.getTime();var o=e.timecomponents,i=o.year,s=o.month,a=o.day,r=o.hour,c=o.minute;return new Date(i,s-1,a,r,c).getTime()-n.getTime();default:return 0}}(DATA.dateTime,e)/1e3;if(top.ABTastyEditor&&("ifEnded"===DATA.previewBlock&&(n=-1),this.previewTime-=1),n<=0)return this.setText({day:0,hour:0,minute:0,second:0}),void this.onTimeEnd();var o=Math.floor(n/86400);n-=86400*o;var i=Math.floor(n/3600);n-=3600*i;var s=Math.floor(n/60);n-=60*s;var a=Math.floor(n);this.setText({day:o,hour:i,minute:s,second:a})}},{key:"setButton",value:function(){var t=this,e=function(e,n,o,i){var s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=document.createElement("a");return a.ariaLabel=e,s&&(a.className="second_link"),a.innerHTML="<span>".concat(e,"</span>"),a.href="button"===n?o:"#","button"===n?(a.target=i?"_blank":"_self",t.addRedirectionEvent(a)):(a.dataset.abtastyActionnable="true",t.addCloseEvent(a)),a},n=DATA,o=n.linkType,i=n.buttonText,s=n.redirectionUrl,a=n.openInNewTab,r=n.secondLink,c=n.secondLinkText,l=n.secondLinkType,d=n.secondLinkURL,u=n.secondLinkOpenInNewTab,h=n.endBtnTargetBlank,m=n.endBtnLabel,y=n.endBtnLink,g=this.container.querySelector(".abtasty-countdown-bottom-button"),b=[];if(o&&o.includes("button")){var p=e(i,o,s,a);if(b.push(p),r){var w=e(c,l,d,u,r);b.push(w)}}for(var v=0,f=b;v<f.length;v++){var T=f[v];g.appendChild(T)}var x=this.container.querySelector(".abtasty-countdown-finish-button"),C=document.createElement("a");C.href=y,C.target=h?"_blank":"_self",C.innerHTML=m,C.ariaLabel=m,x.appendChild(C)}},{key:"setContent",value:function(){var t=this.container.querySelector(".abtasty-countdown-finish-text"),e=document.createElement("div");if(e.innerHTML=DATA.endMessage,t.appendChild(e),"textDigits"!==DATA.layoutType){var n=this.container.querySelector(".abtasty-countdown-top-message"),o=document.createElement("p");o.innerHTML=DATA.message,n.appendChild(o)}}},{key:"init",value:function(){var t=this,e=DATA,n=e.layout,o=e.inlineLayoutContent,i=e.hideResponsiveImage,s=e.hideResponsiveText;try{var a=["free","popin"].includes(n);!function(e){if(t.container.classList.add("abtasty-countdown-layout-".concat(e)),a||(i&&t.container.classList.add("abtasty-countdown-hide-responsive-image"),s&&t.container.classList.add("abtasty-countdown-hide-responsive-text")),e===Q){a&&(t.parentContainer.domElement.querySelector(".".concat(t.parentContainer.contentClassName)).classList.add("abtasty-countdown-content-".concat(n,"-inline")),t.container.classList.add("abtasty-countdown-layout-".concat(n,"-inline")));var o,r=it(t.parentContainer.domElement.querySelectorAll(".".concat(t.parentContainer.closeButtonClassName)));try{for(r.s();!(o=r.n()).done;)o.value.classList.add("abtasty-countdown-close-inline")}catch(t){r.e(t)}finally{r.f()}}}(a&&!o?"free":Q),this.container.innerHTML=function(){var t=DATA,e=t.layout,n=t.inlineLayoutContent,o=t.imagePosition,i=t.layoutType,s="popin"===e||"free"===e&&!n,a="\n ".concat(J(s&&!("popin"===e&&n),"popin"),'\n <div class="abtasty-countdown-layout-').concat(e,' abtasty-countdown-mini">\n ').concat(J(!s&&"before"===o,"banner"),'\n <div class="abtasty-countdown-top-message">\n ').concat(DATA.messageMinimalistMode.split(/!countdown!/gm).map(function(t){return"<p>".concat(t.trim(),"</p>")}).join('\n <span class="abtasty-countdown-days abtasty-countdown-elm-time"></span>\n <span class="abtasty-countdown-hours abtasty-countdown-elm-time"></span>\n <span class="abtasty-countdown-minutes abtasty-countdown-elm-time"></span>\n <span class="abtasty-countdown-seconds abtasty-countdown-elm-time"></span>\n').replace("<p></p>",""),"\n </div>\n ").concat(J(!s&&"after"===o,"banner"),'\n <div class="abtasty-countdown-finish-text"></div>\n <div class="abtasty-countdown-finish-button"></div>\n <div class="abtasty-countdown-bottom-button buttons_container"></div>\n </div>\n '),r="\n ".concat(J(s&&!("popin"===e&&n),"popin"),'\n <div class="abtasty-countdown-layout-').concat(e,' abtasty-countdown-standard">\n ').concat(J(!s&&"before"===o,"banner"),'\n <div class="abtasty-countdown-clock" role="timer" aria-live="off">\n <div class="abtasty-countdown-days abtasty-countdown-elm-time">\n <div class="abtasty-countdown-days__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-days__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-hours abtasty-countdown-elm-time">\n <div class="abtasty-countdown-hours__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-hours__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-minutes abtasty-countdown-elm-time">\n <div class="abtasty-countdown-minutes__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-minutes__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-seconds abtasty-countdown-elm-time">\n <div class="abtasty-countdown-seconds__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-seconds__text abtasty-countdown-elm-text"></div>\n </div>\n </div>\n ').concat(J(!s&&"after"===o,"banner"),'\n <div class="abtasty-countdown-top-message"></div>\n <div class="abtasty-countdown-finish-text"></div>\n <div class="abtasty-countdown-finish-button"></div>\n <div class="abtasty-countdown-bottom-button buttons_container"></div>\n </div>\n ');return"textDigits"===i?a:r}(),this.container.insertAdjacentElement("afterbegin",(t=>{const e=document.createElement("style");return e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),e})("".concat("@media (min-width:741px){.abtasty-countdown-layout-line .abtasty-countdown-elm-time{margin:0}}@media (max-width:740px){.abtasty-countdown-layout-line>div:not(.abtasty-countdown-layout-popin){-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.abtasty-countdown-layout-line div.abtasty-countdown-finish-text,.abtasty-countdown-layout-line div.abtasty-countdown-top-message{margin-bottom:20px}.abtasty-countdown-layout-line div.abtasty-countdown-bottom-button a{margin-left:0}}@media (max-width:579px){.ab_widget_container_countdown_content{max-width:100%;width:100vw}.abtasty-countdown-layout-free,.abtasty-countdown-layout-popin{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important;margin:10px 0!important}.abtasty-countdown-hide-responsive-image .countdown_banner_img_container,.abtasty-countdown-hide-responsive-text .abtasty-countdown-top-message{display:none}}.abtasty-countdown,.abtasty-countdown>div{display:inline-block;text-align:center}.abtasty-countdown>div{margin:10px;overflow:auto;white-space:normal;width:100%}.abtasty-countdown .countdown_popin_img_container{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;max-width:100%}.abtasty-countdown .countdown_popin_img_container:empty{display:none}.abtasty-countdown .abtasty-countdown-finish-text,.abtasty-countdown .abtasty-countdown-top-message{margin-bottom:15px}.abtasty-countdown .abtasty-countdown-elm-time{display:inline-block;margin:6px 6px 15px;padding:6px}.abtasty-countdown .abtasty-countdown-elm-number,.abtasty-countdown .abtasty-countdown-elm-text{font-stretch:normal;font-style:normal;font-weight:700;letter-spacing:normal;line-height:normal;text-align:center}.abtasty-countdown .abtasty-countdown-bottom-button a,.abtasty-countdown .abtasty-countdown-finish-button a{cursor:pointer;display:block;display:inline-block;padding:6px 10px;text-align:center;text-decoration:none}.abtasty-countdown-layout-line>div{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:stretch;-ms-flex-pack:stretch;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:stretch}.abtasty-countdown-layout-line>div>div{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.abtasty-countdown-layout-free{display:block;text-align:center}.abtasty-countdown-layout-line>div{margin:0}.abtasty-countdown-layout-line .abtasty-countdown-finish-text,.abtasty-countdown-layout-line .abtasty-countdown-top-message{-webkit-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding:0 5px 0 15px}.abtasty-countdown-layout-line .abtasty-countdown-top-message p{margin-bottom:0}.abtasty-countdown-layout-line .abtasty-countdown-bottom-button a{margin-left:30px}.abtasty-countdown-layout-line{-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-countdown-layout-line .abtasty-countdown-bottom-button,.abtasty-countdown-layout-line .abtasty-countdown-clock,.abtasty-countdown-layout-line .abtasty-countdown-finish-button{-ms-flex-negative:0;flex-shrink:0}.abtasty-countdown-finish-button,.abtasty-countdown-finish-text{display:none}.abtasty-countdown-endButton-show .abtasty-countdown-finish-button,.abtasty-countdown-endCountdown-show.abtasty-countdown-clock,.abtasty-countdown-endText-show .abtasty-countdown-finish-text{display:block}.abtasty-countdown-layout-line.abtasty-countdown-endButton-show .abtasty-countdown-finish-button,.abtasty-countdown-layout-line.abtasty-countdown-endCountdown-show .abtasty-countdown-clock,.abtasty-countdown-layout-line.abtasty-countdown-endText-show .abtasty-countdown-finish-text{display:table-cell}.abtasty-countdown-endButton-hide .abtasty-countdown-finish-button,.abtasty-countdown-endCountdown-hide .abtasty-countdown-clock,.abtasty-countdown-endText-hide .abtasty-countdown-finish-text,.abtasty-countdown-finish .abtasty-countdown-bottom-button,.abtasty-countdown-finish .abtasty-countdown-top-message{display:none!important}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:55%!important}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-button,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-button{width:45%!important}.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:30%!important}.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom .abtasty-countdown-clock,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-button,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-button{width:35%!important}.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:65%}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop,.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop{width:100%}.abtasty-countdown-standard .abtasty-countdown-clock>.abtasty-countdown-elm-time[data-time-end=true]+.abtasty-countdown-elm-time[data-time-end=true],.abtasty-countdown-standard .abtasty-countdown-clock>.abtasty-countdown-elm-time[data-time-end=true]:first-child{display:none}.abtasty-countdown-content-popin-inline,.abtasty-countdown-content-popin-inline .abtasty-countdown-layout-popin{max-width:inherit;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content}.abtasty-countdown-content-free-inline{max-width:100%}.abtasty-countdown-image-popin-layout{margin-bottom:20px}.abtasty-countdown-layout-popin{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.countdown_banner_img_container{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;padding:0 15px}.countdown_banner_img_container img{max-height:67px;max-width:200px}.abtasty-countdown .abtasty-countdown-mini .abtasty-countdown-elm-time{border:none;margin:0;padding:0}.abtasty-countdown .abtasty-countdown-mini .abtasty-countdown-top-message{display:inline-block;white-space:unset;width:100%}.abtasty-countdown .abtasty-countdown-mini .abtasty-countdown-top-message>*{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.abtasty-countdown-mini .abtasty-countdown-top-message>.abtasty-countdown-elm-time[data-time-end=true]+.abtasty-countdown-elm-time[data-time-end=true],:not(.abtasty-countdown-showTextAndButton) :not(.abtasty-countdown-showText) .abtasty-countdown-mini .abtasty-countdown-top-message>.abtasty-countdown-elm-time[data-time-end=true]:first-child{display:none}"," ").concat(function(t){for(var e=0,n=[{fontName:DATA.messageFontName,fontStyle:DATA.messageFontStyle},{fontName:DATA.numbersfontName,fontStyle:DATA.numbersfontStyle},{fontName:DATA.legendfontName,fontStyle:DATA.legendfontStyle}];e<n.length;e++){var o=n[e];t(o.fontName,o.fontStyle)}var i=DATA,s=i.buttonsAlign,a=i.messageAlign,r=i.textColor,c=i.messageFontSize,l=i.messageFontName,d=i.messageFontStyle,u=i.numbersfontSize,h=i.numberstextColor,m=i.numbersfontName,y=i.numbersfontStyle,g=i.legendfontName,b=i.legendfontStyle,p=i.legendfontSize,w=i.legendtextColor,v=i.countdownBorderRadius,f=i.countdownBorderWidth,T=i.countdownBorderColor,x=i.numbersBackgroundColor,C=void 0!==s&&"fill"!==s?"text-align: ".concat(s,";"):"",S=function(t,e){return t&&"inherit"!==t?"font-family:".concat(t,"_").concat(e.match(G)?e.match(G)[1]:"",";"):e||""},A=S(l,d),E=S(m,y),k=S(g,b);return"\n .abtasty-countdown-bottom-button,\n .abtasty-countdown-finish-button {\n ".concat(C,";\n }\n .abtasty-countdown-bottom-button a,\n .abtasty-countdown-finish-button a {\n width: ").concat("fill"===s?"100%":"auto",";\n }\n\n .abtasty-countdown .abtasty-countdown-finish-text,\n .abtasty-countdown .abtasty-countdown-top-message,\n .abtasty-countdown .abtasty-countdown-finish-text *,\n .abtasty-countdown .abtasty-countdown-top-message * {\n white-space: pre-line;\n text-align: ").concat(a," !important;\n color: ").concat(r,";\n font-size: ").concat(c,"px;\n ").concat(A,";\n }\n\n .abtasty-countdown .abtasty-countdown-elm-number,\n .abtasty-countdown .abtasty-countdown-elm-number * {\n font-size: ").concat(u,"px;\n color: ").concat(h,";\n fill: ").concat(h,";\n -webkit-text-fill-color: ").concat(h,";\n font-weight: initial;\n ").concat(E,";\n }\n\n .abtasty-countdown .abtasty-countdown-elm-text,\n .abtasty-countdown .abtasty-countdown-elm-text * {\n ").concat(k,";\n font-size: ").concat(p,"px;\n color: ").concat(w,";\n -webkit-text-fill-color: ").concat(w,";\n }\n\n .abtasty-countdown > div:not(.abtasty-countdown-mini) .abtasty-countdown-elm-time {\n border-radius: ").concat(v,"px;\n border: ").concat(f,"px solid ").concat(T,";\n background-color: ").concat(x,";\n }\n\n .abtasty-countdown > .abtasty-countdown-mini .abtasty-countdown-elm-time {\n font-size: ").concat(u,"px;\n color: ").concat(h,";\n fill: ").concat(h,";\n -webkit-text-fill-color: ").concat(h,";\n font-weight: initial;\n ").concat(E,";\n }")}(this.parentContainer.loadFont.bind(this.parentContainer)))));var r,c=it(Y);try{for(c.s();!(r=c.n()).done;){var l=r.value,d=this.container.querySelector(".abtasty-countdown-".concat(l,"s"));this.timerElements[l]=d,this.digitElements[l]=d.querySelector(".abtasty-countdown-elm-number"),this.textElements[l]=d.querySelector(".abtasty-countdown-elm-text")}}catch(t){c.e(t)}finally{c.f()}this.setContent(),this.setButton(),this.timeLoop=setInterval(this.setCountdown.bind(this),1e3),this.setCountdown()}catch(t){console.warn("Countdown error occurred during widget rendering:",t)}}}],n&&function(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,rt(o.key),o)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,n}();function lt(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */var t,e,n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.toStringTag||"@@toStringTag";function s(n,o,i,s){var c=o&&o.prototype instanceof r?o:r,l=Object.create(c.prototype);return dt(l,"_invoke",function(n,o,i){var s,r,c,l=0,d=i||[],u=!1,h={p:0,n:0,v:t,a:m,f:m.bind(t,4),d:function(e,n){return s=e,r=0,c=t,h.n=n,a}};function m(n,o){for(r=n,c=o,e=0;!u&&l&&!i&&e<d.length;e++){var i,s=d[e],m=h.p,y=s[2];n>3?(i=y===o)&&(c=s[(r=s[4])?5:(r=3,3)],s[4]=s[5]=t):s[0]<=m&&((i=n<2&&m<s[1])?(r=0,h.v=o,h.n=s[1]):m<y&&(i=n<3||s[0]>o||o>y)&&(s[4]=n,s[5]=o,h.n=y,r=0))}if(i||n>1)return a;throw u=!0,o}return function(i,d,y){if(l>1)throw TypeError("Generator is already running");for(u&&1===d&&m(d,y),r=d,c=y;(e=r<2?t:c)||!u;){s||(r?r<3?(r>1&&(h.n=-1),m(r,c)):h.n=c:h.v=c);try{if(l=2,s){if(r||(i="next"),e=s[i]){if(!(e=e.call(s,c)))throw TypeError("iterator result is not an object");if(!e.done)return e;c=e.value,r<2&&(r=0)}else 1===r&&(e=s.return)&&e.call(s),r<2&&(c=TypeError("The iterator does not provide a '"+i+"' method"),r=1);s=t}else if((e=(u=h.n<0)?c:n.call(o,h))!==a)break}catch(e){s=t,r=1,c=e}finally{l=1}}return{value:e,done:u}}}(n,i,s),!0),l}var a={};function r(){}function c(){}function l(){}e=Object.getPrototypeOf;var d=[][o]?e(e([][o]())):(dt(e={},o,function(){return this}),e),u=l.prototype=r.prototype=Object.create(d);function h(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,dt(t,i,"GeneratorFunction")),t.prototype=Object.create(u),t}return c.prototype=l,dt(u,"constructor",l),dt(l,"constructor",c),c.displayName="GeneratorFunction",dt(l,i,"GeneratorFunction"),dt(u),dt(u,i,"Generator"),dt(u,o,function(){return this}),dt(u,"toString",function(){return"[object Generator]"}),(lt=function(){return{w:s,m:h}})()}function dt(t,e,n,o){var i=Object.defineProperty;try{i({},"",{})}catch(t){i=0}dt=function(t,e,n,o){function s(e,n){dt(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:(s("next",0),s("throw",1),s("return",2))},dt(t,e,n,o)}function ut(t,e,n,o,i,s,a){try{var r=t[s](a),c=r.value}catch(t){return void n(t)}r.done?e(c):Promise.resolve(c).then(o,i)}function ht(){var t;return t=lt().m(function t(){var e,n,o,i,s;return lt().w(function(t){for(;;)switch(t.n){case 0:return l("Widget launch"),e=K(),t.n=1,e.init(!0);case 1:return n=t.v,o=n.response,i=e.domElement.querySelector(".".concat(e.contentClassName)),(s=new ct({parentContainer:e})).init(),s.insert(i,"beforeend"),o&&e.show(),t.a(2,s)}},t)}),ht=function(){var e=this,n=arguments;return new Promise(function(o,i){var s=t.apply(e,n);function a(t){ut(s,o,i,a,r,"next",t)}function r(t){ut(s,o,i,a,r,"throw",t)}a(void 0)})},ht.apply(this,arguments)}!function(){ht.apply(this,arguments)}()}();
|
1
|
+
!function(){"use strict";const t=()=>Object.prototype.hasOwnProperty.call(top,"ABTastyEditor"),e=()=>{const t=!!document.getElementById("ABTastyPreviewBar"),e=location.href.includes("ab_project=preview");return t||e},n=t=>new Function(`try {\n\t\t${t}\n\t} catch (error) {\n\t\treturn null;\n\t}`)(),o=()=>encodeURIComponent(DATA.spNoTrim?window.location.href.replace(window.location.origin,""):`${window.location.pathname}`),s=()=>!t()&&(e()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),i=()=>window.ABTasty&&!0===window.ABTasty.consentReady,a=()=>{const{type:t}=DATA;return`${PACKAGE.replace("@abtasty/","")}${t?`_${t}`:""}`},r=()=>{const t=a();return`${t.charAt(0).toUpperCase()}${t.slice(1)}`.split("-").join(" ")},c=()=>`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,l=n=>{const o=(()=>{if(t()||e())return!1;const n=ABTasty.getTestsOnPage()[TEST_ID];return!!n&&Object.keys(n.targetings.qaParameters).length>0})(),s=window.document.cookie.includes("abTastyDebug=")||!0===window.abTastyDebug;if(o||s){const t=r();window.console.log(`%c${t} - ${o?"QA":"Debug"} Mode for campaign ${TEST_ID} %c ${n}`,"background-color: #D6FF01; color: #3100be; padding: 3px 0 3px 10px; border-radius: 5px 0 0 5px; font-weight: bold;","background-color: #3100be; color: white; padding: 3px 10px 3px 0; border-radius: 0 5px 5px 0;")}},d=t=>{const e={promise:null,resolve:null,reject:null,name:t};return e.promise=new Promise((t,n)=>{e.resolve=t,e.reject=n}),e},u=(t,e)=>{const n=e?[]:null;if("string"!=typeof t||!t.trim().length)return n;const[o,s,i]=t.split("[]").map(t=>t.trim()),a=Boolean(i)?i:t,r=s?document.querySelector(o)?.[s]:document;return r?e?[...r.querySelectorAll(a)]:r.querySelector(a):n},h=t=>u(t,!1),m=t=>u(t,!0),g=(t,e)=>{const n={childList:!0,subtree:!0,attributes:!0},o=()=>s.disconnect(),s=new MutationObserver(()=>{const n=h(e);return n&&!o()&&t(n)});return{clear:o,observe:t=>{const e=document.querySelector("body")||document.documentElement,o=t??e;s.observe(o,n)}}},b=()=>{},p=(e,n)=>{const o=h(e),s={selector:e,clear:b,observe:b};if(o)return setTimeout(()=>n(o),0),s;if(t())return setTimeout(()=>p(e,n),1e3),s;if(e.includes("[]"))return((t,e)=>{const[n,o]=e.split("[]").map(t=>t.trim()),s=h(n),i=s?.[o],{clear:a,observe:r}=g(t,e),c=()=>{const n=h(e);return n&&!l()&&t(n)},l=()=>{a(),s?.removeEventListener("load",c)},d=()=>{r(i),"iframe"===s?.localName&&s.addEventListener("load",c)};return d(),{selector:e,clear:l,observe:d}})(n,e);const{clear:i,observe:a}=g(n,e);return a(),{selector:e,clear:i,observe:a}};function y(t,e){const n=t.parentElement||t.getRootNode().host;return e(t)||!n?t:y(n,e)}const w=e=>{t()||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())},v=(t,e)=>[...m(e)].some(n=>{const[o,,s]=e.split("[]"),i=s??o;return n===t||!!t.closest(i)});let f=!1;class T{constructor(){this.targets=[],this.existingTargets=[],this.inViewportTargets=[],this.visibilityObserver=null,this.mutationObserver=null,this.mouseOverEvent=null,this.scrollEvent=null,this.onTransitionEnd=null,this.onIframeLoad=null}transitionOverHandler(t){const e=[t,"transitionend",this.checkElements.bind(this),!0];return this.getEvents(...e)}intersectionHandler(t){t.forEach(t=>{t.isIntersecting?(this.existingTargets.forEach(e=>{e.element.isSameNode(t.target)&&(this.inViewportTargets.push(e),this.mouseOverEvent.start(),this.scrollEvent.start(),this.onTransitionEnd.start())}),this.checkElements()):this.inViewportTargets=this.inViewportTargets.filter(e=>!e.element.isSameNode(t.target)||(this.mouseOverEvent.clear(),this.scrollEvent.clear(),this.onTransitionEnd.clear(),!1))})}startVisibilityObserver(t){const e={root:t,rootMargin:"0px",threshold:.01};return this.visibilityObserver??=new IntersectionObserver(this.intersectionHandler.bind(this),e),this.visibilityObserver}startMutationObserver(t){return this.mutationObserver??=new MutationObserver(this.checkElements.bind(this)),this.mutationObserver.observe(t,{attributes:!0,childList:!0,subtree:!0}),this.mutationObserver}onMouseOver({target:t,path:e}){const n=this.inViewportTargets.find(({element:n,selector:o})=>{if(n.isSameNode(t))return!0;const[s,,i]=o.split("[]"),a=i??s,r=[...t.querySelectorAll(a)];if(r.length&&r.includes(n))return!0;if(e.includes(n))return!0;if(!t.parentElement?.children?.length)return;const c=[...t.parentElement.children],l=c.findIndex(e=>e.isSameNode(t)),d=c.filter((t,e)=>e>l);if(d.length){if(d.includes(n))return!0;if(d.some(t=>[...t.querySelectorAll(a)].includes(n)))return!0}return!1});if(n&&this.isElementVisible(n.element)){const{selector:t,element:e,uniqueId:o}=n,s=this.targets.find(e=>e.selector===t&&e.uniqueId===o);s&&s.resolve(e),this.clear(t,o)}}getEvents(t,...e){return{start:()=>t?.addEventListener(...e),clear:()=>t?.removeEventListener(...e)}}mouseOverHandler(t){const e=[t,"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0?"touchmove":"mouseover",t=>{const e=t.composedPath(),{target:n}=t;setTimeout(()=>this.onMouseOver({target:n,path:e}),50)},!0];return this.getEvents(...e)}scrollEventHandler(t){const e=[t,"scroll",(n=this.checkElements.bind(this),()=>{f||(f=!0,setTimeout(()=>{n(),f=!1},100))}),{passive:!0}];var n;return this.getEvents(...e)}isElementVisible(t){return this.isElementOpaque(t)&&this.isElementTopmost(t)}isElementOpaque(t){return"HTML"===y(t,t=>"0"===window.getComputedStyle(t).opacity).nodeName}isElementTopmost(t){const e=t.getBoundingClientRect(),n=[[e.left,e.top],[e.right,e.top],[e.left,e.bottom],[e.right,e.bottom],[e.left+e.width/2,e.top],[e.left+e.width/2,e.bottom],[e.left,e.height/2],[e.right,e.height/2],[e.left+e.left/2,e.height/2]];let o=!1,s=0;for(;!o&&s<n.length;){const e=t.getRootNode()?.elementFromPoint(...n[s]);o=t===e||e?.contains(t)||t.contains(e),s+=1}return o}checkElements(){this.targets.forEach(({selector:t,uniqueId:e})=>{const n=h(t),[o,,s]=t.split("[]"),i=s??o;n&&!this.existingTargets.find(t=>t.element.matches(i)&&t.uniqueId===e)&&(this.existingTargets.push({element:n,selector:t,uniqueId:e}),this.visibilityObserver.observe(n))}),this.existingTargets=this.existingTargets.filter(({selector:t,element:e})=>!(!h(t)||!e.isConnected)||(e&&this.visibilityObserver.unobserve(e),!1)),this.inViewportTargets=this.inViewportTargets.filter(({selector:t,element:e,uniqueId:n})=>{const[o,,s]=t.split("[]"),i=s??o;if(e.matches(i)&&this.isElementVisible(e)){const o=this.targets.find(e=>e.selector===t&&e.uniqueId===n);return o&&o.resolve(e),this.clear(t,n),!1}return!0})}onLoadIframe(t){const e=[t.defaultView.frameElement,"load",()=>this.watch(selector,resolve,uniqueId).bind(this),{passive:!0}];return this.getEvents(...e)}watch(t,e,n){this.targets.push({selector:t,resolve:e,uniqueId:n});const{clear:o}=p(t,t=>{o();const e=t.getRootNode({composed:!0}),n="body"in e?e.body:document;this.mouseOverEvent=this.mouseOverHandler(e),this.scrollEvent=this.scrollEventHandler(e),this.onTransitionEnd=this.transitionOverHandler(e),e.defaultView?.frameElement&&(this.onIframeLoad=this.onLoadIframe(e),this.onIframeLoad.start()),this.startVisibilityObserver(e),this.startMutationObserver(n),this.checkElements()})}clear(t,e){[this.targets,this.existingTargets,this.inViewportTargets]=[this.targets,this.existingTargets,this.inViewportTargets].map(n=>n.filter(({selector:n,uniqueId:o})=>n!==t&&o!==e));const n=h(t);n&&this.visibilityObserver?.unobserve(n),0===this.targets.length&&(this.mutationObserver?.disconnect(),this.onIframeLoad?.clear()),0===this.inViewportTargets.length&&(this.mouseOverEvent?.clear(),this.scrollEvent?.clear(),this.onTransitionEnd?.clear())}}const x="remove",C="rebuild",A="update",E="ABTastyData";class S{constructor({triggerEvent:t,triggerSelector:e,triggerDelay:n,triggerTarget:o}){this.event=t,this.selector=Boolean(e)?e:"body",this.target="string"==typeof o?h(e):o,this.delay=1e3*n,this.triggerElements=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.promises=[],this.visibilityObservers=[],this.socialProofStore={},this.elementWaiters=[]}async onElementVisible({promise:t,resolve:e}){const n=d(`${this.event}DomReady`);this.promises.push(n);const{clear:o}=p(this.selector,()=>{const t=new T;this.visibilityObservers.push(t),t.watch(this.selector,e,c())});return this.elementWaiters.push(o),t}onPageLoad({promise:t,resolve:e}){const n=()=>"complete"===document.readyState;if(!n()){const o=["readystatechange",()=>n()&&e(!0),{passive:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}return e(!0),t}onClick({promise:t,resolve:e}){const n=({isTrusted:t,target:n})=>{if(t)return(n.isEqualNode(this.target)||v(n,this.selector))&&e(!0)},{clear:o}=p(this.selector,t=>{o();const e=document.createElement("style");e.id=`Click_${c()}`;const[s,,i]=this.selector.split("[]"),a=i??s;e.innerHTML=`${a} {\n\t\t\t\tcursor: pointer !important;\n\t\t\t\tpointer-events: all !important;\n\t\t\t}`;const r=t.getRootNode();("head"in r?r.head:r).appendChild(e),this.triggerElements.push(e);const l=["click",n,{passive:!0,capture:!0}];this.eventsListeners.push([r,...l]),r.addEventListener(...l)});return this.elementWaiters.push(o),t}onHover({promise:t,resolve:e}){const n=({isTrusted:t,target:n})=>{if(t)return(this.target?n.isEqualNode(this.target):v(n,this.selector))&&e(!0)},{clear:o}=p(this.selector,t=>{const e=t.getRootNode(),o="body"in e?e.body:[...e.childNodes].find(e=>e.contains(t)),s=["mouseenter",n,{passive:!0,capture:!0}];this.eventsListeners.push([o,...s]),o.addEventListener(...s)});return this.elementWaiters.push(o),t}onExitIntent({promise:t,resolve:e}){const n=["mouseleave",({isTrusted:t,clientY:n})=>{t&&n<=0&&e(!0)},{passive:!0}],{clear:o}=p("html",t=>{o(),this.eventsListeners.push([t,...n]),t.addEventListener(...n)});return t}onReengage({promise:t,resolve:e}){const n=this.delay;let o=n;const s=[...document.querySelectorAll("*:empty")].map(t=>t.contentDocument||t.shadowRoot).filter(t=>t),i=[({isTrusted:t})=>{t&&(o=n)},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(t=>{[document,...s].forEach(e=>{this.eventsListeners.push([e,t,...i]),e.addEventListener(t,...i)})});const a=setInterval(()=>{o<=0?e(!0):o-=100},100);return this.intervals.push(a),t}onCustomTrigger({promise:t,resolve:e}){const{triggerEventCustomScript:n}=DATA,o="undefined"!=typeof DATA_JS&&DATA_JS?.triggerEventCustomScript,s="function"==typeof o?()=>new Promise(t=>o(t)):new Function(`return new Promise(async resolve => {${n}})`);return s().then(t=>t&&e(!0)),t}onScrollUp({promise:t,resolve:e}){let n=0;const o=["scroll",({isTrusted:t})=>{t&&(window.scrollY<n?e(!0):n=window.scrollY)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}onScrollPercentReached({promise:t,resolve:e}){const{triggerEventScrollPercent:n}=DATA,o=["scroll",({isTrusted:t})=>{if(!t)return;const o=(()=>{const{documentElement:t,body:e}=document,n=t.scrollTop||e.scrollTop,o=t.scrollHeight||e.scrollHeight;return Math.trunc(n/(o-t.clientHeight)*100,10)})();n<o&&e(!0)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),t}checkSocialProofConditions(t,e,n,o){const s=(()=>{let t;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S?.USER?.accountIdentifier?.length?t=window.ABTASTY_S.USER.accountIdentifier:"function"==typeof window.ABTasty?.getAccountSettings?t=window.ABTasty.getAccountSettings().identifier:window.ABTasty?.accountSettings&&(t=window.ABTasty.accountSettings.identifier),t):t})(),{viewInterval:i,spNoTrim:a}=DATA;if(this.socialProofStore.hasOwnProperty(t))n(this.socialProofStore[t])?o(`${this.socialProofStore[t][i]}`):o(!1);else if(t&&s){const r=e=>(this.socialProofStore[t]=e,o(!!n(e)&&`${e[i]}`));fetch(`https://api-social-proof.abtasty.com/clients/${s}/metrics/${e}?key=${t}${a?"&noTrim=true":""}`).then(t=>t.ok&&t.json()).then(r).catch(()=>l("Failed to fetch datas from server."))}else o(!1)}getSocialProofDatas({promise:t,resolve:e},s,i=!1){const{productKey:a,keyType:r}=(()=>{const{socialProofContentType:t,productKeyProvider:e,pathToProductKey:s,customJSProductKey:i,productSKU:a}=DATA,{pathToProductKey:r,customJSProductKey:c}="undefined"!=typeof DATA_JS?DATA_JS:{};if(2===t)return{productKey:o(),keyType:"url"};{let l=null,d="sku";switch(e){case"ABTastyProductKey":l=window.ABTastyProductKey;break;case"pathToProductKey":l="function"==typeof r?r():n(`return ${s};`);break;case"customJSProductKey":l="function"==typeof c?c():n(i);break;case"productSKU":l=a}return l||3!==t||(l=o(),d="url"),{productKey:l,keyType:d}}})(),{viewInterval:c,triggerSocialProofMinVisitors:d,triggerSocialProofMinPurchases:u,triggerSocialProofMinPageViews:h}=DATA,m={pv:h,i:u,"v-pv":d}[s];return[typeof c,typeof m].includes("undefined")&&e(!1),i&&!a&&(l("Not able to find ABTastyProductKey, impossible to call the API, read documentation for more informations:\n\t\t\t\thttps://support.abtasty.com/hc/en-us/articles/4710919241628-Widgets-List#h_84c04344-c655-4e5e-b9ab-d26a798ad9b0"),e(!1)),this.checkSocialProofConditions(a,"v-pv"===s&&"sku"===r?"v-i":s,t=>{const e=void 0!==t[c]&&t[c]>=m;return e||l(`Widget will not be shown, Social Proof API returned ${t[c]} while ${m} are required`),e},e),t}onConsent({promise:t,resolve:e}){if(!i()){const n=["abtasty_consentValid",()=>e(!0)];return this.eventsListeners.push(n),window.addEventListener(...n),t}return e(!0),t}onTrackingSent({promise:t,resolve:e}){const{triggerEventTrackingSent:n}=DATA;let o=localStorage.getItem(E);const s=()=>JSON.parse(o)?.ActionTracking?.some(({name:t})=>t===n),i=["storage",({key:t,newValue:n})=>{t===E&&(o=n,s()&&e(!0))},{passive:!0,capture:!0}];return o&&s()?e(!0):(()=>{this.eventsListeners.push([window,...i]),window.addEventListener(...i)})(),t}onMinPagesViewed({promise:t,resolve:e}){const{triggerEventMinPagesViewed:n}=DATA;let o=localStorage.getItem(E);const s=()=>n<=(o?JSON.parse(o)?.VisitedPages?.length:0),i=["storage",({key:t,newValue:n})=>{t===E&&(o=n,s()&&e(!0))},{passive:!0,capture:!0}];return o&&s()?e(!0):(()=>{this.eventsListeners.push([window,...i]),window.addEventListener(...i)})(),t}onRageClick({promise:t,resolve:e}){const{triggerEventRageClickQuantity:n,triggerEventRageClickDelay:o}=DATA;let s=0,i=!1;const a=["click",({isTrusted:t})=>{if(t&&(s+=1,s>=n&&e(!0),!i)){i=!0;const t=setTimeout(()=>{s=0,i=!1},o);this.timeouts.push(t)}},{passive:!0,capture:!0}],r=t=>{this.eventsListeners.push([t,...a]),t.addEventListener(...a)},{clear:c}=p("iframe []contentDocument[] body > *",()=>{const t=document.getElementsByTagName("iframe");for(const e of t){"contentDocument"in e&&"body"in e.contentDocument&&r(e.contentDocument);const t=()=>r(e.contentDocument);e.addEventListener("load",t),this.eventsListeners.push([e,"onIframeLoad",t])}});return this.elementWaiters.push(c),r(document),t}clear(){this.triggerElements=this.triggerElements.filter(t=>(t.remove(),!1)),this.eventsListeners=this.eventsListeners.filter(t=>{const[e,...n]=t;return e&&n.length>1&&e.removeEventListener(...n),!1}),this.timeouts=this.timeouts.filter(t=>(clearTimeout(t),!1)),this.intervals=this.intervals.filter(t=>(clearInterval(t),!1));const t=c();return this.visibilityObservers=this.visibilityObservers.filter(e=>(e.clear(this.selector,t),!1)),this.promises=this.promises.filter(t=>(t.resolve(!1),!1)),this.elementWaiters=this.elementWaiters.filter(t=>(t(),!1)),this}async isTriggered(){this.clear();const t=d(this.event);this.promises.push(t);const e={consent:()=>this.onConsent(t),direct:()=>!0,pageLoad:()=>this.onPageLoad(t),click:()=>this.onClick(t),exitIntent:()=>this.onExitIntent(t),reengage:()=>this.onReengage(t),elementVisible:()=>this.onElementVisible(t),script:()=>this.onCustomTrigger(t),hover:()=>this.onHover(t),scrollUp:()=>this.onScrollUp(t),scrollPercent:()=>this.onScrollPercentReached(t),rageClick:()=>this.onRageClick(t),minPagesViewed:()=>this.onMinPagesViewed(t),trackingSent:()=>this.onTrackingSent(t),socialProofPurchases:()=>this.getSocialProofDatas(t,"i",!0),socialProofPageViews:()=>this.getSocialProofDatas(t,"pv"),socialProofVisitors:()=>this.getSocialProofDatas(t,"v-pv")},n=!Object.prototype.hasOwnProperty.call(e,this.event)||await e[this.event]();return n&&this.clear(),"reengage"!==this.event&&this.delay?n&&await(async()=>{const t=d(`${this.event}Delay`);this.promises.push(t);const e=setTimeout(()=>{t.resolve(!0),this.clear()},this.delay);return this.timeouts.push(e),t.promise})():n}}const k="display",L="closing",D="validation",B="ABTastyWidgets",P=`${B}Temporary`;class I{constructor({displayRecurrence:t,closingRecurrence:e,validationRecurrence:n},o){this.displayRecurrence=parseFloat(t),this.closingRecurrence=parseFloat(e),this.validationRecurrence=parseFloat(n),this.onSetCallback=o,this.widgetName=a(),this.uniqueId=c(),this.recurrenceKey=`${this.widgetName}_${this.uniqueId}`,this.isListeningStorageEvent=this.listenStorageEvent(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}onStorage({key:t}){const e=localStorage.getItem(P),n=sessionStorage.getItem(B);"ABTastyData"===t&&!e&&n&&localStorage.setItem(P,n)}listenStorageEvent(){return this.isListeningStorageEvent||window.addEventListener("storage",this.onStorage.bind(this)),!0}getGivenRecurrenceStorageParsed(t){try{const e=t.getItem(B);return JSON.parse(e)}catch(e){return t.removeItem(B),!1}}getSessionRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}getLocalRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}removeGivenStorage(t,e){const{[this.recurrenceKey]:n,...o}=e;return Object.entries(o).length?(t.setItem(B,JSON.stringify(o)),o):(t.removeItem(B),!1)}removeSessionRecurrenceStorage(){const t=this.getSessionRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.sessionStorage,t)}removeLocalRecurrenceStorage(){const t=this.getLocalRecurrenceStorageParsed();return!!t&&this.removeGivenStorage(window.localStorage,t)}getSessionRecurrence(){const t=this.getSessionRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}getLocalRecurrence(){const t=this.getLocalRecurrenceStorageParsed();return!!t&&t[this.recurrenceKey]}getCurrentRecurrence(){if(this.pendingRecurrence)return this.pendingRecurrenceValue;const t=this.getSessionRecurrence(),e=this.getLocalRecurrence();return t||e||{type:!1}}isOver(){const t=localStorage.getItem(P),e=!(!t||!t.includes(this.recurrenceKey))||this.getSessionRecurrence();t&&(sessionStorage.setItem(B,t),localStorage.removeItem(P));const n=this.getLocalRecurrence(),o=(n?parseFloat(n.stamp):0)<(new Date).getTime();return o&&this.removeLocalRecurrenceStorage(),!this.pendingRecurrence&&o&&!this.getLocalRecurrence()&&!e}setRecurrence(t,n){0!==t&&(window.removeEventListener("storage",this.onStorage.bind(this)),this.isListeningStorageEvent=!1);const o=this.getTypeOfStorage(t);if(e()||!o&&"object"!=typeof o)return!1;const{storageString:s,storageMethod:a}=o,r=this.getStamp(t),c={type:n,stamp:r},{type:l}=this.getCurrentRecurrence(),d=async()=>{if(!i()){this.pendingRecurrence=!0,this.pendingRecurrenceValue=c;const t=new S({triggerEvent:"consent"});await t.isTriggered(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}const t=this.getSessionRecurrence(),e=this.getLocalRecurrence();let n;"session"===s?t?n=this.removeSessionRecurrenceStorage():(this.removeLocalRecurrenceStorage(),n=this.getSessionRecurrenceStorageParsed()):"local"===s&&(e?n=this.removeLocalRecurrenceStorage():(this.removeSessionRecurrenceStorage(),n=this.getLocalRecurrenceStorageParsed()));const o=n?{[this.recurrenceKey]:c,...n}:{[this.recurrenceKey]:c};a.setItem(B,JSON.stringify(o)),this.onSetCallback&&"function"==typeof this.onSetCallback&&this.onSetCallback()};if(!a)return!1;if(l&&n!==D)if(n===L&&l!==D)d();else{if(n!==k||l===D||l===L)return!1;d()}else d();return r}setDisplayRecurrence(){const t=k;this.setRecurrence(this.displayRecurrence,t)}setClosingRecurrence(){const t=L;this.setRecurrence(this.closingRecurrence,t)}setValidationRecurrence(){const t=D;this.setRecurrence(this.validationRecurrence,t)}getStamp(t){return(new Date).getTime()+864e5*t}getTypeOfStorage(t){return!(isNaN(t)||t<0||0!==t&&!t)&&(t>0?{storageString:"local",storageMethod:window.localStorage}:0===t&&{storageString:"session",storageMethod:window.sessionStorage})}}class N{constructor(t,e,n){this.isWidgetApplied=t,this.callback=e,this.shouldUpdate=n,this.triggerIframeTarget=null,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.tagRollbackEventParams=["abtasty_resetActionTracking",this.onTagRollback.bind(this)],this.onCampaignLaunchedEventParams=["abtasty_executedCampaign",this.onCampaignLaunched.bind(this)]}decisionHandler(t){const e=!t&&this.isWidgetApplied(),n=e?this.shouldUpdate&&A:C;return n?(this.clearWatcher(),this.callback(n,!t,e),this.watch(),this):this}onCampaignLaunched({detail:{campaignId:t}}){t===TEST_ID&&(this.callback(C,!1),this.watch())}onTagRollback({target:t}){return this.clearWatcher(t),this.callback(x,!1,!0),window.addEventListener(...this.onCampaignLaunchedEventParams),this}observerHandler(t){return s()?t.some(t=>["removedNodes","addedNodes"].some(e=>t[e]&&t[e].length))?this.decisionHandler():this:this.callback(x,!1)}watch(e,n){if(t())return this;if(this.clearWatcher(e),window.removeEventListener(...this.onCampaignLaunchedEventParams),document.addEventListener(...this.tagRollbackEventParams),n?.includes("[]contentDocument[]")){const t=n.split("[]")[0].trim(),{clear:e}=p(t,t=>{e(),this.triggerIframeTarget=t,t.addEventListener("load",this.decisionHandler.bind(this))})}const o=e?.defaultView?.frameElement;o&&this.triggerIframeTarget!==o&&o.addEventListener("load",this.decisionHandler.bind(this));const{clear:s}=p("body",t=>{s();const n=e?.body||e||t;this.observer.observe(n,{childList:!0,subtree:!0})});return this}clearTriggerElementWatcher(){this.triggerIframeTarget?.removeEventListener("load",this.decisionHandler.bind(this))}clearWatcher(t){return document.removeEventListener(...this.tagRollbackEventParams),this.observer.disconnect(),this.clearTriggerElementWatcher(),t?.defaultView?.frameElement?.removeEventListener("load",this.decisionHandler.bind(this)),this}}const R=/.+\/([^.]+)\.(otf|ttf)$/,_=["socialProofPurchases","socialProofPageViews","socialProofVisitors"];class O{constructor(e,n){this.children=void 0,this.uniqueId=`${c()}${n?`_${n}`:""}`,this.widgetName=a(),this.prettyName=r(),this.recurrenceParams=(()=>{const{displayRecurrence:e,closingRecurrence:n,validationRecurrence:o}=DATA,s=!e&&!n&&!o;if(t()||s)return!1;const i={everytime:()=>-1,session:()=>0,once:()=>395,day:t=>DATA[`${t}_day`],week:t=>7*DATA[`${t}_week`],month:t=>30.5*DATA[`${t}_month`]},a={};return e&&(a.displayRecurrence=i[e]("displayRecurrence")),n&&(a.closingRecurrence=i[n]("closingRecurrence")),o&&(a.validationRecurrence=i[o]("validationRecurrence")),a})(),this.triggerParams=(e=>{let{triggerEvent:n}=DATA;const{triggerEventClick:o,triggerEventHover:s,triggerEventReengageDelay:i,socialProofContentType:a,triggerEventElementVisible:r,triggerEventDelay:c}=DATA;if(t()||!n&&!a)return!1;const l={click:()=>o,hover:()=>s,elementVisible:()=>r},d=Object.prototype.hasOwnProperty.call(l,n)?l[n]():"body",u="reengage"===n?i:c;return a&&(n=[,"socialProofPurchases","socialProofPageViews","socialProofVisitors"][a]),{triggerEvent:n,triggerSelector:d,triggerDelay:u,triggerTarget:e}})(e),this.recurrence=!!this.recurrenceParams&&new I(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new S(this.triggerParams),this.shouldUpdate=!!this.triggerParams&&_.includes(this.triggerParams.triggerEvent),this.pageWatcher=new N(this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=(()=>{const{isOncePerPageTrigger:t,triggerEvent:e}=DATA;return!e||!["click","hover","scrollUp","script"].includes(e)||t})(),this.basicClassName=`ab_widget_container_${this.widgetName}`,this.widgetContainerId=`${this.basicClassName}_${this.uniqueId}`,this.contentClassName=`${this.basicClassName}_content`,this.overlayClassName=`${this.basicClassName}_overlay`,this.closeButtonClassName=`${this.basicClassName}_close_button`,this.hideClassName=`ab_hide_${this.uniqueId}`,this.rootElement=null,this.domElement=this.getDom(),this.hasBeenShown=!1,this.closedByUser=!1,this.websiteFocusedElement=null,this.elementsWaiters=[]}clearGivenClearables(){for(const t of this.elementsWaiters)t.clear();this.elementsWaiters=[]}isWidgetApplied(){return this.domElement?.isConnected&&this.domElement.ownerDocument?.defaultView}removeOldDomElement(){const t=this.rootElement?.getElementById(this.widgetContainerId);return t?.remove(),this}async insert(){if(this.isWidgetApplied())return!1;const t=["free"];"drawer"===DATA.layout&&DATA.customTarget&&t.push("drawer");const e=t.includes(DATA.layout);return new Promise(t=>{const{elementReferrer:n="body",referrerInsertType:o="beforeend"}=e?DATA:{},s=p(n,e=>{this.elementsWaiters=this.elementsWaiters.filter(t=>t.selector!==n),this.rootElement=e.getRootNode(),this.removeOldDomElement(),this.domElement.appendChild(this.styleElement),t(e.insertAdjacentElement(o,this.domElement))});this.elementsWaiters.push(s)}).then(()=>this)}remove(){this.trigger&&this.trigger.clear(),this.pageWatcher.clearWatcher(this.rootElement);for(const t of this.elementsWaiters)[DATA.elementReferrer,"body"].includes(t.selector)&&t.clear();return this.domElement?.isConnected&&this.domElement.remove(),this.hasOncePerPageTrigger?this.pageWatcher.watch(this.rootElement):t()||this.init().then(({response:t})=>t?this.show():this),this}show(){const{layout:e,overlay:n=!0}=DATA;return t()||this.hasBeenShown&&this.hasOncePerPageTrigger||window.ABTastyEvent(`${this.prettyName} displayed`,null,TEST_ID),this.closedByUser=!1,this.websiteFocusedElement=document.activeElement,setTimeout(()=>{this.domElement.classList.remove(this.hideClassName),t()||"popin"!==e||!0!==n||this.domElement.querySelector('input[type="text"], textarea, a, button')?.focus()},50),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,this.pageWatcher.watch(this.rootElement),this}hide(e=!0){return!t()&&this.hasBeenShown&&e&&window.ABTastyEvent(`${this.prettyName} closed`,null,TEST_ID),e&&(this.pageWatcher.clearWatcher(this.rootElement),this.closedByUser=!0),this.domElement.classList.add(this.hideClassName),!t()&&this.websiteFocusedElement?.isConnected&&this.websiteFocusedElement.focus(),this}async init(e){const n=t(),o=s(),i=this.trigger?.promises?.length,a=!this.recurrence||this.recurrence.isOver();if(!n&&!o||i||!a)return{container:this,response:!1};this.pageWatcher.watch(this.rootElement||document,this.triggerParams.triggerSelector);const r=n||!this.trigger||this.trigger&&await this.trigger.isTriggered();this.pageWatcher.clearTriggerElementWatcher();const c={container:this,response:r};return r?(await this.insert(),this.addCloseEvent(),n||e||this.hasBeenShown||void 0===this.children||"function"!=typeof this.children.refreshContent||this.children.refreshContent(r),c):c}onPageChange(t,e,n){const o=()=>this.init().then(({response:t})=>{t?this.show():this.hide(!1)});e||(this.hasBeenShown=!1,n&&this.domElement.remove(),this.trigger&&this.trigger.clear());const s={[x]:()=>n?this.remove():this.pageWatcher.watch(this.rootElement),[C]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch(this.rootElement):n||this.insert().then(t=>t.show()).catch(this.pageWatcher.watch):o()},[A]:()=>{this.hasBeenShown?this.pageWatcher.watch():o()}};"function"==typeof s[t]&&s[t]()}addCloseEvent(...e){const{closeButton:n,overlay:o,overlayClickable:s,layout:i,animationDuration:a=1e3}=DATA,r=[];if(void 0!==o&&!0!==o||!0!==s||"popin"!==i||r.push(`.${this.overlayClassName}`),void 0!==n&&n&&r.push(`.${this.closeButtonClassName}`),!r.length)return this;const c=this.domElement.querySelectorAll(r.join(", "));if(!c.length)return this;const l=t=>{const e="click"===t.type,n="keyup"===t.type&&"Escape"===t.code&&t.isTrusted;(e||n)&&(w(t),this.recurrence&&this.recurrence.setClosingRecurrence(),this.hide(!0),setTimeout(()=>this.remove(),1.05*a))},d=["click",l,{once:!0,capture:!0}];e.push(...c);for(const n of e)t()&&(n.dataset.abtastyActionnable="true"),n.removeEventListener(...d),n.addEventListener(...d);return window.removeEventListener("keyup",l,{once:!0}),window.addEventListener("keyup",l,{once:!0}),this}getDom(){const{closeButton:t,layout:e,overlayClickable:n,overlay:o=!0}=DATA,s=document.createElement("div");return s.className=`${this.basicClassName} ${this.hideClassName}`,s.id=this.widgetContainerId,["popin","bannerTop","bannerBottom"].includes(e)&&(s.role="dialog","popin"===e&&!0===o&&(s.ariaModal="true")),s.innerHTML=`\n\t\t\t${"popin"===e&&!0===o?`<div ${n?'aria-label="Close dialog"':""} class="${this.overlayClassName}"></div>`:""}\n\t\t\t<div class="${this.contentClassName}">\n\t\t\t${t?`<button class="${this.closeButtonClassName}" aria-label="Close dialog"><svg viewBox="0 0 16 16">\n\t<defs><path id="prefix__a" d="M12 4.991L11.009 4 8 7.009 4.991 4 4 4.991 7.009 8 4 11.009 4.991 12 8 8.991 11.009 12 12 11.009 8.991 8z"></path></defs>\n\t<g><use xlink:href="#prefix__a"></use></g>\n</svg></button>`:""}\n\t\t\t</div>`,s}loadFont(t,e){if(!t||"inherit"===t||!/otf|ttf/g.test(e))return;const n=document.createElement("style"),o=e.match(R)?e.match(R)[1]:"";n.innerHTML=`@font-face { font-family: '${t}_${o}'; src: url('${e}'); font-display: swap; }`;const s=this.rootElement?.head||document.head;s?.appendChild(n)}getStyleTag(e="",n=DATA){const{noStyles:o,layout:s}=n,{backgroundColor:i,isBackgroundImage:a,backgroundImage:r,backgroundSize:c,backgroundPosition:l,backgroundRepeat:d,borderColor:u,borderRadius:h,borderWidth:m,textColor:g,textAlign:b,fontName:p,fontStyle:y,fontSize:w,isTitle:v,titleTextAlign:f,titleTextColor:T,titleFontName:x,titleFontStyle:C,titleFontSize:A,overlay:E,overlayColor:S,dropShadow:k,dropShadowColor:L,dropShadowBlur:D,containerMargin:B,containerPadding:P,closeButton:I,closeButtonPosition:N,closeButtonSize:_,closeButtonBorderRadius:O,closeButtonBorderWidth:W,closeButtonBorderColor:V,closeButtonColor:M,closeButtonBackgroundColor:q,buttonsAlign:F,buttonsBorderWidth:j,buttonsBorderColor:H,buttonsBorderRadius:z,buttonsBackgroundColor:U,buttonsTextColor:K,buttonsFontName:J,buttonsFontStyle:G,buttonsFontSize:Y,secondLink:Q,secondLinkBorderWidth:X,secondLinkBorderColor:Z,secondLinkBorderRadius:tt,secondLinkBackgroundColor:et,secondLinkTextColor:nt,secondLinkFontName:ot,secondLinkFontStyle:st,secondLinkFontSize:it,animation:at,animationDuration:rt,animationBehaviour:ct,animationSlideDirection:lt}=o?{}:n,dt=document.createElement("style");t()&&dt.setAttribute("abtasty-script-added","true"),this.loadFont(p,y),this.loadFont(x,C),this.loadFont(J,G),this.loadFont(ot,st);const ut=`background: ${["string"==typeof i?i:"rgba(255, 255, 255, 1)",a&&"string"==typeof r&&r.length?`url(${r})`:"",a&&"string"==typeof l&&"100% 100%"!==c?l:"0 0",a&&"string"==typeof c?`/ ${c}`:"/ auto",a&&d&&!["cover","100% 100%"].includes(c)?"repeat":"no-repeat"].join(" ").trim()};`,ht="number"==typeof m&&m>0,mt=`border: ${[ht?`${m}px`:"unset",ht?"solid":"",ht&&"string"==typeof u&&u.length?u:""].join(" ").trim()};`,gt=void 0!==h?`border-radius: ${h}px;`:"",bt=void 0!==g?`color: ${g}; fill: ${g}; -webkit-text-fill-color: ${g};`:"",pt=void 0!==b?`text-align: ${b};`:"",yt=p&&"inherit"!==p?`font-family:${p}_${y.match(R)?y.match(R)[1]:""};`:y||"",wt=w?`font-size: ${w}px;`:"",vt=void 0!==k&&k?`box-shadow: 0 5px ${D}px 0 ${L};`:"",ft=B instanceof Array&&1===B.length&&B[0],Tt=ft?`margin: ${ft.top}px ${ft.right}px ${ft.bottom}px ${ft.left}px;`:"",xt=ft?`margin: calc(${ft.top}px * 0.5) calc(${ft.right}px * 0.5) calc(${ft.bottom}px * 0.5) calc(${ft.left}px * 0.5);`:"",$t=P instanceof Array&&1===P.length&&P[0],Ct=$t?`padding: ${$t.top}px ${$t.right}px ${$t.bottom}px ${$t.left}px;`:"",At=$t?`padding: calc(${$t.top}px * 0.5) calc(${$t.right}px * 0.5) calc(${$t.bottom}px * 0.5) calc(${$t.left}px * 0.5);`:"",Et=void 0!==j&&j?`border-width: ${j}px; border-style: solid;`:"",St=[H,j].every(t=>void 0!==t)&&j?`border-color: ${H};`:"",kt=void 0!==z?`border-radius: ${z}px;`:"",Lt=void 0!==U?`background-color: ${U};`:"",Dt=void 0!==K?`color: ${K}; fill: ${K}; -webkit-text-fill-color: ${K};`:"",Bt=J&&"inherit"!==J?`font-family:${J}_${G.match(R)?G.match(R)[1]:""};`:G||"",Pt=Y?`font-size: ${Y}px;`:"",It="number"==typeof X?`border-width: ${X}px; border-style: solid;`:"",Nt=[Z,X].every(t=>void 0!==t)&&X?`border-color: ${Z};`:"",Rt=void 0!==tt?`border-radius: ${tt}px;`:"",_t=void 0!==et?`background-color: ${et};`:"",Ot=void 0!==nt?`color: ${nt}; fill: ${nt}; -webkit-text-fill-color: ${nt};`:"",Wt=ot&&"inherit"!==ot?`font-family:${ot}_${st.match(R)?st.match(R)[1]:""};`:st||"",Vt=it?`font-size: ${it}px;`:"",Mt="popin"!==s||void 0!==E&&!0!==E?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==S?S:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),qt="number"==typeof _?_:16,Ft=qt/2,jt=o||void 0!==I&&I?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===N?`bottom: calc(100% + ${Ft}px)`:`top: ${Ft}px`)+";",`right: ${Ft}px;`,"width: auto;","height: auto;","background: none;","border: none;","cursor: pointer;","padding: 0;","margin: 0;","line-height: 0;","z-index: 9;","number"==typeof O?`border-radius: ${O}px;`:"","number"==typeof W&&W>0?`border: ${W}px solid ${void 0!==V?V:"rgba(57, 57, 57, 1)"};`:"","string"==typeof q?`background-color: ${q};`:"","}",`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} svg {`,"pointer-events: none;",`width: ${qt}px;`,`height: ${qt}px;`,"string"==typeof M?`fill: ${M};`:"","}"].join(""):"",Ht=v&&"string"==typeof T?[`#${this.widgetContainerId} .${this.contentClassName} > * h1, `,`#${this.widgetContainerId} .${this.contentClassName} > * h2, `,`#${this.widgetContainerId} .${this.contentClassName} > * h3, `,`#${this.widgetContainerId} .${this.contentClassName} > * h4, `,`#${this.widgetContainerId} .${this.contentClassName} > * h5, `,`#${this.widgetContainerId} .${this.contentClassName} > * h6 {`,`color: ${T}; fill: ${T}; -webkit-text-fill-color: ${T};`,void 0!==f?`text-align: ${f};`:"",x&&"inherit"!==x?`font-family:${x}_${C.match(R)?C.match(R)[1]:""};`:C||"",A?`font-size: ${A}px;`:"","}"].join(""):"";let zt="";if("string"==typeof at){const e=(rt/1e3).toFixed(2),n=["top","bottom"].includes(lt),o=Number(n),s=[(["top","left"].includes(lt)?"-":"")+"100vmax",this.translateValues?this.translateValues[o]:"0"];n&&s.reverse(),zt={none:[`.${this.hideClassName} {`,"opacity: 0 !important;","}"],fade:[`.${this.hideClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} {`,`transition: opacity ${e}s ${ct};`,"}","@media (prefers-reduced-motion: reduce) {",`#${this.widgetContainerId} {`,"transition: unset;","}","}"],slide:[`.${this.hideClassName} .${this.overlayClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} .${this.overlayClassName} {`,`transition: opacity ${e}s ${ct};`,"}",`.${this.hideClassName} .${this.contentClassName} {`,`transform: translate(${s.join(", ")}) !important;`,"}",`#${this.widgetContainerId} .${this.contentClassName} {`,`transition: transform ${e}s ${ct};`,"}","@media (prefers-reduced-motion: reduce) {",`#${this.widgetContainerId} .${this.overlayClassName},`,`.${this.hideClassName} .${this.contentClassName},`,`#${this.widgetContainerId} .${this.contentClassName} {`,"transition: unset;","}","}"]}[t()&&!ABTASTY_S.WIDGETS.animationChanged?"none":at].join("")}const Ut=[`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,`margin-${"fill"===F?"top":"left"}: 8px;`,It,Nt,Rt,_t,Ot,Wt,Vt,"}",`#${this.widgetContainerId} .${this.contentClassName} .buttons_container .second_link {`,Ot,Wt,Vt,"}"];return dt.textContent=[`#${this.widgetContainerId} style { display: none; }`,`.${this.hideClassName} {`,"pointer-events: none;","}",`#${this.widgetContainerId} {`,"opacity: 1;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,ut,gt,mt,bt,pt,vt,Tt,yt,wt,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,bt,pt,yt,wt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",Ct,yt,wt,"}",`#${this.widgetContainerId} .${this.contentClassName} a {`,"text-decoration: underline;","}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a, `,`#${this.widgetContainerId} .${this.contentClassName} button {`,"text-decoration: none;","box-sizing: border-box;","display: inline-block;",Et,St,kt,Lt,Dt,Bt,Pt,"}",`#${this.widgetContainerId} .${this.contentClassName} div.buttons_container a *:not(.second_link span), `,`#${this.widgetContainerId} .${this.contentClassName} button:not([class*="close_button"], [class*="csatEmojiButton"]) * {`,Dt,Bt,Pt,"}",...Q?Ut:[],"@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,xt,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,At,"}","}",Mt,jt,Ht,zt,`${e}`].join(""),dt}}const W=["top: 0;","top: 50%;","bottom: 0;"],V=["left: 0;","left: 50%;","right: 0;"],M=t=>1===t?"-50%":0,q=()=>{if(Array.isArray(DATA.popinPosition)){const{popinPosition:[{x:t,y:e}]}=DATA,n=`translate(${M(e)}, ${M(t)});`;return`${W[t]}${V[e]}transform: ${n}`}return"left: 50%;top: 50%;transform: translate(-50%, -50%);"},F=()=>"autoWidth"in DATA&&!0===DATA.autoWidth,j=()=>{if(F())return"width: auto; height: auto; min-width: fit-content;";const{popinPercentWidth:t,popinPixelsWidth:e,widthUnit:n,autoHeight:o,popinPercentHeight:s,popinPixelsHeight:i,heightUnit:a}=DATA;return`width: ${"px"===n?e:t}${n};height: ${o?"auto":`${"px"===a?i:s}${a}`};`};class H extends O{constructor(){super(),this.translateValues=Object.values(DATA.popinPosition[0]).map(t=>M(t)),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:t,zindexCustom:e,widthUnit:n}=DATA,o="string"!=typeof DATA.overlay&&DATA.overlay;return[`#${this.widgetContainerId} {`,"position: fixed;","top: 0;","left: 0;","width: 100%;","height: 100%;",`z-index: ${"custom"===t?e:t};`,"background: none;","pointer-events: "+(o?"all":"none"),"}",`#${this.widgetContainerId} .${this.overlayClassName} {`,"position: absolute;","z-index: -1;","top: 0;","left: 0;","width: 100%;","height: 100%;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: absolute;",q(),j(),"pointer-events: all","}",`${F()?"":[`#${this.widgetContainerId} .${this.contentClassName} > div {`,"height: 100%;","overflow: auto;","box-sizing: border-box;","}"].join("")}`,`${!F()&&["px","em"].includes(n)?["@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,"max-width: 94vw;","}","}"].join(""):""}`].join("")}}class z extends O{constructor(){super(),this.position="string"==typeof DATA.layout&&"bannerTop"===DATA.layout?"top":"bottom",this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:t,zindexCustom:e}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;",`${this.position}: 0;`,"left: 0;","width: 100%;","height: auto;",`z-index: ${"custom"===t?e:t};`,"background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}class U extends O{constructor(t,e){super(t,e),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){return[`#${this.widgetContainerId} {`,"width: auto;","height: auto;","margin: 0;","padding: 0;","background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}const K=/.+\/([^.]+)\.(otf|ttf)$/,J=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"popin";const{layout:n,inlineLayoutContent:o}=DATA,{image:s}=DATA;return t&&"https://widgets-images.abtasty.com/widgets-default-image.png"!==s?`<div class="countdown_${e}_img_container">\n\t\t\t\t<img src="${s}" class="abtasty-countdown-image ${"popin"===n||"free"===n&&!o?"abtasty-countdown-image-popin-layout":""}">\n\t\t\t</div>`:""},G=["day","hour","minute","second"],Y="line",Q=window.ABTASTY_S?.USER?.lang?ABTASTY_S.USER.lang.split("_")[0]:navigator.language.substring(0,2)||"en",X=["fr","en","de","es","ja"].indexOf(Q)>-1?Q:"en",Z=DATA.contentChosenLanguage,tt="default"===Z?X:Z,et=(t,e,n="long")=>{const o={style:"unit",unit:t,unitDisplay:n};return new Intl.NumberFormat(tt,o).format(e)};class nt{constructor(t){let{parentContainer:e}=t;this.parentContainer=e,this.testId=TEST_ID,this.container=this.createContainer(),this.digitElements={},this.textElements={},this.timerElements={},this.timeLoop=null,this.maxWidth=0,this.previewTime=172799,this.fonts=[]}remove(){const{animationDuration:t}=DATA;setTimeout(()=>this.parentContainer.remove(),1.05*t)}getCountdownClock(){return this.container.querySelector(".abtasty-countdown-clock")}onBlurOrMouseLeave(t){let{type:e}=t;const n=this.getCountdownClock();n&&(n.ariaLive="off");const o="mouseleave"===e?"mouseenter":"focus";this.container.addEventListener(o,this.onFocusOrMouseEnter.bind(this),{passive:!0,once:!0})}onFocusOrMouseEnter(t){let{type:e}=t;const n=this.getCountdownClock();n&&(n.ariaLive="polite");const o="mouseenter"===e?"mouseleave":"blur";this.container.addEventListener(o,this.onBlurOrMouseLeave.bind(this),{passive:!0,once:!0})}addAriaEvents(t){const e=["mouseenter","focus"];for(const n of e)t.addEventListener(n,this.onFocusOrMouseEnter.bind(this),{passive:!0,once:!0})}addCloseEvent(e){e&&e.addEventListener("click",e=>{w(e),t()||this.parentContainer.recurrence.setClosingRecurrence(),this.parentContainer.hide(),this.remove()},{capture:!0,passive:!1})}addRedirectionEvent(e){!t()&&e&&e.addEventListener("click",()=>{const{autoHide:t,timeHide:e}=DATA;t&&setTimeout(()=>{this.parentContainer.hide(),this.remove()},1e3*e),this.parentContainer.recurrence.setValidationRecurrence()},{useCapture:!0,once:!0})}createContainer(){const{linkType:t,redirectionUrl:e,openInNewTab:n}=DATA,o=document.createElement(t&&t.includes("widget")?"a":"div");switch(o.classList.add("abtasty-countdown"),t){case"widget":o.href=e,o.target=n?"_blank":"_self",this.addRedirectionEvent(o);break;case"widgetClose":o.href="#",o.dataset.abtastyActionnable="true",this.addCloseEvent(o)}return this.addAriaEvents(o),o}insert(t,e){return t.insertAdjacentElement(e,this.container),this}setText(t){const{layoutType:e,displayElapsedElements:n,layout:o,endSettings:s}=DATA,i={day:DATA.customDaysLabel,hour:DATA.customHoursLabel,minute:DATA.customMinutesLabel,second:DATA.customSecondsLabel},a=DATA.timeUnitLengthFormat;for(const o of G){const s=this.timerElements[o],r=String(t[o]).padStart(2,"0"),c=et(o,r,a).match(/([\d,.]+)\s*(.+)/),l=c?c[1]:r;let d=c?c[2]:o;if(DATA.customTexts&&o in i&&(d=i[o]),n||(s.dataset.timeEnd=0===t[o]?"true":"false"),"textDigits"===e)s.textContent=`${l} ${d}`;else{const t=this.digitElements[o],e=this.textElements[o];t.textContent=l.toString().padStart(2,"0"),e.textContent=d,this.maxWidth<t.offsetWidth&&(this.maxWidth=t.offsetWidth,t.style.minWidth=`${this.maxWidth}px`),t.style.minWidth=`${this.maxWidth}px`}}[null,"",s].includes(this.parentContainer.domElement.ariaLabel)&&["popin","bannerTop","bannerBottom"].includes(o)&&(this.parentContainer.domElement.ariaLabel=[...this.parentContainer.domElement.querySelectorAll(".abtasty-countdown-clock, .abtasty-countdown-top-message")].map(t=>t.textContent.replace(/\s+/g," "),"").join("").trim())}onTimeEnd(){const{endSettings:t,layout:e}=DATA;clearInterval(this.timeLoop);const n=this.getCountdownClock();if(n&&(n.ariaLive="off"),"hideWidget"===t)return this.parentContainer.hide(),void(this.parentContainer.domElement.style.display="none");const o=this.container.querySelectorAll(".abtasty-countdown-elm-time");for(const t of o)t.removeAttribute("data-time-end");["popin","bannerTop","bannerBottom"].includes(e)&&(this.parentContainer.domElement.ariaLabel=DATA.endMessage);const s={endText:!0,endCountdown:["showText","showTextAndButton"].includes(t),endButton:["hideCountdownAndShowTextAndButton","showTextAndButton"].includes(t)},i=[`abtasty-countdown-${t}`,"abtasty-countdown-finish"];for(const t of Object.keys(s)){const e=s[t]?"show":"hide";i.push(`abtasty-countdown-${t}-${e}`)}this.container.classList.add(...i)}setCountdown(){const e=new Date;let n=function(e,n){switch(e.type){case"global":return e.timestamp-n.getTime();case"local":if(t())return e.previewTimestamp-n.getTime();const{year:o,month:s,day:i,hour:a,minute:r}=e.timecomponents;return new Date(o,s-1,i,a,r).getTime()-n.getTime();default:return 0}}(DATA.dateTime,e)/1e3;if(top.ABTastyEditor&&("ifEnded"===DATA.previewBlock&&(n=-1),this.previewTime-=1),n<=0)return this.setText({day:0,hour:0,minute:0,second:0}),void this.onTimeEnd();const o=Math.floor(n/86400);n-=86400*o;const s=Math.floor(n/3600);n-=3600*s;const i=Math.floor(n/60);n-=60*i;const a=Math.floor(n);this.setText({day:o,hour:s,minute:i,second:a})}setButton(){var t=this;const e=function(e,n,o,s){let i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];const a=document.createElement("a");return a.ariaLabel=e,i&&(a.className="second_link"),a.innerHTML=`<span>${e}</span>`,a.href="button"===n?o:"#","button"===n?(a.target=s?"_blank":"_self",t.addRedirectionEvent(a)):(a.dataset.abtastyActionnable="true",t.addCloseEvent(a)),a},{linkType:n,buttonText:o,redirectionUrl:s,openInNewTab:i,secondLink:a,secondLinkText:r,secondLinkType:c,secondLinkURL:l,secondLinkOpenInNewTab:d,endBtnTargetBlank:u,endBtnLabel:h,endBtnLink:m}=DATA,g=this.container.querySelector(".abtasty-countdown-bottom-button"),b=[];if(n&&n.includes("button")){const t=e(o,n,s,i);if(b.push(t),a){const t=e(r,c,l,d,a);b.push(t)}}for(const t of b)g.appendChild(t);const p=this.container.querySelector(".abtasty-countdown-finish-button"),y=document.createElement("a");y.href=m,y.target=u?"_blank":"_self",y.innerHTML=h,y.ariaLabel=h,p.appendChild(y)}setContent(){const t=this.container.querySelector(".abtasty-countdown-finish-text"),e=document.createElement("div");if(e.innerHTML=DATA.endMessage,t.appendChild(e),"textDigits"===DATA.layoutType)return;const n=this.container.querySelector(".abtasty-countdown-top-message"),o=document.createElement("p");o.innerHTML=DATA.message,n.appendChild(o)}init(){const{layout:t,inlineLayoutContent:e,hideResponsiveImage:n,hideResponsiveText:o}=DATA;try{const s=["free","popin"].includes(t);(e=>{if(this.container.classList.add(`abtasty-countdown-layout-${e}`),s||(n&&this.container.classList.add("abtasty-countdown-hide-responsive-image"),o&&this.container.classList.add("abtasty-countdown-hide-responsive-text")),e===Y){s&&(this.parentContainer.domElement.querySelector(`.${this.parentContainer.contentClassName}`).classList.add(`abtasty-countdown-content-${t}-inline`),this.container.classList.add(`abtasty-countdown-layout-${t}-inline`));const e=this.parentContainer.domElement.querySelectorAll(`.${this.parentContainer.closeButtonClassName}`);for(const t of e)t.classList.add("abtasty-countdown-close-inline")}})(s&&!e?"free":Y),this.container.innerHTML=(()=>{const{layout:t,inlineLayoutContent:e,imagePosition:n,layoutType:o}=DATA,s="popin"===t||"free"===t&&!e,i=`\n ${J(s&&!("popin"===t&&e),"popin")}\n <div class="abtasty-countdown-layout-${t} abtasty-countdown-mini">\n ${J(!s&&"before"===n,"banner")}\n <div class="abtasty-countdown-top-message">\n ${DATA.messageMinimalistMode.split(/!countdown!/gm).map(t=>`<p>${t.trim()}</p>`).join('\n <span class="abtasty-countdown-days abtasty-countdown-elm-time"></span>\n <span class="abtasty-countdown-hours abtasty-countdown-elm-time"></span>\n <span class="abtasty-countdown-minutes abtasty-countdown-elm-time"></span>\n <span class="abtasty-countdown-seconds abtasty-countdown-elm-time"></span>\n').replace("<p></p>","")}\n </div>\n ${J(!s&&"after"===n,"banner")}\n <div class="abtasty-countdown-finish-text"></div>\n <div class="abtasty-countdown-finish-button"></div>\n <div class="abtasty-countdown-bottom-button buttons_container"></div>\n </div>\n `,a=`\n ${J(s&&!("popin"===t&&e),"popin")}\n <div class="abtasty-countdown-layout-${t} abtasty-countdown-standard">\n ${J(!s&&"before"===n,"banner")}\n <div class="abtasty-countdown-clock" role="timer" aria-live="off">\n <div class="abtasty-countdown-days abtasty-countdown-elm-time">\n <div class="abtasty-countdown-days__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-days__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-hours abtasty-countdown-elm-time">\n <div class="abtasty-countdown-hours__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-hours__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-minutes abtasty-countdown-elm-time">\n <div class="abtasty-countdown-minutes__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-minutes__text abtasty-countdown-elm-text"></div>\n </div>\n <div class="abtasty-countdown-seconds abtasty-countdown-elm-time">\n <div class="abtasty-countdown-seconds__digit abtasty-countdown-elm-number"></div>\n <div class="abtasty-countdown-seconds__text abtasty-countdown-elm-text"></div>\n </div>\n </div>\n ${J(!s&&"after"===n,"banner")}\n <div class="abtasty-countdown-top-message"></div>\n <div class="abtasty-countdown-finish-text"></div>\n <div class="abtasty-countdown-finish-button"></div>\n <div class="abtasty-countdown-bottom-button buttons_container"></div>\n </div>\n `;return"textDigits"===o?i:a})(),this.container.insertAdjacentElement("afterbegin",(t=>{const e=document.createElement("style");return e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t)),e})(`@media (min-width:741px){.abtasty-countdown-layout-line .abtasty-countdown-elm-time{margin:0}}@media (max-width:740px){.abtasty-countdown-layout-line>div:not(.abtasty-countdown-layout-popin){-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.abtasty-countdown-layout-line div.abtasty-countdown-finish-text,.abtasty-countdown-layout-line div.abtasty-countdown-top-message{margin-bottom:20px}.abtasty-countdown-layout-line div.abtasty-countdown-bottom-button a{margin-left:0}}@media (max-width:579px){.ab_widget_container_countdown_content{max-width:100%;width:100vw}.abtasty-countdown-layout-free,.abtasty-countdown-layout-popin{-webkit-box-orient:vertical!important;-webkit-box-direction:normal!important;-ms-flex-direction:column!important;flex-direction:column!important;margin:10px 0!important}.abtasty-countdown-hide-responsive-image .countdown_banner_img_container,.abtasty-countdown-hide-responsive-text .abtasty-countdown-top-message{display:none}}.abtasty-countdown,.abtasty-countdown>div{display:inline-block;text-align:center}.abtasty-countdown>div{margin:10px;overflow:auto;white-space:normal;width:100%}.abtasty-countdown .countdown_popin_img_container{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;max-width:100%}.abtasty-countdown .countdown_popin_img_container:empty{display:none}.abtasty-countdown .abtasty-countdown-finish-text,.abtasty-countdown .abtasty-countdown-top-message{margin-bottom:15px}.abtasty-countdown .abtasty-countdown-elm-time{display:inline-block;margin:6px 6px 15px;padding:6px}.abtasty-countdown .abtasty-countdown-elm-number,.abtasty-countdown .abtasty-countdown-elm-text{font-stretch:normal;font-style:normal;font-weight:700;letter-spacing:normal;line-height:normal;text-align:center}.abtasty-countdown .abtasty-countdown-bottom-button a,.abtasty-countdown .abtasty-countdown-finish-button a{cursor:pointer;display:block;display:inline-block;padding:6px 10px;text-align:center;text-decoration:none}.abtasty-countdown-layout-line>div{-webkit-box-align:center;-ms-flex-align:center;-webkit-box-pack:stretch;-ms-flex-pack:stretch;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:stretch}.abtasty-countdown-layout-line>div>div{-webkit-box-flex:1;-ms-flex-positive:1;flex-grow:1}.abtasty-countdown-layout-free{display:block;text-align:center}.abtasty-countdown-layout-line>div{margin:0}.abtasty-countdown-layout-line .abtasty-countdown-finish-text,.abtasty-countdown-layout-line .abtasty-countdown-top-message{-webkit-box-sizing:border-box;box-sizing:border-box;margin-bottom:0;padding:0 5px 0 15px}.abtasty-countdown-layout-line .abtasty-countdown-top-message p{margin-bottom:0}.abtasty-countdown-layout-line .abtasty-countdown-bottom-button a{margin-left:30px}.abtasty-countdown-layout-line{-webkit-box-sizing:border-box;box-sizing:border-box}.abtasty-countdown-layout-line .abtasty-countdown-bottom-button,.abtasty-countdown-layout-line .abtasty-countdown-clock,.abtasty-countdown-layout-line .abtasty-countdown-finish-button{-ms-flex-negative:0;flex-shrink:0}.abtasty-countdown-finish-button,.abtasty-countdown-finish-text{display:none}.abtasty-countdown-endButton-show .abtasty-countdown-finish-button,.abtasty-countdown-endCountdown-show.abtasty-countdown-clock,.abtasty-countdown-endText-show .abtasty-countdown-finish-text{display:block}.abtasty-countdown-layout-line.abtasty-countdown-endButton-show .abtasty-countdown-finish-button,.abtasty-countdown-layout-line.abtasty-countdown-endCountdown-show .abtasty-countdown-clock,.abtasty-countdown-layout-line.abtasty-countdown-endText-show .abtasty-countdown-finish-text{display:table-cell}.abtasty-countdown-endButton-hide .abtasty-countdown-finish-button,.abtasty-countdown-endCountdown-hide .abtasty-countdown-clock,.abtasty-countdown-endText-hide .abtasty-countdown-finish-text,.abtasty-countdown-finish .abtasty-countdown-bottom-button,.abtasty-countdown-finish .abtasty-countdown-top-message{display:none!important}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:55%!important}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-button,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-button{width:45%!important}.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:30%!important}.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom .abtasty-countdown-clock,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-button,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-clock,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-button{width:35%!important}.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom .abtasty-countdown-finish-text,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop .abtasty-countdown-finish-text{width:65%}.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-hideCountdownAndShowTextAndButton .abtasty-countdown-layout-bannerTop,.abtasty-countdown-showText .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-showText .abtasty-countdown-layout-bannerTop,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerBottom,.abtasty-countdown-showTextAndButton .abtasty-countdown-layout-bannerTop{width:100%}.abtasty-countdown-standard .abtasty-countdown-clock>.abtasty-countdown-elm-time[data-time-end=true]+.abtasty-countdown-elm-time[data-time-end=true],.abtasty-countdown-standard .abtasty-countdown-clock>.abtasty-countdown-elm-time[data-time-end=true]:first-child{display:none}.abtasty-countdown-content-popin-inline,.abtasty-countdown-content-popin-inline .abtasty-countdown-layout-popin{max-width:inherit;min-width:-webkit-max-content;min-width:-moz-max-content;min-width:max-content}.abtasty-countdown-content-free-inline{max-width:100%}.abtasty-countdown-image-popin-layout{margin-bottom:20px}.abtasty-countdown-layout-popin{-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row}.countdown_banner_img_container{-webkit-box-pack:center;-ms-flex-pack:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;display:-webkit-box;display:-ms-flexbox;display:flex;justify-content:center;padding:0 15px}.countdown_banner_img_container img{max-height:67px;max-width:200px}.abtasty-countdown .abtasty-countdown-mini .abtasty-countdown-elm-time{border:none;margin:0;padding:0}.abtasty-countdown .abtasty-countdown-mini .abtasty-countdown-top-message{display:inline-block;white-space:unset;width:100%}.abtasty-countdown .abtasty-countdown-mini .abtasty-countdown-top-message>*{display:-webkit-inline-box;display:-ms-inline-flexbox;display:inline-flex}.abtasty-countdown-mini .abtasty-countdown-top-message>.abtasty-countdown-elm-time[data-time-end=true]+.abtasty-countdown-elm-time[data-time-end=true],:not(.abtasty-countdown-showTextAndButton) :not(.abtasty-countdown-showText) .abtasty-countdown-mini .abtasty-countdown-top-message>.abtasty-countdown-elm-time[data-time-end=true]:first-child{display:none} ${(t=>{const e=[{fontName:DATA.messageFontName,fontStyle:DATA.messageFontStyle},{fontName:DATA.numbersfontName,fontStyle:DATA.numbersfontStyle},{fontName:DATA.legendfontName,fontStyle:DATA.legendfontStyle}];for(const{fontName:n,fontStyle:o}of e)t(n,o);const{buttonsAlign:n,messageAlign:o,textColor:s,messageFontSize:i,messageFontName:a,messageFontStyle:r,numbersfontSize:c,numberstextColor:l,numbersfontName:d,numbersfontStyle:u,legendfontName:h,legendfontStyle:m,legendfontSize:g,legendtextColor:b,countdownBorderRadius:p,countdownBorderWidth:y,countdownBorderColor:w,numbersBackgroundColor:v}=DATA,f=void 0!==n&&"fill"!==n?`text-align: ${n};`:"",T=(t,e)=>t&&"inherit"!==t?`font-family:${t}_${e.match(K)?e.match(K)[1]:""};`:e||"",x=T(a,r),C=T(d,u);return`\n .abtasty-countdown-bottom-button,\n .abtasty-countdown-finish-button {\n ${f};\n }\n .abtasty-countdown-bottom-button a,\n .abtasty-countdown-finish-button a {\n width: ${"fill"===n?"100%":"auto"};\n }\n\n .abtasty-countdown .abtasty-countdown-finish-text,\n .abtasty-countdown .abtasty-countdown-top-message,\n .abtasty-countdown .abtasty-countdown-finish-text *,\n .abtasty-countdown .abtasty-countdown-top-message * {\n white-space: pre-line;\n text-align: ${o} !important;\n color: ${s};\n font-size: ${i}px;\n ${x};\n }\n\n .abtasty-countdown .abtasty-countdown-elm-number,\n .abtasty-countdown .abtasty-countdown-elm-number * {\n font-size: ${c}px;\n color: ${l};\n fill: ${l};\n -webkit-text-fill-color: ${l};\n font-weight: initial;\n ${C};\n }\n\n .abtasty-countdown .abtasty-countdown-elm-text,\n .abtasty-countdown .abtasty-countdown-elm-text * {\n ${T(h,m)};\n font-size: ${g}px;\n color: ${b};\n -webkit-text-fill-color: ${b};\n }\n\n .abtasty-countdown > div:not(.abtasty-countdown-mini) .abtasty-countdown-elm-time {\n border-radius: ${p}px;\n border: ${y}px solid ${w};\n background-color: ${v};\n }\n\n .abtasty-countdown > .abtasty-countdown-mini .abtasty-countdown-elm-time {\n font-size: ${c}px;\n color: ${l};\n fill: ${l};\n -webkit-text-fill-color: ${l};\n font-weight: initial;\n ${C};\n }`})(this.parentContainer.loadFont.bind(this.parentContainer))}`));for(const t of G){const e=this.container.querySelector(`.abtasty-countdown-${t}s`);this.timerElements[t]=e,this.digitElements[t]=e.querySelector(".abtasty-countdown-elm-number"),this.textElements[t]=e.querySelector(".abtasty-countdown-elm-text")}this.setContent(),this.setButton(),this.timeLoop=setInterval(this.setCountdown.bind(this),1e3),this.setCountdown()}catch(t){console.warn("Countdown error occurred during widget rendering:",t)}}}!async function(){l("Widget launch");const t=(()=>{const{layout:t}=DATA;let e;switch(t){case"popin":e=new H;break;case"bannerTop":case"bannerBottom":e=new z;break;case"free":e=new U;break;default:e=new O}return e})(),{response:e}=await t.init(!0),n=t.domElement.querySelector(`.${t.contentClassName}`),o=new nt({parentContainer:t});o.init(),o.insert(n,"beforeend"),e&&t.show()}()}();
|