@letscooee/web-sdk 14.0.5 → 14.1.0

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.
@@ -1,13 +1,13 @@
1
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=Object.create;var g=Object.defineProperty,l$1=Object.defineProperties,m=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyDescriptors,o=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,p=Object.getPrototypeOf,h=Object.prototype.hasOwnProperty,j=Object.prototype.propertyIsEnumerable;var i=(a,b,c)=>b in a?g(a,b,{enumerable:true,configurable:true,writable:true,value:c}):a[b]=c,r=(a,b)=>{for(var c in b||={})h.call(b,c)&&i(a,c,b[c]);if(f)for(var c of f(b))j.call(b,c)&&i(a,c,b[c]);return a},s$1=(a,b)=>l$1(a,n(b));var t=(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=(a,b)=>{var c={};for(var d in a)h.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.call(a,d)&&(c[d]=a[d]);return c};var v=(a,b)=>()=>(b||a((b={exports:{}}).exports,b),b.exports),w=(a,b)=>{for(var c in b)g(a,c,{get:b[c],enumerable:true});},q=(a,b,c,d)=>{if(b&&typeof b==`object`||typeof b==`function`)for(let e of o(b))!h.call(a,e)&&e!==c&&g(a,e,{get:()=>b[e],enumerable:!(d=m(b,e))||d.enumerable});return a};var x=(a,b,c)=>(c=a!=null?k(p(a)):{},q(!a||!a.__esModule?g(c,`default`,{value:a,enumerable:true}):c,a));
2
2
 
3
- var dt=v((lt,Fe)=>{(function(s){if(typeof lt==`object`&&typeof Fe<`u`)Fe.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 c(v,I,w){function R(T,M){if(!I[T]){if(!v[T]){var p=typeof t==`function`&&t;if(!M&&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,c,v,I,w);}return I[T].exports}for(var b=typeof t==`function`&&t,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(c,v,I){(function(w){var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),M=w.document.createTextNode(``);T.observe(M,{characterData:true}),b=function(){M.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 B=w.document.createElement(`script`);B.onreadystatechange=function(){O(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null;},w.document.documentElement.appendChild(B);}:b=function(){setTimeout(O,0);};var _,C=[];function O(){_=true;for(var B,z,F=C.length;F;){for(z=C,C=[],B=-1;++B<F;)z[B]();F=C.length;}_=false;}v.exports=j;function j(B){C.push(B)===1&&!_&&b();}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{}],2:[function(c,v,I){var w=c(1);function R(){}var b={},m=[`REJECTED`],T=[`FULFILLED`],M=[`PENDING`];v.exports=p;function p(y){if(typeof y!=`function`)throw new TypeError(`resolver must be a function`);this.state=M,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!==M)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(U){return b.reject(y,U)}L===y?b.reject(y,new TypeError(`Cannot resolve promise with itself`)):b.resolve(y,L);});}b.resolve=function(y,A){var D=B(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 U=-1,k=y.queue.length;++U<k;)y.queue[U].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 U(G){D||(D=true,b.resolve(y,G));}function k(){A(U,L);}var $=B(k);$.status===`error`&&L($.value);}function B(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 U=new Array(D),k=0,$=-1,G=new this(R);++$<D;)q(y[$],$);return G;function q(ie,le){A.resolve(ie).then(Se,function(te){L||(L=true,b.reject(G,te));});function Se(te){U[le]=te,++k===D&&!L&&(L=true,b.resolve(G,U));}}}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 U=-1,k=new this(R);++U<D;)$(y[U]);return k;function $(G){A.resolve(G).then(function(q){L||(L=true,b.resolve(k,q));},function(q){L||(L=true,b.reject(k,q));});}}},{1:1}],3:[function(c,v,I){(function(w){typeof w.Promise!=`function`&&(w.Promise=c(2));}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{2:2}],4:[function(c,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 M(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`&&c(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 B=`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(B,y),i=M([``]);t.objectStore(B).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 U(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 k(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)U(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(u){var f=o.result;try{f.createObjectStore(e.storeName),u.oldVersion<=1&&f.createObjectStore(B);}catch(l){if(l.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+u.oldVersion+` to version `+u.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw l}}),o.onerror=function(u){u.preventDefault(),i(o.error);},o.onsuccess=function(){var u=o.result;u.onversionchange=function(f){f.target.close();},t(u),k(e);};})}function q(e){return G(e,false)}function ie(e){return G(e,true)}function le(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 te(e){return M([A(atob(e.data))],{type:e.type})}function We(e){return e&&e.__local_forage_encoded_blob}function Rt(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 Ct(e){U(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,q(e).then(function(o){return e.db=o,le(e)?ie(e):o}).then(function(o){e.db=r.db=o;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=o;}).catch(function(o){throw $(e,o),o})}function K(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),ie(e)}).then(function(){return Ct(e).then(function(){K(e,r,t,i-1);})}).catch(t);t(o);}}function $e(){return {forages:[],db:null,dbReady:null,deferredOperations:[]}}function At(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=Rt);var o=[];function u(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(u));}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,q(t)}).then(function(g){return t.db=g,le(t,r._defaultConfig.version)?ie(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(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),We(g)&&(g=te(g)),a(g);},d.onerror=function(){o(d.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Nt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;We(S)&&(S=te(S));var x=e(S,E.key,g++);x!==void 0?a(x):E.continue();}else a();},d.onerror=function(){o(d.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Lt(e,r,t){var i=this;e=O(e);var a=new p(function(o,u){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){K(i._dbInfo,y,function(d,g){if(d)return u(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(){u(S.error?S.error:S.transaction.error);};}catch(x){u(x);}});}).catch(u);});return _(a,t),a}function Ot(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,y,function(u,f){if(u)return o(u);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 Pt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,y,function(o,u){if(o)return a(o);try{var l=u.objectStore(r._dbInfo.storeName).clear();u.oncomplete=function(){i();},u.onabort=u.onerror=function(){a(l.error?l.error:l.transaction.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Mt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var l=u.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 Vt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);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 Bt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var l=u.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 Ft(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 u=e.name===t.name&&i._dbInfo.db?p.resolve(i._dbInfo.db):q(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=u.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;U(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(N,V){var P=m.open(e.name,l);P.onerror=function(H){P.result.close(),V(H);},P.onupgradeneeded=function(){P.result.deleteObjectStore(e.storeName);},P.onsuccess=function(){var H=P.result;H.close(),N(H);};}).then(function(N){d.db=N;for(var V=0;V<g.length;V++){var P=g[V];P._dbInfo.db=N,k(P._dbInfo);}}).catch(function(N){throw ($(e,N)||p.resolve()).catch(function(){}),N})}}):a=u.then(function(f){U(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(x,N){var V=m.deleteDatabase(e.name);V.onerror=function(){var P=V.result;P&&P.close(),N(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(),x(P);};}).then(function(x){l.db=x;for(var N=0;N<d.length;N++){var V=d[N];k(V._dbInfo);}}).catch(function(x){throw ($(e,x)||p.resolve()).catch(function(){}),x})});}return _(a,r),a}var Ut={_driver:`asyncStorage`,_initStorage:At,_support:T(),iterate:Nt,getItem:xt,setItem:Lt,removeItem:Ot,clear:Pt,length:Mt,key:Vt,keys:Bt,dropInstance:Ft};function kt(){return typeof openDatabase==`function`}var X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Wt=`~~local_forage_type~`,Ge=/^~~local_forage_type~([^~]+)~/,de=`__lfsc__:`,De=de.length,Re=`arbf`,Ce=`blob`,He=`si08`,Ye=`ui08`,je=`uic8`,ze=`si16`,qe=`si32`,Ke=`ur16`,Xe=`ui32`,Je=`fl32`,Qe=`fl64`,Ze=De+Re.length,et=Object.prototype.toString;function tt(e){var r=e.length*.75,t=e.length,i,a=0,o,u,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]),u=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|u>>4,g[a++]=(u&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=et.call(e)),e&&(t===`[object ArrayBuffer]`||e.buffer&&et.call(e.buffer)===`[object ArrayBuffer]`)){var i,a=de;e instanceof ArrayBuffer?(i=e,a+=Re):(i=e.buffer,t===`[object Int8Array]`?a+=He:t===`[object Uint8Array]`?a+=Ye:t===`[object Uint8ClampedArray]`?a+=je:t===`[object Int16Array]`?a+=ze:t===`[object Uint16Array]`?a+=Ke:t===`[object Int32Array]`?a+=qe:t===`[object Uint32Array]`?a+=Xe:t===`[object Float32Array]`?a+=Je:t===`[object Float64Array]`?a+=Qe: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 u=Wt+e.type+`~`+Ae(this.result);r(de+Ce+u);},o.readAsArrayBuffer(e);}else try{r(JSON.stringify(e));}catch(u){console.error(`Couldn't convert value into a JSON string: `,e),r(null,u);}}function Gt(e){if(e.substring(0,De)!==de)return JSON.parse(e);var r=e.substring(Ze),t=e.substring(De,Ze),i;if(t===Ce&&Ge.test(r)){var a=r.match(Ge);i=a[1],r=r.substring(a[0].length);}var o=tt(r);switch(t){case Re:return o;case Ce:return M([o],{type:i});case He:return new Int8Array(o);case Ye:return new Uint8Array(o);case je:return new Uint8ClampedArray(o);case ze:return new Int16Array(o);case Ke:return new Uint16Array(o);case qe:return new Int32Array(o);case Xe:return new Uint32Array(o);case Je:return new Float32Array(o);case Qe:return new Float64Array(o);default:throw new Error(`Unkown type: `+t)}}var xe={serialize:$t,deserialize:Gt,stringToBuffer:tt,bufferToString:Ae};function rt(e,r,t,i){e.executeSql(`CREATE TABLE IF NOT EXISTS `+r.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],t,i);}function Ht(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,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size);}catch(f){return u(f)}t.db.transaction(function(f){rt(f,t,function(){r._dbInfo=t,o();},function(l,d){u(d);});},u);});return t.serializer=xe,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(u,f){f.code===f.SYNTAX_ERR?u.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[r.storeName],function(l,d){d.rows.length?o(l,f):rt(l,r,function(){l.executeSql(t,i,a,o);},o);},o):o(u,f);},o);}function Yt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT * FROM `+u.storeName+` WHERE key = ? LIMIT 1`,[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=u.serializer.deserialize(g)),a(g);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function jt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT * FROM `+u.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var x=g.item(S),N=x.value;if(N&&(N=u.serializer.deserialize(N)),N=e(N,x.key,S+1),N!==void 0){a(N);return}}a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function nt(e,r,t,i){var a=this;e=O(e);var o=new p(function(u,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(){u(l);},function(x,N){f(N);});},function(S){if(S.code===S.QUOTA_ERR){if(i>0){u(nt.apply(a,[e,l,t,i-1]));return}f(S);}});});}).catch(f);});return _(o,t),o}function zt(e,r,t){return nt.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 u=t._dbInfo;u.db.transaction(function(f){J(f,u,`DELETE FROM `+u.storeName+` WHERE key = ?`,[e],function(){a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Kt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,`DELETE FROM `+o.storeName,[],function(){i();},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Xt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,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 Jt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT key FROM `+u.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 Qt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,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 Zt(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 u=[],f=0;f<o.rows.length;f++)u.push(o.rows.item(f).name);r({db:e,storeNames:u});},function(a,o){t(o);});},function(i){t(i);});})}function er(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 u;e.name===t.name?u=i._dbInfo.db:u=openDatabase(e.name,``,``,0),e.storeName?o({db:u,storeNames:[e.storeName]}):o(Zt(u));}).then(function(o){return new p(function(u,f){o.db.transaction(function(l){function d(x){return new p(function(N,V){l.executeSql(`DROP TABLE IF EXISTS `+x,[],function(){N();},function(P,H){V(H);});})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){u();}).catch(function(x){f(x);});},function(l){f(l);});})}):a=p.reject(`Invalid arguments`),_(a,r),a}var tr={_driver:`webSQLStorage`,_initStorage:Ht,_support:kt(),iterate:jt,getItem:Yt,setItem:zt,removeItem:qt,clear:Kt,length:Xt,key:Jt,keys:Qt,dropInstance:er};function rr(){try{return typeof localStorage<`u`&&`setItem`in localStorage&&!!localStorage.setItem}catch{return false}}function ot(e,r){var t=e.name+`/`;return e.storeName!==r.storeName&&(t+=e.storeName+`/`),t}function nr(){var e=`_localforage_support_test`;try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return true}}function or(){return !nr()||localStorage.length>0}function ir(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=ot(e,r._defaultConfig),or()?(r._dbInfo=t,t.serializer=xe,p.resolve()):p.reject()}function ar(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 sr(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 ur(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,u=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(u),l++),E!==void 0)return E}}});return _(i,r),i}function cr(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 fr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],u=0;u<a;u++){var f=localStorage.key(u);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length));}return o});return _(t,e),t}function lr(e){var t=this.keys().then(function(i){return i.length});return _(t,e),t}function dr(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 mr(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(u,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),u(o);}catch(E){(E.name===`QuotaExceededError`||E.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&f(E),f(E);}});})});return _(a,t),a}function gr(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(ot(e,i._defaultConfig)):o(e.name+`/`);}).then(function(o){for(var u=localStorage.length-1;u>=0;u--){var f=localStorage.key(u);f.indexOf(o)===0&&localStorage.removeItem(f);}}):a=p.reject(`Invalid arguments`),_(a,r),a}var pr={_driver:`localStorageWrapper`,_initStorage:ir,_support:rr(),iterate:ur,getItem:sr,setItem:mr,removeItem:dr,clear:ar,length:lr,key:cr,keys:fr,dropInstance:gr},hr=function(r,t){return r===t||typeof r==`number`&&typeof t==`number`&&isNaN(r)&&isNaN(t)},vr=function(r,t){for(var i=r.length,a=0;a<i;){if(hr(r[a],t))return true;a++;}return false},it=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},ae={},at={},re={INDEXEDDB:Ut,WEBSQL:tr,LOCALSTORAGE:pr},yr=[re.INDEXEDDB._driver,re.WEBSQL._driver,re.LOCALSTORAGE._driver],me=[`dropInstance`],Ne=[`clear`,`getItem`,`iterate`,`key`,`keys`,`length`,`removeItem`,`setItem`].concat(me),Er={description:``,driver:yr.slice(),name:`localforage`,size:4980736,storeName:`keyvaluepairs`,version:1};function _r(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)&&(it(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 re)if(re.hasOwnProperty(t)){var i=re[t],a=i._driver;this[t]=a,ae[a]||this.defineDriver(i);}this._defaultConfig=Le({},Er),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(u,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=Ne.concat(`_initStorage`),E=0,S=g.length;E<S;E++){var x=g[E];if((!vr(me,x)||t[x])&&typeof t[x]!=`function`){f(d);return}}var V=function(){for(var se=function(Ir){return function(){var Sr=new Error(`Method `+Ir+` is not implemented by the current driver`),st=p.reject(Sr);return _(st,arguments[arguments.length-1]),st}},Oe=0,wr=me.length;Oe<wr;Oe++){var Pe=me[Oe];t[Pe]||(t[Pe]=se(Pe));}};V();var P=function(se){ae[l]&&console.info(`Redefining LocalForage driver: `+l),ae[l]=t,at[l]=se,u();};`_support`in t?t._support&&typeof t._support==`function`?t._support().then(P,f):P(!!t._support):P(!0);}catch(H){f(H);}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=ae[t]?p.resolve(ae[t]):p.reject(new Error(`Driver not found.`));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(xe);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;it(t)||(t=[t]);var u=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 x(){for(;S<E.length;){var N=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(N).then(l).catch(x)}f();var V=new Error(`No available storage method found.`);return o._driverSet=p.reject(V),o._driverSet}return x()}}return this._driverSet=(this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve()).then(function(){var E=u[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(u);})}).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 !!at[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 u=t[a];this.supports(u)&&i.push(u);}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=Ne.length;t<i;t++)_r(this,Ne[t]);},e.prototype.createInstance=function(t){return new e(t)},e})());},{3:3}]},{},[4])(4)});});var yt=v((vt,_e)=>{(function(s){var n={};n.VERSION=`1.6.1`;var h,c={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],M,p;for(p=1;p<m.length;p++)for(M in m[p])!(M in T)&&m[p].hasOwnProperty(M)&&(T[M]=m[p][M]);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 c)c.hasOwnProperty(T)&&c[T].setLevel(m);},n.getLevel=function(){return b.getLevel()},n.get=function(m){return c[m]||(c[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={},M=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):M(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,_),M(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 _e<`u`&&_e.exports?_e.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n);})(vt);});var Me=`14.0.5`;var Rr=Me.split(`-`)[0].split(`.`).slice(0,3).map(s=>s.padStart(2,`0`)).join(``),Gr=`WEB`,ft=`CooeeSDK`,Q=Me,Hr=parseInt(Rr,10);var Yr=[`collection`,`product`,`cart`],jr=[{identifier:`#flo-checkout-wrapper`,gateway:`Shopflow`},{identifier:`#fastrr-main-container`,gateway:`Shiprocket`},{identifier:`#gokwik-modal-wrapper`,gateway:`Gokwik`},{identifier:`#zecpe`,gateway:`Ecom 360`}],zr=[`View Item`,`View Cart`,`View Collection`],qr=[`CE Screen View`,`View Collection`,`View Item`,`View Cart`],Kr=`https://cdn.jsdelivr.net/npm/swiper@11`;function Jr(s){return `(\u23F0 took: ${Ve(s)})`}function Ve(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 Be(){return window.CooeeSDK.runtimeData}function en(){return Ve(Date.now()-Be().sdkLoadTime.getTime())}var Ue=x(dt());function ge(s){return Ue.default.createInstance({name:`lc`,storeName:s,driver:Ue.default.LOCALSTORAGE})}var ne=class{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 fe=class extends ne{static storeName=`usr`;static{this.storage=ge(this.storeName);}};var mt=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q}/dist`,ee={apiURL:`https://api.sdk.letscooee.com`,debug:false,mode:`production`,baseURL:mt,styleURL:`${mt}/styles.min.css`};var pe=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(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((c,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&c.push({[v]:n[v]}),c),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,c)=>(n[c]!==null&&n[c]!==void 0&&(h[c]=n[c]),h),{})}static stringify(n){return JSON.stringify(n,function(h,c){return c===void 0?null:c})}};var he=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;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.widgetCustomisation=n.widgetCustomisation,this}};var ve=class extends ne{static storeName=`ses`;static{this.storage=ge(this.storeName);}};var ye=class{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,c=`,`,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`+c)+(w[1]?v+w[1]:``)}};function Dn(s){try{return new URL(s)}catch{return}}function Rn(s){return !s||s===`null`||s===`undefined`}function Cn(s,n){let h=s.indexOf(n);return h===-1?false:(s.splice(h,1),true)}function An(s,n,h){return {[s]:Cr(n,h),[s+`_wo_currency`]:n}}function Cr(s,n){if(s==0&&n)return `Free`;let h=Be(),c=he.get(),v=h.shopCurrencyCode||c.currency,I=h.currencyCode;I||Y.warn(`Currency code is not set in RuntimeData`);let w=c.money?.format??h.moneyFormat,R;if(w&&v===I)R=ye.format(s*100,w);else {let b;try{b=new Intl.NumberFormat(gt(),{style:`currency`,currency:I||v,minimumFractionDigits:0,maximumFractionDigits:2});}catch(m){return ke(m,`format-currency`,{extra:{currentCurrency:I,shopCurrency:v}}),``}R=b.format(s),R=R.replace(`₹`,`Rs. `),c.money?.showCurrency&&I!==`INR`&&(R=R.concat(` ${I}`));}return R}function xn(s){let n=gt();try{return new Intl.NumberFormat(n,{notation:`compact`}).format(s)}catch(h){return ke(h,`format-number`,{extra:{lang:n,value:s}}),s.toString()}}function gt(){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 Ee;function pt(){if(Ee)return Ee;try{return Ee=Intl.DateTimeFormat().resolvedOptions().timeZone,Ee}catch{return ``}}function ht(s){document.readyState!==`loading`?s():document.addEventListener(`DOMContentLoaded`,s);}function Nn(s){let n=document.createElement(`span`);n.id=`snackbar`,n.innerText=s,document.body.appendChild(n),n.className=`show`,setTimeout(()=>{n.classList.remove(`show`),document.body.removeChild(n);},5e3);}async function Ar(s,n=7,h=document){let c=1,v=document.querySelectorAll(`nonexistent-tag`);for(;c<=n;){let I=Math.min(50*2**c,1e3);if(c>1&&await pe.sleep(I),v=h.querySelectorAll(s),v.length)return Y.verbose(`Attempt ${c}: ${v.length} elements found with ${s}`),v;Y.verbose(`Attempt ${c}: Elements not found with ${s}. Will retry after ${I}ms.`),c++;}return Y.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function Ln(s,n=10,h=document){return (await Ar(s,n,h)).item(0)}async function xr(s){let[n,h,c]=await Promise.all([fe.get(`did`),ve.get(`id`,``),fe.get(`sessionNumber`,1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${c}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function On(s){let n=await xr(s);return Object.entries(n).map(([h,c])=>({key:h,value:c.toString()}))}function Pn(s,n,h,c=false){Object.defineProperty(s,n,{enumerable:false,configurable:false,writable:c,value:h});}function Mn(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`}}function Vn(s,n){return !n?s:n+s}var W=x(yt());var Y=class{static debuggerEl;static infoLogs=[];static log(...n){W.default.info(...n);}static verbose(...n){W.default.debug(...n);}static error(...n){W.default.error(...n);}static warn(...n){W.default.warn(...n);}static info(...n){W.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(` `)}),this.addToDebugger();}static trace(...n){W.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 Wn(s=ft){W.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q}):`);}}),Nr()&&(localStorage.cooeeLogLevel=`TRACE`),localStorage.cooeeLogLevel?W.default.setLevel(W.default[localStorage.cooeeLogLevel]):W.default.setLevel(W.default.OFF);}function Nr(){let s=Et();return s===`1`||s===`on`}function Et(){return new URL(location.href).searchParams?.get(`cooee-debug`)}function $n(){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=v((lt,Fe)=>{(function(s){if(typeof lt==`object`&&typeof Fe<`u`)Fe.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 c(v,I,w){function R(T,M){if(!I[T]){if(!v[T]){var p=typeof t==`function`&&t;if(!M&&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,c,v,I,w);}return I[T].exports}for(var b=typeof t==`function`&&t,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(c,v,I){(function(w){var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),M=w.document.createTextNode(``);T.observe(M,{characterData:true}),b=function(){M.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 B=w.document.createElement(`script`);B.onreadystatechange=function(){O(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null;},w.document.documentElement.appendChild(B);}:b=function(){setTimeout(O,0);};var _,C=[];function O(){_=true;for(var B,z,F=C.length;F;){for(z=C,C=[],B=-1;++B<F;)z[B]();F=C.length;}_=false;}v.exports=j;function j(B){C.push(B)===1&&!_&&b();}}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{}],2:[function(c,v,I){var w=c(1);function R(){}var b={},m=[`REJECTED`],T=[`FULFILLED`],M=[`PENDING`];v.exports=p;function p(y){if(typeof y!=`function`)throw new TypeError(`resolver must be a function`);this.state=M,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!==M)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(U){return b.reject(y,U)}L===y?b.reject(y,new TypeError(`Cannot resolve promise with itself`)):b.resolve(y,L);});}b.resolve=function(y,A){var D=B(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 U=-1,k=y.queue.length;++U<k;)y.queue[U].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 U(G){D||(D=true,b.resolve(y,G));}function k(){A(U,L);}var $=B(k);$.status===`error`&&L($.value);}function B(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 U=new Array(D),k=0,$=-1,G=new this(R);++$<D;)q(y[$],$);return G;function q(ie,le){A.resolve(ie).then(Se,function(te){L||(L=true,b.reject(G,te));});function Se(te){U[le]=te,++k===D&&!L&&(L=true,b.resolve(G,U));}}}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 U=-1,k=new this(R);++U<D;)$(y[U]);return k;function $(G){A.resolve(G).then(function(q){L||(L=true,b.resolve(k,q));},function(q){L||(L=true,b.reject(k,q));});}}},{1:1}],3:[function(c,v,I){(function(w){typeof w.Promise!=`function`&&(w.Promise=c(2));}).call(this,typeof global<`u`?global:typeof self<`u`?self:typeof window<`u`?window:{});},{2:2}],4:[function(c,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 M(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`&&c(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 B=`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(B,y),i=M([``]);t.objectStore(B).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 U(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 k(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)U(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(u){var f=o.result;try{f.createObjectStore(e.storeName),u.oldVersion<=1&&f.createObjectStore(B);}catch(l){if(l.name===`ConstraintError`)console.warn(`The database "`+e.name+`" has been upgraded from version `+u.oldVersion+` to version `+u.newVersion+`, but the storage "`+e.storeName+`" already exists.`);else throw l}}),o.onerror=function(u){u.preventDefault(),i(o.error);},o.onsuccess=function(){var u=o.result;u.onversionchange=function(f){f.target.close();},t(u),k(e);};})}function q(e){return G(e,false)}function ie(e){return G(e,true)}function le(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 te(e){return M([A(atob(e.data))],{type:e.type})}function We(e){return e&&e.__local_forage_encoded_blob}function Rt(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 Ct(e){U(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,q(e).then(function(o){return e.db=o,le(e)?ie(e):o}).then(function(o){e.db=r.db=o;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=o;}).catch(function(o){throw $(e,o),o})}function K(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),ie(e)}).then(function(){return Ct(e).then(function(){K(e,r,t,i-1);})}).catch(t);t(o);}}function $e(){return {forages:[],db:null,dbReady:null,deferredOperations:[]}}function At(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=Rt);var o=[];function u(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(u));}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,q(t)}).then(function(g){return t.db=g,le(t,r._defaultConfig.version)?ie(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(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),We(g)&&(g=te(g)),a(g);},d.onerror=function(){o(d.error);};}catch(g){o(g);}});}).catch(o);});return _(i,r),i}function Nt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var d=f.objectStore(t._dbInfo.storeName).openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;We(S)&&(S=te(S));var x=e(S,E.key,g++);x!==void 0?a(x):E.continue();}else a();},d.onerror=function(){o(d.error);};}catch(E){o(E);}});}).catch(o);});return _(i,r),i}function Lt(e,r,t){var i=this;e=O(e);var a=new p(function(o,u){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){K(i._dbInfo,y,function(d,g){if(d)return u(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(){u(S.error?S.error:S.transaction.error);};}catch(x){u(x);}});}).catch(u);});return _(a,t),a}function Ot(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,y,function(u,f){if(u)return o(u);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 Pt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,y,function(o,u){if(o)return a(o);try{var l=u.objectStore(r._dbInfo.storeName).clear();u.oncomplete=function(){i();},u.onabort=u.onerror=function(){a(l.error?l.error:l.transaction.error);};}catch(d){a(d);}});}).catch(a);});return _(t,e),t}function Mt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var l=u.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 Vt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);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 Bt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var l=u.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 Ft(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 u=e.name===t.name&&i._dbInfo.db?p.resolve(i._dbInfo.db):q(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=u.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;U(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(N,V){var P=m.open(e.name,l);P.onerror=function(H){P.result.close(),V(H);},P.onupgradeneeded=function(){P.result.deleteObjectStore(e.storeName);},P.onsuccess=function(){var H=P.result;H.close(),N(H);};}).then(function(N){d.db=N;for(var V=0;V<g.length;V++){var P=g[V];P._dbInfo.db=N,k(P._dbInfo);}}).catch(function(N){throw ($(e,N)||p.resolve()).catch(function(){}),N})}}):a=u.then(function(f){U(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(x,N){var V=m.deleteDatabase(e.name);V.onerror=function(){var P=V.result;P&&P.close(),N(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(),x(P);};}).then(function(x){l.db=x;for(var N=0;N<d.length;N++){var V=d[N];k(V._dbInfo);}}).catch(function(x){throw ($(e,x)||p.resolve()).catch(function(){}),x})});}return _(a,r),a}var Ut={_driver:`asyncStorage`,_initStorage:At,_support:T(),iterate:Nt,getItem:xt,setItem:Lt,removeItem:Ot,clear:Pt,length:Mt,key:Vt,keys:Bt,dropInstance:Ft};function kt(){return typeof openDatabase==`function`}var X=`ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/`,Wt=`~~local_forage_type~`,Ge=/^~~local_forage_type~([^~]+)~/,de=`__lfsc__:`,De=de.length,Re=`arbf`,Ce=`blob`,He=`si08`,Ye=`ui08`,je=`uic8`,ze=`si16`,qe=`si32`,Ke=`ur16`,Xe=`ui32`,Je=`fl32`,Qe=`fl64`,Ze=De+Re.length,et=Object.prototype.toString;function tt(e){var r=e.length*.75,t=e.length,i,a=0,o,u,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]),u=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|u>>4,g[a++]=(u&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=et.call(e)),e&&(t===`[object ArrayBuffer]`||e.buffer&&et.call(e.buffer)===`[object ArrayBuffer]`)){var i,a=de;e instanceof ArrayBuffer?(i=e,a+=Re):(i=e.buffer,t===`[object Int8Array]`?a+=He:t===`[object Uint8Array]`?a+=Ye:t===`[object Uint8ClampedArray]`?a+=je:t===`[object Int16Array]`?a+=ze:t===`[object Uint16Array]`?a+=Ke:t===`[object Int32Array]`?a+=qe:t===`[object Uint32Array]`?a+=Xe:t===`[object Float32Array]`?a+=Je:t===`[object Float64Array]`?a+=Qe: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 u=Wt+e.type+`~`+Ae(this.result);r(de+Ce+u);},o.readAsArrayBuffer(e);}else try{r(JSON.stringify(e));}catch(u){console.error(`Couldn't convert value into a JSON string: `,e),r(null,u);}}function Gt(e){if(e.substring(0,De)!==de)return JSON.parse(e);var r=e.substring(Ze),t=e.substring(De,Ze),i;if(t===Ce&&Ge.test(r)){var a=r.match(Ge);i=a[1],r=r.substring(a[0].length);}var o=tt(r);switch(t){case Re:return o;case Ce:return M([o],{type:i});case He:return new Int8Array(o);case Ye:return new Uint8Array(o);case je:return new Uint8ClampedArray(o);case ze:return new Int16Array(o);case Ke:return new Uint16Array(o);case qe:return new Int32Array(o);case Xe:return new Uint32Array(o);case Je:return new Float32Array(o);case Qe:return new Float64Array(o);default:throw new Error(`Unkown type: `+t)}}var xe={serialize:$t,deserialize:Gt,stringToBuffer:tt,bufferToString:Ae};function rt(e,r,t,i){e.executeSql(`CREATE TABLE IF NOT EXISTS `+r.storeName+` (id INTEGER PRIMARY KEY, key unique, value)`,[],t,i);}function Ht(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,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size);}catch(f){return u(f)}t.db.transaction(function(f){rt(f,t,function(){r._dbInfo=t,o();},function(l,d){u(d);});},u);});return t.serializer=xe,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(u,f){f.code===f.SYNTAX_ERR?u.executeSql(`SELECT name FROM sqlite_master WHERE type='table' AND name = ?`,[r.storeName],function(l,d){d.rows.length?o(l,f):rt(l,r,function(){l.executeSql(t,i,a,o);},o);},o):o(u,f);},o);}function Yt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT * FROM `+u.storeName+` WHERE key = ? LIMIT 1`,[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=u.serializer.deserialize(g)),a(g);},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function jt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT * FROM `+u.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var x=g.item(S),N=x.value;if(N&&(N=u.serializer.deserialize(N)),N=e(N,x.key,S+1),N!==void 0){a(N);return}}a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function nt(e,r,t,i){var a=this;e=O(e);var o=new p(function(u,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(){u(l);},function(x,N){f(N);});},function(S){if(S.code===S.QUOTA_ERR){if(i>0){u(nt.apply(a,[e,l,t,i-1]));return}f(S);}});});}).catch(f);});return _(o,t),o}function zt(e,r,t){return nt.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 u=t._dbInfo;u.db.transaction(function(f){J(f,u,`DELETE FROM `+u.storeName+` WHERE key = ?`,[e],function(){a();},function(l,d){o(d);});});}).catch(o);});return _(i,r),i}function Kt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,`DELETE FROM `+o.storeName,[],function(){i();},function(f,l){a(l);});});}).catch(a);});return _(t,e),t}function Xt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,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 Jt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,`SELECT key FROM `+u.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 Qt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,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 Zt(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 u=[],f=0;f<o.rows.length;f++)u.push(o.rows.item(f).name);r({db:e,storeNames:u});},function(a,o){t(o);});},function(i){t(i);});})}function er(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 u;e.name===t.name?u=i._dbInfo.db:u=openDatabase(e.name,``,``,0),e.storeName?o({db:u,storeNames:[e.storeName]}):o(Zt(u));}).then(function(o){return new p(function(u,f){o.db.transaction(function(l){function d(x){return new p(function(N,V){l.executeSql(`DROP TABLE IF EXISTS `+x,[],function(){N();},function(P,H){V(H);});})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){u();}).catch(function(x){f(x);});},function(l){f(l);});})}):a=p.reject(`Invalid arguments`),_(a,r),a}var tr={_driver:`webSQLStorage`,_initStorage:Ht,_support:kt(),iterate:jt,getItem:Yt,setItem:zt,removeItem:qt,clear:Kt,length:Xt,key:Jt,keys:Qt,dropInstance:er};function rr(){try{return typeof localStorage<`u`&&`setItem`in localStorage&&!!localStorage.setItem}catch{return false}}function ot(e,r){var t=e.name+`/`;return e.storeName!==r.storeName&&(t+=e.storeName+`/`),t}function nr(){var e=`_localforage_support_test`;try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return true}}function or(){return !nr()||localStorage.length>0}function ir(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=ot(e,r._defaultConfig),or()?(r._dbInfo=t,t.serializer=xe,p.resolve()):p.reject()}function ar(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 sr(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 ur(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,u=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(u),l++),E!==void 0)return E}}});return _(i,r),i}function cr(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 fr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],u=0;u<a;u++){var f=localStorage.key(u);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length));}return o});return _(t,e),t}function lr(e){var t=this.keys().then(function(i){return i.length});return _(t,e),t}function dr(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 mr(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(u,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),u(o);}catch(E){(E.name===`QuotaExceededError`||E.name===`NS_ERROR_DOM_QUOTA_REACHED`)&&f(E),f(E);}});})});return _(a,t),a}function gr(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(ot(e,i._defaultConfig)):o(e.name+`/`);}).then(function(o){for(var u=localStorage.length-1;u>=0;u--){var f=localStorage.key(u);f.indexOf(o)===0&&localStorage.removeItem(f);}}):a=p.reject(`Invalid arguments`),_(a,r),a}var pr={_driver:`localStorageWrapper`,_initStorage:ir,_support:rr(),iterate:ur,getItem:sr,setItem:mr,removeItem:dr,clear:ar,length:lr,key:cr,keys:fr,dropInstance:gr},hr=function(r,t){return r===t||typeof r==`number`&&typeof t==`number`&&isNaN(r)&&isNaN(t)},vr=function(r,t){for(var i=r.length,a=0;a<i;){if(hr(r[a],t))return true;a++;}return false},it=Array.isArray||function(e){return Object.prototype.toString.call(e)===`[object Array]`},ae={},at={},re={INDEXEDDB:Ut,WEBSQL:tr,LOCALSTORAGE:pr},yr=[re.INDEXEDDB._driver,re.WEBSQL._driver,re.LOCALSTORAGE._driver],me=[`dropInstance`],Ne=[`clear`,`getItem`,`iterate`,`key`,`keys`,`length`,`removeItem`,`setItem`].concat(me),Er={description:``,driver:yr.slice(),name:`localforage`,size:4980736,storeName:`keyvaluepairs`,version:1};function _r(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)&&(it(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 re)if(re.hasOwnProperty(t)){var i=re[t],a=i._driver;this[t]=a,ae[a]||this.defineDriver(i);}this._defaultConfig=Le({},Er),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(u,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=Ne.concat(`_initStorage`),E=0,S=g.length;E<S;E++){var x=g[E];if((!vr(me,x)||t[x])&&typeof t[x]!=`function`){f(d);return}}var V=function(){for(var se=function(Ir){return function(){var Sr=new Error(`Method `+Ir+` is not implemented by the current driver`),st=p.reject(Sr);return _(st,arguments[arguments.length-1]),st}},Oe=0,wr=me.length;Oe<wr;Oe++){var Pe=me[Oe];t[Pe]||(t[Pe]=se(Pe));}};V();var P=function(se){ae[l]&&console.info(`Redefining LocalForage driver: `+l),ae[l]=t,at[l]=se,u();};`_support`in t?t._support&&typeof t._support==`function`?t._support().then(P,f):P(!!t._support):P(!0);}catch(H){f(H);}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=ae[t]?p.resolve(ae[t]):p.reject(new Error(`Driver not found.`));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(xe);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;it(t)||(t=[t]);var u=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 x(){for(;S<E.length;){var N=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(N).then(l).catch(x)}f();var V=new Error(`No available storage method found.`);return o._driverSet=p.reject(V),o._driverSet}return x()}}return this._driverSet=(this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve()).then(function(){var E=u[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(u);})}).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 !!at[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 u=t[a];this.supports(u)&&i.push(u);}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=Ne.length;t<i;t++)_r(this,Ne[t]);},e.prototype.createInstance=function(t){return new e(t)},e})());},{3:3}]},{},[4])(4)});});var yt=v((vt,_e)=>{(function(s){var n={};n.VERSION=`1.6.1`;var h,c={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],M,p;for(p=1;p<m.length;p++)for(M in m[p])!(M in T)&&m[p].hasOwnProperty(M)&&(T[M]=m[p][M]);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 c)c.hasOwnProperty(T)&&c[T].setLevel(m);},n.getLevel=function(){return b.getLevel()},n.get=function(m){return c[m]||(c[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={},M=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):M(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,_),M(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 _e<`u`&&_e.exports?_e.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n);})(vt);});var Me=`14.1.0`;var Rr=Me.split(`-`)[0].split(`.`).slice(0,3).map(s=>s.padStart(2,`0`)).join(``),Gr=`WEB`,ft=`CooeeSDK`,Q=Me,Hr=parseInt(Rr,10);var Yr=[`collection`,`product`,`cart`],jr=[{identifier:`#flo-checkout-wrapper`,gateway:`Shopflow`},{identifier:`#fastrr-main-container`,gateway:`Shiprocket`},{identifier:`#gokwik-modal-wrapper`,gateway:`Gokwik`},{identifier:`#zecpe`,gateway:`Ecom 360`}],zr=[`View Item`,`View Cart`,`View Collection`],qr=[`CE Screen View`,`View Collection`,`View Item`,`View Cart`],Kr=`https://cdn.jsdelivr.net/npm/swiper@11`;function Jr(s){return `(\u23F0 took: ${Ve(s)})`}function Ve(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 Be(){return window.CooeeSDK.runtimeData}function en(){return Ve(Date.now()-Be().sdkLoadTime.getTime())}var Ue=x(dt());function ge(s){return Ue.default.createInstance({name:`lc`,storeName:s,driver:Ue.default.LOCALSTORAGE})}var ne=class{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 fe=class extends ne{static storeName=`usr`;static{this.storage=ge(this.storeName);}};var mt=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q}/dist`,ee={apiURL:`https://api.sdk.letscooee.com`,debug:false,mode:`production`,baseURL:mt,styleURL:`${mt}/styles.min.css`};var pe=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(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((c,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&c.push({[v]:n[v]}),c),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,c)=>(n[c]!==null&&n[c]!==void 0&&(h[c]=n[c]),h),{})}static stringify(n){return JSON.stringify(n,function(h,c){return c===void 0?null:c})}};var he=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;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.widgetCustomisation=n.widgetCustomisation,this}};var ve=class extends ne{static storeName=`ses`;static{this.storage=ge(this.storeName);}};var ye=class{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,c=`,`,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`+c)+(w[1]?v+w[1]:``)}};function Dn(s){try{return new URL(s)}catch{return}}function Rn(s){return !s||s===`null`||s===`undefined`}function Cn(s,n){let h=s.indexOf(n);return h===-1?false:(s.splice(h,1),true)}function An(s,n,h){return {[s]:Cr(n,h),[s+`_wo_currency`]:n}}function Cr(s,n){if(s==0&&n)return `Free`;let h=Be(),c=he.get(),v=h.shopCurrencyCode||c.currency,I=h.currencyCode;I||Y.warn(`Currency code is not set in RuntimeData`);let w=c.money?.format??h.moneyFormat,R;if(w&&v===I)R=ye.format(s*100,w);else {let b;try{b=new Intl.NumberFormat(gt(),{style:`currency`,currency:I||v,minimumFractionDigits:0,maximumFractionDigits:2});}catch(m){return ke(m,`format-currency`,{extra:{currentCurrency:I,shopCurrency:v}}),``}R=b.format(s),R=R.replace(`₹`,`Rs. `),c.money?.showCurrency&&I!==`INR`&&(R=R.concat(` ${I}`));}return R}function xn(s){let n=gt();try{return new Intl.NumberFormat(n,{notation:`compact`}).format(s)}catch(h){return ke(h,`format-number`,{extra:{lang:n,value:s}}),s.toString()}}function gt(){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 Ee;function pt(){if(Ee)return Ee;try{return Ee=Intl.DateTimeFormat().resolvedOptions().timeZone,Ee}catch{return ``}}function ht(s){document.readyState!==`loading`?s():document.addEventListener(`DOMContentLoaded`,s);}function Nn(s){let n=document.createElement(`span`);n.id=`snackbar`,n.innerText=s,document.body.appendChild(n),n.className=`show`,setTimeout(()=>{n.classList.remove(`show`),document.body.removeChild(n);},5e3);}async function Ar(s,n=7,h=document){let c=1,v=document.querySelectorAll(`nonexistent-tag`);for(;c<=n;){let I=Math.min(50*2**c,1e3);if(c>1&&await pe.sleep(I),v=h.querySelectorAll(s),v.length)return Y.verbose(`Attempt ${c}: ${v.length} elements found with ${s}`),v;Y.verbose(`Attempt ${c}: Elements not found with ${s}. Will retry after ${I}ms.`),c++;}return Y.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function Ln(s,n=10,h=document){return (await Ar(s,n,h)).item(0)}async function xr(s){let[n,h,c]=await Promise.all([fe.get(`did`),ve.get(`id`,``),fe.get(`sessionNumber`,1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${c}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function On(s){let n=await xr(s);return Object.entries(n).map(([h,c])=>({key:h,value:c.toString()}))}function Pn(s,n,h,c=false){Object.defineProperty(s,n,{enumerable:false,configurable:false,writable:c,value:h});}function Mn(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`}}function Vn(s,n){return !n?s:n+s}var W=x(yt());var Y=class{static debuggerEl;static infoLogs=[];static log(...n){W.default.info(...n);}static verbose(...n){W.default.debug(...n);}static error(...n){W.default.error(...n);}static warn(...n){W.default.warn(...n);}static info(...n){W.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(` `)}),this.addToDebugger();}static trace(...n){W.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 Wn(s=ft){W.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q}):`);}}),Nr()&&(localStorage.cooeeLogLevel=`TRACE`),localStorage.cooeeLogLevel?W.default.setLevel(W.default[localStorage.cooeeLogLevel]):W.default.setLevel(W.default.OFF);}function Nr(){let s=Et();return s===`1`||s===`on`}function Et(){return new URL(location.href).searchParams?.get(`cooee-debug`)}function $n(){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}`),console.groupEnd(),Y.info(`SDK v${Q} loaded`);}function Gn(){let s=localStorage.getItem(`cooeeDebugTill`),n=Et();if(n===`1`||n===`on`){let h=Or();s||(s=h.toString(),localStorage.setItem(`cooeeDebugTill`,s));}n===`on`?sessionStorage.cooeeDebug=`1`:n===`off`&&sessionStorage.removeItem(`cooeeDebug`),sessionStorage.cooeeDebug&&Lr(),s&&new Date(+s)<new Date&&localStorage.removeItem(`cooeeDebugTill`);}function Lr(){let s=document.createElement(`cooee-debugger`);ht(()=>{document.body.appendChild(s);});}function Or(){return new Date().getTime()+360*60*1e3}var _t=5,Pr=500,oe=class 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 jn(s,n){let h=Date.now(),c;try{c=await Mr(s,n);}catch{}let v=c?new Request(c.url,{method:n?.method||`GET`}):new Request(s,n);if(!c||!c.ok){let m=`Failed to fetch`;c?.statusText&&(m+=`: ${c.statusText}`);let T=new oe(m);throw T.request=v,T.response=c?.clone(),T.status=c?.status,T.requestBody=n?.body,T.responseText=await bt(c),T}let I,w=(c.headers.get(`content-type`)||``).toLowerCase(),R=c.headers.get(`content-length`),b=n?.method?.toUpperCase()||`GET`;if(c.status===204||c.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 c.clone().json();}catch(m){let T=new oe(`Failed to parse JSON response: ${m?.message}`);throw T.request=v,T.response=c.clone(),T.status=c.status,T.requestBody=n?.body,T.responseText=await bt(c),T}else w.includes(`text/`)||w.includes(`image/svg+xml`)?I=await c.text():I=await c.arrayBuffer();return {data:I,status:c.status,statusText:c.statusText,headers:c.headers,timeTakenMs:Date.now()-h,options:n,request:v}}async function Mr(s,n){let h=null,c;for(let v=0;v<=_t;v++){try{if(c=await fetch(s,n),c.ok||c.status>=400&&c.status<500)return c;h=new Error(`Server error: ${c.status} ${c.statusText}`);}catch(I){h=I instanceof Error?I:new Error(String(I));}if(v<_t){let I=Math.pow(2,v)*Pr;Y.info(`Request to ${s} failed. Retrying in ${I}ms...`),await new Promise(w=>setTimeout(w,I));}}if(c&&!c.ok)return c;throw h||new Error(`Request failed after retries`)}async function bt(s){if(s){try{return s=s.clone(),await s.json()}catch{}try{return await s.text()}catch{}}}var be={},Te,we,wt,It,Tt;async function St(){if(!we)return Tt??=Vr(),Tt}async function Vr(){let{BrowserClient:s,Scope:n,defaultStackParser:h,getDefaultIntegrations:c,makeFetchTransport:v}=await import('./esm-DKhFdjmg-CkLM_H-o.js');It=n;we=new s({dsn:`https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520`,transport:v,stackParser:h,integrations:c({}).filter(w=>![`BrowserApiErrors`,`Breadcrumbs`,`GlobalHandlers`].includes(w.name)),environment:ee.mode,release:`web-sdk@${Q}`,debug:ee.debug,sampleRate:.5}),we.init();}function ke(s,n,h){Y.error(`${n}:`,s),St().then(()=>{let c=Dt(h);if(c.setTag(`operation`,n),s instanceof oe){Br(c,s,n);return}c.captureException(s);});}function Zn(s,n,h){St().then(()=>{Dt(h).captureMessage(s,n??`error`);});}function Br(s,n,h){if(Fr(s,n),n.response){let c=n.response,v=n.responseText;s.setTag(`error.message`,n.message),c.status!=null&&s.setTag(`http.status_code`,c.status),c.statusText&&s.setTag(`http.status_text`,c.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:c.statusText,responseType:c.type,redirected:c.redirected,responseUrl:c.url,originalError:n.message}),s.captureMessage(`${h} failed with ${c.status}`,`error`);return}if(n.request){s.captureMessage(`No response was received for ${h}`,`error`);return}}function Fr(s,n){let h=n.request;if(!h)return;s.setExtras({body:n.requestBody,headers:h.headers,method:h.method,url:h.url});let c=h.headers?.get(`Cooee-Retry-Attempt`);c!==null&&s.setTag(`retry.attempt`,c);}function eo(s){wt=s;}function to(s,n){be[s]=r(r({},be[s]),n);}function ro(s){Te=r(r({},Te),s);}function Dt(s){s??={};let{extra:n,tags:h}=s,c=new It;if(c.setClient(we),c.setUser(wt),s.triggerContext&&!s.engagementTrigger&&(s.engagementTrigger=s.triggerContext.triggerData),s.engagementTrigger){let v=s.engagementTrigger;c.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&&c.setExtras(n),h&&c.setTags(h),Te&&c.setTags(Te),Object.keys(be).forEach(v=>{c.setContext(v,be[v]);}),c.setTag(`language`,navigator.language),c.setTag(`timezone`,pt()),Ur(c),c}function Ur(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));}
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}`),console.groupEnd(),Y.info(`SDK v${Q} loaded`);}function Gn(){let s=localStorage.getItem(`cooeeDebugTill`),n=Et();if(n===`1`||n===`on`){let h=Or();s||(s=h.toString(),localStorage.setItem(`cooeeDebugTill`,s));}n===`on`?sessionStorage.cooeeDebug=`1`:n===`off`&&sessionStorage.removeItem(`cooeeDebug`),sessionStorage.cooeeDebug&&Lr(),s&&new Date(+s)<new Date&&localStorage.removeItem(`cooeeDebugTill`);}function Lr(){let s=document.createElement(`cooee-debugger`);ht(()=>{document.body.appendChild(s);});}function Or(){return new Date().getTime()+360*60*1e3}var _t=5,Pr=500,oe=class 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 jn(s,n){let h=Date.now(),c;try{c=await Mr(s,n);}catch{}let v=c?new Request(c.url,{method:n?.method||`GET`}):new Request(s,n);if(!c||!c.ok){let m=`Failed to fetch`;c?.statusText&&(m+=`: ${c.statusText}`);let T=new oe(m);throw T.request=v,T.response=c?.clone(),T.status=c?.status,T.requestBody=n?.body,T.responseText=await bt(c),T}let I,w=(c.headers.get(`content-type`)||``).toLowerCase(),R=c.headers.get(`content-length`),b=n?.method?.toUpperCase()||`GET`;if(c.status===204||c.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 c.clone().json();}catch(m){let T=new oe(`Failed to parse JSON response: ${m?.message}`);throw T.request=v,T.response=c.clone(),T.status=c.status,T.requestBody=n?.body,T.responseText=await bt(c),T}else w.includes(`text/`)||w.includes(`image/svg+xml`)?I=await c.text():I=await c.arrayBuffer();return {data:I,status:c.status,statusText:c.statusText,headers:c.headers,timeTakenMs:Date.now()-h,options:n,request:v}}async function Mr(s,n){let h=null,c;for(let v=0;v<=_t;v++){try{if(c=await fetch(s,n),c.ok||c.status>=400&&c.status<500)return c;h=new Error(`Server error: ${c.status} ${c.statusText}`);}catch(I){h=I instanceof Error?I:new Error(String(I));}if(v<_t){let I=Math.pow(2,v)*Pr;Y.info(`Request to ${s} failed. Retrying in ${I}ms...`),await new Promise(w=>setTimeout(w,I));}}if(c&&!c.ok)return c;throw h||new Error(`Request failed after retries`)}async function bt(s){if(s){try{return s=s.clone(),await s.json()}catch{}try{return await s.text()}catch{}}}var be={},Te,we,wt,It,Tt;async function St(){if(!we)return Tt??=Vr(),Tt}async function Vr(){let{BrowserClient:s,Scope:n,defaultStackParser:h,getDefaultIntegrations:c,makeFetchTransport:v}=await import('./esm-DKhFdjmg-CMFfqDWE.js');It=n;we=new s({dsn:`https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520`,transport:v,stackParser:h,integrations:c({}).filter(w=>![`BrowserApiErrors`,`Breadcrumbs`,`GlobalHandlers`].includes(w.name)),environment:ee.mode,release:`web-sdk@${Q}`,debug:ee.debug,sampleRate:.5}),we.init();}function ke(s,n,h){Y.error(`${n}:`,s),St().then(()=>{let c=Dt(h);if(c.setTag(`operation`,n),s instanceof oe){Br(c,s,n);return}c.captureException(s);});}function Zn(s,n,h){St().then(()=>{Dt(h).captureMessage(s,n??`error`);});}function Br(s,n,h){if(Fr(s,n),n.response){let c=n.response,v=n.responseText;s.setTag(`error.message`,n.message),c.status!=null&&s.setTag(`http.status_code`,c.status),c.statusText&&s.setTag(`http.status_text`,c.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:c.statusText,responseType:c.type,redirected:c.redirected,responseUrl:c.url,originalError:n.message}),s.captureMessage(`${h} failed with ${c.status}`,`error`);return}if(n.request){s.captureMessage(`No response was received for ${h}`,`error`);return}}function Fr(s,n){let h=n.request;if(!h)return;s.setExtras({body:n.requestBody,headers:h.headers,method:h.method,url:h.url});let c=h.headers?.get(`Cooee-Retry-Attempt`);c!==null&&s.setTag(`retry.attempt`,c);}function eo(s){wt=s;}function to(s,n){be[s]=r(r({},be[s]),n);}function ro(s){Te=r(r({},Te),s);}function Dt(s){s??={};let{extra:n,tags:h}=s,c=new It;if(c.setClient(we),c.setUser(wt),s.triggerContext&&!s.engagementTrigger&&(s.engagementTrigger=s.triggerContext.triggerData),s.engagementTrigger){let v=s.engagementTrigger;c.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&&c.setExtras(n),h&&c.setTags(h),Te&&c.setTags(Te),Object.keys(be).forEach(v=>{c.setContext(v,be[v]);}),c.setTag(`language`,navigator.language),c.setTag(`timezone`,pt()),Ur(c),c}function Ur(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));}
11
11
 
12
12
  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){Y.info(`\u{1F4E6} API Resource Metrics for ${i}: Not available`);return}Y.info(`📦 ═══════════ API Resource Metrics ═══════════`),Y.info(`URL: ${i}`),Y.info(`Duration: ${Ve(e.duration)}`);let n=e.transferSize===0;if(Y.info(`Served from: ${n?`💾 Cache (disk/memory)`:`🌐 Network`}`),!n){Y.info(`Transfer size: ${d(e.transferSize)}`),Y.info(`Encoded size: ${d(e.encodedBodySize)}`),Y.info(`Decoded size: ${d(e.decodedBodySize)}`);let c=(1-e.encodedBodySize/e.decodedBodySize)*100;c>0&&Y.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;Y.info(`Timing breakdown (${Ve(e.duration)} total):`),r>0&&Y.info(`${s}Redirect: ${Ve(r)}`),f>0&&Y.info(`${s}Queued: ${Ve(f)}`),g>0&&Y.info(`${s}Stalled: ${Ve(g)}`),a>0&&Y.info(`${s}DNS lookup: ${Ve(a)}`),u>0&&Y.info(`${s}TCP connect: ${Ve(u)}`),m>0&&Y.info(`${s}SSL handshake: ${Ve(m)}`),Y.info(`${s}Server waiting (TTFB): ${Ve(T)}`),Y.info(`${s}Content download: ${Ve(P)}`);let $=e.serverTiming;if($?.length){Y.info(`Server-Timing:`);for(let c of $){let p=c.description||c.name;c.duration>0?Y.info(`${s}${p}: ${Ve(c.duration)}`):Y.info(`${s}${p}: ${c.duration}`);}}Y.info(`📦 ═════════════════════════════════════════════`);}function B(){let e=R();return e.length?e.map(n=>JSON.stringify(n.toJSON())).join(`
13
13
  `):``}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});}
@@ -1,6 +1,6 @@
1
- import { B, N as Nn } from './chunk-DbQ39eGC-BuuE3sKA.js';
1
+ import { B, N as Nn } from './chunk-ekBE5rdY-CTOrJkKT.js';
2
2
  import { M } from './main.min.js';
3
- import { $ as $b, o as of, a, b as bE, B as Bo, w as wD, I as ID, V as Vo, M as Mf, u as uv, c as ud, _ as _D, i as iD, g as ge, d as Iv, X as Xa, W as Wf, T as Tv, e as _f, f as _v, Y as Yg } from './widgets-D_OSh97N-Bpf2Pdkf.js';
3
+ import { $ as $b, o as of, a, b as bE, B as Bo, w as wD, I as ID, V as Vo, M as Mf, u as uv, c as ud, _ as _D, i as iD, g as ge, d as Iv, X as Xa, W as Wf, T as Tv, e as _f, f as _v, Y as Yg } from './widgets-BIWIerG5-Cm-yzVcy.js';
4
4
 
5
5
  function P(i,t){if(i&1&&(Bo(0,`li`)(1,`span`,1),uv(2),Iv(3,`date`),Vo(),uv(4,`\xA0 `),Xa(5,`span`,2),Iv(6,`safeHtml`),Vo()),i&2){let e=t.$implicit;ud(2),Wf(Tv(3,2,e.time,`hh:mm:ss a`)),ud(3),_f(`innerHTML`,_v(6,5,e.message),Yg);}}var _=class i{logs=$b.required();constructor(){}async shareLogs(){let t=this.logs().map(o=>`[${new Date(o.time).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`})}] ${o.message}`).join(`
6
6
  `);t=t.replaceAll(`\xA0`,` `);let e=B();if(e&&(t+=`
@@ -1,4 +1,4 @@
1
- import { r, s, u, w } from './chunk-DbQ39eGC-BuuE3sKA.js';
1
+ import { r, s, u, w } from './chunk-ekBE5rdY-CTOrJkKT.js';
2
2
 
3
3
  var T=typeof __SENTRY_DEBUG__>`u`||__SENTRY_DEBUG__;var x=globalThis;var ut=`9.42.0`;function Ve(){return fn(x),x}function fn(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||ut,t[ut]=t[ut]||{}}function Qt(e,t,n=x){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[ut]=r[ut]||{};return o[e]||(o[e]=t())}var Mn=[`debug`,`info`,`warn`,`error`,`log`,`assert`,`trace`],tg=`Sentry Logger `,ar={};function Be(e){if(!(`console`in x))return e();let t=x.console,n={},r=Object.keys(ar);r.forEach(o=>{let i=ar[o];n[o]=t[o],t[o]=i;});try{return e()}finally{r.forEach(o=>{t[o]=n[o];});}}function ng(){ma().enabled=true;}function rg(){ma().enabled=false;}function Tl(){return ma().enabled}function og(...e){pa(`log`,...e);}function ig(...e){pa(`warn`,...e);}function sg(...e){pa(`error`,...e);}function pa(e,...t){T&&Tl()&&Be(()=>{x.console[e](`${tg}[${e}]:`,...t);});}function ma(){return T?Qt(`loggerSettings`,()=>({enabled:false})):{enabled:false}}var g={enable:ng,disable:rg,isEnabled:Tl,log:og,warn:ig,error:sg};var Il=/\(error: (.*)\)/,vl=/captureMessage|captureException/;function ti(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return (n,r=0,o=0)=>{let i=[],s=n.split(`
4
4
  `);for(let a=r;a<s.length;a++){let c=s[a];if(c.length>1024)continue;let u=Il.test(c)?c.replace(Il,`$1`):c;if(!u.match(/\S*Error: /)){for(let d of t){let l=d(u);if(l){i.push(l);break}}if(i.length>=50+o)break}}return wl(i.slice(o))}}function wl(e){if(!e.length)return [];let t=Array.from(e);return /sentryWrapped/.test(ei(t).function||``)&&t.pop(),t.reverse(),vl.test(ei(t).function||``)&&(t.pop(),vl.test(ei(t).function||``)&&t.pop()),t.slice(0,50).map(n=>s(r({},n),{filename:n.filename||ei(t).filename,function:n.function||`?`}))}function ei(e){return e[e.length-1]||{}}var ha=`<anonymous>`;function tt(e){try{return !e||typeof e!=`function`?ha:e.name||ha}catch{return ha}}function cr(e){let t=e.exception;if(t){let n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames);}),n}catch{return}}}var ni={},Rl={};function He(e,t){ni[e]=ni[e]||[],ni[e].push(t);}function $e(e,t){if(!Rl[e]){Rl[e]=true;try{t();}catch(n){T&&g.error(`Error while instrumenting ${e}`,n);}}}function xe(e,t){let n=e&&ni[e];if(n)for(let r of n)try{r(t);}catch(o){T&&g.error(`Error while triggering instrumentation handler.
package/dist/main.min.js CHANGED
@@ -1,4 +1,4 @@
1
- import { s, r, A as An$1, h as he$3, K as Kr$3, e as ee$4, x as x$2, Y as Y$1, C as Cr$2, v as v$1, k as ke$2, y as yt$1, f as fe$4, L as Ln$1, n as ne$2, g as ge$3, c as en, V as Vn$1, J as Jr$3, d as Cn, a as Be$3, G as Gn$1, P as Pn, R as Rn, i as Yr$3, l as xn, z as zr$3, m as ht$2, p as pe$4, M as Mn$1, o as oe$5, Q as Q$4, H as Hr$3, q as Gr$3, b as jn$1, t as to, E as eo, D as Dn, Z as Zn$1, F as Ar$1, I as ve$2, N as Nn$2, O as On$1, S as ro, T as qr$3, U as xr$1, W as z$3, X as Ve$4, _ as d$3, $ as Wn$1, a0 as $n$1, a1 as Nr$2 } from './chunk-DbQ39eGC-BuuE3sKA.js';
1
+ import { s, r, A as An$1, h as he$3, K as Kr$3, e as ee$4, x as x$2, Y as Y$1, C as Cr$2, v as v$1, k as ke$2, y as yt$1, f as fe$4, L as Ln$1, n as ne$2, g as ge$3, c as en, V as Vn$1, J as Jr$3, d as Cn, a as Be$3, G as Gn$1, P as Pn, R as Rn, i as Yr$3, l as xn, z as zr$3, m as ht$2, p as pe$4, M as Mn$1, o as oe$5, Q as Q$4, H as Hr$3, q as Gr$3, b as jn$1, t as to, E as eo, D as Dn, Z as Zn$1, F as Ar$1, I as ve$2, N as Nn$2, O as On$1, S as ro, T as qr$3, U as xr$1, W as z$3, X as Ve$4, _ as d$3, $ as Wn$1, a0 as $n$1, a1 as Nr$2 } from './chunk-ekBE5rdY-CTOrJkKT.js';
2
2
 
3
3
  var o=`a-f\\d`,I$1=`#?[${o}]{3}[${o}]?`,S$3=`#?[${o}]{6}([${o}]{2})?`,R$1=new RegExp(`[^#${o}]`,`gi`),A$3=new RegExp(`^${I$1}$|^${S$3}$`,`i`);function c(e,r={}){if(typeof e!=`string`||R$1.test(e)||!A$3.test(e))throw new TypeError(`Expected a valid hex string`);e=e.replace(/^#/,``);let t=1;e.length===8&&(t=Number.parseInt(e.slice(6,8),16)/255,e=e.slice(0,6)),e.length===4&&(t=Number.parseInt(e.slice(3,4).repeat(2),16)/255,e=e.slice(0,3)),e.length===3&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]);let l=Number.parseInt(e,16),u=l>>16,p=l>>8&255,m=l&255,s=typeof r.alpha==`number`?r.alpha:t;if(r.format===`array`)return [u,p,m,s];if(r.format===`css`)return `rgb(${u} ${p} ${m}${s===1?``:` / ${Number((s*100).toFixed(2))}%`})`;return {red:u,green:p,blue:m,alpha:s}}var n$1=class n{h;a=100;g;constructor(r){r??={},this.h=r.h,this.a=r.a,this.g=r.g;}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return ``;try{return c(this.hex,{format:`css`,alpha:this.getAlpha()})}catch(r){return console.error(`Invalid hex`,r),`#000000`}}getAlpha(){return (this.a??100)/100}};var h$3=class h{s;g;i;constructor(r){r.s&&(this.s=new n$1(r.s)),r.g&&(this.g=new i(r.g)),this.i=r.i;}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}};var a$2=class a{s;r;w;c;constructor(r){this.s=r.s,this.r=r.r,this.w=r.w,r.c&&(this.c=new n$1(r.c));}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return w$2[this.s??1]}},w$2=(t=>(t[t.SOLID=1]=`SOLID`,t[t.DASHED=2]=`DASHED`,t))(w$2||{});var i=class e{static DEFAULT_FALLBACK=new n$1({h:`#000000`,a:50});r;c;fb;constructor(r){this.r=r.r,r.c&&(this.c=new n$1(r.c)),r.fb&&(this.fb=new n$1(r.fb));}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??e.DEFAULT_FALLBACK}};var g$2=class g{blur;spr;clr;x;y;constructor(r){r=r??{},this.blur=r.blur??0,this.spr=r.spr??0,this.x=r.x??0,this.y=r.y??0,this.clr=new n$1(r.clr);}getStyle(r){return `${this.x*r}px ${this.y*r}px ${this.blur*r}px ${this.spr*r}px ${this.clr.rgba}`}};var b$2=class b{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(r){r=r??{},this.pl=r.pl??0,this.pr=r.pr??0,this.pt=r.pt??0,this.pb=r.pb??0,this.ml=r.ml??0,this.mr=r.mr??0,this.mt=r.mt??0,this.mb=r.mb??0,this.cent=r.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 f=class{rot;constructor(r){r?.rot&&(this.rot=r.rot);}get rotate(){return this.rot}};var y$1=class y{enabled;type;color;constructor(r){r??={},this.enabled=r.enabled,this.type=r.type,this.color=new n$1(r.color);}},d$2=class d{size;enabled;color;constructor(r){r??={},this.enabled=r.enabled,this.size=r.size,this.color=new n$1(r.color);}},x$1=class x{enabled;delay;constructor(r={}){this.enabled=r.enabled,r.delay&&(this.delay=r.delay>100?r.delay:r.delay*1e3);}},C$4=class C{navigation;pagination;autoplay;loop;maxInRow;gap;maxInRowSm;gapSm;speed;marquee;constructor(r){r??={},this.navigation=new d$2(r.navigation),this.pagination=new y$1(r.pagination),this.autoplay=new x$1(r.autoplay),this.loop=r.loop??false,this.maxInRow=r.maxInRow??4,this.gap=r.gap??0,this.maxInRowSm=r.maxInRowSm??this.maxInRow,this.gapSm=r.gapSm??this.gap,r.speed&&(this.speed=r.speed*1e3),this.marquee=r.marquee;}};
4
4
 
@@ -72,17 +72,17 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
72
72
  style="background-color: ${e.pagination.color?.rgba};">
73
73
  </span>
74
74
  `},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 i=new window.CooeeSDK.Swiper(r,t);return r.style.setProperty(`--swiper-navigation-size`,`${e.navigation.size}px`),i}function Si(r,e,t){let i={color:r.navigation.color?.rgba};return r.pagination.enabled&&(i.transform=`translateY(-25%)`),h(`div`,{class:`swiper-container`,ref:e,style:`max-width: 100%`,children:[h(`div`,{class:`swiper-wrapper`,children:t()}),r.navigation.enabled&&h(`div`,{class:`swiper-button-next`,style:i,children:h(`span`,{})}),r.navigation.enabled&&h(`div`,{class:`swiper-button-prev`,style:i,children:h(`span`,{})}),r.pagination.enabled&&h(`div`,{className:`swiper-pagination`,style:{bottom:0,top:`unset`,position:`relative`,color:r.pagination.color?.rgba}})]})}var Qt=class extends _{componentDidMount(){W$2(()=>{this.setState(()=>({checked:this.props.item.selected.value}));});}render(){return h(`div`,{style:this.getCompiledStyles(),className:`lc-checkbox`,children:h(`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 H;return e.textAlign=t.alignment,e.justifyContent=t.alignment,e}getComponentStyles(){return s(r({},this.getTypoStyles()),{display:`flex`})}};var _e=class extends _{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 h(`img`,{onClick:this.customOnClick.bind(this),className:`lc-image`,alt:e?.name||`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 ke=class extends _{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return h(`div`,{style:this.getCompiledStyles(),class:`lc-flexbox`,children:h(Ge,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})})}getComponentStyles(){let e=this.mediaStyle.flex??new St,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 Zt=class extends ke{render(){if(!(this.props.element.hide||!this.matchWhenCondition(this.props.element.when)))return h(`div`,{style:this.getCompiledStyles(),class:`lc-flexbox`,children:h(_t,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.props.noLinks})})}};var er=class extends _{render(){return h(`select`,{style:this.getCompiledStyles(),value:this.props.selectedVariant.selectedSellingPlan.value?.mID??``,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:`lc-dropdown`,children:this.createSelectItems()})}componentDidMount(){W$2(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:false}));});}getTypoStyles(){let e={},t=this.mediaStyle.typo??new H;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+`px`,e.lineHeight=t.lh,e.fontFamily=`inherit`,e.textAlign=t.alignment,e.fontWeight=t.fw,this.stylesConverter.getColourStyles(t.tc,`color`,e),e.boxShadow=`none`,e}getComponentStyles(){let e={};return this.props.selectedVariant.sellingPlans?.length||(e.visibility=`hidden`),r(r({},e),this.getTypoStyles())}createSelectItems(){let e=[],t=this.props.selectedVariant;if(!t.sellingPlans?.length)return [];this.props.triggerContext.triggerData.skipSubscribedItems?t.selectedSellingPlan.value||(t.sellingPlans[0].isSelected=true,t.changeSellingPlan(t.sellingPlans[0])):e.push(h(`option`,{value:``,selected:!t.selectedSellingPlan,children:`One time purchase`}));for(let i of t.sellingPlans??[])e.push(h(`option`,{value:i.mID,selected:i.isSelected,children:i.name}));return e}onChange(e){let t=e.target.value;t?this.props.selectedVariant.selectedSellingPlan.value=this.props.selectedVariant.sellingPlans.find(i=>i.mID===t):this.props.selectedVariant.selectedSellingPlan.value=void 0;}};var ja=new RegExp(`fill="#[a-zA-Z0-9]+"`),tr=class extends _{constructor(){super();}render(){let e=this.getCompiledStyles(),t=this.getRating();return t||(e.display=`none`,t=``),h(`div`,{style:e,className:`lc-star-rating`,dangerouslySetInnerHTML:{__html:t}})}getRating(){let e={size:this.props.element.iconSize,color:this.props.element.c.hex},t=qe$1(this.props.element.fullStar,{svg:e},this.props.triggerContext),i=qe$1(this.props.element.halfStart,{svg:e},this.props.triggerContext),o=this.props.review;if(!o?.rating)return ``;let n=``;if(this.props.element.showSingleStar)n=t;else {let s=5,c=`${o.rating}`.split(`.`);for(let m=0;m<+c[0];m++)n+=t,s--;c[1]&&(n+=i,s--);for(let m=0;m<s;m++)n+=t.replace(ja,`fill="#f1f1f1"`);}return n}getComponentStyles(){return {display:`flex`,alignItems:`center`}}};var rr=class extends _{render(){return h(`select`,{style:this.getCompiledStyles(),value:this.props.item.selectedOrFirstVariant.value.mID,onChange:this.onChange.bind(this),disabled:this.state.disabled,className:`lc-dropdown`,children:this.createSelectItems()})}componentDidMount(){W$2(()=>{this.setState(()=>({disabled:this.props.triggerContext.triggerData.isBundle()?!this.props.item.selected.value:false}));});}getTypoStyles(){let e={},t=this.mediaStyle.typo??new H;return e.letterSpacing=t.letterSpacing,e.fontSize=t.fs+`px`,e.lineHeight=t.lh,e.fontFamily=`inherit`,e.textAlign=t.alignment,e.fontWeight=t.fw,this.stylesConverter.getColourStyles(t.tc,`color`,e),e.boxShadow=`none`,e}getComponentStyles(){let e={};return this.props.item.vars?.length===1&&this.props.item.vars[0].name===`Default Title`&&(e.visibility=`hidden`),r(r({},e),this.getTypoStyles())}createSelectItems(){let e=[];for(let t of this.props.item.vars)e.push(h(`option`,{value:t.mID,disabled:!t.isAvailable,children:t.name}));return e}onChange(e){let t=e.target.value,i=this.props.item.vars.find(o=>o.mID===t);this.props.item.setSelectedVariant(i);}};var ss=()=>{let r=window.ShopifyAnalytics?.meta??{},e=r.selectedVariantId;if(e)return e;if(r.product?.variants?.length>0)return r.product.variants[0].id},vo=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 _t=class extends _{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:h(Zt,{element:t,triggerContext:this.props.triggerContext,elements:t.elems,item:this.props.item,noLinks:this.props.noLinks})}if(e.t===6)return this.props.triggerContext.triggerData.isBundle()?h(Qt,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):void 0;if(e.t===13){let t=e,i=this.props.item,o=vo(i.variantImage??i.firstImageURL),n=vo(i.variantSecondaryImage??i.secondaryImageURL);t.lg=t.sm={src:o,name:i.name,secondarySrc:n};let s=h(_e,{element:t,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?s:h(`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.showChips?h(`cooee-product-options-picker`,{item:this.props.item}):h(rr,{element:t,item:this.props.item,triggerContext:this.props.triggerContext})}return e.t===16?h(er,{element:e,selectedVariant:this.props.item.selectedOrFirstVariant.value,item:this.props.item,triggerContext:this.props.triggerContext}):e.t===19?h(tr,{element:e,triggerContext:this.props.triggerContext,review:this.props.item.reviews}):e.t===18||e.t===3?h(st,{element:e,item:this.props.item,triggerContext:this.props.triggerContext}):h(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=h(oe,{element:e,onClick:this.customOnClick.bind(this),triggerContext:this.props.triggerContext});return this.props.noLinks?t:h(`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 i=t.detail.variantID;this.props.item.setSelectedVariantByID(i);});}};var at=class extends _{productElement;constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`}));}render(){if(this.productElement=new He(Ve$2(this.props.element,this.getProductData(),this.props.triggerContext)),!(this.productElement.hide||!this.matchWhenCondition(this.productElement.when)))return h(`div`,{style:r({},this.getCompiledStyles()),class:`lc-single-product`,children:h(_t,{element:this.productElement,elements:this.productElement.elems,triggerContext:this.props.triggerContext,item:this.props.item,noLinks:this.productElement.noLinks})})}getComponentStyles(){return {flexShrink:0}}getProductData(){if(!this.props.item)return {};let e=this.props.item,t=e.selectedOrFirstVariant.value,i=e.getTemplateVariables();i.product.quantity=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(this.props.item.quantity):this.props.item.quantity;let o=this.props.triggerContext.triggerData.discount?.type===ce.BXGY;return !t.hasEffectivePrice()&&o&&(i.product=s(r(r({},i.product),An$1(`effective_price`,t.effectivePrice.value)),{price:``})),i.variant.quantity=this.props.triggerContext.hasManipulatedProductQuantity()?this.props.triggerContext.getManipulatedQuantity(t.quantity):t.quantity,{product:i.product,variant:i.variant,svg:{color:`{{ svg.color }}`,size:`{{ svg.size }}`}}}};var ir=class extends _{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,t){super(e,t),this.configuration=M$1()?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$1().then(()=>{this.swiperInstance=Ei(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 i=n=>{this.swiperRef=n;},o=()=>e?.map(n=>h(`div`,{class:`swiper-slide`,children:this.getProductFragment(n)}));t=h(`div`,{style:s(r({},this.getCompiledStyles()),{display:`block`}),class:`lc-product-swiper-list`,children:Si(this.configuration,i,o)});}else t=h(`div`,{style:this.getCompiledStyles(),class:`lc-product-list`,children:e?.map((i,o)=>this.getProductFragment(i,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 i=this.props.triggerContext.triggerData,o=i.items.length,n;i.isBundle()?n=this.props.element.prod.symbol?.hide!==true?o*2-1:o:n=this.props.element.conf[this.deviceTypeKey].maxInRow,t.gridTemplateColumns=`repeat(${n}, auto)`;}}return t}getProductFragment(e,t=false){return h(j$2,{children:[h(at,{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&&h(`div`,{style:{display:`flex`,alignItems:`center`,justifyContent:`center`},children:h(oe,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var or=class extends _{swiperRef=null;swiperInstance=null;constructor(e,t){super(e,t);}componentDidMount(){Vi$1().then(()=>{this.swiperInstance=Ei(this.swiperRef,this.props.element.conf);});}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy();}render(){let e=this.props.element,t=o=>{this.swiperRef=o;},i=()=>{let o=e.values?.map(c=>h(`div`,{class:`swiper-slide`,onClick:m=>this.onClick(m,{clickAction:this.getClickAction(c)}),children:this.renderElement(c)}));if(!o?.length)return [];let n=e.conf,s=o.length;if(n.marquee&&s<=Number(n.maxInRow)){let c=Number(n.maxInRow)-s+1;for(let m=0;m<c;m++)o.push(o[m%s]);}return o};return Si(e.conf,t,i)}getComponentStyles(){return {}}renderElement(e){let t=this.valueAddedSlide(this.props.element.slide,e);switch(t?.t){case 1:return h(_e,{element:t,triggerContext:this.props.triggerContext});case 4:return h(ke,{elements:t.elems,element:t,triggerContext:this.props.triggerContext});default:Y$1.warn(`Unknown slide type for carousal`);}}valueAddedSlide(e,t){let i=Ve$2(e,{form:t},this.props.triggerContext);return ie.getParsedElement(i)}getClickAction(e){return Ve$2(this.props.element.clc??{},{form:e},this.props.triggerContext)}};var Ge=class extends _{constructor(e,t){super(e,t),this.setState(()=>({decoration:`unset`})),W$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 h(ke,{element:t,triggerContext:this.props.triggerContext,elements:t.elems})}if(e.t===61)return h(Jt,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?h(st,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return h(oe,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return h(_e,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return h(ir,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return h(at,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return h(or,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return {}}};var nr=class extends _{clickAction;isClickable;constructor(e,t){super(e,t),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===He$3.GO_TO_URL&&!!Dn(this.clickAction.gu?.u)||this.clickAction?.at===He$3.OPEN_CART||this.clickAction?.at===He$3.INITIATE_CHECKOUT;}componentDidMount(){W$2(()=>{let e=this.props.triggerContext.triggerData,t=this.props.triggerContext.selectedItems;e.calculateDiscountData(t,this.props.triggerContext.shouldGiveFBTDiscount);});}render(){return h(j$2,{children:[h(`div`,{style:this.getCompiledStyles(),class:`lc-container`,onClick:e=>{this.onClick(e,{clickAction:this.clickAction});},children:h(Ge,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id===`preview`&&h(`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 X=class r$9{constructor(e){this.engagementTrigger=e;this.triggerContext=new Fe(new Date,this.engagementTrigger);}static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;triggerContext;observers=[];renderedCount=0;scrollSubscription;isExclusionWithBVariation;isProcessing=false;renderSilently(){this.acquireProcessingLock()||this.render().finally(()=>this.releaseProcessingLock()).catch(e=>{ke$2(e,`render-widget`,{triggerContext:this.triggerContext});});}destroy(){Y$1.verbose(`${this.engagementTrigger} will be destroyed`),this.preDestroy(),this.removeFromRendered(),this.rootContainer?.remove(),r$9.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID),xi$1(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){Y$1.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,xi$1(this.engagementTrigger.content?.afterRenderJS);}async updateAndReRender(e){if(!this.acquireProcessingLock())try{this.updateItems(e.items,this.engagementTrigger.items),await this.update(e),await this.render();}finally{this.releaseProcessingLock();}}async update(e){this.engagementTrigger.variation=e.variation;}async rerenderIfDeleted(){if(!this.rootContainer?.isConnected&&!this.acquireProcessingLock()){Y$1.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?(Y$1.verbose(`Lock could not be acquired for ${this.engagementTrigger}`),true):(Y$1.verbose(`Acquiring rendering lock for ${this.engagementTrigger}`),this.isProcessing=true,false)}releaseProcessingLock(){Y$1.verbose(`Releasing rendering lock for ${this.engagementTrigger}`),this.isProcessing=false;}afterRootContainerCreated(){}isAllOkToRender(){return !!this.engagementTrigger.widget}async getVariationIfRequired(){if(this.engagementTrigger.shouldSkipVariation()){Y$1.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;Y$1.log(`${t} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(t.items=e.items.map(i=>new ot$2(i)),t.nonMutableItems=e.items.map(i=>new ot$2(i))),e.bundleFrom&&(t.bundleFrom=new ot$2(e.bundleFrom)),e.discount&&(t.discount=e.discount),e.placement&&(t.placement=e.placement),e.props&&pe$4.hasKeys(e.props)&&(t.props=r(r({},t.props),e.props)),e.content&&(t.content=new Kt(e.content)),t.widget=new Dt(e.widget),t.contentID=e.contentID,t.variation=e.variation,t.placement=e.placement,t.manipulation=e.manipulation,t.entryAnimation=e.entryAnimation??`NONE`,this.isExclusionWithBVariation=t.isExclusionTesting()&&t.variation===`b`,this.isExclusionWithBVariation&&(this.rootContainer.style.height=`0.5px`);}addToRendered(){this.renderedCount++,Y$1.info(`${this.engagementTrigger} rendered \u2705 ${Mn$1(this.renderedCount)} time`);}removeFromRendered(){this instanceof pe?ct.delete(this):kt.delete(this);}async getVariation(){Y$1.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id===`preview`};try{return (await as(e)).data}catch(t){if(t instanceof oe$5&&t.response?.status===400)return;ke$2(t,`get-variation`,{engagementTrigger:this.engagementTrigger});return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){Y$1.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(i=>{let o=new IntersectionObserver((n,s)=>{n.forEach(async c=>{if(c.isIntersecting){Y$1.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);i(await this.getVariation()),s.unobserve(this.rootContainer);}});},t);o.observe(this.rootContainer),this.observers.push(o);})}attachScroll(){this.scrollSubscription=Tr(window,`scroll`).pipe(Fe$1(r$9.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent();});}checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(r$9.engagementIDsWithTrackedDisplay.has(e)||!this.isInViewport())return;let i={};this.triggerContext.triggerData.items?.length&&(i.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let n=new Ir$1(this.isExclusionWithBVariation?`CE Campaign Holdout`:`CE Trigger Displayed`,i,this.engagementTrigger);n.name===`CE Campaign Holdout`&&(n.trigger.holdout=true),fe(n),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=E.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 i=t.getElementById(e);if(i)return i;let o=this.engagementTrigger.objective.toLowerCase().replaceAll(`_`,`-`),n=this.engagementTrigger.shortID;return i=document.createElement(`div`),i.id=e,i.className=`letscooee letscooee-engagement engagement-${n} lc-${o}`,i.dataset.engagementId=n,this.engagementTrigger.id===`preview`&&(i.className+=` letscooee-preview`),i.style.display=`block`,i.style.minHeight=`0.5px`,i.style.minWidth=`0.5px`,i}async startRendering(){let e=this.rootContainer,t=this.triggerContext.triggerData.hasSwiperElement();t&&(e=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:`open`}),Mi$1(e)),this.injectCampaignCSS(t,e);let i=this.engagementTrigger.widget;ze$1(pe$3(nr,{element:i.cont,triggerContext:this.triggerContext,elements:i.elems}),e),this.addToRendered();}injectCampaignCSS(e,t){let i=this.engagementTrigger.content?.outerCSS?.trim()??``,o=this.engagementTrigger.content?.innerCSS?.trim()??``;if(!i&&!o)return;let n=this.rootContainer.id;if(e){Ce$1(o,t),this.injectOuterCSSOnly();return}Ce$1(`#${n} { ${i+`
75
- ${o}`} }`);}injectOuterCSSOnly(){let e=this.engagementTrigger.content?.outerCSS?.trim();if(!e)return;let t=this.rootContainer.id;Ce$1(`#${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 i=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(i)}async createParentElementWithPlacement(e){let t=this.engagementTrigger.placement;if(!t?.selector)return Y$1.info(`\u26A0\uFE0F${this.engagementTrigger} does not have a selector`),null;let i=t.selector,o;if(i.includes(`:shadow`)){let m=i.split(`:shadow`);o=(await Ln$1(m[0].trim()))?.shadowRoot,i=m[1].trim(),o&&Mi$1(o,false);}Y$1.verbose(`${this.engagementTrigger} attempt to render "${t.position}" "${i}"`);let n=await Ln$1(i,3,o??document);if(!n)return Y$1.warn(`${this.engagementTrigger} no placement found with ${i}`),null;let s=this.generateParentElementID(),c=this.getParentElement(s);if(!e)return c;switch(t.position){case Ve$3.BEFORE1:case Ve$3.BEFORE:n.parentElement?.insertBefore(c,n);break;case Ve$3.INSIDE_FIRST1:case Ve$3.INSIDE_FIRST:n.insertBefore(c,n.firstChild);break;case Ve$3.INSIDE_LAST1:case Ve$3.INSIDE_LAST:n.appendChild(c);break;case Ve$3.AFTER1:case Ve$3.AFTER:default:n.parentElement?.insertBefore(c,n.nextSibling);}return c}async runChoresBeforeRender(){if(this.isExclusionWithBVariation)return;if(!this.isAllOkToRender()){Y$1.info(`\u26A0\uFE0F ${this.engagementTrigger} could not be rendered`);return}Y$1.verbose(`${this.engagementTrigger} will be rendered`);let e;try{e=await hi(this.engagementTrigger);}catch(t){Y$1.info(`\u203C\uFE0F${this.engagementTrigger} could not render as items failed to refresh`,t);return}if(!this.engagementTrigger.isCollectionPromoted()&&!e?.length&&this.engagementTrigger.isProductPromoted()){Y$1.info(`\u203C\uFE0F${this.engagementTrigger} could not render as no products promoted`);return}this.engagementTrigger.items=e,await this.startRendering();}updateItems(e,t){let i=this.getItemDiff(e,t),o=this.getItemDiff(t,e);t.push(...i);for(let n of o)Pe.remove(t,n);}getItemDiff(e,t){return e.filter(i=>!t.some(o=>o.selectedOrFirstVariant.value.mID===i.selectedOrFirstVariant.value.mID))}};var pe=class extends X{constructor(e){super(e);}rerenderAfterCartOpened(){this.rerenderIfDeleted(),this.checkAndSendEvent();}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}checkAndSendEvent(){if(!V.get().isOpen()&&Be$3().pageName!==`cart`){Y$1.log(`Do not send display event as neither the cart drawer nor the cart page is open.`);return}return super.checkAndSendEvent()}};var Ii=class r{constructor(e,t){this.engagementTrigger=e;this.element=t;this.cartItems=E.getCurrent().items;}cartItems;static renderCartUpsell(e){let t=e.placement;if(!t?.selector){Y$1.warn(`No placement available for ${e.objective}`,e.shortID);return}let i=Array.from(document.querySelectorAll(t.selector));if(!i?.length){Y$1.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let o of i)new r(e,o).render();}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let t=this.engagementTrigger.items.find(w=>w.mID===e.product_id.toString());if(!t)return;let i=t.vars.find(w=>w.mID===e.id.toString());if(!i)return;let o=new nt$1(i),n=e.selling_plan_allocation?.selling_plan;if(n)for(let w of o.sellingPlans??[])w.mID===n.id.toString()&&(w.isSelected=true,o.changeSellingPlan(w));let s=new ot$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 m=new j(this.engagementTrigger);m.placement.selector=`.${c}`,m.items=[s];let C=new pe(m);C.renderSilently(),this.watchForCartItemDeletion(C,c);}watchForCartItemDeletion(e,t){let i=new MutationObserver(o=>{o.forEach(n=>{n.removedNodes.forEach(s=>{s===this.element&&(Y$1.verbose(`${t} has been removed`),e.destroy(),i.disconnect());});});});i.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 i=t.selling_plan_allocation?.selling_plan?.name;return !(i&&!e.includes(i))})}};var Ti=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-collection-filter`);}};var xi=class extends pe{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$2(e,`apply-milestones`,{engagementTrigger:this.engagementTrigger});}}async checkMilestone(){let e=await E.getCurrent().getNormalisedCart(),t=this.engagementTrigger.progressBarConfig,i=[],o=[],n=[],s,c,m=[...t.milestones];for(let v of m){if(v.rewardType!==Fe$2.FREE_AUTO_GIFT)continue;if(v.isUIOnly&&!v.allowATC){Y$1.verbose(`Skipping milestone ${v.label} as it is UI only and does not allow ATC`);continue}let L=v.items[0],A=v.reached,b=e.items.find(Je=>(Je.vID===L.vID||Je.mID===L.mID)&&Je.properties._letscooee_campaign===this.engagementTrigger.shortID);A&&(s=v,c=b),b&&i.push(b),!A&&b&&t.removeIneligibleItem?(Y$1.verbose(`Removing free gift ${b.vID} from cart`),n.push(b)):A&&!b&&(Y$1.verbose(`Adding free gift ${L.vID} to cart`),o.push(L));}t.restrictToLatestFreebie&&s&&(c?(i=i.filter(v=>v.vID!==c.vID),o=[]):o=[s.items[0]],n.push(...i));let C={},w={};n.length&&n.forEach(v=>w[v.key??v.vID]=0),o.length&&o.forEach(v=>w[v.vID]=1);let O=t.coupons,F=[];if(O?.length){F=O.map(A=>A.couponCode);let v=E.getCurrent().discount_codes?.map(A=>A.code)??[];F.every(A=>v.some(b=>b===A))||(C.discount=F.join(`,`));}if(pe$4.hasKeys(w)&&(C.updates=w),!pe$4.hasKeys(C))return;let y=await is(C,this.engagementTrigger),P=y?.items,x=[];for(let v of o){let L=P?.find(A=>F?.length?A.id+``===v.vID&&A.discounts?.some(b=>F.includes(b.title)):A.id+``===v.vID);L&&x.push(L);}if(!x.length){V.get().refreshUI(y,false);return}try{await Promise.all(x.map(v=>os(v,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()})));}catch(v){ke$2(v,`add-private-attribute`,{engagementTrigger:this.engagementTrigger,extra:{productAddedByCooee:x}});}finally{V.get().refreshUI(y,false);}}};var sr=class extends pe{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 Di=class extends X{constructor(e){super(e);}isAllOkToRender(){return !!this.engagementTrigger.content?.videoConfig}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e,t=this.engagementTrigger.content.videoConfig;t.template===`FLOATING_POPUP`?e=`cooee-video-popup`:t.template===`STORY`?e=`cooee-video-stories`:e=`cooee-video-playlist`,this.createAngularWidget(e);}};var Pi=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-sticky-atc`);}};var Ri=class extends X{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,i=`Engagement(id: ${t.engagementID}, shortID: ${t.shortID})`,o=e.detail;if(!pe$4.hasKeys(o)){Y$1.error(`No detail received for ${i}`);return}Y$1.log(`Detail received for BYOB`,o);let n=o.campaignID??o.campaignId??o.campaign_id;if(n!==t.shortID&&n!==t.engagementID){Y$1.warn(`Current ${i} is not BYOB. Received: ${n}`);return}let s=o.items;if(!s?.length)return;let c=s.map(m=>new et({mID:m.product_id,vID:m.variant_id,quantity:m.quantity||1}));await new Re(this.triggerContext).execute({embeddedItems:c,clickAction:{at:He$3.ADD_BUNDLE,applyDiscount:true}});}};var bo=false,Co=false,_i=null,ki=null,cs=false,ct=new Set,kt=new Set;function ls(){cs||(cs=true,ht$2(()=>{Un(document.body,{childList:true,subtree:true},500,Mn).subscribe(()=>{kt.forEach(r=>r.rerenderIfDeleted()),ct.forEach(r=>r.rerenderIfDeleted());});}));}function ar(r){if(r.length>0&&us(),ls(),bo){Y$1.verbose(`Cart widget processing in progress, queuing latest triggers`),_i=r;return}bo=true;try{za(r);}finally{if(bo=false,_i){let e=_i;_i=null,Y$1.verbose(`Processing queued cart triggers`),ar(e);}}}function cr(r){if(r.length>0&&us(),ls(),Co){Y$1.verbose(`Page widget processing in progress, queuing latest triggers`),ki=r;return}Co=true;try{Ka(r);}finally{if(Co=false,ki){let e=ki;ki=null,Y$1.verbose(`Processing queued page triggers`),cr(e);}}}function ms(){ct.forEach(r=>r.rerenderAfterCartOpened());}function za(r){ds(ct,r);for(let e of r){Y$1.info(`${e} received as cart embed`);let t=ps(ct,e);if(t&&!e.isSubscriptionUpsell()){t.updateAndReRender(e).catch(o=>{ke$2(o,`update-and-re-render`,{engagementTrigger:e});});continue}Y$1.verbose(`${e} is new`);let i;if(e.isProgressBar())i=new xi(e);else if(e.isSubscriptionUpsell()){Ii.renderCartUpsell(e);continue}else e.isSavingsBar()?i=new sr(e):i=new pe(e);ct.add(i),i.renderSilently();}}function Ka(r){ds(kt,r);for(let e of r){Y$1.info(`${e} received as page embed`);let t=ps(kt,e);if(t){t.updateAndReRender(e).catch(o=>{ke$2(o,`update-and-re-render`,{engagementTrigger:e});});continue}Y$1.verbose(`${e} is new`);let i;e.isShoppableVideo()?i=new Di(e):e.isBYOB()?i=new Ri(e):e.isStickyATC()?i=new Pi(e):e.isSavingsBar()?i=new sr(e):e.isCollectionFilter()?i=new Ti(e):i=new X(e),kt.add(i),i.renderSilently();}}function ps(r,e){for(let t of r)if(t.matches(e))return t}function ds(r,e){let t=new Set(e.map(i=>i.shortID));for(let i of r)t.has(i.engagementTrigger.shortID)||i.destroy();}function us(){import('./widgets-D_OSh97N-Bpf2Pdkf.js').then(function (n) { return n.ad; }).then(({loadAngularWidgets:r})=>{r();});}var Ai=class extends ne$2{static storeName=`app`;static{this.storage=ge$3(this.storeName);}};var Xa=` 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/`,Ya=/bot|crawl|http|lighthouse|scan|search|spider/i,lr;function Ja(){if(lr instanceof RegExp)return lr;try{lr=new RegExp(Xa,`i`);}catch{lr=Ya;}return lr}function gs(r){return !!r&&Ja().test(r)}var Qa=`2.0.4`,Ao=500,fs=`user-agent`,Mt=``,hs=`?`,Fi=`function`,Ke=`undefined`,Ut=`object`,Oo=`string`,Q=`browser`,Ae=`cpu`,Se=`device`,he=`engine`,de=`os`,Lt=`result`,u=`name`,l=`type`,d=`vendor`,g=`version`,Z=`architecture`,br=`major`,p=`model`,wr=`console`,S=`mobile`,k=`tablet`,W=`smarttv`,ye=`wearable`,Oi=`xr`,vr=`embedded`,mr=`inapp`,Mo=`brands`,mt=`formFactors`,Uo=`fullVersionList`,Nt=`platform`,Fo=`platformVersion`,Wi=`bitness`,Xe=`sec-ch-ua`,Za=Xe+`-full-version-list`,ec=Xe+`-arch`,tc=Xe+`-`+Wi,rc=Xe+`-form-factors`,ic=Xe+`-`+S,oc=Xe+`-`+p,_s=Xe+`-`+Nt,nc=_s+`-version`,ks=[Mo,Uo,S,p,Nt,Fo,Z,mt,Wi],Li=`Amazon`,At=`Apple`,ws=`ASUS`,vs=`BlackBerry`,lt=`Google`,bs=`Huawei`,yo=`Lenovo`,Cs=`Honor`,Ni=`LG`,Eo=`Microsoft`,So=`Motorola`,Io=`Nvidia`,ys=`OnePlus`,To=`OPPO`,pr=`Samsung`,Es=`Sharp`,dr=`Sony`,xo=`Xiaomi`,Do=`Zebra`,Ss=`Chrome`,Is=`Chromium`,je=`Chromecast`,Ui=`Edge`,ur=`Firefox`,gr=`Opera`,Po=`Facebook`,Ts=`Sogou`,Ot=`Mobile `,fr=` Browser`,Lo=`Windows`,ee=typeof window!==Ke&&window.navigator?window.navigator:void 0,ze=ee&&ee.userAgentData?ee.userAgentData:void 0,ac=function(r,e){var t={},i=e;if(!Bi(e)){i={};for(var o in e)for(var n in e[o])i[n]=e[o][n].concat(i[n]?i[n]:[]);}for(var s in r)t[s]=i[s]&&i[s].length%2===0?i[s].concat(r[s]):r[s];return t},Hi=function(r){for(var e={},t=0;t<r.length;t++)e[r[t].toUpperCase()]=r[t];return e},No=function(r,e){if(typeof r===Ut&&r.length>0){for(var t in r)if(Oe(e)==Oe(r[t]))return true;return false}return Bt(r)?Oe(e)==Oe(r):false},Bi=function(r,e){for(var t in r)return /^(browser|cpu|device|engine|os)$/.test(t)||(e?Bi(r[t]):false)},Bt=function(r){return typeof r===Oo},Ro=function(r){if(r){for(var e=[],t=Ft(/\\?\"/g,r).split(`,`),i=0;i<t.length;i++)if(t[i].indexOf(`;`)>-1){var o=Vi(t[i]).split(`;v=`);e[i]={brand:o[0],version:o[1]};}else e[i]=Vi(t[i]);return e}},Oe=function(r){return Bt(r)?r.toLowerCase():r},_o=function(r){return Bt(r)?Ft(/[^\d\.]/g,r).split(`.`)[0]:void 0},Le=function(r){for(var e in r){var t=r[e];typeof t==Ut&&t.length==2?this[t[0]]=t[1]:this[t]=void 0;}return this},Ft=function(r,e){return Bt(e)?e.replace(r,Mt):e},hr=function(r){return Ft(/\\?\"/g,r)},Vi=function(r,e){if(Bt(r))return r=Ft(/^\s\s*/,r),typeof e===Ke?r:r.substring(0,Ao)},ko=function(r,e){if(!(!r||!e))for(var t=0,i,o,n,s,c,m;t<e.length&&!c;){var C=e[t],w=e[t+1];for(i=o=0;i<C.length&&!c&&C[i];)if(c=C[i++].exec(r),c)for(n=0;n<w.length;n++)m=c[++o],s=w[n],typeof s===Ut&&s.length>0?s.length===2?typeof s[1]==Fi?this[s[0]]=s[1].call(this,m):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===Fi&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=m?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=m?s[1].call(this,m,s[2]):void 0:s.length==3?this[s[0]]=m?m.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=m?s[3].call(this,m.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=m?s[3].apply(this,[m.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=m||void 0;t+=2;}},Ee=function(r,e){for(var t in e)if(typeof e[t]===Ut&&e[t].length>0){for(var i=0;i<e[t].length;i++)if(No(e[t][i],r))return t===hs?void 0:t}else if(No(e[t],r))return t===hs?void 0:t;return e.hasOwnProperty(`*`)?e[`*`]:r},xs={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:``},Ds={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},cc={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`},Ps={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[u,Ot+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[g,[u,Ui+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[u,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,g],[/opios[\/ ]+([\w\.]+)/i],[g,[u,gr+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[u,gr+` GX`]],[/\bopr\/([\w\.]+)/i],[g,[u,gr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[u,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[u,`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],[u,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[u,`Quark`]],[/\bddg\/([\w\.]+)/i],[g,[u,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[u,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[u,`WeChat`]],[/konqueror\/([\w\.]+)/i],[g,[u,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[u,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[u,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[g,[u,`Smart `+yo+fr]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,`$1 Secure`+fr],g],[/\bfocus\/([\w\.]+)/i],[g,[u,ur+` Focus`]],[/\bopt\/([\w\.]+)/i],[g,[u,gr+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[g,[u,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[g,[u,`Dolphin`]],[/coast\/([\w\.]+)/i],[g,[u,gr+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[g,[u,`MIUI`+fr]],[/fxios\/([\w\.-]+)/i],[g,[u,Ot+ur]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[u,`360`]],[/\b(qq)\/([\w\.]+)/i],[[u,/(.+)/,`$1Browser`],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[u,/(.+)/,`$1`+fr],g],[/samsungbrowser\/([\w\.]+)/i],[g,[u,pr+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[g,[u,Ts+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,Ts+` Mobile`],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[u,g],[/(lbbrowser|rekonq)/i],[u],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,Po],g,[l,mr]],[/(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],[u,g,[l,mr]],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[u,`GSA`],[l,mr]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[u,`TikTok`],[l,mr]],[/\[(linkedin)app\]/i],[u,[l,mr]],[/(chromium)[\/ ]([-\w\.]+)/i],[u,g],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[u,Ss+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[g,[u,Ui+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,Ss+` WebView`],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[u,`Android`+fr]],[/chrome\/([\w\.]+) mobile/i],[g,[u,Ot+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,g],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[g,[u,Ot+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[u,Ot+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[g,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[g,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[u,g],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[u,Ot+ur],g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,`Netscape`],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[u,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[u,ur+` 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],[u,[g,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[u,[g,/[^\d\.]+./,Mt]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[Z,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[Z,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[Z,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[Z,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[Z,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[Z,/ower/,Mt,Oe]],[/ sun4\w[;\)]/i],[[Z,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[Z,Oe]]],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],[p,[d,pr],[l,k]],[/\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],[p,[d,pr],[l,S]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[d,At],[l,S]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[d,At],[l,k]],[/(macintosh);/i],[p,[d,At]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[d,Es],[l,S]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[p,[d,Cs],[l,k]],[/honor([-\w ]+)[;\)]/i],[p,[d,Cs],[l,S]],[/\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],[p,[d,bs],[l,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[d,bs],[l,S]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[p,/_/g,` `],[d,xo],[l,k]],[/\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],[[p,/_/g,` `],[d,xo],[l,S]],[/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],[p,[d,ys],[l,S]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[d,To],[l,S]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[p,[d,Ee,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":To}],[l,k]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[p,[d,`BLU`],[l,S]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[d,`Vivo`],[l,S]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[d,`Realme`],[l,S]],[/(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],[p,[d,yo],[l,k]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[p,[d,yo],[l,S]],[/\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],[p,[d,So],[l,S]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[d,So],[l,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[d,Ni],[l,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[d,Ni],[l,S]],[/(nokia) (t[12][01])/i],[d,p,[l,k]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[p,/_/g,` `],[l,S],[d,`Nokia`]],[/(pixel (c|tablet))\b/i],[p,[d,lt],[l,k]],[/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],[p,[d,lt],[l,S]],[/(google) (pixelbook( go)?)/i],[d,p],[/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],[p,[d,dr],[l,S]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,`Xperia Tablet`],[d,dr],[l,k]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[d,Li],[l,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,`Fire Phone $1`],[d,Li],[l,S]],[/(playbook);[-\w\),; ]+(rim)/i],[p,d,[l,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[d,vs],[l,S]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[d,ws],[l,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[d,ws],[l,S]],[/(nexus 9)/i],[p,[d,`HTC`],[l,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[p,/_/g,` `],[l,S]],[/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],[p,[d,`TCL`],[l,k]],[/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],[p,[d,`TCL`],[l,S]],[/(itel) ((\w+))/i],[[d,Oe],p,[l,Ee,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[d,`Acer`],[l,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[d,`Meizu`],[l,S]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[d,`Ulefone`],[l,S]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[d,`Energizer`],[l,S]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[d,`Cat`],[l,S]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[d,`Smartfren`],[l,S]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[p,[d,`Nothing`],[l,S]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[p,[d,`Archos`],[l,k]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[p,[d,`Archos`],[l,S]],[/; (n159v)/i],[p,[d,`HMD`],[l,S]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[d,p,[l,k]],[/(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],[d,p,[l,S]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[d,p,[l,k]],[/(surface duo)/i],[p,[d,Eo],[l,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[d,`Fairphone`],[l,S]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[p,[d,Io],[l,k]],[/(sprint) (\w+)/i],[d,p,[l,S]],[/(kin\.[onetw]{3})/i],[[p,/\./g,` `],[d,Eo],[l,S]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[d,Do],[l,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[d,Do],[l,S]],[/smart-tv.+(samsung)/i],[d,[l,W]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,`SmartTV`],[d,pr],[l,W]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[d,p,[l,W]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,Ni],[l,W]],[/(apple) ?tv/i],[d,[p,At+` TV`],[l,W]],[/crkey.*devicetype\/chromecast/i],[[p,je+` Third Generation`],[d,lt],[l,W]],[/crkey.*devicetype\/([^/]*)/i],[[p,/^/,`Chromecast `],[d,lt],[l,W]],[/fuchsia.*crkey/i],[[p,je+` Nest Hub`],[d,lt],[l,W]],[/crkey/i],[[p,je],[d,lt],[l,W]],[/(portaltv)/i],[p,[d,Po],[l,W]],[/droid.+aft(\w+)( bui|\))/i],[p,[d,Li],[l,W]],[/(shield \w+ tv)/i],[p,[d,Io],[l,W]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[d,Es],[l,W]],[/(bravia[\w ]+)( bui|\))/i],[p,[d,dr],[l,W]],[/(mi(tv|box)-?\w+) bui/i],[p,[d,xo],[l,W]],[/Hbbtv.*(technisat) (.*);/i],[d,p,[l,W]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,/.+\/(\w+)/,`$1`,Ee,{LG:`lge`}],[p,Vi],[l,W]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[p,[l,W]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[l,W]],[/(playstation \w+)/i],[p,[d,dr],[l,wr]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[d,Eo],[l,wr]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[d,p,[l,wr]],[/droid.+; (shield)( bui|\))/i],[p,[d,Io],[l,wr]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[p,[d,pr],[l,ye]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[d,p,[l,ye]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[p,[d,To],[l,ye]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[d,At],[l,ye]],[/(opwwe\d{3})/i],[p,[d,ys],[l,ye]],[/(moto 360)/i],[p,[d,So],[l,ye]],[/(smartwatch 3)/i],[p,[d,dr],[l,ye]],[/(g watch r)/i],[p,[d,Ni],[l,ye]],[/droid.+; (wt63?0{2,3})\)/i],[p,[d,Do],[l,ye]],[/droid.+; (glass) \d/i],[p,[d,lt],[l,Oi]],[/(pico) (4|neo3(?: link|pro)?)/i],[d,p,[l,Oi]],[/(quest( \d| pro)?s?).+vr/i],[p,[d,Po],[l,Oi]],[/mobile vr; rv.+firefox/i],[[l,Oi]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,vr]],[/(aeobc)\b/i],[p,[d,Li],[l,vr]],[/(homepod).+mac os/i],[p,[d,At],[l,vr]],[/windows iot/i],[[l,vr]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[p,[l,Ee,{mobile:`Mobile`,xr:`VR`,"*":k}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,S]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[p,[d,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[u,Ui+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[u,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[u,`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],[u,g],[/ladybird\//i],[[u,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,u]],os:[[/(windows nt) (6\.[23]); arm/i],[[u,/N/,`R`],[g,Ee,xs]],[/(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],[u,g],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[g,/(;|\))/g,``,Ee,xs],[u,Lo]],[/(windows ce)\/?([\d\.]*)/i],[u,g],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,`.`],[u,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[u,`macOS`],[g,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[g,[u,je+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[g,[u,je+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[g,[u,je+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[g,[u,je+` Linux`]],[/crkey\/([\d\.]+)/i],[g,[u,je]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[g,u],[/(ubuntu) ([\w\.]+) like android/i],[[u,/(.+)/,`$1 Touch`],g],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[u,g],[/\(bb(10);/i],[g,[u,vs]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[u,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[u,ur+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[g,[u,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[g,Ee,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[u,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[u,`watchOS`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,`Chrome OS`],g],[/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],[u,g],[/(sunos) ?([\d\.]*)/i],[[u,`Solaris`],g],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,g]]},Mi=(function(){var r={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return Le.call(r.init,[[Q,[u,g,br,l]],[Ae,[Z]],[Se,[l,p,d]],[he,[u,g]],[de,[u,g]]]),Le.call(r.isIgnore,[[Q,[g,br]],[he,[g]],[de,[g]]]),Le.call(r.isIgnoreRgx,[[Q,/ ?browser$/i],[de,/ ?os$/i]]),Le.call(r.toString,[[Q,[u,g]],[Ae,[Z]],[Se,[d,p]],[he,[u,g]],[de,[u,g]]]),r})(),lc=function(r,e){var t=Mi.init[e],i=Mi.isIgnore[e]||0,o=Mi.isIgnoreRgx[e]||0,n=Mi.toString[e]||0;function s(){Le.call(this,t);}return s.prototype.getItem=function(){return r},s.prototype.withClientHints=function(){return ze?ze.getHighEntropyValues(ks).then(function(c){return r.setCH(new As(c,false)).parseCH().get()}):r.parseCH().get()},s.prototype.withFeatureCheck=function(){return r.detectFeature().get()},e!=Lt&&(s.prototype.is=function(c){var m=false;for(var C in this)if(this.hasOwnProperty(C)&&!No(i,C)&&Oe(o?Ft(o,this[C]):this[C])==Oe(o?Ft(o,c):c)){if(m=true,c!=Ke)break}else if(c==Ke&&m){m=!m;break}return m},s.prototype.toString=function(){var c=Mt;for(var m in n)typeof this[n[m]]!==Ke&&(c+=(c?` `:Mt)+this[n[m]]);return c||Ke}),ze||(s.prototype.then=function(c){var m=this,C=function(){for(var O in m)m.hasOwnProperty(O)&&(this[O]=m[O]);};C.prototype={is:s.prototype.is,toString:s.prototype.toString};var w=new C;return c(w),w}),new s};function As(r,e){if(r=r||{},Le.call(this,ks),e)Le.call(this,[[Mo,Ro(r[Xe])],[Uo,Ro(r[Za])],[S,/\?1/.test(r[ic])],[p,hr(r[oc])],[Nt,hr(r[_s])],[Fo,hr(r[nc])],[Z,hr(r[ec])],[mt,Ro(r[rc])],[Wi,hr(r[tc])]]);else for(var t in r)this.hasOwnProperty(t)&&typeof r[t]!==Ke&&(this[t]=r[t]);}function Rs(r,e,t,i){return this.get=function(o){return o?this.data.hasOwnProperty(o)?this.data[o]:void 0:this.data},this.set=function(o,n){return this.data[o]=n,this},this.setCH=function(o){return this.uaCH=o,this},this.detectFeature=function(){if(ee&&ee.userAgent==this.ua)switch(this.itemType){case Q:ee.brave&&typeof ee.brave.isBrave==Fi&&this.set(u,`Brave`);break;case Se:!this.get(l)&&ze&&ze[S]&&this.set(l,S),this.get(p)==`Macintosh`&&ee&&typeof ee.standalone!==Ke&&ee.maxTouchPoints&&ee.maxTouchPoints>2&&this.set(p,`iPad`).set(l,k);break;case de:!this.get(u)&&ze&&ze[Nt]&&this.set(u,ze[Nt]);break;case Lt:var o=this.data,n=function(s){return o[s].getItem().detectFeature().get()};this.set(Q,n(Q)).set(Ae,n(Ae)).set(Se,n(Se)).set(he,n(he)).set(de,n(de));}return this},this.parseUA=function(){return this.itemType!=Lt&&ko.call(this.data,this.ua,this.rgxMap),this.itemType==Q&&this.set(br,_o(this.get(g))),this},this.parseCH=function(){var o=this.uaCH,n=this.rgxMap;switch(this.itemType){case Q:case he:var s=o[Uo]||o[Mo],c;if(s)for(var m in s){var C=s[m].brand||s[m],w=s[m].version;this.itemType==Q&&!/not.a.brand/i.test(C)&&(!c||/Chrom/.test(c)&&C!=Is||c==Ui&&/WebView2/.test(C))&&(C=Ee(C,cc),c=this.get(u),c&&!/Chrom/.test(c)&&/Chrom/.test(C)||this.set(u,C).set(g,w).set(br,_o(w)),c=C),this.itemType==he&&C==Is&&this.set(g,w);}break;case Ae:var O=o[Z];O&&(O&&o[Wi]==`64`&&(O+=`64`),ko.call(this.data,O+`;`,n));break;case Se:if(o[S]&&this.set(l,S),o[p]&&(this.set(p,o[p]),!this.get(l)||!this.get(d))){var F={};ko.call(F,`droid 9; `+o[p]+`)`,n),!this.get(l)&&F.type&&this.set(l,F.type),!this.get(d)&&F.vendor&&this.set(d,F.vendor);}if(o[mt]){var y;if(typeof o[mt]!=`string`)for(var P=0;!y&&P<o[mt].length;)y=Ee(o[mt][P++],Ds);else y=Ee(o[mt],Ds);this.set(l,y);}break;case de:var x=o[Nt];if(x){var v=o[Fo];x==Lo&&(v=parseInt(_o(v),10)>=13?`11`:`10`),this.set(u,x).set(g,v);}this.get(u)==Lo&&o[p]==`Xbox`&&this.set(u,`Xbox`).set(g,void 0);break;case Lt:var L=this.data,A=function(b){return L[b].getItem().setCH(o).parseCH().get()};this.set(Q,A(Q)).set(Ae,A(Ae)).set(Se,A(Se)).set(he,A(he)).set(de,A(de));}return this},Le.call(this,[[`itemType`,r],[`ua`,e],[`uaCH`,i],[`rgxMap`,t],[`data`,lc(this,r)]]),this}function we(r,e,t){if(typeof r===Ut?(Bi(r,true)?(typeof e===Ut&&(t=e),e=r):(t=r,e=void 0),r=void 0):typeof r===Oo&&!Bi(e,true)&&(t=e,e=void 0),t&&typeof t.append===Fi){var i={};t.forEach(function(m,C){i[C]=m;}),t=i;}if(!(this instanceof we))return new we(r,e,t).getResult();var o=typeof r===Oo?r:t&&t[fs]?t[fs]:ee&&ee.userAgent?ee.userAgent:Mt,n=new As(t,true),s=e?ac(Ps,e):Ps,c=function(m){return m==Lt?function(){return new Rs(m,o,s,n).set(`ua`,o).set(Q,this.getBrowser()).set(Ae,this.getCPU()).set(Se,this.getDevice()).set(he,this.getEngine()).set(de,this.getOS()).get()}:function(){return new Rs(m,o,s[m],n).parseUA().get()}};return Le.call(this,[[`getBrowser`,c(Q)],[`getCPU`,c(Ae)],[`getDevice`,c(Se)],[`getEngine`,c(he)],[`getOS`,c(de)],[`getResult`,c(Lt)],[`getUA`,function(){return o}],[`setUA`,function(m){return Bt(m)&&(o=m.length>Ao?Vi(m,Ao):m),this}]]).setUA(o),this}we.VERSION=Qa;we.BROWSER=Hi([u,g,br,l]);we.CPU=Hi([Z]);we.DEVICE=Hi([p,d,l,wr,S,W,k,ye,vr]);we.ENGINE=we.OS=Hi([u,g]);var $i=class{modifications=[];constructor(){Ce$1(`.lc-hide {display: none !important;height: 0 !important;}
75
+ ${o}`} }`);}injectOuterCSSOnly(){let e=this.engagementTrigger.content?.outerCSS?.trim();if(!e)return;let t=this.rootContainer.id;Ce$1(`#${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 i=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(i)}async createParentElementWithPlacement(e){let t=this.engagementTrigger.placement;if(!t?.selector)return Y$1.info(`\u26A0\uFE0F${this.engagementTrigger} does not have a selector`),null;let i=t.selector,o;if(i.includes(`:shadow`)){let m=i.split(`:shadow`);o=(await Ln$1(m[0].trim()))?.shadowRoot,i=m[1].trim(),o&&Mi$1(o,false);}Y$1.verbose(`${this.engagementTrigger} attempt to render "${t.position}" "${i}"`);let n=await Ln$1(i,3,o??document);if(!n)return Y$1.warn(`${this.engagementTrigger} no placement found with ${i}`),null;let s=this.generateParentElementID(),c=this.getParentElement(s);if(!e)return c;switch(t.position){case Ve$3.BEFORE1:case Ve$3.BEFORE:n.parentElement?.insertBefore(c,n);break;case Ve$3.INSIDE_FIRST1:case Ve$3.INSIDE_FIRST:n.insertBefore(c,n.firstChild);break;case Ve$3.INSIDE_LAST1:case Ve$3.INSIDE_LAST:n.appendChild(c);break;case Ve$3.AFTER1:case Ve$3.AFTER:default:n.parentElement?.insertBefore(c,n.nextSibling);}return c}async runChoresBeforeRender(){if(this.isExclusionWithBVariation)return;if(!this.isAllOkToRender()){Y$1.info(`\u26A0\uFE0F ${this.engagementTrigger} could not be rendered`);return}Y$1.verbose(`${this.engagementTrigger} will be rendered`);let e;try{e=await hi(this.engagementTrigger);}catch(t){Y$1.info(`\u203C\uFE0F${this.engagementTrigger} could not render as items failed to refresh`,t);return}if(!this.engagementTrigger.isCollectionPromoted()&&!e?.length&&this.engagementTrigger.isProductPromoted()){Y$1.info(`\u203C\uFE0F${this.engagementTrigger} could not render as no products promoted`);return}this.engagementTrigger.items=e,await this.startRendering();}updateItems(e,t){let i=this.getItemDiff(e,t),o=this.getItemDiff(t,e);t.push(...i);for(let n of o)Pe.remove(t,n);}getItemDiff(e,t){return e.filter(i=>!t.some(o=>o.selectedOrFirstVariant.value.mID===i.selectedOrFirstVariant.value.mID))}};var pe=class extends X{constructor(e){super(e);}rerenderAfterCartOpened(){this.rerenderIfDeleted(),this.checkAndSendEvent();}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}checkAndSendEvent(){if(!V.get().isOpen()&&Be$3().pageName!==`cart`){Y$1.log(`Do not send display event as neither the cart drawer nor the cart page is open.`);return}return super.checkAndSendEvent()}};var Ii=class r{constructor(e,t){this.engagementTrigger=e;this.element=t;this.cartItems=E.getCurrent().items;}cartItems;static renderCartUpsell(e){let t=e.placement;if(!t?.selector){Y$1.warn(`No placement available for ${e.objective}`,e.shortID);return}let i=Array.from(document.querySelectorAll(t.selector));if(!i?.length){Y$1.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let o of i)new r(e,o).render();}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let t=this.engagementTrigger.items.find(w=>w.mID===e.product_id.toString());if(!t)return;let i=t.vars.find(w=>w.mID===e.id.toString());if(!i)return;let o=new nt$1(i),n=e.selling_plan_allocation?.selling_plan;if(n)for(let w of o.sellingPlans??[])w.mID===n.id.toString()&&(w.isSelected=true,o.changeSellingPlan(w));let s=new ot$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 m=new j(this.engagementTrigger);m.placement.selector=`.${c}`,m.items=[s];let C=new pe(m);C.renderSilently(),this.watchForCartItemDeletion(C,c);}watchForCartItemDeletion(e,t){let i=new MutationObserver(o=>{o.forEach(n=>{n.removedNodes.forEach(s=>{s===this.element&&(Y$1.verbose(`${t} has been removed`),e.destroy(),i.disconnect());});});});i.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 i=t.selling_plan_allocation?.selling_plan?.name;return !(i&&!e.includes(i))})}};var Ti=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-collection-filter`);}};var xi=class extends pe{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$2(e,`apply-milestones`,{engagementTrigger:this.engagementTrigger});}}async checkMilestone(){let e=await E.getCurrent().getNormalisedCart(),t=this.engagementTrigger.progressBarConfig,i=[],o=[],n=[],s,c,m=[...t.milestones];for(let v of m){if(v.rewardType!==Fe$2.FREE_AUTO_GIFT)continue;if(v.isUIOnly&&!v.allowATC){Y$1.verbose(`Skipping milestone ${v.label} as it is UI only and does not allow ATC`);continue}let L=v.items[0],A=v.reached,b=e.items.find(Je=>(Je.vID===L.vID||Je.mID===L.mID)&&Je.properties._letscooee_campaign===this.engagementTrigger.shortID);A&&(s=v,c=b),b&&i.push(b),!A&&b&&t.removeIneligibleItem?(Y$1.verbose(`Removing free gift ${b.vID} from cart`),n.push(b)):A&&!b&&(Y$1.verbose(`Adding free gift ${L.vID} to cart`),o.push(L));}t.restrictToLatestFreebie&&s&&(c?(i=i.filter(v=>v.vID!==c.vID),o=[]):o=[s.items[0]],n.push(...i));let C={},w={};n.length&&n.forEach(v=>w[v.key??v.vID]=0),o.length&&o.forEach(v=>w[v.vID]=1);let O=t.coupons,F=[];if(O?.length){F=O.map(A=>A.couponCode);let v=E.getCurrent().discount_codes?.map(A=>A.code)??[];F.every(A=>v.some(b=>b===A))||(C.discount=F.join(`,`));}if(pe$4.hasKeys(w)&&(C.updates=w),!pe$4.hasKeys(C))return;let y=await is(C,this.engagementTrigger),P=y?.items,x=[];for(let v of o){let L=P?.find(A=>F?.length?A.id+``===v.vID&&A.discounts?.some(b=>F.includes(b.title)):A.id+``===v.vID);L&&x.push(L);}if(!x.length){V.get().refreshUI(y,false);return}try{await Promise.all(x.map(v=>os(v,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()})));}catch(v){ke$2(v,`add-private-attribute`,{engagementTrigger:this.engagementTrigger,extra:{productAddedByCooee:x}});}finally{V.get().refreshUI(y,false);}}};var sr=class extends pe{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 Di=class extends X{constructor(e){super(e);}isAllOkToRender(){return !!this.engagementTrigger.content?.videoConfig}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e,t=this.engagementTrigger.content.videoConfig;t.template===`FLOATING_POPUP`?e=`cooee-video-popup`:t.template===`STORY`?e=`cooee-video-stories`:e=`cooee-video-playlist`,this.createAngularWidget(e);}};var Pi=class extends X{constructor(e){super(e);}isAllOkToRender(){return true}async startRendering(){if(this.widgetElement?.isConnected){this.addToRendered();return}this.createAngularWidget(`cooee-sticky-atc`);}};var Ri=class extends X{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,i=`Engagement(id: ${t.engagementID}, shortID: ${t.shortID})`,o=e.detail;if(!pe$4.hasKeys(o)){Y$1.error(`No detail received for ${i}`);return}Y$1.log(`Detail received for BYOB`,o);let n=o.campaignID??o.campaignId??o.campaign_id;if(n!==t.shortID&&n!==t.engagementID){Y$1.warn(`Current ${i} is not BYOB. Received: ${n}`);return}let s=o.items;if(!s?.length)return;let c=s.map(m=>new et({mID:m.product_id,vID:m.variant_id,quantity:m.quantity||1}));await new Re(this.triggerContext).execute({embeddedItems:c,clickAction:{at:He$3.ADD_BUNDLE,applyDiscount:true}});}};var bo=false,Co=false,_i=null,ki=null,cs=false,ct=new Set,kt=new Set;function ls(){cs||(cs=true,ht$2(()=>{Un(document.body,{childList:true,subtree:true},500,Mn).subscribe(()=>{kt.forEach(r=>r.rerenderIfDeleted()),ct.forEach(r=>r.rerenderIfDeleted());});}));}function ar(r){if(r.length>0&&us(),ls(),bo){Y$1.verbose(`Cart widget processing in progress, queuing latest triggers`),_i=r;return}bo=true;try{za(r);}finally{if(bo=false,_i){let e=_i;_i=null,Y$1.verbose(`Processing queued cart triggers`),ar(e);}}}function cr(r){if(r.length>0&&us(),ls(),Co){Y$1.verbose(`Page widget processing in progress, queuing latest triggers`),ki=r;return}Co=true;try{Ka(r);}finally{if(Co=false,ki){let e=ki;ki=null,Y$1.verbose(`Processing queued page triggers`),cr(e);}}}function ms(){ct.forEach(r=>r.rerenderAfterCartOpened());}function za(r){ds(ct,r);for(let e of r){Y$1.info(`${e} received as cart embed`);let t=ps(ct,e);if(t&&!e.isSubscriptionUpsell()){t.updateAndReRender(e).catch(o=>{ke$2(o,`update-and-re-render`,{engagementTrigger:e});});continue}Y$1.verbose(`${e} is new`);let i;if(e.isProgressBar())i=new xi(e);else if(e.isSubscriptionUpsell()){Ii.renderCartUpsell(e);continue}else e.isSavingsBar()?i=new sr(e):i=new pe(e);ct.add(i),i.renderSilently();}}function Ka(r){ds(kt,r);for(let e of r){Y$1.info(`${e} received as page embed`);let t=ps(kt,e);if(t){t.updateAndReRender(e).catch(o=>{ke$2(o,`update-and-re-render`,{engagementTrigger:e});});continue}Y$1.verbose(`${e} is new`);let i;e.isShoppableVideo()?i=new Di(e):e.isBYOB()?i=new Ri(e):e.isStickyATC()?i=new Pi(e):e.isSavingsBar()?i=new sr(e):e.isCollectionFilter()?i=new Ti(e):i=new X(e),kt.add(i),i.renderSilently();}}function ps(r,e){for(let t of r)if(t.matches(e))return t}function ds(r,e){let t=new Set(e.map(i=>i.shortID));for(let i of r)t.has(i.engagementTrigger.shortID)||i.destroy();}function us(){import('./widgets-BIWIerG5-Cm-yzVcy.js').then(function (n) { return n.ad; }).then(({loadAngularWidgets:r})=>{r();});}var Ai=class extends ne$2{static storeName=`app`;static{this.storage=ge$3(this.storeName);}};var Xa=` 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/`,Ya=/bot|crawl|http|lighthouse|scan|search|spider/i,lr;function Ja(){if(lr instanceof RegExp)return lr;try{lr=new RegExp(Xa,`i`);}catch{lr=Ya;}return lr}function gs(r){return !!r&&Ja().test(r)}var Qa=`2.0.4`,Ao=500,fs=`user-agent`,Mt=``,hs=`?`,Fi=`function`,Ke=`undefined`,Ut=`object`,Oo=`string`,Q=`browser`,Ae=`cpu`,Se=`device`,he=`engine`,de=`os`,Lt=`result`,u=`name`,l=`type`,d=`vendor`,g=`version`,Z=`architecture`,br=`major`,p=`model`,wr=`console`,S=`mobile`,k=`tablet`,W=`smarttv`,ye=`wearable`,Oi=`xr`,vr=`embedded`,mr=`inapp`,Mo=`brands`,mt=`formFactors`,Uo=`fullVersionList`,Nt=`platform`,Fo=`platformVersion`,Wi=`bitness`,Xe=`sec-ch-ua`,Za=Xe+`-full-version-list`,ec=Xe+`-arch`,tc=Xe+`-`+Wi,rc=Xe+`-form-factors`,ic=Xe+`-`+S,oc=Xe+`-`+p,_s=Xe+`-`+Nt,nc=_s+`-version`,ks=[Mo,Uo,S,p,Nt,Fo,Z,mt,Wi],Li=`Amazon`,At=`Apple`,ws=`ASUS`,vs=`BlackBerry`,lt=`Google`,bs=`Huawei`,yo=`Lenovo`,Cs=`Honor`,Ni=`LG`,Eo=`Microsoft`,So=`Motorola`,Io=`Nvidia`,ys=`OnePlus`,To=`OPPO`,pr=`Samsung`,Es=`Sharp`,dr=`Sony`,xo=`Xiaomi`,Do=`Zebra`,Ss=`Chrome`,Is=`Chromium`,je=`Chromecast`,Ui=`Edge`,ur=`Firefox`,gr=`Opera`,Po=`Facebook`,Ts=`Sogou`,Ot=`Mobile `,fr=` Browser`,Lo=`Windows`,ee=typeof window!==Ke&&window.navigator?window.navigator:void 0,ze=ee&&ee.userAgentData?ee.userAgentData:void 0,ac=function(r,e){var t={},i=e;if(!Bi(e)){i={};for(var o in e)for(var n in e[o])i[n]=e[o][n].concat(i[n]?i[n]:[]);}for(var s in r)t[s]=i[s]&&i[s].length%2===0?i[s].concat(r[s]):r[s];return t},Hi=function(r){for(var e={},t=0;t<r.length;t++)e[r[t].toUpperCase()]=r[t];return e},No=function(r,e){if(typeof r===Ut&&r.length>0){for(var t in r)if(Oe(e)==Oe(r[t]))return true;return false}return Bt(r)?Oe(e)==Oe(r):false},Bi=function(r,e){for(var t in r)return /^(browser|cpu|device|engine|os)$/.test(t)||(e?Bi(r[t]):false)},Bt=function(r){return typeof r===Oo},Ro=function(r){if(r){for(var e=[],t=Ft(/\\?\"/g,r).split(`,`),i=0;i<t.length;i++)if(t[i].indexOf(`;`)>-1){var o=Vi(t[i]).split(`;v=`);e[i]={brand:o[0],version:o[1]};}else e[i]=Vi(t[i]);return e}},Oe=function(r){return Bt(r)?r.toLowerCase():r},_o=function(r){return Bt(r)?Ft(/[^\d\.]/g,r).split(`.`)[0]:void 0},Le=function(r){for(var e in r){var t=r[e];typeof t==Ut&&t.length==2?this[t[0]]=t[1]:this[t]=void 0;}return this},Ft=function(r,e){return Bt(e)?e.replace(r,Mt):e},hr=function(r){return Ft(/\\?\"/g,r)},Vi=function(r,e){if(Bt(r))return r=Ft(/^\s\s*/,r),typeof e===Ke?r:r.substring(0,Ao)},ko=function(r,e){if(!(!r||!e))for(var t=0,i,o,n,s,c,m;t<e.length&&!c;){var C=e[t],w=e[t+1];for(i=o=0;i<C.length&&!c&&C[i];)if(c=C[i++].exec(r),c)for(n=0;n<w.length;n++)m=c[++o],s=w[n],typeof s===Ut&&s.length>0?s.length===2?typeof s[1]==Fi?this[s[0]]=s[1].call(this,m):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===Fi&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=m?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=m?s[1].call(this,m,s[2]):void 0:s.length==3?this[s[0]]=m?m.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=m?s[3].call(this,m.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=m?s[3].apply(this,[m.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=m||void 0;t+=2;}},Ee=function(r,e){for(var t in e)if(typeof e[t]===Ut&&e[t].length>0){for(var i=0;i<e[t].length;i++)if(No(e[t][i],r))return t===hs?void 0:t}else if(No(e[t],r))return t===hs?void 0:t;return e.hasOwnProperty(`*`)?e[`*`]:r},xs={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:``},Ds={embedded:`Automotive`,mobile:`Mobile`,tablet:[`Tablet`,`EInk`],smarttv:`TV`,wearable:`Watch`,xr:[`VR`,`XR`],"?":[`Desktop`,`Unknown`],"*":void 0},cc={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`},Ps={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[g,[u,Ot+`Chrome`]],[/webview.+edge\/([\w\.]+)/i],[g,[u,Ui+` WebView`]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[g,[u,`Edge`]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,g],[/opios[\/ ]+([\w\.]+)/i],[g,[u,gr+` Mini`]],[/\bop(?:rg)?x\/([\w\.]+)/i],[g,[u,gr+` GX`]],[/\bopr\/([\w\.]+)/i],[g,[u,gr]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[g,[u,`Baidu`]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[g,[u,`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],[u,g],[/quark(?:pc)?\/([-\w\.]+)/i],[g,[u,`Quark`]],[/\bddg\/([\w\.]+)/i],[g,[u,`DuckDuckGo`]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[g,[u,`UCBrowser`]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[g,[u,`WeChat`]],[/konqueror\/([\w\.]+)/i],[g,[u,`Konqueror`]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[g,[u,`IE`]],[/ya(?:search)?browser\/([\w\.]+)/i],[g,[u,`Yandex`]],[/slbrowser\/([\w\.]+)/i],[g,[u,`Smart `+yo+fr]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,`$1 Secure`+fr],g],[/\bfocus\/([\w\.]+)/i],[g,[u,ur+` Focus`]],[/\bopt\/([\w\.]+)/i],[g,[u,gr+` Touch`]],[/coc_coc\w+\/([\w\.]+)/i],[g,[u,`Coc Coc`]],[/dolfin\/([\w\.]+)/i],[g,[u,`Dolphin`]],[/coast\/([\w\.]+)/i],[g,[u,gr+` Coast`]],[/miuibrowser\/([\w\.]+)/i],[g,[u,`MIUI`+fr]],[/fxios\/([\w\.-]+)/i],[g,[u,Ot+ur]],[/\bqihoobrowser\/?([\w\.]*)/i],[g,[u,`360`]],[/\b(qq)\/([\w\.]+)/i],[[u,/(.+)/,`$1Browser`],g],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[u,/(.+)/,`$1`+fr],g],[/samsungbrowser\/([\w\.]+)/i],[g,[u,pr+` Internet`]],[/metasr[\/ ]?([\d\.]+)/i],[g,[u,Ts+` Explorer`]],[/(sogou)mo\w+\/([\d\.]+)/i],[[u,Ts+` Mobile`],g],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[u,g],[/(lbbrowser|rekonq)/i],[u],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[g,u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,Po],g,[l,mr]],[/(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],[u,g,[l,mr]],[/\bgsa\/([\w\.]+) .*safari\//i],[g,[u,`GSA`],[l,mr]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[g,[u,`TikTok`],[l,mr]],[/\[(linkedin)app\]/i],[u,[l,mr]],[/(chromium)[\/ ]([-\w\.]+)/i],[u,g],[/headlesschrome(?:\/([\w\.]+)| )/i],[g,[u,Ss+` Headless`]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[g,[u,Ui+` WebView2`]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,Ss+` WebView`],g],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[g,[u,`Android`+fr]],[/chrome\/([\w\.]+) mobile/i],[g,[u,Ot+`Chrome`]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,g],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[g,[u,Ot+`Safari`]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[u,Ot+`Safari`]],[/version\/([\w\.\,]+) .*(safari)/i],[g,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[g,`1`]],[/(webkit|khtml)\/([\w\.]+)/i],[u,g],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[u,Ot+ur],g],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,`Netscape`],g],[/(wolvic|librewolf)\/([\w\.]+)/i],[u,g],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[g,[u,ur+` 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],[u,[g,/_/g,`.`]],[/(cobalt)\/([\w\.]+)/i],[u,[g,/[^\d\.]+./,Mt]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[Z,`amd64`]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[Z,`ia32`]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[Z,`arm64`]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[Z,`armhf`]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[Z,`arm`]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[Z,/ower/,Mt,Oe]],[/ sun4\w[;\)]/i],[[Z,`sparc`]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[Z,Oe]]],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],[p,[d,pr],[l,k]],[/\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],[p,[d,pr],[l,S]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[d,At],[l,S]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[d,At],[l,k]],[/(macintosh);/i],[p,[d,At]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[d,Es],[l,S]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[p,[d,Cs],[l,k]],[/honor([-\w ]+)[;\)]/i],[p,[d,Cs],[l,S]],[/\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],[p,[d,bs],[l,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[d,bs],[l,S]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[p,/_/g,` `],[d,xo],[l,k]],[/\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],[[p,/_/g,` `],[d,xo],[l,S]],[/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],[p,[d,ys],[l,S]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[d,To],[l,S]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[p,[d,Ee,{OnePlus:[`203`,`304`,`403`,`404`,`413`,`415`],"*":To}],[l,k]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[p,[d,`BLU`],[l,S]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[d,`Vivo`],[l,S]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[d,`Realme`],[l,S]],[/(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],[p,[d,yo],[l,k]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[p,[d,yo],[l,S]],[/\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],[p,[d,So],[l,S]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[d,So],[l,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[d,Ni],[l,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[d,Ni],[l,S]],[/(nokia) (t[12][01])/i],[d,p,[l,k]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[p,/_/g,` `],[l,S],[d,`Nokia`]],[/(pixel (c|tablet))\b/i],[p,[d,lt],[l,k]],[/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],[p,[d,lt],[l,S]],[/(google) (pixelbook( go)?)/i],[d,p],[/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],[p,[d,dr],[l,S]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,`Xperia Tablet`],[d,dr],[l,k]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[d,Li],[l,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,`Fire Phone $1`],[d,Li],[l,S]],[/(playbook);[-\w\),; ]+(rim)/i],[p,d,[l,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[d,vs],[l,S]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[d,ws],[l,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[d,ws],[l,S]],[/(nexus 9)/i],[p,[d,`HTC`],[l,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[p,/_/g,` `],[l,S]],[/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],[p,[d,`TCL`],[l,k]],[/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],[p,[d,`TCL`],[l,S]],[/(itel) ((\w+))/i],[[d,Oe],p,[l,Ee,{tablet:[`p10001l`,`w7001`],"*":`mobile`}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[d,`Acer`],[l,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[d,`Meizu`],[l,S]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[d,`Ulefone`],[l,S]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[d,`Energizer`],[l,S]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[d,`Cat`],[l,S]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[d,`Smartfren`],[l,S]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[p,[d,`Nothing`],[l,S]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[p,[d,`Archos`],[l,k]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[p,[d,`Archos`],[l,S]],[/; (n159v)/i],[p,[d,`HMD`],[l,S]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[d,p,[l,k]],[/(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],[d,p,[l,S]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[d,p,[l,k]],[/(surface duo)/i],[p,[d,Eo],[l,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[d,`Fairphone`],[l,S]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[p,[d,Io],[l,k]],[/(sprint) (\w+)/i],[d,p,[l,S]],[/(kin\.[onetw]{3})/i],[[p,/\./g,` `],[d,Eo],[l,S]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[d,Do],[l,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[d,Do],[l,S]],[/smart-tv.+(samsung)/i],[d,[l,W]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,`SmartTV`],[d,pr],[l,W]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[d,p,[l,W]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,Ni],[l,W]],[/(apple) ?tv/i],[d,[p,At+` TV`],[l,W]],[/crkey.*devicetype\/chromecast/i],[[p,je+` Third Generation`],[d,lt],[l,W]],[/crkey.*devicetype\/([^/]*)/i],[[p,/^/,`Chromecast `],[d,lt],[l,W]],[/fuchsia.*crkey/i],[[p,je+` Nest Hub`],[d,lt],[l,W]],[/crkey/i],[[p,je],[d,lt],[l,W]],[/(portaltv)/i],[p,[d,Po],[l,W]],[/droid.+aft(\w+)( bui|\))/i],[p,[d,Li],[l,W]],[/(shield \w+ tv)/i],[p,[d,Io],[l,W]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[d,Es],[l,W]],[/(bravia[\w ]+)( bui|\))/i],[p,[d,dr],[l,W]],[/(mi(tv|box)-?\w+) bui/i],[p,[d,xo],[l,W]],[/Hbbtv.*(technisat) (.*);/i],[d,p,[l,W]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,/.+\/(\w+)/,`$1`,Ee,{LG:`lge`}],[p,Vi],[l,W]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[p,[l,W]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:|large screen[\w ]+safari)\b/i],[[l,W]],[/(playstation \w+)/i],[p,[d,dr],[l,wr]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[d,Eo],[l,wr]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[d,p,[l,wr]],[/droid.+; (shield)( bui|\))/i],[p,[d,Io],[l,wr]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[p,[d,pr],[l,ye]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[d,p,[l,ye]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[p,[d,To],[l,ye]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[d,At],[l,ye]],[/(opwwe\d{3})/i],[p,[d,ys],[l,ye]],[/(moto 360)/i],[p,[d,So],[l,ye]],[/(smartwatch 3)/i],[p,[d,dr],[l,ye]],[/(g watch r)/i],[p,[d,Ni],[l,ye]],[/droid.+; (wt63?0{2,3})\)/i],[p,[d,Do],[l,ye]],[/droid.+; (glass) \d/i],[p,[d,lt],[l,Oi]],[/(pico) (4|neo3(?: link|pro)?)/i],[d,p,[l,Oi]],[/(quest( \d| pro)?s?).+vr/i],[p,[d,Po],[l,Oi]],[/mobile vr; rv.+firefox/i],[[l,Oi]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[l,vr]],[/(aeobc)\b/i],[p,[d,Li],[l,vr]],[/(homepod).+mac os/i],[p,[d,At],[l,vr]],[/windows iot/i],[[l,vr]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+?(mobile|vr|\d) safari/i],[p,[l,Ee,{mobile:`Mobile`,xr:`VR`,"*":k}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[l,S]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[p,[d,`Generic`]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[g,[u,Ui+`HTML`]],[/(arkweb)\/([\w\.]+)/i],[u,g],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[g,[u,`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],[u,g],[/ladybird\//i],[[u,`LibWeb`]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[g,u]],os:[[/(windows nt) (6\.[23]); arm/i],[[u,/N/,`R`],[g,Ee,xs]],[/(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],[u,g],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[g,/(;|\))/g,``,Ee,xs],[u,Lo]],[/(windows ce)\/?([\d\.]*)/i],[u,g],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[g,/_/g,`.`],[u,`iOS`]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[u,`macOS`],[g,/_/g,`.`]],[/android ([\d\.]+).*crkey/i],[g,[u,je+` Android`]],[/fuchsia.*crkey\/([\d\.]+)/i],[g,[u,je+` Fuchsia`]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[g,[u,je+` SmartSpeaker`]],[/linux.*crkey\/([\d\.]+)/i],[g,[u,je+` Linux`]],[/crkey\/([\d\.]+)/i],[g,[u,je]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[g,u],[/(ubuntu) ([\w\.]+) like android/i],[[u,/(.+)/,`$1 Touch`],g],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[u,g],[/\(bb(10);/i],[g,[u,vs]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[g,[u,`Symbian`]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[g,[u,ur+` OS`]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[g,[u,`webOS`]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[g,Ee,{25:`120`,24:`108`,23:`94`,22:`87`,6:`79`,5:`68`,4:`53`,3:`38`,2:`538`,1:`537`,"*":`TV`}],[u,`webOS`]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[g,[u,`watchOS`]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[u,`Chrome OS`],g],[/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],[u,g],[/(sunos) ?([\d\.]*)/i],[[u,`Solaris`],g],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[u,g]]},Mi=(function(){var r={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return Le.call(r.init,[[Q,[u,g,br,l]],[Ae,[Z]],[Se,[l,p,d]],[he,[u,g]],[de,[u,g]]]),Le.call(r.isIgnore,[[Q,[g,br]],[he,[g]],[de,[g]]]),Le.call(r.isIgnoreRgx,[[Q,/ ?browser$/i],[de,/ ?os$/i]]),Le.call(r.toString,[[Q,[u,g]],[Ae,[Z]],[Se,[d,p]],[he,[u,g]],[de,[u,g]]]),r})(),lc=function(r,e){var t=Mi.init[e],i=Mi.isIgnore[e]||0,o=Mi.isIgnoreRgx[e]||0,n=Mi.toString[e]||0;function s(){Le.call(this,t);}return s.prototype.getItem=function(){return r},s.prototype.withClientHints=function(){return ze?ze.getHighEntropyValues(ks).then(function(c){return r.setCH(new As(c,false)).parseCH().get()}):r.parseCH().get()},s.prototype.withFeatureCheck=function(){return r.detectFeature().get()},e!=Lt&&(s.prototype.is=function(c){var m=false;for(var C in this)if(this.hasOwnProperty(C)&&!No(i,C)&&Oe(o?Ft(o,this[C]):this[C])==Oe(o?Ft(o,c):c)){if(m=true,c!=Ke)break}else if(c==Ke&&m){m=!m;break}return m},s.prototype.toString=function(){var c=Mt;for(var m in n)typeof this[n[m]]!==Ke&&(c+=(c?` `:Mt)+this[n[m]]);return c||Ke}),ze||(s.prototype.then=function(c){var m=this,C=function(){for(var O in m)m.hasOwnProperty(O)&&(this[O]=m[O]);};C.prototype={is:s.prototype.is,toString:s.prototype.toString};var w=new C;return c(w),w}),new s};function As(r,e){if(r=r||{},Le.call(this,ks),e)Le.call(this,[[Mo,Ro(r[Xe])],[Uo,Ro(r[Za])],[S,/\?1/.test(r[ic])],[p,hr(r[oc])],[Nt,hr(r[_s])],[Fo,hr(r[nc])],[Z,hr(r[ec])],[mt,Ro(r[rc])],[Wi,hr(r[tc])]]);else for(var t in r)this.hasOwnProperty(t)&&typeof r[t]!==Ke&&(this[t]=r[t]);}function Rs(r,e,t,i){return this.get=function(o){return o?this.data.hasOwnProperty(o)?this.data[o]:void 0:this.data},this.set=function(o,n){return this.data[o]=n,this},this.setCH=function(o){return this.uaCH=o,this},this.detectFeature=function(){if(ee&&ee.userAgent==this.ua)switch(this.itemType){case Q:ee.brave&&typeof ee.brave.isBrave==Fi&&this.set(u,`Brave`);break;case Se:!this.get(l)&&ze&&ze[S]&&this.set(l,S),this.get(p)==`Macintosh`&&ee&&typeof ee.standalone!==Ke&&ee.maxTouchPoints&&ee.maxTouchPoints>2&&this.set(p,`iPad`).set(l,k);break;case de:!this.get(u)&&ze&&ze[Nt]&&this.set(u,ze[Nt]);break;case Lt:var o=this.data,n=function(s){return o[s].getItem().detectFeature().get()};this.set(Q,n(Q)).set(Ae,n(Ae)).set(Se,n(Se)).set(he,n(he)).set(de,n(de));}return this},this.parseUA=function(){return this.itemType!=Lt&&ko.call(this.data,this.ua,this.rgxMap),this.itemType==Q&&this.set(br,_o(this.get(g))),this},this.parseCH=function(){var o=this.uaCH,n=this.rgxMap;switch(this.itemType){case Q:case he:var s=o[Uo]||o[Mo],c;if(s)for(var m in s){var C=s[m].brand||s[m],w=s[m].version;this.itemType==Q&&!/not.a.brand/i.test(C)&&(!c||/Chrom/.test(c)&&C!=Is||c==Ui&&/WebView2/.test(C))&&(C=Ee(C,cc),c=this.get(u),c&&!/Chrom/.test(c)&&/Chrom/.test(C)||this.set(u,C).set(g,w).set(br,_o(w)),c=C),this.itemType==he&&C==Is&&this.set(g,w);}break;case Ae:var O=o[Z];O&&(O&&o[Wi]==`64`&&(O+=`64`),ko.call(this.data,O+`;`,n));break;case Se:if(o[S]&&this.set(l,S),o[p]&&(this.set(p,o[p]),!this.get(l)||!this.get(d))){var F={};ko.call(F,`droid 9; `+o[p]+`)`,n),!this.get(l)&&F.type&&this.set(l,F.type),!this.get(d)&&F.vendor&&this.set(d,F.vendor);}if(o[mt]){var y;if(typeof o[mt]!=`string`)for(var P=0;!y&&P<o[mt].length;)y=Ee(o[mt][P++],Ds);else y=Ee(o[mt],Ds);this.set(l,y);}break;case de:var x=o[Nt];if(x){var v=o[Fo];x==Lo&&(v=parseInt(_o(v),10)>=13?`11`:`10`),this.set(u,x).set(g,v);}this.get(u)==Lo&&o[p]==`Xbox`&&this.set(u,`Xbox`).set(g,void 0);break;case Lt:var L=this.data,A=function(b){return L[b].getItem().setCH(o).parseCH().get()};this.set(Q,A(Q)).set(Ae,A(Ae)).set(Se,A(Se)).set(he,A(he)).set(de,A(de));}return this},Le.call(this,[[`itemType`,r],[`ua`,e],[`uaCH`,i],[`rgxMap`,t],[`data`,lc(this,r)]]),this}function we(r,e,t){if(typeof r===Ut?(Bi(r,true)?(typeof e===Ut&&(t=e),e=r):(t=r,e=void 0),r=void 0):typeof r===Oo&&!Bi(e,true)&&(t=e,e=void 0),t&&typeof t.append===Fi){var i={};t.forEach(function(m,C){i[C]=m;}),t=i;}if(!(this instanceof we))return new we(r,e,t).getResult();var o=typeof r===Oo?r:t&&t[fs]?t[fs]:ee&&ee.userAgent?ee.userAgent:Mt,n=new As(t,true),s=e?ac(Ps,e):Ps,c=function(m){return m==Lt?function(){return new Rs(m,o,s,n).set(`ua`,o).set(Q,this.getBrowser()).set(Ae,this.getCPU()).set(Se,this.getDevice()).set(he,this.getEngine()).set(de,this.getOS()).get()}:function(){return new Rs(m,o,s[m],n).parseUA().get()}};return Le.call(this,[[`getBrowser`,c(Q)],[`getCPU`,c(Ae)],[`getDevice`,c(Se)],[`getEngine`,c(he)],[`getOS`,c(de)],[`getResult`,c(Lt)],[`getUA`,function(){return o}],[`setUA`,function(m){return Bt(m)&&(o=m.length>Ao?Vi(m,Ao):m),this}]]).setUA(o),this}we.VERSION=Qa;we.BROWSER=Hi([u,g,br,l]);we.CPU=Hi([Z]);we.DEVICE=Hi([p,d,l,wr,S,W,k,ye,vr]);we.ENGINE=we.OS=Hi([u,g]);var $i=class{modifications=[];constructor(){Ce$1(`.lc-hide {display: none !important;height: 0 !important;}
76
76
  .lc-display-block {display: block !important;}
77
- .lc-display-inline {display: inline !important;}`,document.body);}execute(e){for(let t of e){if(!t.experimentConfig)continue;this.executeExperiment(t)&&this.trackExperimentRan(t);}if(document.querySelector(`#lc-hide-body`)?.remove(),!document.body){Zn$1(`No body element found`,`error`);return}this.setupMutationObserver();}executeExperiment(e){let t=e.experimentConfig?.modifications;if(!t?.length)return Y$1.log(`Nothing to experiment`,e.toString()),true;let i=false;for(let o of t){if(!o.cssSelector){Y$1.verbose(`No CSS Selector available`,e?.toString());continue}this.modifications.push(o);let n=Array.from(document.querySelectorAll(o.cssSelector));n?.length&&(this.executeSingleModification(o,n),i=true);}return i}executeSingleModification(e,t){if(t?.length)for(let i of t)Object.assign(i.style,e.style),e.display===`HIDE`?i.classList.add(`lc-hide`):e.display===`BLOCK`?i.classList.add(`lc-display-block`):e.display===`INLINE`&&i.classList.add(`lc-display-inline`),e.type===`TEXT`&&e.text?i.innerHTML=e.text:e.type===`IMAGE`&&this.updateImage(e,i),e.moveTo?.selector&&this.changePlacement(e,i).catch(console.error);}async changePlacement(e,t){let i=await Ln$1(e.moveTo.selector);if(i)switch(e.moveTo.position){case Ve$3.BEFORE1:t.nextElementSibling!==i&&i.parentElement?.insertBefore(t,i);break;case Ve$3.INSIDE_FIRST1:i.firstChild!==t&&i.insertBefore(t,i.firstChild);break;case Ve$3.INSIDE_LAST1:i.lastChild!==t&&i.appendChild(t);break;case Ve$3.AFTER1:default:t.previousElementSibling!==i&&i.parentElement?.insertBefore(t,i.nextSibling);}}trackExperimentRan(e){if(e.id===`preview`){Y$1.warn(`Skipping experiment attribution as its preview`,e.toString());return}Os({name:`CE Experiment Start`,experiment:new mt$1(e)}).catch(t=>{Y$1.error(`Fail to track experiment`,t);});}setupMutationObserver(){new MutationObserver(t=>{t.forEach(i=>{i.addedNodes.forEach(o=>{o instanceof HTMLElement&&this.modifications.forEach(n=>{if(o.matches&&o.matches(n.cssSelector))Y$1.verbose(`1. Re-applying experiment`,n.toString()),this.executeSingleModification(n,[o]);else if(o.querySelectorAll){let s=Array.from(o.querySelectorAll(n.cssSelector));if(!s.length)return;Y$1.verbose(`2. Re-applying experiment`,n.toString()),this.executeSingleModification(n,s);}});});});}).observe(document.body,{childList:true,subtree:true});}updateImage(e,t){let i=e.image?.lg?.src,o=e.image?.sm?.src;!i&&!o||(t instanceof HTMLPictureElement?this.updatePictureElement({desktop:i,mobile:o},t):this.updateImageElement({desktop:i,mobile:o},t));}updateImageElement(e,t){M$1()&&e.mobile?(t.setAttribute(`src`,e.mobile),t.removeAttribute(`srcset`)):e.desktop&&(t.setAttribute(`src`,e.desktop),t.removeAttribute(`srcset`));}updatePictureElement(e,t){if(t.innerHTML=``,e.mobile){let o=document.createElement(`source`);o.srcset=e.mobile,o.media=`(max-width: 767px)`,t.append(o);}if(e.desktop){let o=document.createElement(`source`);o.srcset=e.desktop,o.media=`(min-width: 768px)`,t.append(o);}let i=document.createElement(`img`);i.src=e.desktop??e.mobile??``,t.append(i);}};async function Os(r$10){let e=await $e();await me(`/v1/event/experiment`,r(r({},r$10),e));}function qi(){mc().catch(r=>ke$2(r,`fetch-experiments`));}async function mc(){Be$3().activeExperiments&&(await le$1(le),await pc());}async function pc(){Y$1.info(`Fetch experiments after ⏰`,en()+` of SDK load`);me(`/v1/engagement/experiments`,r({},await $e())).then(async t=>{Y$1.info(`Experiments fetched ${Jr$3(t.timeTakenMs)}`);let i=t.data.experiments.map(o=>new j(o));new $i().execute(i);}).catch(t=>{Y$1.error(`Error sending experiment getter`,t);});}function Ls(){let r=he$3.get();!r.gaMeasurementID||!r.gaEnabled||uc();}async function dc(){let r=await fe$4.get(`gacid`),e=await gc();if(r!==e)return await fe$4.set(`gacid`,e),e}async function uc(){let r=await dc();r&&Yn({gaClientID:r});}async function gc(){let e=he$3.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(t=>{window.gtag(`get`,e,`client_id`,i=>{t(i);});})}async function Ns(r){Y$1.verbose(`Received app configuration`,r),r.currencyCount=r.currencies?.length;let e=D.globalRef.config.update(r);Ls(),V.initialize(),e.website&&(Ui$1(e.website.commonJS),Ce$1(e.website.commonCSS)),window.CooeeSDK.cartDrawerToggle$.pipe(Fe$1(10)).subscribe(async({open:t})=>{Y$1.info(`Cart drawer is now`,t?`open`:`closed`),t&&(ms(),await fc());});}function Ms(r){D.globalRef.apiURLs=r;}async function fc(){let r=await E.getCurrent().getNormalisedCart(),e={value:r.amount,currency:r.currency};K(new Ir$1(`View Cart`,{items:r.items,amount:e,drawer:true}));}var Gi=class{runtimeData=Be$3();meddle(){let e=D.globalRef;e.profile=e.profile??[],e.events=e.events??[],e.page=e.page??[],this.meddlePage(),this.meddleEvents(),this.meddleProfile(),this.exposeMethods();}exposeMethods(){let e=D.globalRef;e.loadWidgets=e.loadCartWidgets=e.loadPageWidgets=()=>{Vt();},e.loadExperiments=()=>{qi();},e.testCartUpdate=this.testCartUpdate.bind(this),e.previewWidget=D.previewWidget.bind(D),e.previewPopup=D.previewPopup.bind(D),e.executeCTA=(t,i)=>{new Re(t).execute(i);},e.sendEvent=t=>{K(t);};}overwritePush(e,t){Pn(e,`push`,t);}meddleEvents(){this.overwritePush(D.globalRef.events,(...e)=>{this.processEvent(e[0]);}),D.globalRef.events.forEach(this.processEvent.bind(this));}meddleProfile(){this.overwritePush(D.globalRef.profile,(...e)=>{this.processProfile(e[0]);}),D.globalRef.profile.forEach(this.processProfile.bind(this));}processEvent(e){e&&(zr$3.includes(e[0])?D.sendEvent(e[0],e[1],r({occurred:this.runtimeData.jsLoadTime},e[2])):D.sendEvent(e[0],e[1],e[2]));}processProfile(e){e&&D.updateProfile(e);}meddlePage(){this.overwritePush(D.globalRef.page,(...e)=>{this.processPage(e[0]);}),D.globalRef.page.forEach(this.processPage.bind(this));}processPage(e){e.appID&&D.authenticate(e),e.currentItem&&hc(e.currentItem),e.currency&&(Be$3().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&&D.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiments=e.activeExperiment),e.cart&&E.getCurrent().update(e.cart),e.configurations&&Ns(e.configurations),e.apiURLs&&Ms(e.apiURLs),e.customContext&&(this.runtimeData.customContext=r(r({},this.runtimeData.customContext),e.customContext));}async testCartUpdate(){if(Be$3().pageName!==`product`){window.alert(`This feature is only available on a product page`);return}let e=ss();if(e||(e=Be$3().currentItem?.vID),!e){window.alert(`Could not find a variant to test. Please try a different product page`);return}let t=new j({id:`preview`,shortID:`1`,redirectBehaviour:Me$1.CART_DRAWER});await new Re(new Fe(new Date,t)).execute({clickAction:{at:He$3.ADD_TO_CART},embeddedItem:new et({vID:e})});}};function hc(r){let e=Be$3();if(e.currentItem&&e.currentItem.vID!==r.vID){let t=new CustomEvent(`letscooee:variant-change`,{detail:{variantID:r.vID,productID:r.mID}});document.dispatchEvent(t);}e.currentItem=new et(r);}var Wt=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=`cooee`.concat(`-`);static getString(e,t){return this.getItem(e)||t}static setString(e,t){this.setItem(e,t);}static remove(e){this.removeItem(e);}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,t){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),t);}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e));}};var wc=1e3,vc=10,Bo=0,Vo=new Date;function Wo(r){Wt.remove(`sleid`),Vo=r??new Date;}function Us(){if(window.scrollY){let r=Vs();Fs(r)&&Bs(r);}ht$2(()=>{bc();});}function bc(){Tr(window,`scroll`).pipe(Fe$1(wc),q$1(()=>{let r=Vs();if(r>100){Y$1.warn(`Received scroll percent is more than 100`,r);return}if(Fs(r))return r})).subscribe(r=>{Bs(r);});}function Fs(r){return Math.abs(Bo-r)>=vc||Bo!==r&&r===100}function Bs(r){if(r==null)return;let e={percent:r,timeMS:new Date().getTime()-Vo.getTime()};Bo=r;let i=new Ir$1(`CE Scroll`,e,null,Wt.getString(`sleid`,``));K(i),Wt.setString(`sleid`,i.id.toHexString()),Vo=new Date(i.occurred);}function Vs(){let r=window.document.body.scrollHeight,e=window.innerHeight;return Math.ceil((window.scrollY+e)/r*100)}function Ws(){document.onvisibilitychange=()=>{document.visibilityState===`visible`?Cc():document.visibilityState===`hidden`&&yc();};}async function Cc(){}async function yc(){let r=await Ec();if(r===0){Y$1.info(`Not sending duration as user was inactive on website`);return}$s(r);}async function Ec(){let r=Be$3();return r.inInactive?0:(r.inInactive=true,r.lastEnterInactive=new Date,Math.max(r.lastEnterInactive.getTime()-r.lastEnterActive.getTime(),0))}function Hs(){let r=Be$3();return r.inInactive?(r.inInactive=false,r.lastEnterActive=new Date,Math.max((r.lastEnterActive.getTime()-r.lastEnterInactive.getTime())/1e3,0)):0}function qs(){Sc();}function Sc(){let r=window.fetch;try{window.fetch=async function(e,t){try{await Ic(e,t);}catch(i){ke$2(i,`modify-graphql-request`,{extra:{body:JSON.stringify(t?.body)}});}return r(e,t)};}catch(e){console.warn(`Fail to override fetch.`,`Cooee won't be able to track "Buy Now Clicked" KPI.`),Y$1.error(e);}Y$1.verbose(`Securely overwritten window.fetch method for graphql query`);}async function Ic(r,e){let t=typeof r==`string`?r:r instanceof Request?r.url:``;if(!(t.includes(`graphql.json`)&&e?.method===`POST`)||!e.body)return;let i;if(typeof e.body==`string`)try{i=JSON.parse(e.body);}catch{return}else i=e.body;i?.variables?.input&&(Y$1.verbose(`Intercepted fetch request of:`,t),i?.query.includes(`cartCreate`)&&(e.body=await Tc(i),xc()));}async function Tc(r){let e=r.variables.input.attributes??[],t=await On$1(`Buy Now`);return r.variables.input.attributes=[...e,...t],JSON.stringify(r)}function xc(){let r=Be$3().currentItem;if(!r)return;K(new Ir$1(`Buy Now Clicked`,{items:[r]}));}var Ht=class{constructor(e,t){this.selectors=e;this.eventName=t;this.selectorString=e.join(`,`);}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let t=e.currentTarget;K(new Ir$1(this.eventName,{class:t.className||void 0,tagName:t.tagName||void 0,id:t.id||void 0})),this.removeClickListener(this.clickListenerCallback);};listenSilently(){this.listen().catch(e=>Y$1.error(e));}async listen(){this.elements=await Ar$1(this.selectorString),this.elements.forEach(e=>{e.addEventListener(`click`,this.clickListenerCallback);});}removeClickListener(e){this.elements?.forEach(t=>{t.removeEventListener(`click`,e);});}};var ji=class r extends Ht{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(r.selectors,`Item Thumbnail Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new r),this.INSTANCE}};var zi=class r extends Ht{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(r.selectors,`Review Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new r),this.INSTANCE}};var Dc=[`.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 Gs(){ht$2(()=>{Y$1.verbose(`Execution order:`,`document ready`),Pc();});}function Pc(){let r=window.location.hash?.substring(1);if(r)if(r.includes(`initiate-checkout`)){document.dispatchEvent(new Event(`letscooee:outbound:third-party-initiate-checkout`));let e=document.querySelector(Dc);if(!e){Y$1.verbose(`No clickable cart checkout button found`);return}Y$1.verbose(`Clickable cart checkout button found`,e),e.click();}else r.includes(`open-cart-drawer`)&&V.get().open();}function zs(){window.addEventListener(`kp-modal:opened`,()=>{Be$3().isGoKwikPopupOpen=true;}),window.addEventListener(`user-loggedin`,r=>{let{token:e}=r.detail;e&&Rt({goKwikToken:e});}),window.gokwikSdk?js():window.addEventListener(`gokwikLoaded`,js);}function js(){window.gokwikSdk&&window.gokwikSdk.on(`checkout_initiated`,async()=>{let r=await E.getCurrent().getNormalisedCart();K(new Ir$1(`Checkout Started`,{via:`GoKwik`,items:r.items,cartToken:r.token,amount:{value:r.amount,currency:r.currency}}));});}var D=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(e){if(!window.cooeeSDKPreview){if(Y$1.info(`Initialising SDK`),gs(navigator.userAgent)){Y$1.info(`This seems to be a bot. Disabling SDK`);return}this.initGlobalReference(e),await Xs(),this.autoAuthenticate(),new Gi().meddle(),zn(),qi(),Rc(),Ws(),Hn(),qs(),Gs(),Us(),zi.getInstance().listenSilently(),ji.getInstance().listenSilently(),zs(),_c(),Gn$1(),po(),Ai.remove(`conf`).catch(t=>{Y$1.error(`Fail to remove App Config from local storage`,t);});}}static initGlobalReference(e){window.CooeeSDK||Pn(window,`CooeeSDK`,{}),this.globalRef=window.CooeeSDK,Pn(this.globalRef,`config`,new he$3),Pn(this.globalRef,`runtimeData`,{sdkLoadTime:e,jsLoadTime:new Date,lastEnterActive:new Date}),Pn(this.globalRef,`uaParser`,new we,true),Pn(this.globalRef,`cart`,E.getCurrent()),Pn(this.globalRef,`cartChange$`,Wn()),Pn(this.globalRef,`cartDrawerToggle$`,V.cartDrawerToggle$.asObservable()),Y$1.verbose(`Global reference initialised`),new le$3(()=>{this.globalRef.uaParser=new we;});}static autoAuthenticate(){let e=Xr();e&&this.authenticate({shopifyShop:e});}static authenticate(e){if(this.authenticated)return;Y$1.info(`Begin auth after ⏰`,en(),`of SDK load`);let t=e.appID?.trim(),i=e.shopifyShop;if((Rn(t)||t.length!==24)&&Rn(i)){Y$1.warn(`Cooee App ID or Shop name is not configured`);return}this.authenticated=true,Ks(e);}static sendEvent(e,t,i){let o=new Ir$1(e,t,i?.triggerData);i?.occurred&&(o.occurred=i.occurred),K(o);}static updateProfile(e){for(let t in e)if(t.toLowerCase().startsWith(`ce `))throw new Error(`User property name cannot start with 'CE '`);Rt(e);}static setPageName(e){if(!e)return;let t=Be$3(),i=t.pageName;if(e===i)return;if(t.pageName=e,Yr$3.some(s=>e.includes(s))){Wo();return}let o={};i&&(o.ps=i);let n=new Ir$1(`CE Screen View`,o);n.occurred=t.jsLoadTime,K(n),Wo(n.occurred);}static previewPopup(e,t){import('./renderer-BpHcv0Tu-BjlOyaqx.js').then(({FreeformRenderer:i})=>{new i(t).render(e);});}static previewWidget(e){new X(new j(e)).renderSilently();}};function Rc(){window.CooeeSDK.cartChange$.subscribe(()=>{Vt();});}function _c(){if(window.opener){try{window.opener.postMessage({action:`COOEE_READY_FOR_PREVIEW`},`*`);}catch(r){Y$1.error(r);}window.addEventListener(`message`,r=>{if(Y$1.verbose(`Received event`,r),!r.origin.includes(`letscooee.com`)&&!r.origin.includes(`localhost`))return;let e=r.data;typeof e==`object`&&(e.action===`POPUP_PREVIEW`?(D.previewPopup(e.engagementTrigger),r.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},r.origin)):e.action===`WIDGET_PREVIEW`&&(D.previewWidget(e.engagementTrigger),r.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},r.origin)));});}}var Js=new U,Ys=0;Js.pipe(Fe$1(50)).subscribe(async r=>{kc(await $e()).catch(t=>{ke$2(t,`load-page-widgets`,{extra:{firstLoad:r}});});});function Vt(r=false){le$1(le).then(()=>{Js.next(r);});}async function as(r){let e=await $e();return Object.assign(r,e),me(`/v1/engagement/get-variant`,r)}async function kc(r$11){Ys++,Ys===1?Y$1.info(`Fetch widgets (after ⏰`,en()+` of SDK load)`):Y$1.info(`Fetch widgets`);let e=r({},r$11),t=Vn$1(`/v1/engagement/eligible`,D.globalRef.apiURLs?.engagementsURL);try{let i=await me(t,e);if(Y$1.info(`Widgets fetched ${Jr$3(i.timeTakenMs)}`),i.data.pageWidgets?.length)cr(i.data.pageWidgets.map(n=>new j(n)));if(i.data.cartWidgets?.length)ar(i.data.cartWidgets.map(n=>new j(n)));}catch(i){Y$1.error(`Error sending widget getter`,i);}}var Qs=x$2(dr$2()),Ki=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 Qs.URLBuilder(location.href);}catch{return {}}let t={};if(this.META_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))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(n=>Array.from(e.getParams().keys()).includes(n)))return t={source:`GOOGLE`},new r(t)}};var Ho={d:(r,e)=>{for(var t in e)Ho.o(e,t)&&!Ho.o(r,t)&&Object.defineProperty(r,t,{enumerable:true,get:e[t]});},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},$o={};Ho.d($o,{A:()=>Ac,k:()=>qo});var Cr=function(r,e,t,i){return new(t||(t=Promise))(function(o,n){function s(C){try{m(i.next(C));}catch(w){n(w);}}function c(C){try{m(i.throw(C));}catch(w){n(w);}}function m(C){var w;C.done?o(C.value):(w=C.value,w instanceof t?w:new t(function(O){O(w);})).then(s,c);}m((i=i.apply(r,[])).next());})},yr=function(r,e){var t,i,o,n,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:c(0),throw:c(1),return:c(2)},typeof Symbol==`function`&&(n[Symbol.iterator]=function(){return this}),n;function c(m){return function(C){return (function(w){if(t)throw new TypeError(`Generator is already executing.`);for(;n&&(n=0,w[0]&&(s=0)),s;)try{if(t=1,i&&(o=2&w[0]?i.return:w[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,w[1])).done)return o;switch(i=0,o&&(w=[2&w[0],o.value]),w[0]){case 0:case 1:o=w;break;case 4:return s.label++,{value:w[1],done:!1};case 5:s.label++,i=w[1],w=[0];continue;case 7:w=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||w[0]!==6&&w[0]!==2)){s=0;continue}if(w[0]===3&&(!o||w[1]>o[0]&&w[1]<o[3])){s.label=w[1];break}if(w[0]===6&&s.label<o[1]){s.label=o[1],o=w;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(w);break}o[2]&&s.ops.pop(),s.trys.pop();continue}w=e.call(r,s);}catch(O){w=[6,O],i=0;}finally{t=o=0;}if(5&w[0])throw w[1];return {value:w[0]?w[1]:void 0,done:true}})([m,C])}}};function qo(){return Cr(this,void 0,Promise,function(){return yr(this,function(r){switch(r.label){case 0:return [4,new Promise(function(e,t){var i=`Unknown`,o=false;function n(y){o||(o=true,e({isPrivate:y,browserName:i}));}function s(){var y=0,P=parseInt(`-1`);try{P.toFixed(P);}catch(x){y=x.message.length;}return y}function c(){return navigator.msSaveBlob!==void 0&&(function(y){try{return y===eval.toString().length}catch{return false}})(39)}function m(){var y;return Cr(this,void 0,void 0,function(){var P,x;return yr(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),n(false),[3,3];case 2:return P=v.sent(),x=P,P instanceof Error&&(x=(y=P.message)!==null&&y!==void 0?y:P),typeof x!=`string`?(n(false),[2]):(n(!!x.includes(`unknown transient reason`)),[3,3]);case 3:return [2]}})})}function C(){var y;return Cr(this,void 0,Promise,function(){return yr(this,function(P){switch(P.label){case 0:return ((y=navigator.storage)===null||y===void 0?void 0:y.getDirectory)===void 0?[3,2]:[4,m()];case 1:return P.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var x=String(Math.random());try{var v=indexedDB.open(x,1);v.onupgradeneeded=function(L){var A=L.target.result,b=function(Je){n(Je);};try{A.createObjectStore(`t`,{autoIncrement:!0}).put(new Blob),b(!1);}catch(Je){(Je.message||``).includes(`are not yet supported`)?b(!0):b(!1);}finally{A.close(),indexedDB.deleteDatabase(x);}},v.onerror=function(){return n(!1)};}catch{n(false);}})():(function(){var x=window.openDatabase,v=window.localStorage;try{x(null,null,null,null);}catch{n(true);return}try{v.setItem(`test`,`1`),v.removeItem(`test`);}catch{n(true);return}n(false);})(),P.label=3;case 3:return [2]}})})}function w(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(y,P){var x;n(Math.round(P/1048576)<2*Math.round(((x=window).performance!==void 0&&x.performance.memory!==void 0&&x.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576));},function(y){t(new Error(`detectIncognito somehow failed to query storage quota: `+y.message));});}function O(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?w():(0, window.webkitRequestFileSystem)(0,1,function(){n(false);},function(){n(true);});}function F(){return Cr(this,void 0,Promise,function(){var y,P;return yr(this,function(x){switch(x.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return [3,4];x.label=1;case 1:return x.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return x.sent(),n(false),[3,4];case 3:return y=x.sent(),typeof(P=y instanceof Error&&typeof y.message==`string`?y.message:String(y))!=`string`?(n(false),[2]):(n(P.includes(`Security error`)),[2]);case 4:return n(navigator.serviceWorker===void 0),[2]}})})}(function(){return Cr(this,void 0,Promise,function(){return yr(this,function(y){switch(y.label){case 0:return s()!==44?[3,2]:(i=`Safari`,[4,C()]);case 1:return y.sent(),[3,6];case 2:return s()!==51?[3,3]:(P=navigator.userAgent,i=P.match(/Chrome/)?navigator.brave!==void 0?`Brave`:P.match(/Edg/)?`Edge`:P.match(/OPR/)?`Opera`:`Chrome`:`Chromium`,O(),[3,6]);case 3:return s()!==25?[3,5]:(i=`Firefox`,[4,F()]);case 4:return y.sent(),[3,6];case 5:c()?(i=`Internet Explorer`,n(window.indexedDB===void 0)):t(new Error(`detectIncognito cannot determine the browser`)),y.label=6;case 6:return [2]}var P;})})})().catch(t);})];case 1:return [2,r.sent()]}})})}typeof window<`u`&&(window.detectIncognito=qo);var Ac=qo,Zs=$o.A;$o.k;var ea=x$2(yt$1()),ta=async()=>{let r={};try{return await Oc(r)}catch(e){return ke$2(e,`device-properties`),r}},Oc=async r=>{let e=window.CooeeSDK.uaParser;Lc(r),Nc(r),Mc(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:Uc()},r.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(r.headless=true,ro({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([Vc(r),Fc(r),Wc(r)]),r},Lc=r=>{let e=navigator;if(!e.deviceMemory)return;r.mem={tot:e.deviceMemory*1024};},Nc=r=>{let e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;t?.effectiveType&&(r.net={type:t.effectiveType});},Mc=r=>{let e=screen.orientation?.type;e&&(r.orientation=e);},Uc=()=>{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},Fc=async r=>{try{await Bc(r);}catch(e){Y$1.error(`Unable to get location`,e);}},Bc=async r=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:`geolocation`})).state!=`granted`))return new Promise(t=>{navigator.geolocation.getCurrentPosition(i=>{r.coords=[i.coords.latitude,i.coords.longitude],t();},()=>t());})},Vc=async r=>{if(`getBattery`in navigator)try{let t=await navigator.getBattery();r.bat={l:t.level*100,c:t.charging},ro({"battery.level":r.bat.l,"battery.charging":r.bat.c});}catch{}},Wc=async r=>{try{(await Zs())?.isPrivate&&(r.incognito=!0,ro({incognito:!0}));}catch(e){ea.default.error(`Unable to detect private/incognito window`,e);}};function ia(r){if(!oa())return;let e=Ye$2[r]?.toLowerCase();e&&(Y$1.verbose(`Sending ${e} intent to MS Clarity`),window.clarity(`set`,`Cooee Intent`,e));}function oa(){return window.clarity&&typeof window.clarity==`function`}var le=new gr$1(1),sa=`App ID or Shopify shop is not set`,Go=``,Ye=``,jo=``,Xi;async function Ks(r){Go=r.appID,jo=r.shopifyShop;try{await Hc(),le.next(!0),le.complete();}catch(e){e?.message?.includes(sa)&&ke$2(e,`initiate-session`,{extra:r}),Y$1.error(`Unable to initiate session`,e);}}async function Kn(){return await aa(false),Xi}async function Xs(){let r=Date.now();await gi.request(`gen_did`,async()=>{Ye=await fe$4.get(`did`),Ye||(Ye=new $$1().toHexString(),await fe$4.set(`did`,Ye)),Y$1.info(`Device ID:`,Ye),la(Ye);}),Y$1.info(`Device ID set/get done ${Jr$3(Date.now()-r)}`);}async function na(){if(Xi)return;let[r,e,t]=await Promise.all([ve$2.get(`id`,``),fe$4.get(`sessionNumber`,1),ve$2.get(`landing`,{})]);ca(r,e,t);}async function Hc(){await aa(true);}async function aa(r){let e=false;return await qc()?(await $c(),e=true):await Gc()?(await na(),e=true):await na(),e?await zc():r&&Vt(),e}async function $c(){Y$1.info(`Starting new session`),await ve$2.clear();let r=new Date,e=new $$1().toHexString(),t=await fe$4.get(`sessionNumber`,0)+1,i=vi();await Promise.all([fe$4.set(`sessionNumber`,t),ve$2.set(`id`,e),ve$2.set(`lastUsedTime`,r.getTime()),ve$2.set(`landing`,i)]),ca(e,t,i);}async function qc(){let r=await ve$2.get(`lastUsedTime`,0);return r?(new Date().getTime()-r)/1e3>1800:true}async function Gc(){return !await ve$2.get(`synced`,false)}async function jc(){if(!Go&&!jo)throw new Error(sa);let r$12=await ta(),e=bi();return s(r(r({deviceID:Ye,deviceProps:r$12,appID:Go,shopifyShop:jo},Xi),e),{sdk:Gr$3,ad:Ki.getAdParams(),occurred:Xc(Be$3().jsLoadTime),properties:{},uuid:await fe$4.get(`uuid`)})}async function zc(){Y$1.info(`Ensuring session on server`),await Kc();let r=Date.now(),e=await jc();Y$1.info(`Session data generated ${Jr$3(Date.now()-r)}`);let t=Vn$1(`/v1/event/validate-session`,D.globalRef.apiURLs?.baseURL??`https://cdn.sdk-api1.letscooee.com`);try{let i=await me(t,e);if(Y$1.info(`Auth finished ${Jr$3(i.timeTakenMs)}`),await ve$2.set(`synced`,!0),i.data.deviceID&&(await fe$4.set(`did`,Ye),la(i.data.deviceID)),i.data.pageWidgets?.length)cr(i.data.pageWidgets.map(n=>new j(n)));if(i.data.cartWidgets?.length)ar(i.data.cartWidgets.map(n=>new j(n)));}catch(i){throw Y$1.error(i),i}}async function Kc(){let r=await fe$4.get(`firstSeen`),e=r?new Date(r):new Date;r||await fe$4.set(`firstSeen`,e.toISOString()),Qn(e),to(`Visitor Info`,{first_seen:e.toISOString()});}function ca(r,e,t){ro({"cooee_session.number":e}),to(`Visitor Session`,{id:r,number:e,landing_page:t}),Y$1.info(`Session number: ${e}, id: ${r}`),Xi={sessionID:r,sessionNumber:e,landingPage:t};}function la(r){Jn(r);to(`Visitor Info`,{device_id:r,[`device_id_${Math.floor(Math.random()*1e4)}`]:r}),eo({id:r});}function Xc(r){return (new Date().getTime()-r.getTime())/1e3>1800?new Date:r}var Yi=class{triggerData;render(e){e.contentSource===Be$2.KLAVIYO&&(this.triggerData=e,window.addEventListener(`klaviyoForms`,this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push([`openForm`,e.klaviyoFormID]));}handleKlaviyoEvents(e){if(e.type!==`klaviyoForms`)return;let t=e.detail;if(t.formId!==this.triggerData.klaviyoFormID){Y$1.warn(`Received invalid trigger callback`);return}switch(t.type){case `open`:fe(new Ir$1(`CE Trigger Displayed`,{form:{id:t.formId}},this.triggerData));break;case `stepSubmit`:{let i=this.getFormDetails(t);fe(new Ir$1(`CE Form Submitted`,{form:i},this.triggerData)),Rt(i);break}case `close`:window.removeEventListener(`klaviyoForms`,this.handleKlaviyoEvents.bind(this)),fe(new Ir$1(`CE Trigger Closed`,{form:{id:t.formId}},this.triggerData));break}}getFormDetails(e){let t={id:e.formId},i=e.metaData;if(pe$4.hasKeys(i)){let o=[`email`,`phone_number`,`first_name`,`last_name`,`$email`,`$phone_number`,`$first_name`,`$last_name`];Object.keys(i).forEach(c=>{o.includes(c)||(t[c]=i[c]);}),t.email=i.$email??i.email,t.mobile=i.$phone_number??i.phone_number;let n=i.$first_name??i.first_name,s=i.$last_name??i.last_name;(n?.length||s?.length)&&(t.name=n+` `+s);}return t}};function ma(r){if(!Yc()||!he$3.get().pixelPush)return;let t=Ye$2[r.intent]?.toLowerCase();t&&(Y$1.verbose(`Sending ${t} intent to Facebook Pixel`),window.fbq(`trackCustom`,`CooeeIntent`,{intent_value:t}));}function Yc(){return window.fbq&&typeof window.fbq==`function`}var ho=`/v1/event/track-page-unload`;function K(r){Y$1.verbose(`Waiting for auth to send event ${r.name}`),le$1(le).then(()=>fe(r));}function $s(r){le$1(le).then(()=>{Jc(r);});}async function Jc(r){let e=Be$3().currentPageViewEvent;if(!e){Y$1.warn(`No page view event was stored previously`);return}let t={pageViewEventID:e.id,pageViewEventName:e.name,pageActiveTimeMS:r};Y$1.verbose(`Sending page unload`,t);let i=Vn$1(ho,D.globalRef.apiURLs?.eventURL);try{await me(i,t);}catch(o){throw Y$1.error(`Error sending page unload for ${e} to server`,o),o}}function fe(r){Qc(r);}async function Qc(r){if(Y$1.verbose(`Sending event: ${r.name}`,r),ol(r)){Y$1.warn(`Rejecting event ${r.name}`);return}Nn();let e=await $e();Object.assign(r,e),Hs(),ve$2.set(`lastUsedTime`,new Date().getTime());let t=il(r.name),o=Vn$1(`/v1/event/track/${t.toLowerCase().replace(/\s+/g,`-`)}`,D.globalRef.apiURLs?.eventURL);try{let n=await me(o,r);Y$1.info(`Event tracked:`,t),Zc(r)&&(Be$3().currentPageViewEvent={id:r.id,name:r.name}),el(r,n.data);}catch(n){throw Y$1.error(`Error sending event ${r.name} to server`,n),n}}function Zc(r){return qr$3.includes(r.name)?r.name===`View Cart`?!r.properties.drawer:true:false}function el(r,e){tl(r,e).catch(t=>{ke$2(t,`process-popup-response`,{extra:{event:r,response:e}});}),rl(e);}async function tl(r,e){if(!e.triggerData)return;let t=new j(e.triggerData);t.occurred=r.occurred,Y$1.log(`${t} will be shown`);let i;try{i=await hi(t);}catch(n){Y$1.error(`Failed to refresh the products`,n);return}if(t.items=i,t.contentSource===Be$2.KLAVIYO){new Yi().render(t);return}new(await(import('./renderer-BpHcv0Tu-BjlOyaqx.js'))).FreeformRenderer().renderEngagement(t).catch(n=>{ke$2(n,`render-popup`,{extra:{event:r},engagementTrigger:t});});}function rl(r){r.intent&&(ia(r.intent),ma(r),Y$1.info(`Intent is ${Ye$2[r.intent]}`));}function il(r){return r.replace(`CE `,``).replace(`Trigger`,`Campaign`).replace(`Screen`,`Page`).replace(`App `,``)}function ol(r){return r.trigger?.triggerID===`test`||r.trigger?.triggerID===`preview`?(Y$1.warn(`Not sending event as this is a test trigger`),true):false}
77
+ .lc-display-inline {display: inline !important;}`,document.body);}execute(e){for(let t of e){if(!t.experimentConfig)continue;this.executeExperiment(t)&&this.trackExperimentRan(t);}if(document.querySelector(`#lc-hide-body`)?.remove(),!document.body){Zn$1(`No body element found`,`error`);return}this.setupMutationObserver();}executeExperiment(e){let t=e.experimentConfig?.modifications;if(!t?.length)return Y$1.log(`Nothing to experiment`,e.toString()),true;let i=false;for(let o of t){if(!o.cssSelector){Y$1.verbose(`No CSS Selector available`,e?.toString());continue}this.modifications.push(o);let n=Array.from(document.querySelectorAll(o.cssSelector));n?.length&&(this.executeSingleModification(o,n),i=true);}return i}executeSingleModification(e,t){if(t?.length)for(let i of t)Object.assign(i.style,e.style),e.display===`HIDE`?i.classList.add(`lc-hide`):e.display===`BLOCK`?i.classList.add(`lc-display-block`):e.display===`INLINE`&&i.classList.add(`lc-display-inline`),e.type===`TEXT`&&e.text?i.innerHTML=e.text:e.type===`IMAGE`&&this.updateImage(e,i),e.moveTo?.selector&&this.changePlacement(e,i).catch(console.error);}async changePlacement(e,t){let i=await Ln$1(e.moveTo.selector);if(i)switch(e.moveTo.position){case Ve$3.BEFORE1:t.nextElementSibling!==i&&i.parentElement?.insertBefore(t,i);break;case Ve$3.INSIDE_FIRST1:i.firstChild!==t&&i.insertBefore(t,i.firstChild);break;case Ve$3.INSIDE_LAST1:i.lastChild!==t&&i.appendChild(t);break;case Ve$3.AFTER1:default:t.previousElementSibling!==i&&i.parentElement?.insertBefore(t,i.nextSibling);}}trackExperimentRan(e){if(e.id===`preview`){Y$1.warn(`Skipping experiment attribution as its preview`,e.toString());return}Os({name:`CE Experiment Start`,experiment:new mt$1(e)}).catch(t=>{Y$1.error(`Fail to track experiment`,t);});}setupMutationObserver(){new MutationObserver(t=>{t.forEach(i=>{i.addedNodes.forEach(o=>{o instanceof HTMLElement&&this.modifications.forEach(n=>{if(o.matches&&o.matches(n.cssSelector))Y$1.verbose(`1. Re-applying experiment`,n.toString()),this.executeSingleModification(n,[o]);else if(o.querySelectorAll){let s=Array.from(o.querySelectorAll(n.cssSelector));if(!s.length)return;Y$1.verbose(`2. Re-applying experiment`,n.toString()),this.executeSingleModification(n,s);}});});});}).observe(document.body,{childList:true,subtree:true});}updateImage(e,t){let i=e.image?.lg?.src,o=e.image?.sm?.src;!i&&!o||(t instanceof HTMLPictureElement?this.updatePictureElement({desktop:i,mobile:o},t):this.updateImageElement({desktop:i,mobile:o},t));}updateImageElement(e,t){M$1()&&e.mobile?(t.setAttribute(`src`,e.mobile),t.removeAttribute(`srcset`)):e.desktop&&(t.setAttribute(`src`,e.desktop),t.removeAttribute(`srcset`));}updatePictureElement(e,t){if(t.innerHTML=``,e.mobile){let o=document.createElement(`source`);o.srcset=e.mobile,o.media=`(max-width: 767px)`,t.append(o);}if(e.desktop){let o=document.createElement(`source`);o.srcset=e.desktop,o.media=`(min-width: 768px)`,t.append(o);}let i=document.createElement(`img`);i.src=e.desktop??e.mobile??``,t.append(i);}};async function Os(r$10){let e=await $e();await me(`/v1/event/experiment`,r(r({},r$10),e));}function qi(){mc().catch(r=>ke$2(r,`fetch-experiments`));}async function mc(){Be$3().activeExperiments&&(await le$1(le),await pc());}async function pc(){Y$1.info(`Fetch experiments after ⏰`,en()+` of SDK load`);me(`/v1/engagement/experiments`,r({},await $e())).then(async t=>{Y$1.info(`Experiments fetched ${Jr$3(t.timeTakenMs)}`);let i=t.data.experiments.map(o=>new j(o));new $i().execute(i);}).catch(t=>{Y$1.error(`Error sending experiment getter`,t);});}function Ls(){let r=he$3.get();!r.gaMeasurementID||!r.gaEnabled||uc();}async function dc(){let r=await fe$4.get(`gacid`),e=await gc();if(r!==e)return await fe$4.set(`gacid`,e),e}async function uc(){let r=await dc();r&&Yn({gaClientID:r});}async function gc(){let e=he$3.get().gaMeasurementID;if(!(!e||!window.gtag))return new Promise(t=>{window.gtag(`get`,e,`client_id`,i=>{t(i);});})}async function Ns(r){Y$1.verbose(`Received app configuration`,r),r.currencyCount=r.currencies?.length;let e=D.globalRef.config.update(r);Ls(),V.initialize(),e.website&&(Ui$1(e.website.commonJS),Ce$1(e.website.commonCSS)),window.CooeeSDK.cartDrawerToggle$.pipe(Fe$1(10)).subscribe(async({open:t})=>{Y$1.info(`Cart drawer is now`,t?`open`:`closed`),t&&(ms(),await fc());});}function Ms(r){D.globalRef.apiURLs=r;}async function fc(){let r=await E.getCurrent().getNormalisedCart(),e={value:r.amount,currency:r.currency};K(new Ir$1(`View Cart`,{items:r.items,amount:e,drawer:true}));}var Gi=class{runtimeData=Be$3();meddle(){let e=D.globalRef;e.profile=e.profile??[],e.events=e.events??[],e.page=e.page??[],this.meddlePage(),this.meddleEvents(),this.meddleProfile(),this.exposeMethods();}exposeMethods(){let e=D.globalRef;e.loadWidgets=e.loadCartWidgets=e.loadPageWidgets=()=>{Vt();},e.loadExperiments=()=>{qi();},e.testCartUpdate=this.testCartUpdate.bind(this),e.previewWidget=D.previewWidget.bind(D),e.previewPopup=D.previewPopup.bind(D),e.executeCTA=(t,i)=>{new Re(t).execute(i);},e.sendEvent=t=>{K(t);};}overwritePush(e,t){Pn(e,`push`,t);}meddleEvents(){this.overwritePush(D.globalRef.events,(...e)=>{this.processEvent(e[0]);}),D.globalRef.events.forEach(this.processEvent.bind(this));}meddleProfile(){this.overwritePush(D.globalRef.profile,(...e)=>{this.processProfile(e[0]);}),D.globalRef.profile.forEach(this.processProfile.bind(this));}processEvent(e){e&&(zr$3.includes(e[0])?D.sendEvent(e[0],e[1],r({occurred:this.runtimeData.jsLoadTime},e[2])):D.sendEvent(e[0],e[1],e[2]));}processProfile(e){e&&D.updateProfile(e);}meddlePage(){this.overwritePush(D.globalRef.page,(...e)=>{this.processPage(e[0]);}),D.globalRef.page.forEach(this.processPage.bind(this));}processPage(e){e.appID&&D.authenticate(e),e.currentItem&&hc(e.currentItem),e.currency&&(Be$3().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&&D.setPageName(e.pageName),e.activeExperiment&&(this.runtimeData.activeExperiments=e.activeExperiment),e.cart&&E.getCurrent().update(e.cart),e.configurations&&Ns(e.configurations),e.apiURLs&&Ms(e.apiURLs),e.customContext&&(this.runtimeData.customContext=r(r({},this.runtimeData.customContext),e.customContext));}async testCartUpdate(){if(Be$3().pageName!==`product`){window.alert(`This feature is only available on a product page`);return}let e=ss();if(e||(e=Be$3().currentItem?.vID),!e){window.alert(`Could not find a variant to test. Please try a different product page`);return}let t=new j({id:`preview`,shortID:`1`,redirectBehaviour:Me$1.CART_DRAWER});await new Re(new Fe(new Date,t)).execute({clickAction:{at:He$3.ADD_TO_CART},embeddedItem:new et({vID:e})});}};function hc(r){let e=Be$3();if(e.currentItem&&e.currentItem.vID!==r.vID){let t=new CustomEvent(`letscooee:variant-change`,{detail:{variantID:r.vID,productID:r.mID}});document.dispatchEvent(t);}e.currentItem=new et(r);}var Wt=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=`cooee`.concat(`-`);static getString(e,t){return this.getItem(e)||t}static setString(e,t){this.setItem(e,t);}static remove(e){this.removeItem(e);}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,t){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),t);}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e));}};var wc=1e3,vc=10,Bo=0,Vo=new Date;function Wo(r){Wt.remove(`sleid`),Vo=r??new Date;}function Us(){if(window.scrollY){let r=Vs();Fs(r)&&Bs(r);}ht$2(()=>{bc();});}function bc(){Tr(window,`scroll`).pipe(Fe$1(wc),q$1(()=>{let r=Vs();if(r>100){Y$1.warn(`Received scroll percent is more than 100`,r);return}if(Fs(r))return r})).subscribe(r=>{Bs(r);});}function Fs(r){return Math.abs(Bo-r)>=vc||Bo!==r&&r===100}function Bs(r){if(r==null)return;let e={percent:r,timeMS:new Date().getTime()-Vo.getTime()};Bo=r;let i=new Ir$1(`CE Scroll`,e,null,Wt.getString(`sleid`,``));K(i),Wt.setString(`sleid`,i.id.toHexString()),Vo=new Date(i.occurred);}function Vs(){let r=window.document.body.scrollHeight,e=window.innerHeight;return Math.ceil((window.scrollY+e)/r*100)}function Ws(){document.onvisibilitychange=()=>{document.visibilityState===`visible`?Cc():document.visibilityState===`hidden`&&yc();};}async function Cc(){}async function yc(){let r=await Ec();if(r===0){Y$1.info(`Not sending duration as user was inactive on website`);return}$s(r);}async function Ec(){let r=Be$3();return r.inInactive?0:(r.inInactive=true,r.lastEnterInactive=new Date,Math.max(r.lastEnterInactive.getTime()-r.lastEnterActive.getTime(),0))}function Hs(){let r=Be$3();return r.inInactive?(r.inInactive=false,r.lastEnterActive=new Date,Math.max((r.lastEnterActive.getTime()-r.lastEnterInactive.getTime())/1e3,0)):0}function qs(){Sc();}function Sc(){let r=window.fetch;try{window.fetch=async function(e,t){try{await Ic(e,t);}catch(i){ke$2(i,`modify-graphql-request`,{extra:{body:JSON.stringify(t?.body)}});}return r(e,t)};}catch(e){console.warn(`Fail to override fetch.`,`Cooee won't be able to track "Buy Now Clicked" KPI.`),Y$1.error(e);}Y$1.verbose(`Securely overwritten window.fetch method for graphql query`);}async function Ic(r,e){let t=typeof r==`string`?r:r instanceof Request?r.url:``;if(!(t.includes(`graphql.json`)&&e?.method===`POST`)||!e.body)return;let i;if(typeof e.body==`string`)try{i=JSON.parse(e.body);}catch{return}else i=e.body;i?.variables?.input&&(Y$1.verbose(`Intercepted fetch request of:`,t),i?.query.includes(`cartCreate`)&&(e.body=await Tc(i),xc()));}async function Tc(r){let e=r.variables.input.attributes??[],t=await On$1(`Buy Now`);return r.variables.input.attributes=[...e,...t],JSON.stringify(r)}function xc(){let r=Be$3().currentItem;if(!r)return;K(new Ir$1(`Buy Now Clicked`,{items:[r]}));}var Ht=class{constructor(e,t){this.selectors=e;this.eventName=t;this.selectorString=e.join(`,`);}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let t=e.currentTarget;K(new Ir$1(this.eventName,{class:t.className||void 0,tagName:t.tagName||void 0,id:t.id||void 0})),this.removeClickListener(this.clickListenerCallback);};listenSilently(){this.listen().catch(e=>Y$1.error(e));}async listen(){this.elements=await Ar$1(this.selectorString),this.elements.forEach(e=>{e.addEventListener(`click`,this.clickListenerCallback);});}removeClickListener(e){this.elements?.forEach(t=>{t.removeEventListener(`click`,e);});}};var ji=class r extends Ht{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(r.selectors,`Item Thumbnail Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new r),this.INSTANCE}};var zi=class r extends Ht{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(r.selectors,`Review Clicked`);}static getInstance(){return this.INSTANCE||(this.INSTANCE=new r),this.INSTANCE}};var Dc=[`.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 Gs(){ht$2(()=>{Y$1.verbose(`Execution order:`,`document ready`),Pc();});}function Pc(){let r=window.location.hash?.substring(1);if(r)if(r.includes(`initiate-checkout`)){document.dispatchEvent(new Event(`letscooee:outbound:third-party-initiate-checkout`));let e=document.querySelector(Dc);if(!e){Y$1.verbose(`No clickable cart checkout button found`);return}Y$1.verbose(`Clickable cart checkout button found`,e),e.click();}else r.includes(`open-cart-drawer`)&&V.get().open();}function zs(){window.addEventListener(`kp-modal:opened`,()=>{Be$3().isGoKwikPopupOpen=true;}),window.addEventListener(`user-loggedin`,r=>{let{token:e}=r.detail;e&&Rt({goKwikToken:e});}),window.gokwikSdk?js():window.addEventListener(`gokwikLoaded`,js);}function js(){window.gokwikSdk&&window.gokwikSdk.on(`checkout_initiated`,async()=>{let r=await E.getCurrent().getNormalisedCart();K(new Ir$1(`Checkout Started`,{via:`GoKwik`,items:r.items,cartToken:r.token,amount:{value:r.amount,currency:r.currency}}));});}var D=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(e){if(!window.cooeeSDKPreview){if(Y$1.info(`Initialising SDK`),gs(navigator.userAgent)){Y$1.info(`This seems to be a bot. Disabling SDK`);return}this.initGlobalReference(e),await Xs(),this.autoAuthenticate(),new Gi().meddle(),zn(),qi(),Rc(),Ws(),Hn(),qs(),Gs(),Us(),zi.getInstance().listenSilently(),ji.getInstance().listenSilently(),zs(),_c(),Gn$1(),po(),Ai.remove(`conf`).catch(t=>{Y$1.error(`Fail to remove App Config from local storage`,t);});}}static initGlobalReference(e){window.CooeeSDK||Pn(window,`CooeeSDK`,{}),this.globalRef=window.CooeeSDK,Pn(this.globalRef,`config`,new he$3),Pn(this.globalRef,`runtimeData`,{sdkLoadTime:e,jsLoadTime:new Date,lastEnterActive:new Date}),Pn(this.globalRef,`uaParser`,new we,true),Pn(this.globalRef,`cart`,E.getCurrent()),Pn(this.globalRef,`cartChange$`,Wn()),Pn(this.globalRef,`cartDrawerToggle$`,V.cartDrawerToggle$.asObservable()),Y$1.verbose(`Global reference initialised`),new le$3(()=>{this.globalRef.uaParser=new we;});}static autoAuthenticate(){let e=Xr();e&&this.authenticate({shopifyShop:e});}static authenticate(e){if(this.authenticated)return;Y$1.info(`Begin auth after ⏰`,en(),`of SDK load`);let t=e.appID?.trim(),i=e.shopifyShop;if((Rn(t)||t.length!==24)&&Rn(i)){Y$1.warn(`Cooee App ID or Shop name is not configured`);return}this.authenticated=true,Ks(e);}static sendEvent(e,t,i){let o=new Ir$1(e,t,i?.triggerData);i?.occurred&&(o.occurred=i.occurred),K(o);}static updateProfile(e){for(let t in e)if(t.toLowerCase().startsWith(`ce `))throw new Error(`User property name cannot start with 'CE '`);Rt(e);}static setPageName(e){if(!e)return;let t=Be$3(),i=t.pageName;if(e===i)return;if(t.pageName=e,Yr$3.some(s=>e.includes(s))){Wo();return}let o={};i&&(o.ps=i);let n=new Ir$1(`CE Screen View`,o);n.occurred=t.jsLoadTime,K(n),Wo(n.occurred);}static previewPopup(e,t){import('./renderer-Te6JmJHE-CG-p9oX6.js').then(({FreeformRenderer:i})=>{new i(t).render(e);});}static previewWidget(e){new X(new j(e)).renderSilently();}};function Rc(){window.CooeeSDK.cartChange$.subscribe(()=>{Vt();});}function _c(){if(window.opener){try{window.opener.postMessage({action:`COOEE_READY_FOR_PREVIEW`},`*`);}catch(r){Y$1.error(r);}window.addEventListener(`message`,r=>{if(Y$1.verbose(`Received event`,r),!r.origin.includes(`letscooee.com`)&&!r.origin.includes(`localhost`))return;let e=r.data;typeof e==`object`&&(e.action===`POPUP_PREVIEW`?(D.previewPopup(e.engagementTrigger),r.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},r.origin)):e.action===`WIDGET_PREVIEW`&&(D.previewWidget(e.engagementTrigger),r.source?.postMessage({action:`PREVIEW_SUCCESSFUL`},r.origin)));});}}var Js=new U,Ys=0;Js.pipe(Fe$1(50)).subscribe(async r=>{kc(await $e()).catch(t=>{ke$2(t,`load-page-widgets`,{extra:{firstLoad:r}});});});function Vt(r=false){le$1(le).then(()=>{Js.next(r);});}async function as(r){let e=await $e();return Object.assign(r,e),me(`/v1/engagement/get-variant`,r)}async function kc(r$11){Ys++,Ys===1?Y$1.info(`Fetch widgets (after ⏰`,en()+` of SDK load)`):Y$1.info(`Fetch widgets`);let e=r({},r$11),t=Vn$1(`/v1/engagement/eligible`,D.globalRef.apiURLs?.engagementsURL);try{let i=await me(t,e);if(Y$1.info(`Widgets fetched ${Jr$3(i.timeTakenMs)}`),i.data.pageWidgets?.length)cr(i.data.pageWidgets.map(n=>new j(n)));if(i.data.cartWidgets?.length)ar(i.data.cartWidgets.map(n=>new j(n)));}catch(i){Y$1.error(`Error sending widget getter`,i);}}var Qs=x$2(dr$2()),Ki=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 Qs.URLBuilder(location.href);}catch{return {}}let t={};if(this.META_REQUIRED_FIELDS.every(n=>Array.from(e.getParams().keys()).includes(n)))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(n=>Array.from(e.getParams().keys()).includes(n)))return t={source:`GOOGLE`},new r(t)}};var Ho={d:(r,e)=>{for(var t in e)Ho.o(e,t)&&!Ho.o(r,t)&&Object.defineProperty(r,t,{enumerable:true,get:e[t]});},o:(r,e)=>Object.prototype.hasOwnProperty.call(r,e)},$o={};Ho.d($o,{A:()=>Ac,k:()=>qo});var Cr=function(r,e,t,i){return new(t||(t=Promise))(function(o,n){function s(C){try{m(i.next(C));}catch(w){n(w);}}function c(C){try{m(i.throw(C));}catch(w){n(w);}}function m(C){var w;C.done?o(C.value):(w=C.value,w instanceof t?w:new t(function(O){O(w);})).then(s,c);}m((i=i.apply(r,[])).next());})},yr=function(r,e){var t,i,o,n,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return n={next:c(0),throw:c(1),return:c(2)},typeof Symbol==`function`&&(n[Symbol.iterator]=function(){return this}),n;function c(m){return function(C){return (function(w){if(t)throw new TypeError(`Generator is already executing.`);for(;n&&(n=0,w[0]&&(s=0)),s;)try{if(t=1,i&&(o=2&w[0]?i.return:w[0]?i.throw||((o=i.return)&&o.call(i),0):i.next)&&!(o=o.call(i,w[1])).done)return o;switch(i=0,o&&(w=[2&w[0],o.value]),w[0]){case 0:case 1:o=w;break;case 4:return s.label++,{value:w[1],done:!1};case 5:s.label++,i=w[1],w=[0];continue;case 7:w=s.ops.pop(),s.trys.pop();continue;default:if(o=s.trys,!((o=o.length>0&&o[o.length-1])||w[0]!==6&&w[0]!==2)){s=0;continue}if(w[0]===3&&(!o||w[1]>o[0]&&w[1]<o[3])){s.label=w[1];break}if(w[0]===6&&s.label<o[1]){s.label=o[1],o=w;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(w);break}o[2]&&s.ops.pop(),s.trys.pop();continue}w=e.call(r,s);}catch(O){w=[6,O],i=0;}finally{t=o=0;}if(5&w[0])throw w[1];return {value:w[0]?w[1]:void 0,done:true}})([m,C])}}};function qo(){return Cr(this,void 0,Promise,function(){return yr(this,function(r){switch(r.label){case 0:return [4,new Promise(function(e,t){var i=`Unknown`,o=false;function n(y){o||(o=true,e({isPrivate:y,browserName:i}));}function s(){var y=0,P=parseInt(`-1`);try{P.toFixed(P);}catch(x){y=x.message.length;}return y}function c(){return navigator.msSaveBlob!==void 0&&(function(y){try{return y===eval.toString().length}catch{return false}})(39)}function m(){var y;return Cr(this,void 0,void 0,function(){var P,x;return yr(this,function(v){switch(v.label){case 0:return v.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return v.sent(),n(false),[3,3];case 2:return P=v.sent(),x=P,P instanceof Error&&(x=(y=P.message)!==null&&y!==void 0?y:P),typeof x!=`string`?(n(false),[2]):(n(!!x.includes(`unknown transient reason`)),[3,3]);case 3:return [2]}})})}function C(){var y;return Cr(this,void 0,Promise,function(){return yr(this,function(P){switch(P.label){case 0:return ((y=navigator.storage)===null||y===void 0?void 0:y.getDirectory)===void 0?[3,2]:[4,m()];case 1:return P.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var x=String(Math.random());try{var v=indexedDB.open(x,1);v.onupgradeneeded=function(L){var A=L.target.result,b=function(Je){n(Je);};try{A.createObjectStore(`t`,{autoIncrement:!0}).put(new Blob),b(!1);}catch(Je){(Je.message||``).includes(`are not yet supported`)?b(!0):b(!1);}finally{A.close(),indexedDB.deleteDatabase(x);}},v.onerror=function(){return n(!1)};}catch{n(false);}})():(function(){var x=window.openDatabase,v=window.localStorage;try{x(null,null,null,null);}catch{n(true);return}try{v.setItem(`test`,`1`),v.removeItem(`test`);}catch{n(true);return}n(false);})(),P.label=3;case 3:return [2]}})})}function w(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(y,P){var x;n(Math.round(P/1048576)<2*Math.round(((x=window).performance!==void 0&&x.performance.memory!==void 0&&x.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576));},function(y){t(new Error(`detectIncognito somehow failed to query storage quota: `+y.message));});}function O(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?w():(0, window.webkitRequestFileSystem)(0,1,function(){n(false);},function(){n(true);});}function F(){return Cr(this,void 0,Promise,function(){var y,P;return yr(this,function(x){switch(x.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return [3,4];x.label=1;case 1:return x.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return x.sent(),n(false),[3,4];case 3:return y=x.sent(),typeof(P=y instanceof Error&&typeof y.message==`string`?y.message:String(y))!=`string`?(n(false),[2]):(n(P.includes(`Security error`)),[2]);case 4:return n(navigator.serviceWorker===void 0),[2]}})})}(function(){return Cr(this,void 0,Promise,function(){return yr(this,function(y){switch(y.label){case 0:return s()!==44?[3,2]:(i=`Safari`,[4,C()]);case 1:return y.sent(),[3,6];case 2:return s()!==51?[3,3]:(P=navigator.userAgent,i=P.match(/Chrome/)?navigator.brave!==void 0?`Brave`:P.match(/Edg/)?`Edge`:P.match(/OPR/)?`Opera`:`Chrome`:`Chromium`,O(),[3,6]);case 3:return s()!==25?[3,5]:(i=`Firefox`,[4,F()]);case 4:return y.sent(),[3,6];case 5:c()?(i=`Internet Explorer`,n(window.indexedDB===void 0)):t(new Error(`detectIncognito cannot determine the browser`)),y.label=6;case 6:return [2]}var P;})})})().catch(t);})];case 1:return [2,r.sent()]}})})}typeof window<`u`&&(window.detectIncognito=qo);var Ac=qo,Zs=$o.A;$o.k;var ea=x$2(yt$1()),ta=async()=>{let r={};try{return await Oc(r)}catch(e){return ke$2(e,`device-properties`),r}},Oc=async r=>{let e=window.CooeeSDK.uaParser;Lc(r),Nc(r),Mc(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:Uc()},r.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(r.headless=true,ro({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([Vc(r),Fc(r),Wc(r)]),r},Lc=r=>{let e=navigator;if(!e.deviceMemory)return;r.mem={tot:e.deviceMemory*1024};},Nc=r=>{let e=navigator,t=e.connection||e.mozConnection||e.webkitConnection;t?.effectiveType&&(r.net={type:t.effectiveType});},Mc=r=>{let e=screen.orientation?.type;e&&(r.orientation=e);},Uc=()=>{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},Fc=async r=>{try{await Bc(r);}catch(e){Y$1.error(`Unable to get location`,e);}},Bc=async r=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:`geolocation`})).state!=`granted`))return new Promise(t=>{navigator.geolocation.getCurrentPosition(i=>{r.coords=[i.coords.latitude,i.coords.longitude],t();},()=>t());})},Vc=async r=>{if(`getBattery`in navigator)try{let t=await navigator.getBattery();r.bat={l:t.level*100,c:t.charging},ro({"battery.level":r.bat.l,"battery.charging":r.bat.c});}catch{}},Wc=async r=>{try{(await Zs())?.isPrivate&&(r.incognito=!0,ro({incognito:!0}));}catch(e){ea.default.error(`Unable to detect private/incognito window`,e);}};function ia(r){if(!oa())return;let e=Ye$2[r]?.toLowerCase();e&&(Y$1.verbose(`Sending ${e} intent to MS Clarity`),window.clarity(`set`,`Cooee Intent`,e));}function oa(){return window.clarity&&typeof window.clarity==`function`}var le=new gr$1(1),sa=`App ID or Shopify shop is not set`,Go=``,Ye=``,jo=``,Xi;async function Ks(r){Go=r.appID,jo=r.shopifyShop;try{await Hc(),le.next(!0),le.complete();}catch(e){e?.message?.includes(sa)&&ke$2(e,`initiate-session`,{extra:r}),Y$1.error(`Unable to initiate session`,e);}}async function Kn(){return await aa(false),Xi}async function Xs(){let r=Date.now();await gi.request(`gen_did`,async()=>{Ye=await fe$4.get(`did`),Ye||(Ye=new $$1().toHexString(),await fe$4.set(`did`,Ye)),Y$1.info(`Device ID:`,Ye),la(Ye);}),Y$1.info(`Device ID set/get done ${Jr$3(Date.now()-r)}`);}async function na(){if(Xi)return;let[r,e,t]=await Promise.all([ve$2.get(`id`,``),fe$4.get(`sessionNumber`,1),ve$2.get(`landing`,{})]);ca(r,e,t);}async function Hc(){await aa(true);}async function aa(r){let e=false;return await qc()?(await $c(),e=true):await Gc()?(await na(),e=true):await na(),e?await zc():r&&Vt(),e}async function $c(){Y$1.info(`Starting new session`),await ve$2.clear();let r=new Date,e=new $$1().toHexString(),t=await fe$4.get(`sessionNumber`,0)+1,i=vi();await Promise.all([fe$4.set(`sessionNumber`,t),ve$2.set(`id`,e),ve$2.set(`lastUsedTime`,r.getTime()),ve$2.set(`landing`,i)]),ca(e,t,i);}async function qc(){let r=await ve$2.get(`lastUsedTime`,0);return r?(new Date().getTime()-r)/1e3>1800:true}async function Gc(){return !await ve$2.get(`synced`,false)}async function jc(){if(!Go&&!jo)throw new Error(sa);let r$12=await ta(),e=bi();return s(r(r({deviceID:Ye,deviceProps:r$12,appID:Go,shopifyShop:jo},Xi),e),{sdk:Gr$3,ad:Ki.getAdParams(),occurred:Xc(Be$3().jsLoadTime),properties:{},uuid:await fe$4.get(`uuid`)})}async function zc(){Y$1.info(`Ensuring session on server`),await Kc();let r=Date.now(),e=await jc();Y$1.info(`Session data generated ${Jr$3(Date.now()-r)}`);let t=Vn$1(`/v1/event/validate-session`,D.globalRef.apiURLs?.baseURL??`https://cdn.sdk-api1.letscooee.com`);try{let i=await me(t,e);if(Y$1.info(`Auth finished ${Jr$3(i.timeTakenMs)}`),await ve$2.set(`synced`,!0),i.data.deviceID&&(await fe$4.set(`did`,Ye),la(i.data.deviceID)),i.data.pageWidgets?.length)cr(i.data.pageWidgets.map(n=>new j(n)));if(i.data.cartWidgets?.length)ar(i.data.cartWidgets.map(n=>new j(n)));}catch(i){throw Y$1.error(i),i}}async function Kc(){let r=await fe$4.get(`firstSeen`),e=r?new Date(r):new Date;r||await fe$4.set(`firstSeen`,e.toISOString()),Qn(e),to(`Visitor Info`,{first_seen:e.toISOString()});}function ca(r,e,t){ro({"cooee_session.number":e}),to(`Visitor Session`,{id:r,number:e,landing_page:t}),Y$1.info(`Session number: ${e}, id: ${r}`),Xi={sessionID:r,sessionNumber:e,landingPage:t};}function la(r){Jn(r);to(`Visitor Info`,{device_id:r,[`device_id_${Math.floor(Math.random()*1e4)}`]:r}),eo({id:r});}function Xc(r){return (new Date().getTime()-r.getTime())/1e3>1800?new Date:r}var Yi=class{triggerData;render(e){e.contentSource===Be$2.KLAVIYO&&(this.triggerData=e,window.addEventListener(`klaviyoForms`,this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push([`openForm`,e.klaviyoFormID]));}handleKlaviyoEvents(e){if(e.type!==`klaviyoForms`)return;let t=e.detail;if(t.formId!==this.triggerData.klaviyoFormID){Y$1.warn(`Received invalid trigger callback`);return}switch(t.type){case `open`:fe(new Ir$1(`CE Trigger Displayed`,{form:{id:t.formId}},this.triggerData));break;case `stepSubmit`:{let i=this.getFormDetails(t);fe(new Ir$1(`CE Form Submitted`,{form:i},this.triggerData)),Rt(i);break}case `close`:window.removeEventListener(`klaviyoForms`,this.handleKlaviyoEvents.bind(this)),fe(new Ir$1(`CE Trigger Closed`,{form:{id:t.formId}},this.triggerData));break}}getFormDetails(e){let t={id:e.formId},i=e.metaData;if(pe$4.hasKeys(i)){let o=[`email`,`phone_number`,`first_name`,`last_name`,`$email`,`$phone_number`,`$first_name`,`$last_name`];Object.keys(i).forEach(c=>{o.includes(c)||(t[c]=i[c]);}),t.email=i.$email??i.email,t.mobile=i.$phone_number??i.phone_number;let n=i.$first_name??i.first_name,s=i.$last_name??i.last_name;(n?.length||s?.length)&&(t.name=n+` `+s);}return t}};function ma(r){if(!Yc()||!he$3.get().pixelPush)return;let t=Ye$2[r.intent]?.toLowerCase();t&&(Y$1.verbose(`Sending ${t} intent to Facebook Pixel`),window.fbq(`trackCustom`,`CooeeIntent`,{intent_value:t}));}function Yc(){return window.fbq&&typeof window.fbq==`function`}var ho=`/v1/event/track-page-unload`;function K(r){Y$1.verbose(`Waiting for auth to send event ${r.name}`),le$1(le).then(()=>fe(r));}function $s(r){le$1(le).then(()=>{Jc(r);});}async function Jc(r){let e=Be$3().currentPageViewEvent;if(!e){Y$1.warn(`No page view event was stored previously`);return}let t={pageViewEventID:e.id,pageViewEventName:e.name,pageActiveTimeMS:r};Y$1.verbose(`Sending page unload`,t);let i=Vn$1(ho,D.globalRef.apiURLs?.eventURL);try{await me(i,t);}catch(o){throw Y$1.error(`Error sending page unload for ${e} to server`,o),o}}function fe(r){Qc(r);}async function Qc(r){if(Y$1.verbose(`Sending event: ${r.name}`,r),ol(r)){Y$1.warn(`Rejecting event ${r.name}`);return}Nn();let e=await $e();Object.assign(r,e),Hs(),ve$2.set(`lastUsedTime`,new Date().getTime());let t=il(r.name),o=Vn$1(`/v1/event/track/${t.toLowerCase().replace(/\s+/g,`-`)}`,D.globalRef.apiURLs?.eventURL);try{let n=await me(o,r);Y$1.info(`Event tracked:`,t),Zc(r)&&(Be$3().currentPageViewEvent={id:r.id,name:r.name}),el(r,n.data);}catch(n){throw Y$1.error(`Error sending event ${r.name} to server`,n),n}}function Zc(r){return qr$3.includes(r.name)?r.name===`View Cart`?!r.properties.drawer:true:false}function el(r,e){tl(r,e).catch(t=>{ke$2(t,`process-popup-response`,{extra:{event:r,response:e}});}),rl(e);}async function tl(r,e){if(!e.triggerData)return;let t=new j(e.triggerData);t.occurred=r.occurred,Y$1.log(`${t} will be shown`);let i;try{i=await hi(t);}catch(n){Y$1.error(`Failed to refresh the products`,n);return}if(t.items=i,t.contentSource===Be$2.KLAVIYO){new Yi().render(t);return}new(await(import('./renderer-Te6JmJHE-CG-p9oX6.js'))).FreeformRenderer().renderEngagement(t).catch(n=>{ke$2(n,`render-popup`,{extra:{event:r},engagementTrigger:t});});}function rl(r){r.intent&&(ia(r.intent),ma(r),Y$1.info(`Intent is ${Ye$2[r.intent]}`));}function il(r){return r.replace(`CE `,``).replace(`Trigger`,`Campaign`).replace(`Screen`,`Page`).replace(`App `,``)}function ol(r){return r.trigger?.triggerID===`test`||r.trigger?.triggerID===`preview`?(Y$1.warn(`Not sending event as this is a test trigger`),true):false}
78
78
 
79
79
  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$3();}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;Y$1.info(`⏱️ ═══════════════ Performance Timing Report ═══════════════`),Y$1.info(`📅 Absolute Timestamps (Local Time):`),Y$1.info(` Note: Inline script can execute during HTML download (incremental parsing)`),Y$1.info(``),Y$1.info(` 1. Navigation started: ${a(d)}`);let r=f?f.getTime():0;if(n&&n>0&&r?r<n?(Y$1.info(` 2. Inline script executed: ${a(r)} (during HTML parsing)`),Y$1.info(` 3. HTML download complete: ${a(n)}`)):(Y$1.info(` 2. HTML download complete: ${a(n)}`),Y$1.info(` 3. Inline script executed: ${a(r)}`)):n&&n>0?Y$1.info(` 2. HTML download complete: ${a(n)}`):r&&Y$1.info(` 2. Inline script executed: ${a(r)}`),Y$1.info(` 4. SDK module loaded: ${a(i.getTime())} (from CDN)`),S&&Y$1.info(` 5. DOMContentLoaded: ${a(S)}`),$&&Y$1.info(` 6. Page fully loaded: ${a($)}`),Y$1.info(``),Y$1.info(`⏱️ Relative Timings:`),n&&n>0&&d){let g=n-d;Y$1.info(` Shopify backend + HTML download: ${Ve$4(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;Y$1.info(` SDK module load time: ${Ve$4(K)} after ${b}`),Y$1.info(` (Note: Using earlier baseline because SDK loaded before ${T})`);}else Y$1.info(` SDK module load time: ${Ve$4(g)} after ${T}`),Y$1.info(` (Baseline: ${T} at ${a(u)})`);let v=i.getTime()-d;Y$1.info(` \u{1F3AF} Total SDK load time: ${Ve$4(v)} (from navigation start to SDK ready)`);}c&&c>0&&Y$1.info(` DOMContentLoaded: ${Ve$4(c)} after navigation start`),m&&m>0&&Y$1.info(` Page fully loaded: ${Ve$4(m)} after navigation start`),C(l),Y$1.info(`⏱️ ═══════════════════════════════════════════════════════`);}function C(i){if(!i){Y$1.info(``),Y$1.info(`📦 SDK Resource Metrics: Not available`);return}Y$1.info(``),Y$1.info(`📦 SDK Resource Metrics:`),Y$1.info(` URL: ${i.name}`),Y$1.info(` Download duration: ${Ve$4(i.duration)}`);let o=i.transferSize===0;if(Y$1.info(` Served from: ${o?`💾 Cache (disk/memory)`:`🌐 Network`}`),!o){Y$1.info(` Transfer size: ${d$3(i.transferSize)}`),Y$1.info(` Encoded size: ${d$3(i.encodedBodySize)}`),Y$1.info(` Decoded size: ${d$3(i.decodedBodySize)}`);let f=(1-i.encodedBodySize/i.decodedBodySize)*100;f>0&&Y$1.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;Y$1.info(` Timing breakdown:`),f>0&&Y$1.info(` DNS lookup: ${Ve$4(f)}`),l>0&&Y$1.info(` TCP connect: ${Ve$4(l)}`),s>0&&Y$1.info(` Request: ${Ve$4(s)}`),n>0&&Y$1.info(` Response: ${Ve$4(n)}`);}}
80
80
 
81
- var sdkDebugLogsUu4p06Kn = /*#__PURE__*/Object.freeze({
81
+ var sdkDebugLogsB0bEHgWx = /*#__PURE__*/Object.freeze({
82
82
  __proto__: null,
83
83
  printAllDebugLogs: x
84
84
  });
85
85
 
86
- performance.mark(`cooee-sdk-start`);var n=new Date;window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=true,Wn$1(),$n$1(),await D.initForMerchantWebsiteOnly(n),be$2(),performance.measure(`cooee-sdk-init`,`cooee-sdk-start`),Nr$2()&&Promise.resolve().then(function () { return sdkDebugLogsUu4p06Kn; }).then(({printAllDebugLogs:a})=>a(n)));
86
+ performance.mark(`cooee-sdk-start`);var n=new Date;window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=true,Wn$1(),$n$1(),await D.initForMerchantWebsiteOnly(n),be$2(),performance.measure(`cooee-sdk-init`,`cooee-sdk-start`),Nr$2()&&Promise.resolve().then(function () { return sdkDebugLogsB0bEHgWx; }).then(({printAllDebugLogs:a})=>a(n)));
87
87
 
88
88
  export { $r as $, A, Be as B, Ct as C, m as D, vs$1 as E, Fe as F, Gr as G, He$1 as H, Ir$1 as I, ve as J, pi$1 as K, bi$1 as L, M$1 as M, Nn$1 as N, ii$1 as O, Fs$1 as P, Ps$1 as Q, Se$1 as R, S$1 as S, ye$1 as T, U, Ve$1 as V, Ce$1 as W, Me$1 as X, De as Y, Vi$1 as Z, _e$1 as _, Mi$1 as a, $e$1 as a0, gr$1 as a1, He$2 as a2, qe$1 as a3, Re$1 as a4, Fe$2 as a5, We$1 as a6, Je as a7, Ae$2 as a8, ge$2 as a9, V$1 as b, H$1 as c, d$2 as d, V as e, fe as f, qt as g, Vr as h, Hr as i, j, nt$1 as k, le$3 as l, mt$1 as m, n$1 as n, f as o, Fr as p, qr as q, rt as r, He$3 as s, yi as t, ue$2 as u, v, wi as w, q$1 as x, ye$3 as y, Sr as z };
@@ -1,4 +1,4 @@
1
- import { k as ke, a as Be, j as jr, Y, r, s, D as Dn, N as Nn } from './chunk-DbQ39eGC-BuuE3sKA.js';
1
+ import { k as ke, a as Be, j as jr, Y, r, s, D as Dn, N as Nn } from './chunk-ekBE5rdY-CTOrJkKT.js';
2
2
  import { j, c as H$1, F as Fe, M, e as V, m as mt, f as fe, I as Ir, $ as $r, q as qr, C as Ct, G as Gr, r as rt, g as qt, h as Vr, i as Hr, A as A$1, S as S$1, k as nt, B as Be$1, w as wi, o as f$1, p as Fr, s as He, t as yi } from './main.min.js';
3
3
 
4
4
  var L=class{loadedFonts=[];async loadAllFonts(e){e.elems?.forEach(t=>{t instanceof Be$1&&this.loadFamily(t.typography?.fam);});}async loadFamily(e){if(!e?.fonts||this.loadedFonts.indexOf(e.name)>-1)return;let t=[];e.fonts.forEach(n=>{if(n.url){let l=new FontFace(`cooee`+e.name,n.getURL(),n.getFontDescriptor());t.push(l.load());}}),this.loadedFonts.push(e.name),(await Promise.all(t)).forEach(n=>{document.fonts.add(n);});}};var S=class{static updateIdentity(e){if(!this.isInstalled())return;let t={};e.email&&(t.email=e.email),e.mobile&&(t.phone_number=e.mobile),Y.verbose(`Sending email/mobile to Klaviyo`),window.klaviyo.push([`identify`,t]);}static isInstalled(){return window.klaviyo&&typeof window.klaviyo==`object`}};var H=class{action;triggerContext;constructor(e,t){this.action=e,this.triggerContext=t;}async execute(){let e=this.containsCTA()?`CE Trigger Clicked`:`CE Trigger Closed`;switch(this.action.at!==He.SUBMIT_FORM&&await this.closeTriggerAndSendEvent(e),this.action.at){case He.ACCEPT_POPUP:break;case He.GO_TO_URL:this.gotoURLAction();break;case He.SHARE:this.shareAction();break;case He.SUBMIT_FORM:await this.collectFormData();break;case void 0:case He.OPEN_CART:break;default:Y.error(`Received an invalid ClickActionType: `,this.action.at);return}}externalAction(){this.action.ext?.u&&window.open(this.action.ext.u,`_blank`)?.focus();}gotoURLAction(){if(this.action.gu?.u){let e=this.action.gu.u;Dn(e)||(e=`//${e}`),window.open(e,`_self`);}}async closeTriggerAndSendEvent(e,t){this.triggerContext.closeInApp(e,t),await this.dispatchEvent();}shareAction(){if(!this.action.share)return;if(!navigator.share){Y.warn(`Navigator.share is not compatible with this browser`);return}navigator.share({text:this.action.share.text,title:`Share`}).then(t=>console.log(t)).catch(t=>console.error(t));}containsCTA(){return this.action.at&&this.action.at!==He.REJECT_POPUP?true:!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))}isEmpty(e){return e?Object.keys(e).length===0:true}async collectFormData(){let e={};for(let t of this.triggerContext.inputs){if(!t.isValid)return;let n=document.getElementById(t.id).value;t.type===51?e.email=n:t.type===52&&(e.mobile=n);}await this.closeTriggerAndSendEvent(`CE Form Submitted`,{form:e}),this.action.applyDiscount&&Nn(`Coupon applied on cart`),S.updateIdentity(e);}async dispatchEvent(){let e=this.triggerContext.triggerData,t={clickAction:this.action,items:this.triggerContext.selectedEmbeddedItems??e.embeddedItems??e.items,collections:e.collections,triggerData:e};await new yi().process(t);let r={action:this.containsCTA()?`CLICKED`:`CLOSED`};document.dispatchEvent(new CustomEvent(`letscooee:outbound:popup-activities`,{detail:r}));}};var a=class{renderer=I.get();parentHTMLEl;inappElement;inappHTMLEl;triggerContext;stylesConverter;scalingFactor;constructor(e,t,r){this.parentHTMLEl=e,this.inappElement=t,this.triggerContext=r,this.stylesConverter=new wi(this.renderer.getScalingFactor());}getHTMLElement(){return this.inappHTMLEl}insertElement(){this.parentHTMLEl.appendChild(this.inappHTMLEl);}processCommonBlocks(){this.processWidthAndHeight(),this.processPositionBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction();let e=s(r(r(r(r({},this.getDisplayStyles()),this.getSpaceStyles()),this.getBorderStyles()),this.getBackgroundStyles()),{boxSizing:`border-box`,outline:`none`});S$1(this.inappHTMLEl,e);}getDisplayStyles(){return {display:`block`}}processWidthAndHeight(){this.inappElement.w&&H$1(this.inappHTMLEl,`width`,this.stylesConverter.getSizePx(this.inappElement.w)),this.inappElement.h&&H$1(this.inappHTMLEl,`height`,this.stylesConverter.getSizePx(this.inappElement.h));}processPositionBlock(){let e={position:`absolute`,left:this.stylesConverter.getSizePx(this.inappElement.x),top:this.stylesConverter.getSizePx(this.inappElement.y)};S$1(this.inappHTMLEl,e);}getBorderStyles(){return this.stylesConverter.getBorderStyles(this.inappElement.br)}getSpaceStyles(){return this.stylesConverter.getSpaceStyles(this.inappElement.spc)}processTransparency(){let e=this.inappElement.alpha;if(!isNaN(e)){let t=(e/100).toFixed(2);H$1(this.inappHTMLEl,`opacity`,t);}}processShadow(){let e=this.inappElement.shd;e?H$1(this.inappHTMLEl,`box-shadow`,e.getStyle(this.scalingFactor)):H$1(this.inappHTMLEl,`box-shadow`,`unset`);}processTransformBlock(){let e=new f$1(this.inappElement.trf);e&&e.rotate&&H$1(this.inappHTMLEl,`transform`,`rotate(${e.rotate}deg)`);}registerAction(){let e=this.inappElement.clc;!e||Object.keys(e).length===0||(this.inappHTMLEl.addEventListener(`click`,t=>{t.stopPropagation(),new H(e,this.triggerContext).execute();}),H$1(this.inappHTMLEl,`cursor`,`pointer`));}getBackgroundStyles(){return this.stylesConverter.getBackgroundStyles(this.inappElement.bg)}};var p=class extends a{constructor(e,t,r){super(e,t,r);}processCommonBlocks(){super.processCommonBlocks(),this.processFontBlock(),this.processAlignment();}processFontBlock(){let e={},t=this.inappElement.typography;return t&&(e.fontSize=this.stylesConverter.getSizePx(t.fs),e.fontFamily=`cooee`+t.fam?.name,e.lineHeight=`${t.lh}`,e.letterSpacing=t.letterSpacing),this.stylesConverter.getColourStyles(this.inappElement.color,`color`,e),S$1(this.inappHTMLEl,e),e}processPart(e,t){let r=[];t.u&&r.push(`underline`),t.st&&r.push(`line-through`),r.length||r.push(`normal`),H$1(e,`font-weight`,t.b?`bold`:`normal`),H$1(e,`font-style`,t.i?`italic`:`normal`),H$1(e,`text-decoration`,r.join(` `)),H$1(e,`color`,t.c??`inherit`),H$1(e,`font-family`,`inherit`);}processAlignment(){let e=this.inappElement.typography.ta,t=e?Fr[e]?.toLowerCase():this.inappElement.typography.alignment;t||(t=`start`),H$1(this.inappHTMLEl,`text-align`,t);}};var u=class extends p{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.inappElement.parts?.forEach(e=>{let t=document.createElement(`span`);t.innerHTML=e.txt?.toString()?.replace(/\n/g,`<br />`),this.processPart(t,e),this.inappHTMLEl.appendChild(t);}),this.processCommonBlocks();}};var f=class extends a{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.processCommonBlocks();}};var E=class extends a{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`img`),this.insertElement();}render(){this.inappHTMLEl.setAttribute(`src`,this.inappElement.src),H$1(this.inappHTMLEl,`max-width`,`none`),H$1(this.inappHTMLEl,`max-height`,`none`),H$1(this.inappHTMLEl,`margin`,`0 auto`),this.processCommonBlocks();}};var v=class o extends a{constructor(t,r,n){super(t,r,n);this.parent=t;this.inappHTMLEl=document.createElement(`div`);}static MAX_Z_INDEX=`2147483647`;render(){return this.parent||this.renderer.removeInApp(),this.insertElement(),this.processCommonBlocks(),this.inappHTMLEl.classList.add(`cooee-wrapper`),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),H$1(this.inappHTMLEl,`z-index`,o.MAX_Z_INDEX),this.inappHTMLEl}getBackgroundStyles(){return this.inappElement.cover?super.getBackgroundStyles():{}}processWidthAndHeight(){let t=this.inappElement.cont;if(this.inappElement.cover)this.renderer.isParentNotBody()?(H$1(this.inappHTMLEl,`width`,`100%`),H$1(this.inappHTMLEl,`height`,`100%`)):(H$1(this.inappHTMLEl,`width`,`100vw`),H$1(this.inappHTMLEl,`height`,`100vh`)),H$1(this.inappHTMLEl,`top`,`0`),H$1(this.inappHTMLEl,`left`,`0`);else {let r=this.inappElement.spc,n=this.stylesConverter.getScaledSize(t.w)+r.getHorizontal(),l=this.stylesConverter.getScaledSize(t.h)+r.getVertical();H$1(this.inappHTMLEl,`width`,n+`px`),H$1(this.inappHTMLEl,`height`,l+`px`);}}getSpaceStyles(){return {padding:this.inappElement.spc.getPaddingCSS()}}getDisplayStyles(){return r(r({display:`flex`},this.inappElement.getStylesForWrapper()),this.inappElement.getFlexStylesForContainer())}processPositionBlock(){this.renderer.isParentNotBody()?H$1(this.inappHTMLEl,`position`,`absolute`):H$1(this.inappHTMLEl,`position`,`fixed`);}getBorderStyles(){return {}}processTransparency(){}processTransformBlock(){}processShadow(){}};var se=`cooee-container`,w=class extends a{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){return this.processCommonBlocks(),H$1(this.inappHTMLEl,`position`,`relative`),H$1(this.inappHTMLEl,`overflow`,`hidden`),this.inappHTMLEl.classList.add(se),this}};var A=class o extends p{static DAYS=`Days`;static HOURS=`Hours`;static MINUTES=`Minutes`;static SECONDS=`Seconds`;elements;spans=[];constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`div`),this.insertElement();}render(){this.addTimerChildren(),this.processAndStartTimer(),this.processCommonBlocks();let e=s(r(r(r({flex:`1 1 0`},this.stylesConverter.getBackgroundStyles(this.inappElement.bg)),this.stylesConverter.getBorderStyles(this.inappElement.br)),this.stylesConverter.getSpaceStyles(this.inappElement.spc)),{marginLeft:this.stylesConverter.getSizePx(this.inappElement.gap),marginRight:this.stylesConverter.getSizePx(this.inappElement.gap)});this.addStylesToTimer(e);}getBackgroundStyles(){return {}}processFontBlock(){let e=super.processFontBlock();return this.stylesConverter.getColourStyles(this.inappElement.color,`color`,e),this.addStylesToTimer(e),e}getSpaceStyles(){return {}}getBorderStyles(){return {}}getDisplayStyles(){return {display:`flex`,flexWrap:`nowrap`,justifyContent:`center`}}addStylesToTimer(e){this.elements.forEach(t=>S$1(t,e));}addTimerChildren(){let e=this.inappElement.show;this.elements=[],e.day&&this.elements.push(this.getChild(o.DAYS)),e.hour&&this.elements.push(this.getChild(o.HOURS)),e.minute&&this.elements.push(this.getChild(o.MINUTES)),e.second&&this.elements.push(this.getChild(o.SECONDS)),this.elements.forEach(t=>this.inappHTMLEl.appendChild(t));}getChild(e){let t=document.createElement(`div`),r=document.createElement(`span`),n=document.createElement(`span`);return n.innerText=e,r.innerText=`00`,r.id=`lc-${e}`,H$1(n,`font-size`,`0.5em`),H$1(n,`text-align`,`center`),H$1(n,`font-family`,`inherit`),H$1(r,`text-align`,`center`),H$1(r,`font-family`,`inherit`),this.inappElement.lblPos===`start`?(t.appendChild(n),t.appendChild(r)):(t.appendChild(r),t.appendChild(n)),H$1(t,`display`,`flex`),H$1(t,`flex-direction`,this.inappElement.horizontal?``:`column`),H$1(t,`justify-content`,`center`),H$1(t,`align-items`,`center`),H$1(t,`gap`,`5px`),this.spans.push(r),t}processAndStartTimer(){let e=this.inappElement.timer.start(this.inappElement.timerType,t=>{this.spans.forEach(r=>{r.id===`lc-${o.DAYS}`?r.innerText=String(t.days).padStart(2,`0`):r.id===`lc-${o.HOURS}`?r.innerText=String(t.hours).padStart(2,`0`):r.id===`lc-${o.MINUTES}`?r.innerText=String(t.minutes).padStart(2,`0`):r.id===`lc-${o.SECONDS}`&&(r.innerText=String(t.seconds).padStart(2,`0`));});});this.triggerContext.intervals.push(e);}};var b=class extends p{constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`select`),this.insertElement();}render(){H$1(this.inappHTMLEl,`background`,`#ffffff00`),H$1(this.inappHTMLEl,`outline`,`none`),this.processCommonBlocks(),this.addListener(this.inappHTMLEl),this.addOptions();}addListener(e){this.triggerContext.selectedEmbeddedItems?.length||this.updateItems(this.triggerContext.triggerData.items[0].vars[0]),e.addEventListener(`click`,t=>{t.stopPropagation();}),e.addEventListener(`change`,()=>{let t=new nt(JSON.parse(e.value));this.updateItems(t);});}updateItems(e){let t=this.triggerContext.triggerData.items[0];this.triggerContext.selectedEmbeddedItems=[t.toEmbed(e)];let r=this.parentHTMLEl.querySelector(`#coo-13`);if(!r)return;let n=e.imgs[0]??t.imgs?.at(0);n?.url&&r.setAttribute(`src`,n.url);}addOptions(){let e=this.triggerContext.triggerData.items,t=this.inappHTMLEl;if(!e?.length){t.add(this.createOption(this.inappElement.placeholderText));return}let r=this.triggerContext.selectedEmbeddedItems?.at(0);e[0].vars.forEach(n=>{t.add(this.createOption(n.name??`Default`,n,n.mID===r?.vID));});}createOption(e,t,r){let n=document.createElement(`option`);return n.text=e,n.value=JSON.stringify(t),r&&(n.selected=true),t||(n.disabled=true),n}};var T=class extends p{borderColor=``;constructor(e,t,r){super(e,t,r),this.inappHTMLEl=document.createElement(`input`),this.insertElement();}render(){let e=this.setInputType();this.inappHTMLEl.setAttribute(`placeholder`,this.inappElement.placeholderText),H$1(this.inappHTMLEl,`background`,`#ffffff00`),H$1(this.inappHTMLEl,`outline`,`none`),this.inappHTMLEl.addEventListener(`click`,t=>{t.stopPropagation();}),this.processCommonBlocks(),this.addListener(this.inappHTMLEl,e),this.triggerContext.addInputField(e,this.inappElement.t);}};var R=class o extends T{static EMAIL_REGEX=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;constructor(e,t,r){super(e,t,r);}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute(`type`,`email`),this.inappHTMLEl.setAttribute(`id`,e),e}addListener(e,t){e.addEventListener(`keydown`,r=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(o.EMAIL_REGEX)?(H$1(this.inappHTMLEl,`border-color`,this.borderColor),this.triggerContext.updateValidation(t,true)):(H$1(this.inappHTMLEl,`border-color`,`red`),this.triggerContext.updateValidation(t,false)),r.stopPropagation();});}};var D=class o extends T{static MOBILE_REGEX=/^\d+$/;constructor(e,t,r){super(e,t,r);}setInputType(){let e=`coo-${this.inappElement.t}`;return this.inappHTMLEl.setAttribute(`type`,`tel`),this.inappHTMLEl.setAttribute(`id`,e),e}addListener(e,t){e.addEventListener(`keydown`,r=>{this.borderColor||(this.borderColor=this.inappHTMLEl.style.borderColor),e.value.match(o.MOBILE_REGEX)?(H$1(this.inappHTMLEl,`border-color`,this.borderColor),this.triggerContext.updateValidation(t,true)):(H$1(this.inappHTMLEl,`border-color`,`red`),this.triggerContext.updateValidation(t,false)),r.stopPropagation();});}};var P=class extends E{constructor(e,t,r){super(e,t,r);}render(){super.render(),this.inappHTMLEl.setAttribute(`id`,`coo-${this.inappElement.type}`);}};var I=class o{static DOCUMENT_STANDARD_MODE=`CSS1Compat`;static ACTIVE_TRIGGER_DATA;static _instance;parent;rootContainer;containerHTMLElement;ian;scalingFactor=1;triggerContext;resizeListener;cartDrawerToggleSubscription;constructor(e){this.resizeListener=()=>this.screenResized(),this.setParentContainer(e);}static get(){return o._instance}render(e){this.renderEngagement(new j(e));}getScalingFactor(){return this.scalingFactor}calculateScalingFactor(e){let t=e.max,r=e.cont.w,n=e.cont.h,l=e.spc,c=this.getWidth(),h=this.getHeight();t&&(c=c?Math.min(c,t):t,h=h?Math.min(h,t):t),h&&(c-=l.getHorizontal(),h-=l.getVertical(),c/h<r/n?this.scalingFactor=c/r:this.scalingFactor=h/n,this.scalingFactor=Math.min(this.scalingFactor,1));}setParentContainer(e){this.parent=e||document.body,this.isParentNotBody()&&H$1(this.parent,`position`,`relative`);}isParentNotBody(){return this.parent&&this.parent!==document.body}getWidth(){return this.isParentNotBody()?this.parent.clientWidth:document.compatMode===o.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parent.clientHeight:document.compatMode===o.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}async renderEngagement(e){this.triggerContext=new Fe(new Date,e),this.triggerContext.onClose(t=>{this.closeInApp(t);}),this.ian=e.ian,(M()||e.previewType===`mobile`)&&this.ian.overrideForMobileView(),await this.preloadImages(e),e.shouldDelay()?window.setTimeout(()=>{this.withCartDrawerClosed();},e.getDelaySeconds()):this.withCartDrawerClosed();}withCartDrawerClosed(){if(!V.get().isOpen()){this.startRenderingOnce();return}this.cartDrawerToggleSubscription=window.CooeeSDK.cartDrawerToggle$.subscribe(({open:t})=>{!t&&this.startRenderingOnce();});}startRenderingOnce(){if(!this.shouldSkipCampaign()){o.ACTIVE_TRIGGER_DATA=this.triggerContext.triggerData,o._instance=this;try{this.startRendering();}catch(e){ke(e,`render-popup`,{triggerContext:this.triggerContext});return}this.sendTriggerDisplayed(),M()||window.addEventListener(`resize`,this.resizeListener),this.cartDrawerToggleSubscription?.unsubscribe();}}shouldSkipCampaign(){let e=this.triggerContext.triggerData;if(!e.previewType&&o.ACTIVE_TRIGGER_DATA){let r={triggerShown:new mt(o.ACTIVE_TRIGGER_DATA??{})};return this.skipTrigger(e,r),true}if(Be().isGoKwikPopupOpen)return this.skipTrigger(e,{reason:`GoKwik popup is open`}),true;let t=jr.find(r=>!!document.querySelector(r.identifier));return t?(this.skipTrigger(e,{reason:`${t.gateway} modal is open`}),true):false}startRendering(){this.calculateScalingFactor(this.ian),this.rootContainer=new v(this.parent,this.ian,this.triggerContext).render();try{this.renderContainer(this.triggerContext);}catch(e){throw Y.error(e),e}}sendTriggerDisplayed(){let e={};this.triggerContext.triggerData.items?.length&&(e.promotedMIDs=this.triggerContext.triggerData.items?.map(n=>n.mID));fe(new Ir(`CE Trigger Displayed`,e,this.triggerContext.triggerData));document.dispatchEvent(new CustomEvent(`letscooee:outbound:popup-activities`,{detail:{action:`DISPLAYED`}}));}sendTriggerClosed(e){let t=e.eventName;delete e.eventName;let r=new Ir(t,e,this.triggerContext.triggerData);r.name===`CE Trigger Clicked`&&(r.items=this.triggerContext.selectedEmbeddedItems??this.triggerContext.triggerData.items?.map(n=>n.toEmbed())),fe(r);}addEnterAnimation(e){this.containerHTMLElement.animate(e.getEnterAnimation(),{duration:500});}renderElement(e,t,r){t instanceof $r?new R(e,t,r).render():t instanceof qr?new D(e,t,r).render():t instanceof Ct?new u(e,t,r).render():t instanceof Gr?new P(e,t,r).render():t instanceof rt?new E(e,t,r).render():t instanceof qt?new f(e,t,r).render():t instanceof Vr?new A(e,t,r).render():t instanceof Hr?new b(e,t,r).render():Y.error(`Unsupported element type- `+t.type);}renderContainer(e){let t=this.ian?.cont;t&&(this.containerHTMLElement=new w(this.rootContainer,t,e).render().getHTMLElement(),new L().loadAllFonts(this.ian),this.ian.elems?.forEach(async r=>{await this.renderElement(this.containerHTMLElement,r,e);}),this.addEnterAnimation(this.ian.anim));}closeInApp(e){let t=this.ian.anim.getExitAnimation();this.sendTriggerClosed(e),o.ACTIVE_TRIGGER_DATA=void 0;let r=this.containerHTMLElement.animate(t,{duration:500,easing:`ease-in-out`});r.onfinish=()=>{this.removeInApp(),window.removeEventListener(`resize`,this.resizeListener);};}screenResized(){this.removeInApp(),this.startRendering();}removeInApp(){let e=document.querySelector(`.${this.triggerContext.rootClassName}`);e&&e.parentElement.removeChild(e);}skipTrigger(e,t){fe(new Ir(`CE Campaign Rejected`,t,e));}async preloadImages(e){let t=e.ian;if(!t)return;let r=[];t.elems.forEach(n=>{let l=n.bg?.img?.src;if(l&&r.push(l),n.t===1){let c=n.src;if(!c)return;r.push(c);}}),t.bg?.img?.src&&r.push(t.bg.img.src),t.cont.bg?.img?.src&&r.push(t.cont.bg.img.src),await Promise.all(r.map(n=>A$1(n)));}};
@@ -1,7 +1,7 @@
1
- import './chunk-DbQ39eGC-BuuE3sKA.js';
1
+ import './chunk-ekBE5rdY-CTOrJkKT.js';
2
2
  import './main.min.js';
3
- import { h as g, j as W, G as Ge, K as Ke, o as of, y as ye, k as Ka, u as uv, J as Ja, S as Sf, D as Df } from './widgets-D_OSh97N-Bpf2Pdkf.js';
4
- import { l, f } from './video-detail-dialog.component-CX4_iSK--CHXmFUnS.js';
3
+ import { h as g, j as W, G as Ge, K as Ke, o as of, y as ye, k as Ka, u as uv, J as Ja, S as Sf, D as Df } from './widgets-BIWIerG5-Cm-yzVcy.js';
4
+ import { l, f } from './video-detail-dialog.component-WEu7uD-2-C1gedzcS.js';
5
5
 
6
6
  var _=class d{dialogRef=g(W);eventData=g(Ge);triggerData=g(Ke)().triggerData;onShareAndClose(p,o){p.stopPropagation();let{url:t,text:a}=l(this.triggerData,this.eventData.video,o!==`Clipboard`);switch(o){case `Whatsapp`:window.open(`https://wa.me/?text=${a}%20${t}`,`_blank`,`noopener,noreferrer`);break;case `X(Twitter)`:window.open(`https://x.com/intent/post?text=${a}&url=${t}`,`_blank`,`noopener,noreferrer`);break;case `Clipboard`:navigator.clipboard.writeText(t).catch(()=>{let e=document.createElement(`textarea`);e.value=t,document.body.appendChild(e),e.select(),document.execCommand(`copy`),document.body.removeChild(e);});break;}o&&f(this.triggerData,this.eventData.video,this.eventData.index,o),this.dialogRef.close();}static ɵfac=function(o){return new(o||d)};static ɵcmp=of({type:d,selectors:[[`cooee-share-dialog`]],decls:19,vars:0,consts:[[1,`share-dialog`],[1,`share-dialog-header`],[`type`,`button`,`aria-label`,`Close`,1,`close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`],[1,`share-options`],[`type`,`button`,`aria-label`,`Share on WhatsApp`,1,`share-option`,3,`click`],[`name`,`whatsapp`,`aria-hidden`,`true`],[`type`,`button`,`aria-label`,`Share on X`,1,`share-option`,3,`click`],[`name`,`x-twitter`,`aria-hidden`,`true`],[`type`,`button`,`aria-label`,`Copy link`,1,`share-option`,3,`click`],[`name`,`copy`,`aria-hidden`,`true`]],template:function(o,t){o&1&&(Ka(0,`div`,0)(1,`div`,1)(2,`h3`),uv(3,`Share`),Ja(),Ka(4,`button`,2),Sf(`click`,function(e){return t.onShareAndClose(e)}),Df(5,`cooee-icon`,3),Ja()(),Ka(6,`div`,4)(7,`button`,5),Sf(`click`,function(e){return t.onShareAndClose(e,`Whatsapp`)}),Df(8,`cooee-icon`,6),Ka(9,`span`),uv(10,`Whatsapp`),Ja()(),Ka(11,`button`,7),Sf(`click`,function(e){return t.onShareAndClose(e,`X(Twitter)`)}),Df(12,`cooee-icon`,8),Ka(13,`span`),uv(14,`X`),Ja()(),Ka(15,`button`,9),Sf(`click`,function(e){return t.onShareAndClose(e,`Clipboard`)}),Df(16,`cooee-icon`,10),Ka(17,`span`),uv(18,`Copy link`),Ja()()()());},dependencies:[ye],styles:[`@keyframes _ngcontent-%COMP%_slideInScale{0%{opacity:0;transform:scale(.9) translateY(8px)}to{opacity:1;transform:scale(1) translateY(0)}}.share-dialog[_ngcontent-%COMP%]{background:#fff;border-radius:12px;padding:20px;min-width:280px;box-shadow:0 8px 32px #00000026;color:#333;animation:_ngcontent-%COMP%_slideInScale .25s ease-out}.share-dialog-header[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px}.share-dialog-header[_ngcontent-%COMP%] h3[_ngcontent-%COMP%]{font-family:var(--lc-heading-family),serif;margin:0;font-size:18px;font-weight:600}.share-options[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:12px;font-family:var(--lc-text-family),serif}.share-option[_ngcontent-%COMP%]{display:flex;align-items:center;gap:12px;padding:12px 16px;background:#0002;border:1px solid #e9ecef;border-radius:8px;color:#333;font-size:16px;font-weight:500;cursor:pointer;transition:all .2s ease}.share-option[_ngcontent-%COMP%]:hover{background:#0004;border-color:#dee2e6;transform:translateY(-1px)}.share-option[_ngcontent-%COMP%]:active{transform:translateY(0)}.share-option[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{width:24px;height:24px}.share-option[_ngcontent-%COMP%] cooee-icon[name=whatsapp][_ngcontent-%COMP%]{color:#25d366}.share-option[_ngcontent-%COMP%] cooee-icon[name=x-twitter][_ngcontent-%COMP%], .share-option[_ngcontent-%COMP%] cooee-icon[name=copy][_ngcontent-%COMP%]{color:#000}.share-option[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{flex:1;text-align:left}button.close-button[_ngcontent-%COMP%]{background-color:transparent;border:none}button.close-button[_ngcontent-%COMP%] cooee-icon[name=close][_ngcontent-%COMP%]{border-radius:100%;color:#000}`]})};
7
7
 
@@ -1,15 +1,15 @@
1
- import { f as fe, Y } from './chunk-DbQ39eGC-BuuE3sKA.js';
1
+ import { f as fe, Y } from './chunk-ekBE5rdY-CTOrJkKT.js';
2
2
  import { I as Ir, V as Ve, H as He, y as ye, M, l as le, u as ue, d, n, a as Mi, b as V } from './main.min.js';
3
- import { l as Mt, h as g, m as Ye, n as Se$1, G as Ge, j as W, o as of, p as ht, q as ut, r as ft, s as TE, t as wE, v as mt, x as pt, y as ye$1, k as Ka, S as Sf, z as ec, w as wD, I as ID, H as Ho, J as Ja, A as lf, C as jD, E as yf, c as ud, _ as _D, F as nc, R as Rf, L as xf, N as Hb, O as Ro, K as Ke, P as Ft, D as Df, $ as $b, Q as Es, B as Bo, X as Xa, V as Vo, U as rc, Z as mf, a0 as ND, a1 as vD, a2 as fu, a3 as pu, a4 as kD, a5 as ED, a6 as Ef, a7 as gv, a8 as Zf, a9 as qf, aa as fv, ab as Sv, ac as Kg } from './widgets-D_OSh97N-Bpf2Pdkf.js';
3
+ import { l as Mt, h as g, m as Ye, n as Se$1, G as Ge, j as W, o as of, p as ht, q as ut, r as ft, s as TE, t as wE, v as mt, x as pt, y as ye$1, k as Ka, S as Sf, z as ec, w as wD, I as ID, H as Ho, J as Ja, A as lf, C as jD, E as yf, c as ud, _ as _D, F as nc, R as Rf, L as xf, N as Hb, O as Ro, K as Ke, P as Ft, D as Df, $ as $b, Q as Es, B as Bo, X as Xa, V as Vo, U as rc, Z as mf, a0 as ND, a1 as vD, a2 as fu, a3 as pu, a4 as kD, a5 as ED, a6 as Ef, a7 as gv, a8 as Zf, a9 as qf, aa as fv, ab as Sv, ac as Kg } from './widgets-BIWIerG5-Cm-yzVcy.js';
4
4
 
5
5
  var f=(t,e,o,r)=>{if(!e)return;let i=new Ir(`CE Video Shared`,{current:{videoID:e.id,videoIndex:o},platform:r},t);window.CooeeSDK.sendEvent(i);},l=(t,e,o=true)=>{let r=o?encodeURIComponent(m(t,e)):m(t,e),n=`Hey! Check out this video for an amazing product -`;return {url:r,text:o?encodeURIComponent(n):n}},m=(t,e)=>{return Ve(He(window.location.href,t),e)};
6
6
 
7
- var S=class n{video=$b.required();progress=Mt(0);constructor(){Es(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100);};e.addEventListener(`timeupdate`,i),t(()=>{e.removeEventListener(`timeupdate`,i);});});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-progress-bar`]],inputs:{video:[1,`video`]},decls:3,vars:3,consts:[[1,`video-untracked-path`],[`role`,`progressbar`,1,`video-tracked-path`]],template:function(e,i){e&1&&(Bo(0,`div`,0)(1,`div`,1),Xa(2,`div`),Vo()()),e&2&&(ud(),rc(`width`,i.progress(),`%`),mf(`aria-valuenow`,i.progress()));},styles:[`[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media(prefers-reduced-motion:reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}`]})};var P=class n{dialogState=Hb();dialog=g(Ro);triggerData=g(Ke)().triggerData;eventData=g(Ge);containerRef=g(Ft);async share(t){t.stopPropagation(),t.preventDefault(),M()&&V()?await this.shareNative():await this.shareWithDialog();}async shareNative(){let t=l(this.triggerData,this.eventData.video,false);await navigator.share(t),f(this.triggerData,this.eventData.video,this.eventData.index,`Native`);}async shareWithDialog(){let t=await import('./share-dialog.component-CMwPyb-w-B0UrEp43.js');this.dialogState.emit(true),this.dialog.open(t.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(false));}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-share-button`]],outputs:{dialogState:`dialogState`},decls:2,vars:0,consts:[[`type`,`button`,`aria-label`,`Share video`,3,`click`],[`name`,`share`]],template:function(e,i){e&1&&(Ka(0,`button`,0),Sf(`click`,function(r){return i.share(r)}),Df(1,`cooee-icon`,1),Ja());},dependencies:[ye$1],styles:[`button[_ngcontent-%COMP%]{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}`]})};var Ie=[`swiperComp`],Se=[`videoEl`],Pe=(n,t)=>t.url;function ke(n,t){n&1&&(Ka(0,`div`,11),Df(1,`div`,15),Ja());}function Me(n,t){if(n&1&&Df(0,`source`,13),n&2){let e=t.$implicit;yf(`type`,gv(e.mimeType))(`src`,e.url);}}function Oe(n,t){n&1&&Ef(0);}function Ne(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,24),Sf(`cardClick`,function(o){fu(e);let r=kD(2).$implicit;return pu(kD().productCardClicked(o,r))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.items);}}function ze(n,t){if(n&1&&Df(0,`cooee-video-card`,23),n&2){let e=kD(2).$implicit;yf(`card`,e.card);}}function Fe(n,t){if(n&1){let e=ND();Df(0,`cooee-video-progress-bar`,16),Ka(1,`div`,17)(2,`cooee-mute-toggle`,18),Zf(`mutedChange`,function(o){fu(e);let r=kD(2);return fv(r.muted,o)||(r.muted=o),pu(o)}),Sf(`toggled`,function(){fu(e);return pu(kD(2).muteToggled())}),Ja(),lf(3,Oe,1,0,`ng-container`,8),Ja(),Ka(4,`div`,19)(5,`cooee-share-button`,20),Sf(`dialogState`,function(o){fu(e);return pu(kD(2).shareDialogOpen.set(o))}),Ja()(),Ka(6,`div`,21),vD(7,Ne,1,1,`cooee-video-promoted-items`,22)(8,ze,1,1,`cooee-video-card`,23),Ja();}if(n&2){let e=kD().$implicit,i=jD(5),o=kD(),r=jD(9);yf(`video`,i),ud(2),qf(`muted`,o.muted),yf(`videoEl`,i),ud(),yf(`ngTemplateOutlet`,r),ud(4),ED(e.items.length&&o.videoConfig.showItems()?7:e.card&&o.videoConfig.footerContent===o.VideoConfigFooterContent.CARD?8:-1);}}function Le(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-detail`,25),Sf(`closeClick`,function(){fu(e);return pu(kD(2).productModalClosed())}),Ja();}if(n&2){let e=kD(2);yf(`item`,e.selectedItem)(`similarItems`,e.selectedVideo.items)(`template`,e.videoConfig.itemDetailConfig.template);}}function Re(n,t){if(n&1){let e=ND();Ka(0,`div`,6)(1,`div`,9)(2,`div`,10),vD(3,ke,2,0,`div`,11),Ka(4,`video`,12,2),Sf(`click`,function(){let o=fu(e).$index,r=kD();return pu(r.currentIndex===o&&r.toggleMute())})(`ended`,function(){fu(e);let o=jD(5);return pu(kD().onVideoEnded(o))})(`loadstart`,function(){let o=fu(e).$index;return pu(kD().onVideoLoadStart(o))})(`canplay`,function(){let o=fu(e).$index;return pu(kD().onVideoCanPlay(o))}),wD(6,Me,1,3,`source`,13,Pe),Ja(),vD(8,Fe,9,5),Ja(),vD(9,Le,1,3,`cooee-item-detail`,14),Ja()();}if(n&2){let e=t.$implicit,i=t.$index,o=kD();ud(2),rc(`background-image`,e.thumbnail?`url(`+e.thumbnail+`)`:null),ud(),ED(o.shouldShowVideoSpinner(i)?3:-1),ud(),yf(`ngClass`,o.viewTemplateClassName)(`muted`,true),mf(`preload`,o.isVideoVisible(i)?`metadata`:`none`)(`data-video-id`,e.id)(`autoplay`,null),ud(2),_D(e.sources),ud(2),ED(o.currentIndex===i?8:-1),ud(),ED(o.selectedItem&&o.currentIndex===i?9:-1);}}function Ae(n,t){n&1&&Ef(0);}function Be(n,t){if(n&1){let e=ND();Ka(0,`button`,26),Sf(`click`,function(){fu(e);return pu(kD().close())}),Df(1,`cooee-icon`,27),Ja();}}var Te=class n$1{swiperComponent;videoElements;VideoConfigFooterContent=ye;currentIndex=0;muted=Mt(false);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName=`lc-video-only-view`;shareDialogOpen=Mt(false);data=g(Ye);elementRef=g(Se$1);eventData=g(Ge);dialogRef=g(W);swiperInitialized=Mt(false);swiperOptions=Mt(null);videos=[];videoConfig;triggerContext;engagementTrigger;isMobile=M();navigationConfig;cssLoadedPromise;resizeDebouncer=new le(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videos[this.currentIndex],this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new ue,this.navigationConfig=new d({enabled:true,size:50,color:new n({h:`#000000`})}),this.cssLoadedPromise=Mi(this.elementRef.nativeElement.shadowRoot);}onKeyDown(t){t.preventDefault(),t.stopPropagation(),this.close();}async ngOnInit(){switch(this.muted.set(await fe.get(`muted`,false)),this.videoConfig.detailPopup.template){case `PRODUCT_DETAIL_VIEW`:this.selectItemForDetailView(),this.viewTemplateClassName=`lc-product-detail-view`;break;case `VIDEO_ONLY_VIEW`:this.viewTemplateClassName=`lc-video-only-view`;break}}ngAfterViewInit(){this.initializeSwiperWithVideoDimensions();}ngOnDestroy(){this.resizeDebouncer?.destroy();}initializeSwiperWithVideoDimensions(){this.applyOptimalVideoDimensions(),this.initSwiperOptions(),this.playActiveVideo(false);}close(){let t=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videos[this.currentIndex],lastVideoIndex:this.currentIndex,lastVideoDuration:t?.currentTime});}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1);}productModalClosed(){this.selectedItem=null;}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause());}toggleMute(){this.muted.update(t=>!t);}async muteToggled(){await fe.set(`muted`,this.muted());let e=[this.muted()?`CE Video Muted`:`CE Video Unmuted`,{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(e);}playActiveVideo(t=true){t&&this.pauseAll();let e=this.getCurrentVideoElement();e&&this.playVideo(e);}playVideo(t){t.currentTime=0,t.play().catch(e=>Y.error(e));}onVideoEnded(t){if(this.currentIndex<this.videos.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(t):this.moveToNextVideo();else {let i=[`CE Last Video Ended`,{previous:this.getPreviousVideoDataForEvent()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.playVideo(t);}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.selectedVideo=this.videos[this.currentIndex],this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.isProductDetailView()?this.selectItemForDetailView():this.selectedItem=null;let r=new Ir(`CE Video Changed`,{previous:e,current:this.currentVideoProps()},this.engagementTrigger);r.setVideos(this.videos[this.currentIndex]),window.CooeeSDK.sendEvent(r);}productCardClicked(t,e){let o=new Ir(`CE More Item Info Clicked`,{current:{videoID:e.id,videoIndex:this.currentIndex}},this.engagementTrigger);o.setVideos(e),window.CooeeSDK.sendEvent(o),this.selectedItem=t;}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}shouldShowVideoSpinner(t){return this.swiperInitialized()?this.videoLoadingStates.get(t)===true&&this.isVideoVisible(t):this.isVideoVisible(t)}isVideoVisible(t){let e=this.currentIndex-1,i=this.currentIndex+1;return t===this.currentIndex||t===e||t===i}async initSwiperOptions(){await this.cssLoadedPromise;let t=this.isMobile?1:`auto`,e=0;this.isProductDetailView()&&(t=`auto`,e=10),this.swiperOptions.set({direction:this.isMobile?`vertical`:`horizontal`,effect:this.isMobile?`slide`:`coverflow`,slidesPerView:t,initialSlide:this.currentIndex,centeredSlides:true,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:false},on:{init:i=>{this.swiperInitialized.set(true),setTimeout(()=>{i.update();},100);}},mousewheel:{enabled:!this.isMobile,invert:false,thresholdDelta:20}});}isProductDetailView(){return this.videoConfig.detailPopup.template===`PRODUCT_DETAIL_VIEW`}currentVideoProps(){return {videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let i=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/i).toFixed(4),t}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null;}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let t=this.calculateOptimalVideoDimensions();t&&this.setVideoContainerDimensions(t.width,t.height);}calculateOptimalVideoDimensions(){let t=this.videos.map(h=>h.sources?.[0]).filter(h=>h?.width&&h?.height).map(h=>({width:h.width,height:h.height,aspectRatio:h.width/h.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,o=window.innerHeight*.9,r=i/e.width,k=o/e.height,A=Math.min(r,k);return {width:Math.floor(e.width*A),height:Math.floor(e.height*A)}}setVideoContainerDimensions(t,e){let i=this.elementRef.nativeElement;i.style.setProperty(`--video-container-width`,`${t}px`),i.style.setProperty(`--video-container-height`,`${e}px`);}onResize(){this.applyOptimalVideoDimensions();}static ɵfac=function(e){return new(e||n$1)};static ɵcmp=of({type:n$1,selectors:[[`cooee-video-detail-dialog`]],viewQuery:function(e,i){if(e&1&&nc(Ie,7)(Se,5),e&2){let o;Rf(o=xf())&&(i.swiperComponent=o.first),Rf(o=xf())&&(i.videoElements=o);}},hostAttrs:[1,`letscooee-widget`],hostBindings:function(e,i){e&1&&Sf(`keydown.escape`,function(r){return i.onKeyDown(r)},Kg);},decls:10,vars:4,consts:[[`swiperComp`,``],[`closeButtonTemplate`,``],[`videoEl`,``],[1,`lc-shadow-inner`,3,`ngClass`],[1,`video-swiper`,3,`slideChange`,`options`,`navigationConfig`],[`ngProjectAs`,`swiper-slides`,5,[`swiper-slides`]],[1,`swiper-slide`,`video-slide`],[1,`lc-desktop-controls`],[4,`ngTemplateOutlet`],[1,`lc-video-modal-row`],[1,`lc-video-container`],[1,`video-loading-overlay`],[`playsinline`,``,1,`lc-video-el`,3,`click`,`ended`,`loadstart`,`canplay`,`ngClass`,`muted`],[3,`src`,`type`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`item`,`similarItems`,`template`],[1,`loading-spinner`],[3,`video`],[1,`lc-video-controls`],[3,`mutedChange`,`toggled`,`muted`,`videoEl`],[1,`share-controls`],[3,`dialogState`],[1,`lc-card-container`],[3,`items`],[3,`card`],[3,`cardClick`,`items`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`closeClick`,`item`,`similarItems`,`template`],[`type`,`button`,`aria-label`,`Close`,1,`lc-close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`]],template:function(e,i){if(e&1&&(Ka(0,`div`,3)(1,`cooee-swiper`,4,0),Sf(`slideChange`,function(r){return i.onSlideChange(r)}),ec(3,5),wD(4,Re,10,10,`div`,6,ID),Ho(),Ja(),Ka(6,`div`,7),lf(7,Ae,1,0,`ng-container`,8),Ja()(),lf(8,Be,2,0,`ng-template`,null,1,Sv)),e&2){let o=jD(9);yf(`ngClass`,i.viewTemplateClassName),ud(),yf(`options`,i.swiperOptions())(`navigationConfig`,i.navigationConfig),ud(3),_D(i.videos),ud(3),yf(`ngTemplateOutlet`,o);}},dependencies:[ht,ut,ft,P,S,TE,wE,mt,pt,ye$1],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media(min-width:768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media(min-width:768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%;pointer-events:none}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media(max-width:768px){.video-swiper>.swiper-button-prev{display:none!important}}@media(max-width:768px){.video-swiper>.swiper-button-next{display:var(--lc-next-video-button-display)!important;width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent);color:#fff;inset:auto auto 12px 50%;transform:translate(-50%) rotate(90deg)}.video-swiper>.swiper-button-next:after{color:#fff;font-weight:900}}.video-swiper:has(cooee-item-detail)>.swiper-button-next{display:none!important}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden;pointer-events:auto}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media(min-width:768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media(max-width:768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media(min-width:768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media(min-width:768px){.video-slide{border-radius:var(--lc-media-radius);overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover;position:relative;z-index:3}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media(max-width:768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}@media(min-width:768px){.lc-video-controls .lc-close-button{display:none}}.share-controls{position:absolute;bottom:30%;right:.5rem;z-index:10;display:flex;gap:.25rem;flex-direction:column;justify-content:center;align-items:center}.lc-close-button{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}.lc-video-container{position:relative;height:100%;width:100%;background:#000000b3 no-repeat center;background-size:cover}@media(min-width:768px){.lc-product-detail-view .lc-video-container{width:50%}}@media(min-width:768px){.lc-video-only-view .lc-video-container{width:var(--video-container-width, 100%);height:var(--video-container-height, 100%)}}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media(max-width:768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media(max-width:768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute;border-radius:var(--lc-card-radius) var(--lc-card-radius) 0 0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#0000004d;z-index:2}.video-loading-overlay .loading-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.3);border-top:3px solid #fff;border-radius:50%;animation:spin 1s linear infinite}
7
+ var S=class n{video=$b.required();progress=Mt(0);constructor(){Es(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100);};e.addEventListener(`timeupdate`,i),t(()=>{e.removeEventListener(`timeupdate`,i);});});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-progress-bar`]],inputs:{video:[1,`video`]},decls:3,vars:3,consts:[[1,`video-untracked-path`],[`role`,`progressbar`,1,`video-tracked-path`]],template:function(e,i){e&1&&(Bo(0,`div`,0)(1,`div`,1),Xa(2,`div`),Vo()()),e&2&&(ud(),rc(`width`,i.progress(),`%`),mf(`aria-valuenow`,i.progress()));},styles:[`[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media(prefers-reduced-motion:reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}`]})};var P=class n{dialogState=Hb();dialog=g(Ro);triggerData=g(Ke)().triggerData;eventData=g(Ge);containerRef=g(Ft);async share(t){t.stopPropagation(),t.preventDefault(),M()&&V()?await this.shareNative():await this.shareWithDialog();}async shareNative(){let t=l(this.triggerData,this.eventData.video,false);await navigator.share(t),f(this.triggerData,this.eventData.video,this.eventData.index,`Native`);}async shareWithDialog(){let t=await import('./share-dialog.component-iVPRqp9I-6AcjxEpb.js');this.dialogState.emit(true),this.dialog.open(t.ShareDialogComponent,{viewContainerRef:this.containerRef}).closed.subscribe(()=>this.dialogState.emit(false));}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-share-button`]],outputs:{dialogState:`dialogState`},decls:2,vars:0,consts:[[`type`,`button`,`aria-label`,`Share video`,3,`click`],[`name`,`share`]],template:function(e,i){e&1&&(Ka(0,`button`,0),Sf(`click`,function(r){return i.share(r)}),Df(1,`cooee-icon`,1),Ja());},dependencies:[ye$1],styles:[`button[_ngcontent-%COMP%]{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}button[_ngcontent-%COMP%] cooee-icon[name=share][_ngcontent-%COMP%]{color:#fff}`]})};var Ie=[`swiperComp`],Se=[`videoEl`],Pe=(n,t)=>t.url;function ke(n,t){n&1&&(Ka(0,`div`,11),Df(1,`div`,15),Ja());}function Me(n,t){if(n&1&&Df(0,`source`,13),n&2){let e=t.$implicit;yf(`type`,gv(e.mimeType))(`src`,e.url);}}function Oe(n,t){n&1&&Ef(0);}function Ne(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,24),Sf(`cardClick`,function(o){fu(e);let r=kD(2).$implicit;return pu(kD().productCardClicked(o,r))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.items);}}function ze(n,t){if(n&1&&Df(0,`cooee-video-card`,23),n&2){let e=kD(2).$implicit;yf(`card`,e.card);}}function Fe(n,t){if(n&1){let e=ND();Df(0,`cooee-video-progress-bar`,16),Ka(1,`div`,17)(2,`cooee-mute-toggle`,18),Zf(`mutedChange`,function(o){fu(e);let r=kD(2);return fv(r.muted,o)||(r.muted=o),pu(o)}),Sf(`toggled`,function(){fu(e);return pu(kD(2).muteToggled())}),Ja(),lf(3,Oe,1,0,`ng-container`,8),Ja(),Ka(4,`div`,19)(5,`cooee-share-button`,20),Sf(`dialogState`,function(o){fu(e);return pu(kD(2).shareDialogOpen.set(o))}),Ja()(),Ka(6,`div`,21),vD(7,Ne,1,1,`cooee-video-promoted-items`,22)(8,ze,1,1,`cooee-video-card`,23),Ja();}if(n&2){let e=kD().$implicit,i=jD(5),o=kD(),r=jD(9);yf(`video`,i),ud(2),qf(`muted`,o.muted),yf(`videoEl`,i),ud(),yf(`ngTemplateOutlet`,r),ud(4),ED(e.items.length&&o.videoConfig.showItems()?7:e.card&&o.videoConfig.footerContent===o.VideoConfigFooterContent.CARD?8:-1);}}function Le(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-detail`,25),Sf(`closeClick`,function(){fu(e);return pu(kD(2).productModalClosed())}),Ja();}if(n&2){let e=kD(2);yf(`item`,e.selectedItem)(`similarItems`,e.selectedVideo.items)(`template`,e.videoConfig.itemDetailConfig.template);}}function Re(n,t){if(n&1){let e=ND();Ka(0,`div`,6)(1,`div`,9)(2,`div`,10),vD(3,ke,2,0,`div`,11),Ka(4,`video`,12,2),Sf(`click`,function(){let o=fu(e).$index,r=kD();return pu(r.currentIndex===o&&r.toggleMute())})(`ended`,function(){fu(e);let o=jD(5);return pu(kD().onVideoEnded(o))})(`loadstart`,function(){let o=fu(e).$index;return pu(kD().onVideoLoadStart(o))})(`canplay`,function(){let o=fu(e).$index;return pu(kD().onVideoCanPlay(o))}),wD(6,Me,1,3,`source`,13,Pe),Ja(),vD(8,Fe,9,5),Ja(),vD(9,Le,1,3,`cooee-item-detail`,14),Ja()();}if(n&2){let e=t.$implicit,i=t.$index,o=kD();ud(2),rc(`background-image`,e.thumbnail?`url(`+e.thumbnail+`)`:null),ud(),ED(o.shouldShowVideoSpinner(i)?3:-1),ud(),yf(`ngClass`,o.viewTemplateClassName)(`muted`,true),mf(`preload`,o.isVideoVisible(i)?`metadata`:`none`)(`data-video-id`,e.id)(`autoplay`,null),ud(2),_D(e.sources),ud(2),ED(o.currentIndex===i?8:-1),ud(),ED(o.selectedItem&&o.currentIndex===i?9:-1);}}function Ae(n,t){n&1&&Ef(0);}function Be(n,t){if(n&1){let e=ND();Ka(0,`button`,26),Sf(`click`,function(){fu(e);return pu(kD().close())}),Df(1,`cooee-icon`,27),Ja();}}var Te=class n$1{swiperComponent;videoElements;VideoConfigFooterContent=ye;currentIndex=0;muted=Mt(false);selectedItem=null;selectedVideo;detailPopupTemplate;viewTemplateClassName=`lc-video-only-view`;shareDialogOpen=Mt(false);data=g(Ye);elementRef=g(Se$1);eventData=g(Ge);dialogRef=g(W);swiperInitialized=Mt(false);swiperOptions=Mt(null);videos=[];videoConfig;triggerContext;engagementTrigger;isMobile=M();navigationConfig;cssLoadedPromise;resizeDebouncer=new le(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.selectedItem=this.data.selectedItem??null,this.selectedVideo=this.videos[this.currentIndex],this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.videoConfig=this.engagementTrigger?.content?.videoConfig??new ue,this.navigationConfig=new d({enabled:true,size:50,color:new n({h:`#000000`})}),this.cssLoadedPromise=Mi(this.elementRef.nativeElement.shadowRoot);}onKeyDown(t){t.preventDefault(),t.stopPropagation(),this.close();}async ngOnInit(){switch(this.muted.set(await fe.get(`muted`,false)),this.videoConfig.detailPopup.template){case `PRODUCT_DETAIL_VIEW`:this.selectItemForDetailView(),this.viewTemplateClassName=`lc-product-detail-view`;break;case `VIDEO_ONLY_VIEW`:this.viewTemplateClassName=`lc-video-only-view`;break}}ngAfterViewInit(){this.initializeSwiperWithVideoDimensions();}ngOnDestroy(){this.resizeDebouncer?.destroy();}initializeSwiperWithVideoDimensions(){this.applyOptimalVideoDimensions(),this.initSwiperOptions(),this.playActiveVideo(false);}close(){let t=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:this.videos[this.currentIndex],lastVideoIndex:this.currentIndex,lastVideoDuration:t?.currentTime});}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1);}productModalClosed(){this.selectedItem=null;}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause());}toggleMute(){this.muted.update(t=>!t);}async muteToggled(){await fe.set(`muted`,this.muted());let e=[this.muted()?`CE Video Muted`:`CE Video Unmuted`,{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(e);}playActiveVideo(t=true){t&&this.pauseAll();let e=this.getCurrentVideoElement();e&&this.playVideo(e);}playVideo(t){t.currentTime=0,t.play().catch(e=>Y.error(e));}onVideoEnded(t){if(this.currentIndex<this.videos.length-1)this.selectedItem||this.shareDialogOpen()?this.playVideo(t):this.moveToNextVideo();else {let i=[`CE Last Video Ended`,{previous:this.getPreviousVideoDataForEvent()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.playVideo(t);}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.selectedVideo=this.videos[this.currentIndex],this.eventData.video=this.selectedVideo,this.eventData.index=this.currentIndex,this.playActiveVideo(),this.isProductDetailView()?this.selectItemForDetailView():this.selectedItem=null;let r=new Ir(`CE Video Changed`,{previous:e,current:this.currentVideoProps()},this.engagementTrigger);r.setVideos(this.videos[this.currentIndex]),window.CooeeSDK.sendEvent(r);}productCardClicked(t,e){let o=new Ir(`CE More Item Info Clicked`,{current:{videoID:e.id,videoIndex:this.currentIndex}},this.engagementTrigger);o.setVideos(e),window.CooeeSDK.sendEvent(o),this.selectedItem=t;}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}shouldShowVideoSpinner(t){return this.swiperInitialized()?this.videoLoadingStates.get(t)===true&&this.isVideoVisible(t):this.isVideoVisible(t)}isVideoVisible(t){let e=this.currentIndex-1,i=this.currentIndex+1;return t===this.currentIndex||t===e||t===i}async initSwiperOptions(){await this.cssLoadedPromise;let t=this.isMobile?1:`auto`,e=0;this.isProductDetailView()&&(t=`auto`,e=10),this.swiperOptions.set({direction:this.isMobile?`vertical`:`horizontal`,effect:this.isMobile?`slide`:`coverflow`,slidesPerView:t,initialSlide:this.currentIndex,centeredSlides:true,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:false},on:{init:i=>{this.swiperInitialized.set(true),setTimeout(()=>{i.update();},100);}},mousewheel:{enabled:!this.isMobile,invert:false,thresholdDelta:20}});}isProductDetailView(){return this.videoConfig.detailPopup.template===`PRODUCT_DETAIL_VIEW`}currentVideoProps(){return {videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(o=>o.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let i=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/i).toFixed(4),t}selectItemForDetailView(){this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null;}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let t=this.calculateOptimalVideoDimensions();t&&this.setVideoContainerDimensions(t.width,t.height);}calculateOptimalVideoDimensions(){let t=this.videos.map(h=>h.sources?.[0]).filter(h=>h?.width&&h?.height).map(h=>({width:h.width,height:h.height,aspectRatio:h.width/h.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,o=window.innerHeight*.9,r=i/e.width,k=o/e.height,A=Math.min(r,k);return {width:Math.floor(e.width*A),height:Math.floor(e.height*A)}}setVideoContainerDimensions(t,e){let i=this.elementRef.nativeElement;i.style.setProperty(`--video-container-width`,`${t}px`),i.style.setProperty(`--video-container-height`,`${e}px`);}onResize(){this.applyOptimalVideoDimensions();}static ɵfac=function(e){return new(e||n$1)};static ɵcmp=of({type:n$1,selectors:[[`cooee-video-detail-dialog`]],viewQuery:function(e,i){if(e&1&&nc(Ie,7)(Se,5),e&2){let o;Rf(o=xf())&&(i.swiperComponent=o.first),Rf(o=xf())&&(i.videoElements=o);}},hostAttrs:[1,`letscooee-widget`],hostBindings:function(e,i){e&1&&Sf(`keydown.escape`,function(r){return i.onKeyDown(r)},Kg);},decls:10,vars:4,consts:[[`swiperComp`,``],[`closeButtonTemplate`,``],[`videoEl`,``],[1,`lc-shadow-inner`,3,`ngClass`],[1,`video-swiper`,3,`slideChange`,`options`,`navigationConfig`],[`ngProjectAs`,`swiper-slides`,5,[`swiper-slides`]],[1,`swiper-slide`,`video-slide`],[1,`lc-desktop-controls`],[4,`ngTemplateOutlet`],[1,`lc-video-modal-row`],[1,`lc-video-container`],[1,`video-loading-overlay`],[`playsinline`,``,1,`lc-video-el`,3,`click`,`ended`,`loadstart`,`canplay`,`ngClass`,`muted`],[3,`src`,`type`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`item`,`similarItems`,`template`],[1,`loading-spinner`],[3,`video`],[1,`lc-video-controls`],[3,`mutedChange`,`toggled`,`muted`,`videoEl`],[1,`share-controls`],[3,`dialogState`],[1,`lc-card-container`],[3,`items`],[3,`card`],[3,`cardClick`,`items`],[1,`swiper-no-swiping`,`swiper-no-mousewheel`,3,`closeClick`,`item`,`similarItems`,`template`],[`type`,`button`,`aria-label`,`Close`,1,`lc-close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`]],template:function(e,i){if(e&1&&(Ka(0,`div`,3)(1,`cooee-swiper`,4,0),Sf(`slideChange`,function(r){return i.onSlideChange(r)}),ec(3,5),wD(4,Re,10,10,`div`,6,ID),Ho(),Ja(),Ka(6,`div`,7),lf(7,Ae,1,0,`ng-container`,8),Ja()(),lf(8,Be,2,0,`ng-template`,null,1,Sv)),e&2){let o=jD(9);yf(`ngClass`,i.viewTemplateClassName),ud(),yf(`options`,i.swiperOptions())(`navigationConfig`,i.navigationConfig),ud(3),_D(i.videos),ud(3),yf(`ngTemplateOutlet`,o);}},dependencies:[ht,ut,ft,P,S,TE,wE,mt,pt,ye$1],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media(min-width:768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media(min-width:768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%;pointer-events:none}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media(max-width:768px){.video-swiper>.swiper-button-prev{display:none!important}}@media(max-width:768px){.video-swiper>.swiper-button-next{display:var(--lc-next-video-button-display)!important;width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent);color:#fff;inset:auto auto 12px 50%;transform:translate(-50%) rotate(90deg)}.video-swiper>.swiper-button-next:after{color:#fff;font-weight:900}}.video-swiper:has(cooee-item-detail)>.swiper-button-next{display:none!important}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden;pointer-events:auto}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media(min-width:768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media(max-width:768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media(min-width:768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media(min-width:768px){.video-slide{border-radius:var(--lc-media-radius);overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover;position:relative;z-index:3}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media(max-width:768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}@media(min-width:768px){.lc-video-controls .lc-close-button{display:none}}.share-controls{position:absolute;bottom:30%;right:.5rem;z-index:10;display:flex;gap:.25rem;flex-direction:column;justify-content:center;align-items:center}.lc-close-button{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}.lc-video-container{position:relative;height:100%;width:100%;background:#000000b3 no-repeat center;background-size:cover}@media(min-width:768px){.lc-product-detail-view .lc-video-container{width:50%}}@media(min-width:768px){.lc-video-only-view .lc-video-container{width:var(--video-container-width, 100%);height:var(--video-container-height, 100%)}}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media(max-width:768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media(max-width:768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute;border-radius:var(--lc-card-radius) var(--lc-card-radius) 0 0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#0000004d;z-index:2}.video-loading-overlay .loading-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.3);border-top:3px solid #fff;border-radius:50%;animation:spin 1s linear infinite}
8
8
  `],encapsulation:3})};
9
9
 
10
- var videoDetailDialog_componentCX4_iSK_ = /*#__PURE__*/Object.freeze({
10
+ var videoDetailDialog_componentWEu7uD2 = /*#__PURE__*/Object.freeze({
11
11
  __proto__: null,
12
12
  VideoDetailDialogComponent: Te
13
13
  });
14
14
 
15
- export { f, l, videoDetailDialog_componentCX4_iSK_ as v };
15
+ export { f, l, videoDetailDialog_componentWEu7uD2 as v };
@@ -1,4 +1,4 @@
1
- import { s, r, Y as Y$1, b as jn$1, e as ee$2, h as he$2, C as Cr$1, A as An$2, f as fe$2 } from './chunk-DbQ39eGC-BuuE3sKA.js';
1
+ import { s, r, Y as Y$1, b as jn$1, e as ee$2, h as he$2, C as Cr$1, A as An$2, f as fe$2 } from './chunk-ekBE5rdY-CTOrJkKT.js';
2
2
  import { v as v$1, U as U$1, x as q, z as Sr$1, D as m$1, E as vs$1, J as ve$2, K as pi$1, N as Nn$1, L as bi$1, O as ii, _ as _e$2, P as Fs$1, Q as Ps$1, R as Se$2, T as ye$2, a as Mi$1, W as Ce$2, s as He$3, X as Me$2, I as Ir$1, Y as De$2, l as le$2, M as M$3, Z as Vi$1, a0 as $e$2, a1 as gr$1, a2 as He$4, a3 as qe$2, a4 as Re$2, a5 as Fe$2, a6 as We$3, a7 as Je$1, a8 as Ae$2, y as ye$3, a9 as ge$3 } from './main.min.js';
3
3
 
4
4
  var Y=null,mr=false,di=1,G=Symbol(`SIGNAL`);function v(e){let t=Y;return Y=e,t}function Dr(){return Y}var Pt$2={version:0,lastCleanEpoch:0,dirty:false,producers:void 0,producersTail:void 0,consumers:void 0,consumersTail:void 0,recomputing:false,consumerAllowSignalWrites:false,consumerIsAlwaysLive:false,kind:`unknown`,producerMustRecompute:()=>false,producerRecomputeValue:()=>{},consumerMarkedDirty:()=>{},consumerOnSignalRead:()=>{}};function jt$1(e){if(mr)throw new Error(``);if(Y===null)return;Y.consumerOnSignalRead(e);let t=Y.producersTail;if(t!==void 0&&t.producer===e)return;let n,r=Y.recomputing;if(r&&(n=t!==void 0?t.nextProducer:Y.producers,n!==void 0&&n.producer===e)){Y.producersTail=n,n.lastReadVersion=e.version;return}let o=e.consumersTail;if(o!==void 0&&o.consumer===Y&&(!r||Qp(o,Y)))return;let i=Vt$2(Y),s={producer:e,consumer:Y,nextProducer:n,prevConsumer:o,lastReadVersion:e.version,nextConsumer:void 0};Y.producersTail=s,t!==void 0?t.nextProducer=s:Y.producers=s,i&&Oc(e,s);}function Ac(){di++;}function fi$1(e){if(!(Vt$2(e)&&!e.dirty)&&!(!e.dirty&&e.lastCleanEpoch===di)){if(!e.producerMustRecompute(e)&&!Dn$1(e)){li(e);return}e.producerRecomputeValue(e),li(e);}}function pi(e){if(e.consumers===void 0)return;let t=mr;mr=true;try{for(let n=e.consumers;n!==void 0;n=n.nextConsumer){let r=n.consumer;r.dirty||Yp(r);}}finally{mr=t;}}function hi$1(){return Y?.consumerAllowSignalWrites!==false}function Yp(e){e.dirty=true,pi(e),e.consumerMarkedDirty?.(e);}function li(e){e.dirty=false,e.lastCleanEpoch=di;}function Bt$2(e){return e&&Rc(e),v(e)}function Rc(e){e.producersTail=void 0,e.recomputing=true;}function yn$1(e,t){v(t),e&&xc(e);}function xc(e){e.recomputing=false;let t=e.producersTail,n=t!==void 0?t.nextProducer:e.producers;if(n!==void 0){if(Vt$2(e))do n=gi(n);while(n!==void 0);t!==void 0?t.nextProducer=void 0:e.producers=void 0;}}function Dn$1(e){for(let t=e.producers;t!==void 0;t=t.nextProducer){let n=t.producer,r=t.lastReadVersion;if(r!==n.version||(fi$1(n),r!==n.version))return true}return false}function lt$2(e){if(Vt$2(e)){let t=e.producers;for(;t!==void 0;)t=gi(t);}e.producers=void 0,e.producersTail=void 0,e.consumers=void 0,e.consumersTail=void 0;}function Oc(e,t){let n=e.consumersTail,r=Vt$2(e);if(n!==void 0?(t.nextConsumer=n.nextConsumer,n.nextConsumer=t):(t.nextConsumer=void 0,e.consumers=t),t.prevConsumer=n,e.consumersTail=t,!r)for(let o=e.producers;o!==void 0;o=o.nextProducer)Oc(o.producer,o);}function gi(e){let t=e.producer,n=e.nextProducer,r=e.nextConsumer,o=e.prevConsumer;if(e.nextConsumer=void 0,e.prevConsumer=void 0,r!==void 0?r.prevConsumer=o:t.consumersTail=o,o!==void 0)o.nextConsumer=r;else if(t.consumers=r,!Vt$2(t)){let i=t.producers;for(;i!==void 0;)i=gi(i);}return n}function Vt$2(e){return e.consumerIsAlwaysLive||e.consumers!==void 0}function Qp(e,t){let n=t.producersTail;if(n!==void 0){let r=t.producers;do{if(r===e)return true;if(r===n)break;r=r.nextProducer;}while(r!==void 0)}return false}function yi(e,t){return Object.is(e,t)}function vn$1(e,t){let n=Object.create(Kp);n.computation=e;let r=()=>{if(fi$1(n),jt$1(n),n.value===yr)throw n.error;return n.value};return r[G]=n,r}var ci=Symbol(`UNSET`),ui$1=Symbol(`COMPUTING`),yr=Symbol(`ERRORED`),Kp=s(r({},Pt$2),{value:ci,dirty:true,error:null,equal:yi,kind:`computed`,producerMustRecompute(e){return e.value===ci||e.value===ui$1},producerRecomputeValue(e){if(e.value===ui$1)throw new Error(``);let t=e.value;e.value=ui$1;let n=Bt$2(e),r,o=false;try{r=e.computation(),v(null),o=t!==ci&&t!==yr&&r!==yr&&e.equal(t,r);}catch(i){r=yr,e.error=i;}finally{yn$1(e,n);}if(o){e.value=t;return}e.value=r,e.version++;}});function Jp(){throw new Error}var kc=Jp;function Fc(e){kc(e);}function Di(e){kc=e;}function vi$1(e,t){let n=Object.create(vr);n.value=e;let r=()=>Lc(n);return r[G]=n,[r,s=>Ht$2(n,s),s=>Pc(n,s)]}function Lc(e){return jt$1(e),e.value}function Ht$2(e,t){hi$1()||Fc(e),e.equal(e.value,t)||(e.value=t,eh(e));}function Pc(e,t){hi$1()||Fc(e),Ht$2(e,t(e.value));}var vr=s(r({},Pt$2),{equal:yi,value:void 0,kind:`signal`});function eh(e){e.version++,Ac(),pi(e);}var Ei=s(r({},Pt$2),{consumerIsAlwaysLive:true,consumerAllowSignalWrites:true,dirty:true,kind:`effect`});function Ci(e){if(e.dirty=false,e.version>0&&!Dn$1(e))return;e.version++;let t=Bt$2(e);try{e.cleanup(),e.fn();}finally{yn$1(e,t);}}var Ii;function Er(){return Ii}function Ae$1(e){let t=Ii;return Ii=e,t}var jc=Symbol(`NotFound`);function $t$1(e){return e===jc||e?.name===`ɵNotFound`}var Mr=`https://angular.dev/best-practices/security#preventing-cross-site-scripting-xss`,m=class extends Error{code;constructor(t,n){super(gt$2(t,n)),this.code=t;}};function th(e){return `NG0${Math.abs(e)}`}function gt$2(e,t){return `${th(e)}${t?`: `+t:``}`}var de$2=globalThis;function A$1(e){for(let t in e)if(e[t]===A$1)return t;throw Error(``)}function Uc(e,t){for(let n in t)t.hasOwnProperty(n)&&!e.hasOwnProperty(n)&&(e[n]=t[n]);}function br(e){if(typeof e==`string`)return e;if(Array.isArray(e))return `[${e.map(br).join(`, `)}]`;if(e==null)return ``+e;let t=e.overriddenName||e.name;if(t)return `${t}`;let n=e.toString();if(n==null)return ``+n;let r=n.indexOf(`
@@ -32,14 +32,14 @@ var Ui={schedule(n,t){let e=setTimeout(n,t);return ()=>clearTimeout(e)}};functio
32
32
  `],encapsulation:3})};var ze=class n extends xe{item;data=g(Ye);dialogRef=g(W);ItemDetailLayout=$e$2;constructor(){super(),this.triggerContext=this.data.triggerContext,this.item=this.data.item;}close(){this.dialogRef.close();}engagementTriggerReceived(t){}update(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-item-quick-view`]],features:[Xf(lt()),za],decls:1,vars:2,consts:[[3,`closeClick`,`item`,`layout`]],template:function(e,i){e&1&&(Ka(0,`cooee-item-detail`,0),Sf(`closeClick`,function(){return i.close()}),Ja()),e&2&&yf(`item`,i.item)(`layout`,i.ItemDetailLayout.TWO_PANE);},dependencies:[ut],styles:[`:host{display:flex;align-items:center;justify-content:center;height:100%}@media(min-width:768px){cooee-item-detail{max-width:900px;max-height:80vh;border-radius:var(--lc-card-radius)}}
33
33
  `],encapsulation:3})};var Ue=class n{dialog=g(Ro);dialogRef;constructor(){}showItemQuickView(t,e){this.dialogRef=this.dialog.open(ze,{width:`100vw`,height:`100dvh`,backdropClass:[`letscooee-backdrop`],data:{item:e,triggerContext:t}});}static ɵfac=function(e){return new(e||n)};static ɵprov=C({token:n,factory:n.ɵfac,providedIn:`root`})};var uo=(n,t)=>({enter:n,exit:t});function fo(n,t){if(n&1&&(Ka(0,`div`,7),uv(1),Ja(),Ka(2,`div`,8),uv(3),Ja()),n&2){let e=kD(2);ud(),ic(` `,e.getCurrency(e.selectedVariant().price.cmp),` `),ud(2),ic(` `,e.getDiscountPercentage(e.selectedVariant().price),`% off `);}}function go(n,t){if(n&1&&(Ka(0,`div`,6),uv(1),Ja()),n&2){let e=kD(2);ud(),ic(` `,e.stickyATCConfig.leftText,` `);}}function ho(n,t){if(n&1&&(Ka(0,`div`,1)(1,`div`,5),uv(2),Ja(),vD(3,fo,4,2),vD(4,go,2,1,`div`,6),Ja()),n&2){let e=kD();ud(2),ic(` `,e.getCurrency(e.selectedVariant().price.d),` `),ud(),ED(e.selectedVariant().price.cmp?3:-1),ud(),ED(e.stickyATCConfig.leftText?4:-1);}}function vo(n,t){if(n&1&&(Ka(0,`div`,9),uv(1),Ja()),n&2){let e=t.$implicit,i=t.$index;kD(2);let r=hv(5);yf(`ngClass`,Cv(2,uo,i===r.currentIndex,i===r.previousIndex)),ud(),ic(` `,e,` `);}}function Co(n,t){if(n&1&&(Ka(0,`div`,4),wD(1,vo,2,5,`div`,9,ID),Ja()),n&2){kD();let e=hv(5);ud(),_D(e.features);}}var Qe=class n extends xe{currentItem;stickyATCConfig;selectedVariant=Mt$2(void 0);featureSlider=Mt$2({features:[],currentIndex:0});constructor(){super();}onVariantChange(t){this.currentItem&&(this.currentItem.setSelectedVariantByID(t.detail.variantID),this.selectedVariant.set(this.currentItem.selectedOrFirstVariant.value));}engagementTriggerReceived(t){this.stickyATCConfig=t.stickyATCConfig??{},this.currentItem=t.items[0],this.selectedVariant.set(this.currentItem.vars[0]),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation();}update(){}getCurrency(t){return Cr$1(t)}getDiscountPercentage(t){return ((t.cmp-t.d)/t.cmp*100).toFixed(0)}addToCart(){this.engagementService.executeCTA(He$3.ADD_TO_CART,{item:this.currentItem});}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let t=this.stickyATCConfig.rightText.split(`
34
34
  `),e=t.length===1?null:setInterval(()=>{this.featureSlider.update(i=>s(r({},i),{previousIndex:i.currentIndex,currentIndex:(i.currentIndex+1)%i.features.length}));},3e3);this.featureSlider.set({intervalRef:e,currentIndex:0,features:t});}replaceVariables(t){return t?qe$2(t,this.currentItem.getTemplateVariables(),this.triggerContext):``}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-sticky-atc`]],hostBindings:function(e,i){e&1&&Sf(`letscooee:variant-change`,function(s){return i.onVariantChange(s)},Jg);},features:[Xf(lt()),za],decls:7,vars:3,consts:[[1,`lc-wrapper`],[1,`lc-prices`],[1,`lc-button-wrapper`],[`type`,`button`,1,`lc-button`,`lc-button-atc`,3,`click`],[1,`lc-features`],[1,`lc-sale-price`],[1,`lc-additional-text`],[1,`lc-compare-price`],[1,`lc-discount-label`],[1,`lc-feature`,3,`ngClass`]],template:function(e,i){if(e&1&&(Ka(0,`div`,0),vD(1,ho,5,3,`div`,1),Ka(2,`div`,2)(3,`button`,3),Sf(`click`,function(){return i.addToCart()}),uv(4,`Add To Cart`),Ja(),Qf(5),vD(6,Co,3,0,`div`,4),Ja()()),e&2){ud(),ED(i.selectedVariant()&&i.stickyATCConfig.showProductInfo?1:-1),ud(4);let r=pv(i.featureSlider());ud(),ED(r.features.length?6:-1);}},dependencies:[wE],styles:[`:host{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media(min-width:768px){.lc-prices{gap:8px}}.lc-sale-price{font-size:24px;font-weight:600}.lc-compare-price{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label{font-size:12px;font-weight:500;color:green}.lc-button-wrapper{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button{background-color:#000;color:#fff;opacity:1;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text,.lc-feature{font-size:12px;color:#666}.lc-features{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features .lc-feature{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features .lc-feature.enter{opacity:1;transform:translateY(0);z-index:2}.lc-features .lc-feature.exit{opacity:0;transform:translateY(-100%);z-index:1}
35
- `],encapsulation:3})};var yo=[`videoEl`];async function vi(){return (await import('./video-detail-dialog.component-CX4_iSK--CHXmFUnS.js').then(function (n) { return n.v; })).VideoDetailDialogComponent}var me=class n extends xe{videoElements;videos;videoConfig;dialogRef=null;dialog=g(Ro);isMobile=M$3();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),vi();}ngAfterViewInit(){this.checkAndOpenVideoFromUrl();}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect();}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videos=this.videoConfig.videos;}onMuteToggled(t,e){t||this.videoElements.forEach(i=>{i.nativeElement!==e&&(i.nativeElement.muted=true,i.nativeElement.pause());});}sendTriggerClicked(t,e){this.sendEvent(`CE Trigger Clicked`,{},t,e);}async onVideoTap(t,e,i,r,s){t?.stopPropagation(),t?.preventDefault();let l=e.items?.[0];if(this.sendTriggerClicked(e,l),this.videoConfig.footerContent===`NONE`){r&&(r.muted=false,r.play(),this.onMuteToggled(false,r));return}await this.openDialog(e,i,s);}sendEvent(t,e,i,r){let s=new Ir$1(t,e,this.engagementTrigger);s.setVideos(i),r&&(s.items=[r.toEmbed()]),window.CooeeSDK.sendEvent(s);}onDialogClosed(){this.resumePlaylistVideos();}isVideoLoading(t){return this.videoLoadingStates.get(t)??true}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}playVideo(t){t.play().catch(e=>{Y$1.error(`Failed to play video:`,e);});}setupIntersectionObserver(t=.5,e=`50px`){this.intersectionObserver=new IntersectionObserver(i=>{i.forEach(r=>{let s=r.target,l=s.dataset.videoId;l&&(r.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(s,true)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(s,false)));});},{threshold:t,rootMargin:e}),setTimeout(()=>{this.videoElements.forEach(i=>{this.intersectionObserver?.observe(i.nativeElement);});},100);}handleVideoVisibilityChange(t,e){e?this.onVideoBecameVisible(t):t.pause();}onVideoBecameVisible(t){this.playVideo(t);}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(t=>{let e=t.nativeElement;e.paused||(this.pausedVideos.push(e),e.pause());});}resumePlaylistVideos(){this.pausedVideos.forEach(t=>{t.play().catch(()=>{});}),this.pausedVideos=[];}async checkAndOpenVideoFromUrl(){let t=We$3();if(!t||!this.videos)return;let e=Je$1();if(e.utm_campaign?.toLowerCase()!==`shoppable_video`||e.utm_source?.toLowerCase()!==Ae$2)return;let i=this.videos.findIndex(r=>r.shortID===+t);if(i!==-1){let r=this.videos[i];await fe$2.set(`muted`,true),await this.openDialog(r,i);}}async openDialog(t,e,i){await Vi$1();let r={videos:this.videos,currentIndex:e,triggerContext:this.triggerContext,selectedItem:i};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let s=await vi();this.dialogRef=this.dialog.open(s,{width:`100vw`,height:`100vh`,data:r,providers:bt(this.triggerContext,{video:t,index:e}),disableClose:true});let l={videoID:t.id,videoIndex:e};this.sendEvent(`CE Video Dialog Opened`,{current:l},t),this.dialogRef.closed.subscribe(c=>{if(this.dialogRef=null,!c)return;let f=c.lastVideoDuration*1e3,w={videoID:c.lastVideo.id,videoIndex:c.lastVideoIndex,playedTillMS:f,playedTillPercent:f/c.lastVideo.durationMS};this.sendEvent(`CE Video Dialog Closed`,{current:w},c.lastVideo),this.onDialogClosed();});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-abstract-video`]],viewQuery:function(e,i){if(e&1&&nc(yo,5),e&2){let r;Rf(r=xf())&&(i.videoElements=r);}},features:[za],decls:0,vars:0,template:function(e,i){},encapsulation:2})};var ue=class n{video=$b.required({alias:`cooeeVideoSources`});prioritySource=$b(`high`);elementRef=g(Se$1);constructor(){Es(()=>{this.updateSources();});}updateSources(){let t=this.elementRef.nativeElement,e=this.video(),i=this.prioritySource();t.querySelectorAll(`source`).forEach(s=>s.remove()),i===`best`?(this.addSource(e.bestSource),this.addSource(e.highSource),this.addSource(e.lowSource)):i===`low`?(this.addSource(e.lowSource),this.addSource(e.highSource),this.addSource(e.bestSource)):(this.addSource(e.highSource),this.addSource(e.bestSource),this.addSource(e.lowSource)),this.addSource(e.m3u8Source),t.load();}addSource(t){if(!t)return;let e=document.createElement(`source`);e.src=t.url,e.type=t.mimeType,this.elementRef.nativeElement.appendChild(e);}static ɵfac=function(e){return new(e||n)};static ɵdir=hn$1({type:n,selectors:[[`video`,`cooeeVideoSources`,``]],inputs:{video:[1,`cooeeVideoSources`,`video`],prioritySource:[1,`prioritySource`]}})};var _o=(n,t)=>t.id;function xo(n,t){if(n&1&&(Df(0,`div`,1),Iv(1,`safeHtml`)),n&2)yf(`innerHTML`,_v(1,1,kD().videoConfig.heading),Yg);}function bo(n,t){n&1&&(Ka(0,`div`,6),Df(1,`div`,12),Ja());}function wo(n,t){if(n&1){let e=ND();Ka(0,`cooee-mute-toggle`,13),Sf(`toggled`,function(r){fu(e),kD();let s=jD(6);return pu(kD().onMuteToggled(r,s))}),Ja();}if(n&2){kD();let e=jD(6);yf(`muted`,e.muted)(`videoEl`,e);}}function Vo(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,16),Sf(`cardClick`,function(r){fu(e);let s=kD(2),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onItemCardClick(r,l,c,f))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.items)(`centeredSlides`,false);}}function To(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-card`,17),Sf(`buttonClick`,function(){fu(e);let r=kD(2),s=r.$implicit,l=r.$index,c=jD(6);return pu(kD().addToCartClicked(null,s,l,c))})(`click`,function(){fu(e);let r=kD(2),s=r.$implicit,l=r.$index,c=jD(6),f=hv(0);return pu(kD().onItemCardClick(f,s,l,c))}),Ja();}if(n&2){kD(2);yf(`item`,hv(0));}}function Eo(n,t){if(n&1&&vD(0,Vo,1,2,`cooee-video-promoted-items`,14)(1,To,1,1,`cooee-item-card`,15),n&2){let e=kD().$implicit,i=kD();ED(hv(2)===i.VideoConfigFooterContent.ITEM_SWIPER&&e.items.length>1?0:e.items.length?1:-1);}}function So(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-card`,18),Sf(`linkClicked`,function(){fu(e);let r=kD().$implicit;return pu(kD().sendTriggerClicked(r))}),Ja();}if(n&2){kD();yf(`card`,hv(1));}}function Io(n,t){if(n&1){let e=ND();Qf(0)(1),Ka(2,`div`,4)(3,`div`,5),Sf(`click`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))})(`keydown.enter`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))})(`keydown.space`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))}),vD(4,bo,2,0,`div`,6),Ka(5,`video`,7,0),Sf(`mouseenter`,function(){fu(e);let r=jD(6);kD();return pu(hv(1)&&r.play())})(`mouseleave`,function(){fu(e);let r=jD(6);kD();return pu(hv(1)&&r.pause())})(`loadstart`,function(){let r=fu(e).$implicit;return pu(kD().onVideoLoadStart(r.id))})(`canplay`,function(){let r=fu(e).$implicit;return pu(kD().onVideoCanPlay(r.id))}),Ja(),Ka(7,`div`,8),vD(8,wo,1,2,`cooee-mute-toggle`,9),Ja()(),Ka(9,`div`,10),vD(10,Eo,2,1)(11,So,1,1,`cooee-video-card`,11),Ja()();}if(n&2){let e=t.$implicit,i=kD(),r=hv(0),s=hv(2);pv(e.items[0]),ud();let c=pv(e.card)&&s===i.VideoConfigFooterContent.CARD;ud(2),rc(`background-image`,e.thumbnail?`url(`+e.thumbnail+`)`:null),ud(),ED(i.isVideoLoading(e.id)?4:-1),ud(),yf(`cooeeVideoSources`,e)(`muted`,true),mf(`preload`,r?`metadata`:`none`)(`autoplay`,null)(`data-video-id`,e.id),ud(3),ED(i.videoConfig.showMuteButton?8:-1),ud(2),ED(i.videoConfig.showItems()?10:c?11:-1);}}var Ze=class n extends me{VideoConfigFooterContent=ye$3;VideoConfigAutoPlay=ge$3;swiperOptions=null;constructor(){super(),this.hasSwiper=true;}ngAfterViewInit(){super.ngAfterViewInit();let t=this.videoConfig.playlistConfig.videoSwiper,e=t?(this.isMobile?t.gapSm:t.gap)+`px`:window.cooeePlaylistGap??24,i=t?this.isMobile?t.maxInRowSm:t.maxInRow:`auto`;this.swiperOptions={direction:`horizontal`,effect:`slide`,loop:t?.loop,freeMode:true,spaceBetween:e,slidesPerView:i,mousewheel:{enabled:true,forceToAxis:true},autoplay:t?.autoplay?.enabled?{delay:t?.autoplay?.delay,disableOnInteraction:false}:false},this.setupIntersectionObserver(),this.playFirstVideo();}ngOnDestroy(){super.ngOnDestroy();}addToCartClicked(t,e,i,r){let s=e.items?.[0],l=he$2.get().website?.canChangeVariantInCart;if(e.items?.length>1||s?.hasVariants()&&!l){this.onItemCardClick(s,e,i,r);return}this.engagementService.executeCTA(He$3.ADD_TO_CART,{item:s,video:e});}goToPDP(t,e){t?.stopPropagation(),t?.preventDefault();let i=e.items?.[0];this.engagementService.executeCTA(He$3.GO_TO_PRODUCT,{item:i,video:e});}onItemCardClick(t,e,i,r){this.videoConfig.playlistConfig.itemCardClickBehavior===`OPEN_ITEM_DETAIL`?this.onVideoTap(null,e,i,r,t):this.onVideoTap(null,e,i,r);}update(){}onVideoBecameVisible(t){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(t):this.playVideo(t));}shouldAutoPlay(){return this.videoConfig.autoPlay===`ON`||this.videoConfig.autoPlay===`ON_HOVER`&&this.isMobile}playFirstVideo(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-playlist`]],features:[Xf(lt()),za],decls:8,vars:7,consts:[[`videoEl`,``],[1,`heading-text`,3,`innerHTML`],[3,`options`,`navigationConfig`,`paginationConfig`],[`ngProjectAs`,`swiper-slides`,5,[`swiper-slides`]],[1,`swiper-slide`,`video-card`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Play video`,`aria-haspopup`,`dialog`,1,`video-wrapper`,3,`click`,`keydown.enter`,`keydown.space`],[1,`video-loading-overlay`],[`width`,`100%`,`playsinline`,``,`loop`,``,3,`mouseenter`,`mouseleave`,`loadstart`,`canplay`,`cooeeVideoSources`,`muted`],[1,`video-controls`],[3,`muted`,`videoEl`],[`role`,`region`,`aria-label`,`Video details`,1,`video-footer`],[3,`card`],[1,`loading-spinner`],[3,`toggled`,`muted`,`videoEl`],[3,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`item`],[3,`cardClick`,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`buttonClick`,`click`,`item`],[3,`linkClicked`,`card`]],template:function(e,i){if(e&1&&(Qf(0)(1)(2),vD(3,xo,2,3,`div`,1),Ka(4,`cooee-swiper`,2),ec(5,3),wD(6,Io,12,12,`div`,4,_o),Ho(),Ja()),e&2){pv(!i.videoConfig.autoPlay||i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON),ud(),pv(i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON_HOVER),ud(),pv(i.videoConfig.footerContent),ud(),ED(i.videoConfig.heading?3:-1);let r=i.videoConfig.playlistConfig.videoSwiper;ud(),yf(`options`,i.swiperOptions)(`navigationConfig`,r==null?null:r.navigation)(`paginationConfig`,r==null?null:r.pagination),ud(2),_D(i.videos);}},dependencies:[ft,mt,pt,re,ue,ht,a],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media(max-width:768px),(prefers-reduced-motion:reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}.video-footer{overflow-x:hidden}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
35
+ `],encapsulation:3})};var yo=[`videoEl`];async function vi(){return (await import('./video-detail-dialog.component-WEu7uD-2-C1gedzcS.js').then(function (n) { return n.v; })).VideoDetailDialogComponent}var me=class n extends xe{videoElements;videos;videoConfig;dialogRef=null;dialog=g(Ro);isMobile=M$3();pausedVideos=[];videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),vi();}ngAfterViewInit(){this.checkAndOpenVideoFromUrl();}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect();}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videos=this.videoConfig.videos;}onMuteToggled(t,e){t||this.videoElements.forEach(i=>{i.nativeElement!==e&&(i.nativeElement.muted=true,i.nativeElement.pause());});}sendTriggerClicked(t,e){this.sendEvent(`CE Trigger Clicked`,{},t,e);}async onVideoTap(t,e,i,r,s){t?.stopPropagation(),t?.preventDefault();let l=e.items?.[0];if(this.sendTriggerClicked(e,l),this.videoConfig.footerContent===`NONE`){r&&(r.muted=false,r.play(),this.onMuteToggled(false,r));return}await this.openDialog(e,i,s);}sendEvent(t,e,i,r){let s=new Ir$1(t,e,this.engagementTrigger);s.setVideos(i),r&&(s.items=[r.toEmbed()]),window.CooeeSDK.sendEvent(s);}onDialogClosed(){this.resumePlaylistVideos();}isVideoLoading(t){return this.videoLoadingStates.get(t)??true}onVideoLoadStart(t){this.videoLoadingStates.set(t,true);}onVideoCanPlay(t){this.videoLoadingStates.set(t,false);}playVideo(t){t.play().catch(e=>{Y$1.error(`Failed to play video:`,e);});}setupIntersectionObserver(t=.5,e=`50px`){this.intersectionObserver=new IntersectionObserver(i=>{i.forEach(r=>{let s=r.target,l=s.dataset.videoId;l&&(r.isIntersecting?(this.visibleVideos.add(l),this.handleVideoVisibilityChange(s,true)):(this.visibleVideos.delete(l),this.handleVideoVisibilityChange(s,false)));});},{threshold:t,rootMargin:e}),setTimeout(()=>{this.videoElements.forEach(i=>{this.intersectionObserver?.observe(i.nativeElement);});},100);}handleVideoVisibilityChange(t,e){e?this.onVideoBecameVisible(t):t.pause();}onVideoBecameVisible(t){this.playVideo(t);}pauseAllPlaylistVideos(){this.pausedVideos=[],this.videoElements.forEach(t=>{let e=t.nativeElement;e.paused||(this.pausedVideos.push(e),e.pause());});}resumePlaylistVideos(){this.pausedVideos.forEach(t=>{t.play().catch(()=>{});}),this.pausedVideos=[];}async checkAndOpenVideoFromUrl(){let t=We$3();if(!t||!this.videos)return;let e=Je$1();if(e.utm_campaign?.toLowerCase()!==`shoppable_video`||e.utm_source?.toLowerCase()!==Ae$2)return;let i=this.videos.findIndex(r=>r.shortID===+t);if(i!==-1){let r=this.videos[i];await fe$2.set(`muted`,true),await this.openDialog(r,i);}}async openDialog(t,e,i){await Vi$1();let r={videos:this.videos,currentIndex:e,triggerContext:this.triggerContext,selectedItem:i};this.dialogRef&&this.dialogRef.close(),this.pauseAllPlaylistVideos();let s=await vi();this.dialogRef=this.dialog.open(s,{width:`100vw`,height:`100vh`,data:r,providers:bt(this.triggerContext,{video:t,index:e}),disableClose:true});let l={videoID:t.id,videoIndex:e};this.sendEvent(`CE Video Dialog Opened`,{current:l},t),this.dialogRef.closed.subscribe(c=>{if(this.dialogRef=null,!c)return;let f=c.lastVideoDuration*1e3,w={videoID:c.lastVideo.id,videoIndex:c.lastVideoIndex,playedTillMS:f,playedTillPercent:f/c.lastVideo.durationMS};this.sendEvent(`CE Video Dialog Closed`,{current:w},c.lastVideo),this.onDialogClosed();});}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-abstract-video`]],viewQuery:function(e,i){if(e&1&&nc(yo,5),e&2){let r;Rf(r=xf())&&(i.videoElements=r);}},features:[za],decls:0,vars:0,template:function(e,i){},encapsulation:2})};var ue=class n{video=$b.required({alias:`cooeeVideoSources`});prioritySource=$b(`high`);elementRef=g(Se$1);constructor(){Es(()=>{this.updateSources();});}updateSources(){let t=this.elementRef.nativeElement,e=this.video(),i=this.prioritySource();t.querySelectorAll(`source`).forEach(s=>s.remove()),i===`best`?(this.addSource(e.bestSource),this.addSource(e.highSource),this.addSource(e.lowSource)):i===`low`?(this.addSource(e.lowSource),this.addSource(e.highSource),this.addSource(e.bestSource)):(this.addSource(e.highSource),this.addSource(e.bestSource),this.addSource(e.lowSource)),this.addSource(e.m3u8Source),t.load();}addSource(t){if(!t)return;let e=document.createElement(`source`);e.src=t.url,e.type=t.mimeType,this.elementRef.nativeElement.appendChild(e);}static ɵfac=function(e){return new(e||n)};static ɵdir=hn$1({type:n,selectors:[[`video`,`cooeeVideoSources`,``]],inputs:{video:[1,`cooeeVideoSources`,`video`],prioritySource:[1,`prioritySource`]}})};var _o=(n,t)=>t.id;function xo(n,t){if(n&1&&(Df(0,`div`,1),Iv(1,`safeHtml`)),n&2)yf(`innerHTML`,_v(1,1,kD().videoConfig.heading),Yg);}function bo(n,t){n&1&&(Ka(0,`div`,6),Df(1,`div`,12),Ja());}function wo(n,t){if(n&1){let e=ND();Ka(0,`cooee-mute-toggle`,13),Sf(`toggled`,function(r){fu(e),kD();let s=jD(6);return pu(kD().onMuteToggled(r,s))}),Ja();}if(n&2){kD();let e=jD(6);yf(`muted`,e.muted)(`videoEl`,e);}}function Vo(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-promoted-items`,16),Sf(`cardClick`,function(r){fu(e);let s=kD(2),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onItemCardClick(r,l,c,f))}),Ja();}if(n&2){let e=kD(2).$implicit;yf(`items`,e.items)(`centeredSlides`,false);}}function To(n,t){if(n&1){let e=ND();Ka(0,`cooee-item-card`,17),Sf(`buttonClick`,function(){fu(e);let r=kD(2),s=r.$implicit,l=r.$index,c=jD(6);return pu(kD().addToCartClicked(null,s,l,c))})(`click`,function(){fu(e);let r=kD(2),s=r.$implicit,l=r.$index,c=jD(6),f=hv(0);return pu(kD().onItemCardClick(f,s,l,c))}),Ja();}if(n&2){kD(2);yf(`item`,hv(0));}}function Eo(n,t){if(n&1&&vD(0,Vo,1,2,`cooee-video-promoted-items`,14)(1,To,1,1,`cooee-item-card`,15),n&2){let e=kD().$implicit,i=kD();ED(hv(2)===i.VideoConfigFooterContent.ITEM_SWIPER&&e.items.length>1?0:e.items.length?1:-1);}}function So(n,t){if(n&1){let e=ND();Ka(0,`cooee-video-card`,18),Sf(`linkClicked`,function(){fu(e);let r=kD().$implicit;return pu(kD().sendTriggerClicked(r))}),Ja();}if(n&2){kD();yf(`card`,hv(1));}}function Io(n,t){if(n&1){let e=ND();Qf(0)(1),Ka(2,`div`,4)(3,`div`,5),Sf(`click`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))})(`keydown.enter`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))})(`keydown.space`,function(r){let s=fu(e),l=s.$implicit,c=s.$index,f=jD(6);return pu(kD().onVideoTap(r,l,c,f))}),vD(4,bo,2,0,`div`,6),Ka(5,`video`,7,0),Sf(`mouseenter`,function(){fu(e);let r=jD(6);kD();return pu(hv(1)&&r.play())})(`mouseleave`,function(){fu(e);let r=jD(6);kD();return pu(hv(1)&&r.pause())})(`loadstart`,function(){let r=fu(e).$implicit;return pu(kD().onVideoLoadStart(r.id))})(`canplay`,function(){let r=fu(e).$implicit;return pu(kD().onVideoCanPlay(r.id))}),Ja(),Ka(7,`div`,8),vD(8,wo,1,2,`cooee-mute-toggle`,9),Ja()(),Ka(9,`div`,10),vD(10,Eo,2,1)(11,So,1,1,`cooee-video-card`,11),Ja()();}if(n&2){let e=t.$implicit,i=kD(),r=hv(0),s=hv(2);pv(e.items[0]),ud();let c=pv(e.card)&&s===i.VideoConfigFooterContent.CARD;ud(2),rc(`background-image`,e.thumbnail?`url(`+e.thumbnail+`)`:null),ud(),ED(i.isVideoLoading(e.id)?4:-1),ud(),yf(`cooeeVideoSources`,e)(`muted`,true),mf(`preload`,r?`metadata`:`none`)(`autoplay`,null)(`data-video-id`,e.id),ud(3),ED(i.videoConfig.showMuteButton?8:-1),ud(2),ED(i.videoConfig.showItems()?10:c?11:-1);}}var Ze=class n extends me{VideoConfigFooterContent=ye$3;VideoConfigAutoPlay=ge$3;swiperOptions=null;constructor(){super(),this.hasSwiper=true;}ngAfterViewInit(){super.ngAfterViewInit();let t=this.videoConfig.playlistConfig.videoSwiper,e=t?(this.isMobile?t.gapSm:t.gap)+`px`:window.cooeePlaylistGap??24,i=t?this.isMobile?t.maxInRowSm:t.maxInRow:`auto`;this.swiperOptions={direction:`horizontal`,effect:`slide`,loop:t?.loop,freeMode:true,spaceBetween:e,slidesPerView:i,mousewheel:{enabled:true,forceToAxis:true},autoplay:t?.autoplay?.enabled?{delay:t?.autoplay?.delay,disableOnInteraction:false}:false},this.setupIntersectionObserver(),this.playFirstVideo();}ngOnDestroy(){super.ngOnDestroy();}addToCartClicked(t,e,i,r){let s=e.items?.[0],l=he$2.get().website?.canChangeVariantInCart;if(e.items?.length>1||s?.hasVariants()&&!l){this.onItemCardClick(s,e,i,r);return}this.engagementService.executeCTA(He$3.ADD_TO_CART,{item:s,video:e});}goToPDP(t,e){t?.stopPropagation(),t?.preventDefault();let i=e.items?.[0];this.engagementService.executeCTA(He$3.GO_TO_PRODUCT,{item:i,video:e});}onItemCardClick(t,e,i,r){this.videoConfig.playlistConfig.itemCardClickBehavior===`OPEN_ITEM_DETAIL`?this.onVideoTap(null,e,i,r,t):this.onVideoTap(null,e,i,r);}update(){}onVideoBecameVisible(t){this.shouldAutoPlay()&&(this.dialogRef?this.pausedVideos.push(t):this.playVideo(t));}shouldAutoPlay(){return this.videoConfig.autoPlay===`ON`||this.videoConfig.autoPlay===`ON_HOVER`&&this.isMobile}playFirstVideo(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-playlist`]],features:[Xf(lt()),za],decls:8,vars:7,consts:[[`videoEl`,``],[1,`heading-text`,3,`innerHTML`],[3,`options`,`navigationConfig`,`paginationConfig`],[`ngProjectAs`,`swiper-slides`,5,[`swiper-slides`]],[1,`swiper-slide`,`video-card`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Play video`,`aria-haspopup`,`dialog`,1,`video-wrapper`,3,`click`,`keydown.enter`,`keydown.space`],[1,`video-loading-overlay`],[`width`,`100%`,`playsinline`,``,`loop`,``,3,`mouseenter`,`mouseleave`,`loadstart`,`canplay`,`cooeeVideoSources`,`muted`],[1,`video-controls`],[3,`muted`,`videoEl`],[`role`,`region`,`aria-label`,`Video details`,1,`video-footer`],[3,`card`],[1,`loading-spinner`],[3,`toggled`,`muted`,`videoEl`],[3,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`item`],[3,`cardClick`,`items`,`centeredSlides`],[`role`,`button`,`tabindex`,`0`,`aria-label`,`Product detail`,3,`buttonClick`,`click`,`item`],[3,`linkClicked`,`card`]],template:function(e,i){if(e&1&&(Qf(0)(1)(2),vD(3,xo,2,3,`div`,1),Ka(4,`cooee-swiper`,2),ec(5,3),wD(6,Io,12,12,`div`,4,_o),Ho(),Ja()),e&2){pv(!i.videoConfig.autoPlay||i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON),ud(),pv(i.videoConfig.autoPlay===i.VideoConfigAutoPlay.ON_HOVER),ud(),pv(i.videoConfig.footerContent),ud(),ED(i.videoConfig.heading?3:-1);let r=i.videoConfig.playlistConfig.videoSwiper;ud(),yf(`options`,i.swiperOptions)(`navigationConfig`,r==null?null:r.navigation)(`paginationConfig`,r==null?null:r.pagination),ud(2),_D(i.videos);}},dependencies:[ft,mt,pt,re,ue,ht,a],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media(max-width:768px),(prefers-reduced-motion:reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}.video-footer{overflow-x:hidden}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-detail-button{display:none!important}cooee-item-card .item-info{font-size:14px;line-height:normal;margin-right:unset!important}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
36
36
  `],encapsulation:3})};var Mo=[`videoElement`],ko=n=>({"cursor-grab":n}),We=class n extends me{videoElement;video;isDragging=false;hidden=false;cdkDrag=g(ge$1,{self:true});untilDestroyed=dt();constructor(){super();}get popupClasses(){return this.hidden?[`hidden`]:[`visible`]}onClick(t){t.stopPropagation(),t.preventDefault(),this.onVideoClick();}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.closest(`.letscooee-engagement`);t&&(t.style.zIndex=`10000`),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=true);}ngAfterViewInit(){super.ngAfterViewInit(),setTimeout(()=>{this.autoPlay();},100);}onVideoClick(){if(this.isDragging){this.isDragging=false;return}this.hidden=true,this.onVideoTap(null,this.video,0);}close(){this.hidden=true;let t=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent(`CE Trigger Closed`,{duration:t});}engagementTriggerReceived(t){super.engagementTriggerReceived(t),this.video=this.videos[0];}update(){}onDialogClosed(){this.hidden=false;}autoPlay(){let t=this.videoElement.nativeElement;this.hidden||this.playVideo(t);}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-popup`]],viewQuery:function(e,i){if(e&1&&nc(Mo,5),e&2){let r;Rf(r=xf())&&(i.videoElement=r.first);}},hostAttrs:[`role`,`button`,`tabindex`,`0`,`aria-label`,`Open video popup `,`cdkDragBoundary`,`body`],hostVars:2,hostBindings:function(e,i){e&1&&Sf(`keydown.enter`,function(s){return i.onClick(s)})(`keydown.space`,function(s){return i.onClick(s)})(`click`,function(s){return i.onClick(s)}),e&2&&XD(i.popupClasses);},features:[Xf(lt()),iD([{directive:ge$1,inputs:[`cdkDragBoundary`,`cdkDragBoundary`]}]),za],decls:9,vars:5,consts:[[`videoElement`,``],[1,`popup-inner`,3,`ngClass`],[`type`,`button`,`aria-label`,`Close video popup`,1,`close-button`,3,`click`],[`name`,`close`,`aria-hidden`,`true`],[1,`play-button`],[`name`,`unmute`,`aria-hidden`,`true`],[1,`text`],[`loop`,``,`preload`,`metadata`,`playsinline`,``,3,`muted`,`cooeeVideoSources`]],template:function(e,i){if(e&1){let r=ND();Ka(0,`div`,1)(1,`button`,2),Sf(`click`,function(l){return fu(r),l.stopPropagation(),pu(i.close())}),Df(2,`cooee-icon`,3),Ja(),Ka(3,`div`,4),Df(4,`cooee-icon`,5),Ka(5,`div`,6),uv(6,`Tap to unmute`),Ja()(),Df(7,`video`,7,0),Ja();}e&2&&(yf(`ngClass`,Ev(3,ko,i.isDragging)),ud(7),yf(`muted`,true)(`cooeeVideoSources`,i.video));},dependencies:[wE,ye,ue],styles:[`:host{position:fixed;display:block;right:24px;bottom:24px;min-height:150px;max-width:150px;box-shadow:0 25px 50px -12px #00000040}:host(.hidden){display:none}.popup-inner{display:flex;justify-content:center;align-items:center;position:relative}video{width:100%;border-radius:8px;background-color:#fff}.close-button{position:absolute;top:-14px;right:-14px;background-color:#00000080;border-radius:9999px;width:32px;height:32px;border:none;z-index:10;display:flex;justify-content:center;align-items:center}.play-button{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.play-button cooee-icon{width:14px;height:14px}.play-button .text{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}
37
37
  `],encapsulation:3})};var Po=(n,t)=>t.id;function Fo(n,t){if(n&1&&(Df(0,`div`,1),Iv(1,`safeHtml`)),n&2)yf(`innerHTML`,_v(1,1,kD().videoConfig.heading),Yg);}function Do(n,t){n&1&&(Ka(0,`div`,9),Df(1,`div`,11),Ja());}function Ao(n,t){if(n&1){let e=ND();Ka(0,`div`,4),Sf(`click`,function(r){let s=fu(e),l=s.$implicit,c=s.$index;return pu(kD().onVideoTap(r,l,c))})(`keydown.enter`,function(r){let s=fu(e),l=s.$implicit,c=s.$index;return pu(kD().onVideoTap(r,l,c))})(`keydown.space`,function(r){let s=fu(e),l=s.$implicit,c=s.$index;return pu(kD().onVideoTap(r,l,c))}),_u(),Ka(1,`svg`,5),Df(2,`circle`,6)(3,`circle`,7),Ja(),Tu(),Ka(4,`div`,8),vD(5,Do,2,0,`div`,9),Ka(6,`video`,10,0),Sf(`loadstart`,function(){let r=fu(e).$implicit;return pu(kD().onVideoLoadStart(r.id))})(`canplay`,function(){let r=fu(e).$implicit;return pu(kD().onVideoCanPlay(r.id))}),Ja()()();}if(n&2){let e=t.$implicit,i=t.$index,r=kD();mf(`aria-label`,`Open video story `+(i+1)),ud(5),ED(r.isVideoLoading(e.id)?5:-1),ud(),yf(`poster`,e.thumbnail)(`cooeeVideoSources`,e)(`prioritySource`,`low`)(`muted`,true),mf(`data-video-id`,e.id);}}var qe=class n extends me{constructor(){super();}ngAfterViewInit(){super.ngAfterViewInit(),this.setupIntersectionObserver();}ngOnDestroy(){super.ngOnDestroy();}update(){}static ɵfac=function(e){return new(e||n)};static ɵcmp=of({type:n,selectors:[[`cooee-video-stories`]],features:[Xf(lt()),za],decls:4,vars:1,consts:[[`videoEl`,``],[1,`heading-text`,3,`innerHTML`],[1,`video-stories`],[`role`,`button`,`tabindex`,`0`,1,`video-story`],[`role`,`button`,`tabindex`,`0`,1,`video-story`,3,`click`,`keydown.enter`,`keydown.space`],[`viewBox`,`0 0 100 100`],[`cx`,`50`,`cy`,`50`,`r`,`48`,`fill`,`none`,`stroke-width`,`4`],[`cx`,`50`,`cy`,`50`,`r`,`48`,`fill`,`none`,`stroke-width`,`4`,`stroke-linecap`,`round`,`stroke-dasharray`,`301.6`,`stroke-dashoffset`,`301.6`,1,`video-story-circle`],[1,`video-wrapper`],[1,`video-loading-overlay`],[`loop`,``,`playsinline`,``,`preload`,`metadata`,3,`loadstart`,`canplay`,`poster`,`cooeeVideoSources`,`prioritySource`,`muted`],[1,`loading-spinner`]],template:function(e,i){e&1&&(vD(0,Fo,2,3,`div`,1),Ka(1,`div`,2),wD(2,Ao,8,7,`div`,3,Po),Ja()),e&2&&(ED(i.videoConfig.heading?0:-1),ud(2),_D(i.videos));},dependencies:[ue,a],styles:[`:host{display:block}.video-stories{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.video-stories::-webkit-scrollbar{display:none}@media(max-width:768px){.video-stories{justify-content:start!important}}.video-story{position:relative;width:5rem;height:5rem;cursor:pointer;flex-shrink:0}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{position:relative;width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px;position:relative;z-index:1}.video-story .video-wrapper .video-loading-overlay{border-radius:9999px}
38
- `],encapsulation:3})};async function Ba(){let n=await $E(fi),t=(e,i)=>{let r=ui(e,{injector:n.injector});customElements.define(i,r);};t(Qe,`cooee-sticky-atc`),t($e,`cooee-savings-bar`),t(je,`cooee-progressbar`),t(Ze,`cooee-video-playlist`),t(We,`cooee-video-popup`),t(qe,`cooee-video-stories`),t(Ve,`cooee-product-options-picker`),t(Be,`cooee-collection-filter`),sessionStorage.cooeeDebug&&import('./debugger.component-D-8HGaxr-rhz7Y3ND.js').then(e=>{t(e.DebuggerComponent,`cooee-debugger`);}),window.cooeeShowQuickItem=(e,i)=>{n.injector.get(Ue).showItemQuickView(e,i);};}
38
+ `],encapsulation:3})};async function Ba(){let n=await $E(fi),t=(e,i)=>{let r=ui(e,{injector:n.injector});customElements.define(i,r);};t(Qe,`cooee-sticky-atc`),t($e,`cooee-savings-bar`),t(je,`cooee-progressbar`),t(Ze,`cooee-video-playlist`),t(We,`cooee-video-popup`),t(qe,`cooee-video-stories`),t(Ve,`cooee-product-options-picker`),t(Be,`cooee-collection-filter`),sessionStorage.cooeeDebug&&import('./debugger.component-Bx8Y-QmH-BpUp6S0M.js').then(e=>{t(e.DebuggerComponent,`cooee-debugger`);}),window.cooeeShowQuickItem=(e,i)=>{n.injector.get(Ue).showItemQuickView(e,i);};}
39
39
 
40
- var widgetsD_OSh97N = /*#__PURE__*/Object.freeze({
40
+ var widgetsBIWIerG5 = /*#__PURE__*/Object.freeze({
41
41
  __proto__: null,
42
42
  loadAngularWidgets: Ba
43
43
  });
44
44
 
45
- export { $b as $, lf as A, Bo as B, jD as C, Df as D, yf as E, nc as F, Ge as G, Ho as H, ID as I, Ja as J, Ke as K, xf as L, Mf as M, Hb as N, Ro as O, Ft$2 as P, Es as Q, Rf as R, Sf as S, Tv as T, rc as U, Vo$1 as V, Wf as W, Xa as X, Yg as Y, mf as Z, _D as _, a, ND as a0, vD as a1, fu as a2, pu as a3, kD as a4, ED as a5, Ef as a6, gv as a7, Zf as a8, qf as a9, fv as aa, Sv as ab, Kg as ac, widgetsD_OSh97N as ad, bE as b, ud as c, Iv as d, _f as e, _v as f, ge$1 as g, g as h, iD as i, W as j, Ka as k, Mt$2 as l, Ye as m, Se$1 as n, of as o, ht as p, ut as q, ft as r, TE as s, wE as t, uv as u, mt as v, wD as w, pt as x, ye as y, ec as z };
45
+ export { $b as $, lf as A, Bo as B, jD as C, Df as D, yf as E, nc as F, Ge as G, Ho as H, ID as I, Ja as J, Ke as K, xf as L, Mf as M, Hb as N, Ro as O, Ft$2 as P, Es as Q, Rf as R, Sf as S, Tv as T, rc as U, Vo$1 as V, Wf as W, Xa as X, Yg as Y, mf as Z, _D as _, a, ND as a0, vD as a1, fu as a2, pu as a3, kD as a4, ED as a5, Ef as a6, gv as a7, Zf as a8, qf as a9, fv as aa, Sv as ab, Kg as ac, widgetsBIWIerG5 as ad, bE as b, ud as c, Iv as d, _f as e, _v as f, ge$1 as g, g as h, iD as i, W as j, Ka as k, Mt$2 as l, Ye as m, Se$1 as n, of as o, ht as p, ut as q, ft as r, TE as s, wE as t, uv as u, mt as v, wD as w, pt as x, ye as y, ec as z };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@letscooee/web-sdk",
3
3
  "description": "Engage uniquely and boost conversions with AI-powered customer journeys driven by real-time intent",
4
- "version": "14.0.5",
4
+ "version": "14.1.0",
5
5
  "scripts": {
6
6
  "lint": "ng lint",
7
7
  "integrity": "./scripts/validate-integrity.sh",