@letscooee/web-sdk 9.3.5 → 9.3.6
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,4 +1,4 @@
|
|
|
1
|
-
"use strict";(()=>{var ih=Object.create,wc=Object.defineProperty,oh=Object.defineProperties,sh=Object.getOwnPropertyDescriptor,ah=Object.getOwnPropertyDescriptors,ch=Object.getOwnPropertyNames,Qu=Object.getOwnPropertySymbols,lh=Object.getPrototypeOf,ep=Object.prototype.hasOwnProperty,uh=Object.prototype.propertyIsEnumerable,Zu=(t,e,r)=>e in t?wc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b=(t,e)=>{for(var r in e||={})ep.call(e,r)&&Zu(t,r,e[r]);if(Qu)for(var r of Qu(e))uh.call(e,r)&&Zu(t,r,e[r]);return t},Z=(t,e)=>oh(t,ah(e)),Gi=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Vi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ph=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ch(e))!ep.call(t,i)&&i!==r&&wc(t,i,{get:()=>e[i],enumerable:!(n=sh(e,i))||n.enumerable});return t},Xt=(t,e,r)=>(r=t!=null?ih(lh(t)):{},ph(e||!t||!t.__esModule?wc(r,"default",{value:t,enumerable:!0}):r,t)),tn=Vi((t,e)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,v){return function(){return v.apply(h,arguments)}},c=function(){var h=arguments,v=h[0],_,m;for(m=1;m<h.length;m++)for(_ in h[m])!(_ in v)&&h[m].hasOwnProperty(_)&&(v[_]=h[m][_]);return v},u=function(h,v){return{value:h,name:v}};n.TRACE=u(1,"TRACE"),n.DEBUG=u(2,"DEBUG"),n.INFO=u(3,"INFO"),n.TIME=u(4,"TIME"),n.WARN=u(5,"WARN"),n.ERROR=u(8,"ERROR"),n.OFF=u(99,"OFF");var f=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};f.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var v=this.context.filterLevel;return h.value>=v.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,v){i&&this.enabledFor(h)&&i(v,c({level:h},this.context))}};var g=new f({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(g,g.enabledFor),h.trace=o(g,g.trace),h.debug=o(g,g.debug),h.time=o(g,g.time),h.timeEnd=o(g,g.timeEnd),h.info=o(g,g.info),h.warn=o(g,g.warn),h.error=o(g,g.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){g.setLevel(h);for(var v in s)s.hasOwnProperty(v)&&s[v].setLevel(h)},n.getLevel=function(){return g.getLevel()},n.get=function(h){return s[h]||(s[h]=new f(c({name:h},g.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(m,y){y.name&&m.unshift("["+y.name+"]")};var v={},_=function(m,y){Function.prototype.apply.call(m,console,y)};return typeof console>"u"?function(){}:function(m,y){m=Array.prototype.slice.call(m);var T=console.log,O;y.level===n.TIME?(O=(y.name?"["+y.name+"] ":"")+m[0],m[1]==="start"?console.time?console.time(O):v[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):_(T,[O+": "+(new Date().getTime()-v[O])+"ms"])):(y.level===n.WARN&&console.warn?T=console.warn:y.level===n.ERROR&&console.error?T=console.error:y.level===n.INFO&&console.info?T=console.info:y.level===n.DEBUG&&console.debug?T=console.debug:y.level===n.TRACE&&console.trace&&(T=console.trace),h.formatter(m,y),_(T,m))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof e<"u"&&e.exports?e.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(t)}),Bp=Vi((t,e)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",c="function",u="undefined",f="object",g="string",h="major",v="model",_="name",m="type",y="vendor",T="version",O="architecture",H="console",R="mobile",k="tablet",V="smarttv",Ut="wearable",de="embedded",j=500,ot="Amazon",Y="Apple",st="ASUS",Jt="BlackBerry",me="Browser",pe="Chrome",Ce="Edge",be="Firefox",Bt="Google",Te="Huawei",pt="LG",Q="Microsoft",we="Motorola",ar="Opera",jr="Samsung",ke="Sharp",en="Sony",Hn="Xiaomi",kn="Zebra",Hi="Facebook",Wi="Chromium OS",ji="Mac OS",Mn=" Browser",Pe=function(z,ft){var X={};for(var ie in z)ft[ie]&&ft[ie].length%2===0?X[ie]=ft[ie].concat(z[ie]):X[ie]=z[ie];return X},$r=function(z){for(var ft={},X=0;X<z.length;X++)ft[z[X].toUpperCase()]=z[X];return ft},rs=function(z,ft){return typeof z===g?a(ft).indexOf(a(z))!==-1:!1},a=function(z){return z.toLowerCase()},l=function(z){return typeof z===g?z.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(z,ft){if(typeof z===g)return z=z.replace(/^\s\s*/,s),typeof ft===u?z:z.substring(0,j)},I=function(z,ft){for(var X=0,ie,$e,Me,re,J,He;X<ft.length&&!J;){var As=ft[X],Yo=ft[X+1];for(ie=$e=0;ie<As.length&&!J&&As[ie];)if(J=As[ie++].exec(z),J)for(Me=0;Me<Yo.length;Me++)He=J[++$e],re=Yo[Me],typeof re===f&&re.length>0?re.length===2?typeof re[1]==c?this[re[0]]=re[1].call(this,He):this[re[0]]=re[1]:re.length===3?typeof re[1]===c&&!(re[1].exec&&re[1].test)?this[re[0]]=He?re[1].call(this,He,re[2]):n:this[re[0]]=He?He.replace(re[1],re[2]):n:re.length===4&&(this[re[0]]=He?re[3].call(this,He.replace(re[1],re[2])):n):this[re]=He||n;X+=2}},N=function(z,ft){for(var X in ft)if(typeof ft[X]===f&&ft[X].length>0){for(var ie=0;ie<ft[X].length;ie++)if(rs(ft[X][ie],z))return X===o?n:X}else if(rs(ft[X],z))return X===o?n:X;return ft.hasOwnProperty("*")?ft["*"]:z},L={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},W={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},te={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[T,[_,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[T,[_,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[_,T],[/opios[\/ ]+([\w\.]+)/i],[T,[_,ar+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[T,[_,ar+" GX"]],[/\bopr\/([\w\.]+)/i],[T,[_,ar]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[T,[_,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[T,[_,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[_,T],[/quark(?:pc)?\/([-\w\.]+)/i],[T,[_,"Quark"]],[/\bddg\/([\w\.]+)/i],[T,[_,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[T,[_,"UC"+me]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[T,[_,"WeChat"]],[/konqueror\/([\w\.]+)/i],[T,[_,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[T,[_,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[T,[_,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[T,[_,"Smart Lenovo "+me]],[/(avast|avg)\/([\w\.]+)/i],[[_,/(.+)/,"$1 Secure "+me],T],[/\bfocus\/([\w\.]+)/i],[T,[_,be+" Focus"]],[/\bopt\/([\w\.]+)/i],[T,[_,ar+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[T,[_,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[T,[_,"Dolphin"]],[/coast\/([\w\.]+)/i],[T,[_,ar+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[T,[_,"MIUI"+Mn]],[/fxios\/([\w\.-]+)/i],[T,[_,be]],[/\bqihoobrowser\/?([\w\.]*)/i],[T,[_,"360"]],[/\b(qq)\/([\w\.]+)/i],[[_,/(.+)/,"$1Browser"],T],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[_,/(.+)/,"$1"+Mn],T],[/samsungbrowser\/([\w\.]+)/i],[T,[_,jr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[T,[_,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[_,"Sogou Mobile"],T],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[_,T],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[_],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[T,_],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[_,Hi],T],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[_,T],[/\bgsa\/([\w\.]+) .*safari\//i],[T,[_,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[T,[_,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[T,[_,pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[_,pe+" WebView"],T],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[T,[_,"Android "+me]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[_,T],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[T,[_,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[T,_],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[_,[T,N,L]],[/(webkit|khtml)\/([\w\.]+)/i],[_,T],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[_,"Netscape"],T],[/(wolvic|librewolf)\/([\w\.]+)/i],[_,T],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[T,[_,be+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[_,[T,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[_,[T,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[O,"amd64"]],[/(ia32(?=;))/i],[[O,a]],[/((?:i[346]|x)86)[;\)]/i],[[O,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[O,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[O,"armhf"]],[/windows (ce|mobile); ppc;/i],[[O,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[O,/ower/,s,a]],[/(sun4\w)[;\)]/i],[[O,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[O,a]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[v,[y,jr],[m,k]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[v,[y,jr],[m,R]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[y,Y],[m,R]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[y,Y],[m,k]],[/(macintosh);/i],[v,[y,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[y,ke],[m,R]],[/(?:honor)([-\w ]+)[;\)]/i],[v,[y,"Honor"],[m,R]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[y,Te],[m,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[y,Te],[m,R]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[m,R]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[m,k]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[y,"OPPO"],[m,R]],[/\b(opd2\d{3}a?) bui/i],[v,[y,"OPPO"],[m,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[y,"Vivo"],[m,R]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[v,[y,"Realme"],[m,R]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[v,[y,we],[m,R]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[y,we],[m,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[y,pt],[m,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[y,pt],[m,R]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[y,"Lenovo"],[m,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[y,"Nokia"],[m,R]],[/(pixel c)\b/i],[v,[y,Bt],[m,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[y,Bt],[m,R]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[v,[y,en],[m,R]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[y,en],[m,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[y,"OnePlus"],[m,R]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[y,ot],[m,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[y,ot],[m,R]],[/(playbook);[-\w\),; ]+(rim)/i],[v,y,[m,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[y,Jt],[m,R]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[y,st],[m,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[y,st],[m,R]],[/(nexus 9)/i],[v,[y,"HTC"],[m,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[v,/_/g," "],[m,R]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[v,[y,"TCL"],[m,k]],[/(itel) ((\w+))/i],[[y,a],v,[m,N,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[y,"Acer"],[m,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[y,"Meizu"],[m,R]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[v,[y,"Ulefone"],[m,R]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[v,[y,"Energizer"],[m,R]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[v,[y,"Cat"],[m,R]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[v,[y,"Smartfren"],[m,R]],[/droid.+; (a(?:015|06[35]|142p?))/i],[v,[y,"Nothing"],[m,R]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[y,v,[m,R]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[y,v,[m,k]],[/(surface duo)/i],[v,[y,Q],[m,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[y,"Fairphone"],[m,R]],[/(u304aa)/i],[v,[y,"AT&T"],[m,R]],[/\bsie-(\w*)/i],[v,[y,"Siemens"],[m,R]],[/\b(rct\w+) b/i],[v,[y,"RCA"],[m,k]],[/\b(venue[\d ]{2,7}) b/i],[v,[y,"Dell"],[m,k]],[/\b(q(?:mv|ta)\w+) b/i],[v,[y,"Verizon"],[m,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[y,"Barnes & Noble"],[m,k]],[/\b(tm\d{3}\w+) b/i],[v,[y,"NuVision"],[m,k]],[/\b(k88) b/i],[v,[y,"ZTE"],[m,k]],[/\b(nx\d{3}j) b/i],[v,[y,"ZTE"],[m,R]],[/\b(gen\d{3}) b.+49h/i],[v,[y,"Swiss"],[m,R]],[/\b(zur\d{3}) b/i],[v,[y,"Swiss"],[m,k]],[/\b((zeki)?tb.*\b) b/i],[v,[y,"Zeki"],[m,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],v,[m,k]],[/\b(ns-?\w{0,9}) b/i],[v,[y,"Insignia"],[m,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[y,"NextBook"],[m,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],v,[m,R]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],v,[m,R]],[/\b(ph-1) /i],[v,[y,"Essential"],[m,R]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[y,"Envizen"],[m,k]],[/\b(trio[-\w\. ]+) b/i],[v,[y,"MachSpeed"],[m,k]],[/\btu_(1491) b/i],[v,[y,"Rotor"],[m,k]],[/(shield[\w ]+) b/i],[v,[y,"Nvidia"],[m,k]],[/(sprint) (\w+)/i],[y,v,[m,R]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[y,Q],[m,R]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[y,kn],[m,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[y,kn],[m,R]],[/smart-tv.+(samsung)/i],[y,[m,V]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[y,jr],[m,V]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,pt],[m,V]],[/(apple) ?tv/i],[y,[v,Y+" TV"],[m,V]],[/crkey/i],[[v,pe+"cast"],[y,Bt],[m,V]],[/droid.+aft(\w+)( bui|\))/i],[v,[y,ot],[m,V]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[y,ke],[m,V]],[/(bravia[\w ]+)( bui|\))/i],[v,[y,en],[m,V]],[/(mitv-\w{5}) bui/i],[v,[y,Hn],[m,V]],[/Hbbtv.*(technisat) (.*);/i],[y,v,[m,V]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,p],[v,p],[m,V]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,V]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,v,[m,H]],[/droid.+; (shield) bui/i],[v,[y,"Nvidia"],[m,H]],[/(playstation [345portablevi]+)/i],[v,[y,en],[m,H]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[y,Q],[m,H]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[v,[y,jr],[m,Ut]],[/((pebble))app/i],[y,v,[m,Ut]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[y,Y],[m,Ut]],[/droid.+; (glass) \d/i],[v,[y,Bt],[m,Ut]],[/droid.+; (wt63?0{2,3})\)/i],[v,[y,kn],[m,Ut]],[/droid.+; (glass) \d/i],[v,[y,Bt],[m,Ut]],[/(pico) (4|neo3(?: link|pro)?)/i],[y,v,[m,Ut]],[/; (quest( \d| pro)?)/i],[v,[y,Hi],[m,Ut]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[m,de]],[/(aeobc)\b/i],[v,[y,ot],[m,de]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[v,[m,R]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[m,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,R]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[T,[_,Ce+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[_,T],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[T,[_,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[_,T],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[T,_]],os:[[/microsoft (windows) (vista|xp)/i],[_,T],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[_,[T,N,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[T,N,W],[_,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[T,/_/g,"."],[_,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[_,ji],[T,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[T,_],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[_,T],[/\(bb(10);/i],[T,[_,Jt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[T,[_,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[T,[_,be+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[T,[_,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[T,[_,"watchOS"]],[/crkey\/([\d\.]+)/i],[T,[_,pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[_,Wi],T],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[_,T],[/(sunos) ?([\w\.\d]*)/i],[[_,"Solaris"],T],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[_,T]]},St=function(z,ft){if(typeof z===f&&(ft=z,z=n),!(this instanceof St))return new St(z,ft).getResult();var X=typeof r!==u&&r.navigator?r.navigator:n,ie=z||(X&&X.userAgent?X.userAgent:s),$e=X&&X.userAgentData?X.userAgentData:n,Me=ft?Pe(te,ft):te,re=X&&X.userAgent==ie;return this.getBrowser=function(){var J={};return J[_]=n,J[T]=n,I.call(J,ie,Me.browser),J[h]=l(J[T]),re&&X&&X.brave&&typeof X.brave.isBrave==c&&(J[_]="Brave"),J},this.getCPU=function(){var J={};return J[O]=n,I.call(J,ie,Me.cpu),J},this.getDevice=function(){var J={};return J[y]=n,J[v]=n,J[m]=n,I.call(J,ie,Me.device),re&&!J[m]&&$e&&$e.mobile&&(J[m]=R),re&&J[v]=="Macintosh"&&X&&typeof X.standalone!==u&&X.maxTouchPoints&&X.maxTouchPoints>2&&(J[v]="iPad",J[m]=k),J},this.getEngine=function(){var J={};return J[_]=n,J[T]=n,I.call(J,ie,Me.engine),J},this.getOS=function(){var J={};return J[_]=n,J[T]=n,I.call(J,ie,Me.os),re&&!J[_]&&$e&&$e.platform&&$e.platform!="Unknown"&&(J[_]=$e.platform.replace(/chrome os/i,Wi).replace(/macos/i,ji)),J},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return ie},this.setUA=function(J){return ie=typeof J===g&&J.length>j?p(J,j):J,this},this.setUA(ie),this};St.VERSION=i,St.BROWSER=$r([_,T,h]),St.CPU=$r([O]),St.DEVICE=$r([v,y,m,H,R,V,k,Ut,de]),St.ENGINE=St.OS=$r([_,T]),typeof t!==u?(typeof e!==u&&e.exports&&(t=e.exports=St),t.UAParser=St):typeof define===c&&define.amd?define(function(){return St}):typeof r!==u&&(r.UAParser=St);var Ct=typeof r!==u&&(r.jQuery||r.Zepto);if(Ct&&!Ct.ua){var le=new St;Ct.ua=le.getResult(),Ct.ua.get=function(){return le.getUA()},Ct.ua.set=function(z){le.setUA(z);var ft=le.getResult();for(var X in ft)Ct.ua[X]=ft[X]}}})(typeof window=="object"?window:t)}),kp=Vi((t,e)=>{"use strict";(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,c,u){function f(v,_){if(!c[v]){if(!o[v]){var m=typeof Gi=="function"&&Gi;if(!_&&m)return m(v,!0);if(g)return g(v,!0);var y=new Error("Cannot find module '"+v+"'");throw y.code="MODULE_NOT_FOUND",y}var T=c[v]={exports:{}};o[v][0].call(T.exports,function(O){var H=o[v][1][O];return f(H||O)},T,T.exports,s,o,c,u)}return c[v].exports}for(var g=typeof Gi=="function"&&Gi,h=0;h<u.length;h++)f(u[h]);return f}({1:[function(s,o,c){(function(u){"use strict";var f=u.MutationObserver||u.WebKitMutationObserver,g;if(f){var h=0,v=new f(O),_=u.document.createTextNode("");v.observe(_,{characterData:!0}),g=function(){_.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var m=new u.MessageChannel;m.port1.onmessage=O,g=function(){m.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?g=function(){var R=u.document.createElement("script");R.onreadystatechange=function(){O(),R.onreadystatechange=null,R.parentNode.removeChild(R),R=null},u.document.documentElement.appendChild(R)}:g=function(){setTimeout(O,0)};var y,T=[];function O(){y=!0;for(var R,k,V=T.length;V;){for(k=T,T=[],R=-1;++R<V;)k[R]();V=T.length}y=!1}o.exports=H;function H(R){T.push(R)===1&&!y&&g()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var u=s(1);function f(){}var g={},h=["REJECTED"],v=["FULFILLED"],_=["PENDING"];o.exports=m;function m(j){if(typeof j!="function")throw new TypeError("resolver must be a function");this.state=_,this.queue=[],this.outcome=void 0,j!==f&&H(this,j)}m.prototype.catch=function(j){return this.then(null,j)},m.prototype.then=function(j,ot){if(typeof j!="function"&&this.state===v||typeof ot!="function"&&this.state===h)return this;var Y=new this.constructor(f);if(this.state!==_){var st=this.state===v?j:ot;T(Y,st,this.outcome)}else this.queue.push(new y(Y,j,ot));return Y};function y(j,ot,Y){this.promise=j,typeof ot=="function"&&(this.onFulfilled=ot,this.callFulfilled=this.otherCallFulfilled),typeof Y=="function"&&(this.onRejected=Y,this.callRejected=this.otherCallRejected)}y.prototype.callFulfilled=function(j){g.resolve(this.promise,j)},y.prototype.otherCallFulfilled=function(j){T(this.promise,this.onFulfilled,j)},y.prototype.callRejected=function(j){g.reject(this.promise,j)},y.prototype.otherCallRejected=function(j){T(this.promise,this.onRejected,j)};function T(j,ot,Y){u(function(){var st;try{st=ot(Y)}catch(Jt){return g.reject(j,Jt)}st===j?g.reject(j,new TypeError("Cannot resolve promise with itself")):g.resolve(j,st)})}g.resolve=function(j,ot){var Y=R(O,ot);if(Y.status==="error")return g.reject(j,Y.value);var st=Y.value;if(st)H(j,st);else{j.state=v,j.outcome=ot;for(var Jt=-1,me=j.queue.length;++Jt<me;)j.queue[Jt].callFulfilled(ot)}return j},g.reject=function(j,ot){j.state=h,j.outcome=ot;for(var Y=-1,st=j.queue.length;++Y<st;)j.queue[Y].callRejected(ot);return j};function O(j){var ot=j&&j.then;if(j&&(typeof j=="object"||typeof j=="function")&&typeof ot=="function")return function(){ot.apply(j,arguments)}}function H(j,ot){var Y=!1;function st(Ce){Y||(Y=!0,g.reject(j,Ce))}function Jt(Ce){Y||(Y=!0,g.resolve(j,Ce))}function me(){ot(Jt,st)}var pe=R(me);pe.status==="error"&&st(pe.value)}function R(j,ot){var Y={};try{Y.value=j(ot),Y.status="success"}catch(st){Y.status="error",Y.value=st}return Y}m.resolve=k;function k(j){return j instanceof this?j:g.resolve(new this(f),j)}m.reject=V;function V(j){var ot=new this(f);return g.reject(ot,j)}m.all=Ut;function Ut(j){var ot=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=j.length,st=!1;if(!Y)return this.resolve([]);for(var Jt=new Array(Y),me=0,pe=-1,Ce=new this(f);++pe<Y;)be(j[pe],pe);return Ce;function be(Bt,Te){ot.resolve(Bt).then(pt,function(Q){st||(st=!0,g.reject(Ce,Q))});function pt(Q){Jt[Te]=Q,++me===Y&&!st&&(st=!0,g.resolve(Ce,Jt))}}}m.race=de;function de(j){var ot=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=j.length,st=!1;if(!Y)return this.resolve([]);for(var Jt=-1,me=new this(f);++Jt<Y;)pe(j[Jt]);return me;function pe(Ce){ot.resolve(Ce).then(function(be){st||(st=!0,g.resolve(me,be))},function(be){st||(st=!0,g.reject(me,be))})}}},{1:1}],3:[function(s,o,c){(function(u){"use strict";typeof u.Promise!="function"&&(u.Promise=s(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(s,o,c){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};function f(d,E){if(!(d instanceof E))throw new TypeError("Cannot call a class as a function")}function g(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=g();function v(){try{if(!h||!h.open)return!1;var d=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),E=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!d||E)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function _(d,E){d=d||[],E=E||{};try{return new Blob(d,E)}catch(D){if(D.name!=="TypeError")throw D;for(var S=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,C=new S,x=0;x<d.length;x+=1)C.append(d[x]);return C.getBlob(E.type)}}typeof Promise>"u"&&s(3);var m=Promise;function y(d,E){E&&d.then(function(S){E(null,S)},function(S){E(S)})}function T(d,E,S){typeof E=="function"&&d.then(E),typeof S=="function"&&d.catch(S)}function O(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}function H(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var R="local-forage-detect-blob-support",k=void 0,V={},Ut=Object.prototype.toString,de="readonly",j="readwrite";function ot(d){for(var E=d.length,S=new ArrayBuffer(E),C=new Uint8Array(S),x=0;x<E;x++)C[x]=d.charCodeAt(x);return S}function Y(d){return new m(function(E){var S=d.transaction(R,j),C=_([""]);S.objectStore(R).put(C,"key"),S.onabort=function(x){x.preventDefault(),x.stopPropagation(),E(!1)},S.oncomplete=function(){var x=navigator.userAgent.match(/Chrome\/(\d+)/),D=navigator.userAgent.match(/Edge\//);E(D||!x||parseInt(x[1],10)>=43)}}).catch(function(){return!1})}function st(d){return typeof k=="boolean"?m.resolve(k):Y(d).then(function(E){return k=E,k})}function Jt(d){var E=V[d.name],S={};S.promise=new m(function(C,x){S.resolve=C,S.reject=x}),E.deferredOperations.push(S),E.dbReady?E.dbReady=E.dbReady.then(function(){return S.promise}):E.dbReady=S.promise}function me(d){var E=V[d.name],S=E.deferredOperations.pop();if(S)return S.resolve(),S.promise}function pe(d,E){var S=V[d.name],C=S.deferredOperations.pop();if(C)return C.reject(E),C.promise}function Ce(d,E){return new m(function(S,C){if(V[d.name]=V[d.name]||en(),d.db)if(E)Jt(d),d.db.close();else return S(d.db);var x=[d.name];E&&x.push(d.version);var D=h.open.apply(h,x);E&&(D.onupgradeneeded=function(P){var U=D.result;try{U.createObjectStore(d.storeName),P.oldVersion<=1&&U.createObjectStore(R)}catch(F){if(F.name==="ConstraintError")console.warn('The database "'+d.name+'" has been upgraded from version '+P.oldVersion+" to version "+P.newVersion+', but the storage "'+d.storeName+'" already exists.');else throw F}}),D.onerror=function(P){P.preventDefault(),C(D.error)},D.onsuccess=function(){var P=D.result;P.onversionchange=function(U){U.target.close()},S(P),me(d)}})}function be(d){return Ce(d,!1)}function Bt(d){return Ce(d,!0)}function Te(d,E){if(!d.db)return!0;var S=!d.db.objectStoreNames.contains(d.storeName),C=d.version<d.db.version,x=d.version>d.db.version;if(C&&(d.version!==E&&console.warn('The database "'+d.name+`" can't be downgraded from version `+d.db.version+" to version "+d.version+"."),d.version=d.db.version),x||S){if(S){var D=d.db.version+1;D>d.version&&(d.version=D)}return!0}return!1}function pt(d){return new m(function(E,S){var C=new FileReader;C.onerror=S,C.onloadend=function(x){var D=btoa(x.target.result||"");E({__local_forage_encoded_blob:!0,data:D,type:d.type})},C.readAsBinaryString(d)})}function Q(d){var E=ot(atob(d.data));return _([E],{type:d.type})}function we(d){return d&&d.__local_forage_encoded_blob}function ar(d){var E=this,S=E._initReady().then(function(){var C=V[E._dbInfo.name];if(C&&C.dbReady)return C.dbReady});return T(S,d,d),S}function jr(d){Jt(d);for(var E=V[d.name],S=E.forages,C=0;C<S.length;C++){var x=S[C];x._dbInfo.db&&(x._dbInfo.db.close(),x._dbInfo.db=null)}return d.db=null,be(d).then(function(D){return d.db=D,Te(d)?Bt(d):D}).then(function(D){d.db=E.db=D;for(var P=0;P<S.length;P++)S[P]._dbInfo.db=D}).catch(function(D){throw pe(d,D),D})}function ke(d,E,S,C){C===void 0&&(C=1);try{var x=d.db.transaction(d.storeName,E);S(null,x)}catch(D){if(C>0&&(!d.db||D.name==="InvalidStateError"||D.name==="NotFoundError"))return m.resolve().then(function(){if(!d.db||D.name==="NotFoundError"&&!d.db.objectStoreNames.contains(d.storeName)&&d.version<=d.db.version)return d.db&&(d.version=d.db.version+1),Bt(d)}).then(function(){return jr(d).then(function(){ke(d,E,S,C-1)})}).catch(S);S(D)}}function en(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hn(d){var E=this,S={db:null};if(d)for(var C in d)S[C]=d[C];var x=V[S.name];x||(x=en(),V[S.name]=x),x.forages.push(E),E._initReady||(E._initReady=E.ready,E.ready=ar);var D=[];function P(){return m.resolve()}for(var U=0;U<x.forages.length;U++){var F=x.forages[U];F!==E&&D.push(F._initReady().catch(P))}var $=x.forages.slice(0);return m.all(D).then(function(){return S.db=x.db,be(S)}).then(function(B){return S.db=B,Te(S,E._defaultConfig.version)?Bt(S):B}).then(function(B){S.db=x.db=B,E._dbInfo=S;for(var G=0;G<$.length;G++){var mt=$[G];mt!==E&&(mt._dbInfo.db=S.db,mt._dbInfo.version=S.version)}})}function kn(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,de,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.get(d);$.onsuccess=function(){var B=$.result;B===void 0&&(B=null),we(B)&&(B=Q(B)),x(B)},$.onerror=function(){D($.error)}}catch(B){D(B)}})}).catch(D)});return y(C,E),C}function Hi(d,E){var S=this,C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,de,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.openCursor(),B=1;$.onsuccess=function(){var G=$.result;if(G){var mt=G.value;we(mt)&&(mt=Q(mt));var he=d(mt,G.key,B++);he!==void 0?x(he):G.continue()}else x()},$.onerror=function(){D($.error)}}catch(G){D(G)}})}).catch(D)});return y(C,E),C}function Wi(d,E,S){var C=this;d=O(d);var x=new m(function(D,P){var U;C.ready().then(function(){return U=C._dbInfo,Ut.call(E)==="[object Blob]"?st(U.db).then(function(F){return F?E:pt(E)}):E}).then(function(F){ke(C._dbInfo,j,function($,B){if($)return P($);try{var G=B.objectStore(C._dbInfo.storeName);F===null&&(F=void 0);var mt=G.put(F,d);B.oncomplete=function(){F===void 0&&(F=null),D(F)},B.onabort=B.onerror=function(){var he=mt.error?mt.error:mt.transaction.error;P(he)}}catch(he){P(he)}})}).catch(P)});return y(x,S),x}function ji(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,j,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.delete(d);U.oncomplete=function(){x()},U.onerror=function(){D($.error)},U.onabort=function(){var B=$.error?$.error:$.transaction.error;D(B)}}catch(B){D(B)}})}).catch(D)});return y(C,E),C}function Mn(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,j,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.clear();P.oncomplete=function(){C()},P.onabort=P.onerror=function(){var $=F.error?F.error:F.transaction.error;x($)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function Pe(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,de,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.count();F.onsuccess=function(){C(F.result)},F.onerror=function(){x(F.error)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function $r(d,E){var S=this,C=new m(function(x,D){if(d<0){x(null);return}S.ready().then(function(){ke(S._dbInfo,de,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=!1,B=F.openKeyCursor();B.onsuccess=function(){var G=B.result;if(!G){x(null);return}d===0||$?x(G.key):($=!0,G.advance(d))},B.onerror=function(){D(B.error)}}catch(G){D(G)}})}).catch(D)});return y(C,E),C}function rs(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,de,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.openKeyCursor(),$=[];F.onsuccess=function(){var B=F.result;if(!B){C($);return}$.push(B.key),B.continue()},F.onerror=function(){x(F.error)}}catch(B){x(B)}})}).catch(x)});return y(S,d),S}function a(d,E){E=H.apply(this,arguments);var S=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||S.name,d.storeName=d.storeName||S.storeName);var C=this,x;if(!d.name)x=m.reject("Invalid arguments");else{var D=d.name===S.name&&C._dbInfo.db,P=D?m.resolve(C._dbInfo.db):be(d).then(function(U){var F=V[d.name],$=F.forages;F.db=U;for(var B=0;B<$.length;B++)$[B]._dbInfo.db=U;return U});d.storeName?x=P.then(function(U){if(U.objectStoreNames.contains(d.storeName)){var F=U.version+1;Jt(d);var $=V[d.name],B=$.forages;U.close();for(var G=0;G<B.length;G++){var mt=B[G];mt._dbInfo.db=null,mt._dbInfo.version=F}var he=new m(function(oe,Ie){var ye=h.open(d.name,F);ye.onerror=function(Ve){var Wu=ye.result;Wu.close(),Ie(Ve)},ye.onupgradeneeded=function(){var Ve=ye.result;Ve.deleteObjectStore(d.storeName)},ye.onsuccess=function(){var Ve=ye.result;Ve.close(),oe(Ve)}});return he.then(function(oe){$.db=oe;for(var Ie=0;Ie<B.length;Ie++){var ye=B[Ie];ye._dbInfo.db=oe,me(ye._dbInfo)}}).catch(function(oe){throw(pe(d,oe)||m.resolve()).catch(function(){}),oe})}}):x=P.then(function(U){Jt(d);var F=V[d.name],$=F.forages;U.close();for(var B=0;B<$.length;B++){var G=$[B];G._dbInfo.db=null}var mt=new m(function(he,oe){var Ie=h.deleteDatabase(d.name);Ie.onerror=function(){var ye=Ie.result;ye&&ye.close(),oe(Ie.error)},Ie.onblocked=function(){console.warn('dropInstance blocked for database "'+d.name+'" until all open connections are closed')},Ie.onsuccess=function(){var ye=Ie.result;ye&&ye.close(),he(ye)}});return mt.then(function(he){F.db=he;for(var oe=0;oe<$.length;oe++){var Ie=$[oe];me(Ie._dbInfo)}}).catch(function(he){throw(pe(d,he)||m.resolve()).catch(function(){}),he})})}return y(x,E),x}var l={_driver:"asyncStorage",_initStorage:Hn,_support:v(),iterate:Hi,getItem:kn,setItem:Wi,removeItem:ji,clear:Mn,length:Pe,key:$r,keys:rs,dropInstance:a};function p(){return typeof openDatabase=="function"}var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="~~local_forage_type~",L=/^~~local_forage_type~([^~]+)~/,W="__lfsc__:",te=W.length,St="arbf",Ct="blob",le="si08",z="ui08",ft="uic8",X="si16",ie="si32",$e="ur16",Me="ui32",re="fl32",J="fl64",He=te+St.length,As=Object.prototype.toString;function Yo(d){var E=d.length*.75,S=d.length,C,x=0,D,P,U,F;d[d.length-1]==="="&&(E--,d[d.length-2]==="="&&E--);var $=new ArrayBuffer(E),B=new Uint8Array($);for(C=0;C<S;C+=4)D=I.indexOf(d[C]),P=I.indexOf(d[C+1]),U=I.indexOf(d[C+2]),F=I.indexOf(d[C+3]),B[x++]=D<<2|P>>4,B[x++]=(P&15)<<4|U>>2,B[x++]=(U&3)<<6|F&63;return $}function Ec(d){var E=new Uint8Array(d),S="",C;for(C=0;C<E.length;C+=3)S+=I[E[C]>>2],S+=I[(E[C]&3)<<4|E[C+1]>>4],S+=I[(E[C+1]&15)<<2|E[C+2]>>6],S+=I[E[C+2]&63];return E.length%3===2?S=S.substring(0,S.length-1)+"=":E.length%3===1&&(S=S.substring(0,S.length-2)+"=="),S}function $d(d,E){var S="";if(d&&(S=As.call(d)),d&&(S==="[object ArrayBuffer]"||d.buffer&&As.call(d.buffer)==="[object ArrayBuffer]")){var C,x=W;d instanceof ArrayBuffer?(C=d,x+=St):(C=d.buffer,S==="[object Int8Array]"?x+=le:S==="[object Uint8Array]"?x+=z:S==="[object Uint8ClampedArray]"?x+=ft:S==="[object Int16Array]"?x+=X:S==="[object Uint16Array]"?x+=$e:S==="[object Int32Array]"?x+=ie:S==="[object Uint32Array]"?x+=Me:S==="[object Float32Array]"?x+=re:S==="[object Float64Array]"?x+=J:E(new Error("Failed to get type for BinaryArray"))),E(x+Ec(C))}else if(S==="[object Blob]"){var D=new FileReader;D.onload=function(){var P=N+d.type+"~"+Ec(this.result);E(W+Ct+P)},D.readAsArrayBuffer(d)}else try{E(JSON.stringify(d))}catch(P){console.error("Couldn't convert value into a JSON string: ",d),E(null,P)}}function Fd(d){if(d.substring(0,te)!==W)return JSON.parse(d);var E=d.substring(He),S=d.substring(te,He),C;if(S===Ct&&L.test(E)){var x=E.match(L);C=x[1],E=E.substring(x[0].length)}var D=Yo(E);switch(S){case St:return D;case Ct:return _([D],{type:C});case le:return new Int8Array(D);case z:return new Uint8Array(D);case ft:return new Uint8ClampedArray(D);case X:return new Int16Array(D);case $e:return new Uint16Array(D);case ie:return new Int32Array(D);case Me:return new Uint32Array(D);case re:return new Float32Array(D);case J:return new Float64Array(D);default:throw new Error("Unkown type: "+S)}}var Sc={serialize:$d,deserialize:Fd,stringToBuffer:Yo,bufferToString:Ec};function th(d,E,S,C){d.executeSql("CREATE TABLE IF NOT EXISTS "+E.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],S,C)}function Hd(d){var E=this,S={db:null};if(d)for(var C in d)S[C]=typeof d[C]!="string"?d[C].toString():d[C];var x=new m(function(D,P){try{S.db=openDatabase(S.name,String(S.version),S.description,S.size)}catch(U){return P(U)}S.db.transaction(function(U){th(U,S,function(){E._dbInfo=S,D()},function(F,$){P($)})},P)});return S.serializer=Sc,x}function Fn(d,E,S,C,x,D){d.executeSql(S,C,x,function(P,U){U.code===U.SYNTAX_ERR?P.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[E.storeName],function(F,$){$.rows.length?D(F,U):th(F,E,function(){F.executeSql(S,C,x,D)},D)},D):D(P,U)},D)}function Vd(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT * FROM "+P.storeName+" WHERE key = ? LIMIT 1",[d],function(F,$){var B=$.rows.length?$.rows.item(0).value:null;B&&(B=P.serializer.deserialize(B)),x(B)},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function qd(d,E){var S=this,C=new m(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT * FROM "+P.storeName,[],function(F,$){for(var B=$.rows,G=B.length,mt=0;mt<G;mt++){var he=B.item(mt),oe=he.value;if(oe&&(oe=P.serializer.deserialize(oe)),oe=d(oe,he.key,mt+1),oe!==void 0){x(oe);return}}x()},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function eh(d,E,S,C){var x=this;d=O(d);var D=new m(function(P,U){x.ready().then(function(){E===void 0&&(E=null);var F=E,$=x._dbInfo;$.serializer.serialize(E,function(B,G){G?U(G):$.db.transaction(function(mt){Fn(mt,$,"INSERT OR REPLACE INTO "+$.storeName+" (key, value) VALUES (?, ?)",[d,B],function(){P(F)},function(he,oe){U(oe)})},function(mt){if(mt.code===mt.QUOTA_ERR){if(C>0){P(eh.apply(x,[d,F,S,C-1]));return}U(mt)}})})}).catch(U)});return y(D,S),D}function Wd(d,E,S){return eh.apply(this,[d,E,S,1])}function zd(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"DELETE FROM "+P.storeName+" WHERE key = ?",[d],function(){x()},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function Kd(d){var E=this,S=new m(function(C,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"DELETE FROM "+D.storeName,[],function(){C()},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Gd(d){var E=this,S=new m(function(C,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"SELECT COUNT(key) as c FROM "+D.storeName,[],function(U,F){var $=F.rows.item(0).c;C($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Yd(d,E){var S=this,C=new m(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT key FROM "+P.storeName+" WHERE id = ? LIMIT 1",[d+1],function(F,$){var B=$.rows.length?$.rows.item(0).key:null;x(B)},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function Xd(d){var E=this,S=new m(function(C,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"SELECT key FROM "+D.storeName,[],function(U,F){for(var $=[],B=0;B<F.rows.length;B++)$.push(F.rows.item(B).key);C($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Jd(d){return new m(function(E,S){d.transaction(function(C){C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(x,D){for(var P=[],U=0;U<D.rows.length;U++)P.push(D.rows.item(U).name);E({db:d,storeNames:P})},function(x,D){S(D)})},function(C){S(C)})})}function Zd(d,E){E=H.apply(this,arguments);var S=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||S.name,d.storeName=d.storeName||S.storeName);var C=this,x;return d.name?x=new m(function(D){var P;d.name===S.name?P=C._dbInfo.db:P=openDatabase(d.name,"","",0),d.storeName?D({db:P,storeNames:[d.storeName]}):D(Jd(P))}).then(function(D){return new m(function(P,U){D.db.transaction(function(F){function $(he){return new m(function(oe,Ie){F.executeSql("DROP TABLE IF EXISTS "+he,[],function(){oe()},function(ye,Ve){Ie(Ve)})})}for(var B=[],G=0,mt=D.storeNames.length;G<mt;G++)B.push($(D.storeNames[G]));m.all(B).then(function(){P()}).catch(function(he){U(he)})},function(F){U(F)})})}):x=m.reject("Invalid arguments"),y(x,E),x}var Qd={_driver:"webSQLStorage",_initStorage:Hd,_support:p(),iterate:qd,getItem:Vd,setItem:Wd,removeItem:zd,clear:Kd,length:Gd,key:Yd,keys:Xd,dropInstance:Zd};function kg(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function rh(d,E){var S=d.name+"/";return d.storeName!==E.storeName&&(S+=d.storeName+"/"),S}function Om(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function Vm(){return!Om()||localStorage.length>0}function zm(d){var E=this,S={};if(d)for(var C in d)S[C]=d[C];return S.keyPrefix=rh(d,E._defaultConfig),Vm()?(E._dbInfo=S,S.serializer=Sc,m.resolve()):m.reject()}function Gm(d){var E=this,S=E.ready().then(function(){for(var C=E._dbInfo.keyPrefix,x=localStorage.length-1;x>=0;x--){var D=localStorage.key(x);D.indexOf(C)===0&&localStorage.removeItem(D)}});return y(S,d),S}function kv(d,E){var S=this;d=O(d);var C=S.ready().then(function(){var x=S._dbInfo,D=localStorage.getItem(x.keyPrefix+d);return D&&(D=x.serializer.deserialize(D)),D});return y(C,E),C}function Pv(d,E){var S=this,C=S.ready().then(function(){for(var x=S._dbInfo,D=x.keyPrefix,P=D.length,U=localStorage.length,F=1,$=0;$<U;$++){var B=localStorage.key($);if(B.indexOf(D)===0){var G=localStorage.getItem(B);if(G&&(G=x.serializer.deserialize(G)),G=d(G,B.substring(P),F++),G!==void 0)return G}}});return y(C,E),C}function Lv(d,E){var S=this,C=S.ready().then(function(){var x=S._dbInfo,D;try{D=localStorage.key(d)}catch{D=null}return D&&(D=D.substring(x.keyPrefix.length)),D});return y(C,E),C}function Mv(d){var E=this,S=E.ready().then(function(){for(var C=E._dbInfo,x=localStorage.length,D=[],P=0;P<x;P++){var U=localStorage.key(P);U.indexOf(C.keyPrefix)===0&&D.push(U.substring(C.keyPrefix.length))}return D});return y(S,d),S}function Uv(d){var E=this,S=E.keys().then(function(C){return C.length});return y(S,d),S}function jv(d,E){var S=this;d=O(d);var C=S.ready().then(function(){var x=S._dbInfo;localStorage.removeItem(x.keyPrefix+d)});return y(C,E),C}function Bv(d,E,S){var C=this;d=O(d);var x=C.ready().then(function(){E===void 0&&(E=null);var D=E;return new m(function(P,U){var F=C._dbInfo;F.serializer.serialize(E,function($,B){if(B)U(B);else try{localStorage.setItem(F.keyPrefix+d,$),P(D)}catch(G){(G.name==="QuotaExceededError"||G.name==="NS_ERROR_DOM_QUOTA_REACHED")&&U(G),U(G)}})})});return y(x,S),x}function $v(d,E){if(E=H.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var S=this.config();d.name=d.name||S.name,d.storeName=d.storeName||S.storeName}var C=this,x;return d.name?x=new m(function(D){d.storeName?D(rh(d,C._defaultConfig)):D(d.name+"/")}).then(function(D){for(var P=localStorage.length-1;P>=0;P--){var U=localStorage.key(P);U.indexOf(D)===0&&localStorage.removeItem(U)}}):x=m.reject("Invalid arguments"),y(x,E),x}var Fv={_driver:"localStorageWrapper",_initStorage:zm,_support:kg(),iterate:Pv,getItem:kv,setItem:Bv,removeItem:jv,clear:Gm,length:Uv,key:Lv,keys:Mv,dropInstance:$v},Hv=function(d,E){return d===E||typeof d=="number"&&typeof E=="number"&&isNaN(d)&&isNaN(E)},Wv=function(d,E){for(var S=d.length,C=0;C<S;){if(Hv(d[C],E))return!0;C++}return!1},nh=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},$a={},fh={},to={INDEXEDDB:l,WEBSQL:Qd,LOCALSTORAGE:Fv},Gv=[to.INDEXEDDB._driver,to.WEBSQL._driver,to.LOCALSTORAGE._driver],bc=["dropInstance"],Yc=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(bc),Oy={description:"",driver:Gv.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Py(d,E){d[E]=function(){var S=arguments;return d.ready().then(function(){return d[E].apply(d,S)})}}function qu(){for(var d=1;d<arguments.length;d++){var E=arguments[d];if(E)for(var S in E)E.hasOwnProperty(S)&&(nh(E[S])?arguments[0][S]=E[S].slice():arguments[0][S]=E[S])}return arguments[0]}var tb=function(){function d(E){f(this,d);for(var S in to)if(to.hasOwnProperty(S)){var C=to[S],x=C._driver;this[S]=x,$a[x]||this.defineDriver(C)}this._defaultConfig=qu({},Oy),this._config=qu({},this._defaultConfig,E),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return d.prototype.config=function(E){if((typeof E>"u"?"undefined":u(E))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var S in E){if(S==="storeName"&&(E[S]=E[S].replace(/\W/g,"_")),S==="version"&&typeof E[S]!="number")return new Error("Database version must be a number.");this._config[S]=E[S]}return"driver"in E&&E.driver?this.setDriver(this._config.driver):!0}else return typeof E=="string"?this._config[E]:this._config},d.prototype.defineDriver=function(E,S,C){var x=new m(function(D,P){try{var U=E._driver,F=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!E._driver){P(F);return}for(var $=Yc.concat("_initStorage"),B=0,G=$.length;B<G;B++){var mt=$[B],he=!Wv(bc,mt);if((he||E[mt])&&typeof E[mt]!="function"){P(F);return}}var oe=function(){for(var ye=function(rb){return function(){var nb=new Error("Method "+rb+" is not implemented by the current driver"),Yh=m.reject(nb);return y(Yh,arguments[arguments.length-1]),Yh}},Ve=0,Wu=bc.length;Ve<Wu;Ve++){var zu=bc[Ve];E[zu]||(E[zu]=ye(zu))}};oe();var Ie=function(ye){$a[U]&&console.info("Redefining LocalForage driver: "+U),$a[U]=E,fh[U]=ye,D()};"_support"in E?E._support&&typeof E._support=="function"?E._support().then(Ie,P):Ie(!!E._support):Ie(!0)}catch(ye){P(ye)}});return T(x,S,C),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(E,S,C){var x=$a[E]?m.resolve($a[E]):m.reject(new Error("Driver not found."));return T(x,S,C),x},d.prototype.getSerializer=function(E){var S=m.resolve(Sc);return T(S,E),S},d.prototype.ready=function(E){var S=this,C=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return T(C,E,E),C},d.prototype.setDriver=function(E,S,C){var x=this;nh(E)||(E=[E]);var D=this._getSupportedDrivers(E);function P(){x._config.driver=x.driver()}function U(B){return x._extend(B),P(),x._ready=x._initStorage(x._config),x._ready}function F(B){return function(){var G=0;function mt(){for(;G<B.length;){var he=B[G];return G++,x._dbInfo=null,x._ready=null,x.getDriver(he).then(U).catch(mt)}P();var oe=new Error("No available storage method found.");return x._driverSet=m.reject(oe),x._driverSet}return mt()}}var $=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=$.then(function(){var B=D[0];return x._dbInfo=null,x._ready=null,x.getDriver(B).then(function(G){x._driver=G._driver,P(),x._wrapLibraryMethodsWithReady(),x._initDriver=F(D)})}).catch(function(){P();var B=new Error("No available storage method found.");return x._driverSet=m.reject(B),x._driverSet}),T(this._driverSet,S,C),this._driverSet},d.prototype.supports=function(E){return!!fh[E]},d.prototype._extend=function(E){qu(this,E)},d.prototype._getSupportedDrivers=function(E){for(var S=[],C=0,x=E.length;C<x;C++){var D=E[C];this.supports(D)&&S.push(D)}return S},d.prototype._wrapLibraryMethodsWithReady=function(){for(var E=0,S=Yc.length;E<S;E++)Py(this,Yc[E])},d.prototype.createInstance=function(E){return new d(E)},d}(),eb=new tb;o.exports=eb},{3:3}]},{},[4])(4)})}),vl=Vi(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URLBuilder=void 0;var e=function(){function r(n){try{this.base=new URL(n),this.params=new URLSearchParams(this.base.search.slice(1))}catch(i){console.error("Un-parsable URL",i)}}return r.prototype.appendQueryParam=function(n,i){this.params.append(n,i?i.toString():"")},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(n){this.params.delete(n)},r.prototype.getBase=function(){return this.base},r.prototype.getPath=function(){return this.base.pathname},r.prototype.getHostname=function(){return this.base.hostname},r.prototype.getParams=function(){return this.params},r.prototype.getQueryParam=function(n){if(!this.params)return"";var i=this.params.get(n);return!i||i==="undefined"||i==="null"?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(n){return this.base.pathname=n,this},r.prototype.setQueryParam=function(n,i){return this.params.set(n,i?i.toString():""),this},r.prototype.setQueryString=function(n){if(n)return n[0]==="?"&&(n=n.slice(1)),this.params=new URLSearchParams(n),this},r.prototype.toString=function(){var n=this.params.toString();return n===""?this.base.search="":this.base.search="?"+n,this.base.toString()},r}();t.URLBuilder=e}),fd=Vi((t,e)=>{"use strict";(function(r,n){typeof t=="object"&&typeof e<"u"?e.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(t,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(u,f){var g=o.retries,h=o.retryDelay,v=o.retryOn;if(f&&f.retries!==void 0)if(n(f.retries))g=f.retries;else throw new i("retries must be a positive integer");if(f&&f.retryDelay!==void 0)if(n(f.retryDelay)||typeof f.retryDelay=="function")h=f.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(f&&f.retryOn)if(Array.isArray(f.retryOn)||typeof f.retryOn=="function")v=f.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(_,m){var y=function(O){var H=typeof Request<"u"&&u instanceof Request?u.clone():u;s(H,f).then(function(R){if(Array.isArray(v)&&v.indexOf(R.status)===-1)_(R);else if(typeof v=="function")try{return Promise.resolve(v(O,null,R)).then(function(k){k?T(O,null,R):_(R)}).catch(m)}catch(k){m(k)}else O<g?T(O,null,R):_(R)}).catch(function(R){if(typeof v=="function")try{Promise.resolve(v(O,R,null)).then(function(k){k?T(O,R,null):m(R)}).catch(function(k){m(k)})}catch(k){m(k)}else O<g?T(O,R,null):m(R)})};function T(O,H,R){var k=typeof h=="function"?h(O,H,R):h;setTimeout(function(){y(++O)},k)}y(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r})}),Gr={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production"},Dt=Xt(tn()),rp="9.3.5",A=class Ku{static SDK_VERSION=rp;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static CTA_EVENT="letscooee:outbound:cta";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static{let e=Ku.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ku.SDK_VERSION_CODE=parseInt(e,10)}},w=class{static log(...t){Dt.default.info(...t)}static debug(...t){Dt.default.debug(...t)}static error(...t){Dt.default.error(...t)}static warn(...t){Dt.default.warn(...t)}static info(...t){Dt.default.info(...t)}static trace(...t){Dt.default.trace(...t)}static configure(t=A.LOG_PREFIX){Dt.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${A.SDK_VERSION}):`)}});let e=this.getDebugParam();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Dt.default.setLevel(Dt.default[localStorage.cooeeLogLevel]):Dt.default.setLevel(Gr.debug?Dt.default.TRACE:Dt.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let t=`
|
|
1
|
+
"use strict";(()=>{var ih=Object.create,wc=Object.defineProperty,oh=Object.defineProperties,sh=Object.getOwnPropertyDescriptor,ah=Object.getOwnPropertyDescriptors,ch=Object.getOwnPropertyNames,Qu=Object.getOwnPropertySymbols,lh=Object.getPrototypeOf,ep=Object.prototype.hasOwnProperty,uh=Object.prototype.propertyIsEnumerable,Zu=(t,e,r)=>e in t?wc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,b=(t,e)=>{for(var r in e||={})ep.call(e,r)&&Zu(t,r,e[r]);if(Qu)for(var r of Qu(e))uh.call(e,r)&&Zu(t,r,e[r]);return t},Z=(t,e)=>oh(t,ah(e)),Gi=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Vi=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),ph=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ch(e))!ep.call(t,i)&&i!==r&&wc(t,i,{get:()=>e[i],enumerable:!(n=sh(e,i))||n.enumerable});return t},Xt=(t,e,r)=>(r=t!=null?ih(lh(t)):{},ph(e||!t||!t.__esModule?wc(r,"default",{value:t,enumerable:!0}):r,t)),tn=Vi((t,e)=>{"use strict";(function(r){"use strict";var n={};n.VERSION="1.6.1";var i,s={},o=function(h,v){return function(){return v.apply(h,arguments)}},c=function(){var h=arguments,v=h[0],_,m;for(m=1;m<h.length;m++)for(_ in h[m])!(_ in v)&&h[m].hasOwnProperty(_)&&(v[_]=h[m][_]);return v},u=function(h,v){return{value:h,name:v}};n.TRACE=u(1,"TRACE"),n.DEBUG=u(2,"DEBUG"),n.INFO=u(3,"INFO"),n.TIME=u(4,"TIME"),n.WARN=u(5,"WARN"),n.ERROR=u(8,"ERROR"),n.OFF=u(99,"OFF");var f=function(h){this.context=h,this.setLevel(h.filterLevel),this.log=this.info};f.prototype={setLevel:function(h){h&&"value"in h&&(this.context.filterLevel=h)},getLevel:function(){return this.context.filterLevel},enabledFor:function(h){var v=this.context.filterLevel;return h.value>=v.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"start"])},timeEnd:function(h){typeof h=="string"&&h.length>0&&this.invoke(n.TIME,[h,"end"])},invoke:function(h,v){i&&this.enabledFor(h)&&i(v,c({level:h},this.context))}};var g=new f({filterLevel:n.OFF});(function(){var h=n;h.enabledFor=o(g,g.enabledFor),h.trace=o(g,g.trace),h.debug=o(g,g.debug),h.time=o(g,g.time),h.timeEnd=o(g,g.timeEnd),h.info=o(g,g.info),h.warn=o(g,g.warn),h.error=o(g,g.error),h.log=h.info})(),n.setHandler=function(h){i=h},n.setLevel=function(h){g.setLevel(h);for(var v in s)s.hasOwnProperty(v)&&s[v].setLevel(h)},n.getLevel=function(){return g.getLevel()},n.get=function(h){return s[h]||(s[h]=new f(c({name:h},g.context)))},n.createDefaultHandler=function(h){h=h||{},h.formatter=h.formatter||function(m,y){y.name&&m.unshift("["+y.name+"]")};var v={},_=function(m,y){Function.prototype.apply.call(m,console,y)};return typeof console>"u"?function(){}:function(m,y){m=Array.prototype.slice.call(m);var T=console.log,O;y.level===n.TIME?(O=(y.name?"["+y.name+"] ":"")+m[0],m[1]==="start"?console.time?console.time(O):v[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):_(T,[O+": "+(new Date().getTime()-v[O])+"ms"])):(y.level===n.WARN&&console.warn?T=console.warn:y.level===n.ERROR&&console.error?T=console.error:y.level===n.INFO&&console.info?T=console.info:y.level===n.DEBUG&&console.debug?T=console.debug:y.level===n.TRACE&&console.trace&&(T=console.trace),h.formatter(m,y),_(T,m))}},n.useDefaults=function(h){n.setLevel(h&&h.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(h))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof e<"u"&&e.exports?e.exports=n:(n._prevLogger=r.Logger,n.noConflict=function(){return r.Logger=n._prevLogger,n},r.Logger=n)})(t)}),Bp=Vi((t,e)=>{"use strict";(function(r,n){"use strict";var i="1.0.40",s="",o="?",c="function",u="undefined",f="object",g="string",h="major",v="model",_="name",m="type",y="vendor",T="version",O="architecture",H="console",R="mobile",k="tablet",V="smarttv",Ut="wearable",de="embedded",j=500,ot="Amazon",Y="Apple",st="ASUS",Jt="BlackBerry",me="Browser",pe="Chrome",Ce="Edge",be="Firefox",Bt="Google",Te="Huawei",pt="LG",Q="Microsoft",we="Motorola",ar="Opera",jr="Samsung",ke="Sharp",en="Sony",Hn="Xiaomi",kn="Zebra",Hi="Facebook",Wi="Chromium OS",ji="Mac OS",Mn=" Browser",Pe=function(z,ft){var X={};for(var ie in z)ft[ie]&&ft[ie].length%2===0?X[ie]=ft[ie].concat(z[ie]):X[ie]=z[ie];return X},$r=function(z){for(var ft={},X=0;X<z.length;X++)ft[z[X].toUpperCase()]=z[X];return ft},rs=function(z,ft){return typeof z===g?a(ft).indexOf(a(z))!==-1:!1},a=function(z){return z.toLowerCase()},l=function(z){return typeof z===g?z.replace(/[^\d\.]/g,s).split(".")[0]:n},p=function(z,ft){if(typeof z===g)return z=z.replace(/^\s\s*/,s),typeof ft===u?z:z.substring(0,j)},I=function(z,ft){for(var X=0,ie,$e,Me,re,J,He;X<ft.length&&!J;){var As=ft[X],Yo=ft[X+1];for(ie=$e=0;ie<As.length&&!J&&As[ie];)if(J=As[ie++].exec(z),J)for(Me=0;Me<Yo.length;Me++)He=J[++$e],re=Yo[Me],typeof re===f&&re.length>0?re.length===2?typeof re[1]==c?this[re[0]]=re[1].call(this,He):this[re[0]]=re[1]:re.length===3?typeof re[1]===c&&!(re[1].exec&&re[1].test)?this[re[0]]=He?re[1].call(this,He,re[2]):n:this[re[0]]=He?He.replace(re[1],re[2]):n:re.length===4&&(this[re[0]]=He?re[3].call(this,He.replace(re[1],re[2])):n):this[re]=He||n;X+=2}},N=function(z,ft){for(var X in ft)if(typeof ft[X]===f&&ft[X].length>0){for(var ie=0;ie<ft[X].length;ie++)if(rs(ft[X][ie],z))return X===o?n:X}else if(rs(ft[X],z))return X===o?n:X;return ft.hasOwnProperty("*")?ft["*"]:z},L={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},W={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},te={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[T,[_,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[T,[_,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[_,T],[/opios[\/ ]+([\w\.]+)/i],[T,[_,ar+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[T,[_,ar+" GX"]],[/\bopr\/([\w\.]+)/i],[T,[_,ar]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[T,[_,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[T,[_,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[_,T],[/quark(?:pc)?\/([-\w\.]+)/i],[T,[_,"Quark"]],[/\bddg\/([\w\.]+)/i],[T,[_,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[T,[_,"UC"+me]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[T,[_,"WeChat"]],[/konqueror\/([\w\.]+)/i],[T,[_,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[T,[_,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[T,[_,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[T,[_,"Smart Lenovo "+me]],[/(avast|avg)\/([\w\.]+)/i],[[_,/(.+)/,"$1 Secure "+me],T],[/\bfocus\/([\w\.]+)/i],[T,[_,be+" Focus"]],[/\bopt\/([\w\.]+)/i],[T,[_,ar+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[T,[_,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[T,[_,"Dolphin"]],[/coast\/([\w\.]+)/i],[T,[_,ar+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[T,[_,"MIUI"+Mn]],[/fxios\/([\w\.-]+)/i],[T,[_,be]],[/\bqihoobrowser\/?([\w\.]*)/i],[T,[_,"360"]],[/\b(qq)\/([\w\.]+)/i],[[_,/(.+)/,"$1Browser"],T],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[_,/(.+)/,"$1"+Mn],T],[/samsungbrowser\/([\w\.]+)/i],[T,[_,jr+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[T,[_,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[_,"Sogou Mobile"],T],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[_,T],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[_],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[T,_],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[_,Hi],T],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[_,T],[/\bgsa\/([\w\.]+) .*safari\//i],[T,[_,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[T,[_,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[T,[_,pe+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[_,pe+" WebView"],T],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[T,[_,"Android "+me]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[_,T],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[T,[_,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[T,_],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[_,[T,N,L]],[/(webkit|khtml)\/([\w\.]+)/i],[_,T],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[_,"Netscape"],T],[/(wolvic|librewolf)\/([\w\.]+)/i],[_,T],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[T,[_,be+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[_,[T,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[_,[T,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[O,"amd64"]],[/(ia32(?=;))/i],[[O,a]],[/((?:i[346]|x)86)[;\)]/i],[[O,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[O,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[O,"armhf"]],[/windows (ce|mobile); ppc;/i],[[O,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[O,/ower/,s,a]],[/(sun4\w)[;\)]/i],[[O,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[O,a]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[v,[y,jr],[m,k]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[v,[y,jr],[m,R]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[v,[y,Y],[m,R]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[v,[y,Y],[m,k]],[/(macintosh);/i],[v,[y,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[v,[y,ke],[m,R]],[/(?:honor)([-\w ]+)[;\)]/i],[v,[y,"Honor"],[m,R]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[v,[y,Te],[m,k]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[v,[y,Te],[m,R]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[m,R]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[v,/_/g," "],[y,Hn],[m,k]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[v,[y,"OPPO"],[m,R]],[/\b(opd2\d{3}a?) bui/i],[v,[y,"OPPO"],[m,k]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[v,[y,"Vivo"],[m,R]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[v,[y,"Realme"],[m,R]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[v,[y,we],[m,R]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[v,[y,we],[m,k]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[v,[y,pt],[m,k]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[v,[y,pt],[m,R]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[v,[y,"Lenovo"],[m,k]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[v,/_/g," "],[y,"Nokia"],[m,R]],[/(pixel c)\b/i],[v,[y,Bt],[m,k]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[v,[y,Bt],[m,R]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[v,[y,en],[m,R]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[v,"Xperia Tablet"],[y,en],[m,k]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[v,[y,"OnePlus"],[m,R]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[v,[y,ot],[m,k]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[v,/(.+)/g,"Fire Phone $1"],[y,ot],[m,R]],[/(playbook);[-\w\),; ]+(rim)/i],[v,y,[m,k]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[v,[y,Jt],[m,R]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[v,[y,st],[m,k]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[v,[y,st],[m,R]],[/(nexus 9)/i],[v,[y,"HTC"],[m,k]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[y,[v,/_/g," "],[m,R]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[v,[y,"TCL"],[m,k]],[/(itel) ((\w+))/i],[[y,a],v,[m,N,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[v,[y,"Acer"],[m,k]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[v,[y,"Meizu"],[m,R]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[v,[y,"Ulefone"],[m,R]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[v,[y,"Energizer"],[m,R]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[v,[y,"Cat"],[m,R]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[v,[y,"Smartfren"],[m,R]],[/droid.+; (a(?:015|06[35]|142p?))/i],[v,[y,"Nothing"],[m,R]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[y,v,[m,R]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[y,v,[m,k]],[/(surface duo)/i],[v,[y,Q],[m,k]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[v,[y,"Fairphone"],[m,R]],[/(u304aa)/i],[v,[y,"AT&T"],[m,R]],[/\bsie-(\w*)/i],[v,[y,"Siemens"],[m,R]],[/\b(rct\w+) b/i],[v,[y,"RCA"],[m,k]],[/\b(venue[\d ]{2,7}) b/i],[v,[y,"Dell"],[m,k]],[/\b(q(?:mv|ta)\w+) b/i],[v,[y,"Verizon"],[m,k]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[v,[y,"Barnes & Noble"],[m,k]],[/\b(tm\d{3}\w+) b/i],[v,[y,"NuVision"],[m,k]],[/\b(k88) b/i],[v,[y,"ZTE"],[m,k]],[/\b(nx\d{3}j) b/i],[v,[y,"ZTE"],[m,R]],[/\b(gen\d{3}) b.+49h/i],[v,[y,"Swiss"],[m,R]],[/\b(zur\d{3}) b/i],[v,[y,"Swiss"],[m,k]],[/\b((zeki)?tb.*\b) b/i],[v,[y,"Zeki"],[m,k]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[y,"Dragon Touch"],v,[m,k]],[/\b(ns-?\w{0,9}) b/i],[v,[y,"Insignia"],[m,k]],[/\b((nxa|next)-?\w{0,9}) b/i],[v,[y,"NextBook"],[m,k]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[y,"Voice"],v,[m,R]],[/\b(lvtel\-)?(v1[12]) b/i],[[y,"LvTel"],v,[m,R]],[/\b(ph-1) /i],[v,[y,"Essential"],[m,R]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[v,[y,"Envizen"],[m,k]],[/\b(trio[-\w\. ]+) b/i],[v,[y,"MachSpeed"],[m,k]],[/\btu_(1491) b/i],[v,[y,"Rotor"],[m,k]],[/(shield[\w ]+) b/i],[v,[y,"Nvidia"],[m,k]],[/(sprint) (\w+)/i],[y,v,[m,R]],[/(kin\.[onetw]{3})/i],[[v,/\./g," "],[y,Q],[m,R]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[v,[y,kn],[m,k]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[v,[y,kn],[m,R]],[/smart-tv.+(samsung)/i],[y,[m,V]],[/hbbtv.+maple;(\d+)/i],[[v,/^/,"SmartTV"],[y,jr],[m,V]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[y,pt],[m,V]],[/(apple) ?tv/i],[y,[v,Y+" TV"],[m,V]],[/crkey/i],[[v,pe+"cast"],[y,Bt],[m,V]],[/droid.+aft(\w+)( bui|\))/i],[v,[y,ot],[m,V]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[v,[y,ke],[m,V]],[/(bravia[\w ]+)( bui|\))/i],[v,[y,en],[m,V]],[/(mitv-\w{5}) bui/i],[v,[y,Hn],[m,V]],[/Hbbtv.*(technisat) (.*);/i],[y,v,[m,V]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[y,p],[v,p],[m,V]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[m,V]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[y,v,[m,H]],[/droid.+; (shield) bui/i],[v,[y,"Nvidia"],[m,H]],[/(playstation [345portablevi]+)/i],[v,[y,en],[m,H]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[v,[y,Q],[m,H]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[v,[y,jr],[m,Ut]],[/((pebble))app/i],[y,v,[m,Ut]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[v,[y,Y],[m,Ut]],[/droid.+; (glass) \d/i],[v,[y,Bt],[m,Ut]],[/droid.+; (wt63?0{2,3})\)/i],[v,[y,kn],[m,Ut]],[/droid.+; (glass) \d/i],[v,[y,Bt],[m,Ut]],[/(pico) (4|neo3(?: link|pro)?)/i],[y,v,[m,Ut]],[/; (quest( \d| pro)?)/i],[v,[y,Hi],[m,Ut]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[y,[m,de]],[/(aeobc)\b/i],[v,[y,ot],[m,de]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[v,[m,R]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[v,[m,k]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[m,k]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[m,R]],[/(android[-\w\. ]{0,9});.+buil/i],[v,[y,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[T,[_,Ce+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[_,T],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[T,[_,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[_,T],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[T,_]],os:[[/microsoft (windows) (vista|xp)/i],[_,T],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[_,[T,N,W]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[T,N,W],[_,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[T,/_/g,"."],[_,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[_,ji],[T,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[T,_],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[_,T],[/\(bb(10);/i],[T,[_,Jt]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[T,[_,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[T,[_,be+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[T,[_,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[T,[_,"watchOS"]],[/crkey\/([\d\.]+)/i],[T,[_,pe+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[_,Wi],T],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[_,T],[/(sunos) ?([\w\.\d]*)/i],[[_,"Solaris"],T],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[_,T]]},St=function(z,ft){if(typeof z===f&&(ft=z,z=n),!(this instanceof St))return new St(z,ft).getResult();var X=typeof r!==u&&r.navigator?r.navigator:n,ie=z||(X&&X.userAgent?X.userAgent:s),$e=X&&X.userAgentData?X.userAgentData:n,Me=ft?Pe(te,ft):te,re=X&&X.userAgent==ie;return this.getBrowser=function(){var J={};return J[_]=n,J[T]=n,I.call(J,ie,Me.browser),J[h]=l(J[T]),re&&X&&X.brave&&typeof X.brave.isBrave==c&&(J[_]="Brave"),J},this.getCPU=function(){var J={};return J[O]=n,I.call(J,ie,Me.cpu),J},this.getDevice=function(){var J={};return J[y]=n,J[v]=n,J[m]=n,I.call(J,ie,Me.device),re&&!J[m]&&$e&&$e.mobile&&(J[m]=R),re&&J[v]=="Macintosh"&&X&&typeof X.standalone!==u&&X.maxTouchPoints&&X.maxTouchPoints>2&&(J[v]="iPad",J[m]=k),J},this.getEngine=function(){var J={};return J[_]=n,J[T]=n,I.call(J,ie,Me.engine),J},this.getOS=function(){var J={};return J[_]=n,J[T]=n,I.call(J,ie,Me.os),re&&!J[_]&&$e&&$e.platform&&$e.platform!="Unknown"&&(J[_]=$e.platform.replace(/chrome os/i,Wi).replace(/macos/i,ji)),J},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return ie},this.setUA=function(J){return ie=typeof J===g&&J.length>j?p(J,j):J,this},this.setUA(ie),this};St.VERSION=i,St.BROWSER=$r([_,T,h]),St.CPU=$r([O]),St.DEVICE=$r([v,y,m,H,R,V,k,Ut,de]),St.ENGINE=St.OS=$r([_,T]),typeof t!==u?(typeof e!==u&&e.exports&&(t=e.exports=St),t.UAParser=St):typeof define===c&&define.amd?define(function(){return St}):typeof r!==u&&(r.UAParser=St);var Ct=typeof r!==u&&(r.jQuery||r.Zepto);if(Ct&&!Ct.ua){var le=new St;Ct.ua=le.getResult(),Ct.ua.get=function(){return le.getUA()},Ct.ua.set=function(z){le.setUA(z);var ft=le.getResult();for(var X in ft)Ct.ua[X]=ft[X]}}})(typeof window=="object"?window:t)}),kp=Vi((t,e)=>{"use strict";(function(r){if(typeof t=="object"&&typeof e<"u")e.exports=r();else if(typeof define=="function"&&define.amd)define([],r);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=r()}})(function(){var r,n,i;return function s(o,c,u){function f(v,_){if(!c[v]){if(!o[v]){var m=typeof Gi=="function"&&Gi;if(!_&&m)return m(v,!0);if(g)return g(v,!0);var y=new Error("Cannot find module '"+v+"'");throw y.code="MODULE_NOT_FOUND",y}var T=c[v]={exports:{}};o[v][0].call(T.exports,function(O){var H=o[v][1][O];return f(H||O)},T,T.exports,s,o,c,u)}return c[v].exports}for(var g=typeof Gi=="function"&&Gi,h=0;h<u.length;h++)f(u[h]);return f}({1:[function(s,o,c){(function(u){"use strict";var f=u.MutationObserver||u.WebKitMutationObserver,g;if(f){var h=0,v=new f(O),_=u.document.createTextNode("");v.observe(_,{characterData:!0}),g=function(){_.data=h=++h%2}}else if(!u.setImmediate&&typeof u.MessageChannel<"u"){var m=new u.MessageChannel;m.port1.onmessage=O,g=function(){m.port2.postMessage(0)}}else"document"in u&&"onreadystatechange"in u.document.createElement("script")?g=function(){var R=u.document.createElement("script");R.onreadystatechange=function(){O(),R.onreadystatechange=null,R.parentNode.removeChild(R),R=null},u.document.documentElement.appendChild(R)}:g=function(){setTimeout(O,0)};var y,T=[];function O(){y=!0;for(var R,k,V=T.length;V;){for(k=T,T=[],R=-1;++R<V;)k[R]();V=T.length}y=!1}o.exports=H;function H(R){T.push(R)===1&&!y&&g()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(s,o,c){"use strict";var u=s(1);function f(){}var g={},h=["REJECTED"],v=["FULFILLED"],_=["PENDING"];o.exports=m;function m(j){if(typeof j!="function")throw new TypeError("resolver must be a function");this.state=_,this.queue=[],this.outcome=void 0,j!==f&&H(this,j)}m.prototype.catch=function(j){return this.then(null,j)},m.prototype.then=function(j,ot){if(typeof j!="function"&&this.state===v||typeof ot!="function"&&this.state===h)return this;var Y=new this.constructor(f);if(this.state!==_){var st=this.state===v?j:ot;T(Y,st,this.outcome)}else this.queue.push(new y(Y,j,ot));return Y};function y(j,ot,Y){this.promise=j,typeof ot=="function"&&(this.onFulfilled=ot,this.callFulfilled=this.otherCallFulfilled),typeof Y=="function"&&(this.onRejected=Y,this.callRejected=this.otherCallRejected)}y.prototype.callFulfilled=function(j){g.resolve(this.promise,j)},y.prototype.otherCallFulfilled=function(j){T(this.promise,this.onFulfilled,j)},y.prototype.callRejected=function(j){g.reject(this.promise,j)},y.prototype.otherCallRejected=function(j){T(this.promise,this.onRejected,j)};function T(j,ot,Y){u(function(){var st;try{st=ot(Y)}catch(Jt){return g.reject(j,Jt)}st===j?g.reject(j,new TypeError("Cannot resolve promise with itself")):g.resolve(j,st)})}g.resolve=function(j,ot){var Y=R(O,ot);if(Y.status==="error")return g.reject(j,Y.value);var st=Y.value;if(st)H(j,st);else{j.state=v,j.outcome=ot;for(var Jt=-1,me=j.queue.length;++Jt<me;)j.queue[Jt].callFulfilled(ot)}return j},g.reject=function(j,ot){j.state=h,j.outcome=ot;for(var Y=-1,st=j.queue.length;++Y<st;)j.queue[Y].callRejected(ot);return j};function O(j){var ot=j&&j.then;if(j&&(typeof j=="object"||typeof j=="function")&&typeof ot=="function")return function(){ot.apply(j,arguments)}}function H(j,ot){var Y=!1;function st(Ce){Y||(Y=!0,g.reject(j,Ce))}function Jt(Ce){Y||(Y=!0,g.resolve(j,Ce))}function me(){ot(Jt,st)}var pe=R(me);pe.status==="error"&&st(pe.value)}function R(j,ot){var Y={};try{Y.value=j(ot),Y.status="success"}catch(st){Y.status="error",Y.value=st}return Y}m.resolve=k;function k(j){return j instanceof this?j:g.resolve(new this(f),j)}m.reject=V;function V(j){var ot=new this(f);return g.reject(ot,j)}m.all=Ut;function Ut(j){var ot=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=j.length,st=!1;if(!Y)return this.resolve([]);for(var Jt=new Array(Y),me=0,pe=-1,Ce=new this(f);++pe<Y;)be(j[pe],pe);return Ce;function be(Bt,Te){ot.resolve(Bt).then(pt,function(Q){st||(st=!0,g.reject(Ce,Q))});function pt(Q){Jt[Te]=Q,++me===Y&&!st&&(st=!0,g.resolve(Ce,Jt))}}}m.race=de;function de(j){var ot=this;if(Object.prototype.toString.call(j)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=j.length,st=!1;if(!Y)return this.resolve([]);for(var Jt=-1,me=new this(f);++Jt<Y;)pe(j[Jt]);return me;function pe(Ce){ot.resolve(Ce).then(function(be){st||(st=!0,g.resolve(me,be))},function(be){st||(st=!0,g.reject(me,be))})}}},{1:1}],3:[function(s,o,c){(function(u){"use strict";typeof u.Promise!="function"&&(u.Promise=s(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(s,o,c){"use strict";var u=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(d){return typeof d}:function(d){return d&&typeof Symbol=="function"&&d.constructor===Symbol&&d!==Symbol.prototype?"symbol":typeof d};function f(d,E){if(!(d instanceof E))throw new TypeError("Cannot call a class as a function")}function g(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var h=g();function v(){try{if(!h||!h.open)return!1;var d=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),E=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!d||E)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function _(d,E){d=d||[],E=E||{};try{return new Blob(d,E)}catch(D){if(D.name!=="TypeError")throw D;for(var S=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,C=new S,x=0;x<d.length;x+=1)C.append(d[x]);return C.getBlob(E.type)}}typeof Promise>"u"&&s(3);var m=Promise;function y(d,E){E&&d.then(function(S){E(null,S)},function(S){E(S)})}function T(d,E,S){typeof E=="function"&&d.then(E),typeof S=="function"&&d.catch(S)}function O(d){return typeof d!="string"&&(console.warn(d+" used as a key, but it is not a string."),d=String(d)),d}function H(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var R="local-forage-detect-blob-support",k=void 0,V={},Ut=Object.prototype.toString,de="readonly",j="readwrite";function ot(d){for(var E=d.length,S=new ArrayBuffer(E),C=new Uint8Array(S),x=0;x<E;x++)C[x]=d.charCodeAt(x);return S}function Y(d){return new m(function(E){var S=d.transaction(R,j),C=_([""]);S.objectStore(R).put(C,"key"),S.onabort=function(x){x.preventDefault(),x.stopPropagation(),E(!1)},S.oncomplete=function(){var x=navigator.userAgent.match(/Chrome\/(\d+)/),D=navigator.userAgent.match(/Edge\//);E(D||!x||parseInt(x[1],10)>=43)}}).catch(function(){return!1})}function st(d){return typeof k=="boolean"?m.resolve(k):Y(d).then(function(E){return k=E,k})}function Jt(d){var E=V[d.name],S={};S.promise=new m(function(C,x){S.resolve=C,S.reject=x}),E.deferredOperations.push(S),E.dbReady?E.dbReady=E.dbReady.then(function(){return S.promise}):E.dbReady=S.promise}function me(d){var E=V[d.name],S=E.deferredOperations.pop();if(S)return S.resolve(),S.promise}function pe(d,E){var S=V[d.name],C=S.deferredOperations.pop();if(C)return C.reject(E),C.promise}function Ce(d,E){return new m(function(S,C){if(V[d.name]=V[d.name]||en(),d.db)if(E)Jt(d),d.db.close();else return S(d.db);var x=[d.name];E&&x.push(d.version);var D=h.open.apply(h,x);E&&(D.onupgradeneeded=function(P){var U=D.result;try{U.createObjectStore(d.storeName),P.oldVersion<=1&&U.createObjectStore(R)}catch(F){if(F.name==="ConstraintError")console.warn('The database "'+d.name+'" has been upgraded from version '+P.oldVersion+" to version "+P.newVersion+', but the storage "'+d.storeName+'" already exists.');else throw F}}),D.onerror=function(P){P.preventDefault(),C(D.error)},D.onsuccess=function(){var P=D.result;P.onversionchange=function(U){U.target.close()},S(P),me(d)}})}function be(d){return Ce(d,!1)}function Bt(d){return Ce(d,!0)}function Te(d,E){if(!d.db)return!0;var S=!d.db.objectStoreNames.contains(d.storeName),C=d.version<d.db.version,x=d.version>d.db.version;if(C&&(d.version!==E&&console.warn('The database "'+d.name+`" can't be downgraded from version `+d.db.version+" to version "+d.version+"."),d.version=d.db.version),x||S){if(S){var D=d.db.version+1;D>d.version&&(d.version=D)}return!0}return!1}function pt(d){return new m(function(E,S){var C=new FileReader;C.onerror=S,C.onloadend=function(x){var D=btoa(x.target.result||"");E({__local_forage_encoded_blob:!0,data:D,type:d.type})},C.readAsBinaryString(d)})}function Q(d){var E=ot(atob(d.data));return _([E],{type:d.type})}function we(d){return d&&d.__local_forage_encoded_blob}function ar(d){var E=this,S=E._initReady().then(function(){var C=V[E._dbInfo.name];if(C&&C.dbReady)return C.dbReady});return T(S,d,d),S}function jr(d){Jt(d);for(var E=V[d.name],S=E.forages,C=0;C<S.length;C++){var x=S[C];x._dbInfo.db&&(x._dbInfo.db.close(),x._dbInfo.db=null)}return d.db=null,be(d).then(function(D){return d.db=D,Te(d)?Bt(d):D}).then(function(D){d.db=E.db=D;for(var P=0;P<S.length;P++)S[P]._dbInfo.db=D}).catch(function(D){throw pe(d,D),D})}function ke(d,E,S,C){C===void 0&&(C=1);try{var x=d.db.transaction(d.storeName,E);S(null,x)}catch(D){if(C>0&&(!d.db||D.name==="InvalidStateError"||D.name==="NotFoundError"))return m.resolve().then(function(){if(!d.db||D.name==="NotFoundError"&&!d.db.objectStoreNames.contains(d.storeName)&&d.version<=d.db.version)return d.db&&(d.version=d.db.version+1),Bt(d)}).then(function(){return jr(d).then(function(){ke(d,E,S,C-1)})}).catch(S);S(D)}}function en(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hn(d){var E=this,S={db:null};if(d)for(var C in d)S[C]=d[C];var x=V[S.name];x||(x=en(),V[S.name]=x),x.forages.push(E),E._initReady||(E._initReady=E.ready,E.ready=ar);var D=[];function P(){return m.resolve()}for(var U=0;U<x.forages.length;U++){var F=x.forages[U];F!==E&&D.push(F._initReady().catch(P))}var $=x.forages.slice(0);return m.all(D).then(function(){return S.db=x.db,be(S)}).then(function(B){return S.db=B,Te(S,E._defaultConfig.version)?Bt(S):B}).then(function(B){S.db=x.db=B,E._dbInfo=S;for(var G=0;G<$.length;G++){var mt=$[G];mt!==E&&(mt._dbInfo.db=S.db,mt._dbInfo.version=S.version)}})}function kn(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,de,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.get(d);$.onsuccess=function(){var B=$.result;B===void 0&&(B=null),we(B)&&(B=Q(B)),x(B)},$.onerror=function(){D($.error)}}catch(B){D(B)}})}).catch(D)});return y(C,E),C}function Hi(d,E){var S=this,C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,de,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.openCursor(),B=1;$.onsuccess=function(){var G=$.result;if(G){var mt=G.value;we(mt)&&(mt=Q(mt));var he=d(mt,G.key,B++);he!==void 0?x(he):G.continue()}else x()},$.onerror=function(){D($.error)}}catch(G){D(G)}})}).catch(D)});return y(C,E),C}function Wi(d,E,S){var C=this;d=O(d);var x=new m(function(D,P){var U;C.ready().then(function(){return U=C._dbInfo,Ut.call(E)==="[object Blob]"?st(U.db).then(function(F){return F?E:pt(E)}):E}).then(function(F){ke(C._dbInfo,j,function($,B){if($)return P($);try{var G=B.objectStore(C._dbInfo.storeName);F===null&&(F=void 0);var mt=G.put(F,d);B.oncomplete=function(){F===void 0&&(F=null),D(F)},B.onabort=B.onerror=function(){var he=mt.error?mt.error:mt.transaction.error;P(he)}}catch(he){P(he)}})}).catch(P)});return y(x,S),x}function ji(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){ke(S._dbInfo,j,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=F.delete(d);U.oncomplete=function(){x()},U.onerror=function(){D($.error)},U.onabort=function(){var B=$.error?$.error:$.transaction.error;D(B)}}catch(B){D(B)}})}).catch(D)});return y(C,E),C}function Mn(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,j,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.clear();P.oncomplete=function(){C()},P.onabort=P.onerror=function(){var $=F.error?F.error:F.transaction.error;x($)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function Pe(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,de,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.count();F.onsuccess=function(){C(F.result)},F.onerror=function(){x(F.error)}}catch($){x($)}})}).catch(x)});return y(S,d),S}function $r(d,E){var S=this,C=new m(function(x,D){if(d<0){x(null);return}S.ready().then(function(){ke(S._dbInfo,de,function(P,U){if(P)return D(P);try{var F=U.objectStore(S._dbInfo.storeName),$=!1,B=F.openKeyCursor();B.onsuccess=function(){var G=B.result;if(!G){x(null);return}d===0||$?x(G.key):($=!0,G.advance(d))},B.onerror=function(){D(B.error)}}catch(G){D(G)}})}).catch(D)});return y(C,E),C}function rs(d){var E=this,S=new m(function(C,x){E.ready().then(function(){ke(E._dbInfo,de,function(D,P){if(D)return x(D);try{var U=P.objectStore(E._dbInfo.storeName),F=U.openKeyCursor(),$=[];F.onsuccess=function(){var B=F.result;if(!B){C($);return}$.push(B.key),B.continue()},F.onerror=function(){x(F.error)}}catch(B){x(B)}})}).catch(x)});return y(S,d),S}function a(d,E){E=H.apply(this,arguments);var S=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||S.name,d.storeName=d.storeName||S.storeName);var C=this,x;if(!d.name)x=m.reject("Invalid arguments");else{var D=d.name===S.name&&C._dbInfo.db,P=D?m.resolve(C._dbInfo.db):be(d).then(function(U){var F=V[d.name],$=F.forages;F.db=U;for(var B=0;B<$.length;B++)$[B]._dbInfo.db=U;return U});d.storeName?x=P.then(function(U){if(U.objectStoreNames.contains(d.storeName)){var F=U.version+1;Jt(d);var $=V[d.name],B=$.forages;U.close();for(var G=0;G<B.length;G++){var mt=B[G];mt._dbInfo.db=null,mt._dbInfo.version=F}var he=new m(function(oe,Ie){var ye=h.open(d.name,F);ye.onerror=function(Ve){var Wu=ye.result;Wu.close(),Ie(Ve)},ye.onupgradeneeded=function(){var Ve=ye.result;Ve.deleteObjectStore(d.storeName)},ye.onsuccess=function(){var Ve=ye.result;Ve.close(),oe(Ve)}});return he.then(function(oe){$.db=oe;for(var Ie=0;Ie<B.length;Ie++){var ye=B[Ie];ye._dbInfo.db=oe,me(ye._dbInfo)}}).catch(function(oe){throw(pe(d,oe)||m.resolve()).catch(function(){}),oe})}}):x=P.then(function(U){Jt(d);var F=V[d.name],$=F.forages;U.close();for(var B=0;B<$.length;B++){var G=$[B];G._dbInfo.db=null}var mt=new m(function(he,oe){var Ie=h.deleteDatabase(d.name);Ie.onerror=function(){var ye=Ie.result;ye&&ye.close(),oe(Ie.error)},Ie.onblocked=function(){console.warn('dropInstance blocked for database "'+d.name+'" until all open connections are closed')},Ie.onsuccess=function(){var ye=Ie.result;ye&&ye.close(),he(ye)}});return mt.then(function(he){F.db=he;for(var oe=0;oe<$.length;oe++){var Ie=$[oe];me(Ie._dbInfo)}}).catch(function(he){throw(pe(d,he)||m.resolve()).catch(function(){}),he})})}return y(x,E),x}var l={_driver:"asyncStorage",_initStorage:Hn,_support:v(),iterate:Hi,getItem:kn,setItem:Wi,removeItem:ji,clear:Mn,length:Pe,key:$r,keys:rs,dropInstance:a};function p(){return typeof openDatabase=="function"}var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",N="~~local_forage_type~",L=/^~~local_forage_type~([^~]+)~/,W="__lfsc__:",te=W.length,St="arbf",Ct="blob",le="si08",z="ui08",ft="uic8",X="si16",ie="si32",$e="ur16",Me="ui32",re="fl32",J="fl64",He=te+St.length,As=Object.prototype.toString;function Yo(d){var E=d.length*.75,S=d.length,C,x=0,D,P,U,F;d[d.length-1]==="="&&(E--,d[d.length-2]==="="&&E--);var $=new ArrayBuffer(E),B=new Uint8Array($);for(C=0;C<S;C+=4)D=I.indexOf(d[C]),P=I.indexOf(d[C+1]),U=I.indexOf(d[C+2]),F=I.indexOf(d[C+3]),B[x++]=D<<2|P>>4,B[x++]=(P&15)<<4|U>>2,B[x++]=(U&3)<<6|F&63;return $}function Ec(d){var E=new Uint8Array(d),S="",C;for(C=0;C<E.length;C+=3)S+=I[E[C]>>2],S+=I[(E[C]&3)<<4|E[C+1]>>4],S+=I[(E[C+1]&15)<<2|E[C+2]>>6],S+=I[E[C+2]&63];return E.length%3===2?S=S.substring(0,S.length-1)+"=":E.length%3===1&&(S=S.substring(0,S.length-2)+"=="),S}function $d(d,E){var S="";if(d&&(S=As.call(d)),d&&(S==="[object ArrayBuffer]"||d.buffer&&As.call(d.buffer)==="[object ArrayBuffer]")){var C,x=W;d instanceof ArrayBuffer?(C=d,x+=St):(C=d.buffer,S==="[object Int8Array]"?x+=le:S==="[object Uint8Array]"?x+=z:S==="[object Uint8ClampedArray]"?x+=ft:S==="[object Int16Array]"?x+=X:S==="[object Uint16Array]"?x+=$e:S==="[object Int32Array]"?x+=ie:S==="[object Uint32Array]"?x+=Me:S==="[object Float32Array]"?x+=re:S==="[object Float64Array]"?x+=J:E(new Error("Failed to get type for BinaryArray"))),E(x+Ec(C))}else if(S==="[object Blob]"){var D=new FileReader;D.onload=function(){var P=N+d.type+"~"+Ec(this.result);E(W+Ct+P)},D.readAsArrayBuffer(d)}else try{E(JSON.stringify(d))}catch(P){console.error("Couldn't convert value into a JSON string: ",d),E(null,P)}}function Fd(d){if(d.substring(0,te)!==W)return JSON.parse(d);var E=d.substring(He),S=d.substring(te,He),C;if(S===Ct&&L.test(E)){var x=E.match(L);C=x[1],E=E.substring(x[0].length)}var D=Yo(E);switch(S){case St:return D;case Ct:return _([D],{type:C});case le:return new Int8Array(D);case z:return new Uint8Array(D);case ft:return new Uint8ClampedArray(D);case X:return new Int16Array(D);case $e:return new Uint16Array(D);case ie:return new Int32Array(D);case Me:return new Uint32Array(D);case re:return new Float32Array(D);case J:return new Float64Array(D);default:throw new Error("Unkown type: "+S)}}var Sc={serialize:$d,deserialize:Fd,stringToBuffer:Yo,bufferToString:Ec};function th(d,E,S,C){d.executeSql("CREATE TABLE IF NOT EXISTS "+E.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],S,C)}function Hd(d){var E=this,S={db:null};if(d)for(var C in d)S[C]=typeof d[C]!="string"?d[C].toString():d[C];var x=new m(function(D,P){try{S.db=openDatabase(S.name,String(S.version),S.description,S.size)}catch(U){return P(U)}S.db.transaction(function(U){th(U,S,function(){E._dbInfo=S,D()},function(F,$){P($)})},P)});return S.serializer=Sc,x}function Fn(d,E,S,C,x,D){d.executeSql(S,C,x,function(P,U){U.code===U.SYNTAX_ERR?P.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[E.storeName],function(F,$){$.rows.length?D(F,U):th(F,E,function(){F.executeSql(S,C,x,D)},D)},D):D(P,U)},D)}function Vd(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT * FROM "+P.storeName+" WHERE key = ? LIMIT 1",[d],function(F,$){var B=$.rows.length?$.rows.item(0).value:null;B&&(B=P.serializer.deserialize(B)),x(B)},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function qd(d,E){var S=this,C=new m(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT * FROM "+P.storeName,[],function(F,$){for(var B=$.rows,G=B.length,mt=0;mt<G;mt++){var he=B.item(mt),oe=he.value;if(oe&&(oe=P.serializer.deserialize(oe)),oe=d(oe,he.key,mt+1),oe!==void 0){x(oe);return}}x()},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function eh(d,E,S,C){var x=this;d=O(d);var D=new m(function(P,U){x.ready().then(function(){E===void 0&&(E=null);var F=E,$=x._dbInfo;$.serializer.serialize(E,function(B,G){G?U(G):$.db.transaction(function(mt){Fn(mt,$,"INSERT OR REPLACE INTO "+$.storeName+" (key, value) VALUES (?, ?)",[d,B],function(){P(F)},function(he,oe){U(oe)})},function(mt){if(mt.code===mt.QUOTA_ERR){if(C>0){P(eh.apply(x,[d,F,S,C-1]));return}U(mt)}})})}).catch(U)});return y(D,S),D}function Wd(d,E,S){return eh.apply(this,[d,E,S,1])}function zd(d,E){var S=this;d=O(d);var C=new m(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"DELETE FROM "+P.storeName+" WHERE key = ?",[d],function(){x()},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function Kd(d){var E=this,S=new m(function(C,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"DELETE FROM "+D.storeName,[],function(){C()},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Gd(d){var E=this,S=new m(function(C,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"SELECT COUNT(key) as c FROM "+D.storeName,[],function(U,F){var $=F.rows.item(0).c;C($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Yd(d,E){var S=this,C=new m(function(x,D){S.ready().then(function(){var P=S._dbInfo;P.db.transaction(function(U){Fn(U,P,"SELECT key FROM "+P.storeName+" WHERE id = ? LIMIT 1",[d+1],function(F,$){var B=$.rows.length?$.rows.item(0).key:null;x(B)},function(F,$){D($)})})}).catch(D)});return y(C,E),C}function Xd(d){var E=this,S=new m(function(C,x){E.ready().then(function(){var D=E._dbInfo;D.db.transaction(function(P){Fn(P,D,"SELECT key FROM "+D.storeName,[],function(U,F){for(var $=[],B=0;B<F.rows.length;B++)$.push(F.rows.item(B).key);C($)},function(U,F){x(F)})})}).catch(x)});return y(S,d),S}function Jd(d){return new m(function(E,S){d.transaction(function(C){C.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(x,D){for(var P=[],U=0;U<D.rows.length;U++)P.push(D.rows.item(U).name);E({db:d,storeNames:P})},function(x,D){S(D)})},function(C){S(C)})})}function Zd(d,E){E=H.apply(this,arguments);var S=this.config();d=typeof d!="function"&&d||{},d.name||(d.name=d.name||S.name,d.storeName=d.storeName||S.storeName);var C=this,x;return d.name?x=new m(function(D){var P;d.name===S.name?P=C._dbInfo.db:P=openDatabase(d.name,"","",0),d.storeName?D({db:P,storeNames:[d.storeName]}):D(Jd(P))}).then(function(D){return new m(function(P,U){D.db.transaction(function(F){function $(he){return new m(function(oe,Ie){F.executeSql("DROP TABLE IF EXISTS "+he,[],function(){oe()},function(ye,Ve){Ie(Ve)})})}for(var B=[],G=0,mt=D.storeNames.length;G<mt;G++)B.push($(D.storeNames[G]));m.all(B).then(function(){P()}).catch(function(he){U(he)})},function(F){U(F)})})}):x=m.reject("Invalid arguments"),y(x,E),x}var Qd={_driver:"webSQLStorage",_initStorage:Hd,_support:p(),iterate:qd,getItem:Vd,setItem:Wd,removeItem:zd,clear:Kd,length:Gd,key:Yd,keys:Xd,dropInstance:Zd};function kg(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function rh(d,E){var S=d.name+"/";return d.storeName!==E.storeName&&(S+=d.storeName+"/"),S}function Om(){var d="_localforage_support_test";try{return localStorage.setItem(d,!0),localStorage.removeItem(d),!1}catch{return!0}}function Vm(){return!Om()||localStorage.length>0}function zm(d){var E=this,S={};if(d)for(var C in d)S[C]=d[C];return S.keyPrefix=rh(d,E._defaultConfig),Vm()?(E._dbInfo=S,S.serializer=Sc,m.resolve()):m.reject()}function Gm(d){var E=this,S=E.ready().then(function(){for(var C=E._dbInfo.keyPrefix,x=localStorage.length-1;x>=0;x--){var D=localStorage.key(x);D.indexOf(C)===0&&localStorage.removeItem(D)}});return y(S,d),S}function kv(d,E){var S=this;d=O(d);var C=S.ready().then(function(){var x=S._dbInfo,D=localStorage.getItem(x.keyPrefix+d);return D&&(D=x.serializer.deserialize(D)),D});return y(C,E),C}function Pv(d,E){var S=this,C=S.ready().then(function(){for(var x=S._dbInfo,D=x.keyPrefix,P=D.length,U=localStorage.length,F=1,$=0;$<U;$++){var B=localStorage.key($);if(B.indexOf(D)===0){var G=localStorage.getItem(B);if(G&&(G=x.serializer.deserialize(G)),G=d(G,B.substring(P),F++),G!==void 0)return G}}});return y(C,E),C}function Lv(d,E){var S=this,C=S.ready().then(function(){var x=S._dbInfo,D;try{D=localStorage.key(d)}catch{D=null}return D&&(D=D.substring(x.keyPrefix.length)),D});return y(C,E),C}function Mv(d){var E=this,S=E.ready().then(function(){for(var C=E._dbInfo,x=localStorage.length,D=[],P=0;P<x;P++){var U=localStorage.key(P);U.indexOf(C.keyPrefix)===0&&D.push(U.substring(C.keyPrefix.length))}return D});return y(S,d),S}function Uv(d){var E=this,S=E.keys().then(function(C){return C.length});return y(S,d),S}function jv(d,E){var S=this;d=O(d);var C=S.ready().then(function(){var x=S._dbInfo;localStorage.removeItem(x.keyPrefix+d)});return y(C,E),C}function Bv(d,E,S){var C=this;d=O(d);var x=C.ready().then(function(){E===void 0&&(E=null);var D=E;return new m(function(P,U){var F=C._dbInfo;F.serializer.serialize(E,function($,B){if(B)U(B);else try{localStorage.setItem(F.keyPrefix+d,$),P(D)}catch(G){(G.name==="QuotaExceededError"||G.name==="NS_ERROR_DOM_QUOTA_REACHED")&&U(G),U(G)}})})});return y(x,S),x}function $v(d,E){if(E=H.apply(this,arguments),d=typeof d!="function"&&d||{},!d.name){var S=this.config();d.name=d.name||S.name,d.storeName=d.storeName||S.storeName}var C=this,x;return d.name?x=new m(function(D){d.storeName?D(rh(d,C._defaultConfig)):D(d.name+"/")}).then(function(D){for(var P=localStorage.length-1;P>=0;P--){var U=localStorage.key(P);U.indexOf(D)===0&&localStorage.removeItem(U)}}):x=m.reject("Invalid arguments"),y(x,E),x}var Fv={_driver:"localStorageWrapper",_initStorage:zm,_support:kg(),iterate:Pv,getItem:kv,setItem:Bv,removeItem:jv,clear:Gm,length:Uv,key:Lv,keys:Mv,dropInstance:$v},Hv=function(d,E){return d===E||typeof d=="number"&&typeof E=="number"&&isNaN(d)&&isNaN(E)},Wv=function(d,E){for(var S=d.length,C=0;C<S;){if(Hv(d[C],E))return!0;C++}return!1},nh=Array.isArray||function(d){return Object.prototype.toString.call(d)==="[object Array]"},$a={},fh={},to={INDEXEDDB:l,WEBSQL:Qd,LOCALSTORAGE:Fv},Gv=[to.INDEXEDDB._driver,to.WEBSQL._driver,to.LOCALSTORAGE._driver],bc=["dropInstance"],Yc=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(bc),Oy={description:"",driver:Gv.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Py(d,E){d[E]=function(){var S=arguments;return d.ready().then(function(){return d[E].apply(d,S)})}}function qu(){for(var d=1;d<arguments.length;d++){var E=arguments[d];if(E)for(var S in E)E.hasOwnProperty(S)&&(nh(E[S])?arguments[0][S]=E[S].slice():arguments[0][S]=E[S])}return arguments[0]}var tb=function(){function d(E){f(this,d);for(var S in to)if(to.hasOwnProperty(S)){var C=to[S],x=C._driver;this[S]=x,$a[x]||this.defineDriver(C)}this._defaultConfig=qu({},Oy),this._config=qu({},this._defaultConfig,E),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return d.prototype.config=function(E){if((typeof E>"u"?"undefined":u(E))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var S in E){if(S==="storeName"&&(E[S]=E[S].replace(/\W/g,"_")),S==="version"&&typeof E[S]!="number")return new Error("Database version must be a number.");this._config[S]=E[S]}return"driver"in E&&E.driver?this.setDriver(this._config.driver):!0}else return typeof E=="string"?this._config[E]:this._config},d.prototype.defineDriver=function(E,S,C){var x=new m(function(D,P){try{var U=E._driver,F=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!E._driver){P(F);return}for(var $=Yc.concat("_initStorage"),B=0,G=$.length;B<G;B++){var mt=$[B],he=!Wv(bc,mt);if((he||E[mt])&&typeof E[mt]!="function"){P(F);return}}var oe=function(){for(var ye=function(rb){return function(){var nb=new Error("Method "+rb+" is not implemented by the current driver"),Yh=m.reject(nb);return y(Yh,arguments[arguments.length-1]),Yh}},Ve=0,Wu=bc.length;Ve<Wu;Ve++){var zu=bc[Ve];E[zu]||(E[zu]=ye(zu))}};oe();var Ie=function(ye){$a[U]&&console.info("Redefining LocalForage driver: "+U),$a[U]=E,fh[U]=ye,D()};"_support"in E?E._support&&typeof E._support=="function"?E._support().then(Ie,P):Ie(!!E._support):Ie(!0)}catch(ye){P(ye)}});return T(x,S,C),x},d.prototype.driver=function(){return this._driver||null},d.prototype.getDriver=function(E,S,C){var x=$a[E]?m.resolve($a[E]):m.reject(new Error("Driver not found."));return T(x,S,C),x},d.prototype.getSerializer=function(E){var S=m.resolve(Sc);return T(S,E),S},d.prototype.ready=function(E){var S=this,C=S._driverSet.then(function(){return S._ready===null&&(S._ready=S._initDriver()),S._ready});return T(C,E,E),C},d.prototype.setDriver=function(E,S,C){var x=this;nh(E)||(E=[E]);var D=this._getSupportedDrivers(E);function P(){x._config.driver=x.driver()}function U(B){return x._extend(B),P(),x._ready=x._initStorage(x._config),x._ready}function F(B){return function(){var G=0;function mt(){for(;G<B.length;){var he=B[G];return G++,x._dbInfo=null,x._ready=null,x.getDriver(he).then(U).catch(mt)}P();var oe=new Error("No available storage method found.");return x._driverSet=m.reject(oe),x._driverSet}return mt()}}var $=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=$.then(function(){var B=D[0];return x._dbInfo=null,x._ready=null,x.getDriver(B).then(function(G){x._driver=G._driver,P(),x._wrapLibraryMethodsWithReady(),x._initDriver=F(D)})}).catch(function(){P();var B=new Error("No available storage method found.");return x._driverSet=m.reject(B),x._driverSet}),T(this._driverSet,S,C),this._driverSet},d.prototype.supports=function(E){return!!fh[E]},d.prototype._extend=function(E){qu(this,E)},d.prototype._getSupportedDrivers=function(E){for(var S=[],C=0,x=E.length;C<x;C++){var D=E[C];this.supports(D)&&S.push(D)}return S},d.prototype._wrapLibraryMethodsWithReady=function(){for(var E=0,S=Yc.length;E<S;E++)Py(this,Yc[E])},d.prototype.createInstance=function(E){return new d(E)},d}(),eb=new tb;o.exports=eb},{3:3}]},{},[4])(4)})}),vl=Vi(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.URLBuilder=void 0;var e=function(){function r(n){try{this.base=new URL(n),this.params=new URLSearchParams(this.base.search.slice(1))}catch(i){console.error("Un-parsable URL",i)}}return r.prototype.appendQueryParam=function(n,i){this.params.append(n,i?i.toString():"")},r.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},r.prototype.deleteQueryParam=function(n){this.params.delete(n)},r.prototype.getBase=function(){return this.base},r.prototype.getPath=function(){return this.base.pathname},r.prototype.getHostname=function(){return this.base.hostname},r.prototype.getParams=function(){return this.params},r.prototype.getQueryParam=function(n){if(!this.params)return"";var i=this.params.get(n);return!i||i==="undefined"||i==="null"?void 0:i},r.prototype.getQueryString=function(){return this.params.toString()},r.prototype.setPath=function(n){return this.base.pathname=n,this},r.prototype.setQueryParam=function(n,i){return this.params.set(n,i?i.toString():""),this},r.prototype.setQueryString=function(n){if(n)return n[0]==="?"&&(n=n.slice(1)),this.params=new URLSearchParams(n),this},r.prototype.toString=function(){var n=this.params.toString();return n===""?this.base.search="":this.base.search="?"+n,this.base.toString()},r}();t.URLBuilder=e}),fd=Vi((t,e)=>{"use strict";(function(r,n){typeof t=="object"&&typeof e<"u"?e.exports=n():typeof define=="function"&&define.amd?define(n):(r=typeof globalThis<"u"?globalThis:r||self,r.fetchRetry=n())})(t,function(){"use strict";var r=function(s,o){if(o=o||{},typeof s!="function")throw new i("fetch must be a function");if(typeof o!="object")throw new i("defaults must be an object");if(o.retries!==void 0&&!n(o.retries))throw new i("retries must be a positive integer");if(o.retryDelay!==void 0&&!n(o.retryDelay)&&typeof o.retryDelay!="function")throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(o.retryOn!==void 0&&!Array.isArray(o.retryOn)&&typeof o.retryOn!="function")throw new i("retryOn property expects an array or function");var c={retries:3,retryDelay:1e3,retryOn:[]};return o=Object.assign(c,o),function(u,f){var g=o.retries,h=o.retryDelay,v=o.retryOn;if(f&&f.retries!==void 0)if(n(f.retries))g=f.retries;else throw new i("retries must be a positive integer");if(f&&f.retryDelay!==void 0)if(n(f.retryDelay)||typeof f.retryDelay=="function")h=f.retryDelay;else throw new i("retryDelay must be a positive integer or a function returning a positive integer");if(f&&f.retryOn)if(Array.isArray(f.retryOn)||typeof f.retryOn=="function")v=f.retryOn;else throw new i("retryOn property expects an array or function");return new Promise(function(_,m){var y=function(O){var H=typeof Request<"u"&&u instanceof Request?u.clone():u;s(H,f).then(function(R){if(Array.isArray(v)&&v.indexOf(R.status)===-1)_(R);else if(typeof v=="function")try{return Promise.resolve(v(O,null,R)).then(function(k){k?T(O,null,R):_(R)}).catch(m)}catch(k){m(k)}else O<g?T(O,null,R):_(R)}).catch(function(R){if(typeof v=="function")try{Promise.resolve(v(O,R,null)).then(function(k){k?T(O,R,null):m(R)}).catch(function(k){m(k)})}catch(k){m(k)}else O<g?T(O,R,null):m(R)})};function T(O,H,R){var k=typeof h=="function"?h(O,H,R):h;setTimeout(function(){y(++O)},k)}y(0)})}};function n(s){return Number.isInteger(s)&&s>=0}function i(s){this.name="ArgumentError",this.message=s}return r})}),Gr={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production"},Dt=Xt(tn()),rp="9.3.6",A=class Ku{static SDK_VERSION=rp;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static CTA_EVENT="letscooee:outbound:cta";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static{let e=Ku.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");Ku.SDK_VERSION_CODE=parseInt(e,10)}},w=class{static log(...t){Dt.default.info(...t)}static debug(...t){Dt.default.debug(...t)}static error(...t){Dt.default.error(...t)}static warn(...t){Dt.default.warn(...t)}static info(...t){Dt.default.info(...t)}static trace(...t){Dt.default.trace(...t)}static configure(t=A.LOG_PREFIX){Dt.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${A.SDK_VERSION}):`)}});let e=this.getDebugParam();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Dt.default.setLevel(Dt.default[localStorage.cooeeLogLevel]):Dt.default.setLevel(Gr.debug?Dt.default.TRACE:Dt.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let t=`
|
|
2
2
|
display: inline-block;
|
|
3
3
|
font-size: 14px;
|
|
4
4
|
background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
Cooee SDK: v${A.SDK_VERSION}`,console.group("%c Elevate your ecommerce experience with Cooee \u{1F680} ",t),console.log(`%c${e}`,"font-size: 13px; line-height: 1.8;"),console.groupEnd()}},np=(()=>{class t{static entityMap={'"':"""};static escapeHtml(r){return String(r).replace(/"/g,n=>t.entityMap[n])}}return t})(),je=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(t){return t??={},this.gaEnabled=t.gaEnabled,this.gaMeasurementID=t.gaMeasurementID,this.pixelPush=t.pixelPush,this.website=t.website??{},this.currencyCount=t.currencyCount??0,this.money=t.money,this.currency=t.currency,this.storefrontToken=t.storefrontToken,this.skipItemAttribute=t.skipItemAttribute,this}},zi=function(t){return t[t.SINGLE=1]="SINGLE",t[t.EXCLUSION=2]="EXCLUSION",t[t.ABTESTING=3]="ABTESTING",t}(zi||{}),$n=function(t){return t.BEFORE="before",t.AFTER="after",t.INSIDE_FIRST="insideFirst",t.INSIDE_LAST="insideLast",t}($n||{}),cr=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}(cr||{}),Yi=function(t){return t.POPUP="POPUP",t.PAGE_EMBED="PAGE_EMBED",t.CART_EMBED="CART_EMBED",t.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",t}(Yi||{}),lr=function(t){return t.PRODUCT_PROMOTION="PRODUCT_PROMOTION",t.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",t.CART_RECOVERY="CART_RECOVERY",t.ANNOUNCEMENT="ANNOUNCEMENT",t.LEAD_GENERATION="LEAD_GENERATION",t.DATA_COLLECTION="DATA_COLLECTION",t.SALE_PROMOTION="SALE_PROMOTION",t.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",t.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",t.BYOB="BYOB",t.PROGRESS_BAR="PROGRESS_BAR",t}(lr||{}),qi=function(t){return t.COOEE="COOEE",t.KLAVIYO="KLAVIYO",t}(qi||{}),Ic=function(t){return t.ICONS="ICONS",t.TILES="TILES",t}(Ic||{}),Tc=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}(Tc||{}),ur=function(t){return t[t.NONE=0]="NONE",t[t.STATIC=1]="STATIC",t[t.UNIQUE_FLAT=2]="UNIQUE_FLAT",t[t.UNIQUE_FLAT_ITEMS=3]="UNIQUE_FLAT_ITEMS",t[t.UNIQUE_FIXED_ITEMS=4]="UNIQUE_FIXED_ITEMS",t[t.UNIQUE_CHEAPEST_ITEM_FREE=5]="UNIQUE_CHEAPEST_ITEM_FREE",t}(ur||{}),jn=class tp{static of(e,r){return r!==void 0?new Array(e).fill(r):Array.from({length:e},(n,i)=>i)}static remove(e,r){let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)}static swap(e,r,n){[e[r],e[n]]=[e[n],e[r]]}static sum(e,r){return e.reduce((n,i)=>n+Math.max(r?r(i):+i,0),0)}static unique(e,r){return e.filter((n,i,s)=>s.findIndex(o=>o[r]===n[r])===i)}static shuffle(e){let r=e.length;for(;r!=0;){let n=Math.floor(Math.random()*r);r--,tp.swap(e,r,n)}}},Xo,_e,cp,Rc,rn,ip,lp,xc,up,Nc,Cc,Dc,mh,Ki={},pp=[],dh=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ac=Array.isArray;function Vr(t,e){for(var r in e)t[r]=e[r];return t}function Oc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Ji(t,e,r){var n,i,s,o={};for(s in e)s=="key"?n=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Xo.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return Ko(t,o,n,i,null)}function Ko(t,e,r,n,i){var s={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++cp,__i:-1,__u:0};return i==null&&_e.vnode!=null&&_e.vnode(s),s}function fr(t){return t.children}function pr(t,e){this.props=t,this.context=e}function Wn(t,e){if(e==null)return t.__?Wn(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Wn(t):null}function fp(t){var e,r;if((t=t.__)!=null&&t.__c!=null){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null){t.__e=t.__c.base=r.__e;break}return fp(t)}}function op(t){(!t.__d&&(t.__d=!0)&&rn.push(t)&&!Jo.__r++||ip!==_e.debounceRendering)&&((ip=_e.debounceRendering)||lp)(Jo)}function Jo(){var t,e,r,n,i,s,o,c;for(rn.sort(xc);t=rn.shift();)t.__d&&(e=rn.length,n=void 0,s=(i=(r=t).__v).__e,o=[],c=[],r.__P&&((n=Vr({},i)).__v=i.__v+1,_e.vnode&&_e.vnode(n),Pc(r.__P,n,i,r.__n,r.__P.namespaceURI,32&i.__u?[s]:null,o,s??Wn(i),!!(32&i.__u),c),n.__v=i.__v,n.__.__k[n.__i]=n,hp(o,n,c),n.__e!=s&&fp(n)),rn.length>e&&rn.sort(xc));Jo.__r=0}function mp(t,e,r,n,i,s,o,c,u,f,g){var h,v,_,m,y,T,O=n&&n.__k||pp,H=e.length;for(u=hh(r,e,O,u,H),h=0;h<H;h++)(_=r.__k[h])!=null&&(v=_.__i===-1?Ki:O[_.__i]||Ki,_.__i=h,T=Pc(t,_,v,i,s,o,c,u,f,g),m=_.__e,_.ref&&v.ref!=_.ref&&(v.ref&&Lc(v.ref,null,_),g.push(_.ref,_.__c||m,_)),y==null&&m!=null&&(y=m),4&_.__u||v.__k===_.__k?u=dp(_,u,t):typeof _.type=="function"&&T!==void 0?u=T:m&&(u=m.nextSibling),_.__u&=-7);return r.__e=y,u}function hh(t,e,r,n,i){var s,o,c,u,f,g=r.length,h=g,v=0;for(t.__k=new Array(i),s=0;s<i;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(u=s+v,(o=t.__k[s]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?Ko(null,o,null,null,null):Ac(o)?Ko(fr,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?Ko(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=t,o.__b=t.__b+1,c=null,(f=o.__i=gh(o,r,u,h))!==-1&&(h--,(c=r[f])&&(c.__u|=2)),c==null||c.__v===null?(f==-1&&v--,typeof o.type!="function"&&(o.__u|=4)):f!=u&&(f==u-1?v--:f==u+1?v++:(f>u?v--:v++,o.__u|=4))):t.__k[s]=null;if(h)for(s=0;s<g;s++)(c=r[s])!=null&&(2&c.__u)==0&&(c.__e==n&&(n=Wn(c)),gp(c,c));return n}function dp(t,e,r){var n,i;if(typeof t.type=="function"){for(n=t.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=t,e=dp(n[i],e,r));return e}t.__e!=e&&(e&&t.type&&!r.contains(e)&&(e=Wn(t)),r.insertBefore(t.__e,e||null),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function gh(t,e,r,n){var i,s,o=t.key,c=t.type,u=e[r];if(u===null||u&&o==u.key&&c===u.type&&(2&u.__u)==0)return r;if(n>(u!=null&&(2&u.__u)==0?1:0))for(i=r-1,s=r+1;i>=0||s<e.length;){if(i>=0){if((u=e[i])&&(2&u.__u)==0&&o==u.key&&c===u.type)return i;i--}if(s<e.length){if((u=e[s])&&(2&u.__u)==0&&o==u.key&&c===u.type)return s;s++}}return-1}function sp(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||dh.test(e)?r:r+"px"}function qo(t,e,r,n,i){var s;t:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||sp(t.style,e,"");if(r)for(e in r)n&&r[e]===n[e]||sp(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(up,"$1")),e=e.toLowerCase()in t||e=="onFocusOut"||e=="onFocusIn"?e.toLowerCase().slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=r,r?n?r.u=n.u:(r.u=Nc,t.addEventListener(e,s?Dc:Cc,s)):t.removeEventListener(e,s?Dc:Cc,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break t}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function ap(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e.t==null)e.t=Nc++;else if(e.t<r.u)return;return r(_e.event?_e.event(e):e)}}}function Pc(t,e,r,n,i,s,o,c,u,f){var g,h,v,_,m,y,T,O,H,R,k,V,Ut,de,j,ot,Y,st=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),s=[c=e.__e=r.__e]),(g=_e.__b)&&g(e);t:if(typeof st=="function")try{if(O=e.props,H="prototype"in st&&st.prototype.render,R=(g=st.contextType)&&n[g.__c],k=g?R?R.props.value:g.__:n,r.__c?T=(h=e.__c=r.__c).__=h.__E:(H?e.__c=h=new st(O,k):(e.__c=h=new pr(O,k),h.constructor=st,h.render=vh),R&&R.sub(h),h.props=O,h.state||(h.state={}),h.context=k,h.__n=n,v=h.__d=!0,h.__h=[],h._sb=[]),H&&h.__s==null&&(h.__s=h.state),H&&st.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Vr({},h.__s)),Vr(h.__s,st.getDerivedStateFromProps(O,h.__s))),_=h.props,m=h.state,h.__v=e,v)H&&st.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),H&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(H&&st.getDerivedStateFromProps==null&&O!==_&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(O,k),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(O,h.__s,k)===!1||e.__v==r.__v)){for(e.__v!=r.__v&&(h.props=O,h.state=h.__s,h.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(Jt){Jt&&(Jt.__=e)}),V=0;V<h._sb.length;V++)h.__h.push(h._sb[V]);h._sb=[],h.__h.length&&o.push(h);break t}h.componentWillUpdate!=null&&h.componentWillUpdate(O,h.__s,k),H&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(_,m,y)})}if(h.context=k,h.props=O,h.__P=t,h.__e=!1,Ut=_e.__r,de=0,H){for(h.state=h.__s,h.__d=!1,Ut&&Ut(e),g=h.render(h.props,h.state,h.context),j=0;j<h._sb.length;j++)h.__h.push(h._sb[j]);h._sb=[]}else do h.__d=!1,Ut&&Ut(e),g=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++de<25);h.state=h.__s,h.getChildContext!=null&&(n=Vr(Vr({},n),h.getChildContext())),H&&!v&&h.getSnapshotBeforeUpdate!=null&&(y=h.getSnapshotBeforeUpdate(_,m)),c=mp(t,Ac(ot=g!=null&&g.type===fr&&g.key==null?g.props.children:g)?ot:[ot],e,r,n,i,s,o,c,u,f),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),T&&(h.__E=h.__=null)}catch(Jt){if(e.__v=null,u||s!=null)if(Jt.then){for(e.__u|=u?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s[s.indexOf(c)]=null,e.__e=c}else for(Y=s.length;Y--;)Oc(s[Y]);else e.__e=r.__e,e.__k=r.__k;_e.__e(Jt,e,r)}else s==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):c=e.__e=yh(r.__e,e,r,n,i,s,o,u,f);return(g=_e.diffed)&&g(e),128&e.__u?void 0:c}function hp(t,e,r){for(var n=0;n<r.length;n++)Lc(r[n],r[++n],r[++n]);_e.__c&&_e.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){_e.__e(s,i.__v)}})}function yh(t,e,r,n,i,s,o,c,u){var f,g,h,v,_,m,y,T=r.props,O=e.props,H=e.type;if(H=="svg"?i="http://www.w3.org/2000/svg":H=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(f=0;f<s.length;f++)if((_=s[f])&&"setAttribute"in _==!!H&&(H?_.localName==H:_.nodeType==3)){t=_,s[f]=null;break}}if(t==null){if(H==null)return document.createTextNode(O);t=document.createElementNS(i,H,O.is&&O),c&&(_e.__m&&_e.__m(e,s),c=!1),s=null}if(H===null)T===O||c&&t.data===O||(t.data=O);else{if(s=s&&Xo.call(t.childNodes),T=r.props||Ki,!c&&s!=null)for(T={},f=0;f<t.attributes.length;f++)T[(_=t.attributes[f]).name]=_.value;for(f in T)if(_=T[f],f!="children"){if(f=="dangerouslySetInnerHTML")h=_;else if(!(f in O)){if(f=="value"&&"defaultValue"in O||f=="checked"&&"defaultChecked"in O)continue;qo(t,f,null,_,i)}}for(f in O)_=O[f],f=="children"?v=_:f=="dangerouslySetInnerHTML"?g=_:f=="value"?m=_:f=="checked"?y=_:c&&typeof _!="function"||T[f]===_||qo(t,f,_,T[f],i);if(g)c||h&&(g.__html===h.__html||g.__html===t.innerHTML)||(t.innerHTML=g.__html),e.__k=[];else if(h&&(t.innerHTML=""),mp(t,Ac(v)?v:[v],e,r,n,H=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:r.__k&&Wn(r,0),c,u),s!=null)for(f=s.length;f--;)Oc(s[f]);c||(f="value",H=="progress"&&m==null?t.removeAttribute("value"):m!==void 0&&(m!==t[f]||H=="progress"&&!m||H=="option"&&m!==T[f])&&qo(t,f,m,T[f],i),f="checked",y!==void 0&&y!==t[f]&&qo(t,f,y,T[f],i))}return t}function Lc(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(i){_e.__e(i,r)}}function gp(t,e,r){var n,i;if(_e.unmount&&_e.unmount(t),(n=t.ref)&&(n.current&&n.current!==t.__e||Lc(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(s){_e.__e(s,e)}n.base=n.__P=null}if(n=t.__k)for(i=0;i<n.length;i++)n[i]&&gp(n[i],e,r||typeof t.type!="function");r||Oc(t.__e),t.__c=t.__=t.__e=void 0}function vh(t,e,r){return this.constructor(t,r)}function Qo(t,e,r){var n,i,s,o;e==document&&(e=document.documentElement),_e.__&&_e.__(t,e),i=(n=typeof r=="function")?null:r&&r.__k||e.__k,s=[],o=[],Pc(e,t=(!n&&r||e).__k=Ji(fr,null,[t]),i||Ki,Ki,e.namespaceURI,!n&&r?[r]:i?null:e.firstChild?Xo.call(e.childNodes):null,s,!n&&r?r:i?i.__e:e.firstChild,n,o),hp(s,t,o)}Xo=pp.slice,_e={__e:function(t,e,r,n){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,n||{}),o=i.__d),o)return i.__E=i}catch(c){t=c}throw t}},cp=0,Rc=function(t){return t!=null&&t.constructor==null},pr.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Vr({},this.state),typeof t=="function"&&(t=t(Vr({},r),this.props)),t&&Vr(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),op(this))},pr.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),op(this))},pr.prototype.render=fr,rn=[],lp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,xc=function(t,e){return t.__v.__b-e.__v.__b},Jo.__r=0,up=/(PointerCapture)$|Capture$/i,Nc=0,Cc=ap(!1),Dc=ap(!0),mh=0;var Uc,Rt,Bc,yp,vp=0,xp=[],Ke=_e,_p=Ke.__b,Ep=Ke.__r,Sp=Ke.diffed,bp=Ke.__c,wp=Ke.unmount,Ip=Ke.__;function _h(t,e){Ke.__h&&Ke.__h(Rt,t,vp||e),vp=0;var r=Rt.__H||(Rt.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function kc(t,e){var r=_h(Uc++,7);return bh(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Eh(){for(var t;t=xp.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(Zo),t.__H.__h.forEach(Mc),t.__H.__h=[]}catch(e){t.__H.__h=[],Ke.__e(e,t.__v)}}Ke.__b=function(t){Rt=null,_p&&_p(t)},Ke.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Ip&&Ip(t,e)},Ke.__r=function(t){Ep&&Ep(t),Uc=0;var e=(Rt=t.__c).__H;e&&(Bc===Rt?(e.__h=[],Rt.__h=[],e.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(e.__h.forEach(Zo),e.__h.forEach(Mc),e.__h=[],Uc=0)),Bc=Rt},Ke.diffed=function(t){Sp&&Sp(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(xp.push(e)!==1&&yp===Ke.requestAnimationFrame||((yp=Ke.requestAnimationFrame)||Sh)(Eh)),e.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Bc=Rt=null},Ke.__c=function(t,e){e.some(function(r){try{r.__h.forEach(Zo),r.__h=r.__h.filter(function(n){return!n.__||Mc(n)})}catch(n){e.some(function(i){i.__h&&(i.__h=[])}),e=[],Ke.__e(n,r.__v)}}),bp&&bp(t,e)},Ke.unmount=function(t){wp&&wp(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Zo(n)}catch(i){e=i}}),r.__H=void 0,e&&Ke.__e(e,r.__v))};var Tp=typeof requestAnimationFrame=="function";function Sh(t){var e,r=function(){clearTimeout(n),Tp&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,100);Tp&&(e=requestAnimationFrame(r))}function Zo(t){var e=Rt,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),Rt=e}function Mc(t){var e=Rt;t.__c=t.__(),Rt=e}function bh(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}var wh=Symbol.for("preact-signals");function Hc(){if(Gn>1)Gn--;else{for(var t,e=!1;Xi!==void 0;){var r=Xi;for(Xi=void 0,Fc++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Dp(r))try{r.c()}catch(i){e||(t=i,e=!0)}r=n}}if(Fc=0,Gn--,e)throw t}}var Re=void 0,Xi=void 0,Gn=0,Fc=0,es=0;function Cp(t){if(Re!==void 0){var e=t.n;if(e===void 0||e.t!==Re)return e={i:0,S:t,p:Re.s,n:void 0,t:Re,e:void 0,x:void 0,r:e},Re.s!==void 0&&(Re.s.n=e),Re.s=e,t.n=e,32&Re.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=Re.s,e.n=void 0,Re.s.n=e,Re.s=e),e}}function Je(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}Je.prototype.brand=wh;Je.prototype.h=function(){return!0};Je.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)};Je.prototype.U=function(t){if(this.t!==void 0){var e=t.e,r=t.x;e!==void 0&&(e.x=r,t.e=void 0),r!==void 0&&(r.e=e,t.x=void 0),t===this.t&&(this.t=r)}};Je.prototype.subscribe=function(t){var e=this;return nt(function(){var r=e.value,n=Re;Re=void 0;try{t(r)}finally{Re=n}})};Je.prototype.valueOf=function(){return this.value};Je.prototype.toString=function(){return this.value+""};Je.prototype.toJSON=function(){return this.value};Je.prototype.peek=function(){var t=Re;Re=void 0;try{return this.value}finally{Re=t}};Object.defineProperty(Je.prototype,"value",{get:function(){var t=Cp(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(Fc>100)throw new Error("Cycle detected");this.v=t,this.i++,es++,Gn++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{Hc()}}}});function Qt(t){return new Je(t)}function Dp(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 Rp(t){for(var e=t.s;e!==void 0;e=e.n){var r=e.S.n;if(r!==void 0&&(e.r=r),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function Np(t){for(var e=t.s,r=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):r=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=r}function Vn(t){Je.call(this,void 0),this.x=t,this.s=void 0,this.g=es-1,this.f=4}(Vn.prototype=new Je).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===es))return!0;if(this.g=es,this.f|=1,this.i>0&&!Dp(this))return this.f&=-2,!0;var t=Re;try{Rp(this),Re=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Re=t,Np(this),this.f&=-2,!0};Vn.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)}Je.prototype.S.call(this,t)};Vn.prototype.U=function(t){if(this.t!==void 0&&(Je.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)}};Vn.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(Vn.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=Cp(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function $c(t){return new Vn(t)}function Ap(t){var e=t.u;if(t.u=void 0,typeof e=="function"){Gn++;var r=Re;Re=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,jc(t),n}finally{Re=r,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,Ap(t)}function Ih(t){if(Re!==this)throw new Error("Out-of-order effect");Np(this),Re=t,this.f&=-2,8&this.f&&jc(this),Hc()}function Qi(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Qi.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()}};Qi.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Ap(this),Rp(this),Gn++;var t=Re;return Re=this,Ih.bind(this,t)};Qi.prototype.N=function(){2&this.f||(this.f|=2,this.o=Xi,Xi=this)};Qi.prototype.d=function(){this.f|=8,1&this.f||jc(this)};function nt(t){var e=new Qi(t);try{e.c()}catch(r){throw e.d(),r}return e.d.bind(e)}var Gc,Wc;function zn(t,e){_e[t]=e.bind(null,_e[t]||function(){})}function ts(t){Wc&&Wc(),Wc=t&&t.S()}function Op(t){var e=this,r=t.data,n=xh(r);n.value=r;var i=kc(function(){for(var s=e.__v;s=s.__;)if(s.__c){s.__c.__$f|=4;break}return e.__$u.c=function(){var o,c=e.__$u.S(),u=i.value;c(),Rc(u)||((o=e.base)==null?void 0:o.nodeType)!==3?(e.__$f|=1,e.setState({})):e.base.data=u},$c(function(){var o=n.value.value;return o===0?0:o===!0?"":o||""})},[]);return i.value}Op.displayName="_st";Object.defineProperties(Je.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Op},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});zn("__b",function(t,e){if(typeof e.type=="string"){var r,n=e.props;for(var i in n)if(i!=="children"){var s=n[i];s instanceof Je&&(r||(e.__np=r={}),r[i]=s,n[i]=s.peek())}}t(e)});zn("__r",function(t,e){ts();var r,n=e.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var s;return nt(function(){s=this}),s.c=function(){n.__$f|=1,n.setState({})},s}())),Gc=n,ts(r),t(e)});zn("__e",function(t,e,r,n){ts(),Gc=void 0,t(e,r,n)});zn("diffed",function(t,e){ts(),Gc=void 0;var r;if(typeof e.type=="string"&&(r=e.__e)){var n=e.__np,i=e.props;if(n){var s=r.U;if(s)for(var o in s){var c=s[o];c!==void 0&&!(o in n)&&(c.d(),s[o]=void 0)}else r.U=s={};for(var u in n){var f=s[u],g=n[u];f===void 0?(f=Th(r,u,g,i),s[u]=f):f.o(g,i)}}}t(e)});function Th(t,e,r,n){var i=e in t&&t.ownerSVGElement===void 0,s=Qt(r);return{o:function(o,c){s.value=o,n=c},d:nt(function(){var o=s.value.value;n[e]!==o&&(n[e]=o,i?t[e]=o:o?t.setAttribute(e,o):t.removeAttribute(e))})}}zn("unmount",function(t,e){if(typeof e.type=="string"){var r=e.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var i in n){var s=n[i];s&&s.d()}}}}else{var o=e.__c;if(o){var c=o.__$u;c&&(o.__$u=void 0,c.d())}}t(e)});zn("__h",function(t,e,r,n){(n<3||n===9)&&(e.__$f|=2),t(e,r,n)});pr.prototype.shouldComponentUpdate=function(t,e){var r=this.__$u,n=r&&r.s!==void 0;for(var i in e)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){if(!(n||2&this.__$f||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var s in t)if(s!=="__source"&&t[s]!==this.props[s])return!0;for(var o in this.props)if(!(o in t))return!0;return!1};function xh(t){return kc(function(){return Qt(t)},[])}var Ch=Object.prototype.toString,qn=Array.isArray||function(t){return Ch.call(t)==="[object Array]"};function zc(t){return typeof t=="function"}function Dh(t){return qn(t)?"array":typeof t}function Vc(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Pp(t,e){return t!=null&&typeof t=="object"&&e in t}function Rh(t,e){return t!=null&&typeof t!="object"&&t.hasOwnProperty&&t.hasOwnProperty(e)}var Nh=RegExp.prototype.test;function Ah(t,e){return Nh.call(t,e)}var Oh=/\S/;function Ph(t){return!Ah(Oh,t)}var Lh={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function Bh(t){return String(t).replace(/[&<>"'`=\/]/g,function(e){return Lh[e]})}var Uh=/\s*/,Mh=/\s+/,Lp=/\s*=/,kh=/\s*\}/,Fh=/#|\^|\/|>|\{|&|=|!/;function Hh(t,e){if(!t)return[];var r=!1,n=[],i=[],s=[],o=!1,c=!1,u="",f=0;function g(){if(o&&!c)for(;s.length;)delete i[s.pop()];else s=[];o=!1,c=!1}var h,v,_;function m(j){if(typeof j=="string"&&(j=j.split(Mh,2)),!qn(j)||j.length!==2)throw new Error("Invalid tags: "+j);h=new RegExp(Vc(j[0])+"\\s*"),v=new RegExp("\\s*"+Vc(j[1])),_=new RegExp("\\s*"+Vc("}"+j[1]))}m(e||Mt.tags);for(var y=new eo(t),T,O,H,R,k,V;!y.eos();){if(T=y.pos,H=y.scanUntil(h),H)for(var Ut=0,de=H.length;Ut<de;++Ut)R=H.charAt(Ut),Ph(R)?(s.push(i.length),u+=R):(c=!0,r=!0,u+=" "),i.push(["text",R,T,T+1]),T+=1,R===`
|
|
17
17
|
`&&(g(),u="",f=0,r=!1);if(!y.scan(h))break;if(o=!0,O=y.scan(Fh)||"name",y.scan(Uh),O==="="?(H=y.scanUntil(Lp),y.scan(Lp),y.scanUntil(v)):O==="{"?(H=y.scanUntil(_),y.scan(kh),y.scanUntil(v),O="&"):H=y.scanUntil(v),!y.scan(v))throw new Error("Unclosed tag at "+y.pos);if(O==">"?k=[O,H,T,y.pos,u,f,r]:k=[O,H,T,y.pos],f++,i.push(k),O==="#"||O==="^")n.push(k);else if(O==="/"){if(V=n.pop(),!V)throw new Error('Unopened section "'+H+'" at '+T);if(V[1]!==H)throw new Error('Unclosed section "'+V[1]+'" at '+T)}else O==="name"||O==="{"||O==="&"?c=!0:O==="="&&m(H)}if(g(),V=n.pop(),V)throw new Error('Unclosed section "'+V[1]+'" at '+y.pos);return jh($h(i))}function $h(t){for(var e=[],r,n,i=0,s=t.length;i<s;++i)r=t[i],r&&(r[0]==="text"&&n&&n[0]==="text"?(n[1]+=r[1],n[3]=r[3]):(e.push(r),n=r));return e}function jh(t){for(var e=[],r=e,n=[],i,s,o=0,c=t.length;o<c;++o)switch(i=t[o],i[0]){case"#":case"^":r.push(i),n.push(i),r=i[4]=[];break;case"/":s=n.pop(),s[5]=i[2],r=n.length>0?n[n.length-1][4]:e;break;default:r.push(i)}return e}function eo(t){this.string=t,this.tail=t,this.pos=0}eo.prototype.eos=function(){return this.tail===""};eo.prototype.scan=function(t){var e=this.tail.match(t);if(!e||e.index!==0)return"";var r=e[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r};eo.prototype.scanUntil=function(t){var e=this.tail.search(t),r;switch(e){case-1:r=this.tail,this.tail="";break;case 0:r="";break;default:r=this.tail.substring(0,e),this.tail=this.tail.substring(e)}return this.pos+=r.length,r};function Yn(t,e){this.view=t,this.cache={".":this.view},this.parent=e}Yn.prototype.push=function(t){return new Yn(t,this)};Yn.prototype.lookup=function(t){var e=this.cache,r;if(e.hasOwnProperty(t))r=e[t];else{for(var n=this,i,s,o,c=!1;n;){if(t.indexOf(".")>0)for(i=n.view,s=t.split("."),o=0;i!=null&&o<s.length;)o===s.length-1&&(c=Pp(i,s[o])||Rh(i,s[o])),i=i[s[o++]];else i=n.view[t],c=Pp(n.view,t);if(c){r=i;break}n=n.parent}e[t]=r}return zc(r)&&(r=r.call(this.view)),r};function dt(){this.templateCache={_cache:{},set:function(t,e){this._cache[t]=e},get:function(t){return this._cache[t]},clear:function(){this._cache={}}}}dt.prototype.clearCache=function(){typeof this.templateCache<"u"&&this.templateCache.clear()};dt.prototype.parse=function(t,e){var r=this.templateCache,n=t+":"+(e||Mt.tags).join(":"),i=typeof r<"u",s=i?r.get(n):void 0;return s==null&&(s=Hh(t,e),i&&r.set(n,s)),s};dt.prototype.render=function(t,e,r,n){var i=this.getConfigTags(n),s=this.parse(t,i),o=e instanceof Yn?e:new Yn(e,void 0);return this.renderTokens(s,o,r,t,n)};dt.prototype.renderTokens=function(t,e,r,n,i){for(var s="",o,c,u,f=0,g=t.length;f<g;++f)u=void 0,o=t[f],c=o[0],c==="#"?u=this.renderSection(o,e,r,n,i):c==="^"?u=this.renderInverted(o,e,r,n,i):c===">"?u=this.renderPartial(o,e,r,i):c==="&"?u=this.unescapedValue(o,e):c==="name"?u=this.escapedValue(o,e,i):c==="text"&&(u=this.rawValue(o)),u!==void 0&&(s+=u);return s};dt.prototype.renderSection=function(t,e,r,n,i){var s=this,o="",c=e.lookup(t[1]);function u(h){return s.render(h,e,r,i)}if(c){if(qn(c))for(var f=0,g=c.length;f<g;++f)o+=this.renderTokens(t[4],e.push(c[f]),r,n,i);else if(typeof c=="object"||typeof c=="string"||typeof c=="number")o+=this.renderTokens(t[4],e.push(c),r,n,i);else if(zc(c)){if(typeof n!="string")throw new Error("Cannot use higher-order sections without the original template");c=c.call(e.view,n.slice(t[3],t[5]),u),c!=null&&(o+=c)}else o+=this.renderTokens(t[4],e,r,n,i);return o}};dt.prototype.renderInverted=function(t,e,r,n,i){var s=e.lookup(t[1]);if(!s||qn(s)&&s.length===0)return this.renderTokens(t[4],e,r,n,i)};dt.prototype.indentPartial=function(t,e,r){for(var n=e.replace(/[^ \t]/g,""),i=t.split(`
|
|
18
18
|
`),s=0;s<i.length;s++)i[s].length&&(s>0||!r)&&(i[s]=n+i[s]);return i.join(`
|
|
19
|
-
`)};dt.prototype.renderPartial=function(t,e,r,n){if(r){var i=this.getConfigTags(n),s=zc(r)?r(t[1]):r[t[1]];if(s!=null){var o=t[6],c=t[5],u=t[4],f=s;c==0&&u&&(f=this.indentPartial(s,u,o));var g=this.parse(f,i);return this.renderTokens(g,e,r,f,n)}}};dt.prototype.unescapedValue=function(t,e){var r=e.lookup(t[1]);if(r!=null)return r};dt.prototype.escapedValue=function(t,e,r){var n=this.getConfigEscape(r)||Mt.escape,i=e.lookup(t[1]);if(i!=null)return typeof i=="number"&&n===Mt.escape?String(i):n(i)};dt.prototype.rawValue=function(t){return t[1]};dt.prototype.getConfigTags=function(t){return qn(t)?t:t&&typeof t=="object"?t.tags:void 0};dt.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!qn(t))return t.escape};var Mt={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){Zi.templateCache=t},get templateCache(){return Zi.templateCache}},Zi=new dt;Mt.clearCache=function(){return Zi.clearCache()};Mt.parse=function(t,e){return Zi.parse(t,e)};Mt.render=function(t,e,r,n){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Dh(t)+'" was given as the first argument for mustache#render(template, view, partials)');return Zi.render(t,e,r,n)};Mt.escape=Bh;Mt.Scanner=eo;Mt.Context=Yn;Mt.Writer=dt;var Zt=Mt,Up=Xt(Bp()),Nt=class Un{static DOCUMENT_STANDARD_MODE="CSS1Compat";static _instance;parentContainer;scalingFactor=1;doc=document;parser=new Up.default;constructor(){}static get(){return Un._instance||(Un._instance=new Un),Un._instance}getUAParser(){return this.parser}getWidth(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientWidth:document.compatMode===Un.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parentContainer.clientHeight:document.compatMode===Un.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}isMobile(){return this.parser.getDevice().type==="mobile"}calculateScalingFactor(e){let r=e.max,n=e.cont.w,i=e.cont.h,s=e.spc,o=Un.get().getWidth(),c=Un.get().getHeight();r&&(o=o?Math.min(o,r):r,c=c?Math.min(c,r):r),c&&(o-=s.getHorizontal(),c-=s.getVertical(),o/c<n/i?this.scalingFactor=o/n:this.scalingFactor=c/i,this.scalingFactor=Math.min(this.scalingFactor,1))}getScalingFactor(){return this.scalingFactor}createElement(e){return this.doc.createElement(e)}appendChild(e,r){e.appendChild(r)}setStyles(e,r){Object.assign(e.style,r)}setStyle(e,r,n){if(r){if(!n){e.style.removeProperty(r);return}e.style.setProperty(r,n,"important")}}setAttribute(e,r,n){e.setAttribute(r,n)}removeInApp(e){let r=document.querySelector(`.${e.rootClassName}`);r&&r.parentElement.removeChild(r)}setParentContainer(e){this.parentContainer=e,this.parentContainer&&this.isParentNotBody()&&this.setStyle(this.parentContainer,"position","relative")}isParentNotBody(){return this.parentContainer!==document.body}},ne=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"},qc=Xt(kp());function Kn(t){return qc.default.createInstance({name:"lc",storeName:t,driver:qc.default.LOCALSTORAGE})}var zr=class{static storage;static async get(t,e){return await this.storage?.getItem(t)??e}static set(t,e){return this.storage?.setItem(t,e)}static remove(t){return this.storage?.removeItem(t)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}},at=class extends zr{static storeName="ses";static{this.storage=Kn(this.storeName)}},Ne=class extends zr{static storeName="usr";static{this.storage=Kn(this.storeName)}},fe=class{isCartDirty=!0;cartEngagements;isGoKwikPopupOpen;previewIDs;previewVariant;pageName;moneyFormat;jsLoadTime=new Date;shopCurrencyCode;inInactive=!1;lastEnterActive=new Date;lastEnterInactive=null;currentItem;_currencyCode;get currencyCode(){return this._currencyCode}set currencyCode(t){this._currencyCode=t}static get(){return window.CooeeSDK.runtimeData}isInactive(){return this.inInactive}async setInactive(){return this.inInactive?0:(this.inInactive=!0,this.lastEnterInactive=new Date,Math.max((this.lastEnterInactive.getTime()-this.lastEnterActive.getTime())/1e3,0))}setActive(){return this.inInactive?(this.inInactive=!1,this.lastEnterActive=new Date,Math.max((this.lastEnterActive.getTime()-this.lastEnterInactive.getTime())/1e3,0)):0}isFirstActive(){return this.lastEnterInactive==null}getCurrentItem(){return this.currentItem}setCurrentItem(t){this.currentItem=t}},Ae=class{static COOEE_URL_PREFIX="?from=cooee";static isShopify(){return!!window.Shopify}static getShopName(){if(this.isShopify())return window.Shopify.shop?.split(".")?.[0]}static getPageName(){if(!this.isShopify())return;let t=new URL(window.location.href).pathname.slice(1).split("/"),e=t[0];if(e==="")return"home";if(e==="collections")return t[2]==="products"?"product":"collection";if(e==="products")return"product";if(e==="cart")return"cart";if(location.href.includes("thank_you"))return"thank_you"}static getProductSlug(t){let e=(t.includes("://")?new URL(t).pathname:t).match(/\/products\/([^/]+?)(?:\.html)?$/);return e?e[1]:null}static getRootPrefix(){return window.Shopify?.routes?.root??"/"}static getCartURL(t){return this.getRootPrefix()+t+this.COOEE_URL_PREFIX}},Jn=class{isLocked=!1;queue=[];async acquire(){if(this.isLocked)await new Promise(t=>this.queue.push(t));else{this.isLocked=!0;return}}release(){if(this.queue.length>0){let t=this.queue.shift();t&&t()}else this.isLocked=!1}},ge=class Mp{static CURRENT;token;items;total_price;original_total_price;currency;item_count;attributes;lock=new Jn;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new Mp),this.CURRENT}async getNormalisedCart(e){await this.fetchCartFromShopify(e);let r=this.convertToCooeeCart();return e&&await Ne.set(ne.CURRENT_CART,r),r}async addCooeeAttributes(){await this.lock.acquire();let e=await at.get(ne.ID),r=await Ne.get(ne.DEVICE_ID);if(this.attributes?.letscooee_did===r&&this.attributes?.letscooee_sid===e){w.debug("Not calling Shopify update.js API.","Current attributes:",this.attributes),this.lock.release();return}let n={letscooee_did:r,letscooee_sid:e,__letscooee_time:new Date().toLocaleString()};w.debug("Updating Shopify cart with attributes:",n);let i=Ae.getCartURL("cart/update.js"),s=await(await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:n})})).json();w.debug("Updated cart attributes",JSON.stringify(s)),this.update(s),this.lock.release()}update(e){return this.token=e.token,this.items=e.items,this.total_price=e.total_price,this.original_total_price=e.original_total_price,this.currency=e.currency,this.item_count=e.item_count,this.attributes=e.attributes,fe.get().currencyCode=this.currency,w.log("Updated ShopifyCart",this),this}toString(){return`ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}convertToCooeeCart(){return{amount:this.total_price/100,originalAmount:this.original_total_price/100,currency:this.currency,itemCount:this.item_count,items:this.normaliseItems(this.items),token:this.token}}normaliseItems(e){if(!e)return w.error("No item received to be sent"),[];Array.isArray(e)||(e=[e]);let r=[];for(let n of e){if(!n.id||!n.title){w.warn("Invalid item received",n);continue}let i={name:n.title,quantity:+n.quantity||1,mID:n.product_id?.toString(),vID:n.id.toString(),price:+n.price/100||0,properties:n.properties},s=n.selling_plan_allocation?.selling_plan;if(!s){r.push(i);continue}i.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:s.fixed_selling_plan,id:s.id,name:s.name,recurringDeliveries:s.recurring_deliveries}},r.push(i)}return r}async fetchCartFromShopify(e){if(!e&&this.token){w.debug("Not fetching cart");return}w.debug("Fetching cart");let r=Ae.getCartURL("cart.js"),n=await(await fetch(r)).json();this.update(n)}},ns=class{static format(t,e){let r=/{{\s*(\w+)\s*}}/;return e.replace(r,(n,i)=>{switch(i){case"amount":return this.formatWithDelimiters(t,2);case"amount_no_decimals":return this.formatWithDelimiters(t,0);case"amount_with_comma_separator":return this.formatWithDelimiters(t,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(t,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(t,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(t,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(t,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(t,2," ",".");default:return n}})}static formatWithDelimiters(t,e=2,r=",",n="."){if(isNaN(t)||t==null)return"0";let i=(t/100).toFixed(e).split("."),s=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),o=i[1]?n+i[1]:"";return s+o}},kt=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}static parseToAny(t){try{return JSON.parse(t.toString())}catch{}return t.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(t.toString()):t}static async sleep(t){return new Promise(e=>setTimeout(e,t))}static hasKeys(t){return t?Object.keys(t).length>=1:!1}static convertObjectToArray(t,e){return e.reduce((r,n)=>(t.hasOwnProperty(n)&&t[n]!=null&&r.push({[n]:t[n]}),r),[])}static removeNullUndefinedKeys(t){return Object.keys(t).reduce((e,r)=>(t[r]!==null&&t[r]!==void 0&&(e[r]=t[r]),e),{})}static stringify(t){return JSON.stringify(t,function(e,r){return r===void 0?null:r})}},se=class{static tz;static isValidURL(t){try{return new URL(t)}catch{return}}static isNull(t){return!t||t==="null"||t==="undefined"}static removeFromArray(t,e){let r=t.indexOf(e);return r===-1?!1:(t.splice(r,1),!0)}static formatCurrency(t,e){if(t==0&&e)return"Free";let r=fe.get(),n=je.get(),i=r.shopCurrencyCode??n.currency,s=r.currencyCode,o=n.money?.format??r.moneyFormat,c;return o&&i===s?c=ns.format(t*100,o):(c=new Intl.NumberFormat(this.getLang(),{style:"currency",currency:s,minimumFractionDigits:0,maximumFractionDigits:2}).format(t),c=c.replace("\u20B9","Rs. "),n.money?.showCurrency&&s!=="INR"&&(c=c.concat(` ${s}`))),c}static formatNumber(t){return new Intl.NumberFormat(this.getLang(),{notation:"compact"}).format(t)}static getLang(){return navigator.languages!==void 0?navigator.languages[0].split("-")[0]:navigator.language??"en"}static getTimezone(){if(this.tz)return this.tz;try{return this.tz=Intl.DateTimeFormat().resolvedOptions().timeZone,this.tz}catch{return""}}static documentReady(t){document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t)}static onDocumentLoaded(t){document.readyState==="complete"?t():document.addEventListener("readystatechange",()=>{document.readyState==="complete"&&t()})}static showSnackbar(t){let e=document.createElement("span");e.id="snackbar",e.innerText=t,document.body.appendChild(e),e.className="show",setTimeout(()=>{e.classList.remove("show"),document.body.removeChild(e)},3e3)}static async retrySelectorForElements(t,e=10,r=document){let n=0,i=document.querySelectorAll("nonexistent-tag");for(;n<e;){let s=Math.min(100*2**n,5e3);if(await kt.sleep(s),i=r.querySelectorAll(t),i.length)return w.debug(`Attempt ${n+1}: ${i.length} elements found with ${t}`),i;w.debug(`Attempt ${n+1}: Elements not found with ${t}. Retrying after ${s}ms.`),n++}return w.warn(`Max attempts reached. Element not found with ${t}.`),i}static async retrySelector(t,e=10,r=document){return(await this.retrySelectorForElements(t,e,r)).item(0)}};function Xn(t,e,r){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!1,value:r})}var bt=class{id;mID;vID;vName;imageURL;name;link;quantity;price;constructor(t){this.id=t.id,this.mID=t.mID,this.vID=t.vID,this.vName=t.vName,this.imageURL=t.imageURL,this.name=t.name,this.link=t.link,this.quantity=t.quantity,this.price=t.price}},is=class{url;alt;constructor(t){t.alt&&(this.alt=t.alt),this.url=t.url}},os=class{d;cmp;effective;constructor(t={}){this.d=t.d,this.cmp=t.cmp,this.effective=t.d}},Kc=class{id;mID;name;groupID;groupName;isSelected;constructor(t){t??={},this.id=t.id,this.mID=t.mID,this.name=t.name,this.groupID=t.groupID,this.groupName=t.groupName,this.isSelected=t.isSelected??!1}},mr=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedSellingPlan;constructor(t){t=t??{},this.mID=t.mID,this.name=t.name,this.imgs=t.imgs?.map(e=>new is(e))??[],this.link=t.link,this.price=new os(t.price),this.sku=t.sku,this.isAvailable=t.isAvailable,this.quantity=t.quantity,t.sellingPlans?.length&&(this.selectedSellingPlan=Qt(void 0)),this.sellingPlans=t.sellingPlans?.map(e=>{let r=new Kc(e);return r.isSelected&&(this.selectedSellingPlan.value=r),r})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(t){this.selectedSellingPlan.value=t}},wt=class{id;mID;name;status;ctg;imgs;videos;portraitVideos;vars;desc;sDesc;link;slug;quantity;category;meta;selectedOrFirstVariant;selected=Qt(!0);constructor(t){this.update(t),this.selectedOrFirstVariant=Qt(this.selectedVariant)}get imageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}get selectedVariant(){return this.vars.find(t=>t.isAvailable)??this.vars[0]}set variants(t){this.vars=t,this.selectedOrFirstVariant.value=this.selectedVariant}update(t){return this.id=t.id,this.mID=t.mID,this.name=t.name,this.status=t.status,this.ctg=t.ctg,this.imgs=t.imgs,this.desc=t.desc,this.sDesc=t.sDesc,this.link=t.link,this.slug=t.slug,this.quantity=t.quantity,this.meta=t.meta,this.category=t.category,this.videos=t.videos,this.portraitVideos=t.videos?.filter(e=>e.orientation==="PORTRAIT"),t.vars&&(this.vars=t.vars.map(e=>new mr(e))),this}toEmbed(t){return t=t??this.selectedOrFirstVariant.value,new bt({id:this.id,mID:this.mID,vID:t.mID,vName:t.name,name:this.name,link:this.link,slug:this.slug,price:t.price.d,imageURL:t.getOneImage()??this.imgs?.[0].url})}},ss=class{id;mID;handle;title;imageURL;constructor(t){t??={},this.id=t.id,this.mID=t.mID,this.handle=t.handle,this.title=t.title,this.imageURL=t.imageURL}},Jc=class{enabled;constructor(t){this.enabled=t.enabled}},Xc=class extends Jc{max;min;constructor(t){t??={},super(t),this.min=t.min,this.max=t.max}},as=class{productQuantity;constructor(t){t??={},this.productQuantity=new Xc(t.productQuantity)}},nn=class{s;g;i;constructor(t){t.s&&(this.s=new We(t.s)),t.g&&(this.g=new ro(t.g)),this.i=t.i}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}},no="a-f\\d",Wh=`#?[${no}]{3}[${no}]?`,Gh=`#?[${no}]{6}([${no}]{2})?`,Vh=new RegExp(`[^#${no}]`,"gi"),zh=new RegExp(`^${Wh}$|^${Gh}$`,"i");function Qc(t,e={}){if(typeof t!="string"||Vh.test(t)||!zh.test(t))throw new TypeError("Expected a valid hex string");t=t.replace(/^#/,"");let r=1;t.length===8&&(r=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),t.length===4&&(r=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);let n=Number.parseInt(t,16),i=n>>16,s=n>>8&255,o=n&255,c=typeof e.alpha=="number"?e.alpha:r;if(e.format==="array")return[i,s,o,c];if(e.format==="css"){let u=c===1?"":` / ${Number((c*100).toFixed(2))}%`;return`rgb(${i} ${s} ${o}${u})`}return{red:i,green:s,blue:o,alpha:c}}var We=class{h;a=100;g;constructor(t){t??={},this.h=t.h,this.a=t.a,this.g=t.g}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return"";try{return Qc(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}}getAlpha(){return(this.a??100)/100}},on=class{s;r;w;c;constructor(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new We(t.c))}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return Fp[this.s??1]}},Fp=(t=>(t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED",t))(Fp||{}),ro=class bd{static DEFAULT_FALLBACK=new We({h:"#000000",a:50});r;c;fb;constructor(e){this.r=e.r,e.c&&(this.c=new We(e.c)),e.fb&&(this.fb=new We(e.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??bd.DEFAULT_FALLBACK}},io=class{blur;spr;clr;x;y;constructor(t){t=t??{},this.blur=t.blur??0,this.spr=t.spr??0,this.x=t.x??0,this.y=t.y??0,this.clr=new We(t.clr)}getStyle(t){return`${this.x*t}px ${this.y*t}px ${this.blur*t}px ${this.spr*t}px ${this.clr.rgba}`}},Nr=class{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(t){t=t??{},this.pl=t.pl??0,this.pr=t.pr??0,this.pt=t.pt??0,this.pb=t.pb??0,this.ml=t.ml??0,this.mr=t.mr??0,this.mt=t.mt??0,this.mb=t.mb??0,this.cent=t.cent??!1}getHorizontal(){return this.pl+this.pr}getVertical(){return this.pt+this.pb}getPaddingCSS(){return`${this.pt}px ${this.pr}px ${this.pb}px ${this.pl}px`}},sn=class{rot;constructor(t){t?.rot&&(this.rot=t.rot)}get rotate(){return this.rot}},At=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(t){this.t=t.t,t.bg&&(this.bg=new nn(t.bg)),t.br&&(this.br=new on(t.br)),t.shd&&(this.shd=new io(t.shd)),t.spc&&(this.spc=new Nr(t.spc)),this.trf=new sn(t.trf),this.clc=t.clc,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y,this.a=t.a}get alpha(){return this.a??100}get type(){return this.t}get typeAsString(){return Le[this.t]}get click(){return this.clc}},Le=(t=>(t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.FLEXBOX=4]="FLEXBOX",t[t.MULTI_COLUMN=5]="MULTI_COLUMN",t[t.CHECKBOX=6]="CHECKBOX",t[t.PRODUCTS=11]="PRODUCTS",t[t.PRODUCT=12]="PRODUCT",t[t.PRODUCT_IMAGE=13]="PRODUCT_IMAGE",t[t.PRODUCT_TITLE=14]="PRODUCT_TITLE",t[t.PRODUCT_VARIATIONS=15]="PRODUCT_VARIATIONS",t[t.PRODUCT_VARIATIONS_SELLING_PLANS=16]="PRODUCT_VARIATIONS_SELLING_PLANS",t[t.PRODUCT_BUTTON=18]="PRODUCT_BUTTON",t[t.EMAIL_INPUT=51]="EMAIL_INPUT",t[t.PHONE_INPUT=52]="PHONE_INPUT",t[t.COUNTDOWN_TIMER=61]="COUNTDOWN_TIMER",t[t.CAROUSEL=62]="CAROUSEL",t[t.SHAPE=100]="SHAPE",t))(Le||{}),an=class extends At{constructor(t){super(t)}},Ar=class extends At{src;constructor(t){super(t),this.src=t.src}},Qn=(t=>(t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY",t))(Qn||{}),cs=class{name;fonts;constructor(t){t=t??{},t.name&&(t.name=t.name!=="Arial"?t.name:""),this.name=t.name,this.fonts=t.fonts?.map(e=>new Zc(e))}},Zc=class{style;url;constructor(t){t=t??{},this.style=t.style,this.url=t.url}getFontDescriptor(){return{style:this.style===2||this.style===4?"italic":"normal",weight:this.style===4||this.style===3?"700":"400"}}getURL(){return`url('${this.url}') format('truetype')`}},it=class{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(t){this.update(t)}get alignment(){return Qn[this.ta]}get letterSpacing(){return this.ls?this.ls+"px":"normal"}update(t){t=t??{},t.lh&&(this.lh=t.lh),t.tdc&&(this.tdc=new We(t.tdc)),this.td=t.td,this.fs=t.s??t.fs??60,this.tc=new We(t.tc),this.ta=t.ta??1,this.fw=t.fw??400,this.ls=t.ls??0,this.tc.h??="#000000",this.fam=new cs(t.fam??t.fmly)}resize(t){this.s*=t,this.ls*=t}},dr=class extends At{typo;constructor(t){super(t);let e=b(b({},t.f),t.typo);t.alg&&(e.ta=t.alg),t.c&&(e.tc=t.c),this.typo=new it(e)}get color(){return this.typography.tc}get typography(){return this.typo}},Yr=class extends dr{prs;constructor(t){super(t),this.prs=t.prs}get parts(){return this.prs}},ls=class extends At{o;constructor(t){super(t),this.o=t.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}},Zn=class{dd;hh;mm;ss;date;constructor(t){t??={},this.dd=t.dd??0,this.hh=t.hh??0,this.mm=t.mm??0,this.ss=t.ss??0,this.date=t.date?new Date(t.date):void 0}start(t,e){let r=new Date;t===2?(r.setSeconds(r.getSeconds()+this.ss),r.setMinutes(r.getMinutes()+this.mm),r.setHours(r.getHours()+this.hh),r.setDate(r.getDate()+this.dd)):r=this.date??new Date;let n=window.setInterval(()=>{let i=new Date().getTime(),s=r.getTime()-i;if(s<1){clearInterval(n);return}let o=Math.floor(s/(1e3*60*60*24)),c=Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),u=Math.floor(s%(1e3*60*60)/(1e3*60)),f=Math.floor(s%(1e3*60)/1e3);e({days:o,hours:c,minutes:u,seconds:f})},1e3);return n}},ei=class extends dr{gap;timer;timerType;horizontal;lblPos;show;constructor(t){t??={},super(t),this.gap=t.gap,this.timerType=t.type,this.timer=new Zn(t.timer),this.show=t.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=t.horizontal,this.lblPos=t.lblPos}},us=class{txt;c;constructor(t){t??={},this.txt=t.txt,this.c=new We(t.c??{})}get text(){return this.txt}get color(){return this.c}},qr=class extends dr{ph;constructor(t){super(t),this.ph=new us(t.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}},ti=class extends qr{constructor(t){t??={},super(t)}},ri=class extends qr{},ni=class extends qr{},ii=class extends Ar{},cn=(t=>(t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=3]="HIGH",t))(cn||{}),ps=class{en;ex;constructor(t){t=t??{},this.en=t.en,this.ex=t.ex}getEnterAnimation(){switch(this.en){case 2:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case 3:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case 4:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case 5:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case 6:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case 7:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case 8:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case 9:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case 10:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}}getExitAnimation(){switch(this.ex){case 2:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case 3:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case 4:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case 5:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case 6:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case 7:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case 8:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case 9:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case 10:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}}},oo=class extends At{gvt;max;cover;anim;embedded;position;constructor(t){t=t??{},super(t),this.gvt=t.gvt??5,this.max=t.max,this.cover=t.cover??!0,this.anim=new ps(t.anim),this.embedded=t.embedded,this.position=t.position??1,this.spc||(this.spc=new Nr({pl:A.IN_APP_DEFAULT_PADDING,pr:A.IN_APP_DEFAULT_PADDING,pt:A.IN_APP_DEFAULT_PADDING,pb:A.IN_APP_DEFAULT_PADDING}))}isEmbedded(){return this.position===2&&!!this.embedded}getEmbeddedSelector(){return`.letscooee-engagement.container-${this.embedded}`}},fs=class extends oo{cont;elems=[];mob;constructor(t){t=t??{},super(t),this.cont=new ls(t.cont),this.mob=new oo(t.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),t.elems.forEach(e=>{e.t===1?this.elems.push(new Ar(e)):e.t===2?this.elems.push(new Yr(e)):e.t===3?this.elems.push(new Yr(e)):e.t===100?this.elems.push(new an(e)):e.t===51?this.elems.push(new ri(e)):e.t===52?this.elems.push(new ni(e)):e.t===61?this.elems.push(new ei(e)):e.t===15||e.t===16?this.elems.push(new ti(e)):e.t===13&&this.elems.push(new ii(e))})}getStylesForWrapper(){if(this.cover)return{};let t;return this.gvt===1?t={top:0,left:0}:this.gvt===2?t={top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===3?t={top:0,right:0}:this.gvt===6?t={top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===9?t={bottom:0,right:0}:this.gvt===8?t={bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===7?t={bottom:0,left:0}:this.gvt===4?t={top:"50%",left:0,transform:"translateY(-50%)"}:t={top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},t.overflow="visible",t}getFlexStylesForContainer(){let t={display:"flex",flexDirection:"row"},e,r;return this.gvt===1?(e="flex-start",r="flex-start"):this.gvt===2?(e="center",r="flex-start"):this.gvt===3?(e="flex-end",r="flex-start"):this.gvt===4?(e="flex-start",r="center"):this.gvt===6?(e="flex-end",r="center"):this.gvt===7?(e="flex-start",r="flex-end"):this.gvt===8?(e="center",r="flex-end"):this.gvt===9?(e="flex-end",r="flex-end"):(e="center",r="center"),t.alignItems=r,t.justifyContent=e,t.overflow="visible",t}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim,this.position=this.mob.position??this.position,this.embedded=this.mob.embedded??this.embedded}},oi=class{gap;dir;wrap;jc;ai;scroll;constructor(t){t??={},this.gap=t.gap??0,this.dir=t.dir??"row",this.wrap=t.wrap??"nowrap",this.jc=t.jc??"flex-start",this.ai=t.ai??"flex-start",this.scroll=t.scroll}},ms=class{of;disp;pos;top;bottom;left;right;zIndex;constructor(t){t??={},this.of=t.of,this.disp=t.disp,this.pos=t.pos,this.top=t.top,this.bottom=t.bottom,this.left=t.left,this.right=t.right,this.zIndex=t.zIndex}},ds=class{w;h;maxW;maxH;minW;minH;constructor(t){t??={},this.w=t.w??"100%",this.h=t.h??"auto",this.maxW=t.maxW,this.maxH=t.maxH,this.minW=t.minW,this.minH=t.minH}},hs=class{size;bg;br;spc;typo;lout;flex;constructor(t){t??={},this.spc=new Nr(t.spc),t.size&&(this.size=new ds(t.size)),t.bg&&(this.bg=new nn(t.bg)),t.br&&(this.br=new on(t.br)),t.typo&&(this.typo=new it(t.typo)),t.lout&&(this.lout=new ms(t.lout)),t.flex&&(this.flex=new oi(t.flex))}},si=class{sm;lg;constructor(t){t??={},this.sm=new hs(t.sm),this.lg=new hs(t.lg)}},ct=class{t;style;hide;when;clc;constructor(t,e){e??={},this.t=t,this.style=new si(e.style),this.hide=e.hide,e.when?.op&&(this.when=e.when),e.clc&&(this.clc=e.clc)}get stringType(){return Le[this.t]}},ze=class extends ct{text;constructor(t,e){t?.style?.lg?.typo?.s&&delete t.style.lg.typo.s,t?.style?.sm?.typo?.s&&delete t.style.sm.typo.s,super(e??2,t),t??={},this.text=t.text}},ln=class extends ze{constructor(t,e){super(t,e??3)}},ai=class extends ct{value;constructor(t){super(6,t),t??={},this.value=t.value}},ci=class extends ze{constructor(t=15,e){super(e,t)}},Hp=Xt(tn()),el=class{enabled;type;color;constructor(t){t??={},this.enabled=t.enabled,this.type=t.type,this.color=new We(t.color)}},tl=class{size;enabled;color;constructor(t){t??={},this.enabled=t.enabled,this.size=t.size,this.color=new We(t.color)}},so=class{navigation;pagination;autoplay;maxInRow;gap;slidesPerView;constructor(t){t??={},this.navigation=new tl(t.navigation),this.pagination=new el(t.pagination),this.autoplay=t.autoplay,this.slidesPerView=t.slidesPerView??1,this.maxInRow=t.maxInRow??t.slidesPerView??4,this.gap=t.gap??0}},gs=class extends ct{conf;slide;formData;values;allowedTypes;constructor(t){super(62,t),t&&this.update(t)}update(t){t??={},this.slide=Ot.getParsedElement(t.slide),this.formData=t.formData,this.values=t.values,this.conf=new so(t.conf),this.allowedTypes=t.allowedTypes}},ys=class extends ze{gap;timer;timerType;horizontal;lblPos;show;constructor(t){t??={},super(t,61),this.gap=t.gap,this.timerType=t.type,this.timer=new Zn(t.timer),this.show=t.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=t.horizontal,this.lblPos=t.lblPos}},Kr=class extends ct{elems;constructor(t){super(4,t),this.update(t)}update(t){t??={},this.elems??=[],t.elems?.forEach(e=>{let r=Ot.getParsedElement(e);r&&this.elems.push(r)})}},un=class extends ct{src;sm;lg;constructor(t,e){super(e??1,t),t&&this.update(t)}update(t){this.src=t.src,this.sm=t.sm,this.lg=t.lg}},Ot=class wd{static getParsedElements(e){let r=[];return e?.forEach(n=>{let i=wd.getParsedElement(n);i&&r.push(i)}),r}static getParsedElement(e){switch(e.t){case 2:return new ze(e);case 3:return new ln(e);case 6:return new ai(e);case 11:return new vs(e);case 12:return new hr(e);case 61:return new ys(e);case 4:return new Kr(e);case 1:return new un(e);case 13:return new un(e,13);case 14:return new ze(e,14);case 15:case 16:return new ci(e.t,e);case 18:return new ln(e,18);case 62:return new gs(e);default:Hp.default.error("Unknown element type",e.t);return}}static parseAlignmentToJustifyContent(e){switch(e){case 1:return"center";case 2:return"flex-end";case 0:return"flex-start";default:return"flex-start"}}},hr=class extends ct{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(t){if(t??={},super(12,t),this.show=t.show,this.elems=Ot.getParsedElements(t.elems),this.noLinks=t.noLinks,!this.elems.length){t.cBox&&this.elems.push(new ai(t.cBox)),this.elems.push(new un(t.img,13));let e=new ze(t.title,14);e.hide=!t.show?.title,e.text="{{ product.name }}",this.elems.push(e);let r=new ze(t.price);r.text="{{ product.price }}",r.hide=!t.show?.price;let n=new ze(t.compareAt);n.text="{{ product.compare_price }}",n.hide=!t.show?.price,t.compareAt||(n.style=new si(r.style),n.style.lg.typo=new it(Z(b({},n.style.lg.typo),{td:"line-through"})),n.style.sm.typo=new it(Z(b({},n.style.sm.typo),{td:"line-through"})));let i=new Kr({style:{lg:{spc:{mb:10},flex:{dir:"row",gap:10,ai:"center",jc:Ot.parseAlignmentToJustifyContent(r.style.lg.typo?.ta)}}}});i.elems.push(n),i.elems.push(r),this.elems.push(i);let s=new ci(15,t.variantDD);if(s.hide=!t.show?.variantDD,this.elems.push(s),t.btn){let o=new ln(t.btn,18);o.hide=!t.show?.btn,this.elems.push(o)}}t.symbol&&(this.symbol=new ze(t.symbol))}},vs=class extends ct{conf;prod;constructor(t){super(11,t),t??={},this.conf=new rl(t.conf),this.prod=new hr(t.prod)}},_s=class extends so{disp;maxItems;constructor(t){t??={},super(t),this.disp=t.disp,this.maxItems=t.maxItems}},rl=class{lg;sm;constructor(t){t??={},this.lg=new _s(t.lg),this.sm=new _s(t.sm)}},Es=class extends Kr{constructor(t){super(t)}},li=class{cont;elems=[];constructor(t){t=t??{},this.cont=new Es(t.cont),t.elems?.forEach(e=>{this.addRawElement(e)})}addRawElement(t){let e=Ot.getParsedElement(t);return e&&this.elems.push(e),e}},nl=class{minValue;rewardType;label;reachingText;reachedText;discount;items;calculatedAlignment;constructor(t){this.minValue=t.minValue,this.rewardType=t.rewardType,this.label=t.label,this.reachingText=t.reachingText,this.reachedText=t.reachedText,this.discount=t.discount,this.items=t.items?.map(e=>new bt(e))}},Ss=class{layout;milestones;constructor(t){this.layout=t.layout??Ic.ICONS,this.milestones=t.milestones?.map(e=>new nl(e))??[]}},bs=class{applyDiscountOnMinimum;constructor(t){this.applyDiscountOnMinimum=t.applyDiscountOnMinimum}},il=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(t){this.shortID=t.shortID,this.contentType=t.contentType,this.engagementID=t.engagementID,this.delay=t.delay??0,this.redirectBehaviour=t.redirectBehaviour,this.onsiteDeliveryType=t.onsiteDeliveryType,this.objective=t.objective}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===zi.EXCLUSION}isABTesting(){return this.contentType===zi.ABTESTING}isSingleContent(){return this.contentType===zi.SINGLE}},Pt=class Ed extends il{static SWIPER_ELEMENTS=new Set([11,62]);nudgeID;contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;bundleConfig;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;discountData=Qt({});constructor(e){super(e),this.id=e.id,this.nudgeID=e.nudgeID,this.currency=fe.get().currencyCode??"USD",this.contentID=e.contentID,this.variation=e.variation,e.widget&&(this.widget=new li(e.widget)),this.previewType=e.previewType,this.occurred=e.occurred??new Date,this.props=e.props,this.embeddedItems=e.embeddedItems?.map(r=>new bt(r)),this.items=e.items?.map(r=>new wt(r))??[],this.nonMutableItems=e.items?.map(r=>new wt(r))??[],this.collections=e.collections?.map(r=>new ss(r))??[],this.discount=e.discount,this.placement=e.placement,this.customerData=e.customerData,this.ian=e.ian?this.processPopup(e.ian):void 0,this.promotionType=e.promotionType,this.manipulation=new as(e.manipulation),this.contentSource=e.contentSource,this.klaviyoFormID=e.klaviyoFormID,this.hasMultiplePlacement=e.hasMultiplePlacement,this.skipSubscribedItems=e.skipSubscribedItems,e.progressBarConfig&&(this.progressBarConfig=new Ss(e.progressBarConfig)),e.bundleConfig&&(this.bundleConfig=new bs(e.bundleConfig)),e.bundleFrom&&(this.bundleFrom=new wt(e.bundleFrom))}shouldDelay(){return this.delay>0}sentryContext(){return{id:this.id,shortID:this.shortID,currency:this.currency,contentType:this.contentType,objective:this.objective,onsiteDeliveryType:this.onsiteDeliveryType,engagementID:this.engagementID,contentID:this.contentID,nudgeID:this.nudgeID,variation:this.variation}}getDelaySeconds(){let e=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-e}isBundle(){return this.objective===lr.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===Yi.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===Yi.PAGE_EMBED}isProgressBar(){return this.objective===lr.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===lr.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===lr.CART_RECOVERY}isProductPromotion(){return this.objective===lr.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isBYOB(){return this.objective===lr.BYOB}isShoppableVideo(){return this.objective===lr.SHOPPABLE_VIDEO}processPopup(e){let r=JSON.stringify(e),n=this.items[0],i={},s={};if(n){let u=n.selectedOrFirstVariant.value;i={name:n.name,id:n.mID,link:n.link,vID:u.mID,image:n.variantImage,price:se.formatCurrency(u.price.d),comparePrice:se.formatCurrency(u.price.cmp),quantity:n.quantity},s={quantity:u.quantity}}let o={productCount:ge.getCurrent().item_count},c=Zt.render(r,{product:i,variant:s,cart:o,discount:this.discount,customer:this.customerData});return n&&(c=c.replace(new RegExp(A.PLACEHOLDER_IMAGE,"gi"),n.variantImage??n.imageURL)),new fs(JSON.parse(c))}calculateDiscountData(e,r){let n=jn.sum(e,s=>s.selectedOrFirstVariant.value.price.d),i={actualPrice:n,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!e?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(i);return}if([ur.UNIQUE_FLAT_ITEMS,ur.STATIC].includes(this.discount.type)&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100;else if(this.discount.type===ur.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)i.discountAmount=i.actualPrice-this.discount.values[0],i.discountPercentage=i.discountAmount/i.actualPrice*100;else if(this.discount.type===ur.UNIQUE_CHEAPEST_ITEM_FREE){e.sort((o,c)=>c.selectedOrFirstVariant.value.price.d-o.selectedOrFirstVariant.value.price.d);let s=e[e.length-1];s.selectedOrFirstVariant.value.price.effective=0,i.discountAmount=s.selectedOrFirstVariant.value.price.d,i.discountPercentage=i.discountAmount/i.actualPrice*100}i.discountedPrice=i.actualPrice-i.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(i)}getPrivateAttributesForLineItem(){return je.get().skipItemAttribute?{_via:"Cooee",[A.CAMPAIGN_ATTRIBUTE]:this.shortID,_letscooee_content:this.contentID}:{}}isBundleDiscount(){return[ur.UNIQUE_FIXED_ITEMS,ur.UNIQUE_FLAT_ITEMS].includes(this.discount.type)}isBundleOnCartDrawer(){return this.onsiteDeliveryType===Yi.CART_EMBED&&this.objective===lr.BUNDLE_AND_UPSELL}hasSwiperElement(){let e=this.widget?.elems.find(n=>Ed.SWIPER_ELEMENTS.has(n.t));if(!e)return!1;if(e.t===62)return!0;let r=Nt.get().isMobile()?"sm":"lg";return e.conf[r].disp===2}toString(){return`Engagement(id=${this.shortID})`}formatCurrencyAndNumber(e){if(!e)return{};let r={discountPercentage:se.formatNumber(e.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice"].map(n=>{r[n]=se.formatCurrency(e[n])}),r}};function qh(t,e){return e={exports:{}},t(e,e.exports),e.exports}var Kh=Zh,Jh=tg,Xh=ig,yr=[],Ht=[],Qh=typeof Uint8Array<"u"?Uint8Array:Array,ol="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pn=0,$p=ol.length;pn<$p;++pn)yr[pn]=ol[pn],Ht[ol.charCodeAt(pn)]=pn;var pn,$p;Ht[45]=62;Ht[95]=63;function nf(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Zh(t){var e=nf(t),r=e[0],n=e[1];return(r+n)*3/4-n}function eg(t,e,r){return(e+r)*3/4-r}function tg(t){var e,r=nf(t),n=r[0],i=r[1],s=new Qh(eg(t,n,i)),o=0,c=i>0?n-4:n,u;for(u=0;u<c;u+=4)e=Ht[t.charCodeAt(u)]<<18|Ht[t.charCodeAt(u+1)]<<12|Ht[t.charCodeAt(u+2)]<<6|Ht[t.charCodeAt(u+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Ht[t.charCodeAt(u)]<<2|Ht[t.charCodeAt(u+1)]>>4,s[o++]=e&255),i===1&&(e=Ht[t.charCodeAt(u)]<<10|Ht[t.charCodeAt(u+1)]<<4|Ht[t.charCodeAt(u+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function rg(t){return yr[t>>18&63]+yr[t>>12&63]+yr[t>>6&63]+yr[t&63]}function ng(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(rg(n));return i.join("")}function ig(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,c=r-n;o<c;o+=s)i.push(ng(t,o,o+s>c?c:o+s));return n===1?(e=t[r-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}var sl={byteLength:Kh,toByteArray:Jh,fromByteArray:Xh},og=function(t,e,r,n,i){var s,o,c=i*8-n-1,u=(1<<c)-1,f=u>>1,g=-7,h=r?i-1:0,v=r?-1:1,_=t[e+h];for(h+=v,s=_&(1<<-g)-1,_>>=-g,g+=c;g>0;s=s*256+t[e+h],h+=v,g-=8);for(o=s&(1<<-g)-1,s>>=-g,g+=n;g>0;o=o*256+t[e+h],h+=v,g-=8);if(s===0)s=1-f;else{if(s===u)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-f}return(_?-1:1)*o*Math.pow(2,s-n)},sg=function(t,e,r,n,i,s){var o,c,u,f=s*8-i-1,g=(1<<f)-1,h=g>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:s-1,m=n?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,o=g):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?e+=v/u:e+=v*Math.pow(2,1-h),e*u>=2&&(o++,u/=2),o+h>=g?(c=0,o=g):o+h>=1?(c=(e*u-1)*Math.pow(2,i),o=o+h):(c=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+_]=c&255,_+=m,c/=256,i-=8);for(o=o<<i|c,f+=i;f>0;t[r+_]=o&255,_+=m,o/=256,f-=8);t[r+_-m]|=y*128},ui={read:og,write:sg},Ts=qh(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=O,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var a=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(a,l),a.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(a){if(a>n)throw new RangeError('The value "'+a+'" is invalid for option "size"');var l=new Uint8Array(a);return Object.setPrototypeOf(l,o.prototype),l}function o(a,l,p){if(typeof a=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(a)}return c(a,l,p)}o.poolSize=8192;function c(a,l,p){if(typeof a=="string")return h(a,l);if(ArrayBuffer.isView(a))return _(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a));if(Pe(a,ArrayBuffer)||a&&Pe(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Pe(a,SharedArrayBuffer)||a&&Pe(a.buffer,SharedArrayBuffer)))return m(a,l,p);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var I=a.valueOf&&a.valueOf();if(I!=null&&I!==a)return o.from(I,l,p);var N=y(a);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return o.from(a[Symbol.toPrimitive]("string"),l,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a))}o.from=function(a,l,p){return c(a,l,p)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function u(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function f(a,l,p){return u(a),a<=0?s(a):l!==void 0?typeof p=="string"?s(a).fill(l,p):s(a).fill(l):s(a)}o.alloc=function(a,l,p){return f(a,l,p)};function g(a){return u(a),s(a<0?0:T(a)|0)}o.allocUnsafe=function(a){return g(a)},o.allocUnsafeSlow=function(a){return g(a)};function h(a,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);var p=H(a,l)|0,I=s(p),N=I.write(a,l);return N!==p&&(I=I.slice(0,N)),I}function v(a){for(var l=a.length<0?0:T(a.length)|0,p=s(l),I=0;I<l;I+=1)p[I]=a[I]&255;return p}function _(a){if(Pe(a,Uint8Array)){var l=new Uint8Array(a);return m(l.buffer,l.byteOffset,l.byteLength)}return v(a)}function m(a,l,p){if(l<0||a.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<l+(p||0))throw new RangeError('"length" is outside of buffer bounds');var I;return l===void 0&&p===void 0?I=new Uint8Array(a):p===void 0?I=new Uint8Array(a,l):I=new Uint8Array(a,l,p),Object.setPrototypeOf(I,o.prototype),I}function y(a){if(o.isBuffer(a)){var l=T(a.length)|0,p=s(l);return p.length===0||a.copy(p,0,0,l),p}if(a.length!==void 0)return typeof a.length!="number"||$r(a.length)?s(0):v(a);if(a.type==="Buffer"&&Array.isArray(a.data))return v(a.data)}function T(a){if(a>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return a|0}function O(a){return+a!=a&&(a=0),o.alloc(+a)}o.isBuffer=function(a){return a!=null&&a._isBuffer===!0&&a!==o.prototype},o.compare=function(a,l){if(Pe(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),Pe(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(a)||!o.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===l)return 0;for(var p=a.length,I=l.length,N=0,L=Math.min(p,I);N<L;++N)if(a[N]!==l[N]){p=a[N],I=l[N];break}return p<I?-1:I<p?1:0},o.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(a,l){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(a.length===0)return o.alloc(0);var p;if(l===void 0)for(l=0,p=0;p<a.length;++p)l+=a[p].length;var I=o.allocUnsafe(l),N=0;for(p=0;p<a.length;++p){var L=a[p];if(Pe(L,Uint8Array))N+L.length>I.length?o.from(L).copy(I,N):Uint8Array.prototype.set.call(I,L,N);else if(o.isBuffer(L))L.copy(I,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=L.length}return I};function H(a,l){if(o.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||Pe(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(a));var p=a.length,I=arguments.length>2&&arguments[2]===!0;if(!I&&p===0)return 0;for(var N=!1;;)switch(l){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return kn(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return ji(a).length;default:if(N)return I?-1:kn(a).length;l=(""+l).toLowerCase(),N=!0}}o.byteLength=H;function R(a,l,p){var I=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,l>>>=0,p<=l))return"";for(a||(a="utf8");;)switch(a){case"hex":return Te(this,l,p);case"utf8":case"utf-8":return me(this,l,p);case"ascii":return be(this,l,p);case"latin1":case"binary":return Bt(this,l,p);case"base64":return Jt(this,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,l,p);default:if(I)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),I=!0}}o.prototype._isBuffer=!0;function k(a,l,p){var I=a[l];a[l]=a[p],a[p]=I}o.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var l=0;l<a;l+=2)k(this,l,l+1);return this},o.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var l=0;l<a;l+=4)k(this,l,l+3),k(this,l+1,l+2);return this},o.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var l=0;l<a;l+=8)k(this,l,l+7),k(this,l+1,l+6),k(this,l+2,l+5),k(this,l+3,l+4);return this},o.prototype.toString=function(){var a=this.length;return a===0?"":arguments.length===0?me(this,0,a):R.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(a){if(!o.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:o.compare(this,a)===0},o.prototype.inspect=function(){var a="",l=e.INSPECT_MAX_BYTES;return a=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(a+=" ... "),"<Buffer "+a+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(a,l,p,I,N){if(Pe(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),!o.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(a));if(l===void 0&&(l=0),p===void 0&&(p=a?a.length:0),I===void 0&&(I=0),N===void 0&&(N=this.length),l<0||p>a.length||I<0||N>this.length)throw new RangeError("out of range index");if(I>=N&&l>=p)return 0;if(I>=N)return-1;if(l>=p)return 1;if(l>>>=0,p>>>=0,I>>>=0,N>>>=0,this===a)return 0;for(var L=N-I,W=p-l,te=Math.min(L,W),St=this.slice(I,N),Ct=a.slice(l,p),le=0;le<te;++le)if(St[le]!==Ct[le]){L=St[le],W=Ct[le];break}return L<W?-1:W<L?1:0};function V(a,l,p,I,N){if(a.length===0)return-1;if(typeof p=="string"?(I=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,$r(p)&&(p=N?0:a.length-1),p<0&&(p=a.length+p),p>=a.length){if(N)return-1;p=a.length-1}else if(p<0)if(N)p=0;else return-1;if(typeof l=="string"&&(l=o.from(l,I)),o.isBuffer(l))return l.length===0?-1:Ut(a,l,p,I,N);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(a,l,p):Uint8Array.prototype.lastIndexOf.call(a,l,p):Ut(a,[l],p,I,N);throw new TypeError("val must be string, number or Buffer")}function Ut(a,l,p,I,N){var L=1,W=a.length,te=l.length;if(I!==void 0&&(I=String(I).toLowerCase(),I==="ucs2"||I==="ucs-2"||I==="utf16le"||I==="utf-16le")){if(a.length<2||l.length<2)return-1;L=2,W/=2,te/=2,p/=2}function St(X,ie){return L===1?X[ie]:X.readUInt16BE(ie*L)}var Ct;if(N){var le=-1;for(Ct=p;Ct<W;Ct++)if(St(a,Ct)===St(l,le===-1?0:Ct-le)){if(le===-1&&(le=Ct),Ct-le+1===te)return le*L}else le!==-1&&(Ct-=Ct-le),le=-1}else for(p+te>W&&(p=W-te),Ct=p;Ct>=0;Ct--){for(var z=!0,ft=0;ft<te;ft++)if(St(a,Ct+ft)!==St(l,ft)){z=!1;break}if(z)return Ct}return-1}o.prototype.includes=function(a,l,p){return this.indexOf(a,l,p)!==-1},o.prototype.indexOf=function(a,l,p){return V(this,a,l,p,!0)},o.prototype.lastIndexOf=function(a,l,p){return V(this,a,l,p,!1)};function de(a,l,p,I){p=Number(p)||0;var N=a.length-p;I?(I=Number(I),I>N&&(I=N)):I=N;var L=l.length;I>L/2&&(I=L/2);for(var W=0;W<I;++W){var te=parseInt(l.substr(W*2,2),16);if($r(te))return W;a[p+W]=te}return W}function j(a,l,p,I){return Mn(kn(l,a.length-p),a,p,I)}function ot(a,l,p,I){return Mn(Hi(l),a,p,I)}function Y(a,l,p,I){return Mn(ji(l),a,p,I)}function st(a,l,p,I){return Mn(Wi(l,a.length-p),a,p,I)}o.prototype.write=function(a,l,p,I){if(l===void 0)I="utf8",p=this.length,l=0;else if(p===void 0&&typeof l=="string")I=l,p=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(p)?(p=p>>>0,I===void 0&&(I="utf8")):(I=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var N=this.length-l;if((p===void 0||p>N)&&(p=N),a.length>0&&(p<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");for(var L=!1;;)switch(I){case"hex":return de(this,a,l,p);case"utf8":case"utf-8":return j(this,a,l,p);case"ascii":case"latin1":case"binary":return ot(this,a,l,p);case"base64":return Y(this,a,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return st(this,a,l,p);default:if(L)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),L=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Jt(a,l,p){return l===0&&p===a.length?sl.fromByteArray(a):sl.fromByteArray(a.slice(l,p))}function me(a,l,p){p=Math.min(a.length,p);for(var I=[],N=l;N<p;){var L=a[N],W=null,te=L>239?4:L>223?3:L>191?2:1;if(N+te<=p){var St,Ct,le,z;switch(te){case 1:L<128&&(W=L);break;case 2:St=a[N+1],(St&192)===128&&(z=(L&31)<<6|St&63,z>127&&(W=z));break;case 3:St=a[N+1],Ct=a[N+2],(St&192)===128&&(Ct&192)===128&&(z=(L&15)<<12|(St&63)<<6|Ct&63,z>2047&&(z<55296||z>57343)&&(W=z));break;case 4:St=a[N+1],Ct=a[N+2],le=a[N+3],(St&192)===128&&(Ct&192)===128&&(le&192)===128&&(z=(L&15)<<18|(St&63)<<12|(Ct&63)<<6|le&63,z>65535&&z<1114112&&(W=z))}}W===null?(W=65533,te=1):W>65535&&(W-=65536,I.push(W>>>10&1023|55296),W=56320|W&1023),I.push(W),N+=te}return Ce(I)}var pe=4096;function Ce(a){var l=a.length;if(l<=pe)return String.fromCharCode.apply(String,a);for(var p="",I=0;I<l;)p+=String.fromCharCode.apply(String,a.slice(I,I+=pe));return p}function be(a,l,p){var I="";p=Math.min(a.length,p);for(var N=l;N<p;++N)I+=String.fromCharCode(a[N]&127);return I}function Bt(a,l,p){var I="";p=Math.min(a.length,p);for(var N=l;N<p;++N)I+=String.fromCharCode(a[N]);return I}function Te(a,l,p){var I=a.length;(!l||l<0)&&(l=0),(!p||p<0||p>I)&&(p=I);for(var N="",L=l;L<p;++L)N+=rs[a[L]];return N}function pt(a,l,p){for(var I=a.slice(l,p),N="",L=0;L<I.length-1;L+=2)N+=String.fromCharCode(I[L]+I[L+1]*256);return N}o.prototype.slice=function(a,l){var p=this.length;a=~~a,l=l===void 0?p:~~l,a<0?(a+=p,a<0&&(a=0)):a>p&&(a=p),l<0?(l+=p,l<0&&(l=0)):l>p&&(l=p),l<a&&(l=a);var I=this.subarray(a,l);return Object.setPrototypeOf(I,o.prototype),I};function Q(a,l,p){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+l>p)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,l,p){a=a>>>0,l=l>>>0,p||Q(a,l,this.length);for(var I=this[a],N=1,L=0;++L<l&&(N*=256);)I+=this[a+L]*N;return I},o.prototype.readUintBE=o.prototype.readUIntBE=function(a,l,p){a=a>>>0,l=l>>>0,p||Q(a,l,this.length);for(var I=this[a+--l],N=1;l>0&&(N*=256);)I+=this[a+--l]*N;return I},o.prototype.readUint8=o.prototype.readUInt8=function(a,l){return a=a>>>0,l||Q(a,1,this.length),this[a]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(a,l){return a=a>>>0,l||Q(a,2,this.length),this[a]|this[a+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(a,l){return a=a>>>0,l||Q(a,2,this.length),this[a]<<8|this[a+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},o.prototype.readIntLE=function(a,l,p){a=a>>>0,l=l>>>0,p||Q(a,l,this.length);for(var I=this[a],N=1,L=0;++L<l&&(N*=256);)I+=this[a+L]*N;return N*=128,I>=N&&(I-=Math.pow(2,8*l)),I},o.prototype.readIntBE=function(a,l,p){a=a>>>0,l=l>>>0,p||Q(a,l,this.length);for(var I=l,N=1,L=this[a+--I];I>0&&(N*=256);)L+=this[a+--I]*N;return N*=128,L>=N&&(L-=Math.pow(2,8*l)),L},o.prototype.readInt8=function(a,l){return a=a>>>0,l||Q(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},o.prototype.readInt16LE=function(a,l){a=a>>>0,l||Q(a,2,this.length);var p=this[a]|this[a+1]<<8;return p&32768?p|4294901760:p},o.prototype.readInt16BE=function(a,l){a=a>>>0,l||Q(a,2,this.length);var p=this[a+1]|this[a]<<8;return p&32768?p|4294901760:p},o.prototype.readInt32LE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},o.prototype.readInt32BE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},o.prototype.readFloatLE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),ui.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),ui.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,l){return a=a>>>0,l||Q(a,8,this.length),ui.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,l){return a=a>>>0,l||Q(a,8,this.length),ui.read(this,a,!1,52,8)};function we(a,l,p,I,N,L){if(!o.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>N||l<L)throw new RangeError('"value" argument is out of bounds');if(p+I>a.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,l,p,I){if(a=+a,l=l>>>0,p=p>>>0,!I){var N=Math.pow(2,8*p)-1;we(this,a,l,p,N,0)}var L=1,W=0;for(this[l]=a&255;++W<p&&(L*=256);)this[l+W]=a/L&255;return l+p},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,l,p,I){if(a=+a,l=l>>>0,p=p>>>0,!I){var N=Math.pow(2,8*p)-1;we(this,a,l,p,N,0)}var L=p-1,W=1;for(this[l+L]=a&255;--L>=0&&(W*=256);)this[l+L]=a/W&255;return l+p},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,1,255,0),this[l]=a&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,2,65535,0),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,2,65535,0),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,4,4294967295,0),this[l+3]=a>>>24,this[l+2]=a>>>16,this[l+1]=a>>>8,this[l]=a&255,l+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,4,4294967295,0),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4},o.prototype.writeIntLE=function(a,l,p,I){if(a=+a,l=l>>>0,!I){var N=Math.pow(2,8*p-1);we(this,a,l,p,N-1,-N)}var L=0,W=1,te=0;for(this[l]=a&255;++L<p&&(W*=256);)a<0&&te===0&&this[l+L-1]!==0&&(te=1),this[l+L]=(a/W>>0)-te&255;return l+p},o.prototype.writeIntBE=function(a,l,p,I){if(a=+a,l=l>>>0,!I){var N=Math.pow(2,8*p-1);we(this,a,l,p,N-1,-N)}var L=p-1,W=1,te=0;for(this[l+L]=a&255;--L>=0&&(W*=256);)a<0&&te===0&&this[l+L+1]!==0&&(te=1),this[l+L]=(a/W>>0)-te&255;return l+p},o.prototype.writeInt8=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,1,127,-128),a<0&&(a=255+a+1),this[l]=a&255,l+1},o.prototype.writeInt16LE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,2,32767,-32768),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeInt16BE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,2,32767,-32768),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeInt32LE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,4,2147483647,-2147483648),this[l]=a&255,this[l+1]=a>>>8,this[l+2]=a>>>16,this[l+3]=a>>>24,l+4},o.prototype.writeInt32BE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4};function ar(a,l,p,I,N,L){if(p+I>a.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function jr(a,l,p,I,N){return l=+l,p=p>>>0,N||ar(a,l,p,4),ui.write(a,l,p,I,23,4),p+4}o.prototype.writeFloatLE=function(a,l,p){return jr(this,a,l,!0,p)},o.prototype.writeFloatBE=function(a,l,p){return jr(this,a,l,!1,p)};function ke(a,l,p,I,N){return l=+l,p=p>>>0,N||ar(a,l,p,8),ui.write(a,l,p,I,52,8),p+8}o.prototype.writeDoubleLE=function(a,l,p){return ke(this,a,l,!0,p)},o.prototype.writeDoubleBE=function(a,l,p){return ke(this,a,l,!1,p)},o.prototype.copy=function(a,l,p,I){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(p||(p=0),!I&&I!==0&&(I=this.length),l>=a.length&&(l=a.length),l||(l=0),I>0&&I<p&&(I=p),I===p||a.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),a.length-l<I-p&&(I=a.length-l+p);var N=I-p;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,p,I):Uint8Array.prototype.set.call(a,this.subarray(p,I),l),N},o.prototype.fill=function(a,l,p,I){if(typeof a=="string"){if(typeof l=="string"?(I=l,l=0,p=this.length):typeof p=="string"&&(I=p,p=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!o.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(a.length===1){var N=a.charCodeAt(0);(I==="utf8"&&N<128||I==="latin1")&&(a=N)}}else typeof a=="number"?a=a&255:typeof a=="boolean"&&(a=Number(a));if(l<0||this.length<l||this.length<p)throw new RangeError("Out of range index");if(p<=l)return this;l=l>>>0,p=p===void 0?this.length:p>>>0,a||(a=0);var L;if(typeof a=="number")for(L=l;L<p;++L)this[L]=a;else{var W=o.isBuffer(a)?a:o.from(a,I),te=W.length;if(te===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(L=0;L<p-l;++L)this[L+l]=W[L%te]}return this};var en=/[^+/0-9A-Za-z-_]/g;function Hn(a){if(a=a.split("=")[0],a=a.trim().replace(en,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function kn(a,l){l=l||1/0;for(var p,I=a.length,N=null,L=[],W=0;W<I;++W){if(p=a.charCodeAt(W),p>55295&&p<57344){if(!N){if(p>56319){(l-=3)>-1&&L.push(239,191,189);continue}else if(W+1===I){(l-=3)>-1&&L.push(239,191,189);continue}N=p;continue}if(p<56320){(l-=3)>-1&&L.push(239,191,189),N=p;continue}p=(N-55296<<10|p-56320)+65536}else N&&(l-=3)>-1&&L.push(239,191,189);if(N=null,p<128){if((l-=1)<0)break;L.push(p)}else if(p<2048){if((l-=2)<0)break;L.push(p>>6|192,p&63|128)}else if(p<65536){if((l-=3)<0)break;L.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((l-=4)<0)break;L.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return L}function Hi(a){for(var l=[],p=0;p<a.length;++p)l.push(a.charCodeAt(p)&255);return l}function Wi(a,l){for(var p,I,N,L=[],W=0;W<a.length&&!((l-=2)<0);++W)p=a.charCodeAt(W),I=p>>8,N=p%256,L.push(N),L.push(I);return L}function ji(a){return sl.toByteArray(Hn(a))}function Mn(a,l,p,I){for(var N=0;N<I&&!(N+p>=l.length||N>=a.length);++N)l[N+p]=a[N];return N}function Pe(a,l){return a instanceof l||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===l.name}function $r(a){return a!==a}var rs=function(){for(var a="0123456789abcdef",l=new Array(256),p=0;p<16;++p)for(var I=p*16,N=0;N<16;++N)l[I+N]=a[p]+a[N];return l}()}),Ee=Ts.Buffer;Ts.SlowBuffer;Ts.INSPECT_MAX_BYTES;Ts.kMaxLength;var pl=function(t,e){return pl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},pl(t,e)};function xs(t,e){pl(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var mn=function(t){xs(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e}(Error),Fe=function(t){xs(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e}(TypeError);function ws(t){return t&&t.Math==Math&&t}function of(){return ws(typeof globalThis=="object"&&globalThis)||ws(typeof window=="object"&&window)||ws(typeof self=="object"&&self)||ws(typeof global=="object"&&global)||Function("return this")()}function ag(){var t=of();return typeof t.navigator=="object"&&t.navigator.product==="ReactNative"}var cg=function(t){var e=ag()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(e);for(var r=Ee.alloc(t),n=0;n<t;++n)r[n]=Math.floor(Math.random()*256);return r},lg=function(){{if(typeof window<"u"){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(Ee.alloc(e))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(e){return global.crypto.getRandomValues(Ee.alloc(e))}:cg}},sf=lg();function ug(t){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(t))}function ml(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function pg(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function fg(t){return uo(t)&&Object.prototype.toString.call(t)==="[object Date]"}function uo(t){return typeof t=="object"&&t!==null}function Cs(t,e){var r=!1;function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return r||(console.warn(e),r=!0),t.apply(this,i)}return n}function Is(t){if(ArrayBuffer.isView(t))return Ee.from(t.buffer,t.byteOffset,t.byteLength);if(ug(t))return Ee.from(t);throw new Fe("Must use either Buffer or TypedArray")}var mg=/^(?:[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,af=function(t){return typeof t=="string"&&mg.test(t)},fl=function(t){if(!af(t))throw new Fe('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 Ee.from(e,"hex")},jp=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")},eI=Math.pow(2,63)-1,tI=-Math.pow(2,63),dg=Math.pow(2,53),hg=-Math.pow(2,53),cf=4,dn=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(e!=null&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer)&&!Array.isArray(e))throw new Fe("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??t.BSON_BINARY_SUBTYPE_DEFAULT,e==null?(this.buffer=Ee.alloc(t.BUFFER_SIZE),this.position=0):(typeof e=="string"?this.buffer=Ee.from(e,"binary"):Array.isArray(e)?this.buffer=Ee.from(e):this.buffer=Is(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if(typeof e=="string"&&e.length!==1)throw new Fe("only accepts single character String");if(typeof e!="number"&&e.length!==1)throw new Fe("only accepts single character Uint8Array or Array");var r;if(typeof e=="string"?r=e.charCodeAt(0):typeof e=="number"?r=e:r=e[0],r<0||r>255)throw new Fe("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=Ee.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},t.prototype.write=function(e,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+e.length){var n=Ee.alloc(this.buffer.length+e.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(e)?(this.buffer.set(Is(e),r),this.position=r+e.byteLength>this.position?r+e.length:this.position):typeof e=="string"&&(this.buffer.write(e,r,e.length,"binary"),this.position=r+e.length>this.position?r+e.length:this.position)},t.prototype.read=function(e,r){return r=r&&r>0?r:this.position,this.buffer.slice(e,e+r)},t.prototype.value=function(e){return e=!!e,e&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(e){return this.buffer.toString(e)},t.prototype.toExtendedJSON=function(e){e=e||{};var r=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return e.legacy?{$binary:r,$type:n.length===1?"0"+n:n}:{$binary:{base64:r,subType:n.length===1?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new Wp(this.buffer.slice(0,this.position));throw new mn('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(e,r){r=r||{};var n,i;if("$binary"in e?r.legacy&&typeof e.$binary=="string"&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,n=Ee.from(e.$binary,"base64")):typeof e.$binary!="string"&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=Ee.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,n=fl(e.$uuid)),!n)throw new Fe("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return i===cf?new Wp(n):new t(n,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t}();Object.defineProperty(dn.prototype,"_bsontype",{value:"Binary"});var al=16,Wp=function(t){xs(e,t);function e(r){var n=this,i,s;if(r==null)i=e.generate();else if(r instanceof e)i=Ee.from(r.buffer),s=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===al)i=Is(r);else if(typeof r=="string")i=fl(r);else throw new Fe("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return n=t.call(this,i,cf)||this,n.__id=s,n}return Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,e.cacheHexString&&(this.__id=jp(r))},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(r){if(r===void 0&&(r=!0),e.cacheHexString&&this.__id)return this.__id;var n=jp(this.id,r);return e.cacheHexString&&(this.__id=n),n},e.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(r){if(!r)return!1;if(r instanceof e)return r.id.equals(this.id);try{return new e(r).id.equals(this.id)}catch{return!1}},e.prototype.toBinary=function(){return new dn(this.id,dn.SUBTYPE_UUID)},e.generate=function(){var r=sf(al);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ee.from(r)},e.isValid=function(r){return r?r instanceof e?!0:typeof r=="string"?af(r):ml(r)?r.length!==al?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},e.createFromHexString=function(r){var n=fl(r);return new e(n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},e}(dn),Ds=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);this.code=e,this.scope=r}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},t}();Object.defineProperty(Ds.prototype,"_bsontype",{value:"Code"});function gg(t){return uo(t)&&t.$id!=null&&typeof t.$ref=="string"&&(t.$db==null||typeof t.$db=="string")}var co=function(){function t(e,r,n,i){if(!(this instanceof t))return new t(e,r,n,i);var s=e.split(".");s.length===2&&(n=s.shift(),e=s.shift()),this.collection=e,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(e.$db=this.db),e},t.prototype.toExtendedJSON=function(e){e=e||{};var r={$ref:this.collection,$id:this.oid};return e.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},t.fromExtendedJSON=function(e){var r=Object.assign({},e);return delete r.$ref,delete r.$id,delete r.$db,new t(e.$ref,e.$id,e.$db,r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t}();Object.defineProperty(co.prototype,"_bsontype",{value:"DBRef"});var Ft=void 0;try{Ft=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 Gp=65536,yg=1<<24,fi=Gp*Gp,lf=fi*fi,Vp=lf/2,zp={},Yp={},K=function(){function t(e,r,n){if(e===void 0&&(e=0),!(this instanceof t))return new t(e,r,n);typeof e=="bigint"?Object.assign(this,t.fromBigInt(e,!!r)):typeof e=="string"?Object.assign(this,t.fromString(e,!!r)):(this.low=e|0,this.high=r|0,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,r,n){return new t(e,r,n)},t.fromInt=function(e,r){var n,i,s;return r?(e>>>=0,(s=0<=e&&e<256)&&(i=Yp[e],i)?i:(n=t.fromBits(e,(e|0)<0?-1:0,!0),s&&(Yp[e]=n),n)):(e|=0,(s=-128<=e&&e<128)&&(i=zp[e],i)?i:(n=t.fromBits(e,e<0?-1:0,!1),s&&(zp[e]=n),n))},t.fromNumber=function(e,r){if(isNaN(e))return r?t.UZERO:t.ZERO;if(r){if(e<0)return t.UZERO;if(e>=lf)return t.MAX_UNSIGNED_VALUE}else{if(e<=-Vp)return t.MIN_VALUE;if(e+1>=Vp)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%fi|0,e/fi|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t.ZERO;if(typeof r=="number"?(n=r,r=!1):r=!!r,n=n||10,n<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return t.fromString(e.substring(1),r,n).neg();for(var s=t.fromNumber(Math.pow(n,8)),o=t.ZERO,c=0;c<e.length;c+=8){var u=Math.min(8,e.length-c),f=parseInt(e.substring(c,c+u),n);if(u<8){var g=t.fromNumber(Math.pow(n,u));o=o.mul(g).add(t.fromNumber(f))}else o=o.mul(s),o=o.add(t.fromNumber(f))}return o.unsigned=r,o},t.fromBytes=function(e,r,n){return n?t.fromBytesLE(e,r):t.fromBytesBE(e,r)},t.fromBytesLE=function(e,r){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)},t.fromBytesBE=function(e,r){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)},t.isLong=function(e){return uo(e)&&e.__isLong__===!0},t.fromValue=function(e,r){return typeof e=="number"?t.fromNumber(e,r):typeof e=="string"?t.fromString(e,r):t.fromBits(e.low,e.high,typeof r=="boolean"?r:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,s=this.low&65535,o=e.high>>>16,c=e.high&65535,u=e.low>>>16,f=e.low&65535,g=0,h=0,v=0,_=0;return _+=s+f,v+=_>>>16,_&=65535,v+=i+u,h+=v>>>16,v&=65535,h+=n+c,g+=h>>>16,h&=65535,g+=r+o,g&=65535,t.fromBits(v<<16|_,g<<16|h,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(e){return this.compare(e)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(Ft){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?Ft.div_u:Ft.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,Ft.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,i,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;s=t.UZERO}else{if(this.eq(t.MIN_VALUE)){if(e.eq(t.ONE)||e.eq(t.NEG_ONE))return t.MIN_VALUE;if(e.eq(t.MIN_VALUE))return t.ONE;var o=this.shr(1);return n=o.div(e).shl(1),n.eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(n)),s=n.add(i.div(e)),s)}else if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=t.ZERO}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var c=Math.ceil(Math.log(n)/Math.LN2),u=c<=48?1:Math.pow(2,c-48),f=t.fromNumber(n),g=f.mul(e);g.isNegative()||g.gt(i);)n-=u,f=t.fromNumber(n,this.unsigned),g=f.mul(e);f.isZero()&&(f=t.ONE),s=s.add(f),i=i.sub(g)}return s},t.prototype.div=function(e){return this.divide(e)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},t.prototype.eq=function(e){return this.equals(e)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(e&1<<r)===0;r--);return this.high!==0?r+33:r+1},t.prototype.greaterThan=function(e){return this.comp(e)>0},t.prototype.gt=function(e){return this.greaterThan(e)},t.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},t.prototype.gte=function(e){return this.greaterThanOrEqual(e)},t.prototype.ge=function(e){return this.greaterThanOrEqual(e)},t.prototype.isEven=function(){return(this.low&1)===0},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return(this.low&1)===1},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return this.high===0&&this.low===0},t.prototype.lessThan=function(e){return this.comp(e)<0},t.prototype.lt=function(e){return this.lessThan(e)},t.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},t.prototype.lte=function(e){return this.lessThanOrEqual(e)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),Ft){var r=(this.unsigned?Ft.rem_u:Ft.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,Ft.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)),Ft){var r=Ft.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,Ft.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,s=this.low>>>16,o=this.low&65535,c=e.high>>>16,u=e.high&65535,f=e.low>>>16,g=e.low&65535,h=0,v=0,_=0,m=0;return m+=o*g,_+=m>>>16,m&=65535,_+=s*g,v+=_>>>16,_&=65535,_+=o*f,v+=_>>>16,_&=65535,v+=i*g,h+=v>>>16,v&=65535,v+=s*f,h+=v>>>16,v&=65535,v+=o*u,h+=v>>>16,v&=65535,h+=n*g+i*f+s*u+o*c,h&=65535,t.fromBits(_<<16|m,h<<16|v,this.unsigned)},t.prototype.mul=function(e){return this.multiply(e)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(e){return!this.equals(e)},t.prototype.neq=function(e){return this.notEquals(e)},t.prototype.ne=function(e){return this.notEquals(e)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(e){return this.shiftLeft(e)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(e){return this.shiftRight(e)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),e&=63,e===0)return this;var r=this.high;if(e<32){var n=this.low;return t.fromBits(n>>>e|r<<32-e,r>>>e,this.unsigned)}else return e===32?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},t.prototype.shru=function(e){return this.shiftRightUnsigned(e)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(e){return this.subtract(e)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*fi+(this.low>>>0):this.high*fi+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},t.prototype.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(t.MIN_VALUE)){var r=t.fromNumber(e),n=this.div(r),i=n.mul(r).sub(this);return n.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=t.fromNumber(Math.pow(e,6),this.unsigned),o=this,c="";;){var u=o.div(s),f=o.sub(u.mul(s)).toInt()>>>0,g=f.toString(e);if(o=u,o.isZero())return g+c;for(;g.length<6;)g="0"+g;c=""+g+c}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(e){return this.lessThanOrEqual(e)},t.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,r){var n=t.fromString(e.$numberLong);return r&&r.relaxed?n.toNumber():n},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},t.TWO_PWR_24=t.fromInt(yg),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t}();Object.defineProperty(K.prototype,"__isLong__",{value:!0});Object.defineProperty(K.prototype,"_bsontype",{value:"Long"});var vg=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,_g=/^(\+|-)?(Infinity|inf)$/i,Eg=/^(\+|-)?NaN$/i,ao=6111,cl=-6176,qp=6176,Sg=34,ll=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Kp=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Jp=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),bg=/^([-+])?(\d+)?$/,wg=31,Xp=16383,Ig=30,Tg=31;function Qp(t){return!isNaN(parseInt(t,10))}function xg(t){var e=K.fromNumber(1e9),r=K.fromNumber(0);if(!t.parts[0]&&!t.parts[1]&&!t.parts[2]&&!t.parts[3])return{quotient:t,rem:r};for(var n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new K(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function Cg(t,e){if(!t&&!e)return{high:K.fromNumber(0),low:K.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new K(t.getLowBits(),0),i=e.shiftRightUnsigned(32),s=new K(e.getLowBits(),0),o=r.multiply(i),c=r.multiply(s),u=n.multiply(i),f=n.multiply(s);return o=o.add(c.shiftRightUnsigned(32)),c=new K(c.getLowBits(),0).add(u).add(f.shiftRightUnsigned(32)),o=o.add(c.shiftRightUnsigned(32)),f=c.shiftLeft(32).add(new K(f.getLowBits(),0)),{high:o,low:f}}function Dg(t,e){var r=t.high>>>0,n=e.high>>>0;if(r<n)return!0;if(r===n){var i=t.low>>>0,s=e.low>>>0;if(i<s)return!0}return!1}function pi(t,e){throw new Fe('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var dl=function(){function t(e){if(!(this instanceof t))return new t(e);if(typeof e=="string")this.bytes=t.fromString(e).bytes;else if(ml(e)){if(e.byteLength!==16)throw new Fe("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new Fe("Decimal128 must take a Buffer or string")}return t.fromString=function(e){var r=!1,n=!1,i=!1,s=0,o=0,c=0,u=0,f=0,g=[0],h=0,v=0,_=0,m=0,y=0,T=0,O=new K(0,0),H=new K(0,0),R=0,k=0;if(e.length>=7e3)throw new Fe(""+e+" not a valid Decimal128 string");var V=e.match(vg),Ut=e.match(_g),de=e.match(Eg);if(!V&&!Ut&&!de||e.length===0)throw new Fe(""+e+" not a valid Decimal128 string");if(V){var j=V[2],ot=V[4],Y=V[5],st=V[6];ot&&st===void 0&&pi(e,"missing exponent power"),ot&&j===void 0&&pi(e,"missing exponent base"),ot===void 0&&(Y||st)&&pi(e,"missing e before exponent")}if((e[k]==="+"||e[k]==="-")&&(r=e[k++]==="-"),!Qp(e[k])&&e[k]!=="."){if(e[k]==="i"||e[k]==="I")return new t(Ee.from(r?Kp:Jp));if(e[k]==="N")return new t(Ee.from(ll))}for(;Qp(e[k])||e[k]===".";){if(e[k]==="."){n&&pi(e,"contains multiple periods"),n=!0,k=k+1;continue}h<34&&(e[k]!=="0"||i)&&(i||(f=o),i=!0,g[v++]=parseInt(e[k],10),h=h+1),i&&(c=c+1),n&&(u=u+1),o=o+1,k=k+1}if(n&&!o)throw new Fe(""+e+" not a valid Decimal128 string");if(e[k]==="e"||e[k]==="E"){var Jt=e.substr(++k).match(bg);if(!Jt||!Jt[2])return new t(Ee.from(ll));y=parseInt(Jt[0],10),k=k+Jt[0].length}if(e[k])return new t(Ee.from(ll));if(_=0,!h)_=0,m=0,g[0]=0,c=1,h=1,s=0;else if(m=h-1,s=c,s!==1)for(;g[f+s-1]===0;)s=s-1;for(y<=u&&u-y>16384?y=cl:y=y-u;y>ao;){if(m=m+1,m-_>Sg){var me=g.join("");if(me.match(/^0+$/)){y=ao;break}pi(e,"overflow")}y=y-1}for(;y<cl||h<c;){if(m===0&&s<h){y=cl,s=0;break}if(h<c?c=c-1:m=m-1,y<ao)y=y+1;else{var me=g.join("");if(me.match(/^0+$/)){y=ao;break}pi(e,"overflow")}}if(m-_+1<s){var pe=o;n&&(f=f+1,pe=pe+1),r&&(f=f+1,pe=pe+1);var Ce=parseInt(e[f+m+1],10),be=0;if(Ce>=5&&(be=1,Ce===5)){for(be=g[m]%2===1?1:0,T=f+m+2;T<pe;T++)if(parseInt(e[T],10)){be=1;break}}if(be){for(var Bt=m;Bt>=0;Bt--)if(++g[Bt]>9&&(g[Bt]=0,Bt===0))if(y<ao)y=y+1,g[Bt]=1;else return new t(Ee.from(r?Kp:Jp))}}if(O=K.fromNumber(0),H=K.fromNumber(0),s===0)O=K.fromNumber(0),H=K.fromNumber(0);else if(m-_<17){var Bt=_;for(H=K.fromNumber(g[Bt++]),O=new K(0,0);Bt<=m;Bt++)H=H.multiply(K.fromNumber(10)),H=H.add(K.fromNumber(g[Bt]))}else{var Bt=_;for(O=K.fromNumber(g[Bt++]);Bt<=m-17;Bt++)O=O.multiply(K.fromNumber(10)),O=O.add(K.fromNumber(g[Bt]));for(H=K.fromNumber(g[Bt++]);Bt<=m;Bt++)H=H.multiply(K.fromNumber(10)),H=H.add(K.fromNumber(g[Bt]))}var Te=Cg(O,K.fromString("100000000000000000"));Te.low=Te.low.add(H),Dg(Te.low,H)&&(Te.high=Te.high.add(K.fromNumber(1))),R=y+qp;var pt={low:K.fromNumber(0),high:K.fromNumber(0)};Te.high.shiftRightUnsigned(49).and(K.fromNumber(1)).equals(K.fromNumber(1))?(pt.high=pt.high.or(K.fromNumber(3).shiftLeft(61)),pt.high=pt.high.or(K.fromNumber(R).and(K.fromNumber(16383).shiftLeft(47))),pt.high=pt.high.or(Te.high.and(K.fromNumber(0x7fffffffffff)))):(pt.high=pt.high.or(K.fromNumber(R&16383).shiftLeft(49)),pt.high=pt.high.or(Te.high.and(K.fromNumber(562949953421311)))),pt.low=Te.low,r&&(pt.high=pt.high.or(K.fromString("9223372036854775808")));var Q=Ee.alloc(16);return k=0,Q[k++]=pt.low.low&255,Q[k++]=pt.low.low>>8&255,Q[k++]=pt.low.low>>16&255,Q[k++]=pt.low.low>>24&255,Q[k++]=pt.low.high&255,Q[k++]=pt.low.high>>8&255,Q[k++]=pt.low.high>>16&255,Q[k++]=pt.low.high>>24&255,Q[k++]=pt.high.low&255,Q[k++]=pt.high.low>>8&255,Q[k++]=pt.high.low>>16&255,Q[k++]=pt.high.low>>24&255,Q[k++]=pt.high.high&255,Q[k++]=pt.high.high>>8&255,Q[k++]=pt.high.high>>16&255,Q[k++]=pt.high.high>>24&255,new t(Q)},t.prototype.toString=function(){for(var e,r=0,n=new Array(36),i=0;i<n.length;i++)n[i]=0;var s=0,o=!1,c,u={parts:[0,0,0,0]},f,g,h=[];s=0;var v=this.bytes,_=v[s++]|v[s++]<<8|v[s++]<<16|v[s++]<<24,m=v[s++]|v[s++]<<8|v[s++]<<16|v[s++]<<24,y=v[s++]|v[s++]<<8|v[s++]<<16|v[s++]<<24,T=v[s++]|v[s++]<<8|v[s++]<<16|v[s++]<<24;s=0;var O={low:new K(_,m),high:new K(y,T)};O.high.lessThan(K.ZERO)&&h.push("-");var H=T>>26&wg;if(H>>3===3){if(H===Ig)return h.join("")+"Infinity";if(H===Tg)return"NaN";e=T>>15&Xp,c=8+(T>>14&1)}else c=T>>14&7,e=T>>17&Xp;var R=e-qp;if(u.parts[0]=(T&16383)+((c&15)<<14),u.parts[1]=y,u.parts[2]=m,u.parts[3]=_,u.parts[0]===0&&u.parts[1]===0&&u.parts[2]===0&&u.parts[3]===0)o=!0;else for(g=3;g>=0;g--){var k=0,V=xg(u);if(u=V.quotient,k=V.rem.low,!!k)for(f=8;f>=0;f--)n[g*9+f]=k%10,k=Math.floor(k/10)}if(o)r=1,n[s]=0;else for(r=36;!n[s];)r=r-1,s=s+1;var Ut=r-1+R;if(Ut>=34||Ut<=-7||R>0){if(r>34)return h.push("".concat(0)),R>0?h.push("E+".concat(R)):R<0&&h.push("E".concat(R)),h.join("");h.push("".concat(n[s++])),r=r-1,r&&h.push(".");for(var i=0;i<r;i++)h.push("".concat(n[s++]));h.push("E"),Ut>0?h.push("+".concat(Ut)):h.push("".concat(Ut))}else if(R>=0)for(var i=0;i<r;i++)h.push("".concat(n[s++]));else{var de=r+R;if(de>0)for(var i=0;i<de;i++)h.push("".concat(n[s++]));else h.push("0");for(h.push(".");de++<0;)h.push("0");for(var i=0;i<r-Math.max(de-1,0);i++)h.push("".concat(n[s++]))}return h.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t}();Object.defineProperty(dl.prototype,"_bsontype",{value:"Decimal128"});var Rs=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},t.fromExtendedJSON=function(e,r){var n=parseFloat(e.$numberDouble);return r&&r.relaxed?n:new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},t}();Object.defineProperty(Rs.prototype,"_bsontype",{value:"Double"});var Ns=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e|0}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,r){return r&&r.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},t}();Object.defineProperty(Ns.prototype,"_bsontype",{value:"Int32"});var hl=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(hl.prototype,"_bsontype",{value:"MaxKey"});var gl=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(gl.prototype,"_bsontype",{value:"MinKey"});var Rg=new RegExp("^[0-9a-fA-F]{24}$"),fn=null,gr=Symbol("id"),Xe=function(){function t(e){if(!(this instanceof t))return new t(e);var r;if(typeof e=="object"&&e&&"id"in e){if(typeof e.id!="string"&&!ArrayBuffer.isView(e.id))throw new Fe("Argument passed in must have an id that is of type string or Buffer");"toHexString"in e&&typeof e.toHexString=="function"?r=Ee.from(e.toHexString(),"hex"):r=e.id}else r=e;if(r==null||typeof r=="number")this[gr]=t.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[gr]=r instanceof Ee?r:Is(r);else if(typeof r=="string")if(r.length===12){var n=Ee.from(r);if(n.byteLength===12)this[gr]=n;else throw new Fe("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&Rg.test(r))this[gr]=Ee.from(r,"hex");else throw new Fe("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new Fe("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[gr]},set:function(e){this[gr]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){typeof e!="number"&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=Ee.alloc(12);return n.writeUInt32BE(e,0),fn===null&&(fn=sf(5)),n[4]=fn[0],n[5]=fn[1],n[6]=fn[2],n[7]=fn[3],n[8]=fn[4],n[11]=r&255,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(e==null)return!1;if(e instanceof t)return this[gr][11]===e[gr][11]&&this[gr].equals(e[gr]);if(typeof e=="string"&&t.isValid(e)&&e.length===12&&ml(this.id))return e===Ee.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 Ee.from(e).equals(this.id);if(typeof e=="object"&&"toHexString"in e&&typeof e.toHexString=="function"){var r=e.toHexString(),n=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===n}return!1},t.prototype.getTimestamp=function(){var e=new Date,r=this.id.readUInt32BE(0);return e.setTime(Math.floor(r)*1e3),e},t.createPk=function(){return new t},t.createFromTime=function(e){var r=Ee.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(e,0),new t(r)},t.createFromHexString=function(e){if(typeof e>"u"||e!=null&&e.length!==24)throw new Fe("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(Ee.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(Xe.prototype,"generate",{value:Cs(function(t){return Xe.generate(t)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(Xe.prototype,"getInc",{value:Cs(function(){return Xe.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Xe.prototype,"get_inc",{value:Cs(function(){return Xe.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Xe,"get_inc",{value:Cs(function(){return Xe.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Xe.prototype,"_bsontype",{value:"ObjectID"});function Ng(t){return t.split("").sort().join("")}var lo=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=Ng(r??""),this.pattern.indexOf("\0")!==-1)throw new mn("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new mn("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if(!(this.options[n]==="i"||this.options[n]==="m"||this.options[n]==="x"||this.options[n]==="l"||this.options[n]==="s"||this.options[n]==="u"))throw new mn("The regular expression option [".concat(this.options[n],"] is not supported"))}return t.parseOptions=function(e){return e?e.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(e){return e=e||{},e.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e)if(typeof e.$regex!="string"){if(e.$regex._bsontype==="BSONRegExp")return e}else return new t(e.$regex,t.parseOptions(e.$options));if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new Fe("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t}();Object.defineProperty(lo.prototype,"_bsontype",{value:"BSONRegExp"});var yl=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(yl.prototype,"_bsontype",{value:"Symbol"});var Ag=K,uf=function(t){xs(e,t);function e(r,n){var i=this;return i instanceof e?(K.isLong(r)?i=t.call(this,r.low,r.high,!0)||this:uo(r)&&typeof r.t<"u"&&typeof r.i<"u"?i=t.call(this,r.i,r.t,!0)||this:i=t.call(this,r,n,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new e(r,n)}return e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(r){return new e(K.fromInt(r,!0))},e.fromNumber=function(r){return new e(K.fromNumber(r,!0))},e.fromBits=function(r,n){return new e(r,n)},e.fromString=function(r,n){return new e(K.fromString(r,!0,n))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(r){return new e(r.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},e.MAX_VALUE=K.MAX_UNSIGNED_VALUE,e}(Ag);function Og(t){return uo(t)&&Reflect.has(t,"_bsontype")&&typeof t._bsontype=="string"}var pf=2147483647,ff=-2147483648,mf=9223372036854776e3,df=-9223372036854776e3,Pg={$oid:Xe,$binary:dn,$uuid:dn,$symbol:yl,$numberInt:Ns,$numberDecimal:dl,$numberDouble:Rs,$numberLong:K,$minKey:gl,$maxKey:hl,$regex:lo,$regularExpression:lo,$timestamp:uf};function hf(t,e){if(e===void 0&&(e={}),typeof t=="number"){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=ff&&t<=pf)return new Ns(t);if(t>=df&&t<=mf)return K.fromNumber(t)}return new Rs(t)}if(t==null||typeof t!="object")return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter(function(h){return h.startsWith("$")&&t[h]!=null}),n=0;n<r.length;n++){var i=Pg[r[n]];if(i)return i.fromExtendedJSON(t,e)}if(t.$date!=null){var s=t.$date,o=new Date;return e.legacy?typeof s=="number"?o.setTime(s):typeof s=="string"&&o.setTime(Date.parse(s)):typeof s=="string"?o.setTime(Date.parse(s)):K.isLong(s)?o.setTime(s.toNumber()):typeof s=="number"&&e.relaxed&&o.setTime(s),o}if(t.$code!=null){var c=Object.assign({},t);return t.$scope&&(c.$scope=hf(t.$scope)),Ds.fromExtendedJSON(t)}if(gg(t)||t.$dbPointer){var u=t.$ref?t:t.$dbPointer;if(u instanceof co)return u;var f=Object.keys(u).filter(function(h){return h.startsWith("$")}),g=!0;if(f.forEach(function(h){["$ref","$id","$db"].indexOf(h)===-1&&(g=!1)}),g)return co.fromExtendedJSON(u)}return t}function Lg(t,e){return t.map(function(r,n){e.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Jr(r,e)}finally{e.seenObjects.pop()}})}function Zp(t){var e=t.toISOString();return t.getUTCMilliseconds()!==0?e:e.slice(0,-5)+"Z"}function Jr(t,e){if((typeof t=="object"||typeof t=="function")&&t!==null){var r=e.seenObjects.findIndex(function(O){return O.obj===t});if(r!==-1){var n=e.seenObjects.map(function(O){return O.propertyName}),i=n.slice(0,r).map(function(O){return"".concat(O," -> ")}).join(""),s=n[r],o=" -> "+n.slice(r+1,n.length-1).map(function(O){return"".concat(O," -> ")}).join(""),c=n[n.length-1],u=" ".repeat(i.length+s.length/2),f="-".repeat(o.length+(s.length+c.length)/2-1);throw new Fe(`Converting circular structure to EJSON:
|
|
19
|
+
`)};dt.prototype.renderPartial=function(t,e,r,n){if(r){var i=this.getConfigTags(n),s=zc(r)?r(t[1]):r[t[1]];if(s!=null){var o=t[6],c=t[5],u=t[4],f=s;c==0&&u&&(f=this.indentPartial(s,u,o));var g=this.parse(f,i);return this.renderTokens(g,e,r,f,n)}}};dt.prototype.unescapedValue=function(t,e){var r=e.lookup(t[1]);if(r!=null)return r};dt.prototype.escapedValue=function(t,e,r){var n=this.getConfigEscape(r)||Mt.escape,i=e.lookup(t[1]);if(i!=null)return typeof i=="number"&&n===Mt.escape?String(i):n(i)};dt.prototype.rawValue=function(t){return t[1]};dt.prototype.getConfigTags=function(t){return qn(t)?t:t&&typeof t=="object"?t.tags:void 0};dt.prototype.getConfigEscape=function(t){if(t&&typeof t=="object"&&!qn(t))return t.escape};var Mt={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){Zi.templateCache=t},get templateCache(){return Zi.templateCache}},Zi=new dt;Mt.clearCache=function(){return Zi.clearCache()};Mt.parse=function(t,e){return Zi.parse(t,e)};Mt.render=function(t,e,r,n){if(typeof t!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+Dh(t)+'" was given as the first argument for mustache#render(template, view, partials)');return Zi.render(t,e,r,n)};Mt.escape=Bh;Mt.Scanner=eo;Mt.Context=Yn;Mt.Writer=dt;var Zt=Mt,Up=Xt(Bp()),Nt=class Un{static DOCUMENT_STANDARD_MODE="CSS1Compat";static _instance;parentContainer;scalingFactor=1;doc=document;parser=new Up.default;constructor(){}static get(){return Un._instance||(Un._instance=new Un),Un._instance}getUAParser(){return this.parser}getWidth(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientWidth:document.compatMode===Un.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth}getHeight(){return this.isParentNotBody()?this.parentContainer.clientHeight:document.compatMode===Un.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight}isMobile(){return this.parser.getDevice().type==="mobile"}calculateScalingFactor(e){let r=e.max,n=e.cont.w,i=e.cont.h,s=e.spc,o=Un.get().getWidth(),c=Un.get().getHeight();r&&(o=o?Math.min(o,r):r,c=c?Math.min(c,r):r),c&&(o-=s.getHorizontal(),c-=s.getVertical(),o/c<n/i?this.scalingFactor=o/n:this.scalingFactor=c/i,this.scalingFactor=Math.min(this.scalingFactor,1))}getScalingFactor(){return this.scalingFactor}createElement(e){return this.doc.createElement(e)}appendChild(e,r){e.appendChild(r)}setStyles(e,r){Object.assign(e.style,r)}setStyle(e,r,n){if(r){if(!n){e.style.removeProperty(r);return}e.style.setProperty(r,n,"important")}}setAttribute(e,r,n){e.setAttribute(r,n)}removeInApp(e){let r=document.querySelector(`.${e.rootClassName}`);r&&r.parentElement.removeChild(r)}setParentContainer(e){this.parentContainer=e,this.parentContainer&&this.isParentNotBody()&&this.setStyle(this.parentContainer,"position","relative")}isParentNotBody(){return this.parentContainer!==document.body}},ne=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"},qc=Xt(kp());function Kn(t){return qc.default.createInstance({name:"lc",storeName:t,driver:qc.default.LOCALSTORAGE})}var zr=class{static storage;static async get(t,e){return await this.storage?.getItem(t)??e}static set(t,e){return this.storage?.setItem(t,e)}static remove(t){return this.storage?.removeItem(t)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}},at=class extends zr{static storeName="ses";static{this.storage=Kn(this.storeName)}},Ne=class extends zr{static storeName="usr";static{this.storage=Kn(this.storeName)}},fe=class{isCartDirty=!0;cartEngagements;isGoKwikPopupOpen;previewIDs;previewVariant;pageName;moneyFormat;jsLoadTime=new Date;shopCurrencyCode;inInactive=!1;lastEnterActive=new Date;lastEnterInactive=null;currentItem;_currencyCode;get currencyCode(){return this._currencyCode}set currencyCode(t){this._currencyCode=t}static get(){return window.CooeeSDK.runtimeData}isInactive(){return this.inInactive}async setInactive(){return this.inInactive?0:(this.inInactive=!0,this.lastEnterInactive=new Date,Math.max((this.lastEnterInactive.getTime()-this.lastEnterActive.getTime())/1e3,0))}setActive(){return this.inInactive?(this.inInactive=!1,this.lastEnterActive=new Date,Math.max((this.lastEnterActive.getTime()-this.lastEnterInactive.getTime())/1e3,0)):0}isFirstActive(){return this.lastEnterInactive==null}getCurrentItem(){return this.currentItem}setCurrentItem(t){this.currentItem=t}},Ae=class{static COOEE_URL_PREFIX="?from=cooee";static isShopify(){return!!window.Shopify}static getShopName(){if(this.isShopify())return window.Shopify.shop?.split(".")?.[0]}static getPageName(){if(!this.isShopify())return;let t=new URL(window.location.href).pathname.slice(1).split("/"),e=t[0];if(e==="")return"home";if(e==="collections")return t[2]==="products"?"product":"collection";if(e==="products")return"product";if(e==="cart")return"cart";if(location.href.includes("thank_you"))return"thank_you"}static getProductSlug(t){let e=(t.includes("://")?new URL(t).pathname:t).match(/\/products\/([^/]+?)(?:\.html)?$/);return e?e[1]:null}static getRootPrefix(){return window.Shopify?.routes?.root??"/"}static getCartURL(t){return this.getRootPrefix()+t+this.COOEE_URL_PREFIX}},Jn=class{isLocked=!1;queue=[];async acquire(){if(this.isLocked)await new Promise(t=>this.queue.push(t));else{this.isLocked=!0;return}}release(){if(this.queue.length>0){let t=this.queue.shift();t&&t()}else this.isLocked=!1}},ge=class Mp{static CURRENT;token;items;total_price;original_total_price;currency;item_count;attributes;lock=new Jn;constructor(){}static getCurrent(){return this.CURRENT||(this.CURRENT=new Mp),this.CURRENT}async getNormalisedCart(e){await this.fetchCartFromShopify(e);let r=this.convertToCooeeCart();return e&&await Ne.set(ne.CURRENT_CART,r),r}async addCooeeAttributes(){await this.lock.acquire();let e=await at.get(ne.ID),r=await Ne.get(ne.DEVICE_ID);if(this.attributes?.letscooee_did===r&&this.attributes?.letscooee_sid===e){w.debug("Not calling Shopify update.js API.","Current attributes:",this.attributes),this.lock.release();return}let n={letscooee_did:r,letscooee_sid:e,__letscooee_time:new Date().toLocaleString()};w.debug("Updating Shopify cart with attributes:",n);let i=Ae.getCartURL("cart/update.js"),s=await(await fetch(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({attributes:n})})).json();w.debug("Updated cart attributes",JSON.stringify(s)),this.update(s),this.lock.release()}update(e){return this.token=e.token,this.items=e.items,this.total_price=e.total_price,this.original_total_price=e.original_total_price,this.currency=e.currency,this.item_count=e.item_count,this.attributes=e.attributes,fe.get().currencyCode=this.currency,w.log("Updated ShopifyCart",this),this}toString(){return`ShopifyCart(token: ${this.token}, itemCount: ${this.item_count})`}convertToCooeeCart(){return{amount:this.total_price/100,originalAmount:this.original_total_price/100,currency:this.currency,itemCount:this.item_count,items:this.normaliseItems(this.items),token:this.token}}normaliseItems(e){if(!e)return w.error("No item received to be sent"),[];Array.isArray(e)||(e=[e]);let r=[];for(let n of e){if(!n.id||!n.title){w.warn("Invalid item received",n);continue}let i={name:n.title,quantity:+n.quantity||1,mID:n.product_id?.toString(),vID:n.id.toString(),price:+n.price/100||0,properties:n.properties},s=n.selling_plan_allocation?.selling_plan;if(!s){r.push(i);continue}i.sellingPlanAllocation={sellingPlan:{fixedSellingPlan:s.fixed_selling_plan,id:s.id,name:s.name,recurringDeliveries:s.recurring_deliveries}},r.push(i)}return r}async fetchCartFromShopify(e){if(!e&&this.token){w.debug("Not fetching cart");return}w.debug("Fetching cart");let r=Ae.getCartURL("cart.js"),n=await(await fetch(r)).json();this.update(n)}},ns=class{static format(t,e){let r=/{{\s*(\w+)\s*}}/;return e.replace(r,(n,i)=>{switch(i){case"amount":return this.formatWithDelimiters(t,2);case"amount_no_decimals":return this.formatWithDelimiters(t,0);case"amount_with_comma_separator":return this.formatWithDelimiters(t,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(t,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(t,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(t,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(t,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(t,2," ",".");default:return n}})}static formatWithDelimiters(t,e=2,r=",",n="."){if(isNaN(t)||t==null)return"0";let i=(t/100).toFixed(e).split("."),s=i[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+r),o=i[1]?n+i[1]:"";return s+o}},kt=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(t){return typeof t=="object"&&!Array.isArray(t)&&t!==null}static parseToAny(t){try{return JSON.parse(t.toString())}catch{}return t.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(t.toString()):t}static async sleep(t){return new Promise(e=>setTimeout(e,t))}static hasKeys(t){return t?Object.keys(t).length>=1:!1}static convertObjectToArray(t,e){return e.reduce((r,n)=>(t.hasOwnProperty(n)&&t[n]!=null&&r.push({[n]:t[n]}),r),[])}static removeNullUndefinedKeys(t){return Object.keys(t).reduce((e,r)=>(t[r]!==null&&t[r]!==void 0&&(e[r]=t[r]),e),{})}static stringify(t){return JSON.stringify(t,function(e,r){return r===void 0?null:r})}},se=class{static tz;static isValidURL(t){try{return new URL(t)}catch{return}}static isNull(t){return!t||t==="null"||t==="undefined"}static removeFromArray(t,e){let r=t.indexOf(e);return r===-1?!1:(t.splice(r,1),!0)}static formatCurrency(t,e){if(t==0&&e)return"Free";let r=fe.get(),n=je.get(),i=r.shopCurrencyCode??n.currency,s=r.currencyCode,o=n.money?.format??r.moneyFormat,c;return o&&i===s?c=ns.format(t*100,o):(c=new Intl.NumberFormat(this.getLang(),{style:"currency",currency:s,minimumFractionDigits:0,maximumFractionDigits:2}).format(t),c=c.replace("\u20B9","Rs. "),n.money?.showCurrency&&s!=="INR"&&(c=c.concat(` ${s}`))),c}static formatNumber(t){return new Intl.NumberFormat(this.getLang(),{notation:"compact"}).format(t)}static getLang(){return navigator.languages!==void 0?navigator.languages[0].split("-")[0]:navigator.language??"en"}static getTimezone(){if(this.tz)return this.tz;try{return this.tz=Intl.DateTimeFormat().resolvedOptions().timeZone,this.tz}catch{return""}}static documentReady(t){document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t)}static onDocumentLoaded(t){document.readyState==="complete"?t():document.addEventListener("readystatechange",()=>{document.readyState==="complete"&&t()})}static showSnackbar(t){let e=document.createElement("span");e.id="snackbar",e.innerText=t,document.body.appendChild(e),e.className="show",setTimeout(()=>{e.classList.remove("show"),document.body.removeChild(e)},3e3)}static async retrySelectorForElements(t,e=10,r=document){let n=0,i=document.querySelectorAll("nonexistent-tag");for(;n<e;){let s=Math.min(100*2**n,5e3);if(await kt.sleep(s),i=r.querySelectorAll(t),i.length)return w.debug(`Attempt ${n+1}: ${i.length} elements found with ${t}`),i;w.debug(`Attempt ${n+1}: Elements not found with ${t}. Retrying after ${s}ms.`),n++}return w.warn(`Max attempts reached. Element not found with ${t}.`),i}static async retrySelector(t,e=10,r=document){return(await this.retrySelectorForElements(t,e,r)).item(0)}};function Xn(t,e,r){Object.defineProperty(t,e,{enumerable:!1,configurable:!1,writable:!1,value:r})}var bt=class{id;mID;vID;vName;imageURL;name;link;quantity;price;constructor(t){this.id=t.id,this.mID=t.mID,this.vID=t.vID,this.vName=t.vName,this.imageURL=t.imageURL,this.name=t.name,this.link=t.link,this.quantity=t.quantity,this.price=t.price}},is=class{url;alt;constructor(t){t.alt&&(this.alt=t.alt),this.url=t.url}},os=class{d;cmp;effective;constructor(t={}){this.d=t.d,this.cmp=t.cmp,this.effective=t.d}},Kc=class{id;mID;name;groupID;groupName;isSelected;constructor(t){t??={},this.id=t.id,this.mID=t.mID,this.name=t.name,this.groupID=t.groupID,this.groupName=t.groupName,this.isSelected=t.isSelected??!1}},mr=class{mID;name;imgs;link;price;sku;isAvailable;quantity;sellingPlans;selectedSellingPlan;constructor(t){t=t??{},this.mID=t.mID,this.name=t.name,this.imgs=t.imgs?.map(e=>new is(e))??[],this.link=t.link,this.price=new os(t.price),this.sku=t.sku,this.isAvailable=t.isAvailable,this.quantity=t.quantity,t.sellingPlans?.length&&(this.selectedSellingPlan=Qt(void 0)),this.sellingPlans=t.sellingPlans?.map(e=>{let r=new Kc(e);return r.isSelected&&(this.selectedSellingPlan.value=r),r})}getOneImage(){return this.imgs[0]?.url}changeSellingPlan(t){this.selectedSellingPlan.value=t}},wt=class{id;mID;name;status;ctg;imgs;videos;portraitVideos;vars;desc;sDesc;link;slug;quantity;category;meta;selectedOrFirstVariant;selected=Qt(!0);constructor(t){this.update(t),this.selectedOrFirstVariant=Qt(this.selectedVariant)}get imageURL(){return this.imgs?.[0]?.url}get secondaryImageURL(){return this.imgs?.[1]?.url}get getVariantImages(){return this.selectedOrFirstVariant.value.imgs}get variantImage(){return this.getVariantImages[0]?.url}get variantSecondaryImage(){return this.getVariantImages[1]?.url}get selectedVariant(){return this.vars.find(t=>t.isAvailable)??this.vars[0]}set variants(t){this.vars=t,this.selectedOrFirstVariant.value=this.selectedVariant}update(t){return this.id=t.id,this.mID=t.mID,this.name=t.name,this.status=t.status,this.ctg=t.ctg,this.imgs=t.imgs,this.desc=t.desc,this.sDesc=t.sDesc,this.link=t.link,this.slug=t.slug,this.quantity=t.quantity,this.meta=t.meta,this.category=t.category,this.videos=t.videos,this.portraitVideos=t.videos?.filter(e=>e.orientation==="PORTRAIT"),t.vars&&(this.vars=t.vars.map(e=>new mr(e))),this}toEmbed(t){return t=t??this.selectedOrFirstVariant.value,new bt({id:this.id,mID:this.mID,vID:t.mID,vName:t.name,name:this.name,link:this.link,slug:this.slug,price:t.price.d,imageURL:t.getOneImage()??this.imgs?.[0].url})}},ss=class{id;mID;handle;title;imageURL;constructor(t){t??={},this.id=t.id,this.mID=t.mID,this.handle=t.handle,this.title=t.title,this.imageURL=t.imageURL}},Jc=class{enabled;constructor(t){this.enabled=t.enabled}},Xc=class extends Jc{max;min;constructor(t){t??={},super(t),this.min=t.min,this.max=t.max}},as=class{productQuantity;constructor(t){t??={},this.productQuantity=new Xc(t.productQuantity)}},nn=class{s;g;i;constructor(t){t.s&&(this.s=new We(t.s)),t.g&&(this.g=new ro(t.g)),this.i=t.i}get solid(){return this.s}get glossy(){return this.g}get img(){return this.i}},no="a-f\\d",Wh=`#?[${no}]{3}[${no}]?`,Gh=`#?[${no}]{6}([${no}]{2})?`,Vh=new RegExp(`[^#${no}]`,"gi"),zh=new RegExp(`^${Wh}$|^${Gh}$`,"i");function Qc(t,e={}){if(typeof t!="string"||Vh.test(t)||!zh.test(t))throw new TypeError("Expected a valid hex string");t=t.replace(/^#/,"");let r=1;t.length===8&&(r=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),t.length===4&&(r=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),t.length===3&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);let n=Number.parseInt(t,16),i=n>>16,s=n>>8&255,o=n&255,c=typeof e.alpha=="number"?e.alpha:r;if(e.format==="array")return[i,s,o,c];if(e.format==="css"){let u=c===1?"":` / ${Number((c*100).toFixed(2))}%`;return`rgb(${i} ${s} ${o}${u})`}return{red:i,green:s,blue:o,alpha:c}}var We=class{h;a=100;g;constructor(t){t??={},this.h=t.h,this.a=t.a,this.g=t.g}get hex(){return this.h}get grad(){return this.g}get rgba(){if(!this.hex)return"";try{return Qc(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}}getAlpha(){return(this.a??100)/100}},on=class{s;r;w;c;constructor(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new We(t.c))}get radius(){return this.r}get width(){return this.w}get color(){return this.c}get style(){return Fp[this.s??1]}},Fp=(t=>(t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED",t))(Fp||{}),ro=class bd{static DEFAULT_FALLBACK=new We({h:"#000000",a:50});r;c;fb;constructor(e){this.r=e.r,e.c&&(this.c=new We(e.c)),e.fb&&(this.fb=new We(e.fb))}get radius(){return this.r}get color(){return this.c}get fallback(){return this.fb??bd.DEFAULT_FALLBACK}},io=class{blur;spr;clr;x;y;constructor(t){t=t??{},this.blur=t.blur??0,this.spr=t.spr??0,this.x=t.x??0,this.y=t.y??0,this.clr=new We(t.clr)}getStyle(t){return`${this.x*t}px ${this.y*t}px ${this.blur*t}px ${this.spr*t}px ${this.clr.rgba}`}},Nr=class{pl;pr;pt;pb;ml;mr;mt;mb;cent;constructor(t){t=t??{},this.pl=t.pl??0,this.pr=t.pr??0,this.pt=t.pt??0,this.pb=t.pb??0,this.ml=t.ml??0,this.mr=t.mr??0,this.mt=t.mt??0,this.mb=t.mb??0,this.cent=t.cent??!1}getHorizontal(){return this.pl+this.pr}getVertical(){return this.pt+this.pb}getPaddingCSS(){return`${this.pt}px ${this.pr}px ${this.pb}px ${this.pl}px`}},sn=class{rot;constructor(t){t?.rot&&(this.rot=t.rot)}get rotate(){return this.rot}},At=class{t;bg;br;clc;shd;spc;trf;a;w;h;x;y;constructor(t){this.t=t.t,t.bg&&(this.bg=new nn(t.bg)),t.br&&(this.br=new on(t.br)),t.shd&&(this.shd=new io(t.shd)),t.spc&&(this.spc=new Nr(t.spc)),this.trf=new sn(t.trf),this.clc=t.clc,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y,this.a=t.a}get alpha(){return this.a??100}get type(){return this.t}get typeAsString(){return Le[this.t]}get click(){return this.clc}},Le=(t=>(t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.FLEXBOX=4]="FLEXBOX",t[t.MULTI_COLUMN=5]="MULTI_COLUMN",t[t.CHECKBOX=6]="CHECKBOX",t[t.PRODUCTS=11]="PRODUCTS",t[t.PRODUCT=12]="PRODUCT",t[t.PRODUCT_IMAGE=13]="PRODUCT_IMAGE",t[t.PRODUCT_TITLE=14]="PRODUCT_TITLE",t[t.PRODUCT_VARIATIONS=15]="PRODUCT_VARIATIONS",t[t.PRODUCT_VARIATIONS_SELLING_PLANS=16]="PRODUCT_VARIATIONS_SELLING_PLANS",t[t.PRODUCT_BUTTON=18]="PRODUCT_BUTTON",t[t.EMAIL_INPUT=51]="EMAIL_INPUT",t[t.PHONE_INPUT=52]="PHONE_INPUT",t[t.COUNTDOWN_TIMER=61]="COUNTDOWN_TIMER",t[t.CAROUSEL=62]="CAROUSEL",t[t.SHAPE=100]="SHAPE",t))(Le||{}),an=class extends At{constructor(t){super(t)}},Ar=class extends At{src;constructor(t){super(t),this.src=t.src}},Qn=(t=>(t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY",t))(Qn||{}),cs=class{name;fonts;constructor(t){t=t??{},t.name&&(t.name=t.name!=="Arial"?t.name:""),this.name=t.name,this.fonts=t.fonts?.map(e=>new Zc(e))}},Zc=class{style;url;constructor(t){t=t??{},this.style=t.style,this.url=t.url}getFontDescriptor(){return{style:this.style===2||this.style===4?"italic":"normal",weight:this.style===4||this.style===3?"700":"400"}}getURL(){return`url('${this.url}') format('truetype')`}},it=class{fw;fs;fam;fmly;lh=1.2;ls;s;tc;ta;td;tdc;constructor(t){this.update(t)}get alignment(){return Qn[this.ta]}get letterSpacing(){return this.ls?this.ls+"px":"normal"}update(t){t=t??{},t.lh&&(this.lh=t.lh),t.tdc&&(this.tdc=new We(t.tdc)),this.td=t.td,this.fs=t.s??t.fs??60,this.tc=new We(t.tc),this.ta=t.ta??1,this.fw=t.fw??400,this.ls=t.ls??0,this.tc.h??="#000000",this.fam=new cs(t.fam??t.fmly)}resize(t){this.s*=t,this.ls*=t}},dr=class extends At{typo;constructor(t){super(t);let e=b(b({},t.f),t.typo);t.alg&&(e.ta=t.alg),t.c&&(e.tc=t.c),this.typo=new it(e)}get color(){return this.typography.tc}get typography(){return this.typo}},Yr=class extends dr{prs;constructor(t){super(t),this.prs=t.prs}get parts(){return this.prs}},ls=class extends At{o;constructor(t){super(t),this.o=t.o??5,this.w=this.w??1080,this.h=this.h??1920}getOrigin(){return this.o}},Zn=class{dd;hh;mm;ss;date;constructor(t){t??={},this.dd=t.dd??0,this.hh=t.hh??0,this.mm=t.mm??0,this.ss=t.ss??0,this.date=t.date?new Date(t.date):void 0}start(t,e){let r=new Date;t===2?(r.setSeconds(r.getSeconds()+this.ss),r.setMinutes(r.getMinutes()+this.mm),r.setHours(r.getHours()+this.hh),r.setDate(r.getDate()+this.dd)):r=this.date??new Date;let n=window.setInterval(()=>{let i=new Date().getTime(),s=r.getTime()-i;if(s<1){clearInterval(n);return}let o=Math.floor(s/(1e3*60*60*24)),c=Math.floor(s%(1e3*60*60*24)/(1e3*60*60)),u=Math.floor(s%(1e3*60*60)/(1e3*60)),f=Math.floor(s%(1e3*60)/1e3);e({days:o,hours:c,minutes:u,seconds:f})},1e3);return n}},ei=class extends dr{gap;timer;timerType;horizontal;lblPos;show;constructor(t){t??={},super(t),this.gap=t.gap,this.timerType=t.type,this.timer=new Zn(t.timer),this.show=t.show??{day:!0,hour:!0,minute:!0,second:!0},this.horizontal=t.horizontal,this.lblPos=t.lblPos}},us=class{txt;c;constructor(t){t??={},this.txt=t.txt,this.c=new We(t.c??{})}get text(){return this.txt}get color(){return this.c}},qr=class extends dr{ph;constructor(t){super(t),this.ph=new us(t.ph)}get placeholderText(){return this.ph.text}get placeholderColor(){return this.ph.color.rgba}},ti=class extends qr{constructor(t){t??={},super(t)}},ri=class extends qr{},ni=class extends qr{},ii=class extends Ar{},cn=(t=>(t[t.LOW=1]="LOW",t[t.MEDIUM=2]="MEDIUM",t[t.HIGH=3]="HIGH",t))(cn||{}),ps=class{en;ex;constructor(t){t=t??{},this.en=t.en,this.ex=t.ex}getEnterAnimation(){switch(this.en){case 2:return[{transform:"translateY(-100%)"},{transform:"translateY(0%)"}];case 3:return[{transform:"translateY(100%)"},{transform:"translateY(0%)"}];case 4:return[{transform:"translateX(-100%)"},{transform:"translateX(0%)"}];case 5:return[{transform:"translateX(100%)"},{transform:"translateX(0%)"}];case 6:return[{transform:"translate(-100%, -100%)"},{transform:"translate(0%, 0%)"}];case 7:return[{transform:"translate(100%, -100%)"},{transform:"translate(0%, 0%)"}];case 8:return[{transform:"translate(-100%, 100%)"},{transform:"translate(0%, 0%)"}];case 9:return[{transform:"translate(100%, 100%)"},{transform:"translate(0%, 0%)"}];case 10:return[{transform:"scale(0.1)"},{transform:"scale(1)"}];default:return[]}}getExitAnimation(){switch(this.ex){case 2:return[{transform:"translateY(0%)"},{transform:"translateY(-100%)"}];case 3:return[{transform:"translateY(0%)"},{transform:"translateY(100%)"}];case 4:return[{transform:"translateX(0%)"},{transform:"translateX(-100%)"}];case 5:return[{transform:"translateX(0%)"},{transform:"translateX(100%)"}];case 6:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, -100%)"}];case 7:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, -100%)"}];case 8:return[{transform:"translate(0%, 0%)"},{transform:"translate(-100%, 100%)"}];case 9:return[{transform:"translate(0%, 0%)"},{transform:"translate(100%, 100%)"}];case 10:return[{transform:"scale(1)"},{transform:"scale(0)"}];default:return[]}}},oo=class extends At{gvt;max;cover;anim;embedded;position;constructor(t){t=t??{},super(t),this.gvt=t.gvt??5,this.max=t.max,this.cover=t.cover??!0,this.anim=new ps(t.anim),this.embedded=t.embedded,this.position=t.position??1,this.spc||(this.spc=new Nr({pl:A.IN_APP_DEFAULT_PADDING,pr:A.IN_APP_DEFAULT_PADDING,pt:A.IN_APP_DEFAULT_PADDING,pb:A.IN_APP_DEFAULT_PADDING}))}isEmbedded(){return this.position===2&&!!this.embedded}getEmbeddedSelector(){return`.letscooee-engagement.container-${this.embedded}`}},fs=class extends oo{cont;elems=[];mob;constructor(t){t=t??{},super(t),this.cont=new ls(t.cont),this.mob=new oo(t.mob),this.bg||(this.bg=this.cont.bg,delete this.cont.bg),t.elems.forEach(e=>{e.t===1?this.elems.push(new Ar(e)):e.t===2?this.elems.push(new Yr(e)):e.t===3?this.elems.push(new Yr(e)):e.t===100?this.elems.push(new an(e)):e.t===51?this.elems.push(new ri(e)):e.t===52?this.elems.push(new ni(e)):e.t===61?this.elems.push(new ei(e)):e.t===15||e.t===16?this.elems.push(new ti(e)):e.t===13&&this.elems.push(new ii(e))})}getStylesForWrapper(){if(this.cover)return{};let t;return this.gvt===1?t={top:0,left:0}:this.gvt===2?t={top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===3?t={top:0,right:0}:this.gvt===6?t={top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===9?t={bottom:0,right:0}:this.gvt===8?t={bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===7?t={bottom:0,left:0}:this.gvt===4?t={top:"50%",left:0,transform:"translateY(-50%)"}:t={top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"},t.overflow="visible",t}getFlexStylesForContainer(){let t={display:"flex",flexDirection:"row"},e,r;return this.gvt===1?(e="flex-start",r="flex-start"):this.gvt===2?(e="center",r="flex-start"):this.gvt===3?(e="flex-end",r="flex-start"):this.gvt===4?(e="flex-start",r="center"):this.gvt===6?(e="flex-end",r="center"):this.gvt===7?(e="flex-start",r="flex-end"):this.gvt===8?(e="center",r="flex-end"):this.gvt===9?(e="flex-end",r="flex-end"):(e="center",r="center"),t.alignItems=r,t.justifyContent=e,t.overflow="visible",t}overrideForMobileView(){this.max=this.mob.max??this.max,this.cover=this.mob.cover??this.cover,this.gvt=this.mob.gvt??this.gvt,this.bg=this.mob.bg??this.bg,this.spc=this.mob.spc??this.spc,this.anim=this.mob.anim??this.anim,this.position=this.mob.position??this.position,this.embedded=this.mob.embedded??this.embedded}},oi=class{gap;dir;wrap;jc;ai;scroll;constructor(t){t??={},this.gap=t.gap??0,this.dir=t.dir??"row",this.wrap=t.wrap??"nowrap",this.jc=t.jc??"flex-start",this.ai=t.ai??"flex-start",this.scroll=t.scroll}},ms=class{of;disp;pos;top;bottom;left;right;zIndex;constructor(t){t??={},this.of=t.of,this.disp=t.disp,this.pos=t.pos,this.top=t.top,this.bottom=t.bottom,this.left=t.left,this.right=t.right,this.zIndex=t.zIndex}},ds=class{w;h;maxW;maxH;minW;minH;constructor(t){t??={},this.w=t.w??"100%",this.h=t.h??"auto",this.maxW=t.maxW,this.maxH=t.maxH,this.minW=t.minW,this.minH=t.minH}},hs=class{size;bg;br;spc;typo;lout;flex;constructor(t){t??={},this.spc=new Nr(t.spc),t.size&&(this.size=new ds(t.size)),t.bg&&(this.bg=new nn(t.bg)),t.br&&(this.br=new on(t.br)),t.typo&&(this.typo=new it(t.typo)),t.lout&&(this.lout=new ms(t.lout)),t.flex&&(this.flex=new oi(t.flex))}},si=class{sm;lg;constructor(t){t??={},this.sm=new hs(t.sm),this.lg=new hs(t.lg)}},ct=class{t;style;hide;when;clc;constructor(t,e){e??={},this.t=t,this.style=new si(e.style),this.hide=e.hide,e.when?.op&&(this.when=e.when),e.clc&&(this.clc=e.clc)}get stringType(){return Le[this.t]}},ze=class extends ct{text;constructor(t,e){t?.style?.lg?.typo?.s&&delete t.style.lg.typo.s,t?.style?.sm?.typo?.s&&delete t.style.sm.typo.s,super(e??2,t),t??={},this.text=t.text}},ln=class extends ze{constructor(t,e){super(t,e??3)}},ai=class extends ct{value;constructor(t){super(6,t),t??={},this.value=t.value}},ci=class extends ze{constructor(t=15,e){super(e,t)}},Hp=Xt(tn()),el=class{enabled;type;color;constructor(t){t??={},this.enabled=t.enabled,this.type=t.type,this.color=new We(t.color)}},tl=class{size;enabled;color;constructor(t){t??={},this.enabled=t.enabled,this.size=t.size,this.color=new We(t.color)}},so=class{navigation;pagination;autoplay;maxInRow;gap;slidesPerView;constructor(t){t??={},this.navigation=new tl(t.navigation),this.pagination=new el(t.pagination),this.autoplay=t.autoplay,this.slidesPerView=t.slidesPerView??1,this.maxInRow=t.maxInRow??t.slidesPerView??4,this.gap=t.gap??0}},gs=class extends ct{conf;slide;formData;values;allowedTypes;constructor(t){super(62,t),t&&this.update(t)}update(t){t??={},this.slide=Ot.getParsedElement(t.slide),this.formData=t.formData,this.values=t.values,this.conf=new so(t.conf),this.allowedTypes=t.allowedTypes}},ys=class extends ze{gap;timer;timerType;horizontal;lblPos;show;constructor(t){t??={},super(t,61),this.gap=t.gap,this.timerType=t.type,this.timer=new Zn(t.timer),this.show=t.show??{days:!0,hours:!0,minutes:!0,seconds:!0},this.horizontal=t.horizontal,this.lblPos=t.lblPos}},Kr=class extends ct{elems;constructor(t){super(4,t),this.update(t)}update(t){t??={},this.elems??=[],t.elems?.forEach(e=>{let r=Ot.getParsedElement(e);r&&this.elems.push(r)})}},un=class extends ct{src;sm;lg;constructor(t,e){super(e??1,t),t&&this.update(t)}update(t){this.src=t.src,this.sm=t.sm,this.lg=t.lg}},Ot=class wd{static getParsedElements(e){let r=[];return e?.forEach(n=>{let i=wd.getParsedElement(n);i&&r.push(i)}),r}static getParsedElement(e){switch(e.t){case 2:return new ze(e);case 3:return new ln(e);case 6:return new ai(e);case 11:return new vs(e);case 12:return new hr(e);case 61:return new ys(e);case 4:return new Kr(e);case 1:return new un(e);case 13:return new un(e,13);case 14:return new ze(e,14);case 15:case 16:return new ci(e.t,e);case 18:return new ln(e,18);case 62:return new gs(e);default:Hp.default.error("Unknown element type",e.t);return}}static parseAlignmentToJustifyContent(e){switch(e){case 1:return"center";case 2:return"flex-end";case 0:return"flex-start";default:return"flex-start"}}},hr=class extends ct{img;title;desc;price;compareAt;btn;variantDD;show;symbol;cBox;elems;noLinks;constructor(t){if(t??={},super(12,t),this.show=t.show,this.elems=Ot.getParsedElements(t.elems),this.noLinks=t.noLinks,!this.elems.length){t.cBox&&this.elems.push(new ai(t.cBox)),this.elems.push(new un(t.img,13));let e=new ze(t.title,14);e.hide=!t.show?.title,e.text="{{ product.name }}",this.elems.push(e);let r=new ze(t.price);r.text="{{ product.price }}",r.hide=!t.show?.price;let n=new ze(t.compareAt);n.text="{{ product.compare_price }}",n.hide=!t.show?.price,t.compareAt||(n.style=new si(r.style),n.style.lg.typo=new it(Z(b({},n.style.lg.typo),{td:"line-through"})),n.style.sm.typo=new it(Z(b({},n.style.sm.typo),{td:"line-through"})));let i=new Kr({style:{lg:{spc:{mb:10},flex:{dir:"row",gap:10,ai:"center",jc:Ot.parseAlignmentToJustifyContent(r.style.lg.typo?.ta)}}}});i.elems.push(n),i.elems.push(r),this.elems.push(i);let s=new ci(15,t.variantDD);if(s.hide=!t.show?.variantDD,this.elems.push(s),t.btn){let o=new ln(t.btn,18);o.hide=!t.show?.btn,this.elems.push(o)}}t.symbol&&(this.symbol=new ze(t.symbol))}},vs=class extends ct{conf;prod;constructor(t){super(11,t),t??={},this.conf=new rl(t.conf),this.prod=new hr(t.prod)}},_s=class extends so{disp;maxItems;constructor(t){t??={},super(t),this.disp=t.disp,this.maxItems=t.maxItems}},rl=class{lg;sm;constructor(t){t??={},this.lg=new _s(t.lg),this.sm=new _s(t.sm)}},Es=class extends Kr{constructor(t){super(t)}},li=class{cont;elems=[];constructor(t){t=t??{},this.cont=new Es(t.cont),t.elems?.forEach(e=>{this.addRawElement(e)})}addRawElement(t){let e=Ot.getParsedElement(t);return e&&this.elems.push(e),e}},nl=class{minValue;rewardType;label;reachingText;reachedText;discount;items;calculatedAlignment;constructor(t){this.minValue=t.minValue,this.rewardType=t.rewardType,this.label=t.label,this.reachingText=t.reachingText,this.reachedText=t.reachedText,this.discount=t.discount,this.items=t.items?.map(e=>new bt(e))}},Ss=class{layout;milestones;constructor(t){this.layout=t.layout??Ic.ICONS,this.milestones=t.milestones?.map(e=>new nl(e))??[]}},bs=class{applyDiscountOnMinimum;constructor(t){this.applyDiscountOnMinimum=t.applyDiscountOnMinimum}},il=class{engagementID;shortID;contentType;delay;onsiteDeliveryType;objective;redirectBehaviour;constructor(t){this.shortID=t.shortID,this.contentType=t.contentType,this.engagementID=t.engagementID,this.delay=t.delay??0,this.redirectBehaviour=t.redirectBehaviour,this.onsiteDeliveryType=t.onsiteDeliveryType,this.objective=t.objective}isAnySplit(){return this.isABTesting()||this.isExclusionTesting()}isExclusionTesting(){return this.contentType===zi.EXCLUSION}isABTesting(){return this.contentType===zi.ABTESTING}isSingleContent(){return this.contentType===zi.SINGLE}},Pt=class Ed extends il{static SWIPER_ELEMENTS=new Set([11,62]);nudgeID;contentID;variation;ian;widget;discount;placement;promotionType;contentSource;manipulation;klaviyoFormID;hasMultiplePlacement;skipSubscribedItems;progressBarConfig;bundleConfig;previewType;occurred;id;currency;props;items;nonMutableItems;embeddedItems;bundleFrom;collections;customerData;discountData=Qt({});constructor(e){super(e),this.id=e.id,this.nudgeID=e.nudgeID,this.currency=fe.get().currencyCode??"USD",this.contentID=e.contentID,this.variation=e.variation,e.widget&&(this.widget=new li(e.widget)),this.previewType=e.previewType,this.occurred=e.occurred??new Date,this.props=e.props,this.embeddedItems=e.embeddedItems?.map(r=>new bt(r)),this.items=e.items?.map(r=>new wt(r))??[],this.nonMutableItems=e.items?.map(r=>new wt(r))??[],this.collections=e.collections?.map(r=>new ss(r))??[],this.discount=e.discount,this.placement=e.placement,this.customerData=e.customerData,this.ian=e.ian?this.processPopup(e.ian):void 0,this.promotionType=e.promotionType,this.manipulation=new as(e.manipulation),this.contentSource=e.contentSource,this.klaviyoFormID=e.klaviyoFormID,this.hasMultiplePlacement=e.hasMultiplePlacement,this.skipSubscribedItems=e.skipSubscribedItems,e.progressBarConfig&&(this.progressBarConfig=new Ss(e.progressBarConfig)),e.bundleConfig&&(this.bundleConfig=new bs(e.bundleConfig)),e.bundleFrom&&(this.bundleFrom=new wt(e.bundleFrom))}shouldDelay(){return this.delay>0}sentryContext(){return{id:this.id,shortID:this.shortID,currency:this.currency,contentType:this.contentType,objective:this.objective,onsiteDeliveryType:this.onsiteDeliveryType,engagementID:this.engagementID,contentID:this.contentID,nudgeID:this.nudgeID,variation:this.variation}}getDelaySeconds(){let e=new Date().getTime()-this.occurred.getTime();return this.delay*1e3-e}isBundle(){return this.objective===lr.BUNDLE_AND_UPSELL}isCartEmbed(){return this.onsiteDeliveryType===Yi.CART_EMBED}isPageEmbed(){return this.onsiteDeliveryType===Yi.PAGE_EMBED}isProgressBar(){return this.objective===lr.PROGRESS_BAR}isSubscriptionUpsell(){return this.objective===lr.SUBSCRIPTION_UPSELL}isCartRecovery(){return this.objective===lr.CART_RECOVERY}isProductPromotion(){return this.objective===lr.PRODUCT_PROMOTION}isProductPromoted(){return this.isProductPromotion()||this.isBundle()||this.isCartRecovery()}isBYOB(){return this.objective===lr.BYOB}isShoppableVideo(){return this.objective===lr.SHOPPABLE_VIDEO}processPopup(e){let r=JSON.stringify(e),n=this.items[0],i={},s={};if(n){let u=n.selectedOrFirstVariant.value;i={name:n.name,id:n.mID,link:n.link,vID:u.mID,image:n.variantImage,price:se.formatCurrency(u.price.d),comparePrice:se.formatCurrency(u.price.cmp),quantity:n.quantity},s={quantity:u.quantity}}let o={productCount:ge.getCurrent().item_count},c=Zt.render(r,{product:i,variant:s,cart:o,discount:this.discount,customer:this.customerData});return n&&(c=c.replace(new RegExp(A.PLACEHOLDER_IMAGE,"gi"),n.variantImage??n.imageURL)),new fs(JSON.parse(c))}calculateDiscountData(e,r){let n=jn.sum(e,s=>s.selectedOrFirstVariant.value.price.d),i={actualPrice:n,discountAmount:0,discountPercentage:0,discountedPrice:n};if(!e?.length||!r||!this.discount?.type){this.discountData.value=this.formatCurrencyAndNumber(i);return}if([ur.UNIQUE_FLAT_ITEMS,ur.STATIC].includes(this.discount.type)&&this.discount.values?.length)i.discountPercentage=this.discount.values[0],i.discountAmount=i.actualPrice*i.discountPercentage/100;else if(this.discount.type===ur.UNIQUE_FIXED_ITEMS&&this.discount.values?.length)i.discountAmount=i.actualPrice-this.discount.values[0],i.discountPercentage=i.discountAmount/i.actualPrice*100;else if(this.discount.type===ur.UNIQUE_CHEAPEST_ITEM_FREE){e.sort((o,c)=>c.selectedOrFirstVariant.value.price.d-o.selectedOrFirstVariant.value.price.d);let s=e[e.length-1];s.selectedOrFirstVariant.value.price.effective=0,i.discountAmount=s.selectedOrFirstVariant.value.price.d,i.discountPercentage=i.discountAmount/i.actualPrice*100}i.discountedPrice=i.actualPrice-i.discountAmount,this.discountData.value=this.formatCurrencyAndNumber(i)}getPrivateAttributesForLineItem(){return je.get().skipItemAttribute?{}:{_via:"Cooee",[A.CAMPAIGN_ATTRIBUTE]:this.shortID,_letscooee_content:this.contentID}}isBundleDiscount(){return[ur.UNIQUE_FIXED_ITEMS,ur.UNIQUE_FLAT_ITEMS].includes(this.discount.type)}isBundleOnCartDrawer(){return this.onsiteDeliveryType===Yi.CART_EMBED&&this.objective===lr.BUNDLE_AND_UPSELL}hasSwiperElement(){let e=this.widget?.elems.find(n=>Ed.SWIPER_ELEMENTS.has(n.t));if(!e)return!1;if(e.t===62)return!0;let r=Nt.get().isMobile()?"sm":"lg";return e.conf[r].disp===2}toString(){return`Engagement(id=${this.shortID})`}formatCurrencyAndNumber(e){if(!e)return{};let r={discountPercentage:se.formatNumber(e.discountPercentage??0),discountCode:this.discount?.code};return["actualPrice","discountAmount","discountedPrice"].map(n=>{r[n]=se.formatCurrency(e[n])}),r}};function qh(t,e){return e={exports:{}},t(e,e.exports),e.exports}var Kh=Zh,Jh=tg,Xh=ig,yr=[],Ht=[],Qh=typeof Uint8Array<"u"?Uint8Array:Array,ol="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pn=0,$p=ol.length;pn<$p;++pn)yr[pn]=ol[pn],Ht[ol.charCodeAt(pn)]=pn;var pn,$p;Ht[45]=62;Ht[95]=63;function nf(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Zh(t){var e=nf(t),r=e[0],n=e[1];return(r+n)*3/4-n}function eg(t,e,r){return(e+r)*3/4-r}function tg(t){var e,r=nf(t),n=r[0],i=r[1],s=new Qh(eg(t,n,i)),o=0,c=i>0?n-4:n,u;for(u=0;u<c;u+=4)e=Ht[t.charCodeAt(u)]<<18|Ht[t.charCodeAt(u+1)]<<12|Ht[t.charCodeAt(u+2)]<<6|Ht[t.charCodeAt(u+3)],s[o++]=e>>16&255,s[o++]=e>>8&255,s[o++]=e&255;return i===2&&(e=Ht[t.charCodeAt(u)]<<2|Ht[t.charCodeAt(u+1)]>>4,s[o++]=e&255),i===1&&(e=Ht[t.charCodeAt(u)]<<10|Ht[t.charCodeAt(u+1)]<<4|Ht[t.charCodeAt(u+2)]>>2,s[o++]=e>>8&255,s[o++]=e&255),s}function rg(t){return yr[t>>18&63]+yr[t>>12&63]+yr[t>>6&63]+yr[t&63]}function ng(t,e,r){for(var n,i=[],s=e;s<r;s+=3)n=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(t[s+2]&255),i.push(rg(n));return i.join("")}function ig(t){for(var e,r=t.length,n=r%3,i=[],s=16383,o=0,c=r-n;o<c;o+=s)i.push(ng(t,o,o+s>c?c:o+s));return n===1?(e=t[r-1],i.push(yr[e>>2]+yr[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(yr[e>>10]+yr[e>>4&63]+yr[e<<2&63]+"=")),i.join("")}var sl={byteLength:Kh,toByteArray:Jh,fromByteArray:Xh},og=function(t,e,r,n,i){var s,o,c=i*8-n-1,u=(1<<c)-1,f=u>>1,g=-7,h=r?i-1:0,v=r?-1:1,_=t[e+h];for(h+=v,s=_&(1<<-g)-1,_>>=-g,g+=c;g>0;s=s*256+t[e+h],h+=v,g-=8);for(o=s&(1<<-g)-1,s>>=-g,g+=n;g>0;o=o*256+t[e+h],h+=v,g-=8);if(s===0)s=1-f;else{if(s===u)return o?NaN:(_?-1:1)*(1/0);o=o+Math.pow(2,n),s=s-f}return(_?-1:1)*o*Math.pow(2,s-n)},sg=function(t,e,r,n,i,s){var o,c,u,f=s*8-i-1,g=(1<<f)-1,h=g>>1,v=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,_=n?0:s-1,m=n?1:-1,y=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,o=g):(o=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-o))<1&&(o--,u*=2),o+h>=1?e+=v/u:e+=v*Math.pow(2,1-h),e*u>=2&&(o++,u/=2),o+h>=g?(c=0,o=g):o+h>=1?(c=(e*u-1)*Math.pow(2,i),o=o+h):(c=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[r+_]=c&255,_+=m,c/=256,i-=8);for(o=o<<i|c,f+=i;f>0;t[r+_]=o&255,_+=m,o/=256,f-=8);t[r+_-m]|=y*128},ui={read:og,write:sg},Ts=qh(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=O,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function i(){try{var a=new Uint8Array(1),l={foo:function(){return 42}};return Object.setPrototypeOf(l,Uint8Array.prototype),Object.setPrototypeOf(a,l),a.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}});function s(a){if(a>n)throw new RangeError('The value "'+a+'" is invalid for option "size"');var l=new Uint8Array(a);return Object.setPrototypeOf(l,o.prototype),l}function o(a,l,p){if(typeof a=="number"){if(typeof l=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(a)}return c(a,l,p)}o.poolSize=8192;function c(a,l,p){if(typeof a=="string")return h(a,l);if(ArrayBuffer.isView(a))return _(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a));if(Pe(a,ArrayBuffer)||a&&Pe(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Pe(a,SharedArrayBuffer)||a&&Pe(a.buffer,SharedArrayBuffer)))return m(a,l,p);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var I=a.valueOf&&a.valueOf();if(I!=null&&I!==a)return o.from(I,l,p);var N=y(a);if(N)return N;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return o.from(a[Symbol.toPrimitive]("string"),l,p);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a))}o.from=function(a,l,p){return c(a,l,p)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function u(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function f(a,l,p){return u(a),a<=0?s(a):l!==void 0?typeof p=="string"?s(a).fill(l,p):s(a).fill(l):s(a)}o.alloc=function(a,l,p){return f(a,l,p)};function g(a){return u(a),s(a<0?0:T(a)|0)}o.allocUnsafe=function(a){return g(a)},o.allocUnsafeSlow=function(a){return g(a)};function h(a,l){if((typeof l!="string"||l==="")&&(l="utf8"),!o.isEncoding(l))throw new TypeError("Unknown encoding: "+l);var p=H(a,l)|0,I=s(p),N=I.write(a,l);return N!==p&&(I=I.slice(0,N)),I}function v(a){for(var l=a.length<0?0:T(a.length)|0,p=s(l),I=0;I<l;I+=1)p[I]=a[I]&255;return p}function _(a){if(Pe(a,Uint8Array)){var l=new Uint8Array(a);return m(l.buffer,l.byteOffset,l.byteLength)}return v(a)}function m(a,l,p){if(l<0||a.byteLength<l)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<l+(p||0))throw new RangeError('"length" is outside of buffer bounds');var I;return l===void 0&&p===void 0?I=new Uint8Array(a):p===void 0?I=new Uint8Array(a,l):I=new Uint8Array(a,l,p),Object.setPrototypeOf(I,o.prototype),I}function y(a){if(o.isBuffer(a)){var l=T(a.length)|0,p=s(l);return p.length===0||a.copy(p,0,0,l),p}if(a.length!==void 0)return typeof a.length!="number"||$r(a.length)?s(0):v(a);if(a.type==="Buffer"&&Array.isArray(a.data))return v(a.data)}function T(a){if(a>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return a|0}function O(a){return+a!=a&&(a=0),o.alloc(+a)}o.isBuffer=function(a){return a!=null&&a._isBuffer===!0&&a!==o.prototype},o.compare=function(a,l){if(Pe(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),Pe(l,Uint8Array)&&(l=o.from(l,l.offset,l.byteLength)),!o.isBuffer(a)||!o.isBuffer(l))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(a===l)return 0;for(var p=a.length,I=l.length,N=0,L=Math.min(p,I);N<L;++N)if(a[N]!==l[N]){p=a[N],I=l[N];break}return p<I?-1:I<p?1:0},o.isEncoding=function(a){switch(String(a).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(a,l){if(!Array.isArray(a))throw new TypeError('"list" argument must be an Array of Buffers');if(a.length===0)return o.alloc(0);var p;if(l===void 0)for(l=0,p=0;p<a.length;++p)l+=a[p].length;var I=o.allocUnsafe(l),N=0;for(p=0;p<a.length;++p){var L=a[p];if(Pe(L,Uint8Array))N+L.length>I.length?o.from(L).copy(I,N):Uint8Array.prototype.set.call(I,L,N);else if(o.isBuffer(L))L.copy(I,N);else throw new TypeError('"list" argument must be an Array of Buffers');N+=L.length}return I};function H(a,l){if(o.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||Pe(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(a));var p=a.length,I=arguments.length>2&&arguments[2]===!0;if(!I&&p===0)return 0;for(var N=!1;;)switch(l){case"ascii":case"latin1":case"binary":return p;case"utf8":case"utf-8":return kn(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return p*2;case"hex":return p>>>1;case"base64":return ji(a).length;default:if(N)return I?-1:kn(a).length;l=(""+l).toLowerCase(),N=!0}}o.byteLength=H;function R(a,l,p){var I=!1;if((l===void 0||l<0)&&(l=0),l>this.length||((p===void 0||p>this.length)&&(p=this.length),p<=0)||(p>>>=0,l>>>=0,p<=l))return"";for(a||(a="utf8");;)switch(a){case"hex":return Te(this,l,p);case"utf8":case"utf-8":return me(this,l,p);case"ascii":return be(this,l,p);case"latin1":case"binary":return Bt(this,l,p);case"base64":return Jt(this,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return pt(this,l,p);default:if(I)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),I=!0}}o.prototype._isBuffer=!0;function k(a,l,p){var I=a[l];a[l]=a[p],a[p]=I}o.prototype.swap16=function(){var a=this.length;if(a%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var l=0;l<a;l+=2)k(this,l,l+1);return this},o.prototype.swap32=function(){var a=this.length;if(a%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var l=0;l<a;l+=4)k(this,l,l+3),k(this,l+1,l+2);return this},o.prototype.swap64=function(){var a=this.length;if(a%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var l=0;l<a;l+=8)k(this,l,l+7),k(this,l+1,l+6),k(this,l+2,l+5),k(this,l+3,l+4);return this},o.prototype.toString=function(){var a=this.length;return a===0?"":arguments.length===0?me(this,0,a):R.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(a){if(!o.isBuffer(a))throw new TypeError("Argument must be a Buffer");return this===a?!0:o.compare(this,a)===0},o.prototype.inspect=function(){var a="",l=e.INSPECT_MAX_BYTES;return a=this.toString("hex",0,l).replace(/(.{2})/g,"$1 ").trim(),this.length>l&&(a+=" ... "),"<Buffer "+a+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(a,l,p,I,N){if(Pe(a,Uint8Array)&&(a=o.from(a,a.offset,a.byteLength)),!o.isBuffer(a))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(a));if(l===void 0&&(l=0),p===void 0&&(p=a?a.length:0),I===void 0&&(I=0),N===void 0&&(N=this.length),l<0||p>a.length||I<0||N>this.length)throw new RangeError("out of range index");if(I>=N&&l>=p)return 0;if(I>=N)return-1;if(l>=p)return 1;if(l>>>=0,p>>>=0,I>>>=0,N>>>=0,this===a)return 0;for(var L=N-I,W=p-l,te=Math.min(L,W),St=this.slice(I,N),Ct=a.slice(l,p),le=0;le<te;++le)if(St[le]!==Ct[le]){L=St[le],W=Ct[le];break}return L<W?-1:W<L?1:0};function V(a,l,p,I,N){if(a.length===0)return-1;if(typeof p=="string"?(I=p,p=0):p>2147483647?p=2147483647:p<-2147483648&&(p=-2147483648),p=+p,$r(p)&&(p=N?0:a.length-1),p<0&&(p=a.length+p),p>=a.length){if(N)return-1;p=a.length-1}else if(p<0)if(N)p=0;else return-1;if(typeof l=="string"&&(l=o.from(l,I)),o.isBuffer(l))return l.length===0?-1:Ut(a,l,p,I,N);if(typeof l=="number")return l=l&255,typeof Uint8Array.prototype.indexOf=="function"?N?Uint8Array.prototype.indexOf.call(a,l,p):Uint8Array.prototype.lastIndexOf.call(a,l,p):Ut(a,[l],p,I,N);throw new TypeError("val must be string, number or Buffer")}function Ut(a,l,p,I,N){var L=1,W=a.length,te=l.length;if(I!==void 0&&(I=String(I).toLowerCase(),I==="ucs2"||I==="ucs-2"||I==="utf16le"||I==="utf-16le")){if(a.length<2||l.length<2)return-1;L=2,W/=2,te/=2,p/=2}function St(X,ie){return L===1?X[ie]:X.readUInt16BE(ie*L)}var Ct;if(N){var le=-1;for(Ct=p;Ct<W;Ct++)if(St(a,Ct)===St(l,le===-1?0:Ct-le)){if(le===-1&&(le=Ct),Ct-le+1===te)return le*L}else le!==-1&&(Ct-=Ct-le),le=-1}else for(p+te>W&&(p=W-te),Ct=p;Ct>=0;Ct--){for(var z=!0,ft=0;ft<te;ft++)if(St(a,Ct+ft)!==St(l,ft)){z=!1;break}if(z)return Ct}return-1}o.prototype.includes=function(a,l,p){return this.indexOf(a,l,p)!==-1},o.prototype.indexOf=function(a,l,p){return V(this,a,l,p,!0)},o.prototype.lastIndexOf=function(a,l,p){return V(this,a,l,p,!1)};function de(a,l,p,I){p=Number(p)||0;var N=a.length-p;I?(I=Number(I),I>N&&(I=N)):I=N;var L=l.length;I>L/2&&(I=L/2);for(var W=0;W<I;++W){var te=parseInt(l.substr(W*2,2),16);if($r(te))return W;a[p+W]=te}return W}function j(a,l,p,I){return Mn(kn(l,a.length-p),a,p,I)}function ot(a,l,p,I){return Mn(Hi(l),a,p,I)}function Y(a,l,p,I){return Mn(ji(l),a,p,I)}function st(a,l,p,I){return Mn(Wi(l,a.length-p),a,p,I)}o.prototype.write=function(a,l,p,I){if(l===void 0)I="utf8",p=this.length,l=0;else if(p===void 0&&typeof l=="string")I=l,p=this.length,l=0;else if(isFinite(l))l=l>>>0,isFinite(p)?(p=p>>>0,I===void 0&&(I="utf8")):(I=p,p=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var N=this.length-l;if((p===void 0||p>N)&&(p=N),a.length>0&&(p<0||l<0)||l>this.length)throw new RangeError("Attempt to write outside buffer bounds");I||(I="utf8");for(var L=!1;;)switch(I){case"hex":return de(this,a,l,p);case"utf8":case"utf-8":return j(this,a,l,p);case"ascii":case"latin1":case"binary":return ot(this,a,l,p);case"base64":return Y(this,a,l,p);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return st(this,a,l,p);default:if(L)throw new TypeError("Unknown encoding: "+I);I=(""+I).toLowerCase(),L=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Jt(a,l,p){return l===0&&p===a.length?sl.fromByteArray(a):sl.fromByteArray(a.slice(l,p))}function me(a,l,p){p=Math.min(a.length,p);for(var I=[],N=l;N<p;){var L=a[N],W=null,te=L>239?4:L>223?3:L>191?2:1;if(N+te<=p){var St,Ct,le,z;switch(te){case 1:L<128&&(W=L);break;case 2:St=a[N+1],(St&192)===128&&(z=(L&31)<<6|St&63,z>127&&(W=z));break;case 3:St=a[N+1],Ct=a[N+2],(St&192)===128&&(Ct&192)===128&&(z=(L&15)<<12|(St&63)<<6|Ct&63,z>2047&&(z<55296||z>57343)&&(W=z));break;case 4:St=a[N+1],Ct=a[N+2],le=a[N+3],(St&192)===128&&(Ct&192)===128&&(le&192)===128&&(z=(L&15)<<18|(St&63)<<12|(Ct&63)<<6|le&63,z>65535&&z<1114112&&(W=z))}}W===null?(W=65533,te=1):W>65535&&(W-=65536,I.push(W>>>10&1023|55296),W=56320|W&1023),I.push(W),N+=te}return Ce(I)}var pe=4096;function Ce(a){var l=a.length;if(l<=pe)return String.fromCharCode.apply(String,a);for(var p="",I=0;I<l;)p+=String.fromCharCode.apply(String,a.slice(I,I+=pe));return p}function be(a,l,p){var I="";p=Math.min(a.length,p);for(var N=l;N<p;++N)I+=String.fromCharCode(a[N]&127);return I}function Bt(a,l,p){var I="";p=Math.min(a.length,p);for(var N=l;N<p;++N)I+=String.fromCharCode(a[N]);return I}function Te(a,l,p){var I=a.length;(!l||l<0)&&(l=0),(!p||p<0||p>I)&&(p=I);for(var N="",L=l;L<p;++L)N+=rs[a[L]];return N}function pt(a,l,p){for(var I=a.slice(l,p),N="",L=0;L<I.length-1;L+=2)N+=String.fromCharCode(I[L]+I[L+1]*256);return N}o.prototype.slice=function(a,l){var p=this.length;a=~~a,l=l===void 0?p:~~l,a<0?(a+=p,a<0&&(a=0)):a>p&&(a=p),l<0?(l+=p,l<0&&(l=0)):l>p&&(l=p),l<a&&(l=a);var I=this.subarray(a,l);return Object.setPrototypeOf(I,o.prototype),I};function Q(a,l,p){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+l>p)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUintLE=o.prototype.readUIntLE=function(a,l,p){a=a>>>0,l=l>>>0,p||Q(a,l,this.length);for(var I=this[a],N=1,L=0;++L<l&&(N*=256);)I+=this[a+L]*N;return I},o.prototype.readUintBE=o.prototype.readUIntBE=function(a,l,p){a=a>>>0,l=l>>>0,p||Q(a,l,this.length);for(var I=this[a+--l],N=1;l>0&&(N*=256);)I+=this[a+--l]*N;return I},o.prototype.readUint8=o.prototype.readUInt8=function(a,l){return a=a>>>0,l||Q(a,1,this.length),this[a]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(a,l){return a=a>>>0,l||Q(a,2,this.length),this[a]|this[a+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(a,l){return a=a>>>0,l||Q(a,2,this.length),this[a]<<8|this[a+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),(this[a]|this[a+1]<<8|this[a+2]<<16)+this[a+3]*16777216},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),this[a]*16777216+(this[a+1]<<16|this[a+2]<<8|this[a+3])},o.prototype.readIntLE=function(a,l,p){a=a>>>0,l=l>>>0,p||Q(a,l,this.length);for(var I=this[a],N=1,L=0;++L<l&&(N*=256);)I+=this[a+L]*N;return N*=128,I>=N&&(I-=Math.pow(2,8*l)),I},o.prototype.readIntBE=function(a,l,p){a=a>>>0,l=l>>>0,p||Q(a,l,this.length);for(var I=l,N=1,L=this[a+--I];I>0&&(N*=256);)L+=this[a+--I]*N;return N*=128,L>=N&&(L-=Math.pow(2,8*l)),L},o.prototype.readInt8=function(a,l){return a=a>>>0,l||Q(a,1,this.length),this[a]&128?(255-this[a]+1)*-1:this[a]},o.prototype.readInt16LE=function(a,l){a=a>>>0,l||Q(a,2,this.length);var p=this[a]|this[a+1]<<8;return p&32768?p|4294901760:p},o.prototype.readInt16BE=function(a,l){a=a>>>0,l||Q(a,2,this.length);var p=this[a+1]|this[a]<<8;return p&32768?p|4294901760:p},o.prototype.readInt32LE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),this[a]|this[a+1]<<8|this[a+2]<<16|this[a+3]<<24},o.prototype.readInt32BE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),this[a]<<24|this[a+1]<<16|this[a+2]<<8|this[a+3]},o.prototype.readFloatLE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),ui.read(this,a,!0,23,4)},o.prototype.readFloatBE=function(a,l){return a=a>>>0,l||Q(a,4,this.length),ui.read(this,a,!1,23,4)},o.prototype.readDoubleLE=function(a,l){return a=a>>>0,l||Q(a,8,this.length),ui.read(this,a,!0,52,8)},o.prototype.readDoubleBE=function(a,l){return a=a>>>0,l||Q(a,8,this.length),ui.read(this,a,!1,52,8)};function we(a,l,p,I,N,L){if(!o.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(l>N||l<L)throw new RangeError('"value" argument is out of bounds');if(p+I>a.length)throw new RangeError("Index out of range")}o.prototype.writeUintLE=o.prototype.writeUIntLE=function(a,l,p,I){if(a=+a,l=l>>>0,p=p>>>0,!I){var N=Math.pow(2,8*p)-1;we(this,a,l,p,N,0)}var L=1,W=0;for(this[l]=a&255;++W<p&&(L*=256);)this[l+W]=a/L&255;return l+p},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(a,l,p,I){if(a=+a,l=l>>>0,p=p>>>0,!I){var N=Math.pow(2,8*p)-1;we(this,a,l,p,N,0)}var L=p-1,W=1;for(this[l+L]=a&255;--L>=0&&(W*=256);)this[l+L]=a/W&255;return l+p},o.prototype.writeUint8=o.prototype.writeUInt8=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,1,255,0),this[l]=a&255,l+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,2,65535,0),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,2,65535,0),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,4,4294967295,0),this[l+3]=a>>>24,this[l+2]=a>>>16,this[l+1]=a>>>8,this[l]=a&255,l+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,4,4294967295,0),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4},o.prototype.writeIntLE=function(a,l,p,I){if(a=+a,l=l>>>0,!I){var N=Math.pow(2,8*p-1);we(this,a,l,p,N-1,-N)}var L=0,W=1,te=0;for(this[l]=a&255;++L<p&&(W*=256);)a<0&&te===0&&this[l+L-1]!==0&&(te=1),this[l+L]=(a/W>>0)-te&255;return l+p},o.prototype.writeIntBE=function(a,l,p,I){if(a=+a,l=l>>>0,!I){var N=Math.pow(2,8*p-1);we(this,a,l,p,N-1,-N)}var L=p-1,W=1,te=0;for(this[l+L]=a&255;--L>=0&&(W*=256);)a<0&&te===0&&this[l+L+1]!==0&&(te=1),this[l+L]=(a/W>>0)-te&255;return l+p},o.prototype.writeInt8=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,1,127,-128),a<0&&(a=255+a+1),this[l]=a&255,l+1},o.prototype.writeInt16LE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,2,32767,-32768),this[l]=a&255,this[l+1]=a>>>8,l+2},o.prototype.writeInt16BE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,2,32767,-32768),this[l]=a>>>8,this[l+1]=a&255,l+2},o.prototype.writeInt32LE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,4,2147483647,-2147483648),this[l]=a&255,this[l+1]=a>>>8,this[l+2]=a>>>16,this[l+3]=a>>>24,l+4},o.prototype.writeInt32BE=function(a,l,p){return a=+a,l=l>>>0,p||we(this,a,l,4,2147483647,-2147483648),a<0&&(a=4294967295+a+1),this[l]=a>>>24,this[l+1]=a>>>16,this[l+2]=a>>>8,this[l+3]=a&255,l+4};function ar(a,l,p,I,N,L){if(p+I>a.length)throw new RangeError("Index out of range");if(p<0)throw new RangeError("Index out of range")}function jr(a,l,p,I,N){return l=+l,p=p>>>0,N||ar(a,l,p,4),ui.write(a,l,p,I,23,4),p+4}o.prototype.writeFloatLE=function(a,l,p){return jr(this,a,l,!0,p)},o.prototype.writeFloatBE=function(a,l,p){return jr(this,a,l,!1,p)};function ke(a,l,p,I,N){return l=+l,p=p>>>0,N||ar(a,l,p,8),ui.write(a,l,p,I,52,8),p+8}o.prototype.writeDoubleLE=function(a,l,p){return ke(this,a,l,!0,p)},o.prototype.writeDoubleBE=function(a,l,p){return ke(this,a,l,!1,p)},o.prototype.copy=function(a,l,p,I){if(!o.isBuffer(a))throw new TypeError("argument should be a Buffer");if(p||(p=0),!I&&I!==0&&(I=this.length),l>=a.length&&(l=a.length),l||(l=0),I>0&&I<p&&(I=p),I===p||a.length===0||this.length===0)return 0;if(l<0)throw new RangeError("targetStart out of bounds");if(p<0||p>=this.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("sourceEnd out of bounds");I>this.length&&(I=this.length),a.length-l<I-p&&(I=a.length-l+p);var N=I-p;return this===a&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(l,p,I):Uint8Array.prototype.set.call(a,this.subarray(p,I),l),N},o.prototype.fill=function(a,l,p,I){if(typeof a=="string"){if(typeof l=="string"?(I=l,l=0,p=this.length):typeof p=="string"&&(I=p,p=this.length),I!==void 0&&typeof I!="string")throw new TypeError("encoding must be a string");if(typeof I=="string"&&!o.isEncoding(I))throw new TypeError("Unknown encoding: "+I);if(a.length===1){var N=a.charCodeAt(0);(I==="utf8"&&N<128||I==="latin1")&&(a=N)}}else typeof a=="number"?a=a&255:typeof a=="boolean"&&(a=Number(a));if(l<0||this.length<l||this.length<p)throw new RangeError("Out of range index");if(p<=l)return this;l=l>>>0,p=p===void 0?this.length:p>>>0,a||(a=0);var L;if(typeof a=="number")for(L=l;L<p;++L)this[L]=a;else{var W=o.isBuffer(a)?a:o.from(a,I),te=W.length;if(te===0)throw new TypeError('The value "'+a+'" is invalid for argument "value"');for(L=0;L<p-l;++L)this[L+l]=W[L%te]}return this};var en=/[^+/0-9A-Za-z-_]/g;function Hn(a){if(a=a.split("=")[0],a=a.trim().replace(en,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function kn(a,l){l=l||1/0;for(var p,I=a.length,N=null,L=[],W=0;W<I;++W){if(p=a.charCodeAt(W),p>55295&&p<57344){if(!N){if(p>56319){(l-=3)>-1&&L.push(239,191,189);continue}else if(W+1===I){(l-=3)>-1&&L.push(239,191,189);continue}N=p;continue}if(p<56320){(l-=3)>-1&&L.push(239,191,189),N=p;continue}p=(N-55296<<10|p-56320)+65536}else N&&(l-=3)>-1&&L.push(239,191,189);if(N=null,p<128){if((l-=1)<0)break;L.push(p)}else if(p<2048){if((l-=2)<0)break;L.push(p>>6|192,p&63|128)}else if(p<65536){if((l-=3)<0)break;L.push(p>>12|224,p>>6&63|128,p&63|128)}else if(p<1114112){if((l-=4)<0)break;L.push(p>>18|240,p>>12&63|128,p>>6&63|128,p&63|128)}else throw new Error("Invalid code point")}return L}function Hi(a){for(var l=[],p=0;p<a.length;++p)l.push(a.charCodeAt(p)&255);return l}function Wi(a,l){for(var p,I,N,L=[],W=0;W<a.length&&!((l-=2)<0);++W)p=a.charCodeAt(W),I=p>>8,N=p%256,L.push(N),L.push(I);return L}function ji(a){return sl.toByteArray(Hn(a))}function Mn(a,l,p,I){for(var N=0;N<I&&!(N+p>=l.length||N>=a.length);++N)l[N+p]=a[N];return N}function Pe(a,l){return a instanceof l||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===l.name}function $r(a){return a!==a}var rs=function(){for(var a="0123456789abcdef",l=new Array(256),p=0;p<16;++p)for(var I=p*16,N=0;N<16;++N)l[I+N]=a[p]+a[N];return l}()}),Ee=Ts.Buffer;Ts.SlowBuffer;Ts.INSPECT_MAX_BYTES;Ts.kMaxLength;var pl=function(t,e){return pl=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},pl(t,e)};function xs(t,e){pl(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var mn=function(t){xs(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e}(Error),Fe=function(t){xs(e,t);function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e}(TypeError);function ws(t){return t&&t.Math==Math&&t}function of(){return ws(typeof globalThis=="object"&&globalThis)||ws(typeof window=="object"&&window)||ws(typeof self=="object"&&self)||ws(typeof global=="object"&&global)||Function("return this")()}function ag(){var t=of();return typeof t.navigator=="object"&&t.navigator.product==="ReactNative"}var cg=function(t){var e=ag()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(e);for(var r=Ee.alloc(t),n=0;n<t;++n)r[n]=Math.floor(Math.random()*256);return r},lg=function(){{if(typeof window<"u"){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(Ee.alloc(e))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(e){return global.crypto.getRandomValues(Ee.alloc(e))}:cg}},sf=lg();function ug(t){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(t))}function ml(t){return Object.prototype.toString.call(t)==="[object Uint8Array]"}function pg(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function fg(t){return uo(t)&&Object.prototype.toString.call(t)==="[object Date]"}function uo(t){return typeof t=="object"&&t!==null}function Cs(t,e){var r=!1;function n(){for(var i=[],s=0;s<arguments.length;s++)i[s]=arguments[s];return r||(console.warn(e),r=!0),t.apply(this,i)}return n}function Is(t){if(ArrayBuffer.isView(t))return Ee.from(t.buffer,t.byteOffset,t.byteLength);if(ug(t))return Ee.from(t);throw new Fe("Must use either Buffer or TypedArray")}var mg=/^(?:[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,af=function(t){return typeof t=="string"&&mg.test(t)},fl=function(t){if(!af(t))throw new Fe('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 Ee.from(e,"hex")},jp=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")},eI=Math.pow(2,63)-1,tI=-Math.pow(2,63),dg=Math.pow(2,53),hg=-Math.pow(2,53),cf=4,dn=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(e!=null&&typeof e!="string"&&!ArrayBuffer.isView(e)&&!(e instanceof ArrayBuffer)&&!Array.isArray(e))throw new Fe("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??t.BSON_BINARY_SUBTYPE_DEFAULT,e==null?(this.buffer=Ee.alloc(t.BUFFER_SIZE),this.position=0):(typeof e=="string"?this.buffer=Ee.from(e,"binary"):Array.isArray(e)?this.buffer=Ee.from(e):this.buffer=Is(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if(typeof e=="string"&&e.length!==1)throw new Fe("only accepts single character String");if(typeof e!="number"&&e.length!==1)throw new Fe("only accepts single character Uint8Array or Array");var r;if(typeof e=="string"?r=e.charCodeAt(0):typeof e=="number"?r=e:r=e[0],r<0||r>255)throw new Fe("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=Ee.alloc(t.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},t.prototype.write=function(e,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+e.length){var n=Ee.alloc(this.buffer.length+e.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n}ArrayBuffer.isView(e)?(this.buffer.set(Is(e),r),this.position=r+e.byteLength>this.position?r+e.length:this.position):typeof e=="string"&&(this.buffer.write(e,r,e.length,"binary"),this.position=r+e.length>this.position?r+e.length:this.position)},t.prototype.read=function(e,r){return r=r&&r>0?r:this.position,this.buffer.slice(e,e+r)},t.prototype.value=function(e){return e=!!e,e&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},t.prototype.length=function(){return this.position},t.prototype.toJSON=function(){return this.buffer.toString("base64")},t.prototype.toString=function(e){return this.buffer.toString(e)},t.prototype.toExtendedJSON=function(e){e=e||{};var r=this.buffer.toString("base64"),n=Number(this.sub_type).toString(16);return e.legacy?{$binary:r,$type:n.length===1?"0"+n:n}:{$binary:{base64:r,subType:n.length===1?"0"+n:n}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new Wp(this.buffer.slice(0,this.position));throw new mn('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(t.SUBTYPE_UUID,'" is currently supported.'))},t.fromExtendedJSON=function(e,r){r=r||{};var n,i;if("$binary"in e?r.legacy&&typeof e.$binary=="string"&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,n=Ee.from(e.$binary,"base64")):typeof e.$binary!="string"&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=Ee.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,n=fl(e.$uuid)),!n)throw new Fe("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return i===cf?new Wp(n):new t(n,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},t.BSON_BINARY_SUBTYPE_DEFAULT=0,t.BUFFER_SIZE=256,t.SUBTYPE_DEFAULT=0,t.SUBTYPE_FUNCTION=1,t.SUBTYPE_BYTE_ARRAY=2,t.SUBTYPE_UUID_OLD=3,t.SUBTYPE_UUID=4,t.SUBTYPE_MD5=5,t.SUBTYPE_ENCRYPTED=6,t.SUBTYPE_COLUMN=7,t.SUBTYPE_USER_DEFINED=128,t}();Object.defineProperty(dn.prototype,"_bsontype",{value:"Binary"});var al=16,Wp=function(t){xs(e,t);function e(r){var n=this,i,s;if(r==null)i=e.generate();else if(r instanceof e)i=Ee.from(r.buffer),s=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===al)i=Is(r);else if(typeof r=="string")i=fl(r);else throw new Fe("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return n=t.call(this,i,cf)||this,n.__id=s,n}return Object.defineProperty(e.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,e.cacheHexString&&(this.__id=jp(r))},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(r){if(r===void 0&&(r=!0),e.cacheHexString&&this.__id)return this.__id;var n=jp(this.id,r);return e.cacheHexString&&(this.__id=n),n},e.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(r){if(!r)return!1;if(r instanceof e)return r.id.equals(this.id);try{return new e(r).id.equals(this.id)}catch{return!1}},e.prototype.toBinary=function(){return new dn(this.id,dn.SUBTYPE_UUID)},e.generate=function(){var r=sf(al);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,Ee.from(r)},e.isValid=function(r){return r?r instanceof e?!0:typeof r=="string"?af(r):ml(r)?r.length!==al?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},e.createFromHexString=function(r){var n=fl(r);return new e(n)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},e}(dn),Ds=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);this.code=e,this.scope=r}return t.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},t.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},t.fromExtendedJSON=function(e){return new t(e.$code,e.$scope)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},t}();Object.defineProperty(Ds.prototype,"_bsontype",{value:"Code"});function gg(t){return uo(t)&&t.$id!=null&&typeof t.$ref=="string"&&(t.$db==null||typeof t.$db=="string")}var co=function(){function t(e,r,n,i){if(!(this instanceof t))return new t(e,r,n,i);var s=e.split(".");s.length===2&&(n=s.shift(),e=s.shift()),this.collection=e,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(t.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(e.$db=this.db),e},t.prototype.toExtendedJSON=function(e){e=e||{};var r={$ref:this.collection,$id:this.oid};return e.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},t.fromExtendedJSON=function(e){var r=Object.assign({},e);return delete r.$ref,delete r.$id,delete r.$db,new t(e.$ref,e.$id,e.$db,r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t}();Object.defineProperty(co.prototype,"_bsontype",{value:"DBRef"});var Ft=void 0;try{Ft=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 Gp=65536,yg=1<<24,fi=Gp*Gp,lf=fi*fi,Vp=lf/2,zp={},Yp={},K=function(){function t(e,r,n){if(e===void 0&&(e=0),!(this instanceof t))return new t(e,r,n);typeof e=="bigint"?Object.assign(this,t.fromBigInt(e,!!r)):typeof e=="string"?Object.assign(this,t.fromString(e,!!r)):(this.low=e|0,this.high=r|0,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return t.fromBits=function(e,r,n){return new t(e,r,n)},t.fromInt=function(e,r){var n,i,s;return r?(e>>>=0,(s=0<=e&&e<256)&&(i=Yp[e],i)?i:(n=t.fromBits(e,(e|0)<0?-1:0,!0),s&&(Yp[e]=n),n)):(e|=0,(s=-128<=e&&e<128)&&(i=zp[e],i)?i:(n=t.fromBits(e,e<0?-1:0,!1),s&&(zp[e]=n),n))},t.fromNumber=function(e,r){if(isNaN(e))return r?t.UZERO:t.ZERO;if(r){if(e<0)return t.UZERO;if(e>=lf)return t.MAX_UNSIGNED_VALUE}else{if(e<=-Vp)return t.MIN_VALUE;if(e+1>=Vp)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%fi|0,e/fi|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(e.length===0)throw Error("empty string");if(e==="NaN"||e==="Infinity"||e==="+Infinity"||e==="-Infinity")return t.ZERO;if(typeof r=="number"?(n=r,r=!1):r=!!r,n=n||10,n<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(i===0)return t.fromString(e.substring(1),r,n).neg();for(var s=t.fromNumber(Math.pow(n,8)),o=t.ZERO,c=0;c<e.length;c+=8){var u=Math.min(8,e.length-c),f=parseInt(e.substring(c,c+u),n);if(u<8){var g=t.fromNumber(Math.pow(n,u));o=o.mul(g).add(t.fromNumber(f))}else o=o.mul(s),o=o.add(t.fromNumber(f))}return o.unsigned=r,o},t.fromBytes=function(e,r,n){return n?t.fromBytesLE(e,r):t.fromBytesBE(e,r)},t.fromBytesLE=function(e,r){return new t(e[0]|e[1]<<8|e[2]<<16|e[3]<<24,e[4]|e[5]<<8|e[6]<<16|e[7]<<24,r)},t.fromBytesBE=function(e,r){return new t(e[4]<<24|e[5]<<16|e[6]<<8|e[7],e[0]<<24|e[1]<<16|e[2]<<8|e[3],r)},t.isLong=function(e){return uo(e)&&e.__isLong__===!0},t.fromValue=function(e,r){return typeof e=="number"?t.fromNumber(e,r):typeof e=="string"?t.fromString(e,r):t.fromBits(e.low,e.high,typeof r=="boolean"?r:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var r=this.high>>>16,n=this.high&65535,i=this.low>>>16,s=this.low&65535,o=e.high>>>16,c=e.high&65535,u=e.low>>>16,f=e.low&65535,g=0,h=0,v=0,_=0;return _+=s+f,v+=_>>>16,_&=65535,v+=i+u,h+=v>>>16,v&=65535,h+=n+c,g+=h>>>16,h&=65535,g+=r+o,g&=65535,t.fromBits(v<<16|_,g<<16|h,this.unsigned)},t.prototype.and=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low&e.low,this.high&e.high,this.unsigned)},t.prototype.compare=function(e){if(t.isLong(e)||(e=t.fromValue(e)),this.eq(e))return 0;var r=this.isNegative(),n=e.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?e.high>>>0>this.high>>>0||e.high===this.high&&e.low>>>0>this.low>>>0?-1:1:this.sub(e).isNegative()?-1:1},t.prototype.comp=function(e){return this.compare(e)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(Ft){if(!this.unsigned&&this.high===-2147483648&&e.low===-1&&e.high===-1)return this;var r=(this.unsigned?Ft.div_u:Ft.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,Ft.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,i,s;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;s=t.UZERO}else{if(this.eq(t.MIN_VALUE)){if(e.eq(t.ONE)||e.eq(t.NEG_ONE))return t.MIN_VALUE;if(e.eq(t.MIN_VALUE))return t.ONE;var o=this.shr(1);return n=o.div(e).shl(1),n.eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(n)),s=n.add(i.div(e)),s)}else if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();s=t.ZERO}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var c=Math.ceil(Math.log(n)/Math.LN2),u=c<=48?1:Math.pow(2,c-48),f=t.fromNumber(n),g=f.mul(e);g.isNegative()||g.gt(i);)n-=u,f=t.fromNumber(n,this.unsigned),g=f.mul(e);f.isZero()&&(f=t.ONE),s=s.add(f),i=i.sub(g)}return s},t.prototype.div=function(e){return this.divide(e)},t.prototype.equals=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.unsigned!==e.unsigned&&this.high>>>31===1&&e.high>>>31===1?!1:this.high===e.high&&this.low===e.low},t.prototype.eq=function(e){return this.equals(e)},t.prototype.getHighBits=function(){return this.high},t.prototype.getHighBitsUnsigned=function(){return this.high>>>0},t.prototype.getLowBits=function(){return this.low},t.prototype.getLowBitsUnsigned=function(){return this.low>>>0},t.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(t.MIN_VALUE)?64:this.neg().getNumBitsAbs();var e=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(e&1<<r)===0;r--);return this.high!==0?r+33:r+1},t.prototype.greaterThan=function(e){return this.comp(e)>0},t.prototype.gt=function(e){return this.greaterThan(e)},t.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},t.prototype.gte=function(e){return this.greaterThanOrEqual(e)},t.prototype.ge=function(e){return this.greaterThanOrEqual(e)},t.prototype.isEven=function(){return(this.low&1)===0},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return(this.low&1)===1},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return this.high===0&&this.low===0},t.prototype.lessThan=function(e){return this.comp(e)<0},t.prototype.lt=function(e){return this.lessThan(e)},t.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},t.prototype.lte=function(e){return this.lessThanOrEqual(e)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),Ft){var r=(this.unsigned?Ft.rem_u:Ft.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,Ft.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)),Ft){var r=Ft.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,Ft.get_high(),this.unsigned)}if(e.isZero())return t.ZERO;if(this.eq(t.MIN_VALUE))return e.isOdd()?t.MIN_VALUE:t.ZERO;if(e.eq(t.MIN_VALUE))return this.isOdd()?t.MIN_VALUE:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().mul(e.neg()):this.neg().mul(e).neg();if(e.isNegative())return this.mul(e.neg()).neg();if(this.lt(t.TWO_PWR_24)&&e.lt(t.TWO_PWR_24))return t.fromNumber(this.toNumber()*e.toNumber(),this.unsigned);var n=this.high>>>16,i=this.high&65535,s=this.low>>>16,o=this.low&65535,c=e.high>>>16,u=e.high&65535,f=e.low>>>16,g=e.low&65535,h=0,v=0,_=0,m=0;return m+=o*g,_+=m>>>16,m&=65535,_+=s*g,v+=_>>>16,_&=65535,_+=o*f,v+=_>>>16,_&=65535,v+=i*g,h+=v>>>16,v&=65535,v+=s*f,h+=v>>>16,v&=65535,v+=o*u,h+=v>>>16,v&=65535,h+=n*g+i*f+s*u+o*c,h&=65535,t.fromBits(_<<16|m,h<<16|v,this.unsigned)},t.prototype.mul=function(e){return this.multiply(e)},t.prototype.negate=function(){return!this.unsigned&&this.eq(t.MIN_VALUE)?t.MIN_VALUE:this.not().add(t.ONE)},t.prototype.neg=function(){return this.negate()},t.prototype.not=function(){return t.fromBits(~this.low,~this.high,this.unsigned)},t.prototype.notEquals=function(e){return!this.equals(e)},t.prototype.neq=function(e){return this.notEquals(e)},t.prototype.ne=function(e){return this.notEquals(e)},t.prototype.or=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low|e.low,this.high|e.high,this.unsigned)},t.prototype.shiftLeft=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low<<e,this.high<<e|this.low>>>32-e,this.unsigned):t.fromBits(0,this.low<<e-32,this.unsigned)},t.prototype.shl=function(e){return this.shiftLeft(e)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),(e&=63)===0?this:e<32?t.fromBits(this.low>>>e|this.high<<32-e,this.high>>e,this.unsigned):t.fromBits(this.high>>e-32,this.high>=0?0:-1,this.unsigned)},t.prototype.shr=function(e){return this.shiftRight(e)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),e&=63,e===0)return this;var r=this.high;if(e<32){var n=this.low;return t.fromBits(n>>>e|r<<32-e,r>>>e,this.unsigned)}else return e===32?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},t.prototype.shru=function(e){return this.shiftRightUnsigned(e)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(e){return this.subtract(e)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*fi+(this.low>>>0):this.high*fi+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var e=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,e&255,e>>>8&255,e>>>16&255,e>>>24]},t.prototype.toBytesBE=function(){var e=this.high,r=this.low;return[e>>>24,e>>>16&255,e>>>8&255,e&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if(e=e||10,e<2||36<e)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(t.MIN_VALUE)){var r=t.fromNumber(e),n=this.div(r),i=n.mul(r).sub(this);return n.toString(e)+i.toInt().toString(e)}else return"-"+this.neg().toString(e);for(var s=t.fromNumber(Math.pow(e,6),this.unsigned),o=this,c="";;){var u=o.div(s),f=o.sub(u.mul(s)).toInt()>>>0,g=f.toString(e);if(o=u,o.isZero())return g+c;for(;g.length<6;)g="0"+g;c=""+g+c}},t.prototype.toUnsigned=function(){return this.unsigned?this:t.fromBits(this.low,this.high,!0)},t.prototype.xor=function(e){return t.isLong(e)||(e=t.fromValue(e)),t.fromBits(this.low^e.low,this.high^e.high,this.unsigned)},t.prototype.eqz=function(){return this.isZero()},t.prototype.le=function(e){return this.lessThanOrEqual(e)},t.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},t.fromExtendedJSON=function(e,r){var n=t.fromString(e.$numberLong);return r&&r.relaxed?n.toNumber():n},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},t.TWO_PWR_24=t.fromInt(yg),t.MAX_UNSIGNED_VALUE=t.fromBits(-1,-1,!0),t.ZERO=t.fromInt(0),t.UZERO=t.fromInt(0,!0),t.ONE=t.fromInt(1),t.UONE=t.fromInt(1,!0),t.NEG_ONE=t.fromInt(-1),t.MAX_VALUE=t.fromBits(-1,2147483647,!1),t.MIN_VALUE=t.fromBits(0,-2147483648,!1),t}();Object.defineProperty(K.prototype,"__isLong__",{value:!0});Object.defineProperty(K.prototype,"_bsontype",{value:"Long"});var vg=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,_g=/^(\+|-)?(Infinity|inf)$/i,Eg=/^(\+|-)?NaN$/i,ao=6111,cl=-6176,qp=6176,Sg=34,ll=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Kp=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Jp=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),bg=/^([-+])?(\d+)?$/,wg=31,Xp=16383,Ig=30,Tg=31;function Qp(t){return!isNaN(parseInt(t,10))}function xg(t){var e=K.fromNumber(1e9),r=K.fromNumber(0);if(!t.parts[0]&&!t.parts[1]&&!t.parts[2]&&!t.parts[3])return{quotient:t,rem:r};for(var n=0;n<=3;n++)r=r.shiftLeft(32),r=r.add(new K(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function Cg(t,e){if(!t&&!e)return{high:K.fromNumber(0),low:K.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new K(t.getLowBits(),0),i=e.shiftRightUnsigned(32),s=new K(e.getLowBits(),0),o=r.multiply(i),c=r.multiply(s),u=n.multiply(i),f=n.multiply(s);return o=o.add(c.shiftRightUnsigned(32)),c=new K(c.getLowBits(),0).add(u).add(f.shiftRightUnsigned(32)),o=o.add(c.shiftRightUnsigned(32)),f=c.shiftLeft(32).add(new K(f.getLowBits(),0)),{high:o,low:f}}function Dg(t,e){var r=t.high>>>0,n=e.high>>>0;if(r<n)return!0;if(r===n){var i=t.low>>>0,s=e.low>>>0;if(i<s)return!0}return!1}function pi(t,e){throw new Fe('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var dl=function(){function t(e){if(!(this instanceof t))return new t(e);if(typeof e=="string")this.bytes=t.fromString(e).bytes;else if(ml(e)){if(e.byteLength!==16)throw new Fe("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}else throw new Fe("Decimal128 must take a Buffer or string")}return t.fromString=function(e){var r=!1,n=!1,i=!1,s=0,o=0,c=0,u=0,f=0,g=[0],h=0,v=0,_=0,m=0,y=0,T=0,O=new K(0,0),H=new K(0,0),R=0,k=0;if(e.length>=7e3)throw new Fe(""+e+" not a valid Decimal128 string");var V=e.match(vg),Ut=e.match(_g),de=e.match(Eg);if(!V&&!Ut&&!de||e.length===0)throw new Fe(""+e+" not a valid Decimal128 string");if(V){var j=V[2],ot=V[4],Y=V[5],st=V[6];ot&&st===void 0&&pi(e,"missing exponent power"),ot&&j===void 0&&pi(e,"missing exponent base"),ot===void 0&&(Y||st)&&pi(e,"missing e before exponent")}if((e[k]==="+"||e[k]==="-")&&(r=e[k++]==="-"),!Qp(e[k])&&e[k]!=="."){if(e[k]==="i"||e[k]==="I")return new t(Ee.from(r?Kp:Jp));if(e[k]==="N")return new t(Ee.from(ll))}for(;Qp(e[k])||e[k]===".";){if(e[k]==="."){n&&pi(e,"contains multiple periods"),n=!0,k=k+1;continue}h<34&&(e[k]!=="0"||i)&&(i||(f=o),i=!0,g[v++]=parseInt(e[k],10),h=h+1),i&&(c=c+1),n&&(u=u+1),o=o+1,k=k+1}if(n&&!o)throw new Fe(""+e+" not a valid Decimal128 string");if(e[k]==="e"||e[k]==="E"){var Jt=e.substr(++k).match(bg);if(!Jt||!Jt[2])return new t(Ee.from(ll));y=parseInt(Jt[0],10),k=k+Jt[0].length}if(e[k])return new t(Ee.from(ll));if(_=0,!h)_=0,m=0,g[0]=0,c=1,h=1,s=0;else if(m=h-1,s=c,s!==1)for(;g[f+s-1]===0;)s=s-1;for(y<=u&&u-y>16384?y=cl:y=y-u;y>ao;){if(m=m+1,m-_>Sg){var me=g.join("");if(me.match(/^0+$/)){y=ao;break}pi(e,"overflow")}y=y-1}for(;y<cl||h<c;){if(m===0&&s<h){y=cl,s=0;break}if(h<c?c=c-1:m=m-1,y<ao)y=y+1;else{var me=g.join("");if(me.match(/^0+$/)){y=ao;break}pi(e,"overflow")}}if(m-_+1<s){var pe=o;n&&(f=f+1,pe=pe+1),r&&(f=f+1,pe=pe+1);var Ce=parseInt(e[f+m+1],10),be=0;if(Ce>=5&&(be=1,Ce===5)){for(be=g[m]%2===1?1:0,T=f+m+2;T<pe;T++)if(parseInt(e[T],10)){be=1;break}}if(be){for(var Bt=m;Bt>=0;Bt--)if(++g[Bt]>9&&(g[Bt]=0,Bt===0))if(y<ao)y=y+1,g[Bt]=1;else return new t(Ee.from(r?Kp:Jp))}}if(O=K.fromNumber(0),H=K.fromNumber(0),s===0)O=K.fromNumber(0),H=K.fromNumber(0);else if(m-_<17){var Bt=_;for(H=K.fromNumber(g[Bt++]),O=new K(0,0);Bt<=m;Bt++)H=H.multiply(K.fromNumber(10)),H=H.add(K.fromNumber(g[Bt]))}else{var Bt=_;for(O=K.fromNumber(g[Bt++]);Bt<=m-17;Bt++)O=O.multiply(K.fromNumber(10)),O=O.add(K.fromNumber(g[Bt]));for(H=K.fromNumber(g[Bt++]);Bt<=m;Bt++)H=H.multiply(K.fromNumber(10)),H=H.add(K.fromNumber(g[Bt]))}var Te=Cg(O,K.fromString("100000000000000000"));Te.low=Te.low.add(H),Dg(Te.low,H)&&(Te.high=Te.high.add(K.fromNumber(1))),R=y+qp;var pt={low:K.fromNumber(0),high:K.fromNumber(0)};Te.high.shiftRightUnsigned(49).and(K.fromNumber(1)).equals(K.fromNumber(1))?(pt.high=pt.high.or(K.fromNumber(3).shiftLeft(61)),pt.high=pt.high.or(K.fromNumber(R).and(K.fromNumber(16383).shiftLeft(47))),pt.high=pt.high.or(Te.high.and(K.fromNumber(0x7fffffffffff)))):(pt.high=pt.high.or(K.fromNumber(R&16383).shiftLeft(49)),pt.high=pt.high.or(Te.high.and(K.fromNumber(562949953421311)))),pt.low=Te.low,r&&(pt.high=pt.high.or(K.fromString("9223372036854775808")));var Q=Ee.alloc(16);return k=0,Q[k++]=pt.low.low&255,Q[k++]=pt.low.low>>8&255,Q[k++]=pt.low.low>>16&255,Q[k++]=pt.low.low>>24&255,Q[k++]=pt.low.high&255,Q[k++]=pt.low.high>>8&255,Q[k++]=pt.low.high>>16&255,Q[k++]=pt.low.high>>24&255,Q[k++]=pt.high.low&255,Q[k++]=pt.high.low>>8&255,Q[k++]=pt.high.low>>16&255,Q[k++]=pt.high.low>>24&255,Q[k++]=pt.high.high&255,Q[k++]=pt.high.high>>8&255,Q[k++]=pt.high.high>>16&255,Q[k++]=pt.high.high>>24&255,new t(Q)},t.prototype.toString=function(){for(var e,r=0,n=new Array(36),i=0;i<n.length;i++)n[i]=0;var s=0,o=!1,c,u={parts:[0,0,0,0]},f,g,h=[];s=0;var v=this.bytes,_=v[s++]|v[s++]<<8|v[s++]<<16|v[s++]<<24,m=v[s++]|v[s++]<<8|v[s++]<<16|v[s++]<<24,y=v[s++]|v[s++]<<8|v[s++]<<16|v[s++]<<24,T=v[s++]|v[s++]<<8|v[s++]<<16|v[s++]<<24;s=0;var O={low:new K(_,m),high:new K(y,T)};O.high.lessThan(K.ZERO)&&h.push("-");var H=T>>26&wg;if(H>>3===3){if(H===Ig)return h.join("")+"Infinity";if(H===Tg)return"NaN";e=T>>15&Xp,c=8+(T>>14&1)}else c=T>>14&7,e=T>>17&Xp;var R=e-qp;if(u.parts[0]=(T&16383)+((c&15)<<14),u.parts[1]=y,u.parts[2]=m,u.parts[3]=_,u.parts[0]===0&&u.parts[1]===0&&u.parts[2]===0&&u.parts[3]===0)o=!0;else for(g=3;g>=0;g--){var k=0,V=xg(u);if(u=V.quotient,k=V.rem.low,!!k)for(f=8;f>=0;f--)n[g*9+f]=k%10,k=Math.floor(k/10)}if(o)r=1,n[s]=0;else for(r=36;!n[s];)r=r-1,s=s+1;var Ut=r-1+R;if(Ut>=34||Ut<=-7||R>0){if(r>34)return h.push("".concat(0)),R>0?h.push("E+".concat(R)):R<0&&h.push("E".concat(R)),h.join("");h.push("".concat(n[s++])),r=r-1,r&&h.push(".");for(var i=0;i<r;i++)h.push("".concat(n[s++]));h.push("E"),Ut>0?h.push("+".concat(Ut)):h.push("".concat(Ut))}else if(R>=0)for(var i=0;i<r;i++)h.push("".concat(n[s++]));else{var de=r+R;if(de>0)for(var i=0;i<de;i++)h.push("".concat(n[s++]));else h.push("0");for(h.push(".");de++<0;)h.push("0");for(var i=0;i<r-Math.max(de-1,0);i++)h.push("".concat(n[s++]))}return h.join("")},t.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},t.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},t.fromExtendedJSON=function(e){return t.fromString(e.$numberDecimal)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},t}();Object.defineProperty(dl.prototype,"_bsontype",{value:"Decimal128"});var Rs=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toJSON=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toExtendedJSON=function(e){return e&&(e.legacy||e.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},t.fromExtendedJSON=function(e,r){var n=parseFloat(e.$numberDouble);return r&&r.relaxed?n:new t(n)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var e=this.toExtendedJSON();return"new Double(".concat(e.$numberDouble,")")},t}();Object.defineProperty(Rs.prototype,"_bsontype",{value:"Double"});var Ns=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=+e|0}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(e){return this.value.toString(e)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(e){return e&&(e.relaxed||e.legacy)?this.value:{$numberInt:this.value.toString()}},t.fromExtendedJSON=function(e,r){return r&&r.relaxed?parseInt(e.$numberInt,10):new t(e.$numberInt)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},t}();Object.defineProperty(Ns.prototype,"_bsontype",{value:"Int32"});var hl=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(hl.prototype,"_bsontype",{value:"MaxKey"});var gl=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(gl.prototype,"_bsontype",{value:"MinKey"});var Rg=new RegExp("^[0-9a-fA-F]{24}$"),fn=null,gr=Symbol("id"),Xe=function(){function t(e){if(!(this instanceof t))return new t(e);var r;if(typeof e=="object"&&e&&"id"in e){if(typeof e.id!="string"&&!ArrayBuffer.isView(e.id))throw new Fe("Argument passed in must have an id that is of type string or Buffer");"toHexString"in e&&typeof e.toHexString=="function"?r=Ee.from(e.toHexString(),"hex"):r=e.id}else r=e;if(r==null||typeof r=="number")this[gr]=t.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[gr]=r instanceof Ee?r:Is(r);else if(typeof r=="string")if(r.length===12){var n=Ee.from(r);if(n.byteLength===12)this[gr]=n;else throw new Fe("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&Rg.test(r))this[gr]=Ee.from(r,"hex");else throw new Fe("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new Fe("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[gr]},set:function(e){this[gr]=e,t.cacheHexString&&(this.__id=e.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(e){this.id.writeUInt32BE(e,0)},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(){if(t.cacheHexString&&this.__id)return this.__id;var e=this.id.toString("hex");return t.cacheHexString&&!this.__id&&(this.__id=e),e},t.getInc=function(){return t.index=(t.index+1)%16777215},t.generate=function(e){typeof e!="number"&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=Ee.alloc(12);return n.writeUInt32BE(e,0),fn===null&&(fn=sf(5)),n[4]=fn[0],n[5]=fn[1],n[6]=fn[2],n[7]=fn[3],n[8]=fn[4],n[11]=r&255,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(e==null)return!1;if(e instanceof t)return this[gr][11]===e[gr][11]&&this[gr].equals(e[gr]);if(typeof e=="string"&&t.isValid(e)&&e.length===12&&ml(this.id))return e===Ee.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 Ee.from(e).equals(this.id);if(typeof e=="object"&&"toHexString"in e&&typeof e.toHexString=="function"){var r=e.toHexString(),n=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===n}return!1},t.prototype.getTimestamp=function(){var e=new Date,r=this.id.readUInt32BE(0);return e.setTime(Math.floor(r)*1e3),e},t.createPk=function(){return new t},t.createFromTime=function(e){var r=Ee.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(e,0),new t(r)},t.createFromHexString=function(e){if(typeof e>"u"||e!=null&&e.length!==24)throw new Fe("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(Ee.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(Xe.prototype,"generate",{value:Cs(function(t){return Xe.generate(t)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(Xe.prototype,"getInc",{value:Cs(function(){return Xe.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Xe.prototype,"get_inc",{value:Cs(function(){return Xe.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Xe,"get_inc",{value:Cs(function(){return Xe.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(Xe.prototype,"_bsontype",{value:"ObjectID"});function Ng(t){return t.split("").sort().join("")}var lo=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=Ng(r??""),this.pattern.indexOf("\0")!==-1)throw new mn("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new mn("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if(!(this.options[n]==="i"||this.options[n]==="m"||this.options[n]==="x"||this.options[n]==="l"||this.options[n]==="s"||this.options[n]==="u"))throw new mn("The regular expression option [".concat(this.options[n],"] is not supported"))}return t.parseOptions=function(e){return e?e.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(e){return e=e||{},e.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e)if(typeof e.$regex!="string"){if(e.$regex._bsontype==="BSONRegExp")return e}else return new t(e.$regex,t.parseOptions(e.$options));if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new Fe("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t}();Object.defineProperty(lo.prototype,"_bsontype",{value:"BSONRegExp"});var yl=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(yl.prototype,"_bsontype",{value:"Symbol"});var Ag=K,uf=function(t){xs(e,t);function e(r,n){var i=this;return i instanceof e?(K.isLong(r)?i=t.call(this,r.low,r.high,!0)||this:uo(r)&&typeof r.t<"u"&&typeof r.i<"u"?i=t.call(this,r.i,r.t,!0)||this:i=t.call(this,r,n,!0)||this,Object.defineProperty(i,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),i):new e(r,n)}return e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(r){return new e(K.fromInt(r,!0))},e.fromNumber=function(r){return new e(K.fromNumber(r,!0))},e.fromBits=function(r,n){return new e(r,n)},e.fromString=function(r,n){return new e(K.fromString(r,!0,n))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(r){return new e(r.$timestamp)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},e.MAX_VALUE=K.MAX_UNSIGNED_VALUE,e}(Ag);function Og(t){return uo(t)&&Reflect.has(t,"_bsontype")&&typeof t._bsontype=="string"}var pf=2147483647,ff=-2147483648,mf=9223372036854776e3,df=-9223372036854776e3,Pg={$oid:Xe,$binary:dn,$uuid:dn,$symbol:yl,$numberInt:Ns,$numberDecimal:dl,$numberDouble:Rs,$numberLong:K,$minKey:gl,$maxKey:hl,$regex:lo,$regularExpression:lo,$timestamp:uf};function hf(t,e){if(e===void 0&&(e={}),typeof t=="number"){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=ff&&t<=pf)return new Ns(t);if(t>=df&&t<=mf)return K.fromNumber(t)}return new Rs(t)}if(t==null||typeof t!="object")return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter(function(h){return h.startsWith("$")&&t[h]!=null}),n=0;n<r.length;n++){var i=Pg[r[n]];if(i)return i.fromExtendedJSON(t,e)}if(t.$date!=null){var s=t.$date,o=new Date;return e.legacy?typeof s=="number"?o.setTime(s):typeof s=="string"&&o.setTime(Date.parse(s)):typeof s=="string"?o.setTime(Date.parse(s)):K.isLong(s)?o.setTime(s.toNumber()):typeof s=="number"&&e.relaxed&&o.setTime(s),o}if(t.$code!=null){var c=Object.assign({},t);return t.$scope&&(c.$scope=hf(t.$scope)),Ds.fromExtendedJSON(t)}if(gg(t)||t.$dbPointer){var u=t.$ref?t:t.$dbPointer;if(u instanceof co)return u;var f=Object.keys(u).filter(function(h){return h.startsWith("$")}),g=!0;if(f.forEach(function(h){["$ref","$id","$db"].indexOf(h)===-1&&(g=!1)}),g)return co.fromExtendedJSON(u)}return t}function Lg(t,e){return t.map(function(r,n){e.seenObjects.push({propertyName:"index ".concat(n),obj:null});try{return Jr(r,e)}finally{e.seenObjects.pop()}})}function Zp(t){var e=t.toISOString();return t.getUTCMilliseconds()!==0?e:e.slice(0,-5)+"Z"}function Jr(t,e){if((typeof t=="object"||typeof t=="function")&&t!==null){var r=e.seenObjects.findIndex(function(O){return O.obj===t});if(r!==-1){var n=e.seenObjects.map(function(O){return O.propertyName}),i=n.slice(0,r).map(function(O){return"".concat(O," -> ")}).join(""),s=n[r],o=" -> "+n.slice(r+1,n.length-1).map(function(O){return"".concat(O," -> ")}).join(""),c=n[n.length-1],u=" ".repeat(i.length+s.length/2),f="-".repeat(o.length+(s.length+c.length)/2-1);throw new Fe(`Converting circular structure to EJSON:
|
|
20
20
|
`+" ".concat(i).concat(s).concat(o).concat(c,`
|
|
21
21
|
`)+" ".concat(u,"\\").concat(f,"/"))}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return Lg(t,e);if(t===void 0)return null;if(t instanceof Date||fg(t)){var g=t.getTime(),h=g>-1&&g<2534023188e5;return e.legacy?e.relaxed&&h?{$date:t.getTime()}:{$date:Zp(t)}:e.relaxed&&h?{$date:Zp(t)}:{$date:{$numberLong:t.getTime().toString()}}}if(typeof t=="number"&&(!e.relaxed||!isFinite(t))){if(Math.floor(t)===t){var v=t>=ff&&t<=pf,_=t>=df&&t<=mf;if(v)return{$numberInt:t.toString()};if(_)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||pg(t)){var m=t.flags;if(m===void 0){var y=t.toString().match(/[gimuy]*$/);y&&(m=y[0])}var T=new lo(t.source,m);return T.toExtendedJSON(e)}return t!=null&&typeof t=="object"?Ug(t,e):t}var Bg={Binary:function(t){return new dn(t.value(),t.sub_type)},Code:function(t){return new Ds(t.code,t.scope)},DBRef:function(t){return new co(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new dl(t.bytes)},Double:function(t){return new Rs(t.value)},Int32:function(t){return new Ns(t.value)},Long:function(t){return K.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 hl},MinKey:function(){return new gl},ObjectID:function(t){return new Xe(t)},ObjectId:function(t){return new Xe(t)},BSONRegExp:function(t){return new lo(t.pattern,t.options)},Symbol:function(t){return new yl(t.value)},Timestamp:function(t){return uf.fromBits(t.low,t.high)}};function Ug(t,e){if(t==null||typeof t!="object")throw new mn("not an object instance");var r=t._bsontype;if(typeof r>"u"){var n={};for(var i in t){e.seenObjects.push({propertyName:i,obj:null});try{var s=Jr(t[i],e);i==="__proto__"?Object.defineProperty(n,i,{value:s,writable:!0,enumerable:!0,configurable:!0}):n[i]=s}finally{e.seenObjects.pop()}}return n}else if(Og(t)){var o=t;if(typeof o.toExtendedJSON!="function"){var c=Bg[t._bsontype];if(!c)throw new Fe("Unrecognized or invalid _bsontype: "+t._bsontype);o=c(o)}return r==="Code"&&o.scope?o=new Ds(o.code,Jr(o.scope,e)):r==="DBRef"&&o.oid&&(o=new co(Jr(o.collection,e),Jr(o.oid,e),Jr(o.db,e),Jr(o.fields,e))),o.toExtendedJSON(e)}else throw new mn("_bsontype must be a string, but was: "+typeof r)}var ef;(function(t){function e(s,o){var c=Object.assign({},{relaxed:!0,legacy:!1},o);return typeof c.relaxed=="boolean"&&(c.strict=!c.relaxed),typeof c.strict=="boolean"&&(c.relaxed=!c.strict),JSON.parse(s,function(u,f){if(u.indexOf("\0")!==-1)throw new mn("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(u)));return hf(f,c)})}t.parse=e;function r(s,o,c,u){c!=null&&typeof c=="object"&&(u=c,c=0),o!=null&&typeof o=="object"&&!Array.isArray(o)&&(u=o,o=void 0,c=0);var f=Object.assign({relaxed:!0,legacy:!1},u,{seenObjects:[{propertyName:"(root)",obj:null}]}),g=Jr(s,f);return JSON.stringify(g,o,c)}t.stringify=r;function n(s,o){return o=o||{},JSON.parse(r(s,o))}t.serialize=n;function i(s,o){return o=o||{},e(JSON.stringify(s),o)}t.deserialize=i})(ef||(ef={}));var tf,rf=of();rf.Map?tf=rf.Map:tf=function(){function t(e){e===void 0&&(e=[]),this._keys=[],this._values={};for(var r=0;r<e.length;r++)if(e[r]!=null){var n=e[r],i=n[0],s=n[1];this._keys.push(i),this._values[i]={v:s,i:this._keys.length-1}}}return t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(e){var r=this._values[e];return r==null?!1:(delete this._values[e],this._keys.splice(r.i,1),!0)},t.prototype.entries=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?[n,e._values[n].v]:void 0,done:n===void 0}}}},t.prototype.forEach=function(e,r){r=r||this;for(var n=0;n<this._keys.length;n++){var i=this._keys[n];e.call(r,this._values[i].v,i,r)}},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,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?n:void 0,done:n===void 0}}}},t.prototype.set=function(e,r){return this._values[e]?(this._values[e].v=r,this):(this._keys.push(e),this._values[e]={v:r,i:this._keys.length-1},this)},t.prototype.values=function(){var e=this,r=0;return{next:function(){var n=e._keys[r++];return{value:n!==void 0?e._values[n].v:void 0,done:n===void 0}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),t}();var rI=K.fromNumber(dg),nI=K.fromNumber(hg),ul=new Uint8Array(8),iI=new DataView(ul.buffer,ul.byteOffset,ul.byteLength),Mg=1024*1024*17,oI=Ee.alloc(Mg),mi=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}},ve=class{constructor(t,e={},r,n){this.name=t,this.properties=e,this.id=n?new Xe(n):new Xe,this.occurred=new Date,r&&(this.trigger=new mi(r)),this.newEvent=!n}trigger;items;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber},It=class{static injectScriptURL(t,e){if(!t)return;let r=document.createElement("script");r.id=e??"",r.src=t,r.defer=!0,t.includes("localhost")&&(r.type="module"),document.head.appendChild(r)}static injectRawScript(t){if(!t)return;let e=document.createElement("script");e.id="cooee-app-script",e.innerHTML=t,document.head.appendChild(e)}static injectRawCSS(t,e=document.head){if(!t)return;let r=document.createElement("style");r.textContent=t,e.appendChild(r)}static injectStylesheet(t,e=document.head){if(!t)return;let r=document.createElement("link");r.rel="stylesheet",r.href=t,e.appendChild(r)}},ae=class{static storage=new Map;static get(t){return this.storage.has(t)||this.storage.set(t,t.getInstance()),this.storage.get(t)}},gf=Xt(vl()),po=class{static UTM_PARAMS=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"];static TW_PARAMS={utm_source:"tw_source",utm_campaign:"tw_campaign"};static getReferrer(){if(document.referrer)return document.referrer.replace(location.origin,"")}static getUTMParams(){let t;try{t=new gf.URLBuilder(location.href)}catch{return{}}let e={};this.UTM_PARAMS.forEach(n=>{let i=t.getQueryParam(n);i&&(e[n]=i)});let r={};return Object.keys(this.TW_PARAMS).forEach(n=>{let i=t.getQueryParam(this.TW_PARAMS[n]);i&&(r[n]=i)}),b(b({},r),e)}},vr=class Sd{origin;path;qs;name;referrer;utmSource;utmMedium;utmCampaign;utmId;utmTerm;utmContent;constructor(e){this.name=e.name,this.path=e.path,this.qs=e.qs,this.referrer=e.referrer,this.utmSource=e.utmSource||e.utm_source,this.utmMedium=e.utmMedium||e.utm_medium,this.utmCampaign=e.utmCampaign||e.utm_campaign,this.utmId=e.utmId||e.utm_id,this.utmTerm=e.utmTerm||e.utm_term,this.utmContent=e.utmContent||e.utm_content}static parseFromCurrent(){let e=location.pathname==="/"?location.pathname:location.pathname.replace(/\/+$/,"");return new Sd(b({origin:location.origin,path:e,qs:location.search,referrer:po.getReferrer(),name:fe.get().pageName},po.getUTMParams()))}};function ce(t){return typeof t=="function"}function Os(t){let e=t(r=>{Error.call(r),r.stack=new Error().stack});return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var Ps=Os(t=>function(e){t(this),this.message=e?`${e.length} errors occurred during unsubscription:
|
|
22
22
|
${e.map((r,n)=>`${n+1}) ${r.toString()}`).join(`
|