@letscooee/web-sdk 0.0.35 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/sdk-preview.min.js +1 -1
- package/dist/sdk.min.js +1 -1
- package/package.json +1 -1
package/dist/sdk-preview.min.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/*! For license information please see sdk-preview.min.js.LICENSE.txt */
|
|
2
|
-
(()=>{var t={145:(t,e)=>{"use strict";e.r=void 0,e.r=function(){return new Promise((function(t,e){var r,n,i="Unknown";function o(e){t({isPrivate:e,browserName:i})}function s(t){return t===eval.toString().length}void 0!==(n=navigator.vendor)&&0===n.indexOf("Apple")&&s(37)?(i="Safari",void 0!==navigator.maxTouchPoints?function(){var t=String(Math.random());try{window.indexedDB.open(t,1).onupgradeneeded=function(e){var r,n,i=null===(r=e.target)||void 0===r?void 0:r.result;try{i.createObjectStore("test",{autoIncrement:!0}).put(new Blob),o(!1)}catch(t){var s=t;return t instanceof Error&&(s=null!==(n=t.message)&&void 0!==n?n:t),o("string"==typeof s&&/BlobURLs are not yet supported/.test(s))}finally{i.close(),window.indexedDB.deleteDatabase(t)}}}catch(t){return o(!1)}}():function(){var t=window.openDatabase,e=window.localStorage;try{t(null,null,null,null)}catch(t){return o(!0)}try{e.setItem("test","1"),e.removeItem("test")}catch(t){return o(!0)}o(!1)}()):function(){var t=navigator.vendor;return void 0!==t&&0===t.indexOf("Google")&&s(33)}()?(r=navigator.userAgent,i=r.match(/Chrome/)?void 0!==navigator.brave?"Brave":r.match(/Edg/)?"Edge":r.match(/OPR/)?"Opera":"Chrome":"Chromium",void 0!==self.Promise&&void 0!==self.Promise.allSettled?navigator.webkitTemporaryStorage.queryUsageAndQuota((function(t,e){var r;o(e<(void 0!==(r=window).performance&&void 0!==r.performance.memory&&void 0!==r.performance.memory.jsHeapSizeLimit?performance.memory.jsHeapSizeLimit:1073741824))}),(function(t){e(new Error("detectIncognito somehow failed to query storage quota: "+t.message))})):(0,window.webkitRequestFileSystem)(0,1,(function(){o(!1)}),(function(){o(!0)}))):void 0!==document.documentElement&&void 0!==document.documentElement.style.MozAppearance&&s(37)?(i="Firefox",o(void 0===navigator.serviceWorker)):void 0!==navigator.msSaveBlob&&s(39)?(i="Internet Explorer",o(void 0===window.indexedDB)):e(new Error("detectIncognito cannot determine the browser"))}))}},238:function(t,e,r){var n;!function(i,o){"use strict";var s="function",u="undefined",a="object",c="string",f="model",p="name",h="type",l="vendor",d="version",g="architecture",y="console",b="mobile",v="tablet",m="smarttv",w="wearable",S="embedded",E="Amazon",_="Apple",O="ASUS",T="BlackBerry",x="Google",A="Huawei",I="LG",N="Microsoft",D="Motorola",P="Samsung",B="Sony",k="Xiaomi",R="Zebra",L="Facebook",C=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},U=function(t,e){return typeof t===c&&-1!==j(e).indexOf(j(t))},j=function(t){return t.toLowerCase()},M=function(t,e){if(typeof t===c)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===u?t:t.substring(0,255)},H=function(t,e){for(var r,n,i,u,c,f,p=0;p<e.length&&!c;){var h=e[p],l=e[p+1];for(r=n=0;r<h.length&&!c;)if(c=h[r++].exec(t))for(i=0;i<l.length;i++)f=c[++n],typeof(u=l[i])===a&&u.length>0?2===u.length?typeof u[1]==s?this[u[0]]=u[1].call(this,f):this[u[0]]=u[1]:3===u.length?typeof u[1]!==s||u[1].exec&&u[1].test?this[u[0]]=f?f.replace(u[1],u[2]):o:this[u[0]]=f?u[1].call(this,f,u[2]):o:4===u.length&&(this[u[0]]=f?u[3].call(this,f.replace(u[1],u[2])):o):this[u]=f||o;p+=2}},G=function(t,e){for(var r in e)if(typeof e[r]===a&&e[r].length>0){for(var n=0;n<e[r].length;n++)if(U(e[r][n],t))return"?"===r?o:r}else if(U(e[r],t))return"?"===r?o:r;return t},V={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"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,d],[/opios[\/ ]+([\w\.]+)/i],[d,[p,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[d,[p,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[p,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[p,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[d,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[p,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure Browser"],d],[/\bfocus\/([\w\.]+)/i],[d,[p,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[d,[p,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[p,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[p,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[d,[p,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,L],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[p,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[p,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,"Chrome WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[p,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,d],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[d,[p,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[d,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[d,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[p,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[p,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\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|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[p,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,j]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",j]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,j]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[l,P],[h,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[l,P],[h,b]],[/\((ip(?:hone|od)[\w ]*);/i],[f,[l,_],[h,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[l,_],[h,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[l,A],[h,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[f,[l,A],[h,b]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g," "],[l,k],[h,b]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[l,k],[h,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[l,"OPPO"],[h,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[l,"Vivo"],[h,b]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[l,"Realme"],[h,b]],[/\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],[f,[l,D],[h,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[l,D],[h,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[l,I],[h,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[l,I],[h,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[l,"Lenovo"],[h,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[l,"Nokia"],[h,b]],[/(pixel c)\b/i],[f,[l,x],[h,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[l,x],[h,b]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[l,B],[h,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[l,B],[h,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[l,"OnePlus"],[h,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[l,E],[h,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[l,E],[h,b]],[/(playbook);[-\w\),; ]+(rim)/i],[f,l,[h,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[l,T],[h,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[l,O],[h,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[l,O],[h,b]],[/(nexus 9)/i],[f,[l,"HTC"],[h,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[l,[f,/_/g," "],[h,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[l,"Acer"],[h,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[l,"Meizu"],[h,b]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[l,"Sharp"],[h,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[l,f,[h,b]],[/(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],[l,f,[h,v]],[/(surface duo)/i],[f,[l,N],[h,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[l,"Fairphone"],[h,b]],[/(u304aa)/i],[f,[l,"AT&T"],[h,b]],[/\bsie-(\w*)/i],[f,[l,"Siemens"],[h,b]],[/\b(rct\w+) b/i],[f,[l,"RCA"],[h,v]],[/\b(venue[\d ]{2,7}) b/i],[f,[l,"Dell"],[h,v]],[/\b(q(?:mv|ta)\w+) b/i],[f,[l,"Verizon"],[h,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[l,"Barnes & Noble"],[h,v]],[/\b(tm\d{3}\w+) b/i],[f,[l,"NuVision"],[h,v]],[/\b(k88) b/i],[f,[l,"ZTE"],[h,v]],[/\b(nx\d{3}j) b/i],[f,[l,"ZTE"],[h,b]],[/\b(gen\d{3}) b.+49h/i],[f,[l,"Swiss"],[h,b]],[/\b(zur\d{3}) b/i],[f,[l,"Swiss"],[h,v]],[/\b((zeki)?tb.*\b) b/i],[f,[l,"Zeki"],[h,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[l,"Dragon Touch"],f,[h,v]],[/\b(ns-?\w{0,9}) b/i],[f,[l,"Insignia"],[h,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[l,"NextBook"],[h,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[l,"Voice"],f,[h,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[l,"LvTel"],f,[h,b]],[/\b(ph-1) /i],[f,[l,"Essential"],[h,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[l,"Envizen"],[h,v]],[/\b(trio[-\w\. ]+) b/i],[f,[l,"MachSpeed"],[h,v]],[/\btu_(1491) b/i],[f,[l,"Rotor"],[h,v]],[/(shield[\w ]+) b/i],[f,[l,"Nvidia"],[h,v]],[/(sprint) (\w+)/i],[l,f,[h,b]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[l,N],[h,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[l,R],[h,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[l,R],[h,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[l,f,[h,y]],[/droid.+; (shield) bui/i],[f,[l,"Nvidia"],[h,y]],[/(playstation [345portablevi]+)/i],[f,[l,B],[h,y]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[l,N],[h,y]],[/smart-tv.+(samsung)/i],[l,[h,m]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[l,P],[h,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[l,I],[h,m]],[/(apple) ?tv/i],[l,[f,"Apple TV"],[h,m]],[/crkey/i],[[f,"Chromecast"],[l,x],[h,m]],[/droid.+aft(\w)( bui|\))/i],[f,[l,E],[h,m]],[/\(dtv[\);].+(aquos)/i],[f,[l,"Sharp"],[h,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[l,M],[f,M],[h,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[h,m]],[/((pebble))app/i],[l,f,[h,w]],[/droid.+; (glass) \d/i],[f,[l,x],[h,w]],[/droid.+; (wt63?0{2,3})\)/i],[f,[l,R],[h,w]],[/(quest( 2)?)/i],[f,[l,L],[h,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[l,[h,S]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[h,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[h,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[h,v]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[h,b]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[l,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[p,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[d,G,V]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,"Windows"],[d,G,V]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[d,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,d],[/\(bb(10);/i],[d,[p,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[p,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[p,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[p,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[p,"Chromium OS"],d],[/(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],[p,d],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[p,d]]},F=function(t,e){if(typeof t===a&&(e=t,t=o),!(this instanceof F))return new F(t,e).getResult();var r=t||(typeof i!==u&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),n=e?function(t,e){var r={};for(var n in t)e[n]&&e[n].length%2==0?r[n]=e[n].concat(t[n]):r[n]=t[n];return r}($,e):$;return this.getBrowser=function(){var t,e={};return e.name=o,e.version=o,H.call(e,r,n.browser),e.major=typeof(t=e.version)===c?t.replace(/[^\d\.]/g,"").split(".")[0]:o,e},this.getCPU=function(){var t={};return t.architecture=o,H.call(t,r,n.cpu),t},this.getDevice=function(){var t={};return t.vendor=o,t.model=o,t.type=o,H.call(t,r,n.device),t},this.getEngine=function(){var t={};return t.name=o,t.version=o,H.call(t,r,n.engine),t},this.getOS=function(){var t={};return t.name=o,t.version=o,H.call(t,r,n.os),t},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 r},this.setUA=function(t){return r=typeof t===c&&t.length>255?M(t,255):t,this},this.setUA(r),this};F.VERSION="1.0.2",F.BROWSER=C([p,d,"major"]),F.CPU=C([g]),F.DEVICE=C([f,l,h,y,b,m,v,w,S]),F.ENGINE=F.OS=C([p,d]),typeof e!==u?(t.exports&&(e=t.exports=F),e.UAParser=F):r.amdO?(n=function(){return F}.call(e,r,e,t))===o||(t.exports=n):typeof i!==u&&(i.UAParser=F);var q=typeof i!==u&&(i.jQuery||i.Zepto);if(q&&!q.ua){var z=new F;q.ua=z.getResult(),q.ua.get=function(){return z.getUA()},q.ua.set=function(t){z.setUA(t);var e=z.getResult();for(var r in e)q.ua[r]=e[r]}}}("object"==typeof window?window:this)},147:t=>{"use strict";t.exports={i8:"0.0.35"}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.amdO={},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};(()=>{"use strict";r.d(n,{default:()=>qr});for(var t=function(){function t(){}var e,n;return e=t,t.API_URL="https://api.sdk.letscooee.com",t.SDK_VERSION=r(147).i8,t.SDK_DEBUG=!1,t.SDK="WEB",t.LOG_PREFIX="CooeeSDK",t.COOEE="cooee",t.CANVAS_WIDTH=1080,t.CANVAS_HEIGHT=1920,t.STORAGE_APP_ID="cooaid",t.STORAGE_USER_ID="uid",t.STORAGE_SDK_TOKEN="st",t.STORAGE_DEVICE_UUID="uuid",t.STORAGE_SESSION_ID="sid",t.STORAGE_SESSION_NUMBER="sn",t.STORAGE_SESSION_START_TIME="sst",t.STORAGE_SESSION_START_EVENT_SENT="sses",t.STORAGE_FIRST_TIME_LAUNCH="ifl",t.STORAGE_LAST_ACTIVE="la",t.STORAGE_ACTIVE_TRIGGER="at",t.STORAGE_ACTIVE_TRIGGERS="ats",t.STORAGE_SHOPIFY_PAST_ORDERS_DATA_SENT="spods",t.SESSION_STORAGE_TAB_OPENED="tabop",t.IDLE_TIME_IN_SECONDS=1800,t.IN_APP_CONTAINER_NAME="cooee-wrapper",n=t.SDK_VERSION.split(".").map((function(t){return t.padStart(2,"0")})).join(""),t.SDK_VERSION_CODE=parseInt(n,10),t.EVENT_SCREEN_VIEW="CE Screen View",t.EVENT_APP_INSTALLED="CE App Installed",t.EVENT_APP_LAUNCHED="CE App Launched",t.EVENT_SESSION_CONCLUDED="CE Session Concluded",t.EVENT_SESSION_STARTED="CE Session Started",t.EVENT_APP_FOREGROUND="CE App Foreground",t.EVENT_APP_BACKGROUND="CE App Background",t.EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed",t.EVENT_TRIGGER_CLOSED="CE Trigger Closed",t.BOT_USER_AGENTS_PATTERN="(googlebot/|bot|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)",t.BOT_UA_REGEX=new RegExp(e.BOT_USER_AGENTS_PATTERN,"i"),t}(),e=function(){function t(t){this.triggerID=t.id,this.engagementID=t.engagementID,this.expireAt=t.expireAt,this.updateExpired()}return Object.defineProperty(t.prototype,"isExpired",{get:function(){return this.expireAt<(new Date).getTime()},enumerable:!1,configurable:!0}),t.prototype.updateExpired=function(){this.isExpired&&(this.expired=!0)},t}(),i=[],o=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=u.length;a<c;++a)i[a]=u[a],o[u.charCodeAt(a)]=a;function f(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("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function p(t,e,r){for(var n,o,s=[],u=e;u<r;u+=3)n=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;var h,l,d=function(t){var e,r,n=f(t),i=n[0],u=n[1],a=new s(function(t,e,r){return 3*(e+r)/4-r}(0,i,u)),c=0,p=u>0?i-4:i;for(r=0;r<p;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],a[c++]=e>>16&255,a[c++]=e>>8&255,a[c++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,a[c++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,a[c++]=e>>8&255,a[c++]=255&e),a},g=function(t){for(var e,r=t.length,n=r%3,o=[],s=16383,u=0,a=r-n;u<a;u+=s)o.push(p(t,u,u+s>a?a:u+s));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")},y=function(t,e,r,n,i){var o,s,u=8*i-n-1,a=(1<<u)-1,c=a>>1,f=-7,p=r?i-1:0,h=r?-1:1,l=t[e+p];for(p+=h,o=l&(1<<-f)-1,l>>=-f,f+=u;f>0;o=256*o+t[e+p],p+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+p],p+=h,f-=8);if(0===o)o=1-c;else{if(o===a)return s?NaN:1/0*(l?-1:1);s+=Math.pow(2,n),o-=c}return(l?-1:1)*s*Math.pow(2,o-n)},b=function(t,e,r,n,i,o){var s,u,a,c=8*o-i-1,f=(1<<c)-1,p=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+p>=1?h/a:h*Math.pow(2,1-p))*a>=2&&(s++,a/=2),s+p>=f?(u=0,s=f):s+p>=1?(u=(e*a-1)*Math.pow(2,i),s+=p):(u=e*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;t[r+l]=255&u,l+=d,u/=256,i-=8);for(s=s<<i|u,c+=i;c>0;t[r+l]=255&s,l+=d,s/=256,c-=8);t[r+l-d]|=128*g},v=(h=function(t,e){var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},e.INSPECT_MAX_BYTES=50;var n=2147483647;function i(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|h(t,e),n=i(r),s=n.write(t,e);return s!==r&&(n=n.slice(0,s)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){var e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t));if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return f(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return f(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);var s=function(t){if(o.isBuffer(t)){var e=0|p(t.length),r=i(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||$(t.length)?i(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t))}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return u(t),i(t<0?0:0|p(t))}function c(t){for(var e=t.length<0?0:0|p(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function f(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,o.prototype),n}function p(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function h(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(i)return n?-1:M(t).length;e=(""+e).toLowerCase(),i=!0}}function l(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return N(this,e,r);case"latin1":case"binary":return D(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){var o,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;o<u;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===a)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+a>u&&(r=u-a),o=r;o>=0;o--){for(var p=!0,h=0;h<a;h++)if(c(t,o+h)!==c(e,h)){p=!1;break}if(p)return o}return-1}function S(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if($(u))return s;t[r+s]=u}return s}function E(t,e,r,n){return G(M(e,t.length-r),t,r,n)}function _(t,e,r,n){return G(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function O(t,e,r,n){return G(H(e),t,r,n)}function T(t,e,r,n){return G(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?g(t):g(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,u,a,c=t[i],f=null,p=c>239?4:c>223?3:c>191?2:1;if(i+p<=r)switch(p){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&c)<<6|63&o)>127&&(f=a);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(a=(15&c)<<12|(63&o)<<6|63&s)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:o=t[i+1],s=t[i+2],u=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&(a=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(f=a)}null===f?(f=65533,p=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=p}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=I));return r}(n)}e.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),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}}),o.poolSize=8192,o.from=function(t,e,r){return s(t,e,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,r){return function(t,e,r){return u(t),t<=0?i(t):void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}(t,e,r)},o.allocUnsafe=function(t){return a(t)},o.allocUnsafeSlow=function(t){return a(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(V(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(t){switch(String(t).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(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=o.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(V(s,Uint8Array))i+s.length>n.length?o.from(s).copy(n,i):Uint8Array.prototype.set.call(n,s,i);else{if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i)}i+=s.length}return n},o.byteLength=h,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},o.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):l.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(t,e,r,n,i){if(V(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),a=Math.min(s,u),c=this.slice(n,i),f=t.slice(e,r),p=0;p<a;++p)if(c[p]!==f[p]){s=c[p],u=f[p];break}return s<u?-1:u<s?1:0},o.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},o.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return S(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return O(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function N(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function P(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=F[t[o]];return i}function B(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function k(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,4),b(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,8),b(t,e,r,n,52,8),r+8}o.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||k(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||k(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return t>>>=0,e||k(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||k(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||k(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||k(t,4,this.length),y(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||k(t,4,this.length),y(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||k(t,8,this.length),y(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||k(t,8,this.length),y(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||R(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=0,s=1,u=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/s>>0)-u&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);R(this,t,e,r,i-1,-i)}var o=r-1,s=1,u=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/s>>0)-u&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},o.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var u=o.isBuffer(t)?t:o.from(t,n),a=u.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=u[s%a]}return this};var j=/[^+/0-9A-Za-z-_]/g;function M(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return d(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}var F=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},h(l={exports:{}},l.exports),l.exports),m=v.Buffer;v.SlowBuffer,v.INSPECT_MAX_BYTES,v.kMaxLength;var w=function(t,e){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},w(t,e)};function S(t,e){function r(){this.constructor=t}w(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var E=function(t){function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return S(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e}(Error),_=function(t){function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return S(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e}(TypeError);function O(t){return t&&t.Math==Math&&t}function T(){return O("object"==typeof globalThis&&globalThis)||O("object"==typeof window&&window)||O("object"==typeof self&&self)||O("object"==typeof r.g&&r.g)||Function("return this")()}var x=function(t){var e,r="object"==typeof(e=T()).navigator&&"ReactNative"===e.navigator.product?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var n=m.alloc(t),i=0;i<t;++i)n[i]=Math.floor(256*Math.random());return n},A=function(){if("undefined"!=typeof window){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(m.alloc(e))}}return void 0!==r.g&&r.g.crypto&&r.g.crypto.getRandomValues?function(t){return r.g.crypto.getRandomValues(m.alloc(t))}:x}();function I(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}function N(t){return"object"==typeof t&&null!==t}function D(t,e){var r=!1;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return r||(console.warn(e),r=!0),t.apply(this,n)}}function P(t){if(ArrayBuffer.isView(t))return m.from(t.buffer,t.byteOffset,t.byteLength);if(e=t,["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e)))return m.from(t);var e;throw new _("Must use either Buffer or TypedArray")}var B=/^(?:[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,k=function(t){return"string"==typeof t&&B.test(t)},R=function(t){if(!k(t))throw new _('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 m.from(e,"hex")},L=function(t,e){return void 0===e&&(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")},C=Symbol("id"),U=function(){function t(e){if(void 0===e)this.id=t.generate();else if(e instanceof t)this[C]=m.from(e.id),this.__id=e.__id;else if(ArrayBuffer.isView(e)&&16===e.byteLength)this.id=P(e);else{if("string"!=typeof e)throw new _("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).");this.id=R(e)}}return Object.defineProperty(t.prototype,"id",{get:function(){return this[C]},set:function(e){this[C]=e,t.cacheHexString&&(this.__id=L(e))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(e){if(void 0===e&&(e=!0),t.cacheHexString&&this.__id)return this.__id;var r=L(this.id,e);return t.cacheHexString&&(this.__id=r),r},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(!e)return!1;if(e instanceof t)return e.id.equals(this.id);try{return new t(e).id.equals(this.id)}catch(t){return!1}},t.prototype.toBinary=function(){return new j(this.id,j.SUBTYPE_UUID)},t.generate=function(){var t=A(16);return t[6]=15&t[6]|64,t[8]=63&t[8]|128,m.from(t)},t.isValid=function(e){if(!e)return!1;if(e instanceof t)return!0;if("string"==typeof e)return k(e);if(I(e)){if(16!==e.length)return!1;try{return parseInt(e[6].toString(16)[0],10)===j.SUBTYPE_UUID}catch(t){return!1}}return!1},t.createFromHexString=function(e){return new t(R(e))},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t}();Object.defineProperty(U.prototype,"_bsontype",{value:"UUID"});var j=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(!(null==e||"string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||Array.isArray(e)))throw new _("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=null!=r?r:t.BSON_BINARY_SUBTYPE_DEFAULT,null==e?(this.buffer=m.alloc(t.BUFFER_SIZE),this.position=0):("string"==typeof e?this.buffer=m.from(e,"binary"):Array.isArray(e)?this.buffer=m.from(e):this.buffer=P(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if("string"==typeof e&&1!==e.length)throw new _("only accepts single character String");if("number"!=typeof e&&1!==e.length)throw new _("only accepts single character Uint8Array or Array");var r;if((r="string"==typeof e?e.charCodeAt(0):"number"==typeof e?e:e[0])<0||r>255)throw new _("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=m.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(t,e){if(e="number"==typeof e?e:this.position,this.buffer.length<e+t.length){var r=m.alloc(this.buffer.length+t.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r}ArrayBuffer.isView(t)?(this.buffer.set(P(t),e),this.position=e+t.byteLength>this.position?e+t.length:this.position):"string"==typeof t&&(this.buffer.write(t,e,t.length,"binary"),this.position=e+t.length>this.position?e+t.length:this.position)},t.prototype.read=function(t,e){return e=e&&e>0?e:this.position,this.buffer.slice(t,t+e)},t.prototype.value=function(t){return(t=!!t)&&this.buffer.length===this.position?this.buffer:t?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(t){return this.buffer.toString(t)},t.prototype.toExtendedJSON=function(t){t=t||{};var e=this.buffer.toString("base64"),r=Number(this.sub_type).toString(16);return t.legacy?{$binary:e,$type:1===r.length?"0"+r:r}:{$binary:{base64:e,subType:1===r.length?"0"+r:r}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new U(this.buffer.slice(0,this.position));throw new E('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){var n,i;if(r=r||{},"$binary"in e?r.legacy&&"string"==typeof e.$binary&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,n=m.from(e.$binary,"base64")):"string"!=typeof e.$binary&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=m.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,n=R(e.$uuid)),!n)throw new _("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return new t(n,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.value(!0);return'new Binary(Buffer.from("'.concat(t.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(j.prototype,"_bsontype",{value:"Binary"});var M=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 t=this.toJSON();return'new Code("'.concat(String(t.code),'"').concat(t.scope?", ".concat(JSON.stringify(t.scope)):"",")")},t}();Object.defineProperty(M.prototype,"_bsontype",{value:"Code"});var H=function(){function t(e,r,n,i){if(!(this instanceof t))return new t(e,r,n,i);var o=e.split(".");2===o.length&&(n=o.shift(),e=o.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(t){this.collection=t},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(t.$db=this.db),t},t.prototype.toExtendedJSON=function(t){t=t||{};var e={$ref:this.collection,$id:this.oid};return t.legacy?e:(this.db&&(e.$db=this.db),e=Object.assign(e,this.fields))},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 t=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(t),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t}();Object.defineProperty(H.prototype,"_bsontype",{value:"DBRef"});var G=void 0;try{G=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(t){}var V=4294967296,$=0x10000000000000000,F=$/2,q={},z={},W=function(){function t(e,r,n){if(void 0===e&&(e=0),!(this instanceof t))return new t(e,r,n);"bigint"==typeof e?Object.assign(this,t.fromBigInt(e,!!r)):"string"==typeof e?Object.assign(this,t.fromString(e,!!r)):(this.low=0|e,this.high=0|r,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,o;return r?(o=0<=(e>>>=0)&&e<256)&&(i=z[e])?i:(n=t.fromBits(e,(0|e)<0?-1:0,!0),o&&(z[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(i=q[e])?i:(n=t.fromBits(e,e<0?-1:0,!1),o&&(q[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>=$)return t.MAX_UNSIGNED_VALUE}else{if(e<=-F)return t.MIN_VALUE;if(e+1>=F)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%V|0,e/V|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t.ZERO;if("number"==typeof r?(n=r,r=!1):r=!!r,(n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return t.fromString(e.substring(1),r,n).neg();for(var o=t.fromNumber(Math.pow(n,8)),s=t.ZERO,u=0;u<e.length;u+=8){var a=Math.min(8,e.length-u),c=parseInt(e.substring(u,u+a),n);if(a<8){var f=t.fromNumber(Math.pow(n,a));s=s.mul(f).add(t.fromNumber(c))}else s=(s=s.mul(o)).add(t.fromNumber(c))}return s.unsigned=r,s},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(t){return N(t)&&!0===t.__isLong__},t.fromValue=function(e,r){return"number"==typeof e?t.fromNumber(e,r):"string"==typeof e?t.fromString(e,r):t.fromBits(e.low,e.high,"boolean"==typeof r?r:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,u=65535&e.high,a=e.low>>>16,c=0,f=0,p=0,h=0;return p+=(h+=o+(65535&e.low))>>>16,h&=65535,f+=(p+=i+a)>>>16,p&=65535,c+=(f+=n+u)>>>16,f&=65535,c+=r+s,c&=65535,t.fromBits(p<<16|h,c<<16|f,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(t){return this.compare(t)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(G){if(!this.unsigned&&-2147483648===this.high&&-1===e.low&&-1===e.high)return this;var r=(this.unsigned?G.div_u:G.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,G.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;o=t.UZERO}else{if(this.eq(t.MIN_VALUE))return e.eq(t.ONE)||e.eq(t.NEG_ONE)?t.MIN_VALUE:e.eq(t.MIN_VALUE)?t.ONE:(n=this.shr(1).div(e).shl(1)).eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=t.ZERO}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:Math.pow(2,s-48),a=t.fromNumber(n),c=a.mul(e);c.isNegative()||c.gt(i);)n-=u,c=(a=t.fromNumber(n,this.unsigned)).mul(e);a.isZero()&&(a=t.ONE),o=o.add(a),i=i.sub(c)}return o},t.prototype.div=function(t){return this.divide(t)},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)&&this.high===e.high&&this.low===e.low},t.prototype.eq=function(t){return this.equals(t)},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,r=0!==this.high?this.high:this.low;for(e=31;e>0&&0==(r&1<<e);e--);return 0!==this.high?e+33:e+1},t.prototype.greaterThan=function(t){return this.comp(t)>0},t.prototype.gt=function(t){return this.greaterThan(t)},t.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},t.prototype.gte=function(t){return this.greaterThanOrEqual(t)},t.prototype.ge=function(t){return this.greaterThanOrEqual(t)},t.prototype.isEven=function(){return 0==(1&this.low)},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return 1==(1&this.low)},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return 0===this.high&&0===this.low},t.prototype.lessThan=function(t){return this.comp(t)<0},t.prototype.lt=function(t){return this.lessThan(t)},t.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},t.prototype.lte=function(t){return this.lessThanOrEqual(t)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),G){var r=(this.unsigned?G.rem_u:G.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,G.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(t){return this.modulo(t)},t.prototype.rem=function(t){return this.modulo(t)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),G){var r=G.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,G.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=65535&this.high,o=this.low>>>16,s=65535&this.low,u=e.high>>>16,a=65535&e.high,c=e.low>>>16,f=65535&e.low,p=0,h=0,l=0,d=0;return l+=(d+=s*f)>>>16,d&=65535,h+=(l+=o*f)>>>16,l&=65535,h+=(l+=s*c)>>>16,l&=65535,p+=(h+=i*f)>>>16,h&=65535,p+=(h+=o*c)>>>16,h&=65535,p+=(h+=s*a)>>>16,h&=65535,p+=n*f+i*c+o*a+s*u,p&=65535,t.fromBits(l<<16|d,p<<16|h,this.unsigned)},t.prototype.mul=function(t){return this.multiply(t)},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(t){return!this.equals(t)},t.prototype.neq=function(t){return this.notEquals(t)},t.prototype.ne=function(t){return this.notEquals(t)},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()),0==(e&=63)?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(t){return this.shiftLeft(t)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),0==(e&=63)?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(t){return this.shiftRight(t)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),0==(e&=63))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)}return 32===e?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},t.prototype.shru=function(t){return this.shiftRightUnsigned(t)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(t){return this.subtract(t)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*V+(this.low>>>0):this.high*V+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},t.prototype.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if((e=e||10)<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)}return"-"+this.neg().toString(e)}for(var o=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,u="";;){var a=s.div(o),c=(s.sub(a.mul(o)).toInt()>>>0).toString(e);if((s=a).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},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(t){return this.lessThanOrEqual(t)},t.prototype.toExtendedJSON=function(t){return t&&t.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(16777216),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(W.prototype,"__isLong__",{value:!0}),Object.defineProperty(W.prototype,"_bsontype",{value:"Long"});var J=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,K=/^(\+|-)?(Infinity|inf)$/i,Y=/^(\+|-)?NaN$/i,Z=6111,X=-6176,Q=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),tt=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),et=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),rt=/^([-+])?(\d+)?$/;function nt(t){return!isNaN(parseInt(t,10))}function it(t){var e=W.fromNumber(1e9),r=W.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=r.shiftLeft(32)).add(new W(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function ot(t,e){throw new _('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var st=function(){function t(e){if(!(this instanceof t))return new t(e);if("string"==typeof e)this.bytes=t.fromString(e).bytes;else{if(!I(e))throw new _("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new _("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}return t.fromString=function(e){var r,n=!1,i=!1,o=!1,s=0,u=0,a=0,c=0,f=0,p=[0],h=0,l=0,d=0,g=0,y=0,b=0,v=new W(0,0),w=new W(0,0),S=0;if(e.length>=7e3)throw new _(e+" not a valid Decimal128 string");var E=e.match(J),O=e.match(K),T=e.match(Y);if(!E&&!O&&!T||0===e.length)throw new _(e+" not a valid Decimal128 string");if(E){var x=E[2],A=E[4],I=E[5],N=E[6];A&&void 0===N&&ot(e,"missing exponent power"),A&&void 0===x&&ot(e,"missing exponent base"),void 0===A&&(I||N)&&ot(e,"missing e before exponent")}if("+"!==e[S]&&"-"!==e[S]||(n="-"===e[S++]),!nt(e[S])&&"."!==e[S]){if("i"===e[S]||"I"===e[S])return new t(m.from(n?tt:et));if("N"===e[S])return new t(m.from(Q))}for(;nt(e[S])||"."===e[S];)"."!==e[S]?(h<34&&("0"!==e[S]||o)&&(o||(f=u),o=!0,p[l++]=parseInt(e[S],10),h+=1),o&&(a+=1),i&&(c+=1),u+=1,S+=1):(i&&ot(e,"contains multiple periods"),i=!0,S+=1);if(i&&!u)throw new _(e+" not a valid Decimal128 string");if("e"===e[S]||"E"===e[S]){var D=e.substr(++S).match(rt);if(!D||!D[2])return new t(m.from(Q));y=parseInt(D[0],10),S+=D[0].length}if(e[S])return new t(m.from(Q));if(d=0,h){if(g=h-1,1!==(s=a))for(;0===p[f+s-1];)s-=1}else d=0,g=0,p[0]=0,a=1,h=1,s=0;for(y<=c&&c-y>16384?y=X:y-=c;y>Z;){if((g+=1)-d>34){if(p.join("").match(/^0+$/)){y=Z;break}ot(e,"overflow")}y-=1}for(;y<X||h<a;){if(0===g&&s<h){y=X,s=0;break}if(h<a?a-=1:g-=1,y<Z)y+=1;else{if(p.join("").match(/^0+$/)){y=Z;break}ot(e,"overflow")}}if(g-d+1<s){var P=u;i&&(f+=1,P+=1),n&&(f+=1,P+=1);var B=parseInt(e[f+g+1],10),k=0;if(B>=5&&(k=1,5===B))for(k=p[g]%2==1?1:0,b=f+g+2;b<P;b++)if(parseInt(e[b],10)){k=1;break}if(k)for(var R=g;R>=0;R--)if(++p[R]>9&&(p[R]=0,0===R)){if(!(y<Z))return new t(m.from(n?tt:et));y+=1,p[R]=1}}if(v=W.fromNumber(0),w=W.fromNumber(0),0===s)v=W.fromNumber(0),w=W.fromNumber(0);else if(g-d<17)for(R=d,w=W.fromNumber(p[R++]),v=new W(0,0);R<=g;R++)w=(w=w.multiply(W.fromNumber(10))).add(W.fromNumber(p[R]));else{for(R=d,v=W.fromNumber(p[R++]);R<=g-17;R++)v=(v=v.multiply(W.fromNumber(10))).add(W.fromNumber(p[R]));for(w=W.fromNumber(p[R++]);R<=g;R++)w=(w=w.multiply(W.fromNumber(10))).add(W.fromNumber(p[R]))}var L,C,U,j,M=function(t,e){if(!t&&!e)return{high:W.fromNumber(0),low:W.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new W(t.getLowBits(),0),i=e.shiftRightUnsigned(32),o=new W(e.getLowBits(),0),s=r.multiply(i),u=r.multiply(o),a=n.multiply(i),c=n.multiply(o);return s=s.add(u.shiftRightUnsigned(32)),u=new W(u.getLowBits(),0).add(a).add(c.shiftRightUnsigned(32)),{high:s=s.add(u.shiftRightUnsigned(32)),low:c=u.shiftLeft(32).add(new W(c.getLowBits(),0))}}(v,W.fromString("100000000000000000"));M.low=M.low.add(w),C=w,((U=(L=M.low).high>>>0)<(j=C.high>>>0)||U===j&&L.low>>>0<C.low>>>0)&&(M.high=M.high.add(W.fromNumber(1))),r=y+6176;var H={low:W.fromNumber(0),high:W.fromNumber(0)};M.high.shiftRightUnsigned(49).and(W.fromNumber(1)).equals(W.fromNumber(1))?(H.high=H.high.or(W.fromNumber(3).shiftLeft(61)),H.high=H.high.or(W.fromNumber(r).and(W.fromNumber(16383).shiftLeft(47))),H.high=H.high.or(M.high.and(W.fromNumber(0x7fffffffffff)))):(H.high=H.high.or(W.fromNumber(16383&r).shiftLeft(49)),H.high=H.high.or(M.high.and(W.fromNumber(562949953421311)))),H.low=M.low,n&&(H.high=H.high.or(W.fromString("9223372036854775808")));var G=m.alloc(16);return S=0,G[S++]=255&H.low.low,G[S++]=H.low.low>>8&255,G[S++]=H.low.low>>16&255,G[S++]=H.low.low>>24&255,G[S++]=255&H.low.high,G[S++]=H.low.high>>8&255,G[S++]=H.low.high>>16&255,G[S++]=H.low.high>>24&255,G[S++]=255&H.high.low,G[S++]=H.high.low>>8&255,G[S++]=H.high.low>>16&255,G[S++]=H.high.low>>24&255,G[S++]=255&H.high.high,G[S++]=H.high.high>>8&255,G[S++]=H.high.high>>16&255,G[S++]=H.high.high>>24&255,new t(G)},t.prototype.toString=function(){for(var t,e=0,r=new Array(36),n=0;n<r.length;n++)r[n]=0;var i,o,s,u=0,a=!1,c={parts:[0,0,0,0]},f=[];u=0;var p=this.bytes,h=p[u++]|p[u++]<<8|p[u++]<<16|p[u++]<<24,l=p[u++]|p[u++]<<8|p[u++]<<16|p[u++]<<24,d=p[u++]|p[u++]<<8|p[u++]<<16|p[u++]<<24,g=p[u++]|p[u++]<<8|p[u++]<<16|p[u++]<<24;u=0,(new W(h,l),new W(d,g)).lessThan(W.ZERO)&&f.push("-");var y=g>>26&31;if(y>>3==3){if(30===y)return f.join("")+"Infinity";if(31===y)return"NaN";t=g>>15&16383,i=8+(g>>14&1)}else i=g>>14&7,t=g>>17&16383;var b=t-6176;if(c.parts[0]=(16383&g)+((15&i)<<14),c.parts[1]=d,c.parts[2]=l,c.parts[3]=h,0===c.parts[0]&&0===c.parts[1]&&0===c.parts[2]&&0===c.parts[3])a=!0;else for(s=3;s>=0;s--){var v=0,m=it(c);if(c=m.quotient,v=m.rem.low)for(o=8;o>=0;o--)r[9*s+o]=v%10,v=Math.floor(v/10)}if(a)e=1,r[u]=0;else for(e=36;!r[u];)e-=1,u+=1;var w=e-1+b;if(w>=34||w<=-7||b>0){if(e>34)return f.push("".concat(0)),b>0?f.push("E+".concat(b)):b<0&&f.push("E".concat(b)),f.join("");for(f.push("".concat(r[u++])),(e-=1)&&f.push("."),n=0;n<e;n++)f.push("".concat(r[u++]));f.push("E"),w>0?f.push("+".concat(w)):f.push("".concat(w))}else if(b>=0)for(n=0;n<e;n++)f.push("".concat(r[u++]));else{var S=e+b;if(S>0)for(n=0;n<S;n++)f.push("".concat(r[u++]));else f.push("0");for(f.push(".");S++<0;)f.push("0");for(n=0;n<e-Math.max(S-1,0);n++)f.push("".concat(r[u++]))}return f.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(st.prototype,"_bsontype",{value:"Decimal128"});var ut=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(t){return this.value.toString(t)},t.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:(Number.isInteger(this.value)?(e=this.value.toFixed(1)).length>=13&&(e=this.value.toExponential(13).toUpperCase()):e=this.value.toString(),{$numberDouble:e});var e},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 t=this.toExtendedJSON();return"new Double(".concat(t.$numberDouble,")")},t}();Object.defineProperty(ut.prototype,"_bsontype",{value:"Double"});var at=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=0|+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(t){return this.value.toString(t)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.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(at.prototype,"_bsontype",{value:"Int32"});var ct=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(ct.prototype,"_bsontype",{value:"MaxKey"});var ft=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(ft.prototype,"_bsontype",{value:"MinKey"});var pt=new RegExp("^[0-9a-fA-F]{24}$"),ht=null,lt=Symbol("id"),dt=function(){function t(e){if(!(this instanceof t))return new t(e);var r;if("object"==typeof e&&e&&"id"in e){if("string"!=typeof e.id&&!ArrayBuffer.isView(e.id))throw new _("Argument passed in must have an id that is of type string or Buffer");r="toHexString"in e&&"function"==typeof e.toHexString?m.from(e.toHexString(),"hex"):e.id}else r=e;if(null==r||"number"==typeof r)this[lt]=t.generate("number"==typeof r?r:void 0);else if(ArrayBuffer.isView(r)&&12===r.byteLength)this[lt]=r instanceof m?r:P(r);else{if("string"!=typeof r)throw new _("Argument passed in does not match the accepted types");if(12===r.length){var n=m.from(r);if(12!==n.byteLength)throw new _("Argument passed in must be a string of 12 bytes");this[lt]=n}else{if(24!==r.length||!pt.test(r))throw new _("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");this[lt]=m.from(r,"hex")}}t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[lt]},set:function(e){this[lt]=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(t){this.id.writeUInt32BE(t,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){"number"!=typeof e&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=m.alloc(12);return n.writeUInt32BE(e,0),null===ht&&(ht=A(5)),n[4]=ht[0],n[5]=ht[1],n[6]=ht[2],n[7]=ht[3],n[8]=ht[4],n[11]=255&r,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(null==e)return!1;if(e instanceof t)return this[lt][11]===e[lt][11]&&this[lt].equals(e[lt]);if("string"==typeof e&&t.isValid(e)&&12===e.length&&I(this.id))return e===m.prototype.toString.call(this.id,"latin1");if("string"==typeof e&&t.isValid(e)&&24===e.length)return e.toLowerCase()===this.toHexString();if("string"==typeof e&&t.isValid(e)&&12===e.length)return m.from(e).equals(this.id);if("object"==typeof e&&"toHexString"in e&&"function"==typeof e.toHexString){var r=e.toHexString(),n=this.toHexString().toLowerCase();return"string"==typeof r&&r.toLowerCase()===n}return!1},t.prototype.getTimestamp=function(){var t=new Date,e=this.id.readUInt32BE(0);return t.setTime(1e3*Math.floor(e)),t},t.createPk=function(){return new t},t.createFromTime=function(e){var r=m.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(void 0===e||null!=e&&24!==e.length)throw new _("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(m.from(e,"hex"))},t.isValid=function(e){if(null==e)return!1;try{return new t(e),!0}catch(t){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(16777215*Math.random()),t}();Object.defineProperty(dt.prototype,"generate",{value:D((function(t){return dt.generate(t)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(dt.prototype,"getInc",{value:D((function(){return dt.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(dt.prototype,"get_inc",{value:D((function(){return dt.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(dt,"get_inc",{value:D((function(){return dt.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(dt.prototype,"_bsontype",{value:"ObjectID"});var gt=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=(null!=r?r:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new E("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(-1!==this.options.indexOf("\0"))throw new E("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if("i"!==this.options[n]&&"m"!==this.options[n]&&"x"!==this.options[n]&&"l"!==this.options[n]&&"s"!==this.options[n]&&"u"!==this.options[n])throw new E("The regular expression option [".concat(this.options[n],"] is not supported"))}return t.parseOptions=function(t){return t?t.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(t){return(t=t||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e){if("string"==typeof e.$regex)return new t(e.$regex,t.parseOptions(e.$options));if("BSONRegExp"===e.$regex._bsontype)return e}if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new _("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t}();Object.defineProperty(gt.prototype,"_bsontype",{value:"BSONRegExp"});var yt=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(yt.prototype,"_bsontype",{value:"Symbol"});var bt=function(t){function e(r,n){var i=this;return i instanceof e?(i=W.isLong(r)?t.call(this,r.low,r.high,!0)||this:N(r)&&void 0!==r.t&&void 0!==r.i?t.call(this,r.i,r.t,!0)||this: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 S(e,t),e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(t){return new e(W.fromInt(t,!0))},e.fromNumber=function(t){return new e(W.fromNumber(t,!0))},e.fromBits=function(t,r){return new e(t,r)},e.fromString=function(t,r){return new e(W.fromString(t,!0,r))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(t){return new e(t.$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=W.MAX_UNSIGNED_VALUE,e}(W);var vt=2147483647,mt=-2147483648,wt=0x8000000000000000,St=-0x8000000000000000,Et={$oid:dt,$binary:j,$uuid:j,$symbol:yt,$numberInt:at,$numberDecimal:st,$numberDouble:ut,$numberLong:W,$minKey:ft,$maxKey:ct,$regex:gt,$regularExpression:gt,$timestamp:bt};function _t(t,e){if(void 0===e&&(e={}),"number"==typeof t){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=mt&&t<=vt)return new at(t);if(t>=St&&t<=wt)return W.fromNumber(t)}return new ut(t)}if(null==t||"object"!=typeof t)return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter((function(e){return e.startsWith("$")&&null!=t[e]})),n=0;n<r.length;n++){var i=Et[r[n]];if(i)return i.fromExtendedJSON(t,e)}if(null!=t.$date){var o=t.$date,s=new Date;return e.legacy?"number"==typeof o?s.setTime(o):"string"==typeof o&&s.setTime(Date.parse(o)):"string"==typeof o?s.setTime(Date.parse(o)):W.isLong(o)?s.setTime(o.toNumber()):"number"==typeof o&&e.relaxed&&s.setTime(o),s}if(null!=t.$code){var u=Object.assign({},t);return t.$scope&&(u.$scope=_t(t.$scope)),M.fromExtendedJSON(t)}if(function(t){return N(t)&&null!=t.$id&&"string"==typeof t.$ref&&(null==t.$db||"string"==typeof t.$db)}(t)||t.$dbPointer){var a=t.$ref?t:t.$dbPointer;if(a instanceof H)return a;var c=Object.keys(a).filter((function(t){return t.startsWith("$")})),f=!0;if(c.forEach((function(t){-1===["$ref","$id","$db"].indexOf(t)&&(f=!1)})),f)return H.fromExtendedJSON(a)}return t}function Ot(t){var e=t.toISOString();return 0!==t.getUTCMilliseconds()?e:e.slice(0,-5)+"Z"}function Tt(t,e){if(("object"==typeof t||"function"==typeof t)&&null!==t){var r=e.seenObjects.findIndex((function(e){return e.obj===t}));if(-1!==r){var n=e.seenObjects.map((function(t){return t.propertyName})),i=n.slice(0,r).map((function(t){return"".concat(t," -> ")})).join(""),o=n[r],s=" -> "+n.slice(r+1,n.length-1).map((function(t){return"".concat(t," -> ")})).join(""),u=n[n.length-1],a=" ".repeat(i.length+o.length/2),c="-".repeat(s.length+(o.length+u.length)/2-1);throw new _("Converting circular structure to EJSON:\n"+" ".concat(i).concat(o).concat(s).concat(u,"\n")+" ".concat(a,"\\").concat(c,"/"))}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return function(t,e){return t.map((function(t,r){e.seenObjects.push({propertyName:"index ".concat(r),obj:null});try{return Tt(t,e)}finally{e.seenObjects.pop()}}))}(t,e);if(void 0===t)return null;if(t instanceof Date||N(h=t)&&"[object Date]"===Object.prototype.toString.call(h)){var f=t.getTime(),p=f>-1&&f<2534023188e5;return e.legacy?e.relaxed&&p?{$date:t.getTime()}:{$date:Ot(t)}:e.relaxed&&p?{$date:Ot(t)}:{$date:{$numberLong:t.getTime().toString()}}}var h;if(!("number"!=typeof t||e.relaxed&&isFinite(t))){if(Math.floor(t)===t){var l=t>=St&&t<=wt;if(t>=mt&&t<=vt)return{$numberInt:t.toString()};if(l)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}(t)){var d=t.flags;if(void 0===d){var g=t.toString().match(/[gimuy]*$/);g&&(d=g[0])}return new gt(t.source,d).toExtendedJSON(e)}return null!=t&&"object"==typeof t?function(t,e){if(null==t||"object"!=typeof t)throw new E("not an object instance");var r=t._bsontype;if(void 0===r){var n={};for(var i in t){e.seenObjects.push({propertyName:i,obj:null});try{var o=Tt(t[i],e);"__proto__"===i?Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):n[i]=o}finally{e.seenObjects.pop()}}return n}if(function(t){return N(t)&&Reflect.has(t,"_bsontype")&&"string"==typeof t._bsontype}(t)){var s=t;if("function"!=typeof s.toExtendedJSON){var u=At[t._bsontype];if(!u)throw new _("Unrecognized or invalid _bsontype: "+t._bsontype);s=u(s)}return"Code"===r&&s.scope?s=new M(s.code,Tt(s.scope,e)):"DBRef"===r&&s.oid&&(s=new H(Tt(s.collection,e),Tt(s.oid,e),Tt(s.db,e),Tt(s.fields,e))),s.toExtendedJSON(e)}throw new E("_bsontype must be a string, but was: "+typeof r)}(t,e):t}var xt,At={Binary:function(t){return new j(t.value(),t.sub_type)},Code:function(t){return new M(t.code,t.scope)},DBRef:function(t){return new H(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new st(t.bytes)},Double:function(t){return new ut(t.value)},Int32:function(t){return new at(t.value)},Long:function(t){return W.fromBits(null!=t.low?t.low:t.low_,null!=t.low?t.high:t.high_,null!=t.low?t.unsigned:t.unsigned_)},MaxKey:function(){return new ct},MinKey:function(){return new ft},ObjectID:function(t){return new dt(t)},ObjectId:function(t){return new dt(t)},BSONRegExp:function(t){return new gt(t.pattern,t.options)},Symbol:function(t){return new yt(t.value)},Timestamp:function(t){return bt.fromBits(t.low,t.high)}};!function(t){function e(t,e){var r=Object.assign({},{relaxed:!0,legacy:!1},e);return"boolean"==typeof r.relaxed&&(r.strict=!r.relaxed),"boolean"==typeof r.strict&&(r.relaxed=!r.strict),JSON.parse(t,(function(t,e){if(-1!==t.indexOf("\0"))throw new E("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(t)));return _t(e,r)}))}function r(t,e,r,n){null!=r&&"object"==typeof r&&(n=r,r=0),null==e||"object"!=typeof e||Array.isArray(e)||(n=e,e=void 0,r=0);var i=Tt(t,Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(i,e,r)}t.parse=e,t.stringify=r,t.serialize=function(t,e){return e=e||{},JSON.parse(r(t,e))},t.deserialize=function(t,r){return r=r||{},e(JSON.stringify(t),r)}}(xt||(xt={}));var It=T();It.Map?It.Map:function(){function t(t){void 0===t&&(t=[]),this._keys=[],this._values={};for(var e=0;e<t.length;e++)if(null!=t[e]){var r=t[e],n=r[0],i=r[1];this._keys.push(n),this._values[n]={v:i,i:this._keys.length-1}}}t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(t){var e=this._values[t];return null!=e&&(delete this._values[t],this._keys.splice(e.i,1),!0)},t.prototype.entries=function(){var t=this,e=0;return{next:function(){var r=t._keys[e++];return{value:void 0!==r?[r,t._values[r].v]:void 0,done:void 0===r}}}},t.prototype.forEach=function(t,e){e=e||this;for(var r=0;r<this._keys.length;r++){var n=this._keys[r];t.call(e,this._values[n].v,n,e)}},t.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},t.prototype.has=function(t){return null!=this._values[t]},t.prototype.keys=function(){var t=this,e=0;return{next:function(){var r=t._keys[e++];return{value:void 0!==r?r:void 0,done:void 0===r}}}},t.prototype.set=function(t,e){return this._values[t]?(this._values[t].v=e,this):(this._keys.push(t),this._values[t]={v:e,i:this._keys.length-1},this)},t.prototype.values=function(){var t=this,e=0;return{next:function(){var r=t._keys[e++];return{value:void 0!==r?t._values[r].v:void 0,done:void 0===r}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0})}(),Math.pow(2,63),Math.pow(2,63);var Nt=Math.pow(2,53),Dt=-Math.pow(2,53);W.fromNumber(Nt),W.fromNumber(Dt),new Set(["$db","$ref","$id","$clusterTime"]);var Pt=new Uint8Array(8);new DataView(Pt.buffer,Pt.byteOffset,Pt.byteLength);m.alloc(17825792);var Bt=function(t,r,n){void 0===r&&(r={}),this.name=t,this.properties=r,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.activeTriggers=[],this.id=new dt,this.occurred=(new Date).toISOString(),n&&(this.trigger=new e(n))},kt=function(){function t(t){t.s&&(this.s=new Ut(t.s)),t.g&&(this.g=new Ft(t.g)),this.i=t.i}return Object.defineProperty(t.prototype,"solid",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossy",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"img",{get:function(){return this.i},enumerable:!1,configurable:!0}),t}();const Rt=new RegExp("[^#a-f\\d]","gi"),Lt=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i");var Ct,Ut=function(){function t(t){this.a=100,this.h=t.h,this.a=t.a,this.g=t.g}return Object.defineProperty(t.prototype,"hex",{get:function(){return this.h},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grad",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){if(!this.hex)return"";try{return function(t,e={}){if("string"!=typeof t||Rt.test(t)||!Lt.test(t))throw new TypeError("Expected a valid hex string");let r=1;8===(t=t.replace(/^#/,"")).length&&(r=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(r=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const n=Number.parseInt(t,16),i=n>>16,o=n>>8&255,s=255&n,u="number"==typeof e.alpha?e.alpha:r;return"array"===e.format?[i,o,s,u]:"css"===e.format?`rgb(${i} ${o} ${s}${1===u?"":` / ${Number((100*u).toFixed(2))}%`})`:{red:i,green:o,blue:s,alpha:u}}(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(){var t;return(null!==(t=this.a)&&void 0!==t?t:100)/100},t}(),jt=function(){function t(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new Ut(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.w},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t;return Ct[null!==(t=this.s)&&void 0!==t?t:Ct.SOLID]},enumerable:!1,configurable:!0}),t}();!function(t){t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED"}(Ct||(Ct={}));var Mt,Ht=function(t){var e;t=null!=t?t:{},this.name=t.name,this.fonts=null===(e=t.fonts)||void 0===e?void 0:e.map((function(t){return new Gt(t)}))},Gt=function(){function t(t){t=null!=t?t:{},this.style=t.style,this.url=t.url}return t.prototype.getFontDescriptor=function(){return{style:this.style===Mt.ITALICS||this.style===Mt.BOLD_ITALICS?"italic":"normal",weight:this.style===Mt.BOLD_ITALICS||this.style===Mt.BOLD?"700":"400"}},t.prototype.getURL=function(){return"url('".concat(this.url,"') format('truetype')")},t}();!function(t){t[t.REGULAR=1]="REGULAR",t[t.ITALICS=2]="ITALICS",t[t.BOLD=3]="BOLD",t[t.BOLD_ITALICS=4]="BOLD_ITALICS"}(Mt||(Mt={}));var Vt,$t=function(){function t(t){t=null!=t?t:{},this.s=t.s,this.lh=t.lh,t.fmly&&(this.fmly=new Ht(t.fmly))}return Object.defineProperty(t.prototype,"family",{get:function(){return this.fmly},enumerable:!1,configurable:!0}),t}(),Ft=function(){function t(t){this.r=t.r,t.c&&(this.c=new Ut(t.c)),t.fb&&(this.fb=new Ut(t.fb))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fallback",{get:function(){var e;return null!==(e=this.fb)&&void 0!==e?e:t.DEFAULT_FALLBACK},enumerable:!1,configurable:!0}),t.DEFAULT_FALLBACK=new Ut({h:"#000000",a:50}),t}(),qt=function(){function t(t){var e,r,n,i;t=null!=t?t:{},this.blur=null!==(e=t.blur)&&void 0!==e?e:0,this.spr=null!==(r=t.spr)&&void 0!==r?r:0,this.x=null!==(n=t.x)&&void 0!==n?n:0,this.y=null!==(i=t.y)&&void 0!==i?i:0,this.clr=new Ut(t.clr)}return t.prototype.getStyle=function(t){return"".concat(this.x*t,"px ").concat(this.y*t,"px ")+"".concat(this.blur*t,"px ").concat(this.spr*t,"px ").concat(this.clr.rgba)},t}(),zt=function(){function t(t){(null==t?void 0:t.rot)&&(this.rot=t.rot)}return Object.defineProperty(t.prototype,"rotate",{get:function(){return this.rot},enumerable:!1,configurable:!0}),t}(),Wt=function(){function t(t){this.t=t.t,t.bg&&(this.bg=new kt(t.bg)),t.br&&(this.br=new jt(t.br)),t.shd&&(this.shd=new qt(t.shd)),this.trf=new zt(t.trf),this.clc=t.clc,this.spc=t.spc,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y,this.a=t.a}return Object.defineProperty(t.prototype,"alpha",{get:function(){var t;return null!==(t=this.a)&&void 0!==t?t:100},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeAsString",{get:function(){return Vt[this.t]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"click",{get:function(){return this.clc},enumerable:!1,configurable:!0}),t}();!function(t){t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.SHAPE=100]="SHAPE"}(Vt||(Vt={}));var Jt,Kt,Yt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zt=function(t){function e(e){return t.call(this,e)||this}return Yt(e,t),e}(Wt),Xt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qt=function(t){function e(e){var r=t.call(this,e)||this;return r.src=e.src,r}return Xt(e,t),e}(Wt),te=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ee=function(t){function e(e){var r=t.call(this,e)||this;return r.alg=Jt.START,r.prs=e.prs,r.alg=e.alg,e.f&&(r.f=new $t(e.f)),e.c&&(r.c=new Ut(e.c)),r}return te(e,t),Object.defineProperty(e.prototype,"parts",{get:function(){return this.prs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.f},enumerable:!1,configurable:!0}),e}(Wt);!function(t){t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY"}(Jt||(Jt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SUPER=1]="SUPER",t[t.SUB=2]="SUB"}(Kt||(Kt={}));var re,ne=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ie=function(t){function e(e){var r,n,i,o=this;return(o=t.call(this,e)||this).o=null!==(r=e.o)&&void 0!==r?r:re.C,o.desk=e.desk,o.w=null!==(n=o.w)&&void 0!==n?n:1080,o.h=null!==(i=o.h)&&void 0!==i?i:1920,o}return ne(e,t),e.prototype.getOrigin=function(){return this.o},e}(Wt);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(re||(re={}));var oe,se=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ue=function(t){function e(e){var r=t.call(this,{bg:e.bg})||this;return r.elems=[],r.cont=new ie(e.cont),r.gvt=e.gvt,r.cover=void 0===e.cover||e.cover,r.bg||(r.bg=r.cont.bg,delete r.cont.bg),e.elems.forEach((function(t){t.t===Vt.IMAGE?r.elems.push(new Qt(t)):t.t===Vt.TEXT||t.t===Vt.BUTTON?r.elems.push(new ee(t)):t.t===Vt.SHAPE&&r.elems.push(new Zt(t))})),r}return se(e,t),e.prototype.getStyles=function(){var t;return(t=this.gvt===oe.NW?{top:0,left:0}:this.gvt===oe.N?{top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===oe.NE?{top:0,right:0}:this.gvt===oe.E?{top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===oe.SE?{bottom:0,right:0}:this.gvt===oe.S?{bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===oe.SW?{bottom:0,left:0}:this.gvt===oe.W?{top:"50%",left:0,transform:"translateY(-50%)"}:{top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"}).position="absolute",t.overflow="hidden",t},e}(Wt);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(oe||(oe={}));var ae=function(t){this.expireAt=(new Date).getTime(),this.id=t.id,this.expireAt=t.expireAt,this.version=t.version,this.engagementID=t.engagementID,this.internal=t.internal,this.pn=t.pn,this.ian=new ue(t.ian)},ce=function(){function t(){}return t.getString=function(e,r){return void 0===r&&(r=""),t.LOCAL_STORAGE.getItem(e)||r},t.setString=function(e,r){r||(r=""),t.LOCAL_STORAGE.setItem(e,r)},t.getNumber=function(e,r){return+t.getString(e,"")||r},t.setNumber=function(e,r){t.setString(e,r.toString())},t.getBoolean=function(t,e){var r=this.LOCAL_STORAGE.getItem(t);return r?JSON.parse(r):e},t.setBoolean=function(e,r){t.setString(e,JSON.stringify(r))},t.getObject=function(e){try{return JSON.parse(t.getString(e,""))}catch(t){return{}}},t.getArray=function(e,r){void 0===r&&(r=[]);try{return JSON.parse(t.getString(e,""))}catch(t){return r}},t.setObject=function(e,r){t.setString(e,JSON.stringify(r))},t.setArray=function(e,r){t.setString(e,JSON.stringify(r))},t.remove=function(e){t.LOCAL_STORAGE.removeItem(e)},t.LOCAL_STORAGE=window.localStorage,t}(),fe=function(){function r(){}return r.storeActiveTrigger=function(r){if("test"!==r.id){var n=ce.getObject(t.STORAGE_ACTIVE_TRIGGERS);n||(n=[]);var i=new e(r);i.isExpired||n.push(i),ce.setObject(t.STORAGE_ACTIVE_TRIGGER,i),ce.setObject(t.STORAGE_ACTIVE_TRIGGERS,n)}},r.getActiveTriggers=function(){var r=ce.getArray(t.STORAGE_ACTIVE_TRIGGERS);return r?(r.forEach((function(t,r,n){new e(t).isExpired&&n.splice(r,1)})),ce.setObject(t.STORAGE_ACTIVE_TRIGGERS,r),r):[]},r}(),pe=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},he=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},le=function(){function t(){this.loadedFonts=[]}return t.prototype.loadAllFonts=function(t){var e;return pe(this,void 0,void 0,(function(){var r=this;return he(this,(function(n){return null===(e=t.elems)||void 0===e||e.forEach((function(t){t instanceof ee&&r.loadFamily(t.font.family)})),[2]}))}))},t.prototype.loadFamily=function(t){return pe(this,void 0,void 0,(function(){var e;return he(this,(function(r){switch(r.label){case 0:return(null==t?void 0:t.fonts)?this.loadedFonts.indexOf(t.name)>-1?[2]:(e=[],t.fonts.forEach((function(r){if(r.url){var n=new FontFace(t.name,r.getURL(),r.getFontDescriptor());e.push(n.load())}})),this.loadedFonts.push(t.name),[4,Promise.all(e)]):[2];case 1:return r.sent().forEach((function(t){document.fonts.add(t)})),[2]}}))}))},t}(),de=function(){function e(){this.inInactive=!0,this.lastEnterActive=new Date,this.lastEnterInactive=null,this.isDebug=!1}return e.getInstance=function(){return this.INSTANCE},e.prototype.getWebAppVersion=function(){var t;return null!==(t=this.webAppVersion)&&void 0!==t?t:"0.0.1+1"},e.prototype.setWebAppVersion=function(t){this.webAppVersion=t},e.prototype.isDebugWebApp=function(){return this.isDebug},e.prototype.setDebugWebApp=function(t){this.isDebug=t},e.prototype.isInactive=function(){return this.inInactive},e.prototype.setInactive=function(){this.inInactive=!0,this.lastEnterInactive=new Date,ce.setNumber(t.STORAGE_LAST_ACTIVE,this.lastEnterInactive.getTime())},e.prototype.setActive=function(){this.inInactive=!1,this.lastEnterActive=new Date},e.prototype.isFirstActive=function(){return null==this.lastEnterInactive},e.prototype.getLastEnterInactive=function(){return this.lastEnterInactive},e.prototype.getTimeForActiveInSeconds=function(){var t,e;return((null===(t=this.lastEnterInactive)||void 0===t?void 0:t.getTime())-(null===(e=this.lastEnterActive)||void 0===e?void 0:e.getTime()))/1e3},e.prototype.getTimeForInactiveInSeconds=function(){return null==this.lastEnterInactive?0:((new Date).getTime()-this.lastEnterInactive.getTime())/1e3},e.prototype.setScreen=function(t){this.screen=t},e.prototype.getScreen=function(){return this.screen},e.INSTANCE=new e,e}(),ge=function(){function e(){}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.getCurrentSessionID=function(){return this.currentSessionID||null},e.prototype.isNewSessionRequired=function(){if(!ce.getString(t.STORAGE_SESSION_ID,""))return!0;var e=ce.getNumber(t.STORAGE_SESSION_START_TIME,0);return((new Date).getTime()-e)/1e3>t.IDLE_TIME_IN_SECONDS},e.prototype.checkForNewSession=function(){this.isNewSessionRequired()?this.startNewSession():this.initializeSessionFromStorage()},e.prototype.startNewSession=function(){this.currentSessionID||(this.currentSessionStartTime=new Date,this.currentSessionID=(new dt).toHexString(),ce.setNumber(t.STORAGE_SESSION_START_TIME,this.currentSessionStartTime.getTime()),ce.setString(t.STORAGE_SESSION_ID,this.currentSessionID),Tr.getInstance().sendEvent(new Bt(t.EVENT_SESSION_STARTED)),this.bumpSessionNumber())},e.prototype.bumpSessionNumber=function(){this.currentSessionNumber=ce.getNumber(t.STORAGE_SESSION_NUMBER,0),this.currentSessionNumber+=1,ce.setNumber(t.STORAGE_SESSION_NUMBER,this.currentSessionNumber)},e.prototype.getCurrentSessionNumber=function(){return this.currentSessionNumber||0},e.prototype.getTotalDurationInSeconds=function(){if(de.getInstance().isFirstActive())throw new Error("This is the first time in foreground after launch");return(this.getLastActive()-this.currentSessionStartTime.getTime())/1e3},e.prototype.conclude=function(){var e={sessionID:this.currentSessionID,occurred:new Date,duration:this.getTotalDurationInSeconds()};Tr.getInstance().concludeSession(e),ce.remove(t.STORAGE_ACTIVE_TRIGGER),this.destroySession()},e.prototype.destroySession=function(){this.currentSessionID=void 0,this.currentSessionNumber=void 0,this.currentSessionStartTime=void 0,ce.remove(t.STORAGE_SESSION_ID),ce.remove(t.STORAGE_SESSION_START_TIME)},e.prototype.initializeSessionFromStorage=function(){this.currentSessionStartTime=new Date(ce.getNumber(t.STORAGE_SESSION_START_TIME,0)),this.currentSessionID=ce.getString(t.STORAGE_SESSION_ID,""),this.currentSessionNumber=ce.getNumber(t.STORAGE_SESSION_NUMBER,0)},e.prototype.getLastActive=function(){return ce.getNumber(t.STORAGE_LAST_ACTIVE,0)},e}(),ye=function(t,e){return ye=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},ye(t,e)};function be(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}ye(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function ve(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function me(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function we(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}function Se(t){return"function"==typeof t}function Ee(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create;var _e=Ee((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function Oe(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Te=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=ve(o),u=s.next();!u.done;u=s.next())u.value.remove(this)}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var a=this.initialTeardown;if(Se(a))try{a()}catch(t){i=t instanceof _e?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var f=ve(c),p=f.next();!p.done;p=f.next()){var h=p.value;try{Ie(h)}catch(t){i=null!=i?i:[],t instanceof _e?i=we(we([],me(i)),me(t.errors)):i.push(t)}}}catch(t){r={error:t}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}}if(i)throw new _e(i)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)Ie(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&Oe(e,t)},t.prototype.remove=function(e){var r=this._finalizers;r&&Oe(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),xe=Te.EMPTY;function Ae(t){return t instanceof Te||t&&"closed"in t&&Se(t.remove)&&Se(t.add)&&Se(t.unsubscribe)}function Ie(t){Se(t)?t():t.unsubscribe()}var Ne=null,De=null,Pe=void 0,Be=!1,ke=!1,Re={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Re.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,we([t,e],me(r))):setTimeout.apply(void 0,we([t,e],me(r)))},clearTimeout:function(t){var e=Re.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Le(){}var Ce=Ue("C",void 0,void 0);function Ue(t,e,r){return{kind:t,value:e,error:r}}var je=null;function Me(t){if(Be){var e=!je;if(e&&(je={errorThrown:!1,error:null}),t(),e){var r=je,n=r.errorThrown,i=r.error;if(je=null,n)throw i}}else t()}var He=function(t){function e(e){var r=t.call(this)||this;return r.isStopped=!1,e?(r.destination=e,Ae(e)&&e.add(r)):r.destination=We,r}return be(e,t),e.create=function(t,e,r){return new Fe(t,e,r)},e.prototype.next=function(t){this.isStopped?ze(function(t){return Ue("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?ze(Ue("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?ze(Ce,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Te),Ge=Function.prototype.bind;function Ve(t,e){return Ge.call(t,e)}var $e=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){qe(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){qe(t)}else qe(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){qe(t)}},t}(),Fe=function(t){function e(e,r,n){var i,o,s=t.call(this)||this;return Se(e)||!e?i={next:null!=e?e:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&ke?((o=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},i={next:e.next&&Ve(e.next,o),error:e.error&&Ve(e.error,o),complete:e.complete&&Ve(e.complete,o)}):i=e,s.destination=new $e(i),s}return be(e,t),e}(He);function qe(t){var e;Be?(e=t,Be&&je&&(je.errorThrown=!0,je.error=e)):function(t){Re.setTimeout((function(){if(!Ne)throw t;Ne(t)}))}(t)}function ze(t,e){var r=De;r&&Re.setTimeout((function(){return r(t,e)}))}var We={closed:!0,next:Le,error:function(t){throw t},complete:Le},Je="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ke(t){return t}function Ye(t){return 0===t.length?Ke:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Ze=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n,i=this,o=(n=t)&&n instanceof He||function(t){return t&&Se(t.next)&&Se(t.error)&&Se(t.complete)}(n)&&Ae(n)?t:new Fe(t,e,r);return Me((function(){var t=i,e=t.operator,r=t.source;o.add(e?e.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=Xe(e))((function(e,n){var i=new Fe({next:function(e){try{t(e)}catch(t){n(t),i.unsubscribe()}},error:n,complete:e});r.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Je]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Ye(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=Xe(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function Xe(t){var e;return null!==(e=null!=t?t:Pe)&&void 0!==e?e:Promise}var Qe,tr,er=Ee((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),rr=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return be(e,t),e.prototype.lift=function(t){var e=new nr(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new er},e.prototype.next=function(t){var e=this;Me((function(){var r,n;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=ve(e.currentObservers),o=i.next();!o.done;o=i.next())o.value.next(t)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},e.prototype.error=function(t){var e=this;Me((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Me((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?xe:(this.currentObservers=null,o.push(t),new Te((function(){e.currentObservers=null,Oe(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,n=e.thrownError,i=e.isStopped;r?t.error(n):i&&t.complete()},e.prototype.asObservable=function(){var t=new Ze;return t.source=this,t},e.create=function(t,e){return new nr(t,e)},e}(Ze),nr=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return be(e,t),e.prototype.next=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===r||r.call(e,t)},e.prototype.error=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===r||r.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,r;return null!==(r=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==r?r:xe},e}(rr),ir={now:function(){return(ir.delegate||Date).now()},delegate:void 0},or=function(t){function e(e,r,n){void 0===e&&(e=1/0),void 0===r&&(r=1/0),void 0===n&&(n=ir);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,r),i}return be(e,t),e.prototype.next=function(e){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;n||(i.push(e),!o&&i.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!t.closed;i+=r?1:2)t.next(n[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,r=t._timestampProvider,n=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),u=0,a=1;a<n.length&&n[a]<=s;a+=2)u=a;u&&n.splice(0,u+1)}},e}(rr),sr=r(238),ur=r.n(sr),ar=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},cr=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},fr=function(){function t(){this.parser=new(ur()),this.result={}}return t.prototype.get=function(){return ar(this,void 0,void 0,(function(){var t;return cr(this,(function(e){switch(e.label){case 0:return t=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return e.sent(),[4,this.getLocation()];case 2:return e.sent(),t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},t.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},t.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},t.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,t]}}))}))},t.prototype.getDeviceMemory=function(){var t=navigator;if(t.deviceMemory){var e=t.deviceMemory;this.result.mem={tot:1024*e}}},t.prototype.getNetworkType=function(){var t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;(null==e?void 0:e.effectiveType)&&(this.result.net={type:e.effectiveType})},t.prototype.getOrientation=function(){var t,e=null===(t=screen.orientation)||void 0===t?void 0:t.type;e&&(this.result.orientation=e)},t.prototype.getDPI=function(){var t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);var e=window.devicePixelRatio||1,r=t.offsetWidth*e;return document.body.removeChild(t),r},t.prototype.getLocation=function(){return ar(this,void 0,void 0,(function(){var t=this;return cr(this,(function(e){switch(e.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=e.sent().state?[2]:[2,new Promise((function(e){navigator.geolocation.getCurrentPosition((function(r){t.result.coords=[r.coords.latitude,r.coords.longitude],e()}),(function(){return e()}))}))]}}))}))},t.prototype.getBatteryInfo=function(){return ar(this,void 0,void 0,(function(){var t;return cr(this,(function(e){switch(e.label){case 0:if(!("getBattery"in navigator))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),this.result.bat={l:100*t.level,c:t.charging},[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},t}(),pr=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},hr=function(){function e(){}return e.log=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];console.log.apply(console,pr([t.LOG_PREFIX,":"],e,!1))},e.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];console.error.apply(console,pr([t.LOG_PREFIX,":"],e,!1))},e.warning=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];console.warn.apply(console,pr([t.LOG_PREFIX,":"],e,!1))},e}(),lr=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},dr=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},gr=function(){function r(){this.runtimeData=de.getInstance(),this.apiToken="",this.userID=""}return r.getInstance=function(){return this.INSTANCE},r.prototype.doHTTP=function(e,r,n,i){return lr(this,void 0,void 0,(function(){var o,s,u;return dr(this,(function(a){switch(a.label){case 0:return r.startsWith("http")||(r=t.API_URL+r),o="keepalive"in new Request(""),i&&!o&&JSON.stringify(i).includes("CE App Background")?[2,this.performXMLHttpRequest(r,n,i)]:(s={method:e,headers:n,keepalive:!0},i&&(s.body=JSON.stringify(i)),[4,fetch(r,s)]);case 1:if(!(u=a.sent()).ok)throw u;return[2,u.json()]}}))}))},r.prototype.performXMLHttpRequest=function(t,e,r){var n=new XMLHttpRequest;return n.open("POST",t,!1),e.forEach((function(t,e){n.setRequestHeader(e,t)})),n.send(JSON.stringify(r)),n.response.json()},r.prototype.registerDevice=function(t){return lr(this,void 0,void 0,(function(){return dr(this,(function(e){return[2,this.doHTTP("POST","/v1/device/validate",this.getDefaultHeaders(),t)]}))}))},r.prototype.sendEvent=function(r){var n=this,i=this.getDefaultHeaders();r.activeTriggers=fe.getActiveTriggers();var o=new e(ce.getObject(t.STORAGE_ACTIVE_TRIGGER));!r.trigger&&o&&(o.updateExpired(),r.trigger=o,"test"===o.triggerID)||this.doHTTP("POST","/v1/event/track",i,r).then((function(t){hr.log("Sent",r.name),t.triggerData&&(new Fr).render(t.triggerData),t.userID&&t.sdkToken&&n.updateUserIDAndToken({userID:t.userID,sdkToken:t.sdkToken})})).catch((function(t){hr.error("Error sending event",t)}))},r.prototype.sendPastOrders=function(e){var r=this.getDefaultHeaders(),n={pastOrdersData:e};this.doHTTP("POST","/v1/event/trackPastOrders",r,n).then((function(){hr.log("Sent Past Orders"),ce.setBoolean(t.STORAGE_SHOPIFY_PAST_ORDERS_DATA_SENT,!0)})).catch((function(t){hr.error("Error sending event",t)}))},r.prototype.updateUserData=function(t){var e=this,r=this.getDefaultHeaders();this.doHTTP("PUT","/v1/user/update",r,t).then((function(t){hr.log("Updated user profile"),e.updateUserIDAndToken(t)})).catch((function(t){hr.error("Error saving user profile",t)}))},r.prototype.updateUserIDAndToken=function(e){Object.keys(e).length&&(e.userID&&(this.setUserID(e.userID),ce.setString(t.STORAGE_USER_ID,e.userID)),e.sdkToken&&(this.setAPIToken(e.sdkToken),ce.setString(t.STORAGE_SDK_TOKEN,e.sdkToken)))},r.prototype.updateDeviceProps=function(t){var e=this.getDefaultHeaders();this.doHTTP("PUT","/v1/device/update",e,t).then((function(){hr.log("Updated device property")})).catch((function(t){hr.error("Error saving device property",t)}))},r.prototype.concludeSession=function(t){var e=this.getDefaultHeaders();this.doHTTP("POST","/v1/session/conclude",e,t).then((function(t){hr.log("Conclude Session",t)})).catch((function(t){hr.error(t)}))},r.prototype.logout=function(){var t=this,e=this.getDefaultHeaders();this.doHTTP("GET","/v1/user/logout",e).then((function(e){hr.log("User logged out"),t.updateUserIDAndToken(e),ge.getInstance().startNewSession()})).catch((function(t){hr.error(t)}))},r.prototype.getDefaultHeaders=function(){var e=new Headers;return e.set("sdk-version",t.SDK_VERSION),e.set("sdk-version-code",t.SDK_VERSION_CODE.toString()),e.set("app-version",this.runtimeData.getWebAppVersion()),e.set("user-id",this.userID),this.apiToken&&e.append("x-sdk-token",this.apiToken),t.SDK_DEBUG&&e.set("sdk-debug",String(1)),this.runtimeData.isDebugWebApp()&&e.set("app-debug",String(1)),e},r.prototype.setAPIToken=function(t){this.apiToken=null!=t?t:""},r.prototype.setUserID=function(t){this.userID=null!=t?t:""},r.INSTANCE=new r,r}(),yr=function(e,r,n){this.appID=e,this.uuid=r,this.props=n,this.sdk=t.SDK},br=r(145),vr=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},mr=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},wr=function(){function e(){this.apiService=gr.getInstance(),this.sdkToken="",this.userID="",this.appID=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.init=function(t){return this.appID=t,this.acquireSDKToken()},e.prototype.hasToken=function(){return!!ce.getString(t.STORAGE_SDK_TOKEN,"")},e.prototype.getUserID=function(){return this.userID},e.prototype.populateUserDataFromStorage=function(){return vr(this,void 0,void 0,(function(){return mr(this,(function(e){return this.sdkToken=ce.getString(t.STORAGE_SDK_TOKEN,""),this.sdkToken||hr.log("No SDK token found in local storage"),this.userID=ce.getString(t.STORAGE_USER_ID,""),this.userID||hr.log("No user ID found in local storage"),this.updateAPIClient(),[2]}))}))},e.prototype.updateAPIClient=function(){hr.log("SDK Token:",this.sdkToken),hr.log("User ID:",this.userID),this.apiService.setAPIToken(this.sdkToken),this.apiService.setUserID(this.userID)},e.prototype.acquireSDKToken=function(){return vr(this,void 0,void 0,(function(){return mr(this,(function(t){return this.hasToken()?[2,this.populateUserDataFromStorage()]:(hr.log("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}))}))},e.prototype.getSDKTokenFromServer=function(){return vr(this,void 0,void 0,(function(){var t,e,r,n;return mr(this,(function(i){switch(i.label){case 0:return[4,this.getUserAuthRequest()];case 1:t=i.sent(),e=this.apiService.registerDevice(t),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e];case 3:return r=i.sent(),hr.log("Register Device Response",r),this.saveUserDataInStorage(r),[3,5];case 4:throw n=i.sent(),hr.error(n),n;case 5:return[2]}}))}))},e.prototype.saveUserDataInStorage=function(e){this.sdkToken=e.sdkToken,this.userID=e.userID,this.updateAPIClient(),ce.setString(t.STORAGE_SDK_TOKEN,this.sdkToken),ce.setString(t.STORAGE_USER_ID,this.userID)},e.prototype.getUserAuthRequest=function(){return vr(this,void 0,void 0,(function(){var t,e;return mr(this,(function(r){switch(r.label){case 0:return[4,(new fr).get()];case 1:(t=r.sent()).host=location.origin,r.label=2;case 2:return r.trys.push([2,4,,5]),[4,(0,br.r)()];case 3:return(null==(e=r.sent())?void 0:e.isPrivate)&&(t.private=!0),[3,5];case 4:return r.sent(),[3,5];case 5:return[2,new yr(this.appID,this.getOrCreateUUID(),t)]}}))}))},e.prototype.getOrCreateUUID=function(){var e=ce.getString(t.STORAGE_DEVICE_UUID,"");return e||(e=(new dt).toHexString(),ce.setString(t.STORAGE_DEVICE_UUID,e)),e},e.INSTANCE=new e,e}(),Sr=function(){function e(){}var r;return e.getString=function(t,e){return this.getItem(t)||e},e.setString=function(t,e){this.setItem(t,e)},e.getItem=function(t){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t))},e.setItem=function(t,e){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t),e)},e.getAppID=function(){return ce.getString(t.STORAGE_APP_ID)},r=e,e.SESSION_STORAGE=window.sessionStorage,e.SESSION_STORAGE_KEY_PREFIX=t.COOEE.concat("/",r.getAppID(),"/"),e}(),Er=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},_r=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},Or=function(){function e(){this.sessionManager=ge.getInstance(),this.safeHttpCallService=Tr.getInstance(),this.userAuthService=wr.getInstance()}return e.prototype.init=function(r){var n=this;t.BOT_UA_REGEX.test(navigator.userAgent)?hr.log("This seems to be a bot. Disabling SDK"):(this.userAuthService.init(r).then((function(){e.replaySubject.next(!0),e.replaySubject.complete()})).catch((function(){setTimeout((function(){n.init(r)}),3e4)})),this.execute())},e.prototype.execute=function(){this.sessionManager.checkForNewSession(),this.isAppFirstTimeLaunch()?this.sendFirstLaunchEvent():this.sendSuccessiveLaunchEvent()},e.prototype.isAppFirstTimeLaunch=function(){return!!ce.getBoolean(t.STORAGE_FIRST_TIME_LAUNCH,!0)&&(ce.setBoolean(t.STORAGE_FIRST_TIME_LAUNCH,!1),!0)},e.prototype.sendFirstLaunchEvent=function(){return Er(this,void 0,void 0,(function(){var e,r;return _r(this,(function(n){switch(n.label){case 0:return e=new Bt(t.EVENT_APP_INSTALLED,{}),r=e,[4,(new fr).get()];case 1:return r.deviceProps=n.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.sendSuccessiveLaunchEvent=function(){return Er(this,void 0,void 0,(function(){var e,r;return _r(this,(function(n){switch(n.label){case 0:return this.isNewTabOpened()?(e=new Bt(t.EVENT_APP_LAUNCHED),r=e,[4,(new fr).get()]):[2];case 1:return r.deviceProps=n.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.isNewTabOpened=function(){return!Sr.getString(t.SESSION_STORAGE_TAB_OPENED,"")&&(Sr.setString(t.SESSION_STORAGE_TAB_OPENED,"1"),!0)},e.replaySubject=new or(1),e}(),Tr=function(){function t(){this.sessionManager=ge.getInstance(),this.httpApiService=gr.getInstance()}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.sendEvent=function(t){var e=this;Or.replaySubject.subscribe((function(){e.addEventVariable(t),e.httpApiService.sendEvent(t)}))},t.prototype.sendPastOrders=function(t){var e=this;Or.replaySubject.subscribe((function(){e.httpApiService.sendPastOrders(t)}))},t.prototype.updateProfile=function(t){var e=this;Or.replaySubject.subscribe((function(){e.httpApiService.updateUserData(t)}))},t.prototype.updateDeviceProps=function(t){var e=this;Or.replaySubject.subscribe((function(){e.httpApiService.updateDeviceProps({props:t})}))},t.prototype.concludeSession=function(t){var e=this;Or.replaySubject.subscribe((function(){e.httpApiService.concludeSession(t)}))},t.prototype.logout=function(){var t=this;Or.replaySubject.subscribe((function(){t.httpApiService.logout()}))},t.prototype.addEventVariable=function(t){t.screenName=de.getInstance().getScreen(),t.properties.path=location.pathname,t.sessionID=this.sessionManager.getCurrentSessionID(),t.sessionNumber=this.sessionManager.getCurrentSessionNumber()},t}();!function(t){t[t.CAMERA=1]="CAMERA",t[t.LOCATION=2]="LOCATION",t[t.PUSH=3]="PUSH"}(Qe||(Qe={})),function(t){t[t.IAB=1]="IAB",t[t.EXTERNAL=2]="EXTERNAL",t[t.PROMPT=3]="PROMPT",t[t.SAME_TAB=4]="SAME_TAB",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.KV_VIEW_ITEM=101]="KV_VIEW_ITEM",t[t.KV_ADD_TO_CART=102]="KV_ADD_TO_CART",t[t.KV_COUPON_CODE=103]="KV_COUPON_CODE",t[t.KV_VIEW_CATEGORY=104]="KV_VIEW_CATEGORY"}(tr||(tr={}));var xr=function(){function t(){this.doc=document}return t.get=function(){return t._instance||(t._instance=new t),t._instance},t.prototype.getWidth=function(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientWidth:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth},t.prototype.getHeight=function(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientHeight:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight},t.prototype.isDesktop=function(){return this.parentContainer!==document.body?this.parentContainer.clientWidth>this.parentContainer.clientHeight:t.get().getWidth()>t.DEFAULT_DESKTOP_SIZE},t.prototype.calculateScalingFactor=function(e,r,n){var i,o=t.get().getWidth(),s=t.get().getHeight();if(this.isDesktop()&&(null==n?void 0:n.max)){var u=null!==(i=n.max)&&void 0!==i?i:t.DEFAULT_MAX_DESKTOP_SIZE;o=Math.min(o,u),s=Math.min(s,u)}this.scalingFactor=o/s<e/r?o/e:s/r,this.scalingFactor=Math.min(this.scalingFactor,1)},t.prototype.getScalingFactor=function(){return this.scalingFactor},t.prototype.createElement=function(t){return this.doc.createElement(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.setStyle=function(t,e,r){e&&(r?t.style.setProperty(e,r,"important"):t.style.removeProperty(e))},t.prototype.setAttribute=function(t,e,r){t.setAttribute(e,r)},t.prototype.removeInApp=function(t){var e=document.querySelector(".".concat(t.rootClassName));e&&e.parentElement.removeChild(e)},t.prototype.setParentContainer=function(t){this.parentContainer=t},t.DOCUMENT_STANDARD_MODE="CSS1Compat",t.DOCUMENT_QUIRKS_MODE="BackCompat",t.DEFAULT_MAX_DESKTOP_SIZE=1200,t.DEFAULT_DESKTOP_SIZE=992,t}(),Ar=function(){return Ar=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Ar.apply(this,arguments)},Ir=function(){function e(t,e){this.action=t,this.apiService=Tr.getInstance(),this.triggerContext=e}return e.prototype.execute=function(){var t=this.action.custKV;switch(this.action.at){case tr.EXTERNAL:this.externalAction();break;case tr.IAB:this.iabAction();break;case tr.SAME_TAB:this.gotoURLAction();break;case tr.SHARE:this.shareAction();break;case tr.PROMPT:this.prompt();break;case tr.KEY_VALUE:case tr.KV_ADD_TO_CART:case tr.KV_COUPON_CODE:case tr.KV_VIEW_CATEGORY:case tr.KV_VIEW_ITEM:t=Ar(Ar({},t),this.action.kv);break;case void 0:break;default:return void hr.error("Received an invalid ClickActionType: ",this.action.at)}this.upAction(),this.kvAction(t),this.closeAction()},e.prototype.externalAction=function(){var t,e;if(null===(t=this.action.ext)||void 0===t?void 0:t.u){var r=this.action.ext.u;this.isValidURL(r)||(r="//".concat(r)),null===(e=window.open(r,"_blank"))||void 0===e||e.focus()}},e.prototype.isValidURL=function(t){try{new URL(t)}catch(t){return!1}return!0},e.prototype.gotoURLAction=function(){var t;if(null===(t=this.action.gu)||void 0===t?void 0:t.u){var e=this.action.gu.u;this.isValidURL(e)||(e="//".concat(e)),window.open(e,"_self")}},e.prototype.iabAction=function(){var t;if(null===(t=this.action.iab)||void 0===t?void 0:t.u){var e=this.action.iab.u;this.isValidURL(e)||(e="//".concat(e)),(new Hr).render(e)}},e.prototype.upAction=function(){this.action.up&&this.apiService.updateProfile(this.action.up)},e.prototype.kvAction=function(t){document.dispatchEvent(new CustomEvent("onCooeeCTA",{detail:t}))},e.prototype.prompt=function(){var t=this.action.pmpt;t&&(t===Qe.LOCATION&&this.promptLocationPermission(),t===Qe.PUSH&&this.promptPushNotificationPermission(),t===Qe.CAMERA&&this.promptCameraPermission())},e.prototype.closeAction=function(){if(this.action.close){xr.get().removeInApp(this.triggerContext);var e=this.triggerContext.startTime,r=((new Date).getTime()-e.getTime())/1e3,n={closeBehaviour:this.containsCTA()?"CTA":"Close",duration:r},i=new Bt(t.EVENT_TRIGGER_CLOSED,n,this.triggerContext.triggerData);this.apiService.sendEvent(i)}},e.prototype.containsCTA=function(){return!!this.action.at||!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))},e.prototype.isEmpty=function(t){return!t||0===Object.keys(t).length},e.prototype.shareAction=function(){this.action.share&&(navigator.share?navigator.share({text:this.action.share.text,title:"Share"}).then((function(t){return console.log(t)})).catch((function(t){return console.error(t)})):hr.warning("Navigator.share is not compatible with this browser"))},e.prototype.promptLocationPermission=function(){var t=this;navigator.geolocation&&navigator.permissions&&navigator.geolocation.getCurrentPosition((function(e){t.apiService.updateDeviceProps({coords:[e.coords.latitude,e.coords.longitude]}),t.sendPermissionData()}))},e.prototype.promptPushNotificationPermission=function(){var t=this;"Notification"in window?"default"===Notification.permission?Notification.requestPermission().then((function(){t.sendPermissionData()})):this.apiService.updateDeviceProps({pnPerm:Notification.permission}):hr.warning("This browser does not support desktop notification")},e.prototype.promptCameraPermission=function(){var t=this;navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally((function(){t.sendPermissionData()}))},e.prototype.checkPermission=function(t){return navigator.permissions.query({name:t}).then((function(t){return t.state.toString()}))},e.prototype.checkAllPermission=function(){return t=this,e=void 0,n=function(){var t,e,r;return function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}(this,(function(n){switch(n.label){case 0:return[4,this.checkPermission("camera")];case 1:return t=n.sent(),[4,this.checkPermission("geolocation")];case 2:return e=n.sent(),r=Notification.permission,[2,{camera:t,location:e,notification:r}]}}))},new((r=void 0)||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}));var t,e,r,n},e.prototype.sendPermissionData=function(){var t=this;this.checkAllPermission().then((function(e){t.apiService.updateDeviceProps({perm:e})}))},e}(),Nr=function(){function t(t,e,r){this.renderer=xr.get(),this.screenWidth=0,this.screenHeight=0,this.parentHTMLEl=t,this.inappElement=e,this.triggerContext=r,this.scalingFactor=this.renderer.getScalingFactor(),this.screenWidth=this.renderer.getWidth(),this.screenHeight=this.renderer.getHeight()}return t.prototype.getHTMLElement=function(){return this.inappHTMLEl},t.prototype.insertElement=function(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)},t.prototype.processCommonBlocks=function(){this.processWidthAndHeight(),this.processPositionBlock(),this.processBorderBlock(),this.processBackgroundBlock(),this.processSpaceBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction(),this.renderer.setStyle(this.inappHTMLEl,"display","block"),this.renderer.setStyle(this.inappHTMLEl,"outline","none")},t.prototype.processWidthAndHeight=function(){this.renderer.setStyle(this.inappHTMLEl,"box-sizing","border-box"),this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(this.inappElement.h))},t.prototype.getSizePx=function(t){return t*this.scalingFactor+"px"},t.prototype.processPositionBlock=function(){this.renderer.setStyle(this.inappHTMLEl,"position","absolute"),this.inappElement.x&&this.renderer.setStyle(this.inappHTMLEl,"left",this.getSizePx(this.inappElement.x)),this.inappElement.y&&this.renderer.setStyle(this.inappHTMLEl,"top",this.getSizePx(this.inappElement.y))},t.prototype.processBorderBlock=function(){var t,e=this.inappElement.br;e&&(e.radius&&e.radius>0&&this.renderer.setStyle(this.inappHTMLEl,"border-radius",this.getSizePx(e.radius)),e.width&&e.width>0&&(this.renderer.setStyle(this.inappHTMLEl,"border-width",this.getSizePx(e.width)),this.renderer.setStyle(this.inappHTMLEl,"border-style",null===(t=e.style)||void 0===t?void 0:t.toLowerCase()),e.color?this.processColourBlock(e.color,"border-color"):this.renderer.setStyle(this.inappHTMLEl,"border-color","black")))},t.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;t&&(t.p&&this.renderer.setStyle(this.inappHTMLEl,"padding",this.getSizePx(t.p)),t.pt&&this.renderer.setStyle(this.inappHTMLEl,"padding-top",this.getSizePx(t.pt)),t.pb&&this.renderer.setStyle(this.inappHTMLEl,"padding-bottom",this.getSizePx(t.pb)),t.pl&&this.renderer.setStyle(this.inappHTMLEl,"padding-left",this.getSizePx(t.pl)),t.pr&&this.renderer.setStyle(this.inappHTMLEl,"padding-right",this.getSizePx(t.pr)),this.renderer.setStyle(this.inappHTMLEl,"margin","0 !important"))},t.prototype.processTransparency=function(){var t=this.inappElement.alpha;if(!isNaN(t)){var e=(t/100).toFixed(2);this.renderer.setStyle(this.inappHTMLEl,"opacity",e)}},t.prototype.processShadow=function(){var t=this.inappElement.shd;t&&this.renderer.setStyle(this.inappHTMLEl,"box-shadow",t.getStyle(this.scalingFactor))},t.prototype.processTransformBlock=function(){var t=new zt(this.inappElement.trf);t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform","rotate(".concat(t.rotate,"deg)"))},t.prototype.registerAction=function(){var t=this,e=this.inappElement.clc;e&&0!==Object.keys(e).length&&(this.inappHTMLEl.addEventListener("click",(function(r){r.stopPropagation(),new Ir(e,t.triggerContext).execute()})),this.inappElement instanceof ie&&1===Object.keys(e).length&&void 0!==e.close&&null!==e.close||this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))},t.prototype.processBackgroundBlock=function(){var t=this.inappElement.bg;if(t){var e=this.inappHTMLEl;if(t.glossy){var r="backdrop-filter",n="-webkit-"+r,i="blur(".concat(t.glossy.radius,"px)");if(!CSS.supports(n,i)&&!CSS.supports(r,i))return void this.renderer.setStyle(e,"background",t.glossy.fallback.rgba);this.renderer.setStyle(e,n,i),this.renderer.setStyle(e,r,i),t.glossy.color&&this.processColourBlock(t.glossy.color,"background",e)}else if(t.solid)t.solid.grad?this.processGradient(t.solid.grad,"background"):t.solid.hex&&this.renderer.setStyle(e,"background",t.solid.rgba);else if(t.img){if(!t.img.src)return;var o='url("'.concat(t.img.src,'") no-repeat center');this.renderer.setStyle(e,"background",o),this.renderer.setStyle(e,"background-size","cover"),t.img.a&&(this.renderer.setStyle(e,"-webkit-backdrop-filter","opacity(".concat(t.img.a,")")),this.renderer.setStyle(e,"backdrop-filter","opacity(".concat(t.img.a,")")))}}},t.prototype.processGradient=function(t,e){if("LINEAR"===t.type){var r="linear-gradient(".concat(t.ang,"deg, ").concat(t.c1,", ").concat(t.c2);t.c3&&(r+=", ".concat(t.c3)),r+=")",this.renderer.setStyle(this.inappHTMLEl,e,r)}},t.prototype.processColourBlock=function(t,e,r){void 0===e&&(e="color"),void 0===r&&(r=this.inappHTMLEl),t&&(t.grad?this.processGradient(t.grad,e):t.hex&&this.renderer.setStyle(r,e,t.rgba))},t}(),Dr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Pr=function(t){function e(e,r,n){return t.call(this,e,r,n)||this}return Dr(e,t),e.prototype.processCommonBlocks=function(){t.prototype.processCommonBlocks.call(this),this.processFontBlock(),this.processColourBlock(this.inappElement.color),this.processAlignment()},e.prototype.processFontBlock=function(){var t,e=this.inappElement.font;e&&(this.renderer.setStyle(this.inappHTMLEl,"font-size",this.getSizePx(e.s)),this.renderer.setStyle(this.inappHTMLEl,"font-family",null===(t=e.family)||void 0===t?void 0:t.name),this.renderer.setStyle(this.inappHTMLEl,"line-height",e.lh))},e.prototype.processPart=function(t,e){var r,n=[];e.u&&n.push("underline"),e.st&&n.push("line-through"),n.length||n.push("normal"),this.renderer.setStyle(t,"font-weight",e.b?"bold":"normal"),this.renderer.setStyle(t,"font-style",e.i?"italic":"normal"),this.renderer.setStyle(t,"text-decoration",n.join(" ")),this.renderer.setStyle(t,"color",null!==(r=e.c)&&void 0!==r?r:"inherit"),this.renderer.setStyle(t,"font-family","inherit")},e.prototype.processAlignment=function(){var t,e=null===(t=Jt[this.inappElement.alg])||void 0===t?void 0:t.toLowerCase();e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)},e}(Nr),Br=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),kr=function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.inappHTMLEl=i.renderer.createElement("div"),i.insertElement(),i}return Br(e,t),e.prototype.render=function(){var t,e=this;null===(t=this.inappElement.parts)||void 0===t||t.forEach((function(t){var r,n,i=e.renderer.createElement("span");i.innerHTML=null===(n=null===(r=t.txt)||void 0===r?void 0:r.toString())||void 0===n?void 0:n.replace(/\n/g,"<br />"),e.processPart(i,t),e.renderer.appendChild(e.inappHTMLEl,i)})),this.processCommonBlocks()},e}(Pr),Rr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lr=function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.inappHTMLEl=i.renderer.createElement("div"),i.insertElement(),i}return Rr(e,t),e.prototype.render=function(){this.processCommonBlocks()},e}(Nr),Cr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ur=function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.inappHTMLEl=i.renderer.createElement("img"),i.insertElement(),i}return Cr(e,t),e.prototype.render=function(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","none"),this.renderer.setStyle(this.inappHTMLEl,"max-height","none"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()},e}(Nr),jr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mr=function(e){function r(t,r,n){var i=e.call(this,t,r,n)||this;return i.parent=t,i.inappHTMLEl=i.renderer.createElement("div"),i}return jr(r,e),r.prototype.render=function(){var e=this;return this.parent||this.renderer.removeInApp(this.triggerContext),this.inappHTMLEl.classList.add(t.IN_APP_CONTAINER_NAME),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),this.renderer.setStyle(this.inappHTMLEl,"z-index",r.MAX_Z_INDEX),this.addProperties(),this.insertElement(),this.inappHTMLEl.addEventListener("click",(function(){new Ir({close:!0},e.triggerContext).execute()})),this.inappHTMLEl},r.prototype.addProperties=function(){var t,e=this.inappElement.cont;this.inappElement.cover?(this.processBackgroundBlock(),this.renderer.setStyle(this.inappHTMLEl,"top","0"),this.renderer.setStyle(this.inappHTMLEl,"left","0"),this.renderer.setStyle(this.inappHTMLEl,"width","100%"),this.renderer.setStyle(this.inappHTMLEl,"height","100%")):(this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(e.w)),this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(e.h)),(null===(t=e.desk)||void 0===t?void 0:t.max)&&xr.get().getWidth()>992&&this.renderer.setStyle(this.inappHTMLEl,"margin","15px"),Object.assign(this.inappHTMLEl.style,this.inappElement.getStyles())),this.parent!==document.body?this.renderer.setStyle(this.inappHTMLEl,"position","absolute"):this.renderer.setStyle(this.inappHTMLEl,"position","fixed")},r.MAX_Z_INDEX="2147483647",r}(Nr),Hr=function(){function e(){this.renderer=xr.get()}return e.prototype.render=function(e){var r=document.querySelector(".".concat(t.IN_APP_CONTAINER_NAME)),n=this.createIFrameContainer();return this.createIFrameElement(n,e),this.createAnchorElement(r,n),this.renderer.appendChild(r,n),n},e.prototype.createIFrameContainer=function(){var t=this.renderer.createElement("div");return this.renderer.setAttribute(t,"class","iframe-container"),this.renderer.setAttribute(t,"id","iframe-container"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0px"),this.renderer.setStyle(t,"left","0px"),t},e.prototype.createIFrameElement=function(t,e){var r=this.renderer.createElement("iframe");return this.renderer.setStyle(r,"width","100%"),this.renderer.setStyle(r,"height","100%"),this.renderer.setAttribute(r,"src",e),this.renderer.setAttribute(r,"frameBorder","0"),this.renderer.appendChild(t,r),r},e.prototype.createAnchorElement=function(t,e){var r=this.renderer.createElement("a");return this.renderer.setStyle(r,"position","absolute"),this.renderer.setStyle(r,"top","0px"),this.renderer.setStyle(r,"right","0px"),r.href="#",r.innerHTML="Close",r.onclick=function(){t.removeChild(e)},this.renderer.appendChild(e,r),r},e}(),Gr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Vr=function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.inappHTMLEl=i.renderer.createElement("div"),i.insertElement(),i}return Gr(e,t),e.prototype.render=function(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),this},e}(Nr),$r=function(){function e(t,e){this._startTime=t,this._triggerData=e}return Object.defineProperty(e.prototype,"startTime",{get:function(){return this._startTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"triggerData",{get:function(){return this._triggerData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootClassName",{get:function(){var e=this.triggerData.id.slice(-6);return"test"===e&&(e=this.startTime.getTime().toString()),t.IN_APP_CONTAINER_NAME+"-"+e},enumerable:!1,configurable:!0}),e}(),Fr=function(){function e(t){this.renderer=xr.get(),this.parent=null!=t?t:document.body,this.renderer.setParentContainer(this.parent)}return e.prototype.render=function(e){e=new ae(e);var r=new $r(new Date,e);this.ian=e.ian,this.renderer.calculateScalingFactor(this.ian.cont.w,this.ian.cont.h,this.ian.cont.desk),this.rootContainer=new Mr(this.parent,this.ian,r).render();try{this.renderContainer(r);var n=new Bt(t.EVENT_TRIGGER_DISPLAYED,{},r.triggerData);Tr.getInstance().sendEvent(n),fe.storeActiveTrigger(e)}catch(t){hr.error(t)}},e.prototype.renderElement=function(t,e,r){e instanceof ee?new kr(t,e,r).render():e instanceof Qt?new Ur(t,e,r).render():e instanceof Zt?new Lr(t,e,r).render():hr.error("Unsupported element type- "+e.type)},e.prototype.renderContainer=function(t){var e,r,n=this,i=null===(e=this.ian)||void 0===e?void 0:e.cont;if(i){var o=new Vr(this.rootContainer,i,t).render().getHTMLElement();this.ian.gvt||(this.ian.gvt=this.ian.cont.getOrigin()),Object.assign(o.style,this.ian.getStyles()),(new le).loadAllFonts(this.ian),null===(r=this.ian.elems)||void 0===r||r.forEach((function(e){return r=n,i=void 0,u=function(){return function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}(this,(function(r){switch(r.label){case 0:return[4,this.renderElement(o,e,t)];case 1:return r.sent(),[2]}}))},new((s=void 0)||(s=Promise))((function(t,e){function n(t){try{a(u.next(t))}catch(t){e(t)}}function o(t){try{a(u.throw(t))}catch(t){e(t)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof s?r:new s((function(t){t(r)}))).then(n,o)}a((u=u.apply(r,i||[])).next())}));var r,i,s,u}))}},e}();const qr=Fr})(),CooeePreview=n.default})();
|
|
2
|
+
(()=>{var t={145:(t,e)=>{"use strict";e.r=void 0,e.r=function(){return new Promise((function(t,e){var r,n,i="Unknown";function o(e){t({isPrivate:e,browserName:i})}function s(t){return t===eval.toString().length}void 0!==(n=navigator.vendor)&&0===n.indexOf("Apple")&&s(37)?(i="Safari",void 0!==navigator.maxTouchPoints?function(){var t=String(Math.random());try{window.indexedDB.open(t,1).onupgradeneeded=function(e){var r,n,i=null===(r=e.target)||void 0===r?void 0:r.result;try{i.createObjectStore("test",{autoIncrement:!0}).put(new Blob),o(!1)}catch(t){var s=t;return t instanceof Error&&(s=null!==(n=t.message)&&void 0!==n?n:t),o("string"==typeof s&&/BlobURLs are not yet supported/.test(s))}finally{i.close(),window.indexedDB.deleteDatabase(t)}}}catch(t){return o(!1)}}():function(){var t=window.openDatabase,e=window.localStorage;try{t(null,null,null,null)}catch(t){return o(!0)}try{e.setItem("test","1"),e.removeItem("test")}catch(t){return o(!0)}o(!1)}()):function(){var t=navigator.vendor;return void 0!==t&&0===t.indexOf("Google")&&s(33)}()?(r=navigator.userAgent,i=r.match(/Chrome/)?void 0!==navigator.brave?"Brave":r.match(/Edg/)?"Edge":r.match(/OPR/)?"Opera":"Chrome":"Chromium",void 0!==self.Promise&&void 0!==self.Promise.allSettled?navigator.webkitTemporaryStorage.queryUsageAndQuota((function(t,e){var r;o(e<(void 0!==(r=window).performance&&void 0!==r.performance.memory&&void 0!==r.performance.memory.jsHeapSizeLimit?performance.memory.jsHeapSizeLimit:1073741824))}),(function(t){e(new Error("detectIncognito somehow failed to query storage quota: "+t.message))})):(0,window.webkitRequestFileSystem)(0,1,(function(){o(!1)}),(function(){o(!0)}))):void 0!==document.documentElement&&void 0!==document.documentElement.style.MozAppearance&&s(37)?(i="Firefox",o(void 0===navigator.serviceWorker)):void 0!==navigator.msSaveBlob&&s(39)?(i="Internet Explorer",o(void 0===window.indexedDB)):e(new Error("detectIncognito cannot determine the browser"))}))}},238:function(t,e,r){var n;!function(i,o){"use strict";var s="function",u="undefined",a="object",c="string",f="model",p="name",l="type",h="vendor",d="version",g="architecture",y="console",b="mobile",v="tablet",m="smarttv",w="wearable",S="embedded",E="Amazon",_="Apple",O="ASUS",T="BlackBerry",x="Google",A="Huawei",I="LG",N="Microsoft",D="Motorola",P="Samsung",B="Sony",R="Xiaomi",k="Zebra",L="Facebook",C=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},U=function(t,e){return typeof t===c&&-1!==j(e).indexOf(j(t))},j=function(t){return t.toLowerCase()},M=function(t,e){if(typeof t===c)return t=t.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof e===u?t:t.substring(0,255)},H=function(t,e){for(var r,n,i,u,c,f,p=0;p<e.length&&!c;){var l=e[p],h=e[p+1];for(r=n=0;r<l.length&&!c;)if(c=l[r++].exec(t))for(i=0;i<h.length;i++)f=c[++n],typeof(u=h[i])===a&&u.length>0?2===u.length?typeof u[1]==s?this[u[0]]=u[1].call(this,f):this[u[0]]=u[1]:3===u.length?typeof u[1]!==s||u[1].exec&&u[1].test?this[u[0]]=f?f.replace(u[1],u[2]):o:this[u[0]]=f?u[1].call(this,f,u[2]):o:4===u.length&&(this[u[0]]=f?u[3].call(this,f.replace(u[1],u[2])):o):this[u]=f||o;p+=2}},G=function(t,e){for(var r in e)if(typeof e[r]===a&&e[r].length>0){for(var n=0;n<e[r].length;n++)if(U(e[r][n],t))return"?"===r?o:r}else if(U(e[r],t))return"?"===r?o:r;return t},V={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"},$={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[d,[p,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[d,[p,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[p,d],[/opios[\/ ]+([\w\.]+)/i],[d,[p,"Opera Mini"]],[/\bopr\/([\w\.]+)/i],[d,[p,"Opera"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[p,d],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[d,[p,"UCBrowser"]],[/\bqbcore\/([\w\.]+)/i],[d,[p,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[d,[p,"WeChat"]],[/konqueror\/([\w\.]+)/i],[d,[p,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[d,[p,"IE"]],[/yabrowser\/([\w\.]+)/i],[d,[p,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[p,/(.+)/,"$1 Secure Browser"],d],[/\bfocus\/([\w\.]+)/i],[d,[p,"Firefox Focus"]],[/\bopt\/([\w\.]+)/i],[d,[p,"Opera Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[d,[p,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[d,[p,"Dolphin"]],[/coast\/([\w\.]+)/i],[d,[p,"Opera Coast"]],[/miuibrowser\/([\w\.]+)/i],[d,[p,"MIUI Browser"]],[/fxios\/([-\w\.]+)/i],[d,[p,"Firefox"]],[/\bqihu|(qi?ho?o?|360)browser/i],[[p,"360 Browser"]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[p,/(.+)/,"$1 Browser"],d],[/(comodo_dragon)\/([\w\.]+)/i],[[p,/_/g," "],d],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[p,d],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[p],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[p,L],d],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[p,d],[/\bgsa\/([\w\.]+) .*safari\//i],[d,[p,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[d,[p,"Chrome Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[p,"Chrome WebView"],d],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[d,[p,"Android Browser"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[p,d],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[d,[p,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[d,p],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[p,[d,G,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[p,d],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[p,"Netscape"],d],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[d,[p,"Firefox Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\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|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[p,d]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[g,"amd64"]],[/(ia32(?=;))/i],[[g,j]],[/((?:i[346]|x)86)[;\)]/i],[[g,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[g,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[g,"armhf"]],[/windows (ce|mobile); ppc;/i],[[g,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[g,/ower/,"",j]],[/(sun4\w)[;\)]/i],[[g,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[g,j]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[f,[h,P],[l,v]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[f,[h,P],[l,b]],[/\((ip(?:hone|od)[\w ]*);/i],[f,[h,_],[l,b]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[f,[h,_],[l,v]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[f,[h,A],[l,v]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}-[atu]?[ln][01259x][012359][an]?)\b(?!.+d\/s)/i],[f,[h,A],[l,b]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[f,/_/g," "],[h,R],[l,b]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[f,/_/g," "],[h,R],[l,v]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[f,[h,"OPPO"],[l,b]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[f,[h,"Vivo"],[l,b]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[f,[h,"Realme"],[l,b]],[/\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],[f,[h,D],[l,b]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[f,[h,D],[l,v]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[f,[h,I],[l,v]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[f,[h,I],[l,b]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[f,[h,"Lenovo"],[l,v]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[f,/_/g," "],[h,"Nokia"],[l,b]],[/(pixel c)\b/i],[f,[h,x],[l,v]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[f,[h,x],[l,b]],[/droid.+ ([c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[f,[h,B],[l,b]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[f,"Xperia Tablet"],[h,B],[l,v]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[f,[h,"OnePlus"],[l,b]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[f,[h,E],[l,v]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[f,/(.+)/g,"Fire Phone $1"],[h,E],[l,b]],[/(playbook);[-\w\),; ]+(rim)/i],[f,h,[l,v]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[f,[h,T],[l,b]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[f,[h,O],[l,v]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[f,[h,O],[l,b]],[/(nexus 9)/i],[f,[h,"HTC"],[l,v]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony)[-_ ]?([-\w]*)/i],[h,[f,/_/g," "],[l,b]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[f,[h,"Acer"],[l,v]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[f,[h,"Meizu"],[l,b]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[f,[h,"Sharp"],[l,b]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[h,f,[l,b]],[/(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],[h,f,[l,v]],[/(surface duo)/i],[f,[h,N],[l,v]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[f,[h,"Fairphone"],[l,b]],[/(u304aa)/i],[f,[h,"AT&T"],[l,b]],[/\bsie-(\w*)/i],[f,[h,"Siemens"],[l,b]],[/\b(rct\w+) b/i],[f,[h,"RCA"],[l,v]],[/\b(venue[\d ]{2,7}) b/i],[f,[h,"Dell"],[l,v]],[/\b(q(?:mv|ta)\w+) b/i],[f,[h,"Verizon"],[l,v]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[f,[h,"Barnes & Noble"],[l,v]],[/\b(tm\d{3}\w+) b/i],[f,[h,"NuVision"],[l,v]],[/\b(k88) b/i],[f,[h,"ZTE"],[l,v]],[/\b(nx\d{3}j) b/i],[f,[h,"ZTE"],[l,b]],[/\b(gen\d{3}) b.+49h/i],[f,[h,"Swiss"],[l,b]],[/\b(zur\d{3}) b/i],[f,[h,"Swiss"],[l,v]],[/\b((zeki)?tb.*\b) b/i],[f,[h,"Zeki"],[l,v]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],f,[l,v]],[/\b(ns-?\w{0,9}) b/i],[f,[h,"Insignia"],[l,v]],[/\b((nxa|next)-?\w{0,9}) b/i],[f,[h,"NextBook"],[l,v]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],f,[l,b]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],f,[l,b]],[/\b(ph-1) /i],[f,[h,"Essential"],[l,b]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[f,[h,"Envizen"],[l,v]],[/\b(trio[-\w\. ]+) b/i],[f,[h,"MachSpeed"],[l,v]],[/\btu_(1491) b/i],[f,[h,"Rotor"],[l,v]],[/(shield[\w ]+) b/i],[f,[h,"Nvidia"],[l,v]],[/(sprint) (\w+)/i],[h,f,[l,b]],[/(kin\.[onetw]{3})/i],[[f,/\./g," "],[h,N],[l,b]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[f,[h,k],[l,v]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[f,[h,k],[l,b]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,f,[l,y]],[/droid.+; (shield) bui/i],[f,[h,"Nvidia"],[l,y]],[/(playstation [345portablevi]+)/i],[f,[h,B],[l,y]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[f,[h,N],[l,y]],[/smart-tv.+(samsung)/i],[h,[l,m]],[/hbbtv.+maple;(\d+)/i],[[f,/^/,"SmartTV"],[h,P],[l,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,I],[l,m]],[/(apple) ?tv/i],[h,[f,"Apple TV"],[l,m]],[/crkey/i],[[f,"Chromecast"],[h,x],[l,m]],[/droid.+aft(\w)( bui|\))/i],[f,[h,E],[l,m]],[/\(dtv[\);].+(aquos)/i],[f,[h,"Sharp"],[l,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,M],[f,M],[l,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[l,m]],[/((pebble))app/i],[h,f,[l,w]],[/droid.+; (glass) \d/i],[f,[h,x],[l,w]],[/droid.+; (wt63?0{2,3})\)/i],[f,[h,k],[l,w]],[/(quest( 2)?)/i],[f,[h,L],[l,w]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[l,S]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[f,[l,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[f,[l,v]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[l,v]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[l,b]],[/(android[-\w\. ]{0,9});.+buil/i],[f,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[d,[p,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[d,[p,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[p,d],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[d,p]],os:[[/microsoft (windows) (vista|xp)/i],[p,d],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[p,[d,G,V]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,"Windows"],[d,G,V]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[d,/_/g,"."],[p,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[p,"Mac OS"],[d,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[d,p],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[p,d],[/\(bb(10);/i],[d,[p,T]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[d,[p,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[d,[p,"Firefox OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[d,[p,"webOS"]],[/crkey\/([\d\.]+)/i],[d,[p,"Chromecast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[p,"Chromium OS"],d],[/(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],[p,d],[/(sunos) ?([\w\.\d]*)/i],[[p,"Solaris"],d],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[p,d]]},F=function(t,e){if(typeof t===a&&(e=t,t=o),!(this instanceof F))return new F(t,e).getResult();var r=t||(typeof i!==u&&i.navigator&&i.navigator.userAgent?i.navigator.userAgent:""),n=e?function(t,e){var r={};for(var n in t)e[n]&&e[n].length%2==0?r[n]=e[n].concat(t[n]):r[n]=t[n];return r}($,e):$;return this.getBrowser=function(){var t,e={};return e.name=o,e.version=o,H.call(e,r,n.browser),e.major=typeof(t=e.version)===c?t.replace(/[^\d\.]/g,"").split(".")[0]:o,e},this.getCPU=function(){var t={};return t.architecture=o,H.call(t,r,n.cpu),t},this.getDevice=function(){var t={};return t.vendor=o,t.model=o,t.type=o,H.call(t,r,n.device),t},this.getEngine=function(){var t={};return t.name=o,t.version=o,H.call(t,r,n.engine),t},this.getOS=function(){var t={};return t.name=o,t.version=o,H.call(t,r,n.os),t},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 r},this.setUA=function(t){return r=typeof t===c&&t.length>255?M(t,255):t,this},this.setUA(r),this};F.VERSION="1.0.2",F.BROWSER=C([p,d,"major"]),F.CPU=C([g]),F.DEVICE=C([f,h,l,y,b,m,v,w,S]),F.ENGINE=F.OS=C([p,d]),typeof e!==u?(t.exports&&(e=t.exports=F),e.UAParser=F):r.amdO?(n=function(){return F}.call(e,r,e,t))===o||(t.exports=n):typeof i!==u&&(i.UAParser=F);var q=typeof i!==u&&(i.jQuery||i.Zepto);if(q&&!q.ua){var z=new F;q.ua=z.getResult(),q.ua.get=function(){return z.getUA()},q.ua.set=function(t){z.setUA(t);var e=z.getResult();for(var r in e)q.ua[r]=e[r]}}}("object"==typeof window?window:this)},147:t=>{"use strict";t.exports={i8:"0.1.0"}}},e={};function r(n){var i=e[n];if(void 0!==i)return i.exports;var o=e[n]={exports:{}};return t[n].call(o.exports,o,o.exports,r),o.exports}r.amdO={},r.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return r.d(e,{a:e}),e},r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);var n={};(()=>{"use strict";r.d(n,{default:()=>Wr});for(var t=function(){function t(){}var e,n;return e=t,t.API_URL="https://api.sdk.letscooee.com",t.SDK_VERSION=r(147).i8,t.SDK_DEBUG=!1,t.SDK="WEB",t.LOG_PREFIX="CooeeSDK",t.COOEE="cooee",t.CANVAS_WIDTH=1080,t.CANVAS_HEIGHT=1920,t.STORAGE_APP_ID="cooaid",t.STORAGE_USER_ID="uid",t.STORAGE_SDK_TOKEN="st",t.STORAGE_DEVICE_UUID="uuid",t.STORAGE_SESSION_ID="sid",t.STORAGE_SESSION_NUMBER="sn",t.STORAGE_SESSION_START_TIME="sst",t.STORAGE_SESSION_START_EVENT_SENT="sses",t.STORAGE_FIRST_TIME_LAUNCH="ifl",t.STORAGE_LAST_ACTIVE="la",t.STORAGE_ACTIVE_TRIGGER="at",t.STORAGE_ACTIVE_TRIGGERS="ats",t.STORAGE_SHOPIFY_PAST_ORDERS_DATA_SENT="spods",t.SESSION_STORAGE_TAB_OPENED="tabop",t.IDLE_TIME_IN_SECONDS=1800,t.IN_APP_CONTAINER_NAME="cooee-wrapper",n=t.SDK_VERSION.split(".").map((function(t){return t.padStart(2,"0")})).join(""),t.SDK_VERSION_CODE=parseInt(n,10),t.EVENT_SCREEN_VIEW="CE Screen View",t.EVENT_APP_INSTALLED="CE App Installed",t.EVENT_APP_LAUNCHED="CE App Launched",t.EVENT_SESSION_CONCLUDED="CE Session Concluded",t.EVENT_SESSION_STARTED="CE Session Started",t.EVENT_APP_FOREGROUND="CE App Foreground",t.EVENT_APP_BACKGROUND="CE App Background",t.EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed",t.EVENT_TRIGGER_CLOSED="CE Trigger Closed",t.BOT_USER_AGENTS_PATTERN="(googlebot/|bot|Googlebot-Mobile|Googlebot-Image|Google favicon|Mediapartners-Google|bingbot|slurp|java|wget|curl|Commons-HttpClient|Python-urllib|libwww|httpunit|nutch|phpcrawl|msnbot|jyxobot|FAST-WebCrawler|FAST Enterprise Crawler|biglotron|teoma|convera|seekbot|gigablast|exabot|ngbot|ia_archiver|GingerCrawler|webmon |httrack|webcrawler|grub.org|UsineNouvelleCrawler|antibot|netresearchserver|speedy|fluffy|bibnum.bnf|findlink|msrbot|panscient|yacybot|AISearchBot|IOI|ips-agent|tagoobot|MJ12bot|dotbot|woriobot|yanga|buzzbot|mlbot|yandexbot|purebot|Linguee Bot|Voyager|CyberPatrol|voilabot|baiduspider|citeseerxbot|spbot|twengabot|postrank|turnitinbot|scribdbot|page2rss|sitebot|linkdex|Adidxbot|blekkobot|ezooms|dotbot|Mail.RU_Bot|discobot|heritrix|findthatfile|europarchive.org|NerdByNature.Bot|sistrix crawler|ahrefsbot|Aboundex|domaincrawler|wbsearchbot|summify|ccbot|edisterbot|seznambot|ec2linkfinder|gslfbot|aihitbot|intelium_bot|facebookexternalhit|yeti|RetrevoPageAnalyzer|lb-spider|sogou|lssbot|careerbot|wotbox|wocbot|ichiro|DuckDuckBot|lssrocketcrawler|drupact|webcompanycrawler|acoonbot|openindexspider|gnam gnam spider|web-archive-net.com.bot|backlinkcrawler|coccoc|integromedb|content crawler spider|toplistbot|seokicks-robot|it2media-domain-crawler|ip-web-crawler.com|siteexplorer.info|elisabot|proximic|changedetection|blexbot|arabot|WeSEE:Search|niki-bot|CrystalSemanticsBot|rogerbot|360Spider|psbot|InterfaxScanBot|Lipperhey SEO Service|CC Metadata Scaper|g00g1e.net|GrapeshotCrawler|urlappendbot|brainobot|fr-crawler|binlar|SimpleCrawler|Livelapbot|Twitterbot|cXensebot|smtbot|bnf.fr_bot|A6-Indexer|ADmantX|Facebot|Twitterbot|OrangeBot|memorybot|AdvBot|MegaIndex|SemanticScholarBot|ltx71|nerdybot|xovibot|BUbiNG|Qwantify|archive.org_bot|Applebot|TweetmemeBot|crawler4j|findxbot|SemrushBot|yoozBot|lipperhey|y!j-asr|Domain Re-Animator Bot|AddThis)",t.BOT_UA_REGEX=new RegExp(e.BOT_USER_AGENTS_PATTERN,"i"),t}(),e=function(){function t(t){this.triggerID=t.id,this.engagementID=t.engagementID,this.expireAt=t.expireAt,this.updateExpired()}return Object.defineProperty(t.prototype,"isExpired",{get:function(){return this.expireAt<(new Date).getTime()},enumerable:!1,configurable:!0}),t.prototype.updateExpired=function(){this.isExpired&&(this.expired=!0)},t}(),i=[],o=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,c=u.length;a<c;++a)i[a]=u[a],o[u.charCodeAt(a)]=a;function f(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("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function p(t,e,r){for(var n,o,s=[],u=e;u<r;u+=3)n=(t[u]<<16&16711680)+(t[u+1]<<8&65280)+(255&t[u+2]),s.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63;var l,h,d=function(t){var e,r,n=f(t),i=n[0],u=n[1],a=new s(function(t,e,r){return 3*(e+r)/4-r}(0,i,u)),c=0,p=u>0?i-4:i;for(r=0;r<p;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],a[c++]=e>>16&255,a[c++]=e>>8&255,a[c++]=255&e;return 2===u&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,a[c++]=255&e),1===u&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,a[c++]=e>>8&255,a[c++]=255&e),a},g=function(t){for(var e,r=t.length,n=r%3,o=[],s=16383,u=0,a=r-n;u<a;u+=s)o.push(p(t,u,u+s>a?a:u+s));return 1===n?(e=t[r-1],o.push(i[e>>2]+i[e<<4&63]+"==")):2===n&&(e=(t[r-2]<<8)+t[r-1],o.push(i[e>>10]+i[e>>4&63]+i[e<<2&63]+"=")),o.join("")},y=function(t,e,r,n,i){var o,s,u=8*i-n-1,a=(1<<u)-1,c=a>>1,f=-7,p=r?i-1:0,l=r?-1:1,h=t[e+p];for(p+=l,o=h&(1<<-f)-1,h>>=-f,f+=u;f>0;o=256*o+t[e+p],p+=l,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+t[e+p],p+=l,f-=8);if(0===o)o=1-c;else{if(o===a)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=c}return(h?-1:1)*s*Math.pow(2,o-n)},b=function(t,e,r,n,i,o){var s,u,a,c=8*o-i-1,f=(1<<c)-1,p=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,d=n?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(u=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-s))<1&&(s--,a*=2),(e+=s+p>=1?l/a:l*Math.pow(2,1-p))*a>=2&&(s++,a/=2),s+p>=f?(u=0,s=f):s+p>=1?(u=(e*a-1)*Math.pow(2,i),s+=p):(u=e*Math.pow(2,p-1)*Math.pow(2,i),s=0));i>=8;t[r+h]=255&u,h+=d,u/=256,i-=8);for(s=s<<i|u,c+=i;c>0;t[r+h]=255&s,h+=d,s/=256,c-=8);t[r+h-d]|=128*g},v=(l=function(t,e){var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=function(t){return+t!=t&&(t=0),o.alloc(+t)},e.INSPECT_MAX_BYTES=50;var n=2147483647;function i(t){if(t>n)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return Object.setPrototypeOf(e,o.prototype),e}function o(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return a(t)}return s(t,e,r)}function s(t,e,r){if("string"==typeof t)return function(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!o.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|l(t,e),n=i(r),s=n.write(t,e);return s!==r&&(n=n.slice(0,s)),n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){var e=new Uint8Array(t);return f(e.buffer,e.byteOffset,e.byteLength)}return c(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t));if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return f(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return f(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return o.from(n,e,r);var s=function(t){if(o.isBuffer(t)){var e=0|p(t.length),r=i(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||$(t.length)?i(0):c(t):"Buffer"===t.type&&Array.isArray(t.data)?c(t.data):void 0}(t);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return o.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(t))}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function a(t){return u(t),i(t<0?0:0|p(t))}function c(t){for(var e=t.length<0?0:0|p(t.length),r=i(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function f(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,o.prototype),n}function p(t){if(t>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function l(t,e){if(o.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(t));var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return M(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return H(t).length;default:if(i)return n?-1:M(t).length;e=(""+e).toLowerCase(),i=!0}}function h(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return P(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return N(this,e,r);case"latin1":case"binary":return D(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function v(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function m(t,e,r,n,i){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return-1;r=t.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof e&&(e=o.from(e,n)),o.isBuffer(e))return 0===e.length?-1:w(t,e,r,n,i);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):w(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function w(t,e,r,n,i){var o,s=1,u=t.length,a=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,u/=2,a/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(i){var f=-1;for(o=r;o<u;o++)if(c(t,o)===c(e,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===a)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+a>u&&(r=u-a),o=r;o>=0;o--){for(var p=!0,l=0;l<a;l++)if(c(t,o+l)!==c(e,l)){p=!1;break}if(p)return o}return-1}function S(t,e,r,n){r=Number(r)||0;var i=t.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=e.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var u=parseInt(e.substr(2*s,2),16);if($(u))return s;t[r+s]=u}return s}function E(t,e,r,n){return G(M(e,t.length-r),t,r,n)}function _(t,e,r,n){return G(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function O(t,e,r,n){return G(H(e),t,r,n)}function T(t,e,r,n){return G(function(t,e){for(var r,n,i,o=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(e,t.length-r),t,r,n)}function x(t,e,r){return 0===e&&r===t.length?g(t):g(t.slice(e,r))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],i=e;i<r;){var o,s,u,a,c=t[i],f=null,p=c>239?4:c>223?3:c>191?2:1;if(i+p<=r)switch(p){case 1:c<128&&(f=c);break;case 2:128==(192&(o=t[i+1]))&&(a=(31&c)<<6|63&o)>127&&(f=a);break;case 3:o=t[i+1],s=t[i+2],128==(192&o)&&128==(192&s)&&(a=(15&c)<<12|(63&o)<<6|63&s)>2047&&(a<55296||a>57343)&&(f=a);break;case 4:o=t[i+1],s=t[i+2],u=t[i+3],128==(192&o)&&128==(192&s)&&128==(192&u)&&(a=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&u)>65535&&a<1114112&&(f=a)}null===f?(f=65533,p=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=p}return function(t){var e=t.length;if(e<=I)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=I));return r}(n)}e.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),o.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||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."),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}}),o.poolSize=8192,o.from=function(t,e,r){return s(t,e,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(t,e,r){return function(t,e,r){return u(t),t<=0?i(t):void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}(t,e,r)},o.allocUnsafe=function(t){return a(t)},o.allocUnsafeSlow=function(t){return a(t)},o.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==o.prototype},o.compare=function(t,e){if(V(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(t)||!o.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,i=0,s=Math.min(r,n);i<s;++i)if(t[i]!==e[i]){r=t[i],n=e[i];break}return r<n?-1:n<r?1:0},o.isEncoding=function(t){switch(String(t).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(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return o.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=o.allocUnsafe(e),i=0;for(r=0;r<t.length;++r){var s=t[r];if(V(s,Uint8Array))i+s.length>n.length?o.from(s).copy(n,i):Uint8Array.prototype.set.call(n,s,i);else{if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i)}i+=s.length}return n},o.byteLength=l,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)v(this,e,e+1);return this},o.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)v(this,e,e+3),v(this,e+1,e+2);return this},o.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)v(this,e,e+7),v(this,e+1,e+6),v(this,e+2,e+5),v(this,e+3,e+4);return this},o.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):h.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(t){if(!o.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===o.compare(this,t)},o.prototype.inspect=function(){var t="",r=e.INSPECT_MAX_BYTES;return t=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(t+=" ... "),"<Buffer "+t+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(t,e,r,n,i){if(V(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(t));if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),e<0||r>t.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&e>=r)return 0;if(n>=i)return-1;if(e>=r)return 1;if(this===t)return 0;for(var s=(i>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),a=Math.min(s,u),c=this.slice(n,i),f=t.slice(e,r),p=0;p<a;++p)if(c[p]!==f[p]){s=c[p],u=f[p];break}return s<u?-1:u<s?1:0},o.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},o.prototype.indexOf=function(t,e,r){return m(this,t,e,r,!0)},o.prototype.lastIndexOf=function(t,e,r){return m(this,t,e,r,!1)},o.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-e;if((void 0===r||r>i)&&(r=i),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return S(this,t,e,r);case"utf8":case"utf-8":return E(this,t,e,r);case"ascii":case"latin1":case"binary":return _(this,t,e,r);case"base64":return O(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,e,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var I=4096;function N(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(127&t[i]);return n}function D(t,e,r){var n="";r=Math.min(t.length,r);for(var i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function P(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=e;o<r;++o)i+=F[t[o]];return i}function B(t,e,r){for(var n=t.slice(e,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function R(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function k(t,e,r,n,i,s){if(!o.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<s)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function L(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,4),b(t,e,r,n,23,4),r+4}function U(t,e,r,n,i){return e=+e,r>>>=0,i||L(t,0,r,8),b(t,e,r,n,52,8),r+8}o.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUintLE=o.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n},o.prototype.readUintBE=o.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=this[t+--e],i=1;e>0&&(i*=256);)n+=this[t+--e]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),this[t]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]|this[t+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(t,e){return t>>>=0,e||R(t,2,this.length),this[t]<<8|this[t+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},o.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=this[t],i=1,o=0;++o<e&&(i*=256);)n+=this[t+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*e)),n},o.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||R(t,e,this.length);for(var n=e,i=1,o=this[t+--n];n>0&&(i*=256);)o+=this[t+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*e)),o},o.prototype.readInt8=function(t,e){return t>>>=0,e||R(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},o.prototype.readInt16LE=function(t,e){t>>>=0,e||R(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(t,e){t>>>=0,e||R(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},o.prototype.readInt32BE=function(t,e){return t>>>=0,e||R(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},o.prototype.readFloatLE=function(t,e){return t>>>=0,e||R(t,4,this.length),y(this,t,!0,23,4)},o.prototype.readFloatBE=function(t,e){return t>>>=0,e||R(t,4,this.length),y(this,t,!1,23,4)},o.prototype.readDoubleLE=function(t,e){return t>>>=0,e||R(t,8,this.length),y(this,t,!0,52,8)},o.prototype.readDoubleBE=function(t,e){return t>>>=0,e||R(t,8,this.length),y(this,t,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[e]=255&t;++o<r&&(i*=256);)this[e+o]=t/i&255;return e+r},o.prototype.writeUintBE=o.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||k(this,t,e,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[e+i]=255&t;--i>=0&&(o*=256);)this[e+i]=t/o&255;return e+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,255,0),this[e]=255&t,e+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=0,s=1,u=0;for(this[e]=255&t;++o<r&&(s*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/s>>0)-u&255;return e+r},o.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var i=Math.pow(2,8*r-1);k(this,t,e,r,i-1,-i)}var o=r-1,s=1,u=0;for(this[e+o]=255&t;--o>=0&&(s*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/s>>0)-u&255;return e+r},o.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},o.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},o.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},o.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},o.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||k(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},o.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},o.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},o.prototype.writeDoubleLE=function(t,e,r){return U(this,t,e,!0,r)},o.prototype.writeDoubleBE=function(t,e,r){return U(this,t,e,!1,r)},o.prototype.copy=function(t,e,r,n){if(!o.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var i=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),i},o.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var i=t.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(t=i)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var s;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(s=e;s<r;++s)this[s]=t;else{var u=o.isBuffer(t)?t:o.from(t,n),a=u.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(s=0;s<r-e;++s)this[s+e]=u[s%a]}return this};var j=/[^+/0-9A-Za-z-_]/g;function M(t,e){var r;e=e||1/0;for(var n=t.length,i=null,o=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function H(t){return d(function(t){if((t=(t=t.split("=")[0]).trim().replace(j,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function G(t,e,r,n){for(var i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function $(t){return t!=t}var F=function(){for(var t="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)e[n+i]=t[r]+t[i];return e}()},l(h={exports:{}},h.exports),h.exports),m=v.Buffer;v.SlowBuffer,v.INSPECT_MAX_BYTES,v.kMaxLength;var w=function(t,e){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},w(t,e)};function S(t,e){function r(){this.constructor=t}w(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var E=function(t){function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return S(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),e}(Error),_=function(t){function e(r){var n=t.call(this,r)||this;return Object.setPrototypeOf(n,e.prototype),n}return S(e,t),Object.defineProperty(e.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),e}(TypeError);function O(t){return t&&t.Math==Math&&t}function T(){return O("object"==typeof globalThis&&globalThis)||O("object"==typeof window&&window)||O("object"==typeof self&&self)||O("object"==typeof r.g&&r.g)||Function("return this")()}var x=function(t){var e,r="object"==typeof(e=T()).navigator&&"ReactNative"===e.navigator.product?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var n=m.alloc(t),i=0;i<t;++i)n[i]=Math.floor(256*Math.random());return n},A=function(){if("undefined"!=typeof window){var t=window.crypto||window.msCrypto;if(t&&t.getRandomValues)return function(e){return t.getRandomValues(m.alloc(e))}}return void 0!==r.g&&r.g.crypto&&r.g.crypto.getRandomValues?function(t){return r.g.crypto.getRandomValues(m.alloc(t))}:x}();function I(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}function N(t){return"object"==typeof t&&null!==t}function D(t,e){var r=!1;return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];return r||(console.warn(e),r=!0),t.apply(this,n)}}function P(t){if(ArrayBuffer.isView(t))return m.from(t.buffer,t.byteOffset,t.byteLength);if(e=t,["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e)))return m.from(t);var e;throw new _("Must use either Buffer or TypedArray")}var B=/^(?:[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,R=function(t){return"string"==typeof t&&B.test(t)},k=function(t){if(!R(t))throw new _('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 m.from(e,"hex")},L=function(t,e){return void 0===e&&(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")},C=Symbol("id"),U=function(){function t(e){if(void 0===e)this.id=t.generate();else if(e instanceof t)this[C]=m.from(e.id),this.__id=e.__id;else if(ArrayBuffer.isView(e)&&16===e.byteLength)this.id=P(e);else{if("string"!=typeof e)throw new _("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).");this.id=k(e)}}return Object.defineProperty(t.prototype,"id",{get:function(){return this[C]},set:function(e){this[C]=e,t.cacheHexString&&(this.__id=L(e))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(e){if(void 0===e&&(e=!0),t.cacheHexString&&this.__id)return this.__id;var r=L(this.id,e);return t.cacheHexString&&(this.__id=r),r},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(!e)return!1;if(e instanceof t)return e.id.equals(this.id);try{return new t(e).id.equals(this.id)}catch(t){return!1}},t.prototype.toBinary=function(){return new j(this.id,j.SUBTYPE_UUID)},t.generate=function(){var t=A(16);return t[6]=15&t[6]|64,t[8]=63&t[8]|128,m.from(t)},t.isValid=function(e){if(!e)return!1;if(e instanceof t)return!0;if("string"==typeof e)return R(e);if(I(e)){if(16!==e.length)return!1;try{return parseInt(e[6].toString(16)[0],10)===j.SUBTYPE_UUID}catch(t){return!1}}return!1},t.createFromHexString=function(e){return new t(k(e))},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t}();Object.defineProperty(U.prototype,"_bsontype",{value:"UUID"});var j=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(!(null==e||"string"==typeof e||ArrayBuffer.isView(e)||e instanceof ArrayBuffer||Array.isArray(e)))throw new _("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=null!=r?r:t.BSON_BINARY_SUBTYPE_DEFAULT,null==e?(this.buffer=m.alloc(t.BUFFER_SIZE),this.position=0):("string"==typeof e?this.buffer=m.from(e,"binary"):Array.isArray(e)?this.buffer=m.from(e):this.buffer=P(e),this.position=this.buffer.byteLength)}return t.prototype.put=function(e){if("string"==typeof e&&1!==e.length)throw new _("only accepts single character String");if("number"!=typeof e&&1!==e.length)throw new _("only accepts single character Uint8Array or Array");var r;if((r="string"==typeof e?e.charCodeAt(0):"number"==typeof e?e:e[0])<0||r>255)throw new _("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=m.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(t,e){if(e="number"==typeof e?e:this.position,this.buffer.length<e+t.length){var r=m.alloc(this.buffer.length+t.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r}ArrayBuffer.isView(t)?(this.buffer.set(P(t),e),this.position=e+t.byteLength>this.position?e+t.length:this.position):"string"==typeof t&&(this.buffer.write(t,e,t.length,"binary"),this.position=e+t.length>this.position?e+t.length:this.position)},t.prototype.read=function(t,e){return e=e&&e>0?e:this.position,this.buffer.slice(t,t+e)},t.prototype.value=function(t){return(t=!!t)&&this.buffer.length===this.position?this.buffer:t?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(t){return this.buffer.toString(t)},t.prototype.toExtendedJSON=function(t){t=t||{};var e=this.buffer.toString("base64"),r=Number(this.sub_type).toString(16);return t.legacy?{$binary:e,$type:1===r.length?"0"+r:r}:{$binary:{base64:e,subType:1===r.length?"0"+r:r}}},t.prototype.toUUID=function(){if(this.sub_type===t.SUBTYPE_UUID)return new U(this.buffer.slice(0,this.position));throw new E('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){var n,i;if(r=r||{},"$binary"in e?r.legacy&&"string"==typeof e.$binary&&"$type"in e?(i=e.$type?parseInt(e.$type,16):0,n=m.from(e.$binary,"base64")):"string"!=typeof e.$binary&&(i=e.$binary.subType?parseInt(e.$binary.subType,16):0,n=m.from(e.$binary.base64,"base64")):"$uuid"in e&&(i=4,n=k(e.$uuid)),!n)throw new _("Unexpected Binary Extended JSON format ".concat(JSON.stringify(e)));return new t(n,i)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){var t=this.value(!0);return'new Binary(Buffer.from("'.concat(t.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(j.prototype,"_bsontype",{value:"Binary"});var M=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 t=this.toJSON();return'new Code("'.concat(String(t.code),'"').concat(t.scope?", ".concat(JSON.stringify(t.scope)):"",")")},t}();Object.defineProperty(M.prototype,"_bsontype",{value:"Code"});var H=function(){function t(e,r,n,i){if(!(this instanceof t))return new t(e,r,n,i);var o=e.split(".");2===o.length&&(n=o.shift(),e=o.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(t){this.collection=t},enumerable:!1,configurable:!0}),t.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(t.$db=this.db),t},t.prototype.toExtendedJSON=function(t){t=t||{};var e={$ref:this.collection,$id:this.oid};return t.legacy?e:(this.db&&(e.$db=this.db),e=Object.assign(e,this.fields))},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 t=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(t),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},t}();Object.defineProperty(H.prototype,"_bsontype",{value:"DBRef"});var G=void 0;try{G=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(t){}var V=4294967296,$=0x10000000000000000,F=$/2,q={},z={},W=function(){function t(e,r,n){if(void 0===e&&(e=0),!(this instanceof t))return new t(e,r,n);"bigint"==typeof e?Object.assign(this,t.fromBigInt(e,!!r)):"string"==typeof e?Object.assign(this,t.fromString(e,!!r)):(this.low=0|e,this.high=0|r,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,o;return r?(o=0<=(e>>>=0)&&e<256)&&(i=z[e])?i:(n=t.fromBits(e,(0|e)<0?-1:0,!0),o&&(z[e]=n),n):(o=-128<=(e|=0)&&e<128)&&(i=q[e])?i:(n=t.fromBits(e,e<0?-1:0,!1),o&&(q[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>=$)return t.MAX_UNSIGNED_VALUE}else{if(e<=-F)return t.MIN_VALUE;if(e+1>=F)return t.MAX_VALUE}return e<0?t.fromNumber(-e,r).neg():t.fromBits(e%V|0,e/V|0,r)},t.fromBigInt=function(e,r){return t.fromString(e.toString(),r)},t.fromString=function(e,r,n){if(0===e.length)throw Error("empty string");if("NaN"===e||"Infinity"===e||"+Infinity"===e||"-Infinity"===e)return t.ZERO;if("number"==typeof r?(n=r,r=!1):r=!!r,(n=n||10)<2||36<n)throw RangeError("radix");var i;if((i=e.indexOf("-"))>0)throw Error("interior hyphen");if(0===i)return t.fromString(e.substring(1),r,n).neg();for(var o=t.fromNumber(Math.pow(n,8)),s=t.ZERO,u=0;u<e.length;u+=8){var a=Math.min(8,e.length-u),c=parseInt(e.substring(u,u+a),n);if(a<8){var f=t.fromNumber(Math.pow(n,a));s=s.mul(f).add(t.fromNumber(c))}else s=(s=s.mul(o)).add(t.fromNumber(c))}return s.unsigned=r,s},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(t){return N(t)&&!0===t.__isLong__},t.fromValue=function(e,r){return"number"==typeof e?t.fromNumber(e,r):"string"==typeof e?t.fromString(e,r):t.fromBits(e.low,e.high,"boolean"==typeof r?r:e.unsigned)},t.prototype.add=function(e){t.isLong(e)||(e=t.fromValue(e));var r=this.high>>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=e.high>>>16,u=65535&e.high,a=e.low>>>16,c=0,f=0,p=0,l=0;return p+=(l+=o+(65535&e.low))>>>16,l&=65535,f+=(p+=i+a)>>>16,p&=65535,c+=(f+=n+u)>>>16,f&=65535,c+=r+s,c&=65535,t.fromBits(p<<16|l,c<<16|f,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(t){return this.compare(t)},t.prototype.divide=function(e){if(t.isLong(e)||(e=t.fromValue(e)),e.isZero())throw Error("division by zero");if(G){if(!this.unsigned&&-2147483648===this.high&&-1===e.low&&-1===e.high)return this;var r=(this.unsigned?G.div_u:G.div_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,G.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?t.UZERO:t.ZERO;var n,i,o;if(this.unsigned){if(e.unsigned||(e=e.toUnsigned()),e.gt(this))return t.UZERO;if(e.gt(this.shru(1)))return t.UONE;o=t.UZERO}else{if(this.eq(t.MIN_VALUE))return e.eq(t.ONE)||e.eq(t.NEG_ONE)?t.MIN_VALUE:e.eq(t.MIN_VALUE)?t.ONE:(n=this.shr(1).div(e).shl(1)).eq(t.ZERO)?e.isNegative()?t.ONE:t.NEG_ONE:(i=this.sub(e.mul(n)),o=n.add(i.div(e)));if(e.eq(t.MIN_VALUE))return this.unsigned?t.UZERO:t.ZERO;if(this.isNegative())return e.isNegative()?this.neg().div(e.neg()):this.neg().div(e).neg();if(e.isNegative())return this.div(e.neg()).neg();o=t.ZERO}for(i=this;i.gte(e);){n=Math.max(1,Math.floor(i.toNumber()/e.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),u=s<=48?1:Math.pow(2,s-48),a=t.fromNumber(n),c=a.mul(e);c.isNegative()||c.gt(i);)n-=u,c=(a=t.fromNumber(n,this.unsigned)).mul(e);a.isZero()&&(a=t.ONE),o=o.add(a),i=i.sub(c)}return o},t.prototype.div=function(t){return this.divide(t)},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)&&this.high===e.high&&this.low===e.low},t.prototype.eq=function(t){return this.equals(t)},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,r=0!==this.high?this.high:this.low;for(e=31;e>0&&0==(r&1<<e);e--);return 0!==this.high?e+33:e+1},t.prototype.greaterThan=function(t){return this.comp(t)>0},t.prototype.gt=function(t){return this.greaterThan(t)},t.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},t.prototype.gte=function(t){return this.greaterThanOrEqual(t)},t.prototype.ge=function(t){return this.greaterThanOrEqual(t)},t.prototype.isEven=function(){return 0==(1&this.low)},t.prototype.isNegative=function(){return!this.unsigned&&this.high<0},t.prototype.isOdd=function(){return 1==(1&this.low)},t.prototype.isPositive=function(){return this.unsigned||this.high>=0},t.prototype.isZero=function(){return 0===this.high&&0===this.low},t.prototype.lessThan=function(t){return this.comp(t)<0},t.prototype.lt=function(t){return this.lessThan(t)},t.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},t.prototype.lte=function(t){return this.lessThanOrEqual(t)},t.prototype.modulo=function(e){if(t.isLong(e)||(e=t.fromValue(e)),G){var r=(this.unsigned?G.rem_u:G.rem_s)(this.low,this.high,e.low,e.high);return t.fromBits(r,G.get_high(),this.unsigned)}return this.sub(this.div(e).mul(e))},t.prototype.mod=function(t){return this.modulo(t)},t.prototype.rem=function(t){return this.modulo(t)},t.prototype.multiply=function(e){if(this.isZero())return t.ZERO;if(t.isLong(e)||(e=t.fromValue(e)),G){var r=G.mul(this.low,this.high,e.low,e.high);return t.fromBits(r,G.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=65535&this.high,o=this.low>>>16,s=65535&this.low,u=e.high>>>16,a=65535&e.high,c=e.low>>>16,f=65535&e.low,p=0,l=0,h=0,d=0;return h+=(d+=s*f)>>>16,d&=65535,l+=(h+=o*f)>>>16,h&=65535,l+=(h+=s*c)>>>16,h&=65535,p+=(l+=i*f)>>>16,l&=65535,p+=(l+=o*c)>>>16,l&=65535,p+=(l+=s*a)>>>16,l&=65535,p+=n*f+i*c+o*a+s*u,p&=65535,t.fromBits(h<<16|d,p<<16|l,this.unsigned)},t.prototype.mul=function(t){return this.multiply(t)},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(t){return!this.equals(t)},t.prototype.neq=function(t){return this.notEquals(t)},t.prototype.ne=function(t){return this.notEquals(t)},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()),0==(e&=63)?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(t){return this.shiftLeft(t)},t.prototype.shiftRight=function(e){return t.isLong(e)&&(e=e.toInt()),0==(e&=63)?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(t){return this.shiftRight(t)},t.prototype.shiftRightUnsigned=function(e){if(t.isLong(e)&&(e=e.toInt()),0==(e&=63))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)}return 32===e?t.fromBits(r,0,this.unsigned):t.fromBits(r>>>e-32,0,this.unsigned)},t.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},t.prototype.shru=function(t){return this.shiftRightUnsigned(t)},t.prototype.subtract=function(e){return t.isLong(e)||(e=t.fromValue(e)),this.add(e.neg())},t.prototype.sub=function(t){return this.subtract(t)},t.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},t.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*V+(this.low>>>0):this.high*V+(this.low>>>0)},t.prototype.toBigInt=function(){return BigInt(this.toString())},t.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},t.prototype.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},t.prototype.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},t.prototype.toSigned=function(){return this.unsigned?t.fromBits(this.low,this.high,!1):this},t.prototype.toString=function(e){if((e=e||10)<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)}return"-"+this.neg().toString(e)}for(var o=t.fromNumber(Math.pow(e,6),this.unsigned),s=this,u="";;){var a=s.div(o),c=(s.sub(a.mul(o)).toInt()>>>0).toString(e);if((s=a).isZero())return c+u;for(;c.length<6;)c="0"+c;u=""+c+u}},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(t){return this.lessThanOrEqual(t)},t.prototype.toExtendedJSON=function(t){return t&&t.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(16777216),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(W.prototype,"__isLong__",{value:!0}),Object.defineProperty(W.prototype,"_bsontype",{value:"Long"});var J=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,K=/^(\+|-)?(Infinity|inf)$/i,Y=/^(\+|-)?NaN$/i,Z=6111,X=-6176,Q=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),tt=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),et=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),rt=/^([-+])?(\d+)?$/;function nt(t){return!isNaN(parseInt(t,10))}function it(t){var e=W.fromNumber(1e9),r=W.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=r.shiftLeft(32)).add(new W(t.parts[n],0)),t.parts[n]=r.div(e).low,r=r.modulo(e);return{quotient:t,rem:r}}function ot(t,e){throw new _('"'.concat(t,'" is not a valid Decimal128 string - ').concat(e))}var st=function(){function t(e){if(!(this instanceof t))return new t(e);if("string"==typeof e)this.bytes=t.fromString(e).bytes;else{if(!I(e))throw new _("Decimal128 must take a Buffer or string");if(16!==e.byteLength)throw new _("Decimal128 must take a Buffer of 16 bytes");this.bytes=e}}return t.fromString=function(e){var r,n=!1,i=!1,o=!1,s=0,u=0,a=0,c=0,f=0,p=[0],l=0,h=0,d=0,g=0,y=0,b=0,v=new W(0,0),w=new W(0,0),S=0;if(e.length>=7e3)throw new _(e+" not a valid Decimal128 string");var E=e.match(J),O=e.match(K),T=e.match(Y);if(!E&&!O&&!T||0===e.length)throw new _(e+" not a valid Decimal128 string");if(E){var x=E[2],A=E[4],I=E[5],N=E[6];A&&void 0===N&&ot(e,"missing exponent power"),A&&void 0===x&&ot(e,"missing exponent base"),void 0===A&&(I||N)&&ot(e,"missing e before exponent")}if("+"!==e[S]&&"-"!==e[S]||(n="-"===e[S++]),!nt(e[S])&&"."!==e[S]){if("i"===e[S]||"I"===e[S])return new t(m.from(n?tt:et));if("N"===e[S])return new t(m.from(Q))}for(;nt(e[S])||"."===e[S];)"."!==e[S]?(l<34&&("0"!==e[S]||o)&&(o||(f=u),o=!0,p[h++]=parseInt(e[S],10),l+=1),o&&(a+=1),i&&(c+=1),u+=1,S+=1):(i&&ot(e,"contains multiple periods"),i=!0,S+=1);if(i&&!u)throw new _(e+" not a valid Decimal128 string");if("e"===e[S]||"E"===e[S]){var D=e.substr(++S).match(rt);if(!D||!D[2])return new t(m.from(Q));y=parseInt(D[0],10),S+=D[0].length}if(e[S])return new t(m.from(Q));if(d=0,l){if(g=l-1,1!==(s=a))for(;0===p[f+s-1];)s-=1}else d=0,g=0,p[0]=0,a=1,l=1,s=0;for(y<=c&&c-y>16384?y=X:y-=c;y>Z;){if((g+=1)-d>34){if(p.join("").match(/^0+$/)){y=Z;break}ot(e,"overflow")}y-=1}for(;y<X||l<a;){if(0===g&&s<l){y=X,s=0;break}if(l<a?a-=1:g-=1,y<Z)y+=1;else{if(p.join("").match(/^0+$/)){y=Z;break}ot(e,"overflow")}}if(g-d+1<s){var P=u;i&&(f+=1,P+=1),n&&(f+=1,P+=1);var B=parseInt(e[f+g+1],10),R=0;if(B>=5&&(R=1,5===B))for(R=p[g]%2==1?1:0,b=f+g+2;b<P;b++)if(parseInt(e[b],10)){R=1;break}if(R)for(var k=g;k>=0;k--)if(++p[k]>9&&(p[k]=0,0===k)){if(!(y<Z))return new t(m.from(n?tt:et));y+=1,p[k]=1}}if(v=W.fromNumber(0),w=W.fromNumber(0),0===s)v=W.fromNumber(0),w=W.fromNumber(0);else if(g-d<17)for(k=d,w=W.fromNumber(p[k++]),v=new W(0,0);k<=g;k++)w=(w=w.multiply(W.fromNumber(10))).add(W.fromNumber(p[k]));else{for(k=d,v=W.fromNumber(p[k++]);k<=g-17;k++)v=(v=v.multiply(W.fromNumber(10))).add(W.fromNumber(p[k]));for(w=W.fromNumber(p[k++]);k<=g;k++)w=(w=w.multiply(W.fromNumber(10))).add(W.fromNumber(p[k]))}var L,C,U,j,M=function(t,e){if(!t&&!e)return{high:W.fromNumber(0),low:W.fromNumber(0)};var r=t.shiftRightUnsigned(32),n=new W(t.getLowBits(),0),i=e.shiftRightUnsigned(32),o=new W(e.getLowBits(),0),s=r.multiply(i),u=r.multiply(o),a=n.multiply(i),c=n.multiply(o);return s=s.add(u.shiftRightUnsigned(32)),u=new W(u.getLowBits(),0).add(a).add(c.shiftRightUnsigned(32)),{high:s=s.add(u.shiftRightUnsigned(32)),low:c=u.shiftLeft(32).add(new W(c.getLowBits(),0))}}(v,W.fromString("100000000000000000"));M.low=M.low.add(w),C=w,((U=(L=M.low).high>>>0)<(j=C.high>>>0)||U===j&&L.low>>>0<C.low>>>0)&&(M.high=M.high.add(W.fromNumber(1))),r=y+6176;var H={low:W.fromNumber(0),high:W.fromNumber(0)};M.high.shiftRightUnsigned(49).and(W.fromNumber(1)).equals(W.fromNumber(1))?(H.high=H.high.or(W.fromNumber(3).shiftLeft(61)),H.high=H.high.or(W.fromNumber(r).and(W.fromNumber(16383).shiftLeft(47))),H.high=H.high.or(M.high.and(W.fromNumber(0x7fffffffffff)))):(H.high=H.high.or(W.fromNumber(16383&r).shiftLeft(49)),H.high=H.high.or(M.high.and(W.fromNumber(562949953421311)))),H.low=M.low,n&&(H.high=H.high.or(W.fromString("9223372036854775808")));var G=m.alloc(16);return S=0,G[S++]=255&H.low.low,G[S++]=H.low.low>>8&255,G[S++]=H.low.low>>16&255,G[S++]=H.low.low>>24&255,G[S++]=255&H.low.high,G[S++]=H.low.high>>8&255,G[S++]=H.low.high>>16&255,G[S++]=H.low.high>>24&255,G[S++]=255&H.high.low,G[S++]=H.high.low>>8&255,G[S++]=H.high.low>>16&255,G[S++]=H.high.low>>24&255,G[S++]=255&H.high.high,G[S++]=H.high.high>>8&255,G[S++]=H.high.high>>16&255,G[S++]=H.high.high>>24&255,new t(G)},t.prototype.toString=function(){for(var t,e=0,r=new Array(36),n=0;n<r.length;n++)r[n]=0;var i,o,s,u=0,a=!1,c={parts:[0,0,0,0]},f=[];u=0;var p=this.bytes,l=p[u++]|p[u++]<<8|p[u++]<<16|p[u++]<<24,h=p[u++]|p[u++]<<8|p[u++]<<16|p[u++]<<24,d=p[u++]|p[u++]<<8|p[u++]<<16|p[u++]<<24,g=p[u++]|p[u++]<<8|p[u++]<<16|p[u++]<<24;u=0,(new W(l,h),new W(d,g)).lessThan(W.ZERO)&&f.push("-");var y=g>>26&31;if(y>>3==3){if(30===y)return f.join("")+"Infinity";if(31===y)return"NaN";t=g>>15&16383,i=8+(g>>14&1)}else i=g>>14&7,t=g>>17&16383;var b=t-6176;if(c.parts[0]=(16383&g)+((15&i)<<14),c.parts[1]=d,c.parts[2]=h,c.parts[3]=l,0===c.parts[0]&&0===c.parts[1]&&0===c.parts[2]&&0===c.parts[3])a=!0;else for(s=3;s>=0;s--){var v=0,m=it(c);if(c=m.quotient,v=m.rem.low)for(o=8;o>=0;o--)r[9*s+o]=v%10,v=Math.floor(v/10)}if(a)e=1,r[u]=0;else for(e=36;!r[u];)e-=1,u+=1;var w=e-1+b;if(w>=34||w<=-7||b>0){if(e>34)return f.push("".concat(0)),b>0?f.push("E+".concat(b)):b<0&&f.push("E".concat(b)),f.join("");for(f.push("".concat(r[u++])),(e-=1)&&f.push("."),n=0;n<e;n++)f.push("".concat(r[u++]));f.push("E"),w>0?f.push("+".concat(w)):f.push("".concat(w))}else if(b>=0)for(n=0;n<e;n++)f.push("".concat(r[u++]));else{var S=e+b;if(S>0)for(n=0;n<S;n++)f.push("".concat(r[u++]));else f.push("0");for(f.push(".");S++<0;)f.push("0");for(n=0;n<e-Math.max(S-1,0);n++)f.push("".concat(r[u++]))}return f.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(st.prototype,"_bsontype",{value:"Decimal128"});var ut=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(t){return this.value.toString(t)},t.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:(Number.isInteger(this.value)?(e=this.value.toFixed(1)).length>=13&&(e=this.value.toExponential(13).toUpperCase()):e=this.value.toString(),{$numberDouble:e});var e},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 t=this.toExtendedJSON();return"new Double(".concat(t.$numberDouble,")")},t}();Object.defineProperty(ut.prototype,"_bsontype",{value:"Double"});var at=function(){function t(e){if(!(this instanceof t))return new t(e);e instanceof Number&&(e=e.valueOf()),this.value=0|+e}return t.prototype.valueOf=function(){return this.value},t.prototype.toString=function(t){return this.value.toString(t)},t.prototype.toJSON=function(){return this.value},t.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.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(at.prototype,"_bsontype",{value:"Int32"});var ct=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(ct.prototype,"_bsontype",{value:"MaxKey"});var ft=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(ft.prototype,"_bsontype",{value:"MinKey"});var pt=new RegExp("^[0-9a-fA-F]{24}$"),lt=null,ht=Symbol("id"),dt=function(){function t(e){if(!(this instanceof t))return new t(e);var r;if("object"==typeof e&&e&&"id"in e){if("string"!=typeof e.id&&!ArrayBuffer.isView(e.id))throw new _("Argument passed in must have an id that is of type string or Buffer");r="toHexString"in e&&"function"==typeof e.toHexString?m.from(e.toHexString(),"hex"):e.id}else r=e;if(null==r||"number"==typeof r)this[ht]=t.generate("number"==typeof r?r:void 0);else if(ArrayBuffer.isView(r)&&12===r.byteLength)this[ht]=r instanceof m?r:P(r);else{if("string"!=typeof r)throw new _("Argument passed in does not match the accepted types");if(12===r.length){var n=m.from(r);if(12!==n.byteLength)throw new _("Argument passed in must be a string of 12 bytes");this[ht]=n}else{if(24!==r.length||!pt.test(r))throw new _("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");this[ht]=m.from(r,"hex")}}t.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(t.prototype,"id",{get:function(){return this[ht]},set:function(e){this[ht]=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(t){this.id.writeUInt32BE(t,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){"number"!=typeof e&&(e=Math.floor(Date.now()/1e3));var r=t.getInc(),n=m.alloc(12);return n.writeUInt32BE(e,0),null===lt&&(lt=A(5)),n[4]=lt[0],n[5]=lt[1],n[6]=lt[2],n[7]=lt[3],n[8]=lt[4],n[11]=255&r,n[10]=r>>8&255,n[9]=r>>16&255,n},t.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(null==e)return!1;if(e instanceof t)return this[ht][11]===e[ht][11]&&this[ht].equals(e[ht]);if("string"==typeof e&&t.isValid(e)&&12===e.length&&I(this.id))return e===m.prototype.toString.call(this.id,"latin1");if("string"==typeof e&&t.isValid(e)&&24===e.length)return e.toLowerCase()===this.toHexString();if("string"==typeof e&&t.isValid(e)&&12===e.length)return m.from(e).equals(this.id);if("object"==typeof e&&"toHexString"in e&&"function"==typeof e.toHexString){var r=e.toHexString(),n=this.toHexString().toLowerCase();return"string"==typeof r&&r.toLowerCase()===n}return!1},t.prototype.getTimestamp=function(){var t=new Date,e=this.id.readUInt32BE(0);return t.setTime(1e3*Math.floor(e)),t},t.createPk=function(){return new t},t.createFromTime=function(e){var r=m.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(void 0===e||null!=e&&24!==e.length)throw new _("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new t(m.from(e,"hex"))},t.isValid=function(e){if(null==e)return!1;try{return new t(e),!0}catch(t){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(16777215*Math.random()),t}();Object.defineProperty(dt.prototype,"generate",{value:D((function(t){return dt.generate(t)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(dt.prototype,"getInc",{value:D((function(){return dt.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(dt.prototype,"get_inc",{value:D((function(){return dt.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(dt,"get_inc",{value:D((function(){return dt.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(dt.prototype,"_bsontype",{value:"ObjectID"});var gt=function(){function t(e,r){if(!(this instanceof t))return new t(e,r);if(this.pattern=e,this.options=(null!=r?r:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new E("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(-1!==this.options.indexOf("\0"))throw new E("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n<this.options.length;n++)if("i"!==this.options[n]&&"m"!==this.options[n]&&"x"!==this.options[n]&&"l"!==this.options[n]&&"s"!==this.options[n]&&"u"!==this.options[n])throw new E("The regular expression option [".concat(this.options[n],"] is not supported"))}return t.parseOptions=function(t){return t?t.split("").sort().join(""):""},t.prototype.toExtendedJSON=function(t){return(t=t||{}).legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},t.fromExtendedJSON=function(e){if("$regex"in e){if("string"==typeof e.$regex)return new t(e.$regex,t.parseOptions(e.$options));if("BSONRegExp"===e.$regex._bsontype)return e}if("$regularExpression"in e)return new t(e.$regularExpression.pattern,t.parseOptions(e.$regularExpression.options));throw new _("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(e)))},t}();Object.defineProperty(gt.prototype,"_bsontype",{value:"BSONRegExp"});var yt=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(yt.prototype,"_bsontype",{value:"Symbol"});var bt=function(t){function e(r,n){var i=this;return i instanceof e?(i=W.isLong(r)?t.call(this,r.low,r.high,!0)||this:N(r)&&void 0!==r.t&&void 0!==r.i?t.call(this,r.i,r.t,!0)||this: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 S(e,t),e.prototype.toJSON=function(){return{$timestamp:this.toString()}},e.fromInt=function(t){return new e(W.fromInt(t,!0))},e.fromNumber=function(t){return new e(W.fromNumber(t,!0))},e.fromBits=function(t,r){return new e(t,r)},e.fromString=function(t,r){return new e(W.fromString(t,!0,r))},e.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},e.fromExtendedJSON=function(t){return new e(t.$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=W.MAX_UNSIGNED_VALUE,e}(W);var vt=2147483647,mt=-2147483648,wt=0x8000000000000000,St=-0x8000000000000000,Et={$oid:dt,$binary:j,$uuid:j,$symbol:yt,$numberInt:at,$numberDecimal:st,$numberDouble:ut,$numberLong:W,$minKey:ft,$maxKey:ct,$regex:gt,$regularExpression:gt,$timestamp:bt};function _t(t,e){if(void 0===e&&(e={}),"number"==typeof t){if(e.relaxed||e.legacy)return t;if(Math.floor(t)===t){if(t>=mt&&t<=vt)return new at(t);if(t>=St&&t<=wt)return W.fromNumber(t)}return new ut(t)}if(null==t||"object"!=typeof t)return t;if(t.$undefined)return null;for(var r=Object.keys(t).filter((function(e){return e.startsWith("$")&&null!=t[e]})),n=0;n<r.length;n++){var i=Et[r[n]];if(i)return i.fromExtendedJSON(t,e)}if(null!=t.$date){var o=t.$date,s=new Date;return e.legacy?"number"==typeof o?s.setTime(o):"string"==typeof o&&s.setTime(Date.parse(o)):"string"==typeof o?s.setTime(Date.parse(o)):W.isLong(o)?s.setTime(o.toNumber()):"number"==typeof o&&e.relaxed&&s.setTime(o),s}if(null!=t.$code){var u=Object.assign({},t);return t.$scope&&(u.$scope=_t(t.$scope)),M.fromExtendedJSON(t)}if(function(t){return N(t)&&null!=t.$id&&"string"==typeof t.$ref&&(null==t.$db||"string"==typeof t.$db)}(t)||t.$dbPointer){var a=t.$ref?t:t.$dbPointer;if(a instanceof H)return a;var c=Object.keys(a).filter((function(t){return t.startsWith("$")})),f=!0;if(c.forEach((function(t){-1===["$ref","$id","$db"].indexOf(t)&&(f=!1)})),f)return H.fromExtendedJSON(a)}return t}function Ot(t){var e=t.toISOString();return 0!==t.getUTCMilliseconds()?e:e.slice(0,-5)+"Z"}function Tt(t,e){if(("object"==typeof t||"function"==typeof t)&&null!==t){var r=e.seenObjects.findIndex((function(e){return e.obj===t}));if(-1!==r){var n=e.seenObjects.map((function(t){return t.propertyName})),i=n.slice(0,r).map((function(t){return"".concat(t," -> ")})).join(""),o=n[r],s=" -> "+n.slice(r+1,n.length-1).map((function(t){return"".concat(t," -> ")})).join(""),u=n[n.length-1],a=" ".repeat(i.length+o.length/2),c="-".repeat(s.length+(o.length+u.length)/2-1);throw new _("Converting circular structure to EJSON:\n"+" ".concat(i).concat(o).concat(s).concat(u,"\n")+" ".concat(a,"\\").concat(c,"/"))}e.seenObjects[e.seenObjects.length-1].obj=t}if(Array.isArray(t))return function(t,e){return t.map((function(t,r){e.seenObjects.push({propertyName:"index ".concat(r),obj:null});try{return Tt(t,e)}finally{e.seenObjects.pop()}}))}(t,e);if(void 0===t)return null;if(t instanceof Date||N(l=t)&&"[object Date]"===Object.prototype.toString.call(l)){var f=t.getTime(),p=f>-1&&f<2534023188e5;return e.legacy?e.relaxed&&p?{$date:t.getTime()}:{$date:Ot(t)}:e.relaxed&&p?{$date:Ot(t)}:{$date:{$numberLong:t.getTime().toString()}}}var l;if(!("number"!=typeof t||e.relaxed&&isFinite(t))){if(Math.floor(t)===t){var h=t>=St&&t<=wt;if(t>=mt&&t<=vt)return{$numberInt:t.toString()};if(h)return{$numberLong:t.toString()}}return{$numberDouble:t.toString()}}if(t instanceof RegExp||function(t){return"[object RegExp]"===Object.prototype.toString.call(t)}(t)){var d=t.flags;if(void 0===d){var g=t.toString().match(/[gimuy]*$/);g&&(d=g[0])}return new gt(t.source,d).toExtendedJSON(e)}return null!=t&&"object"==typeof t?function(t,e){if(null==t||"object"!=typeof t)throw new E("not an object instance");var r=t._bsontype;if(void 0===r){var n={};for(var i in t){e.seenObjects.push({propertyName:i,obj:null});try{var o=Tt(t[i],e);"__proto__"===i?Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):n[i]=o}finally{e.seenObjects.pop()}}return n}if(function(t){return N(t)&&Reflect.has(t,"_bsontype")&&"string"==typeof t._bsontype}(t)){var s=t;if("function"!=typeof s.toExtendedJSON){var u=At[t._bsontype];if(!u)throw new _("Unrecognized or invalid _bsontype: "+t._bsontype);s=u(s)}return"Code"===r&&s.scope?s=new M(s.code,Tt(s.scope,e)):"DBRef"===r&&s.oid&&(s=new H(Tt(s.collection,e),Tt(s.oid,e),Tt(s.db,e),Tt(s.fields,e))),s.toExtendedJSON(e)}throw new E("_bsontype must be a string, but was: "+typeof r)}(t,e):t}var xt,At={Binary:function(t){return new j(t.value(),t.sub_type)},Code:function(t){return new M(t.code,t.scope)},DBRef:function(t){return new H(t.collection||t.namespace,t.oid,t.db,t.fields)},Decimal128:function(t){return new st(t.bytes)},Double:function(t){return new ut(t.value)},Int32:function(t){return new at(t.value)},Long:function(t){return W.fromBits(null!=t.low?t.low:t.low_,null!=t.low?t.high:t.high_,null!=t.low?t.unsigned:t.unsigned_)},MaxKey:function(){return new ct},MinKey:function(){return new ft},ObjectID:function(t){return new dt(t)},ObjectId:function(t){return new dt(t)},BSONRegExp:function(t){return new gt(t.pattern,t.options)},Symbol:function(t){return new yt(t.value)},Timestamp:function(t){return bt.fromBits(t.low,t.high)}};!function(t){function e(t,e){var r=Object.assign({},{relaxed:!0,legacy:!1},e);return"boolean"==typeof r.relaxed&&(r.strict=!r.relaxed),"boolean"==typeof r.strict&&(r.relaxed=!r.strict),JSON.parse(t,(function(t,e){if(-1!==t.indexOf("\0"))throw new E("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(t)));return _t(e,r)}))}function r(t,e,r,n){null!=r&&"object"==typeof r&&(n=r,r=0),null==e||"object"!=typeof e||Array.isArray(e)||(n=e,e=void 0,r=0);var i=Tt(t,Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(i,e,r)}t.parse=e,t.stringify=r,t.serialize=function(t,e){return e=e||{},JSON.parse(r(t,e))},t.deserialize=function(t,r){return r=r||{},e(JSON.stringify(t),r)}}(xt||(xt={}));var It=T();It.Map?It.Map:function(){function t(t){void 0===t&&(t=[]),this._keys=[],this._values={};for(var e=0;e<t.length;e++)if(null!=t[e]){var r=t[e],n=r[0],i=r[1];this._keys.push(n),this._values[n]={v:i,i:this._keys.length-1}}}t.prototype.clear=function(){this._keys=[],this._values={}},t.prototype.delete=function(t){var e=this._values[t];return null!=e&&(delete this._values[t],this._keys.splice(e.i,1),!0)},t.prototype.entries=function(){var t=this,e=0;return{next:function(){var r=t._keys[e++];return{value:void 0!==r?[r,t._values[r].v]:void 0,done:void 0===r}}}},t.prototype.forEach=function(t,e){e=e||this;for(var r=0;r<this._keys.length;r++){var n=this._keys[r];t.call(e,this._values[n].v,n,e)}},t.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},t.prototype.has=function(t){return null!=this._values[t]},t.prototype.keys=function(){var t=this,e=0;return{next:function(){var r=t._keys[e++];return{value:void 0!==r?r:void 0,done:void 0===r}}}},t.prototype.set=function(t,e){return this._values[t]?(this._values[t].v=e,this):(this._keys.push(t),this._values[t]={v:e,i:this._keys.length-1},this)},t.prototype.values=function(){var t=this,e=0;return{next:function(){var r=t._keys[e++];return{value:void 0!==r?t._values[r].v:void 0,done:void 0===r}}}},Object.defineProperty(t.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0})}(),Math.pow(2,63),Math.pow(2,63);var Nt=Math.pow(2,53),Dt=-Math.pow(2,53);W.fromNumber(Nt),W.fromNumber(Dt),new Set(["$db","$ref","$id","$clusterTime"]);var Pt=new Uint8Array(8);new DataView(Pt.buffer,Pt.byteOffset,Pt.byteLength);m.alloc(17825792);var Bt=function(t,r,n){void 0===r&&(r={}),this.name=t,this.properties=r,this.sessionID=null,this.screenName=null,this.deviceProps=null,this.sessionNumber=0,this.activeTriggers=[],this.id=new dt,this.occurred=(new Date).toISOString(),n&&(this.trigger=new e(n))},Rt=function(){function t(t){t.s&&(this.s=new Ut(t.s)),t.g&&(this.g=new Ft(t.g)),this.i=t.i}return Object.defineProperty(t.prototype,"solid",{get:function(){return this.s},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"glossy",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"img",{get:function(){return this.i},enumerable:!1,configurable:!0}),t}();const kt=new RegExp("[^#a-f\\d]","gi"),Lt=new RegExp("^#?[a-f\\d]{3}[a-f\\d]?$|^#?[a-f\\d]{6}([a-f\\d]{2})?$","i");var Ct,Ut=function(){function t(t){this.a=100,this.h=t.h,this.a=t.a,this.g=t.g}return Object.defineProperty(t.prototype,"hex",{get:function(){return this.h},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"grad",{get:function(){return this.g},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rgba",{get:function(){if(!this.hex)return"";try{return function(t,e={}){if("string"!=typeof t||kt.test(t)||!Lt.test(t))throw new TypeError("Expected a valid hex string");let r=1;8===(t=t.replace(/^#/,"")).length&&(r=Number.parseInt(t.slice(6,8),16)/255,t=t.slice(0,6)),4===t.length&&(r=Number.parseInt(t.slice(3,4).repeat(2),16)/255,t=t.slice(0,3)),3===t.length&&(t=t[0]+t[0]+t[1]+t[1]+t[2]+t[2]);const n=Number.parseInt(t,16),i=n>>16,o=n>>8&255,s=255&n,u="number"==typeof e.alpha?e.alpha:r;return"array"===e.format?[i,o,s,u]:"css"===e.format?`rgb(${i} ${o} ${s}${1===u?"":` / ${Number((100*u).toFixed(2))}%`})`:{red:i,green:o,blue:s,alpha:u}}(this.hex,{format:"css",alpha:this.getAlpha()})}catch(t){return console.error("Invalid hex",t),"#000000"}},enumerable:!1,configurable:!0}),t.prototype.getAlpha=function(){var t;return(null!==(t=this.a)&&void 0!==t?t:100)/100},t}(),jt=function(){function t(t){this.s=t.s,this.r=t.r,this.w=t.w,t.c&&(this.c=new Ut(t.c))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"width",{get:function(){return this.w},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"style",{get:function(){var t;return Ct[null!==(t=this.s)&&void 0!==t?t:Ct.SOLID]},enumerable:!1,configurable:!0}),t}();!function(t){t[t.SOLID=1]="SOLID",t[t.DASHED=2]="DASHED"}(Ct||(Ct={}));var Mt,Ht=function(t){var e;t=null!=t?t:{},this.name=t.name,this.fonts=null===(e=t.fonts)||void 0===e?void 0:e.map((function(t){return new Gt(t)}))},Gt=function(){function t(t){t=null!=t?t:{},this.style=t.style,this.url=t.url}return t.prototype.getFontDescriptor=function(){return{style:this.style===Mt.ITALICS||this.style===Mt.BOLD_ITALICS?"italic":"normal",weight:this.style===Mt.BOLD_ITALICS||this.style===Mt.BOLD?"700":"400"}},t.prototype.getURL=function(){return"url('".concat(this.url,"') format('truetype')")},t}();!function(t){t[t.REGULAR=1]="REGULAR",t[t.ITALICS=2]="ITALICS",t[t.BOLD=3]="BOLD",t[t.BOLD_ITALICS=4]="BOLD_ITALICS"}(Mt||(Mt={}));var Vt,$t=function(){function t(t){t=null!=t?t:{},this.s=t.s,this.lh=t.lh,t.fmly&&(this.fmly=new Ht(t.fmly))}return Object.defineProperty(t.prototype,"family",{get:function(){return this.fmly},enumerable:!1,configurable:!0}),t}(),Ft=function(){function t(t){this.r=t.r,t.c&&(this.c=new Ut(t.c)),t.fb&&(this.fb=new Ut(t.fb))}return Object.defineProperty(t.prototype,"radius",{get:function(){return this.r},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fallback",{get:function(){var e;return null!==(e=this.fb)&&void 0!==e?e:t.DEFAULT_FALLBACK},enumerable:!1,configurable:!0}),t.DEFAULT_FALLBACK=new Ut({h:"#000000",a:50}),t}(),qt=function(){function t(t){var e,r,n,i;t=null!=t?t:{},this.blur=null!==(e=t.blur)&&void 0!==e?e:0,this.spr=null!==(r=t.spr)&&void 0!==r?r:0,this.x=null!==(n=t.x)&&void 0!==n?n:0,this.y=null!==(i=t.y)&&void 0!==i?i:0,this.clr=new Ut(t.clr)}return t.prototype.getStyle=function(t){return"".concat(this.x*t,"px ").concat(this.y*t,"px ")+"".concat(this.blur*t,"px ").concat(this.spr*t,"px ").concat(this.clr.rgba)},t}(),zt=function(){function t(t){(null==t?void 0:t.rot)&&(this.rot=t.rot)}return Object.defineProperty(t.prototype,"rotate",{get:function(){return this.rot},enumerable:!1,configurable:!0}),t}(),Wt=function(){function t(t){this.t=t.t,t.bg&&(this.bg=new Rt(t.bg)),t.br&&(this.br=new jt(t.br)),t.shd&&(this.shd=new qt(t.shd)),this.trf=new zt(t.trf),this.clc=t.clc,this.spc=t.spc,this.w=t.w,this.h=t.h,this.x=t.x,this.y=t.y,this.a=t.a}return Object.defineProperty(t.prototype,"alpha",{get:function(){var t;return null!==(t=this.a)&&void 0!==t?t:100},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"type",{get:function(){return this.t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"typeAsString",{get:function(){return Vt[this.t]},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"click",{get:function(){return this.clc},enumerable:!1,configurable:!0}),t}();!function(t){t[t.IMAGE=1]="IMAGE",t[t.TEXT=2]="TEXT",t[t.BUTTON=3]="BUTTON",t[t.SHAPE=100]="SHAPE"}(Vt||(Vt={}));var Jt,Kt,Yt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Zt=function(t){function e(e){return t.call(this,e)||this}return Yt(e,t),e}(Wt),Xt=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Qt=function(t){function e(e){var r=t.call(this,e)||this;return r.src=e.src,r}return Xt(e,t),e}(Wt),te=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ee=function(t){function e(e){var r=t.call(this,e)||this;return r.alg=Jt.START,r.prs=e.prs,r.alg=e.alg,e.f&&(r.f=new $t(e.f)),e.c&&(r.c=new Ut(e.c)),r}return te(e,t),Object.defineProperty(e.prototype,"parts",{get:function(){return this.prs},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"color",{get:function(){return this.c},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"font",{get:function(){return this.f},enumerable:!1,configurable:!0}),e}(Wt);!function(t){t[t.START=0]="START",t[t.CENTER=1]="CENTER",t[t.END=2]="END",t[t.JUSTIFY=3]="JUSTIFY"}(Jt||(Jt={})),function(t){t[t.NORMAL=0]="NORMAL",t[t.SUPER=1]="SUPER",t[t.SUB=2]="SUB"}(Kt||(Kt={}));var re,ne=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ie=function(t){function e(e){var r,n,i,o=this;return(o=t.call(this,e)||this).o=null!==(r=e.o)&&void 0!==r?r:re.C,o.desk=e.desk,o.w=null!==(n=o.w)&&void 0!==n?n:1080,o.h=null!==(i=o.h)&&void 0!==i?i:1920,o}return ne(e,t),e.prototype.getOrigin=function(){return this.o},e}(Wt);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(re||(re={}));var oe,se=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ue=function(t){function e(e){var r,n,i=this;return e=null!=e?e:{},(i=t.call(this,e)||this).gvt=null!==(r=e.gvt)&&void 0!==r?r:oe.C,i.max=e.max,i.cover=null===(n=e.cover)||void 0===n||n,i}return se(e,t),e}(Wt),ae=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),ce=function(t){function e(e){var r,n,i,o=this;return e=null!=e?e:{},(o=t.call(this,e)||this).elems=[],o.cont=new ie(e.cont),o.mob=new ue(e.mob),o.max=null!==(r=o.max)&&void 0!==r?r:null===(i=null===(n=e.cont)||void 0===n?void 0:n.desk)||void 0===i?void 0:i.max,o.bg||(o.bg=o.cont.bg,delete o.cont.bg),e.elems.forEach((function(t){t.t===Vt.IMAGE?o.elems.push(new Qt(t)):t.t===Vt.TEXT||t.t===Vt.BUTTON?o.elems.push(new ee(t)):t.t===Vt.SHAPE&&o.elems.push(new Zt(t))})),o}return ae(e,t),e.prototype.getStyles=function(){var t;return(t=this.gvt===oe.NW?{top:0,left:0}:this.gvt===oe.N?{top:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===oe.NE?{top:0,right:0}:this.gvt===oe.E?{top:"50%",right:0,transform:"translateY(-50%)"}:this.gvt===oe.SE?{bottom:0,right:0}:this.gvt===oe.S?{bottom:0,left:"50%",transform:"translateX(-50%)"}:this.gvt===oe.SW?{bottom:0,left:0}:this.gvt===oe.W?{top:"50%",left:0,transform:"translateY(-50%)"}:{top:"50%",left:"50%",transform:"translateX(-50%) translateY(-50%)"}).position="absolute",t.overflow="hidden",t},e.prototype.overrideForMobileView=function(){var t,e,r;this.max=null!==(t=this.mob.max)&&void 0!==t?t:this.max,this.cover=null!==(e=this.mob.cover)&&void 0!==e?e:this.cover,this.gvt=null!==(r=this.mob.gvt)&&void 0!==r?r:this.gvt},e}(ue);!function(t){t[t.NW=1]="NW",t[t.N=2]="N",t[t.NE=3]="NE",t[t.W=4]="W",t[t.C=5]="C",t[t.E=6]="E",t[t.SW=7]="SW",t[t.S=8]="S",t[t.SE=9]="SE"}(oe||(oe={}));var fe=function(t){this.expireAt=(new Date).getTime(),this.id=t.id,this.expireAt=t.expireAt,this.version=t.version,this.engagementID=t.engagementID,this.internal=t.internal,this.pn=t.pn,this.ian=new ce(t.ian)},pe=function(){function t(){}return t.getString=function(e,r){return void 0===r&&(r=""),t.LOCAL_STORAGE.getItem(e)||r},t.setString=function(e,r){r||(r=""),t.LOCAL_STORAGE.setItem(e,r)},t.getNumber=function(e,r){return+t.getString(e,"")||r},t.setNumber=function(e,r){t.setString(e,r.toString())},t.getBoolean=function(t,e){var r=this.LOCAL_STORAGE.getItem(t);return r?JSON.parse(r):e},t.setBoolean=function(e,r){t.setString(e,JSON.stringify(r))},t.getObject=function(e){try{return JSON.parse(t.getString(e,""))}catch(t){return{}}},t.getArray=function(e,r){void 0===r&&(r=[]);try{return JSON.parse(t.getString(e,""))}catch(t){return r}},t.setObject=function(e,r){t.setString(e,JSON.stringify(r))},t.setArray=function(e,r){t.setString(e,JSON.stringify(r))},t.remove=function(e){t.LOCAL_STORAGE.removeItem(e)},t.LOCAL_STORAGE=window.localStorage,t}(),le=function(){function r(){}return r.storeActiveTrigger=function(r){if("test"!==r.id){var n=pe.getObject(t.STORAGE_ACTIVE_TRIGGERS);n||(n=[]);var i=new e(r);i.isExpired||n.push(i),pe.setObject(t.STORAGE_ACTIVE_TRIGGER,i),pe.setObject(t.STORAGE_ACTIVE_TRIGGERS,n)}},r.getActiveTriggers=function(){var r=pe.getArray(t.STORAGE_ACTIVE_TRIGGERS);return r?(r.forEach((function(t,r,n){new e(t).isExpired&&n.splice(r,1)})),pe.setObject(t.STORAGE_ACTIVE_TRIGGERS,r),r):[]},r}(),he=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},de=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},ge=function(){function t(){this.loadedFonts=[]}return t.prototype.loadAllFonts=function(t){var e;return he(this,void 0,void 0,(function(){var r=this;return de(this,(function(n){return null===(e=t.elems)||void 0===e||e.forEach((function(t){t instanceof ee&&r.loadFamily(t.font.family)})),[2]}))}))},t.prototype.loadFamily=function(t){return he(this,void 0,void 0,(function(){var e;return de(this,(function(r){switch(r.label){case 0:return(null==t?void 0:t.fonts)?this.loadedFonts.indexOf(t.name)>-1?[2]:(e=[],t.fonts.forEach((function(r){if(r.url){var n=new FontFace(t.name,r.getURL(),r.getFontDescriptor());e.push(n.load())}})),this.loadedFonts.push(t.name),[4,Promise.all(e)]):[2];case 1:return r.sent().forEach((function(t){document.fonts.add(t)})),[2]}}))}))},t}(),ye=function(){function e(){this.inInactive=!0,this.lastEnterActive=new Date,this.lastEnterInactive=null,this.isDebug=!1}return e.getInstance=function(){return this.INSTANCE},e.prototype.getWebAppVersion=function(){var t;return null!==(t=this.webAppVersion)&&void 0!==t?t:"0.0.1+1"},e.prototype.setWebAppVersion=function(t){this.webAppVersion=t},e.prototype.isDebugWebApp=function(){return this.isDebug},e.prototype.setDebugWebApp=function(t){this.isDebug=t},e.prototype.isInactive=function(){return this.inInactive},e.prototype.setInactive=function(){this.inInactive=!0,this.lastEnterInactive=new Date,pe.setNumber(t.STORAGE_LAST_ACTIVE,this.lastEnterInactive.getTime())},e.prototype.setActive=function(){this.inInactive=!1,this.lastEnterActive=new Date},e.prototype.isFirstActive=function(){return null==this.lastEnterInactive},e.prototype.getLastEnterInactive=function(){return this.lastEnterInactive},e.prototype.getTimeForActiveInSeconds=function(){var t,e;return((null===(t=this.lastEnterInactive)||void 0===t?void 0:t.getTime())-(null===(e=this.lastEnterActive)||void 0===e?void 0:e.getTime()))/1e3},e.prototype.getTimeForInactiveInSeconds=function(){return null==this.lastEnterInactive?0:((new Date).getTime()-this.lastEnterInactive.getTime())/1e3},e.prototype.setScreen=function(t){this.screen=t},e.prototype.getScreen=function(){return this.screen},e.INSTANCE=new e,e}(),be=function(){function e(){}return e.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new e),this.INSTANCE},e.prototype.getCurrentSessionID=function(){return this.currentSessionID||null},e.prototype.isNewSessionRequired=function(){if(!pe.getString(t.STORAGE_SESSION_ID,""))return!0;var e=pe.getNumber(t.STORAGE_SESSION_START_TIME,0);return((new Date).getTime()-e)/1e3>t.IDLE_TIME_IN_SECONDS},e.prototype.checkForNewSession=function(){this.isNewSessionRequired()?this.startNewSession():this.initializeSessionFromStorage()},e.prototype.startNewSession=function(){this.currentSessionID||(this.currentSessionStartTime=new Date,this.currentSessionID=(new dt).toHexString(),pe.setNumber(t.STORAGE_SESSION_START_TIME,this.currentSessionStartTime.getTime()),pe.setString(t.STORAGE_SESSION_ID,this.currentSessionID),Ar.getInstance().sendEvent(new Bt(t.EVENT_SESSION_STARTED)),this.bumpSessionNumber())},e.prototype.bumpSessionNumber=function(){this.currentSessionNumber=pe.getNumber(t.STORAGE_SESSION_NUMBER,0),this.currentSessionNumber+=1,pe.setNumber(t.STORAGE_SESSION_NUMBER,this.currentSessionNumber)},e.prototype.getCurrentSessionNumber=function(){return this.currentSessionNumber||0},e.prototype.getTotalDurationInSeconds=function(){if(ye.getInstance().isFirstActive())throw new Error("This is the first time in foreground after launch");return(this.getLastActive()-this.currentSessionStartTime.getTime())/1e3},e.prototype.conclude=function(){var e={sessionID:this.currentSessionID,occurred:new Date,duration:this.getTotalDurationInSeconds()};Ar.getInstance().concludeSession(e),pe.remove(t.STORAGE_ACTIVE_TRIGGER),this.destroySession()},e.prototype.destroySession=function(){this.currentSessionID=void 0,this.currentSessionNumber=void 0,this.currentSessionStartTime=void 0,pe.remove(t.STORAGE_SESSION_ID),pe.remove(t.STORAGE_SESSION_START_TIME)},e.prototype.initializeSessionFromStorage=function(){this.currentSessionStartTime=new Date(pe.getNumber(t.STORAGE_SESSION_START_TIME,0)),this.currentSessionID=pe.getString(t.STORAGE_SESSION_ID,""),this.currentSessionNumber=pe.getNumber(t.STORAGE_SESSION_NUMBER,0)},e.prototype.getLastActive=function(){return pe.getNumber(t.STORAGE_LAST_ACTIVE,0)},e}(),ve=function(t,e){return ve=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},ve(t,e)};function me(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}ve(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}function we(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Se(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,i,o=r.call(t),s=[];try{for(;(void 0===e||e-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(t){i={error:t}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function Ee(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))}function _e(t){return"function"==typeof t}function Oe(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}Object.create,Object.create;var Te=Oe((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function xe(t,e){if(t){var r=t.indexOf(e);0<=r&&t.splice(r,1)}}var Ae=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=we(o),u=s.next();!u.done;u=s.next())u.value.remove(this)}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var a=this.initialTeardown;if(_e(a))try{a()}catch(t){i=t instanceof Te?t.errors:[t]}var c=this._finalizers;if(c){this._finalizers=null;try{for(var f=we(c),p=f.next();!p.done;p=f.next()){var l=p.value;try{De(l)}catch(t){i=null!=i?i:[],t instanceof Te?i=Ee(Ee([],Se(i)),Se(t.errors)):i.push(t)}}}catch(t){r={error:t}}finally{try{p&&!p.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}}if(i)throw new Te(i)}},t.prototype.add=function(e){var r;if(e&&e!==this)if(this.closed)De(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&xe(e,t)},t.prototype.remove=function(e){var r=this._finalizers;r&&xe(r,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),Ie=Ae.EMPTY;function Ne(t){return t instanceof Ae||t&&"closed"in t&&_e(t.remove)&&_e(t.add)&&_e(t.unsubscribe)}function De(t){_e(t)?t():t.unsubscribe()}var Pe=null,Be=null,Re=void 0,ke=!1,Le=!1,Ce={setTimeout:function(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=Ce.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,Ee([t,e],Se(r))):setTimeout.apply(void 0,Ee([t,e],Se(r)))},clearTimeout:function(t){var e=Ce.delegate;return((null==e?void 0:e.clearTimeout)||clearTimeout)(t)},delegate:void 0};function Ue(){}var je=Me("C",void 0,void 0);function Me(t,e,r){return{kind:t,value:e,error:r}}var He=null;function Ge(t){if(ke){var e=!He;if(e&&(He={errorThrown:!1,error:null}),t(),e){var r=He,n=r.errorThrown,i=r.error;if(He=null,n)throw i}}else t()}var Ve=function(t){function e(e){var r=t.call(this)||this;return r.isStopped=!1,e?(r.destination=e,Ne(e)&&e.add(r)):r.destination=Ke,r}return me(e,t),e.create=function(t,e,r){return new ze(t,e,r)},e.prototype.next=function(t){this.isStopped?Je(function(t){return Me("N",t,void 0)}(t),this):this._next(t)},e.prototype.error=function(t){this.isStopped?Je(Me("E",void 0,t),this):(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped?Je(je,this):(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(Ae),$e=Function.prototype.bind;function Fe(t,e){return $e.call(t,e)}var qe=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){We(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){We(t)}else We(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){We(t)}},t}(),ze=function(t){function e(e,r,n){var i,o,s=t.call(this)||this;return _e(e)||!e?i={next:null!=e?e:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&Le?((o=Object.create(e)).unsubscribe=function(){return s.unsubscribe()},i={next:e.next&&Fe(e.next,o),error:e.error&&Fe(e.error,o),complete:e.complete&&Fe(e.complete,o)}):i=e,s.destination=new qe(i),s}return me(e,t),e}(Ve);function We(t){var e;ke?(e=t,ke&&He&&(He.errorThrown=!0,He.error=e)):function(t){Ce.setTimeout((function(){if(!Pe)throw t;Pe(t)}))}(t)}function Je(t,e){var r=Be;r&&Ce.setTimeout((function(){return r(t,e)}))}var Ke={closed:!0,next:Ue,error:function(t){throw t},complete:Ue},Ye="function"==typeof Symbol&&Symbol.observable||"@@observable";function Ze(t){return t}function Xe(t){return 0===t.length?Ze:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)}}var Qe=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var r=new t;return r.source=this,r.operator=e,r},t.prototype.subscribe=function(t,e,r){var n,i=this,o=(n=t)&&n instanceof Ve||function(t){return t&&_e(t.next)&&_e(t.error)&&_e(t.complete)}(n)&&Ne(n)?t:new ze(t,e,r);return Ge((function(){var t=i,e=t.operator,r=t.source;o.add(e?e.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var r=this;return new(e=tr(e))((function(e,n){var i=new ze({next:function(e){try{t(e)}catch(t){n(t),i.unsubscribe()}},error:n,complete:e});r.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[Ye]=function(){return this},t.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return Xe(t)(this)},t.prototype.toPromise=function(t){var e=this;return new(t=tr(t))((function(t,r){var n;e.subscribe((function(t){return n=t}),(function(t){return r(t)}),(function(){return t(n)}))}))},t.create=function(e){return new t(e)},t}();function tr(t){var e;return null!==(e=null!=t?t:Re)&&void 0!==e?e:Promise}var er,rr,nr=Oe((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),ir=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return me(e,t),e.prototype.lift=function(t){var e=new or(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new nr},e.prototype.next=function(t){var e=this;Ge((function(){var r,n;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=we(e.currentObservers),o=i.next();!o.done;o=i.next())o.value.next(t)}catch(t){r={error:t}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},e.prototype.error=function(t){var e=this;Ge((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var r=e.observers;r.length;)r.shift().error(t)}}))},e.prototype.complete=function(){var t=this;Ge((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?Ie:(this.currentObservers=null,o.push(t),new Ae((function(){e.currentObservers=null,xe(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,r=e.hasError,n=e.thrownError,i=e.isStopped;r?t.error(n):i&&t.complete()},e.prototype.asObservable=function(){var t=new Qe;return t.source=this,t},e.create=function(t,e){return new or(t,e)},e}(Qe),or=function(t){function e(e,r){var n=t.call(this)||this;return n.destination=e,n.source=r,n}return me(e,t),e.prototype.next=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===r||r.call(e,t)},e.prototype.error=function(t){var e,r;null===(r=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===r||r.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,r;return null!==(r=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==r?r:Ie},e}(ir),sr={now:function(){return(sr.delegate||Date).now()},delegate:void 0},ur=function(t){function e(e,r,n){void 0===e&&(e=1/0),void 0===r&&(r=1/0),void 0===n&&(n=sr);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,r),i}return me(e,t),e.prototype.next=function(e){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,u=r._windowTime;n||(i.push(e),!o&&i.push(s.now()+u)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!t.closed;i+=r?1:2)t.next(n[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,r=t._timestampProvider,n=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),u=0,a=1;a<n.length&&n[a]<=s;a+=2)u=a;u&&n.splice(0,u+1)}},e}(ir),ar=r(238),cr=r.n(ar),fr=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},pr=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},lr=function(){function t(){this.parser=new(cr()),this.result={}}return t.prototype.get=function(){return fr(this,void 0,void 0,(function(){var t;return pr(this,(function(e){switch(e.label){case 0:return t=this.result,this.getDeviceMemory(),this.getNetworkType(),this.getOrientation(),[4,this.getBatteryInfo()];case 1:return e.sent(),[4,this.getLocation()];case 2:return e.sent(),t.locale=navigator.language,t.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:this.getDPI()},t.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},t.browser={name:this.parser.getBrowser().name,ver:this.parser.getBrowser().version},t.device={model:this.parser.getDevice().model,type:this.parser.getDevice().type,vendor:this.parser.getDevice().vendor},t.os={name:this.parser.getOS().name,ver:this.parser.getOS().version},[2,t]}}))}))},t.prototype.getDeviceMemory=function(){var t=navigator;if(t.deviceMemory){var e=t.deviceMemory;this.result.mem={tot:1024*e}}},t.prototype.getNetworkType=function(){var t=navigator,e=t.connection||t.mozConnection||t.webkitConnection;(null==e?void 0:e.effectiveType)&&(this.result.net={type:e.effectiveType})},t.prototype.getOrientation=function(){var t,e=null===(t=screen.orientation)||void 0===t?void 0:t.type;e&&(this.result.orientation=e)},t.prototype.getDPI=function(){var t=document.createElement("div");t.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(t);var e=window.devicePixelRatio||1,r=t.offsetWidth*e;return document.body.removeChild(t),r},t.prototype.getLocation=function(){return fr(this,void 0,void 0,(function(){var t=this;return pr(this,(function(e){switch(e.label){case 0:return navigator.geolocation&&navigator.permissions?[4,navigator.permissions.query({name:"geolocation"})]:[2];case 1:return"granted"!=e.sent().state?[2]:[2,new Promise((function(e){navigator.geolocation.getCurrentPosition((function(r){t.result.coords=[r.coords.latitude,r.coords.longitude],e()}),(function(){return e()}))}))]}}))}))},t.prototype.getBatteryInfo=function(){return fr(this,void 0,void 0,(function(){var t;return pr(this,(function(e){switch(e.label){case 0:if(!("getBattery"in navigator))return[2];e.label=1;case 1:return e.trys.push([1,3,,4]),[4,navigator.getBattery()];case 2:return t=e.sent(),this.result.bat={l:100*t.level,c:t.charging},[3,4];case 3:return e.sent(),[3,4];case 4:return[2]}}))}))},t}(),hr=function(t,e,r){if(r||2===arguments.length)for(var n,i=0,o=e.length;i<o;i++)!n&&i in e||(n||(n=Array.prototype.slice.call(e,0,i)),n[i]=e[i]);return t.concat(n||Array.prototype.slice.call(e))},dr=function(){function e(){}return e.log=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];console.log.apply(console,hr([t.LOG_PREFIX,":"],e,!1))},e.error=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];console.error.apply(console,hr([t.LOG_PREFIX,":"],e,!1))},e.warning=function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];console.warn.apply(console,hr([t.LOG_PREFIX,":"],e,!1))},e}(),gr=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},yr=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},br=function(){function r(){this.runtimeData=ye.getInstance(),this.apiToken="",this.userID=""}return r.getInstance=function(){return this.INSTANCE},r.prototype.doHTTP=function(e,r,n,i){return gr(this,void 0,void 0,(function(){var o,s,u;return yr(this,(function(a){switch(a.label){case 0:return r.startsWith("http")||(r=t.API_URL+r),o="keepalive"in new Request(""),i&&!o&&JSON.stringify(i).includes("CE App Background")?[2,this.performXMLHttpRequest(r,n,i)]:(s={method:e,headers:n,keepalive:!0},i&&(s.body=JSON.stringify(i)),[4,fetch(r,s)]);case 1:if(!(u=a.sent()).ok)throw u;return[2,u.json()]}}))}))},r.prototype.performXMLHttpRequest=function(t,e,r){var n=new XMLHttpRequest;return n.open("POST",t,!1),e.forEach((function(t,e){n.setRequestHeader(e,t)})),n.send(JSON.stringify(r)),n.response.json()},r.prototype.registerDevice=function(t){return gr(this,void 0,void 0,(function(){return yr(this,(function(e){return[2,this.doHTTP("POST","/v1/device/validate",this.getDefaultHeaders(),t)]}))}))},r.prototype.sendEvent=function(r){var n=this,i=this.getDefaultHeaders();r.activeTriggers=le.getActiveTriggers();var o=new e(pe.getObject(t.STORAGE_ACTIVE_TRIGGER));!r.trigger&&o&&(o.updateExpired(),r.trigger=o,"test"===o.triggerID)||this.doHTTP("POST","/v1/event/track",i,r).then((function(t){dr.log("Sent",r.name),t.triggerData&&(new zr).render(t.triggerData),t.userID&&t.sdkToken&&n.updateUserIDAndToken({userID:t.userID,sdkToken:t.sdkToken})})).catch((function(t){dr.error("Error sending event",t)}))},r.prototype.sendPastOrders=function(e){var r=this.getDefaultHeaders(),n={pastOrdersData:e};this.doHTTP("POST","/v1/event/trackPastOrders",r,n).then((function(){dr.log("Sent Past Orders"),pe.setBoolean(t.STORAGE_SHOPIFY_PAST_ORDERS_DATA_SENT,!0)})).catch((function(t){dr.error("Error sending event",t)}))},r.prototype.updateUserData=function(t){var e=this,r=this.getDefaultHeaders();this.doHTTP("PUT","/v1/user/update",r,t).then((function(t){dr.log("Updated user profile"),e.updateUserIDAndToken(t)})).catch((function(t){dr.error("Error saving user profile",t)}))},r.prototype.updateUserIDAndToken=function(e){Object.keys(e).length&&(e.userID&&(this.setUserID(e.userID),pe.setString(t.STORAGE_USER_ID,e.userID)),e.sdkToken&&(this.setAPIToken(e.sdkToken),pe.setString(t.STORAGE_SDK_TOKEN,e.sdkToken)))},r.prototype.updateDeviceProps=function(t){var e=this.getDefaultHeaders();this.doHTTP("PUT","/v1/device/update",e,t).then((function(){dr.log("Updated device property")})).catch((function(t){dr.error("Error saving device property",t)}))},r.prototype.concludeSession=function(t){var e=this.getDefaultHeaders();this.doHTTP("POST","/v1/session/conclude",e,t).then((function(t){dr.log("Conclude Session",t)})).catch((function(t){dr.error(t)}))},r.prototype.logout=function(){var t=this,e=this.getDefaultHeaders();this.doHTTP("GET","/v1/user/logout",e).then((function(e){dr.log("User logged out"),t.updateUserIDAndToken(e),be.getInstance().startNewSession()})).catch((function(t){dr.error(t)}))},r.prototype.getDefaultHeaders=function(){var e=new Headers;return e.set("sdk-version",t.SDK_VERSION),e.set("sdk-version-code",t.SDK_VERSION_CODE.toString()),e.set("app-version",this.runtimeData.getWebAppVersion()),e.set("user-id",this.userID),this.apiToken&&e.append("x-sdk-token",this.apiToken),t.SDK_DEBUG&&e.set("sdk-debug",String(1)),this.runtimeData.isDebugWebApp()&&e.set("app-debug",String(1)),e},r.prototype.setAPIToken=function(t){this.apiToken=null!=t?t:""},r.prototype.setUserID=function(t){this.userID=null!=t?t:""},r.INSTANCE=new r,r}(),vr=function(e,r,n){this.appID=e,this.uuid=r,this.props=n,this.sdk=t.SDK},mr=r(145),wr=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},Sr=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},Er=function(){function e(){this.apiService=br.getInstance(),this.sdkToken="",this.userID="",this.appID=""}return e.getInstance=function(){return this.INSTANCE},e.prototype.init=function(t){return this.appID=t,this.acquireSDKToken()},e.prototype.hasToken=function(){return!!pe.getString(t.STORAGE_SDK_TOKEN,"")},e.prototype.getUserID=function(){return this.userID},e.prototype.populateUserDataFromStorage=function(){return wr(this,void 0,void 0,(function(){return Sr(this,(function(e){return this.sdkToken=pe.getString(t.STORAGE_SDK_TOKEN,""),this.sdkToken||dr.log("No SDK token found in local storage"),this.userID=pe.getString(t.STORAGE_USER_ID,""),this.userID||dr.log("No user ID found in local storage"),this.updateAPIClient(),[2]}))}))},e.prototype.updateAPIClient=function(){dr.log("SDK Token:",this.sdkToken),dr.log("User ID:",this.userID),this.apiService.setAPIToken(this.sdkToken),this.apiService.setUserID(this.userID)},e.prototype.acquireSDKToken=function(){return wr(this,void 0,void 0,(function(){return Sr(this,(function(t){return this.hasToken()?[2,this.populateUserDataFromStorage()]:(dr.log("Attempt to acquire SDK token"),[2,this.getSDKTokenFromServer()])}))}))},e.prototype.getSDKTokenFromServer=function(){return wr(this,void 0,void 0,(function(){var t,e,r,n;return Sr(this,(function(i){switch(i.label){case 0:return[4,this.getUserAuthRequest()];case 1:t=i.sent(),e=this.apiService.registerDevice(t),i.label=2;case 2:return i.trys.push([2,4,,5]),[4,e];case 3:return r=i.sent(),dr.log("Register Device Response",r),this.saveUserDataInStorage(r),[3,5];case 4:throw n=i.sent(),dr.error(n),n;case 5:return[2]}}))}))},e.prototype.saveUserDataInStorage=function(e){this.sdkToken=e.sdkToken,this.userID=e.userID,this.updateAPIClient(),pe.setString(t.STORAGE_SDK_TOKEN,this.sdkToken),pe.setString(t.STORAGE_USER_ID,this.userID)},e.prototype.getUserAuthRequest=function(){return wr(this,void 0,void 0,(function(){var t,e;return Sr(this,(function(r){switch(r.label){case 0:return[4,(new lr).get()];case 1:(t=r.sent()).host=location.origin,r.label=2;case 2:return r.trys.push([2,4,,5]),[4,(0,mr.r)()];case 3:return(null==(e=r.sent())?void 0:e.isPrivate)&&(t.private=!0),[3,5];case 4:return r.sent(),[3,5];case 5:return[2,new vr(this.appID,this.getOrCreateUUID(),t)]}}))}))},e.prototype.getOrCreateUUID=function(){var e=pe.getString(t.STORAGE_DEVICE_UUID,"");return e||(e=(new dt).toHexString(),pe.setString(t.STORAGE_DEVICE_UUID,e)),e},e.INSTANCE=new e,e}(),_r=function(){function e(){}var r;return e.getString=function(t,e){return this.getItem(t)||e},e.setString=function(t,e){this.setItem(t,e)},e.getItem=function(t){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t))},e.setItem=function(t,e){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(t),e)},e.getAppID=function(){return pe.getString(t.STORAGE_APP_ID)},r=e,e.SESSION_STORAGE=window.sessionStorage,e.SESSION_STORAGE_KEY_PREFIX=t.COOEE.concat("/",r.getAppID(),"/"),e}(),Or=function(t,e,r,n){return new(r||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},Tr=function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}},xr=function(){function e(){this.sessionManager=be.getInstance(),this.safeHttpCallService=Ar.getInstance(),this.userAuthService=Er.getInstance()}return e.prototype.init=function(r){var n=this;t.BOT_UA_REGEX.test(navigator.userAgent)?dr.log("This seems to be a bot. Disabling SDK"):(this.userAuthService.init(r).then((function(){e.replaySubject.next(!0),e.replaySubject.complete()})).catch((function(){setTimeout((function(){n.init(r)}),3e4)})),this.execute())},e.prototype.execute=function(){this.sessionManager.checkForNewSession(),this.isAppFirstTimeLaunch()?this.sendFirstLaunchEvent():this.sendSuccessiveLaunchEvent()},e.prototype.isAppFirstTimeLaunch=function(){return!!pe.getBoolean(t.STORAGE_FIRST_TIME_LAUNCH,!0)&&(pe.setBoolean(t.STORAGE_FIRST_TIME_LAUNCH,!1),!0)},e.prototype.sendFirstLaunchEvent=function(){return Or(this,void 0,void 0,(function(){var e,r;return Tr(this,(function(n){switch(n.label){case 0:return e=new Bt(t.EVENT_APP_INSTALLED,{}),r=e,[4,(new lr).get()];case 1:return r.deviceProps=n.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.sendSuccessiveLaunchEvent=function(){return Or(this,void 0,void 0,(function(){var e,r;return Tr(this,(function(n){switch(n.label){case 0:return this.isNewTabOpened()?(e=new Bt(t.EVENT_APP_LAUNCHED),r=e,[4,(new lr).get()]):[2];case 1:return r.deviceProps=n.sent(),this.safeHttpCallService.sendEvent(e),[2]}}))}))},e.prototype.isNewTabOpened=function(){return!_r.getString(t.SESSION_STORAGE_TAB_OPENED,"")&&(_r.setString(t.SESSION_STORAGE_TAB_OPENED,"1"),!0)},e.replaySubject=new ur(1),e}(),Ar=function(){function t(){this.sessionManager=be.getInstance(),this.httpApiService=br.getInstance()}return t.getInstance=function(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE},t.prototype.sendEvent=function(t){var e=this;xr.replaySubject.subscribe((function(){e.addEventVariable(t),e.httpApiService.sendEvent(t)}))},t.prototype.sendPastOrders=function(t){var e=this;xr.replaySubject.subscribe((function(){e.httpApiService.sendPastOrders(t)}))},t.prototype.updateProfile=function(t){var e=this;xr.replaySubject.subscribe((function(){e.httpApiService.updateUserData(t)}))},t.prototype.updateDeviceProps=function(t){var e=this;xr.replaySubject.subscribe((function(){e.httpApiService.updateDeviceProps({props:t})}))},t.prototype.concludeSession=function(t){var e=this;xr.replaySubject.subscribe((function(){e.httpApiService.concludeSession(t)}))},t.prototype.logout=function(){var t=this;xr.replaySubject.subscribe((function(){t.httpApiService.logout()}))},t.prototype.addEventVariable=function(t){t.screenName=ye.getInstance().getScreen(),t.properties.path=location.pathname,t.sessionID=this.sessionManager.getCurrentSessionID(),t.sessionNumber=this.sessionManager.getCurrentSessionNumber()},t}();!function(t){t[t.CAMERA=1]="CAMERA",t[t.LOCATION=2]="LOCATION",t[t.PUSH=3]="PUSH"}(er||(er={})),function(t){t[t.IAB=1]="IAB",t[t.EXTERNAL=2]="EXTERNAL",t[t.PROMPT=3]="PROMPT",t[t.SAME_TAB=4]="SAME_TAB",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.KV_VIEW_ITEM=101]="KV_VIEW_ITEM",t[t.KV_ADD_TO_CART=102]="KV_ADD_TO_CART",t[t.KV_COUPON_CODE=103]="KV_COUPON_CODE",t[t.KV_VIEW_CATEGORY=104]="KV_VIEW_CATEGORY"}(rr||(rr={}));var Ir=function(){function t(){this.doc=document}return t.get=function(){return t._instance||(t._instance=new t),t._instance},t.prototype.getWidth=function(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientWidth:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientWidth:window.innerWidth},t.prototype.getHeight=function(){return this.parentContainer&&this.parentContainer!==document.body?this.parentContainer.clientHeight:document.compatMode===t.DOCUMENT_STANDARD_MODE?document.documentElement.clientHeight:window.innerHeight},t.prototype.isDesktop=function(){return this.parentContainer!==document.body?this.parentContainer.clientWidth>this.parentContainer.clientHeight:this.getWidth()>t.DEFAULT_DESKTOP_SIZE},t.prototype.calculateScalingFactor=function(e,r,n){var i=t.get().getWidth(),o=t.get().getHeight();n&&(i=Math.min(i,n),o=Math.min(o,n)),this.scalingFactor=i/o<e/r?i/e:o/r,this.scalingFactor=Math.min(this.scalingFactor,1)},t.prototype.getScalingFactor=function(){return this.scalingFactor},t.prototype.createElement=function(t){return this.doc.createElement(t)},t.prototype.appendChild=function(t,e){t.appendChild(e)},t.prototype.setStyle=function(t,e,r){e&&(r?t.style.setProperty(e,r,"important"):t.style.removeProperty(e))},t.prototype.setAttribute=function(t,e,r){t.setAttribute(e,r)},t.prototype.removeInApp=function(t){var e=document.querySelector(".".concat(t.rootClassName));e&&e.parentElement.removeChild(e)},t.prototype.setParentContainer=function(t){this.parentContainer=t},t.DOCUMENT_STANDARD_MODE="CSS1Compat",t.DOCUMENT_QUIRKS_MODE="BackCompat",t.DEFAULT_DESKTOP_SIZE=992,t}(),Nr=function(){return Nr=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},Nr.apply(this,arguments)},Dr=function(){function e(t,e){this.action=t,this.apiService=Ar.getInstance(),this.triggerContext=e}return e.prototype.execute=function(){var t=this.action.custKV;switch(this.action.at){case rr.EXTERNAL:this.externalAction();break;case rr.IAB:this.iabAction();break;case rr.SAME_TAB:this.gotoURLAction();break;case rr.SHARE:this.shareAction();break;case rr.PROMPT:this.prompt();break;case rr.KEY_VALUE:case rr.KV_ADD_TO_CART:case rr.KV_COUPON_CODE:case rr.KV_VIEW_CATEGORY:case rr.KV_VIEW_ITEM:t=Nr(Nr({},t),this.action.kv);break;case void 0:break;default:return void dr.error("Received an invalid ClickActionType: ",this.action.at)}this.upAction(),this.kvAction(t),this.closeAction()},e.prototype.externalAction=function(){var t,e;if(null===(t=this.action.ext)||void 0===t?void 0:t.u){var r=this.action.ext.u;this.isValidURL(r)||(r="//".concat(r)),null===(e=window.open(r,"_blank"))||void 0===e||e.focus()}},e.prototype.isValidURL=function(t){try{new URL(t)}catch(t){return!1}return!0},e.prototype.gotoURLAction=function(){var t;if(null===(t=this.action.gu)||void 0===t?void 0:t.u){var e=this.action.gu.u;this.isValidURL(e)||(e="//".concat(e)),window.open(e,"_self")}},e.prototype.iabAction=function(){var t;if(null===(t=this.action.iab)||void 0===t?void 0:t.u){var e=this.action.iab.u;this.isValidURL(e)||(e="//".concat(e)),(new Vr).render(e)}},e.prototype.upAction=function(){this.action.up&&this.apiService.updateProfile(this.action.up)},e.prototype.kvAction=function(t){document.dispatchEvent(new CustomEvent("onCooeeCTA",{detail:t}))},e.prototype.prompt=function(){var t=this.action.pmpt;t&&(t===er.LOCATION&&this.promptLocationPermission(),t===er.PUSH&&this.promptPushNotificationPermission(),t===er.CAMERA&&this.promptCameraPermission())},e.prototype.closeAction=function(){if(this.action.close){Ir.get().removeInApp(this.triggerContext);var e=this.triggerContext.startTime,r=((new Date).getTime()-e.getTime())/1e3,n={closeBehaviour:this.containsCTA()?"CTA":"Close",duration:r},i=new Bt(t.EVENT_TRIGGER_CLOSED,n,this.triggerContext.triggerData);this.apiService.sendEvent(i)}},e.prototype.containsCTA=function(){return!!this.action.at||!(this.isEmpty(this.action.custKV)&&this.isEmpty(this.action.up))},e.prototype.isEmpty=function(t){return!t||0===Object.keys(t).length},e.prototype.shareAction=function(){this.action.share&&(navigator.share?navigator.share({text:this.action.share.text,title:"Share"}).then((function(t){return console.log(t)})).catch((function(t){return console.error(t)})):dr.warning("Navigator.share is not compatible with this browser"))},e.prototype.promptLocationPermission=function(){var t=this;navigator.geolocation&&navigator.permissions&&navigator.geolocation.getCurrentPosition((function(e){t.apiService.updateDeviceProps({coords:[e.coords.latitude,e.coords.longitude]}),t.sendPermissionData()}))},e.prototype.promptPushNotificationPermission=function(){var t=this;"Notification"in window?"default"===Notification.permission?Notification.requestPermission().then((function(){t.sendPermissionData()})):this.apiService.updateDeviceProps({pnPerm:Notification.permission}):dr.warning("This browser does not support desktop notification")},e.prototype.promptCameraPermission=function(){var t=this;navigator.mediaDevices&&navigator.mediaDevices.getUserMedia({video:!0}).finally((function(){t.sendPermissionData()}))},e.prototype.checkPermission=function(t){return navigator.permissions.query({name:t}).then((function(t){return t.state.toString()}))},e.prototype.checkAllPermission=function(){return t=this,e=void 0,n=function(){var t,e,r;return function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}(this,(function(n){switch(n.label){case 0:return[4,this.checkPermission("camera")];case 1:return t=n.sent(),[4,this.checkPermission("geolocation")];case 2:return e=n.sent(),r=Notification.permission,[2,{camera:t,location:e,notification:r}]}}))},new((r=void 0)||(r=Promise))((function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}));var t,e,r,n},e.prototype.sendPermissionData=function(){var t=this;this.checkAllPermission().then((function(e){t.apiService.updateDeviceProps({perm:e})}))},e}(),Pr=function(){function t(t,e,r){this.renderer=Ir.get(),this.screenWidth=0,this.screenHeight=0,this.parentHTMLEl=t,this.inappElement=e,this.triggerContext=r,this.scalingFactor=this.renderer.getScalingFactor(),this.screenWidth=this.renderer.getWidth(),this.screenHeight=this.renderer.getHeight()}return t.prototype.getHTMLElement=function(){return this.inappHTMLEl},t.prototype.insertElement=function(){this.renderer.appendChild(this.parentHTMLEl,this.inappHTMLEl)},t.prototype.processCommonBlocks=function(){this.processWidthAndHeight(),this.processPositionBlock(),this.processBorderBlock(),this.processBackgroundBlock(),this.processSpaceBlock(),this.processTransformBlock(),this.processTransparency(),this.processShadow(),this.registerAction(),this.renderer.setStyle(this.inappHTMLEl,"display","block"),this.renderer.setStyle(this.inappHTMLEl,"outline","none")},t.prototype.processWidthAndHeight=function(){this.renderer.setStyle(this.inappHTMLEl,"box-sizing","border-box"),this.inappElement.w&&this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(this.inappElement.w)),this.inappElement.h&&this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(this.inappElement.h))},t.prototype.getSizePx=function(t){return t*this.scalingFactor+"px"},t.prototype.processPositionBlock=function(){this.renderer.setStyle(this.inappHTMLEl,"position","absolute"),this.inappElement.x&&this.renderer.setStyle(this.inappHTMLEl,"left",this.getSizePx(this.inappElement.x)),this.inappElement.y&&this.renderer.setStyle(this.inappHTMLEl,"top",this.getSizePx(this.inappElement.y))},t.prototype.processBorderBlock=function(){var t,e=this.inappElement.br;e&&(e.radius&&e.radius>0&&this.renderer.setStyle(this.inappHTMLEl,"border-radius",this.getSizePx(e.radius)),e.width&&e.width>0&&(this.renderer.setStyle(this.inappHTMLEl,"border-width",this.getSizePx(e.width)),this.renderer.setStyle(this.inappHTMLEl,"border-style",null===(t=e.style)||void 0===t?void 0:t.toLowerCase()),e.color?this.processColourBlock(e.color,"border-color"):this.renderer.setStyle(this.inappHTMLEl,"border-color","black")))},t.prototype.processSpaceBlock=function(){var t=this.inappElement.spc;t&&(t.p&&this.renderer.setStyle(this.inappHTMLEl,"padding",this.getSizePx(t.p)),t.pt&&this.renderer.setStyle(this.inappHTMLEl,"padding-top",this.getSizePx(t.pt)),t.pb&&this.renderer.setStyle(this.inappHTMLEl,"padding-bottom",this.getSizePx(t.pb)),t.pl&&this.renderer.setStyle(this.inappHTMLEl,"padding-left",this.getSizePx(t.pl)),t.pr&&this.renderer.setStyle(this.inappHTMLEl,"padding-right",this.getSizePx(t.pr)),this.renderer.setStyle(this.inappHTMLEl,"margin","0 !important"))},t.prototype.processTransparency=function(){var t=this.inappElement.alpha;if(!isNaN(t)){var e=(t/100).toFixed(2);this.renderer.setStyle(this.inappHTMLEl,"opacity",e)}},t.prototype.processShadow=function(){var t=this.inappElement.shd;t&&this.renderer.setStyle(this.inappHTMLEl,"box-shadow",t.getStyle(this.scalingFactor))},t.prototype.processTransformBlock=function(){var t=new zt(this.inappElement.trf);t&&t.rotate&&this.renderer.setStyle(this.inappHTMLEl,"transform","rotate(".concat(t.rotate,"deg)"))},t.prototype.registerAction=function(){var t=this,e=this.inappElement.clc;e&&0!==Object.keys(e).length&&(this.inappHTMLEl.addEventListener("click",(function(r){r.stopPropagation(),new Dr(e,t.triggerContext).execute()})),this.inappElement instanceof ie&&1===Object.keys(e).length&&void 0!==e.close&&null!==e.close||this.renderer.setStyle(this.inappHTMLEl,"cursor","pointer"))},t.prototype.processBackgroundBlock=function(){var t=this.inappElement.bg;if(t){var e=this.inappHTMLEl;if(t.glossy){var r="backdrop-filter",n="-webkit-"+r,i="blur(".concat(t.glossy.radius,"px)");if(!CSS.supports(n,i)&&!CSS.supports(r,i))return void this.renderer.setStyle(e,"background",t.glossy.fallback.rgba);this.renderer.setStyle(e,n,i),this.renderer.setStyle(e,r,i),t.glossy.color&&this.processColourBlock(t.glossy.color,"background",e)}else if(t.solid)t.solid.grad?this.processGradient(t.solid.grad,"background"):t.solid.hex&&this.renderer.setStyle(e,"background",t.solid.rgba);else if(t.img){if(!t.img.src)return;var o='url("'.concat(t.img.src,'") no-repeat center');this.renderer.setStyle(e,"background",o),this.renderer.setStyle(e,"background-size","cover"),t.img.a&&(this.renderer.setStyle(e,"-webkit-backdrop-filter","opacity(".concat(t.img.a,")")),this.renderer.setStyle(e,"backdrop-filter","opacity(".concat(t.img.a,")")))}}},t.prototype.processGradient=function(t,e){if("LINEAR"===t.type){var r="linear-gradient(".concat(t.ang,"deg, ").concat(t.c1,", ").concat(t.c2);t.c3&&(r+=", ".concat(t.c3)),r+=")",this.renderer.setStyle(this.inappHTMLEl,e,r)}},t.prototype.processColourBlock=function(t,e,r){void 0===e&&(e="color"),void 0===r&&(r=this.inappHTMLEl),t&&(t.grad?this.processGradient(t.grad,e):t.hex&&this.renderer.setStyle(r,e,t.rgba))},t}(),Br=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Rr=function(t){function e(e,r,n){return t.call(this,e,r,n)||this}return Br(e,t),e.prototype.processCommonBlocks=function(){t.prototype.processCommonBlocks.call(this),this.processFontBlock(),this.processColourBlock(this.inappElement.color),this.processAlignment()},e.prototype.processFontBlock=function(){var t,e=this.inappElement.font;e&&(this.renderer.setStyle(this.inappHTMLEl,"font-size",this.getSizePx(e.s)),this.renderer.setStyle(this.inappHTMLEl,"font-family",null===(t=e.family)||void 0===t?void 0:t.name),this.renderer.setStyle(this.inappHTMLEl,"line-height",e.lh))},e.prototype.processPart=function(t,e){var r,n=[];e.u&&n.push("underline"),e.st&&n.push("line-through"),n.length||n.push("normal"),this.renderer.setStyle(t,"font-weight",e.b?"bold":"normal"),this.renderer.setStyle(t,"font-style",e.i?"italic":"normal"),this.renderer.setStyle(t,"text-decoration",n.join(" ")),this.renderer.setStyle(t,"color",null!==(r=e.c)&&void 0!==r?r:"inherit"),this.renderer.setStyle(t,"font-family","inherit")},e.prototype.processAlignment=function(){var t,e=null===(t=Jt[this.inappElement.alg])||void 0===t?void 0:t.toLowerCase();e||(e="start"),this.renderer.setStyle(this.inappHTMLEl,"text-align",e)},e}(Pr),kr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Lr=function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.inappHTMLEl=i.renderer.createElement("div"),i.insertElement(),i}return kr(e,t),e.prototype.render=function(){var t,e=this;null===(t=this.inappElement.parts)||void 0===t||t.forEach((function(t){var r,n,i=e.renderer.createElement("span");i.innerHTML=null===(n=null===(r=t.txt)||void 0===r?void 0:r.toString())||void 0===n?void 0:n.replace(/\n/g,"<br />"),e.processPart(i,t),e.renderer.appendChild(e.inappHTMLEl,i)})),this.processCommonBlocks()},e}(Rr),Cr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Ur=function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.inappHTMLEl=i.renderer.createElement("div"),i.insertElement(),i}return Cr(e,t),e.prototype.render=function(){this.processCommonBlocks()},e}(Pr),jr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Mr=function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.inappHTMLEl=i.renderer.createElement("img"),i.insertElement(),i}return jr(e,t),e.prototype.render=function(){this.renderer.setAttribute(this.inappHTMLEl,"src",this.inappElement.src),this.renderer.setStyle(this.inappHTMLEl,"max-width","none"),this.renderer.setStyle(this.inappHTMLEl,"max-height","none"),this.renderer.setStyle(this.inappHTMLEl,"margin","0 auto"),this.processCommonBlocks()},e}(Pr),Hr=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Gr=function(e){function r(t,r,n){var i=e.call(this,t,r,n)||this;return i.parent=t,i.inappHTMLEl=i.renderer.createElement("div"),i}return Hr(r,e),r.prototype.render=function(){var e=this;return this.parent||this.renderer.removeInApp(this.triggerContext),this.inappHTMLEl.classList.add(t.IN_APP_CONTAINER_NAME),this.inappHTMLEl.classList.add(this.triggerContext.rootClassName),this.renderer.setStyle(this.inappHTMLEl,"z-index",r.MAX_Z_INDEX),this.addProperties(),this.insertElement(),this.inappHTMLEl.addEventListener("click",(function(){new Dr({close:!0},e.triggerContext).execute()})),this.inappHTMLEl},r.prototype.addProperties=function(){var t=this.inappElement.cont;this.inappElement.cover?(this.processBackgroundBlock(),this.renderer.setStyle(this.inappHTMLEl,"top","0"),this.renderer.setStyle(this.inappHTMLEl,"left","0"),this.renderer.setStyle(this.inappHTMLEl,"width","100%"),this.renderer.setStyle(this.inappHTMLEl,"height","100%")):(this.renderer.setStyle(this.inappHTMLEl,"width",this.getSizePx(t.w)),this.renderer.setStyle(this.inappHTMLEl,"height",this.getSizePx(t.h)),Object.assign(this.inappHTMLEl.style,this.inappElement.getStyles())),this.inappElement.gvt!==oe.C&&this.renderer.setStyle(this.inappHTMLEl,"margin","15px"),this.parent!==document.body?this.renderer.setStyle(this.inappHTMLEl,"position","absolute"):this.renderer.setStyle(this.inappHTMLEl,"position","fixed")},r.MAX_Z_INDEX="2147483647",r}(Pr),Vr=function(){function e(){this.renderer=Ir.get()}return e.prototype.render=function(e){var r=document.querySelector(".".concat(t.IN_APP_CONTAINER_NAME)),n=this.createIFrameContainer();return this.createIFrameElement(n,e),this.createAnchorElement(r,n),this.renderer.appendChild(r,n),n},e.prototype.createIFrameContainer=function(){var t=this.renderer.createElement("div");return this.renderer.setAttribute(t,"class","iframe-container"),this.renderer.setAttribute(t,"id","iframe-container"),this.renderer.setStyle(t,"width","100%"),this.renderer.setStyle(t,"height","100%"),this.renderer.setStyle(t,"position","absolute"),this.renderer.setStyle(t,"top","0px"),this.renderer.setStyle(t,"left","0px"),t},e.prototype.createIFrameElement=function(t,e){var r=this.renderer.createElement("iframe");return this.renderer.setStyle(r,"width","100%"),this.renderer.setStyle(r,"height","100%"),this.renderer.setAttribute(r,"src",e),this.renderer.setAttribute(r,"frameBorder","0"),this.renderer.appendChild(t,r),r},e.prototype.createAnchorElement=function(t,e){var r=this.renderer.createElement("a");return this.renderer.setStyle(r,"position","absolute"),this.renderer.setStyle(r,"top","0px"),this.renderer.setStyle(r,"right","0px"),r.href="#",r.innerHTML="Close",r.onclick=function(){t.removeChild(e)},this.renderer.appendChild(e,r),r},e}(),$r=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},t(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),Fr=function(t){function e(e,r,n){var i=t.call(this,e,r,n)||this;return i.inappHTMLEl=i.renderer.createElement("div"),i.insertElement(),i}return $r(e,t),e.prototype.render=function(){return this.processCommonBlocks(),this.renderer.setStyle(this.inappHTMLEl,"position","relative"),this},e}(Pr),qr=function(){function e(t,e){this._startTime=t,this._triggerData=e}return Object.defineProperty(e.prototype,"startTime",{get:function(){return this._startTime},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"triggerData",{get:function(){return this._triggerData},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rootClassName",{get:function(){var e=this.triggerData.id.slice(-6);return"test"===e&&(e=this.startTime.getTime().toString()),t.IN_APP_CONTAINER_NAME+"-"+e},enumerable:!1,configurable:!0}),e}(),zr=function(){function e(t){this.renderer=Ir.get(),this.parent=null!=t?t:document.body,this.renderer.setParentContainer(this.parent)}return e.prototype.render=function(e){e=new fe(e);var r=new qr(new Date,e);this.ian=e.ian,this.renderer.isDesktop()||this.ian.overrideForMobileView(),this.renderer.calculateScalingFactor(this.ian.cont.w,this.ian.cont.h,this.ian.max),this.rootContainer=new Gr(this.parent,this.ian,r).render();try{this.renderContainer(r);var n=new Bt(t.EVENT_TRIGGER_DISPLAYED,{},r.triggerData);Ar.getInstance().sendEvent(n),le.storeActiveTrigger(e)}catch(t){dr.error(t)}},e.prototype.renderElement=function(t,e,r){e instanceof ee?new Lr(t,e,r).render():e instanceof Qt?new Mr(t,e,r).render():e instanceof Zt?new Ur(t,e,r).render():dr.error("Unsupported element type- "+e.type)},e.prototype.renderContainer=function(t){var e,r,n=this,i=null===(e=this.ian)||void 0===e?void 0:e.cont;if(i){var o=new Fr(this.rootContainer,i,t).render().getHTMLElement();Object.assign(o.style,this.ian.getStyles()),(new ge).loadAllFonts(this.ian),null===(r=this.ian.elems)||void 0===r||r.forEach((function(e){return r=n,i=void 0,u=function(){return function(t,e){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function u(o){return function(u){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((i=(i=s.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,u])}}}(this,(function(r){switch(r.label){case 0:return[4,this.renderElement(o,e,t)];case 1:return r.sent(),[2]}}))},new((s=void 0)||(s=Promise))((function(t,e){function n(t){try{a(u.next(t))}catch(t){e(t)}}function o(t){try{a(u.throw(t))}catch(t){e(t)}}function a(e){var r;e.done?t(e.value):(r=e.value,r instanceof s?r:new s((function(t){t(r)}))).then(n,o)}a((u=u.apply(r,i||[])).next())}));var r,i,s,u}))}},e}();const Wr=zr})(),CooeePreview=n.default})();
|