@letscooee/web-sdk 14.10.0 → 14.10.2
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/{debugger.component-CajbscQS-C1NGaizd.js → debugger.component-D3RdDx1l-BMyVsTJO.js} +1 -1
- package/dist/{esm-B-weSuzB-D-nBc13-.js → esm-B-weSuzB-BvJJJb-5.js} +1 -1
- package/dist/main.min.js +27 -26
- package/dist/renderer-BKCIF7-d-BcEjrOMd.js +5 -0
- package/dist/{share-dialog.component-BmvGBNlx-CnWHGKNf.js → share-dialog.component-TUfgPCA2-DGdhW7-A.js} +2 -2
- package/dist/{video-detail-dialog.component-HADuvpOf-BbMJLWmI.js → video-detail-dialog.component-Be1oat7U-DspjodMZ.js} +6 -6
- package/dist/{widgets-mrkhuR1_-eaozRfHm.js → widgets-ZnU-5WNv-CQ31MMkb.js} +15 -15
- package/package.json +1 -1
- package/dist/renderer-3qnKqaGo-DO_AEGCj.js +0 -5
package/dist/main.min.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
var __require=(x=>typeof require!==`undefined`?require:typeof Proxy!==`undefined`?new Proxy(x,{get:(a,b)=>(typeof require!==`undefined`?require:a)[b]}):x)(function(x){if(typeof require!==`undefined`)return require.apply(this,arguments);throw Error('Calling `require` for "'+x+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});var k$4=Object.create;var g=Object.defineProperty,l$4=Object.defineProperties,m$
|
|
1
|
+
var __require=(x=>typeof require!==`undefined`?require:typeof Proxy!==`undefined`?new Proxy(x,{get:(a,b)=>(typeof require!==`undefined`?require:a)[b]}):x)(function(x){if(typeof require!==`undefined`)return require.apply(this,arguments);throw Error('Calling `require` for "'+x+"\" in an environment that doesn't expose the `require` function. See https://rolldown.rs/in-depth/bundling-cjs#require-external-modules for more details.")});var k$4=Object.create;var g=Object.defineProperty,l$4=Object.defineProperties,m$2=Object.getOwnPropertyDescriptor,n$1=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p$1=Object.getPrototypeOf,h$3=Object.prototype.hasOwnProperty,j$3=Object.prototype.propertyIsEnumerable;var i$1=(a,b,c)=>b in a?g(a,b,{enumerable:true,configurable:true,writable:true,value:c}):a[b]=c,r$2=(a,b)=>{for(var c in b||={})h$3.call(b,c)&&i$1(a,c,b[c]);if(f)for(var c of f(b))j$3.call(b,c)&&i$1(a,c,b[c]);return a},s$2=(a,b)=>l$4(a,n$1(b));var t$1=(a=>typeof __require<`u`?__require:typeof Proxy<`u`?new Proxy(a,{get:(b,c)=>(typeof __require<`u`?__require:b)[c]}):a)(function(a){if(typeof __require<`u`)return __require.apply(this,arguments);throw Error(`Dynamic require of "`+a+`" is not supported`)});var u$1=(a,b)=>{var c={};for(var d in a)h$3.call(a,d)&&b.indexOf(d)<0&&(c[d]=a[d]);if(a!=null&&f)for(var d of f(a))b.indexOf(d)<0&&j$3.call(a,d)&&(c[d]=a[d]);return c};var v$3=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),w$3=(a,b)=>{for(var c in b)g(a,c,{get:b[c],enumerable:true});},q$4=(a,b,c,d)=>{if(b&&typeof b==`object`||typeof b==`function`)for(let e of o(b))!h$3.call(a,e)&&e!==c&&g(a,e,{get:()=>b[e],enumerable:!(d=m$2(b,e))||d.enumerable});return a};var x$2=(a,b,c)=>(c=a!=null?k$4(p$1(a)):{},q$4(!a||!a.__esModule?g(c,`default`,{value:a,enumerable:true}):c,a));
|
|
2
2
|
|
|
3
|
-
var dt$3=v$3((lt,Be)=>{(function(s){if(typeof lt==`object`&&typeof Be<`u`)Be.exports=s();else if(typeof define==`function`&&define.amd)define([],s);else {var n;typeof window<`u`?n=window:typeof global<`u`?n=global:typeof self<`u`?n=self:n=this,n.localforage=s();}})(function(){return (function u(v,I,w){function R(T,B){if(!I[T]){if(!v[T]){var p=typeof t$1==`function`&&t$1;if(!B&&p)return p(T,true);if(b)return b(T,true);var _=new Error(`Cannot find module '`+T+`'`);throw _.code=`MODULE_NOT_FOUND`,_}var C=I[T]={exports:{}};v[T][0].call(C.exports,function(O){var j=v[T][1][O];return R(j||O)},C,C.exports,u,v,I,w);}return I[T].exports}for(var b=typeof t$1==`function`&&t$1,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(u,v,I){(function(w){var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),B=w.document.createTextNode(``);T.observe(B,{characterData:true}),b=function(){B.data=m=++m%2;};}else if(!w.setImmediate&&typeof w.MessageChannel<`u`){var p=new w.MessageChannel;p.port1.onmessage=O,b=function(){p.port2.postMessage(0);};}else `document`in w&&`onreadystatechange`in w.document.createElement(`script`)?b=function(){var M=w.document.createElement(`script`);M.onreadystatechange=function(){O(),M.onreadystatechange=null,M.parentNode.removeChild(M),M=null;},w.document.documentElement.appendChild(M);}:b=function(){setTimeout(O,0);};var _,C=[];function O(){_=true;for(var M,z,F=C.length;F;){for(z=C,C=[],M=-1;++M<F;)z[M]();F=C.length;}_=false;}v.exports=j;function j(M){C.push(M)===1&&!_&&b();}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{}],2:[function(u,v,I){var w=u(1);function R(){}var b={},m=[`REJECTED`],T=[`FULFILLED`],B=[`PENDING`];v.exports=p;function p(y){if(typeof y!=`function`)throw new TypeError(`resolver must be a function`);this.state=B,this.queue=[],this.outcome=void 0,y!==R&&j(this,y);}p.prototype.catch=function(y){return this.then(null,y)},p.prototype.then=function(y,A){if(typeof y!=`function`&&this.state===T||typeof A!=`function`&&this.state===m)return this;var D=new this.constructor(R);if(this.state!==B)C(D,this.state===T?y:A,this.outcome);else this.queue.push(new _(D,y,A));return D};function _(y,A,D){this.promise=y,typeof A==`function`&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof D==`function`&&(this.onRejected=D,this.callRejected=this.otherCallRejected);}_.prototype.callFulfilled=function(y){b.resolve(this.promise,y);},_.prototype.otherCallFulfilled=function(y){C(this.promise,this.onFulfilled,y);},_.prototype.callRejected=function(y){b.reject(this.promise,y);},_.prototype.otherCallRejected=function(y){C(this.promise,this.onRejected,y);};function C(y,A,D){w(function(){var L;try{L=A(D);}catch(k){return b.reject(y,k)}L===y?b.reject(y,new TypeError(`Cannot resolve promise with itself`)):b.resolve(y,L);});}b.resolve=function(y,A){var D=M(O,A);if(D.status===`error`)return b.reject(y,D.value);var L=D.value;if(L)j(y,L);else {y.state=T,y.outcome=A;for(var k=-1,W=y.queue.length;++k<W;)y.queue[k].callFulfilled(A);}return y},b.reject=function(y,A){y.state=m,y.outcome=A;for(var D=-1,L=y.queue.length;++D<L;)y.queue[D].callRejected(A);return y};function O(y){var A=y&&y.then;if(y&&(typeof y==`object`||typeof y==`function`)&&typeof A==`function`)return function(){A.apply(y,arguments);}}function j(y,A){var D=false;function L(G){D||(D=true,b.reject(y,G));}function k(G){D||(D=true,b.resolve(y,G));}function W(){A(k,L);}var $=M(W);$.status===`error`&&L($.value);}function M(y,A){var D={};try{D.value=y(A),D.status=`success`;}catch(L){D.status=`error`,D.value=L;}return D}p.resolve=z;function z(y){return y instanceof this?y:b.resolve(new this(R),y)}p.reject=F;function F(y){var A=new this(R);return b.reject(A,y)}p.all=Ie;function Ie(y){var A=this;if(Object.prototype.toString.call(y)!==`[object Array]`)return this.reject(new TypeError(`must be an array`));var D=y.length,L=false;if(!D)return this.resolve([]);for(var k=new Array(D),W=0,$=-1,G=new this(R);++$<D;)K(y[$],$);return G;function K(oe,de){A.resolve(oe).then(Se,function(ee){L||(L=true,b.reject(G,ee));});function Se(ee){k[de]=ee,++W===D&&!L&&(L=true,b.resolve(G,k));}}}p.race=Z;function Z(y){var A=this;if(Object.prototype.toString.call(y)!==`[object Array]`)return this.reject(new TypeError(`must be an array`));var D=y.length,L=false;if(!D)return this.resolve([]);for(var k=-1,W=new this(R);++k<D;)$(y[k]);return W;function $(G){A.resolve(G).then(function(K){L||(L=true,b.resolve(W,K));},function(K){L||(L=true,b.reject(W,K));});}}},{1:1}],3:[function(u,v,I){(function(w){typeof w.Promise!=`function`&&(w.Promise=u(2));}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{2:2}],4:[function(u,v,I){var w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function R(e,r){if(!(e instanceof r))throw new TypeError(`Cannot call a class as a function`)}function b(){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 m=b();function T(){try{if(!m||!m.open)return !1;var e=typeof openDatabase<`u`&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch==`function`&&fetch.toString().indexOf(`[native code`)!==-1;return (!e||r)&&typeof indexedDB<`u`&&typeof IDBKeyRange<`u`}catch{return false}}function B(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(o){if(o.name!==`TypeError`)throw o;for(var i=new(typeof BlobBuilder<`u`?BlobBuilder:typeof MSBlobBuilder<`u`?MSBlobBuilder:typeof MozBlobBuilder<`u`?MozBlobBuilder:WebKitBlobBuilder),a=0;a<e.length;a+=1)i.append(e[a]);return i.getBlob(r.type)}}typeof Promise>`u`&&u(3);var p=Promise;function _(e,r){r&&e.then(function(t){r(null,t);},function(t){r(t);});}function C(e,r,t){typeof r==`function`&&e.then(r),typeof t==`function`&&e.catch(t);}function O(e){return typeof e!=`string`&&(console.warn(e+` used as a key, but it is not a string.`),e=String(e)),e}function j(){if(arguments.length&&typeof arguments[arguments.length-1]==`function`)return arguments[arguments.length-1]}var M=`local-forage-detect-blob-support`,z=void 0,F={},Ie=Object.prototype.toString,Z=`readonly`,y=`readwrite`;function A(e){for(var r=e.length,t=new ArrayBuffer(r),i=new Uint8Array(t),a=0;a<r;a++)i[a]=e.charCodeAt(a);return t}function D(e){return new p(function(r){var t=e.transaction(M,y),i=B([``]);t.objectStore(M).put(i,`key`),t.onabort=function(a){a.preventDefault(),a.stopPropagation(),r(false);},t.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/);r(navigator.userAgent.match(/Edge\//)||!a||parseInt(a[1],10)>=43);};}).catch(function(){return false})}function L(e){return typeof z==`boolean`?p.resolve(z):D(e).then(function(r){return z=r,z})}function k(e){var r=F[e.name],t={};t.promise=new p(function(i,a){t.resolve=i,t.reject=a;}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise;}function W(e){var t=F[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function $(e,r){var i=F[e.name].deferredOperations.pop();if(i)return i.reject(r),i.promise}function G(e,r){return new p(function(t,i){if(F[e.name]=F[e.name]||$e(),e.db)if(r)k(e),e.db.close();else return t(e.db);var a=[e.name];r&&a.push(e.version);var o=m.open.apply(m,a);r&&(o.onupgradeneeded=function(c){var f=o.result;try{f.createObjectStore(e.storeName),c.oldVersion<=1&&f.createObjectStore(M);}catch(l){if(l.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+c.oldVersion+` to version `+c.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw l}}),o.onerror=function(c){c.preventDefault(),i(o.error);},o.onsuccess=function(){var c=o.result;c.onversionchange=function(f){f.target.close();},t(c),W(e);};})}function K(e){return G(e,false)}function oe(e){return G(e,true)}function de(e,r){if(!e.db)return true;var t=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,a=e.version>e.db.version;if(i&&(e.version!==r&&console.warn(`The database "`+e.name+`" can't be downgraded from version `+e.db.version+` to version `+e.version+`.`),e.version=e.db.version),a||t){if(t){var o=e.db.version+1;o>e.version&&(e.version=o);}return true}return false}function Se(e){return new p(function(r,t){var i=new FileReader;i.onerror=t,i.onloadend=function(a){r({__local_forage_encoded_blob:true,data:btoa(a.target.result||``),type:e.type});},i.readAsBinaryString(e);})}function ee(e){return B([A(atob(e.data))],{type:e.type})}function He(e){return e&&e.__local_forage_encoded_blob}function Ct(e){var r=this,t=r._initReady().then(function(){var i=F[r._dbInfo.name];if(i&&i.dbReady)return i.dbReady});return C(t,e,e),t}function At(e){k(e);for(var r=F[e.name],t=r.forages,i=0;i<t.length;i++){var a=t[i];a._dbInfo.db&&(a._dbInfo.db.close(),a._dbInfo.db=null);}return e.db=null,K(e).then(function(o){return e.db=o,de(e)?oe(e):o}).then(function(o){e.db=r.db=o;for(var c=0;c<t.length;c++)t[c]._dbInfo.db=o;}).catch(function(o){throw $(e,o),o})}function q(e,r,t,i){i===void 0&&(i=1);try{t(null,e.db.transaction(e.storeName,r));}catch(o){if(i>0&&(!e.db||o.name===`InvalidStateError`||o.name===`NotFoundError`))return p.resolve().then(function(){if(!e.db||o.name===`NotFoundError`&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),oe(e)}).then(function(){return At(e).then(function(){q(e,r,t,i-1);})}).catch(t);t(o);}}function $e(){return {forages:[],db:null,dbReady:null,deferredOperations:[]}}function Nt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=e[i];var a=F[t.name];a||(a=$e(),F[t.name]=a),a.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=Ct);var o=[];function c(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(c));}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,K(t)}).then(function(g){return t.db=g,de(t,r._defaultConfig.version)?oe(t):g}).then(function(g){t.db=a.db=g,r._dbInfo=t;for(var E=0;E<d.length;E++){var S=d[E];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version);}})}function xt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){q(t._dbInfo,Z,function(c,f){if(c)return o(c);try{var d=f.objectStore(t._dbInfo.storeName).get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),He(g)&&(g=ee(g)),a(g);},d.onerror=function(){o(d.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Lt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){q(t._dbInfo,Z,function(c,f){if(c)return o(c);try{var d=f.objectStore(t._dbInfo.storeName).openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;He(S)&&(S=ee(S));var N=e(S,E.key,g++);N!==void 0?a(N):E.continue();}else a();},d.onerror=function(){o(d.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Ot(e,r,t){var i=this;e=O(e);var a=new p(function(o,c){var f;i.ready().then(function(){return f=i._dbInfo,Ie.call(r)===`[object Blob]`?L(f.db).then(function(l){return l?r:Se(r)}):r}).then(function(l){q(i._dbInfo,y,function(d,g){if(d)return c(d);try{var E=g.objectStore(i._dbInfo.storeName);l===null&&(l=void 0);var S=E.put(l,e);g.oncomplete=function(){l===void 0&&(l=null),o(l);},g.onabort=g.onerror=function(){c(S.error?S.error:S.transaction.error);};}catch(N){c(N);}});}).catch(c);});return _(a,t),a}function Pt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){q(t._dbInfo,y,function(c,f){if(c)return o(c);try{var d=f.objectStore(t._dbInfo.storeName).delete(e);f.oncomplete=function(){a();},f.onerror=function(){o(d.error);},f.onabort=function(){o(d.error?d.error:d.transaction.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Bt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){q(r._dbInfo,y,function(o,c){if(o)return a(o);try{var l=c.objectStore(r._dbInfo.storeName).clear();c.oncomplete=function(){i();},c.onabort=c.onerror=function(){a(l.error?l.error:l.transaction.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Vt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){q(r._dbInfo,Z,function(o,c){if(o)return a(o);try{var l=c.objectStore(r._dbInfo.storeName).count();l.onsuccess=function(){i(l.result);},l.onerror=function(){a(l.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Mt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){q(t._dbInfo,Z,function(c,f){if(c)return o(c);try{var l=f.objectStore(t._dbInfo.storeName),d=!1,g=l.openKeyCursor();g.onsuccess=function(){var E=g.result;if(!E){a(null);return}e===0||d?a(E.key):(d=!0,E.advance(e));},g.onerror=function(){o(g.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Ft(e){var r=this,t=new p(function(i,a){r.ready().then(function(){q(r._dbInfo,Z,function(o,c){if(o)return a(o);try{var l=c.objectStore(r._dbInfo.storeName).openKeyCursor(),d=[];l.onsuccess=function(){var g=l.result;if(!g){i(d);return}d.push(g.key),g.continue();},l.onerror=function(){a(l.error);};}catch(g){a(g);}});}).catch(a);});return _(t,e),t}function kt(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;if(!e.name)a=p.reject(`Invalid arguments`);else {var c=e.name===t.name&&i._dbInfo.db?p.resolve(i._dbInfo.db):K(e).then(function(f){var l=F[e.name],d=l.forages;l.db=f;for(var g=0;g<d.length;g++)d[g]._dbInfo.db=f;return f});e.storeName?a=c.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;k(e);var d=F[e.name],g=d.forages;f.close();for(var E=0;E<g.length;E++){var S=g[E];S._dbInfo.db=null,S._dbInfo.version=l;}return new p(function(x,V){var P=m.open(e.name,l);P.onerror=function(Y){P.result.close(),V(Y);},P.onupgradeneeded=function(){P.result.deleteObjectStore(e.storeName);},P.onsuccess=function(){var Y=P.result;Y.close(),x(Y);};}).then(function(x){d.db=x;for(var V=0;V<g.length;V++){var P=g[V];P._dbInfo.db=x,W(P._dbInfo);}}).catch(function(x){throw ($(e,x)||p.resolve()).catch(function(){}),x})}}):a=c.then(function(f){k(e);var l=F[e.name],d=l.forages;f.close();for(var g=0;g<d.length;g++){var E=d[g];E._dbInfo.db=null;}return new p(function(N,x){var V=m.deleteDatabase(e.name);V.onerror=function(){var P=V.result;P&&P.close(),x(V.error);},V.onblocked=function(){console.warn(`dropInstance blocked for database "`+e.name+`" until all open connections are closed`);},V.onsuccess=function(){var P=V.result;P&&P.close(),N(P);};}).then(function(N){l.db=N;for(var x=0;x<d.length;x++){var V=d[x];W(V._dbInfo);}}).catch(function(N){throw ($(e,N)||p.resolve()).catch(function(){}),N})});}return _(a,r),a}var Ut={_driver:`asyncStorage`,_initStorage:Nt,_support:T(),iterate:Lt,getItem:xt,setItem:Ot,removeItem:Pt,clear:Bt,length:Vt,key:Mt,keys:Ft,dropInstance:kt};function Wt(){return typeof openDatabase==`function`}var X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ht=`~~local_forage_type~`,Ge=/^~~local_forage_type~([^~]+)~/,me=`__lfsc__:`,De=me.length,Re=`arbf`,Ce=`blob`,Ye=`si08`,je=`ui08`,ze=`uic8`,Ke=`si16`,qe=`si32`,Xe=`ur16`,Je=`ui32`,Qe=`fl32`,Ze=`fl64`,et=De+Re.length,tt=Object.prototype.toString;function rt(e){var r=e.length*.75,t=e.length,i,a=0,o,c,f,l;e[e.length-1]===`=`&&(r--,e[e.length-2]===`=`&&r--);var d=new ArrayBuffer(r),g=new Uint8Array(d);for(i=0;i<t;i+=4)o=X.indexOf(e[i]),c=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|c>>4,g[a++]=(c&15)<<4|f>>2,g[a++]=(f&3)<<6|l&63;return d}function Ae(e){var r=new Uint8Array(e),t=``,i;for(i=0;i<r.length;i+=3)t+=X[r[i]>>2],t+=X[(r[i]&3)<<4|r[i+1]>>4],t+=X[(r[i+1]&15)<<2|r[i+2]>>6],t+=X[r[i+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+`=`:r.length%3===1&&(t=t.substring(0,t.length-2)+`==`),t}function $t(e,r){var t=``;if(e&&(t=tt.call(e)),e&&(t===`[object ArrayBuffer]`||e.buffer&&tt.call(e.buffer)===`[object ArrayBuffer]`)){var i,a=me;e instanceof ArrayBuffer?(i=e,a+=Re):(i=e.buffer,t===`[object Int8Array]`?a+=Ye:t===`[object Uint8Array]`?a+=je:t===`[object Uint8ClampedArray]`?a+=ze:t===`[object Int16Array]`?a+=Ke:t===`[object Uint16Array]`?a+=Xe:t===`[object Int32Array]`?a+=qe:t===`[object Uint32Array]`?a+=Je:t===`[object Float32Array]`?a+=Qe:t===`[object Float64Array]`?a+=Ze:r(new Error(`Failed to get type for BinaryArray`))),r(a+Ae(i));}else if(t===`[object Blob]`){var o=new FileReader;o.onload=function(){var c=Ht+e.type+`~`+Ae(this.result);r(me+Ce+c);},o.readAsArrayBuffer(e);}else try{r(JSON.stringify(e));}catch(c){console.error(`Couldn't convert value into a JSON string: `,e),r(null,c);}}function Gt(e){if(e.substring(0,De)!==me)return JSON.parse(e);var r=e.substring(et),t=e.substring(De,et),i;if(t===Ce&&Ge.test(r)){var a=r.match(Ge);i=a[1],r=r.substring(a[0].length);}var o=rt(r);switch(t){case Re:return o;case Ce:return B([o],{type:i});case Ye:return new Int8Array(o);case je:return new Uint8Array(o);case ze:return new Uint8ClampedArray(o);case Ke:return new Int16Array(o);case Xe:return new Uint16Array(o);case qe:return new Int32Array(o);case Je:return new Uint32Array(o);case Qe:return new Float32Array(o);case Ze:return new Float64Array(o);default:throw new Error(`Unkown type: `+t)}}var Ne={serialize:$t,deserialize:Gt,stringToBuffer:rt,bufferToString:Ae};function nt(e,r,t,i){e.executeSql(`CREATE TABLE IF NOT EXISTS `+r.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],t,i);}function Yt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=typeof e[i]!=`string`?e[i].toString():e[i];var a=new p(function(o,c){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size);}catch(f){return c(f)}t.db.transaction(function(f){nt(f,t,function(){r._dbInfo=t,o();},function(l,d){c(d);});},c);});return t.serializer=Ne,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(c,f){f.code===f.SYNTAX_ERR?c.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[r.storeName],function(l,d){d.rows.length?o(l,f):nt(l,r,function(){l.executeSql(t,i,a,o);},o);},o):o(c,f);},o);}function jt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var c=t._dbInfo;c.db.transaction(function(f){J(f,c,`SELECT * FROM `+c.storeName+` WHERE key = ? LIMIT 1`,[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=c.serializer.deserialize(g)),a(g);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function zt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var c=t._dbInfo;c.db.transaction(function(f){J(f,c,`SELECT * FROM `+c.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var N=g.item(S),x=N.value;if(x&&(x=c.serializer.deserialize(x)),x=e(x,N.key,S+1),x!==void 0){a(x);return}}a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function ot(e,r,t,i){var a=this;e=O(e);var o=new p(function(c,f){a.ready().then(function(){r===void 0&&(r=null);var l=r,d=a._dbInfo;d.serializer.serialize(r,function(g,E){E?f(E):d.db.transaction(function(S){J(S,d,`INSERT OR REPLACE INTO `+d.storeName+` (key, value) VALUES (?, ?)`,[e,g],function(){c(l);},function(N,x){f(x);});},function(S){if(S.code===S.QUOTA_ERR){if(i>0){c(ot.apply(a,[e,l,t,i-1]));return}f(S);}});});}).catch(f);});return _(o,t),o}function Kt(e,r,t){return ot.apply(this,[e,r,t,1])}function qt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var c=t._dbInfo;c.db.transaction(function(f){J(f,c,`DELETE FROM `+c.storeName+` WHERE key = ?`,[e],function(){a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Xt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(c){J(c,o,`DELETE FROM `+o.storeName,[],function(){i();},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Jt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(c){J(c,o,`SELECT COUNT(key) as c FROM `+o.storeName,[],function(f,l){var d=l.rows.item(0).c;i(d);},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Qt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var c=t._dbInfo;c.db.transaction(function(f){J(f,c,`SELECT key FROM `+c.storeName+` WHERE id = ? LIMIT 1`,[e+1],function(l,d){a(d.rows.length?d.rows.item(0).key:null);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Zt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(c){J(c,o,`SELECT key FROM `+o.storeName,[],function(f,l){for(var d=[],g=0;g<l.rows.length;g++)d.push(l.rows.item(g).key);i(d);},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function er(e){return new p(function(r,t){e.transaction(function(i){i.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'`,[],function(a,o){for(var c=[],f=0;f<o.rows.length;f++)c.push(o.rows.item(f).name);r({db:e,storeNames:c});},function(a,o){t(o);});},function(i){t(i);});})}function tr(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;return e.name?a=new p(function(o){var c;e.name===t.name?c=i._dbInfo.db:c=openDatabase(e.name,``,``,0),e.storeName?o({db:c,storeNames:[e.storeName]}):o(er(c));}).then(function(o){return new p(function(c,f){o.db.transaction(function(l){function d(N){return new p(function(x,V){l.executeSql(`DROP TABLE IF EXISTS `+N,[],function(){x();},function(P,Y){V(Y);});})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){c();}).catch(function(N){f(N);});},function(l){f(l);});})}):a=p.reject(`Invalid arguments`),_(a,r),a}var rr={_driver:`webSQLStorage`,_initStorage:Yt,_support:Wt(),iterate:zt,getItem:jt,setItem:Kt,removeItem:qt,clear:Xt,length:Jt,key:Qt,keys:Zt,dropInstance:tr};function nr(){try{return typeof localStorage<`u`&&`setItem`in localStorage&&!!localStorage.setItem}catch{return false}}function it(e,r){var t=e.name+`/`;return e.storeName!==r.storeName&&(t+=e.storeName+`/`),t}function or(){var e=`_localforage_support_test`;try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return true}}function ir(){return !or()||localStorage.length>0}function ar(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=it(e,r._defaultConfig),ir()?(r._dbInfo=t,t.serializer=Ne,p.resolve()):p.reject()}function sr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var o=localStorage.key(a);o.indexOf(i)===0&&localStorage.removeItem(o);}});return _(t,e),t}function ur(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo,o=localStorage.getItem(a.keyPrefix+e);return o&&(o=a.serializer.deserialize(o)),o});return _(i,r),i}function cr(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,c=o.length,f=localStorage.length,l=1,d=0;d<f;d++){var g=localStorage.key(d);if(g.indexOf(o)===0){var E=localStorage.getItem(g);if(E&&(E=a.serializer.deserialize(E)),E=e(E,g.substring(c),l++),E!==void 0)return E}}});return _(i,r),i}function fr(e,r){var t=this,i=t.ready().then(function(){var a=t._dbInfo,o;try{o=localStorage.key(e);}catch{o=null;}return o&&(o=o.substring(a.keyPrefix.length)),o});return _(i,r),i}function lr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],c=0;c<a;c++){var f=localStorage.key(c);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length));}return o});return _(t,e),t}function dr(e){var t=this.keys().then(function(i){return i.length});return _(t,e),t}function mr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo;localStorage.removeItem(a.keyPrefix+e);});return _(i,r),i}function gr(e,r,t){var i=this;e=O(e);var a=i.ready().then(function(){r===void 0&&(r=null);var o=r;return new p(function(c,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),c(o);}catch(E){(E.name===`QuotaExceededError`||E.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&f(E),f(E);}});})});return _(a,t),a}function pr(e,r){if(r=j.apply(this,arguments),e=typeof e!=`function`&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName;}var i=this,a;return e.name?a=new p(function(o){e.storeName?o(it(e,i._defaultConfig)):o(e.name+`/`);}).then(function(o){for(var c=localStorage.length-1;c>=0;c--){var f=localStorage.key(c);f.indexOf(o)===0&&localStorage.removeItem(f);}}):a=p.reject(`Invalid arguments`),_(a,r),a}var hr={_driver:`localStorageWrapper`,_initStorage:ar,_support:nr(),iterate:cr,getItem:ur,setItem:gr,removeItem:mr,clear:sr,length:dr,key:fr,keys:lr,dropInstance:pr},vr=function(r,t){return r===t||typeof r==`number`&&typeof t==`number`&&isNaN(r)&&isNaN(t)},yr=function(r,t){for(var i=r.length,a=0;a<i;){if(vr(r[a],t))return true;a++;}return false},at=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},ie={},st={},te={INDEXEDDB:Ut,WEBSQL:rr,LOCALSTORAGE:hr},Er=[te.INDEXEDDB._driver,te.WEBSQL._driver,te.LOCALSTORAGE._driver],ge=[`dropInstance`],xe=[`clear`,`getItem`,`iterate`,`key`,`keys`,`length`,`removeItem`,`setItem`].concat(ge),_r={description:``,driver:Er.slice(),name:`localforage`,size:4980736,storeName:`keyvaluepairs`,version:1};function br(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})};}function Le(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(at(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t]);}return arguments[0]}v.exports=new((function(){function e(r){R(this,e);for(var t in te)if(te.hasOwnProperty(t)){var i=te[t],a=i._driver;this[t]=a,ie[a]||this.defineDriver(i);}this._defaultConfig=Le({},_r),this._config=Le({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=false,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){});}return e.prototype.config=function(t){if((typeof t>`u`?`undefined`:w(t))===`object`){if(this._ready)return new Error(`Can't call config() after localforage has been used.`);for(var i in t){if(i===`storeName`&&(t[i]=t[i].replace(/\W/g,`_`)),i===`version`&&typeof t[i]!=`number`)return new Error(`Database version must be a number.`);this._config[i]=t[i];}return `driver`in t&&t.driver?this.setDriver(this._config.driver):true}else return typeof t==`string`?this._config[t]:this._config},e.prototype.defineDriver=function(t,i,a){var o=new p(function(c,f){try{var l=t._driver,d=new Error(`Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver`);if(!t._driver){f(d);return}for(var g=xe.concat(`_initStorage`),E=0,S=g.length;E<S;E++){var N=g[E];if((!yr(ge,N)||t[N])&&typeof t[N]!=`function`){f(d);return}}var V=function(){for(var ae=function(Sr){return function(){var Dr=new Error(`Method `+Sr+` is not implemented by the current driver`),ut=p.reject(Dr);return _(ut,arguments[arguments.length-1]),ut}},Oe=0,Ir=ge.length;Oe<Ir;Oe++){var Pe=ge[Oe];t[Pe]||(t[Pe]=ae(Pe));}};V();var P=function(ae){ie[l]&&console.info(`Redefining LocalForage driver: `+l),ie[l]=t,st[l]=ae,c();};`_support`in t?t._support&&typeof t._support==`function`?t._support().then(P,f):P(!!t._support):P(!0);}catch(Y){f(Y);}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=ie[t]?p.resolve(ie[t]):p.reject(new Error(`Driver not found.`));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(Ne);return C(i,t),i},e.prototype.ready=function(t){var i=this,a=i._driverSet.then(function(){return i._ready===null&&(i._ready=i._initDriver()),i._ready});return C(a,t,t),a},e.prototype.setDriver=function(t,i,a){var o=this;at(t)||(t=[t]);var c=this._getSupportedDrivers(t);function f(){o._config.driver=o.driver();}function l(E){return o._extend(E),f(),o._ready=o._initStorage(o._config),o._ready}function d(E){return function(){var S=0;function N(){for(;S<E.length;){var x=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(x).then(l).catch(N)}f();var V=new Error(`No available storage method found.`);return o._driverSet=p.reject(V),o._driverSet}return N()}}return this._driverSet=(this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve()).then(function(){var E=c[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(c);})}).catch(function(){f();var E=new Error(`No available storage method found.`);return o._driverSet=p.reject(E),o._driverSet}),C(this._driverSet,i,a),this._driverSet},e.prototype.supports=function(t){return !!st[t]},e.prototype._extend=function(t){Le(this,t);},e.prototype._getSupportedDrivers=function(t){for(var i=[],a=0,o=t.length;a<o;a++){var c=t[a];this.supports(c)&&i.push(c);}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=xe.length;t<i;t++)br(this,xe[t]);},e.prototype.createInstance=function(t){return new e(t)},e})());},{3:3}]},{},[4])(4)});});var Dt$2=v$3((St,we)=>{(function(s){var n={};n.VERSION=`1.6.1`;var h,u={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],B,p;for(p=1;p<m.length;p++)for(B in m[p])!(B in T)&&m[p].hasOwnProperty(B)&&(T[B]=m[p][B]);return T},w=function(m,T){return {value:m,name:T}};n.TRACE=w(1,`TRACE`),n.DEBUG=w(2,`DEBUG`),n.INFO=w(3,`INFO`),n.TIME=w(4,`TIME`),n.WARN=w(5,`WARN`),n.ERROR=w(8,`ERROR`),n.OFF=w(99,`OFF`);var R=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info;};R.prototype={setLevel:function(m){m&&`value`in m&&(this.context.filterLevel=m);},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var T=this.context.filterLevel;return m.value>=T.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(m){typeof m==`string`&&m.length>0&&this.invoke(n.TIME,[m,`start`]);},timeEnd:function(m){typeof m==`string`&&m.length>0&&this.invoke(n.TIME,[m,`end`]);},invoke:function(m,T){h&&this.enabledFor(m)&&h(T,I({level:m},this.context));}};var b=new R({filterLevel:n.OFF});((function(){var m=n;m.enabledFor=v(b,b.enabledFor),m.trace=v(b,b.trace),m.debug=v(b,b.debug),m.time=v(b,b.time),m.timeEnd=v(b,b.timeEnd),m.info=v(b,b.info),m.warn=v(b,b.warn),m.error=v(b,b.error),m.log=m.info;}))(),n.setHandler=function(m){h=m;},n.setLevel=function(m){b.setLevel(m);for(var T in u)u.hasOwnProperty(T)&&u[T].setLevel(m);},n.getLevel=function(){return b.getLevel()},n.get=function(m){return u[m]||(u[m]=new R(I({name:m},b.context)))},n.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(_,C){C.name&&_.unshift(`[`+C.name+`]`);};var T={},B=function(p,_){Function.prototype.apply.call(p,console,_);};return typeof console>`u`?function(){}:function(p,_){p=Array.prototype.slice.call(p);var C=console.log,O;_.level===n.TIME?(O=(_.name?`[`+_.name+`] `:``)+p[0],p[1]===`start`?console.time?console.time(O):T[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):B(C,[O+`: `+(new Date().getTime()-T[O])+`ms`])):(_.level===n.WARN&&console.warn?C=console.warn:_.level===n.ERROR&&console.error?C=console.error:_.level===n.INFO&&console.info?C=console.info:_.level===n.DEBUG&&console.debug?C=console.debug:_.level===n.TRACE&&console.trace&&(C=console.trace),m.formatter(p,_),B(C,p));}},n.useDefaults=function(m){n.setLevel(m&&m.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(m));},n.setDefaults=n.useDefaults,typeof define==`function`&&define.amd?define(n):typeof we<`u`&&we.exports?we.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n);})(St);});var Ve$3=x$2(dt$3());function pe$4(s){return Ve$3.default.createInstance({name:`lc`,storeName:s,driver:Ve$3.default.LOCALSTORAGE})}var re$5=class re{static storage;static async get(n,h){return await this.storage?.getItem(n)??h}static set(n,h){return this.storage?.setItem(n,h)}static remove(n){return this.storage?.removeItem(n)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var ce$5=class ce extends re$5{static storeName=`usr`;static{this.storage=pe$4(this.storeName);}static getVisitorId(){return window.CooeeSDK?.visitorId??null}static getVisitorOldId(){return window.CooeeSDK?.visitorOldId??null}};var Me$2=`14.10.0`;var Fe$4=(function(s){return s[s.WEB=3]=`WEB`,s.WEB_SDK=`WEB_SDK`,s.SHOPIFY_APP=`SHOPIFY_APP`,s.SHOPIFY_THEME_EXTENSION=`SHOPIFY_THEME_EXTENSION`,s})(Fe$4||{});var Cr$3=Me$2.split(`-`)[0].split(`.`).slice(0,3).map(s=>s.padStart(2,`0`)).join(``),Jr$3=Fe$4.WEB_SDK,mt$4=`CooeeSDK`,Q$3=Me$2,Qr$3=parseInt(Cr$3,10);var Zr$3=[`collection`,`product`,`cart`],en=[{identifier:`#flo-checkout-wrapper`,gateway:`Shopflow`},{identifier:`#fastrr-main-container`,gateway:`Shiprocket`},{identifier:`#gokwik-modal-wrapper`,gateway:`Gokwik`},{identifier:`#zecpe`,gateway:`Ecom 360`}],tn=[`View Item`,`View Cart`,`View Collection`],rn=[`CE Screen View`,`View Collection`,`View Item`,`View Cart`],nn=`https://cdn.jsdelivr.net/npm/swiper@11`;var gt$3=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q$3}/dist`,fe$3={apiURL:`https://api.sdk.letscooee.com`,cdnApiURL:`https://cdn.sdk1.api.letscooee.com`,debug:false,mode:`production`,baseURL:gt$3,styleURL:`${gt$3}/styles.min.css`};var he$4=class he{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(n){return typeof n==`object`&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static async sleep(n){return new Promise(h=>setTimeout(h,n))}static hasKeys(n){return n?Object.keys(n).length>=1:false}static convertObjectToArray(n,h){return h.reduce((u,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&u.push({[v]:n[v]}),u),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,u)=>(n[u]!==null&&n[u]!==void 0&&(h[u]=n[u]),h),{})}static stringify(n){return JSON.stringify(n,function(h,u){return u===void 0?null:u})}};var le$5=class le{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;skipCartAttribute;checkoutProvider;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(n){return n??={},this.gaEnabled=n.gaEnabled,this.gaMeasurementID=n.gaMeasurementID,this.pixelPush=n.pixelPush,this.website=n.website??{},this.currencyCount=n.currencyCount??0,this.money=n.money,this.currency=n.currency,this.storefrontToken=n.storefrontToken,this.skipItemAttribute=n.skipItemAttribute,this.skipCartAttribute=n.skipCartAttribute,this.checkoutProvider=n.checkoutProvider,this.widgetCustomisation=n.widgetCustomisation,this}};var ve$5=class ve extends re$5{static storeName=`ses`;static{this.storage=pe$4(this.storeName);}};var pt$3=5,Ar$3=500,ne$4=class ne extends Error{request;response;status;requestBody;responseText;constructor(n){super(n),this.name=`FetchError`,Object.setPrototypeOf(this,new.target.prototype);}is40x(){return !!this.response&&this.response.status>=400&&this.response.status<500}};async function mn(s,n){let h=Date.now(),u;try{u=await Nr$4(s,n);}catch{}let v=u?new Request(u.url,{method:n?.method||`GET`}):new Request(s,n);if(!u||!u.ok){let m=`Failed to fetch`;u?.statusText&&(m+=`: ${u.statusText}`);let T=new ne$4(m);throw T.request=v,T.response=u?.clone(),T.status=u?.status,T.requestBody=n?.body,T.responseText=await ht$4(u),T}let I,w=(u.headers.get(`content-type`)||``).toLowerCase(),R=u.headers.get(`content-length`),b=n?.method?.toUpperCase()||`GET`;if(u.status===204||u.status===205||b===`HEAD`||R===`0`)I=void 0;else if(w.includes(`application/json`)||w.includes(`application/problem+json`)||w.includes(`text/javascript`))try{I=await u.clone().json();}catch(m){let T=new ne$4(`Failed to parse JSON response: ${m?.message}`);throw T.request=v,T.response=u.clone(),T.status=u.status,T.requestBody=n?.body,T.responseText=await ht$4(u),T}else w.includes(`text/`)||w.includes(`image/svg+xml`)?I=await u.text():I=await u.arrayBuffer();return {data:I,status:u.status,statusText:u.statusText,headers:u.headers,timeTakenMs:Date.now()-h,options:n,request:v}}async function Nr$4(s,n){let h=null,u;for(let v=0;v<=pt$3;v++){try{if(u=await fetch(s,n),u.ok||u.status>=400&&u.status<500)return u;h=new Error(`Server error: ${u.status} ${u.statusText}`);}catch(I){h=I instanceof Error?I:new Error(String(I));}if(v<pt$3){let I=Math.pow(2,v)*Ar$3;U$3.info(`Request to ${s} failed. Retrying in ${I}ms...`),await new Promise(w=>setTimeout(w,I));}}if(u&&!u.ok)return u;throw h||new Error(`Request failed after retries`)}async function ht$4(s){if(s){try{return s=s.clone(),await s.json()}catch{}try{return await s.text()}catch{}}}var ye$4={},Ee$4,_e$3,yt$3,Et$3,vt$3;async function _t$3(){if(!_e$3)return vt$3??=xr$4(),vt$3}async function xr$4(){let{BrowserClient:s,Scope:n,defaultStackParser:h,getDefaultIntegrations:u,makeFetchTransport:v}=await import('./esm-B-weSuzB-D-nBc13-.js');Et$3=n;_e$3=new s({dsn:`https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520`,transport:v,stackParser:h,integrations:u({}).filter(w=>![`BrowserApiErrors`,`Breadcrumbs`,`GlobalHandlers`].includes(w.name)),environment:fe$3.mode,release:`web-sdk@${Q$3}`,debug:fe$3.debug}),_e$3.init();}function ke$1(s,n,h){U$3.error(`${n}:`,s),_t$3().then(()=>{let u=bt$2(h);if(u.setTag(`operation`,n),s instanceof ne$4){Lr$3(u,s,n);return}u.captureException(s);});}function _n$1(s,n,h){_t$3().then(()=>{bt$2(h).captureMessage(s,n??`error`);});}function Lr$3(s,n,h){if(Or$4(s,n),n.response){let u=n.response,v=n.responseText;s.setTag(`error.message`,n.message),u.status!=null&&s.setTag(`http.status_code`,u.status),u.statusText&&s.setTag(`http.status_text`,u.statusText),v&&typeof v==`object`&&`error`in v&&(s.setTag(`http.error_code`,v.error.code),s.setTag(`http.error_message`,v.error.message)),s.setExtras({responseText:n.responseText,statusText:u.statusText,responseType:u.type,redirected:u.redirected,responseUrl:u.url,originalError:n.message}),U$3.error(`${h} failed with ${u.status}`,n);return}if(n.request){U$3.error(`No response was received for ${h}`);return}}function Or$4(s,n){let h=n.request;if(!h)return;s.setExtras({body:n.requestBody,headers:h.headers,method:h.method,url:h.url});let u=h.headers?.get(`Cooee-Retry-Attempt`);u!==null&&s.setTag(`retry.attempt`,u);}function bn(s){yt$3=s;}function Tn(s,n){ye$4[s]=r$2(r$2({},ye$4[s]),n);}function wn(s){Ee$4=r$2(r$2({},Ee$4),s);}function bt$2(s){s??={};let{extra:n,tags:h}=s,u=new Et$3;if(u.setClient(_e$3),u.setUser(yt$3),s.triggerContext&&!s.engagementTrigger&&(s.engagementTrigger=s.triggerContext.triggerData),s.engagementTrigger){let v=s.engagementTrigger;u.setTags({"engagement.id":v.engagementID,"engagement.short_id":v.shortID,"engagement.objective":v.objective,"engagement.delivery_type":v.onsiteDeliveryType,"engagement.content_id":v.contentID,"engagement.variation":v.variation,"engagement.currency":v.currency});}return n&&u.setExtras(n),h&&u.setTags(h),Ee$4&&u.setTags(Ee$4),Object.keys(ye$4).forEach(v=>{u.setContext(v,ye$4[v]);}),u.setTag(`language`,navigator.language),u.setTag(`timezone`,Tt$1()),Pr$5(u),u}function Pr$5(s){window.Shopify&&(s.setTag(`shopify.shop`,window.Shopify.shop),s.setTag(`shopify.currency`,window.Shopify.currency?.active),s.setTag(`shopify.locale`,window.Shopify.locale),s.setTag(`theme.schema_name`,window.Shopify.theme?.schema_name),s.setTag(`theme.schema_version`,window.Shopify.theme?.schema_version));}var be$4=class be{static format(n,h){return h.replace(/{{\s*(\w+)\s*}}/,(v,I)=>{switch(I){case `amount`:return this.formatWithDelimiters(n,2);case `amount_no_decimals`:return this.formatWithDelimiters(n,0);case `amount_with_comma_separator`:return this.formatWithDelimiters(n,2,`.`,`,`);case `amount_no_decimals_with_comma_separator`:return this.formatWithDelimiters(n,0,`.`,`,`);case `amount_with_apostrophe_separator`:return this.formatWithDelimiters(n,2,`'`,`.`);case `amount_no_decimals_with_space_separator`:return this.formatWithDelimiters(n,0,` `);case `amount_with_space_separator`:return this.formatWithDelimiters(n,2,` `,`,`);case `amount_with_period_and_space_separator`:return this.formatWithDelimiters(n,2,` `,`.`);default:return v}})}static formatWithDelimiters(n,h=2,u=`,`,v=`.`){if(isNaN(n)||n==null)return `0`;let w=(n/100).toFixed(h).split(`.`);return w[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1`+u)+(w[1]?v+w[1]:``)}};function Rn$1(s){return `(\u23F0 took: ${Ue$1(s)})`}function Ue$1(s){if(s<0)return `${s}ms`;let n=new Date(Date.UTC(0,0,0,0,0,0,s)),h=[];return n.getUTCMinutes()&&h.push(n.getUTCMinutes()+`m`),n.getUTCSeconds()&&h.push(n.getUTCSeconds()+`s`),n.getUTCMilliseconds()&&h.push(n.getUTCMilliseconds()+`ms`),h.length||h.push(`0ms`),h.join(` `)}function We$4(){return window.CooeeSDK.runtimeData}function Nn$3(){return Ue$1(Date.now()-We$4().sdkLoadTime.getTime())}function Hn$1(s){try{return new URL(s)}catch{return}}function $n$1(s,n){let h=s.indexOf(n);return h===-1?false:(s.splice(h,1),true)}function Gn$1(s,n,h=false){return {[s]:Br$4(n,h),[s+`_wo_currency`]:n}}function Br$4(s,n=false){if(s==0&&n)return `Free`;let h=We$4(),u=le$5.get(),v=h.shopCurrencyCode||u.currency,I=h.currencyCode;I||U$3.warn(`Currency code is not set in RuntimeData`);let w=u.money?.format??h.moneyFormat,R;if(w&&v===I&&!u.money?.auto)R=be$4.format(s*100,w);else {let b={style:`currency`,currency:I||v,minimumFractionDigits:2,maximumFractionDigits:2,trailingZeroDisplay:`stripIfInteger`},m;try{m=new Intl.NumberFormat(wt$2(),b);}catch(T){return ke$1(T,`util_currency_format`,{extra:{currentCurrency:I,shopCurrency:v}}),``}R=m.format(s),R=R.replace(`₹`,`Rs. `),u.money?.showCurrency&&I!==`INR`&&(R=R.concat(` ${I}`));}return R}function Yn$1(s){let n=wt$2();try{return new Intl.NumberFormat(n,{notation:`compact`}).format(s)}catch(h){return ke$1(h,`util_number_format`,{extra:{lang:n,value:s}}),s.toString()}}function wt$2(){let s=`en`;return typeof navigator<`u`&&(navigator.languages!==void 0&&navigator.languages.length>0?s=navigator.languages[0]:navigator.language&&(s=navigator.language)),s=s.split(`;`)[0],s=s.split(`-`)[0],s||`en`}var Te$2;function Tt$1(){if(Te$2)return Te$2;try{return Te$2=Intl.DateTimeFormat().resolvedOptions().timeZone,Te$2}catch{return ``}}function It$3(s){document.readyState!==`loading`?s():document.addEventListener(`DOMContentLoaded`,s);}function jn$1(s){let n=document.createElement(`span`);n.id=`snackbar`,n.innerText=s,document.body.appendChild(n),n.className=`cooee-snackbar show`,setTimeout(()=>{n.classList.remove(`show`),document.body.removeChild(n);},5e3);}async function Vr$4(s,n=7,h=document){let u=1,v=document.querySelectorAll(`nonexistent-tag`);for(;u<=n;){let I=Math.min(50*2**u,1e3);if(u>1&&await he$4.sleep(I),v=h.querySelectorAll(s),v.length)return U$3.verbose(`Attempt ${u}: ${v.length} elements found with ${s}`),v;U$3.verbose(`Attempt ${u}: Elements not found with ${s}. Will retry after ${I}ms.`),u++;}return U$3.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function zn$1(s,n=10,h=document){return (await Vr$4(s,n,h)).item(0)}async function Mr$4(s){if(le$5.get().skipCartAttribute)return {};let[n,h,u]=await Promise.all([ce$5.get(`did`),ve$5.get(`id`,``),ce$5.get(`sessionNumber`,1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${u}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function Kn$1(s){let n=await Mr$4(s);return Object.entries(n).map(([h,u])=>({key:h,value:u.toString()}))}function qn$1(s,n,h,u=false){Object.defineProperty(s,n,{enumerable:false,configurable:false,writable:u,value:h});}function Xn$1(s){if(s%100>=11&&s%100<=13)return s+`th`;switch(s%10){case 1:return s+`st`;case 2:return s+`nd`;case 3:return s+`rd`;default:return s+`th`}}var H$6=x$2(Dt$2());var U$3=class U{static debuggerEl;static infoLogs=[];static log(...n){H$6.default.info(...n);}static verbose(...n){H$6.default.debug(...n);}static error(...n){H$6.default.error(...n);}static warn(...n){H$6.default.warn(...n);}static info(...n){H$6.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(` `)}),this.addToDebugger();}static trace(...n){H$6.default.trace(...n);}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector(`cooee-debugger`),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]));}};function to$1(s=mt$4){H$6.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q$3}):`);}}),Fr$1()&&(localStorage.cooeeLogLevel=`TRACE`),localStorage.cooeeLogLevel?H$6.default.setLevel(H$6.default[localStorage.cooeeLogLevel]):H$6.default.setLevel(H$6.default.OFF);}function Fr$1(){let s=Rt$4();return s===`1`||s===`on`}function Rt$4(){return new URL(location.href).searchParams?.get(`cooee-debug`)}function ro$1(){let s=[`display: inline-block;`,`font-size: 14px;`,`background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);`,`color: white;`,`padding: 4px;`,`border-radius: 4px;`].join(` `),n=`
|
|
3
|
+
var dt$4=v$3((lt,Be)=>{(function(s){if(typeof lt==`object`&&typeof Be<`u`)Be.exports=s();else if(typeof define==`function`&&define.amd)define([],s);else {var n;typeof window<`u`?n=window:typeof global<`u`?n=global:typeof self<`u`?n=self:n=this,n.localforage=s();}})(function(){return (function u(v,I,w){function R(T,B){if(!I[T]){if(!v[T]){var p=typeof t$1==`function`&&t$1;if(!B&&p)return p(T,true);if(b)return b(T,true);var _=new Error(`Cannot find module '`+T+`'`);throw _.code=`MODULE_NOT_FOUND`,_}var C=I[T]={exports:{}};v[T][0].call(C.exports,function(O){var j=v[T][1][O];return R(j||O)},C,C.exports,u,v,I,w);}return I[T].exports}for(var b=typeof t$1==`function`&&t$1,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(u,v,I){(function(w){var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),B=w.document.createTextNode(``);T.observe(B,{characterData:true}),b=function(){B.data=m=++m%2;};}else if(!w.setImmediate&&typeof w.MessageChannel<`u`){var p=new w.MessageChannel;p.port1.onmessage=O,b=function(){p.port2.postMessage(0);};}else `document`in w&&`onreadystatechange`in w.document.createElement(`script`)?b=function(){var M=w.document.createElement(`script`);M.onreadystatechange=function(){O(),M.onreadystatechange=null,M.parentNode.removeChild(M),M=null;},w.document.documentElement.appendChild(M);}:b=function(){setTimeout(O,0);};var _,C=[];function O(){_=true;for(var M,z,F=C.length;F;){for(z=C,C=[],M=-1;++M<F;)z[M]();F=C.length;}_=false;}v.exports=j;function j(M){C.push(M)===1&&!_&&b();}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{}],2:[function(u,v,I){var w=u(1);function R(){}var b={},m=[`REJECTED`],T=[`FULFILLED`],B=[`PENDING`];v.exports=p;function p(y){if(typeof y!=`function`)throw new TypeError(`resolver must be a function`);this.state=B,this.queue=[],this.outcome=void 0,y!==R&&j(this,y);}p.prototype.catch=function(y){return this.then(null,y)},p.prototype.then=function(y,A){if(typeof y!=`function`&&this.state===T||typeof A!=`function`&&this.state===m)return this;var D=new this.constructor(R);if(this.state!==B)C(D,this.state===T?y:A,this.outcome);else this.queue.push(new _(D,y,A));return D};function _(y,A,D){this.promise=y,typeof A==`function`&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof D==`function`&&(this.onRejected=D,this.callRejected=this.otherCallRejected);}_.prototype.callFulfilled=function(y){b.resolve(this.promise,y);},_.prototype.otherCallFulfilled=function(y){C(this.promise,this.onFulfilled,y);},_.prototype.callRejected=function(y){b.reject(this.promise,y);},_.prototype.otherCallRejected=function(y){C(this.promise,this.onRejected,y);};function C(y,A,D){w(function(){var L;try{L=A(D);}catch(k){return b.reject(y,k)}L===y?b.reject(y,new TypeError(`Cannot resolve promise with itself`)):b.resolve(y,L);});}b.resolve=function(y,A){var D=M(O,A);if(D.status===`error`)return b.reject(y,D.value);var L=D.value;if(L)j(y,L);else {y.state=T,y.outcome=A;for(var k=-1,W=y.queue.length;++k<W;)y.queue[k].callFulfilled(A);}return y},b.reject=function(y,A){y.state=m,y.outcome=A;for(var D=-1,L=y.queue.length;++D<L;)y.queue[D].callRejected(A);return y};function O(y){var A=y&&y.then;if(y&&(typeof y==`object`||typeof y==`function`)&&typeof A==`function`)return function(){A.apply(y,arguments);}}function j(y,A){var D=false;function L(G){D||(D=true,b.reject(y,G));}function k(G){D||(D=true,b.resolve(y,G));}function W(){A(k,L);}var $=M(W);$.status===`error`&&L($.value);}function M(y,A){var D={};try{D.value=y(A),D.status=`success`;}catch(L){D.status=`error`,D.value=L;}return D}p.resolve=z;function z(y){return y instanceof this?y:b.resolve(new this(R),y)}p.reject=F;function F(y){var A=new this(R);return b.reject(A,y)}p.all=Ie;function Ie(y){var A=this;if(Object.prototype.toString.call(y)!==`[object Array]`)return this.reject(new TypeError(`must be an array`));var D=y.length,L=false;if(!D)return this.resolve([]);for(var k=new Array(D),W=0,$=-1,G=new this(R);++$<D;)K(y[$],$);return G;function K(oe,de){A.resolve(oe).then(Se,function(ee){L||(L=true,b.reject(G,ee));});function Se(ee){k[de]=ee,++W===D&&!L&&(L=true,b.resolve(G,k));}}}p.race=Z;function Z(y){var A=this;if(Object.prototype.toString.call(y)!==`[object Array]`)return this.reject(new TypeError(`must be an array`));var D=y.length,L=false;if(!D)return this.resolve([]);for(var k=-1,W=new this(R);++k<D;)$(y[k]);return W;function $(G){A.resolve(G).then(function(K){L||(L=true,b.resolve(W,K));},function(K){L||(L=true,b.reject(W,K));});}}},{1:1}],3:[function(u,v,I){(function(w){typeof w.Promise!=`function`&&(w.Promise=u(2));}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{2:2}],4:[function(u,v,I){var w=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e};function R(e,r){if(!(e instanceof r))throw new TypeError(`Cannot call a class as a function`)}function b(){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 m=b();function T(){try{if(!m||!m.open)return !1;var e=typeof openDatabase<`u`&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch==`function`&&fetch.toString().indexOf(`[native code`)!==-1;return (!e||r)&&typeof indexedDB<`u`&&typeof IDBKeyRange<`u`}catch{return false}}function B(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(o){if(o.name!==`TypeError`)throw o;for(var i=new(typeof BlobBuilder<`u`?BlobBuilder:typeof MSBlobBuilder<`u`?MSBlobBuilder:typeof MozBlobBuilder<`u`?MozBlobBuilder:WebKitBlobBuilder),a=0;a<e.length;a+=1)i.append(e[a]);return i.getBlob(r.type)}}typeof Promise>`u`&&u(3);var p=Promise;function _(e,r){r&&e.then(function(t){r(null,t);},function(t){r(t);});}function C(e,r,t){typeof r==`function`&&e.then(r),typeof t==`function`&&e.catch(t);}function O(e){return typeof e!=`string`&&(console.warn(e+` used as a key, but it is not a string.`),e=String(e)),e}function j(){if(arguments.length&&typeof arguments[arguments.length-1]==`function`)return arguments[arguments.length-1]}var M=`local-forage-detect-blob-support`,z=void 0,F={},Ie=Object.prototype.toString,Z=`readonly`,y=`readwrite`;function A(e){for(var r=e.length,t=new ArrayBuffer(r),i=new Uint8Array(t),a=0;a<r;a++)i[a]=e.charCodeAt(a);return t}function D(e){return new p(function(r){var t=e.transaction(M,y),i=B([``]);t.objectStore(M).put(i,`key`),t.onabort=function(a){a.preventDefault(),a.stopPropagation(),r(false);},t.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/);r(navigator.userAgent.match(/Edge\//)||!a||parseInt(a[1],10)>=43);};}).catch(function(){return false})}function L(e){return typeof z==`boolean`?p.resolve(z):D(e).then(function(r){return z=r,z})}function k(e){var r=F[e.name],t={};t.promise=new p(function(i,a){t.resolve=i,t.reject=a;}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise;}function W(e){var t=F[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function $(e,r){var i=F[e.name].deferredOperations.pop();if(i)return i.reject(r),i.promise}function G(e,r){return new p(function(t,i){if(F[e.name]=F[e.name]||$e(),e.db)if(r)k(e),e.db.close();else return t(e.db);var a=[e.name];r&&a.push(e.version);var o=m.open.apply(m,a);r&&(o.onupgradeneeded=function(c){var f=o.result;try{f.createObjectStore(e.storeName),c.oldVersion<=1&&f.createObjectStore(M);}catch(l){if(l.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+c.oldVersion+` to version `+c.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw l}}),o.onerror=function(c){c.preventDefault(),i(o.error);},o.onsuccess=function(){var c=o.result;c.onversionchange=function(f){f.target.close();},t(c),W(e);};})}function K(e){return G(e,false)}function oe(e){return G(e,true)}function de(e,r){if(!e.db)return true;var t=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,a=e.version>e.db.version;if(i&&(e.version!==r&&console.warn(`The database "`+e.name+`" can't be downgraded from version `+e.db.version+` to version `+e.version+`.`),e.version=e.db.version),a||t){if(t){var o=e.db.version+1;o>e.version&&(e.version=o);}return true}return false}function Se(e){return new p(function(r,t){var i=new FileReader;i.onerror=t,i.onloadend=function(a){r({__local_forage_encoded_blob:true,data:btoa(a.target.result||``),type:e.type});},i.readAsBinaryString(e);})}function ee(e){return B([A(atob(e.data))],{type:e.type})}function He(e){return e&&e.__local_forage_encoded_blob}function Ct(e){var r=this,t=r._initReady().then(function(){var i=F[r._dbInfo.name];if(i&&i.dbReady)return i.dbReady});return C(t,e,e),t}function At(e){k(e);for(var r=F[e.name],t=r.forages,i=0;i<t.length;i++){var a=t[i];a._dbInfo.db&&(a._dbInfo.db.close(),a._dbInfo.db=null);}return e.db=null,K(e).then(function(o){return e.db=o,de(e)?oe(e):o}).then(function(o){e.db=r.db=o;for(var c=0;c<t.length;c++)t[c]._dbInfo.db=o;}).catch(function(o){throw $(e,o),o})}function q(e,r,t,i){i===void 0&&(i=1);try{t(null,e.db.transaction(e.storeName,r));}catch(o){if(i>0&&(!e.db||o.name===`InvalidStateError`||o.name===`NotFoundError`))return p.resolve().then(function(){if(!e.db||o.name===`NotFoundError`&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),oe(e)}).then(function(){return At(e).then(function(){q(e,r,t,i-1);})}).catch(t);t(o);}}function $e(){return {forages:[],db:null,dbReady:null,deferredOperations:[]}}function Nt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=e[i];var a=F[t.name];a||(a=$e(),F[t.name]=a),a.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=Ct);var o=[];function c(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(c));}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,K(t)}).then(function(g){return t.db=g,de(t,r._defaultConfig.version)?oe(t):g}).then(function(g){t.db=a.db=g,r._dbInfo=t;for(var E=0;E<d.length;E++){var S=d[E];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version);}})}function xt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){q(t._dbInfo,Z,function(c,f){if(c)return o(c);try{var d=f.objectStore(t._dbInfo.storeName).get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),He(g)&&(g=ee(g)),a(g);},d.onerror=function(){o(d.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Lt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){q(t._dbInfo,Z,function(c,f){if(c)return o(c);try{var d=f.objectStore(t._dbInfo.storeName).openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;He(S)&&(S=ee(S));var N=e(S,E.key,g++);N!==void 0?a(N):E.continue();}else a();},d.onerror=function(){o(d.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Ot(e,r,t){var i=this;e=O(e);var a=new p(function(o,c){var f;i.ready().then(function(){return f=i._dbInfo,Ie.call(r)===`[object Blob]`?L(f.db).then(function(l){return l?r:Se(r)}):r}).then(function(l){q(i._dbInfo,y,function(d,g){if(d)return c(d);try{var E=g.objectStore(i._dbInfo.storeName);l===null&&(l=void 0);var S=E.put(l,e);g.oncomplete=function(){l===void 0&&(l=null),o(l);},g.onabort=g.onerror=function(){c(S.error?S.error:S.transaction.error);};}catch(N){c(N);}});}).catch(c);});return _(a,t),a}function Pt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){q(t._dbInfo,y,function(c,f){if(c)return o(c);try{var d=f.objectStore(t._dbInfo.storeName).delete(e);f.oncomplete=function(){a();},f.onerror=function(){o(d.error);},f.onabort=function(){o(d.error?d.error:d.transaction.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Bt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){q(r._dbInfo,y,function(o,c){if(o)return a(o);try{var l=c.objectStore(r._dbInfo.storeName).clear();c.oncomplete=function(){i();},c.onabort=c.onerror=function(){a(l.error?l.error:l.transaction.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Vt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){q(r._dbInfo,Z,function(o,c){if(o)return a(o);try{var l=c.objectStore(r._dbInfo.storeName).count();l.onsuccess=function(){i(l.result);},l.onerror=function(){a(l.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Mt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){q(t._dbInfo,Z,function(c,f){if(c)return o(c);try{var l=f.objectStore(t._dbInfo.storeName),d=!1,g=l.openKeyCursor();g.onsuccess=function(){var E=g.result;if(!E){a(null);return}e===0||d?a(E.key):(d=!0,E.advance(e));},g.onerror=function(){o(g.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Ft(e){var r=this,t=new p(function(i,a){r.ready().then(function(){q(r._dbInfo,Z,function(o,c){if(o)return a(o);try{var l=c.objectStore(r._dbInfo.storeName).openKeyCursor(),d=[];l.onsuccess=function(){var g=l.result;if(!g){i(d);return}d.push(g.key),g.continue();},l.onerror=function(){a(l.error);};}catch(g){a(g);}});}).catch(a);});return _(t,e),t}function kt(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;if(!e.name)a=p.reject(`Invalid arguments`);else {var c=e.name===t.name&&i._dbInfo.db?p.resolve(i._dbInfo.db):K(e).then(function(f){var l=F[e.name],d=l.forages;l.db=f;for(var g=0;g<d.length;g++)d[g]._dbInfo.db=f;return f});e.storeName?a=c.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;k(e);var d=F[e.name],g=d.forages;f.close();for(var E=0;E<g.length;E++){var S=g[E];S._dbInfo.db=null,S._dbInfo.version=l;}return new p(function(x,V){var P=m.open(e.name,l);P.onerror=function(Y){P.result.close(),V(Y);},P.onupgradeneeded=function(){P.result.deleteObjectStore(e.storeName);},P.onsuccess=function(){var Y=P.result;Y.close(),x(Y);};}).then(function(x){d.db=x;for(var V=0;V<g.length;V++){var P=g[V];P._dbInfo.db=x,W(P._dbInfo);}}).catch(function(x){throw ($(e,x)||p.resolve()).catch(function(){}),x})}}):a=c.then(function(f){k(e);var l=F[e.name],d=l.forages;f.close();for(var g=0;g<d.length;g++){var E=d[g];E._dbInfo.db=null;}return new p(function(N,x){var V=m.deleteDatabase(e.name);V.onerror=function(){var P=V.result;P&&P.close(),x(V.error);},V.onblocked=function(){console.warn(`dropInstance blocked for database "`+e.name+`" until all open connections are closed`);},V.onsuccess=function(){var P=V.result;P&&P.close(),N(P);};}).then(function(N){l.db=N;for(var x=0;x<d.length;x++){var V=d[x];W(V._dbInfo);}}).catch(function(N){throw ($(e,N)||p.resolve()).catch(function(){}),N})});}return _(a,r),a}var Ut={_driver:`asyncStorage`,_initStorage:Nt,_support:T(),iterate:Lt,getItem:xt,setItem:Ot,removeItem:Pt,clear:Bt,length:Vt,key:Mt,keys:Ft,dropInstance:kt};function Wt(){return typeof openDatabase==`function`}var X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Ht=`~~local_forage_type~`,Ge=/^~~local_forage_type~([^~]+)~/,me=`__lfsc__:`,De=me.length,Re=`arbf`,Ce=`blob`,Ye=`si08`,je=`ui08`,ze=`uic8`,Ke=`si16`,qe=`si32`,Xe=`ur16`,Je=`ui32`,Qe=`fl32`,Ze=`fl64`,et=De+Re.length,tt=Object.prototype.toString;function rt(e){var r=e.length*.75,t=e.length,i,a=0,o,c,f,l;e[e.length-1]===`=`&&(r--,e[e.length-2]===`=`&&r--);var d=new ArrayBuffer(r),g=new Uint8Array(d);for(i=0;i<t;i+=4)o=X.indexOf(e[i]),c=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|c>>4,g[a++]=(c&15)<<4|f>>2,g[a++]=(f&3)<<6|l&63;return d}function Ae(e){var r=new Uint8Array(e),t=``,i;for(i=0;i<r.length;i+=3)t+=X[r[i]>>2],t+=X[(r[i]&3)<<4|r[i+1]>>4],t+=X[(r[i+1]&15)<<2|r[i+2]>>6],t+=X[r[i+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+`=`:r.length%3===1&&(t=t.substring(0,t.length-2)+`==`),t}function $t(e,r){var t=``;if(e&&(t=tt.call(e)),e&&(t===`[object ArrayBuffer]`||e.buffer&&tt.call(e.buffer)===`[object ArrayBuffer]`)){var i,a=me;e instanceof ArrayBuffer?(i=e,a+=Re):(i=e.buffer,t===`[object Int8Array]`?a+=Ye:t===`[object Uint8Array]`?a+=je:t===`[object Uint8ClampedArray]`?a+=ze:t===`[object Int16Array]`?a+=Ke:t===`[object Uint16Array]`?a+=Xe:t===`[object Int32Array]`?a+=qe:t===`[object Uint32Array]`?a+=Je:t===`[object Float32Array]`?a+=Qe:t===`[object Float64Array]`?a+=Ze:r(new Error(`Failed to get type for BinaryArray`))),r(a+Ae(i));}else if(t===`[object Blob]`){var o=new FileReader;o.onload=function(){var c=Ht+e.type+`~`+Ae(this.result);r(me+Ce+c);},o.readAsArrayBuffer(e);}else try{r(JSON.stringify(e));}catch(c){console.error(`Couldn't convert value into a JSON string: `,e),r(null,c);}}function Gt(e){if(e.substring(0,De)!==me)return JSON.parse(e);var r=e.substring(et),t=e.substring(De,et),i;if(t===Ce&&Ge.test(r)){var a=r.match(Ge);i=a[1],r=r.substring(a[0].length);}var o=rt(r);switch(t){case Re:return o;case Ce:return B([o],{type:i});case Ye:return new Int8Array(o);case je:return new Uint8Array(o);case ze:return new Uint8ClampedArray(o);case Ke:return new Int16Array(o);case Xe:return new Uint16Array(o);case qe:return new Int32Array(o);case Je:return new Uint32Array(o);case Qe:return new Float32Array(o);case Ze:return new Float64Array(o);default:throw new Error(`Unkown type: `+t)}}var Ne={serialize:$t,deserialize:Gt,stringToBuffer:rt,bufferToString:Ae};function nt(e,r,t,i){e.executeSql(`CREATE TABLE IF NOT EXISTS `+r.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],t,i);}function Yt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=typeof e[i]!=`string`?e[i].toString():e[i];var a=new p(function(o,c){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size);}catch(f){return c(f)}t.db.transaction(function(f){nt(f,t,function(){r._dbInfo=t,o();},function(l,d){c(d);});},c);});return t.serializer=Ne,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(c,f){f.code===f.SYNTAX_ERR?c.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[r.storeName],function(l,d){d.rows.length?o(l,f):nt(l,r,function(){l.executeSql(t,i,a,o);},o);},o):o(c,f);},o);}function jt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var c=t._dbInfo;c.db.transaction(function(f){J(f,c,`SELECT * FROM `+c.storeName+` WHERE key = ? LIMIT 1`,[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=c.serializer.deserialize(g)),a(g);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function zt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var c=t._dbInfo;c.db.transaction(function(f){J(f,c,`SELECT * FROM `+c.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var N=g.item(S),x=N.value;if(x&&(x=c.serializer.deserialize(x)),x=e(x,N.key,S+1),x!==void 0){a(x);return}}a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function ot(e,r,t,i){var a=this;e=O(e);var o=new p(function(c,f){a.ready().then(function(){r===void 0&&(r=null);var l=r,d=a._dbInfo;d.serializer.serialize(r,function(g,E){E?f(E):d.db.transaction(function(S){J(S,d,`INSERT OR REPLACE INTO `+d.storeName+` (key, value) VALUES (?, ?)`,[e,g],function(){c(l);},function(N,x){f(x);});},function(S){if(S.code===S.QUOTA_ERR){if(i>0){c(ot.apply(a,[e,l,t,i-1]));return}f(S);}});});}).catch(f);});return _(o,t),o}function Kt(e,r,t){return ot.apply(this,[e,r,t,1])}function qt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var c=t._dbInfo;c.db.transaction(function(f){J(f,c,`DELETE FROM `+c.storeName+` WHERE key = ?`,[e],function(){a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Xt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(c){J(c,o,`DELETE FROM `+o.storeName,[],function(){i();},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Jt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(c){J(c,o,`SELECT COUNT(key) as c FROM `+o.storeName,[],function(f,l){var d=l.rows.item(0).c;i(d);},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Qt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var c=t._dbInfo;c.db.transaction(function(f){J(f,c,`SELECT key FROM `+c.storeName+` WHERE id = ? LIMIT 1`,[e+1],function(l,d){a(d.rows.length?d.rows.item(0).key:null);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Zt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(c){J(c,o,`SELECT key FROM `+o.storeName,[],function(f,l){for(var d=[],g=0;g<l.rows.length;g++)d.push(l.rows.item(g).key);i(d);},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function er(e){return new p(function(r,t){e.transaction(function(i){i.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'`,[],function(a,o){for(var c=[],f=0;f<o.rows.length;f++)c.push(o.rows.item(f).name);r({db:e,storeNames:c});},function(a,o){t(o);});},function(i){t(i);});})}function tr(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!=`function`&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;return e.name?a=new p(function(o){var c;e.name===t.name?c=i._dbInfo.db:c=openDatabase(e.name,``,``,0),e.storeName?o({db:c,storeNames:[e.storeName]}):o(er(c));}).then(function(o){return new p(function(c,f){o.db.transaction(function(l){function d(N){return new p(function(x,V){l.executeSql(`DROP TABLE IF EXISTS `+N,[],function(){x();},function(P,Y){V(Y);});})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){c();}).catch(function(N){f(N);});},function(l){f(l);});})}):a=p.reject(`Invalid arguments`),_(a,r),a}var rr={_driver:`webSQLStorage`,_initStorage:Yt,_support:Wt(),iterate:zt,getItem:jt,setItem:Kt,removeItem:qt,clear:Xt,length:Jt,key:Qt,keys:Zt,dropInstance:tr};function nr(){try{return typeof localStorage<`u`&&`setItem`in localStorage&&!!localStorage.setItem}catch{return false}}function it(e,r){var t=e.name+`/`;return e.storeName!==r.storeName&&(t+=e.storeName+`/`),t}function or(){var e=`_localforage_support_test`;try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return true}}function ir(){return !or()||localStorage.length>0}function ar(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=it(e,r._defaultConfig),ir()?(r._dbInfo=t,t.serializer=Ne,p.resolve()):p.reject()}function sr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var o=localStorage.key(a);o.indexOf(i)===0&&localStorage.removeItem(o);}});return _(t,e),t}function ur(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo,o=localStorage.getItem(a.keyPrefix+e);return o&&(o=a.serializer.deserialize(o)),o});return _(i,r),i}function cr(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,c=o.length,f=localStorage.length,l=1,d=0;d<f;d++){var g=localStorage.key(d);if(g.indexOf(o)===0){var E=localStorage.getItem(g);if(E&&(E=a.serializer.deserialize(E)),E=e(E,g.substring(c),l++),E!==void 0)return E}}});return _(i,r),i}function fr(e,r){var t=this,i=t.ready().then(function(){var a=t._dbInfo,o;try{o=localStorage.key(e);}catch{o=null;}return o&&(o=o.substring(a.keyPrefix.length)),o});return _(i,r),i}function lr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],c=0;c<a;c++){var f=localStorage.key(c);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length));}return o});return _(t,e),t}function dr(e){var t=this.keys().then(function(i){return i.length});return _(t,e),t}function mr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo;localStorage.removeItem(a.keyPrefix+e);});return _(i,r),i}function gr(e,r,t){var i=this;e=O(e);var a=i.ready().then(function(){r===void 0&&(r=null);var o=r;return new p(function(c,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),c(o);}catch(E){(E.name===`QuotaExceededError`||E.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&f(E),f(E);}});})});return _(a,t),a}function pr(e,r){if(r=j.apply(this,arguments),e=typeof e!=`function`&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName;}var i=this,a;return e.name?a=new p(function(o){e.storeName?o(it(e,i._defaultConfig)):o(e.name+`/`);}).then(function(o){for(var c=localStorage.length-1;c>=0;c--){var f=localStorage.key(c);f.indexOf(o)===0&&localStorage.removeItem(f);}}):a=p.reject(`Invalid arguments`),_(a,r),a}var hr={_driver:`localStorageWrapper`,_initStorage:ar,_support:nr(),iterate:cr,getItem:ur,setItem:gr,removeItem:mr,clear:sr,length:dr,key:fr,keys:lr,dropInstance:pr},vr=function(r,t){return r===t||typeof r==`number`&&typeof t==`number`&&isNaN(r)&&isNaN(t)},yr=function(r,t){for(var i=r.length,a=0;a<i;){if(vr(r[a],t))return true;a++;}return false},at=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},ie={},st={},te={INDEXEDDB:Ut,WEBSQL:rr,LOCALSTORAGE:hr},Er=[te.INDEXEDDB._driver,te.WEBSQL._driver,te.LOCALSTORAGE._driver],ge=[`dropInstance`],xe=[`clear`,`getItem`,`iterate`,`key`,`keys`,`length`,`removeItem`,`setItem`].concat(ge),_r={description:``,driver:Er.slice(),name:`localforage`,size:4980736,storeName:`keyvaluepairs`,version:1};function br(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})};}function Le(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(at(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t]);}return arguments[0]}v.exports=new((function(){function e(r){R(this,e);for(var t in te)if(te.hasOwnProperty(t)){var i=te[t],a=i._driver;this[t]=a,ie[a]||this.defineDriver(i);}this._defaultConfig=Le({},_r),this._config=Le({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=false,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){});}return e.prototype.config=function(t){if((typeof t>`u`?`undefined`:w(t))===`object`){if(this._ready)return new Error(`Can't call config() after localforage has been used.`);for(var i in t){if(i===`storeName`&&(t[i]=t[i].replace(/\W/g,`_`)),i===`version`&&typeof t[i]!=`number`)return new Error(`Database version must be a number.`);this._config[i]=t[i];}return `driver`in t&&t.driver?this.setDriver(this._config.driver):true}else return typeof t==`string`?this._config[t]:this._config},e.prototype.defineDriver=function(t,i,a){var o=new p(function(c,f){try{var l=t._driver,d=new Error(`Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver`);if(!t._driver){f(d);return}for(var g=xe.concat(`_initStorage`),E=0,S=g.length;E<S;E++){var N=g[E];if((!yr(ge,N)||t[N])&&typeof t[N]!=`function`){f(d);return}}var V=function(){for(var ae=function(Sr){return function(){var Dr=new Error(`Method `+Sr+` is not implemented by the current driver`),ut=p.reject(Dr);return _(ut,arguments[arguments.length-1]),ut}},Oe=0,Ir=ge.length;Oe<Ir;Oe++){var Pe=ge[Oe];t[Pe]||(t[Pe]=ae(Pe));}};V();var P=function(ae){ie[l]&&console.info(`Redefining LocalForage driver: `+l),ie[l]=t,st[l]=ae,c();};`_support`in t?t._support&&typeof t._support==`function`?t._support().then(P,f):P(!!t._support):P(!0);}catch(Y){f(Y);}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=ie[t]?p.resolve(ie[t]):p.reject(new Error(`Driver not found.`));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(Ne);return C(i,t),i},e.prototype.ready=function(t){var i=this,a=i._driverSet.then(function(){return i._ready===null&&(i._ready=i._initDriver()),i._ready});return C(a,t,t),a},e.prototype.setDriver=function(t,i,a){var o=this;at(t)||(t=[t]);var c=this._getSupportedDrivers(t);function f(){o._config.driver=o.driver();}function l(E){return o._extend(E),f(),o._ready=o._initStorage(o._config),o._ready}function d(E){return function(){var S=0;function N(){for(;S<E.length;){var x=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(x).then(l).catch(N)}f();var V=new Error(`No available storage method found.`);return o._driverSet=p.reject(V),o._driverSet}return N()}}return this._driverSet=(this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve()).then(function(){var E=c[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(c);})}).catch(function(){f();var E=new Error(`No available storage method found.`);return o._driverSet=p.reject(E),o._driverSet}),C(this._driverSet,i,a),this._driverSet},e.prototype.supports=function(t){return !!st[t]},e.prototype._extend=function(t){Le(this,t);},e.prototype._getSupportedDrivers=function(t){for(var i=[],a=0,o=t.length;a<o;a++){var c=t[a];this.supports(c)&&i.push(c);}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=xe.length;t<i;t++)br(this,xe[t]);},e.prototype.createInstance=function(t){return new e(t)},e})());},{3:3}]},{},[4])(4)});});var Dt$2=v$3((St,we)=>{(function(s){var n={};n.VERSION=`1.6.1`;var h,u={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],B,p;for(p=1;p<m.length;p++)for(B in m[p])!(B in T)&&m[p].hasOwnProperty(B)&&(T[B]=m[p][B]);return T},w=function(m,T){return {value:m,name:T}};n.TRACE=w(1,`TRACE`),n.DEBUG=w(2,`DEBUG`),n.INFO=w(3,`INFO`),n.TIME=w(4,`TIME`),n.WARN=w(5,`WARN`),n.ERROR=w(8,`ERROR`),n.OFF=w(99,`OFF`);var R=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info;};R.prototype={setLevel:function(m){m&&`value`in m&&(this.context.filterLevel=m);},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var T=this.context.filterLevel;return m.value>=T.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(m){typeof m==`string`&&m.length>0&&this.invoke(n.TIME,[m,`start`]);},timeEnd:function(m){typeof m==`string`&&m.length>0&&this.invoke(n.TIME,[m,`end`]);},invoke:function(m,T){h&&this.enabledFor(m)&&h(T,I({level:m},this.context));}};var b=new R({filterLevel:n.OFF});((function(){var m=n;m.enabledFor=v(b,b.enabledFor),m.trace=v(b,b.trace),m.debug=v(b,b.debug),m.time=v(b,b.time),m.timeEnd=v(b,b.timeEnd),m.info=v(b,b.info),m.warn=v(b,b.warn),m.error=v(b,b.error),m.log=m.info;}))(),n.setHandler=function(m){h=m;},n.setLevel=function(m){b.setLevel(m);for(var T in u)u.hasOwnProperty(T)&&u[T].setLevel(m);},n.getLevel=function(){return b.getLevel()},n.get=function(m){return u[m]||(u[m]=new R(I({name:m},b.context)))},n.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(_,C){C.name&&_.unshift(`[`+C.name+`]`);};var T={},B=function(p,_){Function.prototype.apply.call(p,console,_);};return typeof console>`u`?function(){}:function(p,_){p=Array.prototype.slice.call(p);var C=console.log,O;_.level===n.TIME?(O=(_.name?`[`+_.name+`] `:``)+p[0],p[1]===`start`?console.time?console.time(O):T[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):B(C,[O+`: `+(new Date().getTime()-T[O])+`ms`])):(_.level===n.WARN&&console.warn?C=console.warn:_.level===n.ERROR&&console.error?C=console.error:_.level===n.INFO&&console.info?C=console.info:_.level===n.DEBUG&&console.debug?C=console.debug:_.level===n.TRACE&&console.trace&&(C=console.trace),m.formatter(p,_),B(C,p));}},n.useDefaults=function(m){n.setLevel(m&&m.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(m));},n.setDefaults=n.useDefaults,typeof define==`function`&&define.amd?define(n):typeof we<`u`&&we.exports?we.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n);})(St);});var Ve$3=x$2(dt$4());function pe$4(s){return Ve$3.default.createInstance({name:`lc`,storeName:s,driver:Ve$3.default.LOCALSTORAGE})}var re$5=class re{static storage;static async get(n,h){return await this.storage?.getItem(n)??h}static set(n,h){return this.storage?.setItem(n,h)}static remove(n){return this.storage?.removeItem(n)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var ce$5=class ce extends re$5{static storeName=`usr`;static{this.storage=pe$4(this.storeName);}static getVisitorId(){return window.CooeeSDK?.visitorId??null}static getVisitorOldId(){return window.CooeeSDK?.visitorOldId??null}};var Me$2=`14.10.2`;var Fe$4=(function(s){return s[s.WEB=3]=`WEB`,s.WEB_SDK=`WEB_SDK`,s.SHOPIFY_APP=`SHOPIFY_APP`,s.SHOPIFY_THEME_EXTENSION=`SHOPIFY_THEME_EXTENSION`,s})(Fe$4||{});var Cr$3=Me$2.split(`-`)[0].split(`.`).slice(0,3).map(s=>s.padStart(2,`0`)).join(``),Jr$3=Fe$4.WEB_SDK,mt$4=`CooeeSDK`,Q$3=Me$2,Qr$3=parseInt(Cr$3,10);var Zr$3=[`collection`,`product`,`cart`],en$1=[{identifier:`#flo-checkout-wrapper`,gateway:`Shopflow`},{identifier:`#fastrr-main-container`,gateway:`Shiprocket`},{identifier:`#gokwik-modal-wrapper`,gateway:`Gokwik`},{identifier:`#zecpe`,gateway:`Ecom 360`}],tn$1=[`View Item`,`View Cart`,`View Collection`],rn$1=[`CE Screen View`,`View Collection`,`View Item`,`View Cart`],nn$1=`https://cdn.jsdelivr.net/npm/swiper@11`;var gt$3=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q$3}/dist`,fe$3={apiURL:`https://api.sdk.letscooee.com`,cdnApiURL:`https://cdn.sdk1.api.letscooee.com`,debug:false,mode:`production`,baseURL:gt$3,styleURL:`${gt$3}/styles.min.css`};var he$4=class he{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(n){return typeof n==`object`&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static async sleep(n){return new Promise(h=>setTimeout(h,n))}static hasKeys(n){return n?Object.keys(n).length>=1:false}static convertObjectToArray(n,h){return h.reduce((u,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&u.push({[v]:n[v]}),u),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,u)=>(n[u]!==null&&n[u]!==void 0&&(h[u]=n[u]),h),{})}static stringify(n){return JSON.stringify(n,function(h,u){return u===void 0?null:u})}};var le$5=class le{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;skipCartAttribute;checkoutProvider;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(n){return n??={},this.gaEnabled=n.gaEnabled,this.gaMeasurementID=n.gaMeasurementID,this.pixelPush=n.pixelPush,this.website=n.website??{},this.currencyCount=n.currencyCount??0,this.money=n.money,this.currency=n.currency,this.storefrontToken=n.storefrontToken,this.skipItemAttribute=n.skipItemAttribute,this.skipCartAttribute=n.skipCartAttribute,this.checkoutProvider=n.checkoutProvider,this.widgetCustomisation=n.widgetCustomisation,this}};var ve$5=class ve extends re$5{static storeName=`ses`;static{this.storage=pe$4(this.storeName);}};var pt$3=5,Ar$3=500,ne$4=class ne extends Error{request;response;status;requestBody;responseText;constructor(n){super(n),this.name=`FetchError`,Object.setPrototypeOf(this,new.target.prototype);}is40x(){return !!this.response&&this.response.status>=400&&this.response.status<500}};async function mn$1(s,n){let h=Date.now(),u;try{u=await Nr$4(s,n);}catch{}let v=u?new Request(u.url,{method:n?.method||`GET`}):new Request(s,n);if(!u||!u.ok){let m=`Failed to fetch`;u?.statusText&&(m+=`: ${u.statusText}`);let T=new ne$4(m);throw T.request=v,T.response=u?.clone(),T.status=u?.status,T.requestBody=n?.body,T.responseText=await ht$4(u),T}let I,w=(u.headers.get(`content-type`)||``).toLowerCase(),R=u.headers.get(`content-length`),b=n?.method?.toUpperCase()||`GET`;if(u.status===204||u.status===205||b===`HEAD`||R===`0`)I=void 0;else if(w.includes(`application/json`)||w.includes(`application/problem+json`)||w.includes(`text/javascript`))try{I=await u.clone().json();}catch(m){let T=new ne$4(`Failed to parse JSON response: ${m?.message}`);throw T.request=v,T.response=u.clone(),T.status=u.status,T.requestBody=n?.body,T.responseText=await ht$4(u),T}else w.includes(`text/`)||w.includes(`image/svg+xml`)?I=await u.text():I=await u.arrayBuffer();return {data:I,status:u.status,statusText:u.statusText,headers:u.headers,timeTakenMs:Date.now()-h,options:n,request:v}}async function Nr$4(s,n){let h=null,u;for(let v=0;v<=pt$3;v++){try{if(u=await fetch(s,n),u.ok||u.status>=400&&u.status<500)return u;h=new Error(`Server error: ${u.status} ${u.statusText}`);}catch(I){h=I instanceof Error?I:new Error(String(I));}if(v<pt$3){let I=Math.pow(2,v)*Ar$3;U$3.info(`Request to ${s} failed. Retrying in ${I}ms...`),await new Promise(w=>setTimeout(w,I));}}if(u&&!u.ok)return u;throw h||new Error(`Request failed after retries`)}async function ht$4(s){if(s){try{return s=s.clone(),await s.json()}catch{}try{return await s.text()}catch{}}}var ye$4={},Ee$4,_e$3,yt$3,Et$3,vt$3;async function _t$3(){if(!_e$3)return vt$3??=xr$4(),vt$3}async function xr$4(){let{BrowserClient:s,Scope:n,defaultStackParser:h,getDefaultIntegrations:u,makeFetchTransport:v}=await import('./esm-B-weSuzB-BvJJJb-5.js');Et$3=n;_e$3=new s({dsn:`https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520`,transport:v,stackParser:h,integrations:u({}).filter(w=>![`BrowserApiErrors`,`Breadcrumbs`,`GlobalHandlers`].includes(w.name)),environment:fe$3.mode,release:`web-sdk@${Q$3}`,debug:fe$3.debug}),_e$3.init();}function ke$1(s,n,h){U$3.error(`${n}:`,s),_t$3().then(()=>{let u=bt$1(h);if(u.setTag(`operation`,n),s instanceof ne$4){Lr$3(u,s,n);return}u.captureException(s);});}function _n(s,n,h){_t$3().then(()=>{bt$1(h).captureMessage(s,n??`error`);});}function Lr$3(s,n,h){if(Or$4(s,n),n.response){let u=n.response,v=n.responseText;s.setTag(`error.message`,n.message),u.status!=null&&s.setTag(`http.status_code`,u.status),u.statusText&&s.setTag(`http.status_text`,u.statusText),v&&typeof v==`object`&&`error`in v&&(s.setTag(`http.error_code`,v.error.code),s.setTag(`http.error_message`,v.error.message)),s.setExtras({responseText:n.responseText,statusText:u.statusText,responseType:u.type,redirected:u.redirected,responseUrl:u.url,originalError:n.message}),U$3.error(`${h} failed with ${u.status}`,n);return}if(n.request){U$3.error(`No response was received for ${h}`);return}}function Or$4(s,n){let h=n.request;if(!h)return;s.setExtras({body:n.requestBody,headers:h.headers,method:h.method,url:h.url});let u=h.headers?.get(`Cooee-Retry-Attempt`);u!==null&&s.setTag(`retry.attempt`,u);}function bn$1(s){yt$3=s;}function Tn$1(s,n){ye$4[s]=r$2(r$2({},ye$4[s]),n);}function wn$1(s){Ee$4=r$2(r$2({},Ee$4),s);}function bt$1(s){s??={};let{extra:n,tags:h}=s,u=new Et$3;if(u.setClient(_e$3),u.setUser(yt$3),s.triggerContext&&!s.engagementTrigger&&(s.engagementTrigger=s.triggerContext.triggerData),s.engagementTrigger){let v=s.engagementTrigger;u.setTags({"engagement.id":v.engagementID,"engagement.short_id":v.shortID,"engagement.objective":v.objective,"engagement.delivery_type":v.onsiteDeliveryType,"engagement.content_id":v.contentID,"engagement.variation":v.variation,"engagement.currency":v.currency});}return n&&u.setExtras(n),h&&u.setTags(h),Ee$4&&u.setTags(Ee$4),Object.keys(ye$4).forEach(v=>{u.setContext(v,ye$4[v]);}),u.setTag(`language`,navigator.language),u.setTag(`timezone`,Tt$1()),Pr$5(u),u}function Pr$5(s){window.Shopify&&(s.setTag(`shopify.shop`,window.Shopify.shop),s.setTag(`shopify.currency`,window.Shopify.currency?.active),s.setTag(`shopify.locale`,window.Shopify.locale),s.setTag(`theme.schema_name`,window.Shopify.theme?.schema_name),s.setTag(`theme.schema_version`,window.Shopify.theme?.schema_version));}var be$4=class be{static format(n,h){return h.replace(/{{\s*(\w+)\s*}}/,(v,I)=>{switch(I){case `amount`:return this.formatWithDelimiters(n,2);case `amount_no_decimals`:return this.formatWithDelimiters(n,0);case `amount_with_comma_separator`:return this.formatWithDelimiters(n,2,`.`,`,`);case `amount_no_decimals_with_comma_separator`:return this.formatWithDelimiters(n,0,`.`,`,`);case `amount_with_apostrophe_separator`:return this.formatWithDelimiters(n,2,`'`,`.`);case `amount_no_decimals_with_space_separator`:return this.formatWithDelimiters(n,0,` `);case `amount_with_space_separator`:return this.formatWithDelimiters(n,2,` `,`,`);case `amount_with_period_and_space_separator`:return this.formatWithDelimiters(n,2,` `,`.`);default:return v}})}static formatWithDelimiters(n,h=2,u=`,`,v=`.`){if(isNaN(n)||n==null)return `0`;let w=(n/100).toFixed(h).split(`.`);return w[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,`$1`+u)+(w[1]?v+w[1]:``)}};function Rn$1(s){return `(\u23F0 took: ${Ue$1(s)})`}function Ue$1(s){if(s<0)return `${s}ms`;let n=new Date(Date.UTC(0,0,0,0,0,0,s)),h=[];return n.getUTCMinutes()&&h.push(n.getUTCMinutes()+`m`),n.getUTCSeconds()&&h.push(n.getUTCSeconds()+`s`),n.getUTCMilliseconds()&&h.push(n.getUTCMilliseconds()+`ms`),h.length||h.push(`0ms`),h.join(` `)}function We$4(){return window.CooeeSDK.runtimeData}function Nn$3(){return Ue$1(Date.now()-We$4().sdkLoadTime.getTime())}function Hn$1(s){try{return new URL(s)}catch{return}}function $n$1(s,n){let h=s.indexOf(n);return h===-1?false:(s.splice(h,1),true)}function Gn$1(s,n,h=false){return {[s]:Br$4(n,h),[s+`_wo_currency`]:n}}function Br$4(s,n=false){if(s==0&&n)return `Free`;let h=We$4(),u=le$5.get(),v=h.shopCurrencyCode||u.currency,I=h.currencyCode;I||U$3.warn(`Currency code is not set in RuntimeData`);let w=u.money?.format??h.moneyFormat,R;if(w&&v===I&&!u.money?.auto)R=be$4.format(s*100,w);else {let b={style:`currency`,currency:I||v,minimumFractionDigits:2,maximumFractionDigits:2,trailingZeroDisplay:`stripIfInteger`},m;try{m=new Intl.NumberFormat(wt$2(),b);}catch(T){return ke$1(T,`util_currency_format`,{extra:{currentCurrency:I,shopCurrency:v}}),``}R=m.format(s),R=R.replace(`₹`,`Rs. `),u.money?.showCurrency&&I!==`INR`&&(R=R.concat(` ${I}`));}return R}function Yn$1(s){let n=wt$2();try{return new Intl.NumberFormat(n,{notation:`compact`}).format(s)}catch(h){return ke$1(h,`util_number_format`,{extra:{lang:n,value:s}}),s.toString()}}function wt$2(){let s=`en`;return typeof navigator<`u`&&(navigator.languages!==void 0&&navigator.languages.length>0?s=navigator.languages[0]:navigator.language&&(s=navigator.language)),s=s.split(`;`)[0],s=s.split(`-`)[0],s||`en`}var Te$2;function Tt$1(){if(Te$2)return Te$2;try{return Te$2=Intl.DateTimeFormat().resolvedOptions().timeZone,Te$2}catch{return ``}}function It$2(s){document.readyState!==`loading`?s():document.addEventListener(`DOMContentLoaded`,s);}function jn$1(s){let n=document.createElement(`span`);n.id=`snackbar`,n.innerText=s,document.body.appendChild(n),n.className=`cooee-snackbar show`,setTimeout(()=>{n.classList.remove(`show`),document.body.removeChild(n);},5e3);}async function Vr$4(s,n=7,h=document){let u=1,v=document.querySelectorAll(`nonexistent-tag`);for(;u<=n;){let I=Math.min(50*2**u,1e3);if(u>1&&await he$4.sleep(I),v=h.querySelectorAll(s),v.length)return U$3.verbose(`Attempt ${u}: ${v.length} elements found with ${s}`),v;U$3.verbose(`Attempt ${u}: Elements not found with ${s}. Will retry after ${I}ms.`),u++;}return U$3.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function zn$1(s,n=10,h=document){return (await Vr$4(s,n,h)).item(0)}async function Mr$4(s){if(le$5.get().skipCartAttribute)return {};let[n,h,u]=await Promise.all([ce$5.get(`did`),ve$5.get(`id`,``),ce$5.get(`sessionNumber`,1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${u}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function Kn$1(s){let n=await Mr$4(s);return Object.entries(n).map(([h,u])=>({key:h,value:u.toString()}))}function qn$1(s,n,h,u=false){Object.defineProperty(s,n,{enumerable:false,configurable:false,writable:u,value:h});}function Xn$1(s){if(s%100>=11&&s%100<=13)return s+`th`;switch(s%10){case 1:return s+`st`;case 2:return s+`nd`;case 3:return s+`rd`;default:return s+`th`}}var H$6=x$2(Dt$2());var U$3=class U{static debuggerEl;static infoLogs=[];static log(...n){H$6.default.info(...n);}static verbose(...n){H$6.default.debug(...n);}static error(...n){H$6.default.error(...n);}static warn(...n){H$6.default.warn(...n);}static info(...n){H$6.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(` `)}),this.addToDebugger();}static trace(...n){H$6.default.trace(...n);}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector(`cooee-debugger`),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]));}};function to(s=mt$4){H$6.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q$3}):`);}}),Fr$1()&&(localStorage.cooeeLogLevel=`TRACE`),localStorage.cooeeLogLevel?H$6.default.setLevel(H$6.default[localStorage.cooeeLogLevel]):H$6.default.setLevel(H$6.default.OFF);}function Fr$1(){let s=Rt$4();return s===`1`||s===`on`}function Rt$4(){return new URL(location.href).searchParams?.get(`cooee-debug`)}function ro(){let s=[`display: inline-block;`,`font-size: 14px;`,`background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);`,`color: white;`,`padding: 4px;`,`border-radius: 4px;`].join(` `),n=`
|
|
4
4
|
`;n+=`\u{1F4E3} Drive higher conversions with AI-powered onsite engagement
|
|
5
5
|
`,n+=`\u{1F50D} Track real-time visitor intent & optimize engagement
|
|
6
6
|
`,n+=`\u{1F4CA} Improve Meta Ads ROAS with intent-driven campaigns
|
|
7
7
|
`,n+=`\u{1F6CD}\uFE0F Boost purchases & repeat sales effortlessly
|
|
8
8
|
`,n+=`
|
|
9
9
|
|
|
10
|
-
`,n+=`Learn more: https://www.letscooee.com`,console.group(`%c Elevate your ecommerce experience with Cooee 🚀 `,s),console.log(`%c${n}`,`font-size: 13px; line-height: 1.8;`),console.log(`SDK v${Q$3}`),console.groupEnd(),U$3.info(`SDK v${Q$3} loaded`);}function no
|
|
10
|
+
`,n+=`Learn more: https://www.letscooee.com`,console.group(`%c Elevate your ecommerce experience with Cooee 🚀 `,s),console.log(`%c${n}`,`font-size: 13px; line-height: 1.8;`),console.log(`SDK v${Q$3}`),console.groupEnd(),U$3.info(`SDK v${Q$3} loaded`);}function no(){let s=localStorage.getItem(`cooeeDebugTill`),n=Rt$4();if(n===`1`||n===`on`){let h=Ur$3();s||(s=h.toString(),localStorage.setItem(`cooeeDebugTill`,s));}n===`on`?sessionStorage.cooeeDebug=`1`:n===`off`&&sessionStorage.removeItem(`cooeeDebug`),sessionStorage.cooeeDebug&&kr$5(),s&&new Date(+s)<new Date&&localStorage.removeItem(`cooeeDebugTill`);}function kr$5(){let s=document.createElement(`cooee-debugger`);It$2(()=>{document.body.appendChild(s);});}function Ur$3(){return new Date().getTime()+360*60*1e3}
|
|
11
11
|
|
|
12
|
-
var q$3=`a-f\\d`,kr$4=`#?[${q$3}]{3}[${q$3}]?`,Gr$2=`#?[${q$3}]{6}([${q$3}]{2})?`,Br$3=new RegExp(`[^#${q$3}]`,`gi`),Wr$3=new RegExp(`^${kr$4}$|^${Gr$2}$`,`i`);function xt$1(r,t={}){if(typeof r!=`string`||Br$3.test(r)||!Wr$3.test(r))throw new TypeError(`Expected a valid hex string`);r=r.replace(/^#/,``);let e=1;r.length===8&&(e=Number.parseInt(r.slice(6,8),16)/255,r=r.slice(0,6)),r.length===4&&(e=Number.parseInt(r.slice(3,4).repeat(2),16)/255,r=r.slice(0,3)),r.length===3&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);let i=Number.parseInt(r,16),n=i>>16,o=i>>8&255,_=i&255,u=typeof t.alpha==`number`?t.alpha:e;if(t.format===`array`)return [n,o,_,u];if(t.format===`css`)return `rgb(${n} ${o} ${_}${u===1?``:` / ${Number((u*100).toFixed(2))}%`})`;return {red:n,green:o,blue:_,alpha:u}}var y$1=class y{h;a=100;g;constructor(t){t??={},this.h=t.h,this.a=t.a,this.g=t.g;}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return ``;try{return xt$1(this.hex,{format:`css`,alpha:this.getAlpha()})}catch(t){return console.error(`Invalid hex`,t),`#000000`}}getAlpha(){return (this.a??100)/100}};var T$2=class T{s;g;i;constructor(t){t.s&&(this.s=new y$1(t.s)),t.g&&(this.g=new z$3(t.g)),this.i=t.i;}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}};var C$3=class C{s;r;w;c;constructor(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new y$1(t.c));}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return rr$4[this.s??1]}},rr$4=(e=>(e[e.SOLID=1]=`SOLID`,e[e.DASHED=2]=`DASHED`,e))(rr$4||{});var z$3=class r{static DEFAULT_FALLBACK=new y$1({h:`#000000`,a:50});r;c;fb;constructor(t){this.r=t.r,t.c&&(this.c=new y$1(t.c)),t.fb&&(this.fb=new y$1(t.fb));}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??r.DEFAULT_FALLBACK}};var Q$2=class Q{blur;spr;clr;x;y;constructor(t){t=t??{},this.blur=t.blur??0,this.spr=t.spr??0,this.x=t.x??0,this.y=t.y??0,this.clr=new y$1(t.clr);}getStyle(t){return `${this.x*t}px ${this.y*t}px ${this.blur*t}px ${this.spr*t}px ${this.clr.rgba}`}};var D$1=class D{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(t){t=t??{},this.pl=t.pl??0,this.pr=t.pr??0,this.pt=t.pt??0,this.pb=t.pb??0,this.ml=t.ml??0,this.mr=t.mr??0,this.mt=t.mt??0,this.mb=t.mb??0,this.cent=t.cent??false;}getHorizontal(){return this.pl+this.pr}getVertical(){return this.pt+this.pb}getPaddingCSS(){return `${this.pt}px ${this.pr}px ${this.pb}px ${this.pl}px`}};var j$2=class j{rot;constructor(t){t?.rot&&(this.rot=t.rot);}get rotate(){return this.rot}},ut$3,d$1,sr$4,Dt$1,w$2,er$4,_r$4,ur$3,lr$4,wt$1,Tt,Ct$3,J$2={},cr$3=[],$r$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,lt$3=Array.isArray;function A$3(r,t){for(var e in t)r[e]=t[e];return r}function Ut$1(r){r&&r.parentNode&&r.parentNode.removeChild(r);}function Yr$2(r,t,e){var i,n,o,_={};for(o in t)o==`key`?i=t[o]:o==`ref`?n=t[o]:_[o]=t[o];if(arguments.length>2&&(_.children=arguments.length>3?ut$3.call(arguments,2):e),typeof r==`function`&&r.defaultProps!=null)for(o in r.defaultProps)_[o]===void 0&&(_[o]=r.defaultProps[o]);return st$3(r,_,i,n,null)}function st$3(r,t,e,i,n){var o={type:r,props:t,key:e,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++sr$4,__i:-1,__u:0};return n==null&&d$1.vnode!=null&&d$1.vnode(o),o}function ct$3(r){return r.children}function M$4(r,t){this.props=r,this.context=t;}function V$3(r,t){if(t==null)return r.__?V$3(r.__,r.__i+1):null;for(var e;t<r.__k.length;t++)if((e=r.__k[t])!=null&&e.__e!=null)return e.__e;return typeof r.type==`function`?V$3(r):null}function fr$4(r){var t,e;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,t=0;t<r.__k.length;t++)if((e=r.__k[t])!=null&&e.__e!=null){r.__e=r.__c.base=e.__e;break}return fr$4(r)}}function ir$4(r){(!r.__d&&(r.__d=true)&&w$2.push(r)&&!_t$2.__r++||er$4!=d$1.debounceRendering)&&((er$4=d$1.debounceRendering)||_r$4)(_t$2);}function _t$2(){for(var r,t,e,i,n,o,_,u=1;w$2.length;)w$2.length>u&&w$2.sort(ur$3),r=w$2.shift(),u=w$2.length,r.__d&&(e=void 0,n=(i=(t=r).__v).__e,o=[],_=[],t.__P&&((e=A$3({},i)).__v=i.__v+1,d$1.vnode&&d$1.vnode(e),Mt$2(t.__P,e,i,t.__n,t.__P.namespaceURI,32&i.__u?[n]:null,o,n??V$3(i),!!(32&i.__u),_),e.__v=i.__v,e.__.__k[e.__i]=e,pr$4(o,e,_),e.__e!=n&&fr$4(e)));_t$2.__r=0;}function ar$4(r,t,e,i,n,o,_,u,l,c,h){var s,E,a,g,O,N,p=i&&i.__k||cr$3,m=t.length;for(l=Kr$2(e,t,p,l,m),s=0;s<m;s++)(a=e.__k[s])!=null&&(E=a.__i==-1?J$2:p[a.__i]||J$2,a.__i=s,N=Mt$2(r,a,E,n,o,_,u,l,c,h),g=a.__e,a.ref&&E.ref!=a.ref&&(E.ref&&Vt$2(E.ref,null,a),h.push(a.ref,a.__c||g,a)),O==null&&g!=null&&(O=g),4&a.__u||E.__k===a.__k?l=hr$4(a,l,r):typeof a.type==`function`&&N!==void 0?l=N:g&&(l=g.nextSibling),a.__u&=-7);return e.__e=O,l}function Kr$2(r,t,e,i,n){var o,_,u,l,c,h=e.length,s=h,E=0;for(r.__k=new Array(n),o=0;o<n;o++)(_=t[o])!=null&&typeof _!=`boolean`&&typeof _!=`function`?(l=o+E,(_=r.__k[o]=typeof _==`string`||typeof _==`number`||typeof _==`bigint`||_.constructor==String?st$3(null,_,null,null,null):lt$3(_)?st$3(ct$3,{children:_},null,null,null):_.constructor==null&&_.__b>0?st$3(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_).__=r,_.__b=r.__b+1,u=null,(c=_.__i=Xr$2(_,e,l,s))!=-1&&(s--,(u=e[c])&&(u.__u|=2)),u==null||u.__v==null?(c==-1&&(n>h?E--:n<h&&E++),typeof _.type!=`function`&&(_.__u|=4)):c!=l&&(c==l-1?E--:c==l+1?E++:(c>l?E--:E++,_.__u|=4))):r.__k[o]=null;if(s)for(o=0;o<h;o++)(u=e[o])!=null&&!(2&u.__u)&&(u.__e==i&&(i=V$3(u)),mr$4(u,u));return i}function hr$4(r,t,e){var i,n;if(typeof r.type==`function`){for(i=r.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=r,t=hr$4(i[n],t,e));return t}r.__e!=t&&(t&&r.type&&!e.contains(t)&&(t=V$3(r)),e.insertBefore(r.__e,t||null),t=r.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Xr$2(r,t,e,i){var n,o,_=r.key,u=r.type,l=t[e];if(l===null&&r.key==null||l&&_==l.key&&u==l.type&&(2&l.__u)==0)return e;if(i>(l!=null&&(2&l.__u)==0?1:0))for(n=e-1,o=e+1;n>=0||o<t.length;){if(n>=0){if((l=t[n])&&(2&l.__u)==0&&_==l.key&&u==l.type)return n;n--;}if(o<t.length){if((l=t[o])&&(2&l.__u)==0&&_==l.key&&u==l.type)return o;o++;}}return -1}function nr$3(r,t,e){t[0]==`-`?r.setProperty(t,e??``):r[t]=e==null?``:typeof e!=`number`||$r$2.test(t)?e:e+`px`;}function ot$2(r,t,e,i,n){var o,_;t:if(t==`style`)if(typeof e==`string`)r.style.cssText=e;else {if(typeof i==`string`&&(r.style.cssText=i=``),i)for(t in i)e&&t in e||nr$3(r.style,t,``);if(e)for(t in e)i&&e[t]==i[t]||nr$3(r.style,t,e[t]);}else if(t[0]==`o`&&t[1]==`n`)o=t!=(t=t.replace(lr$4,`$1`)),_=t.toLowerCase(),t=_ in r||t==`onFocusOut`||t==`onFocusIn`?_.slice(2):t.slice(2),r.l||(r.l={}),r.l[t+o]=e,e?i?e.u=i.u:(e.u=wt$1,r.addEventListener(t,o?Ct$3:Tt,o)):r.removeEventListener(t,o?Ct$3:Tt,o);else {if(n==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in r)try{r[t]=e??``;break t}catch{}typeof e==`function`||(e==null||e===false&&t[4]!=`-`?r.removeAttribute(t):r.setAttribute(t,t==`popover`&&e==1?``:e));}}function or$4(r){return function(t){if(this.l){var e=this.l[t.type+r];if(t.t==null)t.t=wt$1++;else if(t.t<e.u)return;return e(d$1.event?d$1.event(t):t)}}}function Mt$2(r,t,e,i,n,o,_,u,l,c){var h,s,E,a,g,O,N,p,m,F,f,et,$,Zt,it,Y,Lt,L=t.type;if(t.constructor!=null)return null;128&e.__u&&(l=!!(32&e.__u),o=[u=t.__e=e.__e]),(h=d$1.__b)&&h(t);t:if(typeof L==`function`)try{if(p=t.props,m=`prototype`in L&&L.prototype.render,F=(h=L.contextType)&&i[h.__c],f=h?F?F.props.value:h.__:i,e.__c?N=(s=t.__c=e.__c).__=s.__E:(m?t.__c=s=new L(p,f):(t.__c=s=new M$4(p,f),s.constructor=L,s.render=zr$2),F&&F.sub(s),s.props=p,s.state||(s.state={}),s.context=f,s.__n=i,E=s.__d=!0,s.__h=[],s._sb=[]),m&&s.__s==null&&(s.__s=s.state),m&&L.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=A$3({},s.__s)),A$3(s.__s,L.getDerivedStateFromProps(p,s.__s))),a=s.props,g=s.state,s.__v=t,E)m&&L.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),m&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else {if(m&&L.getDerivedStateFromProps==null&&p!==a&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(p,f),!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(p,s.__s,f)===!1||t.__v==e.__v){for(t.__v!=e.__v&&(s.props=p,s.state=s.__s,s.__d=!1),t.__e=e.__e,t.__k=e.__k,t.__k.some(function(K){K&&(K.__=t);}),et=0;et<s._sb.length;et++)s.__h.push(s._sb[et]);s._sb=[],s.__h.length&&_.push(s);break t}s.componentWillUpdate!=null&&s.componentWillUpdate(p,s.__s,f),m&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(a,g,O);});}if(s.context=f,s.props=p,s.__P=r,s.__e=!1,$=d$1.__r,Zt=0,m){for(s.state=s.__s,s.__d=!1,$&&$(t),h=s.render(s.props,s.state,s.context),it=0;it<s._sb.length;it++)s.__h.push(s._sb[it]);s._sb=[];}else do s.__d=!1,$&&$(t),h=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++Zt<25);s.state=s.__s,s.getChildContext!=null&&(i=A$3(A$3({},i),s.getChildContext())),m&&!E&&s.getSnapshotBeforeUpdate!=null&&(O=s.getSnapshotBeforeUpdate(a,g)),Y=h,h!=null&&h.type===ct$3&&h.key==null&&(Y=dr$4(h.props.children)),u=ar$4(r,lt$3(Y)?Y:[Y],t,e,i,n,o,_,u,l,c),s.base=t.__e,t.__u&=-161,s.__h.length&&_.push(s),N&&(s.__E=s.__=null);}catch(K){if(t.__v=null,l||o!=null)if(K.then){for(t.__u|=l?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;o[o.indexOf(u)]=null,t.__e=u;}else for(Lt=o.length;Lt--;)Ut$1(o[Lt]);else t.__e=e.__e,t.__k=e.__k;d$1.__e(K,t,e);}else o==null&&t.__v==e.__v?(t.__k=e.__k,t.__e=e.__e):u=t.__e=qr$2(e.__e,t,e,i,n,o,_,l,c);return (h=d$1.diffed)&&h(t),128&t.__u?void 0:u}function pr$4(r,t,e){for(var i=0;i<e.length;i++)Vt$2(e[i],e[++i],e[++i]);d$1.__c&&d$1.__c(t,r),r.some(function(n){try{r=n.__h,n.__h=[],r.some(function(o){o.call(n);});}catch(o){d$1.__e(o,n.__v);}});}function dr$4(r){return typeof r!=`object`||r==null||r.__b&&r.__b>0?r:lt$3(r)?r.map(dr$4):A$3({},r)}function qr$2(r,t,e,i,n,o,_,u,l){var c,h,s,E,a,g,O,N=e.props,p=t.props,m=t.type;if(m==`svg`?n=`http://www.w3.org/2000/svg`:m==`math`?n=`http://www.w3.org/1998/Math/MathML`:n||(n=`http://www.w3.org/1999/xhtml`),o!=null){for(c=0;c<o.length;c++)if((a=o[c])&&`setAttribute`in a==!!m&&(m?a.localName==m:a.nodeType==3)){r=a,o[c]=null;break}}if(r==null){if(m==null)return document.createTextNode(p);r=document.createElementNS(n,m,p.is&&p),u&&(d$1.__m&&d$1.__m(t,o),u=false),o=null;}if(m==null)N===p||u&&r.data==p||(r.data=p);else {if(o=o&&ut$3.call(r.childNodes),N=e.props||J$2,!u&&o!=null)for(N={},c=0;c<r.attributes.length;c++)N[(a=r.attributes[c]).name]=a.value;for(c in N)if(a=N[c],c!=`children`){if(c==`dangerouslySetInnerHTML`)s=a;else if(!(c in p)){if(c==`value`&&`defaultValue`in p||c==`checked`&&`defaultChecked`in p)continue;ot$2(r,c,null,a,n);}}for(c in p)a=p[c],c==`children`?E=a:c==`dangerouslySetInnerHTML`?h=a:c==`value`?g=a:c==`checked`?O=a:u&&typeof a!=`function`||N[c]===a||ot$2(r,c,a,N[c],n);if(h)u||s&&(h.__html==s.__html||h.__html==r.innerHTML)||(r.innerHTML=h.__html),t.__k=[];else if(s&&(r.innerHTML=``),ar$4(t.type==`template`?r.content:r,lt$3(E)?E:[E],t,e,i,m==`foreignObject`?`http://www.w3.org/1999/xhtml`:n,o,_,o?o[0]:e.__k&&V$3(e,0),u,l),o!=null)for(c=o.length;c--;)Ut$1(o[c]);u||(c=`value`,m==`progress`&&g==null?r.removeAttribute(`value`):g!=null&&(g!==r[c]||m==`progress`&&!g||m==`option`&&g!=N[c])&&ot$2(r,c,g,N[c],n),c=`checked`,O!=null&&O!=r[c]&&ot$2(r,c,O,N[c],n));}return r}function Vt$2(r,t,e){try{if(typeof r==`function`){var i=typeof r.__u==`function`;i&&r.__u(),i&&t==null||(r.__u=r(t));}else r.current=t;}catch(n){d$1.__e(n,e);}}function mr$4(r,t,e){var i,n;if(d$1.unmount&&d$1.unmount(r),(i=r.ref)&&(i.current&&i.current!=r.__e||Vt$2(i,null,t)),(i=r.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(o){d$1.__e(o,t);}i.base=i.__P=null;}if(i=r.__k)for(n=0;n<i.length;n++)i[n]&&mr$4(i[n],t,e||typeof r.type!=`function`);e||Ut$1(r.__e),r.__c=r.__=r.__e=void 0;}function zr$2(r,t,e){return this.constructor(r,e)}function $e$2(r,t,e){var i,n,o,_;t==document&&(t=document.documentElement),d$1.__&&d$1.__(r,t),n=(i="undefined"==`function`)?null:t.__k,o=[],_=[],Mt$2(t,r=(t).__k=Yr$2(ct$3,null,[r]),n||J$2,J$2,t.namespaceURI,n?null:t.firstChild?ut$3.call(t.childNodes):null,o,n?n.__e:t.firstChild,i,_),pr$4(o,r,_);}ut$3=cr$3.slice,d$1={__e:function(r,t,e,i){for(var n,o,_;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(r)),_=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(r,i||{}),_=n.__d),_)return n.__E=n}catch(u){r=u;}throw r}},sr$4=0,Dt$1=function(r){return r!=null&&r.constructor==null},M$4.prototype.setState=function(r,t){var e=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=A$3({},this.state);typeof r==`function`&&(r=r(A$3({},e),this.props)),r&&A$3(e,r),r!=null&&this.__v&&(t&&this._sb.push(t),ir$4(this));},M$4.prototype.forceUpdate=function(r){this.__v&&(this.__e=true,r&&this.__h.push(r),ir$4(this));},M$4.prototype.render=ct$3,w$2=[],_r$4=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ur$3=function(r,t){return r.__v.__b-t.__v.__b},_t$2.__r=0,lr$4=/(PointerCapture)$|Capture$/i,wt$1=0,Tt=or$4(false),Ct$3=or$4(true);var kt$3,R$3,Ht$2,vr$2,Er$3=0,br$3=[],S$3=d$1,gr$4=S$3.__b,Nr$3=S$3.__r,Sr$3=S$3.diffed,Ir$4=S$3.__c,Or$3=S$3.unmount,yr$2=S$3.__;function Qr$2(r,t){S$3.__h&&S$3.__h(R$3,r,Er$3||t),Er$3=0;var e=R$3.__H||(R$3.__H={__:[],__h:[]});return r>=e.__.length&&e.__.push({}),e.__[r]}function Bt$2(r,t){var e=Qr$2(kt$3++,7);return Zr$2(e.__H,t)&&(e.__=r(),e.__H=t,e.__h=r),e.__}function jr$1(){for(var r;r=br$3.shift();)if(r.__P&&r.__H)try{r.__H.__h.forEach(ft$3),r.__H.__h.forEach(Gt$1),r.__H.__h=[];}catch(t){r.__H.__h=[],S$3.__e(t,r.__v);}}S$3.__b=function(r){R$3=null,gr$4&&gr$4(r);},S$3.__=function(r,t){r&&t.__k&&t.__k.__m&&(r.__m=t.__k.__m),yr$2&&yr$2(r,t);},S$3.__r=function(r){Nr$3&&Nr$3(r),kt$3=0;var t=(R$3=r.__c).__H;t&&(Ht$2===R$3?(t.__h=[],R$3.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0;})):(t.__h.forEach(ft$3),t.__h.forEach(Gt$1),t.__h=[],kt$3=0)),Ht$2=R$3;},S$3.diffed=function(r){Sr$3&&Sr$3(r);var t=r.__c;t&&t.__H&&(t.__H.__h.length&&(br$3.push(t)!==1&&vr$2===S$3.requestAnimationFrame||((vr$2=S$3.requestAnimationFrame)||Jr$2)(jr$1)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0;})),Ht$2=R$3=null;},S$3.__c=function(r,t){t.some(function(e){try{e.__h.forEach(ft$3),e.__h=e.__h.filter(function(i){return !i.__||Gt$1(i)});}catch(i){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],S$3.__e(i,e.__v);}}),Ir$4&&Ir$4(r,t);},S$3.unmount=function(r){Or$3&&Or$3(r);var t,e=r.__c;e&&e.__H&&(e.__H.__.forEach(function(i){try{ft$3(i);}catch(n){t=n;}}),e.__H=void 0,t&&S$3.__e(t,e.__v));};var Rr$3=typeof requestAnimationFrame==`function`;function Jr$2(r){var t,e=function(){clearTimeout(i),Rr$3&&cancelAnimationFrame(t),setTimeout(r);},i=setTimeout(e,35);Rr$3&&(t=requestAnimationFrame(e));}function ft$3(r){var t=R$3,e=r.__c;typeof e==`function`&&(r.__c=void 0,e()),R$3=t;}function Gt$1(r){var t=R$3;r.__c=r.__(),R$3=t;}function Zr$2(r,t){return !r||r.length!==t.length||t.some(function(e,i){return e!==r[i]})}var te$4=Symbol.for(`preact-signals`);function Ft$2(){if(H$5>1)H$5--;else {for(var r,t=false;Z$1!==void 0;){var e=Z$1;for(Z$1=void 0,Wt$1++;e!==void 0;){var i=e.o;if(e.o=void 0,e.f&=-3,!(8&e.f)&&Pr$4(e))try{e.c();}catch(n){t||(r=n,t=true);}e=i;}}if(Wt$1=0,H$5--,t)throw r}}var v$2=void 0;var Z$1=void 0,H$5=0,Wt$1=0,at$2=0;function Lr$2(r){if(v$2!==void 0){var t=r.n;if(t===void 0||t.t!==v$2)return t={i:0,S:r,p:v$2.s,n:void 0,t:v$2,e:void 0,x:void 0,r:t},v$2.s!==void 0&&(v$2.s.n=t),v$2.s=t,r.n=t,32&v$2.f&&r.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=v$2.s,t.n=void 0,v$2.s.n=t,v$2.s=t),t}}function I$2(r){this.v=r,this.i=0,this.n=void 0,this.t=void 0;}I$2.prototype.brand=te$4;I$2.prototype.h=function(){return true};I$2.prototype.S=function(r){this.t!==r&&r.e===void 0&&(r.x=this.t,this.t!==void 0&&(this.t.e=r),this.t=r);};I$2.prototype.U=function(r){if(this.t!==void 0){var t=r.e,e=r.x;t!==void 0&&(t.x=e,r.e=void 0),e!==void 0&&(e.e=t,r.x=void 0),r===this.t&&(this.t=e);}};I$2.prototype.subscribe=function(r){var t=this;return rt$2(function(){var e=t.value,i=v$2;v$2=void 0;try{r(e);}finally{v$2=i;}})};I$2.prototype.valueOf=function(){return this.value};I$2.prototype.toString=function(){return this.value+``};I$2.prototype.toJSON=function(){return this.value};I$2.prototype.peek=function(){var r=v$2;v$2=void 0;try{return this.value}finally{v$2=r;}};Object.defineProperty(I$2.prototype,`value`,{get:function(){var r=Lr$2(this);return r!==void 0&&(r.i=this.i),this.v},set:function(r){if(r!==this.v){if(Wt$1>100)throw new Error(`Cycle detected`);this.v=r,this.i++,at$2++,H$5++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N();}finally{Ft$2();}}}});function b$1(r){return new I$2(r)}function Pr$4(r){for(var t=r.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return true;return false}function Ar$2(r){for(var t=r.s;t!==void 0;t=t.n){var e=t.S.n;if(e!==void 0&&(t.r=e),t.S.n=t,t.i=-1,t.n===void 0){r.s=t;break}}}function xr$3(r){for(var t=r.s,e=void 0;t!==void 0;){var i=t.p;t.i===-1?(t.S.U(t),i!==void 0&&(i.n=t.n),t.n!==void 0&&(t.n.p=i)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=i;}r.s=e;}function k$3(r){I$2.call(this,void 0),this.x=r,this.s=void 0,this.g=at$2-1,this.f=4;}(k$3.prototype=new I$2).h=function(){if(this.f&=-3,1&this.f)return false;if((36&this.f)==32||(this.f&=-5,this.g===at$2))return true;if(this.g=at$2,this.f|=1,this.i>0&&!Pr$4(this))return this.f&=-2,true;var r=v$2;try{Ar$2(this),v$2=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++);}catch(e){this.v=e,this.f|=16,this.i++;}return v$2=r,xr$3(this),this.f&=-2,true};k$3.prototype.S=function(r){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t);}I$2.prototype.S.call(this,r);};k$3.prototype.U=function(r){if(this.t!==void 0&&(I$2.prototype.U.call(this,r),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t);}};k$3.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var r=this.t;r!==void 0;r=r.x)r.t.N();}};Object.defineProperty(k$3.prototype,`value`,{get:function(){if(1&this.f)throw new Error(`Cycle detected`);var r=Lr$2(this);if(this.h(),r!==void 0&&(r.i=this.i),16&this.f)throw this.v;return this.v}});function $t$2(r){return new k$3(r)}function Tr$3(r){var t=r.u;if(r.u=void 0,typeof t==`function`){H$5++;var e=v$2;v$2=void 0;try{t();}catch(i){throw r.f&=-2,r.f|=8,Yt$2(r),i}finally{v$2=e,Ft$2();}}}function Yt$2(r){for(var t=r.s;t!==void 0;t=t.n)t.S.U(t);r.x=void 0,r.s=void 0,Tr$3(r);}function re$4(r){if(v$2!==this)throw new Error(`Out-of-order effect`);xr$3(this),v$2=r,this.f&=-2,8&this.f&&Yt$2(this),Ft$2();}function tt$2(r){this.x=r,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32;}tt$2.prototype.c=function(){var r=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.u=t);}finally{r();}};tt$2.prototype.S=function(){if(1&this.f)throw new Error(`Cycle detected`);this.f|=1,this.f&=-9,Tr$3(this),Ar$2(this),H$5++;var r=v$2;return v$2=this,re$4.bind(this,r)};tt$2.prototype.N=function(){2&this.f||(this.f|=2,this.o=Z$1,Z$1=this);};tt$2.prototype.d=function(){this.f|=8,1&this.f||Yt$2(this);};function rt$2(r){var t=new tt$2(r);try{t.c();}catch(e){throw t.d(),e}return t.d.bind(t)}var Kt$2;function G$2(r,t){d$1[r]=t.bind(null,d$1[r]||function(){});}function ht$3(r){Kt$2&&Kt$2(),Kt$2=r&&r.S();}function Cr$2(r){var t=this,e=r.data,i=ie$3(e);i.value=e;var n=Bt$2(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var _,u=t.__$u.S(),l=n.value;u(),Dt$1(l)||((_=t.base)==null?void 0:_.nodeType)!==3?(t.__$f|=1,t.setState({})):t.base.data=l;},$t$2(function(){var _=i.value.value;return _===0?0:_===true?``:_||``})},[]);return n.value}Cr$2.displayName=`_st`;Object.defineProperties(I$2.prototype,{constructor:{configurable:true,value:void 0},type:{configurable:true,value:Cr$2},props:{configurable:true,get:function(){return {data:this}}},__b:{configurable:true,value:1}});G$2(`__b`,function(r,t){if(typeof t.type==`string`){var e,i=t.props;for(var n in i)if(n!==`children`){var o=i[n];o instanceof I$2&&(e||(t.__np=e={}),e[n]=o,i[n]=o.peek());}}r(t);});G$2(`__r`,function(r,t){ht$3();var e,i=t.__c;i&&(i.__$f&=-2,(e=i.__$u)===void 0&&(i.__$u=e=(function(n){var o;return rt$2(function(){o=this;}),o.c=function(){i.__$f|=1,i.setState({});},o})())),ht$3(e),r(t);});G$2(`__e`,function(r,t,e,i){ht$3(),r(t,e,i);});G$2(`diffed`,function(r,t){ht$3();var e;if(typeof t.type==`string`&&(e=t.__e)){var i=t.__np,n=t.props;if(i){var o=e.U;if(o)for(var _ in o){var u=o[_];u!==void 0&&!(_ in i)&&(u.d(),o[_]=void 0);}else e.U=o={};for(var l in i){var c=o[l],h=i[l];c===void 0?(c=ee$2(e,l,h,n),o[l]=c):c.o(h,n);}}}r(t);});function ee$2(r,t,e,i){var n=t in r&&r.ownerSVGElement===void 0,o=b$1(e);return {o:function(_,u){o.value=_,i=u;},d:rt$2(function(){var _=o.value.value;i[t]!==_&&(i[t]=_,n?r[t]=_:_?r.setAttribute(t,_):r.removeAttribute(t));})}}G$2(`unmount`,function(r,t){if(typeof t.type==`string`){var e=t.__e;if(e){var i=e.U;if(i){e.U=void 0;for(var n in i){var o=i[n];o&&o.d();}}}}else {var _=t.__c;if(_){var u=_.__$u;u&&(_.__$u=void 0,u.d());}}r(t);});G$2(`__h`,function(r,t,e,i){(i<3||i===9)&&(t.__$f|=2),r(t,e,i);});M$4.prototype.shouldComponentUpdate=function(r,t){var e=this.__$u,i=e&&e.s!==void 0;for(var n in t)return true;if(this.__f||typeof this.u==`boolean`&&this.u===true){if(!(i||2&this.__$f||4&this.__$f)||1&this.__$f)return true}else if(!(i||4&this.__$f)||3&this.__$f)return true;for(var o in r)if(o!==`__source`&&r[o]!==this.props[o])return true;for(var _ in this.props)if(!(_ in r))return true;return false};function ie$3(r){return Bt$2(function(){return b$1(r)},[])}var pt$2=class pt{id;mID;vID;vName;imageURL;name;link;quantity;price;finalPrice;constructor(t){this.id=t.id,this.mID=t.mID,this.vID=t.vID,this.vName=t.vName,this.imageURL=t.imageURL,this.name=t.name,this.link=t.link,this.quantity=t.quantity,this.price=t.price,this.finalPrice=t.finalPrice??t.price;}};var U$2=class U{d;cmp;effective;constructor(t={}){this.d=t.d,this.cmp=t.cmp,this.effective=this.d;}get comparePrice(){return this.cmp??this.d}};var dt$2=class dt{url;alt;constructor(t){t.alt&&(this.alt=t.alt),this.url=t.url;}};var qt$1=class qt{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??false;}},mt$3=class mt{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedOptions;metafields;flatMetafields;selectedSellingPlan;effectivePrice;compareDiscountAmount;compareDiscountPercentage;constructor(t){t=t??{},this.mID=t.mID,this.name=t.name,this.imgs=t.imgs?.map(e=>new dt$2(e))??[],this.link=t.link,this.price=new U$2(t.price),this.sku=t.sku,this.isAvailable=t.isAvailable,this.quantity=t.quantity,this.selectedOptions=t.selectedOptions??[],this.metafields=t.metafields??[],this.effectivePrice=b$1(this.price.effective),this.compareDiscountAmount=b$1(this.price.comparePrice-this.price.d),this.compareDiscountPercentage=b$1(this.compareDiscountAmount.value/this.price.comparePrice*100),t.sellingPlans?.length&&(this.selectedSellingPlan=b$1(void 0)),this.sellingPlans=t.sellingPlans?.map(e=>{let i=new qt$1(e);return i.isSelected&&(this.selectedSellingPlan.value=i),i});}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(t){this.selectedSellingPlan.value=t;}hasEffectivePrice(){return this.effectivePrice.value!==this.price.d}};function zt$1(r,t){for(let e of r){let i=t.get(e.attr),n=Array.isArray(i),o=typeof i==`string`,_=typeof i==`number`&&typeof e.value==`number`,u=Array.isArray(e.value),l=true;switch(e.op){case `contains`:l=(n||o)&&i.includes(e.value);break;case `notContains`:l=(n||o)&&!i.includes(e.value);break;case `eq`:l=i===e.value;break;case `ne`:l=i!==e.value;break;case `gt`:l=_&&i>e.value;break;case `gte`:l=_&&i>=e.value;break;case `lt`:l=_&&i<e.value;break;case `lte`:l=_&&i<=e.value;break;case `in`:l=u&&e.value.includes(i);break;case `nin`:l=u&&!e.value.includes(i);break;case `between`:l=_&&u&&e.value.length===2&&i>=e.value[0]&&i<=e.value[1];break;case `all`:l=n&&u&&e.value.every(c=>i.includes(c));break;default:l=false;break}if(!l)return false}return true}var vt$2=class vt{id;mID;vars;quantity;meta;reviews;templateSuffix;cardClasses;vendor;minPrice;maxPrice;name;slug;link;imgs;options;descHtml;tags;productType;metafields;flatMetafields;selectedOrFirstVariant;selected=b$1(true);selectedQty=b$1(1);_showAddToCartButton;constructor(t){this.update(t),this.selectedOrFirstVariant=b$1(this.selectedVariant),this._showAddToCartButton=this.evaluateShowATCFlag();}get firstImageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}get showAddToCartButton(){return this._showAddToCartButton}set variants(t){this.vars=t,this.selectedOrFirstVariant.value=this.selectedVariant;}set selectedQuantity(t){this.selectedQty.value=Math.max(1,t);}get selectedVariant(){return this.vars.find(t=>t.isAvailable)??this.vars[0]}hasVariants(){return this.vars?.length>1}setSelectedVariant(t){this.selectedOrFirstVariant.value=t;}setSelectedVariantByID(t){if(!t)return;let e=this.vars.find(i=>i.mID===t.toString());e&&this.setSelectedVariant(e);}update(t){return this.id=t.id??this.id,this.mID=t.mID??this.mID,this.name=t.name??this.name,this.imgs=t.imgs??this.imgs,this.descHtml=t.descHtml??this.descHtml,this.link=t.link??this.link,this.slug=t.slug??this.slug,this.quantity=t.quantity??this.quantity,this.meta=t.meta??this.meta,this.productType=t.productType??this.productType,this.reviews=t.reviews??this.reviews,this.options=t.options??this.options,this.tags=t.tags??this.tags,this.templateSuffix=t.templateSuffix??this.templateSuffix,this.vendor=t.vendor??this.vendor,this.minPrice=t.minPrice?new U$2(t.minPrice):void 0,this.maxPrice=t.maxPrice?new U$2(t.maxPrice):void 0,t.vars&&(this.vars=t.vars.map(e=>new mt$3(e))),this}toEmbed(t){return t=t??this.selectedOrFirstVariant.value,new pt$2({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,i=this.name,n=this.productType,o=this.productType,_=this.variantImage??this.firstImageURL,u=this.meta,l=this.tags?.join(`,`)??``,c=this.reviews?.rating,h=this.reviews?.totalReviews,s$1=this.vendor,E=e.cmp&&e.cmp>e.d,a=t.compareDiscountAmount.value,g=Math.ceil(t.compareDiscountPercentage.value-.5),O=r$2(r$2(s$2(r$2(s$2(r$2({name:i},Gn$1(`price`,e.d,true)),{image_url:_,meta:u,category:n,type:o,rating:c,reviews:h,tags:l,vendor:s$1,metafields:this.flatMetafields,variant_count:this.vars?.length??0}),Gn$1(`compare_discount_amount`,a,false)),{compare_discount_percentage:g}),this.minPrice&&Gn$1(`minPrice`,this.minPrice.d,true)),this.maxPrice&&Gn$1(`maxPrice`,this.maxPrice.d,true));if(t.hasEffectivePrice()){let p=Gn$1(`effective_price`,t.effectivePrice.value,true);Object.assign(O,p);}if(E){let p=e.cmp-e.d,m={discount_percent:(p/e.cmp*100).toFixed(0)};Object.assign(O,m),Object.assign(O,Gn$1(`compare_price`,e.cmp)),Object.assign(O,Gn$1(`discount_price`,p));}return {product:O,variant:{name:t.name,quantity:t.quantity,sku:t.sku,metafields:t.flatMetafields}}}evaluateShowATCFlag(){let t=le$5.get().widgetCustomisation?.atcButton?.showWhen;if(!t?.predicates?.length)return true;let e=t.predicates,i=this.getValueMap(e);return t.op===`or`?e.some(n=>zt$1([n],i)):zt$1(e,i)}getValueMap(t){let e=new Map;for(let i of t){let n=i.attr.split(`.`);switch(n[1]){case `tags`:e.set(i.attr,this.tags);break;case `type`:case `category`:e.set(i.attr,this.productType);break;case `meta`:case `metafield`:{let _=n[2];if(!_)continue;e.set(i.attr,this.meta?.[_]);break}}}return e}};var Et$2=class Et{id;alt;shortID;sources;items;durationMS;thumbnail;card;bestSource;highSource;goodSource;lowSource;m3u8Source;constructor(t={}){if(this.id=t.id,this.alt=t.alt,this.shortID=t.shortID,this.sources=t.sources?.sort((e,i)=>i.height-e.height),this.durationMS=t.durationMS,this.thumbnail=t.thumbnail,this.items=t.items?t.items.map(e=>new vt$2(e)):[],this.card=t.card,this.sources){let e=[];for(let i of this.sources)i.format===`mp4`?e.push(i):i.format===`m3u8`&&!this.m3u8Source&&(this.m3u8Source=i);e.length>0&&(this.bestSource=e[0],this.highSource=e.length>1?e[1]:e[0],this.lowSource=e.length>2?e[e.length-1]:e[0]);}}};var ne$3=(e=>(e.CLASSIC=`CLASSIC`,e.ITEM_CARD_HEADER=`ITEM_CARD_HEADER`,e))(ne$3||{});var oe$5=(i=>(i.ON=`ON`,i.OFF=`OFF`,i.ON_HOVER=`ON_HOVER`,i))(oe$5||{}),se$3=(n=>(n.FIRST_ITEM=`FIRST_ITEM`,n.ITEM_SWIPER=`ITEM_SWIPER`,n.CARD=`CARD`,n.NONE=`NONE`,n))(se$3||{});var Dr$2=class Dr{videoEntries;source;template;heading;autoPlay;showMuteButton;footerContent;detailPopup;playlistConfig;itemDetailConfig;constructor(t={}){this.videoEntries=t.videoEntries?.map(e=>({video:new Et$2(e.video),title:e.title}))??[],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.autoPlay=t.autoPlay??`ON`,this.footerContent=t.footerContent??`FIRST_ITEM`,this.playlistConfig={videoSwiper:t.playlistConfig?.videoSwiper??void 0,itemCardClickBehavior:t.playlistConfig?.itemCardClickBehavior??`OPEN_VIDEO_DETAIL`},this.itemDetailConfig={template:t.itemDetailConfig?.template??`CLASSIC`};}showItems(){return this.footerContent===`FIRST_ITEM`||this.footerContent===`ITEM_SWIPER`}};var wr$3=class wr{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(t){this.t=t.t,t.bg&&(this.bg=new T$2(t.bg)),t.br&&(this.br=new C$3(t.br)),t.shd&&(this.shd=new Q$2(t.shd)),t.spc&&(this.spc=new D$1(t.spc)),this.trf=new j$2(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 B$3[this.t]}get click(){return this.clc}},B$3=(f=>(f[f.IMAGE=1]=`IMAGE`,f[f.TEXT=2]=`TEXT`,f[f.BUTTON=3]=`BUTTON`,f[f.FLEXBOX=4]=`FLEXBOX`,f[f.MULTI_COLUMN=5]=`MULTI_COLUMN`,f[f.CHECKBOX=6]=`CHECKBOX`,f[f.PARTIAL=8]=`PARTIAL`,f[f.PRODUCTS=11]=`PRODUCTS`,f[f.PRODUCT=12]=`PRODUCT`,f[f.PRODUCT_IMAGE=13]=`PRODUCT_IMAGE`,f[f.PRODUCT_TITLE=14]=`PRODUCT_TITLE`,f[f.PRODUCT_VARIATIONS=15]=`PRODUCT_VARIATIONS`,f[f.PRODUCT_VARIATIONS_SELLING_PLANS=16]=`PRODUCT_VARIATIONS_SELLING_PLANS`,f[f.PRODUCT_BUTTON=18]=`PRODUCT_BUTTON`,f[f.PRODUCT_RATING=19]=`PRODUCT_RATING`,f[f.EMAIL_INPUT=51]=`EMAIL_INPUT`,f[f.PHONE_INPUT=52]=`PHONE_INPUT`,f[f.COUNTDOWN_TIMER=61]=`COUNTDOWN_TIMER`,f[f.CAROUSEL=62]=`CAROUSEL`,f[f.SHAPE=100]=`SHAPE`,f))(B$3||{});var Ur$2=0;function _e$2(r=document.head){return Mr$3(fe$3.styleURL,r,`cooee-global-styles`)}function ue$2(r=document.head){return Mr$3(`${nn}/swiper-bundle.min.css`,r,`swiper-styles`)}function Mr$3(r,t=document.head,e){return new Promise(i=>{if(t.querySelector(`#${e}`)){i();return}let o=document.createElement(`link`);o.rel=`stylesheet`,o.href=r,o.id=e,o.onload=()=>{i();},o.onerror=()=>{console.error(`Failed to load stylesheet:`,r),i();},t.appendChild(o);})}function le$4(r,t=document.head){if(!r)return;Ur$2++;let e=document.createElement(`style`);e.id=`cooee-app-css-${Ur$2}`,e.textContent=r,t.appendChild(e);}function Ui$2(r){if(!r)return;let t=document.createElement(`script`);t.id=`cooee-app-script`,t.innerHTML=r,document.head.appendChild(t);}function Mi$2(r){if(r)try{(0,eval)(r);}catch(t){console.error(`Failed to execute script:`,t);}}async function Vi$2(){let r=(await import(`${nn}/swiper-bundle.min.mjs`)).Swiper;return window.CooeeSDK.Swiper=r}async function Hi$2(r,t=true){if(!r)return;let e=[];t&&e.push(ue$2(r)),e.push(_e$2(r)),await Promise.all(e);let i=le$5.get().website.commonCSS;le$4(i,r);}var ce$4=(function(r){return r[r.SINGLE=1]=`SINGLE`,r[r.EXCLUSION=2]=`EXCLUSION`,r[r.ABTESTING=3]=`ABTESTING`,r[r.GLOBAL_AB=4]=`GLOBAL_AB`,r})(ce$4||{});var fe$2=(function(r){return r.BEFORE=`before`,r.AFTER=`after`,r.INSIDE_FIRST=`insideFirst`,r.INSIDE_LAST=`insideLast`,r.BEFORE1=`BEFORE`,r.AFTER1=`AFTER`,r.INSIDE_FIRST1=`INSIDE_FIRST`,r.INSIDE_LAST1=`INSIDE_LAST`,r})(fe$2||{}),ae$4=(function(r){return r.SHOPIFY_CHECKOUT=`shopify_checkout`,r.THIRD_PARTY_CHECKOUT=`third_party_checkout`,r.CART_PAGE=`cart_page`,r.CART_DRAWER=`cart_drawer`,r})(ae$4||{});var he$3=(function(r){return r[r.NONE=0]=`NONE`,r[r.REJECT_POPUP=1]=`REJECT_POPUP`,r[r.ACCEPT_POPUP=2]=`ACCEPT_POPUP`,r[r.GO_TO_URL=4]=`GO_TO_URL`,r[r.SHARE=5]=`SHARE`,r[r.KEY_VALUE=100]=`KEY_VALUE`,r[r.GO_TO_PRODUCT=101]=`GO_TO_PRODUCT`,r[r.ADD_TO_CART=102]=`ADD_TO_CART`,r[r.COPY_COUPON_CODE=103]=`COPY_COUPON_CODE`,r[r.GO_TO_COLLECTION=104]=`GO_TO_COLLECTION`,r[r.OPEN_CART=105]=`OPEN_CART`,r[r.SUBMIT_FORM=106]=`SUBMIT_FORM`,r[r.INITIATE_CHECKOUT=107]=`INITIATE_CHECKOUT`,r[r.ADD_BUNDLE=108]=`ADD_BUNDLE`,r[r.UPGRADE_TO_SUBSCRIPTION=109]=`UPGRADE_TO_SUBSCRIPTION`,r[r.BUY_NOW=110]=`BUY_NOW`,r[r.QUICK_VIEW=111]=`QUICK_VIEW`,r})(he$3||{}),pe$3=(function(r){return r.POPUP=`POPUP`,r.PAGE_EMBED=`PAGE_EMBED`,r.CART_EMBED=`CART_EMBED`,r.ANNOUNCEMENT_BAR=`ANNOUNCEMENT_BAR`,r.CHECKOUT_PAGE=`CHECKOUT_PAGE`,r})(pe$3||{}),de$3=(function(r){return r.PRODUCT_PROMOTION=`PRODUCT_PROMOTION`,r.BUNDLE_AND_UPSELL=`BUNDLE_AND_UPSELL`,r.CART_RECOVERY=`CART_RECOVERY`,r.ANNOUNCEMENT=`ANNOUNCEMENT`,r.LEAD_GENERATION=`LEAD_GENERATION`,r.DATA_COLLECTION=`DATA_COLLECTION`,r.SALE_PROMOTION=`SALE_PROMOTION`,r.SUBSCRIPTION_UPSELL=`SUBSCRIPTION_UPSELL`,r.SHOPPABLE_VIDEO=`SHOPPABLE_VIDEO`,r.VIDEO_STORY=`VIDEO_STORY`,r.FLOATING_VIDEO=`FLOATING_VIDEO`,r.BYOB=`BYOB`,r.PROGRESS_BAR=`PROGRESS_BAR`,r.BUY_NOW=`BUY_NOW`,r.STICKY_ATC=`STICKY_ATC`,r.EXPERIMENT=`EXPERIMENT`,r.SAVINGS_BAR=`SAVINGS_BAR`,r.COLLECTION_FILTER=`COLLECTION_FILTER`,r.COLLECTION_PROMOTION=`COLLECTION_PROMOTION`,r.ADD_ONS=`ADD_ONS`,r})(de$3||{}),me$3=(function(r){return r.ICONS=`ICONS`,r.TILES=`TILES`,r})(me$3||{}),ve$4=(function(r){return r.FREE_SHIPPING=`FREE_SHIPPING`,r.DISCOUNT=`DISCOUNT`,r.FREE_AUTO_GIFT=`FREE_AUTO_GIFT`,r.FREE_GIFT_SELECT=`FREE_GIFT_SELECT`,r.UI_ONLY=`UI_ONLY`,r})(ve$4||{});var gt$2=class gt{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;}};var Nt$2=class Nt{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;}};var St$2=class St{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;}};var Qt$2=(n=>(n[n.START=0]=`START`,n[n.CENTER=1]=`CENTER`,n[n.END=2]=`END`,n[n.JUSTIFY=3]=`JUSTIFY`,n))(Qt$2||{});var It$2=class It{name;fonts;constructor(t){t=t??{},t.name&&(t.name=t.name!==`Arial`?t.name:``),this.name=t.name,this.fonts=t.fonts?.map(e=>new jt$2(e));}},jt$2=class jt{style;url;constructor(t){t=t??{},this.style=t.style,this.url=t.url;}getFontDescriptor(){return {style:this.style===2||this.style===4?`italic`:`normal`,weight:this.style===4||this.style===3?`700`:`400`}}getURL(){return `url('${this.url}') format('truetype')`}};var W$2=class W{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(t){this.update(t);}get alignment(){return Qt$2[this.ta]}get letterSpacing(){return this.ls?this.ls+`px`:`normal`}update(t){t=t??{},t.lh&&(this.lh=t.lh),t.tdc&&(this.tdc=new y$1(t.tdc)),this.td=t.td,this.fs=t.s??t.fs??60,this.tc=new y$1(t.tc),this.ta=t.ta??1,this.fw=t.fw??400,this.ls=t.ls??0,this.tc.h??=`#000000`,this.fam=new It$2(t.fam??t.fmly);}resize(t){this.s*=t,this.ls*=t;}};var Ot$2=class Ot{size;bg;br;spc;typo;lout;flex;constructor(t){t??={},this.spc=new D$1(t.spc),t.size&&(this.size=new St$2(t.size)),t.bg&&(this.bg=new T$2(t.bg)),t.br&&(this.br=new C$3(t.br)),t.typo&&(this.typo=new W$2(t.typo)),t.lout&&(this.lout=new Nt$2(t.lout)),t.flex&&(this.flex=new gt$2(t.flex));}},yt$2=class yt{sm;lg;constructor(t){t??={},this.sm=new Ot$2(t.sm),this.lg=new Ot$2(t.lg);}};var Rt$3=class Rt{t;classes;style;hide;when;clc;l;constructor(t,e){e??={},this.t=t,this.classes=e.classes??``,this.style=new yt$2(e.style),this.hide=e.hide,this.l=e.l,e.when?.op&&(this.when=e.when),e.clc&&(this.clc=e.clc);}get stringType(){return B$3[this.t]}};var bt$1=class bt extends Rt$3{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;}};var Ee$3=(i=>(i.SINGLE=`SINGLE`,i.MULTIPLE=`MULTIPLE`,i.CHIPS=`CHIPS`,i))(Ee$3||{}),Vr$3=class Vr extends bt$1{showChips;optionsConfig;type;horizontal;constructor(t=15,e){super(e,t),e??={},this.showChips=e.showChips??false,this.optionsConfig=e.optionsConfig??{},this.horizontal=e.horizontal,e.type?this.type=e.type:e.showChips?this.type=`CHIPS`:this.type=`SINGLE`;}};var ge$3=(i=>(i[i.LOW=1]=`LOW`,i[i.MEDIUM=2]=`MEDIUM`,i[i.HIGH=3]=`HIGH`,i))(ge$3||{}),Ne$3=(e=>(e.SINGLE_PANE=`SINGLE_PANE`,e.TWO_PANE=`TWO_PANE`,e))(Ne$3||{});function vn(r){if(!r)return {display:`block`};let t={display:r.disp};return r.of&&(t.objectFit=r.of),r.pos===`absolute`&&(t.width=`auto !important`,t.position=`absolute`,t.right=r.right+`px`,t.left=r.left+`px`,t.top=r.top+`px`,t.bottom=r.bottom+`px`),t}function En(r){return r?{gap:r.gap+`px`,flexWrap:r.wrap,flexDirection:r.dir,justifyContent:r.jc,alignItems:r.ai,width:`100%`}:{}}function Hr$2(r,t,e){if(e??={},r.type===`LINEAR`){let i=`linear-gradient(${r.ang}deg, ${r.c1}, ${r.c2}`;r.c3&&(i+=`, ${r.c3}`),i+=`)`,e[t]=i;}return e}function Jt$2(r,t=`color`,e){return e??={},r?r.grad?Hr$2(r.grad,t,e):(r.hex&&(e[t]=r.rgba),e):e}function P$2(r,t){return Se$5(r,t)+`px`}function Se$5(r,t=1){return (r??0)*t}function gn(r){let t={};return r?.w&&(t.width=r.w),r?.h&&(t.height=r.h),r?.maxW&&(t.maxWidth=r.maxW),r?.maxH&&(t.maxHeight=r.maxH),r?.minW&&(t.minWidth=r.minW),r?.minH&&(t.minHeight=r.minH),t}function Nn$2(r,t){if(!r)return {};let e={};return r.radius&&r.radius>0&&(e.borderRadius=P$2(r.radius,t)),r.width&&r.width>0&&(e.borderWidth=P$2(r.width,t),e.borderStyle=r.style?.toLowerCase(),r.color?Jt$2(r.color,`border-color`,e):e.borderColor=`black`),e}function Sn(r,t){let e={};return r?(e.paddingTop=P$2(r.pt,t),e.paddingBottom=P$2(r.pb,t),e.paddingLeft=P$2(r.pl,t),e.paddingRight=P$2(r.pr,t),e.marginTop=P$2(r.mt,t),e.marginBottom=P$2(r.mb,t),e.marginLeft=r.cent?`auto`:P$2(r.ml,t),e.marginRight=r.cent?`auto`:P$2(r.mr,t),e):(e.margin=`0 !important`,e.padding=`unset`,e)}function In(r){if(!r)return {};let t={};if(r.glossy){let e=`backdrop-filter`,i=`-webkit-`+e,n=`blur(${r.glossy.radius}px)`;if(!CSS.supports(i,n)&&!CSS.supports(e,n))return {background:r.glossy.fallback.rgba};if(t[i]=n,t[e]=n,r.glossy.color)return Jt$2(r.glossy.color,`background`,t)}else if(r.solid){if(r.solid.grad)return Hr$2(r.solid.grad,`background`,t);if(r.solid.hex)return {backgroundColor:r.solid.rgba}}else if(r.img){if(!r.img.src)return {};let e=(r.img.a??0)/100;t.background=`linear-gradient(rgba(0, 0, 0, ${e}), rgba(0, 0, 0, ${e})),url("${r.img.src}") no-repeat center`,t.backgroundSize=`cover`,r.img.a&&(t[`-webkit-backdrop-filter`]=`opacity(${r.img.a})`,t.backdropFilter=`opacity(${r.img.a})`);}return t}function On$1(r=new W$2){let t={};return t.letterSpacing=r.letterSpacing,t.fontSize=r.fs+`px`,t.lineHeight=r.lh,t.fontFamily=r.fam.name||`inherit`,t.textAlign=r.alignment,t.fontWeight=r.fw,t.textDecoration=r.td??`none`,Jt$2(r.tc,`color`,t),t.boxShadow=`none`,t}
|
|
12
|
+
var q$3=`a-f\\d`,kr$4=`#?[${q$3}]{3}[${q$3}]?`,Gr$2=`#?[${q$3}]{6}([${q$3}]{2})?`,Br$3=new RegExp(`[^#${q$3}]`,`gi`),Wr$3=new RegExp(`^${kr$4}$|^${Gr$2}$`,`i`);function xt$1(r,t={}){if(typeof r!=`string`||Br$3.test(r)||!Wr$3.test(r))throw new TypeError(`Expected a valid hex string`);r=r.replace(/^#/,``);let e=1;r.length===8&&(e=Number.parseInt(r.slice(6,8),16)/255,r=r.slice(0,6)),r.length===4&&(e=Number.parseInt(r.slice(3,4).repeat(2),16)/255,r=r.slice(0,3)),r.length===3&&(r=r[0]+r[0]+r[1]+r[1]+r[2]+r[2]);let i=Number.parseInt(r,16),n=i>>16,o=i>>8&255,_=i&255,u=typeof t.alpha==`number`?t.alpha:e;if(t.format===`array`)return [n,o,_,u];if(t.format===`css`)return `rgb(${n} ${o} ${_}${u===1?``:` / ${Number((u*100).toFixed(2))}%`})`;return {red:n,green:o,blue:_,alpha:u}}var y$1=class y{h;a=100;g;constructor(t){t??={},this.h=t.h,this.a=t.a,this.g=t.g;}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return ``;try{return xt$1(this.hex,{format:`css`,alpha:this.getAlpha()})}catch(t){return console.error(`Invalid hex`,t),`#000000`}}getAlpha(){return (this.a??100)/100}};var T$2=class T{s;g;i;constructor(t){t.s&&(this.s=new y$1(t.s)),t.g&&(this.g=new z$3(t.g)),this.i=t.i;}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}};var C$3=class C{s;r;w;c;constructor(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new y$1(t.c));}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return rr$4[this.s??1]}},rr$4=(e=>(e[e.SOLID=1]=`SOLID`,e[e.DASHED=2]=`DASHED`,e))(rr$4||{});var z$3=class r{static DEFAULT_FALLBACK=new y$1({h:`#000000`,a:50});r;c;fb;constructor(t){this.r=t.r,t.c&&(this.c=new y$1(t.c)),t.fb&&(this.fb=new y$1(t.fb));}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??r.DEFAULT_FALLBACK}};var Q$2=class Q{blur;spr;clr;x;y;constructor(t){t=t??{},this.blur=t.blur??0,this.spr=t.spr??0,this.x=t.x??0,this.y=t.y??0,this.clr=new y$1(t.clr);}getStyle(t){return `${this.x*t}px ${this.y*t}px ${this.blur*t}px ${this.spr*t}px ${this.clr.rgba}`}};var D$2=class D{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(t){t=t??{},this.pl=t.pl??0,this.pr=t.pr??0,this.pt=t.pt??0,this.pb=t.pb??0,this.ml=t.ml??0,this.mr=t.mr??0,this.mt=t.mt??0,this.mb=t.mb??0,this.cent=t.cent??false;}getHorizontal(){return this.pl+this.pr}getVertical(){return this.pt+this.pb}getPaddingCSS(){return `${this.pt}px ${this.pr}px ${this.pb}px ${this.pl}px`}};var j$2=class j{rot;constructor(t){t?.rot&&(this.rot=t.rot);}get rotate(){return this.rot}},ut$3,d$1,sr$4,Dt$1,w$2,er$4,_r$4,ur$4,lr$4,wt$1,Tt,Ct$3,J$2={},cr$3=[],$r$2=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,lt$3=Array.isArray;function A$3(r,t){for(var e in t)r[e]=t[e];return r}function Ut$1(r){r&&r.parentNode&&r.parentNode.removeChild(r);}function Yr$2(r,t,e){var i,n,o,_={};for(o in t)o==`key`?i=t[o]:o==`ref`?n=t[o]:_[o]=t[o];if(arguments.length>2&&(_.children=arguments.length>3?ut$3.call(arguments,2):e),typeof r==`function`&&r.defaultProps!=null)for(o in r.defaultProps)_[o]===void 0&&(_[o]=r.defaultProps[o]);return st$3(r,_,i,n,null)}function st$3(r,t,e,i,n){var o={type:r,props:t,key:e,ref:i,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++sr$4,__i:-1,__u:0};return n==null&&d$1.vnode!=null&&d$1.vnode(o),o}function ct$3(r){return r.children}function M$4(r,t){this.props=r,this.context=t;}function V$3(r,t){if(t==null)return r.__?V$3(r.__,r.__i+1):null;for(var e;t<r.__k.length;t++)if((e=r.__k[t])!=null&&e.__e!=null)return e.__e;return typeof r.type==`function`?V$3(r):null}function fr$4(r){var t,e;if((r=r.__)!=null&&r.__c!=null){for(r.__e=r.__c.base=null,t=0;t<r.__k.length;t++)if((e=r.__k[t])!=null&&e.__e!=null){r.__e=r.__c.base=e.__e;break}return fr$4(r)}}function ir$4(r){(!r.__d&&(r.__d=true)&&w$2.push(r)&&!_t$2.__r++||er$4!=d$1.debounceRendering)&&((er$4=d$1.debounceRendering)||_r$4)(_t$2);}function _t$2(){for(var r,t,e,i,n,o,_,u=1;w$2.length;)w$2.length>u&&w$2.sort(ur$4),r=w$2.shift(),u=w$2.length,r.__d&&(e=void 0,n=(i=(t=r).__v).__e,o=[],_=[],t.__P&&((e=A$3({},i)).__v=i.__v+1,d$1.vnode&&d$1.vnode(e),Mt$2(t.__P,e,i,t.__n,t.__P.namespaceURI,32&i.__u?[n]:null,o,n??V$3(i),!!(32&i.__u),_),e.__v=i.__v,e.__.__k[e.__i]=e,pr$4(o,e,_),e.__e!=n&&fr$4(e)));_t$2.__r=0;}function ar$4(r,t,e,i,n,o,_,u,l,c,h){var s,E,a,g,I,N,p=i&&i.__k||cr$3,m=t.length;for(l=Kr$2(e,t,p,l,m),s=0;s<m;s++)(a=e.__k[s])!=null&&(E=a.__i==-1?J$2:p[a.__i]||J$2,a.__i=s,N=Mt$2(r,a,E,n,o,_,u,l,c,h),g=a.__e,a.ref&&E.ref!=a.ref&&(E.ref&&Vt$2(E.ref,null,a),h.push(a.ref,a.__c||g,a)),I==null&&g!=null&&(I=g),4&a.__u||E.__k===a.__k?l=hr$4(a,l,r):typeof a.type==`function`&&N!==void 0?l=N:g&&(l=g.nextSibling),a.__u&=-7);return e.__e=I,l}function Kr$2(r,t,e,i,n){var o,_,u,l,c,h=e.length,s=h,E=0;for(r.__k=new Array(n),o=0;o<n;o++)(_=t[o])!=null&&typeof _!=`boolean`&&typeof _!=`function`?(l=o+E,(_=r.__k[o]=typeof _==`string`||typeof _==`number`||typeof _==`bigint`||_.constructor==String?st$3(null,_,null,null,null):lt$3(_)?st$3(ct$3,{children:_},null,null,null):_.constructor==null&&_.__b>0?st$3(_.type,_.props,_.key,_.ref?_.ref:null,_.__v):_).__=r,_.__b=r.__b+1,u=null,(c=_.__i=Xr$2(_,e,l,s))!=-1&&(s--,(u=e[c])&&(u.__u|=2)),u==null||u.__v==null?(c==-1&&(n>h?E--:n<h&&E++),typeof _.type!=`function`&&(_.__u|=4)):c!=l&&(c==l-1?E--:c==l+1?E++:(c>l?E--:E++,_.__u|=4))):r.__k[o]=null;if(s)for(o=0;o<h;o++)(u=e[o])!=null&&!(2&u.__u)&&(u.__e==i&&(i=V$3(u)),mr$3(u,u));return i}function hr$4(r,t,e){var i,n;if(typeof r.type==`function`){for(i=r.__k,n=0;i&&n<i.length;n++)i[n]&&(i[n].__=r,t=hr$4(i[n],t,e));return t}r.__e!=t&&(t&&r.type&&!e.contains(t)&&(t=V$3(r)),e.insertBefore(r.__e,t||null),t=r.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Xr$2(r,t,e,i){var n,o,_=r.key,u=r.type,l=t[e];if(l===null&&r.key==null||l&&_==l.key&&u==l.type&&(2&l.__u)==0)return e;if(i>(l!=null&&(2&l.__u)==0?1:0))for(n=e-1,o=e+1;n>=0||o<t.length;){if(n>=0){if((l=t[n])&&(2&l.__u)==0&&_==l.key&&u==l.type)return n;n--;}if(o<t.length){if((l=t[o])&&(2&l.__u)==0&&_==l.key&&u==l.type)return o;o++;}}return -1}function nr$3(r,t,e){t[0]==`-`?r.setProperty(t,e??``):r[t]=e==null?``:typeof e!=`number`||$r$2.test(t)?e:e+`px`;}function ot$2(r,t,e,i,n){var o,_;t:if(t==`style`)if(typeof e==`string`)r.style.cssText=e;else {if(typeof i==`string`&&(r.style.cssText=i=``),i)for(t in i)e&&t in e||nr$3(r.style,t,``);if(e)for(t in e)i&&e[t]==i[t]||nr$3(r.style,t,e[t]);}else if(t[0]==`o`&&t[1]==`n`)o=t!=(t=t.replace(lr$4,`$1`)),_=t.toLowerCase(),t=_ in r||t==`onFocusOut`||t==`onFocusIn`?_.slice(2):t.slice(2),r.l||(r.l={}),r.l[t+o]=e,e?i?e.u=i.u:(e.u=wt$1,r.addEventListener(t,o?Ct$3:Tt,o)):r.removeEventListener(t,o?Ct$3:Tt,o);else {if(n==`http://www.w3.org/2000/svg`)t=t.replace(/xlink(H|:h)/,`h`).replace(/sName$/,`s`);else if(t!=`width`&&t!=`height`&&t!=`href`&&t!=`list`&&t!=`form`&&t!=`tabIndex`&&t!=`download`&&t!=`rowSpan`&&t!=`colSpan`&&t!=`role`&&t!=`popover`&&t in r)try{r[t]=e??``;break t}catch{}typeof e==`function`||(e==null||e===false&&t[4]!=`-`?r.removeAttribute(t):r.setAttribute(t,t==`popover`&&e==1?``:e));}}function or$4(r){return function(t){if(this.l){var e=this.l[t.type+r];if(t.t==null)t.t=wt$1++;else if(t.t<e.u)return;return e(d$1.event?d$1.event(t):t)}}}function Mt$2(r,t,e,i,n,o,_,u,l,c){var h,s,E,a,g,I,N,p,m,F,f,et,$,Zt,it,Y,bt,b=t.type;if(t.constructor!=null)return null;128&e.__u&&(l=!!(32&e.__u),o=[u=t.__e=e.__e]),(h=d$1.__b)&&h(t);t:if(typeof b==`function`)try{if(p=t.props,m=`prototype`in b&&b.prototype.render,F=(h=b.contextType)&&i[h.__c],f=h?F?F.props.value:h.__:i,e.__c?N=(s=t.__c=e.__c).__=s.__E:(m?t.__c=s=new b(p,f):(t.__c=s=new M$4(p,f),s.constructor=b,s.render=zr$2),F&&F.sub(s),s.props=p,s.state||(s.state={}),s.context=f,s.__n=i,E=s.__d=!0,s.__h=[],s._sb=[]),m&&s.__s==null&&(s.__s=s.state),m&&b.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=A$3({},s.__s)),A$3(s.__s,b.getDerivedStateFromProps(p,s.__s))),a=s.props,g=s.state,s.__v=t,E)m&&b.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),m&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else {if(m&&b.getDerivedStateFromProps==null&&p!==a&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(p,f),!s.__e&&s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(p,s.__s,f)===!1||t.__v==e.__v){for(t.__v!=e.__v&&(s.props=p,s.state=s.__s,s.__d=!1),t.__e=e.__e,t.__k=e.__k,t.__k.some(function(K){K&&(K.__=t);}),et=0;et<s._sb.length;et++)s.__h.push(s._sb[et]);s._sb=[],s.__h.length&&_.push(s);break t}s.componentWillUpdate!=null&&s.componentWillUpdate(p,s.__s,f),m&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(a,g,I);});}if(s.context=f,s.props=p,s.__P=r,s.__e=!1,$=d$1.__r,Zt=0,m){for(s.state=s.__s,s.__d=!1,$&&$(t),h=s.render(s.props,s.state,s.context),it=0;it<s._sb.length;it++)s.__h.push(s._sb[it]);s._sb=[];}else do s.__d=!1,$&&$(t),h=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++Zt<25);s.state=s.__s,s.getChildContext!=null&&(i=A$3(A$3({},i),s.getChildContext())),m&&!E&&s.getSnapshotBeforeUpdate!=null&&(I=s.getSnapshotBeforeUpdate(a,g)),Y=h,h!=null&&h.type===ct$3&&h.key==null&&(Y=dr$4(h.props.children)),u=ar$4(r,lt$3(Y)?Y:[Y],t,e,i,n,o,_,u,l,c),s.base=t.__e,t.__u&=-161,s.__h.length&&_.push(s),N&&(s.__E=s.__=null);}catch(K){if(t.__v=null,l||o!=null)if(K.then){for(t.__u|=l?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;o[o.indexOf(u)]=null,t.__e=u;}else for(bt=o.length;bt--;)Ut$1(o[bt]);else t.__e=e.__e,t.__k=e.__k;d$1.__e(K,t,e);}else o==null&&t.__v==e.__v?(t.__k=e.__k,t.__e=e.__e):u=t.__e=qr$2(e.__e,t,e,i,n,o,_,l,c);return (h=d$1.diffed)&&h(t),128&t.__u?void 0:u}function pr$4(r,t,e){for(var i=0;i<e.length;i++)Vt$2(e[i],e[++i],e[++i]);d$1.__c&&d$1.__c(t,r),r.some(function(n){try{r=n.__h,n.__h=[],r.some(function(o){o.call(n);});}catch(o){d$1.__e(o,n.__v);}});}function dr$4(r){return typeof r!=`object`||r==null||r.__b&&r.__b>0?r:lt$3(r)?r.map(dr$4):A$3({},r)}function qr$2(r,t,e,i,n,o,_,u,l){var c,h,s,E,a,g,I,N=e.props,p=t.props,m=t.type;if(m==`svg`?n=`http://www.w3.org/2000/svg`:m==`math`?n=`http://www.w3.org/1998/Math/MathML`:n||(n=`http://www.w3.org/1999/xhtml`),o!=null){for(c=0;c<o.length;c++)if((a=o[c])&&`setAttribute`in a==!!m&&(m?a.localName==m:a.nodeType==3)){r=a,o[c]=null;break}}if(r==null){if(m==null)return document.createTextNode(p);r=document.createElementNS(n,m,p.is&&p),u&&(d$1.__m&&d$1.__m(t,o),u=false),o=null;}if(m==null)N===p||u&&r.data==p||(r.data=p);else {if(o=o&&ut$3.call(r.childNodes),N=e.props||J$2,!u&&o!=null)for(N={},c=0;c<r.attributes.length;c++)N[(a=r.attributes[c]).name]=a.value;for(c in N)if(a=N[c],c!=`children`){if(c==`dangerouslySetInnerHTML`)s=a;else if(!(c in p)){if(c==`value`&&`defaultValue`in p||c==`checked`&&`defaultChecked`in p)continue;ot$2(r,c,null,a,n);}}for(c in p)a=p[c],c==`children`?E=a:c==`dangerouslySetInnerHTML`?h=a:c==`value`?g=a:c==`checked`?I=a:u&&typeof a!=`function`||N[c]===a||ot$2(r,c,a,N[c],n);if(h)u||s&&(h.__html==s.__html||h.__html==r.innerHTML)||(r.innerHTML=h.__html),t.__k=[];else if(s&&(r.innerHTML=``),ar$4(t.type==`template`?r.content:r,lt$3(E)?E:[E],t,e,i,m==`foreignObject`?`http://www.w3.org/1999/xhtml`:n,o,_,o?o[0]:e.__k&&V$3(e,0),u,l),o!=null)for(c=o.length;c--;)Ut$1(o[c]);u||(c=`value`,m==`progress`&&g==null?r.removeAttribute(`value`):g!=null&&(g!==r[c]||m==`progress`&&!g||m==`option`&&g!=N[c])&&ot$2(r,c,g,N[c],n),c=`checked`,I!=null&&I!=r[c]&&ot$2(r,c,I,N[c],n));}return r}function Vt$2(r,t,e){try{if(typeof r==`function`){var i=typeof r.__u==`function`;i&&r.__u(),i&&t==null||(r.__u=r(t));}else r.current=t;}catch(n){d$1.__e(n,e);}}function mr$3(r,t,e){var i,n;if(d$1.unmount&&d$1.unmount(r),(i=r.ref)&&(i.current&&i.current!=r.__e||Vt$2(i,null,t)),(i=r.__c)!=null){if(i.componentWillUnmount)try{i.componentWillUnmount();}catch(o){d$1.__e(o,t);}i.base=i.__P=null;}if(i=r.__k)for(n=0;n<i.length;n++)i[n]&&mr$3(i[n],t,e||typeof r.type!=`function`);e||Ut$1(r.__e),r.__c=r.__=r.__e=void 0;}function zr$2(r,t,e){return this.constructor(r,e)}function $e$2(r,t,e){var i,n,o,_;t==document&&(t=document.documentElement),d$1.__&&d$1.__(r,t),n=(i="undefined"==`function`)?null:t.__k,o=[],_=[],Mt$2(t,r=(t).__k=Yr$2(ct$3,null,[r]),n||J$2,J$2,t.namespaceURI,n?null:t.firstChild?ut$3.call(t.childNodes):null,o,n?n.__e:t.firstChild,i,_),pr$4(o,r,_);}ut$3=cr$3.slice,d$1={__e:function(r,t,e,i){for(var n,o,_;t=t.__;)if((n=t.__c)&&!n.__)try{if((o=n.constructor)&&o.getDerivedStateFromError!=null&&(n.setState(o.getDerivedStateFromError(r)),_=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(r,i||{}),_=n.__d),_)return n.__E=n}catch(u){r=u;}throw r}},sr$4=0,Dt$1=function(r){return r!=null&&r.constructor==null},M$4.prototype.setState=function(r,t){var e=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=A$3({},this.state);typeof r==`function`&&(r=r(A$3({},e),this.props)),r&&A$3(e,r),r!=null&&this.__v&&(t&&this._sb.push(t),ir$4(this));},M$4.prototype.forceUpdate=function(r){this.__v&&(this.__e=true,r&&this.__h.push(r),ir$4(this));},M$4.prototype.render=ct$3,w$2=[],_r$4=typeof Promise==`function`?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ur$4=function(r,t){return r.__v.__b-t.__v.__b},_t$2.__r=0,lr$4=/(PointerCapture)$|Capture$/i,wt$1=0,Tt=or$4(false),Ct$3=or$4(true);var kt$3,P$1,Ht$2,vr$2,Er$3=0,Rr$3=[],S$3=d$1,gr$4=S$3.__b,Nr$3=S$3.__r,Sr$3=S$3.diffed,Or$3=S$3.__c,Ir$4=S$3.unmount,yr$2=S$3.__;function Qr$2(r,t){S$3.__h&&S$3.__h(P$1,r,Er$3||t),Er$3=0;var e=P$1.__H||(P$1.__H={__:[],__h:[]});return r>=e.__.length&&e.__.push({}),e.__[r]}function Bt$2(r,t){var e=Qr$2(kt$3++,7);return Zr$2(e.__H,t)&&(e.__=r(),e.__H=t,e.__h=r),e.__}function jr$1(){for(var r;r=Rr$3.shift();)if(r.__P&&r.__H)try{r.__H.__h.forEach(ft$3),r.__H.__h.forEach(Gt$1),r.__H.__h=[];}catch(t){r.__H.__h=[],S$3.__e(t,r.__v);}}S$3.__b=function(r){P$1=null,gr$4&&gr$4(r);},S$3.__=function(r,t){r&&t.__k&&t.__k.__m&&(r.__m=t.__k.__m),yr$2&&yr$2(r,t);},S$3.__r=function(r){Nr$3&&Nr$3(r),kt$3=0;var t=(P$1=r.__c).__H;t&&(Ht$2===P$1?(t.__h=[],P$1.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0;})):(t.__h.forEach(ft$3),t.__h.forEach(Gt$1),t.__h=[],kt$3=0)),Ht$2=P$1;},S$3.diffed=function(r){Sr$3&&Sr$3(r);var t=r.__c;t&&t.__H&&(t.__H.__h.length&&(Rr$3.push(t)!==1&&vr$2===S$3.requestAnimationFrame||((vr$2=S$3.requestAnimationFrame)||Jr$2)(jr$1)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0;})),Ht$2=P$1=null;},S$3.__c=function(r,t){t.some(function(e){try{e.__h.forEach(ft$3),e.__h=e.__h.filter(function(i){return !i.__||Gt$1(i)});}catch(i){t.some(function(n){n.__h&&(n.__h=[]);}),t=[],S$3.__e(i,e.__v);}}),Or$3&&Or$3(r,t);},S$3.unmount=function(r){Ir$4&&Ir$4(r);var t,e=r.__c;e&&e.__H&&(e.__H.__.forEach(function(i){try{ft$3(i);}catch(n){t=n;}}),e.__H=void 0,t&&S$3.__e(t,e.__v));};var Pr$4=typeof requestAnimationFrame==`function`;function Jr$2(r){var t,e=function(){clearTimeout(i),Pr$4&&cancelAnimationFrame(t),setTimeout(r);},i=setTimeout(e,35);Pr$4&&(t=requestAnimationFrame(e));}function ft$3(r){var t=P$1,e=r.__c;typeof e==`function`&&(r.__c=void 0,e()),P$1=t;}function Gt$1(r){var t=P$1;r.__c=r.__(),P$1=t;}function Zr$2(r,t){return !r||r.length!==t.length||t.some(function(e,i){return e!==r[i]})}var te$4=Symbol.for(`preact-signals`);function Ft$2(){if(H$5>1)H$5--;else {for(var r,t=false;Z$1!==void 0;){var e=Z$1;for(Z$1=void 0,Wt$1++;e!==void 0;){var i=e.o;if(e.o=void 0,e.f&=-3,!(8&e.f)&&Lr$2(e))try{e.c();}catch(n){t||(r=n,t=true);}e=i;}}if(Wt$1=0,H$5--,t)throw r}}var v$2=void 0;var Z$1=void 0,H$5=0,Wt$1=0,at$2=0;function br$3(r){if(v$2!==void 0){var t=r.n;if(t===void 0||t.t!==v$2)return t={i:0,S:r,p:v$2.s,n:void 0,t:v$2,e:void 0,x:void 0,r:t},v$2.s!==void 0&&(v$2.s.n=t),v$2.s=t,r.n=t,32&v$2.f&&r.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=v$2.s,t.n=void 0,v$2.s.n=t,v$2.s=t),t}}function O$1(r){this.v=r,this.i=0,this.n=void 0,this.t=void 0;}O$1.prototype.brand=te$4;O$1.prototype.h=function(){return true};O$1.prototype.S=function(r){this.t!==r&&r.e===void 0&&(r.x=this.t,this.t!==void 0&&(this.t.e=r),this.t=r);};O$1.prototype.U=function(r){if(this.t!==void 0){var t=r.e,e=r.x;t!==void 0&&(t.x=e,r.e=void 0),e!==void 0&&(e.e=t,r.x=void 0),r===this.t&&(this.t=e);}};O$1.prototype.subscribe=function(r){var t=this;return rt$2(function(){var e=t.value,i=v$2;v$2=void 0;try{r(e);}finally{v$2=i;}})};O$1.prototype.valueOf=function(){return this.value};O$1.prototype.toString=function(){return this.value+``};O$1.prototype.toJSON=function(){return this.value};O$1.prototype.peek=function(){var r=v$2;v$2=void 0;try{return this.value}finally{v$2=r;}};Object.defineProperty(O$1.prototype,`value`,{get:function(){var r=br$3(this);return r!==void 0&&(r.i=this.i),this.v},set:function(r){if(r!==this.v){if(Wt$1>100)throw new Error(`Cycle detected`);this.v=r,this.i++,at$2++,H$5++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N();}finally{Ft$2();}}}});function R$3(r){return new O$1(r)}function Lr$2(r){for(var t=r.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return true;return false}function Ar$2(r){for(var t=r.s;t!==void 0;t=t.n){var e=t.S.n;if(e!==void 0&&(t.r=e),t.S.n=t,t.i=-1,t.n===void 0){r.s=t;break}}}function xr$3(r){for(var t=r.s,e=void 0;t!==void 0;){var i=t.p;t.i===-1?(t.S.U(t),i!==void 0&&(i.n=t.n),t.n!==void 0&&(t.n.p=i)):e=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=i;}r.s=e;}function k$3(r){O$1.call(this,void 0),this.x=r,this.s=void 0,this.g=at$2-1,this.f=4;}(k$3.prototype=new O$1).h=function(){if(this.f&=-3,1&this.f)return false;if((36&this.f)==32||(this.f&=-5,this.g===at$2))return true;if(this.g=at$2,this.f|=1,this.i>0&&!Lr$2(this))return this.f&=-2,true;var r=v$2;try{Ar$2(this),v$2=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++);}catch(e){this.v=e,this.f|=16,this.i++;}return v$2=r,xr$3(this),this.f&=-2,true};k$3.prototype.S=function(r){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t);}O$1.prototype.S.call(this,r);};k$3.prototype.U=function(r){if(this.t!==void 0&&(O$1.prototype.U.call(this,r),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t);}};k$3.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var r=this.t;r!==void 0;r=r.x)r.t.N();}};Object.defineProperty(k$3.prototype,`value`,{get:function(){if(1&this.f)throw new Error(`Cycle detected`);var r=br$3(this);if(this.h(),r!==void 0&&(r.i=this.i),16&this.f)throw this.v;return this.v}});function $t$2(r){return new k$3(r)}function Tr$3(r){var t=r.u;if(r.u=void 0,typeof t==`function`){H$5++;var e=v$2;v$2=void 0;try{t();}catch(i){throw r.f&=-2,r.f|=8,Yt$2(r),i}finally{v$2=e,Ft$2();}}}function Yt$2(r){for(var t=r.s;t!==void 0;t=t.n)t.S.U(t);r.x=void 0,r.s=void 0,Tr$3(r);}function re$4(r){if(v$2!==this)throw new Error(`Out-of-order effect`);xr$3(this),v$2=r,this.f&=-2,8&this.f&&Yt$2(this),Ft$2();}function tt$2(r){this.x=r,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32;}tt$2.prototype.c=function(){var r=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t==`function`&&(this.u=t);}finally{r();}};tt$2.prototype.S=function(){if(1&this.f)throw new Error(`Cycle detected`);this.f|=1,this.f&=-9,Tr$3(this),Ar$2(this),H$5++;var r=v$2;return v$2=this,re$4.bind(this,r)};tt$2.prototype.N=function(){2&this.f||(this.f|=2,this.o=Z$1,Z$1=this);};tt$2.prototype.d=function(){this.f|=8,1&this.f||Yt$2(this);};function rt$2(r){var t=new tt$2(r);try{t.c();}catch(e){throw t.d(),e}return t.d.bind(t)}var Kt$2;function G$2(r,t){d$1[r]=t.bind(null,d$1[r]||function(){});}function ht$3(r){Kt$2&&Kt$2(),Kt$2=r&&r.S();}function Cr$2(r){var t=this,e=r.data,i=ie$3(e);i.value=e;var n=Bt$2(function(){for(var o=t.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return t.__$u.c=function(){var _,u=t.__$u.S(),l=n.value;u(),Dt$1(l)||((_=t.base)==null?void 0:_.nodeType)!==3?(t.__$f|=1,t.setState({})):t.base.data=l;},$t$2(function(){var _=i.value.value;return _===0?0:_===true?``:_||``})},[]);return n.value}Cr$2.displayName=`_st`;Object.defineProperties(O$1.prototype,{constructor:{configurable:true,value:void 0},type:{configurable:true,value:Cr$2},props:{configurable:true,get:function(){return {data:this}}},__b:{configurable:true,value:1}});G$2(`__b`,function(r,t){if(typeof t.type==`string`){var e,i=t.props;for(var n in i)if(n!==`children`){var o=i[n];o instanceof O$1&&(e||(t.__np=e={}),e[n]=o,i[n]=o.peek());}}r(t);});G$2(`__r`,function(r,t){ht$3();var e,i=t.__c;i&&(i.__$f&=-2,(e=i.__$u)===void 0&&(i.__$u=e=(function(n){var o;return rt$2(function(){o=this;}),o.c=function(){i.__$f|=1,i.setState({});},o})())),ht$3(e),r(t);});G$2(`__e`,function(r,t,e,i){ht$3(),r(t,e,i);});G$2(`diffed`,function(r,t){ht$3();var e;if(typeof t.type==`string`&&(e=t.__e)){var i=t.__np,n=t.props;if(i){var o=e.U;if(o)for(var _ in o){var u=o[_];u!==void 0&&!(_ in i)&&(u.d(),o[_]=void 0);}else e.U=o={};for(var l in i){var c=o[l],h=i[l];c===void 0?(c=ee$2(e,l,h,n),o[l]=c):c.o(h,n);}}}r(t);});function ee$2(r,t,e,i){var n=t in r&&r.ownerSVGElement===void 0,o=R$3(e);return {o:function(_,u){o.value=_,i=u;},d:rt$2(function(){var _=o.value.value;i[t]!==_&&(i[t]=_,n?r[t]=_:_?r.setAttribute(t,_):r.removeAttribute(t));})}}G$2(`unmount`,function(r,t){if(typeof t.type==`string`){var e=t.__e;if(e){var i=e.U;if(i){e.U=void 0;for(var n in i){var o=i[n];o&&o.d();}}}}else {var _=t.__c;if(_){var u=_.__$u;u&&(_.__$u=void 0,u.d());}}r(t);});G$2(`__h`,function(r,t,e,i){(i<3||i===9)&&(t.__$f|=2),r(t,e,i);});M$4.prototype.shouldComponentUpdate=function(r,t){var e=this.__$u,i=e&&e.s!==void 0;for(var n in t)return true;if(this.__f||typeof this.u==`boolean`&&this.u===true){if(!(i||2&this.__$f||4&this.__$f)||1&this.__$f)return true}else if(!(i||4&this.__$f)||3&this.__$f)return true;for(var o in r)if(o!==`__source`&&r[o]!==this.props[o])return true;for(var _ in this.props)if(!(_ in r))return true;return false};function ie$3(r){return Bt$2(function(){return R$3(r)},[])}var pt$2=class pt{id;mID;vID;vName;imageURL;name;link;quantity;price;finalPrice;constructor(t){this.id=t.id,this.mID=t.mID,this.vID=t.vID,this.vName=t.vName,this.imageURL=t.imageURL,this.name=t.name,this.link=t.link,this.quantity=t.quantity,this.price=t.price,this.finalPrice=t.finalPrice??t.price;}};var U$2=class U{d;cmp;effective;constructor(t={}){this.d=t.d,this.cmp=t.cmp,this.effective=this.d;}get comparePrice(){return this.cmp??this.d}};var dt$3=class dt{url;alt;constructor(t){t.alt&&(this.alt=t.alt),this.url=t.url;}};var qt$1=class qt{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??false;}},mt$3=class mt{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedOptions;metafields;flatMetafields;selectedSellingPlan;effectivePrice;compareDiscountAmount;compareDiscountPercentage;constructor(t){t=t??{},this.mID=t.mID,this.name=t.name,this.imgs=t.imgs?.map(e=>new dt$3(e))??[],this.link=t.link,this.price=new U$2(t.price),this.sku=t.sku,this.isAvailable=t.isAvailable,this.quantity=t.quantity,this.selectedOptions=t.selectedOptions??[],this.metafields=t.metafields??[],this.effectivePrice=R$3(this.price.effective),this.compareDiscountAmount=R$3(this.price.comparePrice-this.price.d),this.compareDiscountPercentage=R$3(this.compareDiscountAmount.value/this.price.comparePrice*100),t.sellingPlans?.length&&(this.selectedSellingPlan=R$3(void 0)),this.sellingPlans=t.sellingPlans?.map(e=>{let i=new qt$1(e);return i.isSelected&&(this.selectedSellingPlan.value=i),i});}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(t){this.selectedSellingPlan.value=t;}hasEffectivePrice(){return this.effectivePrice.value!==this.price.d}};function zt$1(r,t){for(let e of r){let i=t.get(e.attr),n=Array.isArray(i),o=typeof i==`string`,_=typeof i==`number`&&typeof e.value==`number`,u=Array.isArray(e.value),l=true;switch(e.op){case `contains`:l=(n||o)&&i.includes(e.value);break;case `notContains`:l=(n||o)&&!i.includes(e.value);break;case `eq`:l=i===e.value;break;case `ne`:l=i!==e.value;break;case `gt`:l=_&&i>e.value;break;case `gte`:l=_&&i>=e.value;break;case `lt`:l=_&&i<e.value;break;case `lte`:l=_&&i<=e.value;break;case `in`:l=u&&e.value.includes(i);break;case `nin`:l=u&&!e.value.includes(i);break;case `between`:l=_&&u&&e.value.length===2&&i>=e.value[0]&&i<=e.value[1];break;case `all`:l=n&&u&&e.value.every(c=>i.includes(c));break;default:l=false;break}if(!l)return false}return true}var vt$2=class vt{id;mID;vars;quantity;meta;reviews;templateSuffix;cardClasses;vendor;minPrice;maxPrice;name;slug;link;imgs;options;descHtml;tags;productType;metafields;flatMetafields;selectedOrFirstVariant;selected=R$3(true);selectedQty=R$3(1);_showAddToCartButton;constructor(t){this.update(t),this.selectedOrFirstVariant=R$3(this.selectedVariant),this._showAddToCartButton=this.evaluateShowATCFlag();}get firstImageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}get showAddToCartButton(){return this._showAddToCartButton}set variants(t){this.vars=t,this.selectedOrFirstVariant.value=this.selectedVariant;}set selectedQuantity(t){this.selectedQty.value=Math.max(1,t);}get selectedVariant(){return this.vars.find(t=>t.isAvailable)??this.vars[0]}hasVariants(){return this.vars?.length>1}setSelectedVariant(t){this.selectedOrFirstVariant.value=t;}setSelectedVariantByID(t){if(!t)return;let e=this.vars.find(i=>i.mID===t.toString());e&&this.setSelectedVariant(e);}update(t){return this.id=t.id??this.id,this.mID=t.mID??this.mID,this.name=t.name??this.name,this.imgs=t.imgs??this.imgs,this.descHtml=t.descHtml??this.descHtml,this.link=t.link??this.link,this.slug=t.slug??this.slug,this.quantity=t.quantity??this.quantity,this.meta=t.meta??this.meta,this.productType=t.productType??this.productType,this.reviews=t.reviews??this.reviews,this.options=t.options??this.options,this.tags=t.tags??this.tags,this.templateSuffix=t.templateSuffix??this.templateSuffix,this.vendor=t.vendor??this.vendor,this.minPrice=t.minPrice?new U$2(t.minPrice):void 0,this.maxPrice=t.maxPrice?new U$2(t.maxPrice):void 0,t.vars&&(this.vars=t.vars.map(e=>new mt$3(e))),this}toEmbed(t){return t=t??this.selectedOrFirstVariant.value,new pt$2({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,i=this.name,n=this.productType,o=this.productType,_=this.variantImage??this.firstImageURL,u=this.meta,l=this.tags?.join(`,`)??``,c=this.reviews?.rating,h=this.reviews?.totalReviews,s$1=this.vendor,E=e.cmp&&e.cmp>e.d,a=t.compareDiscountAmount.value,g=Math.ceil(t.compareDiscountPercentage.value-.5),I=r$2(r$2(s$2(r$2(s$2(r$2({name:i},Gn$1(`price`,e.d,true)),{image_url:_,meta:u,category:n,type:o,rating:c,reviews:h,tags:l,vendor:s$1,metafields:this.flatMetafields,variant_count:this.vars?.length??0}),Gn$1(`compare_discount_amount`,a,false)),{compare_discount_percentage:g}),this.minPrice&&Gn$1(`minPrice`,this.minPrice.d,true)),this.maxPrice&&Gn$1(`maxPrice`,this.maxPrice.d,true));if(t.hasEffectivePrice()){let p=Gn$1(`effective_price`,t.effectivePrice.value,true);Object.assign(I,p);}if(E){let p=e.cmp-e.d,m={discount_percent:(p/e.cmp*100).toFixed(0)};Object.assign(I,m),Object.assign(I,Gn$1(`compare_price`,e.cmp)),Object.assign(I,Gn$1(`discount_price`,p));}return {product:I,variant:{name:t.name,quantity:t.quantity,sku:t.sku,metafields:t.flatMetafields}}}evaluateShowATCFlag(){let t=le$5.get().widgetCustomisation?.atcButton?.showWhen;if(!t?.predicates?.length)return true;let e=t.predicates,i=this.getValueMap(e);return t.op===`or`?e.some(n=>zt$1([n],i)):zt$1(e,i)}getValueMap(t){let e=new Map;for(let i of t){let n=i.attr.split(`.`);switch(n[1]){case `tags`:e.set(i.attr,this.tags);break;case `type`:case `category`:e.set(i.attr,this.productType);break;case `meta`:case `metafield`:{let _=n[2];if(!_)continue;e.set(i.attr,this.meta?.[_]);break}}}return e}};var Et$2=class Et{id;alt;shortID;sources;items;durationMS;thumbnail;card;bestSource;highSource;goodSource;lowSource;m3u8Source;constructor(t={}){if(this.id=t.id,this.alt=t.alt,this.shortID=t.shortID,this.sources=t.sources?.sort((e,i)=>i.height-e.height),this.durationMS=t.durationMS,this.thumbnail=t.thumbnail,this.items=t.items?t.items.map(e=>new vt$2(e)):[],this.card=t.card,this.sources){let e=[];for(let i of this.sources)i.format===`mp4`?e.push(i):i.format===`m3u8`&&!this.m3u8Source&&(this.m3u8Source=i);e.length>0&&(this.bestSource=e[0],this.highSource=e.length>1?e[1]:e[0],this.lowSource=e.length>2?e[e.length-1]:e[0]);}}};var ne$3=(e=>(e.CLASSIC=`CLASSIC`,e.ITEM_CARD_HEADER=`ITEM_CARD_HEADER`,e))(ne$3||{});var oe$5=(i=>(i.ON=`ON`,i.OFF=`OFF`,i.ON_HOVER=`ON_HOVER`,i))(oe$5||{}),se$3=(n=>(n.FIRST_ITEM=`FIRST_ITEM`,n.ITEM_SWIPER=`ITEM_SWIPER`,n.CARD=`CARD`,n.NONE=`NONE`,n))(se$3||{});var Dr$2=class Dr{videoEntries;source;template;heading;autoPlay;showMuteButton;footerContent;detailPopup;playlistConfig;itemDetailConfig;constructor(t={}){this.videoEntries=t.videoEntries?.map(e=>({video:new Et$2(e.video),title:e.title}))??[],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.autoPlay=t.autoPlay??`ON`,this.footerContent=t.footerContent??`FIRST_ITEM`,this.playlistConfig={videoSwiper:t.playlistConfig?.videoSwiper??void 0,itemCardClickBehavior:t.playlistConfig?.itemCardClickBehavior??`OPEN_VIDEO_DETAIL`},this.itemDetailConfig={template:t.itemDetailConfig?.template??`CLASSIC`};}showItems(){return this.footerContent===`FIRST_ITEM`||this.footerContent===`ITEM_SWIPER`}};var wr$3=class wr{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(t){this.t=t.t,t.bg&&(this.bg=new T$2(t.bg)),t.br&&(this.br=new C$3(t.br)),t.shd&&(this.shd=new Q$2(t.shd)),t.spc&&(this.spc=new D$2(t.spc)),this.trf=new j$2(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 B$3[this.t]}get click(){return this.clc}},B$3=(f=>(f[f.IMAGE=1]=`IMAGE`,f[f.TEXT=2]=`TEXT`,f[f.BUTTON=3]=`BUTTON`,f[f.FLEXBOX=4]=`FLEXBOX`,f[f.MULTI_COLUMN=5]=`MULTI_COLUMN`,f[f.CHECKBOX=6]=`CHECKBOX`,f[f.PARTIAL=8]=`PARTIAL`,f[f.PRODUCTS=11]=`PRODUCTS`,f[f.PRODUCT=12]=`PRODUCT`,f[f.PRODUCT_IMAGE=13]=`PRODUCT_IMAGE`,f[f.PRODUCT_TITLE=14]=`PRODUCT_TITLE`,f[f.PRODUCT_VARIATIONS=15]=`PRODUCT_VARIATIONS`,f[f.PRODUCT_VARIATIONS_SELLING_PLANS=16]=`PRODUCT_VARIATIONS_SELLING_PLANS`,f[f.PRODUCT_BUTTON=18]=`PRODUCT_BUTTON`,f[f.PRODUCT_RATING=19]=`PRODUCT_RATING`,f[f.EMAIL_INPUT=51]=`EMAIL_INPUT`,f[f.PHONE_INPUT=52]=`PHONE_INPUT`,f[f.COUNTDOWN_TIMER=61]=`COUNTDOWN_TIMER`,f[f.CAROUSEL=62]=`CAROUSEL`,f[f.SHAPE=100]=`SHAPE`,f))(B$3||{});var Ur$2=0;function _e$2(r=document.head){return Mr$3(fe$3.styleURL,r,`cooee-global-styles`)}function ue$3(r=document.head){return Mr$3(`${nn$1}/swiper-bundle.min.css`,r,`swiper-styles`)}function Mr$3(r,t=document.head,e){return new Promise(i=>{if(t.querySelector(`#${e}`)){i();return}let o=document.createElement(`link`);o.rel=`stylesheet`,o.href=r,o.id=e,o.onload=()=>{i();},o.onerror=()=>{console.error(`Failed to load stylesheet:`,r),i();},t.appendChild(o);})}function le$4(r,t=document.head){if(!r)return;Ur$2++;let e=document.createElement(`style`);e.id=`cooee-app-css-${Ur$2}`,e.textContent=r,t.appendChild(e);}function Ui$2(r){if(!r)return;let t=document.createElement(`script`);t.id=`cooee-app-script`,t.innerHTML=r,document.head.appendChild(t);}function Mi$2(r){if(r)try{(0,eval)(r);}catch(t){console.error(`Failed to execute script:`,t);}}async function Vi$2(){let r=(await import(`${nn$1}/swiper-bundle.min.mjs`)).Swiper;return window.CooeeSDK.Swiper=r}async function Hi$2(r,t=true){if(!r)return;let e=[];t&&e.push(ue$3(r)),e.push(_e$2(r)),await Promise.all(e);let i=le$5.get().website.commonCSS;le$4(i,r);}var ce$4=(function(r){return r[r.SINGLE=1]=`SINGLE`,r[r.EXCLUSION=2]=`EXCLUSION`,r[r.ABTESTING=3]=`ABTESTING`,r[r.GLOBAL_AB=4]=`GLOBAL_AB`,r})(ce$4||{});var fe$2=(function(r){return r.BEFORE=`before`,r.AFTER=`after`,r.INSIDE_FIRST=`insideFirst`,r.INSIDE_LAST=`insideLast`,r.BEFORE1=`BEFORE`,r.AFTER1=`AFTER`,r.INSIDE_FIRST1=`INSIDE_FIRST`,r.INSIDE_LAST1=`INSIDE_LAST`,r})(fe$2||{}),ae$4=(function(r){return r.SHOPIFY_CHECKOUT=`shopify_checkout`,r.THIRD_PARTY_CHECKOUT=`third_party_checkout`,r.CART_PAGE=`cart_page`,r.CART_DRAWER=`cart_drawer`,r})(ae$4||{});var he$3=(function(r){return r[r.NONE=0]=`NONE`,r[r.REJECT_POPUP=1]=`REJECT_POPUP`,r[r.ACCEPT_POPUP=2]=`ACCEPT_POPUP`,r[r.GO_TO_URL=4]=`GO_TO_URL`,r[r.SHARE=5]=`SHARE`,r[r.KEY_VALUE=100]=`KEY_VALUE`,r[r.GO_TO_PRODUCT=101]=`GO_TO_PRODUCT`,r[r.ADD_TO_CART=102]=`ADD_TO_CART`,r[r.COPY_COUPON_CODE=103]=`COPY_COUPON_CODE`,r[r.GO_TO_COLLECTION=104]=`GO_TO_COLLECTION`,r[r.OPEN_CART=105]=`OPEN_CART`,r[r.SUBMIT_FORM=106]=`SUBMIT_FORM`,r[r.INITIATE_CHECKOUT=107]=`INITIATE_CHECKOUT`,r[r.ADD_BUNDLE=108]=`ADD_BUNDLE`,r[r.UPGRADE_TO_SUBSCRIPTION=109]=`UPGRADE_TO_SUBSCRIPTION`,r[r.BUY_NOW=110]=`BUY_NOW`,r[r.QUICK_VIEW=111]=`QUICK_VIEW`,r})(he$3||{}),pe$3=(function(r){return r.POPUP=`POPUP`,r.PAGE_EMBED=`PAGE_EMBED`,r.CART_EMBED=`CART_EMBED`,r.ANNOUNCEMENT_BAR=`ANNOUNCEMENT_BAR`,r.CHECKOUT_PAGE=`CHECKOUT_PAGE`,r})(pe$3||{}),de$3=(function(r){return r.PRODUCT_PROMOTION=`PRODUCT_PROMOTION`,r.BUNDLE_AND_UPSELL=`BUNDLE_AND_UPSELL`,r.CART_RECOVERY=`CART_RECOVERY`,r.ANNOUNCEMENT=`ANNOUNCEMENT`,r.LEAD_GENERATION=`LEAD_GENERATION`,r.DATA_COLLECTION=`DATA_COLLECTION`,r.SALE_PROMOTION=`SALE_PROMOTION`,r.SUBSCRIPTION_UPSELL=`SUBSCRIPTION_UPSELL`,r.SHOPPABLE_VIDEO=`SHOPPABLE_VIDEO`,r.VIDEO_STORY=`VIDEO_STORY`,r.FLOATING_VIDEO=`FLOATING_VIDEO`,r.BYOB=`BYOB`,r.PROGRESS_BAR=`PROGRESS_BAR`,r.BUY_NOW=`BUY_NOW`,r.STICKY_ATC=`STICKY_ATC`,r.EXPERIMENT=`EXPERIMENT`,r.SAVINGS_BAR=`SAVINGS_BAR`,r.COLLECTION_FILTER=`COLLECTION_FILTER`,r.COLLECTION_PROMOTION=`COLLECTION_PROMOTION`,r.ADD_ONS=`ADD_ONS`,r})(de$3||{}),me$3=(function(r){return r.ICONS=`ICONS`,r.TILES=`TILES`,r})(me$3||{}),ve$4=(function(r){return r.FREE_SHIPPING=`FREE_SHIPPING`,r.DISCOUNT=`DISCOUNT`,r.FREE_AUTO_GIFT=`FREE_AUTO_GIFT`,r.FREE_GIFT_SELECT=`FREE_GIFT_SELECT`,r.UI_ONLY=`UI_ONLY`,r})(ve$4||{});var gt$2=class gt{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;}};var Nt$2=class Nt{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;}};var St$2=class St{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;}};var Qt$2=(n=>(n[n.START=0]=`START`,n[n.CENTER=1]=`CENTER`,n[n.END=2]=`END`,n[n.JUSTIFY=3]=`JUSTIFY`,n))(Qt$2||{});var Ot$2=class Ot{name;fonts;constructor(t){t=t??{},t.name&&(t.name=t.name!==`Arial`?t.name:``),this.name=t.name,this.fonts=t.fonts?.map(e=>new jt$2(e));}},jt$2=class jt{style;url;constructor(t){t=t??{},this.style=t.style,this.url=t.url;}getFontDescriptor(){return {style:this.style===2||this.style===4?`italic`:`normal`,weight:this.style===4||this.style===3?`700`:`400`}}getURL(){return `url('${this.url}') format('truetype')`}};var W$2=class W{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(t){this.update(t);}get alignment(){return Qt$2[this.ta]}get letterSpacing(){return this.ls?this.ls+`px`:`normal`}update(t){t=t??{},t.lh&&(this.lh=t.lh),t.tdc&&(this.tdc=new y$1(t.tdc)),this.td=t.td,this.fs=t.s??t.fs??60,this.tc=new y$1(t.tc),this.ta=t.ta??1,this.fw=t.fw??400,this.ls=t.ls??0,this.tc.h??=`#000000`,this.fam=new Ot$2(t.fam??t.fmly);}resize(t){this.s*=t,this.ls*=t;}};var It$1=class It{size;bg;br;spc;typo;lout;flex;constructor(t){t??={},this.spc=new D$2(t.spc),t.size&&(this.size=new St$2(t.size)),t.bg&&(this.bg=new T$2(t.bg)),t.br&&(this.br=new C$3(t.br)),t.typo&&(this.typo=new W$2(t.typo)),t.lout&&(this.lout=new Nt$2(t.lout)),t.flex&&(this.flex=new gt$2(t.flex));}},yt$2=class yt{sm;lg;constructor(t){t??={},this.sm=new It$1(t.sm),this.lg=new It$1(t.lg);}};var Pt$1=class Pt{t;classes;style;hide;when;clc;l;constructor(t,e){e??={},this.t=t,this.classes=e.classes??``,this.style=new yt$2(e.style),this.hide=e.hide,this.l=e.l,e.when?.op&&(this.when=e.when),e.clc&&(this.clc=e.clc);}get stringType(){return B$3[this.t]}};var Rt$3=class Rt extends Pt$1{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;}};var Ee$3=(i=>(i.SINGLE=`SINGLE`,i.MULTIPLE=`MULTIPLE`,i.CHIPS=`CHIPS`,i))(Ee$3||{}),Vr$3=class Vr extends Rt$3{showChips;optionsConfig;type;horizontal;constructor(t=15,e){super(e,t),e??={},this.showChips=e.showChips??false,this.optionsConfig=e.optionsConfig??{},this.horizontal=e.horizontal,e.type?this.type=e.type:e.showChips?this.type=`CHIPS`:this.type=`SINGLE`;}};var ge$2=(i=>(i[i.LOW=1]=`LOW`,i[i.MEDIUM=2]=`MEDIUM`,i[i.HIGH=3]=`HIGH`,i))(ge$2||{}),Ne$3=(e=>(e.SINGLE_PANE=`SINGLE_PANE`,e.TWO_PANE=`TWO_PANE`,e))(Ne$3||{});function vn$1(r){if(!r)return {display:`block`};let t={display:r.disp};return r.of&&(t.objectFit=r.of),r.pos===`absolute`&&(t.width=`auto !important`,t.position=`absolute`,t.right=r.right+`px`,t.left=r.left+`px`,t.top=r.top+`px`,t.bottom=r.bottom+`px`),t}function En(r){return r?{gap:r.gap+`px`,flexWrap:r.wrap,flexDirection:r.dir,justifyContent:r.jc,alignItems:r.ai,width:`100%`}:{}}function Hr$2(r,t,e){if(e??={},r.type===`LINEAR`){let i=`linear-gradient(${r.ang}deg, ${r.c1}, ${r.c2}`;r.c3&&(i+=`, ${r.c3}`),i+=`)`,e[t]=i;}return e}function Jt$2(r,t=`color`,e){return e??={},r?r.grad?Hr$2(r.grad,t,e):(r.hex&&(e[t]=r.rgba),e):e}function L$4(r,t){return Se$5(r,t)+`px`}function Se$5(r,t=1){return (r??0)*t}function gn$1(r){let t={};return r?.w&&(t.width=r.w),r?.h&&(t.height=r.h),r?.maxW&&(t.maxWidth=r.maxW),r?.maxH&&(t.maxHeight=r.maxH),r?.minW&&(t.minWidth=r.minW),r?.minH&&(t.minHeight=r.minH),t}function Nn$2(r,t){if(!r)return {};let e={};return r.radius&&r.radius>0&&(e.borderRadius=L$4(r.radius,t)),r.width&&r.width>0&&(e.borderWidth=L$4(r.width,t),e.borderStyle=r.style?.toLowerCase(),r.color?Jt$2(r.color,`border-color`,e):e.borderColor=`black`),e}function Sn$1(r,t){let e={};return r?(e.paddingTop=L$4(r.pt,t),e.paddingBottom=L$4(r.pb,t),e.paddingLeft=L$4(r.pl,t),e.paddingRight=L$4(r.pr,t),e.marginTop=L$4(r.mt,t),e.marginBottom=L$4(r.mb,t),e.marginLeft=r.cent?`auto`:L$4(r.ml,t),e.marginRight=r.cent?`auto`:L$4(r.mr,t),e):(e.margin=`0 !important`,e.padding=`unset`,e)}function On$1(r){if(!r)return {};let t={};if(r.glossy){let e=`backdrop-filter`,i=`-webkit-`+e,n=`blur(${r.glossy.radius}px)`;if(!CSS.supports(i,n)&&!CSS.supports(e,n))return {background:r.glossy.fallback.rgba};if(t[i]=n,t[e]=n,r.glossy.color)return Jt$2(r.glossy.color,`background`,t)}else if(r.solid){if(r.solid.grad)return Hr$2(r.solid.grad,`background`,t);if(r.solid.hex)return {backgroundColor:r.solid.rgba}}else if(r.img){if(!r.img.src)return {};let e=(r.img.a??0)/100;t.background=`linear-gradient(rgba(0, 0, 0, ${e}), rgba(0, 0, 0, ${e})),url("${r.img.src}") no-repeat center`,t.backgroundSize=`cover`,r.img.a&&(t[`-webkit-backdrop-filter`]=`opacity(${r.img.a})`,t.backdropFilter=`opacity(${r.img.a})`);}return t}function In$1(r=new W$2){let t={};return t.letterSpacing=r.letterSpacing,t.fontSize=r.fs+`px`,t.lineHeight=r.lh,t.fontFamily=r.fam.name||`inherit`,t.textAlign=r.alignment,t.fontWeight=r.fw,t.textDecoration=r.td??`none`,Jt$2(r.tc,`color`,t),t.boxShadow=`none`,t}
|
|
13
13
|
|
|
14
14
|
var i=class{enabled;type;color;constructor(e){e??={},this.enabled=e.enabled,this.type=e.type,this.color=new y$1(e.color);}},l$3=class l{size;enabled;color;constructor(e){e??={},this.enabled=e.enabled,this.size=e.size,this.color=new y$1(e.color);}},r$1=class r{enabled;delay;constructor(e={}){this.enabled=e.enabled,e.delay&&(this.delay=e.delay>100?e.delay:e.delay*1e3);}},s$1=class s{navigation;pagination;autoplay;loop;maxInRow;gap;maxInRowSm;gapSm;speed;marquee;constructor(e){e??={},this.navigation=new l$3(e.navigation),this.pagination=new i(e.pagination),this.autoplay=new r$1(e.autoplay),this.loop=e.loop??false,this.maxInRow=e.maxInRow??4,this.gap=e.gap??0,this.maxInRowSm=e.maxInRowSm??this.maxInRow,this.gapSm=e.gapSm??this.gap,e.speed&&(this.speed=e.speed*1e3),this.marquee=e.marquee;}};
|
|
15
15
|
|
|
@@ -17,24 +17,24 @@ var Se$4=v$3((Y,Te)=>{(function(i,r){typeof Y==`object`&&typeof Te<`u`?r(Y):type
|
|
|
17
17
|
|
|
18
18
|
`+t.split(/\n/)[s-1]+`
|
|
19
19
|
`+Array(l).join(` `)+`^`)}r.prototype=Object.create(Error.prototype,{name:{value:`Squirrelly Error`,enumerable:false}});var d=new Function(`return this`)().Promise,T=false;try{T=new Function(`return (async function(){}).constructor`)();}catch(e){if(!(e instanceof SyntaxError))throw e}function C(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function $(e,t,n){for(var a in t)C(t,a)&&(t[a]==null||typeof t[a]!=`object`||a!==`storage`&&a!==`prefixes`||n?e[a]=t[a]:e[a]=$({},t[a]));return e}var R=/^async +/,G=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,D=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,V=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,le=/[.*+\-?^${}()|[\]\\]/g;function W(e){return le.test(e)?e.replace(le,`\\$&`):e}function ue(e,t){t.rmWhitespace&&(e=e.replace(/[\r\n]+/g,`
|
|
20
|
-
`).replace(/^\s+|\s+$/gm,``)),G.lastIndex=0,D.lastIndex=0,V.lastIndex=0;var n=t.prefixes,a=[n.h,n.b,n.i,n.r,n.c,n.e].reduce(function(x,u){return x&&u?x+`|`+W(u):u?W(u):x},``),s=new RegExp(`([|()]|=>)|('|"|\`|\\/\\*)|\\s*((\\/)?(-|_)?`+W(t.tags[1])+`)`,`g`),l=new RegExp(`([^]*?)`+W(t.tags[0])+`(-|_)?\\s*(`+a+`)?\\s*`,`g`),c=0,y=false;function v(x,u){var p
|
|
21
|
-
`);}}return s}var z=(function(){function e(t){this.cache=t;}return e.prototype.define=function(t,n){this.cache[t]=n;},e.prototype.get=function(t){return this.cache[t]},e.prototype.remove=function(t){delete this.cache[t];},e.prototype.reset=function(){this.cache={};},e.prototype.load=function(t){$(this.cache,t,true);},e})();function F(e,t,n,a){if(t&&t.length>0)throw r((a?`Native`:``)+`Helper '`+e+`' doesn't accept blocks`);if(n&&n.length>0)throw r((a?`Native`:``)+`Helper '`+e+`' doesn't accept filters`)}var Ae={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function _e(e){return Ae[e]}var fe=new z({}),de=new z({each:function(e,t){var n=``,a=e.params[0];if(F(`each`,t,false),e.async)return new Promise(function(l){(function c(y,v,b,N,_){b(y[v],v).then(function(x){N+=x,v===y.length-1?_(N):c(y,v+1,b,N,_);});})(a,0,e.exec,n,l);});for(var s=0;s<a.length;s++)n+=e.exec(a[s],s);return n},foreach:function(e,t){var n=e.params[0];if(F(`foreach`,t,false),e.async)return new Promise(function(l){(function c(y,v,b,N,_,x){N(v[b],y[v[b]]).then(function(u){_+=u,b===v.length-1?x(_):c(y,v,b+1,N,_,x);});})(n,Object.keys(n),0,e.exec,``,l);});var a=``;for(var s in n)C(n,s)&&(a+=e.exec(s,n[s]));return a},include:function(e,t,n){F(`include`,t,false);var a=n.storage.templates.get(e.params[0]);if(!a)throw r(`Could not fetch template "`+e.params[0]+`"`);return a(e.params[1],n)},extends:function(e,t,n){var a=e.params[1]||{};a.content=e.exec();for(var s=0;s<t.length;s++){var l=t[s];a[l.name]=l.exec();}var c=n.storage.templates.get(e.params[0]);if(!c)throw r(`Could not fetch template "`+e.params[0]+`"`);return c(a,n)},useScope:function(e,t){return F(`useScope`,t,false),e.exec(e.params[0])}}),ge=new z({if:function(e,t){F(`if`,false,e.f,true);var n=`if(`+e.p+`){`+P(e.d,t)+`}`;if(e.b)for(var a=0;a<e.b.length;a++){var s=e.b[a];s.n===`else`?n+=`else{`+P(s.d,t)+`}`:s.n===`elif`&&(n+=`else if(`+s.p+`){`+P(s.d,t)+`}`);}return n},try:function(e,t){if(F(`try`,false,e.f,true),!e.b||e.b.length!==1||e.b[0].n!==`catch`)throw r(`native helper 'try' only accepts 1 block, 'catch'`);var n=`try{`+P(e.d,t)+`}`,a=e.b[0];return n+=`catch`+(a.res?`(`+a.res+`)`:``)+`{`+P(a.d,t)+`}`},block:function(e,t){return F(`block`,e.b,e.f,true),`if(!`+t.varName+`[`+e.p+`]){tR+=(`+ee(e.d,``,t)+`)()}else{tR+=`+t.varName+`[`+e.p+`]}`}}),
|
|
20
|
+
`).replace(/^\s+|\s+$/gm,``)),G.lastIndex=0,D.lastIndex=0,V.lastIndex=0;var n=t.prefixes,a=[n.h,n.b,n.i,n.r,n.c,n.e].reduce(function(x,u){return x&&u?x+`|`+W(u):u?W(u):x},``),s=new RegExp(`([|()]|=>)|('|"|\`|\\/\\*)|\\s*((\\/)?(-|_)?`+W(t.tags[1])+`)`,`g`),l=new RegExp(`([^]*?)`+W(t.tags[0])+`(-|_)?\\s*(`+a+`)?\\s*`,`g`),c=0,y=false;function v(x,u){var m,p={f:[]},S=0,g=`c`;function E(j){var k=e.slice(c,j),I=k.trim();if(g===`f`)I===`safe`?p.raw=true:t.async&&R.test(I)?(I=I.replace(R,``),p.f.push([I,``,true])):p.f.push([I,``]);else if(g===`fp`)p.f[p.f.length-1][1]+=I;else if(g===`err`){if(I){var M=k.search(/\S/);o(`invalid syntax`,e,c+M);}}else p[g]=I;c=j+1;}for(u===`h`||u===`b`||u===`c`?g=`n`:u===`r`&&(p.raw=true,u=`i`),s.lastIndex=c;(m=s.exec(e))!==null;){var O=m[1],H=m[2],ne=m[3],X=m[4],Z=m[5],f=m.index;if(O)O===`(`?(S===0&&(g===`n`?(E(f),g=`p`):g===`f`&&(E(f),g=`fp`)),S++):O===`)`?--S===0&&g!==`c`&&(E(f),g=`err`):S===0&&O===`|`?(E(f),g=`f`):O===`=>`&&(E(f),c+=1,g=`res`);else if(H)if(H===`/*`){var U=e.indexOf(`*/`,s.lastIndex);U===-1&&o(`unclosed comment`,e,m.index),s.lastIndex=U+2;}else H===`'`?(D.lastIndex=m.index,D.exec(e)?s.lastIndex=D.lastIndex:o(`unclosed string`,e,m.index)):H===`"`?(V.lastIndex=m.index,V.exec(e)?s.lastIndex=V.lastIndex:o(`unclosed string`,e,m.index)):H==="`"&&(G.lastIndex=m.index,G.exec(e)?s.lastIndex=G.lastIndex:o(`unclosed string`,e,m.index));else if(ne)return E(f),c=f+m[0].length,l.lastIndex=c,y=Z,X&&u===`h`&&(u=`s`),p.t=u,p}return o(`unclosed tag`,e,x),p}var b=(function x(u,m){u.b=[],u.d=[];var p,S=false,g=[];function E(M,Ce){M&&(M=(function(A,B,ie,ae){var L,q;return typeof B.autoTrim==`string`?L=q=B.autoTrim:Array.isArray(B.autoTrim)&&(L=B.autoTrim[1],q=B.autoTrim[0]),(ie||ie===false)&&(L=ie),(ae||ae===false)&&(q=ae),L===`slurp`&&q===`slurp`?A.trim():(L===`_`||L===`slurp`?A=String.prototype.trimLeft?A.trimLeft():A.replace(/^[\s\uFEFF\xA0]+/,``):L!==`-`&&L!==`nl`||(A=A.replace(/^(?:\n|\r|\r\n)/,``)),q===`_`||q===`slurp`?A=String.prototype.trimRight?A.trimRight():A.replace(/[\s\uFEFF\xA0]+$/,``):q!==`-`&&q!==`nl`||(A=A.replace(/(?:\n|\r|\r\n)$/,``)),A)})(M,t,y,Ce))&&(M=M.replace(/\\|'/g,`\\$&`).replace(/\r\n|\n|\r/g,`\\n`),g.push(M));}for(;(p=l.exec(e))!==null;){var O,H=p[1],ne=p[2],X=p[3]||``;for(var Z in n)if(n[Z]===X){O=Z;break}E(H,ne),c=p.index+p[0].length,O||o(`unrecognized tag type: `+X,e,c);var f=v(p.index,O),U=f.t;if(U===`h`){var j=f.n||``;t.async&&R.test(j)&&(f.a=true,f.n=j.replace(R,``)),f=x(f),g.push(f);}else if(U===`c`){if(u.n===f.n)return S?(S.d=g,u.b.push(S)):u.d=g,u;o(`Helper start and end don't match`,e,p.index+p[0].length);}else if(U===`b`){S?(S.d=g,u.b.push(S)):u.d=g;var k=f.n||``;t.async&&R.test(k)&&(f.a=true,f.n=k.replace(R,``)),S=f,g=[];}else if(U===`s`){var I=f.n||``;t.async&&R.test(I)&&(f.a=true,f.n=I.replace(R,``)),g.push(f);}else g.push(f);}if(!m)throw r(`unclosed helper "`+u.n+`"`);return E(e.slice(c,e.length),false),u.d=g,u})({f:[]},true);if(t.plugins)for(var N=0;N<t.plugins.length;N++){var _=t.plugins[N];_.processAST&&(b.d=_.processAST(b.d,t));}return b.d}function K(e,t){var n=ue(e,t),a=`var tR='';`+(t.useWith?`with(`+t.varName+`||{}){`:``)+P(n,t)+`if(cb){cb(null,tR)} return tR`+(t.useWith?`}`:``);if(t.plugins)for(var s=0;s<t.plugins.length;s++){var l=t.plugins[s];l.processFnString&&(a=l.processFnString(a,t));}return a}function Q(e,t){for(var n=0;n<t.length;n++){var a=t[n][0],s=t[n][1];e=(t[n][2]?`await `:``)+`c.l('F','`+a+`')(`+e,s&&(e+=`,`+s),e+=`)`;}return e}function ce(e,t,n,a,s,l){var c=`{exec:`+(s?`async `:``)+ee(n,t,e)+`,params:[`+a+`]`;return l&&(c+=`,name:'`+l+`'`),s&&(c+=`,async:true`),c+=`}`}function Ie(e,t){for(var n=`[`,a=0;a<e.length;a++){var s=e[a];n+=ce(t,s.res||``,s.d,s.p||``,s.a,s.n),a<e.length&&(n+=`,`);}return n+=`]`}function ee(e,t,n){return `function(`+t+`){var tR='';`+P(e,n)+`return tR}`}function P(e,t){for(var n=0,a=e.length,s=``;n<a;n++){var l=e[n];if(typeof l==`string`)s+=`tR+='`+l+`';`;else {var c=l.t,y=l.c||``,v=l.f,b=l.n||``,N=l.p||``,_=l.res||``,x=l.b,u=!!l.a;if(c===`i`){t.defaultFilter&&(y=`c.l('F','`+t.defaultFilter+`')(`+y+`)`);var m=Q(y,v);!l.raw&&t.autoEscape&&(m=`c.l('F','e')(`+m+`)`),s+=`tR+=`+m+`;`;}else if(c===`h`)if(t.storage.nativeHelpers.get(b))s+=t.storage.nativeHelpers.get(b)(l,t);else {var p=(u?`await `:``)+`c.l('H','`+b+`')(`+ce(t,_,l.d,N,u);p+=x?`,`+Ie(x,t):`,[]`,s+=`tR+=`+Q(p+=`,c)`,v)+`;`;}else c===`s`?s+=`tR+=`+Q((u?`await `:``)+`c.l('H','`+b+`')({params:[`+N+`]},[],c)`,v)+`;`:c===`e`&&(s+=y+`
|
|
21
|
+
`);}}return s}var z=(function(){function e(t){this.cache=t;}return e.prototype.define=function(t,n){this.cache[t]=n;},e.prototype.get=function(t){return this.cache[t]},e.prototype.remove=function(t){delete this.cache[t];},e.prototype.reset=function(){this.cache={};},e.prototype.load=function(t){$(this.cache,t,true);},e})();function F(e,t,n,a){if(t&&t.length>0)throw r((a?`Native`:``)+`Helper '`+e+`' doesn't accept blocks`);if(n&&n.length>0)throw r((a?`Native`:``)+`Helper '`+e+`' doesn't accept filters`)}var Ae={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function _e(e){return Ae[e]}var fe=new z({}),de=new z({each:function(e,t){var n=``,a=e.params[0];if(F(`each`,t,false),e.async)return new Promise(function(l){(function c(y,v,b,N,_){b(y[v],v).then(function(x){N+=x,v===y.length-1?_(N):c(y,v+1,b,N,_);});})(a,0,e.exec,n,l);});for(var s=0;s<a.length;s++)n+=e.exec(a[s],s);return n},foreach:function(e,t){var n=e.params[0];if(F(`foreach`,t,false),e.async)return new Promise(function(l){(function c(y,v,b,N,_,x){N(v[b],y[v[b]]).then(function(u){_+=u,b===v.length-1?x(_):c(y,v,b+1,N,_,x);});})(n,Object.keys(n),0,e.exec,``,l);});var a=``;for(var s in n)C(n,s)&&(a+=e.exec(s,n[s]));return a},include:function(e,t,n){F(`include`,t,false);var a=n.storage.templates.get(e.params[0]);if(!a)throw r(`Could not fetch template "`+e.params[0]+`"`);return a(e.params[1],n)},extends:function(e,t,n){var a=e.params[1]||{};a.content=e.exec();for(var s=0;s<t.length;s++){var l=t[s];a[l.name]=l.exec();}var c=n.storage.templates.get(e.params[0]);if(!c)throw r(`Could not fetch template "`+e.params[0]+`"`);return c(a,n)},useScope:function(e,t){return F(`useScope`,t,false),e.exec(e.params[0])}}),ge=new z({if:function(e,t){F(`if`,false,e.f,true);var n=`if(`+e.p+`){`+P(e.d,t)+`}`;if(e.b)for(var a=0;a<e.b.length;a++){var s=e.b[a];s.n===`else`?n+=`else{`+P(s.d,t)+`}`:s.n===`elif`&&(n+=`else if(`+s.p+`){`+P(s.d,t)+`}`);}return n},try:function(e,t){if(F(`try`,false,e.f,true),!e.b||e.b.length!==1||e.b[0].n!==`catch`)throw r(`native helper 'try' only accepts 1 block, 'catch'`);var n=`try{`+P(e.d,t)+`}`,a=e.b[0];return n+=`catch`+(a.res?`(`+a.res+`)`:``)+`{`+P(a.d,t)+`}`},block:function(e,t){return F(`block`,e.b,e.f,true),`if(!`+t.varName+`[`+e.p+`]){tR+=(`+ee(e.d,``,t)+`)()}else{tR+=`+t.varName+`[`+e.p+`]}`}}),pe=new z({e:function(e){var t=String(e);return /[&<>"']/.test(t)?t.replace(/[&<>"']/g,_e):t}}),J={varName:`it`,autoTrim:[false,`nl`],autoEscape:true,defaultFilter:false,tags:[`{{`,`}}`],l:function(e,t){if(e===`H`){var n=this.storage.helpers.get(t);if(n)return n;throw r(`Can't find helper '`+t+`'`)}if(e===`F`){var a=this.storage.filters.get(t);if(a)return a;throw r(`Can't find filter '`+t+`'`)}},async:false,storage:{helpers:de,nativeHelpers:ge,filters:pe,templates:fe},prefixes:{h:`@`,b:`#`,i:``,r:`*`,c:`/`,e:`!`},cache:false,plugins:[],useWith:false};function te(e,t){var n={};return $(n,J),t&&$(n,t),e&&$(n,e),n.l.bind(n),n}function me(e,t){var n,a=te(t||{}),s=Function;if(a.async){if(!T)throw r(`This environment doesn't support async/await`);s=T;}if(a.varName&&(n=a.varName,/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(n)===false))throw r(`options.varName must be a valid JS identifier`);try{return new s(a.varName,`c`,`cb`,K(e,a))}catch(l){throw l instanceof SyntaxError?r(`Bad template syntax
|
|
22
22
|
|
|
23
23
|
`+l.message+`
|
|
24
24
|
`+Array(l.message.length+1).join(`=`)+`
|
|
25
|
-
`+K(e,a)):l}}function re(e,t){var n;return t.cache&&t.name&&t.storage.templates.get(t.name)?t.storage.templates.get(t.name):(n=typeof e==`function`?e:
|
|
25
|
+
`+K(e,a)):l}}function re(e,t){var n;return t.cache&&t.name&&t.storage.templates.get(t.name)?t.storage.templates.get(t.name):(n=typeof e==`function`?e:me(e,t),t.cache&&t.name&&t.storage.templates.define(t.name,n),n)}J.l.bind(J),i.compile=me,i.compileScope=P,i.compileScopeIntoFunction=ee,i.compileToString=K,i.defaultConfig=J,i.filters=pe,i.getConfig=te,i.helpers=de,i.nativeHelpers=ge,i.parse=ue,i.render=function(e,t,n,a){var s=te(n||{});if(!s.async)return re(e,s)(t,s);if(!a){if(typeof d==`function`)return new d(function(l,c){try{l(re(e,s)(t,s));}catch(y){c(y);}});throw r(`Please provide a callback function, this env doesn't support Promises`)}try{re(e,s)(t,s,a);}catch(l){return a(l)}},i.templates=fe,Object.defineProperty(i,`__esModule`,{value:true});});});var Re$1=(o=>(o.IMAGE=`IMAGE`,o.BUTTON=`BUTTON`,o))(Re$1||{}),xe$2=class xe{title;subtitle;template;refreshPage;options;constructor(r={}){this.template=r.template??`IMAGE`,this.refreshPage=r.refreshPage??false,this.options=r.options??[],this.title=r.title,this.subtitle=r.subtitle;}};var oe$4=class oe{minValue;rewardType;label;reachingText;reachedText;discount;items;isUIOnly;allowATC;reached;calculatedAlignment;images;constructor(r){this.reached=r.reached??false,this.calculatedAlignment=r.calculatedAlignment,this.minValue=r.minValue,this.rewardType=r.rewardType,this.label=r.label,this.reachingText=r.reachingText,this.reachedText=r.reachedText,this.discount=r.discount,this.items=r.items?.map(o=>new pt$2(o)),this.isUIOnly=r.isUIOnly,this.allowATC=r.allowATC,this.images=r.images;}},Pe$2=(o=>(o.CART_AMOUNT=`CART_AMOUNT`,o.ITEM_COUNT=`ITEM_COUNT`,o))(Pe$2||{}),Ne$2=class Ne{layout;milestones;totalProgress;coupons;reachedAmountOrCount;onlyLatestGift;noConfetti;removeIneligibleItem;restrictToLatestFreebie;rewardBasis;treatFreebieAsSeparateLineItem;constructor(r){this.layout=r.layout??me$3.ICONS,this.onlyLatestGift=r.onlyLatestGift,this.noConfetti=r.noConfetti,this.removeIneligibleItem=r.removeIneligibleItem??true,this.restrictToLatestFreebie=r.restrictToLatestFreebie,this.rewardBasis=r.rewardBasis??`CART_AMOUNT`,this.treatFreebieAsSeparateLineItem=r.treatFreebieAsSeparateLineItem??true,this.update(r);}update(r){r=r??{},this.milestones=r.milestones?.map(o=>new oe$4(o))??[],this.totalProgress=r.totalProgress??0,this.coupons=r.coupons,this.reachedAmountOrCount=r.reachedAmountOrCount;}};var we$4=class we{animateNumber;animationDuration;text;iconURL;animation;totalSavings;constructor(r={}){this.animateNumber=r.animateNumber??true,this.animation=r.animation??`SLOT_MACHINE`,this.animationDuration=r.animationDuration??1e3,this.text=r.text??`You are saving {{ cart.total_savings }} on this order`,this.iconURL=r.iconURL,this.totalSavings=r.totalSavings??0;}};var h$2=x$2(Se$4());h$2.filters.define(`default`,function(i){return typeof i>`u`||i==null?``:Le(i)});+h$2.filters.define(`max`,(i,r)=>{let o=Number(i),d=Number(r);return isNaN(o)||isNaN(d)?i:o>d?r:i});h$2.filters.define(`min`,(i,r)=>{let o=Number(i),d=Number(r);return isNaN(o)||isNaN(d)?i:o<d?r:i});h$2.filters.define(`fallback`,(i,r)=>i==null||i===``?r:i);h$2.filters.define(`manipulate_quantity`,(i,r,o)=>{if(r??=1,o??=100,r>o)return U$3.error(`Invalid range: min should be less than or equal to max.`),i;if(i>=r&&i<=o)return i;let d=i%o;return d<r?r:d});h$2.filters.define(`apply_discount_perc`,(i,r,o=Infinity)=>{if(i=+i,isNaN(i))return U$3.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(r=+(r??0),isNaN(r))return U$3.error("Need percent as a number for `apply_discount_perc` filter"),NaN;if(r<0||r>100)return U$3.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let d=i*r/100;return i-Math.min(o,d)});h$2.filters.define(`apply_discount_fixed`,(i,r)=>(i=+i,isNaN(i)?(U$3.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,i-r)));h$2.filters.define(`currency`,i=>(i=+i,isNaN(i)?(U$3.error("Need value as a number for `currency` filter"),NaN):Br$4(i)));h$2.filters.define(`split`,(i,r,o)=>{if(typeof i!=`string`)return U$3.error("Need value as a string for `split` filter"),``;if(r==null)return U$3.error("Need delimiter for `split` filter"),``;if(o==null||isNaN(Number(o)))return U$3.error("Need a valid index for `split` filter"),``;let d=i.split(String(r)),T=Number(o);return d[T<0?d.length+T:T].trim()??``});h$2.filters.define(`replace`,(i,r,o,d=false)=>typeof i!=`string`?(U$3.error("Need value as a string for `replace` filter"),``):r==null?(U$3.error("Need search string for `replace` filter"),i):o==null?(U$3.error("Need replacement string for `replace` filter"),i):d&&i.includes(String(r))?String(o):i.split(String(r)).join(String(o)));h$2.defaultConfig.defaultFilter=`default`;h$2.defaultConfig.useWith=true;h$2.defaultConfig.autoEscape=false;var Me$1={'"':`"`,"\\":`\`,"\n":`\\n`," ":`\\t`};function Le(i){return String(i).replace(/["\\\n\t]/g,r=>Me$1[r])}function qe$2(i){if(!i)return ``;return i.replace(/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g,(o,d,T,C)=>`{{ ${(T||C||``).trim()} }}`)}var Fe$3=(i,r$1,o)=>{r$1=r$2({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},r$1);try{return h$2.render(qe$2(i),r$1)}catch(d){throw ke$1(d,`template_squirrelly_render`,{extra:{template:i,values:r$1},triggerContext:o}),d}},We$3=(i,r,o)=>{let T=Fe$3(JSON.stringify(i),r,o);try{return JSON.parse(T)}catch(C){throw ke$1(C,`template_variable_replace`,{extra:{before:i,after:T},triggerContext:o}),C}},ze$1=(i,r)=>{!i||!r||h$2.templates.define(i,h$2.compile(r));};
|
|
26
26
|
|
|
27
|
-
var dr$3=v$3(dt=>{Object.defineProperty(dt,`__esModule`,{value:true});dt.URLBuilder=void 0;dt.URLBuilder=(function(){function r(t){try{this.base=new URL(t),this.params=new URLSearchParams(this.base.search.slice(1));}catch(i){console.error(`Un-parsable URL`,i);}}return r.prototype.appendQueryParam=function(t,i){this.params.append(t,i?i.toString():``);},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(t){this.params.delete(t);},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(t){if(!this.params)return ``;var i=this.params.get(t);return !i||i===`undefined`||i===`null`?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(t){return this.base.pathname=t,this},r.prototype.setQueryParam=function(t,i){return this.params.set(t,i?i.toString():``),this},r.prototype.setQueryString=function(t){if(t)return t[0]===`?`&&(t=t.slice(1)),this.params=new URLSearchParams(t),this},r.prototype.toString=function(){var t=this.params.toString();return t===``?this.base.search=``:this.base.search=`?`+t,this.base.toString()},r})();});var mt$2=class mt{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;treatment;constructor(t){t=t||{},this.triggerID=t.id||t.triggerID,this.nudgeID=t.nudgeID,this.shortID=t.shortID,this.contentType=t.contentType,this.engagementID=t.engagementID,this.contentID=t.contentID,this.variation=t.variation,this.props=t.props,this.objective=t.objective,this.onsiteDeliveryType=t.onsiteDeliveryType,this.holdout=t.holdout,this.treatment=t.treatment;}};function Mr$2(r,t){return t={exports:{}},r(t,t.exports),t.exports}var jr=Yr$1,$r$1=Hr$1,Pr$3=Zr$1,X$1=[],H$4=[],Cr$1=typeof Uint8Array<`u`?Uint8Array:Array,Rt$2=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;for(K$3=0,kt$2=Rt$2.length;K$3<kt$2;++K$3)X$1[K$3]=Rt$2[K$3],H$4[Rt$2.charCodeAt(K$3)]=K$3;var K$3,kt$2;H$4[45]=62;H$4[95]=63;function pr$3(r){var t=r.length;if(t%4>0)throw new Error(`Invalid string. Length must be a multiple of 4`);var i=r.indexOf(`=`);i===-1&&(i=t);var f=i===t?0:4-i%4;return [i,f]}function Yr$1(r){var t=pr$3(r),i=t[0],f=t[1];return (i+f)*3/4-f}function Jr$1(r,t,i){return (t+i)*3/4-i}function Hr$1(r){var t,i=pr$3(r),f=i[0],c=i[1],h=new Cr$1(Jr$1(r,f,c)),a=0,p=c>0?f-4:f,y;for(y=0;y<p;y+=4)t=H$4[r.charCodeAt(y)]<<18|H$4[r.charCodeAt(y+1)]<<12|H$4[r.charCodeAt(y+2)]<<6|H$4[r.charCodeAt(y+3)],h[a++]=t>>16&255,h[a++]=t>>8&255,h[a++]=t&255;return c===2&&(t=H$4[r.charCodeAt(y)]<<2|H$4[r.charCodeAt(y+1)]>>4,h[a++]=t&255),c===1&&(t=H$4[r.charCodeAt(y)]<<10|H$4[r.charCodeAt(y+1)]<<4|H$4[r.charCodeAt(y+2)]>>2,h[a++]=t>>8&255,h[a++]=t&255),h}function Vr$2(r){return X$1[r>>18&63]+X$1[r>>12&63]+X$1[r>>6&63]+X$1[r&63]}function Wr$2(r,t,i){for(var f,c=[],h=t;h<i;h+=3)f=(r[h]<<16&16711680)+(r[h+1]<<8&65280)+(r[h+2]&255),c.push(Vr$2(f));return c.join(``)}function Zr$1(r){for(var t,i=r.length,f=i%3,c=[],h=16383,a=0,p=i-f;a<p;a+=h)c.push(Wr$2(r,a,a+h>p?p:a+h));return f===1?(t=r[i-1],c.push(X$1[t>>2]+X$1[t<<4&63]+`==`)):f===2&&(t=(r[i-2]<<8)+r[i-1],c.push(X$1[t>>10]+X$1[t>>4&63]+X$1[t<<2&63]+`=`)),c.join(``)}var Lt$1={byteLength:jr,toByteArray:$r$1,fromByteArray:Pr$3};var zr$1=function(t,i,f,c,h){var a,p,y=h*8-c-1,E=(1<<y)-1,m=E>>1,w=-7,_=f?h-1:0,O=f?-1:1,S=t[i+_];for(_+=O,a=S&(1<<-w)-1,S>>=-w,w+=y;w>0;a=a*256+t[i+_],_+=O,w-=8);for(p=a&(1<<-w)-1,a>>=-w,w+=c;w>0;p=p*256+t[i+_],_+=O,w-=8);if(a===0)a=1-m;else {if(a===E)return p?NaN:(S?-1:1)*Infinity;p=p+Math.pow(2,c),a=a-m;}return (S?-1:1)*p*Math.pow(2,a-c)},Xr$1=function(t,i,f,c,h,a){var p,y,E,m=a*8-h-1,w=(1<<m)-1,_=w>>1,O=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=c?0:a-1,d=c?1:-1,M=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===Infinity?(y=isNaN(i)?1:0,p=w):(p=Math.floor(Math.log(i)/Math.LN2),i*(E=Math.pow(2,-p))<1&&(p--,E*=2),p+_>=1?i+=O/E:i+=O*Math.pow(2,1-_),i*E>=2&&(p++,E/=2),p+_>=w?(y=0,p=w):p+_>=1?(y=(i*E-1)*Math.pow(2,h),p=p+_):(y=i*Math.pow(2,_-1)*Math.pow(2,h),p=0));h>=8;t[f+S]=y&255,S+=d,y/=256,h-=8);for(p=p<<h|y,m+=h;m>0;t[f+S]=p&255,S+=d,p/=256,m-=8);t[f+S-d]|=M*128;},ot$1={read:zr$1,write:Xr$1},vt$1=Mr$2(function(r,t){var i=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;t.Buffer=a,t.SlowBuffer=D,t.INSPECT_MAX_BYTES=50;var f=2147483647;t.kMaxLength=f,a.TYPED_ARRAY_SUPPORT=c(),!a.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 c(){try{var o=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(o,e),o.foo()===42}catch{return false}}Object.defineProperty(a.prototype,`parent`,{enumerable:true,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,`offset`,{enumerable:true,get:function(){if(a.isBuffer(this))return this.byteOffset}});function h(o){if(o>f)throw new RangeError(`The value "`+o+`" is invalid for option "size"`);var e=new Uint8Array(o);return Object.setPrototypeOf(e,a.prototype),e}function a(o,e,n){if(typeof o==`number`){if(typeof e==`string`)throw new TypeError(`The "string" argument must be of type string. Received type number`);return m(o)}return p(o,e,n)}a.poolSize=8192;function p(o,e,n){if(typeof o==`string`)return w(o,e);if(ArrayBuffer.isView(o))return O(o);if(o==null)throw new TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+babelHelpers.typeof(o));if(Z(o,ArrayBuffer)||o&&Z(o.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(Z(o,SharedArrayBuffer)||o&&Z(o.buffer,SharedArrayBuffer)))return S(o,e,n);if(typeof o==`number`)throw new TypeError(`The "value" argument must not be of type number. Received type number`);var s=o.valueOf&&o.valueOf();if(s!=null&&s!==o)return a.from(s,e,n);var u=d(o);if(u)return u;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof o[Symbol.toPrimitive]==`function`)return a.from(o[Symbol.toPrimitive](`string`),e,n);throw new TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+babelHelpers.typeof(o))}a.from=function(o,e,n){return p(o,e,n)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function y(o){if(typeof o!=`number`)throw new TypeError(`"size" argument must be of type number`);if(o<0)throw new RangeError(`The value "`+o+`" is invalid for option "size"`)}function E(o,e,n){return y(o),o<=0?h(o):e!==void 0?typeof n==`string`?h(o).fill(e,n):h(o).fill(e):h(o)}a.alloc=function(o,e,n){return E(o,e,n)};function m(o){return y(o),h(o<0?0:M(o)|0)}a.allocUnsafe=function(o){return m(o)},a.allocUnsafeSlow=function(o){return m(o)};function w(o,e){if((typeof e!=`string`||e===``)&&(e=`utf8`),!a.isEncoding(e))throw new TypeError(`Unknown encoding: `+e);var n=F(o,e)|0,s=h(n),u=s.write(o,e);return u!==n&&(s=s.slice(0,u)),s}function _(o){for(var e=o.length<0?0:M(o.length)|0,n=h(e),s=0;s<e;s+=1)n[s]=o[s]&255;return n}function O(o){if(Z(o,Uint8Array)){var e=new Uint8Array(o);return S(e.buffer,e.byteOffset,e.byteLength)}return _(o)}function S(o,e,n){if(e<0||o.byteLength<e)throw new RangeError(`"offset" is outside of buffer bounds`);if(o.byteLength<e+(n||0))throw new RangeError(`"length" is outside of buffer bounds`);var s;return e===void 0&&n===void 0?s=new Uint8Array(o):n===void 0?s=new Uint8Array(o,e):s=new Uint8Array(o,e,n),Object.setPrototypeOf(s,a.prototype),s}function d(o){if(a.isBuffer(o)){var e=M(o.length)|0,n=h(e);return n.length===0||o.copy(n,0,0,e),n}if(o.length!==void 0)return typeof o.length!=`number`||Ut(o.length)?h(0):_(o);if(o.type===`Buffer`&&Array.isArray(o.data))return _(o.data)}function M(o){if(o>=f)throw new RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+f.toString(16)+` bytes`);return o|0}function D(o){return +o!=o&&(o=0),a.alloc(+o)}a.isBuffer=function(e){return e!=null&&e._isBuffer===true&&e!==a.prototype},a.compare=function(e,n){if(Z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),Z(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(e)||!a.isBuffer(n))throw new TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===n)return 0;for(var s=e.length,u=n.length,l=0,g=Math.min(s,u);l<g;++l)if(e[l]!==n[l]){s=e[l],u=n[l];break}return s<u?-1:u<s?1:0},a.isEncoding=function(e){switch(String(e).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 true;default:return false}},a.concat=function(e,n){if(!Array.isArray(e))throw new TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return a.alloc(0);var s;if(n===void 0)for(n=0,s=0;s<e.length;++s)n+=e[s].length;var u=a.allocUnsafe(n),l=0;for(s=0;s<e.length;++s){var g=e[s];if(Z(g,Uint8Array))l+g.length>u.length?a.from(g).copy(u,l):Uint8Array.prototype.set.call(u,g,l);else if(a.isBuffer(g))g.copy(u,l);else throw new TypeError(`"list" argument must be an Array of Buffers`);l+=g.length;}return u};function F(o,e){if(a.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||Z(o,ArrayBuffer))return o.byteLength;if(typeof o!=`string`)throw new TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+babelHelpers.typeof(o));var n=o.length,s=arguments.length>2&&arguments[2]===true;if(!s&&n===0)return 0;for(var u=false;;)switch(e){case `ascii`:case `latin1`:case `binary`:return n;case `utf8`:case `utf-8`:return xt(o).length;case `ucs2`:case `ucs-2`:case `utf16le`:case `utf-16le`:return n*2;case `hex`:return n>>>1;case `base64`:return Xt(o).length;default:if(u)return s?-1:xt(o).length;e=(``+e).toLowerCase(),u=true;}}a.byteLength=F;function P(o,e,n){var s=false;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return ``;for(o||(o=`utf8`);;)switch(o){case `hex`:return V(this,e,n);case `utf8`:case `utf-8`:return nt(this,e,n);case `ascii`:return it(this,e,n);case `latin1`:case `binary`:return T(this,e,n);case `base64`:return et(this,e,n);case `ucs2`:case `ucs-2`:case `utf16le`:case `utf-16le`:return b(this,e,n);default:if(s)throw new TypeError(`Unknown encoding: `+o);o=(o+``).toLowerCase(),s=true;}}a.prototype._isBuffer=true;function B(o,e,n){var s=o[e];o[e]=o[n],o[n]=s;}a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError(`Buffer size must be a multiple of 16-bits`);for(var n=0;n<e;n+=2)B(this,n,n+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError(`Buffer size must be a multiple of 32-bits`);for(var n=0;n<e;n+=4)B(this,n,n+3),B(this,n+1,n+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError(`Buffer size must be a multiple of 64-bits`);for(var n=0;n<e;n+=8)B(this,n,n+7),B(this,n+1,n+6),B(this,n+2,n+5),B(this,n+3,n+4);return this},a.prototype.toString=function(){var e=this.length;return e===0?``:arguments.length===0?nt(this,0,e):P.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError(`Argument must be a Buffer`);return this===e?true:a.compare(this,e)===0},a.prototype.inspect=function(){var e=``,n=t.INSPECT_MAX_BYTES;return e=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(e+=` ... `),`<Buffer `+e+`>`},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(e,n,s,u,l){if(Z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+babelHelpers.typeof(e));if(n===void 0&&(n=0),s===void 0&&(s=e?e.length:0),u===void 0&&(u=0),l===void 0&&(l=this.length),n<0||s>e.length||u<0||l>this.length)throw new RangeError(`out of range index`);if(u>=l&&n>=s)return 0;if(u>=l)return -1;if(n>=s)return 1;if(n>>>=0,s>>>=0,u>>>=0,l>>>=0,this===e)return 0;for(var g=l-u,I=s-n,x=Math.min(g,I),U=this.slice(u,l),j=e.slice(n,s),R=0;R<x;++R)if(U[R]!==j[R]){g=U[R],I=j[R];break}return g<I?-1:I<g?1:0};function Y(o,e,n,s,u){if(o.length===0)return -1;if(typeof n==`string`?(s=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Ut(n)&&(n=u?0:o.length-1),n<0&&(n=o.length+n),n>=o.length){if(u)return -1;n=o.length-1;}else if(n<0)if(u)n=0;else return -1;if(typeof e==`string`&&(e=a.from(e,s)),a.isBuffer(e))return e.length===0?-1:W(o,e,n,s,u);if(typeof e==`number`)return e=e&255,typeof Uint8Array.prototype.indexOf==`function`?u?Uint8Array.prototype.indexOf.call(o,e,n):Uint8Array.prototype.lastIndexOf.call(o,e,n):W(o,[e],n,s,u);throw new TypeError(`val must be string, number or Buffer`)}function W(o,e,n,s,u){var l=1,g=o.length,I=e.length;if(s!==void 0&&(s=String(s).toLowerCase(),s===`ucs2`||s===`ucs-2`||s===`utf16le`||s===`utf-16le`)){if(o.length<2||e.length<2)return -1;l=2,g/=2,I/=2,n/=2;}function x(qt,Gt){return l===1?qt[Gt]:qt.readUInt16BE(Gt*l)}var U;if(u){var j=-1;for(U=n;U<g;U++)if(x(o,U)===x(e,j===-1?0:U-j)){if(j===-1&&(j=U),U-j+1===I)return j*l}else j!==-1&&(U-=U-j),j=-1;}else for(n+I>g&&(n=g-I),U=n;U>=0;U--){for(var R=true,wt=0;wt<I;wt++)if(x(o,U+wt)!==x(e,wt)){R=false;break}if(R)return U}return -1}a.prototype.includes=function(e,n,s){return this.indexOf(e,n,s)!==-1},a.prototype.indexOf=function(e,n,s){return Y(this,e,n,s,true)},a.prototype.lastIndexOf=function(e,n,s){return Y(this,e,n,s,false)};function q(o,e,n,s){n=Number(n)||0;var u=o.length-n;s?(s=Number(s),s>u&&(s=u)):s=u;var l=e.length;s>l/2&&(s=l/2);for(var g=0;g<s;++g){var I=parseInt(e.substr(g*2,2),16);if(Ut(I))return g;o[n+g]=I;}return g}function bt(o,e,n,s){return yt(xt(e,o.length-n),o,n,s)}function at(o,e,n,s){return yt(Tr(e),o,n,s)}function At(o,e,n,s){return yt(Xt(e),o,n,s)}function pt(o,e,n,s){return yt(Rr(e,o.length-n),o,n,s)}a.prototype.write=function(e,n,s,u){if(n===void 0)u=`utf8`,s=this.length,n=0;else if(s===void 0&&typeof n==`string`)u=n,s=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(s)?(s=s>>>0,u===void 0&&(u=`utf8`)):(u=s,s=void 0);else throw new Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);var l=this.length-n;if((s===void 0||s>l)&&(s=l),e.length>0&&(s<0||n<0)||n>this.length)throw new RangeError(`Attempt to write outside buffer bounds`);u||(u=`utf8`);for(var g=false;;)switch(u){case `hex`:return q(this,e,n,s);case `utf8`:case `utf-8`:return bt(this,e,n,s);case `ascii`:case `latin1`:case `binary`:return at(this,e,n,s);case `base64`:return At(this,e,n,s);case `ucs2`:case `ucs-2`:case `utf16le`:case `utf-16le`:return pt(this,e,n,s);default:if(g)throw new TypeError(`Unknown encoding: `+u);u=(``+u).toLowerCase(),g=true;}},a.prototype.toJSON=function(){return {type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function et(o,e,n){return e===0&&n===o.length?Lt$1.fromByteArray(o):Lt$1.fromByteArray(o.slice(e,n))}function nt(o,e,n){n=Math.min(o.length,n);for(var s=[],u=e;u<n;){var l=o[u],g=null,I=l>239?4:l>223?3:l>191?2:1;if(u+I<=n){var x,U,j,R;switch(I){case 1:l<128&&(g=l);break;case 2:x=o[u+1],(x&192)===128&&(R=(l&31)<<6|x&63,R>127&&(g=R));break;case 3:x=o[u+1],U=o[u+2],(x&192)===128&&(U&192)===128&&(R=(l&15)<<12|(x&63)<<6|U&63,R>2047&&(R<55296||R>57343)&&(g=R));break;case 4:x=o[u+1],U=o[u+2],j=o[u+3],(x&192)===128&&(U&192)===128&&(j&192)===128&&(R=(l&15)<<18|(x&63)<<12|(U&63)<<6|j&63,R>65535&&R<1114112&&(g=R));}}g===null?(g=65533,I=1):g>65535&&(g-=65536,s.push(g>>>10&1023|55296),g=56320|g&1023),s.push(g),u+=I;}return gt(s)}var G=4096;function gt(o){var e=o.length;if(e<=G)return String.fromCharCode.apply(String,o);for(var n=``,s=0;s<e;)n+=String.fromCharCode.apply(String,o.slice(s,s+=G));return n}function it(o,e,n){var s=``;n=Math.min(o.length,n);for(var u=e;u<n;++u)s+=String.fromCharCode(o[u]&127);return s}function T(o,e,n){var s=``;n=Math.min(o.length,n);for(var u=e;u<n;++u)s+=String.fromCharCode(o[u]);return s}function V(o,e,n){var s=o.length;(!e||e<0)&&(e=0),(!n||n<0||n>s)&&(n=s);for(var u=``,l=e;l<n;++l)u+=Lr[o[l]];return u}function b(o,e,n){for(var s=o.slice(e,n),u=``,l=0;l<s.length-1;l+=2)u+=String.fromCharCode(s[l]+s[l+1]*256);return u}a.prototype.slice=function(e,n){var s=this.length;e=~~e,n=n===void 0?s:~~n,e<0?(e+=s,e<0&&(e=0)):e>s&&(e=s),n<0?(n+=s,n<0&&(n=0)):n>s&&(n=s),n<e&&(n=e);var u=this.subarray(e,n);return Object.setPrototypeOf(u,a.prototype),u};function N(o,e,n){if(o%1!==0||o<0)throw new RangeError(`offset is not uint`);if(o+e>n)throw new RangeError(`Trying to access beyond buffer length`)}a.prototype.readUintLE=a.prototype.readUIntLE=function(e,n,s){e=e>>>0,n=n>>>0,s||N(e,n,this.length);for(var u=this[e],l=1,g=0;++g<n&&(l*=256);)u+=this[e+g]*l;return u},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,n,s){e=e>>>0,n=n>>>0,s||N(e,n,this.length);for(var u=this[e+--n],l=1;n>0&&(l*=256);)u+=this[e+--n]*l;return u},a.prototype.readUint8=a.prototype.readUInt8=function(e,n){return e=e>>>0,n||N(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,n){return e=e>>>0,n||N(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,n){return e=e>>>0,n||N(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,n){return e=e>>>0,n||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,n){return e=e>>>0,n||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,n,s){e=e>>>0,n=n>>>0,s||N(e,n,this.length);for(var u=this[e],l=1,g=0;++g<n&&(l*=256);)u+=this[e+g]*l;return l*=128,u>=l&&(u-=Math.pow(2,8*n)),u},a.prototype.readIntBE=function(e,n,s){e=e>>>0,n=n>>>0,s||N(e,n,this.length);for(var u=n,l=1,g=this[e+--u];u>0&&(l*=256);)g+=this[e+--u]*l;return l*=128,g>=l&&(g-=Math.pow(2,8*n)),g},a.prototype.readInt8=function(e,n){return e=e>>>0,n||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,n){e=e>>>0,n||N(e,2,this.length);var s=this[e]|this[e+1]<<8;return s&32768?s|4294901760:s},a.prototype.readInt16BE=function(e,n){e=e>>>0,n||N(e,2,this.length);var s=this[e+1]|this[e]<<8;return s&32768?s|4294901760:s},a.prototype.readInt32LE=function(e,n){return e=e>>>0,n||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,n){return e=e>>>0,n||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,n){return e=e>>>0,n||N(e,4,this.length),ot$1.read(this,e,true,23,4)},a.prototype.readFloatBE=function(e,n){return e=e>>>0,n||N(e,4,this.length),ot$1.read(this,e,false,23,4)},a.prototype.readDoubleLE=function(e,n){return e=e>>>0,n||N(e,8,this.length),ot$1.read(this,e,true,52,8)},a.prototype.readDoubleBE=function(e,n){return e=e>>>0,n||N(e,8,this.length),ot$1.read(this,e,false,52,8)};function C(o,e,n,s,u,l){if(!a.isBuffer(o))throw new TypeError(`"buffer" argument must be a Buffer instance`);if(e>u||e<l)throw new RangeError(`"value" argument is out of bounds`);if(n+s>o.length)throw new RangeError(`Index out of range`)}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,n,s,u){if(e=+e,n=n>>>0,s=s>>>0,!u){var l=Math.pow(2,8*s)-1;C(this,e,n,s,l,0);}var g=1,I=0;for(this[n]=e&255;++I<s&&(g*=256);)this[n+I]=e/g&255;return n+s},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,n,s,u){if(e=+e,n=n>>>0,s=s>>>0,!u){var l=Math.pow(2,8*s)-1;C(this,e,n,s,l,0);}var g=s-1,I=1;for(this[n+g]=e&255;--g>=0&&(I*=256);)this[n+g]=e/I&255;return n+s},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,1,255,0),this[n]=e&255,n+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,2,65535,0),this[n]=e&255,this[n+1]=e>>>8,n+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,2,65535,0),this[n]=e>>>8,this[n+1]=e&255,n+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,4,4294967295,0),this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=e&255,n+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,4,4294967295,0),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4},a.prototype.writeIntLE=function(e,n,s,u){if(e=+e,n=n>>>0,!u){var l=Math.pow(2,8*s-1);C(this,e,n,s,l-1,-l);}var g=0,I=1,x=0;for(this[n]=e&255;++g<s&&(I*=256);)e<0&&x===0&&this[n+g-1]!==0&&(x=1),this[n+g]=(e/I>>0)-x&255;return n+s},a.prototype.writeIntBE=function(e,n,s,u){if(e=+e,n=n>>>0,!u){var l=Math.pow(2,8*s-1);C(this,e,n,s,l-1,-l);}var g=s-1,I=1,x=0;for(this[n+g]=e&255;--g>=0&&(I*=256);)e<0&&x===0&&this[n+g+1]!==0&&(x=1),this[n+g]=(e/I>>0)-x&255;return n+s},a.prototype.writeInt8=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,1,127,-128),e<0&&(e=255+e+1),this[n]=e&255,n+1},a.prototype.writeInt16LE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,2,32767,-32768),this[n]=e&255,this[n+1]=e>>>8,n+2},a.prototype.writeInt16BE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,2,32767,-32768),this[n]=e>>>8,this[n+1]=e&255,n+2},a.prototype.writeInt32LE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,4,2147483647,-2147483648),this[n]=e&255,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24,n+4},a.prototype.writeInt32BE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};function Wt(o,e,n,s,u,l){if(n+s>o.length)throw new RangeError(`Index out of range`);if(n<0)throw new RangeError(`Index out of range`)}function Zt(o,e,n,s,u){return e=+e,n=n>>>0,u||Wt(o,e,n,4),ot$1.write(o,e,n,s,23,4),n+4}a.prototype.writeFloatLE=function(e,n,s){return Zt(this,e,n,true,s)},a.prototype.writeFloatBE=function(e,n,s){return Zt(this,e,n,false,s)};function zt(o,e,n,s,u){return e=+e,n=n>>>0,u||Wt(o,e,n,8),ot$1.write(o,e,n,s,52,8),n+8}a.prototype.writeDoubleLE=function(e,n,s){return zt(this,e,n,true,s)},a.prototype.writeDoubleBE=function(e,n,s){return zt(this,e,n,false,s)},a.prototype.copy=function(e,n,s,u){if(!a.isBuffer(e))throw new TypeError(`argument should be a Buffer`);if(s||(s=0),!u&&u!==0&&(u=this.length),n>=e.length&&(n=e.length),n||(n=0),u>0&&u<s&&(u=s),u===s||e.length===0||this.length===0)return 0;if(n<0)throw new RangeError(`targetStart out of bounds`);if(s<0||s>=this.length)throw new RangeError(`Index out of range`);if(u<0)throw new RangeError(`sourceEnd out of bounds`);u>this.length&&(u=this.length),e.length-n<u-s&&(u=e.length-n+s);var l=u-s;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(n,s,u):Uint8Array.prototype.set.call(e,this.subarray(s,u),n),l},a.prototype.fill=function(e,n,s,u){if(typeof e==`string`){if(typeof n==`string`?(u=n,n=0,s=this.length):typeof s==`string`&&(u=s,s=this.length),u!==void 0&&typeof u!=`string`)throw new TypeError(`encoding must be a string`);if(typeof u==`string`&&!a.isEncoding(u))throw new TypeError(`Unknown encoding: `+u);if(e.length===1){var l=e.charCodeAt(0);(u===`utf8`&&l<128||u===`latin1`)&&(e=l);}}else typeof e==`number`?e=e&255:typeof e==`boolean`&&(e=Number(e));if(n<0||this.length<n||this.length<s)throw new RangeError(`Out of range index`);if(s<=n)return this;n=n>>>0,s=s===void 0?this.length:s>>>0,e||(e=0);var g;if(typeof e==`number`)for(g=n;g<s;++g)this[g]=e;else {var I=a.isBuffer(e)?e:a.from(e,u),x=I.length;if(x===0)throw new TypeError(`The value "`+e+`" is invalid for argument "value"`);for(g=0;g<s-n;++g)this[g+n]=I[g%x];}return this};var xr=/[^+/0-9A-Za-z-_]/g;function Ur(o){if(o=o.split(`=`)[0],o=o.trim().replace(xr,``),o.length<2)return ``;for(;o.length%4!==0;)o=o+`=`;return o}function xt(o,e){e=e||Infinity;for(var n,s=o.length,u=null,l=[],g=0;g<s;++g){if(n=o.charCodeAt(g),n>55295&&n<57344){if(!u){if(n>56319){(e-=3)>-1&&l.push(239,191,189);continue}else if(g+1===s){(e-=3)>-1&&l.push(239,191,189);continue}u=n;continue}if(n<56320){(e-=3)>-1&&l.push(239,191,189),u=n;continue}n=(u-55296<<10|n-56320)+65536;}else u&&(e-=3)>-1&&l.push(239,191,189);if(u=null,n<128){if((e-=1)<0)break;l.push(n);}else if(n<2048){if((e-=2)<0)break;l.push(n>>6|192,n&63|128);}else if(n<65536){if((e-=3)<0)break;l.push(n>>12|224,n>>6&63|128,n&63|128);}else if(n<1114112){if((e-=4)<0)break;l.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128);}else throw new Error(`Invalid code point`)}return l}function Tr(o){for(var e=[],n=0;n<o.length;++n)e.push(o.charCodeAt(n)&255);return e}function Rr(o,e){for(var n,s,u,l=[],g=0;g<o.length&&!((e-=2)<0);++g)n=o.charCodeAt(g),s=n>>8,u=n%256,l.push(u),l.push(s);return l}function Xt(o){return Lt$1.toByteArray(Ur(o))}function yt(o,e,n,s){for(var u=0;u<s&&!(u+n>=e.length||u>=o.length);++u)e[u+n]=o[u];return u}function Z(o,e){return o instanceof e||o!=null&&o.constructor!=null&&o.constructor.name!=null&&o.constructor.name===e.name}function Ut(o){return o!==o}var Lr=(function(){for(var o=`0123456789abcdef`,e=new Array(256),n=0;n<16;++n)for(var s=n*16,u=0;u<16;++u)e[s+u]=o[n]+o[u];return e})();}),A$2=vt$1.Buffer;vt$1.SlowBuffer;vt$1.INSPECT_MAX_BYTES;vt$1.kMaxLength;var $t$1=function(t,i){return $t$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,c){f.__proto__=c;}||function(f,c){for(var h in c)c.hasOwnProperty(h)&&(f[h]=c[h]);},$t$1(t,i)};function Bt$1(r,t){$t$1(r,t);function i(){this.constructor=r;}r.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i);}var tt$1=(function(r){Bt$1(t,r);function t(i){var f=r.call(this,i)||this;return Object.setPrototypeOf(f,t.prototype),f}return Object.defineProperty(t.prototype,`name`,{get:function(){return `BSONError`},enumerable:false,configurable:true}),t})(Error),L$3=(function(r){Bt$1(t,r);function t(i){var f=r.call(this,i)||this;return Object.setPrototypeOf(f,t.prototype),f}return Object.defineProperty(t.prototype,`name`,{get:function(){return `BSONTypeError`},enumerable:false,configurable:true}),t})(TypeError);function _t$1(r){return r&&r.Math==Math&&r}function gr$3(){return _t$1(typeof globalThis==`object`&&globalThis)||_t$1(typeof window==`object`&&window)||_t$1(typeof self==`object`&&self)||_t$1(typeof global==`object`&&global)||Function(`return this`)()}function qr$1(){var r=gr$3();return typeof r.navigator==`object`&&r.navigator.product===`ReactNative`}var Gr$1=function(t){var i=qr$1()?`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(i);for(var f=A$2.alloc(t),c=0;c<t;++c)f[c]=Math.floor(Math.random()*256);return f},kr$3=function(){if(typeof window<`u`){var r=window.crypto||window.msCrypto;if(r&&r.getRandomValues)return function(t){return r.getRandomValues(A$2.alloc(t))}}return typeof global<`u`&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(A$2.alloc(t))}:Gr$1},yr$1=kr$3();function Kr$1(r){return [`[object ArrayBuffer]`,`[object SharedArrayBuffer]`].includes(Object.prototype.toString.call(r))}function Ct$2(r){return Object.prototype.toString.call(r)===`[object Uint8Array]`}function Qr$1(r){return Object.prototype.toString.call(r)===`[object RegExp]`}function te$3(r){return lt$2(r)&&Object.prototype.toString.call(r)===`[object Date]`}function lt$2(r){return typeof r==`object`&&r!==null}function St$1(r,t){var i=false;function f(){for(var c=[],h=0;h<arguments.length;h++)c[h]=arguments[h];return i||(console.warn(t),i=true),r.apply(this,c)}return f}function Et$1(r){if(ArrayBuffer.isView(r))return A$2.from(r.buffer,r.byteOffset,r.byteLength);if(Kr$1(r))return A$2.from(r);throw new L$3(`Must use either Buffer or TypedArray`)}var re$3=/^(?:[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,wr$2=function(r){return typeof r==`string`&&re$3.test(r)},Pt=function(r){if(!wr$2(r))throw new L$3(`UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".`);var t=r.replace(/-/g,``);return A$2.from(t,`hex`)},Kt$1=function(r,t){return t===void 0&&(t=true),t?r.toString(`hex`,0,4)+`-`+r.toString(`hex`,4,6)+`-`+r.toString(`hex`,6,8)+`-`+r.toString(`hex`,8,10)+`-`+r.toString(`hex`,10,16):r.toString(`hex`)};var ee$1=Math.pow(2,53),ne$2=-Math.pow(2,53);var mr$3=4;var rt$1=(function(){function r(t,i){if(!(this instanceof r))return new r(t,i);if(t!=null&&typeof t!=`string`&&!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer)&&!Array.isArray(t))throw new L$3(`Binary can only be constructed from string, Buffer, TypedArray, or Array<number>`);this.sub_type=i??r.BSON_BINARY_SUBTYPE_DEFAULT,t==null?(this.buffer=A$2.alloc(r.BUFFER_SIZE),this.position=0):(typeof t==`string`?this.buffer=A$2.from(t,`binary`):Array.isArray(t)?this.buffer=A$2.from(t):this.buffer=Et$1(t),this.position=this.buffer.byteLength);}return r.prototype.put=function(t){if(typeof t==`string`&&t.length!==1)throw new L$3(`only accepts single character String`);if(typeof t!=`number`&&t.length!==1)throw new L$3(`only accepts single character Uint8Array or Array`);var i;if(typeof t==`string`?i=t.charCodeAt(0):typeof t==`number`?i=t:i=t[0],i<0||i>255)throw new L$3(`only accepts number in a valid unsigned byte range 0-255`);if(this.buffer.length>this.position)this.buffer[this.position++]=i;else {var f=A$2.alloc(r.BUFFER_SIZE+this.buffer.length);this.buffer.copy(f,0,0,this.buffer.length),this.buffer=f,this.buffer[this.position++]=i;}},r.prototype.write=function(t,i){if(i=typeof i==`number`?i:this.position,this.buffer.length<i+t.length){var f=A$2.alloc(this.buffer.length+t.length);this.buffer.copy(f,0,0,this.buffer.length),this.buffer=f;}ArrayBuffer.isView(t)?(this.buffer.set(Et$1(t),i),this.position=i+t.byteLength>this.position?i+t.length:this.position):typeof t==`string`&&(this.buffer.write(t,i,t.length,`binary`),this.position=i+t.length>this.position?i+t.length:this.position);},r.prototype.read=function(t,i){return i=i&&i>0?i:this.position,this.buffer.slice(t,t+i)},r.prototype.value=function(t){return t=!!t,t&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString(`binary`,0,this.position)},r.prototype.length=function(){return this.position},r.prototype.toJSON=function(){return this.buffer.toString(`base64`)},r.prototype.toString=function(t){return this.buffer.toString(t)},r.prototype.toExtendedJSON=function(t){t=t||{};var i=this.buffer.toString(`base64`),f=Number(this.sub_type).toString(16);return t.legacy?{$binary:i,$type:f.length===1?`0`+f:f}:{$binary:{base64:i,subType:f.length===1?`0`+f:f}}},r.prototype.toUUID=function(){if(this.sub_type===r.SUBTYPE_UUID)return new Qt$1(this.buffer.slice(0,this.position));throw new tt$1(`Binary sub_type "`.concat(this.sub_type,`" is not supported for converting to UUID. Only "`).concat(r.SUBTYPE_UUID,`" is currently supported.`))},r.fromExtendedJSON=function(t,i){i=i||{};var f,c;if(`$binary`in t?i.legacy&&typeof t.$binary==`string`&&`$type`in t?(c=t.$type?parseInt(t.$type,16):0,f=A$2.from(t.$binary,`base64`)):typeof t.$binary!=`string`&&(c=t.$binary.subType?parseInt(t.$binary.subType,16):0,f=A$2.from(t.$binary.base64,`base64`)):`$uuid`in t&&(c=4,f=Pt(t.$uuid)),!f)throw new L$3(`Unexpected Binary Extended JSON format `.concat(JSON.stringify(t)));return c===mr$3?new Qt$1(f):new r(f,c)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){var t=this.value(true);return `new Binary(Buffer.from("`.concat(t.toString(`hex`),`", "hex"), `).concat(this.sub_type,`)`)},r.BSON_BINARY_SUBTYPE_DEFAULT=0,r.BUFFER_SIZE=256,r.SUBTYPE_DEFAULT=0,r.SUBTYPE_FUNCTION=1,r.SUBTYPE_BYTE_ARRAY=2,r.SUBTYPE_UUID_OLD=3,r.SUBTYPE_UUID=4,r.SUBTYPE_MD5=5,r.SUBTYPE_ENCRYPTED=6,r.SUBTYPE_COLUMN=7,r.SUBTYPE_USER_DEFINED=128,r})();Object.defineProperty(rt$1.prototype,`_bsontype`,{value:`Binary`});var Dt=16,Qt$1=(function(r){Bt$1(t,r);function t(i){var f=this,c,h;if(i==null)c=t.generate();else if(i instanceof t)c=A$2.from(i.buffer),h=i.__id;else if(ArrayBuffer.isView(i)&&i.byteLength===Dt)c=Et$1(i);else if(typeof i==`string`)c=Pt(i);else throw new L$3(`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 f=r.call(this,c,mr$3)||this,f.__id=h,f}return Object.defineProperty(t.prototype,`id`,{get:function(){return this.buffer},set:function(i){this.buffer=i,t.cacheHexString&&(this.__id=Kt$1(i));},enumerable:false,configurable:true}),t.prototype.toHexString=function(i){if(i===void 0&&(i=true),t.cacheHexString&&this.__id)return this.__id;var f=Kt$1(this.id,i);return t.cacheHexString&&(this.__id=f),f},t.prototype.toString=function(i){return i?this.id.toString(i):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(i){if(!i)return false;if(i instanceof t)return i.id.equals(this.id);try{return new t(i).id.equals(this.id)}catch{return false}},t.prototype.toBinary=function(){return new rt$1(this.id,rt$1.SUBTYPE_UUID)},t.generate=function(){var i=yr$1(Dt);return i[6]=i[6]&15|64,i[8]=i[8]&63|128,A$2.from(i)},t.isValid=function(i){return i?i instanceof t?true:typeof i==`string`?wr$2(i):Ct$2(i)?i.length!==Dt?false:(i[6]&240)===64&&(i[8]&128)===128:false:false},t.createFromHexString=function(i){return new t(Pt(i))},t.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},t.prototype.inspect=function(){return `new UUID("`.concat(this.toHexString(),`")`)},t})(rt$1),Nt$1=(function(){function r(t,i){if(!(this instanceof r))return new r(t,i);this.code=t,this.scope=i;}return r.prototype.toJSON=function(){return {code:this.code,scope:this.scope}},r.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},r.fromExtendedJSON=function(t){return new r(t.$code,t.$scope)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){var t=this.toJSON();return `new Code("`.concat(String(t.code),`"`).concat(t.scope?`, `.concat(JSON.stringify(t.scope)):``,`)`)},r})();Object.defineProperty(Nt$1.prototype,`_bsontype`,{value:`Code`});function ie$2(r){return lt$2(r)&&r.$id!=null&&typeof r.$ref==`string`&&(r.$db==null||typeof r.$db==`string`)}var ht$2=(function(){function r(t,i,f,c){if(!(this instanceof r))return new r(t,i,f,c);var h=t.split(`.`);h.length===2&&(f=h.shift(),t=h.shift()),this.collection=t,this.oid=i,this.db=f,this.fields=c||{};}return Object.defineProperty(r.prototype,`namespace`,{get:function(){return this.collection},set:function(t){this.collection=t;},enumerable:false,configurable:true}),r.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(t.$db=this.db),t},r.prototype.toExtendedJSON=function(t){t=t||{};var i={$ref:this.collection,$id:this.oid};return t.legacy||(this.db&&(i.$db=this.db),i=Object.assign(i,this.fields)),i},r.fromExtendedJSON=function(t){var i=Object.assign({},t);return delete i.$ref,delete i.$id,delete i.$db,new r(t.$ref,t.$id,t.$db,i)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){var t=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return `new DBRef("`.concat(this.namespace,`", new ObjectId("`).concat(String(t),`")`).concat(this.db?`, "`.concat(this.db,`"`):``,`)`)},r})();Object.defineProperty(ht$2.prototype,`_bsontype`,{value:`DBRef`});var J$1=void 0;try{J$1=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 tr$3=65536,oe$3=1<<24,ft$2=tr$3*tr$3,_r$3=ft$2*ft$2,rr$3=_r$3/2,er$3={},nr$2={},v$1=(function(){function r(t,i,f){if(t===void 0&&(t=0),!(this instanceof r))return new r(t,i,f);typeof t==`bigint`?Object.assign(this,r.fromBigInt(t,!!i)):typeof t==`string`?Object.assign(this,r.fromString(t,!!i)):(this.low=t|0,this.high=i|0,this.unsigned=!!f),Object.defineProperty(this,`__isLong__`,{value:true,configurable:false,writable:false,enumerable:false});}return r.fromBits=function(t,i,f){return new r(t,i,f)},r.fromInt=function(t,i){var f,c,h;return i?(t>>>=0,(h=0<=t&&t<256)&&(c=nr$2[t],c)?c:(f=r.fromBits(t,(t|0)<0?-1:0,true),h&&(nr$2[t]=f),f)):(t|=0,(h=-128<=t&&t<128)&&(c=er$3[t],c)?c:(f=r.fromBits(t,t<0?-1:0,false),h&&(er$3[t]=f),f))},r.fromNumber=function(t,i){if(isNaN(t))return i?r.UZERO:r.ZERO;if(i){if(t<0)return r.UZERO;if(t>=_r$3)return r.MAX_UNSIGNED_VALUE}else {if(t<=-9223372036854776e3)return r.MIN_VALUE;if(t+1>=rr$3)return r.MAX_VALUE}return t<0?r.fromNumber(-t,i).neg():r.fromBits(t%ft$2|0,t/ft$2|0,i)},r.fromBigInt=function(t,i){return r.fromString(t.toString(),i)},r.fromString=function(t,i,f){if(t.length===0)throw Error(`empty string`);if(t===`NaN`||t===`Infinity`||t===`+Infinity`||t===`-Infinity`)return r.ZERO;if(typeof i==`number`?(f=i,i=false):i=!!i,f=f||10,f<2||36<f)throw RangeError(`radix`);var c;if((c=t.indexOf(`-`))>0)throw Error(`interior hyphen`);if(c===0)return r.fromString(t.substring(1),i,f).neg();for(var h=r.fromNumber(Math.pow(f,8)),a=r.ZERO,p=0;p<t.length;p+=8){var y=Math.min(8,t.length-p),E=parseInt(t.substring(p,p+y),f);if(y<8){var m=r.fromNumber(Math.pow(f,y));a=a.mul(m).add(r.fromNumber(E));}else a=a.mul(h),a=a.add(r.fromNumber(E));}return a.unsigned=i,a},r.fromBytes=function(t,i,f){return f?r.fromBytesLE(t,i):r.fromBytesBE(t,i)},r.fromBytesLE=function(t,i){return new r(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,i)},r.fromBytesBE=function(t,i){return new r(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],i)},r.isLong=function(t){return lt$2(t)&&t.__isLong__===true},r.fromValue=function(t,i){return typeof t==`number`?r.fromNumber(t,i):typeof t==`string`?r.fromString(t,i):r.fromBits(t.low,t.high,typeof i==`boolean`?i:t.unsigned)},r.prototype.add=function(t){r.isLong(t)||(t=r.fromValue(t));var i=this.high>>>16,f=this.high&65535,c=this.low>>>16,h=this.low&65535,a=t.high>>>16,p=t.high&65535,y=t.low>>>16,E=t.low&65535,m=0,w=0,_=0,O=0;return O+=h+E,_+=O>>>16,O&=65535,_+=c+y,w+=_>>>16,_&=65535,w+=f+p,m+=w>>>16,w&=65535,m+=i+a,m&=65535,r.fromBits(_<<16|O,m<<16|w,this.unsigned)},r.prototype.and=function(t){return r.isLong(t)||(t=r.fromValue(t)),r.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},r.prototype.compare=function(t){if(r.isLong(t)||(t=r.fromValue(t)),this.eq(t))return 0;var i=this.isNegative(),f=t.isNegative();return i&&!f?-1:!i&&f?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},r.prototype.comp=function(t){return this.compare(t)},r.prototype.divide=function(t){if(r.isLong(t)||(t=r.fromValue(t)),t.isZero())throw Error(`division by zero`);if(J$1){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var i=(this.unsigned?J$1.div_u:J$1.div_s)(this.low,this.high,t.low,t.high);return r.fromBits(i,J$1.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?r.UZERO:r.ZERO;var f,c,h;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return r.UZERO;if(t.gt(this.shru(1)))return r.UONE;h=r.UZERO;}else {if(this.eq(r.MIN_VALUE)){if(t.eq(r.ONE)||t.eq(r.NEG_ONE))return r.MIN_VALUE;if(t.eq(r.MIN_VALUE))return r.ONE;return f=this.shr(1).div(t).shl(1),f.eq(r.ZERO)?t.isNegative()?r.ONE:r.NEG_ONE:(c=this.sub(t.mul(f)),h=f.add(c.div(t)),h)}else if(t.eq(r.MIN_VALUE))return this.unsigned?r.UZERO:r.ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();h=r.ZERO;}for(c=this;c.gte(t);){f=Math.max(1,Math.floor(c.toNumber()/t.toNumber()));for(var p=Math.ceil(Math.log(f)/Math.LN2),y=p<=48?1:Math.pow(2,p-48),E=r.fromNumber(f),m=E.mul(t);m.isNegative()||m.gt(c);)f-=y,E=r.fromNumber(f,this.unsigned),m=E.mul(t);E.isZero()&&(E=r.ONE),h=h.add(E),c=c.sub(m);}return h},r.prototype.div=function(t){return this.divide(t)},r.prototype.equals=function(t){return r.isLong(t)||(t=r.fromValue(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?false:this.high===t.high&&this.low===t.low},r.prototype.eq=function(t){return this.equals(t)},r.prototype.getHighBits=function(){return this.high},r.prototype.getHighBitsUnsigned=function(){return this.high>>>0},r.prototype.getLowBits=function(){return this.low},r.prototype.getLowBitsUnsigned=function(){return this.low>>>0},r.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(r.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t=this.high!==0?this.high:this.low,i;for(i=31;i>0&&(t&1<<i)===0;i--);return this.high!==0?i+33:i+1},r.prototype.greaterThan=function(t){return this.comp(t)>0},r.prototype.gt=function(t){return this.greaterThan(t)},r.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},r.prototype.gte=function(t){return this.greaterThanOrEqual(t)},r.prototype.ge=function(t){return this.greaterThanOrEqual(t)},r.prototype.isEven=function(){return (this.low&1)===0},r.prototype.isNegative=function(){return !this.unsigned&&this.high<0},r.prototype.isOdd=function(){return (this.low&1)===1},r.prototype.isPositive=function(){return this.unsigned||this.high>=0},r.prototype.isZero=function(){return this.high===0&&this.low===0},r.prototype.lessThan=function(t){return this.comp(t)<0},r.prototype.lt=function(t){return this.lessThan(t)},r.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},r.prototype.lte=function(t){return this.lessThanOrEqual(t)},r.prototype.modulo=function(t){if(r.isLong(t)||(t=r.fromValue(t)),J$1){var i=(this.unsigned?J$1.rem_u:J$1.rem_s)(this.low,this.high,t.low,t.high);return r.fromBits(i,J$1.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},r.prototype.mod=function(t){return this.modulo(t)},r.prototype.rem=function(t){return this.modulo(t)},r.prototype.multiply=function(t){if(this.isZero())return r.ZERO;if(r.isLong(t)||(t=r.fromValue(t)),J$1){var i=J$1.mul(this.low,this.high,t.low,t.high);return r.fromBits(i,J$1.get_high(),this.unsigned)}if(t.isZero())return r.ZERO;if(this.eq(r.MIN_VALUE))return t.isOdd()?r.MIN_VALUE:r.ZERO;if(t.eq(r.MIN_VALUE))return this.isOdd()?r.MIN_VALUE:r.ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(r.TWO_PWR_24)&&t.lt(r.TWO_PWR_24))return r.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var f=this.high>>>16,c=this.high&65535,h=this.low>>>16,a=this.low&65535,p=t.high>>>16,y=t.high&65535,E=t.low>>>16,m=t.low&65535,w=0,_=0,O=0,S=0;return S+=a*m,O+=S>>>16,S&=65535,O+=h*m,_+=O>>>16,O&=65535,O+=a*E,_+=O>>>16,O&=65535,_+=c*m,w+=_>>>16,_&=65535,_+=h*E,w+=_>>>16,_&=65535,_+=a*y,w+=_>>>16,_&=65535,w+=f*m+c*E+h*y+a*p,w&=65535,r.fromBits(O<<16|S,w<<16|_,this.unsigned)},r.prototype.mul=function(t){return this.multiply(t)},r.prototype.negate=function(){return !this.unsigned&&this.eq(r.MIN_VALUE)?r.MIN_VALUE:this.not().add(r.ONE)},r.prototype.neg=function(){return this.negate()},r.prototype.not=function(){return r.fromBits(~this.low,~this.high,this.unsigned)},r.prototype.notEquals=function(t){return !this.equals(t)},r.prototype.neq=function(t){return this.notEquals(t)},r.prototype.ne=function(t){return this.notEquals(t)},r.prototype.or=function(t){return r.isLong(t)||(t=r.fromValue(t)),r.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},r.prototype.shiftLeft=function(t){return r.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?r.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):r.fromBits(0,this.low<<t-32,this.unsigned)},r.prototype.shl=function(t){return this.shiftLeft(t)},r.prototype.shiftRight=function(t){return r.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?r.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):r.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},r.prototype.shr=function(t){return this.shiftRight(t)},r.prototype.shiftRightUnsigned=function(t){if(r.isLong(t)&&(t=t.toInt()),t&=63,t===0)return this;var i=this.high;if(t<32){var f=this.low;return r.fromBits(f>>>t|i<<32-t,i>>>t,this.unsigned)}else return t===32?r.fromBits(i,0,this.unsigned):r.fromBits(i>>>t-32,0,this.unsigned)},r.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},r.prototype.shru=function(t){return this.shiftRightUnsigned(t)},r.prototype.subtract=function(t){return r.isLong(t)||(t=r.fromValue(t)),this.add(t.neg())},r.prototype.sub=function(t){return this.subtract(t)},r.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},r.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*ft$2+(this.low>>>0):this.high*ft$2+(this.low>>>0)},r.prototype.toBigInt=function(){return BigInt(this.toString())},r.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},r.prototype.toBytesLE=function(){var t=this.high,i=this.low;return [i&255,i>>>8&255,i>>>16&255,i>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},r.prototype.toBytesBE=function(){var t=this.high,i=this.low;return [t>>>24,t>>>16&255,t>>>8&255,t&255,i>>>24,i>>>16&255,i>>>8&255,i&255]},r.prototype.toSigned=function(){return this.unsigned?r.fromBits(this.low,this.high,false):this},r.prototype.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError(`radix`);if(this.isZero())return `0`;if(this.isNegative())if(this.eq(r.MIN_VALUE)){var i=r.fromNumber(t),f=this.div(i),c=f.mul(i).sub(this);return f.toString(t)+c.toInt().toString(t)}else return `-`+this.neg().toString(t);for(var h=r.fromNumber(Math.pow(t,6),this.unsigned),a=this,p=``;;){var y=a.div(h),m=(a.sub(y.mul(h)).toInt()>>>0).toString(t);if(a=y,a.isZero())return m+p;for(;m.length<6;)m=`0`+m;p=``+m+p;}},r.prototype.toUnsigned=function(){return this.unsigned?this:r.fromBits(this.low,this.high,true)},r.prototype.xor=function(t){return r.isLong(t)||(t=r.fromValue(t)),r.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},r.prototype.eqz=function(){return this.isZero()},r.prototype.le=function(t){return this.lessThanOrEqual(t)},r.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},r.fromExtendedJSON=function(t,i){var f=r.fromString(t.$numberLong);return i&&i.relaxed?f.toNumber():f},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new Long("`.concat(this.toString(),`"`).concat(this.unsigned?`, true`:``,`)`)},r.TWO_PWR_24=r.fromInt(oe$3),r.MAX_UNSIGNED_VALUE=r.fromBits(-1,-1,true),r.ZERO=r.fromInt(0),r.UZERO=r.fromInt(0,true),r.ONE=r.fromInt(1),r.UONE=r.fromInt(1,true),r.NEG_ONE=r.fromInt(-1),r.MAX_VALUE=r.fromBits(-1,2147483647,false),r.MIN_VALUE=r.fromBits(0,-2147483648,false),r})();Object.defineProperty(v$1.prototype,`__isLong__`,{value:true});Object.defineProperty(v$1.prototype,`_bsontype`,{value:`Long`});var se$2=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,fe$1=/^(\+|-)?(Infinity|inf)$/i,ae$3=/^(\+|-)?NaN$/i,ut$2=6111,Ft$1=-6176,ir$3=6176,ue$1=34,Mt$1=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),or$3=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),sr$3=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),he$2=/^([-+])?(\d+)?$/,ce$3=31,fr$3=16383,le$3=30,pe$2=31;function ar$3(r){return !isNaN(parseInt(r,10))}function ge$2(r){var t=v$1.fromNumber(1e9),i=v$1.fromNumber(0);if(!r.parts[0]&&!r.parts[1]&&!r.parts[2]&&!r.parts[3])return {quotient:r,rem:i};for(var f=0;f<=3;f++)i=i.shiftLeft(32),i=i.add(new v$1(r.parts[f],0)),r.parts[f]=i.div(t).low,i=i.modulo(t);return {quotient:r,rem:i}}function ye$3(r,t){if(!r&&!t)return {high:v$1.fromNumber(0),low:v$1.fromNumber(0)};var i=r.shiftRightUnsigned(32),f=new v$1(r.getLowBits(),0),c=t.shiftRightUnsigned(32),h=new v$1(t.getLowBits(),0),a=i.multiply(c),p=i.multiply(h),y=f.multiply(c),E=f.multiply(h);return a=a.add(p.shiftRightUnsigned(32)),p=new v$1(p.getLowBits(),0).add(y).add(E.shiftRightUnsigned(32)),a=a.add(p.shiftRightUnsigned(32)),E=p.shiftLeft(32).add(new v$1(E.getLowBits(),0)),{high:a,low:E}}function we$3(r,t){var i=r.high>>>0,f=t.high>>>0;if(i<f)return true;if(i===f){if(r.low>>>0<t.low>>>0)return true}return false}function st$2(r,t){throw new L$3(`"`.concat(r,`" is not a valid Decimal128 string - `).concat(t))}var Yt$1=(function(){function r(t){if(!(this instanceof r))return new r(t);if(typeof t==`string`)this.bytes=r.fromString(t).bytes;else if(Ct$2(t)){if(t.byteLength!==16)throw new L$3(`Decimal128 must take a Buffer of 16 bytes`);this.bytes=t;}else throw new L$3(`Decimal128 must take a Buffer or string`)}return r.fromString=function(t){var i=false,f=false,c=false,h=0,a=0,p=0,y=0,E=0,m=[0],w=0,_=0,O=0,S=0,d=0,M=0,D=new v$1(0,0),F=new v$1(0,0),P=0,B=0;if(t.length>=7e3)throw new L$3(``+t+` not a valid Decimal128 string`);var Y=t.match(se$2),W=t.match(fe$1),q=t.match(ae$3);if(!Y&&!W&&!q||t.length===0)throw new L$3(``+t+` not a valid Decimal128 string`);if(Y){var bt=Y[2],at=Y[4],At=Y[5],pt=Y[6];at&&pt===void 0&&st$2(t,`missing exponent power`),at&&bt===void 0&&st$2(t,`missing exponent base`),at===void 0&&(At||pt)&&st$2(t,`missing e before exponent`);}if((t[B]===`+`||t[B]===`-`)&&(i=t[B++]===`-`),!ar$3(t[B])&&t[B]!==`.`){if(t[B]===`i`||t[B]===`I`)return new r(A$2.from(i?or$3:sr$3));if(t[B]===`N`)return new r(A$2.from(Mt$1))}for(;ar$3(t[B])||t[B]===`.`;){if(t[B]===`.`){f&&st$2(t,`contains multiple periods`),f=true,B=B+1;continue}w<34&&(t[B]!==`0`||c)&&(c||(E=a),c=true,m[_++]=parseInt(t[B],10),w=w+1),c&&(p=p+1),f&&(y=y+1),a=a+1,B=B+1;}if(f&&!a)throw new L$3(``+t+` not a valid Decimal128 string`);if(t[B]===`e`||t[B]===`E`){var et=t.substr(++B).match(he$2);if(!et||!et[2])return new r(A$2.from(Mt$1));d=parseInt(et[0],10),B=B+et[0].length;}if(t[B])return new r(A$2.from(Mt$1));if(O=0,!w)O=0,S=0,m[0]=0,p=1,w=1,h=0;else if(S=w-1,h=p,h!==1)for(;m[E+h-1]===0;)h=h-1;for(d<=y&&y-d>16384?d=Ft$1:d=d-y;d>ut$2;){if(S=S+1,S-O>ue$1){var nt=m.join(``);if(nt.match(/^0+$/)){d=ut$2;break}st$2(t,`overflow`);}d=d-1;}for(;d<Ft$1||w<p;){if(S===0&&h<w){d=Ft$1,h=0;break}if(w<p?p=p-1:S=S-1,d<ut$2)d=d+1;else {var nt=m.join(``);if(nt.match(/^0+$/)){d=ut$2;break}st$2(t,`overflow`);}}if(S-O+1<h){var G=a;f&&(E=E+1,G=G+1),i&&(E=E+1,G=G+1);var gt=parseInt(t[E+S+1],10),it=0;if(gt>=5&&(it=1,gt===5)){for(it=m[S]%2===1?1:0,M=E+S+2;M<G;M++)if(parseInt(t[M],10)){it=1;break}}if(it){for(var T=S;T>=0;T--)if(++m[T]>9&&(m[T]=0,T===0))if(d<ut$2)d=d+1,m[T]=1;else return new r(A$2.from(i?or$3:sr$3))}}if(D=v$1.fromNumber(0),F=v$1.fromNumber(0),h===0)D=v$1.fromNumber(0),F=v$1.fromNumber(0);else if(S-O<17){var T=O;for(F=v$1.fromNumber(m[T++]),D=new v$1(0,0);T<=S;T++)F=F.multiply(v$1.fromNumber(10)),F=F.add(v$1.fromNumber(m[T]));}else {var T=O;for(D=v$1.fromNumber(m[T++]);T<=S-17;T++)D=D.multiply(v$1.fromNumber(10)),D=D.add(v$1.fromNumber(m[T]));for(F=v$1.fromNumber(m[T++]);T<=S;T++)F=F.multiply(v$1.fromNumber(10)),F=F.add(v$1.fromNumber(m[T]));}var V=ye$3(D,v$1.fromString(`100000000000000000`));V.low=V.low.add(F),we$3(V.low,F)&&(V.high=V.high.add(v$1.fromNumber(1))),P=d+ir$3;var b={low:v$1.fromNumber(0),high:v$1.fromNumber(0)};V.high.shiftRightUnsigned(49).and(v$1.fromNumber(1)).equals(v$1.fromNumber(1))?(b.high=b.high.or(v$1.fromNumber(3).shiftLeft(61)),b.high=b.high.or(v$1.fromNumber(P).and(v$1.fromNumber(16383).shiftLeft(47))),b.high=b.high.or(V.high.and(v$1.fromNumber(0x7fffffffffff)))):(b.high=b.high.or(v$1.fromNumber(P&16383).shiftLeft(49)),b.high=b.high.or(V.high.and(v$1.fromNumber(562949953421311)))),b.low=V.low,i&&(b.high=b.high.or(v$1.fromString(`9223372036854775808`)));var N=A$2.alloc(16);return B=0,N[B++]=b.low.low&255,N[B++]=b.low.low>>8&255,N[B++]=b.low.low>>16&255,N[B++]=b.low.low>>24&255,N[B++]=b.low.high&255,N[B++]=b.low.high>>8&255,N[B++]=b.low.high>>16&255,N[B++]=b.low.high>>24&255,N[B++]=b.high.low&255,N[B++]=b.high.low>>8&255,N[B++]=b.high.low>>16&255,N[B++]=b.high.low>>24&255,N[B++]=b.high.high&255,N[B++]=b.high.high>>8&255,N[B++]=b.high.high>>16&255,N[B++]=b.high.high>>24&255,new r(N)},r.prototype.toString=function(){for(var t,i=0,f=new Array(36),c=0;c<f.length;c++)f[c]=0;var h=0,a=false,p,y={parts:[0,0,0,0]},E,m,w=[];h=0;var _=this.bytes,O=_[h++]|_[h++]<<8|_[h++]<<16|_[h++]<<24,S=_[h++]|_[h++]<<8|_[h++]<<16|_[h++]<<24,d=_[h++]|_[h++]<<8|_[h++]<<16|_[h++]<<24,M=_[h++]|_[h++]<<8|_[h++]<<16|_[h++]<<24;h=0;({low:new v$1(O,S),high:new v$1(d,M)}).high.lessThan(v$1.ZERO)&&w.push(`-`);var F=M>>26&ce$3;if(F>>3===3){if(F===le$3)return w.join(``)+`Infinity`;if(F===pe$2)return `NaN`;t=M>>15&fr$3,p=8+(M>>14&1);}else p=M>>14&7,t=M>>17&fr$3;var P=t-ir$3;if(y.parts[0]=(M&16383)+((p&15)<<14),y.parts[1]=d,y.parts[2]=S,y.parts[3]=O,y.parts[0]===0&&y.parts[1]===0&&y.parts[2]===0&&y.parts[3]===0)a=true;else for(m=3;m>=0;m--){var B=0,Y=ge$2(y);if(y=Y.quotient,B=Y.rem.low,!!B)for(E=8;E>=0;E--)f[m*9+E]=B%10,B=Math.floor(B/10);}if(a)i=1,f[h]=0;else for(i=36;!f[h];)i=i-1,h=h+1;var W=i-1+P;if(W>=34||W<=-7||P>0){if(i>34)return w.push(``.concat(0)),P>0?w.push(`E+`.concat(P)):P<0&&w.push(`E`.concat(P)),w.join(``);w.push(``.concat(f[h++])),i=i-1,i&&w.push(`.`);for(var c=0;c<i;c++)w.push(``.concat(f[h++]));w.push(`E`),W>0?w.push(`+`.concat(W)):w.push(``.concat(W));}else if(P>=0)for(var c=0;c<i;c++)w.push(``.concat(f[h++]));else {var q=i+P;if(q>0)for(var c=0;c<q;c++)w.push(``.concat(f[h++]));else w.push(`0`);for(w.push(`.`);q++<0;)w.push(`0`);for(var c=0;c<i-Math.max(q-1,0);c++)w.push(``.concat(f[h++]));}return w.join(``)},r.prototype.toJSON=function(){return {$numberDecimal:this.toString()}},r.prototype.toExtendedJSON=function(){return {$numberDecimal:this.toString()}},r.fromExtendedJSON=function(t){return r.fromString(t.$numberDecimal)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new Decimal128("`.concat(this.toString(),`")`)},r})();Object.defineProperty(Yt$1.prototype,`_bsontype`,{value:`Decimal128`});var Ot$1=(function(){function r(t){if(!(this instanceof r))return new r(t);t instanceof Number&&(t=t.valueOf()),this.value=+t;}return r.prototype.valueOf=function(){return this.value},r.prototype.toJSON=function(){return this.value},r.prototype.toString=function(t){return this.value.toString(t)},r.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.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()}},r.fromExtendedJSON=function(t,i){var f=parseFloat(t.$numberDouble);return i&&i.relaxed?f:new r(f)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){var t=this.toExtendedJSON();return `new Double(`.concat(t.$numberDouble,`)`)},r})();Object.defineProperty(Ot$1.prototype,`_bsontype`,{value:`Double`});var It$1=(function(){function r(t){if(!(this instanceof r))return new r(t);t instanceof Number&&(t=t.valueOf()),this.value=+t|0;}return r.prototype.valueOf=function(){return this.value},r.prototype.toString=function(t){return this.value.toString(t)},r.prototype.toJSON=function(){return this.value},r.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},r.fromExtendedJSON=function(t,i){return i&&i.relaxed?parseInt(t.$numberInt,10):new r(t.$numberInt)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new Int32(`.concat(this.valueOf(),`)`)},r})();Object.defineProperty(It$1.prototype,`_bsontype`,{value:`Int32`});var Jt$1=(function(){function r(){if(!(this instanceof r))return new r}return r.prototype.toExtendedJSON=function(){return {$maxKey:1}},r.fromExtendedJSON=function(){return new r},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new MaxKey()`},r})();Object.defineProperty(Jt$1.prototype,`_bsontype`,{value:`MaxKey`});var Ht$1=(function(){function r(){if(!(this instanceof r))return new r}return r.prototype.toExtendedJSON=function(){return {$minKey:1}},r.fromExtendedJSON=function(){return new r},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new MinKey()`},r})();Object.defineProperty(Ht$1.prototype,`_bsontype`,{value:`MinKey`});var me$2=new RegExp(`^[0-9a-fA-F]{24}$`),Q$1=null,z$2=Symbol(`id`),$$2=(function(){function r(t){if(!(this instanceof r))return new r(t);var i;if(typeof t==`object`&&t&&`id`in t){if(typeof t.id!=`string`&&!ArrayBuffer.isView(t.id))throw new L$3(`Argument passed in must have an id that is of type string or Buffer`);`toHexString`in t&&typeof t.toHexString==`function`?i=A$2.from(t.toHexString(),`hex`):i=t.id;}else i=t;if(i==null||typeof i==`number`)this[z$2]=r.generate(typeof i==`number`?i:void 0);else if(ArrayBuffer.isView(i)&&i.byteLength===12)this[z$2]=i instanceof A$2?i:Et$1(i);else if(typeof i==`string`)if(i.length===12){var f=A$2.from(i);if(f.byteLength===12)this[z$2]=f;else throw new L$3(`Argument passed in must be a string of 12 bytes`)}else if(i.length===24&&me$2.test(i))this[z$2]=A$2.from(i,`hex`);else throw new L$3(`Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer`);else throw new L$3(`Argument passed in does not match the accepted types`);r.cacheHexString&&(this.__id=this.id.toString(`hex`));}return Object.defineProperty(r.prototype,`id`,{get:function(){return this[z$2]},set:function(t){this[z$2]=t,r.cacheHexString&&(this.__id=t.toString(`hex`));},enumerable:false,configurable:true}),Object.defineProperty(r.prototype,`generationTime`,{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0);},enumerable:false,configurable:true}),r.prototype.toHexString=function(){if(r.cacheHexString&&this.__id)return this.__id;var t=this.id.toString(`hex`);return r.cacheHexString&&!this.__id&&(this.__id=t),t},r.getInc=function(){return r.index=(r.index+1)%16777215},r.generate=function(t){typeof t!=`number`&&(t=Math.floor(Date.now()/1e3));var i=r.getInc(),f=A$2.alloc(12);return f.writeUInt32BE(t,0),Q$1===null&&(Q$1=yr$1(5)),f[4]=Q$1[0],f[5]=Q$1[1],f[6]=Q$1[2],f[7]=Q$1[3],f[8]=Q$1[4],f[11]=i&255,f[10]=i>>8&255,f[9]=i>>16&255,f},r.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},r.prototype.toJSON=function(){return this.toHexString()},r.prototype.equals=function(t){if(t==null)return false;if(t instanceof r)return this[z$2][11]===t[z$2][11]&&this[z$2].equals(t[z$2]);if(typeof t==`string`&&r.isValid(t)&&t.length===12&&Ct$2(this.id))return t===A$2.prototype.toString.call(this.id,`latin1`);if(typeof t==`string`&&r.isValid(t)&&t.length===24)return t.toLowerCase()===this.toHexString();if(typeof t==`string`&&r.isValid(t)&&t.length===12)return A$2.from(t).equals(this.id);if(typeof t==`object`&&`toHexString`in t&&typeof t.toHexString==`function`){var i=t.toHexString(),f=this.toHexString().toLowerCase();return typeof i==`string`&&i.toLowerCase()===f}return false},r.prototype.getTimestamp=function(){var t=new Date,i=this.id.readUInt32BE(0);return t.setTime(Math.floor(i)*1e3),t},r.createPk=function(){return new r},r.createFromTime=function(t){var i=A$2.from([0,0,0,0,0,0,0,0,0,0,0,0]);return i.writeUInt32BE(t,0),new r(i)},r.createFromHexString=function(t){if(typeof t>`u`||t!=null&&t.length!==24)throw new L$3(`Argument passed in must be a single String of 12 bytes or a string of 24 hex characters`);return new r(A$2.from(t,`hex`))},r.isValid=function(t){if(t==null)return false;try{return new r(t),!0}catch{return false}},r.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString(`hex`)}},r.fromExtendedJSON=function(t){return new r(t.$oid)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new ObjectId("`.concat(this.toHexString(),`")`)},r.index=Math.floor(Math.random()*16777215),r})();Object.defineProperty($$2.prototype,`generate`,{value:St$1(function(r){return $$2.generate(r)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty($$2.prototype,`getInc`,{value:St$1(function(){return $$2.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty($$2.prototype,`get_inc`,{value:St$1(function(){return $$2.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty($$2,`get_inc`,{value:St$1(function(){return $$2.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty($$2.prototype,`_bsontype`,{value:`ObjectID`});function _e$1(r){return r.split(``).sort().join(``)}var ct$2=(function(){function r(t,i){if(!(this instanceof r))return new r(t,i);if(this.pattern=t,this.options=_e$1(i??``),this.pattern.indexOf(`\0`)!==-1)throw new tt$1(`BSON Regex patterns cannot contain null bytes, found: `.concat(JSON.stringify(this.pattern)));if(this.options.indexOf(`\0`)!==-1)throw new tt$1(`BSON Regex options cannot contain null bytes, found: `.concat(JSON.stringify(this.options)));for(var f=0;f<this.options.length;f++)if(!(this.options[f]===`i`||this.options[f]===`m`||this.options[f]===`x`||this.options[f]===`l`||this.options[f]===`s`||this.options[f]===`u`))throw new tt$1(`The regular expression option [`.concat(this.options[f],`] is not supported`))}return r.parseOptions=function(t){return t?t.split(``).sort().join(``):``},r.prototype.toExtendedJSON=function(t){return t=t||{},t.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},r.fromExtendedJSON=function(t){if(`$regex`in t)if(typeof t.$regex!=`string`){if(t.$regex._bsontype===`BSONRegExp`)return t}else return new r(t.$regex,r.parseOptions(t.$options));if(`$regularExpression`in t)return new r(t.$regularExpression.pattern,r.parseOptions(t.$regularExpression.options));throw new L$3(`Unexpected BSONRegExp EJSON object form: `.concat(JSON.stringify(t)))},r})();Object.defineProperty(ct$2.prototype,`_bsontype`,{value:`BSONRegExp`});var Vt$1=(function(){function r(t){if(!(this instanceof r))return new r(t);this.value=t;}return r.prototype.valueOf=function(){return this.value},r.prototype.toString=function(){return this.value},r.prototype.inspect=function(){return `new BSONSymbol("`.concat(this.value,`")`)},r.prototype.toJSON=function(){return this.value},r.prototype.toExtendedJSON=function(){return {$symbol:this.value}},r.fromExtendedJSON=function(t){return new r(t.$symbol)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r})();Object.defineProperty(Vt$1.prototype,`_bsontype`,{value:`Symbol`});var Er$2=(function(r){Bt$1(t,r);function t(i,f){var c=this;return c instanceof t?(v$1.isLong(i)?c=r.call(this,i.low,i.high,true)||this:lt$2(i)&&typeof i.t<`u`&&typeof i.i<`u`?c=r.call(this,i.i,i.t,true)||this:c=r.call(this,i,f,true)||this,Object.defineProperty(c,`_bsontype`,{value:`Timestamp`,writable:false,configurable:false,enumerable:false}),c):new t(i,f)}return t.prototype.toJSON=function(){return {$timestamp:this.toString()}},t.fromInt=function(i){return new t(v$1.fromInt(i,true))},t.fromNumber=function(i){return new t(v$1.fromNumber(i,true))},t.fromBits=function(i,f){return new t(i,f)},t.fromString=function(i,f){return new t(v$1.fromString(i,true,f))},t.prototype.toExtendedJSON=function(){return {$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(i){return new t(i.$timestamp)},t.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},t.prototype.inspect=function(){return `new Timestamp({ t: `.concat(this.getHighBits(),`, i: `).concat(this.getLowBits(),` })`)},t.MAX_VALUE=v$1.MAX_UNSIGNED_VALUE,t})(v$1);function ve$3(r){return lt$2(r)&&Reflect.has(r,`_bsontype`)&&typeof r._bsontype==`string`}var vr$1=2147483647,Br$2=-2147483648,Sr$2=0x8000000000000000,Nr$2=-9223372036854776e3,Be$2={$oid:$$2,$binary:rt$1,$uuid:rt$1,$symbol:Vt$1,$numberInt:It$1,$numberDecimal:Yt$1,$numberDouble:Ot$1,$numberLong:v$1,$minKey:Ht$1,$maxKey:Jt$1,$regex:ct$2,$regularExpression:ct$2,$timestamp:Er$2};function Or$2(r,t){if(t===void 0&&(t={}),typeof r==`number`){if(t.relaxed||t.legacy)return r;if(Math.floor(r)===r){if(r>=Br$2&&r<=vr$1)return new It$1(r);if(r>=Nr$2&&r<=Sr$2)return v$1.fromNumber(r)}return new Ot$1(r)}if(r==null||typeof r!=`object`)return r;if(r.$undefined)return null;for(var i=Object.keys(r).filter(function(w){return w.startsWith(`$`)&&r[w]!=null}),f=0;f<i.length;f++){var c=Be$2[i[f]];if(c)return c.fromExtendedJSON(r,t)}if(r.$date!=null){var h=r.$date,a=new Date;return t.legacy?typeof h==`number`?a.setTime(h):typeof h==`string`&&a.setTime(Date.parse(h)):typeof h==`string`?a.setTime(Date.parse(h)):v$1.isLong(h)?a.setTime(h.toNumber()):typeof h==`number`&&t.relaxed&&a.setTime(h),a}if(r.$code!=null){var p=Object.assign({},r);return r.$scope&&(p.$scope=Or$2(r.$scope)),Nt$1.fromExtendedJSON(r)}if(ie$2(r)||r.$dbPointer){var y=r.$ref?r:r.$dbPointer;if(y instanceof ht$2)return y;var E=Object.keys(y).filter(function(w){return w.startsWith(`$`)}),m=true;if(E.forEach(function(w){[`$ref`,`$id`,`$db`].indexOf(w)===-1&&(m=false);}),m)return ht$2.fromExtendedJSON(y)}return r}function Se$3(r,t){return r.map(function(i,f){t.seenObjects.push({propertyName:`index `.concat(f),obj:null});try{return k$2(i,t)}finally{t.seenObjects.pop();}})}function ur$2(r){var t=r.toISOString();return r.getUTCMilliseconds()!==0?t:t.slice(0,-5)+`Z`}function k$2(r,t){if((typeof r==`object`||typeof r==`function`)&&r!==null){var i=t.seenObjects.findIndex(function(D){return D.obj===r});if(i!==-1){var f=t.seenObjects.map(function(D){return D.propertyName}),c=f.slice(0,i).map(function(D){return ``.concat(D,` -> `)}).join(``),h=f[i],a=` -> `+f.slice(i+1,f.length-1).map(function(D){return ``.concat(D,` -> `)}).join(``),p=f[f.length-1],y=` `.repeat(c.length+h.length/2),E=`-`.repeat(a.length+(h.length+p.length)/2-1);throw new L$3(`Converting circular structure to EJSON:
|
|
27
|
+
var Ir$3=v$3(It=>{Object.defineProperty(It,`__esModule`,{value:true});It.URLBuilder=void 0;It.URLBuilder=(function(){function r(t){try{this.base=new URL(t),this.params=new URLSearchParams(this.base.search.slice(1));}catch(i){console.error(`Un-parsable URL`,i);}}return r.prototype.appendQueryParam=function(t,i){this.params.append(t,i?i.toString():``);},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(t){this.params.delete(t);},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(t){if(!this.params)return ``;var i=this.params.get(t);return !i||i===`undefined`||i===`null`?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(t){return this.base.pathname=t,this},r.prototype.setQueryParam=function(t,i){return this.params.set(t,i?i.toString():``),this},r.prototype.setQueryString=function(t){if(t)return t[0]===`?`&&(t=t.slice(1)),this.params=new URLSearchParams(t),this},r.prototype.toString=function(){var t=this.params.toString();return t===``?this.base.search=``:this.base.search=`?`+t,this.base.toString()},r})();});var mt$2=class mt{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;treatment;constructor(t){t=t||{},this.triggerID=t.id||t.triggerID,this.nudgeID=t.nudgeID,this.shortID=t.shortID,this.contentType=t.contentType,this.engagementID=t.engagementID,this.contentID=t.contentID,this.variation=t.variation,this.props=t.props,this.objective=t.objective,this.onsiteDeliveryType=t.onsiteDeliveryType,this.holdout=t.holdout,this.treatment=t.treatment;}};function Mr$2(r,t){return t={exports:{}},r(t,t.exports),t.exports}var jr=Yr$1,$r$1=Hr$1,Pr$3=Zr$1,X$1=[],H$4=[],Cr$1=typeof Uint8Array<`u`?Uint8Array:Array,Rt$2=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`;for(K$3=0,kt$2=Rt$2.length;K$3<kt$2;++K$3)X$1[K$3]=Rt$2[K$3],H$4[Rt$2.charCodeAt(K$3)]=K$3;var K$3,kt$2;H$4[45]=62;H$4[95]=63;function pr$3(r){var t=r.length;if(t%4>0)throw new Error(`Invalid string. Length must be a multiple of 4`);var i=r.indexOf(`=`);i===-1&&(i=t);var f=i===t?0:4-i%4;return [i,f]}function Yr$1(r){var t=pr$3(r),i=t[0],f=t[1];return (i+f)*3/4-f}function Jr$1(r,t,i){return (t+i)*3/4-i}function Hr$1(r){var t,i=pr$3(r),f=i[0],c=i[1],h=new Cr$1(Jr$1(r,f,c)),a=0,p=c>0?f-4:f,y;for(y=0;y<p;y+=4)t=H$4[r.charCodeAt(y)]<<18|H$4[r.charCodeAt(y+1)]<<12|H$4[r.charCodeAt(y+2)]<<6|H$4[r.charCodeAt(y+3)],h[a++]=t>>16&255,h[a++]=t>>8&255,h[a++]=t&255;return c===2&&(t=H$4[r.charCodeAt(y)]<<2|H$4[r.charCodeAt(y+1)]>>4,h[a++]=t&255),c===1&&(t=H$4[r.charCodeAt(y)]<<10|H$4[r.charCodeAt(y+1)]<<4|H$4[r.charCodeAt(y+2)]>>2,h[a++]=t>>8&255,h[a++]=t&255),h}function Vr$2(r){return X$1[r>>18&63]+X$1[r>>12&63]+X$1[r>>6&63]+X$1[r&63]}function Wr$2(r,t,i){for(var f,c=[],h=t;h<i;h+=3)f=(r[h]<<16&16711680)+(r[h+1]<<8&65280)+(r[h+2]&255),c.push(Vr$2(f));return c.join(``)}function Zr$1(r){for(var t,i=r.length,f=i%3,c=[],h=16383,a=0,p=i-f;a<p;a+=h)c.push(Wr$2(r,a,a+h>p?p:a+h));return f===1?(t=r[i-1],c.push(X$1[t>>2]+X$1[t<<4&63]+`==`)):f===2&&(t=(r[i-2]<<8)+r[i-1],c.push(X$1[t>>10]+X$1[t>>4&63]+X$1[t<<2&63]+`=`)),c.join(``)}var Lt$1={byteLength:jr,toByteArray:$r$1,fromByteArray:Pr$3};var zr$1=function(t,i,f,c,h){var a,p,y=h*8-c-1,E=(1<<y)-1,m=E>>1,w=-7,_=f?h-1:0,O=f?-1:1,S=t[i+_];for(_+=O,a=S&(1<<-w)-1,S>>=-w,w+=y;w>0;a=a*256+t[i+_],_+=O,w-=8);for(p=a&(1<<-w)-1,a>>=-w,w+=c;w>0;p=p*256+t[i+_],_+=O,w-=8);if(a===0)a=1-m;else {if(a===E)return p?NaN:(S?-1:1)*Infinity;p=p+Math.pow(2,c),a=a-m;}return (S?-1:1)*p*Math.pow(2,a-c)},Xr$1=function(t,i,f,c,h,a){var p,y,E,m=a*8-h-1,w=(1<<m)-1,_=w>>1,O=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,S=c?0:a-1,I=c?1:-1,M=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===Infinity?(y=isNaN(i)?1:0,p=w):(p=Math.floor(Math.log(i)/Math.LN2),i*(E=Math.pow(2,-p))<1&&(p--,E*=2),p+_>=1?i+=O/E:i+=O*Math.pow(2,1-_),i*E>=2&&(p++,E/=2),p+_>=w?(y=0,p=w):p+_>=1?(y=(i*E-1)*Math.pow(2,h),p=p+_):(y=i*Math.pow(2,_-1)*Math.pow(2,h),p=0));h>=8;t[f+S]=y&255,S+=I,y/=256,h-=8);for(p=p<<h|y,m+=h;m>0;t[f+S]=p&255,S+=I,p/=256,m-=8);t[f+S-I]|=M*128;},ot$1={read:zr$1,write:Xr$1},vt$1=Mr$2(function(r,t){var i=typeof Symbol==`function`&&typeof Symbol.for==`function`?Symbol.for(`nodejs.util.inspect.custom`):null;t.Buffer=a,t.SlowBuffer=D,t.INSPECT_MAX_BYTES=50;var f=2147483647;t.kMaxLength=f,a.TYPED_ARRAY_SUPPORT=c(),!a.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 c(){try{var o=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(o,e),o.foo()===42}catch{return false}}Object.defineProperty(a.prototype,`parent`,{enumerable:true,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,`offset`,{enumerable:true,get:function(){if(a.isBuffer(this))return this.byteOffset}});function h(o){if(o>f)throw new RangeError(`The value "`+o+`" is invalid for option "size"`);var e=new Uint8Array(o);return Object.setPrototypeOf(e,a.prototype),e}function a(o,e,n){if(typeof o==`number`){if(typeof e==`string`)throw new TypeError(`The "string" argument must be of type string. Received type number`);return m(o)}return p(o,e,n)}a.poolSize=8192;function p(o,e,n){if(typeof o==`string`)return w(o,e);if(ArrayBuffer.isView(o))return O(o);if(o==null)throw new TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+babelHelpers.typeof(o));if(Z(o,ArrayBuffer)||o&&Z(o.buffer,ArrayBuffer)||typeof SharedArrayBuffer<`u`&&(Z(o,SharedArrayBuffer)||o&&Z(o.buffer,SharedArrayBuffer)))return S(o,e,n);if(typeof o==`number`)throw new TypeError(`The "value" argument must not be of type number. Received type number`);var s=o.valueOf&&o.valueOf();if(s!=null&&s!==o)return a.from(s,e,n);var u=I(o);if(u)return u;if(typeof Symbol<`u`&&Symbol.toPrimitive!=null&&typeof o[Symbol.toPrimitive]==`function`)return a.from(o[Symbol.toPrimitive](`string`),e,n);throw new TypeError(`The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type `+babelHelpers.typeof(o))}a.from=function(o,e,n){return p(o,e,n)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function y(o){if(typeof o!=`number`)throw new TypeError(`"size" argument must be of type number`);if(o<0)throw new RangeError(`The value "`+o+`" is invalid for option "size"`)}function E(o,e,n){return y(o),o<=0?h(o):e!==void 0?typeof n==`string`?h(o).fill(e,n):h(o).fill(e):h(o)}a.alloc=function(o,e,n){return E(o,e,n)};function m(o){return y(o),h(o<0?0:M(o)|0)}a.allocUnsafe=function(o){return m(o)},a.allocUnsafeSlow=function(o){return m(o)};function w(o,e){if((typeof e!=`string`||e===``)&&(e=`utf8`),!a.isEncoding(e))throw new TypeError(`Unknown encoding: `+e);var n=F(o,e)|0,s=h(n),u=s.write(o,e);return u!==n&&(s=s.slice(0,u)),s}function _(o){for(var e=o.length<0?0:M(o.length)|0,n=h(e),s=0;s<e;s+=1)n[s]=o[s]&255;return n}function O(o){if(Z(o,Uint8Array)){var e=new Uint8Array(o);return S(e.buffer,e.byteOffset,e.byteLength)}return _(o)}function S(o,e,n){if(e<0||o.byteLength<e)throw new RangeError(`"offset" is outside of buffer bounds`);if(o.byteLength<e+(n||0))throw new RangeError(`"length" is outside of buffer bounds`);var s;return e===void 0&&n===void 0?s=new Uint8Array(o):n===void 0?s=new Uint8Array(o,e):s=new Uint8Array(o,e,n),Object.setPrototypeOf(s,a.prototype),s}function I(o){if(a.isBuffer(o)){var e=M(o.length)|0,n=h(e);return n.length===0||o.copy(n,0,0,e),n}if(o.length!==void 0)return typeof o.length!=`number`||Ut(o.length)?h(0):_(o);if(o.type===`Buffer`&&Array.isArray(o.data))return _(o.data)}function M(o){if(o>=f)throw new RangeError(`Attempt to allocate Buffer larger than maximum size: 0x`+f.toString(16)+` bytes`);return o|0}function D(o){return +o!=o&&(o=0),a.alloc(+o)}a.isBuffer=function(e){return e!=null&&e._isBuffer===true&&e!==a.prototype},a.compare=function(e,n){if(Z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),Z(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(e)||!a.isBuffer(n))throw new TypeError(`The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array`);if(e===n)return 0;for(var s=e.length,u=n.length,l=0,g=Math.min(s,u);l<g;++l)if(e[l]!==n[l]){s=e[l],u=n[l];break}return s<u?-1:u<s?1:0},a.isEncoding=function(e){switch(String(e).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 true;default:return false}},a.concat=function(e,n){if(!Array.isArray(e))throw new TypeError(`"list" argument must be an Array of Buffers`);if(e.length===0)return a.alloc(0);var s;if(n===void 0)for(n=0,s=0;s<e.length;++s)n+=e[s].length;var u=a.allocUnsafe(n),l=0;for(s=0;s<e.length;++s){var g=e[s];if(Z(g,Uint8Array))l+g.length>u.length?a.from(g).copy(u,l):Uint8Array.prototype.set.call(u,g,l);else if(a.isBuffer(g))g.copy(u,l);else throw new TypeError(`"list" argument must be an Array of Buffers`);l+=g.length;}return u};function F(o,e){if(a.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||Z(o,ArrayBuffer))return o.byteLength;if(typeof o!=`string`)throw new TypeError(`The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type `+babelHelpers.typeof(o));var n=o.length,s=arguments.length>2&&arguments[2]===true;if(!s&&n===0)return 0;for(var u=false;;)switch(e){case `ascii`:case `latin1`:case `binary`:return n;case `utf8`:case `utf-8`:return xt(o).length;case `ucs2`:case `ucs-2`:case `utf16le`:case `utf-16le`:return n*2;case `hex`:return n>>>1;case `base64`:return Xt(o).length;default:if(u)return s?-1:xt(o).length;e=(``+e).toLowerCase(),u=true;}}a.byteLength=F;function P(o,e,n){var s=false;if((e===void 0||e<0)&&(e=0),e>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0,e>>>=0,n<=e))return ``;for(o||(o=`utf8`);;)switch(o){case `hex`:return V(this,e,n);case `utf8`:case `utf-8`:return nt(this,e,n);case `ascii`:return it(this,e,n);case `latin1`:case `binary`:return T(this,e,n);case `base64`:return et(this,e,n);case `ucs2`:case `ucs-2`:case `utf16le`:case `utf-16le`:return b(this,e,n);default:if(s)throw new TypeError(`Unknown encoding: `+o);o=(o+``).toLowerCase(),s=true;}}a.prototype._isBuffer=true;function B(o,e,n){var s=o[e];o[e]=o[n],o[n]=s;}a.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError(`Buffer size must be a multiple of 16-bits`);for(var n=0;n<e;n+=2)B(this,n,n+1);return this},a.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError(`Buffer size must be a multiple of 32-bits`);for(var n=0;n<e;n+=4)B(this,n,n+3),B(this,n+1,n+2);return this},a.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError(`Buffer size must be a multiple of 64-bits`);for(var n=0;n<e;n+=8)B(this,n,n+7),B(this,n+1,n+6),B(this,n+2,n+5),B(this,n+3,n+4);return this},a.prototype.toString=function(){var e=this.length;return e===0?``:arguments.length===0?nt(this,0,e):P.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError(`Argument must be a Buffer`);return this===e?true:a.compare(this,e)===0},a.prototype.inspect=function(){var e=``,n=t.INSPECT_MAX_BYTES;return e=this.toString(`hex`,0,n).replace(/(.{2})/g,`$1 `).trim(),this.length>n&&(e+=` ... `),`<Buffer `+e+`>`},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(e,n,s,u,l){if(Z(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError(`The "target" argument must be one of type Buffer or Uint8Array. Received type `+babelHelpers.typeof(e));if(n===void 0&&(n=0),s===void 0&&(s=e?e.length:0),u===void 0&&(u=0),l===void 0&&(l=this.length),n<0||s>e.length||u<0||l>this.length)throw new RangeError(`out of range index`);if(u>=l&&n>=s)return 0;if(u>=l)return -1;if(n>=s)return 1;if(n>>>=0,s>>>=0,u>>>=0,l>>>=0,this===e)return 0;for(var g=l-u,d=s-n,x=Math.min(g,d),U=this.slice(u,l),j=e.slice(n,s),R=0;R<x;++R)if(U[R]!==j[R]){g=U[R],d=j[R];break}return g<d?-1:d<g?1:0};function Y(o,e,n,s,u){if(o.length===0)return -1;if(typeof n==`string`?(s=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,Ut(n)&&(n=u?0:o.length-1),n<0&&(n=o.length+n),n>=o.length){if(u)return -1;n=o.length-1;}else if(n<0)if(u)n=0;else return -1;if(typeof e==`string`&&(e=a.from(e,s)),a.isBuffer(e))return e.length===0?-1:W(o,e,n,s,u);if(typeof e==`number`)return e=e&255,typeof Uint8Array.prototype.indexOf==`function`?u?Uint8Array.prototype.indexOf.call(o,e,n):Uint8Array.prototype.lastIndexOf.call(o,e,n):W(o,[e],n,s,u);throw new TypeError(`val must be string, number or Buffer`)}function W(o,e,n,s,u){var l=1,g=o.length,d=e.length;if(s!==void 0&&(s=String(s).toLowerCase(),s===`ucs2`||s===`ucs-2`||s===`utf16le`||s===`utf-16le`)){if(o.length<2||e.length<2)return -1;l=2,g/=2,d/=2,n/=2;}function x(qt,Gt){return l===1?qt[Gt]:qt.readUInt16BE(Gt*l)}var U;if(u){var j=-1;for(U=n;U<g;U++)if(x(o,U)===x(e,j===-1?0:U-j)){if(j===-1&&(j=U),U-j+1===d)return j*l}else j!==-1&&(U-=U-j),j=-1;}else for(n+d>g&&(n=g-d),U=n;U>=0;U--){for(var R=true,wt=0;wt<d;wt++)if(x(o,U+wt)!==x(e,wt)){R=false;break}if(R)return U}return -1}a.prototype.includes=function(e,n,s){return this.indexOf(e,n,s)!==-1},a.prototype.indexOf=function(e,n,s){return Y(this,e,n,s,true)},a.prototype.lastIndexOf=function(e,n,s){return Y(this,e,n,s,false)};function q(o,e,n,s){n=Number(n)||0;var u=o.length-n;s?(s=Number(s),s>u&&(s=u)):s=u;var l=e.length;s>l/2&&(s=l/2);for(var g=0;g<s;++g){var d=parseInt(e.substr(g*2,2),16);if(Ut(d))return g;o[n+g]=d;}return g}function bt(o,e,n,s){return yt(xt(e,o.length-n),o,n,s)}function at(o,e,n,s){return yt(Tr(e),o,n,s)}function At(o,e,n,s){return yt(Xt(e),o,n,s)}function pt(o,e,n,s){return yt(Rr(e,o.length-n),o,n,s)}a.prototype.write=function(e,n,s,u){if(n===void 0)u=`utf8`,s=this.length,n=0;else if(s===void 0&&typeof n==`string`)u=n,s=this.length,n=0;else if(isFinite(n))n=n>>>0,isFinite(s)?(s=s>>>0,u===void 0&&(u=`utf8`)):(u=s,s=void 0);else throw new Error(`Buffer.write(string, encoding, offset[, length]) is no longer supported`);var l=this.length-n;if((s===void 0||s>l)&&(s=l),e.length>0&&(s<0||n<0)||n>this.length)throw new RangeError(`Attempt to write outside buffer bounds`);u||(u=`utf8`);for(var g=false;;)switch(u){case `hex`:return q(this,e,n,s);case `utf8`:case `utf-8`:return bt(this,e,n,s);case `ascii`:case `latin1`:case `binary`:return at(this,e,n,s);case `base64`:return At(this,e,n,s);case `ucs2`:case `ucs-2`:case `utf16le`:case `utf-16le`:return pt(this,e,n,s);default:if(g)throw new TypeError(`Unknown encoding: `+u);u=(``+u).toLowerCase(),g=true;}},a.prototype.toJSON=function(){return {type:`Buffer`,data:Array.prototype.slice.call(this._arr||this,0)}};function et(o,e,n){return e===0&&n===o.length?Lt$1.fromByteArray(o):Lt$1.fromByteArray(o.slice(e,n))}function nt(o,e,n){n=Math.min(o.length,n);for(var s=[],u=e;u<n;){var l=o[u],g=null,d=l>239?4:l>223?3:l>191?2:1;if(u+d<=n){var x,U,j,R;switch(d){case 1:l<128&&(g=l);break;case 2:x=o[u+1],(x&192)===128&&(R=(l&31)<<6|x&63,R>127&&(g=R));break;case 3:x=o[u+1],U=o[u+2],(x&192)===128&&(U&192)===128&&(R=(l&15)<<12|(x&63)<<6|U&63,R>2047&&(R<55296||R>57343)&&(g=R));break;case 4:x=o[u+1],U=o[u+2],j=o[u+3],(x&192)===128&&(U&192)===128&&(j&192)===128&&(R=(l&15)<<18|(x&63)<<12|(U&63)<<6|j&63,R>65535&&R<1114112&&(g=R));}}g===null?(g=65533,d=1):g>65535&&(g-=65536,s.push(g>>>10&1023|55296),g=56320|g&1023),s.push(g),u+=d;}return gt(s)}var G=4096;function gt(o){var e=o.length;if(e<=G)return String.fromCharCode.apply(String,o);for(var n=``,s=0;s<e;)n+=String.fromCharCode.apply(String,o.slice(s,s+=G));return n}function it(o,e,n){var s=``;n=Math.min(o.length,n);for(var u=e;u<n;++u)s+=String.fromCharCode(o[u]&127);return s}function T(o,e,n){var s=``;n=Math.min(o.length,n);for(var u=e;u<n;++u)s+=String.fromCharCode(o[u]);return s}function V(o,e,n){var s=o.length;(!e||e<0)&&(e=0),(!n||n<0||n>s)&&(n=s);for(var u=``,l=e;l<n;++l)u+=Lr[o[l]];return u}function b(o,e,n){for(var s=o.slice(e,n),u=``,l=0;l<s.length-1;l+=2)u+=String.fromCharCode(s[l]+s[l+1]*256);return u}a.prototype.slice=function(e,n){var s=this.length;e=~~e,n=n===void 0?s:~~n,e<0?(e+=s,e<0&&(e=0)):e>s&&(e=s),n<0?(n+=s,n<0&&(n=0)):n>s&&(n=s),n<e&&(n=e);var u=this.subarray(e,n);return Object.setPrototypeOf(u,a.prototype),u};function N(o,e,n){if(o%1!==0||o<0)throw new RangeError(`offset is not uint`);if(o+e>n)throw new RangeError(`Trying to access beyond buffer length`)}a.prototype.readUintLE=a.prototype.readUIntLE=function(e,n,s){e=e>>>0,n=n>>>0,s||N(e,n,this.length);for(var u=this[e],l=1,g=0;++g<n&&(l*=256);)u+=this[e+g]*l;return u},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,n,s){e=e>>>0,n=n>>>0,s||N(e,n,this.length);for(var u=this[e+--n],l=1;n>0&&(l*=256);)u+=this[e+--n]*l;return u},a.prototype.readUint8=a.prototype.readUInt8=function(e,n){return e=e>>>0,n||N(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,n){return e=e>>>0,n||N(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,n){return e=e>>>0,n||N(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,n){return e=e>>>0,n||N(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,n){return e=e>>>0,n||N(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readIntLE=function(e,n,s){e=e>>>0,n=n>>>0,s||N(e,n,this.length);for(var u=this[e],l=1,g=0;++g<n&&(l*=256);)u+=this[e+g]*l;return l*=128,u>=l&&(u-=Math.pow(2,8*n)),u},a.prototype.readIntBE=function(e,n,s){e=e>>>0,n=n>>>0,s||N(e,n,this.length);for(var u=n,l=1,g=this[e+--u];u>0&&(l*=256);)g+=this[e+--u]*l;return l*=128,g>=l&&(g-=Math.pow(2,8*n)),g},a.prototype.readInt8=function(e,n){return e=e>>>0,n||N(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,n){e=e>>>0,n||N(e,2,this.length);var s=this[e]|this[e+1]<<8;return s&32768?s|4294901760:s},a.prototype.readInt16BE=function(e,n){e=e>>>0,n||N(e,2,this.length);var s=this[e+1]|this[e]<<8;return s&32768?s|4294901760:s},a.prototype.readInt32LE=function(e,n){return e=e>>>0,n||N(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,n){return e=e>>>0,n||N(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readFloatLE=function(e,n){return e=e>>>0,n||N(e,4,this.length),ot$1.read(this,e,true,23,4)},a.prototype.readFloatBE=function(e,n){return e=e>>>0,n||N(e,4,this.length),ot$1.read(this,e,false,23,4)},a.prototype.readDoubleLE=function(e,n){return e=e>>>0,n||N(e,8,this.length),ot$1.read(this,e,true,52,8)},a.prototype.readDoubleBE=function(e,n){return e=e>>>0,n||N(e,8,this.length),ot$1.read(this,e,false,52,8)};function C(o,e,n,s,u,l){if(!a.isBuffer(o))throw new TypeError(`"buffer" argument must be a Buffer instance`);if(e>u||e<l)throw new RangeError(`"value" argument is out of bounds`);if(n+s>o.length)throw new RangeError(`Index out of range`)}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,n,s,u){if(e=+e,n=n>>>0,s=s>>>0,!u){var l=Math.pow(2,8*s)-1;C(this,e,n,s,l,0);}var g=1,d=0;for(this[n]=e&255;++d<s&&(g*=256);)this[n+d]=e/g&255;return n+s},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,n,s,u){if(e=+e,n=n>>>0,s=s>>>0,!u){var l=Math.pow(2,8*s)-1;C(this,e,n,s,l,0);}var g=s-1,d=1;for(this[n+g]=e&255;--g>=0&&(d*=256);)this[n+g]=e/d&255;return n+s},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,1,255,0),this[n]=e&255,n+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,2,65535,0),this[n]=e&255,this[n+1]=e>>>8,n+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,2,65535,0),this[n]=e>>>8,this[n+1]=e&255,n+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,4,4294967295,0),this[n+3]=e>>>24,this[n+2]=e>>>16,this[n+1]=e>>>8,this[n]=e&255,n+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,4,4294967295,0),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4},a.prototype.writeIntLE=function(e,n,s,u){if(e=+e,n=n>>>0,!u){var l=Math.pow(2,8*s-1);C(this,e,n,s,l-1,-l);}var g=0,d=1,x=0;for(this[n]=e&255;++g<s&&(d*=256);)e<0&&x===0&&this[n+g-1]!==0&&(x=1),this[n+g]=(e/d>>0)-x&255;return n+s},a.prototype.writeIntBE=function(e,n,s,u){if(e=+e,n=n>>>0,!u){var l=Math.pow(2,8*s-1);C(this,e,n,s,l-1,-l);}var g=s-1,d=1,x=0;for(this[n+g]=e&255;--g>=0&&(d*=256);)e<0&&x===0&&this[n+g+1]!==0&&(x=1),this[n+g]=(e/d>>0)-x&255;return n+s},a.prototype.writeInt8=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,1,127,-128),e<0&&(e=255+e+1),this[n]=e&255,n+1},a.prototype.writeInt16LE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,2,32767,-32768),this[n]=e&255,this[n+1]=e>>>8,n+2},a.prototype.writeInt16BE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,2,32767,-32768),this[n]=e>>>8,this[n+1]=e&255,n+2},a.prototype.writeInt32LE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,4,2147483647,-2147483648),this[n]=e&255,this[n+1]=e>>>8,this[n+2]=e>>>16,this[n+3]=e>>>24,n+4},a.prototype.writeInt32BE=function(e,n,s){return e=+e,n=n>>>0,s||C(this,e,n,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[n]=e>>>24,this[n+1]=e>>>16,this[n+2]=e>>>8,this[n+3]=e&255,n+4};function Wt(o,e,n,s,u,l){if(n+s>o.length)throw new RangeError(`Index out of range`);if(n<0)throw new RangeError(`Index out of range`)}function Zt(o,e,n,s,u){return e=+e,n=n>>>0,u||Wt(o,e,n,4),ot$1.write(o,e,n,s,23,4),n+4}a.prototype.writeFloatLE=function(e,n,s){return Zt(this,e,n,true,s)},a.prototype.writeFloatBE=function(e,n,s){return Zt(this,e,n,false,s)};function zt(o,e,n,s,u){return e=+e,n=n>>>0,u||Wt(o,e,n,8),ot$1.write(o,e,n,s,52,8),n+8}a.prototype.writeDoubleLE=function(e,n,s){return zt(this,e,n,true,s)},a.prototype.writeDoubleBE=function(e,n,s){return zt(this,e,n,false,s)},a.prototype.copy=function(e,n,s,u){if(!a.isBuffer(e))throw new TypeError(`argument should be a Buffer`);if(s||(s=0),!u&&u!==0&&(u=this.length),n>=e.length&&(n=e.length),n||(n=0),u>0&&u<s&&(u=s),u===s||e.length===0||this.length===0)return 0;if(n<0)throw new RangeError(`targetStart out of bounds`);if(s<0||s>=this.length)throw new RangeError(`Index out of range`);if(u<0)throw new RangeError(`sourceEnd out of bounds`);u>this.length&&(u=this.length),e.length-n<u-s&&(u=e.length-n+s);var l=u-s;return this===e&&typeof Uint8Array.prototype.copyWithin==`function`?this.copyWithin(n,s,u):Uint8Array.prototype.set.call(e,this.subarray(s,u),n),l},a.prototype.fill=function(e,n,s,u){if(typeof e==`string`){if(typeof n==`string`?(u=n,n=0,s=this.length):typeof s==`string`&&(u=s,s=this.length),u!==void 0&&typeof u!=`string`)throw new TypeError(`encoding must be a string`);if(typeof u==`string`&&!a.isEncoding(u))throw new TypeError(`Unknown encoding: `+u);if(e.length===1){var l=e.charCodeAt(0);(u===`utf8`&&l<128||u===`latin1`)&&(e=l);}}else typeof e==`number`?e=e&255:typeof e==`boolean`&&(e=Number(e));if(n<0||this.length<n||this.length<s)throw new RangeError(`Out of range index`);if(s<=n)return this;n=n>>>0,s=s===void 0?this.length:s>>>0,e||(e=0);var g;if(typeof e==`number`)for(g=n;g<s;++g)this[g]=e;else {var d=a.isBuffer(e)?e:a.from(e,u),x=d.length;if(x===0)throw new TypeError(`The value "`+e+`" is invalid for argument "value"`);for(g=0;g<s-n;++g)this[g+n]=d[g%x];}return this};var xr=/[^+/0-9A-Za-z-_]/g;function Ur(o){if(o=o.split(`=`)[0],o=o.trim().replace(xr,``),o.length<2)return ``;for(;o.length%4!==0;)o=o+`=`;return o}function xt(o,e){e=e||Infinity;for(var n,s=o.length,u=null,l=[],g=0;g<s;++g){if(n=o.charCodeAt(g),n>55295&&n<57344){if(!u){if(n>56319){(e-=3)>-1&&l.push(239,191,189);continue}else if(g+1===s){(e-=3)>-1&&l.push(239,191,189);continue}u=n;continue}if(n<56320){(e-=3)>-1&&l.push(239,191,189),u=n;continue}n=(u-55296<<10|n-56320)+65536;}else u&&(e-=3)>-1&&l.push(239,191,189);if(u=null,n<128){if((e-=1)<0)break;l.push(n);}else if(n<2048){if((e-=2)<0)break;l.push(n>>6|192,n&63|128);}else if(n<65536){if((e-=3)<0)break;l.push(n>>12|224,n>>6&63|128,n&63|128);}else if(n<1114112){if((e-=4)<0)break;l.push(n>>18|240,n>>12&63|128,n>>6&63|128,n&63|128);}else throw new Error(`Invalid code point`)}return l}function Tr(o){for(var e=[],n=0;n<o.length;++n)e.push(o.charCodeAt(n)&255);return e}function Rr(o,e){for(var n,s,u,l=[],g=0;g<o.length&&!((e-=2)<0);++g)n=o.charCodeAt(g),s=n>>8,u=n%256,l.push(u),l.push(s);return l}function Xt(o){return Lt$1.toByteArray(Ur(o))}function yt(o,e,n,s){for(var u=0;u<s&&!(u+n>=e.length||u>=o.length);++u)e[u+n]=o[u];return u}function Z(o,e){return o instanceof e||o!=null&&o.constructor!=null&&o.constructor.name!=null&&o.constructor.name===e.name}function Ut(o){return o!==o}var Lr=(function(){for(var o=`0123456789abcdef`,e=new Array(256),n=0;n<16;++n)for(var s=n*16,u=0;u<16;++u)e[s+u]=o[n]+o[u];return e})();}),A$2=vt$1.Buffer;vt$1.SlowBuffer;vt$1.INSPECT_MAX_BYTES;vt$1.kMaxLength;var $t$1=function(t,i){return $t$1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(f,c){f.__proto__=c;}||function(f,c){for(var h in c)c.hasOwnProperty(h)&&(f[h]=c[h]);},$t$1(t,i)};function Bt$1(r,t){$t$1(r,t);function i(){this.constructor=r;}r.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i);}var tt$1=(function(r){Bt$1(t,r);function t(i){var f=r.call(this,i)||this;return Object.setPrototypeOf(f,t.prototype),f}return Object.defineProperty(t.prototype,`name`,{get:function(){return `BSONError`},enumerable:false,configurable:true}),t})(Error),L$3=(function(r){Bt$1(t,r);function t(i){var f=r.call(this,i)||this;return Object.setPrototypeOf(f,t.prototype),f}return Object.defineProperty(t.prototype,`name`,{get:function(){return `BSONTypeError`},enumerable:false,configurable:true}),t})(TypeError);function _t$1(r){return r&&r.Math==Math&&r}function gr$3(){return _t$1(typeof globalThis==`object`&&globalThis)||_t$1(typeof window==`object`&&window)||_t$1(typeof self==`object`&&self)||_t$1(typeof global==`object`&&global)||Function(`return this`)()}function qr$1(){var r=gr$3();return typeof r.navigator==`object`&&r.navigator.product===`ReactNative`}var Gr$1=function(t){var i=qr$1()?`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(i);for(var f=A$2.alloc(t),c=0;c<t;++c)f[c]=Math.floor(Math.random()*256);return f},kr$3=function(){if(typeof window<`u`){var r=window.crypto||window.msCrypto;if(r&&r.getRandomValues)return function(t){return r.getRandomValues(A$2.alloc(t))}}return typeof global<`u`&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(A$2.alloc(t))}:Gr$1},yr$1=kr$3();function Kr$1(r){return [`[object ArrayBuffer]`,`[object SharedArrayBuffer]`].includes(Object.prototype.toString.call(r))}function Ct$2(r){return Object.prototype.toString.call(r)===`[object Uint8Array]`}function Qr$1(r){return Object.prototype.toString.call(r)===`[object RegExp]`}function te$3(r){return lt$2(r)&&Object.prototype.toString.call(r)===`[object Date]`}function lt$2(r){return typeof r==`object`&&r!==null}function St$1(r,t){var i=false;function f(){for(var c=[],h=0;h<arguments.length;h++)c[h]=arguments[h];return i||(console.warn(t),i=true),r.apply(this,c)}return f}function Et$1(r){if(ArrayBuffer.isView(r))return A$2.from(r.buffer,r.byteOffset,r.byteLength);if(Kr$1(r))return A$2.from(r);throw new L$3(`Must use either Buffer or TypedArray`)}var re$3=/^(?:[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,wr$2=function(r){return typeof r==`string`&&re$3.test(r)},Pt=function(r){if(!wr$2(r))throw new L$3(`UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".`);var t=r.replace(/-/g,``);return A$2.from(t,`hex`)},Kt$1=function(r,t){return t===void 0&&(t=true),t?r.toString(`hex`,0,4)+`-`+r.toString(`hex`,4,6)+`-`+r.toString(`hex`,6,8)+`-`+r.toString(`hex`,8,10)+`-`+r.toString(`hex`,10,16):r.toString(`hex`)};var ee$1=Math.pow(2,53),ne$2=-Math.pow(2,53);var mr$2=4;var rt$1=(function(){function r(t,i){if(!(this instanceof r))return new r(t,i);if(t!=null&&typeof t!=`string`&&!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer)&&!Array.isArray(t))throw new L$3(`Binary can only be constructed from string, Buffer, TypedArray, or Array<number>`);this.sub_type=i??r.BSON_BINARY_SUBTYPE_DEFAULT,t==null?(this.buffer=A$2.alloc(r.BUFFER_SIZE),this.position=0):(typeof t==`string`?this.buffer=A$2.from(t,`binary`):Array.isArray(t)?this.buffer=A$2.from(t):this.buffer=Et$1(t),this.position=this.buffer.byteLength);}return r.prototype.put=function(t){if(typeof t==`string`&&t.length!==1)throw new L$3(`only accepts single character String`);if(typeof t!=`number`&&t.length!==1)throw new L$3(`only accepts single character Uint8Array or Array`);var i;if(typeof t==`string`?i=t.charCodeAt(0):typeof t==`number`?i=t:i=t[0],i<0||i>255)throw new L$3(`only accepts number in a valid unsigned byte range 0-255`);if(this.buffer.length>this.position)this.buffer[this.position++]=i;else {var f=A$2.alloc(r.BUFFER_SIZE+this.buffer.length);this.buffer.copy(f,0,0,this.buffer.length),this.buffer=f,this.buffer[this.position++]=i;}},r.prototype.write=function(t,i){if(i=typeof i==`number`?i:this.position,this.buffer.length<i+t.length){var f=A$2.alloc(this.buffer.length+t.length);this.buffer.copy(f,0,0,this.buffer.length),this.buffer=f;}ArrayBuffer.isView(t)?(this.buffer.set(Et$1(t),i),this.position=i+t.byteLength>this.position?i+t.length:this.position):typeof t==`string`&&(this.buffer.write(t,i,t.length,`binary`),this.position=i+t.length>this.position?i+t.length:this.position);},r.prototype.read=function(t,i){return i=i&&i>0?i:this.position,this.buffer.slice(t,t+i)},r.prototype.value=function(t){return t=!!t,t&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString(`binary`,0,this.position)},r.prototype.length=function(){return this.position},r.prototype.toJSON=function(){return this.buffer.toString(`base64`)},r.prototype.toString=function(t){return this.buffer.toString(t)},r.prototype.toExtendedJSON=function(t){t=t||{};var i=this.buffer.toString(`base64`),f=Number(this.sub_type).toString(16);return t.legacy?{$binary:i,$type:f.length===1?`0`+f:f}:{$binary:{base64:i,subType:f.length===1?`0`+f:f}}},r.prototype.toUUID=function(){if(this.sub_type===r.SUBTYPE_UUID)return new Qt$1(this.buffer.slice(0,this.position));throw new tt$1(`Binary sub_type "`.concat(this.sub_type,`" is not supported for converting to UUID. Only "`).concat(r.SUBTYPE_UUID,`" is currently supported.`))},r.fromExtendedJSON=function(t,i){i=i||{};var f,c;if(`$binary`in t?i.legacy&&typeof t.$binary==`string`&&`$type`in t?(c=t.$type?parseInt(t.$type,16):0,f=A$2.from(t.$binary,`base64`)):typeof t.$binary!=`string`&&(c=t.$binary.subType?parseInt(t.$binary.subType,16):0,f=A$2.from(t.$binary.base64,`base64`)):`$uuid`in t&&(c=4,f=Pt(t.$uuid)),!f)throw new L$3(`Unexpected Binary Extended JSON format `.concat(JSON.stringify(t)));return c===mr$2?new Qt$1(f):new r(f,c)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){var t=this.value(true);return `new Binary(Buffer.from("`.concat(t.toString(`hex`),`", "hex"), `).concat(this.sub_type,`)`)},r.BSON_BINARY_SUBTYPE_DEFAULT=0,r.BUFFER_SIZE=256,r.SUBTYPE_DEFAULT=0,r.SUBTYPE_FUNCTION=1,r.SUBTYPE_BYTE_ARRAY=2,r.SUBTYPE_UUID_OLD=3,r.SUBTYPE_UUID=4,r.SUBTYPE_MD5=5,r.SUBTYPE_ENCRYPTED=6,r.SUBTYPE_COLUMN=7,r.SUBTYPE_USER_DEFINED=128,r})();Object.defineProperty(rt$1.prototype,`_bsontype`,{value:`Binary`});var Dt=16,Qt$1=(function(r){Bt$1(t,r);function t(i){var f=this,c,h;if(i==null)c=t.generate();else if(i instanceof t)c=A$2.from(i.buffer),h=i.__id;else if(ArrayBuffer.isView(i)&&i.byteLength===Dt)c=Et$1(i);else if(typeof i==`string`)c=Pt(i);else throw new L$3(`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 f=r.call(this,c,mr$2)||this,f.__id=h,f}return Object.defineProperty(t.prototype,`id`,{get:function(){return this.buffer},set:function(i){this.buffer=i,t.cacheHexString&&(this.__id=Kt$1(i));},enumerable:false,configurable:true}),t.prototype.toHexString=function(i){if(i===void 0&&(i=true),t.cacheHexString&&this.__id)return this.__id;var f=Kt$1(this.id,i);return t.cacheHexString&&(this.__id=f),f},t.prototype.toString=function(i){return i?this.id.toString(i):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(i){if(!i)return false;if(i instanceof t)return i.id.equals(this.id);try{return new t(i).id.equals(this.id)}catch{return false}},t.prototype.toBinary=function(){return new rt$1(this.id,rt$1.SUBTYPE_UUID)},t.generate=function(){var i=yr$1(Dt);return i[6]=i[6]&15|64,i[8]=i[8]&63|128,A$2.from(i)},t.isValid=function(i){return i?i instanceof t?true:typeof i==`string`?wr$2(i):Ct$2(i)?i.length!==Dt?false:(i[6]&240)===64&&(i[8]&128)===128:false:false},t.createFromHexString=function(i){return new t(Pt(i))},t.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},t.prototype.inspect=function(){return `new UUID("`.concat(this.toHexString(),`")`)},t})(rt$1),Nt$1=(function(){function r(t,i){if(!(this instanceof r))return new r(t,i);this.code=t,this.scope=i;}return r.prototype.toJSON=function(){return {code:this.code,scope:this.scope}},r.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},r.fromExtendedJSON=function(t){return new r(t.$code,t.$scope)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){var t=this.toJSON();return `new Code("`.concat(String(t.code),`"`).concat(t.scope?`, `.concat(JSON.stringify(t.scope)):``,`)`)},r})();Object.defineProperty(Nt$1.prototype,`_bsontype`,{value:`Code`});function ie$2(r){return lt$2(r)&&r.$id!=null&&typeof r.$ref==`string`&&(r.$db==null||typeof r.$db==`string`)}var ht$2=(function(){function r(t,i,f,c){if(!(this instanceof r))return new r(t,i,f,c);var h=t.split(`.`);h.length===2&&(f=h.shift(),t=h.shift()),this.collection=t,this.oid=i,this.db=f,this.fields=c||{};}return Object.defineProperty(r.prototype,`namespace`,{get:function(){return this.collection},set:function(t){this.collection=t;},enumerable:false,configurable:true}),r.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(t.$db=this.db),t},r.prototype.toExtendedJSON=function(t){t=t||{};var i={$ref:this.collection,$id:this.oid};return t.legacy||(this.db&&(i.$db=this.db),i=Object.assign(i,this.fields)),i},r.fromExtendedJSON=function(t){var i=Object.assign({},t);return delete i.$ref,delete i.$id,delete i.$db,new r(t.$ref,t.$id,t.$db,i)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){var t=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return `new DBRef("`.concat(this.namespace,`", new ObjectId("`).concat(String(t),`")`).concat(this.db?`, "`.concat(this.db,`"`):``,`)`)},r})();Object.defineProperty(ht$2.prototype,`_bsontype`,{value:`DBRef`});var J$1=void 0;try{J$1=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 tr$3=65536,oe$3=1<<24,ft$2=tr$3*tr$3,_r$3=ft$2*ft$2,rr$3=_r$3/2,er$3={},nr$2={},v$1=(function(){function r(t,i,f){if(t===void 0&&(t=0),!(this instanceof r))return new r(t,i,f);typeof t==`bigint`?Object.assign(this,r.fromBigInt(t,!!i)):typeof t==`string`?Object.assign(this,r.fromString(t,!!i)):(this.low=t|0,this.high=i|0,this.unsigned=!!f),Object.defineProperty(this,`__isLong__`,{value:true,configurable:false,writable:false,enumerable:false});}return r.fromBits=function(t,i,f){return new r(t,i,f)},r.fromInt=function(t,i){var f,c,h;return i?(t>>>=0,(h=0<=t&&t<256)&&(c=nr$2[t],c)?c:(f=r.fromBits(t,(t|0)<0?-1:0,true),h&&(nr$2[t]=f),f)):(t|=0,(h=-128<=t&&t<128)&&(c=er$3[t],c)?c:(f=r.fromBits(t,t<0?-1:0,false),h&&(er$3[t]=f),f))},r.fromNumber=function(t,i){if(isNaN(t))return i?r.UZERO:r.ZERO;if(i){if(t<0)return r.UZERO;if(t>=_r$3)return r.MAX_UNSIGNED_VALUE}else {if(t<=-9223372036854776e3)return r.MIN_VALUE;if(t+1>=rr$3)return r.MAX_VALUE}return t<0?r.fromNumber(-t,i).neg():r.fromBits(t%ft$2|0,t/ft$2|0,i)},r.fromBigInt=function(t,i){return r.fromString(t.toString(),i)},r.fromString=function(t,i,f){if(t.length===0)throw Error(`empty string`);if(t===`NaN`||t===`Infinity`||t===`+Infinity`||t===`-Infinity`)return r.ZERO;if(typeof i==`number`?(f=i,i=false):i=!!i,f=f||10,f<2||36<f)throw RangeError(`radix`);var c;if((c=t.indexOf(`-`))>0)throw Error(`interior hyphen`);if(c===0)return r.fromString(t.substring(1),i,f).neg();for(var h=r.fromNumber(Math.pow(f,8)),a=r.ZERO,p=0;p<t.length;p+=8){var y=Math.min(8,t.length-p),E=parseInt(t.substring(p,p+y),f);if(y<8){var m=r.fromNumber(Math.pow(f,y));a=a.mul(m).add(r.fromNumber(E));}else a=a.mul(h),a=a.add(r.fromNumber(E));}return a.unsigned=i,a},r.fromBytes=function(t,i,f){return f?r.fromBytesLE(t,i):r.fromBytesBE(t,i)},r.fromBytesLE=function(t,i){return new r(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,i)},r.fromBytesBE=function(t,i){return new r(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],i)},r.isLong=function(t){return lt$2(t)&&t.__isLong__===true},r.fromValue=function(t,i){return typeof t==`number`?r.fromNumber(t,i):typeof t==`string`?r.fromString(t,i):r.fromBits(t.low,t.high,typeof i==`boolean`?i:t.unsigned)},r.prototype.add=function(t){r.isLong(t)||(t=r.fromValue(t));var i=this.high>>>16,f=this.high&65535,c=this.low>>>16,h=this.low&65535,a=t.high>>>16,p=t.high&65535,y=t.low>>>16,E=t.low&65535,m=0,w=0,_=0,O=0;return O+=h+E,_+=O>>>16,O&=65535,_+=c+y,w+=_>>>16,_&=65535,w+=f+p,m+=w>>>16,w&=65535,m+=i+a,m&=65535,r.fromBits(_<<16|O,m<<16|w,this.unsigned)},r.prototype.and=function(t){return r.isLong(t)||(t=r.fromValue(t)),r.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},r.prototype.compare=function(t){if(r.isLong(t)||(t=r.fromValue(t)),this.eq(t))return 0;var i=this.isNegative(),f=t.isNegative();return i&&!f?-1:!i&&f?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},r.prototype.comp=function(t){return this.compare(t)},r.prototype.divide=function(t){if(r.isLong(t)||(t=r.fromValue(t)),t.isZero())throw Error(`division by zero`);if(J$1){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var i=(this.unsigned?J$1.div_u:J$1.div_s)(this.low,this.high,t.low,t.high);return r.fromBits(i,J$1.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?r.UZERO:r.ZERO;var f,c,h;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return r.UZERO;if(t.gt(this.shru(1)))return r.UONE;h=r.UZERO;}else {if(this.eq(r.MIN_VALUE)){if(t.eq(r.ONE)||t.eq(r.NEG_ONE))return r.MIN_VALUE;if(t.eq(r.MIN_VALUE))return r.ONE;return f=this.shr(1).div(t).shl(1),f.eq(r.ZERO)?t.isNegative()?r.ONE:r.NEG_ONE:(c=this.sub(t.mul(f)),h=f.add(c.div(t)),h)}else if(t.eq(r.MIN_VALUE))return this.unsigned?r.UZERO:r.ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();h=r.ZERO;}for(c=this;c.gte(t);){f=Math.max(1,Math.floor(c.toNumber()/t.toNumber()));for(var p=Math.ceil(Math.log(f)/Math.LN2),y=p<=48?1:Math.pow(2,p-48),E=r.fromNumber(f),m=E.mul(t);m.isNegative()||m.gt(c);)f-=y,E=r.fromNumber(f,this.unsigned),m=E.mul(t);E.isZero()&&(E=r.ONE),h=h.add(E),c=c.sub(m);}return h},r.prototype.div=function(t){return this.divide(t)},r.prototype.equals=function(t){return r.isLong(t)||(t=r.fromValue(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?false:this.high===t.high&&this.low===t.low},r.prototype.eq=function(t){return this.equals(t)},r.prototype.getHighBits=function(){return this.high},r.prototype.getHighBitsUnsigned=function(){return this.high>>>0},r.prototype.getLowBits=function(){return this.low},r.prototype.getLowBitsUnsigned=function(){return this.low>>>0},r.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(r.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t=this.high!==0?this.high:this.low,i;for(i=31;i>0&&(t&1<<i)===0;i--);return this.high!==0?i+33:i+1},r.prototype.greaterThan=function(t){return this.comp(t)>0},r.prototype.gt=function(t){return this.greaterThan(t)},r.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},r.prototype.gte=function(t){return this.greaterThanOrEqual(t)},r.prototype.ge=function(t){return this.greaterThanOrEqual(t)},r.prototype.isEven=function(){return (this.low&1)===0},r.prototype.isNegative=function(){return !this.unsigned&&this.high<0},r.prototype.isOdd=function(){return (this.low&1)===1},r.prototype.isPositive=function(){return this.unsigned||this.high>=0},r.prototype.isZero=function(){return this.high===0&&this.low===0},r.prototype.lessThan=function(t){return this.comp(t)<0},r.prototype.lt=function(t){return this.lessThan(t)},r.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},r.prototype.lte=function(t){return this.lessThanOrEqual(t)},r.prototype.modulo=function(t){if(r.isLong(t)||(t=r.fromValue(t)),J$1){var i=(this.unsigned?J$1.rem_u:J$1.rem_s)(this.low,this.high,t.low,t.high);return r.fromBits(i,J$1.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},r.prototype.mod=function(t){return this.modulo(t)},r.prototype.rem=function(t){return this.modulo(t)},r.prototype.multiply=function(t){if(this.isZero())return r.ZERO;if(r.isLong(t)||(t=r.fromValue(t)),J$1){var i=J$1.mul(this.low,this.high,t.low,t.high);return r.fromBits(i,J$1.get_high(),this.unsigned)}if(t.isZero())return r.ZERO;if(this.eq(r.MIN_VALUE))return t.isOdd()?r.MIN_VALUE:r.ZERO;if(t.eq(r.MIN_VALUE))return this.isOdd()?r.MIN_VALUE:r.ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(r.TWO_PWR_24)&&t.lt(r.TWO_PWR_24))return r.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var f=this.high>>>16,c=this.high&65535,h=this.low>>>16,a=this.low&65535,p=t.high>>>16,y=t.high&65535,E=t.low>>>16,m=t.low&65535,w=0,_=0,O=0,S=0;return S+=a*m,O+=S>>>16,S&=65535,O+=h*m,_+=O>>>16,O&=65535,O+=a*E,_+=O>>>16,O&=65535,_+=c*m,w+=_>>>16,_&=65535,_+=h*E,w+=_>>>16,_&=65535,_+=a*y,w+=_>>>16,_&=65535,w+=f*m+c*E+h*y+a*p,w&=65535,r.fromBits(O<<16|S,w<<16|_,this.unsigned)},r.prototype.mul=function(t){return this.multiply(t)},r.prototype.negate=function(){return !this.unsigned&&this.eq(r.MIN_VALUE)?r.MIN_VALUE:this.not().add(r.ONE)},r.prototype.neg=function(){return this.negate()},r.prototype.not=function(){return r.fromBits(~this.low,~this.high,this.unsigned)},r.prototype.notEquals=function(t){return !this.equals(t)},r.prototype.neq=function(t){return this.notEquals(t)},r.prototype.ne=function(t){return this.notEquals(t)},r.prototype.or=function(t){return r.isLong(t)||(t=r.fromValue(t)),r.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},r.prototype.shiftLeft=function(t){return r.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?r.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):r.fromBits(0,this.low<<t-32,this.unsigned)},r.prototype.shl=function(t){return this.shiftLeft(t)},r.prototype.shiftRight=function(t){return r.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?r.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):r.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},r.prototype.shr=function(t){return this.shiftRight(t)},r.prototype.shiftRightUnsigned=function(t){if(r.isLong(t)&&(t=t.toInt()),t&=63,t===0)return this;var i=this.high;if(t<32){var f=this.low;return r.fromBits(f>>>t|i<<32-t,i>>>t,this.unsigned)}else return t===32?r.fromBits(i,0,this.unsigned):r.fromBits(i>>>t-32,0,this.unsigned)},r.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},r.prototype.shru=function(t){return this.shiftRightUnsigned(t)},r.prototype.subtract=function(t){return r.isLong(t)||(t=r.fromValue(t)),this.add(t.neg())},r.prototype.sub=function(t){return this.subtract(t)},r.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},r.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*ft$2+(this.low>>>0):this.high*ft$2+(this.low>>>0)},r.prototype.toBigInt=function(){return BigInt(this.toString())},r.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},r.prototype.toBytesLE=function(){var t=this.high,i=this.low;return [i&255,i>>>8&255,i>>>16&255,i>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},r.prototype.toBytesBE=function(){var t=this.high,i=this.low;return [t>>>24,t>>>16&255,t>>>8&255,t&255,i>>>24,i>>>16&255,i>>>8&255,i&255]},r.prototype.toSigned=function(){return this.unsigned?r.fromBits(this.low,this.high,false):this},r.prototype.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError(`radix`);if(this.isZero())return `0`;if(this.isNegative())if(this.eq(r.MIN_VALUE)){var i=r.fromNumber(t),f=this.div(i),c=f.mul(i).sub(this);return f.toString(t)+c.toInt().toString(t)}else return `-`+this.neg().toString(t);for(var h=r.fromNumber(Math.pow(t,6),this.unsigned),a=this,p=``;;){var y=a.div(h),m=(a.sub(y.mul(h)).toInt()>>>0).toString(t);if(a=y,a.isZero())return m+p;for(;m.length<6;)m=`0`+m;p=``+m+p;}},r.prototype.toUnsigned=function(){return this.unsigned?this:r.fromBits(this.low,this.high,true)},r.prototype.xor=function(t){return r.isLong(t)||(t=r.fromValue(t)),r.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},r.prototype.eqz=function(){return this.isZero()},r.prototype.le=function(t){return this.lessThanOrEqual(t)},r.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},r.fromExtendedJSON=function(t,i){var f=r.fromString(t.$numberLong);return i&&i.relaxed?f.toNumber():f},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new Long("`.concat(this.toString(),`"`).concat(this.unsigned?`, true`:``,`)`)},r.TWO_PWR_24=r.fromInt(oe$3),r.MAX_UNSIGNED_VALUE=r.fromBits(-1,-1,true),r.ZERO=r.fromInt(0),r.UZERO=r.fromInt(0,true),r.ONE=r.fromInt(1),r.UONE=r.fromInt(1,true),r.NEG_ONE=r.fromInt(-1),r.MAX_VALUE=r.fromBits(-1,2147483647,false),r.MIN_VALUE=r.fromBits(0,-2147483648,false),r})();Object.defineProperty(v$1.prototype,`__isLong__`,{value:true});Object.defineProperty(v$1.prototype,`_bsontype`,{value:`Long`});var se$2=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,fe$1=/^(\+|-)?(Infinity|inf)$/i,ae$3=/^(\+|-)?NaN$/i,ut$2=6111,Ft$1=-6176,ir$3=6176,ue$2=34,Mt$1=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),or$3=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),sr$3=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),he$2=/^([-+])?(\d+)?$/,ce$3=31,fr$3=16383,le$3=30,pe$2=31;function ar$3(r){return !isNaN(parseInt(r,10))}function ge$1(r){var t=v$1.fromNumber(1e9),i=v$1.fromNumber(0);if(!r.parts[0]&&!r.parts[1]&&!r.parts[2]&&!r.parts[3])return {quotient:r,rem:i};for(var f=0;f<=3;f++)i=i.shiftLeft(32),i=i.add(new v$1(r.parts[f],0)),r.parts[f]=i.div(t).low,i=i.modulo(t);return {quotient:r,rem:i}}function ye$3(r,t){if(!r&&!t)return {high:v$1.fromNumber(0),low:v$1.fromNumber(0)};var i=r.shiftRightUnsigned(32),f=new v$1(r.getLowBits(),0),c=t.shiftRightUnsigned(32),h=new v$1(t.getLowBits(),0),a=i.multiply(c),p=i.multiply(h),y=f.multiply(c),E=f.multiply(h);return a=a.add(p.shiftRightUnsigned(32)),p=new v$1(p.getLowBits(),0).add(y).add(E.shiftRightUnsigned(32)),a=a.add(p.shiftRightUnsigned(32)),E=p.shiftLeft(32).add(new v$1(E.getLowBits(),0)),{high:a,low:E}}function we$3(r,t){var i=r.high>>>0,f=t.high>>>0;if(i<f)return true;if(i===f){if(r.low>>>0<t.low>>>0)return true}return false}function st$2(r,t){throw new L$3(`"`.concat(r,`" is not a valid Decimal128 string - `).concat(t))}var Yt$1=(function(){function r(t){if(!(this instanceof r))return new r(t);if(typeof t==`string`)this.bytes=r.fromString(t).bytes;else if(Ct$2(t)){if(t.byteLength!==16)throw new L$3(`Decimal128 must take a Buffer of 16 bytes`);this.bytes=t;}else throw new L$3(`Decimal128 must take a Buffer or string`)}return r.fromString=function(t){var i=false,f=false,c=false,h=0,a=0,p=0,y=0,E=0,m=[0],w=0,_=0,O=0,S=0,I=0,M=0,D=new v$1(0,0),F=new v$1(0,0),P=0,B=0;if(t.length>=7e3)throw new L$3(``+t+` not a valid Decimal128 string`);var Y=t.match(se$2),W=t.match(fe$1),q=t.match(ae$3);if(!Y&&!W&&!q||t.length===0)throw new L$3(``+t+` not a valid Decimal128 string`);if(Y){var bt=Y[2],at=Y[4],At=Y[5],pt=Y[6];at&&pt===void 0&&st$2(t,`missing exponent power`),at&&bt===void 0&&st$2(t,`missing exponent base`),at===void 0&&(At||pt)&&st$2(t,`missing e before exponent`);}if((t[B]===`+`||t[B]===`-`)&&(i=t[B++]===`-`),!ar$3(t[B])&&t[B]!==`.`){if(t[B]===`i`||t[B]===`I`)return new r(A$2.from(i?or$3:sr$3));if(t[B]===`N`)return new r(A$2.from(Mt$1))}for(;ar$3(t[B])||t[B]===`.`;){if(t[B]===`.`){f&&st$2(t,`contains multiple periods`),f=true,B=B+1;continue}w<34&&(t[B]!==`0`||c)&&(c||(E=a),c=true,m[_++]=parseInt(t[B],10),w=w+1),c&&(p=p+1),f&&(y=y+1),a=a+1,B=B+1;}if(f&&!a)throw new L$3(``+t+` not a valid Decimal128 string`);if(t[B]===`e`||t[B]===`E`){var et=t.substr(++B).match(he$2);if(!et||!et[2])return new r(A$2.from(Mt$1));I=parseInt(et[0],10),B=B+et[0].length;}if(t[B])return new r(A$2.from(Mt$1));if(O=0,!w)O=0,S=0,m[0]=0,p=1,w=1,h=0;else if(S=w-1,h=p,h!==1)for(;m[E+h-1]===0;)h=h-1;for(I<=y&&y-I>16384?I=Ft$1:I=I-y;I>ut$2;){if(S=S+1,S-O>ue$2){var nt=m.join(``);if(nt.match(/^0+$/)){I=ut$2;break}st$2(t,`overflow`);}I=I-1;}for(;I<Ft$1||w<p;){if(S===0&&h<w){I=Ft$1,h=0;break}if(w<p?p=p-1:S=S-1,I<ut$2)I=I+1;else {var nt=m.join(``);if(nt.match(/^0+$/)){I=ut$2;break}st$2(t,`overflow`);}}if(S-O+1<h){var G=a;f&&(E=E+1,G=G+1),i&&(E=E+1,G=G+1);var gt=parseInt(t[E+S+1],10),it=0;if(gt>=5&&(it=1,gt===5)){for(it=m[S]%2===1?1:0,M=E+S+2;M<G;M++)if(parseInt(t[M],10)){it=1;break}}if(it){for(var T=S;T>=0;T--)if(++m[T]>9&&(m[T]=0,T===0))if(I<ut$2)I=I+1,m[T]=1;else return new r(A$2.from(i?or$3:sr$3))}}if(D=v$1.fromNumber(0),F=v$1.fromNumber(0),h===0)D=v$1.fromNumber(0),F=v$1.fromNumber(0);else if(S-O<17){var T=O;for(F=v$1.fromNumber(m[T++]),D=new v$1(0,0);T<=S;T++)F=F.multiply(v$1.fromNumber(10)),F=F.add(v$1.fromNumber(m[T]));}else {var T=O;for(D=v$1.fromNumber(m[T++]);T<=S-17;T++)D=D.multiply(v$1.fromNumber(10)),D=D.add(v$1.fromNumber(m[T]));for(F=v$1.fromNumber(m[T++]);T<=S;T++)F=F.multiply(v$1.fromNumber(10)),F=F.add(v$1.fromNumber(m[T]));}var V=ye$3(D,v$1.fromString(`100000000000000000`));V.low=V.low.add(F),we$3(V.low,F)&&(V.high=V.high.add(v$1.fromNumber(1))),P=I+ir$3;var b={low:v$1.fromNumber(0),high:v$1.fromNumber(0)};V.high.shiftRightUnsigned(49).and(v$1.fromNumber(1)).equals(v$1.fromNumber(1))?(b.high=b.high.or(v$1.fromNumber(3).shiftLeft(61)),b.high=b.high.or(v$1.fromNumber(P).and(v$1.fromNumber(16383).shiftLeft(47))),b.high=b.high.or(V.high.and(v$1.fromNumber(0x7fffffffffff)))):(b.high=b.high.or(v$1.fromNumber(P&16383).shiftLeft(49)),b.high=b.high.or(V.high.and(v$1.fromNumber(562949953421311)))),b.low=V.low,i&&(b.high=b.high.or(v$1.fromString(`9223372036854775808`)));var N=A$2.alloc(16);return B=0,N[B++]=b.low.low&255,N[B++]=b.low.low>>8&255,N[B++]=b.low.low>>16&255,N[B++]=b.low.low>>24&255,N[B++]=b.low.high&255,N[B++]=b.low.high>>8&255,N[B++]=b.low.high>>16&255,N[B++]=b.low.high>>24&255,N[B++]=b.high.low&255,N[B++]=b.high.low>>8&255,N[B++]=b.high.low>>16&255,N[B++]=b.high.low>>24&255,N[B++]=b.high.high&255,N[B++]=b.high.high>>8&255,N[B++]=b.high.high>>16&255,N[B++]=b.high.high>>24&255,new r(N)},r.prototype.toString=function(){for(var t,i=0,f=new Array(36),c=0;c<f.length;c++)f[c]=0;var h=0,a=false,p,y={parts:[0,0,0,0]},E,m,w=[];h=0;var _=this.bytes,O=_[h++]|_[h++]<<8|_[h++]<<16|_[h++]<<24,S=_[h++]|_[h++]<<8|_[h++]<<16|_[h++]<<24,I=_[h++]|_[h++]<<8|_[h++]<<16|_[h++]<<24,M=_[h++]|_[h++]<<8|_[h++]<<16|_[h++]<<24;h=0;({low:new v$1(O,S),high:new v$1(I,M)}).high.lessThan(v$1.ZERO)&&w.push(`-`);var F=M>>26&ce$3;if(F>>3===3){if(F===le$3)return w.join(``)+`Infinity`;if(F===pe$2)return `NaN`;t=M>>15&fr$3,p=8+(M>>14&1);}else p=M>>14&7,t=M>>17&fr$3;var P=t-ir$3;if(y.parts[0]=(M&16383)+((p&15)<<14),y.parts[1]=I,y.parts[2]=S,y.parts[3]=O,y.parts[0]===0&&y.parts[1]===0&&y.parts[2]===0&&y.parts[3]===0)a=true;else for(m=3;m>=0;m--){var B=0,Y=ge$1(y);if(y=Y.quotient,B=Y.rem.low,!!B)for(E=8;E>=0;E--)f[m*9+E]=B%10,B=Math.floor(B/10);}if(a)i=1,f[h]=0;else for(i=36;!f[h];)i=i-1,h=h+1;var W=i-1+P;if(W>=34||W<=-7||P>0){if(i>34)return w.push(``.concat(0)),P>0?w.push(`E+`.concat(P)):P<0&&w.push(`E`.concat(P)),w.join(``);w.push(``.concat(f[h++])),i=i-1,i&&w.push(`.`);for(var c=0;c<i;c++)w.push(``.concat(f[h++]));w.push(`E`),W>0?w.push(`+`.concat(W)):w.push(``.concat(W));}else if(P>=0)for(var c=0;c<i;c++)w.push(``.concat(f[h++]));else {var q=i+P;if(q>0)for(var c=0;c<q;c++)w.push(``.concat(f[h++]));else w.push(`0`);for(w.push(`.`);q++<0;)w.push(`0`);for(var c=0;c<i-Math.max(q-1,0);c++)w.push(``.concat(f[h++]));}return w.join(``)},r.prototype.toJSON=function(){return {$numberDecimal:this.toString()}},r.prototype.toExtendedJSON=function(){return {$numberDecimal:this.toString()}},r.fromExtendedJSON=function(t){return r.fromString(t.$numberDecimal)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new Decimal128("`.concat(this.toString(),`")`)},r})();Object.defineProperty(Yt$1.prototype,`_bsontype`,{value:`Decimal128`});var Ot$1=(function(){function r(t){if(!(this instanceof r))return new r(t);t instanceof Number&&(t=t.valueOf()),this.value=+t;}return r.prototype.valueOf=function(){return this.value},r.prototype.toJSON=function(){return this.value},r.prototype.toString=function(t){return this.value.toString(t)},r.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.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()}},r.fromExtendedJSON=function(t,i){var f=parseFloat(t.$numberDouble);return i&&i.relaxed?f:new r(f)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){var t=this.toExtendedJSON();return `new Double(`.concat(t.$numberDouble,`)`)},r})();Object.defineProperty(Ot$1.prototype,`_bsontype`,{value:`Double`});var dt$2=(function(){function r(t){if(!(this instanceof r))return new r(t);t instanceof Number&&(t=t.valueOf()),this.value=+t|0;}return r.prototype.valueOf=function(){return this.value},r.prototype.toString=function(t){return this.value.toString(t)},r.prototype.toJSON=function(){return this.value},r.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},r.fromExtendedJSON=function(t,i){return i&&i.relaxed?parseInt(t.$numberInt,10):new r(t.$numberInt)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new Int32(`.concat(this.valueOf(),`)`)},r})();Object.defineProperty(dt$2.prototype,`_bsontype`,{value:`Int32`});var Jt$1=(function(){function r(){if(!(this instanceof r))return new r}return r.prototype.toExtendedJSON=function(){return {$maxKey:1}},r.fromExtendedJSON=function(){return new r},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new MaxKey()`},r})();Object.defineProperty(Jt$1.prototype,`_bsontype`,{value:`MaxKey`});var Ht$1=(function(){function r(){if(!(this instanceof r))return new r}return r.prototype.toExtendedJSON=function(){return {$minKey:1}},r.fromExtendedJSON=function(){return new r},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new MinKey()`},r})();Object.defineProperty(Ht$1.prototype,`_bsontype`,{value:`MinKey`});var me$2=new RegExp(`^[0-9a-fA-F]{24}$`),Q$1=null,z$2=Symbol(`id`),$$2=(function(){function r(t){if(!(this instanceof r))return new r(t);var i;if(typeof t==`object`&&t&&`id`in t){if(typeof t.id!=`string`&&!ArrayBuffer.isView(t.id))throw new L$3(`Argument passed in must have an id that is of type string or Buffer`);`toHexString`in t&&typeof t.toHexString==`function`?i=A$2.from(t.toHexString(),`hex`):i=t.id;}else i=t;if(i==null||typeof i==`number`)this[z$2]=r.generate(typeof i==`number`?i:void 0);else if(ArrayBuffer.isView(i)&&i.byteLength===12)this[z$2]=i instanceof A$2?i:Et$1(i);else if(typeof i==`string`)if(i.length===12){var f=A$2.from(i);if(f.byteLength===12)this[z$2]=f;else throw new L$3(`Argument passed in must be a string of 12 bytes`)}else if(i.length===24&&me$2.test(i))this[z$2]=A$2.from(i,`hex`);else throw new L$3(`Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer`);else throw new L$3(`Argument passed in does not match the accepted types`);r.cacheHexString&&(this.__id=this.id.toString(`hex`));}return Object.defineProperty(r.prototype,`id`,{get:function(){return this[z$2]},set:function(t){this[z$2]=t,r.cacheHexString&&(this.__id=t.toString(`hex`));},enumerable:false,configurable:true}),Object.defineProperty(r.prototype,`generationTime`,{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0);},enumerable:false,configurable:true}),r.prototype.toHexString=function(){if(r.cacheHexString&&this.__id)return this.__id;var t=this.id.toString(`hex`);return r.cacheHexString&&!this.__id&&(this.__id=t),t},r.getInc=function(){return r.index=(r.index+1)%16777215},r.generate=function(t){typeof t!=`number`&&(t=Math.floor(Date.now()/1e3));var i=r.getInc(),f=A$2.alloc(12);return f.writeUInt32BE(t,0),Q$1===null&&(Q$1=yr$1(5)),f[4]=Q$1[0],f[5]=Q$1[1],f[6]=Q$1[2],f[7]=Q$1[3],f[8]=Q$1[4],f[11]=i&255,f[10]=i>>8&255,f[9]=i>>16&255,f},r.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},r.prototype.toJSON=function(){return this.toHexString()},r.prototype.equals=function(t){if(t==null)return false;if(t instanceof r)return this[z$2][11]===t[z$2][11]&&this[z$2].equals(t[z$2]);if(typeof t==`string`&&r.isValid(t)&&t.length===12&&Ct$2(this.id))return t===A$2.prototype.toString.call(this.id,`latin1`);if(typeof t==`string`&&r.isValid(t)&&t.length===24)return t.toLowerCase()===this.toHexString();if(typeof t==`string`&&r.isValid(t)&&t.length===12)return A$2.from(t).equals(this.id);if(typeof t==`object`&&`toHexString`in t&&typeof t.toHexString==`function`){var i=t.toHexString(),f=this.toHexString().toLowerCase();return typeof i==`string`&&i.toLowerCase()===f}return false},r.prototype.getTimestamp=function(){var t=new Date,i=this.id.readUInt32BE(0);return t.setTime(Math.floor(i)*1e3),t},r.createPk=function(){return new r},r.createFromTime=function(t){var i=A$2.from([0,0,0,0,0,0,0,0,0,0,0,0]);return i.writeUInt32BE(t,0),new r(i)},r.createFromHexString=function(t){if(typeof t>`u`||t!=null&&t.length!==24)throw new L$3(`Argument passed in must be a single String of 12 bytes or a string of 24 hex characters`);return new r(A$2.from(t,`hex`))},r.isValid=function(t){if(t==null)return false;try{return new r(t),!0}catch{return false}},r.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString(`hex`)}},r.fromExtendedJSON=function(t){return new r(t.$oid)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r.prototype.inspect=function(){return `new ObjectId("`.concat(this.toHexString(),`")`)},r.index=Math.floor(Math.random()*16777215),r})();Object.defineProperty($$2.prototype,`generate`,{value:St$1(function(r){return $$2.generate(r)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty($$2.prototype,`getInc`,{value:St$1(function(){return $$2.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty($$2.prototype,`get_inc`,{value:St$1(function(){return $$2.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty($$2,`get_inc`,{value:St$1(function(){return $$2.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty($$2.prototype,`_bsontype`,{value:`ObjectID`});function _e$1(r){return r.split(``).sort().join(``)}var ct$2=(function(){function r(t,i){if(!(this instanceof r))return new r(t,i);if(this.pattern=t,this.options=_e$1(i??``),this.pattern.indexOf(`\0`)!==-1)throw new tt$1(`BSON Regex patterns cannot contain null bytes, found: `.concat(JSON.stringify(this.pattern)));if(this.options.indexOf(`\0`)!==-1)throw new tt$1(`BSON Regex options cannot contain null bytes, found: `.concat(JSON.stringify(this.options)));for(var f=0;f<this.options.length;f++)if(!(this.options[f]===`i`||this.options[f]===`m`||this.options[f]===`x`||this.options[f]===`l`||this.options[f]===`s`||this.options[f]===`u`))throw new tt$1(`The regular expression option [`.concat(this.options[f],`] is not supported`))}return r.parseOptions=function(t){return t?t.split(``).sort().join(``):``},r.prototype.toExtendedJSON=function(t){return t=t||{},t.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},r.fromExtendedJSON=function(t){if(`$regex`in t)if(typeof t.$regex!=`string`){if(t.$regex._bsontype===`BSONRegExp`)return t}else return new r(t.$regex,r.parseOptions(t.$options));if(`$regularExpression`in t)return new r(t.$regularExpression.pattern,r.parseOptions(t.$regularExpression.options));throw new L$3(`Unexpected BSONRegExp EJSON object form: `.concat(JSON.stringify(t)))},r})();Object.defineProperty(ct$2.prototype,`_bsontype`,{value:`BSONRegExp`});var Vt$1=(function(){function r(t){if(!(this instanceof r))return new r(t);this.value=t;}return r.prototype.valueOf=function(){return this.value},r.prototype.toString=function(){return this.value},r.prototype.inspect=function(){return `new BSONSymbol("`.concat(this.value,`")`)},r.prototype.toJSON=function(){return this.value},r.prototype.toExtendedJSON=function(){return {$symbol:this.value}},r.fromExtendedJSON=function(t){return new r(t.$symbol)},r.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},r})();Object.defineProperty(Vt$1.prototype,`_bsontype`,{value:`Symbol`});var Er$2=(function(r){Bt$1(t,r);function t(i,f){var c=this;return c instanceof t?(v$1.isLong(i)?c=r.call(this,i.low,i.high,true)||this:lt$2(i)&&typeof i.t<`u`&&typeof i.i<`u`?c=r.call(this,i.i,i.t,true)||this:c=r.call(this,i,f,true)||this,Object.defineProperty(c,`_bsontype`,{value:`Timestamp`,writable:false,configurable:false,enumerable:false}),c):new t(i,f)}return t.prototype.toJSON=function(){return {$timestamp:this.toString()}},t.fromInt=function(i){return new t(v$1.fromInt(i,true))},t.fromNumber=function(i){return new t(v$1.fromNumber(i,true))},t.fromBits=function(i,f){return new t(i,f)},t.fromString=function(i,f){return new t(v$1.fromString(i,true,f))},t.prototype.toExtendedJSON=function(){return {$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(i){return new t(i.$timestamp)},t.prototype[Symbol.for(`nodejs.util.inspect.custom`)]=function(){return this.inspect()},t.prototype.inspect=function(){return `new Timestamp({ t: `.concat(this.getHighBits(),`, i: `).concat(this.getLowBits(),` })`)},t.MAX_VALUE=v$1.MAX_UNSIGNED_VALUE,t})(v$1);function ve$3(r){return lt$2(r)&&Reflect.has(r,`_bsontype`)&&typeof r._bsontype==`string`}var vr$1=2147483647,Br$2=-2147483648,Sr$2=0x8000000000000000,Nr$2=-9223372036854776e3,Be$2={$oid:$$2,$binary:rt$1,$uuid:rt$1,$symbol:Vt$1,$numberInt:dt$2,$numberDecimal:Yt$1,$numberDouble:Ot$1,$numberLong:v$1,$minKey:Ht$1,$maxKey:Jt$1,$regex:ct$2,$regularExpression:ct$2,$timestamp:Er$2};function Or$2(r,t){if(t===void 0&&(t={}),typeof r==`number`){if(t.relaxed||t.legacy)return r;if(Math.floor(r)===r){if(r>=Br$2&&r<=vr$1)return new dt$2(r);if(r>=Nr$2&&r<=Sr$2)return v$1.fromNumber(r)}return new Ot$1(r)}if(r==null||typeof r!=`object`)return r;if(r.$undefined)return null;for(var i=Object.keys(r).filter(function(w){return w.startsWith(`$`)&&r[w]!=null}),f=0;f<i.length;f++){var c=Be$2[i[f]];if(c)return c.fromExtendedJSON(r,t)}if(r.$date!=null){var h=r.$date,a=new Date;return t.legacy?typeof h==`number`?a.setTime(h):typeof h==`string`&&a.setTime(Date.parse(h)):typeof h==`string`?a.setTime(Date.parse(h)):v$1.isLong(h)?a.setTime(h.toNumber()):typeof h==`number`&&t.relaxed&&a.setTime(h),a}if(r.$code!=null){var p=Object.assign({},r);return r.$scope&&(p.$scope=Or$2(r.$scope)),Nt$1.fromExtendedJSON(r)}if(ie$2(r)||r.$dbPointer){var y=r.$ref?r:r.$dbPointer;if(y instanceof ht$2)return y;var E=Object.keys(y).filter(function(w){return w.startsWith(`$`)}),m=true;if(E.forEach(function(w){[`$ref`,`$id`,`$db`].indexOf(w)===-1&&(m=false);}),m)return ht$2.fromExtendedJSON(y)}return r}function Se$3(r,t){return r.map(function(i,f){t.seenObjects.push({propertyName:`index `.concat(f),obj:null});try{return k$2(i,t)}finally{t.seenObjects.pop();}})}function ur$3(r){var t=r.toISOString();return r.getUTCMilliseconds()!==0?t:t.slice(0,-5)+`Z`}function k$2(r,t){if((typeof r==`object`||typeof r==`function`)&&r!==null){var i=t.seenObjects.findIndex(function(D){return D.obj===r});if(i!==-1){var f=t.seenObjects.map(function(D){return D.propertyName}),c=f.slice(0,i).map(function(D){return ``.concat(D,` -> `)}).join(``),h=f[i],a=` -> `+f.slice(i+1,f.length-1).map(function(D){return ``.concat(D,` -> `)}).join(``),p=f[f.length-1],y=` `.repeat(c.length+h.length/2),E=`-`.repeat(a.length+(h.length+p.length)/2-1);throw new L$3(`Converting circular structure to EJSON:
|
|
28
28
|
`+` `.concat(c).concat(h).concat(a).concat(p,`
|
|
29
|
-
`)+` `.concat(y,`\\`).concat(E,`/`))}t.seenObjects[t.seenObjects.length-1].obj=r;}if(Array.isArray(r))return Se$3(r,t);if(r===void 0)return null;if(r instanceof Date||te$3(r)){var m=r.getTime(),w=m>-1&&m<0xe677d3328480;return t.legacy?t.relaxed&&w?{$date:r.getTime()}:{$date:ur$
|
|
29
|
+
`)+` `.concat(y,`\\`).concat(E,`/`))}t.seenObjects[t.seenObjects.length-1].obj=r;}if(Array.isArray(r))return Se$3(r,t);if(r===void 0)return null;if(r instanceof Date||te$3(r)){var m=r.getTime(),w=m>-1&&m<0xe677d3328480;return t.legacy?t.relaxed&&w?{$date:r.getTime()}:{$date:ur$3(r)}:t.relaxed&&w?{$date:ur$3(r)}:{$date:{$numberLong:r.getTime().toString()}}}if(typeof r==`number`&&(!t.relaxed||!isFinite(r))){if(Math.floor(r)===r){var _=r>=Br$2&&r<=vr$1,O=r>=Nr$2&&r<=Sr$2;if(_)return {$numberInt:r.toString()};if(O)return {$numberLong:r.toString()}}return {$numberDouble:r.toString()}}if(r instanceof RegExp||Qr$1(r)){var S=r.flags;if(S===void 0){var I=r.toString().match(/[gimuy]*$/);I&&(S=I[0]);}return new ct$2(r.source,S).toExtendedJSON(t)}return r!=null&&typeof r==`object`?Oe$1(r,t):r}var Ne$1={Binary:function(r){return new rt$1(r.value(),r.sub_type)},Code:function(r){return new Nt$1(r.code,r.scope)},DBRef:function(r){return new ht$2(r.collection||r.namespace,r.oid,r.db,r.fields)},Decimal128:function(r){return new Yt$1(r.bytes)},Double:function(r){return new Ot$1(r.value)},Int32:function(r){return new dt$2(r.value)},Long:function(r){return v$1.fromBits(r.low!=null?r.low:r.low_,r.low!=null?r.high:r.high_,r.low!=null?r.unsigned:r.unsigned_)},MaxKey:function(){return new Jt$1},MinKey:function(){return new Ht$1},ObjectID:function(r){return new $$2(r)},ObjectId:function(r){return new $$2(r)},BSONRegExp:function(r){return new ct$2(r.pattern,r.options)},Symbol:function(r){return new Vt$1(r.value)},Timestamp:function(r){return Er$2.fromBits(r.low,r.high)}};function Oe$1(r,t){if(r==null||typeof r!=`object`)throw new tt$1(`not an object instance`);var i=r._bsontype;if(typeof i>`u`){var f={};for(var c in r){t.seenObjects.push({propertyName:c,obj:null});try{var h=k$2(r[c],t);c===`__proto__`?Object.defineProperty(f,c,{value:h,writable:!0,enumerable:!0,configurable:!0}):f[c]=h;}finally{t.seenObjects.pop();}}return f}else if(ve$3(r)){var a=r;if(typeof a.toExtendedJSON!=`function`){var p=Ne$1[r._bsontype];if(!p)throw new L$3(`Unrecognized or invalid _bsontype: `+r._bsontype);a=p(a);}return i===`Code`&&a.scope?a=new Nt$1(a.code,k$2(a.scope,t)):i===`DBRef`&&a.oid&&(a=new ht$2(k$2(a.collection,t),k$2(a.oid,t),k$2(a.db,t),k$2(a.fields,t))),a.toExtendedJSON(t)}else throw new tt$1(`_bsontype must be a string, but was: `+typeof i)}var hr$3;(function(r){function t(h,a){var p=Object.assign({},{relaxed:true,legacy:false},a);return typeof p.relaxed==`boolean`&&(p.strict=!p.relaxed),typeof p.strict==`boolean`&&(p.relaxed=!p.strict),JSON.parse(h,function(y,E){if(y.indexOf(`\0`)!==-1)throw new tt$1(`BSON Document field names cannot contain null bytes, found: `.concat(JSON.stringify(y)));return Or$2(E,p)})}r.parse=t;function i(h,a,p,y){p!=null&&typeof p==`object`&&(y=p,p=0),a!=null&&typeof a==`object`&&!Array.isArray(a)&&(y=a,a=void 0,p=0);var m=k$2(h,Object.assign({relaxed:true,legacy:false},y,{seenObjects:[{propertyName:`(root)`,obj:null}]}));return JSON.stringify(m,a,p)}r.stringify=i;function f(h,a){return a=a||{},JSON.parse(i(h,a))}r.serialize=f;function c(h,a){return a=a||{},t(JSON.stringify(h),a)}r.deserialize=c;})(hr$3||(hr$3={}));var lr$3=gr$3();lr$3.Map?lr$3.Map:(function(){function r(t){t===void 0&&(t=[]),this._keys=[],this._values={};for(var i=0;i<t.length;i++)if(t[i]!=null){var f=t[i],c=f[0],h=f[1];this._keys.push(c),this._values[c]={v:h,i:this._keys.length-1};}}return r.prototype.clear=function(){this._keys=[],this._values={};},r.prototype.delete=function(t){var i=this._values[t];return i==null?false:(delete this._values[t],this._keys.splice(i.i,1),true)},r.prototype.entries=function(){var t=this,i=0;return {next:function(){var f=t._keys[i++];return {value:f!==void 0?[f,t._values[f].v]:void 0,done:f===void 0}}}},r.prototype.forEach=function(t,i){i=i||this;for(var f=0;f<this._keys.length;f++){var c=this._keys[f];t.call(i,this._values[c].v,c,i);}},r.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},r.prototype.has=function(t){return this._values[t]!=null},r.prototype.keys=function(){var t=this,i=0;return {next:function(){var f=t._keys[i++];return {value:f!==void 0?f:void 0,done:f===void 0}}}},r.prototype.set=function(t,i){return this._values[t]?(this._values[t].v=i,this):(this._keys.push(t),this._values[t]={v:i,i:this._keys.length-1},this)},r.prototype.values=function(){var t=this,i=0;return {next:function(){var f=t._keys[i++];return {value:f!==void 0?t._values[f].v:void 0,done:f===void 0}}}},Object.defineProperty(r.prototype,`size`,{get:function(){return this._keys.length},enumerable:false,configurable:true}),r})();v$1.fromNumber(ee$1);v$1.fromNumber(ne$2);var jt$1=new Uint8Array(8);new DataView(jt$1.buffer,jt$1.byteOffset,jt$1.byteLength);A$2.alloc(1024*1024*17);var dr$3=class dr{constructor(t,i={},f,c){this.name=t;this.properties=i;this.id=c?new $$2(c):new $$2,this.occurred=new Date,f&&(this.trigger=new mt$2(f)),this.newEvent=!c;}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale;setVideos(t){t&&(this.videos=[t.id],this.properties.current??={videoID:t.id});}};var Ar$1=x$2(Ir$3());var be$3=[`utm_source`,`utm_medium`,`utm_campaign`,`utm_term`,`utm_content`,`utm_id`],br$2={utm_source:`tw_source`,utm_campaign:`tw_campaign`},Ae$1=`cooee_ai`,Ye$1=()=>{if(document.referrer)return document.referrer.replace(location.origin,``)},Je$1=()=>{let r$1;try{r$1=new Ar$1.URLBuilder(location.href);}catch{return {}}let t={};be$3.forEach(f=>{let c=r$1.getQueryParam(f);c&&(t[f]=c);});let i={};return Object.keys(br$2).forEach(f=>{let c=r$1.getQueryParam(br$2[f]);c&&(i[f]=c);}),r$2(r$2({},i),t)};function He$2(r,t){if(!r)return ``;let i=t?t.objective.toLowerCase().toString():`cooee_widget`,f=t?t.shortID:``,c=new URL(r,location.origin);return c.searchParams.set(`utm_source`,Ae$1),c.searchParams.set(`utm_medium`,`onsite_widget`),c.searchParams.set(`utm_campaign`,i),c.searchParams.set(`utm_content`,f),c.toString()}var Ve$2=(r,t)=>{let i=new URL(r);return t.shortID&&i.searchParams.set(`ceevid`,t.shortID+``),i.toString()},We$2=()=>new URLSearchParams(location.search).get(`ceevid`);
|
|
30
30
|
|
|
31
31
|
function M$3(){return window.CooeeSDK?.uaParser.getDevice().type===`mobile`}function S$2(e,i){Object.assign(e.style,i);}function H$3(e,i,t){if(i){if(!t){e.style.removeProperty(i);return}e.style.setProperty(i,t,`important`);}}function C$2(e){if(!e)return false;if(e.tagName.toLowerCase()===`cart-drawer`&&e.hasAttribute(`open`))return true;let t=e.getBoundingClientRect(),n=(window.innerHeight||document.documentElement.clientHeight)+.5,r=(window.innerWidth||document.documentElement.clientWidth)+.5,o=getComputedStyle(e);if(o.display===`none`||o.visibility===`hidden`||parseFloat(o.opacity)===0||e.hidden||!(e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0))return false;let u=Math.max(0,Math.min(t.right,r)-Math.max(t.left,0))*Math.max(0,Math.min(t.bottom,n)-Math.max(t.top,0)),c=t.width*t.height;if(!(c>0&&u/c>=.1))return false;let p=t.top<=n&&t.bottom>=0,g=t.left<=r&&t.right>=0,m=p&&g,l=o.transform.match(/matrix\(([^)]+)\)/),s=0,a=0;if(l){let d=l[1].split(`, `).map(parseFloat);s=d[4],a=d[5];}let y=s+t.left>r||s+t.right<0||a+t.top>n||a+t.bottom<0;return m||!y}var V$2=()=>typeof navigator<`u`&&`share`in navigator,A$1=e=>new Promise((i,t)=>{let n=new Image;n.onload=()=>{i({width:n.width,height:n.height});},n.onerror=t,n.src=e,n.style.display=`none`;});
|
|
32
32
|
|
|
33
|
-
function u
|
|
33
|
+
function u(r){return typeof r==`function`}function R$2(r){let t=r(o=>{Error.call(o),o.stack=new Error().stack;});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var G$1=R$2(r=>function(t){r(this),this.message=t?`${t.length} errors occurred during unsubscription:
|
|
34
34
|
${t.map((o,n)=>`${n+1}) ${o.toString()}`).join(`
|
|
35
|
-
`)}`:``,this.name=`UnsubscriptionError`,this.errors=t;});function P$1(r,e){if(r){let t=r.indexOf(e);0<=t&&r.splice(t,1);}}var v=class r{constructor(e){this.initialTeardown=e,this.closed=false,this._parentage=null,this._finalizers=null;}unsubscribe(){let e;if(!this.closed){this.closed=true;let{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(let i of t)i.remove(this);else t.remove(this);let{initialTeardown:o}=this;if(u$1(o))try{o();}catch(i){e=i instanceof G$1?i.errors:[i];}let{_finalizers:n}=this;if(n){this._finalizers=null;for(let i of n)try{Pr$2(i);}catch(s){e=e??[],s instanceof G$1?e=[...e,...s.errors]:e.push(s);}}if(e)throw new G$1(e)}}add(e){var t;if(e&&e!==this)if(this.closed)Pr$2(e);else {if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this);}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e);}}_hasParent(e){let{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){let{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e;}_removeParent(e){let{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&P$1(t,e);}remove(e){let{_finalizers:t}=this;t&&P$1(t,e),e instanceof r&&e._removeParent(this);}};v.EMPTY=(()=>{let r=new v;return r.closed=true,r})();var br$1=v.EMPTY;function K$2(r){return r instanceof v||r&&`closed`in r&&u$1(r.remove)&&u$1(r.add)&&u$1(r.unsubscribe)}function Pr$2(r){u$1(r)?r():r.unsubscribe();}var w$1={Promise:void 0};var L$2={setTimeout(r,e,...t){return setTimeout(r,e,...t)},clearTimeout(r){return (clearTimeout)(r)},delegate:void 0};function H$2(r){L$2.setTimeout(()=>{throw r});}function V$1(){}function M$2(r){r();}var j$1=class j extends v{constructor(e){super(),this.isStopped=false,e?(this.destination=e,K$2(e)&&e.add(this)):this.destination=se$1;}static create(e,t,o){return new O(e,t,o)}next(e){this.isStopped?_r$2():this._next(e);}error(e){this.isStopped?_r$2():(this.isStopped=true,this._error(e));}complete(){this.isStopped?_r$2():(this.isStopped=true,this._complete());}unsubscribe(){this.closed||(this.isStopped=true,super.unsubscribe(),this.destination=null);}_next(e){this.destination.next(e);}_error(e){try{this.destination.error(e);}finally{this.unsubscribe();}}_complete(){try{this.destination.complete();}finally{this.unsubscribe();}}};var wr$1=class wr{constructor(e){this.partialObserver=e;}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e);}catch(o){J(o);}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e);}catch(o){J(o);}else J(e);}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete();}catch(t){J(t);}}},O=class extends j$1{constructor(e,t,o){super();let n;if(u$1(e)||!e)n={next:e??void 0,error:t??void 0,complete:o??void 0};else {n=e;}this.destination=new wr$1(n);}};function J(r){H$2(r);}function ie$1(r){throw r}function _r$2(r,e){}var se$1={closed:true,next:V$1,error:ie$1,complete:V$1};var k$1=typeof Symbol==`function`&&Symbol.observable||`@@observable`;function T$1(r){return r}function Rr$2(r){return r.length===0?T$1:r.length===1?r[0]:function(t){return r.reduce((o,n)=>n(o),t)}}var m=(()=>{class r{constructor(t){t&&(this._subscribe=t);}lift(t){let o=new r;return o.source=this,o.operator=t,o}subscribe(t,o,n){let i=ce$2(t)?t:new O(t,o,n);return M$2(()=>{let{operator:s,source:c}=this;i.add(s?s.call(i,c):c?this._subscribe(i):this._trySubscribe(i));}),i}_trySubscribe(t){try{return this._subscribe(t)}catch(o){t.error(o);}}forEach(t,o){return o=Lr$1(o),new o((n,i)=>{let s=new O({next:c=>{try{t(c);}catch(f){i(f),s.unsubscribe();}},error:i,complete:n});this.subscribe(s);})}_subscribe(t){var o;return (o=this.source)===null||o===void 0?void 0:o.subscribe(t)}[k$1](){return this}pipe(...t){return Rr$2(t)(this)}toPromise(t){return t=Lr$1(t),new t((o,n)=>{let i;this.subscribe(s=>i=s,s=>n(s),()=>o(i));})}}return r.create=e=>new r(e),r})();function Lr$1(r){var e;return (e=r??w$1.Promise)!==null&&e!==void 0?e:Promise}function fe(r){return r&&u$1(r.next)&&u$1(r.error)&&u$1(r.complete)}function ce$2(r){return r&&r instanceof j$1||fe(r)&&K$2(r)}var Mr$1=R$2(r=>function(){r(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`;});var U$1=(()=>{class r extends m{constructor(){super(),this.closed=false,this.currentObservers=null,this.observers=[],this.isStopped=false,this.hasError=false,this.thrownError=null;}lift(t){let o=new Q(this,this);return o.operator=t,o}_throwIfClosed(){if(this.closed)throw new Mr$1}next(t){M$2(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let o of this.currentObservers)o.next(t);}});}error(t){M$2(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=true,this.thrownError=t;let{observers:o}=this;for(;o.length;)o.shift().error(t);}});}complete(){M$2(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=true;let{observers:t}=this;for(;t.length;)t.shift().complete();}});}unsubscribe(){this.isStopped=this.closed=true,this.observers=this.currentObservers=null;}get observed(){var t;return ((t=this.observers)===null||t===void 0?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){let{hasError:o,isStopped:n,observers:i}=this;return o||n?br$1:(this.currentObservers=null,i.push(t),new v(()=>{this.currentObservers=null,P$1(i,t);}))}_checkFinalizedStatuses(t){let{hasError:o,thrownError:n,isStopped:i}=this;o?t.error(n):i&&t.complete();}asObservable(){let t=new m;return t.source=this,t}}return r.create=(e,t)=>new Q(e,t),r})(),Q=class extends U$1{constructor(e,t){super(),this.destination=e,this.source=t;}next(e){var t,o;(o=(t=this.destination)===null||t===void 0?void 0:t.next)===null||o===void 0||o.call(t,e);}error(e){var t,o;(o=(t=this.destination)===null||t===void 0?void 0:t.error)===null||o===void 0||o.call(t,e);}complete(){var e,t;(t=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||t===void 0||t.call(e);}_subscribe(e){var t,o;return (o=(t=this.source)===null||t===void 0?void 0:t.subscribe(e))!==null&&o!==void 0?o:br$1}};var Sr$1=class Sr extends U$1{constructor(e){super(),this._value=e;}get value(){return this.getValue()}_subscribe(e){let t=super._subscribe(e);return !t.closed&&e.next(this._value),t}getValue(){let{hasError:e,thrownError:t,_value:o}=this;if(e)throw t;return this._throwIfClosed(),o}next(e){super.next(this._value=e);}};var Y$1={now(){return (Y$1.delegate||Date).now()},delegate:void 0};var gr$2=class gr extends U$1{constructor(e=Infinity,t=Infinity,o=Y$1){super(),this._bufferSize=e,this._windowTime=t,this._timestampProvider=o,this._buffer=[],this._infiniteTimeWindow=true,this._infiniteTimeWindow=t===Infinity,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,t);}next(e){let{isStopped:t,_buffer:o,_infiniteTimeWindow:n,_timestampProvider:i,_windowTime:s}=this;t||(o.push(e),!n&&o.push(i.now()+s)),this._trimBuffer(),super.next(e);}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let t=this._innerSubscribe(e),{_infiniteTimeWindow:o,_buffer:n}=this,i=n.slice();for(let s=0;s<i.length&&!e.closed;s+=o?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),t}_trimBuffer(){let{_bufferSize:e,_timestampProvider:t,_buffer:o,_infiniteTimeWindow:n}=this,i=(n?1:2)*e;if(e<Infinity&&i<o.length&&o.splice(0,o.length-i),!n){let s=t.now(),c=0;for(let f=1;f<o.length&&o[f]<=s;f+=2)c=f;c&&o.splice(0,c+1);}}};var kr$2=R$2(r=>function(){r(this),this.name=`EmptyError`,this.message=`no elements in sequence`;});function le$2(r,e){return new Promise((o,n)=>{let i=new O({next:s=>{o(s),i.unsubscribe();},error:n,complete:()=>{n(new kr$2);}});r.subscribe(i);})}function ue(r){return u$1(r?.lift)}function p(r){return e=>{if(ue(e))return e.lift(function(t){try{return r(t,this)}catch(o){this.error(o);}});throw new TypeError(`Unable to lift unknown Observable type`)}}function a$2(r,e,t,o,n){return new Er$1(r,e,t,o,n)}var Er$1=class Er extends j$1{constructor(e,t,o,n,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=t?function(c){try{t(c);}catch(f){e.error(f);}}:super._next,this._error=n?function(c){try{n(c);}catch(f){e.error(f);}finally{this.unsubscribe();}}:super._error,this._complete=o?function(){try{o();}catch(c){e.error(c);}finally{this.unsubscribe();}}:super._complete;}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:t}=this;super.unsubscribe(),!t&&((e=this.onFinalize)===null||e===void 0||e.call(this));}}};function q$2(r,e){return p((t,o)=>{let n=0;t.subscribe(a$2(o,i=>{o.next(r.call(e,i,n++));}));})}function Dr$1(r,e,t,o){function n(i){return i instanceof t?i:new t(function(s){s(i);})}return new(t||(t=Promise))(function(i,s){function c(b){try{l(o.next(b));}catch(y){s(y);}}function f(b){try{l(o.throw(b));}catch(y){s(y);}}function l(b){b.done?i(b.value):n(b.value).then(c,f);}l((o=o.apply(r,[])).next());})}function Ur$1(r){var e=typeof Symbol==`function`&&Symbol.iterator,t=e&&r[e],o=0;if(t)return t.call(r);if(r&&typeof r.length==`number`)return {next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(e?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function F$1(r){return this instanceof F$1?(this.v=r,this):new F$1(r)}function Wr$1(r,e,t){if(!Symbol.asyncIterator)throw new TypeError(`Symbol.asyncIterator is not defined.`);var o=t.apply(r,e||[]),n,i=[];return n=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),c(`next`),c(`throw`),c(`return`,s),n[Symbol.asyncIterator]=function(){return this},n;function s(d){return function(x){return Promise.resolve(x).then(d,y)}}function c(d,x){o[d]&&(n[d]=function(S){return new Promise(function(B,g){i.push([d,S,B,g])>1||f(d,S);})},x&&(n[d]=x(n[d])));}function f(d,x){try{l(o[d](x));}catch(S){E(i[0][3],S);}}function l(d){d.value instanceof F$1?Promise.resolve(d.value.v).then(b,y):E(i[0][2],d);}function b(d){f(`next`,d);}function y(d){f(`throw`,d);}function E(d,x){d(x),i.shift(),i.length&&f(i[0][0],i[0][1]);}}function zr(r){if(!Symbol.asyncIterator)throw new TypeError(`Symbol.asyncIterator is not defined.`);var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Ur$1==`function`?Ur$1(r):r[Symbol.iterator](),t={},o(`next`),o(`throw`),o(`return`),t[Symbol.asyncIterator]=function(){return this},t);function o(i){t[i]=r[i]&&function(s){return new Promise(function(c,f){s=r[i](s),n(c,f,s.done,s.value);})};}function n(i,s,c,f){Promise.resolve(f).then(function(l){i({value:l,done:c});},s);}}var D=r=>r&&typeof r.length==`number`&&typeof r!=`function`;function X(r){return u$1(r?.then)}function Z(r){return u$1(r[k$1])}function rr$2(r){return Symbol.asyncIterator&&u$1(r?.[Symbol.asyncIterator])}function er$2(r){return new TypeError(`You provided ${r!==null&&typeof r==`object`?`an invalid object`:`'${r}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function pe$1(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var tr$2=pe$1();function or$2(r){return u$1(r?.[tr$2])}function nr$1(r){return Wr$1(this,arguments,function*(){let t=r.getReader();try{for(;;){let{value:o,done:n}=yield F$1(t.read());if(n)return yield F$1(void 0);yield yield F$1(o);}}finally{t.releaseLock();}})}function ir$2(r){return u$1(r?.getReader)}function h$1(r){if(r instanceof m)return r;if(r!=null){if(Z(r))return ae$2(r);if(D(r))return me$1(r);if(X(r))return de$2(r);if(rr$2(r))return Vr$1(r);if(or$2(r))return he$1(r);if(ir$2(r))return xe$1(r)}throw er$2(r)}function ae$2(r){return new m(e=>{let t=r[k$1]();if(u$1(t.subscribe))return t.subscribe(e);throw new TypeError(`Provided object does not correctly implement Symbol.observable`)})}function me$1(r){return new m(e=>{for(let t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete();})}function de$2(r){return new m(e=>{r.then(t=>{e.closed||(e.next(t),e.complete());},t=>e.error(t)).then(null,H$2);})}function he$1(r){return new m(e=>{for(let t of r)if(e.next(t),e.closed)return;e.complete();})}function Vr$1(r){return new m(e=>{be$2(r,e).catch(t=>e.error(t));})}function xe$1(r){return Vr$1(nr$1(r))}function be$2(r,e){var t,o,n,i;return Dr$1(this,void 0,void 0,function*(){try{for(t=zr(r);o=yield t.next(),!o.done;){let s=o.value;if(e.next(s),e.closed)return}}catch(s){n={error:s};}finally{try{o&&!o.done&&(i=t.return)&&(yield i.call(t));}finally{if(n)throw n.error}}e.complete();})}function ye$2(r){return new m(e=>{h$1(r()).subscribe(e);})}function _(r,e,t,o=0,n=false){let i=e.schedule(function(){t(),n?r.add(this.schedule(null,o)):this.unsubscribe();},o);if(r.add(i),!n)return i}function Yr(r,e,t,o,n,i,s,c){let f=[],l=0,b=0,y=false,E=()=>{y&&!f.length&&!l&&e.complete();},d=S=>l<o?x(S):f.push(S),x=S=>{l++;let B=false;h$1(t(S,b++)).subscribe(a$2(e,g=>{e.next(g);},()=>{B=true;},void 0,()=>{if(B)try{for(l--;f.length&&l<o;){let g=f.shift();s?_(e,s,()=>x(g)):x(g);}E();}catch(g){e.error(g);}}));};return r.subscribe(a$2(e,d,()=>{y=true,E();})),()=>{}}function N$2(r,e,t=Infinity){return u$1(e)?N$2((o,n)=>q$2((i,s)=>e(o,i,n,s))(h$1(r(o,n))),t):(typeof e==`number`&&(t=e),p((o,n)=>Yr(o,n,r,t)))}function sr$2(r=Infinity){return N$2(T$1,r)}var fr$2=new m(r=>r.complete());function cr$2(r){return r&&u$1(r.schedule)}function qr(r){return r[r.length-1]}function I$1(r){return cr$2(qr(r))?r.pop():void 0}function Nr$1(r,e){return typeof qr(r)==`number`?r.pop():e}function lr$2(r,e=0){return p((t,o)=>{t.subscribe(a$2(o,n=>_(o,r,()=>o.next(n),e),()=>_(o,r,()=>o.complete(),e),n=>_(o,r,()=>o.error(n),e)));})}function ur$1(r,e=0){return p((t,o)=>{o.add(r.schedule(()=>t.subscribe(o),e));})}function $r(r,e){return h$1(r).pipe(ur$1(e),lr$2(e))}function Br$1(r,e){return h$1(r).pipe(ur$1(e),lr$2(e))}function Gr(r,e){return new m(t=>{let o=0;return e.schedule(function(){o===r.length?t.complete():(t.next(r[o++]),t.closed||this.schedule());})})}function Kr(r,e){return new m(t=>{let o;return _(t,e,()=>{o=r[tr$2](),_(t,e,()=>{let n,i;try{({value:n,done:i}=o.next());}catch(s){t.error(s);return}i?t.complete():t.next(n);},0,true);}),()=>u$1(o?.return)&&o.return()})}function pr$2(r,e){if(!r)throw new Error(`Iterable cannot be null`);return new m(t=>{_(t,e,()=>{let o=r[Symbol.asyncIterator]();_(t,e,()=>{o.next().then(n=>{n.done?t.complete():t.next(n.value);});},0,true);});})}function Hr(r,e){return pr$2(nr$1(r),e)}function Jr(r,e){if(r!=null){if(Z(r))return $r(r,e);if(D(r))return Gr(r,e);if(X(r))return Br$1(r,e);if(rr$2(r))return pr$2(r,e);if(or$2(r))return Kr(r,e);if(ir$2(r))return Hr(r,e)}throw er$2(r)}function W$1(r,e){return e?Jr(r,e):h$1(r)}function ve$2(...r){let e=I$1(r),t=Nr$1(r,Infinity),o=r;return o.length?o.length===1?h$1(o[0]):sr$2(t)(W$1(o,e)):fr$2}function Nn$1(r){return r<=0?()=>fr$2:p((e,t)=>{let o=0;e.subscribe(a$2(t,n=>{++o<=r&&(t.next(n),r<=o&&t.complete());}));})}function Qr(){return sr$2(1)}function Or$1(...r){return Qr()(W$1(r,I$1(r)))}function _e(...r){let e=I$1(r);return p((t,o)=>{(e?Or$1(r,t,e):Or$1(r,t)).subscribe(o);})}function ii$1(r,e){return p((t,o)=>{let n=null,i=0,s=!1,c=()=>s&&!n&&o.complete();t.subscribe(a$2(o,f=>{n?.unsubscribe();let l=0,b=i++;h$1(r(f,b)).subscribe(n=a$2(o,y=>o.next(e?e(f,y,b,l++):y),()=>{n=null,c();}));},()=>{s=!0,c();}));})}function pi$1(r){return p((e,t)=>{h$1(r).subscribe(a$2(t,()=>t.complete(),V$1)),!t.closed&&e.subscribe(t);})}function bi$2(r,e,t){let o=u$1(r)||e||t?{next:r,error:e,complete:t}:r;return o?p((n,i)=>{var s;(s=o.subscribe)===null||s===void 0||s.call(o);let c=!0;n.subscribe(a$2(i,f=>{var l;(l=o.next)===null||l===void 0||l.call(o,f),i.next(f);},()=>{var f;c=!1,(f=o.complete)===null||f===void 0||f.call(o),i.complete();},f=>{var l;c=!1,(l=o.error)===null||l===void 0||l.call(o,f),i.error(f);},()=>{var f,l;c&&((f=o.unsubscribe)===null||f===void 0||f.call(o)),(l=o.finalize)===null||l===void 0||l.call(o);}));}):T$1}var ar$2=class ar extends v{constructor(e,t){super();}schedule(e,t=0){return this}};var $$1={setInterval(r,e,...t){let{delegate:o}=$$1;return o?.setInterval?o.setInterval(r,e,...t):setInterval(r,e,...t)},clearInterval(r){return (clearInterval)(r)},delegate:void 0};var mr$2=class mr extends ar$2{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=false;}schedule(e,t=0){var o;if(this.closed)return this;this.state=e;let n=this.id,i=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=true,this.delay=t,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(i,this.id,t),this}requestAsyncId(e,t,o=0){return $$1.setInterval(e.flush.bind(e,this),o)}recycleAsyncId(e,t,o=0){if(o!=null&&this.delay===o&&this.pending===false)return t;t!=null&&$$1.clearInterval(t);}execute(e,t){if(this.closed)return new Error(`executing a cancelled action`);this.pending=false;let o=this._execute(e,t);if(o)return o;this.pending===false&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null));}_execute(e,t){let o=false,n;try{this.work(e);}catch(i){o=true,n=i||new Error(`Scheduled action threw falsy error`);}if(o)return this.unsubscribe(),n}unsubscribe(){if(!this.closed){let{id:e,scheduler:t}=this,{actions:o}=t;this.work=this.state=this.scheduler=null,this.pending=false,P$1(o,this),e!=null&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe();}}};var z$1=class r{constructor(e,t=r.now){this.schedulerActionCtor=e,this.now=t;}schedule(e,t=0,o){return new this.schedulerActionCtor(this,e).schedule(o,t)}};z$1.now=Y$1.now;var dr$2=class dr extends z$1{constructor(e,t=z$1.now){super(e,t),this.actions=[],this._active=false;}flush(e){let{actions:t}=this;if(this._active){t.push(e);return}let o;this._active=true;do if(o=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=false,o){for(;e=t.shift();)e.unsubscribe();throw o}}};var C$1=new dr$2(mr$2),Xr=C$1;function Zr(r,e){return p((t,o)=>{let{leading:n=!0,trailing:i=!1}=e??{},s=!1,c=null,f=null,l=!1,b=()=>{f?.unsubscribe(),f=null,i&&(d(),l&&o.complete());},y=()=>{f=null,l&&o.complete();},E=x=>f=h$1(r(x)).subscribe(a$2(o,b,y)),d=()=>{if(s){s=!1;let x=c;c=null,o.next(x),!l&&E(x);}};t.subscribe(a$2(o,x=>{s=!0,c=x,!(f&&!f.closed)&&(n?d():E(x));},()=>{l=!0,!(i&&s&&f&&!f.closed)&&o.complete();}));})}function re$2(r){return r instanceof Date&&!isNaN(r)}function hr$2(r=0,e,t=Xr){let o=-1;return e!=null&&(cr$2(e)?t=e:o=e),new m(n=>{let i=re$2(r)?+r-t.now():r;i<0&&(i=0);let s=0;return t.schedule(function(){n.closed||(n.next(s++),0<=o?this.schedule(void 0,o):n.complete());},i)})}function we$2(r,e=C$1,t){let o=hr$2(r,e);return Zr(()=>o,t)}function Se$2(...r){return W$1(r,I$1(r))}var{isArray:ge$1}=Array;function Ee$2(r,e){return ge$1(e)?r(...e):r(e)}function xr$2(r){return q$2(e=>Ee$2(r,e))}var Oe=[`addListener`,`removeListener`],Te$1=[`addEventListener`,`removeEventListener`],Ie$2=[`on`,`off`];function Tr$2(r,e,t,o){if(u$1(t)&&(o=t,t=void 0),o)return Tr$2(r,e,t).pipe(xr$2(o));let[n,i]=je$2(r)?Te$1.map(s=>c=>r[s](e,c,t)):Pe(r)?Oe.map(ee(r,e)):Ae(r)?Ie$2.map(ee(r,e)):[];if(!n&&D(r))return N$2(s=>Tr$2(s,e,t))(h$1(r));if(!n)throw new TypeError(`Invalid event target`);return new m(s=>{let c=(...f)=>s.next(1<f.length?f:f[0]);return n(c),()=>i(c)})}function ee(r,e){return t=>o=>r[t](e,o)}function Pe(r){return u$1(r.addListener)&&u$1(r.removeListener)}function Ae(r){return u$1(r.on)&&u$1(r.off)}function je$2(r){return u$1(r.addEventListener)&&u$1(r.removeEventListener)}function te$2(r,e,t){return t?te$2(r,e).pipe(xr$2(t)):new m(o=>{let n=(...s)=>o.next(s.length===1?s[0]:s),i=r(n);return u$1(e)?()=>e(n,i):void 0})}function Ir$2(r,e){return p((t,o)=>{let n=0;t.subscribe(a$2(o,i=>r.call(e,i,n++)&&o.next(i)));})}function oe$2(r){return p((e,t)=>{let o=!1,n=null,i=null,s=!1,c=()=>{if(i?.unsubscribe(),i=null,o){o=!1;let l=n;n=null,t.next(l);}s&&t.complete();},f=()=>{i=null,s&&t.complete();};e.subscribe(a$2(t,l=>{o=!0,n=l,i||h$1(r(l)).subscribe(i=a$2(t,c,f));},()=>{s=!0,(!o||!i||i.closed)&&t.complete();}));})}function vs(r,e=C$1){return oe$2(()=>hr$2(r,e))}function Fe$2(r,e=C$1){return p((t,o)=>{let n=null,i=null,s=null,c=()=>{if(n){n.unsubscribe(),n=null;let l=i;i=null,o.next(l);}};function f(){let l=s+r,b=e.now();if(b<l){n=this.schedule(void 0,l-b),o.add(n);return}c();}t.subscribe(a$2(o,l=>{i=l,s=e.now(),n||(n=e.schedule(f,r),o.add(n));},()=>{c(),o.complete();},void 0,()=>{i=n=null;}));})}function Ps(r,e=T$1){return r=r??Ce$1,p((t,o)=>{let n,i=!0;t.subscribe(a$2(o,s=>{let c=e(s);(i||!r(n,c))&&(i=!1,n=c,o.next(s));}));})}function Ce$1(r,e){return r===e}function Fs(r){return Ir$2((e,t)=>r<=t)}
|
|
35
|
+
`)}`:``,this.name=`UnsubscriptionError`,this.errors=t;});function P(r,e){if(r){let t=r.indexOf(e);0<=t&&r.splice(t,1);}}var v=class r{constructor(e){this.initialTeardown=e,this.closed=false,this._parentage=null,this._finalizers=null;}unsubscribe(){let e;if(!this.closed){this.closed=true;let{_parentage:t}=this;if(t)if(this._parentage=null,Array.isArray(t))for(let i of t)i.remove(this);else t.remove(this);let{initialTeardown:o}=this;if(u(o))try{o();}catch(i){e=i instanceof G$1?i.errors:[i];}let{_finalizers:n}=this;if(n){this._finalizers=null;for(let i of n)try{Pr$2(i);}catch(s){e=e??[],s instanceof G$1?e=[...e,...s.errors]:e.push(s);}}if(e)throw new G$1(e)}}add(e){var t;if(e&&e!==this)if(this.closed)Pr$2(e);else {if(e instanceof r){if(e.closed||e._hasParent(this))return;e._addParent(this);}(this._finalizers=(t=this._finalizers)!==null&&t!==void 0?t:[]).push(e);}}_hasParent(e){let{_parentage:t}=this;return t===e||Array.isArray(t)&&t.includes(e)}_addParent(e){let{_parentage:t}=this;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e;}_removeParent(e){let{_parentage:t}=this;t===e?this._parentage=null:Array.isArray(t)&&P(t,e);}remove(e){let{_finalizers:t}=this;t&&P(t,e),e instanceof r&&e._removeParent(this);}};v.EMPTY=(()=>{let r=new v;return r.closed=true,r})();var br$1=v.EMPTY;function K$2(r){return r instanceof v||r&&`closed`in r&&u(r.remove)&&u(r.add)&&u(r.unsubscribe)}function Pr$2(r){u(r)?r():r.unsubscribe();}var w$1={Promise:void 0};var L$2={setTimeout(r,e,...t){return setTimeout(r,e,...t)},clearTimeout(r){return (clearTimeout)(r)},delegate:void 0};function H$2(r){L$2.setTimeout(()=>{throw r});}function V$1(){}function M$2(r){r();}var j$1=class j extends v{constructor(e){super(),this.isStopped=false,e?(this.destination=e,K$2(e)&&e.add(this)):this.destination=se$1;}static create(e,t,o){return new O(e,t,o)}next(e){this.isStopped?_r$2():this._next(e);}error(e){this.isStopped?_r$2():(this.isStopped=true,this._error(e));}complete(){this.isStopped?_r$2():(this.isStopped=true,this._complete());}unsubscribe(){this.closed||(this.isStopped=true,super.unsubscribe(),this.destination=null);}_next(e){this.destination.next(e);}_error(e){try{this.destination.error(e);}finally{this.unsubscribe();}}_complete(){try{this.destination.complete();}finally{this.unsubscribe();}}};var wr$1=class wr{constructor(e){this.partialObserver=e;}next(e){let{partialObserver:t}=this;if(t.next)try{t.next(e);}catch(o){J(o);}}error(e){let{partialObserver:t}=this;if(t.error)try{t.error(e);}catch(o){J(o);}else J(e);}complete(){let{partialObserver:e}=this;if(e.complete)try{e.complete();}catch(t){J(t);}}},O=class extends j$1{constructor(e,t,o){super();let n;if(u(e)||!e)n={next:e??void 0,error:t??void 0,complete:o??void 0};else {n=e;}this.destination=new wr$1(n);}};function J(r){H$2(r);}function ie$1(r){throw r}function _r$2(r,e){}var se$1={closed:true,next:V$1,error:ie$1,complete:V$1};var k$1=typeof Symbol==`function`&&Symbol.observable||`@@observable`;function T$1(r){return r}function Rr$2(r){return r.length===0?T$1:r.length===1?r[0]:function(t){return r.reduce((o,n)=>n(o),t)}}var m$1=(()=>{class r{constructor(t){t&&(this._subscribe=t);}lift(t){let o=new r;return o.source=this,o.operator=t,o}subscribe(t,o,n){let i=ce$2(t)?t:new O(t,o,n);return M$2(()=>{let{operator:s,source:c}=this;i.add(s?s.call(i,c):c?this._subscribe(i):this._trySubscribe(i));}),i}_trySubscribe(t){try{return this._subscribe(t)}catch(o){t.error(o);}}forEach(t,o){return o=Lr$1(o),new o((n,i)=>{let s=new O({next:c=>{try{t(c);}catch(f){i(f),s.unsubscribe();}},error:i,complete:n});this.subscribe(s);})}_subscribe(t){var o;return (o=this.source)===null||o===void 0?void 0:o.subscribe(t)}[k$1](){return this}pipe(...t){return Rr$2(t)(this)}toPromise(t){return t=Lr$1(t),new t((o,n)=>{let i;this.subscribe(s=>i=s,s=>n(s),()=>o(i));})}}return r.create=e=>new r(e),r})();function Lr$1(r){var e;return (e=r??w$1.Promise)!==null&&e!==void 0?e:Promise}function fe(r){return r&&u(r.next)&&u(r.error)&&u(r.complete)}function ce$2(r){return r&&r instanceof j$1||fe(r)&&K$2(r)}var Mr$1=R$2(r=>function(){r(this),this.name=`ObjectUnsubscribedError`,this.message=`object unsubscribed`;});var U$1=(()=>{class r extends m$1{constructor(){super(),this.closed=false,this.currentObservers=null,this.observers=[],this.isStopped=false,this.hasError=false,this.thrownError=null;}lift(t){let o=new Q(this,this);return o.operator=t,o}_throwIfClosed(){if(this.closed)throw new Mr$1}next(t){M$2(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let o of this.currentObservers)o.next(t);}});}error(t){M$2(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=true,this.thrownError=t;let{observers:o}=this;for(;o.length;)o.shift().error(t);}});}complete(){M$2(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=true;let{observers:t}=this;for(;t.length;)t.shift().complete();}});}unsubscribe(){this.isStopped=this.closed=true,this.observers=this.currentObservers=null;}get observed(){var t;return ((t=this.observers)===null||t===void 0?void 0:t.length)>0}_trySubscribe(t){return this._throwIfClosed(),super._trySubscribe(t)}_subscribe(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)}_innerSubscribe(t){let{hasError:o,isStopped:n,observers:i}=this;return o||n?br$1:(this.currentObservers=null,i.push(t),new v(()=>{this.currentObservers=null,P(i,t);}))}_checkFinalizedStatuses(t){let{hasError:o,thrownError:n,isStopped:i}=this;o?t.error(n):i&&t.complete();}asObservable(){let t=new m$1;return t.source=this,t}}return r.create=(e,t)=>new Q(e,t),r})(),Q=class extends U$1{constructor(e,t){super(),this.destination=e,this.source=t;}next(e){var t,o;(o=(t=this.destination)===null||t===void 0?void 0:t.next)===null||o===void 0||o.call(t,e);}error(e){var t,o;(o=(t=this.destination)===null||t===void 0?void 0:t.error)===null||o===void 0||o.call(t,e);}complete(){var e,t;(t=(e=this.destination)===null||e===void 0?void 0:e.complete)===null||t===void 0||t.call(e);}_subscribe(e){var t,o;return (o=(t=this.source)===null||t===void 0?void 0:t.subscribe(e))!==null&&o!==void 0?o:br$1}};var Sr$1=class Sr extends U$1{constructor(e){super(),this._value=e;}get value(){return this.getValue()}_subscribe(e){let t=super._subscribe(e);return !t.closed&&e.next(this._value),t}getValue(){let{hasError:e,thrownError:t,_value:o}=this;if(e)throw t;return this._throwIfClosed(),o}next(e){super.next(this._value=e);}};var Y$1={now(){return (Y$1.delegate||Date).now()},delegate:void 0};var gr$2=class gr extends U$1{constructor(e=Infinity,t=Infinity,o=Y$1){super(),this._bufferSize=e,this._windowTime=t,this._timestampProvider=o,this._buffer=[],this._infiniteTimeWindow=true,this._infiniteTimeWindow=t===Infinity,this._bufferSize=Math.max(1,e),this._windowTime=Math.max(1,t);}next(e){let{isStopped:t,_buffer:o,_infiniteTimeWindow:n,_timestampProvider:i,_windowTime:s}=this;t||(o.push(e),!n&&o.push(i.now()+s)),this._trimBuffer(),super.next(e);}_subscribe(e){this._throwIfClosed(),this._trimBuffer();let t=this._innerSubscribe(e),{_infiniteTimeWindow:o,_buffer:n}=this,i=n.slice();for(let s=0;s<i.length&&!e.closed;s+=o?1:2)e.next(i[s]);return this._checkFinalizedStatuses(e),t}_trimBuffer(){let{_bufferSize:e,_timestampProvider:t,_buffer:o,_infiniteTimeWindow:n}=this,i=(n?1:2)*e;if(e<Infinity&&i<o.length&&o.splice(0,o.length-i),!n){let s=t.now(),c=0;for(let f=1;f<o.length&&o[f]<=s;f+=2)c=f;c&&o.splice(0,c+1);}}};var kr$2=R$2(r=>function(){r(this),this.name=`EmptyError`,this.message=`no elements in sequence`;});function le$2(r,e){return new Promise((o,n)=>{let i=new O({next:s=>{o(s),i.unsubscribe();},error:n,complete:()=>{n(new kr$2);}});r.subscribe(i);})}function ue$1(r){return u(r?.lift)}function p(r){return e=>{if(ue$1(e))return e.lift(function(t){try{return r(t,this)}catch(o){this.error(o);}});throw new TypeError(`Unable to lift unknown Observable type`)}}function a$2(r,e,t,o,n){return new Er$1(r,e,t,o,n)}var Er$1=class Er extends j$1{constructor(e,t,o,n,i,s){super(e),this.onFinalize=i,this.shouldUnsubscribe=s,this._next=t?function(c){try{t(c);}catch(f){e.error(f);}}:super._next,this._error=n?function(c){try{n(c);}catch(f){e.error(f);}finally{this.unsubscribe();}}:super._error,this._complete=o?function(){try{o();}catch(c){e.error(c);}finally{this.unsubscribe();}}:super._complete;}unsubscribe(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:t}=this;super.unsubscribe(),!t&&((e=this.onFinalize)===null||e===void 0||e.call(this));}}};function q$2(r,e){return p((t,o)=>{let n=0;t.subscribe(a$2(o,i=>{o.next(r.call(e,i,n++));}));})}function Dr$1(r,e,t,o){function n(i){return i instanceof t?i:new t(function(s){s(i);})}return new(t||(t=Promise))(function(i,s){function c(b){try{l(o.next(b));}catch(y){s(y);}}function f(b){try{l(o.throw(b));}catch(y){s(y);}}function l(b){b.done?i(b.value):n(b.value).then(c,f);}l((o=o.apply(r,[])).next());})}function Ur$1(r){var e=typeof Symbol==`function`&&Symbol.iterator,t=e&&r[e],o=0;if(t)return t.call(r);if(r&&typeof r.length==`number`)return {next:function(){return r&&o>=r.length&&(r=void 0),{value:r&&r[o++],done:!r}}};throw new TypeError(e?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function F$1(r){return this instanceof F$1?(this.v=r,this):new F$1(r)}function Wr$1(r,e,t){if(!Symbol.asyncIterator)throw new TypeError(`Symbol.asyncIterator is not defined.`);var o=t.apply(r,e||[]),n,i=[];return n=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),c(`next`),c(`throw`),c(`return`,s),n[Symbol.asyncIterator]=function(){return this},n;function s(d){return function(x){return Promise.resolve(x).then(d,y)}}function c(d,x){o[d]&&(n[d]=function(S){return new Promise(function(B,g){i.push([d,S,B,g])>1||f(d,S);})},x&&(n[d]=x(n[d])));}function f(d,x){try{l(o[d](x));}catch(S){E(i[0][3],S);}}function l(d){d.value instanceof F$1?Promise.resolve(d.value.v).then(b,y):E(i[0][2],d);}function b(d){f(`next`,d);}function y(d){f(`throw`,d);}function E(d,x){d(x),i.shift(),i.length&&f(i[0][0],i[0][1]);}}function zr(r){if(!Symbol.asyncIterator)throw new TypeError(`Symbol.asyncIterator is not defined.`);var e=r[Symbol.asyncIterator],t;return e?e.call(r):(r=typeof Ur$1==`function`?Ur$1(r):r[Symbol.iterator](),t={},o(`next`),o(`throw`),o(`return`),t[Symbol.asyncIterator]=function(){return this},t);function o(i){t[i]=r[i]&&function(s){return new Promise(function(c,f){s=r[i](s),n(c,f,s.done,s.value);})};}function n(i,s,c,f){Promise.resolve(f).then(function(l){i({value:l,done:c});},s);}}var D=r=>r&&typeof r.length==`number`&&typeof r!=`function`;function X(r){return u(r?.then)}function Z(r){return u(r[k$1])}function rr$2(r){return Symbol.asyncIterator&&u(r?.[Symbol.asyncIterator])}function er$2(r){return new TypeError(`You provided ${r!==null&&typeof r==`object`?`an invalid object`:`'${r}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function pe$1(){return typeof Symbol!=`function`||!Symbol.iterator?`@@iterator`:Symbol.iterator}var tr$2=pe$1();function or$2(r){return u(r?.[tr$2])}function nr$1(r){return Wr$1(this,arguments,function*(){let t=r.getReader();try{for(;;){let{value:o,done:n}=yield F$1(t.read());if(n)return yield F$1(void 0);yield yield F$1(o);}}finally{t.releaseLock();}})}function ir$2(r){return u(r?.getReader)}function h$1(r){if(r instanceof m$1)return r;if(r!=null){if(Z(r))return ae$2(r);if(D(r))return me$1(r);if(X(r))return de$2(r);if(rr$2(r))return Vr$1(r);if(or$2(r))return he$1(r);if(ir$2(r))return xe$1(r)}throw er$2(r)}function ae$2(r){return new m$1(e=>{let t=r[k$1]();if(u(t.subscribe))return t.subscribe(e);throw new TypeError(`Provided object does not correctly implement Symbol.observable`)})}function me$1(r){return new m$1(e=>{for(let t=0;t<r.length&&!e.closed;t++)e.next(r[t]);e.complete();})}function de$2(r){return new m$1(e=>{r.then(t=>{e.closed||(e.next(t),e.complete());},t=>e.error(t)).then(null,H$2);})}function he$1(r){return new m$1(e=>{for(let t of r)if(e.next(t),e.closed)return;e.complete();})}function Vr$1(r){return new m$1(e=>{be$2(r,e).catch(t=>e.error(t));})}function xe$1(r){return Vr$1(nr$1(r))}function be$2(r,e){var t,o,n,i;return Dr$1(this,void 0,void 0,function*(){try{for(t=zr(r);o=yield t.next(),!o.done;){let s=o.value;if(e.next(s),e.closed)return}}catch(s){n={error:s};}finally{try{o&&!o.done&&(i=t.return)&&(yield i.call(t));}finally{if(n)throw n.error}}e.complete();})}function ye$2(r){return new m$1(e=>{h$1(r()).subscribe(e);})}function _(r,e,t,o=0,n=false){let i=e.schedule(function(){t(),n?r.add(this.schedule(null,o)):this.unsubscribe();},o);if(r.add(i),!n)return i}function Yr(r,e,t,o,n,i,s,c){let f=[],l=0,b=0,y=false,E=()=>{y&&!f.length&&!l&&e.complete();},d=S=>l<o?x(S):f.push(S),x=S=>{l++;let B=false;h$1(t(S,b++)).subscribe(a$2(e,g=>{e.next(g);},()=>{B=true;},void 0,()=>{if(B)try{for(l--;f.length&&l<o;){let g=f.shift();s?_(e,s,()=>x(g)):x(g);}E();}catch(g){e.error(g);}}));};return r.subscribe(a$2(e,d,()=>{y=true,E();})),()=>{}}function N$2(r,e,t=Infinity){return u(e)?N$2((o,n)=>q$2((i,s)=>e(o,i,n,s))(h$1(r(o,n))),t):(typeof e==`number`&&(t=e),p((o,n)=>Yr(o,n,r,t)))}function sr$2(r=Infinity){return N$2(T$1,r)}var fr$2=new m$1(r=>r.complete());function cr$2(r){return r&&u(r.schedule)}function qr(r){return r[r.length-1]}function I$1(r){return cr$2(qr(r))?r.pop():void 0}function Nr$1(r,e){return typeof qr(r)==`number`?r.pop():e}function lr$2(r,e=0){return p((t,o)=>{t.subscribe(a$2(o,n=>_(o,r,()=>o.next(n),e),()=>_(o,r,()=>o.complete(),e),n=>_(o,r,()=>o.error(n),e)));})}function ur$2(r,e=0){return p((t,o)=>{o.add(r.schedule(()=>t.subscribe(o),e));})}function $r(r,e){return h$1(r).pipe(ur$2(e),lr$2(e))}function Br$1(r,e){return h$1(r).pipe(ur$2(e),lr$2(e))}function Gr(r,e){return new m$1(t=>{let o=0;return e.schedule(function(){o===r.length?t.complete():(t.next(r[o++]),t.closed||this.schedule());})})}function Kr(r,e){return new m$1(t=>{let o;return _(t,e,()=>{o=r[tr$2](),_(t,e,()=>{let n,i;try{({value:n,done:i}=o.next());}catch(s){t.error(s);return}i?t.complete():t.next(n);},0,true);}),()=>u(o?.return)&&o.return()})}function pr$2(r,e){if(!r)throw new Error(`Iterable cannot be null`);return new m$1(t=>{_(t,e,()=>{let o=r[Symbol.asyncIterator]();_(t,e,()=>{o.next().then(n=>{n.done?t.complete():t.next(n.value);});},0,true);});})}function Hr(r,e){return pr$2(nr$1(r),e)}function Jr(r,e){if(r!=null){if(Z(r))return $r(r,e);if(D(r))return Gr(r,e);if(X(r))return Br$1(r,e);if(rr$2(r))return pr$2(r,e);if(or$2(r))return Kr(r,e);if(ir$2(r))return Hr(r,e)}throw er$2(r)}function W$1(r,e){return e?Jr(r,e):h$1(r)}function ve$2(...r){let e=I$1(r),t=Nr$1(r,Infinity),o=r;return o.length?o.length===1?h$1(o[0]):sr$2(t)(W$1(o,e)):fr$2}function Nn$1(r){return r<=0?()=>fr$2:p((e,t)=>{let o=0;e.subscribe(a$2(t,n=>{++o<=r&&(t.next(n),r<=o&&t.complete());}));})}function Qr(){return sr$2(1)}function Or$1(...r){return Qr()(W$1(r,I$1(r)))}function _e(...r){let e=I$1(r);return p((t,o)=>{(e?Or$1(r,t,e):Or$1(r,t)).subscribe(o);})}function ii$1(r,e){return p((t,o)=>{let n=null,i=0,s=!1,c=()=>s&&!n&&o.complete();t.subscribe(a$2(o,f=>{n?.unsubscribe();let l=0,b=i++;h$1(r(f,b)).subscribe(n=a$2(o,y=>o.next(e?e(f,y,b,l++):y),()=>{n=null,c();}));},()=>{s=!0,c();}));})}function pi$1(r){return p((e,t)=>{h$1(r).subscribe(a$2(t,()=>t.complete(),V$1)),!t.closed&&e.subscribe(t);})}function bi$2(r,e,t){let o=u(r)||e||t?{next:r,error:e,complete:t}:r;return o?p((n,i)=>{var s;(s=o.subscribe)===null||s===void 0||s.call(o);let c=!0;n.subscribe(a$2(i,f=>{var l;(l=o.next)===null||l===void 0||l.call(o,f),i.next(f);},()=>{var f;c=!1,(f=o.complete)===null||f===void 0||f.call(o),i.complete();},f=>{var l;c=!1,(l=o.error)===null||l===void 0||l.call(o,f),i.error(f);},()=>{var f,l;c&&((f=o.unsubscribe)===null||f===void 0||f.call(o)),(l=o.finalize)===null||l===void 0||l.call(o);}));}):T$1}var ar$2=class ar extends v{constructor(e,t){super();}schedule(e,t=0){return this}};var $$1={setInterval(r,e,...t){let{delegate:o}=$$1;return o?.setInterval?o.setInterval(r,e,...t):setInterval(r,e,...t)},clearInterval(r){return (clearInterval)(r)},delegate:void 0};var mr$1=class mr extends ar$2{constructor(e,t){super(e,t),this.scheduler=e,this.work=t,this.pending=false;}schedule(e,t=0){var o;if(this.closed)return this;this.state=e;let n=this.id,i=this.scheduler;return n!=null&&(this.id=this.recycleAsyncId(i,n,t)),this.pending=true,this.delay=t,this.id=(o=this.id)!==null&&o!==void 0?o:this.requestAsyncId(i,this.id,t),this}requestAsyncId(e,t,o=0){return $$1.setInterval(e.flush.bind(e,this),o)}recycleAsyncId(e,t,o=0){if(o!=null&&this.delay===o&&this.pending===false)return t;t!=null&&$$1.clearInterval(t);}execute(e,t){if(this.closed)return new Error(`executing a cancelled action`);this.pending=false;let o=this._execute(e,t);if(o)return o;this.pending===false&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null));}_execute(e,t){let o=false,n;try{this.work(e);}catch(i){o=true,n=i||new Error(`Scheduled action threw falsy error`);}if(o)return this.unsubscribe(),n}unsubscribe(){if(!this.closed){let{id:e,scheduler:t}=this,{actions:o}=t;this.work=this.state=this.scheduler=null,this.pending=false,P(o,this),e!=null&&(this.id=this.recycleAsyncId(t,e,null)),this.delay=null,super.unsubscribe();}}};var z$1=class r{constructor(e,t=r.now){this.schedulerActionCtor=e,this.now=t;}schedule(e,t=0,o){return new this.schedulerActionCtor(this,e).schedule(o,t)}};z$1.now=Y$1.now;var dr$2=class dr extends z$1{constructor(e,t=z$1.now){super(e,t),this.actions=[],this._active=false;}flush(e){let{actions:t}=this;if(this._active){t.push(e);return}let o;this._active=true;do if(o=e.execute(e.state,e.delay))break;while(e=t.shift());if(this._active=false,o){for(;e=t.shift();)e.unsubscribe();throw o}}};var C$1=new dr$2(mr$1),Xr=C$1;function Zr(r,e){return p((t,o)=>{let{leading:n=!0,trailing:i=!1}=e??{},s=!1,c=null,f=null,l=!1,b=()=>{f?.unsubscribe(),f=null,i&&(d(),l&&o.complete());},y=()=>{f=null,l&&o.complete();},E=x=>f=h$1(r(x)).subscribe(a$2(o,b,y)),d=()=>{if(s){s=!1;let x=c;c=null,o.next(x),!l&&E(x);}};t.subscribe(a$2(o,x=>{s=!0,c=x,!(f&&!f.closed)&&(n?d():E(x));},()=>{l=!0,!(i&&s&&f&&!f.closed)&&o.complete();}));})}function re$2(r){return r instanceof Date&&!isNaN(r)}function hr$2(r=0,e,t=Xr){let o=-1;return e!=null&&(cr$2(e)?t=e:o=e),new m$1(n=>{let i=re$2(r)?+r-t.now():r;i<0&&(i=0);let s=0;return t.schedule(function(){n.closed||(n.next(s++),0<=o?this.schedule(void 0,o):n.complete());},i)})}function we$2(r,e=C$1,t){let o=hr$2(r,e);return Zr(()=>o,t)}function Se$2(...r){return W$1(r,I$1(r))}var{isArray:ge}=Array;function Ee$2(r,e){return ge(e)?r(...e):r(e)}function xr$2(r){return q$2(e=>Ee$2(r,e))}var Oe=[`addListener`,`removeListener`],Te$1=[`addEventListener`,`removeEventListener`],Ie$2=[`on`,`off`];function Tr$2(r,e,t,o){if(u(t)&&(o=t,t=void 0),o)return Tr$2(r,e,t).pipe(xr$2(o));let[n,i]=je$2(r)?Te$1.map(s=>c=>r[s](e,c,t)):Pe$1(r)?Oe.map(ee(r,e)):Ae(r)?Ie$2.map(ee(r,e)):[];if(!n&&D(r))return N$2(s=>Tr$2(s,e,t))(h$1(r));if(!n)throw new TypeError(`Invalid event target`);return new m$1(s=>{let c=(...f)=>s.next(1<f.length?f:f[0]);return n(c),()=>i(c)})}function ee(r,e){return t=>o=>r[t](e,o)}function Pe$1(r){return u(r.addListener)&&u(r.removeListener)}function Ae(r){return u(r.on)&&u(r.off)}function je$2(r){return u(r.addEventListener)&&u(r.removeEventListener)}function te$2(r,e,t){return t?te$2(r,e).pipe(xr$2(t)):new m$1(o=>{let n=(...s)=>o.next(s.length===1?s[0]:s),i=r(n);return u(e)?()=>e(n,i):void 0})}function Ir$2(r,e){return p((t,o)=>{let n=0;t.subscribe(a$2(o,i=>r.call(e,i,n++)&&o.next(i)));})}function oe$2(r){return p((e,t)=>{let o=!1,n=null,i=null,s=!1,c=()=>{if(i?.unsubscribe(),i=null,o){o=!1;let l=n;n=null,t.next(l);}s&&t.complete();},f=()=>{i=null,s&&t.complete();};e.subscribe(a$2(t,l=>{o=!0,n=l,i||h$1(r(l)).subscribe(i=a$2(t,c,f));},()=>{s=!0,(!o||!i||i.closed)&&t.complete();}));})}function vs(r,e=C$1){return oe$2(()=>hr$2(r,e))}function Fe$2(r,e=C$1){return p((t,o)=>{let n=null,i=null,s=null,c=()=>{if(n){n.unsubscribe(),n=null;let l=i;i=null,o.next(l);}};function f(){let l=s+r,b=e.now();if(b<l){n=this.schedule(void 0,l-b),o.add(n);return}c();}t.subscribe(a$2(o,l=>{i=l,s=e.now(),n||(n=e.schedule(f,r),o.add(n));},()=>{c(),o.complete();},void 0,()=>{i=n=null;}));})}function Ps(r,e=T$1){return r=r??Ce$1,p((t,o)=>{let n,i=!0;t.subscribe(a$2(o,s=>{let c=e(s);(i||!r(n,c))&&(i=!1,n=c,o.next(s));}));})}function Ce$1(r,e){return r===e}function Fs(r){return Ir$2((e,t)=>r<=t)}
|
|
36
36
|
|
|
37
|
-
var Fe$1=class Fe{constructor(e,t){this._startTime=e;this._triggerData=t;}intervals=[];selectedEmbeddedItems;renderer;closeCallback;inputFields=[];get startTime(){return this._startTime}get triggerData(){return this._triggerData}get inputs(){return this.inputFields}get rootClassName(){let e=this.triggerData.shortID??this.triggerData.id.slice(-6);return e===`test`&&(e=`test-`+this.startTime.getTime().toString()),`cooee-wrapper-`+e}get selectedItems(){return this.triggerData.items.filter(e=>e.selected.value)}get shouldGiveFBTDiscount(){let e=this.selectedItems.length;return this.triggerData.bundleConfig?.applyDiscountOnMinimum?this.triggerData.bundleConfig.applyDiscountOnMinimum<=e:e===this.triggerData.items.length}onClose(e){this.closeCallback=e;}closeInApp(e,t){t??={};let o=r$2({eventName:e,duration:(new Date().getTime()-this.startTime.getTime())/1e3},t);this.stopIntervals(),this.closeCallback&&this.closeCallback(o);}addInputField(e,t){this.inputFields.push({id:e,type:t,isValid:false});}updateValidation(e,t){this.inputFields.forEach(n=>{if(n.id===e){n.isValid=t;return}});}stopIntervals(){this.intervals.forEach(e=>clearInterval(e));}};var Qe=class extends wr$3{constructor(e){super(e);}};var ye$1=class ye extends wr$3{src;constructor(e){super(e),this.src=e.src;}};var ae$1=class ae extends wr$3{typo;constructor(e){super(e);let t=r$2(r$2({},e.f),e.typo);e.alg&&(t.ta=e.alg),e.c&&(t.tc=e.c),this.typo=new W$2(t);}get color(){return this.typography.tc}get typography(){return this.typo}};var Be$1=class Be extends ae$1{prs;constructor(e){super(e),this.prs=e.prs;}get parts(){return this.prs}};var Ve$1=class Ve{dd;hh;mm;ss;date;constructor(e){e??={},this.dd=e.dd??0,this.hh=e.hh??0,this.mm=e.mm??0,this.ss=e.ss??0,this.date=e.date?new Date(e.date):void 0;}start(e,t){let n=new Date;e===2?(n.setSeconds(n.getSeconds()+this.ss),n.setMinutes(n.getMinutes()+this.mm),n.setHours(n.getHours()+this.hh),n.setDate(n.getDate()+this.dd)):n=this.date??new Date;let o=window.setInterval(()=>{let i=new Date().getTime(),s=n.getTime()-i;if(s<1){clearInterval(o);return}t({days:Math.floor(s/(1e3*60*60*24)),hours:Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),minutes:Math.floor(s%(1e3*60*60)/(1e3*60)),seconds:Math.floor(s%(1e3*60)/1e3)});},1e3);return o}};var Rt$1=class Rt extends ae$1{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new Ve$1(e.timer),this.show=e.show??{day:true,hour:true,minute:true,second:true},this.horizontal=e.horizontal,this.lblPos=e.lblPos;}};var _t=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new y$1(e.c??{});}get text(){return this.txt}get color(){return this.c}};var ce$1=class ce extends ae$1{ph;constructor(e){super(e),this.ph=new _t(e.ph);}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}};var At=class extends ce$1{constructor(e){e??={},super(e);}};var Ot=class extends ce$1{};var Lt=class extends ce$1{};var kt$1=class kt extends ye$1{};var H$1=(function(r){return r[r.NONE=0]=`NONE`,r[r.STATIC=1]=`STATIC`,r[r.UNIQUE_FLAT=2]=`UNIQUE_FLAT`,r[r.UNIQUE_FLAT_ITEMS=3]=`UNIQUE_FLAT_ITEMS`,r[r.UNIQUE_FIXED_ITEMS=4]=`UNIQUE_FIXED_ITEMS`,r[r.UNIQUE_CHEAPEST_ITEM_FREE=5]=`UNIQUE_CHEAPEST_ITEM_FREE`,r[r.BXGY=6]=`BXGY`,r})(H$1||{});var te$1=class r{static of(e,t){return t!==void 0?new Array(e).fill(t):Array.from({length:e},(n,o)=>o)}static remove(e,t){let n=e.indexOf(t);return n===-1?false:(e.splice(n,1),true)}static swap(e,t,n){[e[t],e[n]]=[e[n],e[t]];}static sum(e,t){return e.reduce((n,o)=>n+Math.max(t?t(o):+o,0),0)}static unique(e,t){return e.filter((n,o,i)=>i.findIndex(s=>s[t]===n[t])===o)}static shuffle(e){let t=e.length;for(;t!=0;){let n=Math.floor(Math.random()*t);t--,r.swap(e,t,n);}}};var Rn=(()=>{class r{static toTitle(t){return t?this.titleCase(t.toLowerCase().split(/[_-]+/).join(` `)):``}static toSlug(t){return t?t.toLowerCase().replace(/[_-]+/,` `).replace(/[^\w ]+/g,``).replace(/ +/g,`-`):``}static toCamelCase(t){return t.toLowerCase().split(` `).map((n,o)=>o===0?n:n.charAt(0).toUpperCase()+n.slice(1)).join(``)}static format(t,...n){return t?.replace(/{(\d+)}/g,(o,i)=>{let s=n[i];return s!==void 0?s:o})}static chop(t,n){if(!(!t||!n))return t.length<=n?t:t.substring(0,n)}static titleCase=t=>t.replace(/(^|\s)\S/g,n=>n.toUpperCase())}return r})();var Nt=class{applyDiscountOnMinimum;constructor(e){this.applyDiscountOnMinimum=e.applyDiscountOnMinimum;}};var Ut=class{modifications;constructor(e={}){e.modifications?.length?this.modifications=e.modifications.map(t=>new Mt(t)):e.experiments?.length&&(this.modifications=e.experiments.map(t=>new Mt(t)));}};var Mt=class{cssSelector;type;display;bg;typo;br;text;image;moveTo;customClasses;constructor(e={}){this.cssSelector=e.cssSelector??``,this.type=e.type??`OTHER`,this.display=e.display,e.bg&&(this.bg=new y$1(e.bg)),e.typo&&(this.typo=new W$2(e.typo)),e.br&&(this.br=new C$3(e.br)),this.text=e.text,this.image=e.image,this.moveTo=e.moveTo,this.customClasses=e.customClasses;}get style(){let e={};return this.br?.r&&(e.borderRadius=this.br.r+`px`),this.br?.w&&(e.borderWidth=this.br.w+`px`),this.br?.s&&(e.borderStyle=rr$4[this.br.s]?.toLowerCase()),this.br?.c?.h&&(e.borderColor=this.br.color?.rgba),this.bg?.h&&(e.backgroundColor=this.bg.rgba),this.type===`TEXT`&&this.typo&&(this.typo.fs&&(e.fontSize=this.typo.fs+`px`),this.typo.lh&&(e.lineHeight=this.typo.lh),this.typo.fw&&(e.fontWeight=this.typo.fw),this.typo.ta&&(e.textAlign=this.typo.alignment),this.typo.tc.h&&(e.color=this.typo.tc.rgba),this.typo.ls&&(e.letterSpacing=this.typo.letterSpacing),this.typo.td&&(e.textDecoration=this.typo.td??`none`)),e}toString(){return `Experiment(cssSelector=${this.cssSelector})`}};var Ft=class{skipSubscribedItems;constructor(e={}){this.skipSubscribedItems=e.skipSubscribedItems??false;}};function Ze(){return !!window.Shopify}function _n(){if(Ze())return window.Shopify.shop?.split(`.`)?.[0]}function An(r){let n=(r.includes(`://`)?new URL(r).pathname:r).match(/\/products\/([^/]+?)(?:\.html)?$/);return n?n[1]:null}function We$1(r){return (window.Shopify?.routes?.root??`/`)+r.substring(1)}function Bt(r){return We$1(r+`?from=cooee`)}function $e$1(r){if(r)return r.split(`/`).pop()}function On(r,e){if(!(!r||false))return `gid://shopify/${e}/${r}`}var h=class r{static CURRENT;token;items=[];total_price=0;original_total_price=0;items_subtotal_price=0;currency;item_count=0;attributes;cart_level_discount_applications;discount_codes;total_discount=0;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new r),this.CURRENT}async getNormalisedCart(e){return Oo(e)}getCooeeCart(){return Ir$1()}update(e){return this.token=e.token,this.items=e.items,this.total_price=e.total_price,this.original_total_price=e.original_total_price,this.items_subtotal_price=e.items_subtotal_price,this.currency=e.currency,this.item_count=e.item_count,this.attributes=e.attributes,this.cart_level_discount_applications=e.cart_level_discount_applications,this.discount_codes=e.discount_codes,this.total_discount=e.total_discount,We$4().currencyCode=this.currency,U$3.verbose(`Updated ShopifyCart`,this),this}toString(){return `ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}};async function Oo(r){let e=h.getCurrent();await ko(e,r);let t=Ln(e);return r&&await ce$5.set(`cart`,t),t}function Ir$1(){return Ln(h.getCurrent())}function Ln(r){return {amount:r.total_price/100,originalAmount:r.original_total_price/100,itemsSubtotalPrice:r.items_subtotal_price/100,currency:r.currency,itemCount:r.item_count,items:Lo(r.items),token:r.token,discountCodes:r.discount_codes?.filter(e=>e.applicable).map(e=>e.code)||[]}}function Lo(r){if(!r)return U$3.error(`No item received to be sent`),[];Array.isArray(r)||(r=[r]);let e=[];for(let t of r){if(!t.id||!t.title){U$3.warn(`Invalid item received`,t);continue}let n={name:t.title,quantity:+t.quantity||1,mID:t.product_id?.toString(),vID:t.id.toString(),price:+t.price/100||0,finalPrice:+t.final_price/100||0,properties:t.properties,key:t.key},o=t.selling_plan_allocation?.selling_plan;if(!o){e.push(n);continue}n.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:o.fixed_selling_plan,id:o.id,name:o.name,recurringDeliveries:o.recurring_deliveries}},e.push(n);}return e}async function ko(r,e){if(!e&&r.token){U$3.verbose(`Not fetching cart`);return}U$3.verbose(`Fetching cart`);let t=Bt(`/cart.js`);try{let n=(await mn(t)).data;r.update(n);}catch(n){U$3.error(`Unable to fetch the cart`,n);}}var Vt=class{id;mID;handle;title;imageURL;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.handle=e.handle,this.title=e.title,this.imageURL=e.imageURL;}};var Wt=class extends wr$3{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920;}getOrigin(){return this.o}};var $t=class{en;ex;constructor(e){e=e??{},this.en=e.en,this.ex=e.ex;}getEnterAnimation(){switch(this.en){case 2:return [{transform:`translateY(-100%)`},{transform:`translateY(0%)`}];case 3:return [{transform:`translateY(100%)`},{transform:`translateY(0%)`}];case 4:return [{transform:`translateX(-100%)`},{transform:`translateX(0%)`}];case 5:return [{transform:`translateX(100%)`},{transform:`translateX(0%)`}];case 6:return [{transform:`translate(-100%, -100%)`},{transform:`translate(0%, 0%)`}];case 7:return [{transform:`translate(100%, -100%)`},{transform:`translate(0%, 0%)`}];case 8:return [{transform:`translate(-100%, 100%)`},{transform:`translate(0%, 0%)`}];case 9:return [{transform:`translate(100%, 100%)`},{transform:`translate(0%, 0%)`}];case 10:return [{transform:`scale(0.1)`},{transform:`scale(1)`}];default:return []}}getExitAnimation(){switch(this.ex){case 2:return [{transform:`translateY(0%)`},{transform:`translateY(-100%)`}];case 3:return [{transform:`translateY(0%)`},{transform:`translateY(100%)`}];case 4:return [{transform:`translateX(0%)`},{transform:`translateX(-100%)`}];case 5:return [{transform:`translateX(0%)`},{transform:`translateX(100%)`}];case 6:return [{transform:`translate(0%, 0%)`},{transform:`translate(-100%, -100%)`}];case 7:return [{transform:`translate(0%, 0%)`},{transform:`translate(100%, -100%)`}];case 8:return [{transform:`translate(0%, 0%)`},{transform:`translate(-100%, 100%)`}];case 9:return [{transform:`translate(0%, 0%)`},{transform:`translate(100%, 100%)`}];case 10:return [{transform:`scale(1)`},{transform:`scale(0)`}];default:return []}}};var Ht=15,et=class extends wr$3{gvt;max;cover;anim;embedded;constructor(e){e=e??{},super(e),this.gvt=e.gvt??5,this.max=e.max,this.cover=e.cover??true,this.anim=new $t(e.anim),this.spc||(this.spc=new D$1({pl:Ht,pr:Ht,pt:Ht,pb:Ht}));}};var qt=class extends et{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new Wt(e.cont),this.mob=new et(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(t=>{t.t===1?this.elems.push(new ye$1(t)):t.t===2?this.elems.push(new Be$1(t)):t.t===3?this.elems.push(new Be$1(t)):t.t===100?this.elems.push(new Qe(t)):t.t===51?this.elems.push(new Ot(t)):t.t===52?this.elems.push(new Lt(t)):t.t===61?this.elems.push(new Rt$1(t)):t.t===15||t.t===16?this.elems.push(new At(t)):t.t===13&&this.elems.push(new kt$1(t));});}getStylesForWrapper(){if(this.cover)return {};let e;return this.gvt===1?e={top:0,left:0}:this.gvt===2?e={top:0,left:`50%`,transform:`translateX(-50%)`}:this.gvt===3?e={top:0,right:0}:this.gvt===6?e={top:`50%`,right:0,transform:`translateY(-50%)`}:this.gvt===9?e={bottom:0,right:0}:this.gvt===8?e={bottom:0,left:`50%`,transform:`translateX(-50%)`}:this.gvt===7?e={bottom:0,left:0}:this.gvt===4?e={top:`50%`,left:0,transform:`translateY(-50%)`}:e={top:`50%`,left:`50%`,transform:`translateX(-50%) translateY(-50%)`},e.overflow=`visible`,e}getFlexStylesForContainer(){let e={display:`flex`,flexDirection:`row`},t,n;return this.gvt===1?(t=`flex-start`,n=`flex-start`):this.gvt===2?(t=`center`,n=`flex-start`):this.gvt===3?(t=`flex-end`,n=`flex-start`):this.gvt===4?(t=`flex-start`,n=`center`):this.gvt===6?(t=`flex-end`,n=`center`):this.gvt===7?(t=`flex-start`,n=`flex-end`):this.gvt===8?(t=`center`,n=`flex-end`):this.gvt===9?(t=`flex-end`,n=`flex-end`):(t=`center`,n=`center`),e.alignItems=n,e.justifyContent=t,e.overflow=`visible`,e}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim;}};var ve$1=class ve extends bt$1{constructor(e,t){super(e,t??3);}};var He$1=class He extends Rt$3{value;constructor(e){super(6,e),e??={},this.value=e.value;}};var Gt=class extends Rt$3{templateName;constructor(e){super(8,e),this.templateName=e?.templateName;}};var jt=class extends Rt$3{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new y$1(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??false,this.fullStar=e.fullStar,this.halfStart=e.halfStart;}};var kn=x$2(Dt$2());var Kt=class extends Rt$3{conf;slide;formData;values;allowedTypes;constructor(e){super(62,e),e&&this.update(e);}update(e){e??={},this.slide=F.getParsedElement(e.slide),this.formData=e.formData,this.values=e.values,this.conf=new s$1(e.conf),this.allowedTypes=e.allowedTypes;}};var Xt=class extends bt$1{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e,61),this.gap=e.gap,this.timerType=e.type,this.timer=new Ve$1(e.timer),this.show=e.show??{days:true,hours:true,minutes:true,seconds:true},this.horizontal=e.horizontal,this.lblPos=e.lblPos;}};var le$1=class le extends Rt$3{elems;constructor(e){super(4,e),this.update(e);}update(e){e??={},this.elems??=[],e.elems?.forEach(t=>{let n=F.getParsedElement(t);n&&this.elems.push(n);});}};var Ee$1=class Ee extends Rt$3{src;sm;lg;constructor(e,t){super(t??1,e),e&&this.update(e);}update(e){this.src=e.src,this.sm=e.sm,this.lg=e.lg;}};var F=class r{static getParsedElements(e){let t=[];return e?.forEach(n=>{let o=r.getParsedElement(n);o&&t.push(o);}),t}static getParsedElement(e){switch(e.t){case 2:return new bt$1(e);case 3:return new ve$1(e);case 6:return new He$1(e);case 8:return new Gt(e);case 11:return new zt(e);case 12:return new me(e);case 61:return new Xt(e);case 4:return new le$1(e);case 1:return new Ee$1(e);case 13:return new Ee$1(e,13);case 14:return new bt$1(e,14);case 15:case 16:return new Vr$3(e.t,e);case 18:return new ve$1(e,18);case 62:return new Kt(e);case 19:return new jt(e);default:kn.default.error(`Unknown element type`,e.t);return}}static parseAlignmentToJustifyContent(e){switch(e){case 1:return `center`;case 2:return `flex-end`;case 0:return `flex-start`;default:return `flex-start`}}};var me=class extends Rt$3{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(e){if(e??={},super(12,e),this.show=e.show,this.elems=F.getParsedElements(e.elems),this.noLinks=e.noLinks,!this.elems.length){e.cBox&&this.elems.push(new He$1(e.cBox)),this.elems.push(new Ee$1(e.img,13));let t=new bt$1(e.title,14);t.hide=!e.show?.title,t.text=`{{ product.name }}`,this.elems.push(t);let n=new bt$1(e.price);n.text=`{{ product.price }}`,n.hide=!e.show?.price;let o=new bt$1(e.compareAt);o.text=`{{ product.compare_price }}`,o.hide=!e.show?.price,e.compareAt||(o.style=new yt$2(n.style),o.style.lg.typo=new W$2(s$2(r$2({},o.style.lg.typo),{td:`line-through`})),o.style.sm.typo=new W$2(s$2(r$2({},o.style.sm.typo),{td:`line-through`})));let i=new le$1({style:{lg:{spc:{mb:10},flex:{dir:`row`,gap:10,ai:`center`,jc:F.parseAlignmentToJustifyContent(n.style.lg.typo?.ta)}}}});i.elems.push(o),i.elems.push(n),this.elems.push(i);let s$2$1=new Vr$3(15,e.variantDD);if(s$2$1.hide=!e.show?.variantDD,this.elems.push(s$2$1),e.btn){let c=new ve$1(e.btn,18);c.hide=!e.show?.btn,this.elems.push(c);}}e.symbol&&(this.symbol=new bt$1(e.symbol));}};var zt=class extends Rt$3{conf;prod;constructor(e){super(11,e),e??={},this.conf=new Tr$1(e.conf),this.prod=new me(e.prod);}};var Yt=class extends s$1{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems;}},Tr$1=class Tr{lg;sm;constructor(e){e??={},this.lg=new Yt(e.lg),this.sm=new Yt(e.sm);}};var Jt=class extends le$1{constructor(e){super(e);}};var qe$1=class qe{cont;elems=[];constructor(e){e=e??{},this.cont=new Jt(e.cont),e.elems?.forEach(t=>{this.addRawElement(t);});}addRawElement(e){let t=F.getParsedElement(e);return t&&this.elems.push(t),t}};function Qt(r,e){return No(r,e,0,5)}function No(r,e,t=0,n=50){if(e){if(t>n){console.warn(`Maximum recursion depth reached in findFirstElementOfType`);return}for(let o of e){if(o.t===r)return o;let i=`elems`in o?o.elems:[];if(i?.length>0){let s=Qt(r,i);if(s)return s}}}}var Dr=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(e){this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.delay=e.delay??0,this.redirectBehaviour=e.redirectBehaviour,this.onsiteDeliveryType=e.onsiteDeliveryType,this.objective=e.objective;}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===ce$4.EXCLUSION}isABTesting(){return this.contentType===ce$4.ABTESTING}isSingleContent(){return this.contentType===ce$4.SINGLE}isGlobalAB(){return this.contentType===ce$4.GLOBAL_AB}},tt=class{videoConfig;savingsBarConfig;collectionFilterConfig;subsUpgradeConfig;afterDeleteJS;afterRenderJS;classes;globalCSS;innerCSS;outerCSS;showSnackBar;constructor(e){this.update(e);}update(e){e??={},e.videoConfig&&(this.videoConfig=new Dr$2(e.videoConfig)),e.savingsBarConfig&&(this.savingsBarConfig=new we$4(e.savingsBarConfig)),e.collectionFilterConfig&&(this.collectionFilterConfig=new xe$2(e.collectionFilterConfig)),e.subsUpgradeConfig&&(this.subsUpgradeConfig=new Ft(e.subsUpgradeConfig)),this.afterDeleteJS=e.afterDeleteJS,this.afterRenderJS=e.afterRenderJS,this.innerCSS=e.innerCSS,this.outerCSS=e.outerCSS,this.globalCSS=e.globalCSS,this.classes=e.classes,this.showSnackBar=e.showSnackBar;}},q$1=class q extends Dr{contentID;variation;ian;widget;discount;placement;klaviyoFormID;entryAnimation;hasMultiplePlacement;progressBarConfig;stickyATCConfig;bundleConfig;content;treatment;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;experimentConfig;discountData=b$1({});constructor(e){if(super(e),this.id=e.id,this.currency=We$4().currencyCode??`USD`,this.contentID=e.contentID,this.variation=e.variation,e.widget&&(this.widget=new qe$1(e.widget)),this.previewType=e.previewType,this.occurred=e.occurred??new Date,this.props=e.props,this.entryAnimation=e.entryAnimation??`NONE`,this.embeddedItems=e.embeddedItems?.map(t=>new pt$2(t)),this.items=e.items?.map(t=>new vt$2(t))??[],this.nonMutableItems=e.items?.map(t=>new vt$2(t))??[],this.collections=e.collections?.map(t=>new Vt(t))??[],this.discount=e.discount,this.placement=e.placement,e.customerData?.name){let t=e.customerData.name.split(` `);this.customerData={name:e.customerData.name,full_name:e.customerData.name,first_name:t[0],last_name:t[1]};}this.ian=e.ian?this.processPopup(e.ian):void 0,this.klaviyoFormID=e.klaviyoFormID,this.hasMultiplePlacement=e.hasMultiplePlacement,this.stickyATCConfig=e.stickyATCConfig,e.experimentConfig&&(this.experimentConfig=new Ut(e.experimentConfig)),e.progressBarConfig&&(this.progressBarConfig=new Ne$2(e.progressBarConfig)),e.bundleConfig&&(this.bundleConfig=new Nt(e.bundleConfig)),e.bundleFrom&&(this.bundleFrom=new vt$2(e.bundleFrom)),e.content&&(this.content=new tt(e.content)),e.treatment&&(this.treatment=e.treatment);}shouldDelay(){return this.delay>0}getDelaySeconds(){let e=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-e}isBundle(){return this.objective===de$3.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===pe$3.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===pe$3.PAGE_EMBED}isPageWidgets(){return this.onsiteDeliveryType===pe$3.PAGE_EMBED||this.onsiteDeliveryType===pe$3.ANNOUNCEMENT_BAR}isProgressBar(){return this.objective===de$3.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===de$3.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===de$3.CART_RECOVERY}isProductPromotion(){return this.objective===de$3.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()||this.isAddOns()}isCollectionPromoted(){return this.objective===de$3.COLLECTION_PROMOTION}isBYOB(){return this.objective===de$3.BYOB}isStickyATC(){return this.objective===de$3.STICKY_ATC}isAddOns(){return this.objective===de$3.ADD_ONS}isShoppableVideo(){return this.objective===de$3.SHOPPABLE_VIDEO}isVideoStory(){return this.objective===de$3.VIDEO_STORY}isFloatingVideo(){return this.objective===de$3.FLOATING_VIDEO}isVideoObjective(){return this.isShoppableVideo()||this.isVideoStory()||this.isFloatingVideo()}isSavingsBar(){return this.objective===de$3.SAVINGS_BAR}isCollectionFilter(){return this.objective===de$3.COLLECTION_FILTER}processPopup(e){let t=this.items[0],n={},o={};if(t){let c=t.selectedOrFirstVariant.value;n=s$2(r$2(r$2({name:t.name,id:t.mID,link:t.link,vID:c.mID,image:t.variantImage},Gn$1(`price`,c.price.d)),Gn$1(`comparePrice`,c.price.cmp)),{quantity:t.quantity}),o={quantity:c.quantity};}let i={productCount:h.getCurrent().item_count},s$3=Fe$3(JSON.stringify(e),{product:n,variant:o,cart:i,discount:this.discount,customer:this.customerData},new Fe$1(new Date,this));return t&&(s$3=s$3.replace(new RegExp(`https://cdn.global.letscooee.com/images/placeholders/product.png`,`gi`),t.variantImage??t.firstImageURL)),new qt(JSON.parse(s$3))}calculateDiscountData(e,t){let n=te$1.sum(e,s=>s.selectedOrFirstVariant.value.price.d),o=te$1.sum(e,s=>s.selectedOrFirstVariant.value.price.comparePrice),i={actualPrice:n,totalComparePrice:o,compareDiscountAmount:o-n,discountAmount:0,discountPercentage:0,discountedPrice:n,compareDiscountPercentage:0};if(!e?.length||!t||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(i);return}if(H$1.BXGY===this.discount.type&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],this.updateEffectivePrice(e,i.discountPercentage,true),i.discountAmount=i.actualPrice-te$1.sum(e,s=>s.selectedOrFirstVariant.value.effectivePrice.value);else if([H$1.STATIC,H$1.UNIQUE_FLAT].includes(this.discount.type)&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100,this.updateEffectivePrice(e,i.discountPercentage);else if(H$1.UNIQUE_FLAT_ITEMS===this.discount.type&&this.discount.values?.length)this.discount.ruleType===`fixed_amount`?(i.discountAmount=this.discount.values[0],i.discountPercentage=i.actualPrice>0?i.discountAmount*100/i.actualPrice:0):(i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100),this.updateEffectivePrice(e,i.discountPercentage);else if(this.discount.type===H$1.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)i.discountAmount=i.actualPrice-this.discount.values[0],i.discountPercentage=i.discountAmount/i.actualPrice*100,this.updateEffectivePrice(e,i.discountPercentage);else if(this.discount.type===H$1.UNIQUE_CHEAPEST_ITEM_FREE){e.sort((c,d)=>d.selectedOrFirstVariant.value.price.d-c.selectedOrFirstVariant.value.price.d);let s=e[e.length-1];s.selectedOrFirstVariant.value.effectivePrice.value=0,i.discountAmount=s.selectedOrFirstVariant.value.price.d,i.discountPercentage=i.discountAmount/i.actualPrice*100;}i.discountedPrice=i.actualPrice-i.discountAmount,i.compareDiscountAmount=i.totalComparePrice-i.discountedPrice,i.compareDiscountPercentage=Math.ceil(i.compareDiscountAmount/i.totalComparePrice*100-.5),this.discountData.value=this.formatCurrencyAndNumber(i);}getPrivateAttributesForLineItem(){return le$5.get().skipItemAttribute?{}:{_via:`Cooee`,_letscooee_campaign:this.shortID,_letscooee_content:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return le$5.get().skipItemAttribute?[]:[{key:`_via`,value:`Cooee`},{key:`_letscooee_campaign`,value:this.shortID},{key:`_letscooee_content`,value:this.contentID}]}isBundleOnCartDrawer(){return this.isBundle()&&this.isCartEmbed()}isBundleOnPDP(){return this.isPageEmbed()&&this.isBundle()}hasSwiperElement(){if(Qt(62,this.widget?.elems))return true;let t=Qt(11,this.widget?.elems);return t?t.conf.lg.disp===2||t.conf.sm.disp===2:false}toString(){let e;return this.onsiteDeliveryType===pe$3.POPUP?e=`Popup`:e=Rn.toTitle(this.objective),`${e}(id=${this.shortID})`}getCartMagicVariables(){let e=h.getCurrent(),t=te$1.sum(e.items??[],n=>n.discounts?.reduce((o,i)=>o+(i.amount??0),0)??0);return r$2(r$2(r$2(r$2({productCount:e.item_count,product_count:e.item_count},Gn$1(`amount`,e.total_price/100)),Gn$1(`originalAmount`,e.original_total_price/100)),Gn$1(`total_line_items_discount`,t/100)),Gn$1(`total_discount`,e.total_discount/100))}shouldGetVariationImmediately(){return this.hasMultiplePlacement&&!this.alwaysHaveVariations()}shouldSkipVariation(){return !this.isAnySplit()||this.alwaysHaveVariations()?true:!!this.variation}alwaysHaveVariations(){return this.isProgressBar()||this.isSavingsBar()}updateEffectivePrice(e,t,n=false){let o=We$4().currentItem;e.forEach(i=>{let s=i.selectedOrFirstVariant.value,c=s.price;if(n&&i.mID===o.mID)s.effectivePrice.value=c.d;else {let u=c.d*t/100;s.effectivePrice.value=c.d-u;}let d=c.comparePrice;s.compareDiscountAmount.value=d-s.effectivePrice.value,s.compareDiscountPercentage.value=s.compareDiscountAmount.value/d*100;});}formatCurrencyAndNumber(e){if(!e)return {};let t={discountPercentage:Yn$1(e.discountPercentage??0),discountCode:this.discount?.code};return [`actualPrice`,`discountAmount`,`discountedPrice`,`totalComparePrice`,`compareDiscountAmount`].map(n=>{Object.assign(t,Gn$1(n,e[n]));}),t}};var Fo=`/api/2026-01/graphql.json?from=cooee`,Nn={"Content-Type":`application/json`};async function de$1(r,e,t){let n=le$5.get().storefrontToken;if(!n)throw new Error(`Storefront token not set for the store`);let o=new Headers(Nn);o.append(`X-Shopify-Storefront-Access-Token`,n);let i=JSON.stringify({query:r,variables:e});try{return await mn(Fo,{method:`POST`,headers:o,body:i})}catch(s){throw U$3.error(s,t),s}}function we$1(r,e){return Bo(Bt(r),e)}async function Bo(r,e){return mn(r,{body:JSON.stringify(e),method:`POST`,headers:Nn})}var Zt=class{isLocked=false;queue=[];async acquire(){if(this.isLocked)await new Promise(e=>this.queue.push(e));else {this.isLocked=true;return}}release(){if(this.queue.length>0){let e=this.queue.shift();e&&e();}else this.isLocked=false;}};var Pr$1=new Zt,Vo=`
|
|
37
|
+
var Fe$1=class Fe{constructor(e,t){this._startTime=e;this._triggerData=t;}intervals=[];selectedEmbeddedItems;renderer;closeCallback;inputFields=[];get startTime(){return this._startTime}get triggerData(){return this._triggerData}get inputs(){return this.inputFields}get rootClassName(){let e=this.triggerData.shortID??this.triggerData.id.slice(-6);return e===`test`&&(e=`test-`+this.startTime.getTime().toString()),`cooee-wrapper-`+e}get selectedItems(){return this.triggerData.items.filter(e=>e.selected.value)}get shouldGiveFBTDiscount(){let e=this.selectedItems.length;return this.triggerData.bundleConfig?.applyDiscountOnMinimum?this.triggerData.bundleConfig.applyDiscountOnMinimum<=e:e===this.triggerData.items.length}onClose(e){this.closeCallback=e;}closeInApp(e,t){t??={};let n=r$2({eventName:e,duration:(new Date().getTime()-this.startTime.getTime())/1e3},t);this.stopIntervals(),this.closeCallback&&this.closeCallback(n);}addInputField(e,t){this.inputFields.push({id:e,type:t,isValid:false});}updateValidation(e,t){this.inputFields.forEach(o=>{if(o.id===e){o.isValid=t;return}});}stopIntervals(){this.intervals.forEach(e=>clearInterval(e));}};var Qe=class extends wr$3{constructor(e){super(e);}};var ye$1=class ye extends wr$3{src;constructor(e){super(e),this.src=e.src;}};var ae$1=class ae extends wr$3{typo;constructor(e){super(e);let t=r$2(r$2({},e.f),e.typo);e.alg&&(t.ta=e.alg),e.c&&(t.tc=e.c),this.typo=new W$2(t);}get color(){return this.typography.tc}get typography(){return this.typo}};var Be$1=class Be extends ae$1{prs;constructor(e){super(e),this.prs=e.prs;}get parts(){return this.prs}};var Ve$1=class Ve{dd;hh;mm;ss;date;constructor(e){e??={},this.dd=e.dd??0,this.hh=e.hh??0,this.mm=e.mm??0,this.ss=e.ss??0,this.date=e.date?new Date(e.date):void 0;}start(e,t){let o=new Date;e===2?(o.setSeconds(o.getSeconds()+this.ss),o.setMinutes(o.getMinutes()+this.mm),o.setHours(o.getHours()+this.hh),o.setDate(o.getDate()+this.dd)):o=this.date??new Date;let n=window.setInterval(()=>{let i=new Date().getTime(),s=o.getTime()-i;if(s<1){clearInterval(n);return}t({days:Math.floor(s/(1e3*60*60*24)),hours:Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),minutes:Math.floor(s%(1e3*60*60)/(1e3*60)),seconds:Math.floor(s%(1e3*60)/1e3)});},1e3);return n}};var Rt$1=class Rt extends ae$1{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e),this.gap=e.gap,this.timerType=e.type,this.timer=new Ve$1(e.timer),this.show=e.show??{day:true,hour:true,minute:true,second:true},this.horizontal=e.horizontal,this.lblPos=e.lblPos;}};var _t=class{txt;c;constructor(e){e??={},this.txt=e.txt,this.c=new y$1(e.c??{});}get text(){return this.txt}get color(){return this.c}};var ce$1=class ce extends ae$1{ph;constructor(e){super(e),this.ph=new _t(e.ph);}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}};var At=class extends ce$1{constructor(e){e??={},super(e);}};var Ot=class extends ce$1{};var Lt=class extends ce$1{};var kt$1=class kt extends ye$1{};var H$1=(function(r){return r[r.NONE=0]=`NONE`,r[r.STATIC=1]=`STATIC`,r[r.UNIQUE_FLAT=2]=`UNIQUE_FLAT`,r[r.UNIQUE_FLAT_ITEMS=3]=`UNIQUE_FLAT_ITEMS`,r[r.UNIQUE_FIXED_ITEMS=4]=`UNIQUE_FIXED_ITEMS`,r[r.UNIQUE_CHEAPEST_ITEM_FREE=5]=`UNIQUE_CHEAPEST_ITEM_FREE`,r[r.BXGY=6]=`BXGY`,r})(H$1||{});var te$1=class r{static of(e,t){return t!==void 0?new Array(e).fill(t):Array.from({length:e},(o,n)=>n)}static remove(e,t){let o=e.indexOf(t);return o===-1?false:(e.splice(o,1),true)}static swap(e,t,o){[e[t],e[o]]=[e[o],e[t]];}static sum(e,t){return e.reduce((o,n)=>o+Math.max(t?t(n):+n,0),0)}static unique(e,t){return e.filter((o,n,i)=>i.findIndex(s=>s[t]===o[t])===n)}static shuffle(e){let t=e.length;for(;t!=0;){let o=Math.floor(Math.random()*t);t--,r.swap(e,t,o);}}};var Ro=(()=>{class r{static toTitle(t){return t?this.titleCase(t.toLowerCase().split(/[_-]+/).join(` `)):``}static toSlug(t){return t?t.toLowerCase().replace(/[_-]+/,` `).replace(/[^\w ]+/g,``).replace(/ +/g,`-`):``}static toCamelCase(t){return t.toLowerCase().split(` `).map((o,n)=>n===0?o:o.charAt(0).toUpperCase()+o.slice(1)).join(``)}static format(t,...o){return t?.replace(/{(\d+)}/g,(n,i)=>{let s=o[i];return s!==void 0?s:n})}static chop(t,o){if(!(!t||!o))return t.length<=o?t:t.substring(0,o)}static titleCase=t=>t.replace(/(^|\s)\S/g,o=>o.toUpperCase())}return r})();var Nt=class{applyDiscountOnMinimum;constructor(e){this.applyDiscountOnMinimum=e.applyDiscountOnMinimum;}};var Ut=class{modifications;constructor(e={}){e.modifications?.length?this.modifications=e.modifications.map(t=>new Mt(t)):e.experiments?.length&&(this.modifications=e.experiments.map(t=>new Mt(t)));}};var Mt=class{cssSelector;type;display;bg;typo;br;text;image;moveTo;customClasses;constructor(e={}){this.cssSelector=e.cssSelector??``,this.type=e.type??`OTHER`,this.display=e.display,e.bg&&(this.bg=new y$1(e.bg)),e.typo&&(this.typo=new W$2(e.typo)),e.br&&(this.br=new C$3(e.br)),this.text=e.text,this.image=e.image,this.moveTo=e.moveTo,this.customClasses=e.customClasses;}get style(){let e={};return this.br?.r&&(e.borderRadius=this.br.r+`px`),this.br?.w&&(e.borderWidth=this.br.w+`px`),this.br?.s&&(e.borderStyle=rr$4[this.br.s]?.toLowerCase()),this.br?.c?.h&&(e.borderColor=this.br.color?.rgba),this.bg?.h&&(e.backgroundColor=this.bg.rgba),this.type===`TEXT`&&this.typo&&(this.typo.fs&&(e.fontSize=this.typo.fs+`px`),this.typo.lh&&(e.lineHeight=this.typo.lh),this.typo.fw&&(e.fontWeight=this.typo.fw),this.typo.ta&&(e.textAlign=this.typo.alignment),this.typo.tc.h&&(e.color=this.typo.tc.rgba),this.typo.ls&&(e.letterSpacing=this.typo.letterSpacing),this.typo.td&&(e.textDecoration=this.typo.td??`none`)),e}toString(){return `Experiment(cssSelector=${this.cssSelector})`}};var Ft=class{skipSubscribedItems;constructor(e={}){this.skipSubscribedItems=e.skipSubscribedItems??false;}};function Ze(){return !!window.Shopify}function _o(){if(Ze())return window.Shopify.shop?.split(`.`)?.[0]}function Ao(r){let o=(r.includes(`://`)?new URL(r).pathname:r).match(/\/products\/([^/]+?)(?:\.html)?$/);return o?o[1]:null}function We$1(r){return (window.Shopify?.routes?.root??`/`)+r.substring(1)}function Bt(r){return We$1(r+`?from=cooee`)}function $e$1(r){if(r)return r.split(`/`).pop()}function Oo(r,e){if(!(!r||false))return `gid://shopify/${e}/${r}`}var h=class r{static CURRENT;token;items=[];total_price=0;original_total_price=0;items_subtotal_price=0;currency;item_count=0;attributes;cart_level_discount_applications;discount_codes;total_discount=0;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new r),this.CURRENT}async getNormalisedCart(e){return On(e)}getCooeeCart(){return Tr$1()}update(e){return this.token=e.token,this.items=e.items,this.total_price=e.total_price,this.original_total_price=e.original_total_price,this.items_subtotal_price=e.items_subtotal_price,this.currency=e.currency,this.item_count=e.item_count,this.attributes=e.attributes,this.cart_level_discount_applications=e.cart_level_discount_applications,this.discount_codes=e.discount_codes,this.total_discount=e.total_discount,We$4().currencyCode=this.currency,U$3.verbose(`Updated ShopifyCart`,this),this}toString(){return `ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}};async function On(r){let e=h.getCurrent();await kn(e,r);let t=Lo(e);return r&&await ce$5.set(`cart`,t),t}function Tr$1(){return Lo(h.getCurrent())}function Lo(r){return {amount:r.total_price/100,originalAmount:r.original_total_price/100,itemsSubtotalPrice:r.items_subtotal_price/100,currency:r.currency,itemCount:r.item_count,items:Ln(r.items),token:r.token,discountCodes:r.discount_codes?.filter(e=>e.applicable).map(e=>e.code)||[]}}function Ln(r){if(!r)return U$3.error(`No item received to be sent`),[];Array.isArray(r)||(r=[r]);let e=[];for(let t of r){if(!t.id||!t.title){U$3.warn(`Invalid item received`,t);continue}let o={name:t.title,quantity:+t.quantity||1,mID:t.product_id?.toString(),vID:t.id.toString(),price:+t.price/100||0,finalPrice:+t.final_price/100||0,properties:t.properties,key:t.key},n=t.selling_plan_allocation?.selling_plan;if(!n){e.push(o);continue}o.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:n.fixed_selling_plan,id:n.id,name:n.name,recurringDeliveries:n.recurring_deliveries}},e.push(o);}return e}async function kn(r,e){if(!e&&r.token){U$3.verbose(`Not fetching cart`);return}U$3.verbose(`Fetching cart`);let t=Bt(`/cart.js`);try{let o=(await mn$1(t)).data;r.update(o);}catch(o){U$3.error(`Unable to fetch the cart`,o);}}var Vt=class{id;mID;handle;title;imageURL;constructor(e){e??={},this.id=e.id,this.mID=e.mID,this.handle=e.handle,this.title=e.title,this.imageURL=e.imageURL;}};var Wt=class extends wr$3{o;constructor(e){super(e),this.o=e.o??5,this.w=this.w??1080,this.h=this.h??1920;}getOrigin(){return this.o}};var $t=class{en;ex;constructor(e){e=e??{},this.en=e.en,this.ex=e.ex;}getEnterAnimation(){switch(this.en){case 2:return [{transform:`translateY(-100%)`},{transform:`translateY(0%)`}];case 3:return [{transform:`translateY(100%)`},{transform:`translateY(0%)`}];case 4:return [{transform:`translateX(-100%)`},{transform:`translateX(0%)`}];case 5:return [{transform:`translateX(100%)`},{transform:`translateX(0%)`}];case 6:return [{transform:`translate(-100%, -100%)`},{transform:`translate(0%, 0%)`}];case 7:return [{transform:`translate(100%, -100%)`},{transform:`translate(0%, 0%)`}];case 8:return [{transform:`translate(-100%, 100%)`},{transform:`translate(0%, 0%)`}];case 9:return [{transform:`translate(100%, 100%)`},{transform:`translate(0%, 0%)`}];case 10:return [{transform:`scale(0.1)`},{transform:`scale(1)`}];default:return []}}getExitAnimation(){switch(this.ex){case 2:return [{transform:`translateY(0%)`},{transform:`translateY(-100%)`}];case 3:return [{transform:`translateY(0%)`},{transform:`translateY(100%)`}];case 4:return [{transform:`translateX(0%)`},{transform:`translateX(-100%)`}];case 5:return [{transform:`translateX(0%)`},{transform:`translateX(100%)`}];case 6:return [{transform:`translate(0%, 0%)`},{transform:`translate(-100%, -100%)`}];case 7:return [{transform:`translate(0%, 0%)`},{transform:`translate(100%, -100%)`}];case 8:return [{transform:`translate(0%, 0%)`},{transform:`translate(-100%, 100%)`}];case 9:return [{transform:`translate(0%, 0%)`},{transform:`translate(100%, 100%)`}];case 10:return [{transform:`scale(1)`},{transform:`scale(0)`}];default:return []}}};var Ht=15,et=class extends wr$3{gvt;max;cover;anim;embedded;constructor(e){e=e??{},super(e),this.gvt=e.gvt??5,this.max=e.max,this.cover=e.cover??true,this.anim=new $t(e.anim),this.spc||(this.spc=new D$2({pl:Ht,pr:Ht,pt:Ht,pb:Ht}));}};var qt=class extends et{cont;elems=[];mob;constructor(e){e=e??{},super(e),this.cont=new Wt(e.cont),this.mob=new et(e.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),e.elems.forEach(t=>{t.t===1?this.elems.push(new ye$1(t)):t.t===2?this.elems.push(new Be$1(t)):t.t===3?this.elems.push(new Be$1(t)):t.t===100?this.elems.push(new Qe(t)):t.t===51?this.elems.push(new Ot(t)):t.t===52?this.elems.push(new Lt(t)):t.t===61?this.elems.push(new Rt$1(t)):t.t===15||t.t===16?this.elems.push(new At(t)):t.t===13&&this.elems.push(new kt$1(t));});}getStylesForWrapper(){if(this.cover)return {};let e;return this.gvt===1?e={top:0,left:0}:this.gvt===2?e={top:0,left:`50%`,transform:`translateX(-50%)`}:this.gvt===3?e={top:0,right:0}:this.gvt===6?e={top:`50%`,right:0,transform:`translateY(-50%)`}:this.gvt===9?e={bottom:0,right:0}:this.gvt===8?e={bottom:0,left:`50%`,transform:`translateX(-50%)`}:this.gvt===7?e={bottom:0,left:0}:this.gvt===4?e={top:`50%`,left:0,transform:`translateY(-50%)`}:e={top:`50%`,left:`50%`,transform:`translateX(-50%) translateY(-50%)`},e.overflow=`visible`,e}getFlexStylesForContainer(){let e={display:`flex`,flexDirection:`row`},t,o;return this.gvt===1?(t=`flex-start`,o=`flex-start`):this.gvt===2?(t=`center`,o=`flex-start`):this.gvt===3?(t=`flex-end`,o=`flex-start`):this.gvt===4?(t=`flex-start`,o=`center`):this.gvt===6?(t=`flex-end`,o=`center`):this.gvt===7?(t=`flex-start`,o=`flex-end`):this.gvt===8?(t=`center`,o=`flex-end`):this.gvt===9?(t=`flex-end`,o=`flex-end`):(t=`center`,o=`center`),e.alignItems=o,e.justifyContent=t,e.overflow=`visible`,e}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim;}};var ve$1=class ve extends Rt$3{constructor(e,t){super(e,t??3);}};var He$1=class He extends Pt$1{value;constructor(e){super(6,e),e??={},this.value=e.value;}};var Gt=class extends Pt$1{templateName;constructor(e){super(8,e),this.templateName=e?.templateName;}};var jt=class extends Pt$1{c;iconSize;showSingleStar;fullStar;halfStart;constructor(e){super(19,e),e??={},this.c=new y$1(e.c),this.iconSize=e.iconSize??24,this.showSingleStar=e.showSingleStar??false,this.fullStar=e.fullStar,this.halfStart=e.halfStart;}};var ko=x$2(Dt$2());var Kt=class extends Pt$1{conf;slide;formData;values;allowedTypes;constructor(e){super(62,e),e&&this.update(e);}update(e){e??={},this.slide=F.getParsedElement(e.slide),this.formData=e.formData,this.values=e.values,this.conf=new s$1(e.conf),this.allowedTypes=e.allowedTypes;}};var Xt=class extends Rt$3{gap;timer;timerType;horizontal;lblPos;show;constructor(e){e??={},super(e,61),this.gap=e.gap,this.timerType=e.type,this.timer=new Ve$1(e.timer),this.show=e.show??{days:true,hours:true,minutes:true,seconds:true},this.horizontal=e.horizontal,this.lblPos=e.lblPos;}};var le$1=class le extends Pt$1{elems;constructor(e){super(4,e),this.update(e);}update(e){e??={},this.elems??=[],e.elems?.forEach(t=>{let o=F.getParsedElement(t);o&&this.elems.push(o);});}};var Ee$1=class Ee extends Pt$1{src;sm;lg;constructor(e,t){super(t??1,e),e&&this.update(e);}update(e){this.src=e.src,this.sm=e.sm,this.lg=e.lg;}};var F=class r{static getParsedElements(e){let t=[];return e?.forEach(o=>{let n=r.getParsedElement(o);n&&t.push(n);}),t}static getParsedElement(e){switch(e.t){case 2:return new Rt$3(e);case 3:return new ve$1(e);case 6:return new He$1(e);case 8:return new Gt(e);case 11:return new zt(e);case 12:return new me(e);case 61:return new Xt(e);case 4:return new le$1(e);case 1:return new Ee$1(e);case 13:return new Ee$1(e,13);case 14:return new Rt$3(e,14);case 15:case 16:return new Vr$3(e.t,e);case 18:return new ve$1(e,18);case 62:return new Kt(e);case 19:return new jt(e);default:ko.default.error(`Unknown element type`,e.t);return}}static parseAlignmentToJustifyContent(e){switch(e){case 1:return `center`;case 2:return `flex-end`;case 0:return `flex-start`;default:return `flex-start`}}};var me=class extends Pt$1{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(e){if(e??={},super(12,e),this.show=e.show,this.elems=F.getParsedElements(e.elems),this.noLinks=e.noLinks,!this.elems.length){e.cBox&&this.elems.push(new He$1(e.cBox)),this.elems.push(new Ee$1(e.img,13));let t=new Rt$3(e.title,14);t.hide=!e.show?.title,t.text=`{{ product.name }}`,this.elems.push(t);let o=new Rt$3(e.price);o.text=`{{ product.price }}`,o.hide=!e.show?.price;let n=new Rt$3(e.compareAt);n.text=`{{ product.compare_price }}`,n.hide=!e.show?.price,e.compareAt||(n.style=new yt$2(o.style),n.style.lg.typo=new W$2(s$2(r$2({},n.style.lg.typo),{td:`line-through`})),n.style.sm.typo=new W$2(s$2(r$2({},n.style.sm.typo),{td:`line-through`})));let i=new le$1({style:{lg:{spc:{mb:10},flex:{dir:`row`,gap:10,ai:`center`,jc:F.parseAlignmentToJustifyContent(o.style.lg.typo?.ta)}}}});i.elems.push(n),i.elems.push(o),this.elems.push(i);let s$2$1=new Vr$3(15,e.variantDD);if(s$2$1.hide=!e.show?.variantDD,this.elems.push(s$2$1),e.btn){let c=new ve$1(e.btn,18);c.hide=!e.show?.btn,this.elems.push(c);}}e.symbol&&(this.symbol=new Rt$3(e.symbol));}};var zt=class extends Pt$1{conf;prod;constructor(e){super(11,e),e??={},this.conf=new Ir$1(e.conf),this.prod=new me(e.prod);}};var Yt=class extends s$1{disp;maxItems;constructor(e){e??={},super(e),this.disp=e.disp,this.maxItems=e.maxItems;}},Ir$1=class Ir{lg;sm;constructor(e){e??={},this.lg=new Yt(e.lg),this.sm=new Yt(e.sm);}};var Jt=class extends le$1{constructor(e){super(e);}};var qe$1=class qe{cont;elems=[];constructor(e){e=e??{},this.cont=new Jt(e.cont),e.elems?.forEach(t=>{this.addRawElement(t);});}addRawElement(e){let t=F.getParsedElement(e);return t&&this.elems.push(t),t}};function Qt(r,e){return Nn(r,e,0,5)}function Nn(r,e,t=0,o=50){if(e){if(t>o){console.warn(`Maximum recursion depth reached in findFirstElementOfType`);return}for(let n of e){if(n.t===r)return n;let i=`elems`in n?n.elems:[];if(i?.length>0){let s=Qt(r,i);if(s)return s}}}}var Pr$1=class Pr{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(e){this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.delay=e.delay??0,this.redirectBehaviour=e.redirectBehaviour,this.onsiteDeliveryType=e.onsiteDeliveryType,this.objective=e.objective;}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===ce$4.EXCLUSION}isABTesting(){return this.contentType===ce$4.ABTESTING}isSingleContent(){return this.contentType===ce$4.SINGLE}isGlobalAB(){return this.contentType===ce$4.GLOBAL_AB}},tt=class{videoConfig;savingsBarConfig;collectionFilterConfig;subsUpgradeConfig;afterDeleteJS;afterRenderJS;classes;globalCSS;innerCSS;outerCSS;showSnackBar;constructor(e){this.update(e);}update(e){e??={},e.videoConfig&&(this.videoConfig=new Dr$2(e.videoConfig)),e.savingsBarConfig&&(this.savingsBarConfig=new we$4(e.savingsBarConfig)),e.collectionFilterConfig&&(this.collectionFilterConfig=new xe$2(e.collectionFilterConfig)),e.subsUpgradeConfig&&(this.subsUpgradeConfig=new Ft(e.subsUpgradeConfig)),this.afterDeleteJS=e.afterDeleteJS,this.afterRenderJS=e.afterRenderJS,this.innerCSS=e.innerCSS,this.outerCSS=e.outerCSS,this.globalCSS=e.globalCSS,this.classes=e.classes,this.showSnackBar=e.showSnackBar;}},q$1=class q extends Pr$1{contentID;variation;ian;widget;discount;placement;klaviyoFormID;entryAnimation;hasMultiplePlacement;progressBarConfig;stickyATCConfig;bundleConfig;content;treatment;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;experimentConfig;discountData=R$3({});constructor(e){if(super(e),this.id=e.id,this.currency=We$4().currencyCode??`USD`,this.contentID=e.contentID,this.variation=e.variation,e.widget&&(this.widget=new qe$1(e.widget)),this.previewType=e.previewType,this.occurred=e.occurred??new Date,this.props=e.props,this.entryAnimation=e.entryAnimation??`NONE`,this.embeddedItems=e.embeddedItems?.map(t=>new pt$2(t)),this.items=e.items?.map(t=>new vt$2(t))??[],this.nonMutableItems=e.items?.map(t=>new vt$2(t))??[],this.collections=e.collections?.map(t=>new Vt(t))??[],this.discount=e.discount,this.placement=e.placement,e.customerData?.name){let t=e.customerData.name.split(` `);this.customerData={name:e.customerData.name,full_name:e.customerData.name,first_name:t[0],last_name:t[1]};}this.ian=e.ian?this.processPopup(e.ian):void 0,this.klaviyoFormID=e.klaviyoFormID,this.hasMultiplePlacement=e.hasMultiplePlacement,this.stickyATCConfig=e.stickyATCConfig,e.experimentConfig&&(this.experimentConfig=new Ut(e.experimentConfig)),e.progressBarConfig&&(this.progressBarConfig=new Ne$2(e.progressBarConfig)),e.bundleConfig&&(this.bundleConfig=new Nt(e.bundleConfig)),e.bundleFrom&&(this.bundleFrom=new vt$2(e.bundleFrom)),e.content&&(this.content=new tt(e.content)),e.treatment&&(this.treatment=e.treatment);}shouldDelay(){return this.delay>0}getDelaySeconds(){let e=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-e}isBundle(){return this.objective===de$3.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===pe$3.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===pe$3.PAGE_EMBED}isPageWidgets(){return this.onsiteDeliveryType===pe$3.PAGE_EMBED||this.onsiteDeliveryType===pe$3.ANNOUNCEMENT_BAR}isProgressBar(){return this.objective===de$3.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===de$3.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===de$3.CART_RECOVERY}isProductPromotion(){return this.objective===de$3.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()||this.isAddOns()}isCollectionPromoted(){return this.objective===de$3.COLLECTION_PROMOTION}isBYOB(){return this.objective===de$3.BYOB}isStickyATC(){return this.objective===de$3.STICKY_ATC}isAddOns(){return this.objective===de$3.ADD_ONS}isShoppableVideo(){return this.objective===de$3.SHOPPABLE_VIDEO}isVideoStory(){return this.objective===de$3.VIDEO_STORY}isFloatingVideo(){return this.objective===de$3.FLOATING_VIDEO}isVideoObjective(){return this.isShoppableVideo()||this.isVideoStory()||this.isFloatingVideo()}isSavingsBar(){return this.objective===de$3.SAVINGS_BAR}isCollectionFilter(){return this.objective===de$3.COLLECTION_FILTER}processPopup(e){let t=this.items[0],o={},n={};if(t){let c=t.selectedOrFirstVariant.value;o=s$2(r$2(r$2({name:t.name,id:t.mID,link:t.link,vID:c.mID,image:t.variantImage},Gn$1(`price`,c.price.d)),Gn$1(`comparePrice`,c.price.cmp)),{quantity:t.quantity}),n={quantity:c.quantity};}let i={productCount:h.getCurrent().item_count},s$3=Fe$3(JSON.stringify(e),{product:o,variant:n,cart:i,discount:this.discount,customer:this.customerData},new Fe$1(new Date,this));return t&&(s$3=s$3.replace(new RegExp(`https://cdn.global.letscooee.com/images/placeholders/product.png`,`gi`),t.variantImage??t.firstImageURL)),new qt(JSON.parse(s$3))}calculateDiscountData(e,t){let o=te$1.sum(e,s=>s.selectedOrFirstVariant.value.price.d),n=te$1.sum(e,s=>s.selectedOrFirstVariant.value.price.comparePrice),i={actualPrice:o,totalComparePrice:n,compareDiscountAmount:n-o,discountAmount:0,discountPercentage:0,discountedPrice:o,compareDiscountPercentage:0};if(!e?.length||!t||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(i);return}if(H$1.BXGY===this.discount.type&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],this.updateEffectivePrice(e,i.discountPercentage,true),i.discountAmount=i.actualPrice-te$1.sum(e,s=>s.selectedOrFirstVariant.value.effectivePrice.value);else if([H$1.STATIC,H$1.UNIQUE_FLAT].includes(this.discount.type)&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100,this.updateEffectivePrice(e,i.discountPercentage);else if(H$1.UNIQUE_FLAT_ITEMS===this.discount.type&&this.discount.values?.length)this.discount.ruleType===`fixed_amount`?(i.discountAmount=this.discount.values[0],i.discountPercentage=i.actualPrice>0?i.discountAmount*100/i.actualPrice:0):(i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100),this.updateEffectivePrice(e,i.discountPercentage);else if(this.discount.type===H$1.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)i.discountAmount=i.actualPrice-this.discount.values[0],i.discountPercentage=i.discountAmount/i.actualPrice*100,this.updateEffectivePrice(e,i.discountPercentage);else if(this.discount.type===H$1.UNIQUE_CHEAPEST_ITEM_FREE){e.sort((c,d)=>d.selectedOrFirstVariant.value.price.d-c.selectedOrFirstVariant.value.price.d);let s=e[e.length-1];s.selectedOrFirstVariant.value.effectivePrice.value=0,i.discountAmount=s.selectedOrFirstVariant.value.price.d,i.discountPercentage=i.discountAmount/i.actualPrice*100;}i.discountedPrice=i.actualPrice-i.discountAmount,i.compareDiscountAmount=i.totalComparePrice-i.discountedPrice,i.compareDiscountPercentage=Math.ceil(i.compareDiscountAmount/i.totalComparePrice*100-.5),this.discountData.value=this.formatCurrencyAndNumber(i);}getPrivateAttributesForLineItem(){return le$5.get().skipItemAttribute?{}:{_via:`Cooee`,_letscooee_campaign:this.shortID,_letscooee_content:this.contentID}}getKVFormatPrivateAttributesForLineItem(){return le$5.get().skipItemAttribute?[]:[{key:`_via`,value:`Cooee`},{key:`_letscooee_campaign`,value:this.shortID},{key:`_letscooee_content`,value:this.contentID}]}isBundleOnCartDrawer(){return this.isBundle()&&this.isCartEmbed()}isBundleOnPDP(){return this.isPageEmbed()&&this.isBundle()}hasSwiperElement(){if(Qt(62,this.widget?.elems))return true;let t=Qt(11,this.widget?.elems);return t?t.conf.lg.disp===2||t.conf.sm.disp===2:false}toString(){let e;return this.onsiteDeliveryType===pe$3.POPUP?e=`Popup`:e=Ro.toTitle(this.objective),`${e}(id=${this.shortID})`}getCartMagicVariables(){let e=h.getCurrent(),t=te$1.sum(e.items??[],o=>o.discounts?.reduce((n,i)=>n+(i.amount??0),0)??0);return r$2(r$2(r$2(r$2({productCount:e.item_count,product_count:e.item_count},Gn$1(`amount`,e.total_price/100)),Gn$1(`originalAmount`,e.original_total_price/100)),Gn$1(`total_line_items_discount`,t/100)),Gn$1(`total_discount`,e.total_discount/100))}shouldGetVariationImmediately(){return this.hasMultiplePlacement&&!this.alwaysHaveVariations()}shouldSkipVariation(){return !this.isAnySplit()||this.alwaysHaveVariations()?true:!!this.variation}alwaysHaveVariations(){return this.isProgressBar()||this.isSavingsBar()}updateEffectivePrice(e,t,o=false){let n=We$4().currentItem;e.forEach(i=>{let s=i.selectedOrFirstVariant.value,c=s.price;if(o&&i.mID===n.mID)s.effectivePrice.value=c.d;else {let g=c.d*t/100;s.effectivePrice.value=c.d-g;}let d=c.comparePrice;s.compareDiscountAmount.value=d-s.effectivePrice.value,s.compareDiscountPercentage.value=s.compareDiscountAmount.value/d*100;});}formatCurrencyAndNumber(e){if(!e)return {};let t={discountPercentage:Yn$1(e.discountPercentage??0),discountCode:this.discount?.code};return [`actualPrice`,`discountAmount`,`discountedPrice`,`totalComparePrice`,`compareDiscountAmount`].map(o=>{Object.assign(t,Gn$1(o,e[o]));}),t}};var Fn=`/api/2026-01/graphql.json?from=cooee`,No={"Content-Type":`application/json`};async function de$1(r,e,t){let o=le$5.get().storefrontToken;if(!o)throw new Error(`Storefront token not set for the store`);let n=new Headers(No);n.append(`X-Shopify-Storefront-Access-Token`,o);let i=JSON.stringify({query:r,variables:e});try{return await mn$1(Fn,{method:`POST`,headers:n,body:i})}catch(s){throw U$3.error(s,t),s}}function we$1(r,e){return Bn(Bt(r),e)}async function Bn(r,e){return mn$1(r,{body:JSON.stringify(e),method:`POST`,headers:No})}var Zt=class{isLocked=false;queue=[];async acquire(){if(this.isLocked)await new Promise(e=>this.queue.push(e));else {this.isLocked=true;return}}release(){if(this.queue.length>0){let e=this.queue.shift();e&&e();}else this.isLocked=false;}};var Dr=new Zt,Vn=`
|
|
38
38
|
mutation cartMetafieldsSet($metafields: [CartMetafieldsSetInput!]!) {
|
|
39
39
|
cartMetafieldsSet(metafields: $metafields) {
|
|
40
40
|
metafields {
|
|
@@ -48,14 +48,15 @@ var Fe$1=class Fe{constructor(e,t){this._startTime=e;this._triggerData=t;}interv
|
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
|
-
`;function Un(){le$5.get().skipCartAttribute||Ho().catch(r=>{U$3.error(`Fail to add attributes in cart`,r);});}async function Wo(){let e=await(await fetch(window.Shopify.routes.root+`browsing_context_suggestions.json?country[enabled]=true&country[exclude]=${window.Shopify.country}&language[enabled]=true&language[exclude]=${window.Shopify.language}`)).json(),t=le$5.get().storefrontToken,n=new Headers;n.append(`x-shopify-storefront-access-token`,t),n.append(`Content-Type`,`application/json`),await de$1(Vo,{metafields:[{key:`currentCountry`,ownerId:`gid://shopify/Cart/${h.getCurrent().token}`,type:`single_line_text_field`,value:e.detected_values.country.handle}]},`add-cart-metafields-set`);}function $o(){h.getCurrent().token?Wo().catch(r=>{U$3.error(`Fail to update cart metafields`,r);}):setTimeout($o,500);}async function Ho(){await Pr$1.acquire();let r=h.getCurrent(),e=await Mr$4();if(r.attributes?.letscooee_did===e.letscooee_did&&r.attributes?.letscooee_sn===e.letscooee_sn){U$3.verbose(`Not calling Shopify update.js API.`,`Current attributes:`,r.attributes),Pr$1.release();return}try{let t=await we$1(`/cart/update.js`,{attributes:e});U$3.verbose(`Updated cart attributes`,JSON.stringify(t.data)),r.update(t.data);}catch(t){U$3.error(`Failed to add cart attributes`,t);}Pr$1.release();}var qo=r=>r,Mn=r=>r.filter(e=>e.removedNodes&&e.removedNodes.length>0);function Fn(r,e={childList:true,subtree:true},t=500,n=qo){return te$2(o=>{let i=new MutationObserver(s=>o(s));return i.observe(r,e),i},(o,i)=>i.disconnect()).pipe(q$2(o=>n(o)),Ir$2(o=>o.length>0),Fe$2(t))}var qn=x$2(Dt$2());var Wn=new U$1,$n=new U$1;function Nl(){return $n.asObservable()}function er$1(){Wn.next();}Wn.pipe(Fe$2(100)).subscribe(zo.bind(void 0));function Ul(){er$1(),Go(),jo();}function Go(){let r=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener(`load`,function(){Hn(this._url).catch(e=>U$3.error(`Unable to process cart change in XMLHttpRequest`,e));}),r.apply(this,arguments)},U$3.verbose(`Securely overwritten window.XMLHttpRequest.send method`);}function jo(){let r=window.fetch;try{window.fetch=async function(e,t){return r(e,t).then(n=>{let o=``;try{o=typeof e==`string`||e instanceof URL?e.toString():e?.url??n?.url??``;}catch{}return Hn(o).catch(i=>U$3.error(`Unable to process cart change in fetch`,i)),n})},U$3.verbose(`Securely overwritten window.fetch method`);}catch(e){console.warn(`Fail to override fetch.`,`Cooee won't be able to track "Add To Cart" and "Remove From Cart" KPI.`),U$3.error(e);}}async function Hn(r){Ko(r)&&er$1();}function Ko(r){return /\/cart\/(add|change|update|clear)/.test(r)}function Xo(r$1,e){let t=r$1?.items,n=e.items,o=[],i=[];if(U$3.verbose(`Comparing cart change with old count ${t?.length} to new count ${n.length}`),n?.forEach(s$4=>{let c=t?.find(d=>d.vID===s$4.vID);if(c){if(c.quantity!==s$4.quantity){let d=c.quantity<s$4.quantity,u=Math.abs(c.quantity-s$4.quantity),p=s$2(r$2({},s$4),{quantity:u});d?o.push(p):i.push(p);}t&&$n$1(t,c);}else o.push(s$4);}),t)for(let s of t)i.push(s);U$3.verbose(`Cart delta: added: ${o.length}, removed: ${i.length}`),o.length&&Bn(`Add To Cart`,{items:o}),i.length&&r$1.token===e.token&&Bn(`Remove From Cart`,{items:i}),(i.length||o.length)&&$n.next({itemsAdded:o,itemsRemoved:i,cart:e});}function Bn(r,e){Vn(new Ir$3(r,e));}async function zo(){Xo(await ce$5.get(`cart`,{}),await h.getCurrent().getNormalisedCart(true));}var P=class r{static cartDrawerToggle$=new Sr$1({open:false,firstOpen:false});static DEFAULT_SELECTOR=`cart-drawer`;static _instance;inShadow=false;cartDrawerElement;cartDrawerShadowElement;configWebsite=le$5.get().website??{};currentState=false;mutationSubscription;mutationObserver;firstOpen=true;selector;shadowParentElementSelector;clickEventListener;refreshUIEventListener;iconSelector=[`button[drawer-to-open="cart-drawer"]`,`a[href="/cart"]`,`.header__icon--cart`,`#cart-icon-bubble`,`.cart-icon-bubble`,`.cart-count`,`a[onclick*="handleFloCartBtn"]`].join(`,`);cartSelector=[r.DEFAULT_SELECTOR,`#halo-cart-sidebar`,`[role="dialog"][class*="cart" i]`,`[id*="section-cart" i]`,`#sidebar-cart`,`#rebuy-cart`,`#mini-cart`,`#flo-cart-wrapper`,`#drawer-cart`,`#UpcartPopupBackDrop`,`[id$="CartDrawer" i]`].join(`,`);constructor(){this.initialize(),this.refreshUIEventListener=this.updateBubble.bind(this),this.clickEventListener=this.manualCartIconClicked.bind(this),document.addEventListener(`letscooee:outbound:refresh-ui`,this.refreshUIEventListener),document.addEventListener(`click`,this.clickEventListener,{capture:true,passive:true});}get element(){return this.cartDrawerElement}static get(){return r._instance||(r._instance=new r),r._instance}static initialize(){r.get();}isOpen(){if(window.cooeeIsCartDrawerVisible)return window.cooeeIsCartDrawerVisible();if(this.cartDrawerElement?.id===`rebuy-cart`)return !!window.Rebuy?.SmartCart?.visible;let e=this.inShadow?this.isPresent():C$2(this.cartDrawerElement);return U$3.info(`Cart drawer is currently ${e?`open`:`close`}`),e}open(){if(this.isOpen()){U$3.log(`Drawer is already open`);return}document.dispatchEvent(new CustomEvent(`letscooee:outbound:open-cart`));let e=document.querySelector(this.iconSelector);if(!e){U$3.verbose(`No clickable cart icon found with selector`,this.iconSelector);return}e.click();}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===r.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id===`mini-cart`}refreshUI(e,t=true){if(window.cooeeUpdateCartDrawer)try{window.cooeeUpdateCartDrawer(e);}catch(n){ke$1(n,`shopify_cart_drawer_update`);}else if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:e}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&e)this.element.classList.remove(`is-empty`),this.element.renderContents?.(e);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!e?.items?.[0])return;let n=e.items[0].id,o=e.items[0].quantity,i=e.items[0].price;window.cartGiftUpdate(n,i,o,``,`ADD_TO_CART`);}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer&&typeof window.theme?.CartDrawer==`function`)window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()===`cart-drawer-component`)document.dispatchEvent(new CustomEvent(`action:cart:updateCartandShowCart`));else if(this.element?.id===`sidebar-cart`)document.body.dispatchEvent(new CustomEvent(`cart:refresh`,{bubbles:true,detail:{}}));else if(this.element?.id===`quick-cart`){let n=document.querySelector(`a[href="/cart"]`);n&&n.click();}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):window.refreshCart?h.getCurrent().getNormalisedCart(true).then(()=>{window.refreshCart(h.getCurrent());}):window.OPEN_CART?window.OPEN_CART():window.updateCart?window.updateCart():window.sjRefreshCart?window.sjRefreshCart():window.CartJS?.getCart?window.CartJS?.getCart():window.updateCartItemJS?window.updateCartItemJS(1,e?.items?.[0]?.id+``):(U$3.info(`No method found to update the cart drawer. Blindly firing some events to try`),document.dispatchEvent(new CustomEvent(`cart:refresh`,{bubbles:true})));document.dispatchEvent(new CustomEvent(`letscooee:outbound:refresh-ui`,{detail:{responseJSON:e,currentCart:h.getCurrent()}})),t&&er$1();}async initialize(){let e=this.configWebsite.cartDrawerSelector;if(!e){await this.findCartDrawer();return}let t=e.split(`:shadow`);t.length===1?(this.selector=t[0],await this.findCartDrawer()):(this.inShadow=true,this.shadowParentElementSelector=t[0]?.trim(),this.selector=t[1]?.trim(),await this.findCartDrawerWithShadow());}async findCartDrawer(){if(!Ze())return;let e=this.selector||this.cartSelector;if(this.cartDrawerElement=await zn$1(e),!this.cartDrawerElement){qn.default.warn(`Max attempts exhausted to find cart drawer`);return}U$3.verbose(`Found`,this.cartDrawerElement,`from selector: ${e}`),this.createMutationObservers();}async findCartDrawerWithShadow(){if(!this.shadowParentElementSelector)return;let t=(await zn$1(this.shadowParentElementSelector))?.shadowRoot;t?.mode===`open`&&(this.cartDrawerShadowElement=t,this.createMutationObservers());}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||this.watchForCartToggle();}watchForCartToggle(){let e=this.cartDrawerElement||this.cartDrawerShadowElement,t=new U$1;this.mutationObserver=new MutationObserver(()=>{t.next();}),this.mutationObserver.observe(e,{attributes:true,subtree:true,childList:this.inShadow}),this.mutationSubscription=t.pipe(we$2(800,void 0,{leading:false,trailing:true})).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,r.cartDrawerToggle$.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=false));});}isPresent(){if(!this.selector||!this.cartDrawerShadowElement)return false;let e=this.cartDrawerShadowElement.querySelector(this.selector);return e?C$2(e):false}async updateBubble(){let e=(await h.getCurrent().getNormalisedCart(true)).itemCount,t=document.querySelector(`.cart-link__bubble`);t&&(t.innerText=e+``);}manualCartIconClicked(e){!e.target.closest(this.iconSelector)||!e.isTrusted||window.CooeeSDK.events.push([`Open Cart`]);}};var Gn=`query getProduct(
|
|
51
|
+
`;function Uo(){le$5.get().skipCartAttribute||Hn().catch(r=>{U$3.error(`Fail to add attributes in cart`,r);});}async function Wn(){let e=await(await fetch(window.Shopify.routes.root+`browsing_context_suggestions.json?country[enabled]=true&country[exclude]=${window.Shopify.country}&language[enabled]=true&language[exclude]=${window.Shopify.language}`)).json(),t=le$5.get().storefrontToken,o=new Headers;o.append(`x-shopify-storefront-access-token`,t),o.append(`Content-Type`,`application/json`),await de$1(Vn,{metafields:[{key:`currentCountry`,ownerId:`gid://shopify/Cart/${h.getCurrent().token}`,type:`single_line_text_field`,value:e.detected_values.country.handle}]},`add-cart-metafields-set`);}function $n(){h.getCurrent().token?Wn().catch(r=>{U$3.error(`Fail to update cart metafields`,r);}):setTimeout($n,500);}async function Hn(){await Dr.acquire();let r=h.getCurrent(),e=await Mr$4();if(r.attributes?.letscooee_did===e.letscooee_did&&r.attributes?.letscooee_sn===e.letscooee_sn){U$3.verbose(`Not calling Shopify update.js API.`,`Current attributes:`,r.attributes),Dr.release();return}try{let t=await we$1(`/cart/update.js`,{attributes:e});U$3.verbose(`Updated cart attributes`,JSON.stringify(t.data)),r.update(t.data);}catch(t){U$3.error(`Failed to add cart attributes`,t);}Dr.release();}var qn=r=>r,Mo=r=>r.filter(e=>e.removedNodes&&e.removedNodes.length>0);function Fo(r,e={childList:true,subtree:true},t=500,o=qn){return te$2(n=>{let i=new MutationObserver(s=>n(s));return i.observe(r,e),i},(n,i)=>i.disconnect()).pipe(q$2(n=>o(n)),Ir$2(n=>n.length>0),Fe$2(t))}var qo=x$2(Dt$2());var Wo=new U$1,$o=new U$1;function Nl(){return $o.asObservable()}function er$1(){Wo.next();}Wo.pipe(Fe$2(100)).subscribe(zn.bind(void 0));function Ul(){er$1(),Gn(),jn();}function Gn(){let r=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener(`load`,function(){Ho(this._url).catch(e=>U$3.error(`Unable to process cart change in XMLHttpRequest`,e));}),r.apply(this,arguments)},U$3.verbose(`Securely overwritten window.XMLHttpRequest.send method`);}function jn(){let r=window.fetch;try{window.fetch=async function(e,t){return r(e,t).then(o=>{let n=``;try{n=typeof e==`string`||e instanceof URL?e.toString():e?.url??o?.url??``;}catch{}return Ho(n).catch(i=>U$3.error(`Unable to process cart change in fetch`,i)),o})},U$3.verbose(`Securely overwritten window.fetch method`);}catch(e){console.warn(`Fail to override fetch.`,`Cooee won't be able to track "Add To Cart" and "Remove From Cart" KPI.`),U$3.error(e);}}async function Ho(r){Kn(r)&&er$1();}function Kn(r){return /\/cart\/(add|change|update|clear)/.test(r)}function Xn(r$1,e){let t=r$1?.items,o=e.items,n=[],i=[];if(U$3.verbose(`Comparing cart change with old count ${t?.length} to new count ${o.length}`),o?.forEach(s$4=>{let c=t?.find(d=>d.vID===s$4.vID);if(c){if(c.quantity!==s$4.quantity){let d=c.quantity<s$4.quantity,g=Math.abs(c.quantity-s$4.quantity),p=s$2(r$2({},s$4),{quantity:g});d?n.push(p):i.push(p);}t&&$n$1(t,c);}else n.push(s$4);}),t)for(let s of t)i.push(s);U$3.verbose(`Cart delta: added: ${n.length}, removed: ${i.length}`),n.length&&Bo(`Add To Cart`,{items:n}),i.length&&r$1.token===e.token&&Bo(`Remove From Cart`,{items:i}),(i.length||n.length)&&$o.next({itemsAdded:n,itemsRemoved:i,cart:e});}function Bo(r,e){Vo(new dr$3(r,e));}async function zn(){Xn(await ce$5.get(`cart`,{}),await h.getCurrent().getNormalisedCart(true));}var D$1=class r{static cartDrawerToggle$=new Sr$1({open:false,firstOpen:false});static DEFAULT_SELECTOR=`cart-drawer`;static _instance;inShadow=false;cartDrawerElement;cartDrawerShadowElement;configWebsite=le$5.get().website??{};currentState=false;mutationSubscription;mutationObserver;firstOpen=true;selector;shadowParentElementSelector;clickEventListener;refreshUIEventListener;iconSelector=[`button[drawer-to-open="cart-drawer"]`,`a[href="/cart"]`,`.header__icon--cart`,`#cart-icon-bubble`,`.cart-icon-bubble`,`.cart-count`,`a[onclick*="handleFloCartBtn"]`].join(`,`);cartSelector=[r.DEFAULT_SELECTOR,`#halo-cart-sidebar`,`[role="dialog"][class*="cart" i]`,`[id*="section-cart" i]`,`#sidebar-cart`,`#rebuy-cart`,`#mini-cart`,`#flo-cart-wrapper`,`#drawer-cart`,`#UpcartPopupBackDrop`,`[id$="CartDrawer" i]`].join(`,`);constructor(){this.initialize(),this.refreshUIEventListener=this.updateBubble.bind(this),this.clickEventListener=this.manualCartIconClicked.bind(this),document.addEventListener(`letscooee:outbound:refresh-ui`,this.refreshUIEventListener),document.addEventListener(`click`,this.clickEventListener,{capture:true,passive:true});}get element(){return this.cartDrawerElement}static get(){return r._instance||(r._instance=new r),r._instance}static initialize(){r.get();}isOpen(){if(window.cooeeIsCartDrawerVisible)return window.cooeeIsCartDrawerVisible();if(this.cartDrawerElement?.id===`rebuy-cart`)return !!window.Rebuy?.SmartCart?.visible;let e=this.inShadow?this.isPresent():C$2(this.cartDrawerElement);return U$3.info(`Cart drawer is currently ${e?`open`:`close`}`),e}open(){if(this.isOpen()){U$3.log(`Drawer is already open`);return}document.dispatchEvent(new CustomEvent(`letscooee:outbound:open-cart`));let e=document.querySelector(this.iconSelector);if(!e){U$3.verbose(`No clickable cart icon found with selector`,this.iconSelector);return}e.click();}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===r.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id===`mini-cart`}refreshUI(e,t=true){if(window.cooeeUpdateCartDrawer)try{window.cooeeUpdateCartDrawer(e);}catch(o){ke$1(o,`shopify_cart_drawer_update`);}else if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:e}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&e)this.element.classList.remove(`is-empty`),this.element.renderContents?.(e);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!e?.items?.[0])return;let o=e.items[0].id,n=e.items[0].quantity,i=e.items[0].price;window.cartGiftUpdate(o,i,n,``,`ADD_TO_CART`);}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer&&typeof window.theme?.CartDrawer==`function`)window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()===`cart-drawer-component`)document.dispatchEvent(new CustomEvent(`action:cart:updateCartandShowCart`));else if(this.element?.id===`sidebar-cart`)document.body.dispatchEvent(new CustomEvent(`cart:refresh`,{bubbles:true,detail:{}}));else if(this.element?.id===`quick-cart`){let o=document.querySelector(`a[href="/cart"]`);o&&o.click();}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):window.refreshCart?h.getCurrent().getNormalisedCart(true).then(()=>{window.refreshCart(h.getCurrent());}):window.OPEN_CART?window.OPEN_CART():window.updateCart?window.updateCart():window.sjRefreshCart?window.sjRefreshCart():window.CartJS?.getCart?window.CartJS?.getCart():window.updateCartItemJS?window.updateCartItemJS(1,e?.items?.[0]?.id+``):(U$3.info(`No method found to update the cart drawer. Blindly firing some events to try`),document.dispatchEvent(new CustomEvent(`cart:refresh`,{bubbles:true})));document.dispatchEvent(new CustomEvent(`letscooee:outbound:refresh-ui`,{detail:{responseJSON:e,currentCart:h.getCurrent()}})),t&&er$1();}async initialize(){let e=this.configWebsite.cartDrawerSelector;if(!e){await this.findCartDrawer();return}let t=e.split(`:shadow`);t.length===1?(this.selector=t[0],await this.findCartDrawer()):(this.inShadow=true,this.shadowParentElementSelector=t[0]?.trim(),this.selector=t[1]?.trim(),await this.findCartDrawerWithShadow());}async findCartDrawer(){if(!Ze())return;let e=this.selector||this.cartSelector;if(this.cartDrawerElement=await zn$1(e),!this.cartDrawerElement){qo.default.warn(`Max attempts exhausted to find cart drawer`);return}U$3.verbose(`Found`,this.cartDrawerElement,`from selector: ${e}`),this.createMutationObservers();}async findCartDrawerWithShadow(){if(!this.shadowParentElementSelector)return;let t=(await zn$1(this.shadowParentElementSelector))?.shadowRoot;t?.mode===`open`&&(this.cartDrawerShadowElement=t,this.createMutationObservers());}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||this.watchForCartToggle();}watchForCartToggle(){let e=this.cartDrawerElement||this.cartDrawerShadowElement,t=new U$1;this.mutationObserver=new MutationObserver(()=>{t.next();}),this.mutationObserver.observe(e,{attributes:true,subtree:true,childList:this.inShadow}),this.mutationSubscription=t.pipe(we$2(800,void 0,{leading:false,trailing:true})).subscribe(()=>{let o=this.isOpen();this.currentState!==o&&(this.currentState=o,r.cartDrawerToggle$.next({open:o,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=false));});}isPresent(){if(!this.selector||!this.cartDrawerShadowElement)return false;let e=this.cartDrawerShadowElement.querySelector(this.selector);return e?C$2(e):false}async updateBubble(){let e=(await h.getCurrent().getNormalisedCart(true)).itemCount,t=document.querySelector(`.cart-link__bubble`);t&&(t.innerText=e+``);}manualCartIconClicked(e){!e.target.closest(this.iconSelector)||!e.isTrusted||window.CooeeSDK.events.push([`Open Cart`]);}};var Go=`query getProduct(
|
|
52
52
|
$id: ID!,
|
|
53
53
|
$firstForVariant: Int = 250,
|
|
54
54
|
$productMetafields: [HasMetafieldsIdentifier!]! = [],
|
|
55
55
|
$variantMetafields: [HasMetafieldsIdentifier!]! = [],
|
|
56
56
|
$language: LanguageCode,
|
|
57
|
+
$country: CountryCode,
|
|
57
58
|
)
|
|
58
|
-
@inContext(language: $language) {
|
|
59
|
+
@inContext(language: $language, country: $country) {
|
|
59
60
|
product(id: $id) {
|
|
60
61
|
id
|
|
61
62
|
title
|
|
@@ -126,7 +127,7 @@ var Fe$1=class Fe{constructor(e,t){this._startTime=e;this._triggerData=t;}interv
|
|
|
126
127
|
}
|
|
127
128
|
}
|
|
128
129
|
}
|
|
129
|
-
`;var xr$1=new Map,tr$1=async r=>{for(let i of r.items)if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(i,r);}catch(s){U$3.error(s);}if(r.isCartEmbed()&&!r.isSubscriptionUpsell()){let s=(await h.getCurrent().getNormalisedCart()).items.map(c=>c.mID);r.items=r.items.filter(c=>!s.includes(c.mID));}if(r.items=
|
|
130
|
+
`;var xr$1=new Map,tr$1=async r=>{for(let i of r.items)if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(i,r);}catch(s){U$3.error(s);}if(r.isCartEmbed()&&!r.isSubscriptionUpsell()){let s=(await h.getCurrent().getNormalisedCart()).items.map(c=>c.mID);r.items=r.items.filter(c=>!s.includes(c.mID));}if(r.items=jo(r),r.isVideoObjective())return await Yn(r.content.videoConfig,r),r.items;let e=r.items.length,t=r.items.map(i=>Xo(i,r)),n=(await Promise.all(t)).filter(i=>i!=null);if(e&&!n.length){let i=`Failed to fetch any product from Ajax API`;throw be$1(new dr$3(`CE Campaign Failed`,{reason:i,currency:r.currency},r)),new Error(i)}return jo(r,n)},jo=(r,e=r.items)=>{if(!r.isCartRecovery())return e;let t=h.getCurrent().items,o=[];for(let n of e)for(let i of n.vars){if(!i.isAvailable)continue;let s=t.find(g=>g.variant_id.toString()===i.mID);if(!s)continue;let c=new vt$2(n);c.name=s.title;let d=new mt$3(i);d.name=s.variant_title,d.price.d=s.discounted_price/100,c.variants=[d],o.push(c);}return o},Yn=async(r,e)=>{await Promise.all(r.videoEntries.map(async t=>{t.video.items=await Promise.all(t.video.items.map(async o=>{return await Xo(o,e)||o}));}));},Xo=async(r,e)=>{if(xr$1.has(r.mID))return xr$1.get(r.mID);let t;try{t=(await de$1(Go,{id:Oo(r.mID,`Product`),language:We$4().locale.toUpperCase(),country:We$4().country,productMetafields:window.cooeeProductMetafields??[],variantMetafields:window.cooeeVariantMetafields??[]},`get-product`)).data;}catch(o){return o instanceof ne$4&&o.response?.status===404||U$3.error(`Error fetching item from Shopify API`,o,{productId:r.mID,engagementTrigger:e}),null}return t?.data?.product?Jn(r,t.data.product):(U$3.error(`Product not found after Storefront call for:`,r),null)},Ko=(r=[])=>r.reduce((e,t)=>(t&&((e[t.namespace]??={})[t.key]=t.value),e),{}),Jn=(r,e)=>{if(!r||!e)return r;r.name=e.title,r.tags=e.tags,r.productType=e.productType,r.slug=e.handle,r.descHtml=e.descriptionHtml,r.link=e.onlineStoreUrl,r.imgs=e.media.nodes.filter(o=>o.image).map(o=>({alt:o.altText,url:o.image?.url})),r.options=e.options.map(o=>({id:$e$1(o.id),name:o.name,optionValues:o.optionValues.map(n=>({id:$e$1(n.id),name:n.name,swatch:n.swatch?{color:n.swatch.color,image:n.swatch.image?{id:$e$1(n.swatch.image.id),alt:n.swatch.image.alt??void 0,url:n.swatch.image.image?.url}:void 0}:void 0}))})),r.flatMetafields=Ko(e.metafields);let t=r.selectedOrFirstVariant.value;return r.vars.map(o=>{let n=e.variants.nodes.find(i=>$e$1(i.id)===o.mID);n!=null&&(o.name=n.title,o.isAvailable=n.availableForSale,o.price.d=+n.price.amount,o.price.effective=o.price.d,o.price.cmp=n.compareAtPrice?+n.compareAtPrice.amount:null,o.link=r.link?`${r.link}?variant=${o.mID}`:``,o.imgs=n.image?[{alt:n.image.altText,url:n.image.url}]:[],o.sku=n.sku,o.selectedOptions=n.selectedOptions,o.flatMetafields=Ko(n.metafields),t.mID===$e$1(n.id)&&(t.effectivePrice.value=o.price.d));}),xr$1.set(r.mID,r),r};var rt=r=>{let e=r instanceof vt$2?r.selectedOrFirstVariant.value.mID:r.vID,t=r instanceof vt$2?r.selectedOrFirstVariant.value.name:r.vName;return {product_id:r.mID,product_name:r.name,variant_id:e,variant_name:t}};var Rr$1=(function(r){return r.NONE=``,r.SHOPIFY=`shopify`,r.THIRD_PARTY=`third_party`,r})(Rr$1||{});function zo(r,e,t){let o=D$1.get();if(r===he$3.OPEN_CART||e===ae$4.CART_DRAWER){o.open(),t&&o.refreshUI(t);return}if(r===he$3.INITIATE_CHECKOUT){Qn();return}if(e===ae$4.CART_PAGE){location.href=`/cart`;return}if(e===ae$4.SHOPIFY_CHECKOUT){location.href=`/checkout`;return}if(e===ae$4.THIRD_PARTY_CHECKOUT){Yo(`/cart#initiate-checkout=1`);return}t&&o.refreshUI(t);}function Qn(){le$5.get().checkoutProvider===Rr$1.THIRD_PARTY?Yo(`/cart#initiate-checkout=1`):location.href=`/checkout`;}function Yo(r){window.triggerGokwikCustomCheckout?window.triggerGokwikCustomCheckout():window.shiprocketCheckoutEvents?.buyCart?window.shiprocketCheckoutEvents.buyCart():window.openCheckout?window.openCheckout():window.handleFloCheckoutBtn?window.handleFloCheckoutBtn():window.openRzpCheckout?window.openRzpCheckout():location.href=r;}var sn=x$2(Dt$2());var _r$1=class _r{origin;path;qs;name;referrer;utmSource;utmMedium;utmCampaign;utmId;utmTerm;utmContent;themeId;themeName;templateSuffix;pageType;constructor(e){this.name=e.name,this.pageType=e.pageType??e.name,this.path=e.path,this.qs=e.qs,this.referrer=e.referrer,this.utmSource=e.utmSource||e.utm_source,this.utmMedium=e.utmMedium||e.utm_medium,this.utmCampaign=e.utmCampaign||e.utm_campaign,this.utmId=e.utmId||e.utm_id,this.utmTerm=e.utmTerm||e.utm_term,this.utmContent=e.utmContent||e.utm_content,this.themeId=e.themeId,this.themeName=e.themeName,this.templateSuffix=e.templateSuffix;}};function rr$1(){let r$2$1=We$4(),e=location.pathname===`/`?location.pathname:location.pathname.replace(/\/+$/,``);return new _r$1(r$2({origin:location.origin,path:e,qs:location.search,referrer:Ye$1(),name:r$2$1.pageName,pageType:r$2$1.pageName,templateSuffix:r$2$1.template.suffix,themeId:window.Shopify.theme.id+``,themeName:window.Shopify.theme.name},Je$1()))}function wm(){let r=We$4(),e=new URLSearchParams(location.search),t=e.get(`cooee-preview`),o=e.get(`cooee-exp-preview`);if(t){let i=t.split(`,`).map(s=>s.trim()).filter(s=>Number.isInteger(+s));i.length&&(r.previewIDs=i);}if(o){let i=o.split(`,`).map(s=>s.trim()).filter(s=>Number.isInteger(+s));i.length&&(r.previewIDs??=[],r.previewIDs.push(...i),r.activeExperiments=true);}let n=e.get(`cooee-variant`)?.trim();n&&(r.previewVariant=n);}function or$1(){let r$3=We$4();return s$2(r$2(s$2(r$2({},r$3.customContext),{page:rr$1(),locale:r$3.locale,currentItem:r$3.currentItem,previewIDs:r$3.previewIDs,previewVariant:r$3.previewVariant,engagementIDs:ei(),cart:Tr$1()}),Zn()),{host:window.location.host})}function Zn(){let r=window.CooeeSDK.uaParser.getResult();return {os:r.os,device:r.device,browser:r.browser}}function ei(){let r=document.querySelectorAll(`.letscooee-engagement`),e=[];return r.forEach(t=>{let o=t.dataset.engagementId;o&&+o&&e.push(o);}),e}var ti=`keepalive`in new Request(``),Ar=new Headers,Or={type:Jr$3,code:Qr$3,version:Q$3};ii();async function ot(){let[r$4]=await Promise.all([tn()]);return r$2(r$2({},or$1()),r$4)}function $m(r){le$2(K$1).then(()=>ri(r??{})).catch(e=>U$3.error(`Session not established, skipping updateProfile`,e));}function ri(r){Zo(`/v1/user/update`,r).then(()=>{U$3.verbose(`Updated user profile`);}).catch(e=>{U$3.error(`Error saving user profile`,e);});}function Jo(r){return re$1(`/v1/event/generate-discount`,r)}function Hm(r){le$2(K$1).then(()=>oi({props:r})).catch(e=>U$3.error(`Session not established, skipping updateDeviceProps`,e));}function oi(r){Zo(`/v1/device/update`,r).then(()=>{U$3.verbose(`Updated device properties`);}).catch(async e=>{U$3.error(`Error saving device property`,e);});}function Qo(r){r&&(Or.firstSeen=r.toUTCString());}function re$1(r,e){return en(`POST`,r,e)}function Zo(r,e){return en(`PUT`,r,e)}async function en(r$5,e,t){if(!Ze())return U$3.log(`Rejecting ${r$5} ${e} as this is not e-commerce app`),Promise.reject();e.startsWith(`http`)||(e.includes(`/event/track`)?e=(window.CooeeSDK.apiURLs?.eventURL||fe$3.apiURL)+e:e=(window.CooeeSDK.apiURLs?.baseURL||fe$3.cdnApiURL)+e);let o=t?s$2(r$2({},t),{sdkMeta:Or}):void 0;if(o&&(o.deviceId=ce$5.getVisitorOldId(),o.visitorId=ce$5.getVisitorId(),o.shopifyShop=window.Shopify?.shop,o.shopName=_o()),o&&!ti&&e.includes(Lr))return ni(e,Ar,o);let n={method:r$5,headers:Ar,keepalive:false};return o&&(n.body=JSON.stringify(o)),mn$1(e,n)}function ni(r,e,t){return new Promise((o,n)=>{let i=new XMLHttpRequest;i.open(`POST`,r,true),e.forEach((s,c)=>{i.setRequestHeader(c,s);}),i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(i.status>=200&&i.status<300)try{if(i.getResponseHeader(`Content-Type`)?.includes(`application/json`))o({data:JSON.parse(i.responseText),headers:e,request:i,status:i.status,statusText:i.statusText});else n(new Error(`Content-Type of response header is not json`));}catch(s){n(s);}else n(new Error(`Received status - ${i.status}(${i.statusText})`));},i.onerror=()=>{n(new Error(`Network error occurred during the request.`));},i.send(JSON.stringify(t));})}function ii(){Ar.set(`Content-Type`,`text/plain; charset=utf-8`);let r=localStorage.getItem(`cooeeDebugTill`);(r&&new Date(+r)>new Date)&&(Or.debug=true);}var si=`
|
|
130
131
|
mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {
|
|
131
132
|
cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
|
|
132
133
|
cart {
|
|
@@ -138,7 +139,7 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {
|
|
|
138
139
|
}
|
|
139
140
|
}
|
|
140
141
|
}
|
|
141
|
-
`,Se$1=class Se{static applyDiscountUsingRedirect(e,t,n
|
|
142
|
+
`,Se$1=class Se{static applyDiscountUsingRedirect(e,t,o,n){let i=`${location.origin}/discount/${e}`;if(U$3.log(`Applying discount code ${e}`,t,o),t===ae$4.CART_PAGE){location.href=`${i}?redirect=/cart`;return}if(t===ae$4.CART_DRAWER||n===he$3.OPEN_CART){location.href=`${i}?redirect=${location.pathname}#open-cart-drawer=1`;return}if(t===ae$4.SHOPIFY_CHECKOUT){location.href=`${i}?redirect=/checkout`;return}if(t===ae$4.THIRD_PARTY_CHECKOUT||n===he$3.INITIATE_CHECKOUT){location.href=`${i}?redirect=/cart#initiate-checkout=1`;return}location.href=`${i}?redirect=${o||location.pathname}`;}static async applyWithStorefront(e){let t={cartId:`gid://shopify/Cart/${h.getCurrent().token}`,discountCodes:e};U$3.verbose(`Applying ${e.length} coupons on cart`),await de$1(si,t,`storefront-apply-discount`);}};var rn=x$2(Se$4());var ai=`
|
|
142
143
|
mutation cartCreate($input: CartInput) {
|
|
143
144
|
cartCreate(input: $input) {
|
|
144
145
|
cart {
|
|
@@ -151,21 +152,21 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]!) {
|
|
|
151
152
|
}
|
|
152
153
|
}
|
|
153
154
|
}
|
|
154
|
-
`;function no(r){let e=P.get();if(window.cooeeGetCartSections&&typeof window.cooeeGetCartSections==`function`)try{return {sections_url:window.location.pathname,sections:window.cooeeGetCartSections()}}catch(t){ke$1(t,`shopify_cart_sections_fetch`,{engagementTrigger:r});}else {if(e.isMiniCart())return {sections:[`mini-cart`]};if(e.isShopifyDefaultDrawer())return {sections:e.element.getSectionsToRender?.().map((t=>t.section??t.id))}}return {}}async function kr$1(r$6,e){if(!he$4.hasKeys(r$6)){U$3.warn(`No update fields provided`);return}let t=no(e),n=r$2(r$2({},r$6),t);try{let o=await we$1(`/cart/update.js`,n);return U$3.log(`Updated cart`,r$6),h.getCurrent().update(o.data),o.data}catch(o){ke$1(o,`shopify_cart_update`),e.content?.showSnackBar!==false&&jn$1(`Failed to update item in cart`);}}var pe=class{async addToCart(e,t){if(!e.length)return;let n=e.map(s=>{let{vID:c,vName:d,quantity:u}=this.getVariantDetails(s),p=t.getPrivateAttributesForLineItem();if(he$4.hasKeys(window.CooeeSDK.customItemProperties)){let T={name:d},g={templateSuffix:s.templateSuffix},y=ro.render(JSON.stringify(window.CooeeSDK.customItemProperties),{variant:T,product:g});p=r$2(r$2({},JSON.parse(y)),p);}let C=s.selectedOrFirstVariant?.value?.selectedSellingPlan?.value;return r$2({id:c?+c:+s.mID,quantity:u,properties:p},C&&{selling_plan:C.mID})}),o=no(t),i=r$2({items:n},o);try{let s=await we$1(`/cart/add.js`,i);return U$3.log(`Added ${e.length} items to Cart`),t.content?.showSnackBar!==!1&&jn$1(`Product added to your cart`),s.data}catch(s){ke$1(s,`shopify_cart_item_add`,{engagementTrigger:t});let c=[`Failed to add product in cart.`];if(s instanceof ne$4&&s.is40x()&&s.responseText){let d=s.responseText;d.description&&c.push(`Reason: ${d.description}`);}c.push(`Please try again later.`),t.content?.showSnackBar!==false&&jn$1(c.join(` `));}}async copyDiscountCode(e){if(e)try{await navigator.clipboard.writeText(e),U$3.log(`Code-${e} copied`),jn$1(`Discount code copied`);}catch(t){U$3.error(`Failed to copy code`,t);}}getProductURL(e){if(!e?.link)return;let t=An(e.link);if(t)return We$1(`/products/`+t)}async upgradeToSubscription(e,t){if(!e){U$3.warn(`Trying to upgrade to subscription with no item`);return}let n=await h.getCurrent().getNormalisedCart(),o=e.selectedOrFirstVariant.value,i=n.items.findIndex(d=>d.vID===o.mID),s=o.selectedSellingPlan.value,c={line:i+1,selling_plan:s?.mID||null,properties:t.getPrivateAttributesForLineItem()};try{let d=await we$1(`/cart/change.js`,c);return U$3.log(`Upgraded ${e} selling plan`),jn$1(`Line item updated`),h.getCurrent().update(d.data),d.data}catch(d){ke$1(d,`shopify_cart_subscription_switch`,{engagementTrigger:t}),jn$1(`Failed to update subscription`);}}async createNewCart(e,t,n){if(!e?.vID){U$3.error(`No variant ID found to perform Buy now`,e);return}let o=t?[t]:[];return (await de$1(ai,{input:{lines:[{merchandiseId:`gid://shopify/ProductVariant/${e.vID}`,quantity:1,attributes:n.getKVFormatPrivateAttributesForLineItem()}],discountCodes:o,attributes:await Kn$1(`Buy Now`)}},`storefront-create-cart`)).data.data?.cartCreate?.cart?.checkoutUrl}async process(e){let t=e.clickAction,n=e.items,o=e.triggerData,i;if(t.at){let s=t;U$3.log(`Performing ${JSON.stringify(s)} action`);let c={};if(s.at===he$3.GO_TO_PRODUCT)i=this.getProductURL(n[0]);else if(s.at===he$3.ADD_TO_CART)n?.length&&await this.addToCart(n,o);else if(s.at===he$3.COPY_COUPON_CODE)await this.copyDiscountCode(o.discount?.code),c.discountCode=o.discount?.code;else if(s.at===he$3.OPEN_CART)P.get().open();else if(s.at===he$3.GO_TO_COLLECTION){let d=e.collections;if(!d?.length)return;i=We$1(`/collections/`+d[0].handle);}c.products=n.map(rt),c.redirectTo=i,ot(s.at,c);}t.applyDiscount&&o.discount?.code?Se$1.applyDiscountUsingRedirect(o.discount.code,o.redirectBehaviour,i):i&&(location.pathname=i);}getVariantDetails(e){let t,n,o;if(e instanceof pt$2)t=e.vID,n=e.vName,o=e.quantity??1;else {if(!e.vars?.length)return {};t=e.selectedOrFirstVariant.value.mID,n=e.selectedOrFirstVariant.value.name,o=e.selectedQty.value;}return {vID:t,quantity:o,vName:n}}};async function oo(r$7,e){if(!he$4.hasKeys(e)){U$3.warn(`No update fields provided`);return}let t=r$2({id:r$7.key},e);try{let n=await we$1(`/cart/change.js`,t);U$3.log(`Updated line-item`,r$7),h.getCurrent().update(n.data);}catch(n){ke$1(n,`shopify_cart_item_update`);}}var Ge$1=class Ge{constructor(e){this.triggerContext=e;}async execute(e){let t=We$4().currentItem,n=e.clickAction;if(!n)return;let o=e.item,i=this.triggerContext,s=new pe,c=i.triggerData.redirectBehaviour,d=!!i.triggerData.discount?.type&&!!n?.applyDiscount,u={selectedVariants:i.triggerData.nonMutableItems.map(f=>({itemMID:f.mID,mID:f.selectedOrFirstVariant.value.mID,variantID:f.selectedOrFirstVariant.value.mID})),eID:i.triggerData.engagementID,cID:i.triggerData.contentID},p=``,C=[],T=[];if(o?T=[o.toEmbed()]:e.embeddedItem&&(T=[e.embeddedItem]),n.at===he$3.ADD_BUNDLE){let f=i.selectedItems;if(T=e.embeddedItems??f.map(L=>L.toEmbed()),i.shouldGiveFBTDiscount||e.embeddedItems?.length){let L;e.embeddedItems?L=e.embeddedItems.map(_=>({itemMID:_.mID,mID:_.vID,variantID:_.vID,quantity:_.quantity})):L=f.map(_=>({itemMID:_.mID,mID:_.selectedOrFirstVariant.value.mID,variantID:_.selectedOrFirstVariant.value.mID}));let ue=i.triggerData.bundleFrom;i.triggerData.isBundleOnCartDrawer()&&ue&&(L.push({itemMID:ue.mID,mID:ue.selectedOrFirstVariant.value.mID,isPrimary:true}),T.unshift(ue.toEmbed())),u.selectedVariants=L,i.triggerData.isBundleOnPDP()&&u.selectedVariants.forEach(_=>{_.itemMID===t.mID&&(_.isPrimary=true);});}else u=void 0;C=e.embeddedItems??f;}else if(n.at===he$3.INITIATE_CHECKOUT){let f=await h.getCurrent().getNormalisedCart();T=f.items,u.selectedVariants=f.items.map(L=>({itemMID:L.mID,mID:L.vID}));}else if(n.at===he$3.ADD_TO_CART)C=o?[o]:[e.embeddedItem];else if(n.at===he$3.QUICK_VIEW){window.cooeeShowQuickItem(this.triggerContext,o),this.sendTriggerClicked(T,{from:`button`},e.video);return}else if(n.at===he$3.GO_TO_PRODUCT)p=o?We$1(`/products/`+o.slug):e.embeddedItem?.link;else if(n.at===he$3.GO_TO_URL){let f=Hn$1(n.gu?.u);window.CooeeSDK.allowExternalURL?f&&(p=f.href):f&&(p=f.pathname+f.search+f.hash);}else if(n.at===he$3.UPGRADE_TO_SUBSCRIPTION){let f=await s.upgradeToSubscription(o,i.triggerData);this.triggerContext.triggerData.content?.subsUpgradeConfig?.skipSubscribedItems&&this.triggerContext.renderer.destroy(),P.get().refreshUI(f);}else if(n.at===he$3.GO_TO_COLLECTION){let f=this.triggerContext.triggerData.collections?.[0];f&&(p=`/collections/`+f.handle);}if(this.sendTriggerClicked(T,{from:`button`},e.video),U$3.verbose({redirectPath:p,afterAtcAction:c,hasDiscount:d}),!d&&p){ot(n.at,{redirectTo:p}),location.href=p;return}let g,y=false;try{g=await this.getOrGenerateDiscountCode(u),U$3.verbose(`Discount code (if any) to apply`,g);}catch(f){if(!this.triggerContext.triggerData.isBYOB()){io.default.error(`Unable to get a discount code`,f);return}}if(g&&n.at===he$3.COPY_COUPON_CODE)await s.copyDiscountCode(g);else if(n.at===he$3.BUY_NOW){let f=await s.createNewCart(t,g,i.triggerData);f&&(ot(n.at,{products:[rt(t)],redirectTo:f}),location.href=f);return}try{g&&await Se$1.applyWithStorefront([g]);}catch(f){U$3.error(f),y=true;}let b;if(C?.length&&(b=await s.addToCart(C,i.triggerData)),ot(n.at,{products:C.map(rt),redirectTo:p,discountCode:g}),y&&g){Se$1.applyDiscountUsingRedirect(g,c,p,n.at);return}if(p){location.href=p;return}zn(n.at,c,b);}sendTriggerClicked(e,t,n){let o=new Ir$3(`CE Trigger Clicked`,t,this.triggerContext.triggerData);o.items=e,o.setVideos(n),be$1(o);}async getOrGenerateDiscountCode(e){let t=this.triggerContext.triggerData.discount;if(!t?.type)return;let n=``;if(t.type===H$1.STATIC){if(!t.code)throw _n$1(`No discount code found`,`warning`,{triggerContext:this.triggerContext}),new Error(`No discount code found`);return t.code}if(e){if(n=await ci(e,this.triggerContext),!n)throw U$3.error(`No discount code found`,e),new Error(`Discount code not found or generated`);return n}}};function ot(r$8,e){document.dispatchEvent(new CustomEvent(`letscooee:outbound:cta-executed`,{detail:r$2({action:he$3[r$8]},e)}));}async function ci(r,e){try{return (await Jn(r)).data.code}catch(t){throw jn$1(`Failed to generate a discount code`),ke$1(t,`discount_backend_generate`,{triggerContext:e}),t}}var E$1=class E extends M$4{mediaStyle={};deviceTypeKey;clickExecutor;componentWillMount(){this.deviceTypeKey=M$3()?`sm`:`lg`,this.clickExecutor=new Ge$1(this.props.triggerContext);}getCompiledStyles(){return this.putStyleAccordingToDevice(),r$2(r$2(s$2(r$2(r$2(r$2(r$2(r$2(r$2({},En(this.mediaStyle.flex)),In(this.mediaStyle.bg)),Nn$2(this.mediaStyle.br)),gn(this.mediaStyle.size)),Sn(this.mediaStyle.spc)),vn(this.mediaStyle.lout)),{boxSizing:`border-box`,outline:`none`}),this.getComponentStyles()),this.props.style)}matchWhenCondition(e){if(!e?.op)return true;let{lhs:t,rhs:n}=e;switch(e.op){case `eq`:return t===n;case `gt`:return +t>+n;case `gte`:return +t>=+n;case `lt`:return +t<+n;case `lte`:return +t<=+n;case `ne`:return t!==n;case `null`:return t==null;case `notNull`:return t!=null;case `empty`:return t.trim()===``;case `notEmpty`:return t.trim()!==``;case `in`:return new RegExp(`\\b${n}\\b`).test(t);case `nin`:return !new RegExp(`\\b${n}\\b`).test(t);default:return U$3.error(`Invalid operator found for when condition - ${e.op}`),false}}getClasses(e){return this.props.element.classes?(e??=``,e+` `+this.props.element.classes):e??``}putStyleAccordingToDevice(){let e=this.props.element;this.mediaStyle=e.style.lg,M$3()&&e.style.sm&&Object.keys(e.style.sm).length&&(this.mediaStyle=r$2(r$2({},this.mediaStyle),e.style.sm));}sendTriggerClicked(e,t){this.clickExecutor.sendTriggerClicked(e,t);}async onClick(e,t){e.stopPropagation(),t.clickAction||(t.clickAction=this.props.element.clc),t.clickAction?.at&&await this.clickExecutor.execute(t);}};var li=0;function l$2(r,e,t,n,o,i){e||(e={});var s,c,d$1$1=e;if(`ref`in d$1$1)for(c in d$1$1={},e)c==`ref`?s=e[c]:d$1$1[c]=e[c];var u={type:r,props:d$1$1,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--li,__i:-1,__u:0,__source:o,__self:i};if(typeof r==`function`&&(s=r.defaultProps))for(c in s)d$1$1[c]===void 0&&(d$1$1[c]=s[c]);return d$1.vnode&&d$1.vnode(u),u}var B$2=class B extends E$1{componentDidMount(){this.setState(()=>({text:this.props.element.text})),rt$2(this.onChange.bind(this));}componentWillReceiveProps(e){this.props.element=e.element,this.onChange();}render(){let e=this.getCompiledStyles(),t=this.state.text;return t||(e.display=`none`,t=``),l$2(`div`,{style:e,onClick:this.customOnClick.bind(this),className:this.getClasses(`lc-text`),children:l$2(`span`,{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:t}})})}customOnClick(){this.props.onClick&&this.props.onClick(`title`);}onChange(){if(this.props.element.text==null)return;let e=this.props.triggerContext.triggerData,t={bundle:e.discountData.value,customer:e.customerData,cart:e.getCartMagicVariables()},o=new bt$1(We$3(this.props.element,t,this.props.triggerContext));if(!this.matchWhenCondition(o.when)){this.setState(()=>({text:``}));return}this.setState(()=>({text:o.text}));}getComponentStyles(){return r$2({},On$1(this.mediaStyle.typo))}getSpanStyle(){return {overflow:`hidden`,display:`-webkit-box`,webkitBoxOrient:`vertical`,webkitLineClamp:2,color:`inherit`,fontSize:`inherit`,fontWeight:`inherit`,fontFamily:`inherit`}}};var Ie$1=class Ie extends B$2{render(){let e=this.props.element?.clc,t=e?.at?`lc-button-at-${e.at}`:``;return l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-button `+t),onClick:n=>this.onClick(n,{item:this.props.item}),children:l$2(`span`,{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:this.state.text}})})}getComponentStyles(){return s$2(r$2({},super.getComponentStyles()),{cursor:`pointer`})}};var Nr=class extends M$4{render(){if(this.props.element.show[this.props.label.toLowerCase()])return this.props.element.lblPos===`end`?l$2(`div`,{style:r$2(r$2({},this.getElementStyle()),this.props.styles),children:[l$2(`span`,{children:this.props.time}),l$2(`span`,{style:this.getTimeLabelStyle(),children:this.props.label})]}):l$2(`div`,{style:r$2(r$2({},this.getElementStyle()),this.props.styles),children:[l$2(`span`,{style:this.getTimeLabelStyle(),children:this.props.label}),l$2(`span`,{children:this.props.time})]})}getDesign(){}getTimeLabelStyle(){return {fontSize:`0.5em`,alignContent:`center`}}getElementStyle(){let e={display:`flex`,flexDirection:`column`,placeContent:`center center`,textAlign:`center`};return this.props.element.horizontal&&(e.gridTemplateColumns=`repeat(2, minmax(0, 1fr))`),e}},it=class extends B$2{labels={Days:`00`,Hours:`00`,Minutes:`00`,Seconds:`00`};componentWillMount(){super.componentWillMount(),this.setState(()=>r$2({},this.labels)),this.processAndStartTimer();}render(){return l$2(`div`,{style:this.getLabelsParentStyle(),className:this.getClasses(),children:Object.keys(this.labels).map(e=>l$2(Nr,{styles:this.getCompiledStyles(),label:e,time:this.state[e],element:this.props.element}))})}getLabelsParentStyle(){return {display:`grid`,justifyContent:`center`,gridTemplateColumns:`repeat(4, auto)`,gap:P$2(this.props.element.gap)}}getDisplayStyles(){return {display:`grid`,placeContent:`center center`}}getComponentStyles(){return r$2(r$2({},super.getComponentStyles()),this.getDisplayStyles())}processAndStartTimer(){this.props.element.timer.start(this.props.element.timerType,e=>{this.labels.Days=String(e.days).padStart(2,`0`),this.labels.Hours=String(e.hours).padStart(2,`0`),this.labels.Minutes=String(e.minutes).padStart(2,`0`),this.labels.Seconds=String(e.seconds).padStart(2,`0`),this.setState(()=>r$2({},this.labels));});}};function or$1(r,e){if(!r)return;let t={loop:e.loop,slidesPerView:e.maxInRow,spaceBetween:e.gap+`px`,pagination:{type:e.pagination.type,el:r.querySelector(`.swiper-pagination`),clickable:true,renderBullet:(o,i)=>`
|
|
155
|
+
`;function on(r){let e=D$1.get();if(window.cooeeGetCartSections&&typeof window.cooeeGetCartSections==`function`)try{return {sections_url:window.location.pathname,sections:window.cooeeGetCartSections()}}catch(t){ke$1(t,`shopify_cart_sections_fetch`,{engagementTrigger:r});}else {if(e.isMiniCart())return {sections:[`mini-cart`]};if(e.isShopifyDefaultDrawer())return {sections:e.element.getSectionsToRender?.().map((t=>t.section??t.id))}}return {}}async function kr$1(r$6,e){if(!he$4.hasKeys(r$6)){U$3.warn(`No update fields provided`);return}let t=on(e),o=r$2(r$2({},r$6),t);try{let n=await we$1(`/cart/update.js`,o);return U$3.log(`Updated cart`,r$6),h.getCurrent().update(n.data),n.data}catch(n){ke$1(n,`shopify_cart_update`),e.content?.showSnackBar!==false&&jn$1(`Failed to update item in cart`);}}var pe=class{async addToCart(e,t){if(!e.length)return;let o=e.map(s=>{let{vID:c,vName:d,quantity:g}=this.getVariantDetails(s),p=t.getPrivateAttributesForLineItem();if(he$4.hasKeys(window.CooeeSDK.customItemProperties)){let I={name:d},u={templateSuffix:s.templateSuffix},y=rn.render(JSON.stringify(window.CooeeSDK.customItemProperties),{variant:I,product:u});p=r$2(r$2({},JSON.parse(y)),p);}let C=s.selectedOrFirstVariant?.value?.selectedSellingPlan?.value;return r$2({id:c?+c:+s.mID,quantity:g,properties:p},C&&{selling_plan:C.mID})}),n=on(t),i=r$2({items:o},n);try{let s=await we$1(`/cart/add.js`,i);return U$3.log(`Added ${e.length} items to Cart`),t.content?.showSnackBar!==!1&&jn$1(`Product added to your cart`),s.data}catch(s){ke$1(s,`shopify_cart_item_add`,{engagementTrigger:t});let c=[`Failed to add product in cart.`];if(s instanceof ne$4&&s.is40x()&&s.responseText){let d=s.responseText;d.description&&c.push(`Reason: ${d.description}`);}c.push(`Please try again later.`),t.content?.showSnackBar!==false&&jn$1(c.join(` `));}}async copyDiscountCode(e){if(e)try{await navigator.clipboard.writeText(e),U$3.log(`Code-${e} copied`),jn$1(`Discount code copied`);}catch(t){U$3.error(`Failed to copy code`,t);}}getProductURL(e){if(!e?.link)return;let t=Ao(e.link);if(t)return We$1(`/products/`+t)}async upgradeToSubscription(e,t){if(!e){U$3.warn(`Trying to upgrade to subscription with no item`);return}let o=await h.getCurrent().getNormalisedCart(),n=e.selectedOrFirstVariant.value,i=o.items.findIndex(d=>d.vID===n.mID),s=n.selectedSellingPlan.value,c={line:i+1,selling_plan:s?.mID||null,properties:t.getPrivateAttributesForLineItem()};try{let d=await we$1(`/cart/change.js`,c);return U$3.log(`Upgraded ${e} selling plan`),jn$1(`Line item updated`),h.getCurrent().update(d.data),d.data}catch(d){ke$1(d,`shopify_cart_subscription_switch`,{engagementTrigger:t}),jn$1(`Failed to update subscription`);}}async createNewCart(e,t,o){if(!e?.vID){U$3.error(`No variant ID found to perform Buy now`,e);return}let n=t?[t]:[];return (await de$1(ai,{input:{lines:[{merchandiseId:`gid://shopify/ProductVariant/${e.vID}`,quantity:1,attributes:o.getKVFormatPrivateAttributesForLineItem()}],discountCodes:n,attributes:await Kn$1(`Buy Now`)}},`storefront-create-cart`)).data.data?.cartCreate?.cart?.checkoutUrl}async process(e){let t=e.clickAction,o=e.items,n=e.triggerData,i;if(t.at){let s=t;U$3.log(`Performing ${JSON.stringify(s)} action`);let c={};if(s.at===he$3.GO_TO_PRODUCT)i=this.getProductURL(o[0]);else if(s.at===he$3.ADD_TO_CART)o?.length&&await this.addToCart(o,n);else if(s.at===he$3.COPY_COUPON_CODE)await this.copyDiscountCode(n.discount?.code),c.discountCode=n.discount?.code;else if(s.at===he$3.OPEN_CART)D$1.get().open();else if(s.at===he$3.GO_TO_COLLECTION){let d=e.collections;if(!d?.length)return;i=We$1(`/collections/`+d[0].handle);}c.products=o.map(rt),c.redirectTo=i,nt$1(s.at,c);}t.applyDiscount&&n.discount?.code?Se$1.applyDiscountUsingRedirect(n.discount.code,n.redirectBehaviour,i):i&&(location.pathname=i);}getVariantDetails(e){let t,o,n;if(e instanceof pt$2)t=e.vID,o=e.vName,n=e.quantity??1;else {if(!e.vars?.length)return {};t=e.selectedOrFirstVariant.value.mID,o=e.selectedOrFirstVariant.value.name,n=e.selectedQty.value;}return {vID:t,quantity:n,vName:o}}};async function nn(r$7,e){if(!he$4.hasKeys(e)){U$3.warn(`No update fields provided`);return}let t=r$2({id:r$7.key},e);try{let o=await we$1(`/cart/change.js`,t);U$3.log(`Updated line-item`,r$7),h.getCurrent().update(o.data);}catch(o){ke$1(o,`shopify_cart_item_update`);}}var Ge$1=class Ge{constructor(e){this.triggerContext=e;}async execute(e){let t=We$4().currentItem,o=e.clickAction;if(!o)return;let n=e.item,i=this.triggerContext,s=new pe,c=i.triggerData.redirectBehaviour,d=!!i.triggerData.discount?.type&&!!o?.applyDiscount,g={selectedVariants:i.triggerData.nonMutableItems.map(f=>({itemMID:f.mID,mID:f.selectedOrFirstVariant.value.mID,variantID:f.selectedOrFirstVariant.value.mID})),eID:i.triggerData.engagementID,cID:i.triggerData.contentID},p=``,C=[],I=[];if(n?I=[n.toEmbed()]:e.embeddedItem&&(I=[e.embeddedItem]),o.at===he$3.ADD_BUNDLE){let f=i.selectedItems;if(I=e.embeddedItems??f.map(L=>L.toEmbed()),i.shouldGiveFBTDiscount||e.embeddedItems?.length){let L;e.embeddedItems?L=e.embeddedItems.map(_=>({itemMID:_.mID,mID:_.vID,variantID:_.vID,quantity:_.quantity})):L=f.map(_=>({itemMID:_.mID,mID:_.selectedOrFirstVariant.value.mID,variantID:_.selectedOrFirstVariant.value.mID}));let ge=i.triggerData.bundleFrom;i.triggerData.isBundleOnCartDrawer()&&ge&&(L.push({itemMID:ge.mID,mID:ge.selectedOrFirstVariant.value.mID,isPrimary:true}),I.unshift(ge.toEmbed())),g.selectedVariants=L,i.triggerData.isBundleOnPDP()&&g.selectedVariants.forEach(_=>{_.itemMID===t.mID&&(_.isPrimary=true);});}else g=void 0;C=e.embeddedItems??f;}else if(o.at===he$3.INITIATE_CHECKOUT){let f=await h.getCurrent().getNormalisedCart();I=f.items,g.selectedVariants=f.items.map(L=>({itemMID:L.mID,mID:L.vID}));}else if(o.at===he$3.ADD_TO_CART)C=n?[n]:[e.embeddedItem];else if(o.at===he$3.QUICK_VIEW){window.cooeeShowQuickItem(this.triggerContext,n),this.sendTriggerClicked(I,{from:`button`},e.video);return}else if(o.at===he$3.GO_TO_PRODUCT)p=n?We$1(`/products/`+n.slug):e.embeddedItem?.link;else if(o.at===he$3.GO_TO_URL){let f=Hn$1(o.gu?.u);window.CooeeSDK.allowExternalURL?f&&(p=f.href):f&&(p=f.pathname+f.search+f.hash);}else if(o.at===he$3.UPGRADE_TO_SUBSCRIPTION){let f=await s.upgradeToSubscription(n,i.triggerData);this.triggerContext.triggerData.content?.subsUpgradeConfig?.skipSubscribedItems&&this.triggerContext.renderer.destroy(),D$1.get().refreshUI(f);}else if(o.at===he$3.GO_TO_COLLECTION){let f=this.triggerContext.triggerData.collections?.[0];f&&(p=`/collections/`+f.handle);}if(this.sendTriggerClicked(I,{from:`button`},e.video),U$3.verbose({redirectPath:p,afterAtcAction:c,hasDiscount:d}),!d&&p){nt$1(o.at,{redirectTo:p}),location.href=p;return}let u,y=false;try{u=await this.getOrGenerateDiscountCode(g),U$3.verbose(`Discount code (if any) to apply`,u);}catch(f){if(!this.triggerContext.triggerData.isBYOB()){sn.default.error(`Unable to get a discount code`,f);return}}if(u&&o.at===he$3.COPY_COUPON_CODE)await s.copyDiscountCode(u);else if(o.at===he$3.BUY_NOW){let f=await s.createNewCart(t,u,i.triggerData);f&&(nt$1(o.at,{products:[rt(t)],redirectTo:f}),location.href=f);return}try{u&&await Se$1.applyWithStorefront([u]);}catch(f){U$3.error(f),y=true;}let S;if(C?.length&&(S=await s.addToCart(C,i.triggerData)),nt$1(o.at,{products:C.map(rt),redirectTo:p,discountCode:u}),y&&u){Se$1.applyDiscountUsingRedirect(u,c,p,o.at);return}if(p){location.href=p;return}zo(o.at,c,S);}sendTriggerClicked(e,t,o){let n=new dr$3(`CE Trigger Clicked`,t,this.triggerContext.triggerData);n.items=e,n.setVideos(o),be$1(n);}async getOrGenerateDiscountCode(e){let t=this.triggerContext.triggerData.discount;if(!t?.type)return;let o=``;if(t.type===H$1.STATIC){if(!t.code)throw _n(`No discount code found`,`warning`,{triggerContext:this.triggerContext}),new Error(`No discount code found`);return t.code}if(e){if(o=await ci(e,this.triggerContext),!o)throw U$3.error(`No discount code found`,e),new Error(`Discount code not found or generated`);return o}}};function nt$1(r$8,e){document.dispatchEvent(new CustomEvent(`letscooee:outbound:cta-executed`,{detail:r$2({action:he$3[r$8]},e)}));}async function ci(r,e){try{return (await Jo(r)).data.code}catch(t){throw jn$1(`Failed to generate a discount code`),ke$1(t,`discount_backend_generate`,{triggerContext:e}),t}}var E$1=class E extends M$4{mediaStyle={};deviceTypeKey;clickExecutor;componentWillMount(){this.deviceTypeKey=M$3()?`sm`:`lg`,this.clickExecutor=new Ge$1(this.props.triggerContext);}getCompiledStyles(){return this.putStyleAccordingToDevice(),r$2(r$2(s$2(r$2(r$2(r$2(r$2(r$2(r$2({},En(this.mediaStyle.flex)),On$1(this.mediaStyle.bg)),Nn$2(this.mediaStyle.br)),gn$1(this.mediaStyle.size)),Sn$1(this.mediaStyle.spc)),vn$1(this.mediaStyle.lout)),{boxSizing:`border-box`,outline:`none`}),this.getComponentStyles()),this.props.style)}matchWhenCondition(e){if(!e?.op)return true;let{lhs:t,rhs:o}=e;switch(e.op){case `eq`:return t===o;case `gt`:return +t>+o;case `gte`:return +t>=+o;case `lt`:return +t<+o;case `lte`:return +t<=+o;case `ne`:return t!==o;case `null`:return t==null;case `notNull`:return t!=null;case `empty`:return t.trim()===``;case `notEmpty`:return t.trim()!==``;case `in`:return new RegExp(`\\b${o}\\b`).test(t);case `nin`:return !new RegExp(`\\b${o}\\b`).test(t);default:return U$3.error(`Invalid operator found for when condition - ${e.op}`),false}}getClasses(e){return this.props.element.classes?(e??=``,e+` `+this.props.element.classes):e??``}putStyleAccordingToDevice(){let e=this.props.element;this.mediaStyle=e.style.lg,M$3()&&e.style.sm&&Object.keys(e.style.sm).length&&(this.mediaStyle=r$2(r$2({},this.mediaStyle),e.style.sm));}sendTriggerClicked(e,t){this.clickExecutor.sendTriggerClicked(e,t);}async onClick(e,t){e.stopPropagation(),t.clickAction||(t.clickAction=this.props.element.clc),t.clickAction?.at&&await this.clickExecutor.execute(t);}};var li=0;function l$2(r,e,t,o,n,i){e||(e={});var s,c,d$1$1=e;if(`ref`in d$1$1)for(c in d$1$1={},e)c==`ref`?s=e[c]:d$1$1[c]=e[c];var g={type:r,props:d$1$1,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--li,__i:-1,__u:0,__source:n,__self:i};if(typeof r==`function`&&(s=r.defaultProps))for(c in s)d$1$1[c]===void 0&&(d$1$1[c]=s[c]);return d$1.vnode&&d$1.vnode(g),g}var B$2=class B extends E$1{componentDidMount(){this.setState(()=>({text:this.props.element.text})),rt$2(this.onChange.bind(this));}componentWillReceiveProps(e){this.props.element=e.element,this.onChange();}render(){let e=this.getCompiledStyles(),t=this.state.text;return t||(e.display=`none`,t=``),l$2(`div`,{style:e,onClick:this.customOnClick.bind(this),className:this.getClasses(`lc-text`),children:l$2(`span`,{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:t}})})}customOnClick(){this.props.onClick&&this.props.onClick(`title`);}onChange(){if(this.props.element.text==null)return;let e=this.props.triggerContext.triggerData,t={bundle:e.discountData.value,customer:e.customerData,cart:e.getCartMagicVariables()},n=new Rt$3(We$3(this.props.element,t,this.props.triggerContext));if(!this.matchWhenCondition(n.when)){this.setState(()=>({text:``}));return}this.setState(()=>({text:n.text}));}getComponentStyles(){return r$2({},In$1(this.mediaStyle.typo))}getSpanStyle(){return {overflow:`hidden`,display:`-webkit-box`,webkitBoxOrient:`vertical`,webkitLineClamp:2,color:`inherit`,fontSize:`inherit`,fontWeight:`inherit`,fontFamily:`inherit`}}};var Te=class extends B$2{render(){let e=this.props.element?.clc,t=e?.at?`lc-button-at-${e.at}`:``;return l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-button `+t),onClick:o=>this.onClick(o,{item:this.props.item}),children:l$2(`span`,{style:this.getSpanStyle(),dangerouslySetInnerHTML:{__html:this.state.text}})})}getComponentStyles(){return s$2(r$2({},super.getComponentStyles()),{cursor:`pointer`})}};var Nr=class extends M$4{render(){if(this.props.element.show[this.props.label.toLowerCase()])return this.props.element.lblPos===`end`?l$2(`div`,{style:r$2(r$2({},this.getElementStyle()),this.props.styles),children:[l$2(`span`,{children:this.props.time}),l$2(`span`,{style:this.getTimeLabelStyle(),children:this.props.label})]}):l$2(`div`,{style:r$2(r$2({},this.getElementStyle()),this.props.styles),children:[l$2(`span`,{style:this.getTimeLabelStyle(),children:this.props.label}),l$2(`span`,{children:this.props.time})]})}getDesign(){}getTimeLabelStyle(){return {fontSize:`0.5em`,alignContent:`center`}}getElementStyle(){let e={display:`flex`,flexDirection:`column`,placeContent:`center center`,textAlign:`center`};return this.props.element.horizontal&&(e.gridTemplateColumns=`repeat(2, minmax(0, 1fr))`),e}},it=class extends B$2{labels={Days:`00`,Hours:`00`,Minutes:`00`,Seconds:`00`};componentWillMount(){super.componentWillMount(),this.setState(()=>r$2({},this.labels)),this.processAndStartTimer();}render(){return l$2(`div`,{style:this.getLabelsParentStyle(),className:this.getClasses(),children:Object.keys(this.labels).map(e=>l$2(Nr,{styles:this.getCompiledStyles(),label:e,time:this.state[e],element:this.props.element}))})}getLabelsParentStyle(){return {display:`grid`,justifyContent:`center`,gridTemplateColumns:`repeat(4, auto)`,gap:L$4(this.props.element.gap)}}getDisplayStyles(){return {display:`grid`,placeContent:`center center`}}getComponentStyles(){return r$2(r$2({},super.getComponentStyles()),this.getDisplayStyles())}processAndStartTimer(){this.props.element.timer.start(this.props.element.timerType,e=>{this.labels.Days=String(e.days).padStart(2,`0`),this.labels.Hours=String(e.hours).padStart(2,`0`),this.labels.Minutes=String(e.minutes).padStart(2,`0`),this.labels.Seconds=String(e.seconds).padStart(2,`0`),this.setState(()=>r$2({},this.labels));});}};function nr(r,e){if(!r)return;let t={loop:e.loop,slidesPerView:e.maxInRow,spaceBetween:e.gap+`px`,pagination:{type:e.pagination.type,el:r.querySelector(`.swiper-pagination`),clickable:true,renderBullet:(n,i)=>`
|
|
155
156
|
<span class="${i}"
|
|
156
157
|
style="background-color: ${e.pagination.color?.rgba};"></span>
|
|
157
|
-
`,renderProgressbar:
|
|
158
|
-
<span class="${
|
|
158
|
+
`,renderProgressbar:n=>`
|
|
159
|
+
<span class="${n}"
|
|
159
160
|
style="background-color: ${e.pagination.color?.rgba};">
|
|
160
161
|
</span>
|
|
161
|
-
`},navigation:{nextEl:r.querySelector(`.swiper-button-next`),prevEl:r.querySelector(`.swiper-button-prev`)},autoplay:e.autoplay?.enabled?{delay:e.autoplay?.delay,disableOnInteraction:false,pauseOnMouseEnter:false}:false,autoHeight:true};e.marquee&&t.autoplay&&typeof t.autoplay==`object`&&(t.speed=e.speed,t.autoplay.pauseOnMouseEnter=true,r.style.setProperty(`--swiper-wrapper-transition-timing-function`,`linear`));let n=new window.CooeeSDK.Swiper(r,t);return r.style.setProperty(`--swiper-navigation-size`,`${e.navigation.size}px`),n}function ir$1(r,e,t){let n={color:r.navigation.color?.rgba};return r.pagination.enabled&&(n.transform=`translateY(-25%)`),l$2(`div`,{class:`swiper-container`,ref:e,style:`max-width: 100%`,children:[l$2(`div`,{class:`swiper-wrapper`,children:t()}),r.navigation.enabled&&l$2(`div`,{class:`swiper-button-next`,style:n,children:l$2(`span`,{})}),r.navigation.enabled&&l$2(`div`,{class:`swiper-button-prev`,style:n,children:l$2(`span`,{})}),r.pagination.enabled&&l$2(`div`,{className:`swiper-pagination`,style:{color:r.pagination.color?.rgba}})]})}var gp=()=>{let r=window.ShopifyAnalytics?.meta??{},e=r.selectedVariantId;if(e)return e;if(r.product?.variants?.length>0)return r.product.variants[0].id},Ur=r=>{if(!r)return;let e;try{e=new URL(r);}catch{return}if(e.hostname!==`cdn.shopify.com`)return r;let t=e.pathname.split(`.`);return t.length!==2?r:(e.pathname=t[0]+`_large.`+t[1],e.toString())};var st$1=class st extends E$1{componentDidMount(){rt$2(()=>{this.setState(()=>({checked:this.props.item.selected.value}));});}render(){return l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-checkbox`),children:l$2(`input`,{type:`checkbox`,checked:this.state.checked,onChange:this.onChange.bind(this),style:{appearance:`auto`}})})}onChange(e){let{checked:t}=e.target;this.props.item.selected.value=t;}getTypoStyles(){let e={},t=this.mediaStyle.typo??new W$2;return e.textAlign=t.alignment,e.justifyContent=t.alignment,e}getComponentStyles(){return s$2(r$2({},this.getTypoStyles()),{display:`flex`})}};var ne$1=class ne extends E$1{constructor(e,t){super(e,t);}render(){let e=this.props.element[this.deviceTypeKey],t=e?.src||this.props.element.src||this.props.element.lg?.src;return l$2(`img`,{onClick:this.customOnClick.bind(this),alt:e?.name||`Image`,className:this.getClasses(`lc-image`),onMouseEnter:this.handleMouseEnter.bind(this),onMouseLeave:this.handleMouseLeave.bind(this),src:t,style:this.getCompiledStyles()})}customOnClick(e){this.props.element.clc?.at===he$3.ADD_TO_CART&&this.props.triggerContext.triggerData.items[0]&&this.onClick(e,{item:this.props.triggerContext.triggerData.items[0]}),this.props.onClick&&this.props.onClick(`image`);}getComponentStyles(){let e=this.mediaStyle.lout;if(!e||e.pos!==`absolute`)return {};let t={zIndex:e.zIndex,cursor:this.props.element.clc?.at?`pointer`:`auto`};return this.mediaStyle.size?.w&&(t.width=this.mediaStyle.size.w),this.mediaStyle.size?.h&&(t.height=this.mediaStyle.size.h),t}handleMouseEnter(e){let t=this.props.element[this.deviceTypeKey]?.secondarySrc;t&&(e.currentTarget.src=t);}handleMouseLeave(e){e.currentTarget.src=this.props.element[this.deviceTypeKey]?.src;}};var oe$1=class oe extends E$1{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-flexbox`),children:l$2(ge,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})})}getComponentStyles(){let e=this.mediaStyle.flex??new gt$2,t={display:`flex`,gap:e.gap+`px`,flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai};return e.wrap===`nowrap`&&e.scroll&&(e.dir===`column`?t[`overflow-y`]=`auto`:t[`overflow-x`]=`auto`),t}};var at$1=class at extends oe$1{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-flexbox`),children:l$2(je$1,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext,item:this.props.item,productVariables:this.props.productVariables,noLinks:this.props.noLinks})})}};var ct$1=class ct extends E$1{render(){return l$2(`select`,{style:this.getCompiledStyles(),value:this.props.selectedVariant.selectedSellingPlan.value?.mID??``,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:this.getClasses(`lc-dropdown`),children:this.createSelectItems()})}componentDidMount(){rt$2(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:false}));});}getComponentStyles(){let e={};return this.props.selectedVariant.sellingPlans?.length||(e.visibility=`hidden`),r$2(r$2({},e),On$1(this.mediaStyle.typo))}createSelectItems(){let e=[],t=this.props.selectedVariant;if(!t.sellingPlans?.length)return [];this.props.triggerContext.triggerData.content?.subsUpgradeConfig?.skipSubscribedItems?t.selectedSellingPlan.value||(t.sellingPlans[0].isSelected=true,t.changeSellingPlan(t.sellingPlans[0])):e.push(l$2(`option`,{value:``,selected:!t.selectedSellingPlan,children:`One time purchase`}));for(let n of t.sellingPlans??[])e.push(l$2(`option`,{value:n.mID,selected:n.isSelected,children:n.name}));return e}onChange(e){let t=e.target.value;t?this.props.selectedVariant.selectedSellingPlan.value=this.props.selectedVariant.sellingPlans.find(n=>n.mID===t):this.props.selectedVariant.selectedSellingPlan.value=void 0;}};var mi=new RegExp(`fill="#[a-zA-Z0-9]+"`),lt$1=class lt extends E$1{constructor(){super();}render(){let e=this.getCompiledStyles(),t=this.getRating();return t||(e.display=`none`,t=``),l$2(`div`,{style:e,className:this.getClasses(`lc-star-rating`),dangerouslySetInnerHTML:{__html:t}})}getRating(){let e={size:this.props.element.iconSize,color:this.props.element.c.hex},t=Fe$3(this.props.element.fullStar,{svg:e},this.props.triggerContext),n=Fe$3(this.props.element.halfStart,{svg:e},this.props.triggerContext),o=this.props.review;if(!o?.rating)return ``;let i=``;if(this.props.element.showSingleStar)i=t;else {let s=5,c=`${o.rating}`.split(`.`);for(let d=0;d<+c[0];d++)i+=t,s--;c[1]&&(i+=n,s--);for(let d=0;d<s;d++)i+=t.replace(mi,`fill="#f1f1f1"`);}return i}getComponentStyles(){return {display:`flex`,alignItems:`center`}}};var mt$1=class mt extends E$1{render(){return l$2(`select`,{style:this.getCompiledStyles(),value:this.props.item.selectedOrFirstVariant.value.mID,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:this.getClasses(`lc-dropdown`),children:this.createSelectItems()})}componentDidMount(){rt$2(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:false}));});}getComponentStyles(){let e={};return this.props.item.vars?.length===1&&this.props.item.vars[0].name===`Default Title`&&(e.visibility=`hidden`),r$2(r$2({},e),On$1(this.mediaStyle.typo))}createSelectItems(){let e=[];for(let t of this.props.item.vars)e.push(l$2(`option`,{value:t.mID,disabled:!t.isAvailable,children:t.name}));return e}onChange(e){let t=e.target.value,n=this.props.item.vars.find(o=>o.mID===t);this.props.item.setSelectedVariant(n);}};var je$1=class je extends E$1{constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`}));}renderElement(e){if(!(e.hide||!this.matchWhenCondition(e.when))){if(e.t===4){let t=e;return t.l===`Star Rating`&&!this.props.item.reviews?.rating?void 0:l$2(at$1,{element:t,triggerContext:this.props.triggerContext,elements:t.elems,item:this.props.item,productVariables:this.props.productVariables,noLinks:this.props.noLinks})}if(e.t===6){let t=this.props.triggerContext,n=t.triggerData;return n.isBundle()||n.isAddOns()?l$2(st$1,{element:e,item:this.props.item,triggerContext:t}):void 0}if(e.t===8){let t=e;if(!t.templateName)return ``;try{if(!/^[a-zA-Z0-9_-]+$/.test(t.templateName))return U$3.error(`Invalid partial template name`,t.templateName),``;let n=Fe$3(`{{ @include("${t.templateName}", it) /}}`,this.props.productVariables??{});return l$2(`div`,{className:`lc-partial-`+t.templateName,dangerouslySetInnerHTML:{__html:n}})}catch(n){return U$3.error(`Failed to render partial element`,t.templateName,this.props.productVariables,n),``}}if(e.t===13){let t=e,n=this.props.item,o=Ur(n.variantImage??n.firstImageURL),i=Ur(n.variantSecondaryImage??n.secondaryImageURL);t.lg=t.sm={src:o,name:n.name,secondarySrc:i};let s=l$2(ne$1,{element:t,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?s:l$2(`a`,{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:`block`},children:s})}if(e.t===14)return this.renderProductTitle(e);if(e.t===15){let t=e;return this.props.triggerContext.triggerData.isCartEmbed()&&this.props.item.vars?.length===1&&this.props.item.vars[0].name===`Default Title`?void 0:t.type!==`SINGLE`?l$2(`cooee-product-options-picker`,{item:this.props.item,styles:t.style,horizontal:t.horizontal,dropdownType:t.type}):l$2(mt$1,{element:t,item:this.props.item,triggerContext:this.props.triggerContext})}return e.t===16?l$2(ct$1,{element:e,selectedVariant:this.props.item.selectedOrFirstVariant.value,item:this.props.item,triggerContext:this.props.triggerContext}):e.t===19?l$2(lt$1,{element:e,triggerContext:this.props.triggerContext,review:this.props.item.reviews}):e.t===18||e.t===3?l$2(Ie$1,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):l$2(ge,{elements:[e],element:this.props.element,triggerContext:this.props.triggerContext})}}render(){return this.attachListener(),this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return {}}renderProductTitle(e){let t=l$2(B$2,{element:e,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?t:l$2(`a`,{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:`block`,textDecoration:this.state.decoration},onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),children:t})}customOnClick(e){this.sendTriggerClicked([this.props.item.toEmbed()],{from:e});}onMouseEnter(){this.setState(()=>({decoration:`underline`}));}onMouseLeave(){this.setState(()=>({decoration:`unset`}));}attachListener(){document.addEventListener(`letscooee:variant-change`,e=>{let t=e;if(!t.detail||this.props.item.mID!==t.detail.productID)return;let n=t.detail.variantID;this.props.item.setSelectedVariantByID(n);});}};var Te=class extends E$1{productElement;constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`}));}render(){let e=this.props.item,t=this.getProductData();if(this.productElement=new me(We$3(this.props.element,t,this.props.triggerContext)),this.productElement.hide||!this.matchWhenCondition(this.productElement.when))return;let o=this.getClasses([`lc-single-product`,...e.cardClasses??[]].join(` `));return l$2(`div`,{style:r$2({},this.getCompiledStyles()),className:o,children:l$2(je$1,{element:this.productElement,elements:this.productElement.elems,triggerContext:this.props.triggerContext,item:this.props.item,productVariables:t,noLinks:this.productElement.noLinks})})}getComponentStyles(){return {flexShrink:0}}getProductData(){if(!this.props.item)return {};let e=this.props.item,t=e.selectedOrFirstVariant.value,n=e.getTemplateVariables();n.product.quantity=this.props.item.quantity;let o=this.props.triggerContext.triggerData.discount?.type===H$1.BXGY;return !t.hasEffectivePrice()&&o&&(n.product=s$2(r$2(r$2({},n.product),Gn$1(`effective_price`,t.effectivePrice.value)),{price:``})),n.variant.quantity=t.quantity,{product:n.product,variant:n.variant,svg:{color:`{{ svg.color }}`,size:`{{ svg.size }}`}}}};var dt$1=class dt extends E$1{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,t){super(e,t),this.configuration=M$3()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+`px`;}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&Vi$2().then(()=>{this.swiperInstance=or$1(this.swiperRef,this.props.element.conf[this.deviceTypeKey]);});}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy();}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let t;if(this.configuration.disp===2){let n=i=>{this.swiperRef=i;},o=()=>e?.map(i=>l$2(`div`,{class:`swiper-slide`,children:this.getProductFragment(i)}));t=l$2(`div`,{style:s$2(r$2({},this.getCompiledStyles()),{display:`block`}),className:this.getClasses(`lc-product-swiper-list`),children:ir$1(this.configuration,n,o)});}else t=l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-product-list`),children:e?.map((n,o)=>this.getProductFragment(n,o!==e.length-1))});return t}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),t={display:e?`flex`:`grid`,justifyContent:`safe `+(this.mediaStyle.flex?.jc??`center`),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??`row`};if(t.flexDirection===`row`){if(e)t.maxWidth=`100%`,t.overflowY=`auto`;else if(this.configuration.disp===1){let n=this.props.triggerContext.triggerData,o=n.items.length,i;n.isBundle()?i=this.props.element.prod.symbol?.hide!==true?o*2-1:o:i=this.props.element.conf[this.deviceTypeKey].maxInRow,t.gridTemplateColumns=`repeat(${i}, auto)`;}}return t}getProductFragment(e,t=false){return l$2(ct$3,{children:[l$2(Te,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&t&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&l$2(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`},children:l$2(B$2,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var pt$1=class pt extends E$1{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t);}componentDidMount(){Vi$2().then(()=>{this.swiperInstance=or$1(this.swiperRef,this.props.element.conf);});}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy();}render(){let e=this.props.element,t=o=>{this.swiperRef=o;},n=()=>{let o=e.values?.map(c=>l$2(`div`,{class:`swiper-slide`,onClick:d=>this.onClick(d,{clickAction:this.getClickAction(c)}),children:this.renderElement(c)}));if(!o?.length)return [];let i=e.conf,s=o.length;if(i.marquee&&s<=Number(i.maxInRow)){let c=Number(i.maxInRow)-s+1;for(let d=0;d<c;d++)o.push(o[d%s]);}return o};return ir$1(e.conf,t,n)}getComponentStyles(){return {}}renderElement(e){let t=this.valueAddedSlide(this.props.element.slide,e);switch(t?.t){case 1:return l$2(ne$1,{element:t,triggerContext:this.props.triggerContext});case 4:return l$2(oe$1,{elements:t.elems,element:t,triggerContext:this.props.triggerContext});default:U$3.warn(`Unknown slide type for carousal`);}}valueAddedSlide(e,t){let n=We$3(e,{form:t},this.props.triggerContext);return F.getParsedElement(n)}getClickAction(e){return We$3(this.props.element.clc??{},{form:e},this.props.triggerContext)}};var ge=class extends E$1{constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`})),rt$2(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}));});}renderElement(e){if(!e.hide){if(e.t===4){let t=e;return l$2(oe$1,{element:t,triggerContext:this.props.triggerContext,elements:t.elems})}if(e.t===61)return l$2(it,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?l$2(Ie$1,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return l$2(B$2,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return l$2(ne$1,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return l$2(dt$1,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return l$2(Te,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return l$2(pt$1,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return {}}};var gt$1=class gt extends E$1{clickAction;isClickable;constructor(e,t){super(e,t),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===he$3.GO_TO_URL&&!!Hn$1(this.clickAction.gu?.u)||this.clickAction?.at===he$3.OPEN_CART||this.clickAction?.at===he$3.INITIATE_CHECKOUT;}componentDidMount(){rt$2(()=>{let e=this.props.triggerContext.triggerData,t=this.props.triggerContext.selectedItems;e.calculateDiscountData(t,this.props.triggerContext.shouldGiveFBTDiscount);});}render(){return l$2(ct$3,{children:[l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-container`),onClick:e=>{this.onClick(e,{clickAction:this.clickAction});},children:l$2(ge,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id===`preview`&&l$2(`div`,{class:`letscooee-preview-badge`,children:[`#`,this.props.triggerContext.triggerData.shortID,` preview`]})]})}getComponentStyles(){let e={position:`relative`,overflow:`hidden`,display:`block`};return this.isClickable&&(e.cursor=`pointer`),e}};var R$1=class r$9{constructor(e){this.engagementTrigger=e;this.triggerContext=new Fe$1(new Date,this.engagementTrigger);}static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;triggerContext;observers=[];parentOuterShadowElement;renderedCount=0;scrollSubscription;isExclusionWithBVariation;isProcessing=false;lockReleased$=new U$1;renderSilently(){this.acquireProcessingLock()||this.render().finally(()=>this.releaseProcessingLock()).catch(e=>{ke$1(e,`widget_render`,{triggerContext:this.triggerContext});});}destroy(){U$3.verbose(`${this.engagementTrigger} will be destroyed`),this.preDestroy(),this.removeFromRendered(),this.rootContainer?.remove(),r$9.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID),Mi$2(this.engagementTrigger.content?.afterDeleteJS);}matches(e){return this.engagementTrigger.shortID===e.shortID}async render(){if(this.engagementTrigger.shouldGetVariationImmediately()){let e=await this.getVariation();this.handleVariationResponse(e);}if(this.rootContainer=await this.getWidgetContainer(true),!this.rootContainer){U$3.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.afterRootContainerCreated(),await this.getVariationIfRequired(),await this.runChoresBeforeRender(),this.attachScroll(),this.checkAndSendEvent(),this.triggerContext.renderer=this,Mi$2(this.engagementTrigger.content?.afterRenderJS);}async updateAndReRender(e){await this.waitForLockRelease(),this.acquireProcessingLock();try{this.updateItems(e.items,this.engagementTrigger.items),await this.update(e),await this.render();}finally{this.releaseProcessingLock();}}async update(e){this.engagementTrigger.variation=e.variation;}async rerenderIfDeleted(){if(!this.rootContainer?.isConnected&&!this.acquireProcessingLock()){U$3.info(`${this.engagementTrigger} deleted. Will be re-rendered`);try{this.preDestroy(),await this.render();}finally{this.releaseProcessingLock();}}}updateAngularWidget(){return this.widgetElement?.isConnected?(this.widgetElement.update(),true):false}preDestroy(){this.scrollSubscription?.unsubscribe(),this.observers.forEach(e=>{e?.disconnect&&e.disconnect();});}acquireProcessingLock(){return this.isProcessing?(U$3.verbose(`Lock could not be acquired for ${this.engagementTrigger}`),true):(U$3.verbose(`Acquiring rendering lock for ${this.engagementTrigger}`),this.isProcessing=true,false)}releaseProcessingLock(){U$3.verbose(`Releasing rendering lock for ${this.engagementTrigger}`),this.isProcessing=false,this.lockReleased$.next();}async waitForLockRelease(){this.isProcessing&&await le$2(this.lockReleased$);}afterRootContainerCreated(){}isAllOkToRender(){return !!this.engagementTrigger.widget}async getVariationIfRequired(){if(this.engagementTrigger.shouldSkipVariation()){U$3.verbose(`${this.engagementTrigger} already has necessary data to render`);return}let e=await this.observeWidgetContainerInViewport();this.handleVariationResponse(e);}handleVariationResponse(e){if(!e)return;let t=this.engagementTrigger;U$3.log(`${t} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(t.items=e.items.map(n=>new vt$2(n)),t.nonMutableItems=e.items.map(n=>new vt$2(n))),e.bundleFrom&&(t.bundleFrom=new vt$2(e.bundleFrom)),e.discount&&(t.discount=e.discount),e.placement&&(t.placement=e.placement),he$4.hasKeys(e.stickyATCConfig)&&(t.stickyATCConfig=e.stickyATCConfig),e.props&&he$4.hasKeys(e.props)&&(t.props=r$2(r$2({},t.props),e.props)),e.content&&(t.content=new tt(e.content)),t.widget=new qe$1(e.widget),t.contentID=e.contentID,t.variation=e.variation,t.placement=e.placement,t.entryAnimation=e.entryAnimation??`NONE`,this.isExclusionWithBVariation=t.isExclusionTesting()&&t.variation===`b`,this.isExclusionWithBVariation&&(this.rootContainer.style.height=`0.5px`);}addToRendered(){this.renderedCount++,U$3.info(`${this.engagementTrigger} rendered \u2705 ${Xn$1(this.renderedCount)} time`);}removeFromRendered(){this instanceof G?De.delete(this):Ke$1.delete(this);}async getVariation(){U$3.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id===`preview`};try{return (await so(e)).data}catch(t){t instanceof ne$4&&t.response?.status;return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){U$3.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let e=window.innerHeight*.3,t={root:null,rootMargin:`${e}px 0px ${e}px 0px`,threshold:0};return this.isInViewport()?this.getVariation():new Promise(n=>{let o=new IntersectionObserver((i,s)=>{i.forEach(async c=>{if(c.isIntersecting){U$3.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);n(await this.getVariation()),s.unobserve(this.rootContainer);}});},t);o.observe(this.rootContainer),this.observers.push(o);})}attachScroll(){this.scrollSubscription=Tr$2(window,`scroll`).pipe(Fe$2(r$9.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent();});}checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(r$9.engagementIDsWithTrackedDisplay.has(e)||!this.isInViewport())return;let n={};this.triggerContext.triggerData.items?.length&&(n.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let i=new Ir$3(this.isExclusionWithBVariation?`CE Campaign Holdout`:`CE Trigger Displayed`,n,this.engagementTrigger);i.name===`CE Campaign Holdout`&&(i.trigger.holdout=true),be$1(i),r$9.engagementIDsWithTrackedDisplay.add(e),this.scrollSubscription?.unsubscribe();}generateParentElementID(){return `letscooee-${this.engagementTrigger.shortID}`}createAngularWidget(e){let t=this.widgetElement=document.createElement(e);return t.cart=h.getCurrent(),t.triggerContext=this.triggerContext,t.engagementTrigger=this.engagementTrigger,t.setAttribute(`engagement`,this.engagementTrigger.shortID),this.rootContainer.appendChild(t),this.addToRendered(),this.injectOuterCSSOnly(),t}getParentElement(e,t=document){let n=t.getElementById(e);if(n)return n;let o=this.engagementTrigger.objective.toLowerCase().replaceAll(`_`,`-`),i=this.engagementTrigger.shortID;n=document.createElement(`div`),n.id=e;let s=`letscooee letscooee-engagement engagement-${i} lc-${o}`;return this.engagementTrigger.content?.classes&&(s+=` ${this.engagementTrigger.content.classes}`),n.className=s,n.dataset.engagementId=i,this.engagementTrigger.id===`preview`&&(n.className+=` letscooee-preview`),n.style.display=`block`,n.style.minHeight=`0.5px`,n.style.minWidth=`0.5px`,n}async startRendering(){let e=this.rootContainer,t=this.triggerContext.triggerData.hasSwiperElement();t&&(e=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:`open`}),Hi$2(e)),this.injectCampaignCSS(t,e);let n=this.engagementTrigger.widget;$e$2(Yr$2(gt$1,{element:n.cont,triggerContext:this.triggerContext,elements:n.elems}),e),this.addToRendered();}injectCampaignCSS(e,t){let n=this.engagementTrigger.content?.outerCSS?.trim()??``,o=this.engagementTrigger.content?.innerCSS?.trim()??``,i=this.engagementTrigger.content?.globalCSS?.trim()??``;if(i&&le$4(i),!n&&!o)return;let s=this.rootContainer.id;if(e){le$4(o,t),this.injectOuterCSSOnly();return}le$4(`#${s} { ${n+`
|
|
162
|
-
${o}`} }`,this.parentOuterShadowElement);}injectOuterCSSOnly(){let e=this.engagementTrigger.content?.outerCSS?.trim();if(!e)return;let t=this.rootContainer.id;le$4(`#${t} { ${e} }`);}isInViewport(){let e=this.rootContainer?.getBoundingClientRect();if(!e)return false;let t=window.innerHeight||document.documentElement.clientHeight,s=(Math.min(e.bottom,t)-Math.max(e.top,0))*e.width/(e.width*e.height)*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let t=await this.createParentElementWithPlacement(e);if(t)return t;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(e){let t=this.engagementTrigger.placement;if(!t?.selector)return U$3.info(`\u26A0\uFE0F${this.engagementTrigger} does not have a selector`),null;let n=t.selector,o;if(n.includes(`:shadow`)){let d=n.split(`:shadow`);o=(await zn$1(d[0].trim()))?.shadowRoot,n=d[1].trim(),o&&(this.parentOuterShadowElement=o,Hi$2(o,false));}U$3.verbose(`${this.engagementTrigger} attempt to render "${t.position}" "${n}"`);let i=await zn$1(n,3,o??document);if(!i)return U$3.warn(`${this.engagementTrigger} no placement found with ${n}`),null;let s=this.generateParentElementID(),c=this.getParentElement(s);if(!e)return c;switch(t.position){case fe$2.BEFORE1:case fe$2.BEFORE:i.parentElement?.insertBefore(c,i);break;case fe$2.INSIDE_FIRST1:case fe$2.INSIDE_FIRST:i.insertBefore(c,i.firstChild);break;case fe$2.INSIDE_LAST1:case fe$2.INSIDE_LAST:i.appendChild(c);break;case fe$2.AFTER1:case fe$2.AFTER:default:i.parentElement?.insertBefore(c,i.nextSibling);}return c}async runChoresBeforeRender(){if(this.isExclusionWithBVariation)return;if(!this.isAllOkToRender()){U$3.info(`\u26A0\uFE0F ${this.engagementTrigger} could not be rendered`);return}U$3.verbose(`${this.engagementTrigger} will be rendered`);let e;try{e=await tr$1(this.engagementTrigger);}catch(t){U$3.info(`\u203C\uFE0F${this.engagementTrigger} could not render as items failed to refresh`,t);return}if(!this.engagementTrigger.isCollectionPromoted()&&!e?.length&&this.engagementTrigger.isProductPromoted()){U$3.info(`\u203C\uFE0F${this.engagementTrigger} could not render as no products promoted`);return}this.engagementTrigger.items=e,await this.startRendering();}updateItems(e,t){let n=this.getItemDiff(e,t),o=this.getItemDiff(t,e);t.push(...n);for(let i of o)te$1.remove(t,i);}getItemDiff(e,t){return e.filter(n=>!t.some(o=>o.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}};var G=class extends R$1{constructor(e){super(e);}async rerenderAfterCartOpened(){await this.rerenderIfDeleted(),this.checkAndSendEvent();}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}checkAndSendEvent(){if(!P.get().isOpen()&&We$4().pageName!==`cart`){U$3.log(`Do not send display event as neither the cart drawer nor the cart page is open.`);return}return super.checkAndSendEvent()}};var sr$1=class r{constructor(e,t){this.engagementTrigger=e;this.element=t;this.cartItems=h.getCurrent().items;}cartItems;static renderCartUpsell(e){let t=e.placement;if(!t?.selector){U$3.warn(`No placement available for ${e.objective}`,e.shortID);return}let n=Array.from(document.querySelectorAll(t.selector));if(!n?.length){U$3.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let o of n)new r(e,o).render();}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.content?.subsUpgradeConfig?.skipSubscribedItems&&e.selling_plan_allocation)return;let t=this.engagementTrigger.items.find(p=>p.mID===e.product_id.toString());if(!t)return;let n=t.vars.find(p=>p.mID===e.id.toString());if(!n)return;let o=new mt$3(n),i=e.selling_plan_allocation?.selling_plan;if(i)for(let p of o.sellingPlans??[])p.mID===i.id.toString()&&(p.isSelected=true,o.changeSellingPlan(p));let s=new vt$2(t);s.vars=[o],s.selectedOrFirstVariant.value=o;let c=`lc-cart-item-${this.engagementTrigger.shortID}-${t.mID}`;this.element.classList.add(c);let d=new q$1(this.engagementTrigger);d.placement.selector=`.${c}`,d.items=[s];let u=new G(d);u.renderSilently(),this.watchForCartItemDeletion(u,c);}watchForCartItemDeletion(e,t){let n=new MutationObserver(o=>{o.forEach(i=>{i.removedNodes.forEach(s=>{s===this.element&&(U$3.verbose(`${t} has been removed`),e.destroy(),n.disconnect());});});});n.observe(this.element.parentElement,{childList:true,subtree:true});}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(t=>{if(!(e.includes(t.url)||e.includes(t.variant_id))&&(!e.includes(t.product_title)||t.variant_title&&!e.includes(t.variant_title)))return false;let n=t.selling_plan_allocation?.selling_plan?.name;return !(n&&!e.includes(n))})}};var ar$1=class ar extends R$1{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-collection-filter`);}};var cr$1=class cr extends G{constructor(e){super(e);}async update(e){await super.update(e),this.engagementTrigger.progressBarConfig.update(e.progressBarConfig),await this.checkMilestoneTryCatch(),this.updateAngularWidget();}isAllOkToRender(){return !!this.engagementTrigger.progressBarConfig}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget(`cooee-progressbar`),await this.checkMilestoneTryCatch();}async checkMilestoneTryCatch(){try{await this.checkMilestone();}catch(e){ke$1(e,`progressbar_milestones_apply`,{engagementTrigger:this.engagementTrigger});}}async checkMilestone(){let e=await h.getCurrent().getNormalisedCart(true),t=this.engagementTrigger.progressBarConfig,n=[],o=[],i=[],s,c,d=[...t.milestones];for(let u of d){if(u.rewardType!==ve$4.FREE_AUTO_GIFT)continue;if(u.isUIOnly&&!u.allowATC){U$3.verbose(`Skipping milestone ${u.label} as it is UI only and does not allow ATC`);continue}let p=u.items[0],C=u.reached,T=e.items.find(g=>(g.vID===p.vID||g.mID===p.mID)&&g.properties._letscooee_campaign===this.engagementTrigger.shortID);C&&(s=u,c=T),T&&n.push(T),!C&&T&&t.removeIneligibleItem?(U$3.verbose(`Removing free gift ${T.vID} from cart`),i.push(T)):C&&!T&&(U$3.verbose(`Adding free gift ${p.vID} to cart`),o.push(p));}t.restrictToLatestFreebie&&s&&(c?(n=n.filter(u=>u.vID!==c.vID),o=[]):o=[s.items[0]],i.push(...n)),t.treatFreebieAsSeparateLineItem?await this.handleSeparateFreebieLineItems(o,i):await this.handleCombinedCartUpdate(o,i);}async handleSeparateFreebieLineItems(e,t){if(!t.length&&!e.length)return;let n=new pe,o=[];if(e.length){let c=this.addFreebiesOperation(e,n);o.push(c);}if(t.length){let c=this.removeFreebiesOperation(t);o.push(c);}if(!o.length)return;let i;try{i=await Promise.all(o),U$3.log(`All freebie and coupon operations completed`);}catch(c){ke$1(c,`progressbar_freebie_ops_parallel`,{engagementTrigger:this.engagementTrigger});}let s;e.length&&i?.length&&(s=i[0]),P.get().refreshUI(s,false);}async removeFreebiesOperation(e){let t={updates:{}};return e.forEach(n=>t.updates[n.key??n.vID]=n.quantity-1),kr$1(t,this.engagementTrigger)}async addFreebiesOperation(e,t){return t.addToCart(e,this.engagementTrigger)}async handleCombinedCartUpdate(e,t){let n=this.engagementTrigger.progressBarConfig,o={},i={};t.length&&t.forEach(C=>i[C.key??C.vID]=0),e.length&&e.forEach(C=>i[C.vID]=1);let s=n.coupons,c=[];if(s?.length){c=s.map(g=>g.couponCode);let C=h.getCurrent().discount_codes?.map(g=>g.code)??[];c.every(g=>C.some(y=>y===g))||(o.discount=c.join(`,`));}if(he$4.hasKeys(i)&&(o.updates=i),!he$4.hasKeys(o))return;let d=await kr$1(o,this.engagementTrigger),u=d?.items,p=[];for(let C of e){let T=u?.find(g=>c?.length?g.id+``===C.vID&&g.discounts?.some(y=>c.includes(y.title)):g.id+``===C.vID);T&&p.push(T);}if(!p.length){P.get().refreshUI(d,false);return}try{await Promise.all(p.map(C=>oo(C,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()})));}catch(C){ke$1(C,`progressbar_private_attr_add`,{engagementTrigger:this.engagementTrigger,extra:{productAddedByCooee:p}});}finally{P.get().refreshUI(d,false);}}};var ut$1=class ut extends G{constructor(e){super(e);}async update(e){await super.update(e),this.engagementTrigger.content.update(e.content),this.updateAngularWidget();}isAllOkToRender(){return !!this.engagementTrigger.content}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget(`cooee-savings-bar`);}};var lr$1=class lr extends R$1{constructor(e){super(e);}isAllOkToRender(){return !!this.engagementTrigger.content?.videoConfig}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e;this.engagementTrigger.isFloatingVideo()?e=`cooee-video-popup`:this.engagementTrigger.isVideoStory()?e=`cooee-video-stories`:e=`cooee-video-playlist`,this.createAngularWidget(e);}};var mr$1=class mr extends R$1{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-sticky-atc`);}};var dr$1=class dr extends R$1{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(`letscooee:inbound:cta:add-bundle`,this.inboundCTAListener.bind(this),false);}async inboundCTAListener(e){let t=this.engagementTrigger,n=`Engagement(id: ${t.engagementID}, shortID: ${t.shortID})`,o=e.detail;if(!he$4.hasKeys(o)){U$3.error(`No detail received for ${n}`);return}U$3.log(`Detail received for BYOB`,o);let i=o.campaignID??o.campaignId??o.campaign_id;if(i!==t.shortID&&i!==t.engagementID){U$3.warn(`Current ${n} is not BYOB. Received: ${i}`);return}let s=o.items;if(!s?.length)return;let c=s.map(d=>new pt$2({mID:d.product_id,vID:d.variant_id,quantity:d.quantity||1}));await new Ge$1(this.triggerContext).execute({embeddedItems:c,clickAction:{at:he$3.ADD_BUNDLE,applyDiscount:true}});}};var pr$1=class pr extends R$1{cartChangeSubscription;isProcessingAddOns=false;afterRootContainerCreated(){this.cartChangeSubscription&&!this.cartChangeSubscription.closed||this.listenCartChange();}preDestroy(){super.preDestroy(),this.cartChangeSubscription?.unsubscribe();}listenCartChange(){let e=new pe;this.cartChangeSubscription=window.CooeeSDK.cartChange$.subscribe(async t=>{if(this.isProcessingAddOns||!this.wasCurrentItemAdded(t))return;this.isProcessingAddOns=true;let n=this.triggerContext.triggerData;U$3.log(`${n} detected current item addition to cart`);let o=this.triggerContext.selectedItems;if(!o?.length){U$3.log(`No add-ons selected for the current product ${n}`),this.isProcessingAddOns=false;return}U$3.log(`Adding ${o.length} add on items in the cart`);let i=await e.addToCart(o,n);P.get().refreshUI(i,false),this.isProcessingAddOns=false;});}wasCurrentItemAdded(e){let t=window.CooeeSDK.runtimeData.currentItem;return t?!!e.itemsAdded?.find(n=>n.mID===t?.mID&&n.vID===t.vID):false}};var Mr=false,Fr=false,gr$1=null,ur=null,ao=false,De=new Set,Ke$1=new Set;function co(){ao||(ao=true,It$3(()=>{Fn(document.body,{childList:true,subtree:true},500,Mn).subscribe(()=>{Ke$1.forEach(r=>r.rerenderIfDeleted()),De.forEach(r=>r.rerenderIfDeleted());});}));}async function ft$1(r){if(r.length>0&&await po(),co(),Mr){U$3.verbose(`Cart widget processing in progress, queuing latest triggers`),gr$1=r;return}Mr=true;try{di(r);}finally{if(Mr=false,gr$1){let e=gr$1;gr$1=null,U$3.verbose(`Processing queued cart triggers`),ft$1(e);}}}async function ht$1(r){if(r.length>0&&await po(),co(),Fr){U$3.verbose(`Page widget processing in progress, queuing latest triggers`),ur=r;return}Fr=true;try{pi(r);}finally{if(Fr=false,ur){let e=ur;ur=null,U$3.verbose(`Processing queued page triggers`),ht$1(e).catch(console.error);}}}function dh(){De.forEach(r=>r.rerenderAfterCartOpened().catch(e=>ke$1(e,`cart_widget_render_update`,{engagementTrigger:r.engagementTrigger})));}function di(r){mo(De,r);for(let e of r){U$3.info(`${e} received as cart embed`);let t=lo(De,e);if(t&&!e.isSubscriptionUpsell()){t.updateAndReRender(e).catch(o=>{ke$1(o,`widget_update_render`,{engagementTrigger:e});});continue}U$3.verbose(`${e} is new`);let n;if(e.isProgressBar())n=new cr$1(e);else if(e.isSubscriptionUpsell()){sr$1.renderCartUpsell(e);continue}else e.isSavingsBar()?n=new ut$1(e):n=new G(e);De.add(n),n.renderSilently();}}function pi(r){mo(Ke$1,r);for(let e of r){U$3.info(`${e} received as page embed`);let t=lo(Ke$1,e);if(t){t.updateAndReRender(e).catch(o=>{ke$1(o,`widget_update_render`,{engagementTrigger:e});});continue}U$3.verbose(`${e} is new`);let n;e.isVideoObjective()?n=new lr$1(e):e.isBYOB()?n=new dr$1(e):e.isStickyATC()?n=new mr$1(e):e.isSavingsBar()?n=new ut$1(e):e.isCollectionFilter()?n=new ar$1(e):e.isAddOns()?n=new pr$1(e):n=new R$1(e),Ke$1.add(n),n.renderSilently();}}function lo(r,e){for(let t of r)if(t.matches(e))return t}function mo(r,e){let t=new Set(e.map(n=>n.shortID));for(let n of r)t.has(n.engagementTrigger.shortID)||n.destroy();}async function po(){await(await import('./widgets-mrkhuR1_-eaozRfHm.js').then(function (n) { return n.ad; })).loadAngularWidgets();}var uo=new U$1,go=0;uo.pipe(Fe$2(50)).subscribe(async r=>{gi$1(await nt$1()).catch(t=>{U$3.error(`Error fetching widgets. Is firstLoad: ${r}`,t);});});function fo(r=false){le$2(K$1).then(()=>{uo.next(r);}).catch(e=>U$3.error(`Session not established, skipping fetchWidgets`,e));}async function so(r){let e=await nt$1();return Object.assign(r,e),re$1(`/v1/engagement/get-variant`,r)}async function gi$1(r$10){go++,go===1?U$3.info(`Fetch widgets (after ⏰`,Nn$3()+` of SDK load)`):U$3.info(`Fetch widgets`);let t=await re$1(`/v1/engagement/eligible`,r$2({},r$10));U$3.info(`Widgets fetched ${Rn$1(t.timeTakenMs)}`);ht$1(t.data.pageWidgets?.map(i=>new q$1(i))??[]).catch(console.error);ft$1(t.data.cartWidgets?.map(i=>new q$1(i))??[]).catch(console.error);}var ho=x$2(dr$3()),fr$1=class r{static META_REQUIRED_FIELDS=[`ad_id`];static GOOGLE_REQUIRED_FIELDS=[`gad_source`,`gclid`];source;adID;campaignID;adName;campaignName;constructor(e){this.adID=e.adID,this.campaignID=e.campaignID,this.source=e.source;}static getAdParams(){let e;try{e=new ho.URLBuilder(location.href);}catch{return {}}let t={};if(this.META_REQUIRED_FIELDS.every(i=>Array.from(e.getParams().keys()).includes(i)))return t={source:`META`,adID:e.getQueryParam(`ad_id`)?.trim(),campaignID:e.getQueryParam(`campaign_id`)?.trim()},new r(t);if(this.GOOGLE_REQUIRED_FIELDS.every(i=>Array.from(e.getParams().keys()).includes(i)))return t={source:`GOOGLE`},new r(t)}};var Br={d:(r,e)=>{for(var t in e)Br.o(e,t)&&!Br.o(r,t)&&Object.defineProperty(r,t,{enumerable:true,get:e[t]});},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},Vr={};Br.d(Vr,{A:()=>ui,k:()=>Wr});var Ct$1=function(r,e,t,n){return new(t||(t=Promise))(function(o,i){function s(u){try{d(n.next(u));}catch(p){i(p);}}function c(u){try{d(n.throw(u));}catch(p){i(p);}}function d(u){var p;u.done?o(u.value):(p=u.value,p instanceof t?p:new t(function(C){C(p);})).then(s,c);}d((n=n.apply(r,[])).next());})},yt$1=function(r,e){var t,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==`function`&&(i[Symbol.iterator]=function(){return this}),i;function c(d){return function(u){return (function(p){if(t)throw new TypeError(`Generator is already executing.`);for(;i&&(i=0,p[0]&&(s=0)),s;)try{if(t=1,n&&(o=2&p[0]?n.return:p[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,p[1])).done)return o;switch(n=0,o&&(p=[2&p[0],o.value]),p[0]){case 0:case 1:o=p;break;case 4:return s.label++,{value:p[1],done:!1};case 5:s.label++,n=p[1],p=[0];continue;case 7:p=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||p[0]!==6&&p[0]!==2)){s=0;continue}if(p[0]===3&&(!o||p[1]>o[0]&&p[1]<o[3])){s.label=p[1];break}if(p[0]===6&&s.label<o[1]){s.label=o[1],o=p;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(p);break}o[2]&&s.ops.pop(),s.trys.pop();continue}p=e.call(r,s);}catch(C){p=[6,C],n=0;}finally{t=o=0;}if(5&p[0])throw p[1];return {value:p[0]?p[1]:void 0,done:true}})([d,u])}}};function Wr(){return Ct$1(this,void 0,Promise,function(){return yt$1(this,function(r){switch(r.label){case 0:return [4,new Promise(function(e,t){var n=`Unknown`,o=false;function i(g){o||(o=true,e({isPrivate:g,browserName:n}));}function s(){var g=0,y=parseInt(`-1`);try{y.toFixed(y);}catch(b){g=b.message.length;}return g}function c(){return navigator.msSaveBlob!==void 0&&(function(g){try{return g===eval.toString().length}catch{return false}})(39)}function d(){var g;return Ct$1(this,void 0,void 0,function(){var y,b;return yt$1(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return f.sent(),i(false),[3,3];case 2:return y=f.sent(),b=y,y instanceof Error&&(b=(g=y.message)!==null&&g!==void 0?g:y),typeof b!=`string`?(i(false),[2]):(i(!!b.includes(`unknown transient reason`)),[3,3]);case 3:return [2]}})})}function u(){var g;return Ct$1(this,void 0,Promise,function(){return yt$1(this,function(y){switch(y.label){case 0:return ((g=navigator.storage)===null||g===void 0?void 0:g.getDirectory)===void 0?[3,2]:[4,d()];case 1:return y.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var b=String(Math.random());try{var f=indexedDB.open(b,1);f.onupgradeneeded=function(L){var ue=L.target.result,_=function(Cr){i(Cr);};try{ue.createObjectStore(`t`,{autoIncrement:!0}).put(new Blob),_(!1);}catch(Cr){(Cr.message||``).includes(`are not yet supported`)?_(!0):_(!1);}finally{ue.close(),indexedDB.deleteDatabase(b);}},f.onerror=function(){return i(!1)};}catch{i(false);}})():(function(){var b=window.openDatabase,f=window.localStorage;try{b(null,null,null,null);}catch{i(true);return}try{f.setItem(`test`,`1`),f.removeItem(`test`);}catch{i(true);return}i(false);})(),y.label=3;case 3:return [2]}})})}function p(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(g,y){var b;i(Math.round(y/1048576)<2*Math.round(((b=window).performance!==void 0&&b.performance.memory!==void 0&&b.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576));},function(g){t(new Error(`detectIncognito somehow failed to query storage quota: `+g.message));});}function C(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?p():(0, window.webkitRequestFileSystem)(0,1,function(){i(false);},function(){i(true);});}function T(){return Ct$1(this,void 0,Promise,function(){var g,y;return yt$1(this,function(b){switch(b.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return [3,4];b.label=1;case 1:return b.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return b.sent(),i(false),[3,4];case 3:return g=b.sent(),typeof(y=g instanceof Error&&typeof g.message==`string`?g.message:String(g))!=`string`?(i(false),[2]):(i(y.includes(`Security error`)),[2]);case 4:return i(navigator.serviceWorker===void 0),[2]}})})}(function(){return Ct$1(this,void 0,Promise,function(){return yt$1(this,function(g){switch(g.label){case 0:return s()!==44?[3,2]:(n=`Safari`,[4,u()]);case 1:return g.sent(),[3,6];case 2:return s()!==51?[3,3]:(y=navigator.userAgent,n=y.match(/Chrome/)?navigator.brave!==void 0?`Brave`:y.match(/Edg/)?`Edge`:y.match(/OPR/)?`Opera`:`Chrome`:`Chromium`,C(),[3,6]);case 3:return s()!==25?[3,5]:(n=`Firefox`,[4,T()]);case 4:return g.sent(),[3,6];case 5:c()?(n=`Internet Explorer`,i(window.indexedDB===void 0)):t(new Error(`detectIncognito cannot determine the browser`)),g.label=6;case 6:return [2]}var y;})})})().catch(t);})];case 1:return [2,r.sent()]}})})}typeof window<`u`&&(window.detectIncognito=Wr);var ui=Wr,Co=Vr.A;Vr.k;var yo=x$2(Dt$2()),vo=async()=>{let r={};try{return await fi$1(r)}catch(e){return ke$1(e,`device_props_collect`),r}},fi$1=async r=>{let e=window.CooeeSDK.uaParser;hi$1(r),Ci$1(r),yi$1(r),r.referrer=document.referrer,r.host=location.origin,r.path=location.pathname,r.qs=location.search,r.locale=navigator.language,r.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:vi$1()},r.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(r.headless=true,wn({headless:true}));let t=e.getResult();return r.browser=t.browser,r.device=t.device,r.engine=t.engine,r.cpu=t.cpu,r.os=t.os,r.navigatorUA=navigator.userAgent,await Promise.all([bi$1(r),Ei$1(r),Si$1(r)]),r},hi$1=r=>{let e=navigator;if(!e.deviceMemory)return;r.mem={tot:e.deviceMemory*1024};},Ci$1=r=>{let e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;t?.effectiveType&&(r.net={type:t.effectiveType});},yi$1=r=>{let e=screen.orientation?.type;e&&(r.orientation=e);},vi$1=()=>{if(!document.body)return;let r=document.createElement(`div`);r.setAttribute(`style`,`height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;`),document.body.appendChild(r);let e=window.devicePixelRatio||1,t=r.offsetWidth*e;return document.body.removeChild(r),t},Ei$1=async r=>{try{await wi$1(r);}catch(e){U$3.error(`Unable to get location`,e);}},wi$1=async r=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:`geolocation`})).state!=`granted`))return new Promise(t=>{navigator.geolocation.getCurrentPosition(n=>{r.coords=[n.coords.latitude,n.coords.longitude],t();},()=>t());})},bi$1=async r=>{if(`getBattery`in navigator)try{let t=await navigator.getBattery();r.bat={l:t.level*100,c:t.charging},wn({"battery.level":r.bat.l,"battery.charging":r.bat.c});}catch{}},Si$1=async r=>{try{(await Co())?.isPrivate&&(r.incognito=!0,wn({incognito:!0}));}catch(e){yo.default.error(`Unable to detect private/incognito window`,e);}};function wo(r){if(!bo())return;let e=ge$3[r]?.toLowerCase();e&&(U$3.verbose(`Sending ${e} intent to MS Clarity`),window.clarity(`set`,`Cooee Intent`,e));}function bo(){return window.clarity&&typeof window.clarity==`function`}var K$1=new gr$2(1),Ii$1=`Store id or shop name is missing`,hr$1;async function rC(){U$3.info(`Begin auth after ⏰`,Nn$3(),`of JS load`);try{await Ti$1(),K$1.next(!0),K$1.complete();}catch(r){r?.message?.includes(Ii$1)&&ke$1(r,`session_initiate`),U$3.error(`Unable to initiate session`,r),K$1.error(r);}}async function to(){return await Io(false),hr$1}async function nC(){Do(ce$5.getVisitorOldId()??new $$2().toHexString());}async function So(){if(hr$1)return;let[r,e,t]=await Promise.all([ve$5.get(`id`,``),ce$5.get(`sessionNumber`,1),ve$5.get(`landing`,{})]);To(r,e,t);}async function Ti$1(){await Io(true);}async function Io(r){let e=false;return await Pi$1()?(await Di$1(),e=true):await xi$1()?(await So(),e=true):await So(),e?await _i$1():r&&fo(),e}async function Di$1(){U$3.info(`Starting new session`),await ve$5.clear();let r=new Date,e=new $$2().toHexString(),t=await ce$5.get(`sessionNumber`,0)+1,n=rr$1();await Promise.all([ce$5.set(`sessionNumber`,t),ve$5.set(`id`,e),ve$5.set(`lastUsedTime`,r.getTime()),ve$5.set(`landing`,n)]),To(e,t,n);}async function Pi$1(){let r=await ve$5.get(`lastUsedTime`,0);return r?(new Date().getTime()-r)/1e3>1800:true}async function xi$1(){return !await ve$5.get(`synced`,false)}async function Ri$1(){let r$11=await vo(),e=nr();return s$2(r$2(r$2({deviceProps:r$11},hr$1),e),{sdk:Jr$3,ad:fr$1.getAdParams(),occurred:Li$1(We$4().jsLoadTime),properties:{}})}async function _i$1(){U$3.info(`Ensuring session on server`),await Ai$1();let r=Date.now(),e=await Ri$1();U$3.info(`Session data generated ${Rn$1(Date.now()-r)}`);try{let t=await re$1(`/v1/event/validate-session`,e);U$3.info(`Auth finished ${Rn$1(t.timeTakenMs)}`),await ve$5.set(`synced`,!0),t.data.deviceID&&(Oi$1(t.data.deviceID,t.data.visitorID),Do(ce$5.getVisitorOldId()??t.data.deviceID));ht$1(t.data.pageWidgets?.map(i=>new q$1(i))??[]).catch(console.error);ft$1(t.data.cartWidgets?.map(i=>new q$1(i))??[]).catch(console.error);}catch(t){throw U$3.error(t),t}}async function Ai$1(){let r=await ce$5.get(`firstSeen`),e=r?new Date(r):new Date;r||await ce$5.set(`firstSeen`,e.toISOString()),Qn(e);}function To(r,e,t){wn({"cooee_session.number":e}),Tn(`Visitor Session`,{id:r,number:e,landing_page:t}),U$3.info(`Session number: ${e}, id: ${r}`),hr$1={sessionID:r,sessionNumber:e,landingPage:t};}function Oi$1(r,e){let t=ce$5.getVisitorOldId(),n=ce$5.getVisitorId(),o=!!t&&t!==r,i=!!e&&!!n&&n!==e;if(!o&&!i)return;_n$1(`Visitor identity client-server divergence`,`warning`,{tags:{divergence_type:o&&i?`both`:o?`did_only`:`vid_only`},extra:{clientDid:t,backendDid:r,clientVid:n,backendVid:e}});}function Do(r){U$3.info(`Visitor ID (old):`,r),U$3.info(`Visitor ID (new):`,ce$5.getVisitorId()),bn({id:r});}function Li$1(r){return (new Date().getTime()-r.getTime())/1e3>1800?new Date:r}function lC(){document.onvisibilitychange=()=>{document.visibilityState===`visible`?ki$1():document.visibilityState===`hidden`&&Ni$1();};}async function ki$1(){}async function Ni$1(){let r=await Ui$1();if(r===0){U$3.info(`Not sending duration as user was inactive on website`);return}xo(r);}async function Ui$1(){let r=We$4();return r.inInactive?0:(r.inInactive=true,r.lastEnterInactive=new Date,Math.max(r.lastEnterInactive.getTime()-r.lastEnterActive.getTime(),0))}function Po(){let r=We$4();return r.inInactive?(r.inInactive=false,r.lastEnterActive=new Date,Math.max((r.lastEnterActive.getTime()-r.lastEnterInactive.getTime())/1e3,0)):0}function Ro(r){if(!Mi$1()||!le$5.get().pixelPush)return;let t=ge$3[r.intent]?.toLowerCase();t&&(U$3.verbose(`Sending ${t} intent to Facebook Pixel`),window.fbq(`trackCustom`,`CooeeIntent`,{intent_value:t}));}function Mi$1(){return window.fbq&&typeof window.fbq==`function`}var Lr=`/v1/event/track-page-unload`;function Vn(r){U$3.verbose(`Waiting for auth to send event ${r.name}`),le$2(K$1).then(()=>be$1(r)).catch(e=>U$3.error(`Session not established, skipping trackEvent`,e));}function xo(r){le$2(K$1).then(()=>{Fi$1(r);}).catch(e=>U$3.error(`Session not established, skipping trackPageUnload`,e));}async function Fi$1(r){let e=We$4().currentPageViewEvent;if(!e){U$3.warn(`No page view event was stored previously`);return}let t={pageViewEventID:e.id,pageViewEventName:e.name,pageActiveTimeMS:r};U$3.verbose(`Sending page unload`,t);try{await re$1(Lr,t);}catch(n){throw U$3.error(`Error sending page unload for ${e} to server`,n),n}}function be$1(r){Bi$1(r);}async function Bi$1(r){if(U$3.verbose(`Sending event: ${r.name}`,r),Gi(r)){U$3.warn(`Rejecting event ${r.name}`);return}Un();let e=await nt$1();Object.assign(r,e),Po(),ve$5.set(`lastUsedTime`,new Date().getTime());let t=qi$1(r.name),n=t.toLowerCase().replace(/\s+/g,`-`);try{let o=await re$1(`/v1/event/track/${n}`,r);U$3.info(`Event tracked:`,t),Vi$1(r)&&(We$4().currentPageViewEvent={id:r.id,name:r.name}),Wi$1(r,o.data);}catch(o){throw U$3.error(`Error sending event ${r.name} to server`,o),o}}function Vi$1(r){return rn.includes(r.name)?r.name===`View Cart`?!r.properties.drawer:true:false}function Wi$1(r,e){$i$1(r,e).catch(t=>{ke$1(t,`popup_response_process`,{extra:{event:r,response:e}});}),Hi$1(e);}async function $i$1(r,e){if(!e.triggerData?.ian)return;let t=new q$1(e.triggerData);t.occurred=r.occurred,U$3.log(`${t} will be shown`);let n;try{n=await tr$1(t);}catch(i){U$3.error(`Failed to refresh the products`,i);return}t.items=n;new(await(import('./renderer-3qnKqaGo-DO_AEGCj.js'))).FreeformRenderer().renderEngagement(t).catch(i=>{ke$1(i,`popup_render`,{extra:{event:r},engagementTrigger:t});});}function Hi$1(r){r.intent&&(wo(r.intent),Ro(r),U$3.info(`Intent is ${ge$3[r.intent]}`));}function qi$1(r){return r.replace(`CE `,``).replace(`Trigger`,`Campaign`).replace(`Screen`,`Page`).replace(`App `,``)}function Gi(r){return r.trigger?.triggerID===`test`||r.trigger?.triggerID===`preview`?(U$3.warn(`Not sending event as this is a test trigger`),true):false}
|
|
162
|
+
`},navigation:{nextEl:r.querySelector(`.swiper-button-next`),prevEl:r.querySelector(`.swiper-button-prev`)},autoplay:e.autoplay?.enabled?{delay:e.autoplay?.delay,disableOnInteraction:false,pauseOnMouseEnter:false}:false,autoHeight:true};e.marquee&&t.autoplay&&typeof t.autoplay==`object`&&(t.speed=e.speed,t.autoplay.pauseOnMouseEnter=true,r.style.setProperty(`--swiper-wrapper-transition-timing-function`,`linear`));let o=new window.CooeeSDK.Swiper(r,t);return r.style.setProperty(`--swiper-navigation-size`,`${e.navigation.size}px`),o}function ir$1(r,e,t){let o={color:r.navigation.color?.rgba};return r.pagination.enabled&&(o.transform=`translateY(-25%)`),l$2(`div`,{class:`swiper-container`,ref:e,style:`max-width: 100%`,children:[l$2(`div`,{class:`swiper-wrapper`,children:t()}),r.navigation.enabled&&l$2(`div`,{class:`swiper-button-next`,style:o,children:l$2(`span`,{})}),r.navigation.enabled&&l$2(`div`,{class:`swiper-button-prev`,style:o,children:l$2(`span`,{})}),r.pagination.enabled&&l$2(`div`,{className:`swiper-pagination`,style:{color:r.pagination.color?.rgba}})]})}var up=()=>{let r=window.ShopifyAnalytics?.meta??{},e=r.selectedVariantId;if(e)return e;if(r.product?.variants?.length>0)return r.product.variants[0].id},Ur=r=>{if(!r)return;let e;try{e=new URL(r);}catch{return}if(e.hostname!==`cdn.shopify.com`)return r;let t=e.pathname.split(`.`);return t.length!==2?r:(e.pathname=t[0]+`_large.`+t[1],e.toString())};var st$1=class st extends E$1{componentDidMount(){rt$2(()=>{this.setState(()=>({checked:this.props.item.selected.value}));});}render(){return l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-checkbox`),children:l$2(`input`,{type:`checkbox`,checked:this.state.checked,onChange:this.onChange.bind(this),style:{appearance:`auto`}})})}onChange(e){let{checked:t}=e.target;this.props.item.selected.value=t;}getTypoStyles(){let e={},t=this.mediaStyle.typo??new W$2;return e.textAlign=t.alignment,e.justifyContent=t.alignment,e}getComponentStyles(){return s$2(r$2({},this.getTypoStyles()),{display:`flex`})}};var oe$1=class oe extends E$1{constructor(e,t){super(e,t);}render(){let e=this.props.element[this.deviceTypeKey],t=e?.src||this.props.element.src||this.props.element.lg?.src;return l$2(`img`,{onClick:this.customOnClick.bind(this),alt:e?.name||`Image`,className:this.getClasses(`lc-image`),onMouseEnter:this.handleMouseEnter.bind(this),onMouseLeave:this.handleMouseLeave.bind(this),src:t,style:this.getCompiledStyles()})}customOnClick(e){this.props.element.clc?.at===he$3.ADD_TO_CART&&this.props.triggerContext.triggerData.items[0]&&this.onClick(e,{item:this.props.triggerContext.triggerData.items[0]}),this.props.onClick&&this.props.onClick(`image`);}getComponentStyles(){let e=this.mediaStyle.lout;if(!e||e.pos!==`absolute`)return {};let t={zIndex:e.zIndex,cursor:this.props.element.clc?.at?`pointer`:`auto`};return this.mediaStyle.size?.w&&(t.width=this.mediaStyle.size.w),this.mediaStyle.size?.h&&(t.height=this.mediaStyle.size.h),t}handleMouseEnter(e){let t=this.props.element[this.deviceTypeKey]?.secondarySrc;t&&(e.currentTarget.src=t);}handleMouseLeave(e){e.currentTarget.src=this.props.element[this.deviceTypeKey]?.src;}};var ne$1=class ne extends E$1{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-flexbox`),children:l$2(ue,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})})}getComponentStyles(){let e=this.mediaStyle.flex??new gt$2,t={display:`flex`,gap:e.gap+`px`,flexWrap:e.wrap,flexDirection:e.dir,justifyContent:e.jc,alignItems:e.ai};return e.wrap===`nowrap`&&e.scroll&&(e.dir===`column`?t[`overflow-y`]=`auto`:t[`overflow-x`]=`auto`),t}};var at$1=class at extends ne$1{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-flexbox`),children:l$2(je$1,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext,item:this.props.item,productVariables:this.props.productVariables,noLinks:this.props.noLinks})})}};var ct$1=class ct extends E$1{render(){return l$2(`select`,{style:this.getCompiledStyles(),value:this.props.selectedVariant.selectedSellingPlan.value?.mID??``,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:this.getClasses(`lc-dropdown`),children:this.createSelectItems()})}componentDidMount(){rt$2(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:false}));});}getComponentStyles(){let e={};return this.props.selectedVariant.sellingPlans?.length||(e.visibility=`hidden`),r$2(r$2({},e),In$1(this.mediaStyle.typo))}createSelectItems(){let e=[],t=this.props.selectedVariant;if(!t.sellingPlans?.length)return [];this.props.triggerContext.triggerData.content?.subsUpgradeConfig?.skipSubscribedItems?t.selectedSellingPlan.value||(t.sellingPlans[0].isSelected=true,t.changeSellingPlan(t.sellingPlans[0])):e.push(l$2(`option`,{value:``,selected:!t.selectedSellingPlan,children:`One time purchase`}));for(let o of t.sellingPlans??[])e.push(l$2(`option`,{value:o.mID,selected:o.isSelected,children:o.name}));return e}onChange(e){let t=e.target.value;t?this.props.selectedVariant.selectedSellingPlan.value=this.props.selectedVariant.sellingPlans.find(o=>o.mID===t):this.props.selectedVariant.selectedSellingPlan.value=void 0;}};var mi=new RegExp(`fill="#[a-zA-Z0-9]+"`),lt$1=class lt extends E$1{constructor(){super();}render(){let e=this.getCompiledStyles(),t=this.getRating();return t||(e.display=`none`,t=``),l$2(`div`,{style:e,className:this.getClasses(`lc-star-rating`),dangerouslySetInnerHTML:{__html:t}})}getRating(){let e={size:this.props.element.iconSize,color:this.props.element.c.hex},t=Fe$3(this.props.element.fullStar,{svg:e},this.props.triggerContext),o=Fe$3(this.props.element.halfStart,{svg:e},this.props.triggerContext),n=this.props.review;if(!n?.rating)return ``;let i=``;if(this.props.element.showSingleStar)i=t;else {let s=5,c=`${n.rating}`.split(`.`);for(let d=0;d<+c[0];d++)i+=t,s--;c[1]&&(i+=o,s--);for(let d=0;d<s;d++)i+=t.replace(mi,`fill="#f1f1f1"`);}return i}getComponentStyles(){return {display:`flex`,alignItems:`center`}}};var mt$1=class mt extends E$1{render(){return l$2(`select`,{style:this.getCompiledStyles(),value:this.props.item.selectedOrFirstVariant.value.mID,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:this.getClasses(`lc-dropdown`),children:this.createSelectItems()})}componentDidMount(){rt$2(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:false}));});}getComponentStyles(){let e={};return this.props.item.vars?.length===1&&this.props.item.vars[0].name===`Default Title`&&(e.visibility=`hidden`),r$2(r$2({},e),In$1(this.mediaStyle.typo))}createSelectItems(){let e=[];for(let t of this.props.item.vars)e.push(l$2(`option`,{value:t.mID,disabled:!t.isAvailable,children:t.name}));return e}onChange(e){let t=e.target.value,o=this.props.item.vars.find(n=>n.mID===t);this.props.item.setSelectedVariant(o);}};var je$1=class je extends E$1{constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`}));}renderElement(e){if(!(e.hide||!this.matchWhenCondition(e.when))){if(e.t===4){let t=e;return t.l===`Star Rating`&&!this.props.item.reviews?.rating?void 0:l$2(at$1,{element:t,triggerContext:this.props.triggerContext,elements:t.elems,item:this.props.item,productVariables:this.props.productVariables,noLinks:this.props.noLinks})}if(e.t===6){let t=this.props.triggerContext,o=t.triggerData;return o.isBundle()||o.isAddOns()?l$2(st$1,{element:e,item:this.props.item,triggerContext:t}):void 0}if(e.t===8){let t=e;if(!t.templateName)return ``;try{if(!/^[a-zA-Z0-9_-]+$/.test(t.templateName))return U$3.error(`Invalid partial template name`,t.templateName),``;let o=Fe$3(`{{ @include("${t.templateName}", it) /}}`,this.props.productVariables??{});return l$2(`div`,{className:`lc-partial-`+t.templateName,dangerouslySetInnerHTML:{__html:o}})}catch(o){return U$3.error(`Failed to render partial element`,t.templateName,this.props.productVariables,o),``}}if(e.t===13){let t=e,o=this.props.item,n=Ur(o.variantImage??o.firstImageURL),i=Ur(o.variantSecondaryImage??o.secondaryImageURL);t.lg=t.sm={src:n,name:o.name,secondarySrc:i};let s=l$2(oe$1,{element:t,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?s:l$2(`a`,{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:`block`},children:s})}if(e.t===14)return this.renderProductTitle(e);if(e.t===15){let t=e;return this.props.triggerContext.triggerData.isCartEmbed()&&this.props.item.vars?.length===1&&this.props.item.vars[0].name===`Default Title`?void 0:t.type!==`SINGLE`?l$2(`cooee-product-options-picker`,{item:this.props.item,styles:t.style,horizontal:t.horizontal,dropdownType:t.type}):l$2(mt$1,{element:t,item:this.props.item,triggerContext:this.props.triggerContext})}return e.t===16?l$2(ct$1,{element:e,selectedVariant:this.props.item.selectedOrFirstVariant.value,item:this.props.item,triggerContext:this.props.triggerContext}):e.t===19?l$2(lt$1,{element:e,triggerContext:this.props.triggerContext,review:this.props.item.reviews}):e.t===18||e.t===3?l$2(Te,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):l$2(ue,{elements:[e],element:this.props.element,triggerContext:this.props.triggerContext})}}render(){return this.attachListener(),this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return {}}renderProductTitle(e){let t=l$2(B$2,{element:e,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?t:l$2(`a`,{href:this.props.item.selectedOrFirstVariant.value.link,style:{display:`block`,textDecoration:this.state.decoration},onMouseEnter:this.onMouseEnter.bind(this),onMouseLeave:this.onMouseLeave.bind(this),children:t})}customOnClick(e){this.sendTriggerClicked([this.props.item.toEmbed()],{from:e});}onMouseEnter(){this.setState(()=>({decoration:`underline`}));}onMouseLeave(){this.setState(()=>({decoration:`unset`}));}attachListener(){document.addEventListener(`letscooee:variant-change`,e=>{let t=e;if(!t.detail||this.props.item.mID!==t.detail.productID)return;let o=t.detail.variantID;this.props.item.setSelectedVariantByID(o);});}};var Ie$1=class Ie extends E$1{productElement;constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`}));}render(){let e=this.props.item,t=this.getProductData();if(this.productElement=new me(We$3(this.props.element,t,this.props.triggerContext)),this.productElement.hide||!this.matchWhenCondition(this.productElement.when))return;let n=this.getClasses([`lc-single-product`,...e.cardClasses??[]].join(` `));return l$2(`div`,{style:r$2({},this.getCompiledStyles()),className:n,children:l$2(je$1,{element:this.productElement,elements:this.productElement.elems,triggerContext:this.props.triggerContext,item:this.props.item,productVariables:t,noLinks:this.productElement.noLinks})})}getComponentStyles(){return {flexShrink:0}}getProductData(){if(!this.props.item)return {};let e=this.props.item,t=e.selectedOrFirstVariant.value,o=e.getTemplateVariables();o.product.quantity=this.props.item.quantity;let n=this.props.triggerContext.triggerData.discount?.type===H$1.BXGY;return !t.hasEffectivePrice()&&n&&(o.product=s$2(r$2(r$2({},o.product),Gn$1(`effective_price`,t.effectivePrice.value)),{price:``})),o.variant.quantity=t.quantity,{product:o.product,variant:o.variant,svg:{color:`{{ svg.color }}`,size:`{{ svg.size }}`}}}};var dt$1=class dt extends E$1{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,t){super(e,t),this.configuration=M$3()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+`px`;}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&Vi$2().then(()=>{this.swiperInstance=nr(this.swiperRef,this.props.element.conf[this.deviceTypeKey]);});}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy();}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let t;if(this.configuration.disp===2){let o=i=>{this.swiperRef=i;},n=()=>e?.map(i=>l$2(`div`,{class:`swiper-slide`,children:this.getProductFragment(i)}));t=l$2(`div`,{style:s$2(r$2({},this.getCompiledStyles()),{display:`block`}),className:this.getClasses(`lc-product-swiper-list`),children:ir$1(this.configuration,o,n)});}else t=l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-product-list`),children:e?.map((o,n)=>this.getProductFragment(o,n!==e.length-1))});return t}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),t={display:e?`flex`:`grid`,justifyContent:`safe `+(this.mediaStyle.flex?.jc??`center`),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??`row`};if(t.flexDirection===`row`){if(e)t.maxWidth=`100%`,t.overflowY=`auto`;else if(this.configuration.disp===1){let o=this.props.triggerContext.triggerData,n=o.items.length,i;o.isBundle()?i=this.props.element.prod.symbol?.hide!==true?n*2-1:n:i=this.props.element.conf[this.deviceTypeKey].maxInRow,t.gridTemplateColumns=`repeat(${i}, auto)`;}}return t}getProductFragment(e,t=false){return l$2(ct$3,{children:[l$2(Ie$1,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&t&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&l$2(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`},children:l$2(B$2,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var pt$1=class pt extends E$1{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t);}componentDidMount(){Vi$2().then(()=>{this.swiperInstance=nr(this.swiperRef,this.props.element.conf);});}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy();}render(){let e=this.props.element,t=n=>{this.swiperRef=n;},o=()=>{let n=e.values?.map(c=>l$2(`div`,{class:`swiper-slide`,onClick:d=>this.onClick(d,{clickAction:this.getClickAction(c)}),children:this.renderElement(c)}));if(!n?.length)return [];let i=e.conf,s=n.length;if(i.marquee&&s<=Number(i.maxInRow)){let c=Number(i.maxInRow)-s+1;for(let d=0;d<c;d++)n.push(n[d%s]);}return n};return ir$1(e.conf,t,o)}getComponentStyles(){return {}}renderElement(e){let t=this.valueAddedSlide(this.props.element.slide,e);switch(t?.t){case 1:return l$2(oe$1,{element:t,triggerContext:this.props.triggerContext});case 4:return l$2(ne$1,{elements:t.elems,element:t,triggerContext:this.props.triggerContext});default:U$3.warn(`Unknown slide type for carousal`);}}valueAddedSlide(e,t){let o=We$3(e,{form:t},this.props.triggerContext);return F.getParsedElement(o)}getClickAction(e){return We$3(this.props.element.clc??{},{form:e},this.props.triggerContext)}};var ue=class extends E$1{constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`})),rt$2(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}));});}renderElement(e){if(!e.hide){if(e.t===4){let t=e;return l$2(ne$1,{element:t,triggerContext:this.props.triggerContext,elements:t.elems})}if(e.t===61)return l$2(it,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?l$2(Te,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return l$2(B$2,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return l$2(oe$1,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return l$2(dt$1,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return l$2(Ie$1,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return l$2(pt$1,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return {}}};var ut$1=class ut extends E$1{clickAction;isClickable;constructor(e,t){super(e,t),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===he$3.GO_TO_URL&&!!Hn$1(this.clickAction.gu?.u)||this.clickAction?.at===he$3.OPEN_CART||this.clickAction?.at===he$3.INITIATE_CHECKOUT;}componentDidMount(){rt$2(()=>{let e=this.props.triggerContext.triggerData,t=this.props.triggerContext.selectedItems;e.calculateDiscountData(t,this.props.triggerContext.shouldGiveFBTDiscount);});}render(){return l$2(ct$3,{children:[l$2(`div`,{style:this.getCompiledStyles(),className:this.getClasses(`lc-container`),onClick:e=>{this.onClick(e,{clickAction:this.clickAction});},children:l$2(ue,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id===`preview`&&l$2(`div`,{class:`letscooee-preview-badge`,children:[`#`,this.props.triggerContext.triggerData.shortID,` preview`]})]})}getComponentStyles(){let e={position:`relative`,overflow:`hidden`,display:`block`};return this.isClickable&&(e.cursor=`pointer`),e}};var R$1=class r$9{constructor(e){this.engagementTrigger=e;this.triggerContext=new Fe$1(new Date,this.engagementTrigger);}static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;triggerContext;observers=[];parentOuterShadowElement;renderedCount=0;scrollSubscription;isExclusionWithBVariation;isProcessing=false;lockReleased$=new U$1;renderSilently(){this.acquireProcessingLock()||this.render().finally(()=>this.releaseProcessingLock()).catch(e=>{ke$1(e,`widget_render`,{triggerContext:this.triggerContext});});}destroy(){U$3.verbose(`${this.engagementTrigger} will be destroyed`),this.preDestroy(),this.removeFromRendered(),this.rootContainer?.remove(),r$9.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID),Mi$2(this.engagementTrigger.content?.afterDeleteJS);}matches(e){return this.engagementTrigger.shortID===e.shortID}async render(){if(this.engagementTrigger.shouldGetVariationImmediately()){let e=await this.getVariation();this.handleVariationResponse(e);}if(this.rootContainer=await this.getWidgetContainer(true),!this.rootContainer){U$3.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.afterRootContainerCreated(),await this.getVariationIfRequired(),await this.runChoresBeforeRender(),this.attachScroll(),this.checkAndSendEvent(),this.triggerContext.renderer=this,Mi$2(this.engagementTrigger.content?.afterRenderJS);}async updateAndReRender(e){await this.waitForLockRelease(),this.acquireProcessingLock();try{this.updateItems(e.items,this.engagementTrigger.items),await this.update(e),await this.render();}finally{this.releaseProcessingLock();}}async update(e){this.engagementTrigger.variation=e.variation;}async rerenderIfDeleted(){if(!this.rootContainer?.isConnected&&!this.acquireProcessingLock()){U$3.info(`${this.engagementTrigger} deleted. Will be re-rendered`);try{this.preDestroy(),await this.render();}finally{this.releaseProcessingLock();}}}updateAngularWidget(){return this.widgetElement?.isConnected?(this.widgetElement.update(),true):false}preDestroy(){this.scrollSubscription?.unsubscribe(),this.observers.forEach(e=>{e?.disconnect&&e.disconnect();});}acquireProcessingLock(){return this.isProcessing?(U$3.verbose(`Lock could not be acquired for ${this.engagementTrigger}`),true):(U$3.verbose(`Acquiring rendering lock for ${this.engagementTrigger}`),this.isProcessing=true,false)}releaseProcessingLock(){U$3.verbose(`Releasing rendering lock for ${this.engagementTrigger}`),this.isProcessing=false,this.lockReleased$.next();}async waitForLockRelease(){this.isProcessing&&await le$2(this.lockReleased$);}afterRootContainerCreated(){}isAllOkToRender(){return !!this.engagementTrigger.widget}async getVariationIfRequired(){if(this.engagementTrigger.shouldSkipVariation()){U$3.verbose(`${this.engagementTrigger} already has necessary data to render`);return}let e=await this.observeWidgetContainerInViewport();this.handleVariationResponse(e);}handleVariationResponse(e){if(!e)return;let t=this.engagementTrigger;U$3.log(`${t} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(t.items=e.items.map(o=>new vt$2(o)),t.nonMutableItems=e.items.map(o=>new vt$2(o))),e.bundleFrom&&(t.bundleFrom=new vt$2(e.bundleFrom)),e.discount&&(t.discount=e.discount),e.placement&&(t.placement=e.placement),he$4.hasKeys(e.stickyATCConfig)&&(t.stickyATCConfig=e.stickyATCConfig),e.props&&he$4.hasKeys(e.props)&&(t.props=r$2(r$2({},t.props),e.props)),e.content&&(t.content=new tt(e.content)),t.widget=new qe$1(e.widget),t.contentID=e.contentID,t.variation=e.variation,t.placement=e.placement,t.entryAnimation=e.entryAnimation??`NONE`,this.isExclusionWithBVariation=t.isExclusionTesting()&&t.variation===`b`,this.isExclusionWithBVariation&&(this.rootContainer.style.height=`0.5px`);}addToRendered(){this.renderedCount++,U$3.info(`${this.engagementTrigger} rendered \u2705 ${Xn$1(this.renderedCount)} time`);}removeFromRendered(){this instanceof G?Pe.delete(this):Ke$1.delete(this);}async getVariation(){U$3.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id===`preview`};try{return (await an(e)).data}catch(t){t instanceof ne$4&&t.response?.status;return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){U$3.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let e=window.innerHeight*.3,t={root:null,rootMargin:`${e}px 0px ${e}px 0px`,threshold:0};return this.isInViewport()?this.getVariation():new Promise(o=>{let n=new IntersectionObserver((i,s)=>{i.forEach(async c=>{if(c.isIntersecting){U$3.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);o(await this.getVariation()),s.unobserve(this.rootContainer);}});},t);n.observe(this.rootContainer),this.observers.push(n);})}attachScroll(){this.scrollSubscription=Tr$2(window,`scroll`).pipe(Fe$2(r$9.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent();});}checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(r$9.engagementIDsWithTrackedDisplay.has(e)||!this.isInViewport())return;let o={};this.triggerContext.triggerData.items?.length&&(o.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let i=new dr$3(this.isExclusionWithBVariation?`CE Campaign Holdout`:`CE Trigger Displayed`,o,this.engagementTrigger);i.name===`CE Campaign Holdout`&&(i.trigger.holdout=true),be$1(i),r$9.engagementIDsWithTrackedDisplay.add(e),this.scrollSubscription?.unsubscribe();}generateParentElementID(){return `letscooee-${this.engagementTrigger.shortID}`}createAngularWidget(e){let t=this.widgetElement=document.createElement(e);return t.cart=h.getCurrent(),t.triggerContext=this.triggerContext,t.engagementTrigger=this.engagementTrigger,t.setAttribute(`engagement`,this.engagementTrigger.shortID),this.rootContainer.appendChild(t),this.addToRendered(),this.injectOuterCSSOnly(),t}getParentElement(e,t=document){let o=t.getElementById(e);if(o)return o;let n=this.engagementTrigger.objective.toLowerCase().replaceAll(`_`,`-`),i=this.engagementTrigger.shortID;o=document.createElement(`div`),o.id=e;let s=`letscooee letscooee-engagement engagement-${i} lc-${n}`;return this.engagementTrigger.content?.classes&&(s+=` ${this.engagementTrigger.content.classes}`),o.className=s,o.dataset.engagementId=i,this.engagementTrigger.id===`preview`&&(o.className+=` letscooee-preview`),o.style.display=`block`,o.style.minHeight=`0.5px`,o.style.minWidth=`0.5px`,o}async startRendering(){let e=this.rootContainer,t=this.triggerContext.triggerData.hasSwiperElement();t&&(e=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:`open`}),Hi$2(e)),this.injectCampaignCSS(t,e);let o=this.engagementTrigger.widget;$e$2(Yr$2(ut$1,{element:o.cont,triggerContext:this.triggerContext,elements:o.elems}),e),this.addToRendered();}injectCampaignCSS(e,t){let o=this.engagementTrigger.content?.outerCSS?.trim()??``,n=this.engagementTrigger.content?.innerCSS?.trim()??``,i=this.engagementTrigger.content?.globalCSS?.trim()??``;if(i&&le$4(i),!o&&!n)return;let s=this.rootContainer.id;if(e){le$4(n,t),this.injectOuterCSSOnly();return}le$4(`#${s} { ${o+`
|
|
163
|
+
${n}`} }`,this.parentOuterShadowElement);}injectOuterCSSOnly(){let e=this.engagementTrigger.content?.outerCSS?.trim();if(!e)return;let t=this.rootContainer.id;le$4(`#${t} { ${e} }`);}isInViewport(){let e=this.rootContainer?.getBoundingClientRect();if(!e)return false;let t=window.innerHeight||document.documentElement.clientHeight,s=(Math.min(e.bottom,t)-Math.max(e.top,0))*e.width/(e.width*e.height)*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let t=await this.createParentElementWithPlacement(e);if(t)return t;let o=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(o)}async createParentElementWithPlacement(e){let t=this.engagementTrigger.placement;if(!t?.selector)return U$3.info(`\u26A0\uFE0F${this.engagementTrigger} does not have a selector`),null;let o=t.selector,n;if(o.includes(`:shadow`)){let d=o.split(`:shadow`);n=(await zn$1(d[0].trim()))?.shadowRoot,o=d[1].trim(),n&&(this.parentOuterShadowElement=n,Hi$2(n,false));}U$3.verbose(`${this.engagementTrigger} attempt to render "${t.position}" "${o}"`);let i=await zn$1(o,3,n??document);if(!i)return U$3.warn(`${this.engagementTrigger} no placement found with ${o}`),null;let s=this.generateParentElementID(),c=this.getParentElement(s);if(!e)return c;switch(t.position){case fe$2.BEFORE1:case fe$2.BEFORE:i.parentElement?.insertBefore(c,i);break;case fe$2.INSIDE_FIRST1:case fe$2.INSIDE_FIRST:i.insertBefore(c,i.firstChild);break;case fe$2.INSIDE_LAST1:case fe$2.INSIDE_LAST:i.appendChild(c);break;case fe$2.AFTER1:case fe$2.AFTER:default:i.parentElement?.insertBefore(c,i.nextSibling);}return c}async runChoresBeforeRender(){if(this.isExclusionWithBVariation)return;if(!this.isAllOkToRender()){U$3.info(`\u26A0\uFE0F ${this.engagementTrigger} could not be rendered`);return}U$3.verbose(`${this.engagementTrigger} will be rendered`);let e;try{e=await tr$1(this.engagementTrigger);}catch(t){U$3.info(`\u203C\uFE0F${this.engagementTrigger} could not render as items failed to refresh`,t);return}if(!this.engagementTrigger.isCollectionPromoted()&&!e?.length&&this.engagementTrigger.isProductPromoted()){U$3.info(`\u203C\uFE0F${this.engagementTrigger} could not render as no products promoted`),this.destroy();return}this.engagementTrigger.items=e,await this.startRendering();}updateItems(e,t){let o=this.getItemDiff(e,t),n=this.getItemDiff(t,e);t.push(...o);for(let i of n)te$1.remove(t,i);}getItemDiff(e,t){return e.filter(o=>!t.some(n=>n.selectedOrFirstVariant.value.mID===o.selectedOrFirstVariant.value.mID))}};var G=class extends R$1{constructor(e){super(e);}async rerenderAfterCartOpened(){await this.rerenderIfDeleted(),this.checkAndSendEvent();}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}checkAndSendEvent(){if(!D$1.get().isOpen()&&We$4().pageName!==`cart`){U$3.log(`Do not send display event as neither the cart drawer nor the cart page is open.`);return}return super.checkAndSendEvent()}};var sr$1=class r{constructor(e,t){this.engagementTrigger=e;this.element=t;this.cartItems=h.getCurrent().items;}cartItems;static renderCartUpsell(e){let t=e.placement;if(!t?.selector){U$3.warn(`No placement available for ${e.objective}`,e.shortID);return}let o=Array.from(document.querySelectorAll(t.selector));if(!o?.length){U$3.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let n of o)new r(e,n).render();}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.content?.subsUpgradeConfig?.skipSubscribedItems&&e.selling_plan_allocation)return;let t=this.engagementTrigger.items.find(p=>p.mID===e.product_id.toString());if(!t)return;let o=t.vars.find(p=>p.mID===e.id.toString());if(!o)return;let n=new mt$3(o),i=e.selling_plan_allocation?.selling_plan;if(i)for(let p of n.sellingPlans??[])p.mID===i.id.toString()&&(p.isSelected=true,n.changeSellingPlan(p));let s=new vt$2(t);s.vars=[n],s.selectedOrFirstVariant.value=n;let c=`lc-cart-item-${this.engagementTrigger.shortID}-${t.mID}`;this.element.classList.add(c);let d=new q$1(this.engagementTrigger);d.placement.selector=`.${c}`,d.items=[s];let g=new G(d);g.renderSilently(),this.watchForCartItemDeletion(g,c);}watchForCartItemDeletion(e,t){let o=new MutationObserver(n=>{n.forEach(i=>{i.removedNodes.forEach(s=>{s===this.element&&(U$3.verbose(`${t} has been removed`),e.destroy(),o.disconnect());});});});o.observe(this.element.parentElement,{childList:true,subtree:true});}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(t=>{if(!(e.includes(t.url)||e.includes(t.variant_id))&&(!e.includes(t.product_title)||t.variant_title&&!e.includes(t.variant_title)))return false;let o=t.selling_plan_allocation?.selling_plan?.name;return !(o&&!e.includes(o))})}};var ar$1=class ar extends R$1{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-collection-filter`);}};var cr$1=class cr extends G{constructor(e){super(e);}async update(e){await super.update(e),this.engagementTrigger.progressBarConfig.update(e.progressBarConfig),await this.checkMilestoneTryCatch(),this.updateAngularWidget();}isAllOkToRender(){return !!this.engagementTrigger.progressBarConfig}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget(`cooee-progressbar`),await this.checkMilestoneTryCatch();}async checkMilestoneTryCatch(){try{await this.checkMilestone();}catch(e){ke$1(e,`progressbar_milestones_apply`,{engagementTrigger:this.engagementTrigger});}}async checkMilestone(){let e=await h.getCurrent().getNormalisedCart(true),t=this.engagementTrigger.progressBarConfig,o=[],n=[],i=[],s,c,d=[...t.milestones];for(let g of d){if(g.rewardType!==ve$4.FREE_AUTO_GIFT)continue;if(g.isUIOnly&&!g.allowATC){U$3.verbose(`Skipping milestone ${g.label} as it is UI only and does not allow ATC`);continue}let p=g.items[0],C=g.reached,I=e.items.find(u=>(u.vID===p.vID||u.mID===p.mID)&&u.properties._letscooee_campaign===this.engagementTrigger.shortID);C&&(s=g,c=I),I&&o.push(I),!C&&I&&t.removeIneligibleItem?(U$3.verbose(`Removing free gift ${I.vID} from cart`),i.push(I)):C&&!I&&(U$3.verbose(`Adding free gift ${p.vID} to cart`),n.push(p));}t.restrictToLatestFreebie&&s&&(c?(o=o.filter(g=>g.vID!==c.vID),n=[]):n=[s.items[0]],i.push(...o)),t.treatFreebieAsSeparateLineItem?await this.handleSeparateFreebieLineItems(n,i):await this.handleCombinedCartUpdate(n,i);}async handleSeparateFreebieLineItems(e,t){if(!t.length&&!e.length)return;let o=new pe,n=[];if(e.length){let c=this.addFreebiesOperation(e,o);n.push(c);}if(t.length){let c=this.removeFreebiesOperation(t);n.push(c);}if(!n.length)return;let i;try{i=await Promise.all(n),U$3.log(`All freebie and coupon operations completed`);}catch(c){ke$1(c,`progressbar_freebie_ops_parallel`,{engagementTrigger:this.engagementTrigger});}let s;e.length&&i?.length&&(s=i[0]),D$1.get().refreshUI(s,false);}async removeFreebiesOperation(e){let t={updates:{}};return e.forEach(o=>t.updates[o.key??o.vID]=o.quantity-1),kr$1(t,this.engagementTrigger)}async addFreebiesOperation(e,t){return t.addToCart(e,this.engagementTrigger)}async handleCombinedCartUpdate(e,t){let o=this.engagementTrigger.progressBarConfig,n={},i={};t.length&&t.forEach(C=>i[C.key??C.vID]=0),e.length&&e.forEach(C=>i[C.vID]=1);let s=o.coupons,c=[];if(s?.length){c=s.map(u=>u.couponCode);let C=h.getCurrent().discount_codes?.map(u=>u.code)??[];c.every(u=>C.some(y=>y===u))||(n.discount=c.join(`,`));}if(he$4.hasKeys(i)&&(n.updates=i),!he$4.hasKeys(n))return;let d=await kr$1(n,this.engagementTrigger),g=d?.items,p=[];for(let C of e){let I=g?.find(u=>c?.length?u.id+``===C.vID&&u.discounts?.some(y=>c.includes(y.title)):u.id+``===C.vID);I&&p.push(I);}if(!p.length){D$1.get().refreshUI(d,false);return}try{await Promise.all(p.map(C=>nn(C,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()})));}catch(C){ke$1(C,`progressbar_private_attr_add`,{engagementTrigger:this.engagementTrigger,extra:{productAddedByCooee:p}});}finally{D$1.get().refreshUI(d,false);}}};var gt$1=class gt extends G{constructor(e){super(e);}async update(e){await super.update(e),this.engagementTrigger.content.update(e.content),this.updateAngularWidget();}isAllOkToRender(){return !!this.engagementTrigger.content}async startRendering(){if(this.updateAngularWidget()){this.addToRendered();return}this.createAngularWidget(`cooee-savings-bar`);}};var lr$1=class lr extends R$1{constructor(e){super(e);}isAllOkToRender(){return !!this.engagementTrigger.content?.videoConfig}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e;this.engagementTrigger.isFloatingVideo()?e=`cooee-video-popup`:this.engagementTrigger.isVideoStory()?e=`cooee-video-stories`:e=`cooee-video-playlist`,this.createAngularWidget(e);}};var mr=class extends R$1{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-sticky-atc`);}};var dr$1=class dr extends R$1{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(`letscooee:inbound:cta:add-bundle`,this.inboundCTAListener.bind(this),false);}async inboundCTAListener(e){let t=this.engagementTrigger,o=`Engagement(id: ${t.engagementID}, shortID: ${t.shortID})`,n=e.detail;if(!he$4.hasKeys(n)){U$3.error(`No detail received for ${o}`);return}U$3.log(`Detail received for BYOB`,n);let i=n.campaignID??n.campaignId??n.campaign_id;if(i!==t.shortID&&i!==t.engagementID){U$3.warn(`Current ${o} is not BYOB. Received: ${i}`);return}let s=n.items;if(!s?.length)return;let c=s.map(d=>new pt$2({mID:d.product_id,vID:d.variant_id,quantity:d.quantity||1}));await new Ge$1(this.triggerContext).execute({embeddedItems:c,clickAction:{at:he$3.ADD_BUNDLE,applyDiscount:true}});}};var pr$1=class pr extends R$1{cartChangeSubscription;isProcessingAddOns=false;afterRootContainerCreated(){this.cartChangeSubscription&&!this.cartChangeSubscription.closed||this.listenCartChange();}preDestroy(){super.preDestroy(),this.cartChangeSubscription?.unsubscribe();}listenCartChange(){let e=new pe;this.cartChangeSubscription=window.CooeeSDK.cartChange$.subscribe(async t=>{if(this.isProcessingAddOns||!this.wasCurrentItemAdded(t))return;this.isProcessingAddOns=true;let o=this.triggerContext.triggerData;U$3.log(`${o} detected current item addition to cart`);let n=this.triggerContext.selectedItems;if(!n?.length){U$3.log(`No add-ons selected for the current product ${o}`),this.isProcessingAddOns=false;return}U$3.log(`Adding ${n.length} add on items in the cart`);let i=await e.addToCart(n,o);D$1.get().refreshUI(i,false),this.isProcessingAddOns=false;});}wasCurrentItemAdded(e){let t=window.CooeeSDK.runtimeData.currentItem;return t?!!e.itemsAdded?.find(o=>o.mID===t?.mID&&o.vID===t.vID):false}};var Mr=false,Fr=false,ur$1=null,gr$1=null,cn=false,Pe=new Set,Ke$1=new Set;function ln(){cn||(cn=true,It$2(()=>{Fo(document.body,{childList:true,subtree:true},500,Mo).subscribe(()=>{Ke$1.forEach(r=>r.rerenderIfDeleted()),Pe.forEach(r=>r.rerenderIfDeleted());});}));}async function ft$1(r){if(r.length>0&&await pn(),ln(),Mr){U$3.verbose(`Cart widget processing in progress, queuing latest triggers`),ur$1=r;return}Mr=true;try{di(r);}finally{if(Mr=false,ur$1){let e=ur$1;ur$1=null,U$3.verbose(`Processing queued cart triggers`),ft$1(e);}}}async function ht$1(r){if(r.length>0&&await pn(),ln(),Fr){U$3.verbose(`Page widget processing in progress, queuing latest triggers`),gr$1=r;return}Fr=true;try{pi(r);}finally{if(Fr=false,gr$1){let e=gr$1;gr$1=null,U$3.verbose(`Processing queued page triggers`),ht$1(e).catch(console.error);}}}function dh(){Pe.forEach(r=>r.rerenderAfterCartOpened().catch(e=>ke$1(e,`cart_widget_render_update`,{engagementTrigger:r.engagementTrigger})));}function di(r){dn(Pe,r);for(let e of r){U$3.info(`${e} received as cart embed`);let t=mn(Pe,e);if(t&&!e.isSubscriptionUpsell()){t.updateAndReRender(e).catch(n=>{ke$1(n,`widget_update_render`,{engagementTrigger:e});});continue}U$3.verbose(`${e} is new`);let o;if(e.isProgressBar())o=new cr$1(e);else if(e.isSubscriptionUpsell()){sr$1.renderCartUpsell(e);continue}else e.isSavingsBar()?o=new gt$1(e):o=new G(e);Pe.add(o),o.renderSilently();}}function pi(r){dn(Ke$1,r);for(let e of r){U$3.info(`${e} received as page embed`);let t=mn(Ke$1,e);if(t){t.updateAndReRender(e).catch(n=>{ke$1(n,`widget_update_render`,{engagementTrigger:e});});continue}U$3.verbose(`${e} is new`);let o;e.isVideoObjective()?o=new lr$1(e):e.isBYOB()?o=new dr$1(e):e.isStickyATC()?o=new mr(e):e.isSavingsBar()?o=new gt$1(e):e.isCollectionFilter()?o=new ar$1(e):e.isAddOns()?o=new pr$1(e):o=new R$1(e),Ke$1.add(o),o.renderSilently();}}function mn(r,e){for(let t of r)if(t.matches(e))return t}function dn(r,e){let t=new Set(e.map(o=>o.shortID));for(let o of r)t.has(o.engagementTrigger.shortID)||o.destroy();}async function pn(){await(await import('./widgets-ZnU-5WNv-CQ31MMkb.js').then(function (n) { return n.ad; })).loadAngularWidgets();}var gn=new U$1,un=0;gn.pipe(Fe$2(50)).subscribe(async r=>{ui(await ot()).catch(t=>{U$3.error(`Error fetching widgets. Is firstLoad: ${r}`,t);});});function fn(r=false){le$2(K$1).then(()=>{gn.next(r);}).catch(e=>U$3.error(`Session not established, skipping fetchWidgets`,e));}async function an(r){let e=await ot();return Object.assign(r,e),re$1(`/v1/engagement/get-variant`,r)}async function ui(r$10){un++,un===1?U$3.info(`Fetch widgets (after ⏰`,Nn$3()+` of SDK load)`):U$3.info(`Fetch widgets`);let t=await re$1(`/v1/engagement/eligible`,r$2({},r$10));U$3.info(`Widgets fetched ${Rn$1(t.timeTakenMs)}`);ht$1(t.data.pageWidgets?.map(i=>new q$1(i))??[]).catch(console.error);ft$1(t.data.cartWidgets?.map(i=>new q$1(i))??[]).catch(console.error);}var hn=x$2(Ir$3()),fr$1=class r{static META_REQUIRED_FIELDS=[`ad_id`];static GOOGLE_REQUIRED_FIELDS=[`gad_source`,`gclid`];source;adID;campaignID;adName;campaignName;constructor(e){this.adID=e.adID,this.campaignID=e.campaignID,this.source=e.source;}static getAdParams(){let e;try{e=new hn.URLBuilder(location.href);}catch{return {}}let t={};if(this.META_REQUIRED_FIELDS.every(i=>Array.from(e.getParams().keys()).includes(i)))return t={source:`META`,adID:e.getQueryParam(`ad_id`)?.trim(),campaignID:e.getQueryParam(`campaign_id`)?.trim()},new r(t);if(this.GOOGLE_REQUIRED_FIELDS.every(i=>Array.from(e.getParams().keys()).includes(i)))return t={source:`GOOGLE`},new r(t)}};var Br={d:(r,e)=>{for(var t in e)Br.o(e,t)&&!Br.o(r,t)&&Object.defineProperty(r,t,{enumerable:true,get:e[t]});},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},Vr={};Br.d(Vr,{A:()=>gi$1,k:()=>Wr});var Ct$1=function(r,e,t,o){return new(t||(t=Promise))(function(n,i){function s(g){try{d(o.next(g));}catch(p){i(p);}}function c(g){try{d(o.throw(g));}catch(p){i(p);}}function d(g){var p;g.done?n(g.value):(p=g.value,p instanceof t?p:new t(function(C){C(p);})).then(s,c);}d((o=o.apply(r,[])).next());})},yt$1=function(r,e){var t,o,n,i,s={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return i={next:c(0),throw:c(1),return:c(2)},typeof Symbol==`function`&&(i[Symbol.iterator]=function(){return this}),i;function c(d){return function(g){return (function(p){if(t)throw new TypeError(`Generator is already executing.`);for(;i&&(i=0,p[0]&&(s=0)),s;)try{if(t=1,o&&(n=2&p[0]?o.return:p[0]?o.throw||((n=o.return)&&n.call(o),0):o.next)&&!(n=n.call(o,p[1])).done)return n;switch(o=0,n&&(p=[2&p[0],n.value]),p[0]){case 0:case 1:n=p;break;case 4:return s.label++,{value:p[1],done:!1};case 5:s.label++,o=p[1],p=[0];continue;case 7:p=s.ops.pop(),s.trys.pop();continue;default:if(n=s.trys,!((n=n.length>0&&n[n.length-1])||p[0]!==6&&p[0]!==2)){s=0;continue}if(p[0]===3&&(!n||p[1]>n[0]&&p[1]<n[3])){s.label=p[1];break}if(p[0]===6&&s.label<n[1]){s.label=n[1],n=p;break}if(n&&s.label<n[2]){s.label=n[2],s.ops.push(p);break}n[2]&&s.ops.pop(),s.trys.pop();continue}p=e.call(r,s);}catch(C){p=[6,C],o=0;}finally{t=n=0;}if(5&p[0])throw p[1];return {value:p[0]?p[1]:void 0,done:true}})([d,g])}}};function Wr(){return Ct$1(this,void 0,Promise,function(){return yt$1(this,function(r){switch(r.label){case 0:return [4,new Promise(function(e,t){var o=`Unknown`,n=false;function i(u){n||(n=true,e({isPrivate:u,browserName:o}));}function s(){var u=0,y=parseInt(`-1`);try{y.toFixed(y);}catch(S){u=S.message.length;}return u}function c(){return navigator.msSaveBlob!==void 0&&(function(u){try{return u===eval.toString().length}catch{return false}})(39)}function d(){var u;return Ct$1(this,void 0,void 0,function(){var y,S;return yt$1(this,function(f){switch(f.label){case 0:return f.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return f.sent(),i(false),[3,3];case 2:return y=f.sent(),S=y,y instanceof Error&&(S=(u=y.message)!==null&&u!==void 0?u:y),typeof S!=`string`?(i(false),[2]):(i(!!S.includes(`unknown transient reason`)),[3,3]);case 3:return [2]}})})}function g(){var u;return Ct$1(this,void 0,Promise,function(){return yt$1(this,function(y){switch(y.label){case 0:return ((u=navigator.storage)===null||u===void 0?void 0:u.getDirectory)===void 0?[3,2]:[4,d()];case 1:return y.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var S=String(Math.random());try{var f=indexedDB.open(S,1);f.onupgradeneeded=function(L){var ge=L.target.result,_=function(Cr){i(Cr);};try{ge.createObjectStore(`t`,{autoIncrement:!0}).put(new Blob),_(!1);}catch(Cr){(Cr.message||``).includes(`are not yet supported`)?_(!0):_(!1);}finally{ge.close(),indexedDB.deleteDatabase(S);}},f.onerror=function(){return i(!1)};}catch{i(false);}})():(function(){var S=window.openDatabase,f=window.localStorage;try{S(null,null,null,null);}catch{i(true);return}try{f.setItem(`test`,`1`),f.removeItem(`test`);}catch{i(true);return}i(false);})(),y.label=3;case 3:return [2]}})})}function p(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(u,y){var S;i(Math.round(y/1048576)<2*Math.round(((S=window).performance!==void 0&&S.performance.memory!==void 0&&S.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576));},function(u){t(new Error(`detectIncognito somehow failed to query storage quota: `+u.message));});}function C(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?p():(0, window.webkitRequestFileSystem)(0,1,function(){i(false);},function(){i(true);});}function I(){return Ct$1(this,void 0,Promise,function(){var u,y;return yt$1(this,function(S){switch(S.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return [3,4];S.label=1;case 1:return S.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return S.sent(),i(false),[3,4];case 3:return u=S.sent(),typeof(y=u instanceof Error&&typeof u.message==`string`?u.message:String(u))!=`string`?(i(false),[2]):(i(y.includes(`Security error`)),[2]);case 4:return i(navigator.serviceWorker===void 0),[2]}})})}(function(){return Ct$1(this,void 0,Promise,function(){return yt$1(this,function(u){switch(u.label){case 0:return s()!==44?[3,2]:(o=`Safari`,[4,g()]);case 1:return u.sent(),[3,6];case 2:return s()!==51?[3,3]:(y=navigator.userAgent,o=y.match(/Chrome/)?navigator.brave!==void 0?`Brave`:y.match(/Edg/)?`Edge`:y.match(/OPR/)?`Opera`:`Chrome`:`Chromium`,C(),[3,6]);case 3:return s()!==25?[3,5]:(o=`Firefox`,[4,I()]);case 4:return u.sent(),[3,6];case 5:c()?(o=`Internet Explorer`,i(window.indexedDB===void 0)):t(new Error(`detectIncognito cannot determine the browser`)),u.label=6;case 6:return [2]}var y;})})})().catch(t);})];case 1:return [2,r.sent()]}})})}typeof window<`u`&&(window.detectIncognito=Wr);var gi$1=Wr,Cn=Vr.A;Vr.k;var yn=x$2(Dt$2()),vn=async()=>{let r={};try{return await fi$1(r)}catch(e){return ke$1(e,`device_props_collect`),r}},fi$1=async r=>{let e=window.CooeeSDK.uaParser;hi$1(r),Ci$1(r),yi$1(r),r.referrer=document.referrer,r.host=location.origin,r.path=location.pathname,r.qs=location.search,r.locale=navigator.language,r.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:vi$1()},r.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(r.headless=true,wn$1({headless:true}));let t=e.getResult();return r.browser=t.browser,r.device=t.device,r.engine=t.engine,r.cpu=t.cpu,r.os=t.os,r.navigatorUA=navigator.userAgent,await Promise.all([bi$1(r),Ei$1(r),Si$1(r)]),r},hi$1=r=>{let e=navigator;if(!e.deviceMemory)return;r.mem={tot:e.deviceMemory*1024};},Ci$1=r=>{let e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;t?.effectiveType&&(r.net={type:t.effectiveType});},yi$1=r=>{let e=screen.orientation?.type;e&&(r.orientation=e);},vi$1=()=>{if(!document.body)return;let r=document.createElement(`div`);r.setAttribute(`style`,`height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;`),document.body.appendChild(r);let e=window.devicePixelRatio||1,t=r.offsetWidth*e;return document.body.removeChild(r),t},Ei$1=async r=>{try{await wi$1(r);}catch(e){U$3.error(`Unable to get location`,e);}},wi$1=async r=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:`geolocation`})).state!=`granted`))return new Promise(t=>{navigator.geolocation.getCurrentPosition(o=>{r.coords=[o.coords.latitude,o.coords.longitude],t();},()=>t());})},bi$1=async r=>{if(`getBattery`in navigator)try{let t=await navigator.getBattery();r.bat={l:t.level*100,c:t.charging},wn$1({"battery.level":r.bat.l,"battery.charging":r.bat.c});}catch{}},Si$1=async r=>{try{(await Cn())?.isPrivate&&(r.incognito=!0,wn$1({incognito:!0}));}catch(e){yn.default.error(`Unable to detect private/incognito window`,e);}};function wn(r){if(!bn())return;let e=ge$2[r]?.toLowerCase();e&&(U$3.verbose(`Sending ${e} intent to MS Clarity`),window.clarity(`set`,`Cooee Intent`,e));}function bn(){return window.clarity&&typeof window.clarity==`function`}var K$1=new gr$2(1),Ti$1=`Store id or shop name is missing`,hr$1;async function rC(){U$3.info(`Begin auth after ⏰`,Nn$3(),`of JS load`);try{await Ii$1(),K$1.next(!0),K$1.complete();}catch(r){r?.message?.includes(Ti$1)&&ke$1(r,`session_initiate`),U$3.error(`Unable to initiate session`,r),K$1.error(r);}}async function tn(){return await Tn(false),hr$1}async function oC(){Pn(ce$5.getVisitorOldId()??new $$2().toHexString());}async function Sn(){if(hr$1)return;let[r,e,t]=await Promise.all([ve$5.get(`id`,``),ce$5.get(`sessionNumber`,1),ve$5.get(`landing`,{})]);In(r,e,t);}async function Ii$1(){await Tn(true);}async function Tn(r){let e=false;return await Di$1()?(await Pi$1(),e=true):await xi$1()?(await Sn(),e=true):await Sn(),e?await _i$1():r&&fn(),e}async function Pi$1(){U$3.info(`Starting new session`),await ve$5.clear();let r=new Date,e=new $$2().toHexString(),t=await ce$5.get(`sessionNumber`,0)+1,o=rr$1();await Promise.all([ce$5.set(`sessionNumber`,t),ve$5.set(`id`,e),ve$5.set(`lastUsedTime`,r.getTime()),ve$5.set(`landing`,o)]),In(e,t,o);}async function Di$1(){let r=await ve$5.get(`lastUsedTime`,0);return r?(new Date().getTime()-r)/1e3>1800:true}async function xi$1(){return !await ve$5.get(`synced`,false)}async function Ri$1(){let r$11=await vn(),e=or$1();return s$2(r$2(r$2({deviceProps:r$11},hr$1),e),{sdk:Jr$3,ad:fr$1.getAdParams(),occurred:Li$1(We$4().jsLoadTime),properties:{}})}async function _i$1(){U$3.info(`Ensuring session on server`),await Ai$1();let r=Date.now(),e=await Ri$1();U$3.info(`Session data generated ${Rn$1(Date.now()-r)}`);try{let t=await re$1(`/v1/event/validate-session`,e);U$3.info(`Auth finished ${Rn$1(t.timeTakenMs)}`),await ve$5.set(`synced`,!0),t.data.deviceID&&(Oi$1(t.data.deviceID,t.data.visitorID),Pn(ce$5.getVisitorOldId()??t.data.deviceID));ht$1(t.data.pageWidgets?.map(i=>new q$1(i))??[]).catch(console.error);ft$1(t.data.cartWidgets?.map(i=>new q$1(i))??[]).catch(console.error);}catch(t){throw U$3.error(t),t}}async function Ai$1(){let r=await ce$5.get(`firstSeen`),e=r?new Date(r):new Date;r||await ce$5.set(`firstSeen`,e.toISOString()),Qo(e);}function In(r,e,t){wn$1({"cooee_session.number":e}),Tn$1(`Visitor Session`,{id:r,number:e,landing_page:t}),U$3.info(`Session number: ${e}, id: ${r}`),hr$1={sessionID:r,sessionNumber:e,landingPage:t};}function Oi$1(r,e){let t=ce$5.getVisitorOldId(),o=ce$5.getVisitorId(),n=!!t&&t!==r,i=!!e&&!!o&&o!==e;if(!n&&!i)return;_n(`Visitor identity client-server divergence`,`warning`,{tags:{divergence_type:n&&i?`both`:n?`did_only`:`vid_only`},extra:{clientDid:t,backendDid:r,clientVid:o,backendVid:e}});}function Pn(r){U$3.info(`Visitor ID (old):`,r),U$3.info(`Visitor ID (new):`,ce$5.getVisitorId()),bn$1({id:r});}function Li$1(r){return (new Date().getTime()-r.getTime())/1e3>1800?new Date:r}function lC(){document.onvisibilitychange=()=>{document.visibilityState===`visible`?ki$1():document.visibilityState===`hidden`&&Ni$1();};}async function ki$1(){}async function Ni$1(){let r=await Ui$1();if(r===0){U$3.info(`Not sending duration as user was inactive on website`);return}xn(r);}async function Ui$1(){let r=We$4();return r.inInactive?0:(r.inInactive=true,r.lastEnterInactive=new Date,Math.max(r.lastEnterInactive.getTime()-r.lastEnterActive.getTime(),0))}function Dn(){let r=We$4();return r.inInactive?(r.inInactive=false,r.lastEnterActive=new Date,Math.max((r.lastEnterActive.getTime()-r.lastEnterInactive.getTime())/1e3,0)):0}function Rn(r){if(!Mi$1()||!le$5.get().pixelPush)return;let t=ge$2[r.intent]?.toLowerCase();t&&(U$3.verbose(`Sending ${t} intent to Facebook Pixel`),window.fbq(`trackCustom`,`CooeeIntent`,{intent_value:t}));}function Mi$1(){return window.fbq&&typeof window.fbq==`function`}var Lr=`/v1/event/track-page-unload`;function Vo(r){U$3.verbose(`Waiting for auth to send event ${r.name}`),le$2(K$1).then(()=>be$1(r)).catch(e=>U$3.error(`Session not established, skipping trackEvent`,e));}function xn(r){le$2(K$1).then(()=>{Fi$1(r);}).catch(e=>U$3.error(`Session not established, skipping trackPageUnload`,e));}async function Fi$1(r){let e=We$4().currentPageViewEvent;if(!e){U$3.warn(`No page view event was stored previously`);return}let t={pageViewEventID:e.id,pageViewEventName:e.name,pageActiveTimeMS:r};U$3.verbose(`Sending page unload`,t);try{await re$1(Lr,t);}catch(o){throw U$3.error(`Error sending page unload for ${e} to server`,o),o}}function be$1(r){Bi$1(r);}async function Bi$1(r){if(U$3.verbose(`Sending event: ${r.name}`,r),Gi(r)){U$3.warn(`Rejecting event ${r.name}`);return}Uo();let e=await ot();Object.assign(r,e),Dn(),ve$5.set(`lastUsedTime`,new Date().getTime());let t=qi$1(r.name),o=t.toLowerCase().replace(/\s+/g,`-`);try{let n=await re$1(`/v1/event/track/${o}`,r);U$3.info(`Event tracked:`,t),Vi$1(r)&&(We$4().currentPageViewEvent={id:r.id,name:r.name}),Wi$1(r,n.data);}catch(n){throw U$3.error(`Error sending event ${r.name} to server`,n),n}}function Vi$1(r){return rn$1.includes(r.name)?r.name===`View Cart`?!r.properties.drawer:true:false}function Wi$1(r,e){$i$1(r,e).catch(t=>{ke$1(t,`popup_response_process`,{extra:{event:r,response:e}});}),Hi$1(e);}async function $i$1(r,e){if(!e.triggerData?.ian)return;let t=new q$1(e.triggerData);t.occurred=r.occurred,U$3.log(`${t} will be shown`);let o;try{o=await tr$1(t);}catch(i){U$3.error(`Failed to refresh the products`,i);return}t.items=o;new(await(import('./renderer-BKCIF7-d-BcEjrOMd.js'))).FreeformRenderer().renderEngagement(t).catch(i=>{ke$1(i,`popup_render`,{extra:{event:r},engagementTrigger:t});});}function Hi$1(r){r.intent&&(wn(r.intent),Rn(r),U$3.info(`Intent is ${ge$2[r.intent]}`));}function qi$1(r){return r.replace(`CE `,``).replace(`Trigger`,`Campaign`).replace(`Screen`,`Page`).replace(`App `,``)}function Gi(r){return r.trigger?.triggerID===`test`||r.trigger?.triggerID===`preview`?(U$3.warn(`Not sending event as this is a test trigger`),true):false}
|
|
163
164
|
|
|
164
165
|
var t=class{lastWidth;lastHeight;resizeTimeout=null;debounceDelay=200;onResizeCallback;constructor(e){this.onResizeCallback=e,this.lastWidth=window.innerWidth,this.lastHeight=window.innerHeight,window.addEventListener(`resize`,this.debouncedResize),window.addEventListener(`orientationchange`,this.handleImmediateResize);}destroy(){window.removeEventListener(`resize`,this.debouncedResize),window.removeEventListener(`orientationchange`,this.handleImmediateResize);}handleImmediateResize=()=>{this.triggerResize();};debouncedResize=()=>{this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.triggerResize();},this.debounceDelay);};triggerResize(){let e=window.innerWidth,i=window.innerHeight;(i!==this.lastHeight||e!==this.lastWidth)&&(this.onResizeCallback(),this.lastWidth=e,this.lastHeight=i);}};
|
|
165
166
|
|
|
166
|
-
var Me=class extends re$5{static storeName=`app`;static{this.storage=pe$4(this.storeName);}};var Ki=` daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\bperl\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/`,Yi=/bot|crawl|http|lighthouse|scan|search|spider/i,he;function Xi(){if(he instanceof RegExp)return he;try{he=new RegExp(Ki,`i`);}catch{he=Yi;}return he}function gi(t){return !!t&&Xi().test(t)}var Ji=`2.0.4`,ht=500,fi=`user-agent`,ne=``,hi=`?`,Ue=`function`,j=`undefined`,se=`object`,bt=`string`,x$1=`browser`,B$1=`cpu`,N$1=`device`,T=`engine`,I=`os`,re=`result`,c=`name`,r=`type`,a$1=`vendor`,l$1=`version`,S$1=`architecture`,Re=`major`,n=`model`,ke=`console`,u=`mobile`,b=`tablet`,y=`smarttv`,L$1=`wearable`,Ne=`xr`,Ce=`embedded`,be=`inapp`,yt=`brands`,Y=`formFactors`,Et=`fullVersionList`,oe=`platform`,xt=`platformVersion`,Ve=`bitness`,q=`sec-ch-ua`,Zi=q+`-full-version-list`,Qi=q+`-arch`,er=q+`-`+Ve,tr=q+`-form-factors`,ir=q+`-`+u,rr=q+`-`+n,Ti=q+`-`+oe,or=Ti+`-version`,Ai=[yt,Et,u,n,oe,xt,S$1,Y,Ve],Be=`Amazon`,te=`Apple`,bi=`ASUS`,wi=`BlackBerry`,K=`Google`,vi=`Huawei`,nt=`Lenovo`,yi=`Honor`,He=`LG`,st=`Microsoft`,at=`Motorola`,ct=`Nvidia`,Ei=`OnePlus`,lt=`OPPO`,we=`Samsung`,xi=`Sharp`,ve=`Sony`,dt=`Xiaomi`,pt=`Zebra`,Si=`Chrome`,ki=`Chromium`,W=`Chromecast`,ze=`Edge`,ye=`Firefox`,Ee=`Opera`,mt=`Facebook`,Ci=`Sogou`,ie=`Mobile `,xe=` Browser`,wt=`Windows`,k=typeof window!==j&&window.navigator?window.navigator:void 0,V=k&&k.userAgentData?k.userAgentData:void 0,sr=function(t,e){var i={},o=e;if(!Fe(e)){o={};for(var s in e)for(var p in e[s])o[p]=e[s][p].concat(o[p]?o[p]:[]);}for(var d in t)i[d]=o[d]&&o[d].length%2===0?o[d].concat(t[d]):t[d];return i},je=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].toUpperCase()]=t[i];return e},vt=function(t,e){if(typeof t===se&&t.length>0){for(var i in t)if(H(e)==H(t[i]))return true;return false}return ce(t)?H(e)==H(t):false},Fe=function(t,e){for(var i in t)return /^(browser|cpu|device|engine|os)$/.test(i)||(e?Fe(t[i]):false)},ce=function(t){return typeof t===bt},ut=function(t){if(t){for(var e=[],i=ae(/\\?\"/g,t).split(`,`),o=0;o<i.length;o++)if(i[o].indexOf(`;`)>-1){var s=We(i[o]).split(`;v=`);e[o]={brand:s[0],version:s[1]};}else e[o]=We(i[o]);return e}},H=function(t){return ce(t)?t.toLowerCase():t},gt=function(t){return ce(t)?ae(/[^\d\.]/g,t).split(`.`)[0]:void 0},$=function(t){for(var e in t){var i=t[e];typeof i==se&&i.length==2?this[i[0]]=i[1]:this[i]=void 0;}return this},ae=function(t,e){return ce(e)?e.replace(t,ne):e},Se=function(t){return ae(/\\?\"/g,t)},We=function(t,e){if(ce(t))return t=ae(/^\s\s*/,t),typeof e===j?t:t.substring(0,ht)},ft=function(t,e){if(!(!t||!e))for(var i=0,o,s,p,d,g,m;i<e.length&&!g;){var v=e[i],R=e[i+1];for(o=s=0;o<v.length&&!g&&v[o];)if(g=v[o++].exec(t),g)for(p=0;p<R.length;p++)m=g[++s],d=R[p],typeof d===se&&d.length>0?d.length===2?typeof d[1]==Ue?this[d[0]]=d[1].call(this,m):this[d[0]]=d[1]:d.length>=3&&(typeof d[1]===Ue&&!(d[1].exec&&d[1].test)?d.length>3?this[d[0]]=m?d[1].apply(this,d.slice(2)):void 0:this[d[0]]=m?d[1].call(this,m,d[2]):void 0:d.length==3?this[d[0]]=m?m.replace(d[1],d[2]):void 0:d.length==4?this[d[0]]=m?d[3].call(this,m.replace(d[1],d[2])):void 0:d.length>4&&(this[d[0]]=m?d[3].apply(this,[m.replace(d[1],d[2])].concat(d.slice(4))):void 0)):this[d]=m||void 0;i+=2;}},M$1=function(t,e){for(var i in e)if(typeof e[i]===se&&e[i].length>0){for(var o=0;o<e[i].length;o++)if(vt(e[i][o],t))return i===hi?void 0:i}else if(vt(e[i],t))return i===hi?void 0:i;return e.hasOwnProperty(`*`)?e[`*`]:t},Ri={ME:`4.90`,"NT 3.51":`3.51`,"NT 4.0":`4.0`,2e3:[`5.0`,`5.01`],XP:[`5.1`,`5.2`],Vista:`6.0`,7:`6.1`,8:`6.2`,"8.1":`6.3`,10:[`6.4`,`10.0`],NT:``},Ii={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},ar={Chrome:`Google Chrome`,Edge:`Microsoft Edge`,"Edge WebView2":`Microsoft Edge WebView2`,"Chrome WebView":`Android WebView`,"Chrome Headless":`HeadlessChrome`,"Huawei Browser":`HuaweiBrowser`,"MIUI Browser":`Miui Browser`,"Opera Mobi":`OperaMobile`,Yandex:`YaBrowser`},_i={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[l$1,[c,ie+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[l$1,[c,ze+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l$1,[c,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,l$1],[/opios[\/ ]+([\w\.]+)/i],[l$1,[c,Ee+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[l$1,[c,Ee+` GX`]],[/\bopr\/([\w\.]+)/i],[l$1,[c,Ee]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[l$1,[c,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[l$1,[c,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[c,l$1],[/quark(?:pc)?\/([-\w\.]+)/i],[l$1,[c,`Quark`]],[/\bddg\/([\w\.]+)/i],[l$1,[c,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l$1,[c,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[l$1,[c,`WeChat`]],[/konqueror\/([\w\.]+)/i],[l$1,[c,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l$1,[c,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[l$1,[c,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[l$1,[c,`Smart `+nt+xe]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,`$1 Secure`+xe],l$1],[/\bfocus\/([\w\.]+)/i],[l$1,[c,ye+` Focus`]],[/\bopt\/([\w\.]+)/i],[l$1,[c,Ee+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[l$1,[c,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[l$1,[c,`Dolphin`]],[/coast\/([\w\.]+)/i],[l$1,[c,Ee+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[l$1,[c,`MIUI`+xe]],[/fxios\/([\w\.-]+)/i],[l$1,[c,ie+ye]],[/\bqihoobrowser\/?([\w\.]*)/i],[l$1,[c,`360`]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,`$1Browser`],l$1],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,`$1`+xe],l$1],[/samsungbrowser\/([\w\.]+)/i],[l$1,[c,we+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[l$1,[c,Ci+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,Ci+` Mobile`],l$1],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[c,l$1],[/(lbbrowser|rekonq)/i],[c],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[l$1,c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,mt],l$1,[r,be]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[c,l$1,[r,be]],[/\bgsa\/([\w\.]+) .*safari\//i],[l$1,[c,`GSA`],[r,be]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[l$1,[c,`TikTok`],[r,be]],[/\[(linkedin)app\]/i],[c,[r,be]],[/(chromium)[\/ ]([-\w\.]+)/i],[c,l$1],[/headlesschrome(?:\/([\w\.]+)| )/i],[l$1,[c,Si+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[l$1,[c,ze+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,Si+` WebView`],l$1],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l$1,[c,`Android`+xe]],[/chrome\/([\w\.]+) mobile/i],[l$1,[c,ie+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,l$1],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[l$1,[c,ie+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[c,ie+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[l$1,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[l$1,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[c,l$1],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[c,ie+ye],l$1],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,`Netscape`],l$1],[/(wolvic|librewolf)\/([\w\.]+)/i],[c,l$1],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l$1,[c,ye+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[c,[l$1,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[c,[l$1,/[^\d\.]+./,ne]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[S$1,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[S$1,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[S$1,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[S$1,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[S$1,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[S$1,/ower/,ne,H]],[/ sun4\w[;\)]/i],[[S$1,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[S$1,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[n,[a$1,we],[r,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[n,[a$1,we],[r,u]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[n,[a$1,te],[r,u]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[n,[a$1,te],[r,b]],[/(macintosh);/i],[n,[a$1,te]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[n,[a$1,xi],[r,u]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[n,[a$1,yi],[r,b]],[/honor([-\w ]+)[;\)]/i],[n,[a$1,yi],[r,u]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[n,[a$1,vi],[r,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[n,[a$1,vi],[r,u]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[n,/_/g,` `],[a$1,dt],[r,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[n,/_/g,` `],[a$1,dt],[r,u]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[n,[a$1,Ei],[r,u]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[n,[a$1,lt],[r,u]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[n,[a$1,M$1,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":lt}],[r,b]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[n,[a$1,`BLU`],[r,u]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[n,[a$1,`Vivo`],[r,u]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[n,[a$1,`Realme`],[r,u]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[n,[a$1,nt],[r,b]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[n,[a$1,nt],[r,u]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[n,[a$1,at],[r,u]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[n,[a$1,at],[r,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[n,[a$1,He],[r,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[n,[a$1,He],[r,u]],[/(nokia) (t[12][01])/i],[a$1,n,[r,b]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[n,/_/g,` `],[r,u],[a$1,`Nokia`]],[/(pixel (c|tablet))\b/i],[n,[a$1,K],[r,b]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[n,[a$1,K],[r,u]],[/(google) (pixelbook( go)?)/i],[a$1,n],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[n,[a$1,ve],[r,u]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[n,`Xperia Tablet`],[a$1,ve],[r,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[n,[a$1,Be],[r,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[n,/(.+)/g,`Fire Phone $1`],[a$1,Be],[r,u]],[/(playbook);[-\w\),; ]+(rim)/i],[n,a$1,[r,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[n,[a$1,wi],[r,u]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[n,[a$1,bi],[r,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[n,[a$1,bi],[r,u]],[/(nexus 9)/i],[n,[a$1,`HTC`],[r,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[a$1,[n,/_/g,` `],[r,u]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[n,[a$1,`TCL`],[r,b]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[n,[a$1,`TCL`],[r,u]],[/(itel) ((\w+))/i],[[a$1,H],n,[r,M$1,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[n,[a$1,`Acer`],[r,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[n,[a$1,`Meizu`],[r,u]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[n,[a$1,`Ulefone`],[r,u]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[n,[a$1,`Energizer`],[r,u]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[n,[a$1,`Cat`],[r,u]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[n,[a$1,`Smartfren`],[r,u]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[n,[a$1,`Nothing`],[r,u]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[n,[a$1,`Archos`],[r,b]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[n,[a$1,`Archos`],[r,u]],[/; (n159v)/i],[n,[a$1,`HMD`],[r,u]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[a$1,n,[r,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[a$1,n,[r,u]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[a$1,n,[r,b]],[/(surface duo)/i],[n,[a$1,st],[r,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[n,[a$1,`Fairphone`],[r,u]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[n,[a$1,ct],[r,b]],[/(sprint) (\w+)/i],[a$1,n,[r,u]],[/(kin\.[onetw]{3})/i],[[n,/\./g,` `],[a$1,st],[r,u]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[n,[a$1,pt],[r,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[n,[a$1,pt],[r,u]],[/smart-tv.+(samsung)/i],[a$1,[r,y]],[/hbbtv.+maple;(\d+)/i],[[n,/^/,`SmartTV`],[a$1,we],[r,y]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[a$1,n,[r,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[a$1,He],[r,y]],[/(apple) ?tv/i],[a$1,[n,te+` TV`],[r,y]],[/crkey.*devicetype\/chromecast/i],[[n,W+` Third Generation`],[a$1,K],[r,y]],[/crkey.*devicetype\/([^/]*)/i],[[n,/^/,`Chromecast `],[a$1,K],[r,y]],[/fuchsia.*crkey/i],[[n,W+` Nest Hub`],[a$1,K],[r,y]],[/crkey/i],[[n,W],[a$1,K],[r,y]],[/(portaltv)/i],[n,[a$1,mt],[r,y]],[/droid.+aft(\w+)( bui|\))/i],[n,[a$1,Be],[r,y]],[/(shield \w+ tv)/i],[n,[a$1,ct],[r,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[n,[a$1,xi],[r,y]],[/(bravia[\w ]+)( bui|\))/i],[n,[a$1,ve],[r,y]],[/(mi(tv|box)-?\w+) bui/i],[n,[a$1,dt],[r,y]],[/Hbbtv.*(technisat) (.*);/i],[a$1,n,[r,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[a$1,/.+\/(\w+)/,`$1`,M$1,{LG:`lge`}],[n,We],[r,y]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[n,[r,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[r,y]],[/(playstation \w+)/i],[n,[a$1,ve],[r,ke]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[n,[a$1,st],[r,ke]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[a$1,n,[r,ke]],[/droid.+; (shield)( bui|\))/i],[n,[a$1,ct],[r,ke]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[n,[a$1,we],[r,L$1]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[a$1,n,[r,L$1]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[n,[a$1,lt],[r,L$1]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[n,[a$1,te],[r,L$1]],[/(opwwe\d{3})/i],[n,[a$1,Ei],[r,L$1]],[/(moto 360)/i],[n,[a$1,at],[r,L$1]],[/(smartwatch 3)/i],[n,[a$1,ve],[r,L$1]],[/(g watch r)/i],[n,[a$1,He],[r,L$1]],[/droid.+; (wt63?0{2,3})\)/i],[n,[a$1,pt],[r,L$1]],[/droid.+; (glass) \d/i],[n,[a$1,K],[r,Ne]],[/(pico) (4|neo3(?: link|pro)?)/i],[a$1,n,[r,Ne]],[/(quest( \d| pro)?s?).+vr/i],[n,[a$1,mt],[r,Ne]],[/mobile vr; rv.+firefox/i],[[r,Ne]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[a$1,[r,Ce]],[/(aeobc)\b/i],[n,[a$1,Be],[r,Ce]],[/(homepod).+mac os/i],[n,[a$1,te],[r,Ce]],[/windows iot/i],[[r,Ce]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[n,[r,M$1,{mobile:`Mobile`,xr:`VR`,"*":b}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[r,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[r,u]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[n,[a$1,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l$1,[c,ze+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[c,l$1],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l$1,[c,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,l$1],[/ladybird\//i],[[c,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l$1,c]],os:[[/(windows nt) (6\.[23]); arm/i],[[c,/N/,`R`],[l$1,M$1,Ri]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[c,l$1],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[l$1,/(;|\))/g,``,M$1,Ri],[c,wt]],[/(windows ce)\/?([\d\.]*)/i],[c,l$1],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[l$1,/_/g,`.`],[c,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[c,`macOS`],[l$1,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[l$1,[c,W+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[l$1,[c,W+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[l$1,[c,W+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[l$1,[c,W+` Linux`]],[/crkey\/([\d\.]+)/i],[l$1,[c,W]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[l$1,c],[/(ubuntu) ([\w\.]+) like android/i],[[c,/(.+)/,`$1 Touch`],l$1],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[c,l$1],[/\(bb(10);/i],[l$1,[c,wi]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[l$1,[c,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l$1,[c,ye+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[l$1,[c,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[l$1,M$1,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[c,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[l$1,[c,`watchOS`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,`Chrome OS`],l$1],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[c,l$1],[/(sunos) ?([\d\.]*)/i],[[c,`Solaris`],l$1],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,l$1]]},$e=(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return $.call(t.init,[[x$1,[c,l$1,Re,r]],[B$1,[S$1]],[N$1,[r,n,a$1]],[T,[c,l$1]],[I,[c,l$1]]]),$.call(t.isIgnore,[[x$1,[l$1,Re]],[T,[l$1]],[I,[l$1]]]),$.call(t.isIgnoreRgx,[[x$1,/ ?browser$/i],[I,/ ?os$/i]]),$.call(t.toString,[[x$1,[c,l$1]],[B$1,[S$1]],[N$1,[a$1,n]],[T,[c,l$1]],[I,[c,l$1]]]),t})(),cr=function(t,e){var i=$e.init[e],o=$e.isIgnore[e]||0,s=$e.isIgnoreRgx[e]||0,p=$e.toString[e]||0;function d(){$.call(this,i);}return d.prototype.getItem=function(){return t},d.prototype.withClientHints=function(){return V?V.getHighEntropyValues(Ai).then(function(g){return t.setCH(new Di(g,false)).parseCH().get()}):t.parseCH().get()},d.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=re&&(d.prototype.is=function(g){var m=false;for(var v in this)if(this.hasOwnProperty(v)&&!vt(o,v)&&H(s?ae(s,this[v]):this[v])==H(s?ae(s,g):g)){if(m=true,g!=j)break}else if(g==j&&m){m=!m;break}return m},d.prototype.toString=function(){var g=ne;for(var m in p)typeof this[p[m]]!==j&&(g+=(g?` `:ne)+this[p[m]]);return g||j}),V||(d.prototype.then=function(g){var m=this,v=function(){for(var D in m)m.hasOwnProperty(D)&&(this[D]=m[D]);};v.prototype={is:d.prototype.is,toString:d.prototype.toString};var R=new v;return g(R),R}),new d};function Di(t,e){if(t=t||{},$.call(this,Ai),e)$.call(this,[[yt,ut(t[q])],[Et,ut(t[Zi])],[u,/\?1/.test(t[ir])],[n,Se(t[rr])],[oe,Se(t[Ti])],[xt,Se(t[or])],[S$1,Se(t[Qi])],[Y,ut(t[tr])],[Ve,Se(t[er])]]);else for(var i in t)this.hasOwnProperty(i)&&typeof t[i]!==j&&(this[i]=t[i]);}function Pi(t,e,i,o){return this.get=function(s){return s?this.data.hasOwnProperty(s)?this.data[s]:void 0:this.data},this.set=function(s,p){return this.data[s]=p,this},this.setCH=function(s){return this.uaCH=s,this},this.detectFeature=function(){if(k&&k.userAgent==this.ua)switch(this.itemType){case x$1:k.brave&&typeof k.brave.isBrave==Ue&&this.set(c,`Brave`);break;case N$1:!this.get(r)&&V&&V[u]&&this.set(r,u),this.get(n)==`Macintosh`&&k&&typeof k.standalone!==j&&k.maxTouchPoints&&k.maxTouchPoints>2&&this.set(n,`iPad`).set(r,b);break;case I:!this.get(c)&&V&&V[oe]&&this.set(c,V[oe]);break;case re:var s=this.data,p=function(d){return s[d].getItem().detectFeature().get()};this.set(x$1,p(x$1)).set(B$1,p(B$1)).set(N$1,p(N$1)).set(T,p(T)).set(I,p(I));}return this},this.parseUA=function(){return this.itemType!=re&&ft.call(this.data,this.ua,this.rgxMap),this.itemType==x$1&&this.set(Re,gt(this.get(l$1))),this},this.parseCH=function(){var s=this.uaCH,p=this.rgxMap;switch(this.itemType){case x$1:case T:var d=s[Et]||s[yt],g;if(d)for(var m in d){var v=d[m].brand||d[m],R=d[m].version;this.itemType==x$1&&!/not.a.brand/i.test(v)&&(!g||/Chrom/.test(g)&&v!=ki||g==ze&&/WebView2/.test(v))&&(v=M$1(v,ar),g=this.get(c),g&&!/Chrom/.test(g)&&/Chrom/.test(v)||this.set(c,v).set(l$1,R).set(Re,gt(R)),g=v),this.itemType==T&&v==ki&&this.set(l$1,R);}break;case B$1:var D=s[S$1];D&&(D&&s[Ve]==`64`&&(D+=`64`),ft.call(this.data,D+`;`,p));break;case N$1:if(s[u]&&this.set(r,u),s[n]&&(this.set(n,s[n]),!this.get(r)||!this.get(a$1))){var _={};ft.call(_,`droid 9; `+s[n]+`)`,p),!this.get(r)&&_.type&&this.set(r,_.type),!this.get(a$1)&&_.vendor&&this.set(a$1,_.vendor);}if(s[Y]){var X;if(typeof s[Y]!=`string`)for(var _e=0;!X&&_e<s[Y].length;)X=M$1(s[Y][_e++],Ii);else X=M$1(s[Y],Ii);this.set(r,X);}break;case I:var pe=s[oe];if(pe){var me=s[xt];pe==wt&&(me=parseInt(gt(me),10)>=13?`11`:`10`),this.set(c,pe).set(l$1,me);}this.get(c)==wt&&s[n]==`Xbox`&&this.set(c,`Xbox`).set(l$1,void 0);break;case re:var Ze=this.data,G=function(Qe){return Ze[Qe].getItem().setCH(s).parseCH().get()};this.set(x$1,G(x$1)).set(B$1,G(B$1)).set(N$1,G(N$1)).set(T,G(T)).set(I,G(I));}return this},$.call(this,[[`itemType`,t],[`ua`,e],[`uaCH`,o],[`rgxMap`,i],[`data`,cr(this,t)]]),this}function A(t,e,i){if(typeof t===se?(Fe(t,true)?(typeof e===se&&(i=e),e=t):(i=t,e=void 0),t=void 0):typeof t===bt&&!Fe(e,true)&&(i=e,e=void 0),i&&typeof i.append===Ue){var o={};i.forEach(function(m,v){o[v]=m;}),i=o;}if(!(this instanceof A))return new A(t,e,i).getResult();var s=typeof t===bt?t:i&&i[fi]?i[fi]:k&&k.userAgent?k.userAgent:ne,p=new Di(i,true),d=e?sr(_i,e):_i,g=function(m){return m==re?function(){return new Pi(m,s,d,p).set(`ua`,s).set(x$1,this.getBrowser()).set(B$1,this.getCPU()).set(N$1,this.getDevice()).set(T,this.getEngine()).set(I,this.getOS()).get()}:function(){return new Pi(m,s,d[m],p).parseUA().get()}};return $.call(this,[[`getBrowser`,g(x$1)],[`getCPU`,g(B$1)],[`getDevice`,g(N$1)],[`getEngine`,g(T)],[`getOS`,g(I)],[`getResult`,g(re)],[`getUA`,function(){return s}],[`setUA`,function(m){return ce(m)&&(s=m.length>ht?We(m,ht):m),this}]]).setUA(s),this}A.VERSION=Ji;A.BROWSER=je([c,l$1,Re,r]);A.CPU=je([S$1]);A.DEVICE=je([n,a$1,r,ke,u,y,b,L$1,Ce]);A.ENGINE=A.OS=je([c,l$1]);var qe=class{modifications=[];constructor(){le$4(`.lc-hide {display: none !important;height: 0 !important;}
|
|
167
|
+
var Me=class extends re$5{static storeName=`app`;static{this.storage=pe$4(this.storeName);}};var Ki=` daum[ /]| deusu/|(?:^|[^g])news(?!sapphire)|(?<! (?:channel/|google/))google(?!(app|/google| pixel))|(?<! cu)bots?(?:\\b|_)|(?<!(?:lib))http|(?<![hg]m)score|(?<!cam)scan|24x7|@[a-z][\\w-]+\\.|\\(\\)|\\.com\\b|\\bperl\\b|\\btime/|\\||^[\\w \\.\\-\\(?:\\):%]+(?:/v?\\d+(?:\\.\\d+)?(?:\\.\\d{1,10})*?)?(?:,|$)|^[^ ]{50,}$|^\\d+\\b|^\\W|^\\w*search\\b|^\\w+/[\\w\\(\\)]*$|^active|^ad muncher|^amaya|^avsdevicesdk/|^azure|^biglotron|^bot|^bw/|^clamav[ /]|^client/|^cobweb/|^custom|^ddg[_-]android|^discourse|^dispatch/\\d|^downcast/|^duckduckgo|^email|^facebook|^getright/|^gozilla/|^hobbit|^hotzonu|^hwcdn/|^igetter/|^jeode/|^jetty/|^jigsaw|^microsoft bits|^movabletype|^mozilla/\\d\\.\\d\\s[\\w\\.-]+$|^mozilla/\\d\\.\\d\\s\\(compatible;?(?:\\s\\w+\\/\\d+\\.\\d+)?\\)$|^navermailapp|^netsurf|^offline|^openai/|^owler|^php|^postman|^python|^rank|^read|^reed|^rest|^rss|^snapchat|^space bison|^svn|^swcd |^taringa|^thumbor/|^track|^w3c|^webbandit/|^webcopier|^wget|^whatsapp|^wordpress|^xenu link sleuth|^yahoo|^yandex|^zdm/\\d|^zoom marketplace/|agent\\b|analyzer|archive|ask jeeves/teoma|audit|bit\\.ly/|bluecoat drtr|browsex|burpcollaborator|capture|catch|check\\b|checker|chrome-lighthouse|chromeframe|classifier|cloudflare|convertify|crawl|cypress/|dareboost|datanyze|dejaclick|detect|dmbrowser|download|evc-batch/|exaleadcloudview|feed|fetcher|firephp|functionize|grab|headless|httrack|hubspot marketing grader|hydra|ibisbrowser|infrawatch|insight|inspect|iplabel|java(?!;)|library|linkcheck|mail\\.ru/|manager|measure|neustar wpm|node\\b|nutch|offbyone|onetrust|optimize|pageburst|pagespeed|parser|phantomjs|pingdom|powermarks|preview|proxy|ptst[ /]\\d|retriever|rexx;|rigor|rss\\b|scrape|server|sogou|sparkler/|speedcurve|spider|splash|statuscake|supercleaner|synapse|synthetic|tools|torrent|transcoder|url|validator|virtuoso|wappalyzer|webglance|webkit2png|whatcms/|xtate/`,Yi=/bot|crawl|http|lighthouse|scan|search|spider/i,he;function Xi(){if(he instanceof RegExp)return he;try{he=new RegExp(Ki,`i`);}catch{he=Yi;}return he}function gi(t){return !!t&&Xi().test(t)}var Ji=`2.0.4`,ht=500,fi=`user-agent`,ne=``,hi=`?`,Ue=`function`,j=`undefined`,se=`object`,bt=`string`,x$1=`browser`,B$1=`cpu`,N$1=`device`,T=`engine`,I=`os`,re=`result`,c=`name`,r=`type`,a$1=`vendor`,l$1=`version`,S$1=`architecture`,Re=`major`,n=`model`,ke=`console`,m=`mobile`,b=`tablet`,y=`smarttv`,L$1=`wearable`,Ne=`xr`,Ce=`embedded`,be=`inapp`,yt=`brands`,Y=`formFactors`,Et=`fullVersionList`,oe=`platform`,xt=`platformVersion`,Ve=`bitness`,q=`sec-ch-ua`,Zi=q+`-full-version-list`,Qi=q+`-arch`,er=q+`-`+Ve,tr=q+`-form-factors`,ir=q+`-`+m,rr=q+`-`+n,Ti=q+`-`+oe,or=Ti+`-version`,Ai=[yt,Et,m,n,oe,xt,S$1,Y,Ve],Be=`Amazon`,te=`Apple`,bi=`ASUS`,wi=`BlackBerry`,K=`Google`,vi=`Huawei`,nt=`Lenovo`,yi=`Honor`,He=`LG`,st=`Microsoft`,at=`Motorola`,ct=`Nvidia`,Ei=`OnePlus`,lt=`OPPO`,we=`Samsung`,xi=`Sharp`,ve=`Sony`,dt=`Xiaomi`,pt=`Zebra`,Si=`Chrome`,ki=`Chromium`,W=`Chromecast`,ze=`Edge`,ye=`Firefox`,Ee=`Opera`,ut=`Facebook`,Ci=`Sogou`,ie=`Mobile `,xe=` Browser`,wt=`Windows`,k=typeof window!==j&&window.navigator?window.navigator:void 0,V=k&&k.userAgentData?k.userAgentData:void 0,sr=function(t,e){var i={},o=e;if(!Fe(e)){o={};for(var s in e)for(var p in e[s])o[p]=e[s][p].concat(o[p]?o[p]:[]);}for(var d in t)i[d]=o[d]&&o[d].length%2===0?o[d].concat(t[d]):t[d];return i},je=function(t){for(var e={},i=0;i<t.length;i++)e[t[i].toUpperCase()]=t[i];return e},vt=function(t,e){if(typeof t===se&&t.length>0){for(var i in t)if(H(e)==H(t[i]))return true;return false}return ce(t)?H(e)==H(t):false},Fe=function(t,e){for(var i in t)return /^(browser|cpu|device|engine|os)$/.test(i)||(e?Fe(t[i]):false)},ce=function(t){return typeof t===bt},mt=function(t){if(t){for(var e=[],i=ae(/\\?\"/g,t).split(`,`),o=0;o<i.length;o++)if(i[o].indexOf(`;`)>-1){var s=We(i[o]).split(`;v=`);e[o]={brand:s[0],version:s[1]};}else e[o]=We(i[o]);return e}},H=function(t){return ce(t)?t.toLowerCase():t},gt=function(t){return ce(t)?ae(/[^\d\.]/g,t).split(`.`)[0]:void 0},$=function(t){for(var e in t){var i=t[e];typeof i==se&&i.length==2?this[i[0]]=i[1]:this[i]=void 0;}return this},ae=function(t,e){return ce(e)?e.replace(t,ne):e},Se=function(t){return ae(/\\?\"/g,t)},We=function(t,e){if(ce(t))return t=ae(/^\s\s*/,t),typeof e===j?t:t.substring(0,ht)},ft=function(t,e){if(!(!t||!e))for(var i=0,o,s,p,d,g,u;i<e.length&&!g;){var v=e[i],R=e[i+1];for(o=s=0;o<v.length&&!g&&v[o];)if(g=v[o++].exec(t),g)for(p=0;p<R.length;p++)u=g[++s],d=R[p],typeof d===se&&d.length>0?d.length===2?typeof d[1]==Ue?this[d[0]]=d[1].call(this,u):this[d[0]]=d[1]:d.length>=3&&(typeof d[1]===Ue&&!(d[1].exec&&d[1].test)?d.length>3?this[d[0]]=u?d[1].apply(this,d.slice(2)):void 0:this[d[0]]=u?d[1].call(this,u,d[2]):void 0:d.length==3?this[d[0]]=u?u.replace(d[1],d[2]):void 0:d.length==4?this[d[0]]=u?d[3].call(this,u.replace(d[1],d[2])):void 0:d.length>4&&(this[d[0]]=u?d[3].apply(this,[u.replace(d[1],d[2])].concat(d.slice(4))):void 0)):this[d]=u||void 0;i+=2;}},M$1=function(t,e){for(var i in e)if(typeof e[i]===se&&e[i].length>0){for(var o=0;o<e[i].length;o++)if(vt(e[i][o],t))return i===hi?void 0:i}else if(vt(e[i],t))return i===hi?void 0:i;return e.hasOwnProperty(`*`)?e[`*`]:t},Ri={ME:`4.90`,"NT 3.51":`3.51`,"NT 4.0":`4.0`,2e3:[`5.0`,`5.01`],XP:[`5.1`,`5.2`],Vista:`6.0`,7:`6.1`,8:`6.2`,"8.1":`6.3`,10:[`6.4`,`10.0`],NT:``},Ii={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},ar={Chrome:`Google Chrome`,Edge:`Microsoft Edge`,"Edge WebView2":`Microsoft Edge WebView2`,"Chrome WebView":`Android WebView`,"Chrome Headless":`HeadlessChrome`,"Huawei Browser":`HuaweiBrowser`,"MIUI Browser":`Miui Browser`,"Opera Mobi":`OperaMobile`,Yandex:`YaBrowser`},_i={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[l$1,[c,ie+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[l$1,[c,ze+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[l$1,[c,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[c,l$1],[/opios[\/ ]+([\w\.]+)/i],[l$1,[c,Ee+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[l$1,[c,Ee+` GX`]],[/\bopr\/([\w\.]+)/i],[l$1,[c,Ee]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[l$1,[c,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[l$1,[c,`Maxthon`]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser)\/([-\w\.]+)/i,/(heytap|ovi|115|surf)browser\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[c,l$1],[/quark(?:pc)?\/([-\w\.]+)/i],[l$1,[c,`Quark`]],[/\bddg\/([\w\.]+)/i],[l$1,[c,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[l$1,[c,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[l$1,[c,`WeChat`]],[/konqueror\/([\w\.]+)/i],[l$1,[c,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[l$1,[c,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[l$1,[c,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[l$1,[c,`Smart `+nt+xe]],[/(avast|avg)\/([\w\.]+)/i],[[c,/(.+)/,`$1 Secure`+xe],l$1],[/\bfocus\/([\w\.]+)/i],[l$1,[c,ye+` Focus`]],[/\bopt\/([\w\.]+)/i],[l$1,[c,Ee+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[l$1,[c,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[l$1,[c,`Dolphin`]],[/coast\/([\w\.]+)/i],[l$1,[c,Ee+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[l$1,[c,`MIUI`+xe]],[/fxios\/([\w\.-]+)/i],[l$1,[c,ie+ye]],[/\bqihoobrowser\/?([\w\.]*)/i],[l$1,[c,`360`]],[/\b(qq)\/([\w\.]+)/i],[[c,/(.+)/,`$1Browser`],l$1],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[c,/(.+)/,`$1`+xe],l$1],[/samsungbrowser\/([\w\.]+)/i],[l$1,[c,we+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[l$1,[c,Ci+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[c,Ci+` Mobile`],l$1],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[c,l$1],[/(lbbrowser|rekonq)/i],[c],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[l$1,c],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[c,ut],l$1,[r,be]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[c,l$1,[r,be]],[/\bgsa\/([\w\.]+) .*safari\//i],[l$1,[c,`GSA`],[r,be]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[l$1,[c,`TikTok`],[r,be]],[/\[(linkedin)app\]/i],[c,[r,be]],[/(chromium)[\/ ]([-\w\.]+)/i],[c,l$1],[/headlesschrome(?:\/([\w\.]+)| )/i],[l$1,[c,Si+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[l$1,[c,ze+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[c,Si+` WebView`],l$1],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[l$1,[c,`Android`+xe]],[/chrome\/([\w\.]+) mobile/i],[l$1,[c,ie+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[c,l$1],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[l$1,[c,ie+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[c,ie+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[l$1,c],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[c,[l$1,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[c,l$1],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[c,ie+ye],l$1],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[c,`Netscape`],l$1],[/(wolvic|librewolf)\/([\w\.]+)/i],[c,l$1],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[l$1,[c,ye+` Reality`]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[c,[l$1,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[c,[l$1,/[^\d\.]+./,ne]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[S$1,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[S$1,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[S$1,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[S$1,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[S$1,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[S$1,/ower/,ne,H]],[/ sun4\w[;\)]/i],[[S$1,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[S$1,H]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[n,[a$1,we],[r,b]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[n,[a$1,we],[r,m]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[n,[a$1,te],[r,m]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[n,[a$1,te],[r,b]],[/(macintosh);/i],[n,[a$1,te]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[n,[a$1,xi],[r,m]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[n,[a$1,yi],[r,b]],[/honor([-\w ]+)[;\)]/i],[n,[a$1,yi],[r,m]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[n,[a$1,vi],[r,b]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[n,[a$1,vi],[r,m]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[n,/_/g,` `],[a$1,dt],[r,b]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[n,/_/g,` `],[a$1,dt],[r,m]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[n,[a$1,Ei],[r,m]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[n,[a$1,lt],[r,m]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[n,[a$1,M$1,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":lt}],[r,b]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[n,[a$1,`BLU`],[r,m]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[n,[a$1,`Vivo`],[r,m]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[n,[a$1,`Realme`],[r,m]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[n,[a$1,nt],[r,b]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[n,[a$1,nt],[r,m]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[n,[a$1,at],[r,m]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[n,[a$1,at],[r,b]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[n,[a$1,He],[r,b]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[n,[a$1,He],[r,m]],[/(nokia) (t[12][01])/i],[a$1,n,[r,b]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[n,/_/g,` `],[r,m],[a$1,`Nokia`]],[/(pixel (c|tablet))\b/i],[n,[a$1,K],[r,b]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[n,[a$1,K],[r,m]],[/(google) (pixelbook( go)?)/i],[a$1,n],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[n,[a$1,ve],[r,m]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[n,`Xperia Tablet`],[a$1,ve],[r,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[n,[a$1,Be],[r,b]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[n,/(.+)/g,`Fire Phone $1`],[a$1,Be],[r,m]],[/(playbook);[-\w\),; ]+(rim)/i],[n,a$1,[r,b]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[n,[a$1,wi],[r,m]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[n,[a$1,bi],[r,b]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[n,[a$1,bi],[r,m]],[/(nexus 9)/i],[n,[a$1,`HTC`],[r,b]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[a$1,[n,/_/g,` `],[r,m]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[n,[a$1,`TCL`],[r,b]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[n,[a$1,`TCL`],[r,m]],[/(itel) ((\w+))/i],[[a$1,H],n,[r,M$1,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[n,[a$1,`Acer`],[r,b]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[n,[a$1,`Meizu`],[r,m]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[n,[a$1,`Ulefone`],[r,m]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[n,[a$1,`Energizer`],[r,m]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[n,[a$1,`Cat`],[r,m]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[n,[a$1,`Smartfren`],[r,m]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[n,[a$1,`Nothing`],[r,m]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[n,[a$1,`Archos`],[r,b]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[n,[a$1,`Archos`],[r,m]],[/; (n159v)/i],[n,[a$1,`HMD`],[r,m]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[a$1,n,[r,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i],[a$1,n,[r,m]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[a$1,n,[r,b]],[/(surface duo)/i],[n,[a$1,st],[r,b]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[n,[a$1,`Fairphone`],[r,m]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[n,[a$1,ct],[r,b]],[/(sprint) (\w+)/i],[a$1,n,[r,m]],[/(kin\.[onetw]{3})/i],[[n,/\./g,` `],[a$1,st],[r,m]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[n,[a$1,pt],[r,b]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[n,[a$1,pt],[r,m]],[/smart-tv.+(samsung)/i],[a$1,[r,y]],[/hbbtv.+maple;(\d+)/i],[[n,/^/,`SmartTV`],[a$1,we],[r,y]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[a$1,n,[r,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[a$1,He],[r,y]],[/(apple) ?tv/i],[a$1,[n,te+` TV`],[r,y]],[/crkey.*devicetype\/chromecast/i],[[n,W+` Third Generation`],[a$1,K],[r,y]],[/crkey.*devicetype\/([^/]*)/i],[[n,/^/,`Chromecast `],[a$1,K],[r,y]],[/fuchsia.*crkey/i],[[n,W+` Nest Hub`],[a$1,K],[r,y]],[/crkey/i],[[n,W],[a$1,K],[r,y]],[/(portaltv)/i],[n,[a$1,ut],[r,y]],[/droid.+aft(\w+)( bui|\))/i],[n,[a$1,Be],[r,y]],[/(shield \w+ tv)/i],[n,[a$1,ct],[r,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[n,[a$1,xi],[r,y]],[/(bravia[\w ]+)( bui|\))/i],[n,[a$1,ve],[r,y]],[/(mi(tv|box)-?\w+) bui/i],[n,[a$1,dt],[r,y]],[/Hbbtv.*(technisat) (.*);/i],[a$1,n,[r,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[a$1,/.+\/(\w+)/,`$1`,M$1,{LG:`lge`}],[n,We],[r,y]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[n,[r,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[r,y]],[/(playstation \w+)/i],[n,[a$1,ve],[r,ke]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[n,[a$1,st],[r,ke]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[a$1,n,[r,ke]],[/droid.+; (shield)( bui|\))/i],[n,[a$1,ct],[r,ke]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[n,[a$1,we],[r,L$1]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[a$1,n,[r,L$1]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[n,[a$1,lt],[r,L$1]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[n,[a$1,te],[r,L$1]],[/(opwwe\d{3})/i],[n,[a$1,Ei],[r,L$1]],[/(moto 360)/i],[n,[a$1,at],[r,L$1]],[/(smartwatch 3)/i],[n,[a$1,ve],[r,L$1]],[/(g watch r)/i],[n,[a$1,He],[r,L$1]],[/droid.+; (wt63?0{2,3})\)/i],[n,[a$1,pt],[r,L$1]],[/droid.+; (glass) \d/i],[n,[a$1,K],[r,Ne]],[/(pico) (4|neo3(?: link|pro)?)/i],[a$1,n,[r,Ne]],[/(quest( \d| pro)?s?).+vr/i],[n,[a$1,ut],[r,Ne]],[/mobile vr; rv.+firefox/i],[[r,Ne]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[a$1,[r,Ce]],[/(aeobc)\b/i],[n,[a$1,Be],[r,Ce]],[/(homepod).+mac os/i],[n,[a$1,te],[r,Ce]],[/windows iot/i],[[r,Ce]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[n,[r,M$1,{mobile:`Mobile`,xr:`VR`,"*":b}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[r,b]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[r,m]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[n,[a$1,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[l$1,[c,ze+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[c,l$1],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[l$1,[c,`Blink`]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[c,l$1],[/ladybird\//i],[[c,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[l$1,c]],os:[[/(windows nt) (6\.[23]); arm/i],[[c,/N/,`R`],[l$1,M$1,Ri]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[c,l$1],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[l$1,/(;|\))/g,``,M$1,Ri],[c,wt]],[/(windows ce)\/?([\d\.]*)/i],[c,l$1],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[l$1,/_/g,`.`],[c,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[c,`macOS`],[l$1,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[l$1,[c,W+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[l$1,[c,W+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[l$1,[c,W+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[l$1,[c,W+` Linux`]],[/crkey\/([\d\.]+)/i],[l$1,[c,W]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[l$1,c],[/(ubuntu) ([\w\.]+) like android/i],[[c,/(.+)/,`$1 Touch`],l$1],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[c,l$1],[/\(bb(10);/i],[l$1,[c,wi]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[l$1,[c,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[l$1,[c,ye+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[l$1,[c,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[l$1,M$1,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[c,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[l$1,[c,`watchOS`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[c,`Chrome OS`],l$1],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[c,l$1],[/(sunos) ?([\d\.]*)/i],[[c,`Solaris`],l$1],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[c,l$1]]},$e=(function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return $.call(t.init,[[x$1,[c,l$1,Re,r]],[B$1,[S$1]],[N$1,[r,n,a$1]],[T,[c,l$1]],[I,[c,l$1]]]),$.call(t.isIgnore,[[x$1,[l$1,Re]],[T,[l$1]],[I,[l$1]]]),$.call(t.isIgnoreRgx,[[x$1,/ ?browser$/i],[I,/ ?os$/i]]),$.call(t.toString,[[x$1,[c,l$1]],[B$1,[S$1]],[N$1,[a$1,n]],[T,[c,l$1]],[I,[c,l$1]]]),t})(),cr=function(t,e){var i=$e.init[e],o=$e.isIgnore[e]||0,s=$e.isIgnoreRgx[e]||0,p=$e.toString[e]||0;function d(){$.call(this,i);}return d.prototype.getItem=function(){return t},d.prototype.withClientHints=function(){return V?V.getHighEntropyValues(Ai).then(function(g){return t.setCH(new Di(g,false)).parseCH().get()}):t.parseCH().get()},d.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=re&&(d.prototype.is=function(g){var u=false;for(var v in this)if(this.hasOwnProperty(v)&&!vt(o,v)&&H(s?ae(s,this[v]):this[v])==H(s?ae(s,g):g)){if(u=true,g!=j)break}else if(g==j&&u){u=!u;break}return u},d.prototype.toString=function(){var g=ne;for(var u in p)typeof this[p[u]]!==j&&(g+=(g?` `:ne)+this[p[u]]);return g||j}),V||(d.prototype.then=function(g){var u=this,v=function(){for(var D in u)u.hasOwnProperty(D)&&(this[D]=u[D]);};v.prototype={is:d.prototype.is,toString:d.prototype.toString};var R=new v;return g(R),R}),new d};function Di(t,e){if(t=t||{},$.call(this,Ai),e)$.call(this,[[yt,mt(t[q])],[Et,mt(t[Zi])],[m,/\?1/.test(t[ir])],[n,Se(t[rr])],[oe,Se(t[Ti])],[xt,Se(t[or])],[S$1,Se(t[Qi])],[Y,mt(t[tr])],[Ve,Se(t[er])]]);else for(var i in t)this.hasOwnProperty(i)&&typeof t[i]!==j&&(this[i]=t[i]);}function Pi(t,e,i,o){return this.get=function(s){return s?this.data.hasOwnProperty(s)?this.data[s]:void 0:this.data},this.set=function(s,p){return this.data[s]=p,this},this.setCH=function(s){return this.uaCH=s,this},this.detectFeature=function(){if(k&&k.userAgent==this.ua)switch(this.itemType){case x$1:k.brave&&typeof k.brave.isBrave==Ue&&this.set(c,`Brave`);break;case N$1:!this.get(r)&&V&&V[m]&&this.set(r,m),this.get(n)==`Macintosh`&&k&&typeof k.standalone!==j&&k.maxTouchPoints&&k.maxTouchPoints>2&&this.set(n,`iPad`).set(r,b);break;case I:!this.get(c)&&V&&V[oe]&&this.set(c,V[oe]);break;case re:var s=this.data,p=function(d){return s[d].getItem().detectFeature().get()};this.set(x$1,p(x$1)).set(B$1,p(B$1)).set(N$1,p(N$1)).set(T,p(T)).set(I,p(I));}return this},this.parseUA=function(){return this.itemType!=re&&ft.call(this.data,this.ua,this.rgxMap),this.itemType==x$1&&this.set(Re,gt(this.get(l$1))),this},this.parseCH=function(){var s=this.uaCH,p=this.rgxMap;switch(this.itemType){case x$1:case T:var d=s[Et]||s[yt],g;if(d)for(var u in d){var v=d[u].brand||d[u],R=d[u].version;this.itemType==x$1&&!/not.a.brand/i.test(v)&&(!g||/Chrom/.test(g)&&v!=ki||g==ze&&/WebView2/.test(v))&&(v=M$1(v,ar),g=this.get(c),g&&!/Chrom/.test(g)&&/Chrom/.test(v)||this.set(c,v).set(l$1,R).set(Re,gt(R)),g=v),this.itemType==T&&v==ki&&this.set(l$1,R);}break;case B$1:var D=s[S$1];D&&(D&&s[Ve]==`64`&&(D+=`64`),ft.call(this.data,D+`;`,p));break;case N$1:if(s[m]&&this.set(r,m),s[n]&&(this.set(n,s[n]),!this.get(r)||!this.get(a$1))){var _={};ft.call(_,`droid 9; `+s[n]+`)`,p),!this.get(r)&&_.type&&this.set(r,_.type),!this.get(a$1)&&_.vendor&&this.set(a$1,_.vendor);}if(s[Y]){var X;if(typeof s[Y]!=`string`)for(var _e=0;!X&&_e<s[Y].length;)X=M$1(s[Y][_e++],Ii);else X=M$1(s[Y],Ii);this.set(r,X);}break;case I:var pe=s[oe];if(pe){var ue=s[xt];pe==wt&&(ue=parseInt(gt(ue),10)>=13?`11`:`10`),this.set(c,pe).set(l$1,ue);}this.get(c)==wt&&s[n]==`Xbox`&&this.set(c,`Xbox`).set(l$1,void 0);break;case re:var Ze=this.data,G=function(Qe){return Ze[Qe].getItem().setCH(s).parseCH().get()};this.set(x$1,G(x$1)).set(B$1,G(B$1)).set(N$1,G(N$1)).set(T,G(T)).set(I,G(I));}return this},$.call(this,[[`itemType`,t],[`ua`,e],[`uaCH`,o],[`rgxMap`,i],[`data`,cr(this,t)]]),this}function A(t,e,i){if(typeof t===se?(Fe(t,true)?(typeof e===se&&(i=e),e=t):(i=t,e=void 0),t=void 0):typeof t===bt&&!Fe(e,true)&&(i=e,e=void 0),i&&typeof i.append===Ue){var o={};i.forEach(function(u,v){o[v]=u;}),i=o;}if(!(this instanceof A))return new A(t,e,i).getResult();var s=typeof t===bt?t:i&&i[fi]?i[fi]:k&&k.userAgent?k.userAgent:ne,p=new Di(i,true),d=e?sr(_i,e):_i,g=function(u){return u==re?function(){return new Pi(u,s,d,p).set(`ua`,s).set(x$1,this.getBrowser()).set(B$1,this.getCPU()).set(N$1,this.getDevice()).set(T,this.getEngine()).set(I,this.getOS()).get()}:function(){return new Pi(u,s,d[u],p).parseUA().get()}};return $.call(this,[[`getBrowser`,g(x$1)],[`getCPU`,g(B$1)],[`getDevice`,g(N$1)],[`getEngine`,g(T)],[`getOS`,g(I)],[`getResult`,g(re)],[`getUA`,function(){return s}],[`setUA`,function(u){return ce(u)&&(s=u.length>ht?We(u,ht):u),this}]]).setUA(s),this}A.VERSION=Ji;A.BROWSER=je([c,l$1,Re,r]);A.CPU=je([S$1]);A.DEVICE=je([n,a$1,r,ke,m,y,b,L$1,Ce]);A.ENGINE=A.OS=je([c,l$1]);var qe=class{modifications=[];constructor(){le$4(`.lc-hide {display: none !important;height: 0 !important;}
|
|
167
168
|
.lc-display-block {display: block !important;}
|
|
168
|
-
.lc-display-inline {display: inline !important;}`,document.body);}execute(e){for(let i of e){if(!i.experimentConfig)continue;this.executeExperiment(i)&&this.trackExperimentRan(i);}if(document.querySelector(`#lc-hide-body`)?.remove(),!document.body){_n
|
|
169
|
+
.lc-display-inline {display: inline !important;}`,document.body);}execute(e){for(let i of e){if(!i.experimentConfig)continue;this.executeExperiment(i)&&this.trackExperimentRan(i);}if(document.querySelector(`#lc-hide-body`)?.remove(),!document.body){_n(`No body element found`,`error`);return}this.setupMutationObserver();}executeExperiment(e){let i=e.experimentConfig?.modifications;if(!i?.length)return U$3.log(`Nothing to experiment`,e.toString()),true;let o=false;for(let s of i){if(!s.cssSelector){U$3.verbose(`No CSS Selector available`,e?.toString());continue}this.modifications.push(s);let p=Array.from(document.querySelectorAll(s.cssSelector));p?.length&&(this.executeSingleModification(s,p),o=true);}return o}executeSingleModification(e,i){if(i?.length)for(let o of i){for(let[s,p]of Object.entries(e.style))o.style.setProperty(s.replace(/([A-Z])/g,`-$1`).toLowerCase(),p,`important`);if(e.display===`HIDE`?o.classList.add(`lc-hide`):e.display===`BLOCK`?o.classList.add(`lc-display-block`):e.display===`INLINE`&&o.classList.add(`lc-display-inline`),e.type===`TEXT`&&e.text?o.innerHTML=e.text:e.type===`IMAGE`&&this.updateImage(e,o),e.moveTo?.selector&&this.changePlacement(e,o).catch(console.error),e.customClasses){let s=e.customClasses.split(/[,\s\n]+/).map(d=>d.trim()).filter(Boolean);s.filter(d=>d.startsWith(`-`)).forEach(d=>o.classList.remove(d.slice(1)));let p=s.filter(d=>!d.startsWith(`-`)&&!o.classList.contains(d));p.length&&(o.className=[o.className,...p].filter(Boolean).join(` `));}}}async changePlacement(e,i){let o=await zn$1(e.moveTo.selector);if(o)switch(e.moveTo.position){case fe$2.BEFORE1:i.nextElementSibling!==o&&o.parentElement?.insertBefore(i,o);break;case fe$2.INSIDE_FIRST1:o.firstChild!==i&&o.insertBefore(i,o.firstChild);break;case fe$2.INSIDE_LAST1:o.lastChild!==i&&o.appendChild(i);break;case fe$2.AFTER1:default:i.previousElementSibling!==o&&o.parentElement?.insertBefore(i,o.nextSibling);}}trackExperimentRan(e){if(e.id===`preview`){U$3.warn(`Skipping experiment attribution as its preview`,e.toString());return}Oi({name:`CE Experiment Start`,experiment:new mt$2(e)}).catch(i=>{U$3.error(`Fail to track experiment`,i);});}setupMutationObserver(){new MutationObserver(i=>{i.forEach(o=>{o.addedNodes.forEach(s=>{s instanceof HTMLElement&&this.modifications.forEach(p=>{if(s.matches&&s.matches(p.cssSelector))U$3.verbose(`1. Re-applying experiment`,p.toString()),this.executeSingleModification(p,[s]);else if(s.querySelectorAll){let d=Array.from(s.querySelectorAll(p.cssSelector));if(!d.length)return;U$3.verbose(`2. Re-applying experiment`,p.toString()),this.executeSingleModification(p,d);}});});});}).observe(document.body,{childList:true,subtree:true});}updateImage(e,i){let o=e.image?.lg?.src,s=e.image?.sm?.src;!o&&!s||(i instanceof HTMLPictureElement?this.updatePictureElement({desktop:o,mobile:s},i):this.updateImageElement({desktop:o,mobile:s},i));}updateImageElement(e,i){M$3()&&e.mobile?(i.setAttribute(`src`,e.mobile),i.removeAttribute(`srcset`)):e.desktop&&(i.setAttribute(`src`,e.desktop),i.removeAttribute(`srcset`));}updatePictureElement(e,i){if(i.innerHTML=``,e.mobile){let s=document.createElement(`source`);s.srcset=e.mobile,s.media=`(max-width: 767px)`,i.append(s);}if(e.desktop){let s=document.createElement(`source`);s.srcset=e.desktop,s.media=`(min-width: 768px)`,i.append(s);}let o=document.createElement(`img`);o.src=e.desktop??e.mobile??``,i.append(o);}};async function Oi(t){let e=await ot();await re$1(`/v1/event/experiment`,r$2(r$2({},t),e));}function Ge(){lr().catch(t=>{U$3.error(`Error fetching experiments`,t);});}async function lr(){We$4().activeExperiments&&(await le$2(K$1),await dr());}async function dr(){U$3.info(`Fetch experiments after ⏰`,Nn$3()+` of SDK load`);let e=r$2({},await ot());try{let i=await re$1(`/v1/engagement/experiments`,e);U$3.info(`Experiments fetched ${Rn$1(i.timeTakenMs)}`);let o=i.data.experiments.map(s=>new q$1(s));new qe().execute(o);}catch(i){throw U$3.error(`Error sending experiment getter`,i),i}}function U(t){let e=t.replace(`#`,``),i,o,s;return e.length===3?(i=parseInt(e[0]+e[0],16),o=parseInt(e[1]+e[1],16),s=parseInt(e[2]+e[2],16)):(i=parseInt(e.slice(0,2),16),o=parseInt(e.slice(2,4),16),s=parseInt(e.slice(4,6),16)),`${i} ${o} ${s}`}var pr={sharp:`0px`,subtle:`4px`,rounded:`8px`,pill:`9999px`},ur={sharp:`0px`,subtle:`4px`,rounded:`8px`,pill:`12px`},Li={compact:{xs:`3px`,sm:`6px`,md:`9px`,lg:`12px`,xl:`18px`},comfortable:{xs:`4px`,sm:`8px`,md:`12px`,lg:`16px`,xl:`24px`},spacious:{xs:`6px`,sm:`12px`,md:`18px`,lg:`24px`,xl:`36px`}},Ke=class{colors;body;heading;subheading;density;buttons;card;price;cssVarOverrides;enabled;constructor(e){e&&Object.assign(this,e);}toCSSString(){let e=[],i=U(this.colors.primary),o=U(this.colors.onPrimary),s=U(this.colors.surface),p=U(this.colors.textPrimary),d=U(this.colors.textSecondary),g=U(this.colors.sale??`#dc2626`);e.push(`--lc-primary-color: ${i}`),e.push(`--lc-card-bg-color: ${s}`);let u=this.card?.transparency!=null?(100-this.card.transparency)/100:1;e.push(`--lc-card-bg-opacity: ${u}`),e.push(`--lc-text-color: ${p}`),e.push(`--lc-subheading-color: ${p}`),e.push(`--lc-item-cmp-price-color: ${d}`),e.push(`--lc-item-sale-price-color: ${g}`);let v=this.price.showSaleColor?g:p;if(e.push(`--lc-item-price-color: ${v}`),this.price.showComparePrice||e.push(`--lc-item-cmp-price-display: none`),this.price.weight&&e.push(`--lc-item-price-weight: ${this.price.weight}`),e.push(`--lc-text-family: ${this.body.family}`),e.push(`--lc-text-size: ${this.body.size}px`),this.body.weight&&(e.push(`--lc-text-weight: ${this.body.weight}`),e.push(`--lc-item-text-weight: ${this.body.weight}`)),this.heading){let h=this.heading,me=h.color?U(h.color):p;e.push(`--lc-heading-color: ${me}`),h.family&&e.push(`--lc-heading-family: ${h.family}`),h.size&&e.push(`--lc-heading-size: ${h.size}px`),h.weight&&e.push(`--lc-heading-weight: ${h.weight}`),h.align&&e.push(`--lc-heading-align: ${h.align}`),h.transform&&e.push(`--lc-heading-transform: ${h.transform}`),h.letterSpacing&&e.push(`--lc-heading-letter-spacing: ${h.letterSpacing}`);}else e.push(`--lc-heading-color: ${p}`);if(this.subheading){let h=this.subheading,me=h.color?U(h.color):p;e.push(`--lc-subheading-color: ${me}`),h.family&&e.push(`--lc-subheading-family: ${h.family}`),h.size&&e.push(`--lc-subheading-size: ${h.size}px`),h.weight&&e.push(`--lc-subheading-weight: ${h.weight}`),h.align&&e.push(`--lc-subheading-align: ${h.align}`),h.transform&&e.push(`--lc-subheading-transform: ${h.transform}`),h.letterSpacing&&e.push(`--lc-subheading-letter-spacing: ${h.letterSpacing}`);}let R=pr[this.buttons?.shape??`rounded`]??`8px`,D=ur[this.card?.shape??`rounded`]??`8px`;e.push(`--lc-button-radius: ${R}`),e.push(`--lc-card-radius: ${D}`),e.push(`--lc-badge-radius: ${R}`);let _=Li[this.density]??Li.comfortable;e.push(`--lc-spacing-xs: ${_.xs}`),e.push(`--lc-spacing-sm: ${_.sm}`),e.push(`--lc-spacing-md: ${_.md}`),e.push(`--lc-spacing-lg: ${_.lg}`),e.push(`--lc-spacing-xl: ${_.xl}`);let X=this.buttons.family??this.body.family;e.push(`--lc-button-family: ${X}`),e.push(`--lc-primary-button-weight: ${this.buttons.weight}`),e.push(`--lc-secondary-button-weight: ${this.buttons.weight}`),e.push(`--lc-primary-button-transform: ${this.buttons.textTransform}`),e.push(`--lc-secondary-button-transform: ${this.buttons.textTransform}`),this.buttons.size&&e.push(`--lc-button-size: ${this.buttons.size}px`),this.buttons.letterSpacing&&e.push(`--lc-button-letter-spacing: ${this.buttons.letterSpacing}`);let{bg:_e,color:pe,border:ue}=this.resolvePrimaryButtonColors(i,o);e.push(`--lc-primary-button-bg-color: ${_e}`),e.push(`--lc-primary-button-color: ${pe}`),e.push(`--lc-primary-button-border-color: ${ue}`);let Ze=this.buttons.secondaryBg?U(this.buttons.secondaryBg):s,{bg:G,color:Qe,border:Gi}=this.resolveSecondaryButtonColors(i,s,p,Ze);switch(e.push(`--lc-secondary-button-bg-color: ${G}`),e.push(`--lc-secondary-button-color: ${Qe}`),e.push(`--lc-secondary-button-border-color: ${Gi}`),this.card.border){case `subtle`:e.push(`--lc-card-border-width: 1px`),e.push(`--lc-card-border-color: 0 0 0 / 0.06`);break;case `visible`:e.push(`--lc-card-border-width: 1px`),e.push(`--lc-card-border-color: 0 0 0 / 0.15`);break;default:e.push(`--lc-card-border-width: 0px`),e.push(`--lc-card-border-color: transparent`);}switch(this.card.shadow){case `subtle`:e.push(`--lc-card-shadow: 0 1px 3px rgba(0,0,0,0.08)`);break;case `medium`:e.push(`--lc-card-shadow: 0 2px 8px rgba(0,0,0,0.12)`);break;default:e.push(`--lc-card-shadow: none`);}if(e.push(`--lc-badge-bg: ${i}`),e.push(`--lc-badge-color: ${o}`),this.cssVarOverrides)for(let[h,me]of Object.entries(this.cssVarOverrides))e.push(`${h}: ${me}`);let Pe=[];this.heading?.mobileSize&&Pe.push(`--lc-heading-size: ${this.heading.mobileSize}px`),this.subheading?.mobileSize&&Pe.push(`--lc-subheading-size: ${this.subheading.mobileSize}px`);let _t=`:root {
|
|
169
170
|
${e.map(h=>` ${h};`).join(`
|
|
170
171
|
`)}
|
|
171
172
|
}`;return Pe.length&&(_t+=`
|
|
@@ -174,16 +175,16 @@ ${e.map(h=>` ${h};`).join(`
|
|
|
174
175
|
${Pe.map(h=>` ${h};`).join(`
|
|
175
176
|
`)}
|
|
176
177
|
}
|
|
177
|
-
}`),_t}resolvePrimaryButtonColors(e,i){switch(this.buttons.primary.style){case `outline`:return {bg:`0 0 0 / 0`,color:e,border:e};case `ghost`:return {bg:`0 0 0 / 0`,color:e,border:`0 0 0 / 0`};default:return {bg:e,color:i,border:e}}}resolveSecondaryButtonColors(e,i,o,s){switch(this.buttons.secondaryColorScheme){case `accent`:return this.buttons.secondary.style===`filled`?{bg:s,color:e,border:s}:{bg:`0 0 0 / 0`,color:e,border:e};case `inverted`:return {bg:o,color:i,border:`0 0 0 / 0`};default:return this.buttons.secondary.style===`filled`?{bg:s,color:o,border:s}:{bg:`0 0 0 / 0`,color:o,border:o}}}};var Ye=class{apply(e){if(!e)return;le$4(new Ke(e).toCSSString());}};function Mi(){let t=le$5.get();!t.gaMeasurementID||!t.gaEnabled||fr();}async function gr(){let t=await ce$5.get(`gacid`),e=await hr();if(t!==e)return await ce$5.set(`gacid`,e),e}async function fr(){let t=await gr();t&&Hm({gaClientID:t});}async function hr(){let e=le$5.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(i=>{window.gtag(`get`,e,`client_id`,o=>{i(o);});})}var Ni=!!new URL(location.href).searchParams?.get(`new-brand`);async function Bi(t){(t?.enabled||Ni)&&new Ye().apply(t);}function br(t){if(!t)return t;let e=t.match(/:root\s*\{/);if(!e)return t;let i=0,o=-1;for(let s=e.index;s<t.length;s++)if(t[s]===`{`)i++;else if(t[s]===`}`&&--i===0){o=s+1;break}return o===-1?t:(t.slice(0,e.index)+t.slice(o)).trimStart()}async function St(t){U$3.verbose(`Received store settings`,t),t.currencyCount=t.currencies?.length;let e=w.globalRef.config.update(t);Mi(),P.initialize(),e.website&&(Ni&&(e.website.commonCSS=br(e.website.commonCSS)),Ui$2(e.website.commonJS),le$4(e.website.commonCSS),kt(e.website.widgetPartials??[])),window.CooeeSDK.cartDrawerToggle$.pipe(Fe$2(10)).subscribe(async({open:i})=>{U$3.info(`Cart drawer is now`,i?`open`:`closed`),i&&(dh(),await wr());});}function Hi(t){w.globalRef.apiURLs=t;}function kt(t){t?.length&&t.forEach(e=>{ze$1(e.name,e.template);});}async function wr(){let t=await h.getCurrent().getNormalisedCart(),e={value:t.amount,currency:t.currency};Vn(new Ir$3(`View Cart`,{items:t.items,amount:e,drawer:true}));}var Ie=class{runtimeData=We$4();meddle(){let e=w.globalRef;e.profile=e.profile??[],e.events=e.events??[],e.page=e.page??[],this.meddlePage(),this.meddleEvents(),this.meddleProfile(),this.exposeMethods();}exposeMethods(){let e=w.globalRef;e.loadWidgets=e.loadCartWidgets=e.loadPageWidgets=()=>{fo();},e.loadExperiments=()=>{Ge();},e.testCartUpdate=this.testCartUpdate.bind(this),e.previewWidget=w.previewWidget.bind(w),e.previewPopup=w.previewPopup.bind(w),e.executeCTA=(i,o)=>{new Ge$1(i).execute(o);},e.sendEvent=i=>{Vn(i);};}overwritePush(e,i){qn$1(e,`push`,i);}meddleEvents(){this.overwritePush(w.globalRef.events,(...e)=>{this.processEvent(e[0]);}),w.globalRef.events.forEach(this.processEvent.bind(this));}meddleProfile(){this.overwritePush(w.globalRef.profile,(...e)=>{this.processProfile(e[0]);}),w.globalRef.profile.forEach(this.processProfile.bind(this));}processEvent(e){e&&(tn.includes(e[0])?w.sendEvent(e[0],e[1],r$2({occurred:this.runtimeData.jsLoadTime},e[2])):w.sendEvent(e[0],e[1],e[2]));}processProfile(e){e&&w.updateProfile(e);}meddlePage(){this.overwritePush(w.globalRef.page,(...e)=>{this.processPage(e[0]);}),w.globalRef.page.forEach(this.processPage.bind(this));}processPage(e){e.currentItem&&vr(e.currentItem),e.currency&&(We$4().currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.pageName&&w.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiments=e.activeExperiment),e.cart&&h.getCurrent().update(e.cart),e.configurations&&St(e.configurations),e.storeSettings&&St(e.storeSettings),e.storeBrand&&Bi(e.storeBrand),e.apiURLs&&Hi(e.apiURLs),e.widgetPartials&&kt(e.widgetPartials),e.template&&(this.runtimeData.template=e.template),e._error&&ke$1(e._error,e.slug,e.context),e.customContext&&(this.runtimeData.customContext=r$2(r$2({},this.runtimeData.customContext),e.customContext));}async testCartUpdate(){if(We$4().pageName!==`product`){window.alert(`This feature is only available on a product page`);return}let e=gp();if(e||(e=We$4().currentItem?.vID),!e){window.alert(`Could not find a variant to test. Please try a different product page`);return}let i=new q$1({id:`preview`,shortID:`1`,redirectBehaviour:ae$4.CART_DRAWER});await new Ge$1(new Fe$1(new Date,i)).execute({clickAction:{at:he$3.ADD_TO_CART},embeddedItem:new pt$2({vID:e})});}};function vr(t){let e=We$4();if(e.currentItem&&e.currentItem.vID!==t.vID){let i=new CustomEvent(`letscooee:variant-change`,{detail:{variantID:t.vID,productID:t.mID}});document.dispatchEvent(i);}e.currentItem=new pt$2(t);}var le=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=`cooee`.concat(`-`);static getString(e,i){return this.getItem(e)||i}static setString(e,i){this.setItem(e,i);}static remove(e){this.removeItem(e);}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,i){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),i);}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e));}};var yr=1e3,Er=10,Ct=0,Rt=new Date;function It(t){le.remove(`sleid`),Rt=t??new Date;}function $i(){if(window.scrollY){let t=Fi();zi(t)&&Ui(t);}It$3(()=>{xr();});}function xr(){Tr$2(window,`scroll`).pipe(Fe$2(yr),q$2(()=>{let t=Fi();if(t>100){U$3.warn(`Received scroll percent is more than 100`,t);return}if(zi(t))return t})).subscribe(t=>{Ui(t);});}function zi(t){return Math.abs(Ct-t)>=Er||Ct!==t&&t===100}function Ui(t){if(t==null)return;let e={percent:t,timeMS:new Date().getTime()-Rt.getTime()};Ct=t;let o=new Ir$3(`CE Scroll`,e,null,le.getString(`sleid`,``));Vn(o),le.setString(`sleid`,o.id.toHexString()),Rt=new Date(o.occurred);}function Fi(){let t=window.document.body.scrollHeight,e=window.innerHeight;return Math.ceil((window.scrollY+e)/t*100)}function Wi(){Sr();}function Sr(){let t=window.fetch;try{window.fetch=async function(e,i){try{await kr(e,i);}catch(o){ke$1(o,`shopify_graphql_request_modify`,{extra:{body:JSON.stringify(i?.body)}});}return t(e,i)};}catch(e){console.warn(`Fail to override fetch.`,`Cooee won't be able to track "Buy Now Clicked" KPI.`),U$3.error(e);}U$3.verbose(`Securely overwritten window.fetch method for graphql query`);}async function kr(t,e){let i=typeof t==`string`?t:t instanceof Request?t.url:``;if(!(i.includes(`graphql.json`)&&e?.method===`POST`)||!e.body)return;let o;if(typeof e.body==`string`)try{o=JSON.parse(e.body);}catch{return}else o=e.body;o?.variables?.input&&(U$3.verbose(`Intercepted fetch request of:`,i),o?.query.includes(`cartCreate`)&&(e.body=await Cr(o),Rr()));}async function Cr(t){let e=t.variables.input.attributes??[],i=await Kn$1(`Buy Now`);return t.variables.input.attributes=[...e,...i],JSON.stringify(t)}function Rr(){let t=We$4().currentItem;if(!t)return;Vn(new Ir$3(`Buy Now Clicked`,{items:[t]}));}var de=class{constructor(e,i){this.selectors=e;this.eventName=i;this.selectorString=e.join(`,`);}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let i=e.currentTarget;Vn(new Ir$3(this.eventName,{class:i.className||void 0,tagName:i.tagName||void 0,id:i.id||void 0})),this.removeClickListener(this.clickListenerCallback);};listenSilently(){this.listen().catch(e=>U$3.error(e));}async listen(){this.elements=await Vr$4(this.selectorString),this.elements.forEach(e=>{e.addEventListener(`click`,this.clickListenerCallback);});}removeClickListener(e){this.elements?.forEach(i=>{i.removeEventListener(`click`,e);});}};var Xe=class t extends de{static selectors=[`.product__thumbnail-list-inner > button`,`product-gallery-navigation > button`,`.product-media--thumb-container`,`.product-images-inner > img`,`.m-product-media`,`.swiper-button-control`,`.media__thumb`,`.slick-arrow`,`.productView-img-container.product-single__media`,`.product-gallery__thumbnail_item_inner`];constructor(){super(t.selectors,`Item Thumbnail Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var Je=class t extends de{static selectors=[`.jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup`,`reviewsio-product-ratings`,`.ruk_rating_snippet.tracked:not(.hidden)`,`a > .loox-rating`,`.yotpo-reviews-star-ratings-widget`,`.yotpo.lp-hero__reviews`,`.pr-rating > a`,`.rivyoReviewWidget`];constructor(){super(t.selectors,`Review Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var Ir=[`.gokwik-checkout button`,`button.cart__checkout-button`,`button.cart__checkout`,`button#checkout`,`button#checkout2`,`button[id*="checkout" i]`,`button[name*="checkout" i]`,`button[class*="checkout" i]`].join(`,`);function Vi(){It$3(()=>{U$3.verbose(`Execution order:`,`document ready`),_r();});}function _r(){let t=window.location.hash?.substring(1);if(t)if(t.includes(`initiate-checkout`)){document.dispatchEvent(new Event(`letscooee:outbound:third-party-initiate-checkout`));let e=document.querySelector(Ir);if(!e){U$3.verbose(`No clickable cart checkout button found`);return}U$3.verbose(`Clickable cart checkout button found`,e),e.click();}else t.includes(`open-cart-drawer`)&&P.get().open();}function ji(){window.addEventListener(`kp-modal:opened`,()=>{We$4().isGoKwikPopupOpen=true;}),window.addEventListener(`user-loggedin`,t=>{let{token:e}=t.detail;e&&$m({goKwikToken:e});});}var w=class{static globalRef;static async initForMerchantWebsiteOnly(e){if(U$3.info(`Initialising SDK`),gi(navigator.userAgent)){U$3.info(`This seems to be a bot. Disabling SDK`);return}if(navigator.webdriver){U$3.info(`This seems to be headless browser. Disabling SDK`);return}if(this.initGlobalReference(e),window.cooeeSDKPreview){new Ie().meddle();return}await nC(),rC(),new Ie().meddle(),wm(),Ge(),Pr(),lC(),Ul(),Wi(),Vi(),$i(),Je.getInstance().listenSilently(),Xe.getInstance().listenSilently(),ji(),Tr(),no$1(),$o(),Me.remove(`conf`).catch(i=>{U$3.error(`Fail to remove App Config from local storage`,i);});}static initGlobalReference(e){window.CooeeSDK||qn$1(window,`CooeeSDK`,{}),this.globalRef=window.CooeeSDK,qn$1(this.globalRef,`config`,new le$5),qn$1(this.globalRef,`runtimeData`,{sdkLoadTime:e,jsLoadTime:new Date,lastEnterActive:new Date}),qn$1(this.globalRef,`uaParser`,new A,true),qn$1(this.globalRef,`cart`,h.getCurrent()),qn$1(this.globalRef,`cartChange$`,Nl()),qn$1(this.globalRef,`cartDrawerToggle$`,P.cartDrawerToggle$.asObservable()),U$3.verbose(`Global reference initialised`),new t(()=>{this.globalRef.uaParser=new A;});}static sendEvent(e,i,o){let s=new Ir$3(e,i,o?.triggerData);o?.occurred&&(s.occurred=o.occurred),Vn(s);}static updateProfile(e){for(let i in e)if(i.toLowerCase().startsWith(`ce `))throw new Error(`User property name cannot start with 'CE '`);$m(e);}static setPageName(e){if(!e)return;let i=We$4(),o=i.pageName;if(e===o)return;if(i.pageName=e,Zr$3.some(d=>e.includes(d))){It();return}let s={};o&&(s.ps=o);let p=new Ir$3(`CE Screen View`,s);p.occurred=i.jsLoadTime,Vn(p),It(p.occurred);}static previewPopup(e,i){import('./renderer-3qnKqaGo-DO_AEGCj.js').then(({FreeformRenderer:o})=>{new o(i).render(e);});}static previewWidget(e){if(!e)return;let i=new q$1(e);i.isPageWidgets()?ht$1([i]).catch(console.error):i.isCartEmbed()?ft$1([i]).catch(console.error):U$3.error(`Unsupported widget type for preview: `+i.onsiteDeliveryType);}};function Pr(){window.CooeeSDK.cartChange$.subscribe(()=>{fo();});}function Tr(){if(window.opener){try{window.opener.postMessage({action:`COOEE_READY_FOR_PREVIEW`},`*`);}catch(t){U$3.error(t);}window.addEventListener(`message`,t=>{if(U$3.verbose(`Received event`,t),!t.origin.includes(`letscooee.com`)&&!t.origin.includes(`localhost`))return;let e=t.data;typeof e==`object`&&(e.action===`POPUP_PREVIEW`?(w.previewPopup(e.engagementTrigger),t.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},t.origin)):e.action===`WIDGET_PREVIEW`&&(w.previewWidget(e.engagementTrigger),t.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},t.origin)));});}}performance.mark(`cooee-sdk-start`);var qi=new Date;window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=true,to$1(),ro$1(),await w.initForMerchantWebsiteOnly(qi),_e$2(),performance.measure(`cooee-sdk-init`,`cooee-sdk-start`),Fr$1()&&Promise.resolve().then(function () { return sdkDebugLogsBJz8NT5y; }).then(({printAllDebugLogs:t})=>t(qi)));
|
|
178
|
+
}`),_t}resolvePrimaryButtonColors(e,i){switch(this.buttons.primary.style){case `outline`:return {bg:`0 0 0 / 0`,color:e,border:e};case `ghost`:return {bg:`0 0 0 / 0`,color:e,border:`0 0 0 / 0`};default:return {bg:e,color:i,border:e}}}resolveSecondaryButtonColors(e,i,o,s){switch(this.buttons.secondaryColorScheme){case `accent`:return this.buttons.secondary.style===`filled`?{bg:s,color:e,border:s}:{bg:`0 0 0 / 0`,color:e,border:e};case `inverted`:return {bg:o,color:i,border:`0 0 0 / 0`};default:return this.buttons.secondary.style===`filled`?{bg:s,color:o,border:s}:{bg:`0 0 0 / 0`,color:o,border:o}}}};var Ye=class{apply(e){if(!e)return;le$4(new Ke(e).toCSSString());}};function Mi(){let t=le$5.get();!t.gaMeasurementID||!t.gaEnabled||fr();}async function gr(){let t=await ce$5.get(`gacid`),e=await hr();if(t!==e)return await ce$5.set(`gacid`,e),e}async function fr(){let t=await gr();t&&Hm({gaClientID:t});}async function hr(){let e=le$5.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(i=>{window.gtag(`get`,e,`client_id`,o=>{i(o);});})}var Ni=!!new URL(location.href).searchParams?.get(`new-brand`);async function Bi(t){(t?.enabled||Ni)&&new Ye().apply(t);}function br(t){if(!t)return t;let e=t.match(/:root\s*\{/);if(!e)return t;let i=0,o=-1;for(let s=e.index;s<t.length;s++)if(t[s]===`{`)i++;else if(t[s]===`}`&&--i===0){o=s+1;break}return o===-1?t:(t.slice(0,e.index)+t.slice(o)).trimStart()}async function St(t){U$3.verbose(`Received store settings`,t),t.currencyCount=t.currencies?.length;let e=w.globalRef.config.update(t);Mi(),D$1.initialize(),e.website&&(Ni&&(e.website.commonCSS=br(e.website.commonCSS)),Ui$2(e.website.commonJS),le$4(e.website.commonCSS),kt(e.website.widgetPartials??[])),window.CooeeSDK.cartDrawerToggle$.pipe(Fe$2(10)).subscribe(async({open:i})=>{U$3.info(`Cart drawer is now`,i?`open`:`closed`),i&&(dh(),await wr());});}function Hi(t){w.globalRef.apiURLs=t;}function kt(t){t?.length&&t.forEach(e=>{ze$1(e.name,e.template);});}async function wr(){let t=await h.getCurrent().getNormalisedCart(),e={value:t.amount,currency:t.currency};Vo(new dr$3(`View Cart`,{items:t.items,amount:e,drawer:true}));}var Ie=class{runtimeData=We$4();meddle(){let e=w.globalRef;e.profile=e.profile??[],e.events=e.events??[],e.page=e.page??[],this.meddlePage(),this.meddleEvents(),this.meddleProfile(),this.exposeMethods();}exposeMethods(){let e=w.globalRef;e.loadWidgets=e.loadCartWidgets=e.loadPageWidgets=()=>{fn();},e.loadExperiments=()=>{Ge();},e.testCartUpdate=this.testCartUpdate.bind(this),e.previewWidget=w.previewWidget.bind(w),e.previewPopup=w.previewPopup.bind(w),e.executeCTA=(i,o)=>{new Ge$1(i).execute(o);},e.sendEvent=i=>{Vo(i);};}overwritePush(e,i){qn$1(e,`push`,i);}meddleEvents(){this.overwritePush(w.globalRef.events,(...e)=>{this.processEvent(e[0]);}),w.globalRef.events.forEach(this.processEvent.bind(this));}meddleProfile(){this.overwritePush(w.globalRef.profile,(...e)=>{this.processProfile(e[0]);}),w.globalRef.profile.forEach(this.processProfile.bind(this));}processEvent(e){e&&(tn$1.includes(e[0])?w.sendEvent(e[0],e[1],r$2({occurred:this.runtimeData.jsLoadTime},e[2])):w.sendEvent(e[0],e[1],e[2]));}processProfile(e){e&&w.updateProfile(e);}meddlePage(){this.overwritePush(w.globalRef.page,(...e)=>{this.processPage(e[0]);}),w.globalRef.page.forEach(this.processPage.bind(this));}processPage(e){e.currentItem&&vr(e.currentItem),e.currency&&(We$4().currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.country&&(this.runtimeData.country=e.country),e.pageName&&w.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiments=e.activeExperiment),e.cart&&h.getCurrent().update(e.cart),e.configurations&&St(e.configurations),e.storeSettings&&St(e.storeSettings),e.storeBrand&&Bi(e.storeBrand),e.apiURLs&&Hi(e.apiURLs),e.widgetPartials&&kt(e.widgetPartials),e.template&&(this.runtimeData.template=e.template),e._error&&ke$1(e._error,e.slug,e.context),e.customContext&&(this.runtimeData.customContext=r$2(r$2({},this.runtimeData.customContext),e.customContext));}async testCartUpdate(){if(We$4().pageName!==`product`){window.alert(`This feature is only available on a product page`);return}let e=up();if(e||(e=We$4().currentItem?.vID),!e){window.alert(`Could not find a variant to test. Please try a different product page`);return}let i=new q$1({id:`preview`,shortID:`1`,redirectBehaviour:ae$4.CART_DRAWER});await new Ge$1(new Fe$1(new Date,i)).execute({clickAction:{at:he$3.ADD_TO_CART},embeddedItem:new pt$2({vID:e})});}};function vr(t){let e=We$4();if(e.currentItem&&e.currentItem.vID!==t.vID){let i=new CustomEvent(`letscooee:variant-change`,{detail:{variantID:t.vID,productID:t.mID}});document.dispatchEvent(i);}e.currentItem=new pt$2(t);}var le=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=`cooee`.concat(`-`);static getString(e,i){return this.getItem(e)||i}static setString(e,i){this.setItem(e,i);}static remove(e){this.removeItem(e);}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,i){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),i);}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e));}};var yr=1e3,Er=10,Ct=0,Rt=new Date;function It(t){le.remove(`sleid`),Rt=t??new Date;}function $i(){if(window.scrollY){let t=Fi();zi(t)&&Ui(t);}It$2(()=>{xr();});}function xr(){Tr$2(window,`scroll`).pipe(Fe$2(yr),q$2(()=>{let t=Fi();if(t>100){U$3.warn(`Received scroll percent is more than 100`,t);return}if(zi(t))return t})).subscribe(t=>{Ui(t);});}function zi(t){return Math.abs(Ct-t)>=Er||Ct!==t&&t===100}function Ui(t){if(t==null)return;let e={percent:t,timeMS:new Date().getTime()-Rt.getTime()};Ct=t;let o=new dr$3(`CE Scroll`,e,null,le.getString(`sleid`,``));Vo(o),le.setString(`sleid`,o.id.toHexString()),Rt=new Date(o.occurred);}function Fi(){let t=window.document.body.scrollHeight,e=window.innerHeight;return Math.ceil((window.scrollY+e)/t*100)}function Wi(){Sr();}function Sr(){let t=window.fetch;try{window.fetch=async function(e,i){try{await kr(e,i);}catch(o){ke$1(o,`shopify_graphql_request_modify`,{extra:{body:JSON.stringify(i?.body)}});}return t(e,i)};}catch(e){console.warn(`Fail to override fetch.`,`Cooee won't be able to track "Buy Now Clicked" KPI.`),U$3.error(e);}U$3.verbose(`Securely overwritten window.fetch method for graphql query`);}async function kr(t,e){let i=typeof t==`string`?t:t instanceof Request?t.url:``;if(!(i.includes(`graphql.json`)&&e?.method===`POST`)||!e.body)return;let o;if(typeof e.body==`string`)try{o=JSON.parse(e.body);}catch{return}else o=e.body;o?.variables?.input&&(U$3.verbose(`Intercepted fetch request of:`,i),o?.query.includes(`cartCreate`)&&(e.body=await Cr(o),Rr()));}async function Cr(t){let e=t.variables.input.attributes??[],i=await Kn$1(`Buy Now`);return t.variables.input.attributes=[...e,...i],JSON.stringify(t)}function Rr(){let t=We$4().currentItem;if(!t)return;Vo(new dr$3(`Buy Now Clicked`,{items:[t]}));}var de=class{constructor(e,i){this.selectors=e;this.eventName=i;this.selectorString=e.join(`,`);}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let i=e.currentTarget;Vo(new dr$3(this.eventName,{class:i.className||void 0,tagName:i.tagName||void 0,id:i.id||void 0})),this.removeClickListener(this.clickListenerCallback);};listenSilently(){this.listen().catch(e=>U$3.error(e));}async listen(){this.elements=await Vr$4(this.selectorString),this.elements.forEach(e=>{e.addEventListener(`click`,this.clickListenerCallback);});}removeClickListener(e){this.elements?.forEach(i=>{i.removeEventListener(`click`,e);});}};var Xe=class t extends de{static selectors=[`.product__thumbnail-list-inner > button`,`product-gallery-navigation > button`,`.product-media--thumb-container`,`.product-images-inner > img`,`.m-product-media`,`.swiper-button-control`,`.media__thumb`,`.slick-arrow`,`.productView-img-container.product-single__media`,`.product-gallery__thumbnail_item_inner`];constructor(){super(t.selectors,`Item Thumbnail Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var Je=class t extends de{static selectors=[`.jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup`,`reviewsio-product-ratings`,`.ruk_rating_snippet.tracked:not(.hidden)`,`a > .loox-rating`,`.yotpo-reviews-star-ratings-widget`,`.yotpo.lp-hero__reviews`,`.pr-rating > a`,`.rivyoReviewWidget`];constructor(){super(t.selectors,`Review Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var Ir=[`.gokwik-checkout button`,`button.cart__checkout-button`,`button.cart__checkout`,`button#checkout`,`button#checkout2`,`button[id*="checkout" i]`,`button[name*="checkout" i]`,`button[class*="checkout" i]`].join(`,`);function Vi(){It$2(()=>{U$3.verbose(`Execution order:`,`document ready`),_r();});}function _r(){let t=window.location.hash?.substring(1);if(t)if(t.includes(`initiate-checkout`)){document.dispatchEvent(new Event(`letscooee:outbound:third-party-initiate-checkout`));let e=document.querySelector(Ir);if(!e){U$3.verbose(`No clickable cart checkout button found`);return}U$3.verbose(`Clickable cart checkout button found`,e),e.click();}else t.includes(`open-cart-drawer`)&&D$1.get().open();}function ji(){window.addEventListener(`kp-modal:opened`,()=>{We$4().isGoKwikPopupOpen=true;}),window.addEventListener(`user-loggedin`,t=>{let{token:e}=t.detail;e&&$m({goKwikToken:e});});}var w=class{static globalRef;static async initForMerchantWebsiteOnly(e){if(U$3.info(`Initialising SDK`),gi(navigator.userAgent)){U$3.info(`This seems to be a bot. Disabling SDK`);return}if(navigator.webdriver){U$3.info(`This seems to be headless browser. Disabling SDK`);return}if(this.initGlobalReference(e),window.cooeeSDKPreview){new Ie().meddle();return}await oC(),rC(),new Ie().meddle(),wm(),Ge(),Pr(),lC(),Ul(),Wi(),Vi(),$i(),Je.getInstance().listenSilently(),Xe.getInstance().listenSilently(),ji(),Tr(),no(),$n(),Me.remove(`conf`).catch(i=>{U$3.error(`Fail to remove App Config from local storage`,i);});}static initGlobalReference(e){window.CooeeSDK||qn$1(window,`CooeeSDK`,{}),this.globalRef=window.CooeeSDK,qn$1(this.globalRef,`config`,new le$5),qn$1(this.globalRef,`runtimeData`,{sdkLoadTime:e,jsLoadTime:new Date,lastEnterActive:new Date}),qn$1(this.globalRef,`uaParser`,new A,true),qn$1(this.globalRef,`cart`,h.getCurrent()),qn$1(this.globalRef,`cartChange$`,Nl()),qn$1(this.globalRef,`cartDrawerToggle$`,D$1.cartDrawerToggle$.asObservable()),U$3.verbose(`Global reference initialised`),new t(()=>{this.globalRef.uaParser=new A;});}static sendEvent(e,i,o){let s=new dr$3(e,i,o?.triggerData);o?.occurred&&(s.occurred=o.occurred),Vo(s);}static updateProfile(e){for(let i in e)if(i.toLowerCase().startsWith(`ce `))throw new Error(`User property name cannot start with 'CE '`);$m(e);}static setPageName(e){if(!e)return;let i=We$4(),o=i.pageName;if(e===o)return;if(i.pageName=e,Zr$3.some(d=>e.includes(d))){It();return}let s={};o&&(s.ps=o);let p=new dr$3(`CE Screen View`,s);p.occurred=i.jsLoadTime,Vo(p),It(p.occurred);}static previewPopup(e,i){import('./renderer-BKCIF7-d-BcEjrOMd.js').then(({FreeformRenderer:o})=>{new o(i).render(e);});}static previewWidget(e){if(!e)return;let i=new q$1(e);i.isPageWidgets()?ht$1([i]).catch(console.error):i.isCartEmbed()?ft$1([i]).catch(console.error):U$3.error(`Unsupported widget type for preview: `+i.onsiteDeliveryType);}};function Pr(){window.CooeeSDK.cartChange$.subscribe(()=>{fn();});}function Tr(){if(window.opener){try{window.opener.postMessage({action:`COOEE_READY_FOR_PREVIEW`},`*`);}catch(t){U$3.error(t);}window.addEventListener(`message`,t=>{if(U$3.verbose(`Received event`,t),!t.origin.includes(`letscooee.com`)&&!t.origin.includes(`localhost`))return;let e=t.data;typeof e==`object`&&(e.action===`POPUP_PREVIEW`?(w.previewPopup(e.engagementTrigger),t.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},t.origin)):e.action===`WIDGET_PREVIEW`&&(w.previewWidget(e.engagementTrigger),t.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},t.origin)));});}}performance.mark(`cooee-sdk-start`);var qi=new Date;window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=true,to(),ro(),await w.initForMerchantWebsiteOnly(qi),_e$2(),performance.measure(`cooee-sdk-init`,`cooee-sdk-start`),Fr$1()&&Promise.resolve().then(function () { return sdkDebugLogsCL3qBmXx; }).then(({printAllDebugLogs:t})=>t(qi)));
|
|
178
179
|
|
|
179
180
|
var s=`\xA0\xA0\xA0`,l=[`/v1/engagement/cart-widgets`,`/v1/engagement/page-widgets`,`/v1/event/validate-session`];function d(e){if(e===0)return `0 B`;let i=1024,n=[`B`,`KB`,`MB`,`GB`],r=Math.floor(Math.log(e)/Math.log(i));return `${(e/Math.pow(i,r)).toFixed(2)} ${n[r]}`}function E(e){let i=performance.getEntriesByType?.(`resource`);if(i)return i.filter(n=>n.name.includes(e)).pop()}function R(){let e=performance.getEntriesByType?.(`resource`);return e?e.filter(i=>l.some(n=>i.name.includes(n))):[]}function S(e,i){if(!e){U$3.info(`\u{1F4E6} API Resource Metrics for ${i}: Not available`);return}U$3.info(`📦 ═══════════ API Resource Metrics ═══════════`),U$3.info(`URL: ${i}`),U$3.info(`Duration: ${Ue$1(e.duration)}`);let n=e.transferSize===0;if(U$3.info(`Served from: ${n?`💾 Cache (disk/memory)`:`🌐 Network`}`),!n){U$3.info(`Transfer size: ${d(e.transferSize)}`),U$3.info(`Encoded size: ${d(e.encodedBodySize)}`),U$3.info(`Decoded size: ${d(e.decodedBodySize)}`);let c=(1-e.encodedBodySize/e.decodedBodySize)*100;c>0&&U$3.info(`Compression ratio: ${c.toFixed(1)}%`);}let r=e.redirectEnd-e.redirectStart,f=e.fetchStart-e.startTime,a=e.domainLookupEnd-e.domainLookupStart,u=e.connectEnd-e.connectStart,m=e.secureConnectionStart>0?e.connectEnd-e.secureConnectionStart:0,g=e.connectEnd===e.connectStart?e.requestStart-e.fetchStart-a:e.requestStart-e.connectEnd,T=e.responseStart-e.requestStart,P=e.responseEnd-e.responseStart;U$3.info(`Timing breakdown (${Ue$1(e.duration)} total):`),r>0&&U$3.info(`${s}Redirect: ${Ue$1(r)}`),f>0&&U$3.info(`${s}Queued: ${Ue$1(f)}`),g>0&&U$3.info(`${s}Stalled: ${Ue$1(g)}`),a>0&&U$3.info(`${s}DNS lookup: ${Ue$1(a)}`),u>0&&U$3.info(`${s}TCP connect: ${Ue$1(u)}`),m>0&&U$3.info(`${s}SSL handshake: ${Ue$1(m)}`),U$3.info(`${s}Server waiting (TTFB): ${Ue$1(T)}`),U$3.info(`${s}Content download: ${Ue$1(P)}`);let $=e.serverTiming;if($?.length){U$3.info(`Server-Timing:`);for(let c of $){let p=c.description||c.name;c.duration>0?U$3.info(`${s}${p}: ${Ue$1(c.duration)}`):U$3.info(`${s}${p}: ${c.duration}`);}}U$3.info(`📦 ═════════════════════════════════════════════`);}function B(){let e=R();return e.length?e.map(n=>JSON.stringify(n.toJSON())).join(`
|
|
180
181
|
`):``}function z(){let e=new Set;for(let n of l){let r=E(n);r?S(r,n):e.add(n);}if(!e.size||typeof PerformanceObserver>`u`)return;let i=new PerformanceObserver(n=>{for(let r of n.getEntries())for(let f of e)if(r.name.includes(f)){S(r,f),e.delete(f);break}e.size||i.disconnect();});i.observe({type:`resource`,buffered:false});}
|
|
181
182
|
|
|
182
183
|
function a(i){return i?new Date(i).toLocaleString(`en-US`,{year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,fractionalSecondDigits:3,hour12:false,timeZoneName:`short`}):`N/A`}function M(){let i=performance.getEntriesByType?.(`resource`);if(i)return i.find(o=>o.name.includes(`@letscooee/web-sdk`)&&o.name.includes(`main.min.js`))}function x(i){window.cooeeSDKPreview||(document.readyState===`complete`?setTimeout(()=>L(i),100):window.addEventListener(`load`,()=>{setTimeout(()=>L(i),100);}));}function L(i){try{N(i),z();}catch(o){console.error(`Failed to print debugging logs`,o);}}function N(i){let o=performance.getEntriesByType?.(`navigation`)?.[0],f=window.CooeeSDK?.pageLoadTime,l=M(),s=performance.timeOrigin||0,n=o?.responseEnd?s+o.responseEnd:void 0,d=s,c=o?.domContentLoadedEventEnd||0,m=o?.loadEventEnd||0,u=n&&n>0?n:f?f.getTime():0,T=n&&n>0?`HTML download complete`:`inline script execution`,S=c>0?d+c:void 0,$=m>0?d+m:void 0;U$3.info(`⏱️ ═══════════════ Performance Timing Report ═══════════════`),U$3.info(`📅 Absolute Timestamps (Local Time):`),U$3.info(` Note: Inline script can execute during HTML download (incremental parsing)`),U$3.info(``),U$3.info(` 1. Navigation started: ${a(d)}`);let r=f?f.getTime():0;if(n&&n>0&&r?r<n?(U$3.info(` 2. Inline script executed: ${a(r)} (during HTML parsing)`),U$3.info(` 3. HTML download complete: ${a(n)}`)):(U$3.info(` 2. HTML download complete: ${a(n)}`),U$3.info(` 3. Inline script executed: ${a(r)}`)):n&&n>0?U$3.info(` 2. HTML download complete: ${a(n)}`):r&&U$3.info(` 2. Inline script executed: ${a(r)}`),U$3.info(` 4. SDK module loaded: ${a(i.getTime())} (from CDN)`),S&&U$3.info(` 5. DOMContentLoaded: ${a(S)}`),$&&U$3.info(` 6. Page fully loaded: ${a($)}`),U$3.info(``),U$3.info(`⏱️ Relative Timings:`),n&&n>0&&d){let g=n-d;U$3.info(` Shopify backend + HTML download: ${Ue$1(g)} (not Cooee SDK)`);}if(u){let g=i.getTime()-u;if(g<0){let w=r>0?r:d,b=r>0?`inline script execution`:`navigation start`,K=i.getTime()-w;U$3.info(` SDK module load time: ${Ue$1(K)} after ${b}`),U$3.info(` (Note: Using earlier baseline because SDK loaded before ${T})`);}else U$3.info(` SDK module load time: ${Ue$1(g)} after ${T}`),U$3.info(` (Baseline: ${T} at ${a(u)})`);let v=i.getTime()-d;U$3.info(` \u{1F3AF} Total SDK load time: ${Ue$1(v)} (from navigation start to SDK ready)`);}c&&c>0&&U$3.info(` DOMContentLoaded: ${Ue$1(c)} after navigation start`),m&&m>0&&U$3.info(` Page fully loaded: ${Ue$1(m)} after navigation start`),C(l),U$3.info(`⏱️ ═══════════════════════════════════════════════════════`);}function C(i){if(!i){U$3.info(``),U$3.info(`📦 SDK Resource Metrics: Not available`);return}U$3.info(``),U$3.info(`📦 SDK Resource Metrics:`),U$3.info(` URL: ${i.name}`),U$3.info(` Download duration: ${Ue$1(i.duration)}`);let o=i.transferSize===0;if(U$3.info(` Served from: ${o?`💾 Cache (disk/memory)`:`🌐 Network`}`),!o){U$3.info(` Transfer size: ${d(i.transferSize)}`),U$3.info(` Encoded size: ${d(i.encodedBodySize)}`),U$3.info(` Decoded size: ${d(i.decodedBodySize)}`);let f=(1-i.encodedBodySize/i.decodedBodySize)*100;f>0&&U$3.info(` Compression ratio: ${f.toFixed(1)}%`);}if(i.domainLookupEnd>0){let f=i.domainLookupEnd-i.domainLookupStart,l=i.connectEnd-i.connectStart,s=i.responseStart-i.requestStart,n=i.responseEnd-i.responseStart;U$3.info(` Timing breakdown:`),f>0&&U$3.info(` DNS lookup: ${Ue$1(f)}`),l>0&&U$3.info(` TCP connect: ${Ue$1(l)}`),s>0&&U$3.info(` Request: ${Ue$1(s)}`),n>0&&U$3.info(` Response: ${Ue$1(n)}`);}}
|
|
183
184
|
|
|
184
|
-
var
|
|
185
|
+
var sdkDebugLogsCL3qBmXx = /*#__PURE__*/Object.freeze({
|
|
185
186
|
__proto__: null,
|
|
186
187
|
printAllDebugLogs: x
|
|
187
188
|
});
|
|
188
189
|
|
|
189
|
-
export { U$1 as $, At as A, B,
|
|
190
|
+
export { U$1 as $, At as A, B, mt$3 as C, Dr$2 as D, ae$1 as E, Fe$1 as F, j$2 as G, He$2 as H, Qt$2 as I, Jt$2 as J, he$3 as K, Lt as L, M$3 as M, Nn$2 as N, Ot as O, Qn as P, Qe as Q, Rt$1 as R, Se$5 as S, Hn$1 as T, U$3 as U, Ve$2 as V, We$4 as W, pe as X, u$1 as Y, w$3 as Z, v as _, Hi$2 as a, q$2 as a0, Sr$1 as a1, m$1 as a2, vs as a3, ve$2 as a4, pi$1 as a5, Nn$1 as a6, bi$2 as a7, ii$1 as a8, _e as a9, Fs as aa, Ps as ab, Se$2 as ac, ye$2 as ad, mn$1 as ae, fe$3 as af, le$4 as ag, ae$4 as ah, Ee$3 as ai, le$5 as aj, gn$1 as ak, In$1 as al, Br$4 as am, ne$3 as an, Vi$2 as ao, Ne$3 as ap, gr$2 as aq, Re$1 as ar, Fe$3 as as, Pe$2 as at, ve$4 as au, Gn$1 as av, We$2 as aw, Je$1 as ax, Ae$1 as ay, oe$5 as az, V$2 as b, ce$5 as c, dr$3 as d, H$3 as e, D$1 as f, en$1 as g, be$1 as h, Be$1 as i, jn$1 as j, ke$1 as k, l$3 as l, mt$2 as m, kt$1 as n, ye$1 as o, A$1 as p, q$1 as q, r$2 as r, se$3 as s, t, s$2 as u, L$4 as v, Sn$1 as w, On$1 as x, y$1 as y, S$2 as z };
|