document.sezzleButtonVersion = "sezzle-widget22.8.0.js";
document.sezzleCssVersionOverride = "sezzle-styles-global2.1.0.css";
document.widgetServerBaseUrl = "https://widget.sezzle.com";
document.geoIpBaseUrl = "https://geoip.sezzle.com";
document.sezzleDefaultModalVersion = "sezzle-modal-3.0.7.html";
document.sezzleModalAvailableLanguages = "en,fr,es";

// Sezzle's merchant widget config override
document.sezzleConfig = {
"configGroups": [{
"targetXPath": "#productPrice-product-template/.visually-hidden",
"renderToPath": "../../..",
"urlMatch": "product",
"ignoredFormattedPriceText": ["Sale price","Regular price"],
"relatedElementActions": [
{
"relatedPath": ".",
"initialAction": function(r,w){
if(r.firstElementChild && r.firstElementChild.textContent === "Regular price" ){
w.style.display = "none"
}
if(w.nextElementSibling && w.nextElementSibling.className.indexOf("sezzle-shopify-info-button") > -1){
w.nextElementSibling.style.display = "none"
}
}
}
]
},{
"targetXPath": ".cart-subtotal--price/.visually-hidden",
"urlMatch": "cart"
}]
}

if (document.sezzleConfig){
   document.sezzleConfig.merchantID = '217a9c57-4633-4116-81ad-68fc305e6c81';

   // 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-widget22.8.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]",s="[object Function]",l="[object GeneratorFunction]",u="[object Map]",f="[object Number]",d="[object Object]",h="[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]",C="[object Int16Array]",k="[object Int32Array]",x="[object Uint8Array]",P="[object Uint8ClampedArray]",L="[object Uint16Array]",S="[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[C]=N[k]=N[u]=N[f]=N[d]=N[p]=N[m]=N[g]=N[y]=N[x]=N[P]=N[L]=N[S]=!0,N["[object Error]"]=N[s]=N[v]=!1;var A="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g,F="object"==typeof self&&self&&self.Object===Object&&self,W=A||F||Function("return this")(),M=t&&!t.nodeType&&t,I=M&&e&&!e.nodeType&&e,D=I&&I.exports===M;function G(e,t){return e.set(t[0],t[1]),e}function B(e,t){return e.add(t),e}function R(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 q(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 $(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n}var V,X=Array.prototype,Y=Function.prototype,J=Object.prototype,K=W["__core-js_shared__"],Z=(V=/[^.]+$/.exec(K&&K.keys&&K.keys.IE_PROTO||""))?"Symbol(src)_1."+V:"",Q=Y.toString,ee=J.hasOwnProperty,te=J.toString,ne=RegExp("^"+Q.call(ee).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),re=D?W.Buffer:void 0,oe=W.Symbol,ie=W.Uint8Array,ae=H(Object.getPrototypeOf,Object),ce=Object.create,se=J.propertyIsEnumerable,le=X.splice,ue=Object.getOwnPropertySymbols,fe=re?re.isBuffer:void 0,de=H(Object.keys,Object),he=We(W,"DataView"),pe=We(W,"Map"),me=We(W,"Promise"),ge=We(W,"Set"),ye=We(W,"WeakMap"),ve=We(Object,"create"),be=Be(he),we=Be(pe),Ee=Be(me),ze=Be(ge),_e=Be(ye),Ce=oe?oe.prototype:void 0,ke=Ce?Ce.valueOf:void 0;function xe(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 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 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 Se(e){this.__data__=new Pe(e)}function Te(e,t,n){var r=e[t];ee.call(e,t)&&Re(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function Oe(e,t){for(var n=e.length;n--;)if(Re(e[n][0],t))return n;return-1}function je(e,t,n,r,o,h,v){var O;if(r&&(O=h?r(e,o,h,v):r(e)),void 0!==O)return O;if(!Ve(e))return e;var j=qe(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=Ie(e),F=A==s||A==l;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==d||A==i||F&&!h){if(q(e))return h?e:{};if(O=function(e){return"function"!=typeof e.constructor||Ge(e)?{}:Ve(t=ae(e))?ce(t):{};var t}(F?{}:e),!t)return function(e,t){return Ae(e,Me(e),t)}(e,function(e,t){return e&&Ae(t,Xe(t),e)}(O,e))}else{if(!N[A])return h?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 C:case k:case x:case P:case L:case S: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 R(t?n(U(e),!0):U(e),G,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 R(t?n($(e),!0):$(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 Se);var W=v.get(e);if(W)return W;if(v.set(e,O),!j)var M=n?function(e){return function(e,t,n){var r=t(e);return qe(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,Me)}(e):Xe(e);return function(e,t){for(var n=-1,r=e?e.length:0;++n<r&&!1!==t(e[n],n););}(M||e,(function(o,i){M&&(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 Fe(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 We(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return function(e){return!(!Ve(e)||(t=e,Z&&Z in t))&&($e(e)||q(e)?ne:O).test(Be(e));var t}(n)?n:void 0}xe.prototype.clear=function(){this.__data__=ve?ve(null):{}},xe.prototype.delete=function(e){return this.has(e)&&delete this.__data__[e]},xe.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},xe.prototype.has=function(e){var t=this.__data__;return ve?void 0!==t[e]:ee.call(t,e)},xe.prototype.set=function(e,t){return this.__data__[e]=ve&&void 0===t?r:t,this},Pe.prototype.clear=function(){this.__data__=[]},Pe.prototype.delete=function(e){var t=this.__data__,n=Oe(t,e);return!(n<0||(n==t.length-1?t.pop():le.call(t,n,1),0))},Pe.prototype.get=function(e){var t=this.__data__,n=Oe(t,e);return n<0?void 0:t[n][1]},Pe.prototype.has=function(e){return Oe(this.__data__,e)>-1},Pe.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 xe,map:new(pe||Pe),string:new xe}},Le.prototype.delete=function(e){return Fe(this,e).delete(e)},Le.prototype.get=function(e){return Fe(this,e).get(e)},Le.prototype.has=function(e){return Fe(this,e).has(e)},Le.prototype.set=function(e,t){return Fe(this,e).set(e,t),this},Se.prototype.clear=function(){this.__data__=new Pe},Se.prototype.delete=function(e){return this.__data__.delete(e)},Se.prototype.get=function(e){return this.__data__.get(e)},Se.prototype.has=function(e){return this.__data__.has(e)},Se.prototype.set=function(e,t){var n=this.__data__;if(n instanceof Pe){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 Me=ue?H(ue,Object):function(){return[]},Ie=function(e){return te.call(e)};function De(e,t){return!!(t=null==t?o:t)&&("number"==typeof e||j.test(e))&&e>-1&&e%1==0&&e<t}function Ge(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||J)}function Be(e){if(null!=e){try{return Q.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function Re(e,t){return e===t||e!=e&&t!=t}(he&&Ie(new he(new ArrayBuffer(1)))!=w||pe&&Ie(new pe)!=u||me&&Ie(me.resolve())!=h||ge&&Ie(new ge)!=m||ye&&Ie(new ye)!=v)&&(Ie=function(e){var t=te.call(e),n=t==d?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 h;case ze:return m;case _e:return v}return t});var qe=Array.isArray;function Ue(e){return null!=e&&function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=o}(e.length)&&!$e(e)}var He=fe||function(){return!1};function $e(e){var t=Ve(e)?te.call(e):"";return t==s||t==l}function Ve(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Xe(e){return Ue(e)?function(e,t){var n=qe(e)||function(e){return function(e){return function(e){return!!e&&"object"==typeof e}(e)&&Ue(e)}(e)&&ee.call(e,"callee")&&(!se.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||De(a,r))||n.push(a);return n}(e):function(e){if(!Ge(e))return de(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="function"==typeof Symbol?Symbol:{},i=o.iterator||"@@iterator",a=o.asyncIterator||"@@asyncIterator",c=o.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 l(e,t,n,r){var o=t&&t.prototype instanceof g?t:g,i=Object.create(o.prototype),a=new L(r||[]);return i._invoke=function(e,t,n){var r=f;return function(o,i){if(r===h)throw new Error("Generator is already running");if(r===p){if("throw"===o)throw i;return T()}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=k(a,n);if(c){if(c===m)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===f)throw r=p,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=h;var s=u(e,t,n);if("normal"===s.type){if(r=n.done?p:d,s.arg===m)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r=p,n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f="suspendedStart",d="suspendedYield",h="executing",p="completed",m={};function g(){}function y(){}function v(){}var b={};s(b,i,(function(){return this}));var w=Object.getPrototypeOf,E=w&&w(w(S([])));E&&E!==n&&r.call(E,i)&&(b=E);var z=v.prototype=g.prototype=Object.create(b);function _(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 s=u(e[o],e,i);if("throw"!==s.type){var l=s.arg,f=l.value;return f&&"object"==typeof 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){l.value=e,a(l)}),(function(e){return n("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,r){function i(){return new t((function(t,o){n(e,r,t,o)}))}return o=o?o.then(i,i):i()}}function k(e,n){var r=e.iterator[n.method];if(r===t){if(n.delegate=null,"throw"===n.method){if(e.iterator.return&&(n.method="return",n.arg=t,k(e,n),"throw"===n.method))return m;n.method="throw",n.arg=new TypeError("The iterator does not provide a 'throw' method")}return m}var o=u(r,e.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;var i=o.arg;return i?i.done?(n[e.resultName]=i.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,m):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function x(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 P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function S(e){if(e){var n=e[i];if(n)return n.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var o=-1,a=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 a.next=a}}return{next:T}}function T(){return{value:t,done:!0}}return y.prototype=v,s(z,"constructor",v),s(v,"constructor",y),y.displayName=s(v,c,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,s(e,c,"GeneratorFunction")),e.prototype=Object.create(z),e},e.awrap=function(e){return{__await:e}},_(C.prototype),s(C.prototype,a,(function(){return this})),e.AsyncIterator=C,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new C(l(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},_(z),s(z,c,"Generator"),s(z,i,(function(){return this})),s(z,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=S,L.prototype={constructor:L,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(P),!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 s=r.call(a,"catchLoc"),l=r.call(a,"finallyLoc");if(s&&l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!l)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,m):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),m},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),P(n),m}},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;P(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:S(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),m}},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(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,r.key,r)}}n(666);var t=document.widgetServerBaseUrl?"".concat(document.widgetServerBaseUrl,"/v1/event/log"):"http://widget.sezzle.com/v1/event/log",r=["afterpay-paragraph","affirm-as-low-as","qp-widget-container"];const o=function(){function n(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n)}var o,i;return o=n,i=[{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.getElementsByClassName("sezzle-shopify-info-button").length>1}},{key:"isCompetitorWidgetFound",value:function(){var e=0;return Array.prototype.forEach.call(r,(function(t){document.getElementsByClassName(t).length&&e++})),e>0}},{key:"sendEvents",value:function(e){this.httpRequestWrapper("post",t,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&&e(o.prototype,null),i&&e(o,i),Object.defineProperty(o,"prototype",{writable:!1}),n}();function i(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 a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){c(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function c(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return s="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},s(e)}function l(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,r.key,r)}}n(465);const u=function(){function e(t){!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"],this.widgetConfig={config:null,configGroups:null,merchantID:null,numberOfPayments:null,minPrice:null,maxPrice:null,apModalHTML:null,fingerprint:null,apDualInstall: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.modifySezzleConfig()}var t,n;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(){var e=this;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 t=["targetXPath"];this.basicWidgetConfig.configGroups.forEach((function(e){t.forEach((function(t){if(!e.hasOwnProperty(t))throw new Error("".concat(t," must be specified in all configs in options.configGroups"))}))}));var n={targetXPath:"string",renderToPath:"string",urlMatch:"string"};this.basicWidgetConfig.configGroups.forEach((function(e){Object.keys(n).forEach((function(t){if(e.hasOwnProperty(t)&&s(e[t])!==s(n[t]))throw new Error("".concat(t," must be of type ").concat(n[t]))}))})),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).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,apModalHTML:'<div id="afterpay-popup-wrapper" style="position: fixed; z-index: 2147483647; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: auto;"><div id="afterpay-popup-outer" style="display: flex; place-content: center; align-items: center; width: 100%; min-height: 100%; background-color: rgba(0, 0, 0, 0.8);"><div id="afterpay-popup-inner" style="position: relative; background-color: rgb(255, 255, 255);"><a href="https://www.afterpay.com/purchase-payment-agreement" target="_blank" style="display: block;"><img src="https://static.afterpay.com/us-popup-medium.png" srcset="https://static.afterpay.com/us-popup-medium.png 1x, https://static.afterpay.com/us-popup-medium@2x.png 2x" style="max-width: 597px; display: block; width: 100%;"></a><a href="#" style="position: absolute; right: 8px; top: 8px;"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 32 32" version="1.1" width="32px" height="32px"><g id="surface1"><path style=" " d="M 16 3 C 8.832031 3 3 8.832031 3 16 C 3 23.167969 8.832031 29 16 29 C 23.167969 29 29 23.167969 29 16 C 29 8.832031 23.167969 3 16 3 Z M 16 5 C 22.085938 5 27 9.914063 27 16 C 27 22.085938 22.085938 27 16 27 C 9.914063 27 5 22.085938 5 16 C 5 9.914063 9.914063 5 16 5 Z M 12.21875 10.78125 L 10.78125 12.21875 L 14.5625 16 L 10.78125 19.78125 L 12.21875 21.21875 L 16 17.4375 L 19.78125 21.21875 L 21.21875 19.78125 L 17.4375 16 L 21.21875 12.21875 L 19.78125 10.78125 L 16 14.5625 Z "></path></g></svg></a></div></div></div>',observeElements:this.basicWidgetConfig.observeElements||[],apDualInstall:this.basicWidgetConfig.apDualInstall||!1};this.widgetConfig=a(a({},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))}))}}])&&l(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),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,r.key,r)}}const d=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=0;i<o.length;i++){var a=o[i];if(".."===e[t])r.push(a.parentElement);else if("#"===e[t][0])r.push(a.getElementById(e[t].substr(1)));else if("."===e[t][0])1===e[t].trim().length&&r.push(a),Array.prototype.forEach.call(a.getElementsByClassName(e[t].substr(1)),(function(e){r.push(e)}));else if(0===e[t].indexOf("child")){var c=e[t].split("-")[1],s=a.childNodes[c];if(void 0!==s)if("#text"===s.nodeName){var l=document.createElement("span");l.appendChild(document.createTextNode(s.nodeValue)),a.replaceChild(l,s),r.push(l)}else r.push(s);else r.push(a)}else!function(){var n=0;e[t].split("-").length>1&&e[t].split("-")[1]>=0&&(n=parseInt(e[t].split("-")[1],10)),Array.prototype.forEach.call(a.getElementsByTagName(e[t].split("-")[0]),(function(e,t){t===n&&r.push(e)}))}()}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=null;if(null!==this._config.configGroups[t].rendertopath){var r=o.breakXPath(this._config.configGroups[t].rendertopath);n=e;for(var i=0;i<r.length;i++){var a=r[i];if(null===n)break;if("."!==a)if(".."===a)n=n.parentElement;else if("."===a[0])n=n.getElementsByClassName(a.substr(1)).length?n.getElementsByClassName(a.substr(1))[0]:null;else if("#"===a[0])n=document.getElementById(a.substr(1));else if("::first-child"===a)n=n.children.length>0?n.firstElementChild:null,this._config.configGroups[t].widgetIsFirstChild=!0;else{var c=0;a.split("-").length>1&&a.split("-")[1]>=0&&(c=parseInt(a.split("-")[1],10)),n=n.getElementsByTagName(a.split("-")[0]).length>c?n.getElementsByTagName(a.split("-")[0])[c]:null}}}return n||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&&f(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function h(e){return h="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},h(e)}function p(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 m(){m=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new k(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=z(a,n);if(c){if(c===u)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var u={};function f(){}function d(){}function p(){}var g={};c(g,o,(function(){return this}));var y=Object.getPrototypeOf,v=y&&y(y(x([])));v&&v!==t&&n.call(v,o)&&(g=v);var b=p.prototype=f.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(o,i,a,c){var s=l(e[o],e,i);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"==h(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function z(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,z(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function _(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 C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(_,this),this.reset(!0)}function x(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:P}}function P(){return{value:void 0,done:!0}}return d.prototype=p,c(b,"constructor",p),c(p,"constructor",d),d.displayName=c(p,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,a,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(E.prototype),c(E.prototype,i,(function(){return this})),e.AsyncIterator=E,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new E(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),c(b,a,"Generator"),c(b,o,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=x,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.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,u):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),u},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),C(n),u}},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;C(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function g(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}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,r.key,r)}}var v=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._addClickEventForOtherVendors()}},{key:"renderModals",value:function(){this._renderModal(),this._renderOtherVendorModals()}},{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){if(n.preventDefault(),t._processContentForModal(e),n.target.id="sezzle-modal-return",!n.target.classList.contains("no-sezzle-info")){var r,o=document.getElementsByClassName("sezzle-checkout-modal-lightbox");if(Array.prototype.forEach.call(o,(function(e){e.classList.contains("close-sezzle-modal")&&(r=e)})),r){t._disableBodyScroll(!0),r.style.display="block",r.getElementsByClassName("close-sezzle-modal")[0].focus();var i=r.getElementsByClassName("sezzle-modal");i.length&&(i[0].className="sezzle-modal"),t.modalKeyboardNavigation(),t._widgetEventLogger.logEvent("onclick")}}}))}))}},{key:"_addClickEventForOtherVendors",value:function(){var e=this;this._vendorsSupportedForDualInstall.forEach((function(t){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.modalKeyboardNavigation(),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=document.querySelector(".sezzle-modal-content").childNodes,n=t[0],r=t[t.length-1];document.addEventListener("keydown",(function(t){if("ArrowDown"===t.key&&document.activeElement===r)n.focus();else if("ArrowUp"===t.key&&document.activeElement===n)r.focus();else if("Escape"===t.key){for(var o=document.getElementsByClassName("sezzle-checkout-modal-lightbox"),i=0;i<o.length;i++)o[i].style.display="none",e._disableBodyScroll(!1);var a=document.querySelector("#sezzle-modal-return");a?(a.focus(),a.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=m().mark((function e(){var t,n,r;return m().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="Sezzle Information",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){g(i,n,o,a,c,"next",e)}function c(e){g(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 p(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)?p(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)),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&&y(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const b=v;function w(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,r.key,r)}}function E(e,t,n){z(e,t),t.set(e,n)}function z(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _(e,t,n,r){return O(e,t),T(n,"set"),L(e,n,r),r}function C(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function k(e,t){return j(e,P(e,t,"get"))}function x(e,t,n){return L(e,P(e,t,"set"),n),n}function P(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}function L(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 S(e,t,n){return O(e,t),T(n,"get"),j(e,n)}function T(e,t){if(void 0===e)throw new TypeError("attempted to "+t+" private static field before its declaration")}function O(e,t){if(e!==t)throw new TypeError("Private static access of wrong provenance")}function j(e,t){return t.get?t.get.call(e):t.value}var N=new WeakMap,A=new WeakMap,F=new WeakSet,W=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),z(this,n=F),n.add(this),E(this,N,{writable:!0,value:void 0}),E(this,A,{writable:!0,value:void 0}),!S(e,e,I))throw new Error("Use static initializer to initialize the logger");x(this,N,t),x(this,A,[])}var t,n,r;return t=e,r=[{key:"NewWidgetEventLogger",value:function(t){return S(e,e,D)||(_(e,e,I,!0),_(e,e,D,new e(t))),S(e,e,D)}},{key:"Destruct",value:function(){_(e,e,D,null)}}],(n=[{key:"logEvent",value:function(e,t){var n={name:e,description:null!=t?t:"",createdAt:(new Date).toJSON()};!n.name.startsWith("onclick")&&this.isEventLogged(n.name,n.description)||k(this,A).push(n),n.name.startsWith("onclick")&&(C(this,F,M).call(this),x(this,A,[]))}},{key:"isEventLogged",value:function(e,t){return k(this,A).some((function(n){return n.name===e&&n.description===t}))}},{key:"forceSendEvents",value:function(){C(this,F,M).call(this),x(this,A,[])}}])&&w(t.prototype,n),r&&w(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();function M(){var e=this;try{var t=[];k(this,A).forEach((function(n){var r;t.push({event_name:n.name,description:n.description,merchant_uuid:null!==(r=k(e,N))&&void 0!==r?r:"",merchant_site:window.location.hostname,created_at:n.createdAt})})),t.length>0&&o.sendEvents(t)}catch(e){console.log(e)}}var I={writable:!0,value:void 0},D={writable:!0,value:void 0};const G=W;function B(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,r.key,r)}}const R=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%% %%info%%{apDualInstallText}{thresholdPriceText}"),fr:"ou ".concat(this._numberOfPayments," paiements de %%price%% sans intérêts{promotext} avec %%logo%% %%info%%{apDualInstallText}{thresholdPriceText}"),es:"o ".concat(this._numberOfPayments," pagos sin intereses de %%price%%{promotext} con %%logo%% %%info%%{apDualInstallText}{thresholdPriceText}")},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%% %%afterpay-info-icon%%",fr:" ou %%afterpay-logo%% %%afterpay-info-icon%%",es:" o %%afterpay-logo%% %%afterpay-info-icon%%"},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._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]||this._longTermTranslations[this._defaultLanguage]}},{key:"getThresholdPriceText",value:function(){return this._thresholdPriceTextTranslations[this._language]}},{key:"getApDualInstallText",value:function(){return this._apDualInstallTranslations[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}}])&&B(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),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,r.key,r)}}const U=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 H(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,r.key,r)}}var $=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 U}var t,n,r;return t=e,r=[{key:"getPromotionString",value:function(t,n,r,o){var i=V[t.type],a=!!t.spend_award_threshold_in_cents,c=!!t.is_new_user_only&&t.is_new_user_only,s=!!t.promo_code,l=o.getMainViewTranslationTextByLanguage(i,c,a,s,n,r);return l=l.replace("{money}",e.format(n,t.currency_code,t.spend_award_in_cents)),a&&(l=l.replace("{threshold}",e.format(n,t.currency_code,t.spend_award_threshold_in_cents))),s&&(l=l.replace("{promocode}",t.promo_code)),l}},{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):""}}])&&H(t.prototype,n),r&&H(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}(),V={1:"reward",2:"discount"};const X=$;function Y(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 J(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,r.key,r)}}function K(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 Z(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}var Q=new WeakSet,ee=new WeakSet,te=new WeakSet,ne=new WeakSet;function re(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 oe(e){return Z(this,te,ie).call(this,e)[0]}function ie(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 Y(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)?Y(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 ae(e){return Math.round(100*e)/100}const ce=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),K(this,ne),K(this,te),K(this,ee),K(this,Q),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=Z(this,te,ie).call(this,e),r={productPrice:e,paymentTerms:[]};return r.paymentTerms=n.map((function(n){var r=n[0],o=n[1],i=Z(t,Q,re).call(t,e,r,o),a=Z(t,ne,ae).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=Z(this,ee,oe).call(this,e);return Z(this,Q,re).call(this,e,t[0],t[1])}}])&&J(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function se(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 le(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,r.key,r)}}function ue(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 fe(e,t){return function(e,t){return t.get?t.get.call(e):t.value}(e,he(e,t,"get"))}function de(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,he(e,t,"set"),n),n}function he(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,me=new WeakMap;const ge=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),ue(this,pe,{writable:!0,value:void 0}),ue(this,me,{writable:!0,value:void 0}),this.sezzleDOMFunctions=r,this.widgetConfig=t,this.longTermPaymentConfig=n,de(this,pe,"{price}"),de(this,me,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,i=this.sezzleDOMFunctions.getPriceText(e,t);if(!i)return null;i=i.replace("\n","").trim(),n&&n.forEach((function(e){var t=new RegExp(e,"ig");i=i.replace(t,"")}));var a=new RegExp(/\d+((\.|,|\s)\d+)*/g),c=o.matchAll(a,i);if(0===c.length||c.length>2)return null;var s={formatter:i.replace(a,fe(this,pe)),prices:[]};return s.prices=c.map((function(e){var t,n=e;return r.naFormat.test(e)&&(n=e.replaceAll(",",""),t=r.naFormat),r.euFormat.test(e)&&(n=e.replaceAll(".","").replaceAll(",","."),t=r.euFormat),r.euFormatWithSpace.test(e)&&(n=e.replaceAll(" ","").replaceAll(",","."),t=r.euFormatWithSpace),r.euDecimalsNoThousandDelimiterFormat.test(e)&&(n=e.replaceAll(",","."),t=r.euDecimalsNoThousandDelimiterFormat),{value:parseFloat(n),format:t}})),s}},{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 se(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)?se(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 ce(this.longTermPaymentConfig.paymentTerms).calculateLowestAvailablePayment(c.value).toFixed(fe(this,me)):(c.value/this.widgetConfig.numberOfPayments).toFixed(fe(this,me)),i=this.getFormattedPrice(a,c.format),r=r.replace(fe(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(fe(this,pe),r).trim():n.replace(fe(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 ce(this.longTermPaymentConfig.paymentTerms).getPaymentInfo(r),i={productPrice:t+o.productPrice.toFixed(fe(this,me)).replace(this.thousandDelimiter,","),paymentTerms:[]};return i.paymentTerms=o.paymentTerms.map((function(e){return{durationInMonths:e.durationInMonths,apr:e.apr,monthlyPayment:t+e.monthlyPayment.toFixed(fe(n,me)).replace(n.thousandDelimiter,","),totalAmount:t+e.totalAmount.toFixed(fe(n,me)).replace(n.thousandDelimiter,","),totalInterest:t+e.totalInterest.toFixed(fe(n,me)).replace(n.thousandDelimiter,",")}})),i}}])&&le(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ye(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,r.key,r)}}function ve(e,t){be(e,t),t.add(e)}function be(e,t){if(t.has(e))throw new TypeError("Cannot initialize the same private elements twice on an object")}function we(e,t,n){if(!t.has(e))throw new TypeError("attempted to get private field on non-instance");return n}function Ee(e,t,n){if(!t.has(e))throw new TypeError("attempted to "+n+" private field on non-instance");return t.get(e)}var ze=new WeakMap,_e=new WeakSet,Ce=new WeakSet,ke=new WeakSet,xe=new WeakSet,Pe=new WeakSet,Le=new WeakSet,Se=new WeakSet,Te=new WeakSet,Oe=new WeakSet,je=new WeakSet,Ne=new WeakSet,Ae=new WeakSet,Fe=function(){function e(t,n){var r,o;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),ve(this,Ae),ve(this,Ne),ve(this,je),ve(this,Oe),ve(this,Te),ve(this,Se),ve(this,Le),ve(this,Pe),ve(this,xe),ve(this,ke),ve(this,Ce),ve(this,_e),o={writable:!0,value:void 0},be(this,r=ze),r.set(this,o),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,Ee(e,t,"set"),n)}(this,ze,2e3),this.widgetConfig=t,this.widgetEventLogger=n,this.sezzleDOMFunctions=new d(t),this.language=new R(4),this.language.setLanguage(this.widgetConfig.config.language),this.promotion=new X(document.sezzlePromotion,this.language),this.priceProcessor=new ge(t,document.longTermPaymentConfig,this.sezzleDOMFunctions),this.modal=new b(t,n,this.promotion,this.priceProcessor,this.language)}var t,n;return t=e,n=[{key:"initializeRendering",value:function(){we(this,Ae,Ve).call(this,this.widgetConfig.observeElements),we(this,_e,We).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 s=n.getParsedPrice(e.target,t.ignoredPriceElements,t.ignoredFormattedPriceText),l=n.getProductPriceEligibility(s);l.isPriceGreaterThanMaxPrice&&!l.isLongTermPaymentEligible&&c.classList.add("sezzle-hidden");var u=r.getWidgetInnerContent(t,o,l,s);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)),null;var o=this.priceProcessor.getProductPriceEligibility(r);if(o.isPriceGreaterThanMaxPrice&&!o.isLongTermPaymentEligible)return null;var i=this.sezzleDOMFunctions.getElementToRender(e,t);e.dataset.sezzleindex=t,"auto"===n.alignment&&(n.alignment=we(this,ke,Ie).call(this,e));var a=document.createElement("div");a.className="sezzle-shopify-info-button sezzlewidgetindex-".concat(t),we(this,xe,De).call(this,a),n.containerStyle!=={}&&we(this,Pe,Ge).call(this,a,n);var c=document.createElement("button");c.ariaHasPopup="dialog",c.className="sezzle-checkout-button-wrapper sezzle-modal-link",c.style.cursor="pointer",we(this,xe,De).call(this,c),we(this,Le,Be).call(this,c,n);var s=this.getWidgetInnerContent(n,t,o,r);return c.appendChild(s),a.appendChild(c),n.widgetIsFirstChild?we(this,Ne,$e).call(this,a,i):we(this,je,He).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",e.textStyle!=={}&&we(this,Se,Re).call(this,i,e),we(this,Le,Be).call(this,i,e),we(this,Te,qe).call(this,i,e),we(this,Ce,Me).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 s=o.priceProcessor.getFormattedWidgetPrice(r,n.isLongTermPaymentEligible),l=document.createTextNode(s);c.appendChild(l),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",i.appendChild(u),e.logoStyle!=={}&&we(o,Oe,Ue).call(o,u,e);break;case"info":var f=document.createElement("div");f.ariaLabel="Click to learn more about Sezzle",f.name="Click to learn more about 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 d=document.createElement("img");d.className="sezzle-ap-logo ap-modal-info-link no-sezzle-info",d.src="https://media.sezzle.com/sezzle-credit-website-assets/ap-badge-black-on-mint.svg",d.alt="Afterpay",i.appendChild(d);break;case"afterpay-info-icon":var h=document.createElement("button");h.role="button",h.type="button",h.ariaLabel="Click to learn more about Afterpay",h.name="Click to learn more about Afterpay",h.ariaHasPopup="dialog",h.className="ap-modal-info-link no-sezzle-info",h.innerHTML="&#9432;",h.style="font-size: ".concat(e.textStyle.fontSize,"px;"),i.appendChild(h);break;case"line-break":var p=document.createElement("br");i.appendChild(p);break;case"min-price":var m=document.createElement("span");m.className="sezzle-payment-amount sezzle-button-text sezzleindex-".concat(t);var g=o.priceProcessor.getFormattedMinPrice(r),y=document.createTextNode(g);m.appendChild(y),i.appendChild(m);break;default:var v=document.createTextNode(a);i.appendChild(v)}})),i}}],n&&ye(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function We(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);setTimeout((function(){return we(t,_e,We).call(t,e)}),function(e,t){return t.get?t.get.call(e):t.value}(this,Ee(this,ze,"get")));var o=document.getElementsByClassName("sezzle-")[0];void 0!==o&&(o.classList.contains("sezzle-hidden")||o.classList.add("sezzle-hidden"))}function Me(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 Ie(e){if(!e)return"left";var t=window.getComputedStyle(e).textAlign;return"start"===t||"justify"===t?"left":"end"===t?"right":t}function De(e){return e.className+=" sezzle-".concat(this.widgetConfig.merchantID),e}function Ge(e,t){Object.keys(t.containerStyle).forEach((function(n){e.style[n]=t.containerStyle[n]}))}function Be(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 Re(e,t){Object.keys(t.textStyle).forEach((function(n){e.style[n]=t.textStyle[n]}))}function qe(e,t){switch(t.theme){case"dark":case"white-flat":e.className+=" szl-dark";break;default:e.className+=" szl-light"}}function Ue(e,t){Object.keys(t.logoStyle).forEach((function(n){e.style[n]=t.logoStyle[n]}))}function He(e,t){t.parentNode.insertBefore(e,t.nextSibling)}function $e(e,t){for(t.parentElement.insertBefore(e,t);e.previousSibling;)e.parentElement.insertBefore(e,e.previousSibling)}function Ve(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=G.NewWidgetEventLogger(document.sezzleConfig.merchantID);new tt(document.sezzleConfig,e).init()}))}))}))}const Xe=Fe;function Ye(e){return Ye="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},Ye(e)}function Je(){Je=function(){return e};var e={},t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},o=r.iterator||"@@iterator",i=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var o=t&&t.prototype instanceof f?t:f,i=Object.create(o.prototype),a=new _(r||[]);return i._invoke=function(e,t,n){var r="suspendedStart";return function(o,i){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===o)throw i;return{value:void 0,done:!0}}for(n.method=o,n.arg=i;;){var a=n.delegate;if(a){var c=w(a,n);if(c){if(c===u)continue;return c}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var s=l(e,t,n);if("normal"===s.type){if(r=n.done?"completed":"suspendedYield",s.arg===u)continue;return{value:s.arg,done:n.done}}"throw"===s.type&&(r="completed",n.method="throw",n.arg=s.arg)}}}(e,n,a),i}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var u={};function f(){}function d(){}function h(){}var p={};c(p,o,(function(){return this}));var m=Object.getPrototypeOf,g=m&&m(m(C([])));g&&g!==t&&n.call(g,o)&&(p=g);var y=h.prototype=f.prototype=Object.create(p);function v(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){function r(o,i,a,c){var s=l(e[o],e,i);if("throw"!==s.type){var u=s.arg,f=u.value;return f&&"object"==Ye(f)&&n.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,a,c)}),(function(e){r("throw",e,a,c)})):t.resolve(f).then((function(e){u.value=e,a(u)}),(function(e){return r("throw",e,a,c)}))}c(s.arg)}var o;this._invoke=function(e,n){function i(){return new t((function(t,o){r(e,n,t,o)}))}return o=o?o.then(i,i):i()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return u;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,u;var o=r.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,u):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,u)}function E(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 z(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:k}}function k(){return{value:void 0,done:!0}}return d.prototype=h,c(y,"constructor",h),c(h,"constructor",d),d.displayName=c(h,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,h):(e.__proto__=h,c(e,a,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},v(b.prototype),c(b.prototype,i,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,o,i){void 0===i&&(i=Promise);var a=new b(s(t,n,r,o),i);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},v(y),c(y,a,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},e.values=C,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(z),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},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 t=this;function r(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var c=n.call(i,"catchLoc"),s=n.call(i,"finallyLoc");if(c&&s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var o=this.tryEntries[r];if(o.tryLoc<=this.prev&&n.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,u):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),u},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),z(n),u}},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;z(n)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:C(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},e}function Ke(e,t,n,r,o,i,a){try{var c=e[i](a),s=c.value}catch(e){return void n(e)}c.done?t(s):Promise.resolve(s).then(r,o)}function Ze(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){Ke(i,r,o,a,c,"next",e)}function c(e){Ke(i,r,o,a,c,"throw",e)}a(void 0)}))}}function Qe(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,r.key,r)}}var et=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}var t,n,r,i,a;return t=e,n=[{key:"init",value:(a=Ze(Je().mark((function e(){var t,n;return Je().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.widgetEventLogger.logEvent("request"),(t=o._getCookie("shopify_pay_redirect"))&&this.widgetEventLogger.logEvent("shop-checkout-status-".concat(t)),!((n=new u(this.basicWidgetConfiguration).getSezzleConfig).configGroups.length>0)){e.next=8;break}return e.next=8,this.initializeWidget(n);case 8:e.next=13;break;case 10:e.prev=10,e.t0=e.catch(0),this.widgetEventLogger.logEvent("error",e.t0.message);case 13:this.widgetEventLogger.forceSendEvents();case 14:case"end":return e.stop()}}),e,this,[[0,10]])}))),function(){return a.apply(this,arguments)})},{key:"initializeWidget",value:(i=Ze(Je().mark((function e(t){return Je().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._loadCSS();case 2:new Xe(t,this.widgetEventLogger).initializeRendering(),o.isWidgetDuplicateFound()&&this.widgetEventLogger.logEvent("duplicate-widget"),o.isCompetitorWidgetFound()&&this.widgetEventLogger.logEvent("competitor-widget");case 6:case"end":return e.stop()}}),e,this)}))),function(e){return i.apply(this,arguments)})},{key:"_loadCSS",value:(r=Ze(Je().mark((function e(){var t,n,r,i,a,c;return Je().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&&Qe(t.prototype,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();const tt=et;if(0===document.getElementsByClassName("sezzle-shopify-info-button").length)if(document.sezzleConfig){var nt=G.NewWidgetEventLogger(document.sezzleConfig.merchantID);document.sezzleConfig.merchantID||nt.logEvent("warning","Merchant UUID is not provided"),o.WaitForBodyToBeReady().then((function(){new tt(document.sezzleConfig,nt).init()}))}else{var rt=G.NewWidgetEventLogger("");rt.logEvent("request"),rt.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")}})()})();