@letscooee/web-sdk 9.12.6 → 9.12.8
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/main.min.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var yd=Object.create;var Ec=Object.defineProperty;var vd=Object.getOwnPropertyDescriptor;var wd=Object.getOwnPropertyNames;var bd=Object.getPrototypeOf,_d=Object.prototype.hasOwnProperty;var Ed=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of wd(e))!_d.call(t,i)&&i!==r&&Ec(t,i,{get:()=>e[i],enumerable:!(n=vd(e,i))||n.enumerable});return t};var Sd=(t,e,r)=>(r=t!=null?yd(bd(t)):{},Ed(e||!t||!t.__esModule?Ec(r,"default",{value:t,enumerable:!0}):r,t));var Id=Object.create,ta=Object.defineProperty,Cd=Object.defineProperties,Td=Object.getOwnPropertyDescriptor,xd=Object.getOwnPropertyDescriptors,Dd=Object.getOwnPropertyNames,Sc=Object.getOwnPropertySymbols,Ad=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty,Nd=Object.prototype.propertyIsEnumerable,Ic=(t,e,r)=>e in t?ta(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e||={})du.call(e,r)&&Ic(t,r,e[r]);if(Sc)for(var r of Sc(e))Nd.call(e,r)&&Ic(t,r,e[r]);return t},yt=(t,e)=>Cd(t,xd(e)),di=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),rs=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Od=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Dd(e))!du.call(t,i)&&i!==r&&ta(t,i,{get:()=>e[i],enumerable:!(n=Td(e,i))||n.enumerable});return t},ke=(t,e,r)=>(r=t!=null?Id(Ad(t)):{},Od(e||!t||!t.__esModule?ta(r,"default",{value:t,enumerable:!0}):r,t)),sn=rs((t,e)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,b){return function(){return b.apply(h,arguments)}},c=function(){var h=arguments,b=h[0],v,w;for(w=1;w<h.length;w++)for(v in h[w])!(v in b)&&h[w].hasOwnProperty(v)&&(b[v]=h[w][v]);return b},l=function(h,b){return{value:h,name:b}};n.TRACE=l(1,"TRACE"),n.DEBUG=l(2,"DEBUG"),n.INFO=l(3,"INFO"),n.TIME=l(4,"TIME"),n.WARN=l(5,"WARN"),n.ERROR=l(8,"ERROR"),n.OFF=l(99,"OFF");var p=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};p.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var b=this.context.filterLevel;return h.value>=b.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,b){i&&this.enabledFor(h)&&i(b,c({level:h},this.context))}};var d=new p({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(d,d.enabledFor),h.trace=o(d,d.trace),h.debug=o(d,d.debug),h.time=o(d,d.time),h.timeEnd=o(d,d.timeEnd),h.info=o(d,d.info),h.warn=o(d,d.warn),h.error=o(d,d.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){d.setLevel(h);for(var b in s)s.hasOwnProperty(b)&&s[b].setLevel(h)},n.getLevel=function(){return d.getLevel()},n.get=function(h){return s[h]||(s[h]=new p(c({name:h},d.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(w,_){_.name&&w.unshift("["+_.name+"]")};var b={},v=function(w,_){Function.prototype.apply.call(w,console,_)};return typeof console>"u"?function(){}:function(w,_){w=Array.prototype.slice.call(w);var k=console.log,A;_.level===n.TIME?(A=(_.name?"["+_.name+"] ":"")+w[0],w[1]==="start"?console.time?console.time(A):b[A]=new Date().getTime():console.timeEnd?console.timeEnd(A):v(k,[A+": "+(new Date().getTime()-b[A])+"ms"])):(_.level===n.WARN&&console.warn?k=console.warn:_.level===n.ERROR&&console.error?k=console.error:_.level===n.INFO&&console.info?k=console.info:_.level===n.DEBUG&&console.debug?k=console.debug:_.level===n.TRACE&&console.trace&&(k=console.trace),h.formatter(w,_),v(k,w))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof e<"u"&&e.exports?e.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(t)}),kd=rs((t,e)=>{"use strict";(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,c,l){function p(b,v){if(!c[b]){if(!o[b]){var w=typeof di=="function"&&di;if(!v&&w)return w(b,!0);if(d)return d(b,!0);var _=new Error("Cannot find module '"+b+"'");throw _.code="MODULE_NOT_FOUND",_}var k=c[b]={exports:{}};o[b][0].call(k.exports,function(A){var B=o[b][1][A];return p(B||A)},k,k.exports,s,o,c,l)}return c[b].exports}for(var d=typeof di=="function"&&di,h=0;h<l.length;h++)p(l[h]);return p}({1:[function(s,o,c){(function(l){"use strict";var p=l.MutationObserver||l.WebKitMutationObserver,d;if(p){var h=0,b=new p(A),v=l.document.createTextNode("");b.observe(v,{characterData:!0}),d=function(){v.data=h=++h%2}}else if(!l.setImmediate&&typeof l.MessageChannel<"u"){var w=new l.MessageChannel;w.port1.onmessage=A,d=function(){w.port2.postMessage(0)}}else"document"in l&&"onreadystatechange"in l.document.createElement("script")?d=function(){var G=l.document.createElement("script");G.onreadystatechange=function(){A(),G.onreadystatechange=null,G.parentNode.removeChild(G),G=null},l.document.documentElement.appendChild(G)}:d=function(){setTimeout(A,0)};var _,k=[];function A(){_=!0;for(var G,j,X=k.length;X;){for(j=k,k=[],G=-1;++G<X;)j[G]();X=k.length}_=!1}o.exports=B;function B(G){k.push(G)===1&&!_&&d()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var l=s(1);function p(){}var d={},h=["REJECTED"],b=["FULFILLED"],v=["PENDING"];o.exports=w;function w(q){if(typeof q!="function")throw new TypeError("resolver must be a function");this.state=v,this.queue=[],this.outcome=void 0,q!==p&&B(this,q)}w.prototype.catch=function(q){return this.then(null,q)},w.prototype.then=function(q,rt){if(typeof q!="function"&&this.state===b||typeof rt!="function"&&this.state===h)return this;var Q=new this.constructor(p);if(this.state!==v){var tt=this.state===b?q:rt;k(Q,tt,this.outcome)}else this.queue.push(new _(Q,q,rt));return Q};function _(q,rt,Q){this.promise=q,typeof rt=="function"&&(this.onFulfilled=rt,this.callFulfilled=this.otherCallFulfilled),typeof Q=="function"&&(this.onRejected=Q,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(q){d.resolve(this.promise,q)},_.prototype.otherCallFulfilled=function(q){k(this.promise,this.onFulfilled,q)},_.prototype.callRejected=function(q){d.reject(this.promise,q)},_.prototype.otherCallRejected=function(q){k(this.promise,this.onRejected,q)};function k(q,rt,Q){l(function(){var tt;try{tt=rt(Q)}catch(lt){return d.reject(q,lt)}tt===q?d.reject(q,new TypeError("Cannot resolve promise with itself")):d.resolve(q,tt)})}d.resolve=function(q,rt){var Q=G(A,rt);if(Q.status==="error")return d.reject(q,Q.value);var tt=Q.value;if(tt)B(q,tt);else{q.state=b,q.outcome=rt;for(var lt=-1,kt=q.queue.length;++lt<kt;)q.queue[lt].callFulfilled(rt)}return q},d.reject=function(q,rt){q.state=h,q.outcome=rt;for(var Q=-1,tt=q.queue.length;++Q<tt;)q.queue[Q].callRejected(rt);return q};function A(q){var rt=q&&q.then;if(q&&(typeof q=="object"||typeof q=="function")&&typeof rt=="function")return function(){rt.apply(q,arguments)}}function B(q,rt){var Q=!1;function tt(jt){Q||(Q=!0,d.reject(q,jt))}function lt(jt){Q||(Q=!0,d.resolve(q,jt))}function kt(){rt(lt,tt)}var At=G(kt);At.status==="error"&&tt(At.value)}function G(q,rt){var Q={};try{Q.value=q(rt),Q.status="success"}catch(tt){Q.status="error",Q.value=tt}return Q}w.resolve=j;function j(q){return q instanceof this?q:d.resolve(new this(p),q)}w.reject=X;function X(q){var rt=new this(p);return d.reject(rt,q)}w.all=_t;function _t(q){var rt=this;if(Object.prototype.toString.call(q)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Q=q.length,tt=!1;if(!Q)return this.resolve([]);for(var lt=new Array(Q),kt=0,At=-1,jt=new this(p);++At<Q;)Wt(q[At],At);return jt;function Wt(ft,Gt){rt.resolve(ft).then(st,function(et){tt||(tt=!0,d.reject(jt,et))});function st(et){lt[Gt]=et,++kt===Q&&!tt&&(tt=!0,d.resolve(jt,lt))}}}w.race=Dt;function Dt(q){var rt=this;if(Object.prototype.toString.call(q)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Q=q.length,tt=!1;if(!Q)return this.resolve([]);for(var lt=-1,kt=new this(p);++lt<Q;)At(q[lt]);return kt;function At(jt){rt.resolve(jt).then(function(Wt){tt||(tt=!0,d.resolve(kt,Wt))},function(Wt){tt||(tt=!0,d.reject(kt,Wt))})}}},{1:1}],3:[function(s,o,c){(function(l){"use strict";typeof l.Promise!="function"&&(l.Promise=s(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(s,o,c){"use strict";var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g};function p(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function d(){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 h=d();function b(){try{if(!h||!h.open)return!1;var g=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),m=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!g||m)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function v(g,m){g=g||[],m=m||{};try{return new Blob(g,m)}catch(C){if(C.name!=="TypeError")throw C;for(var y=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,I=new y,S=0;S<g.length;S+=1)I.append(g[S]);return I.getBlob(m.type)}}typeof Promise>"u"&&s(3);var w=Promise;function _(g,m){m&&g.then(function(y){m(null,y)},function(y){m(y)})}function k(g,m,y){typeof m=="function"&&g.then(m),typeof y=="function"&&g.catch(y)}function A(g){return typeof g!="string"&&(console.warn(g+" used as a key, but it is not a string."),g=String(g)),g}function B(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var G="local-forage-detect-blob-support",j=void 0,X={},_t=Object.prototype.toString,Dt="readonly",q="readwrite";function rt(g){for(var m=g.length,y=new ArrayBuffer(m),I=new Uint8Array(y),S=0;S<m;S++)I[S]=g.charCodeAt(S);return y}function Q(g){return new w(function(m){var y=g.transaction(G,q),I=v([""]);y.objectStore(G).put(I,"key"),y.onabort=function(S){S.preventDefault(),S.stopPropagation(),m(!1)},y.oncomplete=function(){var S=navigator.userAgent.match(/Chrome\/(\d+)/),C=navigator.userAgent.match(/Edge\//);m(C||!S||parseInt(S[1],10)>=43)}}).catch(function(){return!1})}function tt(g){return typeof j=="boolean"?w.resolve(j):Q(g).then(function(m){return j=m,j})}function lt(g){var m=X[g.name],y={};y.promise=new w(function(I,S){y.resolve=I,y.reject=S}),m.deferredOperations.push(y),m.dbReady?m.dbReady=m.dbReady.then(function(){return y.promise}):m.dbReady=y.promise}function kt(g){var m=X[g.name],y=m.deferredOperations.pop();if(y)return y.resolve(),y.promise}function At(g,m){var y=X[g.name],I=y.deferredOperations.pop();if(I)return I.reject(m),I.promise}function jt(g,m){return new w(function(y,I){if(X[g.name]=X[g.name]||ui(),g.db)if(m)lt(g),g.db.close();else return y(g.db);var S=[g.name];m&&S.push(g.version);var C=h.open.apply(h,S);m&&(C.onupgradeneeded=function(O){var $=C.result;try{$.createObjectStore(g.storeName),O.oldVersion<=1&&$.createObjectStore(G)}catch(W){if(W.name==="ConstraintError")console.warn('The database "'+g.name+'" has been upgraded from version '+O.oldVersion+" to version "+O.newVersion+', but the storage "'+g.storeName+'" already exists.');else throw W}}),C.onerror=function(O){O.preventDefault(),I(C.error)},C.onsuccess=function(){var O=C.result;O.onversionchange=function($){$.target.close()},y(O),kt(g)}})}function Wt(g){return jt(g,!1)}function ft(g){return jt(g,!0)}function Gt(g,m){if(!g.db)return!0;var y=!g.db.objectStoreNames.contains(g.storeName),I=g.version<g.db.version,S=g.version>g.db.version;if(I&&(g.version!==m&&console.warn('The database "'+g.name+`" can't be downgraded from version `+g.db.version+" to version "+g.version+"."),g.version=g.db.version),S||y){if(y){var C=g.db.version+1;C>g.version&&(g.version=C)}return!0}return!1}function st(g){return new w(function(m,y){var I=new FileReader;I.onerror=y,I.onloadend=function(S){var C=btoa(S.target.result||"");m({__local_forage_encoded_blob:!0,data:C,type:g.type})},I.readAsBinaryString(g)})}function et(g){var m=rt(atob(g.data));return v([m],{type:g.type})}function $t(g){return g&&g.__local_forage_encoded_blob}function ci(g){var m=this,y=m._initReady().then(function(){var I=X[m._dbInfo.name];if(I&&I.dbReady)return I.dbReady});return k(y,g,g),y}function li(g){lt(g);for(var m=X[g.name],y=m.forages,I=0;I<y.length;I++){var S=y[I];S._dbInfo.db&&(S._dbInfo.db.close(),S._dbInfo.db=null)}return g.db=null,Wt(g).then(function(C){return g.db=C,Gt(g)?ft(g):C}).then(function(C){g.db=m.db=C;for(var O=0;O<y.length;O++)y[O]._dbInfo.db=C}).catch(function(C){throw At(g,C),C})}function oe(g,m,y,I){I===void 0&&(I=1);try{var S=g.db.transaction(g.storeName,m);y(null,S)}catch(C){if(I>0&&(!g.db||C.name==="InvalidStateError"||C.name==="NotFoundError"))return w.resolve().then(function(){if(!g.db||C.name==="NotFoundError"&&!g.db.objectStoreNames.contains(g.storeName)&&g.version<=g.db.version)return g.db&&(g.version=g.db.version+1),ft(g)}).then(function(){return li(g).then(function(){oe(g,m,y,I-1)})}).catch(y);y(C)}}function ui(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Es(g){var m=this,y={db:null};if(g)for(var I in g)y[I]=g[I];var S=X[y.name];S||(S=ui(),X[y.name]=S),S.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=ci);var C=[];function O(){return w.resolve()}for(var $=0;$<S.forages.length;$++){var W=S.forages[$];W!==m&&C.push(W._initReady().catch(O))}var V=S.forages.slice(0);return w.all(C).then(function(){return y.db=S.db,Wt(y)}).then(function(F){return y.db=F,Gt(y,m._defaultConfig.version)?ft(y):F}).then(function(F){y.db=S.db=F,m._dbInfo=y;for(var J=0;J<V.length;J++){var it=V[J];it!==m&&(it._dbInfo.db=y.db,it._dbInfo.version=y.version)}})}function dn(g,m){var y=this;g=A(g);var I=new w(function(S,C){y.ready().then(function(){oe(y._dbInfo,Dt,function(O,$){if(O)return C(O);try{var W=$.objectStore(y._dbInfo.storeName),V=W.get(g);V.onsuccess=function(){var F=V.result;F===void 0&&(F=null),$t(F)&&(F=et(F)),S(F)},V.onerror=function(){C(V.error)}}catch(F){C(F)}})}).catch(C)});return _(I,m),I}function Ss(g,m){var y=this,I=new w(function(S,C){y.ready().then(function(){oe(y._dbInfo,Dt,function(O,$){if(O)return C(O);try{var W=$.objectStore(y._dbInfo.storeName),V=W.openCursor(),F=1;V.onsuccess=function(){var J=V.result;if(J){var it=J.value;$t(it)&&(it=et(it));var vt=g(it,J.key,F++);vt!==void 0?S(vt):J.continue()}else S()},V.onerror=function(){C(V.error)}}catch(J){C(J)}})}).catch(C)});return _(I,m),I}function Is(g,m,y){var I=this;g=A(g);var S=new w(function(C,O){var $;I.ready().then(function(){return $=I._dbInfo,_t.call(m)==="[object Blob]"?tt($.db).then(function(W){return W?m:st(m)}):m}).then(function(W){oe(I._dbInfo,q,function(V,F){if(V)return O(V);try{var J=F.objectStore(I._dbInfo.storeName);W===null&&(W=void 0);var it=J.put(W,g);F.oncomplete=function(){W===void 0&&(W=null),C(W)},F.onabort=F.onerror=function(){var vt=it.error?it.error:it.transaction.error;O(vt)}}catch(vt){O(vt)}})}).catch(O)});return _(S,y),S}function hi(g,m){var y=this;g=A(g);var I=new w(function(S,C){y.ready().then(function(){oe(y._dbInfo,q,function(O,$){if(O)return C(O);try{var W=$.objectStore(y._dbInfo.storeName),V=W.delete(g);$.oncomplete=function(){S()},$.onerror=function(){C(V.error)},$.onabort=function(){var F=V.error?V.error:V.transaction.error;C(F)}}catch(F){C(F)}})}).catch(C)});return _(I,m),I}function Lr(g){var m=this,y=new w(function(I,S){m.ready().then(function(){oe(m._dbInfo,q,function(C,O){if(C)return S(C);try{var $=O.objectStore(m._dbInfo.storeName),W=$.clear();O.oncomplete=function(){I()},O.onabort=O.onerror=function(){var V=W.error?W.error:W.transaction.error;S(V)}}catch(V){S(V)}})}).catch(S)});return _(y,g),y}function ae(g){var m=this,y=new w(function(I,S){m.ready().then(function(){oe(m._dbInfo,Dt,function(C,O){if(C)return S(C);try{var $=O.objectStore(m._dbInfo.storeName),W=$.count();W.onsuccess=function(){I(W.result)},W.onerror=function(){S(W.error)}}catch(V){S(V)}})}).catch(S)});return _(y,g),y}function fn(g,m){var y=this,I=new w(function(S,C){if(g<0){S(null);return}y.ready().then(function(){oe(y._dbInfo,Dt,function(O,$){if(O)return C(O);try{var W=$.objectStore(y._dbInfo.storeName),V=!1,F=W.openKeyCursor();F.onsuccess=function(){var J=F.result;if(!J){S(null);return}g===0||V?S(J.key):(V=!0,J.advance(g))},F.onerror=function(){C(F.error)}}catch(J){C(J)}})}).catch(C)});return _(I,m),I}function Cs(g){var m=this,y=new w(function(I,S){m.ready().then(function(){oe(m._dbInfo,Dt,function(C,O){if(C)return S(C);try{var $=O.objectStore(m._dbInfo.storeName),W=$.openKeyCursor(),V=[];W.onsuccess=function(){var F=W.result;if(!F){I(V);return}V.push(F.key),F.continue()},W.onerror=function(){S(W.error)}}catch(F){S(F)}})}).catch(S)});return _(y,g),y}function a(g,m){m=B.apply(this,arguments);var y=this.config();g=typeof g!="function"&&g||{},g.name||(g.name=g.name||y.name,g.storeName=g.storeName||y.storeName);var I=this,S;if(!g.name)S=w.reject("Invalid arguments");else{var C=g.name===y.name&&I._dbInfo.db,O=C?w.resolve(I._dbInfo.db):Wt(g).then(function($){var W=X[g.name],V=W.forages;W.db=$;for(var F=0;F<V.length;F++)V[F]._dbInfo.db=$;return $});g.storeName?S=O.then(function($){if($.objectStoreNames.contains(g.storeName)){var W=$.version+1;lt(g);var V=X[g.name],F=V.forages;$.close();for(var J=0;J<F.length;J++){var it=F[J];it._dbInfo.db=null,it._dbInfo.version=W}var vt=new w(function(pt,Pt){var It=h.open(g.name,W);It.onerror=function(ce){var Ns=It.result;Ns.close(),Pt(ce)},It.onupgradeneeded=function(){var ce=It.result;ce.deleteObjectStore(g.storeName)},It.onsuccess=function(){var ce=It.result;ce.close(),pt(ce)}});return vt.then(function(pt){V.db=pt;for(var Pt=0;Pt<F.length;Pt++){var It=F[Pt];It._dbInfo.db=pt,kt(It._dbInfo)}}).catch(function(pt){throw(At(g,pt)||w.resolve()).catch(function(){}),pt})}}):S=O.then(function($){lt(g);var W=X[g.name],V=W.forages;$.close();for(var F=0;F<V.length;F++){var J=V[F];J._dbInfo.db=null}var it=new w(function(vt,pt){var Pt=h.deleteDatabase(g.name);Pt.onerror=function(){var It=Pt.result;It&&It.close(),pt(Pt.error)},Pt.onblocked=function(){console.warn('dropInstance blocked for database "'+g.name+'" until all open connections are closed')},Pt.onsuccess=function(){var It=Pt.result;It&&It.close(),vt(It)}});return it.then(function(vt){W.db=vt;for(var pt=0;pt<V.length;pt++){var Pt=V[pt];kt(Pt._dbInfo)}}).catch(function(vt){throw(At(g,vt)||w.resolve()).catch(function(){}),vt})})}return _(S,m),S}var u={_driver:"asyncStorage",_initStorage:Es,_support:b(),iterate:Ss,getItem:dn,setItem:Is,removeItem:hi,clear:Lr,length:ae,key:fn,keys:Cs,dropInstance:a};function f(){return typeof openDatabase=="function"}var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D="~~local_forage_type~",M=/^~~local_forage_type~([^~]+)~/,Y="__lfsc__:",ut=Y.length,Nt="arbf",gt="blob",St="si08",Ut="ui08",hr="uic8",gn="si16",mn="si32",lc="ur16",uc="ui32",hc="fl32",pc="fl64",dc=ut+Nt.length,fc=Object.prototype.toString;function gc(g){var m=g.length*.75,y=g.length,I,S=0,C,O,$,W;g[g.length-1]==="="&&(m--,g[g.length-2]==="="&&m--);var V=new ArrayBuffer(m),F=new Uint8Array(V);for(I=0;I<y;I+=4)C=E.indexOf(g[I]),O=E.indexOf(g[I+1]),$=E.indexOf(g[I+2]),W=E.indexOf(g[I+3]),F[S++]=C<<2|O>>4,F[S++]=(O&15)<<4|$>>2,F[S++]=($&3)<<6|W&63;return V}function Ts(g){var m=new Uint8Array(g),y="",I;for(I=0;I<m.length;I+=3)y+=E[m[I]>>2],y+=E[(m[I]&3)<<4|m[I+1]>>4],y+=E[(m[I+1]&15)<<2|m[I+2]>>6],y+=E[m[I+2]&63];return m.length%3===2?y=y.substring(0,y.length-1)+"=":m.length%3===1&&(y=y.substring(0,y.length-2)+"=="),y}function Rp(g,m){var y="";if(g&&(y=fc.call(g)),g&&(y==="[object ArrayBuffer]"||g.buffer&&fc.call(g.buffer)==="[object ArrayBuffer]")){var I,S=Y;g instanceof ArrayBuffer?(I=g,S+=Nt):(I=g.buffer,y==="[object Int8Array]"?S+=St:y==="[object Uint8Array]"?S+=Ut:y==="[object Uint8ClampedArray]"?S+=hr:y==="[object Int16Array]"?S+=gn:y==="[object Uint16Array]"?S+=lc:y==="[object Int32Array]"?S+=mn:y==="[object Uint32Array]"?S+=uc:y==="[object Float32Array]"?S+=hc:y==="[object Float64Array]"?S+=pc:m(new Error("Failed to get type for BinaryArray"))),m(S+Ts(I))}else if(y==="[object Blob]"){var C=new FileReader;C.onload=function(){var O=D+g.type+"~"+Ts(this.result);m(Y+gt+O)},C.readAsArrayBuffer(g)}else try{m(JSON.stringify(g))}catch(O){console.error("Couldn't convert value into a JSON string: ",g),m(null,O)}}function Lp(g){if(g.substring(0,ut)!==Y)return JSON.parse(g);var m=g.substring(dc),y=g.substring(ut,dc),I;if(y===gt&&M.test(m)){var S=m.match(M);I=S[1],m=m.substring(S[0].length)}var C=gc(m);switch(y){case Nt:return C;case gt:return v([C],{type:I});case St:return new Int8Array(C);case Ut:return new Uint8Array(C);case hr:return new Uint8ClampedArray(C);case gn:return new Int16Array(C);case lc:return new Uint16Array(C);case mn:return new Int32Array(C);case uc:return new Uint32Array(C);case hc:return new Float32Array(C);case pc:return new Float64Array(C);default:throw new Error("Unkown type: "+y)}}var xs={serialize:Rp,deserialize:Lp,stringToBuffer:gc,bufferToString:Ts};function mc(g,m,y,I){g.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],y,I)}function Mp(g){var m=this,y={db:null};if(g)for(var I in g)y[I]=typeof g[I]!="string"?g[I].toString():g[I];var S=new w(function(C,O){try{y.db=openDatabase(y.name,String(y.version),y.description,y.size)}catch($){return O($)}y.db.transaction(function($){mc($,y,function(){m._dbInfo=y,C()},function(W,V){O(V)})},O)});return y.serializer=xs,S}function Je(g,m,y,I,S,C){g.executeSql(y,I,S,function(O,$){$.code===$.SYNTAX_ERR?O.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(W,V){V.rows.length?C(W,$):mc(W,m,function(){W.executeSql(y,I,S,C)},C)},C):C(O,$)},C)}function Up(g,m){var y=this;g=A(g);var I=new w(function(S,C){y.ready().then(function(){var O=y._dbInfo;O.db.transaction(function($){Je($,O,"SELECT * FROM "+O.storeName+" WHERE key = ? LIMIT 1",[g],function(W,V){var F=V.rows.length?V.rows.item(0).value:null;F&&(F=O.serializer.deserialize(F)),S(F)},function(W,V){C(V)})})}).catch(C)});return _(I,m),I}function Bp(g,m){var y=this,I=new w(function(S,C){y.ready().then(function(){var O=y._dbInfo;O.db.transaction(function($){Je($,O,"SELECT * FROM "+O.storeName,[],function(W,V){for(var F=V.rows,J=F.length,it=0;it<J;it++){var vt=F.item(it),pt=vt.value;if(pt&&(pt=O.serializer.deserialize(pt)),pt=g(pt,vt.key,it+1),pt!==void 0){S(pt);return}}S()},function(W,V){C(V)})})}).catch(C)});return _(I,m),I}function yc(g,m,y,I){var S=this;g=A(g);var C=new w(function(O,$){S.ready().then(function(){m===void 0&&(m=null);var W=m,V=S._dbInfo;V.serializer.serialize(m,function(F,J){J?$(J):V.db.transaction(function(it){Je(it,V,"INSERT OR REPLACE INTO "+V.storeName+" (key, value) VALUES (?, ?)",[g,F],function(){O(W)},function(vt,pt){$(pt)})},function(it){if(it.code===it.QUOTA_ERR){if(I>0){O(yc.apply(S,[g,W,y,I-1]));return}$(it)}})})}).catch($)});return _(C,y),C}function jp(g,m,y){return yc.apply(this,[g,m,y,1])}function $p(g,m){var y=this;g=A(g);var I=new w(function(S,C){y.ready().then(function(){var O=y._dbInfo;O.db.transaction(function($){Je($,O,"DELETE FROM "+O.storeName+" WHERE key = ?",[g],function(){S()},function(W,V){C(V)})})}).catch(C)});return _(I,m),I}function Fp(g){var m=this,y=new w(function(I,S){m.ready().then(function(){var C=m._dbInfo;C.db.transaction(function(O){Je(O,C,"DELETE FROM "+C.storeName,[],function(){I()},function($,W){S(W)})})}).catch(S)});return _(y,g),y}function Hp(g){var m=this,y=new w(function(I,S){m.ready().then(function(){var C=m._dbInfo;C.db.transaction(function(O){Je(O,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function($,W){var V=W.rows.item(0).c;I(V)},function($,W){S(W)})})}).catch(S)});return _(y,g),y}function Vp(g,m){var y=this,I=new w(function(S,C){y.ready().then(function(){var O=y._dbInfo;O.db.transaction(function($){Je($,O,"SELECT key FROM "+O.storeName+" WHERE id = ? LIMIT 1",[g+1],function(W,V){var F=V.rows.length?V.rows.item(0).key:null;S(F)},function(W,V){C(V)})})}).catch(C)});return _(I,m),I}function qp(g){var m=this,y=new w(function(I,S){m.ready().then(function(){var C=m._dbInfo;C.db.transaction(function(O){Je(O,C,"SELECT key FROM "+C.storeName,[],function($,W){for(var V=[],F=0;F<W.rows.length;F++)V.push(W.rows.item(F).key);I(V)},function($,W){S(W)})})}).catch(S)});return _(y,g),y}function Wp(g){return new w(function(m,y){g.transaction(function(I){I.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(S,C){for(var O=[],$=0;$<C.rows.length;$++)O.push(C.rows.item($).name);m({db:g,storeNames:O})},function(S,C){y(C)})},function(I){y(I)})})}function Gp(g,m){m=B.apply(this,arguments);var y=this.config();g=typeof g!="function"&&g||{},g.name||(g.name=g.name||y.name,g.storeName=g.storeName||y.storeName);var I=this,S;return g.name?S=new w(function(C){var O;g.name===y.name?O=I._dbInfo.db:O=openDatabase(g.name,"","",0),g.storeName?C({db:O,storeNames:[g.storeName]}):C(Wp(O))}).then(function(C){return new w(function(O,$){C.db.transaction(function(W){function V(vt){return new w(function(pt,Pt){W.executeSql("DROP TABLE IF EXISTS "+vt,[],function(){pt()},function(It,ce){Pt(ce)})})}for(var F=[],J=0,it=C.storeNames.length;J<it;J++)F.push(V(C.storeNames[J]));w.all(F).then(function(){O()}).catch(function(vt){$(vt)})},function(W){$(W)})})}):S=w.reject("Invalid arguments"),_(S,m),S}var zp={_driver:"webSQLStorage",_initStorage:Mp,_support:f(),iterate:Bp,getItem:Up,setItem:jp,removeItem:$p,clear:Fp,length:Hp,key:Vp,keys:qp,dropInstance:Gp};function Yp(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function vc(g,m){var y=g.name+"/";return g.storeName!==m.storeName&&(y+=g.storeName+"/"),y}function Kp(){var g="_localforage_support_test";try{return localStorage.setItem(g,!0),localStorage.removeItem(g),!1}catch{return!0}}function Jp(){return!Kp()||localStorage.length>0}function Xp(g){var m=this,y={};if(g)for(var I in g)y[I]=g[I];return y.keyPrefix=vc(g,m._defaultConfig),Jp()?(m._dbInfo=y,y.serializer=xs,w.resolve()):w.reject()}function Qp(g){var m=this,y=m.ready().then(function(){for(var I=m._dbInfo.keyPrefix,S=localStorage.length-1;S>=0;S--){var C=localStorage.key(S);C.indexOf(I)===0&&localStorage.removeItem(C)}});return _(y,g),y}function Zp(g,m){var y=this;g=A(g);var I=y.ready().then(function(){var S=y._dbInfo,C=localStorage.getItem(S.keyPrefix+g);return C&&(C=S.serializer.deserialize(C)),C});return _(I,m),I}function td(g,m){var y=this,I=y.ready().then(function(){for(var S=y._dbInfo,C=S.keyPrefix,O=C.length,$=localStorage.length,W=1,V=0;V<$;V++){var F=localStorage.key(V);if(F.indexOf(C)===0){var J=localStorage.getItem(F);if(J&&(J=S.serializer.deserialize(J)),J=g(J,F.substring(O),W++),J!==void 0)return J}}});return _(I,m),I}function ed(g,m){var y=this,I=y.ready().then(function(){var S=y._dbInfo,C;try{C=localStorage.key(g)}catch{C=null}return C&&(C=C.substring(S.keyPrefix.length)),C});return _(I,m),I}function rd(g){var m=this,y=m.ready().then(function(){for(var I=m._dbInfo,S=localStorage.length,C=[],O=0;O<S;O++){var $=localStorage.key(O);$.indexOf(I.keyPrefix)===0&&C.push($.substring(I.keyPrefix.length))}return C});return _(y,g),y}function nd(g){var m=this,y=m.keys().then(function(I){return I.length});return _(y,g),y}function id(g,m){var y=this;g=A(g);var I=y.ready().then(function(){var S=y._dbInfo;localStorage.removeItem(S.keyPrefix+g)});return _(I,m),I}function sd(g,m,y){var I=this;g=A(g);var S=I.ready().then(function(){m===void 0&&(m=null);var C=m;return new w(function(O,$){var W=I._dbInfo;W.serializer.serialize(m,function(V,F){if(F)$(F);else try{localStorage.setItem(W.keyPrefix+g,V),O(C)}catch(J){(J.name==="QuotaExceededError"||J.name==="NS_ERROR_DOM_QUOTA_REACHED")&&$(J),$(J)}})})});return _(S,y),S}function od(g,m){if(m=B.apply(this,arguments),g=typeof g!="function"&&g||{},!g.name){var y=this.config();g.name=g.name||y.name,g.storeName=g.storeName||y.storeName}var I=this,S;return g.name?S=new w(function(C){g.storeName?C(vc(g,I._defaultConfig)):C(g.name+"/")}).then(function(C){for(var O=localStorage.length-1;O>=0;O--){var $=localStorage.key(O);$.indexOf(C)===0&&localStorage.removeItem($)}}):S=w.reject("Invalid arguments"),_(S,m),S}var ad={_driver:"localStorageWrapper",_initStorage:Xp,_support:Yp(),iterate:td,getItem:Zp,setItem:sd,removeItem:id,clear:Qp,length:nd,key:ed,keys:rd,dropInstance:od},cd=function(g,m){return g===m||typeof g=="number"&&typeof m=="number"&&isNaN(g)&&isNaN(m)},ld=function(g,m){for(var y=g.length,I=0;I<y;){if(cd(g[I],m))return!0;I++}return!1},wc=Array.isArray||function(g){return Object.prototype.toString.call(g)==="[object Array]"},yn={},bc={},Mr={INDEXEDDB:u,WEBSQL:zp,LOCALSTORAGE:ad},ud=[Mr.INDEXEDDB._driver,Mr.WEBSQL._driver,Mr.LOCALSTORAGE._driver],pi=["dropInstance"],Ds=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pi),hd={description:"",driver:ud.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function pd(g,m){g[m]=function(){var y=arguments;return g.ready().then(function(){return g[m].apply(g,y)})}}function As(){for(var g=1;g<arguments.length;g++){var m=arguments[g];if(m)for(var y in m)m.hasOwnProperty(y)&&(wc(m[y])?arguments[0][y]=m[y].slice():arguments[0][y]=m[y])}return arguments[0]}var dd=function(){function g(m){p(this,g);for(var y in Mr)if(Mr.hasOwnProperty(y)){var I=Mr[y],S=I._driver;this[y]=S,yn[S]||this.defineDriver(I)}this._defaultConfig=As({},hd),this._config=As({},this._defaultConfig,m),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return g.prototype.config=function(m){if((typeof m>"u"?"undefined":l(m))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var y in m){if(y==="storeName"&&(m[y]=m[y].replace(/\W/g,"_")),y==="version"&&typeof m[y]!="number")return new Error("Database version must be a number.");this._config[y]=m[y]}return"driver"in m&&m.driver?this.setDriver(this._config.driver):!0}else return typeof m=="string"?this._config[m]:this._config},g.prototype.defineDriver=function(m,y,I){var S=new w(function(C,O){try{var $=m._driver,W=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!m._driver){O(W);return}for(var V=Ds.concat("_initStorage"),F=0,J=V.length;F<J;F++){var it=V[F],vt=!ld(pi,it);if((vt||m[it])&&typeof m[it]!="function"){O(W);return}}var pt=function(){for(var It=function(gd){return function(){var md=new Error("Method "+gd+" is not implemented by the current driver"),_c=w.reject(md);return _(_c,arguments[arguments.length-1]),_c}},ce=0,Ns=pi.length;ce<Ns;ce++){var Os=pi[ce];m[Os]||(m[Os]=It(Os))}};pt();var Pt=function(It){yn[$]&&console.info("Redefining LocalForage driver: "+$),yn[$]=m,bc[$]=It,C()};"_support"in m?m._support&&typeof m._support=="function"?m._support().then(Pt,O):Pt(!!m._support):Pt(!0)}catch(It){O(It)}});return k(S,y,I),S},g.prototype.driver=function(){return this._driver||null},g.prototype.getDriver=function(m,y,I){var S=yn[m]?w.resolve(yn[m]):w.reject(new Error("Driver not found."));return k(S,y,I),S},g.prototype.getSerializer=function(m){var y=w.resolve(xs);return k(y,m),y},g.prototype.ready=function(m){var y=this,I=y._driverSet.then(function(){return y._ready===null&&(y._ready=y._initDriver()),y._ready});return k(I,m,m),I},g.prototype.setDriver=function(m,y,I){var S=this;wc(m)||(m=[m]);var C=this._getSupportedDrivers(m);function O(){S._config.driver=S.driver()}function $(F){return S._extend(F),O(),S._ready=S._initStorage(S._config),S._ready}function W(F){return function(){var J=0;function it(){for(;J<F.length;){var vt=F[J];return J++,S._dbInfo=null,S._ready=null,S.getDriver(vt).then($).catch(it)}O();var pt=new Error("No available storage method found.");return S._driverSet=w.reject(pt),S._driverSet}return it()}}var V=this._driverSet!==null?this._driverSet.catch(function(){return w.resolve()}):w.resolve();return this._driverSet=V.then(function(){var F=C[0];return S._dbInfo=null,S._ready=null,S.getDriver(F).then(function(J){S._driver=J._driver,O(),S._wrapLibraryMethodsWithReady(),S._initDriver=W(C)})}).catch(function(){O();var F=new Error("No available storage method found.");return S._driverSet=w.reject(F),S._driverSet}),k(this._driverSet,y,I),this._driverSet},g.prototype.supports=function(m){return!!bc[m]},g.prototype._extend=function(m){As(this,m)},g.prototype._getSupportedDrivers=function(m){for(var y=[],I=0,S=m.length;I<S;I++){var C=m[I];this.supports(C)&&y.push(C)}return y},g.prototype._wrapLibraryMethodsWithReady=function(){for(var m=0,y=Ds.length;m<y;m++)pd(this,Ds[m])},g.prototype.createInstance=function(m){return new g(m)},g}(),fd=new dd;o.exports=fd},{3:3}]},{},[4])(4)})}),fu=rs(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URLBuilder=void 0;var e=function(){function r(n){try{this.base=new URL(n),this.params=new URLSearchParams(this.base.search.slice(1))}catch(i){console.error("Un-parsable URL",i)}}return r.prototype.appendQueryParam=function(n,i){this.params.append(n,i?i.toString():"")},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(n){this.params.delete(n)},r.prototype.getBase=function(){return this.base},r.prototype.getPath=function(){return this.base.pathname},r.prototype.getHostname=function(){return this.base.hostname},r.prototype.getParams=function(){return this.params},r.prototype.getQueryParam=function(n){if(!this.params)return"";var i=this.params.get(n);return!i||i==="undefined"||i==="null"?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(n){return this.base.pathname=n,this},r.prototype.setQueryParam=function(n,i){return this.params.set(n,i?i.toString():""),this},r.prototype.setQueryString=function(n){if(n)return n[0]==="?"&&(n=n.slice(1)),this.params=new URLSearchParams(n),this},r.prototype.toString=function(){var n=this.params.toString();return n===""?this.base.search="":this.base.search="?"+n,this.base.toString()},r}();t.URLBuilder=e}),Pd=rs((t,e)=>{"use strict";(function(r,n){typeof t=="object"&&typeof e<"u"?e.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(t,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(l,p){var d=o.retries,h=o.retryDelay,b=o.retryOn;if(p&&p.retries!==void 0)if(n(p.retries))d=p.retries;else throw new i("retries must be a positive integer");if(p&&p.retryDelay!==void 0)if(n(p.retryDelay)||typeof p.retryDelay=="function")h=p.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(p&&p.retryOn)if(Array.isArray(p.retryOn)||typeof p.retryOn=="function")b=p.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(v,w){var _=function(A){var B=typeof Request<"u"&&l instanceof Request?l.clone():l;s(B,p).then(function(G){if(Array.isArray(b)&&b.indexOf(G.status)===-1)v(G);else if(typeof b=="function")try{return Promise.resolve(b(A,null,G)).then(function(j){j?k(A,null,G):v(G)}).catch(w)}catch(j){w(j)}else A<d?k(A,null,G):v(G)}).catch(function(G){if(typeof b=="function")try{Promise.resolve(b(A,G,null)).then(function(j){j?k(A,G,null):w(G)}).catch(function(j){w(j)})}catch(j){w(j)}else A<d?k(A,G,null):w(G)})};function k(A,B,G){var j=typeof h=="function"?h(A,B,G):h;setTimeout(function(){_(++A)},j)}_(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r})}),Rd="9.12.6",H=class co{static SDK_VERSION=Rd;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_EXPERIMENT_START="CE Experiment Start";static EVENT_VIDEO_DIALOG_CLOSED="CE Video Dialog Closed";static EVENT_VIDEO_DIALOG_OPENED="CE Video Dialog Opened";static EVENT_VIDEO_CHANGE="CE Video Changed";static EVENT_LAST_VIDEO_ENDED="CE Last Video Ended";static EVENT_VIDEO_MUTED="CE Video Muted";static EVENT_VIDEO_UNMUTED="CE Video Unmuted";static EVENT_ADD_TO_CART_CLICKED="CE Add To Cart Clicked";static EVENT_VIEW_ITEM_CLICKED="CE View Item Clicked";static EVENT_MORE_ITEM_INFO_CLICKED="CE More Item Info Clicked";static EVENT_OPEN_CART_CLICKED="CE Open Cart Clicked";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_OPEN_CART="Open Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static CTA_AFTER_REFRESH_UI="letscooee:outbound:refresh-ui";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static PAYMENT_MODAL_DETAILS=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}];static{let e=co.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");co.SDK_VERSION_CODE=parseInt(e,10)}},qe={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${H.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${H.SDK_VERSION}/dist/widget.min.js`},he=ke(sn()),T=class{static log(...t){he.default.info(...t)}static debug(...t){he.default.debug(...t)}static error(...t){he.default.error(...t)}static warn(...t){he.default.warn(...t)}static info(...t){he.default.info(...t)}static trace(...t){he.default.trace(...t)}};function Ld(t=H.LOG_PREFIX){he.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${H.SDK_VERSION}):`)}});let e=gu();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?he.default.setLevel(he.default[localStorage.cooeeLogLevel]):he.default.setLevel(qe.debug?he.default.TRACE:he.default.OFF)}function gu(){return new URL(location.href).searchParams?.get("cooee-debug")}function Md(){let t=`
|
|
1
|
+
"use strict";(()=>{var yd=Object.create;var Ec=Object.defineProperty;var vd=Object.getOwnPropertyDescriptor;var wd=Object.getOwnPropertyNames;var bd=Object.getPrototypeOf,_d=Object.prototype.hasOwnProperty;var Ed=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of wd(e))!_d.call(t,i)&&i!==r&&Ec(t,i,{get:()=>e[i],enumerable:!(n=vd(e,i))||n.enumerable});return t};var Sd=(t,e,r)=>(r=t!=null?yd(bd(t)):{},Ed(e||!t||!t.__esModule?Ec(r,"default",{value:t,enumerable:!0}):r,t));var Id=Object.create,ta=Object.defineProperty,Cd=Object.defineProperties,Td=Object.getOwnPropertyDescriptor,xd=Object.getOwnPropertyDescriptors,Dd=Object.getOwnPropertyNames,Sc=Object.getOwnPropertySymbols,Ad=Object.getPrototypeOf,du=Object.prototype.hasOwnProperty,Nd=Object.prototype.propertyIsEnumerable,Ic=(t,e,r)=>e in t?ta(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,x=(t,e)=>{for(var r in e||={})du.call(e,r)&&Ic(t,r,e[r]);if(Sc)for(var r of Sc(e))Nd.call(e,r)&&Ic(t,r,e[r]);return t},yt=(t,e)=>Cd(t,xd(e)),di=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),rs=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Od=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Dd(e))!du.call(t,i)&&i!==r&&ta(t,i,{get:()=>e[i],enumerable:!(n=Td(e,i))||n.enumerable});return t},ke=(t,e,r)=>(r=t!=null?Id(Ad(t)):{},Od(e||!t||!t.__esModule?ta(r,"default",{value:t,enumerable:!0}):r,t)),sn=rs((t,e)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,b){return function(){return b.apply(h,arguments)}},c=function(){var h=arguments,b=h[0],v,w;for(w=1;w<h.length;w++)for(v in h[w])!(v in b)&&h[w].hasOwnProperty(v)&&(b[v]=h[w][v]);return b},l=function(h,b){return{value:h,name:b}};n.TRACE=l(1,"TRACE"),n.DEBUG=l(2,"DEBUG"),n.INFO=l(3,"INFO"),n.TIME=l(4,"TIME"),n.WARN=l(5,"WARN"),n.ERROR=l(8,"ERROR"),n.OFF=l(99,"OFF");var p=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};p.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var b=this.context.filterLevel;return h.value>=b.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,b){i&&this.enabledFor(h)&&i(b,c({level:h},this.context))}};var d=new p({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(d,d.enabledFor),h.trace=o(d,d.trace),h.debug=o(d,d.debug),h.time=o(d,d.time),h.timeEnd=o(d,d.timeEnd),h.info=o(d,d.info),h.warn=o(d,d.warn),h.error=o(d,d.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){d.setLevel(h);for(var b in s)s.hasOwnProperty(b)&&s[b].setLevel(h)},n.getLevel=function(){return d.getLevel()},n.get=function(h){return s[h]||(s[h]=new p(c({name:h},d.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(w,_){_.name&&w.unshift("["+_.name+"]")};var b={},v=function(w,_){Function.prototype.apply.call(w,console,_)};return typeof console>"u"?function(){}:function(w,_){w=Array.prototype.slice.call(w);var k=console.log,A;_.level===n.TIME?(A=(_.name?"["+_.name+"] ":"")+w[0],w[1]==="start"?console.time?console.time(A):b[A]=new Date().getTime():console.timeEnd?console.timeEnd(A):v(k,[A+": "+(new Date().getTime()-b[A])+"ms"])):(_.level===n.WARN&&console.warn?k=console.warn:_.level===n.ERROR&&console.error?k=console.error:_.level===n.INFO&&console.info?k=console.info:_.level===n.DEBUG&&console.debug?k=console.debug:_.level===n.TRACE&&console.trace&&(k=console.trace),h.formatter(w,_),v(k,w))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof e<"u"&&e.exports?e.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(t)}),kd=rs((t,e)=>{"use strict";(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,c,l){function p(b,v){if(!c[b]){if(!o[b]){var w=typeof di=="function"&&di;if(!v&&w)return w(b,!0);if(d)return d(b,!0);var _=new Error("Cannot find module '"+b+"'");throw _.code="MODULE_NOT_FOUND",_}var k=c[b]={exports:{}};o[b][0].call(k.exports,function(A){var B=o[b][1][A];return p(B||A)},k,k.exports,s,o,c,l)}return c[b].exports}for(var d=typeof di=="function"&&di,h=0;h<l.length;h++)p(l[h]);return p}({1:[function(s,o,c){(function(l){"use strict";var p=l.MutationObserver||l.WebKitMutationObserver,d;if(p){var h=0,b=new p(A),v=l.document.createTextNode("");b.observe(v,{characterData:!0}),d=function(){v.data=h=++h%2}}else if(!l.setImmediate&&typeof l.MessageChannel<"u"){var w=new l.MessageChannel;w.port1.onmessage=A,d=function(){w.port2.postMessage(0)}}else"document"in l&&"onreadystatechange"in l.document.createElement("script")?d=function(){var G=l.document.createElement("script");G.onreadystatechange=function(){A(),G.onreadystatechange=null,G.parentNode.removeChild(G),G=null},l.document.documentElement.appendChild(G)}:d=function(){setTimeout(A,0)};var _,k=[];function A(){_=!0;for(var G,j,X=k.length;X;){for(j=k,k=[],G=-1;++G<X;)j[G]();X=k.length}_=!1}o.exports=B;function B(G){k.push(G)===1&&!_&&d()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var l=s(1);function p(){}var d={},h=["REJECTED"],b=["FULFILLED"],v=["PENDING"];o.exports=w;function w(q){if(typeof q!="function")throw new TypeError("resolver must be a function");this.state=v,this.queue=[],this.outcome=void 0,q!==p&&B(this,q)}w.prototype.catch=function(q){return this.then(null,q)},w.prototype.then=function(q,rt){if(typeof q!="function"&&this.state===b||typeof rt!="function"&&this.state===h)return this;var Q=new this.constructor(p);if(this.state!==v){var tt=this.state===b?q:rt;k(Q,tt,this.outcome)}else this.queue.push(new _(Q,q,rt));return Q};function _(q,rt,Q){this.promise=q,typeof rt=="function"&&(this.onFulfilled=rt,this.callFulfilled=this.otherCallFulfilled),typeof Q=="function"&&(this.onRejected=Q,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(q){d.resolve(this.promise,q)},_.prototype.otherCallFulfilled=function(q){k(this.promise,this.onFulfilled,q)},_.prototype.callRejected=function(q){d.reject(this.promise,q)},_.prototype.otherCallRejected=function(q){k(this.promise,this.onRejected,q)};function k(q,rt,Q){l(function(){var tt;try{tt=rt(Q)}catch(lt){return d.reject(q,lt)}tt===q?d.reject(q,new TypeError("Cannot resolve promise with itself")):d.resolve(q,tt)})}d.resolve=function(q,rt){var Q=G(A,rt);if(Q.status==="error")return d.reject(q,Q.value);var tt=Q.value;if(tt)B(q,tt);else{q.state=b,q.outcome=rt;for(var lt=-1,kt=q.queue.length;++lt<kt;)q.queue[lt].callFulfilled(rt)}return q},d.reject=function(q,rt){q.state=h,q.outcome=rt;for(var Q=-1,tt=q.queue.length;++Q<tt;)q.queue[Q].callRejected(rt);return q};function A(q){var rt=q&&q.then;if(q&&(typeof q=="object"||typeof q=="function")&&typeof rt=="function")return function(){rt.apply(q,arguments)}}function B(q,rt){var Q=!1;function tt(jt){Q||(Q=!0,d.reject(q,jt))}function lt(jt){Q||(Q=!0,d.resolve(q,jt))}function kt(){rt(lt,tt)}var At=G(kt);At.status==="error"&&tt(At.value)}function G(q,rt){var Q={};try{Q.value=q(rt),Q.status="success"}catch(tt){Q.status="error",Q.value=tt}return Q}w.resolve=j;function j(q){return q instanceof this?q:d.resolve(new this(p),q)}w.reject=X;function X(q){var rt=new this(p);return d.reject(rt,q)}w.all=_t;function _t(q){var rt=this;if(Object.prototype.toString.call(q)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Q=q.length,tt=!1;if(!Q)return this.resolve([]);for(var lt=new Array(Q),kt=0,At=-1,jt=new this(p);++At<Q;)Wt(q[At],At);return jt;function Wt(ft,Gt){rt.resolve(ft).then(st,function(et){tt||(tt=!0,d.reject(jt,et))});function st(et){lt[Gt]=et,++kt===Q&&!tt&&(tt=!0,d.resolve(jt,lt))}}}w.race=Dt;function Dt(q){var rt=this;if(Object.prototype.toString.call(q)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Q=q.length,tt=!1;if(!Q)return this.resolve([]);for(var lt=-1,kt=new this(p);++lt<Q;)At(q[lt]);return kt;function At(jt){rt.resolve(jt).then(function(Wt){tt||(tt=!0,d.resolve(kt,Wt))},function(Wt){tt||(tt=!0,d.reject(kt,Wt))})}}},{1:1}],3:[function(s,o,c){(function(l){"use strict";typeof l.Promise!="function"&&(l.Promise=s(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(s,o,c){"use strict";var l=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(g){return typeof g}:function(g){return g&&typeof Symbol=="function"&&g.constructor===Symbol&&g!==Symbol.prototype?"symbol":typeof g};function p(g,m){if(!(g instanceof m))throw new TypeError("Cannot call a class as a function")}function d(){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 h=d();function b(){try{if(!h||!h.open)return!1;var g=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),m=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!g||m)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function v(g,m){g=g||[],m=m||{};try{return new Blob(g,m)}catch(C){if(C.name!=="TypeError")throw C;for(var y=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,I=new y,S=0;S<g.length;S+=1)I.append(g[S]);return I.getBlob(m.type)}}typeof Promise>"u"&&s(3);var w=Promise;function _(g,m){m&&g.then(function(y){m(null,y)},function(y){m(y)})}function k(g,m,y){typeof m=="function"&&g.then(m),typeof y=="function"&&g.catch(y)}function A(g){return typeof g!="string"&&(console.warn(g+" used as a key, but it is not a string."),g=String(g)),g}function B(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var G="local-forage-detect-blob-support",j=void 0,X={},_t=Object.prototype.toString,Dt="readonly",q="readwrite";function rt(g){for(var m=g.length,y=new ArrayBuffer(m),I=new Uint8Array(y),S=0;S<m;S++)I[S]=g.charCodeAt(S);return y}function Q(g){return new w(function(m){var y=g.transaction(G,q),I=v([""]);y.objectStore(G).put(I,"key"),y.onabort=function(S){S.preventDefault(),S.stopPropagation(),m(!1)},y.oncomplete=function(){var S=navigator.userAgent.match(/Chrome\/(\d+)/),C=navigator.userAgent.match(/Edge\//);m(C||!S||parseInt(S[1],10)>=43)}}).catch(function(){return!1})}function tt(g){return typeof j=="boolean"?w.resolve(j):Q(g).then(function(m){return j=m,j})}function lt(g){var m=X[g.name],y={};y.promise=new w(function(I,S){y.resolve=I,y.reject=S}),m.deferredOperations.push(y),m.dbReady?m.dbReady=m.dbReady.then(function(){return y.promise}):m.dbReady=y.promise}function kt(g){var m=X[g.name],y=m.deferredOperations.pop();if(y)return y.resolve(),y.promise}function At(g,m){var y=X[g.name],I=y.deferredOperations.pop();if(I)return I.reject(m),I.promise}function jt(g,m){return new w(function(y,I){if(X[g.name]=X[g.name]||ui(),g.db)if(m)lt(g),g.db.close();else return y(g.db);var S=[g.name];m&&S.push(g.version);var C=h.open.apply(h,S);m&&(C.onupgradeneeded=function(O){var $=C.result;try{$.createObjectStore(g.storeName),O.oldVersion<=1&&$.createObjectStore(G)}catch(W){if(W.name==="ConstraintError")console.warn('The database "'+g.name+'" has been upgraded from version '+O.oldVersion+" to version "+O.newVersion+', but the storage "'+g.storeName+'" already exists.');else throw W}}),C.onerror=function(O){O.preventDefault(),I(C.error)},C.onsuccess=function(){var O=C.result;O.onversionchange=function($){$.target.close()},y(O),kt(g)}})}function Wt(g){return jt(g,!1)}function ft(g){return jt(g,!0)}function Gt(g,m){if(!g.db)return!0;var y=!g.db.objectStoreNames.contains(g.storeName),I=g.version<g.db.version,S=g.version>g.db.version;if(I&&(g.version!==m&&console.warn('The database "'+g.name+`" can't be downgraded from version `+g.db.version+" to version "+g.version+"."),g.version=g.db.version),S||y){if(y){var C=g.db.version+1;C>g.version&&(g.version=C)}return!0}return!1}function st(g){return new w(function(m,y){var I=new FileReader;I.onerror=y,I.onloadend=function(S){var C=btoa(S.target.result||"");m({__local_forage_encoded_blob:!0,data:C,type:g.type})},I.readAsBinaryString(g)})}function et(g){var m=rt(atob(g.data));return v([m],{type:g.type})}function $t(g){return g&&g.__local_forage_encoded_blob}function ci(g){var m=this,y=m._initReady().then(function(){var I=X[m._dbInfo.name];if(I&&I.dbReady)return I.dbReady});return k(y,g,g),y}function li(g){lt(g);for(var m=X[g.name],y=m.forages,I=0;I<y.length;I++){var S=y[I];S._dbInfo.db&&(S._dbInfo.db.close(),S._dbInfo.db=null)}return g.db=null,Wt(g).then(function(C){return g.db=C,Gt(g)?ft(g):C}).then(function(C){g.db=m.db=C;for(var O=0;O<y.length;O++)y[O]._dbInfo.db=C}).catch(function(C){throw At(g,C),C})}function oe(g,m,y,I){I===void 0&&(I=1);try{var S=g.db.transaction(g.storeName,m);y(null,S)}catch(C){if(I>0&&(!g.db||C.name==="InvalidStateError"||C.name==="NotFoundError"))return w.resolve().then(function(){if(!g.db||C.name==="NotFoundError"&&!g.db.objectStoreNames.contains(g.storeName)&&g.version<=g.db.version)return g.db&&(g.version=g.db.version+1),ft(g)}).then(function(){return li(g).then(function(){oe(g,m,y,I-1)})}).catch(y);y(C)}}function ui(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Es(g){var m=this,y={db:null};if(g)for(var I in g)y[I]=g[I];var S=X[y.name];S||(S=ui(),X[y.name]=S),S.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=ci);var C=[];function O(){return w.resolve()}for(var $=0;$<S.forages.length;$++){var W=S.forages[$];W!==m&&C.push(W._initReady().catch(O))}var V=S.forages.slice(0);return w.all(C).then(function(){return y.db=S.db,Wt(y)}).then(function(F){return y.db=F,Gt(y,m._defaultConfig.version)?ft(y):F}).then(function(F){y.db=S.db=F,m._dbInfo=y;for(var J=0;J<V.length;J++){var it=V[J];it!==m&&(it._dbInfo.db=y.db,it._dbInfo.version=y.version)}})}function dn(g,m){var y=this;g=A(g);var I=new w(function(S,C){y.ready().then(function(){oe(y._dbInfo,Dt,function(O,$){if(O)return C(O);try{var W=$.objectStore(y._dbInfo.storeName),V=W.get(g);V.onsuccess=function(){var F=V.result;F===void 0&&(F=null),$t(F)&&(F=et(F)),S(F)},V.onerror=function(){C(V.error)}}catch(F){C(F)}})}).catch(C)});return _(I,m),I}function Ss(g,m){var y=this,I=new w(function(S,C){y.ready().then(function(){oe(y._dbInfo,Dt,function(O,$){if(O)return C(O);try{var W=$.objectStore(y._dbInfo.storeName),V=W.openCursor(),F=1;V.onsuccess=function(){var J=V.result;if(J){var it=J.value;$t(it)&&(it=et(it));var vt=g(it,J.key,F++);vt!==void 0?S(vt):J.continue()}else S()},V.onerror=function(){C(V.error)}}catch(J){C(J)}})}).catch(C)});return _(I,m),I}function Is(g,m,y){var I=this;g=A(g);var S=new w(function(C,O){var $;I.ready().then(function(){return $=I._dbInfo,_t.call(m)==="[object Blob]"?tt($.db).then(function(W){return W?m:st(m)}):m}).then(function(W){oe(I._dbInfo,q,function(V,F){if(V)return O(V);try{var J=F.objectStore(I._dbInfo.storeName);W===null&&(W=void 0);var it=J.put(W,g);F.oncomplete=function(){W===void 0&&(W=null),C(W)},F.onabort=F.onerror=function(){var vt=it.error?it.error:it.transaction.error;O(vt)}}catch(vt){O(vt)}})}).catch(O)});return _(S,y),S}function hi(g,m){var y=this;g=A(g);var I=new w(function(S,C){y.ready().then(function(){oe(y._dbInfo,q,function(O,$){if(O)return C(O);try{var W=$.objectStore(y._dbInfo.storeName),V=W.delete(g);$.oncomplete=function(){S()},$.onerror=function(){C(V.error)},$.onabort=function(){var F=V.error?V.error:V.transaction.error;C(F)}}catch(F){C(F)}})}).catch(C)});return _(I,m),I}function Lr(g){var m=this,y=new w(function(I,S){m.ready().then(function(){oe(m._dbInfo,q,function(C,O){if(C)return S(C);try{var $=O.objectStore(m._dbInfo.storeName),W=$.clear();O.oncomplete=function(){I()},O.onabort=O.onerror=function(){var V=W.error?W.error:W.transaction.error;S(V)}}catch(V){S(V)}})}).catch(S)});return _(y,g),y}function ae(g){var m=this,y=new w(function(I,S){m.ready().then(function(){oe(m._dbInfo,Dt,function(C,O){if(C)return S(C);try{var $=O.objectStore(m._dbInfo.storeName),W=$.count();W.onsuccess=function(){I(W.result)},W.onerror=function(){S(W.error)}}catch(V){S(V)}})}).catch(S)});return _(y,g),y}function fn(g,m){var y=this,I=new w(function(S,C){if(g<0){S(null);return}y.ready().then(function(){oe(y._dbInfo,Dt,function(O,$){if(O)return C(O);try{var W=$.objectStore(y._dbInfo.storeName),V=!1,F=W.openKeyCursor();F.onsuccess=function(){var J=F.result;if(!J){S(null);return}g===0||V?S(J.key):(V=!0,J.advance(g))},F.onerror=function(){C(F.error)}}catch(J){C(J)}})}).catch(C)});return _(I,m),I}function Cs(g){var m=this,y=new w(function(I,S){m.ready().then(function(){oe(m._dbInfo,Dt,function(C,O){if(C)return S(C);try{var $=O.objectStore(m._dbInfo.storeName),W=$.openKeyCursor(),V=[];W.onsuccess=function(){var F=W.result;if(!F){I(V);return}V.push(F.key),F.continue()},W.onerror=function(){S(W.error)}}catch(F){S(F)}})}).catch(S)});return _(y,g),y}function a(g,m){m=B.apply(this,arguments);var y=this.config();g=typeof g!="function"&&g||{},g.name||(g.name=g.name||y.name,g.storeName=g.storeName||y.storeName);var I=this,S;if(!g.name)S=w.reject("Invalid arguments");else{var C=g.name===y.name&&I._dbInfo.db,O=C?w.resolve(I._dbInfo.db):Wt(g).then(function($){var W=X[g.name],V=W.forages;W.db=$;for(var F=0;F<V.length;F++)V[F]._dbInfo.db=$;return $});g.storeName?S=O.then(function($){if($.objectStoreNames.contains(g.storeName)){var W=$.version+1;lt(g);var V=X[g.name],F=V.forages;$.close();for(var J=0;J<F.length;J++){var it=F[J];it._dbInfo.db=null,it._dbInfo.version=W}var vt=new w(function(pt,Pt){var It=h.open(g.name,W);It.onerror=function(ce){var Ns=It.result;Ns.close(),Pt(ce)},It.onupgradeneeded=function(){var ce=It.result;ce.deleteObjectStore(g.storeName)},It.onsuccess=function(){var ce=It.result;ce.close(),pt(ce)}});return vt.then(function(pt){V.db=pt;for(var Pt=0;Pt<F.length;Pt++){var It=F[Pt];It._dbInfo.db=pt,kt(It._dbInfo)}}).catch(function(pt){throw(At(g,pt)||w.resolve()).catch(function(){}),pt})}}):S=O.then(function($){lt(g);var W=X[g.name],V=W.forages;$.close();for(var F=0;F<V.length;F++){var J=V[F];J._dbInfo.db=null}var it=new w(function(vt,pt){var Pt=h.deleteDatabase(g.name);Pt.onerror=function(){var It=Pt.result;It&&It.close(),pt(Pt.error)},Pt.onblocked=function(){console.warn('dropInstance blocked for database "'+g.name+'" until all open connections are closed')},Pt.onsuccess=function(){var It=Pt.result;It&&It.close(),vt(It)}});return it.then(function(vt){W.db=vt;for(var pt=0;pt<V.length;pt++){var Pt=V[pt];kt(Pt._dbInfo)}}).catch(function(vt){throw(At(g,vt)||w.resolve()).catch(function(){}),vt})})}return _(S,m),S}var u={_driver:"asyncStorage",_initStorage:Es,_support:b(),iterate:Ss,getItem:dn,setItem:Is,removeItem:hi,clear:Lr,length:ae,key:fn,keys:Cs,dropInstance:a};function f(){return typeof openDatabase=="function"}var E="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",D="~~local_forage_type~",M=/^~~local_forage_type~([^~]+)~/,Y="__lfsc__:",ut=Y.length,Nt="arbf",gt="blob",St="si08",Ut="ui08",hr="uic8",gn="si16",mn="si32",lc="ur16",uc="ui32",hc="fl32",pc="fl64",dc=ut+Nt.length,fc=Object.prototype.toString;function gc(g){var m=g.length*.75,y=g.length,I,S=0,C,O,$,W;g[g.length-1]==="="&&(m--,g[g.length-2]==="="&&m--);var V=new ArrayBuffer(m),F=new Uint8Array(V);for(I=0;I<y;I+=4)C=E.indexOf(g[I]),O=E.indexOf(g[I+1]),$=E.indexOf(g[I+2]),W=E.indexOf(g[I+3]),F[S++]=C<<2|O>>4,F[S++]=(O&15)<<4|$>>2,F[S++]=($&3)<<6|W&63;return V}function Ts(g){var m=new Uint8Array(g),y="",I;for(I=0;I<m.length;I+=3)y+=E[m[I]>>2],y+=E[(m[I]&3)<<4|m[I+1]>>4],y+=E[(m[I+1]&15)<<2|m[I+2]>>6],y+=E[m[I+2]&63];return m.length%3===2?y=y.substring(0,y.length-1)+"=":m.length%3===1&&(y=y.substring(0,y.length-2)+"=="),y}function Rp(g,m){var y="";if(g&&(y=fc.call(g)),g&&(y==="[object ArrayBuffer]"||g.buffer&&fc.call(g.buffer)==="[object ArrayBuffer]")){var I,S=Y;g instanceof ArrayBuffer?(I=g,S+=Nt):(I=g.buffer,y==="[object Int8Array]"?S+=St:y==="[object Uint8Array]"?S+=Ut:y==="[object Uint8ClampedArray]"?S+=hr:y==="[object Int16Array]"?S+=gn:y==="[object Uint16Array]"?S+=lc:y==="[object Int32Array]"?S+=mn:y==="[object Uint32Array]"?S+=uc:y==="[object Float32Array]"?S+=hc:y==="[object Float64Array]"?S+=pc:m(new Error("Failed to get type for BinaryArray"))),m(S+Ts(I))}else if(y==="[object Blob]"){var C=new FileReader;C.onload=function(){var O=D+g.type+"~"+Ts(this.result);m(Y+gt+O)},C.readAsArrayBuffer(g)}else try{m(JSON.stringify(g))}catch(O){console.error("Couldn't convert value into a JSON string: ",g),m(null,O)}}function Lp(g){if(g.substring(0,ut)!==Y)return JSON.parse(g);var m=g.substring(dc),y=g.substring(ut,dc),I;if(y===gt&&M.test(m)){var S=m.match(M);I=S[1],m=m.substring(S[0].length)}var C=gc(m);switch(y){case Nt:return C;case gt:return v([C],{type:I});case St:return new Int8Array(C);case Ut:return new Uint8Array(C);case hr:return new Uint8ClampedArray(C);case gn:return new Int16Array(C);case lc:return new Uint16Array(C);case mn:return new Int32Array(C);case uc:return new Uint32Array(C);case hc:return new Float32Array(C);case pc:return new Float64Array(C);default:throw new Error("Unkown type: "+y)}}var xs={serialize:Rp,deserialize:Lp,stringToBuffer:gc,bufferToString:Ts};function mc(g,m,y,I){g.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],y,I)}function Mp(g){var m=this,y={db:null};if(g)for(var I in g)y[I]=typeof g[I]!="string"?g[I].toString():g[I];var S=new w(function(C,O){try{y.db=openDatabase(y.name,String(y.version),y.description,y.size)}catch($){return O($)}y.db.transaction(function($){mc($,y,function(){m._dbInfo=y,C()},function(W,V){O(V)})},O)});return y.serializer=xs,S}function Je(g,m,y,I,S,C){g.executeSql(y,I,S,function(O,$){$.code===$.SYNTAX_ERR?O.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(W,V){V.rows.length?C(W,$):mc(W,m,function(){W.executeSql(y,I,S,C)},C)},C):C(O,$)},C)}function Up(g,m){var y=this;g=A(g);var I=new w(function(S,C){y.ready().then(function(){var O=y._dbInfo;O.db.transaction(function($){Je($,O,"SELECT * FROM "+O.storeName+" WHERE key = ? LIMIT 1",[g],function(W,V){var F=V.rows.length?V.rows.item(0).value:null;F&&(F=O.serializer.deserialize(F)),S(F)},function(W,V){C(V)})})}).catch(C)});return _(I,m),I}function Bp(g,m){var y=this,I=new w(function(S,C){y.ready().then(function(){var O=y._dbInfo;O.db.transaction(function($){Je($,O,"SELECT * FROM "+O.storeName,[],function(W,V){for(var F=V.rows,J=F.length,it=0;it<J;it++){var vt=F.item(it),pt=vt.value;if(pt&&(pt=O.serializer.deserialize(pt)),pt=g(pt,vt.key,it+1),pt!==void 0){S(pt);return}}S()},function(W,V){C(V)})})}).catch(C)});return _(I,m),I}function yc(g,m,y,I){var S=this;g=A(g);var C=new w(function(O,$){S.ready().then(function(){m===void 0&&(m=null);var W=m,V=S._dbInfo;V.serializer.serialize(m,function(F,J){J?$(J):V.db.transaction(function(it){Je(it,V,"INSERT OR REPLACE INTO "+V.storeName+" (key, value) VALUES (?, ?)",[g,F],function(){O(W)},function(vt,pt){$(pt)})},function(it){if(it.code===it.QUOTA_ERR){if(I>0){O(yc.apply(S,[g,W,y,I-1]));return}$(it)}})})}).catch($)});return _(C,y),C}function jp(g,m,y){return yc.apply(this,[g,m,y,1])}function $p(g,m){var y=this;g=A(g);var I=new w(function(S,C){y.ready().then(function(){var O=y._dbInfo;O.db.transaction(function($){Je($,O,"DELETE FROM "+O.storeName+" WHERE key = ?",[g],function(){S()},function(W,V){C(V)})})}).catch(C)});return _(I,m),I}function Fp(g){var m=this,y=new w(function(I,S){m.ready().then(function(){var C=m._dbInfo;C.db.transaction(function(O){Je(O,C,"DELETE FROM "+C.storeName,[],function(){I()},function($,W){S(W)})})}).catch(S)});return _(y,g),y}function Hp(g){var m=this,y=new w(function(I,S){m.ready().then(function(){var C=m._dbInfo;C.db.transaction(function(O){Je(O,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function($,W){var V=W.rows.item(0).c;I(V)},function($,W){S(W)})})}).catch(S)});return _(y,g),y}function Vp(g,m){var y=this,I=new w(function(S,C){y.ready().then(function(){var O=y._dbInfo;O.db.transaction(function($){Je($,O,"SELECT key FROM "+O.storeName+" WHERE id = ? LIMIT 1",[g+1],function(W,V){var F=V.rows.length?V.rows.item(0).key:null;S(F)},function(W,V){C(V)})})}).catch(C)});return _(I,m),I}function qp(g){var m=this,y=new w(function(I,S){m.ready().then(function(){var C=m._dbInfo;C.db.transaction(function(O){Je(O,C,"SELECT key FROM "+C.storeName,[],function($,W){for(var V=[],F=0;F<W.rows.length;F++)V.push(W.rows.item(F).key);I(V)},function($,W){S(W)})})}).catch(S)});return _(y,g),y}function Wp(g){return new w(function(m,y){g.transaction(function(I){I.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(S,C){for(var O=[],$=0;$<C.rows.length;$++)O.push(C.rows.item($).name);m({db:g,storeNames:O})},function(S,C){y(C)})},function(I){y(I)})})}function Gp(g,m){m=B.apply(this,arguments);var y=this.config();g=typeof g!="function"&&g||{},g.name||(g.name=g.name||y.name,g.storeName=g.storeName||y.storeName);var I=this,S;return g.name?S=new w(function(C){var O;g.name===y.name?O=I._dbInfo.db:O=openDatabase(g.name,"","",0),g.storeName?C({db:O,storeNames:[g.storeName]}):C(Wp(O))}).then(function(C){return new w(function(O,$){C.db.transaction(function(W){function V(vt){return new w(function(pt,Pt){W.executeSql("DROP TABLE IF EXISTS "+vt,[],function(){pt()},function(It,ce){Pt(ce)})})}for(var F=[],J=0,it=C.storeNames.length;J<it;J++)F.push(V(C.storeNames[J]));w.all(F).then(function(){O()}).catch(function(vt){$(vt)})},function(W){$(W)})})}):S=w.reject("Invalid arguments"),_(S,m),S}var zp={_driver:"webSQLStorage",_initStorage:Mp,_support:f(),iterate:Bp,getItem:Up,setItem:jp,removeItem:$p,clear:Fp,length:Hp,key:Vp,keys:qp,dropInstance:Gp};function Yp(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function vc(g,m){var y=g.name+"/";return g.storeName!==m.storeName&&(y+=g.storeName+"/"),y}function Kp(){var g="_localforage_support_test";try{return localStorage.setItem(g,!0),localStorage.removeItem(g),!1}catch{return!0}}function Jp(){return!Kp()||localStorage.length>0}function Xp(g){var m=this,y={};if(g)for(var I in g)y[I]=g[I];return y.keyPrefix=vc(g,m._defaultConfig),Jp()?(m._dbInfo=y,y.serializer=xs,w.resolve()):w.reject()}function Qp(g){var m=this,y=m.ready().then(function(){for(var I=m._dbInfo.keyPrefix,S=localStorage.length-1;S>=0;S--){var C=localStorage.key(S);C.indexOf(I)===0&&localStorage.removeItem(C)}});return _(y,g),y}function Zp(g,m){var y=this;g=A(g);var I=y.ready().then(function(){var S=y._dbInfo,C=localStorage.getItem(S.keyPrefix+g);return C&&(C=S.serializer.deserialize(C)),C});return _(I,m),I}function td(g,m){var y=this,I=y.ready().then(function(){for(var S=y._dbInfo,C=S.keyPrefix,O=C.length,$=localStorage.length,W=1,V=0;V<$;V++){var F=localStorage.key(V);if(F.indexOf(C)===0){var J=localStorage.getItem(F);if(J&&(J=S.serializer.deserialize(J)),J=g(J,F.substring(O),W++),J!==void 0)return J}}});return _(I,m),I}function ed(g,m){var y=this,I=y.ready().then(function(){var S=y._dbInfo,C;try{C=localStorage.key(g)}catch{C=null}return C&&(C=C.substring(S.keyPrefix.length)),C});return _(I,m),I}function rd(g){var m=this,y=m.ready().then(function(){for(var I=m._dbInfo,S=localStorage.length,C=[],O=0;O<S;O++){var $=localStorage.key(O);$.indexOf(I.keyPrefix)===0&&C.push($.substring(I.keyPrefix.length))}return C});return _(y,g),y}function nd(g){var m=this,y=m.keys().then(function(I){return I.length});return _(y,g),y}function id(g,m){var y=this;g=A(g);var I=y.ready().then(function(){var S=y._dbInfo;localStorage.removeItem(S.keyPrefix+g)});return _(I,m),I}function sd(g,m,y){var I=this;g=A(g);var S=I.ready().then(function(){m===void 0&&(m=null);var C=m;return new w(function(O,$){var W=I._dbInfo;W.serializer.serialize(m,function(V,F){if(F)$(F);else try{localStorage.setItem(W.keyPrefix+g,V),O(C)}catch(J){(J.name==="QuotaExceededError"||J.name==="NS_ERROR_DOM_QUOTA_REACHED")&&$(J),$(J)}})})});return _(S,y),S}function od(g,m){if(m=B.apply(this,arguments),g=typeof g!="function"&&g||{},!g.name){var y=this.config();g.name=g.name||y.name,g.storeName=g.storeName||y.storeName}var I=this,S;return g.name?S=new w(function(C){g.storeName?C(vc(g,I._defaultConfig)):C(g.name+"/")}).then(function(C){for(var O=localStorage.length-1;O>=0;O--){var $=localStorage.key(O);$.indexOf(C)===0&&localStorage.removeItem($)}}):S=w.reject("Invalid arguments"),_(S,m),S}var ad={_driver:"localStorageWrapper",_initStorage:Xp,_support:Yp(),iterate:td,getItem:Zp,setItem:sd,removeItem:id,clear:Qp,length:nd,key:ed,keys:rd,dropInstance:od},cd=function(g,m){return g===m||typeof g=="number"&&typeof m=="number"&&isNaN(g)&&isNaN(m)},ld=function(g,m){for(var y=g.length,I=0;I<y;){if(cd(g[I],m))return!0;I++}return!1},wc=Array.isArray||function(g){return Object.prototype.toString.call(g)==="[object Array]"},yn={},bc={},Mr={INDEXEDDB:u,WEBSQL:zp,LOCALSTORAGE:ad},ud=[Mr.INDEXEDDB._driver,Mr.WEBSQL._driver,Mr.LOCALSTORAGE._driver],pi=["dropInstance"],Ds=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pi),hd={description:"",driver:ud.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function pd(g,m){g[m]=function(){var y=arguments;return g.ready().then(function(){return g[m].apply(g,y)})}}function As(){for(var g=1;g<arguments.length;g++){var m=arguments[g];if(m)for(var y in m)m.hasOwnProperty(y)&&(wc(m[y])?arguments[0][y]=m[y].slice():arguments[0][y]=m[y])}return arguments[0]}var dd=function(){function g(m){p(this,g);for(var y in Mr)if(Mr.hasOwnProperty(y)){var I=Mr[y],S=I._driver;this[y]=S,yn[S]||this.defineDriver(I)}this._defaultConfig=As({},hd),this._config=As({},this._defaultConfig,m),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return g.prototype.config=function(m){if((typeof m>"u"?"undefined":l(m))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var y in m){if(y==="storeName"&&(m[y]=m[y].replace(/\W/g,"_")),y==="version"&&typeof m[y]!="number")return new Error("Database version must be a number.");this._config[y]=m[y]}return"driver"in m&&m.driver?this.setDriver(this._config.driver):!0}else return typeof m=="string"?this._config[m]:this._config},g.prototype.defineDriver=function(m,y,I){var S=new w(function(C,O){try{var $=m._driver,W=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!m._driver){O(W);return}for(var V=Ds.concat("_initStorage"),F=0,J=V.length;F<J;F++){var it=V[F],vt=!ld(pi,it);if((vt||m[it])&&typeof m[it]!="function"){O(W);return}}var pt=function(){for(var It=function(gd){return function(){var md=new Error("Method "+gd+" is not implemented by the current driver"),_c=w.reject(md);return _(_c,arguments[arguments.length-1]),_c}},ce=0,Ns=pi.length;ce<Ns;ce++){var Os=pi[ce];m[Os]||(m[Os]=It(Os))}};pt();var Pt=function(It){yn[$]&&console.info("Redefining LocalForage driver: "+$),yn[$]=m,bc[$]=It,C()};"_support"in m?m._support&&typeof m._support=="function"?m._support().then(Pt,O):Pt(!!m._support):Pt(!0)}catch(It){O(It)}});return k(S,y,I),S},g.prototype.driver=function(){return this._driver||null},g.prototype.getDriver=function(m,y,I){var S=yn[m]?w.resolve(yn[m]):w.reject(new Error("Driver not found."));return k(S,y,I),S},g.prototype.getSerializer=function(m){var y=w.resolve(xs);return k(y,m),y},g.prototype.ready=function(m){var y=this,I=y._driverSet.then(function(){return y._ready===null&&(y._ready=y._initDriver()),y._ready});return k(I,m,m),I},g.prototype.setDriver=function(m,y,I){var S=this;wc(m)||(m=[m]);var C=this._getSupportedDrivers(m);function O(){S._config.driver=S.driver()}function $(F){return S._extend(F),O(),S._ready=S._initStorage(S._config),S._ready}function W(F){return function(){var J=0;function it(){for(;J<F.length;){var vt=F[J];return J++,S._dbInfo=null,S._ready=null,S.getDriver(vt).then($).catch(it)}O();var pt=new Error("No available storage method found.");return S._driverSet=w.reject(pt),S._driverSet}return it()}}var V=this._driverSet!==null?this._driverSet.catch(function(){return w.resolve()}):w.resolve();return this._driverSet=V.then(function(){var F=C[0];return S._dbInfo=null,S._ready=null,S.getDriver(F).then(function(J){S._driver=J._driver,O(),S._wrapLibraryMethodsWithReady(),S._initDriver=W(C)})}).catch(function(){O();var F=new Error("No available storage method found.");return S._driverSet=w.reject(F),S._driverSet}),k(this._driverSet,y,I),this._driverSet},g.prototype.supports=function(m){return!!bc[m]},g.prototype._extend=function(m){As(this,m)},g.prototype._getSupportedDrivers=function(m){for(var y=[],I=0,S=m.length;I<S;I++){var C=m[I];this.supports(C)&&y.push(C)}return y},g.prototype._wrapLibraryMethodsWithReady=function(){for(var m=0,y=Ds.length;m<y;m++)pd(this,Ds[m])},g.prototype.createInstance=function(m){return new g(m)},g}(),fd=new dd;o.exports=fd},{3:3}]},{},[4])(4)})}),fu=rs(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URLBuilder=void 0;var e=function(){function r(n){try{this.base=new URL(n),this.params=new URLSearchParams(this.base.search.slice(1))}catch(i){console.error("Un-parsable URL",i)}}return r.prototype.appendQueryParam=function(n,i){this.params.append(n,i?i.toString():"")},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(n){this.params.delete(n)},r.prototype.getBase=function(){return this.base},r.prototype.getPath=function(){return this.base.pathname},r.prototype.getHostname=function(){return this.base.hostname},r.prototype.getParams=function(){return this.params},r.prototype.getQueryParam=function(n){if(!this.params)return"";var i=this.params.get(n);return!i||i==="undefined"||i==="null"?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(n){return this.base.pathname=n,this},r.prototype.setQueryParam=function(n,i){return this.params.set(n,i?i.toString():""),this},r.prototype.setQueryString=function(n){if(n)return n[0]==="?"&&(n=n.slice(1)),this.params=new URLSearchParams(n),this},r.prototype.toString=function(){var n=this.params.toString();return n===""?this.base.search="":this.base.search="?"+n,this.base.toString()},r}();t.URLBuilder=e}),Pd=rs((t,e)=>{"use strict";(function(r,n){typeof t=="object"&&typeof e<"u"?e.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(t,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(l,p){var d=o.retries,h=o.retryDelay,b=o.retryOn;if(p&&p.retries!==void 0)if(n(p.retries))d=p.retries;else throw new i("retries must be a positive integer");if(p&&p.retryDelay!==void 0)if(n(p.retryDelay)||typeof p.retryDelay=="function")h=p.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(p&&p.retryOn)if(Array.isArray(p.retryOn)||typeof p.retryOn=="function")b=p.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(v,w){var _=function(A){var B=typeof Request<"u"&&l instanceof Request?l.clone():l;s(B,p).then(function(G){if(Array.isArray(b)&&b.indexOf(G.status)===-1)v(G);else if(typeof b=="function")try{return Promise.resolve(b(A,null,G)).then(function(j){j?k(A,null,G):v(G)}).catch(w)}catch(j){w(j)}else A<d?k(A,null,G):v(G)}).catch(function(G){if(typeof b=="function")try{Promise.resolve(b(A,G,null)).then(function(j){j?k(A,G,null):w(G)}).catch(function(j){w(j)})}catch(j){w(j)}else A<d?k(A,G,null):w(G)})};function k(A,B,G){var j=typeof h=="function"?h(A,B,G):h;setTimeout(function(){_(++A)},j)}_(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r})}),Rd="9.12.8",H=class co{static SDK_VERSION=Rd;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_EXPERIMENT_START="CE Experiment Start";static EVENT_VIDEO_DIALOG_CLOSED="CE Video Dialog Closed";static EVENT_VIDEO_DIALOG_OPENED="CE Video Dialog Opened";static EVENT_VIDEO_CHANGE="CE Video Changed";static EVENT_LAST_VIDEO_ENDED="CE Last Video Ended";static EVENT_VIDEO_MUTED="CE Video Muted";static EVENT_VIDEO_UNMUTED="CE Video Unmuted";static EVENT_ADD_TO_CART_CLICKED="CE Add To Cart Clicked";static EVENT_VIEW_ITEM_CLICKED="CE View Item Clicked";static EVENT_MORE_ITEM_INFO_CLICKED="CE More Item Info Clicked";static EVENT_OPEN_CART_CLICKED="CE Open Cart Clicked";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_OPEN_CART="Open Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static CTA_AFTER_REFRESH_UI="letscooee:outbound:refresh-ui";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static PAYMENT_MODAL_DETAILS=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}];static{let e=co.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");co.SDK_VERSION_CODE=parseInt(e,10)}},qe={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${H.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${H.SDK_VERSION}/dist/widget.min.js`},he=ke(sn()),T=class{static log(...t){he.default.info(...t)}static debug(...t){he.default.debug(...t)}static error(...t){he.default.error(...t)}static warn(...t){he.default.warn(...t)}static info(...t){he.default.info(...t)}static trace(...t){he.default.trace(...t)}};function Ld(t=H.LOG_PREFIX){he.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${H.SDK_VERSION}):`)}});let e=gu();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?he.default.setLevel(he.default[localStorage.cooeeLogLevel]):he.default.setLevel(qe.debug?he.default.TRACE:he.default.OFF)}function gu(){return new URL(location.href).searchParams?.get("cooee-debug")}function Md(){let t=`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
font-size: 14px;
|
|
4
4
|
background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
|
|
@@ -28,7 +28,7 @@ Event: ${Qe(t)}`),!0):_m(t,e.denyUrls)?(Ct&&nt.warn(`Event dropped due to being
|
|
|
28
28
|
Event: ${Qe(t)}.
|
|
29
29
|
Url: ${Fi(t)}`),!0):Em(t,e.allowUrls)?!1:(Ct&&nt.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
30
30
|
Event: ${Qe(t)}.
|
|
31
|
-
Url: ${Fi(t)}`),!0)}function wm(t,e){return t.type||!e||!e.length?!1:Sm(t).some(r=>ss(r,e))}function bm(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?ss(r,e):!1}function _m(t,e){if(!e||!e.length)return!1;let r=Fi(t);return r?ss(r,e):!1}function Em(t,e){if(!e||!e.length)return!0;let r=Fi(t);return r?ss(r,e):!0}function Sm(t){let e=[];t.message&&e.push(t.message);let r;try{r=t.exception.values[t.exception.values.length-1]}catch{}return r&&r.value&&(e.push(r.value),r.type&&e.push(`${r.type}: ${r.value}`)),e}function Im(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Cm(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 Fi(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Cm(e):null}catch{return Ct&&nt.error(`Cannot extract url for event ${Qe(t)}`),null}}function Tm(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}var xm="Dedupe",Dm=()=>{let t;return{name:xm,processEvent(e){if(e.type)return e;try{if(Nm(e,t))return Ct&&nt.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Am=Dm;function Nm(t,e){return e?!!(Om(t,e)||km(t,e)):!1}function Om(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Wu(t,e)||!qu(t,e))}function km(t,e){let r=el(e),n=el(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Wu(t,e)||!qu(t,e))}function qu(t,e){let r=Rc(t),n=Rc(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){let s=n[i],o=r[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function Wu(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 el(t){return t.exception&&t.exception.values&&t.exception.values[0]}var Ft=ht,Io=0;function Gu(){return Io>0}function Pm(){Io++,setTimeout(()=>{Io--})}function Xr(t,e={},r){if(typeof t!="function")return t;try{let i=t.__sentry_wrapped__;if(i)return i;if(pa(t))return t}catch{return t}let n=function(){let i=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let s=i.map(o=>Xr(o,e));return t.apply(this,s)}catch(s){throw Pm(),dg(o=>{o.addEventProcessor(c=>(e.mechanism&&(yo(c,void 0,void 0),Hn(c,e.mechanism)),c.extra=yt(x({},c.extra),{arguments:i}),c)),Jg(s)}),s}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch{}Nu(n,t),Ir(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}var Hr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function ma(t,e){let r=ya(t,e),n={type:e&&e.name,value:Bm(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function Rm(t,e,r,n){let i=ie(),s=i&&i.getOptions().normalizeDepth,o=Vm(e),c={__serialized__:Ru(e,s)};if(o)return{exception:{values:[ma(t,o)]},extra:c};let l={exception:{values:[{type:ns(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:Fm(e,{isUnhandledRejection:n})}]},extra:c};if(r){let p=ya(t,r);p.length&&(l.exception.values[0].stacktrace={frames:p})}return l}function Rs(t,e){return{exception:{values:[ma(t,e)]}}}function ya(t,e){let r=e.stacktrace||e.stack||"",n=Mm(e),i=Um(e);try{return t(r,n,i)}catch{}return[]}var Lm=/Minified React error #\d+;/i;function Mm(t){return t&&Lm.test(t.message)?1:0}function Um(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Bm(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function jm(t,e,r,n){let i=r&&r.syntheticException||void 0,s=va(t,e,i,n);return Hn(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),Tr(s)}function $m(t,e,r="info",n,i){let s=n&&n.syntheticException||void 0,o=Co(t,e,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Tr(o)}function va(t,e,r,n,i){let s;if(Tu(e)&&e.error)return Rs(t,e.error);if(Tc(e)||Jd(e)){let o=e;if("stack"in e)s=Rs(t,e);else{let c=o.name||(Tc(o)?"DOMError":"DOMException"),l=o.message?`${c}: ${o.message}`:c;s=Co(t,l,r,n),yo(s,l)}return"code"in o&&(s.tags=yt(x({},s.tags),{"DOMException.code":`${o.code}`})),s}return oa(e)?Rs(t,e):Kr(e)||ns(e)?(s=Rm(t,e,r,i),Hn(s,{synthetic:!0}),s):(s=Co(t,e,r,n),yo(s,`${e}`,void 0),Hn(s,{synthetic:!0}),s)}function Co(t,e,r,n){let i={};if(n&&r){let s=ya(t,r);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}if(aa(e)){let{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function Fm(t,{isUnhandledRejection:e}){let r=mf(t),n=e?"promise rejection":"exception";return Tu(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:ns(t)?`Event \`${Hm(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Hm(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Vm(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}function qm(t,{metadata:e,tunnel:r,dsn:n}){let i=x(x({event_id:t.event_id,sent_at:new Date().toISOString()},e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}}),!!r&&!!n&&{dsn:os(n)}),s=Wm(t);return ti(i,[s])}function Wm(t){return[{type:"user_report"},t]}var Gm=class extends nm{constructor(t){let e=x({parentSpanIsAlwaysRootSpan:!0},t),r=Ft.SENTRY_SDK_SOURCE||kf();cm(e,"browser",["browser"],r),super(e),e.sendClientReports&&Ft.document&&Ft.document.addEventListener("visibilitychange",()=>{Ft.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,e){return jm(this._options.stackParser,t,e,this._options.attachStacktrace)}eventFromMessage(t,e="info",r){return $m(this._options.stackParser,t,e,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){Hr&&nt.warn("SDK not enabled, will not capture user feedback.");return}let e=qm(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(e)}_prepareEvent(t,e,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,e,r)}_flushOutcomes(){let t=this._clearOutcomes();if(t.length===0){Hr&&nt.log("No outcomes to send");return}if(!this._dsn){Hr&&nt.log("No dsn provided, will not send outcomes");return}Hr&&nt.log("Sending outcomes:",t);let e=Qf(t,this._options.tunnel&&os(this._dsn));this.sendEnvelope(e)}},zm=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,zt=ht,Ym=1e3,rl,To,xo;function Km(t){let e="dom";Or(e,t),kr(e,Jm)}function Jm(){if(!zt.document)return;let t=be.bind(null,"dom"),e=nl(t,!0);zt.document.addEventListener("click",e,!1),zt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let n=zt[r]&&zt[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Ht(n,"addEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let l=this,p=l.__sentry_instrumentation_handlers__=l.__sentry_instrumentation_handlers__||{},d=p[s]=p[s]||{refCount:0};if(!d.handler){let h=nl(t);d.handler=h,i.call(this,s,h,c)}d.refCount++}catch{}return i.call(this,s,o,c)}}),Ht(n,"removeEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let l=this,p=l.__sentry_instrumentation_handlers__||{},d=p[s];d&&(d.refCount--,d.refCount<=0&&(i.call(this,s,d.handler,c),d.handler=void 0,delete p[s]),Object.keys(p).length===0&&delete l.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,c)}}))})}function Xm(t){if(t.type!==To)return!1;try{if(!t.target||t.target._sentryId!==xo)return!1}catch{}return!0}function Qm(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function nl(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=Zm(r);if(Qm(r.type,n))return;Ir(r,"_sentryCaptured",!0),n&&!n._sentryId&&Ir(n,"_sentryId",_e());let i=r.type==="keypress"?"input":r.type;Xm(r)||(t({event:r,name:i,global:e}),To=r.type,xo=n?n._sentryId:void 0),clearTimeout(rl),rl=zt.setTimeout(()=>{xo=void 0,To=void 0},Ym)}}function Zm(t){try{return t.target}catch{return null}}var wi;function ty(t){let e="history";Or(e,t),kr(e,ey)}function ey(){if(!ng())return;let t=zt.onpopstate;zt.onpopstate=function(...r){let n=zt.location.href,i=wi;if(wi=n,be("history",{from:i,to:n}),t)try{return t.apply(this,r)}catch{}};function e(r){return function(...n){let i=n.length>2?n[2]:void 0;if(i){let s=wi,o=String(i);wi=o,be("history",{from:s,to:o})}return r.apply(this,n)}}Ht(zt.history,"pushState",e),Ht(zt.history,"replaceState",e)}var ki={};function ry(t){let e=ki[t];if(e)return e;let r=zt[t];if(go(r))return ki[t]=r.bind(zt);let n=zt.document;if(n&&typeof n.createElement=="function")try{let i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);let s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch(i){zm&&nt.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return r&&(ki[t]=r.bind(zt))}function il(t){ki[t]=void 0}var On="__sentry_xhr_v3__";function ny(t){let e="xhr";Or(e,t),kr(e,iy)}function iy(){if(!zt.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;Ht(t,"open",function(e){return function(...r){let n=sr()*1e3,i=Fe(r[0])?r[0].toUpperCase():void 0,s=sy(r[1]);if(!i||!s)return e.apply(this,r);this[On]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let o=()=>{let c=this[On];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}let l={endTimestamp:sr()*1e3,startTimestamp:n,xhr:this};be("xhr",l)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Ht(this,"onreadystatechange",function(c){return function(...l){return o(),c.apply(this,l)}}):this.addEventListener("readystatechange",o),Ht(this,"setRequestHeader",function(c){return function(...l){let[p,d]=l,h=this[On];return h&&Fe(p)&&Fe(d)&&(h.request_headers[p.toLowerCase()]=d),c.apply(this,l)}}),e.apply(this,r)}}),Ht(t,"send",function(e){return function(...r){let n=this[On];if(!n)return e.apply(this,r);r[0]!==void 0&&(n.body=r[0]);let i={startTimestamp:sr()*1e3,xhr:this};return be("xhr",i),e.apply(this,r)}})}function sy(t){if(Fe(t))return t;try{return t.toString()}catch{}}function oy(t,e=ry("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let c=x({body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return il("fetch"),ji("No fetch implementation available");try{return e(t.url,c).then(l=>(r-=o,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 il("fetch"),r-=o,n--,ji(l)}}return am(t,i)}var ay=30,cy=50;function Do(t,e,r,n){let i={filename:t,function:e==="<anonymous>"?Cr:e,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var ly=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,uy=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,hy=/\((\S*)(?::(\d+))(?::(\d+))\)/,py=t=>{let e=ly.exec(t);if(e){let[,n,i,s]=e;return Do(n,Cr,+i,+s)}let r=uy.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=hy.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=zu(r[1]||Cr,r[2]);return Do(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},dy=[ay,py],fy=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,gy=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,my=t=>{let e=fy.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=gy.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],n=e[1]||Cr;return[n,r]=zu(n,r),Do(r,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},yy=[cy,my],vy=[dy,yy],wy=vf(...vy),zu=(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]:Cr,r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},bi=1024,by="Breadcrumbs",_y=(t={})=>{let e=x({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:by,setup(r){e.console&&bf(Cy(r)),e.dom&&Km(Iy(r,e.dom)),e.xhr&&ny(Ty(r)),e.fetch&&Cf(xy(r)),e.history&&ty(Dy(r)),e.sentry&&r.on("beforeSendEvent",Sy(r))}}},Ey=_y;function Sy(t){return function(e){ie()===t&&xr({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:Qe(e)},{event:e})}}function Iy(t,e){return function(r){if(ie()!==t)return;let n,i,s=typeof e=="object"?e.serializeAttribute:void 0,o=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;o&&o>bi&&(Hr&&nt.warn(`\`dom.maxStringLength\` cannot exceed ${bi}, but a value of ${o} was configured. Sentry will use ${bi} instead.`),o=bi),typeof s=="string"&&(s=[s]);try{let l=r.event,p=Ay(l)?l.target:l;n=Du(p,{keyAttrs:s,maxStringLength:o}),i=af(p)}catch{n="<unknown>"}if(n.length===0)return;let c={category:`ui.${r.name}`,message:n};i&&(c.data={"ui.component_name":i}),xr(c,{event:r.event,name:r.name,global:r.global})}}function Cy(t){return function(e){if(ie()!==t)return;let r={category:"console",data:{arguments:e.args,logger:"console"},level:Ff(e.level),message:xc(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)r.message=`Assertion failed: ${xc(e.args.slice(1)," ")||"console.assert"}`,r.data.arguments=e.args.slice(1);else return;xr(r,{input:e.args,level:e.level})}}function Ty(t){return function(e){if(ie()!==t)return;let{startTimestamp:r,endTimestamp:n}=e,i=e.xhr[On];if(!r||!n||!i)return;let{method:s,url:o,status_code:c,body:l}=i,p={method:s,url:o,status_code:c},d={xhr:e.xhr,input:l,startTimestamp:r,endTimestamp:n};xr({category:"xhr",data:p,type:"http"},d)}}function xy(t){return function(e){if(ie()!==t)return;let{startTimestamp:r,endTimestamp:n}=e;if(n&&!(e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"))if(e.error){let i=e.fetchData,s={data:e.error,input:e.args,startTimestamp:r,endTimestamp:n};xr({category:"fetch",data:i,level:"error",type:"http"},s)}else{let i=e.response,s=yt(x({},e.fetchData),{status_code:i&&i.status}),o={input:e.args,response:i,startTimestamp:r,endTimestamp:n};xr({category:"fetch",data:s,type:"http"},o)}}}function Dy(t){return function(e){if(ie()!==t)return;let r=e.from,n=e.to,i=Ps(Ft.location.href),s=r?Ps(r):void 0,o=Ps(n);(!s||!s.path)&&(s=i),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),xr({category:"navigation",data:{from:r,to:n}})}}function Ay(t){return!!t&&!!t.target}var Ny=["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"],Oy="BrowserApiErrors",ky=(t={})=>{let e=x({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t);return{name:Oy,setupOnce(){e.setTimeout&&Ht(Ft,"setTimeout",sl),e.setInterval&&Ht(Ft,"setInterval",sl),e.requestAnimationFrame&&Ht(Ft,"requestAnimationFrame",Ry),e.XMLHttpRequest&&"XMLHttpRequest"in Ft&&Ht(XMLHttpRequest.prototype,"send",Ly);let r=e.eventTarget;r&&(Array.isArray(r)?r:Ny).forEach(My)}}},Py=ky;function sl(t){return function(...e){let r=e[0];return e[0]=Xr(r,{mechanism:{data:{function:ar(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Ry(t){return function(e){return t.apply(this,[Xr(e,{mechanism:{data:{function:"requestAnimationFrame",handler:ar(t)},handled:!1,type:"instrument"}})])}}function Ly(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Ht(r,n,function(i){let s={mechanism:{data:{function:n,handler:ar(i)},handled:!1,type:"instrument"}},o=pa(i);return o&&(s.mechanism.data.handler=ar(o)),Xr(i,s)})}),t.apply(this,e)}}function My(t){let e=Ft,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ht(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Xr(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:ar(s),target:t},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,Xr(s,{mechanism:{data:{function:"addEventListener",handler:ar(s),target:t},handled:!1,type:"instrument"}}),o])}}),Ht(r,"removeEventListener",function(n){return function(i,s,o){let c=s;try{let l=c&&c.__sentry_wrapped__;l&&n.call(this,i,l,o)}catch{}return n.call(this,i,c,o)}}))}var Uy="GlobalHandlers",By=(t={})=>{let e=x({onerror:!0,onunhandledrejection:!0},t);return{name:Uy,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&($y(r),ol("onerror")),e.onunhandledrejection&&(Fy(r),ol("onunhandledrejection"))}}},jy=By;function $y(t){Df(e=>{let{stackParser:r,attachStacktrace:n}=Yu();if(ie()!==t||Gu())return;let{msg:i,url:s,line:o,column:c,error:l}=e,p=qy(va(r,l||i,void 0,n,!1),s,o,c);p.level="error",Fu(p,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}function Fy(t){Nf(e=>{let{stackParser:r,attachStacktrace:n}=Yu();if(ie()!==t||Gu())return;let i=Hy(e),s=ca(i)?Vy(i):va(r,i,void 0,n,!0);s.level="error",Fu(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function Hy(t){if(ca(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 Vy(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function qy(t,e,r,n){let i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},c=o.stacktrace=o.stacktrace||{},l=c.frames=c.frames||[],p=isNaN(parseInt(n,10))?void 0:n,d=isNaN(parseInt(r,10))?void 0:r,h=Fe(e)&&e.length>0?e:of();return l.length===0&&l.push({colno:p,filename:h,function:Cr,in_app:!0,lineno:d}),t}function ol(t){Hr&&nt.log(`Global Handler attached: ${t}`)}function Yu(){let t=ie();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var Wy=()=>({name:"HttpContext",preprocessEvent(t){if(!Ft.navigator&&!Ft.location&&!Ft.document)return;let e=t.request&&t.request.url||Ft.location&&Ft.location.href,{referrer:r}=Ft.document||{},{userAgent:n}=Ft.navigator||{},i=x(x(x({},t.request&&t.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=yt(x(x({},t.request),e&&{url:e}),{headers:i});t.request=s}}),Gy="cause",zy=5,Yy="LinkedErrors",Ky=(t={})=>{let e=t.limit||zy,r=t.key||Gy;return{name:Yy,preprocessEvent(n,i,s){let o=s.getOptions();ef(ma,o.stackParser,o.maxValueLength,r,e,n,i)}}},Jy=Ky;function Xy(t){return[mm(),pm(),Py(),Ey(),jy(),Jy(),Am(),Wy()]}var Kt=class Ku{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Ku),this.INSTANCE}captureError(e,r,n){T.error(`${r}:`,e);let i=this.getNewScope(n);i.setTag("operation",r),i.captureException(e)}captureMessage(e,r,n){this.getNewScope(n).captureMessage(e,r??"error")}setGlobalContext(e,r){this.contexts[e]=x({context:r},this.contexts[e])}setUser(e){this.user=e}setTags(e){this.tags=e}getNewScope(e){e??={};let{extra:r,tags:n}=e,i=new Ge;if(i.setClient(this.client),i.setUser(this.user),e.triggerContext&&!e.engagementTrigger&&(e.engagementTrigger=e.triggerContext.triggerData),e.engagementTrigger){let s=e.engagementTrigger;i.setTags({"engagement.id":s.engagementID,"engagement.short_id":s.shortID,"engagement.objective":s.objective,"engagement.delivery_type":s.onsiteDeliveryType,"engagement.content_id":s.contentID,"engagement.variation":s.variation,"engagement.currency":s.currency})}return r&&i.setExtras(r),this.tags&&i.setTags(this.tags),n&&i.setTags(n),Object.keys(this.contexts).forEach(s=>{i.setContext(s,this.contexts[s])}),i.setTag("language",navigator.language),i.setTag("timezone",ev()),this.addShopifyTags(i),i}addShopifyTags(e){window.Shopify&&(e.setTag("shopify.shop",window.Shopify.shop),e.setTag("shopify.currency",window.Shopify.currency?.active),e.setTag("shopify.locale",window.Shopify.locale),e.setTag("theme.schema_name",window.Shopify.theme?.schema_name),e.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}init(){let e=Xy({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new Gm({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:oy,stackParser:wy,integrations:e,environment:qe.mode,release:`web-sdk@${H.SDK_VERSION}`,debug:qe.debug}),this.client.init()}},ot=class{static ID="id";static SESSION_LANDING_PAGE="landing";static SESSION_LAST_USED_TIME="lastUsedTime";static SESSION_SYNCED="synced";static APP_CONFIG="conf";static DEVICE_ID="did";static SDK_TOKEN="token";static FIRST_SEEN="firstSeen";static SESSION_NUMBER="sessionNumber";static GA_CLIENT_ID="gacid";static CURRENT_CART="cart";static MUTED="muted"},al=ke(kd());function wa(t){return al.default.createInstance({name:"lc",storeName:t,driver:al.default.LOCALSTORAGE})}var ba=class{static storage;static async get(t,e){return await this.storage?.getItem(t)??e}static set(t,e){return this.storage?.setItem(t,e)}static remove(t){return this.storage?.removeItem(t)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}},te=class extends ba{static storeName="ses";static{this.storage=wa(this.storeName)}},Lt=class extends ba{static storeName="usr";static{this.storage=wa(this.storeName)}},Qy=class{static format(t,e){let r=/{{\s*(\w+)\s*}}/;return e.replace(r,(n,i)=>{switch(i){case"amount":return this.formatWithDelimiters(t,2);case"amount_no_decimals":return this.formatWithDelimiters(t,0);case"amount_with_comma_separator":return this.formatWithDelimiters(t,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(t,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(t,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(t,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(t,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(t,2," ",".");default:return n}})}static formatWithDelimiters(t,e=2,r=",",n="."){if(isNaN(t)||t==null)return"0";let i=(t/100).toFixed(e).split("."),s=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),o=i[1]?n+i[1]:"";return s+o}},Ot=class{isCartDirty=!0;cartEngagements;isGoKwikPopupOpen;previewIDs;previewVariant;pageName;moneyFormat;jsLoadTime=new Date;shopCurrencyCode;locale;activeExperiment;inInactive=!1;lastEnterActive=new Date;lastEnterInactive=null;currentItem;_currencyCode;get currencyCode(){return this._currencyCode}set currencyCode(t){this._currencyCode=t}static get(){return window.CooeeSDK.runtimeData}isInactive(){return this.inInactive}async setInactive(){return this.inInactive?0:(this.inInactive=!0,this.lastEnterInactive=new Date,Math.max((this.lastEnterInactive.getTime()-this.lastEnterActive.getTime())/1e3,0))}setActive(){return this.inInactive?(this.inInactive=!1,this.lastEnterActive=new Date,Math.max((this.lastEnterActive.getTime()-this.lastEnterInactive.getTime())/1e3,0)):0}isFirstActive(){return this.lastEnterInactive==null}getCurrentItem(){return this.currentItem}setCurrentItem(t){this.currentItem=new on(t)}};function Ju(t){try{return new URL(t)}catch{return}}function cl(t){return!t||t==="null"||t==="undefined"}function Zy(t,e){let r=t.indexOf(e);return r===-1?!1:(t.splice(r,1),!0)}function De(t,e){if(t==0&&e)return"Free";let r=Ot.get(),n=ne.get(),i=r.shopCurrencyCode||n.currency,s=r.currencyCode;s||T.warn("Currency code is not set in RuntimeData");let o=n.money?.format??r.moneyFormat,c;if(o&&i===s)c=Qy.format(t*100,o);else{let l;try{l=new Intl.NumberFormat(Xu(),{style:"currency",currency:s||i,minimumFractionDigits:0,maximumFractionDigits:2})}catch(p){return Kt.getInstance().captureError(p,"format-currency",{extra:{currentCurrency:s,shopCurrency:i}}),""}c=l.format(t),c=c.replace("\u20B9","Rs. "),n.money?.showCurrency&&s!=="INR"&&(c=c.concat(` ${s}`))}return c}function tv(t){return new Intl.NumberFormat(Xu(),{notation:"compact"}).format(t)}function Xu(){return navigator.languages!==void 0?navigator.languages[0].split("-")[0]:navigator.language??"en"}var _i;function ev(){if(_i)return _i;try{return _i=Intl.DateTimeFormat().resolvedOptions().timeZone,_i}catch{return""}}function _a(t){document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t)}function tr(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)},3e3)}async function Qu(t,e=10,r=document){let n=0,i=document.querySelectorAll("nonexistent-tag");for(;n<e;){let s=Math.min(100*2**n,5e3);if(await Jn.sleep(s),i=r.querySelectorAll(t),i.length)return T.debug(`Attempt ${n+1}: ${i.length} elements found with ${t}`),i;T.debug(`Attempt ${n+1}: Elements not found with ${t}. Retrying after ${s}ms.`),n++}return T.warn(`Max attempts reached. Element not found with ${t}.`),i}async function Hi(t,e=10,r=document){return(await Qu(t,e,r)).item(0)}function rv(t,e,r=document.body){let n=new MutationObserver(i=>{i.forEach(s=>{s.removedNodes.forEach(o=>{(o===t||o.contains(t))&&(e(),n.disconnect())})})});n.observe(r,{childList:!0})}async function Zu(){let t=await Lt.get(ot.DEVICE_ID),e=await te.get(ot.ID,"");return[{key:"letscooee_did",value:t},{key:"letscooee_sid",value:e},{key:"__letscooee_time",value:new Date().toLocaleString()},{key:"__letscooee_via",value:"Buy Now"}]}function kn(t,e,r){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!1,value:r})}var cs,dt,th,eh,mr,ll,rh,Ao,nh,Ea,No,Oo,nv,Vn={},ih=[],iv=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Sa=Array.isArray;function nr(t,e){for(var r in e)t[r]=e[r];return t}function Ia(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function sh(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?cs.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return Pi(t,o,n,i,null)}function Pi(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++th,__i:-1,__u:0};return i==null&&dt.vnode!=null&&dt.vnode(s),s}function cn(t){return t.children}function br(t,e){this.props=t,this.context=e}function Qr(t,e){if(e==null)return t.__?Qr(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"?Qr(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 ul(t){(!t.__d&&(t.__d=!0)&&mr.push(t)&&!Vi.__r++||ll!==dt.debounceRendering)&&((ll=dt.debounceRendering)||rh)(Vi)}function Vi(){var t,e,r,n,i,s,o,c;for(mr.sort(Ao);t=mr.shift();)t.__d&&(e=mr.length,n=void 0,s=(i=(r=t).__v).__e,o=[],c=[],r.__P&&((n=nr({},i)).__v=i.__v+1,dt.vnode&&dt.vnode(n),Ca(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,o,s??Qr(i),!!(32&i.__u),c),n.__v=i.__v,n.__.__k[n.__i]=n,lh(o,n,c),n.__e!=s&&oh(n)),mr.length>e&&mr.sort(Ao));Vi.__r=0}function ah(t,e,r,n,i,s,o,c,l,p,d){var h,b,v,w,_,k,A=n&&n.__k||ih,B=e.length;for(l=sv(r,e,A,l,B),h=0;h<B;h++)(v=r.__k[h])!=null&&(b=v.__i===-1?Vn:A[v.__i]||Vn,v.__i=h,k=Ca(t,v,b,i,s,o,c,l,p,d),w=v.__e,v.ref&&b.ref!=v.ref&&(b.ref&&Ta(b.ref,null,v),d.push(v.ref,v.__c||w,v)),_==null&&w!=null&&(_=w),4&v.__u||b.__k===v.__k?l=ch(v,l,t):typeof v.type=="function"&&k!==void 0?l=k:w&&(l=w.nextSibling),v.__u&=-7);return r.__e=_,l}function sv(t,e,r,n,i){var s,o,c,l,p,d=r.length,h=d,b=0;for(t.__k=new Array(i),s=0;s<i;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=s+b,(o=t.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Pi(null,o,null,null,null):Sa(o)?Pi(cn,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Pi(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,c=null,(p=o.__i=ov(o,r,l,h))!==-1&&(h--,(c=r[p])&&(c.__u|=2)),c==null||c.__v===null?(p==-1&&b--,typeof o.type!="function"&&(o.__u|=4)):p!=l&&(p==l-1?b--:p==l+1?b++:(p>l?b--:b++,o.__u|=4))):t.__k[s]=null;if(h)for(s=0;s<d;s++)(c=r[s])!=null&&(2&c.__u)==0&&(c.__e==n&&(n=Qr(c)),uh(c,c));return n}function ch(t,e,r){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=ch(n[i],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=Qr(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ov(t,e,r,n){var i,s,o=t.key,c=t.type,l=e[r];if(l===null||l&&o==l.key&&c===l.type&&(2&l.__u)==0)return r;if(n>(l!=null&&(2&l.__u)==0?1:0))for(i=r-1,s=r+1;i>=0||s<e.length;){if(i>=0){if((l=e[i])&&(2&l.__u)==0&&o==l.key&&c===l.type)return i;i--}if(s<e.length){if((l=e[s])&&(2&l.__u)==0&&o==l.key&&c===l.type)return s;s++}}return-1}function hl(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||iv.test(e)?r:r+"px"}function Ei(t,e,r,n,i){var s;t: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||hl(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||hl(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(nh,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?n?r.u=n.u:(r.u=Ea,t.addEventListener(e,s?Oo:No,s)):t.removeEventListener(e,s?Oo:No,s);else{if(i=="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 t}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function pl(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Ea++;else if(e.t<r.u)return;return r(dt.event?dt.event(e):e)}}}function Ca(t,e,r,n,i,s,o,c,l,p){var d,h,b,v,w,_,k,A,B,G,j,X,_t,Dt,q,rt,Q,tt=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),s=[c=e.__e=r.__e]),(d=dt.__b)&&d(e);t:if(typeof tt=="function")try{if(A=e.props,B="prototype"in tt&&tt.prototype.render,G=(d=tt.contextType)&&n[d.__c],j=d?G?G.props.value:d.__:n,r.__c?k=(h=e.__c=r.__c).__=h.__E:(B?e.__c=h=new tt(A,j):(e.__c=h=new br(A,j),h.constructor=tt,h.render=cv),G&&G.sub(h),h.props=A,h.state||(h.state={}),h.context=j,h.__n=n,b=h.__d=!0,h.__h=[],h._sb=[]),B&&h.__s==null&&(h.__s=h.state),B&&tt.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=nr({},h.__s)),nr(h.__s,tt.getDerivedStateFromProps(A,h.__s))),v=h.props,w=h.state,h.__v=e,b)B&&tt.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),B&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(B&&tt.getDerivedStateFromProps==null&&A!==v&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(A,j),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(A,h.__s,j)===!1||e.__v==r.__v)){for(e.__v!=r.__v&&(h.props=A,h.state=h.__s,h.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(lt){lt&&(lt.__=e)}),X=0;X<h._sb.length;X++)h.__h.push(h._sb[X]);h._sb=[],h.__h.length&&o.push(h);break t}h.componentWillUpdate!=null&&h.componentWillUpdate(A,h.__s,j),B&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(v,w,_)})}if(h.context=j,h.props=A,h.__P=t,h.__e=!1,_t=dt.__r,Dt=0,B){for(h.state=h.__s,h.__d=!1,_t&&_t(e),d=h.render(h.props,h.state,h.context),q=0;q<h._sb.length;q++)h.__h.push(h._sb[q]);h._sb=[]}else do h.__d=!1,_t&&_t(e),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++Dt<25);h.state=h.__s,h.getChildContext!=null&&(n=nr(nr({},n),h.getChildContext())),B&&!b&&h.getSnapshotBeforeUpdate!=null&&(_=h.getSnapshotBeforeUpdate(v,w)),c=ah(t,Sa(rt=d!=null&&d.type===cn&&d.key==null?d.props.children:d)?rt:[rt],e,r,n,i,s,o,c,l,p),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),k&&(h.__E=h.__=null)}catch(lt){if(e.__v=null,l||s!=null)if(lt.then){for(e.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,e.__e=c}else for(Q=s.length;Q--;)Ia(s[Q]);else e.__e=r.__e,e.__k=r.__k;dt.__e(lt,e,r)}else s==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):c=e.__e=av(r.__e,e,r,n,i,s,o,l,p);return(d=dt.diffed)&&d(e),128&e.__u?void 0:c}function lh(t,e,r){for(var n=0;n<r.length;n++)Ta(r[n],r[++n],r[++n]);dt.__c&&dt.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){dt.__e(s,i.__v)}})}function av(t,e,r,n,i,s,o,c,l){var p,d,h,b,v,w,_,k=r.props,A=e.props,B=e.type;if(B=="svg"?i="http://www.w3.org/2000/svg":B=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(p=0;p<s.length;p++)if((v=s[p])&&"setAttribute"in v==!!B&&(B?v.localName==B:v.nodeType==3)){t=v,s[p]=null;break}}if(t==null){if(B==null)return document.createTextNode(A);t=document.createElementNS(i,B,A.is&&A),c&&(dt.__m&&dt.__m(e,s),c=!1),s=null}if(B===null)k===A||c&&t.data===A||(t.data=A);else{if(s=s&&cs.call(t.childNodes),k=r.props||Vn,!c&&s!=null)for(k={},p=0;p<t.attributes.length;p++)k[(v=t.attributes[p]).name]=v.value;for(p in k)if(v=k[p],p!="children"){if(p=="dangerouslySetInnerHTML")h=v;else if(!(p in A)){if(p=="value"&&"defaultValue"in A||p=="checked"&&"defaultChecked"in A)continue;Ei(t,p,null,v,i)}}for(p in A)v=A[p],p=="children"?b=v:p=="dangerouslySetInnerHTML"?d=v:p=="value"?w=v:p=="checked"?_=v:c&&typeof v!="function"||k[p]===v||Ei(t,p,v,k[p],i);if(d)c||h&&(d.__html===h.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(h&&(t.innerHTML=""),ah(t,Sa(b)?b:[b],e,r,n,B=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:r.__k&&Qr(r,0),c,l),s!=null)for(p=s.length;p--;)Ia(s[p]);c||(p="value",B=="progress"&&w==null?t.removeAttribute("value"):w!==void 0&&(w!==t[p]||B=="progress"&&!w||B=="option"&&w!==k[p])&&Ei(t,p,w,k[p],i),p="checked",_!==void 0&&_!==t[p]&&Ei(t,p,_,k[p],i))}return t}function Ta(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(i){dt.__e(i,r)}}function uh(t,e,r){var n,i;if(dt.unmount&&dt.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Ta(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){dt.__e(s,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&uh(n[i],e,r||typeof t.type!="function");r||Ia(t.__e),t.__c=t.__=t.__e=void 0}function cv(t,e,r){return this.constructor(t,r)}function lv(t,e,r){var n,i,s,o;e==document&&(e=document.documentElement),dt.__&&dt.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,s=[],o=[],Ca(e,t=(!n&&r||e).__k=sh(cn,null,[t]),i||Vn,Vn,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?cs.call(e.childNodes):null,s,!n&&r?r:i?i.__e:e.firstChild,n,o),lh(s,t,o)}cs=ih.slice,dt={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(c){t=c}throw t}},th=0,eh=function(t){return t!=null&&t.constructor==null},br.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=nr({},this.state),typeof t=="function"&&(t=t(nr({},r),this.props)),t&&nr(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),ul(this))},br.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ul(this))},br.prototype.render=cn,mr=[],rh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ao=function(t,e){return t.__v.__b-e.__v.__b},Vi.__r=0,nh=/(PointerCapture)$|Capture$/i,Ea=0,No=pl(!1),Oo=pl(!0),nv=0;var ko,ee,Ls,dl,fl=0,hh=[],Mt=dt,gl=Mt.__b,ml=Mt.__r,yl=Mt.diffed,vl=Mt.__c,wl=Mt.unmount,bl=Mt.__;function uv(t,e){Mt.__h&&Mt.__h(ee,t,fl||e),fl=0;var r=ee.__H||(ee.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ph(t,e){var r=uv(ko++,7);return dv(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function hv(){for(var t;t=hh.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ri),t.__H.__h.forEach(Po),t.__H.__h=[]}catch(e){t.__H.__h=[],Mt.__e(e,t.__v)}}Mt.__b=function(t){ee=null,gl&&gl(t)},Mt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),bl&&bl(t,e)},Mt.__r=function(t){ml&&ml(t),ko=0;var e=(ee=t.__c).__H;e&&(Ls===ee?(e.__h=[],ee.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(Ri),e.__h.forEach(Po),e.__h=[],ko=0)),Ls=ee},Mt.diffed=function(t){yl&&yl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(hh.push(e)!==1&&dl===Mt.requestAnimationFrame||((dl=Mt.requestAnimationFrame)||pv)(hv)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Ls=ee=null},Mt.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Ri),r.__h=r.__h.filter(function(n){return!n.__||Po(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Mt.__e(n,r.__v)}}),vl&&vl(t,e)},Mt.unmount=function(t){wl&&wl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ri(n)}catch(i){e=i}}),r.__H=void 0,e&&Mt.__e(e,r.__v))};var _l=typeof requestAnimationFrame=="function";function pv(t){var e,r=function(){clearTimeout(n),_l&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);_l&&(e=requestAnimationFrame(r))}function Ri(t){var e=ee,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),ee=e}function Po(t){var e=ee;t.__c=t.__(),ee=e}function dv(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}var fv=Symbol.for("preact-signals");function xa(){if(Wr>1)Wr--;else{for(var t,e=!1;Un!==void 0;){var r=Un;for(Un=void 0,Ro++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&fh(r))try{r.c()}catch(i){e||(t=i,e=!0)}r=n}}if(Ro=0,Wr--,e)throw t}}var wt=void 0,Un=void 0,Wr=0,Ro=0,qi=0;function dh(t){if(wt!==void 0){var e=t.n;if(e===void 0||e.t!==wt)return e={i:0,S:t,p:wt.s,n:void 0,t:wt,e:void 0,x:void 0,r:e},wt.s!==void 0&&(wt.s.n=e),wt.s=e,t.n=e,32&wt.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=wt.s,e.n=void 0,wt.s.n=e,wt.s=e),e}}function qt(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}qt.prototype.brand=fv;qt.prototype.h=function(){return!0};qt.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)};qt.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)}};qt.prototype.subscribe=function(t){var e=this;return Ke(function(){var r=e.value,n=wt;wt=void 0;try{t(r)}finally{wt=n}})};qt.prototype.valueOf=function(){return this.value};qt.prototype.toString=function(){return this.value+""};qt.prototype.toJSON=function(){return this.value};qt.prototype.peek=function(){var t=wt;wt=void 0;try{return this.value}finally{wt=t}};Object.defineProperty(qt.prototype,"value",{get:function(){var t=dh(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Ro>100)throw new Error("Cycle detected");this.v=t,this.i++,qi++,Wr++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{xa()}}}});function Dr(t){return new qt(t)}function fh(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 gh(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 mh(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 ln(t){qt.call(this,void 0),this.x=t,this.s=void 0,this.g=qi-1,this.f=4}(ln.prototype=new qt).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===qi))return!0;if(this.g=qi,this.f|=1,this.i>0&&!fh(this))return this.f&=-2,!0;var t=wt;try{gh(this),wt=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 wt=t,mh(this),this.f&=-2,!0};ln.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)}qt.prototype.S.call(this,t)};ln.prototype.U=function(t){if(this.t!==void 0&&(qt.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)}};ln.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(ln.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=dh(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function gv(t){return new ln(t)}function yh(t){var e=t.u;if(t.u=void 0,typeof e=="function"){Wr++;var r=wt;wt=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Da(t),n}finally{wt=r,xa()}}}function Da(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,yh(t)}function mv(t){if(wt!==this)throw new Error("Out-of-order effect");mh(this),wt=t,this.f&=-2,8&this.f&&Da(this),xa()}function ei(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ei.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()}};ei.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,yh(this),gh(this),Wr++;var t=wt;return wt=this,mv.bind(this,t)};ei.prototype.N=function(){2&this.f||(this.f|=2,this.o=Un,Un=this)};ei.prototype.d=function(){this.f|=8,1&this.f||Da(this)};function Ke(t){var e=new ei(t);try{e.c()}catch(r){throw e.d(),r}return e.d.bind(e)}var Aa,Ms;function un(t,e){dt[t]=e.bind(null,dt[t]||function(){})}function Wi(t){Ms&&Ms(),Ms=t&&t.S()}function vh(t){var e=this,r=t.data,n=vv(r);n.value=r;var i=ph(function(){for(var s=e.__v;s=s.__;)if(s.__c){s.__c.__$f|=4;break}return e.__$u.c=function(){var o,c=e.__$u.S(),l=i.value;c(),eh(l)||((o=e.base)==null?void 0:o.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=l},gv(function(){var o=n.value.value;return o===0?0:o===!0?"":o||""})},[]);return i.value}vh.displayName="_st";Object.defineProperties(qt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:vh},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});un("__b",function(t,e){if(typeof e.type=="string"){var r,n=e.props;for(var i in n)if(i!=="children"){var s=n[i];s instanceof qt&&(r||(e.__np=r={}),r[i]=s,n[i]=s.peek())}}t(e)});un("__r",function(t,e){Wi();var r,n=e.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var s;return Ke(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),Aa=n,Wi(r),t(e)});un("__e",function(t,e,r,n){Wi(),Aa=void 0,t(e,r,n)});un("diffed",function(t,e){Wi(),Aa=void 0;var r;if(typeof e.type=="string"&&(r=e.__e)){var n=e.__np,i=e.props;if(n){var s=r.U;if(s)for(var o in s){var c=s[o];c!==void 0&&!(o in n)&&(c.d(),s[o]=void 0)}else r.U=s={};for(var l in n){var p=s[l],d=n[l];p===void 0?(p=yv(r,l,d,i),s[l]=p):p.o(d,i)}}}t(e)});function yv(t,e,r,n){var i=e in t&&t.ownerSVGElement===void 0,s=Dr(r);return{o:function(o,c){s.value=o,n=c},d:Ke(function(){var o=s.value.value;n[e]!==o&&(n[e]=o,i?t[e]=o:o?t.setAttribute(e,o):t.removeAttribute(e))})}}un("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 i in n){var s=n[i];s&&s.d()}}}}else{var o=e.__c;if(o){var c=o.__$u;c&&(o.__$u=void 0,c.d())}}t(e)});un("__h",function(t,e,r,n){(n<3||n===9)&&(e.__$f|=2),t(e,r,n)});br.prototype.shouldComponentUpdate=function(t,e){var r=this.__$u,n=r&&r.s!==void 0;for(var i 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 s in t)if(s!=="__source"&&t[s]!==this.props[s])return!0;for(var o in this.props)if(!(o in t))return!0;return!1};function vv(t){return ph(function(){return Dr(t)},[])}var wv=class{url;alt;constructor(t){t.alt&&(this.alt=t.alt),this.url=t.url}},bv=class{d;cmp;effective;constructor(t={}){this.d=t.d,this.cmp=t.cmp,this.effective=this.d}},_v=class{id;mID;name;groupID;groupName;isSelected;constructor(t){t??={},this.id=t.id,this.mID=t.mID,this.name=t.name,this.groupID=t.groupID,this.groupName=t.groupName,this.isSelected=t.isSelected??!1}},ls=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedOptions;selectedSellingPlan;effectivePrice;constructor(t){t=t??{},this.mID=t.mID,this.name=t.name,this.imgs=t.imgs?.map(e=>new wv(e))??[],this.link=t.link,this.price=new bv(t.price),this.sku=t.sku,this.isAvailable=t.isAvailable,this.quantity=t.quantity,this.selectedOptions=t.selectedOptions??[],this.effectivePrice=Dr(this.price.effective),t.sellingPlans?.length&&(this.selectedSellingPlan=Dr(void 0)),this.sellingPlans=t.sellingPlans?.map(e=>{let r=new _v(e);return r.isSelected&&(this.selectedSellingPlan.value=r),r})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(t){this.selectedSellingPlan.value=t}hasEffectivePrice(){return this.effectivePrice.value!==this.price.d}},He=class{id;mID;name;status;ctg;options;imgs;videos;portraitVideos;vars;desc;sDesc;link;slug;quantity;category;meta;reviews;tags;selectedOrFirstVariant;selected=Dr(!0);constructor(t){this.update(t),this.selectedOrFirstVariant=Dr(this.selectedVariant)}get imageURL(){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(t){this.vars=t,this.selectedOrFirstVariant.value=this.selectedVariant}get selectedVariant(){return this.vars.find(t=>t.isAvailable)??this.vars[0]}setSelectedVariant(t){this.selectedOrFirstVariant.value=t}update(t){return this.id=t.id,this.mID=t.mID,this.name=t.name,this.status=t.status,this.ctg=t.ctg,this.imgs=t.imgs,this.desc=t.desc,this.sDesc=t.sDesc,this.link=t.link,this.slug=t.slug,this.quantity=t.quantity,this.meta=t.meta,this.category=t.category,this.videos=t.videos,this.reviews=t.reviews,this.options=t.options,this.portraitVideos=t.videos?.filter(e=>e.orientation==="PORTRAIT"),this.tags=t.tags,t.vars&&(this.vars=t.vars.map(e=>new ls(e))),this}toEmbed(t){return t=t??this.selectedOrFirstVariant.value,new on({id:this.id,mID:this.mID,vID:t.mID,vName:t.name,name:this.name,link:this.link,slug:this.slug,price:t.price.d,imageURL:t.getOneImage()??this.imgs?.[0].url})}getTemplateVariables(){let t=this.selectedOrFirstVariant.value,e=t.price,r=this.name,n=this.category,i=De(e.d,!0),s=this.variantImage??this.imageURL,o=this.meta,c=this.tags?.join(",")??"",l=this.reviews?.rating,p=this.reviews?.totalReviews,d=e.cmp&&e.cmp>e.d,h={name:r,price:i,image_url:s,meta:o,category:n,rating:l,reviews:p,tags:c};if(t.hasEffectivePrice()&&(h.effective_price=De(t.effectivePrice.value)),d){h.compare_price=De(e.cmp);let v=e.cmp-e.d;h.discount_percent=(v/e.cmp*100).toFixed(0),h.discount_price=De(v)}let b={name:t.name,quantity:t.quantity};return{product:h,variant:b}}},Ev=class{id;alt;sources;items;durationMS;thumbnail;constructor(t={}){this.id=t.id,this.alt=t.alt,this.sources=t.sources?.sort((e,r)=>r.height-e.height),this.durationMS=t.durationMS,this.thumbnail=t.thumbnail,this.items=t.items?t.items.map(e=>new He(e)):[]}},Sv=class{videos;source;template;heading;slidePerViewCount;autoPlay;showMuteButton;footerContent;detailPopup;constructor(t={}){this.videos=t.videos?.map(e=>new Ev(e))??[],this.source=t.source,this.template=t.template,this.detailPopup=t.detailPopup??{template:"VIDEO_ONLY_VIEW"},this.heading=t.heading,this.showMuteButton=t.showMuteButton,this.slidePerViewCount=t.slidePerViewCount??4,this.autoPlay=t.autoPlay??"ON",this.footerContent=t.footerContent??"FIRST_ITEM"}},Iv=Object.prototype.toString,hn=Array.isArray||function(t){return Iv.call(t)==="[object Array]"};function Na(t){return typeof t=="function"}function Cv(t){return hn(t)?"array":typeof t}function Us(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function El(t,e){return t!=null&&typeof t=="object"&&e in t}function Tv(t,e){return t!=null&&typeof t!="object"&&t.hasOwnProperty&&t.hasOwnProperty(e)}var xv=RegExp.prototype.test;function Dv(t,e){return xv.call(t,e)}var Av=/\S/;function Nv(t){return!Dv(Av,t)}var Ov={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function kv(t){return String(t).replace(/[&<>"'`=\/]/g,function(e){return Ov[e]})}var Pv=/\s*/,Rv=/\s+/,Sl=/\s*=/,Lv=/\s*\}/,Mv=/#|\^|\/|>|\{|&|=|!/;function Uv(t,e){if(!t)return[];var r=!1,n=[],i=[],s=[],o=!1,c=!1,l="",p=0;function d(){if(o&&!c)for(;s.length;)delete i[s.pop()];else s=[];o=!1,c=!1}var h,b,v;function w(q){if(typeof q=="string"&&(q=q.split(Rv,2)),!hn(q)||q.length!==2)throw new Error("Invalid tags: "+q);h=new RegExp(Us(q[0])+"\\s*"),b=new RegExp("\\s*"+Us(q[1])),v=new RegExp("\\s*"+Us("}"+q[1]))}w(e||de.tags);for(var _=new ri(t),k,A,B,G,j,X;!_.eos();){if(k=_.pos,B=_.scanUntil(h),B)for(var _t=0,Dt=B.length;_t<Dt;++_t)G=B.charAt(_t),Nv(G)?(s.push(i.length),l+=G):(c=!0,r=!0,l+=" "),i.push(["text",G,k,k+1]),k+=1,G===`
|
|
31
|
+
Url: ${Fi(t)}`),!0)}function wm(t,e){return t.type||!e||!e.length?!1:Sm(t).some(r=>ss(r,e))}function bm(t,e){if(t.type!=="transaction"||!e||!e.length)return!1;let r=t.transaction;return r?ss(r,e):!1}function _m(t,e){if(!e||!e.length)return!1;let r=Fi(t);return r?ss(r,e):!1}function Em(t,e){if(!e||!e.length)return!0;let r=Fi(t);return r?ss(r,e):!0}function Sm(t){let e=[];t.message&&e.push(t.message);let r;try{r=t.exception.values[t.exception.values.length-1]}catch{}return r&&r.value&&(e.push(r.value),r.type&&e.push(`${r.type}: ${r.value}`)),e}function Im(t){try{return t.exception.values[0].type==="SentryError"}catch{}return!1}function Cm(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 Fi(t){try{let e;try{e=t.exception.values[0].stacktrace.frames}catch{}return e?Cm(e):null}catch{return Ct&&nt.error(`Cannot extract url for event ${Qe(t)}`),null}}function Tm(t){return t.type||!t.exception||!t.exception.values||t.exception.values.length===0?!1:!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value)}var xm="Dedupe",Dm=()=>{let t;return{name:xm,processEvent(e){if(e.type)return e;try{if(Nm(e,t))return Ct&&nt.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Am=Dm;function Nm(t,e){return e?!!(Om(t,e)||km(t,e)):!1}function Om(t,e){let r=t.message,n=e.message;return!(!r&&!n||r&&!n||!r&&n||r!==n||!Wu(t,e)||!qu(t,e))}function km(t,e){let r=el(e),n=el(t);return!(!r||!n||r.type!==n.type||r.value!==n.value||!Wu(t,e)||!qu(t,e))}function qu(t,e){let r=Rc(t),n=Rc(e);if(!r&&!n)return!0;if(r&&!n||!r&&n||(r=r,n=n,n.length!==r.length))return!1;for(let i=0;i<n.length;i++){let s=n[i],o=r[i];if(s.filename!==o.filename||s.lineno!==o.lineno||s.colno!==o.colno||s.function!==o.function)return!1}return!0}function Wu(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 el(t){return t.exception&&t.exception.values&&t.exception.values[0]}var Ft=ht,Io=0;function Gu(){return Io>0}function Pm(){Io++,setTimeout(()=>{Io--})}function Xr(t,e={},r){if(typeof t!="function")return t;try{let i=t.__sentry_wrapped__;if(i)return i;if(pa(t))return t}catch{return t}let n=function(){let i=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);let s=i.map(o=>Xr(o,e));return t.apply(this,s)}catch(s){throw Pm(),dg(o=>{o.addEventProcessor(c=>(e.mechanism&&(yo(c,void 0,void 0),Hn(c,e.mechanism)),c.extra=yt(x({},c.extra),{arguments:i}),c)),Jg(s)}),s}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}catch{}Nu(n,t),Ir(t,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get(){return t.name}})}catch{}return n}var Hr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function ma(t,e){let r=ya(t,e),n={type:e&&e.name,value:Bm(e)};return r.length&&(n.stacktrace={frames:r}),n.type===void 0&&n.value===""&&(n.value="Unrecoverable error caught"),n}function Rm(t,e,r,n){let i=ie(),s=i&&i.getOptions().normalizeDepth,o=Vm(e),c={__serialized__:Ru(e,s)};if(o)return{exception:{values:[ma(t,o)]},extra:c};let l={exception:{values:[{type:ns(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:Fm(e,{isUnhandledRejection:n})}]},extra:c};if(r){let p=ya(t,r);p.length&&(l.exception.values[0].stacktrace={frames:p})}return l}function Rs(t,e){return{exception:{values:[ma(t,e)]}}}function ya(t,e){let r=e.stacktrace||e.stack||"",n=Mm(e),i=Um(e);try{return t(r,n,i)}catch{}return[]}var Lm=/Minified React error #\d+;/i;function Mm(t){return t&&Lm.test(t.message)?1:0}function Um(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Bm(t){let e=t&&t.message;return e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function jm(t,e,r,n){let i=r&&r.syntheticException||void 0,s=va(t,e,i,n);return Hn(s),s.level="error",r&&r.event_id&&(s.event_id=r.event_id),Tr(s)}function $m(t,e,r="info",n,i){let s=n&&n.syntheticException||void 0,o=Co(t,e,s,i);return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),Tr(o)}function va(t,e,r,n,i){let s;if(Tu(e)&&e.error)return Rs(t,e.error);if(Tc(e)||Jd(e)){let o=e;if("stack"in e)s=Rs(t,e);else{let c=o.name||(Tc(o)?"DOMError":"DOMException"),l=o.message?`${c}: ${o.message}`:c;s=Co(t,l,r,n),yo(s,l)}return"code"in o&&(s.tags=yt(x({},s.tags),{"DOMException.code":`${o.code}`})),s}return oa(e)?Rs(t,e):Kr(e)||ns(e)?(s=Rm(t,e,r,i),Hn(s,{synthetic:!0}),s):(s=Co(t,e,r,n),yo(s,`${e}`,void 0),Hn(s,{synthetic:!0}),s)}function Co(t,e,r,n){let i={};if(n&&r){let s=ya(t,r);s.length&&(i.exception={values:[{value:e,stacktrace:{frames:s}}]})}if(aa(e)){let{__sentry_template_string__:s,__sentry_template_values__:o}=e;return i.logentry={message:s,params:o},i}return i.message=e,i}function Fm(t,{isUnhandledRejection:e}){let r=mf(t),n=e?"promise rejection":"exception";return Tu(t)?`Event \`ErrorEvent\` captured as ${n} with message \`${t.message}\``:ns(t)?`Event \`${Hm(t)}\` (type=${t.type}) captured as ${n}`:`Object captured as ${n} with keys: ${r}`}function Hm(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Vm(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let r=t[e];if(r instanceof Error)return r}}function qm(t,{metadata:e,tunnel:r,dsn:n}){let i=x(x({event_id:t.event_id,sent_at:new Date().toISOString()},e&&e.sdk&&{sdk:{name:e.sdk.name,version:e.sdk.version}}),!!r&&!!n&&{dsn:os(n)}),s=Wm(t);return ti(i,[s])}function Wm(t){return[{type:"user_report"},t]}var Gm=class extends nm{constructor(t){let e=x({parentSpanIsAlwaysRootSpan:!0},t),r=Ft.SENTRY_SDK_SOURCE||kf();cm(e,"browser",["browser"],r),super(e),e.sendClientReports&&Ft.document&&Ft.document.addEventListener("visibilitychange",()=>{Ft.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,e){return jm(this._options.stackParser,t,e,this._options.attachStacktrace)}eventFromMessage(t,e="info",r){return $m(this._options.stackParser,t,e,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){Hr&&nt.warn("SDK not enabled, will not capture user feedback.");return}let e=qm(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(e)}_prepareEvent(t,e,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,e,r)}_flushOutcomes(){let t=this._clearOutcomes();if(t.length===0){Hr&&nt.log("No outcomes to send");return}if(!this._dsn){Hr&&nt.log("No dsn provided, will not send outcomes");return}Hr&&nt.log("Sending outcomes:",t);let e=Qf(t,this._options.tunnel&&os(this._dsn));this.sendEnvelope(e)}},zm=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,zt=ht,Ym=1e3,rl,To,xo;function Km(t){let e="dom";Or(e,t),kr(e,Jm)}function Jm(){if(!zt.document)return;let t=be.bind(null,"dom"),e=nl(t,!0);zt.document.addEventListener("click",e,!1),zt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(r=>{let n=zt[r]&&zt[r].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(Ht(n,"addEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let l=this,p=l.__sentry_instrumentation_handlers__=l.__sentry_instrumentation_handlers__||{},d=p[s]=p[s]||{refCount:0};if(!d.handler){let h=nl(t);d.handler=h,i.call(this,s,h,c)}d.refCount++}catch{}return i.call(this,s,o,c)}}),Ht(n,"removeEventListener",function(i){return function(s,o,c){if(s==="click"||s=="keypress")try{let l=this,p=l.__sentry_instrumentation_handlers__||{},d=p[s];d&&(d.refCount--,d.refCount<=0&&(i.call(this,s,d.handler,c),d.handler=void 0,delete p[s]),Object.keys(p).length===0&&delete l.__sentry_instrumentation_handlers__)}catch{}return i.call(this,s,o,c)}}))})}function Xm(t){if(t.type!==To)return!1;try{if(!t.target||t.target._sentryId!==xo)return!1}catch{}return!0}function Qm(t,e){return t!=="keypress"?!1:!e||!e.tagName?!0:!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable)}function nl(t,e=!1){return r=>{if(!r||r._sentryCaptured)return;let n=Zm(r);if(Qm(r.type,n))return;Ir(r,"_sentryCaptured",!0),n&&!n._sentryId&&Ir(n,"_sentryId",_e());let i=r.type==="keypress"?"input":r.type;Xm(r)||(t({event:r,name:i,global:e}),To=r.type,xo=n?n._sentryId:void 0),clearTimeout(rl),rl=zt.setTimeout(()=>{xo=void 0,To=void 0},Ym)}}function Zm(t){try{return t.target}catch{return null}}var wi;function ty(t){let e="history";Or(e,t),kr(e,ey)}function ey(){if(!ng())return;let t=zt.onpopstate;zt.onpopstate=function(...r){let n=zt.location.href,i=wi;if(wi=n,be("history",{from:i,to:n}),t)try{return t.apply(this,r)}catch{}};function e(r){return function(...n){let i=n.length>2?n[2]:void 0;if(i){let s=wi,o=String(i);wi=o,be("history",{from:s,to:o})}return r.apply(this,n)}}Ht(zt.history,"pushState",e),Ht(zt.history,"replaceState",e)}var ki={};function ry(t){let e=ki[t];if(e)return e;let r=zt[t];if(go(r))return ki[t]=r.bind(zt);let n=zt.document;if(n&&typeof n.createElement=="function")try{let i=n.createElement("iframe");i.hidden=!0,n.head.appendChild(i);let s=i.contentWindow;s&&s[t]&&(r=s[t]),n.head.removeChild(i)}catch(i){zm&&nt.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return r&&(ki[t]=r.bind(zt))}function il(t){ki[t]=void 0}var On="__sentry_xhr_v3__";function ny(t){let e="xhr";Or(e,t),kr(e,iy)}function iy(){if(!zt.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;Ht(t,"open",function(e){return function(...r){let n=sr()*1e3,i=Fe(r[0])?r[0].toUpperCase():void 0,s=sy(r[1]);if(!i||!s)return e.apply(this,r);this[On]={method:i,url:s,request_headers:{}},i==="POST"&&s.match(/sentry_key/)&&(this.__sentry_own_request__=!0);let o=()=>{let c=this[On];if(c&&this.readyState===4){try{c.status_code=this.status}catch{}let l={endTimestamp:sr()*1e3,startTimestamp:n,xhr:this};be("xhr",l)}};return"onreadystatechange"in this&&typeof this.onreadystatechange=="function"?Ht(this,"onreadystatechange",function(c){return function(...l){return o(),c.apply(this,l)}}):this.addEventListener("readystatechange",o),Ht(this,"setRequestHeader",function(c){return function(...l){let[p,d]=l,h=this[On];return h&&Fe(p)&&Fe(d)&&(h.request_headers[p.toLowerCase()]=d),c.apply(this,l)}}),e.apply(this,r)}}),Ht(t,"send",function(e){return function(...r){let n=this[On];if(!n)return e.apply(this,r);r[0]!==void 0&&(n.body=r[0]);let i={startTimestamp:sr()*1e3,xhr:this};return be("xhr",i),e.apply(this,r)}})}function sy(t){if(Fe(t))return t;try{return t.toString()}catch{}}function oy(t,e=ry("fetch")){let r=0,n=0;function i(s){let o=s.body.length;r+=o,n++;let c=x({body:s.body,method:"POST",referrerPolicy:"origin",headers:t.headers,keepalive:r<=6e4&&n<15},t.fetchOptions);if(!e)return il("fetch"),ji("No fetch implementation available");try{return e(t.url,c).then(l=>(r-=o,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 il("fetch"),r-=o,n--,ji(l)}}return am(t,i)}var ay=30,cy=50;function Do(t,e,r,n){let i={filename:t,function:e==="<anonymous>"?Cr:e,in_app:!0};return r!==void 0&&(i.lineno=r),n!==void 0&&(i.colno=n),i}var ly=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,uy=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,hy=/\((\S*)(?::(\d+))(?::(\d+))\)/,py=t=>{let e=ly.exec(t);if(e){let[,n,i,s]=e;return Do(n,Cr,+i,+s)}let r=uy.exec(t);if(r){if(r[2]&&r[2].indexOf("eval")===0){let s=hy.exec(r[2]);s&&(r[2]=s[1],r[3]=s[2],r[4]=s[3])}let[n,i]=zu(r[1]||Cr,r[2]);return Do(i,n,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},dy=[ay,py],fy=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,gy=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,my=t=>{let e=fy.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let i=gy.exec(e[3]);i&&(e[1]=e[1]||"eval",e[3]=i[1],e[4]=i[2],e[5]="")}let r=e[3],n=e[1]||Cr;return[n,r]=zu(n,r),Do(r,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},yy=[cy,my],vy=[dy,yy],wy=vf(...vy),zu=(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]:Cr,r?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},bi=1024,by="Breadcrumbs",_y=(t={})=>{let e=x({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:by,setup(r){e.console&&bf(Cy(r)),e.dom&&Km(Iy(r,e.dom)),e.xhr&&ny(Ty(r)),e.fetch&&Cf(xy(r)),e.history&&ty(Dy(r)),e.sentry&&r.on("beforeSendEvent",Sy(r))}}},Ey=_y;function Sy(t){return function(e){ie()===t&&xr({category:`sentry.${e.type==="transaction"?"transaction":"event"}`,event_id:e.event_id,level:e.level,message:Qe(e)},{event:e})}}function Iy(t,e){return function(r){if(ie()!==t)return;let n,i,s=typeof e=="object"?e.serializeAttribute:void 0,o=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;o&&o>bi&&(Hr&&nt.warn(`\`dom.maxStringLength\` cannot exceed ${bi}, but a value of ${o} was configured. Sentry will use ${bi} instead.`),o=bi),typeof s=="string"&&(s=[s]);try{let l=r.event,p=Ay(l)?l.target:l;n=Du(p,{keyAttrs:s,maxStringLength:o}),i=af(p)}catch{n="<unknown>"}if(n.length===0)return;let c={category:`ui.${r.name}`,message:n};i&&(c.data={"ui.component_name":i}),xr(c,{event:r.event,name:r.name,global:r.global})}}function Cy(t){return function(e){if(ie()!==t)return;let r={category:"console",data:{arguments:e.args,logger:"console"},level:Ff(e.level),message:xc(e.args," ")};if(e.level==="assert")if(e.args[0]===!1)r.message=`Assertion failed: ${xc(e.args.slice(1)," ")||"console.assert"}`,r.data.arguments=e.args.slice(1);else return;xr(r,{input:e.args,level:e.level})}}function Ty(t){return function(e){if(ie()!==t)return;let{startTimestamp:r,endTimestamp:n}=e,i=e.xhr[On];if(!r||!n||!i)return;let{method:s,url:o,status_code:c,body:l}=i,p={method:s,url:o,status_code:c},d={xhr:e.xhr,input:l,startTimestamp:r,endTimestamp:n};xr({category:"xhr",data:p,type:"http"},d)}}function xy(t){return function(e){if(ie()!==t)return;let{startTimestamp:r,endTimestamp:n}=e;if(n&&!(e.fetchData.url.match(/sentry_key/)&&e.fetchData.method==="POST"))if(e.error){let i=e.fetchData,s={data:e.error,input:e.args,startTimestamp:r,endTimestamp:n};xr({category:"fetch",data:i,level:"error",type:"http"},s)}else{let i=e.response,s=yt(x({},e.fetchData),{status_code:i&&i.status}),o={input:e.args,response:i,startTimestamp:r,endTimestamp:n};xr({category:"fetch",data:s,type:"http"},o)}}}function Dy(t){return function(e){if(ie()!==t)return;let r=e.from,n=e.to,i=Ps(Ft.location.href),s=r?Ps(r):void 0,o=Ps(n);(!s||!s.path)&&(s=i),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),i.protocol===s.protocol&&i.host===s.host&&(r=s.relative),xr({category:"navigation",data:{from:r,to:n}})}}function Ay(t){return!!t&&!!t.target}var Ny=["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"],Oy="BrowserApiErrors",ky=(t={})=>{let e=x({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t);return{name:Oy,setupOnce(){e.setTimeout&&Ht(Ft,"setTimeout",sl),e.setInterval&&Ht(Ft,"setInterval",sl),e.requestAnimationFrame&&Ht(Ft,"requestAnimationFrame",Ry),e.XMLHttpRequest&&"XMLHttpRequest"in Ft&&Ht(XMLHttpRequest.prototype,"send",Ly);let r=e.eventTarget;r&&(Array.isArray(r)?r:Ny).forEach(My)}}},Py=ky;function sl(t){return function(...e){let r=e[0];return e[0]=Xr(r,{mechanism:{data:{function:ar(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function Ry(t){return function(e){return t.apply(this,[Xr(e,{mechanism:{data:{function:"requestAnimationFrame",handler:ar(t)},handled:!1,type:"instrument"}})])}}function Ly(t){return function(...e){let r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(n=>{n in r&&typeof r[n]=="function"&&Ht(r,n,function(i){let s={mechanism:{data:{function:n,handler:ar(i)},handled:!1,type:"instrument"}},o=pa(i);return o&&(s.mechanism.data.handler=ar(o)),Xr(i,s)})}),t.apply(this,e)}}function My(t){let e=Ft,r=e[t]&&e[t].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(Ht(r,"addEventListener",function(n){return function(i,s,o){try{typeof s.handleEvent=="function"&&(s.handleEvent=Xr(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:ar(s),target:t},handled:!1,type:"instrument"}}))}catch{}return n.apply(this,[i,Xr(s,{mechanism:{data:{function:"addEventListener",handler:ar(s),target:t},handled:!1,type:"instrument"}}),o])}}),Ht(r,"removeEventListener",function(n){return function(i,s,o){let c=s;try{let l=c&&c.__sentry_wrapped__;l&&n.call(this,i,l,o)}catch{}return n.call(this,i,c,o)}}))}var Uy="GlobalHandlers",By=(t={})=>{let e=x({onerror:!0,onunhandledrejection:!0},t);return{name:Uy,setupOnce(){Error.stackTraceLimit=50},setup(r){e.onerror&&($y(r),ol("onerror")),e.onunhandledrejection&&(Fy(r),ol("onunhandledrejection"))}}},jy=By;function $y(t){Df(e=>{let{stackParser:r,attachStacktrace:n}=Yu();if(ie()!==t||Gu())return;let{msg:i,url:s,line:o,column:c,error:l}=e,p=qy(va(r,l||i,void 0,n,!1),s,o,c);p.level="error",Fu(p,{originalException:l,mechanism:{handled:!1,type:"onerror"}})})}function Fy(t){Nf(e=>{let{stackParser:r,attachStacktrace:n}=Yu();if(ie()!==t||Gu())return;let i=Hy(e),s=ca(i)?Vy(i):va(r,i,void 0,n,!0);s.level="error",Fu(s,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function Hy(t){if(ca(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 Vy(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function qy(t,e,r,n){let i=t.exception=t.exception||{},s=i.values=i.values||[],o=s[0]=s[0]||{},c=o.stacktrace=o.stacktrace||{},l=c.frames=c.frames||[],p=isNaN(parseInt(n,10))?void 0:n,d=isNaN(parseInt(r,10))?void 0:r,h=Fe(e)&&e.length>0?e:of();return l.length===0&&l.push({colno:p,filename:h,function:Cr,in_app:!0,lineno:d}),t}function ol(t){Hr&&nt.log(`Global Handler attached: ${t}`)}function Yu(){let t=ie();return t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var Wy=()=>({name:"HttpContext",preprocessEvent(t){if(!Ft.navigator&&!Ft.location&&!Ft.document)return;let e=t.request&&t.request.url||Ft.location&&Ft.location.href,{referrer:r}=Ft.document||{},{userAgent:n}=Ft.navigator||{},i=x(x(x({},t.request&&t.request.headers),r&&{Referer:r}),n&&{"User-Agent":n}),s=yt(x(x({},t.request),e&&{url:e}),{headers:i});t.request=s}}),Gy="cause",zy=5,Yy="LinkedErrors",Ky=(t={})=>{let e=t.limit||zy,r=t.key||Gy;return{name:Yy,preprocessEvent(n,i,s){let o=s.getOptions();ef(ma,o.stackParser,o.maxValueLength,r,e,n,i)}}},Jy=Ky;function Xy(t){return[mm(),pm(),Py(),Ey(),jy(),Jy(),Am(),Wy()]}var Kt=class Ku{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new Ku),this.INSTANCE}captureError(e,r,n){T.error(`${r}:`,e);let i=this.getNewScope(n);i.setTag("operation",r),i.captureException(e)}captureMessage(e,r,n){this.getNewScope(n).captureMessage(e,r??"error")}setGlobalContext(e,r){this.contexts[e]=x({context:r},this.contexts[e])}setUser(e){this.user=e}setTags(e){this.tags=e}getNewScope(e){e??={};let{extra:r,tags:n}=e,i=new Ge;if(i.setClient(this.client),i.setUser(this.user),e.triggerContext&&!e.engagementTrigger&&(e.engagementTrigger=e.triggerContext.triggerData),e.engagementTrigger){let s=e.engagementTrigger;i.setTags({"engagement.id":s.engagementID,"engagement.short_id":s.shortID,"engagement.objective":s.objective,"engagement.delivery_type":s.onsiteDeliveryType,"engagement.content_id":s.contentID,"engagement.variation":s.variation,"engagement.currency":s.currency})}return r&&i.setExtras(r),this.tags&&i.setTags(this.tags),n&&i.setTags(n),Object.keys(this.contexts).forEach(s=>{i.setContext(s,this.contexts[s])}),i.setTag("language",navigator.language),i.setTag("timezone",ev()),this.addShopifyTags(i),i}addShopifyTags(e){window.Shopify&&(e.setTag("shopify.shop",window.Shopify.shop),e.setTag("shopify.currency",window.Shopify.currency?.active),e.setTag("shopify.locale",window.Shopify.locale),e.setTag("theme.schema_name",window.Shopify.theme?.schema_name),e.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}init(){let e=Xy({}).filter(r=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(r.name));this.client=new Gm({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:oy,stackParser:wy,integrations:e,environment:qe.mode,release:`web-sdk@${H.SDK_VERSION}`,debug:qe.debug}),this.client.init()}},ot=class{static ID="id";static SESSION_LANDING_PAGE="landing";static SESSION_LAST_USED_TIME="lastUsedTime";static SESSION_SYNCED="synced";static APP_CONFIG="conf";static DEVICE_ID="did";static SDK_TOKEN="token";static FIRST_SEEN="firstSeen";static SESSION_NUMBER="sessionNumber";static GA_CLIENT_ID="gacid";static CURRENT_CART="cart";static MUTED="muted"},al=ke(kd());function wa(t){return al.default.createInstance({name:"lc",storeName:t,driver:al.default.LOCALSTORAGE})}var ba=class{static storage;static async get(t,e){return await this.storage?.getItem(t)??e}static set(t,e){return this.storage?.setItem(t,e)}static remove(t){return this.storage?.removeItem(t)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}},te=class extends ba{static storeName="ses";static{this.storage=wa(this.storeName)}},Lt=class extends ba{static storeName="usr";static{this.storage=wa(this.storeName)}},Qy=class{static format(t,e){let r=/{{\s*(\w+)\s*}}/;return e.replace(r,(n,i)=>{switch(i){case"amount":return this.formatWithDelimiters(t,2);case"amount_no_decimals":return this.formatWithDelimiters(t,0);case"amount_with_comma_separator":return this.formatWithDelimiters(t,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(t,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(t,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(t,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(t,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(t,2," ",".");default:return n}})}static formatWithDelimiters(t,e=2,r=",",n="."){if(isNaN(t)||t==null)return"0";let i=(t/100).toFixed(e).split("."),s=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),o=i[1]?n+i[1]:"";return s+o}},Ot=class{isCartDirty=!0;cartEngagements;isGoKwikPopupOpen;previewIDs;previewVariant;pageName;moneyFormat;jsLoadTime=new Date;shopCurrencyCode;locale;activeExperiment;inInactive=!1;lastEnterActive=new Date;lastEnterInactive=null;currentItem;_currencyCode;get currencyCode(){return this._currencyCode}set currencyCode(t){this._currencyCode=t}static get(){return window.CooeeSDK.runtimeData}isInactive(){return this.inInactive}async setInactive(){return this.inInactive?0:(this.inInactive=!0,this.lastEnterInactive=new Date,Math.max((this.lastEnterInactive.getTime()-this.lastEnterActive.getTime())/1e3,0))}setActive(){return this.inInactive?(this.inInactive=!1,this.lastEnterActive=new Date,Math.max((this.lastEnterActive.getTime()-this.lastEnterInactive.getTime())/1e3,0)):0}isFirstActive(){return this.lastEnterInactive==null}getCurrentItem(){return this.currentItem}setCurrentItem(t){this.currentItem=new on(t)}};function Ju(t){try{return new URL(t)}catch{return}}function cl(t){return!t||t==="null"||t==="undefined"}function Zy(t,e){let r=t.indexOf(e);return r===-1?!1:(t.splice(r,1),!0)}function De(t,e){if(t==0&&e)return"Free";let r=Ot.get(),n=ne.get(),i=r.shopCurrencyCode||n.currency,s=r.currencyCode;s||T.warn("Currency code is not set in RuntimeData");let o=n.money?.format??r.moneyFormat,c;if(o&&i===s)c=Qy.format(t*100,o);else{let l;try{l=new Intl.NumberFormat(Xu(),{style:"currency",currency:s||i,minimumFractionDigits:0,maximumFractionDigits:2})}catch(p){return Kt.getInstance().captureError(p,"format-currency",{extra:{currentCurrency:s,shopCurrency:i}}),""}c=l.format(t),c=c.replace("\u20B9","Rs. "),n.money?.showCurrency&&s!=="INR"&&(c=c.concat(` ${s}`))}return c}function tv(t){return new Intl.NumberFormat(Xu(),{notation:"compact"}).format(t)}function Xu(){return navigator.languages!==void 0?navigator.languages[0].split("-")[0]:navigator.language??"en"}var _i;function ev(){if(_i)return _i;try{return _i=Intl.DateTimeFormat().resolvedOptions().timeZone,_i}catch{return""}}function _a(t){document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t)}function tr(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)},3e3)}async function Qu(t,e=10,r=document){let n=0,i=document.querySelectorAll("nonexistent-tag");for(;n<e;){let s=Math.min(100*2**n,5e3);if(await Jn.sleep(s),i=r.querySelectorAll(t),i.length)return T.debug(`Attempt ${n+1}: ${i.length} elements found with ${t}`),i;T.debug(`Attempt ${n+1}: Elements not found with ${t}. Retrying after ${s}ms.`),n++}return T.warn(`Max attempts reached. Element not found with ${t}.`),i}async function Hi(t,e=10,r=document){return(await Qu(t,e,r)).item(0)}function rv(t,e,r=document.body){let n=new MutationObserver(i=>{i.forEach(s=>{s.removedNodes.forEach(o=>{(o===t||o.contains(t))&&(e(),n.disconnect())})})});n.observe(r,{childList:!0})}async function Zu(){let t=await Lt.get(ot.DEVICE_ID),e=await te.get(ot.ID,"");return[{key:"letscooee_did",value:t},{key:"letscooee_sid",value:e},{key:"__letscooee_time",value:new Date().toLocaleString()},{key:"__letscooee_via",value:"Buy Now"}]}function kn(t,e,r){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!1,value:r})}var cs,dt,th,eh,mr,ll,rh,Ao,nh,Ea,No,Oo,nv,Vn={},ih=[],iv=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Sa=Array.isArray;function nr(t,e){for(var r in e)t[r]=e[r];return t}function Ia(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function sh(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?cs.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return Pi(t,o,n,i,null)}function Pi(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++th,__i:-1,__u:0};return i==null&&dt.vnode!=null&&dt.vnode(s),s}function cn(t){return t.children}function br(t,e){this.props=t,this.context=e}function Qr(t,e){if(e==null)return t.__?Qr(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"?Qr(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 ul(t){(!t.__d&&(t.__d=!0)&&mr.push(t)&&!Vi.__r++||ll!==dt.debounceRendering)&&((ll=dt.debounceRendering)||rh)(Vi)}function Vi(){var t,e,r,n,i,s,o,c;for(mr.sort(Ao);t=mr.shift();)t.__d&&(e=mr.length,n=void 0,s=(i=(r=t).__v).__e,o=[],c=[],r.__P&&((n=nr({},i)).__v=i.__v+1,dt.vnode&&dt.vnode(n),Ca(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,o,s??Qr(i),!!(32&i.__u),c),n.__v=i.__v,n.__.__k[n.__i]=n,lh(o,n,c),n.__e!=s&&oh(n)),mr.length>e&&mr.sort(Ao));Vi.__r=0}function ah(t,e,r,n,i,s,o,c,l,p,d){var h,b,v,w,_,k,A=n&&n.__k||ih,B=e.length;for(l=sv(r,e,A,l,B),h=0;h<B;h++)(v=r.__k[h])!=null&&(b=v.__i===-1?Vn:A[v.__i]||Vn,v.__i=h,k=Ca(t,v,b,i,s,o,c,l,p,d),w=v.__e,v.ref&&b.ref!=v.ref&&(b.ref&&Ta(b.ref,null,v),d.push(v.ref,v.__c||w,v)),_==null&&w!=null&&(_=w),4&v.__u||b.__k===v.__k?l=ch(v,l,t):typeof v.type=="function"&&k!==void 0?l=k:w&&(l=w.nextSibling),v.__u&=-7);return r.__e=_,l}function sv(t,e,r,n,i){var s,o,c,l,p,d=r.length,h=d,b=0;for(t.__k=new Array(i),s=0;s<i;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=s+b,(o=t.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Pi(null,o,null,null,null):Sa(o)?Pi(cn,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Pi(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,c=null,(p=o.__i=ov(o,r,l,h))!==-1&&(h--,(c=r[p])&&(c.__u|=2)),c==null||c.__v===null?(p==-1&&b--,typeof o.type!="function"&&(o.__u|=4)):p!=l&&(p==l-1?b--:p==l+1?b++:(p>l?b--:b++,o.__u|=4))):t.__k[s]=null;if(h)for(s=0;s<d;s++)(c=r[s])!=null&&(2&c.__u)==0&&(c.__e==n&&(n=Qr(c)),uh(c,c));return n}function ch(t,e,r){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=ch(n[i],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=Qr(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function ov(t,e,r,n){var i,s,o=t.key,c=t.type,l=e[r];if(l===null||l&&o==l.key&&c===l.type&&(2&l.__u)==0)return r;if(n>(l!=null&&(2&l.__u)==0?1:0))for(i=r-1,s=r+1;i>=0||s<e.length;){if(i>=0){if((l=e[i])&&(2&l.__u)==0&&o==l.key&&c===l.type)return i;i--}if(s<e.length){if((l=e[s])&&(2&l.__u)==0&&o==l.key&&c===l.type)return s;s++}}return-1}function hl(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||iv.test(e)?r:r+"px"}function Ei(t,e,r,n,i){var s;t: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||hl(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||hl(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(nh,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?n?r.u=n.u:(r.u=Ea,t.addEventListener(e,s?Oo:No,s)):t.removeEventListener(e,s?Oo:No,s);else{if(i=="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 t}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function pl(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Ea++;else if(e.t<r.u)return;return r(dt.event?dt.event(e):e)}}}function Ca(t,e,r,n,i,s,o,c,l,p){var d,h,b,v,w,_,k,A,B,G,j,X,_t,Dt,q,rt,Q,tt=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),s=[c=e.__e=r.__e]),(d=dt.__b)&&d(e);t:if(typeof tt=="function")try{if(A=e.props,B="prototype"in tt&&tt.prototype.render,G=(d=tt.contextType)&&n[d.__c],j=d?G?G.props.value:d.__:n,r.__c?k=(h=e.__c=r.__c).__=h.__E:(B?e.__c=h=new tt(A,j):(e.__c=h=new br(A,j),h.constructor=tt,h.render=cv),G&&G.sub(h),h.props=A,h.state||(h.state={}),h.context=j,h.__n=n,b=h.__d=!0,h.__h=[],h._sb=[]),B&&h.__s==null&&(h.__s=h.state),B&&tt.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=nr({},h.__s)),nr(h.__s,tt.getDerivedStateFromProps(A,h.__s))),v=h.props,w=h.state,h.__v=e,b)B&&tt.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),B&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(B&&tt.getDerivedStateFromProps==null&&A!==v&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(A,j),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(A,h.__s,j)===!1||e.__v==r.__v)){for(e.__v!=r.__v&&(h.props=A,h.state=h.__s,h.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(lt){lt&&(lt.__=e)}),X=0;X<h._sb.length;X++)h.__h.push(h._sb[X]);h._sb=[],h.__h.length&&o.push(h);break t}h.componentWillUpdate!=null&&h.componentWillUpdate(A,h.__s,j),B&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(v,w,_)})}if(h.context=j,h.props=A,h.__P=t,h.__e=!1,_t=dt.__r,Dt=0,B){for(h.state=h.__s,h.__d=!1,_t&&_t(e),d=h.render(h.props,h.state,h.context),q=0;q<h._sb.length;q++)h.__h.push(h._sb[q]);h._sb=[]}else do h.__d=!1,_t&&_t(e),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++Dt<25);h.state=h.__s,h.getChildContext!=null&&(n=nr(nr({},n),h.getChildContext())),B&&!b&&h.getSnapshotBeforeUpdate!=null&&(_=h.getSnapshotBeforeUpdate(v,w)),c=ah(t,Sa(rt=d!=null&&d.type===cn&&d.key==null?d.props.children:d)?rt:[rt],e,r,n,i,s,o,c,l,p),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),k&&(h.__E=h.__=null)}catch(lt){if(e.__v=null,l||s!=null)if(lt.then){for(e.__u|=l?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,e.__e=c}else for(Q=s.length;Q--;)Ia(s[Q]);else e.__e=r.__e,e.__k=r.__k;dt.__e(lt,e,r)}else s==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):c=e.__e=av(r.__e,e,r,n,i,s,o,l,p);return(d=dt.diffed)&&d(e),128&e.__u?void 0:c}function lh(t,e,r){for(var n=0;n<r.length;n++)Ta(r[n],r[++n],r[++n]);dt.__c&&dt.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){dt.__e(s,i.__v)}})}function av(t,e,r,n,i,s,o,c,l){var p,d,h,b,v,w,_,k=r.props,A=e.props,B=e.type;if(B=="svg"?i="http://www.w3.org/2000/svg":B=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(p=0;p<s.length;p++)if((v=s[p])&&"setAttribute"in v==!!B&&(B?v.localName==B:v.nodeType==3)){t=v,s[p]=null;break}}if(t==null){if(B==null)return document.createTextNode(A);t=document.createElementNS(i,B,A.is&&A),c&&(dt.__m&&dt.__m(e,s),c=!1),s=null}if(B===null)k===A||c&&t.data===A||(t.data=A);else{if(s=s&&cs.call(t.childNodes),k=r.props||Vn,!c&&s!=null)for(k={},p=0;p<t.attributes.length;p++)k[(v=t.attributes[p]).name]=v.value;for(p in k)if(v=k[p],p!="children"){if(p=="dangerouslySetInnerHTML")h=v;else if(!(p in A)){if(p=="value"&&"defaultValue"in A||p=="checked"&&"defaultChecked"in A)continue;Ei(t,p,null,v,i)}}for(p in A)v=A[p],p=="children"?b=v:p=="dangerouslySetInnerHTML"?d=v:p=="value"?w=v:p=="checked"?_=v:c&&typeof v!="function"||k[p]===v||Ei(t,p,v,k[p],i);if(d)c||h&&(d.__html===h.__html||d.__html===t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(h&&(t.innerHTML=""),ah(t,Sa(b)?b:[b],e,r,n,B=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:r.__k&&Qr(r,0),c,l),s!=null)for(p=s.length;p--;)Ia(s[p]);c||(p="value",B=="progress"&&w==null?t.removeAttribute("value"):w!==void 0&&(w!==t[p]||B=="progress"&&!w||B=="option"&&w!==k[p])&&Ei(t,p,w,k[p],i),p="checked",_!==void 0&&_!==t[p]&&Ei(t,p,_,k[p],i))}return t}function Ta(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(i){dt.__e(i,r)}}function uh(t,e,r){var n,i;if(dt.unmount&&dt.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Ta(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){dt.__e(s,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&uh(n[i],e,r||typeof t.type!="function");r||Ia(t.__e),t.__c=t.__=t.__e=void 0}function cv(t,e,r){return this.constructor(t,r)}function lv(t,e,r){var n,i,s,o;e==document&&(e=document.documentElement),dt.__&&dt.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,s=[],o=[],Ca(e,t=(!n&&r||e).__k=sh(cn,null,[t]),i||Vn,Vn,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?cs.call(e.childNodes):null,s,!n&&r?r:i?i.__e:e.firstChild,n,o),lh(s,t,o)}cs=ih.slice,dt={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(c){t=c}throw t}},th=0,eh=function(t){return t!=null&&t.constructor==null},br.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=nr({},this.state),typeof t=="function"&&(t=t(nr({},r),this.props)),t&&nr(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),ul(this))},br.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),ul(this))},br.prototype.render=cn,mr=[],rh=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ao=function(t,e){return t.__v.__b-e.__v.__b},Vi.__r=0,nh=/(PointerCapture)$|Capture$/i,Ea=0,No=pl(!1),Oo=pl(!0),nv=0;var ko,ee,Ls,dl,fl=0,hh=[],Mt=dt,gl=Mt.__b,ml=Mt.__r,yl=Mt.diffed,vl=Mt.__c,wl=Mt.unmount,bl=Mt.__;function uv(t,e){Mt.__h&&Mt.__h(ee,t,fl||e),fl=0;var r=ee.__H||(ee.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function ph(t,e){var r=uv(ko++,7);return dv(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function hv(){for(var t;t=hh.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Ri),t.__H.__h.forEach(Po),t.__H.__h=[]}catch(e){t.__H.__h=[],Mt.__e(e,t.__v)}}Mt.__b=function(t){ee=null,gl&&gl(t)},Mt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),bl&&bl(t,e)},Mt.__r=function(t){ml&&ml(t),ko=0;var e=(ee=t.__c).__H;e&&(Ls===ee?(e.__h=[],ee.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(Ri),e.__h.forEach(Po),e.__h=[],ko=0)),Ls=ee},Mt.diffed=function(t){yl&&yl(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(hh.push(e)!==1&&dl===Mt.requestAnimationFrame||((dl=Mt.requestAnimationFrame)||pv)(hv)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Ls=ee=null},Mt.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Ri),r.__h=r.__h.filter(function(n){return!n.__||Po(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Mt.__e(n,r.__v)}}),vl&&vl(t,e)},Mt.unmount=function(t){wl&&wl(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Ri(n)}catch(i){e=i}}),r.__H=void 0,e&&Mt.__e(e,r.__v))};var _l=typeof requestAnimationFrame=="function";function pv(t){var e,r=function(){clearTimeout(n),_l&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);_l&&(e=requestAnimationFrame(r))}function Ri(t){var e=ee,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),ee=e}function Po(t){var e=ee;t.__c=t.__(),ee=e}function dv(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}var fv=Symbol.for("preact-signals");function xa(){if(Wr>1)Wr--;else{for(var t,e=!1;Un!==void 0;){var r=Un;for(Un=void 0,Ro++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&fh(r))try{r.c()}catch(i){e||(t=i,e=!0)}r=n}}if(Ro=0,Wr--,e)throw t}}var wt=void 0,Un=void 0,Wr=0,Ro=0,qi=0;function dh(t){if(wt!==void 0){var e=t.n;if(e===void 0||e.t!==wt)return e={i:0,S:t,p:wt.s,n:void 0,t:wt,e:void 0,x:void 0,r:e},wt.s!==void 0&&(wt.s.n=e),wt.s=e,t.n=e,32&wt.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=wt.s,e.n=void 0,wt.s.n=e,wt.s=e),e}}function qt(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}qt.prototype.brand=fv;qt.prototype.h=function(){return!0};qt.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)};qt.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)}};qt.prototype.subscribe=function(t){var e=this;return Ke(function(){var r=e.value,n=wt;wt=void 0;try{t(r)}finally{wt=n}})};qt.prototype.valueOf=function(){return this.value};qt.prototype.toString=function(){return this.value+""};qt.prototype.toJSON=function(){return this.value};qt.prototype.peek=function(){var t=wt;wt=void 0;try{return this.value}finally{wt=t}};Object.defineProperty(qt.prototype,"value",{get:function(){var t=dh(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Ro>100)throw new Error("Cycle detected");this.v=t,this.i++,qi++,Wr++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{xa()}}}});function Dr(t){return new qt(t)}function fh(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 gh(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 mh(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 ln(t){qt.call(this,void 0),this.x=t,this.s=void 0,this.g=qi-1,this.f=4}(ln.prototype=new qt).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===qi))return!0;if(this.g=qi,this.f|=1,this.i>0&&!fh(this))return this.f&=-2,!0;var t=wt;try{gh(this),wt=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 wt=t,mh(this),this.f&=-2,!0};ln.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)}qt.prototype.S.call(this,t)};ln.prototype.U=function(t){if(this.t!==void 0&&(qt.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)}};ln.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(ln.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=dh(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function gv(t){return new ln(t)}function yh(t){var e=t.u;if(t.u=void 0,typeof e=="function"){Wr++;var r=wt;wt=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,Da(t),n}finally{wt=r,xa()}}}function Da(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,yh(t)}function mv(t){if(wt!==this)throw new Error("Out-of-order effect");mh(this),wt=t,this.f&=-2,8&this.f&&Da(this),xa()}function ei(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ei.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()}};ei.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,yh(this),gh(this),Wr++;var t=wt;return wt=this,mv.bind(this,t)};ei.prototype.N=function(){2&this.f||(this.f|=2,this.o=Un,Un=this)};ei.prototype.d=function(){this.f|=8,1&this.f||Da(this)};function Ke(t){var e=new ei(t);try{e.c()}catch(r){throw e.d(),r}return e.d.bind(e)}var Aa,Ms;function un(t,e){dt[t]=e.bind(null,dt[t]||function(){})}function Wi(t){Ms&&Ms(),Ms=t&&t.S()}function vh(t){var e=this,r=t.data,n=vv(r);n.value=r;var i=ph(function(){for(var s=e.__v;s=s.__;)if(s.__c){s.__c.__$f|=4;break}return e.__$u.c=function(){var o,c=e.__$u.S(),l=i.value;c(),eh(l)||((o=e.base)==null?void 0:o.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=l},gv(function(){var o=n.value.value;return o===0?0:o===!0?"":o||""})},[]);return i.value}vh.displayName="_st";Object.defineProperties(qt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:vh},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});un("__b",function(t,e){if(typeof e.type=="string"){var r,n=e.props;for(var i in n)if(i!=="children"){var s=n[i];s instanceof qt&&(r||(e.__np=r={}),r[i]=s,n[i]=s.peek())}}t(e)});un("__r",function(t,e){Wi();var r,n=e.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var s;return Ke(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),Aa=n,Wi(r),t(e)});un("__e",function(t,e,r,n){Wi(),Aa=void 0,t(e,r,n)});un("diffed",function(t,e){Wi(),Aa=void 0;var r;if(typeof e.type=="string"&&(r=e.__e)){var n=e.__np,i=e.props;if(n){var s=r.U;if(s)for(var o in s){var c=s[o];c!==void 0&&!(o in n)&&(c.d(),s[o]=void 0)}else r.U=s={};for(var l in n){var p=s[l],d=n[l];p===void 0?(p=yv(r,l,d,i),s[l]=p):p.o(d,i)}}}t(e)});function yv(t,e,r,n){var i=e in t&&t.ownerSVGElement===void 0,s=Dr(r);return{o:function(o,c){s.value=o,n=c},d:Ke(function(){var o=s.value.value;n[e]!==o&&(n[e]=o,i?t[e]=o:o?t.setAttribute(e,o):t.removeAttribute(e))})}}un("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 i in n){var s=n[i];s&&s.d()}}}}else{var o=e.__c;if(o){var c=o.__$u;c&&(o.__$u=void 0,c.d())}}t(e)});un("__h",function(t,e,r,n){(n<3||n===9)&&(e.__$f|=2),t(e,r,n)});br.prototype.shouldComponentUpdate=function(t,e){var r=this.__$u,n=r&&r.s!==void 0;for(var i 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 s in t)if(s!=="__source"&&t[s]!==this.props[s])return!0;for(var o in this.props)if(!(o in t))return!0;return!1};function vv(t){return ph(function(){return Dr(t)},[])}var wv=class{url;alt;constructor(t){t.alt&&(this.alt=t.alt),this.url=t.url}},bv=class{d;cmp;effective;constructor(t={}){this.d=t.d,this.cmp=t.cmp,this.effective=this.d}},_v=class{id;mID;name;groupID;groupName;isSelected;constructor(t){t??={},this.id=t.id,this.mID=t.mID,this.name=t.name,this.groupID=t.groupID,this.groupName=t.groupName,this.isSelected=t.isSelected??!1}},ls=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedOptions;selectedSellingPlan;effectivePrice;constructor(t){t=t??{},this.mID=t.mID,this.name=t.name,this.imgs=t.imgs?.map(e=>new wv(e))??[],this.link=t.link,this.price=new bv(t.price),this.sku=t.sku,this.isAvailable=t.isAvailable,this.quantity=t.quantity,this.selectedOptions=t.selectedOptions??[],this.effectivePrice=Dr(this.price.effective),t.sellingPlans?.length&&(this.selectedSellingPlan=Dr(void 0)),this.sellingPlans=t.sellingPlans?.map(e=>{let r=new _v(e);return r.isSelected&&(this.selectedSellingPlan.value=r),r})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(t){this.selectedSellingPlan.value=t}hasEffectivePrice(){return this.effectivePrice.value!==this.price.d}},He=class{id;mID;name;status;ctg;options;imgs;videos;portraitVideos;vars;desc;sDesc;link;slug;quantity;category;meta;reviews;tags;selectedOrFirstVariant;selected=Dr(!0);constructor(t){this.update(t),this.selectedOrFirstVariant=Dr(this.selectedVariant)}get imageURL(){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(t){this.vars=t,this.selectedOrFirstVariant.value=this.selectedVariant}get selectedVariant(){return this.vars.find(t=>t.isAvailable)??this.vars[0]}setSelectedVariant(t){this.selectedOrFirstVariant.value=t}update(t){return this.id=t.id,this.mID=t.mID,this.name=t.name,this.status=t.status,this.ctg=t.ctg,this.imgs=t.imgs,this.desc=t.desc,this.sDesc=t.sDesc,this.link=t.link,this.slug=t.slug,this.quantity=t.quantity,this.meta=t.meta,this.category=t.category,this.videos=t.videos,this.reviews=t.reviews,this.options=t.options,this.portraitVideos=t.videos?.filter(e=>e.orientation==="PORTRAIT"),this.tags=t.tags,t.vars&&(this.vars=t.vars.map(e=>new ls(e))),this}toEmbed(t){return t=t??this.selectedOrFirstVariant.value,new on({id:this.id,mID:this.mID,vID:t.mID,vName:t.name,name:this.name,link:this.link,slug:this.slug,price:t.price.d,imageURL:t.getOneImage()??this.imgs?.[0].url})}getTemplateVariables(){let t=this.selectedOrFirstVariant.value,e=t.price,r=this.name,n=this.category,i=De(e.d,!0),s=this.variantImage??this.imageURL,o=this.meta,c=this.tags?.join(",")??"",l=this.reviews?.rating,p=this.reviews?.totalReviews,d=e.cmp&&e.cmp>e.d,h={name:r,price:i,image_url:s,meta:o,category:n,rating:l,reviews:p,tags:c};if(t.hasEffectivePrice()&&(h.effective_price=De(t.effectivePrice.value)),d){h.compare_price=De(e.cmp);let v=e.cmp-e.d;h.discount_percent=(v/e.cmp*100).toFixed(0),h.discount_price=De(v)}let b={name:t.name,quantity:t.quantity};return{product:h,variant:b}}},Ev=class{id;alt;sources;items;durationMS;thumbnail;card;constructor(t={}){this.id=t.id,this.alt=t.alt,this.sources=t.sources?.sort((e,r)=>r.height-e.height),this.durationMS=t.durationMS,this.thumbnail=t.thumbnail,this.items=t.items?t.items.map(e=>new He(e)):[],this.card=t.card}},Sv=class{videos;source;template;heading;slidePerViewCount;autoPlay;showMuteButton;footerContent;detailPopup;constructor(t={}){this.videos=t.videos?.map(e=>new Ev(e))??[],this.source=t.source,this.template=t.template,this.detailPopup=t.detailPopup??{template:"VIDEO_ONLY_VIEW"},this.heading=t.heading,this.showMuteButton=t.showMuteButton,this.slidePerViewCount=t.slidePerViewCount??4,this.autoPlay=t.autoPlay??"ON",this.footerContent=t.footerContent??"FIRST_ITEM"}},Iv=Object.prototype.toString,hn=Array.isArray||function(t){return Iv.call(t)==="[object Array]"};function Na(t){return typeof t=="function"}function Cv(t){return hn(t)?"array":typeof t}function Us(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function El(t,e){return t!=null&&typeof t=="object"&&e in t}function Tv(t,e){return t!=null&&typeof t!="object"&&t.hasOwnProperty&&t.hasOwnProperty(e)}var xv=RegExp.prototype.test;function Dv(t,e){return xv.call(t,e)}var Av=/\S/;function Nv(t){return!Dv(Av,t)}var Ov={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function kv(t){return String(t).replace(/[&<>"'`=\/]/g,function(e){return Ov[e]})}var Pv=/\s*/,Rv=/\s+/,Sl=/\s*=/,Lv=/\s*\}/,Mv=/#|\^|\/|>|\{|&|=|!/;function Uv(t,e){if(!t)return[];var r=!1,n=[],i=[],s=[],o=!1,c=!1,l="",p=0;function d(){if(o&&!c)for(;s.length;)delete i[s.pop()];else s=[];o=!1,c=!1}var h,b,v;function w(q){if(typeof q=="string"&&(q=q.split(Rv,2)),!hn(q)||q.length!==2)throw new Error("Invalid tags: "+q);h=new RegExp(Us(q[0])+"\\s*"),b=new RegExp("\\s*"+Us(q[1])),v=new RegExp("\\s*"+Us("}"+q[1]))}w(e||de.tags);for(var _=new ri(t),k,A,B,G,j,X;!_.eos();){if(k=_.pos,B=_.scanUntil(h),B)for(var _t=0,Dt=B.length;_t<Dt;++_t)G=B.charAt(_t),Nv(G)?(s.push(i.length),l+=G):(c=!0,r=!0,l+=" "),i.push(["text",G,k,k+1]),k+=1,G===`
|
|
32
32
|
`&&(d(),l="",p=0,r=!1);if(!_.scan(h))break;if(o=!0,A=_.scan(Mv)||"name",_.scan(Pv),A==="="?(B=_.scanUntil(Sl),_.scan(Sl),_.scanUntil(b)):A==="{"?(B=_.scanUntil(v),_.scan(Lv),_.scanUntil(b),A="&"):B=_.scanUntil(b),!_.scan(b))throw new Error("Unclosed tag at "+_.pos);if(A==">"?j=[A,B,k,_.pos,l,p,r]:j=[A,B,k,_.pos],p++,i.push(j),A==="#"||A==="^")n.push(j);else if(A==="/"){if(X=n.pop(),!X)throw new Error('Unopened section "'+B+'" at '+k);if(X[1]!==B)throw new Error('Unclosed section "'+X[1]+'" at '+k)}else A==="name"||A==="{"||A==="&"?c=!0:A==="="&&w(B)}if(d(),X=n.pop(),X)throw new Error('Unclosed section "'+X[1]+'" at '+_.pos);return jv(Bv(i))}function Bv(t){for(var e=[],r,n,i=0,s=t.length;i<s;++i)r=t[i],r&&(r[0]==="text"&&n&&n[0]==="text"?(n[1]+=r[1],n[3]=r[3]):(e.push(r),n=r));return e}function jv(t){for(var e=[],r=e,n=[],i,s,o=0,c=t.length;o<c;++o)switch(i=t[o],i[0]){case"#":case"^":r.push(i),n.push(i),r=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],r=n.length>0?n[n.length-1][4]:e;break;default:r.push(i)}return e}function ri(t){this.string=t,this.tail=t,this.pos=0}ri.prototype.eos=function(){return this.tail===""};ri.prototype.scan=function(t){var e=this.tail.match(t);if(!e||e.index!==0)return"";var r=e[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};ri.prototype.scanUntil=function(t){var e=this.tail.search(t),r;switch(e){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,e),this.tail=this.tail.substring(e)}return this.pos+=r.length,r};function Zr(t,e){this.view=t,this.cache={".":this.view},this.parent=e}Zr.prototype.push=function(t){return new Zr(t,this)};Zr.prototype.lookup=function(t){var e=this.cache,r;if(e.hasOwnProperty(t))r=e[t];else{for(var n=this,i,s,o,c=!1;n;){if(t.indexOf(".")>0)for(i=n.view,s=t.split("."),o=0;i!=null&&o<s.length;)o===s.length-1&&(c=El(i,s[o])||Tv(i,s[o])),i=i[s[o++]];else i=n.view[t],c=El(n.view,t);if(c){r=i;break}n=n.parent}e[t]=r}return Na(r)&&(r=r.call(this.view)),r};function Jt(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}Jt.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Jt.prototype.parse=function(t,e){var r=this.templateCache,n=t+":"+(e||de.tags).join(":"),i=typeof r<"u",s=i?r.get(n):void 0;return s==null&&(s=Uv(t,e),i&&r.set(n,s)),s};Jt.prototype.render=function(t,e,r,n){var i=this.getConfigTags(n),s=this.parse(t,i),o=e instanceof Zr?e:new Zr(e,void 0);return this.renderTokens(s,o,r,t,n)};Jt.prototype.renderTokens=function(t,e,r,n,i){for(var s="",o,c,l,p=0,d=t.length;p<d;++p)l=void 0,o=t[p],c=o[0],c==="#"?l=this.renderSection(o,e,r,n,i):c==="^"?l=this.renderInverted(o,e,r,n,i):c===">"?l=this.renderPartial(o,e,r,i):c==="&"?l=this.unescapedValue(o,e):c==="name"?l=this.escapedValue(o,e,i):c==="text"&&(l=this.rawValue(o)),l!==void 0&&(s+=l);return s};Jt.prototype.renderSection=function(t,e,r,n,i){var s=this,o="",c=e.lookup(t[1]);function l(h){return s.render(h,e,r,i)}if(c){if(hn(c))for(var p=0,d=c.length;p<d;++p)o+=this.renderTokens(t[4],e.push(c[p]),r,n,i);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(t[4],e.push(c),r,n,i);else if(Na(c)){if(typeof n!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(e.view,n.slice(t[3],t[5]),l),c!=null&&(o+=c)}else o+=this.renderTokens(t[4],e,r,n,i);return o}};Jt.prototype.renderInverted=function(t,e,r,n,i){var s=e.lookup(t[1]);if(!s||hn(s)&&s.length===0)return this.renderTokens(t[4],e,r,n,i)};Jt.prototype.indentPartial=function(t,e,r){for(var n=e.replace(/[^ \t]/g,""),i=t.split(`
|
|
33
33
|
`),s=0;s<i.length;s++)i[s].length&&(s>0||!r)&&(i[s]=n+i[s]);return i.join(`
|
|
34
34
|
`)};Jt.prototype.renderPartial=function(t,e,r,n){if(r){var i=this.getConfigTags(n),s=Na(r)?r(t[1]):r[t[1]];if(s!=null){var o=t[6],c=t[5],l=t[4],p=s;c==0&&l&&(p=this.indentPartial(s,l,o));var d=this.parse(p,i);return this.renderTokens(d,e,r,p,n)}}};Jt.prototype.unescapedValue=function(t,e){var r=e.lookup(t[1]);if(r!=null)return r};Jt.prototype.escapedValue=function(t,e,r){var n=this.getConfigEscape(r)||de.escape,i=e.lookup(t[1]);if(i!=null)return typeof i=="number"&&n===de.escape?String(i):n(i)};Jt.prototype.rawValue=function(t){return t[1]};Jt.prototype.getConfigTags=function(t){return hn(t)?t:t&&typeof t=="object"?t.tags:void 0};Jt.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!hn(t))return t.escape};var de={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){qn.templateCache=t},get templateCache(){return qn.templateCache}},qn=new Jt;de.clearCache=function(){return qn.clearCache()};de.parse=function(t,e){return qn.parse(t,e)};de.render=function(t,e,r,n){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Cv(t)+'" was given as the first argument for mustache#render(template, view, partials)');return qn.render(t,e,r,n)};de.escape=kv;de.Scanner=ri;de.Context=Zr;de.Writer=Jt;var Ve=de,Wn=class Le{static DOCUMENT_STANDARD_MODE="CSS1Compat";static _instance;parentContainer;scalingFactor=1;doc=document;constructor(){}static get(){return Le._instance||(Le._instance=new Le),Le._instance}getWidth(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientWidth:document.compatMode===Le.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parentContainer.clientHeight:document.compatMode===Le.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}isMobile(){return window.CooeeSDK.uaParser.getDevice().type==="mobile"}calculateScalingFactor(e){let r=e.max,n=e.cont.w,i=e.cont.h,s=e.spc,o=Le.get().getWidth(),c=Le.get().getHeight();r&&(o=o?Math.min(o,r):r,c=c?Math.min(c,r):r),c&&(o-=s.getHorizontal(),c-=s.getVertical(),o/c<n/i?this.scalingFactor=o/n:this.scalingFactor=c/i,this.scalingFactor=Math.min(this.scalingFactor,1))}getScalingFactor(){return this.scalingFactor}createElement(e){return this.doc.createElement(e)}appendChild(e,r){e.appendChild(r)}setStyles(e,r){Object.assign(e.style,r)}setStyle(e,r,n){if(r){if(!n){e.style.removeProperty(r);return}e.style.setProperty(r,n,"important")}}setAttribute(e,r,n){e.setAttribute(r,n)}removeInApp(e){let r=document.querySelector(`.${e.rootClassName}`);r&&r.parentElement.removeChild(r)}setParentContainer(e){this.parentContainer=e,this.parentContainer&&this.isParentNotBody()&&this.setStyle(this.parentContainer,"position","relative")}isParentNotBody(){return this.parentContainer!==document.body}},$v="?from=cooee";function Oa(){return!!window.Shopify}function Fv(){if(Oa())return window.Shopify.shop?.split(".")?.[0]}function Hv(t){let e=(t.includes("://")?new URL(t).pathname:t).match(/\/products\/([^/]+?)(?:\.html)?$/);return e?e[1]:null}function Gi(){return window.Shopify?.routes?.root??"/"}function Bn(t){return Gi()+t+$v}var Vv=class{isLocked=!1;queue=[];async acquire(){if(this.isLocked)await new Promise(t=>this.queue.push(t));else{this.isLocked=!0;return}}release(){if(this.queue.length>0){let t=this.queue.shift();t&&t()}else this.isLocked=!1}},qv=class Lo{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&&!this.isInAppBrowser())return navigator.locks.request(e,r);let n=!1,i=0,s=Math.random().toString(36).substring(2,10);for(;i++<this.MAX_RETRIES&&(T.debug(`Lock retry ${i}`),n=await this.acquire(e,s),!n);)await this.sleep(Lo.RETRY_INTERVAL*i+Math.random()*100);try{return await r()}finally{this.release(e,s)}}static isInAppBrowser(){let e=navigator.userAgent||"",r=/iPhone|iPad|iPod/i.test(e),n=/(FBAV|FBAN|Instagram)/i.test(e);return r&&n}static async acquire(e,r){let n=Date.now(),i=localStorage.getItem(e),s=i?JSON.parse(i):null;if(s&&n<=s.expiry)return!1;let o={owner:r,expiry:n+Lo.LOCK_TIMEOUT};return localStorage.setItem(e,JSON.stringify(o)),await this.sleep(150+Math.random()*100),JSON.parse(localStorage.getItem(e)||"{}").owner===r?(T.debug(`${r}: Lock acquired!`),!0):(T.debug(`${r}: Race lost. Another tab acquired the lock.`),!1)}static release(e,r){let n=localStorage.getItem(e);if(!n)return;let i=JSON.parse(n);i.owner===r?(localStorage.removeItem(e),T.debug(`${r}: Lock released`)):T.debug(`${r}: Cannot release lock. Current owner: ${i.owner}`)}static sleep(e){return new Promise(r=>setTimeout(r,e))}},xt=class wh{static CURRENT;token;items;total_price;original_total_price;items_subtotal_price;currency;item_count;attributes;cart_level_discount_applications;lock=new Vv;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new wh),this.CURRENT}async getNormalisedCart(e){await this.fetchCartFromShopify(e);let r=this.convertToCooeeCart();return e&&await Lt.set(ot.CURRENT_CART,r),r}async addCooeeAttributes(){await this.lock.acquire();let e=await te.get(ot.ID),r=await Lt.get(ot.DEVICE_ID);if(this.attributes?.letscooee_did===r&&this.attributes?.letscooee_sid===e){T.debug("Not calling Shopify update.js API.","Current attributes:",this.attributes),this.lock.release();return}let n={letscooee_did:r,letscooee_sid:e,__letscooee_time:new Date().toLocaleString()};T.debug("Updating Shopify cart with attributes:",n);let i=Bn("cart/update.js"),s=await(await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:n})})).json();T.debug("Updated cart attributes",JSON.stringify(s)),this.update(s),this.lock.release()}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,Ot.get().currencyCode=this.currency,T.log("Updated ShopifyCart",this),this}toString(){return`ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}convertToCooeeCart(){return{amount:this.total_price/100,originalAmount:this.original_total_price/100,itemsSubtotalPrice:this.items_subtotal_price/100,currency:this.currency,itemCount:this.item_count,items:this.normaliseItems(this.items),token:this.token}}normaliseItems(e){if(!e)return T.error("No item received to be sent"),[];Array.isArray(e)||(e=[e]);let r=[];for(let n of e){if(!n.id||!n.title){T.warn("Invalid item received",n);continue}let i={name:n.title,quantity:+n.quantity||1,mID:n.product_id?.toString(),vID:n.id.toString(),price:+n.price/100||0,finalPrice:+n.final_price/100||0,properties:n.properties,key:n.key},s=n.selling_plan_allocation?.selling_plan;if(!s){r.push(i);continue}i.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:s.fixed_selling_plan,id:s.id,name:s.name,recurringDeliveries:s.recurring_deliveries}},r.push(i)}return r}async fetchCartFromShopify(e){if(!e&&this.token){T.debug("Not fetching cart");return}T.debug("Fetching cart");let r=Bn("cart.js"),n=await(await fetch(r)).json();this.update(n)}},Wv=class{id;mID;handle;title;imageURL;constructor(t){t??={},this.id=t.id,this.mID=t.mID,this.handle=t.handle,this.title=t.title,this.imageURL=t.imageURL}},Gv=class{enabled;constructor(t){this.enabled=t.enabled}},zv=class extends Gv{max;min;constructor(t){t??={},super(t),this.min=t.min,this.max=t.max}},Yv=class{productQuantity;constructor(t){t??={},this.productQuantity=new zv(t.productQuantity)}},ni=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(t){this.t=t.t,t.bg&&(this.bg=new Eu(t.bg)),t.br&&(this.br=new ra(t.br)),t.shd&&(this.shd=new qd(t.shd)),t.spc&&(this.spc=new ia(t.spc)),this.trf=new Iu(t.trf),this.clc=t.clc,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y,this.a=t.a}get alpha(){return this.a??100}get type(){return this.t}get typeAsString(){return ka[this.t]}get click(){return this.clc}},ka=(t=>(t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.FLEXBOX=4]="FLEXBOX",t[t.MULTI_COLUMN=5]="MULTI_COLUMN",t[t.CHECKBOX=6]="CHECKBOX",t[t.PRODUCTS=11]="PRODUCTS",t[t.PRODUCT=12]="PRODUCT",t[t.PRODUCT_IMAGE=13]="PRODUCT_IMAGE",t[t.PRODUCT_TITLE=14]="PRODUCT_TITLE",t[t.PRODUCT_VARIATIONS=15]="PRODUCT_VARIATIONS",t[t.PRODUCT_VARIATIONS_SELLING_PLANS=16]="PRODUCT_VARIATIONS_SELLING_PLANS",t[t.PRODUCT_BUTTON=18]="PRODUCT_BUTTON",t[t.PRODUCT_RATING=19]="PRODUCT_RATING",t[t.EMAIL_INPUT=51]="EMAIL_INPUT",t[t.PHONE_INPUT=52]="PHONE_INPUT",t[t.COUNTDOWN_TIMER=61]="COUNTDOWN_TIMER",t[t.CAROUSEL=62]="CAROUSEL",t[t.SHAPE=100]="SHAPE",t))(ka||{}),bh=class extends ni{constructor(t){super(t)}},Pa=class extends ni{src;constructor(t){super(t),this.src=t.src}},us=class extends ni{typo;constructor(t){super(t);let e=x(x({},t.f),t.typo);t.alg&&(e.ta=t.alg),t.c&&(e.tc=t.c),this.typo=new We(e)}get color(){return this.typography.tc}get typography(){return this.typo}},Mo=class extends us{prs;constructor(t){super(t),this.prs=t.prs}get parts(){return this.prs}},Kv=class extends ni{o;constructor(t){super(t),this.o=t.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}},_h=class{dd;hh;mm;ss;date;constructor(t){t??={},this.dd=t.dd??0,this.hh=t.hh??0,this.mm=t.mm??0,this.ss=t.ss??0,this.date=t.date?new Date(t.date):void 0}start(t,e){let r=new Date;t===2?(r.setSeconds(r.getSeconds()+this.ss),r.setMinutes(r.getMinutes()+this.mm),r.setHours(r.getHours()+this.hh),r.setDate(r.getDate()+this.dd)):r=this.date??new Date;let n=window.setInterval(()=>{let i=new Date().getTime(),s=r.getTime()-i;if(s<1){clearInterval(n);return}let o=Math.floor(s/(1e3*60*60*24)),c=Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),l=Math.floor(s%(1e3*60*60)/(1e3*60)),p=Math.floor(s%(1e3*60)/1e3);e({days:o,hours:c,minutes:l,seconds:p})},1e3);return n}},Eh=class extends us{gap;timer;timerType;horizontal;lblPos;show;constructor(t){t??={},super(t),this.gap=t.gap,this.timerType=t.type,this.timer=new _h(t.timer),this.show=t.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=t.horizontal,this.lblPos=t.lblPos}},Jv=class{txt;c;constructor(t){t??={},this.txt=t.txt,this.c=new re(t.c??{})}get text(){return this.txt}get color(){return this.c}},Ra=class extends us{ph;constructor(t){super(t),this.ph=new Jv(t.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}},Sh=class extends Ra{constructor(t){t??={},super(t)}},Ih=class extends Ra{},Ch=class extends Ra{},Th=class extends Pa{},hs=(t=>(t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=3]="HIGH",t))(hs||{}),Xv=class{en;ex;constructor(t){t=t??{},this.en=t.en,this.ex=t.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[]}}},Il=class extends ni{gvt;max;cover;anim;embedded;position;constructor(t){t=t??{},super(t),this.gvt=t.gvt??5,this.max=t.max,this.cover=t.cover??!0,this.anim=new Xv(t.anim),this.embedded=t.embedded,this.position=t.position??1,this.spc||(this.spc=new ia({pl:H.IN_APP_DEFAULT_PADDING,pr:H.IN_APP_DEFAULT_PADDING,pt:H.IN_APP_DEFAULT_PADDING,pb:H.IN_APP_DEFAULT_PADDING}))}isEmbedded(){return this.position===2&&!!this.embedded}getEmbeddedSelector(){return`.letscooee-engagement.container-${this.embedded}`}},Qv=class extends Il{cont;elems=[];mob;constructor(t){t=t??{},super(t),this.cont=new Kv(t.cont),this.mob=new Il(t.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),t.elems.forEach(e=>{e.t===1?this.elems.push(new Pa(e)):e.t===2?this.elems.push(new Mo(e)):e.t===3?this.elems.push(new Mo(e)):e.t===100?this.elems.push(new bh(e)):e.t===51?this.elems.push(new Ih(e)):e.t===52?this.elems.push(new Ch(e)):e.t===61?this.elems.push(new Eh(e)):e.t===15||e.t===16?this.elems.push(new Sh(e)):e.t===13&&this.elems.push(new Th(e))})}getStylesForWrapper(){if(this.cover)return{};let t;return this.gvt===1?t={top:0,left:0}:this.gvt===2?t={top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===3?t={top:0,right:0}:this.gvt===6?t={top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===9?t={bottom:0,right:0}:this.gvt===8?t={bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===7?t={bottom:0,left:0}:this.gvt===4?t={top:"50%",left:0,transform:"translateY(-50%)"}:t={top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},t.overflow="visible",t}getFlexStylesForContainer(){let t={display:"flex",flexDirection:"row"},e,r;return this.gvt===1?(e="flex-start",r="flex-start"):this.gvt===2?(e="center",r="flex-start"):this.gvt===3?(e="flex-end",r="flex-start"):this.gvt===4?(e="flex-start",r="center"):this.gvt===6?(e="flex-end",r="center"):this.gvt===7?(e="flex-start",r="flex-end"):this.gvt===8?(e="center",r="flex-end"):this.gvt===9?(e="flex-end",r="flex-end"):(e="center",r="center"),t.alignItems=r,t.justifyContent=e,t.overflow="visible",t}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,this.position=this.mob.position??this.position,this.embedded=this.mob.embedded??this.embedded}},xh=class{gap;dir;wrap;jc;ai;scroll;constructor(t){t??={},this.gap=t.gap??0,this.dir=t.dir??"row",this.wrap=t.wrap??"nowrap",this.jc=t.jc??"flex-start",this.ai=t.ai??"flex-start",this.scroll=t.scroll}},Zv=class{of;disp;pos;top;bottom;left;right;zIndex;constructor(t){t??={},this.of=t.of,this.disp=t.disp,this.pos=t.pos,this.top=t.top,this.bottom=t.bottom,this.left=t.left,this.right=t.right,this.zIndex=t.zIndex}},tw=class{w;h;maxW;maxH;minW;minH;constructor(t){t??={},this.w=t.w??"100%",this.h=t.h??"auto",this.maxW=t.maxW,this.maxH=t.maxH,this.minW=t.minW,this.minH=t.minH}},Cl=class{size;bg;br;spc;typo;lout;flex;constructor(t){t??={},this.spc=new ia(t.spc),t.size&&(this.size=new tw(t.size)),t.bg&&(this.bg=new Eu(t.bg)),t.br&&(this.br=new ra(t.br)),t.typo&&(this.typo=new We(t.typo)),t.lout&&(this.lout=new Zv(t.lout)),t.flex&&(this.flex=new xh(t.flex))}},Dh=class{sm;lg;constructor(t){t??={},this.sm=new Cl(t.sm),this.lg=new Cl(t.lg)}},lr=class{t;style;hide;when;clc;constructor(t,e){e??={},this.t=t,this.style=new Dh(e.style),this.hide=e.hide,e.when?.op&&(this.when=e.when),e.clc&&(this.clc=e.clc)}get stringType(){return ka[this.t]}},Ne=class extends lr{text;constructor(t,e){t?.style?.lg?.typo?.s&&delete t.style.lg.typo.s,t?.style?.sm?.typo?.s&&delete t.style.sm.typo.s,super(e??2,t),t??={},this.text=t.text}},Uo=class extends Ne{constructor(t,e){super(t,e??3)}},Ah=class extends lr{value;constructor(t){super(6,t),t??={},this.value=t.value}},Nh=class extends Ne{showChips;optionsConfig;constructor(t=15,e){super(e,t),e??={},this.showChips=e.showChips??!1,this.optionsConfig=e.optionsConfig??{}}},ew=class extends lr{c;iconSize;showSingleStar;fullStar;halfStart;constructor(t){super(19,t),t??={},this.c=new re(t.c),this.iconSize=t.iconSize??24,this.showSingleStar=t.showSingleStar??!1,this.fullStar=t.fullStar,this.halfStart=t.halfStart}},rw=ke(sn()),nw=class{enabled;type;color;constructor(t){t??={},this.enabled=t.enabled,this.type=t.type,this.color=new re(t.color)}},iw=class{size;enabled;color;constructor(t){t??={},this.enabled=t.enabled,this.size=t.size,this.color=new re(t.color)}},Oh=class{navigation;pagination;autoplay;maxInRow;gap;slidesPerView;constructor(t){t??={},this.navigation=new iw(t.navigation),this.pagination=new nw(t.pagination),this.autoplay=t.autoplay,this.slidesPerView=t.slidesPerView??1,this.maxInRow=t.maxInRow??t.slidesPerView??4,this.gap=t.gap??0}},sw=class extends lr{conf;slide;formData;values;allowedTypes;constructor(t){super(62,t),t&&this.update(t)}update(t){t??={},this.slide=tn.getParsedElement(t.slide),this.formData=t.formData,this.values=t.values,this.conf=new Oh(t.conf),this.allowedTypes=t.allowedTypes}},ow=class extends Ne{gap;timer;timerType;horizontal;lblPos;show;constructor(t){t??={},super(t,61),this.gap=t.gap,this.timerType=t.type,this.timer=new _h(t.timer),this.show=t.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=t.horizontal,this.lblPos=t.lblPos}},La=class extends lr{elems;constructor(t){super(4,t),this.update(t)}update(t){t??={},this.elems??=[],t.elems?.forEach(e=>{let r=tn.getParsedElement(e);r&&this.elems.push(r)})}},Bo=class extends lr{src;sm;lg;constructor(t,e){super(e??1,t),t&&this.update(t)}update(t){this.src=t.src,this.sm=t.sm,this.lg=t.lg}},tn=class kh{static getParsedElements(e){let r=[];return e?.forEach(n=>{let i=kh.getParsedElement(n);i&&r.push(i)}),r}static getParsedElement(e){switch(e.t){case 2:return new Ne(e);case 3:return new Uo(e);case 6:return new Ah(e);case 11:return new aw(e);case 12:return new Ma(e);case 61:return new ow(e);case 4:return new La(e);case 1:return new Bo(e);case 13:return new Bo(e,13);case 14:return new Ne(e,14);case 15:case 16:return new Nh(e.t,e);case 18:return new Uo(e,18);case 62:return new sw(e);case 19:return new ew(e);default:rw.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"}}},Ma=class extends lr{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(t){if(t??={},super(12,t),this.show=t.show,this.elems=tn.getParsedElements(t.elems),this.noLinks=t.noLinks,!this.elems.length){t.cBox&&this.elems.push(new Ah(t.cBox)),this.elems.push(new Bo(t.img,13));let e=new Ne(t.title,14);e.hide=!t.show?.title,e.text="{{ product.name }}",this.elems.push(e);let r=new Ne(t.price);r.text="{{ product.price }}",r.hide=!t.show?.price;let n=new Ne(t.compareAt);n.text="{{ product.compare_price }}",n.hide=!t.show?.price,t.compareAt||(n.style=new Dh(r.style),n.style.lg.typo=new We(yt(x({},n.style.lg.typo),{td:"line-through"})),n.style.sm.typo=new We(yt(x({},n.style.sm.typo),{td:"line-through"})));let i=new La({style:{lg:{spc:{mb:10},flex:{dir:"row",gap:10,ai:"center",jc:tn.parseAlignmentToJustifyContent(r.style.lg.typo?.ta)}}}});i.elems.push(n),i.elems.push(r),this.elems.push(i);let s=new Nh(15,t.variantDD);if(s.hide=!t.show?.variantDD,this.elems.push(s),t.btn){let o=new Uo(t.btn,18);o.hide=!t.show?.btn,this.elems.push(o)}}t.symbol&&(this.symbol=new Ne(t.symbol))}},aw=class extends lr{conf;prod;constructor(t){super(11,t),t??={},this.conf=new cw(t.conf),this.prod=new Ma(t.prod)}},Tl=class extends Oh{disp;maxItems;constructor(t){t??={},super(t),this.disp=t.disp,this.maxItems=t.maxItems}},cw=class{lg;sm;constructor(t){t??={},this.lg=new Tl(t.lg),this.sm=new Tl(t.sm)}},lw=class extends La{constructor(t){super(t)}},Ph=class{cont;elems=[];constructor(t){t=t??{},this.cont=new lw(t.cont),t.elems?.forEach(e=>{this.addRawElement(e)})}addRawElement(t){let e=tn.getParsedElement(t);return e&&this.elems.push(e),e}},uw=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(t){this.shortID=t.shortID,this.contentType=t.contentType,this.engagementID=t.engagementID,this.delay=t.delay??0,this.redirectBehaviour=t.redirectBehaviour,this.onsiteDeliveryType=t.onsiteDeliveryType,this.objective=t.objective}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===Ai.EXCLUSION}isABTesting(){return this.contentType===Ai.ABTESTING}isSingleContent(){return this.contentType===Ai.SINGLE}},Rh=class{videoConfig;constructor(t){t??={},t.videoConfig&&(this.videoConfig=new Sv(t.videoConfig))}},Ar=class Lh extends uw{static SWIPER_ELEMENTS=new Set([11,62]);nudgeID;contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;stickyATCConfig;bundleConfig;content;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;experimentConfig;discountData=Dr({});constructor(e){super(e),this.id=e.id,this.nudgeID=e.nudgeID,this.currency=Ot.get().currencyCode??"USD",this.contentID=e.contentID,this.variation=e.variation,e.widget&&(this.widget=new Ph(e.widget)),this.previewType=e.previewType,this.occurred=e.occurred??new Date,this.props=e.props,this.embeddedItems=e.embeddedItems?.map(r=>new on(r)),this.items=e.items?.map(r=>new He(r))??[],this.nonMutableItems=e.items?.map(r=>new He(r))??[],this.collections=e.collections?.map(r=>new Wv(r))??[],this.discount=e.discount,this.placement=e.placement,this.customerData=e.customerData,this.ian=e.ian?this.processPopup(e.ian):void 0,this.promotionType=e.promotionType,this.manipulation=new Yv(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 zd(e.experimentConfig)),e.progressBarConfig&&(this.progressBarConfig=new Kd(e.progressBarConfig)),e.bundleConfig&&(this.bundleConfig=new Ud(e.bundleConfig)),e.bundleFrom&&(this.bundleFrom=new He(e.bundleFrom)),e.content&&(this.content=new Rh(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===Re.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===lo.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===lo.PAGE_EMBED}isProgressBar(){return this.objective===Re.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===Re.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===Re.CART_RECOVERY}isProductPromotion(){return this.objective===Re.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isCollectionPromoted(){return this.isProductPromotion()&&this.collections.length>0&&this.promotionType===yu.COLLECTION}isBYOB(){return this.objective===Re.BYOB}isStickyATC(){return this.objective===Re.STICKY_ATC}isShoppableVideo(){return this.objective===Re.SHOPPABLE_VIDEO}processPopup(e){let r=JSON.stringify(e),n=this.items[0],i={},s={};if(n){let l=n.selectedOrFirstVariant.value;i={name:n.name,id:n.mID,link:n.link,vID:l.mID,image:n.variantImage,price:De(l.price.d),comparePrice:De(l.price.cmp),quantity:n.quantity},s={quantity:l.quantity}}let o={productCount:xt.getCurrent().item_count},c=Ve.render(r,{product:i,variant:s,cart:o,discount:this.discount,customer:this.customerData});return n&&(c=c.replace(new RegExp(H.PLACEHOLDER_IMAGE,"gi"),n.variantImage??n.imageURL)),new Qv(JSON.parse(c))}calculateDiscountData(e,r){let n=Ni.sum(e,o=>o.selectedOrFirstVariant.value.price.d),i=Ni.sum(e,o=>{let c=o.selectedOrFirstVariant.value.price;return c.cmp??c.d}),s={actualPrice:n,totalComparePrice:i,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!e?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(s);return}if(ge.BXGY===this.discount.type&&this.discount.values?.length)s.discountPercentage=this.discount.values[0],this.updateEffectivePrice(e,s.discountPercentage,!0),s.discountAmount=s.actualPrice-Ni.sum(e,o=>o.selectedOrFirstVariant.value.effectivePrice.value);else if([ge.UNIQUE_FLAT_ITEMS,ge.STATIC,ge.UNIQUE_FLAT].includes(this.discount.type)&&this.discount.values?.length)s.discountPercentage=this.discount.values[0],s.discountAmount=s.actualPrice*s.discountPercentage/100,this.updateEffectivePrice(e,s.discountPercentage);else if(this.discount.type===ge.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)s.discountAmount=s.actualPrice-this.discount.values[0],s.discountPercentage=s.discountAmount/s.actualPrice*100,this.updateEffectivePrice(e,s.discountPercentage);else if(this.discount.type===ge.UNIQUE_CHEAPEST_ITEM_FREE){e.sort((c,l)=>l.selectedOrFirstVariant.value.price.d-c.selectedOrFirstVariant.value.price.d);let o=e[e.length-1];o.selectedOrFirstVariant.value.effectivePrice.value=0,s.discountAmount=o.selectedOrFirstVariant.value.price.d,s.discountPercentage=s.discountAmount/s.actualPrice*100}s.discountedPrice=s.actualPrice-s.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(s)}getPrivateAttributesForLineItem(){return ne.get().skipItemAttribute?{}:{[H.VIA]:"Cooee",[H.CAMPAIGN_ATTRIBUTE]:this.shortID,[H.CONTENT_ATTRIBUTE]:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return ne.get().skipItemAttribute?[]:[{key:H.VIA,value:"Cooee"},{key:H.CAMPAIGN_ATTRIBUTE,value:this.shortID},{key:H.CONTENT_ATTRIBUTE,value:this.contentID}]}isBundleDiscount(){return[ge.UNIQUE_FIXED_ITEMS,ge.UNIQUE_FLAT_ITEMS].includes(this.discount.type)}isBundleOnCartDrawer(){return this.isBundle()&&this.isCartEmbed()}isBundleOnPDP(){return this.isPageEmbed()&&this.isBundle()}hasSwiperElement(){let e=this.widget?.elems.find(n=>Lh.SWIPER_ELEMENTS.has(n.t));if(!e)return!1;if(e.t===62)return!0;let r=Wn.get().isMobile()?"sm":"lg";return e.conf[r].disp===2}toString(){return`Engagement(id=${this.shortID})`}getCartMagicVariables(){let e=xt.getCurrent();return{productCount:e.item_count,amount:De(e.total_price/100),originalAmount:De(e.original_total_price/100)}}updateEffectivePrice(e,r,n=!1){let i=Ot.get().getCurrentItem();e.forEach(s=>{let o=s.selectedOrFirstVariant.value,c=o.price;if(n&&s.mID===i.mID)o.effectivePrice.value=c.d;else{let l=c.d*r/100;o.effectivePrice.value=c.d-l}})}formatCurrencyAndNumber(e){if(!e)return{};let r={discountPercentage:tv(e.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice","totalComparePrice"].map(n=>{r[n]=De(e[n])}),r}};function hw(t,e){return e={exports:{}},t(e,e.exports),e.exports}var pw=mw,dw=vw,fw=_w,Ae=[],ue=[],gw=typeof Uint8Array<"u"?Uint8Array:Array,Bs="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pr=0,xl=Bs.length;pr<xl;++pr)Ae[pr]=Bs[pr],ue[Bs.charCodeAt(pr)]=pr;var pr,xl;ue[45]=62;ue[95]=63;function Mh(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 mw(t){var e=Mh(t),r=e[0],n=e[1];return(r+n)*3/4-n}function yw(t,e,r){return(e+r)*3/4-r}function vw(t){var e,r=Mh(t),n=r[0],i=r[1],s=new gw(yw(t,n,i)),o=0,c=i>0?n-4:n,l;for(l=0;l<c;l+=4)e=ue[t.charCodeAt(l)]<<18|ue[t.charCodeAt(l+1)]<<12|ue[t.charCodeAt(l+2)]<<6|ue[t.charCodeAt(l+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=ue[t.charCodeAt(l)]<<2|ue[t.charCodeAt(l+1)]>>4,s[o++]=e&255),i===1&&(e=ue[t.charCodeAt(l)]<<10|ue[t.charCodeAt(l+1)]<<4|ue[t.charCodeAt(l+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function ww(t){return Ae[t>>18&63]+Ae[t>>12&63]+Ae[t>>6&63]+Ae[t&63]}function bw(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(ww(n));return i.join("")}function _w(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,c=r-n;o<c;o+=s)i.push(bw(t,o,o+s>c?c:o+s));return n===1?(e=t[r-1],i.push(Ae[e>>2]+Ae[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Ae[e>>10]+Ae[e>>4&63]+Ae[e<<2&63]+"=")),i.join("")}var js={byteLength:pw,toByteArray:dw,fromByteArray:fw},Ew=function(t,e,r,n,i){var s,o,c=i*8-n-1,l=(1<<c)-1,p=l>>1,d=-7,h=r?i-1:0,b=r?-1:1,v=t[e+h];for(h+=b,s=v&(1<<-d)-1,v>>=-d,d+=c;d>0;s=s*256+t[e+h],h+=b,d-=8);for(o=s&(1<<-d)-1,s>>=-d,d+=n;d>0;o=o*256+t[e+h],h+=b,d-=8);if(s===0)s=1-p;else{if(s===l)return o?NaN:(v?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-p}return(v?-1:1)*o*Math.pow(2,s-n)},Sw=function(t,e,r,n,i,s){var o,c,l,p=s*8-i-1,d=(1<<p)-1,h=d>>1,b=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:s-1,w=n?1:-1,_=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,o=d):(o=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+h>=1?e+=b/l:e+=b*Math.pow(2,1-h),e*l>=2&&(o++,l/=2),o+h>=d?(c=0,o=d):o+h>=1?(c=(e*l-1)*Math.pow(2,i),o=o+h):(c=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+v]=c&255,v+=w,c/=256,i-=8);for(o=o<<i|c,p+=i;p>0;t[r+v]=o&255,v+=w,o/=256,p-=8);t[r+v-w]|=_*128},Ur={read:Ew,write:Sw},ps=hw(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=A,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.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 i(){try{var a=new Uint8Array(1),u={foo:function(){return 42}};return Object.setPrototypeOf(u,Uint8Array.prototype),Object.setPrototypeOf(a,u),a.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(a){if(a>n)throw new RangeError('The value "'+a+'" is invalid for option "size"');var u=new Uint8Array(a);return Object.setPrototypeOf(u,o.prototype),u}function o(a,u,f){if(typeof a=="number"){if(typeof u=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return d(a)}return c(a,u,f)}o.poolSize=8192;function c(a,u,f){if(typeof a=="string")return h(a,u);if(ArrayBuffer.isView(a))return v(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a));if(ae(a,ArrayBuffer)||a&&ae(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ae(a,SharedArrayBuffer)||a&&ae(a.buffer,SharedArrayBuffer)))return w(a,u,f);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var E=a.valueOf&&a.valueOf();if(E!=null&&E!==a)return o.from(E,u,f);var D=_(a);if(D)return D;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return o.from(a[Symbol.toPrimitive]("string"),u,f);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a))}o.from=function(a,u,f){return c(a,u,f)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function l(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function p(a,u,f){return l(a),a<=0?s(a):u!==void 0?typeof f=="string"?s(a).fill(u,f):s(a).fill(u):s(a)}o.alloc=function(a,u,f){return p(a,u,f)};function d(a){return l(a),s(a<0?0:k(a)|0)}o.allocUnsafe=function(a){return d(a)},o.allocUnsafeSlow=function(a){return d(a)};function h(a,u){if((typeof u!="string"||u==="")&&(u="utf8"),!o.isEncoding(u))throw new TypeError("Unknown encoding: "+u);var f=B(a,u)|0,E=s(f),D=E.write(a,u);return D!==f&&(E=E.slice(0,D)),E}function b(a){for(var u=a.length<0?0:k(a.length)|0,f=s(u),E=0;E<u;E+=1)f[E]=a[E]&255;return f}function v(a){if(ae(a,Uint8Array)){var u=new Uint8Array(a);return w(u.buffer,u.byteOffset,u.byteLength)}return b(a)}function w(a,u,f){if(u<0||a.byteLength<u)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<u+(f||0))throw new RangeError('"length" is outside of buffer bounds');var E;return u===void 0&&f===void 0?E=new Uint8Array(a):f===void 0?E=new Uint8Array(a,u):E=new Uint8Array(a,u,f),Object.setPrototypeOf(E,o.prototype),E}function _(a){if(o.isBuffer(a)){var u=k(a.length)|0,f=s(u);return f.length===0||a.copy(f,0,0,u),f}if(a.length!==void 0)return typeof a.length!="number"||fn(a.length)?s(0):b(a);if(a.type==="Buffer"&&Array.isArray(a.data))return b(a.data)}function k(a){if(a>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return a|0}function A(a){return+a!=a&&(a=0),o.alloc(+a)}o.isBuffer=function(a){return a!=null&&a._isBuffer===!0&&a!==o.prototype},o.compare=function(a,u){if(ae(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),ae(u,Uint8Array)&&(u=o.from(u,u.offset,u.byteLength)),!o.isBuffer(a)||!o.isBuffer(u))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===u)return 0;for(var f=a.length,E=u.length,D=0,M=Math.min(f,E);D<M;++D)if(a[D]!==u[D]){f=a[D],E=u[D];break}return f<E?-1:E<f?1:0},o.isEncoding=function(a){switch(String(a).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}},o.concat=function(a,u){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(a.length===0)return o.alloc(0);var f;if(u===void 0)for(u=0,f=0;f<a.length;++f)u+=a[f].length;var E=o.allocUnsafe(u),D=0;for(f=0;f<a.length;++f){var M=a[f];if(ae(M,Uint8Array))D+M.length>E.length?o.from(M).copy(E,D):Uint8Array.prototype.set.call(E,M,D);else if(o.isBuffer(M))M.copy(E,D);else throw new TypeError('"list" argument must be an Array of Buffers');D+=M.length}return E};function B(a,u){if(o.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||ae(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(a));var f=a.length,E=arguments.length>2&&arguments[2]===!0;if(!E&&f===0)return 0;for(var D=!1;;)switch(u){case"ascii":case"latin1":case"binary":return f;case"utf8":case"utf-8":return dn(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return f*2;case"hex":return f>>>1;case"base64":return hi(a).length;default:if(D)return E?-1:dn(a).length;u=(""+u).toLowerCase(),D=!0}}o.byteLength=B;function G(a,u,f){var E=!1;if((u===void 0||u<0)&&(u=0),u>this.length||((f===void 0||f>this.length)&&(f=this.length),f<=0)||(f>>>=0,u>>>=0,f<=u))return"";for(a||(a="utf8");;)switch(a){case"hex":return Gt(this,u,f);case"utf8":case"utf-8":return kt(this,u,f);case"ascii":return Wt(this,u,f);case"latin1":case"binary":return ft(this,u,f);case"base64":return lt(this,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return st(this,u,f);default:if(E)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),E=!0}}o.prototype._isBuffer=!0;function j(a,u,f){var E=a[u];a[u]=a[f],a[f]=E}o.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var u=0;u<a;u+=2)j(this,u,u+1);return this},o.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var u=0;u<a;u+=4)j(this,u,u+3),j(this,u+1,u+2);return this},o.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var u=0;u<a;u+=8)j(this,u,u+7),j(this,u+1,u+6),j(this,u+2,u+5),j(this,u+3,u+4);return this},o.prototype.toString=function(){var a=this.length;return a===0?"":arguments.length===0?kt(this,0,a):G.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(a){if(!o.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:o.compare(this,a)===0},o.prototype.inspect=function(){var a="",u=e.INSPECT_MAX_BYTES;return a=this.toString("hex",0,u).replace(/(.{2})/g,"$1 ").trim(),this.length>u&&(a+=" ... "),"<Buffer "+a+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(a,u,f,E,D){if(ae(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),!o.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(a));if(u===void 0&&(u=0),f===void 0&&(f=a?a.length:0),E===void 0&&(E=0),D===void 0&&(D=this.length),u<0||f>a.length||E<0||D>this.length)throw new RangeError("out of range index");if(E>=D&&u>=f)return 0;if(E>=D)return-1;if(u>=f)return 1;if(u>>>=0,f>>>=0,E>>>=0,D>>>=0,this===a)return 0;for(var M=D-E,Y=f-u,ut=Math.min(M,Y),Nt=this.slice(E,D),gt=a.slice(u,f),St=0;St<ut;++St)if(Nt[St]!==gt[St]){M=Nt[St],Y=gt[St];break}return M<Y?-1:Y<M?1:0};function X(a,u,f,E,D){if(a.length===0)return-1;if(typeof f=="string"?(E=f,f=0):f>2147483647?f=2147483647:f<-2147483648&&(f=-2147483648),f=+f,fn(f)&&(f=D?0:a.length-1),f<0&&(f=a.length+f),f>=a.length){if(D)return-1;f=a.length-1}else if(f<0)if(D)f=0;else return-1;if(typeof u=="string"&&(u=o.from(u,E)),o.isBuffer(u))return u.length===0?-1:_t(a,u,f,E,D);if(typeof u=="number")return u=u&255,typeof Uint8Array.prototype.indexOf=="function"?D?Uint8Array.prototype.indexOf.call(a,u,f):Uint8Array.prototype.lastIndexOf.call(a,u,f):_t(a,[u],f,E,D);throw new TypeError("val must be string, number or Buffer")}function _t(a,u,f,E,D){var M=1,Y=a.length,ut=u.length;if(E!==void 0&&(E=String(E).toLowerCase(),E==="ucs2"||E==="ucs-2"||E==="utf16le"||E==="utf-16le")){if(a.length<2||u.length<2)return-1;M=2,Y/=2,ut/=2,f/=2}function Nt(gn,mn){return M===1?gn[mn]:gn.readUInt16BE(mn*M)}var gt;if(D){var St=-1;for(gt=f;gt<Y;gt++)if(Nt(a,gt)===Nt(u,St===-1?0:gt-St)){if(St===-1&&(St=gt),gt-St+1===ut)return St*M}else St!==-1&&(gt-=gt-St),St=-1}else for(f+ut>Y&&(f=Y-ut),gt=f;gt>=0;gt--){for(var Ut=!0,hr=0;hr<ut;hr++)if(Nt(a,gt+hr)!==Nt(u,hr)){Ut=!1;break}if(Ut)return gt}return-1}o.prototype.includes=function(a,u,f){return this.indexOf(a,u,f)!==-1},o.prototype.indexOf=function(a,u,f){return X(this,a,u,f,!0)},o.prototype.lastIndexOf=function(a,u,f){return X(this,a,u,f,!1)};function Dt(a,u,f,E){f=Number(f)||0;var D=a.length-f;E?(E=Number(E),E>D&&(E=D)):E=D;var M=u.length;E>M/2&&(E=M/2);for(var Y=0;Y<E;++Y){var ut=parseInt(u.substr(Y*2,2),16);if(fn(ut))return Y;a[f+Y]=ut}return Y}function q(a,u,f,E){return Lr(dn(u,a.length-f),a,f,E)}function rt(a,u,f,E){return Lr(Ss(u),a,f,E)}function Q(a,u,f,E){return Lr(hi(u),a,f,E)}function tt(a,u,f,E){return Lr(Is(u,a.length-f),a,f,E)}o.prototype.write=function(a,u,f,E){if(u===void 0)E="utf8",f=this.length,u=0;else if(f===void 0&&typeof u=="string")E=u,f=this.length,u=0;else if(isFinite(u))u=u>>>0,isFinite(f)?(f=f>>>0,E===void 0&&(E="utf8")):(E=f,f=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var D=this.length-u;if((f===void 0||f>D)&&(f=D),a.length>0&&(f<0||u<0)||u>this.length)throw new RangeError("Attempt to write outside buffer bounds");E||(E="utf8");for(var M=!1;;)switch(E){case"hex":return Dt(this,a,u,f);case"utf8":case"utf-8":return q(this,a,u,f);case"ascii":case"latin1":case"binary":return rt(this,a,u,f);case"base64":return Q(this,a,u,f);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return tt(this,a,u,f);default:if(M)throw new TypeError("Unknown encoding: "+E);E=(""+E).toLowerCase(),M=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function lt(a,u,f){return u===0&&f===a.length?js.fromByteArray(a):js.fromByteArray(a.slice(u,f))}function kt(a,u,f){f=Math.min(a.length,f);for(var E=[],D=u;D<f;){var M=a[D],Y=null,ut=M>239?4:M>223?3:M>191?2:1;if(D+ut<=f){var Nt,gt,St,Ut;switch(ut){case 1:M<128&&(Y=M);break;case 2:Nt=a[D+1],(Nt&192)===128&&(Ut=(M&31)<<6|Nt&63,Ut>127&&(Y=Ut));break;case 3:Nt=a[D+1],gt=a[D+2],(Nt&192)===128&&(gt&192)===128&&(Ut=(M&15)<<12|(Nt&63)<<6|gt&63,Ut>2047&&(Ut<55296||Ut>57343)&&(Y=Ut));break;case 4:Nt=a[D+1],gt=a[D+2],St=a[D+3],(Nt&192)===128&&(gt&192)===128&&(St&192)===128&&(Ut=(M&15)<<18|(Nt&63)<<12|(gt&63)<<6|St&63,Ut>65535&&Ut<1114112&&(Y=Ut))}}Y===null?(Y=65533,ut=1):Y>65535&&(Y-=65536,E.push(Y>>>10&1023|55296),Y=56320|Y&1023),E.push(Y),D+=ut}return jt(E)}var At=4096;function jt(a){var u=a.length;if(u<=At)return String.fromCharCode.apply(String,a);for(var f="",E=0;E<u;)f+=String.fromCharCode.apply(String,a.slice(E,E+=At));return f}function Wt(a,u,f){var E="";f=Math.min(a.length,f);for(var D=u;D<f;++D)E+=String.fromCharCode(a[D]&127);return E}function ft(a,u,f){var E="";f=Math.min(a.length,f);for(var D=u;D<f;++D)E+=String.fromCharCode(a[D]);return E}function Gt(a,u,f){var E=a.length;(!u||u<0)&&(u=0),(!f||f<0||f>E)&&(f=E);for(var D="",M=u;M<f;++M)D+=Cs[a[M]];return D}function st(a,u,f){for(var E=a.slice(u,f),D="",M=0;M<E.length-1;M+=2)D+=String.fromCharCode(E[M]+E[M+1]*256);return D}o.prototype.slice=function(a,u){var f=this.length;a=~~a,u=u===void 0?f:~~u,a<0?(a+=f,a<0&&(a=0)):a>f&&(a=f),u<0?(u+=f,u<0&&(u=0)):u>f&&(u=f),u<a&&(u=a);var E=this.subarray(a,u);return Object.setPrototypeOf(E,o.prototype),E};function et(a,u,f){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+u>f)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,u,f){a=a>>>0,u=u>>>0,f||et(a,u,this.length);for(var E=this[a],D=1,M=0;++M<u&&(D*=256);)E+=this[a+M]*D;return E},o.prototype.readUintBE=o.prototype.readUIntBE=function(a,u,f){a=a>>>0,u=u>>>0,f||et(a,u,this.length);for(var E=this[a+--u],D=1;u>0&&(D*=256);)E+=this[a+--u]*D;return E},o.prototype.readUint8=o.prototype.readUInt8=function(a,u){return a=a>>>0,u||et(a,1,this.length),this[a]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(a,u){return a=a>>>0,u||et(a,2,this.length),this[a]|this[a+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(a,u){return a=a>>>0,u||et(a,2,this.length),this[a]<<8|this[a+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(a,u){return a=a>>>0,u||et(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(a,u){return a=a>>>0,u||et(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},o.prototype.readIntLE=function(a,u,f){a=a>>>0,u=u>>>0,f||et(a,u,this.length);for(var E=this[a],D=1,M=0;++M<u&&(D*=256);)E+=this[a+M]*D;return D*=128,E>=D&&(E-=Math.pow(2,8*u)),E},o.prototype.readIntBE=function(a,u,f){a=a>>>0,u=u>>>0,f||et(a,u,this.length);for(var E=u,D=1,M=this[a+--E];E>0&&(D*=256);)M+=this[a+--E]*D;return D*=128,M>=D&&(M-=Math.pow(2,8*u)),M},o.prototype.readInt8=function(a,u){return a=a>>>0,u||et(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},o.prototype.readInt16LE=function(a,u){a=a>>>0,u||et(a,2,this.length);var f=this[a]|this[a+1]<<8;return f&32768?f|4294901760:f},o.prototype.readInt16BE=function(a,u){a=a>>>0,u||et(a,2,this.length);var f=this[a+1]|this[a]<<8;return f&32768?f|4294901760:f},o.prototype.readInt32LE=function(a,u){return a=a>>>0,u||et(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},o.prototype.readInt32BE=function(a,u){return a=a>>>0,u||et(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},o.prototype.readFloatLE=function(a,u){return a=a>>>0,u||et(a,4,this.length),Ur.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,u){return a=a>>>0,u||et(a,4,this.length),Ur.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,u){return a=a>>>0,u||et(a,8,this.length),Ur.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,u){return a=a>>>0,u||et(a,8,this.length),Ur.read(this,a,!1,52,8)};function $t(a,u,f,E,D,M){if(!o.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(u>D||u<M)throw new RangeError('"value" argument is out of bounds');if(f+E>a.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,u,f,E){if(a=+a,u=u>>>0,f=f>>>0,!E){var D=Math.pow(2,8*f)-1;$t(this,a,u,f,D,0)}var M=1,Y=0;for(this[u]=a&255;++Y<f&&(M*=256);)this[u+Y]=a/M&255;return u+f},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,u,f,E){if(a=+a,u=u>>>0,f=f>>>0,!E){var D=Math.pow(2,8*f)-1;$t(this,a,u,f,D,0)}var M=f-1,Y=1;for(this[u+M]=a&255;--M>=0&&(Y*=256);)this[u+M]=a/Y&255;return u+f},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,1,255,0),this[u]=a&255,u+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,2,65535,0),this[u]=a&255,this[u+1]=a>>>8,u+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,2,65535,0),this[u]=a>>>8,this[u+1]=a&255,u+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,4,4294967295,0),this[u+3]=a>>>24,this[u+2]=a>>>16,this[u+1]=a>>>8,this[u]=a&255,u+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,4,4294967295,0),this[u]=a>>>24,this[u+1]=a>>>16,this[u+2]=a>>>8,this[u+3]=a&255,u+4},o.prototype.writeIntLE=function(a,u,f,E){if(a=+a,u=u>>>0,!E){var D=Math.pow(2,8*f-1);$t(this,a,u,f,D-1,-D)}var M=0,Y=1,ut=0;for(this[u]=a&255;++M<f&&(Y*=256);)a<0&&ut===0&&this[u+M-1]!==0&&(ut=1),this[u+M]=(a/Y>>0)-ut&255;return u+f},o.prototype.writeIntBE=function(a,u,f,E){if(a=+a,u=u>>>0,!E){var D=Math.pow(2,8*f-1);$t(this,a,u,f,D-1,-D)}var M=f-1,Y=1,ut=0;for(this[u+M]=a&255;--M>=0&&(Y*=256);)a<0&&ut===0&&this[u+M+1]!==0&&(ut=1),this[u+M]=(a/Y>>0)-ut&255;return u+f},o.prototype.writeInt8=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,1,127,-128),a<0&&(a=255+a+1),this[u]=a&255,u+1},o.prototype.writeInt16LE=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,2,32767,-32768),this[u]=a&255,this[u+1]=a>>>8,u+2},o.prototype.writeInt16BE=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,2,32767,-32768),this[u]=a>>>8,this[u+1]=a&255,u+2},o.prototype.writeInt32LE=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,4,2147483647,-2147483648),this[u]=a&255,this[u+1]=a>>>8,this[u+2]=a>>>16,this[u+3]=a>>>24,u+4},o.prototype.writeInt32BE=function(a,u,f){return a=+a,u=u>>>0,f||$t(this,a,u,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[u]=a>>>24,this[u+1]=a>>>16,this[u+2]=a>>>8,this[u+3]=a&255,u+4};function ci(a,u,f,E,D,M){if(f+E>a.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("Index out of range")}function li(a,u,f,E,D){return u=+u,f=f>>>0,D||ci(a,u,f,4),Ur.write(a,u,f,E,23,4),f+4}o.prototype.writeFloatLE=function(a,u,f){return li(this,a,u,!0,f)},o.prototype.writeFloatBE=function(a,u,f){return li(this,a,u,!1,f)};function oe(a,u,f,E,D){return u=+u,f=f>>>0,D||ci(a,u,f,8),Ur.write(a,u,f,E,52,8),f+8}o.prototype.writeDoubleLE=function(a,u,f){return oe(this,a,u,!0,f)},o.prototype.writeDoubleBE=function(a,u,f){return oe(this,a,u,!1,f)},o.prototype.copy=function(a,u,f,E){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(f||(f=0),!E&&E!==0&&(E=this.length),u>=a.length&&(u=a.length),u||(u=0),E>0&&E<f&&(E=f),E===f||a.length===0||this.length===0)return 0;if(u<0)throw new RangeError("targetStart out of bounds");if(f<0||f>=this.length)throw new RangeError("Index out of range");if(E<0)throw new RangeError("sourceEnd out of bounds");E>this.length&&(E=this.length),a.length-u<E-f&&(E=a.length-u+f);var D=E-f;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(u,f,E):Uint8Array.prototype.set.call(a,this.subarray(f,E),u),D},o.prototype.fill=function(a,u,f,E){if(typeof a=="string"){if(typeof u=="string"?(E=u,u=0,f=this.length):typeof f=="string"&&(E=f,f=this.length),E!==void 0&&typeof E!="string")throw new TypeError("encoding must be a string");if(typeof E=="string"&&!o.isEncoding(E))throw new TypeError("Unknown encoding: "+E);if(a.length===1){var D=a.charCodeAt(0);(E==="utf8"&&D<128||E==="latin1")&&(a=D)}}else typeof a=="number"?a=a&255:typeof a=="boolean"&&(a=Number(a));if(u<0||this.length<u||this.length<f)throw new RangeError("Out of range index");if(f<=u)return this;u=u>>>0,f=f===void 0?this.length:f>>>0,a||(a=0);var M;if(typeof a=="number")for(M=u;M<f;++M)this[M]=a;else{var Y=o.isBuffer(a)?a:o.from(a,E),ut=Y.length;if(ut===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(M=0;M<f-u;++M)this[M+u]=Y[M%ut]}return this};var ui=/[^+/0-9A-Za-z-_]/g;function Es(a){if(a=a.split("=")[0],a=a.trim().replace(ui,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function dn(a,u){u=u||1/0;for(var f,E=a.length,D=null,M=[],Y=0;Y<E;++Y){if(f=a.charCodeAt(Y),f>55295&&f<57344){if(!D){if(f>56319){(u-=3)>-1&&M.push(239,191,189);continue}else if(Y+1===E){(u-=3)>-1&&M.push(239,191,189);continue}D=f;continue}if(f<56320){(u-=3)>-1&&M.push(239,191,189),D=f;continue}f=(D-55296<<10|f-56320)+65536}else D&&(u-=3)>-1&&M.push(239,191,189);if(D=null,f<128){if((u-=1)<0)break;M.push(f)}else if(f<2048){if((u-=2)<0)break;M.push(f>>6|192,f&63|128)}else if(f<65536){if((u-=3)<0)break;M.push(f>>12|224,f>>6&63|128,f&63|128)}else if(f<1114112){if((u-=4)<0)break;M.push(f>>18|240,f>>12&63|128,f>>6&63|128,f&63|128)}else throw new Error("Invalid code point")}return M}function Ss(a){for(var u=[],f=0;f<a.length;++f)u.push(a.charCodeAt(f)&255);return u}function Is(a,u){for(var f,E,D,M=[],Y=0;Y<a.length&&!((u-=2)<0);++Y)f=a.charCodeAt(Y),E=f>>8,D=f%256,M.push(D),M.push(E);return M}function hi(a){return js.toByteArray(Es(a))}function Lr(a,u,f,E){for(var D=0;D<E&&!(D+f>=u.length||D>=a.length);++D)u[D+f]=a[D];return D}function ae(a,u){return a instanceof u||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===u.name}function fn(a){return a!==a}var Cs=function(){for(var a="0123456789abcdef",u=new Array(256),f=0;f<16;++f)for(var E=f*16,D=0;D<16;++D)u[E+D]=a[f]+a[D];return u}()}),ct=ps.Buffer;ps.SlowBuffer;ps.INSPECT_MAX_BYTES;ps.kMaxLength;var jo=function(t,e){return jo=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},jo(t,e)};function ds(t,e){jo(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var _r=function(t){ds(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),Tt=function(t){ds(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 Si(t){return t&&t.Math==Math&&t}function Uh(){return Si(typeof globalThis=="object"&&globalThis)||Si(typeof window=="object"&&window)||Si(typeof self=="object"&&self)||Si(typeof global=="object"&&global)||Function("return this")()}function Iw(){var t=Uh();return typeof t.navigator=="object"&&t.navigator.product==="ReactNative"}var Cw=function(t){var e=Iw()?"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(e);for(var r=ct.alloc(t),n=0;n<t;++n)r[n]=Math.floor(Math.random()*256);return r},Tw=function(){{if(typeof window<"u"){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(ct.alloc(e))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(e){return global.crypto.getRandomValues(ct.alloc(e))}:Cw}},Bh=Tw();function xw(t){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(t))}function Ua(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function Dw(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Aw(t){return ii(t)&&Object.prototype.toString.call(t)==="[object Date]"}function ii(t){return typeof t=="object"&&t!==null}function fs(t,e){var r=!1;function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return r||(console.warn(e),r=!0),t.apply(this,i)}return n}function zi(t){if(ArrayBuffer.isView(t))return ct.from(t.buffer,t.byteOffset,t.byteLength);if(xw(t))return ct.from(t);throw new Tt("Must use either Buffer or TypedArray")}var Nw=/^(?:[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,jh=function(t){return typeof t=="string"&&Nw.test(t)},$o=function(t){if(!jh(t))throw new Tt('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 ct.from(e,"hex")},Dl=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")},mE=Math.pow(2,63)-1,yE=-Math.pow(2,63),Ow=Math.pow(2,53),kw=-Math.pow(2,53),$h=4,Er=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 Tt("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=ct.alloc(t.BUFFER_SIZE),this.position=0):(typeof e=="string"?this.buffer=ct.from(e,"binary"):Array.isArray(e)?this.buffer=ct.from(e):this.buffer=zi(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if(typeof e=="string"&&e.length!==1)throw new Tt("only accepts single character String");if(typeof e!="number"&&e.length!==1)throw new Tt("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 Tt("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=ct.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=ct.alloc(this.buffer.length+e.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(e)?(this.buffer.set(zi(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 Al(this.buffer.slice(0,this.position));throw new _r('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,i;if("$binary"in e?r.legacy&&typeof e.$binary=="string"&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,n=ct.from(e.$binary,"base64")):typeof e.$binary!="string"&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=ct.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,n=$o(e.$uuid)),!n)throw new Tt("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return i===$h?new Al(n):new t(n,i)},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(Er.prototype,"_bsontype",{value:"Binary"});var $s=16,Al=function(t){ds(e,t);function e(r){var n=this,i,s;if(r==null)i=e.generate();else if(r instanceof e)i=ct.from(r.buffer),s=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===$s)i=zi(r);else if(typeof r=="string")i=$o(r);else throw new Tt("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,i,$h)||this,n.__id=s,n}return Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,e.cacheHexString&&(this.__id=Dl(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=Dl(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 Er(this.id,Er.SUBTYPE_UUID)},e.generate=function(){var r=Bh($s);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,ct.from(r)},e.isValid=function(r){return r?r instanceof e?!0:typeof r=="string"?jh(r):Ua(r)?r.length!==$s?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},e.createFromHexString=function(r){var n=$o(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}(Er),gs=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(gs.prototype,"_bsontype",{value:"Code"});function Pw(t){return ii(t)&&t.$id!=null&&typeof t.$ref=="string"&&(t.$db==null||typeof t.$db=="string")}var Gn=function(){function t(e,r,n,i){if(!(this instanceof t))return new t(e,r,n,i);var s=e.split(".");s.length===2&&(n=s.shift(),e=s.shift()),this.collection=e,this.oid=r,this.db=n,this.fields=i||{}}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(Gn.prototype,"_bsontype",{value:"DBRef"});var le=void 0;try{le=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 Nl=65536,Rw=1<<24,Vr=Nl*Nl,Fh=Vr*Vr,Ol=Fh/2,kl={},Pl={},K=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,i,s;return r?(e>>>=0,(s=0<=e&&e<256)&&(i=Pl[e],i)?i:(n=t.fromBits(e,(e|0)<0?-1:0,!0),s&&(Pl[e]=n),n)):(e|=0,(s=-128<=e&&e<128)&&(i=kl[e],i)?i:(n=t.fromBits(e,e<0?-1:0,!1),s&&(kl[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>=Fh)return t.MAX_UNSIGNED_VALUE}else{if(e<=-Ol)return t.MIN_VALUE;if(e+1>=Ol)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%Vr|0,e/Vr|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 i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return t.fromString(e.substring(1),r,n).neg();for(var s=t.fromNumber(Math.pow(n,8)),o=t.ZERO,c=0;c<e.length;c+=8){var l=Math.min(8,e.length-c),p=parseInt(e.substring(c,c+l),n);if(l<8){var d=t.fromNumber(Math.pow(n,l));o=o.mul(d).add(t.fromNumber(p))}else o=o.mul(s),o=o.add(t.fromNumber(p))}return o.unsigned=r,o},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 ii(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,i=this.low>>>16,s=this.low&65535,o=e.high>>>16,c=e.high&65535,l=e.low>>>16,p=e.low&65535,d=0,h=0,b=0,v=0;return v+=s+p,b+=v>>>16,v&=65535,b+=i+l,h+=b>>>16,b&=65535,h+=n+c,d+=h>>>16,h&=65535,d+=r+o,d&=65535,t.fromBits(b<<16|v,d<<16|h,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(le){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?le.div_u:le.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,le.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,i,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;s=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 o=this.shr(1);return n=o.div(e).shl(1),n.eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(n)),s=n.add(i.div(e)),s)}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();s=t.ZERO}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var c=Math.ceil(Math.log(n)/Math.LN2),l=c<=48?1:Math.pow(2,c-48),p=t.fromNumber(n),d=p.mul(e);d.isNegative()||d.gt(i);)n-=l,p=t.fromNumber(n,this.unsigned),d=p.mul(e);p.isZero()&&(p=t.ONE),s=s.add(p),i=i.sub(d)}return s},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)),le){var r=(this.unsigned?le.rem_u:le.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,le.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)),le){var r=le.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,le.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,i=this.high&65535,s=this.low>>>16,o=this.low&65535,c=e.high>>>16,l=e.high&65535,p=e.low>>>16,d=e.low&65535,h=0,b=0,v=0,w=0;return w+=o*d,v+=w>>>16,w&=65535,v+=s*d,b+=v>>>16,v&=65535,v+=o*p,b+=v>>>16,v&=65535,b+=i*d,h+=b>>>16,b&=65535,b+=s*p,h+=b>>>16,b&=65535,b+=o*l,h+=b>>>16,b&=65535,h+=n*d+i*p+s*l+o*c,h&=65535,t.fromBits(v<<16|w,h<<16|b,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)*Vr+(this.low>>>0):this.high*Vr+(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),i=n.mul(r).sub(this);return n.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=t.fromNumber(Math.pow(e,6),this.unsigned),o=this,c="";;){var l=o.div(s),p=o.sub(l.mul(s)).toInt()>>>0,d=p.toString(e);if(o=l,o.isZero())return d+c;for(;d.length<6;)d="0"+d;c=""+d+c}},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(Rw),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(K.prototype,"__isLong__",{value:!0});Object.defineProperty(K.prototype,"_bsontype",{value:"Long"});var Lw=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Mw=/^(\+|-)?(Infinity|inf)$/i,Uw=/^(\+|-)?NaN$/i,wn=6111,Fs=-6176,Rl=6176,Bw=34,Hs=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Ll=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Ml=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),jw=/^([-+])?(\d+)?$/,$w=31,Ul=16383,Fw=30,Hw=31;function Bl(t){return!isNaN(parseInt(t,10))}function Vw(t){var e=K.fromNumber(1e9),r=K.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 K(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function qw(t,e){if(!t&&!e)return{high:K.fromNumber(0),low:K.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new K(t.getLowBits(),0),i=e.shiftRightUnsigned(32),s=new K(e.getLowBits(),0),o=r.multiply(i),c=r.multiply(s),l=n.multiply(i),p=n.multiply(s);return o=o.add(c.shiftRightUnsigned(32)),c=new K(c.getLowBits(),0).add(l).add(p.shiftRightUnsigned(32)),o=o.add(c.shiftRightUnsigned(32)),p=c.shiftLeft(32).add(new K(p.getLowBits(),0)),{high:o,low:p}}function Ww(t,e){var r=t.high>>>0,n=e.high>>>0;if(r<n)return!0;if(r===n){var i=t.low>>>0,s=e.low>>>0;if(i<s)return!0}return!1}function Br(t,e){throw new Tt('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var Ba=function(){function t(e){if(!(this instanceof t))return new t(e);if(typeof e=="string")this.bytes=t.fromString(e).bytes;else if(Ua(e)){if(e.byteLength!==16)throw new Tt("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new Tt("Decimal128 must take a Buffer or string")}return t.fromString=function(e){var r=!1,n=!1,i=!1,s=0,o=0,c=0,l=0,p=0,d=[0],h=0,b=0,v=0,w=0,_=0,k=0,A=new K(0,0),B=new K(0,0),G=0,j=0;if(e.length>=7e3)throw new Tt(""+e+" not a valid Decimal128 string");var X=e.match(Lw),_t=e.match(Mw),Dt=e.match(Uw);if(!X&&!_t&&!Dt||e.length===0)throw new Tt(""+e+" not a valid Decimal128 string");if(X){var q=X[2],rt=X[4],Q=X[5],tt=X[6];rt&&tt===void 0&&Br(e,"missing exponent power"),rt&&q===void 0&&Br(e,"missing exponent base"),rt===void 0&&(Q||tt)&&Br(e,"missing e before exponent")}if((e[j]==="+"||e[j]==="-")&&(r=e[j++]==="-"),!Bl(e[j])&&e[j]!=="."){if(e[j]==="i"||e[j]==="I")return new t(ct.from(r?Ll:Ml));if(e[j]==="N")return new t(ct.from(Hs))}for(;Bl(e[j])||e[j]===".";){if(e[j]==="."){n&&Br(e,"contains multiple periods"),n=!0,j=j+1;continue}h<34&&(e[j]!=="0"||i)&&(i||(p=o),i=!0,d[b++]=parseInt(e[j],10),h=h+1),i&&(c=c+1),n&&(l=l+1),o=o+1,j=j+1}if(n&&!o)throw new Tt(""+e+" not a valid Decimal128 string");if(e[j]==="e"||e[j]==="E"){var lt=e.substr(++j).match(jw);if(!lt||!lt[2])return new t(ct.from(Hs));_=parseInt(lt[0],10),j=j+lt[0].length}if(e[j])return new t(ct.from(Hs));if(v=0,!h)v=0,w=0,d[0]=0,c=1,h=1,s=0;else if(w=h-1,s=c,s!==1)for(;d[p+s-1]===0;)s=s-1;for(_<=l&&l-_>16384?_=Fs:_=_-l;_>wn;){if(w=w+1,w-v>Bw){var kt=d.join("");if(kt.match(/^0+$/)){_=wn;break}Br(e,"overflow")}_=_-1}for(;_<Fs||h<c;){if(w===0&&s<h){_=Fs,s=0;break}if(h<c?c=c-1:w=w-1,_<wn)_=_+1;else{var kt=d.join("");if(kt.match(/^0+$/)){_=wn;break}Br(e,"overflow")}}if(w-v+1<s){var At=o;n&&(p=p+1,At=At+1),r&&(p=p+1,At=At+1);var jt=parseInt(e[p+w+1],10),Wt=0;if(jt>=5&&(Wt=1,jt===5)){for(Wt=d[w]%2===1?1:0,k=p+w+2;k<At;k++)if(parseInt(e[k],10)){Wt=1;break}}if(Wt){for(var ft=w;ft>=0;ft--)if(++d[ft]>9&&(d[ft]=0,ft===0))if(_<wn)_=_+1,d[ft]=1;else return new t(ct.from(r?Ll:Ml))}}if(A=K.fromNumber(0),B=K.fromNumber(0),s===0)A=K.fromNumber(0),B=K.fromNumber(0);else if(w-v<17){var ft=v;for(B=K.fromNumber(d[ft++]),A=new K(0,0);ft<=w;ft++)B=B.multiply(K.fromNumber(10)),B=B.add(K.fromNumber(d[ft]))}else{var ft=v;for(A=K.fromNumber(d[ft++]);ft<=w-17;ft++)A=A.multiply(K.fromNumber(10)),A=A.add(K.fromNumber(d[ft]));for(B=K.fromNumber(d[ft++]);ft<=w;ft++)B=B.multiply(K.fromNumber(10)),B=B.add(K.fromNumber(d[ft]))}var Gt=qw(A,K.fromString("100000000000000000"));Gt.low=Gt.low.add(B),Ww(Gt.low,B)&&(Gt.high=Gt.high.add(K.fromNumber(1))),G=_+Rl;var st={low:K.fromNumber(0),high:K.fromNumber(0)};Gt.high.shiftRightUnsigned(49).and(K.fromNumber(1)).equals(K.fromNumber(1))?(st.high=st.high.or(K.fromNumber(3).shiftLeft(61)),st.high=st.high.or(K.fromNumber(G).and(K.fromNumber(16383).shiftLeft(47))),st.high=st.high.or(Gt.high.and(K.fromNumber(0x7fffffffffff)))):(st.high=st.high.or(K.fromNumber(G&16383).shiftLeft(49)),st.high=st.high.or(Gt.high.and(K.fromNumber(562949953421311)))),st.low=Gt.low,r&&(st.high=st.high.or(K.fromString("9223372036854775808")));var et=ct.alloc(16);return j=0,et[j++]=st.low.low&255,et[j++]=st.low.low>>8&255,et[j++]=st.low.low>>16&255,et[j++]=st.low.low>>24&255,et[j++]=st.low.high&255,et[j++]=st.low.high>>8&255,et[j++]=st.low.high>>16&255,et[j++]=st.low.high>>24&255,et[j++]=st.high.low&255,et[j++]=st.high.low>>8&255,et[j++]=st.high.low>>16&255,et[j++]=st.high.low>>24&255,et[j++]=st.high.high&255,et[j++]=st.high.high>>8&255,et[j++]=st.high.high>>16&255,et[j++]=st.high.high>>24&255,new t(et)},t.prototype.toString=function(){for(var e,r=0,n=new Array(36),i=0;i<n.length;i++)n[i]=0;var s=0,o=!1,c,l={parts:[0,0,0,0]},p,d,h=[];s=0;var b=this.bytes,v=b[s++]|b[s++]<<8|b[s++]<<16|b[s++]<<24,w=b[s++]|b[s++]<<8|b[s++]<<16|b[s++]<<24,_=b[s++]|b[s++]<<8|b[s++]<<16|b[s++]<<24,k=b[s++]|b[s++]<<8|b[s++]<<16|b[s++]<<24;s=0;var A={low:new K(v,w),high:new K(_,k)};A.high.lessThan(K.ZERO)&&h.push("-");var B=k>>26&$w;if(B>>3===3){if(B===Fw)return h.join("")+"Infinity";if(B===Hw)return"NaN";e=k>>15&Ul,c=8+(k>>14&1)}else c=k>>14&7,e=k>>17&Ul;var G=e-Rl;if(l.parts[0]=(k&16383)+((c&15)<<14),l.parts[1]=_,l.parts[2]=w,l.parts[3]=v,l.parts[0]===0&&l.parts[1]===0&&l.parts[2]===0&&l.parts[3]===0)o=!0;else for(d=3;d>=0;d--){var j=0,X=Vw(l);if(l=X.quotient,j=X.rem.low,!!j)for(p=8;p>=0;p--)n[d*9+p]=j%10,j=Math.floor(j/10)}if(o)r=1,n[s]=0;else for(r=36;!n[s];)r=r-1,s=s+1;var _t=r-1+G;if(_t>=34||_t<=-7||G>0){if(r>34)return h.push("".concat(0)),G>0?h.push("E+".concat(G)):G<0&&h.push("E".concat(G)),h.join("");h.push("".concat(n[s++])),r=r-1,r&&h.push(".");for(var i=0;i<r;i++)h.push("".concat(n[s++]));h.push("E"),_t>0?h.push("+".concat(_t)):h.push("".concat(_t))}else if(G>=0)for(var i=0;i<r;i++)h.push("".concat(n[s++]));else{var Dt=r+G;if(Dt>0)for(var i=0;i<Dt;i++)h.push("".concat(n[s++]));else h.push("0");for(h.push(".");Dt++<0;)h.push("0");for(var i=0;i<r-Math.max(Dt-1,0);i++)h.push("".concat(n[s++]))}return h.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(Ba.prototype,"_bsontype",{value:"Decimal128"});var ms=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(ms.prototype,"_bsontype",{value:"Double"});var ys=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(ys.prototype,"_bsontype",{value:"Int32"});var ja=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(ja.prototype,"_bsontype",{value:"MaxKey"});var $a=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($a.prototype,"_bsontype",{value:"MinKey"});var Gw=new RegExp("^[0-9a-fA-F]{24}$"),dr=null,Se=Symbol("id"),Yt=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 Tt("Argument passed in must have an id that is of type string or Buffer");"toHexString"in e&&typeof e.toHexString=="function"?r=ct.from(e.toHexString(),"hex"):r=e.id}else r=e;if(r==null||typeof r=="number")this[Se]=t.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[Se]=r instanceof ct?r:zi(r);else if(typeof r=="string")if(r.length===12){var n=ct.from(r);if(n.byteLength===12)this[Se]=n;else throw new Tt("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&Gw.test(r))this[Se]=ct.from(r,"hex");else throw new Tt("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new Tt("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[Se]},set:function(e){this[Se]=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=ct.alloc(12);return n.writeUInt32BE(e,0),dr===null&&(dr=Bh(5)),n[4]=dr[0],n[5]=dr[1],n[6]=dr[2],n[7]=dr[3],n[8]=dr[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[Se][11]===e[Se][11]&&this[Se].equals(e[Se]);if(typeof e=="string"&&t.isValid(e)&&e.length===12&&Ua(this.id))return e===ct.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 ct.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=ct.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 Tt("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(ct.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(Yt.prototype,"generate",{value:fs(function(t){return Yt.generate(t)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(Yt.prototype,"getInc",{value:fs(function(){return Yt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Yt.prototype,"get_inc",{value:fs(function(){return Yt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Yt,"get_inc",{value:fs(function(){return Yt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Yt.prototype,"_bsontype",{value:"ObjectID"});function zw(t){return t.split("").sort().join("")}var zn=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=zw(r??""),this.pattern.indexOf("\0")!==-1)throw new _r("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new _r("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 _r("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 Tt("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t}();Object.defineProperty(zn.prototype,"_bsontype",{value:"BSONRegExp"});var Fa=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(Fa.prototype,"_bsontype",{value:"Symbol"});var Yw=K,Hh=function(t){ds(e,t);function e(r,n){var i=this;return i instanceof e?(K.isLong(r)?i=t.call(this,r.low,r.high,!0)||this:ii(r)&&typeof r.t<"u"&&typeof r.i<"u"?i=t.call(this,r.i,r.t,!0)||this:i=t.call(this,r,n,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new e(r,n)}return e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(r){return new e(K.fromInt(r,!0))},e.fromNumber=function(r){return new e(K.fromNumber(r,!0))},e.fromBits=function(r,n){return new e(r,n)},e.fromString=function(r,n){return new e(K.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=K.MAX_UNSIGNED_VALUE,e}(Yw);function Kw(t){return ii(t)&&Reflect.has(t,"_bsontype")&&typeof t._bsontype=="string"}var Vh=2147483647,qh=-2147483648,Wh=9223372036854776e3,Gh=-9223372036854776e3,Jw={$oid:Yt,$binary:Er,$uuid:Er,$symbol:Fa,$numberInt:ys,$numberDecimal:Ba,$numberDouble:ms,$numberLong:K,$minKey:$a,$maxKey:ja,$regex:zn,$regularExpression:zn,$timestamp:Hh};function zh(t,e){if(e===void 0&&(e={}),typeof t=="number"){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=qh&&t<=Vh)return new ys(t);if(t>=Gh&&t<=Wh)return K.fromNumber(t)}return new ms(t)}if(t==null||typeof t!="object")return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter(function(h){return h.startsWith("$")&&t[h]!=null}),n=0;n<r.length;n++){var i=Jw[r[n]];if(i)return i.fromExtendedJSON(t,e)}if(t.$date!=null){var s=t.$date,o=new Date;return e.legacy?typeof s=="number"?o.setTime(s):typeof s=="string"&&o.setTime(Date.parse(s)):typeof s=="string"?o.setTime(Date.parse(s)):K.isLong(s)?o.setTime(s.toNumber()):typeof s=="number"&&e.relaxed&&o.setTime(s),o}if(t.$code!=null){var c=Object.assign({},t);return t.$scope&&(c.$scope=zh(t.$scope)),gs.fromExtendedJSON(t)}if(Pw(t)||t.$dbPointer){var l=t.$ref?t:t.$dbPointer;if(l instanceof Gn)return l;var p=Object.keys(l).filter(function(h){return h.startsWith("$")}),d=!0;if(p.forEach(function(h){["$ref","$id","$db"].indexOf(h)===-1&&(d=!1)}),d)return Gn.fromExtendedJSON(l)}return t}function Xw(t,e){return t.map(function(r,n){e.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return er(r,e)}finally{e.seenObjects.pop()}})}function jl(t){var e=t.toISOString();return t.getUTCMilliseconds()!==0?e:e.slice(0,-5)+"Z"}function er(t,e){if((typeof t=="object"||typeof t=="function")&&t!==null){var r=e.seenObjects.findIndex(function(A){return A.obj===t});if(r!==-1){var n=e.seenObjects.map(function(A){return A.propertyName}),i=n.slice(0,r).map(function(A){return"".concat(A," -> ")}).join(""),s=n[r],o=" -> "+n.slice(r+1,n.length-1).map(function(A){return"".concat(A," -> ")}).join(""),c=n[n.length-1],l=" ".repeat(i.length+s.length/2),p="-".repeat(o.length+(s.length+c.length)/2-1);throw new Tt(`Converting circular structure to EJSON:
|