@abtasty/nps 1.5.0 → 1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/form.js +1 -1
- package/dist/main.js +1 -1
- package/package.json +2 -2
package/dist/main.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
!function(){"use strict";function e(e,t,n,s,i,r,o){try{var a=e[r](o),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(s,i)}function t(t){return function(){var n=this,s=arguments;return new Promise(function(i,r){var o=t.apply(n,s);function a(t){e(o,i,r,a,c,"next",t)}function c(t){e(o,i,r,a,c,"throw",t)}a(void 0)})}}var n,s=(function(e){var t=function(e){var t,n=Object.prototype,s=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},r=i.iterator||"@@iterator",o=i.asyncIterator||"@@asyncIterator",a=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,s){var i=t&&t.prototype instanceof v?t:v,r=Object.create(i.prototype),o=new k(s||[]);return r._invoke=function(e,t,n){var s=u;return function(i,r){if(s===m)throw new Error("Generator is already running");if(s===g){if("throw"===i)throw r;return L()}for(n.method=i,n.arg=r;;){var o=n.delegate;if(o){var a=T(o,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(s===u)throw s=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);s=m;var c=h(e,t,n);if("normal"===c.type){if(s=n.done?g:d,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(s=g,n.method="throw",n.arg=c.arg)}}}(e,n,o),r}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u="suspendedStart",d="suspendedYield",m="executing",g="completed",p={};function v(){}function f(){}function y(){}var b={};c(b,r,function(){return this});var w=Object.getPrototypeOf,C=w&&w(w(A([])));C&&C!==n&&s.call(C,r)&&(b=C);var E=y.prototype=v.prototype=Object.create(b);function S(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function $(e,t){function n(i,r,o,a){var c=h(e[i],e,r);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&s.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,o,a)},function(e){n("throw",e,o,a)}):t.resolve(u).then(function(e){l.value=e,o(l)},function(e){return n("throw",e,o,a)})}a(c.arg)}var i;this._invoke=function(e,s){function r(){return new t(function(t,i){n(e,s,t,i)})}return i=i?i.then(r,r):r()}}function T(e,n){var s=e.iterator[n.method];if(s===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=h(s,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,p;var r=i.arg;return r?r.done?(n[e.resultName]=r.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function A(e){if(e){var n=e[r];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function n(){for(;++i<e.length;)if(s.call(e,i))return n.value=e[i],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:L}}function L(){return{value:t,done:!0}}return f.prototype=y,c(E,"constructor",y),c(y,"constructor",f),f.displayName=c(y,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,a,"GeneratorFunction")),e.prototype=Object.create(E),e},e.awrap=function(e){return{__await:e}},S($.prototype),c($.prototype,o,function(){return this}),e.AsyncIterator=$,e.async=function(t,n,s,i,r){void 0===r&&(r=Promise);var o=new $(l(t,n,s,i),r);return e.isGeneratorFunction(n)?o:o.next().then(function(e){return e.done?e.value:o.next()})},S(E),c(E,a,"Generator"),c(E,r,function(){return this}),c(E,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var s=t.pop();if(s in e)return n.value=s,n.done=!1,n}return n.done=!0,n}},e.values=A,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&s.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function i(s,i){return a.type="throw",a.arg=e,n.next=s,i&&(n.method="next",n.arg=t),!!i}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return i("end");if(o.tryLoc<=this.prev){var c=s.call(o,"catchLoc"),l=s.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return i(o.catchLoc,!0);if(this.prev<o.finallyLoc)return i(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return i(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return i(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&s.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var r=i;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=e,o.arg=t,r?(this.method="next",this.next=r.finallyLoc,p):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var s=n.completion;if("throw"===s.type){var i=s.arg;x(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,s){return this.delegate={iterator:A(e),resultName:n,nextLoc:s},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(n={exports:{}}),n.exports);const i=()=>Object.prototype.hasOwnProperty.call(window,"ABTastyEditor"),r=()=>{let e;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S&&window.ABTASTY_S.USER&&window.ABTASTY_S.USER.accountIdentifier&&window.ABTASTY_S.USER.accountIdentifier.length?e=window.ABTASTY_S.USER.accountIdentifier:window.ABTasty&&window.ABTasty.getAccountSettings&&"function"==typeof window.ABTasty.getAccountSettings?e=window.ABTasty.getAccountSettings().identifier:window.ABTasty&&window.ABTasty.accountSettings&&(e=window.ABTasty.accountSettings.identifier),e):e},o=()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t},a=()=>!i()&&(o()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),c=()=>window.ABTasty&&!0===window.ABTasty.consentReady,l="remove",h="rebuild",u="https://api-social-proof.abtasty.com/clients/",d=()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`},m=()=>{const e=d();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")},g=()=>`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,p=e=>{if((()=>{if(i()||o())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})()){const t=m();window.console.log(`%c${t} - QA Mode for campaign ${TEST_ID}\n${e}`,"background-color: rgba(0, 127, 145, 1); color: rgba(247, 247, 247, 1)")}},v=e=>{const t={promise:null,resolve:null,reject:null,name:e};return t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),t},f=(e,t)=>{const n=()=>{try{return document.querySelector(e)}catch(e){return null}};let s=n();const i=[document.body||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],r=()=>a.disconnect(),o=()=>a.observe(...i),a=new MutationObserver(()=>(s=n(),s&&!r()&&t(s)));return s?setTimeout(()=>t(s),0):o(),{selector:e,clear:r,observe:o}};function y(e,t){return t(e)||!e.parentElement?e:y(e.parentElement,t)}const b=e=>{i()||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())},w=(e,t)=>[...document.querySelectorAll(t)].some(n=>n.isSameNode(e)||!!e.closest(t));class C{constructor(){this.targets=[],this.existingTargets=[],this.inViewportTargets=[],this.visibilityObserver=this.startVisibilityObserver(),this.mutationObserver=this.startMutationObserver(),this.mouseOverEvent=this.mouseOverHandler()}intersectionHandler(e){e.forEach(e=>{e.isIntersecting?(this.existingTargets.forEach(t=>{t.element.isSameNode(e.target)&&(this.inViewportTargets.push(t),this.mouseOverEvent.start())}),this.checkElements()):this.inViewportTargets=this.inViewportTargets.filter(t=>!t.element.isSameNode(e.target)||(this.mouseOverEvent.clear(),!1))})}startVisibilityObserver(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:0})}startMutationObserver(){const e=this.mutationObserver||new MutationObserver(this.checkElements.bind(this));return document.body&&e.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),e}onMouseOver({target:e,path:t}){const n=this.inViewportTargets.find(({element:n,selector:s})=>{if(n.isSameNode(e))return!0;const i=[...e.querySelectorAll(s)];if(i.length&&i.includes(n))return!0;if(t.includes(n))return!0;const r=[...e.parentElement.children],o=r.findIndex(t=>t.isSameNode(e)),a=r.filter((e,t)=>t>o);if(a.length){if(a.includes(n))return!0;if(a.some(e=>[...e.querySelectorAll(s)].includes(n)))return!0}return!1});if(n&&this.isElementVisible(n.element)){const{selector:e,element:t,uniqueId:s}=n,i=this.targets.find(t=>t.selector===e&&t.uniqueId===s);i&&i.resolve(t),this.clear(e,s)}}mouseOverHandler(){const e=["mouseover",e=>setTimeout(()=>this.onMouseOver(e),50),!0];return{start:()=>document.addEventListener(...e),clear:()=>document.removeEventListener(...e)}}isElementVisible(e){return this.isElementTopmost(e)&&this.isElementOpaque(e)}isElementOpaque(e){return"HTML"===y(e,e=>"0"===window.getComputedStyle(e).opacity).nodeName}isElementTopmost(e){const t=e.getBoundingClientRect(),n=[[t.left,t.top],[t.right,t.top],[t.left,t.bottom],[t.right,t.bottom],[t.left+t.width/2,t.top],[t.left+t.width/2,t.bottom],[t.left,t.height/2],[t.right,t.height/2],[t.left+t.left/2,t.height/2]];let s=!1,i=0;for(;!s&&i<n.length;){const t=document.elementFromPoint(...n[i]);s=e===t||e.contains(t),i+=1}return s}checkElements(){this.targets.forEach(({selector:e,uniqueId:t})=>{const n=document.querySelector(e);n&&!this.existingTargets.find(n=>n.element.matches(e)&&n.uniqueId===t)&&(this.existingTargets.push({element:n,selector:e,uniqueId:t}),this.visibilityObserver.observe(n))}),this.existingTargets=this.existingTargets.filter(({selector:e,element:t})=>!!document.querySelector(e)||(t&&this.visibilityObserver.unobserve(t),!1)),this.inViewportTargets=this.inViewportTargets.filter(({selector:e,element:t,uniqueId:n})=>{if(t.matches(e)&&this.isElementVisible(t)){const s=this.targets.find(t=>t.selector===e&&t.uniqueId===n);return s&&s.resolve(t),this.clear(e,n),!1}return!0})}watch(e,t,n){this.targets.push({selector:e,resolve:t,uniqueId:n});const s=()=>{this.startMutationObserver(),this.checkElements()};document.body?s():f("body",s)}clear(e,t){[this.targets,this.existingTargets,this.inViewportTargets]=[this.targets,this.existingTargets,this.inViewportTargets].map(n=>n.filter(({selector:n,uniqueId:s})=>n!==e&&s!==t));const n=document.querySelector(e);n&&this.visibilityObserver.unobserve(n),0===this.targets.length&&this.mutationObserver.disconnect(),0===this.inViewportTargets.length&&this.mouseOverEvent.clear()}}class E{constructor({triggerEvent:e,triggerSelector:t,triggerDelay:n}){this.event=e,this.selector=t&&t.length?t:"body",this.delay=1e3*n,this.elementsSelectors=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.visibilityObservers=[],this.elementsWaiters=[]}async onElementVisible({promise:e,resolve:t}){const n=v(`${this.event}DomReady`);this.promises.push(n);const s=await this.onPageLoad(n),i=await async function(){let e;return e=await("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||new Promise((e,t)=>{const n=window.document.getElementsByTagName("script")[0],s=window.document.createElement("script");s.src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver",n.parentNode.insertBefore(s,n),s.onload=e,s.onerror=t})),e}(),r=new C;if(this.visibilityObservers.push(r),i&&s){const e=g();r.watch(this.selector,t,e)}return e}onPageLoad({promise:e,resolve:t}){const n=()=>"complete"===document.readyState;if(!n()){const s=["readystatechange",({isTrusted:e})=>e&&n()&&t(!0),{passive:!0}];return this.eventsListeners.push([document,...s]),document.addEventListener(...s),e}return t(!0),e}onClick({promise:e,resolve:t}){const n=document.createElement("style");n.type="text/css",n.id=`Click_${g()}`,n.innerHTML=`${this.selector} {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}`,document.head.appendChild(n),this.elementsSelectors.push(`#${n.id}`);const s=["click",({isTrusted:e,target:n})=>e&&w(n,this.selector)&&t(!0),{passive:!0,capture:!0}];return this.eventsListeners.push([document,...s]),document.addEventListener(...s),e}onHover({promise:e,resolve:t}){const n=["mouseenter",({isTrusted:e,target:n})=>e&&w(n,this.selector)&&t(!0),{passive:!0,capture:!0}];return this.eventsListeners.push([document.documentElement,...n]),document.documentElement.addEventListener(...n),e}onExitIntent({promise:e,resolve:t}){const n=["mouseleave",({isTrusted:e,clientY:n})=>{e&&n<=0&&t(!0)},{passive:!0}],s=f("body",e=>{this.eventsListeners.push([e,...n]),e.addEventListener(...n),this.elementsWaiters=this.elementsWaiters.filter(e=>e!==s)});return this.elementsWaiters.push(s),e}onReengage({promise:e,resolve:t}){const n=this.delay;let s=n;const i=[({isTrusted:e})=>{e&&(s=n)},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(e=>{this.eventsListeners.push([document,e,...i]),document.addEventListener(e,...i)});const r=setInterval(()=>{s<=0?t(!0):s-=100},100);return this.intervals.push(r),e}onCustomTrigger({promise:e,resolve:t}){const{triggerEventCustomScript:n}=DATA;return new Function(`return new Promise(async resolve => {${n}})`)().then(e=>e&&t(!0)),e}onScrollUp({promise:e,resolve:t}){let n=0;const s=["scroll",({isTrusted:e})=>{e&&(window.pageYOffset<n?t(!0):n=window.pageYOffset)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...s]),document.addEventListener(...s),e}onScrollPercentReached({promise:e,resolve:t}){const{triggerEventScrollPercent:n}=DATA,s=["scroll",({isTrusted:e})=>{if(!e)return;const s=(()=>{const{documentElement:e,body:t}=document,n=e.scrollTop||t.scrollTop,s=e.scrollHeight||t.scrollHeight;return Math.trunc(n/(s-e.clientHeight)*100,10)})();n<s&&t(!0)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...s]),document.addEventListener(...s),e}getSocialProofPurchases({promise:e,resolve:t}){const n=window.ABTastyProductKey,s=r(),{viewInterval:i,triggerSocialProofMinPurchases:o,spNoTrim:a}=DATA;return n||(p("Not able to find ABTastyProductKey, impossible to call the API."),t(!1)),n&&s?fetch(`${u}${s}/metrics/i?key=${n}${a?"&noTrim=true":""}`).then(e=>e.ok&&e.json()).then(e=>(e=>{if(void 0===i||void 0===o)return!1;const t=void 0!==e[i]&&e[i]>=o;return t||p(`Widget will not be shown, product has been purchased ${e[i]} times while ${o} are required`),t})(e)&&t(`${e[i]}`)).catch(()=>p("Failed to fetch datas from server.")):t(!1),e}getSocialProofPageViews({promise:e,resolve:t}){const{viewInterval:n,triggerSocialProofMinPageViews:s,spNoTrim:i}=DATA,o=encodeURIComponent(i?window.location.href.replace(window.location.origin,""):`${window.location.pathname}`),a=r();return o&&a?fetch(`${u}${a}/metrics/pv?key=${o}${i?"&noTrim=true":""}`).then(e=>e.ok&&e.json()).then(e=>(e=>{if(void 0===n||void 0===s)return!1;const t=void 0!==e[n]&&e[n]>=s;return t||p(`Widget will not be shown, page has been seen ${e[n]} times while ${s} are required`),t})(e)&&t(`${e[n]}`)).catch(()=>p("Failed to fetch datas from server.")):t(!1),e}onConsent({promise:e,resolve:t}){if(!c()){const n=["abtasty_consentValid",()=>t(!0)];return this.eventsListeners.push(n),window.addEventListener(...n),e}return t(!0),e}onTrackingSent({promise:e,resolve:t}){const{triggerEventTrackingSent:n}=DATA;let s=localStorage.getItem("ABTastyData");const i=()=>JSON.parse(s).ActionTracking.find(({name:e})=>e===n),r=["storage",()=>{s=localStorage.getItem("ABTastyData"),i()&&t(!0)},{passive:!0,capture:!0}];return s&&i()?t(!0):(()=>{this.eventsListeners.push([window,...r]),window.addEventListener(...r)})(),e}onMinPagesViewed({promise:e,resolve:t}){const{triggerEventMinPagesViewed:n}=DATA;let s=localStorage.getItem("ABTastyData");const i=()=>n<=(s?JSON.parse(s).VisitedPages.length:0),r=["storage",()=>{s=localStorage.getItem("ABTastyData"),i()&&t(!0)},{passive:!0,capture:!0}];return s&&i()?t(!0):(()=>{this.eventsListeners.push([window,...r]),window.addEventListener(...r)})(),e}onRageClick({promise:e,resolve:t}){const{triggerEventRageClickQuantity:n,triggerEventRageClickDelay:s}=DATA;let i=0,r=!1;const o=["click",({isTrusted:e})=>{e&&(i+=1,i>=n&&t(!0),r||(r=!0,setTimeout(()=>{i=0,r=!1},s)))},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),e}clear(){if(this.elementsSelectors.length&&(this.elementsSelectors.forEach(e=>{document.querySelector(e)&&document.querySelector(e).remove()}),this.elementsSelectors=[]),this.eventsListeners.length&&(this.eventsListeners.forEach(e=>{const[t,...n]=e;t&&n.length>1&&t.removeEventListener(...n)}),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(e=>clearTimeout(e)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(e=>clearInterval(e)),this.intervals=[]),this.observers.length&&(this.observers.forEach(e=>e.disconnect()),this.observers=[]),this.visibilityObservers.length){const e=g();this.visibilityObservers.forEach(t=>t.clear(this.selector,e)),this.visibilityObservers=[]}return this.promises.length&&(this.promises.forEach(e=>e.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[]),this}async isTriggered(){this.clear();const e=v(this.event);this.promises.push(e);const t={consent:()=>this.onConsent(e),direct:()=>!0,pageLoad:()=>this.onPageLoad(e),click:()=>this.onClick(e),exitIntent:()=>this.onExitIntent(e),reengage:()=>this.onReengage(e),elementVisible:()=>this.onElementVisible(e),script:()=>this.onCustomTrigger(e),hover:()=>this.onHover(e),scrollUp:()=>this.onScrollUp(e),scrollPercent:()=>this.onScrollPercentReached(e),rageClick:()=>this.onRageClick(e),minPagesViewed:()=>this.onMinPagesViewed(e),trackingSent:()=>this.onTrackingSent(e),socialProofPurchases:()=>this.getSocialProofPurchases(e),socialProofPageViews:()=>this.getSocialProofPageViews(e)},n=!Object.prototype.hasOwnProperty.call(t,this.event)||await t[this.event]();return this.clear(),"reengage"!==this.event&&this.delay?n&&await(async()=>{const e=v(`${this.event}Delay`);return this.promises.push(e),setTimeout(()=>{e.resolve(!0),this.clear()},this.delay),e.promise})():n}}const S="closing",$="validation",T="ABTastyWidgets",N="ABTastyWidgetsTemporary";class x{constructor({displayRecurrence:e,closingRecurrence:t,validationRecurrence:n},s){this.displayRecurrence=parseFloat(e),this.closingRecurrence=parseFloat(t),this.validationRecurrence=parseFloat(n),this.onSetCallback=s,this.widgetName=d(),this.uniqueId=g(),this.recurrenceKey=`${this.widgetName}_${this.uniqueId}`,this.isListeningStorageEvent=this.listenStorageEvent(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}onStorage({key:e}){const t=localStorage.getItem(N),n=sessionStorage.getItem(T);"ABTastyData"===e&&!t&&n&&localStorage.setItem(N,n)}listenStorageEvent(){return this.isListeningStorageEvent||window.addEventListener("storage",this.onStorage.bind(this)),!0}getGivenRecurrenceStorageParsed(e){try{const t=e.getItem(T);return JSON.parse(t)}catch(t){return e.removeItem(T),!1}}getSessionRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}getLocalRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}removeGivenStorage(e,t){const{[this.recurrenceKey]:n,...s}=t;return Object.entries(s).length?(e.setItem(T,JSON.stringify(s)),s):(e.removeItem(T),!1)}removeSessionRecurrenceStorage(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.sessionStorage,e)}removeLocalRecurrenceStorage(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.localStorage,e)}getSessionRecurrence(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getLocalRecurrence(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getCurrentRecurrence(){if(this.pendingRecurrence)return this.pendingRecurrenceValue;const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();return e||t||{type:!1}}isOver(){const e=localStorage.getItem(N),t=!(!e||!e.includes(this.recurrenceKey))||this.getSessionRecurrence();e&&(sessionStorage.setItem(T,e),localStorage.removeItem(N));const n=this.getLocalRecurrence(),s=(n?parseFloat(n.stamp):0)<(new Date).getTime();return s&&this.removeLocalRecurrenceStorage(),!this.pendingRecurrence&&s&&!this.getLocalRecurrence()&&!t}setRecurrence(e,t){0!==e&&(window.removeEventListener("storage",this.onStorage.bind(this)),this.isListeningStorageEvent=!1);const n=this.getTypeOfStorage(e);if(o()||!n&&"object"!=typeof n)return!1;const{storageString:s,storageMethod:i}=n,r=this.getStamp(e),a={type:t,stamp:r},{type:l}=this.getCurrentRecurrence(),h=async()=>{if(!c()){this.pendingRecurrence=!0,this.pendingRecurrenceValue=a;const e=new E({triggerEvent:"consent"});await e.isTriggered(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();let n;"session"===s?e?n=this.removeSessionRecurrenceStorage():(this.removeLocalRecurrenceStorage(),n=this.getSessionRecurrenceStorageParsed()):"local"===s&&(t?n=this.removeLocalRecurrenceStorage():(this.removeSessionRecurrenceStorage(),n=this.getLocalRecurrenceStorageParsed()));const r=n?{[this.recurrenceKey]:a,...n}:{[this.recurrenceKey]:a};i.setItem(T,JSON.stringify(r)),this.onSetCallback&&"function"==typeof this.onSetCallback&&this.onSetCallback()};if(!i)return!1;if(l&&t!==$)if(t===S&&l!==$)h();else{if("display"!==t||l===$||l===S)return!1;h()}else h();return r}setDisplayRecurrence(){this.setRecurrence(this.displayRecurrence,"display")}setClosingRecurrence(){this.setRecurrence(this.closingRecurrence,"closing")}setValidationRecurrence(){this.setRecurrence(this.validationRecurrence,"validation")}getStamp(e){return(new Date).getTime()+864e5*e}getTypeOfStorage(e){return!(isNaN(e)||e<0||0!==e&&!e)&&(e>0?{storageString:"local",storageMethod:window.localStorage}:0===e&&{storageString:"session",storageMethod:window.sessionStorage})}}class k{constructor(e,t,n){this.recurrence=e,this.isWidgetApplied=t,this.callback=n,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=["abtasty_resetActionTracking",this.eventHandler.bind(this),{passive:!0}],this.elementsWaiters=[]}recurrenceIsDone(){return!this.recurrence||this.recurrence.isOver()}decisionHandler(e){const t=a(),{type:n}=this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1};let s;const i=this.isWidgetApplied(),r=(()=>{const t=this.recurrenceIsDone();return e&&"display"===n||t})();return!i&&t&&r?s=h:(i&&(!t||!r)||!i&&!t)&&(s=l),"string"==typeof s&&(this.clearWatcher(),this.callback(s,e),this.watch()),this}eventHandler(){let e=a();return[250,500].forEach(t=>{setTimeout(()=>{const n=a();return 500===t&&n===e?this:(e=n,this.decisionHandler(!1))},t)}),this}observerHandler(e){return e.some(e=>["removedNodes","addedNodes"].some(t=>e[t]&&e[t].length))?this.decisionHandler(!0):this}watch(){if(i())return this;this.clearWatcher(),document.addEventListener(...this.eventListenerParams);const e=()=>{const e=[document.body,{childList:!0,subtree:!0}];this.observer.observe(...e)};return document.body?e():(()=>{const t=f("body",()=>{e(),this.elementsWaiters=this.elementsWaiters.filter(e=>e!==t)});this.elementsWaiters.push(t)})(),this}clearWatcher(){return document.removeEventListener(...this.eventListenerParams),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[]),this.observer.disconnect(),this}}const A=/.+\/([^.]+)\.(otf|ttf)$/;class L{constructor(){this.children=void 0,this.uniqueId=g(),this.widgetName=d(),this.prettyName=m(),this.recurrenceParams=(()=>{const{displayRecurrence:e,closingRecurrence:t,validationRecurrence:n}=DATA;if(i()||!e&&!t&&!n)return!1;const s={everytime:()=>-1,session:()=>0,once:()=>395,day:e=>DATA[`${e}_day`],week:e=>7*DATA[`${e}_week`],month:e=>30.5*DATA[`${e}_month`]},r={};return e&&(r.displayRecurrence=s[e]("displayRecurrence")),t&&(r.closingRecurrence=s[t]("closingRecurrence")),n&&(r.validationRecurrence=s[n]("validationRecurrence")),r})(),this.triggerParams=(()=>{let{triggerEvent:e}=DATA;const{triggerEventClick:t,triggerEventHover:n,triggerEventReengageDelay:s,socialProofContentType:r,triggerEventElementVisible:o,triggerEventDelay:a}=DATA;if(i()||!e&&!r)return!1;const c={click:()=>t,hover:()=>n,elementVisible:()=>o},l=Object.prototype.hasOwnProperty.call(c,e)?c[e]():"body",h="reengage"===e?s:a;return r&&(e=1===r?"socialProofPurchases":"socialProofPageViews"),{triggerEvent:e,triggerSelector:l,triggerDelay:h}})(),this.recurrence=!!this.recurrenceParams&&new x(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new E(this.triggerParams),this.pageWatcher=new k(this.recurrence,this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=(()=>{const{isOncePerPageTrigger:e,triggerEvent:t}=DATA;return!t||!["click","hover","scrollUp","script"].includes(t)||e})(),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.domElement=this.getDom(),this.hasBeenShown=!1,this.closedByUser=!1,this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.elementsWaiters=[]}clearGivenClearables(){this.eventsListeners.length&&(this.eventsListeners.forEach(e=>document.removeEventListener(...e)),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(e=>clearTimeout(e)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(e=>clearInterval(e)),this.intervals=[]),this.observers.length&&(this.observers.forEach(e=>e.disconnect()),this.observers=[]),this.promises.length&&(this.promises.forEach(e=>e.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[])}isWidgetApplied(){return this.domElement&&this.domElement.isConnected}removeOldDomElement(){const e=document.getElementById(this.widgetContainerId);return e&&e.remove(),this}async insert(){if(this.isWidgetApplied())return!1;const e=new Promise(e=>{const t=f("head",t=>{this.elementsWaiters=this.elementsWaiters.filter(({selector:e})=>"head"!==e),e(t.appendChild(this.styleElement))});this.elementsWaiters.push(t)}),t=new Promise(e=>{const{elementReferrer:t="body",referrerInsertType:n="beforeend"}="free"===DATA.layout?DATA:{},s=f(t,s=>{this.elementsWaiters=this.elementsWaiters.filter(e=>e.selector!==t),this.removeOldDomElement(),e(s.insertAdjacentElement(n,this.domElement))});this.elementsWaiters.push(s)});return Promise.all([t,e]).then(()=>this)}remove(){return this.pageWatcher.clearWatcher(),[this.domElement,this.styleElement].forEach(e=>e&&e.isConnected&&e.remove()),this.hasOncePerPageTrigger?this.pageWatcher.watch():i()||this.init().then(({response:e})=>e?this.show():this),this}show(){return i()||this.hasBeenShown&&this.hasOncePerPageTrigger||window.ABTastyEvent(`${this.prettyName} displayed`,null,TEST_ID),this.closedByUser=!1,setTimeout(()=>this.domElement.classList.remove(this.hideClassName),50),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,this.pageWatcher.watch(),this}hide(){return!i()&&this.hasBeenShown&&window.ABTastyEvent(`${this.prettyName} closed`,null,TEST_ID),this.closedByUser=!0,this.domElement.classList.add(this.hideClassName),this}async init(e){const t=i(),n=a(),s=this.trigger&&this.trigger.promises.length,r=!this.recurrence||this.recurrence.isOver();if(!t&&!n||s||!r)return!1;this.pageWatcher.watch();const o=t||!this.trigger||this.trigger&&await this.trigger.isTriggered();return!!o&&(await this.insert(),this.addCloseEvent(),t||e||this.hasBeenShown||void 0===this.children||"function"!=typeof this.children.refreshContent||this.children.refreshContent(o),{container:this,response:o})}onPageChange(e,t){const n=()=>this.init().then(({response:e})=>e&&this.show());t||(this.hasBeenShown=!1);const s=this.isWidgetApplied(),i={[l]:()=>{s?this.remove():(this.trigger&&this.trigger.clear(),this.pageWatcher.watch())},[h]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch():s||this.insert().then(e=>e.show()).catch(this.pageWatcher.watch):n()}};"function"==typeof i[e]&&i[e]()}addCloseEvent(...e){const{closeButton:t,overlay:n,overlayClickable:s,layout:r,animationDuration:o=1e3}=DATA,a=[];if(void 0!==n&&!0!==n||!0!==s||"popin"!==r||a.push(`.${this.overlayClassName}`),void 0!==t&&t&&a.push(`.${this.closeButtonClassName}`),!a.length)return this;const c=this.domElement.querySelectorAll(a.join(", "));return c.length?(e.push(...c),e.forEach(e=>{i()&&(e.dataset.abtastyActionnable="true"),e.addEventListener("click",e=>{b(e),this.recurrence&&this.recurrence.setClosingRecurrence(),this.hide(),setTimeout(()=>this.remove(),1.05*o)},{once:!0,capture:!0})}),this):this}getDom(){const{closeButton:e,layout:t,overlay:n=!0}=DATA,s=document.createElement("div");return s.className=`${this.basicClassName} ${this.hideClassName}`,s.id=this.widgetContainerId,s.innerHTML=`\n\t\t\t${"popin"===t&&!0===n?`<div class="${this.overlayClassName}"></div>`:""}\n\t\t\t<div class="${this.contentClassName}">\n\t\t\t${e?`<button class="${this.closeButtonClassName}"><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(e,t){if(!e||"inherit"===e)return;const n=document.createElement("style"),s=t.match(A)?t.match(A)[1]:"";n.innerHTML=`@font-face { font-family: '${e}_${s}'; src: url('${t}');}`,document.head.appendChild(n)}getStyleTag(e="",t=DATA){const{noStyles:n,layout:s}=t,{backgroundColor:r,isBackgroundImage:o,backgroundImage:a,backgroundSize:c,backgroundPosition:l,backgroundRepeat:h,borderColor:u,borderRadius:d,borderWidth:m,textColor:g,textAlign:p,fontName:v,fontStyle:f,fontSize:y,isTitle:b,titleTextAlign:w,titleTextColor:C,titleFontName:E,titleFontStyle:S,titleFontSize:$,overlay:T,overlayColor:N,dropShadow:x,dropShadowColor:k,dropShadowBlur:L,containerMargin:P,containerPadding:I,closeButton:O,closeButtonPosition:R,closeButtonSize:B,closeButtonBorderRadius:_,closeButtonBorderWidth:D,closeButtonBorderColor:j,closeButtonColor:W,closeButtonBackgroundColor:F,buttonsBorderWidth:q,buttonsBorderColor:V,buttonsBorderRadius:M,buttonsBackgroundColor:H,buttonsTextColor:z,buttonsFontName:Y,buttonsFontStyle:G,buttonsFontSize:U,animation:Q,animationDuration:K,animationBehaviour:J,animationSlideDirection:X}=n?{}:t,Z=document.createElement("style");Z.type="text/css",i()&&Z.setAttribute("abtasty-script-added","true"),this.loadFont(v,f),this.loadFont(E,S),this.loadFont(Y,G);const ee=`background: ${["string"==typeof r?r:"rgba(255, 255, 255, 1)",o&&"string"==typeof a&&a.length?`url(${a})`:"",o&&"string"==typeof l&&"100% 100%"!==c?l:"0 0",o&&"string"==typeof c?`/ ${c}`:"/ auto",o&&h&&!["cover","100% 100%"].includes(c)?"repeat":"no-repeat"].join(" ").trim()};`,te="number"==typeof m&&m>0,ne=`border: ${[te?`${m}px`:"unset",te?"solid":"",te&&"string"==typeof u&&u.length?u:""].join(" ").trim()};`,se=void 0!==d?`border-radius: ${d}px;`:"",ie=void 0!==g?`color: ${g}; fill: ${g}; -webkit-text-fill-color: ${g};`:"",re=void 0!==p?`text-align: ${p};`:"",oe=v&&"inherit"!==v?`font-family:${v}_${f.match(A)?f.match(A)[1]:""};`:f||"",ae=y?`font-size: ${y}px;`:"",ce=void 0!==x&&x?`box-shadow: 0 5px ${L}px 0 ${k};`:"",le=P instanceof Array&&1===P.length&&P[0],he=le?`margin: ${le.top}px ${le.right}px ${le.bottom}px ${le.left}px;`:"",ue=le?`margin: calc(${le.top}px * 0.5) calc(${le.right}px * 0.5) calc(${le.bottom}px * 0.5) calc(${le.left}px * 0.5);`:"",de=I instanceof Array&&1===I.length&&I[0],me=de?`padding: ${de.top}px ${de.right}px ${de.bottom}px ${de.left}px;`:"",ge=de?`padding: calc(${de.top}px * 0.5) calc(${de.right}px * 0.5) calc(${de.bottom}px * 0.5) calc(${de.left}px * 0.5);`:"",pe=void 0!==q&&q?`border-width: ${q}px; border-style: solid;`:"",ve=[V,q].every(e=>void 0!==e)&&q?`border-color: ${V};`:"",fe=void 0!==M?`border-radius: ${M}px;`:"",ye=void 0!==H?`background-color: ${H};`:"",be=void 0!==z?`color: ${z}; fill: ${z}; -webkit-text-fill-color: ${z};`:"",we=Y&&"inherit"!==Y?`font-family:${Y}_${G.match(A)?G.match(A)[1]:""};`:G||"",Ce=U?`font-size: ${U}px;`:"",Ee="popin"!==s||void 0!==T&&!0!==T?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==N?N:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),Se="number"==typeof B?B:16,$e=Se/2,Te=n||void 0!==O&&O?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===R?`bottom: calc(100% + ${$e}px)`:`top: ${$e}px`)+";",`right: ${$e}px;`,"width: auto;","height: auto;","background: none;","border: none;","cursor: pointer;","outline: none;","padding: 0;","margin: 0;","line-height: 0;","z-index: 9;","number"==typeof _?`border-radius: ${_}px;`:"","number"==typeof D&&D>0?`border: ${D}px solid ${void 0!==j?j:"rgba(57, 57, 57, 1)"};`:"","string"==typeof F?`background-color: ${F};`:"","}",`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} svg {`,"pointer-events: none;",`width: ${Se}px;`,`height: ${Se}px;`,"string"==typeof W?`fill: ${W};`:"","}"].join(""):"",Ne=b&&"string"==typeof C?[`#${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: ${C}; fill: ${C}; -webkit-text-fill-color: ${C};`,void 0!==w?`text-align: ${w};`:"",E&&"inherit"!==E?`font-family:${E}_${S.match(A)?S.match(A)[1]:""};`:S||"",$?`font-size: ${$}px;`:"","}"].join(""):"";let xe="";if("string"==typeof Q){const e=(K/1e3).toFixed(2),t=["top","bottom"].includes(X),n=Number(t),s=[(["top","left"].includes(X)?"-":"")+"100vmax",this.translateValues?this.translateValues[n]:"0"];t&&s.reverse(),xe={none:[],fade:[`#${this.widgetContainerId} {`,`transition: opacity ${e}s ${J};`,"}"],slide:[`.${this.hideClassName} .${this.overlayClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} .${this.overlayClassName} {`,`transition: opacity ${e}s ${J};`,"}",`.${this.hideClassName} .${this.contentClassName} {`,`transform: translate(${s.join(", ")}) !important;`,"}",`#${this.widgetContainerId} .${this.contentClassName} {`,`transition: transform ${e}s ${J};`,"}"]}[i()&&!ABTASTY_S.WIDGETS.animationChanged?"none":Q].join("")}return Z.textContent=[`.${this.hideClassName} {`,"opacity: 0 !important;","pointer-events: none;","}",`#${this.widgetContainerId} {`,"opacity: 1;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,ee,se,ne,ie,re,ce,he,oe,ae,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,ie,re,oe,ae,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",me,oe,ae,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a, `,`#${this.widgetContainerId} .${this.contentClassName} > * button {`,"box-sizing: border-box;","display: inline-block;",pe,ve,fe,ye,be,we,Ce,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a *, `,`#${this.widgetContainerId} .${this.contentClassName} > * button * {`,be,we,Ce,"}","@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,ue,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,ge,"}","}",Ee,Te,Ne,xe,`${e}`].join(""),Z}}const P=["top: 0;","top: 50%;","bottom: 0;"],I=["left: 0;","left: 50%;","right: 0;"],O=e=>1===e?"-50%":0,R=()=>{if(Array.isArray(DATA.popinPosition)){const{popinPosition:[{x:e,y:t}]}=DATA,n=`translate(${O(t)}, ${O(e)});`;return`${P[e]}${I[t]}transform: ${n}`}return"left: 50%;top: 50%;transform: translate(-50%, -50%);"},B=()=>"autoWidth"in DATA&&!0===DATA.autoWidth,_=()=>{if(B())return"width: auto;height: auto;";const{popinPercentWidth:e,popinPixelsWidth:t,widthUnit:n,autoHeight:s,popinPercentHeight:i,popinPixelsHeight:r,heightUnit:o}=DATA;return`width: ${"px"===n?t:e}${n};height: ${s?"auto":`${"px"===o?r:i}${o}`};`};class D extends L{constructor(){super(),this.translateValues=Object.values(DATA.popinPosition[0]).map(e=>O(e)),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:e,zindexCustom:t,overlay:n}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;","top: 0;","left: 0;","width: 100%;","height: 100%;",`z-index: ${"custom"===e?t:e};`,"background: none;","pointer-events: "+(!1===n?"none":"all"),"}",`#${this.widgetContainerId} .${this.overlayClassName} {`,"position: absolute;","z-index: -1;","top: 0;","left: 0;","width: 100%;","height: 100%;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: absolute;",R(),_(),"pointer-events: all","}",`${B()?"":[`#${this.widgetContainerId} .${this.contentClassName} > div {`,"height: 100%;","overflow: auto;","box-sizing: border-box;","}"].join("")}`,`${B()?"":["@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,"max-width: 94vw;","}","}"].join("")}`].join("")}}class j extends L{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:e,zindexCustom:t}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;",`${this.position}: 0;`,"left: 0;","width: 100%;","height: auto;",`z-index: ${"custom"===e?t:e};`,"background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}class W extends L{constructor(){super(),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 F=()=>{const{layout:e}=DATA;let t;switch(e){case"popin":t=new D;break;case"bannerTop":case"bannerBottom":t=new j;break;case"free":t=new W;break;default:t=new L}return t};function q(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function V(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,s)}return n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?V(Object(n),!0).forEach(function(t){q(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):V(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}var H=DATA,z=H.isFeedBackQuestion,Y=H.isThankYouMessage,G=H.autoHide,U=H.timeHide,Q=H.stepToShow,K=H.question,J=H.feedbackQuestion,X=H.buttonText,Z=H.thankYouMessage,ee=H.isLegend,te=H.minLegend,ne=H.maxLegend,se=H.noStyles,ie={capture:!0,passive:!1},re=function(){function e(t){var n=t.parentContainer;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentContainer=n,this.baseClassName="nps_container",this.className="".concat(this.baseClassName,"_").concat(n.uniqueId),this.questionClassName="".concat(this.baseClassName,"_question"),this.notesClassName="".concat(this.baseClassName,"_notes"),this.feedbackQuestionClassName="".concat(this.questionClassName,"_feedback"),this.feedbackFormClassName="".concat(this.questionClassName,"_feedback_form"),this.notesButtonsClassName="".concat(this.notesClassName,"_button"),this.thankYouClassName="".concat(this.baseClassName,"_thanks"),this.hideClassName="nps_".concat(n.uniqueId,"_display_none"),this.currentNote=NaN,this.userFeedback="",this.npsContainer=this.getContainer(),this.questionElement=this.getQuestionElement(),this.notesContainer=this.getNotesElement(),this.feedbackElements=this.getFeedBackElements(),this.thankYouElement=this.getThankYouElement(),this.npsElement=this.getNPSElement(),this.styleElement=this.getStyleElement()}var t;return(t=[{key:"sendNote",value:function(){if(!i()&&!isNaN(this.currentNote))try{window.abtasty.send("nps",{ns:this.currentNote,nf:this.userFeedback})}catch(e){p("Not able to send NPS hit due to old tag version (< 3.0)")}return this}},{key:"insertIn",value:function(e,t){return document.head.insertAdjacentElement("beforeend",this.styleElement),e.insertAdjacentElement(t,this.npsElement),this}},{key:"complete",value:function(){var e=this;return this.sendNote(),G?(setTimeout(function(){e.parentContainer.hide(),setTimeout(function(){e.parentContainer.recurrence.setValidationRecurrence(),e.parentContainer.remove(),e.showNotes(),e.currentNote=NaN,e.userFeedback="",e.feedbackElements.feedbackFormElement.querySelector("textarea").value=""},1e3)},1e3*U),this):this}},{key:"onClickNote",value:function(e){this.currentNote=Number(e.target.dataset.note),z&&J&&J.length?this.showFeedBack():Y&&Z&&Z.length?this.showThankYouMessage():this.complete()}},{key:"onFeedbackSend",value:function(){Y&&Z&&Z.length?this.showThankYouMessage():this.complete()}},{key:"showNotes",value:function(){var e=this;return this.npsContainer.childNodes.forEach(function(t){return t.classList.add(e.hideClassName)}),[this.questionElement,this.notesContainer].forEach(function(t){return t.classList.remove(e.hideClassName)}),this}},{key:"showFeedBack",value:function(){var e=this;return this.npsContainer.childNodes.forEach(function(t){return t.classList.add(e.hideClassName)}),Object.values(this.feedbackElements).forEach(function(t){return t.classList.remove(e.hideClassName)}),this}},{key:"showThankYouMessage",value:function(){var e=this;return this.npsContainer.childNodes.forEach(function(t){return t.classList.add(e.hideClassName)}),this.thankYouElement.classList.remove(this.hideClassName),this.complete(),this}},{key:"getThankYouElement",value:function(){var e=document.createElement("p");return e.className="".concat(this.thankYouClassName," ").concat(this.hideClassName),e.innerHTML=Z,i()&&"displayThanksStep"===Q&&e.classList.remove(this.hideClassName),e}},{key:"getFeedBackElements",value:function(){var e=this,t=document.createElement("p");t.className="".concat(this.feedbackQuestionClassName," ").concat(this.hideClassName),t.innerHTML=J;var n=document.createElement("form");n.className="".concat(this.feedbackFormClassName," ").concat(this.hideClassName),n.addEventListener("submit",b,M({},ie));var s=document.createElement("textarea");s.className="".concat(this.feedbackQuestionClassName,"_textarea");var r=document.createElement("button");return r.className="".concat(this.feedbackQuestionClassName,"_button"),r.innerHTML="<span>".concat(X,"</span>"),r.addEventListener("click",function(t){return b(t),e.userFeedback=s.value,e.onFeedbackSend()},M({},ie)),i()&&"displayFeedbackStep"===Q&&[t,n].forEach(function(t){return t.classList.remove(e.hideClassName)}),n.appendChild(s),n.appendChild(r),{feedbackQuestionElement:t,feedbackFormElement:n}}},{key:"getNotesElement",value:function(){var e=this,t=document.createElement("div");t.className=this.notesClassName,i()&&"displayNoteStep"!==Q&&t.classList.add(this.hideClassName);for(var n=10;n>=0;){var s=document.createElement("button");s.className=this.notesButtonsClassName,s.dataset.note=n,i()&&s.setAttribute("data-abtasty-actionnable",""),s.innerHTML+="<span>".concat(n,"</span>"),s.addEventListener("click",function(t){b(t),e.onClickNote(t)},M({},ie)),t.insertAdjacentElement("afterbegin",s),5===n&&s.insertAdjacentHTML("afterend","<br>"),n-=1}return ee&&(t.insertAdjacentHTML("afterbegin","<legend>".concat(te,"</legend>")),t.insertAdjacentHTML("beforeend","<legend>".concat(ne,"</legend>"))),t}},{key:"getQuestionElement",value:function(){var e=document.createElement("p");return e.className=this.questionClassName,e.innerHTML=K,i()&&"displayNoteStep"!==Q&&e.classList.add(this.hideClassName),e}},{key:"getContainer",value:function(){var e=document.createElement("div");return e.className="".concat(this.baseClassName," ").concat(this.className),e}},{key:"getNPSElement",value:function(){var e=this;return this.npsContainer.appendChild(this.questionElement),this.npsContainer.appendChild(this.notesContainer),z&&Object.values(this.feedbackElements).forEach(function(t){e.npsContainer.appendChild(t)}),Y&&this.npsContainer.appendChild(this.thankYouElement),this.npsContainer}},{key:"getStyleElement",value:function(){var e=document.createElement("style");if(e.type="text/css",i()&&e.setAttribute("abtasty-script-added","true"),se)e.textContent=["#".concat(this.parentContainer.widgetContainerId," .").concat(this.className," .").concat(this.hideClassName," {"),"display: none !important;","}"].join("");else{var t=DATA,n=t.containerPadding,s=t.legendTextColor,r=t.legendFontName,o=t.legendFontStyle,a=t.legendFontSize,c=t.buttonsFontSize;this.parentContainer.loadFont(r,o);var l=/.+\/([^.]+)\.(otf|ttf)$/,h=r&&"inherit"!==r?"font-family:".concat(r,"_").concat(o.match(l)?o.match(l)[1]:"",";"):o||"",u=n instanceof Array&&1===n.length&&n[0],d="#".concat(this.parentContainer.widgetContainerId," .").concat(this.className);e.textContent=["".concat(d," .").concat(this.hideClassName," {"),"display: none !important;","}","".concat(d,","),"".concat(d," * {"),"all: unset;","box-sizing: border-box;","font-size: 10px;","line-height: normal;","font-family: sans-serif;","}","".concat(d," > * {"),"display: block;","width: 100%;","}","".concat(d," .").concat(this.notesClassName," {"),"position: relative;","display: inline-block;","width: auto;","}","".concat(d," p {"),"margin-bottom: 15px;","font-size: 1.4em;","white-space: pre-line;","}","".concat(d," button {"),"vertical-align: middle;","cursor: pointer;","text-align: center;","}","".concat(d," button span {"),"font-size: 1em;","pointer-events: none;","}","".concat(d," .").concat(this.notesClassName," button {"),"margin: 0 5px;","width: ".concat(1.75*c,"px;"),"height: ".concat(1.75*c,"px;"),"}","".concat(d," .").concat(this.feedbackFormClassName," span {"),"display: block;","padding: 6px 24px;","}",ee?["".concat(d," legend {"),"position: absolute;","text-decoration: none;","border: none;","color: ".concat(s,";"),"fill: ".concat(s,";"),"-webkit-text-fill-color: ".concat(s,";"),"font-size: ".concat(a,"px;"),h,"}","".concat(d," legend:nth-of-type(2) {"),"left: auto;","right: 0;","}"].join(""):"","".concat(d," textarea {"),"display: block;","width: 100%;","min-width: 310px;","min-height: 60px;","font-size: 1.4em;","border: 1px solid grey;","border-radius: 4px;","resize: vertical;","margin-bottom: 10px;","text-align: left;","padding: 5px;","}","".concat(d," .").concat(this.thankYouClassName," {"),"margin-bottom: 0;","}","@media screen and (min-width: 580px) {","".concat(d," {"),"min-width: 560px;","}",ee?["".concat(d," .").concat(this.notesClassName," {"),"padding-top: ".concat(1.5*a,"px"),"}","".concat(d," legend {"),"top: 0;","left: 0;","display: inline-block;","width: auto;","}"].join(""):"","".concat(d," br {"),"display: none","}","}","@media screen and (max-width: 579px) {","".concat(d," {"),"min-width: ".concat(240+(u.left+u.right/2),"px;"),"}","".concat(d," .").concat(this.notesClassName," button {"),"margin-bottom: 5px;","}","".concat(d," br {"),"display: block","}",ee?["".concat(d," .").concat(this.notesClassName," {"),"padding-bottom: 35px;","}","".concat(d," legend {"),"bottom: 0;","left: 50%;","transform: translateX(-50%)","}","".concat(d," legend:nth-of-type(1) {"),"bottom: 15px;","}","".concat(d," legend:nth-of-type(2) {"),"left: 50%;","right: unset;","}","".concat(d," legend:nth-of-type(1)::before {"),'content: "0: ";',"}","".concat(d," legend:nth-of-type(2)::before{"),'content: "10: ";',"}"].join(""):"","".concat(d," textarea {"),"min-width: auto;","}","}"].join("")}return e}}])&&function(e,t){for(var n=0;n<t.length;n++){var s=t[n];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}(e.prototype,t),e}();function oe(){return(oe=t(s.mark(function e(){var t,n,i;return s.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=F(),n=t.domElement.querySelector(".".concat(t.contentClassName)),i=new re({parentContainer:t}),t.children=i,i.insertIn(n,"beforeend"),t.init().then(function(e){return e.response&&t.show()}),e.abrupt("return",{parentContainer:t,NPS:i});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}!function(){oe.apply(this,arguments)}()}();
|
1
|
+
!function(){"use strict";function e(e,t,n,i,s,r,o){try{var a=e[r](o),c=a.value}catch(e){return void n(e)}a.done?t(c):Promise.resolve(c).then(i,s)}function t(t){return function(){var n=this,i=arguments;return new Promise(function(s,r){var o=t.apply(n,i);function a(t){e(o,s,r,a,c,"next",t)}function c(t){e(o,s,r,a,c,"throw",t)}a(void 0)})}}var n,i=(function(e){var t=function(e){var t,n=Object.prototype,i=n.hasOwnProperty,s="function"==typeof Symbol?Symbol:{},r=s.iterator||"@@iterator",o=s.asyncIterator||"@@asyncIterator",a=s.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function l(e,t,n,i){var s=t&&t.prototype instanceof v?t:v,r=Object.create(s.prototype),o=new k(i||[]);return r._invoke=function(e,t,n){var i=u;return function(s,r){if(i===m)throw new Error("Generator is already running");if(i===g){if("throw"===s)throw r;return L()}for(n.method=s,n.arg=r;;){var o=n.delegate;if(o){var a=T(o,n);if(a){if(a===p)continue;return a}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===u)throw i=g,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=h(e,t,n);if("normal"===c.type){if(i=n.done?g:d,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=g,n.method="throw",n.arg=c.arg)}}}(e,n,o),r}function h(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var u="suspendedStart",d="suspendedYield",m="executing",g="completed",p={};function v(){}function f(){}function y(){}var b={};c(b,r,function(){return this});var w=Object.getPrototypeOf,C=w&&w(w(A([])));C&&C!==n&&i.call(C,r)&&(b=C);var $=y.prototype=v.prototype=Object.create(b);function E(e){["next","throw","return"].forEach(function(t){c(e,t,function(e){return this._invoke(t,e)})})}function S(e,t){function n(s,r,o,a){var c=h(e[s],e,r);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==typeof u&&i.call(u,"__await")?t.resolve(u.__await).then(function(e){n("next",e,o,a)},function(e){n("throw",e,o,a)}):t.resolve(u).then(function(e){l.value=e,o(l)},function(e){return n("throw",e,o,a)})}a(c.arg)}var s;this._invoke=function(e,i){function r(){return new t(function(t,s){n(e,i,t,s)})}return s=s?s.then(r,r):r()}}function T(e,n){var i=e.iterator[n.method];if(i===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,T(e,n),"throw"===n.method))return p;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var s=h(i,e.iterator,n.arg);if("throw"===s.type)return n.method="throw",n.arg=s.arg,n.delegate=null,p;var r=s.arg;return r?r.done?(n[e.resultName]=r.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,p):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,p)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function x(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function A(e){if(e){var n=e[r];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var s=-1,o=function n(){for(;++s<e.length;)if(i.call(e,s))return n.value=e[s],n.done=!1,n;return n.value=t,n.done=!0,n};return o.next=o}}return{next:L}}function L(){return{value:t,done:!0}}return f.prototype=y,c($,"constructor",y),c(y,"constructor",f),f.displayName=c(y,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,y):(e.__proto__=y,c(e,a,"GeneratorFunction")),e.prototype=Object.create($),e},e.awrap=function(e){return{__await:e}},E(S.prototype),c(S.prototype,o,function(){return this}),e.AsyncIterator=S,e.async=function(t,n,i,s,r){void 0===r&&(r=Promise);var o=new S(l(t,n,i,s),r);return e.isGeneratorFunction(n)?o:o.next().then(function(e){return e.done?e.value:o.next()})},E($),c($,a,"Generator"),c($,r,function(){return this}),c($,"toString",function(){return"[object Generator]"}),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var i=t.pop();if(i in e)return n.value=i,n.done=!1,n}return n.done=!0,n}},e.values=A,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(x),!e)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function s(i,s){return a.type="throw",a.arg=e,n.next=i,s&&(n.method="next",n.arg=t),!!s}for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r],a=o.completion;if("root"===o.tryLoc)return s("end");if(o.tryLoc<=this.prev){var c=i.call(o,"catchLoc"),l=i.call(o,"finallyLoc");if(c&&l){if(this.prev<o.catchLoc)return s(o.catchLoc,!0);if(this.prev<o.finallyLoc)return s(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return s(o.catchLoc,!0)}else{if(!l)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return s(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var s=this.tryEntries[n];if(s.tryLoc<=this.prev&&i.call(s,"finallyLoc")&&this.prev<s.finallyLoc){var r=s;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc&&(r=null);var o=r?r.completion:{};return o.type=e,o.arg=t,r?(this.method="next",this.next=r.finallyLoc,p):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),x(n),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var i=n.completion;if("throw"===i.type){var s=i.arg;x(n)}return s}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,i){return this.delegate={iterator:A(e),resultName:n,nextLoc:i},"next"===this.method&&(this.arg=t),p}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}(n={exports:{}}),n.exports);const s=()=>Object.prototype.hasOwnProperty.call(window,"ABTastyEditor"),r=()=>{let e;return window.ABTasty||window.ABTASTY_S?(window.ABTASTY_S&&window.ABTASTY_S.USER&&window.ABTASTY_S.USER.accountIdentifier&&window.ABTASTY_S.USER.accountIdentifier.length?e=window.ABTASTY_S.USER.accountIdentifier:window.ABTasty&&window.ABTasty.getAccountSettings&&"function"==typeof window.ABTasty.getAccountSettings?e=window.ABTasty.getAccountSettings().identifier:window.ABTasty&&window.ABTasty.accountSettings&&(e=window.ABTasty.accountSettings.identifier),e):e},o=()=>{const e=!!document.getElementById("ABTastyPreviewBar"),t=location.href.includes("ab_project=preview");return e||t},a=()=>!s()&&(o()||!!window.ABTasty.getTestsOnPage()[TEST_ID]),c=()=>window.ABTasty&&!0===window.ABTasty.consentReady,l="remove",h="rebuild",u="https://api-social-proof.abtasty.com/clients/",d=()=>{const{type:e}=DATA;return`${PACKAGE.replace("@abtasty/","")}${e?`_${e}`:""}`},m=()=>{const e=d();return`${e.charAt(0).toUpperCase()}${e.slice(1)}`.split("-").join(" ")},g=()=>`${PLUGIN_ID.split("-")[0]}_${TEST_ID}`,p=e=>{if((()=>{if(s()||o())return!1;const e=ABTasty.getTestsOnPage()[TEST_ID];return!!e&&Object.keys(e.targetings.qaParameters).length>0})()){const t=m();window.console.log(`%c${t} - QA Mode for campaign ${TEST_ID}\n${e}`,"background-color: rgba(0, 127, 145, 1); color: rgba(247, 247, 247, 1)")}},v=e=>{const t={promise:null,resolve:null,reject:null,name:e};return t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),t},f=(e,t)=>{const n=()=>{try{return document.querySelector(e)}catch(e){return null}};let i=n();const s=[document.body||document.documentElement,{childList:!0,subtree:!0,attributes:!0}],r=()=>a.disconnect(),o=()=>a.observe(...s),a=new MutationObserver(()=>(i=n(),i&&!r()&&t(i)));return i?setTimeout(()=>t(i),0):o(),{selector:e,clear:r,observe:o}};function y(e,t){return t(e)||!e.parentElement?e:y(e.parentElement,t)}const b=e=>{s()||(e.preventDefault(),e.stopPropagation(),e.stopImmediatePropagation())},w=(e,t)=>[...document.querySelectorAll(t)].some(n=>n.isSameNode(e)||!!e.closest(t));class C{constructor(){this.targets=[],this.existingTargets=[],this.inViewportTargets=[],this.visibilityObserver=this.startVisibilityObserver(),this.mutationObserver=this.startMutationObserver(),this.mouseOverEvent=this.mouseOverHandler()}intersectionHandler(e){e.forEach(e=>{e.isIntersecting?(this.existingTargets.forEach(t=>{t.element.isSameNode(e.target)&&(this.inViewportTargets.push(t),this.mouseOverEvent.start())}),this.checkElements()):this.inViewportTargets=this.inViewportTargets.filter(t=>!t.element.isSameNode(e.target)||(this.mouseOverEvent.clear(),!1))})}startVisibilityObserver(){return new IntersectionObserver(this.intersectionHandler.bind(this),{root:null,rootMargin:"0px",threshold:0})}startMutationObserver(){const e=this.mutationObserver||new MutationObserver(this.checkElements.bind(this));return document.body&&e.observe(document.body,{attributes:!0,childList:!0,subtree:!0}),e}onMouseOver({target:e,path:t}){const n=this.inViewportTargets.find(({element:n,selector:i})=>{if(n.isSameNode(e))return!0;const s=[...e.querySelectorAll(i)];if(s.length&&s.includes(n))return!0;if(t.includes(n))return!0;const r=[...e.parentElement.children],o=r.findIndex(t=>t.isSameNode(e)),a=r.filter((e,t)=>t>o);if(a.length){if(a.includes(n))return!0;if(a.some(e=>[...e.querySelectorAll(i)].includes(n)))return!0}return!1});if(n&&this.isElementVisible(n.element)){const{selector:e,element:t,uniqueId:i}=n,s=this.targets.find(t=>t.selector===e&&t.uniqueId===i);s&&s.resolve(t),this.clear(e,i)}}mouseOverHandler(){const e=["mouseover",e=>setTimeout(()=>this.onMouseOver(e),50),!0];return{start:()=>document.addEventListener(...e),clear:()=>document.removeEventListener(...e)}}isElementVisible(e){return this.isElementTopmost(e)&&this.isElementOpaque(e)}isElementOpaque(e){return"HTML"===y(e,e=>"0"===window.getComputedStyle(e).opacity).nodeName}isElementTopmost(e){const t=e.getBoundingClientRect(),n=[[t.left,t.top],[t.right,t.top],[t.left,t.bottom],[t.right,t.bottom],[t.left+t.width/2,t.top],[t.left+t.width/2,t.bottom],[t.left,t.height/2],[t.right,t.height/2],[t.left+t.left/2,t.height/2]];let i=!1,s=0;for(;!i&&s<n.length;){const t=document.elementFromPoint(...n[s]);i=e===t||e.contains(t),s+=1}return i}checkElements(){this.targets.forEach(({selector:e,uniqueId:t})=>{const n=document.querySelector(e);n&&!this.existingTargets.find(n=>n.element.matches(e)&&n.uniqueId===t)&&(this.existingTargets.push({element:n,selector:e,uniqueId:t}),this.visibilityObserver.observe(n))}),this.existingTargets=this.existingTargets.filter(({selector:e,element:t})=>!!document.querySelector(e)||(t&&this.visibilityObserver.unobserve(t),!1)),this.inViewportTargets=this.inViewportTargets.filter(({selector:e,element:t,uniqueId:n})=>{if(t.matches(e)&&this.isElementVisible(t)){const i=this.targets.find(t=>t.selector===e&&t.uniqueId===n);return i&&i.resolve(t),this.clear(e,n),!1}return!0})}watch(e,t,n){this.targets.push({selector:e,resolve:t,uniqueId:n});const i=()=>{this.startMutationObserver(),this.checkElements()};document.body?i():f("body",i)}clear(e,t){[this.targets,this.existingTargets,this.inViewportTargets]=[this.targets,this.existingTargets,this.inViewportTargets].map(n=>n.filter(({selector:n,uniqueId:i})=>n!==e&&i!==t));const n=document.querySelector(e);n&&this.visibilityObserver.unobserve(n),0===this.targets.length&&this.mutationObserver.disconnect(),0===this.inViewportTargets.length&&this.mouseOverEvent.clear()}}class ${constructor({triggerEvent:e,triggerSelector:t,triggerDelay:n}){this.event=e,this.selector=t&&t.length?t:"body",this.delay=1e3*n,this.elementsSelectors=[],this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.visibilityObservers=[],this.elementsWaiters=[]}async onElementVisible({promise:e,resolve:t}){const n=v(`${this.event}DomReady`);this.promises.push(n);const i=await this.onPageLoad(n),s=await async function(){let e;return e=await("IntersectionObserver"in window&&"IntersectionObserverEntry"in window&&"intersectionRatio"in window.IntersectionObserverEntry.prototype||new Promise((e,t)=>{const n=window.document.getElementsByTagName("script")[0],i=window.document.createElement("script");i.src="https://polyfill.io/v3/polyfill.min.js?flags=gated&features=IntersectionObserver",n.parentNode.insertBefore(i,n),i.onload=e,i.onerror=t})),e}(),r=new C;if(this.visibilityObservers.push(r),s&&i){const e=g();r.watch(this.selector,t,e)}return e}onPageLoad({promise:e,resolve:t}){const n=()=>"complete"===document.readyState;if(!n()){const i=["readystatechange",({isTrusted:e})=>e&&n()&&t(!0),{passive:!0}];return this.eventsListeners.push([document,...i]),document.addEventListener(...i),e}return t(!0),e}onClick({promise:e,resolve:t}){const n=document.createElement("style");n.type="text/css",n.id=`Click_${g()}`,n.innerHTML=`${this.selector} {\n\t\t\tcursor: pointer !important;\n\t\t\tpointer-events: all !important;\n\t\t}`,document.head.appendChild(n),this.elementsSelectors.push(`#${n.id}`);const i=["click",({isTrusted:e,target:n})=>e&&w(n,this.selector)&&t(!0),{passive:!0,capture:!0}];return this.eventsListeners.push([document,...i]),document.addEventListener(...i),e}onHover({promise:e,resolve:t}){const n=["mouseenter",({isTrusted:e,target:n})=>e&&w(n,this.selector)&&t(!0),{passive:!0,capture:!0}];return this.eventsListeners.push([document.documentElement,...n]),document.documentElement.addEventListener(...n),e}onExitIntent({promise:e,resolve:t}){const n=["mouseleave",({isTrusted:e,clientY:n})=>{e&&n<=0&&t(!0)},{passive:!0}],i=f("body",e=>{this.eventsListeners.push([e,...n]),e.addEventListener(...n),this.elementsWaiters=this.elementsWaiters.filter(e=>e!==i)});return this.elementsWaiters.push(i),e}onReengage({promise:e,resolve:t}){const n=this.delay;let i=n;const s=[({isTrusted:e})=>{e&&(i=n)},{passive:!0}];["click","mousemove","scroll","keypress"].forEach(e=>{this.eventsListeners.push([document,e,...s]),document.addEventListener(e,...s)});const r=setInterval(()=>{i<=0?t(!0):i-=100},100);return this.intervals.push(r),e}onCustomTrigger({promise:e,resolve:t}){const{triggerEventCustomScript:n}=DATA;return new Function(`return new Promise(async resolve => {${n}})`)().then(e=>e&&t(!0)),e}onScrollUp({promise:e,resolve:t}){let n=0;const i=["scroll",({isTrusted:e})=>{e&&(window.pageYOffset<n?t(!0):n=window.pageYOffset)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...i]),document.addEventListener(...i),e}onScrollPercentReached({promise:e,resolve:t}){const{triggerEventScrollPercent:n}=DATA,i=["scroll",({isTrusted:e})=>{if(!e)return;const i=(()=>{const{documentElement:e,body:t}=document,n=e.scrollTop||t.scrollTop,i=e.scrollHeight||t.scrollHeight;return Math.trunc(n/(i-e.clientHeight)*100,10)})();n<i&&t(!0)},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...i]),document.addEventListener(...i),e}getSocialProofPurchases({promise:e,resolve:t}){const n=window.ABTastyProductKey,i=r(),{viewInterval:s,triggerSocialProofMinPurchases:o,spNoTrim:a}=DATA;return n||(p("Not able to find ABTastyProductKey, impossible to call the API."),t(!1)),n&&i?fetch(`${u}${i}/metrics/i?key=${n}${a?"&noTrim=true":""}`).then(e=>e.ok&&e.json()).then(e=>(e=>{if(void 0===s||void 0===o)return!1;const t=void 0!==e[s]&&e[s]>=o;return t||p(`Widget will not be shown, product has been purchased ${e[s]} times while ${o} are required`),t})(e)&&t(`${e[s]}`)).catch(()=>p("Failed to fetch datas from server.")):t(!1),e}getSocialProofPageViews({promise:e,resolve:t}){const{viewInterval:n,triggerSocialProofMinPageViews:i,spNoTrim:s}=DATA,o=encodeURIComponent(s?window.location.href.replace(window.location.origin,""):`${window.location.pathname}`),a=r();return o&&a?fetch(`${u}${a}/metrics/pv?key=${o}${s?"&noTrim=true":""}`).then(e=>e.ok&&e.json()).then(e=>(e=>{if(void 0===n||void 0===i)return!1;const t=void 0!==e[n]&&e[n]>=i;return t||p(`Widget will not be shown, page has been seen ${e[n]} times while ${i} are required`),t})(e)&&t(`${e[n]}`)).catch(()=>p("Failed to fetch datas from server.")):t(!1),e}onConsent({promise:e,resolve:t}){if(!c()){const n=["abtasty_consentValid",()=>t(!0)];return this.eventsListeners.push(n),window.addEventListener(...n),e}return t(!0),e}onTrackingSent({promise:e,resolve:t}){const{triggerEventTrackingSent:n}=DATA;let i=localStorage.getItem("ABTastyData");const s=()=>JSON.parse(i).ActionTracking.find(({name:e})=>e===n),r=["storage",()=>{i=localStorage.getItem("ABTastyData"),s()&&t(!0)},{passive:!0,capture:!0}];return i&&s()?t(!0):(()=>{this.eventsListeners.push([window,...r]),window.addEventListener(...r)})(),e}onMinPagesViewed({promise:e,resolve:t}){const{triggerEventMinPagesViewed:n}=DATA;let i=localStorage.getItem("ABTastyData");const s=()=>n<=(i?JSON.parse(i).VisitedPages.length:0),r=["storage",()=>{i=localStorage.getItem("ABTastyData"),s()&&t(!0)},{passive:!0,capture:!0}];return i&&s()?t(!0):(()=>{this.eventsListeners.push([window,...r]),window.addEventListener(...r)})(),e}onRageClick({promise:e,resolve:t}){const{triggerEventRageClickQuantity:n,triggerEventRageClickDelay:i}=DATA;let s=0,r=!1;const o=["click",({isTrusted:e})=>{e&&(s+=1,s>=n&&t(!0),r||(r=!0,setTimeout(()=>{s=0,r=!1},i)))},{passive:!0,capture:!0}];return this.eventsListeners.push([document,...o]),document.addEventListener(...o),e}clear(){if(this.elementsSelectors.length&&(this.elementsSelectors.forEach(e=>{document.querySelector(e)&&document.querySelector(e).remove()}),this.elementsSelectors=[]),this.eventsListeners.length&&(this.eventsListeners.forEach(e=>{const[t,...n]=e;t&&n.length>1&&t.removeEventListener(...n)}),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(e=>clearTimeout(e)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(e=>clearInterval(e)),this.intervals=[]),this.observers.length&&(this.observers.forEach(e=>e.disconnect()),this.observers=[]),this.visibilityObservers.length){const e=g();this.visibilityObservers.forEach(t=>t.clear(this.selector,e)),this.visibilityObservers=[]}return this.promises.length&&(this.promises.forEach(e=>e.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[]),this}async isTriggered(){this.clear();const e=v(this.event);this.promises.push(e);const t={consent:()=>this.onConsent(e),direct:()=>!0,pageLoad:()=>this.onPageLoad(e),click:()=>this.onClick(e),exitIntent:()=>this.onExitIntent(e),reengage:()=>this.onReengage(e),elementVisible:()=>this.onElementVisible(e),script:()=>this.onCustomTrigger(e),hover:()=>this.onHover(e),scrollUp:()=>this.onScrollUp(e),scrollPercent:()=>this.onScrollPercentReached(e),rageClick:()=>this.onRageClick(e),minPagesViewed:()=>this.onMinPagesViewed(e),trackingSent:()=>this.onTrackingSent(e),socialProofPurchases:()=>this.getSocialProofPurchases(e),socialProofPageViews:()=>this.getSocialProofPageViews(e)},n=!Object.prototype.hasOwnProperty.call(t,this.event)||await t[this.event]();return this.clear(),"reengage"!==this.event&&this.delay?n&&await(async()=>{const e=v(`${this.event}Delay`);return this.promises.push(e),setTimeout(()=>{e.resolve(!0),this.clear()},this.delay),e.promise})():n}}const E="closing",S="validation",T="ABTastyWidgets",N="ABTastyWidgetsTemporary";class x{constructor({displayRecurrence:e,closingRecurrence:t,validationRecurrence:n},i){this.displayRecurrence=parseFloat(e),this.closingRecurrence=parseFloat(t),this.validationRecurrence=parseFloat(n),this.onSetCallback=i,this.widgetName=d(),this.uniqueId=g(),this.recurrenceKey=`${this.widgetName}_${this.uniqueId}`,this.isListeningStorageEvent=this.listenStorageEvent(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}onStorage({key:e}){const t=localStorage.getItem(N),n=sessionStorage.getItem(T);"ABTastyData"===e&&!t&&n&&localStorage.setItem(N,n)}listenStorageEvent(){return this.isListeningStorageEvent||window.addEventListener("storage",this.onStorage.bind(this)),!0}getGivenRecurrenceStorageParsed(e){try{const t=e.getItem(T);return JSON.parse(t)}catch(t){return e.removeItem(T),!1}}getSessionRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.sessionStorage)}getLocalRecurrenceStorageParsed(){return this.getGivenRecurrenceStorageParsed(window.localStorage)}removeGivenStorage(e,t){const{[this.recurrenceKey]:n,...i}=t;return Object.entries(i).length?(e.setItem(T,JSON.stringify(i)),i):(e.removeItem(T),!1)}removeSessionRecurrenceStorage(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.sessionStorage,e)}removeLocalRecurrenceStorage(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&this.removeGivenStorage(window.localStorage,e)}getSessionRecurrence(){const e=this.getSessionRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getLocalRecurrence(){const e=this.getLocalRecurrenceStorageParsed();return!!e&&e[this.recurrenceKey]}getCurrentRecurrence(){if(this.pendingRecurrence)return this.pendingRecurrenceValue;const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();return e||t||{type:!1}}isOver(){const e=localStorage.getItem(N),t=!(!e||!e.includes(this.recurrenceKey))||this.getSessionRecurrence();e&&(sessionStorage.setItem(T,e),localStorage.removeItem(N));const n=this.getLocalRecurrence(),i=(n?parseFloat(n.stamp):0)<(new Date).getTime();return i&&this.removeLocalRecurrenceStorage(),!this.pendingRecurrence&&i&&!this.getLocalRecurrence()&&!t}setRecurrence(e,t){0!==e&&(window.removeEventListener("storage",this.onStorage.bind(this)),this.isListeningStorageEvent=!1);const n=this.getTypeOfStorage(e);if(o()||!n&&"object"!=typeof n)return!1;const{storageString:i,storageMethod:s}=n,r=this.getStamp(e),a={type:t,stamp:r},{type:l}=this.getCurrentRecurrence(),h=async()=>{if(!c()){this.pendingRecurrence=!0,this.pendingRecurrenceValue=a;const e=new $({triggerEvent:"consent"});await e.isTriggered(),this.pendingRecurrence=!1,this.pendingRecurrenceValue={}}const e=this.getSessionRecurrence(),t=this.getLocalRecurrence();let n;"session"===i?e?n=this.removeSessionRecurrenceStorage():(this.removeLocalRecurrenceStorage(),n=this.getSessionRecurrenceStorageParsed()):"local"===i&&(t?n=this.removeLocalRecurrenceStorage():(this.removeSessionRecurrenceStorage(),n=this.getLocalRecurrenceStorageParsed()));const r=n?{[this.recurrenceKey]:a,...n}:{[this.recurrenceKey]:a};s.setItem(T,JSON.stringify(r)),this.onSetCallback&&"function"==typeof this.onSetCallback&&this.onSetCallback()};if(!s)return!1;if(l&&t!==S)if(t===E&&l!==S)h();else{if("display"!==t||l===S||l===E)return!1;h()}else h();return r}setDisplayRecurrence(){this.setRecurrence(this.displayRecurrence,"display")}setClosingRecurrence(){this.setRecurrence(this.closingRecurrence,"closing")}setValidationRecurrence(){this.setRecurrence(this.validationRecurrence,"validation")}getStamp(e){return(new Date).getTime()+864e5*e}getTypeOfStorage(e){return!(isNaN(e)||e<0||0!==e&&!e)&&(e>0?{storageString:"local",storageMethod:window.localStorage}:0===e&&{storageString:"session",storageMethod:window.sessionStorage})}}class k{constructor(e,t,n){this.recurrence=e,this.isWidgetApplied=t,this.callback=n,this.observer=new MutationObserver(this.observerHandler.bind(this)),this.eventListenerParams=["abtasty_resetActionTracking",this.eventHandler.bind(this),{passive:!0}],this.elementsWaiters=[]}recurrenceIsDone(){return!this.recurrence||this.recurrence.isOver()}decisionHandler(e){const t=a(),{type:n}=this.recurrence?this.recurrence.getCurrentRecurrence():{type:!1};let i;const s=this.isWidgetApplied(),r=(()=>{const t=this.recurrenceIsDone();return e&&"display"===n||t})();return!s&&t&&r?i=h:(s&&(!t||!r)||!s&&!t)&&(i=l),"string"==typeof i&&(this.clearWatcher(),this.callback(i,e),this.watch()),this}eventHandler(){let e=a();return[250,500].forEach(t=>{setTimeout(()=>{const n=a();return 500===t&&n===e?this:(e=n,this.decisionHandler(!1))},t)}),this}observerHandler(e){return e.some(e=>["removedNodes","addedNodes"].some(t=>e[t]&&e[t].length))?this.decisionHandler(!0):this}watch(){if(s())return this;this.clearWatcher(),document.addEventListener(...this.eventListenerParams);const e=()=>{const e=[document.body,{childList:!0,subtree:!0}];this.observer.observe(...e)};return document.body?e():(()=>{const t=f("body",()=>{e(),this.elementsWaiters=this.elementsWaiters.filter(e=>e!==t)});this.elementsWaiters.push(t)})(),this}clearWatcher(){return document.removeEventListener(...this.eventListenerParams),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[]),this.observer.disconnect(),this}}const A=/.+\/([^.]+)\.(otf|ttf)$/;class L{constructor(){this.children=void 0,this.uniqueId=g(),this.widgetName=d(),this.prettyName=m(),this.recurrenceParams=(()=>{const{displayRecurrence:e,closingRecurrence:t,validationRecurrence:n}=DATA;if(s()||!e&&!t&&!n)return!1;const i={everytime:()=>-1,session:()=>0,once:()=>395,day:e=>DATA[`${e}_day`],week:e=>7*DATA[`${e}_week`],month:e=>30.5*DATA[`${e}_month`]},r={};return e&&(r.displayRecurrence=i[e]("displayRecurrence")),t&&(r.closingRecurrence=i[t]("closingRecurrence")),n&&(r.validationRecurrence=i[n]("validationRecurrence")),r})(),this.triggerParams=(()=>{let{triggerEvent:e}=DATA;const{triggerEventClick:t,triggerEventHover:n,triggerEventReengageDelay:i,socialProofContentType:r,triggerEventElementVisible:o,triggerEventDelay:a}=DATA;if(s()||!e&&!r)return!1;const c={click:()=>t,hover:()=>n,elementVisible:()=>o},l=Object.prototype.hasOwnProperty.call(c,e)?c[e]():"body",h="reengage"===e?i:a;return r&&(e=1===r?"socialProofPurchases":"socialProofPageViews"),{triggerEvent:e,triggerSelector:l,triggerDelay:h}})(),this.recurrence=!!this.recurrenceParams&&new x(this.recurrenceParams,this.clearGivenClearables.bind(this)),this.trigger=!!this.triggerParams&&new $(this.triggerParams),this.pageWatcher=new k(this.recurrence,this.isWidgetApplied.bind(this),this.onPageChange.bind(this)),this.hasOncePerPageTrigger=(()=>{const{isOncePerPageTrigger:e,triggerEvent:t}=DATA;return!t||!["click","hover","scrollUp","script"].includes(t)||e})(),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.domElement=this.getDom(),this.hasBeenShown=!1,this.closedByUser=!1,this.eventsListeners=[],this.timeouts=[],this.intervals=[],this.observers=[],this.promises=[],this.elementsWaiters=[]}clearGivenClearables(){this.eventsListeners.length&&(this.eventsListeners.forEach(e=>document.removeEventListener(...e)),this.eventsListeners=[]),this.timeouts.length&&(this.timeouts.forEach(e=>clearTimeout(e)),this.timeouts=[]),this.intervals.length&&(this.intervals.forEach(e=>clearInterval(e)),this.intervals=[]),this.observers.length&&(this.observers.forEach(e=>e.disconnect()),this.observers=[]),this.promises.length&&(this.promises.forEach(e=>e.resolve(!1)),this.promises=[]),this.elementsWaiters.length&&(this.elementsWaiters.forEach(e=>e.clear()),this.elementsWaiters=[])}isWidgetApplied(){return this.domElement&&this.domElement.isConnected}removeOldDomElement(){const e=document.getElementById(this.widgetContainerId);return e&&e.remove(),this}async insert(){if(this.isWidgetApplied())return!1;const e=new Promise(e=>{const t=f("head",t=>{this.elementsWaiters=this.elementsWaiters.filter(({selector:e})=>"head"!==e),e(t.appendChild(this.styleElement))});this.elementsWaiters.push(t)}),t=new Promise(e=>{const{elementReferrer:t="body",referrerInsertType:n="beforeend"}="free"===DATA.layout?DATA:{},i=f(t,i=>{this.elementsWaiters=this.elementsWaiters.filter(e=>e.selector!==t),this.removeOldDomElement(),e(i.insertAdjacentElement(n,this.domElement))});this.elementsWaiters.push(i)});return Promise.all([t,e]).then(()=>this)}remove(){return this.pageWatcher.clearWatcher(),[this.domElement,this.styleElement].forEach(e=>e&&e.isConnected&&e.remove()),this.hasOncePerPageTrigger?this.pageWatcher.watch():s()||this.init().then(({response:e})=>e?this.show():this),this}show(){return s()||this.hasBeenShown&&this.hasOncePerPageTrigger||window.ABTastyEvent(`${this.prettyName} displayed`,null,TEST_ID),this.closedByUser=!1,setTimeout(()=>this.domElement.classList.remove(this.hideClassName),50),this.recurrence&&this.recurrence.setDisplayRecurrence(),this.hasBeenShown=!0,this.pageWatcher.watch(),this}hide(){return!s()&&this.hasBeenShown&&window.ABTastyEvent(`${this.prettyName} closed`,null,TEST_ID),this.closedByUser=!0,this.domElement.classList.add(this.hideClassName),this}async init(e){const t=s(),n=a(),i=this.trigger&&this.trigger.promises.length,r=!this.recurrence||this.recurrence.isOver();if(!t&&!n||i||!r)return!1;this.pageWatcher.watch();const o=t||!this.trigger||this.trigger&&await this.trigger.isTriggered();return!!o&&(await this.insert(),this.addCloseEvent(),t||e||this.hasBeenShown||void 0===this.children||"function"!=typeof this.children.refreshContent||this.children.refreshContent(o),{container:this,response:o})}onPageChange(e,t){const n=()=>this.init().then(({response:e})=>e&&this.show());t||(this.hasBeenShown=!1);const i=this.isWidgetApplied(),s={[l]:()=>{i?this.remove():(this.trigger&&this.trigger.clear(),this.pageWatcher.watch())},[h]:()=>{this.hasBeenShown?this.closedByUser?this.pageWatcher.watch():i||this.insert().then(e=>e.show()).catch(this.pageWatcher.watch):n()}};"function"==typeof s[e]&&s[e]()}addCloseEvent(...e){const{closeButton:t,overlay:n,overlayClickable:i,layout:r,animationDuration:o=1e3}=DATA,a=[];if(void 0!==n&&!0!==n||!0!==i||"popin"!==r||a.push(`.${this.overlayClassName}`),void 0!==t&&t&&a.push(`.${this.closeButtonClassName}`),!a.length)return this;const c=this.domElement.querySelectorAll(a.join(", "));return c.length?(e.push(...c),e.forEach(e=>{s()&&(e.dataset.abtastyActionnable="true"),e.addEventListener("click",e=>{b(e),this.recurrence&&this.recurrence.setClosingRecurrence(),this.hide(),setTimeout(()=>this.remove(),1.05*o)},{once:!0,capture:!0})}),this):this}getDom(){const{closeButton:e,layout:t,overlay:n=!0}=DATA,i=document.createElement("div");return i.className=`${this.basicClassName} ${this.hideClassName}`,i.id=this.widgetContainerId,i.innerHTML=`\n\t\t\t${"popin"===t&&!0===n?`<div class="${this.overlayClassName}"></div>`:""}\n\t\t\t<div class="${this.contentClassName}">\n\t\t\t${e?`<button class="${this.closeButtonClassName}"><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(e,t){if(!e||"inherit"===e)return;const n=document.createElement("style"),i=t.match(A)?t.match(A)[1]:"";n.innerHTML=`@font-face { font-family: '${e}_${i}'; src: url('${t}');}`,document.head.appendChild(n)}getStyleTag(e="",t=DATA){const{noStyles:n,layout:i}=t,{backgroundColor:r,isBackgroundImage:o,backgroundImage:a,backgroundSize:c,backgroundPosition:l,backgroundRepeat:h,borderColor:u,borderRadius:d,borderWidth:m,textColor:g,textAlign:p,fontName:v,fontStyle:f,fontSize:y,isTitle:b,titleTextAlign:w,titleTextColor:C,titleFontName:$,titleFontStyle:E,titleFontSize:S,overlay:T,overlayColor:N,dropShadow:x,dropShadowColor:k,dropShadowBlur:L,containerMargin:P,containerPadding:I,closeButton:_,closeButtonPosition:O,closeButtonSize:B,closeButtonBorderRadius:R,closeButtonBorderWidth:D,closeButtonBorderColor:j,closeButtonColor:W,closeButtonBackgroundColor:F,buttonsAlign:q,buttonsBorderWidth:V,buttonsBorderColor:M,buttonsBorderRadius:H,buttonsBackgroundColor:z,buttonsTextColor:Y,buttonsFontName:G,buttonsFontStyle:U,buttonsFontSize:Q,secondLinkBorderWidth:K,secondLinkBorderColor:J,secondLinkBorderRadius:X,secondLinkBackgroundColor:Z,secondLinkTextColor:ee,secondLinkFontName:te,secondLinkFontStyle:ne,secondLinkFontSize:ie,animation:se,animationDuration:re,animationBehaviour:oe,animationSlideDirection:ae}=n?{}:t,ce=document.createElement("style");ce.type="text/css",s()&&ce.setAttribute("abtasty-script-added","true"),this.loadFont(v,f),this.loadFont($,E),this.loadFont(G,U),this.loadFont(te,ne);const le=`background: ${["string"==typeof r?r:"rgba(255, 255, 255, 1)",o&&"string"==typeof a&&a.length?`url(${a})`:"",o&&"string"==typeof l&&"100% 100%"!==c?l:"0 0",o&&"string"==typeof c?`/ ${c}`:"/ auto",o&&h&&!["cover","100% 100%"].includes(c)?"repeat":"no-repeat"].join(" ").trim()};`,he="number"==typeof m&&m>0,ue=`border: ${[he?`${m}px`:"unset",he?"solid":"",he&&"string"==typeof u&&u.length?u:""].join(" ").trim()};`,de=void 0!==d?`border-radius: ${d}px;`:"",me=void 0!==g?`color: ${g}; fill: ${g}; -webkit-text-fill-color: ${g};`:"",ge=void 0!==p?`text-align: ${p};`:"",pe=v&&"inherit"!==v?`font-family:${v}_${f.match(A)?f.match(A)[1]:""};`:f||"",ve=y?`font-size: ${y}px;`:"",fe=void 0!==x&&x?`box-shadow: 0 5px ${L}px 0 ${k};`:"",ye=P instanceof Array&&1===P.length&&P[0],be=ye?`margin: ${ye.top}px ${ye.right}px ${ye.bottom}px ${ye.left}px;`:"",we=ye?`margin: calc(${ye.top}px * 0.5) calc(${ye.right}px * 0.5) calc(${ye.bottom}px * 0.5) calc(${ye.left}px * 0.5);`:"",Ce=I instanceof Array&&1===I.length&&I[0],$e=Ce?`padding: ${Ce.top}px ${Ce.right}px ${Ce.bottom}px ${Ce.left}px;`:"",Ee=Ce?`padding: calc(${Ce.top}px * 0.5) calc(${Ce.right}px * 0.5) calc(${Ce.bottom}px * 0.5) calc(${Ce.left}px * 0.5);`:"",Se=void 0!==V&&V?`border-width: ${V}px; border-style: solid;`:"",Te=[M,V].every(e=>void 0!==e)&&V?`border-color: ${M};`:"",Ne=void 0!==H?`border-radius: ${H}px;`:"",xe=void 0!==z?`background-color: ${z};`:"",ke=void 0!==Y?`color: ${Y}; fill: ${Y}; -webkit-text-fill-color: ${Y};`:"",Ae=G&&"inherit"!==G?`font-family:${G}_${U.match(A)?U.match(A)[1]:""};`:U||"",Le=Q?`font-size: ${Q}px;`:"",Pe=void 0!==K&&K?`border-width: ${K}px; border-style: solid;`:"",Ie=[J,K].every(e=>void 0!==e)&&K?`border-color: ${J};`:"",_e=void 0!==X?`border-radius: ${X}px;`:"",Oe=void 0!==Z?`background-color: ${Z};`:"",Be=void 0!==ee?`color: ${ee}; fill: ${ee}; -webkit-text-fill-color: ${ee};`:"",Re=te&&"inherit"!==te?`font-family:${te}_${ne.match(A)?ne.match(A)[1]:""};`:ne||"",De=ie?`font-size: ${ie}px;`:"",je="popin"!==i||void 0!==T&&!0!==T?"":[`#${this.widgetContainerId} .${this.overlayClassName} {`,`background-color: ${void 0!==N?N:"rgba(0, 0, 0, 0.6)"};`,"}"].join(""),We="number"==typeof B?B:16,Fe=We/2,qe=n||void 0!==_&&_?[`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} {`,"position: absolute;",("out"===O?`bottom: calc(100% + ${Fe}px)`:`top: ${Fe}px`)+";",`right: ${Fe}px;`,"width: auto;","height: auto;","background: none;","border: none;","cursor: pointer;","outline: none;","padding: 0;","margin: 0;","line-height: 0;","z-index: 9;","number"==typeof R?`border-radius: ${R}px;`:"","number"==typeof D&&D>0?`border: ${D}px solid ${void 0!==j?j:"rgba(57, 57, 57, 1)"};`:"","string"==typeof F?`background-color: ${F};`:"","}",`#${this.widgetContainerId} .${this.contentClassName} .${this.closeButtonClassName} svg {`,"pointer-events: none;",`width: ${We}px;`,`height: ${We}px;`,"string"==typeof W?`fill: ${W};`:"","}"].join(""):"",Ve=b&&"string"==typeof C?[`#${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: ${C}; fill: ${C}; -webkit-text-fill-color: ${C};`,void 0!==w?`text-align: ${w};`:"",$&&"inherit"!==$?`font-family:${$}_${E.match(A)?E.match(A)[1]:""};`:E||"",S?`font-size: ${S}px;`:"","}"].join(""):"";let Me="";if("string"==typeof se){const e=(re/1e3).toFixed(2),t=["top","bottom"].includes(ae),n=Number(t),i=[(["top","left"].includes(ae)?"-":"")+"100vmax",this.translateValues?this.translateValues[n]:"0"];t&&i.reverse(),Me={none:[],fade:[`#${this.widgetContainerId} {`,`transition: opacity ${e}s ${oe};`,"}"],slide:[`.${this.hideClassName} .${this.overlayClassName} {`,"opacity: 0 !important;","}",`#${this.widgetContainerId} .${this.overlayClassName} {`,`transition: opacity ${e}s ${oe};`,"}",`.${this.hideClassName} .${this.contentClassName} {`,`transform: translate(${i.join(", ")}) !important;`,"}",`#${this.widgetContainerId} .${this.contentClassName} {`,`transition: transform ${e}s ${oe};`,"}"]}[s()&&!ABTASTY_S.WIDGETS.animationChanged?"none":se].join("")}return ce.textContent=[`.${this.hideClassName} {`,"opacity: 0 !important;","pointer-events: none;","}",`#${this.widgetContainerId} {`,"opacity: 1;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,le,de,ue,me,ge,fe,be,pe,ve,"}",`#${this.widgetContainerId} .${this.contentClassName} p {`,me,ge,pe,ve,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,"display: block;","line-height: 1;","text-indent: unset;",$e,pe,ve,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a, `,`#${this.widgetContainerId} .${this.contentClassName} > * button {`,"box-sizing: border-box;","display: inline-block;",Se,Te,Ne,xe,ke,Ae,Le,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a *, `,`#${this.widgetContainerId} .${this.contentClassName} > * button * {`,ke,Ae,Le,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a:nth-child(2), `,`#${this.widgetContainerId} .${this.contentClassName} > * button:nth-child(2) {`,`margin-${"fill"===q?"top":"left"}: 8px;`,Pe,Ie,_e,Oe,Be,Re,De,"}",`#${this.widgetContainerId} .${this.contentClassName} > * a:nth-child(2) *, `,`#${this.widgetContainerId} .${this.contentClassName} > * button:nth-child(2) * {`,Be,Re,De,"}","@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,we,"}",`#${this.widgetContainerId} .${this.contentClassName} > * {`,Ee,"}","}",je,qe,Ve,Me,`${e}`].join(""),ce}}const P=["top: 0;","top: 50%;","bottom: 0;"],I=["left: 0;","left: 50%;","right: 0;"],_=e=>1===e?"-50%":0,O=()=>{if(Array.isArray(DATA.popinPosition)){const{popinPosition:[{x:e,y:t}]}=DATA,n=`translate(${_(t)}, ${_(e)});`;return`${P[e]}${I[t]}transform: ${n}`}return"left: 50%;top: 50%;transform: translate(-50%, -50%);"},B=()=>"autoWidth"in DATA&&!0===DATA.autoWidth,R=()=>{if(B())return"width: auto;height: auto;";const{popinPercentWidth:e,popinPixelsWidth:t,widthUnit:n,autoHeight:i,popinPercentHeight:s,popinPixelsHeight:r,heightUnit:o}=DATA;return`width: ${"px"===n?t:e}${n};height: ${i?"auto":`${"px"===o?r:s}${o}`};`};class D extends L{constructor(){super(),this.translateValues=Object.values(DATA.popinPosition[0]).map(e=>_(e)),this.stringStyles=this.getStyles(),this.styleElement=this.getStyleTag(this.stringStyles)}getStyles(){const{zindex:e,zindexCustom:t,overlay:n}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;","top: 0;","left: 0;","width: 100%;","height: 100%;",`z-index: ${"custom"===e?t:e};`,"background: none;","pointer-events: "+(!1===n?"none":"all"),"}",`#${this.widgetContainerId} .${this.overlayClassName} {`,"position: absolute;","z-index: -1;","top: 0;","left: 0;","width: 100%;","height: 100%;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: absolute;",O(),R(),"pointer-events: all","}",`${B()?"":[`#${this.widgetContainerId} .${this.contentClassName} > div {`,"height: 100%;","overflow: auto;","box-sizing: border-box;","}"].join("")}`,`${B()?"":["@media screen and (max-width: 579px) {",`#${this.widgetContainerId} .${this.contentClassName} {`,"max-width: 94vw;","}","}"].join("")}`].join("")}}class j extends L{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:e,zindexCustom:t}=DATA;return[`#${this.widgetContainerId} {`,"position: fixed;",`${this.position}: 0;`,"left: 0;","width: 100%;","height: auto;",`z-index: ${"custom"===e?t:e};`,"background: none;","}",`#${this.widgetContainerId} .${this.contentClassName} {`,"position: relative;","}"].join("")}}class W extends L{constructor(){super(),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 F=()=>{const{layout:e}=DATA;let t;switch(e){case"popin":t=new D;break;case"bannerTop":case"bannerBottom":t=new j;break;case"free":t=new W;break;default:t=new L}return t},q={button:"button",buttonClose:"buttonClose",widget:"widget",widgetClose:"widgetClose"},V=[{label:"widget_promotionalBanner_content_radio_linkType_option_button",value:q.button},{label:"widget_promotionalBanner_content_radio_linkType_option_buttonClose",value:q.buttonClose},{label:"widget_promotionalBanner_content_radio_linkType_option_wholeBannerClickable",value:q.widget},{label:"widget_promotionalBanner_content_radio_linkType_option_wholeBannerClickableClose",value:q.widgetClose},{label:"widget_promotionalBanner_content_radio_linkType_option_none",value:!1}],M=(q.button,e=>e&&[q.button,q.buttonClose].includes(e));function H(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function z(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,i)}return n}function Y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?z(Object(n),!0).forEach(function(t){H(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):z(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}V.filter(({value:e})=>M(e)),s()&&Number(ABTASTY_S.USER.additionalInformation.account_iframe_less_mode);var G=DATA,U=G.isFeedBackQuestion,Q=G.isThankYouMessage,K=G.autoHide,J=G.timeHide,X=G.stepToShow,Z=G.question,ee=G.feedbackQuestion,te=G.buttonText,ne=G.thankYouMessage,ie=G.isLegend,se=G.minLegend,re=G.maxLegend,oe=G.noStyles,ae={capture:!0,passive:!1},ce=function(){function e(t){var n=t.parentContainer;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.parentContainer=n,this.baseClassName="nps_container",this.className="".concat(this.baseClassName,"_").concat(n.uniqueId),this.questionClassName="".concat(this.baseClassName,"_question"),this.notesClassName="".concat(this.baseClassName,"_notes"),this.feedbackQuestionClassName="".concat(this.questionClassName,"_feedback"),this.feedbackFormClassName="".concat(this.questionClassName,"_feedback_form"),this.notesButtonsClassName="".concat(this.notesClassName,"_button"),this.thankYouClassName="".concat(this.baseClassName,"_thanks"),this.hideClassName="nps_".concat(n.uniqueId,"_display_none"),this.currentNote=NaN,this.userFeedback="",this.npsContainer=this.getContainer(),this.questionElement=this.getQuestionElement(),this.notesContainer=this.getNotesElement(),this.feedbackElements=this.getFeedBackElements(),this.thankYouElement=this.getThankYouElement(),this.npsElement=this.getNPSElement(),this.styleElement=this.getStyleElement()}var t;return(t=[{key:"sendNote",value:function(){if(!s()&&!isNaN(this.currentNote))try{window.abtasty.send("nps",{ns:this.currentNote,nf:this.userFeedback})}catch(e){p("Not able to send NPS hit due to old tag version (< 3.0)")}return this}},{key:"insertIn",value:function(e,t){return document.head.insertAdjacentElement("beforeend",this.styleElement),e.insertAdjacentElement(t,this.npsElement),this}},{key:"complete",value:function(){var e=this;return this.sendNote(),K?(setTimeout(function(){e.parentContainer.hide(),setTimeout(function(){e.parentContainer.recurrence.setValidationRecurrence(),e.parentContainer.remove(),e.showNotes(),e.currentNote=NaN,e.userFeedback="",e.feedbackElements.feedbackFormElement.querySelector("textarea").value=""},1e3)},1e3*J),this):this}},{key:"onClickNote",value:function(e){this.currentNote=Number(e.target.dataset.note),U&&ee&&ee.length?this.showFeedBack():Q&&ne&&ne.length?this.showThankYouMessage():this.complete()}},{key:"onFeedbackSend",value:function(){Q&&ne&&ne.length?this.showThankYouMessage():this.complete()}},{key:"showNotes",value:function(){var e=this;return this.npsContainer.childNodes.forEach(function(t){return t.classList.add(e.hideClassName)}),[this.questionElement,this.notesContainer].forEach(function(t){return t.classList.remove(e.hideClassName)}),this}},{key:"showFeedBack",value:function(){var e=this;return this.npsContainer.childNodes.forEach(function(t){return t.classList.add(e.hideClassName)}),Object.values(this.feedbackElements).forEach(function(t){return t.classList.remove(e.hideClassName)}),this}},{key:"showThankYouMessage",value:function(){var e=this;return this.npsContainer.childNodes.forEach(function(t){return t.classList.add(e.hideClassName)}),this.thankYouElement.classList.remove(this.hideClassName),this.complete(),this}},{key:"getThankYouElement",value:function(){var e=document.createElement("p");return e.className="".concat(this.thankYouClassName," ").concat(this.hideClassName),e.innerHTML=ne,s()&&"displayThanksStep"===X&&e.classList.remove(this.hideClassName),e}},{key:"getFeedBackElements",value:function(){var e=this,t=document.createElement("p");t.className="".concat(this.feedbackQuestionClassName," ").concat(this.hideClassName),t.innerHTML=ee;var n=document.createElement("form");n.className="".concat(this.feedbackFormClassName," ").concat(this.hideClassName),n.addEventListener("submit",b,Y({},ae));var i=document.createElement("textarea");i.className="".concat(this.feedbackQuestionClassName,"_textarea");var r=document.createElement("button");return r.className="".concat(this.feedbackQuestionClassName,"_button"),r.innerHTML="<span>".concat(te,"</span>"),r.addEventListener("click",function(t){return b(t),e.userFeedback=i.value,e.onFeedbackSend()},Y({},ae)),s()&&"displayFeedbackStep"===X&&[t,n].forEach(function(t){return t.classList.remove(e.hideClassName)}),n.appendChild(i),n.appendChild(r),{feedbackQuestionElement:t,feedbackFormElement:n}}},{key:"getNotesElement",value:function(){var e=this,t=document.createElement("div");t.className=this.notesClassName,s()&&"displayNoteStep"!==X&&t.classList.add(this.hideClassName);for(var n=10;n>=0;){var i=document.createElement("button");i.className=this.notesButtonsClassName,i.dataset.note=n,s()&&i.setAttribute("data-abtasty-actionnable",""),i.innerHTML+="<span>".concat(n,"</span>"),i.addEventListener("click",function(t){b(t),e.onClickNote(t)},Y({},ae)),t.insertAdjacentElement("afterbegin",i),5===n&&i.insertAdjacentHTML("afterend","<br>"),n-=1}return ie&&(t.insertAdjacentHTML("afterbegin","<legend>".concat(se,"</legend>")),t.insertAdjacentHTML("beforeend","<legend>".concat(re,"</legend>"))),t}},{key:"getQuestionElement",value:function(){var e=document.createElement("p");return e.className=this.questionClassName,e.innerHTML=Z,s()&&"displayNoteStep"!==X&&e.classList.add(this.hideClassName),e}},{key:"getContainer",value:function(){var e=document.createElement("div");return e.className="".concat(this.baseClassName," ").concat(this.className),e}},{key:"getNPSElement",value:function(){var e=this;return this.npsContainer.appendChild(this.questionElement),this.npsContainer.appendChild(this.notesContainer),U&&Object.values(this.feedbackElements).forEach(function(t){e.npsContainer.appendChild(t)}),Q&&this.npsContainer.appendChild(this.thankYouElement),this.npsContainer}},{key:"getStyleElement",value:function(){var e=document.createElement("style");if(e.type="text/css",s()&&e.setAttribute("abtasty-script-added","true"),oe)e.textContent=["#".concat(this.parentContainer.widgetContainerId," .").concat(this.className," .").concat(this.hideClassName," {"),"display: none !important;","}"].join("");else{var t=DATA,n=t.containerPadding,i=t.legendTextColor,r=t.legendFontName,o=t.legendFontStyle,a=t.legendFontSize,c=t.buttonsFontSize;this.parentContainer.loadFont(r,o);var l=/.+\/([^.]+)\.(otf|ttf)$/,h=r&&"inherit"!==r?"font-family:".concat(r,"_").concat(o.match(l)?o.match(l)[1]:"",";"):o||"",u=n instanceof Array&&1===n.length&&n[0],d="#".concat(this.parentContainer.widgetContainerId," .").concat(this.className);e.textContent=["".concat(d," .").concat(this.hideClassName," {"),"display: none !important;","}","".concat(d,","),"".concat(d," * {"),"all: unset;","box-sizing: border-box;","font-size: 10px;","line-height: normal;","font-family: sans-serif;","}","".concat(d," > * {"),"display: block;","width: 100%;","}","".concat(d," .").concat(this.notesClassName," {"),"position: relative;","display: inline-block;","width: auto;","}","".concat(d," p {"),"margin-bottom: 15px;","font-size: 1.4em;","white-space: pre-line;","}","".concat(d," button {"),"vertical-align: middle;","cursor: pointer;","text-align: center;","}","".concat(d," button span {"),"font-size: 1em;","pointer-events: none;","}","".concat(d," .").concat(this.notesClassName," button {"),"margin: 0 5px;","width: ".concat(1.75*c,"px;"),"height: ".concat(1.75*c,"px;"),"}","".concat(d," .").concat(this.feedbackFormClassName," span {"),"display: block;","padding: 6px 24px;","}",ie?["".concat(d," legend {"),"position: absolute;","text-decoration: none;","border: none;","color: ".concat(i,";"),"fill: ".concat(i,";"),"-webkit-text-fill-color: ".concat(i,";"),"font-size: ".concat(a,"px;"),h,"}","".concat(d," legend:nth-of-type(2) {"),"left: auto;","right: 0;","}"].join(""):"","".concat(d," textarea {"),"display: block;","width: 100%;","min-width: 310px;","min-height: 60px;","font-size: 1.4em;","border: 1px solid grey;","border-radius: 4px;","resize: vertical;","margin-bottom: 10px;","text-align: left;","padding: 5px;","}","".concat(d," .").concat(this.thankYouClassName," {"),"margin-bottom: 0;","}","@media screen and (min-width: 580px) {","".concat(d," {"),"min-width: 560px;","}",ie?["".concat(d," .").concat(this.notesClassName," {"),"padding-top: ".concat(1.5*a,"px"),"}","".concat(d," legend {"),"top: 0;","left: 0;","display: inline-block;","width: auto;","}"].join(""):"","".concat(d," br {"),"display: none","}","}","@media screen and (max-width: 579px) {","".concat(d," {"),"min-width: ".concat(240+(u.left+u.right/2),"px;"),"}","".concat(d," .").concat(this.notesClassName," button {"),"margin-bottom: 5px;","}","".concat(d," br {"),"display: block","}",ie?["".concat(d," .").concat(this.notesClassName," {"),"padding-bottom: 35px;","}","".concat(d," legend {"),"bottom: 0;","left: 50%;","transform: translateX(-50%)","}","".concat(d," legend:nth-of-type(1) {"),"bottom: 15px;","}","".concat(d," legend:nth-of-type(2) {"),"left: 50%;","right: unset;","}","".concat(d," legend:nth-of-type(1)::before {"),'content: "0: ";',"}","".concat(d," legend:nth-of-type(2)::before{"),'content: "10: ";',"}"].join(""):"","".concat(d," textarea {"),"min-width: auto;","}","}"].join("")}return e}}])&&function(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}(e.prototype,t),e}();function le(){return(le=t(i.mark(function e(){var t,n,s;return i.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=F(),n=t.domElement.querySelector(".".concat(t.contentClassName)),s=new ce({parentContainer:t}),t.children=s,s.insertIn(n,"beforeend"),t.init().then(function(e){return e.response&&t.show()}),e.abrupt("return",{parentContainer:t,NPS:s});case 8:case"end":return e.stop()}},e)}))).apply(this,arguments)}!function(){le.apply(this,arguments)}()}();
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@abtasty/nps",
|
3
3
|
"description": "Allow you to add a custom NPS on your website",
|
4
|
-
"version": "1.5.
|
4
|
+
"version": "1.5.1",
|
5
5
|
"form": "dist/form.js",
|
6
6
|
"main": "dist/main.js",
|
7
7
|
"files": [
|
@@ -37,6 +37,6 @@
|
|
37
37
|
"rollup-plugin-terser": "^7.0.0"
|
38
38
|
},
|
39
39
|
"dependencies": {
|
40
|
-
"@abtasty/widget-utils": "^1.18.
|
40
|
+
"@abtasty/widget-utils": "^1.18.26"
|
41
41
|
}
|
42
42
|
}
|