document.widgetServerBaseUrl = "https://widget.sezzle.com";
document.SezzleDynamicModalURL =  "https://dynamic-modal.sezzle.com";
document.sezzleButtonVersion = "sezzle-widget23.9.0.js";
document.sezzleCssVersionOverride = "sezzle-styles-global2.1.0.css";
document.sezzleDefaultModalVersion = "sezzle-modal-4.0.4.html";
document.sezzleModalAvailableLanguages = "en,fr,es";

// Sezzle's merchant widget config override
document.longTermPaymentConfig = {
    minPrice: 15000,
    maxPrice: 1500000,
    paymentTerms: [
        {
            price: 1000,
            options: [
                [48, 9.99],
                [36, 9.99],
                [24, 9.99]
            ]
        },
        {
            price: 500,
            options: [
                [24, 9.99],
                [18, 9.99],
                [12, 9.99]
            ]
        },
        {
            price: 300,
            options: [
                [12, 9.99],
                [9, 9.99],
                [6, 9.99]
            ]
        },
        {
            price: 150,
            options: [
                [9, 9.99],
                [6, 9.99],
                [3, 0]
            ]
        }
    ]
};
document.sezzleConfig = {
"configGroups": [{
"targetXPath": ".product__price/SPAN-1",
"renderToPath": "../..",
"urlMatch": "product"
},{
"targetXPath": ".cart__footer-subtotal/SPAN-0",
"urlMatch": "cart"
}]
}

if (document.sezzleConfig){
   document.sezzleConfig.merchantID = '1dbd99bb-fb98-4d5d-a971-f88b66d8199d';

   // Sezzle's merchant payment settings override

   // Sezzle's merchant local config override
   try {document.sezzleConfig = Object.assign(document.localSezzleConfig, document.sezzleConfig); } catch(e) {}
 }
/*! For license information please see sezzle-widget23.9.0.js.LICENSE.txt */
(()=>{var e={465:(e,t,n)=>{e=n.nmd(e);var r="__lodash_hash_undefined__",o=9007199254740991,i="[object Arguments]",a="[object Boolean]",c="[object Date]",l="[object Function]",s="[object GeneratorFunction]",u="[object Map]",f="[object Number]",h="[object Object]",d="[object Promise]",p="[object RegExp]",m="[object Set]",g="[object String]",y="[object Symbol]",v="[object WeakMap]",b="[object ArrayBuffer]",w="[object DataView]",E="[object Float32Array]",z="[object Float64Array]",_="[object Int8Array]",S="[object Int16Array]",k="[object Int32Array]",P="[object Uint8Array]",C="[object Uint8ClampedArray]",L="[object Uint16Array]",x="[object Uint32Array]",T=/\w*$/,O=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,N={};N[i]=N["[object Array]"]=N[b]=N[w]=N[a]=N[c]=N[E]=N[z]=N[_]=N[S]=N[k]=N[u]=N[f]=N[h]=N[p]=N[m]=N[g]=N[y]=N[P]=N[C]=N[L]=N[x]=!0,N["[object Error]"]=N[l]=N[v]=!1;var A="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,M="object"==typeof self&&self&&self.Object===Object&&self,F=A||M||Function("return this")(),I=t&&!t.nodeType&&t,W=I&&e&&!e.nodeType&&e,G=W&&W.exports===I;function D(e,t){return e.set(t[0],t[1]),e}function B(e,t){return e.add(t),e}function q(e,t,n,r){var o=-1,i=e?e.length:0;for(r&&i&&(n=e[++o]);++o<i;)n=t(n,e[o],o,e);return n}function R(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(e){}return t}function U(e){var t=-1,n=Array(e.size);return e.forEach((function(e,r){n[++t]=[r,e]})),n}function H(e,t){return function(n){return e(t(n))}}function V(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var $,X=Array.prototype,Y=Function.prototype,J=Object.prototype,K=F["__core-js_shared__"],Q=($=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+$:"",Z=Y.toString,ee=J.hasOwnProperty,te=J.toString,ne=RegExp("^"+Z.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=G?F.Buffer:void 0,oe=F.Symbol,ie=F.Uint8Array,ae=H(Object.getPrototypeOf,Object),ce=Object.create,le=J.propertyIsEnumerable,se=X.splice,ue=Object.getOwnPropertySymbols,fe=re?re.isBuffer:void 0,he=H(Object.keys,Object),de=Fe(F,"DataView"),pe=Fe(F,"Map"),me=Fe(F,"Promise"),ge=Fe(F,"Set"),ye=Fe(F,"WeakMap"),ve=Fe(Object,"create"),be=Be(de),we=Be(pe),Ee=Be(me),ze=Be(ge),_e=Be(ye),Se=oe?oe.prototype:void 0,ke=Se?Se.valueOf:void 0;function Pe(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Ce(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function Le(e){var t=-1,n=e?e.length:0;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}function xe(e){this.__data__=new Ce(e)}function Te(e,t,n){var r=e[t];ee.call(e,t)&&qe(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Oe(e,t){for(var n=e.length;n--;)if(qe(e[n][0],t))return n;return-1}function je(e,t,n,r,o,d,v){var O;if(r&&(O=d?r(e,o,d,v):r(e)),void 0!==O)return O;if(!$e(e))return e;var j=Re(e);if(j){if(O=function(e){var t=e.length,n=e.constructor(t);return t&&"string"==typeof e[0]&&ee.call(e,"index")&&(n.index=e.index,n.input=e.input),n}(e),!t)return function(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n<r;)t[n]=e[n];return t}(e,O)}else{var A=We(e),M=A==l||A==s;if(He(e))return function(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}(e,t);if(A==h||A==i||M&&!d){if(R(e))return d?e:{};if(O=function(e){return"function"!=typeof e.constructor||De(e)?{}:$e(t=ae(e))?ce(t):{};var t}(M?{}:e),!t)return function(e,t){return Ae(e,Ie(e),t)}(e,function(e,t){return e&&Ae(t,Xe(t),e)}(O,e))}else{if(!N[A])return d?e:{};O=function(e,t,n,r){var o,i=e.constructor;switch(t){case b:return Ne(e);case a:case c:return new i(+e);case w:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}(e,r);case E:case z:case _:case S:case k:case P:case C:case L:case x:return function(e,t){var n=t?Ne(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}(e,r);case u:return function(e,t,n){return q(t?n(U(e),!0):U(e),D,new e.constructor)}(e,r,n);case f:case g:return new i(e);case p:return function(e){var t=new e.constructor(e.source,T.exec(e));return t.lastIndex=e.lastIndex,t}(e);case m:return function(e,t,n){return q(t?n(V(e),!0):V(e),B,new e.constructor)}(e,r,n);case y:return o=e,ke?Object(ke.call(o)):{}}}(e,A,je,t)}}v||(v=new xe);var F=v.get(e);if(F)return F;if(v.set(e,O),!j)var I=n?function(e){return function(e,t,n){var r=t(e);return Re(e)?r:function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e}(r,n(e))}(e,Xe,Ie)}(e):Xe(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n););}(I||e,(function(o,i){I&&(o=e[i=o]),Te(O,i,je(o,t,n,r,i,e,v))})),O}function Ne(e){var t=new e.constructor(e.byteLength);return new ie(t).set(new ie(e)),t}function Ae(e,t,n,r){n||(n={});for(var o=-1,i=t.length;++o<i;){var a=t[o],c=r?r(n[a],e[a],a,n,e):void 0;Te(n,a,void 0===c?e[a]:c)}return n}function Me(e,t){var n,r,o=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?o["string"==typeof t?"string":"hash"]:o.map}function Fe(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!$e(e)||(t=e,Q&&Q in t))&&(Ve(e)||R(e)?ne:O).test(Be(e));var t}(n)?n:void 0}Pe.prototype.clear=function(){this.__data__=ve?ve(null):{}},Pe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},Pe.prototype.get=function(e){var t=this.__data__;if(ve){var n=t[e];return n===r?void 0:n}return ee.call(t,e)?t[e]:void 0},Pe.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:ee.call(t,e)},Pe.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?r:t,this},Ce.prototype.clear=function(){this.__data__=[]},Ce.prototype.delete=function(e){var t=this.__data__,n=Oe(t,e);return!(n<0||(n==t.length-1?t.pop():se.call(t,n,1),0))},Ce.prototype.get=function(e){var t=this.__data__,n=Oe(t,e);return n<0?void 0:t[n][1]},Ce.prototype.has=function(e){return Oe(this.__data__,e)>-1},Ce.prototype.set=function(e,t){var n=this.__data__,r=Oe(n,e);return r<0?n.push([e,t]):n[r][1]=t,this},Le.prototype.clear=function(){this.__data__={hash:new Pe,map:new(pe||Ce),string:new Pe}},Le.prototype.delete=function(e){return Me(this,e).delete(e)},Le.prototype.get=function(e){return Me(this,e).get(e)},Le.prototype.has=function(e){return Me(this,e).has(e)},Le.prototype.set=function(e,t){return Me(this,e).set(e,t),this},xe.prototype.clear=function(){this.__data__=new Ce},xe.prototype.delete=function(e){return this.__data__.delete(e)},xe.prototype.get=function(e){return this.__data__.get(e)},xe.prototype.has=function(e){return this.__data__.has(e)},xe.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Ce){var r=n.__data__;if(!pe||r.length<199)return r.push([e,t]),this;n=this.__data__=new Le(r)}return n.set(e,t),this};var Ie=ue?H(ue,Object):function(){return[]},We=function(e){return te.call(e)};function Ge(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||j.test(e))&&e>-1&&e%1==0&&e<t}function De(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||J)}function Be(e){if(null!=e){try{return Z.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function qe(e,t){return e===t||e!=e&&t!=t}(de&&We(new de(new ArrayBuffer(1)))!=w||pe&&We(new pe)!=u||me&&We(me.resolve())!=d||ge&&We(new ge)!=m||ye&&We(new ye)!=v)&&(We=function(e){var t=te.call(e),n=t==h?e.constructor:void 0,r=n?Be(n):void 0;if(r)switch(r){case be:return w;case we:return u;case Ee:return d;case ze:return m;case _e:return v}return t});var Re=Array.isArray;function Ue(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!Ve(e)}var He=fe||function(){return!1};function Ve(e){var t=$e(e)?te.call(e):"";return t==l||t==s}function $e(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Xe(e){return Ue(e)?function(e,t){var n=Re(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ue(e)}(e)&&ee.call(e,"callee")&&(!le.call(e,"callee")||te.call(e)==i)}(e)?function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}(e.length,String):[],r=n.length,o=!!r;for(var a in e)!t&&!ee.call(e,a)||o&&("length"==a||Ge(a,r))||n.push(a);return n}(e):function(e){if(!De(e))return he(e);var t=[];for(var n in Object(e))ee.call(e,n)&&"constructor"!=n&&t.push(n);return t}(e)}e.exports=function(e){return je(e,!0,!0)}},666:e=>{var t=function(e){"use strict";var t,n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),c=new T(r||[]);return o(a,"_invoke",{value:P(e,n,c)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,a,(function(){return this}));var E=Object.getPrototypeOf,z=E&&E(E(O([])));z&&z!==n&&r.call(z,a)&&(w=z);var _=b.prototype=y.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(o,i,a,c){var l=f(e[o],e,i);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==typeof u&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(u).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function P(e,t,n){var r=h;return function(o,i){if(r===p)throw new Error("Generator is already running");if(r===m){if("throw"===o)throw i;return j()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=C(a,n);if(c){if(c===g)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=p;var l=f(e,t,n);if("normal"===l.type){if(r=n.done?m:d,l.arg===g)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r=m,n.method="throw",n.arg=l.arg)}}}function C(e,n){var r=n.method,o=e.iterator[r];if(o===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,C(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,e.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[e.resultName]=a.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function L(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 T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function O(e){if(e){var n=e[a];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,i=function n(){for(;++o<e.length;)if(r.call(e,o))return n.value=e[o],n.done=!1,n;return n.value=t,n.done=!0,n};return i.next=i}}return{next:j}}function j(){return{value:t,done:!0}}return v.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},e.awrap=function(e){return{__await:e}},S(k.prototype),s(k.prototype,c,(function(){return this})),e.AsyncIterator=k,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new k(u(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(_),s(_,l,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},e.values=O,T.prototype={constructor:T,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)&&r.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 o(r,o){return c.type="throw",c.arg=e,n.next=r,o&&(n.method="next",n.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(l&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},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),g},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),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:O(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),g}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}},t={};function n(r){var o=t[r];if(void 0!==o)return o.exports;var i=t[r]={id:r,loaded:!1,exports:{}};return e[r](i,i.exports,n),i.loaded=!0,i.exports}n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(t,n){for(var r=0;r<n.length;r++){var o=n[r];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,(void 0,i=function(t,n){if("object"!==e(t)||null===t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,"string");if("object"!==e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(o.key),"symbol"===e(i)?i:String(i)),o)}var i}n(666);var r=document.widgetServerBaseUrl?"".concat(document.widgetServerBaseUrl,"/v1/event/log"):"http://widget.sezzle.com/v1/event/log";const o=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e)}var n,o;return n=e,o=[{key:"httpRequestWrapper",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Promise((function(r,o){var i=new XMLHttpRequest;i.open(e,t,!0),null!==n&&i.setRequestHeader("Content-Type","application/json"),i.onload=function(){this.status>=200&&this.status<300?r(i.response):o(new Error("An error occurred when calling ".concat(t,". Status code: ").concat(this.status,"; Response text: ").concat(i.responseText)))},i.onerror=function(e){var n;n=e instanceof ErrorEvent?"An error occurred when calling ".concat(t,". Error message: ").concat(e.message,"; Filename: ").concat(e.filename,"; Line#: ").concat(e.lineno):"An error occurred when calling ".concat(t,". Error type: ").concat(e.type),o(new Error(n))},null===n?i.send():i.send(JSON.stringify(n))}))}},{key:"_getCookie",value:function(e){var t=";".concat(document.cookie).split(";".concat(e,"="));if(2===t.length)return t.pop().split(";").shift()}},{key:"isWidgetDuplicateFound",value:function(){return document.querySelectorAll(".".concat("sezzle-shopify-info-button",':not([style*="display: none"])')).length>1}},{key:"sendEvents",value:function(e){this.httpRequestWrapper("post",r,e)}},{key:"breakXPath",value:function(e){return e.split("/").filter((function(e){return""!==e}))}},{key:"getWidgetBaseUrl",value:function(){return document.widgetServerBaseUrl||"https://widget.sezzle.com"}},{key:"predictBackgroundTheme",value:function(){var e,t,n,r=window.getComputedStyle(document.body).getPropertyValue("background-color");if("transparent"===r||"rgba(0, 0, 0, 0)"===r)return"light";r.match(/^rgb/)?(e=(r=r.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/))[1],t=r[2],n=r[3]):(e=(r=+"0x".concat(r.slice(1).replace(r.length<5&&/./g,"$&$&")))>>16,t=r>>8&255,n=255&r);var o=.2126*e+.7152*t+.0722*n,i=(Math.max(e,t,n)+Math.min(e,t,n))/2;return Math.sqrt(e*e*.299+t*t*.587+n*n*.114)<=180&&o<=180&&i<=180?"dark":"light"}},{key:"matchAll",value:function(e,t){for(var n,r=[];n=e.exec(t);)r.push(n[0]);return r}},{key:"WaitForBodyToBeReady",value:function(){return new Promise((function(e){document.body&&e();var t=new MutationObserver((function(){document.body&&(t.disconnect(),e())}));t.observe(document.documentElement,{childList:!0})}))}}],null&&t(n.prototype,null),o&&t(n,o),Object.defineProperty(n,"prototype",{writable:!1}),e}();function i(){i=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",l=a.asyncIterator||"@@asyncIterator",s=a.toStringTag||"@@toStringTag";function f(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{f({},"")}catch(e){f=function(e,t,n){return e[t]=n}}function h(e,t,n,r){var i=t&&t.prototype instanceof b?t:b,a=Object.create(i.prototype),c=new j(r||[]);return o(a,"_invoke",{value:L(e,n,c)}),a}function d(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=h;var p="suspendedStart",m="suspendedYield",g="executing",y="completed",v={};function b(){}function w(){}function E(){}var z={};f(z,c,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(N([])));S&&S!==n&&r.call(S,c)&&(z=S);var k=E.prototype=b.prototype=Object.create(z);function P(e){["next","throw","return"].forEach((function(t){f(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,i,a,c){var l=d(e[o],e,i);if("throw"!==l.type){var s=l.arg,f=s.value;return f&&"object"==u(f)&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(f).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function L(t,n,r){var o=p;return function(i,a){if(o===g)throw new Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=x(c,r);if(l){if(l===v)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===p)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=g;var s=d(t,n,r);if("normal"===s.type){if(o=r.done?y:m,s.arg===v)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=y,r.method="throw",r.arg=s.arg)}}}function x(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,x(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),v;var i=d(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,v;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,v):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,v)}function T(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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function N(t){if(t||""===t){var n=t[c];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(u(t)+" is not iterable")}return w.prototype=E,o(k,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:w,configurable:!0}),w.displayName=f(E,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===w||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,f(e,s,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},P(C.prototype),f(C.prototype,l,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new C(h(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(k),f(k,s,"Generator"),f(k,c,(function(){return this})),f(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(l&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,v):this.complete(a)},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),v},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),O(n),v}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),v}},t}function a(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function c(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function s(e,t,n){return(t=h(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function f(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,h(r.key),r)}}function h(e){var t=function(e,t){if("object"!==u(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===u(t)?t:String(t)}n(465);var d=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.basicWidgetConfig=t,this.propsNotInConfigGroup=["merchantID","minPrice","maxPrice","numberOfPayments","apModalHTML","language","apDualInstall","isLongTermOnly"],this.widgetConfig={config:null,configGroups:null,merchantID:null,numberOfPayments:null,minPrice:null,maxPrice:null,apModalHTML:null,fingerprint:null,apDualInstall:null,isLongTermOnly:null,mutationObserverConfig:{attributes:!0,childList:!0,characterData:!0},apiEndpoints:{sezzleAssetsCDN:"https://media.sezzle.com/shopify-app/assets/",cssForMerchantURL:"".concat(o.getWidgetBaseUrl(),"/v1/css/price-widget?uuid=").concat(t.merchantID)},observeElements:null},this.widgetEventLogger=r,this.modifySezzleConfig(),this.language=n,this.language.setLanguage(this.widgetConfig.config.language)}var t,n,r,c;return t=e,n=[{key:"getSezzleConfig",get:function(){return this.widgetConfig}},{key:"modifySezzleConfig",value:function(){this._validateConfig(),this._urlConfigFilter(),this._configSetters(),this._setConfigGroups()}},{key:"_validateConfig",value:function(){if(!Array.isArray(this.basicWidgetConfig.configGroups))throw new Error("options.configGroups is not an array");if(!this.basicWidgetConfig.configGroups.length)throw new Error("options.configGroups must have at least one config object");var e=["targetXPath"];this.basicWidgetConfig.configGroups.forEach((function(t){e.forEach((function(e){if(!t.hasOwnProperty(e))throw new Error("".concat(e," must be specified in all configs in options.configGroups"))}))})),this.checkCrucialFieldsAreTypeString(),this.checkGlobalValuesOutsideConfigGroups()}},{key:"checkCrucialFieldsAreTypeString",value:function(){var e={targetXPath:"string",renderToPath:"string",urlMatch:"string"};this.basicWidgetConfig.configGroups.forEach((function(t){Object.keys(e).forEach((function(n){if(t.hasOwnProperty(n)&&u(t[n])!==u(e[n]))throw new Error("".concat(n," must be of type ").concat(e[n]))}))}))}},{key:"checkGlobalValuesOutsideConfigGroups",value:function(){var e=this;this.basicWidgetConfig.configGroups.forEach((function(t){Object.keys(t).forEach((function(t){if(e.propsNotInConfigGroup.indexOf(t)>=0)throw new Error("".concat(t," is not a property of a configGroup. Specify this key at the outermost layer"))}))}))}},{key:"_urlConfigFilter",value:function(){this.basicWidgetConfig.configGroups=this.basicWidgetConfig.configGroups.filter((function(e){return!e.urlMatch||RegExp(e.urlMatch,"i").test(window.location.href)}))}},{key:"_configSetters",value:function(){var e={config:this.basicWidgetConfig,merchantID:this.basicWidgetConfig.merchantID||"",numberOfPayments:4,minPrice:this.basicWidgetConfig.minPrice||0,maxPrice:this.basicWidgetConfig.maxPrice||25e4,observeElements:this.basicWidgetConfig.observeElements||[],apDualInstall:this.basicWidgetConfig.apDualInstall||!1,isLongTermOnly:this.basicWidgetConfig.isLongTermOnly||!1};this.widgetConfig=l(l({},this.widgetConfig),e)}},{key:"_mapGroupToDefault",value:function(e){var t={};switch(t.xpath=o.breakXPath(e.targetXPath),t.rendertopath=e.renderToPath||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.renderToPath||"..",t.relatedElementActions=e.relatedElementActions||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.relatedElementActions||[],t.ignoredPriceElements=e.ignoredPriceElements||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.ignoredPriceElements||[],"string"==typeof t.ignoredPriceElements?t.ignoredPriceElements=[o.breakXPath(t.ignoredPriceElements.trim())]:t.ignoredPriceElements=t.ignoredPriceElements.map((function(e){return o.breakXPath(e.trim())})),t.alignment=e.alignment||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.alignment||"auto",t.alignmentSwitchMinWidth=e.alignmentSwitchMinWidth||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.alignmentSwitchMinWidth,t.alignmentSwitchType=e.alignmentSwitchType||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.alignmentSwitchType,t.containerStyle=e.containerStyle||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.containerStyle||{},t.textStyle=e.textStyle||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.textStyle||{},t.logoStyle=e.logoStyle||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.logoStyle||{},t.theme=e.theme||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.theme||"",t.theme){case"dark":t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor_WhiteWM.svg",t.imageClassName="szl-dark-image";break;case"light":t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",t.imageClassName="szl-light-image";break;case"white-flat":t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_WhiteAlt.svg",t.imageClassName="szl-dark-image";break;case"black-flat":t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_BlackAlt.svg",t.imageClassName="szl-light-image";break;default:"dark"===o.predictBackgroundTheme()?(t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor_WhiteWM.svg",t.imageClassName="szl-dark-image"):(t.imageURL="https://media.sezzle.com/branding/2.0/Sezzle_Logo_FullColor.svg",t.imageClassName="szl-light-image")}return t.hideClasses=e.hideClasses||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.hideClasses||[],"string"==typeof t.hideClasses?t.hideClasses=[o.breakXPath(t.hideClasses.trim())]:t.hideClasses=t.hideClasses.map((function(e){return o.breakXPath(e.trim())})),t.ignoredFormattedPriceText=e.ignoredFormattedPriceText||this.basicWidgetConfig.defaultConfig&&this.basicWidgetConfig.defaultConfig.ignoredFormattedPriceText||["Subtotal","Total:","Sold Out"],Array.isArray(t.ignoredFormattedPriceText)||(t.ignoredFormattedPriceText=[t.ignoredFormattedPriceText]),t.widgetIsFirstChild=!1,t}},{key:"_setConfigGroups",value:function(){var e=this;this.widgetConfig.configGroups=[],this.basicWidgetConfig.configGroups.forEach((function(t){e.widgetConfig.configGroups.push(e._mapGroupToDefault(t))}))}},{key:"_setAPModalHTML",value:(r=i().mark((function e(){var t,n,r=this;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.widgetConfig.apDualInstall){e.next=2;break}return e.abrupt("return");case 2:return t=this.language.getLanguage(),n="https://media.sezzle.com/afterpay/modal/".concat(t,".html"),e.next=6,o.httpRequestWrapper("GET",n).then((function(e){r.widgetConfig.apModalHTML=e})).catch((function(e){r.widgetEventLogger.logEvent("error",e.message)}));case 6:case"end":return e.stop()}}),e,this)})),c=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function c(e){a(i,n,o,c,l,"next",e)}function l(e){a(i,n,o,c,l,"throw",e)}c(void 0)}))},function(){return c.apply(this,arguments)})}],n&&f(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const p=d;function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function g(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==m(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==m(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===m(o)?o:String(o)),r)}var o}const y=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._config=t}var t,n;return t=e,n=[{key:"getElementsByXPath",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(e===[])return[];if(t===e.length)return n;null===n&&(n=[document]);for(var r=[],o=Array.prototype.slice.call(n),i=function(){var n=o[a];if(".."===e[t])r.push(n.parentElement);else if("#"===e[t][0])r.push(n.getElementById(e[t].substr(1)));else if("."===e[t][0])1===e[t].trim().length&&r.push(n),Array.prototype.forEach.call(n.getElementsByClassName(e[t].substr(1)),(function(e){r.push(e)}));else if(0===e[t].indexOf("child")){var i=e[t].split("-")[1],c=n.childNodes[i];if(void 0!==c)if("#text"===c.nodeName){var l=document.createElement("span");l.appendChild(document.createTextNode(c.nodeValue)),n.replaceChild(l,c),r.push(l)}else r.push(c);else r.push(n)}else{var s=e[t].split("-"),u=0;s.length>1&&s[s.length-1]>=0&&(u=parseInt(s[s.length-1],10));var f=e[t].replace("-".concat(u),"");Array.prototype.forEach.call(n.getElementsByTagName(f),(function(e,t){t===u&&r.push(e)}))}},a=0;a<o.length;a++)i();return r=r.filter((function(e){return null!==e})),this.getElementsByXPath(e,t+1,r)}},{key:"getElementToRender",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=document.getElementById("sezzle-widget-v2-render-reference");if(n)return n;var r=null;if(null!==this._config.configGroups[t].rendertopath){var i=o.breakXPath(this._config.configGroups[t].rendertopath);r=e;for(var a=0;a<i.length;a++){var c=i[a];if(null===r)break;if("."!==c)if(".."===c)r=r.parentElement;else if("."===c[0])r=r.getElementsByClassName(c.substr(1)).length?r.getElementsByClassName(c.substr(1))[0]:null;else if("#"===c[0])r=document.getElementById(c.substr(1));else if("::first-child"===c)r=r.children.length>0?r.firstElementChild:null,this._config.configGroups[t].widgetIsFirstChild=!0;else{var l=0;c.split("-").length>1&&c.split("-")[1]>=0&&(l=parseInt(c.split("-")[1],10)),r=r.getElementsByTagName(c.split("-")[0]).length>l?r.getElementsByTagName(c.split("-")[0])[l]:null}}}return r||e.parentElement}},{key:"getPriceText",value:function(e,t){var n=this;if(!t||0===t.length)return e.textContent;if(t.forEach((function(t){n.getElementsByXPath(t,0,[e]).forEach((function(e){e.classList.add("sezzle-ignored-price-element")}))})),!e.getElementsByClassName("sezzle-ignored-price-element").length)return e.textContent;var r=e.cloneNode(!0);return Array.prototype.forEach.call(r.getElementsByTagName("*"),(function(e){-1!==Array.prototype.slice.call(e.classList).indexOf("sezzle-ignored-price-element")&&r.removeChild(e)})),Array.prototype.forEach.call(e.getElementsByClassName("sezzle-ignored-price-element"),(function(e){e.classList.remove("sezzle-ignored-price-element")})),r.textContent}},{key:"startObserve",value:function(e,t){var n=new MutationObserver(t);return n.observe(e,this._config.mutationObserverConfig),n}},{key:"observeRelatedElements",value:function(e,t,n){var r=this;n&&n.forEach((function(n){if("string"==typeof n.relatedPath&&("function"==typeof n.action||"function"==typeof n.initialAction)){var i=r.getElementsByXPath(o.breakXPath(n.relatedPath),0,[e]);i.length>0&&("function"==typeof n.action&&r.startObserve(i[0],(function(e){n.action(e,t)})),"function"==typeof n.initialAction&&n.initialAction(i[0],t))}}))}},{key:"hideSezzleHideElements",value:function(e){var t=this;this._config.configGroups[e].hideClasses.forEach((function(e){t.getElementsByXPath(e).forEach((function(e){e.classList.contains("sezzle-hidden")||e.classList.add("sezzle-hidden")}))}))}}],n&&g(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function v(e){return v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},v(e)}function b(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function w(){w=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),c=new j(r||[]);return o(a,"_invoke",{value:L(e,n,c)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",g={};function y(){}function b(){}function E(){}var z={};s(z,a,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(N([])));S&&S!==n&&r.call(S,a)&&(z=S);var k=E.prototype=y.prototype=Object.create(z);function P(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,i,a,c){var l=f(e[o],e,i);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==v(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(u).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function L(t,n,r){var o=h;return function(i,a){if(o===p)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=x(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var s=f(t,n,r);if("normal"===s.type){if(o=r.done?m:d,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function x(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,x(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function T(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 O(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function j(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function N(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(v(t)+" is not iterable")}return b.prototype=E,o(k,"constructor",{value:E,configurable:!0}),o(E,"constructor",{value:b,configurable:!0}),b.displayName=s(E,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,E):(e.__proto__=E,s(e,l,"GeneratorFunction")),e.prototype=Object.create(k),e},t.awrap=function(e){return{__await:e}},P(C.prototype),s(C.prototype,c,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new C(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},P(k),s(k,l,"Generator"),s(k,a,(function(){return this})),s(k,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=N,j.prototype={constructor:j,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(O),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(l&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},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),g},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),O(n),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;O(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function E(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function z(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==v(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==v(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===v(o)?o:String(o)),r)}var o}var _=function(){function e(t,n,r,o,i){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._widgetConfig=t,this._widgetEventLogger=n,this._scrollDistance=0,this._modalNode=null,this._sezzleElement=null,this._vendorsSupportedForDualInstall=["ap"],this._promotion=r,this._priceProcessor=o,this._languageConfig=i}var t,n,r,i;return t=e,n=[{key:"addClickEventForModal",value:function(e){this._sezzleElement=e.widget,this._sezzleAddClickEvent(e),this._sezzleAddKeyEvent(e),this._addClickEventForOtherVendors()}},{key:"renderModals",value:function(){this._renderModal(),this._renderOtherVendorModals()}},{key:"_openSezzleModal",value:function(e,t){if(e.preventDefault(),this._processContentForModal(t),e.target.id="sezzle-modal-return",!e.target.classList.contains("no-sezzle-info")){var n,r=document.getElementsByClassName("sezzle-checkout-modal-lightbox");if(Array.prototype.forEach.call(r,(function(e){e.classList.contains("close-sezzle-modal")&&(n=e)})),n){this._disableBodyScroll(!0),n.style.display="block",n.getElementsByClassName("close-sezzle-modal")[0].focus();var o=n.getElementsByClassName("sezzle-modal");o.length&&(o[0].className="sezzle-modal"),this.modalKeyboardNavigation(),this._widgetEventLogger.logEvent("onclick")}}}},{key:"_sezzleAddKeyEvent",value:function(e){var t=this,n=document.getElementsByClassName("sezzle-modal-link");Array.prototype.forEach.call(n,(function(n){n.addEventListener("keydown",(function(n){"Enter"!==n.key&&" "!==n.key||t._openSezzleModal(n,e)}))}))}},{key:"_sezzleAddClickEvent",value:function(e){var t=this,n=document.getElementsByClassName("sezzle-modal-link");Array.prototype.forEach.call(n,(function(n){n.addEventListener("click",(function(n){t._openSezzleModal(n,e)}))}))}},{key:"_addClickEventForOtherVendors",value:function(){var e=this;this._vendorsSupportedForDualInstall.forEach((function(t){if(e._widgetConfig["".concat(t,"ModalHTML")]){var n=e._sezzleElement.getElementsByClassName("".concat(t,"-modal-info-link"));Array.prototype.forEach.call(n,(function(n){n.addEventListener("click",(function(n){n.target.id="sezzle-modal-return",e._disableBodyScroll(!0),document.getElementsByClassName("sezzle-".concat(t,"-modal"))[0].style.display="block",document.getElementsByClassName("sezzle-".concat(t,"-modal"))[0].focus(),e._widgetEventLogger.logEvent("onclick-".concat(t))}))}))}}))}},{key:"_disableBodyScroll",value:function(e){var t=document.body;e?(this._scrollDistance=window.pageYOffset||(document.documentElement.clientHeight?document.documentElement.scrollTop:document.body.scrollTop)||0,t.classList.add("sezzle-modal-open"),t.style.top="".concat(-1*this._scrollDistance,"px")):(t.classList.remove("sezzle-modal-open"),window.scrollTo(0,this._scrollDistance),t.style.top=0,document.getElementsByClassName("sezzle-modal")[0].scrollTop=0,this._scrollDistance=0)}},{key:"modalKeyboardNavigation",value:function(){var e=this,t=Array.prototype.slice.call(document.querySelector(".sezzle-modal-content").childNodes);t.unshift(document.querySelector("button.close-sezzle-modal"));var n=t[0],r=t[t.length-1],o={};document.addEventListener("keydown",(function(t){if(("Shift"===t.key||"Control"===t.key)&&(t.stopImmediatePropagation(),o[t.key]=!0),document.addEventListener("keyup",(function(e){delete o[e.key]})),o.Control&&!o.Shift&&"Tab"===t.key&&document.activeElement===r)n.focus();else if(o.Shift&&"Tab"===t.key&&document.activeElement===n)r.focus();else if("Escape"===t.key){for(var i=document.getElementsByClassName("sezzle-checkout-modal-lightbox"),a=0;a<i.length;a++)i[a].style.display="none",e._disableBodyScroll(!1);var c=document.querySelector("#sezzle-modal-return");c?(c.focus(),c.removeAttribute("id")):document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon")?document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon").focus():document.querySelector(".sezzle-checkout-button-wrapper").focus()}}))}},{key:"_renderModal",value:(r=w().mark((function e(){var t,n,r;return w().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,(t=document.getElementsByClassName("sezzle-checkout-modal-lightbox")).length?this._modalNode=t[0]:(this._modalNode=document.createElement("section"),this._modalNode.className="sezzle-checkout-modal-lightbox close-sezzle-modal",this._modalNode.style.display="none",this._modalNode.role="dialog",this._modalNode.ariaLabel=this._languageConfig.getSezzleInformation(),this._modalNode.style.maxHeight="100%",this._modalNode.lang=this._languageConfig._language,document.getElementsByTagName("html")[0].appendChild(this._modalNode)),!document.sezzleDefaultModalVersion||!document.sezzleModalAvailableLanguages){e.next=11;break}return document.sezzleModalAvailableLanguages.split(",").map((function(e){return e.trim()})).indexOf(this._languageConfig._language)>-1?document.modalLanguage=this._languageConfig._language:document.modalLanguage="en",n="".concat(this._widgetConfig.apiEndpoints.sezzleAssetsCDN).concat(document.sezzleDefaultModalVersion),e.next=9,o.httpRequestWrapper("GET",n);case 9:r=e.sent,this._modalNode.innerHTML=r;case 11:this._loadModalScript(),this._closeSezzleModalHandler(),e.next=18;break;case 15:e.prev=15,e.t0=e.catch(0),this._widgetEventLogger.logEvent("error",e.t0.message);case 18:case"end":return e.stop()}}),e,this,[[0,15]])})),i=function(){var e=this,t=arguments;return new Promise((function(n,o){var i=r.apply(e,t);function a(e){E(i,n,o,a,c,"next",e)}function c(e){E(i,n,o,a,c,"throw",e)}a(void 0)}))},function(){return i.apply(this,arguments)})},{key:"_closeSezzleModalHandler",value:function(){var e=this;Array.prototype.forEach.call(document.getElementsByClassName("close-sezzle-modal"),(function(t){t.addEventListener("click",(function(t){e._disableBodyScroll(!1),e._modalNode.style.display="none",e._modalNode.getElementsByClassName("sezzle-modal")[0].className="sezzle-modal sezzle-checkout-modal-hidden";var n=document.querySelector("#sezzle-modal-return");n?(n.focus(),n.removeAttribute("id")):document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon")?document.querySelector(".sezzle-checkout-button-wrapper").querySelector(".sezzle-info-icon").focus():document.querySelector(".sezzle-checkout-button-wrapper").focus()}))}));var t=document.getElementsByClassName("sezzle-modal")[0];t||(t=document.getElementsByClassName("sezzle-checkout-modal-lightbox")[0]),t.addEventListener("click",(function(e){return e.stopPropagation()}))}},{key:"_renderOtherVendorModals",value:function(){var e=this;this._vendorsSupportedForDualInstall.forEach((function(t){if(document.getElementsByClassName("".concat(t,"-modal-info-link")).length>0){var n=document.createElement("section");n.className="sezzle-checkout-modal-lightbox sezzle-".concat(t,"-modal"),n.style="position: center",n.style.display="none",n.role="dialog",n.ariaLabel="".concat(t," Information"),n.name="Learn more about ".concat(t),n.innerHTML=e._widgetConfig["".concat(t,"ModalHTML")]||"",document.getElementsByTagName("html")[0].appendChild(n),n.addEventListener("click",(function(r){e._disableBodyScroll(!1),n.style.display="none";var o=document.querySelector("#sezzle-modal-return");o?(o.focus(),o.removeAttribute("id")):document.querySelector(".".concat(t,"-modal-info-link"))?document.querySelector(".sezzle-checkout-button-wrapper").getElementsByClassName("".concat(t,"-modal-info-link"))[0].focus():document.querySelector(".sezzle-checkout-button-wrapper").focus(),r.stopPropagation()}))}}))}},{key:"_addPromoToModal",value:function(){if(document.sezzlePromotion){var e=document.createElement("div");e.className="promo";var t=this._promotion.getModalPromotionString();if(t.includes(this._promotion.promoInitiative.name)){var n=document.createElement("a");n.href=this._promotion.promoInitiative.link,n.target="_blank",n.rel="noopener",n.textContent=this._promotion.promoInitiative.name;var r=function(e){if(Array.isArray(e))return e}(c=t.split(this._promotion.promoInitiative.name))||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(c)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(e,t):void 0}}(c)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),o=r[0],i=r.slice(1);e.append(o,n,i)}else e.append(t);var a=document.querySelector(".terms");a.parentElement.insertBefore(e,a)}var c}},{key:"_loadModalScript",value:function(){if(!document.sezzleDefaultModalVersion||!document.sezzleModalAvailableLanguages)return null;var e=document.head,t=document.createElement("script");t.innerHTML=this._modalNode.querySelector("script").innerHTML,e.appendChild(t)}},{key:"_processContentForModal",value:function(e){if(!document.sezzleDefaultModalVersion||!document.sezzleModalAvailableLanguages)return null;var t=this._priceProcessor.getParsedPrice(e.priceElement,e.configGroup.ignoredPriceElements,e.configGroup.ignoredFormattedPriceText);if(!t)return this._widgetEventLogger.logEvent("warning","Cannot render modal. Failed to parse price for the element ".concat(e.id||e.className)),null;var n=this._priceProcessor.getProductPriceEligibility(t);n.isLongTermPaymentEligible?document.longTermPayment=this._priceProcessor.getFormattedLongTermPaymentInfo(t,"$"):document.longTermPayment=null,this._executeModalScript(n.isLongTermPaymentEligible)}},{key:"_executeModalScript",value:function(e){ModalUI?ModalUI.load():this._widgetEventLogger.logEvent("error","ModalUI is undefined. Problem adding modal script to the document"),e||this._addPromoToModal()}}],n&&z(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const S=_;function k(e){return k="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},k(e)}function P(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==k(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==k(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===k(o)?o:String(o)),r)}var o}function C(e,t,n){L(e,t),t.set(e,n)}function L(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function x(e,t,n,r){return I(e,t),F(n,"set"),A(e,n,r),r}function T(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function O(e,t){return W(e,N(e,t,"get"))}function j(e,t,n){return A(e,N(e,t,"set"),n),n}function N(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function A(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}function M(e,t,n){return I(e,t),F(n,"get"),W(e,n)}function F(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}function I(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}function W(e,t){return t.get?t.get.call(e):t.value}var G=new WeakMap,D=new WeakMap,B=new WeakMap,q=new WeakSet,R=function(){function e(t){var n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),L(this,n=q),n.add(this),C(this,G,{writable:!0,value:void 0}),C(this,D,{writable:!0,value:void 0}),C(this,B,{writable:!0,value:void 0}),!M(e,e,H))throw new Error("Use static initializer to initialize the logger");j(this,G,t),j(this,D,[]),j(this,B,[])}var t,n,r;return t=e,r=[{key:"NewWidgetEventLogger",value:function(t){return M(e,e,V)||(x(e,e,H,!0),x(e,e,V,new e(t))),M(e,e,V)}},{key:"Destruct",value:function(){x(e,e,V,null)}}],(n=[{key:"logEvent",value:function(e,t){var n={name:e,description:t||"",createdAt:(new Date).toJSON()},r=n.name.startsWith("onclick");!r&&this.isEventLogged(n.name,n.description)||(O(this,D).push(n),r&&(T(this,q,U).call(this),j(this,D,[])))}},{key:"isEventLogged",value:function(e,t){return O(this,D).some((function(n){return n.name===e&&n.description===t}))}},{key:"isEventSent",value:function(e,t){return O(this,B).some((function(n){return n.name===e&&n.description===t}))}},{key:"forceSendEvents",value:function(){T(this,q,U).call(this),j(this,D,[])}}])&&P(t.prototype,n),r&&P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function U(){var e=this;try{var t=[];O(this,D).forEach((function(n){var r,o,i,a;e.isEventSent(n.name,n.description)||(t.push({event_name:n.name,description:n.description,merchant_uuid:null!==(r=O(e,G))&&void 0!==r?r:"",merchant_site:window.location.hostname,created_at:n.createdAt,theme:{name:(null===(o=window)||void 0===o||null===(o=o.Shopify)||void 0===o?void 0:o.theme.name)||"",id:(null===(i=window)||void 0===i||null===(i=i.Shopify)||void 0===i?void 0:i.theme.theme_store_id)||0,role:(null===(a=window)||void 0===a||null===(a=a.Shopify)||void 0===a?void 0:a.theme.role)||""}}),n.name.startsWith("onclick")||O(e,B).push(n))})),t.length>0&&o.sendEvents(t)}catch(e){console.log(e)}}var H={writable:!0,value:void 0},V={writable:!0,value:void 0};const $=R;function X(e){return X="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},X(e)}function Y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==X(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==X(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===X(o)?o:String(o)),r)}var o}const J=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._numberOfPayments=t,this._defaultLanguage="en",this._translations={en:"or ".concat(this._numberOfPayments," interest-free payments of %%price%%{promotext} with %%logo%%{apDualInstallText}{thresholdPriceText} %%info%%"),fr:"ou ".concat(this._numberOfPayments," paiements de %%price%% sans intérêts{promotext} avec %%logo%%{apDualInstallText}{thresholdPriceText} %%info%%"),es:"o ".concat(this._numberOfPayments," pagos sin intereses de %%price%%{promotext} con %%logo%%{apDualInstallText}{thresholdPriceText} %%info%%")},this._longTermTranslations={en:"or monthly payments as low as %%price%% with %%logo%% %%info%%",fr:"ou des paiements mensuels aussi bas que %%price%% avec %%logo%% %%info%%",es:"o pagos mensuales tan bajos como %%price%% con %%logo%% %%info%%"},this._apDualInstallTranslations={en:" or %%afterpay-logo%%",fr:" ou %%afterpay-logo%%",es:" o %%afterpay-logo%%"},this._thresholdPriceTextTranslations={en:" for orders over %%min-price%%",fr:" pour les achats de plus de %%min-price%%",es:" por compras superiores a %%min-price%%"},this._sezzleInformation={en:"Sezzle Information",fr:"Informations Sezzle",es:"Información de Sezzle"},this._clickToLearnMore={en:"Click to learn more about",fr:"Cliquez pour en savoir plus sur",es:"Haga clic para obtener más información sobre"},this._language=null}var t,n;return t=e,(n=[{key:"getTranslation",value:function(){return this._translations[this._language]}},{key:"getLongTermWidgetText",value:function(){return this._longTermTranslations[this._language]}},{key:"getThresholdPriceText",value:function(){return this._thresholdPriceTextTranslations[this._language]}},{key:"getApDualInstallText",value:function(){return this._apDualInstallTranslations[this._language]}},{key:"getSezzleInformation",value:function(){return this._sezzleInformation[this._language]}},{key:"getClickToLearnMore",value:function(){return this._clickToLearnMore[this._language]}},{key:"setLanguage",value:function(e){var t;(t="function"==typeof e?e():e)&&"string"==typeof t||(t=document.querySelector("html").lang);var n=t.substring(0,2).toLowerCase();t.split("-")[1],this._checkIfLanguageIsValid(n)?this._language=n:this._language=this._defaultLanguage}},{key:"_checkIfLanguageIsValid",value:function(e){var t=0;return Object.getOwnPropertyNames(this._translations).forEach((function(n){n===e&&t++})),t>0}},{key:"getLanguage",value:function(){return this._language}}])&&Y(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function K(e){return K="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},K(e)}function Q(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==K(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==K(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===K(o)?o:String(o)),r)}var o}const Z=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.promoTranslations={main:{reward:{is_new_user_only:{true:{threshold:{true:{promocode:{true:[{en:". Get {money} back on your first purchase of {threshold} or more using promo code {promocode}"},{fr:". {money} remboursés sur votre premier achat de {threshold} ou plus en utilisant le code promo {promocode}"},{es:". Consigue {money} de vuelta en tu primera compra de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} back on your first purchase of {threshold} or more"},{fr:". {money} remboursés sur votre premier achat de {threshold} ou plus"},{es:". Recibe {money} de vuelta en tu primera compra de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} back on your first purchase using promo code {promocode}"},{fr:". {money} remboursés sur votre premier achat en utilisant le code promo {promocode}"},{es:". Recibe {money} de vuelta en tu primera compra usando el código promocional {promocode}"}],false:[{en:". Get {money} back on your first purchase"},{fr:". {money} remboursés sur votre premier achat"},{es:". Recibe {money} de vuelta en tu primera compra"}]}}}},false:{threshold:{true:{promocode:{true:[{en:". Get {money} back on purchases of {threshold} or more using promo code {promocode}"},{fr:". Recevez {money} de remboursement sur vos achats de {threshold} ou plus en utilisant le code promo {promocode}"},{es:". Obtén {money} de vuelta en compras de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} back on purchases of {threshold} or more"},{fr:". Obtenez {money} de remboursement sur vos achats de plus de {threshold}"},{es:". Obtén {money} de vuelta en tus compras de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} back using promo code {promocode}"},{fr:". {money} remboursés en utilisant le code promo {promocode}"},{es:". Recibe {money} de vuelta usando el código promocional {promocode}"}],false:[{en:". Get {money} back"},{fr:". {money} remboursés"},{es:". Recibe {money} de vuelta"}]}}}}}},discount:{is_new_user_only:{true:{threshold:{true:{promocode:{true:[{en:". Get {money} off your first purchase of {threshold} or more using promo code {promocode}"},{fr:". Obtenez {money} de remise sur votre premier achat de {threshold} ou plus en utilisant le code promo {promocode}"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} off your first purchase of {threshold} or more"},{fr:". Obtenez {money} de remise sur votre premier achat de {threshold} ou plus"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} off your first purchase using promo code {promocode}"},{fr:". Obtenez {money} de remise sur votre premier achat en utilisant le code promo {promocode}"},{es:". Obtén {money} de descuento en tu primera compra usando el código promocional {promocode}"}],false:[{en:". Get {money} off your first purchase"},{fr:". Obtenez {money} de remise sur votre premier achat"},{es:". Obtén {money} de descuento en tu primera compra"}]}}}},false:{threshold:{true:{promocode:{true:[{en:". Get {money} off on purchases of {threshold} or more using promo code {promocode}"},{fr:". Obtenez {money} de remise sur vos achats de {threshold} ou plus en utilisant le code promo {promocode}"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más usando el código promocional {promocode}"}],false:[{en:". Get {money} off on purchases of {threshold} or more"},{fr:". Obtenez {money} de remise sur vos achats de {threshold} ou plus"},{es:". Obtén {money} de descuento en tu primera compra de {threshold} o más"}]}},false:{promocode:{true:[{en:". Get {money} off using promo code {promocode}"},{fr:". Obtenez {money} de remise en utilisant le code promo {promocode}"},{es:". Obtén {money} de descuento usando el código promocional {promocode}"}],false:[{en:". Get {money} off"},{fr:". Obtenez {money} de remise"},{es:". Obtén {money} de descuento"}]}}}}}}},modal:[{en:"Customer will receive {promoinitiative} award at the time of their purchase."},{fr:"Les clients obtiendront des {promoinitiative} en récompense au moment de leur achat."},{es:"Los clientes recibirán una recompensa {promoinitiative} al realizar la compra."}]}}var t,n;return t=e,(n=[{key:"getMainViewTranslationTextByLanguage",value:function(e,t,n,r,o,i){var a=this.promoTranslations.main[e].is_new_user_only[t].threshold[n].promocode[r];if(a){var c=a.find((function(e){return e["".concat(o)]}));return c?c["".concat(o)]:(c=a.find((function(e){return e["".concat(i)]})))["".concat(i)]}return""}},{key:"getModalViewTranslationTextByLanguage",value:function(e,t){var n=this.promoTranslations.modal;if(n){var r=n.find((function(t){return t["".concat(e)]}));return r?r["".concat(e)]:(r=n.find((function(e){return e["".concat(t)]})))["".concat(t)]}return""}}])&&Q(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ee(e){return ee="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ee(e)}function te(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==ee(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ee(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===ee(o)?o:String(o)),r)}var o}var ne=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.promoConfig=t,this.promoConfig&&(this.promoInitiative={name:this.promoConfig.promo_initiative_name,link:this.promoConfig.promo_initiative_link}),this.language=n._language,this.defaultLanguage=n._defaultLanguage,this.promoTranslations=new Z}var t,n,r;return t=e,r=[{key:"getPromotionString",value:function(t,n,r,o){var i=re[t.type],a=!!t.spend_award_threshold_in_cents,c=!!t.is_new_user_only&&t.is_new_user_only,l=!!t.promo_code,s=o.getMainViewTranslationTextByLanguage(i,c,a,l,n,r);return s=s.replace("{money}",e.format(n,t.currency_code,t.spend_award_in_cents)),a&&(s=s.replace("{threshold}",e.format(n,t.currency_code,t.spend_award_threshold_in_cents))),l&&(s=s.replace("{promocode}",t.promo_code)),s}},{key:"format",value:function(e,t,n){var r=new Intl.NumberFormat(e,{style:"currency",currency:t,minimumFractionDigits:0,maximumFractionDigits:0}),o=new Intl.NumberFormat(e,{style:"currency",currency:t,minimumFractionDigits:2}),i=parseInt(n)/100;return i%1==0?r.format(i):o.format(i)}}],(n=[{key:"getModalPromotionString",value:function(){return this.promoConfig?this.promoTranslations.getModalViewTranslationTextByLanguage(this.language,this.defaultLanguage).replace("{promoinitiative}",this.promoInitiative.name):""}},{key:"getPromotionString",value:function(){return this.promoConfig?e.getPromotionString(this.promoConfig,this.language,this.defaultLanguage,this.promoTranslations):""}}])&&te(t.prototype,n),r&&te(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),re={1:"reward",2:"discount"};const oe=ne;function ie(e){return ie="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ie(e)}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ce(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==ie(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==ie(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===ie(o)?o:String(o)),r)}var o}function le(e,t){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.add(e)}function se(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var ue=new WeakSet,fe=new WeakSet,he=new WeakSet,de=new WeakSet;function pe(e,t,n){if(n>0){var r=n/100/12,o=Math.pow(1+r,t);return e*r*o/(o-1)}return e/t}function me(e){return se(this,he,ge).call(this,e)[0]}function ge(e){var t,n=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return ae(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ae(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(this.terms);try{for(n.s();!(t=n.n()).done;){var r=t.value;if(e>r.price)return r.options}}catch(e){n.e(e)}finally{n.f()}return this.terms[this.terms.length-1].options}function ye(e){return Math.round(100*e)/100}const ve=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),le(this,de),le(this,he),le(this,fe),le(this,ue),this.terms=t||[{price:1e3,options:[[48,8.99],[36,7.99],[3,0]]},{price:500,options:[[24,7.99],[12,6.99],[3,0]]},{price:250,options:[[12,6.99],[9,5.99],[3,0]]},{price:100,options:[[9,5.99],[6,5.99],[3,0]]}]}var t,n;return t=e,(n=[{key:"getPaymentInfo",value:function(e){var t=this;if(!e||e<=0)throw new Error("Unable to calculate Long Term payments: product price is undefined or non-positive");var n=se(this,he,ge).call(this,e),r={productPrice:e,paymentTerms:[]};return r.paymentTerms=n.map((function(n){var r=n[0],o=n[1],i=se(t,ue,pe).call(t,e,r,o),a=se(t,de,ye).call(t,i*r);return{durationInMonths:r,apr:o,monthlyPayment:i,totalAmount:a,totalInterest:a-e}})),r.paymentTerms.sort((function(e,t){return e.monthlyPayment-t.monthlyPayment})),r}},{key:"calculateLowestAvailablePayment",value:function(e){if(!e||e<=0)throw new Error("Unable to calculate lowest Long Term payment: product price is undefined or non-positive");var t=se(this,fe,me).call(this,e);return se(this,ue,pe).call(this,e,t[0],t[1])}}])&&ce(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function be(e){return be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},be(e)}function we(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ee(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,(void 0,o=function(e,t){if("object"!==be(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==be(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(r.key),"symbol"===be(o)?o:String(o)),r)}var o}function ze(e,t,n){!function(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}(e,t),t.set(e,n)}function _e(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,ke(e,t,"get"))}function Se(e,t,n){return function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}}(e,ke(e,t,"set"),n),n}function ke(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var Pe=new WeakMap,Ce=new WeakMap,Le=function(){function e(t,n,r,o){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ze(this,Pe,{writable:!0,value:void 0}),ze(this,Ce,{writable:!0,value:void 0}),this.sezzleDOMFunctions=r,this.widgetEventLogger=o,this.widgetConfig=t,this.longTermPaymentConfig=n,Se(this,Pe,"{price}"),Se(this,Ce,2),this.thousandDelimiter=/\B(?=(\d{3})+(?!\d))/g,this.naFormat=/^\d{1,3}(,\d{3})+(\.\d+)?$/,this.euFormat=/^\d{1,3}(\.\d{3})+(,\d+)?$/,this.euFormatWithSpace=/^\d{1,3}(\s\d{3})+(,\d+)?$/,this.euDecimalsNoThousandDelimiterFormat=/(^\d+((,\d{1,2})|(,\d{4,}))$)|(^\d{4,},\d+$)/}var t,n;return t=e,(n=[{key:"getParsedPrice",value:function(e,t,n){var r=this.sezzleDOMFunctions.getPriceText(e,t);return r?(r=this.removeIgnoredPriceText(r,n),this.convertToNumber(r)):(this.widgetEventLogger.logEvent("warning","No price text after ignored price elements."),null)}},{key:"removeIgnoredPriceText",value:function(e,t){return e=e.replace("\n","").trim(),t&&t.forEach((function(t){var n=new RegExp(t,"ig");e=e.replace(n,"")})),e}},{key:"convertToNumber",value:function(e){var t=this,n=new RegExp(/\d+((\.|,|\s)\d+)*/g),r=o.matchAll(n,e);if(0===r.length||r.length>2)return this.widgetEventLogger.logEvent("warning","priceText ".concat(r," contains unexpected number of values")),null;var i={formatter:e.replace(n,_e(this,Pe)),prices:[]};return i.prices=r.map((function(e){var n,r=e;return t.naFormat.test(e)&&(r=e.replaceAll(",",""),n=t.naFormat),t.euFormat.test(e)&&(r=e.replaceAll(".","").replaceAll(",","."),n=t.euFormat),t.euFormatWithSpace.test(e)&&(r=e.replaceAll("/s","").replaceAll(",",".").replaceAll(" ",""),n=t.euFormatWithSpace),t.euDecimalsNoThousandDelimiterFormat.test(e)&&(r=e.replaceAll(",","."),n=t.euDecimalsNoThousandDelimiterFormat),NaN===parseFloat(r)&&t.widgetEventLogger.logEvent("warning","parsed price element text ".concat(r," is not a number")),{value:parseFloat(r),format:n}})),i}},{key:"getFormattedPrice",value:function(e,t){switch(t){case this.naFormat:return e.toString().replace(this.thousandDelimiter,",");case this.euFormat:return e.toString().replace(".",",").replace(this.thousandDelimiter,".");case this.euFormatWithSpace:return e.toString().replace(".",",").replace(this.thousandDelimiter," ");case this.euDecimalsNoThousandDelimiterFormat:return e.toString().replace(".",",");default:return e.toString()}}},{key:"getFormattedWidgetPrice",value:function(e,t){if(!e.prices||0===e.prices.length)throw new Error("Cannot get formatted widget price: no product prices are provided");var n,r=e.formatter,o=function(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return we(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?we(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}(e.prices);try{for(o.s();!(n=o.n()).done;){var i,a,c=n.value;a=t?new ve(this.longTermPaymentConfig.paymentTerms).calculateLowestAvailablePayment(c.value).toFixed(_e(this,Ce)):(c.value/this.widgetConfig.numberOfPayments).toFixed(_e(this,Ce)),i=this.getFormattedPrice(a,c.format),r=r.replace(_e(this,Pe),i)}}catch(e){o.e(e)}finally{o.f()}return r}},{key:"getFormattedMinPrice",value:function(e){var t=e.prices[0].format,n=e.formatter,r=this.getFormattedPrice(this.widgetConfig.minPrice/100,t),o=this.priceFormatContainsRange(n);return o?n.split(o)[0].replace(_e(this,Pe),r).trim():n.replace(_e(this,Pe),r)}},{key:"priceFormatContainsRange",value:function(e){var t="";return["–","-"].forEach((function(n){e.includes(n)&&(t=n)})),t}},{key:"getProductPriceEligibility",value:function(e){var t=100*e.prices[0].value;return{isPriceLessThanMinPrice:!!(t<this.widgetConfig.minPrice),isPriceGreaterThanMaxPrice:!!(t>this.widgetConfig.maxPrice),isLongTermPaymentEligible:!!(this.longTermPaymentConfig&&t>=this.longTermPaymentConfig.minPrice&&t<=this.longTermPaymentConfig.maxPrice)}}},{key:"getFormattedLongTermPaymentInfo",value:function(e,t){var n=this;if(!t)throw new Error("Cannot get formatted long term payment info: the currency symbol is not provided");var r=e.prices[0].value,o=new ve(this.longTermPaymentConfig.paymentTerms).getPaymentInfo(r),i={productPrice:t+o.productPrice.toFixed(_e(this,Ce)).replace(this.thousandDelimiter,","),paymentTerms:[]};return i.paymentTerms=o.paymentTerms.map((function(e){return{durationInMonths:e.durationInMonths,apr:e.apr,monthlyPayment:t+e.monthlyPayment.toFixed(_e(n,Ce)).replace(n.thousandDelimiter,","),totalAmount:t+e.totalAmount.toFixed(_e(n,Ce)).replace(n.thousandDelimiter,","),totalInterest:t+e.totalInterest.toFixed(_e(n,Ce)).replace(n.thousandDelimiter,",")}})),i}}])&&Ee(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const xe=Le;function Te(e){return Te="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(e)}function Oe(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return je(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?je(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,a=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){c=!0,i=e},f:function(){try{a||null==n.return||n.return()}finally{if(c)throw i}}}}function je(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ne(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Ae(r.key),r)}}function Ae(e){var t=function(e,t){if("object"!==Te(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Te(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Te(t)?t:String(t)}var Me,Fe,Ie,We=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this._widgetEventLogger=t}var t,n;return t=e,(n=[{key:"searchForCompetitorWidget",value:function(t){var n,r=Oe(e.competitorWidgets[t].tagNames);try{for(r.s();!(n=r.n()).done;){var o=n.value;if(document.getElementsByTagName(o).length)return!0}}catch(e){r.e(e)}finally{r.f()}var i,a=Oe(e.competitorWidgets[t].ids);try{for(a.s();!(i=a.n()).done;){var c=i.value;if(document.getElementById(c))return!0}}catch(e){a.e(e)}finally{a.f()}var l,s=Oe(e.competitorWidgets[t].classes);try{for(s.s();!(l=s.n()).done;){var u=l.value;if(document.getElementsByClassName(u).length)return!0}}catch(e){s.e(e)}finally{s.f()}}},{key:"logCompetitorEvents",value:function(){for(var t in e.competitorWidgets)this.searchForCompetitorWidget(t)&&this._widgetEventLogger.logEvent("competitor-widget",t)}}])&&Ne(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();Me=We,Ie={klarna:{tagNames:["klarna-placement"],ids:[],classes:[]},afterpay:{tagNames:["afterpay-placement"],ids:[],classes:["afterpay-paragraph"]},shoppay:{tagNames:["shopify-payment-terms","shop-pay-installments-banner"],ids:["shopify-installments"],classes:["shopify-installments"]},affirm:{tagNames:[],ids:["afffirm-promo-box"],classes:["affirm-as-low-as"]},paypal:{tagNames:[],ids:["paypal-commerce-proddetails-messaging-banner","paypal_message","paypal_message_container"],classes:["paypal-message","paypal-message-container"]},quadpay:{tagNames:["quadpay-widget"],ids:["qp-container"],classes:["qp-widget-container","qp-container"]},zip:{tagNames:["quadpay-widget-v3"],ids:["qp-container"],classes:["qp-container"]}},(Fe=Ae(Fe="competitorWidgets"))in Me?Object.defineProperty(Me,Fe,{value:Ie,enumerable:!0,configurable:!0,writable:!0}):Me[Fe]=Ie;const Ge=We;function De(e){return De="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},De(e)}function Be(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,qe(r.key),r)}}function qe(e){var t=function(e,t){if("object"!==De(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==De(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===De(t)?t:String(t)}function Re(e,t){Ue(e,t),t.add(e)}function Ue(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function He(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function Ve(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var $e=n(465),Xe=new WeakMap,Ye=new WeakSet,Je=new WeakSet,Ke=new WeakSet,Qe=new WeakSet,Ze=new WeakSet,et=new WeakSet,tt=new WeakSet,nt=new WeakSet,rt=new WeakSet,ot=new WeakSet,it=new WeakSet,at=new WeakSet,ct=function(){function e(t,n,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),Re(this,at),Re(this,it),Re(this,ot),Re(this,rt),Re(this,nt),Re(this,tt),Re(this,et),Re(this,Ze),Re(this,Qe),Re(this,Ke),Re(this,Je),Re(this,Ye),function(e,t,n){Ue(e,t),t.set(e,{writable:!0,value:void 0})}(this,Xe),function(e,t,n){(function(e,t,n){if(t.set)t.set.call(e,n);else{if(!t.writable)throw new TypeError("attempted to set read only private field");t.value=n}})(e,Ve(e,t,"set"),n)}(this,Xe,2e3),this.widgetConfig=t,this.widgetEventLogger=n,this.competitor=new Ge(this.widgetEventLogger),this.sezzleDOMFunctions=new y(t),this.language=r,this.promotion=new oe(document.sezzlePromotion,this.language),this.priceProcessor=new xe(t,document.longTermPaymentConfig,this.sezzleDOMFunctions,this.widgetEventLogger),this.modal=new S(t,n,this.promotion,this.priceProcessor,this.language)}var t,n;return t=e,n=[{key:"initializeRendering",value:function(){He(this,at,bt).call(this,this.widgetConfig.observeElements),He(this,Ye,lt).call(this,[]),this.modal.renderModals()}},{key:"mutationCallBack",value:function(e,t,n){var r=this;e.filter((function(e){return"childList"===e.type})).forEach((function(e){var o=e.target.dataset.sezzleindex,i=document.getElementsByClassName("sezzleindex-".concat(o))[0];if(i){var a=i.parentElement,c=a.parentElement.parentElement;try{c.classList.remove("sezzle-hidden");var l=n.getParsedPrice(e.target,t.ignoredPriceElements,t.ignoredFormattedPriceText),s=n.getProductPriceEligibility(l);(s.isPriceGreaterThanMaxPrice&&!s.isLongTermPaymentEligible||!s.isLongTermPaymentEligible&&r.widgetConfig.config.isLongTermOnly)&&c.classList.add("sezzle-hidden");var u=r.getWidgetInnerContent(t,o,s,l);a.innerHTML=u.innerHTML}catch(e){c.classList.add("sezzle-hidden"),r.widgetEventLogger.logEvent("warning",e.message)}}}))}},{key:"render",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;try{if(e.classList.contains("sezzle-ignored-price-element"))return null;var r=this.priceProcessor.getParsedPrice(e,n.ignoredPriceElements,n.ignoredFormattedPriceText);if(!r)return this.widgetEventLogger.logEvent("warning","Cannot render widget. Failed to parse price for the element ".concat(e.id||e.className)),null;var o=this.priceProcessor.getProductPriceEligibility(r);if(o.isPriceGreaterThanMaxPrice&&!o.isLongTermPaymentEligible||!o.isLongTermPaymentEligible&&this.widgetConfig.config.isLongTermOnly)return null;var i=this.sezzleDOMFunctions.getElementToRender(e,t);e.dataset.sezzleindex=t,"auto"===n.alignment&&(n.alignment=He(this,Ke,ut).call(this,e));var a=document.createElement("div");a.className="sezzle-shopify-info-button sezzlewidgetindex-".concat(t),He(this,Qe,ft).call(this,a),n.containerStyle!=={}&&He(this,Ze,ht).call(this,a,n);var c=document.createElement("div");c.ariaHasPopup="dialog",c.role="button",c.className="sezzle-checkout-button-wrapper sezzle-modal-link",c.tabIndex=0,c.style.cursor="pointer",He(this,Qe,ft).call(this,c),He(this,et,dt).call(this,c,n);var l=this.getWidgetInnerContent(n,t,o,r);return c.appendChild(l),a.appendChild(c),n.widgetIsFirstChild?He(this,it,vt).call(this,a,i):He(this,ot,yt).call(this,a,i),a}catch(e){return this.widgetEventLogger.logEvent("error","An exception occurred when rendering a widget: ".concat(e.message)),null}}},{key:"getWidgetInnerContent",value:function(e,t,n,r){var o=this,i=document.createElement("div");return i.className="sezzle-button-text",i.style.fontSize="14px",i.style.lineHeight="18px",e.textStyle!=={}&&He(this,tt,pt).call(this,i,e),He(this,et,dt).call(this,i,e),He(this,nt,mt).call(this,i,e),He(this,Je,st).call(this,e,n).forEach((function(a){switch(a){case"price":var c=document.createElement("span");c.className="sezzle-payment-amount sezzle-button-text sezzleindex-".concat(t);var l=o.priceProcessor.getFormattedWidgetPrice(r,n.isLongTermPaymentEligible),s=document.createTextNode(l);c.appendChild(s),i.appendChild(c);break;case"logo":var u=document.createElement("img");u.className="sezzle-logo ".concat(e.imageClassName),u.src=e.imageURL,u.alt="Sezzle",u.style.height="18px",u.style.width="72px",i.appendChild(u),e.logoStyle!=={}&&He(o,rt,gt).call(o,u,e);break;case"info":var f=document.createElement("div");f.ariaLabel="".concat(o.language.getClickToLearnMore," Sezzle"),f.name="".concat(o.language.getClickToLearnMore," Sezzle"),f.className="sezzle-info-icon",f.innerHTML="&#9432;",f.style="font-size: ".concat(e.textStyle.fontSize,"px;"),i.appendChild(f);break;case"afterpay-logo":var h=document.createElement("img");h.className="sezzle-ap-logo ap-modal-info-link no-sezzle-info",h.src="https://media.sezzle.com/sezzle-credit-website-assets/ap-badge-black-on-mint.svg",h.alt="".concat(o.language.getClickToLearnMore," Afterpay"),i.appendChild(h);break;case"line-break":var d=document.createElement("br");i.appendChild(d);break;case"min-price":var p=document.createElement("span");p.className="sezzle-payment-amount sezzle-button-text sezzleindex-".concat(t);var m=o.priceProcessor.getFormattedMinPrice(r),g=document.createTextNode(m);p.appendChild(g),i.appendChild(p);break;default:var y=document.createTextNode(a);i.appendChild(y)}})),i}}],n&&Be(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function lt(e){var t=this;e=e.filter((function(e){return null!=e.widget})),this.widgetConfig.configGroups.forEach((function(n,r){t.sezzleDOMFunctions.getElementsByXPath(n.xpath).forEach((function(o){if(!o.hasAttribute("data-sezzleindex")){var i=t.render(o,r,n);if(i){t.widgetEventLogger.logEvent("onload");try{var a={priceElement:o,observer:t.sezzleDOMFunctions.startObserve(o,(function(e){t.mutationCallBack(e,n,t.priceProcessor)})),widget:i,configGroup:n};e.push(a),t.modal.addClickEventForModal(a),t.sezzleDOMFunctions.observeRelatedElements(a.priceElement,a.widget,a.configGroup.relatedElementActions)}catch(e){t.widgetEventLogger.logEvent("warning","The widget has been rendered, but an error occurred when running additional instructions: ".concat(e.message))}}}}))})),e.forEach((function(e){document.body.contains(e.priceElement)||(null!==e.observer&&e.observer.disconnect(),e.widget.remove(),e.widget=null)}));for(var n=0,r=this.widgetConfig.configGroups.length;n<r;n++)this.sezzleDOMFunctions.hideSezzleHideElements(n);window.addEventListener("load",(function(){var n;setTimeout((function(){He(t,Ye,lt).call(t,e),t.competitor.logCompetitorEvents(),t.widgetEventLogger.forceSendEvents()}),function(e,t){return t.get?t.get.call(e):t.value}(n=t,Ve(n,Xe,"get")))}));var o=document.getElementsByClassName("sezzle-")[0];void 0!==o&&(o.classList.contains("sezzle-hidden")||o.classList.add("sezzle-hidden"))}function st(e,t){var n;if(n=t.isLongTermPaymentEligible?this.language.getLongTermWidgetText():this.language.getTranslation(),t.isPriceLessThanMinPrice){var r=this.language.getThresholdPriceText();n=n.replace("{thresholdPriceText}",r)}else if(this.widgetConfig.apDualInstall){var o=this.language.getApDualInstallText();n=n.replace("{apDualInstallText}",o)}n=(n=n.replace("{apDualInstallText}","")).replace("{thresholdPriceText}","");var i=this.promotion.getPromotionString();return n.replace("{promotext}",i).split("%%")}function ut(e){if(!e)return"left";var t=window.getComputedStyle(e).textAlign;return"start"===t||"justify"===t?"left":"end"===t?"right":t}function ft(e){return e.className+=" sezzle-".concat(this.widgetConfig.merchantID),e}function ht(e,t){Object.keys(t.containerStyle).forEach((function(n){e.style[n]=t.containerStyle[n]}))}function dt(e,t){var n="";if(matchMedia&&t.alignmentSwitchMinWidth&&t.alignmentSwitchType){var r="(min-width: ".concat(t.alignmentSwitchMinWidth,"px)");window.matchMedia(r).matches||(n=t.alignmentSwitchType)}var o=n||t.alignment||"auto";e.className+=" sezzle-".concat(o)}function pt(e,t){Object.keys(t.textStyle).forEach((function(n){e.style[n]=t.textStyle[n]}))}function mt(e,t){switch(t.theme){case"dark":case"white-flat":e.className+=" szl-dark";break;default:e.className+=" szl-light"}}function gt(e,t){Object.keys(t.logoStyle).forEach((function(n){e.style[n]=t.logoStyle[n]}))}function yt(e,t){t.parentNode.insertBefore(e,t.nextSibling)}function vt(e,t){for(t.parentElement.insertBefore(e,t);e.previousSibling;)e.parentElement.insertBefore(e,e.previousSibling)}function bt(e){Array.isArray(e)&&0!=e.length&&e.forEach((function(e){var t=document.querySelectorAll(e.element);t.length>0&&t.forEach((function(t){t.addEventListener(e.eventType,(function(){document.querySelector("[data-sezzleindex]").removeAttribute("data-sezzleindex"),document.querySelector(".sezzle-shopify-info-button").remove();var e=$.NewWidgetEventLogger(document.sezzleConfig.merchantID);new Ct($e(document.sezzleConfig),e).init()}))}))}))}const wt=ct;function Et(e){return Et="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Et(e)}function zt(){zt=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof y?t:y,a=Object.create(i.prototype),c=new T(r||[]);return o(a,"_invoke",{value:P(e,n,c)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var h="suspendedStart",d="suspendedYield",p="executing",m="completed",g={};function y(){}function v(){}function b(){}var w={};s(w,a,(function(){return this}));var E=Object.getPrototypeOf,z=E&&E(E(O([])));z&&z!==n&&r.call(z,a)&&(w=z);var _=b.prototype=y.prototype=Object.create(w);function S(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function n(o,i,a,c){var l=f(e[o],e,i);if("throw"!==l.type){var s=l.arg,u=s.value;return u&&"object"==Et(u)&&r.call(u,"__await")?t.resolve(u.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(u).then((function(e){s.value=e,a(s)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function P(t,n,r){var o=h;return function(i,a){if(o===p)throw new Error("Generator is already running");if(o===m){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=C(c,r);if(l){if(l===g)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var s=f(t,n,r);if("normal"===s.type){if(o=r.done?m:d,s.arg===g)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(o=m,r.method="throw",r.arg=s.arg)}}}function C(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,C(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function L(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 T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(L,this),this.reset(!0)}function O(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(Et(t)+" is not iterable")}return v.prototype=b,o(_,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:v,configurable:!0}),v.displayName=s(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,s(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},S(k.prototype),s(k.prototype,c,(function(){return this})),t.AsyncIterator=k,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new k(u(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(_),s(_,l,"Generator"),s(_,a,(function(){return this})),s(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=O,T.prototype={constructor:T,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(x),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),s=r.call(a,"finallyLoc");if(l&&s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,g):this.complete(a)},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),g},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),g}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;x(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:O(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},t}function _t(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function St(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){_t(i,r,o,a,c,"next",e)}function c(e){_t(i,r,o,a,c,"throw",e)}a(void 0)}))}}function kt(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,Pt(r.key),r)}}function Pt(e){var t=function(e,t){if("object"!==Et(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==Et(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===Et(t)?t:String(t)}const Ct=function(){function e(t,n){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.basicWidgetConfiguration=t,this.widgetEventLogger=n,this.competitor=new Ge(this.widgetEventLogger)}var t,n,r,i,a;return t=e,n=[{key:"init",value:(a=St(zt().mark((function e(){var t,n,r,i;return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.widgetEventLogger.logEvent("request"),(t=o._getCookie("shopify_pay_redirect"))&&this.widgetEventLogger.logEvent("shopify-pay-redirect-".concat(t)),n=new J(4),r=new p(this.basicWidgetConfiguration,n,this.widgetEventLogger),e.next=8,r._setAPModalHTML();case 8:if(!((i=r.getSezzleConfig).configGroups.length>0)){e.next=12;break}return e.next=12,this.initializeWidget(i,n);case 12:e.next=17;break;case 14:e.prev=14,e.t0=e.catch(0),this.widgetEventLogger.logEvent("error",e.t0.message);case 17:this.widgetEventLogger.forceSendEvents();case 18:case"end":return e.stop()}}),e,this,[[0,14]])}))),function(){return a.apply(this,arguments)})},{key:"initializeWidget",value:(i=St(zt().mark((function e(t,n){return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loadCSS();case 2:new wt(t,this.widgetEventLogger,n).initializeRendering(),o.isWidgetDuplicateFound()&&this.widgetEventLogger.logEvent("duplicate-widget"),this.competitor.logCompetitorEvents();case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return i.apply(this,arguments)})},{key:"_loadCSS",value:(r=St(zt().mark((function e(){var t,n,r,i,a,c;return zt().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=document.sezzleCssVersionOverride){e.next=8;break}return n="".concat(o.getWidgetBaseUrl(),"/v1/css/price-widget?uuid=").concat(this.basicWidgetConfiguration.merchantID),e.next=5,o.httpRequestWrapper("GET",n);case 5:r=e.sent,r=JSON.parse(r),t=r.version;case 8:i=document,a=i.head,(c=document.createElement("link")).type="text/css",c.rel="stylesheet",c.href="https://media.sezzle.com/shopify-app/assets/".concat(t),a.appendChild(c);case 14:case"end":return e.stop()}}),e,this)}))),function(){return r.apply(this,arguments)})}],n&&kt(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();var Lt=n(465);!function(){var e=Lt(document.sezzleConfig),t=null==e?void 0:e.merchantID,n=$.NewWidgetEventLogger(t||"");if(!function(e){return!!e&&(document.sezzleJSMerchantUUIDs||(document.sezzleJSMerchantUUIDs=[]),!!document.sezzleJSMerchantUUIDs.includes(e)||(document.sezzleJSMerchantUUIDs.push(e),!1))}(t)){if(!e)return n.logEvent("request"),void n.logEvent("error","No sezzleConfig is found in the document. Check that at least a default or a custom override config is presented for the merchant");t||n.logEvent("warning","Merchant UUID is not provided"),o.WaitForBodyToBeReady().then((function(){new Ct(e,n).init()}))}}()})()})();