PageSourceSearch

https://huel.com/_next/static/immutable/chunks/3ep7c9d2jt7g8.js

js huel.com collected 2026-10-02 02:28:07 UTC 198,990 bytes, 5 lines download raw bytes

1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="3a6a5a03-6954-6569-6dba-2f8e0b9e1ac0")}catch(e){}}();
2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,138200,(e,t,r)=>{try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}!function(r,i){if("function"==typeof define&&define.amd){let t;void 0!==(t=i())&&e.v(t)}else t.exports?t.exports=i():r.jsonSchema=i()}(e.e,function(){var e=r;e.Integer={type:"integer"};var t={String:String,Boolean:Boolean,Number:Number,Object:Object,Array:Array,Date:Date};function r(e,t){return r(e,t,{changing:!1})}e.validate=r,e.checkPropertyChange=function(e,t,i){return r(e,t,{changing:i||"property"})};var r=e._validate=function(e,r,i){i||(i={});var n=i.changing;function o(e){return e.type||t[e.name]==e&&e.name.toLowerCase()}var a=[];function s(e,t,r,u){var l;function c(e){a.push({property:r,message:e})}if(r+=r?"number"==typeof u?"["+u+"]":void 0===u?"":"."+u:u,("object"!=typeof t||t instanceof Array)&&(r||"function"!=typeof t)&&!(t&&o(t)))return"function"==typeof t?e instanceof t||c("is not an instance of the class/constructor "+t.name):t&&c("Invalid schema/property definition "+t),null;function d(e,t){if(e){if("string"==typeof e&&"any"!=e&&("null"==e?null!==t:typeof t!=e)&&!(t instanceof Array&&"array"==e)&&!(t instanceof Date&&"date"==e)&&("integer"!=e||t%1!=0))return[{property:r,message:t+" - "+typeof t+" value found, but a "+e+" is required"}];if(e instanceof Array){for(var i=[],n=0;n<e.length&&(i=d(e[n],t)).length;n++);if(i.length)return i}else if("object"==typeof e){var o=a;a=[],s(t,e,r);var u=a;return a=o,u}}return[]}if(n&&t.readonly&&c("is a readonly field, it can not be changed"),t.extends&&s(e,t.extends,r,u),void 0===e)t.required&&c("is missing and it is required");else if(a=a.concat(d(o(t),e)),t.disallow&&!d(t.disallow,e).length&&c(" disallowed value was matched"),null!==e){if(e instanceof Array){if(t.items){var p=t.items instanceof Array,f=t.items;for(u=0,l=e.length;u<l;u+=1)p&&(f=t.items[u]),i.coerce&&(e[u]=i.coerce(e[u],f)),a.concat(s(e[u],f,r,u))}t.minItems&&e.length<t.minItems&&c("There must be a minimum of "+t.minItems+" in the array"),t.maxItems&&e.length>t.maxItems&&c("There must be a maximum of "+t.maxItems+" in the array")}else(t.properties||t.additionalProperties)&&a.concat(function(e,t,r,o){if("object"==typeof t){for(var u in("object"!=typeof e||e instanceof Array)&&a.push({property:r,message:"an object is required"}),t)if(t.hasOwnProperty(u)&&"__proto__"!=u&&"constructor"!=u){var l=e.hasOwnProperty(u)?e[u]:void 0;if(void 0===l&&i.existingOnly)continue;var c=t[u];void 0===l&&c.default&&(l=e[u]=c.default),i.coerce&&u in e&&(l=e[u]=i.coerce(l,c)),s(l,c,r,u)}}for(u in e){if(e.hasOwnProperty(u)&&("_"!=u.charAt(0)||"_"!=u.charAt(1))&&t&&!t[u]&&!1===o)if(i.filter){delete e[u];continue}else a.push({property:r,message:"The property "+u+" is not defined in the schema and the schema does not allow additional properties"});var d=t&&t[u]&&t[u].requires;!d||d in e||a.push({property:r,message:"the presence of the property "+u+" requires that "+d+" also be present"}),l=e[u],!o||t&&"object"==typeof t&&u in t||(i.coerce&&(l=e[u]=i.coerce(l,o)),s(l,o,r,u)),!n&&l&&l.$schema&&(a=a.concat(s(l,l.$schema,r,u)))}return a}(e,t.properties,r,t.additionalProperties));if(t.pattern&&"string"==typeof e&&!e.match(t.pattern)&&c("does not match the regex pattern "+t.pattern),t.maxLength&&"string"==typeof e&&e.length>t.maxLength&&c("may only be "+t.maxLength+" characters long"),t.minLength&&"string"==typeof e&&e.length<t.minLength&&c("must be at least "+t.minLength+" characters long"),void 0!==t.minimum&&typeof e==typeof t.minimum&&t.minimum>e&&c("must have a minimum value of "+t.minimum),void 0!==t.maximum&&typeof e==typeof t.maximum&&t.maximum<e&&c("must have a maximum value of "+t.maximum),t.enum){var g,h=t.enum;l=h.length;for(var E=0;E<l;E++)if(h[E]===e){g=1;break}g||c("does not have a value in the enumeration "+h.join(", "))}"number"==typeof t.maxDecimal&&e.toString().match(RegExp("\\.[0-9]{"+(t.maxDecimal+1)+",}"))&&c("may only have "+t.maxDecimal+" digits of decimal places")}return null}return r&&s(e,r,"",n||""),!n&&e&&e.$schema&&s(e,e.$schema,"",""),{valid:!a.length,errors:a}};return e.mustBeValid=function(e){if(!e.valid)throw TypeError(e.errors.map(function(e){return"for property "+e.property+": "+e.message}).join(", \n"))},e})},788177,(e,t,r)=>{try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let n=e=>new TextEncoder().encode(e);function o(e,t){let r,i,o,a,s,u;for("string"==typeof e&&(e=n(e)),r=3&e.length,i=e.length-r,o=t,u=0;u<i;)s=255&e[u]|(255&e[++u])<<8|(255&e[++u])<<16|(255&e[++u])<<24,++u,o^=s=(65535&(s=(s=(65535&s)*0xcc9e2d51+(((s>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|s>>>17))*0x1b873593+(((s>>>16)*0x1b873593&65535)<<16)|0,o=(65535&(a=(65535&(o=o<<13|o>>>19))*5+(((o>>>16)*5&65535)<<16)|0))+27492+(((a>>>16)+58964&65535)<<16);switch(s=0,r){case 3:s^=(255&e[u+2])<<16;case 2:s^=(255&e[u+1])<<8;case 1:s^=255&e[u],o^=s=(65535&(s=(s=(65535&s)*0xcc9e2d51+(((s>>>16)*0xcc9e2d51&65535)<<16)|0)<<15|s>>>17))*0x1b873593+(((s>>>16)*0x1b873593&65535)<<16)|0}return o^=e.length,o^=o>>>16,o=(65535&o)*0x85ebca6b+(((o>>>16)*0x85ebca6b&65535)<<16)|0,o^=o>>>13,o=(65535&o)*0xc2b2ae35+(((o>>>
216)*0xc2b2ae35&65535)<<16)|0,(o^=o>>>16)>>>0}o.v2=function(e,t){"string"==typeof e&&(e=n(e));let r=e.length,i=t^r,o=0,a;for(;r>=4;)a=(65535&(a=255&e[o]|(255&e[++o])<<8|(255&e[++o])<<16|(255&e[++o])<<24))*0x5bd1e995+(((a>>>16)*0x5bd1e995&65535)<<16),a^=a>>>24,i=(65535&i)*0x5bd1e995+(((i>>>16)*0x5bd1e995&65535)<<16)^(a=(65535&a)*0x5bd1e995+(((a>>>16)*0x5bd1e995&65535)<<16)),r-=4,++o;switch(r){case 3:i^=(255&e[o+2])<<16;case 2:i^=(255&e[o+1])<<8;case 1:i^=255&e[o],i=(65535&i)*0x5bd1e995+(((i>>>16)*0x5bd1e995&65535)<<16)}return i^=i>>>13,i=(65535&i)*0x5bd1e995+(((i>>>16)*0x5bd1e995&65535)<<16),(i^=i>>>15)>>>0},o.v3=o,t.exports=o},798539,(e,t,r)=>{try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}!function(e){"use strict";var i="function",n="undefined",o="object",a="string",s="major",u="model",l="name",c="type",d="vendor",p="version",f="architecture",g="console",h="mobile",E="tablet",y="smarttv",v="wearable",_="embedded",I="Amazon",m="Apple",O="ASUS",b="BlackBerry",R="Browser",N="Chrome",T="Firefox",A="Google",S="Honor",w="Huawei",D="Microsoft",U="Motorola",C="Nvidia",M="OnePlus",L="Opera",P="OPPO",k="Samsung",V="Sharp",x="Sony",F="Xiaomi",K="Zebra",G="Facebook",j="Chromium OS",B="Mac OS",z=" Browser",q=function(e,t){var r={};for(var i in e)t[i]&&t[i].length%2==0?r[i]=t[i].concat(e[i]):r[i]=e[i];return r},H=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},X=function(e,t){return typeof e===a&&-1!==W(t).indexOf(W(e))},W=function(e){return e.toLowerCase()},Y=function(e,t){if(typeof e===a)return e=e.replace(/^\s\s*/,""),typeof t===n?e:e.substring(0,500)},J=function(e,t){for(var r,n,a,s,u,l,c=0;c<t.length&&!u;){var d=t[c],p=t[c+1];for(r=n=0;r<d.length&&!u&&d[r];)if(u=d[r++].exec(e))for(a=0;a<p.length;a++)l=u[++n],typeof(s=p[a])===o&&s.length>0?2===s.length?typeof s[1]==i?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:3===s.length?typeof s[1]!==i||s[1].exec&&s[1].test?this[s[0]]=l?l.replace(s[1],s[2]):void 0:this[s[0]]=l?s[1].call(this,l,s[2]):void 0:4===s.length&&(this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):void 0):this[s]=l||void 0;c+=2}},$=function(e,t){for(var r in t)if(typeof t[r]===o&&t[r].length>0){for(var i=0;i<t[r].length;i++)if(X(t[r][i],e))return"?"===r?void 0:r}else if(X(t[r],e))return"?"===r?void 0:r;return t.hasOwnProperty("*")?t["*"]:e},Q={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"},Z={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[p,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[p,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,p],[/opios[\/ ]+([\w\.]+)/i],[p,[l,L+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[p,[l,L+" GX"]],[/\bopr\/([\w\.]+)/i],[p,[l,L]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[p,[l,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[p,[l,"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],[l,p],[/quark(?:pc)?\/([-\w\.]+)/i],[p,[l,"Quark"]],[/\bddg\/([\w\.]+)/i],[p,[l,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[p,[l,"UC"+R]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[p,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[p,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[p,[l,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[p,[l,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[p,[l,"Smart Lenovo "+R]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+R],p],[/\bfocus\/([\w\.]+)/i],[p,[l,T+" Focus"]],[/\bopt\/([\w\.]+)/i],[p,[l,L+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[p,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[p,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[p,[l,L+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[p,[l,"MIUI"+z]],[/fxios\/([\w\.-]+)/i],[p,[l,T]],[/\bqihoobrowser\/?([\w\.]*)/i],[p,[l,"360"]],[/\b(qq)\/([\w\.]+)/i],[[l,/(.+)/,"$1Browser"],p],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1"+z],p],[/samsungbrowser\/([\w\.]+)/i],[p,[l,k+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[p,[l,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[l,"Sogou Mobile"],p],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[l,p],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[l],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[p,l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,G],p],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\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],[l,p],[/\bgsa\/([\w\.]+) .*safari\//i],[p,[l,"GSA"]],[/musical_ly(?:.
2+app_?version\/|_)([\w\.]+)/i],[p,[l,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[p,[l,N+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,N+" WebView"],p],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[p,[l,"Android "+R]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,p],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[p,[l,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[p,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[p,$,{"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,p],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],p],[/(wolvic|librewolf)\/([\w\.]+)/i],[l,p],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[p,[l,T+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[l,[p,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[l,[p,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[f,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[f,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[f,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[f,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[f,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[f,/ower/,"",W]],[/ sun4\w[;\)]/i],[[f,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[f,W]]],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],[u,[d,k],[c,E]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[u,[d,k],[c,h]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[u,[d,m],[c,h]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[d,m],[c,E]],[/(macintosh);/i],[u,[d,m]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[d,V],[c,h]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[u,[d,S],[c,E]],[/honor([-\w ]+)[;\)]/i],[u,[d,S],[c,h]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[u,[d,w],[c,E]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[d,w],[c,h]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[u,/_/g," "],[d,F],[c,E]],[/\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,/ ([\w ]+) miui\/v?\d/i],[[u,/_/g," "],[d,F],[c,h]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[d,P],[c,h]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[u,[d,$,{OnePlus:["304","403","203"],"*":P}],[c,E]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[d,"Vivo"],[c,h]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[u,[d,"Realme"],[c,h]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[d,U],[c,h]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[d,U],[c,E]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[d,"LG"],[c,E]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[d,"LG"],[c,h]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}
2(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[u,[d,"Lenovo"],[c,E]],[/(nokia) (t[12][01])/i],[d,u,[c,E]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[u,/_/g," "],[c,h],[d,"Nokia"]],[/(pixel (c|tablet))\b/i],[u,[d,A],[c,E]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[d,A],[c,h]],[/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],[u,[d,x],[c,h]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[d,x],[c,E]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[d,M],[c,h]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[d,I],[c,E]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[d,I],[c,h]],[/(playbook);[-\w\),; ]+(rim)/i],[u,d,[c,E]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[d,b],[c,h]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[d,O],[c,E]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[d,O],[c,h]],[/(nexus 9)/i],[u,[d,"HTC"],[c,E]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[d,[u,/_/g," "],[c,h]],[/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],[u,[d,"TCL"],[c,E]],[/(itel) ((\w+))/i],[[d,W],u,[c,$,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[d,"Acer"],[c,E]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[d,"Meizu"],[c,h]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[u,[d,"Ulefone"],[c,h]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[u,[d,"Energizer"],[c,h]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[u,[d,"Cat"],[c,h]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[u,[d,"Smartfren"],[c,h]],[/droid.+; (a(?:015|06[35]|142p?))/i],[u,[d,"Nothing"],[c,h]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[u,[d,"Archos"],[c,E]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[u,[d,"Archos"],[c,h]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[d,u,[c,E]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[d,u,[c,h]],[/(kobo)\s(ereader|touch)/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],[d,u,[c,E]],[/(surface duo)/i],[u,[d,D],[c,E]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[d,"Fairphone"],[c,h]],[/(u304aa)/i],[u,[d,"AT&T"],[c,h]],[/\bsie-(\w*)/i],[u,[d,"Siemens"],[c,h]],[/\b(rct\w+) b/i],[u,[d,"RCA"],[c,E]],[/\b(venue[\d ]{2,7}) b/i],[u,[d,"Dell"],[c,E]],[/\b(q(?:mv|ta)\w+) b/i],[u,[d,"Verizon"],[c,E]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[d,"Barnes & Noble"],[c,E]],[/\b(tm\d{3}\w+) b/i],[u,[d,"NuVision"],[c,E]],[/\b(k88) b/i],[u,[d,"ZTE"],[c,E]],[/\b(nx\d{3}j) b/i],[u,[d,"ZTE"],[c,h]],[/\b(gen\d{3}) b.+49h/i],[u,[d,"Swiss"],[c,h]],[/\b(zur\d{3}) b/i],[u,[d,"Swiss"],[c,E]],[/\b((zeki)?tb.*\b) b/i],[u,[d,"Zeki"],[c,E]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[d,"Dragon Touch"],u,[c,E]],[/\b(ns-?\w{0,9}) b/i],[u,[d,"Insignia"],[c,E]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[d,"NextBook"],[c,E]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[d,"Voice"],u,[c,h]],[/\b(lvtel\-)?(v1[12]) b/i],[[d,"LvTel"],u,[c,h]],[/\b(ph-1) /i],[u,[d,"Essential"],[c,h]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[d,"Envizen"],[c,E]],[/\b(trio[-\w\. ]+) b/i],[u,[d,"MachSpeed"],[c,E]],[/\btu_(1491) b/i],[u,[d,"Rotor"],[c,E]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[u,[d,C],[c,E]],[/(sprint) (\w+)/i],[d,u,[c,h]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[d,D],[c,h]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[d,K],[c,E]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[d,K],[c,h]],[/smart-tv.+(samsung)/i],[d,[c,y]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[d,k],[c,y]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[d,"LG"],[c,y]],[/(apple) ?tv/i],[d,[u,m+" TV"],[c,y]],[/crkey/i],[[u,N+"cast"],[d,A],[c,y]],[/droid.+aft(\w+)( bui|\))/i],[u,[d,I],[c,y]],[/(shield \w+ tv)/i],[u,[d,C],[c,y]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[u,[d,V],[c,y]],[/(bravia[\w ]+)( bui|\))/i],[u,[d,x],[c,y]],[/(mi(tv|box)-?\w+) bui/i],[u,[d,F],[c,y]],[/Hbbtv.*(technisat) (.*);/i],[d,u,[c,y]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[d,Y],[u,Y],[c,y]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[u,[c,y]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,y]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[d,u,[c,g]],[/droid.+; (shield)( bui|\))/i],[u,[d,C],[c,g]],[/(playstation \w+)/i],[u,[d,x],[c,g]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[d,D],[c,g]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[u,[d,k],[c,v]],[/((pebble))app/i,/(asu
vendor: 8,993 bytes, line 2
2s|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[d,u,[c,v]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[u,[d,P],[c,v]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[u,[d,m],[c,v]],[/(opwwe\d{3})/i],[u,[d,M],[c,v]],[/(moto 360)/i],[u,[d,U],[c,v]],[/(smartwatch 3)/i],[u,[d,x],[c,v]],[/(g watch r)/i],[u,[d,"LG"],[c,v]],[/droid.+; (wt63?0{2,3})\)/i],[u,[d,K],[c,v]],[/droid.+; (glass) \d/i],[u,[d,A],[c,v]],[/(pico) (4|neo3(?: link|pro)?)/i],[d,u,[c,v]],[/; (quest( \d| pro)?)/i],[u,[d,G],[c,v]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[d,[c,_]],[/(aeobc)\b/i],[u,[d,I],[c,_]],[/(homepod).+mac os/i],[u,[d,m],[c,_]],[/windows iot/i],[[c,_]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[u,[c,h]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[c,E]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,E]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,h]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[u,[d,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[p,[l,"EdgeHTML"]],[/(arkweb)\/([\w\.]+)/i],[l,p],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[p,[l,"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],[l,p],[/ladybird\//i],[[l,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[p,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,p],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[l,[p,$,Q]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[p,$,Q],[l,"Windows"]],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[p,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,B],[p,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[p,l],[/(ubuntu) ([\w\.]+) like android/i],[[l,/(.+)/,"$1 Touch"],p],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[l,p],[/\(bb(10);/i],[p,[l,b]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[p,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[p,[l,T+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[p,[l,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[p,[l,"watchOS"]],[/crkey\/([\d\.]+)/i],[p,[l,N+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[l,j],p],[/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)(?: arm\w*| x86\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,p],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],p],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[l,p]]},ee=function(t,r){if(typeof t===o&&(r=t,t=void 0),!(this instanceof ee))return new ee(t,r).getResult();var g=typeof e!==n&&e.navigator?e.navigator:void 0,y=t||(g&&g.userAgent?g.userAgent:""),v=g&&g.userAgentData?g.userAgentData:void 0,_=r?q(Z,r):Z,I=g&&g.userAgent==y;return this.getBrowser=function(){var e,t={};return t[l]=void 0,t[p]=void 0,J.call(t,y,_.browser),t[s]=typeof(e=t[p])===a?e.replace(/[^\d\.]/g,"").split(".")[0]:void 0,I&&g&&g.brave&&typeof g.brave.isBrave==i&&(t[l]="Brave"),t},this.getCPU=function(){var e={};return e[f]=void 0,J.call(e,y,_.cpu),e},this.getDevice=function(){var e={};return e[d]=void 0,e[u]=void 0,e[c]=void 0,J.call(e,y,_.device),I&&!e[c]&&v&&v.mobile&&(e[c]=h),I&&"Macintosh"==e[u]&&g&&typeof g.standalone!==n&&g.maxTouchPoints&&g.maxTouchPoints>2&&(e[u]="iPad",e[c]=E),e},this.getEngine=function(){var e={};return e[l]=void 0,e[p]=void 0,J.call(e,y,_.engine),e},this.getOS=function(){var e={};return e[l]=void 0,e[p]=void 0,J.call(e,y,_.os),I&&!e[l]&&v&&v.platform&&"Unknown"!=v.platform&&(e[l]=v.platform.replace(/chrome os/i,j).replace(/macos/i,B)),e},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 y},this.setUA=function(e){return y=typeof e===a&&e.length>500?Y(e,500):e,this},this.setUA(y),this};ee.VERSION="1.0.41",ee.BROWSER=H([l,p,s]),ee.CPU=H([f]),ee.DEVICE=H([u,d,c,g,h,y,E,v,_]),ee.ENGINE=ee.OS=H([l,p]),t.exports&&(r=t.exports=ee),r.UAParser=ee;var et=typeof e!==n&&(e.jQuery||e.Zepto);if(et&&!et.ua){var er=new ee;et.ua=er.getResult(),et.ua.get=function(){return er.getUA()},et.ua.set=function(e){er.setUA(e);var t=er.getResult();for(var r in t)et.ua[r]=t[r]}}}("object"==typeof window?window:e.e)},700742,(e,t,r)=>{"use strict";try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}var n="function"==typeof Symbol&&Symbol.for,o=n?Symbol.for("react.element"):60103,a=n?Symbol.for("react.portal"):60106,s=n?Symbol.for("react.fragment"):60107,u=n?Symbol.for("react.strict_mode"):60108,l=n?Symbol.for("react.profiler"):60114,c=n?Symbol.for("react.provider"):60109,d=n?Symbol.for("react.context"):60110,p=n?Symbol.for("react.async_mode"):60111,f=n?Symbol.for("react.concurrent_mode"):60111,g=n?Symbol.for("react.forward_ref"):60112,h=n?Symbol.for("react.suspense"):60113,E=n?Symbol.for("react.suspense_list"):60120,y=n?Symbol.for("react.memo"):60115,v=n?Symbol.for("react.lazy"):60116,_=n?Symbol.for("react.block"):60121,I=n?Symbol.for("react.fundamental"):60117,m=n?Symbol.for("react.responder"):60118,O=n?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case o:switch(e=e.type){case p:case f:case s:case l:case u:case h:return e;default:switch(e=e&&e.$$typeof){case d:case g:case v:case y:case c:return e;default:return t}}case a:return t}}}function R(e){return b(e)===f}r.AsyncMode=p,r.ConcurrentMode=f,r.ContextConsumer=d,r.ContextProvider=c,r.Element=o,r.ForwardRef=g,r.Fragment=s,r.Lazy=v,r.Memo=y,r.Portal=a,r.Profiler=l,r.StrictMode=u,r.Suspense=h,r.isAsyncMode=function(e){return R(e)||b(e)===p},r.isConcurrentMode=R,r.isContextConsumer=function(e){return b(e)===d},r.isContextProvider=function(e){return b(e)===c},r.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},r.isForwardRef=function(e){return b(e)===g},r.isFragment=function(e){return b(e)===s},r.isLazy=function(e){return b(e)===v},r.isMemo=function(e){return b(e)===y},r.isPortal=function(e){return b(e)===a},r.isProfiler=function(e){return b(e)===l},r.isStrictMode=function(e){return b(e)===u},r.isSuspense=function(e){return b(e)===h},r.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===f||e===l||e===u||e===h||e===E||"object"==typeof e&&null!==e&&(e.$$typeof===v||e.$$typeof===y||e.$$typeof===c||e.$$typeof===d||e.$$typeof===g||e.$$typeof===I||e.$$typeof===m||e.$$typeof===O||e.$$typeof===_)},r.typeOf=b},127142,(e,t,r)=>{"use strict";try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}t.exports=e.r(700742)},705927,(e,t,r)=>{"use strict";try{var i="u">typeof window?window:e.g;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}var n=e.r(127142),o={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},u={};function l(e){return n.isMemo(e)?s:u[e.$$typeof]||o}u[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},u[n.Memo]=s;var c=Object.defineProperty,d=Object.getOwnPropertyNames,p=Object.getOwnPropertySymbols,f=Object.getOwnPropertyDescriptor,g=Object.getPrototypeOf,h=Object.prototype;
2t.exports=function e(t,r,i){if("string"!=typeof r){if(h){var n=g(r);n&&n!==h&&e(t,n,i)}var o=d(r);p&&(o=o.concat(p(r)));for(var s=l(t),u=l(r),E=0;E<o.length;++E){var y=o[E];if(!a[y]&&!(i&&i[y])&&!(u&&u[y])&&!(s&&s[y])){var v=f(r,y);try{c(t,y,v)}catch(e){}}}}return t}},454917,691666,111112,e=>{"use strict";try{var t=window;t._sentryModuleMetadata=t._sentryModuleMetadata||{},t._sentryModuleMetadata[(new t.Error).stack]=Object.assign({},t._sentryModuleMetadata[(new t.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let r=Object.freeze({strictlyNecessaryCookies:!0,performanceCookies:!1,functionalCookies:!1,targetingCookies:!1,socialMediaCookies:!1,videoCookies:!1});Object.freeze(["strictlyNecessaryCookies","performanceCookies","functionalCookies","targetingCookies","socialMediaCookies","videoCookies"]);let i=Object.freeze({C0001:"strictlyNecessaryCookies",C0002:"performanceCookies",C0003:"functionalCookies",C0004:"targetingCookies",C0005:"socialMediaCookies",VID1:"videoCookies"});e.s(["DEFAULT_CONSENT",0,r,"ONETRUST_CONSENT_COOKIE_NAME",0,"OptanonConsent","ONETRUST_CONSENT_UPDATE_EVENT_NAME",0,"consent.onetrust","ONETRUST_COOKIE_BANNER_DISMISSED_COOKIE_NAME",0,"OptanonAlertBoxClosed","ONETRUST_GROUP_MAPPING",0,i,"ONETRUST_PERFORMANCE_GROUP_ID",0,"C0002"],454917);try{var n=window;n._sentryModuleMetadata=n._sentryModuleMetadata||{},n._sentryModuleMetadata[(new n.Error).stack]=Object.assign({},n._sentryModuleMetadata[(new n.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}e.s(["getOneTrustConsentFromCookies",0,function(e){if(!e)return{...r};let t=new URLSearchParams(e).get("groups");return t?t.split(",").reduce((e,t)=>{let[r,n]=t.split(":");return r&&n&&r in i&&(e[i[r]]="1"===n),e},{...r}):{...r}}],691666);try{var o=window;o._sentryModuleMetadata=o._sentryModuleMetadata||{},o._sentryModuleMetadata[(new o.Error).stack]=Object.assign({},o._sentryModuleMetadata[(new o.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}e.s(["hasConsent",0,function(e,t){return"strictlyNecessaryCookie
2s"===t||e[t]}],111112)},781552,551380,117823,e=>{"use strict";var t=e.i(852345),r=e.i(541224),i=e.i(313403);try{var n="u">typeof window?window:e.g;n._sentryModuleMetadata=n._sentryModuleMetadata||{},n._sentryModuleMetadata[(new n.Error).stack]=Object.assign({},n._sentryModuleMetadata[(new n.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let o=(e,t)=>{let r=e instanceof Map?e:new Map(e.entries()),i=t instanceof Map?t:new Map(t.entries());if(r.size!==i.size)return!1;for(let[e,t]of r)if(!i.has(e)||!Object.is(t,i.get(e)))return!1;return!0};try{var a="u">typeof window?window:e.g;a._sentryModuleMetadata=a._sentryModuleMetadata||{},a._sentryModuleMetadata[(new a.Error).stack]=Object.assign({},a._sentryModuleMetadata[(new a.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}var s=e.i(546186);try{var u=window;u._sentryModuleMetadata=u._sentryModuleMetadata||{},u._sentryModuleMetadata[new u.Error().stack]=Object.assign({},u._sentryModuleMetadata[new u.Error().stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}function l(e){return{consent:e.consent,hasLoaded:e.hasLoaded,hasInteracted:e.hasInteracted,updatedAt:e.updatedAt}}function c(e){return e.consent}function d(e){return e.hasLoaded}e.s(["useConsent",0,function(){let e;return(0,r.useStore)(s.consentStore,(e=i.default.useRef(void 0),t=>{let r=l(t);return!function(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t||Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;if(Symbol.iterator in e&&Symbol.iterator in t){if("entries"in e&&"entries"in t)return o(e,t);let r=e[Symbol.iterator](),i=t[Symbol.iterator](),n=r.next(),a=i.next();for(;!n.done&&!a.done;){if(!Object.is(n.value,a.value))return!1;n=r.next(),a=i.next()}return!!n.done&&!!a.done}return o({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)})}(e.current,r)?e.current=r:e.current}))},"useConsentLoaded",0,function(){return(0,r.useStore)(s.consentStore,d)},"useConsentValues",0,function(){return(0,r.useStore)(s.consentStore,c)},"useHasConsent",0,function(e){let i,n=(0,t.c)(2);return n[0]!==e?(i=t=>t.hasConsent(e),n[0]=e,n[1]=i):i=n[1],(0,r.useStore)(s.consentStore,i)}],551380);try{var p=window;p._sentryModuleMetadata=p._sentryModuleMetadata||{},p._sentryModuleMetadata[new p.Error().stack]=Object.assign({},p._sentryModuleMetadata[new p.Error().stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}function f(){return(0,s.initializeConsentStore)()}e.s(["ConsentInitializer",0,function(){let e,r=(0,t.c)(1);return r[0]===Symbol.for("react.memo_cache_sentinel")?(e=[],r[0]=e):e=r[0],(0,i.useEffect)(f,e),null}],117823);try{var g=window;g._sentryModuleMetadata=g._sentryModuleMetadata||{},g._sentryModuleMetadata[(new g.Error).stack]=Object.assign({},g._sentryModuleMetadata[(new g.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}e.s([],781552)},546186,e=>{"use strict";var t=e.i(475633),r=e.i(420748),i=e.i(454917);e.i(284221);var n=e.i(477265);try{var o=window;o._sentryModuleMetadata=o._sentryModuleMetadata||{},o._sentryModuleMetadata[(new o.Error).stack]=Object.assign({},o._sentryModuleMetadata[(new o.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let a={get(e){let t=document.cookie.split("; ").find(t=>{let[r]=t.split("=");return r===e});return t?Promise.resolve(decodeURIComponent(t.split("=").slice(1).join("="))):Promise.resolve(void 0)},set(e,t,r){if(!e||"string"!=typeof e)return(0,n.handleClientError)(Error("[CookieStore] Cookie name must be a non-empty string"),{context:{layer:"browserCookieStore",operation:"set"}}),Promise.resolve();let i=encodeURIComponent(t),o=[`${e}=${i}`,r?.expiresDays?`expires=${new Date(Date.now()+864e5*r.expiresDays).toUTCString()}`:void 0,r?.maxAge?`Max-Age=${r.maxAge}`:void 0,r?.path?`Path=${r.path}`:void 0,r?.domain?`Domain=${r.domain}`:void 0,r?.secure?"Secure":void 0,r?.sameSite?`SameSite=${r.sameSite}`:void 0].filter(Boolean);return document.cookie=o.join("; "),Promise.resolve()},delete(e,t){let r=t?.path||"/",i=t?.domain?`; domain=${t.domain}`:"";return document.cookie=`${e}=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=${r}${i}`,Promise.resolve()}};var s=e.i(691666);try{var u=window;u._sentryModuleMetadata=u._sentryModuleMetadata||{},u._sentryModuleMetadata[(new u.Error).stack]=Object.assign({},u._sentryModuleMetadata[(new u.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}async function l(){let e=await a.get(i.ONETRUST_CONSENT_COOKIE_NAME);
2return(0,s.getOneTrustConsentFromCookies)(e)}async function c(){return!!await a.get(i.ONETRUST_COOKIE_BANNER_DISMISSED_COOKIE_NAME)}var d=e.i(111112);try{var p=window;p._sentryModuleMetadata=p._sentryModuleMetadata||{},p._sentryModuleMetadata[(new p.Error).stack]=Object.assign({},p._sentryModuleMetadata[(new p.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let f=(0,t.createStore)()((0,r.subscribeWithSelector)((e,t)=>{let r=new Set,n=e=>{r.forEach(({callback:t})=>t(e))};return{hasLoaded:!1,hasInteracted:!1,consent:i.DEFAULT_CONSENT,updatedAt:null,setConsent:t=>{e({consent:t,updatedAt:new Date().toISOString()}),n(t)},setState:t=>{e(t)},hasConsent:e=>(0,d.hasConsent)(t().consent,e),loadConsent:async()=>{try{let[t,r]=await Promise.all([l(),c()]),i={...t,strictlyNecessaryCookies:!0};e({hasLoaded:!0,hasInteracted:r,consent:i,updatedAt:r?new Date().toISOString():null}),n(i)}catch(e){console.warn("Error loading consent",e)}},subscribeToConsent:e=>{let t={callback:e};return r.add(t),()=>r.delete(t)}}}));e.s(["consentStore",0,f,"initializeConsentStore",0,function(){let{loadConsent:e}=f.getState();e();let t=()=>void e();return window.addEventListener(i.ONETRUST_CONSENT_UPDATE_EVENT_NAME,t),()=>{window.removeEventListener(i.ONETRUST_CONSENT_UPDATE_EVENT_NAME,t)}}],546186)},798301,e=>{"use strict";var t=e.i(852345),r=e.i(313403),i=e.i(493878);e.i(158024);var n=e.i(777156);e.i(781552);var o=e.i(551380);try{var a=window;a._sentryModuleMetadata=a._sentryModuleMetadata||{},a._sentryModuleMetadata[new a.Error().stack]=Object.assign({},a._sentryModuleMetadata[new a.Error().stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let s=e=>{let a,s=(0,t.c)(4),u=(0,r.useContext)(i.OptimizelySdkContext),l=(0,o.useHasConsent)("performanceCookies");return s[0]!==e||s[1]!==u||s[2]!==l?(a=()=>{u&&l&&u.decide(e,[n.OptimizelyDecideOption.EXCLUDE_VARIABLES])},s[0]=e,s[1]=u,s[2]=l,s[3]=a):a=s[3],a},u=e=>{let i,n,o=(0,t.c)(5),a=s(e);return o[0]!==a?(i=()=>{a()},o[0]=a,o[1]=i):i=o[1],o[2]!==e||o[3]!==a?(n=[e,a],o[2]=e,o[3]=a,o[4]=n):n=o[4],(0,r.useEffect)(i,n),null};e.s(["TrackFeatureFlagView",0,e=>{let{featureKey:t}=e;return u(t),null},"useTrackEvent",0,e=>{let n,a=(0,t.c)(4),s=(0,r.useContext)(i.OptimizelySdkContext),u=(0,o.useHasConsent)("performanceCookies");return a[0]!==e||a[1]!==s||a[2]!==u?(n=()=>((e,t,r)=>{if(window.optimizely=window.optimizely||[],window.optimizely.push({type:"event",eventName:e}),t?.isReady()&&r)try{t.track(e)}catch(e){console.error("[HUEL] Error tracking event - exception caught",e)}})(e,s,u),a[0]=e,a[1]=s,a[2]=u,a[3]=n):n=a[3],n},"useTrackFeatureFlagView",0,u,"useTrackFeatureFlagViewOnAction",0,s])},493878,777156,158024,e=>{"use strict";let t;var r,i,n,o,a,s,u,l,c,d,p,f,g,h,E,y,v,_,I,m,O,b,R,N=e.i(852345),T=e.i(662109),A=e.i(313403);try{var S="u">typeof window?window:e.g;S._sentryModuleMetadata=S._sentryModuleMetadata||{},S._sentryModuleMetadata[(new S.Error).stack]=Object.assign({},S._sentryModuleMetadata[(new S.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let w="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);try{var D="u">typeof window?window:e.g;D._sentryModuleMetadata=D._sentryModuleMetadata||{},D._sentryModuleMetadata[(new D.Error).stack]=Object.assign({},D._sentryModuleMetadata[(new D.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let U=new Uint8Array(16);try{var C="u">typeof window?window:e.g;C._sentryModuleMetadata=C._sentryModuleMetadata||{},C._sentryModuleMetadata[(new C.Error).stack]=Object.assign({},C._sentryModuleMetadata[(new C.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}try{var M="u">typeof window?window:e.g;M._sentryModuleMetadata=M._sentryModuleMetadata||{},M._sentryModuleMetadata[(new M.Error).stack]=Object.assign({},M._sentryModuleMetadata[(new M.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}try{var L="u">typeof window?window:e.g;L._sentryModuleMetadata=L._sentryModuleMetadata||{},L._sentryModuleMetadata[(new L.Error).stack]=Object.assign({},L._sentryModuleMetadata[(new L.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let P=[];for(let e=0;e<256;++e)P.push((e+256).toString(16).slice(1));try{var k="u">typeof window?window:e.g;k._sentryModuleMetadata=k._sentryModuleMetadata||{},k._sentryModuleMetadata[(new k.Error).stack]=Object.assign({},k._sentryModuleMetadata[(new k.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let V=function(e,r,i){if(w&&!r&&!e)return w();let n=(e=e||{}).random||(e.rng||function(){if(!t&&!(t="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return t(U)})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,r){i=i||0;for(let e=0;e<16;++e)r[i+e]=n[e];return r}return function(e,t=0){return P[e[t+0]]+P[e[t+1]]+P[e[t+2]]+P[e[t+3]]+"-"+P[e[t+4]]+P[e[t+5]]+"-"+P[e[t+6]]+P[e[t+7]]+"-"+P[e[t+8]]+P[e[t+9]]+"-"+P[e[t+10]]+P[e[t+11]]+P[e[t+12]]+P[e[t+13]]+P[e[t+14]]+P[e[t+15]]}(n)};var x=e.i(138200),F=e.i(788177),K=e.i(798539);try{var G="u">typeof window?window:e.g;G._sentryModuleMetadata=G._sentryModuleMetadata||{},G._sentryModuleMetadata[(new G.Error).stack]=Object.assign({},G._sentryModuleMetadata[(new G.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}
2var j=function(e,t){return(j=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function B(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var z=function(){return(z=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function q(e,t,r,i){return new(r||(r=Promise))(function(n,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((i=i.apply(e,t||[])).next())})}function H(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(r=1,i&&(n=2&l[0]?i.return:l[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,l[1])).done)return n;switch(i=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,i=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){a.label=l[1];break}if(6===l[0]&&a.label<n[1]){a.label=n[1],n=l;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(l);break}n[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],i=0}finally{r=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function X(e,t,r){if(r||2==arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var W=new(function(){function e(){}return e.prototype.handleError=function(e){},e}());function Y(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];if(!e)return{};if("function"==typeof Object.assign)return Object.assign.apply(Object,X([e],t,!1));for(var i=Object(e),n=0;n<t.length;n++){var o=t[n];if(null!=o)for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a])}return i}function J(e,t){return e?function(e,t){var r={};return e.forEach(function(e){r[t(e)]=e}),r}(e,function(e){return e[t]}):{}}function $(){return V()}function Q(e,t){for(var r=!1,i=Object.keys(e),n=0;n<i.length;n++)if(t===e[i[n]]){r=!0;break}return r}function Z(e){return Object.keys(e).map(function(t){return e[t]})}function ee(e,t){for(var r,i=0;i<e.length;i++){var n=e[i];if(t(n)){r=n;break}}return r}function et(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=0;return e.replace(/%s/g,function(){var e=t[i++],r=typeof e;return"function"===r?e():"string"===r?e:String(e)})}var er=function(){return Math.round(new Date().getTime())},ei=function(e){return"number"==typeof e&&0x20000000000000>=Math.abs(e)},en=function(e){return"number"==typeof e};(r=g||(g={}))[r.NOTSET=0]="NOTSET",r[r.DEBUG=1]="DEBUG",r[r.INFO=2]="INFO",r[r.WARNING=3]="WARNING",r[r.ERROR=4]="ERROR";var eo={NOTSET:0,DEBUG:1,INFO:2,WARNING:3,ERROR:4};function ea(e){return"string"!=typeof e?e:("WARN"===(e=e.toUpperCase())&&(e="WARNING"),eo[e])?eo[e]:e}var es=function(){function e(){this.defaultLoggerFacade=new ed,this.loggers={}}return e.prototype.getLogger=function(e){return e?(this.loggers[e]||(this.loggers[e]=new ed({messagePrefix:e})),this.loggers[e]):this.defaultLoggerFacade},e}(),eu=function(){function e(e){void 0===e&&(e={}),this.logLevel=g.NOTSET,void 0!==e.logLevel&&Q(g,e.logLevel)&&this.setLogLevel(e.logLevel),this.logToConsole=void 0===e.logToConsole||!!e.logToConsole,this.prefix=void 0!==e.prefix?e.prefix:"[OPTIMIZELY]"}return e.prototype.log=function(e,t){if(this.shouldLog(e)&&this.logToConsole){var r="".concat(this.prefix," - ").concat(this.getLogLevelName(e)," ").concat(this.getTime()," ").concat(t);this.consoleLog(e,[r])}},e.prototype.setLogLevel=function(e){e=ea(e),Q(g,e)&&void 0!==e?this.logLevel=e:this.logLevel=g.E
2RROR},e.prototype.getTime=function(){return new Date().toISOString()},e.prototype.shouldLog=function(e){return e>=this.logLevel},e.prototype.getLogLevelName=function(e){switch(e){case g.DEBUG:return"DEBUG";case g.INFO:return"INFO ";case g.WARNING:return"WARN ";case g.ERROR:return"ERROR";default:return"NOTSET"}},e.prototype.consoleLog=function(e,t){switch(e){case g.DEBUG:console.log.apply(console,t);break;case g.INFO:console.info.apply(console,t);break;case g.WARNING:console.warn.apply(console,t);break;case g.ERROR:console.error.apply(console,t);break;default:console.log.apply(console,t)}},e}(),el=g.NOTSET,ec=null,ed=function(){function e(e){void 0===e&&(e={}),this.messagePrefix="",e.messagePrefix&&(this.messagePrefix=e.messagePrefix)}return e.prototype.log=function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];this.internalLog(ea(e),{message:t,splat:r})},e.prototype.info=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.namedLog(g.INFO,e,t)},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.namedLog(g.DEBUG,e,t)},e.prototype.warn=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.namedLog(g.WARNING,e,t)},e.prototype.error=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.namedLog(g.ERROR,e,t)},e.prototype.format=function(e){return"".concat(this.messagePrefix?this.messagePrefix+": ":"").concat(et.apply(void 0,X([e.message],e.splat,!1)))},e.prototype.internalLog=function(e,t){!ec||!(e<el)&&(ec.log(e,this.format(t)),t.error&&t.error instanceof Error&&W.handleError(t.error))},e.prototype.namedLog=function(e,t,r){if(t instanceof Error){t=(i=t).message,this.internalLog(e,{error:i,message:t,splat:r});return}if(0===r.length)return void this.internalLog(e,{message:t,splat:r});var i,n=r[r.length-1];n instanceof Error&&(i=n,r.splice(-1)),this.internalLog(e,{message:t,error:i,splat:r})},e}(),ep=new es;function ef(e){return ep.getLogger(e)}function eg(e){ec=e}var eh=function(e){e=ea(e),el=Q(g,e)&&void 0!==e?e:g.ERROR};function eE(e,t){var r=e.context,i=t.context;return r.accountId===i.accountId&&r.projectId===i.projectId&&r.clientName===i.clientName&&r.clientVersion===i.clientVersion&&r.revision===i.revision&&r.anonymizeIP===i.anonymizeIP&&r.botFiltering===i.botFiltering}var ey=ef("EventProcessor"),ev=function(){function e(e){var t=e.timeout,r=e.callback;this.timeout=Math.max(t,0),this.callback=r}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),e_=function(){function e(e){var t=e.sink;this.sink=t}return e.prototype.start=function(){return Promise.resolve()},e.prototype.stop=function(){return Promise.resolve()},e.prototype.enqueue=function(e){this.sink([e])},e}(),eI=function(){function e(e){var t=e.flushInterval,r=e.maxQueueSize,i=e.sink,n=e.closingSink,o=e.batchComparator;this.buffer=[],this.maxQueueSize=Math.max(r,1),this.sink=i,this.closingSink=n,this.batchComparator=o,this.timer=new ev({callback:this.flush.bind(this),timeout:t}),this.started=!1}return e.prototype.start=function(){return this.started=!0,Promise.resolve()},e.prototype.stop=function(){this.started=!1;var e=this.closingSink?this.closingSink(this.buffer):this.sink(this.buffer);return this.buffer=[],this.timer.stop(),e},e.prototype.enqueue=function(e){if(!this.started)return void ey.warn("Queue is stopped, not accepting event");var t=this.buffer[0];t&&!this.batchComparator(t,e)&&this.flush(),0===this.buffer.length&&this.timer.refresh(),this.buffer.push(e),this.buffer.length>=this.maxQueueSize&&this.flush()},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e}(),em={NOTSET:0,DEBUG:1,INFO:2,WARNING:3,ERROR:4},eO={BROWSER_ODP_MANAGER_INITIALIZATION_FAILED:"%s: Error initializing Browser ODP Manager.",CONDITION_EVALUATOR_ERROR:"%s: Error evaluating audience condition of type %s: %s",DATAFILE_AND_SDK_KEY_MISSING:"%s: You must provide at least one of sdkKey or datafile. Cannot start Optimizely",EXPERIMENT_KEY_NOT_IN_DATAFILE:"%s: Experiment key %s is not in datafile.",FEATURE_NOT_IN_DATAFILE:"%s: Feature key %s is not in datafile.",FETCH_SEGMENTS_FAILED_NETWORK_E
2RROR:"%s: Audience segments fetch failed. (network error)",FETCH_SEGMENTS_FAILED_DECODE_ERROR:"%s: Audience segments fetch failed. (decode error)",IMPROPERLY_FORMATTED_EXPERIMENT:"%s: Experiment key %s is improperly formatted.",INVALID_ATTRIBUTES:"%s: Provided attributes are in an invalid format.",INVALID_BUCKETING_ID:"%s: Unable to generate hash for bucketing ID %s: %s",INVALID_DATAFILE:"%s: Datafile is invalid - property %s: %s",INVALID_DATAFILE_MALFORMED:"%s: Datafile is invalid because it is malformed.",INVALID_CONFIG:"%s: Provided Optimizely config is in an invalid format.",INVALID_JSON:"%s: JSON object is not valid.",INVALID_ERROR_HANDLER:'%s: Provided "errorHandler" is in an invalid format.',INVALID_EVENT_DISPATCHER:'%s: Provided "eventDispatcher" is in an invalid format.',INVALID_EVENT_TAGS:"%s: Provided event tags are in an invalid format.",INVALID_EXPERIMENT_KEY:"%s: Experiment key %s is not in datafile. It is either invalid, paused, or archived.",INVALID_EXPERIMENT_ID:"%s: Experiment ID %s is not in datafile.",INVALID_GROUP_ID:"%s: Group ID %s is not in datafile.",INVALID_LOGGER:'%s: Provided "logger" is in an invalid format.',INVALID_ROLLOUT_ID:"%s: Invalid rollout ID %s attached to feature %s",INVALID_USER_ID:"%s: Provided user ID is in an invalid format.",INVALID_USER_PROFILE_SERVICE:"%s: Provided user profile service instance is in an invalid format: %s.",LOCAL_STORAGE_DOES_NOT_EXIST:"Error accessing window localStorage.",MISSING_INTEGRATION_KEY:"%s: Integration key missing from datafile. All integrations should include a key.",NO_DATAFILE_SPECIFIED:"%s: No datafile specified. Cannot start optimizely.",NO_JSON_PROVIDED:"%s: No JSON object to validate against schema.",NO_VARIATION_FOR_EXPERIMENT_KEY:"%s: No variation key %s defined in datafile for experiment %s.",ODP_CONFIG_NOT_AVAILABLE:"%s: ODP is not integrated to the project.",ODP_EVENT_FAILED:"ODP event send failed.",ODP_FETCH_QUALIFIED_SEGMENTS_SEGMENTS_MANAGER_MISSING:"%s: ODP unable to fetch qualified segments (Segments Manager not initialized).",ODP_IDENTIFY_FAILED_EVENT_MANAGER_MISSING:"%s: ODP identify event %s is not dispatched (Event Manager not instantiated).",ODP_INITIALIZATION_FAILED:"%s: ODP failed to initialize.",ODP_INVALID_DATA:"%s: ODP data is not valid",ODP_EVENT_FAILED_ODP_MANAGER_MISSING:"%s: ODP Event failed to send. (ODP Manager not initialized).",ODP_FETCH_QUALIFIED_SEGMENTS_FAILED_ODP_MANAGER_MISSING:"%s: ODP failed to Fetch Qualified Segments. (ODP Manager not initialized).",ODP_IDENTIFY_USER_FAILED_ODP_MANAGER_MISSING:"%s: ODP failed to Identify User. (ODP Manager not initialized).",ODP_IDENTIFY_USER_FAILED_USER_CONTEXT_INITIALIZATION:"%s: ODP failed to Identify User. (Failed during User Context Initialization).",ODP_MANAGER_UPDATE_SETTINGS_FAILED_EVENT_MANAGER_MISSING:"%s: ODP Manager failed to update OdpConfig settings for internal event manager. (Event Manager not initialized).",ODP_MANAGER_UPDATE_SETTINGS_FAILED_SEGMENTS_MANAGER_MISSING:"%s: ODP Manager failed to update OdpConfig settings for internal segments manager. (Segments Manager not initialized).",ODP_NOT_ENABLED:"ODP is not enabled",ODP_NOT_INTEGRATED:"%s: ODP is not integrated",ODP_SEND_EVENT_FAILED_EVENT_MANAGER_MISSING:"%s: ODP send event %s was not dispatched (Event Manager not instantiated).",ODP_SEND_EVENT_FAILED_UID_MISSING:"%s: ODP send event %s was not dispatched (No valid user identifier provided).",ODP_SEND_EVENT_FAILED_VUID_MISSING:"%s: ODP send event %s was not dispatched (Unable to fetch VUID).",ODP_VUID_INITIALIZATION_FAILED:"%s: ODP VUID initialization failed.",ODP_VUID_REGISTRATION_FAILED:"%s: ODP VUID failed to be registered.",ODP_VUID_REGISTRATION_FAILED_EVENT_MANAGER_MISSING:"%s: ODP register vuid failed. (Event Manager not instantiated).",UNDEFINED_ATTRIBUTE:"%s: Provided attribute: %s has an undefined value.",UNRECOGNIZED_ATTRIBUTE:"%s: Unrecognized attribute %s provided. Pruning before sending event to Optimizely.",UNABLE_TO_CAST_VALUE:"%s: Unable to cast value %s to type %s, returning null.",USER_NOT_IN_FORCED_VARIATION:"%s: User %s is not in the forced variation map. Cannot remove their forced variation.",USER_PROFILE_LOOKUP_ERROR:'%s: Error while looking up user profile for user ID "%s": %s.',USER_PROFILE_SAVE_ERROR:'%s: Error while saving user profile for user ID "%s": %s.',VARIABLE_KEY_NOT_IN_DATAFILE:'%s: Variable with key "%s" associated with feature with key "%s" is not in datafile.',VARIATION_ID_NOT_IN_DATAFILE:"%s: N
2o variation ID %s defined in datafile for experiment %s.",VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT:"%s: Variation ID %s is not in the datafile.",INVALID_INPUT_FORMAT:"%s: Provided %s is in an invalid format.",INVALID_DATAFILE_VERSION:"%s: This version of the JavaScript SDK does not support the given datafile version: %s",INVALID_VARIATION_KEY:"%s: Provided variation key is in an invalid format."},eb={ACTIVATE_USER:"%s: Activating user %s in experiment %s.",DISPATCH_CONVERSION_EVENT:"%s: Dispatching conversion event to URL %s with params %s.",DISPATCH_IMPRESSION_EVENT:"%s: Dispatching impression event to URL %s with params %s.",DEPRECATED_EVENT_VALUE:"%s: Event value is deprecated in %s call.",EVENT_KEY_NOT_FOUND:"%s: Event key %s is not in datafile.",EXPERIMENT_NOT_RUNNING:"%s: Experiment %s is not running.",FEATURE_ENABLED_FOR_USER:"%s: Feature %s is enabled for user %s.",FEATURE_NOT_ENABLED_FOR_USER:"%s: Feature %s is not enabled for user %s.",FEATURE_HAS_NO_EXPERIMENTS:"%s: Feature %s is not attached to any experiments.",FAILED_TO_PARSE_VALUE:'%s: Failed to parse event value "%s" from event tags.',FAILED_TO_PARSE_REVENUE:'%s: Failed to parse revenue value "%s" from event tags.',FORCED_BUCKETING_FAILED:"%s: Variation key %s is not in datafile. Not activating user %s.",INVALID_OBJECT:"%s: Optimizely object is not valid. Failing %s.",INVALID_CLIENT_ENGINE:"%s: Invalid client engine passed: %s. Defaulting to node-sdk.",INVALID_DEFAULT_DECIDE_OPTIONS:"%s: Provided default decide options is not an array.",INVALID_DECIDE_OPTIONS:"%s: Provided decide options is not an array. Using default decide options.",INVALID_VARIATION_ID:"%s: Bucketed into an invalid variation ID. Returning null.",NOTIFICATION_LISTENER_EXCEPTION:"%s: Notification listener for (%s) threw exception: %s",NO_ROLLOUT_EXISTS:"%s: There is no rollout of feature %s.",NOT_ACTIVATING_USER:"%s: Not activating user %s for experiment %s.",NOT_TRACKING_USER:"%s: Not tracking user %s.",ODP_DISABLED:"ODP Disabled.",ODP_IDENTIFY_FAILED_ODP_DISABLED:"%s: ODP identify event for user %s is not dispatched (ODP disabled).",ODP_IDENTIFY_FAILED_ODP_NOT_INTEGRATED:"%s: ODP identify event %s is not dispatched (ODP not integrated).",ODP_SEND_EVENT_IDENTIFIER_CONVERSION_FAILED:"%s: sendOdpEvent failed to parse through and convert fs_user_id aliases",PARSED_REVENUE_VALUE:'%s: Parsed revenue value "%s" from event tags.',PARSED_NUMERIC_VALUE:'%s: Parsed event value "%s" from event tags.',RETURNING_STORED_VARIATION:'%s: Returning previously activated variation "%s" of experiment "%s" for user "%s" from user profile.',ROLLOUT_HAS_NO_EXPERIMENTS:"%s: Rollout of feature %s has no experiments",SAVED_VARIATION:'%s: Saved variation "%s" of experiment "%s" for user "%s".',SAVED_VARIATION_NOT_FOUND:"%s: User %s was previously bucketed into variation with ID %s for experiment %s, but no matching variation was found.",SHOULD_NOT_DISPATCH_ACTIVATE:'%s: Experiment %s is not in "Running" state. Not activating user.',SKIPPING_JSON_VALIDATION:"%s: Skipping JSON schema validation.",TRACK_EVENT:"%s: Tracking event %s for user %s.",UNRECOGNIZED_DECIDE_OPTION:"%s: Unrecognized decide option %s provided.",USER_ASSIGNED_TO_EXPERIMENT_BUCKET:"%s: Assigned bucket %s to user with bucketing ID %s.",USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP:"%s: User %s is in experiment %s of group %s.",USER_BUCKETED_INTO_TARGETING_RULE:"%s: User %s bucketed into targeting rule %s.",USER_IN_FEATURE_EXPERIMENT:"%s: User %s is in variation %s of experiment %s on the feature %s.",USER_IN_ROLLOUT:"%s: User %s is in rollout of feature %s.",USER_NOT_BUCKETED_INTO_EVERYONE_TARGETING_RULE:"%s: User %s not bucketed into everyone targeting rule due to traffic allocation.",USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP:"%s: User %s is not in experiment %s of group %s.",USER_NOT_BUCKETED_INTO_ANY_EXPERIMENT_IN_GROUP:"%s: User %s is not in any experiment of group %s.",USER_NOT_BUCKETED_INTO_TARGETING_RULE:"%s User %s not bucketed into targeting rule %s due to traffic allocation. Trying everyone rule.",USER_NOT_IN_FEATURE_EXPERIMENT:"%s: User %s is not in any experiment on the feature %s.",USER_NOT_IN_ROLLOUT:"%s: User %s is not in rollout of feature %s.",USER_FORCED_IN_VARIATION:"%s: User %s is forced in variation %s.",USER_MAPPED_TO_FORCED_VARIATION:"%s: Set variation %s for experiment %s and user %s in the forced variation map.",USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE:"
2%s: User %s does not meet conditions for targeting rule %s.",USER_MEETS_CONDITIONS_FOR_TARGETING_RULE:"%s: User %s meets conditions for targeting rule %s.",USER_HAS_VARIATION:"%s: User %s is in variation %s of experiment %s.",USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED:"Variation (%s) is mapped to flag (%s), rule (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED:"Variation (%s) is mapped to flag (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID:"Invalid variation is mapped to flag (%s), rule (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID:"Invalid variation is mapped to flag (%s) and user (%s) in the forced decision map.",USER_HAS_FORCED_VARIATION:"%s: Variation %s is mapped to experiment %s and user %s in the forced variation map.",USER_HAS_NO_VARIATION:"%s: User %s is in no variation of experiment %s.",USER_HAS_NO_FORCED_VARIATION:"%s: User %s is not in the forced variation map.",USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT:"%s: No experiment %s mapped to user %s in the forced variation map.",USER_NOT_IN_ANY_EXPERIMENT:"%s: User %s is not in any experiment of group %s.",USER_NOT_IN_EXPERIMENT:"%s: User %s does not meet conditions to be in experiment %s.",USER_RECEIVED_DEFAULT_VARIABLE_VALUE:'%s: User "%s" is not in any variation or rollout rule. Returning default value for variable "%s" of feature flag "%s".',FEATURE_NOT_ENABLED_RETURN_DEFAULT_VARIABLE_VALUE:'%s: Feature "%s" is not enabled for user %s. Returning the default variable value "%s".',VARIABLE_NOT_USED_RETURN_DEFAULT_VARIABLE_VALUE:'%s: Variable "%s" is not used in variation "%s". Returning default value.',USER_RECEIVED_VARIABLE_VALUE:'%s: Got variable value "%s" for variable "%s" of feature flag "%s"',VALID_DATAFILE:"%s: Datafile is valid.",VALID_USER_PROFILE_SERVICE:"%s: Valid user profile service provided.",VARIATION_REMOVED_FOR_USER:"%s: Variation mapped to experiment %s has been removed for user %s.",VARIABLE_REQUESTED_WITH_WRONG_TYPE:'%s: Requested variable type "%s", but variable is of type "%s". Use correct API to retrieve value. Returning None.',VALID_BUCKETING_ID:'%s: BucketingId is valid: "%s"',BUCKETING_ID_NOT_STRING:"%s: BucketingID attribute is not a string. Defaulted to userId",EVALUATING_AUDIENCE:'%s: Starting to evaluate audience "%s" with conditions: %s.',EVALUATING_AUDIENCES_COMBINED:'%s: Evaluating audiences for %s "%s": %s.',AUDIENCE_EVALUATION_RESULT:'%s: Audience "%s" evaluated to %s.',AUDIENCE_EVALUATION_RESULT_COMBINED:"%s: Audiences for %s %s collectively evaluated to %s.",MISSING_ATTRIBUTE_VALUE:'%s: Audience condition %s evaluated to UNKNOWN because no value was passed for user attribute "%s".',UNEXPECTED_CONDITION_VALUE:"%s: Audience condition %s evaluated to UNKNOWN because the condition value is not supported.",UNEXPECTED_TYPE:'%s: Audience condition %s evaluated to UNKNOWN because a value of type "%s" was passed for user attribute "%s".',UNEXPECTED_TYPE_NULL:'%s: Audience condition %s evaluated to UNKNOWN because a null value was passed for user attribute "%s".',UNKNOWN_CONDITION_TYPE:"%s: Audience condition %s has an unknown condition type. You may need to upgrade to a newer release of the Optimizely SDK.",UNKNOWN_MATCH_TYPE:"%s: Audience condition %s uses an unknown match type. You may need to upgrade to a newer release of the Optimizely SDK.",UPDATED_OPTIMIZELY_CONFIG:"%s: Updated Optimizely config to revision %s (project id %s)",OUT_OF_BOUNDS:'%s: Audience condition %s evaluated to UNKNOWN because the number value for user attribute "%s" is not in the range [-2^53, +2^53].',UNABLE_TO_ATTACH_UNLOAD:'%s: unable to bind optimizely.close() to page unload event: "%s"'},eR={BOT_FILTERING:"$opt_bot_filtering",BUCKETING_ID:"$opt_bucketing_id",STICKY_BUCKETING_KEY:"$opt_experiment_bucket_map",USER_AGENT:"$opt_user_agent",FORCED_DECISION_NULL_RULE_KEY:"$opt_null_rule_key"},eN="javascript-sdk",eT="node-sdk",eA="5.4.1",eS={AB_TEST:"ab-test",FEATURE:"feature",FEATURE_TEST:"feature-test",FEATURE_VARIABLE:"feature-variable",ALL_FEATURE_VARIABLES:"all-feature-variables",FLAG:"flag"},ew={FEATURE_TEST:"feature-test",ROLLOUT:"rollout",EXPERIMENT:"experiment"},eD={RULE:"rule",EXPERIMENT:"experiment"},eU={BOOLEAN:"boolean",DOUBLE:"double",INTEGER:"integer",STRING:"string",JSON:"json"},eC={V2:"2",V3:"3",V4:"4"},eM={SDK_NOT_READY:"Optimizely SDK not configured properly yet.",FLAG_KEY_INVALID:'No flag was found for key "%s".',VARIABLE_VALUE_INVALID:'Variable value for key "%s" is invali
2d or wrong type.'};(i=h||(h={})).ACTIVATE="ACTIVATE:experiment, user_id,attributes, variation, event",i.DECISION="DECISION:type, userId, attributes, decisionInfo",i.LOG_EVENT="LOG_EVENT:logEvent",i.OPTIMIZELY_CONFIG_UPDATE="OPTIMIZELY_CONFIG_UPDATE",i.TRACK="TRACK:event_key, user_id, attributes, event_tags, event",(n=E||(E={})).VUID="vuid",n.FS_USER_ID="fs_user_id";var eL="fs-user-id",eP="fullstack";(o=y||(y={})).IDENTIFIED="identified",o.INITIALIZED="client_initialized";var ek=Object.freeze({__proto__:null,LOG_LEVEL:em,ERROR_MESSAGES:eO,LOG_MESSAGES:eb,CONTROL_ATTRIBUTES:eR,JAVASCRIPT_CLIENT_ENGINE:eN,NODE_CLIENT_ENGINE:eT,REACT_CLIENT_ENGINE:"react-sdk",REACT_NATIVE_CLIENT_ENGINE:"react-native-sdk",REACT_NATIVE_JS_CLIENT_ENGINE:"react-native-js-sdk",CLIENT_VERSION:eA,DECISION_NOTIFICATION_TYPES:eS,DECISION_SOURCES:ew,AUDIENCE_EVALUATION_TYPES:eD,FEATURE_VARIABLE_TYPES:eU,DATAFILE_VERSIONS:eC,DECISION_MESSAGES:eM,get NOTIFICATION_TYPES(){return h},REQUEST_TIMEOUT_MS:6e4,REQUEST_TIMEOUT_ODP_SEGMENTS_MS:1e4,REQUEST_TIMEOUT_ODP_EVENTS_MS:1e4,get ODP_USER_KEY(){return E},FS_USER_ID_ALIAS:eL,ODP_DEFAULT_EVENT_TYPE:eP,get ODP_EVENT_ACTION(){return y}}),eV=ef("EventProcessor"),ex=ef("EventProcessor"),eF=function(){function e(e){var t=e.key,r=e.maxValues;this.LS_KEY=t,this.maxValues=void 0===r?1e3:r}return e.prototype.get=function(e){return this.getMap()[e]||null},e.prototype.set=function(e,t){var r=this.getMap();r[e]=t,this.replace(r)},e.prototype.remove=function(e){var t=this.getMap();delete t[e],this.replace(t)},e.prototype.values=function(){return Z(this.getMap())},e.prototype.clear=function(){this.replace({})},e.prototype.replace=function(e){try{"u">typeof window?window&&window.localStorage&&localStorage.setItem(this.LS_KEY,JSON.stringify(e)):localStorage.setItem(this.LS_KEY,JSON.stringify(e)),this.clean()}catch(e){ex.error(String(e))}},e.prototype.clean=function(){var e=this.getMap(),t=Object.keys(e),r=t.length-this.maxValues;if(!(r<1)){var i=t.map(function(t){return{key:t,value:e[t]}});i.sort(function(e,t){return e.value.timestamp-t.value.timestamp});for(var n=0;n<r;n++)delete e[i[n].key];this.replace(e)}},e.prototype.getMap=function(){try{var e="u">typeof window?window&&window.localStorage&&localStorage.getItem(this.LS_KEY):localStorage.getItem(this.LS_KEY);if(e)return JSON.parse(e)||{}}catch(e){ex.error(e)}return{}},e}(),eK=ef("EventProcessor"),eG=function(e){function t(t){var r=t.eventDispatcher;return e.call(this,{eventDispatcher:r,store:new eF({maxValues:100,key:"fs_optly_pending_events"})})||this}return B(t,e),t}(function(){function e(e){var t=e.eventDispatcher,r=e.store;this.dispatcher=t,this.store=r}return e.prototype.dispatchEvent=function(e,t){this.send({uuid:$(),timestamp:new Date().getTime(),request:e},t)},e.prototype.sendPendingEvents=function(){var e=this,t=this.store.values();eK.debug("Sending %s pending events from previous page",t.length),t.forEach(function(t){try{e.send(t,function(){})}catch(e){eK.debug(String(e))}})},e.prototype.send=function(e,t){var r=this;this.store.set(e.uuid,e),this.dispatcher.dispatchEvent(e.request,function(i){r.store.remove(e.uuid),t(i)})},e}()),ej="$opt_bot_filtering",eB=function(){function e(){this.reqsInFlightCount=0,this.reqsCompleteResolvers=[]}return e.prototype.trackRequest=function(e){var t=this;this.reqsInFlightCount++;var r=function(){t.reqsInFlightCount--,0===t.reqsInFlightCount&&(t.reqsCompleteResolvers.forEach(function(e){return e()}),t.reqsCompleteResolvers=[])};e.then(r,r)},e.prototype.onRequestsComplete=function(){var e=this;return new Promise(function(t){0===e.reqsInFlightCount?t():e.reqsCompleteResolvers.push(t)})},e}(),ez=ef("LogTierV1EventProcessor"),eq=function(){function e(e){var t,r,i,n,o,a,s=e.dispatcher,u=e.closingDispatcher,l=e.flushInterval,c=void 0===l?3e4:l,d=e.batchSize,p=void 0===d?10:d,f=e.notificationCenter;this.dispatcher=s,this.closingDispatcher=u,this.notificationCenter=f,this.requestTracker=new eB,(t=c)<=0&&(eV.warn("Invalid flushInterval ".concat(t,", defaulting to ").concat(3e4)),t=3e4),c=t,(r=Math.floor(r=p))<1&&(eV.warn("Invalid batchSize ".concat(r,", defaulting to ").concat(10)),r=10),p=r=Math.max(1,r),this.queue=(i=p,n=c,o=this.drainQueue.bind(this,!1),a=this.drainQueue.bind(this,!0),i>1?new eI({flushInterval:n,maxQueueSize:i,sink:o,closingSink:a,batchComparator:eE}):new e_({sink:o}))}return e.prototype.drainQueue=function(e,t){var r=this,i=new Promise(function(i){if(ez.debug("draining queue with %s events",t.length),0===t.length)return void i();var n,o,a,s={url:"https://logx.optimizely.com/v1/events",httpVerb:"POST",params:(n=[],o=t[0],t.forEach(function(e){if("conversion"===e.type||"impression"===e.type){var t,r,i,o,a,s,u,l,c,d,p,f,g,h,E,y,v=(r={snapshots:[],visitor_id:(t=e).user.id,attributes:[]}
2,t.user.attributes.forEach(function(e){r.attributes.push({entity_id:e.entityId,key:e.key,type:"custom",value:e.value})}),"boolean"==typeof t.context.botFiltering&&r.attributes.push({entity_id:ej,key:ej,type:"custom",value:t.context.botFiltering}),r);"impression"===e.type?v.snapshots.push((s=(i=e).layer,u=i.experiment,l=i.variation,c=i.ruleKey,d=i.flagKey,p=i.ruleType,f=i.enabled,{decisions:[{campaign_id:g=s?s.id:null,experiment_id:null!=(o=null==u?void 0:u.id)?o:"",variation_id:null!=(a=null==l?void 0:l.id)?a:"",metadata:{flag_key:d,rule_key:c,rule_type:p,variation_key:l?l.key:"",enabled:f}}],events:[{entity_id:g,timestamp:i.timestamp,key:"campaign_activated",uuid:i.uuid}]})):"conversion"===e.type&&v.snapshots.push((E=z({},(h=e).tags),delete E.revenue,delete E.value,y={entity_id:h.event.id,key:h.event.key,timestamp:h.timestamp,uuid:h.uuid},h.tags&&(y.tags=h.tags),null!=h.value&&(y.value=h.value),null!=h.revenue&&(y.revenue=h.revenue),{events:[y]})),n.push(v)}}),{client_name:o.context.clientName,client_version:o.context.clientVersion,account_id:o.context.accountId,project_id:o.context.projectId,revision:o.context.revision,anonymize_ip:o.context.anonymizeIP,enrich_decisions:!0,visitors:n})};(e&&r.closingDispatcher?r.closingDispatcher:r.dispatcher).dispatchEvent(s,function(){i()}),a=r.notificationCenter,a&&a.sendNotifications(h.LOG_EVENT,s)});return this.requestTracker.trackRequest(i),i},e.prototype.process=function(e){this.queue.enqueue(e)},e.prototype.stop=function(){try{return this.queue.stop(),this.requestTracker.onRequestsComplete()}catch(e){ez.error('Error stopping EventProcessor: "%s"',Object(e).message,String(e))}return Promise.resolve()},e.prototype.start=function(){return q(this,void 0,void 0,function(){return H(this,function(e){switch(e.label){case 0:return[4,this.queue.start()];case 1:return e.sent(),[2]}})})},e}(),eH="CONFIG_VALIDATOR",eX=[eC.V2,eC.V3,eC.V4],eW=function(e){if("object"==typeof e&&null!==e){var t=e.errorHandler,r=e.eventDispatcher,i=e.logger;if(t&&"function"!=typeof t.handleError)throw Error(et(eO.INVALID_ERROR_HANDLER,eH));if(r&&"function"!=typeof r.dispatchEvent)throw Error(et(eO.INVALID_EVENT_DISPATCHER,eH));if(i&&"function"!=typeof i.log)throw Error(et(eO.INVALID_LOGGER,eH));return!0}throw Error(et(eO.INVALID_CONFIG,eH))},eY=function(e){if(!e)throw Error(et(eO.NO_DATAFILE_SPECIFIED,eH));if("string"==typeof e)try{e=JSON.parse(e)}catch(e){throw Error(et(eO.INVALID_DATAFILE_MALFORMED,eH))}if("object"==typeof e&&!Array.isArray(e)&&null!==e&&-1===eX.indexOf(e.version))throw Error(et(eO.INVALID_DATAFILE_VERSION,eH,e.version));return e},eJ="POST",e$={dispatchEvent:function(e,t){var r,i,n=e.params,o=e.url;e.httpVerb===eJ?((i=new XMLHttpRequest).open(eJ,o,!0),i.setRequestHeader("Content-Type","application/json"),i.onreadystatechange=function(){if(4===i.readyState&&t&&"function"==typeof t)try{t({statusCode:i.status})}catch(e){}},i.send(JSON.stringify(n))):(o+="?wxhr=true",n&&(o+="&"+Object.keys(r=n).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(r[e])}).join("&")),(i=new XMLHttpRequest).open("GET",o,!0),i.onreadystatechange=function(){if(4===i.readyState&&t&&"function"==typeof t)try{t({statusCode:i.status})}catch(e){}},i.send())}},eQ={dispatchEvent:function(e,t){var r=e.params,i=e.url,n=new Blob([JSON.stringify(r)],{type:"application/json"});t({statusCode:navigator.sendBeacon(i,n)?200:500})}},eZ=function(){function e(){}return e.prototype.log=function(){},e}();function e0(e){return new eu(e)}var e1=Object.freeze({__proto__:null,NoOpLogger:eZ,createLogger:e0,createNoOpLogger:function(){return new eZ}}),e2=function(){function e(e){var t=this;this.logger=e.logger,this.errorHandler=e.errorHandler,this.notificationListeners={},Z(h).forEach(function(e){t.notificationListeners[e]=[]}),this.listenerId=1}return e.prototype.addNotificationListener=function(e,t){try{if(!(Z(h).indexOf(e)>-1))return -1;this.notificationListeners[e]||(this.notificationListeners[e]=[]);var r=!1;if((this.notificationListeners[e]||[]).forEach(function(e){if(e.callback===t){r=!0;return}}),r)return -1;this.notificationListeners[e].push({id:this.listenerId,callback:t});var i=this.listenerId;return this.listenerId+=1,i}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),-1}},e.prototype.removeNotificationListener=function(e){var t,r,i=this;try{if(Object.keys(this.notificationListeners).some(function(n){return(i.notificationListeners[n]||[]).every(function(i,o){return i.id!==e||(t=o,r=n,!1)}),void 0!==t&&void 0!==r}),void 0!==t&&void 0!==r)return this.notificationListeners[r].splice(t,1),!0}catch(e){this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e)}return!1},e.prototype.clearAllNotificationListeners=function(){var e=this;
2try{Z(h).forEach(function(t){e.notificationListeners[t]=[]})}catch(e){this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e)}},e.prototype.clearNotificationListeners=function(e){try{this.notificationListeners[e]=[]}catch(e){this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e)}},e.prototype.sendNotifications=function(e,t){var r=this;try{(this.notificationListeners[e]||[]).forEach(function(i){var n=i.callback;try{n(t)}catch(t){r.logger.log(em.ERROR,eb.NOTIFICATION_LISTENER_EXCEPTION,"NOTIFICATION_CENTER",e,t.message)}})}catch(e){this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e)}},e}(),e5=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new(eq.bind.apply(eq,X([void 0],e,!1)))};(a=v||(v={})).IGNORE_CACHE="IGNORE_CACHE",a.RESET_CACHE="RESET_CACHE",(s=_||(_={})).BOOLEAN="boolean",s.DOUBLE="double",s.INTEGER="integer",s.STRING="string",s.JSON="json",(u=I||(I={})).DISABLE_DECISION_EVENT="DISABLE_DECISION_EVENT",u.ENABLED_FLAGS_ONLY="ENABLED_FLAGS_ONLY",u.IGNORE_USER_PROFILE_SERVICE="IGNORE_USER_PROFILE_SERVICE",u.INCLUDE_REASONS="INCLUDE_REASONS",u.EXCLUDE_VARIABLES="EXCLUDE_VARIABLES";var e3="Polling intervals below ".concat(30," seconds are not recommended."),e6=[0,8,16,32,64,128,256,512],e4=ef("DatafileManager"),e9=function(){function e(){this.listeners={},this.listenerId=1}return e.prototype.on=function(e,t){var r=this;this.listeners[e]||(this.listeners[e]={});var i=String(this.listenerId);return this.listenerId++,this.listeners[e][i]=t,function(){r.listeners[e]&&delete r.listeners[e][i]}},e.prototype.emit=function(e,t){var r=this.listeners[e];r&&Object.keys(r).forEach(function(e){(0,r[e])(t)})},e.prototype.removeAllListeners=function(){this.listeners={}},e}(),e8=function(){function e(){this.errorCount=0}return e.prototype.getDelay=function(){return 0===this.errorCount?0:1e3*e6[Math.min(e6.length-1,this.errorCount)]+Math.round(1e3*Math.random())},e.prototype.countError=function(){this.errorCount<e6.length-1&&this.errorCount++},e.prototype.reset=function(){this.errorCount=0},e}(),e7=function(){function e(){}return e.getNotificationCenter=function(e,t){var r;return(void 0===t&&(t=ef()),e)?(this._notificationCenters.has(e)?r=this._notificationCenters.get(e):(r=new e2({logger:t,errorHandler:{handleError:function(){}}}),this._notificationCenters.set(e,r)),r):void t.log(g.ERROR,"No SDK key provided to getNotificationCenter.")},e.removeNotificationCenter=function(e){if(e){var t=this._notificationCenters.get(e);t&&(t.clearAllNotificationListeners(),this._notificationCenters.delete(e))}},e._notificationCenters=new Map,e}(),te=ef("DatafileManager");function tt(e){return e>=200&&e<400}var tr={get:function(){return Promise.resolve(void 0)},set:function(){return Promise.resolve()},contains:function(){return Promise.resolve(!1)},remove:function(){return Promise.resolve(!1)}},ti=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return B(t,e),t.prototype.makeGetRequest=function(e,t){var r;return r=new XMLHttpRequest,{responsePromise:new Promise(function(i,n){r.open("GET",e,!0),Object.keys(t).forEach(function(e){var i=t[e];r.setRequestHeader(e,i)}),r.onreadystatechange=function(){if(4===r.readyState){if(0===r.status)return void n(Error("Request error"));var e=function(e){var t=e.getAllResponseHeaders();if(null===t)return{};var r=t.split("\r\n"),i={};return r.forEach(function(e){var t=e.indexOf(": ");if(t>-1){var r=e.slice(0,t),n=e.slice(t+2);n.length>0&&(i[r]=n)}}),i}(r);i({statusCode:r.status,body:r.responseText,headers:e})}},r.timeout=6e4,r.ontimeout=function(){e4.error("Request timed out")},r.send()}),abort:function(){r.abort()}}},t.prototype.getConfigDefaults=function(){return{autoUpdate:!1}},t}(function(){function e(e){var t=this,r=z(z({},this.getConfigDefaults()),e),i=r.datafile,n=r.autoUpdate,o=r.sdkKey,a=r.updateInterval,s=r.urlTemplate,u=r.cache,l=r.customHeaders;this.cache=void 0===u?tr:u,this.cacheKey="opt-datafile-"+o,this.sdkKey=o,this.customHeaders=l,this.isReadyPromiseSettled=!1,this.readyPromiseResolver=function(){},this.readyPromiseRejecter=function(){},this.readyPromise=new Promise(function(e,r){t.readyPromiseResolver=e,t.readyPromiseRejecter=r}),i?(this.currentDatafile=i,o||this.resolveReadyPromise()):this.currentDatafile="",this.isStarted=!1,this.datafileUrl=et(void 0===s?"https://cdn.optimizely.com/datafiles/%s.json":s,o),this.emitter=new e9,this.autoUpdate=void 0!==n&&n,this.updateInterval=void 0===a?3e5:a,this.updateInterval<3e4&&te.warn(e3),this.currentTimeout=null,this.currentRequest=null,this.backoffController=new e8,this.syncOnCurrentRequestComplete=!1}return e.prototype.get=function(){return this.currentDatafile},e.prototype.start=function(){this.isStarted||(te.debug("Datafile manager started"),this.isStarted=!0,this.backoffController.reset(),this.setDatafileFromCacheIfAvailable(),this.syncDatafile())},e.prototype.stop=function(){return te.debug("Datafile manager stopped"),this.isStarted=!1,this.currentTimeout&&(clearTimeout(this.currentTimeout),this.currentTimeout=null),this.emitter.removeAllListeners(),this.currentRequest&&(this.currentRequest.abort(),this.currentRequest=null),Promise.resolve()},e.prototype.onReady=function(){return this.readyPromise},e.prototype.on=function(e,t){return this.emitter.on(e,t)},e.prototype.onRequestRejected=function(e){this.isStarted&&(this.backoffController.countError(),e instanceof Error?te.error("Error fetching datafile: %s",e.message,e):"string"==typeof e?te.error("Error fetching datafile: %s",e):te.error("Error fetching datafile"))},e.prototype.onRequestResolved=function(e){if(this.isStarted){void 0!==e.statusCode&&tt(e.statusCode)?this.backoffController.reset():this.backoffController.countError(),this.trySavingLastModified(e.headers);var t,r=this.getNextDatafileFromResponse(e);""!==r&&(te.info("Updating datafile from response"),this.currentDatafile=r,this.cache.set(this.cacheKey,r),this.isReadyPromiseSettled?(null==(t=e7.getNotificationCenter(this.sdkKey,te))||t.sendNotifications(h.OPTIMIZELY_CONFIG_UPDATE),this.emitter.emit("update",{datafile:r})):this.resolveReadyPromise())}},e.prototype.onRequestComplete=function(){this.isStarted&&(this.currentRequest=null,this.isReadyPromiseSettled||this.autoUpdate||this.rejectReadyPromise(Error("Failed to become ready")),this.autoUpdate&&this.syncOnCurrentRequestComplete&&this.syncDatafile(),this.syncOnCurrentRequestComplete=!1)},e.prototype.syncDatafile=function(){var e=this,t={};this.customHeaders&&Y(t,this.customHeaders),this.lastResponseLastModified&&(t["if-modified-since"]=this.lastResponseLastModified),te.debug("Making datafile request to url %s with headers: %s",this.datafileUrl,function(){return JSON.stringify(t)}
2),this.currentRequest=this.makeGetRequest(this.datafileUrl,t);var r=function(){e.onRequestComplete()};this.currentRequest.responsePromise.then(function(t){e.onRequestResolved(t)},function(t){e.onRequestRejected(t)}).then(r,r),this.autoUpdate&&this.scheduleNextUpdate()},e.prototype.resolveReadyPromise=function(){this.readyPromiseResolver(),this.isReadyPromiseSettled=!0},e.prototype.rejectReadyPromise=function(e){this.readyPromiseRejecter(e),this.isReadyPromiseSettled=!0},e.prototype.scheduleNextUpdate=function(){var e=this,t=Math.max(this.backoffController.getDelay(),this.updateInterval);te.debug("Scheduling sync in %s ms",t),this.currentTimeout=setTimeout(function(){e.currentRequest?e.syncOnCurrentRequestComplete=!0:e.syncDatafile()},t)},e.prototype.getNextDatafileFromResponse=function(e){return(te.debug("Response status code: %s",e.statusCode),void 0===e.statusCode||304===e.statusCode)?"":tt(e.statusCode)?e.body:(te.error("Datafile fetch request failed with status: ".concat(e.statusCode)),"")},e.prototype.trySavingLastModified=function(e){var t=e["last-modified"]||e["Last-Modified"];void 0!==t&&(this.lastResponseLastModified=t,te.debug("Saved last modified header value from response: %s",this.lastResponseLastModified))},e.prototype.setDatafileFromCacheIfAvailable=function(){var e=this;this.cache.get(this.cacheKey).then(function(t){e.isStarted&&!e.isReadyPromiseSettled&&t&&(te.debug("Using datafile from cache"),e.currentDatafile=t,e.resolveReadyPromise())})},e}()),tn=function(){function e(e,t,r,i){this.apiKey=e,this.apiHost=t,this.pixelUrl=r,this.segmentsToCheck=i}return e.prototype.equals=function(e){var t,r;return this.apiHost===e.apiHost&&this.apiKey===e.apiKey&&this.pixelUrl===e.pixelUrl&&(t=this.segmentsToCheck,r=e.segmentsToCheck,t.length===r.length&&t.every(function(e,t){return e===r[t]}))},e}(),to="Running",ta="$opt_",ts="PROJECT_CONFIG",tu=function(e,t){void 0===t&&(t=null);var r,i,n,o,a=((o=Y({},e)).events=(e.events||[]).map(function(e){var t=Y({},e);return t.experimentsIds=e.experimentIds,t}),o.audiences=(e.audiences||[]).map(function(e){return Y({},e)}),o.experiments=(e.experiments||[]).map(function(e){return Y({},e)}),o.featureFlags=(e.featureFlags||[]).map(function(e){return Y({},e)}),o.groups=(e.groups||[]).map(function(e){var t=Y({},e);return t.experiments=(e.experiments||[]).map(function(e){return Y({},e)}),t}),o.rollouts=(e.rollouts||[]).map(function(e){var t=Y({},e);return t.experiments=(e.experiments||[]).map(function(e){return Y({},e)}),t}),o.environmentKey=null!=(i=e.environmentKey)?i:"",o.sdkKey=null!=(n=e.sdkKey)?n:"",o);a.__datafileStr=null===t?JSON.stringify(e):t,(a.audiences||[]).forEach(function(e){e.conditions=JSON.parse(e.conditions)}),a.audiencesById=J(a.audiences,"id"),Y(a.audiencesById,J(a.typedAudiences,"id")),a.attributeKeyMap=J(a.attributes,"key"),a.eventKeyMap=J(a.events,"key"),a.groupIdMap=J(a.groups,"id"),Object.keys(a.groupIdMap||{}).forEach(function(e){(a.groupIdMap[e].experiments||[]).forEach(function(t){a.experiments.push(Y(t,{groupId:e}))})}),a.rolloutIdMap=J(a.rollouts||[],"id"),Z(a.rolloutIdMap||{}).forEach(function(e){(e.experiments||[]).forEach(function(e){e.isRollout=!0,a.experiments.push(e),e.variationKeyMap=J(e.variations,"key")})});var s=new Set;Object.keys(a.audiencesById).map(function(e){return tl(a.audiencesById[e])}).forEach(function(e){e.forEach(function(e){s.add(e)})});var u=Array.from(s),l=!1,c="",d="",p="";return a.integrations&&(a.integrationKeyMap=J(a.integrations,"key"),a.integrations.forEach(function(e){if(!("key"in e))throw Error(et(eO.MISSING_INTEGRATION_KEY,ts));"odp"===e.key&&(l=!0,d=d||e.publicKey||"",c=c||e.host||"",p=p||e.pixelUrl||"")})),l?a.odpIntegrationConfig={integrated:!0,odpConfig:new tn(d,c,p,u)}:a.odpIntegrationConfig={integrated:!1},a.experimentKeyMap=J(a.experiments,"key"),a.experimentIdMap=J(a.experiments,"id"),a.variationIdMap={},a.variationVariableUsageMap={},(a.experiments||[]).forEach(function(e){e.variationKeyMap=J(e.variations,"key"),Y(a.variationIdMap,J(e.variations,"id")),Z(e.variationKeyMap||{}).forEach(function(e){e.variables&&(a.variationVariableUsageMap[e.id]=J(e.variables,"id"))})}),a.experimentFeatureMap={},a.featureKeyMap=J(a.featureFlags||[],"key"),Z(a.featureKeyMap||{}
2).forEach(function(e){e.variables.forEach(function(e){e.type===eU.STRING&&e.subType===eU.JSON&&(e.type=eU.JSON,delete e.subType)}),e.variableKeyMap=J(e.variables,"key"),(e.experimentIds||[]).forEach(function(t){a.experimentFeatureMap[t]?a.experimentFeatureMap[t].push(e.id):a.experimentFeatureMap[t]=[e.id]})}),a.flagRulesMap={},(a.featureFlags||[]).forEach(function(e){var t=[];e.experimentIds.forEach(function(e){var r=a.experimentIdMap[e];r&&t.push(r)});var r=a.rolloutIdMap[e.rolloutId];r&&t.push.apply(t,r.experiments),a.flagRulesMap[e.key]=t}),a.flagVariationsMap={},Object.keys(r=a.flagRulesMap||{}).map(function(e){return[e,r[e]]}).forEach(function(e){var t=e[0],r=e[1],i=[];r.forEach(function(e){e.variations.forEach(function(e){ee(i,function(t){return t.id===e.id})||i.push(e)})}),a.flagVariationsMap[t]=i}),a},tl=function(e){return e.conditions?tc(e.conditions):[]},tc=function(e){var t=[];return["and","or","not"].includes(e)?[]:(Array.isArray(e)?e.forEach(function(e){return t.push.apply(t,tc(e))}):"qualified"===e.match&&t.push(e.value),t)},td=function(e,t){var r=e.experimentIdMap[t];if(!r)throw Error(et(eO.INVALID_EXPERIMENT_ID,ts,t));return r.layerId},tp=function(e,t,r){var i=e.attributeKeyMap[t],n=0===t.indexOf(ta);return i?(n&&r.log(em.WARNING,"Attribute %s unexpectedly has reserved prefix %s; using attribute ID instead of reserved attribute name.",t,ta),i.id):n?t:(r.log(em.DEBUG,eO.UNRECOGNIZED_ATTRIBUTE,ts,t),null)},tf=function(e,t){var r=e.eventKeyMap[t];return r?r.id:null},tg=function(e,t){var r=e.experimentKeyMap[t];if(!r)throw Error(et(eO.INVALID_EXPERIMENT_KEY,ts,t));return r.status},th=function(e,t){var r=e.experimentIdMap[t];if(!r)throw Error(et(eO.INVALID_EXPERIMENT_ID,ts,t));return r.audienceConditions||r.audienceIds},tE=function(e,t){return e.variationIdMap.hasOwnProperty(t)?e.variationIdMap[t].key:null},ty=function(e,t,r){var i=e.experimentKeyMap[t];return i.variationKeyMap.hasOwnProperty(r)?i.variationKeyMap[r].id:null},tv=function(e,t){if(e.experimentKeyMap.hasOwnProperty(t)){var r=e.experimentKeyMap[t];if(r)return r}throw Error(et(eO.EXPERIMENT_KEY_NOT_IN_DATAFILE,ts,t))},t_=function(e,t){var r=e.experimentIdMap[t];if(!r)throw Error(et(eO.INVALID_EXPERIMENT_ID,ts,t));return r.trafficAllocation},tI=function(e,t,r){if(e.experimentIdMap.hasOwnProperty(t)){var i=e.experimentIdMap[t];if(i)return i}return r.log(em.ERROR,eO.INVALID_EXPERIMENT_ID,ts,t),null},tm=function(e,t,r){if(!e)return null;var i=ee(e.flagVariationsMap[t],function(e){return e.key===r});return i||null},tO=function(e,t,r){if(e.featureKeyMap.hasOwnProperty(t)){var i=e.featureKeyMap[t];if(i)return i}return r.log(em.ERROR,eO.FEATURE_NOT_IN_DATAFILE,ts,t),null},tb=function(e,t,r,i){var n=e.featureKeyMap[t];if(!n)return i.log(em.ERROR,eO.FEATURE_NOT_IN_DATAFILE,ts,t),null;var o=n.variableKeyMap[r];return o||(i.log(em.ERROR,eO.VARIABLE_KEY_NOT_IN_DATAFILE,ts,r,t),null)},tR=function(e,t,r,i){if(!t||!r)return null;if(!e.variationVariableUsageMap.hasOwnProperty(r.id))return i.log(em.ERROR,eO.VARIATION_ID_NOT_IN_DATAFILE_NO_EXPERIMENT,ts,r.id),null;var n=e.variationVariableUsageMap[r.id][t.id];return n?n.value:null},tN=function(e,t,r){var i;switch(t){case eU.BOOLEAN:"true"!==e&&"false"!==e?(r.log(em.ERROR,eO.UNABLE_TO_CAST_VALUE,ts,e,t),i=null):i="true"===e;break;case eU.INTEGER:isNaN(i=parseInt(e,10))&&(r.log(em.ERROR,eO.UNABLE_TO_CAST_VALUE,ts,e,t),i=null);break;case eU.DOUBLE:isNaN(i=parseFloat(e))&&(r.log(em.ERROR,eO.UNABLE_TO_CAST_VALUE,ts,e,t),i=null);break;case eU.JSON:try{i=JSON.parse(e)}catch(n){r.log(em.ERROR,eO.UNABLE_TO_CAST_VALUE,ts,e,t),i=null}break;default:i=e}return i},tT=function(e){return e.__datafileStr},tA=function(e){try{t=eY(e.datafile)}catch(e){return{configObj:null,error:e}}if(e.jsonSchemaValidator)try{e.jsonSchemaValidator.validate(t),e.logger.log(em.INFO,eb.VALID_DATAFILE,ts)}catch(e){return{configObj:null,error:e}}else e.logger.log(em.INFO,eb.SKIPPING_JSON_VALIDATION,ts);var t,r=[t];return"string"==typeof e.datafile&&r.push(e.datafile),{configObj:tu.apply(void 0,r),error:null}},tS=function(e){return!!e.sendFlagDecisions},tw=function(){function e(e,t){void 0===t&&(t=6e4),this.logger=e,this.timeout=t}return e.prototype.makeRequest=function(e,t,r,i){var n=this,o=new XMLHttpRequest;return{responsePromise:new Promise(function(a,s){o.open(r,e,!0),n.setHeadersInXhr(t,o),o.onreadystatechange=function(){if(o.readyState===XMLHttpRequest.DONE){if(0===o.status)return void s(Error("Request error"));var e=n.parseHeadersFromXhr(o);a({statusCode:o.status,body:o.responseText,headers:e})}},o.timeout=n.timeout,o.ontimeout=function(){n.logger.log(g.WARNING,"Request timed out")},o.send(i)}),abort:function(){o.abort()}}},e.prototype.setHeadersInXhr=function(e,t){Object.keys(e).forEach(function(r){var i=e[r];"string"==typeof i&&t.setRequestHeader(r,i)})},e.prototype.parseHeadersFromXhr=function(e){var t=this,r=e.getAllResponseHeaders();if(null===r)return{};var i=r.split("\r\n"),n={};
2return i.forEach(function(e){try{var r=e.indexOf(": ");if(r>-1){var i=e.slice(0,r),o=e.slice(r+2);i&&o&&(n[i]=o)}}catch(r){t.logger.log(g.WARNING,"Unable to parse & skipped header item '".concat(e,"'"))}}),n},e}(),tD=function(e){var t=e.browserCallback,r=e.nonBrowserCallback;return"u">typeof window?t(null==window?void 0:window.localStorage):r()},tU=function(){function e(){this.logger=ef()}return e.prototype.contains=function(e){return q(this,void 0,void 0,function(){var t=this;return H(this,function(r){return[2,tD({browserCallback:function(t){return(null==t?void 0:t.getItem(e))!==null},nonBrowserCallback:function(){return t.logger.error(eO.LOCAL_STORAGE_DOES_NOT_EXIST),!1}})]})})},e.prototype.get=function(e){return q(this,void 0,void 0,function(){var t=this;return H(this,function(r){return[2,tD({browserCallback:function(t){return(null==t?void 0:t.getItem(e))||void 0},nonBrowserCallback:function(){t.logger.error(eO.LOCAL_STORAGE_DOES_NOT_EXIST)}})]})})},e.prototype.remove=function(e){return q(this,void 0,void 0,function(){var t=this;return H(this,function(r){switch(r.label){case 0:return[4,this.contains(e)];case 1:if(r.sent())return tD({browserCallback:function(t){null==t||t.removeItem(e)},nonBrowserCallback:function(){t.logger.error(eO.LOCAL_STORAGE_DOES_NOT_EXIST)}}),[2,!0];return[2,!1]}})})},e.prototype.set=function(e,t){return q(this,void 0,void 0,function(){var r=this;return H(this,function(i){return[2,tD({browserCallback:function(r){null==r||r.setItem(e,t)},nonBrowserCallback:function(){r.logger.error(eO.LOCAL_STORAGE_DOES_NOT_EXIST)}})]})})},e}(),tC=function(){function e(e){void 0===e&&(e=null),this._value=e,this._time=Date.now()}return Object.defineProperty(e.prototype,"value",{get:function(){return this._value},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"time",{get:function(){return this._time},enumerable:!1,configurable:!0}),e.prototype.is_stale=function(e){return!(e<=0)&&Date.now()-this._time>=e},e}(),tM=function(){function e(e){var t=e.maxSize,r=e.timeout;this._map=new Map;var i=ef();i.debug("Provisioning cache with maxSize of ".concat(t)),i.debug("Provisioning cache with timeout of ".concat(r)),this._maxSize=t,this._timeout=r}return Object.defineProperty(e.prototype,"map",{get:function(){return this._map},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"maxSize",{get:function(){return this._maxSize},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"timeout",{get:function(){return this._timeout},enumerable:!1,configurable:!0}),e.prototype.lookup=function(e){if(this._maxSize<=0)return null;var t=this._map.get(e);return t?t.is_stale(this._timeout)?(this._map.delete(e),null):(this._map.delete(e),this._map.set(e,t),t.value):null},e.prototype.save=function(e){var t=e.key,r=e.value;if(!(this._maxSize<=0)&&(this._map.get(t)&&this._map.delete(t),this._map.set(t,new tC(r)),this._map.size>this._maxSize)){var i=this._map.keys().next().value;this._map.delete(i)}},e.prototype.reset=function(){this._maxSize<=0||this._map.clear()},e.prototype.peek=function(e){if(this._maxSize<=0)return null;var t,r=this._map.get(e);return null!=(t=null==r?void 0:r.value)?t:null},e}(),tL=function(e){function t(t){var r,i;return e.call(this,{maxSize:null!=(r=null==t?void 0:t.maxSize)?r:100,timeout:null!=(i=null==t?void 0:t.timeout)?i:6e5})||this}return B(t,e),t}(tM);B(function(e){var t,r;return l.call(this,{maxSize:null!=(t=null==e?void 0:e.maxSize)?t:1e4,timeout:null!=(r=null==e?void 0:e.timeout)?r:6e5})||this},l=tM);var tP=function(){function e(){this._keyForVuid="optimizely-vuid",this._vuid=""}return Object.defineProperty(e.prototype,"vuid",{get:function(){return this._vuid},enumerable:!1,configurable:!0}),e.instance=function(t){return q(this,void 0,void 0,function(){return H(this,function(r){switch(r.label){case 0:if(this._instance||(this._instance=new e),this._instance._vuid)return[3,2];return[4,this._instance.load(t)];case 1:r.sent(),r.label=2;case 2:return[2,this._instance]}})})},e.prototype.load=function(t){return q(this,void 0,void 0,function(){var r;return H(this,function(i){switch(i.label){case 0:return[4,t.get(this._keyForVuid)];case 1:if(!((r=i.sent())&&e.isVuid(r)))return[3,2];return this._vuid=r,[3,4];case 2:return this._vuid=this.makeVuid(),[4,this.save(this._vuid,t)];case 3:i.sent(),i.label=4;case 4:return[2,this._vuid]}})})},e.prototype.makeVuid=function(){var t=$().replace(/-/g,"").toLowerCase(),r="".concat(e.vuid_prefix).concat(t);return r.length<=32?r:r.substring(0,32)},e.prototype.save=function(e,t){return q(this,void 0,void 0,function(){return H(this,function(r){switch(r.label){case 0:return[4,t.set(this._keyForVuid,e)];case 1:return r.sent(),[2]}})})},e._reset=function(){this._instance._vuid=""},e.vuid_prefix="vuid_",e.isVuid=function(t){return(null==t?void 0:t.startsWith(e.vuid_prefix))||!1},e}();function tk(e){var t=["string","number","boolean"],r=!1;return e.forEach(function(e){t.includes(typeof e)||null===e||(r=!0)}),r}var tV=function(e,t,r,i){this.type=e,this.action=t,this.identifiers=null!=r?r:new Map,this.data=null!=i?i:new Map},tx=function(){};(c=m||(m={}))[c.Running=0]="Running",c[c.Stopped=1]="Stopped";var tF=function(){function e(e){var t,r,i,n=e.odpIntegrationConfig,o=e.segmentManager,a=e.eventManager,s=e.logger,u=this;this.ready=!1,this.status=m.Stopped,this.segmentManager=o,this.eventManager=a,this.logger=s,this.configPromise=(t=tx,r=tx,{promise:i=new Promise(function(e,i){t=e,r=i}),resolve:t,reject:r,then:i.then.bind(i)});var l=[this.configPromise];this.isVuidEnabled()&&l.push(this.initializeVuid()),this.initPromise=Promise.all(l),this.onReady().then(function(){u.ready=!0,u.isVuidEnabled()&&u.status===m.Running&&u.registerVuid()}),n&&this.updateSettings(n)}return e.prototype.getStatus=function(){return this.status},e.prototype.start=function(){return q(this,void 0,void 0,function(){return H(this,function(e){return this.status===m.Running?[2]:this.odpIntegrationConfig?this.odpIntegrationConfig.integrated?(this.status=m.Running,this.segmentManager.updateSettings(this.odpIntegrationConfig.odpConfig),this.eventManager.updateSettings(this.odpIntegrationConfig.odpConfig),this.eventManager.start(),[2,Promise.resolve()]):[2,Promise.reject(Error("start() called when ODP is not integrated"))]:[2,Promise.reject(Error("cannot start without ODP config"))]})})},e.prototype.stop=function(){return q(this,void 0,void 0,function(){return H(this,function(e){switch(e.label){case 0:if(this.status===m.Stopped)return[2];return this.status=m.Stopped,[4,this.eventManager.stop()];case 1:return e.sent(),[2]}})})},e.prototype.onReady=function(){return this.initPromise},e.prototype.isReady=function(){return this.ready},e.prototype.updateSettings=function(e){var t;return this.configPromise.resolve(),!(this.odpIntegrationConfig&&(t=this.odpIntegrationConfig,t.integrated===e.integrated&&(!t.integrated||!e.integrated||t.odpConfig.equals(e.odpConfig))))&&(this.odpIntegrationConfig=e,e.integrated?this.status===m.Running?(this.segmentManager.updateSettings(e.odpConfig),this.eventManager.updateSettings(e.odpConfig)):this.start():this.stop(),!0)},e.prototype.fetchQualifiedSegments=function(e,t){return void 0===t&&(t=[]),q(this,void 0,void 0,function(){return H(this,function(r){return this.odpIntegrationConfig?this.odpIntegrationConfig.integrated?tP.isVuid(e)?[2,this.segmentManager.fetchQualifiedSegments(E.VUID,e,t)]:[2,this.segmentManager.fetchQualifiedSegments(E.FS_USER_ID,e,t)]:(this.logger.log(g.ERROR,eO.ODP_NOT_INTEGRATED),[2,null]):(this.logger.log(g.ERROR,eO.ODP_CONFIG_NOT_AVAILABLE),[2,null])})})},e.prototype.identifyUser=function(e,t){this.odpIntegrationConfig?this.odpIntegrationConfig.integrated?e&&tP.isVuid(e)?this.eventManager.identifyUser(void 0,e):this.eventManager.identifyUser(e,t):this.logger.log(g.INFO,eO.ODP_NOT_INTEGRATED):this.logger.log(g.ERROR,eO.ODP_CONFIG_NOT_AVAILABLE)},e.prototype.sendEvent=function(e){var t=e.type,r=e.action,i=e.identifiers,n=e.data,o=t;if(("string"!=typeof o||""===o)&&(o="fullstack"),!this.odpIntegrationConfig)return void this.logger.log(g.ERROR,eO.ODP_CONFIG_NOT_AVAILABLE);if(!this.odpIntegrationConfig.integrated)return void this.logger.log(g.ERROR,eO.ODP_NOT_INTEGRATED);if(tk(n))throw Error(eO.ODP_INVALID_DATA);if("string"!=typeof r||""===r)throw Error("ODP action is not val
2id (cannot be empty).");this.eventManager.sendEvent(new tV(o,r,i,n))},e.prototype.initializeVuid=function(){return Promise.resolve()},e.prototype.registerVuid=function(){if(!this.odpIntegrationConfig)return void this.logger.log(g.ERROR,eO.ODP_CONFIG_NOT_AVAILABLE);if(!this.odpIntegrationConfig.integrated)return void this.logger.log(g.INFO,eO.ODP_NOT_INTEGRATED);var e=this.getVuid();if(e)try{this.eventManager.registerVuid(e)}catch(e){this.logger.log(g.ERROR,eO.ODP_VUID_REGISTRATION_FAILED)}},e}(),tK="ODP event send failed",tG=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return B(t,e),t.prototype.shouldSendEvents=function(e){return e.length<=1||(this.getLogger().log(g.ERROR,"".concat("ODP event send failed"," (browser only supports batch size 1)")),!1)},t.prototype.getPixelApiEndpoint=function(e){return new URL("v2/zaius.gif",e.pixelUrl).href},t.prototype.generateRequestData=function(e,t){var r=this.getPixelApiEndpoint(e),i=e.apiKey,n=t[0],o=new URL(r);return n.identifiers.forEach(function(e,t){o.searchParams.append(t,e)}),n.data.forEach(function(e,t){o.searchParams.append(t,e)}),o.searchParams.append("tracker_id",i),o.searchParams.append("event_type",n.type),o.searchParams.append("vdl_action",n.action),{method:"GET",endpoint:o.toString(),headers:{},data:""}},t}(function(){function e(e,t){this.requestHandler=e,this.logger=t}return e.prototype.getLogger=function(){return this.logger},e.prototype.sendEvents=function(e,t){var r;return q(this,void 0,void 0,function(){var i,n,o,a,s,u,l,c,d;return H(this,function(p){switch(p.label){case 0:if(i=!1,0===t.length)return this.logger.log(g.ERROR,"".concat(tK," (no events)")),[2,i];if(!this.shouldSendEvents(t))return[2,i];o=(n=this.generateRequestData(e,t)).method,a=n.endpoint,s=n.headers,u=n.data,l=0,p.label=1;case 1:return p.trys.push([1,3,,4]),[4,this.requestHandler.makeRequest(a,s,o,u).responsePromise];case 2:return l=null!=(r=p.sent().statusCode)?r:l,[3,4];case 3:return c=p.sent(),d="network error",c instanceof Error&&(d=c.message),this.logger.log(g.ERROR,"".concat(tK," (").concat(d,")")),i=!0,[3,4];case 4:return l>=400&&this.logger.log(g.ERROR,"".concat(tK," (").concat(l,")")),l>=500&&(i=!0),[2,i]}})})},e}()),tj=function(e){"function"==typeof queueMicrotask?queueMicrotask(e):setTimeout(e)};(d=O||(O={}))[d.Stopped=0]="Stopped",d[d.Running=1]="Running";var tB=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.hasNecessaryIdentifiers=function(e){return e.identifiers.size>=0},t}return B(t,e),t.prototype.initParams=function(e,t,r){this.queueSize=t||100,this.batchSize=1,this.flushInterval=0,void 0!==e&&1!==e&&this.getLogger().log(g.WARNING,"ODP event batch size must be 1 in the browser."),void 0!==r&&0!==r&&this.getLogger().log(g.WARNING,"ODP event flush interval must be 0 in the browser.")},t.prototype.discardEventsIfNeeded=function(){this.getLogger().log(g.DEBUG,"ODPConfig not ready. Leaving events in queue.")},t}(function(){function e(e){var t=e.odpConfig,r=e.apiManager,i=e.logger,n=e.clientEngine,o=e.clientVersion,a=e.queueSize,s=e.batchSize,u=e.flushInterval,l=e.userAgentParser,c=e.retries;if(this.status=O.Stopped,this.queue=[],this.apiManager=r,this.logger=i,this.clientEngine=n,this.clientVersion=o,this.initParams(s,a,u),this.status=O.Stopped,this.userAgentParser=l,this.retries=c||3,l){var d=l.parseUserAgentInfo(),p=d.os,f=d.device,g={os:p.name,os_version:p.version,device_type:f.type,model:f.model};this.userAgentData=new Map(Object.entries(g).filter(function(e){e[0];var t=e[1];return null!=t&&void 0!=t}))}t&&this.updateSettings(t)}return e.prototype.updateSettings=function(e){this.odpConfig&&this.odpConfig.equals(e)||(this.flush(),this.odpConfig=e)},e.prototype.flush=function(){this.processQueue(!0)},e.prototype.start=function(){this.odpConfig?(this.status=O.Running,this.batchSize>1&&this.setNewTimeout()):this.logger.log(g.ERROR,eO.ODP_CONFIG_NOT_AVAILABLE)},e.prototype.stop=function(){return q(this,void 0,void 0,function(){return H(this,function(e){return this.logger.log(g.DEBUG,"Stop requested."),this.flush(),this.clearCurrentTimeout(),this.status=O.Stopped,this.logger.log(g.DEBUG,"Stopped. Queue Count: %s",this.queue.length),[2]})})},e.prototype.registerVuid=function(e){var t=new Map;t.set(E.VUID,e);var r=new tV(eP,y.INITIALIZED,t);this.sendEvent(r)},e.prototype.identifyUser=function(e,t){var r=new Map;if(!e&&!t)return void this.logger.log(g.ERROR,eO.ODP_SEND_EVENT_FAILED_UID_MISSING);t&&r.set(E.VUID,t),e&&r.set(E.FS_USER_ID,e);var i=new tV(eP,y.IDENTIFIED,r);this.sendEvent(i)},e.prototype.sendEvent=function(e){tk(e.data)?this.logger.log(g.ERROR,"Event data found to be invalid."):(e.data=this.augmentCommonData(e.data),this.enqueue(e))},e.prototype.enqueue=function(e){this.status===O.Stopped?this.logger.log(g.WARNING,"Failed to Process ODP Event. ODPEventManager is not running."):this.hasNecessaryIdentifiers(e)?this.queue.length>=this.queueSize?this.logger.log(g.WARNING,"Failed to Process ODP Event. Event Queue full. queueSize = %s.",this.queue.length):(this.queue.push(e),this.processQueue()):this.logger.log(g.ERROR,"ODP events should have at least one key-value pair in identifiers.")},e.prototype.processQueue=function(e){if(void 0===e&&(e=!1),this.status===O.Running){if(e)for(this.clearCurrentTimeout();this.queueContainsItems();)this.makeAndSend1Batch();else if(this.queueHasBatches())for(this.clearCurrentTimeout();this.queueHasBatches();)this.makeAndSend1Batch();this.batchSize>1&&this.setNewTimeout()}},e.prototype.clearCurrentTimeout=function(){clearTimeout(this.timeoutId),this.timeoutId=void 0},e.prototype.setNewTimeout=function(){var e=this;void 0===this.timeoutId&&(this.timeoutId=setTimeout(function(){return e.processQueue(!0)},this.flushInterval))},e.prototype.makeAndSend1Batch=function(){var e=this;if(this.odpConfig){var t=this.queue.splice(0,this.batchSize),r=this.odpConfig;t.length>0&&tj(function(){return q(e,void 0,void 0,function(){var e,i;return H(this,function(n){switch(n.label){case 0:i=0,n.label=1;case 1:return[4,this.apiManager.sendEvents(r,t)];case 2:e=n.sent(),i+=1,n.label=3;case 3:if(e&&i<this.retries)return[3,1];n.label=4;case 4:return[2]}})})})}},e.prototype.queueHasBatches=function(){return this.queueContainsItems()&&this.queue.length%this.batchSize==0},e.prototype.queueContainsItems=function(){return this.queue.length>0},e.prototype.augmentCommonData=function(e){var t=new Map(this.userAgentData);return t.set("idempotence_id",$()),t.set("data_source_type","sdk"),t.set("data_source",this.clientEngine),t.set("data_source_version",this.clientVersion),e.forEach(function(e,r){return t.set(r,e)}),t},e.prototype.getLogger=function(){return this.logger},e.prototype.getQueue=function(){return this.queue},e}
2()),tz=function(){function e(e,t,r,i){this.odpConfig=i,this._segmentsCache=e,this.odpSegmentApiManager=t,this.logger=r||ef("OdpSegmentManager")}return Object.defineProperty(e.prototype,"segmentsCache",{get:function(){return this._segmentsCache},enumerable:!1,configurable:!0}),e.prototype.fetchQualifiedSegments=function(e,t,r){return q(this,void 0,void 0,function(){var i,n,o,a,s,u;return H(this,function(l){switch(l.label){case 0:if(!this.odpConfig)return this.logger.log(g.WARNING,eO.ODP_CONFIG_NOT_AVAILABLE),[2,null];if(!(i=this.odpConfig.segmentsToCheck)||i.length<=0)return this.logger.log(g.DEBUG,"No segments are used in the project. Returning an empty list."),[2,[]];if(n=this.makeCacheKey(e,t),o=r.includes(v.IGNORE_CACHE),(a=r.includes(v.RESET_CACHE))&&this.reset(),!o&&!a){if(s=this._segmentsCache.lookup(n))return this.logger.log(g.DEBUG,'ODP cache hit. Returning segments from cache "%s".',n),[2,s];this.logger.log(g.DEBUG,"ODP cache miss.")}return this.logger.log(g.DEBUG,"Making a call to ODP server."),[4,this.odpSegmentApiManager.fetchSegments(this.odpConfig.apiKey,this.odpConfig.apiHost,e,t,i)];case 1:return(u=l.sent())&&!o&&this._segmentsCache.save({key:n,value:u}),[2,u]}})})},e.prototype.reset=function(){this._segmentsCache.reset()},e.prototype.makeCacheKey=function(e,t){return"".concat(e,"-$-").concat(t)},e.prototype.updateSettings=function(e){this.odpConfig=e,this.reset()},e}(),tq={$schema:"http://json-schema.org/draft-04/schema#",title:"Project Config JSON Schema",type:"object",properties:{projectId:{type:"string",required:!0},accountId:{type:"string",required:!0},groups:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},policy:{type:"string",required:!0},trafficAllocation:{type:"array",items:{type:"object",properties:{entityId:{type:"string",required:!0},endOfRange:{type:"integer",required:!0}}},required:!0},experiments:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0},status:{type:"string",required:!0},layerId:{type:"string",required:!0},variations:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0}}},required:!0},trafficAllocation:{type:"array",items:{type:"object",properties:{entityId:{type:"string",required:!0},endOfRange:{type:"integer",required:!0}}},required:!0},audienceIds:{type:"array",items:{type:"string"},required:!0},forcedVariations:{type:"object",required:!0}}},required:!0}}},required:!0},experiments:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0},status:{type:"string",required:!0},layerId:{type:"string",required:!0},variations:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0}}},required:!0},trafficAllocation:{type:"array",items:{type:"object",properties:{entityId:{type:"string",required:!0},endOfRange:{type:"integer",required:!0}}},required:!0},audienceIds:{type:"array",items:{type:"string"},required:!0},forcedVariations:{type:"object",required:!0}}},required:!0},events:{type:"array",items:{type:"object",properties:{key:{type:"string",required:!0},experimentIds:{type:"array",items:{type:"string",required:!0}},id:{type:"string",required:!0}}},required:!0},audiences:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},name:{type:"string",required:!0},conditions:{type:"string",required:!0}}},required:!0},attributes:{type:"array",items:{type:"object",properties:{id:{type:"string",required:!0},key:{type:"string",required:!0}}},required:!0},version:{type:"string",required:!0},revision:{type:"string",required:!0},integrations:{type:"array",items:{type:"object",properties:{key:{type:"string",required:!0},host:{type:"string"},publicKey:{type:"string"},pixelUrl:{type:"string"}}}}}},tH={$schema:"https://json-schema.org/draft/2019-09/schema",$id:"https://example.com/example.json",title:"ODP Response Schema",type:"object",required:["data"],properties:{data:{title:"The data Schema",type:"object",required:["customer"],properties:{customer:{title:"The customer Schema",type:"object",required:[],properties:{audiences:{title:"The audiences Schema",type:"object",required:["edges"],properties:{edges:{title:"The edges Schema",type:"array",items:{title:"A Schema",type:"object",required:["node"],properties:{node:{title:"The node Schema",type:"object",required:["name","state"],properties:{name:{title:"The name Schema",type:"string",examples:["has_email","has_email_opted_in"]}
2,state:{title:"The state Schema",type:"string",examples:["qualified"]}},examples:[]}},examples:[]},examples:[]}},examples:[]}},examples:[]}},examples:[]},errors:{title:"The errors Schema",type:"array",default:[],items:{title:"A Schema",type:"object",required:["message","locations","extensions"],properties:{message:{title:"The message Schema",type:"string",examples:["Exception while fetching data (/customer) : java.lang.RuntimeException: could not resolve _fs_user_id = asdsdaddddd"]},locations:{title:"The locations Schema",type:"array",items:{title:"A Schema",type:"object",required:["line","column"],properties:{line:{title:"The line Schema",type:"integer",examples:[2]},column:{title:"The column Schema",type:"integer",examples:[3]}},examples:[]},examples:[]},path:{title:"The path Schema",type:"array",items:{title:"A Schema",type:"string",examples:["customer"]},examples:[]},extensions:{title:"The extensions Schema",type:"object",required:["classification"],properties:{classification:{title:"The classification Schema",type:"string",examples:["InvalidIdentifierException"]}},examples:[]}},examples:[]},examples:[]}},examples:[]},tX=[],tW="Audience segments fetch failed",tY=function(){function e(e,t){this.toGraphQLJson=function(e,t,r){return X(X(['{"query" : "query {customer',"(".concat(e,' : \\"').concat(t,'\\") '),"{audiences","(subset: ["],(null==r?void 0:r.map(function(e,t){return'\\"'.concat(e,'\\"').concat(t<r.length-1?",":"")}))||"",!0),[']) {edges {node {name state}}}}}"}'],!1).join("")},this.requestHandler=e,this.logger=t}return e.prototype.fetchSegments=function(e,t,r,i,n){var o,a,s,u;return q(this,void 0,void 0,function(){var l,c,d,p,f,h,E,y;return H(this,function(v){switch(v.label){case 0:if(!e||!t)return this.logger.log(g.ERROR,"".concat(tW," (Parameters apiKey or apiHost invalid)")),[2,null];if((null==n?void 0:n.length)===0)return[2,tX];return l="".concat(t,"/v3/graphql"),c=this.toGraphQLJson(r,i,n),[4,this.querySegments(e,l,r,i,c)];case 1:if(!(d=v.sent()))return this.logger.log(g.ERROR,"".concat(tW," (network error)")),[2,null];if(!(p=this.parseSegmentsResponseJson(d)))return this.logger.log(g.ERROR,"".concat(tW," (decode error)")),[2,null];if((null==(o=p.errors)?void 0:o.length)>0)return h=(f=p.errors[0].extensions).code,E=f.classification,"INVALID_IDENTIFIER_EXCEPTION"==h?this.logger.log(g.ERROR,"".concat(tW," (invalid identifier)")):this.logger.log(g.ERROR,"".concat(tW," (").concat(E,")")),[2,null];if(!(y=null==(u=null==(s=null==(a=null==p?void 0:p.data)?void 0:a.customer)?void 0:s.audiences)?void 0:u.edges))return this.logger.log(g.ERROR,"".concat(tW," (decode error)")),[2,null];return[2,y.filter(function(e){return"qualified"==e.node.state}).map(function(e){return e.node.name})]}})})},e.prototype.querySegments=function(e,t,r,i,n){return q(this,void 0,void 0,function(){var r,i,o,a;return H(this,function(s){switch(s.label){case 0:r="POST",i=t,o={"Content-Type":"application/json","x-api-key":e},s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.requestHandler.makeRequest(i,o,r,n).responsePromise];case 2:return a=s.sent(),[3,4];case 3:return s.sent(),[2,null];case 4:return[2,a.body]}})})},e.prototype.parseSegmentsResponseJson=function(e){var t={};try{t=JSON.parse(e)}catch(e){return null}return!function(e,t,r){void 0===t&&(t=tq),void 0===r&&(r=!0);var i="".concat("JSON_SCHEMA_VALIDATOR"," (").concat(t.title,")");if("object"!=typeof e||null===e)throw Error(et(eO.NO_JSON_PROVIDED,i));var n=(0,x.validate)(e,t);if(n.valid)return!0;if(!r)return!1;if(Array.isArray(n.errors))throw Error(et(eO.INVALID_DATAFILE,i,n.errors[0].property,n.errors[0].message));throw Error(et(eO.INVALID_JSON,i))}(t,tH,!1)?null:t},e}(),tJ=function(e){function t(t){return e.call(this,t)||this}return B(t,e),t.createInstance=function(e){var r,i,n,o=e.logger,a=e.odpOptions,s=e.odpIntegrationConfig,u=e.clientEngine,l=e.clientVersion;o=o||ef(),u=u||eN,l=l||eA;var c=void 0;return(null==s?void 0:s.integrated)&&(c=s.odpConfig),r=(null==a?void 0:a.segmentsRequestHandler)?a.segmentsRequestHandler:new tw(o,(null==a?void 0:a.segmentsApiTimeout)||1e4),i=(null==a?void 0:a.segmentManager)?a.segmentManager:new tz((null==a?void 0:a.segmentsCache)||new tL({maxSize:null==a?void 0:a.segmentsCacheSize,timeout:null==a?void 0:a.segmentsCacheTimeout}),new tY(r,o),o,c),n=(null==a?void 0:a.eventRequestHandler)?a.eventRequestHandler:new tw(o,(null==a?void 0:a.eventApiTimeout)||1e4),new t({odpIntegrationConfig:s,segmentManager:i,eventManager:(null==a?void 0:a.eventManager)?a.eventManager:new tB({odpConfig:c,apiManager:new tG(n,o),logger:o,clientEngine:u,clientVersion:l,flushInterval:null==a?void 0:a.eventFlushInterval,batchSize:null==a?void 0:a.eventBatchSize,queueSize:null==a?void 0:a.eventQueueSize,userAgentParser:null==a?void 0:a.userAgentParser}),logger:o})},t.prototype.initializeVuid=function(){return q(this,void 0,void 0,function(){var e;return H(this,function(r){switch(r.label){case 0:return[4,tP.instance(t.cache)];case 1:return e=r.sent(),this.vuid=e.vuid,[2]}})})},t.prototype.identifyUser=function(t,r){t&&tP.isVuid(t)?e.prototype.identifyUser.call(this,void 0,t):t&&r&&tP.isVuid(r)?e.prototype.identifyUser.call(this,t,r):e.prototype.identifyUser.call(this,t,r||this.vuid)},t.prototype.sendEvent=function(t){var r=t.type,i=t.action,n=t.identifiers,o=t.data,a=new Map(n);if(!n.has(E.VUID))if(this.vuid)a.set(E.VUID,this.vuid);else throw Error(eO.ODP_SEND_EVENT_FAILED_VUID_MISSING);e.prototype.sendEvent.call(this,{type:r,action:i,identifiers:a,data:o})},t.prototype.isVuidEnabled=function(){return!0},t.prototype.getVuid=function(){return this.vuid}
2,t.cache=new tU,t}(tF);function t$(e,t,r){return{variationKey:null,enabled:!1,variables:{},ruleKey:null,flagKey:e,userContext:t,reasons:r}}var tQ=function(){function e(e){var t,r=e.optimizely,i=e.userId,n=e.attributes,o=e.shouldIdentifyUser,a=this;this._qualifiedSegments=null,this.optimizely=r,this.userId=i,this.attributes=null!=(t=z({},n))?t:{},this.forcedDecisionsMap={},(void 0===o||o)&&r.readyPromise.then(function(e){e.success&&r.isOdpIntegrated()&&a.identifyUser()})}return e.prototype.identifyUser=function(){this.optimizely.identifyUser(this.userId)},e.prototype.setAttribute=function(e,t){this.attributes[e]=t},e.prototype.getUserId=function(){return this.userId},e.prototype.getAttributes=function(){return z({},this.attributes)},e.prototype.getOptimizely=function(){return this.optimizely},Object.defineProperty(e.prototype,"qualifiedSegments",{get:function(){return this._qualifiedSegments},set:function(e){this._qualifiedSegments=e},enumerable:!1,configurable:!0}),e.prototype.decide=function(e,t){return void 0===t&&(t=[]),this.optimizely.decide(this.cloneUserContext(),e,t)},e.prototype.decideForKeys=function(e,t){return void 0===t&&(t=[]),this.optimizely.decideForKeys(this.cloneUserContext(),e,t)},e.prototype.decideAll=function(e){return void 0===e&&(e=[]),this.optimizely.decideAll(this.cloneUserContext(),e)},e.prototype.trackEvent=function(e,t){this.optimizely.track(e,this.userId,this.attributes,t)},e.prototype.setForcedDecision=function(e,t){var r,i=e.flagKey,n=null!=(r=e.ruleKey)?r:eR.FORCED_DECISION_NULL_RULE_KEY,o=t.variationKey;return this.forcedDecisionsMap[i]||(this.forcedDecisionsMap[i]={}),this.forcedDecisionsMap[i][n]={variationKey:o},!0},e.prototype.getForcedDecision=function(e){return this.findForcedDecision(e)},e.prototype.removeForcedDecision=function(e){var t,r=null!=(t=e.ruleKey)?t:eR.FORCED_DECISION_NULL_RULE_KEY,i=e.flagKey,n=!1;return this.forcedDecisionsMap.hasOwnProperty(i)&&(this.forcedDecisionsMap[i].hasOwnProperty(r)&&(delete this.forcedDecisionsMap[i][r],n=!0),0===Object.keys(this.forcedDecisionsMap[i]).length&&delete this.forcedDecisionsMap[i]),n},e.prototype.removeAllForcedDecisions=function(){return this.forcedDecisionsMap={},!0},e.prototype.findForcedDecision=function(e){var t,r=null!=(t=e.ruleKey)?t:eR.FORCED_DECISION_NULL_RULE_KEY,i=e.flagKey;if(this.forcedDecisionsMap.hasOwnProperty(e.flagKey)){var n=this.forcedDecisionsMap[i];if(n.hasOwnProperty(r))return{variationKey:n[r].variationKey}}return null},e.prototype.cloneUserContext=function(){var t=new e({shouldIdentifyUser:!1,optimizely:this.getOptimizely(),userId:this.getUserId(),attributes:this.getAttributes()});return Object.keys(this.forcedDecisionsMap).length>0&&(t.forcedDecisionsMap=z({},this.forcedDecisionsMap)),t._qualifiedSegments=this._qualifiedSegments,t},e.prototype.fetchQualifiedSegments=function(e){return q(this,void 0,void 0,function(){var t;return H(this,function(r){switch(r.label){case 0:return[4,this.optimizely.fetchQualifiedSegments(this.userId,e)];case 1:return t=r.sent(),this.qualifiedSegments=t,[2,null!==t]}})})},e.prototype.isQualifiedFor=function(e){return!!this._qualifiedSegments&&this._qualifiedSegments.indexOf(e)>-1},e}(),tZ=["and","or","not"];function t0(e,t){if(Array.isArray(e)){var r=e[0],i=e.slice(1);switch("string"==typeof r&&-1===tZ.indexOf(r)&&(r="or",i=e),r){case"and":var n=i,o=t,a=!1;if(Array.isArray(n)){for(var s=0;s<n.length;s++){var u=t0(n[s],o);if(!1===u)return!1;null===u&&(a=!0)}return!a||null}return null;case"not":var l=i,c=t;if(Array.isArray(l)&&l.length>0){var d=t0(l[0],c);return null===d?null:!d}return null;default:var p=i,f=t,g=!1;if(Array.isArray(p)){for(var h=0;h<p.length;h++){var E=t0(p[h],f);if(!0===E)return!0;null===E&&(g=!0)}return!!g&&null}return null}}return t(e)}var t1=function(){function e(t,r,i){this.sdkKey=null!=(n=t.sdkKey)?n:"",this.environmentKey=null!=(o=t.environmentKey)?o:"",this.attributes=t.attributes,this.audiences=e.getAudiences(t),this.events=t.events,this.revision=t.revision;var n,o,a=(t.featureFlags||[]).reduce(function(e,t){return e[t.id]=t.variables,e},{}),s=e.getVariableIdMap(t),u=e.getExperimentsMap(t,a,s,i),l=u.experimentsMapById,c=u.experimentsMapByKey;this.experimentsMap=c,this.featuresMap=e.getFeaturesMap(t,a,l,s),this.datafile=r}return e.prototype.getDatafile=function(){return this.datafile},e.getAudiences=function(e){var t=[],r=[];
2return(e.typedAudiences||[]).forEach(function(e){t.push({id:e.id,conditions:JSON.stringify(e.conditions),name:e.name}),r.push(e.id)}),(e.audiences||[]).forEach(function(e){-1===r.indexOf(e.id)&&"$opt_dummy_audience"!=e.id&&t.push({id:e.id,conditions:JSON.stringify(e.conditions),name:e.name})}),t},e.getSerializedAudiences=function(t,r){var i="";if(t){var n="";t.forEach(function(t){var o="";if(t instanceof Array)o=e.getSerializedAudiences(t,r),o="(".concat(o,")");else if(tZ.indexOf(t)>-1)n=t.toUpperCase();else{var a=r[t]?r[t].name:t;i||"NOT"===n?(n=""===n?"OR":n,i=""===i?"".concat(n,' "').concat(r[t].name,'"'):i.concat(" ".concat(n,' "').concat(a,'"'))):i='"'.concat(a,'"')}""!==o&&(""!==i||"NOT"===n?(n=""===n?"OR":n,i=""===i?"".concat(n," ").concat(o):i.concat(" ".concat(n," ").concat(o))):i=i.concat(o))})}return i},e.getExperimentAudiences=function(t,r){return t.audienceConditions?e.getSerializedAudiences(t.audienceConditions,r.audiencesById):""},e.mergeFeatureVariables=function(e,t,r,i,n){var o=(e[r]||[]).reduce(function(e,t){return e[t.key]={id:t.id,key:t.key,type:t.type,value:t.defaultValue},e},{});return(i||[]).forEach(function(e){var r=t[e.id],i={id:e.id,key:r.key,type:r.type,value:n?e.value:r.defaultValue};o[r.key]=i}),o},e.getVariationsMap=function(t,r,i,n){return t.reduce(function(t,o){var a=e.mergeFeatureVariables(r,i,n,o.variables,o.featureEnabled);return t[o.key]={id:o.id,key:o.key,featureEnabled:o.featureEnabled,variablesMap:a},t},{})},e.getVariableIdMap=function(e){return(e.featureFlags||[]).reduce(function(e,t){return t.variables.forEac
2h(function(t){e[t.id]=t}),e},{})},e.getDeliveryRules=function(t,r,i,n,o){return n.map(function(n){return{id:n.id,key:n.key,audiences:e.getExperimentAudiences(n,t),variationsMap:e.getVariationsMap(n.variations,r,o,i)}})},e.getRolloutExperimentIds=function(e){var t=[];return(e||[]).forEach(function(e){e.experiments.forEach(function(e){t.push(e.id)})}),t},e.getExperimentsMap=function(t,r,i,n){var o=this.getRolloutExperimentIds(t.rollouts),a={},s={};return(t.experiments||[]).forEach(function(u){if(-1===o.indexOf(u.id)){var l=t.experimentFeatureMap[u.id],c="";l&&l.length>0&&(c=l[0]);var d=e.getVariationsMap(u.variations,r,i,c.toString()),p={id:u.id,key:u.key,audiences:e.getExperimentAudiences(u,t),variationsMap:d};a[u.id]=p,s[u.key]&&n&&n.warn("Duplicate experiment keys found in datafile: ".concat(u.key)),s[u.key]=p}}),{experimentsMapById:a,experimentsMapByKey:s}},e.getExperimentsKeyMap=function(e){var t={};for(var r in e){var i=e[r];t[i.key]=i}return t},e.getFeaturesMap=function(t,r,i,n){var o={};return t.featureFlags.forEac
2h(function(a){var s={},u=[];a.experimentIds.forEach(function(e){var t=i[e];t&&(s[t.key]=t),u.push(i[e])});var l=(a.variables||[]).reduce(function(e,t){return e[t.key]={id:t.id,key:t.key,type:t.type,value:t.defaultValue},e},{}),c=[],d=t.rolloutIdMap[a.rolloutId];d&&(c=e.getDeliveryRules(t,r,a.id,d.experiments,n)),o[a.key]={id:a.id,key:a.key,experimentRules:u,deliveryRules:c,experimentsMap:s,variablesMap:l}}),o},e}(),t2=ef();function t5(e,t){return e instanceof Error?e.message:t||"Unknown error"}var t3=function(){function e(e){this.updateListeners=[],this.configObj=null,this.optimizelyConfigObj=null,this.datafileManager=null;try{if(this.jsonSchemaValidator=e.jsonSchemaValidator,!e.datafile&&!e.sdkKey){var t=Error(et(eO.DATAFILE_AND_SDK_KEY_MISSING,"PROJECT_CONFIG_MANAGER"));this.readyPromise=Promise.resolve({success:!1,reason:t5(t)}),t2.error(t);return}var r=null;e.datafile&&(r=this.handleNewDatafile(e.datafile)),e.sdkKey&&e.datafileManager?(this.datafileManager=e.datafileManager,this.datafileManager.start(),this.readyPromise=this.datafileManager.onReady().then(this.onDatafileManagerReadyFulfill.bind(this),this.onDatafileManagerReadyReject.bind(this)),this.datafileManager.on("update",this.onDatafileManagerUpdate.bind(this))):this.configObj?this.readyPromise=Promise.resolve({success:!0}):this.readyPromise=Promise.resolve({success:!1,reason:t5(r,"Invalid datafile")})}catch(e){t2.error(e),this.readyPromise=Promise.resolve({success:!1,reason:t5(e,"Error in initialize")})}}return e.prototype.onDatafileManagerReadyFulfill=function(){if(this.datafileManager){var e=this.handleNewDatafile(this.datafileManager.get());return e?{success:!1,reason:t5(e)}:{success:!0}}return{success:!1,reason:t5(null,"Datafile manager is not provided")}},e.prototype.onDatafileManagerReadyReject=function(e){return{success:!1,reason:t5(e,"Failed to become ready")}},e.prototype.onDatafileManagerUpdate=function(){this.datafileManager&&this.handleNewDatafile(this.datafileManager.get())},e.prototype.handleNewDatafile=function(e){var t=this,r=tA({datafile:e,jsonSchemaValidator:this.jsonSchemaValidator,logger:t2}),i=r.configObj,n=r.error;if(n)t2.error(n);else{var o=this.configObj?this.configObj.revision:"null";i&&o!==i.revision&&(this.configObj=i,this.optimizelyConfigObj=null,tj(function(){t.updateListeners.forEach(function(e){return e(i)})}))}return n},e.prototype.getConfig=function(){return this.configObj},e.prototype.getOptimizelyConfig=function(){var e;return!this.optimizelyConfigObj&&this.configObj&&(this.optimizelyConfigObj=(e=this.configObj,new t1(e,tT(this.configObj),t2))),this.optimizelyConfigObj},e.prototype.onReady=function(){return this.readyPromise},e.prototype.onUpdate=function(e){var t=this;return this.updateListeners.push(e),function(){var r=t.updateListeners.indexOf(e);r>-1&&t.updateListeners.splice(r,1)}},e.prototype.stop=function(){this.datafileManager&&this.datafileManager.stop(),this.updateListeners=[]},e}(),t6="BUCKETER",t4=function(e){var t=[],r=e.experimentIdMap[e.experimentId].groupId;if(r){var i=e.groupIdMap[r];if(!i)throw Error(et(eO.INVALID_GROUP_ID,t6,r));if("random"===i.policy){var n=t9(i,e.bucketingId,e.userId,e.logger);if(null===n)return e.logger.log(em.INFO,eb.USER_NOT_IN_ANY_EXPERIMENT,t6,e.userId,r),t.push([eb.USER_NOT_IN_ANY_EXPERIMENT,t6,e.userId,r]),{result:null,reasons:t};if(n!==e.experimentId)return e.logger.log(em.INFO,eb.USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP,t6,e.userId,e.experimentKey,r),t.push([eb.USER_NOT_BUCKETED_INTO_EXPERIMENT_IN_GROUP,t6,e.userId,e.experimentKey,r]),{result:null,reasons:t};e.logger.log(em.INFO,eb.USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP,t6,e.userId,e.experimentKey,r),t.push([eb.USER_BUCKETED_INTO_EXPERIMENT_IN_GROUP,t6,e.userId,e.experimentKey,r])}}var o=t7("".concat(e.bucketingId).concat(e.experimentId));e.logger.log(em.DEBUG,eb.USER_ASSIGNED_TO_EXPERIMENT_BUCKET,t6,o,e.userId),t.push([eb.USER_ASSIGNED_TO_EXPERIMENT_BUCKET,t6,o,e.userId]);var a=t8(o,e.trafficAllocationConfig);return null===a||e.variationIdMap[a]?{result:a,reasons:t}:(a&&(e.logger.log(em.WARNING,eb.INVALID_VARIATION_ID,t6),t.push([eb.INVALID_VARIATION_ID,t6])),{result:null,reasons:t})},t9=function(e,t,r,i){var n=t7("".concat(t).concat(e.id));return i.log(em.DEBUG,eb.USER_ASSIGNED_TO_EXPERIMENT_BUCKET,t6,n,r),t8(n,e.trafficAllocation)},t8=function(e,t){for(var r=0;r<t.length;
2r++)if(e<t[r].endOfRange)return t[r].entityId;return null},t7=function(e){try{var t=F.default.v3(e,1);return Math.floor(t/0x100000000*1e4)}catch(t){throw Error(et(eO.INVALID_BUCKETING_ID,t6,e,t.message))}},re="SEMANTIC VERSION",rt=ef();function rr(e){return/^\d+$/.test(e)}function ri(e){var t=e.indexOf("-"),r=e.indexOf("+");return!(t<0)&&(r<0||t<r)}function rn(e){var t=e.indexOf("-"),r=e.indexOf("+");return!(r<0)&&(t<0||r<t)}function ro(e){var t=e,r="";if(/\s/.test(e))return rt.warn(eb.UNKNOWN_MATCH_TYPE,re,e),null;if(ri(e)?(t=e.substring(0,e.indexOf("-")),r=e.substring(e.indexOf("-")+1)):rn(e)&&(t=e.substring(0,e.indexOf("+")),r=e.substring(e.indexOf("+")+1)),"string"!=typeof t||"string"!=typeof r)return null;var i=t.split(".").length-1;if(i>2)return rt.warn(eb.UNKNOWN_MATCH_TYPE,re,e),null;var n=t.split(".");if(n.length!=i+1)return rt.warn(eb.UNKNOWN_MATCH_TYPE,re,e),null;for(var o=0;o<n.length;o++)if(!rr(n[o]))return rt.warn(eb.UNKNOWN_MATCH_TYPE,re,e),null;return r&&n.push(r),n}var ra="CUSTOM_ATTRIBUTE_CONDITION_EVALUATOR",rs=ef(),ru="exact",rl="exists",rc="semver_eq",rd="semver_ge",rp="semver_gt",rf="semver_le",rg="semver_lt",rh="substring",rE=[ru,rl,"gt","ge","lt","le",rh,rc,rg,rf,rp,rd],ry={};function rv(e){return"string"==typeof e||"boolean"==typeof e||en(e)}function r_(e,t){var r=t.getAttributes(),i=e.value,n=typeof i,o=e.name,a=r[o],s=typeof a;return!rv(i)||en(i)&&!ei(i)?(rs.warn(eb.UNEXPECTED_CONDITION_VALUE,ra,JSON.stringify(e)),null):null===a?(rs.debug(eb.UNEXPECTED_TYPE_NULL,ra,JSON.stringify(e),o),null):rv(a)&&n===s?en(a)&&!ei(a)?(rs.warn(eb.OUT_OF_BOUNDS,ra,JSON.stringify(e),o),null):i===a:(rs.warn(eb.UNEXPECTED_TYPE,ra,JSON.stringify(e),s,o),null)}function rI(e,t){var r=t.getAttributes(),i=e.name,n=r[i],o=typeof n,a=e.value;return null!==a&&ei(a)?null===n?(rs.debug(eb.UNEXPECTED_TYPE_NULL,ra,JSON.stringify(e),i),!1):en(n)?!!ei(n)||(rs.warn(eb.OUT_OF_BOUNDS,ra,JSON.stringify(e),i),!1):(rs.warn(eb.UNEXPECTED_TYPE,ra,JSON.stringify(e),o,i),!1):(rs.warn(eb.UNEXPECTED_CONDITION_VALUE,ra,JSON.stringify(e)),!1)}function rm(e,t){var r=t.getAttributes(),i=e.name,n=r[i],o=e.value;return"string"!=typeof o?(rs.warn(eb.UNEXPECTED_CONDITION_VALUE,ra,JSON.stringify(e)),null):null===n?(rs.debug(eb.UNEXPECTED_TYPE_NULL,ra,JSON.stringify(e),i),null):"string"!=typeof n?(rs.warn(eb.UNEXPECTED_TYPE,ra,JSON.stringify(e),typeof n,i),null):function(e,t){var r=ro(t),i=ro(e);if(!r||!i)return null;for(var n=r.length,o=0;o<i.length;o++)if(n<=o)return ri(e)||rn(e)?1:-1;else if(rr(r[o])){var a=parseInt(r[o]),s=parseInt(i[o]);if(a>s)return 1;if(a<s)return -1}else if(r[o]<i[o])return ri(e)&&!ri(t)?1:-1;else if(r[o]>i[o])return!ri(e)&&ri(t)?-1:1;return ri(t)&&!ri(e)?-1:0}(o,n)}ry[ru]=r_,ry[rl]=function(e,t){return null!=t.getAttributes()[e.name]},ry.gt=function(e,t){var r=t.getAttributes()[e.name],i=e.value;return rI(e,t)&&null!==i?r>i:null},ry.ge=function(e,t){var r=t.getAttributes()[e.name],i=e.value;return rI(e,t)&&null!==i?r>=i:null},ry.lt=function(e,t){var r=t.getAttributes()[e.name],i=e.value;return rI(e,t)&&null!==i?r<i:null},ry.le=function(e,t){var r=t.getAttributes()[e.name],i=e.value;return rI(e,t)&&null!==i?r<=i:null},ry[rh]=function(e,t){var r=t.getAttributes(),i=e.name,n=r[e.name],o=typeof n,a=e.value;return"string"!=typeof a?(rs.warn(eb.UNEXPECTED_CONDITION_VALUE,ra,JSON.stringify(e)),null):null===n?(rs.debug(eb.UNEXPECTED_TYPE_NULL,ra,JSON.stringify(e),i),null):"string"!=typeof n?(rs.warn(eb.UNEXPECTED_TYPE,ra,JSON.stringify(e),o,i),null):-1!==n.indexOf(a)},ry[rc]=function(e,t){var r=rm(e,t);return null===r?null:0===r},ry[rp]=function(e,t){var r=rm(e,t);return null===r?null:r>0},ry[rd]=function(e,t){var r=rm(e,t);return null===r?null:r>=0},ry[rg]=function(e,t){var r=rm(e,t);return null===r?null:r<0},ry[rf]=function(e,t){var r=rm(e,t);return null===r?null:r<=0};var rO=Object.freeze({__proto__:null,evaluate:function(e,t){var r=t.getAttributes(),i=e.match;if(void 0!==i&&-1===rE.indexOf(i))return rs.warn(eb.UNKNOWN_MATCH_TYPE,ra,JSON.stringify(e)),null;var n=e.name;return r.hasOwnProperty(n)||i==rl?(i&&ry[i]||r_)(e,t):(rs.debug(eb.MISSING_ATTRIBUTE_VALUE,ra,JSON.stringify(e),n),null)}}),rb=ef(),rR="qualified",rN=[rR],rT={};function rA(e,t){return t.isQualifiedFor(e.value)}rT[rR]=rA;var rS=Object.freeze({__proto__:null,evaluate:function(e,t){var r=e.match;return void 0!==r&&-1===rN.indexOf(r)?(rb.warn(eb.UNKNOWN_MATCH_TYPE,"ODP_SEGMENT_CONDITION_EVALUATOR",JSON.stringify(e)),null):(r&&rT[r]||rA)(e,t)}}),rw=ef(),rD="AUDIENCE_EVALUATOR",rU=function(){function e(e){this.typeToEvaluatorMap=Y({},e,{custom_attribute:rO,third_party_dimension:rS})}return e.prototype.evaluate=function(e,t,r){var i=this;return!e||0===e.length||!!t0(e,function(e){var n=t[e];if(n){rw.log(em.DEBUG,eb.EVALUATING_AUDIENCE,rD,e,JSON.stringify(n.conditions));var o=t0(n.conditions,i.evaluateConditionWithUserAttributes.bind(i,r)),a=null===o?"UNKNOWN":o.toString().toUpperCase();return rw.log(em.DEBUG,eb.AUDIENCE_EVALUATION_RESULT,rD,e,a),o}return null})},e.prototype.evaluateConditionWithUserAttributes=function(e,t){var r=this.t
2ypeToEvaluatorMap[t.type];if(!r)return rw.log(em.WARNING,eb.UNKNOWN_CONDITION_TYPE,rD,JSON.stringify(t)),null;try{return r.evaluate(t,e)}catch(e){rw.log(em.ERROR,eO.CONDITION_EVALUATOR_ERROR,rD,t.type,e.message)}return null},e}();function rC(e){return"string"==typeof e&&""!==e}var rM="DECISION_SERVICE",rL=function(){function e(e){this.audienceEvaluator=new rU(e.UNSTABLE_conditionEvaluators),this.forcedVariationMap={},this.logger=e.logger,this.userProfileService=e.userProfileService||null}return e.prototype.getVariation=function(e,t,r,i){void 0===i&&(i={});var n=r.getUserId(),o=r.getAttributes(),a=this.getBucketingId(n,o),s=[],u=t.key;if(!this.checkIfExperimentIsActive(e,u))return this.logger.log(em.INFO,eb.EXPERIMENT_NOT_RUNNING,rM,u),s.push([eb.EXPERIMENT_NOT_RUNNING,rM,u]),{result:null,reasons:s};var l=this.getForcedVariation(e,u,n);s.push.apply(s,l.reasons);var c=l.result;if(c)return{result:c,reasons:s};var d=this.getWhitelistedVariation(t,n);s.push.apply(s,d.reasons);var p=d.result;if(p)return{result:p.key,reasons:s};var f=i[I.IGNORE_USER_PROFILE_SERVICE],g=this.resolveExperimentBucketMap(n,o);if(!f&&(p=this.getStoredVariation(e,t,n,g)))return this.logger.log(em.INFO,eb.RETURNING_STORED_VARIATION,rM,p.key,u,n),s.push([eb.RETURNING_STORED_VARIATION,rM,p.key,u,n]),{result:p.key,reasons:s};var h=this.checkIfUserIsInAudience(e,t,eD.EXPERIMENT,r,"");if(s.push.apply(s,h.reasons),!h.result)return this.logger.log(em.INFO,eb.USER_NOT_IN_EXPERIMENT,rM,n,u),s.push([eb.USER_NOT_IN_EXPERIMENT,rM,n,u]),{result:null,reasons:s};var E=t4(this.buildBucketerParams(e,t,a,n));s.push.apply(s,E.reasons);var y=E.result;return(y&&(p=e.variationIdMap[y]),p)?(this.logger.log(em.INFO,eb.USER_HAS_VARIATION,rM,n,p.key,u),s.push([eb.USER_HAS_VARIATION,rM,n,p.key,u]),f||this.saveUserProfile(t,p,n,g),{result:p.key,reasons:s}):(this.logger.log(em.DEBUG,eb.USER_HAS_NO_VARIATION,rM,n,u),s.push([eb.USER_HAS_NO_VARIATION,rM,n,u]),{result:null,reasons:s})},e.prototype.resolveExperimentBucketMap=function(e,t){t=t||{};var r=this.getUserProfile(e)||{},i=t[eR.STICKY_BUCKETING_KEY];return Y({},r.experiment_bucket_map,i)},e.prototype.checkIfExperimentIsActive=function(e,t){return tg(e,t)===to},e.prototype.getWhitelistedVariation=function(e,t){var r=[];if(e.forcedVariations&&e.forcedVariations.hasOwnProperty(t)){var i=e.forcedVariations[t];if(e.variationKeyMap.hasOwnProperty(i))return this.logger.log(em.INFO,eb.USER_FORCED_IN_VARIATION,rM,t,i),r.push([eb.USER_FORCED_IN_VARIATION,rM,t,i]),{result:e.variationKeyMap[i],reasons:r};this.logger.log(em.ERROR,eb.FORCED_BUCKETING_FAILED,rM,i,t),r.push([eb.FORCED_BUCKETING_FAILED,rM,i,t])}return{result:null,reasons:r}},e.prototype.checkIfUserIsInAudience=function(e,t,r,i,n){var o=[],a=th(e,t.id),s=e.audiencesById;this.logger.log(em.DEBUG,eb.EVALUATING_AUDIENCES_COMBINED,rM,r,n||t.key,JSON.stringify(a)),o.push([eb.EVALUATING_AUDIENCES_COMBINED,rM,r,n||t.key,JSON.stringify(a)]);var u=this.audienceEvaluator.evaluate(a,s,i);return this.logger.log(em.INFO,eb.AUDIENCE_EVALUATION_RESULT_COMBINED,rM,r,n||t.key,u.toString().toUpperCase()),o.push([eb.AUDIENCE_EVALUATION_RESULT_COMBINED,rM,r,n||t.key,u.toString().toUpperCase()]),{result:u,reasons:o}},e.prototype.buildBucketerParams=function(e,t,r,i){return{bucketingId:r,experimentId:t.id,experimentKey:t.key,experimentIdMap:e.experimentIdMap,experimentKeyMap:e.experimentKeyMap,groupIdMap:e.groupIdMap,logger:this.logger,trafficAllocationConfig:t_(e,t.id),userId:i,variationIdMap:e.variationIdMap}},e.prototype.getStoredVariation=function(e,t,r,i){if(i.hasOwnProperty(t.id)){var n=i[t.id],o=n.variation_id;if(e.variationIdMap.hasOwnProperty(o))return e.variationIdMap[n.variation_id];this.logger.log(em.INFO,eb.SAVED_VARIATION_NOT_FOUND,rM,r,o,t.key)}return null},e.prototype.getUserProfile=function(e){if(!this.userProfileService)return{user_id:e,experiment_bucket_map:{}};try{return this.userProfileService.lookup(e)}catch(t){this.logger.log(em.ERROR,eO.USER_PROFILE_LOOKUP_ERROR,rM,e,t.message)}return null},e.prototype.saveUserProfile=function(e,t,r,i){if(this.userProfileService)try{i[e.id]={variation_id:t.
2id},this.userProfileService.save({user_id:r,experiment_bucket_map:i}),this.logger.log(em.INFO,eb.SAVED_VARIATION,rM,t.key,e.key,r)}catch(e){this.logger.log(em.ERROR,eO.USER_PROFILE_SAVE_ERROR,rM,r,e.message)}},e.prototype.getVariationForFeature=function(e,t,r,i){void 0===i&&(i={});var n=[],o=this.getVariationForFeatureExperiment(e,t,r,i);n.push.apply(n,o.reasons);var a=o.result;if(null!==a.variation)return{result:a,reasons:n};var s=this.getVariationForRollout(e,t,r);n.push.apply(n,s.reasons);var u=s.result,l=r.getUserId();return u.variation?(this.logger.log(em.DEBUG,eb.USER_IN_ROLLOUT,rM,l,t.key),n.push([eb.USER_IN_ROLLOUT,rM,l,t.key])):(this.logger.log(em.DEBUG,eb.USER_NOT_IN_ROLLOUT,rM,l,t.key),n.push([eb.USER_NOT_IN_ROLLOUT,rM,l,t.key])),{result:u,reasons:n}},e.prototype.getVariationForFeatureExperiment=function(e,t,r,i){void 0===i&&(i={});var n,o,a=[],s=null;if(t.experimentIds.length>0)for(o=0;o<t.experimentIds.length;o++){var u=tI(e,t.experimentIds[o],this.logger);if(u&&(n=this.getVariationFromExperimentRule(e,t.key,u,r,i),a.push.apply(a,n.reasons),s=n.result)){var l=null;return(l=u.variationKeyMap[s])||(l=tm(e,t.key,s)),{result:{experiment:u,variation:l,decisionSource:ew.FEATURE_TEST},reasons:a}}}else this.logger.log(em.DEBUG,eb.FEATURE_HAS_NO_EXPERIMENTS,rM,t.key),a.push([eb.FEATURE_HAS_NO_EXPERIMENTS,rM,t.key]);return{result:{experiment:null,variation:null,decisionSource:ew.FEATURE_TEST},reasons:a}},e.prototype.getVariationForRollout=function(e,t,r){var i,n,o,a=[];if(!t.rolloutId)return this.logger.log(em.DEBUG,eb.NO_ROLLOUT_EXISTS,rM,t.key),a.push([eb.NO_ROLLOUT_EXISTS,rM,t.key]),{result:{experiment:null,variation:null,decisionSource:ew.ROLLOUT},reasons:a};var s=e.rolloutIdMap[t.rolloutId];if(!s)return this.logger.log(em.ERROR,eO.INVALID_ROLLOUT_ID,rM,t.rolloutId,t.key),a.push([eO.INVA
2LID_ROLLOUT_ID,rM,t.rolloutId,t.key]),{result:{experiment:null,variation:null,decisionSource:ew.ROLLOUT},reasons:a};var u=s.experiments;if(0===u.length)return this.logger.log(em.ERROR,eb.ROLLOUT_HAS_NO_EXPERIMENTS,rM,t.rolloutId),a.push([eb.ROLLOUT_HAS_NO_EXPERIMENTS,rM,t.rolloutId]),{result:{experiment:null,variation:null,decisionSource:ew.ROLLOUT},reasons:a};for(var l=0;l<u.length;){if(i=this.getVariationFromDeliveryRule(e,t.key,u,l,r),a.push.apply(a,i.reasons),o=i.result,n=i.skipToEveryoneElse,o)return{result:{experiment:e.experimentIdMap[u[l].id],variation:o,decisionSource:ew.ROLLOUT},reasons:a};l=n?u.length-1:l+1}return{result:{experiment:null,variation:null,decisionSource:ew.ROLLOUT},reasons:a}},e.prototype.getBucketingId=function(e,t){var r=e;return null!=t&&"object"==typeof t&&t.hasOwnProperty(eR.BUCKETING_ID)&&("string"==typeof t[eR.BUCKETING_ID]?(r=String(t[eR.BUCKETING_ID]),this.logger.log(em.DEBUG,eb.VALID_BUCKETING_ID,rM,r)):this.logger.log(em.WARNING,eb.BUCKETING_ID_NOT_STRING,rM)),r},e.prototype.findValidatedForcedDecision=function(e,t,r,i){var n,o=[],a=t.getForcedDecision({flagKey:r,ruleKey:i}),s=null,u=t.getUserId();return e&&a&&((s=tm(e,r,n=a.variationKey))?i?(this.logger.log(em.INFO,eb.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED,n,r,i,u),o.push([eb.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED,n,r,i,u])):(this.logger.log(em.INFO,eb.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED,n,r,u),o.push([eb.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED,n,r,u])):i?(this.logger.log(em.INFO,eb.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID,r,i,u),o.push([eb.USER_HAS_FORCED_DECISION_WITH_RULE_SPECIFIED_BUT_INVALID,r,i,u])):(this.logger.log(em.INFO,eb.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID,r,u),o.push([eb.USER_HAS_FORCED_DECISION_WITH_NO_RULE_SPECIFIED_BUT_INVALID,r,u]))),{result:s,reasons:o}},e.prototype.removeForcedVariation=function(e,t,r){if(!e)throw Error(et(eO.INVALID_USER_ID,rM));if(this.forcedVariationMap.hasOwnProperty(e))delete this.forcedVariationMap[e][t],this.logger.log(em.DEBUG,eb.VARIATION_REMOVED_FOR_USER,rM,r,e);else throw Error(et(eO.USER_NOT_IN_FORCED_VARIATION,rM,e))},e.prototype.setInForcedVariationMap=function(e,t,r){this.forcedVariationMap.hasOwnProperty(e)||(this.forcedVariationMap[e]={}),this.forcedVariationMap[e][t]=r,this.logger.log(em.DEBUG,eb.USER_MAPPED_TO_FORCED_VARIATION,rM,r,t,e)},e.prototype.getForcedVariation=function(e,t,r){var i,n=[],o=this.forcedVariationMap[r];if(!o)return this.logger.log(em.DEBUG,eb.USER_HAS_NO_FORCED_VARIATION,rM,r),{result:null,reasons:n};try{var a=tv(e,t);if(!a.hasOwnProperty("id"))return this.logger.log(em.ERROR,eO.IMPROPERLY_FORMATTED_EXPERIMENT,rM,t),n.push([eO.IMPROPERLY_FORMATTED_EXPERIMENT,rM,t]),{result:null,reasons:n};i=a.id}catch(e){return this.logger.log(em.ERROR,e.message),n.push(e.message),{result:null,reasons:n}}var s=o[i];if(!s)return this.logger.log(em.DEBUG,eb.USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT,rM,t,r),{result:null,reasons:n};var u=tE(e,s);return u?(this.logger.log(em.DEBUG,eb.USER_HAS_FORCED_VARIATION,rM,u,t,r),n.push([eb.USER_HAS_FORCED_VARIATION,rM,u,t,r])):this.logger.log(em.DEBUG,eb.USER_HAS_NO_FORCED_VARIATION_FOR_EXPERIMENT,rM,t,r),{result:u,reasons:n}},e.prototype.setForcedVariation=function(e,t,r,i){if(null!=i&&!rC(i))return this.logger.log(em.ERROR,eO.INVALID_VARIATION_KEY,rM),!1;try{var n,o=tv(e,t);if(!o.hasOwnProperty("id"))return this.logger.log(em.ERROR,eO.IMPROPERLY_FORMATTED_EXPERIMENT,rM,t),!1;n=o.id}catch(e){return this.logger.log(em.ERROR,e.message),!1}if(null==i)try{return this.removeForcedVariation(r,n,t),!0}catch(e){return this.logger.log(em.ERROR,e.message),!1}var a=ty(e,t,i);if(!a)return this.logger.log(em.ERROR,eO.NO_VARIATION_FOR_EXPERIMENT_KEY,rM,i,t),!1;try{return this.setInForcedVariationMap(r,n,a),!0}catch(e){return this.logger.log(em.ERROR,e.message),!1}},e.prototype.getVariationFromExperimentRule=function(e,t,r,i,n){void 0===n&&(n={});var o=[],a=this.findValidatedForcedDecision(e,i,t,r.key);o.push.apply(o,a.reasons);var s=a.result;if(s)return{result:s.key,reasons:o};var u=this.getVariation(e,r,i,n);return o.push.apply(o,u.reasons),{result:u.result,reasons:o}},e.prototype.getVariationFromDeliveryRule=function(e,t,r,i,n){var o,a,s=[],u=!1,l=r[i],c=this.findValidatedForcedDecision(e,n,t,l.key);s.push.apply(s,c.reasons);var d=c.result;if(d)return{result:d,reasons:s,skipToEveryoneElse:u};var p=n.getUserId(),f=n.getAttributes(),g=this.getBucketingId(p,f),h=i===r.length-1,E=h?"Everyone Else":i+1,y=null,v=this.checkIfUserIsInAudience(e,l,eD.RULE,n,E);return(s.push.apply(s,v.reasons),v.result)?(this.logger.log(em.DEBUG,eb.USER_MEETS_CONDITIONS_FOR_TARGETING_RULE,rM,p,E),s.push([eb.USER_MEETS_CONDITIONS_FOR_TARGETING_RULE,rM,p,E]),a=t4(this.buildBucketerParams(e,l,g,p)),s.push.apply(s,a.reasons),(o=a.result)&&(y=e.variationIdMap.hasOwnProperty(o)?e.variationIdMap[o]:null),y?(this.logger.log(em.DEBUG,eb.USER_BUCKET
2ED_INTO_TARGETING_RULE,rM,p,E),s.push([eb.USER_BUCKETED_INTO_TARGETING_RULE,rM,p,E])):h||(this.logger.log(em.DEBUG,eb.USER_NOT_BUCKETED_INTO_TARGETING_RULE,rM,p,E),s.push([eb.USER_NOT_BUCKETED_INTO_TARGETING_RULE,rM,p,E]),u=!0)):(this.logger.log(em.DEBUG,eb.USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE,rM,p,E),s.push([eb.USER_DOESNT_MEET_CONDITIONS_FOR_TARGETING_RULE,rM,p,E])),{result:y,reasons:s,skipToEveryoneElse:u}},e}(),rP="EVENT_TAG_UTILS";function rk(e,t){var r=e.revenue;if(null==r)return null;var i="string"==typeof r?parseInt(r):Math.trunc(r);return isFinite(i)?(t.log(em.INFO,eb.PARSED_REVENUE_VALUE,rP,i),i):(t.log(em.INFO,eb.FAILED_TO_PARSE_REVENUE,rP,r),null)}function rV(e,t){var r=e.value;if(null==r)return null;var i="string"==typeof r?parseFloat(r):r;return isFinite(i)?(t.log(em.INFO,eb.PARSED_NUMERIC_VALUE,rP,i),i):(t.log(em.INFO,eb.FAILED_TO_PARSE_VALUE,rP,r),null)}var rx="ATTRIBUTES_VALIDATOR";function rF(e,t){return"string"==typeof e&&("string"==typeof t||"boolean"==typeof t||en(t)&&ei(t))}var rK="custom",rG="https://logx.optimizely.com/v1/events",rj="POST";function rB(e){var t=e.attributes,r=e.userId,i=e.clientEngine,n=e.clientVersion,o=e.configObj,a=e.logger,s=!!o.anonymizeIP&&o.anonymizeIP,u=o.botFiltering,l={account_id:o.accountId,project_id:o.projectId,visitors:[{snapshots:[],visitor_id:r,attributes:[]}],revision:o.revision,client_name:i,client_version:n,anonymize_ip:s,enrich_decisions:!0};return t&&Object.keys(t||{}).forEach(function(e){var r=t[e];if(rF(e,r)){var i=tp(o,e,a);i&&l.visitors[0].attributes.push({entity_id:i,key:e,type:rK,value:r})}}),"boolean"==typeof u&&l.visitors[0].attributes.push({entity_id:eR.BOT_FILTERING,key:eR.BOT_FILTERING,type:rK,value:u}),l}function rz(e){var t,r;return null!=(r=null==(t=e.experiment)?void 0:t.key)?r:""}function rq(e){var t,r;return null!=(r=null==(t=e.variation)?void 0:t.key)?r:""}function rH(e){var t,r;return null!=(r=null==(t=e.variation)?void 0:t.featureEnabled)&&r}function rX(e){var t,r;return null!=(r=null==(t=e.experiment)?void 0:t.id)?r:null}function rW(e){var t,r;return null!=(r=null==(t=e.variation)?void 0:t.id)?r:null}var rY=ef("EVENT_BUILDER"),rJ=function(e){var t=e.configObj,r=e.decisionObj,i=e.userId,n=e.flagKey,o=e.enabled,a=e.userAttributes,s=e.clientEngine,u=e.clientVersion,l=r.decisionSource,c=rz(r),d=rX(r),p=rq(r),f=rW(r),g=null!==d?td(t,d):null;return{type:"impression",timestamp:er(),uuid:$(),user:{id:i,attributes:rQ(t,a)},context:{accountId:t.accountId,projectId:t.projectId,revision:t.revision,clientName:s,clientVersion:u,anonymizeIP:t.anonymizeIP||!1,botFiltering:t.botFiltering},layer:{id:g},experiment:{id:d,key:c},variation:{id:f,key:p},ruleKey:c,flagKey:n,ruleType:l,enabled:o}},r$=function(e){var t=e.configObj,r=e.userId,i=e.userAttributes,n=e.clientEngine,o=e.clientVersion,a=e.eventKey,s=e.eventTags,u=tf(t,a),l=s?rk(s,rY):null,c=s?rV(s,rY):null;return{type:"conversion",timestamp:er(),uuid:$(),user:{id:r,attributes:rQ(t,i)},context:{accountId:t.accountId,projectId:t.projectId,revision:t.revision,clientName:n,clientVersion:o,anonymizeIP:t.anonymizeIP||!1,botFiltering:t.botFiltering},event:{id:u,key:a},revenue:l,value:c,tags:s}};function rQ(e,t){var r=[];return t&&Object.keys(t||{}).forEach(function(i){var n=t[i];if(rF(i,n)){var o=tp(e,i,rY);o&&r.push({entityId:o,key:i,value:n})}}),r}var rZ="USER_PROFILE_SERVICE_VALIDATOR",r0="OPTIMIZELY",r1=function(){function e(e){var t,r=this,i=e.clientEngine;i||(e.logger.log(em.INFO,eb.INVALID_CLIENT_ENGINE,r0,i),i=eT),this.clientEngine=i,this.clientVersion=e.clientVersion||eA,this.errorHandler=e.errorHandler,this.isOptimizelyConfigValid=e.isValidInstance,this.logger=e.logger,this.odp
2Manager=e.odpManager;var n=null!=(t=e.defaultDecideOptions)?t:[];Array.isArray(n)||(this.logger.log(em.DEBUG,eb.INVALID_DEFAULT_DECIDE_OPTIONS,r0),n=[]);var o={};n.forEach(function(e){I[e]?o[e]=!0:r.logger.log(em.WARNING,eb.UNRECOGNIZED_DECIDE_OPTION,r0,e)}),this.defaultDecideOptions=o,this.projectConfigManager=new t3({datafile:e.datafile,jsonSchemaValidator:e.jsonSchemaValidator,sdkKey:e.sdkKey,datafileManager:e.datafileManager}),this.disposeOnUpdate=this.projectConfigManager.onUpdate(function(e){r.logger.log(em.INFO,eb.UPDATED_OPTIMIZELY_CONFIG,r0,e.revision,e.projectId),r.notificationCenter.sendNotifications(h.OPTIMIZELY_CONFIG_UPDATE),r.updateOdpSettings()});var a=this.projectConfigManager.onReady(),s=null;if(e.userProfileService)try{(function(e){if("object"==typeof e&&null!==e){if("function"!=typeof e.lookup)throw Error(et(eO.INVALID_USER_PROFILE_SERVICE,rZ,"Missing function 'lookup'"));if("function"!=typeof e.save)throw Error(et(eO.INVALID_USER_PROFILE_SERVICE,rZ,"Missing function 'save'"));return!0}throw Error(et(eO.INVALID_USER_PROFILE_SERVICE,rZ))})(e.userProfileService)&&(s=e.userProfileService,this.logger.log(em.INFO,eb.VALID_USER_PROFILE_SERVICE,r0))}catch(e){this.logger.log(em.WARNING,e.message)}this.decisionService=new rL({userProfileService:s,logger:this.logger,UNSTABLE_conditionEvaluators:e.UNSTABLE_conditionEvaluators}),this.notificationCenter=e.notificationCenter,this.eventProcessor=e.eventProcessor;var u=this.eventProcessor.start();this.readyPromise=Promise.all([a,u,e.odpManager?e.odpManager.onReady():Promise.resolve()]).then(function(e){return e[0]}),this.readyTimeouts={},this.nextReadyTimeoutId=0}return e.prototype.getProjectConfig=function(){return this.projectConfigManager.getConfig()},e.prototype.isValidInstance=function(){return this.isOptimizelyConfigValid&&!!this.projectConfigManager.getConfig()},e.prototype.activate=function(e,t,r){try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"activate"),null;if(!this.validateInputs({experiment_key:e,user_id:t},r))return this.notActivatingExperiment(e,t);var i=this.projectConfigManager.getConfig();if(!i)return null;try{var n=this.getVariation(e,t,r);if(null===n)return this.notActivatingExperiment(e,t);if(tg(i,e)!==to)return this.logger.log(em.DEBUG,eb.SHOULD_NOT_DISPATCH_ACTIVATE,r0,e),n;var o=tv(i,e),a=o.variationKeyMap[n],s={experiment:o,variation:a,decisionSource:ew.EXPERIMENT};return this.sendImpressionEvent(s,"",t,!0,r),n}catch(r){return this.logger.log(em.ERROR,r.message),this.logger.log(em.INFO,eb.NOT_ACTIVATING_USER,r0,t,e),this.errorHandler.handleError(r),null}}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.sendImpressionEvent=function(e,t,r,i,n){var o=this.projectConfigManager.getConfig();if(o){var a=rJ({decisionObj:e,flagKey:t,enabled:i,userId:r,userAttributes:n,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:o});this.eventProcessor.process(a),this.emitNotificationCenterActivate(e,t,r,i,n)}},e.prototype.emitNotificationCenterActivate=function(e,t,r,i,n){var o,a,s=this.projectConfigManager.getConfig();if(s){var u,l,c,d,p,f,g,E,y,v,_,I,m=e.decisionSource,O=rz(e),b=rX(e),R=rq(e),N=rW(e);null!==b&&""!==R&&(o=s.experimentIdMap[b]);var T=(l=rB(u={attributes:n,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:s,experimentId:b,ruleKey:O,flagKey:t,ruleType:m,userId:r,enabled:i,variationId:N,logger:this.logger}),c=u.configObj,d=u.experimentId,p=u.variationId,f=u.ruleKey,g=u.ruleType,E=u.flagKey,y=u.enabled,v=d?td(c,d):null,_=p?tE(c,p):null,I={decisions:[{campaign_id:v,experiment_id:d,variation_id:p,metadata:{flag_key:E,rule_key:f,rule_type:g,variation_key:_=_||"",enabled:y}}],events:[{entity_id:v,timestamp:er(),key:"campaign_activated",uuid:$()}]},l.visitors[0].snapshots.push(I),{httpVerb:rj,url:rG,params:l});o&&o.variationKeyMap&&""!==R&&(a=o.variationKeyMap[R]),this.notificationCenter.sendNotifications(h.ACTIVATE,{experiment:o,userId:r,attributes:n,variation:a,logEvent:T})}},e.prototype.track=function(e,t,r,i){try{if(!this.isValidInstance())return void this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"track");if(!this.validateInputs({user_id:t,event_key:e},r,i))return;var n=this.projectConfigManager.getConfig();if(!n)return;if(!n.eventKeyMap.hasOwnProperty(e)){this.logger.log(em.WARNING,eb.EVENT_KEY_NOT_FOUND,r0,e),this.logger.log(em.WARNING,eb.NOT_TRACKING_USER,r0,t);return}i=this.filterEmptyValues(i);
2var o=r$({eventKey:e,eventTags:i,userId:t,userAttributes:r,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:n});this.logger.log(em.INFO,eb.TRACK_EVENT,r0,e,t),this.eventProcessor.process(o),this.emitNotificationCenterTrack(e,t,r,i)}catch(e){this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),this.logger.log(em.ERROR,eb.NOT_TRACKING_USER,r0,t)}},e.prototype.emitNotificationCenterTrack=function(e,t,r,i){try{var n,o,a,s=this.projectConfigManager.getConfig();if(!s)return;var u=(n={attributes:r,clientEngine:this.clientEngine,clientVersion:this.clientVersion,configObj:s,eventKey:e,eventTags:i,logger:this.logger,userId:t},o=rB(n),a=function(e,t,r,i){var n={events:[]},o={entity_id:tf(e,t),timestamp:er(),uuid:$(),key:t};if(i){var a=rk(i,r);null!==a&&(o.revenue=a);var s=rV(i,r);null!==s&&(o.value=s),o.tags=i}return n.events.push(o),n}(n.configObj,n.eventKey,n.logger,n.eventTags),o.visitors[0].snapshots=[a],{httpVerb:rj,url:rG,params:o});this.notificationCenter.sendNotifications(h.TRACK,{eventKey:e,userId:t,attributes:r,eventTags:i,logEvent:u})}catch(e){this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e)}},e.prototype.getVariation=function(e,t,r){try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"getVariation"),null;try{if(!this.validateInputs({experiment_key:e,user_id:t},r))return null;var i,n=this.projectConfigManager.getConfig();if(!n)return null;var o=n.experimentKeyMap[e];if(!o||o.isRollout)return this.logger.log(em.DEBUG,eO.INVALID_EXPERIMENT_KEY,r0,e),null;var a=this.decisionService.getVariation(n,o,this.createInternalUserContext(t,r)).result,s=(i=o.id,n.experimentFeatureMap.hasOwnProperty(i))?eS.FEATURE_TEST:eS.AB_TEST;return this.notificationCenter.sendNotifications(h.DECISION,{type:s,userId:t,attributes:r||{},decisionInfo:{experimentKey:e,variationKey:a}}),a}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.setForcedVariation=function(e,t,r){if(!this.validateInputs({experiment_key:e,user_id:t}))return!1;var i=this.projectConfigManager.getConfig();if(!i)return!1;try{return this.decisionService.setForcedVariation(i,e,t,r)}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),!1}},e.prototype.getForcedVariation=function(e,t){if(!this.validateInputs({experiment_key:e,user_id:t}))return null;var r=this.projectConfigManager.getConfig();if(!r)return null;try{return this.decisionService.getForcedVariation(r,e,t).result}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.validateInputs=function(e,t,r){try{if(e.hasOwnProperty("user_id")){var i=e.user_id;if("string"!=typeof i||null===i||"undefined"===i)throw Error(et(eO.INVALID_INPUT_FORMAT,r0,"user_id"));delete e.user_id}return Object.keys(e).forEach(function(t){if(!rC(e[t]))throw Error(et(eO.INVALID_INPUT_FORMAT,r0,t))}),t&&function(e){if("object"==typeof e&&!Array.isArray(e)&&null!==e)return Object.keys(e).forEach(function(t){if(void 0===e[t])throw Error(et(eO.UNDEFINED_ATTRIBUTE,rx,t))});throw Error(et(eO.INVALID_ATTRIBUTES,rx))}(t),r&&function(e){if("object"!=typeof e||Array.isArray(e)||null===e)throw Error(et(eO.INVALID_EVENT_TAGS,"EVENT_TAGS_VALIDATOR"))}(r),!0}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),!1}},e.prototype.notActivatingExperiment=function(e,t){return this.logger.log(em.INFO,eb.NOT_ACTIVATING_USER,r0,t,e),null},e.prototype.filterEmptyValues=function(e){for(var t in e)e.hasOwnProperty(t)&&(null===e[t]||void 0===e[t])&&delete e[t];return e},e.prototype.isFeatureEnabled=function(e,t,r){try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"isFeatureEnabled"),!1;if(!this.validateInputs({feature_key:e,user_id:t},r))return!1;var i=this.projectConfigManager.getConfig();if(!i)return!1;var n=tO(i,e,this.logger);if(!n)return!1;var o={},a=this.createInternalUserContext(t,r),s=this.decisionService.getVariationForFeature
2(i,n,a).result,u=s.decisionSource,l=rz(s),c=rq(s),d=rH(s);u===ew.FEATURE_TEST&&(o={experimentKey:l,variationKey:c}),(u===ew.FEATURE_TEST||u===ew.ROLLOUT&&tS(i))&&this.sendImpressionEvent(s,n.key,t,d,r),!0===d?this.logger.log(em.INFO,eb.FEATURE_ENABLED_FOR_USER,r0,e,t):(this.logger.log(em.INFO,eb.FEATURE_NOT_ENABLED_FOR_USER,r0,e,t),d=!1);var p={featureKey:e,featureEnabled:d,source:s.decisionSource,sourceInfo:o};return this.notificationCenter.sendNotifications(h.DECISION,{type:eS.FEATURE,userId:t,attributes:r||{},decisionInfo:p}),d}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),!1}},e.prototype.getEnabledFeatures=function(e,t){var r=this;try{var i=[];if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"getEnabledFeatures"),i;if(!this.validateInputs({user_id:e}))return i;var n=this.projectConfigManager.getConfig();if(!n)return i;return Z(n.featureKeyMap).forEach(function(n){r.isFeatureEnabled(n.key,e,t)&&i.push(n.key)}),i}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),[]}},e.prototype.getFeatureVariable=function(e,t,r,i){try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"getFeatureVariable"),null;return this.getFeatureVariableForType(e,t,null,r,i)}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableForType=function(e,t,r,i,n){if(!this.validateInputs({feature_key:e,variable_key:t,user_id:i},n))return null;var o=this.projectConfigManager.getConfig();if(!o)return null;var a=tO(o,e,this.logger);if(!a)return null;var s=tb(o,e,t,this.logger);if(!s)return null;if(r&&s.type!==r)return this.logger.log(em.WARNING,eb.VARIABLE_REQUESTED_WITH_WRONG_TYPE,r0,r,s.type),null;var u=this.createInternalUserContext(i,n),l=this.decisionService.getVariationForFeature(o,a,u).result,c=rH(l),d=this.getFeatureVariableValueFromVariation(e,c,l.variation,s,i),p={};return l.decisionSource===ew.FEATURE_TEST&&null!==l.experiment&&null!==l.variation&&(p={experimentKey:l.experiment.key,variationKey:l.variation.key}),this.notificationCenter.sendNotifications(h.DECISION,{type:eS.FEATURE_VARIABLE,userId:i,attributes:n||{},decisionInfo:{featureKey:e,featureEnabled:c,source:l.decisionSource,variableKey:t,variableValue:d,variableType:s.type,sourceInfo:p}}),d},e.prototype.getFeatureVariableValueFromVariation=function(e,t,r,i,n){var o=this.projectConfigManager.getConfig();if(!o)return null;var a=i.defaultValue;if(null!==r){var s=tR(o,i,r,this.logger);null!==s?t?(a=s,this.logger.log(em.INFO,eb.USER_RECEIVED_VARIABLE_VALUE,r0,a,i.key,e)):this.logger.log(em.INFO,eb.FEATURE_NOT_ENABLED_RETURN_DEFAULT_VARIABLE_VALUE,r0,e,n,a):this.logger.log(em.INFO,eb.VARIABLE_NOT_USED_RETURN_DEFAULT_VARIABLE_VALUE,r0,i.key,r.key)}else this.logger.log(em.INFO,eb.USER_RECEIVED_DEFAULT_VARIABLE_VALUE,r0,n,i.key,e);return tN(a,i.type,this.logger)},e.prototype.getFeatureVariableBoolean=function(e,t,r,i){try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"getFeatureVariableBoolean"),null;return this.getFeatureVariableForType(e,t,eU.BOOLEAN,r,i)}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableDouble=function(e,t,r,i){try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"getFeatureVariableDouble"),null;return this.getFeatureVariableForType(e,t,eU.DOUBLE,r,i)}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableInteger=function(e,t,r,i){try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"getFeatureVariableInteger"),null;return this.getFeatureVariableForType(e,t,eU.INTEGER,r,i)}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableString=function(e,t,r,i){try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"getFeatureVariableString"),null;return this.getFeatureVariableForType(e,t,eU.STRING,r,i)}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getFeatureVariableJSON=function(e,t,r,i){try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"getFeatureVariableJSON"),null;return this.getFeatureVariableForType(e,t,eU.JSON,r,i)}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getAllFeatureVariables=function(e,t,r){var i=this;try{if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"getAllFeatureVariables"),null;if(!this.validateInputs({feature_key:e,user_id:t},r))return null;var n=this.projectConfigManager.getConfig();if(!n)return null;var o=tO(n,e,this.logger);if(!o)return null;var a=this.createInternalUserContext(t,r),s=this.decisionService.getVariationForFeature
2(n,o,a).result,u=rH(s),l={};o.variables.forEach(function(r){l[r.key]=i.getFeatureVariableValueFromVariation(e,u,s.variation,r,t)});var c={};return s.decisionSource===ew.FEATURE_TEST&&null!==s.experiment&&null!==s.variation&&(c={experimentKey:s.experiment.key,variationKey:s.variation.key}),this.notificationCenter.sendNotifications(h.DECISION,{type:eS.ALL_FEATURE_VARIABLES,userId:t,attributes:r||{},decisionInfo:{featureKey:e,featureEnabled:u,source:s.decisionSource,variableValues:l,sourceInfo:c}}),l}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.getOptimizelyConfig=function(){try{if(!this.projectConfigManager.getConfig())return null;return this.projectConfigManager.getOptimizelyConfig()}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),null}},e.prototype.close=function(){var e,t=this;try{this.odpManager&&this.odpManager.stop(),this.notificationCenter.clearAllNotificationListeners();var r=null==(e=this.projectConfigManager.getConfig())?void 0:e.sdkKey;r&&e7.removeNotificationCenter(r);var i=this.eventProcessor.stop();return this.disposeOnUpdate&&(this.disposeOnUpdate(),this.disposeOnUpdate=null),this.projectConfigManager&&this.projectConfigManager.stop(),Object.keys(this.readyTimeouts).forEach(function(e){var r=t.readyTimeouts[e];clearTimeout(r.readyTimeout),r.onClose()}),this.readyTimeouts={},i.then(function(){return{success:!0}},function(e){return{success:!1,reason:String(e)}})}catch(e){return this.logger.log(em.ERROR,e.message),this.errorHandler.handleError(e),Promise.resolve({success:!1,reason:String(e)})}},e.prototype.onReady=function(e){var t,r,i=this;"object"==typeof e&&null!==e&&void 0!==e.timeout&&(t=e.timeout),ei(t)||(t=3e4);var n=new Promise(function(e){r=e}),o=this.nextReadyTimeoutId;this.nextReadyTimeoutId++;var a=setTimeout(function(){delete i.readyTimeouts[o],r({success:!1,reason:et("onReady timeout expired after %s ms",t)})},t);return this.readyTimeouts[o]={readyTimeout:a,onClose:function(){r({success:!1,reason:"Instance closed"})}},this.readyPromise.then(function(){clearTimeout(a),delete i.readyTimeouts[o],r({success:!0})}),Promise.race([this.readyPromise,n])},e.prototype.createUserContext=function(e,t){var r,i=null!=e?e:null==(r=this.odpManager)?void 0:r.getVuid();return void 0!==i&&this.validateInputs({user_id:i},t)?new tQ({optimizely:this,userId:i,attributes:t,shouldIdentifyUser:!0}):null},e.prototype.createInternalUserContext=function(e,t){return new tQ({optimizely:this,userId:e,attributes:t,shouldIdentifyUser:!1})},e.prototype.decide=function(e,t,r){var i,n,o,a,s,u=this;void 0===r&&(r=[]);var l=e.getUserId(),c=e.getAttributes(),d=this.projectConfigManager.getConfig(),p=[];if(!this.isValidInstance()||!d)return this.logger.log(em.INFO,eb.INVALID_OBJECT,r0,"decide"),t$(t,e,[eM.SDK_NOT_READY]);var f=d.featureKeyMap[t];if(!f)return this.logger.log(em.ERROR,eO.FEATURE_NOT_IN_DATAFILE,r0,t),t$(t,e,[et(eM.FLAG_KEY_INVALID,t)]);var g=this.getAllDecideOptions(r),E=this.decisionService.findValidatedForcedDecision(d,e,t);p.push.apply(p,E.reasons);var y=E.result;if(y)s={experiment:null,variation:y,decisionSource:ew.FEATURE_TEST};else{var v=this.decisionService.getVariationForFeature(d,f,e,g);p.push.apply(p,v.reasons),s=v.result}var _=s.decisionSource,m=null!=(n=null==(i=s.experiment)?void 0:i.key)?n:null,O=null!=(a=null==(o=s.variation)?void 0:o.key)?a:null,b=rH(s);!0===b?this.logger.log(em.INFO,eb.FEATURE_ENABLED_FOR_USER,r0,t,l):this.logger.log(em.INFO,eb.FEATURE_NOT_ENABLED_FOR_USER,r0,t,l);var R={},N=!1;
2g[I.EXCLUDE_VARIABLES]||f.variables.forEach(function(e){R[e.key]=u.getFeatureVariableValueFromVariation(t,b,s.variation,e,l)}),!g[I.DISABLE_DECISION_EVENT]&&(_===ew.FEATURE_TEST||_===ew.ROLLOUT&&tS(d))&&(this.sendImpressionEvent(s,t,l,b,c),N=!0);var T=g[I.INCLUDE_REASONS],A=[];T&&(A=p.map(function(e){return et.apply(void 0,X([e[0]],e.slice(1),!1))}));var S={flagKey:t,enabled:b,variationKey:O,ruleKey:m,variables:R,reasons:A,decisionEventDispatched:N};return this.notificationCenter.sendNotifications(h.DECISION,{type:eS.FLAG,userId:l,attributes:c,decisionInfo:S}),{variationKey:O,enabled:b,variables:R,ruleKey:m,flagKey:t,userContext:e,reasons:A}},e.prototype.getAllDecideOptions=function(e){var t=this,r=z({},this.defaultDecideOptions);return Array.isArray(e)?e.forEach(function(e){I[e]?r[e]=!0:t.logger.log(em.WARNING,eb.UNRECOGNIZED_DECIDE_OPTION,r0,e)}):this.logger.log(em.DEBUG,eb.INVALID_DECIDE_OPTIONS,r0),r},e.prototype.decideForKeys=function(e,t,r){var i=this;void 0===r&&(r=[]);var n={};if(!this.isValidInstance())return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"decideForKeys"),n;if(0===t.length)return n;var o=this.getAllDecideOptions(r);return t.forEach(function(t){var a=i.decide(e,t,r);(!o[I.ENABLED_FLAGS_ONLY]||a.enabled)&&(n[t]=a)}),n},e.prototype.decideAll=function(e,t){void 0===t&&(t=[]);var r=this.projectConfigManager.getConfig();if(!this.isValidInstance()||!r)return this.logger.log(em.ERROR,eb.INVALID_OBJECT,r0,"decideAll"),{};var i=Object.keys(r.featureKeyMap);return this.decideForKeys(e,i,t)}
2,e.prototype.updateOdpSettings=function(){var e=this.projectConfigManager.getConfig();e&&this.odpManager&&this.odpManager.updateSettings(e.odpIntegrationConfig)},e.prototype.sendOdpEvent=function(e,t,r,i){if(!this.odpManager)return void this.logger.error(eO.ODP_EVENT_FAILED_ODP_MANAGER_MISSING);var n=null!=t?t:eP,o=new Map(r);if(r&&r.size>0)try{r.forEach(function(e,t){(eL===t.toLowerCase()||E.FS_USER_ID===t.toLowerCase())&&(o.delete(t),o.set(E.FS_USER_ID,e))})}catch(e){this.logger.warn(eb.ODP_SEND_EVENT_IDENTIFIER_CONVERSION_FAILED)}try{var a=new tV(n,e,o,i);this.odpManager.sendEvent(a)}catch(e){this.logger.error(eO.ODP_EVENT_FAILED,e)}},e.prototype.isOdpIntegrated=function(){var e,t,r;return null!=(r=null==(t=null==(e=this.projectConfigManager.getConfig())?void 0:e.odpIntegrationConfig)?void 0:t.integrated)&&r},e.prototype.identifyUser=function(e){this.odpManager&&this.isOdpIntegrated()&&this.odpManager.identifyUser(e)},e.prototype.fetchQualifiedSegments=function(e,t){return q(this,void 0,void 0,function(){return H(this,function(r){switch(r.label){case 0:if(!this.odpManager)return[2,null];return[4,this.odpManager.fetchQualifiedSegments(e,t)];case 1:return[2,r.sent()]}})})},e.prototype.getVuid=function(){var e;if(!this.odpManager){null==(e=this.logger)||e.error("Unable to get VUID - ODP Manager is not instantiated yet.");return}
2return this.odpManager.isVuidEnabled()?this.odpManager.getVuid():void this.logger.log(em.WARNING,"getVuid() unavailable for this platform",r0)},e}(),r2={parseUserAgentInfo:function(){var e=new K.UAParser().getResult();return{os:e.os,device:e.device}}},r5=Object.freeze({__proto__:null,get LogLevel(){return g},getLogger:ef,setLogHandler:eg,LOG_LEVEL:em,createLogger:e0}),r3=ef();eg(e0()),eh(g.INFO);var r6=!1,r4=function(e){var t;try{var r,i,n,o=!1;e.errorHandler&&(W=e.errorHandler),e.logger&&(eg(e.logger),eh(g.NOTSET)),void 0!==e.logLevel&&eh(e.logLevel);try{eW(e),o=!0}catch(e){r3.error(e)}var a=void 0;null==e.eventDispatcher?(a=new eG({eventDispatcher:e$}),r6||(a.sendPendingEvents(),r6=!0)):a=e.eventDispatcher;var s=e.closingEventDispatcher;!e.eventDispatcher&&!s&&window.navigator&&"sendBeacon"in window.navigator&&(s=eQ);var u=e.eventBatchSize,l=e.eventFlushInterval;r=e.eventBatchSize,"number"==typeof r&&ei(r)&&r>=1||(r3.warn("Invalid eventBatchSize %s, defaulting to %s",e.eventBatchSize,10),u=10),i=e.eventFlushInterval,"number"==typeof i&&ei(i)&&i>0||(r3.warn("Invalid eventFlushInterval %s, defaulting to %s",e.eventFlushInterval,1e3),l=1e3);var c=W,d=(n={logger:r3,errorHandler:c},new e2(n)),p={dispatcher:a,closingDispatcher:s,flushInterval:l,batchSize:u,maxQueueSize:e.eventMaxQueueSize||1e4,notificationCenter:d},f=(null==(t=e.odpOptions)?void 0:t.disabled)===!0;f&&r3.info(eb.ODP_DISABLED);var h=e.clientEngine,E=e.clientVersion,y=z(z({clientEngine:eN},e),{eventProcessor:e5(p),logger:r3,errorHandler:c,datafileManager:e.sdkKey?function(e,t,r,i){var n={sdkKey:e};if((void 0===i||"object"==typeof i&&null!==i)&&Y(n,i),r){var o=tA({datafile:r,jsonSchemaValidator:void 0,logger:t}),a=o.configObj,s=o.error;s&&t.error(s),a&&(n.datafile=tT(a))}return new ti(n)}(e.sdkKey,r3,e.datafile,e.datafileOptions):void 0,notificationCenter:d,isValidInstance:o,odpManager:f?void 0:tJ.createInstance({logger:r3,odpOptions:e.odpOptions,clientEngine:h,clientVersion:E})}),v=new r1(y);try{if("function"==typeof window.addEventListener){var _="onpagehide"in window?"pagehide":"unload";window.addEventListener(_,function(){v.close()},!1)}}catch(e){r3.error(eb.UNABLE_TO_ATTACH_UNLOAD,"INDEX_BROWSER",e.message)}return v}catch(e){return r3.error(e),null}};z(z({},r5),{logging:e1,errorHandler:{handleError:function(){}},eventDispatcher:e$,sendBeaconEventDispatcher:eQ,enums:ek,setLogger:eg,setLogLevel:eh,createInstance:r4,__internalResetRetryState:function(){r6=!1},OptimizelyDecideOption:I,getUserAgentParser:function(){return r2}}),e.s(["OptimizelyDecideOption",0,I,"createInstance",0,r4,"enums",0,ek,"getLogger",0,ef],777156),e.i(705927);try{var r9="u">typeof window?window:e.g;r9._sentryModuleMetadata=r9._sentryModuleMetadata||{},r9._sentryModuleMetadata[(new r9.Error).stack]=Object.assign({},r9._sentryModuleMetadata[(new r9.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}var r8=(0,A.createContext)({optimizely:null,isServerSide:!1,timeout:0});r8.Consumer;var r7=r8.Provider,ie=function(e,t){return(ie=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},it=function(){return(it=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}).apply(this,arguments)};function ir(e,t,r,i){return new(r||(r=Promise))(function(n,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(a,s)}u((i=i.apply(e,t||[])).next())})}function ii(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){var l=[s,u];if(r)throw TypeError("Generator is already executing.");for(;o&&(o=0,l[0]&&(a=0)),a;)try{if(r=1,i&&(n=2&l[0]?i.return:l[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,l[1])).done)return n;switch(i=0,n&&(l=[2&l[0],n.value]),l[0]){case 0:case 1:n=l;break;case 4:return a.label++,{value:l[1],done:!1};case 5:a.label++,i=l[1],l=[0];continue;case 7:l=a.ops.pop(),a.trys.pop();continue;default:if(!(n=(n=a.trys).length>0&&n[n.length-1])&&(6===l[0]||2===l[0])){a=0;continue}if(3===l[0]&&(!n||l[1]>n[0]&&l[1]<n[3])){a.label=l[1];break}if(6===l[0]&&a.label<n[1]){a.label=n[1],n=l;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(l);break}n[2]&&a.ops.pop(),a.trys.pop();continue}l=t.call(e,a)}catch(e){l=[6,e],i=0}finally{r=n=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}function io(e,t,r){if(r||2==arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}function ia(e,t){if(e.id!==t.id)return!1;var r=e.attributes||{},i=t.attributes||{},n=Object.keys(r),o=Object.keys(i);if(n.length!==o.length)return!1;for(var a=0;a<n.length;a++){var s=n[a];if(r[s]!==i[s])return!1}return!0}function is(e,t,r){return{enabled:!1,flagKey:e,ruleKey:null,variationKey:null,variables:{},reasons:[t],userContext:{id:r.id,attributes:r.attributes}}}function iu(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var i=0;return e.replace(/%s/g,function(){var e=t[i++],r=typeof e;return"function"===r?e():"string"===r?e:String(e)})}"function"==typeof SuppressedError&&SuppressedError;var il=(function(){function e(){this.observers=[]}return e.getInstance=function(){return e.instance||(e.instance=new e),e.instance},e.prototype.subscribe=function(e,t){var r=this,i="key-".concat(Math.floor(1e5+999999*Math.random()));return this.observers.push({subscriptionId:i,key:e,callback:t}),function(){var e=r.observers.findIndex(function(e){return e.subscriptionId===i});e>=0&&r.observers.splice(e,1)}},e.prototype.notify=function(e){this.observers.filter(function(t){return t.key===e}
2).forEach(function(e){return e.callback()})},e})().getInstance(),ic=ef("ReactSDK"),id=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ic.log(ek.LOG_LEVEL.WARNING,iu.apply(void 0,io([e],t,!1)))},ip=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ic.log(ek.LOG_LEVEL.INFO,iu.apply(void 0,io([e],t,!1)))},ig=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];return ic.log(ek.LOG_LEVEL.ERROR,iu.apply(void 0,io([e],t,!1)))};(p=b||(b={})).TIMEOUT="TIMEOUT",p.NO_CLIENT="NO_CLIENT",p.USER_NOT_READY="USER_NOT_READY";var ih={id:null,attributes:{}},iE=function(){function e(e){var t=this;this.userContext=null,this.onUserUpdateHandlers=[],this.isUserPromiseResolved=!1,this.isUserReady=!1,this.onForcedVariationsUpdateHandlers=[],this.forcedDecisionFlagKeys=new Set,this.isClientReady=!1,this.clientAndUserReadyPromiseFulfilled=!1,this.isUsingSdkKey=!1,this.user=it({},ih),this.initialConfig=e;var r=it(it({},e),{clientEngine:"react-sdk",clientVersion:"3.4.0"});this.userPromiseResolver=function(){};var i=new Promise(function(e){t.userPromiseResolver=e});if(this._client=r4(r),this.isClientReady=!!this.getOptimizelyConfig(),this.isUsingSdkKey=!!r.sdkKey,this._client){var n=this._client.onReady();this.clientAndUserReadyPromise=Promise.all([i,n]).then(function(e){var r=e[0];t.isClientReady=e[1].success,t.isUserReady=r.success;var i=t.isReady();return t.clientAndUserReadyPromiseFulfilled=!0,{success:i,message:i?"Client and user are both ready.":"Client or user did not become ready."}})}else id("Unable to resolve datafile and user information because Optimizely client failed to initialize."),this.clientAndUserReadyPromise=new Promise(function(e){e({success:!1,reason:b.NO_CLIENT,message:"Optimizely client failed to initialize."})})}return e.prototype.getUserWithOverrides=function(e,t){return{id:void 0===e?this.user.id:e,attributes:void 0===t?this.user.attributes:t}},e.prototype.getIsReadyPromiseFulfilled=function(){return this.clientAndUserReadyPromiseFulfilled},e.prototype.getIsUsingSdkKey=function(){return this.isUsingSdkKey},Object.defineProperty(e.prototype,"odpExplicitlyOff",{get:function(){var e;return null==(e=this.initialConfig.odpOptions)?void 0:e.disabled},enumerable:!1,configurable:!0}),e.prototype.onReady=function(e){var t,r=this;void 0===e&&(e={});var i=5e3;e&&void 0!==e.timeout&&(i=e.timeout);var n=new Promise(function(e){t=setTimeout(function(){e({success:!1,reason:b.TIMEOUT,message:"Failed to initialize before timeout",dataReadyPromise:r.clientAndUserReadyPromise})},i)});return Promise.race([this.clientAndUserReadyPromise,n]).then(function(e){return ir(r,void 0,void 0,function(){return ii(this,function(r){return clearTimeout(t),[2,e]})})})},e.prototype.getUserContext=function(){return this._client?this.userContext?this.userContext:(id("Unable to get user context. User context not set."),null):(id("Unable to get user context. Optimizely client not initialized."),null)},e.prototype.setCurrentUserContext=function(e){if(!this._client)return void id("Unable to set user context for user ID ".concat(e.id,". Optimizely client not initialized."));if(!this.userContext){this.userContext=this._client.createUserContext(e.id||void 0,e.attributes);return}ia(e,{id:this.userContext.getUserId(),attributes:this.userContext.getAttributes()})||(this.userContext=this._client.createUserContext(e.id||void 0,e.attributes))},e.prototype.makeUserContextInstance=function(e){return this._client?this.userContext&&ia(e,this.user)?this.userContext:this._client.createUserContext(e.id||void 0,e.attributes):(id("Unable to create user context for ".concat(e.id,". Optimizely client failed to initialize or not ready.")),null)},e.prototype.fetchQualifiedSegments=function(e){return ir(this,void 0,void 0,function(){var t;return ii(this,function(r){switch(r.label){case 0:if(!this.userContext)return[2,!1];if(this.odpExplicitlyOff||!(null==(t=this._client)?void 0:t.isOdpIntegrated()))return[2,!0];return[4,this.userContext.fetchQualifiedSegments(e)];case 1:return[2,r.sent()]}})})},e.prototype.setUser=function(e,t){return ir(this,void 0,void 0,function(){var r,i,n,o,a,s=this;return ii(this,function(u){switch(u.label){case 0:if(null===e.id&&this.odpExplicitlyOff)return[2];if(this.user={id:e.id||ih.id,attributes:e.attributes||ih.attributes},e.id!==ih.id)return[3,2];return[4,null==(i=this._client)?void 0:i.onReady()];case 1:return u.sent(),this.setCurrentUserContext(e),this.user.id=(null==(n=this.userContext)?void 0:n.getUserId())||ih.id,[3,4];case 2:return this.setCurrentUserContext(e),this.userContext&&!this.odpExplicitlyOff&&(null==(o=this._client)?void 0:o.isOdpIntegrated())&&void 0!==t&&(this.userContext.qualifiedSegments=t),[4,null==(a=this._client)?void 0:a.onReady()];case 3:u.sent(),u.label=4;case 4:return[4,this.fetchQualifiedSegments()];case 5:return r=u.sent(),this.isUserPromiseResolved||(this.userPromiseResolver({success:r}),this.isUserPromiseResolved=!0),this.onUserUpdateHandlers.forEac
2h(function(e){return e(s.user)}),[2]}})})},e.prototype.onUserUpdate=function(e){var t=this;return this.onUserUpdateHandlers.push(e),function(){var r=t.onUserUpdateHandlers.indexOf(e);r>-1&&t.onUserUpdateHandlers.splice(r,1)}},e.prototype.onForcedVariationsUpdate=function(e){var t=this;return this.onForcedVariationsUpdateHandlers.push(e),function(){var r=t.onForcedVariationsUpdateHandlers.indexOf(e);r>-1&&t.onForcedVariationsUpdateHandlers.splice(r,1)}},e.prototype.isReady=function(){return this.isClientReady&&this.isUserReady},e.prototype.activate=function(e,t,r){if(!this._client)return id('Unable to activate experiment "%s" because Optimizely client failed to initialize.',e),null;var i=this.getUserWithOverrides(t,r);return null===i.id?(ip('Unable to activate experiment "%s" because User ID is not set',e),null):this._client.activate(e,i.id,i.attributes)},e.prototype.decide=function(e,t,r,i){if(void 0===t&&(t=[]),!this._client)return id('Unable to evaluate feature "%s" because Optimizely client failed to initialize.',e),is(e,"Unable to evaluate flag ".concat(e," because Optimizely client failed to initialize."),this.user);var n=this.getUserWithOverrides(r,i);if(null===n.id)return ip('Unable to evaluate feature "%s" because User ID is not set.',e),is(e,"Unable to evaluate flag ".concat(e," because User ID is not set."),n);var o=this.makeUserContextInstance(n);return o?it(it({},o.decide(e,t)),{userContext:{id:n.id,attributes:n.attributes}}):is(e,"Not Evaluating flag ".concat(e," because user id or attributes are not valid"),n)},e.prototype.decideForKeys=function(e,t,r,i){if(void 0===t&&(t=[]),!this._client)return id("Unable to evaluate features for keys because Optimizely client failed to initialize."),{};var n=this.getUserWithOverrides(r,i);if(null===n.id)return ip("Unable to evaluate features for keys because User ID is not set"),{};var o=this.makeUserContextInstance(n);return o?Object.entries(o.decideForKeys(e,t)).reduce(function(e,t){var r=t[0],i=t[1];return e[r]=it(it({},i),{userContext:{id:n.id||"",attributes:n.attributes}}),e},{}):{}},e.prototype.decideAll=function(e,t,r){if(void 0===e&&(e=[]),!this._client)return id("Unable to evaluate all feature decisions because Optimizely client is not initialized."),{};var i=this.getUserWithOverrides(t,r);if(null===i.id)return ip("Unable to evaluate all feature decisions because User ID is not set"),{};var n=this.makeUserContextInstance(i);return n?Object.entries(n.decideAll(e)).reduce(function(e,t){var r=t[0],n=t[1];return e[r]=it(it({},n),{userContext:{id:i.id||"",attributes:i.attributes}}),e},{}):{}},e.prototype.getVariation=function(e,t,r){if(!this._client)return id('Unable to get variation for experiment "%s" because Optimizely client failed to initialize.',e),null;var i=this.getUserWithOverrides(t,r);return null===i.id?(ip('Unable to get variation for experiment "%s" because User ID is not set',e),null):this._client.getVariation(e,i.id,i.attributes)},e.prototype.track=function(e,t,r,i){if(!this._client)return void id('Unable to send tracking event "%s" because Optimizely client failed to initialize.',e);void 0!==t&&"string"!=typeof t&&(i=t,t=void 0);var n=this.getUserWithOverrides(t,r);null===n.id?ip('Unable to send tracking event "%s" because User ID is not set',e):this._client.track(e,n.id,n.attributes,i)},e.prototype.setForcedDecision=function(e,t){this.userContext?this.userContext.setForcedDecision(e,t)&&(this.forcedDecisionFlagKeys.add(e.flagKey),il.notify(e.flagKey)):id("Unable to set a forced decision because the user context has not been set yet.")},e.prototype.getForcedDecision=function(e){return this.userContext?this.userContext.getForcedDecision(e):(id("Unable to get a forced decision because the user context has not been set yet."),null)},e.prototype.removeForcedDecision=function(e){if(!this.userContext)return id("Unable to remove forced decisions because the user context has not been set yet."),!1;var t=this.userContext.removeForcedDecision(e);return t&&(this.forcedDecisionFlagKeys.delete(e.flagKey),il.notify(e.flagKey)),t},e.prototype.removeAllForcedDecisions=function(){if(!this.userContext)return id("Unable to remove all forced decisions because the user context has not been set yet."),!1;var e=this.userContext.removeAllForcedDecisions();return e&&(this.forcedDecisionFlagKeys.forEach(function(e){return il.notify(e)}),this.forcedDecisionFlagKeys.clear()),e},e.prototype.isFeatureEnabled=function(e,t,r){if(!this._client)return id('Unable to determine if feature "%s" is enabled because Optimizely client failed to initialize.',e),!1;var i=this.getUserWithOverrides(t,r);return null===i.id?(ip('Unable to determine if feature "%s" is enabled because User ID is not set',e),!1):this._client.isFeatureEnabled(e,i.id,i.attributes)},e.prototype.getFeatureVariables=function(e,t,r){var i=this;if(!this._client)return id('Unable to get feature variables for feature "%s" because Optimizely client failed to initialize.',e),{};var n=this.getUserWithOverrides(t,r),o=n.id;if(null===o)return id('Unable to get feature variables for feature "%s" because User ID is not set',e),{};var a=n.attributes,s={},u=this._client.getOptimizelyConfig();if(!u)return id('Unable to retrieve feature variables for feature "%s" because Optimizely client failed to initialize.',e),{};var l=u.featuresMap[e];
2return l?(Object.keys(l.variablesMap).forEach(function(t){var r=l.variablesMap[t];s[r.key]=i._client.getFeatureVariable(e,r.key,o,a)}),s):(ip('Unable to retrieve feature variables for feature "%s" because config features map is not set',e),{})},e.prototype.getFeatureVariableString=function(e,t,r,i){if(!this._client)return id('Unable to get feature variable string from feature "%s" because Optimizely client failed to initialize.',e),null;var n=this.getUserWithOverrides(r,i);return null===n.id?(ip('Unable to get feature variable string from feature "%s" because User ID is not set',e),null):this._client.getFeatureVariableString(e,t,n.id,n.attributes)},e.prototype.getFeatureVariableBoolean=function(e,t,r,i){if(!this._client)return id('Unable to get feature variable boolean from feature "%s" because Optimizely client failed to initialize.',e),null;var n=this.getUserWithOverrides(r,i);return null===n.id?(ip('Unable to get feature variable boolean from feature "%s" because User ID is not set',e),null):this._client.getFeatureVariableBoolean(e,t,n.id,n.attributes)},e.prototype.getFeatureVariableInteger=function(e,t,r,i){if(!this._client)return id('Unable to get feature variable integer from feature "%s" because Optimizely client failed to initialize.',e),null;var n=this.getUserWithOverrides(r,i);return null===n.id?(ip('Unable to get feature variable integer from feature "%s" because User ID is not set',e),null):this._client.getFeatureVariableInteger(e,t,n.id,n.attributes)},e.prototype.getFeatureVariableDouble=function(e,t,r,i){if(!this._client)return id('Unable to get feature variable double from feature "%s" because Optimizely client failed to initialize.',e),null;var n=this.getUserWithOverrides(r,i);return null===n.id?(ip('Unable to get feature variable double from feature "%s" because User ID is not set',e),null):this._client.getFeatureVariableDouble(e,t,n.id,n.attributes)},e.prototype.getFeatureVariableJSON=function(e,t,r,i){if(!this._client)return id('Unable to get feature variable JSON from feature "%s" because Optimizely client failed to initialize.',e),null;var n=this.getUserWithOverrides(r,i);return null===n.id?(ip('Unable to get feature variable JSON from feature "%s" because User ID is not set',e),null):this._client.getFeatureVariableJSON(e,t,n.id,n.attributes)},e.prototype.getFeatureVariable=function(e,t,r,i){if(!this._client)return id('Unable to get feature variable from feature "%s" because Optimizely client failed to initialize.',e,t),null;var n=this.getUserWithOverrides(r,i);return null===n.id?(ip('Unable to get feature variable from feature "%s" because User ID is not set',e,t),null):this._client.getFeatureVariable(e,t,n.id,n.attributes)},e.prototype.getAllFeatureVariables=function(e,t,r){if(!this._client)return id('Unable to get all feature variables from feature "%s" because Optimizely client failed to initialize.',e),{};var i=this.getUserWithOverrides(t,r);return null===i.id?(ip('Unable to get all feature variables from feature "%s" because User ID is not set',e),{}):this._client.getAllFeatureVariables(e,i.id,i.attributes)},e.prototype.getEnabledFeatures=function(e,t){if(!this._client)return id("Unable to get list of enabled features because Optimizely client failed to initialize."),[];var r=this.getUserWithOverrides(e,t);return null===r.id?(ip("Unable to get list of enabled features because User ID is not set"),[]):this._client.getEnabledFeatures(r.id,r.attributes)},e.prototype.getForcedVariation=function(e,t){if(!this._client)return id('Unable to get forced variation for experiment "%s" because Optimizely client failed to initialize.',e),null;var r=this.getUserWithOverrides(t);return null===r.id?(ip('Unable to get forced variation for experiment "%s" because User ID is not set',e),null):this._client.getForcedVariation(e,r.id)},e.prototype.setForcedVariation=function(e,t,r){if(!this._client)return id('Unable to set forced variation for experiment "%s" because Optimizely client failed to initialize.',e),!1;var i=null,n=null;if(2==arguments.length)n=t,i=this.getUserWithOverrides().id;else if(3==arguments.length){if(i=this.getUserWithOverrides(t).id,void 0===r)return!1;n=r}if(null===i)return id('Unable to set forced variation for experiment "%s" because User ID is not set',e),!1;var o=this._client.setForcedVariation(e,i,n);
2return this.onForcedVariationsUpdateHandlers.forEach(function(e){return e()}),o},e.prototype.getOptimizelyConfig=function(){return this._client?this._client.getOptimizelyConfig():(id("Unable to get Optimizely configuration because Optimizely client failed to initialize."),null)},e.prototype.close=function(){return this._client?this._client.close():new Promise(function(e,t){return e({success:!0,reason:"Optimizely client is not initialized."})})},Object.defineProperty(e.prototype,"client",{get:function(){return this._client?this._client:(id("Unable to get client because Optimizely client failed to initialize."),null)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"notificationCenter",{get:function(){return this._client?this._client.notificationCenter:{addNotificationListener:function(){return id("Unable to add notification listener because Optimizely client failed to initialize."),0},removeNotificationListener:function(){return id("Unable to remove notification listener because Optimizely client failed to initialize."),!1},clearAllNotificationListeners:function(){id("Unable to clear all notification listeners because Optimizely client failed to initialize.")},clearNotificationListeners:function(){id("Unable to clear notification listeners because Optimizely client failed to initialize.")}}},enumerable:!1,configurable:!0}),e.prototype.sendOdpEvent=function(e,t,r,i){var n;e&&e.trim()?null==(n=this.client)||n.sendOdpEvent(e,t,r,i):ig("ODP action is not valid (cannot be empty).")},e.prototype.getVuid=function(){return this._client?this._client.getVuid():void id("Unable to get VUID because Optimizely client failed to initialize.")},e}();function iy(e){return new iE(e)}var iv=ef("<OptimizelyProvider>");!function(e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function t(){this.constructor=r}function r(t){var r=e.call(this,t)||this;return r.setUserInOptimizely(),r}ie(r,e),r.prototype=null===e?Object.create(e):(t.prototype=e.prototype,new t),r.prototype.setUserInOptimizely=function(){return ir(this,void 0,void 0,function(){var e,t,r,i,n,o,a,s,u,l;return ii(this,function(c){switch(c.label){case 0:if(t=(e=this.props).optimizely,r=e.userId,i=e.userAttributes,n=e.user,o=e.qualifiedSegments,!t)return iv.error("OptimizelyProvider must be passed an instance of the Optimizely SDK client"),[2];if(a=null,n?"then"in n?n.then(function(e){t.setUser(e,o)}):a={id:n.id,attributes:n.attributes||{}}:r?(a={id:r,attributes:i||{}},iv.warn("Passing userId and userAttributes as props is deprecated, please switch to using `user` prop")):t.user?(u=(s=t.user).id,l=s.attributes,a={id:u,attributes:i||l||{}}):a={id:ih.id,attributes:i||ih.attributes},!a)return[3,4];c.label=1;case 1:return c.trys.push([1,3,,4]),[4,t.setUser(a,o)];case 2:return c.sent(),[3,4];case 3:return c.sent(),iv.error("Error while trying to set user."),[3,4];case 4:return[2]}})})},r.prototype.componentDidUpdate=function(e){if(!e.isServerSide){var t=this.props.optimizely;this.props.user&&"id"in this.props.user&&(t.user.id&&ia({id:t.user.id,attributes:t.user.attributes||{}},{id:this.props.user.id,attributes:this.props.user.attributes||{}})||t.setUser(this.props.user,this.props.qualifiedSegments))}},r.prototype.render=function(){var e=this.props,t=e.optimizely,r=e.children,i=e.timeout,n=!!this.props.isServerSide;return A.createElement(r7,{value:{optimizely:t,isServerSide:n,timeout:i}},r)}}(A.Component),ef("ReactSDK"),(f=R||(R={})).EXPERIMENT="Experiment",f.FEATURE="Feature",ef("ReactSDK"),e.s(["createInstance",0,iy],158024),e.i(710691);var i_=e.i(865344);e.i(781552);var iI=e.i(551380);e.i(293410);var im=e.i(539543),iO=e.i(223584),ib=e.i(15248);try{var iR=window;iR._sentryModuleMetadata=iR._sentryModuleMetadata||{},iR._sentryModuleMetadata[(new iR.Error).stack]=Object.assign({},iR._sentryModuleMetadata[(new iR.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let iN=(0,ib.createAdapter)({id:"clarity",name:"Microsoft Clarity",config:{consent:{initialize:"strictlyNecessaryCookie
2s"},receiveHuelTrackingEvents:!1},trackThirdPartyEvent(e){window.clarity?.("set",e.event,e.data)}});var iT=e.i(92829);try{var iA=window;iA._sentryModuleMetadata=iA._sentryModuleMetadata||{},iA._sentryModuleMetadata[(new iA.Error).stack]=Object.assign({},iA._sentryModuleMetadata[(new iA.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}try{var iS=window;iS._sentryModuleMetadata=iS._sentryModuleMetadata||{},iS._sentryModuleMetadata[new iS.Error().stack]=Object.assign({},iS._sentryModuleMetadata[new iS.Error().stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let iw=(0,A.createContext)(null);function iD(e){return e&&e.close(),null}function iU(e){if("flag"===e.type&&e.decisionInfo.flagKey){let t=t=>`${t}:${e.decisionInfo.flagKey}`,r=e.decisionInfo.variationKey||"[NOT_EXPOSED]",i=t("optimizely_feature_flag");iT.HeapAdapter.trackThirdPartyEvent?.({event:i,data:{[i]:r}}),iT.HeapAdapter.identify?.({[t("optimizely_feature")]:r}),iN.trackThirdPartyEvent?.({event:t("optimizely_feature_flag"),data:`${e.decisionInfo.flagKey} - ${r}`})}}e.s(["OptimizelySdkContext",0,iw,"OptimizelySdkProvider",0,e=>{let t,r,i,n,o,a=(0,N.c)(19),{children:s,datafile:u}=e,l=(0,iO.useStoreContext)(),c=(0,im.useLocale)(),{consent:d,hasLoaded:p}=(0,iI.useConsent)(),f=p&&d.performanceCookies,[g,h]=(0,A.useState)(null);return a[0]!==u||a[1]!==p||a[2]!==c||a[3]!==f||a[4]!==l?(t=()=>{(async()=>{if(h(iD),p&&f)try{let e=iy({sdkKey:"4qaE9ebF3nkARmBfCgsF1",datafile:u,logLevel:"error",defaultDecideOptions:[I.EXCLUDE_VARIABLES]});await e.onReady();let t=await i_.cookieStore.get("huel-experimentation-user-id");if(t){let r=await i_.cookieStore.get("huel-experimentation-nnc");await e.setUser({id:t,attributes:{store:l.storeCode,locale:c.toLowerCase(),hasPurchased:"1"===r}})}e.notificationCenter.addNotificationListener(ek.NOTIFICATION_TYPES.DECISION,iU),h(e)}catch(e){console.warn("[HUEL][Experimentation] Error initializing Optimizely SDK",e)}})()},a[0]=u,a[1]=p,a[2]=c,a[3]=f,a[4]=l,a[5]=t):t=a[5],a[6]!==d||a[7]!==u||a[8]!==p||a[9]!==c||a[10]!==f||a[11]!==l?(r=[l,c,p,f,u,d],a[6]=d,a[7]=u,a[8]=p,a[9]=c,a[10]=f,a[11]=l,a[12]=r):r=a[12],(0,A.useEffect)(t,r),a[13]!==g?(i=()=>()=>{g&&g.close()},n=[g],a[13]=g,a[14]=i,a[15]=n):(i=a[14],n=a[15]),(0,A.useEffect)(i,n),a[16]!==s||a[17]!==g?(o=(0,T.jsx)(iw.Provider,{value:g,children:s}),a[16]=s,a[17]=g,a[18]=o):o=a[18],o}],493878)},15248,92829,e=>{"use strict";var t=e.i(546186);try{var r=window;r._sentryModuleMetadata=r._sentryModuleMetadata||{},r._sentryModuleMetadata[(new r.Error).stack]=Object.assign({},r._sentryModuleMetadata[(new r.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}try{var i=window;i._sentryModuleMetadata=i._sentryModuleMetadata||{},i._sentryModuleMetadata[(new i.Error).stack]=Object.assign({},i._sentryModuleMetadata[(new i.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}function n(e,r){let i=e.consent[r];return!i||t.consentStore.getState().hasConsent(i)}function o(e){let{config:t}=e;return{id:e.id,name:e.name,config:t,hasConsent:e=>n(t,e),initialize:e.initialize?()=>{if(n(t,"initialize"))return e.initialize?.()}:void 0,trackEvent:e.trackEvent?r=>{n(t,"trackEvent")&&e.trackEvent?.(r)}:void 0,trackThirdPartyEvent:e.trackThirdPartyEvent?r=>{n(t,"trackThirdPartyEvent")&&e.trackThirdPartyEvent?.(r)}:void 0,identify:e.identify?r=>{n(t,"identify")&&e.identify?.(r)}:void 0,cleanup:e.cleanup}}e.s(["createAdapter",0,o],15248);try{var a=window;a._sentryModuleMetadata=a._sentryModuleMetadata||{},a._sentryModuleMetadata[(new a.Error).stack]=Object.assign({},a._sentryModuleMetadata[(new a.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let s="huelTracking_",u=`${s}customerId`,l=["email","customerId"],c=new Set(["emailSha256",`${s}emailSha256`]),d=new Set([...c,"email","customerId",`${s}email`,u]),p=new Set(["event_id","locale","countryCode","addToCartSource","orderType","quantity","currency","total","location","title","path","method","searchTerm","resultsCount","itemListId","itemListName","index","value","itemAreaClicked"]),f=e=>"string"==typeof e||"number"==typeof e||"boolean"==typeof e,g=e=>{let t={},r=e.map(e=>e.pimId).filter(e=>void 0!==e),i=e.map(e=>e.pimVariantId).filter(e=>void 0!==e),n=e.map(e=>e.sku).filter(e=>void 0!==e),o=e.map(e=>e.parentName).filter(e=>void 0!==e),a=e.map(e=>e.name).filter(e=>void 0!==e),s=e.map(e=>e.quantity).filter(e=>void 0!==e),u=e.map(e=>e.price).filter(e=>void 0!==e),l=e.map(e=>e.category).filter(e=>void 0!==e),c=e.map(e=>e.shopifyProductId).filter(e=>void 0!==e),d=e.map(e=>e.shopifyVariantId).filter(e=>void 0!==e);return r.length>0&&(t.huelTracking_products_pimId=r),i.length>0&&(t.huelTracking_products_pimVariantId=i),n.length>0&&(t.huelTracking_products_sku=n),o.length>0&&(t.huelTracking_products_parentName=o),a.length>0&&(t.huelTracking_products_name=a),s.length>0&&(t.huelTracking_products_quantity=s),u.length>0&&(t.huelTracking_products_price=u),l.length>0&&(t.huelTracking_products_category=l),c.length>0&&(t.huelTracking_products_shopifyProductId=c),d.length>0&&(t.huelTracking_products_shopifyVariantId=d),t};function h(e){try{"string"==typeof e&&e.length>0&&window.heap?.identify?.(e)}catch{console.error("[Heap] Cannot identify user")}}function E(e,t){let r={};for(let[i,n]of Object.entries(e))t.has(i)||(r[i]=n);return r}function y(e,t){try{window.heap?.removeEventProperty?.(u)}catch{console.error("[Heap] Cannot remove legacy event property")}try{let r=t?E(t,d):void 0;r&&Object.keys(r).length>0?window.heap?.track?.(e,r):window.heap?.track?.(e)}catch{console.error("[Heap] Cannot send custom event")}}function v(e){try{if(0===Object.keys(e).length)return;window.heap?.addUserProperties(e)}catch{console.error("[Heap] Cannot send user properties")}}function _(e){let t;if(!e)return{};if("string"==typeof e)try{let r=JSON.parse(e);if(!r||"object"!=typeof r||Array.isArray(r))return{};t=r}catch{return{}}else t=e;let r={};for(let[e,i]of Object.entries(t))if(f(i))r[e]=i;else if(Array.isArray(i)){let t=i.filter(f);t.length>0&&(r[e]=t)}return r}try{var I=window;I._sentryModuleMetadata=I._sentryModuleMetadata||{},I._sentryModuleMetadata[(new I.Error).stack]=Object.assign({},I._sentryModuleMetadata[(new I.Error).stack],{"_sentryBundlerPluginAppKey:huel-storefront":!0})}catch(e){}let m=new Set(["HuelTracking.sign_up","HuelTracking.login"]),O=o({id:"heap",name:"Heap Analytics",config:{consent:{initialize:"performanceCookies",trackEvent:"performanceCookies",trackThirdPartyEvent:"performanceCookies",identify:"performanceCookies"},receiveHuelTrackingEvents:!0,eventFilter:["HuelTracking.add_to_cart","HuelTracking.remove_from_cart","HuelTracking.view_cart","HuelTracking.sign_up","HuelTracking.login","HuelTracking.email_sign_up","HuelTracking.page_view","HuelTracking.modal_open","HuelTracking.view_item","HuelTracking.variant_selected","HuelTracking.view_item_list"]},trackEvent(e){if(m.has(e.event)){let t,r=(t={},"string"==typeof e.email&&e.email.length>0&&(t.email=e.email),"string"==typeof e.customerId&&e.customerId.length>0&&(t.customerId=e.customerId),t);h("string"==typeof e.customerId?e.customerId:void 0),v(r)}let t=function(e){let t={};for(let[r,i]of Object.entries(e))"event"!==r&&"timestamp"!==r&&p.has(r)&&f(i)&&(t[`${s}${r}`]=i);if("products"in e&&Array.isArray(e.products)&&e.products.length>0)Object.assign(t,g(e.products));else"product"in e&&void 0!==e.product&&Object.assign(t,g([e.product]));return t}(e);y(e.event,t)},trackThirdPartyEvent(e){let t=_(e.data);y(e.event,t)},identify(e){let t=function(e){let t=E(_(e),c);for(let e of l){let r=t[e];void 0!==r&&("string"!=typeof r||0===r.trim().length)&&delete t[e]}return t}(e),r=t.customerId;h("string"==typeof r?r:void 0),v(t)}});e.s(["HeapAdapter",0,O],92829)}]);
3
4//# debugId=3a6a5a03-6954-6569-6dba-2f8e0b9e1ac0
5//# sourceMappingURL=338z5_cj16kts.js.map

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.