@letscooee/web-sdk 13.0.18 → 13.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NUQA2TNP.js → chunk-5UGKH6LI.js} +1 -1
- package/dist/{chunk-RF2HDGHM.js → chunk-BVWCBCYN.js} +1 -1
- package/dist/{chunk-QA6GKNSU.js → chunk-DZGV3ZMR.js} +1 -1
- package/dist/{chunk-DZFO4O3B.js → chunk-JYZSJOIU.js} +1 -1
- package/dist/{debug-logs-LURTT6GZ.js → debug-logs-L7PWPC5Y.js} +1 -1
- package/dist/main.min.js +18 -18
- package/dist/{share-dialog.component-YYXL7PVF.js → share-dialog.component-KIB37SEN.js} +1 -1
- package/dist/{video-detail-dialog.component-RWCPJW4J.js → video-detail-dialog.component-5VOI3PVB.js} +1 -1
- package/dist/widget.min.js +2 -2
- package/package.json +2 -2
package/dist/main.min.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
import{a as $s,b as Vs,c as am,d as cm,e as lm,f as um,g as fm,h as dr,i as Ws,j as w,k as pm,l as mm,m as dm,n as hm,o as Tr}from"./chunk-RF2HDGHM.js";import{a as E,b as Z,c as Ci,d as sm,e as kl,f as zr,g as bo}from"./chunk-V7UGKYBN.js";var Fl=kl(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.URLBuilder=void 0;var xE=(function(){function t(e){try{this.base=new URL(e),this.params=new URLSearchParams(this.base.search.slice(1))}catch(r){console.error("Un-parsable URL",r)}}return t.prototype.appendQueryParam=function(e,r){this.params.append(e,r?r.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(e){this.params.delete(e)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(e){if(!this.params)return"";var r=this.params.get(e);return!r||r==="undefined"||r==="null"?void 0:r},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(e){return this.base.pathname=e,this},t.prototype.setQueryParam=function(e,r){return this.params.set(e,r?r.toString():""),this},t.prototype.setQueryString=function(e){if(e)return e[0]==="?"&&(e=e.slice(1)),this.params=new URLSearchParams(e),this},t.prototype.toString=function(){var e=this.params.toString();return e===""?this.base.search="":this.base.search="?"+e,this.base.toString()},t})();js.URLBuilder=xE});var Sm=kl((bm,zl)=>{"use strict";(function(t){if(typeof bm=="object"&&typeof zl<"u")zl.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return(function n(o,i,s){function a(m,d){if(!i[m]){if(!o[m]){var _=typeof Ci=="function"&&Ci;if(!d&&_)return _(m,!0);if(l)return l(m,!0);var y=new Error("Cannot find module '"+m+"'");throw y.code="MODULE_NOT_FOUND",y}var C=i[m]={exports:{}};o[m][0].call(C.exports,function(N){var A=o[m][1][N];return a(A||N)},C,C.exports,n,o,i,s)}return i[m].exports}for(var l=typeof Ci=="function"&&Ci,f=0;f<s.length;f++)a(s[f]);return a})({1:[function(n,o,i){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,l;if(a){var f=0,m=new a(N),d=s.document.createTextNode("");m.observe(d,{characterData:!0}),l=function(){d.data=f=++f%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var _=new s.MessageChannel;_.port1.onmessage=N,l=function(){_.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var B=s.document.createElement("script");B.onreadystatechange=function(){N(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},s.document.documentElement.appendChild(B)}:l=function(){setTimeout(N,0)};var y,C=[];function N(){y=!0;for(var B,q,P=C.length;P;){for(q=C,C=[],B=-1;++B<P;)q[B]();P=C.length}y=!1}o.exports=A;function A(B){C.push(B)===1&&!y&&l()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,o,i){"use strict";var s=n(1);function a(){}var l={},f=["REJECTED"],m=["FULFILLED"],d=["PENDING"];o.exports=_;function _(X){if(typeof X!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,X!==a&&A(this,X)}_.prototype.catch=function(X){return this.then(null,X)},_.prototype.then=function(X,ce){if(typeof X!="function"&&this.state===m||typeof ce!="function"&&this.state===f)return this;var se=new this.constructor(a);if(this.state!==d){var de=this.state===m?X:ce;C(se,de,this.outcome)}else this.queue.push(new y(se,X,ce));return se};function y(X,ce,se){this.promise=X,typeof ce=="function"&&(this.onFulfilled=ce,this.callFulfilled=this.otherCallFulfilled),typeof se=="function"&&(this.onRejected=se,this.callRejected=this.otherCallRejected)}y.prototype.callFulfilled=function(X){l.resolve(this.promise,X)},y.prototype.otherCallFulfilled=function(X){C(this.promise,this.onFulfilled,X)},y.prototype.callRejected=function(X){l.reject(this.promise,X)},y.prototype.otherCallRejected=function(X){C(this.promise,this.onRejected,X)};function C(X,ce,se){s(function(){var de;try{de=ce(se)}catch(Le){return l.reject(X,Le)}de===X?l.reject(X,new TypeError("Cannot resolve promise with itself")):l.resolve(X,de)})}l.resolve=function(X,ce){var se=B(N,ce);if(se.status==="error")return l.reject(X,se.value);var de=se.value;if(de)A(X,de);else{X.state=m,X.outcome=ce;for(var Le=-1,Se=X.queue.length;++Le<Se;)X.queue[Le].callFulfilled(ce)}return X},l.reject=function(X,ce){X.state=f,X.outcome=ce;for(var se=-1,de=X.queue.length;++se<de;)X.queue[se].callRejected(ce);return X};function N(X){var ce=X&&X.then;if(X&&(typeof X=="object"||typeof X=="function")&&typeof ce=="function")return function(){ce.apply(X,arguments)}}function A(X,ce){var se=!1;function de(Ge){se||(se=!0,l.reject(X,Ge))}function Le(Ge){se||(se=!0,l.resolve(X,Ge))}function Se(){ce(Le,de)}var Re=B(Se);Re.status==="error"&&de(Re.value)}function B(X,ce){var se={};try{se.value=X(ce),se.status="success"}catch(de){se.status="error",se.value=de}return se}_.resolve=q;function q(X){return X instanceof this?X:l.resolve(new this(a),X)}_.reject=P;function P(X){var ce=new this(a);return l.reject(ce,X)}_.all=Q;function Q(X){var ce=this;if(Object.prototype.toString.call(X)!=="[object Array]")return this.reject(new TypeError("must be an array"));var se=X.length,de=!1;if(!se)return this.resolve([]);for(var Le=new Array(se),Se=0,Re=-1,Ge=new this(a);++Re<se;)Je(X[Re],Re);return Ge;function Je(Bt,D){ce.resolve(Bt).then(R,function(V){de||(de=!0,l.reject(Ge,V))});function R(V){Le[D]=V,++Se===se&&!de&&(de=!0,l.resolve(Ge,Le))}}}_.race=Ee;function Ee(X){var ce=this;if(Object.prototype.toString.call(X)!=="[object Array]")return this.reject(new TypeError("must be an array"));var se=X.length,de=!1;if(!se)return this.resolve([]);for(var Le=-1,Se=new this(a);++Le<se;)Re(X[Le]);return Se;function Re(Ge){ce.resolve(Ge).then(function(Je){de||(de=!0,l.resolve(Se,Je))},function(Je){de||(de=!0,l.reject(Se,Je))})}}},{1:1}],3:[function(n,o,i){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,o,i){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p};function a(p,b){if(!(p instanceof b))throw new TypeError("Cannot call a class as a function")}function l(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var f=l();function m(){try{if(!f||!f.open)return!1;var p=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),b=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!p||b)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function d(p,b){p=p||[],b=b||{};try{return new Blob(p,b)}catch(S){if(S.name!=="TypeError")throw S;for(var g=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,T=new g,I=0;I<p.length;I+=1)T.append(p[I]);return T.getBlob(b.type)}}typeof Promise>"u"&&n(3);var _=Promise;function y(p,b){b&&p.then(function(g){b(null,g)},function(g){b(g)})}function C(p,b,g){typeof b=="function"&&p.then(b),typeof g=="function"&&p.catch(g)}function N(p){return typeof p!="string"&&(console.warn(p+" used as a key, but it is not a string."),p=String(p)),p}function A(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var B="local-forage-detect-blob-support",q=void 0,P={},Q=Object.prototype.toString,Ee="readonly",X="readwrite";function ce(p){for(var b=p.length,g=new ArrayBuffer(b),T=new Uint8Array(g),I=0;I<b;I++)T[I]=p.charCodeAt(I);return g}function se(p){return new _(function(b){var g=p.transaction(B,X),T=d([""]);g.objectStore(B).put(T,"key"),g.onabort=function(I){I.preventDefault(),I.stopPropagation(),b(!1)},g.oncomplete=function(){var I=navigator.userAgent.match(/Chrome\/(\d+)/),S=navigator.userAgent.match(/Edge\//);b(S||!I||parseInt(I[1],10)>=43)}}).catch(function(){return!1})}function de(p){return typeof q=="boolean"?_.resolve(q):se(p).then(function(b){return q=b,q})}function Le(p){var b=P[p.name],g={};g.promise=new _(function(T,I){g.resolve=T,g.reject=I}),b.deferredOperations.push(g),b.dbReady?b.dbReady=b.dbReady.then(function(){return g.promise}):b.dbReady=g.promise}function Se(p){var b=P[p.name],g=b.deferredOperations.pop();if(g)return g.resolve(),g.promise}function Re(p,b){var g=P[p.name],T=g.deferredOperations.pop();if(T)return T.reject(b),T.promise}function Ge(p,b){return new _(function(g,T){if(P[p.name]=P[p.name]||qe(),p.db)if(b)Le(p),p.db.close();else return g(p.db);var I=[p.name];b&&I.push(p.version);var S=f.open.apply(f,I);b&&(S.onupgradeneeded=function(M){var G=S.result;try{G.createObjectStore(p.storeName),M.oldVersion<=1&&G.createObjectStore(B)}catch(z){if(z.name==="ConstraintError")console.warn('The database "'+p.name+'" has been upgraded from version '+M.oldVersion+" to version "+M.newVersion+', but the storage "'+p.storeName+'" already exists.');else throw z}}),S.onerror=function(M){M.preventDefault(),T(S.error)},S.onsuccess=function(){var M=S.result;M.onversionchange=function(G){G.target.close()},g(M),Se(p)}})}function Je(p){return Ge(p,!1)}function Bt(p){return Ge(p,!0)}function D(p,b){if(!p.db)return!0;var g=!p.db.objectStoreNames.contains(p.storeName),T=p.version<p.db.version,I=p.version>p.db.version;if(T&&(p.version!==b&&console.warn('The database "'+p.name+`" can't be downgraded from version `+p.db.version+" to version "+p.version+"."),p.version=p.db.version),I||g){if(g){var S=p.db.version+1;S>p.version&&(p.version=S)}return!0}return!1}function R(p){return new _(function(b,g){var T=new FileReader;T.onerror=g,T.onloadend=function(I){var S=btoa(I.target.result||"");b({__local_forage_encoded_blob:!0,data:S,type:p.type})},T.readAsBinaryString(p)})}function V(p){var b=ce(atob(p.data));return d([b],{type:p.type})}function k(p){return p&&p.__local_forage_encoded_blob}function H(p){var b=this,g=b._initReady().then(function(){var T=P[b._dbInfo.name];if(T&&T.dbReady)return T.dbReady});return C(g,p,p),g}function ne(p){Le(p);for(var b=P[p.name],g=b.forages,T=0;T<g.length;T++){var I=g[T];I._dbInfo.db&&(I._dbInfo.db.close(),I._dbInfo.db=null)}return p.db=null,Je(p).then(function(S){return p.db=S,D(p)?Bt(p):S}).then(function(S){p.db=b.db=S;for(var M=0;M<g.length;M++)g[M]._dbInfo.db=S}).catch(function(S){throw Re(p,S),S})}function he(p,b,g,T){T===void 0&&(T=1);try{var I=p.db.transaction(p.storeName,b);g(null,I)}catch(S){if(T>0&&(!p.db||S.name==="InvalidStateError"||S.name==="NotFoundError"))return _.resolve().then(function(){if(!p.db||S.name==="NotFoundError"&&!p.db.objectStoreNames.contains(p.storeName)&&p.version<=p.db.version)return p.db&&(p.version=p.db.version+1),Bt(p)}).then(function(){return ne(p).then(function(){he(p,b,g,T-1)})}).catch(g);g(S)}}function qe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ze(p){var b=this,g={db:null};if(p)for(var T in p)g[T]=p[T];var I=P[g.name];I||(I=qe(),P[g.name]=I),I.forages.push(b),b._initReady||(b._initReady=b.ready,b.ready=H);var S=[];function M(){return _.resolve()}for(var G=0;G<I.forages.length;G++){var z=I.forages[G];z!==b&&S.push(z._initReady().catch(M))}var Y=I.forages.slice(0);return _.all(S).then(function(){return g.db=I.db,Je(g)}).then(function(J){return g.db=J,D(g,b._defaultConfig.version)?Bt(g):J}).then(function(J){g.db=I.db=J,b._dbInfo=g;for(var te=0;te<Y.length;te++){var ve=Y[te];ve!==b&&(ve._dbInfo.db=g.db,ve._dbInfo.version=g.version)}})}function et(p,b){var g=this;p=N(p);var T=new _(function(I,S){g.ready().then(function(){he(g._dbInfo,Ee,function(M,G){if(M)return S(M);try{var z=G.objectStore(g._dbInfo.storeName),Y=z.get(p);Y.onsuccess=function(){var J=Y.result;J===void 0&&(J=null),k(J)&&(J=V(J)),I(J)},Y.onerror=function(){S(Y.error)}}catch(J){S(J)}})}).catch(S)});return y(T,b),T}function vt(p,b){var g=this,T=new _(function(I,S){g.ready().then(function(){he(g._dbInfo,Ee,function(M,G){if(M)return S(M);try{var z=G.objectStore(g._dbInfo.storeName),Y=z.openCursor(),J=1;Y.onsuccess=function(){var te=Y.result;if(te){var ve=te.value;k(ve)&&(ve=V(ve));var Oe=p(ve,te.key,J++);Oe!==void 0?I(Oe):te.continue()}else I()},Y.onerror=function(){S(Y.error)}}catch(te){S(te)}})}).catch(S)});return y(T,b),T}function Et(p,b,g){var T=this;p=N(p);var I=new _(function(S,M){var G;T.ready().then(function(){return G=T._dbInfo,Q.call(b)==="[object Blob]"?de(G.db).then(function(z){return z?b:R(b)}):b}).then(function(z){he(T._dbInfo,X,function(Y,J){if(Y)return M(Y);try{var te=J.objectStore(T._dbInfo.storeName);z===null&&(z=void 0);var ve=te.put(z,p);J.oncomplete=function(){z===void 0&&(z=null),S(z)},J.onabort=J.onerror=function(){var Oe=ve.error?ve.error:ve.transaction.error;M(Oe)}}catch(Oe){M(Oe)}})}).catch(M)});return y(I,g),I}function it(p,b){var g=this;p=N(p);var T=new _(function(I,S){g.ready().then(function(){he(g._dbInfo,X,function(M,G){if(M)return S(M);try{var z=G.objectStore(g._dbInfo.storeName),Y=z.delete(p);G.oncomplete=function(){I()},G.onerror=function(){S(Y.error)},G.onabort=function(){var J=Y.error?Y.error:Y.transaction.error;S(J)}}catch(J){S(J)}})}).catch(S)});return y(T,b),T}function be(p){var b=this,g=new _(function(T,I){b.ready().then(function(){he(b._dbInfo,X,function(S,M){if(S)return I(S);try{var G=M.objectStore(b._dbInfo.storeName),z=G.clear();M.oncomplete=function(){T()},M.onabort=M.onerror=function(){var Y=z.error?z.error:z.transaction.error;I(Y)}}catch(Y){I(Y)}})}).catch(I)});return y(g,p),g}function He(p){var b=this,g=new _(function(T,I){b.ready().then(function(){he(b._dbInfo,Ee,function(S,M){if(S)return I(S);try{var G=M.objectStore(b._dbInfo.storeName),z=G.count();z.onsuccess=function(){T(z.result)},z.onerror=function(){I(z.error)}}catch(Y){I(Y)}})}).catch(I)});return y(g,p),g}function Ae(p,b){var g=this,T=new _(function(I,S){if(p<0){I(null);return}g.ready().then(function(){he(g._dbInfo,Ee,function(M,G){if(M)return S(M);try{var z=G.objectStore(g._dbInfo.storeName),Y=!1,J=z.openKeyCursor();J.onsuccess=function(){var te=J.result;if(!te){I(null);return}p===0||Y?I(te.key):(Y=!0,te.advance(p))},J.onerror=function(){S(J.error)}}catch(te){S(te)}})}).catch(S)});return y(T,b),T}function $e(p){var b=this,g=new _(function(T,I){b.ready().then(function(){he(b._dbInfo,Ee,function(S,M){if(S)return I(S);try{var G=M.objectStore(b._dbInfo.storeName),z=G.openKeyCursor(),Y=[];z.onsuccess=function(){var J=z.result;if(!J){T(Y);return}Y.push(J.key),J.continue()},z.onerror=function(){I(z.error)}}catch(J){I(J)}})}).catch(I)});return y(g,p),g}function De(p,b){b=A.apply(this,arguments);var g=this.config();p=typeof p!="function"&&p||{},p.name||(p.name=p.name||g.name,p.storeName=p.storeName||g.storeName);var T=this,I;if(!p.name)I=_.reject("Invalid arguments");else{var S=p.name===g.name&&T._dbInfo.db,M=S?_.resolve(T._dbInfo.db):Je(p).then(function(G){var z=P[p.name],Y=z.forages;z.db=G;for(var J=0;J<Y.length;J++)Y[J]._dbInfo.db=G;return G});p.storeName?I=M.then(function(G){if(G.objectStoreNames.contains(p.storeName)){var z=G.version+1;Le(p);var Y=P[p.name],J=Y.forages;G.close();for(var te=0;te<J.length;te++){var ve=J[te];ve._dbInfo.db=null,ve._dbInfo.version=z}var Oe=new _(function(Ne,rt){var Qe=f.open(p.name,z);Qe.onerror=function(Xt){var xi=Qe.result;xi.close(),rt(Xt)},Qe.onupgradeneeded=function(){var Xt=Qe.result;Xt.deleteObjectStore(p.storeName)},Qe.onsuccess=function(){var Xt=Qe.result;Xt.close(),Ne(Xt)}});return Oe.then(function(Ne){Y.db=Ne;for(var rt=0;rt<J.length;rt++){var Qe=J[rt];Qe._dbInfo.db=Ne,Se(Qe._dbInfo)}}).catch(function(Ne){throw(Re(p,Ne)||_.resolve()).catch(function(){}),Ne})}}):I=M.then(function(G){Le(p);var z=P[p.name],Y=z.forages;G.close();for(var J=0;J<Y.length;J++){var te=Y[J];te._dbInfo.db=null}var ve=new _(function(Oe,Ne){var rt=f.deleteDatabase(p.name);rt.onerror=function(){var Qe=rt.result;Qe&&Qe.close(),Ne(rt.error)},rt.onblocked=function(){console.warn('dropInstance blocked for database "'+p.name+'" until all open connections are closed')},rt.onsuccess=function(){var Qe=rt.result;Qe&&Qe.close(),Oe(Qe)}});return ve.then(function(Oe){z.db=Oe;for(var Ne=0;Ne<Y.length;Ne++){var rt=Y[Ne];Se(rt._dbInfo)}}).catch(function(Oe){throw(Re(p,Oe)||_.resolve()).catch(function(){}),Oe})})}return y(I,b),I}var $t={_driver:"asyncStorage",_initStorage:Ze,_support:m(),iterate:vt,getItem:et,setItem:Et,removeItem:it,clear:be,length:He,key:Ae,keys:$e,dropInstance:De};function h(){return typeof openDatabase=="function"}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="~~local_forage_type~",v=/^~~local_forage_type~([^~]+)~/,x="__lfsc__:",O=x.length,W="arbf",ue="blob",_e="si08",ge="ui08",Me="uic8",ke="si16",tt="si32",fr="ur16",qr="ui32",_o="fl32",pr="fl64",mr=O+W.length,Qp=Object.prototype.toString;function Zp(p){var b=p.length*.75,g=p.length,T,I=0,S,M,G,z;p[p.length-1]==="="&&(b--,p[p.length-2]==="="&&b--);var Y=new ArrayBuffer(b),J=new Uint8Array(Y);for(T=0;T<g;T+=4)S=c.indexOf(p[T]),M=c.indexOf(p[T+1]),G=c.indexOf(p[T+2]),z=c.indexOf(p[T+3]),J[I++]=S<<2|M>>4,J[I++]=(M&15)<<4|G>>2,J[I++]=(G&3)<<6|z&63;return Y}function Nl(p){var b=new Uint8Array(p),g="",T;for(T=0;T<b.length;T+=3)g+=c[b[T]>>2],g+=c[(b[T]&3)<<4|b[T+1]>>4],g+=c[(b[T+1]&15)<<2|b[T+2]>>6],g+=c[b[T+2]&63];return b.length%3===2?g=g.substring(0,g.length-1)+"=":b.length%3===1&&(g=g.substring(0,g.length-2)+"=="),g}function Vv(p,b){var g="";if(p&&(g=Qp.call(p)),p&&(g==="[object ArrayBuffer]"||p.buffer&&Qp.call(p.buffer)==="[object ArrayBuffer]")){var T,I=x;p instanceof ArrayBuffer?(T=p,I+=W):(T=p.buffer,g==="[object Int8Array]"?I+=_e:g==="[object Uint8Array]"?I+=ge:g==="[object Uint8ClampedArray]"?I+=Me:g==="[object Int16Array]"?I+=ke:g==="[object Uint16Array]"?I+=fr:g==="[object Int32Array]"?I+=tt:g==="[object Uint32Array]"?I+=qr:g==="[object Float32Array]"?I+=_o:g==="[object Float64Array]"?I+=pr:b(new Error("Failed to get type for BinaryArray"))),b(I+Nl(T))}else if(g==="[object Blob]"){var S=new FileReader;S.onload=function(){var M=u+p.type+"~"+Nl(this.result);b(x+ue+M)},S.readAsArrayBuffer(p)}else try{b(JSON.stringify(p))}catch(M){console.error("Couldn't convert value into a JSON string: ",p),b(null,M)}}function Wv(p){if(p.substring(0,O)!==x)return JSON.parse(p);var b=p.substring(mr),g=p.substring(O,mr),T;if(g===ue&&v.test(b)){var I=b.match(v);T=I[1],b=b.substring(I[0].length)}var S=Zp(b);switch(g){case W:return S;case ue:return d([S],{type:T});case _e:return new Int8Array(S);case ge:return new Uint8Array(S);case Me:return new Uint8ClampedArray(S);case ke:return new Int16Array(S);case fr:return new Uint16Array(S);case tt:return new Int32Array(S);case qr:return new Uint32Array(S);case _o:return new Float32Array(S);case pr:return new Float64Array(S);default:throw new Error("Unkown type: "+g)}}var Pl={serialize:Vv,deserialize:Wv,stringToBuffer:Zp,bufferToString:Nl};function em(p,b,g,T){p.executeSql("CREATE TABLE IF NOT EXISTS "+b.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],g,T)}function jv(p){var b=this,g={db:null};if(p)for(var T in p)g[T]=typeof p[T]!="string"?p[T].toString():p[T];var I=new _(function(S,M){try{g.db=openDatabase(g.name,String(g.version),g.description,g.size)}catch(G){return M(G)}g.db.transaction(function(G){em(G,g,function(){b._dbInfo=g,S()},function(z,Y){M(Y)})},M)});return g.serializer=Pl,I}function dn(p,b,g,T,I,S){p.executeSql(g,T,I,function(M,G){G.code===G.SYNTAX_ERR?M.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[b.storeName],function(z,Y){Y.rows.length?S(z,G):em(z,b,function(){z.executeSql(g,T,I,S)},S)},S):S(M,G)},S)}function Gv(p,b){var g=this;p=N(p);var T=new _(function(I,S){g.ready().then(function(){var M=g._dbInfo;M.db.transaction(function(G){dn(G,M,"SELECT * FROM "+M.storeName+" WHERE key = ? LIMIT 1",[p],function(z,Y){var J=Y.rows.length?Y.rows.item(0).value:null;J&&(J=M.serializer.deserialize(J)),I(J)},function(z,Y){S(Y)})})}).catch(S)});return y(T,b),T}function qv(p,b){var g=this,T=new _(function(I,S){g.ready().then(function(){var M=g._dbInfo;M.db.transaction(function(G){dn(G,M,"SELECT * FROM "+M.storeName,[],function(z,Y){for(var J=Y.rows,te=J.length,ve=0;ve<te;ve++){var Oe=J.item(ve),Ne=Oe.value;if(Ne&&(Ne=M.serializer.deserialize(Ne)),Ne=p(Ne,Oe.key,ve+1),Ne!==void 0){I(Ne);return}}I()},function(z,Y){S(Y)})})}).catch(S)});return y(T,b),T}function tm(p,b,g,T){var I=this;p=N(p);var S=new _(function(M,G){I.ready().then(function(){b===void 0&&(b=null);var z=b,Y=I._dbInfo;Y.serializer.serialize(b,function(J,te){te?G(te):Y.db.transaction(function(ve){dn(ve,Y,"INSERT OR REPLACE INTO "+Y.storeName+" (key, value) VALUES (?, ?)",[p,J],function(){M(z)},function(Oe,Ne){G(Ne)})},function(ve){if(ve.code===ve.QUOTA_ERR){if(T>0){M(tm.apply(I,[p,z,g,T-1]));return}G(ve)}})})}).catch(G)});return y(S,g),S}function zv(p,b,g){return tm.apply(this,[p,b,g,1])}function Yv(p,b){var g=this;p=N(p);var T=new _(function(I,S){g.ready().then(function(){var M=g._dbInfo;M.db.transaction(function(G){dn(G,M,"DELETE FROM "+M.storeName+" WHERE key = ?",[p],function(){I()},function(z,Y){S(Y)})})}).catch(S)});return y(T,b),T}function Kv(p){var b=this,g=new _(function(T,I){b.ready().then(function(){var S=b._dbInfo;S.db.transaction(function(M){dn(M,S,"DELETE FROM "+S.storeName,[],function(){T()},function(G,z){I(z)})})}).catch(I)});return y(g,p),g}function Xv(p){var b=this,g=new _(function(T,I){b.ready().then(function(){var S=b._dbInfo;S.db.transaction(function(M){dn(M,S,"SELECT COUNT(key) as c FROM "+S.storeName,[],function(G,z){var Y=z.rows.item(0).c;T(Y)},function(G,z){I(z)})})}).catch(I)});return y(g,p),g}function Jv(p,b){var g=this,T=new _(function(I,S){g.ready().then(function(){var M=g._dbInfo;M.db.transaction(function(G){dn(G,M,"SELECT key FROM "+M.storeName+" WHERE id = ? LIMIT 1",[p+1],function(z,Y){var J=Y.rows.length?Y.rows.item(0).key:null;I(J)},function(z,Y){S(Y)})})}).catch(S)});return y(T,b),T}function Qv(p){var b=this,g=new _(function(T,I){b.ready().then(function(){var S=b._dbInfo;S.db.transaction(function(M){dn(M,S,"SELECT key FROM "+S.storeName,[],function(G,z){for(var Y=[],J=0;J<z.rows.length;J++)Y.push(z.rows.item(J).key);T(Y)},function(G,z){I(z)})})}).catch(I)});return y(g,p),g}function Zv(p){return new _(function(b,g){p.transaction(function(T){T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(I,S){for(var M=[],G=0;G<S.rows.length;G++)M.push(S.rows.item(G).name);b({db:p,storeNames:M})},function(I,S){g(S)})},function(T){g(T)})})}function eE(p,b){b=A.apply(this,arguments);var g=this.config();p=typeof p!="function"&&p||{},p.name||(p.name=p.name||g.name,p.storeName=p.storeName||g.storeName);var T=this,I;return p.name?I=new _(function(S){var M;p.name===g.name?M=T._dbInfo.db:M=openDatabase(p.name,"","",0),p.storeName?S({db:M,storeNames:[p.storeName]}):S(Zv(M))}).then(function(S){return new _(function(M,G){S.db.transaction(function(z){function Y(Oe){return new _(function(Ne,rt){z.executeSql("DROP TABLE IF EXISTS "+Oe,[],function(){Ne()},function(Qe,Xt){rt(Xt)})})}for(var J=[],te=0,ve=S.storeNames.length;te<ve;te++)J.push(Y(S.storeNames[te]));_.all(J).then(function(){M()}).catch(function(Oe){G(Oe)})},function(z){G(z)})})}):I=_.reject("Invalid arguments"),y(I,b),I}var tE={_driver:"webSQLStorage",_initStorage:jv,_support:h(),iterate:qv,getItem:Gv,setItem:zv,removeItem:Yv,clear:Kv,length:Xv,key:Jv,keys:Qv,dropInstance:eE};function rE(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function rm(p,b){var g=p.name+"/";return p.storeName!==b.storeName&&(g+=p.storeName+"/"),g}function nE(){var p="_localforage_support_test";try{return localStorage.setItem(p,!0),localStorage.removeItem(p),!1}catch{return!0}}function oE(){return!nE()||localStorage.length>0}function iE(p){var b=this,g={};if(p)for(var T in p)g[T]=p[T];return g.keyPrefix=rm(p,b._defaultConfig),oE()?(b._dbInfo=g,g.serializer=Pl,_.resolve()):_.reject()}function sE(p){var b=this,g=b.ready().then(function(){for(var T=b._dbInfo.keyPrefix,I=localStorage.length-1;I>=0;I--){var S=localStorage.key(I);S.indexOf(T)===0&&localStorage.removeItem(S)}});return y(g,p),g}function aE(p,b){var g=this;p=N(p);var T=g.ready().then(function(){var I=g._dbInfo,S=localStorage.getItem(I.keyPrefix+p);return S&&(S=I.serializer.deserialize(S)),S});return y(T,b),T}function cE(p,b){var g=this,T=g.ready().then(function(){for(var I=g._dbInfo,S=I.keyPrefix,M=S.length,G=localStorage.length,z=1,Y=0;Y<G;Y++){var J=localStorage.key(Y);if(J.indexOf(S)===0){var te=localStorage.getItem(J);if(te&&(te=I.serializer.deserialize(te)),te=p(te,J.substring(M),z++),te!==void 0)return te}}});return y(T,b),T}function lE(p,b){var g=this,T=g.ready().then(function(){var I=g._dbInfo,S;try{S=localStorage.key(p)}catch{S=null}return S&&(S=S.substring(I.keyPrefix.length)),S});return y(T,b),T}function uE(p){var b=this,g=b.ready().then(function(){for(var T=b._dbInfo,I=localStorage.length,S=[],M=0;M<I;M++){var G=localStorage.key(M);G.indexOf(T.keyPrefix)===0&&S.push(G.substring(T.keyPrefix.length))}return S});return y(g,p),g}function fE(p){var b=this,g=b.keys().then(function(T){return T.length});return y(g,p),g}function pE(p,b){var g=this;p=N(p);var T=g.ready().then(function(){var I=g._dbInfo;localStorage.removeItem(I.keyPrefix+p)});return y(T,b),T}function mE(p,b,g){var T=this;p=N(p);var I=T.ready().then(function(){b===void 0&&(b=null);var S=b;return new _(function(M,G){var z=T._dbInfo;z.serializer.serialize(b,function(Y,J){if(J)G(J);else try{localStorage.setItem(z.keyPrefix+p,Y),M(S)}catch(te){(te.name==="QuotaExceededError"||te.name==="NS_ERROR_DOM_QUOTA_REACHED")&&G(te),G(te)}})})});return y(I,g),I}function dE(p,b){if(b=A.apply(this,arguments),p=typeof p!="function"&&p||{},!p.name){var g=this.config();p.name=p.name||g.name,p.storeName=p.storeName||g.storeName}var T=this,I;return p.name?I=new _(function(S){p.storeName?S(rm(p,T._defaultConfig)):S(p.name+"/")}).then(function(S){for(var M=localStorage.length-1;M>=0;M--){var G=localStorage.key(M);G.indexOf(S)===0&&localStorage.removeItem(G)}}):I=_.reject("Invalid arguments"),y(I,b),I}var hE={_driver:"localStorageWrapper",_initStorage:iE,_support:rE(),iterate:cE,getItem:aE,setItem:mE,removeItem:pE,clear:sE,length:fE,key:lE,keys:uE,dropInstance:dE},gE=function(b,g){return b===g||typeof b=="number"&&typeof g=="number"&&isNaN(b)&&isNaN(g)},yE=function(b,g){for(var T=b.length,I=0;I<T;){if(gE(b[I],g))return!0;I++}return!1},nm=Array.isArray||function(p){return Object.prototype.toString.call(p)==="[object Array]"},Ii={},om={},wo={INDEXEDDB:$t,WEBSQL:tE,LOCALSTORAGE:hE},vE=[wo.INDEXEDDB._driver,wo.WEBSQL._driver,wo.LOCALSTORAGE._driver],Hs=["dropInstance"],Ll=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Hs),EE={description:"",driver:vE.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function _E(p,b){p[b]=function(){var g=arguments;return p.ready().then(function(){return p[b].apply(p,g)})}}function Ml(){for(var p=1;p<arguments.length;p++){var b=arguments[p];if(b)for(var g in b)b.hasOwnProperty(g)&&(nm(b[g])?arguments[0][g]=b[g].slice():arguments[0][g]=b[g])}return arguments[0]}var wE=(function(){function p(b){a(this,p);for(var g in wo)if(wo.hasOwnProperty(g)){var T=wo[g],I=T._driver;this[g]=I,Ii[I]||this.defineDriver(T)}this._defaultConfig=Ml({},EE),this._config=Ml({},this._defaultConfig,b),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return p.prototype.config=function(g){if((typeof g>"u"?"undefined":s(g))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var T in g){if(T==="storeName"&&(g[T]=g[T].replace(/\W/g,"_")),T==="version"&&typeof g[T]!="number")return new Error("Database version must be a number.");this._config[T]=g[T]}return"driver"in g&&g.driver?this.setDriver(this._config.driver):!0}else return typeof g=="string"?this._config[g]:this._config},p.prototype.defineDriver=function(g,T,I){var S=new _(function(M,G){try{var z=g._driver,Y=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver){G(Y);return}for(var J=Ll.concat("_initStorage"),te=0,ve=J.length;te<ve;te++){var Oe=J[te],Ne=!yE(Hs,Oe);if((Ne||g[Oe])&&typeof g[Oe]!="function"){G(Y);return}}var rt=function(){for(var xi=function(TE){return function(){var IE=new Error("Method "+TE+" is not implemented by the current driver"),im=_.reject(IE);return y(im,arguments[arguments.length-1]),im}},Bl=0,SE=Hs.length;Bl<SE;Bl++){var Ul=Hs[Bl];g[Ul]||(g[Ul]=xi(Ul))}};rt();var Qe=function(xi){Ii[z]&&console.info("Redefining LocalForage driver: "+z),Ii[z]=g,om[z]=xi,M()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(Qe,G):Qe(!!g._support):Qe(!0)}catch(Xt){G(Xt)}});return C(S,T,I),S},p.prototype.driver=function(){return this._driver||null},p.prototype.getDriver=function(g,T,I){var S=Ii[g]?_.resolve(Ii[g]):_.reject(new Error("Driver not found."));return C(S,T,I),S},p.prototype.getSerializer=function(g){var T=_.resolve(Pl);return C(T,g),T},p.prototype.ready=function(g){var T=this,I=T._driverSet.then(function(){return T._ready===null&&(T._ready=T._initDriver()),T._ready});return C(I,g,g),I},p.prototype.setDriver=function(g,T,I){var S=this;nm(g)||(g=[g]);var M=this._getSupportedDrivers(g);function G(){S._config.driver=S.driver()}function z(te){return S._extend(te),G(),S._ready=S._initStorage(S._config),S._ready}function Y(te){return function(){var ve=0;function Oe(){for(;ve<te.length;){var Ne=te[ve];return ve++,S._dbInfo=null,S._ready=null,S.getDriver(Ne).then(z).catch(Oe)}G();var rt=new Error("No available storage method found.");return S._driverSet=_.reject(rt),S._driverSet}return Oe()}}var J=this._driverSet!==null?this._driverSet.catch(function(){return _.resolve()}):_.resolve();return this._driverSet=J.then(function(){var te=M[0];return S._dbInfo=null,S._ready=null,S.getDriver(te).then(function(ve){S._driver=ve._driver,G(),S._wrapLibraryMethodsWithReady(),S._initDriver=Y(M)})}).catch(function(){G();var te=new Error("No available storage method found.");return S._driverSet=_.reject(te),S._driverSet}),C(this._driverSet,T,I),this._driverSet},p.prototype.supports=function(g){return!!om[g]},p.prototype._extend=function(g){Ml(this,g)},p.prototype._getSupportedDrivers=function(g){for(var T=[],I=0,S=g.length;I<S;I++){var M=g[I];this.supports(M)&&T.push(M)}return T},p.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,T=Ll.length;g<T;g++)_E(this,Ll[g])},p.prototype.createInstance=function(g){return new p(g)},p})(),bE=new wE;o.exports=bE},{3:3}]},{},[4])(4)})});var Mf=kl((ec,eg)=>{"use strict";(function(t,e){typeof ec=="object"&&typeof eg<"u"?e(ec):typeof define=="function"&&define.amd?define(["exports"],e):e((t=typeof globalThis<"u"?globalThis:t||self).Sqrl={})})(ec,function(t){"use strict";function e(D){var R,V,k=new Error(D);return R=k,V=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(R,V):R.__proto__=V,k}function r(D,R,V){var k=R.slice(0,V).split(/\n/),H=k.length,ne=k[H-1].length+1;throw e(D+=" at line "+H+" col "+ne+`:
|
|
1
|
+
import{a as $s,b as Vs,c as am,d as cm,e as lm,f as um,g as fm,h as dr,i as Ws,j as b,k as pm,l as mm,m as dm,n as hm,o as Tr}from"./chunk-BVWCBCYN.js";import{a as E,b as Z,c as Ci,d as sm,e as kl,f as zr,g as wo}from"./chunk-V7UGKYBN.js";var Fl=kl(js=>{"use strict";Object.defineProperty(js,"__esModule",{value:!0});js.URLBuilder=void 0;var xE=(function(){function t(e){try{this.base=new URL(e),this.params=new URLSearchParams(this.base.search.slice(1))}catch(r){console.error("Un-parsable URL",r)}}return t.prototype.appendQueryParam=function(e,r){this.params.append(e,r?r.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(e){this.params.delete(e)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(e){if(!this.params)return"";var r=this.params.get(e);return!r||r==="undefined"||r==="null"?void 0:r},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(e){return this.base.pathname=e,this},t.prototype.setQueryParam=function(e,r){return this.params.set(e,r?r.toString():""),this},t.prototype.setQueryString=function(e){if(e)return e[0]==="?"&&(e=e.slice(1)),this.params=new URLSearchParams(e),this},t.prototype.toString=function(){var e=this.params.toString();return e===""?this.base.search="":this.base.search="?"+e,this.base.toString()},t})();js.URLBuilder=xE});var Sm=kl((wm,zl)=>{"use strict";(function(t){if(typeof wm=="object"&&typeof zl<"u")zl.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return(function n(o,i,s){function a(m,d){if(!i[m]){if(!o[m]){var _=typeof Ci=="function"&&Ci;if(!d&&_)return _(m,!0);if(l)return l(m,!0);var y=new Error("Cannot find module '"+m+"'");throw y.code="MODULE_NOT_FOUND",y}var C=i[m]={exports:{}};o[m][0].call(C.exports,function(N){var A=o[m][1][N];return a(A||N)},C,C.exports,n,o,i,s)}return i[m].exports}for(var l=typeof Ci=="function"&&Ci,f=0;f<s.length;f++)a(s[f]);return a})({1:[function(n,o,i){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,l;if(a){var f=0,m=new a(N),d=s.document.createTextNode("");m.observe(d,{characterData:!0}),l=function(){d.data=f=++f%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var _=new s.MessageChannel;_.port1.onmessage=N,l=function(){_.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var B=s.document.createElement("script");B.onreadystatechange=function(){N(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},s.document.documentElement.appendChild(B)}:l=function(){setTimeout(N,0)};var y,C=[];function N(){y=!0;for(var B,q,P=C.length;P;){for(q=C,C=[],B=-1;++B<P;)q[B]();P=C.length}y=!1}o.exports=A;function A(B){C.push(B)===1&&!y&&l()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,o,i){"use strict";var s=n(1);function a(){}var l={},f=["REJECTED"],m=["FULFILLED"],d=["PENDING"];o.exports=_;function _(X){if(typeof X!="function")throw new TypeError("resolver must be a function");this.state=d,this.queue=[],this.outcome=void 0,X!==a&&A(this,X)}_.prototype.catch=function(X){return this.then(null,X)},_.prototype.then=function(X,ce){if(typeof X!="function"&&this.state===m||typeof ce!="function"&&this.state===f)return this;var se=new this.constructor(a);if(this.state!==d){var de=this.state===m?X:ce;C(se,de,this.outcome)}else this.queue.push(new y(se,X,ce));return se};function y(X,ce,se){this.promise=X,typeof ce=="function"&&(this.onFulfilled=ce,this.callFulfilled=this.otherCallFulfilled),typeof se=="function"&&(this.onRejected=se,this.callRejected=this.otherCallRejected)}y.prototype.callFulfilled=function(X){l.resolve(this.promise,X)},y.prototype.otherCallFulfilled=function(X){C(this.promise,this.onFulfilled,X)},y.prototype.callRejected=function(X){l.reject(this.promise,X)},y.prototype.otherCallRejected=function(X){C(this.promise,this.onRejected,X)};function C(X,ce,se){s(function(){var de;try{de=ce(se)}catch(Le){return l.reject(X,Le)}de===X?l.reject(X,new TypeError("Cannot resolve promise with itself")):l.resolve(X,de)})}l.resolve=function(X,ce){var se=B(N,ce);if(se.status==="error")return l.reject(X,se.value);var de=se.value;if(de)A(X,de);else{X.state=m,X.outcome=ce;for(var Le=-1,Se=X.queue.length;++Le<Se;)X.queue[Le].callFulfilled(ce)}return X},l.reject=function(X,ce){X.state=f,X.outcome=ce;for(var se=-1,de=X.queue.length;++se<de;)X.queue[se].callRejected(ce);return X};function N(X){var ce=X&&X.then;if(X&&(typeof X=="object"||typeof X=="function")&&typeof ce=="function")return function(){ce.apply(X,arguments)}}function A(X,ce){var se=!1;function de(Ge){se||(se=!0,l.reject(X,Ge))}function Le(Ge){se||(se=!0,l.resolve(X,Ge))}function Se(){ce(Le,de)}var Re=B(Se);Re.status==="error"&&de(Re.value)}function B(X,ce){var se={};try{se.value=X(ce),se.status="success"}catch(de){se.status="error",se.value=de}return se}_.resolve=q;function q(X){return X instanceof this?X:l.resolve(new this(a),X)}_.reject=P;function P(X){var ce=new this(a);return l.reject(ce,X)}_.all=Q;function Q(X){var ce=this;if(Object.prototype.toString.call(X)!=="[object Array]")return this.reject(new TypeError("must be an array"));var se=X.length,de=!1;if(!se)return this.resolve([]);for(var Le=new Array(se),Se=0,Re=-1,Ge=new this(a);++Re<se;)Je(X[Re],Re);return Ge;function Je(Bt,D){ce.resolve(Bt).then(R,function(V){de||(de=!0,l.reject(Ge,V))});function R(V){Le[D]=V,++Se===se&&!de&&(de=!0,l.resolve(Ge,Le))}}}_.race=Ee;function Ee(X){var ce=this;if(Object.prototype.toString.call(X)!=="[object Array]")return this.reject(new TypeError("must be an array"));var se=X.length,de=!1;if(!se)return this.resolve([]);for(var Le=-1,Se=new this(a);++Le<se;)Re(X[Le]);return Se;function Re(Ge){ce.resolve(Ge).then(function(Je){de||(de=!0,l.resolve(Se,Je))},function(Je){de||(de=!0,l.reject(Se,Je))})}}},{1:1}],3:[function(n,o,i){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,o,i){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(p){return typeof p}:function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p};function a(p,w){if(!(p instanceof w))throw new TypeError("Cannot call a class as a function")}function l(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var f=l();function m(){try{if(!f||!f.open)return!1;var p=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),w=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!p||w)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function d(p,w){p=p||[],w=w||{};try{return new Blob(p,w)}catch(S){if(S.name!=="TypeError")throw S;for(var g=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,T=new g,I=0;I<p.length;I+=1)T.append(p[I]);return T.getBlob(w.type)}}typeof Promise>"u"&&n(3);var _=Promise;function y(p,w){w&&p.then(function(g){w(null,g)},function(g){w(g)})}function C(p,w,g){typeof w=="function"&&p.then(w),typeof g=="function"&&p.catch(g)}function N(p){return typeof p!="string"&&(console.warn(p+" used as a key, but it is not a string."),p=String(p)),p}function A(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var B="local-forage-detect-blob-support",q=void 0,P={},Q=Object.prototype.toString,Ee="readonly",X="readwrite";function ce(p){for(var w=p.length,g=new ArrayBuffer(w),T=new Uint8Array(g),I=0;I<w;I++)T[I]=p.charCodeAt(I);return g}function se(p){return new _(function(w){var g=p.transaction(B,X),T=d([""]);g.objectStore(B).put(T,"key"),g.onabort=function(I){I.preventDefault(),I.stopPropagation(),w(!1)},g.oncomplete=function(){var I=navigator.userAgent.match(/Chrome\/(\d+)/),S=navigator.userAgent.match(/Edge\//);w(S||!I||parseInt(I[1],10)>=43)}}).catch(function(){return!1})}function de(p){return typeof q=="boolean"?_.resolve(q):se(p).then(function(w){return q=w,q})}function Le(p){var w=P[p.name],g={};g.promise=new _(function(T,I){g.resolve=T,g.reject=I}),w.deferredOperations.push(g),w.dbReady?w.dbReady=w.dbReady.then(function(){return g.promise}):w.dbReady=g.promise}function Se(p){var w=P[p.name],g=w.deferredOperations.pop();if(g)return g.resolve(),g.promise}function Re(p,w){var g=P[p.name],T=g.deferredOperations.pop();if(T)return T.reject(w),T.promise}function Ge(p,w){return new _(function(g,T){if(P[p.name]=P[p.name]||qe(),p.db)if(w)Le(p),p.db.close();else return g(p.db);var I=[p.name];w&&I.push(p.version);var S=f.open.apply(f,I);w&&(S.onupgradeneeded=function(M){var G=S.result;try{G.createObjectStore(p.storeName),M.oldVersion<=1&&G.createObjectStore(B)}catch(z){if(z.name==="ConstraintError")console.warn('The database "'+p.name+'" has been upgraded from version '+M.oldVersion+" to version "+M.newVersion+', but the storage "'+p.storeName+'" already exists.');else throw z}}),S.onerror=function(M){M.preventDefault(),T(S.error)},S.onsuccess=function(){var M=S.result;M.onversionchange=function(G){G.target.close()},g(M),Se(p)}})}function Je(p){return Ge(p,!1)}function Bt(p){return Ge(p,!0)}function D(p,w){if(!p.db)return!0;var g=!p.db.objectStoreNames.contains(p.storeName),T=p.version<p.db.version,I=p.version>p.db.version;if(T&&(p.version!==w&&console.warn('The database "'+p.name+`" can't be downgraded from version `+p.db.version+" to version "+p.version+"."),p.version=p.db.version),I||g){if(g){var S=p.db.version+1;S>p.version&&(p.version=S)}return!0}return!1}function R(p){return new _(function(w,g){var T=new FileReader;T.onerror=g,T.onloadend=function(I){var S=btoa(I.target.result||"");w({__local_forage_encoded_blob:!0,data:S,type:p.type})},T.readAsBinaryString(p)})}function V(p){var w=ce(atob(p.data));return d([w],{type:p.type})}function k(p){return p&&p.__local_forage_encoded_blob}function H(p){var w=this,g=w._initReady().then(function(){var T=P[w._dbInfo.name];if(T&&T.dbReady)return T.dbReady});return C(g,p,p),g}function ne(p){Le(p);for(var w=P[p.name],g=w.forages,T=0;T<g.length;T++){var I=g[T];I._dbInfo.db&&(I._dbInfo.db.close(),I._dbInfo.db=null)}return p.db=null,Je(p).then(function(S){return p.db=S,D(p)?Bt(p):S}).then(function(S){p.db=w.db=S;for(var M=0;M<g.length;M++)g[M]._dbInfo.db=S}).catch(function(S){throw Re(p,S),S})}function he(p,w,g,T){T===void 0&&(T=1);try{var I=p.db.transaction(p.storeName,w);g(null,I)}catch(S){if(T>0&&(!p.db||S.name==="InvalidStateError"||S.name==="NotFoundError"))return _.resolve().then(function(){if(!p.db||S.name==="NotFoundError"&&!p.db.objectStoreNames.contains(p.storeName)&&p.version<=p.db.version)return p.db&&(p.version=p.db.version+1),Bt(p)}).then(function(){return ne(p).then(function(){he(p,w,g,T-1)})}).catch(g);g(S)}}function qe(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Ze(p){var w=this,g={db:null};if(p)for(var T in p)g[T]=p[T];var I=P[g.name];I||(I=qe(),P[g.name]=I),I.forages.push(w),w._initReady||(w._initReady=w.ready,w.ready=H);var S=[];function M(){return _.resolve()}for(var G=0;G<I.forages.length;G++){var z=I.forages[G];z!==w&&S.push(z._initReady().catch(M))}var Y=I.forages.slice(0);return _.all(S).then(function(){return g.db=I.db,Je(g)}).then(function(J){return g.db=J,D(g,w._defaultConfig.version)?Bt(g):J}).then(function(J){g.db=I.db=J,w._dbInfo=g;for(var te=0;te<Y.length;te++){var ve=Y[te];ve!==w&&(ve._dbInfo.db=g.db,ve._dbInfo.version=g.version)}})}function et(p,w){var g=this;p=N(p);var T=new _(function(I,S){g.ready().then(function(){he(g._dbInfo,Ee,function(M,G){if(M)return S(M);try{var z=G.objectStore(g._dbInfo.storeName),Y=z.get(p);Y.onsuccess=function(){var J=Y.result;J===void 0&&(J=null),k(J)&&(J=V(J)),I(J)},Y.onerror=function(){S(Y.error)}}catch(J){S(J)}})}).catch(S)});return y(T,w),T}function vt(p,w){var g=this,T=new _(function(I,S){g.ready().then(function(){he(g._dbInfo,Ee,function(M,G){if(M)return S(M);try{var z=G.objectStore(g._dbInfo.storeName),Y=z.openCursor(),J=1;Y.onsuccess=function(){var te=Y.result;if(te){var ve=te.value;k(ve)&&(ve=V(ve));var Oe=p(ve,te.key,J++);Oe!==void 0?I(Oe):te.continue()}else I()},Y.onerror=function(){S(Y.error)}}catch(te){S(te)}})}).catch(S)});return y(T,w),T}function Et(p,w,g){var T=this;p=N(p);var I=new _(function(S,M){var G;T.ready().then(function(){return G=T._dbInfo,Q.call(w)==="[object Blob]"?de(G.db).then(function(z){return z?w:R(w)}):w}).then(function(z){he(T._dbInfo,X,function(Y,J){if(Y)return M(Y);try{var te=J.objectStore(T._dbInfo.storeName);z===null&&(z=void 0);var ve=te.put(z,p);J.oncomplete=function(){z===void 0&&(z=null),S(z)},J.onabort=J.onerror=function(){var Oe=ve.error?ve.error:ve.transaction.error;M(Oe)}}catch(Oe){M(Oe)}})}).catch(M)});return y(I,g),I}function it(p,w){var g=this;p=N(p);var T=new _(function(I,S){g.ready().then(function(){he(g._dbInfo,X,function(M,G){if(M)return S(M);try{var z=G.objectStore(g._dbInfo.storeName),Y=z.delete(p);G.oncomplete=function(){I()},G.onerror=function(){S(Y.error)},G.onabort=function(){var J=Y.error?Y.error:Y.transaction.error;S(J)}}catch(J){S(J)}})}).catch(S)});return y(T,w),T}function we(p){var w=this,g=new _(function(T,I){w.ready().then(function(){he(w._dbInfo,X,function(S,M){if(S)return I(S);try{var G=M.objectStore(w._dbInfo.storeName),z=G.clear();M.oncomplete=function(){T()},M.onabort=M.onerror=function(){var Y=z.error?z.error:z.transaction.error;I(Y)}}catch(Y){I(Y)}})}).catch(I)});return y(g,p),g}function He(p){var w=this,g=new _(function(T,I){w.ready().then(function(){he(w._dbInfo,Ee,function(S,M){if(S)return I(S);try{var G=M.objectStore(w._dbInfo.storeName),z=G.count();z.onsuccess=function(){T(z.result)},z.onerror=function(){I(z.error)}}catch(Y){I(Y)}})}).catch(I)});return y(g,p),g}function Ae(p,w){var g=this,T=new _(function(I,S){if(p<0){I(null);return}g.ready().then(function(){he(g._dbInfo,Ee,function(M,G){if(M)return S(M);try{var z=G.objectStore(g._dbInfo.storeName),Y=!1,J=z.openKeyCursor();J.onsuccess=function(){var te=J.result;if(!te){I(null);return}p===0||Y?I(te.key):(Y=!0,te.advance(p))},J.onerror=function(){S(J.error)}}catch(te){S(te)}})}).catch(S)});return y(T,w),T}function $e(p){var w=this,g=new _(function(T,I){w.ready().then(function(){he(w._dbInfo,Ee,function(S,M){if(S)return I(S);try{var G=M.objectStore(w._dbInfo.storeName),z=G.openKeyCursor(),Y=[];z.onsuccess=function(){var J=z.result;if(!J){T(Y);return}Y.push(J.key),J.continue()},z.onerror=function(){I(z.error)}}catch(J){I(J)}})}).catch(I)});return y(g,p),g}function De(p,w){w=A.apply(this,arguments);var g=this.config();p=typeof p!="function"&&p||{},p.name||(p.name=p.name||g.name,p.storeName=p.storeName||g.storeName);var T=this,I;if(!p.name)I=_.reject("Invalid arguments");else{var S=p.name===g.name&&T._dbInfo.db,M=S?_.resolve(T._dbInfo.db):Je(p).then(function(G){var z=P[p.name],Y=z.forages;z.db=G;for(var J=0;J<Y.length;J++)Y[J]._dbInfo.db=G;return G});p.storeName?I=M.then(function(G){if(G.objectStoreNames.contains(p.storeName)){var z=G.version+1;Le(p);var Y=P[p.name],J=Y.forages;G.close();for(var te=0;te<J.length;te++){var ve=J[te];ve._dbInfo.db=null,ve._dbInfo.version=z}var Oe=new _(function(Ne,rt){var Qe=f.open(p.name,z);Qe.onerror=function(Xt){var xi=Qe.result;xi.close(),rt(Xt)},Qe.onupgradeneeded=function(){var Xt=Qe.result;Xt.deleteObjectStore(p.storeName)},Qe.onsuccess=function(){var Xt=Qe.result;Xt.close(),Ne(Xt)}});return Oe.then(function(Ne){Y.db=Ne;for(var rt=0;rt<J.length;rt++){var Qe=J[rt];Qe._dbInfo.db=Ne,Se(Qe._dbInfo)}}).catch(function(Ne){throw(Re(p,Ne)||_.resolve()).catch(function(){}),Ne})}}):I=M.then(function(G){Le(p);var z=P[p.name],Y=z.forages;G.close();for(var J=0;J<Y.length;J++){var te=Y[J];te._dbInfo.db=null}var ve=new _(function(Oe,Ne){var rt=f.deleteDatabase(p.name);rt.onerror=function(){var Qe=rt.result;Qe&&Qe.close(),Ne(rt.error)},rt.onblocked=function(){console.warn('dropInstance blocked for database "'+p.name+'" until all open connections are closed')},rt.onsuccess=function(){var Qe=rt.result;Qe&&Qe.close(),Oe(Qe)}});return ve.then(function(Oe){z.db=Oe;for(var Ne=0;Ne<Y.length;Ne++){var rt=Y[Ne];Se(rt._dbInfo)}}).catch(function(Oe){throw(Re(p,Oe)||_.resolve()).catch(function(){}),Oe})})}return y(I,w),I}var $t={_driver:"asyncStorage",_initStorage:Ze,_support:m(),iterate:vt,getItem:et,setItem:Et,removeItem:it,clear:we,length:He,key:Ae,keys:$e,dropInstance:De};function h(){return typeof openDatabase=="function"}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="~~local_forage_type~",v=/^~~local_forage_type~([^~]+)~/,x="__lfsc__:",O=x.length,W="arbf",ue="blob",_e="si08",ge="ui08",Me="uic8",ke="si16",tt="si32",fr="ur16",qr="ui32",_o="fl32",pr="fl64",mr=O+W.length,Qp=Object.prototype.toString;function Zp(p){var w=p.length*.75,g=p.length,T,I=0,S,M,G,z;p[p.length-1]==="="&&(w--,p[p.length-2]==="="&&w--);var Y=new ArrayBuffer(w),J=new Uint8Array(Y);for(T=0;T<g;T+=4)S=c.indexOf(p[T]),M=c.indexOf(p[T+1]),G=c.indexOf(p[T+2]),z=c.indexOf(p[T+3]),J[I++]=S<<2|M>>4,J[I++]=(M&15)<<4|G>>2,J[I++]=(G&3)<<6|z&63;return Y}function Nl(p){var w=new Uint8Array(p),g="",T;for(T=0;T<w.length;T+=3)g+=c[w[T]>>2],g+=c[(w[T]&3)<<4|w[T+1]>>4],g+=c[(w[T+1]&15)<<2|w[T+2]>>6],g+=c[w[T+2]&63];return w.length%3===2?g=g.substring(0,g.length-1)+"=":w.length%3===1&&(g=g.substring(0,g.length-2)+"=="),g}function Vv(p,w){var g="";if(p&&(g=Qp.call(p)),p&&(g==="[object ArrayBuffer]"||p.buffer&&Qp.call(p.buffer)==="[object ArrayBuffer]")){var T,I=x;p instanceof ArrayBuffer?(T=p,I+=W):(T=p.buffer,g==="[object Int8Array]"?I+=_e:g==="[object Uint8Array]"?I+=ge:g==="[object Uint8ClampedArray]"?I+=Me:g==="[object Int16Array]"?I+=ke:g==="[object Uint16Array]"?I+=fr:g==="[object Int32Array]"?I+=tt:g==="[object Uint32Array]"?I+=qr:g==="[object Float32Array]"?I+=_o:g==="[object Float64Array]"?I+=pr:w(new Error("Failed to get type for BinaryArray"))),w(I+Nl(T))}else if(g==="[object Blob]"){var S=new FileReader;S.onload=function(){var M=u+p.type+"~"+Nl(this.result);w(x+ue+M)},S.readAsArrayBuffer(p)}else try{w(JSON.stringify(p))}catch(M){console.error("Couldn't convert value into a JSON string: ",p),w(null,M)}}function Wv(p){if(p.substring(0,O)!==x)return JSON.parse(p);var w=p.substring(mr),g=p.substring(O,mr),T;if(g===ue&&v.test(w)){var I=w.match(v);T=I[1],w=w.substring(I[0].length)}var S=Zp(w);switch(g){case W:return S;case ue:return d([S],{type:T});case _e:return new Int8Array(S);case ge:return new Uint8Array(S);case Me:return new Uint8ClampedArray(S);case ke:return new Int16Array(S);case fr:return new Uint16Array(S);case tt:return new Int32Array(S);case qr:return new Uint32Array(S);case _o:return new Float32Array(S);case pr:return new Float64Array(S);default:throw new Error("Unkown type: "+g)}}var Pl={serialize:Vv,deserialize:Wv,stringToBuffer:Zp,bufferToString:Nl};function em(p,w,g,T){p.executeSql("CREATE TABLE IF NOT EXISTS "+w.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],g,T)}function jv(p){var w=this,g={db:null};if(p)for(var T in p)g[T]=typeof p[T]!="string"?p[T].toString():p[T];var I=new _(function(S,M){try{g.db=openDatabase(g.name,String(g.version),g.description,g.size)}catch(G){return M(G)}g.db.transaction(function(G){em(G,g,function(){w._dbInfo=g,S()},function(z,Y){M(Y)})},M)});return g.serializer=Pl,I}function dn(p,w,g,T,I,S){p.executeSql(g,T,I,function(M,G){G.code===G.SYNTAX_ERR?M.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[w.storeName],function(z,Y){Y.rows.length?S(z,G):em(z,w,function(){z.executeSql(g,T,I,S)},S)},S):S(M,G)},S)}function Gv(p,w){var g=this;p=N(p);var T=new _(function(I,S){g.ready().then(function(){var M=g._dbInfo;M.db.transaction(function(G){dn(G,M,"SELECT * FROM "+M.storeName+" WHERE key = ? LIMIT 1",[p],function(z,Y){var J=Y.rows.length?Y.rows.item(0).value:null;J&&(J=M.serializer.deserialize(J)),I(J)},function(z,Y){S(Y)})})}).catch(S)});return y(T,w),T}function qv(p,w){var g=this,T=new _(function(I,S){g.ready().then(function(){var M=g._dbInfo;M.db.transaction(function(G){dn(G,M,"SELECT * FROM "+M.storeName,[],function(z,Y){for(var J=Y.rows,te=J.length,ve=0;ve<te;ve++){var Oe=J.item(ve),Ne=Oe.value;if(Ne&&(Ne=M.serializer.deserialize(Ne)),Ne=p(Ne,Oe.key,ve+1),Ne!==void 0){I(Ne);return}}I()},function(z,Y){S(Y)})})}).catch(S)});return y(T,w),T}function tm(p,w,g,T){var I=this;p=N(p);var S=new _(function(M,G){I.ready().then(function(){w===void 0&&(w=null);var z=w,Y=I._dbInfo;Y.serializer.serialize(w,function(J,te){te?G(te):Y.db.transaction(function(ve){dn(ve,Y,"INSERT OR REPLACE INTO "+Y.storeName+" (key, value) VALUES (?, ?)",[p,J],function(){M(z)},function(Oe,Ne){G(Ne)})},function(ve){if(ve.code===ve.QUOTA_ERR){if(T>0){M(tm.apply(I,[p,z,g,T-1]));return}G(ve)}})})}).catch(G)});return y(S,g),S}function zv(p,w,g){return tm.apply(this,[p,w,g,1])}function Yv(p,w){var g=this;p=N(p);var T=new _(function(I,S){g.ready().then(function(){var M=g._dbInfo;M.db.transaction(function(G){dn(G,M,"DELETE FROM "+M.storeName+" WHERE key = ?",[p],function(){I()},function(z,Y){S(Y)})})}).catch(S)});return y(T,w),T}function Kv(p){var w=this,g=new _(function(T,I){w.ready().then(function(){var S=w._dbInfo;S.db.transaction(function(M){dn(M,S,"DELETE FROM "+S.storeName,[],function(){T()},function(G,z){I(z)})})}).catch(I)});return y(g,p),g}function Xv(p){var w=this,g=new _(function(T,I){w.ready().then(function(){var S=w._dbInfo;S.db.transaction(function(M){dn(M,S,"SELECT COUNT(key) as c FROM "+S.storeName,[],function(G,z){var Y=z.rows.item(0).c;T(Y)},function(G,z){I(z)})})}).catch(I)});return y(g,p),g}function Jv(p,w){var g=this,T=new _(function(I,S){g.ready().then(function(){var M=g._dbInfo;M.db.transaction(function(G){dn(G,M,"SELECT key FROM "+M.storeName+" WHERE id = ? LIMIT 1",[p+1],function(z,Y){var J=Y.rows.length?Y.rows.item(0).key:null;I(J)},function(z,Y){S(Y)})})}).catch(S)});return y(T,w),T}function Qv(p){var w=this,g=new _(function(T,I){w.ready().then(function(){var S=w._dbInfo;S.db.transaction(function(M){dn(M,S,"SELECT key FROM "+S.storeName,[],function(G,z){for(var Y=[],J=0;J<z.rows.length;J++)Y.push(z.rows.item(J).key);T(Y)},function(G,z){I(z)})})}).catch(I)});return y(g,p),g}function Zv(p){return new _(function(w,g){p.transaction(function(T){T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(I,S){for(var M=[],G=0;G<S.rows.length;G++)M.push(S.rows.item(G).name);w({db:p,storeNames:M})},function(I,S){g(S)})},function(T){g(T)})})}function eE(p,w){w=A.apply(this,arguments);var g=this.config();p=typeof p!="function"&&p||{},p.name||(p.name=p.name||g.name,p.storeName=p.storeName||g.storeName);var T=this,I;return p.name?I=new _(function(S){var M;p.name===g.name?M=T._dbInfo.db:M=openDatabase(p.name,"","",0),p.storeName?S({db:M,storeNames:[p.storeName]}):S(Zv(M))}).then(function(S){return new _(function(M,G){S.db.transaction(function(z){function Y(Oe){return new _(function(Ne,rt){z.executeSql("DROP TABLE IF EXISTS "+Oe,[],function(){Ne()},function(Qe,Xt){rt(Xt)})})}for(var J=[],te=0,ve=S.storeNames.length;te<ve;te++)J.push(Y(S.storeNames[te]));_.all(J).then(function(){M()}).catch(function(Oe){G(Oe)})},function(z){G(z)})})}):I=_.reject("Invalid arguments"),y(I,w),I}var tE={_driver:"webSQLStorage",_initStorage:jv,_support:h(),iterate:qv,getItem:Gv,setItem:zv,removeItem:Yv,clear:Kv,length:Xv,key:Jv,keys:Qv,dropInstance:eE};function rE(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function rm(p,w){var g=p.name+"/";return p.storeName!==w.storeName&&(g+=p.storeName+"/"),g}function nE(){var p="_localforage_support_test";try{return localStorage.setItem(p,!0),localStorage.removeItem(p),!1}catch{return!0}}function oE(){return!nE()||localStorage.length>0}function iE(p){var w=this,g={};if(p)for(var T in p)g[T]=p[T];return g.keyPrefix=rm(p,w._defaultConfig),oE()?(w._dbInfo=g,g.serializer=Pl,_.resolve()):_.reject()}function sE(p){var w=this,g=w.ready().then(function(){for(var T=w._dbInfo.keyPrefix,I=localStorage.length-1;I>=0;I--){var S=localStorage.key(I);S.indexOf(T)===0&&localStorage.removeItem(S)}});return y(g,p),g}function aE(p,w){var g=this;p=N(p);var T=g.ready().then(function(){var I=g._dbInfo,S=localStorage.getItem(I.keyPrefix+p);return S&&(S=I.serializer.deserialize(S)),S});return y(T,w),T}function cE(p,w){var g=this,T=g.ready().then(function(){for(var I=g._dbInfo,S=I.keyPrefix,M=S.length,G=localStorage.length,z=1,Y=0;Y<G;Y++){var J=localStorage.key(Y);if(J.indexOf(S)===0){var te=localStorage.getItem(J);if(te&&(te=I.serializer.deserialize(te)),te=p(te,J.substring(M),z++),te!==void 0)return te}}});return y(T,w),T}function lE(p,w){var g=this,T=g.ready().then(function(){var I=g._dbInfo,S;try{S=localStorage.key(p)}catch{S=null}return S&&(S=S.substring(I.keyPrefix.length)),S});return y(T,w),T}function uE(p){var w=this,g=w.ready().then(function(){for(var T=w._dbInfo,I=localStorage.length,S=[],M=0;M<I;M++){var G=localStorage.key(M);G.indexOf(T.keyPrefix)===0&&S.push(G.substring(T.keyPrefix.length))}return S});return y(g,p),g}function fE(p){var w=this,g=w.keys().then(function(T){return T.length});return y(g,p),g}function pE(p,w){var g=this;p=N(p);var T=g.ready().then(function(){var I=g._dbInfo;localStorage.removeItem(I.keyPrefix+p)});return y(T,w),T}function mE(p,w,g){var T=this;p=N(p);var I=T.ready().then(function(){w===void 0&&(w=null);var S=w;return new _(function(M,G){var z=T._dbInfo;z.serializer.serialize(w,function(Y,J){if(J)G(J);else try{localStorage.setItem(z.keyPrefix+p,Y),M(S)}catch(te){(te.name==="QuotaExceededError"||te.name==="NS_ERROR_DOM_QUOTA_REACHED")&&G(te),G(te)}})})});return y(I,g),I}function dE(p,w){if(w=A.apply(this,arguments),p=typeof p!="function"&&p||{},!p.name){var g=this.config();p.name=p.name||g.name,p.storeName=p.storeName||g.storeName}var T=this,I;return p.name?I=new _(function(S){p.storeName?S(rm(p,T._defaultConfig)):S(p.name+"/")}).then(function(S){for(var M=localStorage.length-1;M>=0;M--){var G=localStorage.key(M);G.indexOf(S)===0&&localStorage.removeItem(G)}}):I=_.reject("Invalid arguments"),y(I,w),I}var hE={_driver:"localStorageWrapper",_initStorage:iE,_support:rE(),iterate:cE,getItem:aE,setItem:mE,removeItem:pE,clear:sE,length:fE,key:lE,keys:uE,dropInstance:dE},gE=function(w,g){return w===g||typeof w=="number"&&typeof g=="number"&&isNaN(w)&&isNaN(g)},yE=function(w,g){for(var T=w.length,I=0;I<T;){if(gE(w[I],g))return!0;I++}return!1},nm=Array.isArray||function(p){return Object.prototype.toString.call(p)==="[object Array]"},Ii={},om={},bo={INDEXEDDB:$t,WEBSQL:tE,LOCALSTORAGE:hE},vE=[bo.INDEXEDDB._driver,bo.WEBSQL._driver,bo.LOCALSTORAGE._driver],Hs=["dropInstance"],Ll=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Hs),EE={description:"",driver:vE.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function _E(p,w){p[w]=function(){var g=arguments;return p.ready().then(function(){return p[w].apply(p,g)})}}function Ml(){for(var p=1;p<arguments.length;p++){var w=arguments[p];if(w)for(var g in w)w.hasOwnProperty(g)&&(nm(w[g])?arguments[0][g]=w[g].slice():arguments[0][g]=w[g])}return arguments[0]}var bE=(function(){function p(w){a(this,p);for(var g in bo)if(bo.hasOwnProperty(g)){var T=bo[g],I=T._driver;this[g]=I,Ii[I]||this.defineDriver(T)}this._defaultConfig=Ml({},EE),this._config=Ml({},this._defaultConfig,w),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return p.prototype.config=function(g){if((typeof g>"u"?"undefined":s(g))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var T in g){if(T==="storeName"&&(g[T]=g[T].replace(/\W/g,"_")),T==="version"&&typeof g[T]!="number")return new Error("Database version must be a number.");this._config[T]=g[T]}return"driver"in g&&g.driver?this.setDriver(this._config.driver):!0}else return typeof g=="string"?this._config[g]:this._config},p.prototype.defineDriver=function(g,T,I){var S=new _(function(M,G){try{var z=g._driver,Y=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!g._driver){G(Y);return}for(var J=Ll.concat("_initStorage"),te=0,ve=J.length;te<ve;te++){var Oe=J[te],Ne=!yE(Hs,Oe);if((Ne||g[Oe])&&typeof g[Oe]!="function"){G(Y);return}}var rt=function(){for(var xi=function(TE){return function(){var IE=new Error("Method "+TE+" is not implemented by the current driver"),im=_.reject(IE);return y(im,arguments[arguments.length-1]),im}},Bl=0,SE=Hs.length;Bl<SE;Bl++){var Ul=Hs[Bl];g[Ul]||(g[Ul]=xi(Ul))}};rt();var Qe=function(xi){Ii[z]&&console.info("Redefining LocalForage driver: "+z),Ii[z]=g,om[z]=xi,M()};"_support"in g?g._support&&typeof g._support=="function"?g._support().then(Qe,G):Qe(!!g._support):Qe(!0)}catch(Xt){G(Xt)}});return C(S,T,I),S},p.prototype.driver=function(){return this._driver||null},p.prototype.getDriver=function(g,T,I){var S=Ii[g]?_.resolve(Ii[g]):_.reject(new Error("Driver not found."));return C(S,T,I),S},p.prototype.getSerializer=function(g){var T=_.resolve(Pl);return C(T,g),T},p.prototype.ready=function(g){var T=this,I=T._driverSet.then(function(){return T._ready===null&&(T._ready=T._initDriver()),T._ready});return C(I,g,g),I},p.prototype.setDriver=function(g,T,I){var S=this;nm(g)||(g=[g]);var M=this._getSupportedDrivers(g);function G(){S._config.driver=S.driver()}function z(te){return S._extend(te),G(),S._ready=S._initStorage(S._config),S._ready}function Y(te){return function(){var ve=0;function Oe(){for(;ve<te.length;){var Ne=te[ve];return ve++,S._dbInfo=null,S._ready=null,S.getDriver(Ne).then(z).catch(Oe)}G();var rt=new Error("No available storage method found.");return S._driverSet=_.reject(rt),S._driverSet}return Oe()}}var J=this._driverSet!==null?this._driverSet.catch(function(){return _.resolve()}):_.resolve();return this._driverSet=J.then(function(){var te=M[0];return S._dbInfo=null,S._ready=null,S.getDriver(te).then(function(ve){S._driver=ve._driver,G(),S._wrapLibraryMethodsWithReady(),S._initDriver=Y(M)})}).catch(function(){G();var te=new Error("No available storage method found.");return S._driverSet=_.reject(te),S._driverSet}),C(this._driverSet,T,I),this._driverSet},p.prototype.supports=function(g){return!!om[g]},p.prototype._extend=function(g){Ml(this,g)},p.prototype._getSupportedDrivers=function(g){for(var T=[],I=0,S=g.length;I<S;I++){var M=g[I];this.supports(M)&&T.push(M)}return T},p.prototype._wrapLibraryMethodsWithReady=function(){for(var g=0,T=Ll.length;g<T;g++)_E(this,Ll[g])},p.prototype.createInstance=function(g){return new p(g)},p})(),wE=new bE;o.exports=wE},{3:3}]},{},[4])(4)})});var Mf=kl((ec,eg)=>{"use strict";(function(t,e){typeof ec=="object"&&typeof eg<"u"?e(ec):typeof define=="function"&&define.amd?define(["exports"],e):e((t=typeof globalThis<"u"?globalThis:t||self).Sqrl={})})(ec,function(t){"use strict";function e(D){var R,V,k=new Error(D);return R=k,V=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(R,V):R.__proto__=V,k}function r(D,R,V){var k=R.slice(0,V).split(/\n/),H=k.length,ne=k[H-1].length+1;throw e(D+=" at line "+H+" col "+ne+`:
|
|
2
2
|
|
|
3
3
|
`+R.split(/\n/)[H-1]+`
|
|
4
4
|
`+Array(ne).join(" ")+"^")}e.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var n=new Function("return this")().Promise,o=!1;try{o=new Function("return (async function(){}).constructor")()}catch(D){if(!(D instanceof SyntaxError))throw D}function i(D,R){return Object.prototype.hasOwnProperty.call(D,R)}function s(D,R,V){for(var k in R)i(R,k)&&(R[k]==null||typeof R[k]!="object"||k!=="storage"&&k!=="prefixes"||V?D[k]=R[k]:D[k]=s({},R[k]));return D}var a=/^async +/,l=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,f=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,m=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,d=/[.*+\-?^${}()|[\]\\]/g;function _(D){return d.test(D)?D.replace(d,"\\$&"):D}function y(D,R){R.rmWhitespace&&(D=D.replace(/[\r\n]+/g,`
|
|
5
|
-
`).replace(/^\s+|\s+$/gm,"")),l.lastIndex=0,f.lastIndex=0,m.lastIndex=0;var V=R.prefixes,k=[V.h,V.b,V.i,V.r,V.c,V.e].reduce(function(it,
|
|
6
|
-
`)}}return H}var Q=(function(){function D(R){this.cache=R}return D.prototype.define=function(R,V){this.cache[R]=V},D.prototype.get=function(R){return this.cache[R]},D.prototype.remove=function(R){delete this.cache[R]},D.prototype.reset=function(){this.cache={}},D.prototype.load=function(R){s(this.cache,R,!0)},D})();function Ee(D,R,V,k){if(R&&R.length>0)throw e((k?"Native":"")+"Helper '"+D+"' doesn't accept blocks");if(V&&V.length>0)throw e((k?"Native":"")+"Helper '"+D+"' doesn't accept filters")}var X={"&":"&","<":"<",">":">",'"':""","'":"'"};function ce(D){return X[D]}var se=new Q({}),de=new Q({each:function(D,R){var V="",k=D.params[0];if(Ee("each",R,!1),D.async)return new Promise(function(ne){(function he(qe,Ze,et,vt,Et){et(qe[Ze],Ze).then(function(it){vt+=it,Ze===qe.length-1?Et(vt):he(qe,Ze+1,et,vt,Et)})})(k,0,D.exec,V,ne)});for(var H=0;H<k.length;H++)V+=D.exec(k[H],H);return V},foreach:function(D,R){var V=D.params[0];if(Ee("foreach",R,!1),D.async)return new Promise(function(ne){(function he(qe,Ze,et,vt,Et,it){vt(Ze[et],qe[Ze[et]]).then(function(
|
|
5
|
+
`).replace(/^\s+|\s+$/gm,"")),l.lastIndex=0,f.lastIndex=0,m.lastIndex=0;var V=R.prefixes,k=[V.h,V.b,V.i,V.r,V.c,V.e].reduce(function(it,we){return it&&we?it+"|"+_(we):we?_(we):it},""),H=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+_(R.tags[1])+")","g"),ne=new RegExp("([^]*?)"+_(R.tags[0])+"(-|_)?\\s*("+k+")?\\s*","g"),he=0,qe=!1;function Ze(it,we){var He,Ae={f:[]},$e=0,De="c";function $t(ue){var _e=D.slice(he,ue),ge=_e.trim();if(De==="f")ge==="safe"?Ae.raw=!0:R.async&&a.test(ge)?(ge=ge.replace(a,""),Ae.f.push([ge,"",!0])):Ae.f.push([ge,""]);else if(De==="fp")Ae.f[Ae.f.length-1][1]+=ge;else if(De==="err"){if(ge){var Me=_e.search(/\S/);r("invalid syntax",D,he+Me)}}else Ae[De]=ge;he=ue+1}for(we==="h"||we==="b"||we==="c"?De="n":we==="r"&&(Ae.raw=!0,we="i"),H.lastIndex=he;(He=H.exec(D))!==null;){var h=He[1],c=He[2],u=He[3],v=He[4],x=He[5],O=He.index;if(h)h==="("?($e===0&&(De==="n"?($t(O),De="p"):De==="f"&&($t(O),De="fp")),$e++):h===")"?--$e===0&&De!=="c"&&($t(O),De="err"):$e===0&&h==="|"?($t(O),De="f"):h==="=>"&&($t(O),he+=1,De="res");else if(c)if(c==="/*"){var W=D.indexOf("*/",H.lastIndex);W===-1&&r("unclosed comment",D,He.index),H.lastIndex=W+2}else c==="'"?(f.lastIndex=He.index,f.exec(D)?H.lastIndex=f.lastIndex:r("unclosed string",D,He.index)):c==='"'?(m.lastIndex=He.index,m.exec(D)?H.lastIndex=m.lastIndex:r("unclosed string",D,He.index)):c==="`"&&(l.lastIndex=He.index,l.exec(D)?H.lastIndex=l.lastIndex:r("unclosed string",D,He.index));else if(u)return $t(O),he=O+He[0].length,ne.lastIndex=he,qe=x,v&&we==="h"&&(we="s"),Ae.t=we,Ae}return r("unclosed tag",D,it),Ae}var et=(function it(we,He){we.b=[],we.d=[];var Ae,$e=!1,De=[];function $t(Me,ke){Me&&(Me=(function(tt,fr,qr,_o){var pr,mr;return typeof fr.autoTrim=="string"?pr=mr=fr.autoTrim:Array.isArray(fr.autoTrim)&&(pr=fr.autoTrim[1],mr=fr.autoTrim[0]),(qr||qr===!1)&&(pr=qr),(_o||_o===!1)&&(mr=_o),pr==="slurp"&&mr==="slurp"?tt.trim():(pr==="_"||pr==="slurp"?tt=String.prototype.trimLeft?tt.trimLeft():tt.replace(/^[\s\uFEFF\xA0]+/,""):pr!=="-"&&pr!=="nl"||(tt=tt.replace(/^(?:\n|\r|\r\n)/,"")),mr==="_"||mr==="slurp"?tt=String.prototype.trimRight?tt.trimRight():tt.replace(/[\s\uFEFF\xA0]+$/,""):mr!=="-"&&mr!=="nl"||(tt=tt.replace(/(?:\n|\r|\r\n)$/,"")),tt)})(Me,R,qe,ke))&&(Me=Me.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),De.push(Me))}for(;(Ae=ne.exec(D))!==null;){var h,c=Ae[1],u=Ae[2],v=Ae[3]||"";for(var x in V)if(V[x]===v){h=x;break}$t(c,u),he=Ae.index+Ae[0].length,h||r("unrecognized tag type: "+v,D,he);var O=Ze(Ae.index,h),W=O.t;if(W==="h"){var ue=O.n||"";R.async&&a.test(ue)&&(O.a=!0,O.n=ue.replace(a,"")),O=it(O),De.push(O)}else if(W==="c"){if(we.n===O.n)return $e?($e.d=De,we.b.push($e)):we.d=De,we;r("Helper start and end don't match",D,Ae.index+Ae[0].length)}else if(W==="b"){$e?($e.d=De,we.b.push($e)):we.d=De;var _e=O.n||"";R.async&&a.test(_e)&&(O.a=!0,O.n=_e.replace(a,"")),$e=O,De=[]}else if(W==="s"){var ge=O.n||"";R.async&&a.test(ge)&&(O.a=!0,O.n=ge.replace(a,"")),De.push(O)}else De.push(O)}if(!He)throw e('unclosed helper "'+we.n+'"');return $t(D.slice(he,D.length),!1),we.d=De,we})({f:[]},!0);if(R.plugins)for(var vt=0;vt<R.plugins.length;vt++){var Et=R.plugins[vt];Et.processAST&&(et.d=Et.processAST(et.d,R))}return et.d}function C(D,R){var V=y(D,R),k="var tR='';"+(R.useWith?"with("+R.varName+"||{}){":"")+P(V,R)+"if(cb){cb(null,tR)} return tR"+(R.useWith?"}":"");if(R.plugins)for(var H=0;H<R.plugins.length;H++){var ne=R.plugins[H];ne.processFnString&&(k=ne.processFnString(k,R))}return k}function N(D,R){for(var V=0;V<R.length;V++){var k=R[V][0],H=R[V][1];D=(R[V][2]?"await ":"")+"c.l('F','"+k+"')("+D,H&&(D+=","+H),D+=")"}return D}function A(D,R,V,k,H,ne){var he="{exec:"+(H?"async ":"")+q(V,R,D)+",params:["+k+"]";return ne&&(he+=",name:'"+ne+"'"),H&&(he+=",async:true"),he+="}"}function B(D,R){for(var V="[",k=0;k<D.length;k++){var H=D[k];V+=A(R,H.res||"",H.d,H.p||"",H.a,H.n),k<D.length&&(V+=",")}return V+="]"}function q(D,R,V){return"function("+R+"){var tR='';"+P(D,V)+"return tR}"}function P(D,R){for(var V=0,k=D.length,H="";V<k;V++){var ne=D[V];if(typeof ne=="string")H+="tR+='"+ne+"';";else{var he=ne.t,qe=ne.c||"",Ze=ne.f,et=ne.n||"",vt=ne.p||"",Et=ne.res||"",it=ne.b,we=!!ne.a;if(he==="i"){R.defaultFilter&&(qe="c.l('F','"+R.defaultFilter+"')("+qe+")");var He=N(qe,Ze);!ne.raw&&R.autoEscape&&(He="c.l('F','e')("+He+")"),H+="tR+="+He+";"}else if(he==="h")if(R.storage.nativeHelpers.get(et))H+=R.storage.nativeHelpers.get(et)(ne,R);else{var Ae=(we?"await ":"")+"c.l('H','"+et+"')("+A(R,Et,ne.d,vt,we);Ae+=it?","+B(it,R):",[]",H+="tR+="+N(Ae+=",c)",Ze)+";"}else he==="s"?H+="tR+="+N((we?"await ":"")+"c.l('H','"+et+"')({params:["+vt+"]},[],c)",Ze)+";":he==="e"&&(H+=qe+`
|
|
6
|
+
`)}}return H}var Q=(function(){function D(R){this.cache=R}return D.prototype.define=function(R,V){this.cache[R]=V},D.prototype.get=function(R){return this.cache[R]},D.prototype.remove=function(R){delete this.cache[R]},D.prototype.reset=function(){this.cache={}},D.prototype.load=function(R){s(this.cache,R,!0)},D})();function Ee(D,R,V,k){if(R&&R.length>0)throw e((k?"Native":"")+"Helper '"+D+"' doesn't accept blocks");if(V&&V.length>0)throw e((k?"Native":"")+"Helper '"+D+"' doesn't accept filters")}var X={"&":"&","<":"<",">":">",'"':""","'":"'"};function ce(D){return X[D]}var se=new Q({}),de=new Q({each:function(D,R){var V="",k=D.params[0];if(Ee("each",R,!1),D.async)return new Promise(function(ne){(function he(qe,Ze,et,vt,Et){et(qe[Ze],Ze).then(function(it){vt+=it,Ze===qe.length-1?Et(vt):he(qe,Ze+1,et,vt,Et)})})(k,0,D.exec,V,ne)});for(var H=0;H<k.length;H++)V+=D.exec(k[H],H);return V},foreach:function(D,R){var V=D.params[0];if(Ee("foreach",R,!1),D.async)return new Promise(function(ne){(function he(qe,Ze,et,vt,Et,it){vt(Ze[et],qe[Ze[et]]).then(function(we){Et+=we,et===Ze.length-1?it(Et):he(qe,Ze,et+1,vt,Et,it)})})(V,Object.keys(V),0,D.exec,"",ne)});var k="";for(var H in V)i(V,H)&&(k+=D.exec(H,V[H]));return k},include:function(D,R,V){Ee("include",R,!1);var k=V.storage.templates.get(D.params[0]);if(!k)throw e('Could not fetch template "'+D.params[0]+'"');return k(D.params[1],V)},extends:function(D,R,V){var k=D.params[1]||{};k.content=D.exec();for(var H=0;H<R.length;H++){var ne=R[H];k[ne.name]=ne.exec()}var he=V.storage.templates.get(D.params[0]);if(!he)throw e('Could not fetch template "'+D.params[0]+'"');return he(k,V)},useScope:function(D,R){return Ee("useScope",R,!1),D.exec(D.params[0])}}),Le=new Q({if:function(D,R){Ee("if",!1,D.f,!0);var V="if("+D.p+"){"+P(D.d,R)+"}";if(D.b)for(var k=0;k<D.b.length;k++){var H=D.b[k];H.n==="else"?V+="else{"+P(H.d,R)+"}":H.n==="elif"&&(V+="else if("+H.p+"){"+P(H.d,R)+"}")}return V},try:function(D,R){if(Ee("try",!1,D.f,!0),!D.b||D.b.length!==1||D.b[0].n!=="catch")throw e("native helper 'try' only accepts 1 block, 'catch'");var V="try{"+P(D.d,R)+"}",k=D.b[0];return V+="catch"+(k.res?"("+k.res+")":"")+"{"+P(k.d,R)+"}"},block:function(D,R){return Ee("block",D.b,D.f,!0),"if(!"+R.varName+"["+D.p+"]){tR+=("+q(D.d,"",R)+")()}else{tR+="+R.varName+"["+D.p+"]}"}}),Se=new Q({e:function(D){var R=String(D);return/[&<>"']/.test(R)?R.replace(/[&<>"']/g,ce):R}}),Re={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(D,R){if(D==="H"){var V=this.storage.helpers.get(R);if(V)return V;throw e("Can't find helper '"+R+"'")}if(D==="F"){var k=this.storage.filters.get(R);if(k)return k;throw e("Can't find filter '"+R+"'")}},async:!1,storage:{helpers:de,nativeHelpers:Le,filters:Se,templates:se},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function Ge(D,R){var V={};return s(V,Re),R&&s(V,R),D&&s(V,D),V.l.bind(V),V}function Je(D,R){var V,k=Ge(R||{}),H=Function;if(k.async){if(!o)throw e("This environment doesn't support async/await");H=o}if(k.varName&&(V=k.varName,/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(V)===!1))throw e("options.varName must be a valid JS identifier");try{return new H(k.varName,"c","cb",C(D,k))}catch(ne){throw ne instanceof SyntaxError?e(`Bad template syntax
|
|
7
7
|
|
|
8
8
|
`+ne.message+`
|
|
9
9
|
`+Array(ne.message.length+1).join("=")+`
|
|
10
|
-
`+C(D,k)):ne}}function Bt(D,R){var V;return R.cache&&R.name&&R.storage.templates.get(R.name)?R.storage.templates.get(R.name):(V=typeof D=="function"?D:Je(D,R),R.cache&&R.name&&R.storage.templates.define(R.name,V),V)}Re.l.bind(Re),t.compile=Je,t.compileScope=P,t.compileScopeIntoFunction=q,t.compileToString=C,t.defaultConfig=Re,t.filters=Se,t.getConfig=Ge,t.helpers=de,t.nativeHelpers=Le,t.parse=y,t.render=function(D,R,V,k){var H=Ge(V||{});if(!H.async)return Bt(D,H)(R,H);if(!k){if(typeof n=="function")return new n(function(ne,he){try{ne(Bt(D,H)(R,H))}catch(qe){he(qe)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{Bt(D,H)(R,H,k)}catch(ne){return k(ne)}},t.templates=se,Object.defineProperty(t,"__esModule",{value:!0})})});var ze=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(e){return e??={},this.gaEnabled=e.gaEnabled,this.gaMeasurementID=e.gaMeasurementID,this.pixelPush=e.pixelPush,this.website=e.website??{},this.currencyCount=e.currencyCount??0,this.money=e.money,this.currency=e.currency,this.storefrontToken=e.storefrontToken,this.skipItemAttribute=e.skipItemAttribute,this}};var ym=zr(Fl());var CE=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"],gm={utm_source:"tw_source",utm_campaign:"tw_campaign"};var vm=()=>{if(document.referrer)return document.referrer.replace(location.origin,"")},Em=()=>{let t;try{t=new ym.URLBuilder(location.href)}catch{return{}}let e={};CE.forEach(n=>{let o=t.getQueryParam(n);o&&(e[n]=o)});let r={};return Object.keys(gm).forEach(n=>{let o=t.getQueryParam(gm[n]);o&&(r[n]=o)}),E(E({},r),e)};function fe(){return window.CooeeSDK.runtimeData}function So(){return Tr(Date.now()-fe().sdkLoadTime.getTime())}var Hl=class{origin;path;qs;name;referrer;utmSource;utmMedium;utmCampaign;utmId;utmTerm;utmContent;constructor(e){this.name=e.name,this.path=e.path,this.qs=e.qs,this.referrer=e.referrer,this.utmSource=e.utmSource||e.utm_source,this.utmMedium=e.utmMedium||e.utm_medium,this.utmCampaign=e.utmCampaign||e.utm_campaign,this.utmId=e.utmId||e.utm_id,this.utmTerm=e.utmTerm||e.utm_term,this.utmContent=e.utmContent||e.utm_content}};function Gs(){let t=location.pathname==="/"?location.pathname:location.pathname.replace(/\/+$/,"");return new Hl(E({origin:location.origin,path:t,qs:location.search,referrer:vm(),name:fe().pageName},Em()))}function _m(){let t=fe(),e=new URLSearchParams(location.search),r=e.get("cooee-preview");if(r){let o=r.split(",").map(i=>i.trim()).filter(i=>Number.isInteger(+i));o.length&&(t.previewIDs=o)}let n=e.get("cooee-variant")?.trim();n&&(t.previewVariant=n)}var Jt=(function(t){return t[t.NONE=0]="NONE",t[t.STATIC=1]="STATIC",t[t.UNIQUE_FLAT=2]="UNIQUE_FLAT",t[t.UNIQUE_FLAT_ITEMS=3]="UNIQUE_FLAT_ITEMS",t[t.UNIQUE_FIXED_ITEMS=4]="UNIQUE_FIXED_ITEMS",t[t.UNIQUE_CHEAPEST_ITEM_FREE=5]="UNIQUE_CHEAPEST_ITEM_FREE",t[t.BXGY=6]="BXGY",t})(Jt||{});var Ri=(function(t){return t[t.SINGLE=1]="SINGLE",t[t.EXCLUSION=2]="EXCLUSION",t[t.ABTESTING=3]="ABTESTING",t})(Ri||{});var $l=(function(t){return t[t.NONE=0]="NONE",t[t.ITEM=1]="ITEM",t[t.COLLECTION=2]="COLLECTION",t})($l||{});var At=(function(t){return t.BEFORE="before",t.AFTER="after",t.INSIDE_FIRST="insideFirst",t.INSIDE_LAST="insideLast",t.BEFORE1="BEFORE",t.AFTER1="AFTER",t.INSIDE_FIRST1="INSIDE_FIRST",t.INSIDE_LAST1="INSIDE_LAST",t})(At||{}),Qt=(function(t){return t.SHOPIFY_CHECKOUT="shopify_checkout",t.THIRD_PARTY_CHECKOUT="third_party_checkout",t.CART_PAGE="cart_page",t.CART_DRAWER="cart_drawer",t})(Qt||{});var we=(function(t){return t[t.NONE=0]="NONE",t[t.REJECT_POPUP=1]="REJECT_POPUP",t[t.ACCEPT_POPUP=2]="ACCEPT_POPUP",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",t[t.OPEN_CART=105]="OPEN_CART",t[t.SUBMIT_FORM=106]="SUBMIT_FORM",t[t.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",t[t.ADD_BUNDLE=108]="ADD_BUNDLE",t[t.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",t[t.BUY_NOW=110]="BUY_NOW",t[t.QUICK_VIEW=111]="QUICK_VIEW",t})(we||{}),Ai=(function(t){return t.POPUP="POPUP",t.PAGE_EMBED="PAGE_EMBED",t.CART_EMBED="CART_EMBED",t.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",t})(Ai||{}),hr=(function(t){return t.PRODUCT_PROMOTION="PRODUCT_PROMOTION",t.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",t.CART_RECOVERY="CART_RECOVERY",t.ANNOUNCEMENT="ANNOUNCEMENT",t.LEAD_GENERATION="LEAD_GENERATION",t.DATA_COLLECTION="DATA_COLLECTION",t.SALE_PROMOTION="SALE_PROMOTION",t.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",t.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",t.BYOB="BYOB",t.PROGRESS_BAR="PROGRESS_BAR",t.BUY_NOW="BUY_NOW",t.STICKY_ATC="STICKY_ATC",t.EXPERIMENT="EXPERIMENT",t.SAVINGS_BAR="SAVINGS_BAR",t})(hr||{}),Di=(function(t){return t.COOEE="COOEE",t.KLAVIYO="KLAVIYO",t})(Di||{}),Vl=(function(t){return t.ICONS="ICONS",t.TILES="TILES",t})(Vl||{}),Wl=(function(t){return t.FREE_SHIPPING="FREE_SHIPPING",t.DISCOUNT="DISCOUNT",t.FREE_AUTO_GIFT="FREE_AUTO_GIFT",t.FREE_GIFT_SELECT="FREE_GIFT_SELECT",t.UI_ONLY="UI_ONLY",t})(Wl||{});var Yr=class t{static of(e,r){return r!==void 0?new Array(e).fill(r):Array.from({length:e},(n,o)=>o)}static remove(e,r){let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)}static swap(e,r,n){[e[r],e[n]]=[e[n],e[r]]}static sum(e,r){return e.reduce((n,o)=>n+Math.max(r?r(o):+o,0),0)}static unique(e,r){return e.filter((n,o,i)=>i.findIndex(s=>s[r]===n[r])===o)}static shuffle(e){let r=e.length;for(;r!=0;){let n=Math.floor(Math.random()*r);r--,t.swap(e,r,n)}}};var wm=(()=>{class t{static toTitle(r){return r?this.titleCase(r.toLowerCase().split(/[_-]+/).join(" ")):""}static toSlug(r){return r?r.toLowerCase().replace(/[_-]+/," ").replace(/[^\w ]+/g,"").replace(/ +/g,"-"):""}static toCamelCase(r){return r.toLowerCase().split(" ").map((n,o)=>o===0?n:n.charAt(0).toUpperCase()+n.slice(1)).join("")}static format(r,...n){return r?.replace(/{(\d+)}/g,(o,i)=>{let s=n[i];return s!==void 0?s:o})}static chop(r,n){if(!(!r||!n))return r.length<=n?r:r.substring(0,n)}static titleCase=r=>r.replace(/(^|\s)\S/g,n=>n.toUpperCase())}return t})();var qs=class{applyDiscountOnMinimum;constructor(e){this.applyDiscountOnMinimum=e.applyDiscountOnMinimum}};var $n=class{s;g;i;constructor(e){e.s&&(this.s=new Ve(e.s)),e.g&&(this.g=new Oi(e.g)),this.i=e.i}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}};var Ni="a-f\\d",RE=`#?[${Ni}]{3}[${Ni}]?`,AE=`#?[${Ni}]{6}([${Ni}]{2})?`,DE=new RegExp(`[^#${Ni}]`,"gi"),OE=new RegExp(`^${RE}$|^${AE}$`,"i");function jl(t,e={}){if(typeof t!="string"||DE.test(t)||!OE.test(t))throw new TypeError("Expected a valid hex string");t=t.replace(/^#/,"");let r=1;t.length===8&&(r=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),t.length===4&&(r=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);let n=Number.parseInt(t,16),o=n>>16,i=n>>8&255,s=n&255,a=typeof e.alpha=="number"?e.alpha:r;if(e.format==="array")return[o,i,s,a];if(e.format==="css"){let l=a===1?"":` / ${Number((a*100).toFixed(2))}%`;return`rgb(${o} ${i} ${s}${l})`}return{red:o,green:i,blue:s,alpha:a}}var Ve=class{h;a=100;g;constructor(e){e??={},this.h=e.h,this.a=e.a,this.g=e.g}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return"";try{return jl(this.hex,{format:"css",alpha:this.getAlpha()})}catch(e){return console.error("Invalid hex",e),"#000000"}}getAlpha(){return(this.a??100)/100}};var Kr=class{s;r;w;c;constructor(e){this.s=e.s,this.r=e.r,this.w=e.w,e.c&&(this.c=new Ve(e.c))}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return zs[this.s??1]}},zs=(r=>(r[r.SOLID=1]="SOLID",r[r.DASHED=2]="DASHED",r))(zs||{});var Oi=class t{static DEFAULT_FALLBACK=new Ve({h:"#000000",a:50});r;c;fb;constructor(e){this.r=e.r,e.c&&(this.c=new Ve(e.c)),e.fb&&(this.fb=new Ve(e.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??t.DEFAULT_FALLBACK}};var Pi=class{blur;spr;clr;x;y;constructor(e){e=e??{},this.blur=e.blur??0,this.spr=e.spr??0,this.x=e.x??0,this.y=e.y??0,this.clr=new Ve(e.clr)}getStyle(e){return`${this.x*e}px ${this.y*e}px ${this.blur*e}px ${this.spr*e}px ${this.clr.rgba}`}};var Xr=class{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(e){e=e??{},this.pl=e.pl??0,this.pr=e.pr??0,this.pt=e.pt??0,this.pb=e.pb??0,this.ml=e.ml??0,this.mr=e.mr??0,this.mt=e.mt??0,this.mb=e.mb??0,this.cent=e.cent??!1}getHorizontal(){return this.pl+this.pr}getVertical(){return this.pt+this.pb}getPaddingCSS(){return`${this.pt}px ${this.pr}px ${this.pb}px ${this.pl}px`}};var Vn=class{rot;constructor(e){e?.rot&&(this.rot=e.rot)}get rotate(){return this.rot}};var To=(o=>(o[o.START=0]="START",o[o.CENTER=1]="CENTER",o[o.END=2]="END",o[o.JUSTIFY=3]="JUSTIFY",o))(To||{});var Ys=class{name;fonts;constructor(e){e=e??{},e.name&&(e.name=e.name!=="Arial"?e.name:""),this.name=e.name,this.fonts=e.fonts?.map(r=>new Gl(r))}},Gl=class{style;url;constructor(e){e=e??{},this.style=e.style,this.url=e.url}getFontDescriptor(){return{style:this.style===2||this.style===4?"italic":"normal",weight:this.style===4||this.style===3?"700":"400"}}getURL(){return`url('${this.url}') format('truetype')`}};var st=class{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(e){this.update(e)}get alignment(){return To[this.ta]}get letterSpacing(){return this.ls?this.ls+"px":"normal"}update(e){e=e??{},e.lh&&(this.lh=e.lh),e.tdc&&(this.tdc=new Ve(e.tdc)),this.td=e.td,this.fs=e.s??e.fs??60,this.tc=new Ve(e.tc),this.ta=e.ta??1,this.fw=e.fw??400,this.ls=e.ls??0,this.tc.h??="#000000",this.fam=new Ys(e.fam??e.fmly)}resize(e){this.s*=e,this.ls*=e}};var Ks=class{modifications;constructor(e={}){e.modifications?.length?this.modifications=e.modifications.map(r=>new Xs(r)):e.experiments?.length&&(this.modifications=e.experiments.map(r=>new Xs(r)))}};var Xs=class{cssSelector;type;display;bg;typo;br;text;image;moveTo;constructor(e={}){this.cssSelector=e.cssSelector??"",this.type=e.type??"OTHER",this.display=e.display,e.bg&&(this.bg=new Ve(e.bg)),e.typo&&(this.typo=new st(e.typo)),e.br&&(this.br=new Kr(e.br)),this.text=e.text,this.image=e.image,this.moveTo=e.moveTo}get style(){let e={};return this.br?.r&&(e.borderRadius=this.br.r+"px"),this.br?.w&&(e.borderWidth=this.br.w+"px"),this.br?.s&&(e.borderStyle=zs[this.br.s]?.toLowerCase()),this.br?.c?.h&&(e.borderColor=this.br.color?.rgba),this.bg?.h&&(e.backgroundColor=this.bg.rgba),this.type==="TEXT"&&this.typo&&(this.typo.fs&&(e.fontSize=this.typo.fs+"px"),this.typo.lh&&(e.lineHeight=this.typo.lh),this.typo.fw&&(e.fontWeight=this.typo.fw),this.typo.ta&&(e.textAlign=this.typo.alignment),this.typo.tc.h&&(e.color=this.typo.tc.rgba),this.typo.ls&&(e.letterSpacing=this.typo.letterSpacing),this.typo.td&&(e.textDecoration=this.typo.td??"none")),e}toString(){return`Experiment(cssSelector=${this.cssSelector})`}};var Dt=class{id;mID;vID;vName;imageURL;name;link;quantity;price;finalPrice;constructor(e){this.id=e.id,this.mID=e.mID,this.vID=e.vID,this.vName=e.vName,this.imageURL=e.imageURL,this.name=e.name,this.link=e.link,this.quantity=e.quantity,this.price=e.price,this.finalPrice=e.finalPrice??e.price}};var ql=class{minValue;rewardType;label;reachingText;reachedText;discount;items;isUIOnly;allowATC;reached;calculatedAlignment;constructor(e){this.reached=e.reached??!1,this.calculatedAlignment=e.calculatedAlignment,this.minValue=e.minValue,this.rewardType=e.rewardType,this.label=e.label,this.reachingText=e.reachingText,this.reachedText=e.reachedText,this.discount=e.discount,this.items=e.items?.map(r=>new Dt(r)),this.isUIOnly=e.isUIOnly,this.allowATC=e.allowATC}};var Js=class{layout;milestones;totalProgress;coupons;reachedAmountOrCount;onlyLatestGift;noConfetti;removeIneligibleItem;restrictToLatestFreebie;rewardBasis;constructor(e){this.layout=e.layout??Vl.ICONS,this.onlyLatestGift=e.onlyLatestGift,this.noConfetti=e.noConfetti,this.removeIneligibleItem=e.removeIneligibleItem??!0,this.restrictToLatestFreebie=e.restrictToLatestFreebie,this.rewardBasis=e.rewardBasis??"CART_AMOUNT",this.update(e)}update(e){e=e??{},this.milestones=e.milestones?.map(r=>new ql(r))??[],this.totalProgress=e.totalProgress??0,this.coupons=e.coupons,this.reachedAmountOrCount=e.reachedAmountOrCount}};var Qs=class{animateNumber;animationDuration;text;iconURL;animation;totalSavings;constructor(e={}){this.animateNumber=e.animateNumber??!0,this.animation=e.animation??"SLOT_MACHINE",this.animationDuration=e.animationDuration??1e3,this.text=e.text??"You are saving {{ cart.total_savings }} on this order",this.iconURL=e.iconURL,this.totalSavings=e.totalSavings??0}};var Ir=class{constructor(e,r){this._startTime=e;this._triggerData=r}intervals=[];selectedEmbeddedItems;renderer;closeCallback;inputFields=[];get startTime(){return this._startTime}get triggerData(){return this._triggerData}get inputs(){return this.inputFields}get rootClassName(){let e=this.triggerData.shortID??this.triggerData.id.slice(-6);return e==="test"&&(e="test-"+this.startTime.getTime().toString()),"cooee-wrapper-"+e}get selectedItems(){return this.triggerData.items.filter(e=>e.selected.value)}get shouldGiveFBTDiscount(){let e=this.selectedItems.length;return this.triggerData.bundleConfig?.applyDiscountOnMinimum?this.triggerData.bundleConfig.applyDiscountOnMinimum<=e:e===this.triggerData.items.length}onClose(e){this.closeCallback=e}closeInApp(e,r){r??={};let n=(new Date().getTime()-this.startTime.getTime())/1e3,o=E({eventName:e,duration:n},r);this.stopIntervals(),this.closeCallback&&this.closeCallback(o)}addInputField(e,r){this.inputFields.push({id:e,type:r,isValid:!1})}updateValidation(e,r){this.inputFields.forEach(n=>{if(n.id===e){n.isValid=r;return}})}hasManipulatedProductQuantity(){let e=this.triggerData.manipulation.productQuantity;return e?.enabled&&e.min!=null&&e.max!=null}getManipulatedQuantity(e){let{min:r=1,max:n=100}=this.triggerData.manipulation.productQuantity;if(r>n)return w.error("Invalid range: min should be less than or equal to max."),e;if(e>=r&&e<=n)return e;let o=e%100;return o<r?r:o>n?n:o}stopIntervals(){this.intervals.forEach(e=>clearInterval(e))}};var _t=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}static parseToAny(e){try{return JSON.parse(e.toString())}catch{}return e.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(e.toString()):e}static async sleep(e){return new Promise(r=>setTimeout(r,e))}static hasKeys(e){return e?Object.keys(e).length>=1:!1}static convertObjectToArray(e,r){return r.reduce((n,o)=>(e.hasOwnProperty(o)&&e[o]!=null&&n.push({[o]:e[o]}),n),[])}static removeNullUndefinedKeys(e){return Object.keys(e).reduce((r,n)=>(e[n]!==null&&e[n]!==void 0&&(r[n]=e[n]),r),{})}static stringify(e){return JSON.stringify(e,function(r,n){return n===void 0?null:n})}};var Yl=zr(Sm());function Io(t){return Yl.default.createInstance({name:"lc",storeName:t,driver:Yl.default.LOCALSTORAGE})}var hn=class{static storage;static async get(e,r){return await this.storage?.getItem(e)??r}static set(e,r){return this.storage?.setItem(e,r)}static remove(e){return this.storage?.removeItem(e)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var Li=class Li extends hn{};bo(Li,"storeName","ses"),Li.storage=Io(Li.storeName);var It=Li;var Mi=class Mi extends hn{};bo(Mi,"storeName","usr"),Mi.storage=Io(Mi.storeName);var Ye=Mi;var Zt=class extends Error{request;response;status;requestBody;responseText;constructor(e){super(e),this.name="FetchError",Object.setPrototypeOf(this,new.target.prototype)}is40x(){return!!this.response&&this.response.status>=400&&this.response.status<500}};async function Jr(t,e){let r=Date.now(),n;try{n=await NE(t,e)}catch{}let o=n?new Request(n.url,{method:e?.method||"GET"}):new Request(t,e);if(!n||!n.ok){let f="Failed to fetch";n?.statusText&&(f+=`: ${n.statusText}`);let m=new Zt(f);throw m.request=o,m.response=n?.clone(),m.status=n?.status,m.requestBody=e?.body,m.responseText=await Tm(n),m}let i,s=(n.headers.get("content-type")||"").toLowerCase(),a=n.headers.get("content-length"),l=e?.method?.toUpperCase()||"GET";if(n.status===204||n.status===205||l==="HEAD"||a==="0")i=void 0;else if(s.includes("application/json")||s.includes("application/problem+json")||s.includes("text/javascript"))try{i=await n.clone().json()}catch(f){let m=new Zt(`Failed to parse JSON response: ${f?.message}`);throw m.request=o,m.response=n.clone(),m.status=n.status,m.requestBody=e?.body,m.responseText=await Tm(n),m}else s.includes("text/")||s.includes("image/svg+xml")?i=await n.text():i=await n.arrayBuffer();return{data:i,status:n.status,statusText:n.statusText,headers:n.headers,timeTakenMs:Date.now()-r,options:e,request:o}}async function NE(t,e){let r=null,n;for(let o=0;o<=5;o++){try{let i=new Headers(e?.headers);(t.includes("letscooee.com")||t.includes("localhost"))&&i.set("Cooee-Retry-Attempt",o.toString());let s=Z(E({},e),{headers:i});if(n=await fetch(t,s),n.ok||n.status>=400&&n.status<500)return n;r=new Error(`Server error: ${n.status} ${n.statusText}`)}catch(i){r=i instanceof Error?i:new Error(String(i))}if(o<5){let i=Math.pow(2,o)*500;await new Promise(s=>setTimeout(s,i))}}if(n&&!n.ok)return n;throw r||new Error("Request failed after retries")}async function Tm(t){if(t){try{return t=t.clone(),await t.json()}catch{}try{return await t.text()}catch{}}}var ie=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var pe=globalThis;var xr="9.42.0";function Wn(){return jn(pe),pe}function jn(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||xr,e[xr]=e[xr]||{}}function Qr(t,e,r=pe){let n=r.__SENTRY__=r.__SENTRY__||{},o=n[xr]=n[xr]||{};return o[t]||(o[t]=e())}var Kl=["debug","info","warn","error","log","assert","trace"],PE="Sentry Logger ",xo={};function gn(t){if(!("console"in pe))return t();let e=pe.console,r={},n=Object.keys(xo);n.forEach(o=>{let i=xo[o];r[o]=e[o],e[o]=i});try{return t()}finally{n.forEach(o=>{e[o]=r[o]})}}function LE(){Jl().enabled=!0}function ME(){Jl().enabled=!1}function Im(){return Jl().enabled}function BE(...t){Xl("log",...t)}function UE(...t){Xl("warn",...t)}function kE(...t){Xl("error",...t)}function Xl(t,...e){ie&&Im()&&gn(()=>{pe.console[t](`${PE}[${t}]:`,...e)})}function Jl(){return ie?Qr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var ee={enable:LE,disable:ME,isEnabled:Im,log:BE,warn:UE,error:kE};var xm=/\(error: (.*)\)/,Cm=/captureMessage|captureException/;function Zl(...t){let e=t.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,o=0)=>{let i=[],s=r.split(`
|
|
10
|
+
`+C(D,k)):ne}}function Bt(D,R){var V;return R.cache&&R.name&&R.storage.templates.get(R.name)?R.storage.templates.get(R.name):(V=typeof D=="function"?D:Je(D,R),R.cache&&R.name&&R.storage.templates.define(R.name,V),V)}Re.l.bind(Re),t.compile=Je,t.compileScope=P,t.compileScopeIntoFunction=q,t.compileToString=C,t.defaultConfig=Re,t.filters=Se,t.getConfig=Ge,t.helpers=de,t.nativeHelpers=Le,t.parse=y,t.render=function(D,R,V,k){var H=Ge(V||{});if(!H.async)return Bt(D,H)(R,H);if(!k){if(typeof n=="function")return new n(function(ne,he){try{ne(Bt(D,H)(R,H))}catch(qe){he(qe)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{Bt(D,H)(R,H,k)}catch(ne){return k(ne)}},t.templates=se,Object.defineProperty(t,"__esModule",{value:!0})})});var ze=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(e){return e??={},this.gaEnabled=e.gaEnabled,this.gaMeasurementID=e.gaMeasurementID,this.pixelPush=e.pixelPush,this.website=e.website??{},this.currencyCount=e.currencyCount??0,this.money=e.money,this.currency=e.currency,this.storefrontToken=e.storefrontToken,this.skipItemAttribute=e.skipItemAttribute,this}};var ym=zr(Fl());var CE=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"],gm={utm_source:"tw_source",utm_campaign:"tw_campaign"};var vm=()=>{if(document.referrer)return document.referrer.replace(location.origin,"")},Em=()=>{let t;try{t=new ym.URLBuilder(location.href)}catch{return{}}let e={};CE.forEach(n=>{let o=t.getQueryParam(n);o&&(e[n]=o)});let r={};return Object.keys(gm).forEach(n=>{let o=t.getQueryParam(gm[n]);o&&(r[n]=o)}),E(E({},r),e)};function fe(){return window.CooeeSDK.runtimeData}function So(){return Tr(Date.now()-fe().sdkLoadTime.getTime())}var Hl=class{origin;path;qs;name;referrer;utmSource;utmMedium;utmCampaign;utmId;utmTerm;utmContent;constructor(e){this.name=e.name,this.path=e.path,this.qs=e.qs,this.referrer=e.referrer,this.utmSource=e.utmSource||e.utm_source,this.utmMedium=e.utmMedium||e.utm_medium,this.utmCampaign=e.utmCampaign||e.utm_campaign,this.utmId=e.utmId||e.utm_id,this.utmTerm=e.utmTerm||e.utm_term,this.utmContent=e.utmContent||e.utm_content}};function Gs(){let t=location.pathname==="/"?location.pathname:location.pathname.replace(/\/+$/,"");return new Hl(E({origin:location.origin,path:t,qs:location.search,referrer:vm(),name:fe().pageName},Em()))}function _m(){let t=fe(),e=new URLSearchParams(location.search),r=e.get("cooee-preview");if(r){let o=r.split(",").map(i=>i.trim()).filter(i=>Number.isInteger(+i));o.length&&(t.previewIDs=o)}let n=e.get("cooee-variant")?.trim();n&&(t.previewVariant=n)}var Jt=(function(t){return t[t.NONE=0]="NONE",t[t.STATIC=1]="STATIC",t[t.UNIQUE_FLAT=2]="UNIQUE_FLAT",t[t.UNIQUE_FLAT_ITEMS=3]="UNIQUE_FLAT_ITEMS",t[t.UNIQUE_FIXED_ITEMS=4]="UNIQUE_FIXED_ITEMS",t[t.UNIQUE_CHEAPEST_ITEM_FREE=5]="UNIQUE_CHEAPEST_ITEM_FREE",t[t.BXGY=6]="BXGY",t})(Jt||{});var Ri=(function(t){return t[t.SINGLE=1]="SINGLE",t[t.EXCLUSION=2]="EXCLUSION",t[t.ABTESTING=3]="ABTESTING",t})(Ri||{});var $l=(function(t){return t[t.NONE=0]="NONE",t[t.ITEM=1]="ITEM",t[t.COLLECTION=2]="COLLECTION",t})($l||{});var At=(function(t){return t.BEFORE="before",t.AFTER="after",t.INSIDE_FIRST="insideFirst",t.INSIDE_LAST="insideLast",t.BEFORE1="BEFORE",t.AFTER1="AFTER",t.INSIDE_FIRST1="INSIDE_FIRST",t.INSIDE_LAST1="INSIDE_LAST",t})(At||{}),Qt=(function(t){return t.SHOPIFY_CHECKOUT="shopify_checkout",t.THIRD_PARTY_CHECKOUT="third_party_checkout",t.CART_PAGE="cart_page",t.CART_DRAWER="cart_drawer",t})(Qt||{});var be=(function(t){return t[t.NONE=0]="NONE",t[t.REJECT_POPUP=1]="REJECT_POPUP",t[t.ACCEPT_POPUP=2]="ACCEPT_POPUP",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",t[t.OPEN_CART=105]="OPEN_CART",t[t.SUBMIT_FORM=106]="SUBMIT_FORM",t[t.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",t[t.ADD_BUNDLE=108]="ADD_BUNDLE",t[t.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",t[t.BUY_NOW=110]="BUY_NOW",t[t.QUICK_VIEW=111]="QUICK_VIEW",t})(be||{}),Ai=(function(t){return t.POPUP="POPUP",t.PAGE_EMBED="PAGE_EMBED",t.CART_EMBED="CART_EMBED",t.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",t})(Ai||{}),hr=(function(t){return t.PRODUCT_PROMOTION="PRODUCT_PROMOTION",t.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",t.CART_RECOVERY="CART_RECOVERY",t.ANNOUNCEMENT="ANNOUNCEMENT",t.LEAD_GENERATION="LEAD_GENERATION",t.DATA_COLLECTION="DATA_COLLECTION",t.SALE_PROMOTION="SALE_PROMOTION",t.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",t.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",t.BYOB="BYOB",t.PROGRESS_BAR="PROGRESS_BAR",t.BUY_NOW="BUY_NOW",t.STICKY_ATC="STICKY_ATC",t.EXPERIMENT="EXPERIMENT",t.SAVINGS_BAR="SAVINGS_BAR",t})(hr||{}),Di=(function(t){return t.COOEE="COOEE",t.KLAVIYO="KLAVIYO",t})(Di||{}),Vl=(function(t){return t.ICONS="ICONS",t.TILES="TILES",t})(Vl||{}),Wl=(function(t){return t.FREE_SHIPPING="FREE_SHIPPING",t.DISCOUNT="DISCOUNT",t.FREE_AUTO_GIFT="FREE_AUTO_GIFT",t.FREE_GIFT_SELECT="FREE_GIFT_SELECT",t.UI_ONLY="UI_ONLY",t})(Wl||{});var Yr=class t{static of(e,r){return r!==void 0?new Array(e).fill(r):Array.from({length:e},(n,o)=>o)}static remove(e,r){let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)}static swap(e,r,n){[e[r],e[n]]=[e[n],e[r]]}static sum(e,r){return e.reduce((n,o)=>n+Math.max(r?r(o):+o,0),0)}static unique(e,r){return e.filter((n,o,i)=>i.findIndex(s=>s[r]===n[r])===o)}static shuffle(e){let r=e.length;for(;r!=0;){let n=Math.floor(Math.random()*r);r--,t.swap(e,r,n)}}};var bm=(()=>{class t{static toTitle(r){return r?this.titleCase(r.toLowerCase().split(/[_-]+/).join(" ")):""}static toSlug(r){return r?r.toLowerCase().replace(/[_-]+/," ").replace(/[^\w ]+/g,"").replace(/ +/g,"-"):""}static toCamelCase(r){return r.toLowerCase().split(" ").map((n,o)=>o===0?n:n.charAt(0).toUpperCase()+n.slice(1)).join("")}static format(r,...n){return r?.replace(/{(\d+)}/g,(o,i)=>{let s=n[i];return s!==void 0?s:o})}static chop(r,n){if(!(!r||!n))return r.length<=n?r:r.substring(0,n)}static titleCase=r=>r.replace(/(^|\s)\S/g,n=>n.toUpperCase())}return t})();var qs=class{applyDiscountOnMinimum;constructor(e){this.applyDiscountOnMinimum=e.applyDiscountOnMinimum}};var $n=class{s;g;i;constructor(e){e.s&&(this.s=new Ve(e.s)),e.g&&(this.g=new Oi(e.g)),this.i=e.i}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}};var Ni="a-f\\d",RE=`#?[${Ni}]{3}[${Ni}]?`,AE=`#?[${Ni}]{6}([${Ni}]{2})?`,DE=new RegExp(`[^#${Ni}]`,"gi"),OE=new RegExp(`^${RE}$|^${AE}$`,"i");function jl(t,e={}){if(typeof t!="string"||DE.test(t)||!OE.test(t))throw new TypeError("Expected a valid hex string");t=t.replace(/^#/,"");let r=1;t.length===8&&(r=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),t.length===4&&(r=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);let n=Number.parseInt(t,16),o=n>>16,i=n>>8&255,s=n&255,a=typeof e.alpha=="number"?e.alpha:r;if(e.format==="array")return[o,i,s,a];if(e.format==="css"){let l=a===1?"":` / ${Number((a*100).toFixed(2))}%`;return`rgb(${o} ${i} ${s}${l})`}return{red:o,green:i,blue:s,alpha:a}}var Ve=class{h;a=100;g;constructor(e){e??={},this.h=e.h,this.a=e.a,this.g=e.g}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return"";try{return jl(this.hex,{format:"css",alpha:this.getAlpha()})}catch(e){return console.error("Invalid hex",e),"#000000"}}getAlpha(){return(this.a??100)/100}};var Kr=class{s;r;w;c;constructor(e){this.s=e.s,this.r=e.r,this.w=e.w,e.c&&(this.c=new Ve(e.c))}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return zs[this.s??1]}},zs=(r=>(r[r.SOLID=1]="SOLID",r[r.DASHED=2]="DASHED",r))(zs||{});var Oi=class t{static DEFAULT_FALLBACK=new Ve({h:"#000000",a:50});r;c;fb;constructor(e){this.r=e.r,e.c&&(this.c=new Ve(e.c)),e.fb&&(this.fb=new Ve(e.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??t.DEFAULT_FALLBACK}};var Pi=class{blur;spr;clr;x;y;constructor(e){e=e??{},this.blur=e.blur??0,this.spr=e.spr??0,this.x=e.x??0,this.y=e.y??0,this.clr=new Ve(e.clr)}getStyle(e){return`${this.x*e}px ${this.y*e}px ${this.blur*e}px ${this.spr*e}px ${this.clr.rgba}`}};var Xr=class{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(e){e=e??{},this.pl=e.pl??0,this.pr=e.pr??0,this.pt=e.pt??0,this.pb=e.pb??0,this.ml=e.ml??0,this.mr=e.mr??0,this.mt=e.mt??0,this.mb=e.mb??0,this.cent=e.cent??!1}getHorizontal(){return this.pl+this.pr}getVertical(){return this.pt+this.pb}getPaddingCSS(){return`${this.pt}px ${this.pr}px ${this.pb}px ${this.pl}px`}};var Vn=class{rot;constructor(e){e?.rot&&(this.rot=e.rot)}get rotate(){return this.rot}};var To=(o=>(o[o.START=0]="START",o[o.CENTER=1]="CENTER",o[o.END=2]="END",o[o.JUSTIFY=3]="JUSTIFY",o))(To||{});var Ys=class{name;fonts;constructor(e){e=e??{},e.name&&(e.name=e.name!=="Arial"?e.name:""),this.name=e.name,this.fonts=e.fonts?.map(r=>new Gl(r))}},Gl=class{style;url;constructor(e){e=e??{},this.style=e.style,this.url=e.url}getFontDescriptor(){return{style:this.style===2||this.style===4?"italic":"normal",weight:this.style===4||this.style===3?"700":"400"}}getURL(){return`url('${this.url}') format('truetype')`}};var st=class{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(e){this.update(e)}get alignment(){return To[this.ta]}get letterSpacing(){return this.ls?this.ls+"px":"normal"}update(e){e=e??{},e.lh&&(this.lh=e.lh),e.tdc&&(this.tdc=new Ve(e.tdc)),this.td=e.td,this.fs=e.s??e.fs??60,this.tc=new Ve(e.tc),this.ta=e.ta??1,this.fw=e.fw??400,this.ls=e.ls??0,this.tc.h??="#000000",this.fam=new Ys(e.fam??e.fmly)}resize(e){this.s*=e,this.ls*=e}};var Ks=class{modifications;constructor(e={}){e.modifications?.length?this.modifications=e.modifications.map(r=>new Xs(r)):e.experiments?.length&&(this.modifications=e.experiments.map(r=>new Xs(r)))}};var Xs=class{cssSelector;type;display;bg;typo;br;text;image;moveTo;constructor(e={}){this.cssSelector=e.cssSelector??"",this.type=e.type??"OTHER",this.display=e.display,e.bg&&(this.bg=new Ve(e.bg)),e.typo&&(this.typo=new st(e.typo)),e.br&&(this.br=new Kr(e.br)),this.text=e.text,this.image=e.image,this.moveTo=e.moveTo}get style(){let e={};return this.br?.r&&(e.borderRadius=this.br.r+"px"),this.br?.w&&(e.borderWidth=this.br.w+"px"),this.br?.s&&(e.borderStyle=zs[this.br.s]?.toLowerCase()),this.br?.c?.h&&(e.borderColor=this.br.color?.rgba),this.bg?.h&&(e.backgroundColor=this.bg.rgba),this.type==="TEXT"&&this.typo&&(this.typo.fs&&(e.fontSize=this.typo.fs+"px"),this.typo.lh&&(e.lineHeight=this.typo.lh),this.typo.fw&&(e.fontWeight=this.typo.fw),this.typo.ta&&(e.textAlign=this.typo.alignment),this.typo.tc.h&&(e.color=this.typo.tc.rgba),this.typo.ls&&(e.letterSpacing=this.typo.letterSpacing),this.typo.td&&(e.textDecoration=this.typo.td??"none")),e}toString(){return`Experiment(cssSelector=${this.cssSelector})`}};var Dt=class{id;mID;vID;vName;imageURL;name;link;quantity;price;finalPrice;constructor(e){this.id=e.id,this.mID=e.mID,this.vID=e.vID,this.vName=e.vName,this.imageURL=e.imageURL,this.name=e.name,this.link=e.link,this.quantity=e.quantity,this.price=e.price,this.finalPrice=e.finalPrice??e.price}};var ql=class{minValue;rewardType;label;reachingText;reachedText;discount;items;isUIOnly;allowATC;reached;calculatedAlignment;constructor(e){this.reached=e.reached??!1,this.calculatedAlignment=e.calculatedAlignment,this.minValue=e.minValue,this.rewardType=e.rewardType,this.label=e.label,this.reachingText=e.reachingText,this.reachedText=e.reachedText,this.discount=e.discount,this.items=e.items?.map(r=>new Dt(r)),this.isUIOnly=e.isUIOnly,this.allowATC=e.allowATC}};var Js=class{layout;milestones;totalProgress;coupons;reachedAmountOrCount;onlyLatestGift;noConfetti;removeIneligibleItem;restrictToLatestFreebie;rewardBasis;constructor(e){this.layout=e.layout??Vl.ICONS,this.onlyLatestGift=e.onlyLatestGift,this.noConfetti=e.noConfetti,this.removeIneligibleItem=e.removeIneligibleItem??!0,this.restrictToLatestFreebie=e.restrictToLatestFreebie,this.rewardBasis=e.rewardBasis??"CART_AMOUNT",this.update(e)}update(e){e=e??{},this.milestones=e.milestones?.map(r=>new ql(r))??[],this.totalProgress=e.totalProgress??0,this.coupons=e.coupons,this.reachedAmountOrCount=e.reachedAmountOrCount}};var Qs=class{animateNumber;animationDuration;text;iconURL;animation;totalSavings;constructor(e={}){this.animateNumber=e.animateNumber??!0,this.animation=e.animation??"SLOT_MACHINE",this.animationDuration=e.animationDuration??1e3,this.text=e.text??"You are saving {{ cart.total_savings }} on this order",this.iconURL=e.iconURL,this.totalSavings=e.totalSavings??0}};var Ir=class{constructor(e,r){this._startTime=e;this._triggerData=r}intervals=[];selectedEmbeddedItems;renderer;closeCallback;inputFields=[];get startTime(){return this._startTime}get triggerData(){return this._triggerData}get inputs(){return this.inputFields}get rootClassName(){let e=this.triggerData.shortID??this.triggerData.id.slice(-6);return e==="test"&&(e="test-"+this.startTime.getTime().toString()),"cooee-wrapper-"+e}get selectedItems(){return this.triggerData.items.filter(e=>e.selected.value)}get shouldGiveFBTDiscount(){let e=this.selectedItems.length;return this.triggerData.bundleConfig?.applyDiscountOnMinimum?this.triggerData.bundleConfig.applyDiscountOnMinimum<=e:e===this.triggerData.items.length}onClose(e){this.closeCallback=e}closeInApp(e,r){r??={};let n=(new Date().getTime()-this.startTime.getTime())/1e3,o=E({eventName:e,duration:n},r);this.stopIntervals(),this.closeCallback&&this.closeCallback(o)}addInputField(e,r){this.inputFields.push({id:e,type:r,isValid:!1})}updateValidation(e,r){this.inputFields.forEach(n=>{if(n.id===e){n.isValid=r;return}})}hasManipulatedProductQuantity(){let e=this.triggerData.manipulation.productQuantity;return e?.enabled&&e.min!=null&&e.max!=null}getManipulatedQuantity(e){let{min:r=1,max:n=100}=this.triggerData.manipulation.productQuantity;if(r>n)return b.error("Invalid range: min should be less than or equal to max."),e;if(e>=r&&e<=n)return e;let o=e%100;return o<r?r:o>n?n:o}stopIntervals(){this.intervals.forEach(e=>clearInterval(e))}};var _t=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}static parseToAny(e){try{return JSON.parse(e.toString())}catch{}return e.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(e.toString()):e}static async sleep(e){return new Promise(r=>setTimeout(r,e))}static hasKeys(e){return e?Object.keys(e).length>=1:!1}static convertObjectToArray(e,r){return r.reduce((n,o)=>(e.hasOwnProperty(o)&&e[o]!=null&&n.push({[o]:e[o]}),n),[])}static removeNullUndefinedKeys(e){return Object.keys(e).reduce((r,n)=>(e[n]!==null&&e[n]!==void 0&&(r[n]=e[n]),r),{})}static stringify(e){return JSON.stringify(e,function(r,n){return n===void 0?null:n})}};var Yl=zr(Sm());function Io(t){return Yl.default.createInstance({name:"lc",storeName:t,driver:Yl.default.LOCALSTORAGE})}var hn=class{static storage;static async get(e,r){return await this.storage?.getItem(e)??r}static set(e,r){return this.storage?.setItem(e,r)}static remove(e){return this.storage?.removeItem(e)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var Li=class Li extends hn{};wo(Li,"storeName","ses"),Li.storage=Io(Li.storeName);var It=Li;var Mi=class Mi extends hn{};wo(Mi,"storeName","usr"),Mi.storage=Io(Mi.storeName);var Ye=Mi;var Zt=class extends Error{request;response;status;requestBody;responseText;constructor(e){super(e),this.name="FetchError",Object.setPrototypeOf(this,new.target.prototype)}is40x(){return!!this.response&&this.response.status>=400&&this.response.status<500}};async function Jr(t,e){let r=Date.now(),n;try{n=await NE(t,e)}catch{}let o=n?new Request(n.url,{method:e?.method||"GET"}):new Request(t,e);if(!n||!n.ok){let f="Failed to fetch";n?.statusText&&(f+=`: ${n.statusText}`);let m=new Zt(f);throw m.request=o,m.response=n?.clone(),m.status=n?.status,m.requestBody=e?.body,m.responseText=await Tm(n),m}let i,s=(n.headers.get("content-type")||"").toLowerCase(),a=n.headers.get("content-length"),l=e?.method?.toUpperCase()||"GET";if(n.status===204||n.status===205||l==="HEAD"||a==="0")i=void 0;else if(s.includes("application/json")||s.includes("application/problem+json")||s.includes("text/javascript"))try{i=await n.clone().json()}catch(f){let m=new Zt(`Failed to parse JSON response: ${f?.message}`);throw m.request=o,m.response=n.clone(),m.status=n.status,m.requestBody=e?.body,m.responseText=await Tm(n),m}else s.includes("text/")||s.includes("image/svg+xml")?i=await n.text():i=await n.arrayBuffer();return{data:i,status:n.status,statusText:n.statusText,headers:n.headers,timeTakenMs:Date.now()-r,options:e,request:o}}async function NE(t,e){let r=null,n;for(let o=0;o<=5;o++){try{let i=new Headers(e?.headers);(t.includes("letscooee.com")||t.includes("localhost"))&&i.set("Cooee-Retry-Attempt",o.toString());let s=Z(E({},e),{headers:i});if(n=await fetch(t,s),n.ok||n.status>=400&&n.status<500)return n;r=new Error(`Server error: ${n.status} ${n.statusText}`)}catch(i){r=i instanceof Error?i:new Error(String(i))}if(o<5){let i=Math.pow(2,o)*500;await new Promise(s=>setTimeout(s,i))}}if(n&&!n.ok)return n;throw r||new Error("Request failed after retries")}async function Tm(t){if(t){try{return t=t.clone(),await t.json()}catch{}try{return await t.text()}catch{}}}var ie=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var pe=globalThis;var xr="9.42.0";function Wn(){return jn(pe),pe}function jn(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||xr,e[xr]=e[xr]||{}}function Qr(t,e,r=pe){let n=r.__SENTRY__=r.__SENTRY__||{},o=n[xr]=n[xr]||{};return o[t]||(o[t]=e())}var Kl=["debug","info","warn","error","log","assert","trace"],PE="Sentry Logger ",xo={};function gn(t){if(!("console"in pe))return t();let e=pe.console,r={},n=Object.keys(xo);n.forEach(o=>{let i=xo[o];r[o]=e[o],e[o]=i});try{return t()}finally{n.forEach(o=>{e[o]=r[o]})}}function LE(){Jl().enabled=!0}function ME(){Jl().enabled=!1}function Im(){return Jl().enabled}function BE(...t){Xl("log",...t)}function UE(...t){Xl("warn",...t)}function kE(...t){Xl("error",...t)}function Xl(t,...e){ie&&Im()&&gn(()=>{pe.console[t](`${PE}[${t}]:`,...e)})}function Jl(){return ie?Qr("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var ee={enable:LE,disable:ME,isEnabled:Im,log:BE,warn:UE,error:kE};var xm=/\(error: (.*)\)/,Cm=/captureMessage|captureException/;function Zl(...t){let e=t.sort((r,n)=>r[0]-n[0]).map(r=>r[1]);return(r,n=0,o=0)=>{let i=[],s=r.split(`
|
|
11
11
|
`);for(let a=n;a<s.length;a++){let l=s[a];if(l.length>1024)continue;let f=xm.test(l)?l.replace(xm,"$1"):l;if(!f.match(/\S*Error: /)){for(let m of e){let d=m(f);if(d){i.push(d);break}}if(i.length>=50+o)break}}return Rm(i.slice(o))}}function Rm(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(Zs(e).function||"")&&e.pop(),e.reverse(),Cm.test(Zs(e).function||"")&&(e.pop(),Cm.test(Zs(e).function||"")&&e.pop()),e.slice(0,50).map(r=>Z(E({},r),{filename:r.filename||Zs(e).filename,function:r.function||"?"}))}function Zs(t){return t[t.length-1]||{}}var Ql="<anonymous>";function er(t){try{return!t||typeof t!="function"?Ql:t.name||Ql}catch{return Ql}}function ea(t){let e=t.exception;if(e){let r=[];try{return e.values.forEach(n=>{n.stacktrace.frames&&r.push(...n.stacktrace.frames)}),r}catch{return}}}var ta={},Am={};function Ot(t,e){ta[t]=ta[t]||[],ta[t].push(e)}function Nt(t,e){if(!Am[t]){Am[t]=!0;try{e()}catch(r){ie&&ee.error(`Error while instrumenting ${t}`,r)}}}function at(t,e){let r=t&&ta[t];if(r)for(let n of r)try{n(e)}catch(o){ie&&ee.error(`Error while triggering instrumentation handler.
|
|
12
12
|
Type: ${t}
|
|
13
13
|
Name: ${er(n)}
|
|
14
|
-
Error:`,o)}}var eu=null;function tu(t){let e="error";Ot(e,t),Nt(e,FE)}function FE(){eu=pe.onerror,pe.onerror=function(t,e,r,n,o){return at("error",{column:n,error:o,line:r,msg:t,url:e}),eu?eu.apply(this,arguments):!1},pe.onerror.__SENTRY_INSTRUMENTED__=!0}var ru=null;function nu(t){let e="unhandledrejection";Ot(e,t),Nt(e,HE)}function HE(){ru=pe.onunhandledrejection,pe.onunhandledrejection=function(t){return at("unhandledrejection",t),ru?ru.apply(this,arguments):!0},pe.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Dm=Object.prototype.toString;function Gn(t){switch(Dm.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return gr(t,Error)}}function Co(t,e){return Dm.call(t)===`[object ${e}]`}function ra(t){return Co(t,"ErrorEvent")}function na(t){return Co(t,"DOMError")}function ou(t){return Co(t,"DOMException")}function Pt(t){return Co(t,"String")}function Ro(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function qn(t){return t===null||Ro(t)||typeof t!="object"&&typeof t!="function"}function Zr(t){return Co(t,"Object")}function zn(t){return typeof Event<"u"&&gr(t,Event)}function iu(t){return typeof Element<"u"&&gr(t,Element)}function su(t){return Co(t,"RegExp")}function en(t){return!!(t?.then&&typeof t.then=="function")}function au(t){return Zr(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function gr(t,e){try{return t instanceof e}catch{return!1}}function Bi(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function Om(t){return typeof Request<"u"&&gr(t,Request)}var cu=pe,$E=80;function Ui(t,e={}){if(!t)return"<unknown>";try{let r=t,n=5,o=[],i=0,s=0,a=" > ",l=a.length,f,m=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||$E;for(;r&&i++<n&&(f=VE(r,m),!(f==="html"||i>1&&s+o.length*l+f.length>=d));)o.push(f),s+=f.length,r=r.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function VE(t,e){let r=t,n=[];if(!r?.tagName)return"";if(cu.HTMLElement&&r instanceof HTMLElement&&r.dataset){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}n.push(r.tagName.toLowerCase());let o=e?.length?e.filter(s=>r.getAttribute(s)).map(s=>[s,r.getAttribute(s)]):null;if(o?.length)o.forEach(s=>{n.push(`[${s[0]}="${s[1]}"]`)});else{r.id&&n.push(`#${r.id}`);let s=r.className;if(s&&Pt(s)){let a=s.split(/\s+/);for(let l of a)n.push(`.${l}`)}}let i=["aria-label","type","name","title","alt"];for(let s of i){let a=r.getAttribute(s);a&&n.push(`[${s}="${a}"]`)}return n.join("")}function ki(){try{return cu.document.location.href}catch{return""}}function lu(t){if(!cu.HTMLElement)return null;let e=t,r=5;for(let n=0;n<r;n++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}function yn(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function oa(t,e){if(!Array.isArray(t))return"";let r=[];for(let n=0;n<t.length;n++){let o=t[n];try{Bi(o)?r.push("[VueViewModel]"):r.push(String(o))}catch{r.push("[value cannot be serialized]")}}return r.join(e)}function Nm(t,e,r=!1){return Pt(t)?su(e)?e.test(t):Pt(e)?r?t===e:t.includes(e):!1:!1}function Ao(t,e=[],r=!1){return e.some(n=>Nm(t,n,r))}function ct(t,e,r){if(!(e in t))return;let n=t[e];if(typeof n!="function")return;let o=r(n);typeof o=="function"&&ia(o,n);try{t[e]=o}catch{ie&&ee.log(`Failed to replace method "${e}" in object`,t)}}function Vt(t,e,r){try{Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0})}catch{ie&&ee.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function ia(t,e){try{let r=e.prototype||{};t.prototype=e.prototype=r,Vt(t,"__sentry_original__",e)}catch{}}function Yn(t){return t.__sentry_original__}function sa(t){if(Gn(t))return E({message:t.message,name:t.name,stack:t.stack},Lm(t));if(zn(t)){let e=E({type:t.type,target:Pm(t.target),currentTarget:Pm(t.currentTarget)},Lm(t));return typeof CustomEvent<"u"&&gr(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Pm(t){try{return iu(t)?Ui(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Lm(t){if(typeof t=="object"&&t!==null){let e={};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}else return{}}function uu(t,e=40){let r=Object.keys(sa(t));r.sort();let n=r[0];if(!n)return"[object has no keys]";if(n.length>=e)return yn(n,e);for(let o=r.length;o>0;o--){let i=r.slice(0,o).join(", ");if(!(i.length>e))return o===r.length?i:yn(i,e)}return""}function WE(){let t=pe;return t.crypto||t.msCrypto}function lt(t=WE()){let e=()=>Math.random()*16;try{if(t?.randomUUID)return t.randomUUID().replace(/-/g,"");t?.getRandomValues&&(e=()=>{let r=new Uint8Array(1);return t.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(e()&15)>>r/4).toString(16))}function Mm(t){return t.exception?.values?.[0]}function Cr(t){let{message:e,event_id:r}=t;if(e)return e;let n=Mm(t);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Do(t,e,r){let n=t.exception=t.exception||{},o=n.values=n.values||[],i=o[0]=o[0]||{};i.value||(i.value=e||""),i.type||(i.type=r||"Error")}function Rr(t,e){let r=Mm(t);if(!r)return;let n={type:"generic",handled:!0},o=r.mechanism;if(r.mechanism=E(E(E({},n),o),e),e&&"data"in e){let i=E(E({},o?.data),e.data);r.mechanism.data=i}}function aa(t){if(jE(t))return!0;try{Vt(t,"__sentry_captured__",!0)}catch{}return!1}function jE(t){try{return t.__sentry_captured__}catch{}}var Um=1e3;function Ar(){return Date.now()/Um}function GE(){let{performance:t}=pe;if(!t?.now||!t.timeOrigin)return Ar;let e=t.timeOrigin;return()=>(e+t.now())/Um}var Bm;function Ut(){return(Bm??(Bm=GE()))()}function km(t){let e=Ut(),r={sid:lt(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>qE(r)};return t&&tn(r,t),r}function tn(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Ut(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:lt()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let r=t.timestamp-t.started;t.duration=r>=0?r:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Fm(t,e){let r={};e?r={status:e}:t.status==="ok"&&(r={status:"exited"}),tn(t,r)}function qE(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function vn(t,e,r=2){if(!e||typeof e!="object"||r<=0)return e;if(t&&Object.keys(e).length===0)return t;let n=E({},t);for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=vn(n[o],e[o],r-1));return n}function fu(){return lt()}function ca(){return lt().substring(16)}var pu="_sentrySpan";function mu(t,e){e?Vt(t,pu,e):delete t[pu]}function du(t){return t[pu]}var zE=100,wt=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:fu(),sampleRand:Math.random()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags=E({},this._tags),e._extra=E({},this._extra),e._contexts=E({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata=E({},this._sdkProcessingMetadata),e._propagationContext=E({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,mu(e,du(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&tn(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags=E(E({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,r){return this._tags=Z(E({},this._tags),{[e]:r}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=E(E({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,r){return this._extra=Z(E({},this._extra),{[e]:r}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,r){return r===null?delete this._contexts[e]:this._contexts[e]=r,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let r=typeof e=="function"?e(this):e,n=r instanceof t?r.getScopeData():Zr(r)?e:void 0,{tags:o,extra:i,user:s,contexts:a,level:l,fingerprint:f=[],propagationContext:m}=n||{};return this._tags=E(E({},this._tags),o),this._extra=E(E({},this._extra),i),this._contexts=E(E({},this._contexts),a),s&&Object.keys(s).length&&(this._user=s),l&&(this._level=l),f.length&&(this._fingerprint=f),m&&(this._propagationContext=m),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,mu(this,void 0),this._attachments=[],this.setPropagationContext({traceId:fu(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,r){let n=typeof r=="number"?r:zE;if(n<=0)return this;let o=Z(E({timestamp:Ar()},e),{message:e.message?yn(e.message,2048):e.message});return this._breadcrumbs.push(o),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:du(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=vn(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,r){let n=r?.event_id||lt();if(!this._client)return ie&&ee.warn("No client configured on scope - will not capture exception!"),n;let o=new Error("Sentry syntheticException");return this._client.captureException(e,Z(E({originalException:e,syntheticException:o},r),{event_id:n}),this),n}captureMessage(e,r,n){let o=n?.event_id||lt();if(!this._client)return ie&&ee.warn("No client configured on scope - will not capture message!"),o;let i=new Error(e);return this._client.captureMessage(e,r,Z(E({originalException:e,syntheticException:i},n),{event_id:o}),this),o}captureEvent(e,r){let n=r?.event_id||lt();return this._client?(this._client.captureEvent(e,Z(E({},r),{event_id:n}),this),n):(ie&&ee.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function Hm(){return Qr("defaultCurrentScope",()=>new wt)}function $m(){return Qr("defaultIsolationScope",()=>new wt)}var hu=class{constructor(e,r){let n;e?n=e:n=new wt;let o;r?o=r:o=new wt,this._stack=[{scope:n}],this._isolationScope=o}withScope(e){let r=this._pushScope(),n;try{n=e(r)}catch(o){throw this._popScope(),o}return en(n)?n.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Oo(){let t=Wn(),e=jn(t);return e.stack=e.stack||new hu(Hm(),$m())}function YE(t){return Oo().withScope(t)}function KE(t,e){let r=Oo();return r.withScope(()=>(r.getStackTop().scope=t,e(t)))}function Vm(t){return Oo().withScope(()=>t(Oo().getIsolationScope()))}function Wm(){return{withIsolationScope:Vm,withScope:YE,withSetScope:KE,withSetIsolationScope:(t,e)=>Vm(e),getCurrentScope:()=>Oo().getScope(),getIsolationScope:()=>Oo().getIsolationScope()}}function la(t){let e=jn(t);return e.acs?e.acs:Wm()}function yr(){let t=Wn();return la(t).getCurrentScope()}function Dr(){let t=Wn();return la(t).getIsolationScope()}function ua(){return Qr("globalScope",()=>new wt)}function Fi(...t){let e=Wn(),r=la(e);if(t.length===2){let[n,o]=t;return n?r.withSetScope(n,o):r.withScope(o)}return r.withScope(t[0])}function We(){return yr().getClient()}function gu(t){let e=t.getPropagationContext(),{traceId:r,parentSpanId:n,propagationSpanId:o}=e,i={trace_id:r,span_id:o||ca()};return n&&(i.parent_span_id=n),i}var fa="sentry.source",yu="sentry.sample_rate",jm="sentry.previous_trace_sample_rate",vu="sentry.op",Eu="sentry.origin";var _u="sentry.profile_id",wu="sentry.exclusive_time";var XE="_sentryScope",JE="_sentryIsolationScope";function pa(t){return{scope:t[XE],isolationScope:t[JE]}}var QE="sentry-",ZE=/^sentry-/;function qm(t){let e=e_(t);if(!e)return;let r=Object.entries(e).reduce((n,[o,i])=>{if(o.match(ZE)){let s=o.slice(QE.length);n[s]=i}return n},{});if(Object.keys(r).length>0)return r}function e_(t){if(!(!t||!Pt(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,r)=>{let n=Gm(r);return Object.entries(n).forEach(([o,i])=>{e[o]=i}),e},{}):Gm(t)}function Gm(t){return t.split(",").map(e=>e.split("=").map(r=>{try{return decodeURIComponent(r.trim())}catch{return}})).reduce((e,[r,n])=>(r&&n&&(e[r]=n),e),{})}function zm(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var Jm=1,Ym=!1;function bu(t){let{spanId:e,traceId:r,isRemote:n}=t.spanContext(),o=n?e:No(t).parent_span_id,i=pa(t).scope,s=n?i?.getPropagationContext().propagationSpanId||ca():e;return{parent_span_id:o,span_id:s,trace_id:r}}function t_(t){if(t&&t.length>0)return t.map(s=>{var a=s,{context:l}=a,f=l,{spanId:e,traceId:r,traceFlags:n}=f,o=sm(f,["spanId","traceId","traceFlags"]),{attributes:i}=a;return E({span_id:e,trace_id:r,sampled:n===Jm,attributes:i},o)})}function Km(t){return typeof t=="number"?Xm(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Xm(t.getTime()):Ut()}function Xm(t){return t>9999999999?t/1e3:t}function No(t){if(n_(t))return t.getSpanJSON();let{spanId:e,traceId:r}=t.spanContext();if(r_(t)){let{attributes:n,startTime:o,name:i,endTime:s,status:a,links:l}=t,f="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:r,data:n,description:i,parent_span_id:f,start_timestamp:Km(o),timestamp:Km(s)||void 0,status:o_(a),op:n[vu],origin:n[Eu],links:t_(l)}}return{span_id:e,trace_id:r,start_timestamp:0,data:{}}}function r_(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function n_(t){return typeof t.getSpanJSON=="function"}function Qm(t){let{traceFlags:e}=t.spanContext();return e===Jm}function o_(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"unknown_error"}var i_="_sentryRootSpan";function Hi(t){return t[i_]||t}function Su(){Ym||(gn(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),Ym=!0)}function Zm(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||We()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}var Po="production";var s_=/^o(\d+)\./,a_=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function c_(t){return t==="http"||t==="https"}function En(t,e=!1){let{host:r,path:n,pass:o,port:i,projectId:s,protocol:a,publicKey:l}=t;return`${a}://${l}${e&&o?`:${o}`:""}@${r}${i?`:${i}`:""}/${n&&`${n}/`}${s}`}function l_(t){let e=a_.exec(t);if(!e){gn(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[r,n,o="",i="",s="",a=""]=e.slice(1),l="",f=a,m=f.split("/");if(m.length>1&&(l=m.slice(0,-1).join("/"),f=m.pop()),f){let d=f.match(/^\d+/);d&&(f=d[0])}return ed({host:i,pass:o,path:l,projectId:f,port:s,protocol:r,publicKey:n})}function ed(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function u_(t){if(!ie)return!0;let{port:e,projectId:r,protocol:n}=t;return["protocol","publicKey","host","projectId"].find(s=>t[s]?!1:(ee.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:r.match(/^\d+$/)?c_(n)?e&&isNaN(parseInt(e,10))?(ee.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(ee.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(ee.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function td(t){return t.match(s_)?.[1]}function rd(t){let e=typeof t=="string"?l_(t):ed(t);if(!(!e||!u_(e)))return e}var f_="_frozenDsc";function nd(t,e){let r=e.getOptions(),{publicKey:n,host:o}=e.getDsn()||{},i;r.orgId?i=String(r.orgId):o&&(i=td(o));let s={environment:r.environment||Po,release:r.release,public_key:n,trace_id:t,org_id:i};return e.emit("createDsc",s),s}function od(t,e){let r=e.getPropagationContext();return r.dsc||nd(r.traceId,t)}function Tu(t){let e=We();if(!e)return{};let r=Hi(t),n=No(r),o=n.data,i=r.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[yu]??o[jm];function a(C){return(typeof s=="number"||typeof s=="string")&&(C.sample_rate=`${s}`),C}let l=r[f_];if(l)return a(l);let f=i?.get("sentry.dsc"),m=f&&qm(f);if(m)return a(m);let d=nd(t.spanContext().traceId,e),_=o[fa],y=n.description;return _!=="url"&&y&&(d.transaction=y),Zm()&&(d.sampled=String(Qm(r)),d.sample_rand=i?.get("sentry.sample_rand")??pa(r).scope?.getPropagationContext().sampleRand.toString()),a(d),e.emit("createDsc",d,r),d}function tr(t,e=100,r=1/0){try{return Iu("",t,e,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function ma(t,e=3,r=100*1024){let n=tr(t,e);return h_(n)>r?ma(t,e-1,r):n}function Iu(t,e,r=1/0,n=1/0,o=g_()){let[i,s]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let a=p_(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let l=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:r;if(l===0)return a.replace("object ","");if(i(e))return"[Circular ~]";let f=e;if(f&&typeof f.toJSON=="function")try{let y=f.toJSON();return Iu("",y,l-1,n,o)}catch{}let m=Array.isArray(e)?[]:{},d=0,_=sa(e);for(let y in _){if(!Object.prototype.hasOwnProperty.call(_,y))continue;if(d>=n){m[y]="[MaxProperties ~]";break}let C=_[y];m[y]=Iu(y,C,l-1,n,o),d++}return s(e),m}function p_(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Bi(e))return"[VueViewModel]";if(au(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${er(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let r=m_(e);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function m_(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function d_(t){return~-encodeURI(t).split(/%..|./).length}function h_(t){return d_(JSON.stringify(t))}function g_(){let t=new WeakSet;function e(n){return t.has(n)?!0:(t.add(n),!1)}function r(n){t.delete(n)}return[e,r]}function rn(t,e=[]){return[t,e]}function id(t,e){let[r,n]=t;return[r,[...n,e]]}function Cu(t,e){let r=t[1];for(let n of r){let o=n[0].type;if(e(n,o))return!0}return!1}function xu(t){let e=jn(pe);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function sd(t){let[e,r]=t,n=JSON.stringify(e);function o(i){typeof n=="string"?n=typeof i=="string"?n+i:[xu(n),i]:n.push(typeof i=="string"?xu(i):i)}for(let i of r){let[s,a]=i;if(o(`
|
|
14
|
+
Error:`,o)}}var eu=null;function tu(t){let e="error";Ot(e,t),Nt(e,FE)}function FE(){eu=pe.onerror,pe.onerror=function(t,e,r,n,o){return at("error",{column:n,error:o,line:r,msg:t,url:e}),eu?eu.apply(this,arguments):!1},pe.onerror.__SENTRY_INSTRUMENTED__=!0}var ru=null;function nu(t){let e="unhandledrejection";Ot(e,t),Nt(e,HE)}function HE(){ru=pe.onunhandledrejection,pe.onunhandledrejection=function(t){return at("unhandledrejection",t),ru?ru.apply(this,arguments):!0},pe.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Dm=Object.prototype.toString;function Gn(t){switch(Dm.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return gr(t,Error)}}function Co(t,e){return Dm.call(t)===`[object ${e}]`}function ra(t){return Co(t,"ErrorEvent")}function na(t){return Co(t,"DOMError")}function ou(t){return Co(t,"DOMException")}function Pt(t){return Co(t,"String")}function Ro(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function qn(t){return t===null||Ro(t)||typeof t!="object"&&typeof t!="function"}function Zr(t){return Co(t,"Object")}function zn(t){return typeof Event<"u"&&gr(t,Event)}function iu(t){return typeof Element<"u"&&gr(t,Element)}function su(t){return Co(t,"RegExp")}function en(t){return!!(t?.then&&typeof t.then=="function")}function au(t){return Zr(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function gr(t,e){try{return t instanceof e}catch{return!1}}function Bi(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function Om(t){return typeof Request<"u"&&gr(t,Request)}var cu=pe,$E=80;function Ui(t,e={}){if(!t)return"<unknown>";try{let r=t,n=5,o=[],i=0,s=0,a=" > ",l=a.length,f,m=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||$E;for(;r&&i++<n&&(f=VE(r,m),!(f==="html"||i>1&&s+o.length*l+f.length>=d));)o.push(f),s+=f.length,r=r.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function VE(t,e){let r=t,n=[];if(!r?.tagName)return"";if(cu.HTMLElement&&r instanceof HTMLElement&&r.dataset){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}n.push(r.tagName.toLowerCase());let o=e?.length?e.filter(s=>r.getAttribute(s)).map(s=>[s,r.getAttribute(s)]):null;if(o?.length)o.forEach(s=>{n.push(`[${s[0]}="${s[1]}"]`)});else{r.id&&n.push(`#${r.id}`);let s=r.className;if(s&&Pt(s)){let a=s.split(/\s+/);for(let l of a)n.push(`.${l}`)}}let i=["aria-label","type","name","title","alt"];for(let s of i){let a=r.getAttribute(s);a&&n.push(`[${s}="${a}"]`)}return n.join("")}function ki(){try{return cu.document.location.href}catch{return""}}function lu(t){if(!cu.HTMLElement)return null;let e=t,r=5;for(let n=0;n<r;n++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}function yn(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function oa(t,e){if(!Array.isArray(t))return"";let r=[];for(let n=0;n<t.length;n++){let o=t[n];try{Bi(o)?r.push("[VueViewModel]"):r.push(String(o))}catch{r.push("[value cannot be serialized]")}}return r.join(e)}function Nm(t,e,r=!1){return Pt(t)?su(e)?e.test(t):Pt(e)?r?t===e:t.includes(e):!1:!1}function Ao(t,e=[],r=!1){return e.some(n=>Nm(t,n,r))}function ct(t,e,r){if(!(e in t))return;let n=t[e];if(typeof n!="function")return;let o=r(n);typeof o=="function"&&ia(o,n);try{t[e]=o}catch{ie&&ee.log(`Failed to replace method "${e}" in object`,t)}}function Vt(t,e,r){try{Object.defineProperty(t,e,{value:r,writable:!0,configurable:!0})}catch{ie&&ee.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function ia(t,e){try{let r=e.prototype||{};t.prototype=e.prototype=r,Vt(t,"__sentry_original__",e)}catch{}}function Yn(t){return t.__sentry_original__}function sa(t){if(Gn(t))return E({message:t.message,name:t.name,stack:t.stack},Lm(t));if(zn(t)){let e=E({type:t.type,target:Pm(t.target),currentTarget:Pm(t.currentTarget)},Lm(t));return typeof CustomEvent<"u"&&gr(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function Pm(t){try{return iu(t)?Ui(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Lm(t){if(typeof t=="object"&&t!==null){let e={};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}else return{}}function uu(t,e=40){let r=Object.keys(sa(t));r.sort();let n=r[0];if(!n)return"[object has no keys]";if(n.length>=e)return yn(n,e);for(let o=r.length;o>0;o--){let i=r.slice(0,o).join(", ");if(!(i.length>e))return o===r.length?i:yn(i,e)}return""}function WE(){let t=pe;return t.crypto||t.msCrypto}function lt(t=WE()){let e=()=>Math.random()*16;try{if(t?.randomUUID)return t.randomUUID().replace(/-/g,"");t?.getRandomValues&&(e=()=>{let r=new Uint8Array(1);return t.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(e()&15)>>r/4).toString(16))}function Mm(t){return t.exception?.values?.[0]}function Cr(t){let{message:e,event_id:r}=t;if(e)return e;let n=Mm(t);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function Do(t,e,r){let n=t.exception=t.exception||{},o=n.values=n.values||[],i=o[0]=o[0]||{};i.value||(i.value=e||""),i.type||(i.type=r||"Error")}function Rr(t,e){let r=Mm(t);if(!r)return;let n={type:"generic",handled:!0},o=r.mechanism;if(r.mechanism=E(E(E({},n),o),e),e&&"data"in e){let i=E(E({},o?.data),e.data);r.mechanism.data=i}}function aa(t){if(jE(t))return!0;try{Vt(t,"__sentry_captured__",!0)}catch{}return!1}function jE(t){try{return t.__sentry_captured__}catch{}}var Um=1e3;function Ar(){return Date.now()/Um}function GE(){let{performance:t}=pe;if(!t?.now||!t.timeOrigin)return Ar;let e=t.timeOrigin;return()=>(e+t.now())/Um}var Bm;function Ut(){return(Bm??(Bm=GE()))()}function km(t){let e=Ut(),r={sid:lt(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>qE(r)};return t&&tn(r,t),r}function tn(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||Ut(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:lt()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let r=t.timestamp-t.started;t.duration=r>=0?r:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Fm(t,e){let r={};e?r={status:e}:t.status==="ok"&&(r={status:"exited"}),tn(t,r)}function qE(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function vn(t,e,r=2){if(!e||typeof e!="object"||r<=0)return e;if(t&&Object.keys(e).length===0)return t;let n=E({},t);for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=vn(n[o],e[o],r-1));return n}function fu(){return lt()}function ca(){return lt().substring(16)}var pu="_sentrySpan";function mu(t,e){e?Vt(t,pu,e):delete t[pu]}function du(t){return t[pu]}var zE=100,bt=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:fu(),sampleRand:Math.random()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags=E({},this._tags),e._extra=E({},this._extra),e._contexts=E({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata=E({},this._sdkProcessingMetadata),e._propagationContext=E({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,mu(e,du(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&tn(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags=E(E({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,r){return this._tags=Z(E({},this._tags),{[e]:r}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=E(E({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,r){return this._extra=Z(E({},this._extra),{[e]:r}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,r){return r===null?delete this._contexts[e]:this._contexts[e]=r,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let r=typeof e=="function"?e(this):e,n=r instanceof t?r.getScopeData():Zr(r)?e:void 0,{tags:o,extra:i,user:s,contexts:a,level:l,fingerprint:f=[],propagationContext:m}=n||{};return this._tags=E(E({},this._tags),o),this._extra=E(E({},this._extra),i),this._contexts=E(E({},this._contexts),a),s&&Object.keys(s).length&&(this._user=s),l&&(this._level=l),f.length&&(this._fingerprint=f),m&&(this._propagationContext=m),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,mu(this,void 0),this._attachments=[],this.setPropagationContext({traceId:fu(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,r){let n=typeof r=="number"?r:zE;if(n<=0)return this;let o=Z(E({timestamp:Ar()},e),{message:e.message?yn(e.message,2048):e.message});return this._breadcrumbs.push(o),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:du(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=vn(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,r){let n=r?.event_id||lt();if(!this._client)return ie&&ee.warn("No client configured on scope - will not capture exception!"),n;let o=new Error("Sentry syntheticException");return this._client.captureException(e,Z(E({originalException:e,syntheticException:o},r),{event_id:n}),this),n}captureMessage(e,r,n){let o=n?.event_id||lt();if(!this._client)return ie&&ee.warn("No client configured on scope - will not capture message!"),o;let i=new Error(e);return this._client.captureMessage(e,r,Z(E({originalException:e,syntheticException:i},n),{event_id:o}),this),o}captureEvent(e,r){let n=r?.event_id||lt();return this._client?(this._client.captureEvent(e,Z(E({},r),{event_id:n}),this),n):(ie&&ee.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function Hm(){return Qr("defaultCurrentScope",()=>new bt)}function $m(){return Qr("defaultIsolationScope",()=>new bt)}var hu=class{constructor(e,r){let n;e?n=e:n=new bt;let o;r?o=r:o=new bt,this._stack=[{scope:n}],this._isolationScope=o}withScope(e){let r=this._pushScope(),n;try{n=e(r)}catch(o){throw this._popScope(),o}return en(n)?n.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Oo(){let t=Wn(),e=jn(t);return e.stack=e.stack||new hu(Hm(),$m())}function YE(t){return Oo().withScope(t)}function KE(t,e){let r=Oo();return r.withScope(()=>(r.getStackTop().scope=t,e(t)))}function Vm(t){return Oo().withScope(()=>t(Oo().getIsolationScope()))}function Wm(){return{withIsolationScope:Vm,withScope:YE,withSetScope:KE,withSetIsolationScope:(t,e)=>Vm(e),getCurrentScope:()=>Oo().getScope(),getIsolationScope:()=>Oo().getIsolationScope()}}function la(t){let e=jn(t);return e.acs?e.acs:Wm()}function yr(){let t=Wn();return la(t).getCurrentScope()}function Dr(){let t=Wn();return la(t).getIsolationScope()}function ua(){return Qr("globalScope",()=>new bt)}function Fi(...t){let e=Wn(),r=la(e);if(t.length===2){let[n,o]=t;return n?r.withSetScope(n,o):r.withScope(o)}return r.withScope(t[0])}function We(){return yr().getClient()}function gu(t){let e=t.getPropagationContext(),{traceId:r,parentSpanId:n,propagationSpanId:o}=e,i={trace_id:r,span_id:o||ca()};return n&&(i.parent_span_id=n),i}var fa="sentry.source",yu="sentry.sample_rate",jm="sentry.previous_trace_sample_rate",vu="sentry.op",Eu="sentry.origin";var _u="sentry.profile_id",bu="sentry.exclusive_time";var XE="_sentryScope",JE="_sentryIsolationScope";function pa(t){return{scope:t[XE],isolationScope:t[JE]}}var QE="sentry-",ZE=/^sentry-/;function qm(t){let e=e_(t);if(!e)return;let r=Object.entries(e).reduce((n,[o,i])=>{if(o.match(ZE)){let s=o.slice(QE.length);n[s]=i}return n},{});if(Object.keys(r).length>0)return r}function e_(t){if(!(!t||!Pt(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,r)=>{let n=Gm(r);return Object.entries(n).forEach(([o,i])=>{e[o]=i}),e},{}):Gm(t)}function Gm(t){return t.split(",").map(e=>e.split("=").map(r=>{try{return decodeURIComponent(r.trim())}catch{return}})).reduce((e,[r,n])=>(r&&n&&(e[r]=n),e),{})}function zm(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var Jm=1,Ym=!1;function wu(t){let{spanId:e,traceId:r,isRemote:n}=t.spanContext(),o=n?e:No(t).parent_span_id,i=pa(t).scope,s=n?i?.getPropagationContext().propagationSpanId||ca():e;return{parent_span_id:o,span_id:s,trace_id:r}}function t_(t){if(t&&t.length>0)return t.map(s=>{var a=s,{context:l}=a,f=l,{spanId:e,traceId:r,traceFlags:n}=f,o=sm(f,["spanId","traceId","traceFlags"]),{attributes:i}=a;return E({span_id:e,trace_id:r,sampled:n===Jm,attributes:i},o)})}function Km(t){return typeof t=="number"?Xm(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Xm(t.getTime()):Ut()}function Xm(t){return t>9999999999?t/1e3:t}function No(t){if(n_(t))return t.getSpanJSON();let{spanId:e,traceId:r}=t.spanContext();if(r_(t)){let{attributes:n,startTime:o,name:i,endTime:s,status:a,links:l}=t,f="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:r,data:n,description:i,parent_span_id:f,start_timestamp:Km(o),timestamp:Km(s)||void 0,status:o_(a),op:n[vu],origin:n[Eu],links:t_(l)}}return{span_id:e,trace_id:r,start_timestamp:0,data:{}}}function r_(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function n_(t){return typeof t.getSpanJSON=="function"}function Qm(t){let{traceFlags:e}=t.spanContext();return e===Jm}function o_(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"unknown_error"}var i_="_sentryRootSpan";function Hi(t){return t[i_]||t}function Su(){Ym||(gn(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),Ym=!0)}function Zm(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||We()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}var Po="production";var s_=/^o(\d+)\./,a_=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function c_(t){return t==="http"||t==="https"}function En(t,e=!1){let{host:r,path:n,pass:o,port:i,projectId:s,protocol:a,publicKey:l}=t;return`${a}://${l}${e&&o?`:${o}`:""}@${r}${i?`:${i}`:""}/${n&&`${n}/`}${s}`}function l_(t){let e=a_.exec(t);if(!e){gn(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[r,n,o="",i="",s="",a=""]=e.slice(1),l="",f=a,m=f.split("/");if(m.length>1&&(l=m.slice(0,-1).join("/"),f=m.pop()),f){let d=f.match(/^\d+/);d&&(f=d[0])}return ed({host:i,pass:o,path:l,projectId:f,port:s,protocol:r,publicKey:n})}function ed(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function u_(t){if(!ie)return!0;let{port:e,projectId:r,protocol:n}=t;return["protocol","publicKey","host","projectId"].find(s=>t[s]?!1:(ee.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:r.match(/^\d+$/)?c_(n)?e&&isNaN(parseInt(e,10))?(ee.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(ee.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(ee.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1)}function td(t){return t.match(s_)?.[1]}function rd(t){let e=typeof t=="string"?l_(t):ed(t);if(!(!e||!u_(e)))return e}var f_="_frozenDsc";function nd(t,e){let r=e.getOptions(),{publicKey:n,host:o}=e.getDsn()||{},i;r.orgId?i=String(r.orgId):o&&(i=td(o));let s={environment:r.environment||Po,release:r.release,public_key:n,trace_id:t,org_id:i};return e.emit("createDsc",s),s}function od(t,e){let r=e.getPropagationContext();return r.dsc||nd(r.traceId,t)}function Tu(t){let e=We();if(!e)return{};let r=Hi(t),n=No(r),o=n.data,i=r.spanContext().traceState,s=i?.get("sentry.sample_rate")??o[yu]??o[jm];function a(C){return(typeof s=="number"||typeof s=="string")&&(C.sample_rate=`${s}`),C}let l=r[f_];if(l)return a(l);let f=i?.get("sentry.dsc"),m=f&&qm(f);if(m)return a(m);let d=nd(t.spanContext().traceId,e),_=o[fa],y=n.description;return _!=="url"&&y&&(d.transaction=y),Zm()&&(d.sampled=String(Qm(r)),d.sample_rand=i?.get("sentry.sample_rand")??pa(r).scope?.getPropagationContext().sampleRand.toString()),a(d),e.emit("createDsc",d,r),d}function tr(t,e=100,r=1/0){try{return Iu("",t,e,r)}catch(n){return{ERROR:`**non-serializable** (${n})`}}}function ma(t,e=3,r=100*1024){let n=tr(t,e);return h_(n)>r?ma(t,e-1,r):n}function Iu(t,e,r=1/0,n=1/0,o=g_()){let[i,s]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let a=p_(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let l=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:r;if(l===0)return a.replace("object ","");if(i(e))return"[Circular ~]";let f=e;if(f&&typeof f.toJSON=="function")try{let y=f.toJSON();return Iu("",y,l-1,n,o)}catch{}let m=Array.isArray(e)?[]:{},d=0,_=sa(e);for(let y in _){if(!Object.prototype.hasOwnProperty.call(_,y))continue;if(d>=n){m[y]="[MaxProperties ~]";break}let C=_[y];m[y]=Iu(y,C,l-1,n,o),d++}return s(e),m}function p_(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Bi(e))return"[VueViewModel]";if(au(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${er(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let r=m_(e);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(r){return`**non-serializable** (${r})`}}function m_(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function d_(t){return~-encodeURI(t).split(/%..|./).length}function h_(t){return d_(JSON.stringify(t))}function g_(){let t=new WeakSet;function e(n){return t.has(n)?!0:(t.add(n),!1)}function r(n){t.delete(n)}return[e,r]}function rn(t,e=[]){return[t,e]}function id(t,e){let[r,n]=t;return[r,[...n,e]]}function Cu(t,e){let r=t[1];for(let n of r){let o=n[0].type;if(e(n,o))return!0}return!1}function xu(t){let e=jn(pe);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function sd(t){let[e,r]=t,n=JSON.stringify(e);function o(i){typeof n=="string"?n=typeof i=="string"?n+i:[xu(n),i]:n.push(typeof i=="string"?xu(i):i)}for(let i of r){let[s,a]=i;if(o(`
|
|
15
15
|
${JSON.stringify(s)}
|
|
16
|
-
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(tr(a))}o(l)}}return typeof n=="string"?n:y_(n)}function y_(t){let e=t.reduce((o,i)=>o+i.length,0),r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function ad(t){let e=typeof t.data=="string"?xu(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var v_={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item"};function Ru(t){return v_[t]}function Au(t){if(!t?.sdk)return;let{name:e,version:r}=t.sdk;return{name:e,version:r}}function cd(t,e,r,n){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return E(E(E({event_id:t.event_id,sent_at:new Date().toISOString()},e&&{sdk:e}),!!r&&n&&{dsn:En(n)}),o&&{trace:o})}function E_(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function ld(t,e,r,n){let o=Au(r),i=E(E({sent_at:new Date().toISOString()},o&&{sdk:o}),!!n&&e&&{dsn:En(e)}),s="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return rn(i,[s])}function ud(t,e,r,n){let o=Au(r),i=t.type&&t.type!=="replay_event"?t.type:"event";E_(t,r?.sdk);let s=cd(t,o,n,e);return delete t.sdkProcessingMetadata,rn(s,[[{type:i},t]])}var Du=0,fd=1,pd=2;function rr(t){return new vr(e=>{e(t)})}function _n(t){return new vr((e,r)=>{r(t)})}var vr=class t{constructor(e){this._state=Du,this._handlers=[],this._runExecutor(e)}then(e,r){return new t((n,o)=>{this._handlers.push([!1,i=>{if(!e)n(i);else try{n(e(i))}catch(s){o(s)}},i=>{if(!r)o(i);else try{n(r(i))}catch(s){o(s)}}]),this._executeHandlers()})}catch(e){return this.then(r=>r,e)}finally(e){return new t((r,n)=>{let o,i;return this.then(s=>{i=!1,o=s,e&&e()},s=>{i=!0,o=s,e&&e()}).then(()=>{if(i){n(o);return}r(o)})})}_executeHandlers(){if(this._state===Du)return;let e=this._handlers.slice();this._handlers=[],e.forEach(r=>{r[0]||(this._state===fd&&r[1](this._value),this._state===pd&&r[2](this._value),r[0]=!0)})}_runExecutor(e){let r=(i,s)=>{if(this._state===Du){if(en(s)){s.then(n,o);return}this._state=i,this._value=s,this._executeHandlers()}},n=i=>{r(fd,i)},o=i=>{r(pd,i)};try{e(n,o)}catch(i){o(i)}}};function da(t,e,r,n=0){return new vr((o,i)=>{let s=t[n];if(e===null||typeof s!="function")o(e);else{let a=s(E({},e),r);ie&&s.id&&a===null&&ee.log(`Event processor "${s.id}" dropped event`),en(a)?a.then(l=>da(t,l,r,n+1).then(o)).then(null,i):da(t,a,r,n+1).then(o).then(null,i)}})}function md(t,e){let{fingerprint:r,span:n,breadcrumbs:o,sdkProcessingMetadata:i}=e;__(t,e),n&&S_(t,n),T_(t,r),w_(t,o),b_(t,i)}function Ou(t,e){let{extra:r,tags:n,user:o,contexts:i,level:s,sdkProcessingMetadata:a,breadcrumbs:l,fingerprint:f,eventProcessors:m,attachments:d,propagationContext:_,transactionName:y,span:C}=e;ha(t,"extra",r),ha(t,"tags",n),ha(t,"user",o),ha(t,"contexts",i),t.sdkProcessingMetadata=vn(t.sdkProcessingMetadata,a,2),s&&(t.level=s),y&&(t.transactionName=y),C&&(t.span=C),l.length&&(t.breadcrumbs=[...t.breadcrumbs,...l]),f.length&&(t.fingerprint=[...t.fingerprint,...f]),m.length&&(t.eventProcessors=[...t.eventProcessors,...m]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext=E(E({},t.propagationContext),_)}function ha(t,e,r){t[e]=vn(t[e],r,1)}function __(t,e){let{extra:r,tags:n,user:o,contexts:i,level:s,transactionName:a}=e;Object.keys(r).length&&(t.extra=E(E({},r),t.extra)),Object.keys(n).length&&(t.tags=E(E({},n),t.tags)),Object.keys(o).length&&(t.user=E(E({},o),t.user)),Object.keys(i).length&&(t.contexts=E(E({},i),t.contexts)),s&&(t.level=s),a&&t.type!=="transaction"&&(t.transaction=a)}function w_(t,e){let r=[...t.breadcrumbs||[],...e];t.breadcrumbs=r.length?r:void 0}function b_(t,e){t.sdkProcessingMetadata=E(E({},t.sdkProcessingMetadata),e)}function S_(t,e){t.contexts=E({trace:bu(e)},t.contexts),t.sdkProcessingMetadata=E({dynamicSamplingContext:Tu(e)},t.sdkProcessingMetadata);let r=Hi(e),n=No(r).description;n&&!t.transaction&&t.type==="transaction"&&(t.transaction=n)}function T_(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}var ga,dd,ya;function hd(t){let e=pe._sentryDebugIds;if(!e)return{};let r=Object.keys(e);return ya&&r.length===dd||(dd=r.length,ya=r.reduce((n,o)=>{ga||(ga={});let i=ga[o];if(i)n[i[0]]=i[1];else{let s=t(o);for(let a=s.length-1;a>=0;a--){let f=s[a]?.filename,m=e[o];if(f&&m){n[f]=m,ga[o]=[f,m];break}}}return n},{})),ya}function gd(t,e,r,n,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=t,l=Z(E({},e),{event_id:e.event_id||r.event_id||lt(),timestamp:e.timestamp||Ar()}),f=r.integrations||t.integrations.map(A=>A.name);I_(l,t),R_(l,f),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&x_(l,t.stackParser);let m=D_(n,r.captureContext);r.mechanism&&Rr(l,r.mechanism);let d=o?o.getEventProcessors():[],_=ua().getScopeData();if(i){let A=i.getScopeData();Ou(_,A)}if(m){let A=m.getScopeData();Ou(_,A)}let y=[...r.attachments||[],..._.attachments];y.length&&(r.attachments=y),md(l,_);let C=[...d,..._.eventProcessors];return da(C,l,r).then(A=>(A&&C_(A),typeof s=="number"&&s>0?A_(A,s,a):A))}function I_(t,e){let{environment:r,release:n,dist:o,maxValueLength:i=250}=e;t.environment=t.environment||r||Po,!t.release&&n&&(t.release=n),!t.dist&&o&&(t.dist=o);let s=t.request;s?.url&&(s.url=yn(s.url,i))}function x_(t,e){let r=hd(e);t.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=r[o.filename])})})}function C_(t){let e={};if(t.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let r=t.debug_meta.images;Object.entries(e).forEach(([n,o])=>{r.push({type:"sourcemap",code_file:n,debug_id:o})})}function R_(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function A_(t,e,r){if(!t)return null;let n=E(E(E(E(E({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>E(E({},o),o.data&&{data:tr(o.data,e,r)}))}),t.user&&{user:tr(t.user,e,r)}),t.contexts&&{contexts:tr(t.contexts,e,r)}),t.extra&&{extra:tr(t.extra,e,r)});return t.contexts?.trace&&n.contexts&&(n.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(n.contexts.trace.data=tr(t.contexts.trace.data,e,r))),t.spans&&(n.spans=t.spans.map(o=>E(E({},o),o.data&&{data:tr(o.data,e,r)}))),t.contexts?.flags&&n.contexts&&(n.contexts.flags=tr(t.contexts.flags,3,r)),n}function D_(t,e){if(!e)return t;let r=t?t.clone():new wt;return r.update(e),r}function yd(t){if(t)return O_(t)?{captureContext:t}:P_(t)?{captureContext:t}:t}function O_(t){return t instanceof wt||typeof t=="function"}var N_=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function P_(t){return Object.keys(t).some(e=>N_.includes(e))}function va(t,e){return yr().captureException(t,yd(e))}function Ea(t,e){let r=typeof e=="string"?e:void 0,n=typeof e!="string"?{captureContext:e}:void 0;return yr().captureMessage(t,r,n)}function $i(t,e){return yr().captureEvent(t,e)}function Vi(t){let e=Dr(),r=yr(),{userAgent:n}=pe.navigator||{},o=km(E(E({user:r.getUser()||e.getUser()},n&&{userAgent:n}),t)),i=e.getSession();return i?.status==="ok"&&tn(i,{status:"exited"}),_a(),e.setSession(o),o}function _a(){let t=Dr(),r=yr().getSession()||t.getSession();r&&Fm(r),Ed(),t.setSession()}function Ed(){let t=Dr(),e=We(),r=t.getSession();r&&e&&e.captureSession(r)}function Wi(t=!1){if(t){_a();return}Ed()}var L_="7";function M_(t){let e=t.protocol?`${t.protocol}:`:"",r=t.port?`:${t.port}`:"";return`${e}//${t.host}${r}${t.path?`/${t.path}`:""}/api/`}function B_(t){return`${M_(t)}${t.projectId}/envelope/`}function U_(t,e){let r={sentry_version:L_};return t.publicKey&&(r.sentry_key=t.publicKey),e&&(r.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(r).toString()}function _d(t,e,r){return e||`${B_(t)}?${U_(t,r)}`}var wd=[];function bd(t,e){let r={};return e.forEach(n=>{n&&Pu(t,n,r)}),r}function Nu(t,e){for(let r of e)r?.afterAllSetup&&r.afterAllSetup(t)}function Pu(t,e,r){if(r[e.name]){ie&&ee.log(`Integration skipped because it was already installed: ${e.name}`);return}if(r[e.name]=e,wd.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),wd.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let n=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,i)=>n(o,i,t))}if(typeof e.processEvent=="function"){let n=e.processEvent.bind(e),o=Object.assign((i,s)=>n(i,s,t),{id:e.name});t.addEventProcessor(o)}ie&&ee.log(`Integration installed: ${e.name}`)}function Sd(t,e,r){let n=[{type:"client_report"},{timestamp:r||Ar(),discarded_events:t}];return rn(e?{dsn:e}:{},[n])}function wa(t){let e=[];t.message&&e.push(t.message);try{let r=t.exception.values[t.exception.values.length-1];r?.value&&(e.push(r.value),r.type&&e.push(`${r.type}: ${r.value}`))}catch{}return e}function Td(t){let{trace_id:e,parent_span_id:r,span_id:n,status:o,origin:i,data:s,op:a}=t.contexts?.trace??{};return{data:s??{},description:t.transaction,op:a,parent_span_id:r,span_id:n??"",start_timestamp:t.start_timestamp??0,status:o,timestamp:t.timestamp,trace_id:e??"",origin:i,profile_id:s?.[_u],exclusive_time:s?.[wu],measurements:t.measurements,is_segment:!0}}function Id(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:E(E(E({},t.data),t.profile_id&&{[_u]:t.profile_id}),t.exclusive_time&&{[wu]:t.exclusive_time})}},measurements:t.measurements}}var xd="Not capturing exception because it's already been captured.",Cd="Discarded session because of missing or non-string release",Dd=Symbol.for("SentryInternalError"),Od=Symbol.for("SentryDoNotSendEventError");function ba(t){return{message:t,[Dd]:!0}}function Lu(t){return{message:t,[Od]:!0}}function Rd(t){return!!t&&typeof t=="object"&&Dd in t}function Ad(t){return!!t&&typeof t=="object"&&Od in t}var ji=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=rd(e.dsn):ie&&ee.warn("No DSN provided, client will not send events."),this._dsn){let r=_d(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(Z(E({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:r}))}}captureException(e,r,n){let o=lt();if(aa(e))return ie&&ee.log(xd),o;let i=E({event_id:o},r);return this._process(this.eventFromException(e,i).then(s=>this._captureEvent(s,i,n))),i.event_id}captureMessage(e,r,n,o){let i=E({event_id:lt()},n),s=Ro(e)?e:String(e),a=qn(e)?this.eventFromMessage(s,r,i):this.eventFromException(e,i);return this._process(a.then(l=>this._captureEvent(l,i,o))),i.event_id}captureEvent(e,r,n){let o=lt();if(r?.originalException&&aa(r.originalException))return ie&&ee.log(xd),o;let i=E({event_id:o},r),s=e.sdkProcessingMetadata||{},a=s.capturedSpanScope,l=s.capturedSpanIsolationScope;return this._process(this._captureEvent(e,i,a||n,l)),i.event_id}captureSession(e){this.sendSession(e),tn(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let r=this._transport;return r?(this.emit("flush"),this._isClientDoneProcessing(e).then(n=>r.flush(e).then(o=>n&&o))):rr(!0)}close(e){return this.flush(e).then(r=>(this.getOptions().enabled=!1,this.emit("close"),r))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let r=this._integrations[e.name];Pu(this,e,this._integrations),r||Nu(this,[e])}sendEvent(e,r={}){this.emit("beforeSendEvent",e,r);let n=ud(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of r.attachments||[])n=id(n,ad(i));let o=this.sendEnvelope(n);o&&o.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let{release:r,environment:n=Po}=this._options;if("aggregates"in e){let i=e.attrs||{};if(!i.release&&!r){ie&&ee.warn(Cd);return}i.release=i.release||r,i.environment=i.environment||n,e.attrs=i}else{if(!e.release&&!r){ie&&ee.warn(Cd);return}e.release=e.release||r,e.environment=e.environment||n}this.emit("beforeSendSession",e);let o=ld(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(e,r,n=1){if(this._options.sendClientReports){let o=`${e}:${r}`;ie&&ee.log(`Recording outcome: "${o}"${n>1?` (${n} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+n}}on(e,r){let n=this._hooks[e]=this._hooks[e]||[];return n.push(r),()=>{let o=n.indexOf(r);o>-1&&n.splice(o,1)}}emit(e,...r){let n=this._hooks[e];n&&n.forEach(o=>o(...r))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,r=>(ie&&ee.error("Error while sending envelope:",r),r)):(ie&&ee.error("Transport disabled"),rr({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=bd(this,e),Nu(this,e)}_updateSessionFromEvent(e,r){let n=r.level==="fatal",o=!1,i=r.exception?.values;if(i){o=!0;for(let l of i)if(l.mechanism?.handled===!1){n=!0;break}}let s=e.status==="ok";(s&&e.errors===0||s&&n)&&(tn(e,Z(E({},n&&{status:"crashed"}),{errors:e.errors||Number(o||n)})),this.captureSession(e))}_isClientDoneProcessing(e){return new vr(r=>{let n=0,o=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),r(!0)):(n+=o,e&&n>=e&&(clearInterval(i),r(!1)))},o)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,r,n,o){let i=this.getOptions(),s=Object.keys(this._integrations);return!r.integrations&&s?.length&&(r.integrations=s),this.emit("preprocessEvent",e,r),e.type||o.setLastEventId(e.event_id||r.event_id),gd(i,e,r,n,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,r),a.contexts=E({trace:gu(n)},a.contexts);let l=od(this,n);return a.sdkProcessingMetadata=E({dynamicSamplingContext:l},a.sdkProcessingMetadata),a})}_captureEvent(e,r={},n=yr(),o=Dr()){return ie&&Mu(e)&&ee.log(`Captured error event \`${wa(e)[0]||"<unknown>"}\``),this._processEvent(e,r,n,o).then(i=>i.event_id,i=>{ie&&(Ad(i)?ee.log(i.message):Rd(i)?ee.warn(i.message):ee.warn(i))})}_processEvent(e,r,n,o){let i=this.getOptions(),{sampleRate:s}=i,a=Nd(e),l=Mu(e),f=e.type||"error",m=`before send for type \`${f}\``,d=typeof s>"u"?void 0:zm(s);if(l&&typeof d=="number"&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error"),_n(Lu(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let _=f==="replay_event"?"replay":f;return this._prepareEvent(e,r,n,o).then(y=>{if(y===null)throw this.recordDroppedEvent("event_processor",_),Lu("An event processor returned `null`, will not send event.");if(r.data&&r.data.__sentry__===!0)return y;let N=H_(this,i,y,r);return F_(N,m)}).then(y=>{if(y===null){if(this.recordDroppedEvent("before_send",_),a){let B=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",B)}throw Lu(`${m} returned \`null\`, will not send event.`)}let C=n.getSession()||o.getSession();if(l&&C&&this._updateSessionFromEvent(C,y),a){let A=y.sdkProcessingMetadata?.spanCountBeforeProcessing||0,B=y.spans?y.spans.length:0,q=A-B;q>0&&this.recordDroppedEvent("before_send","span",q)}let N=y.transaction_info;if(a&&N&&y.transaction!==e.transaction){let A="custom";y.transaction_info=Z(E({},N),{source:A})}return this.sendEvent(y,r),y}).then(null,y=>{throw Ad(y)||Rd(y)?y:(this.captureException(y,{data:{__sentry__:!0},originalException:y}),ba(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
17
|
-
Reason: ${y}`))})}_process(e){this._numProcessing++,e.then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([r,n])=>{let[o,i]=r.split(":");return{reason:o,category:i,quantity:n}})}_flushOutcomes(){ie&&ee.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){ie&&ee.log("No outcomes to send");return}if(!this._dsn){ie&&ee.log("No dsn provided, will not send outcomes");return}ie&&ee.log("Sending outcomes:",e);let r=Sd(e,this._options.tunnel&&En(this._dsn));this.sendEnvelope(r)}};function F_(t,e){let r=`${e} must return \`null\` or a valid event.`;if(en(t))return t.then(n=>{if(!Zr(n)&&n!==null)throw
|
|
16
|
+
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let l;try{l=JSON.stringify(a)}catch{l=JSON.stringify(tr(a))}o(l)}}return typeof n=="string"?n:y_(n)}function y_(t){let e=t.reduce((o,i)=>o+i.length,0),r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function ad(t){let e=typeof t.data=="string"?xu(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var v_={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item"};function Ru(t){return v_[t]}function Au(t){if(!t?.sdk)return;let{name:e,version:r}=t.sdk;return{name:e,version:r}}function cd(t,e,r,n){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return E(E(E({event_id:t.event_id,sent_at:new Date().toISOString()},e&&{sdk:e}),!!r&&n&&{dsn:En(n)}),o&&{trace:o})}function E_(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function ld(t,e,r,n){let o=Au(r),i=E(E({sent_at:new Date().toISOString()},o&&{sdk:o}),!!n&&e&&{dsn:En(e)}),s="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return rn(i,[s])}function ud(t,e,r,n){let o=Au(r),i=t.type&&t.type!=="replay_event"?t.type:"event";E_(t,r?.sdk);let s=cd(t,o,n,e);return delete t.sdkProcessingMetadata,rn(s,[[{type:i},t]])}var Du=0,fd=1,pd=2;function rr(t){return new vr(e=>{e(t)})}function _n(t){return new vr((e,r)=>{r(t)})}var vr=class t{constructor(e){this._state=Du,this._handlers=[],this._runExecutor(e)}then(e,r){return new t((n,o)=>{this._handlers.push([!1,i=>{if(!e)n(i);else try{n(e(i))}catch(s){o(s)}},i=>{if(!r)o(i);else try{n(r(i))}catch(s){o(s)}}]),this._executeHandlers()})}catch(e){return this.then(r=>r,e)}finally(e){return new t((r,n)=>{let o,i;return this.then(s=>{i=!1,o=s,e&&e()},s=>{i=!0,o=s,e&&e()}).then(()=>{if(i){n(o);return}r(o)})})}_executeHandlers(){if(this._state===Du)return;let e=this._handlers.slice();this._handlers=[],e.forEach(r=>{r[0]||(this._state===fd&&r[1](this._value),this._state===pd&&r[2](this._value),r[0]=!0)})}_runExecutor(e){let r=(i,s)=>{if(this._state===Du){if(en(s)){s.then(n,o);return}this._state=i,this._value=s,this._executeHandlers()}},n=i=>{r(fd,i)},o=i=>{r(pd,i)};try{e(n,o)}catch(i){o(i)}}};function da(t,e,r,n=0){return new vr((o,i)=>{let s=t[n];if(e===null||typeof s!="function")o(e);else{let a=s(E({},e),r);ie&&s.id&&a===null&&ee.log(`Event processor "${s.id}" dropped event`),en(a)?a.then(l=>da(t,l,r,n+1).then(o)).then(null,i):da(t,a,r,n+1).then(o).then(null,i)}})}function md(t,e){let{fingerprint:r,span:n,breadcrumbs:o,sdkProcessingMetadata:i}=e;__(t,e),n&&S_(t,n),T_(t,r),b_(t,o),w_(t,i)}function Ou(t,e){let{extra:r,tags:n,user:o,contexts:i,level:s,sdkProcessingMetadata:a,breadcrumbs:l,fingerprint:f,eventProcessors:m,attachments:d,propagationContext:_,transactionName:y,span:C}=e;ha(t,"extra",r),ha(t,"tags",n),ha(t,"user",o),ha(t,"contexts",i),t.sdkProcessingMetadata=vn(t.sdkProcessingMetadata,a,2),s&&(t.level=s),y&&(t.transactionName=y),C&&(t.span=C),l.length&&(t.breadcrumbs=[...t.breadcrumbs,...l]),f.length&&(t.fingerprint=[...t.fingerprint,...f]),m.length&&(t.eventProcessors=[...t.eventProcessors,...m]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext=E(E({},t.propagationContext),_)}function ha(t,e,r){t[e]=vn(t[e],r,1)}function __(t,e){let{extra:r,tags:n,user:o,contexts:i,level:s,transactionName:a}=e;Object.keys(r).length&&(t.extra=E(E({},r),t.extra)),Object.keys(n).length&&(t.tags=E(E({},n),t.tags)),Object.keys(o).length&&(t.user=E(E({},o),t.user)),Object.keys(i).length&&(t.contexts=E(E({},i),t.contexts)),s&&(t.level=s),a&&t.type!=="transaction"&&(t.transaction=a)}function b_(t,e){let r=[...t.breadcrumbs||[],...e];t.breadcrumbs=r.length?r:void 0}function w_(t,e){t.sdkProcessingMetadata=E(E({},t.sdkProcessingMetadata),e)}function S_(t,e){t.contexts=E({trace:wu(e)},t.contexts),t.sdkProcessingMetadata=E({dynamicSamplingContext:Tu(e)},t.sdkProcessingMetadata);let r=Hi(e),n=No(r).description;n&&!t.transaction&&t.type==="transaction"&&(t.transaction=n)}function T_(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}var ga,dd,ya;function hd(t){let e=pe._sentryDebugIds;if(!e)return{};let r=Object.keys(e);return ya&&r.length===dd||(dd=r.length,ya=r.reduce((n,o)=>{ga||(ga={});let i=ga[o];if(i)n[i[0]]=i[1];else{let s=t(o);for(let a=s.length-1;a>=0;a--){let f=s[a]?.filename,m=e[o];if(f&&m){n[f]=m,ga[o]=[f,m];break}}}return n},{})),ya}function gd(t,e,r,n,o,i){let{normalizeDepth:s=3,normalizeMaxBreadth:a=1e3}=t,l=Z(E({},e),{event_id:e.event_id||r.event_id||lt(),timestamp:e.timestamp||Ar()}),f=r.integrations||t.integrations.map(A=>A.name);I_(l,t),R_(l,f),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&x_(l,t.stackParser);let m=D_(n,r.captureContext);r.mechanism&&Rr(l,r.mechanism);let d=o?o.getEventProcessors():[],_=ua().getScopeData();if(i){let A=i.getScopeData();Ou(_,A)}if(m){let A=m.getScopeData();Ou(_,A)}let y=[...r.attachments||[],..._.attachments];y.length&&(r.attachments=y),md(l,_);let C=[...d,..._.eventProcessors];return da(C,l,r).then(A=>(A&&C_(A),typeof s=="number"&&s>0?A_(A,s,a):A))}function I_(t,e){let{environment:r,release:n,dist:o,maxValueLength:i=250}=e;t.environment=t.environment||r||Po,!t.release&&n&&(t.release=n),!t.dist&&o&&(t.dist=o);let s=t.request;s?.url&&(s.url=yn(s.url,i))}function x_(t,e){let r=hd(e);t.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=r[o.filename])})})}function C_(t){let e={};if(t.exception?.values?.forEach(n=>{n.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let r=t.debug_meta.images;Object.entries(e).forEach(([n,o])=>{r.push({type:"sourcemap",code_file:n,debug_id:o})})}function R_(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function A_(t,e,r){if(!t)return null;let n=E(E(E(E(E({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>E(E({},o),o.data&&{data:tr(o.data,e,r)}))}),t.user&&{user:tr(t.user,e,r)}),t.contexts&&{contexts:tr(t.contexts,e,r)}),t.extra&&{extra:tr(t.extra,e,r)});return t.contexts?.trace&&n.contexts&&(n.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(n.contexts.trace.data=tr(t.contexts.trace.data,e,r))),t.spans&&(n.spans=t.spans.map(o=>E(E({},o),o.data&&{data:tr(o.data,e,r)}))),t.contexts?.flags&&n.contexts&&(n.contexts.flags=tr(t.contexts.flags,3,r)),n}function D_(t,e){if(!e)return t;let r=t?t.clone():new bt;return r.update(e),r}function yd(t){if(t)return O_(t)?{captureContext:t}:P_(t)?{captureContext:t}:t}function O_(t){return t instanceof bt||typeof t=="function"}var N_=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function P_(t){return Object.keys(t).some(e=>N_.includes(e))}function va(t,e){return yr().captureException(t,yd(e))}function Ea(t,e){let r=typeof e=="string"?e:void 0,n=typeof e!="string"?{captureContext:e}:void 0;return yr().captureMessage(t,r,n)}function $i(t,e){return yr().captureEvent(t,e)}function Vi(t){let e=Dr(),r=yr(),{userAgent:n}=pe.navigator||{},o=km(E(E({user:r.getUser()||e.getUser()},n&&{userAgent:n}),t)),i=e.getSession();return i?.status==="ok"&&tn(i,{status:"exited"}),_a(),e.setSession(o),o}function _a(){let t=Dr(),r=yr().getSession()||t.getSession();r&&Fm(r),Ed(),t.setSession()}function Ed(){let t=Dr(),e=We(),r=t.getSession();r&&e&&e.captureSession(r)}function Wi(t=!1){if(t){_a();return}Ed()}var L_="7";function M_(t){let e=t.protocol?`${t.protocol}:`:"",r=t.port?`:${t.port}`:"";return`${e}//${t.host}${r}${t.path?`/${t.path}`:""}/api/`}function B_(t){return`${M_(t)}${t.projectId}/envelope/`}function U_(t,e){let r={sentry_version:L_};return t.publicKey&&(r.sentry_key=t.publicKey),e&&(r.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(r).toString()}function _d(t,e,r){return e||`${B_(t)}?${U_(t,r)}`}var bd=[];function wd(t,e){let r={};return e.forEach(n=>{n&&Pu(t,n,r)}),r}function Nu(t,e){for(let r of e)r?.afterAllSetup&&r.afterAllSetup(t)}function Pu(t,e,r){if(r[e.name]){ie&&ee.log(`Integration skipped because it was already installed: ${e.name}`);return}if(r[e.name]=e,bd.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),bd.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let n=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,i)=>n(o,i,t))}if(typeof e.processEvent=="function"){let n=e.processEvent.bind(e),o=Object.assign((i,s)=>n(i,s,t),{id:e.name});t.addEventProcessor(o)}ie&&ee.log(`Integration installed: ${e.name}`)}function Sd(t,e,r){let n=[{type:"client_report"},{timestamp:r||Ar(),discarded_events:t}];return rn(e?{dsn:e}:{},[n])}function ba(t){let e=[];t.message&&e.push(t.message);try{let r=t.exception.values[t.exception.values.length-1];r?.value&&(e.push(r.value),r.type&&e.push(`${r.type}: ${r.value}`))}catch{}return e}function Td(t){let{trace_id:e,parent_span_id:r,span_id:n,status:o,origin:i,data:s,op:a}=t.contexts?.trace??{};return{data:s??{},description:t.transaction,op:a,parent_span_id:r,span_id:n??"",start_timestamp:t.start_timestamp??0,status:o,timestamp:t.timestamp,trace_id:e??"",origin:i,profile_id:s?.[_u],exclusive_time:s?.[bu],measurements:t.measurements,is_segment:!0}}function Id(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:E(E(E({},t.data),t.profile_id&&{[_u]:t.profile_id}),t.exclusive_time&&{[bu]:t.exclusive_time})}},measurements:t.measurements}}var xd="Not capturing exception because it's already been captured.",Cd="Discarded session because of missing or non-string release",Dd=Symbol.for("SentryInternalError"),Od=Symbol.for("SentryDoNotSendEventError");function wa(t){return{message:t,[Dd]:!0}}function Lu(t){return{message:t,[Od]:!0}}function Rd(t){return!!t&&typeof t=="object"&&Dd in t}function Ad(t){return!!t&&typeof t=="object"&&Od in t}var ji=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=rd(e.dsn):ie&&ee.warn("No DSN provided, client will not send events."),this._dsn){let r=_d(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(Z(E({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:r}))}}captureException(e,r,n){let o=lt();if(aa(e))return ie&&ee.log(xd),o;let i=E({event_id:o},r);return this._process(this.eventFromException(e,i).then(s=>this._captureEvent(s,i,n))),i.event_id}captureMessage(e,r,n,o){let i=E({event_id:lt()},n),s=Ro(e)?e:String(e),a=qn(e)?this.eventFromMessage(s,r,i):this.eventFromException(e,i);return this._process(a.then(l=>this._captureEvent(l,i,o))),i.event_id}captureEvent(e,r,n){let o=lt();if(r?.originalException&&aa(r.originalException))return ie&&ee.log(xd),o;let i=E({event_id:o},r),s=e.sdkProcessingMetadata||{},a=s.capturedSpanScope,l=s.capturedSpanIsolationScope;return this._process(this._captureEvent(e,i,a||n,l)),i.event_id}captureSession(e){this.sendSession(e),tn(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let r=this._transport;return r?(this.emit("flush"),this._isClientDoneProcessing(e).then(n=>r.flush(e).then(o=>n&&o))):rr(!0)}close(e){return this.flush(e).then(r=>(this.getOptions().enabled=!1,this.emit("close"),r))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let r=this._integrations[e.name];Pu(this,e,this._integrations),r||Nu(this,[e])}sendEvent(e,r={}){this.emit("beforeSendEvent",e,r);let n=ud(e,this._dsn,this._options._metadata,this._options.tunnel);for(let i of r.attachments||[])n=id(n,ad(i));let o=this.sendEnvelope(n);o&&o.then(i=>this.emit("afterSendEvent",e,i),null)}sendSession(e){let{release:r,environment:n=Po}=this._options;if("aggregates"in e){let i=e.attrs||{};if(!i.release&&!r){ie&&ee.warn(Cd);return}i.release=i.release||r,i.environment=i.environment||n,e.attrs=i}else{if(!e.release&&!r){ie&&ee.warn(Cd);return}e.release=e.release||r,e.environment=e.environment||n}this.emit("beforeSendSession",e);let o=ld(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(e,r,n=1){if(this._options.sendClientReports){let o=`${e}:${r}`;ie&&ee.log(`Recording outcome: "${o}"${n>1?` (${n} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+n}}on(e,r){let n=this._hooks[e]=this._hooks[e]||[];return n.push(r),()=>{let o=n.indexOf(r);o>-1&&n.splice(o,1)}}emit(e,...r){let n=this._hooks[e];n&&n.forEach(o=>o(...r))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,r=>(ie&&ee.error("Error while sending envelope:",r),r)):(ie&&ee.error("Transport disabled"),rr({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=wd(this,e),Nu(this,e)}_updateSessionFromEvent(e,r){let n=r.level==="fatal",o=!1,i=r.exception?.values;if(i){o=!0;for(let l of i)if(l.mechanism?.handled===!1){n=!0;break}}let s=e.status==="ok";(s&&e.errors===0||s&&n)&&(tn(e,Z(E({},n&&{status:"crashed"}),{errors:e.errors||Number(o||n)})),this.captureSession(e))}_isClientDoneProcessing(e){return new vr(r=>{let n=0,o=1,i=setInterval(()=>{this._numProcessing==0?(clearInterval(i),r(!0)):(n+=o,e&&n>=e&&(clearInterval(i),r(!1)))},o)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,r,n,o){let i=this.getOptions(),s=Object.keys(this._integrations);return!r.integrations&&s?.length&&(r.integrations=s),this.emit("preprocessEvent",e,r),e.type||o.setLastEventId(e.event_id||r.event_id),gd(i,e,r,n,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,r),a.contexts=E({trace:gu(n)},a.contexts);let l=od(this,n);return a.sdkProcessingMetadata=E({dynamicSamplingContext:l},a.sdkProcessingMetadata),a})}_captureEvent(e,r={},n=yr(),o=Dr()){return ie&&Mu(e)&&ee.log(`Captured error event \`${ba(e)[0]||"<unknown>"}\``),this._processEvent(e,r,n,o).then(i=>i.event_id,i=>{ie&&(Ad(i)?ee.log(i.message):Rd(i)?ee.warn(i.message):ee.warn(i))})}_processEvent(e,r,n,o){let i=this.getOptions(),{sampleRate:s}=i,a=Nd(e),l=Mu(e),f=e.type||"error",m=`before send for type \`${f}\``,d=typeof s>"u"?void 0:zm(s);if(l&&typeof d=="number"&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error"),_n(Lu(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let _=f==="replay_event"?"replay":f;return this._prepareEvent(e,r,n,o).then(y=>{if(y===null)throw this.recordDroppedEvent("event_processor",_),Lu("An event processor returned `null`, will not send event.");if(r.data&&r.data.__sentry__===!0)return y;let N=H_(this,i,y,r);return F_(N,m)}).then(y=>{if(y===null){if(this.recordDroppedEvent("before_send",_),a){let B=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",B)}throw Lu(`${m} returned \`null\`, will not send event.`)}let C=n.getSession()||o.getSession();if(l&&C&&this._updateSessionFromEvent(C,y),a){let A=y.sdkProcessingMetadata?.spanCountBeforeProcessing||0,B=y.spans?y.spans.length:0,q=A-B;q>0&&this.recordDroppedEvent("before_send","span",q)}let N=y.transaction_info;if(a&&N&&y.transaction!==e.transaction){let A="custom";y.transaction_info=Z(E({},N),{source:A})}return this.sendEvent(y,r),y}).then(null,y=>{throw Ad(y)||Rd(y)?y:(this.captureException(y,{data:{__sentry__:!0},originalException:y}),wa(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
17
|
+
Reason: ${y}`))})}_process(e){this._numProcessing++,e.then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([r,n])=>{let[o,i]=r.split(":");return{reason:o,category:i,quantity:n}})}_flushOutcomes(){ie&&ee.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){ie&&ee.log("No outcomes to send");return}if(!this._dsn){ie&&ee.log("No dsn provided, will not send outcomes");return}ie&&ee.log("Sending outcomes:",e);let r=Sd(e,this._options.tunnel&&En(this._dsn));this.sendEnvelope(r)}};function F_(t,e){let r=`${e} must return \`null\` or a valid event.`;if(en(t))return t.then(n=>{if(!Zr(n)&&n!==null)throw wa(r);return n},n=>{throw wa(`${e} rejected with ${n}`)});if(!Zr(t)&&t!==null)throw wa(r);return t}function H_(t,e,r,n){let{beforeSend:o,beforeSendTransaction:i,beforeSendSpan:s}=e,a=r;if(Mu(a)&&o)return o(a,n);if(Nd(a)){if(s){let l=s(Td(a));if(l?a=vn(r,Id(l)):Su(),a.spans){let f=[];for(let m of a.spans){let d=s(m);d?f.push(d):(Su(),f.push(m))}a.spans=f}}if(i){if(a.spans){let l=a.spans.length;a.sdkProcessingMetadata=Z(E({},r.sdkProcessingMetadata),{spanCountBeforeProcessing:l})}return i(a,n)}}return a}function Mu(t){return t.type===void 0}function Nd(t){return t.type==="transaction"}function $_(t){return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{items:t}]}function Pd(t,e,r,n){let o={};return e?.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),r&&n&&(o.dsn=En(n)),rn(o,[$_(t)])}function Gi(t,e){let r=e??V_(t)??[];if(r.length===0)return;let n=t.getOptions(),o=Pd(r,n._metadata,n.tunnel,t.getDsn());Ld().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(o)}function V_(t){return Ld().get(t)}function Ld(){return Qr("clientToLogBufferMap",()=>new WeakMap)}var Bu=Symbol.for("SentryBufferFullError");function Md(t){let e=[];function r(){return t===void 0||e.length<t}function n(s){return e.splice(e.indexOf(s),1)[0]||Promise.resolve(void 0)}function o(s){if(!r())return _n(Bu);let a=s();return e.indexOf(a)===-1&&e.push(a),a.then(()=>n(a)).then(null,()=>n(a).then(null,()=>{})),a}function i(s){return new vr((a,l)=>{let f=e.length;if(!f)return a(!0);let m=setTimeout(()=>{s&&s>0&&a(!1)},s);e.forEach(d=>{rr(d).then(()=>{--f||(clearTimeout(m),a(!0))},l)})})}return{$:e,add:o,drain:i}}function W_(t,e=Date.now()){let r=parseInt(`${t}`,10);if(!isNaN(r))return r*1e3;let n=Date.parse(`${t}`);return isNaN(n)?6e4:n-e}function j_(t,e){return t[e]||t.all||0}function Bd(t,e,r=Date.now()){return j_(t,e)>r}function Ud(t,{statusCode:e,headers:r},n=Date.now()){let o=E({},t),i=r?.["x-sentry-rate-limits"],s=r?.["retry-after"];if(i)for(let a of i.trim().split(",")){let[l,f,,,m]=a.split(":",5),d=parseInt(l,10),_=(isNaN(d)?60:d)*1e3;if(!f)o.all=n+_;else for(let y of f.split(";"))y==="metric_bucket"?(!m||m.split(";").includes("custom"))&&(o[y]=n+_):o[y]=n+_}else s?o.all=n+W_(s,n):e===429&&(o.all=n+60*1e3);return o}var G_=64;function Sa(t,e,r=Md(t.bufferSize||G_)){let n={},o=s=>r.drain(s);function i(s){let a=[];if(Cu(s,(d,_)=>{let y=Ru(_);Bd(n,y)?t.recordDroppedEvent("ratelimit_backoff",y):a.push(d)}),a.length===0)return rr({});let l=rn(s[0],a),f=d=>{Cu(l,(_,y)=>{t.recordDroppedEvent(d,Ru(y))})},m=()=>e({body:sd(l)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&ie&&ee.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),n=Ud(n,d),d),d=>{throw f("network_error"),ie&&ee.error("Encountered error running transport request:",d),d});return r.add(m).then(d=>d,d=>{if(d===Bu)return ie&&ee.error("Skipped sending event because buffer is full."),f("queue_overflow"),rr({});throw d})}return{send:i,flush:o}}function Uu(t){t.user?.ip_address===void 0&&(t.user=Z(E({},t.user),{ip_address:"{{auto}}"}))}function ku(t){"aggregates"in t?t.attrs?.ip_address===void 0&&(t.attrs=Z(E({},t.attrs),{ip_address:"{{auto}}"})):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function Fu(t,e,r=[e],n="npm"){let o=t._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${e}`,packages:r.map(i=>({name:`${n}:@sentry/${i}`,version:xr})),version:xr}),t._metadata=o}var q_=100;function Or(t,e){let r=We(),n=Dr();if(!r)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:i=q_}=r.getOptions();if(i<=0)return;let s=Ar(),a=E({timestamp:s},t),l=o?gn(()=>o(a,e)):a;l!==null&&(r.emit&&r.emit("beforeAddBreadcrumb",l,e),n.addBreadcrumb(l,i))}var kd,z_="FunctionToString",Fd=new WeakMap,Y_=()=>({name:z_,setupOnce(){kd=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=Yn(this),r=Fd.has(We())&&e!==void 0?e:this;return kd.apply(r,t)}}catch{}},setup(t){Fd.set(t,!0)}}),Ta=Y_;var K_=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],X_="EventFilters",Hu=(t={})=>{let e;return{name:X_,setup(r){let n=r.getOptions();e=Hd(t,n)},processEvent(r,n,o){if(!e){let i=o.getOptions();e=Hd(t,i)}return J_(r,e)?null:r}}},xa=(t={})=>Z(E({},Hu(t)),{name:"InboundFilters"});function Hd(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:K_],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function J_(t,e){if(t.type){if(t.type==="transaction"&&Z_(t,e.ignoreTransactions))return ie&&ee.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
18
18
|
Event: ${Cr(t)}`),!0}else{if(Q_(t,e.ignoreErrors))return ie&&ee.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
19
|
-
Event: ${Cr(t)}`),!0;if(
|
|
20
|
-
Event: ${Cr(t)}`),!0;if(
|
|
19
|
+
Event: ${Cr(t)}`),!0;if(nb(t))return ie&&ee.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
20
|
+
Event: ${Cr(t)}`),!0;if(eb(t,e.denyUrls))return ie&&ee.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
21
21
|
Event: ${Cr(t)}.
|
|
22
|
-
Url: ${Ia(t)}`),!0;if(!
|
|
22
|
+
Url: ${Ia(t)}`),!0;if(!tb(t,e.allowUrls))return ie&&ee.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
23
23
|
Event: ${Cr(t)}.
|
|
24
|
-
Url: ${Ia(t)}`),!0}return!1}function Q_(t,e){return e?.length?wa(t).some(r=>Ao(r,e)):!1}function Z_(t,e){if(!e?.length)return!1;let r=t.transaction;return r?Ao(r,e):!1}function ew(t,e){if(!e?.length)return!1;let r=Ia(t);return r?Ao(r,e):!1}function tw(t,e){if(!e?.length)return!0;let r=Ia(t);return r?Ao(r,e):!0}function rw(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Ia(t){try{let r=[...t.exception?.values??[]].reverse().find(n=>n.mechanism?.parent_id===void 0&&n.stacktrace?.frames?.length)?.stacktrace?.frames;return r?rw(r):null}catch{return ie&&ee.error(`Cannot extract url for event ${Cr(t)}`),null}}function nw(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function Vu(t,e,r,n,o,i){if(!o.exception?.values||!i||!gr(i.originalException,Error))return;let s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=$u(t,e,n,i.originalException,r,o.exception.values,s,0))}function $u(t,e,r,n,o,i,s,a){if(i.length>=r+1)return i;let l=[...i];if(gr(n[o],Error)){$d(s,a);let f=t(e,n[o]),m=l.length;Vd(f,o,m,a),l=$u(t,e,r,n[o],o,[f,...l],f,m)}return Array.isArray(n.errors)&&n.errors.forEach((f,m)=>{if(gr(f,Error)){$d(s,a);let d=t(e,f),_=l.length;Vd(d,`errors[${m}]`,_,a),l=$u(t,e,r,f,o,[d,...l],d,_)}}),l}function $d(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Z(E(E({},t.mechanism),t.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:e})}function Vd(t,e,r,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Z(E({},t.mechanism),{type:"chained",source:e,exception_id:r,parent_id:n})}function Wu(t){let e="console";Ot(e,t),Nt(e,ow)}function ow(){"console"in pe&&Kl.forEach(function(t){t in pe.console&&ct(pe.console,t,function(e){return xo[t]=e,function(...r){at("console",{args:r,level:t}),xo[t]?.apply(pe.console,r)}})})}function ju(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var iw="Dedupe",sw=()=>{let t;return{name:iw,processEvent(e){if(e.type)return e;try{if(aw(e,t))return ie&&ee.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Ca=sw;function aw(t,e){return e?!!(cw(t,e)||lw(t,e)):!1}function cw(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Gd(t,e)||!jd(t,e))}function lw(t,e){let r=Wd(e),n=Wd(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Gd(t,e)||!jd(t,e))}function jd(t,e){let r=ea(t),n=ea(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let o=0;o<n.length;o++){let i=n[o],s=r[o];if(i.filename!==s.filename||i.lineno!==s.lineno||i.colno!==s.colno||i.function!==s.function)return!1}return!0}function Gd(t,e){let r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Wd(t){return t.exception?.values?.[0]}function qi(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:r,hash:n,relative:e[5]+r+n}}function Ra(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var zi=pe;function Gu(){return"history"in zi&&!!zi.history}function uw(){if(!("fetch"in zi))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Yi(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function qu(){if(typeof EdgeRuntime=="string")return!0;if(!uw())return!1;if(Yi(zi.fetch))return!0;let t=!1,e=zi.document;if(e&&typeof e.createElement=="function")try{let r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),r.contentWindow?.fetch&&(t=Yi(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){ie&&ee.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}function Yu(t,e){let r="fetch";Ot(r,t),Nt(r,()=>fw(void 0,e))}function fw(t,e=!1){e&&!qu()||ct(pe,"fetch",function(r){return function(...n){let o=new Error,{method:i,url:s}=pw(n),a={args:n,fetchData:{method:i,url:s},startTimestamp:Ut()*1e3,virtualError:o,headers:mw(n)};return t||at("fetch",E({},a)),r.apply(pe,n).then(async l=>(t?t(l):at("fetch",Z(E({},a),{endTimestamp:Ut()*1e3,response:l})),l),l=>{if(at("fetch",Z(E({},a),{endTimestamp:Ut()*1e3,error:l})),Gn(l)&&l.stack===void 0&&(l.stack=o.stack,Vt(l,"framesToPop",1)),l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{let f=new URL(a.fetchData.url);l.message=`${l.message} (${f.host})`}catch{}throw l})}})}function zu(t,e){return!!t&&typeof t=="object"&&!!t[e]}function qd(t){return typeof t=="string"?t:t?zu(t,"url")?t.url:t.toString?t.toString():"":""}function pw(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[r,n]=t;return{url:qd(r),method:zu(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:qd(e),method:zu(e,"method")?String(e.method).toUpperCase():"GET"}}function mw(t){let[e,r]=t;try{if(typeof r=="object"&&r!==null&&"headers"in r&&r.headers)return new Headers(r.headers);if(Om(e))return new Headers(e.headers)}catch{}}function Ku(){return"npm"}var Ke=pe,Xu=0;function Ju(){return Xu>0}function Cw(){Xu++,setTimeout(()=>{Xu--})}function Kn(t,e={}){function r(o){return typeof o=="function"}if(!r(t))return t;try{let o=t.__sentry_wrapped__;if(o)return typeof o=="function"?o:t;if(Yn(t))return t}catch{return t}let n=function(...o){try{let i=o.map(s=>Kn(s,e));return t.apply(this,i)}catch(i){throw Cw(),Fi(s=>{s.addEventProcessor(a=>(e.mechanism&&(Do(a,void 0,void 0),Rr(a,e.mechanism)),a.extra=Z(E({},a.extra),{arguments:o}),a)),va(i)}),i}};try{for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}catch{}ia(n,t),Vt(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}function zd(){let t=ki(),{referrer:e}=Ke.document||{},{userAgent:r}=Ke.navigator||{},n=E(E({},e&&{Referer:e}),r&&{"User-Agent":r});return{url:t,headers:n}}function Aa(t,e){let r=ef(t,e),n={type:Nw(e),value:Pw(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function Rw(t,e,r,n){let i=We()?.getOptions().normalizeDepth,s=Bw(e),a={__serialized__:ma(e,i)};if(s)return{exception:{values:[Aa(t,s)]},extra:a};let l={exception:{values:[{type:zn(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:Lw(e,{isUnhandledRejection:n})}]},extra:a};if(r){let f=ef(t,r);f.length&&(l.exception.values[0].stacktrace={frames:f})}return l}function Qu(t,e){return{exception:{values:[Aa(t,e)]}}}function ef(t,e){let r=e.stacktrace||e.stack||"",n=Dw(e),o=Ow(e);try{return t(r,n,o)}catch{}return[]}var Aw=/Minified React error #\d+;/i;function Dw(t){return t&&Aw.test(t.message)?1:0}function Ow(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Yd(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function Nw(t){let e=t?.name;return!e&&Yd(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function Pw(t){let e=t?.message;return Yd(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Kd(t,e,r,n){let o=r?.syntheticException||void 0,i=Da(t,e,o,n);return Rr(i),i.level="error",r?.event_id&&(i.event_id=r.event_id),rr(i)}function Xd(t,e,r="info",n,o){let i=n?.syntheticException||void 0,s=Zu(t,e,i,o);return s.level=r,n?.event_id&&(s.event_id=n.event_id),rr(s)}function Da(t,e,r,n,o){let i;if(ra(e)&&e.error)return Qu(t,e.error);if(na(e)||ou(e)){let s=e;if("stack"in e)i=Qu(t,e);else{let a=s.name||(na(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;i=Zu(t,l,r,n),Do(i,l)}return"code"in s&&(i.tags=Z(E({},i.tags),{"DOMException.code":`${s.code}`})),i}return Gn(e)?Qu(t,e):Zr(e)||zn(e)?(i=Rw(t,e,r,o),Rr(i,{synthetic:!0}),i):(i=Zu(t,e,r,n),Do(i,`${e}`,void 0),Rr(i,{synthetic:!0}),i)}function Zu(t,e,r,n){let o={};if(n&&r){let i=ef(t,r);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]}),Rr(o,{synthetic:!0})}if(Ro(e)){let{__sentry_template_string__:i,__sentry_template_values__:s}=e;return o.logentry={message:i,params:s},o}return o.message=e,o}function Lw(t,{isUnhandledRejection:e}){let r=uu(t),n=e?"promise rejection":"exception";return ra(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:zn(t)?`Event \`${Mw(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Mw(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Bw(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}var Uw=5e3,Ki=class extends ji{constructor(e){let r=kw(e),n=Ke.SENTRY_SDK_SOURCE||Ku();Fu(r,"browser",["browser"],n),super(r);let{sendDefaultPii:o,sendClientReports:i,enableLogs:s,_experiments:a}=this._options,l=s??a?.enableLogs;Ke.document&&(i||l)&&Ke.document.addEventListener("visibilitychange",()=>{Ke.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),l&&Gi(this))}),l&&(this.on("flush",()=>{Gi(this)}),this.on("afterCaptureLog",()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{Gi(this)},Uw)})),o&&(this.on("postprocessEvent",Uu),this.on("beforeSendSession",ku))}eventFromException(e,r){return Kd(this._options.stackParser,e,r,this._options.attachStacktrace)}eventFromMessage(e,r="info",n){return Xd(this._options.stackParser,e,r,n,this._options.attachStacktrace)}_prepareEvent(e,r,n,o){return e.platform=e.platform||"javascript",super._prepareEvent(e,r,n,o)}};function kw(t){return E({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Ke.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},t)}var Jd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var ut=pe;var Fw=1e3,Qd,tf,rf;function nf(t){Ot("dom",t),Nt("dom",Hw)}function Hw(){if(!ut.document)return;let t=at.bind(null,"dom"),e=Zd(t,!0);ut.document.addEventListener("click",e,!1),ut.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let o=ut[r]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(ct(o,"addEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let f=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},m=f[s]=f[s]||{refCount:0};if(!m.handler){let d=Zd(t);m.handler=d,i.call(this,s,d,l)}m.refCount++}catch{}return i.call(this,s,a,l)}}),ct(o,"removeEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let f=this.__sentry_instrumentation_handlers__||{},m=f[s];m&&(m.refCount--,m.refCount<=0&&(i.call(this,s,m.handler,l),m.handler=void 0,delete f[s]),Object.keys(f).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,l)}}))})}function $w(t){if(t.type!==tf)return!1;try{if(!t.target||t.target._sentryId!==rf)return!1}catch{}return!0}function Vw(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function Zd(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=Ww(r);if(Vw(r.type,n))return;Vt(r,"_sentryCaptured",!0),n&&!n._sentryId&&Vt(n,"_sentryId",lt());let o=r.type==="keypress"?"input":r.type;$w(r)||(t({event:r,name:o,global:e}),tf=r.type,rf=n?n._sentryId:void 0),clearTimeout(Qd),Qd=ut.setTimeout(()=>{rf=void 0,tf=void 0},Fw)}}function Ww(t){try{return t.target}catch{return null}}var Oa;function Xi(t){let e="history";Ot(e,t),Nt(e,jw)}function jw(){if(ut.addEventListener("popstate",()=>{let e=ut.location.href,r=Oa;if(Oa=e,r===e)return;at("history",{from:r,to:e})}),!Gu())return;function t(e){return function(...r){let n=r.length>2?r[2]:void 0;if(n){let o=Oa,i=Gw(String(n));if(Oa=i,o===i)return e.apply(this,r);at("history",{from:o,to:i})}return e.apply(this,r)}}ct(ut.history,"pushState",t),ct(ut.history,"replaceState",t)}function Gw(t){try{return new URL(t,ut.location.origin).toString()}catch{return t}}var Na={};function of(t){let e=Na[t];if(e)return e;let r=ut[t];if(Yi(r))return Na[t]=r.bind(ut);let n=ut.document;if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i?.[t]&&(r=i[t]),n.head.removeChild(o)}catch(o){Jd&&ee.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return r&&(Na[t]=r.bind(ut))}function Pa(t){Na[t]=void 0}var Xn="__sentry_xhr_v3__";function sf(t){Ot("xhr",t),Nt("xhr",qw)}function qw(){if(!ut.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,r,n){let o=new Error,i=Ut()*1e3,s=Pt(n[0])?n[0].toUpperCase():void 0,a=zw(n[1]);if(!s||!a)return e.apply(r,n);r[Xn]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(r.__sentry_own_request__=!0);let l=()=>{let f=r[Xn];if(f&&r.readyState===4){try{f.status_code=r.status}catch{}let m={endTimestamp:Ut()*1e3,startTimestamp:i,xhr:r,virtualError:o};at("xhr",m)}};return"onreadystatechange"in r&&typeof r.onreadystatechange=="function"?r.onreadystatechange=new Proxy(r.onreadystatechange,{apply(f,m,d){return l(),f.apply(m,d)}}):r.addEventListener("readystatechange",l),r.setRequestHeader=new Proxy(r.setRequestHeader,{apply(f,m,d){let[_,y]=d,C=m[Xn];return C&&Pt(_)&&Pt(y)&&(C.request_headers[_.toLowerCase()]=y),f.apply(m,d)}}),e.apply(r,n)}}),t.send=new Proxy(t.send,{apply(e,r,n){let o=r[Xn];if(!o)return e.apply(r,n);n[0]!==void 0&&(o.body=n[0]);let i={startTimestamp:Ut()*1e3,xhr:r};return at("xhr",i),e.apply(r,n)}})}function zw(t){if(Pt(t))return t;try{return t.toString()}catch{}}function af(t,e=of("fetch")){let r=0,n=0;function o(i){let s=i.body.length;r+=s,n++;let a=E({body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return Pa("fetch"),_n("No fetch implementation available");try{return e(t.url,a).then(l=>(r-=s,n--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return Pa("fetch"),r-=s,n--,_n(l)}}return Sa(t,o)}var Yw=30;var Kw=50;function cf(t,e,r,n){let o={filename:t,function:e==="<anonymous>"?"?":e,in_app:!0};return r!==void 0&&(o.lineno=r),n!==void 0&&(o.colno=n),o}var Xw=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Jw=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Qw=/\((\S*)(?::(\d+))(?::(\d+))\)/,Zw=t=>{let e=Xw.exec(t);if(e){let[,n,o,i]=e;return cf(n,"?",+o,+i)}let r=Jw.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=Qw.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[o,i]=nh(r[1]||"?",r[2]);return cf(i,o,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},eh=[Yw,Zw],eb=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tb=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,rb=t=>{let e=eb.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=tb.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let n=e[3],o=e[1]||"?";return[o,n]=nh(o,n),cf(n,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},th=[Kw,rb];var rh=[eh,th],lf=Zl(...rh),nh=(t,e)=>{let r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:"?",r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var Lo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var La=1024,nb="Breadcrumbs",ob=(t={})=>{let e=E({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:nb,setup(r){e.console&&Wu(ab(r)),e.dom&&nf(sb(r,e.dom)),e.xhr&&sf(cb(r)),e.fetch&&Yu(lb(r)),e.history&&Xi(ub(r)),e.sentry&&r.on("beforeSendEvent",ib(r))}}},oh=ob;function ib(t){return function(r){We()===t&&Or({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:Cr(r)},{event:r})}}function sb(t,e){return function(n){if(We()!==t)return;let o,i,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>La&&(Lo&&ee.warn(`\`dom.maxStringLength\` cannot exceed ${La}, but a value of ${a} was configured. Sentry will use ${La} instead.`),a=La),typeof s=="string"&&(s=[s]);try{let f=n.event,m=fb(f)?f.target:f;o=Ui(m,{keyAttrs:s,maxStringLength:a}),i=lu(m)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${n.name}`,message:o};i&&(l.data={"ui.component_name":i}),Or(l,{event:n.event,name:n.name,global:n.global})}}function ab(t){return function(r){if(We()!==t)return;let n={category:"console",data:{arguments:r.args,logger:"console"},level:ju(r.level),message:oa(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)n.message=`Assertion failed: ${oa(r.args.slice(1)," ")||"console.assert"}`,n.data.arguments=r.args.slice(1);else return;Or(n,{input:r.args,level:r.level})}}function cb(t){return function(r){if(We()!==t)return;let{startTimestamp:n,endTimestamp:o}=r,i=r.xhr[Xn];if(!n||!o||!i)return;let{method:s,url:a,status_code:l,body:f}=i,m={method:s,url:a,status_code:l},d={xhr:r.xhr,input:f,startTimestamp:n,endTimestamp:o},_={category:"xhr",data:m,type:"http",level:Ra(l)};t.emit("beforeOutgoingRequestBreadcrumb",_,d),Or(_,d)}}function lb(t){return function(r){if(We()!==t)return;let{startTimestamp:n,endTimestamp:o}=r;if(o&&!(r.fetchData.url.match(/sentry_key/)&&r.fetchData.method==="POST"))if(r.fetchData.method,r.fetchData.url,r.error){let i=r.fetchData,s={data:r.error,input:r.args,startTimestamp:n,endTimestamp:o},a={category:"fetch",data:i,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",a,s),Or(a,s)}else{let i=r.response,s=Z(E({},r.fetchData),{status_code:i?.status});r.fetchData.request_body_size,r.fetchData.response_body_size,i?.status;let a={input:r.args,response:i,startTimestamp:n,endTimestamp:o},l={category:"fetch",data:s,type:"http",level:Ra(s.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",l,a),Or(l,a)}}}function ub(t){return function(r){if(We()!==t)return;let n=r.from,o=r.to,i=qi(Ke.location.href),s=n?qi(n):void 0,a=qi(o);s?.path||(s=i),i.protocol===a.protocol&&i.host===a.host&&(o=a.relative),i.protocol===s.protocol&&i.host===s.host&&(n=s.relative),Or({category:"navigation",data:{from:n,to:o}})}}function fb(t){return!!t&&!!t.target}var pb=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],mb="BrowserApiErrors",db=(t={})=>{let e=E({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},t);return{name:mb,setupOnce(){e.setTimeout&&ct(Ke,"setTimeout",ih),e.setInterval&&ct(Ke,"setInterval",ih),e.requestAnimationFrame&&ct(Ke,"requestAnimationFrame",hb),e.XMLHttpRequest&&"XMLHttpRequest"in Ke&&ct(XMLHttpRequest.prototype,"send",gb);let r=e.eventTarget;r&&(Array.isArray(r)?r:pb).forEach(o=>yb(o,e))}}},sh=db;function ih(t){return function(...e){let r=e[0];return e[0]=Kn(r,{mechanism:{data:{function:er(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function hb(t){return function(e){return t.apply(this,[Kn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:er(t)},handled:!1,type:"instrument"}})])}}function gb(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in r&&typeof r[o]=="function"&&ct(r,o,function(i){let s={mechanism:{data:{function:o,handler:er(i)},handled:!1,type:"instrument"}},a=Yn(i);return a&&(s.mechanism.data.handler=er(a)),Kn(i,s)})}),t.apply(this,e)}}function yb(t,e){let n=Ke[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(ct(n,"addEventListener",function(o){return function(i,s,a){try{vb(s)&&(s.handleEvent=Kn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:er(s),target:t},handled:!1,type:"instrument"}}))}catch{}return e.unregisterOriginalCallbacks&&Eb(this,i,s),o.apply(this,[i,Kn(s,{mechanism:{data:{function:"addEventListener",handler:er(s),target:t},handled:!1,type:"instrument"}}),a])}}),ct(n,"removeEventListener",function(o){return function(i,s,a){try{let l=s.__sentry_wrapped__;l&&o.call(this,i,l,a)}catch{}return o.call(this,i,s,a)}}))}function vb(t){return typeof t.handleEvent=="function"}function Eb(t,e,r){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,r)}var ah=()=>({name:"BrowserSession",setupOnce(){if(typeof Ke.document>"u"){Lo&&ee.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Vi({ignoreDuration:!0}),Wi(),Xi(({from:t,to:e})=>{t!==void 0&&t!==e&&(Vi({ignoreDuration:!0}),Wi())})}});var _b="GlobalHandlers",wb=(t={})=>{let e=E({onerror:!0,onunhandledrejection:!0},t);return{name:_b,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&(bb(r),ch("onerror")),e.onunhandledrejection&&(Sb(r),ch("onunhandledrejection"))}}},lh=wb;function bb(t){tu(e=>{let{stackParser:r,attachStacktrace:n}=uh();if(We()!==t||Ju())return;let{msg:o,url:i,line:s,column:a,error:l}=e,f=xb(Da(r,l||o,void 0,n,!1),i,s,a);f.level="error",$i(f,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}function Sb(t){nu(e=>{let{stackParser:r,attachStacktrace:n}=uh();if(We()!==t||Ju())return;let o=Tb(e),i=qn(o)?Ib(o):Da(r,o,void 0,n,!0);i.level="error",$i(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function Tb(t){if(qn(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function Ib(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function xb(t,e,r,n){let o=t.exception=t.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[],f=n,m=r,d=Pt(e)&&e.length>0?e:ki();return l.length===0&&l.push({colno:f,filename:d,function:"?",in_app:!0,lineno:m}),t}function ch(t){Lo&&ee.log(`Global Handler attached: ${t}`)}function uh(){return We()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var fh=()=>({name:"HttpContext",preprocessEvent(t){if(!Ke.navigator&&!Ke.location&&!Ke.document)return;let e=zd(),r=E(E({},e.headers),t.request?.headers);t.request=Z(E(E({},e),t.request),{headers:r})}});var Cb="cause",Rb=5,Ab="LinkedErrors",Db=(t={})=>{let e=t.limit||Rb,r=t.key||Cb;return{name:Ab,preprocessEvent(n,o,i){let s=i.getOptions();Vu(Aa,s.stackParser,r,e,n,o)}}},ph=Db;function uf(t){return[xa(),Ta(),sh(),oh(),lh(),ph(),Ca(),fh(),ah()]}var Ba={},Ua,ff,mh;(()=>{let t=uf({}).filter(e=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(e.name));ff=new Ki({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:af,stackParser:lf,integrations:t,environment:dr.mode,release:`web-sdk@${Vs}`,debug:dr.debug,sampleRate:.5}),ff.init()})();function ae(t,e,r){w.error(`${e}:`,t);let n=gh(r);if(n.setTag("operation",e),t instanceof Zt){Ob(n,t,e);return}n.captureException(t)}function dh(t,e,r){gh(r).captureMessage(t,e??"error")}function Ob(t,e,r){if(Nb(t,e),e.response){let n=e.response,o=e.responseText;t.setTag("error.message",e.message),n.status!=null&&t.setTag("http.status_code",n.status),n.statusText&&t.setTag("http.status_text",n.statusText),o&&typeof o=="object"&&"error"in o&&(t.setTag("http.error_code",o.error.code),t.setTag("http.error_message",o.error.message)),t.setExtras({responseText:e.responseText,statusText:n.statusText,responseType:n.type,redirected:n.redirected,responseUrl:n.url,originalError:e.message}),t.captureMessage(`${r} failed with ${n.status}`,"error");return}if(e.request){t.captureMessage(`No response was received for ${r}`,"error");return}}function Nb(t,e){let r=e.request;if(!r)return;t.setExtras({body:e.requestBody,headers:r.headers,method:r.method,url:r.url});let n=r.headers?.get("Cooee-Retry-Attempt");n!==null&&t.setTag("retry.attempt",n)}function hh(t){mh=t}function ka(t,e){Ba[t]=E(E({},Ba[t]),e)}function Mo(t){Ua=E(E({},Ua),t)}function gh(t){t??={};let{extra:e,tags:r}=t,n=new wt;if(n.setClient(ff),n.setUser(mh),t.triggerContext&&!t.engagementTrigger&&(t.engagementTrigger=t.triggerContext.triggerData),t.engagementTrigger){let o=t.engagementTrigger;n.setTags({"engagement.id":o.engagementID,"engagement.short_id":o.shortID,"engagement.objective":o.objective,"engagement.delivery_type":o.onsiteDeliveryType,"engagement.content_id":o.contentID,"engagement.variation":o.variation,"engagement.currency":o.currency})}return e&&n.setExtras(e),r&&n.setTags(r),Ua&&n.setTags(Ua),Object.keys(Ba).forEach(o=>{n.setContext(o,Ba[o])}),n.setTag("language",navigator.language),n.setTag("timezone",yh()),Pb(n),n}function Pb(t){window.Shopify&&(t.setTag("shopify.shop",window.Shopify.shop),t.setTag("shopify.currency",window.Shopify.currency?.active),t.setTag("shopify.locale",window.Shopify.locale),t.setTag("theme.schema_name",window.Shopify.theme?.schema_name),t.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}var Fa=class{static format(e,r){let n=/{{\s*(\w+)\s*}}/;return r.replace(n,(o,i)=>{switch(i){case"amount":return this.formatWithDelimiters(e,2);case"amount_no_decimals":return this.formatWithDelimiters(e,0);case"amount_with_comma_separator":return this.formatWithDelimiters(e,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(e,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(e,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(e,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(e,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(e,2," ",".");default:return o}})}static formatWithDelimiters(e,r=2,n=",",o="."){if(isNaN(e)||e==null)return"0";let s=(e/100).toFixed(r).split("."),a=s[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+n),l=s[1]?o+s[1]:"";return a+l}};function Uo(t){try{return new URL(t)}catch{return}}function pf(t){return!t||t==="null"||t==="undefined"}function vh(t,e){let r=t.indexOf(e);return r===-1?!1:(t.splice(r,1),!0)}function Lt(t,e,r){return{[t]:mf(e,r),[t+"_wo_currency"]:e}}function mf(t,e){if(t==0&&e)return"Free";let r=fe(),n=ze.get(),o=r.shopCurrencyCode||n.currency,i=r.currencyCode;i||w.warn("Currency code is not set in RuntimeData");let s=n.money?.format??r.moneyFormat,a;if(s&&o===i)a=Fa.format(t*100,s);else{let l;try{l=new Intl.NumberFormat(_h(),{style:"currency",currency:i||o,minimumFractionDigits:0,maximumFractionDigits:2})}catch(f){return ae(f,"format-currency",{extra:{currentCurrency:i,shopCurrency:o}}),""}a=l.format(t),a=a.replace("\u20B9","Rs. "),n.money?.showCurrency&&i!=="INR"&&(a=a.concat(` ${i}`))}return a}function Eh(t){let e=_h();try{return new Intl.NumberFormat(e,{notation:"compact"}).format(t)}catch(r){return ae(r,"format-number",{extra:{lang:e,value:t}}),t.toString()}}function _h(){let t="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?t=navigator.languages[0]:navigator.language&&(t=navigator.language)),t=t.split(";")[0],t=t.split("-")[0],t||"en"}var Ha;function yh(){if(Ha)return Ha;try{return Ha=Intl.DateTimeFormat().resolvedOptions().timeZone,Ha}catch{return""}}function bn(t){document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t)}function Er(t){let e=document.createElement("span");e.id="snackbar",e.innerText=t,document.body.appendChild(e),e.className="show",setTimeout(()=>{e.classList.remove("show"),document.body.removeChild(e)},5e3)}async function df(t,e=7,r=document){let n=1,o=document.querySelectorAll("nonexistent-tag");for(;n<=e;){let i=Math.min(50*2**n,1e3);if(n>1&&await _t.sleep(i),o=r.querySelectorAll(t),o.length)return w.verbose(`Attempt ${n}: ${o.length} elements found with ${t}`),o;w.verbose(`Attempt ${n}: Elements not found with ${t}. Will retry after ${i}ms.`),n++}return w.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${t}.`),o}async function Sn(t,e=10,r=document){return(await df(t,e,r)).item(0)}async function hf(t){let[e,r,n]=await Promise.all([Ye.get("did"),It.get("id",""),Ye.get("sessionNumber",1)]),o={letscooee_did:e,letscooee_sid:r,letscooee_sn:`${n}`,__letscooee_time:new Date().toLocaleString()};return t&&(o.__letscooee_via=t),o}async function $a(t){let e=await hf(t);return Object.entries(e).map(([r,n])=>({key:r,value:n.toString()}))}function Nr(t,e,r,n=!1){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:n,value:r})}function wh(t){if(t%100>=11&&t%100<=13)return t+"th";switch(t%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd";default:return t+"th"}}var Ga,Te,xh,vf,Jn,bh,Ch,Rh,Ah,Ef,gf,yf,Lb,Ji={},Dh=[],Mb=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qa=Array.isArray;function nn(t,e){for(var r in e)t[r]=e[r];return t}function _f(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function wf(t,e,r){var n,o,i,s={};for(i in e)i=="key"?n=e[i]:i=="ref"?o=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?Ga.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)s[i]===void 0&&(s[i]=t.defaultProps[i]);return Wa(t,s,n,o,null)}function Wa(t,e,r,n,o){var i={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++xh,__i:-1,__u:0};return o==null&&Te.vnode!=null&&Te.vnode(i),i}function Lr(t){return t.children}function Pr(t,e){this.props=t,this.context=e}function ko(t,e){if(e==null)return t.__?ko(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?ko(t):null}function Oh(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return Oh(t)}}function Sh(t){(!t.__d&&(t.__d=!0)&&Jn.push(t)&&!ja.__r++||bh!=Te.debounceRendering)&&((bh=Te.debounceRendering)||Ch)(ja)}function ja(){for(var t,e,r,n,o,i,s,a=1;Jn.length;)Jn.length>a&&Jn.sort(Rh),t=Jn.shift(),a=Jn.length,t.__d&&(r=void 0,o=(n=(e=t).__v).__e,i=[],s=[],e.__P&&((r=nn({},n)).__v=n.__v+1,Te.vnode&&Te.vnode(r),bf(e.__P,r,n,e.__n,e.__P.namespaceURI,32&n.__u?[o]:null,i,o??ko(n),!!(32&n.__u),s),r.__v=n.__v,r.__.__k[r.__i]=r,Lh(i,r,s),r.__e!=o&&Oh(r)));ja.__r=0}function Nh(t,e,r,n,o,i,s,a,l,f,m){var d,_,y,C,N,A,B=n&&n.__k||Dh,q=e.length;for(l=Bb(r,e,B,l,q),d=0;d<q;d++)(y=r.__k[d])!=null&&(_=y.__i==-1?Ji:B[y.__i]||Ji,y.__i=d,A=bf(t,y,_,o,i,s,a,l,f,m),C=y.__e,y.ref&&_.ref!=y.ref&&(_.ref&&Sf(_.ref,null,y),m.push(y.ref,y.__c||C,y)),N==null&&C!=null&&(N=C),4&y.__u||_.__k===y.__k?l=Ph(y,l,t):typeof y.type=="function"&&A!==void 0?l=A:C&&(l=C.nextSibling),y.__u&=-7);return r.__e=N,l}function Bb(t,e,r,n,o){var i,s,a,l,f,m=r.length,d=m,_=0;for(t.__k=new Array(o),i=0;i<o;i++)(s=e[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(l=i+_,(s=t.__k[i]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Wa(null,s,null,null,null):qa(s)?Wa(Lr,{children:s},null,null,null):s.constructor==null&&s.__b>0?Wa(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,a=null,(f=s.__i=Ub(s,r,l,d))!=-1&&(d--,(a=r[f])&&(a.__u|=2)),a==null||a.__v==null?(f==-1&&(o>m?_--:o<m&&_++),typeof s.type!="function"&&(s.__u|=4)):f!=l&&(f==l-1?_--:f==l+1?_++:(f>l?_--:_++,s.__u|=4))):t.__k[i]=null;if(d)for(i=0;i<m;i++)(a=r[i])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=ko(a)),Bh(a,a));return n}function Ph(t,e,r){var n,o;if(typeof t.type=="function"){for(n=t.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=t,e=Ph(n[o],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=ko(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Ub(t,e,r,n){var o,i,s=t.key,a=t.type,l=e[r];if(l===null&&t.key==null||l&&s==l.key&&a==l.type&&(2&l.__u)==0)return r;if(n>(l!=null&&(2&l.__u)==0?1:0))for(o=r-1,i=r+1;o>=0||i<e.length;){if(o>=0){if((l=e[o])&&(2&l.__u)==0&&s==l.key&&a==l.type)return o;o--}if(i<e.length){if((l=e[i])&&(2&l.__u)==0&&s==l.key&&a==l.type)return i;i++}}return-1}function Th(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||Mb.test(e)?r:r+"px"}function Va(t,e,r,n,o){var i,s;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Th(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||Th(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Ah,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=r,r?n?r.u=n.u:(r.u=Ef,t.addEventListener(e,i?yf:gf,i)):t.removeEventListener(e,i?yf:gf,i);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Ih(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Ef++;else if(e.t<r.u)return;return r(Te.event?Te.event(e):e)}}}function bf(t,e,r,n,o,i,s,a,l,f){var m,d,_,y,C,N,A,B,q,P,Q,Ee,X,ce,se,de,Le,Se=e.type;if(e.constructor!=null)return null;128&r.__u&&(l=!!(32&r.__u),i=[a=e.__e=r.__e]),(m=Te.__b)&&m(e);e:if(typeof Se=="function")try{if(B=e.props,q="prototype"in Se&&Se.prototype.render,P=(m=Se.contextType)&&n[m.__c],Q=m?P?P.props.value:m.__:n,r.__c?A=(d=e.__c=r.__c).__=d.__E:(q?e.__c=d=new Se(B,Q):(e.__c=d=new Pr(B,Q),d.constructor=Se,d.render=Fb),P&&P.sub(d),d.props=B,d.state||(d.state={}),d.context=Q,d.__n=n,_=d.__d=!0,d.__h=[],d._sb=[]),q&&d.__s==null&&(d.__s=d.state),q&&Se.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=nn({},d.__s)),nn(d.__s,Se.getDerivedStateFromProps(B,d.__s))),y=d.props,C=d.state,d.__v=e,_)q&&Se.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),q&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(q&&Se.getDerivedStateFromProps==null&&B!==y&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(B,Q),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(B,d.__s,Q)===!1||e.__v==r.__v){for(e.__v!=r.__v&&(d.props=B,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(Re){Re&&(Re.__=e)}),Ee=0;Ee<d._sb.length;Ee++)d.__h.push(d._sb[Ee]);d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(B,d.__s,Q),q&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(y,C,N)})}if(d.context=Q,d.props=B,d.__P=t,d.__e=!1,X=Te.__r,ce=0,q){for(d.state=d.__s,d.__d=!1,X&&X(e),m=d.render(d.props,d.state,d.context),se=0;se<d._sb.length;se++)d.__h.push(d._sb[se]);d._sb=[]}else do d.__d=!1,X&&X(e),m=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++ce<25);d.state=d.__s,d.getChildContext!=null&&(n=nn(nn({},n),d.getChildContext())),q&&!_&&d.getSnapshotBeforeUpdate!=null&&(N=d.getSnapshotBeforeUpdate(y,C)),de=m,m!=null&&m.type===Lr&&m.key==null&&(de=Mh(m.props.children)),a=Nh(t,qa(de)?de:[de],e,r,n,o,i,s,a,l,f),d.base=e.__e,e.__u&=-161,d.__h.length&&s.push(d),A&&(d.__E=d.__=null)}catch(Re){if(e.__v=null,l||i!=null)if(Re.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,e.__e=a}else for(Le=i.length;Le--;)_f(i[Le]);else e.__e=r.__e,e.__k=r.__k;Te.__e(Re,e,r)}else i==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=kb(r.__e,e,r,n,o,i,s,l,f);return(m=Te.diffed)&&m(e),128&e.__u?void 0:a}function Lh(t,e,r){for(var n=0;n<r.length;n++)Sf(r[n],r[++n],r[++n]);Te.__c&&Te.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(i){i.call(o)})}catch(i){Te.__e(i,o.__v)}})}function Mh(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:qa(t)?t.map(Mh):nn({},t)}function kb(t,e,r,n,o,i,s,a,l){var f,m,d,_,y,C,N,A=r.props,B=e.props,q=e.type;if(q=="svg"?o="http://www.w3.org/2000/svg":q=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f<i.length;f++)if((y=i[f])&&"setAttribute"in y==!!q&&(q?y.localName==q:y.nodeType==3)){t=y,i[f]=null;break}}if(t==null){if(q==null)return document.createTextNode(B);t=document.createElementNS(o,q,B.is&&B),a&&(Te.__m&&Te.__m(e,i),a=!1),i=null}if(q==null)A===B||a&&t.data==B||(t.data=B);else{if(i=i&&Ga.call(t.childNodes),A=r.props||Ji,!a&&i!=null)for(A={},f=0;f<t.attributes.length;f++)A[(y=t.attributes[f]).name]=y.value;for(f in A)if(y=A[f],f!="children"){if(f=="dangerouslySetInnerHTML")d=y;else if(!(f in B)){if(f=="value"&&"defaultValue"in B||f=="checked"&&"defaultChecked"in B)continue;Va(t,f,null,y,o)}}for(f in B)y=B[f],f=="children"?_=y:f=="dangerouslySetInnerHTML"?m=y:f=="value"?C=y:f=="checked"?N=y:a&&typeof y!="function"||A[f]===y||Va(t,f,y,A[f],o);if(m)a||d&&(m.__html==d.__html||m.__html==t.innerHTML)||(t.innerHTML=m.__html),e.__k=[];else if(d&&(t.innerHTML=""),Nh(e.type=="template"?t.content:t,qa(_)?_:[_],e,r,n,q=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:r.__k&&ko(r,0),a,l),i!=null)for(f=i.length;f--;)_f(i[f]);a||(f="value",q=="progress"&&C==null?t.removeAttribute("value"):C!=null&&(C!==t[f]||q=="progress"&&!C||q=="option"&&C!=A[f])&&Va(t,f,C,A[f],o),f="checked",N!=null&&N!=t[f]&&Va(t,f,N,A[f],o))}return t}function Sf(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(o){Te.__e(o,r)}}function Bh(t,e,r){var n,o;if(Te.unmount&&Te.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||Sf(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){Te.__e(i,e)}n.base=n.__P=null}if(n=t.__k)for(o=0;o<n.length;o++)n[o]&&Bh(n[o],e,r||typeof t.type!="function");r||_f(t.__e),t.__c=t.__=t.__e=void 0}function Fb(t,e,r){return this.constructor(t,r)}function Uh(t,e,r){var n,o,i,s;e==document&&(e=document.documentElement),Te.__&&Te.__(t,e),o=(n=typeof r=="function")?null:r&&r.__k||e.__k,i=[],s=[],bf(e,t=(!n&&r||e).__k=wf(Lr,null,[t]),o||Ji,Ji,e.namespaceURI,!n&&r?[r]:o?null:e.firstChild?Ga.call(e.childNodes):null,i,!n&&r?r:o?o.__e:e.firstChild,n,s),Lh(i,t,s)}Ga=Dh.slice,Te={__e:function(t,e,r,n){for(var o,i,s;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(t)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,n||{}),s=o.__d),s)return o.__E=o}catch(a){t=a}throw t}},xh=0,vf=function(t){return t!=null&&t.constructor==null},Pr.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=nn({},this.state),typeof t=="function"&&(t=t(nn({},r),this.props)),t&&nn(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Sh(this))},Pr.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Sh(this))},Pr.prototype.render=Lr,Jn=[],Ch=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Rh=function(t,e){return t.__v.__b-e.__v.__b},ja.__r=0,Ah=/(PointerCapture)$|Capture$/i,Ef=0,gf=Ih(!1),yf=Ih(!0),Lb=0;var If,Wt,Tf,kh,Fh=0,zh=[],ft=Te,Hh=ft.__b,$h=ft.__r,Vh=ft.diffed,Wh=ft.__c,jh=ft.unmount,Gh=ft.__;function Hb(t,e){ft.__h&&ft.__h(Wt,t,Fh||e),Fh=0;var r=Wt.__H||(Wt.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Cf(t,e){var r=Hb(If++,7);return Wb(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function $b(){for(var t;t=zh.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(za),t.__H.__h.forEach(xf),t.__H.__h=[]}catch(e){t.__H.__h=[],ft.__e(e,t.__v)}}ft.__b=function(t){Wt=null,Hh&&Hh(t)},ft.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Gh&&Gh(t,e)},ft.__r=function(t){$h&&$h(t),If=0;var e=(Wt=t.__c).__H;e&&(Tf===Wt?(e.__h=[],Wt.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.forEach(za),e.__h.forEach(xf),e.__h=[],If=0)),Tf=Wt},ft.diffed=function(t){Vh&&Vh(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(zh.push(e)!==1&&kh===ft.requestAnimationFrame||((kh=ft.requestAnimationFrame)||Vb)($b)),e.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Tf=Wt=null},ft.__c=function(t,e){e.some(function(r){try{r.__h.forEach(za),r.__h=r.__h.filter(function(n){return!n.__||xf(n)})}catch(n){e.some(function(o){o.__h&&(o.__h=[])}),e=[],ft.__e(n,r.__v)}}),Wh&&Wh(t,e)},ft.unmount=function(t){jh&&jh(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{za(n)}catch(o){e=o}}),r.__H=void 0,e&&ft.__e(e,r.__v))};var qh=typeof requestAnimationFrame=="function";function Vb(t){var e,r=function(){clearTimeout(n),qh&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);qh&&(e=requestAnimationFrame(r))}function za(t){var e=Wt,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Wt=e}function xf(t){var e=Wt;t.__c=t.__(),Wt=e}function Wb(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}var jb=Symbol.for("preact-signals");function Af(){if(Fo>1)Fo--;else{for(var t,e=!1;Qi!==void 0;){var r=Qi;for(Qi=void 0,Rf++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Kh(r))try{r.c()}catch(o){e||(t=o,e=!0)}r=n}}if(Rf=0,Fo--,e)throw t}}var Fe=void 0;var Qi=void 0,Fo=0,Rf=0,Ya=0;function Yh(t){if(Fe!==void 0){var e=t.n;if(e===void 0||e.t!==Fe)return e={i:0,S:t,p:Fe.s,n:void 0,t:Fe,e:void 0,x:void 0,r:e},Fe.s!==void 0&&(Fe.s.n=e),Fe.s=e,t.n=e,32&Fe.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Fe.s,e.n=void 0,Fe.s.n=e,Fe.s=e),e}}function pt(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}pt.prototype.brand=jb;pt.prototype.h=function(){return!0};pt.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};pt.prototype.U=function(t){if(this.t!==void 0){var e=t.e,r=t.x;e!==void 0&&(e.x=r,t.e=void 0),r!==void 0&&(r.e=e,t.x=void 0),t===this.t&&(this.t=r)}};pt.prototype.subscribe=function(t){var e=this;return bt(function(){var r=e.value,n=Fe;Fe=void 0;try{t(r)}finally{Fe=n}})};pt.prototype.valueOf=function(){return this.value};pt.prototype.toString=function(){return this.value+""};pt.prototype.toJSON=function(){return this.value};pt.prototype.peek=function(){var t=Fe;Fe=void 0;try{return this.value}finally{Fe=t}};Object.defineProperty(pt.prototype,"value",{get:function(){var t=Yh(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Rf>100)throw new Error("Cycle detected");this.v=t,this.i++,Ya++,Fo++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Af()}}}});function nr(t){return new pt(t)}function Kh(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Xh(t){for(var e=t.s;e!==void 0;e=e.n){var r=e.S.n;if(r!==void 0&&(e.r=r),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Jh(t){for(var e=t.s,r=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):r=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=r}function Ho(t){pt.call(this,void 0),this.x=t,this.s=void 0,this.g=Ya-1,this.f=4}(Ho.prototype=new pt).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ya))return!0;if(this.g=Ya,this.f|=1,this.i>0&&!Kh(this))return this.f&=-2,!0;var t=Fe;try{Xh(this),Fe=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Fe=t,Jh(this),this.f&=-2,!0};Ho.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}pt.prototype.S.call(this,t)};Ho.prototype.U=function(t){if(this.t!==void 0&&(pt.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};Ho.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(Ho.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Yh(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Df(t){return new Ho(t)}function Qh(t){var e=t.u;if(t.u=void 0,typeof e=="function"){Fo++;var r=Fe;Fe=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Of(t),n}finally{Fe=r,Af()}}}function Of(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Qh(t)}function Gb(t){if(Fe!==this)throw new Error("Out-of-order effect");Jh(this),Fe=t,this.f&=-2,8&this.f&&Of(this),Af()}function Zi(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Zi.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};Zi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Qh(this),Xh(this),Fo++;var t=Fe;return Fe=this,Gb.bind(this,t)};Zi.prototype.N=function(){2&this.f||(this.f|=2,this.o=Qi,Qi=this)};Zi.prototype.d=function(){this.f|=8,1&this.f||Of(this)};function bt(t){var e=new Zi(t);try{e.c()}catch(r){throw e.d(),r}return e.d.bind(e)}var Pf,Nf;function $o(t,e){Te[t]=e.bind(null,Te[t]||function(){})}function Ka(t){Nf&&Nf(),Nf=t&&t.S()}function Zh(t){var e=this,r=t.data,n=zb(r);n.value=r;var o=Cf(function(){for(var i=e.__v;i=i.__;)if(i.__c){i.__c.__$f|=4;break}return e.__$u.c=function(){var s,a=e.__$u.S(),l=o.value;a(),vf(l)||((s=e.base)==null?void 0:s.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=l},Df(function(){var s=n.value.value;return s===0?0:s===!0?"":s||""})},[]);return o.value}Zh.displayName="_st";Object.defineProperties(pt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Zh},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});$o("__b",function(t,e){if(typeof e.type=="string"){var r,n=e.props;for(var o in n)if(o!=="children"){var i=n[o];i instanceof pt&&(r||(e.__np=r={}),r[o]=i,n[o]=i.peek())}}t(e)});$o("__r",function(t,e){Ka();var r,n=e.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=(function(o){var i;return bt(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i})())),Pf=n,Ka(r),t(e)});$o("__e",function(t,e,r,n){Ka(),Pf=void 0,t(e,r,n)});$o("diffed",function(t,e){Ka(),Pf=void 0;var r;if(typeof e.type=="string"&&(r=e.__e)){var n=e.__np,o=e.props;if(n){var i=r.U;if(i)for(var s in i){var a=i[s];a!==void 0&&!(s in n)&&(a.d(),i[s]=void 0)}else r.U=i={};for(var l in n){var f=i[l],m=n[l];f===void 0?(f=qb(r,l,m,o),i[l]=f):f.o(m,o)}}}t(e)});function qb(t,e,r,n){var o=e in t&&t.ownerSVGElement===void 0,i=nr(r);return{o:function(s,a){i.value=s,n=a},d:bt(function(){var s=i.value.value;n[e]!==s&&(n[e]=s,o?t[e]=s:s?t.setAttribute(e,s):t.removeAttribute(e))})}}$o("unmount",function(t,e){if(typeof e.type=="string"){var r=e.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var o in n){var i=n[o];i&&i.d()}}}}else{var s=e.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}t(e)});$o("__h",function(t,e,r,n){(n<3||n===9)&&(e.__$f|=2),t(e,r,n)});Pr.prototype.shouldComponentUpdate=function(t,e){var r=this.__$u,n=r&&r.s!==void 0;for(var o in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(n||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var i in t)if(i!=="__source"&&t[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};function zb(t){return Cf(function(){return nr(t)},[])}var Xa=class{url;alt;constructor(e){e.alt&&(this.alt=e.alt),this.url=e.url}};var Ja=class{d;cmp;effective;constructor(e={}){this.d=e.d,this.cmp=e.cmp,this.effective=this.d}};var Lf=class{id;mID;name;groupID;groupName;isSelected;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.name=e.name,this.groupID=e.groupID,this.groupName=e.groupName,this.isSelected=e.isSelected??!1}},Mr=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedOptions;selectedSellingPlan;effectivePrice;constructor(e){e=e??{},this.mID=e.mID,this.name=e.name,this.imgs=e.imgs?.map(r=>new Xa(r))??[],this.link=e.link,this.price=new Ja(e.price),this.sku=e.sku,this.isAvailable=e.isAvailable,this.quantity=e.quantity,this.selectedOptions=e.selectedOptions??[],this.effectivePrice=nr(this.price.effective),e.sellingPlans?.length&&(this.selectedSellingPlan=nr(void 0)),this.sellingPlans=e.sellingPlans?.map(r=>{let n=new Lf(r);return n.isSelected&&(this.selectedSellingPlan.value=n),n})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(e){this.selectedSellingPlan.value=e}hasEffectivePrice(){return this.effectivePrice.value!==this.price.d}};var xt=class{id;mID;name;options;imgs;vars;desc;link;slug;quantity;category;meta;reviews;tags;templateSuffix;selectedOrFirstVariant;selected=nr(!0);constructor(e){this.update(e),this.selectedOrFirstVariant=nr(this.selectedVariant)}get firstImageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}set variants(e){this.vars=e,this.selectedOrFirstVariant.value=this.selectedVariant}get selectedVariant(){return this.vars.find(e=>e.isAvailable)??this.vars[0]}hasVariants(){return this.vars?.length>1}setSelectedVariant(e){this.selectedOrFirstVariant.value=e}setSelectedVariantByID(e){if(!e)return;let r=this.vars.find(n=>n.mID===e.toString());r&&this.setSelectedVariant(r)}update(e){return this.id=e.id??this.id,this.mID=e.mID??this.mID,this.name=e.name??this.name,this.imgs=e.imgs??this.imgs,this.desc=e.desc??this.desc,this.link=e.link??this.link,this.slug=e.slug??this.slug,this.quantity=e.quantity??this.quantity,this.meta=e.meta??this.meta,this.category=e.category??this.category,this.reviews=e.reviews??this.reviews,this.options=e.options??this.options,this.tags=e.tags??this.tags,this.templateSuffix=e.templateSuffix??this.templateSuffix,e.vars&&(this.vars=e.vars.map(r=>new Mr(r))),this}toEmbed(e){return e=e??this.selectedOrFirstVariant.value,new Dt({id:this.id,mID:this.mID,vID:e.mID,vName:e.name,name:this.name,link:this.link,slug:this.slug,price:e.price.d,imageURL:e.getOneImage()??this.imgs?.[0].url})}getTemplateVariables(){let e=this.selectedOrFirstVariant.value,r=e.price,n=this.name,o=this.category,i=this.variantImage??this.firstImageURL,s=this.meta,a=this.tags?.join(",")??"",l=this.reviews?.rating,f=this.reviews?.totalReviews,m=r.cmp&&r.cmp>r.d,d=Z(E({name:n},Lt("price",r.d,!0)),{image_url:i,meta:s,category:o,rating:l,reviews:f,tags:a});if(e.hasEffectivePrice()){let y=Lt("effective_price",e.effectivePrice.value,!0);Object.assign(d,y)}if(m){let y=r.cmp-r.d,C={discount_percent:(y/r.cmp*100).toFixed(0)};Object.assign(d,C),Object.assign(d,Lt("compare_price",r.cmp)),Object.assign(d,Lt("discount_price",y))}let _={name:e.name,quantity:e.quantity};return{product:d,variant:_}}};var Qa=class{id;alt;shortID;sources;items;durationMS;thumbnail;card;bestSource;highSource;goodSource;lowSource;m3u8Source;constructor(e={}){if(this.id=e.id,this.alt=e.alt,this.shortID=e.shortID,this.sources=e.sources?.sort((r,n)=>n.height-r.height),this.durationMS=e.durationMS,this.thumbnail=e.thumbnail,this.items=e.items?e.items.map(r=>new xt(r)):[],this.card=e.card,this.sources){let r=[];for(let n of this.sources)n.format==="mp4"?r.push(n):n.format==="m3u8"&&!this.m3u8Source&&(this.m3u8Source=n);r.length>0&&(this.bestSource=r[0],this.highSource=r.length>1?r[1]:r[0],this.lowSource=r.length>2?r[r.length-1]:r[0])}}};var Za=class{videos;source;template;heading;autoPlay;showMuteButton;footerContent;detailPopup;playlistConfig;itemDetailConfig;constructor(e={}){this.videos=e.videos?.map(r=>new Qa(r))??[],this.source=e.source,this.template=e.template,this.detailPopup=e.detailPopup??{template:"VIDEO_ONLY_VIEW"},this.heading=e.heading,this.showMuteButton=e.showMuteButton,this.autoPlay=e.autoPlay??"ON",this.footerContent=e.footerContent??"FIRST_ITEM",this.playlistConfig={videoSwiper:e.playlistConfig?.videoSwiper??void 0,itemCardClickBehavior:e.playlistConfig?.itemCardClickBehavior??"OPEN_VIDEO_DETAIL"},this.itemDetailConfig={template:e.itemDetailConfig?.template??"CLASSIC"}}showItems(){return this.footerContent==="FIRST_ITEM"||this.footerContent==="ITEM_SWIPER"}};var Ct=zr(Mf());Ct.filters.define("default",function(t){return typeof t>"u"||t==null?"":Kb(t)});+Ct.filters.define("max",(t,e)=>{let r=Number(t),n=Number(e);return isNaN(r)||isNaN(n)?t:r>n?e:t});Ct.filters.define("min",(t,e)=>{let r=Number(t),n=Number(e);return isNaN(r)||isNaN(n)?t:r<n?e:t});Ct.filters.define("fallback",(t,e)=>t==null||t===""?e:t);Ct.filters.define("manipulate_quantity",(t,e,r)=>{if(e??=1,r??=100,e>r)return w.error("Invalid range: min should be less than or equal to max."),t;if(t>=e&&t<=r)return t;let n=t%r;return n<e?e:n});Ct.filters.define("apply_discount_perc",(t,e,r=1/0)=>{if(t=+t,isNaN(t))return w.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(e<0||e>100)return w.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let n=t*e/100;return t-Math.min(r,n)});Ct.filters.define("apply_discount_fixed",(t,e)=>(t=+t,isNaN(t)?(w.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,t-e)));Ct.filters.define("currency",t=>(t=+t,isNaN(t)?(w.error("Need value as a number for `currency` filter"),NaN):mf(t)));Ct.filters.define("split",(t,e,r)=>{if(typeof t!="string")return w.error("Need value as a string for `split` filter"),"";if(e==null)return w.error("Need delimiter for `split` filter"),"";if(r==null||isNaN(Number(r)))return w.error("Need a valid index for `split` filter"),"";let n=t.split(String(e)),o=Number(r),i=o<0?n.length+o:o;return n[i].trim()??""});Ct.defaultConfig.defaultFilter="default";Ct.defaultConfig.useWith=!0;Ct.defaultConfig.autoEscape=!1;var Yb={'"':""","\\":"\","\n":"\\n"};function Kb(t){return String(t).replace(/["\\\n]/g,e=>Yb[e])}function Xb(t){if(!t)return"";let e=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return t.replace(e,(r,n,o,i)=>`{{ ${(o||i||"").trim()} }}`)}var Vo=(t,e,r)=>{e=E({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},e);try{return Ct.render(Xb(t),e)}catch(n){throw ae(n,"squirrelly-render",{extra:{template:t,values:e},triggerContext:r}),n}},Qn=(t,e,r)=>{let n=JSON.stringify(t),o=Vo(n,e,r);try{return JSON.parse(o)}catch(i){throw ae(i,"variable-replacement",{extra:{before:t,after:o},triggerContext:r}),i}};function es(){return!!window.Shopify}function tc(){if(es())return window.Shopify.shop?.split(".")?.[0]}function tg(t){let n=(t.includes("://")?new URL(t).pathname:t).match(/\/products\/([^/]+?)(?:\.html)?$/);return n?n[1]:null}function Wo(t){return(window.Shopify?.routes?.root??"/")+t.substring(1)}function rc(t){return Wo(t+"?from=cooee")}var me=class t{static CURRENT;token;items=[];total_price=0;original_total_price=0;items_subtotal_price=0;currency;item_count=0;attributes;cart_level_discount_applications;discount_codes;total_discount=0;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new t),this.CURRENT}async getNormalisedCart(e){return Jb(e)}getCooeeCart(){return Bf()}update(e){return this.token=e.token,this.items=e.items,this.total_price=e.total_price,this.original_total_price=e.original_total_price,this.items_subtotal_price=e.items_subtotal_price,this.currency=e.currency,this.item_count=e.item_count,this.attributes=e.attributes,this.cart_level_discount_applications=e.cart_level_discount_applications,this.discount_codes=e.discount_codes,this.total_discount=e.total_discount,fe().currencyCode=this.currency,w.verbose("Updated ShopifyCart",this),this}toString(){return`ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}};async function Jb(t){let e=me.getCurrent();await Zb(e,t);let r=rg(e);return t&&await Ye.set("cart",r),r}function Bf(){return rg(me.getCurrent())}function rg(t){return{amount:t.total_price/100,originalAmount:t.original_total_price/100,itemsSubtotalPrice:t.items_subtotal_price/100,currency:t.currency,itemCount:t.item_count,items:Qb(t.items),token:t.token}}function Qb(t){if(!t)return w.error("No item received to be sent"),[];Array.isArray(t)||(t=[t]);let e=[];for(let r of t){if(!r.id||!r.title){w.warn("Invalid item received",r);continue}let n={name:r.title,quantity:+r.quantity||1,mID:r.product_id?.toString(),vID:r.id.toString(),price:+r.price/100||0,finalPrice:+r.final_price/100||0,properties:r.properties,key:r.key},o=r.selling_plan_allocation?.selling_plan;if(!o){e.push(n);continue}n.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:o.fixed_selling_plan,id:o.id,name:o.name,recurringDeliveries:o.recurring_deliveries}},e.push(n)}return e}async function Zb(t,e){if(!e&&t.token){w.verbose("Not fetching cart");return}w.verbose("Fetching cart");let r=rc("/cart.js");try{let n=(await Jr(r)).data;t.update(n)}catch(n){w.error("Unable to fetch the cart",n)}}var nc=class{id;mID;handle;title;imageURL;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.handle=e.handle,this.title=e.title,this.imageURL=e.imageURL}};var Uf=class{enabled;constructor(e){this.enabled=e.enabled}},kf=class extends Uf{max;min;constructor(e){e??={},super(e),this.min=e.min,this.max=e.max}},oc=class{productQuantity;constructor(e){e??={},this.productQuantity=new kf(e.productQuantity)}};var jt=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(e){this.t=e.t,e.bg&&(this.bg=new $n(e.bg)),e.br&&(this.br=new Kr(e.br)),e.shd&&(this.shd=new Pi(e.shd)),e.spc&&(this.spc=new Xr(e.spc)),this.trf=new Vn(e.trf),this.clc=e.clc,this.w=e.w,this.h=e.h,this.x=e.x,this.y=e.y,this.a=e.a}get alpha(){return this.a??100}get type(){return this.t}get typeAsString(){return je[this.t]}get click(){return this.clc}},je=(P=>(P[P.IMAGE=1]="IMAGE",P[P.TEXT=2]="TEXT",P[P.BUTTON=3]="BUTTON",P[P.FLEXBOX=4]="FLEXBOX",P[P.MULTI_COLUMN=5]="MULTI_COLUMN",P[P.CHECKBOX=6]="CHECKBOX",P[P.PRODUCTS=11]="PRODUCTS",P[P.PRODUCT=12]="PRODUCT",P[P.PRODUCT_IMAGE=13]="PRODUCT_IMAGE",P[P.PRODUCT_TITLE=14]="PRODUCT_TITLE",P[P.PRODUCT_VARIATIONS=15]="PRODUCT_VARIATIONS",P[P.PRODUCT_VARIATIONS_SELLING_PLANS=16]="PRODUCT_VARIATIONS_SELLING_PLANS",P[P.PRODUCT_BUTTON=18]="PRODUCT_BUTTON",P[P.PRODUCT_RATING=19]="PRODUCT_RATING",P[P.EMAIL_INPUT=51]="EMAIL_INPUT",P[P.PHONE_INPUT=52]="PHONE_INPUT",P[P.COUNTDOWN_TIMER=61]="COUNTDOWN_TIMER",P[P.CAROUSEL=62]="CAROUSEL",P[P.SHAPE=100]="SHAPE",P))(je||{});var Zn=class extends jt{constructor(e){super(e)}};var on=class extends jt{src;constructor(e){super(e),this.src=e.src}};var Br=class extends jt{typo;constructor(e){super(e);let r=E(E({},e.f),e.typo);e.alg&&(r.ta=e.alg),e.c&&(r.tc=e.c),this.typo=new st(r)}get color(){return this.typography.tc}get typography(){return this.typo}};var Tn=class extends Br{prs;constructor(e){super(e),this.prs=e.prs}get parts(){return this.prs}};var ic=class extends jt{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}};var jo=class{dd;hh;mm;ss;date;constructor(e){e??={},this.dd=e.dd??0,this.hh=e.hh??0,this.mm=e.mm??0,this.ss=e.ss??0,this.date=e.date?new Date(e.date):void 0}start(e,r){let n=new Date;e===2?(n.setSeconds(n.getSeconds()+this.ss),n.setMinutes(n.getMinutes()+this.mm),n.setHours(n.getHours()+this.hh),n.setDate(n.getDate()+this.dd)):n=this.date??new Date;let o=window.setInterval(()=>{let i=new Date().getTime(),s=n.getTime()-i;if(s<1){clearInterval(o);return}let a=Math.floor(s/(1e3*60*60*24)),l=Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),f=Math.floor(s%(1e3*60*60)/(1e3*60)),m=Math.floor(s%(1e3*60)/1e3);r({days:a,hours:l,minutes:f,seconds:m})},1e3);return o}};var Go=class extends Br{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new jo(e.timer),this.show=e.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}};var sc=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new Ve(e.c??{})}get text(){return this.txt}get color(){return this.c}};var In=class extends Br{ph;constructor(e){super(e),this.ph=new sc(e.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}};var qo=class extends In{constructor(e){e??={},super(e)}};var zo=class extends In{};var Yo=class extends In{};var Ko=class extends on{};var ac=class{en;ex;constructor(e){e=e??{},this.en=e.en,this.ex=e.ex}getEnterAnimation(){switch(this.en){case 2:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case 3:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case 4:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case 5:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case 6:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case 7:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case 8:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case 9:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case 10:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}}getExitAnimation(){switch(this.ex){case 2:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case 3:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case 4:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case 5:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case 6:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case 7:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case 8:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case 9:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case 10:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}}};var cc=15,ts=class extends jt{gvt;max;cover;anim;embedded;constructor(e){e=e??{},super(e),this.gvt=e.gvt??5,this.max=e.max,this.cover=e.cover??!0,this.anim=new ac(e.anim),this.spc||(this.spc=new Xr({pl:cc,pr:cc,pt:cc,pb:cc}))}};var lc=class extends ts{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new ic(e.cont),this.mob=new ts(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(r=>{r.t===1?this.elems.push(new on(r)):r.t===2?this.elems.push(new Tn(r)):r.t===3?this.elems.push(new Tn(r)):r.t===100?this.elems.push(new Zn(r)):r.t===51?this.elems.push(new zo(r)):r.t===52?this.elems.push(new Yo(r)):r.t===61?this.elems.push(new Go(r)):r.t===15||r.t===16?this.elems.push(new qo(r)):r.t===13&&this.elems.push(new Ko(r))})}getStylesForWrapper(){if(this.cover)return{};let e;return this.gvt===1?e={top:0,left:0}:this.gvt===2?e={top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===3?e={top:0,right:0}:this.gvt===6?e={top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===9?e={bottom:0,right:0}:this.gvt===8?e={bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===7?e={bottom:0,left:0}:this.gvt===4?e={top:"50%",left:0,transform:"translateY(-50%)"}:e={top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},e.overflow="visible",e}getFlexStylesForContainer(){let e={display:"flex",flexDirection:"row"},r,n;return this.gvt===1?(r="flex-start",n="flex-start"):this.gvt===2?(r="center",n="flex-start"):this.gvt===3?(r="flex-end",n="flex-start"):this.gvt===4?(r="flex-start",n="center"):this.gvt===6?(r="flex-end",n="center"):this.gvt===7?(r="flex-start",n="flex-end"):this.gvt===8?(r="center",n="flex-end"):this.gvt===9?(r="flex-end",n="flex-end"):(r="center",n="center"),e.alignItems=n,e.justifyContent=r,e.overflow="visible",e}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim}};var Xo=class{gap;dir;wrap;jc;ai;scroll;constructor(e){e??={},this.gap=e.gap??0,this.dir=e.dir??"row",this.wrap=e.wrap??"nowrap",this.jc=e.jc??"flex-start",this.ai=e.ai??"flex-start",this.scroll=e.scroll}};var uc=class{of;disp;pos;top;bottom;left;right;zIndex;constructor(e){e??={},this.of=e.of,this.disp=e.disp,this.pos=e.pos,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.zIndex=e.zIndex}};var fc=class{w;h;maxW;maxH;minW;minH;constructor(e){e??={},this.w=e.w??"100%",this.h=e.h??"auto",this.maxW=e.maxW,this.maxH=e.maxH,this.minW=e.minW,this.minH=e.minH}};var pc=class{size;bg;br;spc;typo;lout;flex;constructor(e){e??={},this.spc=new Xr(e.spc),e.size&&(this.size=new fc(e.size)),e.bg&&(this.bg=new $n(e.bg)),e.br&&(this.br=new Kr(e.br)),e.typo&&(this.typo=new st(e.typo)),e.lout&&(this.lout=new uc(e.lout)),e.flex&&(this.flex=new Xo(e.flex))}},Jo=class{sm;lg;constructor(e){e??={},this.sm=new pc(e.sm),this.lg=new pc(e.lg)}};var dt=class{t;style;hide;when;clc;l;constructor(e,r){r??={},this.t=e,this.style=new Jo(r.style),this.hide=r.hide,this.l=r.l,r.when?.op&&(this.when=r.when),r.clc&&(this.clc=r.clc)}get stringType(){return je[this.t]}};var ht=class extends dt{text;constructor(e,r){e?.style?.lg?.typo?.s&&delete e.style.lg.typo.s,e?.style?.sm?.typo?.s&&delete e.style.sm.typo.s,super(r??2,e),e??={},this.text=e.text}};var eo=class extends ht{constructor(e,r){super(e,r??3)}};var Qo=class extends dt{value;constructor(e){super(6,e),e??={},this.value=e.value}};var Zo=class extends ht{showChips;optionsConfig;constructor(e=15,r){super(r,e),r??={},this.showChips=r.showChips??!1,this.optionsConfig=r.optionsConfig??{}}};var mc=class extends dt{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new Ve(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??!1,this.fullStar=e.fullStar,this.halfStart=e.halfStart}};var ng=zr(Ws());var Ff=class{enabled;type;color;constructor(e){e??={},this.enabled=e.enabled,this.type=e.type,this.color=new Ve(e.color)}},Hf=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new Ve(e.color)}},$f=class{enabled;delay;constructor(e={}){this.enabled=e.enabled,e.delay&&(this.delay=e.delay>100?e.delay:e.delay*1e3)}},ei=class{navigation;pagination;autoplay;loop;maxInRow;gap;maxInRowSm;gapSm;speed;marquee;constructor(e){e??={},this.navigation=new Hf(e.navigation),this.pagination=new Ff(e.pagination),this.autoplay=new $f(e.autoplay),this.loop=e.loop??!1,this.maxInRow=e.maxInRow??4,this.gap=e.gap??0,this.maxInRowSm=e.maxInRowSm??this.maxInRow,this.gapSm=e.gapSm??this.gap,e.speed&&(this.speed=e.speed*1e3),this.marquee=e.marquee}};var dc=class extends dt{conf;slide;formData;values;allowedTypes;constructor(e){super(62,e),e&&this.update(e)}update(e){e??={},this.slide=Gt.getParsedElement(e.slide),this.formData=e.formData,this.values=e.values,this.conf=new ei(e.conf),this.allowedTypes=e.allowedTypes}};var hc=class extends ht{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e,61),this.gap=e.gap,this.timerType=e.type,this.timer=new jo(e.timer),this.show=e.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}};var xn=class extends dt{elems;constructor(e){super(4,e),this.update(e)}update(e){e??={},this.elems??=[],e.elems?.forEach(r=>{let n=Gt.getParsedElement(r);n&&this.elems.push(n)})}};var to=class extends dt{src;sm;lg;constructor(e,r){super(r??1,e),e&&this.update(e)}update(e){this.src=e.src,this.sm=e.sm,this.lg=e.lg}};var Gt=class t{static getParsedElements(e){let r=[];return e?.forEach(n=>{let o=t.getParsedElement(n);o&&r.push(o)}),r}static getParsedElement(e){switch(e.t){case 2:return new ht(e);case 3:return new eo(e);case 6:return new Qo(e);case 11:return new gc(e);case 12:return new Cn(e);case 61:return new hc(e);case 4:return new xn(e);case 1:return new to(e);case 13:return new to(e,13);case 14:return new ht(e,14);case 15:case 16:return new Zo(e.t,e);case 18:return new eo(e,18);case 62:return new dc(e);case 19:return new mc(e);default:ng.default.error("Unknown element type",e.t);return}}static parseAlignmentToJustifyContent(e){switch(e){case 1:return"center";case 2:return"flex-end";case 0:return"flex-start";default:return"flex-start"}}};var Cn=class extends dt{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(e){if(e??={},super(12,e),this.show=e.show,this.elems=Gt.getParsedElements(e.elems),this.noLinks=e.noLinks,!this.elems.length){e.cBox&&this.elems.push(new Qo(e.cBox)),this.elems.push(new to(e.img,13));let r=new ht(e.title,14);r.hide=!e.show?.title,r.text="{{ product.name }}",this.elems.push(r);let n=new ht(e.price);n.text="{{ product.price }}",n.hide=!e.show?.price;let o=new ht(e.compareAt);o.text="{{ product.compare_price }}",o.hide=!e.show?.price,e.compareAt||(o.style=new Jo(n.style),o.style.lg.typo=new st(Z(E({},o.style.lg.typo),{td:"line-through"})),o.style.sm.typo=new st(Z(E({},o.style.sm.typo),{td:"line-through"})));let i=new xn({style:{lg:{spc:{mb:10},flex:{dir:"row",gap:10,ai:"center",jc:Gt.parseAlignmentToJustifyContent(n.style.lg.typo?.ta)}}}});i.elems.push(o),i.elems.push(n),this.elems.push(i);let s=new Zo(15,e.variantDD);if(s.hide=!e.show?.variantDD,this.elems.push(s),e.btn){let a=new eo(e.btn,18);a.hide=!e.show?.btn,this.elems.push(a)}}e.symbol&&(this.symbol=new ht(e.symbol))}};var gc=class extends dt{conf;prod;constructor(e){super(11,e),e??={},this.conf=new Vf(e.conf),this.prod=new Cn(e.prod)}};var yc=class extends ei{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems}},Vf=class{lg;sm;constructor(e){e??={},this.lg=new yc(e.lg),this.sm=new yc(e.sm)}};var vc=class extends xn{constructor(e){super(e)}};var ti=class{cont;elems=[];constructor(e){e=e??{},this.cont=new vc(e.cont),e.elems?.forEach(r=>{this.addRawElement(r)})}addRawElement(e){let r=Gt.getParsedElement(e);return r&&this.elems.push(r),r}};function Ec(t,e){return eS(t,e,0,5)}function eS(t,e,r=0,n=50){if(e){if(r>n){console.warn("Maximum recursion depth reached in findFirstElementOfType");return}for(let o of e){if(o.t===t)return o;let i="elems"in o?o.elems:[];if(i?.length>0){let s=Ec(t,i);if(s)return s}}}}var Wf=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(e){this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.delay=e.delay??0,this.redirectBehaviour=e.redirectBehaviour,this.onsiteDeliveryType=e.onsiteDeliveryType,this.objective=e.objective}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===Ri.EXCLUSION}isABTesting(){return this.contentType===Ri.ABTESTING}isSingleContent(){return this.contentType===Ri.SINGLE}},rs=class{videoConfig;savingsBarConfig;afterDeleteJS;afterRenderJS;innerCSS;outerCSS;constructor(e){this.update(e)}update(e){e??={},e.videoConfig&&(this.videoConfig=new Za(e.videoConfig)),e.savingsBarConfig&&(this.savingsBarConfig=new Qs(e.savingsBarConfig)),this.afterDeleteJS=e.afterDeleteJS,this.afterRenderJS=e.afterRenderJS,this.innerCSS=e.innerCSS,this.outerCSS=e.outerCSS}},St=class extends Wf{contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;entryAnimation;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;stickyATCConfig;bundleConfig;content;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;experimentConfig;discountData=nr({});constructor(e){if(super(e),this.id=e.id,this.currency=fe().currencyCode??"USD",this.contentID=e.contentID,this.variation=e.variation,e.widget&&(this.widget=new ti(e.widget)),this.previewType=e.previewType,this.occurred=e.occurred??new Date,this.props=e.props,this.entryAnimation=e.entryAnimation??"NONE",this.embeddedItems=e.embeddedItems?.map(r=>new Dt(r)),this.items=e.items?.map(r=>new xt(r))??[],this.nonMutableItems=e.items?.map(r=>new xt(r))??[],this.collections=e.collections?.map(r=>new nc(r))??[],this.discount=e.discount,this.placement=e.placement,e.customerData?.name){let r=e.customerData.name.split(" ");this.customerData={name:e.customerData.name,full_name:e.customerData.name,first_name:r[0],last_name:r[1]}}this.ian=e.ian?this.processPopup(e.ian):void 0,this.promotionType=e.promotionType,this.manipulation=new oc(e.manipulation),this.contentSource=e.contentSource,this.klaviyoFormID=e.klaviyoFormID,this.hasMultiplePlacement=e.hasMultiplePlacement,this.skipSubscribedItems=e.skipSubscribedItems,this.stickyATCConfig=e.stickyATCConfig,e.experimentConfig&&(this.experimentConfig=new Ks(e.experimentConfig)),e.progressBarConfig&&(this.progressBarConfig=new Js(e.progressBarConfig)),e.bundleConfig&&(this.bundleConfig=new qs(e.bundleConfig)),e.bundleFrom&&(this.bundleFrom=new xt(e.bundleFrom)),e.content&&(this.content=new rs(e.content))}shouldDelay(){return this.delay>0}getDelaySeconds(){let e=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-e}isBundle(){return this.objective===hr.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===Ai.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===Ai.PAGE_EMBED}isProgressBar(){return this.objective===hr.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===hr.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===hr.CART_RECOVERY}isProductPromotion(){return this.objective===hr.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isCollectionPromoted(){return this.isProductPromotion()&&this.collections.length>0&&this.promotionType===$l.COLLECTION}isBYOB(){return this.objective===hr.BYOB}isStickyATC(){return this.objective===hr.STICKY_ATC}isShoppableVideo(){return this.objective===hr.SHOPPABLE_VIDEO}isSavingsBar(){return this.objective===hr.SAVINGS_BAR}processPopup(e){let r=this.items[0],n={},o={};if(r){let a=r.selectedOrFirstVariant.value;n=Z(E(E({name:r.name,id:r.mID,link:r.link,vID:a.mID,image:r.variantImage},Lt("price",a.price.d)),Lt("comparePrice",a.price.cmp)),{quantity:r.quantity}),o={quantity:a.quantity}}let i={productCount:me.getCurrent().item_count},s=Vo(JSON.stringify(e),{product:n,variant:o,cart:i,discount:this.discount,customer:this.customerData},new Ir(new Date,this));return r&&(s=s.replace(new RegExp("https://cdn.global.letscooee.com/images/placeholders/product.png","gi"),r.variantImage??r.firstImageURL)),new lc(JSON.parse(s))}calculateDiscountData(e,r){let n=Yr.sum(e,s=>s.selectedOrFirstVariant.value.price.d),o=Yr.sum(e,s=>{let a=s.selectedOrFirstVariant.value.price;return a.cmp??a.d}),i={actualPrice:n,totalComparePrice:o,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!e?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(i);return}if(Jt.BXGY===this.discount.type&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],this.updateEffectivePrice(e,i.discountPercentage,!0),i.discountAmount=i.actualPrice-Yr.sum(e,s=>s.selectedOrFirstVariant.value.effectivePrice.value);else if([Jt.STATIC,Jt.UNIQUE_FLAT].includes(this.discount.type)&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100,this.updateEffectivePrice(e,i.discountPercentage);else if(Jt.UNIQUE_FLAT_ITEMS===this.discount.type&&this.discount.values?.length)this.discount.ruleType==="fixed_amount"?(i.discountAmount=this.discount.values[0],i.discountPercentage=i.actualPrice>0?i.discountAmount*100/i.actualPrice:0):(i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100),this.updateEffectivePrice(e,i.discountPercentage);else if(this.discount.type===Jt.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)i.discountAmount=i.actualPrice-this.discount.values[0],i.discountPercentage=i.discountAmount/i.actualPrice*100,this.updateEffectivePrice(e,i.discountPercentage);else if(this.discount.type===Jt.UNIQUE_CHEAPEST_ITEM_FREE){e.sort((a,l)=>l.selectedOrFirstVariant.value.price.d-a.selectedOrFirstVariant.value.price.d);let s=e[e.length-1];s.selectedOrFirstVariant.value.effectivePrice.value=0,i.discountAmount=s.selectedOrFirstVariant.value.price.d,i.discountPercentage=i.discountAmount/i.actualPrice*100}i.discountedPrice=i.actualPrice-i.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(i)}getPrivateAttributesForLineItem(){return ze.get().skipItemAttribute?{}:{_via:"Cooee",_letscooee_campaign:this.shortID,_letscooee_content:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return ze.get().skipItemAttribute?[]:[{key:"_via",value:"Cooee"},{key:"_letscooee_campaign",value:this.shortID},{key:"_letscooee_content",value:this.contentID}]}isBundleOnCartDrawer(){return this.isBundle()&&this.isCartEmbed()}isBundleOnPDP(){return this.isPageEmbed()&&this.isBundle()}hasSwiperElement(){if(Ec(62,this.widget?.elems))return!0;let r=Ec(11,this.widget?.elems);return r?r.conf.lg.disp===2||r.conf.sm.disp===2:!1}toString(){let e;return this.onsiteDeliveryType===Ai.POPUP?e="Popup":e=wm.toTitle(this.objective),`${e}(id=${this.shortID})`}getCartMagicVariables(){let e=me.getCurrent(),r=Yr.sum(e.items??[],n=>n.discounts?.reduce((o,i)=>o+(i.amount??0),0)??0);return E(E(E(E({productCount:e.item_count,product_count:e.item_count},Lt("amount",e.total_price/100)),Lt("originalAmount",e.original_total_price/100)),Lt("total_line_items_discount",r/100)),Lt("total_discount",e.total_discount/100))}shouldGetVariationImmediately(){return this.hasMultiplePlacement&&!this.alwaysHaveVariations()}shouldSkipVariation(){return this.isSingleContent()||this.alwaysHaveVariations()?!0:!!this.variation}alwaysHaveVariations(){return this.isProgressBar()||this.isSavingsBar()}updateEffectivePrice(e,r,n=!1){let o=fe().currentItem;e.forEach(i=>{let s=i.selectedOrFirstVariant.value,a=s.price;if(n&&i.mID===o.mID)s.effectivePrice.value=a.d;else{let l=a.d*r/100;s.effectivePrice.value=a.d-l}})}formatCurrencyAndNumber(e){if(!e)return{};let r={discountPercentage:Eh(e.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice","totalComparePrice"].map(n=>{Object.assign(r,Lt(n,e[n]))}),r}};function rS(t,e){return e={exports:{}},t(e,e.exports),e.exports}var nS=aS,oS=lS,iS=pS,kr=[],ir=[],sS=typeof Uint8Array<"u"?Uint8Array:Array,jf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ro=0,og=jf.length;ro<og;++ro)kr[ro]=jf[ro],ir[jf.charCodeAt(ro)]=ro;var ro,og;ir[45]=62;ir[95]=63;function _g(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function aS(t){var e=_g(t),r=e[0],n=e[1];return(r+n)*3/4-n}function cS(t,e,r){return(e+r)*3/4-r}function lS(t){var e,r=_g(t),n=r[0],o=r[1],i=new sS(cS(t,n,o)),s=0,a=o>0?n-4:n,l;for(l=0;l<a;l+=4)e=ir[t.charCodeAt(l)]<<18|ir[t.charCodeAt(l+1)]<<12|ir[t.charCodeAt(l+2)]<<6|ir[t.charCodeAt(l+3)],i[s++]=e>>16&255,i[s++]=e>>8&255,i[s++]=e&255;return o===2&&(e=ir[t.charCodeAt(l)]<<2|ir[t.charCodeAt(l+1)]>>4,i[s++]=e&255),o===1&&(e=ir[t.charCodeAt(l)]<<10|ir[t.charCodeAt(l+1)]<<4|ir[t.charCodeAt(l+2)]>>2,i[s++]=e>>8&255,i[s++]=e&255),i}function uS(t){return kr[t>>18&63]+kr[t>>12&63]+kr[t>>6&63]+kr[t&63]}function fS(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),o.push(uS(n));return o.join("")}function pS(t){for(var e,r=t.length,n=r%3,o=[],i=16383,s=0,a=r-n;s<a;s+=i)o.push(fS(t,s,s+i>a?a:s+i));return n===1?(e=t[r-1],o.push(kr[e>>2]+kr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],o.push(kr[e>>10]+kr[e>>4&63]+kr[e<<2&63]+"=")),o.join("")}var Gf={byteLength:nS,toByteArray:oS,fromByteArray:iS};var mS=function(e,r,n,o,i){var s,a,l=i*8-o-1,f=(1<<l)-1,m=f>>1,d=-7,_=n?i-1:0,y=n?-1:1,C=e[r+_];for(_+=y,s=C&(1<<-d)-1,C>>=-d,d+=l;d>0;s=s*256+e[r+_],_+=y,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=o;d>0;a=a*256+e[r+_],_+=y,d-=8);if(s===0)s=1-m;else{if(s===f)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,o),s=s-m}return(C?-1:1)*a*Math.pow(2,s-o)},dS=function(e,r,n,o,i,s){var a,l,f,m=s*8-i-1,d=(1<<m)-1,_=d>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=o?0:s-1,N=o?1:-1,A=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=d):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+_>=1?r+=y/f:r+=y*Math.pow(2,1-_),r*f>=2&&(a++,f/=2),a+_>=d?(l=0,a=d):a+_>=1?(l=(r*f-1)*Math.pow(2,i),a=a+_):(l=r*Math.pow(2,_-1)*Math.pow(2,i),a=0));i>=8;e[n+C]=l&255,C+=N,l/=256,i-=8);for(a=a<<i|l,m+=i;m>0;e[n+C]=a&255,C+=N,a/=256,m-=8);e[n+C-N]|=A*128},ri={read:mS,write:dS},bc=rS(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=B,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=o(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{var h=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(h,c),h.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function i(h){if(h>n)throw new RangeError('The value "'+h+'" is invalid for option "size"');var c=new Uint8Array(h);return Object.setPrototypeOf(c,s.prototype),c}function s(h,c,u){if(typeof h=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(h)}return a(h,c,u)}s.poolSize=8192;function a(h,c,u){if(typeof h=="string")return d(h,c);if(ArrayBuffer.isView(h))return y(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(h));if($e(h,ArrayBuffer)||h&&$e(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($e(h,SharedArrayBuffer)||h&&$e(h.buffer,SharedArrayBuffer)))return C(h,c,u);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var v=h.valueOf&&h.valueOf();if(v!=null&&v!==h)return s.from(v,c,u);var x=N(h);if(x)return x;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return s.from(h[Symbol.toPrimitive]("string"),c,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(h))}s.from=function(h,c,u){return a(h,c,u)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function f(h,c,u){return l(h),h<=0?i(h):c!==void 0?typeof u=="string"?i(h).fill(c,u):i(h).fill(c):i(h)}s.alloc=function(h,c,u){return f(h,c,u)};function m(h){return l(h),i(h<0?0:A(h)|0)}s.allocUnsafe=function(h){return m(h)},s.allocUnsafeSlow=function(h){return m(h)};function d(h,c){if((typeof c!="string"||c==="")&&(c="utf8"),!s.isEncoding(c))throw new TypeError("Unknown encoding: "+c);var u=q(h,c)|0,v=i(u),x=v.write(h,c);return x!==u&&(v=v.slice(0,x)),v}function _(h){for(var c=h.length<0?0:A(h.length)|0,u=i(c),v=0;v<c;v+=1)u[v]=h[v]&255;return u}function y(h){if($e(h,Uint8Array)){var c=new Uint8Array(h);return C(c.buffer,c.byteOffset,c.byteLength)}return _(h)}function C(h,c,u){if(c<0||h.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(h.byteLength<c+(u||0))throw new RangeError('"length" is outside of buffer bounds');var v;return c===void 0&&u===void 0?v=new Uint8Array(h):u===void 0?v=new Uint8Array(h,c):v=new Uint8Array(h,c,u),Object.setPrototypeOf(v,s.prototype),v}function N(h){if(s.isBuffer(h)){var c=A(h.length)|0,u=i(c);return u.length===0||h.copy(u,0,0,c),u}if(h.length!==void 0)return typeof h.length!="number"||De(h.length)?i(0):_(h);if(h.type==="Buffer"&&Array.isArray(h.data))return _(h.data)}function A(h){if(h>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return h|0}function B(h){return+h!=h&&(h=0),s.alloc(+h)}s.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==s.prototype},s.compare=function(c,u){if($e(c,Uint8Array)&&(c=s.from(c,c.offset,c.byteLength)),$e(u,Uint8Array)&&(u=s.from(u,u.offset,u.byteLength)),!s.isBuffer(c)||!s.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===u)return 0;for(var v=c.length,x=u.length,O=0,W=Math.min(v,x);O<W;++O)if(c[O]!==u[O]){v=c[O],x=u[O];break}return v<x?-1:x<v?1:0},s.isEncoding=function(c){switch(String(c).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(c,u){if(!Array.isArray(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return s.alloc(0);var v;if(u===void 0)for(u=0,v=0;v<c.length;++v)u+=c[v].length;var x=s.allocUnsafe(u),O=0;for(v=0;v<c.length;++v){var W=c[v];if($e(W,Uint8Array))O+W.length>x.length?s.from(W).copy(x,O):Uint8Array.prototype.set.call(x,W,O);else if(s.isBuffer(W))W.copy(x,O);else throw new TypeError('"list" argument must be an Array of Buffers');O+=W.length}return x};function q(h,c){if(s.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||$e(h,ArrayBuffer))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(h));var u=h.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&u===0)return 0;for(var x=!1;;)switch(c){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":return Et(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return He(h).length;default:if(x)return v?-1:Et(h).length;c=(""+c).toLowerCase(),x=!0}}s.byteLength=q;function P(h,c,u){var v=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,c>>>=0,u<=c))return"";for(h||(h="utf8");;)switch(h){case"hex":return V(this,c,u);case"utf8":case"utf-8":return Ge(this,c,u);case"ascii":return D(this,c,u);case"latin1":case"binary":return R(this,c,u);case"base64":return Re(this,c,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,c,u);default:if(v)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),v=!0}}s.prototype._isBuffer=!0;function Q(h,c,u){var v=h[c];h[c]=h[u],h[u]=v}s.prototype.swap16=function(){var c=this.length;if(c%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var u=0;u<c;u+=2)Q(this,u,u+1);return this},s.prototype.swap32=function(){var c=this.length;if(c%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var u=0;u<c;u+=4)Q(this,u,u+3),Q(this,u+1,u+2);return this},s.prototype.swap64=function(){var c=this.length;if(c%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var u=0;u<c;u+=8)Q(this,u,u+7),Q(this,u+1,u+6),Q(this,u+2,u+5),Q(this,u+3,u+4);return this},s.prototype.toString=function(){var c=this.length;return c===0?"":arguments.length===0?Ge(this,0,c):P.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(c){if(!s.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:s.compare(this,c)===0},s.prototype.inspect=function(){var c="",u=e.INSPECT_MAX_BYTES;return c=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(c+=" ... "),"<Buffer "+c+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(c,u,v,x,O){if($e(c,Uint8Array)&&(c=s.from(c,c.offset,c.byteLength)),!s.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(c));if(u===void 0&&(u=0),v===void 0&&(v=c?c.length:0),x===void 0&&(x=0),O===void 0&&(O=this.length),u<0||v>c.length||x<0||O>this.length)throw new RangeError("out of range index");if(x>=O&&u>=v)return 0;if(x>=O)return-1;if(u>=v)return 1;if(u>>>=0,v>>>=0,x>>>=0,O>>>=0,this===c)return 0;for(var W=O-x,ue=v-u,_e=Math.min(W,ue),ge=this.slice(x,O),Me=c.slice(u,v),ke=0;ke<_e;++ke)if(ge[ke]!==Me[ke]){W=ge[ke],ue=Me[ke];break}return W<ue?-1:ue<W?1:0};function Ee(h,c,u,v,x){if(h.length===0)return-1;if(typeof u=="string"?(v=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,De(u)&&(u=x?0:h.length-1),u<0&&(u=h.length+u),u>=h.length){if(x)return-1;u=h.length-1}else if(u<0)if(x)u=0;else return-1;if(typeof c=="string"&&(c=s.from(c,v)),s.isBuffer(c))return c.length===0?-1:X(h,c,u,v,x);if(typeof c=="number")return c=c&255,typeof Uint8Array.prototype.indexOf=="function"?x?Uint8Array.prototype.indexOf.call(h,c,u):Uint8Array.prototype.lastIndexOf.call(h,c,u):X(h,[c],u,v,x);throw new TypeError("val must be string, number or Buffer")}function X(h,c,u,v,x){var O=1,W=h.length,ue=c.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(h.length<2||c.length<2)return-1;O=2,W/=2,ue/=2,u/=2}function _e(fr,qr){return O===1?fr[qr]:fr.readUInt16BE(qr*O)}var ge;if(x){var Me=-1;for(ge=u;ge<W;ge++)if(_e(h,ge)===_e(c,Me===-1?0:ge-Me)){if(Me===-1&&(Me=ge),ge-Me+1===ue)return Me*O}else Me!==-1&&(ge-=ge-Me),Me=-1}else for(u+ue>W&&(u=W-ue),ge=u;ge>=0;ge--){for(var ke=!0,tt=0;tt<ue;tt++)if(_e(h,ge+tt)!==_e(c,tt)){ke=!1;break}if(ke)return ge}return-1}s.prototype.includes=function(c,u,v){return this.indexOf(c,u,v)!==-1},s.prototype.indexOf=function(c,u,v){return Ee(this,c,u,v,!0)},s.prototype.lastIndexOf=function(c,u,v){return Ee(this,c,u,v,!1)};function ce(h,c,u,v){u=Number(u)||0;var x=h.length-u;v?(v=Number(v),v>x&&(v=x)):v=x;var O=c.length;v>O/2&&(v=O/2);for(var W=0;W<v;++W){var ue=parseInt(c.substr(W*2,2),16);if(De(ue))return W;h[u+W]=ue}return W}function se(h,c,u,v){return Ae(Et(c,h.length-u),h,u,v)}function de(h,c,u,v){return Ae(it(c),h,u,v)}function Le(h,c,u,v){return Ae(He(c),h,u,v)}function Se(h,c,u,v){return Ae(be(c,h.length-u),h,u,v)}s.prototype.write=function(c,u,v,x){if(u===void 0)x="utf8",v=this.length,u=0;else if(v===void 0&&typeof u=="string")x=u,v=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(v)?(v=v>>>0,x===void 0&&(x="utf8")):(x=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var O=this.length-u;if((v===void 0||v>O)&&(v=O),c.length>0&&(v<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");x||(x="utf8");for(var W=!1;;)switch(x){case"hex":return ce(this,c,u,v);case"utf8":case"utf-8":return se(this,c,u,v);case"ascii":case"latin1":case"binary":return de(this,c,u,v);case"base64":return Le(this,c,u,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se(this,c,u,v);default:if(W)throw new TypeError("Unknown encoding: "+x);x=(""+x).toLowerCase(),W=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Re(h,c,u){return c===0&&u===h.length?Gf.fromByteArray(h):Gf.fromByteArray(h.slice(c,u))}function Ge(h,c,u){u=Math.min(h.length,u);for(var v=[],x=c;x<u;){var O=h[x],W=null,ue=O>239?4:O>223?3:O>191?2:1;if(x+ue<=u){var _e,ge,Me,ke;switch(ue){case 1:O<128&&(W=O);break;case 2:_e=h[x+1],(_e&192)===128&&(ke=(O&31)<<6|_e&63,ke>127&&(W=ke));break;case 3:_e=h[x+1],ge=h[x+2],(_e&192)===128&&(ge&192)===128&&(ke=(O&15)<<12|(_e&63)<<6|ge&63,ke>2047&&(ke<55296||ke>57343)&&(W=ke));break;case 4:_e=h[x+1],ge=h[x+2],Me=h[x+3],(_e&192)===128&&(ge&192)===128&&(Me&192)===128&&(ke=(O&15)<<18|(_e&63)<<12|(ge&63)<<6|Me&63,ke>65535&&ke<1114112&&(W=ke))}}W===null?(W=65533,ue=1):W>65535&&(W-=65536,v.push(W>>>10&1023|55296),W=56320|W&1023),v.push(W),x+=ue}return Bt(v)}var Je=4096;function Bt(h){var c=h.length;if(c<=Je)return String.fromCharCode.apply(String,h);for(var u="",v=0;v<c;)u+=String.fromCharCode.apply(String,h.slice(v,v+=Je));return u}function D(h,c,u){var v="";u=Math.min(h.length,u);for(var x=c;x<u;++x)v+=String.fromCharCode(h[x]&127);return v}function R(h,c,u){var v="";u=Math.min(h.length,u);for(var x=c;x<u;++x)v+=String.fromCharCode(h[x]);return v}function V(h,c,u){var v=h.length;(!c||c<0)&&(c=0),(!u||u<0||u>v)&&(u=v);for(var x="",O=c;O<u;++O)x+=$t[h[O]];return x}function k(h,c,u){for(var v=h.slice(c,u),x="",O=0;O<v.length-1;O+=2)x+=String.fromCharCode(v[O]+v[O+1]*256);return x}s.prototype.slice=function(c,u){var v=this.length;c=~~c,u=u===void 0?v:~~u,c<0?(c+=v,c<0&&(c=0)):c>v&&(c=v),u<0?(u+=v,u<0&&(u=0)):u>v&&(u=v),u<c&&(u=c);var x=this.subarray(c,u);return Object.setPrototypeOf(x,s.prototype),x};function H(h,c,u){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+c>u)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(c,u,v){c=c>>>0,u=u>>>0,v||H(c,u,this.length);for(var x=this[c],O=1,W=0;++W<u&&(O*=256);)x+=this[c+W]*O;return x},s.prototype.readUintBE=s.prototype.readUIntBE=function(c,u,v){c=c>>>0,u=u>>>0,v||H(c,u,this.length);for(var x=this[c+--u],O=1;u>0&&(O*=256);)x+=this[c+--u]*O;return x},s.prototype.readUint8=s.prototype.readUInt8=function(c,u){return c=c>>>0,u||H(c,1,this.length),this[c]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(c,u){return c=c>>>0,u||H(c,2,this.length),this[c]|this[c+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(c,u){return c=c>>>0,u||H(c,2,this.length),this[c]<<8|this[c+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(c,u){return c=c>>>0,u||H(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(c,u){return c=c>>>0,u||H(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},s.prototype.readIntLE=function(c,u,v){c=c>>>0,u=u>>>0,v||H(c,u,this.length);for(var x=this[c],O=1,W=0;++W<u&&(O*=256);)x+=this[c+W]*O;return O*=128,x>=O&&(x-=Math.pow(2,8*u)),x},s.prototype.readIntBE=function(c,u,v){c=c>>>0,u=u>>>0,v||H(c,u,this.length);for(var x=u,O=1,W=this[c+--x];x>0&&(O*=256);)W+=this[c+--x]*O;return O*=128,W>=O&&(W-=Math.pow(2,8*u)),W},s.prototype.readInt8=function(c,u){return c=c>>>0,u||H(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},s.prototype.readInt16LE=function(c,u){c=c>>>0,u||H(c,2,this.length);var v=this[c]|this[c+1]<<8;return v&32768?v|4294901760:v},s.prototype.readInt16BE=function(c,u){c=c>>>0,u||H(c,2,this.length);var v=this[c+1]|this[c]<<8;return v&32768?v|4294901760:v},s.prototype.readInt32LE=function(c,u){return c=c>>>0,u||H(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},s.prototype.readInt32BE=function(c,u){return c=c>>>0,u||H(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},s.prototype.readFloatLE=function(c,u){return c=c>>>0,u||H(c,4,this.length),ri.read(this,c,!0,23,4)},s.prototype.readFloatBE=function(c,u){return c=c>>>0,u||H(c,4,this.length),ri.read(this,c,!1,23,4)},s.prototype.readDoubleLE=function(c,u){return c=c>>>0,u||H(c,8,this.length),ri.read(this,c,!0,52,8)},s.prototype.readDoubleBE=function(c,u){return c=c>>>0,u||H(c,8,this.length),ri.read(this,c,!1,52,8)};function ne(h,c,u,v,x,O){if(!s.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>x||c<O)throw new RangeError('"value" argument is out of bounds');if(u+v>h.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(c,u,v,x){if(c=+c,u=u>>>0,v=v>>>0,!x){var O=Math.pow(2,8*v)-1;ne(this,c,u,v,O,0)}var W=1,ue=0;for(this[u]=c&255;++ue<v&&(W*=256);)this[u+ue]=c/W&255;return u+v},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(c,u,v,x){if(c=+c,u=u>>>0,v=v>>>0,!x){var O=Math.pow(2,8*v)-1;ne(this,c,u,v,O,0)}var W=v-1,ue=1;for(this[u+W]=c&255;--W>=0&&(ue*=256);)this[u+W]=c/ue&255;return u+v},s.prototype.writeUint8=s.prototype.writeUInt8=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,1,255,0),this[u]=c&255,u+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,2,65535,0),this[u]=c&255,this[u+1]=c>>>8,u+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,2,65535,0),this[u]=c>>>8,this[u+1]=c&255,u+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,4,4294967295,0),this[u+3]=c>>>24,this[u+2]=c>>>16,this[u+1]=c>>>8,this[u]=c&255,u+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,4,4294967295,0),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4},s.prototype.writeIntLE=function(c,u,v,x){if(c=+c,u=u>>>0,!x){var O=Math.pow(2,8*v-1);ne(this,c,u,v,O-1,-O)}var W=0,ue=1,_e=0;for(this[u]=c&255;++W<v&&(ue*=256);)c<0&&_e===0&&this[u+W-1]!==0&&(_e=1),this[u+W]=(c/ue>>0)-_e&255;return u+v},s.prototype.writeIntBE=function(c,u,v,x){if(c=+c,u=u>>>0,!x){var O=Math.pow(2,8*v-1);ne(this,c,u,v,O-1,-O)}var W=v-1,ue=1,_e=0;for(this[u+W]=c&255;--W>=0&&(ue*=256);)c<0&&_e===0&&this[u+W+1]!==0&&(_e=1),this[u+W]=(c/ue>>0)-_e&255;return u+v},s.prototype.writeInt8=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,1,127,-128),c<0&&(c=255+c+1),this[u]=c&255,u+1},s.prototype.writeInt16LE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,2,32767,-32768),this[u]=c&255,this[u+1]=c>>>8,u+2},s.prototype.writeInt16BE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,2,32767,-32768),this[u]=c>>>8,this[u+1]=c&255,u+2},s.prototype.writeInt32LE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,4,2147483647,-2147483648),this[u]=c&255,this[u+1]=c>>>8,this[u+2]=c>>>16,this[u+3]=c>>>24,u+4},s.prototype.writeInt32BE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4};function he(h,c,u,v,x,O){if(u+v>h.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function qe(h,c,u,v,x){return c=+c,u=u>>>0,x||he(h,c,u,4),ri.write(h,c,u,v,23,4),u+4}s.prototype.writeFloatLE=function(c,u,v){return qe(this,c,u,!0,v)},s.prototype.writeFloatBE=function(c,u,v){return qe(this,c,u,!1,v)};function Ze(h,c,u,v,x){return c=+c,u=u>>>0,x||he(h,c,u,8),ri.write(h,c,u,v,52,8),u+8}s.prototype.writeDoubleLE=function(c,u,v){return Ze(this,c,u,!0,v)},s.prototype.writeDoubleBE=function(c,u,v){return Ze(this,c,u,!1,v)},s.prototype.copy=function(c,u,v,x){if(!s.isBuffer(c))throw new TypeError("argument should be a Buffer");if(v||(v=0),!x&&x!==0&&(x=this.length),u>=c.length&&(u=c.length),u||(u=0),x>0&&x<v&&(x=v),x===v||c.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("sourceEnd out of bounds");x>this.length&&(x=this.length),c.length-u<x-v&&(x=c.length-u+v);var O=x-v;return this===c&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,v,x):Uint8Array.prototype.set.call(c,this.subarray(v,x),u),O},s.prototype.fill=function(c,u,v,x){if(typeof c=="string"){if(typeof u=="string"?(x=u,u=0,v=this.length):typeof v=="string"&&(x=v,v=this.length),x!==void 0&&typeof x!="string")throw new TypeError("encoding must be a string");if(typeof x=="string"&&!s.isEncoding(x))throw new TypeError("Unknown encoding: "+x);if(c.length===1){var O=c.charCodeAt(0);(x==="utf8"&&O<128||x==="latin1")&&(c=O)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(u<0||this.length<u||this.length<v)throw new RangeError("Out of range index");if(v<=u)return this;u=u>>>0,v=v===void 0?this.length:v>>>0,c||(c=0);var W;if(typeof c=="number")for(W=u;W<v;++W)this[W]=c;else{var ue=s.isBuffer(c)?c:s.from(c,x),_e=ue.length;if(_e===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(W=0;W<v-u;++W)this[W+u]=ue[W%_e]}return this};var et=/[^+/0-9A-Za-z-_]/g;function vt(h){if(h=h.split("=")[0],h=h.trim().replace(et,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Et(h,c){c=c||1/0;for(var u,v=h.length,x=null,O=[],W=0;W<v;++W){if(u=h.charCodeAt(W),u>55295&&u<57344){if(!x){if(u>56319){(c-=3)>-1&&O.push(239,191,189);continue}else if(W+1===v){(c-=3)>-1&&O.push(239,191,189);continue}x=u;continue}if(u<56320){(c-=3)>-1&&O.push(239,191,189),x=u;continue}u=(x-55296<<10|u-56320)+65536}else x&&(c-=3)>-1&&O.push(239,191,189);if(x=null,u<128){if((c-=1)<0)break;O.push(u)}else if(u<2048){if((c-=2)<0)break;O.push(u>>6|192,u&63|128)}else if(u<65536){if((c-=3)<0)break;O.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((c-=4)<0)break;O.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return O}function it(h){for(var c=[],u=0;u<h.length;++u)c.push(h.charCodeAt(u)&255);return c}function be(h,c){for(var u,v,x,O=[],W=0;W<h.length&&!((c-=2)<0);++W)u=h.charCodeAt(W),v=u>>8,x=u%256,O.push(x),O.push(v);return O}function He(h){return Gf.toByteArray(vt(h))}function Ae(h,c,u,v){for(var x=0;x<v&&!(x+u>=c.length||x>=h.length);++x)c[x+u]=h[x];return x}function $e(h,c){return h instanceof c||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===c.name}function De(h){return h!==h}var $t=(function(){for(var h="0123456789abcdef",c=new Array(256),u=0;u<16;++u)for(var v=u*16,x=0;x<16;++x)c[v+x]=h[u]+h[x];return c})()}),Ie=bc.Buffer;bc.SlowBuffer;bc.INSPECT_MAX_BYTES;bc.kMaxLength;var Xf=function(e,r){return Xf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},Xf(e,r)};function Sc(t,e){Xf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var oo=(function(t){Sc(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e})(Error),Xe=(function(t){Sc(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e})(TypeError);function _c(t){return t&&t.Math==Math&&t}function wg(){return _c(typeof globalThis=="object"&&globalThis)||_c(typeof window=="object"&&window)||_c(typeof self=="object"&&self)||_c(typeof global=="object"&&global)||Function("return this")()}function hS(){var t=wg();return typeof t.navigator=="object"&&t.navigator.product==="ReactNative"}var gS=function(e){var r=hS()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var n=Ie.alloc(e),o=0;o<e;++o)n[o]=Math.floor(Math.random()*256);return n},yS=function(){{if(typeof window<"u"){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(Ie.alloc(e))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(e){return global.crypto.getRandomValues(Ie.alloc(e))}:gS}},bg=yS();function vS(t){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(t))}function Qf(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function ES(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function _S(t){return ss(t)&&Object.prototype.toString.call(t)==="[object Date]"}function ss(t){return typeof t=="object"&&t!==null}function Tc(t,e){var r=!1;function n(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return r||(console.warn(e),r=!0),t.apply(this,o)}return n}function wc(t){if(ArrayBuffer.isView(t))return Ie.from(t.buffer,t.byteOffset,t.byteLength);if(vS(t))return Ie.from(t);throw new Xe("Must use either Buffer or TypedArray")}var wS=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,Sg=function(t){return typeof t=="string"&&wS.test(t)},Jf=function(t){if(!Sg(t))throw new Xe('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var e=t.replace(/-/g,"");return Ie.from(e,"hex")},ig=function(t,e){return e===void 0&&(e=!0),e?t.toString("hex",0,4)+"-"+t.toString("hex",4,6)+"-"+t.toString("hex",6,8)+"-"+t.toString("hex",8,10)+"-"+t.toString("hex",10,16):t.toString("hex")};var ZU=Math.pow(2,63)-1,ek=-Math.pow(2,63),bS=Math.pow(2,53),SS=-Math.pow(2,53);var Tg=4;var io=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(e!=null&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer)&&!Array.isArray(e))throw new Xe("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??t.BSON_BINARY_SUBTYPE_DEFAULT,e==null?(this.buffer=Ie.alloc(t.BUFFER_SIZE),this.position=0):(typeof e=="string"?this.buffer=Ie.from(e,"binary"):Array.isArray(e)?this.buffer=Ie.from(e):this.buffer=wc(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if(typeof e=="string"&&e.length!==1)throw new Xe("only accepts single character String");if(typeof e!="number"&&e.length!==1)throw new Xe("only accepts single character Uint8Array or Array");var r;if(typeof e=="string"?r=e.charCodeAt(0):typeof e=="number"?r=e:r=e[0],r<0||r>255)throw new Xe("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=Ie.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},t.prototype.write=function(e,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+e.length){var n=Ie.alloc(this.buffer.length+e.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(e)?(this.buffer.set(wc(e),r),this.position=r+e.byteLength>this.position?r+e.length:this.position):typeof e=="string"&&(this.buffer.write(e,r,e.length,"binary"),this.position=r+e.length>this.position?r+e.length:this.position)},t.prototype.read=function(e,r){return r=r&&r>0?r:this.position,this.buffer.slice(e,e+r)},t.prototype.value=function(e){return e=!!e,e&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(e){return this.buffer.toString(e)},t.prototype.toExtendedJSON=function(e){e=e||{};var r=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return e.legacy?{$binary:r,$type:n.length===1?"0"+n:n}:{$binary:{base64:r,subType:n.length===1?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new sg(this.buffer.slice(0,this.position));throw new oo('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(e,r){r=r||{};var n,o;if("$binary"in e?r.legacy&&typeof e.$binary=="string"&&"$type"in e?(o=e.$type?parseInt(e.$type,16):0,n=Ie.from(e.$binary,"base64")):typeof e.$binary!="string"&&(o=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=Ie.from(e.$binary.base64,"base64")):"$uuid"in e&&(o=4,n=Jf(e.$uuid)),!n)throw new Xe("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return o===Tg?new sg(n):new t(n,o)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t})();Object.defineProperty(io.prototype,"_bsontype",{value:"Binary"});var qf=16,sg=(function(t){Sc(e,t);function e(r){var n=this,o,i;if(r==null)o=e.generate();else if(r instanceof e)o=Ie.from(r.buffer),i=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===qf)o=wc(r);else if(typeof r=="string")o=Jf(r);else throw new Xe("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return n=t.call(this,o,Tg)||this,n.__id=i,n}return Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,e.cacheHexString&&(this.__id=ig(r))},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(r){if(r===void 0&&(r=!0),e.cacheHexString&&this.__id)return this.__id;var n=ig(this.id,r);return e.cacheHexString&&(this.__id=n),n},e.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(r){if(!r)return!1;if(r instanceof e)return r.id.equals(this.id);try{return new e(r).id.equals(this.id)}catch{return!1}},e.prototype.toBinary=function(){return new io(this.id,io.SUBTYPE_UUID)},e.generate=function(){var r=bg(qf);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ie.from(r)},e.isValid=function(r){return r?r instanceof e?!0:typeof r=="string"?Sg(r):Qf(r)?r.length!==qf?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},e.createFromHexString=function(r){var n=Jf(r);return new e(n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},e})(io),Ic=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);this.code=e,this.scope=r}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},t})();Object.defineProperty(Ic.prototype,"_bsontype",{value:"Code"});function TS(t){return ss(t)&&t.$id!=null&&typeof t.$ref=="string"&&(t.$db==null||typeof t.$db=="string")}var os=(function(){function t(e,r,n,o){if(!(this instanceof t))return new t(e,r,n,o);var i=e.split(".");i.length===2&&(n=i.shift(),e=i.shift()),this.collection=e,this.oid=r,this.db=n,this.fields=o||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(e.$db=this.db),e},t.prototype.toExtendedJSON=function(e){e=e||{};var r={$ref:this.collection,$id:this.oid};return e.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},t.fromExtendedJSON=function(e){var r=Object.assign({},e);return delete r.$ref,delete r.$id,delete r.$db,new t(e.$ref,e.$id,e.$db,r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t})();Object.defineProperty(os.prototype,"_bsontype",{value:"DBRef"});var or=void 0;try{or=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var ag=65536,IS=1<<24,oi=ag*ag,Ig=oi*oi,cg=Ig/2,lg={},ug={},oe=(function(){function t(e,r,n){if(e===void 0&&(e=0),!(this instanceof t))return new t(e,r,n);typeof e=="bigint"?Object.assign(this,t.fromBigInt(e,!!r)):typeof e=="string"?Object.assign(this,t.fromString(e,!!r)):(this.low=e|0,this.high=r|0,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,r,n){return new t(e,r,n)},t.fromInt=function(e,r){var n,o,i;return r?(e>>>=0,(i=0<=e&&e<256)&&(o=ug[e],o)?o:(n=t.fromBits(e,(e|0)<0?-1:0,!0),i&&(ug[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(o=lg[e],o)?o:(n=t.fromBits(e,e<0?-1:0,!1),i&&(lg[e]=n),n))},t.fromNumber=function(e,r){if(isNaN(e))return r?t.UZERO:t.ZERO;if(r){if(e<0)return t.UZERO;if(e>=Ig)return t.MAX_UNSIGNED_VALUE}else{if(e<=-cg)return t.MIN_VALUE;if(e+1>=cg)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%oi|0,e/oi|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t.ZERO;if(typeof r=="number"?(n=r,r=!1):r=!!r,n=n||10,n<2||36<n)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(o===0)return t.fromString(e.substring(1),r,n).neg();for(var i=t.fromNumber(Math.pow(n,8)),s=t.ZERO,a=0;a<e.length;a+=8){var l=Math.min(8,e.length-a),f=parseInt(e.substring(a,a+l),n);if(l<8){var m=t.fromNumber(Math.pow(n,l));s=s.mul(m).add(t.fromNumber(f))}else s=s.mul(i),s=s.add(t.fromNumber(f))}return s.unsigned=r,s},t.fromBytes=function(e,r,n){return n?t.fromBytesLE(e,r):t.fromBytesBE(e,r)},t.fromBytesLE=function(e,r){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)},t.fromBytesBE=function(e,r){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)},t.isLong=function(e){return ss(e)&&e.__isLong__===!0},t.fromValue=function(e,r){return typeof e=="number"?t.fromNumber(e,r):typeof e=="string"?t.fromString(e,r):t.fromBits(e.low,e.high,typeof r=="boolean"?r:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var r=this.high>>>16,n=this.high&65535,o=this.low>>>16,i=this.low&65535,s=e.high>>>16,a=e.high&65535,l=e.low>>>16,f=e.low&65535,m=0,d=0,_=0,y=0;return y+=i+f,_+=y>>>16,y&=65535,_+=o+l,d+=_>>>16,_&=65535,d+=n+a,m+=d>>>16,d&=65535,m+=r+s,m&=65535,t.fromBits(_<<16|y,m<<16|d,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(e){return this.compare(e)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(or){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?or.div_u:or.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,or.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,o,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;i=t.UZERO}else{if(this.eq(t.MIN_VALUE)){if(e.eq(t.ONE)||e.eq(t.NEG_ONE))return t.MIN_VALUE;if(e.eq(t.MIN_VALUE))return t.ONE;var s=this.shr(1);return n=s.div(e).shl(1),n.eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(o=this.sub(e.mul(n)),i=n.add(o.div(e)),i)}else if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=t.ZERO}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),l=a<=48?1:Math.pow(2,a-48),f=t.fromNumber(n),m=f.mul(e);m.isNegative()||m.gt(o);)n-=l,f=t.fromNumber(n,this.unsigned),m=f.mul(e);f.isZero()&&(f=t.ONE),i=i.add(f),o=o.sub(m)}return i},t.prototype.div=function(e){return this.divide(e)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},t.prototype.eq=function(e){return this.equals(e)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(e&1<<r)===0;r--);return this.high!==0?r+33:r+1},t.prototype.greaterThan=function(e){return this.comp(e)>0},t.prototype.gt=function(e){return this.greaterThan(e)},t.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},t.prototype.gte=function(e){return this.greaterThanOrEqual(e)},t.prototype.ge=function(e){return this.greaterThanOrEqual(e)},t.prototype.isEven=function(){return(this.low&1)===0},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return(this.low&1)===1},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return this.high===0&&this.low===0},t.prototype.lessThan=function(e){return this.comp(e)<0},t.prototype.lt=function(e){return this.lessThan(e)},t.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},t.prototype.lte=function(e){return this.lessThanOrEqual(e)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),or){var r=(this.unsigned?or.rem_u:or.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,or.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(e){return this.modulo(e)},t.prototype.rem=function(e){return this.modulo(e)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),or){var r=or.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,or.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=this.high&65535,i=this.low>>>16,s=this.low&65535,a=e.high>>>16,l=e.high&65535,f=e.low>>>16,m=e.low&65535,d=0,_=0,y=0,C=0;return C+=s*m,y+=C>>>16,C&=65535,y+=i*m,_+=y>>>16,y&=65535,y+=s*f,_+=y>>>16,y&=65535,_+=o*m,d+=_>>>16,_&=65535,_+=i*f,d+=_>>>16,_&=65535,_+=s*l,d+=_>>>16,_&=65535,d+=n*m+o*f+i*l+s*a,d&=65535,t.fromBits(y<<16|C,d<<16|_,this.unsigned)},t.prototype.mul=function(e){return this.multiply(e)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(e){return!this.equals(e)},t.prototype.neq=function(e){return this.notEquals(e)},t.prototype.ne=function(e){return this.notEquals(e)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(e){return this.shiftLeft(e)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(e){return this.shiftRight(e)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),e&=63,e===0)return this;var r=this.high;if(e<32){var n=this.low;return t.fromBits(n>>>e|r<<32-e,r>>>e,this.unsigned)}else return e===32?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},t.prototype.shru=function(e){return this.shiftRightUnsigned(e)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(e){return this.subtract(e)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*oi+(this.low>>>0):this.high*oi+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},t.prototype.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(t.MIN_VALUE)){var r=t.fromNumber(e),n=this.div(r),o=n.mul(r).sub(this);return n.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var i=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,a="";;){var l=s.div(i),f=s.sub(l.mul(i)).toInt()>>>0,m=f.toString(e);if(s=l,s.isZero())return m+a;for(;m.length<6;)m="0"+m;a=""+m+a}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(e){return this.lessThanOrEqual(e)},t.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,r){var n=t.fromString(e.$numberLong);return r&&r.relaxed?n.toNumber():n},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},t.TWO_PWR_24=t.fromInt(IS),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t})();Object.defineProperty(oe.prototype,"__isLong__",{value:!0});Object.defineProperty(oe.prototype,"_bsontype",{value:"Long"});var xS=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,CS=/^(\+|-)?(Infinity|inf)$/i,RS=/^(\+|-)?NaN$/i,ns=6111,zf=-6176,fg=6176,AS=34,Yf=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),pg=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),mg=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),DS=/^([-+])?(\d+)?$/,OS=31,dg=16383,NS=30,PS=31;function hg(t){return!isNaN(parseInt(t,10))}function LS(t){var e=oe.fromNumber(1e9),r=oe.fromNumber(0);if(!t.parts[0]&&!t.parts[1]&&!t.parts[2]&&!t.parts[3])return{quotient:t,rem:r};for(var n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new oe(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function MS(t,e){if(!t&&!e)return{high:oe.fromNumber(0),low:oe.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new oe(t.getLowBits(),0),o=e.shiftRightUnsigned(32),i=new oe(e.getLowBits(),0),s=r.multiply(o),a=r.multiply(i),l=n.multiply(o),f=n.multiply(i);return s=s.add(a.shiftRightUnsigned(32)),a=new oe(a.getLowBits(),0).add(l).add(f.shiftRightUnsigned(32)),s=s.add(a.shiftRightUnsigned(32)),f=a.shiftLeft(32).add(new oe(f.getLowBits(),0)),{high:s,low:f}}function BS(t,e){var r=t.high>>>0,n=e.high>>>0;if(r<n)return!0;if(r===n){var o=t.low>>>0,i=e.low>>>0;if(o<i)return!0}return!1}function ni(t,e){throw new Xe('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var Zf=(function(){function t(e){if(!(this instanceof t))return new t(e);if(typeof e=="string")this.bytes=t.fromString(e).bytes;else if(Qf(e)){if(e.byteLength!==16)throw new Xe("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new Xe("Decimal128 must take a Buffer or string")}return t.fromString=function(e){var r=!1,n=!1,o=!1,i=0,s=0,a=0,l=0,f=0,m=[0],d=0,_=0,y=0,C=0,N=0,A=0,B=new oe(0,0),q=new oe(0,0),P=0,Q=0;if(e.length>=7e3)throw new Xe(""+e+" not a valid Decimal128 string");var Ee=e.match(xS),X=e.match(CS),ce=e.match(RS);if(!Ee&&!X&&!ce||e.length===0)throw new Xe(""+e+" not a valid Decimal128 string");if(Ee){var se=Ee[2],de=Ee[4],Le=Ee[5],Se=Ee[6];de&&Se===void 0&&ni(e,"missing exponent power"),de&&se===void 0&&ni(e,"missing exponent base"),de===void 0&&(Le||Se)&&ni(e,"missing e before exponent")}if((e[Q]==="+"||e[Q]==="-")&&(r=e[Q++]==="-"),!hg(e[Q])&&e[Q]!=="."){if(e[Q]==="i"||e[Q]==="I")return new t(Ie.from(r?pg:mg));if(e[Q]==="N")return new t(Ie.from(Yf))}for(;hg(e[Q])||e[Q]===".";){if(e[Q]==="."){n&&ni(e,"contains multiple periods"),n=!0,Q=Q+1;continue}d<34&&(e[Q]!=="0"||o)&&(o||(f=s),o=!0,m[_++]=parseInt(e[Q],10),d=d+1),o&&(a=a+1),n&&(l=l+1),s=s+1,Q=Q+1}if(n&&!s)throw new Xe(""+e+" not a valid Decimal128 string");if(e[Q]==="e"||e[Q]==="E"){var Re=e.substr(++Q).match(DS);if(!Re||!Re[2])return new t(Ie.from(Yf));N=parseInt(Re[0],10),Q=Q+Re[0].length}if(e[Q])return new t(Ie.from(Yf));if(y=0,!d)y=0,C=0,m[0]=0,a=1,d=1,i=0;else if(C=d-1,i=a,i!==1)for(;m[f+i-1]===0;)i=i-1;for(N<=l&&l-N>16384?N=zf:N=N-l;N>ns;){if(C=C+1,C-y>AS){var Ge=m.join("");if(Ge.match(/^0+$/)){N=ns;break}ni(e,"overflow")}N=N-1}for(;N<zf||d<a;){if(C===0&&i<d){N=zf,i=0;break}if(d<a?a=a-1:C=C-1,N<ns)N=N+1;else{var Ge=m.join("");if(Ge.match(/^0+$/)){N=ns;break}ni(e,"overflow")}}if(C-y+1<i){var Je=s;n&&(f=f+1,Je=Je+1),r&&(f=f+1,Je=Je+1);var Bt=parseInt(e[f+C+1],10),D=0;if(Bt>=5&&(D=1,Bt===5)){for(D=m[C]%2===1?1:0,A=f+C+2;A<Je;A++)if(parseInt(e[A],10)){D=1;break}}if(D){for(var R=C;R>=0;R--)if(++m[R]>9&&(m[R]=0,R===0))if(N<ns)N=N+1,m[R]=1;else return new t(Ie.from(r?pg:mg))}}if(B=oe.fromNumber(0),q=oe.fromNumber(0),i===0)B=oe.fromNumber(0),q=oe.fromNumber(0);else if(C-y<17){var R=y;for(q=oe.fromNumber(m[R++]),B=new oe(0,0);R<=C;R++)q=q.multiply(oe.fromNumber(10)),q=q.add(oe.fromNumber(m[R]))}else{var R=y;for(B=oe.fromNumber(m[R++]);R<=C-17;R++)B=B.multiply(oe.fromNumber(10)),B=B.add(oe.fromNumber(m[R]));for(q=oe.fromNumber(m[R++]);R<=C;R++)q=q.multiply(oe.fromNumber(10)),q=q.add(oe.fromNumber(m[R]))}var V=MS(B,oe.fromString("100000000000000000"));V.low=V.low.add(q),BS(V.low,q)&&(V.high=V.high.add(oe.fromNumber(1))),P=N+fg;var k={low:oe.fromNumber(0),high:oe.fromNumber(0)};V.high.shiftRightUnsigned(49).and(oe.fromNumber(1)).equals(oe.fromNumber(1))?(k.high=k.high.or(oe.fromNumber(3).shiftLeft(61)),k.high=k.high.or(oe.fromNumber(P).and(oe.fromNumber(16383).shiftLeft(47))),k.high=k.high.or(V.high.and(oe.fromNumber(0x7fffffffffff)))):(k.high=k.high.or(oe.fromNumber(P&16383).shiftLeft(49)),k.high=k.high.or(V.high.and(oe.fromNumber(562949953421311)))),k.low=V.low,r&&(k.high=k.high.or(oe.fromString("9223372036854775808")));var H=Ie.alloc(16);return Q=0,H[Q++]=k.low.low&255,H[Q++]=k.low.low>>8&255,H[Q++]=k.low.low>>16&255,H[Q++]=k.low.low>>24&255,H[Q++]=k.low.high&255,H[Q++]=k.low.high>>8&255,H[Q++]=k.low.high>>16&255,H[Q++]=k.low.high>>24&255,H[Q++]=k.high.low&255,H[Q++]=k.high.low>>8&255,H[Q++]=k.high.low>>16&255,H[Q++]=k.high.low>>24&255,H[Q++]=k.high.high&255,H[Q++]=k.high.high>>8&255,H[Q++]=k.high.high>>16&255,H[Q++]=k.high.high>>24&255,new t(H)},t.prototype.toString=function(){for(var e,r=0,n=new Array(36),o=0;o<n.length;o++)n[o]=0;var i=0,s=!1,a,l={parts:[0,0,0,0]},f,m,d=[];i=0;var _=this.bytes,y=_[i++]|_[i++]<<8|_[i++]<<16|_[i++]<<24,C=_[i++]|_[i++]<<8|_[i++]<<16|_[i++]<<24,N=_[i++]|_[i++]<<8|_[i++]<<16|_[i++]<<24,A=_[i++]|_[i++]<<8|_[i++]<<16|_[i++]<<24;i=0;var B={low:new oe(y,C),high:new oe(N,A)};B.high.lessThan(oe.ZERO)&&d.push("-");var q=A>>26&OS;if(q>>3===3){if(q===NS)return d.join("")+"Infinity";if(q===PS)return"NaN";e=A>>15&dg,a=8+(A>>14&1)}else a=A>>14&7,e=A>>17&dg;var P=e-fg;if(l.parts[0]=(A&16383)+((a&15)<<14),l.parts[1]=N,l.parts[2]=C,l.parts[3]=y,l.parts[0]===0&&l.parts[1]===0&&l.parts[2]===0&&l.parts[3]===0)s=!0;else for(m=3;m>=0;m--){var Q=0,Ee=LS(l);if(l=Ee.quotient,Q=Ee.rem.low,!!Q)for(f=8;f>=0;f--)n[m*9+f]=Q%10,Q=Math.floor(Q/10)}if(s)r=1,n[i]=0;else for(r=36;!n[i];)r=r-1,i=i+1;var X=r-1+P;if(X>=34||X<=-7||P>0){if(r>34)return d.push("".concat(0)),P>0?d.push("E+".concat(P)):P<0&&d.push("E".concat(P)),d.join("");d.push("".concat(n[i++])),r=r-1,r&&d.push(".");for(var o=0;o<r;o++)d.push("".concat(n[i++]));d.push("E"),X>0?d.push("+".concat(X)):d.push("".concat(X))}else if(P>=0)for(var o=0;o<r;o++)d.push("".concat(n[i++]));else{var ce=r+P;if(ce>0)for(var o=0;o<ce;o++)d.push("".concat(n[i++]));else d.push("0");for(d.push(".");ce++<0;)d.push("0");for(var o=0;o<r-Math.max(ce-1,0);o++)d.push("".concat(n[i++]))}return d.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t})();Object.defineProperty(Zf.prototype,"_bsontype",{value:"Decimal128"});var xc=(function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},t.fromExtendedJSON=function(e,r){var n=parseFloat(e.$numberDouble);return r&&r.relaxed?n:new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},t})();Object.defineProperty(xc.prototype,"_bsontype",{value:"Double"});var Cc=(function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e|0}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,r){return r&&r.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},t})();Object.defineProperty(Cc.prototype,"_bsontype",{value:"Int32"});var ep=(function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$maxKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MaxKey()"},t})();Object.defineProperty(ep.prototype,"_bsontype",{value:"MaxKey"});var tp=(function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$minKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MinKey()"},t})();Object.defineProperty(tp.prototype,"_bsontype",{value:"MinKey"});var US=new RegExp("^[0-9a-fA-F]{24}$"),no=null,Ur=Symbol("id"),gt=(function(){function t(e){if(!(this instanceof t))return new t(e);var r;if(typeof e=="object"&&e&&"id"in e){if(typeof e.id!="string"&&!ArrayBuffer.isView(e.id))throw new Xe("Argument passed in must have an id that is of type string or Buffer");"toHexString"in e&&typeof e.toHexString=="function"?r=Ie.from(e.toHexString(),"hex"):r=e.id}else r=e;if(r==null||typeof r=="number")this[Ur]=t.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[Ur]=r instanceof Ie?r:wc(r);else if(typeof r=="string")if(r.length===12){var n=Ie.from(r);if(n.byteLength===12)this[Ur]=n;else throw new Xe("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&US.test(r))this[Ur]=Ie.from(r,"hex");else throw new Xe("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new Xe("Argument passed in does not match the accepted types");t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[Ur]},set:function(e){this[Ur]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){typeof e!="number"&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=Ie.alloc(12);return n.writeUInt32BE(e,0),no===null&&(no=bg(5)),n[4]=no[0],n[5]=no[1],n[6]=no[2],n[7]=no[3],n[8]=no[4],n[11]=r&255,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(e==null)return!1;if(e instanceof t)return this[Ur][11]===e[Ur][11]&&this[Ur].equals(e[Ur]);if(typeof e=="string"&&t.isValid(e)&&e.length===12&&Qf(this.id))return e===Ie.prototype.toString.call(this.id,"latin1");if(typeof e=="string"&&t.isValid(e)&&e.length===24)return e.toLowerCase()===this.toHexString();if(typeof e=="string"&&t.isValid(e)&&e.length===12)return Ie.from(e).equals(this.id);if(typeof e=="object"&&"toHexString"in e&&typeof e.toHexString=="function"){var r=e.toHexString(),n=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===n}return!1},t.prototype.getTimestamp=function(){var e=new Date,r=this.id.readUInt32BE(0);return e.setTime(Math.floor(r)*1e3),e},t.createPk=function(){return new t},t.createFromTime=function(e){var r=Ie.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(e,0),new t(r)},t.createFromHexString=function(e){if(typeof e>"u"||e!=null&&e.length!==24)throw new Xe("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(Ie.from(e,"hex"))},t.isValid=function(e){if(e==null)return!1;try{return new t(e),!0}catch{return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},t.index=Math.floor(Math.random()*16777215),t})();Object.defineProperty(gt.prototype,"generate",{value:Tc(function(t){return gt.generate(t)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(gt.prototype,"getInc",{value:Tc(function(){return gt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(gt.prototype,"get_inc",{value:Tc(function(){return gt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(gt,"get_inc",{value:Tc(function(){return gt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(gt.prototype,"_bsontype",{value:"ObjectID"});function kS(t){return t.split("").sort().join("")}var is=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=kS(r??""),this.pattern.indexOf("\0")!==-1)throw new oo("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new oo("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if(!(this.options[n]==="i"||this.options[n]==="m"||this.options[n]==="x"||this.options[n]==="l"||this.options[n]==="s"||this.options[n]==="u"))throw new oo("The regular expression option [".concat(this.options[n],"] is not supported"))}return t.parseOptions=function(e){return e?e.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(e){return e=e||{},e.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e)if(typeof e.$regex!="string"){if(e.$regex._bsontype==="BSONRegExp")return e}else return new t(e.$regex,t.parseOptions(e.$options));if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new Xe("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t})();Object.defineProperty(is.prototype,"_bsontype",{value:"BSONRegExp"});var rp=(function(){function t(e){if(!(this instanceof t))return new t(e);this.value=e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(){return this.value},t.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(){return{$symbol:this.value}},t.fromExtendedJSON=function(e){return new t(e.$symbol)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t})();Object.defineProperty(rp.prototype,"_bsontype",{value:"Symbol"});var FS=oe,xg=(function(t){Sc(e,t);function e(r,n){var o=this;return o instanceof e?(oe.isLong(r)?o=t.call(this,r.low,r.high,!0)||this:ss(r)&&typeof r.t<"u"&&typeof r.i<"u"?o=t.call(this,r.i,r.t,!0)||this:o=t.call(this,r,n,!0)||this,Object.defineProperty(o,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),o):new e(r,n)}return e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(r){return new e(oe.fromInt(r,!0))},e.fromNumber=function(r){return new e(oe.fromNumber(r,!0))},e.fromBits=function(r,n){return new e(r,n)},e.fromString=function(r,n){return new e(oe.fromString(r,!0,n))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(r){return new e(r.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},e.MAX_VALUE=oe.MAX_UNSIGNED_VALUE,e})(FS);function HS(t){return ss(t)&&Reflect.has(t,"_bsontype")&&typeof t._bsontype=="string"}var Cg=2147483647,Rg=-2147483648,Ag=9223372036854776e3,Dg=-9223372036854776e3,$S={$oid:gt,$binary:io,$uuid:io,$symbol:rp,$numberInt:Cc,$numberDecimal:Zf,$numberDouble:xc,$numberLong:oe,$minKey:tp,$maxKey:ep,$regex:is,$regularExpression:is,$timestamp:xg};function Og(t,e){if(e===void 0&&(e={}),typeof t=="number"){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=Rg&&t<=Cg)return new Cc(t);if(t>=Dg&&t<=Ag)return oe.fromNumber(t)}return new xc(t)}if(t==null||typeof t!="object")return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter(function(d){return d.startsWith("$")&&t[d]!=null}),n=0;n<r.length;n++){var o=$S[r[n]];if(o)return o.fromExtendedJSON(t,e)}if(t.$date!=null){var i=t.$date,s=new Date;return e.legacy?typeof i=="number"?s.setTime(i):typeof i=="string"&&s.setTime(Date.parse(i)):typeof i=="string"?s.setTime(Date.parse(i)):oe.isLong(i)?s.setTime(i.toNumber()):typeof i=="number"&&e.relaxed&&s.setTime(i),s}if(t.$code!=null){var a=Object.assign({},t);return t.$scope&&(a.$scope=Og(t.$scope)),Ic.fromExtendedJSON(t)}if(TS(t)||t.$dbPointer){var l=t.$ref?t:t.$dbPointer;if(l instanceof os)return l;var f=Object.keys(l).filter(function(d){return d.startsWith("$")}),m=!0;if(f.forEach(function(d){["$ref","$id","$db"].indexOf(d)===-1&&(m=!1)}),m)return os.fromExtendedJSON(l)}return t}function VS(t,e){return t.map(function(r,n){e.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Rn(r,e)}finally{e.seenObjects.pop()}})}function gg(t){var e=t.toISOString();return t.getUTCMilliseconds()!==0?e:e.slice(0,-5)+"Z"}function Rn(t,e){if((typeof t=="object"||typeof t=="function")&&t!==null){var r=e.seenObjects.findIndex(function(B){return B.obj===t});if(r!==-1){var n=e.seenObjects.map(function(B){return B.propertyName}),o=n.slice(0,r).map(function(B){return"".concat(B," -> ")}).join(""),i=n[r],s=" -> "+n.slice(r+1,n.length-1).map(function(B){return"".concat(B," -> ")}).join(""),a=n[n.length-1],l=" ".repeat(o.length+i.length/2),f="-".repeat(s.length+(i.length+a.length)/2-1);throw new Xe(`Converting circular structure to EJSON:
|
|
24
|
+
Url: ${Ia(t)}`),!0}return!1}function Q_(t,e){return e?.length?ba(t).some(r=>Ao(r,e)):!1}function Z_(t,e){if(!e?.length)return!1;let r=t.transaction;return r?Ao(r,e):!1}function eb(t,e){if(!e?.length)return!1;let r=Ia(t);return r?Ao(r,e):!1}function tb(t,e){if(!e?.length)return!0;let r=Ia(t);return r?Ao(r,e):!0}function rb(t=[]){for(let e=t.length-1;e>=0;e--){let r=t[e];if(r&&r.filename!=="<anonymous>"&&r.filename!=="[native code]")return r.filename||null}return null}function Ia(t){try{let r=[...t.exception?.values??[]].reverse().find(n=>n.mechanism?.parent_id===void 0&&n.stacktrace?.frames?.length)?.stacktrace?.frames;return r?rb(r):null}catch{return ie&&ee.error(`Cannot extract url for event ${Cr(t)}`),null}}function nb(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function Vu(t,e,r,n,o,i){if(!o.exception?.values||!i||!gr(i.originalException,Error))return;let s=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;s&&(o.exception.values=$u(t,e,n,i.originalException,r,o.exception.values,s,0))}function $u(t,e,r,n,o,i,s,a){if(i.length>=r+1)return i;let l=[...i];if(gr(n[o],Error)){$d(s,a);let f=t(e,n[o]),m=l.length;Vd(f,o,m,a),l=$u(t,e,r,n[o],o,[f,...l],f,m)}return Array.isArray(n.errors)&&n.errors.forEach((f,m)=>{if(gr(f,Error)){$d(s,a);let d=t(e,f),_=l.length;Vd(d,`errors[${m}]`,_,a),l=$u(t,e,r,f,o,[d,...l],d,_)}}),l}function $d(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Z(E(E({},t.mechanism),t.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:e})}function Vd(t,e,r,n){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Z(E({},t.mechanism),{type:"chained",source:e,exception_id:r,parent_id:n})}function Wu(t){let e="console";Ot(e,t),Nt(e,ob)}function ob(){"console"in pe&&Kl.forEach(function(t){t in pe.console&&ct(pe.console,t,function(e){return xo[t]=e,function(...r){at("console",{args:r,level:t}),xo[t]?.apply(pe.console,r)}})})}function ju(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var ib="Dedupe",sb=()=>{let t;return{name:ib,processEvent(e){if(e.type)return e;try{if(ab(e,t))return ie&&ee.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Ca=sb;function ab(t,e){return e?!!(cb(t,e)||lb(t,e)):!1}function cb(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Gd(t,e)||!jd(t,e))}function lb(t,e){let r=Wd(e),n=Wd(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Gd(t,e)||!jd(t,e))}function jd(t,e){let r=ea(t),n=ea(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let o=0;o<n.length;o++){let i=n[o],s=r[o];if(i.filename!==s.filename||i.lineno!==s.lineno||i.colno!==s.colno||i.function!==s.function)return!1}return!0}function Gd(t,e){let r=t.fingerprint,n=e.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;r=r,n=n;try{return r.join("")===n.join("")}catch{return!1}}function Wd(t){return t.exception?.values?.[0]}function qi(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let r=e[6]||"",n=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:r,hash:n,relative:e[5]+r+n}}function Ra(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var zi=pe;function Gu(){return"history"in zi&&!!zi.history}function ub(){if(!("fetch"in zi))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Yi(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function qu(){if(typeof EdgeRuntime=="string")return!0;if(!ub())return!1;if(Yi(zi.fetch))return!0;let t=!1,e=zi.document;if(e&&typeof e.createElement=="function")try{let r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),r.contentWindow?.fetch&&(t=Yi(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){ie&&ee.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}function Yu(t,e){let r="fetch";Ot(r,t),Nt(r,()=>fb(void 0,e))}function fb(t,e=!1){e&&!qu()||ct(pe,"fetch",function(r){return function(...n){let o=new Error,{method:i,url:s}=pb(n),a={args:n,fetchData:{method:i,url:s},startTimestamp:Ut()*1e3,virtualError:o,headers:mb(n)};return t||at("fetch",E({},a)),r.apply(pe,n).then(async l=>(t?t(l):at("fetch",Z(E({},a),{endTimestamp:Ut()*1e3,response:l})),l),l=>{if(at("fetch",Z(E({},a),{endTimestamp:Ut()*1e3,error:l})),Gn(l)&&l.stack===void 0&&(l.stack=o.stack,Vt(l,"framesToPop",1)),l instanceof TypeError&&(l.message==="Failed to fetch"||l.message==="Load failed"||l.message==="NetworkError when attempting to fetch resource."))try{let f=new URL(a.fetchData.url);l.message=`${l.message} (${f.host})`}catch{}throw l})}})}function zu(t,e){return!!t&&typeof t=="object"&&!!t[e]}function qd(t){return typeof t=="string"?t:t?zu(t,"url")?t.url:t.toString?t.toString():"":""}function pb(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[r,n]=t;return{url:qd(r),method:zu(n,"method")?String(n.method).toUpperCase():"GET"}}let e=t[0];return{url:qd(e),method:zu(e,"method")?String(e.method).toUpperCase():"GET"}}function mb(t){let[e,r]=t;try{if(typeof r=="object"&&r!==null&&"headers"in r&&r.headers)return new Headers(r.headers);if(Om(e))return new Headers(e.headers)}catch{}}function Ku(){return"npm"}var Ke=pe,Xu=0;function Ju(){return Xu>0}function Cb(){Xu++,setTimeout(()=>{Xu--})}function Kn(t,e={}){function r(o){return typeof o=="function"}if(!r(t))return t;try{let o=t.__sentry_wrapped__;if(o)return typeof o=="function"?o:t;if(Yn(t))return t}catch{return t}let n=function(...o){try{let i=o.map(s=>Kn(s,e));return t.apply(this,i)}catch(i){throw Cb(),Fi(s=>{s.addEventProcessor(a=>(e.mechanism&&(Do(a,void 0,void 0),Rr(a,e.mechanism)),a.extra=Z(E({},a.extra),{arguments:o}),a)),va(i)}),i}};try{for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(n[o]=t[o])}catch{}ia(n,t),Vt(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}function zd(){let t=ki(),{referrer:e}=Ke.document||{},{userAgent:r}=Ke.navigator||{},n=E(E({},e&&{Referer:e}),r&&{"User-Agent":r});return{url:t,headers:n}}function Aa(t,e){let r=ef(t,e),n={type:Nb(e),value:Pb(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function Rb(t,e,r,n){let i=We()?.getOptions().normalizeDepth,s=Bb(e),a={__serialized__:ma(e,i)};if(s)return{exception:{values:[Aa(t,s)]},extra:a};let l={exception:{values:[{type:zn(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:Lb(e,{isUnhandledRejection:n})}]},extra:a};if(r){let f=ef(t,r);f.length&&(l.exception.values[0].stacktrace={frames:f})}return l}function Qu(t,e){return{exception:{values:[Aa(t,e)]}}}function ef(t,e){let r=e.stacktrace||e.stack||"",n=Db(e),o=Ob(e);try{return t(r,n,o)}catch{}return[]}var Ab=/Minified React error #\d+;/i;function Db(t){return t&&Ab.test(t.message)?1:0}function Ob(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Yd(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function Nb(t){let e=t?.name;return!e&&Yd(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function Pb(t){let e=t?.message;return Yd(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Kd(t,e,r,n){let o=r?.syntheticException||void 0,i=Da(t,e,o,n);return Rr(i),i.level="error",r?.event_id&&(i.event_id=r.event_id),rr(i)}function Xd(t,e,r="info",n,o){let i=n?.syntheticException||void 0,s=Zu(t,e,i,o);return s.level=r,n?.event_id&&(s.event_id=n.event_id),rr(s)}function Da(t,e,r,n,o){let i;if(ra(e)&&e.error)return Qu(t,e.error);if(na(e)||ou(e)){let s=e;if("stack"in e)i=Qu(t,e);else{let a=s.name||(na(s)?"DOMError":"DOMException"),l=s.message?`${a}: ${s.message}`:a;i=Zu(t,l,r,n),Do(i,l)}return"code"in s&&(i.tags=Z(E({},i.tags),{"DOMException.code":`${s.code}`})),i}return Gn(e)?Qu(t,e):Zr(e)||zn(e)?(i=Rb(t,e,r,o),Rr(i,{synthetic:!0}),i):(i=Zu(t,e,r,n),Do(i,`${e}`,void 0),Rr(i,{synthetic:!0}),i)}function Zu(t,e,r,n){let o={};if(n&&r){let i=ef(t,r);i.length&&(o.exception={values:[{value:e,stacktrace:{frames:i}}]}),Rr(o,{synthetic:!0})}if(Ro(e)){let{__sentry_template_string__:i,__sentry_template_values__:s}=e;return o.logentry={message:i,params:s},o}return o.message=e,o}function Lb(t,{isUnhandledRejection:e}){let r=uu(t),n=e?"promise rejection":"exception";return ra(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:zn(t)?`Event \`${Mb(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Mb(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Bb(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}var Ub=5e3,Ki=class extends ji{constructor(e){let r=kb(e),n=Ke.SENTRY_SDK_SOURCE||Ku();Fu(r,"browser",["browser"],n),super(r);let{sendDefaultPii:o,sendClientReports:i,enableLogs:s,_experiments:a}=this._options,l=s??a?.enableLogs;Ke.document&&(i||l)&&Ke.document.addEventListener("visibilitychange",()=>{Ke.document.visibilityState==="hidden"&&(i&&this._flushOutcomes(),l&&Gi(this))}),l&&(this.on("flush",()=>{Gi(this)}),this.on("afterCaptureLog",()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{Gi(this)},Ub)})),o&&(this.on("postprocessEvent",Uu),this.on("beforeSendSession",ku))}eventFromException(e,r){return Kd(this._options.stackParser,e,r,this._options.attachStacktrace)}eventFromMessage(e,r="info",n){return Xd(this._options.stackParser,e,r,n,this._options.attachStacktrace)}_prepareEvent(e,r,n,o){return e.platform=e.platform||"javascript",super._prepareEvent(e,r,n,o)}};function kb(t){return E({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Ke.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},t)}var Jd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var ut=pe;var Fb=1e3,Qd,tf,rf;function nf(t){Ot("dom",t),Nt("dom",Hb)}function Hb(){if(!ut.document)return;let t=at.bind(null,"dom"),e=Zd(t,!0);ut.document.addEventListener("click",e,!1),ut.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let o=ut[r]?.prototype;o?.hasOwnProperty?.("addEventListener")&&(ct(o,"addEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let f=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},m=f[s]=f[s]||{refCount:0};if(!m.handler){let d=Zd(t);m.handler=d,i.call(this,s,d,l)}m.refCount++}catch{}return i.call(this,s,a,l)}}),ct(o,"removeEventListener",function(i){return function(s,a,l){if(s==="click"||s=="keypress")try{let f=this.__sentry_instrumentation_handlers__||{},m=f[s];m&&(m.refCount--,m.refCount<=0&&(i.call(this,s,m.handler,l),m.handler=void 0,delete f[s]),Object.keys(f).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,a,l)}}))})}function $b(t){if(t.type!==tf)return!1;try{if(!t.target||t.target._sentryId!==rf)return!1}catch{}return!0}function Vb(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function Zd(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=Wb(r);if(Vb(r.type,n))return;Vt(r,"_sentryCaptured",!0),n&&!n._sentryId&&Vt(n,"_sentryId",lt());let o=r.type==="keypress"?"input":r.type;$b(r)||(t({event:r,name:o,global:e}),tf=r.type,rf=n?n._sentryId:void 0),clearTimeout(Qd),Qd=ut.setTimeout(()=>{rf=void 0,tf=void 0},Fb)}}function Wb(t){try{return t.target}catch{return null}}var Oa;function Xi(t){let e="history";Ot(e,t),Nt(e,jb)}function jb(){if(ut.addEventListener("popstate",()=>{let e=ut.location.href,r=Oa;if(Oa=e,r===e)return;at("history",{from:r,to:e})}),!Gu())return;function t(e){return function(...r){let n=r.length>2?r[2]:void 0;if(n){let o=Oa,i=Gb(String(n));if(Oa=i,o===i)return e.apply(this,r);at("history",{from:o,to:i})}return e.apply(this,r)}}ct(ut.history,"pushState",t),ct(ut.history,"replaceState",t)}function Gb(t){try{return new URL(t,ut.location.origin).toString()}catch{return t}}var Na={};function of(t){let e=Na[t];if(e)return e;let r=ut[t];if(Yi(r))return Na[t]=r.bind(ut);let n=ut.document;if(n&&typeof n.createElement=="function")try{let o=n.createElement("iframe");o.hidden=!0,n.head.appendChild(o);let i=o.contentWindow;i?.[t]&&(r=i[t]),n.head.removeChild(o)}catch(o){Jd&&ee.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,o)}return r&&(Na[t]=r.bind(ut))}function Pa(t){Na[t]=void 0}var Xn="__sentry_xhr_v3__";function sf(t){Ot("xhr",t),Nt("xhr",qb)}function qb(){if(!ut.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,r,n){let o=new Error,i=Ut()*1e3,s=Pt(n[0])?n[0].toUpperCase():void 0,a=zb(n[1]);if(!s||!a)return e.apply(r,n);r[Xn]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(r.__sentry_own_request__=!0);let l=()=>{let f=r[Xn];if(f&&r.readyState===4){try{f.status_code=r.status}catch{}let m={endTimestamp:Ut()*1e3,startTimestamp:i,xhr:r,virtualError:o};at("xhr",m)}};return"onreadystatechange"in r&&typeof r.onreadystatechange=="function"?r.onreadystatechange=new Proxy(r.onreadystatechange,{apply(f,m,d){return l(),f.apply(m,d)}}):r.addEventListener("readystatechange",l),r.setRequestHeader=new Proxy(r.setRequestHeader,{apply(f,m,d){let[_,y]=d,C=m[Xn];return C&&Pt(_)&&Pt(y)&&(C.request_headers[_.toLowerCase()]=y),f.apply(m,d)}}),e.apply(r,n)}}),t.send=new Proxy(t.send,{apply(e,r,n){let o=r[Xn];if(!o)return e.apply(r,n);n[0]!==void 0&&(o.body=n[0]);let i={startTimestamp:Ut()*1e3,xhr:r};return at("xhr",i),e.apply(r,n)}})}function zb(t){if(Pt(t))return t;try{return t.toString()}catch{}}function af(t,e=of("fetch")){let r=0,n=0;function o(i){let s=i.body.length;r+=s,n++;let a=E({body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return Pa("fetch"),_n("No fetch implementation available");try{return e(t.url,a).then(l=>(r-=s,n--,{statusCode:l.status,headers:{"x-sentry-rate-limits":l.headers.get("X-Sentry-Rate-Limits"),"retry-after":l.headers.get("Retry-After")}}))}catch(l){return Pa("fetch"),r-=s,n--,_n(l)}}return Sa(t,o)}var Yb=30;var Kb=50;function cf(t,e,r,n){let o={filename:t,function:e==="<anonymous>"?"?":e,in_app:!0};return r!==void 0&&(o.lineno=r),n!==void 0&&(o.colno=n),o}var Xb=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Jb=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Qb=/\((\S*)(?::(\d+))(?::(\d+))\)/,Zb=t=>{let e=Xb.exec(t);if(e){let[,n,o,i]=e;return cf(n,"?",+o,+i)}let r=Jb.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=Qb.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[o,i]=nh(r[1]||"?",r[2]);return cf(i,o,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},eh=[Yb,Zb],ew=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,tw=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,rw=t=>{let e=ew.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=tw.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let n=e[3],o=e[1]||"?";return[o,n]=nh(o,n),cf(n,o,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},th=[Kb,rw];var rh=[eh,th],lf=Zl(...rh),nh=(t,e)=>{let r=t.indexOf("safari-extension")!==-1,n=t.indexOf("safari-web-extension")!==-1;return r||n?[t.indexOf("@")!==-1?t.split("@")[0]:"?",r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var Lo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var La=1024,nw="Breadcrumbs",ow=(t={})=>{let e=E({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:nw,setup(r){e.console&&Wu(aw(r)),e.dom&&nf(sw(r,e.dom)),e.xhr&&sf(cw(r)),e.fetch&&Yu(lw(r)),e.history&&Xi(uw(r)),e.sentry&&r.on("beforeSendEvent",iw(r))}}},oh=ow;function iw(t){return function(r){We()===t&&Or({category:`sentry.${r.type==="transaction"?"transaction":"event"}`,event_id:r.event_id,level:r.level,message:Cr(r)},{event:r})}}function sw(t,e){return function(n){if(We()!==t)return;let o,i,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>La&&(Lo&&ee.warn(`\`dom.maxStringLength\` cannot exceed ${La}, but a value of ${a} was configured. Sentry will use ${La} instead.`),a=La),typeof s=="string"&&(s=[s]);try{let f=n.event,m=fw(f)?f.target:f;o=Ui(m,{keyAttrs:s,maxStringLength:a}),i=lu(m)}catch{o="<unknown>"}if(o.length===0)return;let l={category:`ui.${n.name}`,message:o};i&&(l.data={"ui.component_name":i}),Or(l,{event:n.event,name:n.name,global:n.global})}}function aw(t){return function(r){if(We()!==t)return;let n={category:"console",data:{arguments:r.args,logger:"console"},level:ju(r.level),message:oa(r.args," ")};if(r.level==="assert")if(r.args[0]===!1)n.message=`Assertion failed: ${oa(r.args.slice(1)," ")||"console.assert"}`,n.data.arguments=r.args.slice(1);else return;Or(n,{input:r.args,level:r.level})}}function cw(t){return function(r){if(We()!==t)return;let{startTimestamp:n,endTimestamp:o}=r,i=r.xhr[Xn];if(!n||!o||!i)return;let{method:s,url:a,status_code:l,body:f}=i,m={method:s,url:a,status_code:l},d={xhr:r.xhr,input:f,startTimestamp:n,endTimestamp:o},_={category:"xhr",data:m,type:"http",level:Ra(l)};t.emit("beforeOutgoingRequestBreadcrumb",_,d),Or(_,d)}}function lw(t){return function(r){if(We()!==t)return;let{startTimestamp:n,endTimestamp:o}=r;if(o&&!(r.fetchData.url.match(/sentry_key/)&&r.fetchData.method==="POST"))if(r.fetchData.method,r.fetchData.url,r.error){let i=r.fetchData,s={data:r.error,input:r.args,startTimestamp:n,endTimestamp:o},a={category:"fetch",data:i,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",a,s),Or(a,s)}else{let i=r.response,s=Z(E({},r.fetchData),{status_code:i?.status});r.fetchData.request_body_size,r.fetchData.response_body_size,i?.status;let a={input:r.args,response:i,startTimestamp:n,endTimestamp:o},l={category:"fetch",data:s,type:"http",level:Ra(s.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",l,a),Or(l,a)}}}function uw(t){return function(r){if(We()!==t)return;let n=r.from,o=r.to,i=qi(Ke.location.href),s=n?qi(n):void 0,a=qi(o);s?.path||(s=i),i.protocol===a.protocol&&i.host===a.host&&(o=a.relative),i.protocol===s.protocol&&i.host===s.host&&(n=s.relative),Or({category:"navigation",data:{from:n,to:o}})}}function fw(t){return!!t&&!!t.target}var pw=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],mw="BrowserApiErrors",dw=(t={})=>{let e=E({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},t);return{name:mw,setupOnce(){e.setTimeout&&ct(Ke,"setTimeout",ih),e.setInterval&&ct(Ke,"setInterval",ih),e.requestAnimationFrame&&ct(Ke,"requestAnimationFrame",hw),e.XMLHttpRequest&&"XMLHttpRequest"in Ke&&ct(XMLHttpRequest.prototype,"send",gw);let r=e.eventTarget;r&&(Array.isArray(r)?r:pw).forEach(o=>yw(o,e))}}},sh=dw;function ih(t){return function(...e){let r=e[0];return e[0]=Kn(r,{mechanism:{data:{function:er(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function hw(t){return function(e){return t.apply(this,[Kn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:er(t)},handled:!1,type:"instrument"}})])}}function gw(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(o=>{o in r&&typeof r[o]=="function"&&ct(r,o,function(i){let s={mechanism:{data:{function:o,handler:er(i)},handled:!1,type:"instrument"}},a=Yn(i);return a&&(s.mechanism.data.handler=er(a)),Kn(i,s)})}),t.apply(this,e)}}function yw(t,e){let n=Ke[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(ct(n,"addEventListener",function(o){return function(i,s,a){try{vw(s)&&(s.handleEvent=Kn(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:er(s),target:t},handled:!1,type:"instrument"}}))}catch{}return e.unregisterOriginalCallbacks&&Ew(this,i,s),o.apply(this,[i,Kn(s,{mechanism:{data:{function:"addEventListener",handler:er(s),target:t},handled:!1,type:"instrument"}}),a])}}),ct(n,"removeEventListener",function(o){return function(i,s,a){try{let l=s.__sentry_wrapped__;l&&o.call(this,i,l,a)}catch{}return o.call(this,i,s,a)}}))}function vw(t){return typeof t.handleEvent=="function"}function Ew(t,e,r){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,r)}var ah=()=>({name:"BrowserSession",setupOnce(){if(typeof Ke.document>"u"){Lo&&ee.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}Vi({ignoreDuration:!0}),Wi(),Xi(({from:t,to:e})=>{t!==void 0&&t!==e&&(Vi({ignoreDuration:!0}),Wi())})}});var _w="GlobalHandlers",bw=(t={})=>{let e=E({onerror:!0,onunhandledrejection:!0},t);return{name:_w,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&(ww(r),ch("onerror")),e.onunhandledrejection&&(Sw(r),ch("onunhandledrejection"))}}},lh=bw;function ww(t){tu(e=>{let{stackParser:r,attachStacktrace:n}=uh();if(We()!==t||Ju())return;let{msg:o,url:i,line:s,column:a,error:l}=e,f=xw(Da(r,l||o,void 0,n,!1),i,s,a);f.level="error",$i(f,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}function Sw(t){nu(e=>{let{stackParser:r,attachStacktrace:n}=uh();if(We()!==t||Ju())return;let o=Tw(e),i=qn(o)?Iw(o):Da(r,o,void 0,n,!0);i.level="error",$i(i,{originalException:o,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function Tw(t){if(qn(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function Iw(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function xw(t,e,r,n){let o=t.exception=t.exception||{},i=o.values=o.values||[],s=i[0]=i[0]||{},a=s.stacktrace=s.stacktrace||{},l=a.frames=a.frames||[],f=n,m=r,d=Pt(e)&&e.length>0?e:ki();return l.length===0&&l.push({colno:f,filename:d,function:"?",in_app:!0,lineno:m}),t}function ch(t){Lo&&ee.log(`Global Handler attached: ${t}`)}function uh(){return We()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var fh=()=>({name:"HttpContext",preprocessEvent(t){if(!Ke.navigator&&!Ke.location&&!Ke.document)return;let e=zd(),r=E(E({},e.headers),t.request?.headers);t.request=Z(E(E({},e),t.request),{headers:r})}});var Cw="cause",Rw=5,Aw="LinkedErrors",Dw=(t={})=>{let e=t.limit||Rw,r=t.key||Cw;return{name:Aw,preprocessEvent(n,o,i){let s=i.getOptions();Vu(Aa,s.stackParser,r,e,n,o)}}},ph=Dw;function uf(t){return[xa(),Ta(),sh(),oh(),lh(),ph(),Ca(),fh(),ah()]}var Ba={},Ua,ff,mh;(()=>{let t=uf({}).filter(e=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(e.name));ff=new Ki({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:af,stackParser:lf,integrations:t,environment:dr.mode,release:`web-sdk@${Vs}`,debug:dr.debug,sampleRate:.5}),ff.init()})();function ae(t,e,r){b.error(`${e}:`,t);let n=gh(r);if(n.setTag("operation",e),t instanceof Zt){Ow(n,t,e);return}n.captureException(t)}function dh(t,e,r){gh(r).captureMessage(t,e??"error")}function Ow(t,e,r){if(Nw(t,e),e.response){let n=e.response,o=e.responseText;t.setTag("error.message",e.message),n.status!=null&&t.setTag("http.status_code",n.status),n.statusText&&t.setTag("http.status_text",n.statusText),o&&typeof o=="object"&&"error"in o&&(t.setTag("http.error_code",o.error.code),t.setTag("http.error_message",o.error.message)),t.setExtras({responseText:e.responseText,statusText:n.statusText,responseType:n.type,redirected:n.redirected,responseUrl:n.url,originalError:e.message}),t.captureMessage(`${r} failed with ${n.status}`,"error");return}if(e.request){t.captureMessage(`No response was received for ${r}`,"error");return}}function Nw(t,e){let r=e.request;if(!r)return;t.setExtras({body:e.requestBody,headers:r.headers,method:r.method,url:r.url});let n=r.headers?.get("Cooee-Retry-Attempt");n!==null&&t.setTag("retry.attempt",n)}function hh(t){mh=t}function ka(t,e){Ba[t]=E(E({},Ba[t]),e)}function Mo(t){Ua=E(E({},Ua),t)}function gh(t){t??={};let{extra:e,tags:r}=t,n=new bt;if(n.setClient(ff),n.setUser(mh),t.triggerContext&&!t.engagementTrigger&&(t.engagementTrigger=t.triggerContext.triggerData),t.engagementTrigger){let o=t.engagementTrigger;n.setTags({"engagement.id":o.engagementID,"engagement.short_id":o.shortID,"engagement.objective":o.objective,"engagement.delivery_type":o.onsiteDeliveryType,"engagement.content_id":o.contentID,"engagement.variation":o.variation,"engagement.currency":o.currency})}return e&&n.setExtras(e),r&&n.setTags(r),Ua&&n.setTags(Ua),Object.keys(Ba).forEach(o=>{n.setContext(o,Ba[o])}),n.setTag("language",navigator.language),n.setTag("timezone",yh()),Pw(n),n}function Pw(t){window.Shopify&&(t.setTag("shopify.shop",window.Shopify.shop),t.setTag("shopify.currency",window.Shopify.currency?.active),t.setTag("shopify.locale",window.Shopify.locale),t.setTag("theme.schema_name",window.Shopify.theme?.schema_name),t.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}var Fa=class{static format(e,r){let n=/{{\s*(\w+)\s*}}/;return r.replace(n,(o,i)=>{switch(i){case"amount":return this.formatWithDelimiters(e,2);case"amount_no_decimals":return this.formatWithDelimiters(e,0);case"amount_with_comma_separator":return this.formatWithDelimiters(e,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(e,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(e,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(e,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(e,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(e,2," ",".");default:return o}})}static formatWithDelimiters(e,r=2,n=",",o="."){if(isNaN(e)||e==null)return"0";let s=(e/100).toFixed(r).split("."),a=s[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+n),l=s[1]?o+s[1]:"";return a+l}};function Uo(t){try{return new URL(t)}catch{return}}function pf(t){return!t||t==="null"||t==="undefined"}function vh(t,e){let r=t.indexOf(e);return r===-1?!1:(t.splice(r,1),!0)}function Lt(t,e,r){return{[t]:mf(e,r),[t+"_wo_currency"]:e}}function mf(t,e){if(t==0&&e)return"Free";let r=fe(),n=ze.get(),o=r.shopCurrencyCode||n.currency,i=r.currencyCode;i||b.warn("Currency code is not set in RuntimeData");let s=n.money?.format??r.moneyFormat,a;if(s&&o===i)a=Fa.format(t*100,s);else{let l;try{l=new Intl.NumberFormat(_h(),{style:"currency",currency:i||o,minimumFractionDigits:0,maximumFractionDigits:2})}catch(f){return ae(f,"format-currency",{extra:{currentCurrency:i,shopCurrency:o}}),""}a=l.format(t),a=a.replace("\u20B9","Rs. "),n.money?.showCurrency&&i!=="INR"&&(a=a.concat(` ${i}`))}return a}function Eh(t){let e=_h();try{return new Intl.NumberFormat(e,{notation:"compact"}).format(t)}catch(r){return ae(r,"format-number",{extra:{lang:e,value:t}}),t.toString()}}function _h(){let t="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?t=navigator.languages[0]:navigator.language&&(t=navigator.language)),t=t.split(";")[0],t=t.split("-")[0],t||"en"}var Ha;function yh(){if(Ha)return Ha;try{return Ha=Intl.DateTimeFormat().resolvedOptions().timeZone,Ha}catch{return""}}function wn(t){document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t)}function Er(t){let e=document.createElement("span");e.id="snackbar",e.innerText=t,document.body.appendChild(e),e.className="show",setTimeout(()=>{e.classList.remove("show"),document.body.removeChild(e)},5e3)}async function df(t,e=7,r=document){let n=1,o=document.querySelectorAll("nonexistent-tag");for(;n<=e;){let i=Math.min(50*2**n,1e3);if(n>1&&await _t.sleep(i),o=r.querySelectorAll(t),o.length)return b.verbose(`Attempt ${n}: ${o.length} elements found with ${t}`),o;b.verbose(`Attempt ${n}: Elements not found with ${t}. Will retry after ${i}ms.`),n++}return b.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${t}.`),o}async function Sn(t,e=10,r=document){return(await df(t,e,r)).item(0)}async function hf(t){let[e,r,n]=await Promise.all([Ye.get("did"),It.get("id",""),Ye.get("sessionNumber",1)]),o={letscooee_did:e,letscooee_sid:r,letscooee_sn:`${n}`,__letscooee_time:new Date().toLocaleString()};return t&&(o.__letscooee_via=t),o}async function $a(t){let e=await hf(t);return Object.entries(e).map(([r,n])=>({key:r,value:n.toString()}))}function Nr(t,e,r,n=!1){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:n,value:r})}function bh(t){if(t%100>=11&&t%100<=13)return t+"th";switch(t%10){case 1:return t+"st";case 2:return t+"nd";case 3:return t+"rd";default:return t+"th"}}var Ga,Te,xh,vf,Jn,wh,Ch,Rh,Ah,Ef,gf,yf,Lw,Ji={},Dh=[],Mw=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qa=Array.isArray;function nn(t,e){for(var r in e)t[r]=e[r];return t}function _f(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function bf(t,e,r){var n,o,i,s={};for(i in e)i=="key"?n=e[i]:i=="ref"?o=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?Ga.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)s[i]===void 0&&(s[i]=t.defaultProps[i]);return Wa(t,s,n,o,null)}function Wa(t,e,r,n,o){var i={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o??++xh,__i:-1,__u:0};return o==null&&Te.vnode!=null&&Te.vnode(i),i}function Lr(t){return t.children}function Pr(t,e){this.props=t,this.context=e}function ko(t,e){if(e==null)return t.__?ko(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?ko(t):null}function Oh(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return Oh(t)}}function Sh(t){(!t.__d&&(t.__d=!0)&&Jn.push(t)&&!ja.__r++||wh!=Te.debounceRendering)&&((wh=Te.debounceRendering)||Ch)(ja)}function ja(){for(var t,e,r,n,o,i,s,a=1;Jn.length;)Jn.length>a&&Jn.sort(Rh),t=Jn.shift(),a=Jn.length,t.__d&&(r=void 0,o=(n=(e=t).__v).__e,i=[],s=[],e.__P&&((r=nn({},n)).__v=n.__v+1,Te.vnode&&Te.vnode(r),wf(e.__P,r,n,e.__n,e.__P.namespaceURI,32&n.__u?[o]:null,i,o??ko(n),!!(32&n.__u),s),r.__v=n.__v,r.__.__k[r.__i]=r,Lh(i,r,s),r.__e!=o&&Oh(r)));ja.__r=0}function Nh(t,e,r,n,o,i,s,a,l,f,m){var d,_,y,C,N,A,B=n&&n.__k||Dh,q=e.length;for(l=Bw(r,e,B,l,q),d=0;d<q;d++)(y=r.__k[d])!=null&&(_=y.__i==-1?Ji:B[y.__i]||Ji,y.__i=d,A=wf(t,y,_,o,i,s,a,l,f,m),C=y.__e,y.ref&&_.ref!=y.ref&&(_.ref&&Sf(_.ref,null,y),m.push(y.ref,y.__c||C,y)),N==null&&C!=null&&(N=C),4&y.__u||_.__k===y.__k?l=Ph(y,l,t):typeof y.type=="function"&&A!==void 0?l=A:C&&(l=C.nextSibling),y.__u&=-7);return r.__e=N,l}function Bw(t,e,r,n,o){var i,s,a,l,f,m=r.length,d=m,_=0;for(t.__k=new Array(o),i=0;i<o;i++)(s=e[i])!=null&&typeof s!="boolean"&&typeof s!="function"?(l=i+_,(s=t.__k[i]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?Wa(null,s,null,null,null):qa(s)?Wa(Lr,{children:s},null,null,null):s.constructor==null&&s.__b>0?Wa(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,a=null,(f=s.__i=Uw(s,r,l,d))!=-1&&(d--,(a=r[f])&&(a.__u|=2)),a==null||a.__v==null?(f==-1&&(o>m?_--:o<m&&_++),typeof s.type!="function"&&(s.__u|=4)):f!=l&&(f==l-1?_--:f==l+1?_++:(f>l?_--:_++,s.__u|=4))):t.__k[i]=null;if(d)for(i=0;i<m;i++)(a=r[i])!=null&&(2&a.__u)==0&&(a.__e==n&&(n=ko(a)),Bh(a,a));return n}function Ph(t,e,r){var n,o;if(typeof t.type=="function"){for(n=t.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=t,e=Ph(n[o],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=ko(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Uw(t,e,r,n){var o,i,s=t.key,a=t.type,l=e[r];if(l===null&&t.key==null||l&&s==l.key&&a==l.type&&(2&l.__u)==0)return r;if(n>(l!=null&&(2&l.__u)==0?1:0))for(o=r-1,i=r+1;o>=0||i<e.length;){if(o>=0){if((l=e[o])&&(2&l.__u)==0&&s==l.key&&a==l.type)return o;o--}if(i<e.length){if((l=e[i])&&(2&l.__u)==0&&s==l.key&&a==l.type)return i;i++}}return-1}function Th(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||Mw.test(e)?r:r+"px"}function Va(t,e,r,n,o){var i,s;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Th(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||Th(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Ah,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=r,r?n?r.u=n.u:(r.u=Ef,t.addEventListener(e,i?yf:gf,i)):t.removeEventListener(e,i?yf:gf,i);else{if(o=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Ih(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Ef++;else if(e.t<r.u)return;return r(Te.event?Te.event(e):e)}}}function wf(t,e,r,n,o,i,s,a,l,f){var m,d,_,y,C,N,A,B,q,P,Q,Ee,X,ce,se,de,Le,Se=e.type;if(e.constructor!=null)return null;128&r.__u&&(l=!!(32&r.__u),i=[a=e.__e=r.__e]),(m=Te.__b)&&m(e);e:if(typeof Se=="function")try{if(B=e.props,q="prototype"in Se&&Se.prototype.render,P=(m=Se.contextType)&&n[m.__c],Q=m?P?P.props.value:m.__:n,r.__c?A=(d=e.__c=r.__c).__=d.__E:(q?e.__c=d=new Se(B,Q):(e.__c=d=new Pr(B,Q),d.constructor=Se,d.render=Fw),P&&P.sub(d),d.props=B,d.state||(d.state={}),d.context=Q,d.__n=n,_=d.__d=!0,d.__h=[],d._sb=[]),q&&d.__s==null&&(d.__s=d.state),q&&Se.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=nn({},d.__s)),nn(d.__s,Se.getDerivedStateFromProps(B,d.__s))),y=d.props,C=d.state,d.__v=e,_)q&&Se.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),q&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(q&&Se.getDerivedStateFromProps==null&&B!==y&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(B,Q),!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(B,d.__s,Q)===!1||e.__v==r.__v){for(e.__v!=r.__v&&(d.props=B,d.state=d.__s,d.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(Re){Re&&(Re.__=e)}),Ee=0;Ee<d._sb.length;Ee++)d.__h.push(d._sb[Ee]);d._sb=[],d.__h.length&&s.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(B,d.__s,Q),q&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(y,C,N)})}if(d.context=Q,d.props=B,d.__P=t,d.__e=!1,X=Te.__r,ce=0,q){for(d.state=d.__s,d.__d=!1,X&&X(e),m=d.render(d.props,d.state,d.context),se=0;se<d._sb.length;se++)d.__h.push(d._sb[se]);d._sb=[]}else do d.__d=!1,X&&X(e),m=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++ce<25);d.state=d.__s,d.getChildContext!=null&&(n=nn(nn({},n),d.getChildContext())),q&&!_&&d.getSnapshotBeforeUpdate!=null&&(N=d.getSnapshotBeforeUpdate(y,C)),de=m,m!=null&&m.type===Lr&&m.key==null&&(de=Mh(m.props.children)),a=Nh(t,qa(de)?de:[de],e,r,n,o,i,s,a,l,f),d.base=e.__e,e.__u&=-161,d.__h.length&&s.push(d),A&&(d.__E=d.__=null)}catch(Re){if(e.__v=null,l||i!=null)if(Re.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;i[i.indexOf(a)]=null,e.__e=a}else for(Le=i.length;Le--;)_f(i[Le]);else e.__e=r.__e,e.__k=r.__k;Te.__e(Re,e,r)}else i==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):a=e.__e=kw(r.__e,e,r,n,o,i,s,l,f);return(m=Te.diffed)&&m(e),128&e.__u?void 0:a}function Lh(t,e,r){for(var n=0;n<r.length;n++)Sf(r[n],r[++n],r[++n]);Te.__c&&Te.__c(e,t),t.some(function(o){try{t=o.__h,o.__h=[],t.some(function(i){i.call(o)})}catch(i){Te.__e(i,o.__v)}})}function Mh(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:qa(t)?t.map(Mh):nn({},t)}function kw(t,e,r,n,o,i,s,a,l){var f,m,d,_,y,C,N,A=r.props,B=e.props,q=e.type;if(q=="svg"?o="http://www.w3.org/2000/svg":q=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f<i.length;f++)if((y=i[f])&&"setAttribute"in y==!!q&&(q?y.localName==q:y.nodeType==3)){t=y,i[f]=null;break}}if(t==null){if(q==null)return document.createTextNode(B);t=document.createElementNS(o,q,B.is&&B),a&&(Te.__m&&Te.__m(e,i),a=!1),i=null}if(q==null)A===B||a&&t.data==B||(t.data=B);else{if(i=i&&Ga.call(t.childNodes),A=r.props||Ji,!a&&i!=null)for(A={},f=0;f<t.attributes.length;f++)A[(y=t.attributes[f]).name]=y.value;for(f in A)if(y=A[f],f!="children"){if(f=="dangerouslySetInnerHTML")d=y;else if(!(f in B)){if(f=="value"&&"defaultValue"in B||f=="checked"&&"defaultChecked"in B)continue;Va(t,f,null,y,o)}}for(f in B)y=B[f],f=="children"?_=y:f=="dangerouslySetInnerHTML"?m=y:f=="value"?C=y:f=="checked"?N=y:a&&typeof y!="function"||A[f]===y||Va(t,f,y,A[f],o);if(m)a||d&&(m.__html==d.__html||m.__html==t.innerHTML)||(t.innerHTML=m.__html),e.__k=[];else if(d&&(t.innerHTML=""),Nh(e.type=="template"?t.content:t,qa(_)?_:[_],e,r,n,q=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,s,i?i[0]:r.__k&&ko(r,0),a,l),i!=null)for(f=i.length;f--;)_f(i[f]);a||(f="value",q=="progress"&&C==null?t.removeAttribute("value"):C!=null&&(C!==t[f]||q=="progress"&&!C||q=="option"&&C!=A[f])&&Va(t,f,C,A[f],o),f="checked",N!=null&&N!=t[f]&&Va(t,f,N,A[f],o))}return t}function Sf(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(o){Te.__e(o,r)}}function Bh(t,e,r){var n,o;if(Te.unmount&&Te.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||Sf(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){Te.__e(i,e)}n.base=n.__P=null}if(n=t.__k)for(o=0;o<n.length;o++)n[o]&&Bh(n[o],e,r||typeof t.type!="function");r||_f(t.__e),t.__c=t.__=t.__e=void 0}function Fw(t,e,r){return this.constructor(t,r)}function Uh(t,e,r){var n,o,i,s;e==document&&(e=document.documentElement),Te.__&&Te.__(t,e),o=(n=typeof r=="function")?null:r&&r.__k||e.__k,i=[],s=[],wf(e,t=(!n&&r||e).__k=bf(Lr,null,[t]),o||Ji,Ji,e.namespaceURI,!n&&r?[r]:o?null:e.firstChild?Ga.call(e.childNodes):null,i,!n&&r?r:o?o.__e:e.firstChild,n,s),Lh(i,t,s)}Ga=Dh.slice,Te={__e:function(t,e,r,n){for(var o,i,s;e=e.__;)if((o=e.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(t)),s=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(t,n||{}),s=o.__d),s)return o.__E=o}catch(a){t=a}throw t}},xh=0,vf=function(t){return t!=null&&t.constructor==null},Pr.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=nn({},this.state),typeof t=="function"&&(t=t(nn({},r),this.props)),t&&nn(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Sh(this))},Pr.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Sh(this))},Pr.prototype.render=Lr,Jn=[],Ch=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Rh=function(t,e){return t.__v.__b-e.__v.__b},ja.__r=0,Ah=/(PointerCapture)$|Capture$/i,Ef=0,gf=Ih(!1),yf=Ih(!0),Lw=0;var If,Wt,Tf,kh,Fh=0,zh=[],ft=Te,Hh=ft.__b,$h=ft.__r,Vh=ft.diffed,Wh=ft.__c,jh=ft.unmount,Gh=ft.__;function Hw(t,e){ft.__h&&ft.__h(Wt,t,Fh||e),Fh=0;var r=Wt.__H||(Wt.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function Cf(t,e){var r=Hw(If++,7);return Ww(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function $w(){for(var t;t=zh.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(za),t.__H.__h.forEach(xf),t.__H.__h=[]}catch(e){t.__H.__h=[],ft.__e(e,t.__v)}}ft.__b=function(t){Wt=null,Hh&&Hh(t)},ft.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Gh&&Gh(t,e)},ft.__r=function(t){$h&&$h(t),If=0;var e=(Wt=t.__c).__H;e&&(Tf===Wt?(e.__h=[],Wt.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.forEach(za),e.__h.forEach(xf),e.__h=[],If=0)),Tf=Wt},ft.diffed=function(t){Vh&&Vh(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(zh.push(e)!==1&&kh===ft.requestAnimationFrame||((kh=ft.requestAnimationFrame)||Vw)($w)),e.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Tf=Wt=null},ft.__c=function(t,e){e.some(function(r){try{r.__h.forEach(za),r.__h=r.__h.filter(function(n){return!n.__||xf(n)})}catch(n){e.some(function(o){o.__h&&(o.__h=[])}),e=[],ft.__e(n,r.__v)}}),Wh&&Wh(t,e)},ft.unmount=function(t){jh&&jh(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{za(n)}catch(o){e=o}}),r.__H=void 0,e&&ft.__e(e,r.__v))};var qh=typeof requestAnimationFrame=="function";function Vw(t){var e,r=function(){clearTimeout(n),qh&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);qh&&(e=requestAnimationFrame(r))}function za(t){var e=Wt,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Wt=e}function xf(t){var e=Wt;t.__c=t.__(),Wt=e}function Ww(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}var jw=Symbol.for("preact-signals");function Af(){if(Fo>1)Fo--;else{for(var t,e=!1;Qi!==void 0;){var r=Qi;for(Qi=void 0,Rf++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Kh(r))try{r.c()}catch(o){e||(t=o,e=!0)}r=n}}if(Rf=0,Fo--,e)throw t}}var Fe=void 0;var Qi=void 0,Fo=0,Rf=0,Ya=0;function Yh(t){if(Fe!==void 0){var e=t.n;if(e===void 0||e.t!==Fe)return e={i:0,S:t,p:Fe.s,n:void 0,t:Fe,e:void 0,x:void 0,r:e},Fe.s!==void 0&&(Fe.s.n=e),Fe.s=e,t.n=e,32&Fe.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Fe.s,e.n=void 0,Fe.s.n=e,Fe.s=e),e}}function pt(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}pt.prototype.brand=jw;pt.prototype.h=function(){return!0};pt.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};pt.prototype.U=function(t){if(this.t!==void 0){var e=t.e,r=t.x;e!==void 0&&(e.x=r,t.e=void 0),r!==void 0&&(r.e=e,t.x=void 0),t===this.t&&(this.t=r)}};pt.prototype.subscribe=function(t){var e=this;return wt(function(){var r=e.value,n=Fe;Fe=void 0;try{t(r)}finally{Fe=n}})};pt.prototype.valueOf=function(){return this.value};pt.prototype.toString=function(){return this.value+""};pt.prototype.toJSON=function(){return this.value};pt.prototype.peek=function(){var t=Fe;Fe=void 0;try{return this.value}finally{Fe=t}};Object.defineProperty(pt.prototype,"value",{get:function(){var t=Yh(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Rf>100)throw new Error("Cycle detected");this.v=t,this.i++,Ya++,Fo++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Af()}}}});function nr(t){return new pt(t)}function Kh(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Xh(t){for(var e=t.s;e!==void 0;e=e.n){var r=e.S.n;if(r!==void 0&&(e.r=r),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Jh(t){for(var e=t.s,r=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):r=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=r}function Ho(t){pt.call(this,void 0),this.x=t,this.s=void 0,this.g=Ya-1,this.f=4}(Ho.prototype=new pt).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Ya))return!0;if(this.g=Ya,this.f|=1,this.i>0&&!Kh(this))return this.f&=-2,!0;var t=Fe;try{Xh(this),Fe=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Fe=t,Jh(this),this.f&=-2,!0};Ho.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}pt.prototype.S.call(this,t)};Ho.prototype.U=function(t){if(this.t!==void 0&&(pt.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};Ho.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(Ho.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Yh(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Df(t){return new Ho(t)}function Qh(t){var e=t.u;if(t.u=void 0,typeof e=="function"){Fo++;var r=Fe;Fe=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Of(t),n}finally{Fe=r,Af()}}}function Of(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,Qh(t)}function Gw(t){if(Fe!==this)throw new Error("Out-of-order effect");Jh(this),Fe=t,this.f&=-2,8&this.f&&Of(this),Af()}function Zi(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Zi.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};Zi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Qh(this),Xh(this),Fo++;var t=Fe;return Fe=this,Gw.bind(this,t)};Zi.prototype.N=function(){2&this.f||(this.f|=2,this.o=Qi,Qi=this)};Zi.prototype.d=function(){this.f|=8,1&this.f||Of(this)};function wt(t){var e=new Zi(t);try{e.c()}catch(r){throw e.d(),r}return e.d.bind(e)}var Pf,Nf;function $o(t,e){Te[t]=e.bind(null,Te[t]||function(){})}function Ka(t){Nf&&Nf(),Nf=t&&t.S()}function Zh(t){var e=this,r=t.data,n=zw(r);n.value=r;var o=Cf(function(){for(var i=e.__v;i=i.__;)if(i.__c){i.__c.__$f|=4;break}return e.__$u.c=function(){var s,a=e.__$u.S(),l=o.value;a(),vf(l)||((s=e.base)==null?void 0:s.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=l},Df(function(){var s=n.value.value;return s===0?0:s===!0?"":s||""})},[]);return o.value}Zh.displayName="_st";Object.defineProperties(pt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Zh},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});$o("__b",function(t,e){if(typeof e.type=="string"){var r,n=e.props;for(var o in n)if(o!=="children"){var i=n[o];i instanceof pt&&(r||(e.__np=r={}),r[o]=i,n[o]=i.peek())}}t(e)});$o("__r",function(t,e){Ka();var r,n=e.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=(function(o){var i;return wt(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i})())),Pf=n,Ka(r),t(e)});$o("__e",function(t,e,r,n){Ka(),Pf=void 0,t(e,r,n)});$o("diffed",function(t,e){Ka(),Pf=void 0;var r;if(typeof e.type=="string"&&(r=e.__e)){var n=e.__np,o=e.props;if(n){var i=r.U;if(i)for(var s in i){var a=i[s];a!==void 0&&!(s in n)&&(a.d(),i[s]=void 0)}else r.U=i={};for(var l in n){var f=i[l],m=n[l];f===void 0?(f=qw(r,l,m,o),i[l]=f):f.o(m,o)}}}t(e)});function qw(t,e,r,n){var o=e in t&&t.ownerSVGElement===void 0,i=nr(r);return{o:function(s,a){i.value=s,n=a},d:wt(function(){var s=i.value.value;n[e]!==s&&(n[e]=s,o?t[e]=s:s?t.setAttribute(e,s):t.removeAttribute(e))})}}$o("unmount",function(t,e){if(typeof e.type=="string"){var r=e.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var o in n){var i=n[o];i&&i.d()}}}}else{var s=e.__c;if(s){var a=s.__$u;a&&(s.__$u=void 0,a.d())}}t(e)});$o("__h",function(t,e,r,n){(n<3||n===9)&&(e.__$f|=2),t(e,r,n)});Pr.prototype.shouldComponentUpdate=function(t,e){var r=this.__$u,n=r&&r.s!==void 0;for(var o in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(n||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var i in t)if(i!=="__source"&&t[i]!==this.props[i])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};function zw(t){return Cf(function(){return nr(t)},[])}var Xa=class{url;alt;constructor(e){e.alt&&(this.alt=e.alt),this.url=e.url}};var Ja=class{d;cmp;effective;constructor(e={}){this.d=e.d,this.cmp=e.cmp,this.effective=this.d}};var Lf=class{id;mID;name;groupID;groupName;isSelected;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.name=e.name,this.groupID=e.groupID,this.groupName=e.groupName,this.isSelected=e.isSelected??!1}},Mr=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedOptions;selectedSellingPlan;effectivePrice;constructor(e){e=e??{},this.mID=e.mID,this.name=e.name,this.imgs=e.imgs?.map(r=>new Xa(r))??[],this.link=e.link,this.price=new Ja(e.price),this.sku=e.sku,this.isAvailable=e.isAvailable,this.quantity=e.quantity,this.selectedOptions=e.selectedOptions??[],this.effectivePrice=nr(this.price.effective),e.sellingPlans?.length&&(this.selectedSellingPlan=nr(void 0)),this.sellingPlans=e.sellingPlans?.map(r=>{let n=new Lf(r);return n.isSelected&&(this.selectedSellingPlan.value=n),n})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(e){this.selectedSellingPlan.value=e}hasEffectivePrice(){return this.effectivePrice.value!==this.price.d}};var xt=class{id;mID;name;options;imgs;vars;desc;link;slug;quantity;category;meta;reviews;tags;templateSuffix;selectedOrFirstVariant;selected=nr(!0);constructor(e){this.update(e),this.selectedOrFirstVariant=nr(this.selectedVariant)}get firstImageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}set variants(e){this.vars=e,this.selectedOrFirstVariant.value=this.selectedVariant}get selectedVariant(){return this.vars.find(e=>e.isAvailable)??this.vars[0]}hasVariants(){return this.vars?.length>1}setSelectedVariant(e){this.selectedOrFirstVariant.value=e}setSelectedVariantByID(e){if(!e)return;let r=this.vars.find(n=>n.mID===e.toString());r&&this.setSelectedVariant(r)}update(e){return this.id=e.id??this.id,this.mID=e.mID??this.mID,this.name=e.name??this.name,this.imgs=e.imgs??this.imgs,this.desc=e.desc??this.desc,this.link=e.link??this.link,this.slug=e.slug??this.slug,this.quantity=e.quantity??this.quantity,this.meta=e.meta??this.meta,this.category=e.category??this.category,this.reviews=e.reviews??this.reviews,this.options=e.options??this.options,this.tags=e.tags??this.tags,this.templateSuffix=e.templateSuffix??this.templateSuffix,e.vars&&(this.vars=e.vars.map(r=>new Mr(r))),this}toEmbed(e){return e=e??this.selectedOrFirstVariant.value,new Dt({id:this.id,mID:this.mID,vID:e.mID,vName:e.name,name:this.name,link:this.link,slug:this.slug,price:e.price.d,imageURL:e.getOneImage()??this.imgs?.[0].url})}getTemplateVariables(){let e=this.selectedOrFirstVariant.value,r=e.price,n=this.name,o=this.category,i=this.variantImage??this.firstImageURL,s=this.meta,a=this.tags?.join(",")??"",l=this.reviews?.rating,f=this.reviews?.totalReviews,m=r.cmp&&r.cmp>r.d,d=Z(E({name:n},Lt("price",r.d,!0)),{image_url:i,meta:s,category:o,rating:l,reviews:f,tags:a});if(e.hasEffectivePrice()){let y=Lt("effective_price",e.effectivePrice.value,!0);Object.assign(d,y)}if(m){let y=r.cmp-r.d,C={discount_percent:(y/r.cmp*100).toFixed(0)};Object.assign(d,C),Object.assign(d,Lt("compare_price",r.cmp)),Object.assign(d,Lt("discount_price",y))}let _={name:e.name,quantity:e.quantity};return{product:d,variant:_}}};var Qa=class{id;alt;shortID;sources;items;durationMS;thumbnail;card;bestSource;highSource;goodSource;lowSource;m3u8Source;constructor(e={}){if(this.id=e.id,this.alt=e.alt,this.shortID=e.shortID,this.sources=e.sources?.sort((r,n)=>n.height-r.height),this.durationMS=e.durationMS,this.thumbnail=e.thumbnail,this.items=e.items?e.items.map(r=>new xt(r)):[],this.card=e.card,this.sources){let r=[];for(let n of this.sources)n.format==="mp4"?r.push(n):n.format==="m3u8"&&!this.m3u8Source&&(this.m3u8Source=n);r.length>0&&(this.bestSource=r[0],this.highSource=r.length>1?r[1]:r[0],this.lowSource=r.length>2?r[r.length-1]:r[0])}}};var Za=class{videos;source;template;heading;autoPlay;showMuteButton;footerContent;detailPopup;playlistConfig;itemDetailConfig;constructor(e={}){this.videos=e.videos?.map(r=>new Qa(r))??[],this.source=e.source,this.template=e.template,this.detailPopup=e.detailPopup??{template:"VIDEO_ONLY_VIEW"},this.heading=e.heading,this.showMuteButton=e.showMuteButton,this.autoPlay=e.autoPlay??"ON",this.footerContent=e.footerContent??"FIRST_ITEM",this.playlistConfig={videoSwiper:e.playlistConfig?.videoSwiper??void 0,itemCardClickBehavior:e.playlistConfig?.itemCardClickBehavior??"OPEN_VIDEO_DETAIL"},this.itemDetailConfig={template:e.itemDetailConfig?.template??"CLASSIC"}}showItems(){return this.footerContent==="FIRST_ITEM"||this.footerContent==="ITEM_SWIPER"}};var Ct=zr(Mf());Ct.filters.define("default",function(t){return typeof t>"u"||t==null?"":Kw(t)});+Ct.filters.define("max",(t,e)=>{let r=Number(t),n=Number(e);return isNaN(r)||isNaN(n)?t:r>n?e:t});Ct.filters.define("min",(t,e)=>{let r=Number(t),n=Number(e);return isNaN(r)||isNaN(n)?t:r<n?e:t});Ct.filters.define("fallback",(t,e)=>t==null||t===""?e:t);Ct.filters.define("manipulate_quantity",(t,e,r)=>{if(e??=1,r??=100,e>r)return b.error("Invalid range: min should be less than or equal to max."),t;if(t>=e&&t<=r)return t;let n=t%r;return n<e?e:n});Ct.filters.define("apply_discount_perc",(t,e,r=1/0)=>{if(t=+t,isNaN(t))return b.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(e<0||e>100)return b.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let n=t*e/100;return t-Math.min(r,n)});Ct.filters.define("apply_discount_fixed",(t,e)=>(t=+t,isNaN(t)?(b.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,t-e)));Ct.filters.define("currency",t=>(t=+t,isNaN(t)?(b.error("Need value as a number for `currency` filter"),NaN):mf(t)));Ct.filters.define("split",(t,e,r)=>{if(typeof t!="string")return b.error("Need value as a string for `split` filter"),"";if(e==null)return b.error("Need delimiter for `split` filter"),"";if(r==null||isNaN(Number(r)))return b.error("Need a valid index for `split` filter"),"";let n=t.split(String(e)),o=Number(r),i=o<0?n.length+o:o;return n[i].trim()??""});Ct.defaultConfig.defaultFilter="default";Ct.defaultConfig.useWith=!0;Ct.defaultConfig.autoEscape=!1;var Yw={'"':""","\\":"\","\n":"\\n"};function Kw(t){return String(t).replace(/["\\\n]/g,e=>Yw[e])}function Xw(t){if(!t)return"";let e=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return t.replace(e,(r,n,o,i)=>`{{ ${(o||i||"").trim()} }}`)}var Vo=(t,e,r)=>{e=E({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},e);try{return Ct.render(Xw(t),e)}catch(n){throw ae(n,"squirrelly-render",{extra:{template:t,values:e},triggerContext:r}),n}},Qn=(t,e,r)=>{let n=JSON.stringify(t),o=Vo(n,e,r);try{return JSON.parse(o)}catch(i){throw ae(i,"variable-replacement",{extra:{before:t,after:o},triggerContext:r}),i}};function es(){return!!window.Shopify}function tc(){if(es())return window.Shopify.shop?.split(".")?.[0]}function tg(t){let n=(t.includes("://")?new URL(t).pathname:t).match(/\/products\/([^/]+?)(?:\.html)?$/);return n?n[1]:null}function Wo(t){return(window.Shopify?.routes?.root??"/")+t.substring(1)}function rc(t){return Wo(t+"?from=cooee")}var me=class t{static CURRENT;token;items=[];total_price=0;original_total_price=0;items_subtotal_price=0;currency;item_count=0;attributes;cart_level_discount_applications;discount_codes;total_discount=0;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new t),this.CURRENT}async getNormalisedCart(e){return Jw(e)}getCooeeCart(){return Bf()}update(e){return this.token=e.token,this.items=e.items,this.total_price=e.total_price,this.original_total_price=e.original_total_price,this.items_subtotal_price=e.items_subtotal_price,this.currency=e.currency,this.item_count=e.item_count,this.attributes=e.attributes,this.cart_level_discount_applications=e.cart_level_discount_applications,this.discount_codes=e.discount_codes,this.total_discount=e.total_discount,fe().currencyCode=this.currency,b.verbose("Updated ShopifyCart",this),this}toString(){return`ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}};async function Jw(t){let e=me.getCurrent();await Zw(e,t);let r=rg(e);return t&&await Ye.set("cart",r),r}function Bf(){return rg(me.getCurrent())}function rg(t){return{amount:t.total_price/100,originalAmount:t.original_total_price/100,itemsSubtotalPrice:t.items_subtotal_price/100,currency:t.currency,itemCount:t.item_count,items:Qw(t.items),token:t.token}}function Qw(t){if(!t)return b.error("No item received to be sent"),[];Array.isArray(t)||(t=[t]);let e=[];for(let r of t){if(!r.id||!r.title){b.warn("Invalid item received",r);continue}let n={name:r.title,quantity:+r.quantity||1,mID:r.product_id?.toString(),vID:r.id.toString(),price:+r.price/100||0,finalPrice:+r.final_price/100||0,properties:r.properties,key:r.key},o=r.selling_plan_allocation?.selling_plan;if(!o){e.push(n);continue}n.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:o.fixed_selling_plan,id:o.id,name:o.name,recurringDeliveries:o.recurring_deliveries}},e.push(n)}return e}async function Zw(t,e){if(!e&&t.token){b.verbose("Not fetching cart");return}b.verbose("Fetching cart");let r=rc("/cart.js");try{let n=(await Jr(r)).data;t.update(n)}catch(n){b.error("Unable to fetch the cart",n)}}var nc=class{id;mID;handle;title;imageURL;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.handle=e.handle,this.title=e.title,this.imageURL=e.imageURL}};var Uf=class{enabled;constructor(e){this.enabled=e.enabled}},kf=class extends Uf{max;min;constructor(e){e??={},super(e),this.min=e.min,this.max=e.max}},oc=class{productQuantity;constructor(e){e??={},this.productQuantity=new kf(e.productQuantity)}};var jt=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(e){this.t=e.t,e.bg&&(this.bg=new $n(e.bg)),e.br&&(this.br=new Kr(e.br)),e.shd&&(this.shd=new Pi(e.shd)),e.spc&&(this.spc=new Xr(e.spc)),this.trf=new Vn(e.trf),this.clc=e.clc,this.w=e.w,this.h=e.h,this.x=e.x,this.y=e.y,this.a=e.a}get alpha(){return this.a??100}get type(){return this.t}get typeAsString(){return je[this.t]}get click(){return this.clc}},je=(P=>(P[P.IMAGE=1]="IMAGE",P[P.TEXT=2]="TEXT",P[P.BUTTON=3]="BUTTON",P[P.FLEXBOX=4]="FLEXBOX",P[P.MULTI_COLUMN=5]="MULTI_COLUMN",P[P.CHECKBOX=6]="CHECKBOX",P[P.PRODUCTS=11]="PRODUCTS",P[P.PRODUCT=12]="PRODUCT",P[P.PRODUCT_IMAGE=13]="PRODUCT_IMAGE",P[P.PRODUCT_TITLE=14]="PRODUCT_TITLE",P[P.PRODUCT_VARIATIONS=15]="PRODUCT_VARIATIONS",P[P.PRODUCT_VARIATIONS_SELLING_PLANS=16]="PRODUCT_VARIATIONS_SELLING_PLANS",P[P.PRODUCT_BUTTON=18]="PRODUCT_BUTTON",P[P.PRODUCT_RATING=19]="PRODUCT_RATING",P[P.EMAIL_INPUT=51]="EMAIL_INPUT",P[P.PHONE_INPUT=52]="PHONE_INPUT",P[P.COUNTDOWN_TIMER=61]="COUNTDOWN_TIMER",P[P.CAROUSEL=62]="CAROUSEL",P[P.SHAPE=100]="SHAPE",P))(je||{});var Zn=class extends jt{constructor(e){super(e)}};var on=class extends jt{src;constructor(e){super(e),this.src=e.src}};var Br=class extends jt{typo;constructor(e){super(e);let r=E(E({},e.f),e.typo);e.alg&&(r.ta=e.alg),e.c&&(r.tc=e.c),this.typo=new st(r)}get color(){return this.typography.tc}get typography(){return this.typo}};var Tn=class extends Br{prs;constructor(e){super(e),this.prs=e.prs}get parts(){return this.prs}};var ic=class extends jt{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}};var jo=class{dd;hh;mm;ss;date;constructor(e){e??={},this.dd=e.dd??0,this.hh=e.hh??0,this.mm=e.mm??0,this.ss=e.ss??0,this.date=e.date?new Date(e.date):void 0}start(e,r){let n=new Date;e===2?(n.setSeconds(n.getSeconds()+this.ss),n.setMinutes(n.getMinutes()+this.mm),n.setHours(n.getHours()+this.hh),n.setDate(n.getDate()+this.dd)):n=this.date??new Date;let o=window.setInterval(()=>{let i=new Date().getTime(),s=n.getTime()-i;if(s<1){clearInterval(o);return}let a=Math.floor(s/(1e3*60*60*24)),l=Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),f=Math.floor(s%(1e3*60*60)/(1e3*60)),m=Math.floor(s%(1e3*60)/1e3);r({days:a,hours:l,minutes:f,seconds:m})},1e3);return o}};var Go=class extends Br{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new jo(e.timer),this.show=e.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}};var sc=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new Ve(e.c??{})}get text(){return this.txt}get color(){return this.c}};var In=class extends Br{ph;constructor(e){super(e),this.ph=new sc(e.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}};var qo=class extends In{constructor(e){e??={},super(e)}};var zo=class extends In{};var Yo=class extends In{};var Ko=class extends on{};var ac=class{en;ex;constructor(e){e=e??{},this.en=e.en,this.ex=e.ex}getEnterAnimation(){switch(this.en){case 2:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case 3:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case 4:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case 5:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case 6:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case 7:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case 8:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case 9:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case 10:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}}getExitAnimation(){switch(this.ex){case 2:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case 3:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case 4:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case 5:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case 6:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case 7:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case 8:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case 9:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case 10:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}}};var cc=15,ts=class extends jt{gvt;max;cover;anim;embedded;constructor(e){e=e??{},super(e),this.gvt=e.gvt??5,this.max=e.max,this.cover=e.cover??!0,this.anim=new ac(e.anim),this.spc||(this.spc=new Xr({pl:cc,pr:cc,pt:cc,pb:cc}))}};var lc=class extends ts{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new ic(e.cont),this.mob=new ts(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(r=>{r.t===1?this.elems.push(new on(r)):r.t===2?this.elems.push(new Tn(r)):r.t===3?this.elems.push(new Tn(r)):r.t===100?this.elems.push(new Zn(r)):r.t===51?this.elems.push(new zo(r)):r.t===52?this.elems.push(new Yo(r)):r.t===61?this.elems.push(new Go(r)):r.t===15||r.t===16?this.elems.push(new qo(r)):r.t===13&&this.elems.push(new Ko(r))})}getStylesForWrapper(){if(this.cover)return{};let e;return this.gvt===1?e={top:0,left:0}:this.gvt===2?e={top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===3?e={top:0,right:0}:this.gvt===6?e={top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===9?e={bottom:0,right:0}:this.gvt===8?e={bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===7?e={bottom:0,left:0}:this.gvt===4?e={top:"50%",left:0,transform:"translateY(-50%)"}:e={top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},e.overflow="visible",e}getFlexStylesForContainer(){let e={display:"flex",flexDirection:"row"},r,n;return this.gvt===1?(r="flex-start",n="flex-start"):this.gvt===2?(r="center",n="flex-start"):this.gvt===3?(r="flex-end",n="flex-start"):this.gvt===4?(r="flex-start",n="center"):this.gvt===6?(r="flex-end",n="center"):this.gvt===7?(r="flex-start",n="flex-end"):this.gvt===8?(r="center",n="flex-end"):this.gvt===9?(r="flex-end",n="flex-end"):(r="center",n="center"),e.alignItems=n,e.justifyContent=r,e.overflow="visible",e}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim}};var Xo=class{gap;dir;wrap;jc;ai;scroll;constructor(e){e??={},this.gap=e.gap??0,this.dir=e.dir??"row",this.wrap=e.wrap??"nowrap",this.jc=e.jc??"flex-start",this.ai=e.ai??"flex-start",this.scroll=e.scroll}};var uc=class{of;disp;pos;top;bottom;left;right;zIndex;constructor(e){e??={},this.of=e.of,this.disp=e.disp,this.pos=e.pos,this.top=e.top,this.bottom=e.bottom,this.left=e.left,this.right=e.right,this.zIndex=e.zIndex}};var fc=class{w;h;maxW;maxH;minW;minH;constructor(e){e??={},this.w=e.w??"100%",this.h=e.h??"auto",this.maxW=e.maxW,this.maxH=e.maxH,this.minW=e.minW,this.minH=e.minH}};var pc=class{size;bg;br;spc;typo;lout;flex;constructor(e){e??={},this.spc=new Xr(e.spc),e.size&&(this.size=new fc(e.size)),e.bg&&(this.bg=new $n(e.bg)),e.br&&(this.br=new Kr(e.br)),e.typo&&(this.typo=new st(e.typo)),e.lout&&(this.lout=new uc(e.lout)),e.flex&&(this.flex=new Xo(e.flex))}},Jo=class{sm;lg;constructor(e){e??={},this.sm=new pc(e.sm),this.lg=new pc(e.lg)}};var dt=class{t;style;hide;when;clc;l;constructor(e,r){r??={},this.t=e,this.style=new Jo(r.style),this.hide=r.hide,this.l=r.l,r.when?.op&&(this.when=r.when),r.clc&&(this.clc=r.clc)}get stringType(){return je[this.t]}};var ht=class extends dt{text;constructor(e,r){e?.style?.lg?.typo?.s&&delete e.style.lg.typo.s,e?.style?.sm?.typo?.s&&delete e.style.sm.typo.s,super(r??2,e),e??={},this.text=e.text}};var eo=class extends ht{constructor(e,r){super(e,r??3)}};var Qo=class extends dt{value;constructor(e){super(6,e),e??={},this.value=e.value}};var Zo=class extends ht{showChips;optionsConfig;constructor(e=15,r){super(r,e),r??={},this.showChips=r.showChips??!1,this.optionsConfig=r.optionsConfig??{}}};var mc=class extends dt{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new Ve(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??!1,this.fullStar=e.fullStar,this.halfStart=e.halfStart}};var ng=zr(Ws());var Ff=class{enabled;type;color;constructor(e){e??={},this.enabled=e.enabled,this.type=e.type,this.color=new Ve(e.color)}},Hf=class{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new Ve(e.color)}},$f=class{enabled;delay;constructor(e={}){this.enabled=e.enabled,e.delay&&(this.delay=e.delay>100?e.delay:e.delay*1e3)}},ei=class{navigation;pagination;autoplay;loop;maxInRow;gap;maxInRowSm;gapSm;speed;marquee;constructor(e){e??={},this.navigation=new Hf(e.navigation),this.pagination=new Ff(e.pagination),this.autoplay=new $f(e.autoplay),this.loop=e.loop??!1,this.maxInRow=e.maxInRow??4,this.gap=e.gap??0,this.maxInRowSm=e.maxInRowSm??this.maxInRow,this.gapSm=e.gapSm??this.gap,e.speed&&(this.speed=e.speed*1e3),this.marquee=e.marquee}};var dc=class extends dt{conf;slide;formData;values;allowedTypes;constructor(e){super(62,e),e&&this.update(e)}update(e){e??={},this.slide=Gt.getParsedElement(e.slide),this.formData=e.formData,this.values=e.values,this.conf=new ei(e.conf),this.allowedTypes=e.allowedTypes}};var hc=class extends ht{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e,61),this.gap=e.gap,this.timerType=e.type,this.timer=new jo(e.timer),this.show=e.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=e.horizontal,this.lblPos=e.lblPos}};var xn=class extends dt{elems;constructor(e){super(4,e),this.update(e)}update(e){e??={},this.elems??=[],e.elems?.forEach(r=>{let n=Gt.getParsedElement(r);n&&this.elems.push(n)})}};var to=class extends dt{src;sm;lg;constructor(e,r){super(r??1,e),e&&this.update(e)}update(e){this.src=e.src,this.sm=e.sm,this.lg=e.lg}};var Gt=class t{static getParsedElements(e){let r=[];return e?.forEach(n=>{let o=t.getParsedElement(n);o&&r.push(o)}),r}static getParsedElement(e){switch(e.t){case 2:return new ht(e);case 3:return new eo(e);case 6:return new Qo(e);case 11:return new gc(e);case 12:return new Cn(e);case 61:return new hc(e);case 4:return new xn(e);case 1:return new to(e);case 13:return new to(e,13);case 14:return new ht(e,14);case 15:case 16:return new Zo(e.t,e);case 18:return new eo(e,18);case 62:return new dc(e);case 19:return new mc(e);default:ng.default.error("Unknown element type",e.t);return}}static parseAlignmentToJustifyContent(e){switch(e){case 1:return"center";case 2:return"flex-end";case 0:return"flex-start";default:return"flex-start"}}};var Cn=class extends dt{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(e){if(e??={},super(12,e),this.show=e.show,this.elems=Gt.getParsedElements(e.elems),this.noLinks=e.noLinks,!this.elems.length){e.cBox&&this.elems.push(new Qo(e.cBox)),this.elems.push(new to(e.img,13));let r=new ht(e.title,14);r.hide=!e.show?.title,r.text="{{ product.name }}",this.elems.push(r);let n=new ht(e.price);n.text="{{ product.price }}",n.hide=!e.show?.price;let o=new ht(e.compareAt);o.text="{{ product.compare_price }}",o.hide=!e.show?.price,e.compareAt||(o.style=new Jo(n.style),o.style.lg.typo=new st(Z(E({},o.style.lg.typo),{td:"line-through"})),o.style.sm.typo=new st(Z(E({},o.style.sm.typo),{td:"line-through"})));let i=new xn({style:{lg:{spc:{mb:10},flex:{dir:"row",gap:10,ai:"center",jc:Gt.parseAlignmentToJustifyContent(n.style.lg.typo?.ta)}}}});i.elems.push(o),i.elems.push(n),this.elems.push(i);let s=new Zo(15,e.variantDD);if(s.hide=!e.show?.variantDD,this.elems.push(s),e.btn){let a=new eo(e.btn,18);a.hide=!e.show?.btn,this.elems.push(a)}}e.symbol&&(this.symbol=new ht(e.symbol))}};var gc=class extends dt{conf;prod;constructor(e){super(11,e),e??={},this.conf=new Vf(e.conf),this.prod=new Cn(e.prod)}};var yc=class extends ei{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems}},Vf=class{lg;sm;constructor(e){e??={},this.lg=new yc(e.lg),this.sm=new yc(e.sm)}};var vc=class extends xn{constructor(e){super(e)}};var ti=class{cont;elems=[];constructor(e){e=e??{},this.cont=new vc(e.cont),e.elems?.forEach(r=>{this.addRawElement(r)})}addRawElement(e){let r=Gt.getParsedElement(e);return r&&this.elems.push(r),r}};function Ec(t,e){return eS(t,e,0,5)}function eS(t,e,r=0,n=50){if(e){if(r>n){console.warn("Maximum recursion depth reached in findFirstElementOfType");return}for(let o of e){if(o.t===t)return o;let i="elems"in o?o.elems:[];if(i?.length>0){let s=Ec(t,i);if(s)return s}}}}var Wf=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(e){this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.delay=e.delay??0,this.redirectBehaviour=e.redirectBehaviour,this.onsiteDeliveryType=e.onsiteDeliveryType,this.objective=e.objective}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===Ri.EXCLUSION}isABTesting(){return this.contentType===Ri.ABTESTING}isSingleContent(){return this.contentType===Ri.SINGLE}},rs=class{videoConfig;savingsBarConfig;afterDeleteJS;afterRenderJS;innerCSS;outerCSS;constructor(e){this.update(e)}update(e){e??={},e.videoConfig&&(this.videoConfig=new Za(e.videoConfig)),e.savingsBarConfig&&(this.savingsBarConfig=new Qs(e.savingsBarConfig)),this.afterDeleteJS=e.afterDeleteJS,this.afterRenderJS=e.afterRenderJS,this.innerCSS=e.innerCSS,this.outerCSS=e.outerCSS}},St=class extends Wf{contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;entryAnimation;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;stickyATCConfig;bundleConfig;content;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;experimentConfig;discountData=nr({});constructor(e){if(super(e),this.id=e.id,this.currency=fe().currencyCode??"USD",this.contentID=e.contentID,this.variation=e.variation,e.widget&&(this.widget=new ti(e.widget)),this.previewType=e.previewType,this.occurred=e.occurred??new Date,this.props=e.props,this.entryAnimation=e.entryAnimation??"NONE",this.embeddedItems=e.embeddedItems?.map(r=>new Dt(r)),this.items=e.items?.map(r=>new xt(r))??[],this.nonMutableItems=e.items?.map(r=>new xt(r))??[],this.collections=e.collections?.map(r=>new nc(r))??[],this.discount=e.discount,this.placement=e.placement,e.customerData?.name){let r=e.customerData.name.split(" ");this.customerData={name:e.customerData.name,full_name:e.customerData.name,first_name:r[0],last_name:r[1]}}this.ian=e.ian?this.processPopup(e.ian):void 0,this.promotionType=e.promotionType,this.manipulation=new oc(e.manipulation),this.contentSource=e.contentSource,this.klaviyoFormID=e.klaviyoFormID,this.hasMultiplePlacement=e.hasMultiplePlacement,this.skipSubscribedItems=e.skipSubscribedItems,this.stickyATCConfig=e.stickyATCConfig,e.experimentConfig&&(this.experimentConfig=new Ks(e.experimentConfig)),e.progressBarConfig&&(this.progressBarConfig=new Js(e.progressBarConfig)),e.bundleConfig&&(this.bundleConfig=new qs(e.bundleConfig)),e.bundleFrom&&(this.bundleFrom=new xt(e.bundleFrom)),e.content&&(this.content=new rs(e.content))}shouldDelay(){return this.delay>0}getDelaySeconds(){let e=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-e}isBundle(){return this.objective===hr.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===Ai.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===Ai.PAGE_EMBED}isProgressBar(){return this.objective===hr.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===hr.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===hr.CART_RECOVERY}isProductPromotion(){return this.objective===hr.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isCollectionPromoted(){return this.isProductPromotion()&&this.collections.length>0&&this.promotionType===$l.COLLECTION}isBYOB(){return this.objective===hr.BYOB}isStickyATC(){return this.objective===hr.STICKY_ATC}isShoppableVideo(){return this.objective===hr.SHOPPABLE_VIDEO}isSavingsBar(){return this.objective===hr.SAVINGS_BAR}processPopup(e){let r=this.items[0],n={},o={};if(r){let a=r.selectedOrFirstVariant.value;n=Z(E(E({name:r.name,id:r.mID,link:r.link,vID:a.mID,image:r.variantImage},Lt("price",a.price.d)),Lt("comparePrice",a.price.cmp)),{quantity:r.quantity}),o={quantity:a.quantity}}let i={productCount:me.getCurrent().item_count},s=Vo(JSON.stringify(e),{product:n,variant:o,cart:i,discount:this.discount,customer:this.customerData},new Ir(new Date,this));return r&&(s=s.replace(new RegExp("https://cdn.global.letscooee.com/images/placeholders/product.png","gi"),r.variantImage??r.firstImageURL)),new lc(JSON.parse(s))}calculateDiscountData(e,r){let n=Yr.sum(e,s=>s.selectedOrFirstVariant.value.price.d),o=Yr.sum(e,s=>{let a=s.selectedOrFirstVariant.value.price;return a.cmp??a.d}),i={actualPrice:n,totalComparePrice:o,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!e?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(i);return}if(Jt.BXGY===this.discount.type&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],this.updateEffectivePrice(e,i.discountPercentage,!0),i.discountAmount=i.actualPrice-Yr.sum(e,s=>s.selectedOrFirstVariant.value.effectivePrice.value);else if([Jt.STATIC,Jt.UNIQUE_FLAT].includes(this.discount.type)&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100,this.updateEffectivePrice(e,i.discountPercentage);else if(Jt.UNIQUE_FLAT_ITEMS===this.discount.type&&this.discount.values?.length)this.discount.ruleType==="fixed_amount"?(i.discountAmount=this.discount.values[0],i.discountPercentage=i.actualPrice>0?i.discountAmount*100/i.actualPrice:0):(i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100),this.updateEffectivePrice(e,i.discountPercentage);else if(this.discount.type===Jt.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)i.discountAmount=i.actualPrice-this.discount.values[0],i.discountPercentage=i.discountAmount/i.actualPrice*100,this.updateEffectivePrice(e,i.discountPercentage);else if(this.discount.type===Jt.UNIQUE_CHEAPEST_ITEM_FREE){e.sort((a,l)=>l.selectedOrFirstVariant.value.price.d-a.selectedOrFirstVariant.value.price.d);let s=e[e.length-1];s.selectedOrFirstVariant.value.effectivePrice.value=0,i.discountAmount=s.selectedOrFirstVariant.value.price.d,i.discountPercentage=i.discountAmount/i.actualPrice*100}i.discountedPrice=i.actualPrice-i.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(i)}getPrivateAttributesForLineItem(){return ze.get().skipItemAttribute?{}:{_via:"Cooee",_letscooee_campaign:this.shortID,_letscooee_content:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return ze.get().skipItemAttribute?[]:[{key:"_via",value:"Cooee"},{key:"_letscooee_campaign",value:this.shortID},{key:"_letscooee_content",value:this.contentID}]}isBundleOnCartDrawer(){return this.isBundle()&&this.isCartEmbed()}isBundleOnPDP(){return this.isPageEmbed()&&this.isBundle()}hasSwiperElement(){if(Ec(62,this.widget?.elems))return!0;let r=Ec(11,this.widget?.elems);return r?r.conf.lg.disp===2||r.conf.sm.disp===2:!1}toString(){let e;return this.onsiteDeliveryType===Ai.POPUP?e="Popup":e=bm.toTitle(this.objective),`${e}(id=${this.shortID})`}getCartMagicVariables(){let e=me.getCurrent(),r=Yr.sum(e.items??[],n=>n.discounts?.reduce((o,i)=>o+(i.amount??0),0)??0);return E(E(E(E({productCount:e.item_count,product_count:e.item_count},Lt("amount",e.total_price/100)),Lt("originalAmount",e.original_total_price/100)),Lt("total_line_items_discount",r/100)),Lt("total_discount",e.total_discount/100))}shouldGetVariationImmediately(){return this.hasMultiplePlacement&&!this.alwaysHaveVariations()}shouldSkipVariation(){return this.isSingleContent()||this.alwaysHaveVariations()?!0:!!this.variation}alwaysHaveVariations(){return this.isProgressBar()||this.isSavingsBar()}updateEffectivePrice(e,r,n=!1){let o=fe().currentItem;e.forEach(i=>{let s=i.selectedOrFirstVariant.value,a=s.price;if(n&&i.mID===o.mID)s.effectivePrice.value=a.d;else{let l=a.d*r/100;s.effectivePrice.value=a.d-l}})}formatCurrencyAndNumber(e){if(!e)return{};let r={discountPercentage:Eh(e.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice","totalComparePrice"].map(n=>{Object.assign(r,Lt(n,e[n]))}),r}};function rS(t,e){return e={exports:{}},t(e,e.exports),e.exports}var nS=aS,oS=lS,iS=pS,kr=[],ir=[],sS=typeof Uint8Array<"u"?Uint8Array:Array,jf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ro=0,og=jf.length;ro<og;++ro)kr[ro]=jf[ro],ir[jf.charCodeAt(ro)]=ro;var ro,og;ir[45]=62;ir[95]=63;function _g(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function aS(t){var e=_g(t),r=e[0],n=e[1];return(r+n)*3/4-n}function cS(t,e,r){return(e+r)*3/4-r}function lS(t){var e,r=_g(t),n=r[0],o=r[1],i=new sS(cS(t,n,o)),s=0,a=o>0?n-4:n,l;for(l=0;l<a;l+=4)e=ir[t.charCodeAt(l)]<<18|ir[t.charCodeAt(l+1)]<<12|ir[t.charCodeAt(l+2)]<<6|ir[t.charCodeAt(l+3)],i[s++]=e>>16&255,i[s++]=e>>8&255,i[s++]=e&255;return o===2&&(e=ir[t.charCodeAt(l)]<<2|ir[t.charCodeAt(l+1)]>>4,i[s++]=e&255),o===1&&(e=ir[t.charCodeAt(l)]<<10|ir[t.charCodeAt(l+1)]<<4|ir[t.charCodeAt(l+2)]>>2,i[s++]=e>>8&255,i[s++]=e&255),i}function uS(t){return kr[t>>18&63]+kr[t>>12&63]+kr[t>>6&63]+kr[t&63]}function fS(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(t[i+2]&255),o.push(uS(n));return o.join("")}function pS(t){for(var e,r=t.length,n=r%3,o=[],i=16383,s=0,a=r-n;s<a;s+=i)o.push(fS(t,s,s+i>a?a:s+i));return n===1?(e=t[r-1],o.push(kr[e>>2]+kr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],o.push(kr[e>>10]+kr[e>>4&63]+kr[e<<2&63]+"=")),o.join("")}var Gf={byteLength:nS,toByteArray:oS,fromByteArray:iS};var mS=function(e,r,n,o,i){var s,a,l=i*8-o-1,f=(1<<l)-1,m=f>>1,d=-7,_=n?i-1:0,y=n?-1:1,C=e[r+_];for(_+=y,s=C&(1<<-d)-1,C>>=-d,d+=l;d>0;s=s*256+e[r+_],_+=y,d-=8);for(a=s&(1<<-d)-1,s>>=-d,d+=o;d>0;a=a*256+e[r+_],_+=y,d-=8);if(s===0)s=1-m;else{if(s===f)return a?NaN:(C?-1:1)*(1/0);a=a+Math.pow(2,o),s=s-m}return(C?-1:1)*a*Math.pow(2,s-o)},dS=function(e,r,n,o,i,s){var a,l,f,m=s*8-i-1,d=(1<<m)-1,_=d>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,C=o?0:s-1,N=o?1:-1,A=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,a=d):(a=Math.floor(Math.log(r)/Math.LN2),r*(f=Math.pow(2,-a))<1&&(a--,f*=2),a+_>=1?r+=y/f:r+=y*Math.pow(2,1-_),r*f>=2&&(a++,f/=2),a+_>=d?(l=0,a=d):a+_>=1?(l=(r*f-1)*Math.pow(2,i),a=a+_):(l=r*Math.pow(2,_-1)*Math.pow(2,i),a=0));i>=8;e[n+C]=l&255,C+=N,l/=256,i-=8);for(a=a<<i|l,m+=i;m>0;e[n+C]=a&255,C+=N,a/=256,m-=8);e[n+C-N]|=A*128},ri={read:mS,write:dS},wc=rS(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=B,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,s.TYPED_ARRAY_SUPPORT=o(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function o(){try{var h=new Uint8Array(1),c={foo:function(){return 42}};return Object.setPrototypeOf(c,Uint8Array.prototype),Object.setPrototypeOf(h,c),h.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function i(h){if(h>n)throw new RangeError('The value "'+h+'" is invalid for option "size"');var c=new Uint8Array(h);return Object.setPrototypeOf(c,s.prototype),c}function s(h,c,u){if(typeof h=="number"){if(typeof c=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return m(h)}return a(h,c,u)}s.poolSize=8192;function a(h,c,u){if(typeof h=="string")return d(h,c);if(ArrayBuffer.isView(h))return y(h);if(h==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(h));if($e(h,ArrayBuffer)||h&&$e(h.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($e(h,SharedArrayBuffer)||h&&$e(h.buffer,SharedArrayBuffer)))return C(h,c,u);if(typeof h=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var v=h.valueOf&&h.valueOf();if(v!=null&&v!==h)return s.from(v,c,u);var x=N(h);if(x)return x;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof h[Symbol.toPrimitive]=="function")return s.from(h[Symbol.toPrimitive]("string"),c,u);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(h))}s.from=function(h,c,u){return a(h,c,u)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function l(h){if(typeof h!="number")throw new TypeError('"size" argument must be of type number');if(h<0)throw new RangeError('The value "'+h+'" is invalid for option "size"')}function f(h,c,u){return l(h),h<=0?i(h):c!==void 0?typeof u=="string"?i(h).fill(c,u):i(h).fill(c):i(h)}s.alloc=function(h,c,u){return f(h,c,u)};function m(h){return l(h),i(h<0?0:A(h)|0)}s.allocUnsafe=function(h){return m(h)},s.allocUnsafeSlow=function(h){return m(h)};function d(h,c){if((typeof c!="string"||c==="")&&(c="utf8"),!s.isEncoding(c))throw new TypeError("Unknown encoding: "+c);var u=q(h,c)|0,v=i(u),x=v.write(h,c);return x!==u&&(v=v.slice(0,x)),v}function _(h){for(var c=h.length<0?0:A(h.length)|0,u=i(c),v=0;v<c;v+=1)u[v]=h[v]&255;return u}function y(h){if($e(h,Uint8Array)){var c=new Uint8Array(h);return C(c.buffer,c.byteOffset,c.byteLength)}return _(h)}function C(h,c,u){if(c<0||h.byteLength<c)throw new RangeError('"offset" is outside of buffer bounds');if(h.byteLength<c+(u||0))throw new RangeError('"length" is outside of buffer bounds');var v;return c===void 0&&u===void 0?v=new Uint8Array(h):u===void 0?v=new Uint8Array(h,c):v=new Uint8Array(h,c,u),Object.setPrototypeOf(v,s.prototype),v}function N(h){if(s.isBuffer(h)){var c=A(h.length)|0,u=i(c);return u.length===0||h.copy(u,0,0,c),u}if(h.length!==void 0)return typeof h.length!="number"||De(h.length)?i(0):_(h);if(h.type==="Buffer"&&Array.isArray(h.data))return _(h.data)}function A(h){if(h>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return h|0}function B(h){return+h!=h&&(h=0),s.alloc(+h)}s.isBuffer=function(c){return c!=null&&c._isBuffer===!0&&c!==s.prototype},s.compare=function(c,u){if($e(c,Uint8Array)&&(c=s.from(c,c.offset,c.byteLength)),$e(u,Uint8Array)&&(u=s.from(u,u.offset,u.byteLength)),!s.isBuffer(c)||!s.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(c===u)return 0;for(var v=c.length,x=u.length,O=0,W=Math.min(v,x);O<W;++O)if(c[O]!==u[O]){v=c[O],x=u[O];break}return v<x?-1:x<v?1:0},s.isEncoding=function(c){switch(String(c).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(c,u){if(!Array.isArray(c))throw new TypeError('"list" argument must be an Array of Buffers');if(c.length===0)return s.alloc(0);var v;if(u===void 0)for(u=0,v=0;v<c.length;++v)u+=c[v].length;var x=s.allocUnsafe(u),O=0;for(v=0;v<c.length;++v){var W=c[v];if($e(W,Uint8Array))O+W.length>x.length?s.from(W).copy(x,O):Uint8Array.prototype.set.call(x,W,O);else if(s.isBuffer(W))W.copy(x,O);else throw new TypeError('"list" argument must be an Array of Buffers');O+=W.length}return x};function q(h,c){if(s.isBuffer(h))return h.length;if(ArrayBuffer.isView(h)||$e(h,ArrayBuffer))return h.byteLength;if(typeof h!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(h));var u=h.length,v=arguments.length>2&&arguments[2]===!0;if(!v&&u===0)return 0;for(var x=!1;;)switch(c){case"ascii":case"latin1":case"binary":return u;case"utf8":case"utf-8":return Et(h).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u*2;case"hex":return u>>>1;case"base64":return He(h).length;default:if(x)return v?-1:Et(h).length;c=(""+c).toLowerCase(),x=!0}}s.byteLength=q;function P(h,c,u){var v=!1;if((c===void 0||c<0)&&(c=0),c>this.length||((u===void 0||u>this.length)&&(u=this.length),u<=0)||(u>>>=0,c>>>=0,u<=c))return"";for(h||(h="utf8");;)switch(h){case"hex":return V(this,c,u);case"utf8":case"utf-8":return Ge(this,c,u);case"ascii":return D(this,c,u);case"latin1":case"binary":return R(this,c,u);case"base64":return Re(this,c,u);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k(this,c,u);default:if(v)throw new TypeError("Unknown encoding: "+h);h=(h+"").toLowerCase(),v=!0}}s.prototype._isBuffer=!0;function Q(h,c,u){var v=h[c];h[c]=h[u],h[u]=v}s.prototype.swap16=function(){var c=this.length;if(c%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var u=0;u<c;u+=2)Q(this,u,u+1);return this},s.prototype.swap32=function(){var c=this.length;if(c%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var u=0;u<c;u+=4)Q(this,u,u+3),Q(this,u+1,u+2);return this},s.prototype.swap64=function(){var c=this.length;if(c%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var u=0;u<c;u+=8)Q(this,u,u+7),Q(this,u+1,u+6),Q(this,u+2,u+5),Q(this,u+3,u+4);return this},s.prototype.toString=function(){var c=this.length;return c===0?"":arguments.length===0?Ge(this,0,c):P.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(c){if(!s.isBuffer(c))throw new TypeError("Argument must be a Buffer");return this===c?!0:s.compare(this,c)===0},s.prototype.inspect=function(){var c="",u=e.INSPECT_MAX_BYTES;return c=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(c+=" ... "),"<Buffer "+c+">"},r&&(s.prototype[r]=s.prototype.inspect),s.prototype.compare=function(c,u,v,x,O){if($e(c,Uint8Array)&&(c=s.from(c,c.offset,c.byteLength)),!s.isBuffer(c))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(c));if(u===void 0&&(u=0),v===void 0&&(v=c?c.length:0),x===void 0&&(x=0),O===void 0&&(O=this.length),u<0||v>c.length||x<0||O>this.length)throw new RangeError("out of range index");if(x>=O&&u>=v)return 0;if(x>=O)return-1;if(u>=v)return 1;if(u>>>=0,v>>>=0,x>>>=0,O>>>=0,this===c)return 0;for(var W=O-x,ue=v-u,_e=Math.min(W,ue),ge=this.slice(x,O),Me=c.slice(u,v),ke=0;ke<_e;++ke)if(ge[ke]!==Me[ke]){W=ge[ke],ue=Me[ke];break}return W<ue?-1:ue<W?1:0};function Ee(h,c,u,v,x){if(h.length===0)return-1;if(typeof u=="string"?(v=u,u=0):u>2147483647?u=2147483647:u<-2147483648&&(u=-2147483648),u=+u,De(u)&&(u=x?0:h.length-1),u<0&&(u=h.length+u),u>=h.length){if(x)return-1;u=h.length-1}else if(u<0)if(x)u=0;else return-1;if(typeof c=="string"&&(c=s.from(c,v)),s.isBuffer(c))return c.length===0?-1:X(h,c,u,v,x);if(typeof c=="number")return c=c&255,typeof Uint8Array.prototype.indexOf=="function"?x?Uint8Array.prototype.indexOf.call(h,c,u):Uint8Array.prototype.lastIndexOf.call(h,c,u):X(h,[c],u,v,x);throw new TypeError("val must be string, number or Buffer")}function X(h,c,u,v,x){var O=1,W=h.length,ue=c.length;if(v!==void 0&&(v=String(v).toLowerCase(),v==="ucs2"||v==="ucs-2"||v==="utf16le"||v==="utf-16le")){if(h.length<2||c.length<2)return-1;O=2,W/=2,ue/=2,u/=2}function _e(fr,qr){return O===1?fr[qr]:fr.readUInt16BE(qr*O)}var ge;if(x){var Me=-1;for(ge=u;ge<W;ge++)if(_e(h,ge)===_e(c,Me===-1?0:ge-Me)){if(Me===-1&&(Me=ge),ge-Me+1===ue)return Me*O}else Me!==-1&&(ge-=ge-Me),Me=-1}else for(u+ue>W&&(u=W-ue),ge=u;ge>=0;ge--){for(var ke=!0,tt=0;tt<ue;tt++)if(_e(h,ge+tt)!==_e(c,tt)){ke=!1;break}if(ke)return ge}return-1}s.prototype.includes=function(c,u,v){return this.indexOf(c,u,v)!==-1},s.prototype.indexOf=function(c,u,v){return Ee(this,c,u,v,!0)},s.prototype.lastIndexOf=function(c,u,v){return Ee(this,c,u,v,!1)};function ce(h,c,u,v){u=Number(u)||0;var x=h.length-u;v?(v=Number(v),v>x&&(v=x)):v=x;var O=c.length;v>O/2&&(v=O/2);for(var W=0;W<v;++W){var ue=parseInt(c.substr(W*2,2),16);if(De(ue))return W;h[u+W]=ue}return W}function se(h,c,u,v){return Ae(Et(c,h.length-u),h,u,v)}function de(h,c,u,v){return Ae(it(c),h,u,v)}function Le(h,c,u,v){return Ae(He(c),h,u,v)}function Se(h,c,u,v){return Ae(we(c,h.length-u),h,u,v)}s.prototype.write=function(c,u,v,x){if(u===void 0)x="utf8",v=this.length,u=0;else if(v===void 0&&typeof u=="string")x=u,v=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(v)?(v=v>>>0,x===void 0&&(x="utf8")):(x=v,v=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var O=this.length-u;if((v===void 0||v>O)&&(v=O),c.length>0&&(v<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");x||(x="utf8");for(var W=!1;;)switch(x){case"hex":return ce(this,c,u,v);case"utf8":case"utf-8":return se(this,c,u,v);case"ascii":case"latin1":case"binary":return de(this,c,u,v);case"base64":return Le(this,c,u,v);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Se(this,c,u,v);default:if(W)throw new TypeError("Unknown encoding: "+x);x=(""+x).toLowerCase(),W=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Re(h,c,u){return c===0&&u===h.length?Gf.fromByteArray(h):Gf.fromByteArray(h.slice(c,u))}function Ge(h,c,u){u=Math.min(h.length,u);for(var v=[],x=c;x<u;){var O=h[x],W=null,ue=O>239?4:O>223?3:O>191?2:1;if(x+ue<=u){var _e,ge,Me,ke;switch(ue){case 1:O<128&&(W=O);break;case 2:_e=h[x+1],(_e&192)===128&&(ke=(O&31)<<6|_e&63,ke>127&&(W=ke));break;case 3:_e=h[x+1],ge=h[x+2],(_e&192)===128&&(ge&192)===128&&(ke=(O&15)<<12|(_e&63)<<6|ge&63,ke>2047&&(ke<55296||ke>57343)&&(W=ke));break;case 4:_e=h[x+1],ge=h[x+2],Me=h[x+3],(_e&192)===128&&(ge&192)===128&&(Me&192)===128&&(ke=(O&15)<<18|(_e&63)<<12|(ge&63)<<6|Me&63,ke>65535&&ke<1114112&&(W=ke))}}W===null?(W=65533,ue=1):W>65535&&(W-=65536,v.push(W>>>10&1023|55296),W=56320|W&1023),v.push(W),x+=ue}return Bt(v)}var Je=4096;function Bt(h){var c=h.length;if(c<=Je)return String.fromCharCode.apply(String,h);for(var u="",v=0;v<c;)u+=String.fromCharCode.apply(String,h.slice(v,v+=Je));return u}function D(h,c,u){var v="";u=Math.min(h.length,u);for(var x=c;x<u;++x)v+=String.fromCharCode(h[x]&127);return v}function R(h,c,u){var v="";u=Math.min(h.length,u);for(var x=c;x<u;++x)v+=String.fromCharCode(h[x]);return v}function V(h,c,u){var v=h.length;(!c||c<0)&&(c=0),(!u||u<0||u>v)&&(u=v);for(var x="",O=c;O<u;++O)x+=$t[h[O]];return x}function k(h,c,u){for(var v=h.slice(c,u),x="",O=0;O<v.length-1;O+=2)x+=String.fromCharCode(v[O]+v[O+1]*256);return x}s.prototype.slice=function(c,u){var v=this.length;c=~~c,u=u===void 0?v:~~u,c<0?(c+=v,c<0&&(c=0)):c>v&&(c=v),u<0?(u+=v,u<0&&(u=0)):u>v&&(u=v),u<c&&(u=c);var x=this.subarray(c,u);return Object.setPrototypeOf(x,s.prototype),x};function H(h,c,u){if(h%1!==0||h<0)throw new RangeError("offset is not uint");if(h+c>u)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(c,u,v){c=c>>>0,u=u>>>0,v||H(c,u,this.length);for(var x=this[c],O=1,W=0;++W<u&&(O*=256);)x+=this[c+W]*O;return x},s.prototype.readUintBE=s.prototype.readUIntBE=function(c,u,v){c=c>>>0,u=u>>>0,v||H(c,u,this.length);for(var x=this[c+--u],O=1;u>0&&(O*=256);)x+=this[c+--u]*O;return x},s.prototype.readUint8=s.prototype.readUInt8=function(c,u){return c=c>>>0,u||H(c,1,this.length),this[c]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(c,u){return c=c>>>0,u||H(c,2,this.length),this[c]|this[c+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(c,u){return c=c>>>0,u||H(c,2,this.length),this[c]<<8|this[c+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(c,u){return c=c>>>0,u||H(c,4,this.length),(this[c]|this[c+1]<<8|this[c+2]<<16)+this[c+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(c,u){return c=c>>>0,u||H(c,4,this.length),this[c]*16777216+(this[c+1]<<16|this[c+2]<<8|this[c+3])},s.prototype.readIntLE=function(c,u,v){c=c>>>0,u=u>>>0,v||H(c,u,this.length);for(var x=this[c],O=1,W=0;++W<u&&(O*=256);)x+=this[c+W]*O;return O*=128,x>=O&&(x-=Math.pow(2,8*u)),x},s.prototype.readIntBE=function(c,u,v){c=c>>>0,u=u>>>0,v||H(c,u,this.length);for(var x=u,O=1,W=this[c+--x];x>0&&(O*=256);)W+=this[c+--x]*O;return O*=128,W>=O&&(W-=Math.pow(2,8*u)),W},s.prototype.readInt8=function(c,u){return c=c>>>0,u||H(c,1,this.length),this[c]&128?(255-this[c]+1)*-1:this[c]},s.prototype.readInt16LE=function(c,u){c=c>>>0,u||H(c,2,this.length);var v=this[c]|this[c+1]<<8;return v&32768?v|4294901760:v},s.prototype.readInt16BE=function(c,u){c=c>>>0,u||H(c,2,this.length);var v=this[c+1]|this[c]<<8;return v&32768?v|4294901760:v},s.prototype.readInt32LE=function(c,u){return c=c>>>0,u||H(c,4,this.length),this[c]|this[c+1]<<8|this[c+2]<<16|this[c+3]<<24},s.prototype.readInt32BE=function(c,u){return c=c>>>0,u||H(c,4,this.length),this[c]<<24|this[c+1]<<16|this[c+2]<<8|this[c+3]},s.prototype.readFloatLE=function(c,u){return c=c>>>0,u||H(c,4,this.length),ri.read(this,c,!0,23,4)},s.prototype.readFloatBE=function(c,u){return c=c>>>0,u||H(c,4,this.length),ri.read(this,c,!1,23,4)},s.prototype.readDoubleLE=function(c,u){return c=c>>>0,u||H(c,8,this.length),ri.read(this,c,!0,52,8)},s.prototype.readDoubleBE=function(c,u){return c=c>>>0,u||H(c,8,this.length),ri.read(this,c,!1,52,8)};function ne(h,c,u,v,x,O){if(!s.isBuffer(h))throw new TypeError('"buffer" argument must be a Buffer instance');if(c>x||c<O)throw new RangeError('"value" argument is out of bounds');if(u+v>h.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(c,u,v,x){if(c=+c,u=u>>>0,v=v>>>0,!x){var O=Math.pow(2,8*v)-1;ne(this,c,u,v,O,0)}var W=1,ue=0;for(this[u]=c&255;++ue<v&&(W*=256);)this[u+ue]=c/W&255;return u+v},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(c,u,v,x){if(c=+c,u=u>>>0,v=v>>>0,!x){var O=Math.pow(2,8*v)-1;ne(this,c,u,v,O,0)}var W=v-1,ue=1;for(this[u+W]=c&255;--W>=0&&(ue*=256);)this[u+W]=c/ue&255;return u+v},s.prototype.writeUint8=s.prototype.writeUInt8=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,1,255,0),this[u]=c&255,u+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,2,65535,0),this[u]=c&255,this[u+1]=c>>>8,u+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,2,65535,0),this[u]=c>>>8,this[u+1]=c&255,u+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,4,4294967295,0),this[u+3]=c>>>24,this[u+2]=c>>>16,this[u+1]=c>>>8,this[u]=c&255,u+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,4,4294967295,0),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4},s.prototype.writeIntLE=function(c,u,v,x){if(c=+c,u=u>>>0,!x){var O=Math.pow(2,8*v-1);ne(this,c,u,v,O-1,-O)}var W=0,ue=1,_e=0;for(this[u]=c&255;++W<v&&(ue*=256);)c<0&&_e===0&&this[u+W-1]!==0&&(_e=1),this[u+W]=(c/ue>>0)-_e&255;return u+v},s.prototype.writeIntBE=function(c,u,v,x){if(c=+c,u=u>>>0,!x){var O=Math.pow(2,8*v-1);ne(this,c,u,v,O-1,-O)}var W=v-1,ue=1,_e=0;for(this[u+W]=c&255;--W>=0&&(ue*=256);)c<0&&_e===0&&this[u+W+1]!==0&&(_e=1),this[u+W]=(c/ue>>0)-_e&255;return u+v},s.prototype.writeInt8=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,1,127,-128),c<0&&(c=255+c+1),this[u]=c&255,u+1},s.prototype.writeInt16LE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,2,32767,-32768),this[u]=c&255,this[u+1]=c>>>8,u+2},s.prototype.writeInt16BE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,2,32767,-32768),this[u]=c>>>8,this[u+1]=c&255,u+2},s.prototype.writeInt32LE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,4,2147483647,-2147483648),this[u]=c&255,this[u+1]=c>>>8,this[u+2]=c>>>16,this[u+3]=c>>>24,u+4},s.prototype.writeInt32BE=function(c,u,v){return c=+c,u=u>>>0,v||ne(this,c,u,4,2147483647,-2147483648),c<0&&(c=4294967295+c+1),this[u]=c>>>24,this[u+1]=c>>>16,this[u+2]=c>>>8,this[u+3]=c&255,u+4};function he(h,c,u,v,x,O){if(u+v>h.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("Index out of range")}function qe(h,c,u,v,x){return c=+c,u=u>>>0,x||he(h,c,u,4),ri.write(h,c,u,v,23,4),u+4}s.prototype.writeFloatLE=function(c,u,v){return qe(this,c,u,!0,v)},s.prototype.writeFloatBE=function(c,u,v){return qe(this,c,u,!1,v)};function Ze(h,c,u,v,x){return c=+c,u=u>>>0,x||he(h,c,u,8),ri.write(h,c,u,v,52,8),u+8}s.prototype.writeDoubleLE=function(c,u,v){return Ze(this,c,u,!0,v)},s.prototype.writeDoubleBE=function(c,u,v){return Ze(this,c,u,!1,v)},s.prototype.copy=function(c,u,v,x){if(!s.isBuffer(c))throw new TypeError("argument should be a Buffer");if(v||(v=0),!x&&x!==0&&(x=this.length),u>=c.length&&(u=c.length),u||(u=0),x>0&&x<v&&(x=v),x===v||c.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(v<0||v>=this.length)throw new RangeError("Index out of range");if(x<0)throw new RangeError("sourceEnd out of bounds");x>this.length&&(x=this.length),c.length-u<x-v&&(x=c.length-u+v);var O=x-v;return this===c&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,v,x):Uint8Array.prototype.set.call(c,this.subarray(v,x),u),O},s.prototype.fill=function(c,u,v,x){if(typeof c=="string"){if(typeof u=="string"?(x=u,u=0,v=this.length):typeof v=="string"&&(x=v,v=this.length),x!==void 0&&typeof x!="string")throw new TypeError("encoding must be a string");if(typeof x=="string"&&!s.isEncoding(x))throw new TypeError("Unknown encoding: "+x);if(c.length===1){var O=c.charCodeAt(0);(x==="utf8"&&O<128||x==="latin1")&&(c=O)}}else typeof c=="number"?c=c&255:typeof c=="boolean"&&(c=Number(c));if(u<0||this.length<u||this.length<v)throw new RangeError("Out of range index");if(v<=u)return this;u=u>>>0,v=v===void 0?this.length:v>>>0,c||(c=0);var W;if(typeof c=="number")for(W=u;W<v;++W)this[W]=c;else{var ue=s.isBuffer(c)?c:s.from(c,x),_e=ue.length;if(_e===0)throw new TypeError('The value "'+c+'" is invalid for argument "value"');for(W=0;W<v-u;++W)this[W+u]=ue[W%_e]}return this};var et=/[^+/0-9A-Za-z-_]/g;function vt(h){if(h=h.split("=")[0],h=h.trim().replace(et,""),h.length<2)return"";for(;h.length%4!==0;)h=h+"=";return h}function Et(h,c){c=c||1/0;for(var u,v=h.length,x=null,O=[],W=0;W<v;++W){if(u=h.charCodeAt(W),u>55295&&u<57344){if(!x){if(u>56319){(c-=3)>-1&&O.push(239,191,189);continue}else if(W+1===v){(c-=3)>-1&&O.push(239,191,189);continue}x=u;continue}if(u<56320){(c-=3)>-1&&O.push(239,191,189),x=u;continue}u=(x-55296<<10|u-56320)+65536}else x&&(c-=3)>-1&&O.push(239,191,189);if(x=null,u<128){if((c-=1)<0)break;O.push(u)}else if(u<2048){if((c-=2)<0)break;O.push(u>>6|192,u&63|128)}else if(u<65536){if((c-=3)<0)break;O.push(u>>12|224,u>>6&63|128,u&63|128)}else if(u<1114112){if((c-=4)<0)break;O.push(u>>18|240,u>>12&63|128,u>>6&63|128,u&63|128)}else throw new Error("Invalid code point")}return O}function it(h){for(var c=[],u=0;u<h.length;++u)c.push(h.charCodeAt(u)&255);return c}function we(h,c){for(var u,v,x,O=[],W=0;W<h.length&&!((c-=2)<0);++W)u=h.charCodeAt(W),v=u>>8,x=u%256,O.push(x),O.push(v);return O}function He(h){return Gf.toByteArray(vt(h))}function Ae(h,c,u,v){for(var x=0;x<v&&!(x+u>=c.length||x>=h.length);++x)c[x+u]=h[x];return x}function $e(h,c){return h instanceof c||h!=null&&h.constructor!=null&&h.constructor.name!=null&&h.constructor.name===c.name}function De(h){return h!==h}var $t=(function(){for(var h="0123456789abcdef",c=new Array(256),u=0;u<16;++u)for(var v=u*16,x=0;x<16;++x)c[v+x]=h[u]+h[x];return c})()}),Ie=wc.Buffer;wc.SlowBuffer;wc.INSPECT_MAX_BYTES;wc.kMaxLength;var Xf=function(e,r){return Xf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var i in o)o.hasOwnProperty(i)&&(n[i]=o[i])},Xf(e,r)};function Sc(t,e){Xf(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var oo=(function(t){Sc(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e})(Error),Xe=(function(t){Sc(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e})(TypeError);function _c(t){return t&&t.Math==Math&&t}function bg(){return _c(typeof globalThis=="object"&&globalThis)||_c(typeof window=="object"&&window)||_c(typeof self=="object"&&self)||_c(typeof global=="object"&&global)||Function("return this")()}function hS(){var t=bg();return typeof t.navigator=="object"&&t.navigator.product==="ReactNative"}var gS=function(e){var r=hS()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var n=Ie.alloc(e),o=0;o<e;++o)n[o]=Math.floor(Math.random()*256);return n},yS=function(){{if(typeof window<"u"){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(Ie.alloc(e))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(e){return global.crypto.getRandomValues(Ie.alloc(e))}:gS}},wg=yS();function vS(t){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(t))}function Qf(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function ES(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function _S(t){return ss(t)&&Object.prototype.toString.call(t)==="[object Date]"}function ss(t){return typeof t=="object"&&t!==null}function Tc(t,e){var r=!1;function n(){for(var o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];return r||(console.warn(e),r=!0),t.apply(this,o)}return n}function bc(t){if(ArrayBuffer.isView(t))return Ie.from(t.buffer,t.byteOffset,t.byteLength);if(vS(t))return Ie.from(t);throw new Xe("Must use either Buffer or TypedArray")}var bS=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,Sg=function(t){return typeof t=="string"&&bS.test(t)},Jf=function(t){if(!Sg(t))throw new Xe('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var e=t.replace(/-/g,"");return Ie.from(e,"hex")},ig=function(t,e){return e===void 0&&(e=!0),e?t.toString("hex",0,4)+"-"+t.toString("hex",4,6)+"-"+t.toString("hex",6,8)+"-"+t.toString("hex",8,10)+"-"+t.toString("hex",10,16):t.toString("hex")};var ek=Math.pow(2,63)-1,tk=-Math.pow(2,63),wS=Math.pow(2,53),SS=-Math.pow(2,53);var Tg=4;var io=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(e!=null&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer)&&!Array.isArray(e))throw new Xe("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??t.BSON_BINARY_SUBTYPE_DEFAULT,e==null?(this.buffer=Ie.alloc(t.BUFFER_SIZE),this.position=0):(typeof e=="string"?this.buffer=Ie.from(e,"binary"):Array.isArray(e)?this.buffer=Ie.from(e):this.buffer=bc(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if(typeof e=="string"&&e.length!==1)throw new Xe("only accepts single character String");if(typeof e!="number"&&e.length!==1)throw new Xe("only accepts single character Uint8Array or Array");var r;if(typeof e=="string"?r=e.charCodeAt(0):typeof e=="number"?r=e:r=e[0],r<0||r>255)throw new Xe("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=Ie.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},t.prototype.write=function(e,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+e.length){var n=Ie.alloc(this.buffer.length+e.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(e)?(this.buffer.set(bc(e),r),this.position=r+e.byteLength>this.position?r+e.length:this.position):typeof e=="string"&&(this.buffer.write(e,r,e.length,"binary"),this.position=r+e.length>this.position?r+e.length:this.position)},t.prototype.read=function(e,r){return r=r&&r>0?r:this.position,this.buffer.slice(e,e+r)},t.prototype.value=function(e){return e=!!e,e&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(e){return this.buffer.toString(e)},t.prototype.toExtendedJSON=function(e){e=e||{};var r=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return e.legacy?{$binary:r,$type:n.length===1?"0"+n:n}:{$binary:{base64:r,subType:n.length===1?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new sg(this.buffer.slice(0,this.position));throw new oo('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(e,r){r=r||{};var n,o;if("$binary"in e?r.legacy&&typeof e.$binary=="string"&&"$type"in e?(o=e.$type?parseInt(e.$type,16):0,n=Ie.from(e.$binary,"base64")):typeof e.$binary!="string"&&(o=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=Ie.from(e.$binary.base64,"base64")):"$uuid"in e&&(o=4,n=Jf(e.$uuid)),!n)throw new Xe("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return o===Tg?new sg(n):new t(n,o)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t})();Object.defineProperty(io.prototype,"_bsontype",{value:"Binary"});var qf=16,sg=(function(t){Sc(e,t);function e(r){var n=this,o,i;if(r==null)o=e.generate();else if(r instanceof e)o=Ie.from(r.buffer),i=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===qf)o=bc(r);else if(typeof r=="string")o=Jf(r);else throw new Xe("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return n=t.call(this,o,Tg)||this,n.__id=i,n}return Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,e.cacheHexString&&(this.__id=ig(r))},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(r){if(r===void 0&&(r=!0),e.cacheHexString&&this.__id)return this.__id;var n=ig(this.id,r);return e.cacheHexString&&(this.__id=n),n},e.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(r){if(!r)return!1;if(r instanceof e)return r.id.equals(this.id);try{return new e(r).id.equals(this.id)}catch{return!1}},e.prototype.toBinary=function(){return new io(this.id,io.SUBTYPE_UUID)},e.generate=function(){var r=wg(qf);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ie.from(r)},e.isValid=function(r){return r?r instanceof e?!0:typeof r=="string"?Sg(r):Qf(r)?r.length!==qf?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},e.createFromHexString=function(r){var n=Jf(r);return new e(n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},e})(io),Ic=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);this.code=e,this.scope=r}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},t})();Object.defineProperty(Ic.prototype,"_bsontype",{value:"Code"});function TS(t){return ss(t)&&t.$id!=null&&typeof t.$ref=="string"&&(t.$db==null||typeof t.$db=="string")}var os=(function(){function t(e,r,n,o){if(!(this instanceof t))return new t(e,r,n,o);var i=e.split(".");i.length===2&&(n=i.shift(),e=i.shift()),this.collection=e,this.oid=r,this.db=n,this.fields=o||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(e.$db=this.db),e},t.prototype.toExtendedJSON=function(e){e=e||{};var r={$ref:this.collection,$id:this.oid};return e.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},t.fromExtendedJSON=function(e){var r=Object.assign({},e);return delete r.$ref,delete r.$id,delete r.$db,new t(e.$ref,e.$id,e.$db,r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t})();Object.defineProperty(os.prototype,"_bsontype",{value:"DBRef"});var or=void 0;try{or=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var ag=65536,IS=1<<24,oi=ag*ag,Ig=oi*oi,cg=Ig/2,lg={},ug={},oe=(function(){function t(e,r,n){if(e===void 0&&(e=0),!(this instanceof t))return new t(e,r,n);typeof e=="bigint"?Object.assign(this,t.fromBigInt(e,!!r)):typeof e=="string"?Object.assign(this,t.fromString(e,!!r)):(this.low=e|0,this.high=r|0,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,r,n){return new t(e,r,n)},t.fromInt=function(e,r){var n,o,i;return r?(e>>>=0,(i=0<=e&&e<256)&&(o=ug[e],o)?o:(n=t.fromBits(e,(e|0)<0?-1:0,!0),i&&(ug[e]=n),n)):(e|=0,(i=-128<=e&&e<128)&&(o=lg[e],o)?o:(n=t.fromBits(e,e<0?-1:0,!1),i&&(lg[e]=n),n))},t.fromNumber=function(e,r){if(isNaN(e))return r?t.UZERO:t.ZERO;if(r){if(e<0)return t.UZERO;if(e>=Ig)return t.MAX_UNSIGNED_VALUE}else{if(e<=-cg)return t.MIN_VALUE;if(e+1>=cg)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%oi|0,e/oi|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t.ZERO;if(typeof r=="number"?(n=r,r=!1):r=!!r,n=n||10,n<2||36<n)throw RangeError("radix");var o;if((o=e.indexOf("-"))>0)throw Error("interior hyphen");if(o===0)return t.fromString(e.substring(1),r,n).neg();for(var i=t.fromNumber(Math.pow(n,8)),s=t.ZERO,a=0;a<e.length;a+=8){var l=Math.min(8,e.length-a),f=parseInt(e.substring(a,a+l),n);if(l<8){var m=t.fromNumber(Math.pow(n,l));s=s.mul(m).add(t.fromNumber(f))}else s=s.mul(i),s=s.add(t.fromNumber(f))}return s.unsigned=r,s},t.fromBytes=function(e,r,n){return n?t.fromBytesLE(e,r):t.fromBytesBE(e,r)},t.fromBytesLE=function(e,r){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)},t.fromBytesBE=function(e,r){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)},t.isLong=function(e){return ss(e)&&e.__isLong__===!0},t.fromValue=function(e,r){return typeof e=="number"?t.fromNumber(e,r):typeof e=="string"?t.fromString(e,r):t.fromBits(e.low,e.high,typeof r=="boolean"?r:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var r=this.high>>>16,n=this.high&65535,o=this.low>>>16,i=this.low&65535,s=e.high>>>16,a=e.high&65535,l=e.low>>>16,f=e.low&65535,m=0,d=0,_=0,y=0;return y+=i+f,_+=y>>>16,y&=65535,_+=o+l,d+=_>>>16,_&=65535,d+=n+a,m+=d>>>16,d&=65535,m+=r+s,m&=65535,t.fromBits(_<<16|y,m<<16|d,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(e){return this.compare(e)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(or){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?or.div_u:or.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,or.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,o,i;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;i=t.UZERO}else{if(this.eq(t.MIN_VALUE)){if(e.eq(t.ONE)||e.eq(t.NEG_ONE))return t.MIN_VALUE;if(e.eq(t.MIN_VALUE))return t.ONE;var s=this.shr(1);return n=s.div(e).shl(1),n.eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(o=this.sub(e.mul(n)),i=n.add(o.div(e)),i)}else if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();i=t.ZERO}for(o=this;o.gte(e);){n=Math.max(1,Math.floor(o.toNumber()/e.toNumber()));for(var a=Math.ceil(Math.log(n)/Math.LN2),l=a<=48?1:Math.pow(2,a-48),f=t.fromNumber(n),m=f.mul(e);m.isNegative()||m.gt(o);)n-=l,f=t.fromNumber(n,this.unsigned),m=f.mul(e);f.isZero()&&(f=t.ONE),i=i.add(f),o=o.sub(m)}return i},t.prototype.div=function(e){return this.divide(e)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},t.prototype.eq=function(e){return this.equals(e)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(e&1<<r)===0;r--);return this.high!==0?r+33:r+1},t.prototype.greaterThan=function(e){return this.comp(e)>0},t.prototype.gt=function(e){return this.greaterThan(e)},t.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},t.prototype.gte=function(e){return this.greaterThanOrEqual(e)},t.prototype.ge=function(e){return this.greaterThanOrEqual(e)},t.prototype.isEven=function(){return(this.low&1)===0},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return(this.low&1)===1},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return this.high===0&&this.low===0},t.prototype.lessThan=function(e){return this.comp(e)<0},t.prototype.lt=function(e){return this.lessThan(e)},t.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},t.prototype.lte=function(e){return this.lessThanOrEqual(e)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),or){var r=(this.unsigned?or.rem_u:or.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,or.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(e){return this.modulo(e)},t.prototype.rem=function(e){return this.modulo(e)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),or){var r=or.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,or.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,o=this.high&65535,i=this.low>>>16,s=this.low&65535,a=e.high>>>16,l=e.high&65535,f=e.low>>>16,m=e.low&65535,d=0,_=0,y=0,C=0;return C+=s*m,y+=C>>>16,C&=65535,y+=i*m,_+=y>>>16,y&=65535,y+=s*f,_+=y>>>16,y&=65535,_+=o*m,d+=_>>>16,_&=65535,_+=i*f,d+=_>>>16,_&=65535,_+=s*l,d+=_>>>16,_&=65535,d+=n*m+o*f+i*l+s*a,d&=65535,t.fromBits(y<<16|C,d<<16|_,this.unsigned)},t.prototype.mul=function(e){return this.multiply(e)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(e){return!this.equals(e)},t.prototype.neq=function(e){return this.notEquals(e)},t.prototype.ne=function(e){return this.notEquals(e)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(e){return this.shiftLeft(e)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(e){return this.shiftRight(e)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),e&=63,e===0)return this;var r=this.high;if(e<32){var n=this.low;return t.fromBits(n>>>e|r<<32-e,r>>>e,this.unsigned)}else return e===32?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},t.prototype.shru=function(e){return this.shiftRightUnsigned(e)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(e){return this.subtract(e)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*oi+(this.low>>>0):this.high*oi+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},t.prototype.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(t.MIN_VALUE)){var r=t.fromNumber(e),n=this.div(r),o=n.mul(r).sub(this);return n.toString(e)+o.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var i=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,a="";;){var l=s.div(i),f=s.sub(l.mul(i)).toInt()>>>0,m=f.toString(e);if(s=l,s.isZero())return m+a;for(;m.length<6;)m="0"+m;a=""+m+a}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(e){return this.lessThanOrEqual(e)},t.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,r){var n=t.fromString(e.$numberLong);return r&&r.relaxed?n.toNumber():n},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},t.TWO_PWR_24=t.fromInt(IS),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t})();Object.defineProperty(oe.prototype,"__isLong__",{value:!0});Object.defineProperty(oe.prototype,"_bsontype",{value:"Long"});var xS=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,CS=/^(\+|-)?(Infinity|inf)$/i,RS=/^(\+|-)?NaN$/i,ns=6111,zf=-6176,fg=6176,AS=34,Yf=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),pg=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),mg=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),DS=/^([-+])?(\d+)?$/,OS=31,dg=16383,NS=30,PS=31;function hg(t){return!isNaN(parseInt(t,10))}function LS(t){var e=oe.fromNumber(1e9),r=oe.fromNumber(0);if(!t.parts[0]&&!t.parts[1]&&!t.parts[2]&&!t.parts[3])return{quotient:t,rem:r};for(var n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new oe(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function MS(t,e){if(!t&&!e)return{high:oe.fromNumber(0),low:oe.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new oe(t.getLowBits(),0),o=e.shiftRightUnsigned(32),i=new oe(e.getLowBits(),0),s=r.multiply(o),a=r.multiply(i),l=n.multiply(o),f=n.multiply(i);return s=s.add(a.shiftRightUnsigned(32)),a=new oe(a.getLowBits(),0).add(l).add(f.shiftRightUnsigned(32)),s=s.add(a.shiftRightUnsigned(32)),f=a.shiftLeft(32).add(new oe(f.getLowBits(),0)),{high:s,low:f}}function BS(t,e){var r=t.high>>>0,n=e.high>>>0;if(r<n)return!0;if(r===n){var o=t.low>>>0,i=e.low>>>0;if(o<i)return!0}return!1}function ni(t,e){throw new Xe('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var Zf=(function(){function t(e){if(!(this instanceof t))return new t(e);if(typeof e=="string")this.bytes=t.fromString(e).bytes;else if(Qf(e)){if(e.byteLength!==16)throw new Xe("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new Xe("Decimal128 must take a Buffer or string")}return t.fromString=function(e){var r=!1,n=!1,o=!1,i=0,s=0,a=0,l=0,f=0,m=[0],d=0,_=0,y=0,C=0,N=0,A=0,B=new oe(0,0),q=new oe(0,0),P=0,Q=0;if(e.length>=7e3)throw new Xe(""+e+" not a valid Decimal128 string");var Ee=e.match(xS),X=e.match(CS),ce=e.match(RS);if(!Ee&&!X&&!ce||e.length===0)throw new Xe(""+e+" not a valid Decimal128 string");if(Ee){var se=Ee[2],de=Ee[4],Le=Ee[5],Se=Ee[6];de&&Se===void 0&&ni(e,"missing exponent power"),de&&se===void 0&&ni(e,"missing exponent base"),de===void 0&&(Le||Se)&&ni(e,"missing e before exponent")}if((e[Q]==="+"||e[Q]==="-")&&(r=e[Q++]==="-"),!hg(e[Q])&&e[Q]!=="."){if(e[Q]==="i"||e[Q]==="I")return new t(Ie.from(r?pg:mg));if(e[Q]==="N")return new t(Ie.from(Yf))}for(;hg(e[Q])||e[Q]===".";){if(e[Q]==="."){n&&ni(e,"contains multiple periods"),n=!0,Q=Q+1;continue}d<34&&(e[Q]!=="0"||o)&&(o||(f=s),o=!0,m[_++]=parseInt(e[Q],10),d=d+1),o&&(a=a+1),n&&(l=l+1),s=s+1,Q=Q+1}if(n&&!s)throw new Xe(""+e+" not a valid Decimal128 string");if(e[Q]==="e"||e[Q]==="E"){var Re=e.substr(++Q).match(DS);if(!Re||!Re[2])return new t(Ie.from(Yf));N=parseInt(Re[0],10),Q=Q+Re[0].length}if(e[Q])return new t(Ie.from(Yf));if(y=0,!d)y=0,C=0,m[0]=0,a=1,d=1,i=0;else if(C=d-1,i=a,i!==1)for(;m[f+i-1]===0;)i=i-1;for(N<=l&&l-N>16384?N=zf:N=N-l;N>ns;){if(C=C+1,C-y>AS){var Ge=m.join("");if(Ge.match(/^0+$/)){N=ns;break}ni(e,"overflow")}N=N-1}for(;N<zf||d<a;){if(C===0&&i<d){N=zf,i=0;break}if(d<a?a=a-1:C=C-1,N<ns)N=N+1;else{var Ge=m.join("");if(Ge.match(/^0+$/)){N=ns;break}ni(e,"overflow")}}if(C-y+1<i){var Je=s;n&&(f=f+1,Je=Je+1),r&&(f=f+1,Je=Je+1);var Bt=parseInt(e[f+C+1],10),D=0;if(Bt>=5&&(D=1,Bt===5)){for(D=m[C]%2===1?1:0,A=f+C+2;A<Je;A++)if(parseInt(e[A],10)){D=1;break}}if(D){for(var R=C;R>=0;R--)if(++m[R]>9&&(m[R]=0,R===0))if(N<ns)N=N+1,m[R]=1;else return new t(Ie.from(r?pg:mg))}}if(B=oe.fromNumber(0),q=oe.fromNumber(0),i===0)B=oe.fromNumber(0),q=oe.fromNumber(0);else if(C-y<17){var R=y;for(q=oe.fromNumber(m[R++]),B=new oe(0,0);R<=C;R++)q=q.multiply(oe.fromNumber(10)),q=q.add(oe.fromNumber(m[R]))}else{var R=y;for(B=oe.fromNumber(m[R++]);R<=C-17;R++)B=B.multiply(oe.fromNumber(10)),B=B.add(oe.fromNumber(m[R]));for(q=oe.fromNumber(m[R++]);R<=C;R++)q=q.multiply(oe.fromNumber(10)),q=q.add(oe.fromNumber(m[R]))}var V=MS(B,oe.fromString("100000000000000000"));V.low=V.low.add(q),BS(V.low,q)&&(V.high=V.high.add(oe.fromNumber(1))),P=N+fg;var k={low:oe.fromNumber(0),high:oe.fromNumber(0)};V.high.shiftRightUnsigned(49).and(oe.fromNumber(1)).equals(oe.fromNumber(1))?(k.high=k.high.or(oe.fromNumber(3).shiftLeft(61)),k.high=k.high.or(oe.fromNumber(P).and(oe.fromNumber(16383).shiftLeft(47))),k.high=k.high.or(V.high.and(oe.fromNumber(0x7fffffffffff)))):(k.high=k.high.or(oe.fromNumber(P&16383).shiftLeft(49)),k.high=k.high.or(V.high.and(oe.fromNumber(562949953421311)))),k.low=V.low,r&&(k.high=k.high.or(oe.fromString("9223372036854775808")));var H=Ie.alloc(16);return Q=0,H[Q++]=k.low.low&255,H[Q++]=k.low.low>>8&255,H[Q++]=k.low.low>>16&255,H[Q++]=k.low.low>>24&255,H[Q++]=k.low.high&255,H[Q++]=k.low.high>>8&255,H[Q++]=k.low.high>>16&255,H[Q++]=k.low.high>>24&255,H[Q++]=k.high.low&255,H[Q++]=k.high.low>>8&255,H[Q++]=k.high.low>>16&255,H[Q++]=k.high.low>>24&255,H[Q++]=k.high.high&255,H[Q++]=k.high.high>>8&255,H[Q++]=k.high.high>>16&255,H[Q++]=k.high.high>>24&255,new t(H)},t.prototype.toString=function(){for(var e,r=0,n=new Array(36),o=0;o<n.length;o++)n[o]=0;var i=0,s=!1,a,l={parts:[0,0,0,0]},f,m,d=[];i=0;var _=this.bytes,y=_[i++]|_[i++]<<8|_[i++]<<16|_[i++]<<24,C=_[i++]|_[i++]<<8|_[i++]<<16|_[i++]<<24,N=_[i++]|_[i++]<<8|_[i++]<<16|_[i++]<<24,A=_[i++]|_[i++]<<8|_[i++]<<16|_[i++]<<24;i=0;var B={low:new oe(y,C),high:new oe(N,A)};B.high.lessThan(oe.ZERO)&&d.push("-");var q=A>>26&OS;if(q>>3===3){if(q===NS)return d.join("")+"Infinity";if(q===PS)return"NaN";e=A>>15&dg,a=8+(A>>14&1)}else a=A>>14&7,e=A>>17&dg;var P=e-fg;if(l.parts[0]=(A&16383)+((a&15)<<14),l.parts[1]=N,l.parts[2]=C,l.parts[3]=y,l.parts[0]===0&&l.parts[1]===0&&l.parts[2]===0&&l.parts[3]===0)s=!0;else for(m=3;m>=0;m--){var Q=0,Ee=LS(l);if(l=Ee.quotient,Q=Ee.rem.low,!!Q)for(f=8;f>=0;f--)n[m*9+f]=Q%10,Q=Math.floor(Q/10)}if(s)r=1,n[i]=0;else for(r=36;!n[i];)r=r-1,i=i+1;var X=r-1+P;if(X>=34||X<=-7||P>0){if(r>34)return d.push("".concat(0)),P>0?d.push("E+".concat(P)):P<0&&d.push("E".concat(P)),d.join("");d.push("".concat(n[i++])),r=r-1,r&&d.push(".");for(var o=0;o<r;o++)d.push("".concat(n[i++]));d.push("E"),X>0?d.push("+".concat(X)):d.push("".concat(X))}else if(P>=0)for(var o=0;o<r;o++)d.push("".concat(n[i++]));else{var ce=r+P;if(ce>0)for(var o=0;o<ce;o++)d.push("".concat(n[i++]));else d.push("0");for(d.push(".");ce++<0;)d.push("0");for(var o=0;o<r-Math.max(ce-1,0);o++)d.push("".concat(n[i++]))}return d.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t})();Object.defineProperty(Zf.prototype,"_bsontype",{value:"Decimal128"});var xc=(function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},t.fromExtendedJSON=function(e,r){var n=parseFloat(e.$numberDouble);return r&&r.relaxed?n:new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},t})();Object.defineProperty(xc.prototype,"_bsontype",{value:"Double"});var Cc=(function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e|0}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,r){return r&&r.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},t})();Object.defineProperty(Cc.prototype,"_bsontype",{value:"Int32"});var ep=(function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$maxKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MaxKey()"},t})();Object.defineProperty(ep.prototype,"_bsontype",{value:"MaxKey"});var tp=(function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$minKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MinKey()"},t})();Object.defineProperty(tp.prototype,"_bsontype",{value:"MinKey"});var US=new RegExp("^[0-9a-fA-F]{24}$"),no=null,Ur=Symbol("id"),gt=(function(){function t(e){if(!(this instanceof t))return new t(e);var r;if(typeof e=="object"&&e&&"id"in e){if(typeof e.id!="string"&&!ArrayBuffer.isView(e.id))throw new Xe("Argument passed in must have an id that is of type string or Buffer");"toHexString"in e&&typeof e.toHexString=="function"?r=Ie.from(e.toHexString(),"hex"):r=e.id}else r=e;if(r==null||typeof r=="number")this[Ur]=t.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[Ur]=r instanceof Ie?r:bc(r);else if(typeof r=="string")if(r.length===12){var n=Ie.from(r);if(n.byteLength===12)this[Ur]=n;else throw new Xe("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&US.test(r))this[Ur]=Ie.from(r,"hex");else throw new Xe("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new Xe("Argument passed in does not match the accepted types");t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[Ur]},set:function(e){this[Ur]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){typeof e!="number"&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=Ie.alloc(12);return n.writeUInt32BE(e,0),no===null&&(no=wg(5)),n[4]=no[0],n[5]=no[1],n[6]=no[2],n[7]=no[3],n[8]=no[4],n[11]=r&255,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(e==null)return!1;if(e instanceof t)return this[Ur][11]===e[Ur][11]&&this[Ur].equals(e[Ur]);if(typeof e=="string"&&t.isValid(e)&&e.length===12&&Qf(this.id))return e===Ie.prototype.toString.call(this.id,"latin1");if(typeof e=="string"&&t.isValid(e)&&e.length===24)return e.toLowerCase()===this.toHexString();if(typeof e=="string"&&t.isValid(e)&&e.length===12)return Ie.from(e).equals(this.id);if(typeof e=="object"&&"toHexString"in e&&typeof e.toHexString=="function"){var r=e.toHexString(),n=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===n}return!1},t.prototype.getTimestamp=function(){var e=new Date,r=this.id.readUInt32BE(0);return e.setTime(Math.floor(r)*1e3),e},t.createPk=function(){return new t},t.createFromTime=function(e){var r=Ie.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(e,0),new t(r)},t.createFromHexString=function(e){if(typeof e>"u"||e!=null&&e.length!==24)throw new Xe("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(Ie.from(e,"hex"))},t.isValid=function(e){if(e==null)return!1;try{return new t(e),!0}catch{return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},t.index=Math.floor(Math.random()*16777215),t})();Object.defineProperty(gt.prototype,"generate",{value:Tc(function(t){return gt.generate(t)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(gt.prototype,"getInc",{value:Tc(function(){return gt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(gt.prototype,"get_inc",{value:Tc(function(){return gt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(gt,"get_inc",{value:Tc(function(){return gt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(gt.prototype,"_bsontype",{value:"ObjectID"});function kS(t){return t.split("").sort().join("")}var is=(function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=kS(r??""),this.pattern.indexOf("\0")!==-1)throw new oo("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new oo("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if(!(this.options[n]==="i"||this.options[n]==="m"||this.options[n]==="x"||this.options[n]==="l"||this.options[n]==="s"||this.options[n]==="u"))throw new oo("The regular expression option [".concat(this.options[n],"] is not supported"))}return t.parseOptions=function(e){return e?e.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(e){return e=e||{},e.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e)if(typeof e.$regex!="string"){if(e.$regex._bsontype==="BSONRegExp")return e}else return new t(e.$regex,t.parseOptions(e.$options));if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new Xe("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t})();Object.defineProperty(is.prototype,"_bsontype",{value:"BSONRegExp"});var rp=(function(){function t(e){if(!(this instanceof t))return new t(e);this.value=e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(){return this.value},t.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(){return{$symbol:this.value}},t.fromExtendedJSON=function(e){return new t(e.$symbol)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t})();Object.defineProperty(rp.prototype,"_bsontype",{value:"Symbol"});var FS=oe,xg=(function(t){Sc(e,t);function e(r,n){var o=this;return o instanceof e?(oe.isLong(r)?o=t.call(this,r.low,r.high,!0)||this:ss(r)&&typeof r.t<"u"&&typeof r.i<"u"?o=t.call(this,r.i,r.t,!0)||this:o=t.call(this,r,n,!0)||this,Object.defineProperty(o,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),o):new e(r,n)}return e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(r){return new e(oe.fromInt(r,!0))},e.fromNumber=function(r){return new e(oe.fromNumber(r,!0))},e.fromBits=function(r,n){return new e(r,n)},e.fromString=function(r,n){return new e(oe.fromString(r,!0,n))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(r){return new e(r.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},e.MAX_VALUE=oe.MAX_UNSIGNED_VALUE,e})(FS);function HS(t){return ss(t)&&Reflect.has(t,"_bsontype")&&typeof t._bsontype=="string"}var Cg=2147483647,Rg=-2147483648,Ag=9223372036854776e3,Dg=-9223372036854776e3,$S={$oid:gt,$binary:io,$uuid:io,$symbol:rp,$numberInt:Cc,$numberDecimal:Zf,$numberDouble:xc,$numberLong:oe,$minKey:tp,$maxKey:ep,$regex:is,$regularExpression:is,$timestamp:xg};function Og(t,e){if(e===void 0&&(e={}),typeof t=="number"){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=Rg&&t<=Cg)return new Cc(t);if(t>=Dg&&t<=Ag)return oe.fromNumber(t)}return new xc(t)}if(t==null||typeof t!="object")return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter(function(d){return d.startsWith("$")&&t[d]!=null}),n=0;n<r.length;n++){var o=$S[r[n]];if(o)return o.fromExtendedJSON(t,e)}if(t.$date!=null){var i=t.$date,s=new Date;return e.legacy?typeof i=="number"?s.setTime(i):typeof i=="string"&&s.setTime(Date.parse(i)):typeof i=="string"?s.setTime(Date.parse(i)):oe.isLong(i)?s.setTime(i.toNumber()):typeof i=="number"&&e.relaxed&&s.setTime(i),s}if(t.$code!=null){var a=Object.assign({},t);return t.$scope&&(a.$scope=Og(t.$scope)),Ic.fromExtendedJSON(t)}if(TS(t)||t.$dbPointer){var l=t.$ref?t:t.$dbPointer;if(l instanceof os)return l;var f=Object.keys(l).filter(function(d){return d.startsWith("$")}),m=!0;if(f.forEach(function(d){["$ref","$id","$db"].indexOf(d)===-1&&(m=!1)}),m)return os.fromExtendedJSON(l)}return t}function VS(t,e){return t.map(function(r,n){e.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Rn(r,e)}finally{e.seenObjects.pop()}})}function gg(t){var e=t.toISOString();return t.getUTCMilliseconds()!==0?e:e.slice(0,-5)+"Z"}function Rn(t,e){if((typeof t=="object"||typeof t=="function")&&t!==null){var r=e.seenObjects.findIndex(function(B){return B.obj===t});if(r!==-1){var n=e.seenObjects.map(function(B){return B.propertyName}),o=n.slice(0,r).map(function(B){return"".concat(B," -> ")}).join(""),i=n[r],s=" -> "+n.slice(r+1,n.length-1).map(function(B){return"".concat(B," -> ")}).join(""),a=n[n.length-1],l=" ".repeat(o.length+i.length/2),f="-".repeat(s.length+(i.length+a.length)/2-1);throw new Xe(`Converting circular structure to EJSON:
|
|
25
25
|
`+" ".concat(o).concat(i).concat(s).concat(a,`
|
|
26
|
-
`)+" ".concat(l,"\\").concat(f,"/"))}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return VS(t,e);if(t===void 0)return null;if(t instanceof Date||_S(t)){var m=t.getTime(),d=m>-1&&m<2534023188e5;return e.legacy?e.relaxed&&d?{$date:t.getTime()}:{$date:gg(t)}:e.relaxed&&d?{$date:gg(t)}:{$date:{$numberLong:t.getTime().toString()}}}if(typeof t=="number"&&(!e.relaxed||!isFinite(t))){if(Math.floor(t)===t){var _=t>=Rg&&t<=Cg,y=t>=Dg&&t<=Ag;if(_)return{$numberInt:t.toString()};if(y)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||ES(t)){var C=t.flags;if(C===void 0){var N=t.toString().match(/[gimuy]*$/);N&&(C=N[0])}var A=new is(t.source,C);return A.toExtendedJSON(e)}return t!=null&&typeof t=="object"?jS(t,e):t}var WS={Binary:function(t){return new io(t.value(),t.sub_type)},Code:function(t){return new Ic(t.code,t.scope)},DBRef:function(t){return new os(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new Zf(t.bytes)},Double:function(t){return new xc(t.value)},Int32:function(t){return new Cc(t.value)},Long:function(t){return oe.fromBits(t.low!=null?t.low:t.low_,t.low!=null?t.high:t.high_,t.low!=null?t.unsigned:t.unsigned_)},MaxKey:function(){return new ep},MinKey:function(){return new tp},ObjectID:function(t){return new gt(t)},ObjectId:function(t){return new gt(t)},BSONRegExp:function(t){return new is(t.pattern,t.options)},Symbol:function(t){return new rp(t.value)},Timestamp:function(t){return xg.fromBits(t.low,t.high)}};function jS(t,e){if(t==null||typeof t!="object")throw new oo("not an object instance");var r=t._bsontype;if(typeof r>"u"){var n={};for(var o in t){e.seenObjects.push({propertyName:o,obj:null});try{var i=Rn(t[o],e);o==="__proto__"?Object.defineProperty(n,o,{value:i,writable:!0,enumerable:!0,configurable:!0}):n[o]=i}finally{e.seenObjects.pop()}}return n}else if(HS(t)){var s=t;if(typeof s.toExtendedJSON!="function"){var a=WS[t._bsontype];if(!a)throw new Xe("Unrecognized or invalid _bsontype: "+t._bsontype);s=a(s)}return r==="Code"&&s.scope?s=new Ic(s.code,Rn(s.scope,e)):r==="DBRef"&&s.oid&&(s=new os(Rn(s.collection,e),Rn(s.oid,e),Rn(s.db,e),Rn(s.fields,e))),s.toExtendedJSON(e)}else throw new oo("_bsontype must be a string, but was: "+typeof r)}var yg;(function(t){function e(i,s){var a=Object.assign({},{relaxed:!0,legacy:!1},s);return typeof a.relaxed=="boolean"&&(a.strict=!a.relaxed),typeof a.strict=="boolean"&&(a.relaxed=!a.strict),JSON.parse(i,function(l,f){if(l.indexOf("\0")!==-1)throw new oo("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(l)));return Og(f,a)})}t.parse=e;function r(i,s,a,l){a!=null&&typeof a=="object"&&(l=a,a=0),s!=null&&typeof s=="object"&&!Array.isArray(s)&&(l=s,s=void 0,a=0);var f=Object.assign({relaxed:!0,legacy:!1},l,{seenObjects:[{propertyName:"(root)",obj:null}]}),m=Rn(i,f);return JSON.stringify(m,s,a)}t.stringify=r;function n(i,s){return s=s||{},JSON.parse(r(i,s))}t.serialize=n;function o(i,s){return s=s||{},e(JSON.stringify(i),s)}t.deserialize=o})(yg||(yg={}));var vg,Eg=wg();Eg.Map?vg=Eg.Map:vg=(function(){function t(e){e===void 0&&(e=[]),this._keys=[],this._values={};for(var r=0;r<e.length;r++)if(e[r]!=null){var n=e[r],o=n[0],i=n[1];this._keys.push(o),this._values[o]={v:i,i:this._keys.length-1}}}return t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(e){var r=this._values[e];return r==null?!1:(delete this._values[e],this._keys.splice(r.i,1),!0)},t.prototype.entries=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?[n,e._values[n].v]:void 0,done:n===void 0}}}},t.prototype.forEach=function(e,r){r=r||this;for(var n=0;n<this._keys.length;n++){var o=this._keys[n];e.call(r,this._values[o].v,o,r)}},t.prototype.get=function(e){return this._values[e]?this._values[e].v:void 0},t.prototype.has=function(e){return this._values[e]!=null},t.prototype.keys=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?n:void 0,done:n===void 0}}}},t.prototype.set=function(e,r){return this._values[e]?(this._values[e].v=r,this):(this._keys.push(e),this._values[e]={v:r,i:this._keys.length-1},this)},t.prototype.values=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?e._values[n].v:void 0,done:n===void 0}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),t})();var tk=oe.fromNumber(bS),rk=oe.fromNumber(SS);var Kf=new Uint8Array(8),nk=new DataView(Kf.buffer,Kf.byteOffset,Kf.byteLength);var GS=1024*1024*17,ok=Ie.alloc(GS);var An=class{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;constructor(e){e=e||{},this.triggerID=e.id||e.triggerID,this.nudgeID=e.nudgeID,this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.contentID=e.contentID,this.variation=e.variation,this.props=e.props,this.objective=e.objective,this.onsiteDeliveryType=e.onsiteDeliveryType,this.holdout=e.holdout}};var xe=class{constructor(e,r={},n,o){this.name=e;this.properties=r;this.id=o?new gt(o):new gt,this.occurred=new Date,n&&(this.trigger=new An(n)),this.newEvent=!o}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale;setVideos(e){e&&(this.videos=[e.id])}};var Ng=0;function Pg(t,e){if(!t)return;let r=document.createElement("script");r.id=e??"",r.src=t,r.type="module",document.head.appendChild(r)}function np(t=document.head){return Lg(dr.styleURL,t,"cooee-global-styles")}function qS(t=document.head){return Lg(dr.swiperStyleURL,t,"cooee-swiper-styles")}function Lg(t,e=document.head,r){return new Promise(n=>{if(e.querySelector(`#${r}`)){n();return}let i=document.createElement("link");i.rel="stylesheet",i.href=t,i.id=r,i.onload=()=>{n()},i.onerror=()=>{console.error("Failed to load stylesheet:",t),n()},e.appendChild(i)})}function sn(t,e=document.head){if(!t)return;Ng++;let r=document.createElement("style");r.id=`cooee-app-css-${Ng}`,r.textContent=t,e.appendChild(r)}function Mg(t){if(!t)return;let e=document.createElement("script");e.id="cooee-app-script",e.innerHTML=t,document.head.appendChild(e)}function op(t){if(t)try{(0,eval)(t)}catch(e){console.error("Failed to execute script:",e)}}async function Rc(){let t=(await import("./swiper-bundle-WHJS64TU.js")).default;return window.CooeeSDK.Swiper=t}async function ip(t,e=!0){if(!t)return;let r=[];e&&r.push(qS(t)),r.push(np(t)),await Promise.all(r);let n=ze.get().website.commonCSS;sn(n,t)}var Ac=class{lastWidth;lastHeight;resizeTimeout=null;debounceDelay=200;onResizeCallback;constructor(e){this.onResizeCallback=e,this.lastWidth=window.innerWidth,this.lastHeight=window.innerHeight,window.addEventListener("resize",this.debouncedResize),window.addEventListener("orientationchange",this.handleImmediateResize)}destroy(){window.removeEventListener("resize",this.debouncedResize),window.removeEventListener("orientationchange",this.handleImmediateResize)}handleImmediateResize=()=>{this.triggerResize()};debouncedResize=()=>{this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.triggerResize()},this.debounceDelay)};triggerResize(){let e=window.innerWidth,r=window.innerHeight;(r!==this.lastHeight||e!==this.lastWidth)&&(this.onResizeCallback(),this.lastWidth=e,this.lastHeight=r)}};var zS=" daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\bperl\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/",YS=/bot|crawl|http|lighthouse|scan|search|spider/i,as;function KS(){if(as instanceof RegExp)return as;try{as=new RegExp(zS,"i")}catch{as=YS}return as}function Bg(t){return!!t&&KS().test(t)}var XS="2.0.4",yp=500,Ug="user-agent",li="",kg="?",Mc="function",Nn="undefined",ui="object",vp="string",kt="browser",an="cpu",$r="device",_r="engine",sr="os",ai="result",$="name",L="type",F="vendor",j="version",Ft="architecture",ys="major",U="model",hs="console",le="mobile",Be="tablet",nt="smarttv",Fr="wearable",Dc="xr",gs="embedded",cs="inapp",wp="brands",ao="formFactors",bp="fullVersionList",ci="platform",Sp="platformVersion",kc="bitness",Pn="sec-ch-ua",JS=Pn+"-full-version-list",QS=Pn+"-arch",ZS=Pn+"-"+kc,e0=Pn+"-form-factors",t0=Pn+"-"+le,r0=Pn+"-"+U,Qg=Pn+"-"+ci,n0=Qg+"-version",Zg=[wp,bp,le,U,ci,Sp,Ft,ao,kc],Oc="Amazon",ii="Apple",Fg="ASUS",Hg="BlackBerry",so="Google",$g="Huawei",sp="Lenovo",Vg="Honor",Nc="LG",ap="Microsoft",cp="Motorola",lp="Nvidia",Wg="OnePlus",up="OPPO",ls="Samsung",jg="Sharp",us="Sony",fp="Xiaomi",pp="Zebra",Gg="Chrome",qg="Chromium",Dn="Chromecast",Lc="Edge",fs="Firefox",ps="Opera",mp="Facebook",zg="Sogou",si="Mobile ",ms=" Browser",Ep="Windows",o0=typeof window!==Nn,Ht=o0&&window.navigator?window.navigator:void 0,On=Ht&&Ht.userAgentData?Ht.userAgentData:void 0,i0=function(t,e){var r={},n=e;if(!Bc(e)){n={};for(var o in e)for(var i in e[o])n[i]=e[o][i].concat(n[i]?n[i]:[])}for(var s in t)r[s]=n[s]&&n[s].length%2===0?n[s].concat(t[s]):t[s];return r},Fc=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},_p=function(t,e){if(typeof t===ui&&t.length>0){for(var r in t)if(cn(e)==cn(t[r]))return!0;return!1}return pi(t)?cn(e)==cn(t):!1},Bc=function(t,e){for(var r in t)return/^(browser|cpu|device|engine|os)$/.test(r)||(e?Bc(t[r]):!1)},pi=function(t){return typeof t===vp},dp=function(t){if(t){for(var e=[],r=fi(/\\?\"/g,t).split(","),n=0;n<r.length;n++)if(r[n].indexOf(";")>-1){var o=Uc(r[n]).split(";v=");e[n]={brand:o[0],version:o[1]}}else e[n]=Uc(r[n]);return e}},cn=function(t){return pi(t)?t.toLowerCase():t},hp=function(t){return pi(t)?fi(/[^\d\.]/g,t).split(".")[0]:void 0},ln=function(t){for(var e in t){var r=t[e];typeof r==ui&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this},fi=function(t,e){return pi(e)?e.replace(t,li):e},ds=function(t){return fi(/\\?\"/g,t)},Uc=function(t,e){if(pi(t))return t=fi(/^\s\s*/,t),typeof e===Nn?t:t.substring(0,yp)},gp=function(t,e){if(!(!t||!e))for(var r=0,n,o,i,s,a,l;r<e.length&&!a;){var f=e[r],m=e[r+1];for(n=o=0;n<f.length&&!a&&f[n];)if(a=f[n++].exec(t),a)for(i=0;i<m.length;i++)l=a[++o],s=m[i],typeof s===ui&&s.length>0?s.length===2?typeof s[1]==Mc?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===Mc&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=l?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=l?s[1].call(this,l,s[2]):void 0:s.length==3?this[s[0]]=l?l.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=l?s[3].apply(this,[l.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=l||void 0;r+=2}},Hr=function(t,e){for(var r in e)if(typeof e[r]===ui&&e[r].length>0){for(var n=0;n<e[r].length;n++)if(_p(e[r][n],t))return r===kg?void 0:r}else if(_p(e[r],t))return r===kg?void 0:r;return e.hasOwnProperty("*")?e["*"]:t},Yg={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Kg={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},s0={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Xg={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[j,[$,si+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[j,[$,Lc+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[j,[$,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[$,j],[/opios[\/ ]+([\w\.]+)/i],[j,[$,ps+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[j,[$,ps+" GX"]],[/\bopr\/([\w\.]+)/i],[j,[$,ps]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[j,[$,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[j,[$,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[$,j],[/quark(?:pc)?\/([-\w\.]+)/i],[j,[$,"Quark"]],[/\bddg\/([\w\.]+)/i],[j,[$,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[j,[$,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[j,[$,"WeChat"]],[/konqueror\/([\w\.]+)/i],[j,[$,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[j,[$,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[j,[$,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[j,[$,"Smart "+sp+ms]],[/(avast|avg)\/([\w\.]+)/i],[[$,/(.+)/,"$1 Secure"+ms],j],[/\bfocus\/([\w\.]+)/i],[j,[$,fs+" Focus"]],[/\bopt\/([\w\.]+)/i],[j,[$,ps+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[j,[$,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[j,[$,"Dolphin"]],[/coast\/([\w\.]+)/i],[j,[$,ps+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[j,[$,"MIUI"+ms]],[/fxios\/([\w\.-]+)/i],[j,[$,si+fs]],[/\bqihoobrowser\/?([\w\.]*)/i],[j,[$,"360"]],[/\b(qq)\/([\w\.]+)/i],[[$,/(.+)/,"$1Browser"],j],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[$,/(.+)/,"$1"+ms],j],[/samsungbrowser\/([\w\.]+)/i],[j,[$,ls+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[j,[$,zg+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[$,zg+" Mobile"],j],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[$,j],[/(lbbrowser|rekonq)/i],[$],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[j,$],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[$,mp],j,[L,cs]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[$,j,[L,cs]],[/\bgsa\/([\w\.]+) .*safari\//i],[j,[$,"GSA"],[L,cs]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[j,[$,"TikTok"],[L,cs]],[/\[(linkedin)app\]/i],[$,[L,cs]],[/(chromium)[\/ ]([-\w\.]+)/i],[$,j],[/headlesschrome(?:\/([\w\.]+)| )/i],[j,[$,Gg+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[j,[$,Lc+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[$,Gg+" WebView"],j],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[j,[$,"Android"+ms]],[/chrome\/([\w\.]+) mobile/i],[j,[$,si+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[$,j],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[j,[$,si+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[$,si+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[j,$],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[$,[j,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[$,j],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[$,si+fs],j],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[$,"Netscape"],j],[/(wolvic|librewolf)\/([\w\.]+)/i],[$,j],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[j,[$,fs+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[$,[j,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[$,[j,/[^\d\.]+./,li]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[Ft,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[Ft,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[Ft,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[Ft,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[Ft,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[Ft,/ower/,li,cn]],[/ sun4\w[;\)]/i],[[Ft,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[Ft,cn]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[U,[F,ls],[L,Be]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[U,[F,ls],[L,le]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[U,[F,ii],[L,le]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[U,[F,ii],[L,Be]],[/(macintosh);/i],[U,[F,ii]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[U,[F,jg],[L,le]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[U,[F,Vg],[L,Be]],[/honor([-\w ]+)[;\)]/i],[U,[F,Vg],[L,le]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[U,[F,$g],[L,Be]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[U,[F,$g],[L,le]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[U,/_/g," "],[F,fp],[L,Be]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[U,/_/g," "],[F,fp],[L,le]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[U,[F,Wg],[L,le]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[U,[F,up],[L,le]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[U,[F,Hr,{OnePlus:["203","304","403","404","413","415"],"*":up}],[L,Be]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[U,[F,"BLU"],[L,le]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[U,[F,"Vivo"],[L,le]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[U,[F,"Realme"],[L,le]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[U,[F,sp],[L,Be]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[U,[F,sp],[L,le]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[U,[F,cp],[L,le]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[U,[F,cp],[L,Be]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[U,[F,Nc],[L,Be]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[U,[F,Nc],[L,le]],[/(nokia) (t[12][01])/i],[F,U,[L,Be]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[U,/_/g," "],[L,le],[F,"Nokia"]],[/(pixel (c|tablet))\b/i],[U,[F,so],[L,Be]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[U,[F,so],[L,le]],[/(google) (pixelbook( go)?)/i],[F,U],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[U,[F,us],[L,le]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[U,"Xperia Tablet"],[F,us],[L,Be]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[U,[F,Oc],[L,Be]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[U,/(.+)/g,"Fire Phone $1"],[F,Oc],[L,le]],[/(playbook);[-\w\),; ]+(rim)/i],[U,F,[L,Be]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[U,[F,Hg],[L,le]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[U,[F,Fg],[L,Be]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[U,[F,Fg],[L,le]],[/(nexus 9)/i],[U,[F,"HTC"],[L,Be]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[F,[U,/_/g," "],[L,le]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[U,[F,"TCL"],[L,Be]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[U,[F,"TCL"],[L,le]],[/(itel) ((\w+))/i],[[F,cn],U,[L,Hr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[U,[F,"Acer"],[L,Be]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[U,[F,"Meizu"],[L,le]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[U,[F,"Ulefone"],[L,le]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[U,[F,"Energizer"],[L,le]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[U,[F,"Cat"],[L,le]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[U,[F,"Smartfren"],[L,le]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[U,[F,"Nothing"],[L,le]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[U,[F,"Archos"],[L,Be]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[U,[F,"Archos"],[L,le]],[/; (n159v)/i],[U,[F,"HMD"],[L,le]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[F,U,[L,Be]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[F,U,[L,le]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[F,U,[L,Be]],[/(surface duo)/i],[U,[F,ap],[L,Be]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[U,[F,"Fairphone"],[L,le]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[U,[F,lp],[L,Be]],[/(sprint) (\w+)/i],[F,U,[L,le]],[/(kin\.[onetw]{3})/i],[[U,/\./g," "],[F,ap],[L,le]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[U,[F,pp],[L,Be]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[U,[F,pp],[L,le]],[/smart-tv.+(samsung)/i],[F,[L,nt]],[/hbbtv.+maple;(\d+)/i],[[U,/^/,"SmartTV"],[F,ls],[L,nt]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[F,U,[L,nt]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[F,Nc],[L,nt]],[/(apple) ?tv/i],[F,[U,ii+" TV"],[L,nt]],[/crkey.*devicetype\/chromecast/i],[[U,Dn+" Third Generation"],[F,so],[L,nt]],[/crkey.*devicetype\/([^/]*)/i],[[U,/^/,"Chromecast "],[F,so],[L,nt]],[/fuchsia.*crkey/i],[[U,Dn+" Nest Hub"],[F,so],[L,nt]],[/crkey/i],[[U,Dn],[F,so],[L,nt]],[/(portaltv)/i],[U,[F,mp],[L,nt]],[/droid.+aft(\w+)( bui|\))/i],[U,[F,Oc],[L,nt]],[/(shield \w+ tv)/i],[U,[F,lp],[L,nt]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[U,[F,jg],[L,nt]],[/(bravia[\w ]+)( bui|\))/i],[U,[F,us],[L,nt]],[/(mi(tv|box)-?\w+) bui/i],[U,[F,fp],[L,nt]],[/Hbbtv.*(technisat) (.*);/i],[F,U,[L,nt]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[F,/.+\/(\w+)/,"$1",Hr,{LG:"lge"}],[U,Uc],[L,nt]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[U,[L,nt]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[L,nt]],[/(playstation \w+)/i],[U,[F,us],[L,hs]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[U,[F,ap],[L,hs]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[F,U,[L,hs]],[/droid.+; (shield)( bui|\))/i],[U,[F,lp],[L,hs]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[U,[F,ls],[L,Fr]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[F,U,[L,Fr]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[U,[F,up],[L,Fr]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[U,[F,ii],[L,Fr]],[/(opwwe\d{3})/i],[U,[F,Wg],[L,Fr]],[/(moto 360)/i],[U,[F,cp],[L,Fr]],[/(smartwatch 3)/i],[U,[F,us],[L,Fr]],[/(g watch r)/i],[U,[F,Nc],[L,Fr]],[/droid.+; (wt63?0{2,3})\)/i],[U,[F,pp],[L,Fr]],[/droid.+; (glass) \d/i],[U,[F,so],[L,Dc]],[/(pico) (4|neo3(?: link|pro)?)/i],[F,U,[L,Dc]],[/(quest( \d| pro)?s?).+vr/i],[U,[F,mp],[L,Dc]],[/mobile vr; rv.+firefox/i],[[L,Dc]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[F,[L,gs]],[/(aeobc)\b/i],[U,[F,Oc],[L,gs]],[/(homepod).+mac os/i],[U,[F,ii],[L,gs]],[/windows iot/i],[[L,gs]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[U,[L,Hr,{mobile:"Mobile",xr:"VR","*":Be}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[L,Be]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[L,le]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[U,[F,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[j,[$,Lc+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[$,j],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[j,[$,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[$,j],[/ladybird\//i],[[$,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[j,$]],os:[[/(windows nt) (6\.[23]); arm/i],[[$,/N/,"R"],[j,Hr,Yg]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[$,j],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[j,/(;|\))/g,"",Hr,Yg],[$,Ep]],[/(windows ce)\/?([\d\.]*)/i],[$,j],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[j,/_/g,"."],[$,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[$,"macOS"],[j,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[j,[$,Dn+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[j,[$,Dn+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[j,[$,Dn+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[j,[$,Dn+" Linux"]],[/crkey\/([\d\.]+)/i],[j,[$,Dn]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[j,$],[/(ubuntu) ([\w\.]+) like android/i],[[$,/(.+)/,"$1 Touch"],j],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[$,j],[/\(bb(10);/i],[j,[$,Hg]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[j,[$,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[j,[$,fs+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[j,[$,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[j,Hr,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[$,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[j,[$,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[$,"Chrome OS"],j],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[$,j],[/(sunos) ?([\d\.]*)/i],[[$,"Solaris"],j],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[$,j]]},Pc=(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return ln.call(t.init,[[kt,[$,j,ys,L]],[an,[Ft]],[$r,[L,U,F]],[_r,[$,j]],[sr,[$,j]]]),ln.call(t.isIgnore,[[kt,[j,ys]],[_r,[j]],[sr,[j]]]),ln.call(t.isIgnoreRgx,[[kt,/ ?browser$/i],[sr,/ ?os$/i]]),ln.call(t.toString,[[kt,[$,j]],[an,[Ft]],[$r,[F,U]],[_r,[$,j]],[sr,[$,j]]]),t})(),a0=function(t,e){var r=Pc.init[e],n=Pc.isIgnore[e]||0,o=Pc.isIgnoreRgx[e]||0,i=Pc.toString[e]||0;function s(){ln.call(this,r)}return s.prototype.getItem=function(){return t},s.prototype.withClientHints=function(){return On?On.getHighEntropyValues(Zg).then(function(a){return t.setCH(new ey(a,!1)).parseCH().get()}):t.parseCH().get()},s.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=ai&&(s.prototype.is=function(a){var l=!1;for(var f in this)if(this.hasOwnProperty(f)&&!_p(n,f)&&cn(o?fi(o,this[f]):this[f])==cn(o?fi(o,a):a)){if(l=!0,a!=Nn)break}else if(a==Nn&&l){l=!l;break}return l},s.prototype.toString=function(){var a=li;for(var l in i)typeof this[i[l]]!==Nn&&(a+=(a?" ":li)+this[i[l]]);return a||Nn}),On||(s.prototype.then=function(a){var l=this,f=function(){for(var d in l)l.hasOwnProperty(d)&&(this[d]=l[d])};f.prototype={is:s.prototype.is,toString:s.prototype.toString};var m=new f;return a(m),m}),new s};function ey(t,e){if(t=t||{},ln.call(this,Zg),e)ln.call(this,[[wp,dp(t[Pn])],[bp,dp(t[JS])],[le,/\?1/.test(t[t0])],[U,ds(t[r0])],[ci,ds(t[Qg])],[Sp,ds(t[n0])],[Ft,ds(t[QS])],[ao,dp(t[e0])],[kc,ds(t[ZS])]]);else for(var r in t)this.hasOwnProperty(r)&&typeof t[r]!==Nn&&(this[r]=t[r])}function Jg(t,e,r,n){return this.get=function(o){return o?this.data.hasOwnProperty(o)?this.data[o]:void 0:this.data},this.set=function(o,i){return this.data[o]=i,this},this.setCH=function(o){return this.uaCH=o,this},this.detectFeature=function(){if(Ht&&Ht.userAgent==this.ua)switch(this.itemType){case kt:Ht.brave&&typeof Ht.brave.isBrave==Mc&&this.set($,"Brave");break;case $r:!this.get(L)&&On&&On[le]&&this.set(L,le),this.get(U)=="Macintosh"&&Ht&&typeof Ht.standalone!==Nn&&Ht.maxTouchPoints&&Ht.maxTouchPoints>2&&this.set(U,"iPad").set(L,Be);break;case sr:!this.get($)&&On&&On[ci]&&this.set($,On[ci]);break;case ai:var o=this.data,i=function(s){return o[s].getItem().detectFeature().get()};this.set(kt,i(kt)).set(an,i(an)).set($r,i($r)).set(_r,i(_r)).set(sr,i(sr))}return this},this.parseUA=function(){return this.itemType!=ai&&gp.call(this.data,this.ua,this.rgxMap),this.itemType==kt&&this.set(ys,hp(this.get(j))),this},this.parseCH=function(){var o=this.uaCH,i=this.rgxMap;switch(this.itemType){case kt:case _r:var s=o[bp]||o[wp],a;if(s)for(var l in s){var f=s[l].brand||s[l],m=s[l].version;this.itemType==kt&&!/not.a.brand/i.test(f)&&(!a||/Chrom/.test(a)&&f!=qg||a==Lc&&/WebView2/.test(f))&&(f=Hr(f,s0),a=this.get($),a&&!/Chrom/.test(a)&&/Chrom/.test(f)||this.set($,f).set(j,m).set(ys,hp(m)),a=f),this.itemType==_r&&f==qg&&this.set(j,m)}break;case an:var d=o[Ft];d&&(d&&o[kc]=="64"&&(d+="64"),gp.call(this.data,d+";",i));break;case $r:if(o[le]&&this.set(L,le),o[U]&&(this.set(U,o[U]),!this.get(L)||!this.get(F))){var _={};gp.call(_,"droid 9; "+o[U]+")",i),!this.get(L)&&_.type&&this.set(L,_.type),!this.get(F)&&_.vendor&&this.set(F,_.vendor)}if(o[ao]){var y;if(typeof o[ao]!="string")for(var C=0;!y&&C<o[ao].length;)y=Hr(o[ao][C++],Kg);else y=Hr(o[ao],Kg);this.set(L,y)}break;case sr:var N=o[ci];if(N){var A=o[Sp];N==Ep&&(A=parseInt(hp(A),10)>=13?"11":"10"),this.set($,N).set(j,A)}this.get($)==Ep&&o[U]=="Xbox"&&this.set($,"Xbox").set(j,void 0);break;case ai:var B=this.data,q=function(P){return B[P].getItem().setCH(o).parseCH().get()};this.set(kt,q(kt)).set(an,q(an)).set($r,q($r)).set(_r,q(_r)).set(sr,q(sr))}return this},ln.call(this,[["itemType",t],["ua",e],["uaCH",n],["rgxMap",r],["data",a0(this,t)]]),this}function wr(t,e,r){if(typeof t===ui?(Bc(t,!0)?(typeof e===ui&&(r=e),e=t):(r=t,e=void 0),t=void 0):typeof t===vp&&!Bc(e,!0)&&(r=e,e=void 0),r&&typeof r.append===Mc){var n={};r.forEach(function(l,f){n[f]=l}),r=n}if(!(this instanceof wr))return new wr(t,e,r).getResult();var o=typeof t===vp?t:r&&r[Ug]?r[Ug]:Ht&&Ht.userAgent?Ht.userAgent:li,i=new ey(r,!0),s=e?i0(Xg,e):Xg,a=function(l){return l==ai?function(){return new Jg(l,o,s,i).set("ua",o).set(kt,this.getBrowser()).set(an,this.getCPU()).set($r,this.getDevice()).set(_r,this.getEngine()).set(sr,this.getOS()).get()}:function(){return new Jg(l,o,s[l],i).parseUA().get()}};return ln.call(this,[["getBrowser",a(kt)],["getCPU",a(an)],["getDevice",a($r)],["getEngine",a(_r)],["getOS",a(sr)],["getResult",a(ai)],["getUA",function(){return o}],["setUA",function(l){return pi(l)&&(o=l.length>yp?Uc(l,yp):l),this}]]).setUA(o),this}wr.VERSION=XS;wr.BROWSER=Fc([$,j,ys,L]);wr.CPU=Fc([Ft]);wr.DEVICE=Fc([U,F,L,hs,le,nt,Be,Fr,gs]);wr.ENGINE=wr.OS=Fc([$,j]);function Hc(){let t=fe();return Z(E({},t.customContext),{page:Gs(),locale:t.locale,currentItem:t.currentItem,previewIDs:t.previewIDs,previewVariant:t.previewVariant,engagementIDs:c0(),cart:Bf()})}function c0(){let t=document.querySelectorAll(".letscooee-engagement"),e=[];return t.forEach(r=>{let n=r.dataset.engagementId;n&&+n&&e.push(n)}),e}function ye(t){return typeof t=="function"}function mi(t){let r=t(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var $c=mi(t=>function(r){t(this),this.message=r?`${r.length} errors occurred during unsubscription:
|
|
26
|
+
`)+" ".concat(l,"\\").concat(f,"/"))}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return VS(t,e);if(t===void 0)return null;if(t instanceof Date||_S(t)){var m=t.getTime(),d=m>-1&&m<2534023188e5;return e.legacy?e.relaxed&&d?{$date:t.getTime()}:{$date:gg(t)}:e.relaxed&&d?{$date:gg(t)}:{$date:{$numberLong:t.getTime().toString()}}}if(typeof t=="number"&&(!e.relaxed||!isFinite(t))){if(Math.floor(t)===t){var _=t>=Rg&&t<=Cg,y=t>=Dg&&t<=Ag;if(_)return{$numberInt:t.toString()};if(y)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||ES(t)){var C=t.flags;if(C===void 0){var N=t.toString().match(/[gimuy]*$/);N&&(C=N[0])}var A=new is(t.source,C);return A.toExtendedJSON(e)}return t!=null&&typeof t=="object"?jS(t,e):t}var WS={Binary:function(t){return new io(t.value(),t.sub_type)},Code:function(t){return new Ic(t.code,t.scope)},DBRef:function(t){return new os(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new Zf(t.bytes)},Double:function(t){return new xc(t.value)},Int32:function(t){return new Cc(t.value)},Long:function(t){return oe.fromBits(t.low!=null?t.low:t.low_,t.low!=null?t.high:t.high_,t.low!=null?t.unsigned:t.unsigned_)},MaxKey:function(){return new ep},MinKey:function(){return new tp},ObjectID:function(t){return new gt(t)},ObjectId:function(t){return new gt(t)},BSONRegExp:function(t){return new is(t.pattern,t.options)},Symbol:function(t){return new rp(t.value)},Timestamp:function(t){return xg.fromBits(t.low,t.high)}};function jS(t,e){if(t==null||typeof t!="object")throw new oo("not an object instance");var r=t._bsontype;if(typeof r>"u"){var n={};for(var o in t){e.seenObjects.push({propertyName:o,obj:null});try{var i=Rn(t[o],e);o==="__proto__"?Object.defineProperty(n,o,{value:i,writable:!0,enumerable:!0,configurable:!0}):n[o]=i}finally{e.seenObjects.pop()}}return n}else if(HS(t)){var s=t;if(typeof s.toExtendedJSON!="function"){var a=WS[t._bsontype];if(!a)throw new Xe("Unrecognized or invalid _bsontype: "+t._bsontype);s=a(s)}return r==="Code"&&s.scope?s=new Ic(s.code,Rn(s.scope,e)):r==="DBRef"&&s.oid&&(s=new os(Rn(s.collection,e),Rn(s.oid,e),Rn(s.db,e),Rn(s.fields,e))),s.toExtendedJSON(e)}else throw new oo("_bsontype must be a string, but was: "+typeof r)}var yg;(function(t){function e(i,s){var a=Object.assign({},{relaxed:!0,legacy:!1},s);return typeof a.relaxed=="boolean"&&(a.strict=!a.relaxed),typeof a.strict=="boolean"&&(a.relaxed=!a.strict),JSON.parse(i,function(l,f){if(l.indexOf("\0")!==-1)throw new oo("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(l)));return Og(f,a)})}t.parse=e;function r(i,s,a,l){a!=null&&typeof a=="object"&&(l=a,a=0),s!=null&&typeof s=="object"&&!Array.isArray(s)&&(l=s,s=void 0,a=0);var f=Object.assign({relaxed:!0,legacy:!1},l,{seenObjects:[{propertyName:"(root)",obj:null}]}),m=Rn(i,f);return JSON.stringify(m,s,a)}t.stringify=r;function n(i,s){return s=s||{},JSON.parse(r(i,s))}t.serialize=n;function o(i,s){return s=s||{},e(JSON.stringify(i),s)}t.deserialize=o})(yg||(yg={}));var vg,Eg=bg();Eg.Map?vg=Eg.Map:vg=(function(){function t(e){e===void 0&&(e=[]),this._keys=[],this._values={};for(var r=0;r<e.length;r++)if(e[r]!=null){var n=e[r],o=n[0],i=n[1];this._keys.push(o),this._values[o]={v:i,i:this._keys.length-1}}}return t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(e){var r=this._values[e];return r==null?!1:(delete this._values[e],this._keys.splice(r.i,1),!0)},t.prototype.entries=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?[n,e._values[n].v]:void 0,done:n===void 0}}}},t.prototype.forEach=function(e,r){r=r||this;for(var n=0;n<this._keys.length;n++){var o=this._keys[n];e.call(r,this._values[o].v,o,r)}},t.prototype.get=function(e){return this._values[e]?this._values[e].v:void 0},t.prototype.has=function(e){return this._values[e]!=null},t.prototype.keys=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?n:void 0,done:n===void 0}}}},t.prototype.set=function(e,r){return this._values[e]?(this._values[e].v=r,this):(this._keys.push(e),this._values[e]={v:r,i:this._keys.length-1},this)},t.prototype.values=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?e._values[n].v:void 0,done:n===void 0}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),t})();var rk=oe.fromNumber(wS),nk=oe.fromNumber(SS);var Kf=new Uint8Array(8),ok=new DataView(Kf.buffer,Kf.byteOffset,Kf.byteLength);var GS=1024*1024*17,ik=Ie.alloc(GS);var An=class{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;constructor(e){e=e||{},this.triggerID=e.id||e.triggerID,this.nudgeID=e.nudgeID,this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.contentID=e.contentID,this.variation=e.variation,this.props=e.props,this.objective=e.objective,this.onsiteDeliveryType=e.onsiteDeliveryType,this.holdout=e.holdout}};var xe=class{constructor(e,r={},n,o){this.name=e;this.properties=r;this.id=o?new gt(o):new gt,this.occurred=new Date,n&&(this.trigger=new An(n)),this.newEvent=!o}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale;setVideos(e){e&&(this.videos=[e.id])}};var Ng=0;function Pg(t,e){if(!t)return;let r=document.createElement("script");r.id=e??"",r.src=t,r.type="module",document.head.appendChild(r)}function np(t=document.head){return Lg(dr.styleURL,t,"cooee-global-styles")}function qS(t=document.head){return Lg(dr.swiperStyleURL,t,"cooee-swiper-styles")}function Lg(t,e=document.head,r){return new Promise(n=>{if(e.querySelector(`#${r}`)){n();return}let i=document.createElement("link");i.rel="stylesheet",i.href=t,i.id=r,i.onload=()=>{n()},i.onerror=()=>{console.error("Failed to load stylesheet:",t),n()},e.appendChild(i)})}function sn(t,e=document.head){if(!t)return;Ng++;let r=document.createElement("style");r.id=`cooee-app-css-${Ng}`,r.textContent=t,e.appendChild(r)}function Mg(t){if(!t)return;let e=document.createElement("script");e.id="cooee-app-script",e.innerHTML=t,document.head.appendChild(e)}function op(t){if(t)try{(0,eval)(t)}catch(e){console.error("Failed to execute script:",e)}}async function Rc(){let t=(await import("./swiper-bundle-WHJS64TU.js")).default;return window.CooeeSDK.Swiper=t}async function ip(t,e=!0){if(!t)return;let r=[];e&&r.push(qS(t)),r.push(np(t)),await Promise.all(r);let n=ze.get().website.commonCSS;sn(n,t)}var Ac=class{lastWidth;lastHeight;resizeTimeout=null;debounceDelay=200;onResizeCallback;constructor(e){this.onResizeCallback=e,this.lastWidth=window.innerWidth,this.lastHeight=window.innerHeight,window.addEventListener("resize",this.debouncedResize),window.addEventListener("orientationchange",this.handleImmediateResize)}destroy(){window.removeEventListener("resize",this.debouncedResize),window.removeEventListener("orientationchange",this.handleImmediateResize)}handleImmediateResize=()=>{this.triggerResize()};debouncedResize=()=>{this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.triggerResize()},this.debounceDelay)};triggerResize(){let e=window.innerWidth,r=window.innerHeight;(r!==this.lastHeight||e!==this.lastWidth)&&(this.onResizeCallback(),this.lastWidth=e,this.lastHeight=r)}};var zS=" daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\bperl\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/",YS=/bot|crawl|http|lighthouse|scan|search|spider/i,as;function KS(){if(as instanceof RegExp)return as;try{as=new RegExp(zS,"i")}catch{as=YS}return as}function Bg(t){return!!t&&KS().test(t)}var XS="2.0.4",yp=500,Ug="user-agent",li="",kg="?",Mc="function",Nn="undefined",ui="object",vp="string",kt="browser",an="cpu",$r="device",_r="engine",sr="os",ai="result",$="name",L="type",F="vendor",j="version",Ft="architecture",ys="major",U="model",hs="console",le="mobile",Be="tablet",nt="smarttv",Fr="wearable",Dc="xr",gs="embedded",cs="inapp",bp="brands",ao="formFactors",wp="fullVersionList",ci="platform",Sp="platformVersion",kc="bitness",Pn="sec-ch-ua",JS=Pn+"-full-version-list",QS=Pn+"-arch",ZS=Pn+"-"+kc,e0=Pn+"-form-factors",t0=Pn+"-"+le,r0=Pn+"-"+U,Qg=Pn+"-"+ci,n0=Qg+"-version",Zg=[bp,wp,le,U,ci,Sp,Ft,ao,kc],Oc="Amazon",ii="Apple",Fg="ASUS",Hg="BlackBerry",so="Google",$g="Huawei",sp="Lenovo",Vg="Honor",Nc="LG",ap="Microsoft",cp="Motorola",lp="Nvidia",Wg="OnePlus",up="OPPO",ls="Samsung",jg="Sharp",us="Sony",fp="Xiaomi",pp="Zebra",Gg="Chrome",qg="Chromium",Dn="Chromecast",Lc="Edge",fs="Firefox",ps="Opera",mp="Facebook",zg="Sogou",si="Mobile ",ms=" Browser",Ep="Windows",o0=typeof window!==Nn,Ht=o0&&window.navigator?window.navigator:void 0,On=Ht&&Ht.userAgentData?Ht.userAgentData:void 0,i0=function(t,e){var r={},n=e;if(!Bc(e)){n={};for(var o in e)for(var i in e[o])n[i]=e[o][i].concat(n[i]?n[i]:[])}for(var s in t)r[s]=n[s]&&n[s].length%2===0?n[s].concat(t[s]):t[s];return r},Fc=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},_p=function(t,e){if(typeof t===ui&&t.length>0){for(var r in t)if(cn(e)==cn(t[r]))return!0;return!1}return pi(t)?cn(e)==cn(t):!1},Bc=function(t,e){for(var r in t)return/^(browser|cpu|device|engine|os)$/.test(r)||(e?Bc(t[r]):!1)},pi=function(t){return typeof t===vp},dp=function(t){if(t){for(var e=[],r=fi(/\\?\"/g,t).split(","),n=0;n<r.length;n++)if(r[n].indexOf(";")>-1){var o=Uc(r[n]).split(";v=");e[n]={brand:o[0],version:o[1]}}else e[n]=Uc(r[n]);return e}},cn=function(t){return pi(t)?t.toLowerCase():t},hp=function(t){return pi(t)?fi(/[^\d\.]/g,t).split(".")[0]:void 0},ln=function(t){for(var e in t){var r=t[e];typeof r==ui&&r.length==2?this[r[0]]=r[1]:this[r]=void 0}return this},fi=function(t,e){return pi(e)?e.replace(t,li):e},ds=function(t){return fi(/\\?\"/g,t)},Uc=function(t,e){if(pi(t))return t=fi(/^\s\s*/,t),typeof e===Nn?t:t.substring(0,yp)},gp=function(t,e){if(!(!t||!e))for(var r=0,n,o,i,s,a,l;r<e.length&&!a;){var f=e[r],m=e[r+1];for(n=o=0;n<f.length&&!a&&f[n];)if(a=f[n++].exec(t),a)for(i=0;i<m.length;i++)l=a[++o],s=m[i],typeof s===ui&&s.length>0?s.length===2?typeof s[1]==Mc?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===Mc&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=l?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=l?s[1].call(this,l,s[2]):void 0:s.length==3?this[s[0]]=l?l.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=l?s[3].apply(this,[l.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=l||void 0;r+=2}},Hr=function(t,e){for(var r in e)if(typeof e[r]===ui&&e[r].length>0){for(var n=0;n<e[r].length;n++)if(_p(e[r][n],t))return r===kg?void 0:r}else if(_p(e[r],t))return r===kg?void 0:r;return e.hasOwnProperty("*")?e["*"]:t},Yg={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},Kg={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},s0={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Xg={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[j,[$,si+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[j,[$,Lc+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[j,[$,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[$,j],[/opios[\/ ]+([\w\.]+)/i],[j,[$,ps+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[j,[$,ps+" GX"]],[/\bopr\/([\w\.]+)/i],[j,[$,ps]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[j,[$,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[j,[$,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[$,j],[/quark(?:pc)?\/([-\w\.]+)/i],[j,[$,"Quark"]],[/\bddg\/([\w\.]+)/i],[j,[$,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[j,[$,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[j,[$,"WeChat"]],[/konqueror\/([\w\.]+)/i],[j,[$,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[j,[$,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[j,[$,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[j,[$,"Smart "+sp+ms]],[/(avast|avg)\/([\w\.]+)/i],[[$,/(.+)/,"$1 Secure"+ms],j],[/\bfocus\/([\w\.]+)/i],[j,[$,fs+" Focus"]],[/\bopt\/([\w\.]+)/i],[j,[$,ps+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[j,[$,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[j,[$,"Dolphin"]],[/coast\/([\w\.]+)/i],[j,[$,ps+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[j,[$,"MIUI"+ms]],[/fxios\/([\w\.-]+)/i],[j,[$,si+fs]],[/\bqihoobrowser\/?([\w\.]*)/i],[j,[$,"360"]],[/\b(qq)\/([\w\.]+)/i],[[$,/(.+)/,"$1Browser"],j],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[$,/(.+)/,"$1"+ms],j],[/samsungbrowser\/([\w\.]+)/i],[j,[$,ls+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[j,[$,zg+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[$,zg+" Mobile"],j],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[$,j],[/(lbbrowser|rekonq)/i],[$],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[j,$],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[$,mp],j,[L,cs]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[$,j,[L,cs]],[/\bgsa\/([\w\.]+) .*safari\//i],[j,[$,"GSA"],[L,cs]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[j,[$,"TikTok"],[L,cs]],[/\[(linkedin)app\]/i],[$,[L,cs]],[/(chromium)[\/ ]([-\w\.]+)/i],[$,j],[/headlesschrome(?:\/([\w\.]+)| )/i],[j,[$,Gg+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[j,[$,Lc+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[$,Gg+" WebView"],j],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[j,[$,"Android"+ms]],[/chrome\/([\w\.]+) mobile/i],[j,[$,si+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[$,j],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[j,[$,si+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[$,si+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[j,$],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[$,[j,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[$,j],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[$,si+fs],j],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[$,"Netscape"],j],[/(wolvic|librewolf)\/([\w\.]+)/i],[$,j],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[j,[$,fs+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[$,[j,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[$,[j,/[^\d\.]+./,li]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[Ft,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[Ft,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[Ft,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[Ft,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[Ft,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[Ft,/ower/,li,cn]],[/ sun4\w[;\)]/i],[[Ft,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[Ft,cn]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[U,[F,ls],[L,Be]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[U,[F,ls],[L,le]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[U,[F,ii],[L,le]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[U,[F,ii],[L,Be]],[/(macintosh);/i],[U,[F,ii]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[U,[F,jg],[L,le]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[U,[F,Vg],[L,Be]],[/honor([-\w ]+)[;\)]/i],[U,[F,Vg],[L,le]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[U,[F,$g],[L,Be]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[U,[F,$g],[L,le]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[U,/_/g," "],[F,fp],[L,Be]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[U,/_/g," "],[F,fp],[L,le]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[U,[F,Wg],[L,le]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[U,[F,up],[L,le]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[U,[F,Hr,{OnePlus:["203","304","403","404","413","415"],"*":up}],[L,Be]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[U,[F,"BLU"],[L,le]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[U,[F,"Vivo"],[L,le]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[U,[F,"Realme"],[L,le]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[U,[F,sp],[L,Be]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[U,[F,sp],[L,le]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[U,[F,cp],[L,le]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[U,[F,cp],[L,Be]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[U,[F,Nc],[L,Be]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[U,[F,Nc],[L,le]],[/(nokia) (t[12][01])/i],[F,U,[L,Be]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[U,/_/g," "],[L,le],[F,"Nokia"]],[/(pixel (c|tablet))\b/i],[U,[F,so],[L,Be]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[U,[F,so],[L,le]],[/(google) (pixelbook( go)?)/i],[F,U],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[U,[F,us],[L,le]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[U,"Xperia Tablet"],[F,us],[L,Be]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[U,[F,Oc],[L,Be]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[U,/(.+)/g,"Fire Phone $1"],[F,Oc],[L,le]],[/(playbook);[-\w\),; ]+(rim)/i],[U,F,[L,Be]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[U,[F,Hg],[L,le]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[U,[F,Fg],[L,Be]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[U,[F,Fg],[L,le]],[/(nexus 9)/i],[U,[F,"HTC"],[L,Be]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[F,[U,/_/g," "],[L,le]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[U,[F,"TCL"],[L,Be]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[U,[F,"TCL"],[L,le]],[/(itel) ((\w+))/i],[[F,cn],U,[L,Hr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[U,[F,"Acer"],[L,Be]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[U,[F,"Meizu"],[L,le]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[U,[F,"Ulefone"],[L,le]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[U,[F,"Energizer"],[L,le]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[U,[F,"Cat"],[L,le]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[U,[F,"Smartfren"],[L,le]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[U,[F,"Nothing"],[L,le]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[U,[F,"Archos"],[L,Be]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[U,[F,"Archos"],[L,le]],[/; (n159v)/i],[U,[F,"HMD"],[L,le]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[F,U,[L,Be]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[F,U,[L,le]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[F,U,[L,Be]],[/(surface duo)/i],[U,[F,ap],[L,Be]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[U,[F,"Fairphone"],[L,le]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[U,[F,lp],[L,Be]],[/(sprint) (\w+)/i],[F,U,[L,le]],[/(kin\.[onetw]{3})/i],[[U,/\./g," "],[F,ap],[L,le]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[U,[F,pp],[L,Be]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[U,[F,pp],[L,le]],[/smart-tv.+(samsung)/i],[F,[L,nt]],[/hbbtv.+maple;(\d+)/i],[[U,/^/,"SmartTV"],[F,ls],[L,nt]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[F,U,[L,nt]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[F,Nc],[L,nt]],[/(apple) ?tv/i],[F,[U,ii+" TV"],[L,nt]],[/crkey.*devicetype\/chromecast/i],[[U,Dn+" Third Generation"],[F,so],[L,nt]],[/crkey.*devicetype\/([^/]*)/i],[[U,/^/,"Chromecast "],[F,so],[L,nt]],[/fuchsia.*crkey/i],[[U,Dn+" Nest Hub"],[F,so],[L,nt]],[/crkey/i],[[U,Dn],[F,so],[L,nt]],[/(portaltv)/i],[U,[F,mp],[L,nt]],[/droid.+aft(\w+)( bui|\))/i],[U,[F,Oc],[L,nt]],[/(shield \w+ tv)/i],[U,[F,lp],[L,nt]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[U,[F,jg],[L,nt]],[/(bravia[\w ]+)( bui|\))/i],[U,[F,us],[L,nt]],[/(mi(tv|box)-?\w+) bui/i],[U,[F,fp],[L,nt]],[/Hbbtv.*(technisat) (.*);/i],[F,U,[L,nt]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[F,/.+\/(\w+)/,"$1",Hr,{LG:"lge"}],[U,Uc],[L,nt]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[U,[L,nt]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[L,nt]],[/(playstation \w+)/i],[U,[F,us],[L,hs]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[U,[F,ap],[L,hs]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[F,U,[L,hs]],[/droid.+; (shield)( bui|\))/i],[U,[F,lp],[L,hs]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[U,[F,ls],[L,Fr]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[F,U,[L,Fr]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[U,[F,up],[L,Fr]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[U,[F,ii],[L,Fr]],[/(opwwe\d{3})/i],[U,[F,Wg],[L,Fr]],[/(moto 360)/i],[U,[F,cp],[L,Fr]],[/(smartwatch 3)/i],[U,[F,us],[L,Fr]],[/(g watch r)/i],[U,[F,Nc],[L,Fr]],[/droid.+; (wt63?0{2,3})\)/i],[U,[F,pp],[L,Fr]],[/droid.+; (glass) \d/i],[U,[F,so],[L,Dc]],[/(pico) (4|neo3(?: link|pro)?)/i],[F,U,[L,Dc]],[/(quest( \d| pro)?s?).+vr/i],[U,[F,mp],[L,Dc]],[/mobile vr; rv.+firefox/i],[[L,Dc]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[F,[L,gs]],[/(aeobc)\b/i],[U,[F,Oc],[L,gs]],[/(homepod).+mac os/i],[U,[F,ii],[L,gs]],[/windows iot/i],[[L,gs]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[U,[L,Hr,{mobile:"Mobile",xr:"VR","*":Be}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[L,Be]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[L,le]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[U,[F,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[j,[$,Lc+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[$,j],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[j,[$,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[$,j],[/ladybird\//i],[[$,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[j,$]],os:[[/(windows nt) (6\.[23]); arm/i],[[$,/N/,"R"],[j,Hr,Yg]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[$,j],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[j,/(;|\))/g,"",Hr,Yg],[$,Ep]],[/(windows ce)\/?([\d\.]*)/i],[$,j],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[j,/_/g,"."],[$,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[$,"macOS"],[j,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[j,[$,Dn+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[j,[$,Dn+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[j,[$,Dn+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[j,[$,Dn+" Linux"]],[/crkey\/([\d\.]+)/i],[j,[$,Dn]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[j,$],[/(ubuntu) ([\w\.]+) like android/i],[[$,/(.+)/,"$1 Touch"],j],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[$,j],[/\(bb(10);/i],[j,[$,Hg]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[j,[$,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[j,[$,fs+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[j,[$,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[j,Hr,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[$,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[j,[$,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[$,"Chrome OS"],j],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[$,j],[/(sunos) ?([\d\.]*)/i],[[$,"Solaris"],j],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[$,j]]},Pc=(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return ln.call(t.init,[[kt,[$,j,ys,L]],[an,[Ft]],[$r,[L,U,F]],[_r,[$,j]],[sr,[$,j]]]),ln.call(t.isIgnore,[[kt,[j,ys]],[_r,[j]],[sr,[j]]]),ln.call(t.isIgnoreRgx,[[kt,/ ?browser$/i],[sr,/ ?os$/i]]),ln.call(t.toString,[[kt,[$,j]],[an,[Ft]],[$r,[F,U]],[_r,[$,j]],[sr,[$,j]]]),t})(),a0=function(t,e){var r=Pc.init[e],n=Pc.isIgnore[e]||0,o=Pc.isIgnoreRgx[e]||0,i=Pc.toString[e]||0;function s(){ln.call(this,r)}return s.prototype.getItem=function(){return t},s.prototype.withClientHints=function(){return On?On.getHighEntropyValues(Zg).then(function(a){return t.setCH(new ey(a,!1)).parseCH().get()}):t.parseCH().get()},s.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=ai&&(s.prototype.is=function(a){var l=!1;for(var f in this)if(this.hasOwnProperty(f)&&!_p(n,f)&&cn(o?fi(o,this[f]):this[f])==cn(o?fi(o,a):a)){if(l=!0,a!=Nn)break}else if(a==Nn&&l){l=!l;break}return l},s.prototype.toString=function(){var a=li;for(var l in i)typeof this[i[l]]!==Nn&&(a+=(a?" ":li)+this[i[l]]);return a||Nn}),On||(s.prototype.then=function(a){var l=this,f=function(){for(var d in l)l.hasOwnProperty(d)&&(this[d]=l[d])};f.prototype={is:s.prototype.is,toString:s.prototype.toString};var m=new f;return a(m),m}),new s};function ey(t,e){if(t=t||{},ln.call(this,Zg),e)ln.call(this,[[bp,dp(t[Pn])],[wp,dp(t[JS])],[le,/\?1/.test(t[t0])],[U,ds(t[r0])],[ci,ds(t[Qg])],[Sp,ds(t[n0])],[Ft,ds(t[QS])],[ao,dp(t[e0])],[kc,ds(t[ZS])]]);else for(var r in t)this.hasOwnProperty(r)&&typeof t[r]!==Nn&&(this[r]=t[r])}function Jg(t,e,r,n){return this.get=function(o){return o?this.data.hasOwnProperty(o)?this.data[o]:void 0:this.data},this.set=function(o,i){return this.data[o]=i,this},this.setCH=function(o){return this.uaCH=o,this},this.detectFeature=function(){if(Ht&&Ht.userAgent==this.ua)switch(this.itemType){case kt:Ht.brave&&typeof Ht.brave.isBrave==Mc&&this.set($,"Brave");break;case $r:!this.get(L)&&On&&On[le]&&this.set(L,le),this.get(U)=="Macintosh"&&Ht&&typeof Ht.standalone!==Nn&&Ht.maxTouchPoints&&Ht.maxTouchPoints>2&&this.set(U,"iPad").set(L,Be);break;case sr:!this.get($)&&On&&On[ci]&&this.set($,On[ci]);break;case ai:var o=this.data,i=function(s){return o[s].getItem().detectFeature().get()};this.set(kt,i(kt)).set(an,i(an)).set($r,i($r)).set(_r,i(_r)).set(sr,i(sr))}return this},this.parseUA=function(){return this.itemType!=ai&&gp.call(this.data,this.ua,this.rgxMap),this.itemType==kt&&this.set(ys,hp(this.get(j))),this},this.parseCH=function(){var o=this.uaCH,i=this.rgxMap;switch(this.itemType){case kt:case _r:var s=o[wp]||o[bp],a;if(s)for(var l in s){var f=s[l].brand||s[l],m=s[l].version;this.itemType==kt&&!/not.a.brand/i.test(f)&&(!a||/Chrom/.test(a)&&f!=qg||a==Lc&&/WebView2/.test(f))&&(f=Hr(f,s0),a=this.get($),a&&!/Chrom/.test(a)&&/Chrom/.test(f)||this.set($,f).set(j,m).set(ys,hp(m)),a=f),this.itemType==_r&&f==qg&&this.set(j,m)}break;case an:var d=o[Ft];d&&(d&&o[kc]=="64"&&(d+="64"),gp.call(this.data,d+";",i));break;case $r:if(o[le]&&this.set(L,le),o[U]&&(this.set(U,o[U]),!this.get(L)||!this.get(F))){var _={};gp.call(_,"droid 9; "+o[U]+")",i),!this.get(L)&&_.type&&this.set(L,_.type),!this.get(F)&&_.vendor&&this.set(F,_.vendor)}if(o[ao]){var y;if(typeof o[ao]!="string")for(var C=0;!y&&C<o[ao].length;)y=Hr(o[ao][C++],Kg);else y=Hr(o[ao],Kg);this.set(L,y)}break;case sr:var N=o[ci];if(N){var A=o[Sp];N==Ep&&(A=parseInt(hp(A),10)>=13?"11":"10"),this.set($,N).set(j,A)}this.get($)==Ep&&o[U]=="Xbox"&&this.set($,"Xbox").set(j,void 0);break;case ai:var B=this.data,q=function(P){return B[P].getItem().setCH(o).parseCH().get()};this.set(kt,q(kt)).set(an,q(an)).set($r,q($r)).set(_r,q(_r)).set(sr,q(sr))}return this},ln.call(this,[["itemType",t],["ua",e],["uaCH",n],["rgxMap",r],["data",a0(this,t)]]),this}function br(t,e,r){if(typeof t===ui?(Bc(t,!0)?(typeof e===ui&&(r=e),e=t):(r=t,e=void 0),t=void 0):typeof t===vp&&!Bc(e,!0)&&(r=e,e=void 0),r&&typeof r.append===Mc){var n={};r.forEach(function(l,f){n[f]=l}),r=n}if(!(this instanceof br))return new br(t,e,r).getResult();var o=typeof t===vp?t:r&&r[Ug]?r[Ug]:Ht&&Ht.userAgent?Ht.userAgent:li,i=new ey(r,!0),s=e?i0(Xg,e):Xg,a=function(l){return l==ai?function(){return new Jg(l,o,s,i).set("ua",o).set(kt,this.getBrowser()).set(an,this.getCPU()).set($r,this.getDevice()).set(_r,this.getEngine()).set(sr,this.getOS()).get()}:function(){return new Jg(l,o,s[l],i).parseUA().get()}};return ln.call(this,[["getBrowser",a(kt)],["getCPU",a(an)],["getDevice",a($r)],["getEngine",a(_r)],["getOS",a(sr)],["getResult",a(ai)],["getUA",function(){return o}],["setUA",function(l){return pi(l)&&(o=l.length>yp?Uc(l,yp):l),this}]]).setUA(o),this}br.VERSION=XS;br.BROWSER=Fc([$,j,ys,L]);br.CPU=Fc([Ft]);br.DEVICE=Fc([U,F,L,hs,le,nt,Be,Fr,gs]);br.ENGINE=br.OS=Fc([$,j]);function Hc(){let t=fe();return E(Z(E({},t.customContext),{page:Gs(),locale:t.locale,currentItem:t.currentItem,previewIDs:t.previewIDs,previewVariant:t.previewVariant,engagementIDs:l0(),cart:Bf()}),c0())}function c0(){let t=window.CooeeSDK.uaParser.getResult();return{os:t.os,device:t.device,browser:t.browser}}function l0(){let t=document.querySelectorAll(".letscooee-engagement"),e=[];return t.forEach(r=>{let n=r.dataset.engagementId;n&&+n&&e.push(n)}),e}function ye(t){return typeof t=="function"}function mi(t){let r=t(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var $c=mi(t=>function(r){t(this),this.message=r?`${r.length} errors occurred during unsubscription:
|
|
27
27
|
${r.map((n,o)=>`${o+1}) ${n.toString()}`).join(`
|
|
28
|
-
`)}`:"",this.name="UnsubscriptionError",this.errors=r});function co(t,e){if(t){let r=t.indexOf(e);0<=r&&t.splice(r,1)}}var ar=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let i of r)i.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(ye(n))try{n()}catch(i){e=i instanceof $c?i.errors:[i]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let i of o)try{ty(i)}catch(s){e=e??[],s instanceof $c?e=[...e,...s.errors]:e.push(s)}}if(e)throw new $c(e)}}add(e){var r;if(e&&e!==this)if(this.closed)ty(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}}_hasParent(e){let{_parentage:r}=this;return r===e||Array.isArray(r)&&r.includes(e)}_addParent(e){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e}_removeParent(e){let{_parentage:r}=this;r===e?this._parentage=null:Array.isArray(r)&&co(r,e)}remove(e){let{_finalizers:r}=this;r&&co(r,e),e instanceof t&&e._removeParent(this)}};ar.EMPTY=(()=>{let t=new ar;return t.closed=!0,t})();var Tp=ar.EMPTY;function Vc(t){return t instanceof ar||t&&"closed"in t&&ye(t.remove)&&ye(t.add)&&ye(t.unsubscribe)}function ty(t){ye(t)?t():t.unsubscribe()}var br={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var di={setTimeout(t,e,...r){let{delegate:n}=di;return n?.setTimeout?n.setTimeout(t,e,...r):setTimeout(t,e,...r)},clearTimeout(t){let{delegate:e}=di;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Wc(t){di.setTimeout(()=>{let{onUnhandledError:e}=br;if(e)e(t);else throw t})}function Ip(){}var ry=xp("C",void 0,void 0);function ny(t){return xp("E",void 0,t)}function oy(t){return xp("N",t,void 0)}function xp(t,e,r){return{kind:t,value:e,error:r}}var lo=null;function hi(t){if(br.useDeprecatedSynchronousErrorHandling){let e=!lo;if(e&&(lo={errorThrown:!1,error:null}),t(),e){let{errorThrown:r,error:n}=lo;if(lo=null,r)throw n}}else t()}function iy(t){br.useDeprecatedSynchronousErrorHandling&&lo&&(lo.errorThrown=!0,lo.error=t)}var uo=class extends ar{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Vc(e)&&e.add(this)):this.destination=f0}static create(e,r,n){return new Ln(e,r,n)}next(e){this.isStopped?Rp(oy(e),this):this._next(e)}error(e){this.isStopped?Rp(ny(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Rp(ry,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},l0=Function.prototype.bind;function Cp(t,e){return l0.call(t,e)}var Ap=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:r}=this;if(r.next)try{r.next(e)}catch(n){jc(n)}}error(e){let{partialObserver:r}=this;if(r.error)try{r.error(e)}catch(n){jc(n)}else jc(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(r){jc(r)}}},Ln=class extends uo{constructor(e,r,n){super();let o;if(ye(e)||!e)o={next:e??void 0,error:r??void 0,complete:n??void 0};else{let i;this&&br.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&Cp(e.next,i),error:e.error&&Cp(e.error,i),complete:e.complete&&Cp(e.complete,i)}):o=e}this.destination=new Ap(o)}};function jc(t){br.useDeprecatedSynchronousErrorHandling?iy(t):Wc(t)}function u0(t){throw t}function Rp(t,e){let{onStoppedNotification:r}=br;r&&di.setTimeout(()=>r(t,e))}var f0={closed:!0,next:Ip,error:u0,complete:Ip};var gi=typeof Symbol=="function"&&Symbol.observable||"@@observable";function sy(t){return t}function ay(t){return t.length===0?sy:t.length===1?t[0]:function(r){return t.reduce((n,o)=>o(n),r)}}var Rt=(()=>{class t{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new t;return n.source=this,n.operator=r,n}subscribe(r,n,o){let i=m0(r)?r:new Ln(r,n,o);return hi(()=>{let{operator:s,source:a}=this;i.add(s?s.call(i,a):a?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=cy(n),new n((o,i)=>{let s=new Ln({next:a=>{try{r(a)}catch(l){i(l),s.unsubscribe()}},error:i,complete:o});this.subscribe(s)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[gi](){return this}pipe(...r){return ay(r)(this)}toPromise(r){return r=cy(r),new r((n,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>n(i))})}}return t.create=e=>new t(e),t})();function cy(t){var e;return(e=t??br.Promise)!==null&&e!==void 0?e:Promise}function p0(t){return t&&ye(t.next)&&ye(t.error)&&ye(t.complete)}function m0(t){return t&&t instanceof uo||p0(t)&&Vc(t)}function d0(t){return ye(t?.lift)}function Vr(t){return e=>{if(d0(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function cr(t,e,r,n,o){return new Dp(t,e,r,n,o)}var Dp=class extends uo{constructor(e,r,n,o,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=r?function(a){try{r(a)}catch(l){e.error(l)}}:super._next,this._error=o?function(a){try{o(a)}catch(l){e.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:r}=this;super.unsubscribe(),!r&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};var ly=mi(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var qt=(()=>{class t extends Rt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new Gc(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new ly}next(r){hi(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){hi(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){hi(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:o,observers:i}=this;return n||o?Tp:(this.currentObservers=null,i.push(r),new ar(()=>{this.currentObservers=null,co(i,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:o,isStopped:i}=this;n?r.error(o):i&&r.complete()}asObservable(){let r=new Rt;return r.source=this,r}}return t.create=(e,r)=>new Gc(e,r),t})(),Gc=class extends qt{constructor(e,r){super(),this.destination=e,this.source=r}next(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,e)}error(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,e)}complete(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)}_subscribe(e){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&n!==void 0?n:Tp}};var vs=class extends qt{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let r=super._subscribe(e);return!r.closed&&e.next(this._value),r}getValue(){let{hasError:e,thrownError:r,_value:n}=this;if(e)throw r;return this._throwIfClosed(),n}next(e){super.next(this._value=e)}};var Es={now(){return(Es.delegate||Date).now()},delegate:void 0};var _s=class extends qt{constructor(e=1/0,r=1/0,n=Es){super(),this._bufferSize=e,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,r)}next(e){let{isStopped:r,_buffer:n,_infiniteTimeWindow:o,_timestampProvider:i,_windowTime:s}=this;r||(n.push(e),!o&&n.push(i.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let r=this._innerSubscribe(e),{_infiniteTimeWindow:n,_buffer:o}=this,i=o.slice();for(let s=0;s<i.length&&!e.closed;s+=n?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),r}_trimBuffer(){let{_bufferSize:e,_timestampProvider:r,_buffer:n,_infiniteTimeWindow:o}=this,i=(o?1:2)*e;if(e<1/0&&i<n.length&&n.splice(0,n.length-i),!o){let s=r.now(),a=0;for(let l=1;l<n.length&&n[l]<=s;l+=2)a=l;a&&n.splice(0,a+1)}}};var qc=class extends ar{constructor(e,r){super()}schedule(e,r=0){return this}};var ws={setInterval(t,e,...r){let{delegate:n}=ws;return n?.setInterval?n.setInterval(t,e,...r):setInterval(t,e,...r)},clearInterval(t){let{delegate:e}=ws;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var zc=class extends qc{constructor(e,r){super(e,r),this.scheduler=e,this.work=r,this.pending=!1}schedule(e,r=0){var n;if(this.closed)return this;this.state=e;let o=this.id,i=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(i,o,r)),this.pending=!0,this.delay=r,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(i,this.id,r),this}requestAsyncId(e,r,n=0){return ws.setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,r,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return r;r!=null&&ws.clearInterval(r)}execute(e,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let n=this._execute(e,r);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,r){let n=!1,o;try{this.work(e)}catch(i){n=!0,o=i||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){let{id:e,scheduler:r}=this,{actions:n}=r;this.work=this.state=this.scheduler=null,this.pending=!1,co(n,this),e!=null&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,super.unsubscribe()}}};var yi=class t{constructor(e,r=t.now){this.schedulerActionCtor=e,this.now=r}schedule(e,r=0,n){return new this.schedulerActionCtor(this,e).schedule(n,r)}};yi.now=Es.now;var Yc=class extends yi{constructor(e,r=yi.now){super(e,r),this.actions=[],this._active=!1}flush(e){let{actions:r}=this;if(this._active){r.push(e);return}let n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,n){for(;e=r.shift();)e.unsubscribe();throw n}}};var bs=new Yc(zc),uy=bs;function fy(t){return t&&ye(t.schedule)}function my(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(m){try{f(n.next(m))}catch(d){s(d)}}function l(m){try{f(n.throw(m))}catch(d){s(d)}}function f(m){m.done?i(m.value):o(m.value).then(a,l)}f((n=n.apply(t,e||[])).next())})}function py(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fo(t){return this instanceof fo?(this.v=t,this):new fo(t)}function dy(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(y){return function(C){return Promise.resolve(C).then(y,d)}}function a(y,C){n[y]&&(o[y]=function(N){return new Promise(function(A,B){i.push([y,N,A,B])>1||l(y,N)})},C&&(o[y]=C(o[y])))}function l(y,C){try{f(n[y](C))}catch(N){_(i[0][3],N)}}function f(y){y.value instanceof fo?Promise.resolve(y.value.v).then(m,d):_(i[0][2],y)}function m(y){l("next",y)}function d(y){l("throw",y)}function _(y,C){y(C),i.shift(),i.length&&l(i[0][0],i[0][1])}}function hy(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof py=="function"?py(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(s){return new Promise(function(a,l){s=t[i](s),o(a,l,s.done,s.value)})}}function o(i,s,a,l){Promise.resolve(l).then(function(f){i({value:f,done:a})},s)}}var Kc=t=>t&&typeof t.length=="number"&&typeof t!="function";function gy(t){return ye(t?.then)}function yy(t){return ye(t[gi])}function vy(t){return Symbol.asyncIterator&&ye(t?.[Symbol.asyncIterator])}function Ey(t){return new TypeError(`You provided ${t!==null&&typeof t=="object"?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function h0(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var _y=h0();function wy(t){return ye(t?.[_y])}function by(t){return dy(this,arguments,function*(){let r=t.getReader();try{for(;;){let{value:n,done:o}=yield fo(r.read());if(o)return yield fo(void 0);yield yield fo(n)}}finally{r.releaseLock()}})}function Sy(t){return ye(t?.getReader)}function Mn(t){if(t instanceof Rt)return t;if(t!=null){if(yy(t))return g0(t);if(Kc(t))return y0(t);if(gy(t))return v0(t);if(vy(t))return Ty(t);if(wy(t))return E0(t);if(Sy(t))return _0(t)}throw Ey(t)}function g0(t){return new Rt(e=>{let r=t[gi]();if(ye(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function y0(t){return new Rt(e=>{for(let r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function v0(t){return new Rt(e=>{t.then(r=>{e.closed||(e.next(r),e.complete())},r=>e.error(r)).then(null,Wc)})}function E0(t){return new Rt(e=>{for(let r of t)if(e.next(r),e.closed)return;e.complete()})}function Ty(t){return new Rt(e=>{w0(t,e).catch(r=>e.error(r))})}function _0(t){return Ty(by(t))}function w0(t,e){var r,n,o,i;return my(this,void 0,void 0,function*(){try{for(r=hy(t);n=yield r.next(),!n.done;){let s=n.value;if(e.next(s),e.closed)return}}catch(s){o={error:s}}finally{try{n&&!n.done&&(i=r.return)&&(yield i.call(r))}finally{if(o)throw o.error}}e.complete()})}function Iy(t,e,r,n=0,o=!1){let i=e.schedule(function(){r(),o?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(i),!o)return i}var xy=mi(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function Sr(t,e){let r=typeof e=="object";return new Promise((n,o)=>{let i=new Ln({next:s=>{n(s),i.unsubscribe()},error:o,complete:()=>{r?n(e.defaultValue):o(new xy)}});t.subscribe(i)})}function Cy(t){return t instanceof Date&&!isNaN(t)}function un(t,e){return Vr((r,n)=>{let o=0;r.subscribe(cr(n,i=>{n.next(t.call(e,i,o++))}))})}var{isArray:b0}=Array;function S0(t,e){return b0(e)?t(...e):t(e)}function Xc(t){return un(e=>S0(t,e))}function Ry(t,e,r,n,o,i,s,a){let l=[],f=0,m=0,d=!1,_=()=>{d&&!l.length&&!f&&e.complete()},y=N=>f<n?C(N):l.push(N),C=N=>{i&&e.next(N),f++;let A=!1;Mn(r(N,m++)).subscribe(cr(e,B=>{o?.(B),i?y(B):e.next(B)},()=>{A=!0},void 0,()=>{if(A)try{for(f--;l.length&&f<n;){let B=l.shift();s?Iy(e,s,()=>C(B)):C(B)}_()}catch(B){e.error(B)}}))};return t.subscribe(cr(e,y,()=>{d=!0,_()})),()=>{a?.()}}function Op(t,e,r=1/0){return ye(e)?Op((n,o)=>un((i,s)=>e(n,i,o,s))(Mn(t(n,o))),r):(typeof e=="number"&&(r=e),Vr((n,o)=>Ry(n,o,t,r)))}var T0=["addListener","removeListener"],I0=["addEventListener","removeEventListener"],x0=["on","off"];function po(t,e,r,n){if(ye(r)&&(n=r,r=void 0),n)return po(t,e,r).pipe(Xc(n));let[o,i]=A0(t)?I0.map(s=>a=>t[s](e,a,r)):C0(t)?T0.map(Ay(t,e)):R0(t)?x0.map(Ay(t,e)):[];if(!o&&Kc(t))return Op(s=>po(s,e,r))(Mn(t));if(!o)throw new TypeError("Invalid event target");return new Rt(s=>{let a=(...l)=>s.next(1<l.length?l:l[0]);return o(a),()=>i(a)})}function Ay(t,e){return r=>n=>t[r](e,n)}function C0(t){return ye(t.addListener)&&ye(t.removeListener)}function R0(t){return ye(t.on)&&ye(t.off)}function A0(t){return ye(t.addEventListener)&&ye(t.removeEventListener)}function Jc(t,e,r){return r?Jc(t,e).pipe(Xc(r)):new Rt(n=>{let o=(...s)=>n.next(s.length===1?s[0]:s),i=t(o);return ye(e)?()=>e(o,i):void 0})}function Dy(t=0,e,r=uy){let n=-1;return e!=null&&(fy(e)?r=e:n=e),new Rt(o=>{let i=Cy(t)?+t-r.now():t;i<0&&(i=0);let s=0;return r.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Np(t,e){return Vr((r,n)=>{let o=0;r.subscribe(cr(n,i=>t.call(e,i,o++)&&n.next(i)))})}function zt(t,e=bs){return Vr((r,n)=>{let o=null,i=null,s=null,a=()=>{if(o){o.unsubscribe(),o=null;let f=i;i=null,n.next(f)}};function l(){let f=s+t,m=e.now();if(m<f){o=this.schedule(void 0,f-m),n.add(o);return}a()}r.subscribe(cr(n,f=>{i=f,s=e.now(),o||(o=e.schedule(l,t),n.add(o))},()=>{a(),n.complete()},void 0,()=>{i=o=null}))})}function Oy(t,e){return Vr((r,n)=>{let{leading:o=!0,trailing:i=!1}=e??{},s=!1,a=null,l=null,f=!1,m=()=>{l?.unsubscribe(),l=null,i&&(y(),f&&n.complete())},d=()=>{l=null,f&&n.complete()},_=C=>l=Mn(t(C)).subscribe(cr(n,m,d)),y=()=>{if(s){s=!1;let C=a;a=null,n.next(C),!f&&_(C)}};r.subscribe(cr(n,C=>{s=!0,a=C,!(l&&!l.closed)&&(o?y():_(C))},()=>{f=!0,!(i&&s&&l&&!l.closed)&&n.complete()}))})}function Pp(t,e=bs,r){let n=Dy(t,e);return Oy(()=>n,r)}var Ny=zr(Fl()),Qc=class t{static META_REQUIRED_FIELDS=["ad_id"];static GOOGLE_REQUIRED_FIELDS=["gad_source","gclid"];source;adID;campaignID;adName;campaignName;constructor(e){this.adID=e.adID,this.campaignID=e.campaignID,this.source=e.source}static getAdParams(){let e;try{e=new Ny.URLBuilder(location.href)}catch{return{}}let r={};if(this.META_REQUIRED_FIELDS.every(i=>Array.from(e.getParams().keys()).includes(i)))return r={source:"META",adID:e.getQueryParam("ad_id")?.trim(),campaignID:e.getQueryParam("campaign_id")?.trim()},new t(r);if(this.GOOGLE_REQUIRED_FIELDS.every(i=>Array.from(e.getParams().keys()).includes(i)))return r={source:"GOOGLE"},new t(r)}};var Zc=class{isLocked=!1;queue=[];async acquire(){if(this.isLocked)await new Promise(e=>this.queue.push(e));else{this.isLocked=!0;return}}release(){if(this.queue.length>0){let e=this.queue.shift();e&&e()}else this.isLocked=!1}},el=class t{static LOCK_TIMEOUT=1e4;static RETRY_INTERVAL=200;static MAX_RETRIES=50;static async request(e,r){if(e=`__cooee_${e}_lock__`,"locks"in navigator&&!O0())try{return await D0(e,r,this.LOCK_TIMEOUT)}catch(s){w.verbose(`Web Locks API failed, falling back to localStorage: ${s}`)}let n=!1,o=0,i=Math.random().toString(36).substring(2,10);for(;o++<this.MAX_RETRIES&&(w.verbose(`Lock retry ${o} for ${e}`),n=await this.acquire(e,i,o),!n);)await this.sleep(t.RETRY_INTERVAL*o+Math.random()*100);try{return await r()}finally{this.release(e,i)}}static async acquire(e,r,n){let o=Date.now(),i=localStorage.getItem(e),s=i?JSON.parse(i):null;if(s&&o<=s.expiry)return!1;let a={owner:r,expiry:o+t.LOCK_TIMEOUT};return localStorage.setItem(e,JSON.stringify(a)),await this.sleep(150+Math.random()*100),JSON.parse(localStorage.getItem(e)||"{}").owner===r?(w.verbose(`${r}: Lock acquired for ${e} after ${n} attempts!`),!0):(w.verbose(`${r}: Race lost. Another tab acquired the lock.`),!1)}static release(e,r){let n=localStorage.getItem(e);if(!n)return;let o=JSON.parse(n);o.owner===r?(localStorage.removeItem(e),w.verbose(`${r}: Lock released`)):w.verbose(`${r}: Cannot release lock. Current owner: ${o.owner}`)}static sleep(e){return new Promise(r=>setTimeout(r,e))}};async function D0(t,e,r){return new Promise((n,o)=>{let i=setTimeout(()=>{o(new Error(`Web Locks API timeout after ${r}ms`))},r);navigator.locks.request(t,async()=>{try{let s=await e();return clearTimeout(i),n(s),s}catch(s){throw clearTimeout(i),o(s),s}}).catch(s=>{clearTimeout(i),o(s)})})}function O0(){let t=navigator.userAgent||"";return/Safari/.test(t)&&!/Chrome/.test(t)&&!/Chromium/.test(t)||/iPhone|iPad|iPod/i.test(t)&&(/(FBAV|FBAN|Instagram|Twitter|Line|WhatsApp)/i.test(t)||!window.safari?.pushNotificaTion)||/Macintosh/.test(t)&&/Safari/.test(t)&&!/Chrome/.test(t)&&!/Chromium/.test(t)&&!window.safari?.pushNotification?!0:N0()}function N0(){try{return window.safari?.pushNotification?window.safari.pushNotification.toString()==="[object SafariRemoteNotification]":!window.indexedDB||!window.localStorage}catch{return!0}}var Lp={d:(t,e)=>{for(var r in e)Lp.o(e,r)&&!Lp.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Mp={};Lp.d(Mp,{A:()=>P0,k:()=>Bp});var Ss=function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(f){try{l(n.next(f))}catch(m){i(m)}}function a(f){try{l(n.throw(f))}catch(m){i(m)}}function l(f){var m;f.done?o(f.value):(m=f.value,m instanceof r?m:new r(function(d){d(m)})).then(s,a)}l((n=n.apply(t,e||[])).next())})},Ts=function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(l){return function(f){return(function(m){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&m[0]?n.return:m[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,m[1])).done)return o;switch(n=0,o&&(m=[2&m[0],o.value]),m[0]){case 0:case 1:o=m;break;case 4:return s.label++,{value:m[1],done:!1};case 5:s.label++,n=m[1],m=[0];continue;case 7:m=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||m[0]!==6&&m[0]!==2)){s=0;continue}if(m[0]===3&&(!o||m[1]>o[0]&&m[1]<o[3])){s.label=m[1];break}if(m[0]===6&&s.label<o[1]){s.label=o[1],o=m;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(m);break}o[2]&&s.ops.pop(),s.trys.pop();continue}m=e.call(t,s)}catch(d){m=[6,d],n=0}finally{r=o=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([l,f])}}};function Bp(){return Ss(this,void 0,Promise,function(){return Ts(this,function(t){switch(t.label){case 0:return[4,new Promise(function(e,r){var n="Unknown",o=!1;function i(y){o||(o=!0,e({isPrivate:y,browserName:n}))}function s(){var y=0,C=parseInt("-1");try{C.toFixed(C)}catch(N){y=N.message.length}return y}function a(){return navigator.msSaveBlob!==void 0&&(function(y){try{return y===eval.toString().length}catch{return!1}})(39)}function l(){var y;return Ss(this,void 0,void 0,function(){var C,N;return Ts(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return A.sent(),i(!1),[3,3];case 2:return C=A.sent(),N=C,C instanceof Error&&(N=(y=C.message)!==null&&y!==void 0?y:C),typeof N!="string"?(i(!1),[2]):(i(!!N.includes("unknown transient reason")),[3,3]);case 3:return[2]}})})}function f(){var y;return Ss(this,void 0,Promise,function(){return Ts(this,function(C){switch(C.label){case 0:return((y=navigator.storage)===null||y===void 0?void 0:y.getDirectory)===void 0?[3,2]:[4,l()];case 1:return C.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var N=String(Math.random());try{var A=indexedDB.open(N,1);A.onupgradeneeded=function(B){var q=B.target.result,P=function(Q){i(Q)};try{q.createObjectStore("t",{autoIncrement:!0}).put(new Blob),P(!1)}catch(Q){(Q.message||"").includes("are not yet supported")?P(!0):P(!1)}finally{q.close(),indexedDB.deleteDatabase(N)}},A.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var N=window.openDatabase,A=window.localStorage;try{N(null,null,null,null)}catch{return void i(!0)}try{A.setItem("test","1"),A.removeItem("test")}catch{return void i(!0)}i(!1)})(),C.label=3;case 3:return[2]}})})}function m(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(y,C){var N;i(Math.round(C/1048576)<2*Math.round(((N=window).performance!==void 0&&N.performance.memory!==void 0&&N.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576))},function(y){r(new Error("detectIncognito somehow failed to query storage quota: "+y.message))})}function d(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?m():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function _(){return Ss(this,void 0,Promise,function(){var y,C;return Ts(this,function(N){switch(N.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return[3,4];N.label=1;case 1:return N.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return N.sent(),i(!1),[3,4];case 3:return y=N.sent(),typeof(C=y instanceof Error&&typeof y.message=="string"?y.message:String(y))!="string"?(i(!1),[2]):(i(C.includes("Security error")),[2]);case 4:return i(navigator.serviceWorker===void 0),[2]}})})}(function(){return Ss(this,void 0,Promise,function(){return Ts(this,function(y){switch(y.label){case 0:return s()!==44?[3,2]:(n="Safari",[4,f()]);case 1:return y.sent(),[3,6];case 2:return s()!==51?[3,3]:(C=navigator.userAgent,n=C.match(/Chrome/)?navigator.brave!==void 0?"Brave":C.match(/Edg/)?"Edge":C.match(/OPR/)?"Opera":"Chrome":"Chromium",d(),[3,6]);case 3:return s()!==25?[3,5]:(n="Firefox",[4,_()]);case 4:return y.sent(),[3,6];case 5:a()?(n="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),y.label=6;case 6:return[2]}var C})})})().catch(r)})];case 1:return[2,t.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Bp);var P0=Bp,Py=Mp.A,OH=Mp.k;var Ly=zr(Ws()),My=async()=>{let t={};try{return await L0(t)}catch(e){return ae(e,"device-properties"),t}},L0=async t=>{let e=window.CooeeSDK.uaParser;M0(t),B0(t),U0(t),t.referrer=document.referrer,t.host=location.origin,t.path=location.pathname,t.qs=location.search,t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:k0()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(t.headless=!0,Mo({headless:!0}));let r=e.getResult();return t.browser=r.browser,t.device=r.device,t.engine=r.engine,t.cpu=r.cpu,t.os=r.os,t.navigatorUA=navigator.userAgent,await Promise.all([$0(t),F0(t),V0(t)]),t},M0=t=>{let e=navigator;if(!e.deviceMemory)return;let r=e.deviceMemory;t.mem={tot:r*1024}},B0=t=>{let e=navigator,r=e.connection||e.mozConnection||e.webkitConnection;r?.effectiveType&&(t.net={type:r.effectiveType})},U0=t=>{let e=screen.orientation?.type;e&&(t.orientation=e)},k0=()=>{if(!document.body)return;let t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);let e=window.devicePixelRatio||1,r=t.offsetWidth*e;return document.body.removeChild(t),r},F0=async t=>{try{await H0(t)}catch(e){w.error("Unable to get location",e)}},H0=async t=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:"geolocation"})).state!="granted"))return new Promise(r=>{navigator.geolocation.getCurrentPosition(n=>{t.coords=[n.coords.latitude,n.coords.longitude],r()},()=>r())})},$0=async t=>{if("getBattery"in navigator)try{let r=await navigator.getBattery();t.bat={l:r.level*100,c:r.charging},Mo({"battery.level":t.bat.l,"battery.charging":t.bat.c})}catch{}},V0=async t=>{try{(await Py())?.isPrivate&&(t.incognito=!0,Mo({incognito:!0}))}catch(e){Ly.default.error("Unable to detect private/incognito window",e)}};var mo=(n=>(n[n.LOW=1]="LOW",n[n.MEDIUM=2]="MEDIUM",n[n.HIGH=3]="HIGH",n))(mo||{});function By(t){ky()}function Uy(t){if(!ky())return;let e=mo[t]?.toLowerCase();e&&(w.verbose(`Sending ${e} intent to MS Clarity`),window.clarity("set","Cooee Intent",e))}function ky(){return window.clarity&&typeof window.clarity=="function"}var lr=new _s(1),Hy="App ID or Shopify shop is not set",Up="",Bn="",kp="",tl;function $y(t){Up=t.appID,kp=t.shopifyShop,W0().then(async()=>{lr.next(!0),lr.complete()}).catch(e=>{e?.message?.includes(Hy)&&ae(e,"initiate-session",{extra:t}),w.error("Unable to initiate session",e)})}async function Vy(){return await jy(),tl}async function Wy(){let t=Date.now();await el.request("gen_did",async()=>{Bn=await Ye.get("did"),Bn||(Bn=new gt().toHexString(),await Ye.set("did",Bn)),w.info("Device ID:",Bn),qy(Bn)}),w.info(`Device ID set/get done in \u23F0 ${Tr(Date.now()-t)}`)}async function Fy(){if(tl)return;let[t,e,r]=await Promise.all([It.get("id",""),Ye.get("sessionNumber",1),It.get("landing",{})]);Gy(t,e,r)}async function W0(){await jy()}async function jy(){let t=!1;await G0()?(await j0(),t=!0):await q0()?(await Fy(),t=!0):await Fy(),t&&await Y0()}async function j0(){w.info("Starting new session"),await It.clear(),w.verbose("Cleared SessionStorage before starting new session");let t=new Date,e=new gt().toHexString(),r=await Ye.get("sessionNumber",0)+1;w.info(`New session number ${r}`);let n=Gs();await Promise.all([Ye.set("sessionNumber",r),It.set("id",e),It.set("lastUsedTime",t.getTime()),It.set("landing",n)]),Gy(e,r,n)}async function G0(){let t=await It.get("lastUsedTime",0);return t?(new Date().getTime()-t)/1e3>1800:!0}async function q0(){return!await It.get("synced",!1)}async function z0(){if(!Up&&!kp)throw new Error(Hy);let t=await My(),e=Hc();return Z(E(E({deviceID:Bn,deviceProps:t,appID:Up,shopifyShop:kp},tl),e),{sdk:$s,ad:Qc.getAdParams(),occurred:X0(fe().jsLoadTime),properties:{},uuid:await Ye.get("uuid")})}async function Y0(){w.info("Ensuring session on server"),await K0();let t=await z0();w.verbose("Request data",t);try{let e=await Yt("/v1/event/validate-session",t);w.info(`Auth finished in \u23F0 ${Tr(e.timeTakenMs)}`),await It.set("synced",!0),e.data.deviceID&&(await Ye.set("did",Bn),qy(e.data.deviceID))}catch(e){throw w.error(e),e}}async function K0(){let t=await Ye.get("firstSeen"),e=t?new Date(t):new Date;t||await Ye.set("firstSeen",e.toISOString()),Yy(e),ka("Visitor Info",{first_seen:e.toISOString()})}function Gy(t,e,r){Mo({"cooee_session.number":e}),ka("Visitor Session",{id:t,number:e,landing_page:r}),w.info(`Session number: ${e}, id: ${t}`),tl={sessionID:t,sessionNumber:e,landingPage:r}}function qy(t){By(t),zy(t);let e=`device_id_${Math.floor(Math.random()*1e4)}`;ka("Visitor Info",{device_id:t,[e]:t}),hh({id:t})}function X0(t){return(new Date().getTime()-t.getTime())/1e3>1800?new Date:t}var J0="2024-10",Q0=`/api/${J0}/graphql.json`,Ky={"Content-Type":"application/json"};async function rl(t,e,r,n){let o=ze.get().storefrontToken;if(!o)throw new Error("Storefront token not set for the store");let i=new Headers(Ky);i.append("X-Shopify-Storefront-Access-Token",o);let s=JSON.stringify({query:t,variables:e});try{return await Jr(Q0,{method:"POST",headers:i,body:s})}catch(a){throw ae(a,r,{engagementTrigger:n}),a}}function ho(t,e){return Z0(rc(t),e)}async function Z0(t,e){let r={body:JSON.stringify(e),method:"POST",headers:Ky};return Jr(t,r)}var Fp=new Zc;function Xy(){eT().catch(t=>{w.error("Fail to add attributes in cart",t)})}async function eT(){await Fp.acquire();let t=me.getCurrent(),e=await hf();if(t.attributes?.letscooee_did===e.letscooee_did&&t.attributes?.letscooee_sn===e.letscooee_sn){w.verbose("Not calling Shopify update.js API.","Current attributes:",t.attributes),Fp.release();return}try{let r=await ho("/cart/update.js",{attributes:e});w.verbose("Updated cart attributes",JSON.stringify(r.data)),t.update(r.data)}catch(r){w.error("Failed to add cart attributes",r)}Fp.release()}function Jy(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?tT():document.visibilityState==="hidden"&&rT()}}async function tT(){}async function rT(){let t=await nT();if(t===0){w.info("Not sending duration as user was inactive on website");return}Zy(t)}async function nT(){let t=fe();return t.inInactive?0:(t.inInactive=!0,t.lastEnterInactive=new Date,Math.max(t.lastEnterInactive.getTime()-t.lastEnterActive.getTime(),0))}function Qy(){let t=fe();return t.inInactive?(t.inInactive=!1,t.lastEnterActive=new Date,Math.max((t.lastEnterActive.getTime()-t.lastEnterInactive.getTime())/1e3,0)):0}function Wr(){return window.CooeeSDK?.uaParser.getDevice().type==="mobile"}function go(t,e){Object.assign(t.style,e)}function re(t,e,r){if(e){if(!r){t.style.removeProperty(e);return}t.style.setProperty(e,r,"important")}}function Hp(t){if(!t)return!1;if(t.tagName.toLowerCase()==="cart-drawer"&&t.hasAttribute("open"))return!0;let r=t.getBoundingClientRect(),n=(window.innerHeight||document.documentElement.clientHeight)+.5,o=(window.innerWidth||document.documentElement.clientWidth)+.5,i=getComputedStyle(t);if(i.display==="none"||i.visibility==="hidden"||parseFloat(i.opacity)===0||t.hidden||!(t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0))return!1;let f=Math.max(0,Math.min(r.right,o)-Math.max(r.left,0)),m=Math.max(0,Math.min(r.bottom,n)-Math.max(r.top,0)),d=f*m,_=r.width*r.height;if(!(_>0&&d/_>=.1))return!1;let C=r.top<=n&&r.bottom>=0,N=r.left<=o&&r.right>=0,A=C&&N,B=i.transform.match(/matrix\(([^)]+)\)/),q=0,P=0;if(B){let Ee=B[1].split(", ").map(parseFloat);q=Ee[4],P=Ee[5]}let Q=q+r.left>o||q+r.right<0||P+r.top>n||P+r.bottom<0;return A||!Q}var ev=t=>new Promise((e,r)=>{let n=new Image;n.onload=()=>{e({width:n.width,height:n.height})},n.onerror=r,n.src=t,n.style.display="none"});var nl=class{loadedFonts=[];async loadAllFonts(e){e.elems?.forEach(r=>{r instanceof Br&&this.loadFamily(r.typography?.fam)})}async loadFamily(e){if(!e?.fonts||this.loadedFonts.indexOf(e.name)>-1)return;let r=[];e.fonts.forEach(o=>{if(o.url){let i=new FontFace("cooee"+e.name,o.getURL(),o.getFontDescriptor());r.push(i.load())}}),this.loadedFonts.push(e.name),(await Promise.all(r)).forEach(o=>{document.fonts.add(o)})}};var av=zr(Ws());var rv=new qt,nv=new qt;function ov(){return nv.asObservable()}function ol(){rv.next()}rv.pipe(zt(100)).subscribe(cT.bind(void 0));function iv(){ol(),oT(),iT()}function oT(){let t=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){sv(this._url).catch(e=>w.error("Unable to process cart change in XMLHttpRequest",e))}),t.apply(this,arguments)},w.verbose("Securely overwritten window.XMLHttpRequest.send method")}function iT(){let t=window.fetch;window.fetch=async function(e,r){return t(e,r).then(n=>{let o="";try{o=typeof e=="string"||e instanceof URL?e.toString():e?.url??n?.url??""}catch{}return sv(o).catch(i=>w.error("Unable to process cart change in fetch",i)),n})},w.verbose("Securely overwritten window.fetch method")}async function sv(t){sT(t)&&ol()}function sT(t){return/\/cart\/(add|change|update|clear)/.test(t)}function aT(t,e){let r=t?.items,n=e.items,o=[],i=[];if(w.verbose(`Comparing cart change with old count ${r?.length} to new count ${n.length}`),n?.forEach(s=>{let a=r?.find(l=>l.vID===s.vID);if(a){if(a.quantity!==s.quantity){let l=a.quantity<s.quantity,f=Math.abs(a.quantity-s.quantity),m=Z(E({},s),{quantity:f});l?o.push(m):i.push(m)}r&&vh(r,a)}else o.push(s)}),r)for(let s of r)i.push(s);w.verbose(`Cart delta: added: ${o.length}, removed: ${i.length}`),o.length&&tv("Add To Cart",{items:o}),i.length&&t.token===e.token&&tv("Remove From Cart",{items:i}),(i.length||o.length)&&nv.next({itemsAdded:o,itemsRemoved:i,cart:e})}function tv(t,e){let r=new xe(t,e);Tt(r)}async function cT(){let t=await Ye.get("cart",{}),e=await me.getCurrent().getNormalisedCart(!0);aT(t,e)}var ot=class t{static cartDrawerToggle$=new vs({open:!1,firstOpen:!1});static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=ze.get().website??{};currentState=!1;mutationSubscription;mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;clickEventListener;refreshUIEventListener;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count",'a[onclick*="handleFloCartBtn"]'].join(",");cartSelector=[t.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize(),this.refreshUIEventListener=this.updateBubble.bind(this),this.clickEventListener=this.manualCartIconClicked.bind(this),document.addEventListener("letscooee:outbound:refresh-ui",this.refreshUIEventListener),document.addEventListener("click",this.clickEventListener,{capture:!0,passive:!0})}get element(){return this.cartDrawerElement}static get(){return t._instance||(t._instance=new t),t._instance}isOpen(){if(window.cooeeIsCartDrawerVisible)return window.cooeeIsCartDrawerVisible();if(this.cartDrawerElement?.id==="rebuy-cart")return!!window.Rebuy?.SmartCart?.visible;let e=this.inShadow?this.isPresent():Hp(this.cartDrawerElement);return w.info(`Cart drawer is currently ${e?"open":"close"}`),e}open(){if(this.isOpen()){w.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent("letscooee:outbound:open-cart"));let e=document.querySelector(this.iconSelector);if(!e){w.verbose("No clickable cart icon found with selector",this.iconSelector);return}e.click()}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===t.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(e,r=!0){if(window.cooeeUpdateCartDrawer)try{window.cooeeUpdateCartDrawer(e)}catch(n){ae(n,"execute-cooeeUpdateCartDrawer")}else if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:e}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&e)this.element.classList.remove("is-empty"),this.element.renderContents?.(e);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!e?.items?.[0])return;let n=e.items[0].id,o=e.items[0].quantity,i=e.items[0].price;window.cartGiftUpdate(n,i,o,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer&&typeof window.theme?.CartDrawer=="function")window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):window.refreshCart?me.getCurrent().getNormalisedCart(!0).then(()=>{window.refreshCart(me.getCurrent())}):window.OPEN_CART?window.OPEN_CART():window.updateCart?window.updateCart():window.sjRefreshCart?window.sjRefreshCart():window.CartJS?.getCart?window.CartJS?.getCart():window.updateCartItemJS?window.updateCartItemJS(1,e?.items?.[0]?.id+""):(w.info("No method found to update the cart drawer. Blindly firing some events to try"),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})));document.dispatchEvent(new CustomEvent("letscooee:outbound:refresh-ui",{detail:{responseJSON:e,currentCart:me.getCurrent()}})),r&&ol()}async initialize(){let e=this.configWebsite.cartDrawerSelector;if(!e){await this.findCartDrawer();return}let r=e.split(":shadow");r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!es())return;let e=this.selector||this.cartSelector;if(this.cartDrawerElement=await Sn(e),!this.cartDrawerElement){av.default.warn("Max attempts exhausted to find cart drawer");return}w.verbose("Found",this.cartDrawerElement,`from selector: ${e}`),this.createMutationObservers()}async findCartDrawerWithShadow(){if(!this.shadowParentElementSelector)return;let r=(await Sn(this.shadowParentElementSelector))?.shadowRoot;r?.mode==="open"&&(this.cartDrawerShadowElement=r,this.createMutationObservers())}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||this.watchForCartToggle()}watchForCartToggle(){let e=this.cartDrawerElement||this.cartDrawerShadowElement,r=new qt;this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(e,{attributes:!0,subtree:!0,childList:this.inShadow}),this.mutationSubscription=r.pipe(Pp(800,void 0,{leading:!1,trailing:!0})).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,t.cartDrawerToggle$.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){if(!this.selector||!this.cartDrawerShadowElement)return!1;let e=this.cartDrawerShadowElement.querySelector(this.selector);return e?Hp(e):!1}async updateBubble(){let e=(await me.getCurrent().getNormalisedCart(!0)).itemCount,r=document.querySelector(".cart-link__bubble");r&&(r.innerText=e+"")}manualCartIconClicked(e){!e.target.closest(this.iconSelector)||!e.isTrusted||window.CooeeSDK.events.push(["Open Cart"])}};var vi=class{constructor(e){this.scalingFactor=e}getLayoutStyles(e){if(!e)return{display:"block"};let r={display:e.disp};return e.of&&(r.objectFit=e.of),e.pos==="absolute"&&(r.width="auto !important",r.position="absolute",r.right=e.right+"px",r.left=e.left+"px",r.top=e.top+"px",r.bottom=e.bottom+"px"),r}getSizeStyles(e){let r={};return e?.w&&(r.width=e.w),e?.h&&(r.height=e.h),e?.maxW&&(r.maxWidth=e.maxW),e?.maxH&&(r.maxHeight=e.maxH),e?.minW&&(r.minWidth=e.minW),e?.minH&&(r.minHeight=e.minH),r}getBorderStyles(e){if(!e)return{};let r={};return e.radius&&e.radius>0&&(r.borderRadius=this.getSizePx(e.radius)),e.width&&e.width>0&&(r.borderWidth=this.getSizePx(e.width),r.borderStyle=e.style?.toLowerCase(),e.color?this.getColourStyles(e.color,"border-color",r):r.borderColor="black"),r}getFlexStyles(e){return e?{gap:e.gap+"px",flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai,width:"100%"}:{}}getSpaceStyles(e){let r={};return e?(r.paddingTop=this.getSizePx(e.pt),r.paddingBottom=this.getSizePx(e.pb),r.paddingLeft=this.getSizePx(e.pl),r.paddingRight=this.getSizePx(e.pr),r.marginTop=this.getSizePx(e.mt),r.marginBottom=this.getSizePx(e.mb),r.marginLeft=e.cent?"auto":this.getSizePx(e.ml),r.marginRight=e.cent?"auto":this.getSizePx(e.mr),r):(r.margin="0 !important",r.padding="unset",r)}getBackgroundStyles(e){if(!e)return{};let r={};if(e.glossy){let n="backdrop-filter",o="-webkit-"+n,i=`blur(${e.glossy.radius}px)`;if(!CSS.supports(o,i)&&!CSS.supports(n,i))return{background:e.glossy.fallback.rgba};if(r[o]=i,r[n]=i,e.glossy.color)return this.getColourStyles(e.glossy.color,"background",r)}else if(e.solid){if(e.solid.grad)return this.getGradientStyles(e.solid.grad,"background",r);if(e.solid.hex)return{backgroundColor:e.solid.rgba}}else if(e.img){if(!e.img.src)return{};let n=(e.img.a??0)/100;r.background=`linear-gradient(rgba(0, 0, 0, ${n}), rgba(0, 0, 0, ${n})),url("${e.img.src}") no-repeat center`,r.backgroundSize="cover",e.img.a&&(r["-webkit-backdrop-filter"]=`opacity(${e.img.a})`,r.backdropFilter=`opacity(${e.img.a})`)}return r}getGradientStyles(e,r,n){if(n??={},e.type==="LINEAR"){let o=`linear-gradient(${e.ang}deg, ${e.c1}, ${e.c2}`;e.c3&&(o+=`, ${e.c3}`),o+=")",n[r]=o}return n}getColourStyles(e,r="color",n){return n??={},e?e.grad?this.getGradientStyles(e.grad,r,n):(e.hex&&(n[r]=e.rgba),n):n}getSizePx(e){return this.getScaledSize(e)+"px"}getScaledSize(e){return(e??0)*this.scalingFactor}};var lT=`
|
|
28
|
+
`)}`:"",this.name="UnsubscriptionError",this.errors=r});function co(t,e){if(t){let r=t.indexOf(e);0<=r&&t.splice(r,1)}}var ar=class t{constructor(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let e;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let i of r)i.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(ye(n))try{n()}catch(i){e=i instanceof $c?i.errors:[i]}let{_finalizers:o}=this;if(o){this._finalizers=null;for(let i of o)try{ty(i)}catch(s){e=e??[],s instanceof $c?e=[...e,...s.errors]:e.push(s)}}if(e)throw new $c(e)}}add(e){var r;if(e&&e!==this)if(this.closed)ty(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(e)}}_hasParent(e){let{_parentage:r}=this;return r===e||Array.isArray(r)&&r.includes(e)}_addParent(e){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(e),r):r?[r,e]:e}_removeParent(e){let{_parentage:r}=this;r===e?this._parentage=null:Array.isArray(r)&&co(r,e)}remove(e){let{_finalizers:r}=this;r&&co(r,e),e instanceof t&&e._removeParent(this)}};ar.EMPTY=(()=>{let t=new ar;return t.closed=!0,t})();var Tp=ar.EMPTY;function Vc(t){return t instanceof ar||t&&"closed"in t&&ye(t.remove)&&ye(t.add)&&ye(t.unsubscribe)}function ty(t){ye(t)?t():t.unsubscribe()}var wr={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var di={setTimeout(t,e,...r){let{delegate:n}=di;return n?.setTimeout?n.setTimeout(t,e,...r):setTimeout(t,e,...r)},clearTimeout(t){let{delegate:e}=di;return(e?.clearTimeout||clearTimeout)(t)},delegate:void 0};function Wc(t){di.setTimeout(()=>{let{onUnhandledError:e}=wr;if(e)e(t);else throw t})}function Ip(){}var ry=xp("C",void 0,void 0);function ny(t){return xp("E",void 0,t)}function oy(t){return xp("N",t,void 0)}function xp(t,e,r){return{kind:t,value:e,error:r}}var lo=null;function hi(t){if(wr.useDeprecatedSynchronousErrorHandling){let e=!lo;if(e&&(lo={errorThrown:!1,error:null}),t(),e){let{errorThrown:r,error:n}=lo;if(lo=null,r)throw n}}else t()}function iy(t){wr.useDeprecatedSynchronousErrorHandling&&lo&&(lo.errorThrown=!0,lo.error=t)}var uo=class extends ar{constructor(e){super(),this.isStopped=!1,e?(this.destination=e,Vc(e)&&e.add(this)):this.destination=p0}static create(e,r,n){return new Ln(e,r,n)}next(e){this.isStopped?Rp(oy(e),this):this._next(e)}error(e){this.isStopped?Rp(ny(e),this):(this.isStopped=!0,this._error(e))}complete(){this.isStopped?Rp(ry,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(e){this.destination.next(e)}_error(e){try{this.destination.error(e)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},u0=Function.prototype.bind;function Cp(t,e){return u0.call(t,e)}var Ap=class{constructor(e){this.partialObserver=e}next(e){let{partialObserver:r}=this;if(r.next)try{r.next(e)}catch(n){jc(n)}}error(e){let{partialObserver:r}=this;if(r.error)try{r.error(e)}catch(n){jc(n)}else jc(e)}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete()}catch(r){jc(r)}}},Ln=class extends uo{constructor(e,r,n){super();let o;if(ye(e)||!e)o={next:e??void 0,error:r??void 0,complete:n??void 0};else{let i;this&&wr.useDeprecatedNextContext?(i=Object.create(e),i.unsubscribe=()=>this.unsubscribe(),o={next:e.next&&Cp(e.next,i),error:e.error&&Cp(e.error,i),complete:e.complete&&Cp(e.complete,i)}):o=e}this.destination=new Ap(o)}};function jc(t){wr.useDeprecatedSynchronousErrorHandling?iy(t):Wc(t)}function f0(t){throw t}function Rp(t,e){let{onStoppedNotification:r}=wr;r&&di.setTimeout(()=>r(t,e))}var p0={closed:!0,next:Ip,error:f0,complete:Ip};var gi=typeof Symbol=="function"&&Symbol.observable||"@@observable";function sy(t){return t}function ay(t){return t.length===0?sy:t.length===1?t[0]:function(r){return t.reduce((n,o)=>o(n),r)}}var Rt=(()=>{class t{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new t;return n.source=this,n.operator=r,n}subscribe(r,n,o){let i=d0(r)?r:new Ln(r,n,o);return hi(()=>{let{operator:s,source:a}=this;i.add(s?s.call(i,a):a?this._subscribe(i):this._trySubscribe(i))}),i}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=cy(n),new n((o,i)=>{let s=new Ln({next:a=>{try{r(a)}catch(l){i(l),s.unsubscribe()}},error:i,complete:o});this.subscribe(s)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[gi](){return this}pipe(...r){return ay(r)(this)}toPromise(r){return r=cy(r),new r((n,o)=>{let i;this.subscribe(s=>i=s,s=>o(s),()=>n(i))})}}return t.create=e=>new t(e),t})();function cy(t){var e;return(e=t??wr.Promise)!==null&&e!==void 0?e:Promise}function m0(t){return t&&ye(t.next)&&ye(t.error)&&ye(t.complete)}function d0(t){return t&&t instanceof uo||m0(t)&&Vc(t)}function h0(t){return ye(t?.lift)}function Vr(t){return e=>{if(h0(e))return e.lift(function(r){try{return t(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function cr(t,e,r,n,o){return new Dp(t,e,r,n,o)}var Dp=class extends uo{constructor(e,r,n,o,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=r?function(a){try{r(a)}catch(l){e.error(l)}}:super._next,this._error=o?function(a){try{o(a)}catch(l){e.error(l)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(a){e.error(a)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:r}=this;super.unsubscribe(),!r&&((e=this.onFinalize)===null||e===void 0||e.call(this))}}};var ly=mi(t=>function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var qt=(()=>{class t extends Rt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new Gc(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new ly}next(r){hi(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){hi(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){hi(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:o,observers:i}=this;return n||o?Tp:(this.currentObservers=null,i.push(r),new ar(()=>{this.currentObservers=null,co(i,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:o,isStopped:i}=this;n?r.error(o):i&&r.complete()}asObservable(){let r=new Rt;return r.source=this,r}}return t.create=(e,r)=>new Gc(e,r),t})(),Gc=class extends qt{constructor(e,r){super(),this.destination=e,this.source=r}next(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,e)}error(e){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,e)}complete(){var e,r;(r=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||r===void 0||r.call(e)}_subscribe(e){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(e))!==null&&n!==void 0?n:Tp}};var vs=class extends qt{constructor(e){super(),this._value=e}get value(){return this.getValue()}_subscribe(e){let r=super._subscribe(e);return!r.closed&&e.next(this._value),r}getValue(){let{hasError:e,thrownError:r,_value:n}=this;if(e)throw r;return this._throwIfClosed(),n}next(e){super.next(this._value=e)}};var Es={now(){return(Es.delegate||Date).now()},delegate:void 0};var _s=class extends qt{constructor(e=1/0,r=1/0,n=Es){super(),this._bufferSize=e,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,r)}next(e){let{isStopped:r,_buffer:n,_infiniteTimeWindow:o,_timestampProvider:i,_windowTime:s}=this;r||(n.push(e),!o&&n.push(i.now()+s)),this._trimBuffer(),super.next(e)}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let r=this._innerSubscribe(e),{_infiniteTimeWindow:n,_buffer:o}=this,i=o.slice();for(let s=0;s<i.length&&!e.closed;s+=n?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),r}_trimBuffer(){let{_bufferSize:e,_timestampProvider:r,_buffer:n,_infiniteTimeWindow:o}=this,i=(o?1:2)*e;if(e<1/0&&i<n.length&&n.splice(0,n.length-i),!o){let s=r.now(),a=0;for(let l=1;l<n.length&&n[l]<=s;l+=2)a=l;a&&n.splice(0,a+1)}}};var qc=class extends ar{constructor(e,r){super()}schedule(e,r=0){return this}};var bs={setInterval(t,e,...r){let{delegate:n}=bs;return n?.setInterval?n.setInterval(t,e,...r):setInterval(t,e,...r)},clearInterval(t){let{delegate:e}=bs;return(e?.clearInterval||clearInterval)(t)},delegate:void 0};var zc=class extends qc{constructor(e,r){super(e,r),this.scheduler=e,this.work=r,this.pending=!1}schedule(e,r=0){var n;if(this.closed)return this;this.state=e;let o=this.id,i=this.scheduler;return o!=null&&(this.id=this.recycleAsyncId(i,o,r)),this.pending=!0,this.delay=r,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(i,this.id,r),this}requestAsyncId(e,r,n=0){return bs.setInterval(e.flush.bind(e,this),n)}recycleAsyncId(e,r,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return r;r!=null&&bs.clearInterval(r)}execute(e,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let n=this._execute(e,r);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(e,r){let n=!1,o;try{this.work(e)}catch(i){n=!0,o=i||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),o}unsubscribe(){if(!this.closed){let{id:e,scheduler:r}=this,{actions:n}=r;this.work=this.state=this.scheduler=null,this.pending=!1,co(n,this),e!=null&&(this.id=this.recycleAsyncId(r,e,null)),this.delay=null,super.unsubscribe()}}};var yi=class t{constructor(e,r=t.now){this.schedulerActionCtor=e,this.now=r}schedule(e,r=0,n){return new this.schedulerActionCtor(this,e).schedule(n,r)}};yi.now=Es.now;var Yc=class extends yi{constructor(e,r=yi.now){super(e,r),this.actions=[],this._active=!1}flush(e){let{actions:r}=this;if(this._active){r.push(e);return}let n;this._active=!0;do if(n=e.execute(e.state,e.delay))break;while(e=r.shift());if(this._active=!1,n){for(;e=r.shift();)e.unsubscribe();throw n}}};var ws=new Yc(zc),uy=ws;function fy(t){return t&&ye(t.schedule)}function my(t,e,r,n){function o(i){return i instanceof r?i:new r(function(s){s(i)})}return new(r||(r=Promise))(function(i,s){function a(m){try{f(n.next(m))}catch(d){s(d)}}function l(m){try{f(n.throw(m))}catch(d){s(d)}}function f(m){m.done?i(m.value):o(m.value).then(a,l)}f((n=n.apply(t,e||[])).next())})}function py(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function fo(t){return this instanceof fo?(this.v=t,this):new fo(t)}function dy(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),a("next"),a("throw"),a("return",s),o[Symbol.asyncIterator]=function(){return this},o;function s(y){return function(C){return Promise.resolve(C).then(y,d)}}function a(y,C){n[y]&&(o[y]=function(N){return new Promise(function(A,B){i.push([y,N,A,B])>1||l(y,N)})},C&&(o[y]=C(o[y])))}function l(y,C){try{f(n[y](C))}catch(N){_(i[0][3],N)}}function f(y){y.value instanceof fo?Promise.resolve(y.value.v).then(m,d):_(i[0][2],y)}function m(y){l("next",y)}function d(y){l("throw",y)}function _(y,C){y(C),i.shift(),i.length&&l(i[0][0],i[0][1])}}function hy(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof py=="function"?py(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(s){return new Promise(function(a,l){s=t[i](s),o(a,l,s.done,s.value)})}}function o(i,s,a,l){Promise.resolve(l).then(function(f){i({value:f,done:a})},s)}}var Kc=t=>t&&typeof t.length=="number"&&typeof t!="function";function gy(t){return ye(t?.then)}function yy(t){return ye(t[gi])}function vy(t){return Symbol.asyncIterator&&ye(t?.[Symbol.asyncIterator])}function Ey(t){return new TypeError(`You provided ${t!==null&&typeof t=="object"?"an invalid object":`'${t}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function g0(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var _y=g0();function by(t){return ye(t?.[_y])}function wy(t){return dy(this,arguments,function*(){let r=t.getReader();try{for(;;){let{value:n,done:o}=yield fo(r.read());if(o)return yield fo(void 0);yield yield fo(n)}}finally{r.releaseLock()}})}function Sy(t){return ye(t?.getReader)}function Mn(t){if(t instanceof Rt)return t;if(t!=null){if(yy(t))return y0(t);if(Kc(t))return v0(t);if(gy(t))return E0(t);if(vy(t))return Ty(t);if(by(t))return _0(t);if(Sy(t))return b0(t)}throw Ey(t)}function y0(t){return new Rt(e=>{let r=t[gi]();if(ye(r.subscribe))return r.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function v0(t){return new Rt(e=>{for(let r=0;r<t.length&&!e.closed;r++)e.next(t[r]);e.complete()})}function E0(t){return new Rt(e=>{t.then(r=>{e.closed||(e.next(r),e.complete())},r=>e.error(r)).then(null,Wc)})}function _0(t){return new Rt(e=>{for(let r of t)if(e.next(r),e.closed)return;e.complete()})}function Ty(t){return new Rt(e=>{w0(t,e).catch(r=>e.error(r))})}function b0(t){return Ty(wy(t))}function w0(t,e){var r,n,o,i;return my(this,void 0,void 0,function*(){try{for(r=hy(t);n=yield r.next(),!n.done;){let s=n.value;if(e.next(s),e.closed)return}}catch(s){o={error:s}}finally{try{n&&!n.done&&(i=r.return)&&(yield i.call(r))}finally{if(o)throw o.error}}e.complete()})}function Iy(t,e,r,n=0,o=!1){let i=e.schedule(function(){r(),o?t.add(this.schedule(null,n)):this.unsubscribe()},n);if(t.add(i),!o)return i}var xy=mi(t=>function(){t(this),this.name="EmptyError",this.message="no elements in sequence"});function Sr(t,e){let r=typeof e=="object";return new Promise((n,o)=>{let i=new Ln({next:s=>{n(s),i.unsubscribe()},error:o,complete:()=>{r?n(e.defaultValue):o(new xy)}});t.subscribe(i)})}function Cy(t){return t instanceof Date&&!isNaN(t)}function un(t,e){return Vr((r,n)=>{let o=0;r.subscribe(cr(n,i=>{n.next(t.call(e,i,o++))}))})}var{isArray:S0}=Array;function T0(t,e){return S0(e)?t(...e):t(e)}function Xc(t){return un(e=>T0(t,e))}function Ry(t,e,r,n,o,i,s,a){let l=[],f=0,m=0,d=!1,_=()=>{d&&!l.length&&!f&&e.complete()},y=N=>f<n?C(N):l.push(N),C=N=>{i&&e.next(N),f++;let A=!1;Mn(r(N,m++)).subscribe(cr(e,B=>{o?.(B),i?y(B):e.next(B)},()=>{A=!0},void 0,()=>{if(A)try{for(f--;l.length&&f<n;){let B=l.shift();s?Iy(e,s,()=>C(B)):C(B)}_()}catch(B){e.error(B)}}))};return t.subscribe(cr(e,y,()=>{d=!0,_()})),()=>{a?.()}}function Op(t,e,r=1/0){return ye(e)?Op((n,o)=>un((i,s)=>e(n,i,o,s))(Mn(t(n,o))),r):(typeof e=="number"&&(r=e),Vr((n,o)=>Ry(n,o,t,r)))}var I0=["addListener","removeListener"],x0=["addEventListener","removeEventListener"],C0=["on","off"];function po(t,e,r,n){if(ye(r)&&(n=r,r=void 0),n)return po(t,e,r).pipe(Xc(n));let[o,i]=D0(t)?x0.map(s=>a=>t[s](e,a,r)):R0(t)?I0.map(Ay(t,e)):A0(t)?C0.map(Ay(t,e)):[];if(!o&&Kc(t))return Op(s=>po(s,e,r))(Mn(t));if(!o)throw new TypeError("Invalid event target");return new Rt(s=>{let a=(...l)=>s.next(1<l.length?l:l[0]);return o(a),()=>i(a)})}function Ay(t,e){return r=>n=>t[r](e,n)}function R0(t){return ye(t.addListener)&&ye(t.removeListener)}function A0(t){return ye(t.on)&&ye(t.off)}function D0(t){return ye(t.addEventListener)&&ye(t.removeEventListener)}function Jc(t,e,r){return r?Jc(t,e).pipe(Xc(r)):new Rt(n=>{let o=(...s)=>n.next(s.length===1?s[0]:s),i=t(o);return ye(e)?()=>e(o,i):void 0})}function Dy(t=0,e,r=uy){let n=-1;return e!=null&&(fy(e)?r=e:n=e),new Rt(o=>{let i=Cy(t)?+t-r.now():t;i<0&&(i=0);let s=0;return r.schedule(function(){o.closed||(o.next(s++),0<=n?this.schedule(void 0,n):o.complete())},i)})}function Np(t,e){return Vr((r,n)=>{let o=0;r.subscribe(cr(n,i=>t.call(e,i,o++)&&n.next(i)))})}function zt(t,e=ws){return Vr((r,n)=>{let o=null,i=null,s=null,a=()=>{if(o){o.unsubscribe(),o=null;let f=i;i=null,n.next(f)}};function l(){let f=s+t,m=e.now();if(m<f){o=this.schedule(void 0,f-m),n.add(o);return}a()}r.subscribe(cr(n,f=>{i=f,s=e.now(),o||(o=e.schedule(l,t),n.add(o))},()=>{a(),n.complete()},void 0,()=>{i=o=null}))})}function Oy(t,e){return Vr((r,n)=>{let{leading:o=!0,trailing:i=!1}=e??{},s=!1,a=null,l=null,f=!1,m=()=>{l?.unsubscribe(),l=null,i&&(y(),f&&n.complete())},d=()=>{l=null,f&&n.complete()},_=C=>l=Mn(t(C)).subscribe(cr(n,m,d)),y=()=>{if(s){s=!1;let C=a;a=null,n.next(C),!f&&_(C)}};r.subscribe(cr(n,C=>{s=!0,a=C,!(l&&!l.closed)&&(o?y():_(C))},()=>{f=!0,!(i&&s&&l&&!l.closed)&&n.complete()}))})}function Pp(t,e=ws,r){let n=Dy(t,e);return Oy(()=>n,r)}var Ny=zr(Fl()),Qc=class t{static META_REQUIRED_FIELDS=["ad_id"];static GOOGLE_REQUIRED_FIELDS=["gad_source","gclid"];source;adID;campaignID;adName;campaignName;constructor(e){this.adID=e.adID,this.campaignID=e.campaignID,this.source=e.source}static getAdParams(){let e;try{e=new Ny.URLBuilder(location.href)}catch{return{}}let r={};if(this.META_REQUIRED_FIELDS.every(i=>Array.from(e.getParams().keys()).includes(i)))return r={source:"META",adID:e.getQueryParam("ad_id")?.trim(),campaignID:e.getQueryParam("campaign_id")?.trim()},new t(r);if(this.GOOGLE_REQUIRED_FIELDS.every(i=>Array.from(e.getParams().keys()).includes(i)))return r={source:"GOOGLE"},new t(r)}};var Zc=class{isLocked=!1;queue=[];async acquire(){if(this.isLocked)await new Promise(e=>this.queue.push(e));else{this.isLocked=!0;return}}release(){if(this.queue.length>0){let e=this.queue.shift();e&&e()}else this.isLocked=!1}},el=class t{static LOCK_TIMEOUT=1e4;static RETRY_INTERVAL=200;static MAX_RETRIES=50;static async request(e,r){if(e=`__cooee_${e}_lock__`,"locks"in navigator&&!N0())try{return await O0(e,r,this.LOCK_TIMEOUT)}catch(s){b.verbose(`Web Locks API failed, falling back to localStorage: ${s}`)}let n=!1,o=0,i=Math.random().toString(36).substring(2,10);for(;o++<this.MAX_RETRIES&&(b.verbose(`Lock retry ${o} for ${e}`),n=await this.acquire(e,i,o),!n);)await this.sleep(t.RETRY_INTERVAL*o+Math.random()*100);try{return await r()}finally{this.release(e,i)}}static async acquire(e,r,n){let o=Date.now(),i=localStorage.getItem(e),s=i?JSON.parse(i):null;if(s&&o<=s.expiry)return!1;let a={owner:r,expiry:o+t.LOCK_TIMEOUT};return localStorage.setItem(e,JSON.stringify(a)),await this.sleep(150+Math.random()*100),JSON.parse(localStorage.getItem(e)||"{}").owner===r?(b.verbose(`${r}: Lock acquired for ${e} after ${n} attempts!`),!0):(b.verbose(`${r}: Race lost. Another tab acquired the lock.`),!1)}static release(e,r){let n=localStorage.getItem(e);if(!n)return;let o=JSON.parse(n);o.owner===r?(localStorage.removeItem(e),b.verbose(`${r}: Lock released`)):b.verbose(`${r}: Cannot release lock. Current owner: ${o.owner}`)}static sleep(e){return new Promise(r=>setTimeout(r,e))}};async function O0(t,e,r){return new Promise((n,o)=>{let i=setTimeout(()=>{o(new Error(`Web Locks API timeout after ${r}ms`))},r);navigator.locks.request(t,async()=>{try{let s=await e();return clearTimeout(i),n(s),s}catch(s){throw clearTimeout(i),o(s),s}}).catch(s=>{clearTimeout(i),o(s)})})}function N0(){let t=navigator.userAgent||"";return/Safari/.test(t)&&!/Chrome/.test(t)&&!/Chromium/.test(t)||/iPhone|iPad|iPod/i.test(t)&&(/(FBAV|FBAN|Instagram|Twitter|Line|WhatsApp)/i.test(t)||!window.safari?.pushNotificaTion)||/Macintosh/.test(t)&&/Safari/.test(t)&&!/Chrome/.test(t)&&!/Chromium/.test(t)&&!window.safari?.pushNotification?!0:P0()}function P0(){try{return window.safari?.pushNotification?window.safari.pushNotification.toString()==="[object SafariRemoteNotification]":!window.indexedDB||!window.localStorage}catch{return!0}}var Lp={d:(t,e)=>{for(var r in e)Lp.o(e,r)&&!Lp.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},Mp={};Lp.d(Mp,{A:()=>L0,k:()=>Bp});var Ss=function(t,e,r,n){return new(r||(r=Promise))(function(o,i){function s(f){try{l(n.next(f))}catch(m){i(m)}}function a(f){try{l(n.throw(f))}catch(m){i(m)}}function l(f){var m;f.done?o(f.value):(m=f.value,m instanceof r?m:new r(function(d){d(m)})).then(s,a)}l((n=n.apply(t,e||[])).next())})},Ts=function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function a(l){return function(f){return(function(m){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&m[0]?n.return:m[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,m[1])).done)return o;switch(n=0,o&&(m=[2&m[0],o.value]),m[0]){case 0:case 1:o=m;break;case 4:return s.label++,{value:m[1],done:!1};case 5:s.label++,n=m[1],m=[0];continue;case 7:m=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||m[0]!==6&&m[0]!==2)){s=0;continue}if(m[0]===3&&(!o||m[1]>o[0]&&m[1]<o[3])){s.label=m[1];break}if(m[0]===6&&s.label<o[1]){s.label=o[1],o=m;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(m);break}o[2]&&s.ops.pop(),s.trys.pop();continue}m=e.call(t,s)}catch(d){m=[6,d],n=0}finally{r=o=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([l,f])}}};function Bp(){return Ss(this,void 0,Promise,function(){return Ts(this,function(t){switch(t.label){case 0:return[4,new Promise(function(e,r){var n="Unknown",o=!1;function i(y){o||(o=!0,e({isPrivate:y,browserName:n}))}function s(){var y=0,C=parseInt("-1");try{C.toFixed(C)}catch(N){y=N.message.length}return y}function a(){return navigator.msSaveBlob!==void 0&&(function(y){try{return y===eval.toString().length}catch{return!1}})(39)}function l(){var y;return Ss(this,void 0,void 0,function(){var C,N;return Ts(this,function(A){switch(A.label){case 0:return A.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return A.sent(),i(!1),[3,3];case 2:return C=A.sent(),N=C,C instanceof Error&&(N=(y=C.message)!==null&&y!==void 0?y:C),typeof N!="string"?(i(!1),[2]):(i(!!N.includes("unknown transient reason")),[3,3]);case 3:return[2]}})})}function f(){var y;return Ss(this,void 0,Promise,function(){return Ts(this,function(C){switch(C.label){case 0:return((y=navigator.storage)===null||y===void 0?void 0:y.getDirectory)===void 0?[3,2]:[4,l()];case 1:return C.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var N=String(Math.random());try{var A=indexedDB.open(N,1);A.onupgradeneeded=function(B){var q=B.target.result,P=function(Q){i(Q)};try{q.createObjectStore("t",{autoIncrement:!0}).put(new Blob),P(!1)}catch(Q){(Q.message||"").includes("are not yet supported")?P(!0):P(!1)}finally{q.close(),indexedDB.deleteDatabase(N)}},A.onerror=function(){return i(!1)}}catch{i(!1)}})():(function(){var N=window.openDatabase,A=window.localStorage;try{N(null,null,null,null)}catch{return void i(!0)}try{A.setItem("test","1"),A.removeItem("test")}catch{return void i(!0)}i(!1)})(),C.label=3;case 3:return[2]}})})}function m(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(y,C){var N;i(Math.round(C/1048576)<2*Math.round(((N=window).performance!==void 0&&N.performance.memory!==void 0&&N.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576))},function(y){r(new Error("detectIncognito somehow failed to query storage quota: "+y.message))})}function d(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?m():(0,window.webkitRequestFileSystem)(0,1,function(){i(!1)},function(){i(!0)})}function _(){return Ss(this,void 0,Promise,function(){var y,C;return Ts(this,function(N){switch(N.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return[3,4];N.label=1;case 1:return N.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return N.sent(),i(!1),[3,4];case 3:return y=N.sent(),typeof(C=y instanceof Error&&typeof y.message=="string"?y.message:String(y))!="string"?(i(!1),[2]):(i(C.includes("Security error")),[2]);case 4:return i(navigator.serviceWorker===void 0),[2]}})})}(function(){return Ss(this,void 0,Promise,function(){return Ts(this,function(y){switch(y.label){case 0:return s()!==44?[3,2]:(n="Safari",[4,f()]);case 1:return y.sent(),[3,6];case 2:return s()!==51?[3,3]:(C=navigator.userAgent,n=C.match(/Chrome/)?navigator.brave!==void 0?"Brave":C.match(/Edg/)?"Edge":C.match(/OPR/)?"Opera":"Chrome":"Chromium",d(),[3,6]);case 3:return s()!==25?[3,5]:(n="Firefox",[4,_()]);case 4:return y.sent(),[3,6];case 5:a()?(n="Internet Explorer",i(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),y.label=6;case 6:return[2]}var C})})})().catch(r)})];case 1:return[2,t.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Bp);var L0=Bp,Py=Mp.A,NH=Mp.k;var Ly=zr(Ws()),My=async()=>{let t={};try{return await M0(t)}catch(e){return ae(e,"device-properties"),t}},M0=async t=>{let e=window.CooeeSDK.uaParser;B0(t),U0(t),k0(t),t.referrer=document.referrer,t.host=location.origin,t.path=location.pathname,t.qs=location.search,t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:F0()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(t.headless=!0,Mo({headless:!0}));let r=e.getResult();return t.browser=r.browser,t.device=r.device,t.engine=r.engine,t.cpu=r.cpu,t.os=r.os,t.navigatorUA=navigator.userAgent,await Promise.all([V0(t),H0(t),W0(t)]),t},B0=t=>{let e=navigator;if(!e.deviceMemory)return;let r=e.deviceMemory;t.mem={tot:r*1024}},U0=t=>{let e=navigator,r=e.connection||e.mozConnection||e.webkitConnection;r?.effectiveType&&(t.net={type:r.effectiveType})},k0=t=>{let e=screen.orientation?.type;e&&(t.orientation=e)},F0=()=>{if(!document.body)return;let t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);let e=window.devicePixelRatio||1,r=t.offsetWidth*e;return document.body.removeChild(t),r},H0=async t=>{try{await $0(t)}catch(e){b.error("Unable to get location",e)}},$0=async t=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:"geolocation"})).state!="granted"))return new Promise(r=>{navigator.geolocation.getCurrentPosition(n=>{t.coords=[n.coords.latitude,n.coords.longitude],r()},()=>r())})},V0=async t=>{if("getBattery"in navigator)try{let r=await navigator.getBattery();t.bat={l:r.level*100,c:r.charging},Mo({"battery.level":t.bat.l,"battery.charging":t.bat.c})}catch{}},W0=async t=>{try{(await Py())?.isPrivate&&(t.incognito=!0,Mo({incognito:!0}))}catch(e){Ly.default.error("Unable to detect private/incognito window",e)}};var mo=(n=>(n[n.LOW=1]="LOW",n[n.MEDIUM=2]="MEDIUM",n[n.HIGH=3]="HIGH",n))(mo||{});function By(t){ky()}function Uy(t){if(!ky())return;let e=mo[t]?.toLowerCase();e&&(b.verbose(`Sending ${e} intent to MS Clarity`),window.clarity("set","Cooee Intent",e))}function ky(){return window.clarity&&typeof window.clarity=="function"}var lr=new _s(1),Hy="App ID or Shopify shop is not set",Up="",Bn="",kp="",tl;function $y(t){Up=t.appID,kp=t.shopifyShop,j0().then(async()=>{lr.next(!0),lr.complete()}).catch(e=>{e?.message?.includes(Hy)&&ae(e,"initiate-session",{extra:t}),b.error("Unable to initiate session",e)})}async function Vy(){return await jy(),tl}async function Wy(){let t=Date.now();await el.request("gen_did",async()=>{Bn=await Ye.get("did"),Bn||(Bn=new gt().toHexString(),await Ye.set("did",Bn)),b.info("Device ID:",Bn),qy(Bn)}),b.info(`Device ID set/get done in \u23F0 ${Tr(Date.now()-t)}`)}async function Fy(){if(tl)return;let[t,e,r]=await Promise.all([It.get("id",""),Ye.get("sessionNumber",1),It.get("landing",{})]);Gy(t,e,r)}async function j0(){await jy()}async function jy(){let t=!1;await q0()?(await G0(),t=!0):await z0()?(await Fy(),t=!0):await Fy(),t&&await K0()}async function G0(){b.info("Starting new session"),await It.clear(),b.verbose("Cleared SessionStorage before starting new session");let t=new Date,e=new gt().toHexString(),r=await Ye.get("sessionNumber",0)+1;b.info(`New session number ${r}`);let n=Gs();await Promise.all([Ye.set("sessionNumber",r),It.set("id",e),It.set("lastUsedTime",t.getTime()),It.set("landing",n)]),Gy(e,r,n)}async function q0(){let t=await It.get("lastUsedTime",0);return t?(new Date().getTime()-t)/1e3>1800:!0}async function z0(){return!await It.get("synced",!1)}async function Y0(){if(!Up&&!kp)throw new Error(Hy);let t=await My(),e=Hc();return Z(E(E({deviceID:Bn,deviceProps:t,appID:Up,shopifyShop:kp},tl),e),{sdk:$s,ad:Qc.getAdParams(),occurred:J0(fe().jsLoadTime),properties:{},uuid:await Ye.get("uuid")})}async function K0(){b.info("Ensuring session on server"),await X0();let t=await Y0();b.verbose("Request data",t);try{let e=await Yt("/v1/event/validate-session",t);b.info(`Auth finished in \u23F0 ${Tr(e.timeTakenMs)}`),await It.set("synced",!0),e.data.deviceID&&(await Ye.set("did",Bn),qy(e.data.deviceID))}catch(e){throw b.error(e),e}}async function X0(){let t=await Ye.get("firstSeen"),e=t?new Date(t):new Date;t||await Ye.set("firstSeen",e.toISOString()),Yy(e),ka("Visitor Info",{first_seen:e.toISOString()})}function Gy(t,e,r){Mo({"cooee_session.number":e}),ka("Visitor Session",{id:t,number:e,landing_page:r}),b.info(`Session number: ${e}, id: ${t}`),tl={sessionID:t,sessionNumber:e,landingPage:r}}function qy(t){By(t),zy(t);let e=`device_id_${Math.floor(Math.random()*1e4)}`;ka("Visitor Info",{device_id:t,[e]:t}),hh({id:t})}function J0(t){return(new Date().getTime()-t.getTime())/1e3>1800?new Date:t}var Q0="2024-10",Z0=`/api/${Q0}/graphql.json`,Ky={"Content-Type":"application/json"};async function rl(t,e,r,n){let o=ze.get().storefrontToken;if(!o)throw new Error("Storefront token not set for the store");let i=new Headers(Ky);i.append("X-Shopify-Storefront-Access-Token",o);let s=JSON.stringify({query:t,variables:e});try{return await Jr(Z0,{method:"POST",headers:i,body:s})}catch(a){throw ae(a,r,{engagementTrigger:n}),a}}function ho(t,e){return eT(rc(t),e)}async function eT(t,e){let r={body:JSON.stringify(e),method:"POST",headers:Ky};return Jr(t,r)}var Fp=new Zc;function Xy(){tT().catch(t=>{b.error("Fail to add attributes in cart",t)})}async function tT(){await Fp.acquire();let t=me.getCurrent(),e=await hf();if(t.attributes?.letscooee_did===e.letscooee_did&&t.attributes?.letscooee_sn===e.letscooee_sn){b.verbose("Not calling Shopify update.js API.","Current attributes:",t.attributes),Fp.release();return}try{let r=await ho("/cart/update.js",{attributes:e});b.verbose("Updated cart attributes",JSON.stringify(r.data)),t.update(r.data)}catch(r){b.error("Failed to add cart attributes",r)}Fp.release()}function Jy(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?rT():document.visibilityState==="hidden"&&nT()}}async function rT(){}async function nT(){let t=await oT();if(t===0){b.info("Not sending duration as user was inactive on website");return}Zy(t)}async function oT(){let t=fe();return t.inInactive?0:(t.inInactive=!0,t.lastEnterInactive=new Date,Math.max(t.lastEnterInactive.getTime()-t.lastEnterActive.getTime(),0))}function Qy(){let t=fe();return t.inInactive?(t.inInactive=!1,t.lastEnterActive=new Date,Math.max((t.lastEnterActive.getTime()-t.lastEnterInactive.getTime())/1e3,0)):0}function Wr(){return window.CooeeSDK?.uaParser.getDevice().type==="mobile"}function go(t,e){Object.assign(t.style,e)}function re(t,e,r){if(e){if(!r){t.style.removeProperty(e);return}t.style.setProperty(e,r,"important")}}function Hp(t){if(!t)return!1;if(t.tagName.toLowerCase()==="cart-drawer"&&t.hasAttribute("open"))return!0;let r=t.getBoundingClientRect(),n=(window.innerHeight||document.documentElement.clientHeight)+.5,o=(window.innerWidth||document.documentElement.clientWidth)+.5,i=getComputedStyle(t);if(i.display==="none"||i.visibility==="hidden"||parseFloat(i.opacity)===0||t.hidden||!(t.offsetWidth>0||t.offsetHeight>0||t.getClientRects().length>0))return!1;let f=Math.max(0,Math.min(r.right,o)-Math.max(r.left,0)),m=Math.max(0,Math.min(r.bottom,n)-Math.max(r.top,0)),d=f*m,_=r.width*r.height;if(!(_>0&&d/_>=.1))return!1;let C=r.top<=n&&r.bottom>=0,N=r.left<=o&&r.right>=0,A=C&&N,B=i.transform.match(/matrix\(([^)]+)\)/),q=0,P=0;if(B){let Ee=B[1].split(", ").map(parseFloat);q=Ee[4],P=Ee[5]}let Q=q+r.left>o||q+r.right<0||P+r.top>n||P+r.bottom<0;return A||!Q}var ev=t=>new Promise((e,r)=>{let n=new Image;n.onload=()=>{e({width:n.width,height:n.height})},n.onerror=r,n.src=t,n.style.display="none"});var nl=class{loadedFonts=[];async loadAllFonts(e){e.elems?.forEach(r=>{r instanceof Br&&this.loadFamily(r.typography?.fam)})}async loadFamily(e){if(!e?.fonts||this.loadedFonts.indexOf(e.name)>-1)return;let r=[];e.fonts.forEach(o=>{if(o.url){let i=new FontFace("cooee"+e.name,o.getURL(),o.getFontDescriptor());r.push(i.load())}}),this.loadedFonts.push(e.name),(await Promise.all(r)).forEach(o=>{document.fonts.add(o)})}};var av=zr(Ws());var rv=new qt,nv=new qt;function ov(){return nv.asObservable()}function ol(){rv.next()}rv.pipe(zt(100)).subscribe(lT.bind(void 0));function iv(){ol(),iT(),sT()}function iT(){let t=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){sv(this._url).catch(e=>b.error("Unable to process cart change in XMLHttpRequest",e))}),t.apply(this,arguments)},b.verbose("Securely overwritten window.XMLHttpRequest.send method")}function sT(){let t=window.fetch;window.fetch=async function(e,r){return t(e,r).then(n=>{let o="";try{o=typeof e=="string"||e instanceof URL?e.toString():e?.url??n?.url??""}catch{}return sv(o).catch(i=>b.error("Unable to process cart change in fetch",i)),n})},b.verbose("Securely overwritten window.fetch method")}async function sv(t){aT(t)&&ol()}function aT(t){return/\/cart\/(add|change|update|clear)/.test(t)}function cT(t,e){let r=t?.items,n=e.items,o=[],i=[];if(b.verbose(`Comparing cart change with old count ${r?.length} to new count ${n.length}`),n?.forEach(s=>{let a=r?.find(l=>l.vID===s.vID);if(a){if(a.quantity!==s.quantity){let l=a.quantity<s.quantity,f=Math.abs(a.quantity-s.quantity),m=Z(E({},s),{quantity:f});l?o.push(m):i.push(m)}r&&vh(r,a)}else o.push(s)}),r)for(let s of r)i.push(s);b.verbose(`Cart delta: added: ${o.length}, removed: ${i.length}`),o.length&&tv("Add To Cart",{items:o}),i.length&&t.token===e.token&&tv("Remove From Cart",{items:i}),(i.length||o.length)&&nv.next({itemsAdded:o,itemsRemoved:i,cart:e})}function tv(t,e){let r=new xe(t,e);Tt(r)}async function lT(){let t=await Ye.get("cart",{}),e=await me.getCurrent().getNormalisedCart(!0);cT(t,e)}var ot=class t{static cartDrawerToggle$=new vs({open:!1,firstOpen:!1});static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=ze.get().website??{};currentState=!1;mutationSubscription;mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;clickEventListener;refreshUIEventListener;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count",'a[onclick*="handleFloCartBtn"]'].join(",");cartSelector=[t.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize(),this.refreshUIEventListener=this.updateBubble.bind(this),this.clickEventListener=this.manualCartIconClicked.bind(this),document.addEventListener("letscooee:outbound:refresh-ui",this.refreshUIEventListener),document.addEventListener("click",this.clickEventListener,{capture:!0,passive:!0})}get element(){return this.cartDrawerElement}static get(){return t._instance||(t._instance=new t),t._instance}isOpen(){if(window.cooeeIsCartDrawerVisible)return window.cooeeIsCartDrawerVisible();if(this.cartDrawerElement?.id==="rebuy-cart")return!!window.Rebuy?.SmartCart?.visible;let e=this.inShadow?this.isPresent():Hp(this.cartDrawerElement);return b.info(`Cart drawer is currently ${e?"open":"close"}`),e}open(){if(this.isOpen()){b.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent("letscooee:outbound:open-cart"));let e=document.querySelector(this.iconSelector);if(!e){b.verbose("No clickable cart icon found with selector",this.iconSelector);return}e.click()}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===t.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(e,r=!0){if(window.cooeeUpdateCartDrawer)try{window.cooeeUpdateCartDrawer(e)}catch(n){ae(n,"execute-cooeeUpdateCartDrawer")}else if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:e}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&e)this.element.classList.remove("is-empty"),this.element.renderContents?.(e);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!e?.items?.[0])return;let n=e.items[0].id,o=e.items[0].quantity,i=e.items[0].price;window.cartGiftUpdate(n,i,o,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer&&typeof window.theme?.CartDrawer=="function")window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):window.refreshCart?me.getCurrent().getNormalisedCart(!0).then(()=>{window.refreshCart(me.getCurrent())}):window.OPEN_CART?window.OPEN_CART():window.updateCart?window.updateCart():window.sjRefreshCart?window.sjRefreshCart():window.CartJS?.getCart?window.CartJS?.getCart():window.updateCartItemJS?window.updateCartItemJS(1,e?.items?.[0]?.id+""):(b.info("No method found to update the cart drawer. Blindly firing some events to try"),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})));document.dispatchEvent(new CustomEvent("letscooee:outbound:refresh-ui",{detail:{responseJSON:e,currentCart:me.getCurrent()}})),r&&ol()}async initialize(){let e=this.configWebsite.cartDrawerSelector;if(!e){await this.findCartDrawer();return}let r=e.split(":shadow");r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!es())return;let e=this.selector||this.cartSelector;if(this.cartDrawerElement=await Sn(e),!this.cartDrawerElement){av.default.warn("Max attempts exhausted to find cart drawer");return}b.verbose("Found",this.cartDrawerElement,`from selector: ${e}`),this.createMutationObservers()}async findCartDrawerWithShadow(){if(!this.shadowParentElementSelector)return;let r=(await Sn(this.shadowParentElementSelector))?.shadowRoot;r?.mode==="open"&&(this.cartDrawerShadowElement=r,this.createMutationObservers())}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||this.watchForCartToggle()}watchForCartToggle(){let e=this.cartDrawerElement||this.cartDrawerShadowElement,r=new qt;this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(e,{attributes:!0,subtree:!0,childList:this.inShadow}),this.mutationSubscription=r.pipe(Pp(800,void 0,{leading:!1,trailing:!0})).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,t.cartDrawerToggle$.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){if(!this.selector||!this.cartDrawerShadowElement)return!1;let e=this.cartDrawerShadowElement.querySelector(this.selector);return e?Hp(e):!1}async updateBubble(){let e=(await me.getCurrent().getNormalisedCart(!0)).itemCount,r=document.querySelector(".cart-link__bubble");r&&(r.innerText=e+"")}manualCartIconClicked(e){!e.target.closest(this.iconSelector)||!e.isTrusted||window.CooeeSDK.events.push(["Open Cart"])}};var vi=class{constructor(e){this.scalingFactor=e}getLayoutStyles(e){if(!e)return{display:"block"};let r={display:e.disp};return e.of&&(r.objectFit=e.of),e.pos==="absolute"&&(r.width="auto !important",r.position="absolute",r.right=e.right+"px",r.left=e.left+"px",r.top=e.top+"px",r.bottom=e.bottom+"px"),r}getSizeStyles(e){let r={};return e?.w&&(r.width=e.w),e?.h&&(r.height=e.h),e?.maxW&&(r.maxWidth=e.maxW),e?.maxH&&(r.maxHeight=e.maxH),e?.minW&&(r.minWidth=e.minW),e?.minH&&(r.minHeight=e.minH),r}getBorderStyles(e){if(!e)return{};let r={};return e.radius&&e.radius>0&&(r.borderRadius=this.getSizePx(e.radius)),e.width&&e.width>0&&(r.borderWidth=this.getSizePx(e.width),r.borderStyle=e.style?.toLowerCase(),e.color?this.getColourStyles(e.color,"border-color",r):r.borderColor="black"),r}getFlexStyles(e){return e?{gap:e.gap+"px",flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai,width:"100%"}:{}}getSpaceStyles(e){let r={};return e?(r.paddingTop=this.getSizePx(e.pt),r.paddingBottom=this.getSizePx(e.pb),r.paddingLeft=this.getSizePx(e.pl),r.paddingRight=this.getSizePx(e.pr),r.marginTop=this.getSizePx(e.mt),r.marginBottom=this.getSizePx(e.mb),r.marginLeft=e.cent?"auto":this.getSizePx(e.ml),r.marginRight=e.cent?"auto":this.getSizePx(e.mr),r):(r.margin="0 !important",r.padding="unset",r)}getBackgroundStyles(e){if(!e)return{};let r={};if(e.glossy){let n="backdrop-filter",o="-webkit-"+n,i=`blur(${e.glossy.radius}px)`;if(!CSS.supports(o,i)&&!CSS.supports(n,i))return{background:e.glossy.fallback.rgba};if(r[o]=i,r[n]=i,e.glossy.color)return this.getColourStyles(e.glossy.color,"background",r)}else if(e.solid){if(e.solid.grad)return this.getGradientStyles(e.solid.grad,"background",r);if(e.solid.hex)return{backgroundColor:e.solid.rgba}}else if(e.img){if(!e.img.src)return{};let n=(e.img.a??0)/100;r.background=`linear-gradient(rgba(0, 0, 0, ${n}), rgba(0, 0, 0, ${n})),url("${e.img.src}") no-repeat center`,r.backgroundSize="cover",e.img.a&&(r["-webkit-backdrop-filter"]=`opacity(${e.img.a})`,r.backdropFilter=`opacity(${e.img.a})`)}return r}getGradientStyles(e,r,n){if(n??={},e.type==="LINEAR"){let o=`linear-gradient(${e.ang}deg, ${e.c1}, ${e.c2}`;e.c3&&(o+=`, ${e.c3}`),o+=")",n[r]=o}return n}getColourStyles(e,r="color",n){return n??={},e?e.grad?this.getGradientStyles(e.grad,r,n):(e.hex&&(n[r]=e.rgba),n):n}getSizePx(e){return this.getScaledSize(e)+"px"}getScaledSize(e){return(e??0)*this.scalingFactor}};var uT=`
|
|
29
29
|
mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
|
|
30
30
|
cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
|
|
31
31
|
cart {
|
|
@@ -37,7 +37,7 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
`,Un=class{static navigate(e,r,n){let o=`${location.origin}/discount/${e}`;switch(
|
|
40
|
+
`,Un=class{static navigate(e,r,n){let o=`${location.origin}/discount/${e}`;switch(b.log(`Applying discount code ${e}`,r,n),r){case Qt.CART_PAGE:location.href=`${o}?redirect=/cart`;break;case Qt.CART_DRAWER:location.href=`${o}?redirect=${location.pathname}#open-cart-drawer=1`;break;case Qt.SHOPIFY_CHECKOUT:location.href=`${o}?redirect=/checkout`;break;case Qt.THIRD_PARTY_CHECKOUT:this.checkThirdPartyMethods(`${o}?redirect=/cart#initiate-checkout=1`);break;default:location.href=`${o}?redirect=${n||location.pathname}`}}static navigateWithoutDiscount(e,r){let n=ot.get();switch(e){case Qt.CART_PAGE:location.href="/cart";break;case Qt.SHOPIFY_CHECKOUT:location.href="/checkout";break;case Qt.THIRD_PARTY_CHECKOUT:this.checkThirdPartyMethods("/cart#initiate-checkout=1");break;case Qt.CART_DRAWER:{n.open();break}}r&&n.refreshUI(r)}static async applyWithStorefront(e){let r={cartId:`gid://shopify/Cart/${me.getCurrent().token}`,discountCodes:e};b.verbose(`Applying ${e.length} coupons on cart`),await rl(uT,r,"storefront-apply-discount")}static checkThirdPartyMethods(e){window.triggerGokwikCustomCheckout?window.triggerGokwikCustomCheckout():window.shiprocketCheckoutEvents?.buyCart?window.shiprocketCheckoutEvents.buyCart():window.openCheckout?window.openCheckout():window.handleFloCheckoutBtn?window.handleFloCheckoutBtn():window.openRzpCheckout?window.openRzpCheckout():location.href=e}};var cv=zr(Mf());var fT=`
|
|
41
41
|
mutation cartCreate($input: CartInput) {
|
|
42
42
|
cartCreate(input: $input) {
|
|
43
43
|
cart {
|
|
@@ -50,14 +50,14 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
`;function lv(t){let e=ot.get();if(window.cooeeGetCartSections&&typeof window.cooeeGetCartSections=="function")try{return{sections_url:window.location.pathname,sections:window.cooeeGetCartSections()}}catch(r){ae(r,"execute-cooeeGetCartSections",{engagementTrigger:t})}else{if(e.isMiniCart())return{sections:["mini-cart"]};if(e.isShopifyDefaultDrawer())return{sections:e.element.getSectionsToRender?.().map((r=>r.section??r.id))}}return{}}async function uv(t,e){if(!_t.hasKeys(t)){w.warn("No update fields provided");return}let r=lv(e),n=E(E({},t),r);try{let o=await ho("/cart/update.js",n);return w.log("Updated cart",t),me.getCurrent().update(o.data),o.data}catch(o){ae(o,"cart-update"),Er("Failed to update item in cart")}}var Ei=class{async addToCart(e,r){if(!e.length)return;let n=e.map(s=>{let{vID:a,vName:l,quantity:f}=this.getVariantDetails(s),m=r.getPrivateAttributesForLineItem();if(_t.hasKeys(window.CooeeSDK.customItemProperties)){let d={name:l},_={templateSuffix:s.templateSuffix},y=cv.render(JSON.stringify(window.CooeeSDK.customItemProperties),{variant:d,product:_});m=E(E({},JSON.parse(y)),m)}return{id:a?+a:+s.mID,quantity:f,properties:m}}),o=lv(r),i=E({items:n},o);try{let s=await ho("/cart/add.js",i);return w.log(`Added ${e.length} items to Cart`),Er("Product added to your cart"),s.data}catch(s){ae(s,"cart-item-add",{engagementTrigger:r});let a=["Failed to add product in cart."];if(s instanceof Zt&&s.is40x()&&s.responseText){let l=s.responseText;l.description&&a.push(`Reason: ${l.description}`)}a.push("Please try again later."),Er(a.join(" "))}}async copyDiscountCode(e){if(e)try{await navigator.clipboard.writeText(e),w.log(`Code-${e} copied`),Er("Discount code copied")}catch(r){w.error("Failed to copy code",r)}}getProductURL(e){if(!e?.link)return;let r=tg(e.link);if(r)return Wo("/products/"+r)}async upgradeToSubscription(e,r){if(!e){w.warn("Trying to upgrade to subscription with no item");return}let n=await me.getCurrent().getNormalisedCart(),o=e.selectedOrFirstVariant.value,i=n.items.findIndex(l=>l.vID===o.mID),s=o.selectedSellingPlan.value,a={line:i+1,selling_plan:s?.mID||null,properties:r.getPrivateAttributesForLineItem()};try{let l=await ho("/cart/change.js",a);return w.log(`Upgraded ${e} selling plan`),Er("Line item updated"),me.getCurrent().update(l.data),l.data}catch(l){ae(l,"cart-switch-subscription",{engagementTrigger:r}),Er("Failed to update subscription")}}async createNewCart(e,r,n){if(!e?.vID){w.error("No variant ID found to perform Buy now",e);return}let o=r?[r]:[],i=[{merchandiseId:`gid://shopify/ProductVariant/${e.vID}`,quantity:1,attributes:n.getKVFormatPrivateAttributesForLineItem()}],s=await $a("Buy Now");return(await rl(uT,{input:{lines:i,discountCodes:o,attributes:s}},"storefront-create-cart")).data.data?.cartCreate?.cart?.checkoutUrl}async process(e){let r=e.clickAction,n=e.items,o=e.triggerData,i;if(r.at){let s=r;if(w.log(`Performing ${JSON.stringify(s)} action`),s.at===we.GO_TO_PRODUCT)i=this.getProductURL(n[0]);else if(s.at===we.ADD_TO_CART)n?.length&&await this.addToCart(n,o);else if(s.at===we.COPY_COUPON_CODE)await this.copyDiscountCode(o.discount?.code);else if(s.at===we.OPEN_CART)ot.get().open();else if(s.at===we.GO_TO_COLLECTION){let a=e.collections;if(!a?.length)return;i=Wo("/collections/"+a[0].handle)}}r.applyDiscount&&o.discount?.code?Un.navigate(o.discount.code,o.redirectBehaviour,i):i&&(location.pathname=i)}getVariantDetails(e){let r,n,o;if(e instanceof Dt)r=e.vID,n=e.vName,o=e.quantity??1;else{if(!e.vars?.length)return{};r=e.selectedOrFirstVariant.value.mID,n=e.selectedOrFirstVariant.value.name,o=1}return{vID:r,quantity:o,vName:n}}};async function fv(t,e){if(!_t.hasKeys(e)){w.warn("No update fields provided");return}let r=E({id:t.key},e);try{let n=await ho("/cart/change.js",r);w.log("Updated line-item",t),me.getCurrent().update(n.data)}catch(n){ae(n,"cart-item-update")}}var il=class{static updateIdentity(e){if(!this.isInstalled())return;let r={};e.email&&(r.email=e.email),e.mobile&&(r.phone_number=e.mobile),w.verbose("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",r])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}};var sl=class{action;triggerContext;constructor(e,r){this.action=e,this.triggerContext=r}async execute(){let e=this.containsCTA()?"CE Trigger Clicked":"CE Trigger Closed";switch(this.action.at!==we.SUBMIT_FORM&&await this.closeTriggerAndSendEvent(e),this.action.at){case we.ACCEPT_POPUP:break;case we.GO_TO_URL:this.gotoURLAction();break;case we.SHARE:this.shareAction();break;case we.SUBMIT_FORM:await this.collectFormData();break;case void 0:case we.OPEN_CART:break;default:w.error("Received an invalid ClickActionType: ",this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,"_blank")?.focus()}gotoURLAction(){if(this.action.gu?.u){let e=this.action.gu.u;Uo(e)||(e=`//${e}`),window.open(e,"_self")}}async closeTriggerAndSendEvent(e,r){this.triggerContext.closeInApp(e,r),await this.dispatchEvent()}shareAction(){if(!this.action.share)return;if(!navigator.share){w.warn("Navigator.share is not compatible with this browser");return}navigator.share({text:this.action.share.text,title:"Share"}).then(r=>console.log(r)).catch(r=>console.error(r))}containsCTA(){return this.action.at&&this.action.at!==we.REJECT_POPUP?!0:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(e){return e?Object.keys(e).length===0:!0}async collectFormData(){let e={};for(let r of this.triggerContext.inputs){if(!r.isValid)return;let o=document.getElementById(r.id).value;r.type===51?e.email=o:r.type===52&&(e.mobile=o)}await this.closeTriggerAndSendEvent("CE Form Submitted",{form:e}),this.action.applyDiscount&&Er("Coupon applied on cart"),il.updateIdentity(e)}async dispatchEvent(){let e=this.triggerContext.triggerData,r={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??e.embeddedItems??e.items,collections:e.collections,triggerData:e};await new Ei().process(r);let n={action:this.containsCTA()?"CLICKED":"CLOSED"};document.dispatchEvent(new CustomEvent("letscooee:outbound:popup-activities",{detail:n}))}};var ur=class{renderer=kn.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(e,r,n){this.parentHTMLEl=e,this.inappElement=r,this.triggerContext=n,this.stylesConverter=new vi(this.renderer.getScalingFactor())}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.parentHTMLEl.appendChild(this.inappHTMLEl)}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let e=Z(E(E(E(E({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:"border-box",outline:"none"});go(this.inappHTMLEl,e)}getDisplayStyles(){return{display:"block"}}processWidthAndHeight(){this.inappElement.w&&re(this.inappHTMLEl,"width",this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&re(this.inappHTMLEl,"height",this.stylesConverter.getSizePx(this.inappElement.h))}processPositionBlock(){let e={position:"absolute",left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};go(this.inappHTMLEl,e)}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let e=this.inappElement.alpha;if(!isNaN(e)){let r=(e/100).toFixed(2);re(this.inappHTMLEl,"opacity",r)}}processShadow(){let e=this.inappElement.shd;e?re(this.inappHTMLEl,"box-shadow",e.getStyle(this.scalingFactor)):re(this.inappHTMLEl,"box-shadow","unset")}processTransformBlock(){let e=new Vn(this.inappElement.trf);e&&e.rotate&&re(this.inappHTMLEl,"transform",`rotate(${e.rotate}deg)`)}registerAction(){let e=this.inappElement.clc;!e||Object.keys(e).length===0||(this.inappHTMLEl.addEventListener("click",r=>{r.stopPropagation(),new sl(e,this.triggerContext).execute()}),re(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}};var jr=class extends ur{constructor(e,r,n){super(e,r,n)}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment()}processFontBlock(){let e={},r=this.inappElement.typography;return r&&(e.fontSize=this.stylesConverter.getSizePx(r.fs),e.fontFamily="cooee"+r.fam?.name,e.lineHeight=`${r.lh}`,e.letterSpacing=r.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),go(this.inappHTMLEl,e),e}processPart(e,r){let n=[];r.u&&n.push("underline"),r.st&&n.push("line-through"),n.length||n.push("normal"),re(e,"font-weight",r.b?"bold":"normal"),re(e,"font-style",r.i?"italic":"normal"),re(e,"text-decoration",n.join(" ")),re(e,"color",r.c??"inherit"),re(e,"font-family","inherit")}processAlignment(){let e=this.inappElement.typography.ta,r=e?To[e]?.toLowerCase():this.inappElement.typography.alignment;r||(r="start"),re(this.inappHTMLEl,"text-align",r)}};var Is=class extends jr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.inappElement.parts?.forEach(e=>{let r=document.createElement("span");r.innerHTML=e.txt?.toString()?.replace(/\n/g,"<br />"),this.processPart(r,e),this.inappHTMLEl.appendChild(r)}),this.processCommonBlocks()}};var xs=class extends ur{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}};var yo=class extends ur{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("img"),this.insertElement()}render(){this.inappHTMLEl.setAttribute("src",this.inappElement.src),re(this.inappHTMLEl,"max-width","none"),re(this.inappHTMLEl,"max-height","none"),re(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()}};var Cs=class t extends ur{constructor(r,n,o){super(r,n,o);this.parent=r;this.inappHTMLEl=document.createElement("div")}static MAX_Z_INDEX="2147483647";render(){return this.parent||this.renderer.removeInApp(),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add("cooee-wrapper"),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),re(this.inappHTMLEl,"z-index",t.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let r=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(re(this.inappHTMLEl,"width","100%"),re(this.inappHTMLEl,"height","100%")):(re(this.inappHTMLEl,"width","100vw"),re(this.inappHTMLEl,"height","100vh")),re(this.inappHTMLEl,"top","0"),re(this.inappHTMLEl,"left","0");else{let n=this.inappElement.spc,o=this.stylesConverter.getScaledSize(r.w)+n.getHorizontal(),i=this.stylesConverter.getScaledSize(r.h)+n.getVertical();re(this.inappHTMLEl,"width",o+"px"),re(this.inappHTMLEl,"height",i+"px")}}getSpaceStyles(){return{padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return E(E({display:"flex"},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){this.renderer.isParentNotBody()?re(this.inappHTMLEl,"position","absolute"):re(this.inappHTMLEl,"position","fixed")}getBorderStyles(){return{}}processTransparency(){}processTransformBlock(){}processShadow(){}};var fT="cooee-container",al=class extends ur{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){return this.processCommonBlocks(),re(this.inappHTMLEl,"position","relative"),re(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(fT),this}};var cl=class t extends jr{static DAYS="Days";static HOURS="Hours";static MINUTES="Minutes";static SECONDS="Seconds";elements;spans=[];constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let e=Z(E(E(E({flex:"1 1 0"},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(e)}getBackgroundStyles(){return{}}processFontBlock(){let e=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),this.addStylesToTimer(e),e}getSpaceStyles(){return{}}getBorderStyles(){return{}}getDisplayStyles(){return{display:"flex",flexWrap:"nowrap",justifyContent:"center"}}addStylesToTimer(e){this.elements.forEach(r=>go(r,e))}addTimerChildren(){let e=this.inappElement.show;this.elements=[],e.day&&this.elements.push(this.getChild(t.DAYS)),e.hour&&this.elements.push(this.getChild(t.HOURS)),e.minute&&this.elements.push(this.getChild(t.MINUTES)),e.second&&this.elements.push(this.getChild(t.SECONDS)),this.elements.forEach(r=>this.inappHTMLEl.appendChild(r))}getChild(e){let r=document.createElement("div"),n=document.createElement("span"),o=document.createElement("span");return o.innerText=e,n.innerText="00",n.id=`lc-${e}`,re(o,"font-size","0.5em"),re(o,"text-align","center"),re(o,"font-family","inherit"),re(n,"text-align","center"),re(n,"font-family","inherit"),this.inappElement.lblPos==="start"?(r.appendChild(o),r.appendChild(n)):(r.appendChild(n),r.appendChild(o)),re(r,"display","flex"),re(r,"flex-direction",this.inappElement.horizontal?"":"column"),re(r,"justify-content","center"),re(r,"align-items","center"),re(r,"gap","5px"),this.spans.push(n),r}processAndStartTimer(){let e=this.inappElement.timer.start(this.inappElement.timerType,r=>{this.spans.forEach(n=>{n.id===`lc-${t.DAYS}`?n.innerText=String(r.days).padStart(2,"0"):n.id===`lc-${t.HOURS}`?n.innerText=String(r.hours).padStart(2,"0"):n.id===`lc-${t.MINUTES}`?n.innerText=String(r.minutes).padStart(2,"0"):n.id===`lc-${t.SECONDS}`&&(n.innerText=String(r.seconds).padStart(2,"0"))})});this.triggerContext.intervals.push(e)}};var ll=class extends jr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("select"),this.insertElement()}render(){re(this.inappHTMLEl,"background","#ffffff00"),re(this.inappHTMLEl,"outline","none"),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions()}addListener(e){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),e.addEventListener("click",r=>{r.stopPropagation()}),e.addEventListener("change",()=>{let r=new Mr(JSON.parse(e.value));this.updateItems(r)})}updateItems(e){let r=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[r.toEmbed(e)];let n=this.parentHTMLEl.querySelector("#coo-13");if(!n)return;let o=e.imgs[0]??r.imgs?.at(0);o?.url&&n.setAttribute("src",o.url)}addOptions(){let e=this.triggerContext.triggerData.items,r=this.inappHTMLEl;if(!e?.length){r.add(this.createOption(this.inappElement.placeholderText));return}let n=this.triggerContext.selectedEmbeddedItems?.at(0);e[0].vars.forEach(o=>{r.add(this.createOption(o.name??"Default",o,o.mID===n?.vID))})}createOption(e,r,n){let o=document.createElement("option");return o.text=e,o.value=JSON.stringify(r),n&&(o.selected=!0),r||(o.disabled=!0),o}};var _i=class extends jr{borderColor="";constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("input"),this.insertElement()}render(){let e=this.setInputType();this.inappHTMLEl.setAttribute("placeholder",this.inappElement.placeholderText),re(this.inappHTMLEl,"background","#ffffff00"),re(this.inappHTMLEl,"outline","none"),this.inappHTMLEl.addEventListener("click",r=>{r.stopPropagation()}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,e),this.triggerContext.addInputField(e,this.inappElement.t)}};var ul=class t extends _i{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute("type","email"),this.inappHTMLEl.setAttribute("id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(t.EMAIL_REGEX)?(re(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(re(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}};var fl=class t extends _i{static MOBILE_REGEX=/^\d+$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute("type","tel"),this.inappHTMLEl.setAttribute("id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(t.MOBILE_REGEX)?(re(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(re(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}};var pl=class extends yo{constructor(e,r,n){super(e,r,n)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}};var kn=class t{static DOCUMENT_STANDARD_MODE="CSS1Compat";static ACTIVE_TRIGGER_DATA;static _instance;parent;rootContainer;containerHTMLElement;ian;scalingFactor=1;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.resizeListener=()=>this.screenResized(),this.setParentContainer(e)}static get(){return t._instance}render(e){this.renderEngagement(new St(e))}getScalingFactor(){return this.scalingFactor}calculateScalingFactor(e){let r=e.max,n=e.cont.w,o=e.cont.h,i=e.spc,s=this.getWidth(),a=this.getHeight();r&&(s=s?Math.min(s,r):r,a=a?Math.min(a,r):r),a&&(s-=i.getHorizontal(),a-=i.getVertical(),s/a<n/o?this.scalingFactor=s/n:this.scalingFactor=a/o,this.scalingFactor=Math.min(this.scalingFactor,1))}setParentContainer(e){this.parent=e||document.body,this.isParentNotBody()&&re(this.parent,"position","relative")}isParentNotBody(){return this.parent&&this.parent!==document.body}getWidth(){return this.isParentNotBody()?this.parent.clientWidth:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parent.clientHeight:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}async renderEngagement(e){this.triggerContext=new Ir(new Date,e),this.triggerContext.onClose(r=>{this.closeInApp(r)}),this.ian=e.ian,(Wr()||e.previewType==="mobile")&&this.ian.overrideForMobileView(),await this.preloadImages(e),e.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed()},e.getDelaySeconds()):this.withCartDrawerClosed()}withCartDrawerClosed(){if(!ot.get().isOpen()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=window.CooeeSDK.cartDrawerToggle$.subscribe(({open:r})=>{!r&&this.startRenderingOnce()})}startRenderingOnce(){if(!this.shouldSkipCampaign()){t.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData,t._instance=this;try{this.startRendering()}catch(e){ae(e,"render-popup",{triggerContext:this.triggerContext});return}this.sendTriggerDisplayed(),Wr()||window.addEventListener("resize",this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe()}}shouldSkipCampaign(){let e=this.triggerContext.triggerData;if(!e.previewType&&t.ACTIVE_TRIGGER_DATA){let n={triggerShown:new An(t.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(e,n),!0}if(fe().isGoKwikPopupOpen)return this.skipTrigger(e,{reason:"GoKwik popup is open"}),!0;let r=lm.find(n=>!!document.querySelector(n.identifier));return r?(this.skipTrigger(e,{reason:`${r.gateway} modal is open`}),!0):!1}startRendering(){this.calculateScalingFactor(this.ian),this.rootContainer=new Cs(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(e){throw w.error(e),e}}sendTriggerDisplayed(){let e={};this.triggerContext.triggerData.items?.length&&(e.promotedMIDs=this.triggerContext.triggerData.items?.map(o=>o.mID));let r=new xe("CE Trigger Displayed",e,this.triggerContext.triggerData);Mt(r);let n={action:"DISPLAYED"};document.dispatchEvent(new CustomEvent("letscooee:outbound:popup-activities",{detail:n}))}sendTriggerClosed(e){let r=e.eventName;delete e.eventName;let n=new xe(r,e,this.triggerContext.triggerData);n.name==="CE Trigger Clicked"&&(n.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(o=>o.toEmbed())),Mt(n)}addEnterAnimation(e){this.containerHTMLElement.animate(e.getEnterAnimation(),{duration:500})}renderElement(e,r,n){r instanceof zo?new ul(e,r,n).render():r instanceof Yo?new fl(e,r,n).render():r instanceof Tn?new Is(e,r,n).render():r instanceof Ko?new pl(e,r,n).render():r instanceof on?new yo(e,r,n).render():r instanceof Zn?new xs(e,r,n).render():r instanceof Go?new cl(e,r,n).render():r instanceof qo?new ll(e,r,n).render():w.error("Unsupported element type- "+r.type)}renderContainer(e){let r=this.ian?.cont;r&&(this.containerHTMLElement=new al(this.rootContainer,r,e).render().getHTMLElement(),new nl().loadAllFonts(this.ian),this.ian.elems?.forEach(async n=>{await this.renderElement(this.containerHTMLElement,n,e)}),this.addEnterAnimation(this.ian.anim))}closeInApp(e){let r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(e),t.ACTIVE_TRIGGER_DATA=void 0;let n=this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"});n.onfinish=()=>{this.removeInApp(),window.removeEventListener("resize",this.resizeListener)}}screenResized(){this.removeInApp(),this.startRendering()}removeInApp(){let e=document.querySelector(`.${this.triggerContext.rootClassName}`);e&&e.parentElement.removeChild(e)}skipTrigger(e,r){let n=new xe("CE Campaign Rejected",r,e);Mt(n)}async preloadImages(e){let r=e.ian;if(!r)return;let n=[];r.elems.forEach(o=>{let i=o.bg?.img?.src;if(i&&n.push(i),o.t===1){let s=o.src;if(!s)return;n.push(s)}}),r.bg?.img?.src&&n.push(r.bg.img.src),r.cont.bg?.img?.src&&n.push(r.cont.bg.img.src),await Promise.all(n.map(o=>ev(o)))}};var ml=class{triggerData;render(e){e.contentSource===Di.KLAVIYO&&(this.triggerData=e,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",e.klaviyoFormID]))}handleKlaviyoEvents(e){if(e.type!=="klaviyoForms")return;let r=e.detail;if(r.formId!==this.triggerData.klaviyoFormID){w.warn("Received invalid trigger callback");return}switch(r.type){case"open":Mt(new xe("CE Trigger Displayed",{form:{id:r.formId}},this.triggerData));break;case"stepSubmit":{let n=this.getFormDetails(r);Mt(new xe("CE Form Submitted",{form:n},this.triggerData)),wi(n);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),Mt(new xe("CE Trigger Closed",{form:{id:r.formId}},this.triggerData));break}}getFormDetails(e){let r={id:e.formId},n=e.metaData;if(_t.hasKeys(n)){let o=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(n).forEach(a=>{o.includes(a)||(r[a]=n[a])}),r.email=n.$email??n.email,r.mobile=n.$phone_number??n.phone_number;let i=n.$first_name??n.first_name,s=n.$last_name??n.last_name;(i?.length||s?.length)&&(r.name=i+" "+s)}return r}};function pv(t){if(!pT()||!ze.get().pixelPush)return;let r=mo[t.intent]?.toLowerCase();r&&(w.verbose(`Sending ${r} intent to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:r}))}function pT(){return window.fbq&&typeof window.fbq=="function"}var $p=new Map,dl=async t=>{for(let i of t.items)if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(i,t)}catch(s){w.error(s)}if(t.isCartEmbed()&&!t.isSubscriptionUpsell()){let s=(await me.getCurrent().getNormalisedCart()).items.map(a=>a.mID);t.items=t.items.filter(a=>!s.includes(a.mID))}if(t.items=mv(t),ze.get().currencyCount<=1)return t.items;if(t.isShoppableVideo())return await mT(t.content.videoConfig,t),t.items;let e=t.items.length,r=t.items.map(i=>dv(i,t)),o=(await Promise.all(r)).filter(i=>i!=null);if(e&&!o.length){let i="Failed to fetch any product from Ajax API",s=new xe("CE Campaign Failed",{reason:i,currency:t.currency},t);throw Mt(s),new Error(i)}return mv(t,o)},mv=(t,e=t.items)=>{if(!t.isCartRecovery())return e;let r=me.getCurrent().items,n=[];for(let o of e)for(let i of o.vars){if(!i.isAvailable)continue;let s=r.find(f=>f.variant_id.toString()===i.mID);if(!s)continue;let a=new xt(o);a.name=s.title;let l=new Mr(i);l.name=s.variant_title,l.price.d=s.discounted_price/100,a.variants=[l],n.push(a)}return n},mT=async(t,e)=>{await Promise.all(t.videos.map(async r=>{r.items=await Promise.all(r.items.map(async n=>{let o=await dv(n,e);return o||n}))}))},dv=async(t,e)=>{if($p.has(t.mID))return $p.get(t.mID);let r,n=`/products/${t.slug}.js`;try{r=(await Jr(n)).data}catch(o){return o instanceof Zt&&o.response?.status===404||ae(o,"fetch-shopify-product",{extra:{item:t,path:n},engagementTrigger:e}),null}return r?dT(t,r):(w.error("Item not found after AJAX call for:",t),null)},dT=(t,e)=>{if(!t||!e)return t;t.name=e.title,t.tags=e.tags,t.slug=e.handle;let r=t.selectedOrFirstVariant.value;return t.vars.map(n=>{let o=e.variants.find(i=>i.id===+n.mID);o!=null&&(n.name=o.title,n.isAvailable=o.available,n.price.d=o.price?o.price/100:o.price,n.price.effective=n.price.d,n.price.cmp=o.compare_at_price?o.compare_at_price/100:o.compare_at_price,+r.mID===o.id&&(r.effectivePrice.value=n.price.d))}),$p.set(t.mID,t),t};var Vp="/v1/event/track-page-unload";function Tt(t){w.verbose(`Waiting for auth to send event ${t.name}`),Sr(lr).then(()=>Mt(t))}function Zy(t){Sr(lr).then(()=>{hT(t)})}async function hT(t){let e=fe().currentPageViewEvent;if(!e){w.warn("No page view event was stored previously");return}let r={pageViewEventID:e.id,pageViewEventName:e.name,pageActiveTimeMS:t};w.verbose("Sending page unload",r);try{await Yt(Vp,r)}catch(n){throw w.error(`Error sending page unload for ${e} to server`,n),n}}function Mt(t){gT(t)}async function gT(t){if(w.verbose(`Sending event: ${t.name}`,t),bT(t)){w.warn(`Rejecting event ${t.name}`);return}Xy();let e=await Fn();Object.assign(t,e),Qy(),It.set("lastUsedTime",new Date().getTime());let r=wT(t.name),n=r.toLowerCase().replace(/\s+/g,"-");try{let o=await Yt(`/v1/event/track/${n}`,t);w.info("Event tracked:",r),yT(t)&&(fe().currentPageViewEvent={id:t.id,name:t.name}),vT(t,o.data)}catch(o){throw w.error(`Error sending event ${t.name} to server`,o),o}}function yT(t){return fm.includes(t.name)?t.name==="View Cart"?!t.properties.drawer:!0:!1}function vT(t,e){ET(t,e).catch(r=>{ae(r,"process-popup-response",{extra:{event:t,response:e}})}),_T(e)}async function ET(t,e){if(!e.triggerData)return;let r=new St(e.triggerData);r.occurred=t.occurred,w.log(`${r} will be shown`);let n;try{n=await dl(r)}catch(o){w.error("Failed to refresh the products",o);return}if(r.items=n,r.contentSource===Di.KLAVIYO){new ml().render(r);return}new kn().renderEngagement(r).catch(o=>{ae(o,"render-popup",{extra:{event:t},engagementTrigger:r})})}function _T(t){t.intent&&(Uy(t.intent),pv(t),w.info(`Intent is ${mo[t.intent]}`))}function wT(t){return t.replace("CE ","").replace("Trigger","Campaign").replace("Screen","Page").replace("App ","")}function bT(t){return t.trigger?.triggerID==="test"||t.trigger?.triggerID==="preview"?(w.warn("Not sending event as this is a test trigger"),!0):!1}var ST="keepalive"in new Request(""),Gr=new Headers;CT();async function Fn(){let[t]=await Promise.all([Vy()]);return E(E({},Hc()),t)}function wi(t){Sr(lr).then(()=>TT(t??{}))}function TT(t){gv("/v1/user/update",t).then(()=>{w.verbose("Updated user profile")}).catch(e=>{w.error("Error saving user profile",e)})}function hv(t){return Yt("/v1/event/generate-discount",t)}function hl(t){Sr(lr).then(()=>IT({props:t}))}function IT(t){gv("/v1/device/update",t).then(()=>{w.verbose("Updated device properties")}).catch(async e=>{w.error("Error saving device property",e)})}function zy(t){t&&Gr.set("cooee-device-id",t)}function Yy(t){t&&Gr.set("cooee-first-seen",t.toUTCString())}function Yt(t,e){return yv("POST",t,e)}function gv(t,e){return yv("PUT",t,e)}function yv(t,e,r){if(!es()&&!fe().flags?.allowEvents)return w.log(`Rejecting ${t} ${e} as this is not e-commerce app`),Promise.reject();if(e.startsWith("http")||(e=dr.apiURL+e),r&&!ST&&e.includes(Vp))return xT(e,Gr,r);let n={method:t,headers:Gr,keepalive:!1};return r&&(n.body=JSON.stringify(r)),Jr(e,n)}function xT(t,e,r){return new Promise((n,o)=>{let i=new XMLHttpRequest;i.open("POST",t,!0),e.forEach((s,a)=>{i.setRequestHeader(a,s)}),i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(i.status>=200&&i.status<300)try{if(i.getResponseHeader("Content-Type")?.includes("application/json")){let a=JSON.parse(i.responseText);n({data:a,headers:e,request:i,status:i.status,statusText:i.statusText})}else o(new Error("Content-Type of response header is not json"))}catch(s){o(s)}else o(new Error(`Received status - ${i.status}(${i.statusText})`))},i.onerror=()=>{o(new Error("Network error occurred during the request."))},i.send(JSON.stringify(r))})}function CT(){Gr.set("Content-Type","application/json; charset=utf-8"),Gr.set("cooee-sdk",$s),Gr.set("cooee-sdk-code",am.toString()),Gr.set("cooee-sdk-version",Vs),Gr.set("cooee-shop-name",tc()??""),dr.debug&&Gr.set("cooee-sdk-debug",String(1))}var gl=class{modifications=[];constructor(){sn(`.lc-hide {display: none !important;height: 0 !important;}
|
|
53
|
+
`;function lv(t){let e=ot.get();if(window.cooeeGetCartSections&&typeof window.cooeeGetCartSections=="function")try{return{sections_url:window.location.pathname,sections:window.cooeeGetCartSections()}}catch(r){ae(r,"execute-cooeeGetCartSections",{engagementTrigger:t})}else{if(e.isMiniCart())return{sections:["mini-cart"]};if(e.isShopifyDefaultDrawer())return{sections:e.element.getSectionsToRender?.().map((r=>r.section??r.id))}}return{}}async function uv(t,e){if(!_t.hasKeys(t)){b.warn("No update fields provided");return}let r=lv(e),n=E(E({},t),r);try{let o=await ho("/cart/update.js",n);return b.log("Updated cart",t),me.getCurrent().update(o.data),o.data}catch(o){ae(o,"cart-update"),Er("Failed to update item in cart")}}var Ei=class{async addToCart(e,r){if(!e.length)return;let n=e.map(s=>{let{vID:a,vName:l,quantity:f}=this.getVariantDetails(s),m=r.getPrivateAttributesForLineItem();if(_t.hasKeys(window.CooeeSDK.customItemProperties)){let d={name:l},_={templateSuffix:s.templateSuffix},y=cv.render(JSON.stringify(window.CooeeSDK.customItemProperties),{variant:d,product:_});m=E(E({},JSON.parse(y)),m)}return{id:a?+a:+s.mID,quantity:f,properties:m}}),o=lv(r),i=E({items:n},o);try{let s=await ho("/cart/add.js",i);return b.log(`Added ${e.length} items to Cart`),Er("Product added to your cart"),s.data}catch(s){ae(s,"cart-item-add",{engagementTrigger:r});let a=["Failed to add product in cart."];if(s instanceof Zt&&s.is40x()&&s.responseText){let l=s.responseText;l.description&&a.push(`Reason: ${l.description}`)}a.push("Please try again later."),Er(a.join(" "))}}async copyDiscountCode(e){if(e)try{await navigator.clipboard.writeText(e),b.log(`Code-${e} copied`),Er("Discount code copied")}catch(r){b.error("Failed to copy code",r)}}getProductURL(e){if(!e?.link)return;let r=tg(e.link);if(r)return Wo("/products/"+r)}async upgradeToSubscription(e,r){if(!e){b.warn("Trying to upgrade to subscription with no item");return}let n=await me.getCurrent().getNormalisedCart(),o=e.selectedOrFirstVariant.value,i=n.items.findIndex(l=>l.vID===o.mID),s=o.selectedSellingPlan.value,a={line:i+1,selling_plan:s?.mID||null,properties:r.getPrivateAttributesForLineItem()};try{let l=await ho("/cart/change.js",a);return b.log(`Upgraded ${e} selling plan`),Er("Line item updated"),me.getCurrent().update(l.data),l.data}catch(l){ae(l,"cart-switch-subscription",{engagementTrigger:r}),Er("Failed to update subscription")}}async createNewCart(e,r,n){if(!e?.vID){b.error("No variant ID found to perform Buy now",e);return}let o=r?[r]:[],i=[{merchandiseId:`gid://shopify/ProductVariant/${e.vID}`,quantity:1,attributes:n.getKVFormatPrivateAttributesForLineItem()}],s=await $a("Buy Now");return(await rl(fT,{input:{lines:i,discountCodes:o,attributes:s}},"storefront-create-cart")).data.data?.cartCreate?.cart?.checkoutUrl}async process(e){let r=e.clickAction,n=e.items,o=e.triggerData,i;if(r.at){let s=r;if(b.log(`Performing ${JSON.stringify(s)} action`),s.at===be.GO_TO_PRODUCT)i=this.getProductURL(n[0]);else if(s.at===be.ADD_TO_CART)n?.length&&await this.addToCart(n,o);else if(s.at===be.COPY_COUPON_CODE)await this.copyDiscountCode(o.discount?.code);else if(s.at===be.OPEN_CART)ot.get().open();else if(s.at===be.GO_TO_COLLECTION){let a=e.collections;if(!a?.length)return;i=Wo("/collections/"+a[0].handle)}}r.applyDiscount&&o.discount?.code?Un.navigate(o.discount.code,o.redirectBehaviour,i):i&&(location.pathname=i)}getVariantDetails(e){let r,n,o;if(e instanceof Dt)r=e.vID,n=e.vName,o=e.quantity??1;else{if(!e.vars?.length)return{};r=e.selectedOrFirstVariant.value.mID,n=e.selectedOrFirstVariant.value.name,o=1}return{vID:r,quantity:o,vName:n}}};async function fv(t,e){if(!_t.hasKeys(e)){b.warn("No update fields provided");return}let r=E({id:t.key},e);try{let n=await ho("/cart/change.js",r);b.log("Updated line-item",t),me.getCurrent().update(n.data)}catch(n){ae(n,"cart-item-update")}}var il=class{static updateIdentity(e){if(!this.isInstalled())return;let r={};e.email&&(r.email=e.email),e.mobile&&(r.phone_number=e.mobile),b.verbose("Sending email/mobile to Klaviyo"),window.klaviyo.push(["identify",r])}static isInstalled(){return window.klaviyo&&typeof window.klaviyo=="object"}};var sl=class{action;triggerContext;constructor(e,r){this.action=e,this.triggerContext=r}async execute(){let e=this.containsCTA()?"CE Trigger Clicked":"CE Trigger Closed";switch(this.action.at!==be.SUBMIT_FORM&&await this.closeTriggerAndSendEvent(e),this.action.at){case be.ACCEPT_POPUP:break;case be.GO_TO_URL:this.gotoURLAction();break;case be.SHARE:this.shareAction();break;case be.SUBMIT_FORM:await this.collectFormData();break;case void 0:case be.OPEN_CART:break;default:b.error("Received an invalid ClickActionType: ",this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,"_blank")?.focus()}gotoURLAction(){if(this.action.gu?.u){let e=this.action.gu.u;Uo(e)||(e=`//${e}`),window.open(e,"_self")}}async closeTriggerAndSendEvent(e,r){this.triggerContext.closeInApp(e,r),await this.dispatchEvent()}shareAction(){if(!this.action.share)return;if(!navigator.share){b.warn("Navigator.share is not compatible with this browser");return}navigator.share({text:this.action.share.text,title:"Share"}).then(r=>console.log(r)).catch(r=>console.error(r))}containsCTA(){return this.action.at&&this.action.at!==be.REJECT_POPUP?!0:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(e){return e?Object.keys(e).length===0:!0}async collectFormData(){let e={};for(let r of this.triggerContext.inputs){if(!r.isValid)return;let o=document.getElementById(r.id).value;r.type===51?e.email=o:r.type===52&&(e.mobile=o)}await this.closeTriggerAndSendEvent("CE Form Submitted",{form:e}),this.action.applyDiscount&&Er("Coupon applied on cart"),il.updateIdentity(e)}async dispatchEvent(){let e=this.triggerContext.triggerData,r={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??e.embeddedItems??e.items,collections:e.collections,triggerData:e};await new Ei().process(r);let n={action:this.containsCTA()?"CLICKED":"CLOSED"};document.dispatchEvent(new CustomEvent("letscooee:outbound:popup-activities",{detail:n}))}};var ur=class{renderer=kn.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(e,r,n){this.parentHTMLEl=e,this.inappElement=r,this.triggerContext=n,this.stylesConverter=new vi(this.renderer.getScalingFactor())}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.parentHTMLEl.appendChild(this.inappHTMLEl)}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let e=Z(E(E(E(E({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:"border-box",outline:"none"});go(this.inappHTMLEl,e)}getDisplayStyles(){return{display:"block"}}processWidthAndHeight(){this.inappElement.w&&re(this.inappHTMLEl,"width",this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&re(this.inappHTMLEl,"height",this.stylesConverter.getSizePx(this.inappElement.h))}processPositionBlock(){let e={position:"absolute",left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};go(this.inappHTMLEl,e)}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let e=this.inappElement.alpha;if(!isNaN(e)){let r=(e/100).toFixed(2);re(this.inappHTMLEl,"opacity",r)}}processShadow(){let e=this.inappElement.shd;e?re(this.inappHTMLEl,"box-shadow",e.getStyle(this.scalingFactor)):re(this.inappHTMLEl,"box-shadow","unset")}processTransformBlock(){let e=new Vn(this.inappElement.trf);e&&e.rotate&&re(this.inappHTMLEl,"transform",`rotate(${e.rotate}deg)`)}registerAction(){let e=this.inappElement.clc;!e||Object.keys(e).length===0||(this.inappHTMLEl.addEventListener("click",r=>{r.stopPropagation(),new sl(e,this.triggerContext).execute()}),re(this.inappHTMLEl,"cursor","pointer"))}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}};var jr=class extends ur{constructor(e,r,n){super(e,r,n)}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment()}processFontBlock(){let e={},r=this.inappElement.typography;return r&&(e.fontSize=this.stylesConverter.getSizePx(r.fs),e.fontFamily="cooee"+r.fam?.name,e.lineHeight=`${r.lh}`,e.letterSpacing=r.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),go(this.inappHTMLEl,e),e}processPart(e,r){let n=[];r.u&&n.push("underline"),r.st&&n.push("line-through"),n.length||n.push("normal"),re(e,"font-weight",r.b?"bold":"normal"),re(e,"font-style",r.i?"italic":"normal"),re(e,"text-decoration",n.join(" ")),re(e,"color",r.c??"inherit"),re(e,"font-family","inherit")}processAlignment(){let e=this.inappElement.typography.ta,r=e?To[e]?.toLowerCase():this.inappElement.typography.alignment;r||(r="start"),re(this.inappHTMLEl,"text-align",r)}};var Is=class extends jr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.inappElement.parts?.forEach(e=>{let r=document.createElement("span");r.innerHTML=e.txt?.toString()?.replace(/\n/g,"<br />"),this.processPart(r,e),this.inappHTMLEl.appendChild(r)}),this.processCommonBlocks()}};var xs=class extends ur{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.processCommonBlocks()}};var yo=class extends ur{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("img"),this.insertElement()}render(){this.inappHTMLEl.setAttribute("src",this.inappElement.src),re(this.inappHTMLEl,"max-width","none"),re(this.inappHTMLEl,"max-height","none"),re(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()}};var Cs=class t extends ur{constructor(r,n,o){super(r,n,o);this.parent=r;this.inappHTMLEl=document.createElement("div")}static MAX_Z_INDEX="2147483647";render(){return this.parent||this.renderer.removeInApp(),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add("cooee-wrapper"),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),re(this.inappHTMLEl,"z-index",t.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let r=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(re(this.inappHTMLEl,"width","100%"),re(this.inappHTMLEl,"height","100%")):(re(this.inappHTMLEl,"width","100vw"),re(this.inappHTMLEl,"height","100vh")),re(this.inappHTMLEl,"top","0"),re(this.inappHTMLEl,"left","0");else{let n=this.inappElement.spc,o=this.stylesConverter.getScaledSize(r.w)+n.getHorizontal(),i=this.stylesConverter.getScaledSize(r.h)+n.getVertical();re(this.inappHTMLEl,"width",o+"px"),re(this.inappHTMLEl,"height",i+"px")}}getSpaceStyles(){return{padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return E(E({display:"flex"},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){this.renderer.isParentNotBody()?re(this.inappHTMLEl,"position","absolute"):re(this.inappHTMLEl,"position","fixed")}getBorderStyles(){return{}}processTransparency(){}processTransformBlock(){}processShadow(){}};var pT="cooee-container",al=class extends ur{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){return this.processCommonBlocks(),re(this.inappHTMLEl,"position","relative"),re(this.inappHTMLEl,"overflow","hidden"),this.inappHTMLEl.classList.add(pT),this}};var cl=class t extends jr{static DAYS="Days";static HOURS="Hours";static MINUTES="Minutes";static SECONDS="Seconds";elements;spans=[];constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("div"),this.insertElement()}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let e=Z(E(E(E({flex:"1 1 0"},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(e)}getBackgroundStyles(){return{}}processFontBlock(){let e=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,"color",e),this.addStylesToTimer(e),e}getSpaceStyles(){return{}}getBorderStyles(){return{}}getDisplayStyles(){return{display:"flex",flexWrap:"nowrap",justifyContent:"center"}}addStylesToTimer(e){this.elements.forEach(r=>go(r,e))}addTimerChildren(){let e=this.inappElement.show;this.elements=[],e.day&&this.elements.push(this.getChild(t.DAYS)),e.hour&&this.elements.push(this.getChild(t.HOURS)),e.minute&&this.elements.push(this.getChild(t.MINUTES)),e.second&&this.elements.push(this.getChild(t.SECONDS)),this.elements.forEach(r=>this.inappHTMLEl.appendChild(r))}getChild(e){let r=document.createElement("div"),n=document.createElement("span"),o=document.createElement("span");return o.innerText=e,n.innerText="00",n.id=`lc-${e}`,re(o,"font-size","0.5em"),re(o,"text-align","center"),re(o,"font-family","inherit"),re(n,"text-align","center"),re(n,"font-family","inherit"),this.inappElement.lblPos==="start"?(r.appendChild(o),r.appendChild(n)):(r.appendChild(n),r.appendChild(o)),re(r,"display","flex"),re(r,"flex-direction",this.inappElement.horizontal?"":"column"),re(r,"justify-content","center"),re(r,"align-items","center"),re(r,"gap","5px"),this.spans.push(n),r}processAndStartTimer(){let e=this.inappElement.timer.start(this.inappElement.timerType,r=>{this.spans.forEach(n=>{n.id===`lc-${t.DAYS}`?n.innerText=String(r.days).padStart(2,"0"):n.id===`lc-${t.HOURS}`?n.innerText=String(r.hours).padStart(2,"0"):n.id===`lc-${t.MINUTES}`?n.innerText=String(r.minutes).padStart(2,"0"):n.id===`lc-${t.SECONDS}`&&(n.innerText=String(r.seconds).padStart(2,"0"))})});this.triggerContext.intervals.push(e)}};var ll=class extends jr{constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("select"),this.insertElement()}render(){re(this.inappHTMLEl,"background","#ffffff00"),re(this.inappHTMLEl,"outline","none"),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions()}addListener(e){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),e.addEventListener("click",r=>{r.stopPropagation()}),e.addEventListener("change",()=>{let r=new Mr(JSON.parse(e.value));this.updateItems(r)})}updateItems(e){let r=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[r.toEmbed(e)];let n=this.parentHTMLEl.querySelector("#coo-13");if(!n)return;let o=e.imgs[0]??r.imgs?.at(0);o?.url&&n.setAttribute("src",o.url)}addOptions(){let e=this.triggerContext.triggerData.items,r=this.inappHTMLEl;if(!e?.length){r.add(this.createOption(this.inappElement.placeholderText));return}let n=this.triggerContext.selectedEmbeddedItems?.at(0);e[0].vars.forEach(o=>{r.add(this.createOption(o.name??"Default",o,o.mID===n?.vID))})}createOption(e,r,n){let o=document.createElement("option");return o.text=e,o.value=JSON.stringify(r),n&&(o.selected=!0),r||(o.disabled=!0),o}};var _i=class extends jr{borderColor="";constructor(e,r,n){super(e,r,n),this.inappHTMLEl=document.createElement("input"),this.insertElement()}render(){let e=this.setInputType();this.inappHTMLEl.setAttribute("placeholder",this.inappElement.placeholderText),re(this.inappHTMLEl,"background","#ffffff00"),re(this.inappHTMLEl,"outline","none"),this.inappHTMLEl.addEventListener("click",r=>{r.stopPropagation()}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,e),this.triggerContext.addInputField(e,this.inappElement.t)}};var ul=class t extends _i{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute("type","email"),this.inappHTMLEl.setAttribute("id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(t.EMAIL_REGEX)?(re(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(re(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}};var fl=class t extends _i{static MOBILE_REGEX=/^\d+$/;constructor(e,r,n){super(e,r,n)}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute("type","tel"),this.inappHTMLEl.setAttribute("id",e),e}addListener(e,r){e.addEventListener("keydown",n=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(t.MOBILE_REGEX)?(re(this.inappHTMLEl,"border-color",this.borderColor),this.triggerContext.updateValidation(r,!0)):(re(this.inappHTMLEl,"border-color","red"),this.triggerContext.updateValidation(r,!1)),n.stopPropagation()})}};var pl=class extends yo{constructor(e,r,n){super(e,r,n)}render(){super.render(),this.inappHTMLEl.setAttribute("id",`coo-${this.inappElement.type}`)}};var kn=class t{static DOCUMENT_STANDARD_MODE="CSS1Compat";static ACTIVE_TRIGGER_DATA;static _instance;parent;rootContainer;containerHTMLElement;ian;scalingFactor=1;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.resizeListener=()=>this.screenResized(),this.setParentContainer(e)}static get(){return t._instance}render(e){this.renderEngagement(new St(e))}getScalingFactor(){return this.scalingFactor}calculateScalingFactor(e){let r=e.max,n=e.cont.w,o=e.cont.h,i=e.spc,s=this.getWidth(),a=this.getHeight();r&&(s=s?Math.min(s,r):r,a=a?Math.min(a,r):r),a&&(s-=i.getHorizontal(),a-=i.getVertical(),s/a<n/o?this.scalingFactor=s/n:this.scalingFactor=a/o,this.scalingFactor=Math.min(this.scalingFactor,1))}setParentContainer(e){this.parent=e||document.body,this.isParentNotBody()&&re(this.parent,"position","relative")}isParentNotBody(){return this.parent&&this.parent!==document.body}getWidth(){return this.isParentNotBody()?this.parent.clientWidth:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parent.clientHeight:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}async renderEngagement(e){this.triggerContext=new Ir(new Date,e),this.triggerContext.onClose(r=>{this.closeInApp(r)}),this.ian=e.ian,(Wr()||e.previewType==="mobile")&&this.ian.overrideForMobileView(),await this.preloadImages(e),e.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed()},e.getDelaySeconds()):this.withCartDrawerClosed()}withCartDrawerClosed(){if(!ot.get().isOpen()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=window.CooeeSDK.cartDrawerToggle$.subscribe(({open:r})=>{!r&&this.startRenderingOnce()})}startRenderingOnce(){if(!this.shouldSkipCampaign()){t.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData,t._instance=this;try{this.startRendering()}catch(e){ae(e,"render-popup",{triggerContext:this.triggerContext});return}this.sendTriggerDisplayed(),Wr()||window.addEventListener("resize",this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe()}}shouldSkipCampaign(){let e=this.triggerContext.triggerData;if(!e.previewType&&t.ACTIVE_TRIGGER_DATA){let n={triggerShown:new An(t.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(e,n),!0}if(fe().isGoKwikPopupOpen)return this.skipTrigger(e,{reason:"GoKwik popup is open"}),!0;let r=lm.find(n=>!!document.querySelector(n.identifier));return r?(this.skipTrigger(e,{reason:`${r.gateway} modal is open`}),!0):!1}startRendering(){this.calculateScalingFactor(this.ian),this.rootContainer=new Cs(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext)}catch(e){throw b.error(e),e}}sendTriggerDisplayed(){let e={};this.triggerContext.triggerData.items?.length&&(e.promotedMIDs=this.triggerContext.triggerData.items?.map(o=>o.mID));let r=new xe("CE Trigger Displayed",e,this.triggerContext.triggerData);Mt(r);let n={action:"DISPLAYED"};document.dispatchEvent(new CustomEvent("letscooee:outbound:popup-activities",{detail:n}))}sendTriggerClosed(e){let r=e.eventName;delete e.eventName;let n=new xe(r,e,this.triggerContext.triggerData);n.name==="CE Trigger Clicked"&&(n.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(o=>o.toEmbed())),Mt(n)}addEnterAnimation(e){this.containerHTMLElement.animate(e.getEnterAnimation(),{duration:500})}renderElement(e,r,n){r instanceof zo?new ul(e,r,n).render():r instanceof Yo?new fl(e,r,n).render():r instanceof Tn?new Is(e,r,n).render():r instanceof Ko?new pl(e,r,n).render():r instanceof on?new yo(e,r,n).render():r instanceof Zn?new xs(e,r,n).render():r instanceof Go?new cl(e,r,n).render():r instanceof qo?new ll(e,r,n).render():b.error("Unsupported element type- "+r.type)}renderContainer(e){let r=this.ian?.cont;r&&(this.containerHTMLElement=new al(this.rootContainer,r,e).render().getHTMLElement(),new nl().loadAllFonts(this.ian),this.ian.elems?.forEach(async n=>{await this.renderElement(this.containerHTMLElement,n,e)}),this.addEnterAnimation(this.ian.anim))}closeInApp(e){let r=this.ian.anim.getExitAnimation();this.sendTriggerClosed(e),t.ACTIVE_TRIGGER_DATA=void 0;let n=this.containerHTMLElement.animate(r,{duration:500,easing:"ease-in-out"});n.onfinish=()=>{this.removeInApp(),window.removeEventListener("resize",this.resizeListener)}}screenResized(){this.removeInApp(),this.startRendering()}removeInApp(){let e=document.querySelector(`.${this.triggerContext.rootClassName}`);e&&e.parentElement.removeChild(e)}skipTrigger(e,r){let n=new xe("CE Campaign Rejected",r,e);Mt(n)}async preloadImages(e){let r=e.ian;if(!r)return;let n=[];r.elems.forEach(o=>{let i=o.bg?.img?.src;if(i&&n.push(i),o.t===1){let s=o.src;if(!s)return;n.push(s)}}),r.bg?.img?.src&&n.push(r.bg.img.src),r.cont.bg?.img?.src&&n.push(r.cont.bg.img.src),await Promise.all(n.map(o=>ev(o)))}};var ml=class{triggerData;render(e){e.contentSource===Di.KLAVIYO&&(this.triggerData=e,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",e.klaviyoFormID]))}handleKlaviyoEvents(e){if(e.type!=="klaviyoForms")return;let r=e.detail;if(r.formId!==this.triggerData.klaviyoFormID){b.warn("Received invalid trigger callback");return}switch(r.type){case"open":Mt(new xe("CE Trigger Displayed",{form:{id:r.formId}},this.triggerData));break;case"stepSubmit":{let n=this.getFormDetails(r);Mt(new xe("CE Form Submitted",{form:n},this.triggerData)),bi(n);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),Mt(new xe("CE Trigger Closed",{form:{id:r.formId}},this.triggerData));break}}getFormDetails(e){let r={id:e.formId},n=e.metaData;if(_t.hasKeys(n)){let o=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(n).forEach(a=>{o.includes(a)||(r[a]=n[a])}),r.email=n.$email??n.email,r.mobile=n.$phone_number??n.phone_number;let i=n.$first_name??n.first_name,s=n.$last_name??n.last_name;(i?.length||s?.length)&&(r.name=i+" "+s)}return r}};function pv(t){if(!mT()||!ze.get().pixelPush)return;let r=mo[t.intent]?.toLowerCase();r&&(b.verbose(`Sending ${r} intent to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:r}))}function mT(){return window.fbq&&typeof window.fbq=="function"}var $p=new Map,dl=async t=>{for(let i of t.items)if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(i,t)}catch(s){b.error(s)}if(t.isCartEmbed()&&!t.isSubscriptionUpsell()){let s=(await me.getCurrent().getNormalisedCart()).items.map(a=>a.mID);t.items=t.items.filter(a=>!s.includes(a.mID))}if(t.items=mv(t),ze.get().currencyCount<=1)return t.items;if(t.isShoppableVideo())return await dT(t.content.videoConfig,t),t.items;let e=t.items.length,r=t.items.map(i=>dv(i,t)),o=(await Promise.all(r)).filter(i=>i!=null);if(e&&!o.length){let i="Failed to fetch any product from Ajax API",s=new xe("CE Campaign Failed",{reason:i,currency:t.currency},t);throw Mt(s),new Error(i)}return mv(t,o)},mv=(t,e=t.items)=>{if(!t.isCartRecovery())return e;let r=me.getCurrent().items,n=[];for(let o of e)for(let i of o.vars){if(!i.isAvailable)continue;let s=r.find(f=>f.variant_id.toString()===i.mID);if(!s)continue;let a=new xt(o);a.name=s.title;let l=new Mr(i);l.name=s.variant_title,l.price.d=s.discounted_price/100,a.variants=[l],n.push(a)}return n},dT=async(t,e)=>{await Promise.all(t.videos.map(async r=>{r.items=await Promise.all(r.items.map(async n=>{let o=await dv(n,e);return o||n}))}))},dv=async(t,e)=>{if($p.has(t.mID))return $p.get(t.mID);let r,n=`/products/${t.slug}.js`;try{r=(await Jr(n)).data}catch(o){return o instanceof Zt&&o.response?.status===404||ae(o,"fetch-shopify-product",{extra:{item:t,path:n},engagementTrigger:e}),null}return r?hT(t,r):(b.error("Item not found after AJAX call for:",t),null)},hT=(t,e)=>{if(!t||!e)return t;t.name=e.title,t.tags=e.tags,t.slug=e.handle;let r=t.selectedOrFirstVariant.value;return t.vars.map(n=>{let o=e.variants.find(i=>i.id===+n.mID);o!=null&&(n.name=o.title,n.isAvailable=o.available,n.price.d=o.price?o.price/100:o.price,n.price.effective=n.price.d,n.price.cmp=o.compare_at_price?o.compare_at_price/100:o.compare_at_price,+r.mID===o.id&&(r.effectivePrice.value=n.price.d))}),$p.set(t.mID,t),t};var Vp="/v1/event/track-page-unload";function Tt(t){b.verbose(`Waiting for auth to send event ${t.name}`),Sr(lr).then(()=>Mt(t))}function Zy(t){Sr(lr).then(()=>{gT(t)})}async function gT(t){let e=fe().currentPageViewEvent;if(!e){b.warn("No page view event was stored previously");return}let r={pageViewEventID:e.id,pageViewEventName:e.name,pageActiveTimeMS:t};b.verbose("Sending page unload",r);try{await Yt(Vp,r)}catch(n){throw b.error(`Error sending page unload for ${e} to server`,n),n}}function Mt(t){yT(t)}async function yT(t){if(b.verbose(`Sending event: ${t.name}`,t),ST(t)){b.warn(`Rejecting event ${t.name}`);return}Xy();let e=await Fn();Object.assign(t,e),Qy(),It.set("lastUsedTime",new Date().getTime());let r=wT(t.name),n=r.toLowerCase().replace(/\s+/g,"-");try{let o=await Yt(`/v1/event/track/${n}`,t);b.info("Event tracked:",r),vT(t)&&(fe().currentPageViewEvent={id:t.id,name:t.name}),ET(t,o.data)}catch(o){throw b.error(`Error sending event ${t.name} to server`,o),o}}function vT(t){return fm.includes(t.name)?t.name==="View Cart"?!t.properties.drawer:!0:!1}function ET(t,e){_T(t,e).catch(r=>{ae(r,"process-popup-response",{extra:{event:t,response:e}})}),bT(e)}async function _T(t,e){if(!e.triggerData)return;let r=new St(e.triggerData);r.occurred=t.occurred,b.log(`${r} will be shown`);let n;try{n=await dl(r)}catch(o){b.error("Failed to refresh the products",o);return}if(r.items=n,r.contentSource===Di.KLAVIYO){new ml().render(r);return}new kn().renderEngagement(r).catch(o=>{ae(o,"render-popup",{extra:{event:t},engagementTrigger:r})})}function bT(t){t.intent&&(Uy(t.intent),pv(t),b.info(`Intent is ${mo[t.intent]}`))}function wT(t){return t.replace("CE ","").replace("Trigger","Campaign").replace("Screen","Page").replace("App ","")}function ST(t){return t.trigger?.triggerID==="test"||t.trigger?.triggerID==="preview"?(b.warn("Not sending event as this is a test trigger"),!0):!1}var TT="keepalive"in new Request(""),Gr=new Headers;RT();async function Fn(){let[t]=await Promise.all([Vy()]);return E(E({},Hc()),t)}function bi(t){Sr(lr).then(()=>IT(t??{}))}function IT(t){gv("/v1/user/update",t).then(()=>{b.verbose("Updated user profile")}).catch(e=>{b.error("Error saving user profile",e)})}function hv(t){return Yt("/v1/event/generate-discount",t)}function hl(t){Sr(lr).then(()=>xT({props:t}))}function xT(t){gv("/v1/device/update",t).then(()=>{b.verbose("Updated device properties")}).catch(async e=>{b.error("Error saving device property",e)})}function zy(t){t&&Gr.set("cooee-device-id",t)}function Yy(t){t&&Gr.set("cooee-first-seen",t.toUTCString())}function Yt(t,e){return yv("POST",t,e)}function gv(t,e){return yv("PUT",t,e)}function yv(t,e,r){if(!es()&&!fe().flags?.allowEvents)return b.log(`Rejecting ${t} ${e} as this is not e-commerce app`),Promise.reject();if(e.startsWith("http")||(e=dr.apiURL+e),r&&!TT&&e.includes(Vp))return CT(e,Gr,r);let n={method:t,headers:Gr,keepalive:!1};return r&&(n.body=JSON.stringify(r)),Jr(e,n)}function CT(t,e,r){return new Promise((n,o)=>{let i=new XMLHttpRequest;i.open("POST",t,!0),e.forEach((s,a)=>{i.setRequestHeader(a,s)}),i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(i.status>=200&&i.status<300)try{if(i.getResponseHeader("Content-Type")?.includes("application/json")){let a=JSON.parse(i.responseText);n({data:a,headers:e,request:i,status:i.status,statusText:i.statusText})}else o(new Error("Content-Type of response header is not json"))}catch(s){o(s)}else o(new Error(`Received status - ${i.status}(${i.statusText})`))},i.onerror=()=>{o(new Error("Network error occurred during the request."))},i.send(JSON.stringify(r))})}function RT(){Gr.set("Content-Type","application/json; charset=utf-8"),Gr.set("cooee-sdk",$s),Gr.set("cooee-sdk-code",am.toString()),Gr.set("cooee-sdk-version",Vs),Gr.set("cooee-shop-name",tc()??""),dr.debug&&Gr.set("cooee-sdk-debug",String(1))}var gl=class{modifications=[];constructor(){sn(`.lc-hide {display: none !important;height: 0 !important;}
|
|
54
54
|
.lc-display-block {display: block !important;}
|
|
55
|
-
.lc-display-inline {display: inline !important;}`,document.body)}execute(e){for(let r of e){if(!r.experimentConfig)continue;this.executeExperiment(r)&&this.trackExperimentRan(r)}if(document.querySelector("#lc-hide-body")?.remove(),!document.body){Ea("No body element found","error");return}this.setupMutationObserver()}executeExperiment(e){let r=e.experimentConfig?.modifications;if(!r?.length)return w.log("Nothing to experiment",e.toString()),!0;let n=!1;for(let o of r){if(!o.cssSelector){w.verbose("No CSS Selector available",e?.toString());continue}this.modifications.push(o);let i=Array.from(document.querySelectorAll(o.cssSelector));i?.length&&(this.executeSingleModification(o,i),n=!0)}return n}executeSingleModification(e,r){if(r?.length)for(let n of r)Object.assign(n.style,e.style),e.display==="HIDE"?n.classList.add("lc-hide"):e.display==="BLOCK"?n.classList.add("lc-display-block"):e.display==="INLINE"&&n.classList.add("lc-display-inline"),e.type==="TEXT"&&e.text?n.innerHTML=e.text:e.type==="IMAGE"&&this.updateImage(e,n),e.moveTo?.selector&&this.changePlacement(e,n).catch(console.error)}async changePlacement(e,r){let n=await Sn(e.moveTo.selector);if(n)switch(e.moveTo.position){case At.BEFORE1:{r.nextElementSibling!==n&&n.parentElement?.insertBefore(r,n);break}case At.INSIDE_FIRST1:{n.firstChild!==r&&n.insertBefore(r,n.firstChild);break}case At.INSIDE_LAST1:{n.lastChild!==r&&n.appendChild(r);break}case At.AFTER1:default:r.previousElementSibling!==n&&n.parentElement?.insertBefore(r,n.nextSibling)}}trackExperimentRan(e){if(e.id==="preview"){w.warn("Skipping experiment attribution as its preview",e.toString());return}vv({name:"CE Experiment Start",experiment:new An(e)}).catch(r=>{w.error("Fail to track experiment",r)})}setupMutationObserver(){new MutationObserver(r=>{r.forEach(n=>{n.addedNodes.forEach(o=>{o instanceof HTMLElement&&this.modifications.forEach(i=>{if(o.matches&&o.matches(i.cssSelector))w.verbose("1. Re-applying experiment",i.toString()),this.executeSingleModification(i,[o]);else if(o.querySelectorAll){let s=Array.from(o.querySelectorAll(i.cssSelector));if(!s.length)return;w.verbose("2. Re-applying experiment",i.toString()),this.executeSingleModification(i,s)}})})})}).observe(document.body,{childList:!0,subtree:!0})}updateImage(e,r){let n=e.image?.lg?.src,o=e.image?.sm?.src;!n&&!o||(r instanceof HTMLPictureElement?this.updatePictureElement({desktop:n,mobile:o},r):this.updateImageElement({desktop:n,mobile:o},r))}updateImageElement(e,r){Wr()&&e.mobile?(r.setAttribute("src",e.mobile),r.removeAttribute("srcset")):e.desktop&&(r.setAttribute("src",e.desktop),r.removeAttribute("srcset"))}updatePictureElement(e,r){if(r.innerHTML="",e.mobile){let o=document.createElement("source");o.srcset=e.mobile,o.media="(max-width: 767px)",r.append(o)}if(e.desktop){let o=document.createElement("source");o.srcset=e.desktop,o.media="(min-width: 768px)",r.append(o)}let n=document.createElement("img");n.src=e.desktop??e.mobile??"",r.append(n)}};async function vv(t){let e=await Fn(),r=E(E({},t),e);await Yt("/v1/event/experiment",r)}function yl(){RT().catch(t=>ae(t,"fetch-experiments"))}async function RT(){fe().activeExperiments&&(await Sr(lr),await AT())}async function AT(){w.info("Fetch experiments after \u23F0",So()+" of SDK load");let t=await Fn(),e=E({},t);Yt("/v1/engagement/experiments",e).then(async r=>{w.info(`Experiments fetched in \u23F0 ${Tr(r.timeTakenMs)}`);let n=r.data.experiments.map(o=>new St(o));new gl().execute(n)}).catch(r=>{w.error("Error sending experiment getter",r)})}var Ev=zr(Ws());var fn=class{constructor(e){this.triggerContext=e}async execute(e){let r=fe().currentItem,n=e.clickAction;if(!n)return;let o=e.item,i=this.triggerContext,s=new Ei,a=i.triggerData.redirectBehaviour,l=!!i.triggerData.discount?.type&&!!n?.applyDiscount,f={selectedVariants:i.triggerData.nonMutableItems.map(A=>({itemMID:A.mID,mID:A.selectedOrFirstVariant.value.mID,variantID:A.selectedOrFirstVariant.value.mID})),eID:i.triggerData.engagementID,cID:i.triggerData.contentID},m="",d=[],_=[];if(o?_=[o.toEmbed()]:e.embeddedItem&&(_=[e.embeddedItem]),n.at===we.ADD_BUNDLE){let A=i.selectedItems;if(_=e.embeddedItems??A.map(B=>B.toEmbed()),i.shouldGiveFBTDiscount||e.embeddedItems?.length){let B;e.embeddedItems?B=e.embeddedItems.map(P=>({itemMID:P.mID,mID:P.vID,variantID:P.vID,quantity:P.quantity})):B=A.map(P=>({itemMID:P.mID,mID:P.selectedOrFirstVariant.value.mID,variantID:P.selectedOrFirstVariant.value.mID}));let q=i.triggerData.bundleFrom;i.triggerData.isBundleOnCartDrawer()&&q&&(B.push({itemMID:q.mID,mID:q.selectedOrFirstVariant.value.mID,isPrimary:!0}),_.unshift(q.toEmbed())),f.selectedVariants=B,i.triggerData.isBundleOnPDP()&&f.selectedVariants.forEach(P=>{P.mID===r.vID&&(P.isPrimary=!0)})}else f=void 0;d=e.embeddedItems??A}else if(n.at===we.INITIATE_CHECKOUT){let A=await me.getCurrent().getNormalisedCart();_=A.items,f.selectedVariants=A.items.map(B=>({itemMID:B.mID,mID:B.vID}))}else if(n.at===we.ADD_TO_CART)d=o?[o]:[e.embeddedItem];else if(n.at===we.QUICK_VIEW){window.cooeeShowQuickItem(this.triggerContext,o),this.sendTriggerClicked(_,{from:"button"},e.video);return}else if(n.at===we.GO_TO_PRODUCT)m=o?Wo("/products/"+o.slug):e.embeddedItem?.link;else if(n.at===we.GO_TO_URL){let A=Uo(n.gu?.u);window.CooeeSDK.allowExternalURL?A&&(m=A.href):A&&(m=A.pathname+A.search+A.hash)}else if(n.at===we.UPGRADE_TO_SUBSCRIPTION){let A=await s.upgradeToSubscription(o,i.triggerData);this.triggerContext.triggerData.skipSubscribedItems&&this.triggerContext.renderer.destroy(),ot.get().refreshUI(A)}else if(n.at===we.GO_TO_COLLECTION){let A=this.triggerContext.triggerData.collections?.[0];A&&(m="collections/"+A.handle)}if(this.sendTriggerClicked(_,{from:"button"},e.video),w.verbose({redirectPath:m,redirectBehaviour:a,hasDiscount:l}),!l&&m){location.href=m;return}let y,C=!1;try{y=await this.getOrGenerateDiscountCode(f),w.verbose("Discount code (if any) to apply",y)}catch(A){if(!this.triggerContext.triggerData.isBYOB()){Ev.default.error("Unable to get a discount code",A);return}}if(y&&n.at===we.COPY_COUPON_CODE)await s.copyDiscountCode(y);else if(n.at===we.BUY_NOW){let A=await s.createNewCart(r,y,i.triggerData);A&&(location.href=A);return}try{y&&await Un.applyWithStorefront([y])}catch(A){w.error(A),C=!0}let N;if(d?.length&&(N=await s.addToCart(d,i.triggerData)),C&&y){Un.navigate(y,a,m);return}if(m){location.href=m;return}Un.navigateWithoutDiscount(a,N)}sendTriggerClicked(e,r,n){let o=new xe("CE Trigger Clicked",r,this.triggerContext.triggerData);o.items=e,o.setVideos(n),Mt(o)}async getOrGenerateDiscountCode(e){let r=this.triggerContext.triggerData.discount;if(!r?.type)return;let n="";if(r.type===Jt.STATIC){if(!r.code)throw dh("No discount code found","warning",{triggerContext:this.triggerContext}),new Error("No discount code found");return r.code}if(e){if(n=await DT(e,this.triggerContext),!n)throw w.error("No discount code found",e),new Error("Discount code not found or generated");return n}}};async function DT(t,e){try{return(await hv(t)).data.code}catch(r){throw Er("Failed to generate a discount code"),ae(r,"backend-generate-discount",{triggerContext:e}),r}}var Ue=class extends Pr{stylesConverter=new vi(1);mediaStyle={};deviceTypeKey;clickExecutor;componentWillMount(){this.deviceTypeKey=Wr()?"sm":"lg",this.clickExecutor=new fn(this.props.triggerContext)}getCompiledStyles(){return this.putStyleAccordingToDevice(),E(E(Z(E(E(E(E(E(E({},this.stylesConverter.getFlexStyles(this.mediaStyle.flex)),this.stylesConverter.getBackgroundStyles(this.mediaStyle.bg)),this.stylesConverter.getBorderStyles(this.mediaStyle.br)),this.stylesConverter.getSizeStyles(this.mediaStyle.size)),this.stylesConverter.getSpaceStyles(this.mediaStyle.spc)),this.stylesConverter.getLayoutStyles(this.mediaStyle.lout)),{boxSizing:"border-box",outline:"none"}),this.getComponentStyles()),this.props.style)}matchWhenCondition(e){if(!e?.op)return!0;let{lhs:r,rhs:n}=e;switch(e.op){case"eq":return r===n;case"gt":return+r>+n;case"gte":return+r>=+n;case"lt":return+r<+n;case"lte":return+r<=+n;case"ne":return r!==n;case"null":return r==null;case"empty":return r.trim()==="";case"in":return new RegExp(`\\b${n}\\b`).test(r);case"nin":return!new RegExp(`\\b${n}\\b`).test(r);default:return w.error(`Invalid operator found for when condition - ${e.op}`),!1}}putStyleAccordingToDevice(){let e=this.props.element;this.mediaStyle=e.style.lg,Wr()&&e.style.sm&&Object.keys(e.style.sm).length&&(this.mediaStyle=E(E({},this.mediaStyle),e.style.sm))}sendTriggerClicked(e,r){this.clickExecutor.sendTriggerClicked(e,r)}async onClick(e,r){e.stopPropagation(),r.clickAction||(r.clickAction=this.props.element.clc),r.clickAction?.at&&await this.clickExecutor.execute(r)}};var OT=0,eG=Array.isArray;function K(t,e,r,n,o,i){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?s=e[a]:l[a]=e[a];var f={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--OT,__i:-1,__u:0,__source:o,__self:i};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)l[a]===void 0&&(l[a]=s[a]);return Te.vnode&&Te.vnode(f),f}var Kt=class extends Ue{componentDidMount(){this.setState(()=>({text:this.props.element.text})),bt(this.onChange.bind(this))}componentWillReceiveProps(e){this.props.element=e.element,this.onChange()}render(){let e=this.getCompiledStyles(),r=this.state.text;return r||(e.display="none",r=""),K("div",{style:e,onClick:this.customOnClick.bind(this),className:"lc-text",children:K("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:r}})})}customOnClick(){this.props.onClick&&this.props.onClick("title")}onChange(){if(this.props.element.text==null)return;let e=this.props.triggerContext.triggerData,r={bundle:e.discountData.value,customer:e.customerData,cart:e.getCartMagicVariables()},n=Qn(this.props.element,r,this.props.triggerContext),o=new ht(n);if(!this.matchWhenCondition(o.when)){this.setState(()=>({text:""}));return}this.setState(()=>({text:o.text}))}getTypoStyles(){let e={},r=this.mediaStyle.typo??new st;return e.letterSpacing=r.letterSpacing,e.fontSize=r.fs+"px",e.lineHeight=r.lh,e.fontFamily=r.fam.name||"inherit",e.textAlign=r.alignment,e.fontWeight=r.fw,e.textDecoration=r.td??"none",this.stylesConverter.getColourStyles(r.tc,"color",e),e}getComponentStyles(){return E({},this.getTypoStyles())}getSpanStyle(){return{overflow:"hidden",display:"-webkit-box",webkitBoxOrient:"vertical",webkitLineClamp:2,color:"inherit",fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit"}}};var vo=class extends Kt{render(){return K("div",{style:this.getCompiledStyles(),className:"lc-button",onClick:e=>this.onClick(e,{item:this.props.item}),children:K("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:this.state.text}})})}getComponentStyles(){return Z(E({},super.getComponentStyles()),{cursor:"pointer"})}};var Wp=class extends Pr{render(){if(this.props.element.show[this.props.label.toLowerCase()])return this.props.element.lblPos==="end"?K("div",{style:E(E({},this.getElementStyle()),this.props.styles),children:[K("span",{children:this.props.time}),K("span",{style:this.getTimeLabelStyle(),children:this.props.label})]}):K("div",{style:E(E({},this.getElementStyle()),this.props.styles),children:[K("span",{style:this.getTimeLabelStyle(),children:this.props.label}),K("span",{children:this.props.time})]})}getDesign(){}getTimeLabelStyle(){return{fontSize:"0.5em",alignContent:"center"}}getElementStyle(){let e={display:"flex",flexDirection:"column",placeContent:"center center",textAlign:"center"};return this.props.element.horizontal&&(e.gridTemplateColumns="repeat(2, minmax(0, 1fr))"),e}},Rs=class extends Kt{labels={Days:"00",Hours:"00",Minutes:"00",Seconds:"00"};componentWillMount(){super.componentWillMount(),this.setState(()=>E({},this.labels)),this.processAndStartTimer()}render(){return K("div",{style:this.getLabelsParentStyle(),children:Object.keys(this.labels).map(e=>K(Wp,{styles:this.getCompiledStyles(),label:e,time:this.state[e],element:this.props.element}))})}getLabelsParentStyle(){return{display:"grid",justifyContent:"center",gridTemplateColumns:"repeat(4, auto)",gap:this.stylesConverter.getSizePx(this.props.element.gap)}}getDisplayStyles(){return{display:"grid",placeContent:"center center"}}getComponentStyles(){return E(E({},super.getComponentStyles()),this.getDisplayStyles())}processAndStartTimer(){this.props.element.timer.start(this.props.element.timerType,e=>{this.labels.Days=String(e.days).padStart(2,"0"),this.labels.Hours=String(e.hours).padStart(2,"0"),this.labels.Minutes=String(e.minutes).padStart(2,"0"),this.labels.Seconds=String(e.seconds).padStart(2,"0"),this.setState(()=>E({},this.labels))})}};function vl(t,e){if(!t)return;let r={loop:e.loop,slidesPerView:e.maxInRow,spaceBetween:e.gap+"px",pagination:{type:e.pagination.type,el:t.querySelector(".swiper-pagination"),clickable:!0,renderBullet:(o,i)=>`
|
|
55
|
+
.lc-display-inline {display: inline !important;}`,document.body)}execute(e){for(let r of e){if(!r.experimentConfig)continue;this.executeExperiment(r)&&this.trackExperimentRan(r)}if(document.querySelector("#lc-hide-body")?.remove(),!document.body){Ea("No body element found","error");return}this.setupMutationObserver()}executeExperiment(e){let r=e.experimentConfig?.modifications;if(!r?.length)return b.log("Nothing to experiment",e.toString()),!0;let n=!1;for(let o of r){if(!o.cssSelector){b.verbose("No CSS Selector available",e?.toString());continue}this.modifications.push(o);let i=Array.from(document.querySelectorAll(o.cssSelector));i?.length&&(this.executeSingleModification(o,i),n=!0)}return n}executeSingleModification(e,r){if(r?.length)for(let n of r)Object.assign(n.style,e.style),e.display==="HIDE"?n.classList.add("lc-hide"):e.display==="BLOCK"?n.classList.add("lc-display-block"):e.display==="INLINE"&&n.classList.add("lc-display-inline"),e.type==="TEXT"&&e.text?n.innerHTML=e.text:e.type==="IMAGE"&&this.updateImage(e,n),e.moveTo?.selector&&this.changePlacement(e,n).catch(console.error)}async changePlacement(e,r){let n=await Sn(e.moveTo.selector);if(n)switch(e.moveTo.position){case At.BEFORE1:{r.nextElementSibling!==n&&n.parentElement?.insertBefore(r,n);break}case At.INSIDE_FIRST1:{n.firstChild!==r&&n.insertBefore(r,n.firstChild);break}case At.INSIDE_LAST1:{n.lastChild!==r&&n.appendChild(r);break}case At.AFTER1:default:r.previousElementSibling!==n&&n.parentElement?.insertBefore(r,n.nextSibling)}}trackExperimentRan(e){if(e.id==="preview"){b.warn("Skipping experiment attribution as its preview",e.toString());return}vv({name:"CE Experiment Start",experiment:new An(e)}).catch(r=>{b.error("Fail to track experiment",r)})}setupMutationObserver(){new MutationObserver(r=>{r.forEach(n=>{n.addedNodes.forEach(o=>{o instanceof HTMLElement&&this.modifications.forEach(i=>{if(o.matches&&o.matches(i.cssSelector))b.verbose("1. Re-applying experiment",i.toString()),this.executeSingleModification(i,[o]);else if(o.querySelectorAll){let s=Array.from(o.querySelectorAll(i.cssSelector));if(!s.length)return;b.verbose("2. Re-applying experiment",i.toString()),this.executeSingleModification(i,s)}})})})}).observe(document.body,{childList:!0,subtree:!0})}updateImage(e,r){let n=e.image?.lg?.src,o=e.image?.sm?.src;!n&&!o||(r instanceof HTMLPictureElement?this.updatePictureElement({desktop:n,mobile:o},r):this.updateImageElement({desktop:n,mobile:o},r))}updateImageElement(e,r){Wr()&&e.mobile?(r.setAttribute("src",e.mobile),r.removeAttribute("srcset")):e.desktop&&(r.setAttribute("src",e.desktop),r.removeAttribute("srcset"))}updatePictureElement(e,r){if(r.innerHTML="",e.mobile){let o=document.createElement("source");o.srcset=e.mobile,o.media="(max-width: 767px)",r.append(o)}if(e.desktop){let o=document.createElement("source");o.srcset=e.desktop,o.media="(min-width: 768px)",r.append(o)}let n=document.createElement("img");n.src=e.desktop??e.mobile??"",r.append(n)}};async function vv(t){let e=await Fn(),r=E(E({},t),e);await Yt("/v1/event/experiment",r)}function yl(){AT().catch(t=>ae(t,"fetch-experiments"))}async function AT(){fe().activeExperiments&&(await Sr(lr),await DT())}async function DT(){b.info("Fetch experiments after \u23F0",So()+" of SDK load");let t=await Fn(),e=E({},t);Yt("/v1/engagement/experiments",e).then(async r=>{b.info(`Experiments fetched in \u23F0 ${Tr(r.timeTakenMs)}`);let n=r.data.experiments.map(o=>new St(o));new gl().execute(n)}).catch(r=>{b.error("Error sending experiment getter",r)})}var Ev=zr(Ws());var fn=class{constructor(e){this.triggerContext=e}async execute(e){let r=fe().currentItem,n=e.clickAction;if(!n)return;let o=e.item,i=this.triggerContext,s=new Ei,a=i.triggerData.redirectBehaviour,l=!!i.triggerData.discount?.type&&!!n?.applyDiscount,f={selectedVariants:i.triggerData.nonMutableItems.map(A=>({itemMID:A.mID,mID:A.selectedOrFirstVariant.value.mID,variantID:A.selectedOrFirstVariant.value.mID})),eID:i.triggerData.engagementID,cID:i.triggerData.contentID},m="",d=[],_=[];if(o?_=[o.toEmbed()]:e.embeddedItem&&(_=[e.embeddedItem]),n.at===be.ADD_BUNDLE){let A=i.selectedItems;if(_=e.embeddedItems??A.map(B=>B.toEmbed()),i.shouldGiveFBTDiscount||e.embeddedItems?.length){let B;e.embeddedItems?B=e.embeddedItems.map(P=>({itemMID:P.mID,mID:P.vID,variantID:P.vID,quantity:P.quantity})):B=A.map(P=>({itemMID:P.mID,mID:P.selectedOrFirstVariant.value.mID,variantID:P.selectedOrFirstVariant.value.mID}));let q=i.triggerData.bundleFrom;i.triggerData.isBundleOnCartDrawer()&&q&&(B.push({itemMID:q.mID,mID:q.selectedOrFirstVariant.value.mID,isPrimary:!0}),_.unshift(q.toEmbed())),f.selectedVariants=B,i.triggerData.isBundleOnPDP()&&f.selectedVariants.forEach(P=>{P.mID===r.vID&&(P.isPrimary=!0)})}else f=void 0;d=e.embeddedItems??A}else if(n.at===be.INITIATE_CHECKOUT){let A=await me.getCurrent().getNormalisedCart();_=A.items,f.selectedVariants=A.items.map(B=>({itemMID:B.mID,mID:B.vID}))}else if(n.at===be.ADD_TO_CART)d=o?[o]:[e.embeddedItem];else if(n.at===be.QUICK_VIEW){window.cooeeShowQuickItem(this.triggerContext,o),this.sendTriggerClicked(_,{from:"button"},e.video);return}else if(n.at===be.GO_TO_PRODUCT)m=o?Wo("/products/"+o.slug):e.embeddedItem?.link;else if(n.at===be.GO_TO_URL){let A=Uo(n.gu?.u);window.CooeeSDK.allowExternalURL?A&&(m=A.href):A&&(m=A.pathname+A.search+A.hash)}else if(n.at===be.UPGRADE_TO_SUBSCRIPTION){let A=await s.upgradeToSubscription(o,i.triggerData);this.triggerContext.triggerData.skipSubscribedItems&&this.triggerContext.renderer.destroy(),ot.get().refreshUI(A)}else if(n.at===be.GO_TO_COLLECTION){let A=this.triggerContext.triggerData.collections?.[0];A&&(m="collections/"+A.handle)}if(this.sendTriggerClicked(_,{from:"button"},e.video),b.verbose({redirectPath:m,redirectBehaviour:a,hasDiscount:l}),!l&&m){location.href=m;return}let y,C=!1;try{y=await this.getOrGenerateDiscountCode(f),b.verbose("Discount code (if any) to apply",y)}catch(A){if(!this.triggerContext.triggerData.isBYOB()){Ev.default.error("Unable to get a discount code",A);return}}if(y&&n.at===be.COPY_COUPON_CODE)await s.copyDiscountCode(y);else if(n.at===be.BUY_NOW){let A=await s.createNewCart(r,y,i.triggerData);A&&(location.href=A);return}try{y&&await Un.applyWithStorefront([y])}catch(A){b.error(A),C=!0}let N;if(d?.length&&(N=await s.addToCart(d,i.triggerData)),C&&y){Un.navigate(y,a,m);return}if(m){location.href=m;return}Un.navigateWithoutDiscount(a,N)}sendTriggerClicked(e,r,n){let o=new xe("CE Trigger Clicked",r,this.triggerContext.triggerData);o.items=e,o.setVideos(n),Mt(o)}async getOrGenerateDiscountCode(e){let r=this.triggerContext.triggerData.discount;if(!r?.type)return;let n="";if(r.type===Jt.STATIC){if(!r.code)throw dh("No discount code found","warning",{triggerContext:this.triggerContext}),new Error("No discount code found");return r.code}if(e){if(n=await OT(e,this.triggerContext),!n)throw b.error("No discount code found",e),new Error("Discount code not found or generated");return n}}};async function OT(t,e){try{return(await hv(t)).data.code}catch(r){throw Er("Failed to generate a discount code"),ae(r,"backend-generate-discount",{triggerContext:e}),r}}var Ue=class extends Pr{stylesConverter=new vi(1);mediaStyle={};deviceTypeKey;clickExecutor;componentWillMount(){this.deviceTypeKey=Wr()?"sm":"lg",this.clickExecutor=new fn(this.props.triggerContext)}getCompiledStyles(){return this.putStyleAccordingToDevice(),E(E(Z(E(E(E(E(E(E({},this.stylesConverter.getFlexStyles(this.mediaStyle.flex)),this.stylesConverter.getBackgroundStyles(this.mediaStyle.bg)),this.stylesConverter.getBorderStyles(this.mediaStyle.br)),this.stylesConverter.getSizeStyles(this.mediaStyle.size)),this.stylesConverter.getSpaceStyles(this.mediaStyle.spc)),this.stylesConverter.getLayoutStyles(this.mediaStyle.lout)),{boxSizing:"border-box",outline:"none"}),this.getComponentStyles()),this.props.style)}matchWhenCondition(e){if(!e?.op)return!0;let{lhs:r,rhs:n}=e;switch(e.op){case"eq":return r===n;case"gt":return+r>+n;case"gte":return+r>=+n;case"lt":return+r<+n;case"lte":return+r<=+n;case"ne":return r!==n;case"null":return r==null;case"empty":return r.trim()==="";case"in":return new RegExp(`\\b${n}\\b`).test(r);case"nin":return!new RegExp(`\\b${n}\\b`).test(r);default:return b.error(`Invalid operator found for when condition - ${e.op}`),!1}}putStyleAccordingToDevice(){let e=this.props.element;this.mediaStyle=e.style.lg,Wr()&&e.style.sm&&Object.keys(e.style.sm).length&&(this.mediaStyle=E(E({},this.mediaStyle),e.style.sm))}sendTriggerClicked(e,r){this.clickExecutor.sendTriggerClicked(e,r)}async onClick(e,r){e.stopPropagation(),r.clickAction||(r.clickAction=this.props.element.clc),r.clickAction?.at&&await this.clickExecutor.execute(r)}};var NT=0,tG=Array.isArray;function K(t,e,r,n,o,i){e||(e={});var s,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?s=e[a]:l[a]=e[a];var f={type:t,props:l,key:r,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--NT,__i:-1,__u:0,__source:o,__self:i};if(typeof t=="function"&&(s=t.defaultProps))for(a in s)l[a]===void 0&&(l[a]=s[a]);return Te.vnode&&Te.vnode(f),f}var Kt=class extends Ue{componentDidMount(){this.setState(()=>({text:this.props.element.text})),wt(this.onChange.bind(this))}componentWillReceiveProps(e){this.props.element=e.element,this.onChange()}render(){let e=this.getCompiledStyles(),r=this.state.text;return r||(e.display="none",r=""),K("div",{style:e,onClick:this.customOnClick.bind(this),className:"lc-text",children:K("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:r}})})}customOnClick(){this.props.onClick&&this.props.onClick("title")}onChange(){if(this.props.element.text==null)return;let e=this.props.triggerContext.triggerData,r={bundle:e.discountData.value,customer:e.customerData,cart:e.getCartMagicVariables()},n=Qn(this.props.element,r,this.props.triggerContext),o=new ht(n);if(!this.matchWhenCondition(o.when)){this.setState(()=>({text:""}));return}this.setState(()=>({text:o.text}))}getTypoStyles(){let e={},r=this.mediaStyle.typo??new st;return e.letterSpacing=r.letterSpacing,e.fontSize=r.fs+"px",e.lineHeight=r.lh,e.fontFamily=r.fam.name||"inherit",e.textAlign=r.alignment,e.fontWeight=r.fw,e.textDecoration=r.td??"none",this.stylesConverter.getColourStyles(r.tc,"color",e),e}getComponentStyles(){return E({},this.getTypoStyles())}getSpanStyle(){return{overflow:"hidden",display:"-webkit-box",webkitBoxOrient:"vertical",webkitLineClamp:2,color:"inherit",fontSize:"inherit",fontWeight:"inherit",fontFamily:"inherit"}}};var vo=class extends Kt{render(){return K("div",{style:this.getCompiledStyles(),className:"lc-button",onClick:e=>this.onClick(e,{item:this.props.item}),children:K("span",{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:this.state.text}})})}getComponentStyles(){return Z(E({},super.getComponentStyles()),{cursor:"pointer"})}};var Wp=class extends Pr{render(){if(this.props.element.show[this.props.label.toLowerCase()])return this.props.element.lblPos==="end"?K("div",{style:E(E({},this.getElementStyle()),this.props.styles),children:[K("span",{children:this.props.time}),K("span",{style:this.getTimeLabelStyle(),children:this.props.label})]}):K("div",{style:E(E({},this.getElementStyle()),this.props.styles),children:[K("span",{style:this.getTimeLabelStyle(),children:this.props.label}),K("span",{children:this.props.time})]})}getDesign(){}getTimeLabelStyle(){return{fontSize:"0.5em",alignContent:"center"}}getElementStyle(){let e={display:"flex",flexDirection:"column",placeContent:"center center",textAlign:"center"};return this.props.element.horizontal&&(e.gridTemplateColumns="repeat(2, minmax(0, 1fr))"),e}},Rs=class extends Kt{labels={Days:"00",Hours:"00",Minutes:"00",Seconds:"00"};componentWillMount(){super.componentWillMount(),this.setState(()=>E({},this.labels)),this.processAndStartTimer()}render(){return K("div",{style:this.getLabelsParentStyle(),children:Object.keys(this.labels).map(e=>K(Wp,{styles:this.getCompiledStyles(),label:e,time:this.state[e],element:this.props.element}))})}getLabelsParentStyle(){return{display:"grid",justifyContent:"center",gridTemplateColumns:"repeat(4, auto)",gap:this.stylesConverter.getSizePx(this.props.element.gap)}}getDisplayStyles(){return{display:"grid",placeContent:"center center"}}getComponentStyles(){return E(E({},super.getComponentStyles()),this.getDisplayStyles())}processAndStartTimer(){this.props.element.timer.start(this.props.element.timerType,e=>{this.labels.Days=String(e.days).padStart(2,"0"),this.labels.Hours=String(e.hours).padStart(2,"0"),this.labels.Minutes=String(e.minutes).padStart(2,"0"),this.labels.Seconds=String(e.seconds).padStart(2,"0"),this.setState(()=>E({},this.labels))})}};function vl(t,e){if(!t)return;let r={loop:e.loop,slidesPerView:e.maxInRow,spaceBetween:e.gap+"px",pagination:{type:e.pagination.type,el:t.querySelector(".swiper-pagination"),clickable:!0,renderBullet:(o,i)=>`
|
|
56
56
|
<span class="${i}"
|
|
57
57
|
style="background-color: ${e.pagination.color?.rgba};"></span>
|
|
58
58
|
`,renderProgressbar:o=>`
|
|
59
59
|
<span class="${o}"
|
|
60
60
|
style="background-color: ${e.pagination.color?.rgba};">
|
|
61
61
|
</span>
|
|
62
|
-
`},navigation:{nextEl:t.querySelector(".swiper-button-next"),prevEl:t.querySelector(".swiper-button-prev")},autoplay:e.autoplay?.enabled?{delay:e.autoplay?.delay,disableOnInteraction:!1,pauseOnMouseEnter:!1}:!1,autoHeight:!0};e.marquee&&r.autoplay&&typeof r.autoplay=="object"&&(r.speed=e.speed,r.autoplay.pauseOnMouseEnter=!0,t.style.setProperty("--swiper-wrapper-transition-timing-function","linear"));let n=new window.CooeeSDK.Swiper(t,r);return t.style.setProperty("--swiper-navigation-size",`${e.navigation.size}px`),n}function El(t,e,r){let n={color:t.navigation.color?.rgba};return t.pagination.enabled&&(n.transform="translateY(-25%)"),K("div",{class:"swiper-container",ref:e,style:"max-width: 100%",children:[K("div",{class:"swiper-wrapper",children:r()}),t.navigation.enabled&&K("div",{class:"swiper-button-next",style:n,children:K("span",{})}),t.navigation.enabled&&K("div",{class:"swiper-button-prev",style:n,children:K("span",{})}),t.pagination.enabled&&K("div",{className:"swiper-pagination",style:{bottom:0,top:"unset",position:"relative",color:t.pagination.color?.rgba}})]})}var As=class extends Ue{componentDidMount(){bt(()=>{this.setState(()=>({checked:this.props.item.selected.value}))})}render(){return K("div",{style:this.getCompiledStyles(),className:"lc-checkbox",children:K("input",{type:"checkbox",checked:this.state.checked,onChange:this.onChange.bind(this),style:{appearance:"auto"}})})}onChange(e){let{checked:r}=e.target;this.props.item.selected.value=r}getTypoStyles(){let e={},r=this.mediaStyle.typo??new st;return e.textAlign=r.alignment,e.justifyContent=r.alignment,e}getComponentStyles(){return Z(E({},this.getTypoStyles()),{display:"flex"})}};var pn=class extends Ue{constructor(e,r){super(e,r)}render(){let e=this.props.element[this.deviceTypeKey],r=e?.src||this.props.element.src||this.props.element.lg?.src;return K("img",{onClick:this.customOnClick.bind(this),className:"lc-image",alt:e?.name||"Image",onMouseEnter:this.handleMouseEnter.bind(this),onMouseLeave:this.handleMouseLeave.bind(this),src:r,style:this.getCompiledStyles()})}customOnClick(e){this.props.element.clc?.at===we.ADD_TO_CART&&this.props.triggerContext.triggerData.items[0]&&this.onClick(e,{item:this.props.triggerContext.triggerData.items[0]}),this.props.onClick&&this.props.onClick("image")}getComponentStyles(){let e=this.mediaStyle.lout;if(!e||e.pos!=="absolute")return{};let r={zIndex:e.zIndex,cursor:this.props.element.clc?.at?"pointer":"auto"};return this.mediaStyle.size?.w&&(r.width=this.mediaStyle.size.w),this.mediaStyle.size?.h&&(r.height=this.mediaStyle.size.h),r}handleMouseEnter(e){let r=this.props.element[this.deviceTypeKey]?.secondarySrc;r&&(e.currentTarget.src=r)}handleMouseLeave(e){e.currentTarget.src=this.props.element[this.deviceTypeKey]?.src}};var mn=class extends Ue{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return K("div",{style:this.getCompiledStyles(),class:"lc-flexbox",children:K(Hn,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})})}getComponentStyles(){let e=this.mediaStyle.flex??new Xo,r={display:"flex",gap:e.gap+"px",flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai};return e.wrap==="nowrap"&&e.scroll&&(e.dir==="column"?r["overflow-y"]="auto":r["overflow-x"]="auto"),r}};var Ds=class extends mn{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return K("div",{style:this.getCompiledStyles(),class:"lc-flexbox",children:K(bi,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.props.noLinks})})}};var Os=class extends Ue{render(){return K("select",{style:this.getCompiledStyles(),value:this.props.selectedVariant.selectedSellingPlan.value?.mID??"",onChange:this.onChange.bind(this),disabled:this.state.disabled,className:"lc-dropdown",children:this.createSelectItems()})}componentDidMount(){bt(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:!1}))})}getTypoStyles(){let e={},r=this.mediaStyle.typo??new st;return e.letterSpacing=r.letterSpacing,e.fontSize=r.fs+"px",e.lineHeight=r.lh,e.fontFamily="inherit",e.textAlign=r.alignment,e.fontWeight=r.fw,this.stylesConverter.getColourStyles(r.tc,"color",e),e.boxShadow="none",e}getComponentStyles(){let e={};return this.props.selectedVariant.sellingPlans?.length||(e.visibility="hidden"),E(E({},e),this.getTypoStyles())}createSelectItems(){let e=[],r=this.props.selectedVariant;if(!r.sellingPlans?.length)return[];this.props.triggerContext.triggerData.skipSubscribedItems?r.selectedSellingPlan.value||(r.sellingPlans[0].isSelected=!0,r.changeSellingPlan(r.sellingPlans[0])):e.push(K("option",{value:"",selected:!r.selectedSellingPlan,children:"One time purchase"}));for(let n of r.sellingPlans??[])e.push(K("option",{value:n.mID,selected:n.isSelected,children:n.name}));return e}onChange(e){let r=e.target.value;r?this.props.selectedVariant.selectedSellingPlan.value=this.props.selectedVariant.sellingPlans.find(n=>n.mID===r):this.props.selectedVariant.selectedSellingPlan.value=void 0}};var NT=new RegExp('fill="#[a-zA-Z0-9]+"'),Ns=class extends Ue{constructor(){super()}render(){let e=this.getCompiledStyles(),r=this.getRating();return r||(e.display="none",r=""),K("div",{style:e,className:"lc-star-rating",dangerouslySetInnerHTML:{__html:r}})}getRating(){let e={size:this.props.element.iconSize,color:this.props.element.c.hex},r=Vo(this.props.element.fullStar,{svg:e},this.props.triggerContext),n=Vo(this.props.element.halfStart,{svg:e},this.props.triggerContext),o=this.props.review;if(!o?.rating)return"";let i="";if(this.props.element.showSingleStar)i=r;else{let s=5,a=`${o.rating}`.split(".");for(let l=0;l<+a[0];l++)i+=r,s--;a[1]&&(i+=n,s--);for(let l=0;l<s;l++)i+=r.replace(NT,'fill="#f1f1f1"')}return i}getComponentStyles(){return{display:"flex",alignItems:"center"}}};var Ps=class extends Ue{render(){return K("select",{style:this.getCompiledStyles(),value:this.props.item.selectedOrFirstVariant.value.mID,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:"lc-dropdown",children:this.createSelectItems()})}componentDidMount(){bt(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:!1}))})}getTypoStyles(){let e={},r=this.mediaStyle.typo??new st;return e.letterSpacing=r.letterSpacing,e.fontSize=r.fs+"px",e.lineHeight=r.lh,e.fontFamily="inherit",e.textAlign=r.alignment,e.fontWeight=r.fw,this.stylesConverter.getColourStyles(r.tc,"color",e),e.boxShadow="none",e}getComponentStyles(){let e={};return this.props.item.vars?.length===1&&this.props.item.vars[0].name==="Default Title"&&(e.visibility="hidden"),E(E({},e),this.getTypoStyles())}createSelectItems(){let e=[];for(let r of this.props.item.vars)e.push(K("option",{value:r.mID,disabled:!r.isAvailable,children:r.name}));return e}onChange(e){let r=e.target.value,n=this.props.item.vars.find(o=>o.mID===r);this.props.item.setSelectedVariant(n)}};var _v=()=>{let t=window.ShopifyAnalytics?.meta??{},e=t.selectedVariantId;if(e)return e;if(t.product?.variants?.length>0)return t.product.variants[0].id},jp=t=>{if(!t)return;let e;try{e=new URL(t)}catch{return}if(e.hostname!=="cdn.shopify.com")return t;let r=e.pathname.split(".");return r.length!==2?t:(e.pathname=r[0]+"_large."+r[1],e.toString())};var bi=class extends Ue{constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"}))}renderElement(e){if(!(e.hide||!this.matchWhenCondition(e.when))){if(e.t===4){let r=e;return r.l==="Star Rating"&&!this.props.item.reviews?.rating?void 0:K(Ds,{element:r,triggerContext:this.props.triggerContext,elements:r.elems,item:this.props.item,noLinks:this.props.noLinks})}if(e.t===6)return this.props.triggerContext.triggerData.isBundle()?K(As,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):void 0;if(e.t===13){let r=e,n=this.props.item,o=jp(n.variantImage??n.firstImageURL),i=jp(n.variantSecondaryImage??n.secondaryImageURL);r.lg=r.sm={src:o,name:n.name,secondarySrc:i};let s=K(pn,{element:r,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?s:K("a",{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:"block"},children:s})}if(e.t===14)return this.renderProductTitle(e);if(e.t===15){let r=e;return this.props.triggerContext.triggerData.isCartEmbed()&&this.props.item.vars?.length===1&&this.props.item.vars[0].name==="Default Title"?void 0:r.showChips?K("cooee-product-options-picker",{item:this.props.item}):K(Ps,{element:r,item:this.props.item,triggerContext:this.props.triggerContext})}return e.t===16?K(Os,{element:e,selectedVariant:this.props.item.selectedOrFirstVariant.value,item:this.props.item,triggerContext:this.props.triggerContext}):e.t===19?K(Ns,{element:e,triggerContext:this.props.triggerContext,review:this.props.item.reviews}):e.t===18||e.t===3?K(vo,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):K(Hn,{elements:[e],element:this.props.element,triggerContext:this.props.triggerContext})}}render(){return this.attachListener(),this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}renderProductTitle(e){let r=K(Kt,{element:e,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?r:K("a",{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:"block",textDecoration:this.state.decoration},onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),children:r})}customOnClick(e){this.sendTriggerClicked([this.props.item.toEmbed()],{from:e})}onMouseEnter(){this.setState(()=>({decoration:"underline"}))}onMouseLeave(){this.setState(()=>({decoration:"unset"}))}attachListener(){document.addEventListener("letscooee:variant-change",e=>{let r=e;if(!r.detail||this.props.item.mID!==r.detail.productID)return;let n=r.detail.variantID;this.props.item.setSelectedVariantByID(n)})}};var Eo=class extends Ue{productElement;constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"}))}render(){let e=Qn(this.props.element,this.getProductData(),this.props.triggerContext);if(this.productElement=new Cn(e),!(this.productElement.hide||!this.matchWhenCondition(this.productElement.when)))return K("div",{style:E({},this.getCompiledStyles()),class:"lc-single-product",children:K(bi,{element:this.productElement,elements:this.productElement.elems,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.productElement.noLinks})})}getComponentStyles(){return{flexShrink:0}}getProductData(){if(!this.props.item)return{};let e=this.props.item,r=e.selectedOrFirstVariant.value,n=e.getTemplateVariables();n.product.quantity=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(this.props.item.quantity):this.props.item.quantity;let o=this.props.triggerContext.triggerData.discount?.type===Jt.BXGY;return!r.hasEffectivePrice()&&o&&(n.product=Z(E(E({},n.product),Lt("effective_price",r.effectivePrice.value)),{price:""})),n.variant.quantity=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(r.quantity):r.quantity,{product:n.product,variant:n.variant,svg:{color:"{{ svg.color }}",size:"{{ svg.size }}"}}}};var Ls=class extends Ue{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,r){super(e,r),this.configuration=Wr()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+"px"}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&Rc().then(()=>{this.swiperInstance=vl(this.swiperRef,this.props.element.conf[this.deviceTypeKey])})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let r;if(this.configuration.disp===2){let n=i=>{this.swiperRef=i},o=()=>e?.map(i=>K("div",{class:"swiper-slide",children:this.getProductFragment(i)}));r=K("div",{style:Z(E({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:El(this.configuration,n,o)})}else r=K("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((n,o)=>this.getProductFragment(n,o!==e.length-1))});return r}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),r={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(r.flexDirection==="row"){if(e)r.maxWidth="100%",r.overflowY="auto";else if(this.configuration.disp===1){let n=this.props.triggerContext.triggerData,o=n.items.length,i;n.isBundle()?i=this.props.element.prod.symbol?.hide!==!0?o*2-1:o:i=this.props.element.conf[this.deviceTypeKey].maxInRow,r.gridTemplateColumns=`repeat(${i}, auto)`}}return r}getProductFragment(e,r=!1){return K(Lr,{children:[K(Eo,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&r&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&K("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:K(Kt,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var Ms=class extends Ue{swiperRef=null;swiperInstance=null;constructor(e,r){super(e,r)}componentDidMount(){Rc().then(()=>{this.swiperInstance=vl(this.swiperRef,this.props.element.conf)})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.element,r=o=>{this.swiperRef=o},n=()=>{let o=e.values?.map(a=>K("div",{class:"swiper-slide",onClick:l=>this.onClick(l,{clickAction:this.getClickAction(a)}),children:this.renderElement(a)}));if(!o?.length)return[];let i=e.conf,s=o.length;if(i.marquee&&s<=Number(i.maxInRow)){let a=Number(i.maxInRow)-s+1;for(let l=0;l<a;l++)o.push(o[l%s])}return o};return El(e.conf,r,n)}getComponentStyles(){return{}}renderElement(e){let r=this.valueAddedSlide(this.props.element.slide,e);switch(r?.t){case 1:return K(pn,{element:r,triggerContext:this.props.triggerContext});case 4:return K(mn,{elements:r.elems,element:r,triggerContext:this.props.triggerContext});default:w.warn("Unknown slide type for carousal")}}valueAddedSlide(e,r){let n=Qn(e,{form:r},this.props.triggerContext);return Gt.getParsedElement(n)}getClickAction(e){return Qn(this.props.element.clc??{},{form:e},this.props.triggerContext)}};var Hn=class extends Ue{constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"})),bt(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}))})}renderElement(e){if(!e.hide){if(e.t===4){let r=e;return K(mn,{element:r,triggerContext:this.props.triggerContext,elements:r.elems})}if(e.t===61)return K(Rs,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?K(vo,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return K(Kt,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return K(pn,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return K(Ls,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return K(Eo,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return K(Ms,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}};var Bs=class extends Ue{clickAction;isClickable;constructor(e,r){super(e,r),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===we.GO_TO_URL&&!!Uo(this.clickAction.gu?.u)||this.clickAction?.at===we.OPEN_CART||this.clickAction?.at===we.INITIATE_CHECKOUT}componentDidMount(){bt(()=>{let e=this.props.triggerContext.triggerData,r=this.props.triggerContext.selectedItems;e.calculateDiscountData(r,this.props.triggerContext.shouldGiveFBTDiscount)})}render(){return K(Lr,{children:[K("div",{style:this.getCompiledStyles(),class:"lc-container",onClick:e=>{this.onClick(e,{clickAction:this.clickAction})},children:K(Hn,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id==="preview"&&K("div",{class:"letscooee-preview-badge",children:["#",this.props.triggerContext.triggerData.shortID," preview"]})]})}getComponentStyles(){let e={position:"relative",overflow:"hidden",display:"block"};return this.isClickable&&(e.cursor="pointer"),e}};var yt=class t{constructor(e){this.engagementTrigger=e;this.triggerContext=new Ir(new Date,this.engagementTrigger)}static currentEngagements=new Set;static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];renderedCount=0;scrollSubscription;variation;isExclusionWithBVariation;isProcessing=!1;renderSilently(){this.acquireProcessingLock()||this.render().finally(()=>this.releaseProcessingLock()).catch(e=>{ae(e,"render-widget",{triggerContext:this.triggerContext})})}destroy(){w.verbose(`${this.engagementTrigger} will be destroyed`),this.preDestroy(),this.removeFromRendered(),this.rootContainer?.remove(),t.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID),op(this.engagementTrigger.content?.afterDeleteJS)}matches(e){return this.engagementTrigger.shortID===e.shortID}async render(){if(this.engagementTrigger.shouldGetVariationImmediately()){let e=await this.getVariation();this.handleVariationResponse(e)}if(this.rootContainer=await this.getWidgetContainer(!0),!this.rootContainer){w.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.afterRootContainerCreated(),this.widget=this.engagementTrigger.widget,await this.getVariationIfRequired(),await this.runChoresBeforeRender(),this.attachScroll(),this.checkAndSendEvent(),this.triggerContext.renderer=this,op(this.engagementTrigger.content?.afterRenderJS)}async updateAndReRender(e){if(!this.acquireProcessingLock())try{this.updateItems(e.items,this.engagementTrigger.items),await this.update(e),await this.render()}finally{this.releaseProcessingLock()}}async update(e){this.variation=e.variation,this.widget=e.widget}async rerenderIfDeleted(){if(!this.rootContainer?.isConnected&&!this.acquireProcessingLock()){w.info(`${this.engagementTrigger} deleted. Will be re-rendered`);try{this.preDestroy(),await this.render()}finally{this.releaseProcessingLock()}}}updateAngularWidget(){return this.widgetElement?.isConnected?(this.widgetElement.update(),!0):!1}preDestroy(){this.scrollSubscription?.unsubscribe(),this.observers.forEach(e=>{e?.disconnect&&e.disconnect()})}acquireProcessingLock(){return this.isProcessing?(w.verbose(`Lock could not be acquired for ${this.engagementTrigger}`),!0):(w.verbose(`Acquiring rendering lock for ${this.engagementTrigger}`),this.isProcessing=!0,!1)}releaseProcessingLock(){w.verbose(`Releasing rendering lock for ${this.engagementTrigger}`),this.isProcessing=!1}afterRootContainerCreated(){}isAllOkToRender(){return!!this.widget}async getVariationIfRequired(){if(this.engagementTrigger.shouldSkipVariation()){w.verbose(`${this.engagementTrigger} already has necessary data to render`);return}let e=await this.observeWidgetContainerInViewport();this.handleVariationResponse(e)}handleVariationResponse(e){e&&(w.log(`${this.engagementTrigger} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(this.engagementTrigger.items=e.items.map(r=>new xt(r)),this.engagementTrigger.nonMutableItems=e.items.map(r=>new xt(r))),e.bundleFrom&&(this.engagementTrigger.bundleFrom=new xt(e.bundleFrom)),e.discount&&(this.engagementTrigger.discount=e.discount),e.placement&&(this.triggerContext.triggerData.placement=e.placement),e.props&&_t.hasKeys(e.props)&&(this.engagementTrigger.props=E(E({},this.engagementTrigger.props),e.props)),e.content&&(this.triggerContext.triggerData.content=new rs(e.content)),this.triggerContext.triggerData.widget=this.widget=new ti(e.widget),this.triggerContext.triggerData.contentID=e.contentID,this.triggerContext.triggerData.variation=this.variation=e.variation,this.triggerContext.triggerData.placement=e.placement,this.triggerContext.triggerData.manipulation=e.manipulation,this.triggerContext.triggerData.entryAnimation=e.entryAnimation??"NONE",this.isExclusionWithBVariation=this.engagementTrigger.isExclusionTesting()&&this.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px"))}addToRendered(){this.renderedCount++,w.info(`${this.engagementTrigger} rendered \u2705 ${wh(this.renderedCount)} time`)}removeFromRendered(){this instanceof mt?mt.currentEngagements.delete(this):t.currentEngagements.delete(this)}async getVariation(){w.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id==="preview"};try{return(await wv(e)).data}catch(r){if(r instanceof Zt&&r.response?.status===400)return;ae(r,"get-variation",{engagementTrigger:this.engagementTrigger});return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){w.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let e=window.innerHeight*.3,r={root:null,rootMargin:`${e}px 0px ${e}px 0px`,threshold:0};return this.isInViewport()?this.getVariation():new Promise(n=>{let o=new IntersectionObserver((i,s)=>{i.forEach(async a=>{if(a.isIntersecting){w.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);let l=await this.getVariation();n(l),s.unobserve(this.rootContainer)}})},r);o.observe(this.rootContainer),this.observers.push(o)})}attachScroll(){this.scrollSubscription=po(window,"scroll").pipe(zt(t.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(t.engagementIDsWithTrackedDisplay.has(e)||!this.isInViewport())return;let n={};this.triggerContext.triggerData.items?.length&&(n.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let o=this.isExclusionWithBVariation?"CE Campaign Holdout":"CE Trigger Displayed",i=new xe(o,n,this.engagementTrigger);i.name==="CE Campaign Holdout"&&(i.trigger.holdout=!0),Mt(i),t.engagementIDsWithTrackedDisplay.add(e),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}createAngularWidget(e){let r=this.widgetElement=document.createElement(e);return r.cart=me.getCurrent(),r.triggerContext=this.triggerContext,r.engagementTrigger=this.engagementTrigger,r.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(r),this.addToRendered(),this.injectOuterCSSOnly(),r}getParentElement(e,r=document){let n=r.getElementById(e);if(n)return n;let o=this.engagementTrigger.objective.toLowerCase().replaceAll("_","-"),i=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=e,n.className=`letscooee letscooee-engagement engagement-${i} lc-${o}`,n.dataset.engagementId=i,this.engagementTrigger.id==="preview"&&(n.className+=" letscooee-preview"),n.style.display="block",n.style.minHeight="0.5px",n.style.minWidth="0.5px",n}async startRendering(){let e=this.rootContainer,r=this.triggerContext.triggerData.hasSwiperElement();r&&(e=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),ip(e)),this.injectCampaignCSS(r,e),Uh(wf(Bs,{element:this.widget.cont,triggerContext:this.triggerContext,elements:this.widget.elems}),e),this.addToRendered()}injectCampaignCSS(e,r){let n=this.engagementTrigger.content?.outerCSS?.trim()??"",o=this.engagementTrigger.content?.innerCSS?.trim()??"";if(!n&&!o)return;let i=this.rootContainer.id;if(e){sn(o,r),this.injectOuterCSSOnly();return}let s=n+`
|
|
63
|
-
${o}`;sn(`#${i} { ${s} }`)}injectOuterCSSOnly(){let e=this.engagementTrigger.content?.outerCSS?.trim();if(!e)return;let r=this.rootContainer.id;sn(`#${r} { ${e} }`)}isInViewport(){let e=this.rootContainer?.getBoundingClientRect();if(!e)return!1;let r=window.innerHeight||document.documentElement.clientHeight,o=(Math.min(e.bottom,r)-Math.max(e.top,0))*e.width,i=e.width*e.height,s=o/i*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(e);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(e){let r=this.engagementTrigger.placement;if(!r?.selector)return w.info(`\u26A0\uFE0F${this.engagementTrigger} does not have a selector`),null;let n=r.selector,o;if(n.includes(":shadow")){let l=n.split(":shadow");o=(await Sn(l[0].trim()))?.shadowRoot,n=l[1].trim(),o&&ip(o,!1)}w.verbose(`${this.engagementTrigger} attempt to render "${r.position}" "${n}"`);let i=await Sn(n,3,o??document);if(!i)return w.warn(`${this.engagementTrigger} no placement found with ${n}`),null;let s=this.generateParentElementID(),a=this.getParentElement(s);if(!e)return a;switch(r.position){case At.BEFORE1:case At.BEFORE:{i.parentElement?.insertBefore(a,i);break}case At.INSIDE_FIRST1:case At.INSIDE_FIRST:{i.insertBefore(a,i.firstChild);break}case At.INSIDE_LAST1:case At.INSIDE_LAST:{i.appendChild(a);break}case At.AFTER1:case At.AFTER:default:i.parentElement?.insertBefore(a,i.nextSibling)}return a}async runChoresBeforeRender(){if(this.isExclusionWithBVariation)return;if(!this.isAllOkToRender()){w.info(`\u26A0\uFE0F ${this.engagementTrigger} could not be rendered`);return}w.verbose(`${this.engagementTrigger} will be rendered`);let e;try{e=await dl(this.engagementTrigger)}catch(r){w.info(`\u203C\uFE0F${this.engagementTrigger} could not render as items failed to refresh`,r);return}if(!this.engagementTrigger.isCollectionPromoted()&&!e?.length&&this.engagementTrigger.isProductPromoted()){w.info(`\u203C\uFE0F${this.engagementTrigger} could not render as no products promoted`);return}this.engagementTrigger.items=e,await this.startRendering()}updateItems(e,r){let n=this.getItemDiff(e,r),o=this.getItemDiff(r,e);r.push(...n);for(let i of o)Yr.remove(r,i)}getItemDiff(e,r){return e.filter(n=>!r.some(o=>o.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}};var mt=class extends yt{static currentEngagements=new Set;constructor(e){super(e)}rerenderAfterCartOpened(){this.rerenderIfDeleted(),this.checkAndSendEvent()}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}checkAndSendEvent(){if(!ot.get().isOpen()&&fe().pageName!=="cart"){w.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}};var PT=t=>t,bv=t=>t.filter(e=>e.removedNodes&&e.removedNodes.length>0);function Sv(t,e={childList:!0,subtree:!0},r=500,n=PT){return Jc(o=>{let i=new MutationObserver(s=>o(s));return i.observe(t,e),i},(o,i)=>i.disconnect()).pipe(un(o=>n(o)),Np(o=>o.length>0),zt(r))}var _l=class t{constructor(e,r){this.engagementTrigger=e;this.element=r;this.cartItems=me.getCurrent().items}cartItems;static renderCartUpsell(e){let r=e.placement;if(!r?.selector){w.warn(`No placement available for ${e.objective}`,e.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){w.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let o of n)new t(e,o).render()}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(m=>m.mID===e.product_id.toString());if(!r)return;let n=r.vars.find(m=>m.mID===e.id.toString());if(!n)return;let o=new Mr(n),i=e.selling_plan_allocation?.selling_plan;if(i)for(let m of o.sellingPlans??[])m.mID===i.id.toString()&&(m.isSelected=!0,o.changeSellingPlan(m));let s=new xt(r);s.vars=[o],s.selectedOrFirstVariant.value=o;let a=`lc-cart-item-${this.engagementTrigger.shortID}-${r.mID}`;this.element.classList.add(a);let l=new St(this.engagementTrigger);l.placement.selector=`.${a}`,l.items=[s];let f=new mt(l);f.renderSilently(),this.watchForCartItemDeletion(f,a)}watchForCartItemDeletion(e,r){let n=new MutationObserver(o=>{o.forEach(i=>{i.removedNodes.forEach(s=>{s===this.element&&(w.verbose(`${r} has been removed`),e.destroy(),n.disconnect())})})});n.observe(this.element.parentElement,{childList:!0,subtree:!0})}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(r=>{if(!(e.includes(r.url)||e.includes(r.variant_id))&&(!e.includes(r.product_title)||r.variant_title&&!e.includes(r.variant_title)))return!1;let n=r.selling_plan_allocation?.selling_plan?.name;return!(n&&!e.includes(n))})}};var wl=class extends mt{constructor(e){super(e)}async update(e){await super.update(e),this.engagementTrigger.progressBarConfig.update(e.progressBarConfig),await this.checkMilestoneTryCatch(),this.updateAngularWidget()}isAllOkToRender(){return!!this.engagementTrigger.progressBarConfig}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget("cooee-progressbar"),await this.checkMilestoneTryCatch()}async checkMilestoneTryCatch(){try{await this.checkMilestone()}catch(e){ae(e,"apply-milestones",{engagementTrigger:this.engagementTrigger})}}async checkMilestone(){let e=await me.getCurrent().getNormalisedCart(),r=this.engagementTrigger.progressBarConfig,n=[],o=[],i=[],s,a,l=[...r.milestones];for(let A of l){if(A.rewardType!==Wl.FREE_AUTO_GIFT)continue;if(A.isUIOnly&&!A.allowATC){w.verbose(`Skipping milestone ${A.label} as it is UI only and does not allow ATC`);continue}let B=A.items[0],q=A.reached,P=e.items.find(Q=>(Q.vID===B.vID||Q.mID===B.mID)&&Q.properties._letscooee_campaign===this.engagementTrigger.shortID);q&&(s=A,a=P),P&&n.push(P),!q&&P&&r.removeIneligibleItem?(w.verbose(`Removing free gift ${P.vID} from cart`),i.push(P)):q&&!P&&(w.verbose(`Adding free gift ${B.vID} to cart`),o.push(B))}r.restrictToLatestFreebie&&s&&(a?(n=n.filter(A=>A.vID!==a.vID),o=[]):o=[s.items[0]],i.push(...n));let f={},m={};i.length&&i.forEach(A=>m[A.key??A.vID]=0),o.length&&o.forEach(A=>m[A.vID]=1);let d=r.coupons,_=[];if(d?.length){_=d.map(q=>q.couponCode);let A=me.getCurrent().discount_codes?.map(q=>q.code)??[];_.every(q=>A.some(P=>P===q))||(f.discount=_.join(","))}if(_t.hasKeys(m)&&(f.updates=m),!_t.hasKeys(f))return;let y=await uv(f,this.engagementTrigger),C=y?.items,N=[];for(let A of o){let B=C?.find(q=>_?.length?q.id+""===A.vID&&q.discounts?.some(P=>_.includes(P.title)):q.id+""===A.vID);B&&N.push(B)}if(!N.length){ot.get().refreshUI(y,!1);return}try{await Promise.all(N.map(A=>fv(A,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()})))}catch(A){ae(A,"add-private-attribute",{engagementTrigger:this.engagementTrigger,extra:{productAddedByCooee:N}})}finally{ot.get().refreshUI(y,!1)}}};var Us=class extends mt{constructor(e){super(e)}async update(e){await super.update(e),this.engagementTrigger.content.update(e.content),this.updateAngularWidget()}isAllOkToRender(){return!!this.engagementTrigger.content}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget("cooee-savings-bar")}};var bl=class extends yt{constructor(e){super(e)}isAllOkToRender(){return!!this.engagementTrigger.content?.videoConfig}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e,r=this.engagementTrigger.content.videoConfig;r.template==="FLOATING_POPUP"?e="cooee-video-popup":r.template==="STORY"?e="cooee-video-stories":e="cooee-video-playlist",this.createAngularWidget(e)}};var Sl=class extends yt{constructor(e){super(e)}isAllOkToRender(){return!0}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget("cooee-sticky-atc")}};var Tl=class extends yt{constructor(e){super(e)}isAllOkToRender(){return!0}async startRendering(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener("letscooee:inbound:cta:add-bundle",this.inboundCTAListener.bind(this),!1)}async inboundCTAListener(e){let r=this.engagementTrigger,n=`Engagement(id: ${r.engagementID}, shortID: ${r.shortID})`,o=e.detail;if(!_t.hasKeys(o)){w.error(`No detail received for ${n}`);return}w.log("Detail received for BYOB",o);let i=o.campaignID??o.campaignId??o.campaign_id;if(i!==r.shortID&&i!==r.engagementID){w.warn(`Current ${n} is not BYOB. Received: ${i}`);return}let s=o.items;if(!s?.length)return;let a=s.map(l=>new Dt({mID:l.product_id,vID:l.variant_id,quantity:l.quantity||1}));await new fn(this.triggerContext).execute({embeddedItems:a,clickAction:{at:we.ADD_BUNDLE,applyDiscount:!0}})}};var Gp=!1,qp=!1,Il=null,xl=null,Tv=!1;function Iv(){Tv||(Tv=!0,bn(()=>{Sv(document.body,{childList:!0,subtree:!0},500,bv).subscribe(()=>{yt.currentEngagements.forEach(t=>t.rerenderIfDeleted()),mt.currentEngagements.forEach(t=>t.rerenderIfDeleted())})}))}function zp(t){if(Iv(),Gp){w.verbose("Cart widget processing in progress, queuing latest triggers"),Il=t;return}Gp=!0;try{LT(t)}finally{if(Gp=!1,Il){let e=Il;Il=null,w.verbose("Processing queued cart triggers"),zp(e)}}}function Yp(t){if(Iv(),qp){w.verbose("Page widget processing in progress, queuing latest triggers"),xl=t;return}qp=!0;try{MT(t)}finally{if(qp=!1,xl){let e=xl;xl=null,w.verbose("Processing queued page triggers"),Yp(e)}}}function LT(t){Cv(mt.currentEngagements,t);for(let e of t){w.info(`${e} received as cart embed`);let r=xv(mt.currentEngagements,e);if(r&&!e.isSubscriptionUpsell()){r.updateAndReRender(e).catch(o=>{ae(o,"update-and-re-render",{engagementTrigger:e})});continue}w.verbose(`${e} is new`);let n;if(e.isProgressBar())n=new wl(e);else if(e.isSubscriptionUpsell()){_l.renderCartUpsell(e);continue}else e.isSavingsBar()?n=new Us(e):n=new mt(e);mt.currentEngagements.add(n),n.renderSilently()}}function MT(t){Cv(yt.currentEngagements,t);for(let e of t){w.info(`${e} received as page embed`);let r=xv(yt.currentEngagements,e);if(r){r.updateAndReRender(e).catch(o=>{ae(o,"update-and-re-render",{engagementTrigger:e})});continue}w.verbose(`${e} is new`);let n;e.isShoppableVideo()?n=new bl(e):e.isBYOB()?n=new Tl(e):e.isStickyATC()?n=new Sl(e):e.isSavingsBar()?n=new Us(e):n=new yt(e),yt.currentEngagements.add(n),n.renderSilently()}}function xv(t,e){for(let r of t)if(r.matches(e))return r}function Cv(t,e){let r=new Set(e.map(n=>n.shortID));for(let n of t)r.has(n.engagementTrigger.shortID)||n.destroy()}var Av=new qt,Rv=0;Av.pipe(zt(50)).subscribe(async t=>{let e=await Fn();BT(e).catch(r=>{ae(r,"load-page-widgets",{extra:{firstLoad:t}})}),UT(e).catch(r=>{ae(r,"load-cart-widgets",{extra:{firstLoad:t}})})});function ks(t=!1){Sr(lr).then(()=>{Av.next(t)})}function Dv(){mt.currentEngagements.forEach(t=>t.rerenderAfterCartOpened())}async function wv(t){let e=await Fn();return Object.assign(t,e),Yt("/v1/engagement/get-variant",t)}async function BT(t){Rv++,Rv===1?w.info("Fetch page widgets (after \u23F0",So()+" of SDK load)"):w.info("Fetch page widgets");let e=E({},t);try{let r=await Yt("/v1/engagement/page-widgets",e);w.info(`Page widgets loaded in \u23F0 ${Tr(r.timeTakenMs)}`);let n=r.data.widgets.map(o=>new St(o));Yp(n)}catch(r){w.error("Error sending widget getter",r)}}async function UT(t){w.info("Fetch cart widgets");let e=E({},t);try{let r=await Yt("/v1/engagement/cart-widgets",e);w.info(`Cart widgets loaded in \u23F0 ${Tr(r.timeTakenMs)}`);let n=r.data.widgets.map(o=>new St(o));zp(n)}catch(r){w.error("Error sending widget getter",r)}}function Ov(){let t=ze.get();!t.gaMeasurementID||!t.gaEnabled||FT()}async function kT(){let t=await Ye.get("gacid"),e=await HT();if(t!==e)return await Ye.set("gacid",e),e}async function FT(){let t=await kT();t&&hl({gaClientID:t})}async function HT(){let e=ze.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(r=>{window.gtag("get",e,"client_id",n=>{r(n)})})}async function Nv(t){w.verbose("Received app configuration",t),t.currencyCount=t.currencies?.length;let e=Ce.globalRef.config.update(t);Ov(),e.website&&(Mg(e.website.commonJS),sn(e.website.commonCSS)),window.CooeeSDK.cartDrawerToggle$.pipe(zt(10)).subscribe(async({open:r})=>{w.info("Cart drawer is now",r?"open":"closed"),r&&(Dv(),await $T())})}async function $T(){let t=await me.getCurrent().getNormalisedCart(),e={value:t.amount,currency:t.currency},r={items:t.items,amount:e,drawer:!0};Tt(new xe("View Cart",r))}var Cl=class{runtimeData=fe();meddle(){let e=Ce.globalRef;e.account=e.account??[],e.profile=e.profile??[],e.events=e.events??[],e.page=e.page??[],this.meddlePage(),this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.exposeMethods()}exposeMethods(){let e=Ce.globalRef;e.loadWidgets=e.loadCartWidgets=e.loadPageWidgets=()=>{ks()},e.loadExperiments=()=>{yl()},e.testCartUpdate=this.testCartUpdate.bind(this),e.previewWidget=Ce.previewWidget.bind(Ce),e.previewPopup=Ce.previewPopup.bind(Ce),e.executeCTA=(r,n)=>{new fn(r).execute(n)},e.sendEvent=r=>{Tt(r)}}overwritePush(e,r){Nr(e,"push",r)}meddleAccount(){this.overwritePush(Ce.globalRef.account,(...e)=>{this.processAccount(e[0])}),Ce.globalRef.account.forEach(this.processAccount.bind(this))}meddleEvents(){this.overwritePush(Ce.globalRef.events,(...e)=>{this.processEvent(e[0])}),Ce.globalRef.events.forEach(this.processEvent.bind(this))}meddleProfile(){this.overwritePush(Ce.globalRef.profile,(...e)=>{this.processProfile(e[0])}),Ce.globalRef.profile.forEach(this.processProfile.bind(this))}processAccount(e){e&&(e.appID&&Ce.authenticate(e),e.flags&&(this.runtimeData.flags=e.flags))}processEvent(e){e&&(um.includes(e[0])?Ce.sendEvent(e[0],e[1],E({occurred:this.runtimeData.jsLoadTime},e[2])):Ce.sendEvent(e[0],e[1],e[2]))}processProfile(e){e&&Ce.updateProfile(e)}processPageName(e){e&&Ce.setPageName(e)}meddlePage(){this.overwritePush(Ce.globalRef.page,(...e)=>{this.processPage(e[0])}),Ce.globalRef.page.forEach(this.processPage.bind(this))}processPage(e){e.currentItem&&VT(e.currentItem),e.currency&&(fe().currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.pageName&&Ce.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiments=e.activeExperiment),e.cart&&me.getCurrent().update(e.cart),e.configurations&&Nv(e.configurations),e.customContext&&(this.runtimeData.customContext=E(E({},this.runtimeData.customContext),e.customContext))}async testCartUpdate(){if(fe().pageName!=="product"){window.alert("This feature is only available on a product page");return}let e=_v();if(e||(e=fe().currentItem?.vID),!e){window.alert("Could not find a variant to test. Please try a different product page");return}let r=new St({id:"preview",shortID:"1",redirectBehaviour:Qt.CART_DRAWER});await new fn(new Ir(new Date,r)).execute({clickAction:{at:we.ADD_TO_CART},embeddedItem:new Dt({vID:e})})}};function VT(t){let e=fe();if(e.currentItem&&e.currentItem.vID!==t.vID){let r=new CustomEvent("letscooee:variant-change",{detail:{variantID:t.vID,productID:t.mID}});document.dispatchEvent(r)}e.currentItem=new Dt(t)}var Si=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX="cooee".concat("-");static getString(e,r){return this.getItem(e)||r}static setString(e,r){this.setItem(e,r)}static remove(e){this.removeItem(e)}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,r){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),r)}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}};var WT=1e3,jT=10,Kp=0,Xp=new Date;function Jp(t){Si.remove("sleid"),Xp=t??new Date}function Pv(){if(window.scrollY){let t=Bv();Lv(t)&&Mv(t)}bn(()=>{GT()})}function GT(){po(window,"scroll").pipe(zt(WT),un(()=>{let t=Bv();if(t>100){w.warn("Received scroll percent is more than 100",t);return}if(Lv(t))return t})).subscribe(t=>{Mv(t)})}function Lv(t){return Math.abs(Kp-t)>=jT||Kp!==t&&t===100}function Mv(t){if(t==null)return;let e={percent:t,timeMS:new Date().getTime()-Xp.getTime()};Kp=t;let r=Si.getString("sleid",""),n=new xe("CE Scroll",e,null,r);Tt(n),Si.setString("sleid",n.id.toHexString()),Xp=new Date(n.occurred)}function Bv(){let t=window.document.body.scrollHeight,e=window.innerHeight;return Math.ceil((window.scrollY+e)/t*100)}function Uv(){qT()}function qT(){let t=window.fetch;window.fetch=async function(e,r){try{await zT(e,r)}catch(n){ae(n,"modify-graphql-request",{extra:{body:JSON.stringify(r?.body)}})}return t(e,r)},w.verbose("Securely overwritten window.fetch method for graphql query")}async function zT(t,e){let r=typeof t=="string"?t:t instanceof Request?t.url:"";if(!(r.includes("graphql.json")&&e?.method==="POST")||!e.body)return;let n;if(typeof e.body=="string")try{n=JSON.parse(e.body)}catch{return}else n=e.body;n?.variables?.input&&(w.verbose("Intercepted fetch request of:",r),n?.query.includes("cartCreate")&&(e.body=await YT(n),KT()))}async function YT(t){let e=t.variables.input.attributes??[],r=await $a("Buy Now");return t.variables.input.attributes=[...e,...r],JSON.stringify(t)}function KT(){let t=fe().currentItem;if(!t)return;let e=new xe("Buy Now Clicked",{items:[t]});Tt(e)}var Ti=class{constructor(e,r){this.selectors=e;this.eventName=r;this.selectorString=e.join(",")}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let r=e.currentTarget,n=new xe(this.eventName,{class:r.className||void 0,tagName:r.tagName||void 0,id:r.id||void 0});Tt(n),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>w.error(e))}async listen(){this.elements=await df(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(r=>{r.removeEventListener("click",e)})}};var Rl=class t extends Ti{static selectors=[".product__thumbnail-list-inner > button","product-gallery-navigation > button",".product-media--thumb-container",".product-images-inner > img",".m-product-media",".swiper-button-control",".media__thumb",".slick-arrow",".productView-img-container.product-single__media",".product-gallery__thumbnail_item_inner"];constructor(){super(t.selectors,"Item Thumbnail Clicked")}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var Al=class t extends Ti{static selectors=[".jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup","reviewsio-product-ratings",".ruk_rating_snippet.tracked:not(.hidden)","a > .loox-rating",".yotpo-reviews-star-ratings-widget",".yotpo.lp-hero__reviews",".pr-rating > a",".rivyoReviewWidget"];constructor(){super(t.selectors,"Review Clicked")}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var XT=[".gokwik-checkout button","button.cart__checkout-button","button.cart__checkout","button#checkout","button#checkout2",'button[id*="checkout" i]','button[name*="checkout" i]','button[class*="checkout" i]'].join(",");function kv(){bn(()=>{w.verbose("Execution order:","document ready"),JT()})}function JT(){let t=window.location.hash?.substring(1);if(t)if(t.includes("initiate-checkout")){document.dispatchEvent(new Event("letscooee:outbound:third-party-initiate-checkout"));let e=document.querySelector(XT);if(!e){w.verbose("No clickable cart checkout button found");return}w.verbose("Clickable cart checkout button found",e),e.click()}else t.includes("open-cart-drawer")&&ot.get().open()}function Hv(){window.addEventListener("kp-modal:opened",()=>{fe().isGoKwikPopupOpen=!0}),window.addEventListener("user-loggedin",t=>{let{token:e}=t.detail;e&&wi({goKwikToken:e})}),window.gokwikSdk?Fv():window.addEventListener("gokwikLoaded",Fv)}function Fv(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let t=await me.getCurrent().getNormalisedCart(),e={via:"GoKwik",items:t.items,cartToken:t.token,amount:{value:t.amount,currency:t.currency}},r=new xe("Checkout Started",e);Tt(r)})}var Dl=class{static watch(){let e=dm();(e==="1"||e==="on")&&hl({debugTill:this.getDebugMillis()}),e==="on"?sessionStorage.cooeeDebug="1":e==="off"&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&this.renderDebugBar()}static renderDebugBar(){let e=document.createElement("cooee-debugger");e.logs=this.logs,bn(()=>{document.body.appendChild(e)})}static getDebugMillis(){return new Date().getTime()+360*60*1e3}};var Fs=class Fs extends hn{};bo(Fs,"storeName","app"),Fs.storage=Io(Fs.storeName);var Ol=Fs;var Ce=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(e){if(!window.cooeeSDKPreview){if(w.info("Initialising SDK"),Bg(navigator.userAgent)){w.info("This seems to be a bot. Disabling SDK");return}this.initGlobalReference(e),await Wy(),this.autoAuthenticate(),new Cl().meddle(),_m(),ks(!0),yl(),QT(),Jy(),iv(),Uv(),kv(),Pv(),Al.getInstance().listenSilently(),Rl.getInstance().listenSilently(),Hv(),ZT(),Dl.watch(),Ol.remove("conf").catch(r=>{w.error("Fail to remove App Config from local storage",r)})}}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(e){window.CooeeSDK||Nr(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,Nr(this.globalRef,"config",new ze),Nr(this.globalRef,"runtimeData",{sdkLoadTime:e,jsLoadTime:new Date,lastEnterActive:new Date}),Nr(this.globalRef,"uaParser",new wr,!0),Nr(this.globalRef,"cart",me.getCurrent()),Nr(this.globalRef,"cartChange$",ov()),Nr(this.globalRef,"cartDrawerToggle$",ot.cartDrawerToggle$.asObservable()),w.verbose("Global reference initialised"),new Ac(()=>{this.globalRef.uaParser=new wr})}static injectWidgetAssets(){Pg(dr.widgetURL,"cooee-widget-sdk"),np()}static autoAuthenticate(){let e=tc();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;w.info("Begin auth after \u23F0",So(),"of SDK load");let r=e.appID?.trim(),n=e.shopifyShop;if((pf(r)||r.length!==24)&&pf(n)){w.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,$y(e)}static sendEvent(e,r,n){let o=new xe(e,r,n?.triggerData);n?.occurred&&(o.occurred=n.occurred),Tt(o)}static updateProfile(e){for(let r in e)if(r.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");wi(e)}static setPageName(e){if(!e)return;let r=fe(),n=r.pageName;if(e===n)return;if(r.pageName=e,cm.some(s=>e.includes(s))){Jp();return}let o={};n&&(o.ps=n);let i=new xe("CE Screen View",o);i.occurred=r.jsLoadTime,Tt(i),Jp(i.occurred)}static previewPopup(e,r){new kn(r).render(e)}static previewWidget(e){new yt(new St(e)).renderSilently()}};function QT(){window.CooeeSDK.cartChange$.subscribe(()=>{ks()})}function ZT(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(t){w.error(t)}window.addEventListener("message",t=>{if(w.verbose("Received event",t),!t.origin.includes("letscooee.com")&&!t.origin.includes("localhost"))return;let e=t.data;typeof e=="object"&&(e.action==="POPUP_PREVIEW"?(Ce.previewPopup(e.engagementTrigger),t.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},t.origin)):e.action==="WIDGET_PREVIEW"&&(Ce.previewWidget(e.engagementTrigger),t.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},t.origin)))})}}var $v=new Date;pm();hm();w.verbose("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(w.verbose("Execution order:","IIFE start"),await Ce.initForMerchantWebsiteOnly($v),await Ce.initForAll(),eI(),w.verbose("Execution order:","IIFE end")))());w.verbose("Execution order:","bottom");function eI(){mm()&&import("./debug-logs-LURTT6GZ.js").then(({printAllDebugLogs:t})=>t($v))}
|
|
62
|
+
`},navigation:{nextEl:t.querySelector(".swiper-button-next"),prevEl:t.querySelector(".swiper-button-prev")},autoplay:e.autoplay?.enabled?{delay:e.autoplay?.delay,disableOnInteraction:!1,pauseOnMouseEnter:!1}:!1,autoHeight:!0};e.marquee&&r.autoplay&&typeof r.autoplay=="object"&&(r.speed=e.speed,r.autoplay.pauseOnMouseEnter=!0,t.style.setProperty("--swiper-wrapper-transition-timing-function","linear"));let n=new window.CooeeSDK.Swiper(t,r);return t.style.setProperty("--swiper-navigation-size",`${e.navigation.size}px`),n}function El(t,e,r){let n={color:t.navigation.color?.rgba};return t.pagination.enabled&&(n.transform="translateY(-25%)"),K("div",{class:"swiper-container",ref:e,style:"max-width: 100%",children:[K("div",{class:"swiper-wrapper",children:r()}),t.navigation.enabled&&K("div",{class:"swiper-button-next",style:n,children:K("span",{})}),t.navigation.enabled&&K("div",{class:"swiper-button-prev",style:n,children:K("span",{})}),t.pagination.enabled&&K("div",{className:"swiper-pagination",style:{bottom:0,top:"unset",position:"relative",color:t.pagination.color?.rgba}})]})}var As=class extends Ue{componentDidMount(){wt(()=>{this.setState(()=>({checked:this.props.item.selected.value}))})}render(){return K("div",{style:this.getCompiledStyles(),className:"lc-checkbox",children:K("input",{type:"checkbox",checked:this.state.checked,onChange:this.onChange.bind(this),style:{appearance:"auto"}})})}onChange(e){let{checked:r}=e.target;this.props.item.selected.value=r}getTypoStyles(){let e={},r=this.mediaStyle.typo??new st;return e.textAlign=r.alignment,e.justifyContent=r.alignment,e}getComponentStyles(){return Z(E({},this.getTypoStyles()),{display:"flex"})}};var pn=class extends Ue{constructor(e,r){super(e,r)}render(){let e=this.props.element[this.deviceTypeKey],r=e?.src||this.props.element.src||this.props.element.lg?.src;return K("img",{onClick:this.customOnClick.bind(this),className:"lc-image",alt:e?.name||"Image",onMouseEnter:this.handleMouseEnter.bind(this),onMouseLeave:this.handleMouseLeave.bind(this),src:r,style:this.getCompiledStyles()})}customOnClick(e){this.props.element.clc?.at===be.ADD_TO_CART&&this.props.triggerContext.triggerData.items[0]&&this.onClick(e,{item:this.props.triggerContext.triggerData.items[0]}),this.props.onClick&&this.props.onClick("image")}getComponentStyles(){let e=this.mediaStyle.lout;if(!e||e.pos!=="absolute")return{};let r={zIndex:e.zIndex,cursor:this.props.element.clc?.at?"pointer":"auto"};return this.mediaStyle.size?.w&&(r.width=this.mediaStyle.size.w),this.mediaStyle.size?.h&&(r.height=this.mediaStyle.size.h),r}handleMouseEnter(e){let r=this.props.element[this.deviceTypeKey]?.secondarySrc;r&&(e.currentTarget.src=r)}handleMouseLeave(e){e.currentTarget.src=this.props.element[this.deviceTypeKey]?.src}};var mn=class extends Ue{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return K("div",{style:this.getCompiledStyles(),class:"lc-flexbox",children:K(Hn,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})})}getComponentStyles(){let e=this.mediaStyle.flex??new Xo,r={display:"flex",gap:e.gap+"px",flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai};return e.wrap==="nowrap"&&e.scroll&&(e.dir==="column"?r["overflow-y"]="auto":r["overflow-x"]="auto"),r}};var Ds=class extends mn{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return K("div",{style:this.getCompiledStyles(),class:"lc-flexbox",children:K(wi,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.props.noLinks})})}};var Os=class extends Ue{render(){return K("select",{style:this.getCompiledStyles(),value:this.props.selectedVariant.selectedSellingPlan.value?.mID??"",onChange:this.onChange.bind(this),disabled:this.state.disabled,className:"lc-dropdown",children:this.createSelectItems()})}componentDidMount(){wt(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:!1}))})}getTypoStyles(){let e={},r=this.mediaStyle.typo??new st;return e.letterSpacing=r.letterSpacing,e.fontSize=r.fs+"px",e.lineHeight=r.lh,e.fontFamily="inherit",e.textAlign=r.alignment,e.fontWeight=r.fw,this.stylesConverter.getColourStyles(r.tc,"color",e),e.boxShadow="none",e}getComponentStyles(){let e={};return this.props.selectedVariant.sellingPlans?.length||(e.visibility="hidden"),E(E({},e),this.getTypoStyles())}createSelectItems(){let e=[],r=this.props.selectedVariant;if(!r.sellingPlans?.length)return[];this.props.triggerContext.triggerData.skipSubscribedItems?r.selectedSellingPlan.value||(r.sellingPlans[0].isSelected=!0,r.changeSellingPlan(r.sellingPlans[0])):e.push(K("option",{value:"",selected:!r.selectedSellingPlan,children:"One time purchase"}));for(let n of r.sellingPlans??[])e.push(K("option",{value:n.mID,selected:n.isSelected,children:n.name}));return e}onChange(e){let r=e.target.value;r?this.props.selectedVariant.selectedSellingPlan.value=this.props.selectedVariant.sellingPlans.find(n=>n.mID===r):this.props.selectedVariant.selectedSellingPlan.value=void 0}};var PT=new RegExp('fill="#[a-zA-Z0-9]+"'),Ns=class extends Ue{constructor(){super()}render(){let e=this.getCompiledStyles(),r=this.getRating();return r||(e.display="none",r=""),K("div",{style:e,className:"lc-star-rating",dangerouslySetInnerHTML:{__html:r}})}getRating(){let e={size:this.props.element.iconSize,color:this.props.element.c.hex},r=Vo(this.props.element.fullStar,{svg:e},this.props.triggerContext),n=Vo(this.props.element.halfStart,{svg:e},this.props.triggerContext),o=this.props.review;if(!o?.rating)return"";let i="";if(this.props.element.showSingleStar)i=r;else{let s=5,a=`${o.rating}`.split(".");for(let l=0;l<+a[0];l++)i+=r,s--;a[1]&&(i+=n,s--);for(let l=0;l<s;l++)i+=r.replace(PT,'fill="#f1f1f1"')}return i}getComponentStyles(){return{display:"flex",alignItems:"center"}}};var Ps=class extends Ue{render(){return K("select",{style:this.getCompiledStyles(),value:this.props.item.selectedOrFirstVariant.value.mID,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:"lc-dropdown",children:this.createSelectItems()})}componentDidMount(){wt(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:!1}))})}getTypoStyles(){let e={},r=this.mediaStyle.typo??new st;return e.letterSpacing=r.letterSpacing,e.fontSize=r.fs+"px",e.lineHeight=r.lh,e.fontFamily="inherit",e.textAlign=r.alignment,e.fontWeight=r.fw,this.stylesConverter.getColourStyles(r.tc,"color",e),e.boxShadow="none",e}getComponentStyles(){let e={};return this.props.item.vars?.length===1&&this.props.item.vars[0].name==="Default Title"&&(e.visibility="hidden"),E(E({},e),this.getTypoStyles())}createSelectItems(){let e=[];for(let r of this.props.item.vars)e.push(K("option",{value:r.mID,disabled:!r.isAvailable,children:r.name}));return e}onChange(e){let r=e.target.value,n=this.props.item.vars.find(o=>o.mID===r);this.props.item.setSelectedVariant(n)}};var _v=()=>{let t=window.ShopifyAnalytics?.meta??{},e=t.selectedVariantId;if(e)return e;if(t.product?.variants?.length>0)return t.product.variants[0].id},jp=t=>{if(!t)return;let e;try{e=new URL(t)}catch{return}if(e.hostname!=="cdn.shopify.com")return t;let r=e.pathname.split(".");return r.length!==2?t:(e.pathname=r[0]+"_large."+r[1],e.toString())};var wi=class extends Ue{constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"}))}renderElement(e){if(!(e.hide||!this.matchWhenCondition(e.when))){if(e.t===4){let r=e;return r.l==="Star Rating"&&!this.props.item.reviews?.rating?void 0:K(Ds,{element:r,triggerContext:this.props.triggerContext,elements:r.elems,item:this.props.item,noLinks:this.props.noLinks})}if(e.t===6)return this.props.triggerContext.triggerData.isBundle()?K(As,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):void 0;if(e.t===13){let r=e,n=this.props.item,o=jp(n.variantImage??n.firstImageURL),i=jp(n.variantSecondaryImage??n.secondaryImageURL);r.lg=r.sm={src:o,name:n.name,secondarySrc:i};let s=K(pn,{element:r,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?s:K("a",{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:"block"},children:s})}if(e.t===14)return this.renderProductTitle(e);if(e.t===15){let r=e;return this.props.triggerContext.triggerData.isCartEmbed()&&this.props.item.vars?.length===1&&this.props.item.vars[0].name==="Default Title"?void 0:r.showChips?K("cooee-product-options-picker",{item:this.props.item}):K(Ps,{element:r,item:this.props.item,triggerContext:this.props.triggerContext})}return e.t===16?K(Os,{element:e,selectedVariant:this.props.item.selectedOrFirstVariant.value,item:this.props.item,triggerContext:this.props.triggerContext}):e.t===19?K(Ns,{element:e,triggerContext:this.props.triggerContext,review:this.props.item.reviews}):e.t===18||e.t===3?K(vo,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):K(Hn,{elements:[e],element:this.props.element,triggerContext:this.props.triggerContext})}}render(){return this.attachListener(),this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}renderProductTitle(e){let r=K(Kt,{element:e,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?r:K("a",{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:"block",textDecoration:this.state.decoration},onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),children:r})}customOnClick(e){this.sendTriggerClicked([this.props.item.toEmbed()],{from:e})}onMouseEnter(){this.setState(()=>({decoration:"underline"}))}onMouseLeave(){this.setState(()=>({decoration:"unset"}))}attachListener(){document.addEventListener("letscooee:variant-change",e=>{let r=e;if(!r.detail||this.props.item.mID!==r.detail.productID)return;let n=r.detail.variantID;this.props.item.setSelectedVariantByID(n)})}};var Eo=class extends Ue{productElement;constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"}))}render(){let e=Qn(this.props.element,this.getProductData(),this.props.triggerContext);if(this.productElement=new Cn(e),!(this.productElement.hide||!this.matchWhenCondition(this.productElement.when)))return K("div",{style:E({},this.getCompiledStyles()),class:"lc-single-product",children:K(wi,{element:this.productElement,elements:this.productElement.elems,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.productElement.noLinks})})}getComponentStyles(){return{flexShrink:0}}getProductData(){if(!this.props.item)return{};let e=this.props.item,r=e.selectedOrFirstVariant.value,n=e.getTemplateVariables();n.product.quantity=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(this.props.item.quantity):this.props.item.quantity;let o=this.props.triggerContext.triggerData.discount?.type===Jt.BXGY;return!r.hasEffectivePrice()&&o&&(n.product=Z(E(E({},n.product),Lt("effective_price",r.effectivePrice.value)),{price:""})),n.variant.quantity=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(r.quantity):r.quantity,{product:n.product,variant:n.variant,svg:{color:"{{ svg.color }}",size:"{{ svg.size }}"}}}};var Ls=class extends Ue{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,r){super(e,r),this.configuration=Wr()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+"px"}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&Rc().then(()=>{this.swiperInstance=vl(this.swiperRef,this.props.element.conf[this.deviceTypeKey])})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let r;if(this.configuration.disp===2){let n=i=>{this.swiperRef=i},o=()=>e?.map(i=>K("div",{class:"swiper-slide",children:this.getProductFragment(i)}));r=K("div",{style:Z(E({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:El(this.configuration,n,o)})}else r=K("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((n,o)=>this.getProductFragment(n,o!==e.length-1))});return r}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),r={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(r.flexDirection==="row"){if(e)r.maxWidth="100%",r.overflowY="auto";else if(this.configuration.disp===1){let n=this.props.triggerContext.triggerData,o=n.items.length,i;n.isBundle()?i=this.props.element.prod.symbol?.hide!==!0?o*2-1:o:i=this.props.element.conf[this.deviceTypeKey].maxInRow,r.gridTemplateColumns=`repeat(${i}, auto)`}}return r}getProductFragment(e,r=!1){return K(Lr,{children:[K(Eo,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&r&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&K("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:K(Kt,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var Ms=class extends Ue{swiperRef=null;swiperInstance=null;constructor(e,r){super(e,r)}componentDidMount(){Rc().then(()=>{this.swiperInstance=vl(this.swiperRef,this.props.element.conf)})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.element,r=o=>{this.swiperRef=o},n=()=>{let o=e.values?.map(a=>K("div",{class:"swiper-slide",onClick:l=>this.onClick(l,{clickAction:this.getClickAction(a)}),children:this.renderElement(a)}));if(!o?.length)return[];let i=e.conf,s=o.length;if(i.marquee&&s<=Number(i.maxInRow)){let a=Number(i.maxInRow)-s+1;for(let l=0;l<a;l++)o.push(o[l%s])}return o};return El(e.conf,r,n)}getComponentStyles(){return{}}renderElement(e){let r=this.valueAddedSlide(this.props.element.slide,e);switch(r?.t){case 1:return K(pn,{element:r,triggerContext:this.props.triggerContext});case 4:return K(mn,{elements:r.elems,element:r,triggerContext:this.props.triggerContext});default:b.warn("Unknown slide type for carousal")}}valueAddedSlide(e,r){let n=Qn(e,{form:r},this.props.triggerContext);return Gt.getParsedElement(n)}getClickAction(e){return Qn(this.props.element.clc??{},{form:e},this.props.triggerContext)}};var Hn=class extends Ue{constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"})),wt(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}))})}renderElement(e){if(!e.hide){if(e.t===4){let r=e;return K(mn,{element:r,triggerContext:this.props.triggerContext,elements:r.elems})}if(e.t===61)return K(Rs,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?K(vo,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return K(Kt,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return K(pn,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return K(Ls,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return K(Eo,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return K(Ms,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}};var Bs=class extends Ue{clickAction;isClickable;constructor(e,r){super(e,r),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===be.GO_TO_URL&&!!Uo(this.clickAction.gu?.u)||this.clickAction?.at===be.OPEN_CART||this.clickAction?.at===be.INITIATE_CHECKOUT}componentDidMount(){wt(()=>{let e=this.props.triggerContext.triggerData,r=this.props.triggerContext.selectedItems;e.calculateDiscountData(r,this.props.triggerContext.shouldGiveFBTDiscount)})}render(){return K(Lr,{children:[K("div",{style:this.getCompiledStyles(),class:"lc-container",onClick:e=>{this.onClick(e,{clickAction:this.clickAction})},children:K(Hn,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id==="preview"&&K("div",{class:"letscooee-preview-badge",children:["#",this.props.triggerContext.triggerData.shortID," preview"]})]})}getComponentStyles(){let e={position:"relative",overflow:"hidden",display:"block"};return this.isClickable&&(e.cursor="pointer"),e}};var yt=class t{constructor(e){this.engagementTrigger=e;this.triggerContext=new Ir(new Date,this.engagementTrigger)}static currentEngagements=new Set;static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;triggerContext;observers=[];renderedCount=0;scrollSubscription;isExclusionWithBVariation;isProcessing=!1;renderSilently(){this.acquireProcessingLock()||this.render().finally(()=>this.releaseProcessingLock()).catch(e=>{ae(e,"render-widget",{triggerContext:this.triggerContext})})}destroy(){b.verbose(`${this.engagementTrigger} will be destroyed`),this.preDestroy(),this.removeFromRendered(),this.rootContainer?.remove(),t.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID),op(this.engagementTrigger.content?.afterDeleteJS)}matches(e){return this.engagementTrigger.shortID===e.shortID}async render(){if(this.engagementTrigger.shouldGetVariationImmediately()){let e=await this.getVariation();this.handleVariationResponse(e)}if(this.rootContainer=await this.getWidgetContainer(!0),!this.rootContainer){b.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.afterRootContainerCreated(),await this.getVariationIfRequired(),await this.runChoresBeforeRender(),this.attachScroll(),this.checkAndSendEvent(),this.triggerContext.renderer=this,op(this.engagementTrigger.content?.afterRenderJS)}async updateAndReRender(e){if(!this.acquireProcessingLock())try{this.updateItems(e.items,this.engagementTrigger.items),await this.update(e),await this.render()}finally{this.releaseProcessingLock()}}async update(e){this.engagementTrigger.variation=e.variation}async rerenderIfDeleted(){if(!this.rootContainer?.isConnected&&!this.acquireProcessingLock()){b.info(`${this.engagementTrigger} deleted. Will be re-rendered`);try{this.preDestroy(),await this.render()}finally{this.releaseProcessingLock()}}}updateAngularWidget(){return this.widgetElement?.isConnected?(this.widgetElement.update(),!0):!1}preDestroy(){this.scrollSubscription?.unsubscribe(),this.observers.forEach(e=>{e?.disconnect&&e.disconnect()})}acquireProcessingLock(){return this.isProcessing?(b.verbose(`Lock could not be acquired for ${this.engagementTrigger}`),!0):(b.verbose(`Acquiring rendering lock for ${this.engagementTrigger}`),this.isProcessing=!0,!1)}releaseProcessingLock(){b.verbose(`Releasing rendering lock for ${this.engagementTrigger}`),this.isProcessing=!1}afterRootContainerCreated(){}isAllOkToRender(){return!!this.engagementTrigger.widget}async getVariationIfRequired(){if(this.engagementTrigger.shouldSkipVariation()){b.verbose(`${this.engagementTrigger} already has necessary data to render`);return}let e=await this.observeWidgetContainerInViewport();this.handleVariationResponse(e)}handleVariationResponse(e){if(!e)return;let r=this.engagementTrigger;b.log(`${r} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(r.items=e.items.map(n=>new xt(n)),r.nonMutableItems=e.items.map(n=>new xt(n))),e.bundleFrom&&(r.bundleFrom=new xt(e.bundleFrom)),e.discount&&(r.discount=e.discount),e.placement&&(r.placement=e.placement),e.props&&_t.hasKeys(e.props)&&(r.props=E(E({},r.props),e.props)),e.content&&(r.content=new rs(e.content)),r.widget=new ti(e.widget),r.contentID=e.contentID,r.variation=e.variation,r.placement=e.placement,r.manipulation=e.manipulation,r.entryAnimation=e.entryAnimation??"NONE",this.isExclusionWithBVariation=r.isExclusionTesting()&&r.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px")}addToRendered(){this.renderedCount++,b.info(`${this.engagementTrigger} rendered \u2705 ${bh(this.renderedCount)} time`)}removeFromRendered(){this instanceof mt?mt.currentEngagements.delete(this):t.currentEngagements.delete(this)}async getVariation(){b.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id==="preview"};try{return(await bv(e)).data}catch(r){if(r instanceof Zt&&r.response?.status===400)return;ae(r,"get-variation",{engagementTrigger:this.engagementTrigger});return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){b.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let e=window.innerHeight*.3,r={root:null,rootMargin:`${e}px 0px ${e}px 0px`,threshold:0};return this.isInViewport()?this.getVariation():new Promise(n=>{let o=new IntersectionObserver((i,s)=>{i.forEach(async a=>{if(a.isIntersecting){b.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);let l=await this.getVariation();n(l),s.unobserve(this.rootContainer)}})},r);o.observe(this.rootContainer),this.observers.push(o)})}attachScroll(){this.scrollSubscription=po(window,"scroll").pipe(zt(t.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(t.engagementIDsWithTrackedDisplay.has(e)||!this.isInViewport())return;let n={};this.triggerContext.triggerData.items?.length&&(n.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let o=this.isExclusionWithBVariation?"CE Campaign Holdout":"CE Trigger Displayed",i=new xe(o,n,this.engagementTrigger);i.name==="CE Campaign Holdout"&&(i.trigger.holdout=!0),Mt(i),t.engagementIDsWithTrackedDisplay.add(e),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}createAngularWidget(e){let r=this.widgetElement=document.createElement(e);return r.cart=me.getCurrent(),r.triggerContext=this.triggerContext,r.engagementTrigger=this.engagementTrigger,r.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(r),this.addToRendered(),this.injectOuterCSSOnly(),r}getParentElement(e,r=document){let n=r.getElementById(e);if(n)return n;let o=this.engagementTrigger.objective.toLowerCase().replaceAll("_","-"),i=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=e,n.className=`letscooee letscooee-engagement engagement-${i} lc-${o}`,n.dataset.engagementId=i,this.engagementTrigger.id==="preview"&&(n.className+=" letscooee-preview"),n.style.display="block",n.style.minHeight="0.5px",n.style.minWidth="0.5px",n}async startRendering(){let e=this.rootContainer,r=this.triggerContext.triggerData.hasSwiperElement();r&&(e=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),ip(e)),this.injectCampaignCSS(r,e);let n=this.engagementTrigger.widget;Uh(bf(Bs,{element:n.cont,triggerContext:this.triggerContext,elements:n.elems}),e),this.addToRendered()}injectCampaignCSS(e,r){let n=this.engagementTrigger.content?.outerCSS?.trim()??"",o=this.engagementTrigger.content?.innerCSS?.trim()??"";if(!n&&!o)return;let i=this.rootContainer.id;if(e){sn(o,r),this.injectOuterCSSOnly();return}let s=n+`
|
|
63
|
+
${o}`;sn(`#${i} { ${s} }`)}injectOuterCSSOnly(){let e=this.engagementTrigger.content?.outerCSS?.trim();if(!e)return;let r=this.rootContainer.id;sn(`#${r} { ${e} }`)}isInViewport(){let e=this.rootContainer?.getBoundingClientRect();if(!e)return!1;let r=window.innerHeight||document.documentElement.clientHeight,o=(Math.min(e.bottom,r)-Math.max(e.top,0))*e.width,i=e.width*e.height,s=o/i*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(e);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(e){let r=this.engagementTrigger.placement;if(!r?.selector)return b.info(`\u26A0\uFE0F${this.engagementTrigger} does not have a selector`),null;let n=r.selector,o;if(n.includes(":shadow")){let l=n.split(":shadow");o=(await Sn(l[0].trim()))?.shadowRoot,n=l[1].trim(),o&&ip(o,!1)}b.verbose(`${this.engagementTrigger} attempt to render "${r.position}" "${n}"`);let i=await Sn(n,3,o??document);if(!i)return b.warn(`${this.engagementTrigger} no placement found with ${n}`),null;let s=this.generateParentElementID(),a=this.getParentElement(s);if(!e)return a;switch(r.position){case At.BEFORE1:case At.BEFORE:{i.parentElement?.insertBefore(a,i);break}case At.INSIDE_FIRST1:case At.INSIDE_FIRST:{i.insertBefore(a,i.firstChild);break}case At.INSIDE_LAST1:case At.INSIDE_LAST:{i.appendChild(a);break}case At.AFTER1:case At.AFTER:default:i.parentElement?.insertBefore(a,i.nextSibling)}return a}async runChoresBeforeRender(){if(this.isExclusionWithBVariation)return;if(!this.isAllOkToRender()){b.info(`\u26A0\uFE0F ${this.engagementTrigger} could not be rendered`);return}b.verbose(`${this.engagementTrigger} will be rendered`);let e;try{e=await dl(this.engagementTrigger)}catch(r){b.info(`\u203C\uFE0F${this.engagementTrigger} could not render as items failed to refresh`,r);return}if(!this.engagementTrigger.isCollectionPromoted()&&!e?.length&&this.engagementTrigger.isProductPromoted()){b.info(`\u203C\uFE0F${this.engagementTrigger} could not render as no products promoted`);return}this.engagementTrigger.items=e,await this.startRendering()}updateItems(e,r){let n=this.getItemDiff(e,r),o=this.getItemDiff(r,e);r.push(...n);for(let i of o)Yr.remove(r,i)}getItemDiff(e,r){return e.filter(n=>!r.some(o=>o.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}};var mt=class extends yt{static currentEngagements=new Set;constructor(e){super(e)}rerenderAfterCartOpened(){this.rerenderIfDeleted(),this.checkAndSendEvent()}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}checkAndSendEvent(){if(!ot.get().isOpen()&&fe().pageName!=="cart"){b.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}};var LT=t=>t,wv=t=>t.filter(e=>e.removedNodes&&e.removedNodes.length>0);function Sv(t,e={childList:!0,subtree:!0},r=500,n=LT){return Jc(o=>{let i=new MutationObserver(s=>o(s));return i.observe(t,e),i},(o,i)=>i.disconnect()).pipe(un(o=>n(o)),Np(o=>o.length>0),zt(r))}var _l=class t{constructor(e,r){this.engagementTrigger=e;this.element=r;this.cartItems=me.getCurrent().items}cartItems;static renderCartUpsell(e){let r=e.placement;if(!r?.selector){b.warn(`No placement available for ${e.objective}`,e.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){b.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let o of n)new t(e,o).render()}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(m=>m.mID===e.product_id.toString());if(!r)return;let n=r.vars.find(m=>m.mID===e.id.toString());if(!n)return;let o=new Mr(n),i=e.selling_plan_allocation?.selling_plan;if(i)for(let m of o.sellingPlans??[])m.mID===i.id.toString()&&(m.isSelected=!0,o.changeSellingPlan(m));let s=new xt(r);s.vars=[o],s.selectedOrFirstVariant.value=o;let a=`lc-cart-item-${this.engagementTrigger.shortID}-${r.mID}`;this.element.classList.add(a);let l=new St(this.engagementTrigger);l.placement.selector=`.${a}`,l.items=[s];let f=new mt(l);f.renderSilently(),this.watchForCartItemDeletion(f,a)}watchForCartItemDeletion(e,r){let n=new MutationObserver(o=>{o.forEach(i=>{i.removedNodes.forEach(s=>{s===this.element&&(b.verbose(`${r} has been removed`),e.destroy(),n.disconnect())})})});n.observe(this.element.parentElement,{childList:!0,subtree:!0})}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(r=>{if(!(e.includes(r.url)||e.includes(r.variant_id))&&(!e.includes(r.product_title)||r.variant_title&&!e.includes(r.variant_title)))return!1;let n=r.selling_plan_allocation?.selling_plan?.name;return!(n&&!e.includes(n))})}};var bl=class extends mt{constructor(e){super(e)}async update(e){await super.update(e),this.engagementTrigger.progressBarConfig.update(e.progressBarConfig),await this.checkMilestoneTryCatch(),this.updateAngularWidget()}isAllOkToRender(){return!!this.engagementTrigger.progressBarConfig}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget("cooee-progressbar"),await this.checkMilestoneTryCatch()}async checkMilestoneTryCatch(){try{await this.checkMilestone()}catch(e){ae(e,"apply-milestones",{engagementTrigger:this.engagementTrigger})}}async checkMilestone(){let e=await me.getCurrent().getNormalisedCart(),r=this.engagementTrigger.progressBarConfig,n=[],o=[],i=[],s,a,l=[...r.milestones];for(let A of l){if(A.rewardType!==Wl.FREE_AUTO_GIFT)continue;if(A.isUIOnly&&!A.allowATC){b.verbose(`Skipping milestone ${A.label} as it is UI only and does not allow ATC`);continue}let B=A.items[0],q=A.reached,P=e.items.find(Q=>(Q.vID===B.vID||Q.mID===B.mID)&&Q.properties._letscooee_campaign===this.engagementTrigger.shortID);q&&(s=A,a=P),P&&n.push(P),!q&&P&&r.removeIneligibleItem?(b.verbose(`Removing free gift ${P.vID} from cart`),i.push(P)):q&&!P&&(b.verbose(`Adding free gift ${B.vID} to cart`),o.push(B))}r.restrictToLatestFreebie&&s&&(a?(n=n.filter(A=>A.vID!==a.vID),o=[]):o=[s.items[0]],i.push(...n));let f={},m={};i.length&&i.forEach(A=>m[A.key??A.vID]=0),o.length&&o.forEach(A=>m[A.vID]=1);let d=r.coupons,_=[];if(d?.length){_=d.map(q=>q.couponCode);let A=me.getCurrent().discount_codes?.map(q=>q.code)??[];_.every(q=>A.some(P=>P===q))||(f.discount=_.join(","))}if(_t.hasKeys(m)&&(f.updates=m),!_t.hasKeys(f))return;let y=await uv(f,this.engagementTrigger),C=y?.items,N=[];for(let A of o){let B=C?.find(q=>_?.length?q.id+""===A.vID&&q.discounts?.some(P=>_.includes(P.title)):q.id+""===A.vID);B&&N.push(B)}if(!N.length){ot.get().refreshUI(y,!1);return}try{await Promise.all(N.map(A=>fv(A,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()})))}catch(A){ae(A,"add-private-attribute",{engagementTrigger:this.engagementTrigger,extra:{productAddedByCooee:N}})}finally{ot.get().refreshUI(y,!1)}}};var Us=class extends mt{constructor(e){super(e)}async update(e){await super.update(e),this.engagementTrigger.content.update(e.content),this.updateAngularWidget()}isAllOkToRender(){return!!this.engagementTrigger.content}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget("cooee-savings-bar")}};var wl=class extends yt{constructor(e){super(e)}isAllOkToRender(){return!!this.engagementTrigger.content?.videoConfig}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e,r=this.engagementTrigger.content.videoConfig;r.template==="FLOATING_POPUP"?e="cooee-video-popup":r.template==="STORY"?e="cooee-video-stories":e="cooee-video-playlist",this.createAngularWidget(e)}};var Sl=class extends yt{constructor(e){super(e)}isAllOkToRender(){return!0}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget("cooee-sticky-atc")}};var Tl=class extends yt{constructor(e){super(e)}isAllOkToRender(){return!0}async startRendering(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener("letscooee:inbound:cta:add-bundle",this.inboundCTAListener.bind(this),!1)}async inboundCTAListener(e){let r=this.engagementTrigger,n=`Engagement(id: ${r.engagementID}, shortID: ${r.shortID})`,o=e.detail;if(!_t.hasKeys(o)){b.error(`No detail received for ${n}`);return}b.log("Detail received for BYOB",o);let i=o.campaignID??o.campaignId??o.campaign_id;if(i!==r.shortID&&i!==r.engagementID){b.warn(`Current ${n} is not BYOB. Received: ${i}`);return}let s=o.items;if(!s?.length)return;let a=s.map(l=>new Dt({mID:l.product_id,vID:l.variant_id,quantity:l.quantity||1}));await new fn(this.triggerContext).execute({embeddedItems:a,clickAction:{at:be.ADD_BUNDLE,applyDiscount:!0}})}};var Gp=!1,qp=!1,Il=null,xl=null,Tv=!1;function Iv(){Tv||(Tv=!0,wn(()=>{Sv(document.body,{childList:!0,subtree:!0},500,wv).subscribe(()=>{yt.currentEngagements.forEach(t=>t.rerenderIfDeleted()),mt.currentEngagements.forEach(t=>t.rerenderIfDeleted())})}))}function zp(t){if(Iv(),Gp){b.verbose("Cart widget processing in progress, queuing latest triggers"),Il=t;return}Gp=!0;try{MT(t)}finally{if(Gp=!1,Il){let e=Il;Il=null,b.verbose("Processing queued cart triggers"),zp(e)}}}function Yp(t){if(Iv(),qp){b.verbose("Page widget processing in progress, queuing latest triggers"),xl=t;return}qp=!0;try{BT(t)}finally{if(qp=!1,xl){let e=xl;xl=null,b.verbose("Processing queued page triggers"),Yp(e)}}}function MT(t){Cv(mt.currentEngagements,t);for(let e of t){b.info(`${e} received as cart embed`);let r=xv(mt.currentEngagements,e);if(r&&!e.isSubscriptionUpsell()){r.updateAndReRender(e).catch(o=>{ae(o,"update-and-re-render",{engagementTrigger:e})});continue}b.verbose(`${e} is new`);let n;if(e.isProgressBar())n=new bl(e);else if(e.isSubscriptionUpsell()){_l.renderCartUpsell(e);continue}else e.isSavingsBar()?n=new Us(e):n=new mt(e);mt.currentEngagements.add(n),n.renderSilently()}}function BT(t){Cv(yt.currentEngagements,t);for(let e of t){b.info(`${e} received as page embed`);let r=xv(yt.currentEngagements,e);if(r){r.updateAndReRender(e).catch(o=>{ae(o,"update-and-re-render",{engagementTrigger:e})});continue}b.verbose(`${e} is new`);let n;e.isShoppableVideo()?n=new wl(e):e.isBYOB()?n=new Tl(e):e.isStickyATC()?n=new Sl(e):e.isSavingsBar()?n=new Us(e):n=new yt(e),yt.currentEngagements.add(n),n.renderSilently()}}function xv(t,e){for(let r of t)if(r.matches(e))return r}function Cv(t,e){let r=new Set(e.map(n=>n.shortID));for(let n of t)r.has(n.engagementTrigger.shortID)||n.destroy()}var Av=new qt,Rv=0;Av.pipe(zt(50)).subscribe(async t=>{let e=await Fn();UT(e).catch(r=>{ae(r,"load-page-widgets",{extra:{firstLoad:t}})}),kT(e).catch(r=>{ae(r,"load-cart-widgets",{extra:{firstLoad:t}})})});function ks(t=!1){Sr(lr).then(()=>{Av.next(t)})}function Dv(){mt.currentEngagements.forEach(t=>t.rerenderAfterCartOpened())}async function bv(t){let e=await Fn();return Object.assign(t,e),Yt("/v1/engagement/get-variant",t)}async function UT(t){Rv++,Rv===1?b.info("Fetch page widgets (after \u23F0",So()+" of SDK load)"):b.info("Fetch page widgets");let e=E({},t);try{let r=await Yt("/v1/engagement/page-widgets",e);b.info(`Page widgets loaded in \u23F0 ${Tr(r.timeTakenMs)}`);let n=r.data.widgets.map(o=>new St(o));Yp(n)}catch(r){b.error("Error sending widget getter",r)}}async function kT(t){b.info("Fetch cart widgets");let e=E({},t);try{let r=await Yt("/v1/engagement/cart-widgets",e);b.info(`Cart widgets loaded in \u23F0 ${Tr(r.timeTakenMs)}`);let n=r.data.widgets.map(o=>new St(o));zp(n)}catch(r){b.error("Error sending widget getter",r)}}function Ov(){let t=ze.get();!t.gaMeasurementID||!t.gaEnabled||HT()}async function FT(){let t=await Ye.get("gacid"),e=await $T();if(t!==e)return await Ye.set("gacid",e),e}async function HT(){let t=await FT();t&&hl({gaClientID:t})}async function $T(){let e=ze.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(r=>{window.gtag("get",e,"client_id",n=>{r(n)})})}async function Nv(t){b.verbose("Received app configuration",t),t.currencyCount=t.currencies?.length;let e=Ce.globalRef.config.update(t);Ov(),e.website&&(Mg(e.website.commonJS),sn(e.website.commonCSS)),window.CooeeSDK.cartDrawerToggle$.pipe(zt(10)).subscribe(async({open:r})=>{b.info("Cart drawer is now",r?"open":"closed"),r&&(Dv(),await VT())})}async function VT(){let t=await me.getCurrent().getNormalisedCart(),e={value:t.amount,currency:t.currency},r={items:t.items,amount:e,drawer:!0};Tt(new xe("View Cart",r))}var Cl=class{runtimeData=fe();meddle(){let e=Ce.globalRef;e.account=e.account??[],e.profile=e.profile??[],e.events=e.events??[],e.page=e.page??[],this.meddlePage(),this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.exposeMethods()}exposeMethods(){let e=Ce.globalRef;e.loadWidgets=e.loadCartWidgets=e.loadPageWidgets=()=>{ks()},e.loadExperiments=()=>{yl()},e.testCartUpdate=this.testCartUpdate.bind(this),e.previewWidget=Ce.previewWidget.bind(Ce),e.previewPopup=Ce.previewPopup.bind(Ce),e.executeCTA=(r,n)=>{new fn(r).execute(n)},e.sendEvent=r=>{Tt(r)}}overwritePush(e,r){Nr(e,"push",r)}meddleAccount(){this.overwritePush(Ce.globalRef.account,(...e)=>{this.processAccount(e[0])}),Ce.globalRef.account.forEach(this.processAccount.bind(this))}meddleEvents(){this.overwritePush(Ce.globalRef.events,(...e)=>{this.processEvent(e[0])}),Ce.globalRef.events.forEach(this.processEvent.bind(this))}meddleProfile(){this.overwritePush(Ce.globalRef.profile,(...e)=>{this.processProfile(e[0])}),Ce.globalRef.profile.forEach(this.processProfile.bind(this))}processAccount(e){e&&(e.appID&&Ce.authenticate(e),e.flags&&(this.runtimeData.flags=e.flags))}processEvent(e){e&&(um.includes(e[0])?Ce.sendEvent(e[0],e[1],E({occurred:this.runtimeData.jsLoadTime},e[2])):Ce.sendEvent(e[0],e[1],e[2]))}processProfile(e){e&&Ce.updateProfile(e)}processPageName(e){e&&Ce.setPageName(e)}meddlePage(){this.overwritePush(Ce.globalRef.page,(...e)=>{this.processPage(e[0])}),Ce.globalRef.page.forEach(this.processPage.bind(this))}processPage(e){e.currentItem&&WT(e.currentItem),e.currency&&(fe().currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.pageName&&Ce.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiments=e.activeExperiment),e.cart&&me.getCurrent().update(e.cart),e.configurations&&Nv(e.configurations),e.customContext&&(this.runtimeData.customContext=E(E({},this.runtimeData.customContext),e.customContext))}async testCartUpdate(){if(fe().pageName!=="product"){window.alert("This feature is only available on a product page");return}let e=_v();if(e||(e=fe().currentItem?.vID),!e){window.alert("Could not find a variant to test. Please try a different product page");return}let r=new St({id:"preview",shortID:"1",redirectBehaviour:Qt.CART_DRAWER});await new fn(new Ir(new Date,r)).execute({clickAction:{at:be.ADD_TO_CART},embeddedItem:new Dt({vID:e})})}};function WT(t){let e=fe();if(e.currentItem&&e.currentItem.vID!==t.vID){let r=new CustomEvent("letscooee:variant-change",{detail:{variantID:t.vID,productID:t.mID}});document.dispatchEvent(r)}e.currentItem=new Dt(t)}var Si=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX="cooee".concat("-");static getString(e,r){return this.getItem(e)||r}static setString(e,r){this.setItem(e,r)}static remove(e){this.removeItem(e)}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,r){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),r)}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}};var jT=1e3,GT=10,Kp=0,Xp=new Date;function Jp(t){Si.remove("sleid"),Xp=t??new Date}function Pv(){if(window.scrollY){let t=Bv();Lv(t)&&Mv(t)}wn(()=>{qT()})}function qT(){po(window,"scroll").pipe(zt(jT),un(()=>{let t=Bv();if(t>100){b.warn("Received scroll percent is more than 100",t);return}if(Lv(t))return t})).subscribe(t=>{Mv(t)})}function Lv(t){return Math.abs(Kp-t)>=GT||Kp!==t&&t===100}function Mv(t){if(t==null)return;let e={percent:t,timeMS:new Date().getTime()-Xp.getTime()};Kp=t;let r=Si.getString("sleid",""),n=new xe("CE Scroll",e,null,r);Tt(n),Si.setString("sleid",n.id.toHexString()),Xp=new Date(n.occurred)}function Bv(){let t=window.document.body.scrollHeight,e=window.innerHeight;return Math.ceil((window.scrollY+e)/t*100)}function Uv(){zT()}function zT(){let t=window.fetch;window.fetch=async function(e,r){try{await YT(e,r)}catch(n){ae(n,"modify-graphql-request",{extra:{body:JSON.stringify(r?.body)}})}return t(e,r)},b.verbose("Securely overwritten window.fetch method for graphql query")}async function YT(t,e){let r=typeof t=="string"?t:t instanceof Request?t.url:"";if(!(r.includes("graphql.json")&&e?.method==="POST")||!e.body)return;let n;if(typeof e.body=="string")try{n=JSON.parse(e.body)}catch{return}else n=e.body;n?.variables?.input&&(b.verbose("Intercepted fetch request of:",r),n?.query.includes("cartCreate")&&(e.body=await KT(n),XT()))}async function KT(t){let e=t.variables.input.attributes??[],r=await $a("Buy Now");return t.variables.input.attributes=[...e,...r],JSON.stringify(t)}function XT(){let t=fe().currentItem;if(!t)return;let e=new xe("Buy Now Clicked",{items:[t]});Tt(e)}var Ti=class{constructor(e,r){this.selectors=e;this.eventName=r;this.selectorString=e.join(",")}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let r=e.currentTarget,n=new xe(this.eventName,{class:r.className||void 0,tagName:r.tagName||void 0,id:r.id||void 0});Tt(n),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>b.error(e))}async listen(){this.elements=await df(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(r=>{r.removeEventListener("click",e)})}};var Rl=class t extends Ti{static selectors=[".product__thumbnail-list-inner > button","product-gallery-navigation > button",".product-media--thumb-container",".product-images-inner > img",".m-product-media",".swiper-button-control",".media__thumb",".slick-arrow",".productView-img-container.product-single__media",".product-gallery__thumbnail_item_inner"];constructor(){super(t.selectors,"Item Thumbnail Clicked")}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var Al=class t extends Ti{static selectors=[".jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup","reviewsio-product-ratings",".ruk_rating_snippet.tracked:not(.hidden)","a > .loox-rating",".yotpo-reviews-star-ratings-widget",".yotpo.lp-hero__reviews",".pr-rating > a",".rivyoReviewWidget"];constructor(){super(t.selectors,"Review Clicked")}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var JT=[".gokwik-checkout button","button.cart__checkout-button","button.cart__checkout","button#checkout","button#checkout2",'button[id*="checkout" i]','button[name*="checkout" i]','button[class*="checkout" i]'].join(",");function kv(){wn(()=>{b.verbose("Execution order:","document ready"),QT()})}function QT(){let t=window.location.hash?.substring(1);if(t)if(t.includes("initiate-checkout")){document.dispatchEvent(new Event("letscooee:outbound:third-party-initiate-checkout"));let e=document.querySelector(JT);if(!e){b.verbose("No clickable cart checkout button found");return}b.verbose("Clickable cart checkout button found",e),e.click()}else t.includes("open-cart-drawer")&&ot.get().open()}function Hv(){window.addEventListener("kp-modal:opened",()=>{fe().isGoKwikPopupOpen=!0}),window.addEventListener("user-loggedin",t=>{let{token:e}=t.detail;e&&bi({goKwikToken:e})}),window.gokwikSdk?Fv():window.addEventListener("gokwikLoaded",Fv)}function Fv(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let t=await me.getCurrent().getNormalisedCart(),e={via:"GoKwik",items:t.items,cartToken:t.token,amount:{value:t.amount,currency:t.currency}},r=new xe("Checkout Started",e);Tt(r)})}var Dl=class{static watch(){let e=dm();(e==="1"||e==="on")&&hl({debugTill:this.getDebugMillis()}),e==="on"?sessionStorage.cooeeDebug="1":e==="off"&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&this.renderDebugBar()}static renderDebugBar(){let e=document.createElement("cooee-debugger");e.logs=this.logs,wn(()=>{document.body.appendChild(e)})}static getDebugMillis(){return new Date().getTime()+360*60*1e3}};var Fs=class Fs extends hn{};wo(Fs,"storeName","app"),Fs.storage=Io(Fs.storeName);var Ol=Fs;var Ce=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(e){if(!window.cooeeSDKPreview){if(b.info("Initialising SDK"),Bg(navigator.userAgent)){b.info("This seems to be a bot. Disabling SDK");return}this.initGlobalReference(e),await Wy(),this.autoAuthenticate(),new Cl().meddle(),_m(),ks(!0),yl(),ZT(),Jy(),iv(),Uv(),kv(),Pv(),Al.getInstance().listenSilently(),Rl.getInstance().listenSilently(),Hv(),eI(),Dl.watch(),Ol.remove("conf").catch(r=>{b.error("Fail to remove App Config from local storage",r)})}}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(e){window.CooeeSDK||Nr(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,Nr(this.globalRef,"config",new ze),Nr(this.globalRef,"runtimeData",{sdkLoadTime:e,jsLoadTime:new Date,lastEnterActive:new Date}),Nr(this.globalRef,"uaParser",new br,!0),Nr(this.globalRef,"cart",me.getCurrent()),Nr(this.globalRef,"cartChange$",ov()),Nr(this.globalRef,"cartDrawerToggle$",ot.cartDrawerToggle$.asObservable()),b.verbose("Global reference initialised"),new Ac(()=>{this.globalRef.uaParser=new br})}static injectWidgetAssets(){Pg(dr.widgetURL,"cooee-widget-sdk"),np()}static autoAuthenticate(){let e=tc();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;b.info("Begin auth after \u23F0",So(),"of SDK load");let r=e.appID?.trim(),n=e.shopifyShop;if((pf(r)||r.length!==24)&&pf(n)){b.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,$y(e)}static sendEvent(e,r,n){let o=new xe(e,r,n?.triggerData);n?.occurred&&(o.occurred=n.occurred),Tt(o)}static updateProfile(e){for(let r in e)if(r.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");bi(e)}static setPageName(e){if(!e)return;let r=fe(),n=r.pageName;if(e===n)return;if(r.pageName=e,cm.some(s=>e.includes(s))){Jp();return}let o={};n&&(o.ps=n);let i=new xe("CE Screen View",o);i.occurred=r.jsLoadTime,Tt(i),Jp(i.occurred)}static previewPopup(e,r){new kn(r).render(e)}static previewWidget(e){new yt(new St(e)).renderSilently()}};function ZT(){window.CooeeSDK.cartChange$.subscribe(()=>{ks()})}function eI(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(t){b.error(t)}window.addEventListener("message",t=>{if(b.verbose("Received event",t),!t.origin.includes("letscooee.com")&&!t.origin.includes("localhost"))return;let e=t.data;typeof e=="object"&&(e.action==="POPUP_PREVIEW"?(Ce.previewPopup(e.engagementTrigger),t.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},t.origin)):e.action==="WIDGET_PREVIEW"&&(Ce.previewWidget(e.engagementTrigger),t.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},t.origin)))})}}var $v=new Date;pm();hm();b.verbose("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(b.verbose("Execution order:","IIFE start"),await Ce.initForMerchantWebsiteOnly($v),await Ce.initForAll(),tI(),b.verbose("Execution order:","IIFE end")))());b.verbose("Execution order:","bottom");function tI(){mm()&&import("./debug-logs-L7PWPC5Y.js").then(({printAllDebugLogs:t})=>t($v))}
|