@letscooee/web-sdk 9.13.0 → 9.13.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/main.min.js +3 -3
- package/dist/widget.min.js +2 -2
- package/package.json +1 -1
package/dist/widget.min.js
CHANGED
|
@@ -7,7 +7,7 @@ import{$ as $i,$a as ks,A as Rl,Aa as Y,B as Et,Ba as Ee,C as zn,Ca as Ls,D as n
|
|
|
7
7
|
|
|
8
8
|
`+y.message+`
|
|
9
9
|
`+Array(y.message.length+1).join("=")+`
|
|
10
|
-
`+N(A,P)):y}}function gt(A,x){var F;return x.cache&&x.name&&x.storage.templates.get(x.name)?x.storage.templates.get(x.name):(F=typeof A=="function"?A:Ye(A,x),x.cache&&x.name&&x.storage.templates.define(x.name,F),F)}Le.l.bind(Le),t.compile=Ye,t.compileScope=se,t.compileScopeIntoFunction=K,t.compileToString=N,t.defaultConfig=Le,t.filters=De,t.getConfig=Ge,t.helpers=ye,t.nativeHelpers=ke,t.parse=w,t.render=function(A,x,F,P){var v=Ge(F||{});if(!v.async)return gt(A,v)(x,v);if(!P){if(typeof r=="function")return new r(function(y,H){try{y(gt(A,v)(x,v))}catch(J){H(J)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{gt(A,v)(x,v,P)}catch(y){return P(y)}},t.templates=te,Object.defineProperty(t,"__esModule",{value:!0})})});var of=Is((rf,ac)=>{"use strict";(function(t){if(typeof rf=="object"&&typeof ac<"u")ac.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,n;return function r(i,o,s){function a(g,p){if(!o[g]){if(!i[g]){var E=typeof ei=="function"&&ei;if(!p&&E)return E(g,!0);if(u)return u(g,!0);var w=new Error("Cannot find module '"+g+"'");throw w.code="MODULE_NOT_FOUND",w}var N=o[g]={exports:{}};i[g][0].call(N.exports,function(M){var L=i[g][1][M];return a(L||M)},N,N.exports,r,i,o,s)}return o[g].exports}for(var u=typeof ei=="function"&&ei,d=0;d<s.length;d++)a(s[d]);return a}({1:[function(r,i,o){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,u;if(a){var d=0,g=new a(M),p=s.document.createTextNode("");g.observe(p,{characterData:!0}),u=function(){p.data=d=++d%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var E=new s.MessageChannel;E.port1.onmessage=M,u=function(){E.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?u=function(){var j=s.document.createElement("script");j.onreadystatechange=function(){M(),j.onreadystatechange=null,j.parentNode.removeChild(j),j=null},s.document.documentElement.appendChild(j)}:u=function(){setTimeout(M,0)};var w,N=[];function M(){w=!0;for(var j,K,se=N.length;se;){for(K=N,N=[],j=-1;++j<se;)K[j]();se=N.length}w=!1}i.exports=L;function L(j){N.push(j)===1&&!w&&u()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,i,o){"use strict";var s=r(1);function a(){}var u={},d=["REJECTED"],g=["FULFILLED"],p=["PENDING"];i.exports=E;function E(U){if(typeof U!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,U!==a&&L(this,U)}E.prototype.catch=function(U){return this.then(null,U)},E.prototype.then=function(U,he){if(typeof U!="function"&&this.state===g||typeof he!="function"&&this.state===d)return this;var te=new this.constructor(a);if(this.state!==p){var ye=this.state===g?U:he;N(te,ye,this.outcome)}else this.queue.push(new w(te,U,he));return te};function w(U,he,te){this.promise=U,typeof he=="function"&&(this.onFulfilled=he,this.callFulfilled=this.otherCallFulfilled),typeof te=="function"&&(this.onRejected=te,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(U){u.resolve(this.promise,U)},w.prototype.otherCallFulfilled=function(U){N(this.promise,this.onFulfilled,U)},w.prototype.callRejected=function(U){u.reject(this.promise,U)},w.prototype.otherCallRejected=function(U){N(this.promise,this.onRejected,U)};function N(U,he,te){s(function(){var ye;try{ye=he(te)}catch(ke){return u.reject(U,ke)}ye===U?u.reject(U,new TypeError("Cannot resolve promise with itself")):u.resolve(U,ye)})}u.resolve=function(U,he){var te=j(M,he);if(te.status==="error")return u.reject(U,te.value);var ye=te.value;if(ye)L(U,ye);else{U.state=g,U.outcome=he;for(var ke=-1,De=U.queue.length;++ke<De;)U.queue[ke].callFulfilled(he)}return U},u.reject=function(U,he){U.state=d,U.outcome=he;for(var te=-1,ye=U.queue.length;++te<ye;)U.queue[te].callRejected(he);return U};function M(U){var he=U&&U.then;if(U&&(typeof U=="object"||typeof U=="function")&&typeof he=="function")return function(){he.apply(U,arguments)}}function L(U,he){var te=!1;function ye(Ge){te||(te=!0,u.reject(U,Ge))}function ke(Ge){te||(te=!0,u.resolve(U,Ge))}function De(){he(ke,ye)}var Le=j(De);Le.status==="error"&&ye(Le.value)}function j(U,he){var te={};try{te.value=U(he),te.status="success"}catch(ye){te.status="error",te.value=ye}return te}E.resolve=K;function K(U){return U instanceof this?U:u.resolve(new this(a),U)}E.reject=se;function se(U){var he=new this(a);return u.reject(he,U)}E.all=X;function X(U){var he=this;if(Object.prototype.toString.call(U)!=="[object Array]")return this.reject(new TypeError("must be an array"));var te=U.length,ye=!1;if(!te)return this.resolve([]);for(var ke=new Array(te),De=0,Le=-1,Ge=new this(a);++Le<te;)Ye(U[Le],Le);return Ge;function Ye(gt,A){he.resolve(gt).then(x,function(F){ye||(ye=!0,u.reject(Ge,F))});function x(F){ke[A]=F,++De===te&&!ye&&(ye=!0,u.resolve(Ge,ke))}}}E.race=be;function be(U){var he=this;if(Object.prototype.toString.call(U)!=="[object Array]")return this.reject(new TypeError("must be an array"));var te=U.length,ye=!1;if(!te)return this.resolve([]);for(var ke=-1,De=new this(a);++ke<te;)Le(U[ke]);return De;function Le(Ge){he.resolve(Ge).then(function(Ye){ye||(ye=!0,u.resolve(De,Ye))},function(Ye){ye||(ye=!0,u.reject(De,Ye))})}}},{1:1}],3:[function(r,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f};function a(f,b){if(!(f instanceof b))throw new TypeError("Cannot call a class as a function")}function u(){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 d=u();function g(){try{if(!d||!d.open)return!1;var f=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),b=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!f||b)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function p(f,b){f=f||[],b=b||{};try{return new Blob(f,b)}catch(C){if(C.name!=="TypeError")throw C;for(var m=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,S=new m,I=0;I<f.length;I+=1)S.append(f[I]);return S.getBlob(b.type)}}typeof Promise>"u"&&r(3);var E=Promise;function w(f,b){b&&f.then(function(m){b(null,m)},function(m){b(m)})}function N(f,b,m){typeof b=="function"&&f.then(b),typeof m=="function"&&f.catch(m)}function M(f){return typeof f!="string"&&(console.warn(f+" used as a key, but it is not a string."),f=String(f)),f}function L(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var j="local-forage-detect-blob-support",K=void 0,se={},X=Object.prototype.toString,be="readonly",U="readwrite";function he(f){for(var b=f.length,m=new ArrayBuffer(b),S=new Uint8Array(m),I=0;I<b;I++)S[I]=f.charCodeAt(I);return m}function te(f){return new E(function(b){var m=f.transaction(j,U),S=p([""]);m.objectStore(j).put(S,"key"),m.onabort=function(I){I.preventDefault(),I.stopPropagation(),b(!1)},m.oncomplete=function(){var I=navigator.userAgent.match(/Chrome\/(\d+)/),C=navigator.userAgent.match(/Edge\//);b(C||!I||parseInt(I[1],10)>=43)}}).catch(function(){return!1})}function ye(f){return typeof K=="boolean"?E.resolve(K):te(f).then(function(b){return K=b,K})}function ke(f){var b=se[f.name],m={};m.promise=new E(function(S,I){m.resolve=S,m.reject=I}),b.deferredOperations.push(m),b.dbReady?b.dbReady=b.dbReady.then(function(){return m.promise}):b.dbReady=m.promise}function De(f){var b=se[f.name],m=b.deferredOperations.pop();if(m)return m.resolve(),m.promise}function Le(f,b){var m=se[f.name],S=m.deferredOperations.pop();if(S)return S.reject(b),S.promise}function Ge(f,b){return new E(function(m,S){if(se[f.name]=se[f.name]||J(),f.db)if(b)ke(f),f.db.close();else return m(f.db);var I=[f.name];b&&I.push(f.version);var C=d.open.apply(d,I);b&&(C.onupgradeneeded=function(R){var B=C.result;try{B.createObjectStore(f.storeName),R.oldVersion<=1&&B.createObjectStore(j)}catch($){if($.name==="ConstraintError")console.warn('The database "'+f.name+'" has been upgraded from version '+R.oldVersion+" to version "+R.newVersion+', but the storage "'+f.storeName+'" already exists.');else throw $}}),C.onerror=function(R){R.preventDefault(),S(C.error)},C.onsuccess=function(){var R=C.result;R.onversionchange=function(B){B.target.close()},m(R),De(f)}})}function Ye(f){return Ge(f,!1)}function gt(f){return Ge(f,!0)}function A(f,b){if(!f.db)return!0;var m=!f.db.objectStoreNames.contains(f.storeName),S=f.version<f.db.version,I=f.version>f.db.version;if(S&&(f.version!==b&&console.warn('The database "'+f.name+`" can't be downgraded from version `+f.db.version+" to version "+f.version+"."),f.version=f.db.version),I||m){if(m){var C=f.db.version+1;C>f.version&&(f.version=C)}return!0}return!1}function x(f){return new E(function(b,m){var S=new FileReader;S.onerror=m,S.onloadend=function(I){var C=btoa(I.target.result||"");b({__local_forage_encoded_blob:!0,data:C,type:f.type})},S.readAsBinaryString(f)})}function F(f){var b=he(atob(f.data));return p([b],{type:f.type})}function P(f){return f&&f.__local_forage_encoded_blob}function v(f){var b=this,m=b._initReady().then(function(){var S=se[b._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return N(m,f,f),m}function y(f){ke(f);for(var b=se[f.name],m=b.forages,S=0;S<m.length;S++){var I=m[S];I._dbInfo.db&&(I._dbInfo.db.close(),I._dbInfo.db=null)}return f.db=null,Ye(f).then(function(C){return f.db=C,A(f)?gt(f):C}).then(function(C){f.db=b.db=C;for(var R=0;R<m.length;R++)m[R]._dbInfo.db=C}).catch(function(C){throw Le(f,C),C})}function H(f,b,m,S){S===void 0&&(S=1);try{var I=f.db.transaction(f.storeName,b);m(null,I)}catch(C){if(S>0&&(!f.db||C.name==="InvalidStateError"||C.name==="NotFoundError"))return E.resolve().then(function(){if(!f.db||C.name==="NotFoundError"&&!f.db.objectStoreNames.contains(f.storeName)&&f.version<=f.db.version)return f.db&&(f.version=f.db.version+1),gt(f)}).then(function(){return y(f).then(function(){H(f,b,m,S-1)})}).catch(m);m(C)}}function J(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function re(f){var b=this,m={db:null};if(f)for(var S in f)m[S]=f[S];var I=se[m.name];I||(I=J(),se[m.name]=I),I.forages.push(b),b._initReady||(b._initReady=b.ready,b.ready=v);var C=[];function R(){return E.resolve()}for(var B=0;B<I.forages.length;B++){var $=I.forages[B];$!==b&&C.push($._initReady().catch(R))}var G=I.forages.slice(0);return E.all(C).then(function(){return m.db=I.db,Ye(m)}).then(function(z){return m.db=z,A(m,b._defaultConfig.version)?gt(m):z}).then(function(z){m.db=I.db=z,b._dbInfo=m;for(var ie=0;ie<G.length;ie++){var xe=G[ie];xe!==b&&(xe._dbInfo.db=m.db,xe._dbInfo.version=m.version)}})}function oe(f,b){var m=this;f=M(f);var S=new E(function(I,C){m.ready().then(function(){H(m._dbInfo,be,function(R,B){if(R)return C(R);try{var $=B.objectStore(m._dbInfo.storeName),G=$.get(f);G.onsuccess=function(){var z=G.result;z===void 0&&(z=null),P(z)&&(z=F(z)),I(z)},G.onerror=function(){C(G.error)}}catch(z){C(z)}})}).catch(C)});return w(S,b),S}function ue(f,b){var m=this,S=new E(function(I,C){m.ready().then(function(){H(m._dbInfo,be,function(R,B){if(R)return C(R);try{var $=B.objectStore(m._dbInfo.storeName),G=$.openCursor(),z=1;G.onsuccess=function(){var ie=G.result;if(ie){var xe=ie.value;P(xe)&&(xe=F(xe));var Ue=f(xe,ie.key,z++);Ue!==void 0?I(Ue):ie.continue()}else I()},G.onerror=function(){C(G.error)}}catch(ie){C(ie)}})}).catch(C)});return w(S,b),S}function Q(f,b,m){var S=this;f=M(f);var I=new E(function(C,R){var B;S.ready().then(function(){return B=S._dbInfo,X.call(b)==="[object Blob]"?ye(B.db).then(function($){return $?b:x(b)}):b}).then(function($){H(S._dbInfo,U,function(G,z){if(G)return R(G);try{var ie=z.objectStore(S._dbInfo.storeName);$===null&&($=void 0);var xe=ie.put($,f);z.oncomplete=function(){$===void 0&&($=null),C($)},z.onabort=z.onerror=function(){var Ue=xe.error?xe.error:xe.transaction.error;R(Ue)}}catch(Ue){R(Ue)}})}).catch(R)});return w(I,m),I}function ae(f,b){var m=this;f=M(f);var S=new E(function(I,C){m.ready().then(function(){H(m._dbInfo,U,function(R,B){if(R)return C(R);try{var $=B.objectStore(m._dbInfo.storeName),G=$.delete(f);B.oncomplete=function(){I()},B.onerror=function(){C(G.error)},B.onabort=function(){var z=G.error?G.error:G.transaction.error;C(z)}}catch(z){C(z)}})}).catch(C)});return w(S,b),S}function ee(f){var b=this,m=new E(function(S,I){b.ready().then(function(){H(b._dbInfo,U,function(C,R){if(C)return I(C);try{var B=R.objectStore(b._dbInfo.storeName),$=B.clear();R.oncomplete=function(){S()},R.onabort=R.onerror=function(){var G=$.error?$.error:$.transaction.error;I(G)}}catch(G){I(G)}})}).catch(I)});return w(m,f),m}function pe(f){var b=this,m=new E(function(S,I){b.ready().then(function(){H(b._dbInfo,be,function(C,R){if(C)return I(C);try{var B=R.objectStore(b._dbInfo.storeName),$=B.count();$.onsuccess=function(){S($.result)},$.onerror=function(){I($.error)}}catch(G){I(G)}})}).catch(I)});return w(m,f),m}function ce(f,b){var m=this,S=new E(function(I,C){if(f<0){I(null);return}m.ready().then(function(){H(m._dbInfo,be,function(R,B){if(R)return C(R);try{var $=B.objectStore(m._dbInfo.storeName),G=!1,z=$.openKeyCursor();z.onsuccess=function(){var ie=z.result;if(!ie){I(null);return}f===0||G?I(ie.key):(G=!0,ie.advance(f))},z.onerror=function(){C(z.error)}}catch(ie){C(ie)}})}).catch(C)});return w(S,b),S}function me(f){var b=this,m=new E(function(S,I){b.ready().then(function(){H(b._dbInfo,be,function(C,R){if(C)return I(C);try{var B=R.objectStore(b._dbInfo.storeName),$=B.openKeyCursor(),G=[];$.onsuccess=function(){var z=$.result;if(!z){S(G);return}G.push(z.key),z.continue()},$.onerror=function(){I($.error)}}catch(z){I(z)}})}).catch(I)});return w(m,f),m}function ge(f,b){b=L.apply(this,arguments);var m=this.config();f=typeof f!="function"&&f||{},f.name||(f.name=f.name||m.name,f.storeName=f.storeName||m.storeName);var S=this,I;if(!f.name)I=E.reject("Invalid arguments");else{var C=f.name===m.name&&S._dbInfo.db,R=C?E.resolve(S._dbInfo.db):Ye(f).then(function(B){var $=se[f.name],G=$.forages;$.db=B;for(var z=0;z<G.length;z++)G[z]._dbInfo.db=B;return B});f.storeName?I=R.then(function(B){if(B.objectStoreNames.contains(f.storeName)){var $=B.version+1;ke(f);var G=se[f.name],z=G.forages;B.close();for(var ie=0;ie<z.length;ie++){var xe=z[ie];xe._dbInfo.db=null,xe._dbInfo.version=$}var Ue=new E(function(He,st){var tt=d.open(f.name,$);tt.onerror=function(Wt){var Qr=tt.result;Qr.close(),st(Wt)},tt.onupgradeneeded=function(){var Wt=tt.result;Wt.deleteObjectStore(f.storeName)},tt.onsuccess=function(){var Wt=tt.result;Wt.close(),He(Wt)}});return Ue.then(function(He){G.db=He;for(var st=0;st<z.length;st++){var tt=z[st];tt._dbInfo.db=He,De(tt._dbInfo)}}).catch(function(He){throw(Le(f,He)||E.resolve()).catch(function(){}),He})}}):I=R.then(function(B){ke(f);var $=se[f.name],G=$.forages;B.close();for(var z=0;z<G.length;z++){var ie=G[z];ie._dbInfo.db=null}var xe=new E(function(Ue,He){var st=d.deleteDatabase(f.name);st.onerror=function(){var tt=st.result;tt&&tt.close(),He(st.error)},st.onblocked=function(){console.warn('dropInstance blocked for database "'+f.name+'" until all open connections are closed')},st.onsuccess=function(){var tt=st.result;tt&&tt.close(),Ue(tt)}});return xe.then(function(Ue){$.db=Ue;for(var He=0;He<G.length;He++){var st=G[He];De(st._dbInfo)}}).catch(function(Ue){throw(Le(f,Ue)||E.resolve()).catch(function(){}),Ue})})}return w(I,b),I}var _e={_driver:"asyncStorage",_initStorage:re,_support:g(),iterate:ue,getItem:oe,setItem:Q,removeItem:ae,clear:ee,length:pe,key:ce,keys:me,dropInstance:ge};function h(){return typeof openDatabase=="function"}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l="~~local_forage_type~",_=/^~~local_forage_type~([^~]+)~/,T="__lfsc__:",D=T.length,V="arbf",ve="blob",Ie="si08",we="ui08",Ve="uic8",Be="si16",qe="si32",kt="ur16",Gt="ui32",bn="fl32",St="fl64",Vt=D+V.length,Vi=Object.prototype.toString;function dl(f){var b=f.length*.75,m=f.length,S,I=0,C,R,B,$;f[f.length-1]==="="&&(b--,f[f.length-2]==="="&&b--);var G=new ArrayBuffer(b),z=new Uint8Array(G);for(S=0;S<m;S+=4)C=c.indexOf(f[S]),R=c.indexOf(f[S+1]),B=c.indexOf(f[S+2]),$=c.indexOf(f[S+3]),z[I++]=C<<2|R>>4,z[I++]=(R&15)<<4|B>>2,z[I++]=(B&3)<<6|$&63;return G}function Es(f){var b=new Uint8Array(f),m="",S;for(S=0;S<b.length;S+=3)m+=c[b[S]>>2],m+=c[(b[S]&3)<<4|b[S+1]>>4],m+=c[(b[S+1]&15)<<2|b[S+2]>>6],m+=c[b[S+2]&63];return b.length%3===2?m=m.substring(0,m.length-1)+"=":b.length%3===1&&(m=m.substring(0,m.length-2)+"=="),m}function qp(f,b){var m="";if(f&&(m=Vi.call(f)),f&&(m==="[object ArrayBuffer]"||f.buffer&&Vi.call(f.buffer)==="[object ArrayBuffer]")){var S,I=T;f instanceof ArrayBuffer?(S=f,I+=V):(S=f.buffer,m==="[object Int8Array]"?I+=Ie:m==="[object Uint8Array]"?I+=we:m==="[object Uint8ClampedArray]"?I+=Ve:m==="[object Int16Array]"?I+=Be:m==="[object Uint16Array]"?I+=kt:m==="[object Int32Array]"?I+=qe:m==="[object Uint32Array]"?I+=Gt:m==="[object Float32Array]"?I+=bn:m==="[object Float64Array]"?I+=St:b(new Error("Failed to get type for BinaryArray"))),b(I+Es(S))}else if(m==="[object Blob]"){var C=new FileReader;C.onload=function(){var R=l+f.type+"~"+Es(this.result);b(T+ve+R)},C.readAsArrayBuffer(f)}else try{b(JSON.stringify(f))}catch(R){console.error("Couldn't convert value into a JSON string: ",f),b(null,R)}}function Zp(f){if(f.substring(0,D)!==T)return JSON.parse(f);var b=f.substring(Vt),m=f.substring(D,Vt),S;if(m===ve&&_.test(b)){var I=b.match(_);S=I[1],b=b.substring(I[0].length)}var C=dl(b);switch(m){case V:return C;case ve:return p([C],{type:S});case Ie:return new Int8Array(C);case we:return new Uint8Array(C);case Ve:return new Uint8ClampedArray(C);case Be:return new Int16Array(C);case kt:return new Uint16Array(C);case qe:return new Int32Array(C);case Gt:return new Uint32Array(C);case bn:return new Float32Array(C);case St:return new Float64Array(C);default:throw new Error("Unkown type: "+m)}}var bs={serialize:qp,deserialize:Zp,stringToBuffer:dl,bufferToString:Es};function fl(f,b,m,S){f.executeSql("CREATE TABLE IF NOT EXISTS "+b.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],m,S)}function Jp(f){var b=this,m={db:null};if(f)for(var S in f)m[S]=typeof f[S]!="string"?f[S].toString():f[S];var I=new E(function(C,R){try{m.db=openDatabase(m.name,String(m.version),m.description,m.size)}catch(B){return R(B)}m.db.transaction(function(B){fl(B,m,function(){b._dbInfo=m,C()},function($,G){R(G)})},R)});return m.serializer=bs,I}function Vn(f,b,m,S,I,C){f.executeSql(m,S,I,function(R,B){B.code===B.SYNTAX_ERR?R.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[b.storeName],function($,G){G.rows.length?C($,B):fl($,b,function(){$.executeSql(m,S,I,C)},C)},C):C(R,B)},C)}function Qp(f,b){var m=this;f=M(f);var S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(B){Vn(B,R,"SELECT * FROM "+R.storeName+" WHERE key = ? LIMIT 1",[f],function($,G){var z=G.rows.length?G.rows.item(0).value:null;z&&(z=R.serializer.deserialize(z)),I(z)},function($,G){C(G)})})}).catch(C)});return w(S,b),S}function eh(f,b){var m=this,S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(B){Vn(B,R,"SELECT * FROM "+R.storeName,[],function($,G){for(var z=G.rows,ie=z.length,xe=0;xe<ie;xe++){var Ue=z.item(xe),He=Ue.value;if(He&&(He=R.serializer.deserialize(He)),He=f(He,Ue.key,xe+1),He!==void 0){I(He);return}}I()},function($,G){C(G)})})}).catch(C)});return w(S,b),S}function pl(f,b,m,S){var I=this;f=M(f);var C=new E(function(R,B){I.ready().then(function(){b===void 0&&(b=null);var $=b,G=I._dbInfo;G.serializer.serialize(b,function(z,ie){ie?B(ie):G.db.transaction(function(xe){Vn(xe,G,"INSERT OR REPLACE INTO "+G.storeName+" (key, value) VALUES (?, ?)",[f,z],function(){R($)},function(Ue,He){B(He)})},function(xe){if(xe.code===xe.QUOTA_ERR){if(S>0){R(pl.apply(I,[f,$,m,S-1]));return}B(xe)}})})}).catch(B)});return w(C,m),C}function th(f,b,m){return pl.apply(this,[f,b,m,1])}function nh(f,b){var m=this;f=M(f);var S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(B){Vn(B,R,"DELETE FROM "+R.storeName+" WHERE key = ?",[f],function(){I()},function($,G){C(G)})})}).catch(C)});return w(S,b),S}function rh(f){var b=this,m=new E(function(S,I){b.ready().then(function(){var C=b._dbInfo;C.db.transaction(function(R){Vn(R,C,"DELETE FROM "+C.storeName,[],function(){S()},function(B,$){I($)})})}).catch(I)});return w(m,f),m}function ih(f){var b=this,m=new E(function(S,I){b.ready().then(function(){var C=b._dbInfo;C.db.transaction(function(R){Vn(R,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function(B,$){var G=$.rows.item(0).c;S(G)},function(B,$){I($)})})}).catch(I)});return w(m,f),m}function oh(f,b){var m=this,S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(B){Vn(B,R,"SELECT key FROM "+R.storeName+" WHERE id = ? LIMIT 1",[f+1],function($,G){var z=G.rows.length?G.rows.item(0).key:null;I(z)},function($,G){C(G)})})}).catch(C)});return w(S,b),S}function sh(f){var b=this,m=new E(function(S,I){b.ready().then(function(){var C=b._dbInfo;C.db.transaction(function(R){Vn(R,C,"SELECT key FROM "+C.storeName,[],function(B,$){for(var G=[],z=0;z<$.rows.length;z++)G.push($.rows.item(z).key);S(G)},function(B,$){I($)})})}).catch(I)});return w(m,f),m}function ah(f){return new E(function(b,m){f.transaction(function(S){S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(I,C){for(var R=[],B=0;B<C.rows.length;B++)R.push(C.rows.item(B).name);b({db:f,storeNames:R})},function(I,C){m(C)})},function(S){m(S)})})}function ch(f,b){b=L.apply(this,arguments);var m=this.config();f=typeof f!="function"&&f||{},f.name||(f.name=f.name||m.name,f.storeName=f.storeName||m.storeName);var S=this,I;return f.name?I=new E(function(C){var R;f.name===m.name?R=S._dbInfo.db:R=openDatabase(f.name,"","",0),f.storeName?C({db:R,storeNames:[f.storeName]}):C(ah(R))}).then(function(C){return new E(function(R,B){C.db.transaction(function($){function G(Ue){return new E(function(He,st){$.executeSql("DROP TABLE IF EXISTS "+Ue,[],function(){He()},function(tt,Wt){st(Wt)})})}for(var z=[],ie=0,xe=C.storeNames.length;ie<xe;ie++)z.push(G(C.storeNames[ie]));E.all(z).then(function(){R()}).catch(function(Ue){B(Ue)})},function($){B($)})})}):I=E.reject("Invalid arguments"),w(I,b),I}var lh={_driver:"webSQLStorage",_initStorage:Jp,_support:h(),iterate:eh,getItem:Qp,setItem:th,removeItem:nh,clear:rh,length:ih,key:oh,keys:sh,dropInstance:ch};function uh(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function hl(f,b){var m=f.name+"/";return f.storeName!==b.storeName&&(m+=f.storeName+"/"),m}function dh(){var f="_localforage_support_test";try{return localStorage.setItem(f,!0),localStorage.removeItem(f),!1}catch{return!0}}function fh(){return!dh()||localStorage.length>0}function ph(f){var b=this,m={};if(f)for(var S in f)m[S]=f[S];return m.keyPrefix=hl(f,b._defaultConfig),fh()?(b._dbInfo=m,m.serializer=bs,E.resolve()):E.reject()}function hh(f){var b=this,m=b.ready().then(function(){for(var S=b._dbInfo.keyPrefix,I=localStorage.length-1;I>=0;I--){var C=localStorage.key(I);C.indexOf(S)===0&&localStorage.removeItem(C)}});return w(m,f),m}function mh(f,b){var m=this;f=M(f);var S=m.ready().then(function(){var I=m._dbInfo,C=localStorage.getItem(I.keyPrefix+f);return C&&(C=I.serializer.deserialize(C)),C});return w(S,b),S}function gh(f,b){var m=this,S=m.ready().then(function(){for(var I=m._dbInfo,C=I.keyPrefix,R=C.length,B=localStorage.length,$=1,G=0;G<B;G++){var z=localStorage.key(G);if(z.indexOf(C)===0){var ie=localStorage.getItem(z);if(ie&&(ie=I.serializer.deserialize(ie)),ie=f(ie,z.substring(R),$++),ie!==void 0)return ie}}});return w(S,b),S}function _h(f,b){var m=this,S=m.ready().then(function(){var I=m._dbInfo,C;try{C=localStorage.key(f)}catch{C=null}return C&&(C=C.substring(I.keyPrefix.length)),C});return w(S,b),S}function vh(f){var b=this,m=b.ready().then(function(){for(var S=b._dbInfo,I=localStorage.length,C=[],R=0;R<I;R++){var B=localStorage.key(R);B.indexOf(S.keyPrefix)===0&&C.push(B.substring(S.keyPrefix.length))}return C});return w(m,f),m}function yh(f){var b=this,m=b.keys().then(function(S){return S.length});return w(m,f),m}function Eh(f,b){var m=this;f=M(f);var S=m.ready().then(function(){var I=m._dbInfo;localStorage.removeItem(I.keyPrefix+f)});return w(S,b),S}function bh(f,b,m){var S=this;f=M(f);var I=S.ready().then(function(){b===void 0&&(b=null);var C=b;return new E(function(R,B){var $=S._dbInfo;$.serializer.serialize(b,function(G,z){if(z)B(z);else try{localStorage.setItem($.keyPrefix+f,G),R(C)}catch(ie){(ie.name==="QuotaExceededError"||ie.name==="NS_ERROR_DOM_QUOTA_REACHED")&&B(ie),B(ie)}})})});return w(I,m),I}function wh(f,b){if(b=L.apply(this,arguments),f=typeof f!="function"&&f||{},!f.name){var m=this.config();f.name=f.name||m.name,f.storeName=f.storeName||m.storeName}var S=this,I;return f.name?I=new E(function(C){f.storeName?C(hl(f,S._defaultConfig)):C(f.name+"/")}).then(function(C){for(var R=localStorage.length-1;R>=0;R--){var B=localStorage.key(R);B.indexOf(C)===0&&localStorage.removeItem(B)}}):I=E.reject("Invalid arguments"),w(I,b),I}var Ch={_driver:"localStorageWrapper",_initStorage:ph,_support:uh(),iterate:gh,getItem:mh,setItem:bh,removeItem:Eh,clear:hh,length:yh,key:_h,keys:vh,dropInstance:wh},Sh=function(b,m){return b===m||typeof b=="number"&&typeof m=="number"&&isNaN(b)&&isNaN(m)},Th=function(b,m){for(var S=b.length,I=0;I<S;){if(Sh(b[I],m))return!0;I++}return!1},ml=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},Jr={},gl={},fr={INDEXEDDB:_e,WEBSQL:lh,LOCALSTORAGE:Ch},Ih=[fr.INDEXEDDB._driver,fr.WEBSQL._driver,fr.LOCALSTORAGE._driver],Bi=["dropInstance"],ws=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Bi),xh={description:"",driver:Ih.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Oh(f,b){f[b]=function(){var m=arguments;return f.ready().then(function(){return f[b].apply(f,m)})}}function Cs(){for(var f=1;f<arguments.length;f++){var b=arguments[f];if(b)for(var m in b)b.hasOwnProperty(m)&&(ml(b[m])?arguments[0][m]=b[m].slice():arguments[0][m]=b[m])}return arguments[0]}var Ah=function(){function f(b){a(this,f);for(var m in fr)if(fr.hasOwnProperty(m)){var S=fr[m],I=S._driver;this[m]=I,Jr[I]||this.defineDriver(S)}this._defaultConfig=Cs({},xh),this._config=Cs({},this._defaultConfig,b),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return f.prototype.config=function(m){if((typeof m>"u"?"undefined":s(m))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var S in m){if(S==="storeName"&&(m[S]=m[S].replace(/\W/g,"_")),S==="version"&&typeof m[S]!="number")return new Error("Database version must be a number.");this._config[S]=m[S]}return"driver"in m&&m.driver?this.setDriver(this._config.driver):!0}else return typeof m=="string"?this._config[m]:this._config},f.prototype.defineDriver=function(m,S,I){var C=new E(function(R,B){try{var $=m._driver,G=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!m._driver){B(G);return}for(var z=ws.concat("_initStorage"),ie=0,xe=z.length;ie<xe;ie++){var Ue=z[ie],He=!Th(Bi,Ue);if((He||m[Ue])&&typeof m[Ue]!="function"){B(G);return}}var st=function(){for(var Qr=function(Rh){return function(){var Mh=new Error("Method "+Rh+" is not implemented by the current driver"),_l=E.reject(Mh);return w(_l,arguments[arguments.length-1]),_l}},Ss=0,Nh=Bi.length;Ss<Nh;Ss++){var Ts=Bi[Ss];m[Ts]||(m[Ts]=Qr(Ts))}};st();var tt=function(Qr){Jr[$]&&console.info("Redefining LocalForage driver: "+$),Jr[$]=m,gl[$]=Qr,R()};"_support"in m?m._support&&typeof m._support=="function"?m._support().then(tt,B):tt(!!m._support):tt(!0)}catch(Wt){B(Wt)}});return N(C,S,I),C},f.prototype.driver=function(){return this._driver||null},f.prototype.getDriver=function(m,S,I){var C=Jr[m]?E.resolve(Jr[m]):E.reject(new Error("Driver not found."));return N(C,S,I),C},f.prototype.getSerializer=function(m){var S=E.resolve(bs);return N(S,m),S},f.prototype.ready=function(m){var S=this,I=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return N(I,m,m),I},f.prototype.setDriver=function(m,S,I){var C=this;ml(m)||(m=[m]);var R=this._getSupportedDrivers(m);function B(){C._config.driver=C.driver()}function $(ie){return C._extend(ie),B(),C._ready=C._initStorage(C._config),C._ready}function G(ie){return function(){var xe=0;function Ue(){for(;xe<ie.length;){var He=ie[xe];return xe++,C._dbInfo=null,C._ready=null,C.getDriver(He).then($).catch(Ue)}B();var st=new Error("No available storage method found.");return C._driverSet=E.reject(st),C._driverSet}return Ue()}}var z=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=z.then(function(){var ie=R[0];return C._dbInfo=null,C._ready=null,C.getDriver(ie).then(function(xe){C._driver=xe._driver,B(),C._wrapLibraryMethodsWithReady(),C._initDriver=G(R)})}).catch(function(){B();var ie=new Error("No available storage method found.");return C._driverSet=E.reject(ie),C._driverSet}),N(this._driverSet,S,I),this._driverSet},f.prototype.supports=function(m){return!!gl[m]},f.prototype._extend=function(m){Cs(this,m)},f.prototype._getSupportedDrivers=function(m){for(var S=[],I=0,C=m.length;I<C;I++){var R=m[I];this.supports(R)&&S.push(R)}return S},f.prototype._wrapLibraryMethodsWithReady=function(){for(var m=0,S=ws.length;m<S;m++)Oh(this,ws[m])},f.prototype.createInstance=function(m){return new f(m)},f}(),Dh=new Ah;i.exports=Dh},{3:3}]},{},[4])(4)})});var Lh={schedule(t,e){let n=setTimeout(t,e);return()=>clearTimeout(n)}};function Fh(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function kh(t){return!!t&&t.nodeType===Node.ELEMENT_NODE}var Us;function Vh(t,e){if(!Us){let n=Element.prototype;Us=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE?Us.call(t,e):!1}function Bh(t){let e={};return t.forEach(({propName:n,templateName:r,transform:i})=>{e[Fh(r)]=[n,i]}),e}function Uh(t,e){return e.get(As).resolveComponentFactory(t).inputs}function Hh(t,e){let n=t.childNodes,r=e.map(()=>[]),i=-1;e.some((o,s)=>o==="*"?(i=s,!0):!1);for(let o=0,s=n.length;o<s;++o){let a=n[o],u=jh(a,e,i);u!==-1&&r[u].push(a)}return r}function jh(t,e,n){let r=n;return kh(t)&&e.some((i,o)=>i!=="*"&&Vh(t,i)?(r=o,!0):!1),r}var $h=10,Hs=class{componentFactory;inputMap=new Map;constructor(e,n){this.componentFactory=n.get(As).resolveComponentFactory(e);for(let r of this.componentFactory.inputs)this.inputMap.set(r.propName,r.templateName)}create(e){return new js(this.componentFactory,e,this.inputMap)}},js=class{componentFactory;injector;inputMap;eventEmitters=new wl(1);events=this.eventEmitters.pipe(Nl(e=>Hi(...e)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(e,n,r){this.componentFactory=e,this.injector=n,this.inputMap=r,this.ngZone=this.injector.get(Pt),this.appRef=this.injector.get(Wi),this.cdScheduler=n.get(Pl),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=Lh.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},$h))})}getInputValue(e){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,n){if(this.componentRef===null){this.initialInputValues.set(e,n);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(e)??e,n),this.componentRef.hostView.dirty&&(this.componentRef.changeDetectorRef.markForRefresh(),this.cdScheduler.notify(6))})}initializeComponent(e){let n=Mt.create({providers:[],parent:this.injector}),r=Hh(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(n,r,e),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[e,n]of this.initialInputValues)this.setInputValue(e,n);this.initialInputValues.clear()}initializeOutputs(e){let n=this.componentFactory.outputs.map(({propName:r,templateName:i})=>{let o=e.instance[r];return new El(s=>{let a=o.subscribe(u=>s.next({name:i,value:u}));return()=>a.unsubscribe()})});this.eventEmitters.next(n)}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}},$s=class extends HTMLElement{ngElementEventsSubscription=null};function nu(t,e){let n=Uh(t,e.injector),r=e.strategyFactory||new Hs(t,e.injector),i=Bh(n);class o extends $s{injector;static observedAttributes=Object.keys(i);get ngElementStrategy(){if(!this._ngElementStrategy){let a=this._ngElementStrategy=r.create(this.injector||e.injector);n.forEach(({propName:u,transform:d})=>{if(!this.hasOwnProperty(u))return;let g=this[u];delete this[u],a.setInputValue(u,g,d)})}return this._ngElementStrategy}_ngElementStrategy;constructor(a){super(),this.injector=a}attributeChangedCallback(a,u,d,g){let[p,E]=i[a];this.ngElementStrategy.setInputValue(p,d,E)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{let u=new CustomEvent(a.name,{detail:a.value});this.dispatchEvent(u)})}}return n.forEach(({propName:s,transform:a})=>{Object.defineProperty(o.prototype,s,{get(){return this.ngElementStrategy.getInputValue(s)},set(u){this.ngElementStrategy.setInputValue(s,u,a)},configurable:!0,enumerable:!0})}),o}var ru="9.13.0";var Xe=class t{static SDK_VERSION=ru;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_EXPERIMENT_START="CE Experiment Start";static EVENT_VIDEO_DIALOG_CLOSED="CE Video Dialog Closed";static EVENT_VIDEO_DIALOG_OPENED="CE Video Dialog Opened";static EVENT_VIDEO_CHANGE="CE Video Changed";static EVENT_LAST_VIDEO_ENDED="CE Last Video Ended";static EVENT_VIDEO_MUTED="CE Video Muted";static EVENT_VIDEO_UNMUTED="CE Video Unmuted";static EVENT_ADD_TO_CART_CLICKED="CE Add To Cart Clicked";static EVENT_VIEW_ITEM_CLICKED="CE View Item Clicked";static EVENT_MORE_ITEM_INFO_CLICKED="CE More Item Info Clicked";static EVENT_OPEN_CART_CLICKED="CE Open Cart Clicked";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_OPEN_CART="Open Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static CTA_AFTER_REFRESH_UI="letscooee:outbound:refresh-ui";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static PAYMENT_MODAL_DETAILS=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}];static{let e=t.SDK_VERSION.split(".").map(n=>n.padStart(2,"0")).join("");t.SDK_VERSION_CODE=parseInt(e,10)}};var Dn={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Xe.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Xe.SDK_VERSION}/dist/widget.min.js`};var Ut=ti(ou());var ut=class{static log(...e){Ut.default.info(...e)}static debug(...e){Ut.default.debug(...e)}static error(...e){Ut.default.error(...e)}static warn(...e){Ut.default.warn(...e)}static info(...e){Ut.default.info(...e)}static trace(...e){Ut.default.trace(...e)}};function su(t=Xe.LOG_PREFIX){Ut.default.useDefaults({formatter:function(n){n.unshift(`${t} (v${Xe.SDK_VERSION}):`)}});let e=Wh();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Ut.default.setLevel(Ut.default[localStorage.cooeeLogLevel]):Ut.default.setLevel(Dn.debug?Ut.default.TRACE:Ut.default.OFF)}function Wh(){return new URL(location.href).searchParams?.get("cooee-debug")}var ki=ti(Qi());var cu={providers:[$l()]};var zh={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},KE=Ce(O({},zh),{"[class.ng-submitted]":"isSubmitted"});var Kh=new nn("",{providedIn:"root",factory:()=>du}),du="always";var Xh=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=Xn({type:t});static \u0275inj=zn({})}return t})();var fu=(()=>{class t{static withConfig(n){return{ngModule:t,providers:[{provide:Kh,useValue:n.callSetDisabledState??du}]}}static \u0275fac=function(r){return new(r||t)};static \u0275mod=Xn({type:t});static \u0275inj=zn({imports:[Xh]})}return t})();var zt=class{static SWIPER_CSS="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css";static injectScriptURL(e,n){if(!e)return;let r=document.createElement("script");r.id=n??"",r.src=e,r.type="module",document.head.appendChild(r)}static injectRawScript(e){if(!e)return;let n=document.createElement("script");n.id="cooee-app-script",n.innerHTML=e,document.head.appendChild(n)}static injectRawCSS(e,n=document.head){if(!e)return;let r=document.createElement("style");r.textContent=e,n.appendChild(r)}static injectSwiperCSS(e=document.head){this.injectStylesheet(this.SWIPER_CSS,e)}static injectStylesheet(e,n=document.head){if(!e)return;let r=document.createElement("link");r.rel="stylesheet",r.href=e,e===this.SWIPER_CSS&&(r.crossOrigin="anonymous",r.onload=i=>{let s=i.currentTarget?.sheet?.cssRules;if(s){for(let a of s)if(a.type==CSSRule.FONT_FACE_RULE){let u=e.split("/"),d=u.slice(0,u.length-1).join("/"),g=a.cssText;g=g.replace(/url\s*\(\s*['"]?(?!((\/)|((?:https?:)?\/\/)|(?:data:?:)))([^'")]+)['"]?\s*\)/g,`url("${d}/$4")`);let p=document.createElement("style");p.appendChild(document.createTextNode(g)),document.head.appendChild(p)}}}),n.appendChild(r)}static async loadSwiperScript(){window.CooeeSDK.Swiper||(window.CooeeSDK.Swiper=(await import("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.mjs")).Swiper)}};var Kt=class t{cooeeEvent=new at;cooeeCTA=new at;elementRef=q(Tt);_engagementTrigger=Lt(null);_triggerContext=Lt(null);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let e=["letscooee-widget"],n=this._engagementTrigger();return e.push(`widget-${n?.shortID}`),e}get triggerContext(){return this._triggerContext()}set triggerContext(e){this._triggerContext.set(e),this._engagementTrigger.set(e.triggerData),this.engagementTriggerReceived(e.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){ut.debug("Init",this.constructor.name);let e=this.elementRef.nativeElement.shadowRoot;e&&(zt.injectStylesheet(Dn.styleURL,e),zt.injectRawCSS(window.CooeeSDK.config.website.commonCSS,e))}ngOnDestroy(){ut.debug("Destroying",this.constructor.name)}sendEventToRenderer(e){this.cooeeEvent.emit(e)}executeCTAViaRenderer(e){this.cooeeCTA.emit(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Me({type:t,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&Bl(r.classes)},inputs:{triggerContext:"triggerContext"},outputs:{cooeeEvent:"cooeeEvent",cooeeCTA:"cooeeCTA"},decls:0,vars:0,template:function(n,r){},encapsulation:2})};var qh=(t,e)=>({"--option-color":t,"background-color":e}),pu=(t,e)=>e.id;function Zh(t,e){if(t&1&&(W(0,"span",6),Ae(1),Y()),t&2){Z();let n=Ke(1);k(),ln(n)}}function Jh(t,e){if(t&1){let n=ze();ct(0)(1)(2),W(3,"button",5),Pe("click",function(){let i=Ne(n).$implicit,o=Z().$implicit,s=Z();return Re(s.onOptionChange(o,i))}),Oe(4,Zh,2,1,"span",6),Y()}if(t&2){let n,r=e.$implicit,i=Z().$implicit,o=Ke(1),s=Z(),a=r.name;k();let u=vt(r.displayName||r.name),d=o?(n=r.hexColor)!==null&&n!==void 0?n:a:"";k(2),Ps("color-type",o)("selected",s.selectedOptions()[i.name]===a),de("disabled",r.disabled)("title",u)("ngStyle",zi(10,qh,d,d)),wn("data-value",a),k(),Te(o?-1:4)}}function Qh(t,e){if(t&1&&(W(0,"div"),ct(1),W(2,"div",1),Ae(3),Y(),W(4,"div",2),Ae(5),Y(),W(6,"div",3),nt(7,Jh,5,13,"button",4,pu),Y()()),t&2){let n=e.$implicit,r=Z();Ul("option-group ",n.name.toLowerCase(),""),k(),vt(r.hasHexColors(n)),k(2),It("",n.name,":"),k(2),ln(r.selectedOptions()[n.name]),k(2),rt(n.optionValues)}}var yr=class t extends Kt{selectedVariant=new at;item=hr.required();selectedOptions=Lt({});options=vr(()=>{let e=this.item();if(!e.options||e.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(e,this.engagementTrigger)}catch(n){ut.error(n)}return e.options});matchedVariant=vr(()=>{let e=this.item(),n=this.selectedOptions();return e.vars.find(r=>e.options.every(i=>n[i.name]===r.selectedOptions.find(o=>o.name===i.name)?.value))});constructor(){super(),ks(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let e=ks(()=>{let n=this.item();if(!n?.options)return;let r=O({},this.selectedOptions());n.options.forEach(i=>{let o=n.vars[0]?.selectedOptions.find(s=>s.name===i.name)?.value;o&&(r[i.name]=o)}),this.selectedOptions.set(r),e.destroy()})}onOptionChange(e,n){let r=O({},this.selectedOptions());r[e.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(e){return!!e.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Me({type:t,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[wt],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],[1,"option-values"],[1,"option-value",3,"disabled","color-type","selected","title","ngStyle"],[1,"option-value",3,"click","disabled","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&nt(0,Qh,9,6,"div",0,pu),n&2&&rt(r.options())},dependencies:[Kl,Yl,fu],styles:[`.option-group{display:flex;gap:4px;align-items:center}.option-group+.option-group{margin-top:8px}.option-values{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:6px;gap:4px}.selected-value{display:none}.option-value{padding:5px 10px;border:1px solid #ccc;cursor:pointer;border-radius:4px;min-width:32px;min-height:32px;text-align:center;position:relative;--selected-color: var(--option-color, rgb(var(--lc-color-button, 0 0 0)))}.option-value.selected{box-shadow:#fff 0 0 0 2px,var(--selected-color) 0 0 0 4px}
|
|
10
|
+
`+N(A,P)):y}}function gt(A,x){var F;return x.cache&&x.name&&x.storage.templates.get(x.name)?x.storage.templates.get(x.name):(F=typeof A=="function"?A:Ye(A,x),x.cache&&x.name&&x.storage.templates.define(x.name,F),F)}Le.l.bind(Le),t.compile=Ye,t.compileScope=se,t.compileScopeIntoFunction=K,t.compileToString=N,t.defaultConfig=Le,t.filters=De,t.getConfig=Ge,t.helpers=ye,t.nativeHelpers=ke,t.parse=w,t.render=function(A,x,F,P){var v=Ge(F||{});if(!v.async)return gt(A,v)(x,v);if(!P){if(typeof r=="function")return new r(function(y,H){try{y(gt(A,v)(x,v))}catch(J){H(J)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{gt(A,v)(x,v,P)}catch(y){return P(y)}},t.templates=te,Object.defineProperty(t,"__esModule",{value:!0})})});var of=Is((rf,ac)=>{"use strict";(function(t){if(typeof rf=="object"&&typeof ac<"u")ac.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,n;return function r(i,o,s){function a(g,p){if(!o[g]){if(!i[g]){var E=typeof ei=="function"&&ei;if(!p&&E)return E(g,!0);if(u)return u(g,!0);var w=new Error("Cannot find module '"+g+"'");throw w.code="MODULE_NOT_FOUND",w}var N=o[g]={exports:{}};i[g][0].call(N.exports,function(M){var L=i[g][1][M];return a(L||M)},N,N.exports,r,i,o,s)}return o[g].exports}for(var u=typeof ei=="function"&&ei,d=0;d<s.length;d++)a(s[d]);return a}({1:[function(r,i,o){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,u;if(a){var d=0,g=new a(M),p=s.document.createTextNode("");g.observe(p,{characterData:!0}),u=function(){p.data=d=++d%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var E=new s.MessageChannel;E.port1.onmessage=M,u=function(){E.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?u=function(){var j=s.document.createElement("script");j.onreadystatechange=function(){M(),j.onreadystatechange=null,j.parentNode.removeChild(j),j=null},s.document.documentElement.appendChild(j)}:u=function(){setTimeout(M,0)};var w,N=[];function M(){w=!0;for(var j,K,se=N.length;se;){for(K=N,N=[],j=-1;++j<se;)K[j]();se=N.length}w=!1}i.exports=L;function L(j){N.push(j)===1&&!w&&u()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,i,o){"use strict";var s=r(1);function a(){}var u={},d=["REJECTED"],g=["FULFILLED"],p=["PENDING"];i.exports=E;function E(U){if(typeof U!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,U!==a&&L(this,U)}E.prototype.catch=function(U){return this.then(null,U)},E.prototype.then=function(U,he){if(typeof U!="function"&&this.state===g||typeof he!="function"&&this.state===d)return this;var te=new this.constructor(a);if(this.state!==p){var ye=this.state===g?U:he;N(te,ye,this.outcome)}else this.queue.push(new w(te,U,he));return te};function w(U,he,te){this.promise=U,typeof he=="function"&&(this.onFulfilled=he,this.callFulfilled=this.otherCallFulfilled),typeof te=="function"&&(this.onRejected=te,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(U){u.resolve(this.promise,U)},w.prototype.otherCallFulfilled=function(U){N(this.promise,this.onFulfilled,U)},w.prototype.callRejected=function(U){u.reject(this.promise,U)},w.prototype.otherCallRejected=function(U){N(this.promise,this.onRejected,U)};function N(U,he,te){s(function(){var ye;try{ye=he(te)}catch(ke){return u.reject(U,ke)}ye===U?u.reject(U,new TypeError("Cannot resolve promise with itself")):u.resolve(U,ye)})}u.resolve=function(U,he){var te=j(M,he);if(te.status==="error")return u.reject(U,te.value);var ye=te.value;if(ye)L(U,ye);else{U.state=g,U.outcome=he;for(var ke=-1,De=U.queue.length;++ke<De;)U.queue[ke].callFulfilled(he)}return U},u.reject=function(U,he){U.state=d,U.outcome=he;for(var te=-1,ye=U.queue.length;++te<ye;)U.queue[te].callRejected(he);return U};function M(U){var he=U&&U.then;if(U&&(typeof U=="object"||typeof U=="function")&&typeof he=="function")return function(){he.apply(U,arguments)}}function L(U,he){var te=!1;function ye(Ge){te||(te=!0,u.reject(U,Ge))}function ke(Ge){te||(te=!0,u.resolve(U,Ge))}function De(){he(ke,ye)}var Le=j(De);Le.status==="error"&&ye(Le.value)}function j(U,he){var te={};try{te.value=U(he),te.status="success"}catch(ye){te.status="error",te.value=ye}return te}E.resolve=K;function K(U){return U instanceof this?U:u.resolve(new this(a),U)}E.reject=se;function se(U){var he=new this(a);return u.reject(he,U)}E.all=X;function X(U){var he=this;if(Object.prototype.toString.call(U)!=="[object Array]")return this.reject(new TypeError("must be an array"));var te=U.length,ye=!1;if(!te)return this.resolve([]);for(var ke=new Array(te),De=0,Le=-1,Ge=new this(a);++Le<te;)Ye(U[Le],Le);return Ge;function Ye(gt,A){he.resolve(gt).then(x,function(F){ye||(ye=!0,u.reject(Ge,F))});function x(F){ke[A]=F,++De===te&&!ye&&(ye=!0,u.resolve(Ge,ke))}}}E.race=be;function be(U){var he=this;if(Object.prototype.toString.call(U)!=="[object Array]")return this.reject(new TypeError("must be an array"));var te=U.length,ye=!1;if(!te)return this.resolve([]);for(var ke=-1,De=new this(a);++ke<te;)Le(U[ke]);return De;function Le(Ge){he.resolve(Ge).then(function(Ye){ye||(ye=!0,u.resolve(De,Ye))},function(Ye){ye||(ye=!0,u.reject(De,Ye))})}}},{1:1}],3:[function(r,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(f){return typeof f}:function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f};function a(f,b){if(!(f instanceof b))throw new TypeError("Cannot call a class as a function")}function u(){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 d=u();function g(){try{if(!d||!d.open)return!1;var f=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),b=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!f||b)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function p(f,b){f=f||[],b=b||{};try{return new Blob(f,b)}catch(C){if(C.name!=="TypeError")throw C;for(var m=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,S=new m,I=0;I<f.length;I+=1)S.append(f[I]);return S.getBlob(b.type)}}typeof Promise>"u"&&r(3);var E=Promise;function w(f,b){b&&f.then(function(m){b(null,m)},function(m){b(m)})}function N(f,b,m){typeof b=="function"&&f.then(b),typeof m=="function"&&f.catch(m)}function M(f){return typeof f!="string"&&(console.warn(f+" used as a key, but it is not a string."),f=String(f)),f}function L(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var j="local-forage-detect-blob-support",K=void 0,se={},X=Object.prototype.toString,be="readonly",U="readwrite";function he(f){for(var b=f.length,m=new ArrayBuffer(b),S=new Uint8Array(m),I=0;I<b;I++)S[I]=f.charCodeAt(I);return m}function te(f){return new E(function(b){var m=f.transaction(j,U),S=p([""]);m.objectStore(j).put(S,"key"),m.onabort=function(I){I.preventDefault(),I.stopPropagation(),b(!1)},m.oncomplete=function(){var I=navigator.userAgent.match(/Chrome\/(\d+)/),C=navigator.userAgent.match(/Edge\//);b(C||!I||parseInt(I[1],10)>=43)}}).catch(function(){return!1})}function ye(f){return typeof K=="boolean"?E.resolve(K):te(f).then(function(b){return K=b,K})}function ke(f){var b=se[f.name],m={};m.promise=new E(function(S,I){m.resolve=S,m.reject=I}),b.deferredOperations.push(m),b.dbReady?b.dbReady=b.dbReady.then(function(){return m.promise}):b.dbReady=m.promise}function De(f){var b=se[f.name],m=b.deferredOperations.pop();if(m)return m.resolve(),m.promise}function Le(f,b){var m=se[f.name],S=m.deferredOperations.pop();if(S)return S.reject(b),S.promise}function Ge(f,b){return new E(function(m,S){if(se[f.name]=se[f.name]||J(),f.db)if(b)ke(f),f.db.close();else return m(f.db);var I=[f.name];b&&I.push(f.version);var C=d.open.apply(d,I);b&&(C.onupgradeneeded=function(R){var B=C.result;try{B.createObjectStore(f.storeName),R.oldVersion<=1&&B.createObjectStore(j)}catch($){if($.name==="ConstraintError")console.warn('The database "'+f.name+'" has been upgraded from version '+R.oldVersion+" to version "+R.newVersion+', but the storage "'+f.storeName+'" already exists.');else throw $}}),C.onerror=function(R){R.preventDefault(),S(C.error)},C.onsuccess=function(){var R=C.result;R.onversionchange=function(B){B.target.close()},m(R),De(f)}})}function Ye(f){return Ge(f,!1)}function gt(f){return Ge(f,!0)}function A(f,b){if(!f.db)return!0;var m=!f.db.objectStoreNames.contains(f.storeName),S=f.version<f.db.version,I=f.version>f.db.version;if(S&&(f.version!==b&&console.warn('The database "'+f.name+`" can't be downgraded from version `+f.db.version+" to version "+f.version+"."),f.version=f.db.version),I||m){if(m){var C=f.db.version+1;C>f.version&&(f.version=C)}return!0}return!1}function x(f){return new E(function(b,m){var S=new FileReader;S.onerror=m,S.onloadend=function(I){var C=btoa(I.target.result||"");b({__local_forage_encoded_blob:!0,data:C,type:f.type})},S.readAsBinaryString(f)})}function F(f){var b=he(atob(f.data));return p([b],{type:f.type})}function P(f){return f&&f.__local_forage_encoded_blob}function v(f){var b=this,m=b._initReady().then(function(){var S=se[b._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return N(m,f,f),m}function y(f){ke(f);for(var b=se[f.name],m=b.forages,S=0;S<m.length;S++){var I=m[S];I._dbInfo.db&&(I._dbInfo.db.close(),I._dbInfo.db=null)}return f.db=null,Ye(f).then(function(C){return f.db=C,A(f)?gt(f):C}).then(function(C){f.db=b.db=C;for(var R=0;R<m.length;R++)m[R]._dbInfo.db=C}).catch(function(C){throw Le(f,C),C})}function H(f,b,m,S){S===void 0&&(S=1);try{var I=f.db.transaction(f.storeName,b);m(null,I)}catch(C){if(S>0&&(!f.db||C.name==="InvalidStateError"||C.name==="NotFoundError"))return E.resolve().then(function(){if(!f.db||C.name==="NotFoundError"&&!f.db.objectStoreNames.contains(f.storeName)&&f.version<=f.db.version)return f.db&&(f.version=f.db.version+1),gt(f)}).then(function(){return y(f).then(function(){H(f,b,m,S-1)})}).catch(m);m(C)}}function J(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function re(f){var b=this,m={db:null};if(f)for(var S in f)m[S]=f[S];var I=se[m.name];I||(I=J(),se[m.name]=I),I.forages.push(b),b._initReady||(b._initReady=b.ready,b.ready=v);var C=[];function R(){return E.resolve()}for(var B=0;B<I.forages.length;B++){var $=I.forages[B];$!==b&&C.push($._initReady().catch(R))}var G=I.forages.slice(0);return E.all(C).then(function(){return m.db=I.db,Ye(m)}).then(function(z){return m.db=z,A(m,b._defaultConfig.version)?gt(m):z}).then(function(z){m.db=I.db=z,b._dbInfo=m;for(var ie=0;ie<G.length;ie++){var xe=G[ie];xe!==b&&(xe._dbInfo.db=m.db,xe._dbInfo.version=m.version)}})}function oe(f,b){var m=this;f=M(f);var S=new E(function(I,C){m.ready().then(function(){H(m._dbInfo,be,function(R,B){if(R)return C(R);try{var $=B.objectStore(m._dbInfo.storeName),G=$.get(f);G.onsuccess=function(){var z=G.result;z===void 0&&(z=null),P(z)&&(z=F(z)),I(z)},G.onerror=function(){C(G.error)}}catch(z){C(z)}})}).catch(C)});return w(S,b),S}function ue(f,b){var m=this,S=new E(function(I,C){m.ready().then(function(){H(m._dbInfo,be,function(R,B){if(R)return C(R);try{var $=B.objectStore(m._dbInfo.storeName),G=$.openCursor(),z=1;G.onsuccess=function(){var ie=G.result;if(ie){var xe=ie.value;P(xe)&&(xe=F(xe));var Ue=f(xe,ie.key,z++);Ue!==void 0?I(Ue):ie.continue()}else I()},G.onerror=function(){C(G.error)}}catch(ie){C(ie)}})}).catch(C)});return w(S,b),S}function Q(f,b,m){var S=this;f=M(f);var I=new E(function(C,R){var B;S.ready().then(function(){return B=S._dbInfo,X.call(b)==="[object Blob]"?ye(B.db).then(function($){return $?b:x(b)}):b}).then(function($){H(S._dbInfo,U,function(G,z){if(G)return R(G);try{var ie=z.objectStore(S._dbInfo.storeName);$===null&&($=void 0);var xe=ie.put($,f);z.oncomplete=function(){$===void 0&&($=null),C($)},z.onabort=z.onerror=function(){var Ue=xe.error?xe.error:xe.transaction.error;R(Ue)}}catch(Ue){R(Ue)}})}).catch(R)});return w(I,m),I}function ae(f,b){var m=this;f=M(f);var S=new E(function(I,C){m.ready().then(function(){H(m._dbInfo,U,function(R,B){if(R)return C(R);try{var $=B.objectStore(m._dbInfo.storeName),G=$.delete(f);B.oncomplete=function(){I()},B.onerror=function(){C(G.error)},B.onabort=function(){var z=G.error?G.error:G.transaction.error;C(z)}}catch(z){C(z)}})}).catch(C)});return w(S,b),S}function ee(f){var b=this,m=new E(function(S,I){b.ready().then(function(){H(b._dbInfo,U,function(C,R){if(C)return I(C);try{var B=R.objectStore(b._dbInfo.storeName),$=B.clear();R.oncomplete=function(){S()},R.onabort=R.onerror=function(){var G=$.error?$.error:$.transaction.error;I(G)}}catch(G){I(G)}})}).catch(I)});return w(m,f),m}function pe(f){var b=this,m=new E(function(S,I){b.ready().then(function(){H(b._dbInfo,be,function(C,R){if(C)return I(C);try{var B=R.objectStore(b._dbInfo.storeName),$=B.count();$.onsuccess=function(){S($.result)},$.onerror=function(){I($.error)}}catch(G){I(G)}})}).catch(I)});return w(m,f),m}function ce(f,b){var m=this,S=new E(function(I,C){if(f<0){I(null);return}m.ready().then(function(){H(m._dbInfo,be,function(R,B){if(R)return C(R);try{var $=B.objectStore(m._dbInfo.storeName),G=!1,z=$.openKeyCursor();z.onsuccess=function(){var ie=z.result;if(!ie){I(null);return}f===0||G?I(ie.key):(G=!0,ie.advance(f))},z.onerror=function(){C(z.error)}}catch(ie){C(ie)}})}).catch(C)});return w(S,b),S}function me(f){var b=this,m=new E(function(S,I){b.ready().then(function(){H(b._dbInfo,be,function(C,R){if(C)return I(C);try{var B=R.objectStore(b._dbInfo.storeName),$=B.openKeyCursor(),G=[];$.onsuccess=function(){var z=$.result;if(!z){S(G);return}G.push(z.key),z.continue()},$.onerror=function(){I($.error)}}catch(z){I(z)}})}).catch(I)});return w(m,f),m}function ge(f,b){b=L.apply(this,arguments);var m=this.config();f=typeof f!="function"&&f||{},f.name||(f.name=f.name||m.name,f.storeName=f.storeName||m.storeName);var S=this,I;if(!f.name)I=E.reject("Invalid arguments");else{var C=f.name===m.name&&S._dbInfo.db,R=C?E.resolve(S._dbInfo.db):Ye(f).then(function(B){var $=se[f.name],G=$.forages;$.db=B;for(var z=0;z<G.length;z++)G[z]._dbInfo.db=B;return B});f.storeName?I=R.then(function(B){if(B.objectStoreNames.contains(f.storeName)){var $=B.version+1;ke(f);var G=se[f.name],z=G.forages;B.close();for(var ie=0;ie<z.length;ie++){var xe=z[ie];xe._dbInfo.db=null,xe._dbInfo.version=$}var Ue=new E(function(He,st){var tt=d.open(f.name,$);tt.onerror=function(Wt){var Qr=tt.result;Qr.close(),st(Wt)},tt.onupgradeneeded=function(){var Wt=tt.result;Wt.deleteObjectStore(f.storeName)},tt.onsuccess=function(){var Wt=tt.result;Wt.close(),He(Wt)}});return Ue.then(function(He){G.db=He;for(var st=0;st<z.length;st++){var tt=z[st];tt._dbInfo.db=He,De(tt._dbInfo)}}).catch(function(He){throw(Le(f,He)||E.resolve()).catch(function(){}),He})}}):I=R.then(function(B){ke(f);var $=se[f.name],G=$.forages;B.close();for(var z=0;z<G.length;z++){var ie=G[z];ie._dbInfo.db=null}var xe=new E(function(Ue,He){var st=d.deleteDatabase(f.name);st.onerror=function(){var tt=st.result;tt&&tt.close(),He(st.error)},st.onblocked=function(){console.warn('dropInstance blocked for database "'+f.name+'" until all open connections are closed')},st.onsuccess=function(){var tt=st.result;tt&&tt.close(),Ue(tt)}});return xe.then(function(Ue){$.db=Ue;for(var He=0;He<G.length;He++){var st=G[He];De(st._dbInfo)}}).catch(function(Ue){throw(Le(f,Ue)||E.resolve()).catch(function(){}),Ue})})}return w(I,b),I}var _e={_driver:"asyncStorage",_initStorage:re,_support:g(),iterate:ue,getItem:oe,setItem:Q,removeItem:ae,clear:ee,length:pe,key:ce,keys:me,dropInstance:ge};function h(){return typeof openDatabase=="function"}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",l="~~local_forage_type~",_=/^~~local_forage_type~([^~]+)~/,T="__lfsc__:",D=T.length,V="arbf",ve="blob",Ie="si08",we="ui08",Ve="uic8",Be="si16",qe="si32",kt="ur16",Gt="ui32",bn="fl32",St="fl64",Vt=D+V.length,Vi=Object.prototype.toString;function dl(f){var b=f.length*.75,m=f.length,S,I=0,C,R,B,$;f[f.length-1]==="="&&(b--,f[f.length-2]==="="&&b--);var G=new ArrayBuffer(b),z=new Uint8Array(G);for(S=0;S<m;S+=4)C=c.indexOf(f[S]),R=c.indexOf(f[S+1]),B=c.indexOf(f[S+2]),$=c.indexOf(f[S+3]),z[I++]=C<<2|R>>4,z[I++]=(R&15)<<4|B>>2,z[I++]=(B&3)<<6|$&63;return G}function Es(f){var b=new Uint8Array(f),m="",S;for(S=0;S<b.length;S+=3)m+=c[b[S]>>2],m+=c[(b[S]&3)<<4|b[S+1]>>4],m+=c[(b[S+1]&15)<<2|b[S+2]>>6],m+=c[b[S+2]&63];return b.length%3===2?m=m.substring(0,m.length-1)+"=":b.length%3===1&&(m=m.substring(0,m.length-2)+"=="),m}function qp(f,b){var m="";if(f&&(m=Vi.call(f)),f&&(m==="[object ArrayBuffer]"||f.buffer&&Vi.call(f.buffer)==="[object ArrayBuffer]")){var S,I=T;f instanceof ArrayBuffer?(S=f,I+=V):(S=f.buffer,m==="[object Int8Array]"?I+=Ie:m==="[object Uint8Array]"?I+=we:m==="[object Uint8ClampedArray]"?I+=Ve:m==="[object Int16Array]"?I+=Be:m==="[object Uint16Array]"?I+=kt:m==="[object Int32Array]"?I+=qe:m==="[object Uint32Array]"?I+=Gt:m==="[object Float32Array]"?I+=bn:m==="[object Float64Array]"?I+=St:b(new Error("Failed to get type for BinaryArray"))),b(I+Es(S))}else if(m==="[object Blob]"){var C=new FileReader;C.onload=function(){var R=l+f.type+"~"+Es(this.result);b(T+ve+R)},C.readAsArrayBuffer(f)}else try{b(JSON.stringify(f))}catch(R){console.error("Couldn't convert value into a JSON string: ",f),b(null,R)}}function Zp(f){if(f.substring(0,D)!==T)return JSON.parse(f);var b=f.substring(Vt),m=f.substring(D,Vt),S;if(m===ve&&_.test(b)){var I=b.match(_);S=I[1],b=b.substring(I[0].length)}var C=dl(b);switch(m){case V:return C;case ve:return p([C],{type:S});case Ie:return new Int8Array(C);case we:return new Uint8Array(C);case Ve:return new Uint8ClampedArray(C);case Be:return new Int16Array(C);case kt:return new Uint16Array(C);case qe:return new Int32Array(C);case Gt:return new Uint32Array(C);case bn:return new Float32Array(C);case St:return new Float64Array(C);default:throw new Error("Unkown type: "+m)}}var bs={serialize:qp,deserialize:Zp,stringToBuffer:dl,bufferToString:Es};function fl(f,b,m,S){f.executeSql("CREATE TABLE IF NOT EXISTS "+b.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],m,S)}function Jp(f){var b=this,m={db:null};if(f)for(var S in f)m[S]=typeof f[S]!="string"?f[S].toString():f[S];var I=new E(function(C,R){try{m.db=openDatabase(m.name,String(m.version),m.description,m.size)}catch(B){return R(B)}m.db.transaction(function(B){fl(B,m,function(){b._dbInfo=m,C()},function($,G){R(G)})},R)});return m.serializer=bs,I}function Vn(f,b,m,S,I,C){f.executeSql(m,S,I,function(R,B){B.code===B.SYNTAX_ERR?R.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[b.storeName],function($,G){G.rows.length?C($,B):fl($,b,function(){$.executeSql(m,S,I,C)},C)},C):C(R,B)},C)}function Qp(f,b){var m=this;f=M(f);var S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(B){Vn(B,R,"SELECT * FROM "+R.storeName+" WHERE key = ? LIMIT 1",[f],function($,G){var z=G.rows.length?G.rows.item(0).value:null;z&&(z=R.serializer.deserialize(z)),I(z)},function($,G){C(G)})})}).catch(C)});return w(S,b),S}function eh(f,b){var m=this,S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(B){Vn(B,R,"SELECT * FROM "+R.storeName,[],function($,G){for(var z=G.rows,ie=z.length,xe=0;xe<ie;xe++){var Ue=z.item(xe),He=Ue.value;if(He&&(He=R.serializer.deserialize(He)),He=f(He,Ue.key,xe+1),He!==void 0){I(He);return}}I()},function($,G){C(G)})})}).catch(C)});return w(S,b),S}function pl(f,b,m,S){var I=this;f=M(f);var C=new E(function(R,B){I.ready().then(function(){b===void 0&&(b=null);var $=b,G=I._dbInfo;G.serializer.serialize(b,function(z,ie){ie?B(ie):G.db.transaction(function(xe){Vn(xe,G,"INSERT OR REPLACE INTO "+G.storeName+" (key, value) VALUES (?, ?)",[f,z],function(){R($)},function(Ue,He){B(He)})},function(xe){if(xe.code===xe.QUOTA_ERR){if(S>0){R(pl.apply(I,[f,$,m,S-1]));return}B(xe)}})})}).catch(B)});return w(C,m),C}function th(f,b,m){return pl.apply(this,[f,b,m,1])}function nh(f,b){var m=this;f=M(f);var S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(B){Vn(B,R,"DELETE FROM "+R.storeName+" WHERE key = ?",[f],function(){I()},function($,G){C(G)})})}).catch(C)});return w(S,b),S}function rh(f){var b=this,m=new E(function(S,I){b.ready().then(function(){var C=b._dbInfo;C.db.transaction(function(R){Vn(R,C,"DELETE FROM "+C.storeName,[],function(){S()},function(B,$){I($)})})}).catch(I)});return w(m,f),m}function ih(f){var b=this,m=new E(function(S,I){b.ready().then(function(){var C=b._dbInfo;C.db.transaction(function(R){Vn(R,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function(B,$){var G=$.rows.item(0).c;S(G)},function(B,$){I($)})})}).catch(I)});return w(m,f),m}function oh(f,b){var m=this,S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(B){Vn(B,R,"SELECT key FROM "+R.storeName+" WHERE id = ? LIMIT 1",[f+1],function($,G){var z=G.rows.length?G.rows.item(0).key:null;I(z)},function($,G){C(G)})})}).catch(C)});return w(S,b),S}function sh(f){var b=this,m=new E(function(S,I){b.ready().then(function(){var C=b._dbInfo;C.db.transaction(function(R){Vn(R,C,"SELECT key FROM "+C.storeName,[],function(B,$){for(var G=[],z=0;z<$.rows.length;z++)G.push($.rows.item(z).key);S(G)},function(B,$){I($)})})}).catch(I)});return w(m,f),m}function ah(f){return new E(function(b,m){f.transaction(function(S){S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(I,C){for(var R=[],B=0;B<C.rows.length;B++)R.push(C.rows.item(B).name);b({db:f,storeNames:R})},function(I,C){m(C)})},function(S){m(S)})})}function ch(f,b){b=L.apply(this,arguments);var m=this.config();f=typeof f!="function"&&f||{},f.name||(f.name=f.name||m.name,f.storeName=f.storeName||m.storeName);var S=this,I;return f.name?I=new E(function(C){var R;f.name===m.name?R=S._dbInfo.db:R=openDatabase(f.name,"","",0),f.storeName?C({db:R,storeNames:[f.storeName]}):C(ah(R))}).then(function(C){return new E(function(R,B){C.db.transaction(function($){function G(Ue){return new E(function(He,st){$.executeSql("DROP TABLE IF EXISTS "+Ue,[],function(){He()},function(tt,Wt){st(Wt)})})}for(var z=[],ie=0,xe=C.storeNames.length;ie<xe;ie++)z.push(G(C.storeNames[ie]));E.all(z).then(function(){R()}).catch(function(Ue){B(Ue)})},function($){B($)})})}):I=E.reject("Invalid arguments"),w(I,b),I}var lh={_driver:"webSQLStorage",_initStorage:Jp,_support:h(),iterate:eh,getItem:Qp,setItem:th,removeItem:nh,clear:rh,length:ih,key:oh,keys:sh,dropInstance:ch};function uh(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function hl(f,b){var m=f.name+"/";return f.storeName!==b.storeName&&(m+=f.storeName+"/"),m}function dh(){var f="_localforage_support_test";try{return localStorage.setItem(f,!0),localStorage.removeItem(f),!1}catch{return!0}}function fh(){return!dh()||localStorage.length>0}function ph(f){var b=this,m={};if(f)for(var S in f)m[S]=f[S];return m.keyPrefix=hl(f,b._defaultConfig),fh()?(b._dbInfo=m,m.serializer=bs,E.resolve()):E.reject()}function hh(f){var b=this,m=b.ready().then(function(){for(var S=b._dbInfo.keyPrefix,I=localStorage.length-1;I>=0;I--){var C=localStorage.key(I);C.indexOf(S)===0&&localStorage.removeItem(C)}});return w(m,f),m}function mh(f,b){var m=this;f=M(f);var S=m.ready().then(function(){var I=m._dbInfo,C=localStorage.getItem(I.keyPrefix+f);return C&&(C=I.serializer.deserialize(C)),C});return w(S,b),S}function gh(f,b){var m=this,S=m.ready().then(function(){for(var I=m._dbInfo,C=I.keyPrefix,R=C.length,B=localStorage.length,$=1,G=0;G<B;G++){var z=localStorage.key(G);if(z.indexOf(C)===0){var ie=localStorage.getItem(z);if(ie&&(ie=I.serializer.deserialize(ie)),ie=f(ie,z.substring(R),$++),ie!==void 0)return ie}}});return w(S,b),S}function _h(f,b){var m=this,S=m.ready().then(function(){var I=m._dbInfo,C;try{C=localStorage.key(f)}catch{C=null}return C&&(C=C.substring(I.keyPrefix.length)),C});return w(S,b),S}function vh(f){var b=this,m=b.ready().then(function(){for(var S=b._dbInfo,I=localStorage.length,C=[],R=0;R<I;R++){var B=localStorage.key(R);B.indexOf(S.keyPrefix)===0&&C.push(B.substring(S.keyPrefix.length))}return C});return w(m,f),m}function yh(f){var b=this,m=b.keys().then(function(S){return S.length});return w(m,f),m}function Eh(f,b){var m=this;f=M(f);var S=m.ready().then(function(){var I=m._dbInfo;localStorage.removeItem(I.keyPrefix+f)});return w(S,b),S}function bh(f,b,m){var S=this;f=M(f);var I=S.ready().then(function(){b===void 0&&(b=null);var C=b;return new E(function(R,B){var $=S._dbInfo;$.serializer.serialize(b,function(G,z){if(z)B(z);else try{localStorage.setItem($.keyPrefix+f,G),R(C)}catch(ie){(ie.name==="QuotaExceededError"||ie.name==="NS_ERROR_DOM_QUOTA_REACHED")&&B(ie),B(ie)}})})});return w(I,m),I}function wh(f,b){if(b=L.apply(this,arguments),f=typeof f!="function"&&f||{},!f.name){var m=this.config();f.name=f.name||m.name,f.storeName=f.storeName||m.storeName}var S=this,I;return f.name?I=new E(function(C){f.storeName?C(hl(f,S._defaultConfig)):C(f.name+"/")}).then(function(C){for(var R=localStorage.length-1;R>=0;R--){var B=localStorage.key(R);B.indexOf(C)===0&&localStorage.removeItem(B)}}):I=E.reject("Invalid arguments"),w(I,b),I}var Ch={_driver:"localStorageWrapper",_initStorage:ph,_support:uh(),iterate:gh,getItem:mh,setItem:bh,removeItem:Eh,clear:hh,length:yh,key:_h,keys:vh,dropInstance:wh},Sh=function(b,m){return b===m||typeof b=="number"&&typeof m=="number"&&isNaN(b)&&isNaN(m)},Th=function(b,m){for(var S=b.length,I=0;I<S;){if(Sh(b[I],m))return!0;I++}return!1},ml=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},Jr={},gl={},fr={INDEXEDDB:_e,WEBSQL:lh,LOCALSTORAGE:Ch},Ih=[fr.INDEXEDDB._driver,fr.WEBSQL._driver,fr.LOCALSTORAGE._driver],Bi=["dropInstance"],ws=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Bi),xh={description:"",driver:Ih.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Oh(f,b){f[b]=function(){var m=arguments;return f.ready().then(function(){return f[b].apply(f,m)})}}function Cs(){for(var f=1;f<arguments.length;f++){var b=arguments[f];if(b)for(var m in b)b.hasOwnProperty(m)&&(ml(b[m])?arguments[0][m]=b[m].slice():arguments[0][m]=b[m])}return arguments[0]}var Ah=function(){function f(b){a(this,f);for(var m in fr)if(fr.hasOwnProperty(m)){var S=fr[m],I=S._driver;this[m]=I,Jr[I]||this.defineDriver(S)}this._defaultConfig=Cs({},xh),this._config=Cs({},this._defaultConfig,b),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return f.prototype.config=function(m){if((typeof m>"u"?"undefined":s(m))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var S in m){if(S==="storeName"&&(m[S]=m[S].replace(/\W/g,"_")),S==="version"&&typeof m[S]!="number")return new Error("Database version must be a number.");this._config[S]=m[S]}return"driver"in m&&m.driver?this.setDriver(this._config.driver):!0}else return typeof m=="string"?this._config[m]:this._config},f.prototype.defineDriver=function(m,S,I){var C=new E(function(R,B){try{var $=m._driver,G=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!m._driver){B(G);return}for(var z=ws.concat("_initStorage"),ie=0,xe=z.length;ie<xe;ie++){var Ue=z[ie],He=!Th(Bi,Ue);if((He||m[Ue])&&typeof m[Ue]!="function"){B(G);return}}var st=function(){for(var Qr=function(Rh){return function(){var Mh=new Error("Method "+Rh+" is not implemented by the current driver"),_l=E.reject(Mh);return w(_l,arguments[arguments.length-1]),_l}},Ss=0,Nh=Bi.length;Ss<Nh;Ss++){var Ts=Bi[Ss];m[Ts]||(m[Ts]=Qr(Ts))}};st();var tt=function(Qr){Jr[$]&&console.info("Redefining LocalForage driver: "+$),Jr[$]=m,gl[$]=Qr,R()};"_support"in m?m._support&&typeof m._support=="function"?m._support().then(tt,B):tt(!!m._support):tt(!0)}catch(Wt){B(Wt)}});return N(C,S,I),C},f.prototype.driver=function(){return this._driver||null},f.prototype.getDriver=function(m,S,I){var C=Jr[m]?E.resolve(Jr[m]):E.reject(new Error("Driver not found."));return N(C,S,I),C},f.prototype.getSerializer=function(m){var S=E.resolve(bs);return N(S,m),S},f.prototype.ready=function(m){var S=this,I=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return N(I,m,m),I},f.prototype.setDriver=function(m,S,I){var C=this;ml(m)||(m=[m]);var R=this._getSupportedDrivers(m);function B(){C._config.driver=C.driver()}function $(ie){return C._extend(ie),B(),C._ready=C._initStorage(C._config),C._ready}function G(ie){return function(){var xe=0;function Ue(){for(;xe<ie.length;){var He=ie[xe];return xe++,C._dbInfo=null,C._ready=null,C.getDriver(He).then($).catch(Ue)}B();var st=new Error("No available storage method found.");return C._driverSet=E.reject(st),C._driverSet}return Ue()}}var z=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=z.then(function(){var ie=R[0];return C._dbInfo=null,C._ready=null,C.getDriver(ie).then(function(xe){C._driver=xe._driver,B(),C._wrapLibraryMethodsWithReady(),C._initDriver=G(R)})}).catch(function(){B();var ie=new Error("No available storage method found.");return C._driverSet=E.reject(ie),C._driverSet}),N(this._driverSet,S,I),this._driverSet},f.prototype.supports=function(m){return!!gl[m]},f.prototype._extend=function(m){Cs(this,m)},f.prototype._getSupportedDrivers=function(m){for(var S=[],I=0,C=m.length;I<C;I++){var R=m[I];this.supports(R)&&S.push(R)}return S},f.prototype._wrapLibraryMethodsWithReady=function(){for(var m=0,S=ws.length;m<S;m++)Oh(this,ws[m])},f.prototype.createInstance=function(m){return new f(m)},f}(),Dh=new Ah;i.exports=Dh},{3:3}]},{},[4])(4)})});var Lh={schedule(t,e){let n=setTimeout(t,e);return()=>clearTimeout(n)}};function Fh(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function kh(t){return!!t&&t.nodeType===Node.ELEMENT_NODE}var Us;function Vh(t,e){if(!Us){let n=Element.prototype;Us=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE?Us.call(t,e):!1}function Bh(t){let e={};return t.forEach(({propName:n,templateName:r,transform:i})=>{e[Fh(r)]=[n,i]}),e}function Uh(t,e){return e.get(As).resolveComponentFactory(t).inputs}function Hh(t,e){let n=t.childNodes,r=e.map(()=>[]),i=-1;e.some((o,s)=>o==="*"?(i=s,!0):!1);for(let o=0,s=n.length;o<s;++o){let a=n[o],u=jh(a,e,i);u!==-1&&r[u].push(a)}return r}function jh(t,e,n){let r=n;return kh(t)&&e.some((i,o)=>i!=="*"&&Vh(t,i)?(r=o,!0):!1),r}var $h=10,Hs=class{componentFactory;inputMap=new Map;constructor(e,n){this.componentFactory=n.get(As).resolveComponentFactory(e);for(let r of this.componentFactory.inputs)this.inputMap.set(r.propName,r.templateName)}create(e){return new js(this.componentFactory,e,this.inputMap)}},js=class{componentFactory;injector;inputMap;eventEmitters=new wl(1);events=this.eventEmitters.pipe(Nl(e=>Hi(...e)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(e,n,r){this.componentFactory=e,this.injector=n,this.inputMap=r,this.ngZone=this.injector.get(Pt),this.appRef=this.injector.get(Wi),this.cdScheduler=n.get(Pl),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(e){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(e)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=Lh.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},$h))})}getInputValue(e){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(e):this.componentRef.instance[e])}setInputValue(e,n){if(this.componentRef===null){this.initialInputValues.set(e,n);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(e)??e,n),this.componentRef.hostView.dirty&&(this.componentRef.changeDetectorRef.markForRefresh(),this.cdScheduler.notify(6))})}initializeComponent(e){let n=Mt.create({providers:[],parent:this.injector}),r=Hh(e,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(n,r,e),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[e,n]of this.initialInputValues)this.setInputValue(e,n);this.initialInputValues.clear()}initializeOutputs(e){let n=this.componentFactory.outputs.map(({propName:r,templateName:i})=>{let o=e.instance[r];return new El(s=>{let a=o.subscribe(u=>s.next({name:i,value:u}));return()=>a.unsubscribe()})});this.eventEmitters.next(n)}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}},$s=class extends HTMLElement{ngElementEventsSubscription=null};function nu(t,e){let n=Uh(t,e.injector),r=e.strategyFactory||new Hs(t,e.injector),i=Bh(n);class o extends $s{injector;static observedAttributes=Object.keys(i);get ngElementStrategy(){if(!this._ngElementStrategy){let a=this._ngElementStrategy=r.create(this.injector||e.injector);n.forEach(({propName:u,transform:d})=>{if(!this.hasOwnProperty(u))return;let g=this[u];delete this[u],a.setInputValue(u,g,d)})}return this._ngElementStrategy}_ngElementStrategy;constructor(a){super(),this.injector=a}attributeChangedCallback(a,u,d,g){let[p,E]=i[a];this.ngElementStrategy.setInputValue(p,d,E)}connectedCallback(){let a=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),a=!0),this.ngElementStrategy.connect(this),a||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(a=>{let u=new CustomEvent(a.name,{detail:a.value});this.dispatchEvent(u)})}}return n.forEach(({propName:s,transform:a})=>{Object.defineProperty(o.prototype,s,{get(){return this.ngElementStrategy.getInputValue(s)},set(u){this.ngElementStrategy.setInputValue(s,u,a)},configurable:!0,enumerable:!0})}),o}var ru="9.13.2";var Xe=class t{static SDK_VERSION=ru;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_EXPERIMENT_START="CE Experiment Start";static EVENT_VIDEO_DIALOG_CLOSED="CE Video Dialog Closed";static EVENT_VIDEO_DIALOG_OPENED="CE Video Dialog Opened";static EVENT_VIDEO_CHANGE="CE Video Changed";static EVENT_LAST_VIDEO_ENDED="CE Last Video Ended";static EVENT_VIDEO_MUTED="CE Video Muted";static EVENT_VIDEO_UNMUTED="CE Video Unmuted";static EVENT_ADD_TO_CART_CLICKED="CE Add To Cart Clicked";static EVENT_VIEW_ITEM_CLICKED="CE View Item Clicked";static EVENT_MORE_ITEM_INFO_CLICKED="CE More Item Info Clicked";static EVENT_OPEN_CART_CLICKED="CE Open Cart Clicked";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_OPEN_CART="Open Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static CTA_AFTER_REFRESH_UI="letscooee:outbound:refresh-ui";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static PAYMENT_MODAL_DETAILS=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}];static{let e=t.SDK_VERSION.split(".").map(n=>n.padStart(2,"0")).join("");t.SDK_VERSION_CODE=parseInt(e,10)}};var Dn={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Xe.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Xe.SDK_VERSION}/dist/widget.min.js`};var Ut=ti(ou());var ut=class{static log(...e){Ut.default.info(...e)}static debug(...e){Ut.default.debug(...e)}static error(...e){Ut.default.error(...e)}static warn(...e){Ut.default.warn(...e)}static info(...e){Ut.default.info(...e)}static trace(...e){Ut.default.trace(...e)}};function su(t=Xe.LOG_PREFIX){Ut.default.useDefaults({formatter:function(n){n.unshift(`${t} (v${Xe.SDK_VERSION}):`)}});let e=Wh();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Ut.default.setLevel(Ut.default[localStorage.cooeeLogLevel]):Ut.default.setLevel(Dn.debug?Ut.default.TRACE:Ut.default.OFF)}function Wh(){return new URL(location.href).searchParams?.get("cooee-debug")}var ki=ti(Qi());var cu={providers:[$l()]};var zh={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},KE=Ce(O({},zh),{"[class.ng-submitted]":"isSubmitted"});var Kh=new nn("",{providedIn:"root",factory:()=>du}),du="always";var Xh=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=Xn({type:t});static \u0275inj=zn({})}return t})();var fu=(()=>{class t{static withConfig(n){return{ngModule:t,providers:[{provide:Kh,useValue:n.callSetDisabledState??du}]}}static \u0275fac=function(r){return new(r||t)};static \u0275mod=Xn({type:t});static \u0275inj=zn({imports:[Xh]})}return t})();var zt=class{static SWIPER_CSS="https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css";static injectScriptURL(e,n){if(!e)return;let r=document.createElement("script");r.id=n??"",r.src=e,r.type="module",document.head.appendChild(r)}static injectRawScript(e){if(!e)return;let n=document.createElement("script");n.id="cooee-app-script",n.innerHTML=e,document.head.appendChild(n)}static injectRawCSS(e,n=document.head){if(!e)return;let r=document.createElement("style");r.textContent=e,n.appendChild(r)}static injectSwiperCSS(e=document.head){this.injectStylesheet(this.SWIPER_CSS,e)}static injectStylesheet(e,n=document.head){if(!e)return;let r=document.createElement("link");r.rel="stylesheet",r.href=e,e===this.SWIPER_CSS&&(r.crossOrigin="anonymous",r.onload=i=>{let s=i.currentTarget?.sheet?.cssRules;if(s){for(let a of s)if(a.type==CSSRule.FONT_FACE_RULE){let u=e.split("/"),d=u.slice(0,u.length-1).join("/"),g=a.cssText;g=g.replace(/url\s*\(\s*['"]?(?!((\/)|((?:https?:)?\/\/)|(?:data:?:)))([^'")]+)['"]?\s*\)/g,`url("${d}/$4")`);let p=document.createElement("style");p.appendChild(document.createTextNode(g)),document.head.appendChild(p)}}}),n.appendChild(r)}static async loadSwiperScript(){window.CooeeSDK.Swiper||(window.CooeeSDK.Swiper=(await import("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.mjs")).Swiper)}};var Kt=class t{cooeeEvent=new at;cooeeCTA=new at;elementRef=q(Tt);_engagementTrigger=Lt(null);_triggerContext=Lt(null);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let e=["letscooee-widget"],n=this._engagementTrigger();return e.push(`widget-${n?.shortID}`),e}get triggerContext(){return this._triggerContext()}set triggerContext(e){this._triggerContext.set(e),this._engagementTrigger.set(e.triggerData),this.engagementTriggerReceived(e.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){ut.debug("Init",this.constructor.name);let e=this.elementRef.nativeElement.shadowRoot;e&&(zt.injectStylesheet(Dn.styleURL,e),zt.injectRawCSS(window.CooeeSDK.config.website.commonCSS,e))}ngOnDestroy(){ut.debug("Destroying",this.constructor.name)}sendEventToRenderer(e){this.cooeeEvent.emit(e)}executeCTAViaRenderer(e){this.cooeeCTA.emit(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Me({type:t,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&Bl(r.classes)},inputs:{triggerContext:"triggerContext"},outputs:{cooeeEvent:"cooeeEvent",cooeeCTA:"cooeeCTA"},decls:0,vars:0,template:function(n,r){},encapsulation:2})};var qh=(t,e)=>({"--option-color":t,"background-color":e}),pu=(t,e)=>e.id;function Zh(t,e){if(t&1&&(W(0,"span",6),Ae(1),Y()),t&2){Z();let n=Ke(1);k(),ln(n)}}function Jh(t,e){if(t&1){let n=ze();ct(0)(1)(2),W(3,"button",5),Pe("click",function(){let i=Ne(n).$implicit,o=Z().$implicit,s=Z();return Re(s.onOptionChange(o,i))}),Oe(4,Zh,2,1,"span",6),Y()}if(t&2){let n,r=e.$implicit,i=Z().$implicit,o=Ke(1),s=Z(),a=r.name;k();let u=vt(r.displayName||r.name),d=o?(n=r.hexColor)!==null&&n!==void 0?n:a:"";k(2),Ps("color-type",o)("selected",s.selectedOptions()[i.name]===a),de("disabled",r.disabled)("title",u)("ngStyle",zi(10,qh,d,d)),wn("data-value",a),k(),Te(o?-1:4)}}function Qh(t,e){if(t&1&&(W(0,"div"),ct(1),W(2,"div",1),Ae(3),Y(),W(4,"div",2),Ae(5),Y(),W(6,"div",3),nt(7,Jh,5,13,"button",4,pu),Y()()),t&2){let n=e.$implicit,r=Z();Ul("option-group ",n.name.toLowerCase(),""),k(),vt(r.hasHexColors(n)),k(2),It("",n.name,":"),k(2),ln(r.selectedOptions()[n.name]),k(2),rt(n.optionValues)}}var yr=class t extends Kt{selectedVariant=new at;item=hr.required();selectedOptions=Lt({});options=vr(()=>{let e=this.item();if(!e.options||e.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(e,this.engagementTrigger)}catch(n){ut.error(n)}return e.options});matchedVariant=vr(()=>{let e=this.item(),n=this.selectedOptions();return e.vars.find(r=>e.options.every(i=>n[i.name]===r.selectedOptions.find(o=>o.name===i.name)?.value))});constructor(){super(),ks(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let e=ks(()=>{let n=this.item();if(!n?.options)return;let r=O({},this.selectedOptions());n.options.forEach(i=>{let o=n.vars[0]?.selectedOptions.find(s=>s.name===i.name)?.value;o&&(r[i.name]=o)}),this.selectedOptions.set(r),e.destroy()})}onOptionChange(e,n){let r=O({},this.selectedOptions());r[e.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(e){return!!e.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Me({type:t,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[wt],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],[1,"option-values"],[1,"option-value",3,"disabled","color-type","selected","title","ngStyle"],[1,"option-value",3,"click","disabled","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&nt(0,Qh,9,6,"div",0,pu),n&2&&rt(r.options())},dependencies:[Kl,Yl,fu],styles:[`.option-group{display:flex;gap:4px;align-items:center}.option-group+.option-group{margin-top:8px}.option-values{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:6px;gap:4px}.selected-value{display:none}.option-value{padding:5px 10px;border:1px solid #ccc;cursor:pointer;border-radius:4px;min-width:32px;min-height:32px;text-align:center;position:relative;--selected-color: var(--option-color, rgb(var(--lc-color-button, 0 0 0)))}.option-value.selected{box-shadow:#fff 0 0 0 2px,var(--selected-color) 0 0 0 4px}
|
|
11
11
|
`],encapsulation:3})};var Gs=function(t){return t.SHOPIFY_CHECKOUT="shopify_checkout",t.THIRD_PARTY_CHECKOUT="third_party_checkout",t.CART_PAGE="cart_page",t.CART_DRAWER="cart_drawer",t}(Gs||{});var Xt=function(t){return t[t.NONE=0]="NONE",t[t.REJECT_POPUP=1]="REJECT_POPUP",t[t.ACCEPT_POPUP=2]="ACCEPT_POPUP",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",t[t.OPEN_CART=105]="OPEN_CART",t[t.SUBMIT_FORM=106]="SUBMIT_FORM",t[t.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",t[t.ADD_BUNDLE=108]="ADD_BUNDLE",t[t.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",t}(Xt||{});var ai=function(t){return t.FREE_SHIPPING="FREE_SHIPPING",t.DISCOUNT="DISCOUNT",t.FREE_AUTO_GIFT="FREE_AUTO_GIFT",t.FREE_GIFT_SELECT="FREE_GIFT_SELECT",t.UI_ONLY="UI_ONLY",t}(ai||{});var Er=class{id;mID;vID;vName;imageURL;name;link;quantity;price;finalPrice;constructor(e){this.id=e.id,this.mID=e.mID,this.vID=e.vID,this.vName=e.vName,this.imageURL=e.imageURL,this.name=e.name,this.link=e.link,this.quantity=e.quantity,this.price=e.price,this.finalPrice=e.finalPrice??e.price}};var Ws=(n=>(n.CART_AMOUNT="CART_AMOUNT",n.ITEM_COUNT="ITEM_COUNT",n))(Ws||{});var br=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(e){return e??={},this.gaEnabled=e.gaEnabled,this.gaMeasurementID=e.gaMeasurementID,this.pixelPush=e.pixelPush,this.website=e.website??{},this.currencyCount=e.currencyCount??0,this.money=e.money,this.currency=e.currency,this.storefrontToken=e.storefrontToken,this.skipItemAttribute=e.skipItemAttribute,this}};var fe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Se=globalThis;var un="9.42.0";function Zn(){return Jn(Se),Se}function Jn(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||un,e[un]=e[un]||{}}function Nn(t,e,n=Se){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[un]=r[un]||{};return i[t]||(i[t]=e())}var Ys=["debug","info","warn","error","log","assert","trace"],em="Sentry Logger ",wr={};function Hn(t){if(!("console"in Se))return t();let e=Se.console,n={},r=Object.keys(wr);r.forEach(i=>{let o=wr[i];n[i]=e[i],e[i]=o});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function tm(){Ks().enabled=!0}function nm(){Ks().enabled=!1}function hu(){return Ks().enabled}function rm(...t){zs("log",...t)}function im(...t){zs("warn",...t)}function om(...t){zs("error",...t)}function zs(t,...e){fe&&hu()&&Hn(()=>{Se.console[t](`${em}[${t}]:`,...e)})}function Ks(){return fe?Nn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var ne={enable:tm,disable:nm,isEnabled:hu,log:rm,warn:im,error:om};var dn="?",mu=/\(error: (.*)\)/,gu=/captureMessage|captureException/;function qs(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{let o=[],s=n.split(`
|
|
12
12
|
`);for(let a=r;a<s.length;a++){let u=s[a];if(u.length>1024)continue;let d=mu.test(u)?u.replace(mu,"$1"):u;if(!d.match(/\S*Error: /)){for(let g of e){let p=g(d);if(p){o.push(p);break}}if(o.length>=50+i)break}}return _u(o.slice(i))}}function _u(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(eo(e).function||"")&&e.pop(),e.reverse(),gu.test(eo(e).function||"")&&(e.pop(),gu.test(eo(e).function||"")&&e.pop()),e.slice(0,50).map(n=>Ce(O({},n),{filename:n.filename||eo(e).filename,function:n.function||dn}))}function eo(t){return t[t.length-1]||{}}var Xs="<anonymous>";function qt(t){try{return!t||typeof t!="function"?Xs:t.name||Xs}catch{return Xs}}function to(t){let e=t.exception;if(e){let n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}var no={},vu={};function Ot(t,e){no[t]=no[t]||[],no[t].push(e)}function At(t,e){if(!vu[t]){vu[t]=!0;try{e()}catch(n){fe&&ne.error(`Error while instrumenting ${t}`,n)}}}function dt(t,e){let n=t&&no[t];if(n)for(let r of n)try{r(e)}catch(i){fe&&ne.error(`Error while triggering instrumentation handler.
|
|
13
13
|
Type: ${t}
|
|
@@ -25,7 +25,7 @@ Event: ${fn(t)}.
|
|
|
25
25
|
Url: ${Io(t)}`),!0}return!1}function yg(t,e){return e?.length?wo(t).some(n=>Tr(n,e)):!1}function Eg(t,e){if(!e?.length)return!1;let n=t.transaction;return n?Tr(n,e):!1}function bg(t,e){if(!e?.length)return!1;let n=Io(t);return n?Tr(n,e):!1}function wg(t,e){if(!e?.length)return!0;let n=Io(t);return n?Tr(n,e):!0}function Cg(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Io(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Cg(n):null}catch{return fe&&ne.error(`Cannot extract url for event ${fn(t)}`),null}}function Sg(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function Ba(t,e,n,r,i,o){if(!i.exception?.values||!o||!sn(o.originalException,Error))return;let s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=Va(t,e,r,o.originalException,n,i.exception.values,s,0))}function Va(t,e,n,r,i,o,s,a){if(o.length>=n+1)return o;let u=[...o];if(sn(r[i],Error)){Dd(s,a);let d=t(e,r[i]),g=u.length;Nd(d,i,g,a),u=Va(t,e,n,r[i],i,[d,...u],d,g)}return Array.isArray(r.errors)&&r.errors.forEach((d,g)=>{if(sn(d,Error)){Dd(s,a);let p=t(e,d),E=u.length;Nd(p,`errors[${g}]`,E,a),u=Va(t,e,n,d,i,[p,...u],p,E)}}),u}function Dd(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Ce(O(O({},t.mechanism),t.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:e})}function Nd(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Ce(O({},t.mechanism),{type:"chained",source:e,exception_id:n,parent_id:r})}function Ua(t){let e="console";Ot(e,t),At(e,Tg)}function Tg(){"console"in Se&&Ys.forEach(function(t){t in Se.console&&ft(Se.console,t,function(e){return wr[t]=e,function(...n){dt("console",{args:n,level:t}),wr[t]?.apply(Se.console,n)}})})}function Ha(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var Ig="Dedupe",xg=()=>{let t;return{name:Ig,processEvent(e){if(e.type)return e;try{if(Og(e,t))return fe&&ne.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Oo=xg;function Og(t,e){return e?!!(Ag(t,e)||Dg(t,e)):!1}function Ag(t,e){let n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Pd(t,e)||!Md(t,e))}function Dg(t,e){let n=Rd(e),r=Rd(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Pd(t,e)||!Md(t,e))}function Md(t,e){let n=to(t),r=to(e);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){let o=r[i],s=n[i];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function Pd(t,e){let n=t.fingerprint,r=e.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function Rd(t){return t.exception?.values?.[0]}function vi(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Ao(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var yi=Se;function ja(){return"history"in yi&&!!yi.history}function Ng(){if(!("fetch"in yi))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function Ei(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function $a(){if(typeof EdgeRuntime=="string")return!0;if(!Ng())return!1;if(Ei(yi.fetch))return!0;let t=!1,e=yi.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow?.fetch&&(t=Ei(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){fe&&ne.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function Wa(t,e){let n="fetch";Ot(n,t),At(n,()=>Rg(void 0,e))}function Rg(t,e=!1){e&&!$a()||ft(Se,"fetch",function(n){return function(...r){let i=new Error,{method:o,url:s}=Mg(r),a={args:r,fetchData:{method:o,url:s},startTimestamp:Ft()*1e3,virtualError:i,headers:Pg(r)};return t||dt("fetch",O({},a)),n.apply(Se,r).then(async u=>(t?t(u):dt("fetch",Ce(O({},a),{endTimestamp:Ft()*1e3,response:u})),u),u=>{if(dt("fetch",Ce(O({},a),{endTimestamp:Ft()*1e3,error:u})),Qn(u)&&u.stack===void 0&&(u.stack=i.stack,jt(u,"framesToPop",1)),u instanceof TypeError&&(u.message==="Failed to fetch"||u.message==="Load failed"||u.message==="NetworkError when attempting to fetch resource."))try{let d=new URL(a.fetchData.url);u.message=`${u.message} (${d.host})`}catch{}throw u})}})}function Ga(t,e){return!!t&&typeof t=="object"&&!!t[e]}function Ld(t){return typeof t=="string"?t:t?Ga(t,"url")?t.url:t.toString?t.toString():"":""}function Mg(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:Ld(n),method:Ga(r,"method")?String(r.method).toUpperCase():"GET"}}let e=t[0];return{url:Ld(e),method:Ga(e,"method")?String(e.method).toUpperCase():"GET"}}function Pg(t){let[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Eu(e))return new Headers(e.headers)}catch{}}function Ya(){return"npm"}var Qe=Se,za=0;function Ka(){return za>0}function Xg(){za++,setTimeout(()=>{za--})}function rr(t,e={}){function n(i){return typeof i=="function"}if(!n(t))return t;try{let i=t.__sentry_wrapped__;if(i)return typeof i=="function"?i:t;if(nr(t))return t}catch{return t}let r=function(...i){try{let o=i.map(s=>rr(s,e));return t.apply(this,o)}catch(o){throw Xg(),di(s=>{s.addEventProcessor(a=>(e.mechanism&&(Ir(a,void 0,void 0),pn(a,e.mechanism)),a.extra=Ce(O({},a.extra),{arguments:i}),a)),Eo(o)}),o}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}so(r,t),jt(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function Fd(){let t=ui(),{referrer:e}=Qe.document||{},{userAgent:n}=Qe.navigator||{},r=O(O({},e&&{Referer:e}),n&&{"User-Agent":n});return{url:t,headers:r}}function Do(t,e){let n=Za(t,e),r={type:e_(e),value:t_(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function qg(t,e,n,r){let o=We()?.getOptions().normalizeDepth,s=i_(e),a={__serialized__:mo(e,o)};if(s)return{exception:{values:[Do(t,s)]},extra:a};let u={exception:{values:[{type:tr(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:n_(e,{isUnhandledRejection:r})}]},extra:a};if(n){let d=Za(t,n);d.length&&(u.exception.values[0].stacktrace={frames:d})}return u}function Xa(t,e){return{exception:{values:[Do(t,e)]}}}function Za(t,e){let n=e.stacktrace||e.stack||"",r=Jg(e),i=Qg(e);try{return t(n,r,i)}catch{}return[]}var Zg=/Minified React error #\d+;/i;function Jg(t){return t&&Zg.test(t.message)?1:0}function Qg(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function kd(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function e_(t){let e=t?.name;return!e&&kd(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function t_(t){let e=t?.message;return kd(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?e.error.message:e:"No error message"}function Vd(t,e,n,r){let i=n?.syntheticException||void 0,o=No(t,e,i,r);return pn(o),o.level="error",n?.event_id&&(o.event_id=n.event_id),Jt(o)}function Bd(t,e,n="info",r,i){let o=r?.syntheticException||void 0,s=qa(t,e,o,i);return s.level=n,r?.event_id&&(s.event_id=r.event_id),Jt(s)}function No(t,e,n,r,i){let o;if(ro(e)&&e.error)return Xa(t,e.error);if(io(e)||ta(e)){let s=e;if("stack"in e)o=Xa(t,e);else{let a=s.name||(io(s)?"DOMError":"DOMException"),u=s.message?`${a}: ${s.message}`:a;o=qa(t,u,n,r),Ir(o,u)}return"code"in s&&(o.tags=Ce(O({},o.tags),{"DOMException.code":`${s.code}`})),o}return Qn(e)?Xa(t,e):Rn(e)||tr(e)?(o=qg(t,e,n,i),pn(o,{synthetic:!0}),o):(o=qa(t,e,n,r),Ir(o,`${e}`,void 0),pn(o,{synthetic:!0}),o)}function qa(t,e,n,r){let i={};if(r&&n){let o=Za(t,n);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]}),pn(i,{synthetic:!0})}if(Sr(e)){let{__sentry_template_string__:o,__sentry_template_values__:s}=e;return i.logentry={message:o,params:s},i}return i.message=e,i}function n_(t,{isUnhandledRejection:e}){let n=aa(t),r=e?"promise rejection":"exception";return ro(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:tr(t)?`Event \`${r_(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function r_(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function i_(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let n=t[e];if(n instanceof Error)return n}}var o_=5e3,bi=class extends gi{constructor(e){let n=s_(e),r=Qe.SENTRY_SDK_SOURCE||Ya();Fa(n,"browser",["browser"],r),super(n);let{sendDefaultPii:i,sendClientReports:o,enableLogs:s,_experiments:a}=this._options,u=s??a?.enableLogs;Qe.document&&(o||u)&&Qe.document.addEventListener("visibilitychange",()=>{Qe.document.visibilityState==="hidden"&&(o&&this._flushOutcomes(),u&&_i(this))}),u&&(this.on("flush",()=>{_i(this)}),this.on("afterCaptureLog",()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{_i(this)},o_)})),i&&(this.on("postprocessEvent",Pa),this.on("beforeSendSession",La))}eventFromException(e,n){return Vd(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Bd(this._options.stackParser,e,n,r,this._options.attachStacktrace)}_prepareEvent(e,n,r,i){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r,i)}};function s_(t){return O({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:Qe.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},t)}var Ud=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var ht=Se;var a_=1e3,Hd,Ja,Qa;function ec(t){let e="dom";Ot(e,t),At(e,c_)}function c_(){if(!ht.document)return;let t=dt.bind(null,"dom"),e=jd(t,!0);ht.document.addEventListener("click",e,!1),ht.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let i=ht[n]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(ft(i,"addEventListener",function(o){return function(s,a,u){if(s==="click"||s=="keypress")try{let d=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},g=d[s]=d[s]||{refCount:0};if(!g.handler){let p=jd(t);g.handler=p,o.call(this,s,p,u)}g.refCount++}catch{}return o.call(this,s,a,u)}}),ft(i,"removeEventListener",function(o){return function(s,a,u){if(s==="click"||s=="keypress")try{let d=this.__sentry_instrumentation_handlers__||{},g=d[s];g&&(g.refCount--,g.refCount<=0&&(o.call(this,s,g.handler,u),g.handler=void 0,delete d[s]),Object.keys(d).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return o.call(this,s,a,u)}}))})}function l_(t){if(t.type!==Ja)return!1;try{if(!t.target||t.target._sentryId!==Qa)return!1}catch{}return!0}function u_(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function jd(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;let r=d_(n);if(u_(n.type,r))return;jt(n,"_sentryCaptured",!0),r&&!r._sentryId&&jt(r,"_sentryId",pt());let i=n.type==="keypress"?"input":n.type;l_(n)||(t({event:n,name:i,global:e}),Ja=n.type,Qa=r?r._sentryId:void 0),clearTimeout(Hd),Hd=ht.setTimeout(()=>{Qa=void 0,Ja=void 0},a_)}}function d_(t){try{return t.target}catch{return null}}var Ro;function wi(t){let e="history";Ot(e,t),At(e,f_)}function f_(){if(ht.addEventListener("popstate",()=>{let e=ht.location.href,n=Ro;if(Ro=e,n===e)return;dt("history",{from:n,to:e})}),!ja())return;function t(e){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let i=Ro,o=p_(String(r));if(Ro=o,i===o)return e.apply(this,n);dt("history",{from:i,to:o})}return e.apply(this,n)}}ft(ht.history,"pushState",t),ft(ht.history,"replaceState",t)}function p_(t){try{return new URL(t,ht.location.origin).toString()}catch{return t}}var Mo={};function tc(t){let e=Mo[t];if(e)return e;let n=ht[t];if(Ei(n))return Mo[t]=n.bind(ht);let r=ht.document;if(r&&typeof r.createElement=="function")try{let i=r.createElement("iframe");i.hidden=!0,r.head.appendChild(i);let o=i.contentWindow;o?.[t]&&(n=o[t]),r.head.removeChild(i)}catch(i){Ud&&ne.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return n&&(Mo[t]=n.bind(ht))}function Po(t){Mo[t]=void 0}var ir="__sentry_xhr_v3__";function nc(t){let e="xhr";Ot(e,t),At(e,h_)}function h_(){if(!ht.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){let i=new Error,o=Ft()*1e3,s=Dt(r[0])?r[0].toUpperCase():void 0,a=m_(r[1]);if(!s||!a)return e.apply(n,r);n[ir]={method:s,url:a,request_headers:{}},s==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let u=()=>{let d=n[ir];if(d&&n.readyState===4){try{d.status_code=n.status}catch{}let g={endTimestamp:Ft()*1e3,startTimestamp:o,xhr:n,virtualError:i};dt("xhr",g)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(d,g,p){return u(),d.apply(g,p)}}):n.addEventListener("readystatechange",u),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(d,g,p){let[E,w]=p,N=g[ir];return N&&Dt(E)&&Dt(w)&&(N.request_headers[E.toLowerCase()]=w),d.apply(g,p)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){let i=n[ir];if(!i)return e.apply(n,r);r[0]!==void 0&&(i.body=r[0]);let o={startTimestamp:Ft()*1e3,xhr:n};return dt("xhr",o),e.apply(n,r)}})}function m_(t){if(Dt(t))return t;try{return t.toString()}catch{}}function rc(t,e=tc("fetch")){let n=0,r=0;function i(o){let s=o.body.length;n+=s,r++;let a=O({body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15},t.fetchOptions);if(!e)return Po("fetch"),Wn("No fetch implementation available");try{return e(t.url,a).then(u=>(n-=s,r--,{statusCode:u.status,headers:{"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")}}))}catch(u){return Po("fetch"),n-=s,r--,Wn(u)}}return So(t,i)}var g_=30;var __=50;function ic(t,e,n,r){let i={filename:t,function:e==="<anonymous>"?dn:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var v_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,y_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,E_=/\((\S*)(?::(\d+))(?::(\d+))\)/,b_=t=>{let e=v_.exec(t);if(e){let[,r,i,o]=e;return ic(r,dn,+i,+o)}let n=y_.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){let s=E_.exec(n[2]);s&&(n[2]=s[1],n[3]=s[2],n[4]=s[3])}let[i,o]=Yd(n[1]||dn,n[2]);return ic(o,i,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},$d=[g_,b_],w_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,C_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,S_=t=>{let e=w_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let o=C_.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let r=e[3],i=e[1]||dn;return[i,r]=Yd(i,r),ic(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Gd=[__,S_];var Wd=[$d,Gd],oc=qs(...Wd),Yd=(t,e)=>{let n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:dn,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var Dr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Lo=1024,T_="Breadcrumbs",I_=(t={})=>{let e=O({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:T_,setup(n){e.console&&Ua(A_(n)),e.dom&&ec(O_(n,e.dom)),e.xhr&&nc(D_(n)),e.fetch&&Wa(N_(n)),e.history&&wi(R_(n)),e.sentry&&n.on("beforeSendEvent",x_(n))}}},zd=I_;function x_(t){return function(n){We()===t&&_n({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:fn(n)},{event:n})}}function O_(t,e){return function(r){if(We()!==t)return;let i,o,s=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>Lo&&(Dr&&ne.warn(`\`dom.maxStringLength\` cannot exceed ${Lo}, but a value of ${a} was configured. Sentry will use ${Lo} instead.`),a=Lo),typeof s=="string"&&(s=[s]);try{let d=r.event,g=M_(d)?d.target:d;i=li(g,{keyAttrs:s,maxStringLength:a}),o=sa(g)}catch{i="<unknown>"}if(i.length===0)return;let u={category:`ui.${r.name}`,message:i};o&&(u.data={"ui.component_name":o}),_n(u,{event:r.event,name:r.name,global:r.global})}}function A_(t){return function(n){if(We()!==t)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:Ha(n.level),message:oo(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${oo(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;_n(r,{input:n.args,level:n.level})}}function D_(t){return function(n){if(We()!==t)return;let{startTimestamp:r,endTimestamp:i}=n,o=n.xhr[ir];if(!r||!i||!o)return;let{method:s,url:a,status_code:u,body:d}=o,g={method:s,url:a,status_code:u},p={xhr:n.xhr,input:d,startTimestamp:r,endTimestamp:i},E={category:"xhr",data:g,type:"http",level:Ao(u)};t.emit("beforeOutgoingRequestBreadcrumb",E,p),_n(E,p)}}function N_(t){return function(n){if(We()!==t)return;let{startTimestamp:r,endTimestamp:i}=n;if(i&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.fetchData.method,n.fetchData.url,n.error){let o=n.fetchData,s={data:n.error,input:n.args,startTimestamp:r,endTimestamp:i},a={category:"fetch",data:o,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",a,s),_n(a,s)}else{let o=n.response,s=Ce(O({},n.fetchData),{status_code:o?.status});n.fetchData.request_body_size,n.fetchData.response_body_size,o?.status;let a={input:n.args,response:o,startTimestamp:r,endTimestamp:i},u={category:"fetch",data:s,type:"http",level:Ao(s.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",u,a),_n(u,a)}}}function R_(t){return function(n){if(We()!==t)return;let r=n.from,i=n.to,o=vi(Qe.location.href),s=r?vi(r):void 0,a=vi(i);s?.path||(s=o),o.protocol===a.protocol&&o.host===a.host&&(i=a.relative),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),_n({category:"navigation",data:{from:r,to:i}})}}function M_(t){return!!t&&!!t.target}var P_=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],L_="BrowserApiErrors",F_=(t={})=>{let e=O({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},t);return{name:L_,setupOnce(){e.setTimeout&&ft(Qe,"setTimeout",Kd),e.setInterval&&ft(Qe,"setInterval",Kd),e.requestAnimationFrame&&ft(Qe,"requestAnimationFrame",k_),e.XMLHttpRequest&&"XMLHttpRequest"in Qe&&ft(XMLHttpRequest.prototype,"send",V_);let n=e.eventTarget;n&&(Array.isArray(n)?n:P_).forEach(i=>B_(i,e))}}},Xd=F_;function Kd(t){return function(...e){let n=e[0];return e[0]=rr(n,{mechanism:{data:{function:qt(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function k_(t){return function(e){return t.apply(this,[rr(e,{mechanism:{data:{function:"requestAnimationFrame",handler:qt(t)},handled:!1,type:"instrument"}})])}}function V_(t){return function(...e){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&ft(n,i,function(o){let s={mechanism:{data:{function:i,handler:qt(o)},handled:!1,type:"instrument"}},a=nr(o);return a&&(s.mechanism.data.handler=qt(a)),rr(o,s)})}),t.apply(this,e)}}function B_(t,e){let r=Qe[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(ft(r,"addEventListener",function(i){return function(o,s,a){try{U_(s)&&(s.handleEvent=rr(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:qt(s),target:t},handled:!1,type:"instrument"}}))}catch{}return e.unregisterOriginalCallbacks&&H_(this,o,s),i.apply(this,[o,rr(s,{mechanism:{data:{function:"addEventListener",handler:qt(s),target:t},handled:!1,type:"instrument"}}),a])}}),ft(r,"removeEventListener",function(i){return function(o,s,a){try{let u=s.__sentry_wrapped__;u&&i.call(this,o,u,a)}catch{}return i.call(this,o,s,a)}}))}function U_(t){return typeof t.handleEvent=="function"}function H_(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}var qd=()=>({name:"BrowserSession",setupOnce(){if(typeof Qe.document>"u"){Dr&&ne.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}hi({ignoreDuration:!0}),mi(),wi(({from:t,to:e})=>{t!==void 0&&t!==e&&(hi({ignoreDuration:!0}),mi())})}});var j_="GlobalHandlers",$_=(t={})=>{let e=O({onerror:!0,onunhandledrejection:!0},t);return{name:j_,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(G_(n),Zd("onerror")),e.onunhandledrejection&&(W_(n),Zd("onunhandledrejection"))}}},Jd=$_;function G_(t){Js(e=>{let{stackParser:n,attachStacktrace:r}=Qd();if(We()!==t||Ka())return;let{msg:i,url:o,line:s,column:a,error:u}=e,d=K_(No(n,u||i,void 0,r,!1),o,s,a);d.level="error",pi(d,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function W_(t){ea(e=>{let{stackParser:n,attachStacktrace:r}=Qd();if(We()!==t||Ka())return;let i=Y_(e),o=er(i)?z_(i):No(n,i,void 0,r,!0);o.level="error",pi(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function Y_(t){if(er(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function z_(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function K_(t,e,n,r){let i=t.exception=t.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},a=s.stacktrace=s.stacktrace||{},u=a.frames=a.frames||[],d=r,g=n,p=Dt(e)&&e.length>0?e:ui();return u.length===0&&u.push({colno:d,filename:p,function:dn,in_app:!0,lineno:g}),t}function Zd(t){Dr&&ne.log(`Global Handler attached: ${t}`)}function Qd(){return We()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var ef=()=>({name:"HttpContext",preprocessEvent(t){if(!Qe.navigator&&!Qe.location&&!Qe.document)return;let e=Fd(),n=O(O({},e.headers),t.request?.headers);t.request=Ce(O(O({},e),t.request),{headers:n})}});var X_="cause",q_=5,Z_="LinkedErrors",J_=(t={})=>{let e=t.limit||q_,n=t.key||X_;return{name:Z_,preprocessEvent(r,i,o){let s=o.getOptions();Ba(Do,s.stackParser,n,e,r,i)}}},tf=J_;function sc(t){return[xo(),To(),Xd(),zd(),Jd(),tf(),Oo(),ef(),qd()]}var Ci=class t{static INSTANCE;contexts={};tags;client;user;constructor(){this.init()}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}captureError(e,n,r){ut.error(`${n}:`,e);let i=this.getNewScope(r);i.setTag("operation",n),i.captureException(e)}captureMessage(e,n,r){this.getNewScope(r).captureMessage(e,n??"error")}async captureFetchFailure(e,n,r){let i="";try{e=e.clone();let s=await e.json();i=JSON.stringify(s)}catch{}if(!i)try{i=await e.text()}catch{}let o=this.getNewScope(r);o.setTag("operation",n),o.setExtra("responseText",i),o.setExtra("statusText",e.statusText),this.captureMessage(`${n} failed with ${e.status}`,"error",r)}setGlobalContext(e,n){this.contexts[e]=O({context:n},this.contexts[e])}setUser(e){this.user=e}setTags(e){this.tags=e}getNewScope(e){e??={};let{extra:n,tags:r}=e,i=new Ct;if(i.setClient(this.client),i.setUser(this.user),e.triggerContext&&!e.engagementTrigger&&(e.engagementTrigger=e.triggerContext.triggerData),e.engagementTrigger){let o=e.engagementTrigger;i.setTags({"engagement.id":o.engagementID,"engagement.short_id":o.shortID,"engagement.objective":o.objective,"engagement.delivery_type":o.onsiteDeliveryType,"engagement.content_id":o.contentID,"engagement.variation":o.variation,"engagement.currency":o.currency})}return n&&i.setExtras(n),this.tags&&i.setTags(this.tags),r&&i.setTags(r),Object.keys(this.contexts).forEach(o=>{i.setContext(o,this.contexts[o])}),i.setTag("language",navigator.language),i.setTag("timezone",nf()),this.addShopifyTags(i),i}addShopifyTags(e){window.Shopify&&(e.setTag("shopify.shop",window.Shopify.shop),e.setTag("shopify.currency",window.Shopify.currency?.active),e.setTag("shopify.locale",window.Shopify.locale),e.setTag("theme.schema_name",window.Shopify.theme?.schema_name),e.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}init(){let e=sc({}).filter(n=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(n.name));this.client=new bi({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:rc,stackParser:oc,integrations:e,environment:Dn.mode,release:`web-sdk@${Xe.SDK_VERSION}`,debug:Dn.debug}),this.client.init()}};var Nr=class{static ID="id";static SESSION_LANDING_PAGE="landing";static SESSION_LAST_USED_TIME="lastUsedTime";static SESSION_SYNCED="synced";static APP_CONFIG="conf";static DEVICE_ID="did";static SDK_TOKEN="token";static FIRST_SEEN="firstSeen";static SESSION_NUMBER="sessionNumber";static GA_CLIENT_ID="gacid";static CURRENT_CART="cart";static MUTED="muted"};var cc=ti(of());function ko(t){return cc.default.createInstance({name:"lc",storeName:t,driver:cc.default.LOCALSTORAGE})}var Rr=class{static storage;static async get(e,n){return await this.storage?.getItem(e)??n}static set(e,n){return this.storage?.setItem(e,n)}static remove(e){return this.storage?.removeItem(e)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var lc=class extends Rr{static storeName="ses";static{this.storage=ko(this.storeName)}};var Mr=class extends Rr{static storeName="usr";static{this.storage=ko(this.storeName)}};var Vo=class{static format(e,n){let r=/{{\s*(\w+)\s*}}/;return n.replace(r,(i,o)=>{switch(o){case"amount":return this.formatWithDelimiters(e,2);case"amount_no_decimals":return this.formatWithDelimiters(e,0);case"amount_with_comma_separator":return this.formatWithDelimiters(e,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(e,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(e,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(e,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(e,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(e,2," ",".");default:return i}})}static formatWithDelimiters(e,n=2,r=",",i="."){if(isNaN(e)||e==null)return"0";let s=(e/100).toFixed(n).split("."),a=s[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),u=s[1]?i+s[1]:"";return a+u}};var Bo=class{isCartDirty=!0;cartEngagements;isGoKwikPopupOpen;previewIDs;previewVariant;pageName;moneyFormat;jsLoadTime=new Date;shopCurrencyCode;locale;activeExperiment;inInactive=!1;lastEnterActive=new Date;lastEnterInactive=null;currentItem;_currencyCode;get currencyCode(){return this._currencyCode}set currencyCode(e){this._currencyCode=e}static get(){return window.CooeeSDK.runtimeData}isInactive(){return this.inInactive}async setInactive(){return this.inInactive?0:(this.inInactive=!0,this.lastEnterInactive=new Date,Math.max((this.lastEnterInactive.getTime()-this.lastEnterActive.getTime())/1e3,0))}setActive(){return this.inInactive?(this.inInactive=!1,this.lastEnterActive=new Date,Math.max((this.lastEnterActive.getTime()-this.lastEnterInactive.getTime())/1e3,0)):0}isFirstActive(){return this.lastEnterInactive==null}getCurrentItem(){return this.currentItem}setCurrentItem(e){this.currentItem=new Er(e)}};function Fn(t,e){if(t==0&&e)return"Free";let n=Bo.get(),r=br.get(),i=n.shopCurrencyCode||r.currency,o=n.currencyCode;o||ut.warn("Currency code is not set in RuntimeData");let s=r.money?.format??n.moneyFormat,a;if(s&&i===o)a=Vo.format(t*100,s);else{let u;try{u=new Intl.NumberFormat(Q_(),{style:"currency",currency:o||i,minimumFractionDigits:0,maximumFractionDigits:2})}catch(d){return Ci.getInstance().captureError(d,"format-currency",{extra:{currentCurrency:o,shopCurrency:i}}),""}a=u.format(t),a=a.replace("\u20B9","Rs. "),r.money?.showCurrency&&o!=="INR"&&(a=a.concat(` ${o}`))}return a}function Q_(){return navigator.languages!==void 0?navigator.languages[0].split("-")[0]:navigator.language??"en"}var Uo;function nf(){if(Uo)return Uo;try{return Uo=Intl.DateTimeFormat().resolvedOptions().timeZone,Uo}catch{return""}}var vn=class t{transform(e){return e==null?null:Fn(e)}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=Gi({name:"cooeeCurrency",type:t,pure:!0})};var ev=Object.prototype.toString,Lr=Array.isArray||function(e){return ev.call(e)==="[object Array]"};function dc(t){return typeof t=="function"}function tv(t){return Lr(t)?"array":typeof t}function uc(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function sf(t,e){return t!=null&&typeof t=="object"&&e in t}function nv(t,e){return t!=null&&typeof t!="object"&&t.hasOwnProperty&&t.hasOwnProperty(e)}var rv=RegExp.prototype.test;function iv(t,e){return rv.call(t,e)}var ov=/\S/;function sv(t){return!iv(ov,t)}var av={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function cv(t){return String(t).replace(/[&<>"'`=\/]/g,function(n){return av[n]})}var lv=/\s*/,uv=/\s+/,af=/\s*=/,dv=/\s*\}/,fv=/#|\^|\/|>|\{|&|=|!/;function pv(t,e){if(!t)return[];var n=!1,r=[],i=[],o=[],s=!1,a=!1,u="",d=0;function g(){if(s&&!a)for(;o.length;)delete i[o.pop()];else o=[];s=!1,a=!1}var p,E,w;function N(te){if(typeof te=="string"&&(te=te.split(uv,2)),!Lr(te)||te.length!==2)throw new Error("Invalid tags: "+te);p=new RegExp(uc(te[0])+"\\s*"),E=new RegExp("\\s*"+uc(te[1])),w=new RegExp("\\s*"+uc("}"+te[1]))}N(e||Qt.tags);for(var M=new Ti(t),L,j,K,se,X,be;!M.eos();){if(L=M.pos,K=M.scanUntil(p),K)for(var U=0,he=K.length;U<he;++U)se=K.charAt(U),sv(se)?(o.push(i.length),u+=se):(a=!0,n=!0,u+=" "),i.push(["text",se,L,L+1]),L+=1,se===`
|
|
26
26
|
`&&(g(),u="",d=0,n=!1);if(!M.scan(p))break;if(s=!0,j=M.scan(fv)||"name",M.scan(lv),j==="="?(K=M.scanUntil(af),M.scan(af),M.scanUntil(E)):j==="{"?(K=M.scanUntil(w),M.scan(dv),M.scanUntil(E),j="&"):K=M.scanUntil(E),!M.scan(E))throw new Error("Unclosed tag at "+M.pos);if(j==">"?X=[j,K,L,M.pos,u,d,n]:X=[j,K,L,M.pos],d++,i.push(X),j==="#"||j==="^")r.push(X);else if(j==="/"){if(be=r.pop(),!be)throw new Error('Unopened section "'+K+'" at '+L);if(be[1]!==K)throw new Error('Unclosed section "'+be[1]+'" at '+L)}else j==="name"||j==="{"||j==="&"?a=!0:j==="="&&N(K)}if(g(),be=r.pop(),be)throw new Error('Unclosed section "'+be[1]+'" at '+M.pos);return mv(hv(i))}function hv(t){for(var e=[],n,r,i=0,o=t.length;i<o;++i)n=t[i],n&&(n[0]==="text"&&r&&r[0]==="text"?(r[1]+=n[1],r[3]=n[3]):(e.push(n),r=n));return e}function mv(t){for(var e=[],n=e,r=[],i,o,s=0,a=t.length;s<a;++s)switch(i=t[s],i[0]){case"#":case"^":n.push(i),r.push(i),n=i[4]=[];break;case"/":o=r.pop(),o[5]=i[2],n=r.length>0?r[r.length-1][4]:e;break;default:n.push(i)}return e}function Ti(t){this.string=t,this.tail=t,this.pos=0}Ti.prototype.eos=function(){return this.tail===""};Ti.prototype.scan=function(e){var n=this.tail.match(e);if(!n||n.index!==0)return"";var r=n[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};Ti.prototype.scanUntil=function(e){var n=this.tail.search(e),r;switch(n){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=r.length,r};function Pr(t,e){this.view=t,this.cache={".":this.view},this.parent=e}Pr.prototype.push=function(e){return new Pr(e,this)};Pr.prototype.lookup=function(e){var n=this.cache,r;if(n.hasOwnProperty(e))r=n[e];else{for(var i=this,o,s,a,u=!1;i;){if(e.indexOf(".")>0)for(o=i.view,s=e.split("."),a=0;o!=null&&a<s.length;)a===s.length-1&&(u=sf(o,s[a])||nv(o,s[a])),o=o[s[a++]];else o=i.view[e],u=sf(i.view,e);if(u){r=o;break}i=i.parent}n[e]=r}return dc(r)&&(r=r.call(this.view)),r};function Nt(){this.templateCache={_cache:{},set:function(e,n){this._cache[e]=n},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}Nt.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};Nt.prototype.parse=function(e,n){var r=this.templateCache,i=e+":"+(n||Qt.tags).join(":"),o=typeof r<"u",s=o?r.get(i):void 0;return s==null&&(s=pv(e,n),o&&r.set(i,s)),s};Nt.prototype.render=function(e,n,r,i){var o=this.getConfigTags(i),s=this.parse(e,o),a=n instanceof Pr?n:new Pr(n,void 0);return this.renderTokens(s,a,r,e,i)};Nt.prototype.renderTokens=function(e,n,r,i,o){for(var s="",a,u,d,g=0,p=e.length;g<p;++g)d=void 0,a=e[g],u=a[0],u==="#"?d=this.renderSection(a,n,r,i,o):u==="^"?d=this.renderInverted(a,n,r,i,o):u===">"?d=this.renderPartial(a,n,r,o):u==="&"?d=this.unescapedValue(a,n):u==="name"?d=this.escapedValue(a,n,o):u==="text"&&(d=this.rawValue(a)),d!==void 0&&(s+=d);return s};Nt.prototype.renderSection=function(e,n,r,i,o){var s=this,a="",u=n.lookup(e[1]);function d(E){return s.render(E,n,r,o)}if(u){if(Lr(u))for(var g=0,p=u.length;g<p;++g)a+=this.renderTokens(e[4],n.push(u[g]),r,i,o);else if(typeof u=="object"||typeof u=="string"||typeof u=="number")a+=this.renderTokens(e[4],n.push(u),r,i,o);else if(dc(u)){if(typeof i!="string")throw new Error("Cannot use higher-order sections without the original template");u=u.call(n.view,i.slice(e[3],e[5]),d),u!=null&&(a+=u)}else a+=this.renderTokens(e[4],n,r,i,o);return a}};Nt.prototype.renderInverted=function(e,n,r,i,o){var s=n.lookup(e[1]);if(!s||Lr(s)&&s.length===0)return this.renderTokens(e[4],n,r,i,o)};Nt.prototype.indentPartial=function(e,n,r){for(var i=n.replace(/[^ \t]/g,""),o=e.split(`
|
|
27
27
|
`),s=0;s<o.length;s++)o[s].length&&(s>0||!r)&&(o[s]=i+o[s]);return o.join(`
|
|
28
|
-
`)};Nt.prototype.renderPartial=function(e,n,r,i){if(r){var o=this.getConfigTags(i),s=dc(r)?r(e[1]):r[e[1]];if(s!=null){var a=e[6],u=e[5],d=e[4],g=s;u==0&&d&&(g=this.indentPartial(s,d,a));var p=this.parse(g,o);return this.renderTokens(p,n,r,g,i)}}};Nt.prototype.unescapedValue=function(e,n){var r=n.lookup(e[1]);if(r!=null)return r};Nt.prototype.escapedValue=function(e,n,r){var i=this.getConfigEscape(r)||Qt.escape,o=n.lookup(e[1]);if(o!=null)return typeof o=="number"&&i===Qt.escape?String(o):i(o)};Nt.prototype.rawValue=function(e){return e[1]};Nt.prototype.getConfigTags=function(e){return Lr(e)?e:e&&typeof e=="object"?e.tags:void 0};Nt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Lr(e))return e.escape};var Qt={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){Si.templateCache=t},get templateCache(){return Si.templateCache}},Si=new Nt;Qt.clearCache=function(){return Si.clearCache()};Qt.parse=function(e,n){return Si.parse(e,n)};Qt.render=function(e,n,r,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+tv(e)+'" was given as the first argument for mustache#render(template, view, partials)');return Si.render(e,n,r,i)};Qt.escape=cv;Qt.Scanner=Ti;Qt.Context=Pr;Qt.Writer=Nt;var fc=Qt;fc.escape=_v;var gv={'"':""","\\":"\"};function _v(t){return String(t).replace(/["
|
|
28
|
+
`)};Nt.prototype.renderPartial=function(e,n,r,i){if(r){var o=this.getConfigTags(i),s=dc(r)?r(e[1]):r[e[1]];if(s!=null){var a=e[6],u=e[5],d=e[4],g=s;u==0&&d&&(g=this.indentPartial(s,d,a));var p=this.parse(g,o);return this.renderTokens(p,n,r,g,i)}}};Nt.prototype.unescapedValue=function(e,n){var r=n.lookup(e[1]);if(r!=null)return r};Nt.prototype.escapedValue=function(e,n,r){var i=this.getConfigEscape(r)||Qt.escape,o=n.lookup(e[1]);if(o!=null)return typeof o=="number"&&i===Qt.escape?String(o):i(o)};Nt.prototype.rawValue=function(e){return e[1]};Nt.prototype.getConfigTags=function(e){return Lr(e)?e:e&&typeof e=="object"?e.tags:void 0};Nt.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!Lr(e))return e.escape};var Qt={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){Si.templateCache=t},get templateCache(){return Si.templateCache}},Si=new Nt;Qt.clearCache=function(){return Si.clearCache()};Qt.parse=function(e,n){return Si.parse(e,n)};Qt.render=function(e,n,r,i){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+tv(e)+'" was given as the first argument for mustache#render(template, view, partials)');return Si.render(e,n,r,i)};Qt.escape=cv;Qt.Scanner=Ti;Qt.Context=Pr;Qt.Writer=Nt;var fc=Qt;fc.escape=_v;var gv={'"':""","\\":"\","\n":"<br>"};function _v(t){return String(t).replace(/["\\\n]/g,e=>gv[e])}var cf=(t,e)=>fc.render(t,e);var Ho=class t{transform(e,n){return e?cf(e,O({},n)):null}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=Gi({name:"cooeeDynamicVariables",type:t,pure:!0})};var pc={};(function t(e,n,r,i){var o=!!(e.Worker&&e.Blob&&e.Promise&&e.OffscreenCanvas&&e.OffscreenCanvasRenderingContext2D&&e.HTMLCanvasElement&&e.HTMLCanvasElement.prototype.transferControlToOffscreen&&e.URL&&e.URL.createObjectURL),s=typeof Path2D=="function"&&typeof DOMMatrix=="function",a=function(){if(!e.OffscreenCanvas)return!1;var v=new OffscreenCanvas(1,1),y=v.getContext("2d");y.fillRect(0,0,1,1);var H=v.transferToImageBitmap();try{y.createPattern(H,"no-repeat")}catch{return!1}return!0}();function u(){}function d(v){var y=n.exports.Promise,H=y!==void 0?y:e.Promise;return typeof H=="function"?new H(v):(v(u,u),null)}var g=function(v,y){return{transform:function(H){if(v)return H;if(y.has(H))return y.get(H);var J=new OffscreenCanvas(H.width,H.height),re=J.getContext("2d");return re.drawImage(H,0,0),y.set(H,J),J},clear:function(){y.clear()}}}(a,new Map),p=function(){var v=Math.floor(16.666666666666668),y,H,J={},re=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(y=function(oe){var ue=Math.random();return J[ue]=requestAnimationFrame(function Q(ae){re===ae||re+v-1<ae?(re=ae,delete J[ue],oe()):J[ue]=requestAnimationFrame(Q)}),ue},H=function(oe){J[oe]&&cancelAnimationFrame(J[oe])}):(y=function(oe){return setTimeout(oe,v)},H=function(oe){return clearTimeout(oe)}),{frame:y,cancel:H}}(),E=function(){var v,y,H={};function J(re){function oe(ue,Q){re.postMessage({options:ue||{},callback:Q})}re.init=function(Q){var ae=Q.transferControlToOffscreen();re.postMessage({canvas:ae},[ae])},re.fire=function(Q,ae,ee){if(y)return oe(Q,null),y;var pe=Math.random().toString(36).slice(2);return y=d(function(ce){function me(ge){ge.data.callback===pe&&(delete H[pe],re.removeEventListener("message",me),y=null,g.clear(),ee(),ce())}re.addEventListener("message",me),oe(Q,pe),H[pe]=me.bind(null,{data:{callback:pe}})}),y},re.reset=function(){re.postMessage({reset:!0});for(var Q in H)H[Q](),delete H[Q]}}return function(){if(v)return v;if(!r&&o){var re=["var CONFETTI, SIZE = {}, module = {};","("+t.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
|
|
29
29
|
`);try{v=new Worker(URL.createObjectURL(new Blob([re])))}catch(oe){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("\u{1F38A} Could not load worker",oe),null}J(v)}return v}}(),w={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function N(v,y){return y?y(v):v}function M(v){return v!=null}function L(v,y,H){return N(v&&M(v[y])?v[y]:w[y],H)}function j(v){return v<0?0:Math.floor(v)}function K(v,y){return Math.floor(Math.random()*(y-v))+v}function se(v){return parseInt(v,16)}function X(v){return v.map(be)}function be(v){var y=String(v).replace(/[^0-9a-f]/gi,"");return y.length<6&&(y=y[0]+y[0]+y[1]+y[1]+y[2]+y[2]),{r:se(y.substring(0,2)),g:se(y.substring(2,4)),b:se(y.substring(4,6))}}function U(v){var y=L(v,"origin",Object);return y.x=L(y,"x",Number),y.y=L(y,"y",Number),y}function he(v){v.width=document.documentElement.clientWidth,v.height=document.documentElement.clientHeight}function te(v){var y=v.getBoundingClientRect();v.width=y.width,v.height=y.height}function ye(v){var y=document.createElement("canvas");return y.style.position="fixed",y.style.top="0px",y.style.left="0px",y.style.pointerEvents="none",y.style.zIndex=v,y}function ke(v,y,H,J,re,oe,ue,Q,ae){v.save(),v.translate(y,H),v.rotate(oe),v.scale(J,re),v.arc(0,0,1,ue,Q,ae),v.restore()}function De(v){var y=v.angle*(Math.PI/180),H=v.spread*(Math.PI/180);return{x:v.x,y:v.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:v.startVelocity*.5+Math.random()*v.startVelocity,angle2D:-y+(.5*H-Math.random()*H),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:v.color,shape:v.shape,tick:0,totalTicks:v.ticks,decay:v.decay,drift:v.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:v.gravity*3,ovalScalar:.6,scalar:v.scalar,flat:v.flat}}function Le(v,y){y.x+=Math.cos(y.angle2D)*y.velocity+y.drift,y.y+=Math.sin(y.angle2D)*y.velocity+y.gravity,y.velocity*=y.decay,y.flat?(y.wobble=0,y.wobbleX=y.x+10*y.scalar,y.wobbleY=y.y+10*y.scalar,y.tiltSin=0,y.tiltCos=0,y.random=1):(y.wobble+=y.wobbleSpeed,y.wobbleX=y.x+10*y.scalar*Math.cos(y.wobble),y.wobbleY=y.y+10*y.scalar*Math.sin(y.wobble),y.tiltAngle+=.1,y.tiltSin=Math.sin(y.tiltAngle),y.tiltCos=Math.cos(y.tiltAngle),y.random=Math.random()+2);var H=y.tick++/y.totalTicks,J=y.x+y.random*y.tiltCos,re=y.y+y.random*y.tiltSin,oe=y.wobbleX+y.random*y.tiltCos,ue=y.wobbleY+y.random*y.tiltSin;if(v.fillStyle="rgba("+y.color.r+", "+y.color.g+", "+y.color.b+", "+(1-H)+")",v.beginPath(),s&&y.shape.type==="path"&&typeof y.shape.path=="string"&&Array.isArray(y.shape.matrix))v.fill(x(y.shape.path,y.shape.matrix,y.x,y.y,Math.abs(oe-J)*.1,Math.abs(ue-re)*.1,Math.PI/10*y.wobble));else if(y.shape.type==="bitmap"){var Q=Math.PI/10*y.wobble,ae=Math.abs(oe-J)*.1,ee=Math.abs(ue-re)*.1,pe=y.shape.bitmap.width*y.scalar,ce=y.shape.bitmap.height*y.scalar,me=new DOMMatrix([Math.cos(Q)*ae,Math.sin(Q)*ae,-Math.sin(Q)*ee,Math.cos(Q)*ee,y.x,y.y]);me.multiplySelf(new DOMMatrix(y.shape.matrix));var ge=v.createPattern(g.transform(y.shape.bitmap),"no-repeat");ge.setTransform(me),v.globalAlpha=1-H,v.fillStyle=ge,v.fillRect(y.x-pe/2,y.y-ce/2,pe,ce),v.globalAlpha=1}else if(y.shape==="circle")v.ellipse?v.ellipse(y.x,y.y,Math.abs(oe-J)*y.ovalScalar,Math.abs(ue-re)*y.ovalScalar,Math.PI/10*y.wobble,0,2*Math.PI):ke(v,y.x,y.y,Math.abs(oe-J)*y.ovalScalar,Math.abs(ue-re)*y.ovalScalar,Math.PI/10*y.wobble,0,2*Math.PI);else if(y.shape==="star")for(var _e=Math.PI/2*3,h=4*y.scalar,c=8*y.scalar,l=y.x,_=y.y,T=5,D=Math.PI/T;T--;)l=y.x+Math.cos(_e)*c,_=y.y+Math.sin(_e)*c,v.lineTo(l,_),_e+=D,l=y.x+Math.cos(_e)*h,_=y.y+Math.sin(_e)*h,v.lineTo(l,_),_e+=D;else v.moveTo(Math.floor(y.x),Math.floor(y.y)),v.lineTo(Math.floor(y.wobbleX),Math.floor(re)),v.lineTo(Math.floor(oe),Math.floor(ue)),v.lineTo(Math.floor(J),Math.floor(y.wobbleY));return v.closePath(),v.fill(),y.tick<y.totalTicks}function Ge(v,y,H,J,re){var oe=y.slice(),ue=v.getContext("2d"),Q,ae,ee=d(function(pe){function ce(){Q=ae=null,ue.clearRect(0,0,J.width,J.height),g.clear(),re(),pe()}function me(){r&&!(J.width===i.width&&J.height===i.height)&&(J.width=v.width=i.width,J.height=v.height=i.height),!J.width&&!J.height&&(H(v),J.width=v.width,J.height=v.height),ue.clearRect(0,0,J.width,J.height),oe=oe.filter(function(ge){return Le(ue,ge)}),oe.length?Q=p.frame(me):ce()}Q=p.frame(me),ae=ce});return{addFettis:function(pe){return oe=oe.concat(pe),ee},canvas:v,promise:ee,reset:function(){Q&&p.cancel(Q),ae&&ae()}}}function Ye(v,y){var H=!v,J=!!L(y||{},"resize"),re=!1,oe=L(y,"disableForReducedMotion",Boolean),ue=o&&!!L(y||{},"useWorker"),Q=ue?E():null,ae=H?he:te,ee=v&&Q?!!v.__confetti_initialized:!1,pe=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,ce;function me(_e,h,c){for(var l=L(_e,"particleCount",j),_=L(_e,"angle",Number),T=L(_e,"spread",Number),D=L(_e,"startVelocity",Number),V=L(_e,"decay",Number),ve=L(_e,"gravity",Number),Ie=L(_e,"drift",Number),we=L(_e,"colors",X),Ve=L(_e,"ticks",Number),Be=L(_e,"shapes"),qe=L(_e,"scalar"),kt=!!L(_e,"flat"),Gt=U(_e),bn=l,St=[],Vt=v.width*Gt.x,Vi=v.height*Gt.y;bn--;)St.push(De({x:Vt,y:Vi,angle:_,spread:T,startVelocity:D,color:we[bn%we.length],shape:Be[K(0,Be.length)],ticks:Ve,decay:V,gravity:ve,drift:Ie,scalar:qe,flat:kt}));return ce?ce.addFettis(St):(ce=Ge(v,St,ae,h,c),ce.promise)}function ge(_e){var h=oe||L(_e,"disableForReducedMotion",Boolean),c=L(_e,"zIndex",Number);if(h&&pe)return d(function(D){D()});H&&ce?v=ce.canvas:H&&!v&&(v=ye(c),document.body.appendChild(v)),J&&!ee&&ae(v);var l={width:v.width,height:v.height};Q&&!ee&&Q.init(v),ee=!0,Q&&(v.__confetti_initialized=!0);function _(){if(Q){var D={getBoundingClientRect:function(){if(!H)return v.getBoundingClientRect()}};ae(D),Q.postMessage({resize:{width:D.width,height:D.height}});return}l.width=l.height=null}function T(){ce=null,J&&(re=!1,e.removeEventListener("resize",_)),H&&v&&(document.body.contains(v)&&document.body.removeChild(v),v=null,ee=!1)}return J&&!re&&(re=!0,e.addEventListener("resize",_,!1)),Q?Q.fire(_e,l,T):me(_e,l,T)}return ge.reset=function(){Q&&Q.reset(),ce&&ce.reset()},ge}var gt;function A(){return gt||(gt=Ye(null,{useWorker:!0,resize:!0})),gt}function x(v,y,H,J,re,oe,ue){var Q=new Path2D(v),ae=new Path2D;ae.addPath(Q,new DOMMatrix(y));var ee=new Path2D;return ee.addPath(ae,new DOMMatrix([Math.cos(ue)*re,Math.sin(ue)*re,-Math.sin(ue)*oe,Math.cos(ue)*oe,H,J])),ee}function F(v){if(!s)throw new Error("path confetti are not supported in this browser");var y,H;typeof v=="string"?y=v:(y=v.path,H=v.matrix);var J=new Path2D(y),re=document.createElement("canvas"),oe=re.getContext("2d");if(!H){for(var ue=1e3,Q=ue,ae=ue,ee=0,pe=0,ce,me,ge=0;ge<ue;ge+=2)for(var _e=0;_e<ue;_e+=2)oe.isPointInPath(J,ge,_e,"nonzero")&&(Q=Math.min(Q,ge),ae=Math.min(ae,_e),ee=Math.max(ee,ge),pe=Math.max(pe,_e));ce=ee-Q,me=pe-ae;var h=10,c=Math.min(h/ce,h/me);H=[c,0,0,c,-Math.round(ce/2+Q)*c,-Math.round(me/2+ae)*c]}return{type:"path",path:y,matrix:H}}function P(v){var y,H=1,J="#000000",re='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof v=="string"?y=v:(y=v.text,H="scalar"in v?v.scalar:H,re="fontFamily"in v?v.fontFamily:re,J="color"in v?v.color:J);var oe=10*H,ue=""+oe+"px "+re,Q=new OffscreenCanvas(oe,oe),ae=Q.getContext("2d");ae.font=ue;var ee=ae.measureText(y),pe=Math.ceil(ee.actualBoundingBoxRight+ee.actualBoundingBoxLeft),ce=Math.ceil(ee.actualBoundingBoxAscent+ee.actualBoundingBoxDescent),me=2,ge=ee.actualBoundingBoxLeft+me,_e=ee.actualBoundingBoxAscent+me;pe+=me+me,ce+=me+me,Q=new OffscreenCanvas(pe,ce),ae=Q.getContext("2d"),ae.font=ue,ae.fillStyle=J,ae.fillText(y,ge,_e);var h=1/H;return{type:"bitmap",bitmap:Q.transferToImageBitmap(),matrix:[h,0,0,h,-pe*h/2,-ce*h/2]}}n.exports=function(){return A().apply(this,arguments)},n.exports.reset=function(){A().reset()},n.exports.create=Ye,n.exports.shapeFromPath=F,n.exports.shapeFromText=P})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),pc,!1);var lf=pc.exports,_A=pc.exports.create;var jo=class{static DEFAULTS={scalar:1.4,zIndex:1e4,shapes:["circle","circle","square"],colors:["#f51c8f","#2179e2","#d52dc8","#01a9d9","#78ff44","#fdff6a"]};static async basic(){await this.fire({particleCount:100,spread:70,origin:{y:.6}})}static async leftRight(e=100){let n=[],r=Date.now()+2e3,i=()=>{n.push(this.fire({angle:60,spread:55,origin:{x:0}}),this.fire({angle:120,spread:55,origin:{x:1}})),Date.now()<r&&e>0&&(requestAnimationFrame(i),e--)};i(),await Promise.all(n)}static async realistic(){await Promise.all([this.realisticFire(.25,{spread:26,startVelocity:55}),this.realisticFire(.2,{spread:60}),this.realisticFire(.35,{spread:100,decay:.91,scalar:.8}),this.realisticFire(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),this.realisticFire(.1,{spread:120,startVelocity:45})])}static async fire(e){Object.assign(e,this.DEFAULTS,e),e.particleCount=e.particleCount??this.DEFAULTS.colors.length,await lf(e)}static async realisticFire(e,n){let i={origin:{y:.7}};await this.fire(Object.assign({},i,n,{particleCount:Math.floor(200*e)}))}};var vv=(t,e)=>e.minValue;function yv(t,e){if(t&1&&(Ee(0,"div",7),Ze(1,"safeHtml")),t&2){let n=Z().$implicit;de("innerHTML",it(1,1,n.minValue+" Products"),bt)}}function Ev(t,e){if(t&1&&(Ee(0,"div",7),Ze(1,"cooeeCurrency"),Ze(2,"safeHtml")),t&2){let n=Z().$implicit;de("innerHTML",it(2,3,it(1,1,n.minValue)),bt)}}function bv(t,e){if(t&1&&(W(0,"li",6)(1,"div"),Oe(2,yv,2,3,"div",7)(3,Ev,3,5,"div",7),Ee(4,"img",8),W(5,"div",9),Ae(6),Y()()()),t&2){let n=e.$implicit,r=Z(2);ii("left",n.calculatedAlignment+"%"),k(2),Te((r.progressBarConfig==null?null:r.progressBarConfig.rewardBasis)===r.RewardBasis.ITEM_COUNT?2:3),k(2),de("src",r.getIconURL(n),lt),k(2),ln(n.label)}}function wv(t,e){if(t&1&&(ct(0)(1),Ee(2,"div",0),Ze(3,"cooeeDynamicVariables"),Ze(4,"safeHtml"),W(5,"div",1)(6,"ul",2)(7,"div",3),Ee(8,"div",4),Y(),nt(9,bv,7,5,"li",5,vv),Y()()),t&2){let n=Z(),r=n.calculatedState(),i=r.nextMilestone?r.nextMilestone.reachingText:r.lastMilestone.reachedText;k(2),de("innerHTML",it(4,6,Hl(3,3,i,n.localDynamicVariables())),bt),k(6),ii("width",r.cartValuePercentage+"%"),k(),rt(r.milestones)}}var $o=class t extends Kt{cart;localDynamicVariables=Lt({});calculatedState=Lt({});progressBarConfig;RewardBasis=Ws;constructor(){super()}engagementTriggerReceived(e){this.progressBarConfig=e.progressBarConfig}ngOnInit(){super.ngOnInit(),this.calculateMilestonesSilently()}update(){this.calculateMilestonesSilently()}getIconURL(e){return e.rewardType===ai.FREE_SHIPPING?"https://img.icons8.com/ios-filled/50/FFFFFF/free-shipping.png":e.rewardType===ai.DISCOUNT?"https://img.icons8.com/ios-glyphs/30/FFFFFF/sale-price-tag.png":e.rewardType===ai.FREE_AUTO_GIFT?"https://img.icons8.com/ios-filled/50/FFFFFF/gift--v1.png":""}calculateMilestonesSilently(){this.calculateMilestones().catch(e=>ut.error(e))}async calculateMilestones(){let e=this.engagementTrigger,n=this.progressBarConfig;if(!n?.milestones?.length){ut.warn("Milestones not available in progress bar config",e);return}let r=await this.cart.getNormalisedCart(),i=n.milestones.at(-1),o=n?.reachedAmountOrCount??r.originalAmount,s=n.totalProgress??0;ut.debug("Cart value:",o,`, percentage: ${s}%`),this.celebrate(e,o);let a={milestonesReady:!0,cartValuePercentage:s,milestones:n.milestones},u=n.milestones.find(d=>!d.reached);if(u){let d=Fn(u.minValue-o);if(n.rewardBasis==="ITEM_COUNT"){let g=u.minValue-o;d=`${g} ${g===1?"product":"products"}`}this.localDynamicVariables.set({amount_left:d}),a.nextMilestone=u,this.calculatedState.set(a);return}a.lastMilestone=i,this.calculatedState.set(a)}celebrate(e,n){let o=[...e.progressBarConfig.milestones].reverse().find(u=>u.minValue<n);if(!o)return;let s=`lc/en/${e.shortID}/${o.minValue}`;sessionStorage.getItem(s)||(sessionStorage.setItem(s,"1"),this.progressBarConfig?.noConfetti||jo.realistic())}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Me({type:t,selectors:[["cooee-progressbar"]],inputs:{cart:"cart"},features:[wt],decls:1,vars:1,consts:[[1,"heading",3,"innerHTML"],[1,"milestone-container"],[1,"milestone-list"],[1,"untracked-path"],[1,"tracked-path"],[1,"milestone-list-item",3,"left"],[1,"milestone-list-item"],[1,"milestone-value",3,"innerHTML"],["width","20","height","20","alt","milestone icon",1,"milestone-icon",3,"src"],[1,"milestone-label"]],template:function(n,r){n&1&&Oe(0,wv,11,8),n&2&&Te(r.calculatedState().milestonesReady?0:-1)},dependencies:[Ho,Un,vn],styles:[`:host{display:block;padding:10px;background:linear-gradient(0deg,rgba(var(--lc-color-primary),.1) 0%,transparent 100%)}.milestone-container{width:95%;margin:8px 0}.heading{font-weight:500;text-align:center;font-size:12px}.milestone-list{display:flex;align-items:center;position:relative;font-size:10px;font-weight:500}.untracked-path{width:100%;background-color:#e5e7eb;height:4px;position:absolute}.tracked-path{background-color:rgb(var(--lc-color-primary));height:100%;display:block;transition:width .5s ease-in-out}.milestone-list{padding:0;margin:0}.milestone-list-item{position:relative;display:flex;flex-direction:column;align-items:center;height:75px}.milestone-list-item>div{display:flex;flex-direction:column;align-items:center;justify-content:space-between;position:absolute;height:100%;width:100px}.milestone-icon{padding:5px;border-radius:1000px;background-color:rgb(var(--lc-color-primary))}
|
|
30
30
|
`],encapsulation:3})};var uf=ti(Qi());var Cv=["numberVariable"],Go=class t extends Kt{numberSlot;savingsBarConfig;textParts=Lt({start:"",end:""});globalIntervals=[];constructor(){super()}ngAfterViewInit(){this.updateUIVars()}engagementTriggerReceived(e){this.savingsBarConfig=e.content.savingsBarConfig,this.elementRef.nativeElement.classList.add("lc_"+e.entryAnimation?.toLowerCase()),this.savingsBarConfig.iconURL&&this.elementRef.nativeElement.style.setProperty("--lc-discount-icon",this.savingsBarConfig.iconURL)}update(){this.updateUIVars()}updateUIVars(){let e=this.engagementTrigger.getCartMagicVariables();e.total_savings=Fn(this.savingsBarConfig.totalSavings);let n=(0,uf.render)(this.savingsBarConfig.text,{cart:e}),r=n.match(/[\d.,]+/)?.[0];if(!r){ut.error("No amount found in text",n);return}let[i,o]=n.split(r);this.textParts.set({start:i,end:o}),this.savingsBarConfig.animateNumber?this.runAnimation(r):this.numberSlot.nativeElement.innerHTML=r}runSlotMachineAnimation(e="0"){let n=this.numberSlot.nativeElement;n.innerHTML="";let r=this.savingsBarConfig.animationDuration/e.length;this.clearPreviousIntervals();for(let i=0;i<e.length;i++){let o=document.createElement("div");o.className="digit",o.style.display="inline-block",n.appendChild(o);let s=setInterval(()=>{let a=Math.floor(Math.random()*10);o.innerHTML=`<div>${a}</div>`},50);this.globalIntervals.push(s),setTimeout(()=>{clearInterval(s);let a=e?.[i]??Math.floor(Math.random()*10);o.innerHTML=`${a}`},(i+1)*r)}}clearPreviousIntervals(){this.globalIntervals.forEach(clearInterval),this.globalIntervals=[]}runIncrementalAnimation(e){let n=performance.now(),r=i=>{let o=Math.min((i-n)/this.savingsBarConfig.animationDuration,1);this.numberSlot.nativeElement.innerHTML=Math.floor(e*o).toString(),o<1&&requestAnimationFrame(r)};requestAnimationFrame(r)}runAnimation(e){this.savingsBarConfig.animation==="SLOT_MACHINE"?this.runSlotMachineAnimation(e):this.savingsBarConfig.animation==="INCREMENTAL"&&this.runIncrementalAnimation(Number(e))}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Me({type:t,selectors:[["cooee-savings-bar"]],viewQuery:function(n,r){if(n&1&&Tn(Cv,5),n&2){let i;In(i=xn())&&(r.numberSlot=i.first)}},features:[wt],decls:6,vars:2,consts:[["numberVariable",""],[1,"container"],[1,"icon"],[1,"primary-text",3,"innerHTML"],[1,"counter-text"],[1,"final-text",3,"innerHTML"]],template:function(n,r){n&1&&(W(0,"div",1),Ee(1,"div",2)(2,"div",3)(3,"div",4,0)(5,"div",5),Y()),n&2&&(k(2),de("innerHTML",r.textParts().start,bt),k(3),de("innerHTML",r.textParts().end,bt))},styles:[`:host{display:block}.container{white-space:pre;display:flex;justify-content:center;align-items:center;background-color:rgb(var(--lc-color-button, 0 162 81));color:rgb(var(--lc-color-button-text, 255 255 255));padding:8px;border-radius:4px 4px 0 0;overflow:hidden}.container .icon{background-image:var(--lc-discount-icon, url(https://img.icons8.com/ios-glyphs/30/FFFFFF/discount--v1.png));background-position:center;background-size:cover;height:20px;width:20px;margin-right:2px}
|
|
31
31
|
`],encapsulation:3})};var df=ti(Qi());var Sv=(t,e)=>({enter:t,exit:e});function Tv(t,e){if(t&1&&(W(0,"div",7),Ae(1),Y(),W(2,"div",8),Ae(3),Y()),t&2){let n=Z(2);k(),It(" ",n.getCurrency(n.selectedVariant().price.cmp)," "),k(2),It(" ",n.getDiscountPercentage(n.selectedVariant().price),"% off ")}}function Iv(t,e){if(t&1&&(W(0,"div",6),Ae(1),Y()),t&2){let n=Z(2);k(),It(" ",n.stickyATCConfig.leftText," ")}}function xv(t,e){if(t&1&&(W(0,"div",1)(1,"div",5),Ae(2),Y(),Oe(3,Tv,4,2)(4,Iv,2,1,"div",6),Y()),t&2){let n=Z();k(2),It(" ",n.getCurrency(n.selectedVariant().price.d)," "),k(),Te(n.selectedVariant().price.cmp?3:-1),k(),Te(n.stickyATCConfig.leftText?4:-1)}}function Ov(t,e){if(t&1&&(W(0,"div",9),Ae(1),Y()),t&2){let n=e.$implicit,r=e.$index;Z(2);let i=Ke(5);de("ngClass",zi(2,Sv,r===i.currentIndex,r===i.previousIndex)),k(),It(" ",n," ")}}function Av(t,e){if(t&1&&(W(0,"div",4),nt(1,Ov,2,5,"div",9,Cn),Y()),t&2){Z();let n=Ke(5);k(),rt(n.features)}}var Wo=class t extends Kt{currentItem;stickyATCConfig;selectedVariant=Lt(void 0);featureSlider=Lt({features:[],currentIndex:0});constructor(){super()}engagementTriggerReceived(e){this.stickyATCConfig=e.stickyATCConfig??{},this.currentItem=e.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(e){return Fn(e)}getDiscountPercentage(e){return((e.cmp-e.d)/e.cmp*100).toFixed(0)}async addToCart(){this.executeCTAViaRenderer({clickAction:{at:102},item:this.currentItem})}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let e=this.stickyATCConfig.rightText.split(`
|
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": "9.13.
|
|
4
|
+
"version": "9.13.2",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"lint": "ng lint",
|
|
7
7
|
"integrity": "./scripts/validate-integrity.sh",
|