@letscooee/web-sdk 9.4.0 → 9.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.min.js CHANGED
@@ -1,4 +1,4 @@
1
- var rg=Object.create;var xc=Object.defineProperty,ng=Object.defineProperties,ig=Object.getOwnPropertyDescriptor,og=Object.getOwnPropertyDescriptors,sg=Object.getOwnPropertyNames,op=Object.getOwnPropertySymbols,ag=Object.getPrototypeOf,ap=Object.prototype.hasOwnProperty,cg=Object.prototype.propertyIsEnumerable;var sp=(t,e,r)=>e in t?xc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e||={})ap.call(e,r)&&sp(t,r,e[r]);if(op)for(var r of op(e))cg.call(e,r)&&sp(t,r,e[r]);return t},ee=(t,e)=>ng(t,og(e));var zi=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ur=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var lg=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of sg(e))!ap.call(t,i)&&i!==r&&xc(t,i,{get:()=>e[i],enumerable:!(n=ig(e,i))||n.enumerable});return t};var Se=(t,e,r)=>(r=t!=null?rg(ag(t)):{},lg(e||!t||!t.__esModule?xc(r,"default",{value:t,enumerable:!0}):r,t));var nn=ur((lp,Yo)=>{"use strict";(function(t){"use strict";var e={};e.VERSION="1.6.1";var r,n={},i=function(m,p){return function(){return p.apply(m,arguments)}},o=function(){var m=arguments,p=m[0],f,d;for(d=1;d<m.length;d++)for(f in m[d])!(f in p)&&m[d].hasOwnProperty(f)&&(p[f]=m[d][f]);return p},s=function(m,p){return{value:m,name:p}};e.TRACE=s(1,"TRACE"),e.DEBUG=s(2,"DEBUG"),e.INFO=s(3,"INFO"),e.TIME=s(4,"TIME"),e.WARN=s(5,"WARN"),e.ERROR=s(8,"ERROR"),e.OFF=s(99,"OFF");var a=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info};a.prototype={setLevel:function(m){m&&"value"in m&&(this.context.filterLevel=m)},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var p=this.context.filterLevel;return m.value>=p.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(m){typeof m=="string"&&m.length>0&&this.invoke(e.TIME,[m,"start"])},timeEnd:function(m){typeof m=="string"&&m.length>0&&this.invoke(e.TIME,[m,"end"])},invoke:function(m,p){r&&this.enabledFor(m)&&r(p,o({level:m},this.context))}};var c=new a({filterLevel:e.OFF});(function(){var m=e;m.enabledFor=i(c,c.enabledFor),m.trace=i(c,c.trace),m.debug=i(c,c.debug),m.time=i(c,c.time),m.timeEnd=i(c,c.timeEnd),m.info=i(c,c.info),m.warn=i(c,c.warn),m.error=i(c,c.error),m.log=m.info})(),e.setHandler=function(m){r=m},e.setLevel=function(m){c.setLevel(m);for(var p in n)n.hasOwnProperty(p)&&n[p].setLevel(m)},e.getLevel=function(){return c.getLevel()},e.get=function(m){return n[m]||(n[m]=new a(o({name:m},c.context)))},e.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(g,E){E.name&&g.unshift("["+E.name+"]")};var p={},f=function(d,g){Function.prototype.apply.call(d,console,g)};return typeof console>"u"?function(){}:function(d,g){d=Array.prototype.slice.call(d);var E=console.log,A;g.level===e.TIME?(A=(g.name?"["+g.name+"] ":"")+d[0],d[1]==="start"?console.time?console.time(A):p[A]=new Date().getTime():console.timeEnd?console.timeEnd(A):f(E,[A+": "+(new Date().getTime()-p[A])+"ms"])):(g.level===e.WARN&&console.warn?E=console.warn:g.level===e.ERROR&&console.error?E=console.error:g.level===e.INFO&&console.info?E=console.info:g.level===e.DEBUG&&console.debug?E=console.debug:g.level===e.TRACE&&console.trace&&(E=console.trace),m.formatter(d,g),f(E,d))}},e.useDefaults=function(m){e.setLevel(m&&m.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(m))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof Yo<"u"&&Yo.exports?Yo.exports=e:(e._prevLogger=t.Logger,e.noConflict=function(){return t.Logger=e._prevLogger,e},t.Logger=e)})(lp)});var Dc=ur(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.MustacheUtils=void 0;var zo=class t{static escapeHtml(e){return String(e).replace(/"/g,r=>t.entityMap[r])}};qo.MustacheUtils=zo;zo.entityMap={'"':"&quot;"}});var Rr=ur(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.MilestoneRewardType=z.ProgressBarLayout=z.EngagementContentSource=z.EngagementObjective=z.OnsiteDeliveryType=z.ClickActionType=z.FrequencyGapUnit=z.FrequencyType=z.RedirectBehaviour=z.EngagementPlacementPosition=z.EngagementCollectionSource=z.PromotionType=z.CartFilterEnum=z.CartCurrencyOperator=z.CartCriteria=z.URLCriteria=z.UTMCriteria=z.CartItemSource=z.EngagementItemSource=z.PurchasedVisitor=z.LoggedInVisitor=z.VisitorType=z.SessionType=z.EngagementContentType=z.TriggerType=z.EngagementType=z.EngagementStatus=z.TimePreference=z.ScheduleFrequency=z.CriteriaFrequency=void 0;var up=function(t){return t[t.ONCE_PER_USER=1]="ONCE_PER_USER",t[t.ONCE_PER_SESSION=2]="ONCE_PER_SESSION",t[t.EVERY_TIME=3]="EVERY_TIME",t}(up||(z.CriteriaFrequency=up={})),pp=function(t){return t[t.ONE_TIME=1]="ONE_TIME",t[t.MULTIPLE=2]="MULTIPLE",t[t.RECURRING=3]="RECURRING",t}(pp||(z.ScheduleFrequency=pp={})),fp=function(t){return t[t.NOW=1]="NOW",t[t.LATER=2]="LATER",t[t.NEVER=3]="NEVER",t}(fp||(z.TimePreference=fp={})),mp=function(t){return t[t.PUBLISHED=1]="PUBLISHED",t[t.DRAFT=2]="DRAFT",t[t.PAUSED=3]="PAUSED",t[t.FAILED=4]="FAILED",t[t.STOPPED=5]="STOPPED",t[t.COMPLETED=6]="COMPLETED",t[t.ARCHIVED=7]="ARCHIVED",t[t.UNINSTALLED=8]="UNINSTALLED",t}(mp||(z.EngagementStatus=mp={})),dp=function(t){return t[t.POPUP=1]="POPUP",t[t.LEAD_GENERATION=2]="LEAD_GENERATION",t[t.PRODUCT_WIDGET=3]="PRODUCT_WIDGET",t[t.PRODUCT_BUNDLE=4]="PRODUCT_BUNDLE",t[t.ANNOUNCEMENT_BAR=5]="ANNOUNCEMENT_BAR",t[t.CART_REMINDER=6]="CART_REMINDER",t[t.CRO_COPILOT=10]="CRO_COPILOT",t[t.OTHER=11]="OTHER",t}(dp||(z.EngagementType=dp={})),hp=function(t){return t[t.NONE=0]="NONE",t[t.RULE_BASED=1]="RULE_BASED",t[t.INTENT_BASED=2]="INTENT_BASED",t}(hp||(z.TriggerType=hp={})),gp=function(t){return t[t.SINGLE=1]="SINGLE",t[t.EXCLUSION=2]="EXCLUSION",t[t.ABTESTING=3]="ABTESTING",t}(gp||(z.EngagementContentType=gp={})),yp=function(t){return t[t.ALL=0]="ALL",t[t.NEW_ONLY=1]="NEW_ONLY",t[t.RETURNING_ONLY=2]="RETURNING_ONLY",t}(yp||(z.SessionType=yp={})),vp=function(t){return t[t.ALL=0]="ALL",t[t.LOGGED_IN_ONLY=3]="LOGGED_IN_ONLY",t[t.NON_LOGGED_IN_ONLY=4]="NON_LOGGED_IN_ONLY",t[t.PURCHASED=5]="PURCHASED",t[t.NON_PURCHASED=6]="NON_PURCHASED",t[t.ABANDON_CART=7]="ABANDON_CART",t[t.RETURNING_AND_NON_PURCHASED=8]="RETURNING_AND_NON_PURCHASED",t}(vp||(z.VisitorType=vp={})),_p=function(t){return t.ALL="ALL",t.LOGGED_IN="LOGGED_IN",t.NON_LOGGED_IN="NON_LOGGED_IN",t}(_p||(z.LoggedInVisitor=_p={})),Ep=function(t){return t.ALL="ALL",t.PURCHASED="PURCHASED",t.NON_PURCHASED="NON_PURCHASED",t}(Ep||(z.PurchasedVisitor=Ep={})),Sp=function(t){return t[t.NONE=0]="NONE",t[t.ITEM_RECOMMENDATION=1]="ITEM_RECOMMENDATION",t[t.MULTIPLE_ITEMS=2]="MULTIPLE_ITEMS",t[t.SINGLE_ITEM=3]="SINGLE_ITEM",t[t.TOP_SELLING=4]="TOP_SELLING",t[t.STOCK_CLEARANCE=5]="STOCK_CLEARANCE",t[t.NEW_ARRIVALS=6]="NEW_ARRIVALS",t[t.RECENTLY_VIEWED=7]="RECENTLY_VIEWED",t[t.EVENT_ITEM=8]="EVENT_ITEM",t[t.CART_ITEM=9]="CART_ITEM",t[t.BUNDLE=10]="BUNDLE",t[t.CURRENT_ITEM=11]="CURRENT_ITEM",t[t.PURCHASED_PREVIOUSLY=12]="PURCHASED_PREVIOUSLY",t[t.COLLECTION_ITEMS=13]="COLLECTION_ITEMS",t[t.TRENDING_ITEMS=14]="TRENDING_ITEMS",t}(Sp||(z.EngagementItemSource=Sp={})),wp=function(t){return t[t.LAST_ADDED=1]="LAST_ADDED",t[t.FIRST_ADDED=2]="FIRST_ADDED",t[t.HIGHEST_PRICE=3]="HIGHEST_PRICE",t[t.LOWEST_PRICE=4]="LOWEST_PRICE",t[t.FIRST_MATCHING_TAG=5]="FIRST_MATCHING_TAG",t[t.ALL=6]="ALL",t}(wp||(z.CartItemSource=wp={})),bp=function(t){return t[t.ALL=0]="ALL",t[t.ONLY_ORGANIC=1]="ONLY_ORGANIC",t[t.ONLY_NON_ORGANIC=2]="ONLY_NON_ORGANIC",t[t.INCLUDES=3]="INCLUDES",t[t.EXCLUDES=4]="EXCLUDES",t}(bp||(z.UTMCriteria=bp={})),Ip=function(t){return t[t.NONE=0]="NONE",t[t.LIKE=1]="LIKE",t[t.NOT_LIKE=2]="NOT_LIKE",t[t.EQUALS=3]="EQUALS",t[t.NOT_EQUALS=4]="NOT_EQUALS",t}(Ip||(z.URLCriteria=Ip={})),Tp=function(t){return t[t.NONE=0]="NONE",t[t.LESS_THAN=1]="LESS_THAN",t[t.GREATER_THAN=2]="GREATER_THAN",t[t.BETWEEN=3]="BETWEEN",t[t.EQUALS=4]="EQUALS",t}(Tp||(z.CartCriteria=Tp={})),Cp=function(t){return t[t.ALL=0]="ALL",t[t.INCLUDES=1]="INCLUDES",t[t.EXCLUDES=2]="EXCLUDES",t}(Cp||(z.CartCurrencyOperator=Cp={})),xp=function(t){return t[t.NONE=0]="NONE",t[t.AMOUNT=1]="AMOUNT",t[t.TOTAL_PRODUCT=2]="TOTAL_PRODUCT",t[t.UNIQUE_PRODUCT=3]="UNIQUE_PRODUCT",t}(xp||(z.CartFilterEnum=xp={})),Dp=function(t){return t[t.NONE=0]="NONE",t[t.ITEM=1]="ITEM",t[t.COLLECTION=2]="COLLECTION",t}(Dp||(z.PromotionType=Dp={})),Rp=function(t){return t[t.NONE=0]="NONE",t[t.SINGLE=1]="SINGLE",t[t.MULTIPLE=2]="MULTIPLE",t}(Rp||(z.EngagementCollectionSource=Rp={})),Ap=function(t){return t.BEFORE="before",t.AFTER="after",t.INSIDE_FIRST="insideFirst",t.INSIDE_LAST="insideLast",t}(Ap||(z.EngagementPlacementPosition=Ap={})),Np=function(t){return t.SHOPIFY_CHECKOUT="shopify_checkout",t.THIRD_PARTY_CHECKOUT="third_party_checkout",t.CART_PAGE="cart_page",t.CART_DRAWER="cart_drawer",t}(Np||(z.RedirectBehaviour=Np={})),Op=function(t){return t.ONCE_IN_SESSION="ONCE_IN_SESSION",t.ACROSS_SESSIONS="ACROSS_SESSIONS",t}(Op||(z.FrequencyType=Op={})),Pp=function(t){return t.DAYS="DAYS",t.HOURS="HOURS",t.MINUTES="MINUTES",t.SECONDS="SECONDS",t}(Pp||(z.FrequencyGapUnit=Pp={})),Lp=function(t){return t[t.NONE=0]="NONE",t[t.REJECT_POPUP=1]="REJECT_POPUP",t[t.ACCEPT_POPUP=2]="ACCEPT_POPUP",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",t[t.OPEN_CART=105]="OPEN_CART",t[t.SUBMIT_FORM=106]="SUBMIT_FORM",t[t.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",t[t.ADD_BUNDLE=108]="ADD_BUNDLE",t[t.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",t}(Lp||(z.ClickActionType=Lp={})),Bp=function(t){return t.POPUP="POPUP",t.PAGE_EMBED="PAGE_EMBED",t.CART_EMBED="CART_EMBED",t.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",t}(Bp||(z.OnsiteDeliveryType=Bp={})),Up=function(t){return t.PRODUCT_PROMOTION="PRODUCT_PROMOTION",t.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",t.CART_RECOVERY="CART_RECOVERY",t.ANNOUNCEMENT="ANNOUNCEMENT",t.LEAD_GENERATION="LEAD_GENERATION",t.DATA_COLLECTION="DATA_COLLECTION",t.SALE_PROMOTION="SALE_PROMOTION",t.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",t.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",t.BYOB="BYOB",t.PROGRESS_BAR="PROGRESS_BAR",t.BUY_NOW="BUY_NOW",t}(Up||(z.EngagementObjective=Up={})),kp=function(t){return t.COOEE="COOEE",t.KLAVIYO="KLAVIYO",t}(kp||(z.EngagementContentSource=kp={})),Mp=function(t){return t.ICONS="ICONS",t.TILES="TILES",t}(Mp||(z.ProgressBarLayout=Mp={})),Fp=function(t){return t.FREE_SHIPPING="FREE_SHIPPING",t.DISCOUNT="DISCOUNT",t.FREE_AUTO_GIFT="FREE_AUTO_GIFT",t.FREE_GIFT_SELECT="FREE_GIFT_SELECT",t}(Fp||(z.MilestoneRewardType=Fp={}))});var Ko=ur(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.PriceRuleType=Gn.DiscountType=void 0;var Hp=function(t){return t[t.NONE=0]="NONE",t[t.STATIC=1]="STATIC",t[t.UNIQUE_FLAT=2]="UNIQUE_FLAT",t[t.UNIQUE_FLAT_ITEMS=3]="UNIQUE_FLAT_ITEMS",t[t.UNIQUE_FIXED_ITEMS=4]="UNIQUE_FIXED_ITEMS",t[t.UNIQUE_CHEAPEST_ITEM_FREE=5]="UNIQUE_CHEAPEST_ITEM_FREE",t[t.BXGY=6]="BXGY",t}(Hp||(Gn.DiscountType=Hp={})),$p=function(t){return t.FIXED_AMOUNT="fixed_amount",t.PERCENTAGE="percentage",t}($p||(Gn.PriceRuleType=$p={}))});var Ac=ur(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.ArrayUtils=void 0;var Rc=class t{static of(e,r){return r!==void 0?new Array(e).fill(r):Array.from({length:e},(n,i)=>i)}static remove(e,r){let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)}static swap(e,r,n){[e[r],e[n]]=[e[n],e[r]]}static sum(e,r){return e.reduce((n,i)=>n+Math.max(r?r(i):+i,0),0)}static unique(e,r){return e.filter((n,i,o)=>o.findIndex(s=>s[r]===n[r])===i)}static shuffle(e){let r=e.length;for(;r!=0;){let n=Math.floor(Math.random()*r);r--,t.swap(e,r,n)}}};Jo.ArrayUtils=Rc});var Sf=ur((Zi,is)=>{"use strict";(function(t,e){"use strict";var r="1.0.40",n="",i="?",o="function",s="undefined",a="object",c="string",m="major",p="model",f="name",d="type",g="vendor",E="version",A="architecture",O="console",D="mobile",R="tablet",P="smarttv",j="wearable",se="embedded",M=500,Q="Amazon",Y="Apple",ae="ASUS",Re="BlackBerry",ge="Browser",Ie="Chrome",Ge="Edge",Me="Firefox",lt="Google",Tt="Huawei",Te="LG",$e="Microsoft",me="Motorola",ne="Opera",je="Samsung",dt="Sharp",lr="Sony",Hr="Xiaomi",rn="Zebra",Mn="Facebook",$r="Chromium OS",Fn="Mac OS",Hn=" Browser",$n=function(V,X){var G={};for(var ye in V)X[ye]&&X[ye].length%2===0?G[ye]=X[ye].concat(V[ye]):G[ye]=V[ye];return G},tr=function(V){for(var X={},G=0;G<V.length;G++)X[V[G].toUpperCase()]=V[G];return X},ht=function(V,X){return typeof V===c?Ht(X).indexOf(Ht(V))!==-1:!1},Ht=function(V){return V.toLowerCase()},Wi=function(V){return typeof V===c?V.replace(/[^\d\.]/g,n).split(".")[0]:e},y=function(V,X){if(typeof V===c)return V=V.replace(/^\s\s*/,n),typeof X===s?V:V.substring(0,M)},l=function(V,X){for(var G=0,ye,gt,ut,ve,Z,Nt;G<X.length&&!Z;){var jn=X[G],Gi=X[G+1];for(ye=gt=0;ye<jn.length&&!Z&&jn[ye];)if(Z=jn[ye++].exec(V),Z)for(ut=0;ut<Gi.length;ut++)Nt=Z[++gt],ve=Gi[ut],typeof ve===a&&ve.length>0?ve.length===2?typeof ve[1]==o?this[ve[0]]=ve[1].call(this,Nt):this[ve[0]]=ve[1]:ve.length===3?typeof ve[1]===o&&!(ve[1].exec&&ve[1].test)?this[ve[0]]=Nt?ve[1].call(this,Nt,ve[2]):e:this[ve[0]]=Nt?Nt.replace(ve[1],ve[2]):e:ve.length===4&&(this[ve[0]]=Nt?ve[3].call(this,Nt.replace(ve[1],ve[2])):e):this[ve]=Nt||e;G+=2}},u=function(V,X){for(var G in X)if(typeof X[G]===a&&X[G].length>0){for(var ye=0;ye<X[G].length;ye++)if(ht(X[G][ye],V))return G===i?e:G}else if(ht(X[G],V))return G===i?e:G;return X.hasOwnProperty("*")?X["*"]:V},_={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},x={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"},U={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,E],[/opios[\/ ]+([\w\.]+)/i],[E,[f,ne+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[E,[f,ne+" GX"]],[/\bopr\/([\w\.]+)/i],[E,[f,ne]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[E,[f,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[E,[f,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,E],[/quark(?:pc)?\/([-\w\.]+)/i],[E,[f,"Quark"]],[/\bddg\/([\w\.]+)/i],[E,[f,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[f,"UC"+ge]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[E,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[E,[f,"Smart Lenovo "+ge]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+ge],E],[/\bfocus\/([\w\.]+)/i],[E,[f,Me+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[f,ne+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[f,ne+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[f,"MIUI"+Hn]],[/fxios\/([\w\.-]+)/i],[E,[f,Me]],[/\bqihoobrowser\/?([\w\.]*)/i],[E,[f,"360"]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,"$1Browser"],E],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1"+Hn],E],[/samsungbrowser\/([\w\.]+)/i],[E,[f,je+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[E,[f,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,"Sogou Mobile"],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,E],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[E,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,Mn],E],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[f,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[f,Ie+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,Ie+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[f,"Android "+ge]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[E,u,_]],[/(webkit|khtml)\/([\w\.]+)/i],[f,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],E],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[f,Me+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[f,[E,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[f,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[A,"amd64"]],[/(ia32(?=;))/i],[[A,Ht]],[/((?:i[346]|x)86)[;\)]/i],[[A,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[A,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[A,"armhf"]],[/windows (ce|mobile); ppc;/i],[[A,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[A,/ower/,n,Ht]],[/(sun4\w)[;\)]/i],[[A,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[A,Ht]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[g,je],[d,R]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[g,je],[d,D]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[g,Y],[d,D]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[g,Y],[d,R]],[/(macintosh);/i],[p,[g,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[g,dt],[d,D]],[/(?:honor)([-\w ]+)[;\)]/i],[p,[g,"Honor"],[d,D]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[g,Tt],[d,R]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[g,Tt],[d,D]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[p,/_/g," "],[g,Hr],[d,D]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[g,Hr],[d,R]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[g,"OPPO"],[d,D]],[/\b(opd2\d{3}a?) bui/i],[p,[g,"OPPO"],[d,R]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[g,"Vivo"],[d,D]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[g,"Realme"],[d,D]],[/\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],[p,[g,me],[d,D]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[g,me],[d,R]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[g,Te],[d,R]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[g,Te],[d,D]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[g,"Lenovo"],[d,R]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[g,"Nokia"],[d,D]],[/(pixel c)\b/i],[p,[g,lt],[d,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[g,lt],[d,D]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[g,lr],[d,D]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[g,lr],[d,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[g,"OnePlus"],[d,D]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[g,Q],[d,R]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[g,Q],[d,D]],[/(playbook);[-\w\),; ]+(rim)/i],[p,g,[d,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[g,Re],[d,D]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[g,ae],[d,R]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[g,ae],[d,D]],[/(nexus 9)/i],[p,[g,"HTC"],[d,R]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[p,/_/g," "],[d,D]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[p,[g,"TCL"],[d,R]],[/(itel) ((\w+))/i],[[g,Ht],p,[d,u,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[g,"Acer"],[d,R]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[g,"Meizu"],[d,D]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[g,"Ulefone"],[d,D]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[g,"Energizer"],[d,D]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[g,"Cat"],[d,D]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[g,"Smartfren"],[d,D]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[g,"Nothing"],[d,D]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[g,p,[d,D]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,p,[d,R]],[/(surface duo)/i],[p,[g,$e],[d,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[g,"Fairphone"],[d,D]],[/(u304aa)/i],[p,[g,"AT&T"],[d,D]],[/\bsie-(\w*)/i],[p,[g,"Siemens"],[d,D]],[/\b(rct\w+) b/i],[p,[g,"RCA"],[d,R]],[/\b(venue[\d ]{2,7}) b/i],[p,[g,"Dell"],[d,R]],[/\b(q(?:mv|ta)\w+) b/i],[p,[g,"Verizon"],[d,R]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[g,"Barnes & Noble"],[d,R]],[/\b(tm\d{3}\w+) b/i],[p,[g,"NuVision"],[d,R]],[/\b(k88) b/i],[p,[g,"ZTE"],[d,R]],[/\b(nx\d{3}j) b/i],[p,[g,"ZTE"],[d,D]],[/\b(gen\d{3}) b.+49h/i],[p,[g,"Swiss"],[d,D]],[/\b(zur\d{3}) b/i],[p,[g,"Swiss"],[d,R]],[/\b((zeki)?tb.*\b) b/i],[p,[g,"Zeki"],[d,R]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],p,[d,R]],[/\b(ns-?\w{0,9}) b/i],[p,[g,"Insignia"],[d,R]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[g,"NextBook"],[d,R]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],p,[d,D]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],p,[d,D]],[/\b(ph-1) /i],[p,[g,"Essential"],[d,D]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[g,"Envizen"],[d,R]],[/\b(trio[-\w\. ]+) b/i],[p,[g,"MachSpeed"],[d,R]],[/\btu_(1491) b/i],[p,[g,"Rotor"],[d,R]],[/(shield[\w ]+) b/i],[p,[g,"Nvidia"],[d,R]],[/(sprint) (\w+)/i],[g,p,[d,D]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[g,$e],[d,D]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[g,rn],[d,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[g,rn],[d,D]],[/smart-tv.+(samsung)/i],[g,[d,P]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[g,je],[d,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,Te],[d,P]],[/(apple) ?tv/i],[g,[p,Y+" TV"],[d,P]],[/crkey/i],[[p,Ie+"cast"],[g,lt],[d,P]],[/droid.+aft(\w+)( bui|\))/i],[p,[g,Q],[d,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[g,dt],[d,P]],[/(bravia[\w ]+)( bui|\))/i],[p,[g,lr],[d,P]],[/(mitv-\w{5}) bui/i],[p,[g,Hr],[d,P]],[/Hbbtv.*(technisat) (.*);/i],[g,p,[d,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,y],[p,y],[d,P]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,P]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,p,[d,O]],[/droid.+; (shield) bui/i],[p,[g,"Nvidia"],[d,O]],[/(playstation [345portablevi]+)/i],[p,[g,lr],[d,O]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[g,$e],[d,O]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[p,[g,je],[d,j]],[/((pebble))app/i],[g,p,[d,j]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[g,Y],[d,j]],[/droid.+; (glass) \d/i],[p,[g,lt],[d,j]],[/droid.+; (wt63?0{2,3})\)/i],[p,[g,rn],[d,j]],[/droid.+; (glass) \d/i],[p,[g,lt],[d,j]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,p,[d,j]],[/; (quest( \d| pro)?)/i],[p,[g,Mn],[d,j]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[d,se]],[/(aeobc)\b/i],[p,[g,Q],[d,se]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[d,D]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[d,R]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,R]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,D]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[f,Ge+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[f,E],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,E],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[f,[E,u,x]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[E,u,x],[f,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,Fn],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,E],[/\(bb(10);/i],[E,[f,Re]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[f,Me+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[f,Ie+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,$r],E],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,E],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,E]]},B=function(V,X){if(typeof V===a&&(X=V,V=e),!(this instanceof B))return new B(V,X).getResult();var G=typeof t!==s&&t.navigator?t.navigator:e,ye=V||(G&&G.userAgent?G.userAgent:n),gt=G&&G.userAgentData?G.userAgentData:e,ut=X?$n(U,X):U,ve=G&&G.userAgent==ye;return this.getBrowser=function(){var Z={};return Z[f]=e,Z[E]=e,l.call(Z,ye,ut.browser),Z[m]=Wi(Z[E]),ve&&G&&G.brave&&typeof G.brave.isBrave==o&&(Z[f]="Brave"),Z},this.getCPU=function(){var Z={};return Z[A]=e,l.call(Z,ye,ut.cpu),Z},this.getDevice=function(){var Z={};return Z[g]=e,Z[p]=e,Z[d]=e,l.call(Z,ye,ut.device),ve&&!Z[d]&&gt&&gt.mobile&&(Z[d]=D),ve&&Z[p]=="Macintosh"&&G&&typeof G.standalone!==s&&G.maxTouchPoints&&G.maxTouchPoints>2&&(Z[p]="iPad",Z[d]=R),Z},this.getEngine=function(){var Z={};return Z[f]=e,Z[E]=e,l.call(Z,ye,ut.engine),Z},this.getOS=function(){var Z={};return Z[f]=e,Z[E]=e,l.call(Z,ye,ut.os),ve&&!Z[f]&&gt&&gt.platform&&gt.platform!="Unknown"&&(Z[f]=gt.platform.replace(/chrome os/i,$r).replace(/macos/i,Fn)),Z},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 ye},this.setUA=function(Z){return ye=typeof Z===c&&Z.length>M?y(Z,M):Z,this},this.setUA(ye),this};B.VERSION=r,B.BROWSER=tr([f,E,m]),B.CPU=tr([A]),B.DEVICE=tr([p,g,d,O,D,P,R,j,se]),B.ENGINE=B.OS=tr([f,E]),typeof Zi!==s?(typeof is!==s&&is.exports&&(Zi=is.exports=B),Zi.UAParser=B):typeof define===o&&define.amd?define(function(){return B}):typeof t!==s&&(t.UAParser=B);var ie=typeof t!==s&&(t.jQuery||t.Zepto);if(ie&&!ie.ua){var he=new B;ie.ua=he.getResult(),ie.ua.get=function(){return he.getUA()},ie.ua.set=function(V){he.setUA(V);var X=he.getResult();for(var G in X)ie.ua[G]=X[G]}}})(typeof window=="object"?window:Zi)});var If=ur((bf,Zc)=>{"use strict";(function(t){if(typeof bf=="object"&&typeof Zc<"u")Zc.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return function n(i,o,s){function a(p,f){if(!o[p]){if(!i[p]){var d=typeof zi=="function"&&zi;if(!f&&d)return d(p,!0);if(c)return c(p,!0);var g=new Error("Cannot find module '"+p+"'");throw g.code="MODULE_NOT_FOUND",g}var E=o[p]={exports:{}};i[p][0].call(E.exports,function(A){var O=i[p][1][A];return a(O||A)},E,E.exports,n,i,o,s)}return o[p].exports}for(var c=typeof zi=="function"&&zi,m=0;m<s.length;m++)a(s[m]);return a}({1:[function(n,i,o){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,c;if(a){var m=0,p=new a(A),f=s.document.createTextNode("");p.observe(f,{characterData:!0}),c=function(){f.data=m=++m%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var d=new s.MessageChannel;d.port1.onmessage=A,c=function(){d.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?c=function(){var D=s.document.createElement("script");D.onreadystatechange=function(){A(),D.onreadystatechange=null,D.parentNode.removeChild(D),D=null},s.document.documentElement.appendChild(D)}:c=function(){setTimeout(A,0)};var g,E=[];function A(){g=!0;for(var D,R,P=E.length;P;){for(R=E,E=[],D=-1;++D<P;)R[D]();P=E.length}g=!1}i.exports=O;function O(D){E.push(D)===1&&!g&&c()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,i,o){"use strict";var s=n(1);function a(){}var c={},m=["REJECTED"],p=["FULFILLED"],f=["PENDING"];i.exports=d;function d(M){if(typeof M!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,M!==a&&O(this,M)}d.prototype.catch=function(M){return this.then(null,M)},d.prototype.then=function(M,Q){if(typeof M!="function"&&this.state===p||typeof Q!="function"&&this.state===m)return this;var Y=new this.constructor(a);if(this.state!==f){var ae=this.state===p?M:Q;E(Y,ae,this.outcome)}else this.queue.push(new g(Y,M,Q));return Y};function g(M,Q,Y){this.promise=M,typeof Q=="function"&&(this.onFulfilled=Q,this.callFulfilled=this.otherCallFulfilled),typeof Y=="function"&&(this.onRejected=Y,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(M){c.resolve(this.promise,M)},g.prototype.otherCallFulfilled=function(M){E(this.promise,this.onFulfilled,M)},g.prototype.callRejected=function(M){c.reject(this.promise,M)},g.prototype.otherCallRejected=function(M){E(this.promise,this.onRejected,M)};function E(M,Q,Y){s(function(){var ae;try{ae=Q(Y)}catch(Re){return c.reject(M,Re)}ae===M?c.reject(M,new TypeError("Cannot resolve promise with itself")):c.resolve(M,ae)})}c.resolve=function(M,Q){var Y=D(A,Q);if(Y.status==="error")return c.reject(M,Y.value);var ae=Y.value;if(ae)O(M,ae);else{M.state=p,M.outcome=Q;for(var Re=-1,ge=M.queue.length;++Re<ge;)M.queue[Re].callFulfilled(Q)}return M},c.reject=function(M,Q){M.state=m,M.outcome=Q;for(var Y=-1,ae=M.queue.length;++Y<ae;)M.queue[Y].callRejected(Q);return M};function A(M){var Q=M&&M.then;if(M&&(typeof M=="object"||typeof M=="function")&&typeof Q=="function")return function(){Q.apply(M,arguments)}}function O(M,Q){var Y=!1;function ae(Ge){Y||(Y=!0,c.reject(M,Ge))}function Re(Ge){Y||(Y=!0,c.resolve(M,Ge))}function ge(){Q(Re,ae)}var Ie=D(ge);Ie.status==="error"&&ae(Ie.value)}function D(M,Q){var Y={};try{Y.value=M(Q),Y.status="success"}catch(ae){Y.status="error",Y.value=ae}return Y}d.resolve=R;function R(M){return M instanceof this?M:c.resolve(new this(a),M)}d.reject=P;function P(M){var Q=new this(a);return c.reject(Q,M)}d.all=j;function j(M){var Q=this;if(Object.prototype.toString.call(M)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=M.length,ae=!1;if(!Y)return this.resolve([]);for(var Re=new Array(Y),ge=0,Ie=-1,Ge=new this(a);++Ie<Y;)Me(M[Ie],Ie);return Ge;function Me(lt,Tt){Q.resolve(lt).then(Te,function($e){ae||(ae=!0,c.reject(Ge,$e))});function Te($e){Re[Tt]=$e,++ge===Y&&!ae&&(ae=!0,c.resolve(Ge,Re))}}}d.race=se;function se(M){var Q=this;if(Object.prototype.toString.call(M)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=M.length,ae=!1;if(!Y)return this.resolve([]);for(var Re=-1,ge=new this(a);++Re<Y;)Ie(M[Re]);return ge;function Ie(Ge){Q.resolve(Ge).then(function(Me){ae||(ae=!0,c.resolve(ge,Me))},function(Me){ae||(ae=!0,c.reject(ge,Me))})}}},{1:1}],3:[function(n,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h};function a(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")}function c(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var m=c();function p(){try{if(!m||!m.open)return!1;var h=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),S=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!h||S)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(h,S){h=h||[],S=S||{};try{return new Blob(h,S)}catch(I){if(I.name!=="TypeError")throw I;for(var v=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,T=new v,C=0;C<h.length;C+=1)T.append(h[C]);return T.getBlob(S.type)}}typeof Promise>"u"&&n(3);var d=Promise;function g(h,S){S&&h.then(function(v){S(null,v)},function(v){S(v)})}function E(h,S,v){typeof S=="function"&&h.then(S),typeof v=="function"&&h.catch(v)}function A(h){return typeof h!="string"&&(console.warn(h+" used as a key, but it is not a string."),h=String(h)),h}function O(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var D="local-forage-detect-blob-support",R=void 0,P={},j=Object.prototype.toString,se="readonly",M="readwrite";function Q(h){for(var S=h.length,v=new ArrayBuffer(S),T=new Uint8Array(v),C=0;C<S;C++)T[C]=h.charCodeAt(C);return v}function Y(h){return new d(function(S){var v=h.transaction(D,M),T=f([""]);v.objectStore(D).put(T,"key"),v.onabort=function(C){C.preventDefault(),C.stopPropagation(),S(!1)},v.oncomplete=function(){var C=navigator.userAgent.match(/Chrome\/(\d+)/),I=navigator.userAgent.match(/Edge\//);S(I||!C||parseInt(C[1],10)>=43)}}).catch(function(){return!1})}function ae(h){return typeof R=="boolean"?d.resolve(R):Y(h).then(function(S){return R=S,R})}function Re(h){var S=P[h.name],v={};v.promise=new d(function(T,C){v.resolve=T,v.reject=C}),S.deferredOperations.push(v),S.dbReady?S.dbReady=S.dbReady.then(function(){return v.promise}):S.dbReady=v.promise}function ge(h){var S=P[h.name],v=S.deferredOperations.pop();if(v)return v.resolve(),v.promise}function Ie(h,S){var v=P[h.name],T=v.deferredOperations.pop();if(T)return T.reject(S),T.promise}function Ge(h,S){return new d(function(v,T){if(P[h.name]=P[h.name]||lr(),h.db)if(S)Re(h),h.db.close();else return v(h.db);var C=[h.name];S&&C.push(h.version);var I=m.open.apply(m,C);S&&(I.onupgradeneeded=function(L){var k=I.result;try{k.createObjectStore(h.storeName),L.oldVersion<=1&&k.createObjectStore(D)}catch(F){if(F.name==="ConstraintError")console.warn('The database "'+h.name+'" has been upgraded from version '+L.oldVersion+" to version "+L.newVersion+', but the storage "'+h.storeName+'" already exists.');else throw F}}),I.onerror=function(L){L.preventDefault(),T(I.error)},I.onsuccess=function(){var L=I.result;L.onversionchange=function(k){k.target.close()},v(L),ge(h)}})}function Me(h){return Ge(h,!1)}function lt(h){return Ge(h,!0)}function Tt(h,S){if(!h.db)return!0;var v=!h.db.objectStoreNames.contains(h.storeName),T=h.version<h.db.version,C=h.version>h.db.version;if(T&&(h.version!==S&&console.warn('The database "'+h.name+`" can't be downgraded from version `+h.db.version+" to version "+h.version+"."),h.version=h.db.version),C||v){if(v){var I=h.db.version+1;I>h.version&&(h.version=I)}return!0}return!1}function Te(h){return new d(function(S,v){var T=new FileReader;T.onerror=v,T.onloadend=function(C){var I=btoa(C.target.result||"");S({__local_forage_encoded_blob:!0,data:I,type:h.type})},T.readAsBinaryString(h)})}function $e(h){var S=Q(atob(h.data));return f([S],{type:h.type})}function me(h){return h&&h.__local_forage_encoded_blob}function ne(h){var S=this,v=S._initReady().then(function(){var T=P[S._dbInfo.name];if(T&&T.dbReady)return T.dbReady});return E(v,h,h),v}function je(h){Re(h);for(var S=P[h.name],v=S.forages,T=0;T<v.length;T++){var C=v[T];C._dbInfo.db&&(C._dbInfo.db.close(),C._dbInfo.db=null)}return h.db=null,Me(h).then(function(I){return h.db=I,Tt(h)?lt(h):I}).then(function(I){h.db=S.db=I;for(var L=0;L<v.length;L++)v[L]._dbInfo.db=I}).catch(function(I){throw Ie(h,I),I})}function dt(h,S,v,T){T===void 0&&(T=1);try{var C=h.db.transaction(h.storeName,S);v(null,C)}catch(I){if(T>0&&(!h.db||I.name==="InvalidStateError"||I.name==="NotFoundError"))return d.resolve().then(function(){if(!h.db||I.name==="NotFoundError"&&!h.db.objectStoreNames.contains(h.storeName)&&h.version<=h.db.version)return h.db&&(h.version=h.db.version+1),lt(h)}).then(function(){return je(h).then(function(){dt(h,S,v,T-1)})}).catch(v);v(I)}}function lr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hr(h){var S=this,v={db:null};if(h)for(var T in h)v[T]=h[T];var C=P[v.name];C||(C=lr(),P[v.name]=C),C.forages.push(S),S._initReady||(S._initReady=S.ready,S.ready=ne);var I=[];function L(){return d.resolve()}for(var k=0;k<C.forages.length;k++){var F=C.forages[k];F!==S&&I.push(F._initReady().catch(L))}var H=C.forages.slice(0);return d.all(I).then(function(){return v.db=C.db,Me(v)}).then(function(W){return v.db=W,Tt(v,S._defaultConfig.version)?lt(v):W}).then(function(W){v.db=C.db=W,S._dbInfo=v;for(var q=0;q<H.length;q++){var ue=H[q];ue!==S&&(ue._dbInfo.db=v.db,ue._dbInfo.version=v.version)}})}function rn(h,S){var v=this;h=A(h);var T=new d(function(C,I){v.ready().then(function(){dt(v._dbInfo,se,function(L,k){if(L)return I(L);try{var F=k.objectStore(v._dbInfo.storeName),H=F.get(h);H.onsuccess=function(){var W=H.result;W===void 0&&(W=null),me(W)&&(W=$e(W)),C(W)},H.onerror=function(){I(H.error)}}catch(W){I(W)}})}).catch(I)});return g(T,S),T}function Mn(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){dt(v._dbInfo,se,function(L,k){if(L)return I(L);try{var F=k.objectStore(v._dbInfo.storeName),H=F.openCursor(),W=1;H.onsuccess=function(){var q=H.result;if(q){var ue=q.value;me(ue)&&(ue=$e(ue));var Ce=h(ue,q.key,W++);Ce!==void 0?C(Ce):q.continue()}else C()},H.onerror=function(){I(H.error)}}catch(q){I(q)}})}).catch(I)});return g(T,S),T}function $r(h,S,v){var T=this;h=A(h);var C=new d(function(I,L){var k;T.ready().then(function(){return k=T._dbInfo,j.call(S)==="[object Blob]"?ae(k.db).then(function(F){return F?S:Te(S)}):S}).then(function(F){dt(T._dbInfo,M,function(H,W){if(H)return L(H);try{var q=W.objectStore(T._dbInfo.storeName);F===null&&(F=void 0);var ue=q.put(F,h);W.oncomplete=function(){F===void 0&&(F=null),I(F)},W.onabort=W.onerror=function(){var Ce=ue.error?ue.error:ue.transaction.error;L(Ce)}}catch(Ce){L(Ce)}})}).catch(L)});return g(C,v),C}function Fn(h,S){var v=this;h=A(h);var T=new d(function(C,I){v.ready().then(function(){dt(v._dbInfo,M,function(L,k){if(L)return I(L);try{var F=k.objectStore(v._dbInfo.storeName),H=F.delete(h);k.oncomplete=function(){C()},k.onerror=function(){I(H.error)},k.onabort=function(){var W=H.error?H.error:H.transaction.error;I(W)}}catch(W){I(W)}})}).catch(I)});return g(T,S),T}function Hn(h){var S=this,v=new d(function(T,C){S.ready().then(function(){dt(S._dbInfo,M,function(I,L){if(I)return C(I);try{var k=L.objectStore(S._dbInfo.storeName),F=k.clear();L.oncomplete=function(){T()},L.onabort=L.onerror=function(){var H=F.error?F.error:F.transaction.error;C(H)}}catch(H){C(H)}})}).catch(C)});return g(v,h),v}function $n(h){var S=this,v=new d(function(T,C){S.ready().then(function(){dt(S._dbInfo,se,function(I,L){if(I)return C(I);try{var k=L.objectStore(S._dbInfo.storeName),F=k.count();F.onsuccess=function(){T(F.result)},F.onerror=function(){C(F.error)}}catch(H){C(H)}})}).catch(C)});return g(v,h),v}function tr(h,S){var v=this,T=new d(function(C,I){if(h<0){C(null);return}v.ready().then(function(){dt(v._dbInfo,se,function(L,k){if(L)return I(L);try{var F=k.objectStore(v._dbInfo.storeName),H=!1,W=F.openKeyCursor();W.onsuccess=function(){var q=W.result;if(!q){C(null);return}h===0||H?C(q.key):(H=!0,q.advance(h))},W.onerror=function(){I(W.error)}}catch(q){I(q)}})}).catch(I)});return g(T,S),T}function ht(h){var S=this,v=new d(function(T,C){S.ready().then(function(){dt(S._dbInfo,se,function(I,L){if(I)return C(I);try{var k=L.objectStore(S._dbInfo.storeName),F=k.openKeyCursor(),H=[];F.onsuccess=function(){var W=F.result;if(!W){T(H);return}H.push(W.key),W.continue()},F.onerror=function(){C(F.error)}}catch(W){C(W)}})}).catch(C)});return g(v,h),v}function Ht(h,S){S=O.apply(this,arguments);var v=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||v.name,h.storeName=h.storeName||v.storeName);var T=this,C;if(!h.name)C=d.reject("Invalid arguments");else{var I=h.name===v.name&&T._dbInfo.db,L=I?d.resolve(T._dbInfo.db):Me(h).then(function(k){var F=P[h.name],H=F.forages;F.db=k;for(var W=0;W<H.length;W++)H[W]._dbInfo.db=k;return k});h.storeName?C=L.then(function(k){if(k.objectStoreNames.contains(h.storeName)){var F=k.version+1;Re(h);var H=P[h.name],W=H.forages;k.close();for(var q=0;q<W.length;q++){var ue=W[q];ue._dbInfo.db=null,ue._dbInfo.version=F}var Ce=new d(function(xe,qe){var Ve=m.open(h.name,F);Ve.onerror=function($t){var Yi=Ve.result;Yi.close(),qe($t)},Ve.onupgradeneeded=function(){var $t=Ve.result;$t.deleteObjectStore(h.storeName)},Ve.onsuccess=function(){var $t=Ve.result;$t.close(),xe($t)}});return Ce.then(function(xe){H.db=xe;for(var qe=0;qe<W.length;qe++){var Ve=W[qe];Ve._dbInfo.db=xe,ge(Ve._dbInfo)}}).catch(function(xe){throw(Ie(h,xe)||d.resolve()).catch(function(){}),xe})}}):C=L.then(function(k){Re(h);var F=P[h.name],H=F.forages;k.close();for(var W=0;W<H.length;W++){var q=H[W];q._dbInfo.db=null}var ue=new d(function(Ce,xe){var qe=m.deleteDatabase(h.name);qe.onerror=function(){var Ve=qe.result;Ve&&Ve.close(),xe(qe.error)},qe.onblocked=function(){console.warn('dropInstance blocked for database "'+h.name+'" until all open connections are closed')},qe.onsuccess=function(){var Ve=qe.result;Ve&&Ve.close(),Ce(Ve)}});return ue.then(function(Ce){F.db=Ce;for(var xe=0;xe<H.length;xe++){var qe=H[xe];ge(qe._dbInfo)}}).catch(function(Ce){throw(Ie(h,Ce)||d.resolve()).catch(function(){}),Ce})})}return g(C,S),C}var Wi={_driver:"asyncStorage",_initStorage:Hr,_support:p(),iterate:Mn,getItem:rn,setItem:$r,removeItem:Fn,clear:Hn,length:$n,key:tr,keys:ht,dropInstance:Ht};function y(){return typeof openDatabase=="function"}var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="~~local_forage_type~",_=/^~~local_forage_type~([^~]+)~/,x="__lfsc__:",U=x.length,B="arbf",ie="blob",he="si08",V="ui08",X="uic8",G="si16",ye="si32",gt="ur16",ut="ui32",ve="fl32",Z="fl64",Nt=U+B.length,jn=Object.prototype.toString;function Gi(h){var S=h.length*.75,v=h.length,T,C=0,I,L,k,F;h[h.length-1]==="="&&(S--,h[h.length-2]==="="&&S--);var H=new ArrayBuffer(S),W=new Uint8Array(H);for(T=0;T<v;T+=4)I=l.indexOf(h[T]),L=l.indexOf(h[T+1]),k=l.indexOf(h[T+2]),F=l.indexOf(h[T+3]),W[C++]=I<<2|L>>4,W[C++]=(L&15)<<4|k>>2,W[C++]=(k&3)<<6|F&63;return H}function Sc(h){var S=new Uint8Array(h),v="",T;for(T=0;T<S.length;T+=3)v+=l[S[T]>>2],v+=l[(S[T]&3)<<4|S[T+1]>>4],v+=l[(S[T+1]&15)<<2|S[T+2]>>6],v+=l[S[T+2]&63];return S.length%3===2?v=v.substring(0,v.length-1)+"=":S.length%3===1&&(v=v.substring(0,v.length-2)+"=="),v}function vh(h,S){var v="";if(h&&(v=jn.call(h)),h&&(v==="[object ArrayBuffer]"||h.buffer&&jn.call(h.buffer)==="[object ArrayBuffer]")){var T,C=x;h instanceof ArrayBuffer?(T=h,C+=B):(T=h.buffer,v==="[object Int8Array]"?C+=he:v==="[object Uint8Array]"?C+=V:v==="[object Uint8ClampedArray]"?C+=X:v==="[object Int16Array]"?C+=G:v==="[object Uint16Array]"?C+=gt:v==="[object Int32Array]"?C+=ye:v==="[object Uint32Array]"?C+=ut:v==="[object Float32Array]"?C+=ve:v==="[object Float64Array]"?C+=Z:S(new Error("Failed to get type for BinaryArray"))),S(C+Sc(T))}else if(v==="[object Blob]"){var I=new FileReader;I.onload=function(){var L=u+h.type+"~"+Sc(this.result);S(x+ie+L)},I.readAsArrayBuffer(h)}else try{S(JSON.stringify(h))}catch(L){console.error("Couldn't convert value into a JSON string: ",h),S(null,L)}}function _h(h){if(h.substring(0,U)!==x)return JSON.parse(h);var S=h.substring(Nt),v=h.substring(U,Nt),T;if(v===ie&&_.test(S)){var C=S.match(_);T=C[1],S=S.substring(C[0].length)}var I=Gi(S);switch(v){case B:return I;case ie:return f([I],{type:T});case he:return new Int8Array(I);case V:return new Uint8Array(I);case X:return new Uint8ClampedArray(I);case G:return new Int16Array(I);case gt:return new Uint16Array(I);case ye:return new Int32Array(I);case ut:return new Uint32Array(I);case ve:return new Float32Array(I);case Z:return new Float64Array(I);default:throw new Error("Unkown type: "+v)}}var wc={serialize:vh,deserialize:_h,stringToBuffer:Gi,bufferToString:Sc};function Zu(h,S,v,T){h.executeSql("CREATE TABLE IF NOT EXISTS "+S.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],v,T)}function Eh(h){var S=this,v={db:null};if(h)for(var T in h)v[T]=typeof h[T]!="string"?h[T].toString():h[T];var C=new d(function(I,L){try{v.db=openDatabase(v.name,String(v.version),v.description,v.size)}catch(k){return L(k)}v.db.transaction(function(k){Zu(k,v,function(){S._dbInfo=v,I()},function(F,H){L(H)})},L)});return v.serializer=wc,C}function jr(h,S,v,T,C,I){h.executeSql(v,T,C,function(L,k){k.code===k.SYNTAX_ERR?L.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[S.storeName],function(F,H){H.rows.length?I(F,k):Zu(F,S,function(){F.executeSql(v,T,C,I)},I)},I):I(L,k)},I)}function Sh(h,S){var v=this;h=A(h);var T=new d(function(C,I){v.ready().then(function(){var L=v._dbInfo;L.db.transaction(function(k){jr(k,L,"SELECT * FROM "+L.storeName+" WHERE key = ? LIMIT 1",[h],function(F,H){var W=H.rows.length?H.rows.item(0).value:null;W&&(W=L.serializer.deserialize(W)),C(W)},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function wh(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){var L=v._dbInfo;L.db.transaction(function(k){jr(k,L,"SELECT * FROM "+L.storeName,[],function(F,H){for(var W=H.rows,q=W.length,ue=0;ue<q;ue++){var Ce=W.item(ue),xe=Ce.value;if(xe&&(xe=L.serializer.deserialize(xe)),xe=h(xe,Ce.key,ue+1),xe!==void 0){C(xe);return}}C()},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function ep(h,S,v,T){var C=this;h=A(h);var I=new d(function(L,k){C.ready().then(function(){S===void 0&&(S=null);var F=S,H=C._dbInfo;H.serializer.serialize(S,function(W,q){q?k(q):H.db.transaction(function(ue){jr(ue,H,"INSERT OR REPLACE INTO "+H.storeName+" (key, value) VALUES (?, ?)",[h,W],function(){L(F)},function(Ce,xe){k(xe)})},function(ue){if(ue.code===ue.QUOTA_ERR){if(T>0){L(ep.apply(C,[h,F,v,T-1]));return}k(ue)}})})}).catch(k)});return g(I,v),I}function bh(h,S,v){return ep.apply(this,[h,S,v,1])}function Ih(h,S){var v=this;h=A(h);var T=new d(function(C,I){v.ready().then(function(){var L=v._dbInfo;L.db.transaction(function(k){jr(k,L,"DELETE FROM "+L.storeName+" WHERE key = ?",[h],function(){C()},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Th(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(L){jr(L,I,"DELETE FROM "+I.storeName,[],function(){T()},function(k,F){C(F)})})}).catch(C)});return g(v,h),v}function Ch(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(L){jr(L,I,"SELECT COUNT(key) as c FROM "+I.storeName,[],function(k,F){var H=F.rows.item(0).c;T(H)},function(k,F){C(F)})})}).catch(C)});return g(v,h),v}function xh(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){var L=v._dbInfo;L.db.transaction(function(k){jr(k,L,"SELECT key FROM "+L.storeName+" WHERE id = ? LIMIT 1",[h+1],function(F,H){var W=H.rows.length?H.rows.item(0).key:null;C(W)},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Dh(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(L){jr(L,I,"SELECT key FROM "+I.storeName,[],function(k,F){for(var H=[],W=0;W<F.rows.length;W++)H.push(F.rows.item(W).key);T(H)},function(k,F){C(F)})})}).catch(C)});return g(v,h),v}function Rh(h){return new d(function(S,v){h.transaction(function(T){T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(C,I){for(var L=[],k=0;k<I.rows.length;k++)L.push(I.rows.item(k).name);S({db:h,storeNames:L})},function(C,I){v(I)})},function(T){v(T)})})}function Ah(h,S){S=O.apply(this,arguments);var v=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||v.name,h.storeName=h.storeName||v.storeName);var T=this,C;return h.name?C=new d(function(I){var L;h.name===v.name?L=T._dbInfo.db:L=openDatabase(h.name,"","",0),h.storeName?I({db:L,storeNames:[h.storeName]}):I(Rh(L))}).then(function(I){return new d(function(L,k){I.db.transaction(function(F){function H(Ce){return new d(function(xe,qe){F.executeSql("DROP TABLE IF EXISTS "+Ce,[],function(){xe()},function(Ve,$t){qe($t)})})}for(var W=[],q=0,ue=I.storeNames.length;q<ue;q++)W.push(H(I.storeNames[q]));d.all(W).then(function(){L()}).catch(function(Ce){k(Ce)})},function(F){k(F)})})}):C=d.reject("Invalid arguments"),g(C,S),C}var Nh={_driver:"webSQLStorage",_initStorage:Eh,_support:y(),iterate:wh,getItem:Sh,setItem:bh,removeItem:Ih,clear:Th,length:Ch,key:xh,keys:Dh,dropInstance:Ah};function Oh(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function tp(h,S){var v=h.name+"/";return h.storeName!==S.storeName&&(v+=h.storeName+"/"),v}function Ph(){var h="_localforage_support_test";try{return localStorage.setItem(h,!0),localStorage.removeItem(h),!1}catch{return!0}}function Lh(){return!Ph()||localStorage.length>0}function Bh(h){var S=this,v={};if(h)for(var T in h)v[T]=h[T];return v.keyPrefix=tp(h,S._defaultConfig),Lh()?(S._dbInfo=v,v.serializer=wc,d.resolve()):d.reject()}function Uh(h){var S=this,v=S.ready().then(function(){for(var T=S._dbInfo.keyPrefix,C=localStorage.length-1;C>=0;C--){var I=localStorage.key(C);I.indexOf(T)===0&&localStorage.removeItem(I)}});return g(v,h),v}function kh(h,S){var v=this;h=A(h);var T=v.ready().then(function(){var C=v._dbInfo,I=localStorage.getItem(C.keyPrefix+h);return I&&(I=C.serializer.deserialize(I)),I});return g(T,S),T}function Mh(h,S){var v=this,T=v.ready().then(function(){for(var C=v._dbInfo,I=C.keyPrefix,L=I.length,k=localStorage.length,F=1,H=0;H<k;H++){var W=localStorage.key(H);if(W.indexOf(I)===0){var q=localStorage.getItem(W);if(q&&(q=C.serializer.deserialize(q)),q=h(q,W.substring(L),F++),q!==void 0)return q}}});return g(T,S),T}function Fh(h,S){var v=this,T=v.ready().then(function(){var C=v._dbInfo,I;try{I=localStorage.key(h)}catch{I=null}return I&&(I=I.substring(C.keyPrefix.length)),I});return g(T,S),T}function Hh(h){var S=this,v=S.ready().then(function(){for(var T=S._dbInfo,C=localStorage.length,I=[],L=0;L<C;L++){var k=localStorage.key(L);k.indexOf(T.keyPrefix)===0&&I.push(k.substring(T.keyPrefix.length))}return I});return g(v,h),v}function $h(h){var S=this,v=S.keys().then(function(T){return T.length});return g(v,h),v}function jh(h,S){var v=this;h=A(h);var T=v.ready().then(function(){var C=v._dbInfo;localStorage.removeItem(C.keyPrefix+h)});return g(T,S),T}function Wh(h,S,v){var T=this;h=A(h);var C=T.ready().then(function(){S===void 0&&(S=null);var I=S;return new d(function(L,k){var F=T._dbInfo;F.serializer.serialize(S,function(H,W){if(W)k(W);else try{localStorage.setItem(F.keyPrefix+h,H),L(I)}catch(q){(q.name==="QuotaExceededError"||q.name==="NS_ERROR_DOM_QUOTA_REACHED")&&k(q),k(q)}})})});return g(C,v),C}function Gh(h,S){if(S=O.apply(this,arguments),h=typeof h!="function"&&h||{},!h.name){var v=this.config();h.name=h.name||v.name,h.storeName=h.storeName||v.storeName}var T=this,C;return h.name?C=new d(function(I){h.storeName?I(tp(h,T._defaultConfig)):I(h.name+"/")}).then(function(I){for(var L=localStorage.length-1;L>=0;L--){var k=localStorage.key(L);k.indexOf(I)===0&&localStorage.removeItem(k)}}):C=d.reject("Invalid arguments"),g(C,S),C}var Vh={_driver:"localStorageWrapper",_initStorage:Bh,_support:Oh(),iterate:Mh,getItem:kh,setItem:Wh,removeItem:jh,clear:Uh,length:$h,key:Fh,keys:Hh,dropInstance:Gh},Yh=function(S,v){return S===v||typeof S=="number"&&typeof v=="number"&&isNaN(S)&&isNaN(v)},zh=function(S,v){for(var T=S.length,C=0;C<T;){if(Yh(S[C],v))return!0;C++}return!1},rp=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"},Vi={},np={},Wn={INDEXEDDB:Wi,WEBSQL:Nh,LOCALSTORAGE:Vh},qh=[Wn.INDEXEDDB._driver,Wn.WEBSQL._driver,Wn.LOCALSTORAGE._driver],Vo=["dropInstance"],bc=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Vo),Kh={description:"",driver:qh.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Jh(h,S){h[S]=function(){var v=arguments;return h.ready().then(function(){return h[S].apply(h,v)})}}function Ic(){for(var h=1;h<arguments.length;h++){var S=arguments[h];if(S)for(var v in S)S.hasOwnProperty(v)&&(rp(S[v])?arguments[0][v]=S[v].slice():arguments[0][v]=S[v])}return arguments[0]}var Xh=function(){function h(S){a(this,h);for(var v in Wn)if(Wn.hasOwnProperty(v)){var T=Wn[v],C=T._driver;this[v]=C,Vi[C]||this.defineDriver(T)}this._defaultConfig=Ic({},Kh),this._config=Ic({},this._defaultConfig,S),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return h.prototype.config=function(v){if((typeof v>"u"?"undefined":s(v))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var T in v){if(T==="storeName"&&(v[T]=v[T].replace(/\W/g,"_")),T==="version"&&typeof v[T]!="number")return new Error("Database version must be a number.");this._config[T]=v[T]}return"driver"in v&&v.driver?this.setDriver(this._config.driver):!0}else return typeof v=="string"?this._config[v]:this._config},h.prototype.defineDriver=function(v,T,C){var I=new d(function(L,k){try{var F=v._driver,H=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!v._driver){k(H);return}for(var W=bc.concat("_initStorage"),q=0,ue=W.length;q<ue;q++){var Ce=W[q],xe=!zh(Vo,Ce);if((xe||v[Ce])&&typeof v[Ce]!="function"){k(H);return}}var qe=function(){for(var Yi=function(eg){return function(){var tg=new Error("Method "+eg+" is not implemented by the current driver"),ip=d.reject(tg);return g(ip,arguments[arguments.length-1]),ip}},Tc=0,Zh=Vo.length;Tc<Zh;Tc++){var Cc=Vo[Tc];v[Cc]||(v[Cc]=Yi(Cc))}};qe();var Ve=function(Yi){Vi[F]&&console.info("Redefining LocalForage driver: "+F),Vi[F]=v,np[F]=Yi,L()};"_support"in v?v._support&&typeof v._support=="function"?v._support().then(Ve,k):Ve(!!v._support):Ve(!0)}catch($t){k($t)}});return E(I,T,C),I},h.prototype.driver=function(){return this._driver||null},h.prototype.getDriver=function(v,T,C){var I=Vi[v]?d.resolve(Vi[v]):d.reject(new Error("Driver not found."));return E(I,T,C),I},h.prototype.getSerializer=function(v){var T=d.resolve(wc);return E(T,v),T},h.prototype.ready=function(v){var T=this,C=T._driverSet.then(function(){return T._ready===null&&(T._ready=T._initDriver()),T._ready});return E(C,v,v),C},h.prototype.setDriver=function(v,T,C){var I=this;rp(v)||(v=[v]);var L=this._getSupportedDrivers(v);function k(){I._config.driver=I.driver()}function F(q){return I._extend(q),k(),I._ready=I._initStorage(I._config),I._ready}function H(q){return function(){var ue=0;function Ce(){for(;ue<q.length;){var xe=q[ue];return ue++,I._dbInfo=null,I._ready=null,I.getDriver(xe).then(F).catch(Ce)}k();var qe=new Error("No available storage method found.");return I._driverSet=d.reject(qe),I._driverSet}return Ce()}}var W=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=W.then(function(){var q=L[0];return I._dbInfo=null,I._ready=null,I.getDriver(q).then(function(ue){I._driver=ue._driver,k(),I._wrapLibraryMethodsWithReady(),I._initDriver=H(L)})}).catch(function(){k();var q=new Error("No available storage method found.");return I._driverSet=d.reject(q),I._driverSet}),E(this._driverSet,T,C),this._driverSet},h.prototype.supports=function(v){return!!np[v]},h.prototype._extend=function(v){Ic(this,v)},h.prototype._getSupportedDrivers=function(v){for(var T=[],C=0,I=v.length;C<I;C++){var L=v[C];this.supports(L)&&T.push(L)}return T},h.prototype._wrapLibraryMethodsWithReady=function(){for(var v=0,T=bc.length;v<T;v++)Jh(this,bc[v])},h.prototype.createInstance=function(v){return new h(v)},h}(),Qh=new Xh;i.exports=Qh},{3:3}]},{},[4])(4)})});var ei=ur(Zn=>{"use strict";var $g=Zn&&Zn.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(p){try{m(n.next(p))}catch(f){s(f)}}function c(p){try{m(n.throw(p))}catch(f){s(f)}}function m(p){p.done?o(p.value):i(p.value).then(a,c)}m((n=n.apply(t,e||[])).next())})};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.JSUtils=void 0;var ss=class{static isObject(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}static parseToAny(e){try{return JSON.parse(e.toString())}catch{}return e.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(e.toString()):e}static sleep(e){return $g(this,void 0,void 0,function*(){return new Promise(r=>setTimeout(r,e))})}static hasKeys(e){return e?Object.keys(e).length>=1:!1}static convertObjectToArray(e,r){return r.reduce((n,i)=>(e.hasOwnProperty(i)&&e[i]!=null&&n.push({[i]:e[i]}),n),[])}static removeNullUndefinedKeys(e){return Object.keys(e).reduce((r,n)=>(e[n]!==null&&e[n]!==void 0&&(r[n]=e[n]),r),{})}static stringify(e){return JSON.stringify(e,function(r,n){return n===void 0?null:n})}};Zn.JSUtils=ss;ss.ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/)});var ku=ur(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.URLBuilder=void 0;var vE=function(){function t(e){try{this.base=new URL(e),this.params=new URLSearchParams(this.base.search.slice(1))}catch(r){console.error("Un-parsable URL",r)}}return t.prototype.appendQueryParam=function(e,r){this.params.append(e,r?r.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(e){this.params.delete(e)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(e){if(!this.params)return"";var r=this.params.get(e);return!r||r==="undefined"||r==="null"?void 0:r},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(e){return this.base.pathname=e,this},t.prototype.setQueryParam=function(e,r){return this.params.set(e,r?r.toString():""),this},t.prototype.setQueryString=function(e){if(e)return e[0]==="?"&&(e=e.slice(1)),this.params=new URLSearchParams(e),this},t.prototype.toString=function(){var e=this.params.toString();return e===""?this.base.search="":this.base.search="?"+e,this.base.toString()},t}();ya.URLBuilder=vE});var th=ur((Ju,Xu)=>{"use strict";(function(t,e){typeof Ju=="object"&&typeof Xu<"u"?Xu.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.fetchRetry=e())})(Ju,function(){"use strict";var t=function(n,i){if(i=i||{},typeof n!="function")throw new r("fetch must be a function");if(typeof i!="object")throw new r("defaults must be an object");if(i.retries!==void 0&&!e(i.retries))throw new r("retries must be a positive integer");if(i.retryDelay!==void 0&&!e(i.retryDelay)&&typeof i.retryDelay!="function")throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(i.retryOn!==void 0&&!Array.isArray(i.retryOn)&&typeof i.retryOn!="function")throw new r("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(a,c){var m=i.retries,p=i.retryDelay,f=i.retryOn;if(c&&c.retries!==void 0)if(e(c.retries))m=c.retries;else throw new r("retries must be a positive integer");if(c&&c.retryDelay!==void 0)if(e(c.retryDelay)||typeof c.retryDelay=="function")p=c.retryDelay;else throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(c&&c.retryOn)if(Array.isArray(c.retryOn)||typeof c.retryOn=="function")f=c.retryOn;else throw new r("retryOn property expects an array or function");return new Promise(function(d,g){var E=function(O){var D=typeof Request<"u"&&a instanceof Request?a.clone():a;n(D,c).then(function(R){if(Array.isArray(f)&&f.indexOf(R.status)===-1)d(R);else if(typeof f=="function")try{return Promise.resolve(f(O,null,R)).then(function(P){P?A(O,null,R):d(R)}).catch(g)}catch(P){g(P)}else O<m?A(O,null,R):d(R)}).catch(function(R){if(typeof f=="function")try{Promise.resolve(f(O,R,null)).then(function(P){P?A(O,R,null):g(R)}).catch(function(P){g(P)})}catch(P){g(P)}else O<m?A(O,R,null):g(R)})};function A(O,D,R){var P=typeof p=="function"?p(O,D,R):p;setTimeout(function(){E(++O)},P)}E(0)})}};function e(n){return Number.isInteger(n)&&n>=0}function r(n){this.name="ArgumentError",this.message=n}return t})});var cp="9.4.0";var N=class t{static SDK_VERSION=cp;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static CTA_EVENT="letscooee:outbound:cta";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static CTA_AFTER_REFRESH_UI="letscooee:outbound:refresh-ui";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static PAYMENT_MODAL_DETAILS=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}];static{let e=t.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");t.SDK_VERSION_CODE=parseInt(e,10)}};var Ct={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.js`};var Ot=Se(nn());var b=class{static log(...e){Ot.default.info(...e)}static debug(...e){Ot.default.debug(...e)}static error(...e){Ot.default.error(...e)}static warn(...e){Ot.default.warn(...e)}static info(...e){Ot.default.info(...e)}static trace(...e){Ot.default.trace(...e)}static configure(e=N.LOG_PREFIX){Ot.default.useDefaults({formatter:function(n){n.unshift(`${e} (v${N.SDK_VERSION}):`)}});let r=this.getDebugParam();(r==="1"||r==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Ot.default.setLevel(Ot.default[localStorage.cooeeLogLevel]):Ot.default.setLevel(Ct.debug?Ot.default.TRACE:Ot.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let e=`
1
+ var rg=Object.create;var xc=Object.defineProperty,ng=Object.defineProperties,ig=Object.getOwnPropertyDescriptor,og=Object.getOwnPropertyDescriptors,sg=Object.getOwnPropertyNames,op=Object.getOwnPropertySymbols,ag=Object.getPrototypeOf,ap=Object.prototype.hasOwnProperty,cg=Object.prototype.propertyIsEnumerable;var sp=(t,e,r)=>e in t?xc(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,w=(t,e)=>{for(var r in e||={})ap.call(e,r)&&sp(t,r,e[r]);if(op)for(var r of op(e))cg.call(e,r)&&sp(t,r,e[r]);return t},ee=(t,e)=>ng(t,og(e));var zi=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var ur=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var lg=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of sg(e))!ap.call(t,i)&&i!==r&&xc(t,i,{get:()=>e[i],enumerable:!(n=ig(e,i))||n.enumerable});return t};var Se=(t,e,r)=>(r=t!=null?rg(ag(t)):{},lg(e||!t||!t.__esModule?xc(r,"default",{value:t,enumerable:!0}):r,t));var nn=ur((lp,Yo)=>{"use strict";(function(t){"use strict";var e={};e.VERSION="1.6.1";var r,n={},i=function(m,p){return function(){return p.apply(m,arguments)}},o=function(){var m=arguments,p=m[0],f,d;for(d=1;d<m.length;d++)for(f in m[d])!(f in p)&&m[d].hasOwnProperty(f)&&(p[f]=m[d][f]);return p},s=function(m,p){return{value:m,name:p}};e.TRACE=s(1,"TRACE"),e.DEBUG=s(2,"DEBUG"),e.INFO=s(3,"INFO"),e.TIME=s(4,"TIME"),e.WARN=s(5,"WARN"),e.ERROR=s(8,"ERROR"),e.OFF=s(99,"OFF");var a=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info};a.prototype={setLevel:function(m){m&&"value"in m&&(this.context.filterLevel=m)},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var p=this.context.filterLevel;return m.value>=p.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(m){typeof m=="string"&&m.length>0&&this.invoke(e.TIME,[m,"start"])},timeEnd:function(m){typeof m=="string"&&m.length>0&&this.invoke(e.TIME,[m,"end"])},invoke:function(m,p){r&&this.enabledFor(m)&&r(p,o({level:m},this.context))}};var c=new a({filterLevel:e.OFF});(function(){var m=e;m.enabledFor=i(c,c.enabledFor),m.trace=i(c,c.trace),m.debug=i(c,c.debug),m.time=i(c,c.time),m.timeEnd=i(c,c.timeEnd),m.info=i(c,c.info),m.warn=i(c,c.warn),m.error=i(c,c.error),m.log=m.info})(),e.setHandler=function(m){r=m},e.setLevel=function(m){c.setLevel(m);for(var p in n)n.hasOwnProperty(p)&&n[p].setLevel(m)},e.getLevel=function(){return c.getLevel()},e.get=function(m){return n[m]||(n[m]=new a(o({name:m},c.context)))},e.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(g,E){E.name&&g.unshift("["+E.name+"]")};var p={},f=function(d,g){Function.prototype.apply.call(d,console,g)};return typeof console>"u"?function(){}:function(d,g){d=Array.prototype.slice.call(d);var E=console.log,A;g.level===e.TIME?(A=(g.name?"["+g.name+"] ":"")+d[0],d[1]==="start"?console.time?console.time(A):p[A]=new Date().getTime():console.timeEnd?console.timeEnd(A):f(E,[A+": "+(new Date().getTime()-p[A])+"ms"])):(g.level===e.WARN&&console.warn?E=console.warn:g.level===e.ERROR&&console.error?E=console.error:g.level===e.INFO&&console.info?E=console.info:g.level===e.DEBUG&&console.debug?E=console.debug:g.level===e.TRACE&&console.trace&&(E=console.trace),m.formatter(d,g),f(E,d))}},e.useDefaults=function(m){e.setLevel(m&&m.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(m))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof Yo<"u"&&Yo.exports?Yo.exports=e:(e._prevLogger=t.Logger,e.noConflict=function(){return t.Logger=e._prevLogger,e},t.Logger=e)})(lp)});var Dc=ur(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.MustacheUtils=void 0;var zo=class t{static escapeHtml(e){return String(e).replace(/"/g,r=>t.entityMap[r])}};qo.MustacheUtils=zo;zo.entityMap={'"':"&quot;"}});var Rr=ur(z=>{"use strict";Object.defineProperty(z,"__esModule",{value:!0});z.MilestoneRewardType=z.ProgressBarLayout=z.EngagementContentSource=z.EngagementObjective=z.OnsiteDeliveryType=z.ClickActionType=z.FrequencyGapUnit=z.FrequencyType=z.RedirectBehaviour=z.EngagementPlacementPosition=z.EngagementCollectionSource=z.PromotionType=z.CartFilterEnum=z.CartCurrencyOperator=z.CartCriteria=z.URLCriteria=z.UTMCriteria=z.CartItemSource=z.EngagementItemSource=z.PurchasedVisitor=z.LoggedInVisitor=z.VisitorType=z.SessionType=z.EngagementContentType=z.TriggerType=z.EngagementType=z.EngagementStatus=z.TimePreference=z.ScheduleFrequency=z.CriteriaFrequency=void 0;var up=function(t){return t[t.ONCE_PER_USER=1]="ONCE_PER_USER",t[t.ONCE_PER_SESSION=2]="ONCE_PER_SESSION",t[t.EVERY_TIME=3]="EVERY_TIME",t}(up||(z.CriteriaFrequency=up={})),pp=function(t){return t[t.ONE_TIME=1]="ONE_TIME",t[t.MULTIPLE=2]="MULTIPLE",t[t.RECURRING=3]="RECURRING",t}(pp||(z.ScheduleFrequency=pp={})),fp=function(t){return t[t.NOW=1]="NOW",t[t.LATER=2]="LATER",t[t.NEVER=3]="NEVER",t}(fp||(z.TimePreference=fp={})),mp=function(t){return t[t.PUBLISHED=1]="PUBLISHED",t[t.DRAFT=2]="DRAFT",t[t.PAUSED=3]="PAUSED",t[t.FAILED=4]="FAILED",t[t.STOPPED=5]="STOPPED",t[t.COMPLETED=6]="COMPLETED",t[t.ARCHIVED=7]="ARCHIVED",t[t.UNINSTALLED=8]="UNINSTALLED",t}(mp||(z.EngagementStatus=mp={})),dp=function(t){return t[t.POPUP=1]="POPUP",t[t.LEAD_GENERATION=2]="LEAD_GENERATION",t[t.PRODUCT_WIDGET=3]="PRODUCT_WIDGET",t[t.PRODUCT_BUNDLE=4]="PRODUCT_BUNDLE",t[t.ANNOUNCEMENT_BAR=5]="ANNOUNCEMENT_BAR",t[t.CART_REMINDER=6]="CART_REMINDER",t[t.CRO_COPILOT=10]="CRO_COPILOT",t[t.OTHER=11]="OTHER",t}(dp||(z.EngagementType=dp={})),hp=function(t){return t[t.NONE=0]="NONE",t[t.RULE_BASED=1]="RULE_BASED",t[t.INTENT_BASED=2]="INTENT_BASED",t}(hp||(z.TriggerType=hp={})),gp=function(t){return t[t.SINGLE=1]="SINGLE",t[t.EXCLUSION=2]="EXCLUSION",t[t.ABTESTING=3]="ABTESTING",t}(gp||(z.EngagementContentType=gp={})),yp=function(t){return t[t.ALL=0]="ALL",t[t.NEW_ONLY=1]="NEW_ONLY",t[t.RETURNING_ONLY=2]="RETURNING_ONLY",t}(yp||(z.SessionType=yp={})),vp=function(t){return t[t.ALL=0]="ALL",t[t.LOGGED_IN_ONLY=3]="LOGGED_IN_ONLY",t[t.NON_LOGGED_IN_ONLY=4]="NON_LOGGED_IN_ONLY",t[t.PURCHASED=5]="PURCHASED",t[t.NON_PURCHASED=6]="NON_PURCHASED",t[t.ABANDON_CART=7]="ABANDON_CART",t[t.RETURNING_AND_NON_PURCHASED=8]="RETURNING_AND_NON_PURCHASED",t}(vp||(z.VisitorType=vp={})),_p=function(t){return t.ALL="ALL",t.LOGGED_IN="LOGGED_IN",t.NON_LOGGED_IN="NON_LOGGED_IN",t}(_p||(z.LoggedInVisitor=_p={})),Ep=function(t){return t.ALL="ALL",t.PURCHASED="PURCHASED",t.NON_PURCHASED="NON_PURCHASED",t}(Ep||(z.PurchasedVisitor=Ep={})),Sp=function(t){return t[t.NONE=0]="NONE",t[t.ITEM_RECOMMENDATION=1]="ITEM_RECOMMENDATION",t[t.MULTIPLE_ITEMS=2]="MULTIPLE_ITEMS",t[t.SINGLE_ITEM=3]="SINGLE_ITEM",t[t.TOP_SELLING=4]="TOP_SELLING",t[t.STOCK_CLEARANCE=5]="STOCK_CLEARANCE",t[t.NEW_ARRIVALS=6]="NEW_ARRIVALS",t[t.RECENTLY_VIEWED=7]="RECENTLY_VIEWED",t[t.EVENT_ITEM=8]="EVENT_ITEM",t[t.CART_ITEM=9]="CART_ITEM",t[t.BUNDLE=10]="BUNDLE",t[t.CURRENT_ITEM=11]="CURRENT_ITEM",t[t.PURCHASED_PREVIOUSLY=12]="PURCHASED_PREVIOUSLY",t[t.COLLECTION_ITEMS=13]="COLLECTION_ITEMS",t[t.TRENDING_ITEMS=14]="TRENDING_ITEMS",t}(Sp||(z.EngagementItemSource=Sp={})),wp=function(t){return t[t.LAST_ADDED=1]="LAST_ADDED",t[t.FIRST_ADDED=2]="FIRST_ADDED",t[t.HIGHEST_PRICE=3]="HIGHEST_PRICE",t[t.LOWEST_PRICE=4]="LOWEST_PRICE",t[t.FIRST_MATCHING_TAG=5]="FIRST_MATCHING_TAG",t[t.ALL=6]="ALL",t}(wp||(z.CartItemSource=wp={})),bp=function(t){return t[t.ALL=0]="ALL",t[t.ONLY_ORGANIC=1]="ONLY_ORGANIC",t[t.ONLY_NON_ORGANIC=2]="ONLY_NON_ORGANIC",t[t.INCLUDES=3]="INCLUDES",t[t.EXCLUDES=4]="EXCLUDES",t}(bp||(z.UTMCriteria=bp={})),Ip=function(t){return t[t.NONE=0]="NONE",t[t.LIKE=1]="LIKE",t[t.NOT_LIKE=2]="NOT_LIKE",t[t.EQUALS=3]="EQUALS",t[t.NOT_EQUALS=4]="NOT_EQUALS",t}(Ip||(z.URLCriteria=Ip={})),Tp=function(t){return t[t.NONE=0]="NONE",t[t.LESS_THAN=1]="LESS_THAN",t[t.GREATER_THAN=2]="GREATER_THAN",t[t.BETWEEN=3]="BETWEEN",t[t.EQUALS=4]="EQUALS",t}(Tp||(z.CartCriteria=Tp={})),Cp=function(t){return t[t.ALL=0]="ALL",t[t.INCLUDES=1]="INCLUDES",t[t.EXCLUDES=2]="EXCLUDES",t}(Cp||(z.CartCurrencyOperator=Cp={})),xp=function(t){return t[t.NONE=0]="NONE",t[t.AMOUNT=1]="AMOUNT",t[t.TOTAL_PRODUCT=2]="TOTAL_PRODUCT",t[t.UNIQUE_PRODUCT=3]="UNIQUE_PRODUCT",t}(xp||(z.CartFilterEnum=xp={})),Dp=function(t){return t[t.NONE=0]="NONE",t[t.ITEM=1]="ITEM",t[t.COLLECTION=2]="COLLECTION",t}(Dp||(z.PromotionType=Dp={})),Rp=function(t){return t[t.NONE=0]="NONE",t[t.SINGLE=1]="SINGLE",t[t.MULTIPLE=2]="MULTIPLE",t}(Rp||(z.EngagementCollectionSource=Rp={})),Ap=function(t){return t.BEFORE="before",t.AFTER="after",t.INSIDE_FIRST="insideFirst",t.INSIDE_LAST="insideLast",t}(Ap||(z.EngagementPlacementPosition=Ap={})),Np=function(t){return t.SHOPIFY_CHECKOUT="shopify_checkout",t.THIRD_PARTY_CHECKOUT="third_party_checkout",t.CART_PAGE="cart_page",t.CART_DRAWER="cart_drawer",t}(Np||(z.RedirectBehaviour=Np={})),Op=function(t){return t.ONCE_IN_SESSION="ONCE_IN_SESSION",t.ACROSS_SESSIONS="ACROSS_SESSIONS",t}(Op||(z.FrequencyType=Op={})),Pp=function(t){return t.DAYS="DAYS",t.HOURS="HOURS",t.MINUTES="MINUTES",t.SECONDS="SECONDS",t}(Pp||(z.FrequencyGapUnit=Pp={})),Lp=function(t){return t[t.NONE=0]="NONE",t[t.REJECT_POPUP=1]="REJECT_POPUP",t[t.ACCEPT_POPUP=2]="ACCEPT_POPUP",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",t[t.OPEN_CART=105]="OPEN_CART",t[t.SUBMIT_FORM=106]="SUBMIT_FORM",t[t.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",t[t.ADD_BUNDLE=108]="ADD_BUNDLE",t[t.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",t}(Lp||(z.ClickActionType=Lp={})),Bp=function(t){return t.POPUP="POPUP",t.PAGE_EMBED="PAGE_EMBED",t.CART_EMBED="CART_EMBED",t.ANNOUNCEMENT_BAR="ANNOUNCEMENT_BAR",t}(Bp||(z.OnsiteDeliveryType=Bp={})),Up=function(t){return t.PRODUCT_PROMOTION="PRODUCT_PROMOTION",t.BUNDLE_AND_UPSELL="BUNDLE_AND_UPSELL",t.CART_RECOVERY="CART_RECOVERY",t.ANNOUNCEMENT="ANNOUNCEMENT",t.LEAD_GENERATION="LEAD_GENERATION",t.DATA_COLLECTION="DATA_COLLECTION",t.SALE_PROMOTION="SALE_PROMOTION",t.SUBSCRIPTION_UPSELL="SUBSCRIPTION_UPSELL",t.SHOPPABLE_VIDEO="SHOPPABLE_VIDEO",t.BYOB="BYOB",t.PROGRESS_BAR="PROGRESS_BAR",t.BUY_NOW="BUY_NOW",t}(Up||(z.EngagementObjective=Up={})),kp=function(t){return t.COOEE="COOEE",t.KLAVIYO="KLAVIYO",t}(kp||(z.EngagementContentSource=kp={})),Mp=function(t){return t.ICONS="ICONS",t.TILES="TILES",t}(Mp||(z.ProgressBarLayout=Mp={})),Fp=function(t){return t.FREE_SHIPPING="FREE_SHIPPING",t.DISCOUNT="DISCOUNT",t.FREE_AUTO_GIFT="FREE_AUTO_GIFT",t.FREE_GIFT_SELECT="FREE_GIFT_SELECT",t}(Fp||(z.MilestoneRewardType=Fp={}))});var Ko=ur(Gn=>{"use strict";Object.defineProperty(Gn,"__esModule",{value:!0});Gn.PriceRuleType=Gn.DiscountType=void 0;var Hp=function(t){return t[t.NONE=0]="NONE",t[t.STATIC=1]="STATIC",t[t.UNIQUE_FLAT=2]="UNIQUE_FLAT",t[t.UNIQUE_FLAT_ITEMS=3]="UNIQUE_FLAT_ITEMS",t[t.UNIQUE_FIXED_ITEMS=4]="UNIQUE_FIXED_ITEMS",t[t.UNIQUE_CHEAPEST_ITEM_FREE=5]="UNIQUE_CHEAPEST_ITEM_FREE",t[t.BXGY=6]="BXGY",t}(Hp||(Gn.DiscountType=Hp={})),$p=function(t){return t.FIXED_AMOUNT="fixed_amount",t.PERCENTAGE="percentage",t}($p||(Gn.PriceRuleType=$p={}))});var Ac=ur(Jo=>{"use strict";Object.defineProperty(Jo,"__esModule",{value:!0});Jo.ArrayUtils=void 0;var Rc=class t{static of(e,r){return r!==void 0?new Array(e).fill(r):Array.from({length:e},(n,i)=>i)}static remove(e,r){let n=e.indexOf(r);return n===-1?!1:(e.splice(n,1),!0)}static swap(e,r,n){[e[r],e[n]]=[e[n],e[r]]}static sum(e,r){return e.reduce((n,i)=>n+Math.max(r?r(i):+i,0),0)}static unique(e,r){return e.filter((n,i,o)=>o.findIndex(s=>s[r]===n[r])===i)}static shuffle(e){let r=e.length;for(;r!=0;){let n=Math.floor(Math.random()*r);r--,t.swap(e,r,n)}}};Jo.ArrayUtils=Rc});var Sf=ur((Zi,is)=>{"use strict";(function(t,e){"use strict";var r="1.0.40",n="",i="?",o="function",s="undefined",a="object",c="string",m="major",p="model",f="name",d="type",g="vendor",E="version",A="architecture",O="console",D="mobile",R="tablet",P="smarttv",j="wearable",se="embedded",M=500,Q="Amazon",Y="Apple",ae="ASUS",Re="BlackBerry",ge="Browser",Ie="Chrome",Ge="Edge",Me="Firefox",lt="Google",Tt="Huawei",Te="LG",$e="Microsoft",me="Motorola",ne="Opera",je="Samsung",dt="Sharp",lr="Sony",Hr="Xiaomi",rn="Zebra",Mn="Facebook",$r="Chromium OS",Fn="Mac OS",Hn=" Browser",$n=function(V,X){var G={};for(var ye in V)X[ye]&&X[ye].length%2===0?G[ye]=X[ye].concat(V[ye]):G[ye]=V[ye];return G},tr=function(V){for(var X={},G=0;G<V.length;G++)X[V[G].toUpperCase()]=V[G];return X},ht=function(V,X){return typeof V===c?Ht(X).indexOf(Ht(V))!==-1:!1},Ht=function(V){return V.toLowerCase()},Wi=function(V){return typeof V===c?V.replace(/[^\d\.]/g,n).split(".")[0]:e},y=function(V,X){if(typeof V===c)return V=V.replace(/^\s\s*/,n),typeof X===s?V:V.substring(0,M)},l=function(V,X){for(var G=0,ye,gt,ut,ve,Z,Nt;G<X.length&&!Z;){var jn=X[G],Gi=X[G+1];for(ye=gt=0;ye<jn.length&&!Z&&jn[ye];)if(Z=jn[ye++].exec(V),Z)for(ut=0;ut<Gi.length;ut++)Nt=Z[++gt],ve=Gi[ut],typeof ve===a&&ve.length>0?ve.length===2?typeof ve[1]==o?this[ve[0]]=ve[1].call(this,Nt):this[ve[0]]=ve[1]:ve.length===3?typeof ve[1]===o&&!(ve[1].exec&&ve[1].test)?this[ve[0]]=Nt?ve[1].call(this,Nt,ve[2]):e:this[ve[0]]=Nt?Nt.replace(ve[1],ve[2]):e:ve.length===4&&(this[ve[0]]=Nt?ve[3].call(this,Nt.replace(ve[1],ve[2])):e):this[ve]=Nt||e;G+=2}},u=function(V,X){for(var G in X)if(typeof X[G]===a&&X[G].length>0){for(var ye=0;ye<X[G].length;ye++)if(ht(X[G][ye],V))return G===i?e:G}else if(ht(X[G],V))return G===i?e:G;return X.hasOwnProperty("*")?X["*"]:V},_={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},x={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"},U={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[f,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[f,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[f,E],[/opios[\/ ]+([\w\.]+)/i],[E,[f,ne+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[E,[f,ne+" GX"]],[/\bopr\/([\w\.]+)/i],[E,[f,ne]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[E,[f,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[E,[f,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[f,E],[/quark(?:pc)?\/([-\w\.]+)/i],[E,[f,"Quark"]],[/\bddg\/([\w\.]+)/i],[E,[f,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[f,"UC"+ge]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[E,[f,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[f,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[f,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[f,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[E,[f,"Smart Lenovo "+ge]],[/(avast|avg)\/([\w\.]+)/i],[[f,/(.+)/,"$1 Secure "+ge],E],[/\bfocus\/([\w\.]+)/i],[E,[f,Me+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[f,ne+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[f,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[f,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[f,ne+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[f,"MIUI"+Hn]],[/fxios\/([\w\.-]+)/i],[E,[f,Me]],[/\bqihoobrowser\/?([\w\.]*)/i],[E,[f,"360"]],[/\b(qq)\/([\w\.]+)/i],[[f,/(.+)/,"$1Browser"],E],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[f,/(.+)/,"$1"+Hn],E],[/samsungbrowser\/([\w\.]+)/i],[E,[f,je+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[E,[f,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[f,"Sogou Mobile"],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[f,E],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[f],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[E,f],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[f,Mn],E],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[f,E],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[f,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[f,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[f,Ie+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[f,Ie+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[f,"Android "+ge]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[f,E],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[E,[f,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[E,f],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[f,[E,u,_]],[/(webkit|khtml)\/([\w\.]+)/i],[f,E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[f,"Netscape"],E],[/(wolvic|librewolf)\/([\w\.]+)/i],[f,E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[f,Me+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[f,[E,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[f,[E,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[A,"amd64"]],[/(ia32(?=;))/i],[[A,Ht]],[/((?:i[346]|x)86)[;\)]/i],[[A,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[A,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[A,"armhf"]],[/windows (ce|mobile); ppc;/i],[[A,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[A,/ower/,n,Ht]],[/(sun4\w)[;\)]/i],[[A,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[A,Ht]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[p,[g,je],[d,R]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[p,[g,je],[d,D]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[p,[g,Y],[d,D]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[p,[g,Y],[d,R]],[/(macintosh);/i],[p,[g,Y]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[p,[g,dt],[d,D]],[/(?:honor)([-\w ]+)[;\)]/i],[p,[g,"Honor"],[d,D]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[p,[g,Tt],[d,R]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[p,[g,Tt],[d,D]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[p,/_/g," "],[g,Hr],[d,D]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[p,/_/g," "],[g,Hr],[d,R]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[p,[g,"OPPO"],[d,D]],[/\b(opd2\d{3}a?) bui/i],[p,[g,"OPPO"],[d,R]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[p,[g,"Vivo"],[d,D]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[p,[g,"Realme"],[d,D]],[/\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],[p,[g,me],[d,D]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[p,[g,me],[d,R]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[p,[g,Te],[d,R]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[p,[g,Te],[d,D]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[p,[g,"Lenovo"],[d,R]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[p,/_/g," "],[g,"Nokia"],[d,D]],[/(pixel c)\b/i],[p,[g,lt],[d,R]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[p,[g,lt],[d,D]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[p,[g,lr],[d,D]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[p,"Xperia Tablet"],[g,lr],[d,R]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[p,[g,"OnePlus"],[d,D]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[p,[g,Q],[d,R]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[p,/(.+)/g,"Fire Phone $1"],[g,Q],[d,D]],[/(playbook);[-\w\),; ]+(rim)/i],[p,g,[d,R]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[p,[g,Re],[d,D]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[p,[g,ae],[d,R]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[p,[g,ae],[d,D]],[/(nexus 9)/i],[p,[g,"HTC"],[d,R]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[g,[p,/_/g," "],[d,D]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[p,[g,"TCL"],[d,R]],[/(itel) ((\w+))/i],[[g,Ht],p,[d,u,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[p,[g,"Acer"],[d,R]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[p,[g,"Meizu"],[d,D]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[p,[g,"Ulefone"],[d,D]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[p,[g,"Energizer"],[d,D]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[p,[g,"Cat"],[d,D]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[p,[g,"Smartfren"],[d,D]],[/droid.+; (a(?:015|06[35]|142p?))/i],[p,[g,"Nothing"],[d,D]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[g,p,[d,D]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[g,p,[d,R]],[/(surface duo)/i],[p,[g,$e],[d,R]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[p,[g,"Fairphone"],[d,D]],[/(u304aa)/i],[p,[g,"AT&T"],[d,D]],[/\bsie-(\w*)/i],[p,[g,"Siemens"],[d,D]],[/\b(rct\w+) b/i],[p,[g,"RCA"],[d,R]],[/\b(venue[\d ]{2,7}) b/i],[p,[g,"Dell"],[d,R]],[/\b(q(?:mv|ta)\w+) b/i],[p,[g,"Verizon"],[d,R]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[p,[g,"Barnes & Noble"],[d,R]],[/\b(tm\d{3}\w+) b/i],[p,[g,"NuVision"],[d,R]],[/\b(k88) b/i],[p,[g,"ZTE"],[d,R]],[/\b(nx\d{3}j) b/i],[p,[g,"ZTE"],[d,D]],[/\b(gen\d{3}) b.+49h/i],[p,[g,"Swiss"],[d,D]],[/\b(zur\d{3}) b/i],[p,[g,"Swiss"],[d,R]],[/\b((zeki)?tb.*\b) b/i],[p,[g,"Zeki"],[d,R]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[g,"Dragon Touch"],p,[d,R]],[/\b(ns-?\w{0,9}) b/i],[p,[g,"Insignia"],[d,R]],[/\b((nxa|next)-?\w{0,9}) b/i],[p,[g,"NextBook"],[d,R]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[g,"Voice"],p,[d,D]],[/\b(lvtel\-)?(v1[12]) b/i],[[g,"LvTel"],p,[d,D]],[/\b(ph-1) /i],[p,[g,"Essential"],[d,D]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[p,[g,"Envizen"],[d,R]],[/\b(trio[-\w\. ]+) b/i],[p,[g,"MachSpeed"],[d,R]],[/\btu_(1491) b/i],[p,[g,"Rotor"],[d,R]],[/(shield[\w ]+) b/i],[p,[g,"Nvidia"],[d,R]],[/(sprint) (\w+)/i],[g,p,[d,D]],[/(kin\.[onetw]{3})/i],[[p,/\./g," "],[g,$e],[d,D]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[p,[g,rn],[d,R]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[p,[g,rn],[d,D]],[/smart-tv.+(samsung)/i],[g,[d,P]],[/hbbtv.+maple;(\d+)/i],[[p,/^/,"SmartTV"],[g,je],[d,P]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[g,Te],[d,P]],[/(apple) ?tv/i],[g,[p,Y+" TV"],[d,P]],[/crkey/i],[[p,Ie+"cast"],[g,lt],[d,P]],[/droid.+aft(\w+)( bui|\))/i],[p,[g,Q],[d,P]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[p,[g,dt],[d,P]],[/(bravia[\w ]+)( bui|\))/i],[p,[g,lr],[d,P]],[/(mitv-\w{5}) bui/i],[p,[g,Hr],[d,P]],[/Hbbtv.*(technisat) (.*);/i],[g,p,[d,P]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[g,y],[p,y],[d,P]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[d,P]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[g,p,[d,O]],[/droid.+; (shield) bui/i],[p,[g,"Nvidia"],[d,O]],[/(playstation [345portablevi]+)/i],[p,[g,lr],[d,O]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[p,[g,$e],[d,O]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[p,[g,je],[d,j]],[/((pebble))app/i],[g,p,[d,j]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[p,[g,Y],[d,j]],[/droid.+; (glass) \d/i],[p,[g,lt],[d,j]],[/droid.+; (wt63?0{2,3})\)/i],[p,[g,rn],[d,j]],[/droid.+; (glass) \d/i],[p,[g,lt],[d,j]],[/(pico) (4|neo3(?: link|pro)?)/i],[g,p,[d,j]],[/; (quest( \d| pro)?)/i],[p,[g,Mn],[d,j]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[g,[d,se]],[/(aeobc)\b/i],[p,[g,Q],[d,se]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[p,[d,D]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[p,[d,R]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[d,R]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[d,D]],[/(android[-\w\. ]{0,9});.+buil/i],[p,[g,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[f,Ge+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[f,E],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[f,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[f,E],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,f]],os:[[/microsoft (windows) (vista|xp)/i],[f,E],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[f,[E,u,x]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[E,u,x],[f,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[f,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[f,Fn],[E,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[E,f],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[f,E],[/\(bb(10);/i],[E,[f,Re]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[E,[f,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[f,Me+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[E,[f,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[f,"watchOS"]],[/crkey\/([\d\.]+)/i],[E,[f,Ie+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[f,$r],E],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[f,E],[/(sunos) ?([\w\.\d]*)/i],[[f,"Solaris"],E],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[f,E]]},B=function(V,X){if(typeof V===a&&(X=V,V=e),!(this instanceof B))return new B(V,X).getResult();var G=typeof t!==s&&t.navigator?t.navigator:e,ye=V||(G&&G.userAgent?G.userAgent:n),gt=G&&G.userAgentData?G.userAgentData:e,ut=X?$n(U,X):U,ve=G&&G.userAgent==ye;return this.getBrowser=function(){var Z={};return Z[f]=e,Z[E]=e,l.call(Z,ye,ut.browser),Z[m]=Wi(Z[E]),ve&&G&&G.brave&&typeof G.brave.isBrave==o&&(Z[f]="Brave"),Z},this.getCPU=function(){var Z={};return Z[A]=e,l.call(Z,ye,ut.cpu),Z},this.getDevice=function(){var Z={};return Z[g]=e,Z[p]=e,Z[d]=e,l.call(Z,ye,ut.device),ve&&!Z[d]&&gt&&gt.mobile&&(Z[d]=D),ve&&Z[p]=="Macintosh"&&G&&typeof G.standalone!==s&&G.maxTouchPoints&&G.maxTouchPoints>2&&(Z[p]="iPad",Z[d]=R),Z},this.getEngine=function(){var Z={};return Z[f]=e,Z[E]=e,l.call(Z,ye,ut.engine),Z},this.getOS=function(){var Z={};return Z[f]=e,Z[E]=e,l.call(Z,ye,ut.os),ve&&!Z[f]&&gt&&gt.platform&&gt.platform!="Unknown"&&(Z[f]=gt.platform.replace(/chrome os/i,$r).replace(/macos/i,Fn)),Z},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 ye},this.setUA=function(Z){return ye=typeof Z===c&&Z.length>M?y(Z,M):Z,this},this.setUA(ye),this};B.VERSION=r,B.BROWSER=tr([f,E,m]),B.CPU=tr([A]),B.DEVICE=tr([p,g,d,O,D,P,R,j,se]),B.ENGINE=B.OS=tr([f,E]),typeof Zi!==s?(typeof is!==s&&is.exports&&(Zi=is.exports=B),Zi.UAParser=B):typeof define===o&&define.amd?define(function(){return B}):typeof t!==s&&(t.UAParser=B);var ie=typeof t!==s&&(t.jQuery||t.Zepto);if(ie&&!ie.ua){var he=new B;ie.ua=he.getResult(),ie.ua.get=function(){return he.getUA()},ie.ua.set=function(V){he.setUA(V);var X=he.getResult();for(var G in X)ie.ua[G]=X[G]}}})(typeof window=="object"?window:Zi)});var If=ur((bf,Zc)=>{"use strict";(function(t){if(typeof bf=="object"&&typeof Zc<"u")Zc.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,r;return function n(i,o,s){function a(p,f){if(!o[p]){if(!i[p]){var d=typeof zi=="function"&&zi;if(!f&&d)return d(p,!0);if(c)return c(p,!0);var g=new Error("Cannot find module '"+p+"'");throw g.code="MODULE_NOT_FOUND",g}var E=o[p]={exports:{}};i[p][0].call(E.exports,function(A){var O=i[p][1][A];return a(O||A)},E,E.exports,n,i,o,s)}return o[p].exports}for(var c=typeof zi=="function"&&zi,m=0;m<s.length;m++)a(s[m]);return a}({1:[function(n,i,o){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,c;if(a){var m=0,p=new a(A),f=s.document.createTextNode("");p.observe(f,{characterData:!0}),c=function(){f.data=m=++m%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var d=new s.MessageChannel;d.port1.onmessage=A,c=function(){d.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?c=function(){var D=s.document.createElement("script");D.onreadystatechange=function(){A(),D.onreadystatechange=null,D.parentNode.removeChild(D),D=null},s.document.documentElement.appendChild(D)}:c=function(){setTimeout(A,0)};var g,E=[];function A(){g=!0;for(var D,R,P=E.length;P;){for(R=E,E=[],D=-1;++D<P;)R[D]();P=E.length}g=!1}i.exports=O;function O(D){E.push(D)===1&&!g&&c()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(n,i,o){"use strict";var s=n(1);function a(){}var c={},m=["REJECTED"],p=["FULFILLED"],f=["PENDING"];i.exports=d;function d(M){if(typeof M!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,M!==a&&O(this,M)}d.prototype.catch=function(M){return this.then(null,M)},d.prototype.then=function(M,Q){if(typeof M!="function"&&this.state===p||typeof Q!="function"&&this.state===m)return this;var Y=new this.constructor(a);if(this.state!==f){var ae=this.state===p?M:Q;E(Y,ae,this.outcome)}else this.queue.push(new g(Y,M,Q));return Y};function g(M,Q,Y){this.promise=M,typeof Q=="function"&&(this.onFulfilled=Q,this.callFulfilled=this.otherCallFulfilled),typeof Y=="function"&&(this.onRejected=Y,this.callRejected=this.otherCallRejected)}g.prototype.callFulfilled=function(M){c.resolve(this.promise,M)},g.prototype.otherCallFulfilled=function(M){E(this.promise,this.onFulfilled,M)},g.prototype.callRejected=function(M){c.reject(this.promise,M)},g.prototype.otherCallRejected=function(M){E(this.promise,this.onRejected,M)};function E(M,Q,Y){s(function(){var ae;try{ae=Q(Y)}catch(Re){return c.reject(M,Re)}ae===M?c.reject(M,new TypeError("Cannot resolve promise with itself")):c.resolve(M,ae)})}c.resolve=function(M,Q){var Y=D(A,Q);if(Y.status==="error")return c.reject(M,Y.value);var ae=Y.value;if(ae)O(M,ae);else{M.state=p,M.outcome=Q;for(var Re=-1,ge=M.queue.length;++Re<ge;)M.queue[Re].callFulfilled(Q)}return M},c.reject=function(M,Q){M.state=m,M.outcome=Q;for(var Y=-1,ae=M.queue.length;++Y<ae;)M.queue[Y].callRejected(Q);return M};function A(M){var Q=M&&M.then;if(M&&(typeof M=="object"||typeof M=="function")&&typeof Q=="function")return function(){Q.apply(M,arguments)}}function O(M,Q){var Y=!1;function ae(Ge){Y||(Y=!0,c.reject(M,Ge))}function Re(Ge){Y||(Y=!0,c.resolve(M,Ge))}function ge(){Q(Re,ae)}var Ie=D(ge);Ie.status==="error"&&ae(Ie.value)}function D(M,Q){var Y={};try{Y.value=M(Q),Y.status="success"}catch(ae){Y.status="error",Y.value=ae}return Y}d.resolve=R;function R(M){return M instanceof this?M:c.resolve(new this(a),M)}d.reject=P;function P(M){var Q=new this(a);return c.reject(Q,M)}d.all=j;function j(M){var Q=this;if(Object.prototype.toString.call(M)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=M.length,ae=!1;if(!Y)return this.resolve([]);for(var Re=new Array(Y),ge=0,Ie=-1,Ge=new this(a);++Ie<Y;)Me(M[Ie],Ie);return Ge;function Me(lt,Tt){Q.resolve(lt).then(Te,function($e){ae||(ae=!0,c.reject(Ge,$e))});function Te($e){Re[Tt]=$e,++ge===Y&&!ae&&(ae=!0,c.resolve(Ge,Re))}}}d.race=se;function se(M){var Q=this;if(Object.prototype.toString.call(M)!=="[object Array]")return this.reject(new TypeError("must be an array"));var Y=M.length,ae=!1;if(!Y)return this.resolve([]);for(var Re=-1,ge=new this(a);++Re<Y;)Ie(M[Re]);return ge;function Ie(Ge){Q.resolve(Ge).then(function(Me){ae||(ae=!0,c.resolve(ge,Me))},function(Me){ae||(ae=!0,c.reject(ge,Me))})}}},{1:1}],3:[function(n,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=n(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h};function a(h,S){if(!(h instanceof S))throw new TypeError("Cannot call a class as a function")}function c(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var m=c();function p(){try{if(!m||!m.open)return!1;var h=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),S=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!h||S)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(h,S){h=h||[],S=S||{};try{return new Blob(h,S)}catch(I){if(I.name!=="TypeError")throw I;for(var v=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,T=new v,C=0;C<h.length;C+=1)T.append(h[C]);return T.getBlob(S.type)}}typeof Promise>"u"&&n(3);var d=Promise;function g(h,S){S&&h.then(function(v){S(null,v)},function(v){S(v)})}function E(h,S,v){typeof S=="function"&&h.then(S),typeof v=="function"&&h.catch(v)}function A(h){return typeof h!="string"&&(console.warn(h+" used as a key, but it is not a string."),h=String(h)),h}function O(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var D="local-forage-detect-blob-support",R=void 0,P={},j=Object.prototype.toString,se="readonly",M="readwrite";function Q(h){for(var S=h.length,v=new ArrayBuffer(S),T=new Uint8Array(v),C=0;C<S;C++)T[C]=h.charCodeAt(C);return v}function Y(h){return new d(function(S){var v=h.transaction(D,M),T=f([""]);v.objectStore(D).put(T,"key"),v.onabort=function(C){C.preventDefault(),C.stopPropagation(),S(!1)},v.oncomplete=function(){var C=navigator.userAgent.match(/Chrome\/(\d+)/),I=navigator.userAgent.match(/Edge\//);S(I||!C||parseInt(C[1],10)>=43)}}).catch(function(){return!1})}function ae(h){return typeof R=="boolean"?d.resolve(R):Y(h).then(function(S){return R=S,R})}function Re(h){var S=P[h.name],v={};v.promise=new d(function(T,C){v.resolve=T,v.reject=C}),S.deferredOperations.push(v),S.dbReady?S.dbReady=S.dbReady.then(function(){return v.promise}):S.dbReady=v.promise}function ge(h){var S=P[h.name],v=S.deferredOperations.pop();if(v)return v.resolve(),v.promise}function Ie(h,S){var v=P[h.name],T=v.deferredOperations.pop();if(T)return T.reject(S),T.promise}function Ge(h,S){return new d(function(v,T){if(P[h.name]=P[h.name]||lr(),h.db)if(S)Re(h),h.db.close();else return v(h.db);var C=[h.name];S&&C.push(h.version);var I=m.open.apply(m,C);S&&(I.onupgradeneeded=function(L){var k=I.result;try{k.createObjectStore(h.storeName),L.oldVersion<=1&&k.createObjectStore(D)}catch(F){if(F.name==="ConstraintError")console.warn('The database "'+h.name+'" has been upgraded from version '+L.oldVersion+" to version "+L.newVersion+', but the storage "'+h.storeName+'" already exists.');else throw F}}),I.onerror=function(L){L.preventDefault(),T(I.error)},I.onsuccess=function(){var L=I.result;L.onversionchange=function(k){k.target.close()},v(L),ge(h)}})}function Me(h){return Ge(h,!1)}function lt(h){return Ge(h,!0)}function Tt(h,S){if(!h.db)return!0;var v=!h.db.objectStoreNames.contains(h.storeName),T=h.version<h.db.version,C=h.version>h.db.version;if(T&&(h.version!==S&&console.warn('The database "'+h.name+`" can't be downgraded from version `+h.db.version+" to version "+h.version+"."),h.version=h.db.version),C||v){if(v){var I=h.db.version+1;I>h.version&&(h.version=I)}return!0}return!1}function Te(h){return new d(function(S,v){var T=new FileReader;T.onerror=v,T.onloadend=function(C){var I=btoa(C.target.result||"");S({__local_forage_encoded_blob:!0,data:I,type:h.type})},T.readAsBinaryString(h)})}function $e(h){var S=Q(atob(h.data));return f([S],{type:h.type})}function me(h){return h&&h.__local_forage_encoded_blob}function ne(h){var S=this,v=S._initReady().then(function(){var T=P[S._dbInfo.name];if(T&&T.dbReady)return T.dbReady});return E(v,h,h),v}function je(h){Re(h);for(var S=P[h.name],v=S.forages,T=0;T<v.length;T++){var C=v[T];C._dbInfo.db&&(C._dbInfo.db.close(),C._dbInfo.db=null)}return h.db=null,Me(h).then(function(I){return h.db=I,Tt(h)?lt(h):I}).then(function(I){h.db=S.db=I;for(var L=0;L<v.length;L++)v[L]._dbInfo.db=I}).catch(function(I){throw Ie(h,I),I})}function dt(h,S,v,T){T===void 0&&(T=1);try{var C=h.db.transaction(h.storeName,S);v(null,C)}catch(I){if(T>0&&(!h.db||I.name==="InvalidStateError"||I.name==="NotFoundError"))return d.resolve().then(function(){if(!h.db||I.name==="NotFoundError"&&!h.db.objectStoreNames.contains(h.storeName)&&h.version<=h.db.version)return h.db&&(h.version=h.db.version+1),lt(h)}).then(function(){return je(h).then(function(){dt(h,S,v,T-1)})}).catch(v);v(I)}}function lr(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Hr(h){var S=this,v={db:null};if(h)for(var T in h)v[T]=h[T];var C=P[v.name];C||(C=lr(),P[v.name]=C),C.forages.push(S),S._initReady||(S._initReady=S.ready,S.ready=ne);var I=[];function L(){return d.resolve()}for(var k=0;k<C.forages.length;k++){var F=C.forages[k];F!==S&&I.push(F._initReady().catch(L))}var H=C.forages.slice(0);return d.all(I).then(function(){return v.db=C.db,Me(v)}).then(function(W){return v.db=W,Tt(v,S._defaultConfig.version)?lt(v):W}).then(function(W){v.db=C.db=W,S._dbInfo=v;for(var q=0;q<H.length;q++){var ue=H[q];ue!==S&&(ue._dbInfo.db=v.db,ue._dbInfo.version=v.version)}})}function rn(h,S){var v=this;h=A(h);var T=new d(function(C,I){v.ready().then(function(){dt(v._dbInfo,se,function(L,k){if(L)return I(L);try{var F=k.objectStore(v._dbInfo.storeName),H=F.get(h);H.onsuccess=function(){var W=H.result;W===void 0&&(W=null),me(W)&&(W=$e(W)),C(W)},H.onerror=function(){I(H.error)}}catch(W){I(W)}})}).catch(I)});return g(T,S),T}function Mn(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){dt(v._dbInfo,se,function(L,k){if(L)return I(L);try{var F=k.objectStore(v._dbInfo.storeName),H=F.openCursor(),W=1;H.onsuccess=function(){var q=H.result;if(q){var ue=q.value;me(ue)&&(ue=$e(ue));var Ce=h(ue,q.key,W++);Ce!==void 0?C(Ce):q.continue()}else C()},H.onerror=function(){I(H.error)}}catch(q){I(q)}})}).catch(I)});return g(T,S),T}function $r(h,S,v){var T=this;h=A(h);var C=new d(function(I,L){var k;T.ready().then(function(){return k=T._dbInfo,j.call(S)==="[object Blob]"?ae(k.db).then(function(F){return F?S:Te(S)}):S}).then(function(F){dt(T._dbInfo,M,function(H,W){if(H)return L(H);try{var q=W.objectStore(T._dbInfo.storeName);F===null&&(F=void 0);var ue=q.put(F,h);W.oncomplete=function(){F===void 0&&(F=null),I(F)},W.onabort=W.onerror=function(){var Ce=ue.error?ue.error:ue.transaction.error;L(Ce)}}catch(Ce){L(Ce)}})}).catch(L)});return g(C,v),C}function Fn(h,S){var v=this;h=A(h);var T=new d(function(C,I){v.ready().then(function(){dt(v._dbInfo,M,function(L,k){if(L)return I(L);try{var F=k.objectStore(v._dbInfo.storeName),H=F.delete(h);k.oncomplete=function(){C()},k.onerror=function(){I(H.error)},k.onabort=function(){var W=H.error?H.error:H.transaction.error;I(W)}}catch(W){I(W)}})}).catch(I)});return g(T,S),T}function Hn(h){var S=this,v=new d(function(T,C){S.ready().then(function(){dt(S._dbInfo,M,function(I,L){if(I)return C(I);try{var k=L.objectStore(S._dbInfo.storeName),F=k.clear();L.oncomplete=function(){T()},L.onabort=L.onerror=function(){var H=F.error?F.error:F.transaction.error;C(H)}}catch(H){C(H)}})}).catch(C)});return g(v,h),v}function $n(h){var S=this,v=new d(function(T,C){S.ready().then(function(){dt(S._dbInfo,se,function(I,L){if(I)return C(I);try{var k=L.objectStore(S._dbInfo.storeName),F=k.count();F.onsuccess=function(){T(F.result)},F.onerror=function(){C(F.error)}}catch(H){C(H)}})}).catch(C)});return g(v,h),v}function tr(h,S){var v=this,T=new d(function(C,I){if(h<0){C(null);return}v.ready().then(function(){dt(v._dbInfo,se,function(L,k){if(L)return I(L);try{var F=k.objectStore(v._dbInfo.storeName),H=!1,W=F.openKeyCursor();W.onsuccess=function(){var q=W.result;if(!q){C(null);return}h===0||H?C(q.key):(H=!0,q.advance(h))},W.onerror=function(){I(W.error)}}catch(q){I(q)}})}).catch(I)});return g(T,S),T}function ht(h){var S=this,v=new d(function(T,C){S.ready().then(function(){dt(S._dbInfo,se,function(I,L){if(I)return C(I);try{var k=L.objectStore(S._dbInfo.storeName),F=k.openKeyCursor(),H=[];F.onsuccess=function(){var W=F.result;if(!W){T(H);return}H.push(W.key),W.continue()},F.onerror=function(){C(F.error)}}catch(W){C(W)}})}).catch(C)});return g(v,h),v}function Ht(h,S){S=O.apply(this,arguments);var v=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||v.name,h.storeName=h.storeName||v.storeName);var T=this,C;if(!h.name)C=d.reject("Invalid arguments");else{var I=h.name===v.name&&T._dbInfo.db,L=I?d.resolve(T._dbInfo.db):Me(h).then(function(k){var F=P[h.name],H=F.forages;F.db=k;for(var W=0;W<H.length;W++)H[W]._dbInfo.db=k;return k});h.storeName?C=L.then(function(k){if(k.objectStoreNames.contains(h.storeName)){var F=k.version+1;Re(h);var H=P[h.name],W=H.forages;k.close();for(var q=0;q<W.length;q++){var ue=W[q];ue._dbInfo.db=null,ue._dbInfo.version=F}var Ce=new d(function(xe,qe){var Ve=m.open(h.name,F);Ve.onerror=function($t){var Yi=Ve.result;Yi.close(),qe($t)},Ve.onupgradeneeded=function(){var $t=Ve.result;$t.deleteObjectStore(h.storeName)},Ve.onsuccess=function(){var $t=Ve.result;$t.close(),xe($t)}});return Ce.then(function(xe){H.db=xe;for(var qe=0;qe<W.length;qe++){var Ve=W[qe];Ve._dbInfo.db=xe,ge(Ve._dbInfo)}}).catch(function(xe){throw(Ie(h,xe)||d.resolve()).catch(function(){}),xe})}}):C=L.then(function(k){Re(h);var F=P[h.name],H=F.forages;k.close();for(var W=0;W<H.length;W++){var q=H[W];q._dbInfo.db=null}var ue=new d(function(Ce,xe){var qe=m.deleteDatabase(h.name);qe.onerror=function(){var Ve=qe.result;Ve&&Ve.close(),xe(qe.error)},qe.onblocked=function(){console.warn('dropInstance blocked for database "'+h.name+'" until all open connections are closed')},qe.onsuccess=function(){var Ve=qe.result;Ve&&Ve.close(),Ce(Ve)}});return ue.then(function(Ce){F.db=Ce;for(var xe=0;xe<H.length;xe++){var qe=H[xe];ge(qe._dbInfo)}}).catch(function(Ce){throw(Ie(h,Ce)||d.resolve()).catch(function(){}),Ce})})}return g(C,S),C}var Wi={_driver:"asyncStorage",_initStorage:Hr,_support:p(),iterate:Mn,getItem:rn,setItem:$r,removeItem:Fn,clear:Hn,length:$n,key:tr,keys:ht,dropInstance:Ht};function y(){return typeof openDatabase=="function"}var l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u="~~local_forage_type~",_=/^~~local_forage_type~([^~]+)~/,x="__lfsc__:",U=x.length,B="arbf",ie="blob",he="si08",V="ui08",X="uic8",G="si16",ye="si32",gt="ur16",ut="ui32",ve="fl32",Z="fl64",Nt=U+B.length,jn=Object.prototype.toString;function Gi(h){var S=h.length*.75,v=h.length,T,C=0,I,L,k,F;h[h.length-1]==="="&&(S--,h[h.length-2]==="="&&S--);var H=new ArrayBuffer(S),W=new Uint8Array(H);for(T=0;T<v;T+=4)I=l.indexOf(h[T]),L=l.indexOf(h[T+1]),k=l.indexOf(h[T+2]),F=l.indexOf(h[T+3]),W[C++]=I<<2|L>>4,W[C++]=(L&15)<<4|k>>2,W[C++]=(k&3)<<6|F&63;return H}function Sc(h){var S=new Uint8Array(h),v="",T;for(T=0;T<S.length;T+=3)v+=l[S[T]>>2],v+=l[(S[T]&3)<<4|S[T+1]>>4],v+=l[(S[T+1]&15)<<2|S[T+2]>>6],v+=l[S[T+2]&63];return S.length%3===2?v=v.substring(0,v.length-1)+"=":S.length%3===1&&(v=v.substring(0,v.length-2)+"=="),v}function vh(h,S){var v="";if(h&&(v=jn.call(h)),h&&(v==="[object ArrayBuffer]"||h.buffer&&jn.call(h.buffer)==="[object ArrayBuffer]")){var T,C=x;h instanceof ArrayBuffer?(T=h,C+=B):(T=h.buffer,v==="[object Int8Array]"?C+=he:v==="[object Uint8Array]"?C+=V:v==="[object Uint8ClampedArray]"?C+=X:v==="[object Int16Array]"?C+=G:v==="[object Uint16Array]"?C+=gt:v==="[object Int32Array]"?C+=ye:v==="[object Uint32Array]"?C+=ut:v==="[object Float32Array]"?C+=ve:v==="[object Float64Array]"?C+=Z:S(new Error("Failed to get type for BinaryArray"))),S(C+Sc(T))}else if(v==="[object Blob]"){var I=new FileReader;I.onload=function(){var L=u+h.type+"~"+Sc(this.result);S(x+ie+L)},I.readAsArrayBuffer(h)}else try{S(JSON.stringify(h))}catch(L){console.error("Couldn't convert value into a JSON string: ",h),S(null,L)}}function _h(h){if(h.substring(0,U)!==x)return JSON.parse(h);var S=h.substring(Nt),v=h.substring(U,Nt),T;if(v===ie&&_.test(S)){var C=S.match(_);T=C[1],S=S.substring(C[0].length)}var I=Gi(S);switch(v){case B:return I;case ie:return f([I],{type:T});case he:return new Int8Array(I);case V:return new Uint8Array(I);case X:return new Uint8ClampedArray(I);case G:return new Int16Array(I);case gt:return new Uint16Array(I);case ye:return new Int32Array(I);case ut:return new Uint32Array(I);case ve:return new Float32Array(I);case Z:return new Float64Array(I);default:throw new Error("Unkown type: "+v)}}var wc={serialize:vh,deserialize:_h,stringToBuffer:Gi,bufferToString:Sc};function Zu(h,S,v,T){h.executeSql("CREATE TABLE IF NOT EXISTS "+S.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],v,T)}function Eh(h){var S=this,v={db:null};if(h)for(var T in h)v[T]=typeof h[T]!="string"?h[T].toString():h[T];var C=new d(function(I,L){try{v.db=openDatabase(v.name,String(v.version),v.description,v.size)}catch(k){return L(k)}v.db.transaction(function(k){Zu(k,v,function(){S._dbInfo=v,I()},function(F,H){L(H)})},L)});return v.serializer=wc,C}function jr(h,S,v,T,C,I){h.executeSql(v,T,C,function(L,k){k.code===k.SYNTAX_ERR?L.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[S.storeName],function(F,H){H.rows.length?I(F,k):Zu(F,S,function(){F.executeSql(v,T,C,I)},I)},I):I(L,k)},I)}function Sh(h,S){var v=this;h=A(h);var T=new d(function(C,I){v.ready().then(function(){var L=v._dbInfo;L.db.transaction(function(k){jr(k,L,"SELECT * FROM "+L.storeName+" WHERE key = ? LIMIT 1",[h],function(F,H){var W=H.rows.length?H.rows.item(0).value:null;W&&(W=L.serializer.deserialize(W)),C(W)},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function wh(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){var L=v._dbInfo;L.db.transaction(function(k){jr(k,L,"SELECT * FROM "+L.storeName,[],function(F,H){for(var W=H.rows,q=W.length,ue=0;ue<q;ue++){var Ce=W.item(ue),xe=Ce.value;if(xe&&(xe=L.serializer.deserialize(xe)),xe=h(xe,Ce.key,ue+1),xe!==void 0){C(xe);return}}C()},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function ep(h,S,v,T){var C=this;h=A(h);var I=new d(function(L,k){C.ready().then(function(){S===void 0&&(S=null);var F=S,H=C._dbInfo;H.serializer.serialize(S,function(W,q){q?k(q):H.db.transaction(function(ue){jr(ue,H,"INSERT OR REPLACE INTO "+H.storeName+" (key, value) VALUES (?, ?)",[h,W],function(){L(F)},function(Ce,xe){k(xe)})},function(ue){if(ue.code===ue.QUOTA_ERR){if(T>0){L(ep.apply(C,[h,F,v,T-1]));return}k(ue)}})})}).catch(k)});return g(I,v),I}function bh(h,S,v){return ep.apply(this,[h,S,v,1])}function Ih(h,S){var v=this;h=A(h);var T=new d(function(C,I){v.ready().then(function(){var L=v._dbInfo;L.db.transaction(function(k){jr(k,L,"DELETE FROM "+L.storeName+" WHERE key = ?",[h],function(){C()},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Th(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(L){jr(L,I,"DELETE FROM "+I.storeName,[],function(){T()},function(k,F){C(F)})})}).catch(C)});return g(v,h),v}function Ch(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(L){jr(L,I,"SELECT COUNT(key) as c FROM "+I.storeName,[],function(k,F){var H=F.rows.item(0).c;T(H)},function(k,F){C(F)})})}).catch(C)});return g(v,h),v}function xh(h,S){var v=this,T=new d(function(C,I){v.ready().then(function(){var L=v._dbInfo;L.db.transaction(function(k){jr(k,L,"SELECT key FROM "+L.storeName+" WHERE id = ? LIMIT 1",[h+1],function(F,H){var W=H.rows.length?H.rows.item(0).key:null;C(W)},function(F,H){I(H)})})}).catch(I)});return g(T,S),T}function Dh(h){var S=this,v=new d(function(T,C){S.ready().then(function(){var I=S._dbInfo;I.db.transaction(function(L){jr(L,I,"SELECT key FROM "+I.storeName,[],function(k,F){for(var H=[],W=0;W<F.rows.length;W++)H.push(F.rows.item(W).key);T(H)},function(k,F){C(F)})})}).catch(C)});return g(v,h),v}function Rh(h){return new d(function(S,v){h.transaction(function(T){T.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(C,I){for(var L=[],k=0;k<I.rows.length;k++)L.push(I.rows.item(k).name);S({db:h,storeNames:L})},function(C,I){v(I)})},function(T){v(T)})})}function Ah(h,S){S=O.apply(this,arguments);var v=this.config();h=typeof h!="function"&&h||{},h.name||(h.name=h.name||v.name,h.storeName=h.storeName||v.storeName);var T=this,C;return h.name?C=new d(function(I){var L;h.name===v.name?L=T._dbInfo.db:L=openDatabase(h.name,"","",0),h.storeName?I({db:L,storeNames:[h.storeName]}):I(Rh(L))}).then(function(I){return new d(function(L,k){I.db.transaction(function(F){function H(Ce){return new d(function(xe,qe){F.executeSql("DROP TABLE IF EXISTS "+Ce,[],function(){xe()},function(Ve,$t){qe($t)})})}for(var W=[],q=0,ue=I.storeNames.length;q<ue;q++)W.push(H(I.storeNames[q]));d.all(W).then(function(){L()}).catch(function(Ce){k(Ce)})},function(F){k(F)})})}):C=d.reject("Invalid arguments"),g(C,S),C}var Nh={_driver:"webSQLStorage",_initStorage:Eh,_support:y(),iterate:wh,getItem:Sh,setItem:bh,removeItem:Ih,clear:Th,length:Ch,key:xh,keys:Dh,dropInstance:Ah};function Oh(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function tp(h,S){var v=h.name+"/";return h.storeName!==S.storeName&&(v+=h.storeName+"/"),v}function Ph(){var h="_localforage_support_test";try{return localStorage.setItem(h,!0),localStorage.removeItem(h),!1}catch{return!0}}function Lh(){return!Ph()||localStorage.length>0}function Bh(h){var S=this,v={};if(h)for(var T in h)v[T]=h[T];return v.keyPrefix=tp(h,S._defaultConfig),Lh()?(S._dbInfo=v,v.serializer=wc,d.resolve()):d.reject()}function Uh(h){var S=this,v=S.ready().then(function(){for(var T=S._dbInfo.keyPrefix,C=localStorage.length-1;C>=0;C--){var I=localStorage.key(C);I.indexOf(T)===0&&localStorage.removeItem(I)}});return g(v,h),v}function kh(h,S){var v=this;h=A(h);var T=v.ready().then(function(){var C=v._dbInfo,I=localStorage.getItem(C.keyPrefix+h);return I&&(I=C.serializer.deserialize(I)),I});return g(T,S),T}function Mh(h,S){var v=this,T=v.ready().then(function(){for(var C=v._dbInfo,I=C.keyPrefix,L=I.length,k=localStorage.length,F=1,H=0;H<k;H++){var W=localStorage.key(H);if(W.indexOf(I)===0){var q=localStorage.getItem(W);if(q&&(q=C.serializer.deserialize(q)),q=h(q,W.substring(L),F++),q!==void 0)return q}}});return g(T,S),T}function Fh(h,S){var v=this,T=v.ready().then(function(){var C=v._dbInfo,I;try{I=localStorage.key(h)}catch{I=null}return I&&(I=I.substring(C.keyPrefix.length)),I});return g(T,S),T}function Hh(h){var S=this,v=S.ready().then(function(){for(var T=S._dbInfo,C=localStorage.length,I=[],L=0;L<C;L++){var k=localStorage.key(L);k.indexOf(T.keyPrefix)===0&&I.push(k.substring(T.keyPrefix.length))}return I});return g(v,h),v}function $h(h){var S=this,v=S.keys().then(function(T){return T.length});return g(v,h),v}function jh(h,S){var v=this;h=A(h);var T=v.ready().then(function(){var C=v._dbInfo;localStorage.removeItem(C.keyPrefix+h)});return g(T,S),T}function Wh(h,S,v){var T=this;h=A(h);var C=T.ready().then(function(){S===void 0&&(S=null);var I=S;return new d(function(L,k){var F=T._dbInfo;F.serializer.serialize(S,function(H,W){if(W)k(W);else try{localStorage.setItem(F.keyPrefix+h,H),L(I)}catch(q){(q.name==="QuotaExceededError"||q.name==="NS_ERROR_DOM_QUOTA_REACHED")&&k(q),k(q)}})})});return g(C,v),C}function Gh(h,S){if(S=O.apply(this,arguments),h=typeof h!="function"&&h||{},!h.name){var v=this.config();h.name=h.name||v.name,h.storeName=h.storeName||v.storeName}var T=this,C;return h.name?C=new d(function(I){h.storeName?I(tp(h,T._defaultConfig)):I(h.name+"/")}).then(function(I){for(var L=localStorage.length-1;L>=0;L--){var k=localStorage.key(L);k.indexOf(I)===0&&localStorage.removeItem(k)}}):C=d.reject("Invalid arguments"),g(C,S),C}var Vh={_driver:"localStorageWrapper",_initStorage:Bh,_support:Oh(),iterate:Mh,getItem:kh,setItem:Wh,removeItem:jh,clear:Uh,length:$h,key:Fh,keys:Hh,dropInstance:Gh},Yh=function(S,v){return S===v||typeof S=="number"&&typeof v=="number"&&isNaN(S)&&isNaN(v)},zh=function(S,v){for(var T=S.length,C=0;C<T;){if(Yh(S[C],v))return!0;C++}return!1},rp=Array.isArray||function(h){return Object.prototype.toString.call(h)==="[object Array]"},Vi={},np={},Wn={INDEXEDDB:Wi,WEBSQL:Nh,LOCALSTORAGE:Vh},qh=[Wn.INDEXEDDB._driver,Wn.WEBSQL._driver,Wn.LOCALSTORAGE._driver],Vo=["dropInstance"],bc=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Vo),Kh={description:"",driver:qh.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Jh(h,S){h[S]=function(){var v=arguments;return h.ready().then(function(){return h[S].apply(h,v)})}}function Ic(){for(var h=1;h<arguments.length;h++){var S=arguments[h];if(S)for(var v in S)S.hasOwnProperty(v)&&(rp(S[v])?arguments[0][v]=S[v].slice():arguments[0][v]=S[v])}return arguments[0]}var Xh=function(){function h(S){a(this,h);for(var v in Wn)if(Wn.hasOwnProperty(v)){var T=Wn[v],C=T._driver;this[v]=C,Vi[C]||this.defineDriver(T)}this._defaultConfig=Ic({},Kh),this._config=Ic({},this._defaultConfig,S),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return h.prototype.config=function(v){if((typeof v>"u"?"undefined":s(v))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var T in v){if(T==="storeName"&&(v[T]=v[T].replace(/\W/g,"_")),T==="version"&&typeof v[T]!="number")return new Error("Database version must be a number.");this._config[T]=v[T]}return"driver"in v&&v.driver?this.setDriver(this._config.driver):!0}else return typeof v=="string"?this._config[v]:this._config},h.prototype.defineDriver=function(v,T,C){var I=new d(function(L,k){try{var F=v._driver,H=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!v._driver){k(H);return}for(var W=bc.concat("_initStorage"),q=0,ue=W.length;q<ue;q++){var Ce=W[q],xe=!zh(Vo,Ce);if((xe||v[Ce])&&typeof v[Ce]!="function"){k(H);return}}var qe=function(){for(var Yi=function(eg){return function(){var tg=new Error("Method "+eg+" is not implemented by the current driver"),ip=d.reject(tg);return g(ip,arguments[arguments.length-1]),ip}},Tc=0,Zh=Vo.length;Tc<Zh;Tc++){var Cc=Vo[Tc];v[Cc]||(v[Cc]=Yi(Cc))}};qe();var Ve=function(Yi){Vi[F]&&console.info("Redefining LocalForage driver: "+F),Vi[F]=v,np[F]=Yi,L()};"_support"in v?v._support&&typeof v._support=="function"?v._support().then(Ve,k):Ve(!!v._support):Ve(!0)}catch($t){k($t)}});return E(I,T,C),I},h.prototype.driver=function(){return this._driver||null},h.prototype.getDriver=function(v,T,C){var I=Vi[v]?d.resolve(Vi[v]):d.reject(new Error("Driver not found."));return E(I,T,C),I},h.prototype.getSerializer=function(v){var T=d.resolve(wc);return E(T,v),T},h.prototype.ready=function(v){var T=this,C=T._driverSet.then(function(){return T._ready===null&&(T._ready=T._initDriver()),T._ready});return E(C,v,v),C},h.prototype.setDriver=function(v,T,C){var I=this;rp(v)||(v=[v]);var L=this._getSupportedDrivers(v);function k(){I._config.driver=I.driver()}function F(q){return I._extend(q),k(),I._ready=I._initStorage(I._config),I._ready}function H(q){return function(){var ue=0;function Ce(){for(;ue<q.length;){var xe=q[ue];return ue++,I._dbInfo=null,I._ready=null,I.getDriver(xe).then(F).catch(Ce)}k();var qe=new Error("No available storage method found.");return I._driverSet=d.reject(qe),I._driverSet}return Ce()}}var W=this._driverSet!==null?this._driverSet.catch(function(){return d.resolve()}):d.resolve();return this._driverSet=W.then(function(){var q=L[0];return I._dbInfo=null,I._ready=null,I.getDriver(q).then(function(ue){I._driver=ue._driver,k(),I._wrapLibraryMethodsWithReady(),I._initDriver=H(L)})}).catch(function(){k();var q=new Error("No available storage method found.");return I._driverSet=d.reject(q),I._driverSet}),E(this._driverSet,T,C),this._driverSet},h.prototype.supports=function(v){return!!np[v]},h.prototype._extend=function(v){Ic(this,v)},h.prototype._getSupportedDrivers=function(v){for(var T=[],C=0,I=v.length;C<I;C++){var L=v[C];this.supports(L)&&T.push(L)}return T},h.prototype._wrapLibraryMethodsWithReady=function(){for(var v=0,T=bc.length;v<T;v++)Jh(this,bc[v])},h.prototype.createInstance=function(v){return new h(v)},h}(),Qh=new Xh;i.exports=Qh},{3:3}]},{},[4])(4)})});var ei=ur(Zn=>{"use strict";var $g=Zn&&Zn.__awaiter||function(t,e,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function a(p){try{m(n.next(p))}catch(f){s(f)}}function c(p){try{m(n.throw(p))}catch(f){s(f)}}function m(p){p.done?o(p.value):i(p.value).then(a,c)}m((n=n.apply(t,e||[])).next())})};Object.defineProperty(Zn,"__esModule",{value:!0});Zn.JSUtils=void 0;var ss=class{static isObject(e){return typeof e=="object"&&!Array.isArray(e)&&e!==null}static parseToAny(e){try{return JSON.parse(e.toString())}catch{}return e.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(e.toString()):e}static sleep(e){return $g(this,void 0,void 0,function*(){return new Promise(r=>setTimeout(r,e))})}static hasKeys(e){return e?Object.keys(e).length>=1:!1}static convertObjectToArray(e,r){return r.reduce((n,i)=>(e.hasOwnProperty(i)&&e[i]!=null&&n.push({[i]:e[i]}),n),[])}static removeNullUndefinedKeys(e){return Object.keys(e).reduce((r,n)=>(e[n]!==null&&e[n]!==void 0&&(r[n]=e[n]),r),{})}static stringify(e){return JSON.stringify(e,function(r,n){return n===void 0?null:n})}};Zn.JSUtils=ss;ss.ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/)});var ku=ur(ya=>{"use strict";Object.defineProperty(ya,"__esModule",{value:!0});ya.URLBuilder=void 0;var vE=function(){function t(e){try{this.base=new URL(e),this.params=new URLSearchParams(this.base.search.slice(1))}catch(r){console.error("Un-parsable URL",r)}}return t.prototype.appendQueryParam=function(e,r){this.params.append(e,r?r.toString():"")},t.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},t.prototype.deleteQueryParam=function(e){this.params.delete(e)},t.prototype.getBase=function(){return this.base},t.prototype.getPath=function(){return this.base.pathname},t.prototype.getHostname=function(){return this.base.hostname},t.prototype.getParams=function(){return this.params},t.prototype.getQueryParam=function(e){if(!this.params)return"";var r=this.params.get(e);return!r||r==="undefined"||r==="null"?void 0:r},t.prototype.getQueryString=function(){return this.params.toString()},t.prototype.setPath=function(e){return this.base.pathname=e,this},t.prototype.setQueryParam=function(e,r){return this.params.set(e,r?r.toString():""),this},t.prototype.setQueryString=function(e){if(e)return e[0]==="?"&&(e=e.slice(1)),this.params=new URLSearchParams(e),this},t.prototype.toString=function(){var e=this.params.toString();return e===""?this.base.search="":this.base.search="?"+e,this.base.toString()},t}();ya.URLBuilder=vE});var th=ur((Ju,Xu)=>{"use strict";(function(t,e){typeof Ju=="object"&&typeof Xu<"u"?Xu.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.fetchRetry=e())})(Ju,function(){"use strict";var t=function(n,i){if(i=i||{},typeof n!="function")throw new r("fetch must be a function");if(typeof i!="object")throw new r("defaults must be an object");if(i.retries!==void 0&&!e(i.retries))throw new r("retries must be a positive integer");if(i.retryDelay!==void 0&&!e(i.retryDelay)&&typeof i.retryDelay!="function")throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(i.retryOn!==void 0&&!Array.isArray(i.retryOn)&&typeof i.retryOn!="function")throw new r("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(a,c){var m=i.retries,p=i.retryDelay,f=i.retryOn;if(c&&c.retries!==void 0)if(e(c.retries))m=c.retries;else throw new r("retries must be a positive integer");if(c&&c.retryDelay!==void 0)if(e(c.retryDelay)||typeof c.retryDelay=="function")p=c.retryDelay;else throw new r("retryDelay must be a positive integer or a function returning a positive integer");if(c&&c.retryOn)if(Array.isArray(c.retryOn)||typeof c.retryOn=="function")f=c.retryOn;else throw new r("retryOn property expects an array or function");return new Promise(function(d,g){var E=function(O){var D=typeof Request<"u"&&a instanceof Request?a.clone():a;n(D,c).then(function(R){if(Array.isArray(f)&&f.indexOf(R.status)===-1)d(R);else if(typeof f=="function")try{return Promise.resolve(f(O,null,R)).then(function(P){P?A(O,null,R):d(R)}).catch(g)}catch(P){g(P)}else O<m?A(O,null,R):d(R)}).catch(function(R){if(typeof f=="function")try{Promise.resolve(f(O,R,null)).then(function(P){P?A(O,R,null):g(R)}).catch(function(P){g(P)})}catch(P){g(P)}else O<m?A(O,R,null):g(R)})};function A(O,D,R){var P=typeof p=="function"?p(O,D,R):p;setTimeout(function(){E(++O)},P)}E(0)})}};function e(n){return Number.isInteger(n)&&n>=0}function r(n){this.name="ArgumentError",this.message=n}return t})});var cp="9.4.1";var N=class t{static SDK_VERSION=cp;static SDK_VERSION_CODE;static SDK="WEB";static LOG_PREFIX="CooeeSDK";static COOEE="cooee";static SESSION_STORAGE_SCROLL_ID="sleid";static IDLE_TIME_IN_SECONDS=30*60;static IN_APP_WRAPPER_NAME="cooee-wrapper";static IN_APP_CONTAINER_NAME="cooee-container";static IN_APP_DEFAULT_PADDING=15;static EVENT_SCREEN_VIEW="CE Screen View";static EVENT_APP_BACKGROUND="CE App Background";static EVENT_TRIGGER_DISPLAYED="CE Trigger Displayed";static EVENT_CAMPAIGN_HOLDOUT="CE Campaign Holdout";static EVENT_CAMPAIGN_REJECTED="CE Campaign Rejected";static EVENT_CAMPAIGN_FAILED="CE Campaign Failed";static EVENT_TRIGGER_CLOSED="CE Trigger Closed";static EVENT_SCROLL="CE Scroll";static EVENT_TRIGGER_CLICKED="CE Trigger Clicked";static EVENT_FORM_SUBMITTED="CE Form Submitted";static EVENT_ADD_TO_CART="Add To Cart";static EVENT_REMOVE_FROM_CART="Remove From Cart";static EVENT_VIEW_ITEM="View Item";static EVENT_VIEW_CART="View Cart";static EVENT_VIEW_COLLECTION="View Collection";static EVENT_BUY_NOW_CLICKED="Buy Now Clicked";static EVENT_CHECKOUT_STARTED="Checkout Started";static EVENT_REVIEW_CLICKED="Review Clicked";static EVENT_ITEM_THUMBNAIL_CLICKED="Item Thumbnail Clicked";static JS_LOAD_WHITELIST_EVENTS=[this.EVENT_VIEW_ITEM,this.EVENT_VIEW_CART,this.EVENT_VIEW_COLLECTION];static HASH_INITIATE_CHECKOUT="initiate-checkout";static HASH_OPEN_CART_DRAWER="open-cart-drawer";static CTA_EVENT="letscooee:outbound:cta";static ADD_BUNDLE_CTA_INBOUND_EVENT="letscooee:inbound:cta:add-bundle";static CTA_OPEN_CART_EVENT="letscooee:outbound:open-cart";static CTA_AFTER_REFRESH_UI="letscooee:outbound:refresh-ui";static POPUP_ACTIVITY_EVENT="letscooee:outbound:popup-activities";static THIRD_PARTY_CHECKOUT_EVENT="letscooee:outbound:third-party-initiate-checkout";static CAMPAIGN_DISPLAYED_ACTIVITY="DISPLAYED";static CAMPAIGN_CLICKED_ACTIVITY="CLICKED";static CAMPAIGN_CLOSED_ACTIVITY="CLOSED";static BLACKLISTED_PAGE_NAMES=["collection","product","cart"];static API_CALL_MAX_ATTEMPTS=3;static API_CALL_RETRY_DELAY=1e3;static PLACEHOLDER_IMAGE="https://cdn.global.letscooee.com/images/placeholders/product.png";static CART_UPDATE_BROADCAST="CART_UPDATE";static GRAPHQL_VERSION="2024-10";static GRAPHQL_API_PATH=`/api/${this.GRAPHQL_VERSION}/graphql.json`;static SHADOW_SPLITTER=":shadow";static CAMPAIGN_ATTRIBUTE="_letscooee_campaign";static CONTENT_ATTRIBUTE="_letscooee_content";static VIA="_via";static PAYMENT_MODAL_DETAILS=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}];static{let e=t.SDK_VERSION.split(".").map(r=>r.padStart(2,"0")).join("");t.SDK_VERSION_CODE=parseInt(e,10)}};var Ct={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",styleURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.css`,widgetURL:`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${N.SDK_VERSION}/dist/widget.min.js`};var Ot=Se(nn());var b=class{static log(...e){Ot.default.info(...e)}static debug(...e){Ot.default.debug(...e)}static error(...e){Ot.default.error(...e)}static warn(...e){Ot.default.warn(...e)}static info(...e){Ot.default.info(...e)}static trace(...e){Ot.default.trace(...e)}static configure(e=N.LOG_PREFIX){Ot.default.useDefaults({formatter:function(n){n.unshift(`${e} (v${N.SDK_VERSION}):`)}});let r=this.getDebugParam();(r==="1"||r==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Ot.default.setLevel(Ot.default[localStorage.cooeeLogLevel]):Ot.default.setLevel(Ct.debug?Ot.default.TRACE:Ot.default.OFF)}static getDebugParam(){return new URL(location.href).searchParams?.get("cooee-debug")}static logBrand(){let e=`
2
2
  display: inline-block;
3
3
  font-size: 14px;
4
4
  background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
@@ -67,4 +67,4 @@ mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
67
67
  <span class="${n}"
68
68
  style="background-color: ${e.pagination.color?.rgba};">
69
69
  </span>
70
- `},navigation:{nextEl:t.querySelector(".swiper-button-next"),prevEl:t.querySelector(".swiper-button-prev")},autoplay:e.autoplay?.enabled?{delay:e.autoplay?.delay,disableOnInteraction:!1}:!1,autoHeight:!0});return t.style.setProperty("--swiper-navigation-size",`${e.navigation.size}px`),r}function ac(t,e,r){let n={color:t.navigation.color?.rgba};return t.pagination.enabled&&(n.transform="translateY(-25%)"),$("div",{class:"swiper-container",ref:e,children:[$("div",{class:"swiper-wrapper",children:r()}),t.navigation.enabled&&$("div",{class:"swiper-button-next",style:n,children:$("span",{})}),t.navigation.enabled&&$("div",{class:"swiper-button-prev",style:n,children:$("span",{})}),t.pagination.enabled&&$("div",{className:"swiper-pagination",style:{bottom:0,top:"unset",position:"relative",color:t.pagination.color?.rgba}})]})}var Ho=class extends Ae{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,r){super(e,r),this.configuration=this.renderer.isMobile()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+"px"}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&oc().then(()=>{this.swiperInstance=sc(this.swiperRef,this.props.element.conf[this.deviceTypeKey])})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let r;if(this.configuration.disp===2){let n=o=>{this.swiperRef=o},i=()=>e?.map(o=>$("div",{class:"swiper-slide",children:this.getProductFragment(o)}));r=$("div",{style:ee(w({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:ac(this.configuration,n,i)})}else r=$("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((n,i)=>this.getProductFragment(n,i!==e.length-1))});return r}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),r={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(r.flexDirection==="row"){if(e)r.maxWidth="100%",r.overflowY="auto";else if(this.configuration.disp===1){let n=this.props.triggerContext.triggerData,i=n.items.length,o;n.isBundle()?o=this.props.element.prod.symbol?.hide!==!0?i*2-1:i:o=this.props.element.conf[this.deviceTypeKey].maxInRow,r.gridTemplateColumns=`repeat(${o}, auto)`}}return r}getProductFragment(e,r=!1){return $(fr,{children:[$(kn,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&r&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&$("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:$(Ft,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var $o=class extends Ae{swiperRef=null;swiperInstance=null;constructor(e,r){super(e,r)}componentDidMount(){oc().then(()=>{this.swiperInstance=sc(this.swiperRef,this.props.element.conf)})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.element,r=i=>{this.swiperRef=i},n=()=>e.values?.map(i=>$("div",{class:"swiper-slide",onClick:()=>this.onClick({clickAction:this.getClickAction(i)}),children:this.renderElement(i)}));return ac(e.conf,r,n)}getComponentStyles(){return{}}renderElement(e){let r=this.valueAddedSlide(this.props.element.slide,e);switch(r?.t){case 1:return $(Mr,{element:r,triggerContext:this.props.triggerContext});case 4:return $(Fr,{elements:r.elems,element:r,triggerContext:this.props.triggerContext});default:b.warn("Unknown slide type for carousal")}}valueAddedSlide(e,r){let n=JSON.stringify(e),i=vt.render(n,{form:r});return kt.getParsedElement(JSON.parse(i))}getClickAction(e){let r=w({},this.props.element.clc),n=JSON.stringify(r),i=vt.render(n,{form:e});return JSON.parse(i)}};var tn=class extends Ae{constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"})),at(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}))})}renderElement(e){if(!e.hide){if(e.t===4){let r=e;return $(Fr,{element:r,triggerContext:this.props.triggerContext,elements:r.elems})}if(e.t===61)return $(Lo,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?$(Un,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return $(Ft,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return $(Mr,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return $(Ho,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return $(kn,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return $($o,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}};var jo=class extends Ae{clickAction;isClickable;constructor(e,r){super(e,r),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===4&&this.clickAction.gu?.u}componentDidMount(){at(()=>{let e=this.props.triggerContext.triggerData,r=this.props.triggerContext.selectedItems;e.calculateDiscountData(r,this.props.triggerContext.shouldGiveFBTDiscount)})}render(){return $(fr,{children:[$("div",{style:this.getCompiledStyles(),class:"lc-container",onClick:()=>{this.onClick({clickAction:this.clickAction})},children:$(tn,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id==="preview"&&$("div",{class:"letscooee-preview-badge",children:["#",this.props.triggerContext.triggerData.shortID," preview"]})]})}getComponentStyles(){let e={position:"relative",overflow:"hidden",display:"block"};return this.isClickable&&(e.cursor="pointer"),e}async onClick(e){if(this.isClickable)return super.onClick(e)}};var At=class t{constructor(e){this.engagementTrigger=e;this.triggerContext=new Pi(new Date,this.engagementTrigger)}static renderedEngagements=[];static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];runtimeData=le.get();widgetAPIService=pe.get(cr);safeHTTPService=pe.get(fe);scrollSubscription;variation;isExclusionWithBVariation;renderSilently(){this.render().catch(e=>Be.getInstance().captureException(e,w({},this.engagementTrigger.sentryContext())))}destroy(){b.log(`${this.engagementTrigger} will be destroyed`),this.scrollSubscription?.unsubscribe(),this.observers.forEach(e=>{e?.disconnect&&e.disconnect()}),this.rootContainer?.remove(),t.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID)}async render(){if(this.engagementTrigger.hasMultiplePlacement){let e=await this.getVariation();this.handleVariationResponse(e)}if(this.rootContainer=await this.getWidgetContainer(!0),!this.rootContainer){b.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.widget=this.engagementTrigger.widget,await this.getVariationIfRequired(),!this.shouldStopRendering()&&(await this.startRendering(),this.attachScroll(),await this.checkAndSendEvent(),this.triggerContext.renderer=this)}isSameTrigger(e){return this.engagementTrigger.shortID===e.shortID}update(e){mh.default.log(`${this.engagementTrigger} will be updated`),this.updateItems(e.items,this.engagementTrigger.items)}shouldStopRendering(){return!this.widget&&!this.isExclusionWithBVariation}async getVariationIfRequired(){if(this.engagementTrigger.isSingleContent()||this.engagementTrigger.widget){b.log(`${this.engagementTrigger} already has required data to render widget`);return}let e=await this.observeWidgetContainerInViewport();this.handleVariationResponse(e)}handleVariationResponse(e){e&&(b.log(`${this.engagementTrigger} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(this.engagementTrigger.items=e.items.map(r=>new Dt(r)),this.engagementTrigger.nonMutableItems=e.items.map(r=>new Dt(r))),e.bundleFrom&&(this.engagementTrigger.bundleFrom=new Dt(e.bundleFrom)),e.discount&&(this.engagementTrigger.discount=e.discount),e.placement&&(this.triggerContext.triggerData.placement=e.placement),e.props&&fh.JSUtils.hasKeys(e.props)&&(this.engagementTrigger.props=w(w({},this.engagementTrigger.props),e.props)),this.triggerContext.triggerData.widget=this.widget=new Si(e.widget),this.triggerContext.triggerData.contentID=e.contentID,this.triggerContext.triggerData.variation=this.variation=e.variation,this.triggerContext.triggerData.placement=e.placement,this.triggerContext.triggerData.manipulation=e.manipulation,this.isExclusionWithBVariation=this.engagementTrigger.isExclusionTesting()&&this.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px"))}addToRendered(){t.renderedEngagements.push(this)}async getVariation(){b.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id==="preview"};try{return await this.widgetAPIService.getVariation(e)}catch(r){b.error(`${this.engagementTrigger} unable to get the variation`,r);return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){b.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let e=window.innerHeight*.3,r={root:null,rootMargin:`-${e}px 0px ${e}px 0px`,threshold:0};return await this.isInViewport()?this.getVariation():new Promise(n=>{let i=new IntersectionObserver((o,s)=>{o.forEach(async a=>{if(a.isIntersecting){b.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);let c=await this.getVariation();n(c),s.unobserve(this.rootContainer)}})},r);i.observe(this.rootContainer),this.observers.push(i)})}attachScroll(){this.scrollSubscription=On(window,"scroll").pipe(ar(t.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(t.engagementIDsWithTrackedDisplay.has(e)||!await this.isInViewport())return;let n={};this.triggerContext.triggerData.items?.length&&(n.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let i=this.isExclusionWithBVariation?N.EVENT_CAMPAIGN_HOLDOUT:N.EVENT_TRIGGER_DISPLAYED,o=new _e(i,n,this.engagementTrigger);o.name===N.EVENT_CAMPAIGN_HOLDOUT&&(o.trigger.holdout=!0),this.safeHTTPService.sendEvent(o),t.engagementIDsWithTrackedDisplay.add(e),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}async isInViewport(){let e=(await this.getWidgetContainer())?.getBoundingClientRect();if(!e)return!1;let r=window.innerHeight||document.documentElement.clientHeight,i=(Math.min(e.bottom,r)-Math.max(e.top,0))*e.width,o=e.width*e.height,s=i/o*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(e);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(e){let r=this.engagementTrigger.placement;if(!r?.selector)return b.warn(`${this.engagementTrigger} does not have a selector`),null;let n=r.selector,i;if(n.includes(N.SHADOW_SPLITTER)){let c=n.split(N.SHADOW_SPLITTER);i=(await te.retrySelector(c[0].trim()))?.shadowRoot,n=c[1].trim(),i&&Rt.injectStylesheet(Ct.styleURL,i);let m=Le.get().website.commonCSS;i&&m&&Rt.injectRawCSS(m,i)}b.debug(`${this.engagementTrigger} attempt to render ${r.position}-${n}`);let o=await te.retrySelector(n,10,i??document);if(!o)return b.warn(`${this.engagementTrigger} no placement found with ${n}`),null;let s=this.generateParentElementID(),a=this.getParentElement(s);if(!e)return a;switch(r.position){case Wo.EngagementPlacementPosition.BEFORE:{o.parentElement?.insertBefore(a,o);break}case Wo.EngagementPlacementPosition.INSIDE_FIRST:{o.insertBefore(a,o.firstChild);break}case Wo.EngagementPlacementPosition.INSIDE_LAST:{o.appendChild(a);break}case Wo.EngagementPlacementPosition.AFTER:default:o.parentElement?.insertBefore(a,o.nextSibling)}return a}async startRendering(){let e;try{e=await ki.refreshItems(this.engagementTrigger)}catch(r){b.error(`${this.engagementTrigger} error refreshing the items`,r);return}if(!e?.length&&this.engagementTrigger.isProductPromoted()){b.warn(`${this.engagementTrigger} is of ${this.engagementTrigger.objective} but no product found`);return}this.engagementTrigger.items=e,this.renderContainer()}getParentElement(e,r=document){let n=r.getElementById(e);if(n)return n;let i=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=e,n.className=`letscooee letscooee-engagement engagement-${i}`,n.dataset.engagementId=i,this.engagementTrigger.id==="preview"&&(n.className+=" letscooee-preview"),n.style.display="block",n.style.minHeight="0.5px",n.style.minWidth="0.5px",n}renderContainer(){if(!this.widget)return;let e=this.rootContainer;if(this.triggerContext.triggerData.hasSwiperElement()){let n=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),i=Le.get().website.commonCSS;i&&Rt.injectRawCSS(i,n),Rt.injectStylesheet(Ct.styleURL,n),Rt.injectStylesheet("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",n),e=n}tf(Mc(jo,{element:this.widget.cont,triggerContext:this.triggerContext,elements:this.widget.elems}),e),this.addToRendered()}updateItems(e,r){let n=this.getItemDiff(e,r),i=this.getItemDiff(r,e);r.push(...n);for(let o of i)ph.ArrayUtils.remove(r,o)}getItemDiff(e,r){return e.filter(n=>!r.some(i=>i.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}};var Dr=class t extends At{static renderedEngagements=[];constructor(e){super(e)}addToRendered(){t.renderedEngagements.push(this)}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}async checkAndSendEvent(){if(!ze.get().isOpen()&&this.runtimeData.pageName!=="cart"){b.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}};var cc=class t{constructor(e,r){this.engagementTrigger=e;this.element=r;this.cartItems=de.getCurrent().items}cartItems;static renderCartUpsell(e){let r=e.placement;if(!r?.selector){b.warn(`No placement available for ${e.objective}`,e.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){b.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let i of n)new t(e,i).render()}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(p=>p.mID===e.product_id.toString());if(!r)return;let n=r.vars.find(p=>p.mID===e.id.toString());if(!n)return;let i=new Sr(n),o=e.selling_plan_allocation?.selling_plan;if(o)for(let p of i.sellingPlans??[])p.mID===o.id.toString()&&(p.isSelected=!0,i.changeSellingPlan(p));let s=new Dt(r);s.vars=[i],s.selectedOrFirstVariant.value=i;let a=`lc-cart-item-${this.engagementTrigger.shortID}-${r.mID}`;this.element.classList.add(a);let c=new Mt(this.engagementTrigger);c.placement.selector=`.${a}`,c.items=[s];let m=new Dr(c);m.renderSilently(),this.watchForCartItemDeletion(m,a)}watchForCartItemDeletion(e,r){let n=new MutationObserver(i=>{i.forEach(o=>{o.removedNodes.forEach(s=>{s===this.element&&(b.debug(`${r} has been removed`),e.destroy(),n.disconnect())})})});n.observe(this.element.parentElement,{childList:!0,subtree:!0})}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(r=>{if(!(e.includes(r.url)||e.includes(r.variant_id))&&(!e.includes(r.product_title)||r.variant_title&&!e.includes(r.variant_title)))return!1;let n=r.selling_plan_allocation?.selling_plan?.name;return!(n&&!e.includes(n))})}};var dh=Se(Rr());var lc=class extends Dr{ctaListener=new Zr;constructor(e){super(e),xr.get().subscriber(N.CART_UPDATE_BROADCAST).pipe(Yu(null)).subscribe(this.checkMilestone.bind(this))}update(e){super.update(e),this.widgetElement.update()}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-progressbar");e.className="cooee-root",e.cart=de.getCurrent(),e.engagementTrigger=this.engagementTrigger,e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}async checkMilestone(){let e=await de.getCurrent().getNormalisedCart(),i=[...this.engagementTrigger.progressBarConfig.milestones].reverse().find(o=>o.minValue<e.amount);if(!i){b.log("No milestone achieved yet");return}if(b.log("Current milestone",i),i.rewardType===dh.MilestoneRewardType.FREE_AUTO_GIFT){let o=i.items[0];if(e.items.find(a=>a.vID===o.vID||a.mID===o.mID)){b.log(`Item(vID:${o.vID}) already present in the cart. Updating item's properties`),await this.ctaListener.performUpdate(o,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});return}else{let a=await this.ctaListener.performAddToCart([o],this.engagementTrigger);ze.get().refreshUI(a,!1),await this.removeOtherFreeGifts(o)}}}async removeOtherFreeGifts(e){let n=(await de.getCurrent().getNormalisedCart()).items.filter(i=>i.vID!==e?.vID&&i.properties[N.CAMPAIGN_ATTRIBUTE]===this.engagementTrigger.shortID);if(n.length)for(let i of n)await this.ctaListener.performUpdate(i,{quantity:0})}};var hh=Se(Rr()),uc=class extends At{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-shoppable-videos");e.className="cooee-root",e.items=this.triggerContext.triggerData.items,e.engagementTrigger=this.engagementTrigger,e.addEventListener("triggerClicked",r=>{let n=r.detail;this.safeHTTPService.sendEvent(n)}),e.addEventListener("performCTA",async r=>{let n={at:hh.ClickActionType.ADD_TO_CART,applyDiscount:!0},i=r.detail;await new en(this.triggerContext).execute({clickAction:n,item:i})}),e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}};var gh=Se(ei());var pc=class extends At{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(N.ADD_BUNDLE_CTA_INBOUND_EVENT,this.inboundCTAListener.bind(this),!1)}async inboundCTAListener(e){let r=this.engagementTrigger,n=`Engagement(id: ${r.engagementID}, shortID: ${r.shortID})`,i=e.detail;if(!gh.JSUtils.hasKeys(i)){b.error(`No detail received for ${n}`);return}b.log("Detail received for BYOB",i);let o=i.campaignID??i.campaignId??i.campaign_id;if(o!==r.shortID&&o!==r.engagementID){b.warn(`Current ${n} is not BYOB. Received: ${o}`);return}let s=i.items;if(!s?.length)return;let a=s.map(c=>new xt({mID:c.product_id,vID:c.variant_id,quantity:c.quantity||1}));await new en(this.triggerContext).execute({embeddedItems:a,clickAction:{at:108,applyDiscount:!0}})}};var Fi=class{runtimeData=le.get();processCartWidgetResponse(e){this.runtimeData.isCartDirty=!1,this.runtimeData.cartEngagements=e;let r=[...Dr.renderedEngagements];Dr.renderedEngagements.length=0;for(let n of e)b.log(`\u{1F4E3} ${n} received as cart embed`),!this.findAndUpdateCurrent(n,r)&&(b.log(`${n} is new`),n.isProgressBar()?new lc(n).renderSilently():n.isSubscriptionUpsell()?cc.renderCartUpsell(n):new Dr(n).renderSilently());this.removeOldWidgets(r)}processPageWidgetResponse(e){let r=[...At.renderedEngagements];At.renderedEngagements.length=0;for(let n of e)b.log(`\u{1F4E3} ${n} received as page embed`),!this.findAndUpdateCurrent(n,r)&&(b.log(`${n} is new`),n.isShoppableVideo()?new uc(n).renderSilently():n.isBYOB()?new pc(n).renderSilently():new At(n).renderSilently());this.removeOldWidgets(r)}findAndUpdateCurrent(e,r){let n=r.findIndex(i=>i.isSameTrigger(e));return n<0||e.isSubscriptionUpsell()?!1:(r[n].update(e),r[n].renderSilently(),r.splice(n,1),!0)}removeOldWidgets(e){for(let r of e)r.destroy()}};var cr=class t{static INSTANCE;httpService=pe.get(mt);sessionManager=pe.get(st);runtimeData=le.get();loadWidgetsSubject=new It;constructor(){this.loadWidgetsSubject.pipe(ar(300)).subscribe(()=>{this.loadCartWidgets().catch(e=>b.error("Unable to initiate cart widgets",e)),this.loadPageWidgets().catch(e=>b.error("Unable to initiate page widgets",e))}),xr.get().subscriber(N.CART_UPDATE_BROADCAST).subscribe(()=>this.loadWidgetsSubject.next())}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}loadOrRenderWidgetsAfterCartChange(){this.runtimeData.isCartDirty?this.loadWidgetsSilently():this.renderCachedCartWidgets()}loadPageWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadPageWidgets().catch(e=>b.error("Unable to initiate load page widgets",e))})}loadCartWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadCartWidgets().catch(e=>b.error("Unable to initiate cart widgets",e))})}loadWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadWidgetsSubject.next()})}async loadPageWidgets(){let e=await this.getWidgetProps();b.log("Load widgets",e),this.httpService.post("/v1/engagement/page-widgets",e).then(async r=>{let n=r.widgets.map(i=>new Mt(i));new Fi().processPageWidgetResponse(n)}).catch(r=>{b.error("Error sending widget getter",r)})}async loadCartWidgets(){let e=await this.getWidgetProps();b.log("Load cart widgets",e),this.httpService.post("/v1/engagement/cart-widgets",e).then(async r=>{let n=r.widgets.map(i=>new Mt(i));new Fi().processCartWidgetResponse(n)}).catch(r=>{b.error("Error sending widget getter",r)})}async getVariation(e){let r=await this.getWidgetProps();return this.httpService.post("/v1/engagement/get-variant",w(w({},e),r))}renderCachedCartWidgets(){new Fi().processCartWidgetResponse(this.runtimeData.cartEngagements)}async addSessionContext(e){let r=await this.sessionManager.checkSessionAndGetContext();e.sessionID=r[0],e.sessionNumber=r[1],e.landingPage=r[2],e.page=Tr.parseFromCurrent()}addAvailableEngagementShortIDs(){let e=document.querySelectorAll(".letscooee-engagement"),r=[];return e.forEach(n=>{let i=n.dataset.engagementId;i&&+i&&r.push(i)}),r}async getWidgetProps(){let e={};e.engagementIDs=this.addAvailableEngagementShortIDs(),e.locale=this.runtimeData.locale,await this.addSessionContext(e),e.currentItem=this.runtimeData.getCurrentItem();try{e.cart=await de.getCurrent().getNormalisedCart()}catch(o){b.error("Error fetching Shopify cart before sending widget call",o)}let r=new URLSearchParams(location.search),n=r.get("cooee-preview");n?e.previewIDs=n.trim().split(",").filter(o=>Number.isInteger(+o)):this.runtimeData.previewIDs?.length&&(e.previewIDs=this.runtimeData.previewIDs);let i=r.get("cooee-variant");return i?e.previewVariant=i:this.runtimeData.previewVariant&&(e.previewVariant=this.runtimeData.previewVariant),e}};var fc=class{runtimeData=le.get();widgetAPIService=pe.get(cr);meddle(){let e=be.globalRef;e.account=e.account??[],e.profile=e.profile??[],e.events=e.events??[],e.screen=e.screen??[],e.page=e.page??[],this.meddlePage(),this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.meddleScreen(),this.exposeMethods()}exposeMethods(){let e=be.globalRef;e.loadPageWidgets=()=>{this.widgetAPIService.loadPageWidgetsSilently()},e.loadCartWidgets=()=>{this.widgetAPIService.loadCartWidgetsSilently()},e.previewWidget=be.previewWidget.bind(be),e.previewPopup=be.previewPopup.bind(be)}overwritePush(e,r){li(e,"push",r)}meddleAccount(){this.overwritePush(be.globalRef.account,(...e)=>{this.processAccount(e[0])}),be.globalRef.account.forEach(this.processAccount.bind(this))}meddleEvents(){this.overwritePush(be.globalRef.events,(...e)=>{this.processEvent(e[0])}),be.globalRef.events.forEach(this.processEvent.bind(this))}meddleProfile(){this.overwritePush(be.globalRef.profile,(...e)=>{this.processProfile(e[0])}),be.globalRef.profile.forEach(this.processProfile.bind(this))}meddleScreen(){this.overwritePush(be.globalRef.screen,(...e)=>{this.processPageName(e[0])}),be.globalRef.screen.forEach(this.processPageName.bind(this))}processAccount(e){e&&(e.appID&&be.authenticate(e),e.flags&&Ln.setFlags(e.flags))}processEvent(e){e&&(N.JS_LOAD_WHITELIST_EVENTS.includes(e[0])?be.sendEvent(e[0],e[1],this.runtimeData.jsLoadTime):be.sendEvent(e[0],e[1]))}processProfile(e){e&&be.updateProfile(e)}processPageName(e){e&&be.setPageName(e)}meddlePage(){this.overwritePush(be.globalRef.page,(...e)=>{this.processPage(e[0])}),be.globalRef.page.forEach(this.processPage.bind(this))}processPage(e){e.currentItem&&this.runtimeData.setCurrentItem(e.currentItem),e.currency&&(this.runtimeData.currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.pageName&&be.setPageName(e.pageName)}};var Hi=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=N.COOEE.concat("-");static getString(e,r){return this.getItem(e)||r}static setString(e,r){this.setItem(e,r)}static remove(e){this.removeItem(e)}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,r){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),r)}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}};var $i=class t{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=pe.get(fe);_lastScreenOrScroll=new Date;lastPercent=0;constructor(){}set lastScreenOrScroll(e){this._lastScreenOrScroll=e}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}resetScrollID(e){Hi.remove(N.SESSION_STORAGE_SCROLL_ID),this.lastScreenOrScroll=e??new Date}listen(){if(window.scrollY){let e=this.getPercentScrolledY();this.shouldSendScroll(e)&&this.sendScroll(e)}te.onDocumentLoaded(()=>{this.observeWindowScroll()})}observeWindowScroll(){On(window,"scroll").pipe(ar(t.DEBOUNCE_TIME),Nn(()=>{let e=this.getPercentScrolledY();if(e>100){b.warn("Received scroll percent is more than 100",e);return}if(this.shouldSendScroll(e))return e})).subscribe(e=>{this.sendScroll(e)})}shouldSendScroll(e){return Math.abs(this.lastPercent-e)>=t.THRESHOLD||this.lastPercent!==e&&e===100}sendScroll(e){if(e==null)return;let r={percent:e,timeMS:new Date().getTime()-this._lastScreenOrScroll.getTime()};this.lastPercent=e;let n=Hi.getString(N.SESSION_STORAGE_SCROLL_ID,""),i=new _e(N.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),Hi.setString(N.SESSION_STORAGE_SCROLL_ID,i.id.toHexString()),this._lastScreenOrScroll=new Date(i.occurred)}getPercentScrolledY(){let e=window.document.body.scrollHeight,r=window.innerHeight;return Math.ceil((window.scrollY+r)/e*100)}};var mc=class t{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=pe.get(fe);runtimeData=le.get();listen(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?this.onVisible():document.visibilityState==="hidden"&&this.onHidden()}}async onVisible(){}async onHidden(){let e=await this.runtimeData.setInactive();if(e===0){b.info("Not sending background event as user was inactive on website");return}b.info(`Sending background event with ${e} seconds`);let r={};r[t.ACTIVE_DURATION]=e,this.apiService.sendEvent(new _e(N.EVENT_APP_BACKGROUND,r))}};var dc=class{compareCartItemSubject=new It;constructor(){this.compareCartItemSubject.pipe(ar(100)).subscribe(this.compareCartItems.bind(this))}listen(){this.compareCartItemSubject.next(),this.overwriteXMLHttpRequest(),this.overwriteFetchMethod()}overwriteXMLHttpRequest(){let e=this,r=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){e.performEvent(this._url).catch(n=>b.error("Unable to process cart change in XMLHttpRequest",n))}),r.apply(this,arguments)},b.debug("Securely overwritten window.XMLHttpRequest.send method")}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=function(n){return r.apply(window,arguments).then(i=>(e.performEvent(n.toString()).catch(o=>b.error("Unable to process cart change in fetch",o)),i))},b.debug("Securely overwritten window.fetch method")}async performEvent(e){this.isCartManipulationURL(e)&&(le.get().isCartDirty=!0,this.compareCartItemSubject.next())}isCartManipulationURL(e){return/\/cart\/(add|change|update|clear)/.test(e)}sendChangesAsEvents(e,r){let n=e?.items,i=r.items,o=[],s=[];if(b.debug(`Comparing cart change with old count ${n?.length} to new count ${i.length}`),i?.forEach(a=>{let c=n?.find(m=>m.vID===a.vID);if(c){if(c.quantity!==a.quantity){let m=c.quantity<a.quantity,p=Math.abs(c.quantity-a.quantity),f=ee(w({},a),{quantity:p});m?o.push(f):s.push(f)}n&&te.removeFromArray(n,c)}else o.push(a)}),n)for(let a of n)s.push(a);b.debug(`Cart delta: added: ${o.length}, removed: ${s.length}`),o.length&&this.sendEvent(N.EVENT_ADD_TO_CART,{items:o}),s.length&&e.token===r.token&&this.sendEvent(N.EVENT_REMOVE_FROM_CART,{items:s}),(s.length||o.length)&&xr.get().broadcast(N.CART_UPDATE_BROADCAST,{itemsAdded:o,itemsRemoved:s})}sendEvent(e,r){let n=new _e(e,r);pe.get(fe).sendEvent(n)}async compareCartItems(){let e=await Oe.get(oe.CURRENT_CART,{}),r=await de.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,r)}};var hc=class{listen(){return this.overwriteFetchMethod(),this}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=async function(n,i){try{await e.modifyRequest(n,i)}catch(o){Be.getInstance().captureError("Failed to modify graphql request",o,{body:JSON.stringify(i?.body)})}return r(n,i)},b.debug("Securely overwritten window.fetch method for graphql query")}async modifyRequest(e,r){let n=typeof e=="string"?e:e instanceof Request?e.url:"";if(!(n.includes("graphql.json")&&r?.method==="POST")||!r.body)return;let i;if(typeof r.body=="string")try{i=JSON.parse(r.body)}catch{return}else i=r.body;b.debug("Intercepted fetch request of:",n),i?.query.includes("cartCreate")&&(r.body=await this.updatedBody(i),this.sendBuyNowEvent())}async updatedBody(e){let r=e.variables.input.attributes??[],n=await te.getCartAttributes();return e.variables.input.attributes=[...r,...n],JSON.stringify(e)}sendBuyNowEvent(){let e=le.get().getCurrentItem();if(!e)return;let r=new _e(N.EVENT_BUY_NOW_CLICKED,{items:[e]});fe.getInstance().sendEvent(r)}};var ji=class{constructor(e,r){this.selectors=e;this.eventName=r;this.selectorString=e.join(",")}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let r=e.currentTarget,n=new _e(this.eventName,{class:r.className||void 0,tagName:r.tagName||void 0,id:r.id||void 0});fe.getInstance().sendEvent(n),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>b.error(e))}async listen(){this.elements=await te.retrySelectorForElements(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(r=>{r.removeEventListener("click",e)})}};var gc=class t extends ji{static selectors=[".product__thumbnail-list-inner > button","product-gallery-navigation > button",".product-media--thumb-container",".product-images-inner > img",".m-product-media",".swiper-button-control",".media__thumb",".slick-arrow",".productView-img-container.product-single__media",".product-gallery__thumbnail_item_inner"];constructor(){super(t.selectors,N.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var yc=class t extends ji{static selectors=[".jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup","reviewsio-product-ratings",".ruk_rating_snippet.tracked:not(.hidden)","a > .loox-rating",".yotpo-reviews-star-ratings-widget",".yotpo.lp-hero__reviews",".pr-rating > a",".rivyoReviewWidget"];constructor(){super(t.selectors,N.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var vc=class{selector=[".gokwik-checkout button","button.cart__checkout-button","button.cart__checkout","button#checkout","button#checkout2",'button[id*="checkout" i]','button[name*="checkout" i]','button[class*="checkout" i]'].join(",");listen(){te.onDocumentLoaded(()=>{b.debug("Execution order:","document ready"),this.useLocationHash()})}useLocationHash(){let e=window.location.hash?.substring(1);if(e)if(e.includes(N.HASH_INITIATE_CHECKOUT)){document.dispatchEvent(new Event(N.THIRD_PARTY_CHECKOUT_EVENT));let r=document.querySelector(this.selector);if(!r){b.debug("No clickable cart checkout button found");return}b.debug("Clickable cart checkout button found",r),r.click()}else e.includes(N.HASH_OPEN_CART_DRAWER)&&ze.get().open()}};var _c=class{trackSilently(){this.track().catch(e=>Be.getInstance().captureException(e))}async track(){let e=window.Shopify?.checkout,r=window.Shopify?.Checkout;if(!e&&!r)return;let n={};this.processSmallCheckout(e,n),this.processBigCheckout(r,n);let i=this.getTokenFromCurrentURLPath();if(i&&(n.urlToken=i),!Object.keys(n).length){b.warn("No processable data found in",e,r);return}n.referrer=document.referrer,n.url=location.href;let o=await pe.get(st).checkSessionAndGetContext();n.sessionID=o[0],this.trackOrder(n)}processSmallCheckout(e,r){e&&(e.order_id&&(r.orderID=e.order_id.toString()),e.token&&(r.checkoutToken=e.token.toString()),e.customer_id&&(r.customerID=e.customer_id.toString()))}processBigCheckout(e,r){e&&(e.token&&!r.checkoutToken&&(r.checkoutToken=e.token.toString()),e.cartToken&&(r.cartToken=e.cartToken.toString()))}trackOrder(e){b.info("Found order to be send",e),fe.getInstance().trackOrder(e)}getTokenFromCurrentURLPath(){let e=new RegExp("[A-Fa-f0-9]{28,32}");return location.pathname?.split("/").find(r=>r.length&&e.test(r))}};var Go=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await de.getCurrent().getNormalisedCart(),r={via:"GoKwik",items:e.items,cartToken:e.token,amount:{value:e.amount,currency:e.currency}},n=new _e(N.EVENT_CHECKOUT_STARTED,r);fe.getInstance().sendEvent(n)})}};var Ec=class{async migrate(){}};vt.escape=yh.MustacheUtils.escapeHtml;var be=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new Ec().migrate(),this.autoAuthenticate(),new fc().meddle(),new mc().listen(),new _c().trackSilently(),new Zr().listen(),new dc().listen(),new hc().listen(),new vc().listen(),pe.get($i).listen(),pe.get(yc).listenSilently(),pe.get(gc).listenSilently(),pe.get(cr).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),er.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||li(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,li(this.globalRef,"config",new Le),li(this.globalRef,"runtimeData",new le),b.debug("Global reference initialised")}static injectWidgetAssets(){Rt.injectScriptURL(Ct.widgetURL,"cooee-widget-sdk"),Rt.injectStylesheet(Ct.styleURL)}static autoAuthenticate(){let e=Pe.getShopName();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;let r=e.appID?.trim(),n=e.shopifyShop;if((te.isNull(r)||r.length!==24)&&te.isNull(n)){b.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,pe.get(st).init(e)}static sendEvent(e,r,n){for(let o in r)if(o.length>3&&o.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");let i=new _e(e,r);i.occurred=n??new Date,pe.get(fe).sendEvent(i)}static updateProfile(e){for(let r in e)if(r.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");pe.get(fe).updateProfile(e)}static setPageName(e){if(!e)return;let r=le.get(),n=r.pageName;if(e===n)return;if(r.pageName=e,e==="cart"&&pe.get(cr).loadOrRenderWidgetsAfterCartChange(),N.BLACKLISTED_PAGE_NAMES.some(s=>e.includes(s))){pe.get($i).resetScrollID();return}let i={};n&&(i.ps=n);let o=new _e(N.EVENT_SCREEN_VIEW,i);o.occurred=r.jsLoadTime,pe.get(fe).sendEvent(o),pe.get($i).resetScrollID(o.occurred)}static previewPopup(e,r){new Ui(r).render(e)}static previewWidget(e){new At(new Mt(e)).render()}static setupPreviewListeners(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(e){b.error(e)}window.addEventListener("message",e=>{if(b.debug("Received event",e),!e.origin.includes("letscooee.com")&&!e.origin.includes("localhost"))return;let r=e.data;typeof r=="object"&&(r.action==="POPUP_PREVIEW"?(this.previewPopup(r.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)):r.action==="WIDGET_PREVIEW"&&(this.previewWidget(r.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)))})}}static attachGoKwikListeners(){let e=le.get();window.addEventListener("kp-modal:opened",()=>{e.isGoKwikPopupOpen=!0}),window.addEventListener("user-loggedin",r=>{let{token:n}=r.detail;n&&this.updateProfile({goKwikToken:n})}),window.gokwikSdk?Go.attachCheckoutListener():window.addEventListener("gokwikLoaded",Go.attachCheckoutListener)}static storePreviewParams(){let e=le.get(),r=new URLSearchParams(location.search),n=r.get("cooee-preview");n&&(e.previewIDs=n.trim().split(",").filter(o=>Number.isInteger(+o)));let i=r.get("cooee-variant");i&&(e.previewVariant=i)}};b.configure();b.logBrand();b.debug("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(b.debug("Execution order:","IIFE start"),await be.initForMerchantWebsiteOnly(),await be.initForAll(),b.debug("Execution order:","IIFE end")))());b.debug("Execution order:","bottom");
70
+ `},navigation:{nextEl:t.querySelector(".swiper-button-next"),prevEl:t.querySelector(".swiper-button-prev")},autoplay:e.autoplay?.enabled?{delay:e.autoplay?.delay,disableOnInteraction:!1}:!1,autoHeight:!0});return t.style.setProperty("--swiper-navigation-size",`${e.navigation.size}px`),r}function ac(t,e,r){let n={color:t.navigation.color?.rgba};return t.pagination.enabled&&(n.transform="translateY(-25%)"),$("div",{class:"swiper-container",ref:e,children:[$("div",{class:"swiper-wrapper",children:r()}),t.navigation.enabled&&$("div",{class:"swiper-button-next",style:n,children:$("span",{})}),t.navigation.enabled&&$("div",{class:"swiper-button-prev",style:n,children:$("span",{})}),t.pagination.enabled&&$("div",{className:"swiper-pagination",style:{bottom:0,top:"unset",position:"relative",color:t.pagination.color?.rgba}})]})}var Ho=class extends Ae{swiperRef=null;swiperInstance=null;configuration;gap;constructor(e,r){super(e,r),this.configuration=this.renderer.isMobile()?this.props.element.conf.sm:this.props.element.conf.lg,this.gap=(this.configuration.gap??15)+"px"}componentDidMount(){this.props.element.conf[this.deviceTypeKey].disp===2&&oc().then(()=>{this.swiperInstance=sc(this.swiperRef,this.props.element.conf[this.deviceTypeKey])})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.triggerContext.triggerData.items;e.splice(this.configuration.maxItems??10);let r;if(this.configuration.disp===2){let n=o=>{this.swiperRef=o},i=()=>e?.map(o=>$("div",{class:"swiper-slide",children:this.getProductFragment(o)}));r=$("div",{style:ee(w({},this.getCompiledStyles()),{display:"block"}),class:"lc-product-swiper-list",children:ac(this.configuration,n,i)})}else r=$("div",{style:this.getCompiledStyles(),class:"lc-product-list",children:e?.map((n,i)=>this.getProductFragment(n,i!==e.length-1))});return r}getComponentStyles(){let e=[0,2].includes(this.configuration.disp),r={display:e?"flex":"grid",justifyContent:"safe "+(this.mediaStyle.flex?.jc??"center"),gap:this.gap,flexDirection:this.mediaStyle.flex?.dir??"row"};if(r.flexDirection==="row"){if(e)r.maxWidth="100%",r.overflowY="auto";else if(this.configuration.disp===1){let n=this.props.triggerContext.triggerData,i=n.items.length,o;n.isBundle()?o=this.props.element.prod.symbol?.hide!==!0?i*2-1:i:o=this.props.element.conf[this.deviceTypeKey].maxInRow,r.gridTemplateColumns=`repeat(${o}, auto)`}}return r}getProductFragment(e,r=!1){return $(fr,{children:[$(kn,{element:this.props.element.prod,item:e,triggerContext:this.props.triggerContext}),this.props.triggerContext.triggerData.isBundle()&&r&&this.props.element.prod.symbol&&!this.props.element.prod.symbol.hide&&$("div",{style:{display:"flex",alignItems:"center",justifyContent:"center"},children:$(Ft,{element:this.props.element.prod.symbol,triggerContext:this.props.triggerContext})})]},e.mID)}};var $o=class extends Ae{swiperRef=null;swiperInstance=null;constructor(e,r){super(e,r)}componentDidMount(){oc().then(()=>{this.swiperInstance=sc(this.swiperRef,this.props.element.conf)})}componentWillUnmount(){this.swiperInstance&&this.swiperInstance.destroy()}render(){let e=this.props.element,r=i=>{this.swiperRef=i},n=()=>e.values?.map(i=>$("div",{class:"swiper-slide",onClick:()=>this.onClick({clickAction:this.getClickAction(i)}),children:this.renderElement(i)}));return ac(e.conf,r,n)}getComponentStyles(){return{}}renderElement(e){let r=this.valueAddedSlide(this.props.element.slide,e);switch(r?.t){case 1:return $(Mr,{element:r,triggerContext:this.props.triggerContext});case 4:return $(Fr,{elements:r.elems,element:r,triggerContext:this.props.triggerContext});default:b.warn("Unknown slide type for carousal")}}valueAddedSlide(e,r){let n=JSON.stringify(e),i=vt.render(n,{form:r});return kt.getParsedElement(JSON.parse(i))}getClickAction(e){let r=w({},this.props.element.clc),n=JSON.stringify(r),i=vt.render(n,{form:e});return JSON.parse(i)}};var tn=class extends Ae{constructor(e,r){super(e,r),this.setState(()=>({decoration:"unset"})),at(()=>{this.setState(()=>({showButton:!this.props.triggerContext.triggerData.isBundle()||!!this.props.triggerContext.selectedItems.length}))})}renderElement(e){if(!e.hide){if(e.t===4){let r=e;return $(Fr,{element:r,triggerContext:this.props.triggerContext,elements:r.elems})}if(e.t===61)return $(Lo,{element:e,triggerContext:this.props.triggerContext});if(e.t===3)return this.state.showButton?$(Un,{element:e,triggerContext:this.props.triggerContext}):void 0;if(e.t===2)return $(Ft,{element:e,triggerContext:this.props.triggerContext});if(e.t===1)return $(Mr,{element:e,triggerContext:this.props.triggerContext});if(e.t===11)return $(Ho,{element:e,triggerContext:this.props.triggerContext});if(e.t===12)return $(kn,{element:e,item:this.props.triggerContext.triggerData.items[0],triggerContext:this.props.triggerContext});if(e.t===62)return $($o,{element:e,triggerContext:this.props.triggerContext})}}render(){return this.props.elements.map(e=>this.renderElement(e))}getComponentStyles(){return{}}};var jo=class extends Ae{clickAction;isClickable;constructor(e,r){super(e,r),this.clickAction=this.props.element.clc,this.isClickable=this.clickAction?.at===4&&this.clickAction.gu?.u}componentDidMount(){at(()=>{let e=this.props.triggerContext.triggerData,r=this.props.triggerContext.selectedItems;e.calculateDiscountData(r,this.props.triggerContext.shouldGiveFBTDiscount)})}render(){return $(fr,{children:[$("div",{style:this.getCompiledStyles(),class:"lc-container",onClick:()=>{this.onClick({clickAction:this.clickAction})},children:$(tn,{elements:this.props.elements,element:this.props.element,triggerContext:this.props.triggerContext})}),this.props.triggerContext.triggerData.id==="preview"&&$("div",{class:"letscooee-preview-badge",children:["#",this.props.triggerContext.triggerData.shortID," preview"]})]})}getComponentStyles(){let e={position:"relative",overflow:"hidden",display:"block"};return this.isClickable&&(e.cursor="pointer"),e}async onClick(e){if(this.isClickable)return super.onClick(e)}};var At=class t{constructor(e){this.engagementTrigger=e;this.triggerContext=new Pi(new Date,this.engagementTrigger)}static renderedEngagements=[];static engagementIDsWithTrackedDisplay=new Set;static DEBOUNCE_TIME=1e3;rootContainer;widgetElement;widget;triggerContext;observers=[];runtimeData=le.get();widgetAPIService=pe.get(cr);safeHTTPService=pe.get(fe);scrollSubscription;variation;isExclusionWithBVariation;renderSilently(){this.render().catch(e=>Be.getInstance().captureException(e,w({},this.engagementTrigger.sentryContext())))}destroy(){b.log(`${this.engagementTrigger} will be destroyed`),this.scrollSubscription?.unsubscribe(),this.observers.forEach(e=>{e?.disconnect&&e.disconnect()}),this.rootContainer?.remove(),t.engagementIDsWithTrackedDisplay.delete(this.engagementTrigger.shortID)}async render(){if(this.engagementTrigger.hasMultiplePlacement){let e=await this.getVariation();this.handleVariationResponse(e)}if(this.rootContainer=await this.getWidgetContainer(!0),!this.rootContainer){b.warn(`${this.engagementTrigger} no section found to render the widget`);return}this.widget=this.engagementTrigger.widget,await this.getVariationIfRequired(),!this.shouldStopRendering()&&(await this.startRendering(),this.attachScroll(),await this.checkAndSendEvent(),this.triggerContext.renderer=this)}isSameTrigger(e){return this.engagementTrigger.shortID===e.shortID}update(e){mh.default.log(`${this.engagementTrigger} will be updated`),this.updateItems(e.items,this.engagementTrigger.items)}shouldStopRendering(){return!this.widget&&!this.isExclusionWithBVariation}async getVariationIfRequired(){if(this.engagementTrigger.isSingleContent()||this.engagementTrigger.widget){b.log(`${this.engagementTrigger} already has required data to render widget`);return}let e=await this.observeWidgetContainerInViewport();this.handleVariationResponse(e)}handleVariationResponse(e){e&&(b.log(`${this.engagementTrigger} visitor has been assigned to variation ${e.variation}`),e.items?.length&&(this.engagementTrigger.items=e.items.map(r=>new Dt(r)),this.engagementTrigger.nonMutableItems=e.items.map(r=>new Dt(r))),e.bundleFrom&&(this.engagementTrigger.bundleFrom=new Dt(e.bundleFrom)),e.discount&&(this.engagementTrigger.discount=e.discount),e.placement&&(this.triggerContext.triggerData.placement=e.placement),e.props&&fh.JSUtils.hasKeys(e.props)&&(this.engagementTrigger.props=w(w({},this.engagementTrigger.props),e.props)),this.triggerContext.triggerData.widget=this.widget=new Si(e.widget),this.triggerContext.triggerData.contentID=e.contentID,this.triggerContext.triggerData.variation=this.variation=e.variation,this.triggerContext.triggerData.placement=e.placement,this.triggerContext.triggerData.manipulation=e.manipulation,this.isExclusionWithBVariation=this.engagementTrigger.isExclusionTesting()&&this.variation==="b",this.isExclusionWithBVariation&&(this.rootContainer.style.height="0.5px"))}addToRendered(){t.renderedEngagements.push(this)}async getVariation(){b.log(`${this.engagementTrigger} get variation`);let e={engagementID:this.engagementTrigger.engagementID,isPreview:this.engagementTrigger.id==="preview"};try{return await this.widgetAPIService.getVariation(e)}catch(r){b.error(`${this.engagementTrigger} unable to get the variation`,r);return}}async observeWidgetContainerInViewport(){if(!this.rootContainer){b.warn(`${this.engagementTrigger} No root container found to watch for viewport`);return}let e=window.innerHeight*.3,r={root:null,rootMargin:`-${e}px 0px ${e}px 0px`,threshold:0};return await this.isInViewport()?this.getVariation():new Promise(n=>{let i=new IntersectionObserver((o,s)=>{o.forEach(async a=>{if(a.isIntersecting){b.log(`${this.engagementTrigger} root container is near the viewport. Fetching variation`);let c=await this.getVariation();n(c),s.unobserve(this.rootContainer)}})},r);i.observe(this.rootContainer),this.observers.push(i)})}attachScroll(){this.scrollSubscription=On(window,"scroll").pipe(ar(t.DEBOUNCE_TIME)).subscribe(()=>{this.checkAndSendEvent()})}async checkAndSendEvent(){let e=this.engagementTrigger.shortID;if(t.engagementIDsWithTrackedDisplay.has(e)||!await this.isInViewport())return;let n={};this.triggerContext.triggerData.items?.length&&(n.promotedMIDs=this.engagementTrigger.items?.map(s=>s.mID));let i=this.isExclusionWithBVariation?N.EVENT_CAMPAIGN_HOLDOUT:N.EVENT_TRIGGER_DISPLAYED,o=new _e(i,n,this.engagementTrigger);o.name===N.EVENT_CAMPAIGN_HOLDOUT&&(o.trigger.holdout=!0),this.safeHTTPService.sendEvent(o),t.engagementIDsWithTrackedDisplay.add(e),this.scrollSubscription.unsubscribe()}generateParentElementID(){return`letscooee-${this.engagementTrigger.shortID}`}async isInViewport(){let e=(await this.getWidgetContainer())?.getBoundingClientRect();if(!e)return!1;let r=window.innerHeight||document.documentElement.clientHeight,i=(Math.min(e.bottom,r)-Math.max(e.top,0))*e.width,o=e.width*e.height,s=i/o*100;return this.engagementTrigger.isAnySplit()?s>0:s>=30}async getWidgetContainer(e){if(this.rootContainer?.isConnected)return this.rootContainer;let r=await this.createParentElementWithPlacement(e);if(r)return r;let n=`.letscooee[data-engagement-id="${this.triggerContext.triggerData.shortID}"]`;return document.querySelector(n)}async createParentElementWithPlacement(e){let r=this.engagementTrigger.placement;if(!r?.selector)return b.warn(`${this.engagementTrigger} does not have a selector`),null;let n=r.selector,i;if(n.includes(N.SHADOW_SPLITTER)){let c=n.split(N.SHADOW_SPLITTER);i=(await te.retrySelector(c[0].trim()))?.shadowRoot,n=c[1].trim(),i&&Rt.injectStylesheet(Ct.styleURL,i);let m=Le.get().website.commonCSS;i&&m&&Rt.injectRawCSS(m,i)}b.debug(`${this.engagementTrigger} attempt to render ${r.position}-${n}`);let o=await te.retrySelector(n,10,i??document);if(!o)return b.warn(`${this.engagementTrigger} no placement found with ${n}`),null;let s=this.generateParentElementID(),a=this.getParentElement(s);if(!e)return a;switch(r.position){case Wo.EngagementPlacementPosition.BEFORE:{o.parentElement?.insertBefore(a,o);break}case Wo.EngagementPlacementPosition.INSIDE_FIRST:{o.insertBefore(a,o.firstChild);break}case Wo.EngagementPlacementPosition.INSIDE_LAST:{o.appendChild(a);break}case Wo.EngagementPlacementPosition.AFTER:default:o.parentElement?.insertBefore(a,o.nextSibling)}return a}async startRendering(){let e;try{e=await ki.refreshItems(this.engagementTrigger)}catch(r){b.error(`${this.engagementTrigger} error refreshing the items`,r);return}if(!e?.length&&this.engagementTrigger.isProductPromoted()){b.warn(`${this.engagementTrigger} is of ${this.engagementTrigger.objective} but no product found`);return}this.engagementTrigger.items=e,this.renderContainer()}getParentElement(e,r=document){let n=r.getElementById(e);if(n)return n;let i=this.engagementTrigger.shortID;return n=document.createElement("div"),n.id=e,n.className=`letscooee letscooee-engagement engagement-${i}`,n.dataset.engagementId=i,this.engagementTrigger.id==="preview"&&(n.className+=" letscooee-preview"),n.style.display="block",n.style.minHeight="0.5px",n.style.minWidth="0.5px",n}renderContainer(){if(!this.widget)return;let e=this.rootContainer;if(this.triggerContext.triggerData.hasSwiperElement()){let n=this.rootContainer?.shadowRoot||this.rootContainer?.attachShadow({mode:"open"}),i=Le.get().website.commonCSS;i&&Rt.injectRawCSS(i,n),Rt.injectStylesheet(Ct.styleURL,n),Rt.injectStylesheet("https://cdn.jsdelivr.net/npm/swiper@11/swiper-bundle.min.css",n),e=n}tf(Mc(jo,{element:this.widget.cont,triggerContext:this.triggerContext,elements:this.widget.elems}),e),this.addToRendered()}updateItems(e,r){let n=this.getItemDiff(e,r),i=this.getItemDiff(r,e);r.push(...n);for(let o of i)ph.ArrayUtils.remove(r,o)}getItemDiff(e,r){return e.filter(n=>!r.some(i=>i.selectedOrFirstVariant.value.mID===n.selectedOrFirstVariant.value.mID))}};var Dr=class t extends At{static renderedEngagements=[];constructor(e){super(e)}addToRendered(){t.renderedEngagements.push(this)}observeWidgetContainerInViewport(){return this.getVariation()}generateParentElementID(){let e=super.generateParentElementID();return this.engagementTrigger.isSubscriptionUpsell()&&(e+=`-${this.engagementTrigger.items[0].selectedOrFirstVariant.value.mID}`),e}async checkAndSendEvent(){if(!ze.get().isOpen()&&this.runtimeData.pageName!=="cart"){b.log("Do not send display event as neither the cart drawer nor the cart page is open.");return}return super.checkAndSendEvent()}};var cc=class t{constructor(e,r){this.engagementTrigger=e;this.element=r;this.cartItems=de.getCurrent().items}cartItems;static renderCartUpsell(e){let r=e.placement;if(!r?.selector){b.warn(`No placement available for ${e.objective}`,e.shortID);return}let n=Array.from(document.querySelectorAll(r.selector));if(!n?.length){b.warn(`No placement found for ${e.objective}`,e.shortID);return}for(let i of n)new t(e,i).render()}render(){let e=this.findCartItemFromHTMLElement();if(!e||this.engagementTrigger.skipSubscribedItems&&e.selling_plan_allocation)return;let r=this.engagementTrigger.items.find(p=>p.mID===e.product_id.toString());if(!r)return;let n=r.vars.find(p=>p.mID===e.id.toString());if(!n)return;let i=new Sr(n),o=e.selling_plan_allocation?.selling_plan;if(o)for(let p of i.sellingPlans??[])p.mID===o.id.toString()&&(p.isSelected=!0,i.changeSellingPlan(p));let s=new Dt(r);s.vars=[i],s.selectedOrFirstVariant.value=i;let a=`lc-cart-item-${this.engagementTrigger.shortID}-${r.mID}`;this.element.classList.add(a);let c=new Mt(this.engagementTrigger);c.placement.selector=`.${a}`,c.items=[s];let m=new Dr(c);m.renderSilently(),this.watchForCartItemDeletion(m,a)}watchForCartItemDeletion(e,r){let n=new MutationObserver(i=>{i.forEach(o=>{o.removedNodes.forEach(s=>{s===this.element&&(b.debug(`${r} has been removed`),e.destroy(),n.disconnect())})})});n.observe(this.element.parentElement,{childList:!0,subtree:!0})}findCartItemFromHTMLElement(){let e=this.element.innerHTML;return this.cartItems.find(r=>{if(!(e.includes(r.url)||e.includes(r.variant_id))&&(!e.includes(r.product_title)||r.variant_title&&!e.includes(r.variant_title)))return!1;let n=r.selling_plan_allocation?.selling_plan?.name;return!(n&&!e.includes(n))})}};var dh=Se(Rr());var lc=class extends Dr{ctaListener=new Zr;constructor(e){super(e),xr.get().subscriber(N.CART_UPDATE_BROADCAST).pipe(Yu(null)).subscribe(this.checkMilestone.bind(this))}update(e){super.update(e),this.widgetElement.update()}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-progressbar");e.className="cooee-root",e.cart=de.getCurrent(),e.engagementTrigger=this.engagementTrigger,e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}async checkMilestone(){let e=await de.getCurrent().getNormalisedCart(),n=[...this.engagementTrigger.progressBarConfig.milestones];for(let i of n){if(e.amount<i.minValue)break;if(b.log("Current milestone",i),i.rewardType===dh.MilestoneRewardType.FREE_AUTO_GIFT){let o=i.items[0];if(e.items.find(a=>a.vID===o.vID||a.mID===o.mID)){b.log(`Item(vID:${o.vID}) already present in the cart. Updating item's properties`),await this.ctaListener.performUpdate(o,{properties:this.engagementTrigger.getPrivateAttributesForLineItem()});break}else{let a=await this.ctaListener.performAddToCart([o],this.engagementTrigger);ze.get().refreshUI(a,!1),await this.removeOtherFreeGifts(o)}}}}async removeOtherFreeGifts(e){let n=(await de.getCurrent().getNormalisedCart()).items.filter(i=>i.vID!==e?.vID&&i.properties[N.CAMPAIGN_ATTRIBUTE]===this.engagementTrigger.shortID);if(n.length)for(let i of n)await this.ctaListener.performUpdate(i,{quantity:0})}};var hh=Se(Rr()),uc=class extends At{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){if(this.widgetElement?.isConnected){this.addToRendered();return}let e=this.widgetElement=document.createElement("cooee-shoppable-videos");e.className="cooee-root",e.items=this.triggerContext.triggerData.items,e.engagementTrigger=this.engagementTrigger,e.addEventListener("triggerClicked",r=>{let n=r.detail;this.safeHTTPService.sendEvent(n)}),e.addEventListener("performCTA",async r=>{let n={at:hh.ClickActionType.ADD_TO_CART,applyDiscount:!0},i=r.detail;await new en(this.triggerContext).execute({clickAction:n,item:i})}),e.setAttribute("engagement",this.engagementTrigger.shortID),this.rootContainer.appendChild(e),this.addToRendered()}};var gh=Se(ei());var pc=class extends At{constructor(e){super(e)}shouldStopRendering(){return!1}renderContainer(){let e=this.getParentElement(`inner-letscooee-${this.engagementTrigger.shortID}`);this.rootContainer.appendChild(e),document.addEventListener(N.ADD_BUNDLE_CTA_INBOUND_EVENT,this.inboundCTAListener.bind(this),!1)}async inboundCTAListener(e){let r=this.engagementTrigger,n=`Engagement(id: ${r.engagementID}, shortID: ${r.shortID})`,i=e.detail;if(!gh.JSUtils.hasKeys(i)){b.error(`No detail received for ${n}`);return}b.log("Detail received for BYOB",i);let o=i.campaignID??i.campaignId??i.campaign_id;if(o!==r.shortID&&o!==r.engagementID){b.warn(`Current ${n} is not BYOB. Received: ${o}`);return}let s=i.items;if(!s?.length)return;let a=s.map(c=>new xt({mID:c.product_id,vID:c.variant_id,quantity:c.quantity||1}));await new en(this.triggerContext).execute({embeddedItems:a,clickAction:{at:108,applyDiscount:!0}})}};var Fi=class{runtimeData=le.get();processCartWidgetResponse(e){this.runtimeData.isCartDirty=!1,this.runtimeData.cartEngagements=e;let r=[...Dr.renderedEngagements];Dr.renderedEngagements.length=0;for(let n of e)b.log(`\u{1F4E3} ${n} received as cart embed`),!this.findAndUpdateCurrent(n,r)&&(b.log(`${n} is new`),n.isProgressBar()?new lc(n).renderSilently():n.isSubscriptionUpsell()?cc.renderCartUpsell(n):new Dr(n).renderSilently());this.removeOldWidgets(r)}processPageWidgetResponse(e){let r=[...At.renderedEngagements];At.renderedEngagements.length=0;for(let n of e)b.log(`\u{1F4E3} ${n} received as page embed`),!this.findAndUpdateCurrent(n,r)&&(b.log(`${n} is new`),n.isShoppableVideo()?new uc(n).renderSilently():n.isBYOB()?new pc(n).renderSilently():new At(n).renderSilently());this.removeOldWidgets(r)}findAndUpdateCurrent(e,r){let n=r.findIndex(i=>i.isSameTrigger(e));return n<0||e.isSubscriptionUpsell()?!1:(r[n].update(e),r[n].renderSilently(),r.splice(n,1),!0)}removeOldWidgets(e){for(let r of e)r.destroy()}};var cr=class t{static INSTANCE;httpService=pe.get(mt);sessionManager=pe.get(st);runtimeData=le.get();loadWidgetsSubject=new It;constructor(){this.loadWidgetsSubject.pipe(ar(300)).subscribe(()=>{this.loadCartWidgets().catch(e=>b.error("Unable to initiate cart widgets",e)),this.loadPageWidgets().catch(e=>b.error("Unable to initiate page widgets",e))}),xr.get().subscriber(N.CART_UPDATE_BROADCAST).subscribe(()=>this.loadWidgetsSubject.next())}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}loadOrRenderWidgetsAfterCartChange(){this.runtimeData.isCartDirty?this.loadWidgetsSilently():this.renderCachedCartWidgets()}loadPageWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadPageWidgets().catch(e=>b.error("Unable to initiate load page widgets",e))})}loadCartWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadCartWidgets().catch(e=>b.error("Unable to initiate cart widgets",e))})}loadWidgetsSilently(){st.replaySubject.subscribe(async()=>{this.loadWidgetsSubject.next()})}async loadPageWidgets(){let e=await this.getWidgetProps();b.log("Load widgets",e),this.httpService.post("/v1/engagement/page-widgets",e).then(async r=>{let n=r.widgets.map(i=>new Mt(i));new Fi().processPageWidgetResponse(n)}).catch(r=>{b.error("Error sending widget getter",r)})}async loadCartWidgets(){let e=await this.getWidgetProps();b.log("Load cart widgets",e),this.httpService.post("/v1/engagement/cart-widgets",e).then(async r=>{let n=r.widgets.map(i=>new Mt(i));new Fi().processCartWidgetResponse(n)}).catch(r=>{b.error("Error sending widget getter",r)})}async getVariation(e){let r=await this.getWidgetProps();return this.httpService.post("/v1/engagement/get-variant",w(w({},e),r))}renderCachedCartWidgets(){new Fi().processCartWidgetResponse(this.runtimeData.cartEngagements)}async addSessionContext(e){let r=await this.sessionManager.checkSessionAndGetContext();e.sessionID=r[0],e.sessionNumber=r[1],e.landingPage=r[2],e.page=Tr.parseFromCurrent()}addAvailableEngagementShortIDs(){let e=document.querySelectorAll(".letscooee-engagement"),r=[];return e.forEach(n=>{let i=n.dataset.engagementId;i&&+i&&r.push(i)}),r}async getWidgetProps(){let e={};e.engagementIDs=this.addAvailableEngagementShortIDs(),e.locale=this.runtimeData.locale,await this.addSessionContext(e),e.currentItem=this.runtimeData.getCurrentItem();try{e.cart=await de.getCurrent().getNormalisedCart()}catch(o){b.error("Error fetching Shopify cart before sending widget call",o)}let r=new URLSearchParams(location.search),n=r.get("cooee-preview");n?e.previewIDs=n.trim().split(",").filter(o=>Number.isInteger(+o)):this.runtimeData.previewIDs?.length&&(e.previewIDs=this.runtimeData.previewIDs);let i=r.get("cooee-variant");return i?e.previewVariant=i:this.runtimeData.previewVariant&&(e.previewVariant=this.runtimeData.previewVariant),e}};var fc=class{runtimeData=le.get();widgetAPIService=pe.get(cr);meddle(){let e=be.globalRef;e.account=e.account??[],e.profile=e.profile??[],e.events=e.events??[],e.screen=e.screen??[],e.page=e.page??[],this.meddlePage(),this.meddleAccount(),this.meddleEvents(),this.meddleProfile(),this.meddleScreen(),this.exposeMethods()}exposeMethods(){let e=be.globalRef;e.loadPageWidgets=()=>{this.widgetAPIService.loadPageWidgetsSilently()},e.loadCartWidgets=()=>{this.widgetAPIService.loadCartWidgetsSilently()},e.previewWidget=be.previewWidget.bind(be),e.previewPopup=be.previewPopup.bind(be)}overwritePush(e,r){li(e,"push",r)}meddleAccount(){this.overwritePush(be.globalRef.account,(...e)=>{this.processAccount(e[0])}),be.globalRef.account.forEach(this.processAccount.bind(this))}meddleEvents(){this.overwritePush(be.globalRef.events,(...e)=>{this.processEvent(e[0])}),be.globalRef.events.forEach(this.processEvent.bind(this))}meddleProfile(){this.overwritePush(be.globalRef.profile,(...e)=>{this.processProfile(e[0])}),be.globalRef.profile.forEach(this.processProfile.bind(this))}meddleScreen(){this.overwritePush(be.globalRef.screen,(...e)=>{this.processPageName(e[0])}),be.globalRef.screen.forEach(this.processPageName.bind(this))}processAccount(e){e&&(e.appID&&be.authenticate(e),e.flags&&Ln.setFlags(e.flags))}processEvent(e){e&&(N.JS_LOAD_WHITELIST_EVENTS.includes(e[0])?be.sendEvent(e[0],e[1],this.runtimeData.jsLoadTime):be.sendEvent(e[0],e[1]))}processProfile(e){e&&be.updateProfile(e)}processPageName(e){e&&be.setPageName(e)}meddlePage(){this.overwritePush(be.globalRef.page,(...e)=>{this.processPage(e[0])}),be.globalRef.page.forEach(this.processPage.bind(this))}processPage(e){e.currentItem&&this.runtimeData.setCurrentItem(e.currentItem),e.currency&&(this.runtimeData.currencyCode=e.currency),e.shopCurrency&&(this.runtimeData.shopCurrencyCode=e.shopCurrency),e.moneyFormat&&(this.runtimeData.moneyFormat=e.moneyFormat),e.jsLoad&&(this.runtimeData.jsLoadTime=e.jsLoad),e.locale&&(this.runtimeData.locale=e.locale),e.pageName&&be.setPageName(e.pageName)}};var Hi=class{static SESSION_STORAGE=window.sessionStorage;static SESSION_STORAGE_KEY_PREFIX=N.COOEE.concat("-");static getString(e,r){return this.getItem(e)||r}static setString(e,r){this.setItem(e,r)}static remove(e){this.removeItem(e)}static getItem(e){return this.SESSION_STORAGE.getItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}static setItem(e,r){this.SESSION_STORAGE.setItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e),r)}static removeItem(e){this.SESSION_STORAGE.removeItem(this.SESSION_STORAGE_KEY_PREFIX.concat(e))}};var $i=class t{static INSTANCE;static DEBOUNCE_TIME=1e3;static THRESHOLD=10;safeHttpService=pe.get(fe);_lastScreenOrScroll=new Date;lastPercent=0;constructor(){}set lastScreenOrScroll(e){this._lastScreenOrScroll=e}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}resetScrollID(e){Hi.remove(N.SESSION_STORAGE_SCROLL_ID),this.lastScreenOrScroll=e??new Date}listen(){if(window.scrollY){let e=this.getPercentScrolledY();this.shouldSendScroll(e)&&this.sendScroll(e)}te.onDocumentLoaded(()=>{this.observeWindowScroll()})}observeWindowScroll(){On(window,"scroll").pipe(ar(t.DEBOUNCE_TIME),Nn(()=>{let e=this.getPercentScrolledY();if(e>100){b.warn("Received scroll percent is more than 100",e);return}if(this.shouldSendScroll(e))return e})).subscribe(e=>{this.sendScroll(e)})}shouldSendScroll(e){return Math.abs(this.lastPercent-e)>=t.THRESHOLD||this.lastPercent!==e&&e===100}sendScroll(e){if(e==null)return;let r={percent:e,timeMS:new Date().getTime()-this._lastScreenOrScroll.getTime()};this.lastPercent=e;let n=Hi.getString(N.SESSION_STORAGE_SCROLL_ID,""),i=new _e(N.EVENT_SCROLL,r,null,n);this.safeHttpService.sendEvent(i),Hi.setString(N.SESSION_STORAGE_SCROLL_ID,i.id.toHexString()),this._lastScreenOrScroll=new Date(i.occurred)}getPercentScrolledY(){let e=window.document.body.scrollHeight,r=window.innerHeight;return Math.ceil((window.scrollY+r)/e*100)}};var mc=class t{static ACTIVE_DURATION="aDur";static INACTIVE_DURATION="iaDur";apiService=pe.get(fe);runtimeData=le.get();listen(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?this.onVisible():document.visibilityState==="hidden"&&this.onHidden()}}async onVisible(){}async onHidden(){let e=await this.runtimeData.setInactive();if(e===0){b.info("Not sending background event as user was inactive on website");return}b.info(`Sending background event with ${e} seconds`);let r={};r[t.ACTIVE_DURATION]=e,this.apiService.sendEvent(new _e(N.EVENT_APP_BACKGROUND,r))}};var dc=class{compareCartItemSubject=new It;constructor(){this.compareCartItemSubject.pipe(ar(100)).subscribe(this.compareCartItems.bind(this))}listen(){this.compareCartItemSubject.next(),this.overwriteXMLHttpRequest(),this.overwriteFetchMethod()}overwriteXMLHttpRequest(){let e=this,r=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){e.performEvent(this._url).catch(n=>b.error("Unable to process cart change in XMLHttpRequest",n))}),r.apply(this,arguments)},b.debug("Securely overwritten window.XMLHttpRequest.send method")}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=function(n){return r.apply(window,arguments).then(i=>(e.performEvent(n.toString()).catch(o=>b.error("Unable to process cart change in fetch",o)),i))},b.debug("Securely overwritten window.fetch method")}async performEvent(e){this.isCartManipulationURL(e)&&(le.get().isCartDirty=!0,this.compareCartItemSubject.next())}isCartManipulationURL(e){return/\/cart\/(add|change|update|clear)/.test(e)}sendChangesAsEvents(e,r){let n=e?.items,i=r.items,o=[],s=[];if(b.debug(`Comparing cart change with old count ${n?.length} to new count ${i.length}`),i?.forEach(a=>{let c=n?.find(m=>m.vID===a.vID);if(c){if(c.quantity!==a.quantity){let m=c.quantity<a.quantity,p=Math.abs(c.quantity-a.quantity),f=ee(w({},a),{quantity:p});m?o.push(f):s.push(f)}n&&te.removeFromArray(n,c)}else o.push(a)}),n)for(let a of n)s.push(a);b.debug(`Cart delta: added: ${o.length}, removed: ${s.length}`),o.length&&this.sendEvent(N.EVENT_ADD_TO_CART,{items:o}),s.length&&e.token===r.token&&this.sendEvent(N.EVENT_REMOVE_FROM_CART,{items:s}),(s.length||o.length)&&xr.get().broadcast(N.CART_UPDATE_BROADCAST,{itemsAdded:o,itemsRemoved:s})}sendEvent(e,r){let n=new _e(e,r);pe.get(fe).sendEvent(n)}async compareCartItems(){let e=await Oe.get(oe.CURRENT_CART,{}),r=await de.getCurrent().getNormalisedCart(!0);this.sendChangesAsEvents(e,r)}};var hc=class{listen(){return this.overwriteFetchMethod(),this}overwriteFetchMethod(){let e=this,r=window.fetch;window.fetch=async function(n,i){try{await e.modifyRequest(n,i)}catch(o){Be.getInstance().captureError("Failed to modify graphql request",o,{body:JSON.stringify(i?.body)})}return r(n,i)},b.debug("Securely overwritten window.fetch method for graphql query")}async modifyRequest(e,r){let n=typeof e=="string"?e:e instanceof Request?e.url:"";if(!(n.includes("graphql.json")&&r?.method==="POST")||!r.body)return;let i;if(typeof r.body=="string")try{i=JSON.parse(r.body)}catch{return}else i=r.body;b.debug("Intercepted fetch request of:",n),i?.query.includes("cartCreate")&&(r.body=await this.updatedBody(i),this.sendBuyNowEvent())}async updatedBody(e){let r=e.variables.input.attributes??[],n=await te.getCartAttributes();return e.variables.input.attributes=[...r,...n],JSON.stringify(e)}sendBuyNowEvent(){let e=le.get().getCurrentItem();if(!e)return;let r=new _e(N.EVENT_BUY_NOW_CLICKED,{items:[e]});fe.getInstance().sendEvent(r)}};var ji=class{constructor(e,r){this.selectors=e;this.eventName=r;this.selectorString=e.join(",")}static INSTANCE;elements;selectorString;clickListenerCallback=e=>{let r=e.currentTarget,n=new _e(this.eventName,{class:r.className||void 0,tagName:r.tagName||void 0,id:r.id||void 0});fe.getInstance().sendEvent(n),this.removeClickListener(this.clickListenerCallback)};listenSilently(){this.listen().catch(e=>b.error(e))}async listen(){this.elements=await te.retrySelectorForElements(this.selectorString),this.elements.forEach(e=>{e.addEventListener("click",this.clickListenerCallback)})}removeClickListener(e){this.elements?.forEach(r=>{r.removeEventListener("click",e)})}};var gc=class t extends ji{static selectors=[".product__thumbnail-list-inner > button","product-gallery-navigation > button",".product-media--thumb-container",".product-images-inner > img",".m-product-media",".swiper-button-control",".media__thumb",".slick-arrow",".productView-img-container.product-single__media",".product-gallery__thumbnail_item_inner"];constructor(){super(t.selectors,N.EVENT_ITEM_THUMBNAIL_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var yc=class t extends ji{static selectors=[".jdgm-widget.jdgm-preview-badge.jdgm-preview-badge--with-link.jdgm--done-setup","reviewsio-product-ratings",".ruk_rating_snippet.tracked:not(.hidden)","a > .loox-rating",".yotpo-reviews-star-ratings-widget",".yotpo.lp-hero__reviews",".pr-rating > a",".rivyoReviewWidget"];constructor(){super(t.selectors,N.EVENT_REVIEW_CLICKED)}static getInstance(){return this.INSTANCE||(this.INSTANCE=new t),this.INSTANCE}};var vc=class{selector=[".gokwik-checkout button","button.cart__checkout-button","button.cart__checkout","button#checkout","button#checkout2",'button[id*="checkout" i]','button[name*="checkout" i]','button[class*="checkout" i]'].join(",");listen(){te.onDocumentLoaded(()=>{b.debug("Execution order:","document ready"),this.useLocationHash()})}useLocationHash(){let e=window.location.hash?.substring(1);if(e)if(e.includes(N.HASH_INITIATE_CHECKOUT)){document.dispatchEvent(new Event(N.THIRD_PARTY_CHECKOUT_EVENT));let r=document.querySelector(this.selector);if(!r){b.debug("No clickable cart checkout button found");return}b.debug("Clickable cart checkout button found",r),r.click()}else e.includes(N.HASH_OPEN_CART_DRAWER)&&ze.get().open()}};var _c=class{trackSilently(){this.track().catch(e=>Be.getInstance().captureException(e))}async track(){let e=window.Shopify?.checkout,r=window.Shopify?.Checkout;if(!e&&!r)return;let n={};this.processSmallCheckout(e,n),this.processBigCheckout(r,n);let i=this.getTokenFromCurrentURLPath();if(i&&(n.urlToken=i),!Object.keys(n).length){b.warn("No processable data found in",e,r);return}n.referrer=document.referrer,n.url=location.href;let o=await pe.get(st).checkSessionAndGetContext();n.sessionID=o[0],this.trackOrder(n)}processSmallCheckout(e,r){e&&(e.order_id&&(r.orderID=e.order_id.toString()),e.token&&(r.checkoutToken=e.token.toString()),e.customer_id&&(r.customerID=e.customer_id.toString()))}processBigCheckout(e,r){e&&(e.token&&!r.checkoutToken&&(r.checkoutToken=e.token.toString()),e.cartToken&&(r.cartToken=e.cartToken.toString()))}trackOrder(e){b.info("Found order to be send",e),fe.getInstance().trackOrder(e)}getTokenFromCurrentURLPath(){let e=new RegExp("[A-Fa-f0-9]{28,32}");return location.pathname?.split("/").find(r=>r.length&&e.test(r))}};var Go=class{static attachCheckoutListener(){window.gokwikSdk&&window.gokwikSdk.on("checkout_initiated",async()=>{let e=await de.getCurrent().getNormalisedCart(),r={via:"GoKwik",items:e.items,cartToken:e.token,amount:{value:e.amount,currency:e.currency}},n=new _e(N.EVENT_CHECKOUT_STARTED,r);fe.getInstance().sendEvent(n)})}};var Ec=class{async migrate(){}};vt.escape=yh.MustacheUtils.escapeHtml;var be=class{static globalRef;static authenticated;static async initForMerchantWebsiteOnly(){window.cooeeSDKPreview||(this.initGlobalReference(),await new Ec().migrate(),this.autoAuthenticate(),new fc().meddle(),new mc().listen(),new _c().trackSilently(),new Zr().listen(),new dc().listen(),new hc().listen(),new vc().listen(),pe.get($i).listen(),pe.get(yc).listenSilently(),pe.get(gc).listenSilently(),pe.get(cr).loadPageWidgetsSilently(),this.attachGoKwikListeners(),this.storePreviewParams(),this.setupPreviewListeners(),er.watch())}static async initForAll(){this.injectWidgetAssets()}static initGlobalReference(){window.CooeeSDK||li(window,"CooeeSDK",{}),this.globalRef=window.CooeeSDK,li(this.globalRef,"config",new Le),li(this.globalRef,"runtimeData",new le),b.debug("Global reference initialised")}static injectWidgetAssets(){Rt.injectScriptURL(Ct.widgetURL,"cooee-widget-sdk"),Rt.injectStylesheet(Ct.styleURL)}static autoAuthenticate(){let e=Pe.getShopName();e&&this.authenticate({shopifyShop:e})}static authenticate(e){if(this.authenticated)return;let r=e.appID?.trim(),n=e.shopifyShop;if((te.isNull(r)||r.length!==24)&&te.isNull(n)){b.warn("Cooee App ID or Shop name is not configured");return}this.authenticated=!0,pe.get(st).init(e)}static sendEvent(e,r,n){for(let o in r)if(o.length>3&&o.toLowerCase().startsWith("ce "))throw new Error("Event property name cannot start with 'CE '");let i=new _e(e,r);i.occurred=n??new Date,pe.get(fe).sendEvent(i)}static updateProfile(e){for(let r in e)if(r.toLowerCase().startsWith("ce "))throw new Error("User property name cannot start with 'CE '");pe.get(fe).updateProfile(e)}static setPageName(e){if(!e)return;let r=le.get(),n=r.pageName;if(e===n)return;if(r.pageName=e,e==="cart"&&pe.get(cr).loadOrRenderWidgetsAfterCartChange(),N.BLACKLISTED_PAGE_NAMES.some(s=>e.includes(s))){pe.get($i).resetScrollID();return}let i={};n&&(i.ps=n);let o=new _e(N.EVENT_SCREEN_VIEW,i);o.occurred=r.jsLoadTime,pe.get(fe).sendEvent(o),pe.get($i).resetScrollID(o.occurred)}static previewPopup(e,r){new Ui(r).render(e)}static previewWidget(e){new At(new Mt(e)).render()}static setupPreviewListeners(){if(window.opener){try{window.opener.postMessage({action:"COOEE_READY_FOR_PREVIEW"},"*")}catch(e){b.error(e)}window.addEventListener("message",e=>{if(b.debug("Received event",e),!e.origin.includes("letscooee.com")&&!e.origin.includes("localhost"))return;let r=e.data;typeof r=="object"&&(r.action==="POPUP_PREVIEW"?(this.previewPopup(r.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)):r.action==="WIDGET_PREVIEW"&&(this.previewWidget(r.engagementTrigger),e.source?.postMessage({action:"PREVIEW_SUCCESSFUL"},e.origin)))})}}static attachGoKwikListeners(){let e=le.get();window.addEventListener("kp-modal:opened",()=>{e.isGoKwikPopupOpen=!0}),window.addEventListener("user-loggedin",r=>{let{token:n}=r.detail;n&&this.updateProfile({goKwikToken:n})}),window.gokwikSdk?Go.attachCheckoutListener():window.addEventListener("gokwikLoaded",Go.attachCheckoutListener)}static storePreviewParams(){let e=le.get(),r=new URLSearchParams(location.search),n=r.get("cooee-preview");n&&(e.previewIDs=n.trim().split(",").filter(o=>Number.isInteger(+o)));let i=r.get("cooee-variant");i&&(e.previewVariant=i)}};b.configure();b.logBrand();b.debug("Execution order:","top");window.cooeeShopifyScriptLoaded||(window.cooeeShopifyScriptLoaded=!0,(async()=>(b.debug("Execution order:","IIFE start"),await be.initForMerchantWebsiteOnly(),await be.initForAll(),b.debug("Execution order:","IIFE end")))());b.debug("Execution order:","bottom");