@letscooee/web-sdk 10.2.0 → 11.0.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,35 +1,20 @@
1
- import{$ as Xi,$a as nr,A as qi,Aa as Y,Ab as Kl,B as xe,Ba as xn,C as Oe,Ca as On,D as Wt,Da as Dn,E as Qn,Ea as Al,F as Ot,Fa as Nl,G as kt,Ga as en,H as ni,Ha as si,I as Ct,Ia as ai,J as Tl,Ja as Ji,K as ri,Ka as Re,L as Vt,La as fn,M as Il,Ma as Bt,N as vt,Na as It,O as dt,Oa as bt,P as k,Pa as Je,Q as xl,Qa as An,R as Ol,Ra as Rl,S as Ki,Sa as Zi,T as Ps,Ta as Qi,U as yr,Ua as Qe,V as ii,Va as it,W as Ls,Wa as Ml,X as Fs,Xa as Pl,Y as Ne,Ya as Ll,Z as er,Za as tr,_ as Er,_a as ci,a as x,aa as St,ab as Nn,b as Ee,bb as Fl,c as ti,ca as br,cb as Vs,d as pl,da as ut,db as rr,e as Gi,ea as Yt,eb as kl,f as Wi,fa as $n,fb as Vl,g as ne,ga as oi,gb as Gn,h as hl,ha as Qt,hb as Bl,i as Yi,ia as De,ib as Ul,j as Lt,ja as Ae,k as ml,ka as In,kb as Hl,l as Ms,la as nt,lb as jl,m as gl,ma as rt,mb as Wn,n as _l,na as Se,nb as $l,o as vl,oa as K,ob as Gl,p as yl,pa as Z,pb as Wl,q as El,qa as $e,qb as eo,r as bl,ra as ct,rb as Rn,s as wl,sa as yt,sb as pn,t as Cl,ta as Et,tb as to,u as Sl,ua as ks,ub as li,v as zi,va as Dl,vb as Yl,w as Ft,wa as Ge,wb as ui,x as Zn,xa as Dt,xb as zl,y as ln,ya as Fe,yb as ql,z as J,za as wr,zb as no}from"./chunk-YIVV24QX.js";var Ql=Gi((Zl,ro)=>{"use strict";(function(t){"use strict";var e={};e.VERSION="1.6.1";var n,r={},i=function(d,_){return function(){return _.apply(d,arguments)}},o=function(){var d=arguments,_=d[0],h,E;for(E=1;E<d.length;E++)for(h in d[E])!(h in _)&&d[E].hasOwnProperty(h)&&(_[h]=d[E][h]);return _},s=function(d,_){return{value:d,name:_}};e.TRACE=s(1,"TRACE"),e.DEBUG=s(2,"DEBUG"),e.INFO=s(3,"INFO"),e.TIME=s(4,"TIME"),e.WARN=s(5,"WARN"),e.ERROR=s(8,"ERROR"),e.OFF=s(99,"OFF");var l=function(d){this.context=d,this.setLevel(d.filterLevel),this.log=this.info};l.prototype={setLevel:function(d){d&&"value"in d&&(this.context.filterLevel=d)},getLevel:function(){return this.context.filterLevel},enabledFor:function(d){var _=this.context.filterLevel;return d.value>=_.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(d){typeof d=="string"&&d.length>0&&this.invoke(e.TIME,[d,"start"])},timeEnd:function(d){typeof d=="string"&&d.length>0&&this.invoke(e.TIME,[d,"end"])},invoke:function(d,_){n&&this.enabledFor(d)&&n(_,o({level:d},this.context))}};var u=new l({filterLevel:e.OFF});(function(){var d=e;d.enabledFor=i(u,u.enabledFor),d.trace=i(u,u.trace),d.debug=i(u,u.debug),d.time=i(u,u.time),d.timeEnd=i(u,u.timeEnd),d.info=i(u,u.info),d.warn=i(u,u.warn),d.error=i(u,u.error),d.log=d.info})(),e.setHandler=function(d){n=d},e.setLevel=function(d){u.setLevel(d);for(var _ in r)r.hasOwnProperty(_)&&r[_].setLevel(d)},e.getLevel=function(){return u.getLevel()},e.get=function(d){return r[d]||(r[d]=new l(o({name:d},u.context)))},e.createDefaultHandler=function(d){d=d||{},d.formatter=d.formatter||function(w,N){N.name&&w.unshift("["+N.name+"]")};var _={},h=function(E,w){Function.prototype.apply.call(E,console,w)};return typeof console>"u"?function(){}:function(E,w){E=Array.prototype.slice.call(E);var N=console.log,B;w.level===e.TIME?(B=(w.name?"["+w.name+"] ":"")+E[0],E[1]==="start"?console.time?console.time(B):_[B]=new Date().getTime():console.timeEnd?console.timeEnd(B):h(N,[B+": "+(new Date().getTime()-_[B])+"ms"])):(w.level===e.WARN&&console.warn?N=console.warn:w.level===e.ERROR&&console.error?N=console.error:w.level===e.INFO&&console.info?N=console.info:w.level===e.DEBUG&&console.debug?N=console.debug:w.level===e.TRACE&&console.trace&&(N=console.trace),d.formatter(E,w),h(N,E))}},e.useDefaults=function(d){e.setLevel(d&&d.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(d))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof ro<"u"&&ro.exports?ro.exports=e:(e._prevLogger=t.Logger,e.noConflict=function(){return t.Logger=e._prevLogger,e},t.Logger=e)})(Zl)});var cu=Gi((au,Ws)=>{"use strict";(function(t){if(typeof au=="object"&&typeof Ws<"u")Ws.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 l(_,h){if(!o[_]){if(!i[_]){var E=typeof ti=="function"&&ti;if(!h&&E)return E(_,!0);if(u)return u(_,!0);var w=new Error("Cannot find module '"+_+"'");throw w.code="MODULE_NOT_FOUND",w}var N=o[_]={exports:{}};i[_][0].call(N.exports,function(B){var P=i[_][1][B];return l(P||B)},N,N.exports,r,i,o,s)}return o[_].exports}for(var u=typeof ti=="function"&&ti,d=0;d<s.length;d++)l(s[d]);return l}({1:[function(r,i,o){(function(s){"use strict";var l=s.MutationObserver||s.WebKitMutationObserver,u;if(l){var d=0,_=new l(B),h=s.document.createTextNode("");_.observe(h,{characterData:!0}),u=function(){h.data=d=++d%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var E=new s.MessageChannel;E.port1.onmessage=B,u=function(){E.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?u=function(){var z=s.document.createElement("script");z.onreadystatechange=function(){B(),z.onreadystatechange=null,z.parentNode.removeChild(z),z=null},s.document.documentElement.appendChild(z)}:u=function(){setTimeout(B,0)};var w,N=[];function B(){w=!0;for(var z,G,te=N.length;te;){for(G=N,N=[],z=-1;++z<te;)G[z]();te=N.length}w=!1}i.exports=P;function P(z){N.push(z)===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 l(){}var u={},d=["REJECTED"],_=["FULFILLED"],h=["PENDING"];i.exports=E;function E(H){if(typeof H!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,H!==l&&P(this,H)}E.prototype.catch=function(H){return this.then(null,H)},E.prototype.then=function(H,ve){if(typeof H!="function"&&this.state===_||typeof ve!="function"&&this.state===d)return this;var fe=new this.constructor(l);if(this.state!==h){var be=this.state===_?H:ve;N(fe,be,this.outcome)}else this.queue.push(new w(fe,H,ve));return fe};function w(H,ve,fe){this.promise=H,typeof ve=="function"&&(this.onFulfilled=ve,this.callFulfilled=this.otherCallFulfilled),typeof fe=="function"&&(this.onRejected=fe,this.callRejected=this.otherCallRejected)}w.prototype.callFulfilled=function(H){u.resolve(this.promise,H)},w.prototype.otherCallFulfilled=function(H){N(this.promise,this.onFulfilled,H)},w.prototype.callRejected=function(H){u.reject(this.promise,H)},w.prototype.otherCallRejected=function(H){N(this.promise,this.onRejected,H)};function N(H,ve,fe){s(function(){var be;try{be=ve(fe)}catch(Ve){return u.reject(H,Ve)}be===H?u.reject(H,new TypeError("Cannot resolve promise with itself")):u.resolve(H,be)})}u.resolve=function(H,ve){var fe=z(B,ve);if(fe.status==="error")return u.reject(H,fe.value);var be=fe.value;if(be)P(H,be);else{H.state=_,H.outcome=ve;for(var Ve=-1,Pe=H.queue.length;++Ve<Pe;)H.queue[Ve].callFulfilled(ve)}return H},u.reject=function(H,ve){H.state=d,H.outcome=ve;for(var fe=-1,be=H.queue.length;++fe<be;)H.queue[fe].callRejected(ve);return H};function B(H){var ve=H&&H.then;if(H&&(typeof H=="object"||typeof H=="function")&&typeof ve=="function")return function(){ve.apply(H,arguments)}}function P(H,ve){var fe=!1;function be(ze){fe||(fe=!0,u.reject(H,ze))}function Ve(ze){fe||(fe=!0,u.resolve(H,ze))}function Pe(){ve(Ve,be)}var Le=z(Pe);Le.status==="error"&&be(Le.value)}function z(H,ve){var fe={};try{fe.value=H(ve),fe.status="success"}catch(be){fe.status="error",fe.value=be}return fe}E.resolve=G;function G(H){return H instanceof this?H:u.resolve(new this(l),H)}E.reject=te;function te(H){var ve=new this(l);return u.reject(ve,H)}E.all=q;function q(H){var ve=this;if(Object.prototype.toString.call(H)!=="[object Array]")return this.reject(new TypeError("must be an array"));var fe=H.length,be=!1;if(!fe)return this.resolve([]);for(var Ve=new Array(fe),Pe=0,Le=-1,ze=new this(l);++Le<fe;)Xe(H[Le],Le);return ze;function Xe(_t,D){ve.resolve(_t).then(O,function(L){be||(be=!0,u.reject(ze,L))});function O(L){Ve[D]=L,++Pe===fe&&!be&&(be=!0,u.resolve(ze,Ve))}}}E.race=Me;function Me(H){var ve=this;if(Object.prototype.toString.call(H)!=="[object Array]")return this.reject(new TypeError("must be an array"));var fe=H.length,be=!1;if(!fe)return this.resolve([]);for(var Ve=-1,Pe=new this(l);++Ve<fe;)Le(H[Ve]);return Pe;function Le(ze){ve.resolve(ze).then(function(Xe){be||(be=!0,u.resolve(Pe,Xe))},function(Xe){be||(be=!0,u.reject(Pe,Xe))})}}},{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 l(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 _(){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 h(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 B(f){return typeof f!="string"&&(console.warn(f+" used as a key, but it is not a string."),f=String(f)),f}function P(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var z="local-forage-detect-blob-support",G=void 0,te={},q=Object.prototype.toString,Me="readonly",H="readwrite";function ve(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 fe(f){return new E(function(b){var m=f.transaction(z,H),S=h([""]);m.objectStore(z).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 be(f){return typeof G=="boolean"?E.resolve(G):fe(f).then(function(b){return G=b,G})}function Ve(f){var b=te[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 Pe(f){var b=te[f.name],m=b.deferredOperations.pop();if(m)return m.resolve(),m.promise}function Le(f,b){var m=te[f.name],S=m.deferredOperations.pop();if(S)return S.reject(b),S.promise}function ze(f,b){return new E(function(m,S){if(te[f.name]=te[f.name]||X(),f.db)if(b)Ve(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 V=C.result;try{V.createObjectStore(f.storeName),R.oldVersion<=1&&V.createObjectStore(z)}catch(j){if(j.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 j}}),C.onerror=function(R){R.preventDefault(),S(C.error)},C.onsuccess=function(){var R=C.result;R.onversionchange=function(V){V.target.close()},m(R),Pe(f)}})}function Xe(f){return ze(f,!1)}function _t(f){return ze(f,!0)}function D(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 O(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 L(f){var b=ve(atob(f.data));return h([b],{type:f.type})}function M(f){return f&&f.__local_forage_encoded_blob}function v(f){var b=this,m=b._initReady().then(function(){var S=te[b._dbInfo.name];if(S&&S.dbReady)return S.dbReady});return N(m,f,f),m}function y(f){Ve(f);for(var b=te[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,Xe(f).then(function(C){return f.db=C,D(f)?_t(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 U(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),_t(f)}).then(function(){return y(f).then(function(){U(f,b,m,S-1)})}).catch(m);m(C)}}function X(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function oe(f){var b=this,m={db:null};if(f)for(var S in f)m[S]=f[S];var I=te[m.name];I||(I=X(),te[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 V=0;V<I.forages.length;V++){var j=I.forages[V];j!==b&&C.push(j._initReady().catch(R))}var $=I.forages.slice(0);return E.all(C).then(function(){return m.db=I.db,Xe(m)}).then(function(W){return m.db=W,D(m,b._defaultConfig.version)?_t(m):W}).then(function(W){m.db=I.db=W,b._dbInfo=m;for(var se=0;se<$.length;se++){var Ie=$[se];Ie!==b&&(Ie._dbInfo.db=m.db,Ie._dbInfo.version=m.version)}})}function ae(f,b){var m=this;f=B(f);var S=new E(function(I,C){m.ready().then(function(){U(m._dbInfo,Me,function(R,V){if(R)return C(R);try{var j=V.objectStore(m._dbInfo.storeName),$=j.get(f);$.onsuccess=function(){var W=$.result;W===void 0&&(W=null),M(W)&&(W=L(W)),I(W)},$.onerror=function(){C($.error)}}catch(W){C(W)}})}).catch(C)});return w(S,b),S}function de(f,b){var m=this,S=new E(function(I,C){m.ready().then(function(){U(m._dbInfo,Me,function(R,V){if(R)return C(R);try{var j=V.objectStore(m._dbInfo.storeName),$=j.openCursor(),W=1;$.onsuccess=function(){var se=$.result;if(se){var Ie=se.value;M(Ie)&&(Ie=L(Ie));var He=f(Ie,se.key,W++);He!==void 0?I(He):se.continue()}else I()},$.onerror=function(){C($.error)}}catch(se){C(se)}})}).catch(C)});return w(S,b),S}function ee(f,b,m){var S=this;f=B(f);var I=new E(function(C,R){var V;S.ready().then(function(){return V=S._dbInfo,q.call(b)==="[object Blob]"?be(V.db).then(function(j){return j?b:O(b)}):b}).then(function(j){U(S._dbInfo,H,function($,W){if($)return R($);try{var se=W.objectStore(S._dbInfo.storeName);j===null&&(j=void 0);var Ie=se.put(j,f);W.oncomplete=function(){j===void 0&&(j=null),C(j)},W.onabort=W.onerror=function(){var He=Ie.error?Ie.error:Ie.transaction.error;R(He)}}catch(He){R(He)}})}).catch(R)});return w(I,m),I}function ce(f,b){var m=this;f=B(f);var S=new E(function(I,C){m.ready().then(function(){U(m._dbInfo,H,function(R,V){if(R)return C(R);try{var j=V.objectStore(m._dbInfo.storeName),$=j.delete(f);V.oncomplete=function(){I()},V.onerror=function(){C($.error)},V.onabort=function(){var W=$.error?$.error:$.transaction.error;C(W)}}catch(W){C(W)}})}).catch(C)});return w(S,b),S}function re(f){var b=this,m=new E(function(S,I){b.ready().then(function(){U(b._dbInfo,H,function(C,R){if(C)return I(C);try{var V=R.objectStore(b._dbInfo.storeName),j=V.clear();R.oncomplete=function(){S()},R.onabort=R.onerror=function(){var $=j.error?j.error:j.transaction.error;I($)}}catch($){I($)}})}).catch(I)});return w(m,f),m}function he(f){var b=this,m=new E(function(S,I){b.ready().then(function(){U(b._dbInfo,Me,function(C,R){if(C)return I(C);try{var V=R.objectStore(b._dbInfo.storeName),j=V.count();j.onsuccess=function(){S(j.result)},j.onerror=function(){I(j.error)}}catch($){I($)}})}).catch(I)});return w(m,f),m}function le(f,b){var m=this,S=new E(function(I,C){if(f<0){I(null);return}m.ready().then(function(){U(m._dbInfo,Me,function(R,V){if(R)return C(R);try{var j=V.objectStore(m._dbInfo.storeName),$=!1,W=j.openKeyCursor();W.onsuccess=function(){var se=W.result;if(!se){I(null);return}f===0||$?I(se.key):($=!0,se.advance(f))},W.onerror=function(){C(W.error)}}catch(se){C(se)}})}).catch(C)});return w(S,b),S}function me(f){var b=this,m=new E(function(S,I){b.ready().then(function(){U(b._dbInfo,Me,function(C,R){if(C)return I(C);try{var V=R.objectStore(b._dbInfo.storeName),j=V.openKeyCursor(),$=[];j.onsuccess=function(){var W=j.result;if(!W){S($);return}$.push(W.key),W.continue()},j.onerror=function(){I(j.error)}}catch(W){I(W)}})}).catch(I)});return w(m,f),m}function ge(f,b){b=P.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):Xe(f).then(function(V){var j=te[f.name],$=j.forages;j.db=V;for(var W=0;W<$.length;W++)$[W]._dbInfo.db=V;return V});f.storeName?I=R.then(function(V){if(V.objectStoreNames.contains(f.storeName)){var j=V.version+1;Ve(f);var $=te[f.name],W=$.forages;V.close();for(var se=0;se<W.length;se++){var Ie=W[se];Ie._dbInfo.db=null,Ie._dbInfo.version=j}var He=new E(function(je,lt){var at=d.open(f.name,j);at.onerror=function(Zt){var ei=at.result;ei.close(),lt(Zt)},at.onupgradeneeded=function(){var Zt=at.result;Zt.deleteObjectStore(f.storeName)},at.onsuccess=function(){var Zt=at.result;Zt.close(),je(Zt)}});return He.then(function(je){$.db=je;for(var lt=0;lt<W.length;lt++){var at=W[lt];at._dbInfo.db=je,Pe(at._dbInfo)}}).catch(function(je){throw(Le(f,je)||E.resolve()).catch(function(){}),je})}}):I=R.then(function(V){Ve(f);var j=te[f.name],$=j.forages;V.close();for(var W=0;W<$.length;W++){var se=$[W];se._dbInfo.db=null}var Ie=new E(function(He,je){var lt=d.deleteDatabase(f.name);lt.onerror=function(){var at=lt.result;at&&at.close(),je(lt.error)},lt.onblocked=function(){console.warn('dropInstance blocked for database "'+f.name+'" until all open connections are closed')},lt.onsuccess=function(){var at=lt.result;at&&at.close(),He(at)}});return Ie.then(function(He){j.db=He;for(var je=0;je<$.length;je++){var lt=$[je];Pe(lt._dbInfo)}}).catch(function(He){throw(Le(f,He)||E.resolve()).catch(function(){}),He})})}return w(I,b),I}var _e={_driver:"asyncStorage",_initStorage:oe,_support:_(),iterate:de,getItem:ae,setItem:ee,removeItem:ce,clear:re,length:he,key:le,keys:me,dropInstance:ge};function p(){return typeof openDatabase=="function"}var a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c="~~local_forage_type~",g=/^~~local_forage_type~([^~]+)~/,T="__lfsc__:",A=T.length,F="arbf",ye="blob",Te="si08",we="ui08",Be="uic8",Ue="si16",tt="si32",$t="ur16",Jt="ui32",Tn="fl32",xt="fl64",Gt=A+F.length,ji=Object.prototype.toString;function sl(f){var b=f.length*.75,m=f.length,S,I=0,C,R,V,j;f[f.length-1]==="="&&(b--,f[f.length-2]==="="&&b--);var $=new ArrayBuffer(b),W=new Uint8Array($);for(S=0;S<m;S+=4)C=a.indexOf(f[S]),R=a.indexOf(f[S+1]),V=a.indexOf(f[S+2]),j=a.indexOf(f[S+3]),W[I++]=C<<2|R>>4,W[I++]=(R&15)<<4|V>>2,W[I++]=(V&3)<<6|j&63;return $}function xs(f){var b=new Uint8Array(f),m="",S;for(S=0;S<b.length;S+=3)m+=a[b[S]>>2],m+=a[(b[S]&3)<<4|b[S+1]>>4],m+=a[(b[S+1]&15)<<2|b[S+2]>>6],m+=a[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 Mp(f,b){var m="";if(f&&(m=ji.call(f)),f&&(m==="[object ArrayBuffer]"||f.buffer&&ji.call(f.buffer)==="[object ArrayBuffer]")){var S,I=T;f instanceof ArrayBuffer?(S=f,I+=F):(S=f.buffer,m==="[object Int8Array]"?I+=Te:m==="[object Uint8Array]"?I+=we:m==="[object Uint8ClampedArray]"?I+=Be:m==="[object Int16Array]"?I+=Ue:m==="[object Uint16Array]"?I+=$t:m==="[object Int32Array]"?I+=tt:m==="[object Uint32Array]"?I+=Jt:m==="[object Float32Array]"?I+=Tn:m==="[object Float64Array]"?I+=xt:b(new Error("Failed to get type for BinaryArray"))),b(I+xs(S))}else if(m==="[object Blob]"){var C=new FileReader;C.onload=function(){var R=c+f.type+"~"+xs(this.result);b(T+ye+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 Pp(f){if(f.substring(0,A)!==T)return JSON.parse(f);var b=f.substring(Gt),m=f.substring(A,Gt),S;if(m===ye&&g.test(b)){var I=b.match(g);S=I[1],b=b.substring(I[0].length)}var C=sl(b);switch(m){case F:return C;case ye:return h([C],{type:S});case Te:return new Int8Array(C);case we:return new Uint8Array(C);case Be:return new Uint8ClampedArray(C);case Ue:return new Int16Array(C);case $t:return new Uint16Array(C);case tt:return new Int32Array(C);case Jt:return new Uint32Array(C);case Tn:return new Float32Array(C);case xt:return new Float64Array(C);default:throw new Error("Unkown type: "+m)}}var Os={serialize:Mp,deserialize:Pp,stringToBuffer:sl,bufferToString:xs};function al(f,b,m,S){f.executeSql("CREATE TABLE IF NOT EXISTS "+b.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],m,S)}function Lp(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(V){return R(V)}m.db.transaction(function(V){al(V,m,function(){b._dbInfo=m,C()},function(j,$){R($)})},R)});return m.serializer=Os,I}function jn(f,b,m,S,I,C){f.executeSql(m,S,I,function(R,V){V.code===V.SYNTAX_ERR?R.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[b.storeName],function(j,$){$.rows.length?C(j,V):al(j,b,function(){j.executeSql(m,S,I,C)},C)},C):C(R,V)},C)}function Fp(f,b){var m=this;f=B(f);var S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(V){jn(V,R,"SELECT * FROM "+R.storeName+" WHERE key = ? LIMIT 1",[f],function(j,$){var W=$.rows.length?$.rows.item(0).value:null;W&&(W=R.serializer.deserialize(W)),I(W)},function(j,$){C($)})})}).catch(C)});return w(S,b),S}function kp(f,b){var m=this,S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(V){jn(V,R,"SELECT * FROM "+R.storeName,[],function(j,$){for(var W=$.rows,se=W.length,Ie=0;Ie<se;Ie++){var He=W.item(Ie),je=He.value;if(je&&(je=R.serializer.deserialize(je)),je=f(je,He.key,Ie+1),je!==void 0){I(je);return}}I()},function(j,$){C($)})})}).catch(C)});return w(S,b),S}function cl(f,b,m,S){var I=this;f=B(f);var C=new E(function(R,V){I.ready().then(function(){b===void 0&&(b=null);var j=b,$=I._dbInfo;$.serializer.serialize(b,function(W,se){se?V(se):$.db.transaction(function(Ie){jn(Ie,$,"INSERT OR REPLACE INTO "+$.storeName+" (key, value) VALUES (?, ?)",[f,W],function(){R(j)},function(He,je){V(je)})},function(Ie){if(Ie.code===Ie.QUOTA_ERR){if(S>0){R(cl.apply(I,[f,j,m,S-1]));return}V(Ie)}})})}).catch(V)});return w(C,m),C}function Vp(f,b,m){return cl.apply(this,[f,b,m,1])}function Bp(f,b){var m=this;f=B(f);var S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(V){jn(V,R,"DELETE FROM "+R.storeName+" WHERE key = ?",[f],function(){I()},function(j,$){C($)})})}).catch(C)});return w(S,b),S}function Up(f){var b=this,m=new E(function(S,I){b.ready().then(function(){var C=b._dbInfo;C.db.transaction(function(R){jn(R,C,"DELETE FROM "+C.storeName,[],function(){S()},function(V,j){I(j)})})}).catch(I)});return w(m,f),m}function Hp(f){var b=this,m=new E(function(S,I){b.ready().then(function(){var C=b._dbInfo;C.db.transaction(function(R){jn(R,C,"SELECT COUNT(key) as c FROM "+C.storeName,[],function(V,j){var $=j.rows.item(0).c;S($)},function(V,j){I(j)})})}).catch(I)});return w(m,f),m}function jp(f,b){var m=this,S=new E(function(I,C){m.ready().then(function(){var R=m._dbInfo;R.db.transaction(function(V){jn(V,R,"SELECT key FROM "+R.storeName+" WHERE id = ? LIMIT 1",[f+1],function(j,$){var W=$.rows.length?$.rows.item(0).key:null;I(W)},function(j,$){C($)})})}).catch(C)});return w(S,b),S}function $p(f){var b=this,m=new E(function(S,I){b.ready().then(function(){var C=b._dbInfo;C.db.transaction(function(R){jn(R,C,"SELECT key FROM "+C.storeName,[],function(V,j){for(var $=[],W=0;W<j.rows.length;W++)$.push(j.rows.item(W).key);S($)},function(V,j){I(j)})})}).catch(I)});return w(m,f),m}function Gp(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=[],V=0;V<C.rows.length;V++)R.push(C.rows.item(V).name);b({db:f,storeNames:R})},function(I,C){m(C)})},function(S){m(S)})})}function Wp(f,b){b=P.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(Gp(R))}).then(function(C){return new E(function(R,V){C.db.transaction(function(j){function $(He){return new E(function(je,lt){j.executeSql("DROP TABLE IF EXISTS "+He,[],function(){je()},function(at,Zt){lt(Zt)})})}for(var W=[],se=0,Ie=C.storeNames.length;se<Ie;se++)W.push($(C.storeNames[se]));E.all(W).then(function(){R()}).catch(function(He){V(He)})},function(j){V(j)})})}):I=E.reject("Invalid arguments"),w(I,b),I}var Yp={_driver:"webSQLStorage",_initStorage:Lp,_support:p(),iterate:kp,getItem:Fp,setItem:Vp,removeItem:Bp,clear:Up,length:Hp,key:jp,keys:$p,dropInstance:Wp};function zp(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ll(f,b){var m=f.name+"/";return f.storeName!==b.storeName&&(m+=f.storeName+"/"),m}function qp(){var f="_localforage_support_test";try{return localStorage.setItem(f,!0),localStorage.removeItem(f),!1}catch{return!0}}function Kp(){return!qp()||localStorage.length>0}function Xp(f){var b=this,m={};if(f)for(var S in f)m[S]=f[S];return m.keyPrefix=ll(f,b._defaultConfig),Kp()?(b._dbInfo=m,m.serializer=Os,E.resolve()):E.reject()}function Jp(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 Zp(f,b){var m=this;f=B(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 Qp(f,b){var m=this,S=m.ready().then(function(){for(var I=m._dbInfo,C=I.keyPrefix,R=C.length,V=localStorage.length,j=1,$=0;$<V;$++){var W=localStorage.key($);if(W.indexOf(C)===0){var se=localStorage.getItem(W);if(se&&(se=I.serializer.deserialize(se)),se=f(se,W.substring(R),j++),se!==void 0)return se}}});return w(S,b),S}function eh(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 th(f){var b=this,m=b.ready().then(function(){for(var S=b._dbInfo,I=localStorage.length,C=[],R=0;R<I;R++){var V=localStorage.key(R);V.indexOf(S.keyPrefix)===0&&C.push(V.substring(S.keyPrefix.length))}return C});return w(m,f),m}function nh(f){var b=this,m=b.keys().then(function(S){return S.length});return w(m,f),m}function rh(f,b){var m=this;f=B(f);var S=m.ready().then(function(){var I=m._dbInfo;localStorage.removeItem(I.keyPrefix+f)});return w(S,b),S}function ih(f,b,m){var S=this;f=B(f);var I=S.ready().then(function(){b===void 0&&(b=null);var C=b;return new E(function(R,V){var j=S._dbInfo;j.serializer.serialize(b,function($,W){if(W)V(W);else try{localStorage.setItem(j.keyPrefix+f,$),R(C)}catch(se){(se.name==="QuotaExceededError"||se.name==="NS_ERROR_DOM_QUOTA_REACHED")&&V(se),V(se)}})})});return w(I,m),I}function oh(f,b){if(b=P.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(ll(f,S._defaultConfig)):C(f.name+"/")}).then(function(C){for(var R=localStorage.length-1;R>=0;R--){var V=localStorage.key(R);V.indexOf(C)===0&&localStorage.removeItem(V)}}):I=E.reject("Invalid arguments"),w(I,b),I}var sh={_driver:"localStorageWrapper",_initStorage:Xp,_support:zp(),iterate:Qp,getItem:Zp,setItem:ih,removeItem:rh,clear:Jp,length:nh,key:eh,keys:th,dropInstance:oh},ah=function(b,m){return b===m||typeof b=="number"&&typeof m=="number"&&isNaN(b)&&isNaN(m)},ch=function(b,m){for(var S=b.length,I=0;I<S;){if(ah(b[I],m))return!0;I++}return!1},ul=Array.isArray||function(f){return Object.prototype.toString.call(f)==="[object Array]"},Qr={},dl={},vr={INDEXEDDB:_e,WEBSQL:Yp,LOCALSTORAGE:sh},lh=[vr.INDEXEDDB._driver,vr.WEBSQL._driver,vr.LOCALSTORAGE._driver],$i=["dropInstance"],Ds=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat($i),uh={description:"",driver:lh.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function dh(f,b){f[b]=function(){var m=arguments;return f.ready().then(function(){return f[b].apply(f,m)})}}function As(){for(var f=1;f<arguments.length;f++){var b=arguments[f];if(b)for(var m in b)b.hasOwnProperty(m)&&(ul(b[m])?arguments[0][m]=b[m].slice():arguments[0][m]=b[m])}return arguments[0]}var fh=function(){function f(b){l(this,f);for(var m in vr)if(vr.hasOwnProperty(m)){var S=vr[m],I=S._driver;this[m]=I,Qr[I]||this.defineDriver(S)}this._defaultConfig=As({},uh),this._config=As({},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,V){try{var j=m._driver,$=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!m._driver){V($);return}for(var W=Ds.concat("_initStorage"),se=0,Ie=W.length;se<Ie;se++){var He=W[se],je=!ch($i,He);if((je||m[He])&&typeof m[He]!="function"){V($);return}}var lt=function(){for(var ei=function(mh){return function(){var gh=new Error("Method "+mh+" is not implemented by the current driver"),fl=E.reject(gh);return w(fl,arguments[arguments.length-1]),fl}},Ns=0,hh=$i.length;Ns<hh;Ns++){var Rs=$i[Ns];m[Rs]||(m[Rs]=ei(Rs))}};lt();var at=function(ei){Qr[j]&&console.info("Redefining LocalForage driver: "+j),Qr[j]=m,dl[j]=ei,R()};"_support"in m?m._support&&typeof m._support=="function"?m._support().then(at,V):at(!!m._support):at(!0)}catch(Zt){V(Zt)}});return N(C,S,I),C},f.prototype.driver=function(){return this._driver||null},f.prototype.getDriver=function(m,S,I){var C=Qr[m]?E.resolve(Qr[m]):E.reject(new Error("Driver not found."));return N(C,S,I),C},f.prototype.getSerializer=function(m){var S=E.resolve(Os);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;ul(m)||(m=[m]);var R=this._getSupportedDrivers(m);function V(){C._config.driver=C.driver()}function j(se){return C._extend(se),V(),C._ready=C._initStorage(C._config),C._ready}function $(se){return function(){var Ie=0;function He(){for(;Ie<se.length;){var je=se[Ie];return Ie++,C._dbInfo=null,C._ready=null,C.getDriver(je).then(j).catch(He)}V();var lt=new Error("No available storage method found.");return C._driverSet=E.reject(lt),C._driverSet}return He()}}var W=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=W.then(function(){var se=R[0];return C._dbInfo=null,C._ready=null,C.getDriver(se).then(function(Ie){C._driver=Ie._driver,V(),C._wrapLibraryMethodsWithReady(),C._initDriver=$(R)})}).catch(function(){V();var se=new Error("No available storage method found.");return C._driverSet=E.reject(se),C._driverSet}),N(this._driverSet,S,I),this._driverSet},f.prototype.supports=function(m){return!!dl[m]},f.prototype._extend=function(m){As(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=Ds.length;m<S;m++)dh(this,Ds[m])},f.prototype.createInstance=function(m){return new f(m)},f}(),ph=new fh;i.exports=ph},{3:3}]},{},[4])(4)})});var lu=Gi((qs,Ks)=>{"use strict";(function(t,e){typeof qs=="object"&&typeof Ks<"u"?Ks.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.fetchRetry=e())})(qs,function(){"use strict";var t=function(r,i){if(i=i||{},typeof r!="function")throw new n("fetch must be a function");if(typeof i!="object")throw new n("defaults must be an object");if(i.retries!==void 0&&!e(i.retries))throw new n("retries must be a positive integer");if(i.retryDelay!==void 0&&!e(i.retryDelay)&&typeof i.retryDelay!="function")throw new n("retryDelay must be a positive integer or a function returning a positive integer");if(i.retryOn!==void 0&&!Array.isArray(i.retryOn)&&typeof i.retryOn!="function")throw new n("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(l,u){var d=i.retries,_=i.retryDelay,h=i.retryOn;if(u&&u.retries!==void 0)if(e(u.retries))d=u.retries;else throw new n("retries must be a positive integer");if(u&&u.retryDelay!==void 0)if(e(u.retryDelay)||typeof u.retryDelay=="function")_=u.retryDelay;else throw new n("retryDelay must be a positive integer or a function returning a positive integer");if(u&&u.retryOn)if(Array.isArray(u.retryOn)||typeof u.retryOn=="function")h=u.retryOn;else throw new n("retryOn property expects an array or function");return new Promise(function(E,w){var N=function(P){var z=typeof Request<"u"&&l instanceof Request?l.clone():l;r(z,u).then(function(G){if(Array.isArray(h)&&h.indexOf(G.status)===-1)E(G);else if(typeof h=="function")try{return Promise.resolve(h(P,null,G)).then(function(te){te?B(P,null,G):E(G)}).catch(w)}catch(te){w(te)}else P<d?B(P,null,G):E(G)}).catch(function(G){if(typeof h=="function")try{Promise.resolve(h(P,G,null)).then(function(te){te?B(P,G,null):w(G)}).catch(function(te){w(te)})}catch(te){w(te)}else P<d?B(P,G,null):w(G)})};function B(P,z,G){var te=typeof _=="function"?_(P,z,G):_;setTimeout(function(){N(++P)},te)}N(0)})}};function e(r){return Number.isInteger(r)&&r>=0}function n(r){this.name="ArgumentError",this.message=r}return t})});var of=Gi((zo,rf)=>{"use strict";(function(t,e){typeof zo=="object"&&typeof rf<"u"?e(zo):typeof define=="function"&&define.amd?define(["exports"],e):e((t=typeof globalThis<"u"?globalThis:t||self).Sqrl={})})(zo,function(t){"use strict";function e(D){var O,L,M=new Error(D);return O=M,L=e.prototype,Object.setPrototypeOf?Object.setPrototypeOf(O,L):O.__proto__=L,M}function n(D,O,L){var M=O.slice(0,L).split(/\n/),v=M.length,y=M[v-1].length+1;throw e(D+=" at line "+v+" col "+y+`:
1
+ import{a as Gt,b as vt,c as Zr,d as Gr,e as Xr,g as Qt,h as Kr,i as Qr,j as ie,k as Fe,n as tn,o as en,p as de,q as rn,r as nn,s as sr,v as on,w as sn,x as an,y as cn,z as ln}from"./chunk-5EYT2ZXX.js";import{a as Le}from"./chunk-E3MW7QNG.js";import{$a as ne,Bb as qr,C as ue,Cb as me,E as at,Ea as Yt,F as ct,Fa as _t,G as xe,Ga as Mt,H as Ee,Ha as $r,I as nr,Ia as Z,K as Tr,L as zt,La as Ae,M as Br,Ma as Me,Na as De,O as Ar,Qa as Jt,R as Bt,Ra as or,S as Wt,T as J,Ta as kr,U as Mr,Ua as Dt,V as Dr,Va as Hr,Wa as pe,X as ir,_a as Se,a as Pt,aa as ht,ab as qt,b as er,bb as he,da as Rr,e as Wn,ea as dt,eb as zr,f as Yn,fa as Fr,fb as Wr,gb as Ut,hb as Zt,i as Te,ia as Lr,ib as Yr,ka as Pr,kb as Jr,l as rr,la as Be,ma as mt,na as gt,oa as Vr,pa as Ct,qa as It,r as Ir,ra as yt,sa as rt,ta as nt,ua as re,va as At,w as Nr,wa as Vt,wb as Re,x as Or,xa as Nt,ya as Ur,za as jr}from"./chunk-S6UU36F3.js";var hn=Wn((Pe,pn)=>{"use strict";(function(e,t){typeof Pe=="object"&&typeof pn<"u"?t(Pe):typeof define=="function"&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).Sqrl={})})(Pe,function(e){"use strict";function t(g){var m,b,w=new Error(g);return m=w,b=t.prototype,Object.setPrototypeOf?Object.setPrototypeOf(m,b):m.__proto__=b,w}function r(g,m,b){var w=m.slice(0,b).split(/\n/),f=w.length,u=w[f-1].length+1;throw t(g+=" at line "+f+" col "+u+`:
2
2
 
3
- `+O.split(/\n/)[v-1]+`
4
- `+Array(y).join(" ")+"^")}e.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var r=new Function("return this")().Promise,i=!1;try{i=new Function("return (async function(){}).constructor")()}catch(D){if(!(D instanceof SyntaxError))throw D}function o(D,O){return Object.prototype.hasOwnProperty.call(D,O)}function s(D,O,L){for(var M in O)o(O,M)&&(O[M]==null||typeof O[M]!="object"||M!=="storage"&&M!=="prefixes"||L?D[M]=O[M]:D[M]=s({},O[M]));return D}var l=/^async +/,u=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,d=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,_=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,h=/[.*+\-?^${}()|[\]\\]/g;function E(D){return h.test(D)?D.replace(h,"\\$&"):D}function w(D,O){O.rmWhitespace&&(D=D.replace(/[\r\n]+/g,`
5
- `).replace(/^\s+|\s+$/gm,"")),u.lastIndex=0,d.lastIndex=0,_.lastIndex=0;var L=O.prefixes,M=[L.h,L.b,L.i,L.r,L.c,L.e].reduce(function(ce,re){return ce&&re?ce+"|"+E(re):re?E(re):ce},""),v=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+E(O.tags[1])+")","g"),y=new RegExp("([^]*?)"+E(O.tags[0])+"(-|_)?\\s*("+M+")?\\s*","g"),U=0,X=!1;function oe(ce,re){var he,le={f:[]},me=0,ge="c";function _e(ye){var Te=D.slice(U,ye),we=Te.trim();if(ge==="f")we==="safe"?le.raw=!0:O.async&&l.test(we)?(we=we.replace(l,""),le.f.push([we,"",!0])):le.f.push([we,""]);else if(ge==="fp")le.f[le.f.length-1][1]+=we;else if(ge==="err"){if(we){var Be=Te.search(/\S/);n("invalid syntax",D,U+Be)}}else le[ge]=we;U=ye+1}for(re==="h"||re==="b"||re==="c"?ge="n":re==="r"&&(le.raw=!0,re="i"),v.lastIndex=U;(he=v.exec(D))!==null;){var p=he[1],a=he[2],c=he[3],g=he[4],T=he[5],A=he.index;if(p)p==="("?(me===0&&(ge==="n"?(_e(A),ge="p"):ge==="f"&&(_e(A),ge="fp")),me++):p===")"?--me===0&&ge!=="c"&&(_e(A),ge="err"):me===0&&p==="|"?(_e(A),ge="f"):p==="=>"&&(_e(A),U+=1,ge="res");else if(a)if(a==="/*"){var F=D.indexOf("*/",v.lastIndex);F===-1&&n("unclosed comment",D,he.index),v.lastIndex=F+2}else a==="'"?(d.lastIndex=he.index,d.exec(D)?v.lastIndex=d.lastIndex:n("unclosed string",D,he.index)):a==='"'?(_.lastIndex=he.index,_.exec(D)?v.lastIndex=_.lastIndex:n("unclosed string",D,he.index)):a==="`"&&(u.lastIndex=he.index,u.exec(D)?v.lastIndex=u.lastIndex:n("unclosed string",D,he.index));else if(c)return _e(A),U=A+he[0].length,y.lastIndex=U,X=T,g&&re==="h"&&(re="s"),le.t=re,le}return n("unclosed tag",D,ce),le}var ae=function ce(re,he){re.b=[],re.d=[];var le,me=!1,ge=[];function _e(Be,Ue){Be&&(Be=function(tt,$t,Jt,Tn){var xt,Gt;return typeof $t.autoTrim=="string"?xt=Gt=$t.autoTrim:Array.isArray($t.autoTrim)&&(xt=$t.autoTrim[1],Gt=$t.autoTrim[0]),(Jt||Jt===!1)&&(xt=Jt),(Tn||Tn===!1)&&(Gt=Tn),xt==="slurp"&&Gt==="slurp"?tt.trim():(xt==="_"||xt==="slurp"?tt=String.prototype.trimLeft?tt.trimLeft():tt.replace(/^[\s\uFEFF\xA0]+/,""):xt!=="-"&&xt!=="nl"||(tt=tt.replace(/^(?:\n|\r|\r\n)/,"")),Gt==="_"||Gt==="slurp"?tt=String.prototype.trimRight?tt.trimRight():tt.replace(/[\s\uFEFF\xA0]+$/,""):Gt!=="-"&&Gt!=="nl"||(tt=tt.replace(/(?:\n|\r|\r\n)$/,"")),tt)}(Be,O,X,Ue))&&(Be=Be.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),ge.push(Be))}for(;(le=y.exec(D))!==null;){var p,a=le[1],c=le[2],g=le[3]||"";for(var T in L)if(L[T]===g){p=T;break}_e(a,c),U=le.index+le[0].length,p||n("unrecognized tag type: "+g,D,U);var A=oe(le.index,p),F=A.t;if(F==="h"){var ye=A.n||"";O.async&&l.test(ye)&&(A.a=!0,A.n=ye.replace(l,"")),A=ce(A),ge.push(A)}else if(F==="c"){if(re.n===A.n)return me?(me.d=ge,re.b.push(me)):re.d=ge,re;n("Helper start and end don't match",D,le.index+le[0].length)}else if(F==="b"){me?(me.d=ge,re.b.push(me)):re.d=ge;var Te=A.n||"";O.async&&l.test(Te)&&(A.a=!0,A.n=Te.replace(l,"")),me=A,ge=[]}else if(F==="s"){var we=A.n||"";O.async&&l.test(we)&&(A.a=!0,A.n=we.replace(l,"")),ge.push(A)}else ge.push(A)}if(!he)throw e('unclosed helper "'+re.n+'"');return _e(D.slice(U,D.length),!1),re.d=ge,re}({f:[]},!0);if(O.plugins)for(var de=0;de<O.plugins.length;de++){var ee=O.plugins[de];ee.processAST&&(ae.d=ee.processAST(ae.d,O))}return ae.d}function N(D,O){var L=w(D,O),M="var tR='';"+(O.useWith?"with("+O.varName+"||{}){":"")+te(L,O)+"if(cb){cb(null,tR)} return tR"+(O.useWith?"}":"");if(O.plugins)for(var v=0;v<O.plugins.length;v++){var y=O.plugins[v];y.processFnString&&(M=y.processFnString(M,O))}return M}function B(D,O){for(var L=0;L<O.length;L++){var M=O[L][0],v=O[L][1];D=(O[L][2]?"await ":"")+"c.l('F','"+M+"')("+D,v&&(D+=","+v),D+=")"}return D}function P(D,O,L,M,v,y){var U="{exec:"+(v?"async ":"")+G(L,O,D)+",params:["+M+"]";return y&&(U+=",name:'"+y+"'"),v&&(U+=",async:true"),U+="}"}function z(D,O){for(var L="[",M=0;M<D.length;M++){var v=D[M];L+=P(O,v.res||"",v.d,v.p||"",v.a,v.n),M<D.length&&(L+=",")}return L+="]"}function G(D,O,L){return"function("+O+"){var tR='';"+te(D,L)+"return tR}"}function te(D,O){for(var L=0,M=D.length,v="";L<M;L++){var y=D[L];if(typeof y=="string")v+="tR+='"+y+"';";else{var U=y.t,X=y.c||"",oe=y.f,ae=y.n||"",de=y.p||"",ee=y.res||"",ce=y.b,re=!!y.a;if(U==="i"){O.defaultFilter&&(X="c.l('F','"+O.defaultFilter+"')("+X+")");var he=B(X,oe);!y.raw&&O.autoEscape&&(he="c.l('F','e')("+he+")"),v+="tR+="+he+";"}else if(U==="h")if(O.storage.nativeHelpers.get(ae))v+=O.storage.nativeHelpers.get(ae)(y,O);else{var le=(re?"await ":"")+"c.l('H','"+ae+"')("+P(O,ee,y.d,de,re);le+=ce?","+z(ce,O):",[]",v+="tR+="+B(le+=",c)",oe)+";"}else U==="s"?v+="tR+="+B((re?"await ":"")+"c.l('H','"+ae+"')({params:["+de+"]},[],c)",oe)+";":U==="e"&&(v+=X+`
6
- `)}}return v}var q=function(){function D(O){this.cache=O}return D.prototype.define=function(O,L){this.cache[O]=L},D.prototype.get=function(O){return this.cache[O]},D.prototype.remove=function(O){delete this.cache[O]},D.prototype.reset=function(){this.cache={}},D.prototype.load=function(O){s(this.cache,O,!0)},D}();function Me(D,O,L,M){if(O&&O.length>0)throw e((M?"Native":"")+"Helper '"+D+"' doesn't accept blocks");if(L&&L.length>0)throw e((M?"Native":"")+"Helper '"+D+"' doesn't accept filters")}var H={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function ve(D){return H[D]}var fe=new q({}),be=new q({each:function(D,O){var L="",M=D.params[0];if(Me("each",O,!1),D.async)return new Promise(function(y){(function U(X,oe,ae,de,ee){ae(X[oe],oe).then(function(ce){de+=ce,oe===X.length-1?ee(de):U(X,oe+1,ae,de,ee)})})(M,0,D.exec,L,y)});for(var v=0;v<M.length;v++)L+=D.exec(M[v],v);return L},foreach:function(D,O){var L=D.params[0];if(Me("foreach",O,!1),D.async)return new Promise(function(y){(function U(X,oe,ae,de,ee,ce){de(oe[ae],X[oe[ae]]).then(function(re){ee+=re,ae===oe.length-1?ce(ee):U(X,oe,ae+1,de,ee,ce)})})(L,Object.keys(L),0,D.exec,"",y)});var M="";for(var v in L)o(L,v)&&(M+=D.exec(v,L[v]));return M},include:function(D,O,L){Me("include",O,!1);var M=L.storage.templates.get(D.params[0]);if(!M)throw e('Could not fetch template "'+D.params[0]+'"');return M(D.params[1],L)},extends:function(D,O,L){var M=D.params[1]||{};M.content=D.exec();for(var v=0;v<O.length;v++){var y=O[v];M[y.name]=y.exec()}var U=L.storage.templates.get(D.params[0]);if(!U)throw e('Could not fetch template "'+D.params[0]+'"');return U(M,L)},useScope:function(D,O){return Me("useScope",O,!1),D.exec(D.params[0])}}),Ve=new q({if:function(D,O){Me("if",!1,D.f,!0);var L="if("+D.p+"){"+te(D.d,O)+"}";if(D.b)for(var M=0;M<D.b.length;M++){var v=D.b[M];v.n==="else"?L+="else{"+te(v.d,O)+"}":v.n==="elif"&&(L+="else if("+v.p+"){"+te(v.d,O)+"}")}return L},try:function(D,O){if(Me("try",!1,D.f,!0),!D.b||D.b.length!==1||D.b[0].n!=="catch")throw e("native helper 'try' only accepts 1 block, 'catch'");var L="try{"+te(D.d,O)+"}",M=D.b[0];return L+="catch"+(M.res?"("+M.res+")":"")+"{"+te(M.d,O)+"}"},block:function(D,O){return Me("block",D.b,D.f,!0),"if(!"+O.varName+"["+D.p+"]){tR+=("+G(D.d,"",O)+")()}else{tR+="+O.varName+"["+D.p+"]}"}}),Pe=new q({e:function(D){var O=String(D);return/[&<>"']/.test(O)?O.replace(/[&<>"']/g,ve):O}}),Le={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(D,O){if(D==="H"){var L=this.storage.helpers.get(O);if(L)return L;throw e("Can't find helper '"+O+"'")}if(D==="F"){var M=this.storage.filters.get(O);if(M)return M;throw e("Can't find filter '"+O+"'")}},async:!1,storage:{helpers:be,nativeHelpers:Ve,filters:Pe,templates:fe},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function ze(D,O){var L={};return s(L,Le),O&&s(L,O),D&&s(L,D),L.l.bind(L),L}function Xe(D,O){var L,M=ze(O||{}),v=Function;if(M.async){if(!i)throw e("This environment doesn't support async/await");v=i}if(M.varName&&(L=M.varName,/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(L)===!1))throw e("options.varName must be a valid JS identifier");try{return new v(M.varName,"c","cb",N(D,M))}catch(y){throw y instanceof SyntaxError?e(`Bad template syntax
3
+ `+m.split(/\n/)[f-1]+`
4
+ `+Array(u).join(" ")+"^")}t.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var o=new Function("return this")().Promise,p=!1;try{p=new Function("return (async function(){}).constructor")()}catch(g){if(!(g instanceof SyntaxError))throw g}function l(g,m){return Object.prototype.hasOwnProperty.call(g,m)}function a(g,m,b){for(var w in m)l(m,w)&&(m[w]==null||typeof m[w]!="object"||w!=="storage"&&w!=="prefixes"||b?g[w]=m[w]:g[w]=a({},m[w]));return g}var d=/^async +/,v=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,E=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,C=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,S=/[.*+\-?^${}()|[\]\\]/g;function I(g){return S.test(g)?g.replace(S,"\\$&"):g}function z(g,m){m.rmWhitespace&&(g=g.replace(/[\r\n]+/g,`
5
+ `).replace(/^\s+|\s+$/gm,"")),v.lastIndex=0,E.lastIndex=0,C.lastIndex=0;var b=m.prefixes,w=[b.h,b.b,b.i,b.r,b.c,b.e].reduce(function(R,B){return R&&B?R+"|"+I(B):B?I(B):R},""),f=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+I(m.tags[1])+")","g"),u=new RegExp("([^]*?)"+I(m.tags[0])+"(-|_)?\\s*("+w+")?\\s*","g"),x=0,N=!1;function A(R,B){var V,F={f:[]},U=0,j="c";function $(H){var q=g.slice(x,H),W=q.trim();if(j==="f")W==="safe"?F.raw=!0:m.async&&d.test(W)?(W=W.replace(d,""),F.f.push([W,"",!0])):F.f.push([W,""]);else if(j==="fp")F.f[F.f.length-1][1]+=W;else if(j==="err"){if(W){var Q=q.search(/\S/);r("invalid syntax",g,x+Q)}}else F[j]=W;x=H+1}for(B==="h"||B==="b"||B==="c"?j="n":B==="r"&&(F.raw=!0,B="i"),f.lastIndex=x;(V=f.exec(g))!==null;){var s=V[1],n=V[2],i=V[3],c=V[4],h=V[5],y=V.index;if(s)s==="("?(U===0&&(j==="n"?($(y),j="p"):j==="f"&&($(y),j="fp")),U++):s===")"?--U===0&&j!=="c"&&($(y),j="err"):U===0&&s==="|"?($(y),j="f"):s==="=>"&&($(y),x+=1,j="res");else if(n)if(n==="/*"){var _=g.indexOf("*/",f.lastIndex);_===-1&&r("unclosed comment",g,V.index),f.lastIndex=_+2}else n==="'"?(E.lastIndex=V.index,E.exec(g)?f.lastIndex=E.lastIndex:r("unclosed string",g,V.index)):n==='"'?(C.lastIndex=V.index,C.exec(g)?f.lastIndex=C.lastIndex:r("unclosed string",g,V.index)):n==="`"&&(v.lastIndex=V.index,v.exec(g)?f.lastIndex=v.lastIndex:r("unclosed string",g,V.index));else if(i)return $(y),x=y+V[0].length,u.lastIndex=x,N=h,c&&B==="h"&&(B="s"),F.t=B,F}return r("unclosed tag",g,R),F}var M=function R(B,V){B.b=[],B.d=[];var F,U=!1,j=[];function $(Q,tt){Q&&(Q=function(st,Ft,Ht,fe){var St,Lt;return typeof Ft.autoTrim=="string"?St=Lt=Ft.autoTrim:Array.isArray(Ft.autoTrim)&&(St=Ft.autoTrim[1],Lt=Ft.autoTrim[0]),(Ht||Ht===!1)&&(St=Ht),(fe||fe===!1)&&(Lt=fe),St==="slurp"&&Lt==="slurp"?st.trim():(St==="_"||St==="slurp"?st=String.prototype.trimLeft?st.trimLeft():st.replace(/^[\s\uFEFF\xA0]+/,""):St!=="-"&&St!=="nl"||(st=st.replace(/^(?:\n|\r|\r\n)/,"")),Lt==="_"||Lt==="slurp"?st=String.prototype.trimRight?st.trimRight():st.replace(/[\s\uFEFF\xA0]+$/,""):Lt!=="-"&&Lt!=="nl"||(st=st.replace(/(?:\n|\r|\r\n)$/,"")),st)}(Q,m,N,tt))&&(Q=Q.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),j.push(Q))}for(;(F=u.exec(g))!==null;){var s,n=F[1],i=F[2],c=F[3]||"";for(var h in b)if(b[h]===c){s=h;break}$(n,i),x=F.index+F[0].length,s||r("unrecognized tag type: "+c,g,x);var y=A(F.index,s),_=y.t;if(_==="h"){var H=y.n||"";m.async&&d.test(H)&&(y.a=!0,y.n=H.replace(d,"")),y=R(y),j.push(y)}else if(_==="c"){if(B.n===y.n)return U?(U.d=j,B.b.push(U)):B.d=j,B;r("Helper start and end don't match",g,F.index+F[0].length)}else if(_==="b"){U?(U.d=j,B.b.push(U)):B.d=j;var q=y.n||"";m.async&&d.test(q)&&(y.a=!0,y.n=q.replace(d,"")),U=y,j=[]}else if(_==="s"){var W=y.n||"";m.async&&d.test(W)&&(y.a=!0,y.n=W.replace(d,"")),j.push(y)}else j.push(y)}if(!V)throw t('unclosed helper "'+B.n+'"');return $(g.slice(x,g.length),!1),B.d=j,B}({f:[]},!0);if(m.plugins)for(var L=0;L<m.plugins.length;L++){var O=m.plugins[L];O.processAST&&(M.d=O.processAST(M.d,m))}return M.d}function P(g,m){var b=z(g,m),w="var tR='';"+(m.useWith?"with("+m.varName+"||{}){":"")+K(b,m)+"if(cb){cb(null,tR)} return tR"+(m.useWith?"}":"");if(m.plugins)for(var f=0;f<m.plugins.length;f++){var u=m.plugins[f];u.processFnString&&(w=u.processFnString(w,m))}return w}function Y(g,m){for(var b=0;b<m.length;b++){var w=m[b][0],f=m[b][1];g=(m[b][2]?"await ":"")+"c.l('F','"+w+"')("+g,f&&(g+=","+f),g+=")"}return g}function k(g,m,b,w,f,u){var x="{exec:"+(f?"async ":"")+X(b,m,g)+",params:["+w+"]";return u&&(x+=",name:'"+u+"'"),f&&(x+=",async:true"),x+="}"}function et(g,m){for(var b="[",w=0;w<g.length;w++){var f=g[w];b+=k(m,f.res||"",f.d,f.p||"",f.a,f.n),w<g.length&&(b+=",")}return b+="]"}function X(g,m,b){return"function("+m+"){var tR='';"+K(g,b)+"return tR}"}function K(g,m){for(var b=0,w=g.length,f="";b<w;b++){var u=g[b];if(typeof u=="string")f+="tR+='"+u+"';";else{var x=u.t,N=u.c||"",A=u.f,M=u.n||"",L=u.p||"",O=u.res||"",R=u.b,B=!!u.a;if(x==="i"){m.defaultFilter&&(N="c.l('F','"+m.defaultFilter+"')("+N+")");var V=Y(N,A);!u.raw&&m.autoEscape&&(V="c.l('F','e')("+V+")"),f+="tR+="+V+";"}else if(x==="h")if(m.storage.nativeHelpers.get(M))f+=m.storage.nativeHelpers.get(M)(u,m);else{var F=(B?"await ":"")+"c.l('H','"+M+"')("+k(m,O,u.d,L,B);F+=R?","+et(R,m):",[]",f+="tR+="+Y(F+=",c)",A)+";"}else x==="s"?f+="tR+="+Y((B?"await ":"")+"c.l('H','"+M+"')({params:["+L+"]},[],c)",A)+";":x==="e"&&(f+=N+`
6
+ `)}}return f}var T=function(){function g(m){this.cache=m}return g.prototype.define=function(m,b){this.cache[m]=b},g.prototype.get=function(m){return this.cache[m]},g.prototype.remove=function(m){delete this.cache[m]},g.prototype.reset=function(){this.cache={}},g.prototype.load=function(m){a(this.cache,m,!0)},g}();function it(g,m,b,w){if(m&&m.length>0)throw t((w?"Native":"")+"Helper '"+g+"' doesn't accept blocks");if(b&&b.length>0)throw t((w?"Native":"")+"Helper '"+g+"' doesn't accept filters")}var ut={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function bt(g){return ut[g]}var Xt=new T({}),Rt=new T({each:function(g,m){var b="",w=g.params[0];if(it("each",m,!1),g.async)return new Promise(function(u){(function x(N,A,M,L,O){M(N[A],A).then(function(R){L+=R,A===N.length-1?O(L):x(N,A+1,M,L,O)})})(w,0,g.exec,b,u)});for(var f=0;f<w.length;f++)b+=g.exec(w[f],f);return b},foreach:function(g,m){var b=g.params[0];if(it("foreach",m,!1),g.async)return new Promise(function(u){(function x(N,A,M,L,O,R){L(A[M],N[A[M]]).then(function(B){O+=B,M===A.length-1?R(O):x(N,A,M+1,L,O,R)})})(b,Object.keys(b),0,g.exec,"",u)});var w="";for(var f in b)l(b,f)&&(w+=g.exec(f,b[f]));return w},include:function(g,m,b){it("include",m,!1);var w=b.storage.templates.get(g.params[0]);if(!w)throw t('Could not fetch template "'+g.params[0]+'"');return w(g.params[1],b)},extends:function(g,m,b){var w=g.params[1]||{};w.content=g.exec();for(var f=0;f<m.length;f++){var u=m[f];w[u.name]=u.exec()}var x=b.storage.templates.get(g.params[0]);if(!x)throw t('Could not fetch template "'+g.params[0]+'"');return x(w,b)},useScope:function(g,m){return it("useScope",m,!1),g.exec(g.params[0])}}),Kt=new T({if:function(g,m){it("if",!1,g.f,!0);var b="if("+g.p+"){"+K(g.d,m)+"}";if(g.b)for(var w=0;w<g.b.length;w++){var f=g.b[w];f.n==="else"?b+="else{"+K(f.d,m)+"}":f.n==="elif"&&(b+="else if("+f.p+"){"+K(f.d,m)+"}")}return b},try:function(g,m){if(it("try",!1,g.f,!0),!g.b||g.b.length!==1||g.b[0].n!=="catch")throw t("native helper 'try' only accepts 1 block, 'catch'");var b="try{"+K(g.d,m)+"}",w=g.b[0];return b+="catch"+(w.res?"("+w.res+")":"")+"{"+K(w.d,m)+"}"},block:function(g,m){return it("block",g.b,g.f,!0),"if(!"+m.varName+"["+g.p+"]){tR+=("+X(g.d,"",m)+")()}else{tR+="+m.varName+"["+g.p+"]}"}}),kt=new T({e:function(g){var m=String(g);return/[&<>"']/.test(m)?m.replace(/[&<>"']/g,bt):m}}),wt={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(g,m){if(g==="H"){var b=this.storage.helpers.get(m);if(b)return b;throw t("Can't find helper '"+m+"'")}if(g==="F"){var w=this.storage.filters.get(m);if(w)return w;throw t("Can't find filter '"+m+"'")}},async:!1,storage:{helpers:Rt,nativeHelpers:Kt,filters:kt,templates:Xt},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function xt(g,m){var b={};return a(b,wt),m&&a(b,m),g&&a(b,g),b.l.bind(b),b}function pt(g,m){var b,w=xt(m||{}),f=Function;if(w.async){if(!p)throw t("This environment doesn't support async/await");f=p}if(w.varName&&(b=w.varName,/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(b)===!1))throw t("options.varName must be a valid JS identifier");try{return new f(w.varName,"c","cb",P(g,w))}catch(u){throw u instanceof SyntaxError?t(`Bad template syntax
7
7
 
8
- `+y.message+`
9
- `+Array(y.message.length+1).join("=")+`
10
- `+N(D,M)):y}}function _t(D,O){var L;return O.cache&&O.name&&O.storage.templates.get(O.name)?O.storage.templates.get(O.name):(L=typeof D=="function"?D:Xe(D,O),O.cache&&O.name&&O.storage.templates.define(O.name,L),L)}Le.l.bind(Le),t.compile=Xe,t.compileScope=te,t.compileScopeIntoFunction=G,t.compileToString=N,t.defaultConfig=Le,t.filters=Pe,t.getConfig=ze,t.helpers=be,t.nativeHelpers=Ve,t.parse=w,t.render=function(D,O,L,M){var v=ze(L||{});if(!v.async)return _t(D,v)(O,v);if(!M){if(typeof r=="function")return new r(function(y,U){try{y(_t(D,v)(O,v))}catch(X){U(X)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{_t(D,v)(O,v,M)}catch(y){return M(y)}},t.templates=fe,Object.defineProperty(t,"__esModule",{value:!0})})});var vh={schedule(t,e){let n=setTimeout(t,e);return()=>clearTimeout(n)}};function yh(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Eh(t){return!!t&&t.nodeType===Node.ELEMENT_NODE}var Bs;function bh(t,e){if(!Bs){let n=Element.prototype;Bs=n.matches||n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector}return t.nodeType===Node.ELEMENT_NODE?Bs.call(t,e):!1}function wh(t){let e={};return t.forEach(({propName:n,templateName:r,transform:i})=>{e[yh(r)]=[n,i]}),e}function Ch(t,e){return e.get(Ps).resolveComponentFactory(t).inputs}function Sh(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 l=n[o],u=Th(l,e,i);u!==-1&&r[u].push(l)}return r}function Th(t,e,n){let r=n;return Eh(t)&&e.some((i,o)=>i!=="*"&&bh(t,i)?(r=o,!0):!1),r}var Ih=10,Us=class{componentFactory;inputMap=new Map;constructor(e,n){this.componentFactory=n.get(Ps).resolveComponentFactory(e);for(let r of this.componentFactory.inputs)this.inputMap.set(r.propName,r.templateName)}create(e){return new Hs(this.componentFactory,e,this.inputMap)}},Hs=class{componentFactory;injector;inputMap;eventEmitters=new Ms(1);events=this.eventEmitters.pipe(Sl(e=>yl(...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(Yt),this.appRef=this.injector.get(oi),this.cdScheduler=n.get(Tl),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=vh.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},Ih))})}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),xl(this.componentRef.hostView)&&(Ol(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(e){let n=Ot.create({providers:[],parent:this.injector}),r=Sh(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 Yi(s=>{let l=o.subscribe(u=>s.next({name:i,value:u}));return()=>l.unsubscribe()})});this.eventEmitters.next(n)}runInZone(e){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(e):e()}},js=class extends HTMLElement{ngElementEventsSubscription=null};function Xl(t,e){let n=Ch(t,e.injector),r=e.strategyFactory||new Us(t,e.injector),i=wh(n);class o extends js{injector;static observedAttributes=Object.keys(i);get ngElementStrategy(){if(!this._ngElementStrategy){let l=this._ngElementStrategy=r.create(this.injector||e.injector);n.forEach(({propName:u,transform:d})=>{if(!this.hasOwnProperty(u))return;let _=this[u];delete this[u],l.setInputValue(u,_,d)})}return this._ngElementStrategy}_ngElementStrategy;constructor(l){super(),this.injector=l}attributeChangedCallback(l,u,d,_){let[h,E]=i[l];this.ngElementStrategy.setInputValue(h,d,E)}connectedCallback(){let l=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),l=!0),this.ngElementStrategy.connect(this),l||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(l=>{let u=new CustomEvent(l.name,{detail:l.value});this.dispatchEvent(u)})}}return n.forEach(({propName:s,transform:l})=>{Object.defineProperty(o.prototype,s,{get(){return this.ngElementStrategy.getInputValue(s)},set(u){this.ngElementStrategy.setInputValue(s,u,l)},configurable:!0,enumerable:!0})}),o}var Jl="10.2.0";var Q=class Q{};ne(Q,"SDK_VERSION",Jl),ne(Q,"SDK_VERSION_CODE"),ne(Q,"SDK","WEB"),ne(Q,"LOG_PREFIX","CooeeSDK"),ne(Q,"COOEE","cooee"),ne(Q,"SESSION_STORAGE_SCROLL_ID","sleid"),ne(Q,"IDLE_TIME_IN_SECONDS",30*60),ne(Q,"IN_APP_WRAPPER_NAME","cooee-wrapper"),ne(Q,"IN_APP_CONTAINER_NAME","cooee-container"),ne(Q,"IN_APP_DEFAULT_PADDING",15),ne(Q,"EVENT_SCREEN_VIEW","CE Screen View"),ne(Q,"EVENT_APP_BACKGROUND","CE App Background"),ne(Q,"EVENT_TRIGGER_DISPLAYED","CE Trigger Displayed"),ne(Q,"EVENT_CAMPAIGN_HOLDOUT","CE Campaign Holdout"),ne(Q,"EVENT_CAMPAIGN_REJECTED","CE Campaign Rejected"),ne(Q,"EVENT_CAMPAIGN_FAILED","CE Campaign Failed"),ne(Q,"EVENT_TRIGGER_CLOSED","CE Trigger Closed"),ne(Q,"EVENT_SCROLL","CE Scroll"),ne(Q,"EVENT_TRIGGER_CLICKED","CE Trigger Clicked"),ne(Q,"EVENT_FORM_SUBMITTED","CE Form Submitted"),ne(Q,"EVENT_EXPERIMENT_START","CE Experiment Start"),ne(Q,"EVENT_VIDEO_DIALOG_CLOSED","CE Video Dialog Closed"),ne(Q,"EVENT_VIDEO_DIALOG_OPENED","CE Video Dialog Opened"),ne(Q,"EVENT_VIDEO_CHANGE","CE Video Changed"),ne(Q,"EVENT_LAST_VIDEO_ENDED","CE Last Video Ended"),ne(Q,"EVENT_VIDEO_MUTED","CE Video Muted"),ne(Q,"EVENT_VIDEO_UNMUTED","CE Video Unmuted"),ne(Q,"EVENT_ADD_TO_CART_CLICKED","CE Add To Cart Clicked"),ne(Q,"EVENT_VIEW_ITEM_CLICKED","CE View Item Clicked"),ne(Q,"EVENT_MORE_ITEM_INFO_CLICKED","CE More Item Info Clicked"),ne(Q,"EVENT_OPEN_CART_CLICKED","CE Open Cart Clicked"),ne(Q,"EVENT_ADD_TO_CART","Add To Cart"),ne(Q,"EVENT_REMOVE_FROM_CART","Remove From Cart"),ne(Q,"EVENT_VIEW_ITEM","View Item"),ne(Q,"EVENT_VIEW_CART","View Cart"),ne(Q,"EVENT_OPEN_CART","Open Cart"),ne(Q,"EVENT_VIEW_COLLECTION","View Collection"),ne(Q,"EVENT_BUY_NOW_CLICKED","Buy Now Clicked"),ne(Q,"EVENT_CHECKOUT_STARTED","Checkout Started"),ne(Q,"EVENT_REVIEW_CLICKED","Review Clicked"),ne(Q,"EVENT_ITEM_THUMBNAIL_CLICKED","Item Thumbnail Clicked"),ne(Q,"JS_LOAD_WHITELIST_EVENTS",[Q.EVENT_VIEW_ITEM,Q.EVENT_VIEW_CART,Q.EVENT_VIEW_COLLECTION]),ne(Q,"HASH_INITIATE_CHECKOUT","initiate-checkout"),ne(Q,"HASH_OPEN_CART_DRAWER","open-cart-drawer"),ne(Q,"ADD_BUNDLE_CTA_INBOUND_EVENT","letscooee:inbound:cta:add-bundle"),ne(Q,"CTA_OPEN_CART_EVENT","letscooee:outbound:open-cart"),ne(Q,"CTA_AFTER_REFRESH_UI","letscooee:outbound:refresh-ui"),ne(Q,"POPUP_ACTIVITY_EVENT","letscooee:outbound:popup-activities"),ne(Q,"THIRD_PARTY_CHECKOUT_EVENT","letscooee:outbound:third-party-initiate-checkout"),ne(Q,"CAMPAIGN_DISPLAYED_ACTIVITY","DISPLAYED"),ne(Q,"CAMPAIGN_CLICKED_ACTIVITY","CLICKED"),ne(Q,"CAMPAIGN_CLOSED_ACTIVITY","CLOSED"),ne(Q,"BLACKLISTED_PAGE_NAMES",["collection","product","cart"]),ne(Q,"PLACEHOLDER_IMAGE","https://cdn.global.letscooee.com/images/placeholders/product.png"),ne(Q,"SHADOW_SPLITTER",":shadow"),ne(Q,"CAMPAIGN_ATTRIBUTE","_letscooee_campaign"),ne(Q,"CONTENT_ATTRIBUTE","_letscooee_content"),ne(Q,"VIA","_via"),ne(Q,"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"}]),(()=>{let e=Q.SDK_VERSION.split(".").map(n=>n.padStart(2,"0")).join("");Q.SDK_VERSION_CODE=parseInt(e,10)})();var Ze=Q;var Mn={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Ze.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Ze.SDK_VERSION}/dist/widget.min.js`};var zt=Wi(Ql());var qe=class{static debuggerEl;static infoLogs=[];static log(...e){zt.default.info(...e)}static verbose(...e){zt.default.debug(...e)}static error(...e){zt.default.error(...e)}static warn(...e){zt.default.warn(...e)}static info(...e){zt.default.info(...e),this.infoLogs.unshift({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){zt.default.trace(...e)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function eu(t=Ze.LOG_PREFIX){zt.default.useDefaults({formatter:function(n){n.unshift(`${t} (v${Ze.SDK_VERSION}):`)}});let e=Oh();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?zt.default.setLevel(zt.default[localStorage.cooeeLogLevel]):zt.default.setLevel(Mn.debug?zt.default.TRACE:zt.default.OFF)}function Oh(){return new URL(location.href).searchParams?.get("cooee-debug")}var tu={providers:[Ll()]};var Nh={"[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"},lE=Ee(x({},Nh),{"[class.ng-submitted]":"isSubmitted"});var Rh=new ln("",{providedIn:"root",factory:()=>iu}),iu="always";var Mh=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=er({type:t});static \u0275inj=Zn({})}return t})();var ou=(()=>{class t{static withConfig(n){return{ngModule:t,providers:[{provide:Rh,useValue:n.callSetDisabledState??iu}]}}static \u0275fac=function(r){return new(r||t)};static \u0275mod=er({type:t});static \u0275inj=Zn({imports:[Mh]})}return t})();var Ut=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 l of s)if(l.type==CSSRule.FONT_FACE_RULE){let u=e.split("/"),d=u.slice(0,u.length-1).join("/"),_=l.cssText;_=_.replace(/url\s*\(\s*['"]?(?!((\/)|((?:https?:)?\/\/)|(?:data:?:)))([^'")]+)['"]?\s*\)/g,`url("${d}/$4")`);let h=document.createElement("style");h.appendChild(document.createTextNode(_)),document.head.appendChild(h)}}}),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 tn=class t{cooeeEvent=new ut;cooeeCTA=new ut;elementRef=J(Vt);_engagementTrigger=Ct(null);_triggerContext=Ct(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(){qe.verbose("Init",this.constructor.name);let e=this.elementRef.nativeElement.shadowRoot;e&&(Ut.injectStylesheet(Mn.styleURL,e),Ut.injectRawCSS(window.CooeeSDK.config.website.commonCSS,e))}ngOnDestroy(){qe.verbose("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=Ne({type:t,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&Ji(r.classes)},inputs:{triggerContext:"triggerContext"},outputs:{cooeeEvent:"cooeeEvent",cooeeCTA:"cooeeCTA"},decls:1,vars:0,template:function(n,r){n&1&&Dl(0)},encapsulation:2})};var nn=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 Ph=(t,e)=>({"--option-color":t,"background-color":e}),su=(t,e)=>e.id;function Lh(t,e){if(t&1&&(K(0,"span",6),Re(1),Z()),t&2){Y();let n=Je(0);k(),fn(n)}}function Fh(t,e){if(t&1){let n=Ge();It(0),K(1,"button",5),Fe("click",function(){let i=xe(n).$implicit,o=Y().$implicit,s=Y();return Oe(s.onOptionChange(o,i))}),De(2,Lh,2,1,"span",6),Z()}if(t&2){let n=e.$implicit,r=Y().$implicit,i=Je(1),o=n.name,s=bt(n.displayName||n.name),l=i?n.hexColor??o:"",u=Y().selectedOptions()[r.name]===o;k(),ai("color-type",i)("selected",u)("disabled",n.disabled),Se("title",s)("ngStyle",Qi(14,Ph,l,l)),Qt("aria-checked",u?"true":"false")("data-value",o)("aria-disabled",n.disabled?"true":null)("aria-label",s),k(),Ae(i?-1:2)}}function kh(t,e){if(t&1&&(K(0,"div"),It(1),K(2,"div",1),Re(3),Z(),K(4,"div",2),Re(5),Z(),K(6,"div",3),nt(7,Fh,3,17,"button",4,su),Z()()),t&2){let n=e.$implicit,r=Y();Ji(Rl("option-group ",n.name.toLowerCase())),k(),bt(r.hasHexColors(n)),k(2),Bt("",n.name,":"),k(2),fn(r.selectedOptions()[n.name]),k(),Qt("aria-label",n.name),k(),rt(n.optionValues)}}var di=t=>t.trim().toLowerCase(),Cr=class t extends tn{selectedVariant=new ut;item=Nn.required();selectedOptions=Ct({});options=tr(()=>{let e=this.item();if(!e.options||e.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(e,this.engagementTrigger)}catch(n){qe.error(n)}return e.options.forEach(n=>{n.optionValues.forEach(r=>{r.disabled=this.isOptionValueDisabledFast(n,r)})}),e.options});matchedVariant=tr(()=>{let e=this.item(),n=this.selectedOptions();return e.vars.find(r=>e.options.every(i=>{let o=r.selectedOptions.find(s=>s.name===i.name)?.value;return n[i.name]===o}))});availabilityIndex=tr(()=>{let e=this.item(),n=new Map;return e?.vars?.length&&e.vars.forEach((r,i)=>{if(r.isAvailable)for(let o of r.selectedOptions){let s=di(o.name),l=o.value,u=n.get(s);u||n.set(s,u=new Map);let d=u.get(l);d||u.set(l,d=new Set),d.add(i)}}),n});constructor(){super(),ci(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let e=ci(()=>{let n=this.item();if(!n?.options)return;let r=x({},this.selectedOptions()),i=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=i?.selectedOptions.find(l=>l.name===o.name)?.value;s&&(r[o.name]=s)}),this.selectedOptions.set(r),e.destroy()})}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.shadowRoot;if(!e)return;let n=nn.get().website?.itemSwatchMapping;n&&Ut.injectRawCSS(n,e)}onOptionChange(e,n){let r=x({},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)}getCandidateVariantsExcluding(e){let n=this.item(),r=this.availabilityIndex(),i=new Set;n.vars.forEach((s,l)=>{s.isAvailable&&i.add(l)});let o=i;for(let[s,l]of Object.entries(this.selectedOptions())){if(di(s)===di(e))continue;let u=r.get(di(s));if(!u)return new Set;let d=u.get(String(l));if(!d)return new Set;if(o=new Set([...o].filter(_=>d.has(_))),o.size===0)return o}return o}isOptionValueDisabledFast(e,n){let i=this.availabilityIndex().get(di(e.name));if(!i)return!0;let o=n.name,s=i.get(o);if(!s||s.size===0)return!0;let l=this.getCandidateVariantsExcluding(e.name);if(l.size===0)return!0;for(let u of l)if(s.has(u))return!1;return!0}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[St],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],["role","radiogroup",1,"option-values"],["type","button","role","radio",1,"option-value",3,"color-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&nt(0,kh,9,7,"div",0,su),n&2&&rt(r.options())},dependencies:[Hl,Bl,ou],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;scrollbar-width:none}.option-values::-webkit-scrollbar{display:none}.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;flex-shrink:0;--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}.option-value.disabled{opacity:.5;pointer-events:none}
11
- `],encapsulation:3})};var $s=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}($s||{});var qt=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}(qt||{});var fi=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}(fi||{});var Sr=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 Gs=(n=>(n.CART_AMOUNT="CART_AMOUNT",n.ITEM_COUNT="ITEM_COUNT",n))(Gs||{});var Tr=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 Ys=Wi(cu());function io(t){return Ys.default.createInstance({name:"lc",storeName:t,driver:Ys.default.LOCALSTORAGE})}var Ir=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 pi=class pi extends Ir{};ne(pi,"storeName","ses"),pi.storage=io(pi.storeName);var zs=pi;var hi=class hi extends Ir{};ne(hi,"storeName","usr"),hi.storage=io(hi.storeName);var xr=hi;var uu=Wi(lu());var eb=(0,uu.default)(fetch);var oo=class extends Error{request;response;status;requestBody;responseText;constructor(e="Failed to fetch"){super(e),this.name="FetchError",Object.setPrototypeOf(this,new.target.prototype)}is40x(){return!!this.response&&this.response.status>=400&&this.response.status<500}};var pe=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Ce=globalThis;var hn="9.42.0";function ir(){return or(Ce),Ce}function or(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||hn,e[hn]=e[hn]||{}}function Pn(t,e,n=Ce){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[hn]=r[hn]||{};return i[t]||(i[t]=e())}var Xs=["debug","info","warn","error","log","assert","trace"],Vh="Sentry Logger ",Or={};function Yn(t){if(!("console"in Ce))return t();let e=Ce.console,n={},r=Object.keys(Or);r.forEach(i=>{let o=Or[i];n[i]=e[i],e[i]=o});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function Bh(){Zs().enabled=!0}function Uh(){Zs().enabled=!1}function du(){return Zs().enabled}function Hh(...t){Js("log",...t)}function jh(...t){Js("warn",...t)}function $h(...t){Js("error",...t)}function Js(t,...e){pe&&du()&&Yn(()=>{Ce.console[t](`${Vh}[${t}]:`,...e)})}function Zs(){return pe?Pn("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var ie={enable:Bh,disable:Uh,isEnabled:du,log:Hh,warn:jh,error:$h};var mn="?",fu=/\(error: (.*)\)/,pu=/captureMessage|captureException/;function ea(...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
- `);for(let l=r;l<s.length;l++){let u=s[l];if(u.length>1024)continue;let d=fu.test(u)?u.replace(fu,"$1"):u;if(!d.match(/\S*Error: /)){for(let _ of e){let h=_(d);if(h){o.push(h);break}}if(o.length>=50+i)break}}return hu(o.slice(i))}}function hu(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(so(e).function||"")&&e.pop(),e.reverse(),pu.test(so(e).function||"")&&(e.pop(),pu.test(so(e).function||"")&&e.pop()),e.slice(0,50).map(n=>Ee(x({},n),{filename:n.filename||so(e).filename,function:n.function||mn}))}function so(t){return t[t.length-1]||{}}var Qs="<anonymous>";function rn(t){try{return!t||typeof t!="function"?Qs:t.name||Qs}catch{return Qs}}function ao(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 co={},mu={};function At(t,e){co[t]=co[t]||[],co[t].push(e)}function Nt(t,e){if(!mu[t]){mu[t]=!0;try{e()}catch(n){pe&&ie.error(`Error while instrumenting ${t}`,n)}}}function ft(t,e){let n=t&&co[t];if(n)for(let r of n)try{r(e)}catch(i){pe&&ie.error(`Error while triggering instrumentation handler.
13
- Type: ${t}
14
- Name: ${rn(r)}
15
- Error:`,i)}}var ta=null;function na(t){let e="error";At(e,t),Nt(e,Gh)}function Gh(){ta=Ce.onerror,Ce.onerror=function(t,e,n,r,i){return ft("error",{column:r,error:i,line:n,msg:t,url:e}),ta?ta.apply(this,arguments):!1},Ce.onerror.__SENTRY_INSTRUMENTED__=!0}var ra=null;function ia(t){let e="unhandledrejection";At(e,t),Nt(e,Wh)}function Wh(){ra=Ce.onunhandledrejection,Ce.onunhandledrejection=function(t){return ft("unhandledrejection",t),ra?ra.apply(this,arguments):!0},Ce.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var gu=Object.prototype.toString;function sr(t){switch(gu.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return un(t,Error)}}function Dr(t,e){return gu.call(t)===`[object ${e}]`}function lo(t){return Dr(t,"ErrorEvent")}function uo(t){return Dr(t,"DOMError")}function oa(t){return Dr(t,"DOMException")}function Rt(t){return Dr(t,"String")}function Ar(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function ar(t){return t===null||Ar(t)||typeof t!="object"&&typeof t!="function"}function Ln(t){return Dr(t,"Object")}function cr(t){return typeof Event<"u"&&un(t,Event)}function sa(t){return typeof Element<"u"&&un(t,Element)}function aa(t){return Dr(t,"RegExp")}function Fn(t){return!!(t?.then&&typeof t.then=="function")}function ca(t){return Ln(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function un(t,e){try{return t instanceof e}catch{return!1}}function mi(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function _u(t){return typeof Request<"u"&&un(t,Request)}var la=Ce,Yh=80;function gi(t,e={}){if(!t)return"<unknown>";try{let n=t,r=5,i=[],o=0,s=0,l=" > ",u=l.length,d,_=Array.isArray(e)?e:e.keyAttrs,h=!Array.isArray(e)&&e.maxStringLength||Yh;for(;n&&o++<r&&(d=zh(n,_),!(d==="html"||o>1&&s+i.length*u+d.length>=h));)i.push(d),s+=d.length,n=n.parentNode;return i.reverse().join(l)}catch{return"<unknown>"}}function zh(t,e){let n=t,r=[];if(!n?.tagName)return"";if(la.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let i=e?.length?e.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(i?.length)i.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let s=n.className;if(s&&Rt(s)){let l=s.split(/\s+/);for(let u of l)r.push(`.${u}`)}}let o=["aria-label","type","name","title","alt"];for(let s of o){let l=n.getAttribute(s);l&&r.push(`[${s}="${l}"]`)}return r.join("")}function _i(){try{return la.document.location.href}catch{return""}}function ua(t){if(!la.HTMLElement)return null;let e=t,n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}function zn(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function fo(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let i=t[r];try{mi(i)?n.push("[VueViewModel]"):n.push(String(i))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function vu(t,e,n=!1){return Rt(t)?aa(e)?e.test(t):Rt(e)?n?t===e:t.includes(e):!1:!1}function Nr(t,e=[],n=!1){return e.some(r=>vu(t,r,n))}function pt(t,e,n){if(!(e in t))return;let r=t[e];if(typeof r!="function")return;let i=n(r);typeof i=="function"&&po(i,r);try{t[e]=i}catch{pe&&ie.log(`Failed to replace method "${e}" in object`,t)}}function Kt(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{pe&&ie.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function po(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,Kt(t,"__sentry_original__",e)}catch{}}function lr(t){return t.__sentry_original__}function ho(t){if(sr(t))return x({message:t.message,name:t.name,stack:t.stack},Eu(t));if(cr(t)){let e=x({type:t.type,target:yu(t.target),currentTarget:yu(t.currentTarget)},Eu(t));return typeof CustomEvent<"u"&&un(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function yu(t){try{return sa(t)?gi(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function Eu(t){if(typeof t=="object"&&t!==null){let e={};for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function da(t,e=40){let n=Object.keys(ho(t));n.sort();let r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return zn(r,e);for(let i=n.length;i>0;i--){let o=n.slice(0,i).join(", ");if(!(o.length>e))return i===n.length?o:zn(o,e)}return""}function qh(){let t=Ce;return t.crypto||t.msCrypto}function ht(t=qh()){let e=()=>Math.random()*16;try{if(t?.randomUUID)return t.randomUUID().replace(/-/g,"");t?.getRandomValues&&(e=()=>{let n=new Uint8Array(1);return t.getRandomValues(n),n[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(e()&15)>>n/4).toString(16))}function bu(t){return t.exception?.values?.[0]}function gn(t){let{message:e,event_id:n}=t;if(e)return e;let r=bu(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Rr(t,e,n){let r=t.exception=t.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=e||""),o.type||(o.type=n||"Error")}function _n(t,e){let n=bu(t);if(!n)return;let r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism=x(x(x({},r),i),e),e&&"data"in e){let o=x(x({},i?.data),e.data);n.mechanism.data=o}}function mo(t){if(Kh(t))return!0;try{Kt(t,"__sentry_captured__",!0)}catch{}return!1}function Kh(t){try{return t.__sentry_captured__}catch{}}var Cu=1e3;function vn(){return Date.now()/Cu}function Xh(){let{performance:t}=Ce;if(!t?.now||!t.timeOrigin)return vn;let e=t.timeOrigin;return()=>(e+t.now())/Cu}var wu;function jt(){return(wu??(wu=Xh()))()}function Su(t){let e=jt(),n={sid:ht(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>Jh(n)};return t&&kn(n,t),n}function kn(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||jt(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:ht()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function Tu(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),kn(t,n)}function Jh(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function qn(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;let r=x({},t);for(let i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[i]=qn(r[i],e[i],n-1));return r}function fa(){return ht()}function go(){return ht().substring(16)}var pa="_sentrySpan";function ha(t,e){e?Kt(t,pa,e):delete t[pa]}function ma(t){return t[pa]}var Zh=100,Tt=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:fa(),sampleRand:Math.random()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags=x({},this._tags),e._extra=x({},this._extra),e._contexts=x({},this._contexts),this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata=x({},this._sdkProcessingMetadata),e._propagationContext=x({},this._propagationContext),e._client=this._client,e._lastEventId=this._lastEventId,ha(e,ma(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&kn(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags=x(x({},this._tags),e),this._notifyScopeListeners(),this}setTag(e,n){return this._tags=Ee(x({},this._tags),{[e]:n}),this._notifyScopeListeners(),this}setExtras(e){return this._extra=x(x({},this._extra),e),this._notifyScopeListeners(),this}setExtra(e,n){return this._extra=Ee(x({},this._extra),{[e]:n}),this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,r=n instanceof t?n.getScopeData():Ln(n)?e:void 0,{tags:i,extra:o,user:s,contexts:l,level:u,fingerprint:d=[],propagationContext:_}=r||{};return this._tags=x(x({},this._tags),i),this._extra=x(x({},this._extra),o),this._contexts=x(x({},this._contexts),l),s&&Object.keys(s).length&&(this._user=s),u&&(this._level=u),d.length&&(this._fingerprint=d),_&&(this._propagationContext=_),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,ha(this,void 0),this._attachments=[],this.setPropagationContext({traceId:fa(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:Zh;if(r<=0)return this;let i=Ee(x({timestamp:vn()},e),{message:e.message?zn(e.message,2048):e.message});return this._breadcrumbs.push(i),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ma(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=qn(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||ht();if(!this._client)return pe&&ie.warn("No client configured on scope - will not capture exception!"),r;let i=new Error("Sentry syntheticException");return this._client.captureException(e,Ee(x({originalException:e,syntheticException:i},n),{event_id:r}),this),r}captureMessage(e,n,r){let i=r?.event_id||ht();if(!this._client)return pe&&ie.warn("No client configured on scope - will not capture message!"),i;let o=new Error(e);return this._client.captureMessage(e,n,Ee(x({originalException:e,syntheticException:o},r),{event_id:i}),this),i}captureEvent(e,n){let r=n?.event_id||ht();return this._client?(this._client.captureEvent(e,Ee(x({},n),{event_id:r}),this),r):(pe&&ie.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function Iu(){return Pn("defaultCurrentScope",()=>new Tt)}function xu(){return Pn("defaultIsolationScope",()=>new Tt)}var ga=class{constructor(e,n){let r;e?r=e:r=new Tt;let i;n?i=n:i=new Tt,this._stack=[{scope:r}],this._isolationScope=i}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(i){throw this._popScope(),i}return Fn(r)?r.then(i=>(this._popScope(),i),i=>{throw this._popScope(),i}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){let e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Mr(){let t=ir(),e=or(t);return e.stack=e.stack||new ga(Iu(),xu())}function Qh(t){return Mr().withScope(t)}function em(t,e){let n=Mr();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function Ou(t){return Mr().withScope(()=>t(Mr().getIsolationScope()))}function Du(){return{withIsolationScope:Ou,withScope:Qh,withSetScope:em,withSetIsolationScope:(t,e)=>Ou(e),getCurrentScope:()=>Mr().getScope(),getIsolationScope:()=>Mr().getIsolationScope()}}function _o(t){let e=or(t);return e.acs?e.acs:Du()}function yn(){let t=ir();return _o(t).getCurrentScope()}function En(){let t=ir();return _o(t).getIsolationScope()}function vo(){return Pn("globalScope",()=>new Tt)}function vi(...t){let e=ir(),n=_o(e);if(t.length===2){let[r,i]=t;return r?n.withSetScope(r,i):n.withScope(i)}return n.withScope(t[0])}function Ke(){return yn().getClient()}function _a(t){let e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:i}=e,o={trace_id:n,span_id:i||go()};return r&&(o.parent_span_id=r),o}var yo="sentry.source",va="sentry.sample_rate",Au="sentry.previous_trace_sample_rate",ya="sentry.op",Ea="sentry.origin";var ba="sentry.profile_id",wa="sentry.exclusive_time";var tm="_sentryScope",nm="_sentryIsolationScope";function Eo(t){return{scope:t[tm],isolationScope:t[nm]}}var rm="sentry-",im=/^sentry-/;function Ru(t){let e=om(t);if(!e)return;let n=Object.entries(e).reduce((r,[i,o])=>{if(i.match(im)){let s=i.slice(rm.length);r[s]=o}return r},{});if(Object.keys(n).length>0)return n}function om(t){if(!(!t||!Rt(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=Nu(n);return Object.entries(r).forEach(([i,o])=>{e[i]=o}),e},{}):Nu(t)}function Nu(t){return t.split(",").map(e=>e.split("=").map(n=>{try{return decodeURIComponent(n.trim())}catch{return}})).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function Mu(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var ku=1,Pu=!1;function Ca(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),i=r?e:Pr(t).parent_span_id,o=Eo(t).scope,s=r?o?.getPropagationContext().propagationSpanId||go():e;return{parent_span_id:i,span_id:s,trace_id:n}}function sm(t){if(t&&t.length>0)return t.map(s=>{var l=s,{context:u}=l,d=u,{spanId:e,traceId:n,traceFlags:r}=d,i=pl(d,["spanId","traceId","traceFlags"]),{attributes:o}=l;return x({span_id:e,trace_id:n,sampled:r===ku,attributes:o},i)})}function Lu(t){return typeof t=="number"?Fu(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Fu(t.getTime()):jt()}function Fu(t){return t>9999999999?t/1e3:t}function Pr(t){if(cm(t))return t.getSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(am(t)){let{attributes:r,startTime:i,name:o,endTime:s,status:l,links:u}=t,d="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:n,data:r,description:o,parent_span_id:d,start_timestamp:Lu(i),timestamp:Lu(s)||void 0,status:lm(l),op:r[ya],origin:r[Ea],links:sm(u)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function am(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function cm(t){return typeof t.getSpanJSON=="function"}function Vu(t){let{traceFlags:e}=t.spanContext();return e===ku}function lm(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"unknown_error"}var um="_sentryRootSpan";function yi(t){return t[um]||t}function Sa(){Pu||(Yn(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),Pu=!0)}function Bu(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||Ke()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}var Lr="production";var dm=/^o(\d+)\./,fm=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function pm(t){return t==="http"||t==="https"}function Kn(t,e=!1){let{host:n,path:r,pass:i,port:o,projectId:s,protocol:l,publicKey:u}=t;return`${l}://${u}${e&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${s}`}function hm(t){let e=fm.exec(t);if(!e){Yn(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[n,r,i="",o="",s="",l=""]=e.slice(1),u="",d=l,_=d.split("/");if(_.length>1&&(u=_.slice(0,-1).join("/"),d=_.pop()),d){let h=d.match(/^\d+/);h&&(d=h[0])}return Uu({host:o,pass:i,path:u,projectId:d,port:s,protocol:n,publicKey:r})}function Uu(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function mm(t){if(!pe)return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(s=>t[s]?!1:(ie.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?pm(r)?e&&isNaN(parseInt(e,10))?(ie.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(ie.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(ie.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Hu(t){return t.match(dm)?.[1]}function ju(t){let e=typeof t=="string"?hm(t):Uu(t);if(!(!e||!mm(e)))return e}var gm="_frozenDsc";function $u(t,e){let n=e.getOptions(),{publicKey:r,host:i}=e.getDsn()||{},o;n.orgId?o=String(n.orgId):i&&(o=Hu(i));let s={environment:n.environment||Lr,release:n.release,public_key:r,trace_id:t,org_id:o};return e.emit("createDsc",s),s}function Gu(t,e){let n=e.getPropagationContext();return n.dsc||$u(n.traceId,t)}function Ta(t){let e=Ke();if(!e)return{};let n=yi(t),r=Pr(n),i=r.data,o=n.spanContext().traceState,s=o?.get("sentry.sample_rate")??i[va]??i[Au];function l(N){return(typeof s=="number"||typeof s=="string")&&(N.sample_rate=`${s}`),N}let u=n[gm];if(u)return l(u);let d=o?.get("sentry.dsc"),_=d&&Ru(d);if(_)return l(_);let h=$u(t.spanContext().traceId,e),E=i[yo],w=r.description;return E!=="url"&&w&&(h.transaction=w),Bu()&&(h.sampled=String(Vu(n)),h.sample_rand=o?.get("sentry.sample_rand")??Eo(n).scope?.getPropagationContext().sampleRand.toString()),l(h),e.emit("createDsc",h,n),h}function on(t,e=100,n=1/0){try{return Ia("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function bo(t,e=3,n=100*1024){let r=on(t,e);return Em(r)>n?bo(t,e-1,n):r}function Ia(t,e,n=1/0,r=1/0,i=bm()){let[o,s]=i;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let l=_m(t,e);if(!l.startsWith("[object "))return l;if(e.__sentry_skip_normalization__)return e;let u=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(u===0)return l.replace("object ","");if(o(e))return"[Circular ~]";let d=e;if(d&&typeof d.toJSON=="function")try{let w=d.toJSON();return Ia("",w,u-1,r,i)}catch{}let _=Array.isArray(e)?[]:{},h=0,E=ho(e);for(let w in E){if(!Object.prototype.hasOwnProperty.call(E,w))continue;if(h>=r){_[w]="[MaxProperties ~]";break}let N=E[w];_[w]=Ia(w,N,u-1,r,i),h++}return s(e),_}function _m(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(mi(e))return"[VueViewModel]";if(ca(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${rn(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=vm(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function vm(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function ym(t){return~-encodeURI(t).split(/%..|./).length}function Em(t){return ym(JSON.stringify(t))}function bm(){let t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Vn(t,e=[]){return[t,e]}function Wu(t,e){let[n,r]=t;return[n,[...r,e]]}function Oa(t,e){let n=t[1];for(let r of n){let i=r[0].type;if(e(r,i))return!0}return!1}function xa(t){let e=or(Ce);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function Yu(t){let[e,n]=t,r=JSON.stringify(e);function i(o){typeof r=="string"?r=typeof o=="string"?r+o:[xa(r),o]:r.push(typeof o=="string"?xa(o):o)}for(let o of n){let[s,l]=o;if(i(`
16
- ${JSON.stringify(s)}
17
- `),typeof l=="string"||l instanceof Uint8Array)i(l);else{let u;try{u=JSON.stringify(l)}catch{u=JSON.stringify(on(l))}i(u)}}return typeof r=="string"?r:wm(r)}function wm(t){let e=t.reduce((i,o)=>i+o.length,0),n=new Uint8Array(e),r=0;for(let i of t)n.set(i,r),r+=i.length;return n}function zu(t){let e=typeof t.data=="string"?xa(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var Cm={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item"};function Da(t){return Cm[t]}function Aa(t){if(!t?.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function qu(t,e,n,r){let i=t.sdkProcessingMetadata?.dynamicSamplingContext;return x(x(x({event_id:t.event_id,sent_at:new Date().toISOString()},e&&{sdk:e}),!!n&&r&&{dsn:Kn(r)}),i&&{trace:i})}function Sm(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function Ku(t,e,n,r){let i=Aa(n),o=x(x({sent_at:new Date().toISOString()},i&&{sdk:i}),!!r&&e&&{dsn:Kn(e)}),s="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Vn(o,[s])}function Xu(t,e,n,r){let i=Aa(n),o=t.type&&t.type!=="replay_event"?t.type:"event";Sm(t,n?.sdk);let s=qu(t,i,r,e);return delete t.sdkProcessingMetadata,Vn(s,[[{type:o},t]])}var Na=0,Ju=1,Zu=2;function sn(t){return new dn(e=>{e(t)})}function Xn(t){return new dn((e,n)=>{n(t)})}var dn=class t{constructor(e){this._state=Na,this._handlers=[],this._runExecutor(e)}then(e,n){return new t((r,i)=>{this._handlers.push([!1,o=>{if(!e)r(o);else try{r(e(o))}catch(s){i(s)}},o=>{if(!n)i(o);else try{r(n(o))}catch(s){i(s)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let i,o;return this.then(s=>{o=!1,i=s,e&&e()},s=>{o=!0,i=s,e&&e()}).then(()=>{if(o){r(i);return}n(i)})})}_executeHandlers(){if(this._state===Na)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Ju&&n[1](this._value),this._state===Zu&&n[2](this._value),n[0]=!0)})}_runExecutor(e){let n=(o,s)=>{if(this._state===Na){if(Fn(s)){s.then(r,i);return}this._state=o,this._value=s,this._executeHandlers()}},r=o=>{n(Ju,o)},i=o=>{n(Zu,o)};try{e(r,i)}catch(o){i(o)}}};function wo(t,e,n,r=0){return new dn((i,o)=>{let s=t[r];if(e===null||typeof s!="function")i(e);else{let l=s(x({},e),n);pe&&s.id&&l===null&&ie.log(`Event processor "${s.id}" dropped event`),Fn(l)?l.then(u=>wo(t,u,n,r+1).then(i)).then(null,o):wo(t,l,n,r+1).then(i).then(null,o)}})}function Qu(t,e){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:o}=e;Tm(t,e),r&&Om(t,r),Dm(t,n),Im(t,i),xm(t,o)}function Ra(t,e){let{extra:n,tags:r,user:i,contexts:o,level:s,sdkProcessingMetadata:l,breadcrumbs:u,fingerprint:d,eventProcessors:_,attachments:h,propagationContext:E,transactionName:w,span:N}=e;Co(t,"extra",n),Co(t,"tags",r),Co(t,"user",i),Co(t,"contexts",o),t.sdkProcessingMetadata=qn(t.sdkProcessingMetadata,l,2),s&&(t.level=s),w&&(t.transactionName=w),N&&(t.span=N),u.length&&(t.breadcrumbs=[...t.breadcrumbs,...u]),d.length&&(t.fingerprint=[...t.fingerprint,...d]),_.length&&(t.eventProcessors=[...t.eventProcessors,..._]),h.length&&(t.attachments=[...t.attachments,...h]),t.propagationContext=x(x({},t.propagationContext),E)}function Co(t,e,n){t[e]=qn(t[e],n,1)}function Tm(t,e){let{extra:n,tags:r,user:i,contexts:o,level:s,transactionName:l}=e;Object.keys(n).length&&(t.extra=x(x({},n),t.extra)),Object.keys(r).length&&(t.tags=x(x({},r),t.tags)),Object.keys(i).length&&(t.user=x(x({},i),t.user)),Object.keys(o).length&&(t.contexts=x(x({},o),t.contexts)),s&&(t.level=s),l&&t.type!=="transaction"&&(t.transaction=l)}function Im(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function xm(t,e){t.sdkProcessingMetadata=x(x({},t.sdkProcessingMetadata),e)}function Om(t,e){t.contexts=x({trace:Ca(e)},t.contexts),t.sdkProcessingMetadata=x({dynamicSamplingContext:Ta(e)},t.sdkProcessingMetadata);let n=yi(e),r=Pr(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function Dm(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}var So,ed,To;function td(t){let e=Ce._sentryDebugIds;if(!e)return{};let n=Object.keys(e);return To&&n.length===ed||(ed=n.length,To=n.reduce((r,i)=>{So||(So={});let o=So[i];if(o)r[o[0]]=o[1];else{let s=t(i);for(let l=s.length-1;l>=0;l--){let d=s[l]?.filename,_=e[i];if(d&&_){r[d]=_,So[i]=[d,_];break}}}return r},{})),To}function nd(t,e,n,r,i,o){let{normalizeDepth:s=3,normalizeMaxBreadth:l=1e3}=t,u=Ee(x({},e),{event_id:e.event_id||n.event_id||ht(),timestamp:e.timestamp||vn()}),d=n.integrations||t.integrations.map(P=>P.name);Am(u,t),Mm(u,d),i&&i.emit("applyFrameMetadata",e),e.type===void 0&&Nm(u,t.stackParser);let _=Lm(r,n.captureContext);n.mechanism&&_n(u,n.mechanism);let h=i?i.getEventProcessors():[],E=vo().getScopeData();if(o){let P=o.getScopeData();Ra(E,P)}if(_){let P=_.getScopeData();Ra(E,P)}let w=[...n.attachments||[],...E.attachments];w.length&&(n.attachments=w),Qu(u,E);let N=[...h,...E.eventProcessors];return wo(N,u,n).then(P=>(P&&Rm(P),typeof s=="number"&&s>0?Pm(P,s,l):P))}function Am(t,e){let{environment:n,release:r,dist:i,maxValueLength:o=250}=e;t.environment=t.environment||n||Lr,!t.release&&r&&(t.release=r),!t.dist&&i&&(t.dist=i);let s=t.request;s?.url&&(s.url=zn(s.url,o))}function Nm(t,e){let n=td(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function Rm(t){let e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(i=>{i.debug_id&&(i.abs_path?e[i.abs_path]=i.debug_id:i.filename&&(e[i.filename]=i.debug_id),delete i.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.entries(e).forEach(([r,i])=>{n.push({type:"sourcemap",code_file:r,debug_id:i})})}function Mm(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function Pm(t,e,n){if(!t)return null;let r=x(x(x(x(x({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>x(x({},i),i.data&&{data:on(i.data,e,n)}))}),t.user&&{user:on(t.user,e,n)}),t.contexts&&{contexts:on(t.contexts,e,n)}),t.extra&&{extra:on(t.extra,e,n)});return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=on(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>x(x({},i),i.data&&{data:on(i.data,e,n)}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=on(t.contexts.flags,3,n)),r}function Lm(t,e){if(!e)return t;let n=t?t.clone():new Tt;return n.update(e),n}function rd(t){if(t)return Fm(t)?{captureContext:t}:Vm(t)?{captureContext:t}:t}function Fm(t){return t instanceof Tt||typeof t=="function"}var km=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Vm(t){return Object.keys(t).some(e=>km.includes(e))}function Io(t,e){return yn().captureException(t,rd(e))}function Ei(t,e){return yn().captureEvent(t,e)}function bi(t){let e=En(),n=yn(),{userAgent:r}=Ce.navigator||{},i=Su(x(x({user:n.getUser()||e.getUser()},r&&{userAgent:r}),t)),o=e.getSession();return o?.status==="ok"&&kn(o,{status:"exited"}),xo(),e.setSession(i),i}function xo(){let t=En(),n=yn().getSession()||t.getSession();n&&Tu(n),od(),t.setSession()}function od(){let t=En(),e=Ke(),n=t.getSession();n&&e&&e.captureSession(n)}function wi(t=!1){if(t){xo();return}od()}var Bm="7";function Um(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function Hm(t){return`${Um(t)}${t.projectId}/envelope/`}function jm(t,e){let n={sentry_version:Bm};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function sd(t,e,n){return e||`${Hm(t)}?${jm(t,n)}`}var ad=[];function cd(t,e){let n={};return e.forEach(r=>{r&&Pa(t,r,n)}),n}function Ma(t,e){for(let n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function Pa(t,e,n){if(n[e.name]){pe&&ie.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,ad.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),ad.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(i,o)=>r(i,o,t))}if(typeof e.processEvent=="function"){let r=e.processEvent.bind(e),i=Object.assign((o,s)=>r(o,s,t),{id:e.name});t.addEventProcessor(i)}pe&&ie.log(`Integration installed: ${e.name}`)}function ld(t,e,n){let r=[{type:"client_report"},{timestamp:n||vn(),discarded_events:t}];return Vn(e?{dsn:e}:{},[r])}function Oo(t){let e=[];t.message&&e.push(t.message);try{let n=t.exception.values[t.exception.values.length-1];n?.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function ud(t){let{trace_id:e,parent_span_id:n,span_id:r,status:i,origin:o,data:s,op:l}=t.contexts?.trace??{};return{data:s??{},description:t.transaction,op:l,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:i,timestamp:t.timestamp,trace_id:e??"",origin:o,profile_id:s?.[ba],exclusive_time:s?.[wa],measurements:t.measurements,is_segment:!0}}function dd(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:x(x(x({},t.data),t.profile_id&&{[ba]:t.profile_id}),t.exclusive_time&&{[wa]:t.exclusive_time})}},measurements:t.measurements}}var fd="Not capturing exception because it's already been captured.",pd="Discarded session because of missing or non-string release",gd=Symbol.for("SentryInternalError"),_d=Symbol.for("SentryDoNotSendEventError");function Do(t){return{message:t,[gd]:!0}}function La(t){return{message:t,[_d]:!0}}function hd(t){return!!t&&typeof t=="object"&&gd in t}function md(t){return!!t&&typeof t=="object"&&_d in t}var Ci=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=ju(e.dsn):pe&&ie.warn("No DSN provided, client will not send events."),this._dsn){let n=sd(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport(Ee(x({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this)},e.transportOptions),{url:n}))}}captureException(e,n,r){let i=ht();if(mo(e))return pe&&ie.log(fd),i;let o=x({event_id:i},n);return this._process(this.eventFromException(e,o).then(s=>this._captureEvent(s,o,r))),o.event_id}captureMessage(e,n,r,i){let o=x({event_id:ht()},r),s=Ar(e)?e:String(e),l=ar(e)?this.eventFromMessage(s,n,o):this.eventFromException(e,o);return this._process(l.then(u=>this._captureEvent(u,o,i))),o.event_id}captureEvent(e,n,r){let i=ht();if(n?.originalException&&mo(n.originalException))return pe&&ie.log(fd),i;let o=x({event_id:i},n),s=e.sdkProcessingMetadata||{},l=s.capturedSpanScope,u=s.capturedSpanIsolationScope;return this._process(this._captureEvent(e,o,l||r,u)),o.event_id}captureSession(e){this.sendSession(e),kn(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(i=>r&&i))):sn(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let n=this._integrations[e.name];Pa(this,e,this._integrations),n||Ma(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=Xu(e,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])r=Wu(r,zu(o));let i=this.sendEnvelope(r);i&&i.then(o=>this.emit("afterSendEvent",e,o),null)}sendSession(e){let{release:n,environment:r=Lr}=this._options;if("aggregates"in e){let o=e.attrs||{};if(!o.release&&!n){pe&&ie.warn(pd);return}o.release=o.release||n,o.environment=o.environment||r,e.attrs=o}else{if(!e.release&&!n){pe&&ie.warn(pd);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);let i=Ku(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(i)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){let i=`${e}:${n}`;pe&&ie.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}on(e,n){let r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{let i=r.indexOf(n);i>-1&&r.splice(i,1)}}emit(e,...n){let r=this._hooks[e];r&&r.forEach(i=>i(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(pe&&ie.error("Error while sending envelope:",n),n)):(pe&&ie.error("Transport disabled"),sn({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=cd(this,e),Ma(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",i=!1,o=n.exception?.values;if(o){i=!0;for(let u of o)if(u.mechanism?.handled===!1){r=!0;break}}let s=e.status==="ok";(s&&e.errors===0||s&&r)&&(kn(e,Ee(x({},r&&{status:"crashed"}),{errors:e.errors||Number(i||r)})),this.captureSession(e))}_isClientDoneProcessing(e){return new dn(n=>{let r=0,i=1,o=setInterval(()=>{this._numProcessing==0?(clearInterval(o),n(!0)):(r+=i,e&&r>=e&&(clearInterval(o),n(!1)))},i)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,i){let o=this.getOptions(),s=Object.keys(this._integrations);return!n.integrations&&s?.length&&(n.integrations=s),this.emit("preprocessEvent",e,n),e.type||i.setLastEventId(e.event_id||n.event_id),nd(o,e,n,r,this,i).then(l=>{if(l===null)return l;this.emit("postprocessEvent",l,n),l.contexts=x({trace:_a(r)},l.contexts);let u=Gu(this,r);return l.sdkProcessingMetadata=x({dynamicSamplingContext:u},l.sdkProcessingMetadata),l})}_captureEvent(e,n={},r=yn(),i=En()){return pe&&Fa(e)&&ie.log(`Captured error event \`${Oo(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,i).then(o=>o.event_id,o=>{pe&&(md(o)?ie.log(o.message):hd(o)?ie.warn(o.message):ie.warn(o))})}_processEvent(e,n,r,i){let o=this.getOptions(),{sampleRate:s}=o,l=vd(e),u=Fa(e),d=e.type||"error",_=`before send for type \`${d}\``,h=typeof s>"u"?void 0:Mu(s);if(u&&typeof h=="number"&&Math.random()>h)return this.recordDroppedEvent("sample_rate","error"),Xn(La(`Discarding event because it's not included in the random sample (sampling rate = ${s})`));let E=d==="replay_event"?"replay":d;return this._prepareEvent(e,n,r,i).then(w=>{if(w===null)throw this.recordDroppedEvent("event_processor",E),La("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return w;let B=Wm(this,o,w,n);return Gm(B,_)}).then(w=>{if(w===null){if(this.recordDroppedEvent("before_send",E),l){let z=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",z)}throw La(`${_} returned \`null\`, will not send event.`)}let N=r.getSession()||i.getSession();if(u&&N&&this._updateSessionFromEvent(N,w),l){let P=w.sdkProcessingMetadata?.spanCountBeforeProcessing||0,z=w.spans?w.spans.length:0,G=P-z;G>0&&this.recordDroppedEvent("before_send","span",G)}let B=w.transaction_info;if(l&&B&&w.transaction!==e.transaction){let P="custom";w.transaction_info=Ee(x({},B),{source:P})}return this.sendEvent(w,n),w}).then(null,w=>{throw md(w)||hd(w)?w:(this.captureException(w,{data:{__sentry__:!0},originalException:w}),Do(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
18
- Reason: ${w}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[i,o]=n.split(":");return{reason:i,category:o,quantity:r}})}_flushOutcomes(){pe&&ie.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){pe&&ie.log("No outcomes to send");return}if(!this._dsn){pe&&ie.log("No dsn provided, will not send outcomes");return}pe&&ie.log("Sending outcomes:",e);let n=ld(e,this._options.tunnel&&Kn(this._dsn));this.sendEnvelope(n)}};function Gm(t,e){let n=`${e} must return \`null\` or a valid event.`;if(Fn(t))return t.then(r=>{if(!Ln(r)&&r!==null)throw Do(n);return r},r=>{throw Do(`${e} rejected with ${r}`)});if(!Ln(t)&&t!==null)throw Do(n);return t}function Wm(t,e,n,r){let{beforeSend:i,beforeSendTransaction:o,beforeSendSpan:s}=e,l=n;if(Fa(l)&&i)return i(l,r);if(vd(l)){if(s){let u=s(ud(l));if(u?l=qn(n,dd(u)):Sa(),l.spans){let d=[];for(let _ of l.spans){let h=s(_);h?d.push(h):(Sa(),d.push(_))}l.spans=d}}if(o){if(l.spans){let u=l.spans.length;l.sdkProcessingMetadata=Ee(x({},n.sdkProcessingMetadata),{spanCountBeforeProcessing:u})}return o(l,r)}}return l}function Fa(t){return t.type===void 0}function vd(t){return t.type==="transaction"}function Ym(t){return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{items:t}]}function yd(t,e,n,r){let i={};return e?.sdk&&(i.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(i.dsn=Kn(r)),Vn(i,[Ym(t)])}function Si(t,e){let n=e??zm(t)??[];if(n.length===0)return;let r=t.getOptions(),i=yd(n,r._metadata,r.tunnel,t.getDsn());Ed().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(i)}function zm(t){return Ed().get(t)}function Ed(){return Pn("clientToLogBufferMap",()=>new WeakMap)}var ka=Symbol.for("SentryBufferFullError");function bd(t){let e=[];function n(){return t===void 0||e.length<t}function r(s){return e.splice(e.indexOf(s),1)[0]||Promise.resolve(void 0)}function i(s){if(!n())return Xn(ka);let l=s();return e.indexOf(l)===-1&&e.push(l),l.then(()=>r(l)).then(null,()=>r(l).then(null,()=>{})),l}function o(s){return new dn((l,u)=>{let d=e.length;if(!d)return l(!0);let _=setTimeout(()=>{s&&s>0&&l(!1)},s);e.forEach(h=>{sn(h).then(()=>{--d||(clearTimeout(_),l(!0))},u)})})}return{$:e,add:i,drain:o}}function qm(t,e=Date.now()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?6e4:r-e}function Km(t,e){return t[e]||t.all||0}function wd(t,e,n=Date.now()){return Km(t,e)>n}function Cd(t,{statusCode:e,headers:n},r=Date.now()){let i=x({},t),o=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(o)for(let l of o.trim().split(",")){let[u,d,,,_]=l.split(":",5),h=parseInt(u,10),E=(isNaN(h)?60:h)*1e3;if(!d)i.all=r+E;else for(let w of d.split(";"))w==="metric_bucket"?(!_||_.split(";").includes("custom"))&&(i[w]=r+E):i[w]=r+E}else s?i.all=r+qm(s,r):e===429&&(i.all=r+60*1e3);return i}var Xm=64;function Ao(t,e,n=bd(t.bufferSize||Xm)){let r={},i=s=>n.drain(s);function o(s){let l=[];if(Oa(s,(h,E)=>{let w=Da(E);wd(r,w)?t.recordDroppedEvent("ratelimit_backoff",w):l.push(h)}),l.length===0)return sn({});let u=Vn(s[0],l),d=h=>{Oa(u,(E,w)=>{t.recordDroppedEvent(h,Da(w))})},_=()=>e({body:Yu(u)}).then(h=>(h.statusCode!==void 0&&(h.statusCode<200||h.statusCode>=300)&&pe&&ie.warn(`Sentry responded with status code ${h.statusCode} to sent event.`),r=Cd(r,h),h),h=>{throw d("network_error"),pe&&ie.error("Encountered error running transport request:",h),h});return n.add(_).then(h=>h,h=>{if(h===ka)return pe&&ie.error("Skipped sending event because buffer is full."),d("queue_overflow"),sn({});throw h})}return{send:o,flush:i}}function Va(t){t.user?.ip_address===void 0&&(t.user=Ee(x({},t.user),{ip_address:"{{auto}}"}))}function Ba(t){"aggregates"in t?t.attrs?.ip_address===void 0&&(t.attrs=Ee(x({},t.attrs),{ip_address:"{{auto}}"})):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function Ua(t,e,n=[e],r="npm"){let i=t._metadata||{};i.sdk||(i.sdk={name:`sentry.javascript.${e}`,packages:n.map(o=>({name:`${r}:@sentry/${o}`,version:hn})),version:hn}),t._metadata=i}var Jm=100;function bn(t,e){let n=Ke(),r=En();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:o=Jm}=n.getOptions();if(o<=0)return;let s=vn(),l=x({timestamp:s},t),u=i?Yn(()=>i(l,e)):l;u!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",u,e),r.addBreadcrumb(u,o))}var Sd,Zm="FunctionToString",Td=new WeakMap,Qm=()=>({name:Zm,setupOnce(){Sd=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=lr(this),n=Td.has(Ke())&&e!==void 0?e:this;return Sd.apply(n,t)}}catch{}},setup(t){Td.set(t,!0)}}),No=Qm;var eg=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,`can't redefine non-configurable property "solana"`,"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],tg="EventFilters",Ha=(t={})=>{let e;return{name:tg,setup(n){let r=n.getOptions();e=Id(t,r)},processEvent(n,r,i){if(!e){let o=i.getOptions();e=Id(t,o)}return ng(n,e)?null:n}}},Mo=(t={})=>Ee(x({},Ha(t)),{name:"InboundFilters"});function Id(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:eg],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function ng(t,e){if(t.type){if(t.type==="transaction"&&ig(t,e.ignoreTransactions))return pe&&ie.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
19
- Event: ${gn(t)}`),!0}else{if(rg(t,e.ignoreErrors))return pe&&ie.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
20
- Event: ${gn(t)}`),!0;if(cg(t))return pe&&ie.warn(`Event dropped due to not having an error message, error type or stacktrace.
21
- Event: ${gn(t)}`),!0;if(og(t,e.denyUrls))return pe&&ie.warn(`Event dropped due to being matched by \`denyUrls\` option.
22
- Event: ${gn(t)}.
23
- Url: ${Ro(t)}`),!0;if(!sg(t,e.allowUrls))return pe&&ie.warn(`Event dropped due to not being matched by \`allowUrls\` option.
24
- Event: ${gn(t)}.
25
- Url: ${Ro(t)}`),!0}return!1}function rg(t,e){return e?.length?Oo(t).some(n=>Nr(n,e)):!1}function ig(t,e){if(!e?.length)return!1;let n=t.transaction;return n?Nr(n,e):!1}function og(t,e){if(!e?.length)return!1;let n=Ro(t);return n?Nr(n,e):!1}function sg(t,e){if(!e?.length)return!0;let n=Ro(t);return n?Nr(n,e):!0}function ag(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 Ro(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?ag(n):null}catch{return pe&&ie.error(`Cannot extract url for event ${gn(t)}`),null}}function cg(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function $a(t,e,n,r,i,o){if(!i.exception?.values||!o||!un(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=ja(t,e,r,o.originalException,n,i.exception.values,s,0))}function ja(t,e,n,r,i,o,s,l){if(o.length>=n+1)return o;let u=[...o];if(un(r[i],Error)){xd(s,l);let d=t(e,r[i]),_=u.length;Od(d,i,_,l),u=ja(t,e,n,r[i],i,[d,...u],d,_)}return Array.isArray(r.errors)&&r.errors.forEach((d,_)=>{if(un(d,Error)){xd(s,l);let h=t(e,d),E=u.length;Od(h,`errors[${_}]`,E,l),u=ja(t,e,n,d,i,[h,...u],h,E)}}),u}function xd(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Ee(x(x({},t.mechanism),t.type==="AggregateError"&&{is_exception_group:!0}),{exception_id:e})}function Od(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism=Ee(x({},t.mechanism),{type:"chained",source:e,exception_id:n,parent_id:r})}function Ga(t){let e="console";At(e,t),Nt(e,lg)}function lg(){"console"in Ce&&Xs.forEach(function(t){t in Ce.console&&pt(Ce.console,t,function(e){return Or[t]=e,function(...n){ft("console",{args:n,level:t}),Or[t]?.apply(Ce.console,n)}})})}function Wa(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var ug="Dedupe",dg=()=>{let t;return{name:ug,processEvent(e){if(e.type)return e;try{if(fg(e,t))return pe&&ie.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}},Po=dg;function fg(t,e){return e?!!(pg(t,e)||hg(t,e)):!1}function pg(t,e){let n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Nd(t,e)||!Ad(t,e))}function hg(t,e){let n=Dd(e),r=Dd(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Nd(t,e)||!Ad(t,e))}function Ad(t,e){let n=ao(t),r=ao(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 Nd(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 Dd(t){return t.exception?.values?.[0]}function Ti(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 Lo(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}var Ii=Ce;function Ya(){return"history"in Ii&&!!Ii.history}function mg(){if(!("fetch"in Ii))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function xi(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function za(){if(typeof EdgeRuntime=="string")return!0;if(!mg())return!1;if(xi(Ii.fetch))return!0;let t=!1,e=Ii.document;if(e&&typeof e.createElement=="function")try{let n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n),n.contentWindow?.fetch&&(t=xi(n.contentWindow.fetch)),e.head.removeChild(n)}catch(n){pe&&ie.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return t}function Ka(t,e){let n="fetch";At(n,t),Nt(n,()=>gg(void 0,e))}function gg(t,e=!1){e&&!za()||pt(Ce,"fetch",function(n){return function(...r){let i=new Error,{method:o,url:s}=_g(r),l={args:r,fetchData:{method:o,url:s},startTimestamp:jt()*1e3,virtualError:i,headers:vg(r)};return t||ft("fetch",x({},l)),n.apply(Ce,r).then(async u=>(t?t(u):ft("fetch",Ee(x({},l),{endTimestamp:jt()*1e3,response:u})),u),u=>{if(ft("fetch",Ee(x({},l),{endTimestamp:jt()*1e3,error:u})),sr(u)&&u.stack===void 0&&(u.stack=i.stack,Kt(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(l.fetchData.url);u.message=`${u.message} (${d.host})`}catch{}throw u})}})}function qa(t,e){return!!t&&typeof t=="object"&&!!t[e]}function Rd(t){return typeof t=="string"?t:t?qa(t,"url")?t.url:t.toString?t.toString():"":""}function _g(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){let[n,r]=t;return{url:Rd(n),method:qa(r,"method")?String(r.method).toUpperCase():"GET"}}let e=t[0];return{url:Rd(e),method:qa(e,"method")?String(e.method).toUpperCase():"GET"}}function vg(t){let[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(_u(e))return new Headers(e.headers)}catch{}}function Xa(){return"npm"}var ot=Ce,Ja=0;function Za(){return Ja>0}function Mg(){Ja++,setTimeout(()=>{Ja--})}function ur(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(lr(t))return t}catch{return t}let r=function(...i){try{let o=i.map(s=>ur(s,e));return t.apply(this,o)}catch(o){throw Mg(),vi(s=>{s.addEventProcessor(l=>(e.mechanism&&(Rr(l,void 0,void 0),_n(l,e.mechanism)),l.extra=Ee(x({},l.extra),{arguments:i}),l)),Io(o)}),o}};try{for(let i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=t[i])}catch{}po(r,t),Kt(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function Md(){let t=_i(),{referrer:e}=ot.document||{},{userAgent:n}=ot.navigator||{},r=x(x({},e&&{Referer:e}),n&&{"User-Agent":n});return{url:t,headers:r}}function Fo(t,e){let n=tc(t,e),r={type:Vg(e),value:Bg(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Pg(t,e,n,r){let o=Ke()?.getOptions().normalizeDepth,s=jg(e),l={__serialized__:bo(e,o)};if(s)return{exception:{values:[Fo(t,s)]},extra:l};let u={exception:{values:[{type:cr(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:Ug(e,{isUnhandledRejection:r})}]},extra:l};if(n){let d=tc(t,n);d.length&&(u.exception.values[0].stacktrace={frames:d})}return u}function Qa(t,e){return{exception:{values:[Fo(t,e)]}}}function tc(t,e){let n=e.stacktrace||e.stack||"",r=Fg(e),i=kg(e);try{return t(n,r,i)}catch{}return[]}var Lg=/Minified React error #\d+;/i;function Fg(t){return t&&Lg.test(t.message)?1:0}function kg(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Pd(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function Vg(t){let e=t?.name;return!e&&Pd(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function Bg(t){let e=t?.message;return Pd(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 Ld(t,e,n,r){let i=n?.syntheticException||void 0,o=ko(t,e,i,r);return _n(o),o.level="error",n?.event_id&&(o.event_id=n.event_id),sn(o)}function Fd(t,e,n="info",r,i){let o=r?.syntheticException||void 0,s=ec(t,e,o,i);return s.level=n,r?.event_id&&(s.event_id=r.event_id),sn(s)}function ko(t,e,n,r,i){let o;if(lo(e)&&e.error)return Qa(t,e.error);if(uo(e)||oa(e)){let s=e;if("stack"in e)o=Qa(t,e);else{let l=s.name||(uo(s)?"DOMError":"DOMException"),u=s.message?`${l}: ${s.message}`:l;o=ec(t,u,n,r),Rr(o,u)}return"code"in s&&(o.tags=Ee(x({},o.tags),{"DOMException.code":`${s.code}`})),o}return sr(e)?Qa(t,e):Ln(e)||cr(e)?(o=Pg(t,e,n,i),_n(o,{synthetic:!0}),o):(o=ec(t,e,n,r),Rr(o,`${e}`,void 0),_n(o,{synthetic:!0}),o)}function ec(t,e,n,r){let i={};if(r&&n){let o=tc(t,n);o.length&&(i.exception={values:[{value:e,stacktrace:{frames:o}}]}),_n(i,{synthetic:!0})}if(Ar(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 Ug(t,{isUnhandledRejection:e}){let n=da(t),r=e?"promise rejection":"exception";return lo(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:cr(t)?`Event \`${Hg(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Hg(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function jg(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let n=t[e];if(n instanceof Error)return n}}var $g=5e3,Oi=class extends Ci{constructor(e){let n=Gg(e),r=ot.SENTRY_SDK_SOURCE||Xa();Ua(n,"browser",["browser"],r),super(n);let{sendDefaultPii:i,sendClientReports:o,enableLogs:s,_experiments:l}=this._options,u=s??l?.enableLogs;ot.document&&(o||u)&&ot.document.addEventListener("visibilitychange",()=>{ot.document.visibilityState==="hidden"&&(o&&this._flushOutcomes(),u&&Si(this))}),u&&(this.on("flush",()=>{Si(this)}),this.on("afterCaptureLog",()=>{this._logFlushIdleTimeout&&clearTimeout(this._logFlushIdleTimeout),this._logFlushIdleTimeout=setTimeout(()=>{Si(this)},$g)})),i&&(this.on("postprocessEvent",Va),this.on("beforeSendSession",Ba))}eventFromException(e,n){return Ld(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return Fd(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 Gg(t){return x({release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:ot.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0},t)}var kd=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var mt=Ce;var Wg=1e3,Vd,nc,rc;function ic(t){let e="dom";At(e,t),Nt(e,Yg)}function Yg(){if(!mt.document)return;let t=ft.bind(null,"dom"),e=Bd(t,!0);mt.document.addEventListener("click",e,!1),mt.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{let i=mt[n]?.prototype;i?.hasOwnProperty?.("addEventListener")&&(pt(i,"addEventListener",function(o){return function(s,l,u){if(s==="click"||s=="keypress")try{let d=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},_=d[s]=d[s]||{refCount:0};if(!_.handler){let h=Bd(t);_.handler=h,o.call(this,s,h,u)}_.refCount++}catch{}return o.call(this,s,l,u)}}),pt(i,"removeEventListener",function(o){return function(s,l,u){if(s==="click"||s=="keypress")try{let d=this.__sentry_instrumentation_handlers__||{},_=d[s];_&&(_.refCount--,_.refCount<=0&&(o.call(this,s,_.handler,u),_.handler=void 0,delete d[s]),Object.keys(d).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return o.call(this,s,l,u)}}))})}function zg(t){if(t.type!==nc)return!1;try{if(!t.target||t.target._sentryId!==rc)return!1}catch{}return!0}function qg(t,e){return t!=="keypress"?!1:e?.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function Bd(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;let r=Kg(n);if(qg(n.type,r))return;Kt(n,"_sentryCaptured",!0),r&&!r._sentryId&&Kt(r,"_sentryId",ht());let i=n.type==="keypress"?"input":n.type;zg(n)||(t({event:n,name:i,global:e}),nc=n.type,rc=r?r._sentryId:void 0),clearTimeout(Vd),Vd=mt.setTimeout(()=>{rc=void 0,nc=void 0},Wg)}}function Kg(t){try{return t.target}catch{return null}}var Vo;function Di(t){let e="history";At(e,t),Nt(e,Xg)}function Xg(){if(mt.addEventListener("popstate",()=>{let e=mt.location.href,n=Vo;if(Vo=e,n===e)return;ft("history",{from:n,to:e})}),!Ya())return;function t(e){return function(...n){let r=n.length>2?n[2]:void 0;if(r){let i=Vo,o=Jg(String(r));if(Vo=o,i===o)return e.apply(this,n);ft("history",{from:i,to:o})}return e.apply(this,n)}}pt(mt.history,"pushState",t),pt(mt.history,"replaceState",t)}function Jg(t){try{return new URL(t,mt.location.origin).toString()}catch{return t}}var Bo={};function oc(t){let e=Bo[t];if(e)return e;let n=mt[t];if(xi(n))return Bo[t]=n.bind(mt);let r=mt.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){kd&&ie.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,i)}return n&&(Bo[t]=n.bind(mt))}function Uo(t){Bo[t]=void 0}var dr="__sentry_xhr_v3__";function sc(t){let e="xhr";At(e,t),Nt(e,Zg)}function Zg(){if(!mt.XMLHttpRequest)return;let t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){let i=new Error,o=jt()*1e3,s=Rt(r[0])?r[0].toUpperCase():void 0,l=Qg(r[1]);if(!s||!l)return e.apply(n,r);n[dr]={method:s,url:l,request_headers:{}},s==="POST"&&l.match(/sentry_key/)&&(n.__sentry_own_request__=!0);let u=()=>{let d=n[dr];if(d&&n.readyState===4){try{d.status_code=n.status}catch{}let _={endTimestamp:jt()*1e3,startTimestamp:o,xhr:n,virtualError:i};ft("xhr",_)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(d,_,h){return u(),d.apply(_,h)}}):n.addEventListener("readystatechange",u),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(d,_,h){let[E,w]=h,N=_[dr];return N&&Rt(E)&&Rt(w)&&(N.request_headers[E.toLowerCase()]=w),d.apply(_,h)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){let i=n[dr];if(!i)return e.apply(n,r);r[0]!==void 0&&(i.body=r[0]);let o={startTimestamp:jt()*1e3,xhr:n};return ft("xhr",o),e.apply(n,r)}})}function Qg(t){if(Rt(t))return t;try{return t.toString()}catch{}}function ac(t,e=oc("fetch")){let n=0,r=0;function i(o){let s=o.body.length;n+=s,r++;let l=x({body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15},t.fetchOptions);if(!e)return Uo("fetch"),Xn("No fetch implementation available");try{return e(t.url,l).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 Uo("fetch"),n-=s,r--,Xn(u)}}return Ao(t,i)}var e_=30;var t_=50;function cc(t,e,n,r){let i={filename:t,function:e==="<anonymous>"?mn:e,in_app:!0};return n!==void 0&&(i.lineno=n),r!==void 0&&(i.colno=r),i}var n_=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,r_=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,i_=/\((\S*)(?::(\d+))(?::(\d+))\)/,o_=t=>{let e=n_.exec(t);if(e){let[,r,i,o]=e;return cc(r,mn,+i,+o)}let n=r_.exec(t);if(n){if(n[2]&&n[2].indexOf("eval")===0){let s=i_.exec(n[2]);s&&(n[2]=s[1],n[3]=s[2],n[4]=s[3])}let[i,o]=$d(n[1]||mn,n[2]);return cc(o,i,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},Ud=[e_,o_],s_=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,a_=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,c_=t=>{let e=s_.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){let o=a_.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]||mn;return[i,r]=$d(i,r),cc(r,i,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Hd=[t_,c_];var jd=[Ud,Hd],lc=ea(...jd),$d=(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]:mn,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};var Fr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Ho=1024,l_="Breadcrumbs",u_=(t={})=>{let e=x({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t);return{name:l_,setup(n){e.console&&Ga(p_(n)),e.dom&&ic(f_(n,e.dom)),e.xhr&&sc(h_(n)),e.fetch&&Ka(m_(n)),e.history&&Di(g_(n)),e.sentry&&n.on("beforeSendEvent",d_(n))}}},Gd=u_;function d_(t){return function(n){Ke()===t&&bn({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:gn(n)},{event:n})}}function f_(t,e){return function(r){if(Ke()!==t)return;let i,o,s=typeof e=="object"?e.serializeAttribute:void 0,l=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;l&&l>Ho&&(Fr&&ie.warn(`\`dom.maxStringLength\` cannot exceed ${Ho}, but a value of ${l} was configured. Sentry will use ${Ho} instead.`),l=Ho),typeof s=="string"&&(s=[s]);try{let d=r.event,_=__(d)?d.target:d;i=gi(_,{keyAttrs:s,maxStringLength:l}),o=ua(_)}catch{i="<unknown>"}if(i.length===0)return;let u={category:`ui.${r.name}`,message:i};o&&(u.data={"ui.component_name":o}),bn(u,{event:r.event,name:r.name,global:r.global})}}function p_(t){return function(n){if(Ke()!==t)return;let r={category:"console",data:{arguments:n.args,logger:"console"},level:Wa(n.level),message:fo(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${fo(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;bn(r,{input:n.args,level:n.level})}}function h_(t){return function(n){if(Ke()!==t)return;let{startTimestamp:r,endTimestamp:i}=n,o=n.xhr[dr];if(!r||!i||!o)return;let{method:s,url:l,status_code:u,body:d}=o,_={method:s,url:l,status_code:u},h={xhr:n.xhr,input:d,startTimestamp:r,endTimestamp:i},E={category:"xhr",data:_,type:"http",level:Lo(u)};t.emit("beforeOutgoingRequestBreadcrumb",E,h),bn(E,h)}}function m_(t){return function(n){if(Ke()!==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},l={category:"fetch",data:o,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",l,s),bn(l,s)}else{let o=n.response,s=Ee(x({},n.fetchData),{status_code:o?.status});n.fetchData.request_body_size,n.fetchData.response_body_size,o?.status;let l={input:n.args,response:o,startTimestamp:r,endTimestamp:i},u={category:"fetch",data:s,type:"http",level:Lo(s.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",u,l),bn(u,l)}}}function g_(t){return function(n){if(Ke()!==t)return;let r=n.from,i=n.to,o=Ti(ot.location.href),s=r?Ti(r):void 0,l=Ti(i);s?.path||(s=o),o.protocol===l.protocol&&o.host===l.host&&(i=l.relative),o.protocol===s.protocol&&o.host===s.host&&(r=s.relative),bn({category:"navigation",data:{from:r,to:i}})}}function __(t){return!!t&&!!t.target}var v_=["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"],y_="BrowserApiErrors",E_=(t={})=>{let e=x({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1},t);return{name:y_,setupOnce(){e.setTimeout&&pt(ot,"setTimeout",Wd),e.setInterval&&pt(ot,"setInterval",Wd),e.requestAnimationFrame&&pt(ot,"requestAnimationFrame",b_),e.XMLHttpRequest&&"XMLHttpRequest"in ot&&pt(XMLHttpRequest.prototype,"send",w_);let n=e.eventTarget;n&&(Array.isArray(n)?n:v_).forEach(i=>C_(i,e))}}},Yd=E_;function Wd(t){return function(...e){let n=e[0];return e[0]=ur(n,{mechanism:{data:{function:rn(t)},handled:!1,type:"instrument"}}),t.apply(this,e)}}function b_(t){return function(e){return t.apply(this,[ur(e,{mechanism:{data:{function:"requestAnimationFrame",handler:rn(t)},handled:!1,type:"instrument"}})])}}function w_(t){return function(...e){let n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(i=>{i in n&&typeof n[i]=="function"&&pt(n,i,function(o){let s={mechanism:{data:{function:i,handler:rn(o)},handled:!1,type:"instrument"}},l=lr(o);return l&&(s.mechanism.data.handler=rn(l)),ur(o,s)})}),t.apply(this,e)}}function C_(t,e){let r=ot[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(pt(r,"addEventListener",function(i){return function(o,s,l){try{S_(s)&&(s.handleEvent=ur(s.handleEvent,{mechanism:{data:{function:"handleEvent",handler:rn(s),target:t},handled:!1,type:"instrument"}}))}catch{}return e.unregisterOriginalCallbacks&&T_(this,o,s),i.apply(this,[o,ur(s,{mechanism:{data:{function:"addEventListener",handler:rn(s),target:t},handled:!1,type:"instrument"}}),l])}}),pt(r,"removeEventListener",function(i){return function(o,s,l){try{let u=s.__sentry_wrapped__;u&&i.call(this,o,u,l)}catch{}return i.call(this,o,s,l)}}))}function S_(t){return typeof t.handleEvent=="function"}function T_(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}var zd=()=>({name:"BrowserSession",setupOnce(){if(typeof ot.document>"u"){Fr&&ie.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}bi({ignoreDuration:!0}),wi(),Di(({from:t,to:e})=>{t!==void 0&&t!==e&&(bi({ignoreDuration:!0}),wi())})}});var I_="GlobalHandlers",x_=(t={})=>{let e=x({onerror:!0,onunhandledrejection:!0},t);return{name:I_,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(O_(n),qd("onerror")),e.onunhandledrejection&&(D_(n),qd("onunhandledrejection"))}}},Kd=x_;function O_(t){na(e=>{let{stackParser:n,attachStacktrace:r}=Xd();if(Ke()!==t||Za())return;let{msg:i,url:o,line:s,column:l,error:u}=e,d=R_(ko(n,u||i,void 0,r,!1),o,s,l);d.level="error",Ei(d,{originalException:u,mechanism:{handled:!1,type:"onerror"}})})}function D_(t){ia(e=>{let{stackParser:n,attachStacktrace:r}=Xd();if(Ke()!==t||Za())return;let i=A_(e),o=ar(i)?N_(i):ko(n,i,void 0,r,!0);o.level="error",Ei(o,{originalException:i,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function A_(t){if(ar(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 N_(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function R_(t,e,n,r){let i=t.exception=t.exception||{},o=i.values=i.values||[],s=o[0]=o[0]||{},l=s.stacktrace=s.stacktrace||{},u=l.frames=l.frames||[],d=r,_=n,h=Rt(e)&&e.length>0?e:_i();return u.length===0&&u.push({colno:d,filename:h,function:mn,in_app:!0,lineno:_}),t}function qd(t){Fr&&ie.log(`Global Handler attached: ${t}`)}function Xd(){return Ke()?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}var Jd=()=>({name:"HttpContext",preprocessEvent(t){if(!ot.navigator&&!ot.location&&!ot.document)return;let e=Md(),n=x(x({},e.headers),t.request?.headers);t.request=Ee(x(x({},e),t.request),{headers:n})}});var M_="cause",P_=5,L_="LinkedErrors",F_=(t={})=>{let e=t.limit||P_,n=t.key||M_;return{name:L_,preprocessEvent(r,i,o){let s=o.getOptions();$a(Fo,s.stackParser,n,e,r,i)}}},Zd=F_;function uc(t){return[Mo(),No(),Yd(),Gd(),Kd(),Zd(),Po(),Jd(),zd()]}var Qd={},ef,dc,k_;(()=>{let t=uc({}).filter(e=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(e.name));dc=new Oi({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:ac,stackParser:lc,integrations:t,environment:Mn.mode,release:`web-sdk@${Ze.SDK_VERSION}`,debug:Mn.debug}),dc.init()})();function $o(t,e,n){qe.error(`${e}:`,t);let r=U_(n);if(r.setTag("operation",e),t instanceof oo){V_(r,t,e);return}r.captureException(t)}function V_(t,e,n){if(B_(t,e),e.response){let r=e.response;t.setTag("http.status_code",r.status),t.setExtras({responseText:e.responseText,statusText:r.statusText,responseType:r.type,redirected:r.redirected,responseUrl:r.url}),t.captureMessage(`${n} failed with ${r.status}`,"error");return}if(e.request){t.captureMessage(`No response was received for ${n}`,"error");return}}function B_(t,e){let n=e.request;n&&t.setExtras({body:e.requestBody,headers:n.headers,method:n.method,url:n.url})}function U_(t){t??={};let{extra:e,tags:n}=t,r=new Tt;if(r.setClient(dc),r.setUser(k_),t.triggerContext&&!t.engagementTrigger&&(t.engagementTrigger=t.triggerContext.triggerData),t.engagementTrigger){let i=t.engagementTrigger;r.setTags({"engagement.id":i.engagementID,"engagement.short_id":i.shortID,"engagement.objective":i.objective,"engagement.delivery_type":i.onsiteDeliveryType,"engagement.content_id":i.contentID,"engagement.variation":i.variation,"engagement.currency":i.currency})}return e&&r.setExtras(e),n&&r.setTags(n),ef&&r.setTags(ef),Object.keys(Qd).forEach(i=>{r.setContext(i,Qd[i])}),r.setTag("language",navigator.language),r.setTag("timezone",tf()),H_(r),r}function H_(t){window.Shopify&&(t.setTag("shopify.shop",window.Shopify.shop),t.setTag("shopify.currency",window.Shopify.currency?.active),t.setTag("shopify.locale",window.Shopify.locale),t.setTag("theme.schema_name",window.Shopify.theme?.schema_name),t.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}var Go=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("."),l=s[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),u=s[1]?i+s[1]:"";return l+u}};function nf(t){let e=new Date(Date.UTC(0,0,0,0,0,0,t)),n=[];return e.getUTCMinutes()&&n.push(e.getUTCMinutes()+"m"),e.getUTCSeconds()&&n.push(e.getUTCSeconds()+"s"),e.getUTCMilliseconds()&&n.push(e.getUTCMilliseconds()+"ms"),n.length||n.push("0ms"),n.join(" ")}var Wo=class{isCartDirty=!0;cartEngagements;isGoKwikPopupOpen;previewIDs;previewVariant;pageName;moneyFormat;jsLoadTime=new Date;shopCurrencyCode;locale;customContext={};activeExperiments;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 Sr(e)}getJSLoadTimeDiff(){return nf(Date.now()-this.jsLoadTime.getTime())}};function fc(t,e,n){return{[t]:Bn(e,n),[t+"_wo_currency"]:e}}function Bn(t,e){if(t==0&&e)return"Free";let n=Wo.get(),r=nn.get(),i=n.shopCurrencyCode||r.currency,o=n.currencyCode;o||qe.warn("Currency code is not set in RuntimeData");let s=r.money?.format??n.moneyFormat,l;if(s&&i===o)l=Go.format(t*100,s);else{let u;try{u=new Intl.NumberFormat(j_(),{style:"currency",currency:o||i,minimumFractionDigits:0,maximumFractionDigits:2})}catch(d){return $o(d,"format-currency",{extra:{currentCurrency:o,shopCurrency:i}}),""}l=u.format(t),l=l.replace("\u20B9","Rs. "),r.money?.showCurrency&&o!=="INR"&&(l=l.concat(` ${o}`))}return l}function j_(){return navigator.languages!==void 0?navigator.languages[0].split("-")[0]:navigator.language??"en"}var Yo;function tf(){if(Yo)return Yo;try{return Yo=Intl.DateTimeFormat().resolvedOptions().timeZone,Yo}catch{return""}}var wn=class t{transform(e){return e==null?null:Bn(e)}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=Xi({name:"cooeeCurrency",type:t,pure:!0})};var Mt=Wi(of());Mt.filters.define("default",function(t){return typeof t>"u"||t==null?"":G_(t)});+Mt.filters.define("max",(t,e)=>{let n=Number(t),r=Number(e);return isNaN(n)||isNaN(r)?t:n>r?e:t});Mt.filters.define("min",(t,e)=>{let n=Number(t),r=Number(e);return isNaN(n)||isNaN(r)?t:n<r?e:t});Mt.filters.define("fallback",(t,e)=>t==null||t===""?e:t);Mt.filters.define("manipulate_quantity",(t,e,n)=>{if(e??=1,n??=100,e>n)return qe.error("Invalid range: min should be less than or equal to max."),t;if(t>=e&&t<=n)return t;let r=t%n;return r<e?e:r});Mt.filters.define("apply_discount_perc",(t,e,n=1/0)=>{if(t=+t,isNaN(t))return qe.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(e<0||e>100)return qe.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let r=t*e/100;return t-Math.min(n,r)});Mt.filters.define("apply_discount_fixed",(t,e)=>(t=+t,isNaN(t)?(qe.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,t-e)));Mt.filters.define("currency",t=>(t=+t,isNaN(t)?(qe.error("Need value as a number for `currency` filter"),NaN):Bn(t)));Mt.defaultConfig.defaultFilter="default";Mt.defaultConfig.useWith=!0;Mt.defaultConfig.autoEscape=!1;var $_={'"':"&quot;","\\":"&bsol;","\n":"\\n"};function G_(t){return String(t).replace(/["\\\n]/g,e=>$_[e])}function W_(t){if(!t)return"";let e=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return t.replace(e,(n,r,i,o)=>`{{ ${(i||o||"").trim()} }}`)}var kr=(t,e,n)=>{e=x({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},e);try{return Mt.render(W_(t),e)}catch(r){throw $o(r,"squirrelly-render",{extra:{template:t,values:e},triggerContext:n}),r}};var qo=class t{transform(e,n){return e?kr(e,x({},n)):null}static \u0275fac=function(n){return new(n||t)};static \u0275pipe=Xi({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",l=function(){if(!e.OffscreenCanvas)return!1;var v=new OffscreenCanvas(1,1),y=v.getContext("2d");y.fillRect(0,0,1,1);var U=v.transferToImageBitmap();try{y.createPattern(U,"no-repeat")}catch{return!1}return!0}();function u(){}function d(v){var y=n.exports.Promise,U=y!==void 0?y:e.Promise;return typeof U=="function"?new U(v):(v(u,u),null)}var _=function(v,y){return{transform:function(U){if(v)return U;if(y.has(U))return y.get(U);var X=new OffscreenCanvas(U.width,U.height),oe=X.getContext("2d");return oe.drawImage(U,0,0),y.set(U,X),X},clear:function(){y.clear()}}}(l,new Map),h=function(){var v=Math.floor(16.666666666666668),y,U,X={},oe=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(y=function(ae){var de=Math.random();return X[de]=requestAnimationFrame(function ee(ce){oe===ce||oe+v-1<ce?(oe=ce,delete X[de],ae()):X[de]=requestAnimationFrame(ee)}),de},U=function(ae){X[ae]&&cancelAnimationFrame(X[ae])}):(y=function(ae){return setTimeout(ae,v)},U=function(ae){return clearTimeout(ae)}),{frame:y,cancel:U}}(),E=function(){var v,y,U={};function X(oe){function ae(de,ee){oe.postMessage({options:de||{},callback:ee})}oe.init=function(ee){var ce=ee.transferControlToOffscreen();oe.postMessage({canvas:ce},[ce])},oe.fire=function(ee,ce,re){if(y)return ae(ee,null),y;var he=Math.random().toString(36).slice(2);return y=d(function(le){function me(ge){ge.data.callback===he&&(delete U[he],oe.removeEventListener("message",me),y=null,_.clear(),re(),le())}oe.addEventListener("message",me),ae(ee,he),U[he]=me.bind(null,{data:{callback:he}})}),y},oe.reset=function(){oe.postMessage({reset:!0});for(var ee in U)U[ee](),delete U[ee]}}return function(){if(v)return v;if(!r&&o){var oe=["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(`
26
- `);try{v=new Worker(URL.createObjectURL(new Blob([oe])))}catch(ae){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("\u{1F38A} Could not load worker",ae),null}X(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 B(v){return v!=null}function P(v,y,U){return N(v&&B(v[y])?v[y]:w[y],U)}function z(v){return v<0?0:Math.floor(v)}function G(v,y){return Math.floor(Math.random()*(y-v))+v}function te(v){return parseInt(v,16)}function q(v){return v.map(Me)}function Me(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:te(y.substring(0,2)),g:te(y.substring(2,4)),b:te(y.substring(4,6))}}function H(v){var y=P(v,"origin",Object);return y.x=P(y,"x",Number),y.y=P(y,"y",Number),y}function ve(v){v.width=document.documentElement.clientWidth,v.height=document.documentElement.clientHeight}function fe(v){var y=v.getBoundingClientRect();v.width=y.width,v.height=y.height}function be(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 Ve(v,y,U,X,oe,ae,de,ee,ce){v.save(),v.translate(y,U),v.rotate(ae),v.scale(X,oe),v.arc(0,0,1,de,ee,ce),v.restore()}function Pe(v){var y=v.angle*(Math.PI/180),U=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*U-Math.random()*U),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 U=y.tick++/y.totalTicks,X=y.x+y.random*y.tiltCos,oe=y.y+y.random*y.tiltSin,ae=y.wobbleX+y.random*y.tiltCos,de=y.wobbleY+y.random*y.tiltSin;if(v.fillStyle="rgba("+y.color.r+", "+y.color.g+", "+y.color.b+", "+(1-U)+")",v.beginPath(),s&&y.shape.type==="path"&&typeof y.shape.path=="string"&&Array.isArray(y.shape.matrix))v.fill(O(y.shape.path,y.shape.matrix,y.x,y.y,Math.abs(ae-X)*.1,Math.abs(de-oe)*.1,Math.PI/10*y.wobble));else if(y.shape.type==="bitmap"){var ee=Math.PI/10*y.wobble,ce=Math.abs(ae-X)*.1,re=Math.abs(de-oe)*.1,he=y.shape.bitmap.width*y.scalar,le=y.shape.bitmap.height*y.scalar,me=new DOMMatrix([Math.cos(ee)*ce,Math.sin(ee)*ce,-Math.sin(ee)*re,Math.cos(ee)*re,y.x,y.y]);me.multiplySelf(new DOMMatrix(y.shape.matrix));var ge=v.createPattern(_.transform(y.shape.bitmap),"no-repeat");ge.setTransform(me),v.globalAlpha=1-U,v.fillStyle=ge,v.fillRect(y.x-he/2,y.y-le/2,he,le),v.globalAlpha=1}else if(y.shape==="circle")v.ellipse?v.ellipse(y.x,y.y,Math.abs(ae-X)*y.ovalScalar,Math.abs(de-oe)*y.ovalScalar,Math.PI/10*y.wobble,0,2*Math.PI):Ve(v,y.x,y.y,Math.abs(ae-X)*y.ovalScalar,Math.abs(de-oe)*y.ovalScalar,Math.PI/10*y.wobble,0,2*Math.PI);else if(y.shape==="star")for(var _e=Math.PI/2*3,p=4*y.scalar,a=8*y.scalar,c=y.x,g=y.y,T=5,A=Math.PI/T;T--;)c=y.x+Math.cos(_e)*a,g=y.y+Math.sin(_e)*a,v.lineTo(c,g),_e+=A,c=y.x+Math.cos(_e)*p,g=y.y+Math.sin(_e)*p,v.lineTo(c,g),_e+=A;else v.moveTo(Math.floor(y.x),Math.floor(y.y)),v.lineTo(Math.floor(y.wobbleX),Math.floor(oe)),v.lineTo(Math.floor(ae),Math.floor(de)),v.lineTo(Math.floor(X),Math.floor(y.wobbleY));return v.closePath(),v.fill(),y.tick<y.totalTicks}function ze(v,y,U,X,oe){var ae=y.slice(),de=v.getContext("2d"),ee,ce,re=d(function(he){function le(){ee=ce=null,de.clearRect(0,0,X.width,X.height),_.clear(),oe(),he()}function me(){r&&!(X.width===i.width&&X.height===i.height)&&(X.width=v.width=i.width,X.height=v.height=i.height),!X.width&&!X.height&&(U(v),X.width=v.width,X.height=v.height),de.clearRect(0,0,X.width,X.height),ae=ae.filter(function(ge){return Le(de,ge)}),ae.length?ee=h.frame(me):le()}ee=h.frame(me),ce=le});return{addFettis:function(he){return ae=ae.concat(he),re},canvas:v,promise:re,reset:function(){ee&&h.cancel(ee),ce&&ce()}}}function Xe(v,y){var U=!v,X=!!P(y||{},"resize"),oe=!1,ae=P(y,"disableForReducedMotion",Boolean),de=o&&!!P(y||{},"useWorker"),ee=de?E():null,ce=U?ve:fe,re=v&&ee?!!v.__confetti_initialized:!1,he=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,le;function me(_e,p,a){for(var c=P(_e,"particleCount",z),g=P(_e,"angle",Number),T=P(_e,"spread",Number),A=P(_e,"startVelocity",Number),F=P(_e,"decay",Number),ye=P(_e,"gravity",Number),Te=P(_e,"drift",Number),we=P(_e,"colors",q),Be=P(_e,"ticks",Number),Ue=P(_e,"shapes"),tt=P(_e,"scalar"),$t=!!P(_e,"flat"),Jt=H(_e),Tn=c,xt=[],Gt=v.width*Jt.x,ji=v.height*Jt.y;Tn--;)xt.push(Pe({x:Gt,y:ji,angle:g,spread:T,startVelocity:A,color:we[Tn%we.length],shape:Ue[G(0,Ue.length)],ticks:Be,decay:F,gravity:ye,drift:Te,scalar:tt,flat:$t}));return le?le.addFettis(xt):(le=ze(v,xt,ce,p,a),le.promise)}function ge(_e){var p=ae||P(_e,"disableForReducedMotion",Boolean),a=P(_e,"zIndex",Number);if(p&&he)return d(function(A){A()});U&&le?v=le.canvas:U&&!v&&(v=be(a),document.body.appendChild(v)),X&&!re&&ce(v);var c={width:v.width,height:v.height};ee&&!re&&ee.init(v),re=!0,ee&&(v.__confetti_initialized=!0);function g(){if(ee){var A={getBoundingClientRect:function(){if(!U)return v.getBoundingClientRect()}};ce(A),ee.postMessage({resize:{width:A.width,height:A.height}});return}c.width=c.height=null}function T(){le=null,X&&(oe=!1,e.removeEventListener("resize",g)),U&&v&&(document.body.contains(v)&&document.body.removeChild(v),v=null,re=!1)}return X&&!oe&&(oe=!0,e.addEventListener("resize",g,!1)),ee?ee.fire(_e,c,T):me(_e,c,T)}return ge.reset=function(){ee&&ee.reset(),le&&le.reset()},ge}var _t;function D(){return _t||(_t=Xe(null,{useWorker:!0,resize:!0})),_t}function O(v,y,U,X,oe,ae,de){var ee=new Path2D(v),ce=new Path2D;ce.addPath(ee,new DOMMatrix(y));var re=new Path2D;return re.addPath(ce,new DOMMatrix([Math.cos(de)*oe,Math.sin(de)*oe,-Math.sin(de)*ae,Math.cos(de)*ae,U,X])),re}function L(v){if(!s)throw new Error("path confetti are not supported in this browser");var y,U;typeof v=="string"?y=v:(y=v.path,U=v.matrix);var X=new Path2D(y),oe=document.createElement("canvas"),ae=oe.getContext("2d");if(!U){for(var de=1e3,ee=de,ce=de,re=0,he=0,le,me,ge=0;ge<de;ge+=2)for(var _e=0;_e<de;_e+=2)ae.isPointInPath(X,ge,_e,"nonzero")&&(ee=Math.min(ee,ge),ce=Math.min(ce,_e),re=Math.max(re,ge),he=Math.max(he,_e));le=re-ee,me=he-ce;var p=10,a=Math.min(p/le,p/me);U=[a,0,0,a,-Math.round(le/2+ee)*a,-Math.round(me/2+ce)*a]}return{type:"path",path:y,matrix:U}}function M(v){var y,U=1,X="#000000",oe='"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,U="scalar"in v?v.scalar:U,oe="fontFamily"in v?v.fontFamily:oe,X="color"in v?v.color:X);var ae=10*U,de=""+ae+"px "+oe,ee=new OffscreenCanvas(ae,ae),ce=ee.getContext("2d");ce.font=de;var re=ce.measureText(y),he=Math.ceil(re.actualBoundingBoxRight+re.actualBoundingBoxLeft),le=Math.ceil(re.actualBoundingBoxAscent+re.actualBoundingBoxDescent),me=2,ge=re.actualBoundingBoxLeft+me,_e=re.actualBoundingBoxAscent+me;he+=me+me,le+=me+me,ee=new OffscreenCanvas(he,le),ce=ee.getContext("2d"),ce.font=de,ce.fillStyle=X,ce.fillText(y,ge,_e);var p=1/U;return{type:"bitmap",bitmap:ee.transferToImageBitmap(),matrix:[p,0,0,p,-he*p/2,-le*p/2]}}n.exports=function(){return D().apply(this,arguments)},n.exports.reset=function(){D().reset()},n.exports.create=Xe,n.exports.shapeFromPath=L,n.exports.shapeFromText=M})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),pc,!1);var sf=pc.exports,YO=pc.exports.create;var Ko=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 sf(e)}static async realisticFire(e,n){let i={origin:{y:.7}};await this.fire(Object.assign({},i,n,{particleCount:Math.floor(200*e)}))}};var Y_=(t,e)=>e.minValue;function z_(t,e){if(t&1&&(Et(0,"div",7),Qe(1,"safeHtml")),t&2){let n=Y().$implicit;Dt("innerHTML",it(1,1,n.minValue+" Products"),vt)}}function q_(t,e){if(t&1&&(Et(0,"div",7),Qe(1,"cooeeCurrency"),Qe(2,"safeHtml")),t&2){let n=Y().$implicit;Dt("innerHTML",it(2,3,it(1,1,n.minValue)),vt)}}function K_(t,e){if(t&1&&(ct(0,"li",6)(1,"div"),De(2,z_,2,3,"div",7)(3,q_,3,5,"div",7),Et(4,"img",8),ct(5,"div",9),Re(6),yt()()()),t&2){let n=e.$implicit,r=Y(2);si("left",n.calculatedAlignment+"%"),k(2),Ae((r.progressBarConfig==null?null:r.progressBarConfig.rewardBasis)===r.RewardBasis.ITEM_COUNT?2:3),k(2),Dt("src",r.getIconURL(n),dt),k(2),fn(n.label)}}function X_(t,e){if(t&1&&(Et(0,"div",0),Qe(1,"cooeeDynamicVariables"),Qe(2,"safeHtml"),ct(3,"div",1)(4,"ul",2)(5,"div",3),Et(6,"div",4),yt(),nt(7,K_,7,5,"li",5,Y_),yt()()),t&2){let n=Y(),r=n.calculatedState(),i=r.nextMilestone?r.nextMilestone.reachingText:r.lastMilestone.reachedText;Dt("innerHTML",it(2,6,Ml(1,3,i,n.localDynamicVariables())),vt),k(6),si("width",r.cartValuePercentage+"%"),k(),rt(r.milestones)}}var Xo=class t extends tn{cart;localDynamicVariables=Ct({});calculatedState=Ct({});progressBarConfig;RewardBasis=Gs;constructor(){super()}engagementTriggerReceived(e){this.progressBarConfig=e.progressBarConfig}ngOnInit(){super.ngOnInit(),this.calculateMilestonesSilently()}update(){this.calculateMilestonesSilently()}getIconURL(e){return e.rewardType===fi.FREE_SHIPPING?"https://img.icons8.com/ios-filled/50/FFFFFF/free-shipping.png":e.rewardType===fi.DISCOUNT?"https://img.icons8.com/ios-glyphs/30/FFFFFF/sale-price-tag.png":e.rewardType===fi.FREE_AUTO_GIFT?"https://img.icons8.com/ios-filled/50/FFFFFF/gift--v1.png":""}calculateMilestonesSilently(){this.calculateMilestones().catch(e=>qe.error(e))}async calculateMilestones(){let e=this.engagementTrigger,n=this.progressBarConfig;if(!n?.milestones?.length){qe.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;qe.verbose("Cart value:",o,`, percentage: ${s}%`),this.celebrate(e,o);let l={milestonesReady:!0,cartValuePercentage:s,milestones:n.milestones},u=n.milestones.find(d=>!d.reached);if(u){let d=Bn(u.minValue-o);if(n.rewardBasis==="ITEM_COUNT"){let _=u.minValue-o;d=`${_} ${_===1?"product":"products"}`}this.localDynamicVariables.set({amount_left:d}),l.nextMilestone=u,this.calculatedState.set(l);return}l.lastMilestone=i,this.calculatedState.set(l)}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||Ko.realistic())}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-progressbar"]],inputs:{cart:"cart"},features:[St],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&&De(0,X_,9,8),n&2&&Ae(r.calculatedState().milestonesReady?0:-1)},dependencies:[qo,Wn,wn],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))}
27
- `],encapsulation:3})};var J_=["numberVariable"],Jo=class t extends tn{numberSlot;savingsBarConfig;textParts=Ct({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=x(x({},this.engagementTrigger.getCartMagicVariables()),fc("total_savings",this.savingsBarConfig.totalSavings)),n=kr(this.savingsBarConfig.text,{cart:e},this.triggerContext),r=n.match(/[\d.,]+/)?.[0];if(!r){qe.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 l=Math.floor(Math.random()*10);o.innerHTML=`<div>${l}</div>`},50);this.globalIntervals.push(s),setTimeout(()=>{clearInterval(s);let l=e?.[i]??Math.floor(Math.random()*10);o.innerHTML=`${l}`},(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=Ne({type:t,selectors:[["cooee-savings-bar"]],viewQuery:function(n,r){if(n&1&&xn(J_,5),n&2){let i;On(i=Dn())&&(r.numberSlot=i.first)}},features:[St],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&&(ct(0,"div",1),Et(1,"div",2)(2,"div",3)(3,"div",4,0)(5,"div",5),yt()),n&2&&(k(2),Dt("innerHTML",r.textParts().start,vt),k(3),Dt("innerHTML",r.textParts().end,vt))},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}
28
- `],encapsulation:3})};var Z_=(t,e)=>({enter:t,exit:e});function Q_(t,e){if(t&1&&(K(0,"div",7),Re(1),Z(),K(2,"div",8),Re(3),Z()),t&2){let n=Y(2);k(),Bt(" ",n.getCurrency(n.selectedVariant().price.cmp)," "),k(2),Bt(" ",n.getDiscountPercentage(n.selectedVariant().price),"% off ")}}function ev(t,e){if(t&1&&(K(0,"div",6),Re(1),Z()),t&2){let n=Y(2);k(),Bt(" ",n.stickyATCConfig.leftText," ")}}function tv(t,e){if(t&1&&(K(0,"div",1)(1,"div",5),Re(2),Z(),De(3,Q_,4,2),De(4,ev,2,1,"div",6),Z()),t&2){let n=Y();k(2),Bt(" ",n.getCurrency(n.selectedVariant().price.d)," "),k(),Ae(n.selectedVariant().price.cmp?3:-1),k(),Ae(n.stickyATCConfig.leftText?4:-1)}}function nv(t,e){if(t&1&&(K(0,"div",9),Re(1),Z()),t&2){let n=e.$implicit,r=e.$index;Y(2);let i=Je(5);Se("ngClass",Qi(2,Z_,r===i.currentIndex,r===i.previousIndex)),k(),Bt(" ",n," ")}}function rv(t,e){if(t&1&&(K(0,"div",4),nt(1,nv,2,5,"div",9,In),Z()),t&2){Y();let n=Je(5);k(),rt(n.features)}}var Zo=class t extends tn{currentItem;stickyATCConfig;selectedVariant=Ct(void 0);featureSlider=Ct({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 Bn(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(`
29
- `),n=e.length===1?null:setInterval(()=>{this.featureSlider.update(r=>Ee(x({},r),{previousIndex:r.currentIndex,currentIndex:(r.currentIndex+1)%r.features.length}))},3e3);this.featureSlider.set({intervalRef:n,currentIndex:0,features:e})}replaceVariables(e){return e?kr(e,this.currentItem.getTemplateVariables(),this.triggerContext):""}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-sticky-atc"]],features:[St],decls:7,vars:3,consts:[[1,"lc-wrapper"],[1,"lc-prices"],[1,"lc-button-wrapper"],["type","button",1,"lc-button","lc-button-atc",3,"click"],[1,"lc-features"],[1,"lc-sale-price"],[1,"lc-additional-text"],[1,"lc-compare-price"],[1,"lc-discount-label"],[1,"lc-feature",3,"ngClass"]],template:function(n,r){if(n&1){let i=Ge();K(0,"div",0),De(1,tv,5,3,"div",1),K(2,"div",2)(3,"button",3),Fe("click",function(){return xe(i),Oe(r.addToCart())}),Re(4,"Add To Cart"),Z(),It(5),De(6,rv,3,0,"div",4),Z()()}if(n&2){k(),Ae(r.selectedVariant()&&r.stickyATCConfig.showProductInfo?1:-1),k(4);let i=bt(r.featureSlider());k(),Ae(i.features.length?6:-1)}},dependencies:[Gn],styles:["[_nghost-%COMP%]{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices[_ngcontent-%COMP%]{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media (min-width: 768px){.lc-prices[_ngcontent-%COMP%]{gap:8px}}.lc-sale-price[_ngcontent-%COMP%]{font-size:24px;font-weight:600}.lc-compare-price[_ngcontent-%COMP%]{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label[_ngcontent-%COMP%]{font-size:12px;font-weight:500;color:green}.lc-button-wrapper[_ngcontent-%COMP%]{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button[_ngcontent-%COMP%]{background-color:#000;color:#fff;opacity:1;cursor:pointer;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text[_ngcontent-%COMP%], .lc-feature[_ngcontent-%COMP%]{font-size:12px;color:#666}.lc-features[_ngcontent-%COMP%]{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features[_ngcontent-%COMP%] .lc-feature[_ngcontent-%COMP%]{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features[_ngcontent-%COMP%] .lc-feature.enter[_ngcontent-%COMP%]{opacity:1;transform:translateY(0);z-index:2}.lc-features[_ngcontent-%COMP%] .lc-feature.exit[_ngcontent-%COMP%]{opacity:0;transform:translateY(-100%);z-index:1}"]})};var Ai=class{_attachedHost;attach(e){return this._attachedHost=e,e.attach(this)}detach(){let e=this._attachedHost;e!=null&&(this._attachedHost=null,e.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(e){this._attachedHost=e}},Vr=class extends Ai{component;viewContainerRef;injector;projectableNodes;constructor(e,n,r,i){super(),this.component=e,this.viewContainerRef=n,this.injector=r,this.projectableNodes=i}},Br=class extends Ai{templateRef;viewContainerRef;context;injector;constructor(e,n,r,i){super(),this.templateRef=e,this.viewContainerRef=n,this.context=r,this.injector=i}get origin(){return this.templateRef.elementRef}attach(e,n=this.context){return this.context=n,super.attach(e)}detach(){return this.context=void 0,super.detach()}},hc=class extends Ai{element;constructor(e){super(),this.element=e instanceof Vt?e.nativeElement:e}},Ur=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(e){if(e instanceof Vr)return this._attachedPortal=e,this.attachComponentPortal(e);if(e instanceof Br)return this._attachedPortal=e,this.attachTemplatePortal(e);if(this.attachDomPortal&&e instanceof hc)return this._attachedPortal=e,this.attachDomPortal(e)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(e){this._disposeFn=e}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},Qo=class extends Ur{outletElement;_appRef;_defaultInjector;constructor(e,n,r){super(),this.outletElement=e,this._appRef=n,this._defaultInjector=r}attachComponentPortal(e){let n;if(e.viewContainerRef){let r=e.injector||e.viewContainerRef.injector,i=r.get(Fs,null,{optional:!0})||void 0;n=e.viewContainerRef.createComponent(e.component,{index:e.viewContainerRef.length,injector:r,ngModuleRef:i,projectableNodes:e.projectableNodes||void 0}),this.setDisposeFn(()=>n.destroy())}else{let r=this._appRef,i=e.injector||this._defaultInjector||Ot.NULL,o=i.get(qi,r.injector);n=kl(e.component,{elementInjector:i,environmentInjector:o,projectableNodes:e.projectableNodes||void 0}),r.attachView(n.hostView),this.setDisposeFn(()=>{r.viewCount>0&&r.detachView(n.hostView),n.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(n)),this._attachedPortal=e,n}attachTemplatePortal(e){let n=e.viewContainerRef,r=n.createEmbeddedView(e.templateRef,e.context,{injector:e.injector});return r.rootNodes.forEach(i=>this.outletElement.appendChild(i)),r.detectChanges(),this.setDisposeFn(()=>{let i=n.indexOf(r);i!==-1&&n.remove(i)}),this._attachedPortal=e,r}attachDomPortal=e=>{let n=e.element;n.parentNode;let r=this.outletElement.ownerDocument.createComment("dom-portal");n.parentNode.insertBefore(r,n),this.outletElement.appendChild(n),this._attachedPortal=e,super.setDisposeFn(()=>{r.parentNode&&r.parentNode.replaceChild(n,r)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(e){return e.hostView.rootNodes[0]}};var mc=(()=>{class t extends Ur{_moduleRef=J(Fs,{optional:!0});_document=J(kt);_viewContainerRef=J(Ls);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(n){this.hasAttached()&&!n&&!this._isInitialized||(this.hasAttached()&&super.detach(),n&&super.attach(n),this._attachedPortal=n||null)}attached=new ut;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(n){n.setAttachedHost(this);let r=n.viewContainerRef!=null?n.viewContainerRef:this._viewContainerRef,i=r.createComponent(n.component,{index:r.length,injector:n.injector||r.injector,projectableNodes:n.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return r!==this._viewContainerRef&&this._getRootNode().appendChild(i.hostView.rootNodes[0]),super.setDisposeFn(()=>i.destroy()),this._attachedPortal=n,this._attachedRef=i,this.attached.emit(i),i}attachTemplatePortal(n){n.setAttachedHost(this);let r=this._viewContainerRef.createEmbeddedView(n.templateRef,n.context,{injector:n.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=n,this._attachedRef=r,this.attached.emit(r),r}attachDomPortal=n=>{let r=n.element;r.parentNode;let i=this._document.createComment("dom-portal");n.setAttachedHost(this),r.parentNode.insertBefore(i,r),this._getRootNode().appendChild(r),this._attachedPortal=n,super.setDisposeFn(()=>{i.parentNode&&i.parentNode.replaceChild(r,i)})};_getRootNode(){let n=this._viewContainerRef.element.nativeElement;return n.nodeType===n.ELEMENT_NODE?n:n.parentNode}static \u0275fac=function(r){return new(r||t)};static \u0275dir=Er({type:t,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[St]})}return t})();var Ni;function iv(){if(Ni==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Ni=!0}))}finally{Ni=Ni||!1}return Ni}function af(t){return iv()?t:!!t.capture}var ov=new ln("cdk-input-modality-detector-options"),sv={ignoreKeys:[18,17,224,91,16]},cf=650,gc={passive:!0,capture:!0},av=(()=>{class t{_platform=J(pn);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new ml(null);_options;_lastTouchMs=0;_onKeydown=n=>{this._options?.ignoreKeys?.some(r=>r===n.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=Rn(n))};_onMousedown=n=>{Date.now()-this._lastTouchMs<cf||(this._modality.next($l(n)?"keyboard":"mouse"),this._mostRecentTarget=Rn(n))};_onTouchstart=n=>{if(Gl(n)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=Rn(n)};constructor(){let n=J(Yt),r=J(kt),i=J(ov,{optional:!0});if(this._options=x(x({},sv),i),this.modalityDetected=this._modality.pipe(wl(1)),this.modalityChanged=this.modalityDetected.pipe(bl()),this._platform.isBrowser){let o=J(yr).createRenderer(null,null);this._listenerCleanups=n.runOutsideAngular(()=>[o.listen(r,"keydown",this._onKeydown,gc),o.listen(r,"mousedown",this._onMousedown,gc),o.listen(r,"touchstart",this._onTouchstart,gc)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(n=>n())}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),ts=function(t){return t[t.IMMEDIATE=0]="IMMEDIATE",t[t.EVENTUAL=1]="EVENTUAL",t}(ts||{}),cv=new ln("cdk-focus-monitor-default-options"),es=af({passive:!0,capture:!0}),lf=(()=>{class t{_ngZone=J(Yt);_platform=J(pn);_inputModalityDetector=J(av);_origin=null;_lastFocusOrigin;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=J(kt);_stopInputModalityDetector=new Lt;constructor(){let n=J(cv,{optional:!0});this._detectionMode=n?.detectionMode||ts.IMMEDIATE}_rootNodeFocusAndBlurListener=n=>{let r=Rn(n);for(let i=r;i;i=i.parentElement)n.type==="focus"?this._onFocus(n,i):this._onBlur(n,i)};monitor(n,r=!1){let i=to(n);if(!this._platform.isBrowser||i.nodeType!==1)return gl();let o=Wl(i)||this._document,s=this._elementInfo.get(i);if(s)return r&&(s.checkChildren=!0),s.subject;let l={checkChildren:r,subject:new Lt,rootNode:o};return this._elementInfo.set(i,l),this._registerGlobalListeners(l),l.subject}stopMonitoring(n){let r=to(n),i=this._elementInfo.get(r);i&&(i.subject.complete(),this._setClasses(r),this._elementInfo.delete(r),this._removeGlobalListeners(i))}focusVia(n,r,i){let o=to(n),s=this._document.activeElement;o===s?this._getClosestElementsInfo(o).forEach(([l,u])=>this._originChanged(l,r,u)):(this._setOrigin(r),typeof o.focus=="function"&&o.focus(i))}ngOnDestroy(){this._elementInfo.forEach((n,r)=>this.stopMonitoring(r))}_getWindow(){return this._document.defaultView||window}_getFocusOrigin(n){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(n)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:n&&this._isLastInteractionFromInputLabel(n)?"mouse":"program"}_shouldBeAttributedToTouch(n){return this._detectionMode===ts.EVENTUAL||!!n?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(n,r){n.classList.toggle("cdk-focused",!!r),n.classList.toggle("cdk-touch-focused",r==="touch"),n.classList.toggle("cdk-keyboard-focused",r==="keyboard"),n.classList.toggle("cdk-mouse-focused",r==="mouse"),n.classList.toggle("cdk-program-focused",r==="program")}_setOrigin(n,r=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=n,this._originFromTouchInteraction=n==="touch"&&r,this._detectionMode===ts.IMMEDIATE){clearTimeout(this._originTimeoutId);let i=this._originFromTouchInteraction?cf:1;this._originTimeoutId=setTimeout(()=>this._origin=null,i)}})}_onFocus(n,r){let i=this._elementInfo.get(r),o=Rn(n);!i||!i.checkChildren&&r!==o||this._originChanged(r,this._getFocusOrigin(o),i)}_onBlur(n,r){let i=this._elementInfo.get(r);!i||i.checkChildren&&n.relatedTarget instanceof Node&&r.contains(n.relatedTarget)||(this._setClasses(r),this._emitOrigin(i,null))}_emitOrigin(n,r){n.subject.observers.length&&this._ngZone.run(()=>n.subject.next(r))}_registerGlobalListeners(n){if(!this._platform.isBrowser)return;let r=n.rootNode,i=this._rootNodeFocusListenerCount.get(r)||0;i||this._ngZone.runOutsideAngular(()=>{r.addEventListener("focus",this._rootNodeFocusAndBlurListener,es),r.addEventListener("blur",this._rootNodeFocusAndBlurListener,es)}),this._rootNodeFocusListenerCount.set(r,i+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(zi(this._stopInputModalityDetector)).subscribe(o=>{this._setOrigin(o,!0)}))}_removeGlobalListeners(n){let r=n.rootNode;if(this._rootNodeFocusListenerCount.has(r)){let i=this._rootNodeFocusListenerCount.get(r);i>1?this._rootNodeFocusListenerCount.set(r,i-1):(r.removeEventListener("focus",this._rootNodeFocusAndBlurListener,es),r.removeEventListener("blur",this._rootNodeFocusAndBlurListener,es),this._rootNodeFocusListenerCount.delete(r))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(n,r,i){this._setClasses(n,r),this._emitOrigin(i,r),this._lastFocusOrigin=r}_getClosestElementsInfo(n){let r=[];return this._elementInfo.forEach((i,o)=>{(o===n||i.checkChildren&&o.contains(n))&&r.push([o,i])}),r}_isLastInteractionFromInputLabel(n){let{_mostRecentTarget:r,mostRecentModality:i}=this._inputModalityDetector;if(i!=="mouse"||!r||r===n||n.nodeName!=="INPUT"&&n.nodeName!=="TEXTAREA"||n.disabled)return!1;let o=n.labels;if(o){for(let s=0;s<o.length;s++)if(o[s].contains(r))return!0}return!1}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var uf=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275cmp=Ne({type:t,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(r,i){},styles:[`.cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}
30
- `],encapsulation:2,changeDetection:0})}return t})();var vc=(()=>{class t{_platform=J(pn);constructor(){}isDisabled(n){return n.hasAttribute("disabled")}isVisible(n){return uv(n)&&getComputedStyle(n).visibility==="visible"}isTabbable(n){if(!this._platform.isBrowser)return!1;let r=lv(vv(n));if(r&&(df(r)===-1||!this.isVisible(r)))return!1;let i=n.nodeName.toLowerCase(),o=df(n);return n.hasAttribute("contenteditable")?o!==-1:i==="iframe"||i==="object"||this._platform.WEBKIT&&this._platform.IOS&&!gv(n)?!1:i==="audio"?n.hasAttribute("controls")?o!==-1:!1:i==="video"?o===-1?!1:o!==null?!0:this._platform.FIREFOX||n.hasAttribute("controls"):n.tabIndex>=0}isFocusable(n,r){return _v(n)&&!this.isDisabled(n)&&(r?.ignoreVisibility||this.isVisible(n))}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function lv(t){try{return t.frameElement}catch{return null}}function uv(t){return!!(t.offsetWidth||t.offsetHeight||typeof t.getClientRects=="function"&&t.getClientRects().length)}function dv(t){let e=t.nodeName.toLowerCase();return e==="input"||e==="select"||e==="button"||e==="textarea"}function fv(t){return hv(t)&&t.type=="hidden"}function pv(t){return mv(t)&&t.hasAttribute("href")}function hv(t){return t.nodeName.toLowerCase()=="input"}function mv(t){return t.nodeName.toLowerCase()=="a"}function ff(t){if(!t.hasAttribute("tabindex")||t.tabIndex===void 0)return!1;let e=t.getAttribute("tabindex");return!!(e&&!isNaN(parseInt(e,10)))}function df(t){if(!ff(t))return null;let e=parseInt(t.getAttribute("tabindex")||"",10);return isNaN(e)?-1:e}function gv(t){let e=t.nodeName.toLowerCase(),n=e==="input"&&t.type;return n==="text"||n==="password"||e==="select"||e==="textarea"}function _v(t){return fv(t)?!1:dv(t)||pv(t)||t.hasAttribute("contenteditable")||ff(t)}function vv(t){return t.ownerDocument&&t.ownerDocument.defaultView||window}var _c=class{_element;_checker;_ngZone;_document;_injector;_startAnchor;_endAnchor;_hasAttached=!1;startAnchorListener=()=>this.focusLastTabbableElement();endAnchorListener=()=>this.focusFirstTabbableElement();get enabled(){return this._enabled}set enabled(e){this._enabled=e,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_enabled=!0;constructor(e,n,r,i,o=!1,s){this._element=e,this._checker=n,this._ngZone=r,this._document=i,this._injector=s,o||this.attachAnchors()}destroy(){let e=this._startAnchor,n=this._endAnchor;e&&(e.removeEventListener("focus",this.startAnchorListener),e.remove()),n&&(n.removeEventListener("focus",this.endAnchorListener),n.remove()),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return this._hasAttached?!0:(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(e){return new Promise(n=>{this._executeOnStable(()=>n(this.focusInitialElement(e)))})}focusFirstTabbableElementWhenReady(e){return new Promise(n=>{this._executeOnStable(()=>n(this.focusFirstTabbableElement(e)))})}focusLastTabbableElementWhenReady(e){return new Promise(n=>{this._executeOnStable(()=>n(this.focusLastTabbableElement(e)))})}_getRegionBoundary(e){let n=this._element.querySelectorAll(`[cdk-focus-region-${e}], [cdkFocusRegion${e}], [cdk-focus-${e}]`);return e=="start"?n.length?n[0]:this._getFirstTabbableElement(this._element):n.length?n[n.length-1]:this._getLastTabbableElement(this._element)}focusInitialElement(e){let n=this._element.querySelector("[cdk-focus-initial], [cdkFocusInitial]");if(n){if(!this._checker.isFocusable(n)){let r=this._getFirstTabbableElement(n);return r?.focus(e),!!r}return n.focus(e),!0}return this.focusFirstTabbableElement(e)}focusFirstTabbableElement(e){let n=this._getRegionBoundary("start");return n&&n.focus(e),!!n}focusLastTabbableElement(e){let n=this._getRegionBoundary("end");return n&&n.focus(e),!!n}hasAttached(){return this._hasAttached}_getFirstTabbableElement(e){if(this._checker.isFocusable(e)&&this._checker.isTabbable(e))return e;let n=e.children;for(let r=0;r<n.length;r++){let i=n[r].nodeType===this._document.ELEMENT_NODE?this._getFirstTabbableElement(n[r]):null;if(i)return i}return null}_getLastTabbableElement(e){if(this._checker.isFocusable(e)&&this._checker.isTabbable(e))return e;let n=e.children;for(let r=n.length-1;r>=0;r--){let i=n[r].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(n[r]):null;if(i)return i}return null}_createAnchor(){let e=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,e),e.classList.add("cdk-visually-hidden"),e.classList.add("cdk-focus-trap-anchor"),e.setAttribute("aria-hidden","true"),e}_toggleAnchorTabIndex(e,n){e?n.setAttribute("tabindex","0"):n.removeAttribute("tabindex")}toggleAnchors(e){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(e,this._startAnchor),this._toggleAnchorTabIndex(e,this._endAnchor))}_executeOnStable(e){this._injector?$n(e,{injector:this._injector}):setTimeout(e)}},pf=(()=>{class t{_checker=J(vc);_ngZone=J(Yt);_document=J(kt);_injector=J(Ot);constructor(){J(li).load(uf)}create(n,r=!1){return new _c(n,this._checker,this._ngZone,this._document,r,this._injector)}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function hf(t,...e){return e.length?e.some(n=>t[n]):t.altKey||t.shiftKey||t.ctrlKey||t.metaKey}function yc(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}function Un(t){return t==null?"":typeof t=="string"?t:`${t}px`}var mf=zl();function vf(t){return new Ec(t.get(ql),t.get(kt))}var Ec=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(e,n){this._viewportRuler=e,this._document=n}attach(){}enable(){if(this._canBeEnabled()){let e=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=e.style.left||"",this._previousHTMLStyles.top=e.style.top||"",e.style.left=Un(-this._previousScrollPosition.left),e.style.top=Un(-this._previousScrollPosition.top),e.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let e=this._document.documentElement,n=this._document.body,r=e.style,i=n.style,o=r.scrollBehavior||"",s=i.scrollBehavior||"";this._isEnabled=!1,r.left=this._previousHTMLStyles.left,r.top=this._previousHTMLStyles.top,e.classList.remove("cdk-global-scrollblock"),mf&&(r.scrollBehavior=i.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),mf&&(r.scrollBehavior=o,i.scrollBehavior=s)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let n=this._document.documentElement,r=this._viewportRuler.getViewportSize();return n.scrollHeight>r.height||n.scrollWidth>r.width}};var bc=class{enable(){}disable(){}attach(){}};var Ri=class{positionStrategy;scrollStrategy=new bc;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(e){if(e){let n=Object.keys(e);for(let r of n)e[r]!==void 0&&(this[r]=e[r])}}};var yf=(()=>{class t{_attachedOverlays=[];_document=J(kt);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(n){this.remove(n),this._attachedOverlays.push(n)}remove(n){let r=this._attachedOverlays.indexOf(n);r>-1&&this._attachedOverlays.splice(r,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),Ev=(()=>{class t extends yf{_ngZone=J(Yt);_renderer=J(yr).createRenderer(null,null);_cleanupKeydown;add(n){super.add(n),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=n=>{let r=this._attachedOverlays;for(let i=r.length-1;i>-1;i--)if(r[i]._keydownEvents.observers.length>0){this._ngZone.run(()=>r[i]._keydownEvents.next(n));break}};static \u0275fac=(()=>{let n;return function(i){return(n||(n=ri(t)))(i||t)}})();static \u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),bv=(()=>{class t extends yf{_platform=J(pn);_ngZone=J(Yt);_renderer=J(yr).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(n){if(super.add(n),!this._isAttached){let r=this._document.body,i={capture:!0},o=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[o.listen(r,"pointerdown",this._pointerDownListener,i),o.listen(r,"click",this._clickListener,i),o.listen(r,"auxclick",this._clickListener,i),o.listen(r,"contextmenu",this._clickListener,i)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=r.style.cursor,r.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(n=>n()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=n=>{this._pointerDownEventTarget=Rn(n)};_clickListener=n=>{let r=Rn(n),i=n.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:r;this._pointerDownEventTarget=null;let o=this._attachedOverlays.slice();for(let s=o.length-1;s>-1;s--){let l=o[s];if(l._outsidePointerEvents.observers.length<1||!l.hasAttached())continue;if(gf(l.overlayElement,r)||gf(l.overlayElement,i))break;let u=l._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>u.next(n)):u.next(n)}};static \u0275fac=(()=>{let n;return function(i){return(n||(n=ri(t)))(i||t)}})();static \u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function gf(t,e){let n=typeof ShadowRoot<"u"&&ShadowRoot,r=e;for(;r;){if(r===t)return!0;r=n&&r instanceof ShadowRoot?r.host:r.parentNode}return!1}var Ef=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275cmp=Ne({type:t,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(r,i){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
31
- `],encapsulation:2,changeDetection:0})}return t})(),Sc=(()=>{class t{_platform=J(pn);_containerElement;_document=J(kt);_styleLoader=J(li);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let n="cdk-overlay-container";if(this._platform.isBrowser||yc()){let i=this._document.querySelectorAll(`.${n}[platform="server"], .${n}[platform="test"]`);for(let o=0;o<i.length;o++)i[o].remove()}let r=this._document.createElement("div");r.classList.add(n),yc()?r.setAttribute("platform","test"):this._platform.isBrowser||r.setAttribute("platform","server"),this._document.body.appendChild(r),this._containerElement=r}_loadStyles(){this._styleLoader.load(Ef)}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})(),wc=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(e,n,r,i){this._renderer=n,this._ngZone=r,this.element=e.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=n.listen(this.element,"click",i)}detach(){this._ngZone.runOutsideAngular(()=>{let e=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(e,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),e.style.pointerEvents="none",e.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Mi=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new Lt;_attachments=new Lt;_detachments=new Lt;_positionStrategy;_scrollStrategy;_locationChanges=hl.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new Lt;_outsidePointerEvents=new Lt;_afterNextRenderRef;constructor(e,n,r,i,o,s,l,u,d,_=!1,h,E){this._portalOutlet=e,this._host=n,this._pane=r,this._config=i,this._ngZone=o,this._keyboardDispatcher=s,this._document=l,this._location=u,this._outsideClickDispatcher=d,this._animationsDisabled=_,this._injector=h,this._renderer=E,i.scrollStrategy&&(this._scrollStrategy=i.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=i.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(e){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let n=this._portalOutlet.attach(e);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=$n(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof n?.onDestroy=="function"&&n.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),n}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let e=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),e}dispose(){let e=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,e&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(e){e!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=e,this.hasAttached()&&(e.attach(this),this.updatePosition()))}updateSize(e){this._config=x(x({},this._config),e),this._updateElementSize()}setDirection(e){this._config=Ee(x({},this._config),{direction:e}),this._updateElementDirection()}addPanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!0)}removePanelClass(e){this._pane&&this._toggleClasses(this._pane,e,!1)}getDirection(){let e=this._config.direction;return e?typeof e=="string"?e:e.value:"ltr"}updateScrollStrategy(e){e!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=e,this.hasAttached()&&(e.attach(this),e.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let e=this._pane.style;e.width=Un(this._config.width),e.height=Un(this._config.height),e.minWidth=Un(this._config.minWidth),e.minHeight=Un(this._config.minHeight),e.maxWidth=Un(this._config.maxWidth),e.maxHeight=Un(this._config.maxHeight)}_togglePointerEvents(e){this._pane.style.pointerEvents=e?"":"none"}_attachBackdrop(){let e="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new wc(this._document,this._renderer,this._ngZone,n=>{this._backdropClick.next(n)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(e))}):this._backdropRef.element.classList.add(e)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(e,n,r){let i=Yl(n||[]).filter(o=>!!o);i.length&&(r?e.classList.add(...i):e.classList.remove(...i))}_detachContentWhenEmpty(){let e=!1;try{this._detachContentAfterRenderRef=$n(()=>{e=!0,this._detachContent()},{injector:this._injector})}catch(n){if(e)throw n;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let e=this._scrollStrategy;e?.disable(),e?.detach?.()}};var _f="cdk-global-overlay-wrapper";function bf(t){return new Cc}var Cc=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(e){let n=e.getConfig();this._overlayRef=e,this._width&&!n.width&&e.updateSize({width:this._width}),this._height&&!n.height&&e.updateSize({height:this._height}),e.hostElement.classList.add(_f),this._isDisposed=!1}top(e=""){return this._bottomOffset="",this._topOffset=e,this._alignItems="flex-start",this}left(e=""){return this._xOffset=e,this._xPosition="left",this}bottom(e=""){return this._topOffset="",this._bottomOffset=e,this._alignItems="flex-end",this}right(e=""){return this._xOffset=e,this._xPosition="right",this}start(e=""){return this._xOffset=e,this._xPosition="start",this}end(e=""){return this._xOffset=e,this._xPosition="end",this}width(e=""){return this._overlayRef?this._overlayRef.updateSize({width:e}):this._width=e,this}height(e=""){return this._overlayRef?this._overlayRef.updateSize({height:e}):this._height=e,this}centerHorizontally(e=""){return this.left(e),this._xPosition="center",this}centerVertically(e=""){return this.top(e),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let e=this._overlayRef.overlayElement.style,n=this._overlayRef.hostElement.style,r=this._overlayRef.getConfig(),{width:i,height:o,maxWidth:s,maxHeight:l}=r,u=(i==="100%"||i==="100vw")&&(!s||s==="100%"||s==="100vw"),d=(o==="100%"||o==="100vh")&&(!l||l==="100%"||l==="100vh"),_=this._xPosition,h=this._xOffset,E=this._overlayRef.getConfig().direction==="rtl",w="",N="",B="";u?B="flex-start":_==="center"?(B="center",E?N=h:w=h):E?_==="left"||_==="end"?(B="flex-end",w=h):(_==="right"||_==="start")&&(B="flex-start",N=h):_==="left"||_==="start"?(B="flex-start",w=h):(_==="right"||_==="end")&&(B="flex-end",N=h),e.position=this._cssPosition,e.marginLeft=u?"0":w,e.marginTop=d?"0":this._topOffset,e.marginBottom=this._bottomOffset,e.marginRight=u?"0":N,n.justifyContent=B,n.alignItems=d?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let e=this._overlayRef.overlayElement.style,n=this._overlayRef.hostElement,r=n.style;n.classList.remove(_f),r.justifyContent=r.alignItems=e.marginTop=e.marginBottom=e.marginLeft=e.marginRight=e.position="",this._overlayRef=null,this._isDisposed=!0}};function wf(t,e){t.get(li).load(Ef);let n=t.get(Sc),r=t.get(kt),i=t.get(no),o=t.get(oi),s=t.get(ui),l=r.createElement("div"),u=r.createElement("div");u.id=i.getId("cdk-overlay-"),u.classList.add("cdk-overlay-pane"),l.appendChild(u),n.getContainerElement().appendChild(l);let d=new Qo(u,o,t),_=new Ri(e),h=t.get(ii,null,{optional:!0})||t.get(yr).createRenderer(null,null);return _.direction=_.direction||s.value,new Mi(d,l,u,_,t.get(Yt),t.get(Ev),r,t.get(Vl),t.get(bv),e?.disableAnimations??t.get(Il,null,{optional:!0})==="NoopAnimations",t.get(qi),h)}function wv(t,e){}var Hr=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var Cv=(()=>{class t extends Ur{_elementRef=J(Vt);_focusTrapFactory=J(pf);_config;_interactivityChecker=J(vc);_ngZone=J(Yt);_focusMonitor=J(lf);_renderer=J(ii);_changeDetectorRef=J(rr);_injector=J(Ot);_platform=J(pn);_document=J(kt);_portalOutlet;_focusTrapped=new Lt;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=J(Hr,{optional:!0})||new Hr,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(n){this._ariaLabelledByQueue.push(n),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(n){let r=this._ariaLabelledByQueue.indexOf(n);r>-1&&(this._ariaLabelledByQueue.splice(r,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(n){this._portalOutlet.hasAttached();let r=this._portalOutlet.attachComponentPortal(n);return this._contentAttached(),r}attachTemplatePortal(n){this._portalOutlet.hasAttached();let r=this._portalOutlet.attachTemplatePortal(n);return this._contentAttached(),r}attachDomPortal=n=>{this._portalOutlet.hasAttached();let r=this._portalOutlet.attachDomPortal(n);return this._contentAttached(),r};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(n,r){this._interactivityChecker.isFocusable(n)||(n.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let i=()=>{o(),s(),n.removeAttribute("tabindex")},o=this._renderer.listen(n,"blur",i),s=this._renderer.listen(n,"mousedown",i)})),n.focus(r)}_focusByCssSelector(n,r){let i=this._elementRef.nativeElement.querySelector(n);i&&this._forceFocus(i,r)}_trapFocus(n){this._isDestroyed||$n(()=>{let r=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||r.focus(n);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(n)||this._focusDialogContainer(n);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',n);break;default:this._focusByCssSelector(this._config.autoFocus,n);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let n=this._config.restoreFocus,r=null;if(typeof n=="string"?r=this._document.querySelector(n):typeof n=="boolean"?r=n?this._elementFocusedBeforeDialogWasOpened:null:n&&(r=n),this._config.restoreFocus&&r&&typeof r.focus=="function"){let i=eo(),o=this._elementRef.nativeElement;(!i||i===this._document.body||i===o||o.contains(i))&&(this._focusMonitor?(this._focusMonitor.focusVia(r,this._closeInteractionType),this._closeInteractionType=null):r.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(n){this._elementRef.nativeElement.focus?.(n)}_containsFocus(){let n=this._elementRef.nativeElement,r=eo();return n===r||n.contains(r)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=eo()))}static \u0275fac=function(r){return new(r||t)};static \u0275cmp=Ne({type:t,selectors:[["cdk-dialog-container"]],viewQuery:function(r,i){if(r&1&&xn(mc,7),r&2){let o;On(o=Dn())&&(i._portalOutlet=o.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(r,i){r&2&&Qt("id",i._config.id||null)("role",i._config.role)("aria-modal",i._config.ariaModal)("aria-labelledby",i._config.ariaLabel?null:i._ariaLabelledByQueue[0])("aria-label",i._config.ariaLabel)("aria-describedby",i._config.ariaDescribedBy||null)},features:[St],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(r,i){r&1&&br(0,wv,0,0,"ng-template",0)},dependencies:[mc],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
32
- `],encapsulation:2})}return t})(),fr=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new Lt;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(e,n){this.overlayRef=e,this.config=n,this.disableClose=n.disableClose,this.backdropClick=e.backdropClick(),this.keydownEvents=e.keydownEvents(),this.outsidePointerEvents=e.outsidePointerEvents(),this.id=n.id,this.keydownEvents.subscribe(r=>{r.keyCode===27&&!this.disableClose&&!hf(r)&&(r.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=e.detachments().subscribe(()=>{n.closeOnOverlayDetachments!==!1&&this.close()})}close(e,n){if(this._canClose(e)){let r=this.closed;this.containerInstance._closeInteractionType=n?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),r.next(e),r.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(e="",n=""){return this.overlayRef.updateSize({width:e,height:n}),this}addPanelClass(e){return this.overlayRef.addPanelClass(e),this}removePanelClass(e){return this.overlayRef.removePanelClass(e),this}_canClose(e){let n=this.config;return!!this.containerInstance&&(!n.closePredicate||n.closePredicate(e,n,this.componentInstance))}},Sv=new ln("DialogScrollStrategy",{providedIn:"root",factory:()=>{let t=J(Ot);return()=>vf(t)}}),Ic=new ln("DialogData"),Tv=new ln("DefaultDialogConfig");function Iv(t){let e=Ct(t),n=new ut;return{valueSignal:e,get value(){return e()},change:n,ngOnDestroy(){n.complete()}}}var Cf=(()=>{class t{_injector=J(Ot);_defaultOptions=J(Tv,{optional:!0});_parentDialog=J(t,{optional:!0,skipSelf:!0});_overlayContainer=J(Sc);_idGenerator=J(no);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new Lt;_afterOpenedAtThisLevel=new Lt;_ariaHiddenElements=new Map;_scrollStrategy=J(Sv);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=_l(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(Cl(void 0)));constructor(){}open(n,r){let i=this._defaultOptions||new Hr;r=x(x({},i),r),r.id=r.id||this._idGenerator.getId("cdk-dialog-"),r.id&&this.getDialogById(r.id);let o=this._getOverlayConfig(r),s=wf(this._injector,o),l=new fr(s,r),u=this._attachContainer(s,l,r);if(l.containerInstance=u,!this.openDialogs.length){let d=this._overlayContainer.getContainerElement();u._focusTrapped?u._focusTrapped.pipe(El(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(d)}):this._hideNonDialogContentFromAssistiveTechnology(d)}return this._attachDialogContent(n,l,u,r),this.openDialogs.push(l),l.closed.subscribe(()=>this._removeOpenDialog(l,!0)),this.afterOpened.next(l),l}closeAll(){Tc(this.openDialogs,n=>n.close())}getDialogById(n){return this.openDialogs.find(r=>r.id===n)}ngOnDestroy(){Tc(this._openDialogsAtThisLevel,n=>{n.config.closeOnDestroy===!1&&this._removeOpenDialog(n,!1)}),Tc(this._openDialogsAtThisLevel,n=>n.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(n){let r=new Ri({positionStrategy:n.positionStrategy||bf().centerHorizontally().centerVertically(),scrollStrategy:n.scrollStrategy||this._scrollStrategy(),panelClass:n.panelClass,hasBackdrop:n.hasBackdrop,direction:n.direction,minWidth:n.minWidth,minHeight:n.minHeight,maxWidth:n.maxWidth,maxHeight:n.maxHeight,width:n.width,height:n.height,disposeOnNavigation:n.closeOnNavigation,disableAnimations:n.disableAnimations});return n.backdropClass&&(r.backdropClass=n.backdropClass),r}_attachContainer(n,r,i){let o=i.injector||i.viewContainerRef?.injector,s=[{provide:Hr,useValue:i},{provide:fr,useValue:r},{provide:Mi,useValue:n}],l;i.container?typeof i.container=="function"?l=i.container:(l=i.container.type,s.push(...i.container.providers(i))):l=Cv;let u=new Vr(l,i.viewContainerRef,Ot.create({parent:o||this._injector,providers:s}));return n.attach(u).instance}_attachDialogContent(n,r,i,o){if(n instanceof Ki){let s=this._createInjector(o,r,i,void 0),l={$implicit:o.data,dialogRef:r};o.templateContext&&(l=x(x({},l),typeof o.templateContext=="function"?o.templateContext():o.templateContext)),i.attachTemplatePortal(new Br(n,null,l,s))}else{let s=this._createInjector(o,r,i,this._injector),l=i.attachComponentPortal(new Vr(n,o.viewContainerRef,s));r.componentRef=l,r.componentInstance=l.instance}}_createInjector(n,r,i,o){let s=n.injector||n.viewContainerRef?.injector,l=[{provide:Ic,useValue:n.data},{provide:fr,useValue:r}];return n.providers&&(typeof n.providers=="function"?l.push(...n.providers(r,n,i)):l.push(...n.providers)),n.direction&&(!s||!s.get(ui,null,{optional:!0}))&&l.push({provide:ui,useValue:Iv(n.direction)}),Ot.create({parent:s||o,providers:l})}_removeOpenDialog(n,r){let i=this.openDialogs.indexOf(n);i>-1&&(this.openDialogs.splice(i,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((o,s)=>{o?s.setAttribute("aria-hidden",o):s.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),r&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(n){if(n.parentElement){let r=n.parentElement.children;for(let i=r.length-1;i>-1;i--){let o=r[i];o!==n&&o.nodeName!=="SCRIPT"&&o.nodeName!=="STYLE"&&!o.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(o,o.getAttribute("aria-hidden")),o.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let n=this._parentDialog;return n?n._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(r){return new(r||t)};static \u0275prov=Ft({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();function Tc(t,e){let n=t.length;for(;n--;)e(t[n])}var Of,We,Df,Nc,pr,Sf,Af,Nf,Rf,Rc,Oc,Dc,xv,Ac={},Mf=[],Ov=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,is=Array.isArray;function Hn(t,e){for(var n in e)t[n]=e[n];return t}function Mc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function xc(t,e,n,r,i){var o={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Df,__i:-1,__u:0};return i==null&&We.vnode!=null&&We.vnode(o),o}function Pc(t){return t.children}function jr(t,e){this.props=t,this.context=e}function $r(t,e){if(e==null)return t.__?$r(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?$r(t):null}function Pf(t){var e,n;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null){t.__e=t.__c.base=n.__e;break}return Pf(t)}}function Tf(t){(!t.__d&&(t.__d=!0)&&pr.push(t)&&!rs.__r++||Sf!=We.debounceRendering)&&((Sf=We.debounceRendering)||Af)(rs)}function rs(){for(var t,e,n,r,i,o,s,l=1;pr.length;)pr.length>l&&pr.sort(Nf),t=pr.shift(),l=pr.length,t.__d&&(n=void 0,i=(r=(e=t).__v).__e,o=[],s=[],e.__P&&((n=Hn({},r)).__v=r.__v+1,We.vnode&&We.vnode(n),kf(e.__P,n,r,e.__n,e.__P.namespaceURI,32&r.__u?[i]:null,o,i??$r(r),!!(32&r.__u),s),n.__v=r.__v,n.__.__k[n.__i]=n,Nv(o,n,s),n.__e!=i&&Pf(n)));rs.__r=0}function Lf(t,e,n,r,i,o,s,l,u,d,_){var h,E,w,N,B,P,z=r&&r.__k||Mf,G=e.length;for(u=Dv(n,e,z,u,G),h=0;h<G;h++)(w=n.__k[h])!=null&&(E=w.__i==-1?Ac:z[w.__i]||Ac,w.__i=h,P=kf(t,w,E,i,o,s,l,u,d,_),N=w.__e,w.ref&&E.ref!=w.ref&&(E.ref&&Lc(E.ref,null,w),_.push(w.ref,w.__c||N,w)),B==null&&N!=null&&(B=N),4&w.__u||E.__k===w.__k?u=Ff(w,u,t):typeof w.type=="function"&&P!==void 0?u=P:N&&(u=N.nextSibling),w.__u&=-7);return n.__e=B,u}function Dv(t,e,n,r,i){var o,s,l,u,d,_=n.length,h=_,E=0;for(t.__k=new Array(i),o=0;o<i;o++)(s=e[o])!=null&&typeof s!="boolean"&&typeof s!="function"?(u=o+E,(s=t.__k[o]=typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?xc(null,s,null,null,null):is(s)?xc(Pc,{children:s},null,null,null):s.constructor==null&&s.__b>0?xc(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=t,s.__b=t.__b+1,l=null,(d=s.__i=Av(s,n,u,h))!=-1&&(h--,(l=n[d])&&(l.__u|=2)),l==null||l.__v==null?(d==-1&&(i>_?E--:i<_&&E++),typeof s.type!="function"&&(s.__u|=4)):d!=u&&(d==u-1?E--:d==u+1?E++:(d>u?E--:E++,s.__u|=4))):t.__k[o]=null;if(h)for(o=0;o<_;o++)(l=n[o])!=null&&(2&l.__u)==0&&(l.__e==r&&(r=$r(l)),Bf(l,l));return r}function Ff(t,e,n){var r,i;if(typeof t.type=="function"){for(r=t.__k,i=0;r&&i<r.length;i++)r[i]&&(r[i].__=t,e=Ff(r[i],e,n));return e}t.__e!=e&&(e&&t.type&&!n.contains(e)&&(e=$r(t)),n.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function Av(t,e,n,r){var i,o,s=t.key,l=t.type,u=e[n];if(u===null&&t.key==null||u&&s==u.key&&l==u.type&&(2&u.__u)==0)return n;if(r>(u!=null&&(2&u.__u)==0?1:0))for(i=n-1,o=n+1;i>=0||o<e.length;){if(i>=0){if((u=e[i])&&(2&u.__u)==0&&s==u.key&&l==u.type)return i;i--}if(o<e.length){if((u=e[o])&&(2&u.__u)==0&&s==u.key&&l==u.type)return o;o++}}return-1}function If(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||Ov.test(e)?n:n+"px"}function ns(t,e,n,r,i){var o,s;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||If(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||If(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")o=e!=(e=e.replace(Rf,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+o]=n,n?r?n.u=r.u:(n.u=Rc,t.addEventListener(e,o?Dc:Oc,o)):t.removeEventListener(e,o?Dc:Oc,o);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function xf(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e.t==null)e.t=Rc++;else if(e.t<n.u)return;return n(We.event?We.event(e):e)}}}function kf(t,e,n,r,i,o,s,l,u,d){var _,h,E,w,N,B,P,z,G,te,q,Me,H,ve,fe,be,Ve,Pe=e.type;if(e.constructor!=null)return null;128&n.__u&&(u=!!(32&n.__u),o=[l=e.__e=n.__e]),(_=We.__b)&&_(e);e:if(typeof Pe=="function")try{if(z=e.props,G="prototype"in Pe&&Pe.prototype.render,te=(_=Pe.contextType)&&r[_.__c],q=_?te?te.props.value:_.__:r,n.__c?P=(h=e.__c=n.__c).__=h.__E:(G?e.__c=h=new Pe(z,q):(e.__c=h=new jr(z,q),h.constructor=Pe,h.render=Mv),te&&te.sub(h),h.props=z,h.state||(h.state={}),h.context=q,h.__n=r,E=h.__d=!0,h.__h=[],h._sb=[]),G&&h.__s==null&&(h.__s=h.state),G&&Pe.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Hn({},h.__s)),Hn(h.__s,Pe.getDerivedStateFromProps(z,h.__s))),w=h.props,N=h.state,h.__v=e,E)G&&Pe.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),G&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(G&&Pe.getDerivedStateFromProps==null&&z!==w&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(z,q),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(z,h.__s,q)===!1||e.__v==n.__v){for(e.__v!=n.__v&&(h.props=z,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(Le){Le&&(Le.__=e)}),Me=0;Me<h._sb.length;Me++)h.__h.push(h._sb[Me]);h._sb=[],h.__h.length&&s.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(z,h.__s,q),G&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(w,N,B)})}if(h.context=q,h.props=z,h.__P=t,h.__e=!1,H=We.__r,ve=0,G){for(h.state=h.__s,h.__d=!1,H&&H(e),_=h.render(h.props,h.state,h.context),fe=0;fe<h._sb.length;fe++)h.__h.push(h._sb[fe]);h._sb=[]}else do h.__d=!1,H&&H(e),_=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++ve<25);h.state=h.__s,h.getChildContext!=null&&(r=Hn(Hn({},r),h.getChildContext())),G&&!E&&h.getSnapshotBeforeUpdate!=null&&(B=h.getSnapshotBeforeUpdate(w,N)),be=_,_!=null&&_.type===Pc&&_.key==null&&(be=Vf(_.props.children)),l=Lf(t,is(be)?be:[be],e,n,r,i,o,s,l,u,d),h.base=e.__e,e.__u&=-161,h.__h.length&&s.push(h),P&&(h.__E=h.__=null)}catch(Le){if(e.__v=null,u||o!=null)if(Le.then){for(e.__u|=u?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;o[o.indexOf(l)]=null,e.__e=l}else for(Ve=o.length;Ve--;)Mc(o[Ve]);else e.__e=n.__e,e.__k=n.__k;We.__e(Le,e,n)}else o==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):l=e.__e=Rv(n.__e,e,n,r,i,o,s,u,d);return(_=We.diffed)&&_(e),128&e.__u?void 0:l}function Nv(t,e,n){for(var r=0;r<n.length;r++)Lc(n[r],n[++r],n[++r]);We.__c&&We.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(o){o.call(i)})}catch(o){We.__e(o,i.__v)}})}function Vf(t){return typeof t!="object"||t==null||t.__b&&t.__b>0?t:is(t)?t.map(Vf):Hn({},t)}function Rv(t,e,n,r,i,o,s,l,u){var d,_,h,E,w,N,B,P=n.props,z=e.props,G=e.type;if(G=="svg"?i="http://www.w3.org/2000/svg":G=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((w=o[d])&&"setAttribute"in w==!!G&&(G?w.localName==G:w.nodeType==3)){t=w,o[d]=null;break}}if(t==null){if(G==null)return document.createTextNode(z);t=document.createElementNS(i,G,z.is&&z),l&&(We.__m&&We.__m(e,o),l=!1),o=null}if(G==null)P===z||l&&t.data==z||(t.data=z);else{if(o=o&&Of.call(t.childNodes),P=n.props||Ac,!l&&o!=null)for(P={},d=0;d<t.attributes.length;d++)P[(w=t.attributes[d]).name]=w.value;for(d in P)if(w=P[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=w;else if(!(d in z)){if(d=="value"&&"defaultValue"in z||d=="checked"&&"defaultChecked"in z)continue;ns(t,d,null,w,i)}}for(d in z)w=z[d],d=="children"?E=w:d=="dangerouslySetInnerHTML"?_=w:d=="value"?N=w:d=="checked"?B=w:l&&typeof w!="function"||P[d]===w||ns(t,d,w,P[d],i);if(_)l||h&&(_.__html==h.__html||_.__html==t.innerHTML)||(t.innerHTML=_.__html),e.__k=[];else if(h&&(t.innerHTML=""),Lf(e.type=="template"?t.content:t,is(E)?E:[E],e,n,r,G=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,s,o?o[0]:n.__k&&$r(n,0),l,u),o!=null)for(d=o.length;d--;)Mc(o[d]);l||(d="value",G=="progress"&&N==null?t.removeAttribute("value"):N!=null&&(N!==t[d]||G=="progress"&&!N||G=="option"&&N!=P[d])&&ns(t,d,N,P[d],i),d="checked",B!=null&&B!=t[d]&&ns(t,d,B,P[d],i))}return t}function Lc(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){We.__e(i,n)}}function Bf(t,e,n){var r,i;if(We.unmount&&We.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||Lc(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(o){We.__e(o,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&Bf(r[i],e,n||typeof t.type!="function");n||Mc(t.__e),t.__c=t.__=t.__e=void 0}function Mv(t,e,n){return this.constructor(t,n)}Of=Mf.slice,We={__e:function(t,e,n,r){for(var i,o,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),s=i.__d),s)return i.__E=i}catch(l){t=l}throw t}},Df=0,Nc=function(t){return t!=null&&t.constructor==null},jr.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Hn({},this.state),typeof t=="function"&&(t=t(Hn({},n),this.props)),t&&Hn(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Tf(this))},jr.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Tf(this))},jr.prototype.render=Pc,pr=[],Af=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Nf=function(t,e){return t.__v.__b-e.__v.__b},rs.__r=0,Rf=/(PointerCapture)$|Capture$/i,Rc=0,Oc=xf(!1),Dc=xf(!0),xv=0;var kc,Xt,Fc,Uf,Hf=0,Kf=[],gt=We,jf=gt.__b,$f=gt.__r,Gf=gt.diffed,Wf=gt.__c,Yf=gt.unmount,zf=gt.__;function Pv(t,e){gt.__h&&gt.__h(Xt,t,Hf||e),Hf=0;var n=Xt.__H||(Xt.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function Bc(t,e){var n=Pv(kc++,7);return kv(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function Lv(){for(var t;t=Kf.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(os),t.__H.__h.forEach(Vc),t.__H.__h=[]}catch(e){t.__H.__h=[],gt.__e(e,t.__v)}}gt.__b=function(t){Xt=null,jf&&jf(t)},gt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),zf&&zf(t,e)},gt.__r=function(t){$f&&$f(t),kc=0;var e=(Xt=t.__c).__H;e&&(Fc===Xt?(e.__h=[],Xt.__h=[],e.__.forEach(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.forEach(os),e.__h.forEach(Vc),e.__h=[],kc=0)),Fc=Xt},gt.diffed=function(t){Gf&&Gf(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Kf.push(e)!==1&&Uf===gt.requestAnimationFrame||((Uf=gt.requestAnimationFrame)||Fv)(Lv)),e.__H.__.forEach(function(n){n.u&&(n.__H=n.u),n.u=void 0})),Fc=Xt=null},gt.__c=function(t,e){e.some(function(n){try{n.__h.forEach(os),n.__h=n.__h.filter(function(r){return!r.__||Vc(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],gt.__e(r,n.__v)}}),Wf&&Wf(t,e)},gt.unmount=function(t){Yf&&Yf(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.forEach(function(r){try{os(r)}catch(i){e=i}}),n.__H=void 0,e&&gt.__e(e,n.__v))};var qf=typeof requestAnimationFrame=="function";function Fv(t){var e,n=function(){clearTimeout(r),qf&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);qf&&(e=requestAnimationFrame(n))}function os(t){var e=Xt,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),Xt=e}function Vc(t){var e=Xt;t.__c=t.__(),Xt=e}function kv(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}var Vv=Symbol.for("preact-signals");function Hc(){if(Gr>1)Gr--;else{for(var t,e=!1;Pi!==void 0;){var n=Pi;for(Pi=void 0,Uc++;n!==void 0;){var r=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&Jf(n))try{n.c()}catch(i){e||(t=i,e=!0)}n=r}}if(Uc=0,Gr--,e)throw t}}var Ye=void 0;var Pi=void 0,Gr=0,Uc=0,ss=0;function Xf(t){if(Ye!==void 0){var e=t.n;if(e===void 0||e.t!==Ye)return e={i:0,S:t,p:Ye.s,n:void 0,t:Ye,e:void 0,x:void 0,r:e},Ye.s!==void 0&&(Ye.s.n=e),Ye.s=e,t.n=e,32&Ye.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=Ye.s,e.n=void 0,Ye.s.n=e,Ye.s=e),e}}function wt(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}wt.prototype.brand=Vv;wt.prototype.h=function(){return!0};wt.prototype.S=function(t){this.t!==t&&t.e===void 0&&(t.x=this.t,this.t!==void 0&&(this.t.e=t),this.t=t)};wt.prototype.U=function(t){if(this.t!==void 0){var e=t.e,n=t.x;e!==void 0&&(e.x=n,t.e=void 0),n!==void 0&&(n.e=e,t.x=void 0),t===this.t&&(this.t=n)}};wt.prototype.subscribe=function(t){var e=this;return as(function(){var n=e.value,r=Ye;Ye=void 0;try{t(n)}finally{Ye=r}})};wt.prototype.valueOf=function(){return this.value};wt.prototype.toString=function(){return this.value+""};wt.prototype.toJSON=function(){return this.value};wt.prototype.peek=function(){var t=Ye;Ye=void 0;try{return this.value}finally{Ye=t}};Object.defineProperty(wt.prototype,"value",{get:function(){var t=Xf(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Uc>100)throw new Error("Cycle detected");this.v=t,this.i++,ss++,Gr++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Hc()}}}});function Li(t){return new wt(t)}function Jf(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function Zf(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Qf(t){for(var e=t.s,n=void 0;e!==void 0;){var r=e.p;e.i===-1?(e.S.U(e),r!==void 0&&(r.n=e.n),e.n!==void 0&&(e.n.p=r)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=r}t.s=n}function Wr(t){wt.call(this,void 0),this.x=t,this.s=void 0,this.g=ss-1,this.f=4}(Wr.prototype=new wt).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===ss))return!0;if(this.g=ss,this.f|=1,this.i>0&&!Jf(this))return this.f&=-2,!0;var t=Ye;try{Zf(this),Ye=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return Ye=t,Qf(this),this.f&=-2,!0};Wr.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}wt.prototype.S.call(this,t)};Wr.prototype.U=function(t){if(this.t!==void 0&&(wt.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};Wr.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(Wr.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Xf(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function ep(t){return new Wr(t)}function tp(t){var e=t.u;if(t.u=void 0,typeof e=="function"){Gr++;var n=Ye;Ye=void 0;try{e()}catch(r){throw t.f&=-2,t.f|=8,jc(t),r}finally{Ye=n,Hc()}}}function jc(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,tp(t)}function Bv(t){if(Ye!==this)throw new Error("Out-of-order effect");Qf(this),Ye=t,this.f&=-2,8&this.f&&jc(this),Hc()}function Fi(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Fi.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};Fi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,tp(this),Zf(this),Gr++;var t=Ye;return Ye=this,Bv.bind(this,t)};Fi.prototype.N=function(){2&this.f||(this.f|=2,this.o=Pi,Pi=this)};Fi.prototype.d=function(){this.f|=8,1&this.f||jc(this)};function as(t){var e=new Fi(t);try{e.c()}catch(n){throw e.d(),n}return e.d.bind(e)}var Gc,$c;function Yr(t,e){We[t]=e.bind(null,We[t]||function(){})}function cs(t){$c&&$c(),$c=t&&t.S()}function np(t){var e=this,n=t.data,r=Hv(n);r.value=n;var i=Bc(function(){for(var o=e.__v;o=o.__;)if(o.__c){o.__c.__$f|=4;break}return e.__$u.c=function(){var s,l=e.__$u.S(),u=i.value;l(),Nc(u)||((s=e.base)==null?void 0:s.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=u},ep(function(){var s=r.value.value;return s===0?0:s===!0?"":s||""})},[]);return i.value}np.displayName="_st";Object.defineProperties(wt.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:np},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Yr("__b",function(t,e){if(typeof e.type=="string"){var n,r=e.props;for(var i in r)if(i!=="children"){var o=r[i];o instanceof wt&&(n||(e.__np=n={}),n[i]=o,r[i]=o.peek())}}t(e)});Yr("__r",function(t,e){cs();var n,r=e.__c;r&&(r.__$f&=-2,(n=r.__$u)===void 0&&(r.__$u=n=function(i){var o;return as(function(){o=this}),o.c=function(){r.__$f|=1,r.setState({})},o}())),Gc=r,cs(n),t(e)});Yr("__e",function(t,e,n,r){cs(),Gc=void 0,t(e,n,r)});Yr("diffed",function(t,e){cs(),Gc=void 0;var n;if(typeof e.type=="string"&&(n=e.__e)){var r=e.__np,i=e.props;if(r){var o=n.U;if(o)for(var s in o){var l=o[s];l!==void 0&&!(s in r)&&(l.d(),o[s]=void 0)}else n.U=o={};for(var u in r){var d=o[u],_=r[u];d===void 0?(d=Uv(n,u,_,i),o[u]=d):d.o(_,i)}}}t(e)});function Uv(t,e,n,r){var i=e in t&&t.ownerSVGElement===void 0,o=Li(n);return{o:function(s,l){o.value=s,r=l},d:as(function(){var s=o.value.value;r[e]!==s&&(r[e]=s,i?t[e]=s:s?t.setAttribute(e,s):t.removeAttribute(e))})}}Yr("unmount",function(t,e){if(typeof e.type=="string"){var n=e.__e;if(n){var r=n.U;if(r){n.U=void 0;for(var i in r){var o=r[i];o&&o.d()}}}}else{var s=e.__c;if(s){var l=s.__$u;l&&(s.__$u=void 0,l.d())}}t(e)});Yr("__h",function(t,e,n,r){(r<3||r===9)&&(e.__$f|=2),t(e,n,r)});jr.prototype.shouldComponentUpdate=function(t,e){var n=this.__$u,r=n&&n.s!==void 0;for(var i in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(r||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(r||4&this.__$f)||3&this.__$f)return!0;for(var o in t)if(o!=="__source"&&t[o]!==this.props[o])return!0;for(var s in this.props)if(!(s in t))return!0;return!1};function Hv(t){return Bc(function(){return Li(t)},[])}var Wc=(i=>(i.SIMPLE="SIMPLE",i.SWIPER="SWIPER",i.STORY="STORY",i.FLOATING_POPUP="FLOATING_POPUP",i))(Wc||{}),Yc=(r=>(r.ON="ON",r.OFF="OFF",r.ON_HOVER="ON_HOVER",r))(Yc||{}),ki=(r=>(r.FIRST_ITEM="FIRST_ITEM",r.CARD="CARD",r.NONE="NONE",r))(ki||{});function jv(t,e){return e={exports:{}},t(e,e.exports),e.exports}var $v=zv,Gv=Kv,Wv=Zv,Sn=[],cn=[],Yv=typeof Uint8Array<"u"?Uint8Array:Array,zc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(hr=0,rp=zc.length;hr<rp;++hr)Sn[hr]=zc[hr],cn[zc.charCodeAt(hr)]=hr;var hr,rp;cn[45]=62;cn[95]=63;function yp(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");n===-1&&(n=e);var r=n===e?0:4-n%4;return[n,r]}function zv(t){var e=yp(t),n=e[0],r=e[1];return(n+r)*3/4-r}function qv(t,e,n){return(e+n)*3/4-n}function Kv(t){var e,n=yp(t),r=n[0],i=n[1],o=new Yv(qv(t,r,i)),s=0,l=i>0?r-4:r,u;for(u=0;u<l;u+=4)e=cn[t.charCodeAt(u)]<<18|cn[t.charCodeAt(u+1)]<<12|cn[t.charCodeAt(u+2)]<<6|cn[t.charCodeAt(u+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return i===2&&(e=cn[t.charCodeAt(u)]<<2|cn[t.charCodeAt(u+1)]>>4,o[s++]=e&255),i===1&&(e=cn[t.charCodeAt(u)]<<10|cn[t.charCodeAt(u+1)]<<4|cn[t.charCodeAt(u+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}function Xv(t){return Sn[t>>18&63]+Sn[t>>12&63]+Sn[t>>6&63]+Sn[t&63]}function Jv(t,e,n){for(var r,i=[],o=e;o<n;o+=3)r=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(Xv(r));return i.join("")}function Zv(t){for(var e,n=t.length,r=n%3,i=[],o=16383,s=0,l=n-r;s<l;s+=o)i.push(Jv(t,s,s+o>l?l:s+o));return r===1?(e=t[n-1],i.push(Sn[e>>2]+Sn[e<<4&63]+"==")):r===2&&(e=(t[n-2]<<8)+t[n-1],i.push(Sn[e>>10]+Sn[e>>4&63]+Sn[e<<2&63]+"=")),i.join("")}var qc={byteLength:$v,toByteArray:Gv,fromByteArray:Wv};var Qv=function(e,n,r,i,o){var s,l,u=o*8-i-1,d=(1<<u)-1,_=d>>1,h=-7,E=r?o-1:0,w=r?-1:1,N=e[n+E];for(E+=w,s=N&(1<<-h)-1,N>>=-h,h+=u;h>0;s=s*256+e[n+E],E+=w,h-=8);for(l=s&(1<<-h)-1,s>>=-h,h+=i;h>0;l=l*256+e[n+E],E+=w,h-=8);if(s===0)s=1-_;else{if(s===d)return l?NaN:(N?-1:1)*(1/0);l=l+Math.pow(2,i),s=s-_}return(N?-1:1)*l*Math.pow(2,s-i)},ey=function(e,n,r,i,o,s){var l,u,d,_=s*8-o-1,h=(1<<_)-1,E=h>>1,w=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,N=i?0:s-1,B=i?1:-1,P=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(u=isNaN(n)?1:0,l=h):(l=Math.floor(Math.log(n)/Math.LN2),n*(d=Math.pow(2,-l))<1&&(l--,d*=2),l+E>=1?n+=w/d:n+=w*Math.pow(2,1-E),n*d>=2&&(l++,d/=2),l+E>=h?(u=0,l=h):l+E>=1?(u=(n*d-1)*Math.pow(2,o),l=l+E):(u=n*Math.pow(2,E-1)*Math.pow(2,o),l=0));o>=8;e[r+N]=u&255,N+=B,u/=256,o-=8);for(l=l<<o|u,_+=o;_>0;e[r+N]=l&255,N+=B,l/=256,_-=8);e[r+N-B]|=P*128},zr={read:Qv,write:ey},ds=jv(function(t,e){var n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=s,e.SlowBuffer=z,e.INSPECT_MAX_BYTES=50;var r=2147483647;e.kMaxLength=r,s.TYPED_ARRAY_SUPPORT=i(),!s.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var p=new Uint8Array(1),a={foo:function(){return 42}};return Object.setPrototypeOf(a,Uint8Array.prototype),Object.setPrototypeOf(p,a),p.foo()===42}catch{return!1}}Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}});function o(p){if(p>r)throw new RangeError('The value "'+p+'" is invalid for option "size"');var a=new Uint8Array(p);return Object.setPrototypeOf(a,s.prototype),a}function s(p,a,c){if(typeof p=="number"){if(typeof a=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(p)}return l(p,a,c)}s.poolSize=8192;function l(p,a,c){if(typeof p=="string")return h(p,a);if(ArrayBuffer.isView(p))return w(p);if(p==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(p));if(me(p,ArrayBuffer)||p&&me(p.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(me(p,SharedArrayBuffer)||p&&me(p.buffer,SharedArrayBuffer)))return N(p,a,c);if(typeof p=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var g=p.valueOf&&p.valueOf();if(g!=null&&g!==p)return s.from(g,a,c);var T=B(p);if(T)return T;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof p[Symbol.toPrimitive]=="function")return s.from(p[Symbol.toPrimitive]("string"),a,c);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(p))}s.from=function(p,a,c){return l(p,a,c)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array);function u(p){if(typeof p!="number")throw new TypeError('"size" argument must be of type number');if(p<0)throw new RangeError('The value "'+p+'" is invalid for option "size"')}function d(p,a,c){return u(p),p<=0?o(p):a!==void 0?typeof c=="string"?o(p).fill(a,c):o(p).fill(a):o(p)}s.alloc=function(p,a,c){return d(p,a,c)};function _(p){return u(p),o(p<0?0:P(p)|0)}s.allocUnsafe=function(p){return _(p)},s.allocUnsafeSlow=function(p){return _(p)};function h(p,a){if((typeof a!="string"||a==="")&&(a="utf8"),!s.isEncoding(a))throw new TypeError("Unknown encoding: "+a);var c=G(p,a)|0,g=o(c),T=g.write(p,a);return T!==c&&(g=g.slice(0,T)),g}function E(p){for(var a=p.length<0?0:P(p.length)|0,c=o(a),g=0;g<a;g+=1)c[g]=p[g]&255;return c}function w(p){if(me(p,Uint8Array)){var a=new Uint8Array(p);return N(a.buffer,a.byteOffset,a.byteLength)}return E(p)}function N(p,a,c){if(a<0||p.byteLength<a)throw new RangeError('"offset" is outside of buffer bounds');if(p.byteLength<a+(c||0))throw new RangeError('"length" is outside of buffer bounds');var g;return a===void 0&&c===void 0?g=new Uint8Array(p):c===void 0?g=new Uint8Array(p,a):g=new Uint8Array(p,a,c),Object.setPrototypeOf(g,s.prototype),g}function B(p){if(s.isBuffer(p)){var a=P(p.length)|0,c=o(a);return c.length===0||p.copy(c,0,0,a),c}if(p.length!==void 0)return typeof p.length!="number"||ge(p.length)?o(0):E(p);if(p.type==="Buffer"&&Array.isArray(p.data))return E(p.data)}function P(p){if(p>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return p|0}function z(p){return+p!=p&&(p=0),s.alloc(+p)}s.isBuffer=function(a){return a!=null&&a._isBuffer===!0&&a!==s.prototype},s.compare=function(a,c){if(me(a,Uint8Array)&&(a=s.from(a,a.offset,a.byteLength)),me(c,Uint8Array)&&(c=s.from(c,c.offset,c.byteLength)),!s.isBuffer(a)||!s.isBuffer(c))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===c)return 0;for(var g=a.length,T=c.length,A=0,F=Math.min(g,T);A<F;++A)if(a[A]!==c[A]){g=a[A],T=c[A];break}return g<T?-1:T<g?1:0},s.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(a,c){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(a.length===0)return s.alloc(0);var g;if(c===void 0)for(c=0,g=0;g<a.length;++g)c+=a[g].length;var T=s.allocUnsafe(c),A=0;for(g=0;g<a.length;++g){var F=a[g];if(me(F,Uint8Array))A+F.length>T.length?s.from(F).copy(T,A):Uint8Array.prototype.set.call(T,F,A);else if(s.isBuffer(F))F.copy(T,A);else throw new TypeError('"list" argument must be an Array of Buffers');A+=F.length}return T};function G(p,a){if(s.isBuffer(p))return p.length;if(ArrayBuffer.isView(p)||me(p,ArrayBuffer))return p.byteLength;if(typeof p!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(p));var c=p.length,g=arguments.length>2&&arguments[2]===!0;if(!g&&c===0)return 0;for(var T=!1;;)switch(a){case"ascii":case"latin1":case"binary":return c;case"utf8":case"utf-8":return ee(p).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return c*2;case"hex":return c>>>1;case"base64":return he(p).length;default:if(T)return g?-1:ee(p).length;a=(""+a).toLowerCase(),T=!0}}s.byteLength=G;function te(p,a,c){var g=!1;if((a===void 0||a<0)&&(a=0),a>this.length||((c===void 0||c>this.length)&&(c=this.length),c<=0)||(c>>>=0,a>>>=0,c<=a))return"";for(p||(p="utf8");;)switch(p){case"hex":return L(this,a,c);case"utf8":case"utf-8":return ze(this,a,c);case"ascii":return D(this,a,c);case"latin1":case"binary":return O(this,a,c);case"base64":return Le(this,a,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,a,c);default:if(g)throw new TypeError("Unknown encoding: "+p);p=(p+"").toLowerCase(),g=!0}}s.prototype._isBuffer=!0;function q(p,a,c){var g=p[a];p[a]=p[c],p[c]=g}s.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var c=0;c<a;c+=2)q(this,c,c+1);return this},s.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var c=0;c<a;c+=4)q(this,c,c+3),q(this,c+1,c+2);return this},s.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var c=0;c<a;c+=8)q(this,c,c+7),q(this,c+1,c+6),q(this,c+2,c+5),q(this,c+3,c+4);return this},s.prototype.toString=function(){var a=this.length;return a===0?"":arguments.length===0?ze(this,0,a):te.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(a){if(!s.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:s.compare(this,a)===0},s.prototype.inspect=function(){var a="",c=e.INSPECT_MAX_BYTES;return a=this.toString("hex",0,c).replace(/(.{2})/g,"$1 ").trim(),this.length>c&&(a+=" ... "),"<Buffer "+a+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(a,c,g,T,A){if(me(a,Uint8Array)&&(a=s.from(a,a.offset,a.byteLength)),!s.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(a));if(c===void 0&&(c=0),g===void 0&&(g=a?a.length:0),T===void 0&&(T=0),A===void 0&&(A=this.length),c<0||g>a.length||T<0||A>this.length)throw new RangeError("out of range index");if(T>=A&&c>=g)return 0;if(T>=A)return-1;if(c>=g)return 1;if(c>>>=0,g>>>=0,T>>>=0,A>>>=0,this===a)return 0;for(var F=A-T,ye=g-c,Te=Math.min(F,ye),we=this.slice(T,A),Be=a.slice(c,g),Ue=0;Ue<Te;++Ue)if(we[Ue]!==Be[Ue]){F=we[Ue],ye=Be[Ue];break}return F<ye?-1:ye<F?1:0};function Me(p,a,c,g,T){if(p.length===0)return-1;if(typeof c=="string"?(g=c,c=0):c>2147483647?c=2147483647:c<-2147483648&&(c=-2147483648),c=+c,ge(c)&&(c=T?0:p.length-1),c<0&&(c=p.length+c),c>=p.length){if(T)return-1;c=p.length-1}else if(c<0)if(T)c=0;else return-1;if(typeof a=="string"&&(a=s.from(a,g)),s.isBuffer(a))return a.length===0?-1:H(p,a,c,g,T);if(typeof a=="number")return a=a&255,typeof Uint8Array.prototype.indexOf=="function"?T?Uint8Array.prototype.indexOf.call(p,a,c):Uint8Array.prototype.lastIndexOf.call(p,a,c):H(p,[a],c,g,T);throw new TypeError("val must be string, number or Buffer")}function H(p,a,c,g,T){var A=1,F=p.length,ye=a.length;if(g!==void 0&&(g=String(g).toLowerCase(),g==="ucs2"||g==="ucs-2"||g==="utf16le"||g==="utf-16le")){if(p.length<2||a.length<2)return-1;A=2,F/=2,ye/=2,c/=2}function Te($t,Jt){return A===1?$t[Jt]:$t.readUInt16BE(Jt*A)}var we;if(T){var Be=-1;for(we=c;we<F;we++)if(Te(p,we)===Te(a,Be===-1?0:we-Be)){if(Be===-1&&(Be=we),we-Be+1===ye)return Be*A}else Be!==-1&&(we-=we-Be),Be=-1}else for(c+ye>F&&(c=F-ye),we=c;we>=0;we--){for(var Ue=!0,tt=0;tt<ye;tt++)if(Te(p,we+tt)!==Te(a,tt)){Ue=!1;break}if(Ue)return we}return-1}s.prototype.includes=function(a,c,g){return this.indexOf(a,c,g)!==-1},s.prototype.indexOf=function(a,c,g){return Me(this,a,c,g,!0)},s.prototype.lastIndexOf=function(a,c,g){return Me(this,a,c,g,!1)};function ve(p,a,c,g){c=Number(c)||0;var T=p.length-c;g?(g=Number(g),g>T&&(g=T)):g=T;var A=a.length;g>A/2&&(g=A/2);for(var F=0;F<g;++F){var ye=parseInt(a.substr(F*2,2),16);if(ge(ye))return F;p[c+F]=ye}return F}function fe(p,a,c,g){return le(ee(a,p.length-c),p,c,g)}function be(p,a,c,g){return le(ce(a),p,c,g)}function Ve(p,a,c,g){return le(he(a),p,c,g)}function Pe(p,a,c,g){return le(re(a,p.length-c),p,c,g)}s.prototype.write=function(a,c,g,T){if(c===void 0)T="utf8",g=this.length,c=0;else if(g===void 0&&typeof c=="string")T=c,g=this.length,c=0;else if(isFinite(c))c=c>>>0,isFinite(g)?(g=g>>>0,T===void 0&&(T="utf8")):(T=g,g=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var A=this.length-c;if((g===void 0||g>A)&&(g=A),a.length>0&&(g<0||c<0)||c>this.length)throw new RangeError("Attempt to write outside buffer bounds");T||(T="utf8");for(var F=!1;;)switch(T){case"hex":return ve(this,a,c,g);case"utf8":case"utf-8":return fe(this,a,c,g);case"ascii":case"latin1":case"binary":return be(this,a,c,g);case"base64":return Ve(this,a,c,g);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pe(this,a,c,g);default:if(F)throw new TypeError("Unknown encoding: "+T);T=(""+T).toLowerCase(),F=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Le(p,a,c){return a===0&&c===p.length?qc.fromByteArray(p):qc.fromByteArray(p.slice(a,c))}function ze(p,a,c){c=Math.min(p.length,c);for(var g=[],T=a;T<c;){var A=p[T],F=null,ye=A>239?4:A>223?3:A>191?2:1;if(T+ye<=c){var Te,we,Be,Ue;switch(ye){case 1:A<128&&(F=A);break;case 2:Te=p[T+1],(Te&192)===128&&(Ue=(A&31)<<6|Te&63,Ue>127&&(F=Ue));break;case 3:Te=p[T+1],we=p[T+2],(Te&192)===128&&(we&192)===128&&(Ue=(A&15)<<12|(Te&63)<<6|we&63,Ue>2047&&(Ue<55296||Ue>57343)&&(F=Ue));break;case 4:Te=p[T+1],we=p[T+2],Be=p[T+3],(Te&192)===128&&(we&192)===128&&(Be&192)===128&&(Ue=(A&15)<<18|(Te&63)<<12|(we&63)<<6|Be&63,Ue>65535&&Ue<1114112&&(F=Ue))}}F===null?(F=65533,ye=1):F>65535&&(F-=65536,g.push(F>>>10&1023|55296),F=56320|F&1023),g.push(F),T+=ye}return _t(g)}var Xe=4096;function _t(p){var a=p.length;if(a<=Xe)return String.fromCharCode.apply(String,p);for(var c="",g=0;g<a;)c+=String.fromCharCode.apply(String,p.slice(g,g+=Xe));return c}function D(p,a,c){var g="";c=Math.min(p.length,c);for(var T=a;T<c;++T)g+=String.fromCharCode(p[T]&127);return g}function O(p,a,c){var g="";c=Math.min(p.length,c);for(var T=a;T<c;++T)g+=String.fromCharCode(p[T]);return g}function L(p,a,c){var g=p.length;(!a||a<0)&&(a=0),(!c||c<0||c>g)&&(c=g);for(var T="",A=a;A<c;++A)T+=_e[p[A]];return T}function M(p,a,c){for(var g=p.slice(a,c),T="",A=0;A<g.length-1;A+=2)T+=String.fromCharCode(g[A]+g[A+1]*256);return T}s.prototype.slice=function(a,c){var g=this.length;a=~~a,c=c===void 0?g:~~c,a<0?(a+=g,a<0&&(a=0)):a>g&&(a=g),c<0?(c+=g,c<0&&(c=0)):c>g&&(c=g),c<a&&(c=a);var T=this.subarray(a,c);return Object.setPrototypeOf(T,s.prototype),T};function v(p,a,c){if(p%1!==0||p<0)throw new RangeError("offset is not uint");if(p+a>c)throw new RangeError("Trying to access beyond buffer length")}s.prototype.readUintLE=s.prototype.readUIntLE=function(a,c,g){a=a>>>0,c=c>>>0,g||v(a,c,this.length);for(var T=this[a],A=1,F=0;++F<c&&(A*=256);)T+=this[a+F]*A;return T},s.prototype.readUintBE=s.prototype.readUIntBE=function(a,c,g){a=a>>>0,c=c>>>0,g||v(a,c,this.length);for(var T=this[a+--c],A=1;c>0&&(A*=256);)T+=this[a+--c]*A;return T},s.prototype.readUint8=s.prototype.readUInt8=function(a,c){return a=a>>>0,c||v(a,1,this.length),this[a]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(a,c){return a=a>>>0,c||v(a,2,this.length),this[a]|this[a+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(a,c){return a=a>>>0,c||v(a,2,this.length),this[a]<<8|this[a+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(a,c){return a=a>>>0,c||v(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(a,c){return a=a>>>0,c||v(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},s.prototype.readIntLE=function(a,c,g){a=a>>>0,c=c>>>0,g||v(a,c,this.length);for(var T=this[a],A=1,F=0;++F<c&&(A*=256);)T+=this[a+F]*A;return A*=128,T>=A&&(T-=Math.pow(2,8*c)),T},s.prototype.readIntBE=function(a,c,g){a=a>>>0,c=c>>>0,g||v(a,c,this.length);for(var T=c,A=1,F=this[a+--T];T>0&&(A*=256);)F+=this[a+--T]*A;return A*=128,F>=A&&(F-=Math.pow(2,8*c)),F},s.prototype.readInt8=function(a,c){return a=a>>>0,c||v(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},s.prototype.readInt16LE=function(a,c){a=a>>>0,c||v(a,2,this.length);var g=this[a]|this[a+1]<<8;return g&32768?g|4294901760:g},s.prototype.readInt16BE=function(a,c){a=a>>>0,c||v(a,2,this.length);var g=this[a+1]|this[a]<<8;return g&32768?g|4294901760:g},s.prototype.readInt32LE=function(a,c){return a=a>>>0,c||v(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},s.prototype.readInt32BE=function(a,c){return a=a>>>0,c||v(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},s.prototype.readFloatLE=function(a,c){return a=a>>>0,c||v(a,4,this.length),zr.read(this,a,!0,23,4)},s.prototype.readFloatBE=function(a,c){return a=a>>>0,c||v(a,4,this.length),zr.read(this,a,!1,23,4)},s.prototype.readDoubleLE=function(a,c){return a=a>>>0,c||v(a,8,this.length),zr.read(this,a,!0,52,8)},s.prototype.readDoubleBE=function(a,c){return a=a>>>0,c||v(a,8,this.length),zr.read(this,a,!1,52,8)};function y(p,a,c,g,T,A){if(!s.isBuffer(p))throw new TypeError('"buffer" argument must be a Buffer instance');if(a>T||a<A)throw new RangeError('"value" argument is out of bounds');if(c+g>p.length)throw new RangeError("Index out of range")}s.prototype.writeUintLE=s.prototype.writeUIntLE=function(a,c,g,T){if(a=+a,c=c>>>0,g=g>>>0,!T){var A=Math.pow(2,8*g)-1;y(this,a,c,g,A,0)}var F=1,ye=0;for(this[c]=a&255;++ye<g&&(F*=256);)this[c+ye]=a/F&255;return c+g},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(a,c,g,T){if(a=+a,c=c>>>0,g=g>>>0,!T){var A=Math.pow(2,8*g)-1;y(this,a,c,g,A,0)}var F=g-1,ye=1;for(this[c+F]=a&255;--F>=0&&(ye*=256);)this[c+F]=a/ye&255;return c+g},s.prototype.writeUint8=s.prototype.writeUInt8=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,1,255,0),this[c]=a&255,c+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,2,65535,0),this[c]=a&255,this[c+1]=a>>>8,c+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,2,65535,0),this[c]=a>>>8,this[c+1]=a&255,c+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,4,4294967295,0),this[c+3]=a>>>24,this[c+2]=a>>>16,this[c+1]=a>>>8,this[c]=a&255,c+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,4,4294967295,0),this[c]=a>>>24,this[c+1]=a>>>16,this[c+2]=a>>>8,this[c+3]=a&255,c+4},s.prototype.writeIntLE=function(a,c,g,T){if(a=+a,c=c>>>0,!T){var A=Math.pow(2,8*g-1);y(this,a,c,g,A-1,-A)}var F=0,ye=1,Te=0;for(this[c]=a&255;++F<g&&(ye*=256);)a<0&&Te===0&&this[c+F-1]!==0&&(Te=1),this[c+F]=(a/ye>>0)-Te&255;return c+g},s.prototype.writeIntBE=function(a,c,g,T){if(a=+a,c=c>>>0,!T){var A=Math.pow(2,8*g-1);y(this,a,c,g,A-1,-A)}var F=g-1,ye=1,Te=0;for(this[c+F]=a&255;--F>=0&&(ye*=256);)a<0&&Te===0&&this[c+F+1]!==0&&(Te=1),this[c+F]=(a/ye>>0)-Te&255;return c+g},s.prototype.writeInt8=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,1,127,-128),a<0&&(a=255+a+1),this[c]=a&255,c+1},s.prototype.writeInt16LE=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,2,32767,-32768),this[c]=a&255,this[c+1]=a>>>8,c+2},s.prototype.writeInt16BE=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,2,32767,-32768),this[c]=a>>>8,this[c+1]=a&255,c+2},s.prototype.writeInt32LE=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,4,2147483647,-2147483648),this[c]=a&255,this[c+1]=a>>>8,this[c+2]=a>>>16,this[c+3]=a>>>24,c+4},s.prototype.writeInt32BE=function(a,c,g){return a=+a,c=c>>>0,g||y(this,a,c,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[c]=a>>>24,this[c+1]=a>>>16,this[c+2]=a>>>8,this[c+3]=a&255,c+4};function U(p,a,c,g,T,A){if(c+g>p.length)throw new RangeError("Index out of range");if(c<0)throw new RangeError("Index out of range")}function X(p,a,c,g,T){return a=+a,c=c>>>0,T||U(p,a,c,4),zr.write(p,a,c,g,23,4),c+4}s.prototype.writeFloatLE=function(a,c,g){return X(this,a,c,!0,g)},s.prototype.writeFloatBE=function(a,c,g){return X(this,a,c,!1,g)};function oe(p,a,c,g,T){return a=+a,c=c>>>0,T||U(p,a,c,8),zr.write(p,a,c,g,52,8),c+8}s.prototype.writeDoubleLE=function(a,c,g){return oe(this,a,c,!0,g)},s.prototype.writeDoubleBE=function(a,c,g){return oe(this,a,c,!1,g)},s.prototype.copy=function(a,c,g,T){if(!s.isBuffer(a))throw new TypeError("argument should be a Buffer");if(g||(g=0),!T&&T!==0&&(T=this.length),c>=a.length&&(c=a.length),c||(c=0),T>0&&T<g&&(T=g),T===g||a.length===0||this.length===0)return 0;if(c<0)throw new RangeError("targetStart out of bounds");if(g<0||g>=this.length)throw new RangeError("Index out of range");if(T<0)throw new RangeError("sourceEnd out of bounds");T>this.length&&(T=this.length),a.length-c<T-g&&(T=a.length-c+g);var A=T-g;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(c,g,T):Uint8Array.prototype.set.call(a,this.subarray(g,T),c),A},s.prototype.fill=function(a,c,g,T){if(typeof a=="string"){if(typeof c=="string"?(T=c,c=0,g=this.length):typeof g=="string"&&(T=g,g=this.length),T!==void 0&&typeof T!="string")throw new TypeError("encoding must be a string");if(typeof T=="string"&&!s.isEncoding(T))throw new TypeError("Unknown encoding: "+T);if(a.length===1){var A=a.charCodeAt(0);(T==="utf8"&&A<128||T==="latin1")&&(a=A)}}else typeof a=="number"?a=a&255:typeof a=="boolean"&&(a=Number(a));if(c<0||this.length<c||this.length<g)throw new RangeError("Out of range index");if(g<=c)return this;c=c>>>0,g=g===void 0?this.length:g>>>0,a||(a=0);var F;if(typeof a=="number")for(F=c;F<g;++F)this[F]=a;else{var ye=s.isBuffer(a)?a:s.from(a,T),Te=ye.length;if(Te===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(F=0;F<g-c;++F)this[F+c]=ye[F%Te]}return this};var ae=/[^+/0-9A-Za-z-_]/g;function de(p){if(p=p.split("=")[0],p=p.trim().replace(ae,""),p.length<2)return"";for(;p.length%4!==0;)p=p+"=";return p}function ee(p,a){a=a||1/0;for(var c,g=p.length,T=null,A=[],F=0;F<g;++F){if(c=p.charCodeAt(F),c>55295&&c<57344){if(!T){if(c>56319){(a-=3)>-1&&A.push(239,191,189);continue}else if(F+1===g){(a-=3)>-1&&A.push(239,191,189);continue}T=c;continue}if(c<56320){(a-=3)>-1&&A.push(239,191,189),T=c;continue}c=(T-55296<<10|c-56320)+65536}else T&&(a-=3)>-1&&A.push(239,191,189);if(T=null,c<128){if((a-=1)<0)break;A.push(c)}else if(c<2048){if((a-=2)<0)break;A.push(c>>6|192,c&63|128)}else if(c<65536){if((a-=3)<0)break;A.push(c>>12|224,c>>6&63|128,c&63|128)}else if(c<1114112){if((a-=4)<0)break;A.push(c>>18|240,c>>12&63|128,c>>6&63|128,c&63|128)}else throw new Error("Invalid code point")}return A}function ce(p){for(var a=[],c=0;c<p.length;++c)a.push(p.charCodeAt(c)&255);return a}function re(p,a){for(var c,g,T,A=[],F=0;F<p.length&&!((a-=2)<0);++F)c=p.charCodeAt(F),g=c>>8,T=c%256,A.push(T),A.push(g);return A}function he(p){return qc.toByteArray(de(p))}function le(p,a,c,g){for(var T=0;T<g&&!(T+c>=a.length||T>=p.length);++T)a[T+c]=p[T];return T}function me(p,a){return p instanceof a||p!=null&&p.constructor!=null&&p.constructor.name!=null&&p.constructor.name===a.name}function ge(p){return p!==p}var _e=function(){for(var p="0123456789abcdef",a=new Array(256),c=0;c<16;++c)for(var g=c*16,T=0;T<16;++T)a[g+T]=p[c]+p[T];return a}()}),ke=ds.Buffer;ds.SlowBuffer;ds.INSPECT_MAX_BYTES;ds.kMaxLength;var Qc=function(e,n){return Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var o in i)i.hasOwnProperty(o)&&(r[o]=i[o])},Qc(e,n)};function fs(t,e){Qc(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}var gr=function(t){fs(e,t);function e(n){var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e}(Error),st=function(t){fs(e,t);function e(n){var r=t.call(this,n)||this;return Object.setPrototypeOf(r,e.prototype),r}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e}(TypeError);function ls(t){return t&&t.Math==Math&&t}function Ep(){return ls(typeof globalThis=="object"&&globalThis)||ls(typeof window=="object"&&window)||ls(typeof self=="object"&&self)||ls(typeof global=="object"&&global)||Function("return this")()}function ty(){var t=Ep();return typeof t.navigator=="object"&&t.navigator.product==="ReactNative"}var ny=function(e){var n=ty()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(n);for(var r=ke.alloc(e),i=0;i<e;++i)r[i]=Math.floor(Math.random()*256);return r},ry=function(){{if(typeof window<"u"){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(ke.alloc(e))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(e){return global.crypto.getRandomValues(ke.alloc(e))}:ny}},bp=ry();function iy(t){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(t))}function tl(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function oy(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function sy(t){return Hi(t)&&Object.prototype.toString.call(t)==="[object Date]"}function Hi(t){return typeof t=="object"&&t!==null}function ps(t,e){var n=!1;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return n||(console.warn(e),n=!0),t.apply(this,i)}return r}function us(t){if(ArrayBuffer.isView(t))return ke.from(t.buffer,t.byteOffset,t.byteLength);if(iy(t))return ke.from(t);throw new st("Must use either Buffer or TypedArray")}var ay=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,wp=function(t){return typeof t=="string"&&ay.test(t)},el=function(t){if(!wp(t))throw new st('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var e=t.replace(/-/g,"");return ke.from(e,"hex")},ip=function(t,e){return e===void 0&&(e=!0),e?t.toString("hex",0,4)+"-"+t.toString("hex",4,6)+"-"+t.toString("hex",6,8)+"-"+t.toString("hex",8,10)+"-"+t.toString("hex",10,16):t.toString("hex")};var eR=Math.pow(2,63)-1,tR=-Math.pow(2,63),cy=Math.pow(2,53),ly=-Math.pow(2,53);var Cp=4;var _r=function(){function t(e,n){if(!(this instanceof t))return new t(e,n);if(e!=null&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer)&&!Array.isArray(e))throw new st("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=n??t.BSON_BINARY_SUBTYPE_DEFAULT,e==null?(this.buffer=ke.alloc(t.BUFFER_SIZE),this.position=0):(typeof e=="string"?this.buffer=ke.from(e,"binary"):Array.isArray(e)?this.buffer=ke.from(e):this.buffer=us(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if(typeof e=="string"&&e.length!==1)throw new st("only accepts single character String");if(typeof e!="number"&&e.length!==1)throw new st("only accepts single character Uint8Array or Array");var n;if(typeof e=="string"?n=e.charCodeAt(0):typeof e=="number"?n=e:n=e[0],n<0||n>255)throw new st("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=n;else{var r=ke.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r,this.buffer[this.position++]=n}},t.prototype.write=function(e,n){if(n=typeof n=="number"?n:this.position,this.buffer.length<n+e.length){var r=ke.alloc(this.buffer.length+e.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r}ArrayBuffer.isView(e)?(this.buffer.set(us(e),n),this.position=n+e.byteLength>this.position?n+e.length:this.position):typeof e=="string"&&(this.buffer.write(e,n,e.length,"binary"),this.position=n+e.length>this.position?n+e.length:this.position)},t.prototype.read=function(e,n){return n=n&&n>0?n:this.position,this.buffer.slice(e,e+n)},t.prototype.value=function(e){return e=!!e,e&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(e){return this.buffer.toString(e)},t.prototype.toExtendedJSON=function(e){e=e||{};var n=this.buffer.toString("base64"),r=Number(this.sub_type).toString(16);return e.legacy?{$binary:n,$type:r.length===1?"0"+r:r}:{$binary:{base64:n,subType:r.length===1?"0"+r:r}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new op(this.buffer.slice(0,this.position));throw new gr('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(e,n){n=n||{};var r,i;if("$binary"in e?n.legacy&&typeof e.$binary=="string"&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,r=ke.from(e.$binary,"base64")):typeof e.$binary!="string"&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,r=ke.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,r=el(e.$uuid)),!r)throw new st("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return i===Cp?new op(r):new t(r,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t}();Object.defineProperty(_r.prototype,"_bsontype",{value:"Binary"});var Kc=16,op=function(t){fs(e,t);function e(n){var r=this,i,o;if(n==null)i=e.generate();else if(n instanceof e)i=ke.from(n.buffer),o=n.__id;else if(ArrayBuffer.isView(n)&&n.byteLength===Kc)i=us(n);else if(typeof n=="string")i=el(n);else throw new st("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return r=t.call(this,i,Cp)||this,r.__id=o,r}return Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer},set:function(n){this.buffer=n,e.cacheHexString&&(this.__id=ip(n))},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(n){if(n===void 0&&(n=!0),e.cacheHexString&&this.__id)return this.__id;var r=ip(this.id,n);return e.cacheHexString&&(this.__id=r),r},e.prototype.toString=function(n){return n?this.id.toString(n):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(n){if(!n)return!1;if(n instanceof e)return n.id.equals(this.id);try{return new e(n).id.equals(this.id)}catch{return!1}},e.prototype.toBinary=function(){return new _r(this.id,_r.SUBTYPE_UUID)},e.generate=function(){var n=bp(Kc);return n[6]=n[6]&15|64,n[8]=n[8]&63|128,ke.from(n)},e.isValid=function(n){return n?n instanceof e?!0:typeof n=="string"?wp(n):tl(n)?n.length!==Kc?!1:(n[6]&240)===64&&(n[8]&128)===128:!1:!1},e.createFromHexString=function(n){var r=el(n);return new e(r)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},e}(_r),hs=function(){function t(e,n){if(!(this instanceof t))return new t(e,n);this.code=e,this.scope=n}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},t}();Object.defineProperty(hs.prototype,"_bsontype",{value:"Code"});function uy(t){return Hi(t)&&t.$id!=null&&typeof t.$ref=="string"&&(t.$db==null||typeof t.$db=="string")}var Bi=function(){function t(e,n,r,i){if(!(this instanceof t))return new t(e,n,r,i);var o=e.split(".");o.length===2&&(r=o.shift(),e=o.shift()),this.collection=e,this.oid=n,this.db=r,this.fields=i||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(e.$db=this.db),e},t.prototype.toExtendedJSON=function(e){e=e||{};var n={$ref:this.collection,$id:this.oid};return e.legacy||(this.db&&(n.$db=this.db),n=Object.assign(n,this.fields)),n},t.fromExtendedJSON=function(e){var n=Object.assign({},e);return delete n.$ref,delete n.$id,delete n.$db,new t(e.$ref,e.$id,e.$db,n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t}();Object.defineProperty(Bi.prototype,"_bsontype",{value:"DBRef"});var an=void 0;try{an=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var sp=65536,dy=1<<24,Kr=sp*sp,Sp=Kr*Kr,ap=Sp/2,cp={},lp={},ue=function(){function t(e,n,r){if(e===void 0&&(e=0),!(this instanceof t))return new t(e,n,r);typeof e=="bigint"?Object.assign(this,t.fromBigInt(e,!!n)):typeof e=="string"?Object.assign(this,t.fromString(e,!!n)):(this.low=e|0,this.high=n|0,this.unsigned=!!r),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,n,r){return new t(e,n,r)},t.fromInt=function(e,n){var r,i,o;return n?(e>>>=0,(o=0<=e&&e<256)&&(i=lp[e],i)?i:(r=t.fromBits(e,(e|0)<0?-1:0,!0),o&&(lp[e]=r),r)):(e|=0,(o=-128<=e&&e<128)&&(i=cp[e],i)?i:(r=t.fromBits(e,e<0?-1:0,!1),o&&(cp[e]=r),r))},t.fromNumber=function(e,n){if(isNaN(e))return n?t.UZERO:t.ZERO;if(n){if(e<0)return t.UZERO;if(e>=Sp)return t.MAX_UNSIGNED_VALUE}else{if(e<=-ap)return t.MIN_VALUE;if(e+1>=ap)return t.MAX_VALUE}return e<0?t.fromNumber(-e,n).neg():t.fromBits(e%Kr|0,e/Kr|0,n)},t.fromBigInt=function(e,n){return t.fromString(e.toString(),n)},t.fromString=function(e,n,r){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t.ZERO;if(typeof n=="number"?(r=n,n=!1):n=!!n,r=r||10,r<2||36<r)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return t.fromString(e.substring(1),n,r).neg();for(var o=t.fromNumber(Math.pow(r,8)),s=t.ZERO,l=0;l<e.length;l+=8){var u=Math.min(8,e.length-l),d=parseInt(e.substring(l,l+u),r);if(u<8){var _=t.fromNumber(Math.pow(r,u));s=s.mul(_).add(t.fromNumber(d))}else s=s.mul(o),s=s.add(t.fromNumber(d))}return s.unsigned=n,s},t.fromBytes=function(e,n,r){return r?t.fromBytesLE(e,n):t.fromBytesBE(e,n)},t.fromBytesLE=function(e,n){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,n)},t.fromBytesBE=function(e,n){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],n)},t.isLong=function(e){return Hi(e)&&e.__isLong__===!0},t.fromValue=function(e,n){return typeof e=="number"?t.fromNumber(e,n):typeof e=="string"?t.fromString(e,n):t.fromBits(e.low,e.high,typeof n=="boolean"?n:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var n=this.high>>>16,r=this.high&65535,i=this.low>>>16,o=this.low&65535,s=e.high>>>16,l=e.high&65535,u=e.low>>>16,d=e.low&65535,_=0,h=0,E=0,w=0;return w+=o+d,E+=w>>>16,w&=65535,E+=i+u,h+=E>>>16,E&=65535,h+=r+l,_+=h>>>16,h&=65535,_+=n+s,_&=65535,t.fromBits(E<<16|w,_<<16|h,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var n=this.isNegative(),r=e.isNegative();return n&&!r?-1:!n&&r?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(e){return this.compare(e)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(an){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var n=(this.unsigned?an.div_u:an.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(n,an.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var r,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;o=t.UZERO}else{if(this.eq(t.MIN_VALUE)){if(e.eq(t.ONE)||e.eq(t.NEG_ONE))return t.MIN_VALUE;if(e.eq(t.MIN_VALUE))return t.ONE;var s=this.shr(1);return r=s.div(e).shl(1),r.eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(r)),o=r.add(i.div(e)),o)}else if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=t.ZERO}for(i=this;i.gte(e);){r=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var l=Math.ceil(Math.log(r)/Math.LN2),u=l<=48?1:Math.pow(2,l-48),d=t.fromNumber(r),_=d.mul(e);_.isNegative()||_.gt(i);)r-=u,d=t.fromNumber(r,this.unsigned),_=d.mul(e);d.isZero()&&(d=t.ONE),o=o.add(d),i=i.sub(_)}return o},t.prototype.div=function(e){return this.divide(e)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},t.prototype.eq=function(e){return this.equals(e)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e=this.high!==0?this.high:this.low,n;for(n=31;n>0&&(e&1<<n)===0;n--);return this.high!==0?n+33:n+1},t.prototype.greaterThan=function(e){return this.comp(e)>0},t.prototype.gt=function(e){return this.greaterThan(e)},t.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},t.prototype.gte=function(e){return this.greaterThanOrEqual(e)},t.prototype.ge=function(e){return this.greaterThanOrEqual(e)},t.prototype.isEven=function(){return(this.low&1)===0},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return(this.low&1)===1},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return this.high===0&&this.low===0},t.prototype.lessThan=function(e){return this.comp(e)<0},t.prototype.lt=function(e){return this.lessThan(e)},t.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},t.prototype.lte=function(e){return this.lessThanOrEqual(e)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),an){var n=(this.unsigned?an.rem_u:an.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(n,an.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(e){return this.modulo(e)},t.prototype.rem=function(e){return this.modulo(e)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),an){var n=an.mul(this.low,this.high,e.low,e.high);return t.fromBits(n,an.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var r=this.high>>>16,i=this.high&65535,o=this.low>>>16,s=this.low&65535,l=e.high>>>16,u=e.high&65535,d=e.low>>>16,_=e.low&65535,h=0,E=0,w=0,N=0;return N+=s*_,w+=N>>>16,N&=65535,w+=o*_,E+=w>>>16,w&=65535,w+=s*d,E+=w>>>16,w&=65535,E+=i*_,h+=E>>>16,E&=65535,E+=o*d,h+=E>>>16,E&=65535,E+=s*u,h+=E>>>16,E&=65535,h+=r*_+i*d+o*u+s*l,h&=65535,t.fromBits(w<<16|N,h<<16|E,this.unsigned)},t.prototype.mul=function(e){return this.multiply(e)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(e){return!this.equals(e)},t.prototype.neq=function(e){return this.notEquals(e)},t.prototype.ne=function(e){return this.notEquals(e)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(e){return this.shiftLeft(e)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(e){return this.shiftRight(e)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),e&=63,e===0)return this;var n=this.high;if(e<32){var r=this.low;return t.fromBits(r>>>e|n<<32-e,n>>>e,this.unsigned)}else return e===32?t.fromBits(n,0,this.unsigned):t.fromBits(n>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},t.prototype.shru=function(e){return this.shiftRightUnsigned(e)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(e){return this.subtract(e)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*Kr+(this.low>>>0):this.high*Kr+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var e=this.high,n=this.low;return[n&255,n>>>8&255,n>>>16&255,n>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},t.prototype.toBytesBE=function(){var e=this.high,n=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,n>>>24,n>>>16&255,n>>>8&255,n&255]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(t.MIN_VALUE)){var n=t.fromNumber(e),r=this.div(n),i=r.mul(n).sub(this);return r.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var o=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,l="";;){var u=s.div(o),d=s.sub(u.mul(o)).toInt()>>>0,_=d.toString(e);if(s=u,s.isZero())return _+l;for(;_.length<6;)_="0"+_;l=""+_+l}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(e){return this.lessThanOrEqual(e)},t.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,n){var r=t.fromString(e.$numberLong);return n&&n.relaxed?r.toNumber():r},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},t.TWO_PWR_24=t.fromInt(dy),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t}();Object.defineProperty(ue.prototype,"__isLong__",{value:!0});Object.defineProperty(ue.prototype,"_bsontype",{value:"Long"});var fy=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,py=/^(\+|-)?(Infinity|inf)$/i,hy=/^(\+|-)?NaN$/i,Vi=6111,Xc=-6176,up=6176,my=34,Jc=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),dp=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),fp=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),gy=/^([-+])?(\d+)?$/,_y=31,pp=16383,vy=30,yy=31;function hp(t){return!isNaN(parseInt(t,10))}function Ey(t){var e=ue.fromNumber(1e9),n=ue.fromNumber(0);if(!t.parts[0]&&!t.parts[1]&&!t.parts[2]&&!t.parts[3])return{quotient:t,rem:n};for(var r=0;r<=3;r++)n=n.shiftLeft(32),n=n.add(new ue(t.parts[r],0)),t.parts[r]=n.div(e).low,n=n.modulo(e);return{quotient:t,rem:n}}function by(t,e){if(!t&&!e)return{high:ue.fromNumber(0),low:ue.fromNumber(0)};var n=t.shiftRightUnsigned(32),r=new ue(t.getLowBits(),0),i=e.shiftRightUnsigned(32),o=new ue(e.getLowBits(),0),s=n.multiply(i),l=n.multiply(o),u=r.multiply(i),d=r.multiply(o);return s=s.add(l.shiftRightUnsigned(32)),l=new ue(l.getLowBits(),0).add(u).add(d.shiftRightUnsigned(32)),s=s.add(l.shiftRightUnsigned(32)),d=l.shiftLeft(32).add(new ue(d.getLowBits(),0)),{high:s,low:d}}function wy(t,e){var n=t.high>>>0,r=e.high>>>0;if(n<r)return!0;if(n===r){var i=t.low>>>0,o=e.low>>>0;if(i<o)return!0}return!1}function qr(t,e){throw new st('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var nl=function(){function t(e){if(!(this instanceof t))return new t(e);if(typeof e=="string")this.bytes=t.fromString(e).bytes;else if(tl(e)){if(e.byteLength!==16)throw new st("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new st("Decimal128 must take a Buffer or string")}return t.fromString=function(e){var n=!1,r=!1,i=!1,o=0,s=0,l=0,u=0,d=0,_=[0],h=0,E=0,w=0,N=0,B=0,P=0,z=new ue(0,0),G=new ue(0,0),te=0,q=0;if(e.length>=7e3)throw new st(""+e+" not a valid Decimal128 string");var Me=e.match(fy),H=e.match(py),ve=e.match(hy);if(!Me&&!H&&!ve||e.length===0)throw new st(""+e+" not a valid Decimal128 string");if(Me){var fe=Me[2],be=Me[4],Ve=Me[5],Pe=Me[6];be&&Pe===void 0&&qr(e,"missing exponent power"),be&&fe===void 0&&qr(e,"missing exponent base"),be===void 0&&(Ve||Pe)&&qr(e,"missing e before exponent")}if((e[q]==="+"||e[q]==="-")&&(n=e[q++]==="-"),!hp(e[q])&&e[q]!=="."){if(e[q]==="i"||e[q]==="I")return new t(ke.from(n?dp:fp));if(e[q]==="N")return new t(ke.from(Jc))}for(;hp(e[q])||e[q]===".";){if(e[q]==="."){r&&qr(e,"contains multiple periods"),r=!0,q=q+1;continue}h<34&&(e[q]!=="0"||i)&&(i||(d=s),i=!0,_[E++]=parseInt(e[q],10),h=h+1),i&&(l=l+1),r&&(u=u+1),s=s+1,q=q+1}if(r&&!s)throw new st(""+e+" not a valid Decimal128 string");if(e[q]==="e"||e[q]==="E"){var Le=e.substr(++q).match(gy);if(!Le||!Le[2])return new t(ke.from(Jc));B=parseInt(Le[0],10),q=q+Le[0].length}if(e[q])return new t(ke.from(Jc));if(w=0,!h)w=0,N=0,_[0]=0,l=1,h=1,o=0;else if(N=h-1,o=l,o!==1)for(;_[d+o-1]===0;)o=o-1;for(B<=u&&u-B>16384?B=Xc:B=B-u;B>Vi;){if(N=N+1,N-w>my){var ze=_.join("");if(ze.match(/^0+$/)){B=Vi;break}qr(e,"overflow")}B=B-1}for(;B<Xc||h<l;){if(N===0&&o<h){B=Xc,o=0;break}if(h<l?l=l-1:N=N-1,B<Vi)B=B+1;else{var ze=_.join("");if(ze.match(/^0+$/)){B=Vi;break}qr(e,"overflow")}}if(N-w+1<o){var Xe=s;r&&(d=d+1,Xe=Xe+1),n&&(d=d+1,Xe=Xe+1);var _t=parseInt(e[d+N+1],10),D=0;if(_t>=5&&(D=1,_t===5)){for(D=_[N]%2===1?1:0,P=d+N+2;P<Xe;P++)if(parseInt(e[P],10)){D=1;break}}if(D){for(var O=N;O>=0;O--)if(++_[O]>9&&(_[O]=0,O===0))if(B<Vi)B=B+1,_[O]=1;else return new t(ke.from(n?dp:fp))}}if(z=ue.fromNumber(0),G=ue.fromNumber(0),o===0)z=ue.fromNumber(0),G=ue.fromNumber(0);else if(N-w<17){var O=w;for(G=ue.fromNumber(_[O++]),z=new ue(0,0);O<=N;O++)G=G.multiply(ue.fromNumber(10)),G=G.add(ue.fromNumber(_[O]))}else{var O=w;for(z=ue.fromNumber(_[O++]);O<=N-17;O++)z=z.multiply(ue.fromNumber(10)),z=z.add(ue.fromNumber(_[O]));for(G=ue.fromNumber(_[O++]);O<=N;O++)G=G.multiply(ue.fromNumber(10)),G=G.add(ue.fromNumber(_[O]))}var L=by(z,ue.fromString("100000000000000000"));L.low=L.low.add(G),wy(L.low,G)&&(L.high=L.high.add(ue.fromNumber(1))),te=B+up;var M={low:ue.fromNumber(0),high:ue.fromNumber(0)};L.high.shiftRightUnsigned(49).and(ue.fromNumber(1)).equals(ue.fromNumber(1))?(M.high=M.high.or(ue.fromNumber(3).shiftLeft(61)),M.high=M.high.or(ue.fromNumber(te).and(ue.fromNumber(16383).shiftLeft(47))),M.high=M.high.or(L.high.and(ue.fromNumber(0x7fffffffffff)))):(M.high=M.high.or(ue.fromNumber(te&16383).shiftLeft(49)),M.high=M.high.or(L.high.and(ue.fromNumber(562949953421311)))),M.low=L.low,n&&(M.high=M.high.or(ue.fromString("9223372036854775808")));var v=ke.alloc(16);return q=0,v[q++]=M.low.low&255,v[q++]=M.low.low>>8&255,v[q++]=M.low.low>>16&255,v[q++]=M.low.low>>24&255,v[q++]=M.low.high&255,v[q++]=M.low.high>>8&255,v[q++]=M.low.high>>16&255,v[q++]=M.low.high>>24&255,v[q++]=M.high.low&255,v[q++]=M.high.low>>8&255,v[q++]=M.high.low>>16&255,v[q++]=M.high.low>>24&255,v[q++]=M.high.high&255,v[q++]=M.high.high>>8&255,v[q++]=M.high.high>>16&255,v[q++]=M.high.high>>24&255,new t(v)},t.prototype.toString=function(){for(var e,n=0,r=new Array(36),i=0;i<r.length;i++)r[i]=0;var o=0,s=!1,l,u={parts:[0,0,0,0]},d,_,h=[];o=0;var E=this.bytes,w=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24,N=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24,B=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24,P=E[o++]|E[o++]<<8|E[o++]<<16|E[o++]<<24;o=0;var z={low:new ue(w,N),high:new ue(B,P)};z.high.lessThan(ue.ZERO)&&h.push("-");var G=P>>26&_y;if(G>>3===3){if(G===vy)return h.join("")+"Infinity";if(G===yy)return"NaN";e=P>>15&pp,l=8+(P>>14&1)}else l=P>>14&7,e=P>>17&pp;var te=e-up;if(u.parts[0]=(P&16383)+((l&15)<<14),u.parts[1]=B,u.parts[2]=N,u.parts[3]=w,u.parts[0]===0&&u.parts[1]===0&&u.parts[2]===0&&u.parts[3]===0)s=!0;else for(_=3;_>=0;_--){var q=0,Me=Ey(u);if(u=Me.quotient,q=Me.rem.low,!!q)for(d=8;d>=0;d--)r[_*9+d]=q%10,q=Math.floor(q/10)}if(s)n=1,r[o]=0;else for(n=36;!r[o];)n=n-1,o=o+1;var H=n-1+te;if(H>=34||H<=-7||te>0){if(n>34)return h.push("".concat(0)),te>0?h.push("E+".concat(te)):te<0&&h.push("E".concat(te)),h.join("");h.push("".concat(r[o++])),n=n-1,n&&h.push(".");for(var i=0;i<n;i++)h.push("".concat(r[o++]));h.push("E"),H>0?h.push("+".concat(H)):h.push("".concat(H))}else if(te>=0)for(var i=0;i<n;i++)h.push("".concat(r[o++]));else{var ve=n+te;if(ve>0)for(var i=0;i<ve;i++)h.push("".concat(r[o++]));else h.push("0");for(h.push(".");ve++<0;)h.push("0");for(var i=0;i<n-Math.max(ve-1,0);i++)h.push("".concat(r[o++]))}return h.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t}();Object.defineProperty(nl.prototype,"_bsontype",{value:"Decimal128"});var ms=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},t.fromExtendedJSON=function(e,n){var r=parseFloat(e.$numberDouble);return n&&n.relaxed?r:new t(r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},t}();Object.defineProperty(ms.prototype,"_bsontype",{value:"Double"});var gs=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e|0}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,n){return n&&n.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},t}();Object.defineProperty(gs.prototype,"_bsontype",{value:"Int32"});var rl=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$maxKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MaxKey()"},t}();Object.defineProperty(rl.prototype,"_bsontype",{value:"MaxKey"});var il=function(){function t(){if(!(this instanceof t))return new t}return t.prototype.toExtendedJSON=function(){return{$minKey:1}},t.fromExtendedJSON=function(){return new t},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new MinKey()"},t}();Object.defineProperty(il.prototype,"_bsontype",{value:"MinKey"});var Cy=new RegExp("^[0-9a-fA-F]{24}$"),mr=null,Cn=Symbol("id"),Pt=function(){function t(e){if(!(this instanceof t))return new t(e);var n;if(typeof e=="object"&&e&&"id"in e){if(typeof e.id!="string"&&!ArrayBuffer.isView(e.id))throw new st("Argument passed in must have an id that is of type string or Buffer");"toHexString"in e&&typeof e.toHexString=="function"?n=ke.from(e.toHexString(),"hex"):n=e.id}else n=e;if(n==null||typeof n=="number")this[Cn]=t.generate(typeof n=="number"?n:void 0);else if(ArrayBuffer.isView(n)&&n.byteLength===12)this[Cn]=n instanceof ke?n:us(n);else if(typeof n=="string")if(n.length===12){var r=ke.from(n);if(r.byteLength===12)this[Cn]=r;else throw new st("Argument passed in must be a string of 12 bytes")}else if(n.length===24&&Cy.test(n))this[Cn]=ke.from(n,"hex");else throw new st("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new st("Argument passed in does not match the accepted types");t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[Cn]},set:function(e){this[Cn]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){typeof e!="number"&&(e=Math.floor(Date.now()/1e3));var n=t.getInc(),r=ke.alloc(12);return r.writeUInt32BE(e,0),mr===null&&(mr=bp(5)),r[4]=mr[0],r[5]=mr[1],r[6]=mr[2],r[7]=mr[3],r[8]=mr[4],r[11]=n&255,r[10]=n>>8&255,r[9]=n>>16&255,r},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(e==null)return!1;if(e instanceof t)return this[Cn][11]===e[Cn][11]&&this[Cn].equals(e[Cn]);if(typeof e=="string"&&t.isValid(e)&&e.length===12&&tl(this.id))return e===ke.prototype.toString.call(this.id,"latin1");if(typeof e=="string"&&t.isValid(e)&&e.length===24)return e.toLowerCase()===this.toHexString();if(typeof e=="string"&&t.isValid(e)&&e.length===12)return ke.from(e).equals(this.id);if(typeof e=="object"&&"toHexString"in e&&typeof e.toHexString=="function"){var n=e.toHexString(),r=this.toHexString().toLowerCase();return typeof n=="string"&&n.toLowerCase()===r}return!1},t.prototype.getTimestamp=function(){var e=new Date,n=this.id.readUInt32BE(0);return e.setTime(Math.floor(n)*1e3),e},t.createPk=function(){return new t},t.createFromTime=function(e){var n=ke.from([0,0,0,0,0,0,0,0,0,0,0,0]);return n.writeUInt32BE(e,0),new t(n)},t.createFromHexString=function(e){if(typeof e>"u"||e!=null&&e.length!==24)throw new st("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(ke.from(e,"hex"))},t.isValid=function(e){if(e==null)return!1;try{return new t(e),!0}catch{return!1}},t.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},t.fromExtendedJSON=function(e){return new t(e.$oid)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},t.index=Math.floor(Math.random()*16777215),t}();Object.defineProperty(Pt.prototype,"generate",{value:ps(function(t){return Pt.generate(t)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(Pt.prototype,"getInc",{value:ps(function(){return Pt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Pt.prototype,"get_inc",{value:ps(function(){return Pt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Pt,"get_inc",{value:ps(function(){return Pt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Pt.prototype,"_bsontype",{value:"ObjectID"});function Sy(t){return t.split("").sort().join("")}var Ui=function(){function t(e,n){if(!(this instanceof t))return new t(e,n);if(this.pattern=e,this.options=Sy(n??""),this.pattern.indexOf("\0")!==-1)throw new gr("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new gr("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var r=0;r<this.options.length;r++)if(!(this.options[r]==="i"||this.options[r]==="m"||this.options[r]==="x"||this.options[r]==="l"||this.options[r]==="s"||this.options[r]==="u"))throw new gr("The regular expression option [".concat(this.options[r],"] is not supported"))}return t.parseOptions=function(e){return e?e.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(e){return e=e||{},e.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e)if(typeof e.$regex!="string"){if(e.$regex._bsontype==="BSONRegExp")return e}else return new t(e.$regex,t.parseOptions(e.$options));if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new st("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t}();Object.defineProperty(Ui.prototype,"_bsontype",{value:"BSONRegExp"});var ol=function(){function t(e){if(!(this instanceof t))return new t(e);this.value=e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(){return this.value},t.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(){return{$symbol:this.value}},t.fromExtendedJSON=function(e){return new t(e.$symbol)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t}();Object.defineProperty(ol.prototype,"_bsontype",{value:"Symbol"});var Ty=ue,Tp=function(t){fs(e,t);function e(n,r){var i=this;return i instanceof e?(ue.isLong(n)?i=t.call(this,n.low,n.high,!0)||this:Hi(n)&&typeof n.t<"u"&&typeof n.i<"u"?i=t.call(this,n.i,n.t,!0)||this:i=t.call(this,n,r,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new e(n,r)}return e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(n){return new e(ue.fromInt(n,!0))},e.fromNumber=function(n){return new e(ue.fromNumber(n,!0))},e.fromBits=function(n,r){return new e(n,r)},e.fromString=function(n,r){return new e(ue.fromString(n,!0,r))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(n){return new e(n.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},e.MAX_VALUE=ue.MAX_UNSIGNED_VALUE,e}(Ty);function Iy(t){return Hi(t)&&Reflect.has(t,"_bsontype")&&typeof t._bsontype=="string"}var Ip=2147483647,xp=-2147483648,Op=9223372036854776e3,Dp=-9223372036854776e3,xy={$oid:Pt,$binary:_r,$uuid:_r,$symbol:ol,$numberInt:gs,$numberDecimal:nl,$numberDouble:ms,$numberLong:ue,$minKey:il,$maxKey:rl,$regex:Ui,$regularExpression:Ui,$timestamp:Tp};function Ap(t,e){if(e===void 0&&(e={}),typeof t=="number"){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=xp&&t<=Ip)return new gs(t);if(t>=Dp&&t<=Op)return ue.fromNumber(t)}return new ms(t)}if(t==null||typeof t!="object")return t;if(t.$undefined)return null;for(var n=Object.keys(t).filter(function(h){return h.startsWith("$")&&t[h]!=null}),r=0;r<n.length;r++){var i=xy[n[r]];if(i)return i.fromExtendedJSON(t,e)}if(t.$date!=null){var o=t.$date,s=new Date;return e.legacy?typeof o=="number"?s.setTime(o):typeof o=="string"&&s.setTime(Date.parse(o)):typeof o=="string"?s.setTime(Date.parse(o)):ue.isLong(o)?s.setTime(o.toNumber()):typeof o=="number"&&e.relaxed&&s.setTime(o),s}if(t.$code!=null){var l=Object.assign({},t);return t.$scope&&(l.$scope=Ap(t.$scope)),hs.fromExtendedJSON(t)}if(uy(t)||t.$dbPointer){var u=t.$ref?t:t.$dbPointer;if(u instanceof Bi)return u;var d=Object.keys(u).filter(function(h){return h.startsWith("$")}),_=!0;if(d.forEach(function(h){["$ref","$id","$db"].indexOf(h)===-1&&(_=!1)}),_)return Bi.fromExtendedJSON(u)}return t}function Oy(t,e){return t.map(function(n,r){e.seenObjects.push({propertyName:"index ".concat(r),obj:null});try{return Jn(n,e)}finally{e.seenObjects.pop()}})}function mp(t){var e=t.toISOString();return t.getUTCMilliseconds()!==0?e:e.slice(0,-5)+"Z"}function Jn(t,e){if((typeof t=="object"||typeof t=="function")&&t!==null){var n=e.seenObjects.findIndex(function(z){return z.obj===t});if(n!==-1){var r=e.seenObjects.map(function(z){return z.propertyName}),i=r.slice(0,n).map(function(z){return"".concat(z," -> ")}).join(""),o=r[n],s=" -> "+r.slice(n+1,r.length-1).map(function(z){return"".concat(z," -> ")}).join(""),l=r[r.length-1],u=" ".repeat(i.length+o.length/2),d="-".repeat(s.length+(o.length+l.length)/2-1);throw new st(`Converting circular structure to EJSON:
33
- `+" ".concat(i).concat(o).concat(s).concat(l,`
34
- `)+" ".concat(u,"\\").concat(d,"/"))}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return Oy(t,e);if(t===void 0)return null;if(t instanceof Date||sy(t)){var _=t.getTime(),h=_>-1&&_<2534023188e5;return e.legacy?e.relaxed&&h?{$date:t.getTime()}:{$date:mp(t)}:e.relaxed&&h?{$date:mp(t)}:{$date:{$numberLong:t.getTime().toString()}}}if(typeof t=="number"&&(!e.relaxed||!isFinite(t))){if(Math.floor(t)===t){var E=t>=xp&&t<=Ip,w=t>=Dp&&t<=Op;if(E)return{$numberInt:t.toString()};if(w)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||oy(t)){var N=t.flags;if(N===void 0){var B=t.toString().match(/[gimuy]*$/);B&&(N=B[0])}var P=new Ui(t.source,N);return P.toExtendedJSON(e)}return t!=null&&typeof t=="object"?Ay(t,e):t}var Dy={Binary:function(t){return new _r(t.value(),t.sub_type)},Code:function(t){return new hs(t.code,t.scope)},DBRef:function(t){return new Bi(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new nl(t.bytes)},Double:function(t){return new ms(t.value)},Int32:function(t){return new gs(t.value)},Long:function(t){return ue.fromBits(t.low!=null?t.low:t.low_,t.low!=null?t.high:t.high_,t.low!=null?t.unsigned:t.unsigned_)},MaxKey:function(){return new rl},MinKey:function(){return new il},ObjectID:function(t){return new Pt(t)},ObjectId:function(t){return new Pt(t)},BSONRegExp:function(t){return new Ui(t.pattern,t.options)},Symbol:function(t){return new ol(t.value)},Timestamp:function(t){return Tp.fromBits(t.low,t.high)}};function Ay(t,e){if(t==null||typeof t!="object")throw new gr("not an object instance");var n=t._bsontype;if(typeof n>"u"){var r={};for(var i in t){e.seenObjects.push({propertyName:i,obj:null});try{var o=Jn(t[i],e);i==="__proto__"?Object.defineProperty(r,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):r[i]=o}finally{e.seenObjects.pop()}}return r}else if(Iy(t)){var s=t;if(typeof s.toExtendedJSON!="function"){var l=Dy[t._bsontype];if(!l)throw new st("Unrecognized or invalid _bsontype: "+t._bsontype);s=l(s)}return n==="Code"&&s.scope?s=new hs(s.code,Jn(s.scope,e)):n==="DBRef"&&s.oid&&(s=new Bi(Jn(s.collection,e),Jn(s.oid,e),Jn(s.db,e),Jn(s.fields,e))),s.toExtendedJSON(e)}else throw new gr("_bsontype must be a string, but was: "+typeof n)}var gp;(function(t){function e(o,s){var l=Object.assign({},{relaxed:!0,legacy:!1},s);return typeof l.relaxed=="boolean"&&(l.strict=!l.relaxed),typeof l.strict=="boolean"&&(l.relaxed=!l.strict),JSON.parse(o,function(u,d){if(u.indexOf("\0")!==-1)throw new gr("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(u)));return Ap(d,l)})}t.parse=e;function n(o,s,l,u){l!=null&&typeof l=="object"&&(u=l,l=0),s!=null&&typeof s=="object"&&!Array.isArray(s)&&(u=s,s=void 0,l=0);var d=Object.assign({relaxed:!0,legacy:!1},u,{seenObjects:[{propertyName:"(root)",obj:null}]}),_=Jn(o,d);return JSON.stringify(_,s,l)}t.stringify=n;function r(o,s){return s=s||{},JSON.parse(n(o,s))}t.serialize=r;function i(o,s){return s=s||{},e(JSON.stringify(o),s)}t.deserialize=i})(gp||(gp={}));var _p,vp=Ep();vp.Map?_p=vp.Map:_p=function(){function t(e){e===void 0&&(e=[]),this._keys=[],this._values={};for(var n=0;n<e.length;n++)if(e[n]!=null){var r=e[n],i=r[0],o=r[1];this._keys.push(i),this._values[i]={v:o,i:this._keys.length-1}}}return t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(e){var n=this._values[e];return n==null?!1:(delete this._values[e],this._keys.splice(n.i,1),!0)},t.prototype.entries=function(){var e=this,n=0;return{next:function(){var r=e._keys[n++];return{value:r!==void 0?[r,e._values[r].v]:void 0,done:r===void 0}}}},t.prototype.forEach=function(e,n){n=n||this;for(var r=0;r<this._keys.length;r++){var i=this._keys[r];e.call(n,this._values[i].v,i,n)}},t.prototype.get=function(e){return this._values[e]?this._values[e].v:void 0},t.prototype.has=function(e){return this._values[e]!=null},t.prototype.keys=function(){var e=this,n=0;return{next:function(){var r=e._keys[n++];return{value:r!==void 0?r:void 0,done:r===void 0}}}},t.prototype.set=function(e,n){return this._values[e]?(this._values[e].v=n,this):(this._keys.push(e),this._values[e]={v:n,i:this._keys.length-1},this)},t.prototype.values=function(){var e=this,n=0;return{next:function(){var r=e._keys[n++];return{value:r!==void 0?e._values[r].v:void 0,done:r===void 0}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),t}();var nR=ue.fromNumber(cy),rR=ue.fromNumber(ly);var Zc=new Uint8Array(8),iR=new DataView(Zc.buffer,Zc.byteOffset,Zc.byteLength);var Ny=1024*1024*17,oR=ke.alloc(Ny);var _s=class{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;constructor(e){e=e||{},this.triggerID=e.id||e.triggerID,this.nudgeID=e.nudgeID,this.shortID=e.shortID,this.contentType=e.contentType,this.engagementID=e.engagementID,this.contentID=e.contentID,this.variation=e.variation,this.props=e.props,this.objective=e.objective,this.onsiteDeliveryType=e.onsiteDeliveryType,this.holdout=e.holdout}};var Xr=class{constructor(e,n={},r,i){this.name=e;this.properties=n;this.id=i?new Pt(i):new Pt,this.occurred=new Date,r&&(this.trigger=new _s(r)),this.newEvent=!i}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale};function Ry(t,e){if(t&1&&(ct(0,"span",1),Re(1),yt()),t&2){Y();let n=Je(0);k(),fn(n.heading)}}function My(t,e){if(t&1&&(ct(0,"span",2),Re(1),yt()),t&2){Y();let n=Je(0);k(),fn(n.subHeading)}}var Jr=class t{card=Nn.required();linkClicked=nr();linkAfterSanity(){return this.card()?.buttonLink?.startsWith("https")?this.card().buttonLink:null}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-video-card"]],inputs:{card:[1,"card"]},outputs:{linkClicked:"linkClicked"},decls:6,vars:6,consts:[[1,"video-card-details"],[1,"heading"],[1,"subheading"],["rel","noopener noreferrer",1,"cta-button",3,"click","href","target"]],template:function(n,r){if(n&1){let i=Ge();It(0),ct(1,"div",0),De(2,Ry,2,1,"span",1),De(3,My,2,1,"span",2),ct(4,"a",3),wr("click",function(){return xe(i),Oe(r.linkClicked.emit())}),Re(5),yt()()}if(n&2){let i=bt(r.card());k(2),Ae(i!=null&&i.heading?2:-1),k(),Ae(i!=null&&i.subHeading?3:-1),k(),Dt("href",r.linkAfterSanity(),dt)("target",i.newTab?"_blank":"_self"),k(),Bt(" ",i==null?null:i.buttonTitle," ")}},styles:["[_nghost-%COMP%]{display:block}.video-card-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3.75px;font-size:14px;line-height:normal}.video-card-details[_ngcontent-%COMP%] .cta-button[_ngcontent-%COMP%]{text-align:center;background-color:#fff;border-radius:var(--lc-button-radius);padding:7.5px 15px;font-weight:500;cursor:pointer;color:var(--lc-color-button);font-size:12px;border:0;text-decoration:none}.video-card-details[_ngcontent-%COMP%] .heading[_ngcontent-%COMP%], .video-card-details[_ngcontent-%COMP%] .subheading[_ngcontent-%COMP%]{text-align:start;color:#000;font-weight:600;overflow:hidden}.video-card-details[_ngcontent-%COMP%] .heading[_ngcontent-%COMP%]{font-size:18px}.video-card-details[_ngcontent-%COMP%] .subheading[_ngcontent-%COMP%]{font-size:16px}"],changeDetection:0})};function Py(t,e){t&1&&(Wt(),Et(0,"path",3))}function Ly(t,e){t&1&&(Wt(),Et(0,"path",4))}var Zr=class t{muted;videoEl;toggled=new ut;toggleMute(e){e.stopPropagation(),e.preventDefault(),this.muted=!this.muted,this.videoEl.muted=this.muted,this.toggled.emit(this.muted),this.muted||this.videoEl.play()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-mute-toggle"]],inputs:{muted:"muted",videoEl:"videoEl"},outputs:{toggled:"toggled"},decls:5,vars:3,consts:[["type","button",1,"lc:bg-black/50",3,"click"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","#fff"],["d","M0 0h24v24H0V0z","fill","none"],["d","M4.34 2.93L2.93 4.34 7.29 8.7 7 9H3v6h4l5 5v-6.59l4.18 4.18c-.65.49-1.38.88-2.18 1.11v2.06c1.34-.3 2.57-.92 3.61-1.75l2.05 2.05 1.41-1.41L4.34 2.93zM10 15.17L7.83 13H5v-2h2.83l.88-.88L10 11.41v3.76zM19 12c0 .82-.15 1.61-.41 2.34l1.53 1.53c.56-1.17.88-2.48.88-3.87 0-4.28-2.99-7.86-7-8.77v2.06c2.89.86 5 3.54 5 6.71zm-7-8l-1.88 1.88L12 7.76zm4.5 8c0-1.77-1.02-3.29-2.5-4.03v1.79l2.48 2.48c.01-.08.02-.16.02-.24z"],["d","M3 9v6h4l5 5V4L7 9H3zm7-.17v6.34L7.83 13H5v-2h2.83L10 8.83zM16.5 12c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77 0-4.28-2.99-7.86-7-8.77z"]],template:function(n,r){n&1&&(ct(0,"button",0),wr("click",function(o){return r.toggleMute(o)}),Wt(),ct(1,"svg",1),Et(2,"path",2),De(3,Py,1,0,":svg:path",3)(4,Ly,1,0,":svg:path",4),yt()()),n&2&&(ai("unmute",!r.muted),k(3),Ae(r.muted?3:4))},styles:["button[_ngcontent-%COMP%]{width:40px;height:40px;display:flex;justify-content:center;align-items:center;border:none;cursor:pointer;border-radius:100%}"]})};var Fy=t=>({"lc:cursor-grab":t}),ky=(t,e)=>e.url;function Vy(t,e){if(t&1&&$e(0,"source",11),t&2){let n=e.$implicit;Se("type",An(n.mimeType))("src",n.url,dt)}}var vs=class t{video;closeClicked=new ut;videoClicked=new ut;isDragging=!1;elementRef=J(Vt);ngOnInit(){let e=this.elementRef.nativeElement.parentElement.parentElement;e.style.zIndex="2147483647"}close(){this.closeClicked.emit()}onVideoClick(){if(this.isDragging){this.isDragging=!1;return}this.videoClicked.emit()}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-draggable-video-popup"]],inputs:{video:"video"},outputs:{closeClicked:"closeClicked",videoClicked:"videoClicked"},decls:14,vars:5,consts:[["role","button","tabindex","0","cdkDrag","",1,"lc-popup-inner","lc:shadow-2xl","lc:rounded-lg","lc:flex","lc:justify-center","lc:items-center",3,"click","keyup","cdkDragMoved","ngClass","cdkDragBoundary"],["type","button",1,"lc-close-button","lc:absolute","lc:-top-3.5","lc:-right-3.5","lc:bg-black/50","lc:rounded-full","lc:w-8","lc:h-8","lc:border-none","lc:z-10","lc:flex","lc:justify-center","lc:items-center",3,"click"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","#fff"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"lc-play-button"],[1,"lc-icon"],["viewBox","0 0 28.31 30"],["d","M19.15,1.29A1.24,1.24,0,0,0,17.82.15a1.36,1.36,0,0,0-.35.07,3.2,3.2,0,0,0-.65.46l-5.06,4.6a1.24,1.24,0,0,0,0,1.75l0,0a1.22,1.22,0,0,0,.89.39,1.25,1.25,0,0,0,.85-.32l3-2.78.17-.13v8l2.44,2.62ZM26.79,26.6l-7.64-7.93-2.5-2.58-6-6.34L8.9,8,5.23,4.15a1.17,1.17,0,0,0-1.66,0h0a1.18,1.18,0,0,0,0,1.66h0L6.1,8.47H3.32a2.94,2.94,0,0,0-2.45,3v7.16a3,3,0,0,0,2.86,3.08H8.07a.44.44,0,0,1,.33.13C9.7,23,11,24.19,12.26,25.36L17,29.7a1.24,1.24,0,0,0,2.17-1V22.21l5.95,6.15a1.2,1.2,0,0,0,1.67,0,1.17,1.17,0,0,0,.08-1.66Zm-10.14-.67-.18-.11L9.75,19.67a1.72,1.72,0,0,0-1.16-.45H4c-.48,0-.59-.11-.59-.61V11.55c0-.49,0-.6.59-.6H8.29l8.29,8.55ZM29.09,15.07A9.9,9.9,0,0,1,26.33,22l-.11.13a1.24,1.24,0,0,1-2-.28,1.29,1.29,0,0,1,.24-1.52h0a6.77,6.77,0,0,0,1.32-1.89,7.41,7.41,0,0,0-1.37-8.55,1.24,1.24,0,0,1-.08-1.75,1.33,1.33,0,0,1,.41-.29,1.19,1.19,0,0,1,1.34.2A8.88,8.88,0,0,1,28,10.36a10,10,0,0,1,1.17,4.17A3.35,3.35,0,0,1,29.09,15.07Z","transform","translate(-0.86 -0.14)","fill","#191919"],[1,"lc-text"],["loop","","preload","auto","playsinline","","autoplay","",1,"lc:rounded-lg","lc:w-full",3,"muted"],[3,"src","type"]],template:function(n,r){n&1&&(K(0,"div",0),Fe("click",function(){return r.onVideoClick()})("keyup",function(){return r.onVideoClick()})("cdkDragMoved",function(){return r.isDragging=!0}),K(1,"button",1),Fe("click",function(o){return o.stopPropagation(),r.close()}),Wt(),K(2,"svg",2),$e(3,"path",3)(4,"path",4),Z()(),Qn(),K(5,"div",5)(6,"div",6),Wt(),K(7,"svg",7),$e(8,"path",8),Z()(),Qn(),K(9,"div",9),Re(10,"Tap to unmute"),Z()(),K(11,"video",10),nt(12,Vy,1,3,"source",11,ky),Z()()),n&2&&(Se("ngClass",Zi(3,Fy,r.isDragging))("cdkDragBoundary","body"),k(11),Se("muted",!0),k(),rt(r.video.sources))},dependencies:[Gn,Kl],styles:["[_nghost-%COMP%]{position:fixed;display:block;right:24px;bottom:24px;max-width:150px}.lc-play-button[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.lc-play-button[_ngcontent-%COMP%] .lc-icon[_ngcontent-%COMP%]{width:14px;height:14px}.lc-play-button[_ngcontent-%COMP%] path[_ngcontent-%COMP%]{fill:#fff}.lc-play-button[_ngcontent-%COMP%] .lc-text[_ngcontent-%COMP%]{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}"]})};function Np(t){t||(t=J(ni));let e=new Yi(n=>{if(t.destroyed){n.next();return}return t.onDestroy(n.next.bind(n))});return n=>n.pipe(zi(e))}var ys=class{lastWidth;lastHeight;resizeTimeout=null;debounceDelay=200;onResizeCallback;constructor(e){this.onResizeCallback=e,this.lastWidth=window.innerWidth,this.lastHeight=window.innerHeight,window.addEventListener("resize",this.debouncedResize),window.addEventListener("orientationchange",this.handleImmediateResize)}destroy(){window.removeEventListener("resize",this.debouncedResize),window.removeEventListener("orientationchange",this.handleImmediateResize)}handleImmediateResize=()=>{this.triggerResize()};debouncedResize=()=>{this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.triggerResize()},this.debounceDelay)};triggerResize(){let e=window.innerWidth,n=window.innerHeight;(n!==this.lastHeight||e!==this.lastWidth)&&(this.onResizeCallback(),this.lastWidth=e,this.lastHeight=n)}};var Es=class t{engagementTrigger;isMobile=window.CooeeSDK.uaParser.getDevice().type==="mobile";ngOnInit(){this.engagementTrigger=this.triggerContext?.triggerData}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-base-video"]],inputs:{triggerContext:"triggerContext"},decls:0,vars:0,template:function(n,r){},encapsulation:2})};var By=t=>({active:t}),Uy=(t,e)=>e.mID;function Hy(t,e){if(t&1&&$e(0,"img",9),t&2){let n=e.$implicit,r=Y();Se("src",n.url,dt)("alt",r.item().name)}}function jy(t,e){if(t&1&&($e(0,"span",18),Qe(1,"cooeeCurrency"),Qe(2,"safeHtml")),t&2){Y(2);let n=Je(15);Se("innerHTML",it(2,3,it(1,1,n.d)),vt)}}function $y(t,e){if(t&1&&($e(0,"span",19),Qe(1,"cooeeCurrency"),Qe(2,"safeHtml")),t&2){Y(2);let n=Je(15);Se("innerHTML",it(2,3,it(1,1,n.cmp)),vt)}}function Gy(t,e){if(t&1&&(K(0,"div",12),De(1,jy,3,5,"span",18),De(2,$y,3,5,"span",19),Z()),t&2){Y();let n=Je(15);k(),Ae(n.d?1:-1),k(),Ae(n.cmp?2:-1)}}function Wy(t,e){if(t&1){let n=Ge();K(0,"a",22),Fe("click",function(i){let o=xe(n).$implicit,s=Y(2);return Oe(s.changeItem(i,o))}),$e(1,"img",23),Z()}if(t&2){let n=e.$implicit,r=Y(2);k(),Se("src",n.firstImageURL,dt)("alt",r.item().name)("ngClass",Zi(3,By,n.mID===r.item().mID+""))}}function Yy(t,e){if(t&1&&(K(0,"span",20),Re(1,"Select product"),Z(),K(2,"div",8),nt(3,Wy,2,5,"a",21,Uy),Z()),t&2){let n=Y();k(3),rt(n.similarItems())}}function zy(t,e){if(t&1&&(K(0,"span",24),Re(1,"Select variant"),Z(),$e(2,"cooee-item-options-picker",25)),t&2){let n=Y();k(2),Se("item",n.item())}}function qy(t,e){if(t&1&&(K(0,"div",26),Re(1,"Description"),Z(),$e(2,"div",27),Qe(3,"safeHtml")),t&2){let n=Y();k(2),Se("innerHTML",it(3,1,n.item().desc),vt)}}function Ky(t,e){t&1&&Re(0," Add To Cart ")}function Xy(t,e){t&1&&Re(0," Out of stock ")}var bs=class t{closeModel=new ut;performCTA=new ut;item=Vs.required();similarItems=Vs.required();closeDialog(){this.closeModel.emit()}clickAddToCart(){this.performCTA.emit({item:this.item(),cta:qt.ADD_TO_CART})}openCart(){this.performCTA.emit({item:this.item(),cta:qt.OPEN_CART})}changeItem(e,n){e.stopPropagation(),e.preventDefault(),this.item.set(n)}goToPDP(){this.performCTA.emit({item:this.item(),cta:qt.GO_TO_PRODUCT})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-product-modal"]],inputs:{item:[1,"item"],similarItems:[1,"similarItems"]},outputs:{closeModel:"closeModel",performCTA:"performCTA",item:"itemChange",similarItems:"similarItemsChange"},decls:28,vars:8,consts:[[1,"lc-card-wrapper"],[1,"lc-card-header"],[1,"lc-header"],["type","button",1,"lc-close-button",3,"click"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","fill","#000"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"lc-card-content"],[1,"lc-image-strip"],[1,"w-28","h-28","object-contain",3,"src","alt"],[1,"lc-inner-body"],[1,"lc-item-name"],[1,"lc-prices"],[1,"lc-card-footer"],["type","button",1,"lc-cta-button",3,"click","disabled"],["type","button",1,"lc-more-info-button",3,"click"],["type","button","title","View Cart",1,"view-cart-button",3,"click"],["width","32","height","32","src","https://img.icons8.com/material-sharp/48/shopping-cart.png","alt","shopping-cart"],[1,"lc-item-price",3,"innerHTML"],[1,"lc-item-cmp-price",3,"innerHTML"],[1,"lc-selected-product-title"],["href","#"],["href","#",3,"click"],[1,"product-selector",3,"src","alt","ngClass"],[1,"lc-selected-variant-title"],[3,"item"],[1,"lc-description-title"],[1,"lc-description",3,"innerHTML"]],template:function(n,r){if(n&1){let i=Ge();K(0,"div",0)(1,"div",1)(2,"div",2),Re(3,"Shop Now"),Z(),K(4,"button",3),Fe("click",function(){return xe(i),Oe(r.closeDialog())}),Wt(),K(5,"svg",4),$e(6,"path",5)(7,"path",6),Z()()(),Qn(),K(8,"div",7)(9,"div",8),nt(10,Hy,1,2,"img",9,In),Z(),K(12,"div",10)(13,"div",11),Re(14),Z(),It(15),De(16,Gy,3,2,"div",12),De(17,Yy,5,0),De(18,zy,3,1),De(19,qy,4,3),Z()(),K(20,"div",13)(21,"button",14),Fe("click",function(){return xe(i),Oe(r.clickAddToCart())}),De(22,Ky,1,0)(23,Xy,1,0),Z(),K(24,"button",15),Fe("click",function(){return xe(i),Oe(r.goToPDP())}),Re(25," More Info "),Z(),K(26,"button",16),Fe("click",function(){return xe(i),Oe(r.openCart())}),$e(27,"img",17),Z()()()}if(n&2){let i=r.item().selectedOrFirstVariant.value;k(10),rt(r.item().imgs),k(4),fn(r.item().name),k();let o=bt(i==null?null:i.price);k(),Ae(o?16:-1),k(),Ae(r.similarItems().length>1?17:-1),k(),Ae(r.item().hasVariants()?18:-1),k(),Ae(r.item().desc?19:-1),k(2),Se("disabled",!i.isAvailable),k(),Ae(i.isAvailable?22:23)}},dependencies:[Gn,Cr,Wn,wn],styles:["[_nghost-%COMP%]{display:block;background:#fff}.lc-card-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;overflow:auto}.lc-card-header[_ngcontent-%COMP%]{display:var(--header-display, flex);flex-direction:row;justify-content:space-between;align-items:center;padding:8px 16px;border-bottom:1px solid var(--lc-color-gray-300)}.lc-header[_ngcontent-%COMP%]{font-size:24px;font-weight:500;color:#000}.lc-close-button[_ngcontent-%COMP%]{background:transparent;border:none;width:36px;height:36px;cursor:pointer}.lc-close-button[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{fill:#000000b3}.lc-card-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overscroll-behavior:contain}.lc-inner-body[_ngcontent-%COMP%]{padding:16px;display:flex;flex-direction:column;gap:8px}.lc-image-strip[_ngcontent-%COMP%]{width:100%;display:flex;overflow-x:auto;gap:.5rem;flex-wrap:nowrap}.lc-image-strip[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:auto;height:200px}.lc-image-strip[_ngcontent-%COMP%] .product-selector[_ngcontent-%COMP%]{height:100px;flex-shrink:0;padding:2px}.lc-image-strip[_ngcontent-%COMP%] .product-selector.active[_ngcontent-%COMP%]{border:red solid 1px}.lc-item-name[_ngcontent-%COMP%]{font-size:20px;font-weight:600;line-height:normal;color:rgb(var(--lc-color-text))}.lc-item-price[_ngcontent-%COMP%]{font-size:18px;font-weight:500;color:rgb(var(--lc-color-text))}.lc-item-cmp-price[_ngcontent-%COMP%]{font-size:18px;font-weight:500;color:rgba(var(--lc-color-text),.75);margin-left:10px;text-decoration:line-through;display:none}.lc-description-title[_ngcontent-%COMP%], .lc-selected-product-title[_ngcontent-%COMP%], .lc-selected-variant-title[_ngcontent-%COMP%]{font-size:18px;font-weight:600;margin-top:8px;line-height:normal;color:#000}.lc-description[_ngcontent-%COMP%]{line-height:normal;color:#000}.lc-card-footer[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:12px;background-color:#0000004d;box-shadow:0 4px 6px #52525b4d;gap:12px}.lc-cta-button[_ngcontent-%COMP%], .lc-more-info-button[_ngcontent-%COMP%]{width:50%;padding:12px;border:none;border-radius:.5rem;font-weight:600;display:flex;justify-content:center;align-items:center;cursor:pointer;font-size:16px}.lc-cta-button[_ngcontent-%COMP%]{background-color:#000;color:#fff}.lc-cta-button[_ngcontent-%COMP%]:disabled{opacity:.5;cursor:not-allowed}.lc-more-info-button[_ngcontent-%COMP%]{background-color:#fff;color:#000}.view-cart-button[_ngcontent-%COMP%]{background:transparent;border:none;cursor:pointer}"]})};var ws=class t{width;static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-video-progress-bar"]],inputs:{width:"width"},decls:3,vars:3,consts:[[1,"video-untracked-path"],["role","progressbar",1,"video-tracked-path"]],template:function(n,r){n&1&&(ct(0,"div",0)(1,"div",1),Et(2,"div"),yt()()),n&2&&(k(),si("width",r.width,"%"),Qt("aria-valuenow",r.width))},styles:["[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%]{height:4px;background-color:#374151;width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{height:4px;background-color:rgba(var(--lc-color-primary),.1)}"]})};function Jy(t,e){if(t&1&&(Et(0,"span",7),Qe(1,"cooeeCurrency"),Qe(2,"safeHtml")),t&2){Y();let n=Je(7);Dt("innerHTML",it(2,3,it(1,1,n.cmp)),vt)}}function Zy(t,e){t&1&&Re(0," Out of Stock ")}function Qy(t,e){t&1&&Re(0," Add To Cart ")}var Cs=class t{buttonClick=nr();item=Nn.required();similarItems=Nn.required();isButtonDisabled=tr(()=>{let e=this.item();return e.hasVariants()?!e.vars.some(n=>n.isAvailable):!e.selectedOrFirstVariant.value.isAvailable});addToCartClicked(e){e.stopPropagation(),this.buttonClick.emit(this.item())}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-product-card"]],inputs:{item:[1,"item"],similarItems:[1,"similarItems"]},outputs:{buttonClick:"buttonClick"},decls:15,vars:13,consts:[[1,"lc-item-card"],[1,"lc-card-content"],[1,"lc-item-image",3,"alt","src"],[1,"lc-product-details"],[1,"lc-item-name"],[1,"lc-prices"],[1,"lc-item-price",3,"innerHTML"],[1,"lc-item-cmp-price",3,"innerHTML"],["type","button",1,"lc-cta-button",3,"click","disabled"]],template:function(n,r){if(n&1){let i=Ge();ct(0,"div",0)(1,"div",1),Et(2,"img",2),ct(3,"div",3)(4,"div",4),Re(5),yt(),ct(6,"div",5),It(7),Et(8,"span",6),Qe(9,"cooeeCurrency"),Qe(10,"safeHtml"),De(11,Jy,3,5,"span",7),yt()()(),ct(12,"button",8),wr("click",function(s){return xe(i),Oe(r.addToCartClicked(s))}),De(13,Zy,1,0)(14,Qy,1,0),yt()()}if(n&2){let i=r.item().selectedOrFirstVariant.value;k(2),Dt("alt",An(r.item().name))("src",r.item().firstImageURL,dt),k(3),Bt(" ",r.item().name," "),k(2);let o=bt(i.price);k(),Dt("innerHTML",it(10,11,it(9,9,o.d)),vt),k(3),Ae(o.cmp?11:-1),k(),Dt("disabled",r.isButtonDisabled()),k(),Ae(r.isButtonDisabled()?13:14)}},dependencies:[wn,Wn],styles:["[_nghost-%COMP%]{display:block;max-width:100%}.lc-item-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:8px;padding:8px}.lc-card-content[_ngcontent-%COMP%]{display:flex;gap:8px;width:100%;align-items:start}.lc-item-image[_ngcontent-%COMP%]{width:70px;height:70px;object-fit:cover;box-sizing:border-box;border-radius:7px}.lc-product-details[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:3.5px;font-size:10.5px}.lc-item-name[_ngcontent-%COMP%]{font-weight:600;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;font-size:16px;line-height:normal;color:rgb(var(--lc-color-text))}.lc-item-price[_ngcontent-%COMP%]{font-size:16px;line-height:normal;color:rgb(var(--lc-color-text))}.lc-item-cmp-price[_ngcontent-%COMP%]{font-size:16px;line-height:normal;color:rgba(var(--lc-color-text),.75);margin-left:10px;text-decoration:line-through;display:none}.lc-cta-button[_ngcontent-%COMP%]{padding:12px 8px;border:none;border-radius:8px;width:100%;background:#000;text-align:center;font-weight:500;cursor:pointer;color:#fff;font-size:16px}.lc-cta-button[_ngcontent-%COMP%]:hover{filter:brightness(.95)}.lc-cta-button[_ngcontent-%COMP%]:active{filter:brightness(.9)}.lc-cta-button[_ngcontent-%COMP%]:focus-visible{outline:2px solid rgb(var(--lc-color-primary, 0, 0, 0));outline-offset:2px}.lc-cta-button[aria-busy=true][_ngcontent-%COMP%], .lc-cta-button[_ngcontent-%COMP%]:disabled{opacity:.7;cursor:default}"]})};var e0=["swiperContainer"],t0=(t,e)=>e.id;function n0(t,e){if(t&1){let n=Ge();K(0,"div",3)(1,"cooee-product-card",4),Fe("buttonClick",function(i){xe(n);let o=Y();return Oe(o.onButtonClick(i))})("click",function(){let i=xe(n).$implicit,o=Y();return Oe(o.cardClick.emit(i))}),Z()()}if(t&2){let n=e.$implicit,r=Y();k(),Se("item",n)("similarItems",r.items())}}var Ss=class t{items=Nn.required();cardClick=nr();buttonClick=nr();destroyRef=J(ni);swiperContainerRef=Fl.required("swiperContainer");swiperInstance;constructor(){ci(()=>{this.initSwiper()}),this.destroyRef.onDestroy(()=>{this.swiperInstance?.destroy()})}onButtonClick(e){let n=nn.get().website?.canChangeVariantInCart;if(this.items()?.length>1||e.hasVariants()&&!n){this.cardClick.emit(e);return}this.buttonClick.emit(e)}initSwiper(){this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef().nativeElement,{direction:"horizontal",effect:"slide",slidesPerView:1.2,nested:!0,centeredSlides:!0,spaceBetween:12,mousewheel:{enabled:!0,thresholdDelta:10,thresholdTime:200}})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-video-promoted-items"]],viewQuery:function(n,r){n&1&&Al(r.swiperContainerRef,e0,5),n&2&&Nl()},inputs:{items:[1,"items"]},outputs:{cardClick:"cardClick",buttonClick:"buttonClick"},decls:5,vars:0,consts:[["swiperContainer",""],[1,"swiper-container"],[1,"swiper-wrapper"],[1,"swiper-slide"],["tabindex","0",3,"buttonClick","click","item","similarItems"]],template:function(n,r){n&1&&(K(0,"div",1,0)(2,"div",2),nt(3,n0,2,2,"div",3,t0),Z()()),n&2&&(k(3),rt(r.items()))},dependencies:[Cs],styles:["[_nghost-%COMP%]{display:block;width:100%}cooee-product-card[_ngcontent-%COMP%]{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background-color:#ffffff80;border-radius:7px;cursor:pointer}"]})};var r0=["swiperContainer"],i0=["videoEl"],o0=(t,e)=>e.url;function s0(t,e){if(t&1&&$e(0,"source",14),t&2){let n=e.$implicit;Se("type",An(n.mimeType))("src",n.url,dt)}}function a0(t,e){t&1&&ks(0)}function c0(t,e){if(t&1){let n=Ge();K(0,"cooee-video-promoted-items",22),Fe("buttonClick",function(i){xe(n);let o=Y(2).$implicit,s=Y();return Oe(s.itemButtonClicked(i,o))})("cardClick",function(i){xe(n);let o=Y(2).$implicit,s=Y();return Oe(s.productCardClicked(i,o))}),Z()}if(t&2){let n=Y(2).$implicit;Se("items",n.items)}}function l0(t,e){if(t&1&&$e(0,"cooee-video-card",21),t&2){let n=Y(2).$implicit;Se("card",n.card)}}function u0(t,e){if(t&1){let n=Ge();$e(0,"cooee-video-progress-bar",16),K(1,"div",17)(2,"cooee-mute-toggle",18),Fe("toggled",function(){xe(n);let i=Y(2);return Oe(i.toggleMute())}),Z(),br(3,a0,1,0,"ng-container",10),Z(),K(4,"div",19),De(5,c0,1,1,"cooee-video-promoted-items",20)(6,l0,1,1,"cooee-video-card",21),Z()}if(t&2){let n=Y(),r=n.$implicit,i=n.$index,o=en(4),s=Y(),l=en(11);Se("width",s.videoProgress[i]||0),k(2),Se("muted",s.muted)("videoEl",o),k(),Se("ngTemplateOutlet",l),k(2),Ae(r.items.length&&s.footerContent===s.VideoConfigFooterContent.FIRST_ITEM?5:r.card&&s.footerContent===s.VideoConfigFooterContent.CARD?6:-1)}}function d0(t,e){if(t&1){let n=Ge();K(0,"cooee-product-modal",23),Fe("performCTA",function(i){xe(n);let o=Y(2);return Oe(o.performClickToAction(i,o.selectedVideo))})("closeModel",function(){xe(n);let i=Y(2);return Oe(i.productModalClosed())}),Z()}if(t&2){let n=Y(2);Se("item",n.selectedItem)("similarItems",n.selectedVideo.items)}}function f0(t,e){if(t&1){let n=Ge();K(0,"div",6)(1,"div",11)(2,"div",12)(3,"video",13,2),Fe("timeupdate",function(i){let o=xe(n).$index,s=Y();return Oe(s.updateProgress(i,o))})("click",function(){let i=xe(n).$index,o=Y();return Oe(o.currentIndex===i&&o.toggleMute())})("ended",function(){xe(n);let i=en(4),o=Y();return Oe(o.onVideoEnded(i))}),nt(5,s0,1,3,"source",14,o0),Z(),De(7,u0,7,5),Z(),De(8,d0,1,2,"cooee-product-modal",15),Z()()}if(t&2){let n=e.$implicit,r=e.$index,i=Y();k(3),Se("ngClass",i.viewTemplateClassName)("autoplay",i.currentIndex===r)("muted",i.muted)("poster",n.thumbnail,dt),Qt("data-video-id",n.id),k(2),rt(n.sources),k(2),Ae(i.currentIndex===r?7:-1),k(),Ae(i.selectedItem&&i.currentIndex===r?8:-1)}}function p0(t,e){t&1&&ks(0)}function h0(t,e){if(t&1){let n=Ge();K(0,"button",24),Fe("click",function(){xe(n);let i=Y();return Oe(i.close())}),Wt(),K(1,"svg",25),$e(2,"path",26)(3,"path",27),Z()()}}var Ts=class t extends Es{videos=[];currentIndex=0;swiperContainerRef;videoElements;data=J(Ic);VideoConfigFooterContent=ki;muted=!1;videoProgress=[];selectedItem=null;selectedVideo;swiperInstance;detailPopupTemplate;footerContent;viewTemplateClassName="lc-video-only-view";cdr=J(rr);elementRef=J(Vt);dialogRef=J(fr);resizeDebouncer=new ys(this.onResize.bind(this));#e=Np();constructor(){super(),this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.triggerContext=this.data.triggerContext}onResize(){this.swiperInstance?.destroy?.(),this.reInitSwiper()}ngOnInit(){super.ngOnInit();let e=this.engagementTrigger?.content?.videoConfig;this.detailPopupTemplate=e?.detailPopup.template??"VIDEO_ONLY_VIEW",this.footerContent=e?.footerContent??"FIRST_ITEM";let n=this.elementRef.nativeElement.shadowRoot,r=nn.get().website.commonCSS;switch(Ut.injectRawCSS(r,n),Ut.injectStylesheet(Mn.styleURL,n),Ut.injectSwiperCSS(n),this.detailPopupTemplate){case"PRODUCT_DETAIL_VIEW":this.selectItemForDetailView(),this.viewTemplateClassName="lc-product-detail-view";break;case"VIDEO_ONLY_VIEW":this.viewTemplateClassName="lc-video-only-view";break}}ngAfterViewInit(){vl(this.getCurrentVideoElement(),"loadeddata").pipe(this.#e).subscribe(()=>{this.initSwiper()})}ngOnDestroy(){this.swiperInstance?.destroy?.(),this.resizeDebouncer.destroy()}close(e=this.videos[this.currentIndex],n=this.currentIndex){let r=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:e,lastVideoIndex:n,lastVideoDuration:r?.currentTime})}itemButtonClicked(e,n){this.performClickToAction({cta:qt.ADD_TO_CART,item:e},n)}performClickToAction(e,n){this.data.onCTAPerformed({cta:e.cta,item:e.item,video:n})}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperInstance.slideTo(this.currentIndex+1)}productModalClosed(){this.selectedItem=null,this.selectedVideo=void 0}pauseAll(){this.videoElements.forEach(e=>e.nativeElement.pause())}async toggleMute(){this.muted=!this.muted,this.videoElements.forEach(r=>r.nativeElement.muted=this.muted);let n=[this.muted?Ze.EVENT_VIDEO_MUTED:Ze.EVENT_VIDEO_UNMUTED,{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(n),await xr.set(Tr.MUTED,this.muted),this.cdr.detectChanges()}playActiveVideo(){this.pauseAll();let e=this.getCurrentVideoElement();e&&(e.currentTime=1,e.play().then(async()=>{this.muted=await xr.get(Tr.MUTED,!1),e.muted=this.muted}))}onVideoEnded(e){if(this.currentIndex<this.videos.length-1)this.selectedItem?(e.currentTime=0,e.play()):this.moveToNextVideo();else{let n=this.getPreviousVideoDataForEvent(),r=[Ze.EVENT_LAST_VIDEO_ENDED,{previous:n},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(r),e.currentTime=0,e.play()}}updateProgress(e,n){let r=e.target;this.videoProgress[n]=r.currentTime/r.duration*100,this.cdr.detectChanges()}onSlideChange(e){let n=this.getPreviousVideoDataForEvent();this.currentIndex=e.realIndex,this.playActiveVideo(),this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"?this.selectItemForDetailView():(this.selectedItem=null,delete this.selectedVideo);let r=this.currentVideoProps(),i={previous:n,current:r},o=[Ze.EVENT_VIDEO_CHANGE,i,{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(o)}productCardClicked(e,n){let r={videoID:n.id,videoIndex:this.currentIndex},i=[Ze.EVENT_MORE_ITEM_INFO_CLICKED,{current:r},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.selectedItem=e,this.selectedVideo=n}reInitSwiper(){this.initSwiper(),this.selectedItem}initSwiper(){let e=this.isMobile?1:"auto",n=0;this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"&&(e="auto",n=10),this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef.nativeElement,{direction:this.isMobile?"vertical":"horizontal",effect:this.isMobile?"slide":"coverflow",slidesPerView:e,initialSlide:this.currentIndex,centeredSlides:!0,spaceBetween:n,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:!1},mousewheel:{enabled:!this.isMobile,invert:!1,thresholdDelta:20},navigation:{nextEl:this.swiperContainerRef.nativeElement.querySelector(".swiper-button-next"),prevEl:this.swiperContainerRef.nativeElement.querySelector(".swiper-button-prev")}}),this.swiperInstance.on("slideChange",r=>{this.onSlideChange(r),this.cdr.detectChanges()}),this.playActiveVideo()}currentVideoProps(){return{videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let e=this.currentVideoProps(),n=this.videoElements.find(i=>i.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;e.playedTillMS=Math.ceil(n?.currentTime*1e3);let r=n?.duration*1e3;return e.playedTillPercent=+(e.playedTillMS/r).toFixed(4),e}selectItemForDetailView(){this.selectedVideo=this.videos[this.currentIndex],this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-video-swiper-dialog"]],viewQuery:function(n,r){if(n&1&&(xn(r0,5),xn(i0,5)),n&2){let i;On(i=Dn())&&(r.swiperContainerRef=i.first),On(i=Dn())&&(r.videoElements=i)}},inputs:{videos:"videos",currentIndex:"currentIndex"},features:[St],decls:12,vars:2,consts:[["swiperContainer",""],["closeButtonTemplate",""],["videoEl",""],[1,"lc-shadow-inner",3,"ngClass"],[1,"swiper-container","video-swiper-container"],[1,"swiper-wrapper"],[1,"swiper-slide","video-slide"],[1,"swiper-button-prev"],[1,"swiper-button-next"],[1,"lc-desktop-controls"],[4,"ngTemplateOutlet"],[1,"lc-video-modal-row"],[1,"lc-video-container"],["playsinline","","preload","metadata",1,"lc-video-el",3,"timeupdate","click","ended","ngClass","autoplay","muted","poster"],[3,"src","type"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"item","similarItems"],[3,"width"],[1,"lc-video-controls"],[3,"toggled","muted","videoEl"],[1,"lc-card-container"],[3,"items"],[3,"card"],[3,"buttonClick","cardClick","items"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"performCTA","closeModel","item","similarItems"],["type","button",1,"lc-close-button",3,"click"],["xmlns","http://www.w3.org/2000/svg","viewBox","0 0 24 24","fill","#fff"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"]],template:function(n,r){if(n&1&&(K(0,"div",3)(1,"div",4,0)(3,"div",5),nt(4,f0,9,7,"div",6,In),Z(),$e(6,"div",7)(7,"div",8),Z(),K(8,"div",9),br(9,p0,1,0,"ng-container",10),Z()(),br(10,h0,4,0,"ng-template",null,1,Pl)),n&2){let i=en(11);Se("ngClass",r.viewTemplateClassName),k(4),rt(r.videos),k(5),Se("ngTemplateOutlet",i)}},dependencies:[Ss,bs,Zr,ws,Ul,Gn,Jr],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media (min-width: 768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper-container{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper-container{align-items:center}@media (min-width: 768px){.video-swiper-container{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper-container>.swiper-wrapper{max-height:100%}.lc-product-detail-view .video-swiper-container>.swiper-wrapper{align-items:center}@media (max-width: 768px){.video-swiper-container>.swiper-button-prev,.video-swiper-container>.swiper-button-next{display:none!important}}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media (min-width: 768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media (max-width: 768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media (min-width: 768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media (min-width: 768px){.video-slide{border-radius:12px;overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{height:100%}.lc-product-detail-view video{width:100%;object-fit:cover;z-index:-1}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media (max-width: 768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}.lc-video-controls .lc-close-button{display:block}@media (min-width: 768px){.lc-video-controls .lc-close-button{display:none}}.lc-close-button{border:none;display:flex;justify-content:center;align-items:center;width:40px;height:40px;background:#00000080;border-radius:100%;cursor:pointer}.lc-close-button svg{width:100%;height:100%}@media (min-width: 768px){.lc-close-button{width:48px;height:48px}}.lc-product-detail-view .lc-video-container{height:100%;position:relative}@media (min-width: 768px){.lc-product-detail-view .lc-video-container{width:50%}}.lc-video-only-view .lc-video-container{height:100%}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media (max-width: 768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-product-modal{--header-display: none;width:50%;flex:1}@media (max-width: 768px){.lc-product-detail-view cooee-product-modal{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-product-modal{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute}
35
- `],encapsulation:3})};var m0=["videoEl"],Rp=(t,e)=>e.url;function g0(t,e){if(t&1&&($e(0,"div",1),Qe(1,"safeHtml")),t&2){let n=Y();Se("innerHTML",it(1,1,n.videoConfig.heading),vt)}}function _0(t,e){if(t&1&&$e(0,"source",7),t&2){let n=e.$implicit;Se("type",An(n.mimeType))("src",n.url,dt)}}function v0(t,e){if(t&1){let n=Ge();K(0,"cooee-mute-toggle",13),Fe("toggled",function(i){xe(n),Y();let o=en(5),s=Y(2);return Oe(s.onMuteToggled(i,o))}),Z()}if(t&2){Y();let n=en(5);Se("muted",n.muted)("videoEl",n)}}function y0(t,e){if(t&1&&($e(0,"span",19),Qe(1,"cooeeCurrency"),Qe(2,"safeHtml")),t&2){Y();let n=Je(6);Se("innerHTML",it(2,3,it(1,1,n.cmp)),vt)}}function E0(t,e){if(t&1){let n=Ge();K(0,"div",10),$e(1,"img",14),K(2,"div",15)(3,"span",16),Re(4),Z(),K(5,"div",17),It(6),$e(7,"span",18),Qe(8,"cooeeCurrency"),Qe(9,"safeHtml"),De(10,y0,3,5,"span",19),Z(),K(11,"button",20),Fe("click",function(i){xe(n);let o=Y().$implicit,s=Y(2);return Oe(s.goToPDP(i,o))}),Re(12," Shop now "),Z()()()}if(t&2){Y();let n=Je(0);k(),Se("src",n.firstImageURL,dt)("alt",n.name),k(3),Bt(" ",n.name," "),k(2);let r=bt(n.selectedOrFirstVariant.value.price);k(),Se("innerHTML",it(9,8,it(8,6,r.d)),vt),k(3),Ae(r.cmp?10:-1)}}function b0(t,e){if(t&1){let n=Ge();K(0,"button",21),Fe("click",function(i){xe(n);let o=Y(),s=o.$implicit,l=o.$index,u=en(5),d=Y(2);return Oe(d.addToCartClicked(i,s,l,u))}),Re(1," Add to cart "),Z()}}function w0(t,e){if(t&1){let n=Ge();K(0,"cooee-video-card",22),Fe("linkClicked",function(){xe(n);let i=Y().$implicit,o=Y(2);return Oe(o.sendTriggerClicked(i))}),Z()}if(t&2){Y();let n=Je(1);Se("card",n)}}function C0(t,e){if(t&1){let n=Ge();It(0)(1),K(2,"div",4)(3,"a",5),Fe("click",function(i){let o=xe(n),s=o.$implicit,l=o.$index,u=en(5),d=Y(2);return Oe(d.onVideoTap(i,s,l,u))}),K(4,"video",6,0),Fe("mouseenter",function(){xe(n);let i=en(5);Y(2);let o=Je(1);return Oe(o&&i.play())})("mouseleave",function(){xe(n);let i=en(5);Y(2);let o=Je(1);return Oe(o&&i.pause())}),nt(6,_0,1,3,"source",7,Rp),Z(),K(8,"div",8),De(9,v0,1,2,"cooee-mute-toggle",9),Z(),De(10,E0,13,10,"div",10),Z(),De(11,b0,2,0,"button",11)(12,w0,1,1,"cooee-video-card",12),Z()}if(t&2){let n=e.$implicit,r=Y(2),i=Je(0),o=bt(n.items[0]);k();let s=bt(n.card),l=o&&r.videoConfig.footerContent==r.VideoConfigFooterContent.FIRST_ITEM,u=s&&r.videoConfig.footerContent==r.VideoConfigFooterContent.CARD;k(3),Se("poster",n.thumbnail,dt)("muted",!0),Qt("autoplay",i||null),k(2),rt(n.sources),k(3),Ae(r.videoConfig.showMuteButton?9:-1),k(),Ae(l?10:-1),k(),Ae(l?11:u?12:-1)}}function S0(t,e){if(t&1&&(K(0,"div",2),nt(1,C0,13,8,"div",4,In),Z()),t&2){let n=Y();k(),rt(n.videos)}}function T0(t,e){if(t&1&&$e(0,"source",7),t&2){let n=e.$implicit;Se("type",An(n.mimeType))("src",n.url,dt)}}function I0(t,e){if(t&1){let n=Ge();K(0,"div",23),Wt(),K(1,"svg",24),$e(2,"circle",25)(3,"circle",26),Z(),Qn(),K(4,"div",27)(5,"video",28),Fe("click",function(i){let o=xe(n),s=o.$implicit,l=o.$index,u=Y(2);return Oe(u.onVideoTap(i,s,l))}),nt(6,T0,1,3,"source",7,Rp),Z()()()}if(t&2){let n=e.$implicit;k(5),Se("muted",!0),k(),rt(n.sources)}}function x0(t,e){if(t&1&&(K(0,"div",3),nt(1,I0,8,1,"div",23,In),Z()),t&2){let n=Y();k(),rt(n.videos)}}function O0(t,e){if(t&1){let n=Ge();K(0,"cooee-draggable-video-popup",30),Fe("videoClicked",function(){xe(n),Y();let i=Je(0),o=Y();return Oe(o.onPopupVideoClicked(i,0))})("closeClicked",function(){xe(n);let i=Y(2);return Oe(i.onPopupVideoClosed())}),Z()}if(t&2){Y();let n=Je(0);Se("video",n)}}function D0(t,e){if(t&1&&(It(0),De(1,O0,1,1,"cooee-draggable-video-popup",29)),t&2){let n=Y();bt(n.videos[0]),k(),Ae(n.hidePopupVideo?-1:1)}}var Is=class t extends tn{videoElements;videos;VideoConfigTemplate=Wc;VideoConfigFooterContent=ki;VideoConfigAutoPlay=Yc;isMobile=window.CooeeSDK.uaParser.getDevice().type==="mobile";hidePopupVideo;videoConfig;dialogRef=null;dialog=J(Cf);cdr=J(rr);constructor(){super()}ngOnInit(){super.ngOnInit(),Ut.loadSwiperScript()}ngAfterViewInit(){this.playFirstVideo()}engagementTriggerReceived(e){this.videoConfig=e.content?.videoConfig,this.videos=this.videoConfig.videos}sendTriggerClicked(e,n){let r=new Xr(Ze.EVENT_TRIGGER_CLICKED,{},this.triggerContext?.triggerData);r.videos=[e.id],n&&(r.items=[n]),this.sendEventToRenderer(r)}onVideoTap(e,n,r,i){e?.stopPropagation(),e?.preventDefault();let o=n.items?.[0];if(this.sendTriggerClicked(n,o?.toEmbed()),this.videoConfig.footerContent==="NONE"){i&&(i.muted=!1,i.play(),this.onMuteToggled(!1,i));return}Ut.loadSwiperScript().then(()=>this.openDialog(n,r))}async performCTA(e){let n,r=this.triggerContext;if(e.cta===qt.ADD_TO_CART)n=Ze.EVENT_ADD_TO_CART_CLICKED;else if(e.cta===qt.GO_TO_PRODUCT)n=Ze.EVENT_VIEW_ITEM_CLICKED;else if(e.cta===qt.OPEN_CART)n=Ze.EVENT_OPEN_CART_CLICKED,r.triggerData.redirectBehaviour=$s.CART_DRAWER;else{qe.warn(`Unsupported CTA type: ${e.cta}`);return}let i={at:e.cta},o={videoID:e.video.id};this.sendEvent(n,{current:o},e.video,e.item),this.executeCTAViaRenderer({clickAction:i,embeddedItem:e.item.toEmbed()})}addToCartClicked(e,n,r,i){let o=n.items?.[0],s=nn.get().website?.canChangeVariantInCart;if(n.items?.length>1||o?.hasVariants()&&!s){this.onVideoTap(e,n,r,i);return}this.performCTA({cta:qt.ADD_TO_CART,item:o,video:n})}goToPDP(e,n){e?.stopPropagation(),e?.preventDefault();let r=n.items?.[0];this.performCTA({cta:qt.GO_TO_PRODUCT,item:r,video:n})}onPopupVideoClicked(e,n){this.hidePopupVideo=!0,this.onVideoTap(null,e,n),this.dialogRef?.closed.subscribe(()=>{this.hidePopupVideo=!1,this.cdr.detectChanges()})}onPopupVideoClosed(){this.hidePopupVideo=!0;let e=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent(Ze.EVENT_TRIGGER_CLOSED,{duration:e})}update(){}onMuteToggled(e,n){e||this.videoElements.forEach(r=>{r.nativeElement!==n&&(r.nativeElement.muted=!0,r.nativeElement.pause())})}playFirstVideo(){this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile&&this.videoElements.first?.nativeElement.play()}sendEvent(e,n,r,i){let o=new Xr(e,n,this.engagementTrigger);r&&(o.videos=[r.id]),i&&(o.items=[i.toEmbed()]),this.sendEventToRenderer(o)}openDialog(e,n){let r={videos:this.videos,currentIndex:n,triggerContext:this.triggerContext,onCTAPerformed:o=>this.performCTA(o)};this.dialogRef&&this.dialogRef.close(),this.dialogRef=this.dialog.open(Ts,{width:"100vw",height:"100vh",data:r});let i={videoID:e.id,videoIndex:n};this.sendEvent(Ze.EVENT_VIDEO_DIALOG_OPENED,{current:i},e),this.dialogRef.closed.subscribe(o=>{if(!o)return;let s=o.lastVideoDuration*1e3,l={videoID:o.lastVideo.id,videoIndex:o.lastVideoIndex,playedTillMS:s,playedTillPercent:s/e.durationMS},u=new Xr(Ze.EVENT_VIDEO_DIALOG_CLOSED,{current:l},this.triggerContext?.triggerData);u.videos=[o.lastVideo.id],this.sendEventToRenderer(u),this.dialogRef=null})}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=Ne({type:t,selectors:[["cooee-shoppable-videos"]],viewQuery:function(n,r){if(n&1&&xn(m0,5),n&2){let i;On(i=Dn())&&(r.videoElements=i)}},features:[St],decls:6,vars:4,consts:[["videoEl",""],["id","lc-heading-text",1,"lc-heading-text",3,"innerHTML"],[1,"lc-video-list"],[1,"lc-video-stories"],[1,"lc-video-card"],["href","",1,"lc-video-wrapper",3,"click"],["width","100%","playsinline","","loop","","preload","metadata",3,"mouseenter","mouseleave","poster","muted"],[3,"src","type"],[1,"lc-video-controls"],[3,"muted","videoEl"],["id","lc-single-product",1,"lc-single-product"],["id","lc-cta-button","type","button",1,"lc-cta-button"],[3,"card"],[3,"toggled","muted","videoEl"],[1,"lc-item-image",3,"src","alt"],[1,"lc-item-details"],[1,"lc-item-name"],[1,"lc-prices"],[1,"lc-item-price",3,"innerHTML"],[1,"lc-item-cmp-price",3,"innerHTML"],["type","button",1,"lc-shop-now-button",3,"click"],["id","lc-cta-button","type","button",1,"lc-cta-button",3,"click"],[3,"linkClicked","card"],[1,"lc-video-story"],["viewBox","0 0 100 100"],["cx","50","cy","50","r","48","fill","none","stroke-width","4"],["id","lc-video-story-circle","cx","50","cy","50","r","48","fill","none","stroke-width","4","stroke-linecap","round","stroke-dasharray","301.6","stroke-dashoffset","301.6"],[1,"story-video-container"],["autoplay","","loop","",3,"click","muted"],[3,"video"],[3,"videoClicked","closeClicked","video"]],template:function(n,r){if(n&1&&(It(0)(1),De(2,g0,2,3,"div",1),De(3,S0,3,0,"div",2)(4,x0,3,0,"div",3)(5,D0,2,2)),n&2){let i=r.videoConfig.template;bt(!r.videoConfig.autoPlay||r.videoConfig.autoPlay===r.VideoConfigAutoPlay.ON),k(),bt(r.videoConfig.autoPlay===r.VideoConfigAutoPlay.ON_HOVER),k(),Ae(r.videoConfig.heading?2:-1),k(),Ae(i===r.VideoConfigTemplate.SIMPLE||i===r.VideoConfigTemplate.SWIPER?3:i===r.VideoConfigTemplate.STORY?4:i===r.VideoConfigTemplate.FLOATING_POPUP?5:-1)}},dependencies:[vs,Zr,Jr,wn,Wn],styles:["[_nghost-%COMP%]{display:block}.lc-heading-text[_ngcontent-%COMP%]{margin-bottom:.5rem;font-size:1.125rem;text-align:center;font-weight:700}.lc-video-list[_ngcontent-%COMP%]{display:flex;overflow-x:auto;gap:24px;margin:8px;align-items:center;scroll-snap-type:x mandatory;scroll-behavior:smooth;padding-top:25px;padding-bottom:25px;scrollbar-width:none}.lc-video-list[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}@media (min-width: 768px){.lc-video-list[_ngcontent-%COMP%]{justify-content:center}}.lc-video-wrapper[_ngcontent-%COMP%]{position:relative;border-radius:.5rem}.lc-video-wrapper[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{border-radius:.5rem}.lc-video-card[_ngcontent-%COMP%]{display:flex;flex-direction:column;gap:2.5px;scroll-snap-align:center;min-width:200px;max-width:300px;transition:transform .3s ease}.lc-video-card[_ngcontent-%COMP%]:hover{transform:scale(1.05)}@media (max-width: 768px){.lc-video-card[_ngcontent-%COMP%]{transition:none}.lc-video-card[_ngcontent-%COMP%]:hover{transform:none}}.lc-cta-button[_ngcontent-%COMP%]{cursor:pointer;background:rgb(var(--lc-color-button));color:rgb(var(--lc-color-button-text));border-radius:var(--lc-button-radius);width:100%;height:auto;text-align:center;z-index:4;padding:1rem}.lc-video-stories[_ngcontent-%COMP%]{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.lc-video-stories[_ngcontent-%COMP%]::-webkit-scrollbar{display:none}@media (max-width: 768px){.lc-video-stories[_ngcontent-%COMP%]{justify-content:start!important}}.lc-video-controls[_ngcontent-%COMP%]{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}.lc-single-product[_ngcontent-%COMP%]{display:flex;margin:.25rem 0;gap:.25rem;align-items:center}.lc-single-product[_ngcontent-%COMP%] .lc-item-image[_ngcontent-%COMP%]{width:50px;height:50px;border-radius:.5rem;display:none}.lc-single-product[_ngcontent-%COMP%] .lc-item-details[_ngcontent-%COMP%]{width:100%;display:flex;flex-direction:column;gap:.25rem;font-size:14px;line-height:normal}.lc-single-product[_ngcontent-%COMP%] .lc-item-details[_ngcontent-%COMP%] .lc-item-name[_ngcontent-%COMP%]{color:rgb(var(--lc-color-text));font-weight:600;display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden}.lc-single-product[_ngcontent-%COMP%] .lc-item-details[_ngcontent-%COMP%] .lc-item-price[_ngcontent-%COMP%]{color:rgb(var(--lc-color-text))}.lc-single-product[_ngcontent-%COMP%] .lc-item-details[_ngcontent-%COMP%] .lc-item-cmp-price[_ngcontent-%COMP%]{color:rgba(var(--lc-color-text),.75);text-decoration:line-through;margin-left:10px;display:none}.lc-single-product[_ngcontent-%COMP%] .lc-item-details[_ngcontent-%COMP%] .lc-shop-now-button[_ngcontent-%COMP%]{display:none;cursor:pointer;background:rgb(var(--lc-color-button));color:rgb(var(--lc-color-button-text));border-radius:var(--lc-button-radius);width:fit-content;height:auto;text-align:center;z-index:4;padding:4px 10px;font-size:12px}.lc-video-story[_ngcontent-%COMP%]{position:relative;width:5rem;height:5rem;cursor:pointer;flex-shrink:0}.lc-video-story[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%}.lc-video-story[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] circle[_ngcontent-%COMP%]:first-child{stroke:#d1d5db}.lc-video-story[_ngcontent-%COMP%] svg[_ngcontent-%COMP%] circle[_ngcontent-%COMP%]:last-child{stroke:#3b82f6}.lc-video-story[_ngcontent-%COMP%] .story-video-container[_ngcontent-%COMP%]{width:100%;height:100%;border-radius:9999px;overflow:hidden}.lc-video-story[_ngcontent-%COMP%] .story-video-container[_ngcontent-%COMP%] video[_ngcontent-%COMP%]{width:100%;height:100%;object-fit:cover;border-radius:9999px}"]})};eu("CooeeWidgetSDK");(async()=>{let t=await jl(tu),e=(n,r)=>{let i=Xl(n,{injector:t.injector});customElements.define(r,i)};e(Zo,"cooee-sticky-atc"),e(Jo,"cooee-savings-bar"),e(Xo,"cooee-progressbar"),e(Is,"cooee-shoppable-videos"),e(Cr,"cooee-product-options-picker"),sessionStorage.cooeeDebug&&import("./chunk-YOGUYHFJ.js").then(n=>{e(n.DebuggerComponent,"cooee-debugger")})})();
8
+ `+u.message+`
9
+ `+Array(u.message.length+1).join("=")+`
10
+ `+P(g,w)):u}}function Et(g,m){var b;return m.cache&&m.name&&m.storage.templates.get(m.name)?m.storage.templates.get(m.name):(b=typeof g=="function"?g:pt(g,m),m.cache&&m.name&&m.storage.templates.define(m.name,b),b)}wt.l.bind(wt),e.compile=pt,e.compileScope=K,e.compileScopeIntoFunction=X,e.compileToString=P,e.defaultConfig=wt,e.filters=kt,e.getConfig=xt,e.helpers=Rt,e.nativeHelpers=Kt,e.parse=z,e.render=function(g,m,b,w){var f=xt(b||{});if(!f.async)return Et(g,f)(m,f);if(!w){if(typeof o=="function")return new o(function(u,x){try{u(Et(g,f)(m,f))}catch(N){x(N)}});throw t("Please provide a callback function, this env doesn't support Promises")}try{Et(g,f)(m,f,w)}catch(u){return w(u)}},e.templates=Xt,Object.defineProperty(e,"__esModule",{value:!0})})});var Jn={schedule(e,t){let r=setTimeout(e,t);return()=>clearTimeout(r)}};function qn(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Zn(e){return!!e&&e.nodeType===Node.ELEMENT_NODE}var ar;function Gn(e,t){if(!ar){let r=Element.prototype;ar=r.matches||r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}return e.nodeType===Node.ELEMENT_NODE?ar.call(e,t):!1}function Xn(e){let t={};return e.forEach(({propName:r,templateName:o,transform:p})=>{t[qn(o)]=[r,p]}),t}function Kn(e,t){return t.get(ir).resolveComponentFactory(e).inputs}function Qn(e,t){let r=e.childNodes,o=t.map(()=>[]),p=-1;t.some((l,a)=>l==="*"?(p=a,!0):!1);for(let l=0,a=r.length;l<a;++l){let d=r[l],v=ti(d,t,p);v!==-1&&o[v].push(d)}return o}function ti(e,t,r){let o=r;return Zn(e)&&t.some((p,l)=>p!=="*"&&Gn(e,p)?(o=l,!0):!1),o}var ei=10,cr=class{componentFactory;inputMap=new Map;constructor(t,r){this.componentFactory=r.get(ir).resolveComponentFactory(t);for(let o of this.componentFactory.inputs)this.inputMap.set(o.propName,o.templateName)}create(t){return new lr(this.componentFactory,t,this.inputMap)}},lr=class{componentFactory;injector;inputMap;eventEmitters=new rr(1);events=this.eventEmitters.pipe(Nr(t=>Ir(...t)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(t,r,o){this.componentFactory=t,this.injector=r,this.inputMap=o,this.ngZone=this.injector.get(Lr),this.appRef=this.injector.get(Pr),this.cdScheduler=r.get(Br),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(t){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(t)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=Jn.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},ei))})}getInputValue(t){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(t):this.componentRef.instance[t])}setInputValue(t,r){if(this.componentRef===null){this.initialInputValues.set(t,r);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(t)??t,r),Mr(this.componentRef.hostView)&&(Dr(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(t){let r=nr.create({providers:[],parent:this.injector}),o=Qn(t,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(r,o,t),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[t,r]of this.initialInputValues)this.setInputValue(t,r);this.initialInputValues.clear()}initializeOutputs(t){let r=this.componentFactory.outputs.map(({propName:o,templateName:p})=>{let l=t.instance[o];return new Te(a=>{let d=l.subscribe(v=>a.next({name:p,value:v}));return()=>d.unsubscribe()})});this.eventEmitters.next(r)}runInZone(t){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(t):t()}},fr=class extends HTMLElement{ngElementEventsSubscription=null};function fn(e,t){let r=Kn(e,t.injector),o=t.strategyFactory||new cr(e,t.injector),p=Xn(r);class l extends fr{injector;static observedAttributes=Object.keys(p);get ngElementStrategy(){if(!this._ngElementStrategy){let d=this._ngElementStrategy=o.create(this.injector||t.injector);r.forEach(({propName:v,transform:E})=>{if(!this.hasOwnProperty(v))return;let C=this[v];delete this[v],d.setInputValue(v,C,E)})}return this._ngElementStrategy}_ngElementStrategy;constructor(d){super(),this.injector=d}attributeChangedCallback(d,v,E,C){let[S,I]=p[d];this.ngElementStrategy.setInputValue(S,E,I)}connectedCallback(){let d=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),d=!0),this.ngElementStrategy.connect(this),d||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(d=>{let v=new CustomEvent(d.name,{detail:d.value});this.dispatchEvent(v)})}}return r.forEach(({propName:a,transform:d})=>{Object.defineProperty(l.prototype,a,{get(){return this.ngElementStrategy.getInputValue(a)},set(v){this.ngElementStrategy.setInputValue(a,v,d)},configurable:!0,enumerable:!0})}),l}var un={providers:[Jr()]};var ur=(r=>(r.CART_AMOUNT="CART_AMOUNT",r.ITEM_COUNT="ITEM_COUNT",r))(ur||{});var lt=Yn(hn());lt.filters.define("default",function(e){return typeof e>"u"||e==null?"":ni(e)});+lt.filters.define("max",(e,t)=>{let r=Number(e),o=Number(t);return isNaN(r)||isNaN(o)?e:r>o?t:e});lt.filters.define("min",(e,t)=>{let r=Number(e),o=Number(t);return isNaN(r)||isNaN(o)?e:r<o?t:e});lt.filters.define("fallback",(e,t)=>e==null||e===""?t:e);lt.filters.define("manipulate_quantity",(e,t,r)=>{if(t??=1,r??=100,t>r)return vt.error("Invalid range: min should be less than or equal to max."),e;if(e>=t&&e<=r)return e;let o=e%r;return o<t?t:o});lt.filters.define("apply_discount_perc",(e,t,r=1/0)=>{if(e=+e,isNaN(e))return vt.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(t<0||t>100)return vt.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let o=e*t/100;return e-Math.min(r,o)});lt.filters.define("apply_discount_fixed",(e,t)=>(e=+e,isNaN(e)?(vt.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,e-t)));lt.filters.define("currency",e=>(e=+e,isNaN(e)?(vt.error("Need value as a number for `currency` filter"),NaN):de(e)));lt.defaultConfig.defaultFilter="default";lt.defaultConfig.useWith=!0;lt.defaultConfig.autoEscape=!1;var ri={'"':"&quot;","\\":"&bsol;","\n":"\\n"};function ni(e){return String(e).replace(/["\\\n]/g,t=>ri[t])}function ii(e){if(!e)return"";let t=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return e.replace(t,(r,o,p,l)=>`{{ ${(p||l||"").trim()} }}`)}var ge=(e,t,r)=>{t=Pt({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},t);try{return lt.render(ii(e),t)}catch(o){throw tn(o,"squirrelly-render",{extra:{template:e,values:t},triggerContext:r}),o}};var Ve=class e{transform(t,r){return t?ge(t,Pt({},r)):null}static \u0275fac=function(r){return new(r||e)};static \u0275pipe=Rr({name:"cooeeDynamicVariables",type:e,pure:!0})};var pr={};(function e(t,r,o,p){var l=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),a=typeof Path2D=="function"&&typeof DOMMatrix=="function",d=function(){if(!t.OffscreenCanvas)return!1;var f=new OffscreenCanvas(1,1),u=f.getContext("2d");u.fillRect(0,0,1,1);var x=f.transferToImageBitmap();try{u.createPattern(x,"no-repeat")}catch{return!1}return!0}();function v(){}function E(f){var u=r.exports.Promise,x=u!==void 0?u:t.Promise;return typeof x=="function"?new x(f):(f(v,v),null)}var C=function(f,u){return{transform:function(x){if(f)return x;if(u.has(x))return u.get(x);var N=new OffscreenCanvas(x.width,x.height),A=N.getContext("2d");return A.drawImage(x,0,0),u.set(x,N),N},clear:function(){u.clear()}}}(d,new Map),S=function(){var f=Math.floor(16.666666666666668),u,x,N={},A=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(u=function(M){var L=Math.random();return N[L]=requestAnimationFrame(function O(R){A===R||A+f-1<R?(A=R,delete N[L],M()):N[L]=requestAnimationFrame(O)}),L},x=function(M){N[M]&&cancelAnimationFrame(N[M])}):(u=function(M){return setTimeout(M,f)},x=function(M){return clearTimeout(M)}),{frame:u,cancel:x}}(),I=function(){var f,u,x={};function N(A){function M(L,O){A.postMessage({options:L||{},callback:O})}A.init=function(O){var R=O.transferControlToOffscreen();A.postMessage({canvas:R},[R])},A.fire=function(O,R,B){if(u)return M(O,null),u;var V=Math.random().toString(36).slice(2);return u=E(function(F){function U(j){j.data.callback===V&&(delete x[V],A.removeEventListener("message",U),u=null,C.clear(),B(),F())}A.addEventListener("message",U),M(O,V),x[V]=U.bind(null,{data:{callback:V}})}),u},A.reset=function(){A.postMessage({reset:!0});for(var O in x)x[O](),delete x[O]}}return function(){if(f)return f;if(!o&&l){var A=["var CONFETTI, SIZE = {}, module = {};","("+e.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(`
11
+ `);try{f=new Worker(URL.createObjectURL(new Blob([A])))}catch(M){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("\u{1F38A} Could not load worker",M),null}N(f)}return f}}(),z={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 P(f,u){return u?u(f):f}function Y(f){return f!=null}function k(f,u,x){return P(f&&Y(f[u])?f[u]:z[u],x)}function et(f){return f<0?0:Math.floor(f)}function X(f,u){return Math.floor(Math.random()*(u-f))+f}function K(f){return parseInt(f,16)}function T(f){return f.map(it)}function it(f){var u=String(f).replace(/[^0-9a-f]/gi,"");return u.length<6&&(u=u[0]+u[0]+u[1]+u[1]+u[2]+u[2]),{r:K(u.substring(0,2)),g:K(u.substring(2,4)),b:K(u.substring(4,6))}}function ut(f){var u=k(f,"origin",Object);return u.x=k(u,"x",Number),u.y=k(u,"y",Number),u}function bt(f){f.width=document.documentElement.clientWidth,f.height=document.documentElement.clientHeight}function Xt(f){var u=f.getBoundingClientRect();f.width=u.width,f.height=u.height}function Rt(f){var u=document.createElement("canvas");return u.style.position="fixed",u.style.top="0px",u.style.left="0px",u.style.pointerEvents="none",u.style.zIndex=f,u}function Kt(f,u,x,N,A,M,L,O,R){f.save(),f.translate(u,x),f.rotate(M),f.scale(N,A),f.arc(0,0,1,L,O,R),f.restore()}function kt(f){var u=f.angle*(Math.PI/180),x=f.spread*(Math.PI/180);return{x:f.x,y:f.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:f.startVelocity*.5+Math.random()*f.startVelocity,angle2D:-u+(.5*x-Math.random()*x),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:f.color,shape:f.shape,tick:0,totalTicks:f.ticks,decay:f.decay,drift:f.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:f.gravity*3,ovalScalar:.6,scalar:f.scalar,flat:f.flat}}function wt(f,u){u.x+=Math.cos(u.angle2D)*u.velocity+u.drift,u.y+=Math.sin(u.angle2D)*u.velocity+u.gravity,u.velocity*=u.decay,u.flat?(u.wobble=0,u.wobbleX=u.x+10*u.scalar,u.wobbleY=u.y+10*u.scalar,u.tiltSin=0,u.tiltCos=0,u.random=1):(u.wobble+=u.wobbleSpeed,u.wobbleX=u.x+10*u.scalar*Math.cos(u.wobble),u.wobbleY=u.y+10*u.scalar*Math.sin(u.wobble),u.tiltAngle+=.1,u.tiltSin=Math.sin(u.tiltAngle),u.tiltCos=Math.cos(u.tiltAngle),u.random=Math.random()+2);var x=u.tick++/u.totalTicks,N=u.x+u.random*u.tiltCos,A=u.y+u.random*u.tiltSin,M=u.wobbleX+u.random*u.tiltCos,L=u.wobbleY+u.random*u.tiltSin;if(f.fillStyle="rgba("+u.color.r+", "+u.color.g+", "+u.color.b+", "+(1-x)+")",f.beginPath(),a&&u.shape.type==="path"&&typeof u.shape.path=="string"&&Array.isArray(u.shape.matrix))f.fill(m(u.shape.path,u.shape.matrix,u.x,u.y,Math.abs(M-N)*.1,Math.abs(L-A)*.1,Math.PI/10*u.wobble));else if(u.shape.type==="bitmap"){var O=Math.PI/10*u.wobble,R=Math.abs(M-N)*.1,B=Math.abs(L-A)*.1,V=u.shape.bitmap.width*u.scalar,F=u.shape.bitmap.height*u.scalar,U=new DOMMatrix([Math.cos(O)*R,Math.sin(O)*R,-Math.sin(O)*B,Math.cos(O)*B,u.x,u.y]);U.multiplySelf(new DOMMatrix(u.shape.matrix));var j=f.createPattern(C.transform(u.shape.bitmap),"no-repeat");j.setTransform(U),f.globalAlpha=1-x,f.fillStyle=j,f.fillRect(u.x-V/2,u.y-F/2,V,F),f.globalAlpha=1}else if(u.shape==="circle")f.ellipse?f.ellipse(u.x,u.y,Math.abs(M-N)*u.ovalScalar,Math.abs(L-A)*u.ovalScalar,Math.PI/10*u.wobble,0,2*Math.PI):Kt(f,u.x,u.y,Math.abs(M-N)*u.ovalScalar,Math.abs(L-A)*u.ovalScalar,Math.PI/10*u.wobble,0,2*Math.PI);else if(u.shape==="star")for(var $=Math.PI/2*3,s=4*u.scalar,n=8*u.scalar,i=u.x,c=u.y,h=5,y=Math.PI/h;h--;)i=u.x+Math.cos($)*n,c=u.y+Math.sin($)*n,f.lineTo(i,c),$+=y,i=u.x+Math.cos($)*s,c=u.y+Math.sin($)*s,f.lineTo(i,c),$+=y;else f.moveTo(Math.floor(u.x),Math.floor(u.y)),f.lineTo(Math.floor(u.wobbleX),Math.floor(A)),f.lineTo(Math.floor(M),Math.floor(L)),f.lineTo(Math.floor(N),Math.floor(u.wobbleY));return f.closePath(),f.fill(),u.tick<u.totalTicks}function xt(f,u,x,N,A){var M=u.slice(),L=f.getContext("2d"),O,R,B=E(function(V){function F(){O=R=null,L.clearRect(0,0,N.width,N.height),C.clear(),A(),V()}function U(){o&&!(N.width===p.width&&N.height===p.height)&&(N.width=f.width=p.width,N.height=f.height=p.height),!N.width&&!N.height&&(x(f),N.width=f.width,N.height=f.height),L.clearRect(0,0,N.width,N.height),M=M.filter(function(j){return wt(L,j)}),M.length?O=S.frame(U):F()}O=S.frame(U),R=F});return{addFettis:function(V){return M=M.concat(V),B},canvas:f,promise:B,reset:function(){O&&S.cancel(O),R&&R()}}}function pt(f,u){var x=!f,N=!!k(u||{},"resize"),A=!1,M=k(u,"disableForReducedMotion",Boolean),L=l&&!!k(u||{},"useWorker"),O=L?I():null,R=x?bt:Xt,B=f&&O?!!f.__confetti_initialized:!1,V=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,F;function U($,s,n){for(var i=k($,"particleCount",et),c=k($,"angle",Number),h=k($,"spread",Number),y=k($,"startVelocity",Number),_=k($,"decay",Number),H=k($,"gravity",Number),q=k($,"drift",Number),W=k($,"colors",T),Q=k($,"ticks",Number),tt=k($,"shapes"),st=k($,"scalar"),Ft=!!k($,"flat"),Ht=ut($),fe=i,St=[],Lt=f.width*Ht.x,zn=f.height*Ht.y;fe--;)St.push(kt({x:Lt,y:zn,angle:c,spread:h,startVelocity:y,color:W[fe%W.length],shape:tt[X(0,tt.length)],ticks:Q,decay:_,gravity:H,drift:q,scalar:st,flat:Ft}));return F?F.addFettis(St):(F=xt(f,St,R,s,n),F.promise)}function j($){var s=M||k($,"disableForReducedMotion",Boolean),n=k($,"zIndex",Number);if(s&&V)return E(function(y){y()});x&&F?f=F.canvas:x&&!f&&(f=Rt(n),document.body.appendChild(f)),N&&!B&&R(f);var i={width:f.width,height:f.height};O&&!B&&O.init(f),B=!0,O&&(f.__confetti_initialized=!0);function c(){if(O){var y={getBoundingClientRect:function(){if(!x)return f.getBoundingClientRect()}};R(y),O.postMessage({resize:{width:y.width,height:y.height}});return}i.width=i.height=null}function h(){F=null,N&&(A=!1,t.removeEventListener("resize",c)),x&&f&&(document.body.contains(f)&&document.body.removeChild(f),f=null,B=!1)}return N&&!A&&(A=!0,t.addEventListener("resize",c,!1)),O?O.fire($,i,h):U($,i,h)}return j.reset=function(){O&&O.reset(),F&&F.reset()},j}var Et;function g(){return Et||(Et=pt(null,{useWorker:!0,resize:!0})),Et}function m(f,u,x,N,A,M,L){var O=new Path2D(f),R=new Path2D;R.addPath(O,new DOMMatrix(u));var B=new Path2D;return B.addPath(R,new DOMMatrix([Math.cos(L)*A,Math.sin(L)*A,-Math.sin(L)*M,Math.cos(L)*M,x,N])),B}function b(f){if(!a)throw new Error("path confetti are not supported in this browser");var u,x;typeof f=="string"?u=f:(u=f.path,x=f.matrix);var N=new Path2D(u),A=document.createElement("canvas"),M=A.getContext("2d");if(!x){for(var L=1e3,O=L,R=L,B=0,V=0,F,U,j=0;j<L;j+=2)for(var $=0;$<L;$+=2)M.isPointInPath(N,j,$,"nonzero")&&(O=Math.min(O,j),R=Math.min(R,$),B=Math.max(B,j),V=Math.max(V,$));F=B-O,U=V-R;var s=10,n=Math.min(s/F,s/U);x=[n,0,0,n,-Math.round(F/2+O)*n,-Math.round(U/2+R)*n]}return{type:"path",path:u,matrix:x}}function w(f){var u,x=1,N="#000000",A='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof f=="string"?u=f:(u=f.text,x="scalar"in f?f.scalar:x,A="fontFamily"in f?f.fontFamily:A,N="color"in f?f.color:N);var M=10*x,L=""+M+"px "+A,O=new OffscreenCanvas(M,M),R=O.getContext("2d");R.font=L;var B=R.measureText(u),V=Math.ceil(B.actualBoundingBoxRight+B.actualBoundingBoxLeft),F=Math.ceil(B.actualBoundingBoxAscent+B.actualBoundingBoxDescent),U=2,j=B.actualBoundingBoxLeft+U,$=B.actualBoundingBoxAscent+U;V+=U+U,F+=U+U,O=new OffscreenCanvas(V,F),R=O.getContext("2d"),R.font=L,R.fillStyle=N,R.fillText(u,j,$);var s=1/x;return{type:"bitmap",bitmap:O.transferToImageBitmap(),matrix:[s,0,0,s,-V*s/2,-F*s/2]}}r.exports=function(){return g().apply(this,arguments)},r.exports.reset=function(){g().reset()},r.exports.create=pt,r.exports.shapeFromPath=b,r.exports.shapeFromText=w})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),pr,!1);var dn=pr.exports,zo=pr.exports.create;var Ue=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(t=100){let r=[],o=Date.now()+2e3,p=()=>{r.push(this.fire({angle:60,spread:55,origin:{x:0}}),this.fire({angle:120,spread:55,origin:{x:1}})),Date.now()<o&&t>0&&(requestAnimationFrame(p),t--)};p(),await Promise.all(r)}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(t){Object.assign(t,this.DEFAULTS,t),t.particleCount=t.particleCount??this.DEFAULTS.colors.length,await dn(t)}static async realisticFire(t,r){let p={origin:{y:.7}};await this.fire(Object.assign({},p,r,{particleCount:Math.floor(200*t)}))}};var oi=(e,t)=>t.minValue;function si(e,t){if(e&1&&(Nt(0,"div",7),Ut(1,"safeHtml")),e&2){let r=Z().$implicit;_t("innerHTML",Zt(1,1,r.minValue+" Products"),Bt)}}function ai(e,t){if(e&1&&(Nt(0,"div",7),Ut(1,"cooeeCurrency"),Ut(2,"safeHtml")),e&2){let r=Z().$implicit;_t("innerHTML",Zt(2,3,Zt(1,1,r.minValue)),Bt)}}function ci(e,t){if(e&1&&(At(0,"li",6)(1,"div"),mt(2,si,2,3,"div",7)(3,ai,3,5,"div",7),Nt(4,"img",8),At(5,"div",9),Dt(6),Vt()()()),e&2){let r=t.$implicit,o=Z(2);or("left",r.calculatedAlignment+"%"),J(2),gt((o.progressBarConfig==null?null:o.progressBarConfig.rewardBasis)===o.RewardBasis.ITEM_COUNT?2:3),J(2),_t("src",o.getIconURL(r),Wt),J(2),Hr(r.label)}}function li(e,t){if(e&1&&(Nt(0,"div",0),Ut(1,"cooeeDynamicVariables"),Ut(2,"safeHtml"),At(3,"div",1)(4,"ul",2)(5,"div",3),Nt(6,"div",4),Vt(),Ct(7,ci,7,5,"li",5,oi),Vt()()),e&2){let r=Z(),o=r.calculatedState(),p=o.nextMilestone?o.nextMilestone.reachingText:o.lastMilestone.reachedText;_t("innerHTML",Zt(2,6,Yr(1,3,p,r.localDynamicVariables())),Bt),J(6),or("width",o.cartValuePercentage+"%"),J(),It(o.milestones)}}var je=class e extends Qt{cart;localDynamicVariables=zt({});calculatedState=zt({});progressBarConfig;RewardBasis=ur;constructor(){super()}engagementTriggerReceived(t){this.progressBarConfig=t.progressBarConfig}ngOnInit(){super.ngOnInit(),this.calculateMilestonesSilently()}update(){this.calculateMilestonesSilently()}getIconURL(t){return t.rewardType===Fe.FREE_SHIPPING?"https://img.icons8.com/ios-filled/50/FFFFFF/free-shipping.png":t.rewardType===Fe.DISCOUNT?"https://img.icons8.com/ios-glyphs/30/FFFFFF/sale-price-tag.png":t.rewardType===Fe.FREE_AUTO_GIFT?"https://img.icons8.com/ios-filled/50/FFFFFF/gift--v1.png":""}calculateMilestonesSilently(){this.calculateMilestones().catch(t=>vt.error(t))}async calculateMilestones(){let t=this.engagementTrigger,r=this.progressBarConfig;if(!r?.milestones?.length){vt.warn("Milestones not available in progress bar config",t);return}let o=await this.cart.getNormalisedCart(),p=r.milestones.at(-1),l=r?.reachedAmountOrCount??o.originalAmount,a=r.totalProgress??0;vt.verbose("Cart value:",l,`, percentage: ${a}%`),this.celebrate(t,l);let d={milestonesReady:!0,cartValuePercentage:a,milestones:r.milestones},v=r.milestones.find(E=>!E.reached);if(v){let E=de(v.minValue-l);if(r.rewardBasis==="ITEM_COUNT"){let C=v.minValue-l;E=`${C} ${C===1?"product":"products"}`}this.localDynamicVariables.set({amount_left:E}),d.nextMilestone=v,this.calculatedState.set(d);return}d.lastMilestone=p,this.calculatedState.set(d)}celebrate(t,r){let l=[...t.progressBarConfig.milestones].reverse().find(v=>v.minValue<r);if(!l)return;let a=`lc/en/${t.shortID}/${l.minValue}`;sessionStorage.getItem(a)||(sessionStorage.setItem(a,"1"),this.progressBarConfig?.noConfetti||Ue.realistic())}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=ht({type:e,selectors:[["cooee-progressbar"]],inputs:{cart:"cart"},features:[dt],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(r,o){r&1&&mt(0,li,9,8),r&2&&gt(o.calculatedState().milestonesReady?0:-1)},dependencies:[Ve,me,rn],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))}
12
+ `],encapsulation:3})};var fi=["numberVariable"],$e=class e extends Qt{numberSlot;savingsBarConfig;textParts=zt({start:"",end:""});globalIntervals=[];constructor(){super()}ngAfterViewInit(){this.updateUIVars()}engagementTriggerReceived(t){this.savingsBarConfig=t.content.savingsBarConfig,this.elementRef.nativeElement.classList.add("lc_"+t.entryAnimation?.toLowerCase()),this.savingsBarConfig.iconURL&&this.elementRef.nativeElement.style.setProperty("--lc-discount-icon",this.savingsBarConfig.iconURL)}update(){this.updateUIVars()}updateUIVars(){let t=Pt(Pt({},this.engagementTrigger.getCartMagicVariables()),en("total_savings",this.savingsBarConfig.totalSavings)),r=ge(this.savingsBarConfig.text,{cart:t},this.triggerContext),o=r.match(/[\d.,]+/)?.[0];if(!o){vt.error("No amount found in text",r);return}let[p,l]=r.split(o);this.textParts.set({start:p,end:l}),this.savingsBarConfig.animateNumber?this.runAnimation(o):this.numberSlot.nativeElement.innerHTML=o}runSlotMachineAnimation(t="0"){let r=this.numberSlot.nativeElement;r.innerHTML="";let o=this.savingsBarConfig.animationDuration/t.length;this.clearPreviousIntervals();for(let p=0;p<t.length;p++){let l=document.createElement("div");l.className="digit",l.style.display="inline-block",r.appendChild(l);let a=setInterval(()=>{let d=Math.floor(Math.random()*10);l.innerHTML=`<div>${d}</div>`},50);this.globalIntervals.push(a),setTimeout(()=>{clearInterval(a);let d=t?.[p]??Math.floor(Math.random()*10);l.innerHTML=`${d}`},(p+1)*o)}}clearPreviousIntervals(){this.globalIntervals.forEach(clearInterval),this.globalIntervals=[]}runIncrementalAnimation(t){let r=performance.now(),o=p=>{let l=Math.min((p-r)/this.savingsBarConfig.animationDuration,1);this.numberSlot.nativeElement.innerHTML=Math.floor(t*l).toString(),l<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}runAnimation(t){this.savingsBarConfig.animation==="SLOT_MACHINE"?this.runSlotMachineAnimation(t):this.savingsBarConfig.animation==="INCREMENTAL"&&this.runIncrementalAnimation(Number(t))}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=ht({type:e,selectors:[["cooee-savings-bar"]],viewQuery:function(r,o){if(r&1&&Ae(fi,5),r&2){let p;Me(p=De())&&(o.numberSlot=p.first)}},features:[dt],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(r,o){r&1&&(At(0,"div",1),Nt(1,"div",2)(2,"div",3)(3,"div",4,0)(5,"div",5),Vt()),r&2&&(J(2),_t("innerHTML",o.textParts().start,Bt),J(3),_t("innerHTML",o.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}
13
+ `],encapsulation:3})};var ui=(e,t)=>({enter:e,exit:t});function pi(e,t){if(e&1&&(rt(0,"div",7),Dt(1),nt(),rt(2,"div",8),Dt(3),nt()),e&2){let r=Z(2);J(),pe(" ",r.getCurrency(r.selectedVariant().price.cmp)," "),J(2),pe(" ",r.getDiscountPercentage(r.selectedVariant().price),"% off ")}}function hi(e,t){if(e&1&&(rt(0,"div",6),Dt(1),nt()),e&2){let r=Z(2);J(),pe(" ",r.stickyATCConfig.leftText," ")}}function di(e,t){if(e&1&&(rt(0,"div",1)(1,"div",5),Dt(2),nt(),mt(3,pi,4,2),mt(4,hi,2,1,"div",6),nt()),e&2){let r=Z();J(2),pe(" ",r.getCurrency(r.selectedVariant().price.d)," "),J(),gt(r.selectedVariant().price.cmp?3:-1),J(),gt(r.stickyATCConfig.leftText?4:-1)}}function mi(e,t){if(e&1&&(rt(0,"div",9),Dt(1),nt()),e&2){let r=t.$implicit,o=t.$index;Z(2);let p=qt(5);yt("ngClass",Wr(2,ui,o===p.currentIndex,o===p.previousIndex)),J(),pe(" ",r," ")}}function gi(e,t){if(e&1&&(rt(0,"div",4),Ct(1,mi,2,5,"div",9,Vr),nt()),e&2){Z();let r=qt(5);J(),It(r.features)}}var ke=class e extends Qt{currentItem;stickyATCConfig;selectedVariant=zt(void 0);featureSlider=zt({features:[],currentIndex:0});constructor(){super()}engagementTriggerReceived(t){this.stickyATCConfig=t.stickyATCConfig??{},this.currentItem=t.items[0],this.selectedVariant.set(this.currentItem.vars[0]),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation()}update(){}getCurrency(t){return de(t)}getDiscountPercentage(t){return((t.cmp-t.d)/t.cmp*100).toFixed(0)}async addToCart(){this.executeCTAViaRenderer({clickAction:{at:102},item:this.currentItem})}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let t=this.stickyATCConfig.rightText.split(`
14
+ `),r=t.length===1?null:setInterval(()=>{this.featureSlider.update(o=>er(Pt({},o),{previousIndex:o.currentIndex,currentIndex:(o.currentIndex+1)%o.features.length}))},3e3);this.featureSlider.set({intervalRef:r,currentIndex:0,features:t})}replaceVariables(t){return t?ge(t,this.currentItem.getTemplateVariables(),this.triggerContext):""}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=ht({type:e,selectors:[["cooee-sticky-atc"]],features:[dt],decls:7,vars:3,consts:[[1,"lc-wrapper"],[1,"lc-prices"],[1,"lc-button-wrapper"],["type","button",1,"lc-button","lc-button-atc",3,"click"],[1,"lc-features"],[1,"lc-sale-price"],[1,"lc-additional-text"],[1,"lc-compare-price"],[1,"lc-discount-label"],[1,"lc-feature",3,"ngClass"]],template:function(r,o){if(r&1){let p=Yt();rt(0,"div",0),mt(1,di,5,3,"div",1),rt(2,"div",2)(3,"button",3),Mt("click",function(){return at(p),ct(o.addToCart())}),Dt(4,"Add To Cart"),nt(),Se(5),mt(6,gi,3,0,"div",4),nt()()}if(r&2){J(),gt(o.selectedVariant()&&o.stickyATCConfig.showProductInfo?1:-1),J(4);let p=ne(o.featureSlider());J(),gt(p.features.length?6:-1)}},dependencies:[Re],styles:[`:host{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media (min-width: 768px){.lc-prices{gap:8px}}.lc-sale-price{font-size:24px;font-weight:600}.lc-compare-price{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label{font-size:12px;font-weight:500;color:green}.lc-button-wrapper{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button{background-color:#000;color:#fff;opacity:1;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text,.lc-feature{font-size:12px;color:#666}.lc-features{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features .lc-feature{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features .lc-feature.enter{opacity:1;transform:translateY(0);z-index:2}.lc-features .lc-feature.exit{opacity:0;transform:translateY(-100%);z-index:1}
15
+ `],encapsulation:3})};function yi(e,t){return t={exports:{}},e(t,t.exports),t.exports}var vi=xi,wi=Si,_i=Ni,$t=[],Tt=[],bi=typeof Uint8Array<"u"?Uint8Array:Array,hr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(se=0,mn=hr.length;se<mn;++se)$t[se]=hr[se],Tt[hr.charCodeAt(se)]=se;var se,mn;Tt[45]=62;Tt[95]=63;function An(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}function xi(e){var t=An(e),r=t[0],o=t[1];return(r+o)*3/4-o}function Ei(e,t,r){return(t+r)*3/4-r}function Si(e){var t,r=An(e),o=r[0],p=r[1],l=new bi(Ei(e,o,p)),a=0,d=p>0?o-4:o,v;for(v=0;v<d;v+=4)t=Tt[e.charCodeAt(v)]<<18|Tt[e.charCodeAt(v+1)]<<12|Tt[e.charCodeAt(v+2)]<<6|Tt[e.charCodeAt(v+3)],l[a++]=t>>16&255,l[a++]=t>>8&255,l[a++]=t&255;return p===2&&(t=Tt[e.charCodeAt(v)]<<2|Tt[e.charCodeAt(v+1)]>>4,l[a++]=t&255),p===1&&(t=Tt[e.charCodeAt(v)]<<10|Tt[e.charCodeAt(v+1)]<<4|Tt[e.charCodeAt(v+2)]>>2,l[a++]=t>>8&255,l[a++]=t&255),l}function Ci(e){return $t[e>>18&63]+$t[e>>12&63]+$t[e>>6&63]+$t[e&63]}function Ii(e,t,r){for(var o,p=[],l=t;l<r;l+=3)o=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),p.push(Ci(o));return p.join("")}function Ni(e){for(var t,r=e.length,o=r%3,p=[],l=16383,a=0,d=r-o;a<d;a+=l)p.push(Ii(e,a,a+l>d?d:a+l));return o===1?(t=e[r-1],p.push($t[t>>2]+$t[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],p.push($t[t>>10]+$t[t>>4&63]+$t[t<<2&63]+"=")),p.join("")}var dr={byteLength:vi,toByteArray:wi,fromByteArray:_i};var Oi=function(t,r,o,p,l){var a,d,v=l*8-p-1,E=(1<<v)-1,C=E>>1,S=-7,I=o?l-1:0,z=o?-1:1,P=t[r+I];for(I+=z,a=P&(1<<-S)-1,P>>=-S,S+=v;S>0;a=a*256+t[r+I],I+=z,S-=8);for(d=a&(1<<-S)-1,a>>=-S,S+=p;S>0;d=d*256+t[r+I],I+=z,S-=8);if(a===0)a=1-C;else{if(a===E)return d?NaN:(P?-1:1)*(1/0);d=d+Math.pow(2,p),a=a-C}return(P?-1:1)*d*Math.pow(2,a-p)},Ti=function(t,r,o,p,l,a){var d,v,E,C=a*8-l-1,S=(1<<C)-1,I=S>>1,z=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=p?0:a-1,Y=p?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(v=isNaN(r)?1:0,d=S):(d=Math.floor(Math.log(r)/Math.LN2),r*(E=Math.pow(2,-d))<1&&(d--,E*=2),d+I>=1?r+=z/E:r+=z*Math.pow(2,1-I),r*E>=2&&(d++,E/=2),d+I>=S?(v=0,d=S):d+I>=1?(v=(r*E-1)*Math.pow(2,l),d=d+I):(v=r*Math.pow(2,I-1)*Math.pow(2,l),d=0));l>=8;t[o+P]=v&255,P+=Y,v/=256,l-=8);for(d=d<<l|v,C+=l;C>0;t[o+P]=d&255,P+=Y,d/=256,C-=8);t[o+P-Y]|=k*128},ve={read:Oi,write:Ti},We=yi(function(e,t){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=et,t.INSPECT_MAX_BYTES=50;var o=2147483647;t.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=p(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function p(){try{var s=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(s,n),s.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function l(s){if(s>o)throw new RangeError('The value "'+s+'" is invalid for option "size"');var n=new Uint8Array(s);return Object.setPrototypeOf(n,a.prototype),n}function a(s,n,i){if(typeof s=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(s)}return d(s,n,i)}a.poolSize=8192;function d(s,n,i){if(typeof s=="string")return S(s,n);if(ArrayBuffer.isView(s))return z(s);if(s==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(s));if(U(s,ArrayBuffer)||s&&U(s.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(U(s,SharedArrayBuffer)||s&&U(s.buffer,SharedArrayBuffer)))return P(s,n,i);if(typeof s=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var c=s.valueOf&&s.valueOf();if(c!=null&&c!==s)return a.from(c,n,i);var h=Y(s);if(h)return h;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof s[Symbol.toPrimitive]=="function")return a.from(s[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(s))}a.from=function(s,n,i){return d(s,n,i)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function v(s){if(typeof s!="number")throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function E(s,n,i){return v(s),s<=0?l(s):n!==void 0?typeof i=="string"?l(s).fill(n,i):l(s).fill(n):l(s)}a.alloc=function(s,n,i){return E(s,n,i)};function C(s){return v(s),l(s<0?0:k(s)|0)}a.allocUnsafe=function(s){return C(s)},a.allocUnsafeSlow=function(s){return C(s)};function S(s,n){if((typeof n!="string"||n==="")&&(n="utf8"),!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=X(s,n)|0,c=l(i),h=c.write(s,n);return h!==i&&(c=c.slice(0,h)),c}function I(s){for(var n=s.length<0?0:k(s.length)|0,i=l(n),c=0;c<n;c+=1)i[c]=s[c]&255;return i}function z(s){if(U(s,Uint8Array)){var n=new Uint8Array(s);return P(n.buffer,n.byteOffset,n.byteLength)}return I(s)}function P(s,n,i){if(n<0||s.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');var c;return n===void 0&&i===void 0?c=new Uint8Array(s):i===void 0?c=new Uint8Array(s,n):c=new Uint8Array(s,n,i),Object.setPrototypeOf(c,a.prototype),c}function Y(s){if(a.isBuffer(s)){var n=k(s.length)|0,i=l(n);return i.length===0||s.copy(i,0,0,n),i}if(s.length!==void 0)return typeof s.length!="number"||j(s.length)?l(0):I(s);if(s.type==="Buffer"&&Array.isArray(s.data))return I(s.data)}function k(s){if(s>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return s|0}function et(s){return+s!=s&&(s=0),a.alloc(+s)}a.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==a.prototype},a.compare=function(n,i){if(U(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),U(i,Uint8Array)&&(i=a.from(i,i.offset,i.byteLength)),!a.isBuffer(n)||!a.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;for(var c=n.length,h=i.length,y=0,_=Math.min(c,h);y<_;++y)if(n[y]!==i[y]){c=n[y],h=i[y];break}return c<h?-1:h<c?1:0},a.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return a.alloc(0);var c;if(i===void 0)for(i=0,c=0;c<n.length;++c)i+=n[c].length;var h=a.allocUnsafe(i),y=0;for(c=0;c<n.length;++c){var _=n[c];if(U(_,Uint8Array))y+_.length>h.length?a.from(_).copy(h,y):Uint8Array.prototype.set.call(h,_,y);else if(a.isBuffer(_))_.copy(h,y);else throw new TypeError('"list" argument must be an Array of Buffers');y+=_.length}return h};function X(s,n){if(a.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||U(s,ArrayBuffer))return s.byteLength;if(typeof s!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(s));var i=s.length,c=arguments.length>2&&arguments[2]===!0;if(!c&&i===0)return 0;for(var h=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return O(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return V(s).length;default:if(h)return c?-1:O(s).length;n=(""+n).toLowerCase(),h=!0}}a.byteLength=X;function K(s,n,i){var c=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(s||(s="utf8");;)switch(s){case"hex":return b(this,n,i);case"utf8":case"utf-8":return xt(this,n,i);case"ascii":return g(this,n,i);case"latin1":case"binary":return m(this,n,i);case"base64":return wt(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,n,i);default:if(c)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),c=!0}}a.prototype._isBuffer=!0;function T(s,n,i){var c=s[n];s[n]=s[i],s[i]=c}a.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<n;i+=2)T(this,i,i+1);return this},a.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<n;i+=4)T(this,i,i+3),T(this,i+1,i+2);return this},a.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<n;i+=8)T(this,i,i+7),T(this,i+1,i+6),T(this,i+2,i+5),T(this,i+3,i+4);return this},a.prototype.toString=function(){var n=this.length;return n===0?"":arguments.length===0?xt(this,0,n):K.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(n){if(!a.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:a.compare(this,n)===0},a.prototype.inspect=function(){var n="",i=t.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(n,i,c,h,y){if(U(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(n));if(i===void 0&&(i=0),c===void 0&&(c=n?n.length:0),h===void 0&&(h=0),y===void 0&&(y=this.length),i<0||c>n.length||h<0||y>this.length)throw new RangeError("out of range index");if(h>=y&&i>=c)return 0;if(h>=y)return-1;if(i>=c)return 1;if(i>>>=0,c>>>=0,h>>>=0,y>>>=0,this===n)return 0;for(var _=y-h,H=c-i,q=Math.min(_,H),W=this.slice(h,y),Q=n.slice(i,c),tt=0;tt<q;++tt)if(W[tt]!==Q[tt]){_=W[tt],H=Q[tt];break}return _<H?-1:H<_?1:0};function it(s,n,i,c,h){if(s.length===0)return-1;if(typeof i=="string"?(c=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,j(i)&&(i=h?0:s.length-1),i<0&&(i=s.length+i),i>=s.length){if(h)return-1;i=s.length-1}else if(i<0)if(h)i=0;else return-1;if(typeof n=="string"&&(n=a.from(n,c)),a.isBuffer(n))return n.length===0?-1:ut(s,n,i,c,h);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?h?Uint8Array.prototype.indexOf.call(s,n,i):Uint8Array.prototype.lastIndexOf.call(s,n,i):ut(s,[n],i,c,h);throw new TypeError("val must be string, number or Buffer")}function ut(s,n,i,c,h){var y=1,_=s.length,H=n.length;if(c!==void 0&&(c=String(c).toLowerCase(),c==="ucs2"||c==="ucs-2"||c==="utf16le"||c==="utf-16le")){if(s.length<2||n.length<2)return-1;y=2,_/=2,H/=2,i/=2}function q(Ft,Ht){return y===1?Ft[Ht]:Ft.readUInt16BE(Ht*y)}var W;if(h){var Q=-1;for(W=i;W<_;W++)if(q(s,W)===q(n,Q===-1?0:W-Q)){if(Q===-1&&(Q=W),W-Q+1===H)return Q*y}else Q!==-1&&(W-=W-Q),Q=-1}else for(i+H>_&&(i=_-H),W=i;W>=0;W--){for(var tt=!0,st=0;st<H;st++)if(q(s,W+st)!==q(n,st)){tt=!1;break}if(tt)return W}return-1}a.prototype.includes=function(n,i,c){return this.indexOf(n,i,c)!==-1},a.prototype.indexOf=function(n,i,c){return it(this,n,i,c,!0)},a.prototype.lastIndexOf=function(n,i,c){return it(this,n,i,c,!1)};function bt(s,n,i,c){i=Number(i)||0;var h=s.length-i;c?(c=Number(c),c>h&&(c=h)):c=h;var y=n.length;c>y/2&&(c=y/2);for(var _=0;_<c;++_){var H=parseInt(n.substr(_*2,2),16);if(j(H))return _;s[i+_]=H}return _}function Xt(s,n,i,c){return F(O(n,s.length-i),s,i,c)}function Rt(s,n,i,c){return F(R(n),s,i,c)}function Kt(s,n,i,c){return F(V(n),s,i,c)}function kt(s,n,i,c){return F(B(n,s.length-i),s,i,c)}a.prototype.write=function(n,i,c,h){if(i===void 0)h="utf8",c=this.length,i=0;else if(c===void 0&&typeof i=="string")h=i,c=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(c)?(c=c>>>0,h===void 0&&(h="utf8")):(h=c,c=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var y=this.length-i;if((c===void 0||c>y)&&(c=y),n.length>0&&(c<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");h||(h="utf8");for(var _=!1;;)switch(h){case"hex":return bt(this,n,i,c);case"utf8":case"utf-8":return Xt(this,n,i,c);case"ascii":case"latin1":case"binary":return Rt(this,n,i,c);case"base64":return Kt(this,n,i,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return kt(this,n,i,c);default:if(_)throw new TypeError("Unknown encoding: "+h);h=(""+h).toLowerCase(),_=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wt(s,n,i){return n===0&&i===s.length?dr.fromByteArray(s):dr.fromByteArray(s.slice(n,i))}function xt(s,n,i){i=Math.min(s.length,i);for(var c=[],h=n;h<i;){var y=s[h],_=null,H=y>239?4:y>223?3:y>191?2:1;if(h+H<=i){var q,W,Q,tt;switch(H){case 1:y<128&&(_=y);break;case 2:q=s[h+1],(q&192)===128&&(tt=(y&31)<<6|q&63,tt>127&&(_=tt));break;case 3:q=s[h+1],W=s[h+2],(q&192)===128&&(W&192)===128&&(tt=(y&15)<<12|(q&63)<<6|W&63,tt>2047&&(tt<55296||tt>57343)&&(_=tt));break;case 4:q=s[h+1],W=s[h+2],Q=s[h+3],(q&192)===128&&(W&192)===128&&(Q&192)===128&&(tt=(y&15)<<18|(q&63)<<12|(W&63)<<6|Q&63,tt>65535&&tt<1114112&&(_=tt))}}_===null?(_=65533,H=1):_>65535&&(_-=65536,c.push(_>>>10&1023|55296),_=56320|_&1023),c.push(_),h+=H}return Et(c)}var pt=4096;function Et(s){var n=s.length;if(n<=pt)return String.fromCharCode.apply(String,s);for(var i="",c=0;c<n;)i+=String.fromCharCode.apply(String,s.slice(c,c+=pt));return i}function g(s,n,i){var c="";i=Math.min(s.length,i);for(var h=n;h<i;++h)c+=String.fromCharCode(s[h]&127);return c}function m(s,n,i){var c="";i=Math.min(s.length,i);for(var h=n;h<i;++h)c+=String.fromCharCode(s[h]);return c}function b(s,n,i){var c=s.length;(!n||n<0)&&(n=0),(!i||i<0||i>c)&&(i=c);for(var h="",y=n;y<i;++y)h+=$[s[y]];return h}function w(s,n,i){for(var c=s.slice(n,i),h="",y=0;y<c.length-1;y+=2)h+=String.fromCharCode(c[y]+c[y+1]*256);return h}a.prototype.slice=function(n,i){var c=this.length;n=~~n,i=i===void 0?c:~~i,n<0?(n+=c,n<0&&(n=0)):n>c&&(n=c),i<0?(i+=c,i<0&&(i=0)):i>c&&(i=c),i<n&&(i=n);var h=this.subarray(n,i);return Object.setPrototypeOf(h,a.prototype),h};function f(s,n,i){if(s%1!==0||s<0)throw new RangeError("offset is not uint");if(s+n>i)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(n,i,c){n=n>>>0,i=i>>>0,c||f(n,i,this.length);for(var h=this[n],y=1,_=0;++_<i&&(y*=256);)h+=this[n+_]*y;return h},a.prototype.readUintBE=a.prototype.readUIntBE=function(n,i,c){n=n>>>0,i=i>>>0,c||f(n,i,this.length);for(var h=this[n+--i],y=1;i>0&&(y*=256);)h+=this[n+--i]*y;return h},a.prototype.readUint8=a.prototype.readUInt8=function(n,i){return n=n>>>0,i||f(n,1,this.length),this[n]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||f(n,2,this.length),this[n]|this[n+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||f(n,2,this.length),this[n]<<8|this[n+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||f(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||f(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},a.prototype.readIntLE=function(n,i,c){n=n>>>0,i=i>>>0,c||f(n,i,this.length);for(var h=this[n],y=1,_=0;++_<i&&(y*=256);)h+=this[n+_]*y;return y*=128,h>=y&&(h-=Math.pow(2,8*i)),h},a.prototype.readIntBE=function(n,i,c){n=n>>>0,i=i>>>0,c||f(n,i,this.length);for(var h=i,y=1,_=this[n+--h];h>0&&(y*=256);)_+=this[n+--h]*y;return y*=128,_>=y&&(_-=Math.pow(2,8*i)),_},a.prototype.readInt8=function(n,i){return n=n>>>0,i||f(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},a.prototype.readInt16LE=function(n,i){n=n>>>0,i||f(n,2,this.length);var c=this[n]|this[n+1]<<8;return c&32768?c|4294901760:c},a.prototype.readInt16BE=function(n,i){n=n>>>0,i||f(n,2,this.length);var c=this[n+1]|this[n]<<8;return c&32768?c|4294901760:c},a.prototype.readInt32LE=function(n,i){return n=n>>>0,i||f(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},a.prototype.readInt32BE=function(n,i){return n=n>>>0,i||f(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},a.prototype.readFloatLE=function(n,i){return n=n>>>0,i||f(n,4,this.length),ve.read(this,n,!0,23,4)},a.prototype.readFloatBE=function(n,i){return n=n>>>0,i||f(n,4,this.length),ve.read(this,n,!1,23,4)},a.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||f(n,8,this.length),ve.read(this,n,!0,52,8)},a.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||f(n,8,this.length),ve.read(this,n,!1,52,8)};function u(s,n,i,c,h,y){if(!a.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>h||n<y)throw new RangeError('"value" argument is out of bounds');if(i+c>s.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(n,i,c,h){if(n=+n,i=i>>>0,c=c>>>0,!h){var y=Math.pow(2,8*c)-1;u(this,n,i,c,y,0)}var _=1,H=0;for(this[i]=n&255;++H<c&&(_*=256);)this[i+H]=n/_&255;return i+c},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(n,i,c,h){if(n=+n,i=i>>>0,c=c>>>0,!h){var y=Math.pow(2,8*c)-1;u(this,n,i,c,y,0)}var _=c-1,H=1;for(this[i+_]=n&255;--_>=0&&(H*=256);)this[i+_]=n/H&255;return i+c},a.prototype.writeUint8=a.prototype.writeUInt8=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,1,255,0),this[i]=n&255,i+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},a.prototype.writeIntLE=function(n,i,c,h){if(n=+n,i=i>>>0,!h){var y=Math.pow(2,8*c-1);u(this,n,i,c,y-1,-y)}var _=0,H=1,q=0;for(this[i]=n&255;++_<c&&(H*=256);)n<0&&q===0&&this[i+_-1]!==0&&(q=1),this[i+_]=(n/H>>0)-q&255;return i+c},a.prototype.writeIntBE=function(n,i,c,h){if(n=+n,i=i>>>0,!h){var y=Math.pow(2,8*c-1);u(this,n,i,c,y-1,-y)}var _=c-1,H=1,q=0;for(this[i+_]=n&255;--_>=0&&(H*=256);)n<0&&q===0&&this[i+_+1]!==0&&(q=1),this[i+_]=(n/H>>0)-q&255;return i+c},a.prototype.writeInt8=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},a.prototype.writeInt16LE=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeInt16BE=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeInt32LE=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},a.prototype.writeInt32BE=function(n,i,c){return n=+n,i=i>>>0,c||u(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function x(s,n,i,c,h,y){if(i+c>s.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function N(s,n,i,c,h){return n=+n,i=i>>>0,h||x(s,n,i,4),ve.write(s,n,i,c,23,4),i+4}a.prototype.writeFloatLE=function(n,i,c){return N(this,n,i,!0,c)},a.prototype.writeFloatBE=function(n,i,c){return N(this,n,i,!1,c)};function A(s,n,i,c,h){return n=+n,i=i>>>0,h||x(s,n,i,8),ve.write(s,n,i,c,52,8),i+8}a.prototype.writeDoubleLE=function(n,i,c){return A(this,n,i,!0,c)},a.prototype.writeDoubleBE=function(n,i,c){return A(this,n,i,!1,c)},a.prototype.copy=function(n,i,c,h){if(!a.isBuffer(n))throw new TypeError("argument should be a Buffer");if(c||(c=0),!h&&h!==0&&(h=this.length),i>=n.length&&(i=n.length),i||(i=0),h>0&&h<c&&(h=c),h===c||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("sourceEnd out of bounds");h>this.length&&(h=this.length),n.length-i<h-c&&(h=n.length-i+c);var y=h-c;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,c,h):Uint8Array.prototype.set.call(n,this.subarray(c,h),i),y},a.prototype.fill=function(n,i,c,h){if(typeof n=="string"){if(typeof i=="string"?(h=i,i=0,c=this.length):typeof c=="string"&&(h=c,c=this.length),h!==void 0&&typeof h!="string")throw new TypeError("encoding must be a string");if(typeof h=="string"&&!a.isEncoding(h))throw new TypeError("Unknown encoding: "+h);if(n.length===1){var y=n.charCodeAt(0);(h==="utf8"&&y<128||h==="latin1")&&(n=y)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<c)throw new RangeError("Out of range index");if(c<=i)return this;i=i>>>0,c=c===void 0?this.length:c>>>0,n||(n=0);var _;if(typeof n=="number")for(_=i;_<c;++_)this[_]=n;else{var H=a.isBuffer(n)?n:a.from(n,h),q=H.length;if(q===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(_=0;_<c-i;++_)this[_+i]=H[_%q]}return this};var M=/[^+/0-9A-Za-z-_]/g;function L(s){if(s=s.split("=")[0],s=s.trim().replace(M,""),s.length<2)return"";for(;s.length%4!==0;)s=s+"=";return s}function O(s,n){n=n||1/0;for(var i,c=s.length,h=null,y=[],_=0;_<c;++_){if(i=s.charCodeAt(_),i>55295&&i<57344){if(!h){if(i>56319){(n-=3)>-1&&y.push(239,191,189);continue}else if(_+1===c){(n-=3)>-1&&y.push(239,191,189);continue}h=i;continue}if(i<56320){(n-=3)>-1&&y.push(239,191,189),h=i;continue}i=(h-55296<<10|i-56320)+65536}else h&&(n-=3)>-1&&y.push(239,191,189);if(h=null,i<128){if((n-=1)<0)break;y.push(i)}else if(i<2048){if((n-=2)<0)break;y.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;y.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;y.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return y}function R(s){for(var n=[],i=0;i<s.length;++i)n.push(s.charCodeAt(i)&255);return n}function B(s,n){for(var i,c,h,y=[],_=0;_<s.length&&!((n-=2)<0);++_)i=s.charCodeAt(_),c=i>>8,h=i%256,y.push(h),y.push(c);return y}function V(s){return dr.toByteArray(L(s))}function F(s,n,i,c){for(var h=0;h<c&&!(h+i>=n.length||h>=s.length);++h)n[h+i]=s[h];return h}function U(s,n){return s instanceof n||s!=null&&s.constructor!=null&&s.constructor.name!=null&&s.constructor.name===n.name}function j(s){return s!==s}var $=function(){for(var s="0123456789abcdef",n=new Array(256),i=0;i<16;++i)for(var c=i*16,h=0;h<16;++h)n[c+h]=s[i]+s[h];return n}()}),G=We.Buffer;We.SlowBuffer;We.INSPECT_MAX_BYTES;We.kMaxLength;var wr=function(t,r){return wr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,p){o.__proto__=p}||function(o,p){for(var l in p)p.hasOwnProperty(l)&&(o[l]=p[l])},wr(t,r)};function Ye(e,t){wr(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ce=function(e){Ye(t,e);function t(r){var o=e.call(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),t}(Error),ot=function(e){Ye(t,e);function t(r){var o=e.call(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),t}(TypeError);function He(e){return e&&e.Math==Math&&e}function Mn(){return He(typeof globalThis=="object"&&globalThis)||He(typeof window=="object"&&window)||He(typeof self=="object"&&self)||He(typeof global=="object"&&global)||Function("return this")()}function Bi(){var e=Mn();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var Ai=function(t){var r=Bi()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var o=G.alloc(t),p=0;p<t;++p)o[p]=Math.floor(Math.random()*256);return o},Mi=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(G.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(G.alloc(t))}:Ai}},Dn=Mi();function Di(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function br(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function Ri(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Fi(e){return Oe(e)&&Object.prototype.toString.call(e)==="[object Date]"}function Oe(e){return typeof e=="object"&&e!==null}function Je(e,t){var r=!1;function o(){for(var p=[],l=0;l<arguments.length;l++)p[l]=arguments[l];return r||(console.warn(t),r=!0),e.apply(this,p)}return o}function ze(e){if(ArrayBuffer.isView(e))return G.from(e.buffer,e.byteOffset,e.byteLength);if(Di(e))return G.from(e);throw new ot("Must use either Buffer or TypedArray")}var Li=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,Rn=function(e){return typeof e=="string"&&Li.test(e)},_r=function(e){if(!Rn(e))throw new ot('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var t=e.replace(/-/g,"");return G.from(t,"hex")},gn=function(e,t){return t===void 0&&(t=!0),t?e.toString("hex",0,4)+"-"+e.toString("hex",4,6)+"-"+e.toString("hex",6,8)+"-"+e.toString("hex",8,10)+"-"+e.toString("hex",10,16):e.toString("hex")};var $s=Math.pow(2,63)-1,ks=-Math.pow(2,63),Pi=Math.pow(2,53),Vi=-Math.pow(2,53);var Fn=4;var le=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(t!=null&&typeof t!="string"&&!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer)&&!Array.isArray(t))throw new ot("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??e.BSON_BINARY_SUBTYPE_DEFAULT,t==null?(this.buffer=G.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=G.from(t,"binary"):Array.isArray(t)?this.buffer=G.from(t):this.buffer=ze(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new ot("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new ot("only accepts single character Uint8Array or Array");var r;if(typeof t=="string"?r=t.charCodeAt(0):typeof t=="number"?r=t:r=t[0],r<0||r>255)throw new ot("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var o=G.alloc(e.BUFFER_SIZE+this.buffer.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o,this.buffer[this.position++]=r}},e.prototype.write=function(t,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+t.length){var o=G.alloc(this.buffer.length+t.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o}ArrayBuffer.isView(t)?(this.buffer.set(ze(t),r),this.position=r+t.byteLength>this.position?r+t.length:this.position):typeof t=="string"&&(this.buffer.write(t,r,t.length,"binary"),this.position=r+t.length>this.position?r+t.length:this.position)},e.prototype.read=function(t,r){return r=r&&r>0?r:this.position,this.buffer.slice(t,t+r)},e.prototype.value=function(t){return t=!!t,t&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},e.prototype.length=function(){return this.position},e.prototype.toJSON=function(){return this.buffer.toString("base64")},e.prototype.toString=function(t){return this.buffer.toString(t)},e.prototype.toExtendedJSON=function(t){t=t||{};var r=this.buffer.toString("base64"),o=Number(this.sub_type).toString(16);return t.legacy?{$binary:r,$type:o.length===1?"0"+o:o}:{$binary:{base64:r,subType:o.length===1?"0"+o:o}}},e.prototype.toUUID=function(){if(this.sub_type===e.SUBTYPE_UUID)return new yn(this.buffer.slice(0,this.position));throw new ce('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(e.SUBTYPE_UUID,'" is currently supported.'))},e.fromExtendedJSON=function(t,r){r=r||{};var o,p;if("$binary"in t?r.legacy&&typeof t.$binary=="string"&&"$type"in t?(p=t.$type?parseInt(t.$type,16):0,o=G.from(t.$binary,"base64")):typeof t.$binary!="string"&&(p=t.$binary.subType?parseInt(t.$binary.subType,16):0,o=G.from(t.$binary.base64,"base64")):"$uuid"in t&&(p=4,o=_r(t.$uuid)),!o)throw new ot("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return p===Fn?new yn(o):new e(o,p)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.value(!0);return'new Binary(Buffer.from("'.concat(t.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BUFFER_SIZE=256,e.SUBTYPE_DEFAULT=0,e.SUBTYPE_FUNCTION=1,e.SUBTYPE_BYTE_ARRAY=2,e.SUBTYPE_UUID_OLD=3,e.SUBTYPE_UUID=4,e.SUBTYPE_MD5=5,e.SUBTYPE_ENCRYPTED=6,e.SUBTYPE_COLUMN=7,e.SUBTYPE_USER_DEFINED=128,e}();Object.defineProperty(le.prototype,"_bsontype",{value:"Binary"});var mr=16,yn=function(e){Ye(t,e);function t(r){var o=this,p,l;if(r==null)p=t.generate();else if(r instanceof t)p=G.from(r.buffer),l=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===mr)p=ze(r);else if(typeof r=="string")p=_r(r);else throw new ot("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return o=e.call(this,p,Fn)||this,o.__id=l,o}return Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,t.cacheHexString&&(this.__id=gn(r))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(r){if(r===void 0&&(r=!0),t.cacheHexString&&this.__id)return this.__id;var o=gn(this.id,r);return t.cacheHexString&&(this.__id=o),o},t.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(r){if(!r)return!1;if(r instanceof t)return r.id.equals(this.id);try{return new t(r).id.equals(this.id)}catch{return!1}},t.prototype.toBinary=function(){return new le(this.id,le.SUBTYPE_UUID)},t.generate=function(){var r=Dn(mr);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,G.from(r)},t.isValid=function(r){return r?r instanceof t?!0:typeof r=="string"?Rn(r):br(r)?r.length!==mr?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},t.createFromHexString=function(r){var o=_r(r);return new t(o)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t}(le),qe=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);this.code=t,this.scope=r}return e.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},e.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},e.fromExtendedJSON=function(t){return new e(t.$code,t.$scope)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toJSON();return'new Code("'.concat(String(t.code),'"').concat(t.scope?", ".concat(JSON.stringify(t.scope)):"",")")},e}();Object.defineProperty(qe.prototype,"_bsontype",{value:"Code"});function Ui(e){return Oe(e)&&e.$id!=null&&typeof e.$ref=="string"&&(e.$db==null||typeof e.$db=="string")}var Ie=function(){function e(t,r,o,p){if(!(this instanceof e))return new e(t,r,o,p);var l=t.split(".");l.length===2&&(o=l.shift(),t=l.shift()),this.collection=t,this.oid=r,this.db=o,this.fields=p||{}}return Object.defineProperty(e.prototype,"namespace",{get:function(){return this.collection},set:function(t){this.collection=t},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(t.$db=this.db),t},e.prototype.toExtendedJSON=function(t){t=t||{};var r={$ref:this.collection,$id:this.oid};return t.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},e.fromExtendedJSON=function(t){var r=Object.assign({},t);return delete r.$ref,delete r.$id,delete r.$db,new e(t.$ref,t.$id,t.$db,r)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(t),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},e}();Object.defineProperty(Ie.prototype,"_bsontype",{value:"DBRef"});var Ot=void 0;try{Ot=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var vn=65536,ji=1<<24,_e=vn*vn,Ln=_e*_e,wn=Ln/2,_n={},bn={},D=function(){function e(t,r,o){if(t===void 0&&(t=0),!(this instanceof e))return new e(t,r,o);typeof t=="bigint"?Object.assign(this,e.fromBigInt(t,!!r)):typeof t=="string"?Object.assign(this,e.fromString(t,!!r)):(this.low=t|0,this.high=r|0,this.unsigned=!!o),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,r,o){return new e(t,r,o)},e.fromInt=function(t,r){var o,p,l;return r?(t>>>=0,(l=0<=t&&t<256)&&(p=bn[t],p)?p:(o=e.fromBits(t,(t|0)<0?-1:0,!0),l&&(bn[t]=o),o)):(t|=0,(l=-128<=t&&t<128)&&(p=_n[t],p)?p:(o=e.fromBits(t,t<0?-1:0,!1),l&&(_n[t]=o),o))},e.fromNumber=function(t,r){if(isNaN(t))return r?e.UZERO:e.ZERO;if(r){if(t<0)return e.UZERO;if(t>=Ln)return e.MAX_UNSIGNED_VALUE}else{if(t<=-wn)return e.MIN_VALUE;if(t+1>=wn)return e.MAX_VALUE}return t<0?e.fromNumber(-t,r).neg():e.fromBits(t%_e|0,t/_e|0,r)},e.fromBigInt=function(t,r){return e.fromString(t.toString(),r)},e.fromString=function(t,r,o){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e.ZERO;if(typeof r=="number"?(o=r,r=!1):r=!!r,o=o||10,o<2||36<o)throw RangeError("radix");var p;if((p=t.indexOf("-"))>0)throw Error("interior hyphen");if(p===0)return e.fromString(t.substring(1),r,o).neg();for(var l=e.fromNumber(Math.pow(o,8)),a=e.ZERO,d=0;d<t.length;d+=8){var v=Math.min(8,t.length-d),E=parseInt(t.substring(d,d+v),o);if(v<8){var C=e.fromNumber(Math.pow(o,v));a=a.mul(C).add(e.fromNumber(E))}else a=a.mul(l),a=a.add(e.fromNumber(E))}return a.unsigned=r,a},e.fromBytes=function(t,r,o){return o?e.fromBytesLE(t,r):e.fromBytesBE(t,r)},e.fromBytesLE=function(t,r){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},e.fromBytesBE=function(t,r){return new e(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},e.isLong=function(t){return Oe(t)&&t.__isLong__===!0},e.fromValue=function(t,r){return typeof t=="number"?e.fromNumber(t,r):typeof t=="string"?e.fromString(t,r):e.fromBits(t.low,t.high,typeof r=="boolean"?r:t.unsigned)},e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var r=this.high>>>16,o=this.high&65535,p=this.low>>>16,l=this.low&65535,a=t.high>>>16,d=t.high&65535,v=t.low>>>16,E=t.low&65535,C=0,S=0,I=0,z=0;return z+=l+E,I+=z>>>16,z&=65535,I+=p+v,S+=I>>>16,I&=65535,S+=o+d,C+=S>>>16,S&=65535,C+=r+a,C&=65535,e.fromBits(I<<16|z,C<<16|S,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(t)),this.eq(t))return 0;var r=this.isNegative(),o=t.isNegative();return r&&!o?-1:!r&&o?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},e.prototype.comp=function(t){return this.compare(t)},e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw Error("division by zero");if(Ot){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Ot.div_u:Ot.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,Ot.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var o,p,l;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;l=e.UZERO}else{if(this.eq(e.MIN_VALUE)){if(t.eq(e.ONE)||t.eq(e.NEG_ONE))return e.MIN_VALUE;if(t.eq(e.MIN_VALUE))return e.ONE;var a=this.shr(1);return o=a.div(t).shl(1),o.eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(p=this.sub(t.mul(o)),l=o.add(p.div(t)),l)}else if(t.eq(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();l=e.ZERO}for(p=this;p.gte(t);){o=Math.max(1,Math.floor(p.toNumber()/t.toNumber()));for(var d=Math.ceil(Math.log(o)/Math.LN2),v=d<=48?1:Math.pow(2,d-48),E=e.fromNumber(o),C=E.mul(t);C.isNegative()||C.gt(p);)o-=v,E=e.fromNumber(o,this.unsigned),C=E.mul(t);E.isZero()&&(E=e.ONE),l=l.add(E),p=p.sub(C)}return l},e.prototype.div=function(t){return this.divide(t)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},e.prototype.eq=function(t){return this.equals(t)},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(e.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(t&1<<r)===0;r--);return this.high!==0?r+33:r+1},e.prototype.greaterThan=function(t){return this.comp(t)>0},e.prototype.gt=function(t){return this.greaterThan(t)},e.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},e.prototype.gte=function(t){return this.greaterThanOrEqual(t)},e.prototype.ge=function(t){return this.greaterThanOrEqual(t)},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.lessThan=function(t){return this.comp(t)<0},e.prototype.lt=function(t){return this.lessThan(t)},e.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},e.prototype.lte=function(t){return this.lessThanOrEqual(t)},e.prototype.modulo=function(t){if(e.isLong(t)||(t=e.fromValue(t)),Ot){var r=(this.unsigned?Ot.rem_u:Ot.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,Ot.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},e.prototype.mod=function(t){return this.modulo(t)},e.prototype.rem=function(t){return this.modulo(t)},e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),Ot){var r=Ot.mul(this.low,this.high,t.low,t.high);return e.fromBits(r,Ot.get_high(),this.unsigned)}if(t.isZero())return e.ZERO;if(this.eq(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.eq(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(e.TWO_PWR_24)&&t.lt(e.TWO_PWR_24))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var o=this.high>>>16,p=this.high&65535,l=this.low>>>16,a=this.low&65535,d=t.high>>>16,v=t.high&65535,E=t.low>>>16,C=t.low&65535,S=0,I=0,z=0,P=0;return P+=a*C,z+=P>>>16,P&=65535,z+=l*C,I+=z>>>16,z&=65535,z+=a*E,I+=z>>>16,z&=65535,I+=p*C,S+=I>>>16,I&=65535,I+=l*E,S+=I>>>16,I&=65535,I+=a*v,S+=I>>>16,I&=65535,S+=o*C+p*E+l*v+a*d,S&=65535,e.fromBits(z<<16|P,S<<16|I,this.unsigned)},e.prototype.mul=function(t){return this.multiply(t)},e.prototype.negate=function(){return!this.unsigned&&this.eq(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=function(){return this.negate()},e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.notEquals=function(t){return!this.equals(t)},e.prototype.neq=function(t){return this.notEquals(t)},e.prototype.ne=function(t){return this.notEquals(t)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):e.fromBits(0,this.low<<t-32,this.unsigned)},e.prototype.shl=function(t){return this.shiftLeft(t)},e.prototype.shiftRight=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=function(t){return this.shiftRight(t)},e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),t&=63,t===0)return this;var r=this.high;if(t<32){var o=this.low;return e.fromBits(o>>>t|r<<32-t,r>>>t,this.unsigned)}else return t===32?e.fromBits(r,0,this.unsigned):e.fromBits(r>>>t-32,0,this.unsigned)},e.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},e.prototype.shru=function(t){return this.shiftRightUnsigned(t)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.neg())},e.prototype.sub=function(t){return this.subtract(t)},e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*_e+(this.low>>>0):this.high*_e+(this.low>>>0)},e.prototype.toBigInt=function(){return BigInt(this.toString())},e.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},e.prototype.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},e.prototype.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},e.prototype.toSigned=function(){return this.unsigned?e.fromBits(this.low,this.high,!1):this},e.prototype.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(e.MIN_VALUE)){var r=e.fromNumber(t),o=this.div(r),p=o.mul(r).sub(this);return o.toString(t)+p.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var l=e.fromNumber(Math.pow(t,6),this.unsigned),a=this,d="";;){var v=a.div(l),E=a.sub(v.mul(l)).toInt()>>>0,C=E.toString(t);if(a=v,a.isZero())return C+d;for(;C.length<6;)C="0"+C;d=""+C+d}},e.prototype.toUnsigned=function(){return this.unsigned?this:e.fromBits(this.low,this.high,!0)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.eqz=function(){return this.isZero()},e.prototype.le=function(t){return this.lessThanOrEqual(t)},e.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},e.fromExtendedJSON=function(t,r){var o=e.fromString(t.$numberLong);return r&&r.relaxed?o.toNumber():o},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},e.TWO_PWR_24=e.fromInt(ji),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e}();Object.defineProperty(D.prototype,"__isLong__",{value:!0});Object.defineProperty(D.prototype,"_bsontype",{value:"Long"});var $i=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,ki=/^(\+|-)?(Infinity|inf)$/i,Hi=/^(\+|-)?NaN$/i,Ce=6111,gr=-6176,xn=6176,zi=34,yr=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),En=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Sn=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Wi=/^([-+])?(\d+)?$/,Yi=31,Cn=16383,Ji=30,qi=31;function In(e){return!isNaN(parseInt(e,10))}function Zi(e){var t=D.fromNumber(1e9),r=D.fromNumber(0);if(!e.parts[0]&&!e.parts[1]&&!e.parts[2]&&!e.parts[3])return{quotient:e,rem:r};for(var o=0;o<=3;o++)r=r.shiftLeft(32),r=r.add(new D(e.parts[o],0)),e.parts[o]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function Gi(e,t){if(!e&&!t)return{high:D.fromNumber(0),low:D.fromNumber(0)};var r=e.shiftRightUnsigned(32),o=new D(e.getLowBits(),0),p=t.shiftRightUnsigned(32),l=new D(t.getLowBits(),0),a=r.multiply(p),d=r.multiply(l),v=o.multiply(p),E=o.multiply(l);return a=a.add(d.shiftRightUnsigned(32)),d=new D(d.getLowBits(),0).add(v).add(E.shiftRightUnsigned(32)),a=a.add(d.shiftRightUnsigned(32)),E=d.shiftLeft(32).add(new D(E.getLowBits(),0)),{high:a,low:E}}function Xi(e,t){var r=e.high>>>0,o=t.high>>>0;if(r<o)return!0;if(r===o){var p=e.low>>>0,l=t.low>>>0;if(p<l)return!0}return!1}function we(e,t){throw new ot('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var xr=function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(br(t)){if(t.byteLength!==16)throw new ot("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new ot("Decimal128 must take a Buffer or string")}return e.fromString=function(t){var r=!1,o=!1,p=!1,l=0,a=0,d=0,v=0,E=0,C=[0],S=0,I=0,z=0,P=0,Y=0,k=0,et=new D(0,0),X=new D(0,0),K=0,T=0;if(t.length>=7e3)throw new ot(""+t+" not a valid Decimal128 string");var it=t.match($i),ut=t.match(ki),bt=t.match(Hi);if(!it&&!ut&&!bt||t.length===0)throw new ot(""+t+" not a valid Decimal128 string");if(it){var Xt=it[2],Rt=it[4],Kt=it[5],kt=it[6];Rt&&kt===void 0&&we(t,"missing exponent power"),Rt&&Xt===void 0&&we(t,"missing exponent base"),Rt===void 0&&(Kt||kt)&&we(t,"missing e before exponent")}if((t[T]==="+"||t[T]==="-")&&(r=t[T++]==="-"),!In(t[T])&&t[T]!=="."){if(t[T]==="i"||t[T]==="I")return new e(G.from(r?En:Sn));if(t[T]==="N")return new e(G.from(yr))}for(;In(t[T])||t[T]===".";){if(t[T]==="."){o&&we(t,"contains multiple periods"),o=!0,T=T+1;continue}S<34&&(t[T]!=="0"||p)&&(p||(E=a),p=!0,C[I++]=parseInt(t[T],10),S=S+1),p&&(d=d+1),o&&(v=v+1),a=a+1,T=T+1}if(o&&!a)throw new ot(""+t+" not a valid Decimal128 string");if(t[T]==="e"||t[T]==="E"){var wt=t.substr(++T).match(Wi);if(!wt||!wt[2])return new e(G.from(yr));Y=parseInt(wt[0],10),T=T+wt[0].length}if(t[T])return new e(G.from(yr));if(z=0,!S)z=0,P=0,C[0]=0,d=1,S=1,l=0;else if(P=S-1,l=d,l!==1)for(;C[E+l-1]===0;)l=l-1;for(Y<=v&&v-Y>16384?Y=gr:Y=Y-v;Y>Ce;){if(P=P+1,P-z>zi){var xt=C.join("");if(xt.match(/^0+$/)){Y=Ce;break}we(t,"overflow")}Y=Y-1}for(;Y<gr||S<d;){if(P===0&&l<S){Y=gr,l=0;break}if(S<d?d=d-1:P=P-1,Y<Ce)Y=Y+1;else{var xt=C.join("");if(xt.match(/^0+$/)){Y=Ce;break}we(t,"overflow")}}if(P-z+1<l){var pt=a;o&&(E=E+1,pt=pt+1),r&&(E=E+1,pt=pt+1);var Et=parseInt(t[E+P+1],10),g=0;if(Et>=5&&(g=1,Et===5)){for(g=C[P]%2===1?1:0,k=E+P+2;k<pt;k++)if(parseInt(t[k],10)){g=1;break}}if(g){for(var m=P;m>=0;m--)if(++C[m]>9&&(C[m]=0,m===0))if(Y<Ce)Y=Y+1,C[m]=1;else return new e(G.from(r?En:Sn))}}if(et=D.fromNumber(0),X=D.fromNumber(0),l===0)et=D.fromNumber(0),X=D.fromNumber(0);else if(P-z<17){var m=z;for(X=D.fromNumber(C[m++]),et=new D(0,0);m<=P;m++)X=X.multiply(D.fromNumber(10)),X=X.add(D.fromNumber(C[m]))}else{var m=z;for(et=D.fromNumber(C[m++]);m<=P-17;m++)et=et.multiply(D.fromNumber(10)),et=et.add(D.fromNumber(C[m]));for(X=D.fromNumber(C[m++]);m<=P;m++)X=X.multiply(D.fromNumber(10)),X=X.add(D.fromNumber(C[m]))}var b=Gi(et,D.fromString("100000000000000000"));b.low=b.low.add(X),Xi(b.low,X)&&(b.high=b.high.add(D.fromNumber(1))),K=Y+xn;var w={low:D.fromNumber(0),high:D.fromNumber(0)};b.high.shiftRightUnsigned(49).and(D.fromNumber(1)).equals(D.fromNumber(1))?(w.high=w.high.or(D.fromNumber(3).shiftLeft(61)),w.high=w.high.or(D.fromNumber(K).and(D.fromNumber(16383).shiftLeft(47))),w.high=w.high.or(b.high.and(D.fromNumber(0x7fffffffffff)))):(w.high=w.high.or(D.fromNumber(K&16383).shiftLeft(49)),w.high=w.high.or(b.high.and(D.fromNumber(562949953421311)))),w.low=b.low,r&&(w.high=w.high.or(D.fromString("9223372036854775808")));var f=G.alloc(16);return T=0,f[T++]=w.low.low&255,f[T++]=w.low.low>>8&255,f[T++]=w.low.low>>16&255,f[T++]=w.low.low>>24&255,f[T++]=w.low.high&255,f[T++]=w.low.high>>8&255,f[T++]=w.low.high>>16&255,f[T++]=w.low.high>>24&255,f[T++]=w.high.low&255,f[T++]=w.high.low>>8&255,f[T++]=w.high.low>>16&255,f[T++]=w.high.low>>24&255,f[T++]=w.high.high&255,f[T++]=w.high.high>>8&255,f[T++]=w.high.high>>16&255,f[T++]=w.high.high>>24&255,new e(f)},e.prototype.toString=function(){for(var t,r=0,o=new Array(36),p=0;p<o.length;p++)o[p]=0;var l=0,a=!1,d,v={parts:[0,0,0,0]},E,C,S=[];l=0;var I=this.bytes,z=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24,P=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24,Y=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24,k=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24;l=0;var et={low:new D(z,P),high:new D(Y,k)};et.high.lessThan(D.ZERO)&&S.push("-");var X=k>>26&Yi;if(X>>3===3){if(X===Ji)return S.join("")+"Infinity";if(X===qi)return"NaN";t=k>>15&Cn,d=8+(k>>14&1)}else d=k>>14&7,t=k>>17&Cn;var K=t-xn;if(v.parts[0]=(k&16383)+((d&15)<<14),v.parts[1]=Y,v.parts[2]=P,v.parts[3]=z,v.parts[0]===0&&v.parts[1]===0&&v.parts[2]===0&&v.parts[3]===0)a=!0;else for(C=3;C>=0;C--){var T=0,it=Zi(v);if(v=it.quotient,T=it.rem.low,!!T)for(E=8;E>=0;E--)o[C*9+E]=T%10,T=Math.floor(T/10)}if(a)r=1,o[l]=0;else for(r=36;!o[l];)r=r-1,l=l+1;var ut=r-1+K;if(ut>=34||ut<=-7||K>0){if(r>34)return S.push("".concat(0)),K>0?S.push("E+".concat(K)):K<0&&S.push("E".concat(K)),S.join("");S.push("".concat(o[l++])),r=r-1,r&&S.push(".");for(var p=0;p<r;p++)S.push("".concat(o[l++]));S.push("E"),ut>0?S.push("+".concat(ut)):S.push("".concat(ut))}else if(K>=0)for(var p=0;p<r;p++)S.push("".concat(o[l++]));else{var bt=r+K;if(bt>0)for(var p=0;p<bt;p++)S.push("".concat(o[l++]));else S.push("0");for(S.push(".");bt++<0;)S.push("0");for(var p=0;p<r-Math.max(bt-1,0);p++)S.push("".concat(o[l++]))}return S.join("")},e.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},e.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},e.fromExtendedJSON=function(t){return e.fromString(t.$numberDecimal)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},e}();Object.defineProperty(xr.prototype,"_bsontype",{value:"Decimal128"});var Ze=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toJSON=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},e.fromExtendedJSON=function(t,r){var o=parseFloat(t.$numberDouble);return r&&r.relaxed?o:new e(o)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toExtendedJSON();return"new Double(".concat(t.$numberDouble,")")},e}();Object.defineProperty(Ze.prototype,"_bsontype",{value:"Double"});var Ge=function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t|0}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},e.fromExtendedJSON=function(t,r){return r&&r.relaxed?parseInt(t.$numberInt,10):new e(t.$numberInt)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},e}();Object.defineProperty(Ge.prototype,"_bsontype",{value:"Int32"});var Er=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$maxKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MaxKey()"},e}();Object.defineProperty(Er.prototype,"_bsontype",{value:"MaxKey"});var Sr=function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$minKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MinKey()"},e}();Object.defineProperty(Sr.prototype,"_bsontype",{value:"MinKey"});var Ki=new RegExp("^[0-9a-fA-F]{24}$"),ae=null,jt=Symbol("id"),ft=function(){function e(t){if(!(this instanceof e))return new e(t);var r;if(typeof t=="object"&&t&&"id"in t){if(typeof t.id!="string"&&!ArrayBuffer.isView(t.id))throw new ot("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?r=G.from(t.toHexString(),"hex"):r=t.id}else r=t;if(r==null||typeof r=="number")this[jt]=e.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[jt]=r instanceof G?r:ze(r);else if(typeof r=="string")if(r.length===12){var o=G.from(r);if(o.byteLength===12)this[jt]=o;else throw new ot("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&Ki.test(r))this[jt]=G.from(r,"hex");else throw new ot("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new ot("Argument passed in does not match the accepted types");e.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(e.prototype,"id",{get:function(){return this[jt]},set:function(t){this[jt]=t,e.cacheHexString&&(this.__id=t.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0)},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(){if(e.cacheHexString&&this.__id)return this.__id;var t=this.id.toString("hex");return e.cacheHexString&&!this.__id&&(this.__id=t),t},e.getInc=function(){return e.index=(e.index+1)%16777215},e.generate=function(t){typeof t!="number"&&(t=Math.floor(Date.now()/1e3));var r=e.getInc(),o=G.alloc(12);return o.writeUInt32BE(t,0),ae===null&&(ae=Dn(5)),o[4]=ae[0],o[5]=ae[1],o[6]=ae[2],o[7]=ae[3],o[8]=ae[4],o[11]=r&255,o[10]=r>>8&255,o[9]=r>>16&255,o},e.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(t){if(t==null)return!1;if(t instanceof e)return this[jt][11]===t[jt][11]&&this[jt].equals(t[jt]);if(typeof t=="string"&&e.isValid(t)&&t.length===12&&br(this.id))return t===G.prototype.toString.call(this.id,"latin1");if(typeof t=="string"&&e.isValid(t)&&t.length===24)return t.toLowerCase()===this.toHexString();if(typeof t=="string"&&e.isValid(t)&&t.length===12)return G.from(t).equals(this.id);if(typeof t=="object"&&"toHexString"in t&&typeof t.toHexString=="function"){var r=t.toHexString(),o=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===o}return!1},e.prototype.getTimestamp=function(){var t=new Date,r=this.id.readUInt32BE(0);return t.setTime(Math.floor(r)*1e3),t},e.createPk=function(){return new e},e.createFromTime=function(t){var r=G.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(t,0),new e(r)},e.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new ot("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(G.from(t,"hex"))},e.isValid=function(t){if(t==null)return!1;try{return new e(t),!0}catch{return!1}},e.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},e.fromExtendedJSON=function(t){return new e(t.$oid)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},e.index=Math.floor(Math.random()*16777215),e}();Object.defineProperty(ft.prototype,"generate",{value:Je(function(e){return ft.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(ft.prototype,"getInc",{value:Je(function(){return ft.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(ft.prototype,"get_inc",{value:Je(function(){return ft.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(ft,"get_inc",{value:Je(function(){return ft.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(ft.prototype,"_bsontype",{value:"ObjectID"});function Qi(e){return e.split("").sort().join("")}var Ne=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.pattern=t,this.options=Qi(r??""),this.pattern.indexOf("\0")!==-1)throw new ce("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new ce("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var o=0;o<this.options.length;o++)if(!(this.options[o]==="i"||this.options[o]==="m"||this.options[o]==="x"||this.options[o]==="l"||this.options[o]==="s"||this.options[o]==="u"))throw new ce("The regular expression option [".concat(this.options[o],"] is not supported"))}return e.parseOptions=function(t){return t?t.split("").sort().join(""):""},e.prototype.toExtendedJSON=function(t){return t=t||{},t.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},e.fromExtendedJSON=function(t){if("$regex"in t)if(typeof t.$regex!="string"){if(t.$regex._bsontype==="BSONRegExp")return t}else return new e(t.$regex,e.parseOptions(t.$options));if("$regularExpression"in t)return new e(t.$regularExpression.pattern,e.parseOptions(t.$regularExpression.options));throw new ot("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e}();Object.defineProperty(Ne.prototype,"_bsontype",{value:"BSONRegExp"});var Cr=function(){function e(t){if(!(this instanceof e))return new e(t);this.value=t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(){return this.value},e.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(){return{$symbol:this.value}},e.fromExtendedJSON=function(t){return new e(t.$symbol)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e}();Object.defineProperty(Cr.prototype,"_bsontype",{value:"Symbol"});var to=D,Pn=function(e){Ye(t,e);function t(r,o){var p=this;return p instanceof t?(D.isLong(r)?p=e.call(this,r.low,r.high,!0)||this:Oe(r)&&typeof r.t<"u"&&typeof r.i<"u"?p=e.call(this,r.i,r.t,!0)||this:p=e.call(this,r,o,!0)||this,Object.defineProperty(p,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),p):new t(r,o)}return t.prototype.toJSON=function(){return{$timestamp:this.toString()}},t.fromInt=function(r){return new t(D.fromInt(r,!0))},t.fromNumber=function(r){return new t(D.fromNumber(r,!0))},t.fromBits=function(r,o){return new t(r,o)},t.fromString=function(r,o){return new t(D.fromString(r,!0,o))},t.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(r){return new t(r.$timestamp)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},t.MAX_VALUE=D.MAX_UNSIGNED_VALUE,t}(to);function eo(e){return Oe(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var Vn=2147483647,Un=-2147483648,jn=9223372036854776e3,$n=-9223372036854776e3,ro={$oid:ft,$binary:le,$uuid:le,$symbol:Cr,$numberInt:Ge,$numberDecimal:xr,$numberDouble:Ze,$numberLong:D,$minKey:Sr,$maxKey:Er,$regex:Ne,$regularExpression:Ne,$timestamp:Pn};function kn(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=Un&&e<=Vn)return new Ge(e);if(e>=$n&&e<=jn)return D.fromNumber(e)}return new Ze(e)}if(e==null||typeof e!="object")return e;if(e.$undefined)return null;for(var r=Object.keys(e).filter(function(S){return S.startsWith("$")&&e[S]!=null}),o=0;o<r.length;o++){var p=ro[r[o]];if(p)return p.fromExtendedJSON(e,t)}if(e.$date!=null){var l=e.$date,a=new Date;return t.legacy?typeof l=="number"?a.setTime(l):typeof l=="string"&&a.setTime(Date.parse(l)):typeof l=="string"?a.setTime(Date.parse(l)):D.isLong(l)?a.setTime(l.toNumber()):typeof l=="number"&&t.relaxed&&a.setTime(l),a}if(e.$code!=null){var d=Object.assign({},e);return e.$scope&&(d.$scope=kn(e.$scope)),qe.fromExtendedJSON(e)}if(Ui(e)||e.$dbPointer){var v=e.$ref?e:e.$dbPointer;if(v instanceof Ie)return v;var E=Object.keys(v).filter(function(S){return S.startsWith("$")}),C=!0;if(E.forEach(function(S){["$ref","$id","$db"].indexOf(S)===-1&&(C=!1)}),C)return Ie.fromExtendedJSON(v)}return e}function no(e,t){return e.map(function(r,o){t.seenObjects.push({propertyName:"index ".concat(o),obj:null});try{return te(r,t)}finally{t.seenObjects.pop()}})}function Nn(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function te(e,t){if((typeof e=="object"||typeof e=="function")&&e!==null){var r=t.seenObjects.findIndex(function(et){return et.obj===e});if(r!==-1){var o=t.seenObjects.map(function(et){return et.propertyName}),p=o.slice(0,r).map(function(et){return"".concat(et," -> ")}).join(""),l=o[r],a=" -> "+o.slice(r+1,o.length-1).map(function(et){return"".concat(et," -> ")}).join(""),d=o[o.length-1],v=" ".repeat(p.length+l.length/2),E="-".repeat(a.length+(l.length+d.length)/2-1);throw new ot(`Converting circular structure to EJSON:
16
+ `+" ".concat(p).concat(l).concat(a).concat(d,`
17
+ `)+" ".concat(v,"\\").concat(E,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return no(e,t);if(e===void 0)return null;if(e instanceof Date||Fi(e)){var C=e.getTime(),S=C>-1&&C<2534023188e5;return t.legacy?t.relaxed&&S?{$date:e.getTime()}:{$date:Nn(e)}:t.relaxed&&S?{$date:Nn(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Math.floor(e)===e){var I=e>=Un&&e<=Vn,z=e>=$n&&e<=jn;if(I)return{$numberInt:e.toString()};if(z)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||Ri(e)){var P=e.flags;if(P===void 0){var Y=e.toString().match(/[gimuy]*$/);Y&&(P=Y[0])}var k=new Ne(e.source,P);return k.toExtendedJSON(t)}return e!=null&&typeof e=="object"?oo(e,t):e}var io={Binary:function(e){return new le(e.value(),e.sub_type)},Code:function(e){return new qe(e.code,e.scope)},DBRef:function(e){return new Ie(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new xr(e.bytes)},Double:function(e){return new Ze(e.value)},Int32:function(e){return new Ge(e.value)},Long:function(e){return D.fromBits(e.low!=null?e.low:e.low_,e.low!=null?e.high:e.high_,e.low!=null?e.unsigned:e.unsigned_)},MaxKey:function(){return new Er},MinKey:function(){return new Sr},ObjectID:function(e){return new ft(e)},ObjectId:function(e){return new ft(e)},BSONRegExp:function(e){return new Ne(e.pattern,e.options)},Symbol:function(e){return new Cr(e.value)},Timestamp:function(e){return Pn.fromBits(e.low,e.high)}};function oo(e,t){if(e==null||typeof e!="object")throw new ce("not an object instance");var r=e._bsontype;if(typeof r>"u"){var o={};for(var p in e){t.seenObjects.push({propertyName:p,obj:null});try{var l=te(e[p],t);p==="__proto__"?Object.defineProperty(o,p,{value:l,writable:!0,enumerable:!0,configurable:!0}):o[p]=l}finally{t.seenObjects.pop()}}return o}else if(eo(e)){var a=e;if(typeof a.toExtendedJSON!="function"){var d=io[e._bsontype];if(!d)throw new ot("Unrecognized or invalid _bsontype: "+e._bsontype);a=d(a)}return r==="Code"&&a.scope?a=new qe(a.code,te(a.scope,t)):r==="DBRef"&&a.oid&&(a=new Ie(te(a.collection,t),te(a.oid,t),te(a.db,t),te(a.fields,t))),a.toExtendedJSON(t)}else throw new ce("_bsontype must be a string, but was: "+typeof r)}var On;(function(e){function t(l,a){var d=Object.assign({},{relaxed:!0,legacy:!1},a);return typeof d.relaxed=="boolean"&&(d.strict=!d.relaxed),typeof d.strict=="boolean"&&(d.relaxed=!d.strict),JSON.parse(l,function(v,E){if(v.indexOf("\0")!==-1)throw new ce("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(v)));return kn(E,d)})}e.parse=t;function r(l,a,d,v){d!=null&&typeof d=="object"&&(v=d,d=0),a!=null&&typeof a=="object"&&!Array.isArray(a)&&(v=a,a=void 0,d=0);var E=Object.assign({relaxed:!0,legacy:!1},v,{seenObjects:[{propertyName:"(root)",obj:null}]}),C=te(l,E);return JSON.stringify(C,a,d)}e.stringify=r;function o(l,a){return a=a||{},JSON.parse(r(l,a))}e.serialize=o;function p(l,a){return a=a||{},t(JSON.stringify(l),a)}e.deserialize=p})(On||(On={}));var Tn,Bn=Mn();Bn.Map?Tn=Bn.Map:Tn=function(){function e(t){t===void 0&&(t=[]),this._keys=[],this._values={};for(var r=0;r<t.length;r++)if(t[r]!=null){var o=t[r],p=o[0],l=o[1];this._keys.push(p),this._values[p]={v:l,i:this._keys.length-1}}}return e.prototype.clear=function(){this._keys=[],this._values={}},e.prototype.delete=function(t){var r=this._values[t];return r==null?!1:(delete this._values[t],this._keys.splice(r.i,1),!0)},e.prototype.entries=function(){var t=this,r=0;return{next:function(){var o=t._keys[r++];return{value:o!==void 0?[o,t._values[o].v]:void 0,done:o===void 0}}}},e.prototype.forEach=function(t,r){r=r||this;for(var o=0;o<this._keys.length;o++){var p=this._keys[o];t.call(r,this._values[p].v,p,r)}},e.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},e.prototype.has=function(t){return this._values[t]!=null},e.prototype.keys=function(){var t=this,r=0;return{next:function(){var o=t._keys[r++];return{value:o!==void 0?o:void 0,done:o===void 0}}}},e.prototype.set=function(t,r){return this._values[t]?(this._values[t].v=r,this):(this._keys.push(t),this._values[t]={v:r,i:this._keys.length-1},this)},e.prototype.values=function(){var t=this,r=0;return{next:function(){var o=t._keys[r++];return{value:o!==void 0?t._values[o].v:void 0,done:o===void 0}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),e}();var Hs=D.fromNumber(Pi),zs=D.fromNumber(Vi);var vr=new Uint8Array(8),Ws=new DataView(vr.buffer,vr.byteOffset,vr.byteLength);var so=1024*1024*17,Ys=G.alloc(so);var Xe=class{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;constructor(t){t=t||{},this.triggerID=t.id||t.triggerID,this.nudgeID=t.nudgeID,this.shortID=t.shortID,this.contentType=t.contentType,this.engagementID=t.engagementID,this.contentID=t.contentID,this.variation=t.variation,this.props=t.props,this.objective=t.objective,this.onsiteDeliveryType=t.onsiteDeliveryType,this.holdout=t.holdout}};var be=class{constructor(t,r={},o,p){this.name=t;this.properties=r;this.id=p?new ft(p):new ft,this.occurred=new Date,o&&(this.trigger=new Xe(o)),this.newEvent=!p}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale};var ao=["videoEl"],ee=class e extends Qt{videoElements;videos;videoConfig;dialogRef=null;dialog=ue(on);isMobile=window.CooeeSDK.uaParser.getDevice().type==="mobile";engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videos=this.videoConfig.videos}onMuteToggled(t,r){t||this.videoElements.forEach(o=>{o.nativeElement!==r&&(o.nativeElement.muted=!0,o.nativeElement.pause())})}sendTriggerClicked(t,r){let o=new be(Gt.EVENT_TRIGGER_CLICKED,{},this.triggerContext?.triggerData);o.videos=[t.id],r&&(o.items=[r]),this.sendEventToRenderer(o)}onVideoTap(t,r,o,p){t?.stopPropagation(),t?.preventDefault();let l=r.items?.[0];if(this.sendTriggerClicked(r,l?.toEmbed()),this.videoConfig.footerContent==="NONE"){p&&(p.muted=!1,p.play(),this.onMuteToggled(!1,p));return}Xr().then(()=>this.openDialog(r,o))}async performCTA(t){let r,o=this.triggerContext;if(t.cta===ie.ADD_TO_CART)r=Gt.EVENT_ADD_TO_CART_CLICKED;else if(t.cta===ie.GO_TO_PRODUCT)r=Gt.EVENT_VIEW_ITEM_CLICKED;else if(t.cta===ie.OPEN_CART)r=Gt.EVENT_OPEN_CART_CLICKED,o.triggerData.redirectBehaviour=Qr.CART_DRAWER;else{vt.warn(`Unsupported CTA type: ${t.cta}`);return}let p={at:t.cta},l={videoID:t.video.id};this.sendEvent(r,{current:l},t.video,t.item),this.executeCTAViaRenderer({clickAction:p,embeddedItem:t.item.toEmbed()})}sendEvent(t,r,o,p){let l=new be(t,r,this.engagementTrigger);o&&(l.videos=[o.id]),p&&(l.items=[p.toEmbed()]),this.sendEventToRenderer(l)}onDialogClosed(){}async openDialog(t,r){let o={videos:this.videos,currentIndex:r,triggerContext:this.triggerContext,onCTAPerformed:a=>this.performCTA(a)};this.dialogRef&&this.dialogRef.close();let p=await import("./chunk-2PZEVGOB.js");this.dialogRef=this.dialog.open(p.VideoDetailDialogComponent,{width:"100vw",height:"100vh",data:o});let l={videoID:t.id,videoIndex:r};this.sendEvent(Gt.EVENT_VIDEO_DIALOG_OPENED,{current:l},t),this.dialogRef.closed.subscribe(a=>{if(this.dialogRef=null,!a)return;let d=a.lastVideoDuration*1e3,v={videoID:a.lastVideo.id,videoIndex:a.lastVideoIndex,playedTillMS:d,playedTillPercent:d/a.lastVideo.durationMS},E=new be(Gt.EVENT_VIDEO_DIALOG_CLOSED,{current:v},this.triggerContext?.triggerData);E.videos=[a.lastVideo.id],this.sendEventToRenderer(E),this.onDialogClosed()})}static \u0275fac=(()=>{let t;return function(o){return(t||(t=Ar(e)))(o||e)}})();static \u0275cmp=ht({type:e,selectors:[["cooee-abstract-video"]],viewQuery:function(r,o){if(r&1&&Ae(ao,5),r&2){let p;Me(p=De())&&(o.videoElements=p)}},features:[dt],decls:0,vars:0,template:function(r,o){},encapsulation:2})};var co=(e,t)=>t.id,lo=(e,t)=>t.url;function fo(e,t){if(e&1&&(re(0,"div",1),Ut(1,"safeHtml")),e&2){let r=Z();yt("innerHTML",Zt(1,1,r.videoConfig.heading),Bt)}}function uo(e,t){if(e&1&&re(0,"source",7),e&2){let r=t.$implicit;yt("type",he(r.mimeType))("src",r.url,Wt)}}function po(e,t){if(e&1){let r=Yt();rt(0,"cooee-mute-toggle",12),Mt("toggled",function(p){at(r),Z();let l=Jt(5),a=Z();return ct(a.onMuteToggled(p,l))}),nt()}if(e&2){Z();let r=Jt(5);yt("muted",r.muted)("videoEl",r)}}function ho(e,t){if(e&1){let r=Yt();rt(0,"cooee-item-card",13),Mt("buttonClick",function(){at(r);let p=Z(),l=p.$implicit,a=p.$index,d=Jt(5),v=Z();return ct(v.addToCartClicked(null,l,a,d))}),nt()}if(e&2){Z();let r=qt(0);yt("item",r)}}function mo(e,t){if(e&1){let r=Yt();rt(0,"cooee-video-card",14),Mt("linkClicked",function(){at(r);let p=Z().$implicit,l=Z();return ct(l.sendTriggerClicked(p))}),nt()}if(e&2){Z();let r=qt(1);yt("card",r)}}function go(e,t){if(e&1){let r=Yt();Se(0)(1),rt(2,"div",4)(3,"div",5),Mt("click",function(p){let l=at(r),a=l.$implicit,d=l.$index,v=Jt(5),E=Z();return ct(E.onVideoTap(p,a,d,v))})("keydown.enter",function(p){let l=at(r),a=l.$implicit,d=l.$index,v=Jt(5),E=Z();return ct(E.onVideoTap(p,a,d,v))})("keydown.space",function(p){let l=at(r),a=l.$implicit,d=l.$index,v=Jt(5),E=Z();return ct(E.onVideoTap(p,a,d,v))}),rt(4,"video",6,0),Mt("mouseenter",function(){at(r);let p=Jt(5);Z();let l=qt(1);return ct(l&&p.play())})("mouseleave",function(){at(r);let p=Jt(5);Z();let l=qt(1);return ct(l&&p.pause())}),Ct(6,uo,1,3,"source",7,lo),nt(),rt(8,"div",8),mt(9,po,1,2,"cooee-mute-toggle",9),nt(),mt(10,ho,1,1,"cooee-item-card",10)(11,mo,1,1,"cooee-video-card",11),nt()()}if(e&2){let r=t.$implicit,o=Z(),p=qt(0),l=ne(r.items[0]);J();let a=ne(r.card),d=l&&o.videoConfig.footerContent==o.VideoConfigFooterContent.FIRST_ITEM,v=a&&o.videoConfig.footerContent==o.VideoConfigFooterContent.CARD;J(3),yt("poster",r.thumbnail,Wt)("muted",!0),Be("autoplay",p||null),J(2),It(r.sources),J(3),gt(o.videoConfig.showMuteButton?9:-1),J(),gt(d?10:v?11:-1)}}var Ke=class e extends ee{VideoConfigFooterContent=sr;VideoConfigAutoPlay=nn;swiperOptions;constructor(){super(),this.hasSwiper=!0,this.swiperOptions={direction:"horizontal",effect:"slide",slidesPerView:"auto",spaceBetween:24,mousewheel:{enabled:!0,forceToAxis:!0},navigation:{enabled:!1},freeMode:!0}}ngAfterViewInit(){this.playFirstVideo()}addToCartClicked(t,r,o,p){let l=r.items?.[0],a=Gr.get().website?.canChangeVariantInCart;if(r.items?.length>1||l?.hasVariants()&&!a){this.onVideoTap(t,r,o,p);return}this.performCTA({cta:ie.ADD_TO_CART,item:l,video:r})}goToPDP(t,r){t?.stopPropagation(),t?.preventDefault();let o=r.items?.[0];this.performCTA({cta:ie.GO_TO_PRODUCT,item:o,video:r})}update(){}playFirstVideo(){this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile&&this.videoElements.first?.nativeElement.play()}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=ht({type:e,selectors:[["cooee-video-playlist"]],features:[dt],decls:7,vars:4,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[3,"options"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-card"],["role","button","tabindex","0","aria-label","Play video","aria-haspopup","dialog",1,"video-wrapper",3,"click","keydown.enter","keydown.space"],["width","100%","playsinline","","loop","","preload","metadata",3,"mouseenter","mouseleave","poster","muted"],[3,"src","type"],[1,"video-controls"],[3,"muted","videoEl"],[3,"item"],[3,"card"],[3,"toggled","muted","videoEl"],[3,"buttonClick","item"],[3,"linkClicked","card"]],template:function(r,o){r&1&&(Se(0)(1),mt(2,fo,2,3,"div",1),rt(3,"cooee-swiper",2),Ur(4,3),Ct(5,go,12,7,"div",4,co),jr(),nt()),r&2&&(ne(!o.videoConfig.autoPlay||o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON),J(),ne(o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON_HOVER),J(),gt(o.videoConfig.heading?2:-1),J(),yt("options",o.swiperOptions),J(2),It(o.videos))},dependencies:[cn,an,sn,ln,me],styles:[`:host{display:block}.heading-text{margin-bottom:.5rem;font-size:1.125rem;text-align:center;font-weight:700}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;border-radius:var(--lc-media-radius, 8px)}.video-wrapper video{border-radius:var(--lc-media-radius, 8px)}.video-card{display:flex;flex-direction:column;gap:2.5px;scroll-snap-align:center;min-width:200px;max-width:300px;transition:transform .3s ease}.video-card:hover{transform:scale(1.05)}@media (max-width: 768px),(prefers-reduced-motion: reduce){.video-card{transition:none}.video-card:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}cooee-item-card{padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-info{font-size:14px;line-height:normal}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}cooee-item-card .item-info .item-cmp-price{color:rgba(var(--lc-color-text),.75);display:none}
18
+ `],encapsulation:3})};function Hn(e){e||(e=ue(Tr));let t=new Te(r=>{if(e.destroyed){r.next();return}return e.onDestroy(r.next.bind(r))});return r=>r.pipe(Or(t))}var yo=e=>({"cursor-grab":e}),vo=(e,t)=>t.url;function wo(e,t){if(e&1&&re(0,"source",11),e&2){let r=t.$implicit;yt("type",he(r.mimeType))("src",r.url,Wt)}}var Qe=class e extends ee{video;isDragging=!1;hidden=!1;cdkDrag=ue(Le,{self:!0});untilDestroyed=Hn();constructor(){super()}get popupClasses(){return this.hidden?["hidden"]:["visible"]}onClick(t){t.stopPropagation(),t.preventDefault(),this.onVideoClick()}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.closest(".letscooee-engagement");t&&(t.style.zIndex="10000"),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=!0)}onVideoClick(){if(this.isDragging){this.isDragging=!1;return}this.hidden=!0,this.onVideoTap(null,this.video,0)}close(){this.hidden=!0;let t=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent(Gt.EVENT_TRIGGER_CLOSED,{duration:t})}engagementTriggerReceived(t){super.engagementTriggerReceived(t),this.video=this.videos[0]}update(){}onDialogClosed(){this.hidden=!1}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=ht({type:e,selectors:[["cooee-video-popup"]],hostAttrs:["role","button","tabindex","0","aria-label","Open video popup "],hostVars:3,hostBindings:function(r,o){r&1&&Mt("keydown.enter",function(l){return o.onClick(l)})("keydown.space",function(l){return o.onClick(l)})("click",function(l){return o.onClick(l)}),r&2&&(_t("cdkDragBoundary","body"),kr(o.popupClasses))},features:[Fr([{directive:Le,inputs:["cdkDragBoundary","cdkDragBoundary"]}]),dt],decls:14,vars:4,consts:[[1,"popup-inner",3,"ngClass"],["type","button","aria-label","Close video popup",1,"close-button",3,"click"],["xmlns","http://www.w3.org/2000/svg","height","24px","viewBox","0 0 24 24","width","24px","fill","#fff"],["d","M0 0h24v24H0V0z","fill","none"],["d","M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"],[1,"play-button"],[1,"icon"],["viewBox","0 0 28.31 30"],["d","M19.15,1.29A1.24,1.24,0,0,0,17.82.15a1.36,1.36,0,0,0-.35.07,3.2,3.2,0,0,0-.65.46l-5.06,4.6a1.24,1.24,0,0,0,0,1.75l0,0a1.22,1.22,0,0,0,.89.39,1.25,1.25,0,0,0,.85-.32l3-2.78.17-.13v8l2.44,2.62ZM26.79,26.6l-7.64-7.93-2.5-2.58-6-6.34L8.9,8,5.23,4.15a1.17,1.17,0,0,0-1.66,0h0a1.18,1.18,0,0,0,0,1.66h0L6.1,8.47H3.32a2.94,2.94,0,0,0-2.45,3v7.16a3,3,0,0,0,2.86,3.08H8.07a.44.44,0,0,1,.33.13C9.7,23,11,24.19,12.26,25.36L17,29.7a1.24,1.24,0,0,0,2.17-1V22.21l5.95,6.15a1.2,1.2,0,0,0,1.67,0,1.17,1.17,0,0,0,.08-1.66Zm-10.14-.67-.18-.11L9.75,19.67a1.72,1.72,0,0,0-1.16-.45H4c-.48,0-.59-.11-.59-.61V11.55c0-.49,0-.6.59-.6H8.29l8.29,8.55ZM29.09,15.07A9.9,9.9,0,0,1,26.33,22l-.11.13a1.24,1.24,0,0,1-2-.28,1.29,1.29,0,0,1,.24-1.52h0a6.77,6.77,0,0,0,1.32-1.89,7.41,7.41,0,0,0-1.37-8.55,1.24,1.24,0,0,1-.08-1.75,1.33,1.33,0,0,1,.41-.29,1.19,1.19,0,0,1,1.34.2A8.88,8.88,0,0,1,28,10.36a10,10,0,0,1,1.17,4.17A3.35,3.35,0,0,1,29.09,15.07Z","transform","translate(-0.86 -0.14)","fill","#191919"],[1,"text"],["loop","","preload","auto","playsinline","","autoplay","",3,"muted"],[3,"src","type"]],template:function(r,o){r&1&&(rt(0,"div",0)(1,"button",1),Mt("click",function(l){return l.stopPropagation(),o.close()}),xe(),rt(2,"svg",2),re(3,"path",3)(4,"path",4),nt()(),Ee(),rt(5,"div",5)(6,"div",6),xe(),rt(7,"svg",7),re(8,"path",8),nt()(),Ee(),rt(9,"div",9),Dt(10,"Tap to unmute"),nt()(),rt(11,"video",10),Ct(12,wo,1,3,"source",11,vo),nt()()),r&2&&(yt("ngClass",zr(2,yo,o.isDragging)),J(11),yt("muted",!0),J(),It(o.video.sources))},dependencies:[Re],styles:[`:host{position:fixed;display:block;right:24px;bottom:24px;min-height:150px;max-width:150px;box-shadow:0 25px 50px -12px #00000040}:host(.hidden){display:none}.popup-inner{display:flex;justify-content:center;align-items:center;position:relative}video{width:100%;border-radius:8px}.close-button{position:absolute;top:-14px;right:-14px;background-color:#00000080;border-radius:9999px;width:32px;height:32px;border:none;z-index:10;display:flex;justify-content:center;align-items:center}.play-button{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.play-button .icon{width:14px;height:14px}.play-button path{fill:#fff}.play-button .text{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}
19
+ `],encapsulation:3})};var _o=(e,t)=>t.id,bo=(e,t)=>t.url;function xo(e,t){if(e&1&&(Nt(0,"div",0),Ut(1,"safeHtml")),e&2){let r=Z();_t("innerHTML",Zt(1,1,r.videoConfig.heading),Bt)}}function Eo(e,t){if(e&1&&Nt(0,"source",9),e&2){let r=t.$implicit;_t("type",he(r.mimeType))("src",r.url,Wt)}}function So(e,t){if(e&1){let r=Yt();At(0,"div",3),$r("click",function(p){let l=at(r),a=l.$implicit,d=l.$index,v=Z();return ct(v.onVideoTap(p,a,d))})("keydown.enter",function(p){let l=at(r),a=l.$implicit,d=l.$index,v=Z();return ct(v.onVideoTap(p,a,d))})("keydown.space",function(p){let l=at(r),a=l.$implicit,d=l.$index,v=Z();return ct(v.onVideoTap(p,a,d))}),xe(),At(1,"svg",4),Nt(2,"circle",5)(3,"circle",6),Vt(),Ee(),At(4,"div",7)(5,"video",8),Ct(6,Eo,1,3,"source",9,bo),Vt()()()}if(e&2){let r=t.$implicit,o=t.$index;Be("aria-label","Open video story "+(o+1)),J(6),It(r.sources)}}var tr=class e extends ee{constructor(){super()}update(){}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=ht({type:e,selectors:[["cooee-video-stories"]],features:[dt],decls:4,vars:1,consts:[[1,"heading-text",3,"innerHTML"],[1,"video-stories"],["role","button","tabindex","0",1,"video-story"],["role","button","tabindex","0",1,"video-story",3,"click","keydown.enter","keydown.space"],["viewBox","0 0 100 100"],["cx","50","cy","50","r","48","fill","none","stroke-width","4"],["cx","50","cy","50","r","48","fill","none","stroke-width","4","stroke-linecap","round","stroke-dasharray","301.6","stroke-dashoffset","301.6",1,"video-story-circle"],[1,"video-wrapper"],["autoplay","","loop","","muted","","playsinline","","preload","metadata"],[3,"src","type"]],template:function(r,o){r&1&&(mt(0,xo,2,3,"div",0),At(1,"div",1),Ct(2,So,8,1,"div",2,_o),Vt()),r&2&&(gt(o.videoConfig.heading?0:-1),J(2),It(o.videos))},dependencies:[me],styles:[`:host{display:block}.heading-text{margin-bottom:.5rem;font-size:1.125rem;text-align:center;font-weight:700}.video-stories{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.video-stories::-webkit-scrollbar{display:none}@media (max-width: 768px){.video-stories{justify-content:start!important}}.video-story{position:relative;width:5rem;height:5rem;cursor:pointer;flex-shrink:0}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px}
20
+ `],encapsulation:3})};Zr("CooeeWidgetSDK");(async()=>{let e=await qr(un),t=(r,o)=>{let p=fn(r,{injector:e.injector});customElements.define(o,p)};t(ke,"cooee-sticky-atc"),t($e,"cooee-savings-bar"),t(je,"cooee-progressbar"),t(Ke,"cooee-video-playlist"),t(Qe,"cooee-video-popup"),t(tr,"cooee-video-stories"),t(Kr,"cooee-product-options-picker"),sessionStorage.cooeeDebug&&import("./chunk-X2P3TPAO.js").then(r=>{t(r.DebuggerComponent,"cooee-debugger")})})();