Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

rox-base

Package Overview
Dependencies
Maintainers
11
Versions
89
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rox-base - npm Package Compare versions

Comparing version 5.3.1 to 5.4.0

2

dist/rox-base.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("axios")):"function"==typeof define&&define.amd?define(["axios"],t):"object"==typeof exports?exports.Rox=t(require("axios")):e.Rox=t(e.axios)}(self,t=>{return r=[,(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var s=r(2);const i="x-api.rollout.io";let n=new s.default;function o(e){let t=i;return{API_HOST:t=e?""+e+i:t,CD_API_ENDPOINT:`https://${t}/device/get_configuration`,CD_S3_ENDPOINT:"https://conf.rollout.io/",SS_API_ENDPOINT:`https://${t}/device/update_state_store/`,SS_S3_ENDPOINT:"https://statestore.rollout.io/",CLIENT_DATA_CACHE_KEY:"client_data",NOTIFICATIONS_ENDPOINT:"https://push.rollout.io/sse",ANALYTICS_ENDPOINT:"https://analytic.rollout.io"}}let a=Object.assign({},o());const u={get:e=>a[e],set:(e,t)=>{a[e]=t},setActive:function(e){a=Object.assign({},e)},setProxy:function(e){n=new s.default(e)},getProxy:()=>n,setHosting:function(e){"eu"===e&&(a=Object.assign({},o("eu-")))},setSelfManagedMode:function(e){var t,r,s,i;a=Object.assign({},o(),({analyticsURL:e,serverURL:t,pushUpdateURL:r,configurationURL:s,stateURL:i}=e,{CD_API_ENDPOINT:t+"/device/get_configuration",SS_API_ENDPOINT:t+"/device/update_state_store/",CLIENT_DATA_CACHE_KEY:"client_data",ANALYTICS_ENDPOINT:e,NOTIFICATIONS_ENDPOINT:r+"/sse",CD_S3_ENDPOINT:s,SS_S3_ENDPOINT:i}))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(3);const i="roxTargetUrl",n="roxAuth";class o{constructor(e){this._proxyUrl="",this._proxyAuthHeader="",this._proxySettings=!1,e&&(this._proxySettings=Object.assign({},e),this._proxyUrl=this._proxySettings.protocol+"://"+this._proxySettings.host+(this._proxySettings.port?":"+this._proxySettings.port:""),this._proxySettings.auth&&this._proxySettings.auth.username&&this._proxySettings.auth.password&&(this._proxyAuthHeader="Basic "+(0,s.encode)(this._proxySettings.auth.username+":"+this._proxySettings.auth.password),this._proxyAuthHeaderEncoded=encodeURIComponent(this._proxyAuthHeader)))}applyProxyToRequest(e){if(this._proxySettings){e.options=e.options?Object.assign({},e.options):{};const t=e.options;t.params=t.params||{},t.params[i]=e.url,this._proxyAuthHeader&&(t.params[n]=this._proxyAuthHeader),e.url=this._proxyUrl}}applyProxyToSseRequest(e){this._proxySettings&&(e.url=`${this._proxyUrl}?${i}=`+encodeURIComponent(e.url),this._proxyAuthHeaderEncoded&&(e.url=`${e.url}&${n}=`+this._proxyAuthHeaderEncoded))}get proxyUrl(){return this._proxyUrl}}},(M,e,t)=>{"use strict";t.r(e),t.d(e,{Base64:()=>H,VERSION:()=>s,atob:()=>R,atobPolyfill:()=>S,btoa:()=>g,btoaPolyfill:()=>f,btou:()=>P,decode:()=>I,encode:()=>x,encodeURI:()=>N,encodeURL:()=>N,extendBuiltins:()=>U,extendString:()=>D,extendUint8Array:()=>F,fromBase64:()=>I,fromUint8Array:()=>m,isValid:()=>w,toBase64:()=>x,toUint8Array:()=>A,utob:()=>b,version:()=>r});const r="3.7.2",s=r;var t="function"==typeof atob,e="function"==typeof btoa,i="function"==typeof Buffer;const n="function"==typeof TextDecoder?new TextDecoder:void 0,o="function"==typeof TextEncoder?new TextEncoder:void 0,a=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),u=(e=>{let r={};return e.forEach((e,t)=>r[e]=t),r})(a),l=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),d="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=e=>e)=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),h=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),p=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),f=t=>{let r,s,i,n,o="";var e=t.length%3;for(let e=0;e<t.length;){if(255<(s=t.charCodeAt(e++))||255<(i=t.charCodeAt(e++))||255<(n=t.charCodeAt(e++)))throw new TypeError("invalid character found");r=s<<16|i<<8|n,o+=a[r>>18&63]+a[r>>12&63]+a[r>>6&63]+a[63&r]}return e?o.slice(0,e-3)+"===".substring(e):o},g=e?e=>btoa(e):i?e=>Buffer.from(e,"binary").toString("base64"):f,y=i?e=>Buffer.from(e).toString("base64"):r=>{let s=[];for(let e=0,t=r.length;e<t;e+=4096)s.push(c.apply(null,r.subarray(e,e+4096)));return g(s.join(""))},m=(e,t=!1)=>t?h(y(e)):y(e),_=e=>{var t;return e.length<2?(t=e.charCodeAt(0))<128?e:t<2048?c(192|t>>>6)+c(128|63&t):c(224|t>>>12&15)+c(128|t>>>6&63)+c(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),c(240|t>>>18&7)+c(128|t>>>12&63)+c(128|t>>>6&63)+c(128|63&t))},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,b=e=>e.replace(v,_),E=i?e=>Buffer.from(e,"utf8").toString("base64"):o?e=>y(o.encode(e)):e=>g(b(e)),x=(e,t=!1)=>t?h(E(e)):E(e),N=e=>x(e,!0),k=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return c(55296+(t>>>10))+c(56320+(1023&t));case 3:return c((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return c((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},P=e=>e.replace(k,L),S=t=>{if(t=t.replace(/\s+/g,""),!l.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let r,s="",i,n;for(let e=0;e<t.length;)r=u[t.charAt(e++)]<<18|u[t.charAt(e++)]<<12|(i=u[t.charAt(e++)])<<6|(n=u[t.charAt(e++)]),s+=64===i?c(r>>16&255):64===n?c(r>>16&255,r>>8&255):c(r>>16&255,r>>8&255,255&r);return s},R=t?e=>atob(p(e)):i?e=>Buffer.from(e,"base64").toString("binary"):S,T=i?e=>d(Buffer.from(e,"base64")):e=>d(R(e),e=>e.charCodeAt(0)),A=e=>T(O(e)),j=i?e=>Buffer.from(e,"base64").toString("utf8"):n?e=>n.decode(T(e)):e=>P(R(e)),O=e=>p(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),I=e=>j(O(e)),w=e=>"string"==typeof e&&(e=e.replace(/\s+/g,"").replace(/={0,2}$/,""),!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)),C=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),D=function(){var e=(e,t)=>Object.defineProperty(String.prototype,e,C(t));e("fromBase64",function(){return I(this)}),e("toBase64",function(e){return x(this,e)}),e("toBase64URI",function(){return x(this,!0)}),e("toBase64URL",function(){return x(this,!0)}),e("toUint8Array",function(){return A(this)})},F=function(){var e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,C(t));e("toBase64",function(e){return m(this,e)}),e("toBase64URI",function(){return m(this,!0)}),e("toBase64URL",function(){return m(this,!0)})},U=()=>{D(),F()},H={version:r,VERSION:s,atob:R,atobPolyfill:S,btoa:g,btoaPolyfill:f,fromBase64:I,toBase64:x,encode:x,encodeURI:N,encodeURL:N,utob:b,btou:P,decode:I,isValid:w,fromUint8Array:m,toUint8Array:A,extendString:D,extendUint8Array:F,extendBuiltins:U}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CallContextTypes:()=>u.callContextTypes,CustomProperty:()=>s.default,DeploymentConfiguration:()=>n.default,DeviceProperty:()=>i.default,Experiment:()=>o.default,FlagTypes:()=>u.FlagTypes,RoxStringBase:()=>u.default,TargetGroup:()=>a.default});var s=r(5),i=r(8),n=r(9),o=r(10),a=r(11),u=r(12)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(6);class i{constructor(e,t,r){if(void 0===e||""===e)throw new Error("Custom property must be initialized with a name.");if(this._name=e,"function"==typeof r){if(1<r.length)throw new Error("Dynamic value of a custom property should be a function with maximum 1 argument");r.isDynamic=!0,this._value=r}else{if(r&&r.constructor!==t&&r.constructor!==Function)throw new Error(`Custom property initialized with an invalid type / value combination. (Type: ${t}, Value: ${r})`);this._value=()=>r}this._type=t}get type(){return this._type.name}get externalType(){return this._type.name}get name(){return this._name}getValue(e={}){if(this._value&&this._value.isDynamic)try{return this._value(e)}catch(e){throw e.isUserError=!0,e.trigger=s.ExceptionTrigger.CUSTOM_PROPERTY_GENERATOR,e}return this._value(e)}get value(){return this._value()}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ExceptionTrigger:()=>i,default:()=>n});var s=r(7);const i={DYNAMIC_PROPERTIES_RULE:"DYNAMIC_PROPERTIES_RULE",CONFIGURATION_FETCHED_HANDLER:"CONFIGURATION_FETCHED_HANDLER",IMPRESSION_HANDLER:"IMPRESSION_HANDLER",CUSTOM_PROPERTY_GENERATOR:"CUSTOM_PROPERTY_GENERATOR"},n=new class{invoke(e,t){if(this.userUnhandledErrorHandler)try{this.userUnhandledErrorHandler(e,t)}catch(e){s.default.error("User Unhandled Error Handler itself threw an exception. original exception:"+t,e)}else s.default.error("User Unhandled Error Occured, no fallback handler was set, exception ignored.",t)}setHandler(e){e instanceof Function?this.userUnhandledErrorHandler=e:s.default.warn("UserspaceUnhandledErrorHandler must be a function. default will be used.")}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});const s={debug:0,info:1,warn:2,error:3};let i="error",n=new class{constructor(){this.debug=(e,...t)=>{s[i]<=s.debug&&console&&console.log(e,...t)},this.info=(e,...t)=>{s[i]<=s.info&&console&&console.info(e,...t)},this.warn=(e,...t)=>{s[i]<=s.warn&&console&&console.warn(e,...t)},this.error=(e,...t)=>{console&&console.error(e,...t)},this.setVerboseMode=e=>{"verbose"===e?(i="debug",this.debug("Active verbose mode")):i="error"},this.setLogger=e=>{n=e}}};const o=n},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s extends r(5).default{get name(){return"rox."+super.name}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e){this.condition=e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e,t,r,s,i,n,o,a){this.identifier=e,this.name=t,this.archived=r,this.sticky=s,this.deploymentConfiguration=i,this.flags=n,this.labels=o,this.stickinessProperty=a}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e,t){this.identifier=e,this.condition=t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FlagTypes:()=>n,callContextTypes:()=>i,default:()=>o});var s=r(13);const i={frozenOrCalc:"frozenValueOrOneTimeEval",oneTimeCalc:"oneTimeEval",default:"useFrozen"},n={boolean:"boolean",number:"number",string:"string"};class o{constructor(e,t,r){if(this._type=r,r=this._validateDefault(e),Array.isArray(t))this._validateOptions(t),this._options=t.map(e=>e.toString());else{if(null!=t)throw new Error("RoxStringBase wrong variations type");this._options=[]}-1===this._options.indexOf(r)&&this._options.push(r),this._value=this._defaultValue=r,this._frozen=!1,this._freezable=!0}_validateDefault(e){if(typeof e!==this._type)throw new Error(`RoxStringBase default value must be of ${this._type} type. Received '${e}'`);return e.toString()}_validateOptions(e){var t=new Error(`RoxStringBase options must be a non-empty array of ${this._type}. Received '${e}'`);if(!e.every(e=>typeof e===this._type))throw t}get defaultValue(){return this._defaultValue}get overridenValue(){if(this.overrider.hasOverride(this.name))return this.overrider.getOverride(this.name)}get overrider(){throw new Error("Not implemented")}getInternalValue(e,t){throw Error("not implemented")}set name(e){this._name=e}get name(){return this._name}_getNameDetails(){if(this.name){const e=this.name.split(".");return{name:e.pop(),namespace:e.join(".")||"default"}}}dump(){var e={type:i.frozenOrCalc};return this.getInternalValue(e),{name:this.name,type:this._type,nameDetails:this._getNameDetails(),options:[...this._options],defaultValue:this.defaultValue,originalValue:this._originalValue(),overridingValue:this.overridenValue,value:e.result.value}}getActiveValue(e,t){throw new Error("Not implemented")}_originalValue(){var e={type:i.frozenOrCalc};return this.getActiveValue(e),e.result.value}_flagImpression(e,t){(0,s.invokeImpression)(e,this,t)}static _normalizeString(e){return e}static _normalizeNumber(e){return Number(e)}static _normalizeBoolean(e){return"boolean"==typeof e?e:"true"===e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{invokeImpression:()=>function(t,r,s){var i=l.default.experimentForFlag(r);try{if(p&&(0,u.isEnabled)("rox.internal.analytics")){var n=i&&i.stickinessProperty;let e=n&&c.default.get(n);var o=(e=e||c.default.get("rox.distinct_id"))?e.getValue(s):"";p.track({flag:r.name,value:t,distinctId:o,type:"IMPRESSION",time:(new Date).getTime()})}}catch(e){a.default.error("Failed to send analytics",e)}if("function"==typeof h){n=!!i;try{h({name:r.name,value:t,targeting:n},s)}catch(e){d.default.invoke(d.ExceptionTrigger.IMPRESSION_HANDLER,e)}}},setAnalytics:()=>function(e){p=e},setHandler:()=>function(e){h=e}});var a=r(7),u=r(15),l=r(14),c=r(26),d=r(6);let h=null,p=null},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});const s=new class{constructor(){this.map={}}setExperiments(e){this.map={},(e=e||[]).forEach(function(e){this.map[e.identifier]=e},this)}experimentWithName(e){return this.map[e]}get experiments(){return Object.keys(this.map).map(e=>this.map[e])}experimentForFlagName(t){return this.experiments.find(e=>e.flags&&e.flags.some(e=>e.name===t))}experimentForFlag(e){return this.experimentForFlagName(e.name)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{getNumber:()=>function(e){return e=a(e),parseInt(e)||0},isEnabled:()=>function(e){return"boolean"==typeof(e=a(e))?e:"true"===e},setDefaultsMode:()=>function(e){n=e},value:()=>a});var s=r(16),i=r(14);let n=!1;const o={"rox.internal.pushUpdates":"true","rox.internal.considerThrottleInPush":"false","rox.internal.throttleFetchInSeconds":"0","rox.internal.analytics":"true"};function a(e){return n&&Object.prototype.hasOwnProperty.call(o,e)?o[e]:(e=i.default.experimentForFlagName(e))&&e.deploymentConfiguration?(new s.default).evaluateExpression(e.deploymentConfiguration.condition):""}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var g=r(17),y=r(29),m=r(7),_=r(18),v=r(6);class s{constructor(e){this._tokenizer=new g.RoxxTokenizer,this._cache=e||{}}_argsArrayForOperator(e,t){const r=[];var s=e.length;for(let e=0;e<s;e++){var i=t.pop();r.push(i)}return r}_modifyArgsHook({operator:e,args:t,context:r,callContext:s}){let i=t;return r&&_.operatorsWithContext.includes(e)&&(i=[...t,r]),s?[...i,s]:i}compileExpression(e){let t=this._cache[e];return t||(t=this._tokenizer.tokenize(e).reverse(),this._cache[e]=t),t}evaluateExpression(t,r={},s={},i){const n=[];var o=this.compileExpression(t);let a=void 0;var u=o.length;try{for(let e=0;e<u;e++){var l=o[e];if(l.type==g.RoxxTokenTypeRand)n.push(l.value);else{if(l.type!=g.RoxxTokenTypeRator){n.push(void 0);break}{const f=_[l.value];var c=this._argsArrayForOperator(f,n),c=this._modifyArgsHook({operator:f,args:c,context:s,callContext:r}),d=f.apply(this,c),h=(n.push(d),`${l.value}(${JSON.stringify(c)}) => `+d);i&&i.push(h),m.default.debug("Roxx: "+h)}}}a=n.pop()}catch(e){var p="Oh uh! An error occured during Roxx evaluation. "+t;e.isUserError?v.default.invoke(e.trigger,e):y.default.error(p,e),m.default.error(p,e),a=!1}finally{return a}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RoxxTokenTypeRand:()=>a,RoxxTokenTypeRator:()=>i,RoxxTokenizer:()=>u});var n=r(28),t=r(18);const s=Object.keys(t),o='{}[]():, \t\r\n"',i="operator",a="operand";class u{constructor(){this.tokenArray=[],this.arrayAccumulator=void 0,this.dictionaryAccumulator=void 0,this.dictKey=void 0}_stringToRoxx(e){return s.includes(e)?{type:i,value:e}:"true"==e?{type:a,value:!0}:"false"==e?{type:a,value:!1}:"undefined"==e?{type:a,value:void 0}:'"'==e.charAt(0)&&'"'==e.charAt(e.length-1)?{type:a,value:e.substr(1,e.length-2)}:isNaN(e)?{type:"UNKNOWN"}:{type:a,value:+e}}push(e){this.dictionaryAccumulator&&!this.dictKey?this.dictKey=e.value:this.dictionaryAccumulator&&this.dictKey?(this.dictionaryAccumulator[this.dictKey]=e.value,this.dictKey=void 0):this.arrayAccumulator?this.arrayAccumulator.push(e.value):this.tokenArray.push(e)}tokenize(e){this.tokenArray=[],this.arrayAccumulator=void 0,this.dictionaryAccumulator=void 0;let t=o;e=e.replace('\\"',"\\RO_Q");const r=new n.default(e,t,!0);let s,i;for(;r.hasMoreTokens();)switch(i=s,s=r.nextTokenWithDelimiters(t)){case"{":this.dictionaryAccumulator={};break;case"}":this.tokenArray.push({type:a,value:this.dictionaryAccumulator}),this.dictionaryAccumulator=void 0;break;case"[":this.arrayAccumulator=[];break;case"]":this.tokenArray.push({type:a,value:this.arrayAccumulator}),this.arrayAccumulator=void 0;break;case'"':'"'==i&&this.push({type:a,value:""}),t='"'==t?o:'"';break;default:'"'==t?this.push({type:a,value:s.replace("\\RO_Q",'\\"')}):-1==o.indexOf(s)&&this.push(this._stringToRoxx(s))}return this.tokenArray}}},(M,e,t)=>{"use strict";t.r(e),t.d(e,{and:()=>g,b64d:()=>V,concat:()=>z,eq:()=>_,flagValue:()=>D,gt:()=>N,gte:()=>R,ifThen:()=>b,inArray:()=>G,isInPercentage:()=>j,isInPercentageRange:()=>H,isInTargetGroup:()=>F,isTargetGroupPaired:()=>B,isUndefined:()=>p,lt:()=>E,lte:()=>x,match:()=>T,md5:()=>K,mergeSeed:()=>L,ne:()=>m,not:()=>v,now:()=>f,numeq:()=>S,numne:()=>P,operatorsWithContext:()=>q,or:()=>y,property:()=>U,semverEq:()=>C,semverGt:()=>I,semverGte:()=>w,semverLt:()=>A,semverLte:()=>O,semverNe:()=>k});var s=t(25),i=t(26),n=t(23),o=t(14),a=t(16),e=t(19),r=t.n(e),u=t(3),l=t(27),c=t(6);function d(e,t,r={zeroExtend:!0,lexicographical:!0}){const s=r&&r.lexicographical;r=r&&r.zeroExtend;let i=e.split("."),n=t.split(".");function o(e){return(s?/[0-9A-Za-z_-]+$/:/^\d+$/).test(e)}if(!i.every(o)||!n.every(o))return NaN;if(r){for(;i.length<n.length;)i.push("0");for(;n.length<i.length;)n.push("0")}s||(i=i.map(Number),n=n.map(Number));for(let e=0;e<i.length;++e){if(n.length==e)return 1;if(i[e]!=n[e])return i[e]>n[e]?1:-1}return i.length!=n.length?-1:0}const h=e=>((255&(e=r()(e,{asBytes:!0}))[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24)>>>0)/(Math.pow(2,32)-1),p=e=>void 0===e,f=()=>Date.now(),g=(e,t)=>e&&t,y=(e,t)=>e||t,m=(e,t)=>(!p(e)&&e)!==(!p(t)&&t),_=(e,t)=>(!p(e)&&e)===(!p(t)&&t),v=e=>!e,b=(e,t,r)=>e?t:r,E=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||!(e<t)),x=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||!(e<=t)),N=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||!(t<e)),P=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||e===t),S=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||e!==t),R=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||!(t<=e)),T=(e,t,r)=>{const s=new RegExp(t,r);return!!s.exec(e)},A=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&d(e,t,{zeroExtend:!0})<0,O=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&d(e,t,{zeroExtend:!0})<=0,I=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&0<d(e,t,{zeroExtend:!0}),w=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&0<=d(e,t,{zeroExtend:!0}),C=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&0==d(e,t),k=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&0!=d(e,t),L=(e,t)=>e+"."+t,j=(e,t)=>h(t)<=e,H=(e,t,r)=>e<=(r=h(r))&&r<=t,D=(e,t={},r={})=>{const s=n.default.flagWithName(e);if(s)return i=Object.assign({},r),s.getInternalValue(i,t),i.isPeek||i.result.isOverride||i.result.isFreezed||s._flagImpression(i.result.value,i.result.usedContext),i.result.value;var i=o.default.experimentForFlagName(e);return i&&i.deploymentConfiguration&&(new a.default).evaluateExpression(i.deploymentConfiguration.condition,r,t)||"false"},F=(e,t={},r={})=>!!(e=s.default.targetGroupWithName(e))&&(new a.default).evaluateExpression(e.condition,r,t),B=()=>!1,U=(t,r={})=>{const e=i.default.get(t);if(e)return e.getValue(r);{const s=l.DynamicPropertiesHandler&&(0,l.DynamicPropertiesHandler)();let e;if(s)if(s._isUserDefined)try{e=s(t,r)}catch(e){throw e.isUserError=!0,e.trigger=c.ExceptionTrigger.DYNAMIC_PROPERTIES_RULE,e}else e=s(t,r);return e}},G=(e,t)=>!!t&&t.includes(e),K=e=>{if("string"==typeof e)return r()(e)},z=(e,t)=>{if("string"==typeof e&&"string"==typeof t)return""+e+t},V=e=>{if("string"==typeof e)return decodeURIComponent((0,u.decode)(e))},q=[F,D,U]},(e,t,r)=>{function y(e,t){e.constructor==String?e=(t&&"binary"===t.encoding?b:_).stringToBytes(e):v(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=m.bytesToWords(e),t=8*e.length,s=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a<r.length;a++)r[a]=16711935&(r[a]<<8|r[a]>>>24)|4278255360&(r[a]<<24|r[a]>>>8);r[t>>>5]|=128<<t%32,r[14+(64+t>>>9<<4)]=t;for(var u=y._ff,l=y._gg,c=y._hh,d=y._ii,a=0;a<r.length;a+=16){var h=s,p=i,f=n,g=o,s=u(s,i,n,o,r[a+0],7,-680876936),o=u(o,s,i,n,r[a+1],12,-389564586),n=u(n,o,s,i,r[a+2],17,606105819),i=u(i,n,o,s,r[a+3],22,-1044525330);s=u(s,i,n,o,r[a+4],7,-176418897),o=u(o,s,i,n,r[a+5],12,1200080426),n=u(n,o,s,i,r[a+6],17,-1473231341),i=u(i,n,o,s,r[a+7],22,-45705983),s=u(s,i,n,o,r[a+8],7,1770035416),o=u(o,s,i,n,r[a+9],12,-1958414417),n=u(n,o,s,i,r[a+10],17,-42063),i=u(i,n,o,s,r[a+11],22,-1990404162),s=u(s,i,n,o,r[a+12],7,1804603682),o=u(o,s,i,n,r[a+13],12,-40341101),n=u(n,o,s,i,r[a+14],17,-1502002290),s=l(s,i=u(i,n,o,s,r[a+15],22,1236535329),n,o,r[a+1],5,-165796510),o=l(o,s,i,n,r[a+6],9,-1069501632),n=l(n,o,s,i,r[a+11],14,643717713),i=l(i,n,o,s,r[a+0],20,-373897302),s=l(s,i,n,o,r[a+5],5,-701558691),o=l(o,s,i,n,r[a+10],9,38016083),n=l(n,o,s,i,r[a+15],14,-660478335),i=l(i,n,o,s,r[a+4],20,-405537848),s=l(s,i,n,o,r[a+9],5,568446438),o=l(o,s,i,n,r[a+14],9,-1019803690),n=l(n,o,s,i,r[a+3],14,-187363961),i=l(i,n,o,s,r[a+8],20,1163531501),s=l(s,i,n,o,r[a+13],5,-1444681467),o=l(o,s,i,n,r[a+2],9,-51403784),n=l(n,o,s,i,r[a+7],14,1735328473),s=c(s,i=l(i,n,o,s,r[a+12],20,-1926607734),n,o,r[a+5],4,-378558),o=c(o,s,i,n,r[a+8],11,-2022574463),n=c(n,o,s,i,r[a+11],16,1839030562),i=c(i,n,o,s,r[a+14],23,-35309556),s=c(s,i,n,o,r[a+1],4,-1530992060),o=c(o,s,i,n,r[a+4],11,1272893353),n=c(n,o,s,i,r[a+7],16,-155497632),i=c(i,n,o,s,r[a+10],23,-1094730640),s=c(s,i,n,o,r[a+13],4,681279174),o=c(o,s,i,n,r[a+0],11,-358537222),n=c(n,o,s,i,r[a+3],16,-722521979),i=c(i,n,o,s,r[a+6],23,76029189),s=c(s,i,n,o,r[a+9],4,-640364487),o=c(o,s,i,n,r[a+12],11,-421815835),n=c(n,o,s,i,r[a+15],16,530742520),s=d(s,i=c(i,n,o,s,r[a+2],23,-995338651),n,o,r[a+0],6,-198630844),o=d(o,s,i,n,r[a+7],10,1126891415),n=d(n,o,s,i,r[a+14],15,-1416354905),i=d(i,n,o,s,r[a+5],21,-57434055),s=d(s,i,n,o,r[a+12],6,1700485571),o=d(o,s,i,n,r[a+3],10,-1894986606),n=d(n,o,s,i,r[a+10],15,-1051523),i=d(i,n,o,s,r[a+1],21,-2054922799),s=d(s,i,n,o,r[a+8],6,1873313359),o=d(o,s,i,n,r[a+15],10,-30611744),n=d(n,o,s,i,r[a+6],15,-1560198380),i=d(i,n,o,s,r[a+13],21,1309151649),s=d(s,i,n,o,r[a+4],6,-145523070),o=d(o,s,i,n,r[a+11],10,-1120210379),n=d(n,o,s,i,r[a+2],15,718787259),i=d(i,n,o,s,r[a+9],21,-343485551),s=s+h>>>0,i=i+p>>>0,n=n+f>>>0,o=o+g>>>0}return m.endian([s,i,n,o])}var m=r(20),_=r(21).utf8,v=r(22),b=r(21).bin;y._ff=function(e,t,r,s,i,n,o){return((e=e+(t&r|~t&s)+(i>>>0)+o)<<n|e>>>32-n)+t},y._gg=function(e,t,r,s,i,n,o){return((e=e+(t&s|r&~s)+(i>>>0)+o)<<n|e>>>32-n)+t},y._hh=function(e,t,r,s,i,n,o){return((e=e+(t^r^s)+(i>>>0)+o)<<n|e>>>32-n)+t},y._ii=function(e,t,r,s,i,n,o){return((e=e+(r^(t|~s))+(i>>>0)+o)<<n|e>>>32-n)+t},y._blocksize=16,y._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);return e=m.wordsToBytes(y(e,t)),t&&t.asBytes?e:t&&t.asString?b.bytesToString(e):m.bytesToHex(e)}},e=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.endian(e[t]);return e},randomBytes:function(e){for(var t=[];0<e;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,s=0;r<e.length;r++,s+=8)t[s>>>5]|=e[r]<<24-s%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var t=[],r=0;r<e.length;r+=3)for(var s=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?t.push(n.charAt(s>>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,s=0;r<e.length;s=++r%4)0!=s&&t.push((n.indexOf(e.charAt(r-1))&Math.pow(2,-2*s+8)-1)<<2*s|n.indexOf(e.charAt(r))>>>6-2*s);return t}};e.exports=r},e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};e.exports=t},e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))||!!e._isBuffer)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RoxFlagRepository:()=>n,default:()=>o});var s=r(24),i=r(14);class n{constructor(){this.map={}}addFlag(e,t){t.name=e,this.map[e]=t,new s.default(this,i.default).setAddedFlag(t)}flagWithName(e){return this.map[e]}get flags(){return Object.keys(this.map).map(e=>this.map[e])}get items(){return this.flags}}const o=new n},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(7);class i{constructor(e,t){this.flagRepo=e,this.experimentsRepo=t}prepareFlagsWithExperiments(){const e=this.experimentsRepo.experiments||[],r=(s.default.debug("Set experiments "+JSON.stringify(e)),[]);e.forEach(t=>{t&&t.flags.forEach(e=>{(e=e&&this.flagRepo.flagWithName(e.name))&&(r.push(e),this.connectExperimentToFlag(e,t.deploymentConfiguration.condition))})}),this.flagRepo.flags.forEach(t=>{r.some(e=>e===t)||this.connectExperimentToFlag(t,void 0)})}setAddedFlag(e){var t=this.experimentsRepo.experimentForFlag(e);t&&this.connectExperimentToFlag(e,t.deploymentConfiguration.condition)}connectExperimentToFlag(e,t){e.condition=t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});const s=new class{constructor(){this.map={}}addTargetGroup(e){this.map[e.identifier]=e}setTargetGroups(e){this.map={},(e=e||[]).forEach(function(e){this.map[e.identifier]=e},this)}targetGroupWithName(e){return this.map[e]}get targetGroups(){return Object.keys(this.map).map(e=>this.map[e])}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});const s=new class{constructor(){this.store=new Map}has(e){return this.store.has(e.name)}get(e){return this.store.get(e)}set(e){this.store.set(e.name,e)}setIfNotExists(e){this.has(e)||this.set(e)}clear(){this.store.clear()}get items(){return Array.from(this.store.values())}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DynamicPropertiesHandler:()=>function(){return i},defaultDynamicPropertyHandler:()=>function(){return s},setDynamicPropertyHandler:()=>function(e){(i=e)&&(i._isUserDefined=!0)}});const s=(e,t)=>t?t[e]:void 0;let i=s},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e,t,r){this._string=e,this._delimiters=t,this._returnDelim=r,this._position=0}countTokens(){let r=0,s=!1;for(let e=this._position,t=this._string.length;e<t;e++)-1!=this._delimiters.indexOf(this._string.charAt(e))?(this._returnDelim&&r++,s&&(r++,s=!1)):s=!0;return s&&r++,r}hasMoreElements(){return this.hasMoreTokens()}hasMoreTokens(){if(!this._delimiters)return!1;var t=this._string.length;if(this._position<t){if(this._returnDelim)return!0;for(let e=this._position;e<t;e++)if(-1==this._delimiters.indexOf(this._string.charAt(e)))return!0}return!1}nextElement(){return this.nextToken()}nextToken(){if(this._delimiters){let e=this._position;var t=this._string.length;if(e<t){if(this._returnDelim){if(-1!=this._delimiters.indexOf(this._string.charAt(this._position)))return this._string.charAt(this._position++);for(this._position++;this._position<t;this._position++)if(-1!=this._delimiters.indexOf(this._string.charAt(this._position)))return this._string.substr(e,this._position-e);return this._string.substr(e)}for(;e<t&&-1!=this._delimiters.indexOf(this._string.charAt(this._position));)e++;if((this._position=e)<t){for(this._position++;this._position<t;this._position++)if(-1!=this._delimiters.indexOf(this._string.charAt(this._position)))return this._string.substr(e,this._position-e);return this._string.substr(e)}}}}nextTokenWithDelimiters(e){return this._delimiters=e,this.nextToken()}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var t=r(30),s=r.n(t),i=r(7),n=r(1);const o=new class{init(e,t,r,s){var i,n,o,a;this.selfManagedMode=s,this.selfManagedMode||({distinct_id:t,app_release:i,platform:n,api_version:o,lib_version:a}=s=t.getProperties(),s=function(e,t){var r={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r}(s,["distinct_id","app_release","platform","api_version","lib_version"]),this.device=s,this.header={apiKey:"abbf3bd9c6e80eb1e8c0566c35b08748",notifier:{name:"Rollout JavaScript SDK",version:a,url:"undefined"!=typeof window&&window.location&&window.location.href||void 0}},this.networkOptions=r,this.user={distinct_id:t,app_release:i,app_key:e,platform:n},this.app={api_version:o,lib_version:a})}error(e,t){if(!this.selfManagedMode)return this._notify("error",e,t)}_notify(e,t,r){const s={payloadVersion:4,exceptions:[],app:this.app,user:this.user,device:this.device,metaData:{data:{message:t,exception:r.toString()}},severity:e};return r instanceof Error?(s.exceptions.push({errorClass:r.name,message:t+"\n"+r.message+"\n"+r.stack,stacktrace:[]}),s.groupingHash=r.fileName):s.exceptions.push({errorClass:"Error",message:t,stacktrace:[]}),this._send([s])}_send(e){e=Object.assign({events:e},this.header),i.default.debug("Sending bugsnag error report."),e={url:"https://notify.bugsnag.com",data:e,options:this.networkOptions},n.default.getProxy().applyProxyToRequest(e);try{s().post(e.url,e.data,e.options).then(()=>{i.default.debug("Successfully sent error report.")}).catch(e=>{i.default.debug("Failed to send error report",e)})}catch(e){i.default.debug("Failed to send error report.",e)}}}},e=>{"use strict";e.exports=t},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ConfigurationParser:()=>i.default,RoxxParser:()=>s.default});var s=r(16),i=r(32)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(33),i=r(34);const n={DATA_CONTAINER:"data",APP_KEY:"application",EXPERIMENTS:"experiments",TARGET_GROUPS:"targetGroups",SIGNED_DATE:"signed_date"};class o{constructor(e,t,r=!0){if(!e||"object"!=typeof e)throw new Error("ConfigurationParser should be constructed with JSON object. Received "+e);if(!t||"string"!=typeof t)throw new Error("ConfigurationParser should be constructed with app key string. Received "+t);this._json=e,this._appKey=t,this._validateAppKey=r}parse(){var e=this._extractInnerJson(this._json);return this._validateAppKey&&e[n.APP_KEY]!==this._appKey?null:(this._parseExperiments(e[n.EXPERIMENTS]),this._parseTargetGroups(e[n.TARGET_GROUPS]),this._signedDate=new Date(this._json[n.SIGNED_DATE]),this)}experiments(){return this._experiments||[]}targetGroups(){return this._targetGroups||[]}signedDate(){return this._signedDate}_extractInnerJson(e){return JSON.parse(e[n.DATA_CONTAINER])}_parseExperiments(e){this._experiments=new s.default(e).parse()}_parseTargetGroups(e){this._targetGroups=new i.default(e).parse()}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var i=r(9),n=r(10);const o={DEPLOYMENT_CONFIGURATION:"deploymentConfiguration",DEPLOYMENT_CONDITION:"condition",EXPERIMENT_ARCHIVED:"archived",EXPERIMENT_STICKY:"sticky",EXPERIMENT_ID:"_id",EXPERIMENT_NAME:"name",EXPERIMENT_FLAGS:"featureFlags",EXPERIMENT_LABELS:"labels",EXPERIMENT_STICKINESS_PROPERTY:"stickinessProperty"};class s{constructor(e){this._json=e}parse(){if(!this._json||!this._json.length)return[];const s=[];return this._json.forEach(e=>{var t,r;e&&e[o.DEPLOYMENT_CONFIGURATION]&&e[o.EXPERIMENT_ID]&&e[o.EXPERIMENT_NAME]&&e[o.EXPERIMENT_FLAGS]&&(r=e[o.DEPLOYMENT_CONFIGURATION])[o.DEPLOYMENT_CONDITION]&&(t=e[o.EXPERIMENT_LABELS]||[],r=new i.default(r[o.DEPLOYMENT_CONDITION]),s.push(new n.default(e[o.EXPERIMENT_ID],e[o.EXPERIMENT_NAME],!!e[o.EXPERIMENT_ARCHIVED],!!e[o.EXPERIMENT_STICKY],r,e[o.EXPERIMENT_FLAGS],t,e[o.EXPERIMENT_STICKINESS_PROPERTY])))}),s}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(11);const i={TARGET_GROUP_ID:"_id",TARGET_GROUP_CONDITION:"condition"};class n{constructor(e){this._json=e}parse(){if(!this._json||!this._json.length)return[];const t=[];return this._json.forEach(e=>{e&&e[i.TARGET_GROUP_ID]&&e[i.TARGET_GROUP_CONDITION]&&t.push(new s.default(e[i.TARGET_GROUP_ID],e[i.TARGET_GROUP_CONDITION]))}),t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FlagsSetter:()=>s.default});var s=r(24)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CustomProperties:()=>s.default,Experiments:()=>i.default,Flags:()=>n.default,TargetGroups:()=>o.default});var s=r(26),i=r(14),n=r(23),o=r(25)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Actions:()=>s,Manager:()=>i});var s=r(38),i=r(39)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{getMergedContext:()=>function(e,t){return e?Object.assign({},e,t):Object.assign({},t)},getMergedContextWithGlobal:()=>function(e){var t=s.getContext();return e?Object.assign({},t,e):Object.assign({},t)}});var s=r(39)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{getContext:()=>function(){return s},setContext:()=>function(e){s=e}});let s={}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e,t){this.cache=e,this._uuid=t,this.distinct_id=this.generateDistinctId(),this.app_release="0.0",this.distinctIdSetExplicitly=!1}setPlatform(e){this.platform=e}setDistinctId(e){this.distinctIdSetExplicitly=!0,this.distinct_id=e}setAppRelease(e){this.app_release=e}uuid(){return this._uuid()}generateDistinctId(){let e=this.cache.get("distinctId");return e||(e=this.uuid(),this.cache.set("distinctId",e)),e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Client:()=>S,createRoxClient:()=>function(e={}){return P=Object.assign({},P,e),R._dynamicApi=new c.default(e.EntitiesProvider,a.default,R),R}});var t=r(56),s=r(29),i=r(57),n=r(7),o=r(26),a=r(23),u=r(25),l=r(14),c=r(70),d=r(1),h=r(5),p=r(16),f=r(13),g=r(6),y=r(68),m=r(69),_=r(15),v=r(27),b=r(42),E=r.n(b),x=r(58),N=r(65);let P={ClassRegister:t.default};class S{constructor(e=5e3){this.classRegisterer=new P.ClassRegister,this.sendStateDebounceNoCheck=E()(()=>{this._sendState()},e,{maxWait:e,leading:!1,trailing:!0}),this.sendStateDebounced=()=>{this.appKey&&this.sendStateDebounceNoCheck()},this.onConfigurationFetched=this.onConfigurationFetched.bind(this)}get dynamicApi(){return this._dynamicApi}get appKey(){return this.app_key}setKey(e){if(!/^[a-f\d]{24}$/i.test(e))throw Error("invalid rollout apikey");this.app_key=e}setup(t={}){try{this.handleOptions(t),P.DeviceProperties=P.DeviceProperties.create?P.DeviceProperties.create(P):P.DeviceProperties,this.app_release&&P.DeviceProperties.setAppRelease(this.app_release),this.distinct_id&&P.DeviceProperties.setDistinctId(this.distinct_id),this.platform&&P.DeviceProperties.setPlatform(this.platform),this.deviceProperties=P.DeviceProperties,s.default.init(this.appKey,P.DeviceProperties,this.networkOptions,this.selfManagedMode),this.configurationFetcher=new i.default(this.appKey,this.deviceProperties,this.devModeSecret,P,this.embeddedConfiguration,{roxyUrl:this.roxyUrl,selfManagedMode:this.selfManagedMode},this.networkOptions),this.roxyUrl||(this.stateSender=new N.default(this.appKey,this.deviceProperties,this.devModeSecret,this.networkOptions,{selfManagedMode:this.selfManagedMode}),this.disableNetwork||(0,f.setAnalytics)(new y.default(this.appKey,Object.assign({},this.analyticsOptions),P.DeviceProperties,this.networkOptions))),P.getDefaultCustomProperties(this.deviceProperties,this.appKey).map(o.default.setIfNotExists.bind(o.default))}catch(e){n.default.error(t="Oh uh! An error occured during setup.",e),s.default.error(t,e)}return Promise.resolve(this)}handleOptions(e){const t=Object.assign({},P.DefaultSetupOptions,e);if(t.selfManaged&&"object"==typeof t.selfManaged){if(!t.selfManaged.analyticsURL)throw new Error("analyticsURL is required on self managed mode");if(!t.selfManaged.serverURL)throw new Error("serverURL is required on self managed mode");e.selfManaged.configurationURL&&(t.selfManaged.configurationURL=e.selfManaged.configurationURL.endsWith("/")?e.selfManaged.configurationURL:e.selfManaged.configurationURL+"/"),e.selfManaged.stateURL&&(t.selfManaged.stateURL=e.selfManaged.stateURL.endsWith("/")?e.selfManaged.stateURL:e.selfManaged.stateURL+"/"),d.default.setSelfManagedMode(t.selfManaged),(0,_.setDefaultsMode)(!0),this.selfManagedMode=!0}t.configuration&&t.configuration.disableNetwork&&(this.disableNetwork=!0),this.embeddedConfiguration=t.embedded,this.fetchIntervalInSec=t.fetchIntervalInSec,this.disablePushUpdateListener=!!(this.disableNetwork||this.selfManagedMode&&!t.selfManaged.pushUpdateURL)||t.disablePushUpdateListener,this.configurationFetchedHandler=t.configurationFetchedHandler,this.impressionHandler=t.impressionHandler,this.dynamicPropertyRuleHandler=t.dynamicPropertyRuleHandler,this.app_release=t.version,this.distinct_id=t.distinctId,this.devModeSecret=t.devModeSecret,this.platform=t.platform,this.roxyUrl=t.roxy,this.networkOptions={httpAgent:t.httpAgent,httpsAgent:t.httpsAgent},this.analyticsOptions=t.analytics,this.eventSourceImpl=t.eventSourceImpl,(0,f.setHandler)(this.impressionHandler),e.logger&&n.default.setLogger(e.logger),this.dynamicPropertyRuleHandler&&(0,v.setDynamicPropertyHandler)(this.dynamicPropertyRuleHandler)}fetchPeriodically(){if(!this.app_key)return n.default.warn("no app key"),Promise.reject();if(this.fetchIntervalInSec<=0)return Promise.resolve();this.fetchIntervalInSec<30&&(this.fetchIntervalInSec=30);var e=this._fetch({useCache:!1});return this.configurationFetcher.dispatchPeriodically({handler:this.onConfigurationFetched,periodTimeInSec:this.fetchIntervalInSec}),e}fetchCacheOnly(){return this._fetch({useCache:!0,skipNetwork:!0})}fetchWithCacheAndProceed(){return this._fetch({useCache:!0})}fetch(){return this._fetch({useCache:!1})}_fetchFromPush(){return this._fetch({useCache:!1,source:"push"})}sendState(){this._sendState()}_sendState(){this.sendStateDebounceNoCheck.cancel(),this.app_key&&(this.disableNetwork?n.default.debug("send state - disabled network"):this.stateSender&&this.stateSender.send())}_fetch(e={}){if(this.app_key){if(this.configurationFetcher)return this.disableNetwork&&(n.default.debug("fetch - disabling network"),e.skipNetwork=!0),this.configurationFetcher.dispatch({handler:this.onConfigurationFetched,options:e})}else n.default.warn("no app key")}register(e,t){void 0===t&&"object"==typeof e&&null!==e&&(t=e,e=""),n.default.debug(`Registering container '${e}' = `+JSON.stringify(t)),this.classRegisterer.handleContainer(e,t),this.sendStateDebounced()}setCustomProperty(e,t,r){e=new h.default(e,t,r),t=!o.default.has(e),o.default.set(e),t&&this.sendStateDebounced()}unfreeze(r,t){a.default.flags.filter(e=>{if(!e.name||"string"!=typeof r)return!0;const t=e.name.split(".");return 1===t.length&&""===r||t.slice(0,t.length-1).join(".")===r}).forEach(e=>{e.unfreeze(t)})}get metadata(){const t=new p.default;return{targetGroups:u.default.targetGroups.map(e=>({name:e.name,isEnabled:t.evaluateExpression(e.condition)})),experiments:l.default.experiments.map(e=>({name:e.name,isEnabled:"true"===t.evaluateExpression(e.deploymentConfiguration.condition)})),flags:a.default.flags.map(e=>({name:e.name,value:e._peek()}))}}onConfigurationFetched(e){try{e.fetcherStatus!==x.FetcherStatus.ERROR_FETCH_FAILED&&this.startOrStopPushUpdatesListener()}catch(e){n.default.warn("Cound not start or stop push notification listener. exception: "+e)}if(this.configurationFetchedHandler instanceof Function)try{return this.configurationFetchedHandler(e)}catch(e){g.default.invoke(g.ExceptionTrigger.CONFIGURATION_FETCHED_HANDLER,e)}}startOrStopPushUpdatesListener(){!this.disablePushUpdateListener&&(0,_.isEnabled)("rox.internal.pushUpdates")?this.app_key&&!this.pushUpdatesListener&&(this.pushUpdatesListener=new m.default(d.default.get("NOTIFICATIONS_ENDPOINT"),this.app_key,this.eventSourceImpl,this.networkOptions),this.pushUpdatesListener.on("changed",()=>{this._fetchFromPush()})):this.pushUpdatesListener&&(this.pushUpdatesListener.stop(),this.pushUpdatesListener=null)}setUserspaceUnhandledErrorHandler(e){g.default.setHandler(e)}get cacheURL(){if(this.configurationFetcher&&this.configurationFetcher.cacheURL)return this.configurationFetcher.cacheURL;throw new Error("Rox was not initialized. Please call setup() before calling cacheURL()")}}const R=new S},(e,t,r)=>{var _=r(43),v=r(44),b=r(47),E=Math.max,x=Math.min;e.exports=function(s,r,e){var i,n,o,a,u,l,c=0,d=!1,h=!1,t=!0;if("function"!=typeof s)throw new TypeError("Expected a function");function p(e){var t=i,r=n;return i=n=void 0,c=e,a=s.apply(r,t)}function f(e){var t=e-l;return void 0===l||r<=t||t<0||h&&o<=e-c}function g(){var e,t=v();if(f(t))return y(t);u=setTimeout(g,(e=r-(t-l),h?x(e,o-(t-c)):e))}function y(e){return u=void 0,t&&i?p(e):(i=n=void 0,a)}function m(){var e=v(),t=f(e);if(i=arguments,n=this,l=e,t){if(void 0===u)return c=e=l,u=setTimeout(g,r),d?p(e):a;if(h)return clearTimeout(u),u=setTimeout(g,r),p(l)}return void 0===u&&(u=setTimeout(g,r)),a}return r=b(r)||0,_(e)&&(d=!!e.leading,h="maxWait"in e,o=h?E(b(e.maxWait)||0,r):o,t="trailing"in e?!!e.trailing:t),m.cancel=function(){void 0!==u&&clearTimeout(u),i=l=n=u=void(c=0)},m.flush=function(){return void 0===u?a:y(v())},m}},e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},(e,t,r)=>{var s=r(45);e.exports=function(){return s.Date.now()}},(e,t,r)=>{var r=r(46),s="object"==typeof self&&self&&self.Object===Object&&self,r=r||s||Function("return this")();e.exports=r},e=>{var t="object"==typeof window&&window&&window.Object===Object&&window;e.exports=t},(e,t,r)=>{var s=r(48),i=r(43),n=r(50),o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(n(e))return NaN;if(i(e)&&(t="function"==typeof e.valueOf?e.valueOf():e,e=i(t)?t+"":t),"string"!=typeof e)return 0===e?e:+e;e=s(e);var t=a.test(e);return t||u.test(e)?l(e.slice(2),t?2:8):o.test(e)?NaN:+e}},(e,t,r)=>{var s=r(49),i=/^\s+/;e.exports=function(e){return e&&e.slice(0,s(e)+1).replace(i,"")}},e=>{var r=/\s/;e.exports=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t}},(e,t,r)=>{var s=r(51),i=r(55);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==s(e)}},(e,t,r)=>{var s=r(52),i=r(53),n=r(54),o=s?s.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":(o&&o in Object(e)?i:n)(e)}},(e,t,r)=>{r=r(45).Symbol,e.exports=r},(e,t,r)=>{var r=r(52),s=Object.prototype,n=s.hasOwnProperty,o=s.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=n.call(e,a),r=e[a];try{var s=!(e[a]=void 0)}catch(e){}var i=o.call(e);return s&&(t?e[a]=r:delete e[a]),i}},e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var t=r(23),n=r(12);const s={flagsRepository:t.default};class i{constructor(e={}){this.options=Object.assign({},s,e),this._flagsRepository=this.options.flagsRepository,this._namespaceStore=new Set}handleContainer(e,t){if("[object String]"!==Object.prototype.toString.call(e))throw new Error("InvalidNamespace: Namespace must be a string (non-nullable).");var r,s;if(this._namespaceStore.has(e))throw new Error(`InvalidNamespace: A namespace must be unique. A container with the given namespace ('${e}') has already been registered.`);this._namespaceStore.add(e);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r=e?e+"."+i:i,(s=t[i])instanceof n.default&&this._flagsRepository.addFlag(r,s))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var s=r(61),i=r(59),n=r(32),o=r(24),a=r(29),u=r(15),t=r(1),l=r(25),c=r(14),d=r(23),h=r(7),p=r(58),f=r(64);const g=t.default.get("CLIENT_DATA_CACHE_KEY");let y=!1;const m=class{constructor(e,t,r,s,i,n,o){this.cache=s.RoxCache,this.crypto=s.RoxCrypto,this.embdeddedJSON=this.fetchFromEmbedded(i),this.appKey=e,this.deviceProperties=t,this.devModeSecret=r,this.options=n||{},this.networkOptions=o,this.lastResponse=null}runHandler(e,t){if(t.errorDetails&&a.default.error("Configuration fetcher returned with "+t.fetcherStatus,t.errorDetails),e instanceof Function)try{e(t)}catch(e){}}dispatch({handler:e,options:t}){h.default.debug("dispatch();");const r=[];if(t.useCache){if(this.embdeddedJSON){if(!this.verifyPayload(this.embdeddedJSON))throw new Error("The embdeddedJSON was corrupted or its authenticity cannot be securely verified.");var s=this.parsePayload(this.embdeddedJSON);s&&r.push({payload:this.embdeddedJSON,parser:s,status:p.FetcherStatus.APPLIED_FROM_EMBEDDED})}if(s=this.fetchFromCache()){if(!this.verifyPayload(s))throw new Error("The cachedPayload was corrupted or its authenticity cannot be securely verified.");var i=this.parsePayload(s);i&&r.push({payload:s,parser:i,status:p.FetcherStatus.APPLIED_FROM_CACHE})}}if(0<r.length){const n=r.reduce((e,t)=>e&&e.parser.signedDate()>t.parser.signedDate()?e:t,null);(!this.lastApplied||this.lastApplied.signedDate()<n.parser.signedDate())&&(this.lastResponse=n.payload,this.apply(n.parser,n.status,!1,e,n.payload))}if(!t.skipNetwork){if(!this.shouldSkipFetch(t.source))return this._dispatch({handler:e,storeInCache:!0});h.default.debug("Skipping fetch - kill switch")}}shouldSkipFetch(e){var e="push"===e,t=(0,u.getNumber)("rox.internal.throttleFetchInSeconds");if(0<t&&(!e||(0,u.isEnabled)("rox.internal.considerThrottleInPush"))){if(e=+Date.now(),this.lastFetchTryTime&&e<this.lastFetchTryTime+1e3*t)return!0;this.lastFetchTryTime=e}return!1}dispatchPeriodically({handler:e,periodTimeInSec:t}){if(y)return h.default.debug("Dispatch Periodically already running"),Promise.resolve();y=!0,h.default.debug("Dispatch Periodically"),setInterval(()=>{this._dispatch({handler:e})},1e3*t)}_dispatch({handler:s,storeInCache:i}){return this.fetchFromNetwork().then(e=>{var t=this.isNewResponse(e);const r=this.process(e,p.FetcherStatus.APPLIED_FROM_NETWORK,t,s);return r.then(()=>{i&&this.storeInCache(e),this.lastResponse=e})}).catch(e=>{this.runHandler(s,new p.FetcherResults(p.FetcherStatus.ERROR_FETCH_FAILED,null,!1,e))})}fetchFromNetwork(){h.default.debug("fetch from network for appKey "+this.appKey);var e=(0,i.buildRequestConfiguration)({appKey:this.appKey,deviceProperties:this.deviceProperties,devModeSecret:this.devModeSecret});return this.rc=e,this.options.roxyUrl?(0,s.fetchRemoteConfigurationWithRoxy)(e,this.options.roxyUrl,this.networkOptions):(0,s.fetchRemoteConfiguration)(e,this.networkOptions,this.options)}fetchFromCache(){h.default.debug("fetch From Cache");let e=this.cache.get(this.cacheKey()),t;if(e=e||this.cache.get(g)){try{t=JSON.parse(e)}catch(e){h.default.warn(`Configuration retrieved from cache, but is corrupted. Aborting. (Error: ${e})`)}if(t&&t.constructor===Object)return h.default.debug("Parsed cached = "+JSON.stringify(t)),t}}cacheKey(){return g+"-"+this.appKey}fetchFromEmbedded(e){let t;if(e){try{t=JSON.parse(e)}catch(e){h.default.warn("Received embdedded configuration, but it is corrupted. Aborting. Error: ",e)}if(t&&t.constructor===Object)return h.default.debug("Parsed embedded = "+JSON.stringify(t)),t}if(f.default&&"object"==typeof f.default)return f.default}storeInCache(e){h.default.debug("Store in cache response = "+JSON.stringify(e)),this.cache.set(this.cacheKey(),JSON.stringify(e))}process(e,t,r,s){if(!e)return Promise.reject("Empty configuration");if(!this.verifyPayload(e))throw new Error("The payload has corrupted or its authenticity cannot be securely verified.");var i=this.parsePayload(e);return i?this.apply(i,t,r,s,e):Promise.reject("Failed to parse configuration")}apply(r,s,i,n,o){if(r)return this.calculatePayload(r),this.lastApplied=r,new Promise(e=>{var t=new p.FetcherResults(s,r.signedDate(),i,void 0,o);this.runHandler(n,t),e()})}parsePayload(e){var t=!this.options.roxyUrl;const r=new n.default(e,this.appKey,t);return r.parse()?r:(h.default.debug(`failed to parse payload. response = ${JSON.stringify(e)} deviceProps = ${this.deviceProperties} app_key = `+this.appKey),null)}verifyPayload(e){var{signature_v0:e,data:t}=e;return!(!this.options.roxyUrl&&!this.options.selfManagedMode)||this.crypto.verify(t,e)}calculatePayload(e){if(e)return l.default.setTargetGroups(e.targetGroups()),c.default.setExperiments(e.experiments()),new o.default(d.default,c.default).prepareFlagsWithExperiments(),e}isNewResponse(e){return JSON.stringify(this.lastResponse)!==JSON.stringify(e)}get cacheURL(){return this.rc&&this.rc.cache_url}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FetcherResults:()=>i,FetcherStatus:()=>s});const s={APPLIED_FROM_EMBEDDED:"APPLIED_FROM_EMBEDDED",APPLIED_FROM_CACHE:"APPLIED_FROM_CACHE",APPLIED_FROM_NETWORK:"APPLIED_FROM_NETWORK",ERROR_FETCH_FAILED:"ERROR_FETCH_FAILED"};class i{constructor(e,t,r,s,i){this.fetcherStatus=e,this.creationDate=t,this.hasChanges=r,this.errorDetails=s,this.clientData=i}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{buildRequestConfiguration:()=>s});var i=r(1),n=r(60);const s=function({appKey:e,deviceProperties:t,devModeSecret:r}){const s=t.getProperties();return s.app_key=e,s.buid=n.generateBuid(s),s.buid_generators_list=n.BUID_GENERATOR_LIST.join(","),s.relative_url=e+"/"+s.buid,s.cache_url=""+i.default.get("CD_S3_ENDPOINT")+s.relative_url,s.devModeSecret=r,s}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BUID_GENERATOR_LIST:()=>i,STATE_GENERATOR_LIST:()=>n,generateBuid:()=>function(e={},t=i){return o(e,t)},generateStateMd5:()=>function(e={},t=n){return o(e,t)}});var t=r(19),s=r.n(t);const i=["lib_version","api_version","platform","app_key","customSigningCertificate"],n=["platform","app_key","feature_flags","custom_properties","devModeSecret"];function o(r={},e=[]){const t=e.map(e=>{var t=r[e];return t?t.constructor===Object||t.constructor===Array?JSON.stringify(t):t:e});return s()(t.join("|"))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{fetchRemoteConfiguration:()=>function(t,r,e={}){var s=t.cache_url+"?distinct_id="+t.distinct_id;return e.selfManagedMode&&!o.default.get("CD_S3_ENDPOINT")?(e=(0,i.buildAPIURL)(t),a((0,n.fetchFromAPI)(e.url,e.body,r))):a((0,n.fetchFromCDN)(s,r).catch(()=>{var e=(0,i.buildAPIURL)(t);return(0,n.fetchFromAPI)(e.url,e.body,r)}))},fetchRemoteConfigurationWithRoxy:()=>function(e,t,r){return e=(0,i.buildAPIURL)(e,t),a((0,n.fetchFromRoxyAPI)(e.url,r))}});var i=r(62),n=r(63),s=r(7),o=r(1);function a(e){return e.catch(e=>{throw e.message="Unable to fetch rox configuration!\n"+e.message,s.default.error(e),e})}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{buildAPIURL:()=>s,buildSetStateAPIURL:()=>n,buildSetStateS3URL:()=>i});var o=r(1);const s=function(e,t=null){const{app_key:r,buid:s,relative_url:i}=e,n=function(e,t){var r={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r}(e,["app_key","buid","relative_url"]);return n.cache_miss_relative_url=i,e=o.default.get("CD_API_ENDPOINT")+`/${r}/`+s,{url:t||e,body:n}},i=function(e){return""+o.default.get("SS_S3_ENDPOINT")+e.app_key+"/"+e.md5},n=function(e,t=null){return{url:t||""+o.default.get("SS_API_ENDPOINT")+e.app_key+"/"+e.md5,body:{platform:e.platform,feature_flags:e.feature_flags,custom_properties:e.custom_properties,devModeSecret:e.devModeSecret}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{fetchFromAPI:()=>function(e,t,r){return e={url:e,data:t,options:r},n.default.getProxy().applyProxyToRequest(e),s().post(e.url,e.data,e.options).then(o)},fetchFromCDN:()=>function(e,t){return e={url:e,options:t},n.default.getProxy().applyProxyToRequest(e),s().get(e.url,e.options).then(({data:e,status:t})=>{if(200===t&&e&&"object"==typeof e){if(404!==e.result)return i.default.debug("succeed fetch from CDN"),e;{i.default.debug("succeed fetch from CDN, but it was missing");const r=new Error("missing from CDN");return r.missing=!0,Promise.reject(r)}}}).catch(e=>{if(e.missing||e.response&&(404==e.response.status||403==e.response.status))return Promise.reject();i.default.debug("Unexpected error calling get configuration, status code returned different from 403 or 404. error: "+e)})},fetchFromRoxyAPI:()=>function(e,t){return e={url:e,options:t},n.default.getProxy().applyProxyToRequest(e),s().get(e.url,e.options).then(o)},setStateToAPI:()=>function(e,t,r){return e={url:e,data:t,options:r},n.default.getProxy().applyProxyToRequest(e),s().post(e.url,e.data,e.options).then(({status:e})=>{if(200!==e)return Promise.reject(new Error("Unexpected response from ROX API"));i.default.debug("succeed setState from API")})},stateFromCDN:()=>function(e,t){return e={url:e,options:t},n.default.getProxy().applyProxyToRequest(e),s().get(e.url,e.options).then(({data:e,status:t})=>{if(200===t&&e&&"object"==typeof e){if(404===e.result){i.default.debug("succeed setState from CDN, but it was missing");const r=new Error("missing from CDN");return r.missing=!0,Promise.reject(r)}if(200===e.result)return void i.default.debug("succeed setState from CDN")}i.default.debug("succeed setState, but with unexpected response")}).catch(e=>{if(e.missing||e.response&&(404==e.response.status||403==e.response.status))return Promise.reject();i.default.debug("Unexpected error calling setState, status code returned different from 403 or 404. error: "+e)})}});var t=r(30),s=r.n(t),i=r(7),n=r(1);function o(e){var{data:e,status:t}=e;return 200===t&&e&&"object"==typeof e?(i.default.debug("succeed fetch from API"),e):Promise.reject(new Error("Unexpected response from ROX API"))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let s,i;try{i=$__ROX_EMBEDDED_CONTENT}catch(e){}if(i&&"string"==typeof i)try{i=JSON.parse(i)}catch(e){i=void 0}const n=s=i&&i.constructor===Object&&i.signed_date?i:s},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(67),i=r(60),n=r(7);const o=new(r(66).default),a=class{constructor(e,t,r,s,i){this.appKey=e,this.deviceProperties=t,this.devModeSecret=r,this.networkOptions=s,this.options=i}send(){n.default.debug("check for cached state for appKey "+this.appKey);var e=this.buildSetState();try{(0,s.sendStateNetwork)(e,this.networkOptions,this.options).catch(e=>{n.default.error("failed to send state (promise)",e)})}catch(e){n.default.error("failed to send state",e)}}sortItemsByName(e){return e.sort((e,t)=>e.name>t.name?-1:1)}buildSetState(){const e=this.deviceProperties.getProperties();return e.app_key=this.appKey,e.feature_flags=this.sortItemsByName(o.featureFlags),e.custom_properties=this.sortItemsByName(o.customProperties),e.devModeSecret=this.devModeSecret,e.md5=i.generateStateMd5(e),e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(23),i=r(26);class n{get customProperties(){const t=[];return i.default.items.forEach(e=>{t.push({name:e.name,type:e.type,externalType:e.externalType})}),t}get featureFlags(){const t=[];return s.default.items.forEach(e=>{t.push({name:e.name,defaultValue:e.defaultValue,options:e._options})}),t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{sendStateNetwork:()=>function(t,r,e={}){var s=(0,n.buildSetStateS3URL)(t);return e.selfManagedMode&&!o.default.get("SS_S3_ENDPOINT")?(e=(0,n.buildSetStateAPIURL)(t),a((0,i.setStateToAPI)(e.url,e.body,r))):a((0,i.stateFromCDN)(s,r).catch(()=>{var e=(0,n.buildSetStateAPIURL)(t);return(0,i.setStateToAPI)(e.url,e.body,r)}))}});var i=r(63),n=r(62),o=r(1);function a(e){return e.catch(e=>{throw e.message="Unable to send state!\n"+e.message,e})}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var a=r(1),t=r(30),u=r.n(t);const l=e=>{setTimeout(e,5)},c=()=>{},s=class{constructor(e,t,r,s){if(t=t||{},this.queue=[],this.writeKey=e,this.host=t.host||a.default.get("ANALYTICS_ENDPOINT"),this.timeout=t.timeout||!1,this.flushAt=Math.max(t.flushAt||20,1),this.flushInterval=t.flushInterval||1e4,this.flushed=!1,this.version=r.getProperties().lib_version||"0.0",void 0===r.getProperties().platform)throw new Error("Platform must be provided");this.platform=r.getProperties().platform||"",this.networkOptions=s,Object.defineProperty(this,"enable",{configurable:!1,writable:!1,enumerable:!0,value:"boolean"!=typeof t.enable||t.enable})}identify(e,t){return this.enqueue("identify",e,t),this}group(e,t){return this.enqueue("group",e,t),this}track(e,t){return this.enqueue("track",e,t),this}page(e,t){return this.enqueue("page",e,t),this}screen(e,t){return this.enqueue("screen",e,t),this}alias(e,t){return this.enqueue("alias",e,t),this}enqueue(e,t,r){return r=r||c,this.enable?(t=Object.assign({},t),this.queue.push({message:t,callback:r}),this.flushed?(this.queue.length>=this.flushAt&&this.flush(),void(this.flushInterval&&!this.timer&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval)))):(this.flushed=!0,void this.flush())):l(r)}flush(e){if(e=e||c,!this.enable)return l(e);if(this.timer&&(clearTimeout(this.timer),this.timer=null),!this.queue.length)return l(e);const t=this.queue.splice(0,this.flushAt),r=t.map(e=>e.callback);var s=t.map(e=>e.message);const i={analyticsVersion:"1.0.0",sdkVersion:this.version,time:(new Date).getTime(),platform:this.platform,rolloutKey:this.writeKey,events:s},n=t=>{r.forEach(e=>e(t)),e(t,i)},o=(s=this.host+"/impression/"+this.writeKey,{httpsAgent:this.networkOptions.httpsAgent,httpAgent:this.networkOptions.httpAgent});this.timeout&&(o.timeout=this.timeout),s={url:s,data:i,options:o},a.default.getProxy().applyProxyToRequest(s),u().post(s.url,s.data,s.options).then(()=>n()).catch(e=>{var t;if(e.response)return t=new Error(e.response.statusText),n(t);n(e)})}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var i=r(7),n=r(1);const o="object"==typeof window&&window.EventSource;class s{constructor(e,t,r,s){e=""+e+(e.endsWith("/")?"":"/")+t,i.default.info("Starting push notification listener to "+e),t={url:e,options:s},n.default.getProxy().applyProxyToSseRequest(t),r?this.eventSource=new r(t.url,t.options):o&&(this.eventSource=new o(t.url))}on(e,t){this.eventSource&&this.eventSource.addEventListener(e,e=>{try{t(e)}catch(e){}})}stop(){this.eventSource&&this.eventSource.close()}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var l=r(12);class s{constructor(e,t,r){this.entityProvider=e,this.flagRepository=t,this.client=r}genericValue(e,t,r,s,i=l.FlagTypes.string,n=this.entityProvider.createString,o=l.default._normalizeString){if("string"!=typeof e)throw new Error("DynamicApi error - name must be a string");if(typeof t!==i)throw new Error(`DynamicApi default value must be of ${i} type. Received '${t}'`);let a=this.flagRepository.flagWithName(e);a||(a=n(t,r),this.flagRepository.addFlag(e,a),this.client.sendStateDebounced()),i={alternativeDefaultValue:t.toString()},a.getInternalValue(i,s);const u=o(i.result.value);return i.result.isFreezed||i.result.isOverride||a._flagImpression(u.toString(),i.result.usedContext),u}isEnabled(e,t,r){return this.genericValue(e,t,null,r,l.FlagTypes.boolean,this.entityProvider.createFlag,l.default._normalizeBoolean)}value(e,t,r,s){return Array.isArray(r)||(s=r,r=null),this.genericValue(e,t,r,s)}getNumber(e,t,r,s){return Array.isArray(r)||(s=r,r=null),this.genericValue(e,t,r,s,l.FlagTypes.number,this.entityProvider.createNumber,l.default._normalizeNumber)}}}],s={},f.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return f.d(t,{a:t}),t},f.d=(e,t)=>{for(var r in t)f.o(t,r)&&!f.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},f.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),f.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},g={},(()=>{"use strict";f.r(g),f.d(g,{Client:()=>a.Client,Config:()=>u.default,ConfigurationParser:()=>h.default,Context:()=>i,DeviceProperties:()=>n.default,DynamicApi:()=>d.default,Entities:()=>s,Experiments:()=>c.default,Flags:()=>l.default,FlagsSetter:()=>p.default,Parsers:()=>r,Repositories:()=>t,RoxLogger:()=>o.default,Setters:()=>e,createRoxClient:()=>a.createRoxClient});var e=f(35),t=f(36),r=f(31),s=f(4),i=f(37),n=f(40),o=f(7),a=f(41),u=f(1),l=f(23),c=f(14),d=f(70),h=f(32),p=f(24)})(),g;function f(e){var t=s[e];return void 0===t&&(t=s[e]={exports:{}},r[e](t,t.exports,f)),t.exports}var r,s,g});
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("axios")):"function"==typeof define&&define.amd?define(["axios"],t):"object"==typeof exports?exports.Rox=t(require("axios")):e.Rox=t(e.axios)}(self,t=>{return r=[,(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>u});var s=r(2);const i="x-api.rollout.io";let n=new s.default;function o(e){let t=i;return{API_HOST:t=e?""+e+i:t,CD_API_ENDPOINT:`https://${t}/device/get_configuration`,CD_S3_ENDPOINT:"https://conf.rollout.io/",SS_API_ENDPOINT:`https://${t}/device/update_state_store/`,SS_S3_ENDPOINT:"https://statestore.rollout.io/",CLIENT_DATA_CACHE_KEY:"client_data",NOTIFICATIONS_ENDPOINT:"https://push.rollout.io/sse",ANALYTICS_ENDPOINT:"https://analytic.rollout.io"}}let a=Object.assign({},o());const u={get:e=>a[e],set:(e,t)=>{a[e]=t},setActive:function(e){a=Object.assign({},e)},setProxy:function(e){n=new s.default(e)},getProxy:()=>n,setHosting:function(e){"eu"===e&&(a=Object.assign({},o("eu-")))},setSelfManagedMode:function(e){var t,r,s,i;a=Object.assign({},o(),({analyticsURL:e,serverURL:t,pushUpdateURL:r,configurationURL:s,stateURL:i}=e,{CD_API_ENDPOINT:t+"/device/get_configuration",SS_API_ENDPOINT:t+"/device/update_state_store/",CLIENT_DATA_CACHE_KEY:"client_data",ANALYTICS_ENDPOINT:e,NOTIFICATIONS_ENDPOINT:r+"/sse",CD_S3_ENDPOINT:s,SS_S3_ENDPOINT:i}))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(3);const i="roxTargetUrl",n="roxAuth";class o{constructor(e){this._proxyUrl="",this._proxyAuthHeader="",this._proxySettings=!1,e&&(this._proxySettings=Object.assign({},e),this._proxyUrl=this._proxySettings.protocol+"://"+this._proxySettings.host+(this._proxySettings.port?":"+this._proxySettings.port:""),this._proxySettings.auth&&this._proxySettings.auth.username&&this._proxySettings.auth.password&&(this._proxyAuthHeader="Basic "+(0,s.encode)(this._proxySettings.auth.username+":"+this._proxySettings.auth.password),this._proxyAuthHeaderEncoded=encodeURIComponent(this._proxyAuthHeader)))}applyProxyToRequest(e){if(this._proxySettings){e.options=e.options?Object.assign({},e.options):{};const t=e.options;t.params=t.params||{},t.params[i]=e.url,this._proxyAuthHeader&&(t.params[n]=this._proxyAuthHeader),e.url=this._proxyUrl}}applyProxyToSseRequest(e){this._proxySettings&&(e.url=`${this._proxyUrl}?${i}=`+encodeURIComponent(e.url),this._proxyAuthHeaderEncoded&&(e.url=`${e.url}&${n}=`+this._proxyAuthHeaderEncoded))}get proxyUrl(){return this._proxyUrl}}},(M,e,t)=>{"use strict";t.r(e),t.d(e,{Base64:()=>H,VERSION:()=>s,atob:()=>R,atobPolyfill:()=>S,btoa:()=>g,btoaPolyfill:()=>f,btou:()=>P,decode:()=>I,encode:()=>x,encodeURI:()=>N,encodeURL:()=>N,extendBuiltins:()=>U,extendString:()=>D,extendUint8Array:()=>F,fromBase64:()=>I,fromUint8Array:()=>m,isValid:()=>w,toBase64:()=>x,toUint8Array:()=>A,utob:()=>b,version:()=>r});const r="3.7.2",s=r;var t="function"==typeof atob,e="function"==typeof btoa,i="function"==typeof Buffer;const n="function"==typeof TextDecoder?new TextDecoder:void 0,o="function"==typeof TextEncoder?new TextEncoder:void 0,a=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),u=(e=>{let r={};return e.forEach((e,t)=>r[e]=t),r})(a),l=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),d="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=e=>e)=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),h=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),p=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),f=t=>{let r,s,i,n,o="";var e=t.length%3;for(let e=0;e<t.length;){if(255<(s=t.charCodeAt(e++))||255<(i=t.charCodeAt(e++))||255<(n=t.charCodeAt(e++)))throw new TypeError("invalid character found");r=s<<16|i<<8|n,o+=a[r>>18&63]+a[r>>12&63]+a[r>>6&63]+a[63&r]}return e?o.slice(0,e-3)+"===".substring(e):o},g=e?e=>btoa(e):i?e=>Buffer.from(e,"binary").toString("base64"):f,y=i?e=>Buffer.from(e).toString("base64"):r=>{let s=[];for(let e=0,t=r.length;e<t;e+=4096)s.push(c.apply(null,r.subarray(e,e+4096)));return g(s.join(""))},m=(e,t=!1)=>t?h(y(e)):y(e),_=e=>{var t;return e.length<2?(t=e.charCodeAt(0))<128?e:t<2048?c(192|t>>>6)+c(128|63&t):c(224|t>>>12&15)+c(128|t>>>6&63)+c(128|63&t):(t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320),c(240|t>>>18&7)+c(128|t>>>12&63)+c(128|t>>>6&63)+c(128|63&t))},v=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,b=e=>e.replace(v,_),E=i?e=>Buffer.from(e,"utf8").toString("base64"):o?e=>y(o.encode(e)):e=>g(b(e)),x=(e,t=!1)=>t?h(E(e)):E(e),N=e=>x(e,!0),k=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,L=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return c(55296+(t>>>10))+c(56320+(1023&t));case 3:return c((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return c((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},P=e=>e.replace(k,L),S=t=>{if(t=t.replace(/\s+/g,""),!l.test(t))throw new TypeError("malformed base64.");t+="==".slice(2-(3&t.length));let r,s="",i,n;for(let e=0;e<t.length;)r=u[t.charAt(e++)]<<18|u[t.charAt(e++)]<<12|(i=u[t.charAt(e++)])<<6|(n=u[t.charAt(e++)]),s+=64===i?c(r>>16&255):64===n?c(r>>16&255,r>>8&255):c(r>>16&255,r>>8&255,255&r);return s},R=t?e=>atob(p(e)):i?e=>Buffer.from(e,"base64").toString("binary"):S,T=i?e=>d(Buffer.from(e,"base64")):e=>d(R(e),e=>e.charCodeAt(0)),A=e=>T(O(e)),j=i?e=>Buffer.from(e,"base64").toString("utf8"):n?e=>n.decode(T(e)):e=>P(R(e)),O=e=>p(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),I=e=>j(O(e)),w=e=>"string"==typeof e&&(e=e.replace(/\s+/g,"").replace(/={0,2}$/,""),!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)),C=e=>({value:e,enumerable:!1,writable:!0,configurable:!0}),D=function(){var e=(e,t)=>Object.defineProperty(String.prototype,e,C(t));e("fromBase64",function(){return I(this)}),e("toBase64",function(e){return x(this,e)}),e("toBase64URI",function(){return x(this,!0)}),e("toBase64URL",function(){return x(this,!0)}),e("toUint8Array",function(){return A(this)})},F=function(){var e=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,C(t));e("toBase64",function(e){return m(this,e)}),e("toBase64URI",function(){return m(this,!0)}),e("toBase64URL",function(){return m(this,!0)})},U=()=>{D(),F()},H={version:r,VERSION:s,atob:R,atobPolyfill:S,btoa:g,btoaPolyfill:f,fromBase64:I,toBase64:x,encode:x,encodeURI:N,encodeURL:N,utob:b,btou:P,decode:I,isValid:w,fromUint8Array:m,toUint8Array:A,extendString:D,extendUint8Array:F,extendBuiltins:U}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CallContextTypes:()=>u.callContextTypes,CustomProperty:()=>s.default,DeploymentConfiguration:()=>n.default,DeviceProperty:()=>i.default,Experiment:()=>o.default,FlagTypes:()=>u.FlagTypes,RoxStringBase:()=>u.default,TargetGroup:()=>a.default});var s=r(5),i=r(8),n=r(9),o=r(10),a=r(11),u=r(12)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(6);class i{constructor(e,t,r){if(void 0===e||""===e)throw new Error("Custom property must be initialized with a name.");if(this._name=e,"function"==typeof r){if(1<r.length)throw new Error("Dynamic value of a custom property should be a function with maximum 1 argument");r.isDynamic=!0,this._value=r}else{if(r&&r.constructor!==t&&r.constructor!==Function)throw new Error(`Custom property initialized with an invalid type / value combination. (Type: ${t}, Value: ${r})`);this._value=()=>r}this._type=t}get type(){return this._type.name}get externalType(){return this._type.name}get name(){return this._name}getValue(e={}){if(this._value&&this._value.isDynamic)try{return this._value(e)}catch(e){throw e.isUserError=!0,e.trigger=s.ExceptionTrigger.CUSTOM_PROPERTY_GENERATOR,e}return this._value(e)}get value(){return this._value()}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ExceptionTrigger:()=>i,default:()=>n});var s=r(7);const i={DYNAMIC_PROPERTIES_RULE:"DYNAMIC_PROPERTIES_RULE",CONFIGURATION_FETCHED_HANDLER:"CONFIGURATION_FETCHED_HANDLER",IMPRESSION_HANDLER:"IMPRESSION_HANDLER",CUSTOM_PROPERTY_GENERATOR:"CUSTOM_PROPERTY_GENERATOR"},n=new class{invoke(e,t){if(this.userUnhandledErrorHandler)try{this.userUnhandledErrorHandler(e,t)}catch(e){s.default.error("User Unhandled Error Handler itself threw an exception. original exception:"+t,e)}else s.default.error("User Unhandled Error Occured, no fallback handler was set, exception ignored.",t)}setHandler(e){e instanceof Function?this.userUnhandledErrorHandler=e:s.default.warn("UserspaceUnhandledErrorHandler must be a function. default will be used.")}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});const s={debug:0,info:1,warn:2,error:3};let i="error",n=new class{constructor(){this.debug=(e,...t)=>{s[i]<=s.debug&&console&&console.log(e,...t)},this.info=(e,...t)=>{s[i]<=s.info&&console&&console.info(e,...t)},this.warn=(e,...t)=>{s[i]<=s.warn&&console&&console.warn(e,...t)},this.error=(e,...t)=>{console&&console.error(e,...t)},this.setVerboseMode=e=>{"verbose"===e?(i="debug",this.debug("Active verbose mode")):i="error"},this.setLogger=e=>{n=e}}};const o=n},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s extends r(5).default{get name(){return"rox."+super.name}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e){this.condition=e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e,t,r,s,i,n,o,a){this.identifier=e,this.name=t,this.archived=r,this.sticky=s,this.deploymentConfiguration=i,this.flags=n,this.labels=o,this.stickinessProperty=a}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e,t){this.identifier=e,this.condition=t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FlagTypes:()=>n,callContextTypes:()=>i,default:()=>o});var s=r(13);const i={frozenOrCalc:"frozenValueOrOneTimeEval",oneTimeCalc:"oneTimeEval",default:"useFrozen"},n={boolean:"boolean",number:"number",string:"string"};class o{constructor(e,t,r){if(this._type=r,r=this._validateDefault(e),Array.isArray(t))this._validateOptions(t),this._options=t.map(e=>e.toString());else{if(null!=t)throw new Error("RoxStringBase wrong variations type");this._options=[]}-1===this._options.indexOf(r)&&this._options.push(r),this._value=this._defaultValue=r,this._frozen=!1,this._freezable=!0}_validateDefault(e){if(typeof e!==this._type)throw new Error(`RoxStringBase default value must be of ${this._type} type. Received '${e}'`);return e.toString()}_validateOptions(e){var t=new Error(`RoxStringBase options must be a non-empty array of ${this._type}. Received '${e}'`);if(!e.every(e=>typeof e===this._type))throw t}get defaultValue(){return this._defaultValue}get overridenValue(){if(this.overrider.hasOverride(this.name))return this.overrider.getOverride(this.name)}get overrider(){throw new Error("Not implemented")}getInternalValue(e,t){throw Error("not implemented")}set name(e){this._name=e}get name(){return this._name}_getNameDetails(){if(this.name){const e=this.name.split(".");return{name:e.pop(),namespace:e.join(".")||"default"}}}dump(){var e={type:i.frozenOrCalc};return this.getInternalValue(e),{name:this.name,type:this._type,nameDetails:this._getNameDetails(),options:[...this._options],defaultValue:this.defaultValue,originalValue:this._originalValue(),overridingValue:this.overridenValue,value:e.result.value}}getActiveValue(e,t){throw new Error("Not implemented")}_originalValue(){var e={type:i.frozenOrCalc};return this.getActiveValue(e),e.result.value}_flagImpression(e,t){(0,s.invokeImpression)(e,this,t)}static _normalizeString(e){return e}static _normalizeNumber(e){return Number(e)}static _normalizeBoolean(e){return"boolean"==typeof e?e:"true"===e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{invokeImpression:()=>function(t,r,s){var i=l.default.experimentForFlag(r);try{if(p&&(0,u.isEnabled)("rox.internal.analytics")){var n=i&&i.stickinessProperty;let e=n&&c.default.get(n);var o=(e=e||c.default.get("rox.distinct_id"))?e.getValue(s):"";p.track({flag:r.name,value:t,distinctId:o,type:"IMPRESSION",time:(new Date).getTime()})}}catch(e){a.default.error("Failed to send analytics",e)}if("function"==typeof h){n=!!i;try{h({name:r.name,value:t,targeting:n},s)}catch(e){d.default.invoke(d.ExceptionTrigger.IMPRESSION_HANDLER,e)}}},setAnalytics:()=>function(e){p=e},setHandler:()=>function(e){h=e}});var a=r(7),u=r(15),l=r(14),c=r(26),d=r(6);let h=null,p=null},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});const s=new class{constructor(){this.map={}}setExperiments(e){this.map={},(e=e||[]).forEach(function(e){this.map[e.identifier]=e},this)}experimentWithName(e){return this.map[e]}get experiments(){return Object.keys(this.map).map(e=>this.map[e])}experimentForFlagName(t){return this.experiments.find(e=>e.flags&&e.flags.some(e=>e.name===t))}experimentForFlag(e){return this.experimentForFlagName(e.name)}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{getNumber:()=>function(e){return e=a(e),parseInt(e)||0},isEnabled:()=>function(e){return"boolean"==typeof(e=a(e))?e:"true"===e},setDefaultsMode:()=>function(e){n=e},value:()=>a});var s=r(16),i=r(14);let n=!1;const o={"rox.internal.pushUpdates":"true","rox.internal.considerThrottleInPush":"false","rox.internal.throttleFetchInSeconds":"0","rox.internal.analytics":"true"};function a(e){return n&&Object.prototype.hasOwnProperty.call(o,e)?o[e]:(e=i.default.experimentForFlagName(e))&&e.deploymentConfiguration?(new s.default).evaluateExpression(e.deploymentConfiguration.condition):""}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var g=r(17),y=r(29),m=r(7),_=r(18),v=r(6);class s{constructor(e){this._tokenizer=new g.RoxxTokenizer,this._cache=e||{}}_argsArrayForOperator(e,t){const r=[];var s=e.length;for(let e=0;e<s;e++){var i=t.pop();r.push(i)}return r}_modifyArgsHook({operator:e,args:t,context:r,callContext:s}){let i=t;return r&&_.operatorsWithContext.includes(e)&&(i=[...t,r]),s?[...i,s]:i}compileExpression(e){let t=this._cache[e];return t||(t=this._tokenizer.tokenize(e).reverse(),this._cache[e]=t),t}evaluateExpression(t,r={},s={},i){const n=[];var o=this.compileExpression(t);let a=void 0;var u=o.length;try{for(let e=0;e<u;e++){var l=o[e];if(l.type==g.RoxxTokenTypeRand)n.push(l.value);else{if(l.type!=g.RoxxTokenTypeRator){n.push(void 0);break}{const f=_[l.value];var c=this._argsArrayForOperator(f,n),c=this._modifyArgsHook({operator:f,args:c,context:s,callContext:r}),d=f.apply(this,c),h=(n.push(d),`${l.value}(${JSON.stringify(c)}) => `+d);i&&i.push(h),m.default.debug("Roxx: "+h)}}}a=n.pop()}catch(e){var p="Oh uh! An error occured during Roxx evaluation. "+t;e.isUserError?v.default.invoke(e.trigger,e):y.default.error(p,e),m.default.error(p,e),a=!1}finally{return a}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RoxxTokenTypeRand:()=>a,RoxxTokenTypeRator:()=>i,RoxxTokenizer:()=>u});var n=r(28),t=r(18);const s=Object.keys(t),o='{}[]():, \t\r\n"',i="operator",a="operand";class u{constructor(){this.tokenArray=[],this.arrayAccumulator=void 0,this.dictionaryAccumulator=void 0,this.dictKey=void 0}_stringToRoxx(e){return s.includes(e)?{type:i,value:e}:"true"==e?{type:a,value:!0}:"false"==e?{type:a,value:!1}:"undefined"==e?{type:a,value:void 0}:'"'==e.charAt(0)&&'"'==e.charAt(e.length-1)?{type:a,value:e.substr(1,e.length-2)}:isNaN(e)?{type:"UNKNOWN"}:{type:a,value:+e}}push(e){this.dictionaryAccumulator&&!this.dictKey?this.dictKey=e.value:this.dictionaryAccumulator&&this.dictKey?(this.dictionaryAccumulator[this.dictKey]=e.value,this.dictKey=void 0):this.arrayAccumulator?this.arrayAccumulator.push(e.value):this.tokenArray.push(e)}tokenize(e){this.tokenArray=[],this.arrayAccumulator=void 0,this.dictionaryAccumulator=void 0;let t=o;e=e.replace('\\"',"\\RO_Q");const r=new n.default(e,t,!0);let s,i;for(;r.hasMoreTokens();)switch(i=s,s=r.nextTokenWithDelimiters(t)){case"{":this.dictionaryAccumulator={};break;case"}":this.tokenArray.push({type:a,value:this.dictionaryAccumulator}),this.dictionaryAccumulator=void 0;break;case"[":this.arrayAccumulator=[];break;case"]":this.tokenArray.push({type:a,value:this.arrayAccumulator}),this.arrayAccumulator=void 0;break;case'"':'"'==i&&this.push({type:a,value:""}),t='"'==t?o:'"';break;default:'"'==t?this.push({type:a,value:s.replace("\\RO_Q",'\\"')}):-1==o.indexOf(s)&&this.push(this._stringToRoxx(s))}return this.tokenArray}}},(M,e,t)=>{"use strict";t.r(e),t.d(e,{and:()=>g,b64d:()=>z,concat:()=>V,eq:()=>_,flagValue:()=>D,gt:()=>N,gte:()=>R,ifThen:()=>b,inArray:()=>G,isInPercentage:()=>j,isInPercentageRange:()=>H,isInTargetGroup:()=>F,isTargetGroupPaired:()=>B,isUndefined:()=>p,lt:()=>E,lte:()=>x,match:()=>T,md5:()=>K,mergeSeed:()=>L,ne:()=>m,not:()=>v,now:()=>f,numeq:()=>S,numne:()=>P,operatorsWithContext:()=>q,or:()=>y,property:()=>U,semverEq:()=>C,semverGt:()=>I,semverGte:()=>w,semverLt:()=>A,semverLte:()=>O,semverNe:()=>k});var s=t(25),i=t(26),n=t(23),o=t(14),a=t(16),e=t(19),r=t.n(e),u=t(3),l=t(27),c=t(6);function d(e,t,r={zeroExtend:!0,lexicographical:!0}){const s=r&&r.lexicographical;r=r&&r.zeroExtend;let i=e.split("."),n=t.split(".");function o(e){return(s?/[0-9A-Za-z_-]+$/:/^\d+$/).test(e)}if(!i.every(o)||!n.every(o))return NaN;if(r){for(;i.length<n.length;)i.push("0");for(;n.length<i.length;)n.push("0")}s||(i=i.map(Number),n=n.map(Number));for(let e=0;e<i.length;++e){if(n.length==e)return 1;if(i[e]!=n[e])return i[e]>n[e]?1:-1}return i.length!=n.length?-1:0}const h=e=>((255&(e=r()(e,{asBytes:!0}))[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24)>>>0)/(Math.pow(2,32)-1),p=e=>void 0===e,f=()=>Date.now(),g=(e,t)=>e&&t,y=(e,t)=>e||t,m=(e,t)=>(!p(e)&&e)!==(!p(t)&&t),_=(e,t)=>(!p(e)&&e)===(!p(t)&&t),v=e=>!e,b=(e,t,r)=>e?t:r,E=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||!(e<t)),x=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||!(e<=t)),N=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||!(t<e)),P=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||e===t),S=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||e!==t),R=(e,t)=>!(p(e)||p(t)||"number"!=typeof e&&(e=Number(e),isNaN(e))||"number"!=typeof t&&(t=Number(t),isNaN(t))||!(t<=e)),T=(e,t,r)=>{const s=new RegExp(t,r);return!!s.exec(e)},A=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&d(e,t,{zeroExtend:!0})<0,O=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&d(e,t,{zeroExtend:!0})<=0,I=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&0<d(e,t,{zeroExtend:!0}),w=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&0<=d(e,t,{zeroExtend:!0}),C=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&0==d(e,t),k=(e,t)=>!p(e)&&!p(t)&&"string"==typeof e&&"string"==typeof t&&0!=d(e,t),L=(e,t)=>e+"."+t,j=(e,t)=>h(t)<=e,H=(e,t,r)=>e<=(r=h(r))&&r<=t,D=(e,t={},r={})=>{const s=n.default.flagWithName(e);if(s)return i=Object.assign({},r),s.getInternalValue(i,t),i.isPeek||i.result.isOverride||i.result.isFreezed||s._flagImpression(i.result.value,i.result.usedContext),i.result.value;var i=o.default.experimentForFlagName(e);return i&&i.deploymentConfiguration&&(new a.default).evaluateExpression(i.deploymentConfiguration.condition,r,t)||"false"},F=(e,t={},r={})=>!!(e=s.default.targetGroupWithName(e))&&(new a.default).evaluateExpression(e.condition,r,t),B=()=>!1,U=(t,r={})=>{const e=i.default.get(t);if(e)return e.getValue(r);{const s=l.DynamicPropertiesHandler&&(0,l.DynamicPropertiesHandler)();let e;if(s)if(s._isUserDefined)try{e=s(t,r)}catch(e){throw e.isUserError=!0,e.trigger=c.ExceptionTrigger.DYNAMIC_PROPERTIES_RULE,e}else e=s(t,r);return e}},G=(e,t)=>!!t&&t.includes(e),K=e=>{if("string"==typeof e)return r()(e)},V=(e,t)=>{if("string"==typeof e&&"string"==typeof t)return""+e+t},z=e=>{if("string"==typeof e)return decodeURIComponent((0,u.decode)(e))},q=[F,D,U]},(e,t,r)=>{function y(e,t){e.constructor==String?e=(t&&"binary"===t.encoding?b:_).stringToBytes(e):v(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var r=m.bytesToWords(e),t=8*e.length,s=1732584193,i=-271733879,n=-1732584194,o=271733878,a=0;a<r.length;a++)r[a]=16711935&(r[a]<<8|r[a]>>>24)|4278255360&(r[a]<<24|r[a]>>>8);r[t>>>5]|=128<<t%32,r[14+(64+t>>>9<<4)]=t;for(var u=y._ff,l=y._gg,c=y._hh,d=y._ii,a=0;a<r.length;a+=16){var h=s,p=i,f=n,g=o,s=u(s,i,n,o,r[a+0],7,-680876936),o=u(o,s,i,n,r[a+1],12,-389564586),n=u(n,o,s,i,r[a+2],17,606105819),i=u(i,n,o,s,r[a+3],22,-1044525330);s=u(s,i,n,o,r[a+4],7,-176418897),o=u(o,s,i,n,r[a+5],12,1200080426),n=u(n,o,s,i,r[a+6],17,-1473231341),i=u(i,n,o,s,r[a+7],22,-45705983),s=u(s,i,n,o,r[a+8],7,1770035416),o=u(o,s,i,n,r[a+9],12,-1958414417),n=u(n,o,s,i,r[a+10],17,-42063),i=u(i,n,o,s,r[a+11],22,-1990404162),s=u(s,i,n,o,r[a+12],7,1804603682),o=u(o,s,i,n,r[a+13],12,-40341101),n=u(n,o,s,i,r[a+14],17,-1502002290),s=l(s,i=u(i,n,o,s,r[a+15],22,1236535329),n,o,r[a+1],5,-165796510),o=l(o,s,i,n,r[a+6],9,-1069501632),n=l(n,o,s,i,r[a+11],14,643717713),i=l(i,n,o,s,r[a+0],20,-373897302),s=l(s,i,n,o,r[a+5],5,-701558691),o=l(o,s,i,n,r[a+10],9,38016083),n=l(n,o,s,i,r[a+15],14,-660478335),i=l(i,n,o,s,r[a+4],20,-405537848),s=l(s,i,n,o,r[a+9],5,568446438),o=l(o,s,i,n,r[a+14],9,-1019803690),n=l(n,o,s,i,r[a+3],14,-187363961),i=l(i,n,o,s,r[a+8],20,1163531501),s=l(s,i,n,o,r[a+13],5,-1444681467),o=l(o,s,i,n,r[a+2],9,-51403784),n=l(n,o,s,i,r[a+7],14,1735328473),s=c(s,i=l(i,n,o,s,r[a+12],20,-1926607734),n,o,r[a+5],4,-378558),o=c(o,s,i,n,r[a+8],11,-2022574463),n=c(n,o,s,i,r[a+11],16,1839030562),i=c(i,n,o,s,r[a+14],23,-35309556),s=c(s,i,n,o,r[a+1],4,-1530992060),o=c(o,s,i,n,r[a+4],11,1272893353),n=c(n,o,s,i,r[a+7],16,-155497632),i=c(i,n,o,s,r[a+10],23,-1094730640),s=c(s,i,n,o,r[a+13],4,681279174),o=c(o,s,i,n,r[a+0],11,-358537222),n=c(n,o,s,i,r[a+3],16,-722521979),i=c(i,n,o,s,r[a+6],23,76029189),s=c(s,i,n,o,r[a+9],4,-640364487),o=c(o,s,i,n,r[a+12],11,-421815835),n=c(n,o,s,i,r[a+15],16,530742520),s=d(s,i=c(i,n,o,s,r[a+2],23,-995338651),n,o,r[a+0],6,-198630844),o=d(o,s,i,n,r[a+7],10,1126891415),n=d(n,o,s,i,r[a+14],15,-1416354905),i=d(i,n,o,s,r[a+5],21,-57434055),s=d(s,i,n,o,r[a+12],6,1700485571),o=d(o,s,i,n,r[a+3],10,-1894986606),n=d(n,o,s,i,r[a+10],15,-1051523),i=d(i,n,o,s,r[a+1],21,-2054922799),s=d(s,i,n,o,r[a+8],6,1873313359),o=d(o,s,i,n,r[a+15],10,-30611744),n=d(n,o,s,i,r[a+6],15,-1560198380),i=d(i,n,o,s,r[a+13],21,1309151649),s=d(s,i,n,o,r[a+4],6,-145523070),o=d(o,s,i,n,r[a+11],10,-1120210379),n=d(n,o,s,i,r[a+2],15,718787259),i=d(i,n,o,s,r[a+9],21,-343485551),s=s+h>>>0,i=i+p>>>0,n=n+f>>>0,o=o+g>>>0}return m.endian([s,i,n,o])}var m=r(20),_=r(21).utf8,v=r(22),b=r(21).bin;y._ff=function(e,t,r,s,i,n,o){return((e=e+(t&r|~t&s)+(i>>>0)+o)<<n|e>>>32-n)+t},y._gg=function(e,t,r,s,i,n,o){return((e=e+(t&s|r&~s)+(i>>>0)+o)<<n|e>>>32-n)+t},y._hh=function(e,t,r,s,i,n,o){return((e=e+(t^r^s)+(i>>>0)+o)<<n|e>>>32-n)+t},y._ii=function(e,t,r,s,i,n,o){return((e=e+(r^(t|~s))+(i>>>0)+o)<<n|e>>>32-n)+t},y._blocksize=16,y._digestsize=16,e.exports=function(e,t){if(null==e)throw new Error("Illegal argument "+e);return e=m.wordsToBytes(y(e,t)),t&&t.asBytes?e:t&&t.asString?b.bytesToString(e):m.bytesToHex(e)}},e=>{var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 16711935&r.rotl(e,8)|4278255360&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.endian(e[t]);return e},randomBytes:function(e){for(var t=[];0<e;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,s=0;r<e.length;r++,s+=8)t[s>>>5]|=e[r]<<24-s%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var t=[],r=0;r<e.length;r+=3)for(var s=e[r]<<16|e[r+1]<<8|e[r+2],i=0;i<4;i++)8*r+6*i<=8*e.length?t.push(n.charAt(s>>>6*(3-i)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/gi,"");for(var t=[],r=0,s=0;r<e.length;s=++r%4)0!=s&&t.push((n.indexOf(e.charAt(r-1))&Math.pow(2,-2*s+8)-1)<<2*s|n.indexOf(e.charAt(r))>>>6-2*s);return t}};e.exports=r},e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};e.exports=t},e=>{function t(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}e.exports=function(e){return null!=e&&(t(e)||"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&t(e.slice(0,0))||!!e._isBuffer)}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{RoxFlagRepository:()=>n,default:()=>o});var s=r(24),i=r(14);class n{constructor(){this.map={}}addFlag(e,t){t.name=e,this.map[e]=t,new s.default(this,i.default).setAddedFlag(t)}flagWithName(e){return this.map[e]}get flags(){return Object.keys(this.map).map(e=>this.map[e])}get items(){return this.flags}}const o=new n},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var s=r(7);class i{constructor(e,t){this.flagRepo=e,this.experimentsRepo=t}prepareFlagsWithExperiments(){const e=this.experimentsRepo.experiments||[],r=(s.default.debug("Set experiments "+JSON.stringify(e)),[]);e.forEach(t=>{t&&t.flags.forEach(e=>{(e=e&&this.flagRepo.flagWithName(e.name))&&(r.push(e),this.connectExperimentToFlag(e,t.deploymentConfiguration.condition))})}),this.flagRepo.flags.forEach(t=>{r.some(e=>e===t)||this.connectExperimentToFlag(t,void 0)})}setAddedFlag(e){var t=this.experimentsRepo.experimentForFlag(e);t&&this.connectExperimentToFlag(e,t.deploymentConfiguration.condition)}connectExperimentToFlag(e,t){e.condition=t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});const s=new class{constructor(){this.map={}}addTargetGroup(e){this.map[e.identifier]=e}setTargetGroups(e){this.map={},(e=e||[]).forEach(function(e){this.map[e.identifier]=e},this)}targetGroupWithName(e){return this.map[e]}get targetGroups(){return Object.keys(this.map).map(e=>this.map[e])}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});const s=new class{constructor(){this.store=new Map}has(e){return this.store.has(e.name)}get(e){return this.store.get(e)}set(e){this.store.set(e.name,e)}setIfNotExists(e){this.has(e)||this.set(e)}clear(){this.store.clear()}get items(){return Array.from(this.store.values())}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{DynamicPropertiesHandler:()=>function(){return i},defaultDynamicPropertyHandler:()=>function(){return s},setDynamicPropertyHandler:()=>function(e){(i=e)&&(i._isUserDefined=!0)}});const s=(e,t)=>t?t[e]:void 0;let i=s},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e,t,r){this._string=e,this._delimiters=t,this._returnDelim=r,this._position=0}countTokens(){let r=0,s=!1;for(let e=this._position,t=this._string.length;e<t;e++)-1!=this._delimiters.indexOf(this._string.charAt(e))?(this._returnDelim&&r++,s&&(r++,s=!1)):s=!0;return s&&r++,r}hasMoreElements(){return this.hasMoreTokens()}hasMoreTokens(){if(!this._delimiters)return!1;var t=this._string.length;if(this._position<t){if(this._returnDelim)return!0;for(let e=this._position;e<t;e++)if(-1==this._delimiters.indexOf(this._string.charAt(e)))return!0}return!1}nextElement(){return this.nextToken()}nextToken(){if(this._delimiters){let e=this._position;var t=this._string.length;if(e<t){if(this._returnDelim){if(-1!=this._delimiters.indexOf(this._string.charAt(this._position)))return this._string.charAt(this._position++);for(this._position++;this._position<t;this._position++)if(-1!=this._delimiters.indexOf(this._string.charAt(this._position)))return this._string.substr(e,this._position-e);return this._string.substr(e)}for(;e<t&&-1!=this._delimiters.indexOf(this._string.charAt(this._position));)e++;if((this._position=e)<t){for(this._position++;this._position<t;this._position++)if(-1!=this._delimiters.indexOf(this._string.charAt(this._position)))return this._string.substr(e,this._position-e);return this._string.substr(e)}}}}nextTokenWithDelimiters(e){return this._delimiters=e,this.nextToken()}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var t=r(30),s=r.n(t),i=r(7),n=r(1);const o=new class{init(e,t,r,s){var i,n,o,a;this.selfManagedMode=s,this.selfManagedMode||({distinct_id:t,app_release:i,platform:n,api_version:o,lib_version:a}=s=t.getProperties(),s=function(e,t){var r={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r}(s,["distinct_id","app_release","platform","api_version","lib_version"]),this.device=s,this.header={apiKey:"abbf3bd9c6e80eb1e8c0566c35b08748",notifier:{name:"Rollout JavaScript SDK",version:a,url:"undefined"!=typeof window&&window.location&&window.location.href||void 0}},this.networkOptions=r,this.user={distinct_id:t,app_release:i,app_key:e,platform:n},this.app={api_version:o,lib_version:a})}error(e,t){if(!this.selfManagedMode)return this._notify("error",e,t)}_notify(e,t,r){const s={payloadVersion:4,exceptions:[],app:this.app,user:this.user,device:this.device,metaData:{data:{message:t,exception:r.toString()}},severity:e};return r instanceof Error?(s.exceptions.push({errorClass:r.name,message:t+"\n"+r.message,stacktrace:r.stack||""}),s.groupingHash=r.fileName):s.exceptions.push({errorClass:"Error",message:t,stacktrace:[]}),this._send([s])}_send(e){e=Object.assign({events:e},this.header),i.default.debug("Sending bugsnag error report."),e={url:"https://notify.bugsnag.com",data:e,options:this.networkOptions},n.default.getProxy().applyProxyToRequest(e);try{s().post(e.url,e.data,e.options).then(()=>{i.default.debug("Successfully sent error report.")}).catch(e=>{i.default.debug("Failed to send error report",e)})}catch(e){i.default.debug("Failed to send error report.",e)}}}},e=>{"use strict";e.exports=t},(e,t,r)=>{"use strict";r.r(t),r.d(t,{ConfigurationParser:()=>i.default,RoxxParser:()=>s.default});var s=r(16),i=r(32)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>o});var s=r(33),i=r(34);const n={DATA_CONTAINER:"data",APP_KEY:"application",EXPERIMENTS:"experiments",TARGET_GROUPS:"targetGroups",SIGNED_DATE:"signed_date"};class o{constructor(e,t,r=!0){if(!e||"object"!=typeof e)throw new Error("ConfigurationParser should be constructed with JSON object. Received "+e);if(!t||"string"!=typeof t)throw new Error("ConfigurationParser should be constructed with app key string. Received "+t);this._json=e,this._appKey=t,this._validateAppKey=r}parse(){var e=this._extractInnerJson(this._json);return this._validateAppKey&&e[n.APP_KEY]!==this._appKey?null:(this._parseExperiments(e[n.EXPERIMENTS]),this._parseTargetGroups(e[n.TARGET_GROUPS]),this._signedDate=new Date(this._json[n.SIGNED_DATE]),this)}experiments(){return this._experiments||[]}targetGroups(){return this._targetGroups||[]}signedDate(){return this._signedDate}_extractInnerJson(e){return JSON.parse(e[n.DATA_CONTAINER])}_parseExperiments(e){this._experiments=new s.default(e).parse()}_parseTargetGroups(e){this._targetGroups=new i.default(e).parse()}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var i=r(9),n=r(10);const o={DEPLOYMENT_CONFIGURATION:"deploymentConfiguration",DEPLOYMENT_CONDITION:"condition",EXPERIMENT_ARCHIVED:"archived",EXPERIMENT_STICKY:"sticky",EXPERIMENT_ID:"_id",EXPERIMENT_NAME:"name",EXPERIMENT_FLAGS:"featureFlags",EXPERIMENT_LABELS:"labels",EXPERIMENT_STICKINESS_PROPERTY:"stickinessProperty"};class s{constructor(e){this._json=e}parse(){if(!this._json||!this._json.length)return[];const s=[];return this._json.forEach(e=>{var t,r;e&&e[o.DEPLOYMENT_CONFIGURATION]&&e[o.EXPERIMENT_ID]&&e[o.EXPERIMENT_NAME]&&e[o.EXPERIMENT_FLAGS]&&(r=e[o.DEPLOYMENT_CONFIGURATION])[o.DEPLOYMENT_CONDITION]&&(t=e[o.EXPERIMENT_LABELS]||[],r=new i.default(r[o.DEPLOYMENT_CONDITION]),s.push(new n.default(e[o.EXPERIMENT_ID],e[o.EXPERIMENT_NAME],!!e[o.EXPERIMENT_ARCHIVED],!!e[o.EXPERIMENT_STICKY],r,e[o.EXPERIMENT_FLAGS],t,e[o.EXPERIMENT_STICKINESS_PROPERTY])))}),s}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(11);const i={TARGET_GROUP_ID:"_id",TARGET_GROUP_CONDITION:"condition"};class n{constructor(e){this._json=e}parse(){if(!this._json||!this._json.length)return[];const t=[];return this._json.forEach(e=>{e&&e[i.TARGET_GROUP_ID]&&e[i.TARGET_GROUP_CONDITION]&&t.push(new s.default(e[i.TARGET_GROUP_ID],e[i.TARGET_GROUP_CONDITION]))}),t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FlagsSetter:()=>s.default});var s=r(24)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{CustomProperties:()=>s.default,Experiments:()=>i.default,Flags:()=>n.default,TargetGroups:()=>o.default});var s=r(26),i=r(14),n=r(23),o=r(25)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Actions:()=>s,Manager:()=>i});var s=r(38),i=r(39)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{getMergedContext:()=>function(e,t){return e?Object.assign({},e,t):Object.assign({},t)},getMergedContextWithGlobal:()=>function(e){var t=s.getContext();return e?Object.assign({},t,e):Object.assign({},t)}});var s=r(39)},(e,t,r)=>{"use strict";r.r(t),r.d(t,{getContext:()=>function(){return s},setContext:()=>function(e){s=e}});let s={}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});class s{constructor(e,t){this.cache=e,this._uuid=t,this.distinct_id=this.generateDistinctId(),this.app_release="0.0",this.distinctIdSetExplicitly=!1}setPlatform(e){this.platform=e}setDistinctId(e){this.distinctIdSetExplicitly=!0,this.distinct_id=e}setAppRelease(e){this.app_release=e}uuid(){return this._uuid()}generateDistinctId(){let e=this.cache.get("distinctId");return e||(e=this.uuid(),this.cache.set("distinctId",e)),e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{Client:()=>S,createRoxClient:()=>function(e={}){return P=Object.assign({},P,e),R._dynamicApi=new c.default(e.EntitiesProvider,a.default,R),R}});var t=r(56),s=r(29),i=r(57),n=r(7),o=r(26),a=r(23),u=r(25),l=r(14),c=r(70),d=r(1),h=r(5),p=r(16),f=r(13),g=r(6),y=r(68),m=r(69),_=r(15),v=r(27),b=r(42),E=r.n(b),x=r(58),N=r(65);let P={ClassRegister:t.default};class S{constructor(e=5e3){this.classRegisterer=new P.ClassRegister,this.sendStateDebounceNoCheck=E()(()=>{this._sendState()},e,{maxWait:e,leading:!1,trailing:!0}),this.sendStateDebounced=()=>{this.appKey&&this.sendStateDebounceNoCheck()},this.onConfigurationFetched=this.onConfigurationFetched.bind(this)}get dynamicApi(){return this._dynamicApi}get appKey(){return this.app_key}setKey(e){if(!/^[a-f\d]{24}$/i.test(e))throw Error("invalid rollout apikey");this.app_key=e}setup(t={}){try{this.handleOptions(t),P.DeviceProperties=P.DeviceProperties.create?P.DeviceProperties.create(P):P.DeviceProperties,this.app_release&&P.DeviceProperties.setAppRelease(this.app_release),this.distinct_id&&P.DeviceProperties.setDistinctId(this.distinct_id),this.platform&&P.DeviceProperties.setPlatform(this.platform),this.deviceProperties=P.DeviceProperties,s.default.init(this.appKey,P.DeviceProperties,this.networkOptions,this.selfManagedMode),this.configurationFetcher=new i.default(this.appKey,this.deviceProperties,this.devModeSecret,P,this.embeddedConfiguration,{roxyUrl:this.roxyUrl,selfManagedMode:this.selfManagedMode},this.networkOptions),this.roxyUrl||(this.stateSender=new N.default(this.appKey,this.deviceProperties,this.devModeSecret,this.networkOptions,{selfManagedMode:this.selfManagedMode}),this.disableNetwork||(0,f.setAnalytics)(new y.default(this.appKey,Object.assign({},this.analyticsOptions),P.DeviceProperties,this.networkOptions))),P.getDefaultCustomProperties(this.deviceProperties,this.appKey).map(o.default.setIfNotExists.bind(o.default))}catch(e){n.default.error(t="Oh uh! An error occured during setup.",e),s.default.error(t,e)}return Promise.resolve(this)}handleOptions(e){const t=Object.assign({},P.DefaultSetupOptions,e);if(t.selfManaged&&"object"==typeof t.selfManaged){if(!t.selfManaged.analyticsURL)throw new Error("analyticsURL is required on self managed mode");if(!t.selfManaged.serverURL)throw new Error("serverURL is required on self managed mode");e.selfManaged.configurationURL&&(t.selfManaged.configurationURL=e.selfManaged.configurationURL.endsWith("/")?e.selfManaged.configurationURL:e.selfManaged.configurationURL+"/"),e.selfManaged.stateURL&&(t.selfManaged.stateURL=e.selfManaged.stateURL.endsWith("/")?e.selfManaged.stateURL:e.selfManaged.stateURL+"/"),d.default.setSelfManagedMode(t.selfManaged),(0,_.setDefaultsMode)(!0),this.selfManagedMode=!0}t.configuration&&t.configuration.disableNetwork&&(this.disableNetwork=!0),this.embeddedConfiguration=t.embedded,this.fetchIntervalInSec=t.fetchIntervalInSec,this.disablePushUpdateListener=!!(this.disableNetwork||this.selfManagedMode&&!t.selfManaged.pushUpdateURL)||t.disablePushUpdateListener,this.configurationFetchedHandler=t.configurationFetchedHandler,this.impressionHandler=t.impressionHandler,this.dynamicPropertyRuleHandler=t.dynamicPropertyRuleHandler,this.app_release=t.version,this.distinct_id=t.distinctId,this.devModeSecret=t.devModeSecret,this.platform=t.platform,this.roxyUrl=t.roxy,this.networkOptions={httpAgent:t.httpAgent,httpsAgent:t.httpsAgent},this.analyticsOptions=t.analytics,this.eventSourceImpl=t.eventSourceImpl,(0,f.setHandler)(this.impressionHandler),e.logger&&n.default.setLogger(e.logger),this.dynamicPropertyRuleHandler&&(0,v.setDynamicPropertyHandler)(this.dynamicPropertyRuleHandler)}fetchPeriodically(){if(!this.app_key)return n.default.warn("no app key"),Promise.reject();if(this.fetchIntervalInSec<=0)return Promise.resolve();this.fetchIntervalInSec<30&&(this.fetchIntervalInSec=30);var e=this._fetch({useCache:!1});return this.configurationFetcher.dispatchPeriodically({handler:this.onConfigurationFetched,periodTimeInSec:this.fetchIntervalInSec}),e}fetchCacheOnly(){return this._fetch({useCache:!0,skipNetwork:!0})}fetchWithCacheAndProceed(){return this._fetch({useCache:!0})}fetch(){return this._fetch({useCache:!1})}_fetchFromPush(){return this._fetch({useCache:!1,source:"push"})}sendState(){this._sendState()}_sendState(){this.sendStateDebounceNoCheck.cancel(),this.app_key&&(this.disableNetwork?n.default.debug("send state - disabled network"):this.stateSender&&this.stateSender.send())}_fetch(e={}){if(this.app_key){if(this.configurationFetcher)return this.disableNetwork&&(n.default.debug("fetch - disabling network"),e.skipNetwork=!0),this.configurationFetcher.dispatch({handler:this.onConfigurationFetched,options:e})}else n.default.warn("no app key")}register(e,t){void 0===t&&"object"==typeof e&&null!==e&&(t=e,e=""),n.default.debug(`Registering container '${e}' = `+JSON.stringify(t)),this.classRegisterer.handleContainer(e,t),this.sendStateDebounced()}setCustomProperty(e,t,r){e=new h.default(e,t,r),t=!o.default.has(e),o.default.set(e),t&&this.sendStateDebounced()}unfreeze(r,t){a.default.flags.filter(e=>{if(!e.name||"string"!=typeof r)return!0;const t=e.name.split(".");return 1===t.length&&""===r||t.slice(0,t.length-1).join(".")===r}).forEach(e=>{e.unfreeze(t)})}get metadata(){const t=new p.default;return{targetGroups:u.default.targetGroups.map(e=>({name:e.name,isEnabled:t.evaluateExpression(e.condition)})),experiments:l.default.experiments.map(e=>({name:e.name,isEnabled:"true"===t.evaluateExpression(e.deploymentConfiguration.condition)})),flags:a.default.flags.map(e=>({name:e.name,value:e._peek()}))}}onConfigurationFetched(e){try{e.fetcherStatus!==x.FetcherStatus.ERROR_FETCH_FAILED&&this.startOrStopPushUpdatesListener()}catch(e){n.default.warn("Cound not start or stop push notification listener. exception: "+e)}if(this.configurationFetchedHandler instanceof Function)try{return this.configurationFetchedHandler(e)}catch(e){g.default.invoke(g.ExceptionTrigger.CONFIGURATION_FETCHED_HANDLER,e)}}startOrStopPushUpdatesListener(){!this.disablePushUpdateListener&&(0,_.isEnabled)("rox.internal.pushUpdates")?this.app_key&&!this.pushUpdatesListener&&(this.pushUpdatesListener=new m.default(d.default.get("NOTIFICATIONS_ENDPOINT"),this.app_key,this.eventSourceImpl,this.networkOptions),this.pushUpdatesListener.on("changed",()=>{this._fetchFromPush()})):this.pushUpdatesListener&&(this.pushUpdatesListener.stop(),this.pushUpdatesListener=null)}setUserspaceUnhandledErrorHandler(e){g.default.setHandler(e)}get cacheURL(){if(this.configurationFetcher&&this.configurationFetcher.cacheURL)return this.configurationFetcher.cacheURL;throw new Error("Rox was not initialized. Please call setup() before calling cacheURL()")}}const R=new S},(e,t,r)=>{var _=r(43),v=r(44),b=r(47),E=Math.max,x=Math.min;e.exports=function(s,r,e){var i,n,o,a,u,l,c=0,d=!1,h=!1,t=!0;if("function"!=typeof s)throw new TypeError("Expected a function");function p(e){var t=i,r=n;return i=n=void 0,c=e,a=s.apply(r,t)}function f(e){var t=e-l;return void 0===l||r<=t||t<0||h&&o<=e-c}function g(){var e,t=v();if(f(t))return y(t);u=setTimeout(g,(e=r-(t-l),h?x(e,o-(t-c)):e))}function y(e){return u=void 0,t&&i?p(e):(i=n=void 0,a)}function m(){var e=v(),t=f(e);if(i=arguments,n=this,l=e,t){if(void 0===u)return c=e=l,u=setTimeout(g,r),d?p(e):a;if(h)return clearTimeout(u),u=setTimeout(g,r),p(l)}return void 0===u&&(u=setTimeout(g,r)),a}return r=b(r)||0,_(e)&&(d=!!e.leading,h="maxWait"in e,o=h?E(b(e.maxWait)||0,r):o,t="trailing"in e?!!e.trailing:t),m.cancel=function(){void 0!==u&&clearTimeout(u),i=l=n=u=void(c=0)},m.flush=function(){return void 0===u?a:y(v())},m}},e=>{e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},(e,t,r)=>{var s=r(45);e.exports=function(){return s.Date.now()}},(e,t,r)=>{var r=r(46),s="object"==typeof self&&self&&self.Object===Object&&self,r=r||s||Function("return this")();e.exports=r},e=>{var t="object"==typeof window&&window&&window.Object===Object&&window;e.exports=t},(e,t,r)=>{var s=r(48),i=r(43),n=r(50),o=/^[-+]0x[0-9a-f]+$/i,a=/^0b[01]+$/i,u=/^0o[0-7]+$/i,l=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(n(e))return NaN;if(i(e)&&(t="function"==typeof e.valueOf?e.valueOf():e,e=i(t)?t+"":t),"string"!=typeof e)return 0===e?e:+e;e=s(e);var t=a.test(e);return t||u.test(e)?l(e.slice(2),t?2:8):o.test(e)?NaN:+e}},(e,t,r)=>{var s=r(49),i=/^\s+/;e.exports=function(e){return e&&e.slice(0,s(e)+1).replace(i,"")}},e=>{var r=/\s/;e.exports=function(e){for(var t=e.length;t--&&r.test(e.charAt(t)););return t}},(e,t,r)=>{var s=r(51),i=r(55);e.exports=function(e){return"symbol"==typeof e||i(e)&&"[object Symbol]"==s(e)}},(e,t,r)=>{var s=r(52),i=r(53),n=r(54),o=s?s.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":(o&&o in Object(e)?i:n)(e)}},(e,t,r)=>{r=r(45).Symbol,e.exports=r},(e,t,r)=>{var r=r(52),s=Object.prototype,n=s.hasOwnProperty,o=s.toString,a=r?r.toStringTag:void 0;e.exports=function(e){var t=n.call(e,a),r=e[a];try{var s=!(e[a]=void 0)}catch(e){}var i=o.call(e);return s&&(t?e[a]=r:delete e[a]),i}},e=>{var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},e=>{e.exports=function(e){return null!=e&&"object"==typeof e}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>i});var t=r(23),n=r(12);const s={flagsRepository:t.default};class i{constructor(e={}){this.options=Object.assign({},s,e),this._flagsRepository=this.options.flagsRepository,this._namespaceStore=new Set}handleContainer(e,t){if("[object String]"!==Object.prototype.toString.call(e))throw new Error("InvalidNamespace: Namespace must be a string (non-nullable).");var r,s;if(this._namespaceStore.has(e))throw new Error(`InvalidNamespace: A namespace must be unique. A container with the given namespace ('${e}') has already been registered.`);this._namespaceStore.add(e);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r=e?e+"."+i:i,(s=t[i])instanceof n.default&&this._flagsRepository.addFlag(r,s))}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>m});var s=r(61),i=r(59),n=r(32),o=r(24),a=r(29),u=r(15),t=r(1),l=r(25),c=r(14),d=r(23),h=r(7),p=r(58),f=r(64);const g=t.default.get("CLIENT_DATA_CACHE_KEY");let y=!1;const m=class{constructor(e,t,r,s,i,n,o){this.cache=s.RoxCache,this.crypto=s.RoxCrypto,this.embdeddedJSON=this.fetchFromEmbedded(i),this.appKey=e,this.deviceProperties=t,this.devModeSecret=r,this.options=n||{},this.networkOptions=o,this.lastResponse=null}runHandler(e,t){if(t.errorDetails&&a.default.error("Configuration fetcher returned with "+t.fetcherStatus,t.errorDetails),e instanceof Function)try{e(t)}catch(e){}}dispatch({handler:e,options:t}){h.default.debug("dispatch();");const r=[];if(t.useCache){if(this.embdeddedJSON){if(!this.verifyPayload(this.embdeddedJSON))throw new Error("The embdeddedJSON was corrupted or its authenticity cannot be securely verified.");var s=this.parsePayload(this.embdeddedJSON);s&&r.push({payload:this.embdeddedJSON,parser:s,status:p.FetcherStatus.APPLIED_FROM_EMBEDDED})}if(s=this.fetchFromCache()){if(!this.verifyPayload(s))throw new Error("The cachedPayload was corrupted or its authenticity cannot be securely verified.");var i=this.parsePayload(s);i&&r.push({payload:s,parser:i,status:p.FetcherStatus.APPLIED_FROM_CACHE})}}if(0<r.length){const n=r.reduce((e,t)=>e&&e.parser.signedDate()>t.parser.signedDate()?e:t,null);(!this.lastApplied||this.lastApplied.signedDate()<n.parser.signedDate())&&(this.lastResponse=n.payload,this.apply(n.parser,n.status,!1,e,n.payload))}if(!t.skipNetwork){if(!this.shouldSkipFetch(t.source))return this._dispatch({handler:e,storeInCache:!0});h.default.debug("Skipping fetch - kill switch")}}shouldSkipFetch(e){var e="push"===e,t=(0,u.getNumber)("rox.internal.throttleFetchInSeconds");if(0<t&&(!e||(0,u.isEnabled)("rox.internal.considerThrottleInPush"))){if(e=+Date.now(),this.lastFetchTryTime&&e<this.lastFetchTryTime+1e3*t)return!0;this.lastFetchTryTime=e}return!1}dispatchPeriodically({handler:e,periodTimeInSec:t}){if(y)return h.default.debug("Dispatch Periodically already running"),Promise.resolve();y=!0,h.default.debug("Dispatch Periodically"),setInterval(()=>{this._dispatch({handler:e})},1e3*t)}_dispatch({handler:s,storeInCache:i}){return this.fetchFromNetwork().then(e=>{var t=this.isNewResponse(e);const r=this.process(e,p.FetcherStatus.APPLIED_FROM_NETWORK,t,s);return r.then(()=>{i&&this.storeInCache(e),this.lastResponse=e})}).catch(e=>{this.runHandler(s,new p.FetcherResults(p.FetcherStatus.ERROR_FETCH_FAILED,null,!1,e))})}fetchFromNetwork(){h.default.debug("fetch from network for appKey "+this.appKey);var e=(0,i.buildRequestConfiguration)({appKey:this.appKey,deviceProperties:this.deviceProperties,devModeSecret:this.devModeSecret});return this.rc=e,this.options.roxyUrl?(0,s.fetchRemoteConfigurationWithRoxy)(e,this.options.roxyUrl,this.networkOptions):(0,s.fetchRemoteConfiguration)(e,this.networkOptions,this.options)}fetchFromCache(){h.default.debug("fetch From Cache");let e=this.cache.get(this.cacheKey()),t;if(e=e||this.cache.get(g)){try{t=JSON.parse(e)}catch(e){h.default.warn(`Configuration retrieved from cache, but is corrupted. Aborting. (Error: ${e})`)}if(t&&t.constructor===Object)return h.default.debug("Parsed cached = "+JSON.stringify(t)),t}}cacheKey(){return g+"-"+this.appKey}fetchFromEmbedded(e){let t;if(e){try{t=JSON.parse(e)}catch(e){h.default.warn("Received embdedded configuration, but it is corrupted. Aborting. Error: ",e)}if(t&&t.constructor===Object)return h.default.debug("Parsed embedded = "+JSON.stringify(t)),t}if(f.default&&"object"==typeof f.default)return f.default}storeInCache(e){h.default.debug("Store in cache response = "+JSON.stringify(e)),this.cache.set(this.cacheKey(),JSON.stringify(e))}process(e,t,r,s){if(!e)return Promise.reject("Empty configuration");if(!this.verifyPayload(e))throw new Error("The payload has corrupted or its authenticity cannot be securely verified.");var i=this.parsePayload(e);return i?this.apply(i,t,r,s,e):Promise.reject("Failed to parse configuration")}apply(r,s,i,n,o){if(r)return this.calculatePayload(r),this.lastApplied=r,new Promise(e=>{var t=new p.FetcherResults(s,r.signedDate(),i,void 0,o);this.runHandler(n,t),e()})}parsePayload(e){var t=!this.options.roxyUrl;const r=new n.default(e,this.appKey,t);return r.parse()?r:(h.default.debug(`failed to parse payload. response = ${JSON.stringify(e)} deviceProps = ${this.deviceProperties} app_key = `+this.appKey),null)}verifyPayload(e){var{signature_v0:e,data:t}=e;return!(!this.options.roxyUrl&&!this.options.selfManagedMode)||this.crypto.verify(t,e)}calculatePayload(e){if(e)return l.default.setTargetGroups(e.targetGroups()),c.default.setExperiments(e.experiments()),new o.default(d.default,c.default).prepareFlagsWithExperiments(),e}isNewResponse(e){return JSON.stringify(this.lastResponse)!==JSON.stringify(e)}get cacheURL(){return this.rc&&this.rc.cache_url}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{FetcherResults:()=>i,FetcherStatus:()=>s});const s={APPLIED_FROM_EMBEDDED:"APPLIED_FROM_EMBEDDED",APPLIED_FROM_CACHE:"APPLIED_FROM_CACHE",APPLIED_FROM_NETWORK:"APPLIED_FROM_NETWORK",ERROR_FETCH_FAILED:"ERROR_FETCH_FAILED"};class i{constructor(e,t,r,s,i){this.fetcherStatus=e,this.creationDate=t,this.hasChanges=r,this.errorDetails=s,this.clientData=i}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{buildRequestConfiguration:()=>s});var i=r(1),n=r(60);const s=function({appKey:e,deviceProperties:t,devModeSecret:r}){const s=t.getProperties();return s.app_key=e,s.buid=n.generateBuid(s),s.buid_generators_list=n.BUID_GENERATOR_LIST.join(","),s.relative_url=e+"/"+s.buid,s.cache_url=""+i.default.get("CD_S3_ENDPOINT")+s.relative_url,s.devModeSecret=r,s}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{BUID_GENERATOR_LIST:()=>i,STATE_GENERATOR_LIST:()=>n,generateBuid:()=>function(e={},t=i){return o(e,t)},generateStateMd5:()=>function(e={},t=n){return o(e,t)}});var t=r(19),s=r.n(t);const i=["lib_version","api_version","platform","app_key","customSigningCertificate"],n=["platform","app_key","feature_flags","custom_properties","devModeSecret"];function o(r={},e=[]){const t=e.map(e=>{var t=r[e];return t?t.constructor===Object||t.constructor===Array?JSON.stringify(t):t:e});return s()(t.join("|"))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{fetchRemoteConfiguration:()=>function(t,r,e={}){var s=t.cache_url+"?distinct_id="+t.distinct_id;return e.selfManagedMode&&!o.default.get("CD_S3_ENDPOINT")?(e=(0,i.buildAPIURL)(t),a((0,n.fetchFromAPI)(e.url,e.body,r))):a((0,n.fetchFromCDN)(s,r).catch(()=>{var e=(0,i.buildAPIURL)(t);return(0,n.fetchFromAPI)(e.url,e.body,r)}))},fetchRemoteConfigurationWithRoxy:()=>function(e,t,r){return e=(0,i.buildAPIURL)(e,t),a((0,n.fetchFromRoxyAPI)(e.url,r))}});var i=r(62),n=r(63),s=r(7),o=r(1);function a(e){return e.catch(e=>{throw e.message="Unable to fetch rox configuration!\n"+e.message,s.default.error(e),e})}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{buildAPIURL:()=>s,buildSetStateAPIURL:()=>n,buildSetStateS3URL:()=>i});var o=r(1);const s=function(e,t=null){const{app_key:r,buid:s,relative_url:i}=e,n=function(e,t){var r={};for(i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.indexOf(i)<0&&(r[i]=e[i]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,i=Object.getOwnPropertySymbols(e);s<i.length;s++)t.indexOf(i[s])<0&&Object.prototype.propertyIsEnumerable.call(e,i[s])&&(r[i[s]]=e[i[s]]);return r}(e,["app_key","buid","relative_url"]);return n.cache_miss_relative_url=i,e=o.default.get("CD_API_ENDPOINT")+`/${r}/`+s,{url:t||e,body:n}},i=function(e){return""+o.default.get("SS_S3_ENDPOINT")+e.app_key+"/"+e.md5},n=function(e,t=null){return{url:t||""+o.default.get("SS_API_ENDPOINT")+e.app_key+"/"+e.md5,body:{platform:e.platform,feature_flags:e.feature_flags,custom_properties:e.custom_properties,devModeSecret:e.devModeSecret}}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{fetchFromAPI:()=>function(e,t,r){return e={url:e,data:t,options:r},n.default.getProxy().applyProxyToRequest(e),s().post(e.url,e.data,e.options).then(o)},fetchFromCDN:()=>function(e,t){return e={url:e,options:t},n.default.getProxy().applyProxyToRequest(e),s().get(e.url,e.options).then(({data:e,status:t})=>{if(200===t&&e&&"object"==typeof e){if(404!==e.result)return i.default.debug("succeed fetch from CDN"),e;{i.default.debug("succeed fetch from CDN, but it was missing");const r=new Error("missing from CDN");return r.missing=!0,Promise.reject(r)}}}).catch(e=>{if(e.missing||e.response&&(404==e.response.status||403==e.response.status))return Promise.reject();i.default.debug("Unexpected error calling get configuration, status code returned different from 403 or 404. error: "+e)})},fetchFromRoxyAPI:()=>function(e,t){return e={url:e,options:t},n.default.getProxy().applyProxyToRequest(e),s().get(e.url,e.options).then(o)},setStateToAPI:()=>function(e,t,r){return e={url:e,data:t,options:r},n.default.getProxy().applyProxyToRequest(e),s().post(e.url,e.data,e.options).then(({status:e})=>{if(200!==e)return Promise.reject(new Error("Unexpected response from ROX API"));i.default.debug("succeed setState from API")})},stateFromCDN:()=>function(e,t){return e={url:e,options:t},n.default.getProxy().applyProxyToRequest(e),s().get(e.url,e.options).then(({data:e,status:t})=>{if(200===t&&e&&"object"==typeof e){if(404===e.result){i.default.debug("succeed setState from CDN, but it was missing");const r=new Error("missing from CDN");return r.missing=!0,Promise.reject(r)}if(200===e.result)return void i.default.debug("succeed setState from CDN")}i.default.debug("succeed setState, but with unexpected response")}).catch(e=>{if(e.missing||e.response&&(404==e.response.status||403==e.response.status))return Promise.reject();i.default.debug("Unexpected error calling setState, status code returned different from 403 or 404. error: "+e)})}});var t=r(30),s=r.n(t),i=r(7),n=r(1);function o(e){var{data:e,status:t}=e;return 200===t&&e&&"object"==typeof e?(i.default.debug("succeed fetch from API"),e):Promise.reject(new Error("Unexpected response from ROX API"))}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});let s,i;try{i=$__ROX_EMBEDDED_CONTENT}catch(e){}if(i&&"string"==typeof i)try{i=JSON.parse(i)}catch(e){i=void 0}const n=s=i&&i.constructor===Object&&i.signed_date?i:s},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>a});var s=r(67),i=r(60),n=r(7);const o=new(r(66).default),a=class{constructor(e,t,r,s,i){this.appKey=e,this.deviceProperties=t,this.devModeSecret=r,this.networkOptions=s,this.options=i}send(){n.default.debug("check for cached state for appKey "+this.appKey);var e=this.buildSetState();try{(0,s.sendStateNetwork)(e,this.networkOptions,this.options).catch(e=>{n.default.error("failed to send state (promise)",e)})}catch(e){n.default.error("failed to send state",e)}}sortItemsByName(e){return e.sort((e,t)=>e.name>t.name?-1:1)}buildSetState(){const e=this.deviceProperties.getProperties();return e.app_key=this.appKey,e.feature_flags=this.sortItemsByName(o.featureFlags),e.custom_properties=this.sortItemsByName(o.customProperties),e.devModeSecret=this.devModeSecret,e.md5=i.generateStateMd5(e),e}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>n});var s=r(23),i=r(26);class n{get customProperties(){const t=[];return i.default.items.forEach(e=>{t.push({name:e.name,type:e.type,externalType:e.externalType})}),t}get featureFlags(){const t=[];return s.default.items.forEach(e=>{t.push({name:e.name,defaultValue:e.defaultValue,options:e._options})}),t}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{sendStateNetwork:()=>function(t,r,e={}){var s=(0,n.buildSetStateS3URL)(t);return e.selfManagedMode&&!o.default.get("SS_S3_ENDPOINT")?(e=(0,n.buildSetStateAPIURL)(t),a((0,i.setStateToAPI)(e.url,e.body,r))):a((0,i.stateFromCDN)(s,r).catch(()=>{var e=(0,n.buildSetStateAPIURL)(t);return(0,i.setStateToAPI)(e.url,e.body,r)}))}});var i=r(63),n=r(62),o=r(1);function a(e){return e.catch(e=>{throw e.message="Unable to send state!\n"+e.message,e})}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var a=r(1),t=r(30),u=r.n(t);const l=e=>{setTimeout(e,5)},c=()=>{},s=class{constructor(e,t,r,s){if(t=t||{},this.queue=[],this.writeKey=e,this.host=t.host||a.default.get("ANALYTICS_ENDPOINT"),this.timeout=t.timeout||!1,this.flushAt=Math.max(t.flushAt||20,1),this.flushInterval=t.flushInterval||1e4,this.flushed=!1,this.version=r.getProperties().lib_version||"0.0",void 0===r.getProperties().platform)throw new Error("Platform must be provided");this.platform=r.getProperties().platform||"",this.networkOptions=s,Object.defineProperty(this,"enable",{configurable:!1,writable:!1,enumerable:!0,value:"boolean"!=typeof t.enable||t.enable})}identify(e,t){return this.enqueue("identify",e,t),this}group(e,t){return this.enqueue("group",e,t),this}track(e,t){return this.enqueue("track",e,t),this}page(e,t){return this.enqueue("page",e,t),this}screen(e,t){return this.enqueue("screen",e,t),this}alias(e,t){return this.enqueue("alias",e,t),this}enqueue(e,t,r){return r=r||c,this.enable?(t=Object.assign({},t),this.queue.push({message:t,callback:r}),this.flushed?(this.queue.length>=this.flushAt&&this.flush(),void(this.flushInterval&&!this.timer&&(this.timer=setTimeout(this.flush.bind(this),this.flushInterval)))):(this.flushed=!0,void this.flush())):l(r)}flush(e){if(e=e||c,!this.enable)return l(e);if(this.timer&&(clearTimeout(this.timer),this.timer=null),!this.queue.length)return l(e);const t=this.queue.splice(0,this.flushAt),r=t.map(e=>e.callback);var s=t.map(e=>e.message);const i={analyticsVersion:"1.0.0",sdkVersion:this.version,time:(new Date).getTime(),platform:this.platform,rolloutKey:this.writeKey,events:s},n=t=>{r.forEach(e=>e(t)),e(t,i)},o=(s=this.host+"/impression/"+this.writeKey,{httpsAgent:this.networkOptions.httpsAgent,httpAgent:this.networkOptions.httpAgent});this.timeout&&(o.timeout=this.timeout),s={url:s,data:i,options:o},a.default.getProxy().applyProxyToRequest(s),u().post(s.url,s.data,s.options).then(()=>n()).catch(e=>{var t;if(e.response)return t=new Error(e.response.statusText),n(t);n(e)})}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var i=r(7),n=r(1);const o="object"==typeof window&&window.EventSource;class s{constructor(e,t,r,s){e=""+e+(e.endsWith("/")?"":"/")+t,i.default.info("Starting push notification listener to "+e),t={url:e,options:s},n.default.getProxy().applyProxyToSseRequest(t),r?this.eventSource=new r(t.url,t.options):o&&(this.eventSource=new o(t.url))}on(e,t){this.eventSource&&this.eventSource.addEventListener(e,e=>{try{t(e)}catch(e){}})}stop(){this.eventSource&&this.eventSource.close()}}},(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s});var l=r(12);class s{constructor(e,t,r){this.entityProvider=e,this.flagRepository=t,this.client=r}genericValue(e,t,r,s,i=l.FlagTypes.string,n=this.entityProvider.createString,o=l.default._normalizeString){if("string"!=typeof e)throw new Error("DynamicApi error - name must be a string");if(typeof t!==i)throw new Error(`DynamicApi default value must be of ${i} type. Received '${t}'`);let a=this.flagRepository.flagWithName(e);a||(a=n(t,r),this.flagRepository.addFlag(e,a),this.client.sendStateDebounced()),i={alternativeDefaultValue:t.toString()},a.getInternalValue(i,s);const u=o(i.result.value);return i.result.isFreezed||i.result.isOverride||a._flagImpression(u.toString(),i.result.usedContext),u}isEnabled(e,t,r){return this.genericValue(e,t,null,r,l.FlagTypes.boolean,this.entityProvider.createFlag,l.default._normalizeBoolean)}value(e,t,r,s){return Array.isArray(r)||(s=r,r=null),this.genericValue(e,t,r,s)}getNumber(e,t,r,s){return Array.isArray(r)||(s=r,r=null),this.genericValue(e,t,r,s,l.FlagTypes.number,this.entityProvider.createNumber,l.default._normalizeNumber)}}}],s={},y.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return y.d(t,{a:t}),t},y.d=(e,t)=>{for(var r in t)y.o(t,r)&&!y.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},y.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),y.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},m={},(()=>{"use strict";y.r(m),y.d(m,{Client:()=>a.Client,Config:()=>u.default,ConfigurationParser:()=>p.default,Context:()=>i,DeviceProperties:()=>n.default,DynamicApi:()=>h.default,Entities:()=>s,Experiments:()=>d.default,Flags:()=>c.default,FlagsSetter:()=>f.default,Parsers:()=>r,Repositories:()=>t,RoxLogger:()=>o.default,Setters:()=>e,TargetGroups:()=>g.default,createRoxClient:()=>a.createRoxClient,flagValue:()=>l.flagValue});var e=y(35),t=y(36),r=y(31),s=y(4),i=y(37),n=y(40),o=y(7),a=y(41),u=y(1),l=y(18),c=y(23),d=y(14),h=y(70),p=y(32),f=y(24),g=y(25)})(),m;function y(e){var t=s[e];return void 0===t&&(t=s[e]={exports:{}},r[e](t,t.exports,y)),t.exports}var r,s,m});
//# sourceMappingURL=rox-base.min.js.map
{
"name": "rox-base",
"version": "5.3.1",
"version": "5.4.0",
"description": "Rollout.io ROX JS SDK Base",

@@ -44,3 +44,3 @@ "author": "Rollout.io <support@rollout.io>",

"dependencies": {
"axios": "^0.26.0"
"axios": "^0.27.2"
},

@@ -57,3 +57,3 @@ "files": [

"md5": "^2.2.1",
"rox-crypto": "^5.3.1",
"rox-crypto": "^5.4.0",
"rox-embedded-webpack-plugin": "^1.1.8",

@@ -82,3 +82,3 @@ "ts-jest": "^27.1.2",

},
"gitHead": "5639cb33c50e0c22f55e499a4572177bdf15c132"
"gitHead": "833e472075d3c93610a1468f10de735ce7a345cb"
}
![Rollout](https://1ko9923xosh2dsbjsxpwqp45-wpengine.netdna-ssl.com/wp-content/themes/rollout/images/rollout_white_logo1.png)
Rollout is a Secure Feature Managment Solution for the Enterprise.
CloudBees Feature Management is a secure feature management solution for the enterprise.

@@ -5,0 +5,0 @@ > Accelerate development and minimize the risk of deploying new code with simple to create feature flags, controlled rollouts, advanced target groups & deployment rules.

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc