PageSourceSearch

https://ouraring.com/b/a/ecom-website/v1.136.0/_next/static/chunks/9634-df2d27c00589ec2c.js

js ouraring.com collected 2026-10-01 08:32:23 UTC 103,849 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9634],{98:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClientBase=void 0,n(41832);let i=n(41832),s=n(51691),a=n(60047),o=n(28109),l=n(28446),u=n(77043),d=n(71074),c=n(54727),_=n(4607),h=n(15163);class g{constructor(e,t,n,r){var l,_,g,f;this.loadingStatus="Uninitialized",this._initializePromise=null,this._listeners={};let v=this.$emt.bind(this);(null==r?void 0:r.logLevel)!=null&&(o.Log.level=r.logLevel),(null==r?void 0:r.disableStorage)&&h.Storage._setDisabled(!0),(null==r?void 0:r.initialSessionID)&&d.StatsigSession.overrideInitialSessionID(r.initialSessionID,e),(null==r?void 0:r.storageProvider)&&h.Storage._setProvider(r.storageProvider),(null==r?void 0:r.enableCookies)&&c.StableID._setCookiesEnabled(e,r.enableCookies),(null==r?void 0:r.disableStableID)&&c.StableID._setDisabled(e,!0),this._sdkKey=e,this._options=null!=r?r:{},this._memoCache={},this.overrideAdapter=null!=(l=null==r?void 0:r.overrideAdapter)?l:null,this._errorBoundary=new s.ErrorBoundary(e,r,v),this._logger=new a.EventLogger(e,v,n,r,this._errorBoundary),this._errorBoundary.wrap(this),this._errorBoundary.wrap(t),this._errorBoundary.wrap(this._logger),n.setErrorBoundary(this._errorBoundary),this.dataAdapter=t,this.dataAdapter.attach(e,r,n),this.storageProvider=h.Storage,null==(f=null==(g=null==(_=this.overrideAdapter)?void 0:_.loadFromStorage)?void 0:g.call(_))||f.catch(e=>this._errorBoundary.logError("OA::loadFromStorage",e)),this._primeReadyRipcord(),function(e,t){var n;if((0,u._isServerEnv)())return;let r=(0,i._getStatsigGlobal)(),s=null!=(n=r.instances)?n:{};null!=s[e]&&o.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),s[e]=t,r.firstInstance||(r.firstInstance=t),r.instances=s,__STATSIG__=r}(e,this)}updateRuntimeOptions(e){e.loggingEnabled?(this._options.loggingEnabled=e.loggingEnabled,this._logger.setLoggingEnabled(e.loggingEnabled)):null!=e.disableLogging&&(this._options.disableLogging=e.disableLogging,this._logger.setLoggingEnabled(e.disableLogging?"disabled":"browser-only")),null!=e.disableStorage&&(this._options.disableStorage=e.disableStorage,h.Storage._setDisabled(e.disableStorage)),null!=e.enableCookies&&(this._options.enableCookies=e.enableCookies,c.StableID._setCookiesEnabled(this._sdkKey,e.enableCookies)),e.logEventCompressionMode?this._logger.setLogEventCompressionMode(e.logEventCompressionMode):e.disableCompression&&this._logger.setLogEventCompressionMode(_.LogEventCompressionMode.Disabled)}flush(){return this._logger.flush()}shutdown(){return r(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this._setStatus("Uninitialized",null),this._initializePromise=null,yield this._logger.stop()})}on(e,t){this._listeners[e]||(this._listeners[e]=[]),this._listeners[e].push(t)}off(e,t){if(this._listeners[e]){let n=this._listeners[e].indexOf(t);-1!==n&&this._listeners[e].splice(n,1)}}$on(e,t){t.__isInternal=!0,this.on(e,t)}$emt(e){var t;let n=t=>{try{t(e)}catch(n){if(!0===t.__isInternal)return void this._errorBoundary.logError(`__emit:${e.name}`,n);o.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",e)}};this._listeners[e.name]&&this._listeners[e.name].forEach(e=>n(e)),null==(t=this._listeners["*"])||t.forEach(n)}_setStatus(e,t){this.loadingStatus=e,this._memoCache={},this.$emt({name:"values_updated",status:e,values:t})}_enqueueExposure(e,t,n){if((null==n?void 0:n.disableExposureLog)===!0)return void this._logger.incrementNonExposureCount(e);this._logger.enqueue(t)}_memoize(e,t){return(n,r)=>{if(this._options.disableEvaluationMemoization)return t(n,r);let i=(0,l.createMemoKey)(e,n,r);return i?(i in this._memoCache||(Object.keys(this._memoCache).length>=3e3&&(this._memoCache={}),this._memoCache[i]=t(n,r)),this._memoCache[i]):t(n,r)}}}t.StatsigClientBase=g},4607:(e,t)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t.LoggingEnabledOption=t.LogEventCompressionMode=void 0,t.LogEventCompressionMode={Disabled:"d",Enabled:"e",Forced:"f"},t.LoggingEnabledOption={disabled:"disabled",browserOnly:"browser-only",always:"always"}},4851:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._resolveDeltasResponse=void 0;let r=n(28551);function i(e,t){null==e||e.forEach(e=>{delete t[e]})}t._resolveDeltasResponse=function(e,t){var n,s,a;let o=(0,r._typedJsonParse)(t,"checksum","DeltasEvaluationResponse");if(!o)return{hadBadDeltaChecksum:!0};let l=(i((a=(n=e,s=o,Object.assign(Object.assign(Object.assign({},n),s),{feature_gates:Object.assign(Object.assign({},n.feature_gates),s.feature_gates),layer_configs:Object.assign(Object.assign({},n.layer_configs),s.layer_configs),dynamic_configs:Object.assign(Object.assign({},n.dynamic_configs),s.dynamic_configs)}))).deleted_gates,a.feature_gates),delete a.deleted_gates,i(a.deleted_configs,a.dynamic_configs),delete a.deleted_configs,i(a.deleted_layers,a.layer_configs),delete a.deleted_layers,a),u=(0,r._DJB2Object)({feature_gates:l.feature_gates,dynamic_configs:l.dynamic_configs,layer_configs:l.layer_configs},2);return u!==o.checksumV2?{hadBadDeltaChecksum:!0,badChecksum:u,badMergedConfigs:l,badFullResponse:o.deltas_full_response}:JSON.stringify(l)}},4956:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useClientAsyncInit=void 0;let r=n(63943),i=n(46024);t.useClientAsyncInit=function(e,t,n=null){return(0,i.useStatsigInternalClientFactoryAsync)(e=>new r.StatsigClient(e.sdkKey,e.initialUser,e.statsigOptions),{sdkKey:e,initialUser:t,statsigOptions:n})}},5440:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},9441:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.V1InitializeContainer=void 0;let r=n(28551);class i{constructor(e){this._values=e}getGate(e){return this._getResultFromLookup(this._values.feature_gates,e)}getConfig(e){return this._getResultFromLookup(this._values.dynamic_configs,e)}getLayer(e){return this._getResultFromLookup(this._values.layer_configs,e)}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var n,i;return e&&null!=(i=null!=(n=e[t])?n:e[(0,r._DJB2)(t)])?i:null}}t.V1InitializeContainer=i},11306:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.isNoopClient=t.NoopEvaluationsClient=void 0;let r=n(28551),i={success:!1,error:Error("NoClient"),duration:0,source:"Uninitialized",sourceUrl:null},s=()=>{},a=()=>i,o=()=>Promise.resolve(),l=()=>Promise.resolve(i),u={reason:"Error:NoClient"},d=e=>(...t)=>{let n="string"==typeof t[0]?t[0]:t[1];switch(e){case"gate":return(0,r._makeFeatureGate)(n,u,null);case"config":return(0,r._makeDynamicConfig)(n,u,null);case"layer":return(0,r._makeLayer)(n,u,null);case"param_store":return{name:n}}},c={sdkKey:"",options:{},values:null,user:{userID:""},errorBoundary:{},session:{data:{sessionID:"",startTime:0,lastUpdate:0},sdkKey:"",lastPersistedAt:0,storageKey:""},stableID:"",storageProvider:r.Storage,sdkInstanceID:""},_=new r.PrecomputedEvaluationsContextHandle("",()=>({}),()=>({}),()=>null,()=>({userID:""}),()=>"");t.NoopEvaluationsClient={isNoop:!0,loadingStatus:"Uninitialized",initializeSync:a,initializeAsync:l,shutdown:o,flush:o,updateRuntimeOptions:s,updateUserSync:a,updateUserAsync:l,getContext:()=>Object.assign({},c),getContextHandle:()=>_,checkGate:()=>!1,getFeatureGate:d("gate"),getDynamicConfig:d("config"),getExperiment:d("config"),getLayer:d("layer"),getParameterStore:d("param_store"),logEvent:s,on:s,off:s,$on:s,$emt:s,dataAdapter:{attach:s,getDataSync:()=>null,getDataAsync:()=>Promise.resolve(null),setData:s,setDataLegacy:s,prefetchData:o}},t.isNoopClient=function(e){return"isNoop"in e}},12315:(e,t,n)=>{var r=function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};
1Object.defineProperty(t,"__esModule",{value:!0});let i=n(28551),s=n(48688),a=n(91925),o=n(41986),l=n(26950);class u extends i.StatsigClientBase{static instance(e){let t=(0,i._getStatsigGlobal)().instance(e);return t instanceof u?t:(i.Log.warn((0,i._isServerEnv)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new u(null!=e?e:"",{}))}initializeSync(e){var t;return"Uninitialized"!==this.loadingStatus?(0,i.createUpdateDetails)(!0,this._store.getSource(),-1,null,null,["MultipleInitializations",...null!=(t=this._store.getWarnings())?t:[]]):(this._logger.start(),this.updateUserSync(this._user,e))}initializeAsync(e){return r(this,void 0,void 0,function*(){return this._initializePromise||(this._initializePromise=this._initializeAsyncImpl(e)),this._initializePromise})}updateUserSync(e,t){let n=performance.now();try{return this._updateUserSyncImpl(e,t,n)}catch(t){let e=t instanceof Error?t:Error(String(t));return this._createErrorUpdateDetails(e,n)}}_updateUserSyncImpl(e,t,n){var r;let s=[...null!=(r=this._store.getWarnings())?r:[]];this._resetForUser(e);let a=this.dataAdapter.getDataSync(this._user);null==a&&s.push("NoCachedValues"),this._store.setValues(a,this._user),this._finalizeUpdate(a);let o=null==t?void 0:t.disableBackgroundCacheRefresh;return!0===o||null==o&&(null==a?void 0:a.source)==="Bootstrap"||this._runPostUpdate(null!=a?a:null,this._user),(0,i.createUpdateDetails)(!0,this._store.getSource(),performance.now()-n,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),s)}updateUserAsync(e,t){return r(this,void 0,void 0,function*(){let n=performance.now();try{return yield this._updateUserAsyncImpl(e,t)}catch(t){let e=t instanceof Error?t:Error(String(t));return this._createErrorUpdateDetails(e,n)}})}_updateUserAsyncImpl(e,t){return r(this,void 0,void 0,function*(){this._resetForUser(e);let n=this._user;i.Diagnostics._markInitOverallStart(this._sdkKey);let r=this.dataAdapter.getDataSync(n);if(this._store.setValues(r,this._user),this._setStatus("Loading",r),r=yield this.dataAdapter.getDataAsync(r,n,t),n!==this._user)return(0,i.createUpdateDetails)(!1,this._store.getSource(),-1,Error("User changed during update"),this._network.getLastUsedInitUrlAndReset());let s=!1;null!=r&&(i.Diagnostics._markInitProcessStart(this._sdkKey),s=this._store.setValues(r,this._user),i.Diagnostics._markInitProcessEnd(this._sdkKey,{success:s})),this._finalizeUpdate(r),s||(this._errorBoundary.attachErrorIfNoneExists(i.UPDATE_DETAIL_ERROR_MESSAGES.NO_NETWORK_DATA),this.$emt({name:"initialization_failure"})),i.Diagnostics._markInitOverallEnd(this._sdkKey,s,this._store.getCurrentSourceDetails());let a=i.Diagnostics._enqueueDiagnosticsEvent(this._user,this._logger,this._sdkKey,this._options);return(0,i.createUpdateDetails)(s,this._store.getSource(),a,this._errorBoundary.getLastSeenErrorAndReset(),this._network.getLastUsedInitUrlAndReset(),this._store.getWarnings())})}getContext(){let e=(0,i._cloneObject)("StatsigUser",this._user);return null==e&&(i.Log.error("Failed to clone user"),e={}),{sdkKey:this._sdkKey,options:this._options,values:this._store.getValues(),user:e,errorBoundary:this._errorBoundary,session:i.StatsigSession.get(this._sdkKey),stableID:i.StableID.get(this._sdkKey),sdkInstanceID:this._sdkInstanceID}}getContextHandle(){return this._contextHandle}checkGate(e,t){return this.getFeatureGate(e,t).value}logEvent(e,t,n){let r="string"==typeof e?{eventName:e,value:t,metadata:n}:e;this.$emt({name:"log_event_called",event:r}),this._logger.enqueue(Object.assign(Object.assign({},r),{user:this._user,time:Date.now()}))}updateUserWithAnalyticsOnlyMetadata(e){this._user=this._configureUser(Object.assign(Object.assign({},this._user),{analyticsOnlyMetadata:e}),this._options)}_primeReadyRipcord(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this._finalizeUpdate(null)})}_initializeAsyncImpl(e){return r(this,void 0,void 0,function*(){return i.Storage.isReady()||(yield i.Storage.isReadyResolver()),this._logger.start(),this.updateUserAsync(this._user,e)})}_createErrorUpdateDetails(e,t){var n;return(0,i.createUpdateDetails)(!1,this._store.getSource(),performance.now()-t,e,null,[...null!=(n=this._store.getWarnings())?n:[]])}_finalizeUpdate(e){this._store.finalize(),this._setStatus("Ready",e)}_runPostUpdate(e,t){this.dataAdapter.getDataAsync(e,t,{priority:"low"}).catch(e=>{i.Log.error("An error occurred after update.",e)})}_resetForUser(e){this._logger.reset(),this._store.reset(),this._user=this._configureUser(e,this._options)}_configureUser(e,t){var n,r,s;let a=(0,i._normalizeUser)(e,t),o=null==(n=a.customIDs)?void 0:n.stableID;if(o){let e=null==(s=(r=this.storageProvider).isReadyResolver)?void 0:s.call(r);e?e.then(()=>i.StableID.setOverride(o,this._sdkKey),()=>i.StableID.setOverride(o,this._sdkKey)):i.StableID.setOverride(o,this._sdkKey)}return Object.keys(this._possibleFirstTouchMetadata).length>0&&(a.analyticsOnlyMetadata=Object.assign(Object.assign({},a.analyticsOnlyMetadata),this._possibleFirstTouchMetadata)),a}_getFeatureGateImpl(e,t){var n,r;let{result:s,details:a}=this._store.getGate(e);this._checkUserHasIdForEvaluation(null==s?void 0:s.id_type,e,"Gate"),this._checkInitializationStatus(a.reason);let o=(0,i._makeFeatureGate)(e,a,s),l=null==(r=null==(n=this.overrideAdapter)?void 0:n.getGateOverride)?void 0:r.call(n,o,this._user,t),u=null!=l?l:o;return this._enqueueExposure(e,(0,i._createGateExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"gate_evaluation",gate:u}),u}_getDynamicConfigImpl(e,t){var n,r;let{result:s,details:a}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(null==s?void 0:s.id_type,e,"Dynamic config"),this._checkInitializationStatus(a.reason);let o=(0,i._makeDynamicConfig)(e,a,s),l=null==(r=null==(n=this.overrideAdapter)?void 0:n.getDynamicConfigOverride)?void 0:r.call(n,o,this._user,t),u=null!=l?l:o;return this._enqueueExposure(e,(0,i._createConfigExposure)(this._user,u,this._store.getExposureMapping()),t),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:u}),u}_getExperimentImpl(e,t){var n,r,s,a;let{result:o,details:l}=this._store.getConfig(e);this._checkUserHasIdForEvaluation(null==o?void 0:o.id_type,e,"Experiment"),this._checkInitializationStatus(l.reason);let u=(0,i._makeExperiment)(e,l,o);null!=u.__evaluation&&(u.__evaluation.secondary_exposures=(0,i._mapExposures)(null!=(r=null==(n=u.__evaluation)?void 0:n.secondary_exposures)?r:[],this._store.getExposureMapping()));let d=null==(a=null==(s=this.overrideAdapter)?void 0:s.getExperimentOverride)?void 0:a.call(s,u,this._user,t),c=null!=d?d:u;return this._enqueueExposure(e,(0,i._createConfigExposure)(this._user,c,this._store.getExposureMapping()),t),this.$emt({name:"experiment_evaluation",experiment:c}),c}_getConfigListImpl(){return this._store.getConfigList()}_getLayerImpl(e,t){var n,r,s;let{result:a,details:o}=this._store.getLayer(e),l=(0,i._makeLayer)(e,o,a),u=null==(r=null==(n=this.overrideAdapter)?void 0:n.getLayerOverride)?void 0:r.call(n,l,this._user,t);(null==t?void 0:t.disableExposureLog)&&this._logger.incrementNonExposureCount(e);let d=(0,i._mergeOverride)(l,u,null!=(s=null==u?void 0:u.__value)?s:l.__value,n=>{null!=t&&t.disableExposureLog||this._enqueueExposure(e,(0,i._createLayerParameterExposure)(this._user,d,n,this._store.getExposureMapping()),t)}
1);return this.$emt({name:"layer_evaluation",layer:d}),d}_getParameterStoreImpl(e,t){var n,r;let{result:i,details:s}=this._store.getParamStore(e);this._logger.incrementNonExposureCount(e);let a={name:e,details:s,__configuration:i,get:(0,o._makeParamStoreGetter)(this,i,t)},l=null==(r=null==(n=this.overrideAdapter)?void 0:n.getParamStoreOverride)?void 0:r.call(n,a,t);return null!=l&&(a.__configuration=l.config,a.details=l.details,a.get=(0,o._makeParamStoreGetter)(this,l.config,t)),a}_checkUserHasIdForEvaluation(e,t,n){e&&((0,i._getUnitIDFromUser)(this._user,e)||i.Log.warn('The user does not have the required id_type "'.concat(e,'" for ').concat(n,' "').concat(t,'"')))}_checkInitializationStatus(e){("Uninitialized"===e||e.startsWith("Loading"))&&i.Log.warn("SDK initialization has not completed. Reason: ".concat(e))}constructor(e,t,n=null){var r,o;i.SDKType._setClientType(e,"javascript-client");let u=new a.default(n,e=>{this.$emt(e)});for(let a of(super(e,null!=(r=null==n?void 0:n.dataAdapter)?r:new l.StatsigEvaluationsDataAdapter,u,n),this._possibleFirstTouchMetadata={},this.getFeatureGate=this._memoize(i.MemoPrefix._gate,this._getFeatureGateImpl.bind(this)),this.getDynamicConfig=this._memoize(i.MemoPrefix._dynamicConfig,this._getDynamicConfigImpl.bind(this)),this.getExperiment=this._memoize(i.MemoPrefix._experiment,this._getExperimentImpl.bind(this)),this.getConfigList=this._memoize(i.MemoPrefix._configList,this._getConfigListImpl.bind(this)),this.getLayer=this._memoize(i.MemoPrefix._layer,this._getLayerImpl.bind(this)),this.getParameterStore=this._memoize(i.MemoPrefix._paramStore,this._getParameterStoreImpl.bind(this)),this._store=new s.default(e,null!=n?n:null),this._network=u,this._user=this._configureUser(t,n),this._sdkInstanceID=(0,i.getUUID)(),this._contextHandle=new i.PrecomputedEvaluationsContextHandle(e,()=>this._options,()=>this._errorBoundary,()=>this._store.getValues(),()=>this._user,()=>this._sdkInstanceID),null!=(o=null==n?void 0:n.plugins)?o:[]))a.bind(this)}}t.default=u},13968:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._notifyVisibilityChanged=t._subscribeToVisiblityChanged=t._isUnloading=t._isCurrentlyVisible=void 0;let r=n(77043),i="foreground",s="background",a=[],o=i,l=!1;t._isCurrentlyVisible=()=>o===i,t._isUnloading=()=>l,t._subscribeToVisiblityChanged=e=>{a.unshift(e)},t._notifyVisibilityChanged=e=>{e!==o&&(o=e,a.forEach(t=>t(e)))},(0,r._addWindowEventListenerSafe)("focus",()=>{l=!1,(0,t._notifyVisibilityChanged)(i)}),(0,r._addWindowEventListenerSafe)("blur",()=>(0,t._notifyVisibilityChanged)(s)),(0,r._addDocumentEventListenerSafe)("visibilitychange",()=>{(0,t._notifyVisibilityChanged)("visible"===document.visibilityState?i:s)}),(0,r._addWindowEventListenerSafe)((0,r._getUnloadEvent)(),()=>{l=!0,(0,t._notifyVisibilityChanged)(s)})},14186:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.V2InitializeContainer=void 0;let r=n(28551);class i{constructor(e){this._values=e}getGate(e){var t,n,r;let i=this._getResultFromLookup(this._values.feature_gates,e);return i?{name:e,value:!0===i.v,rule_id:null!=(t=i.r)?t:"default",secondary_exposures:null!=(n=i.s)?n:[],id_type:null!=(r=i.i)?r:""}:null}getConfig(e){var t,n,r,i;let s=this._getResultFromLookup(this._values.dynamic_configs,e);return s?{name:e,value:null!=(t=this._values.values[s.v])?t:{},rule_id:s.r,secondary_exposures:null!=(n=s.s)?n:[],id_type:null!=(r=s.i)?r:"",is_user_in_experiment:!0===s.ue,passed:!0===s.p,group_name:null!=(i=s.gn)?i:void 0,is_experiment_active:!0===s.ea,group:s.r,is_device_based:"stableID"===s.i}:null}getLayer(e){var t,n,r,i,s,a;let o=this._getResultFromLookup(this._values.layer_configs,e);return o?{name:e,value:null!=(t=this._values.values[o.v])?t:{},rule_id:o.r,secondary_exposures:null!=(n=o.s)?n:[],is_user_in_experiment:!0===o.ue,group_name:null!=(r=o.gn)?r:void 0,is_experiment_active:!0===o.ea,group:o.r,is_device_based:"stableID"===o.i,allocated_experiment_name:null!=(i=o.ae)?i:"",explicit_parameters:null!=(s=o.ep)?s:[],undelegated_secondary_exposures:null!=(a=o.us)?a:[],parameter_rule_ids:o.pr}:null}getParamStore(e){return this._getResultFromLookup(this._values.param_stores,e)}getConfigList(){return Object.keys(this._values.dynamic_configs)}getExposureMapping(){return this._values.exposures}_getResultFromLookup(e,t){var n,i;return e&&null!=(i=null!=(n=e[t])?n:e[(0,r._DJB2)(t)])?i:null}}t.V2InitializeContainer=i},15163:(e,t,n)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t._setObjectInStorage=t._getObjectFromStorage=t.Storage=void 0;let r=n(28109),i=n(77043),s={},a={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:e=>s[e]?s[e]:null,setItem:(e,t)=>{s[e]=t},removeItem:e=>{delete s[e]},getAllKeys:()=>Object.keys(s)},o=null;try{let e=(0,i._getWindowSafe)();e&&e.localStorage&&"function"==typeof e.localStorage.getItem&&(o={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>e.localStorage.getItem(t),setItem:(t,n)=>e.localStorage.setItem(t,n),removeItem:t=>e.localStorage.removeItem(t),getAllKeys:()=>Object.keys(e.localStorage)})}catch(e){r.Log.warn("Failed to setup localStorageProvider.")}let l=null!=o?o:a,u=l;function d(e){try{return e()}catch(e){if(e instanceof Error&&"SecurityError"===e.name)return t.Storage._setProvider(a),null;throw e}}t.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:e=>d(()=>u.getItem(e)),setItem:(e,t)=>d(()=>u.setItem(e,t)),removeItem:e=>u.removeItem(e),getAllKeys:()=>u.getAllKeys(),_setProvider:e=>{l=e,u=e},_setDisabled:e=>{u=e?a:l}},t._getObjectFromStorage=function(e){let n=t.Storage.getItem(e);try{return JSON.parse(null!=n?n:"null")}catch(t){return r.Log.error(`Failed to parse value for key "${e}"`),null}},t._setObjectInStorage=function(e,n){t.Storage.setItem(e,JSON.stringify(n))}},16718:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._makeTypedGet=t._mergeOverride=t._makeLayer=t._makeExperiment=t._makeDynamicConfig=t._makeFeatureGate=void 0;let r=n(28109),i=n(81711);function s(e,t,n,r){var i;return{name:e,details:t,ruleID:null!=(i=null==n?void 0:n.rule_id)?i:"",__evaluation:n,value:r}}function a(e,t,n){var r,i;let a=null!=(r=null==n?void 0:n.value)?r:{};return Object.assign(Object.assign({},s(e,t,n,a)),{idType:null!=(i=null==n?void 0:n.id_type)?i:null,get:o(e,null==n?void 0:n.value)})}function o(e,t,n){return(s,a)=>{var o;let l=null!=(o=null==t?void 0:t[s])?o:null;return null==l?null!=a?a:null:null==a||(0,i._isTypeMatch)(l,a)?(null==n||n(s),l):(r.Log.warn(`Parameter type mismatch. '${e}.${s}' was found to be type '${typeof l}' but fallback/return type is '${typeof a}'. See https://docs.statsig.com/client/javascript-sdk/#typed-getters`),null!=a?a:null)}}t._makeFeatureGate=function(e,t,n){var r;return Object.assign(Object.assign({},s(e,t,n,(null==n?void 0:n.value)===!0)),{idType:null!=(r=null==n?void 0:n.id_type)?r:null})},t._makeDynamicConfig=a,t._makeExperiment=function(e,t,n){var r;return Object.assign(Object.assign({},a(e,t,n)),{groupName:null!=(r=null==n?void 0:n.group_name)?r:null})},t._makeLayer=function(e,t,n,r){var i,a;return Object.assign(Object.assign({},s(e,t,n,void 0)),{get:o(e,null==n?void 0:n.value,r),groupName:null!=(i=null==n?void 0:n.group_name)?i:null,__value:null!=(a=null==n?void 0:n.value)?a:{}})},t._mergeOverride=function(e,t,n,r){return Object.assign(Object.assign(Object.assign({},e),t),{get:o(e.name,n,r)})},t._makeTypedGet=o},20662:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SDKFlags=void 0;let n={};t.SDKFlags={setFlags:(e,t)=>{n[e]=t},get:(e,t)=>{var r,i;return null!=(i=null==(r=n[e])?void 0:r[t])&&i}}},20764:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UrlConfiguration=void 0;let r=n(40195),i=n(87927),s={[i.Endpoint._initialize]:"i",[i.Endpoint._rgstr]:"e",[i.Endpoint._download_config_specs]:"d"};class a{constructor(e,t,n,r){this.customUrl=null,this.fallbackUrls=null,this.endpoint=e,this.endpointDnsKey=s[e],t&&(this.customUrl=t),!t&&n&&(this.customUrl=n.endsWith("/")?`${n}${e}`:`${n}/${e}`),r&&(this.fallbackUrls=r);let a=i.NetworkDefault[e];this.defaultUrl=`${a}/${e}`}getUrl(){var e;return null!=(e=this.customUrl)?e:this.defaultUrl}getChecksum(){var e;let t=(null!=(e=this.fallbackUrls)?e:[]).sort().join(",");return(0,r._DJB2)(this.customUrl+t)}}t.UrlConfiguration=a},20888:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._createLayerParameterExposure=t._createConfigExposure=t._mapExposures=t._createGateExposure=t._isExposureEvent=void 0;let n="statsig::config_exposure",r="statsig::gate_exposure",i="statsig::layer_exposure",s=(e,t,n,r,i)=>(n.bootstrapMetadata&&(r.bootstrapMetadata=n.bootstrapMetadata),{eventName:e,user:t,value:null,metadata:o(n,r),secondaryExposures:i,time:Date.now()});function a(e,t){return e.map(e=>"string"==typeof e?(null!=t?t:{})[e]:e).filter(e=>null!=e)}t._isExposureEvent=({eventName:e})=>
1e===r||e===n||e===i,t._createGateExposure=(e,t,n)=>{var i,o,l;let u={gate:t.name,gateValue:String(t.value),ruleID:t.ruleID};return(null==(i=t.__evaluation)?void 0:i.version)!=null&&(u.configVersion=t.__evaluation.version),s(r,e,t.details,u,a(null!=(l=null==(o=t.__evaluation)?void 0:o.secondary_exposures)?l:[],n))},t._mapExposures=a,t._createConfigExposure=(e,t,r)=>{var i,o,l,u;let d={config:t.name,ruleID:t.ruleID};return(null==(i=t.__evaluation)?void 0:i.version)!=null&&(d.configVersion=t.__evaluation.version),(null==(o=t.__evaluation)?void 0:o.passed)!=null&&(d.rulePassed=String(t.__evaluation.passed)),s(n,e,t.details,d,a(null!=(u=null==(l=t.__evaluation)?void 0:l.secondary_exposures)?u:[],r))},t._createLayerParameterExposure=(e,t,n,r)=>{var o,l,u,d,c,_,h;let g=t.__evaluation,f=(null==(o=null==g?void 0:g.explicit_parameters)?void 0:o.includes(n))===!0,v="",p=null!=(l=null==g?void 0:g.undelegated_secondary_exposures)?l:[];f&&(v=null!=(u=g.allocated_experiment_name)?u:"",p=null!=(d=g.secondary_exposures)?d:[]);let m=null==(c=t.__evaluation)?void 0:c.parameter_rule_ids,y={config:t.name,parameterName:n,ruleID:null!=(_=null==m?void 0:m[n])?_:t.ruleID,allocatedExperiment:v,isExplicitParameter:String(f)};return(null==(h=t.__evaluation)?void 0:h.version)!=null&&(y.configVersion=t.__evaluation.version),s(i,e,t.details,y,a(p,r))};let o=(e,t)=>(t.reason=e.reason,e.lcut&&(t.lcut=String(e.lcut)),e.receivedAt&&(t.receivedAt=String(e.receivedAt)),t)},21377:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(12115),i=n(28551),s=n(11306),a=n(96340);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,s.isNoopClient)(n)?(i.Log.warn(`useParameterStore hook failed to find a valid StatsigClient for parameter store '${e}'.`),s.NoopEvaluationsClient.getParameterStore(e,t)):n.getParameterStore(e,t),[e,n,o,...t?Object.values(t):[]])}},22619:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._makeDataAdapterResult=t.DataAdapterCore=void 0;let i=n(28109),s=n(54727),a=n(80503),o=n(15163),l=n(50012);class u{constructor(e,t){this._adapterName=e,this._cacheSuffix=t,this._options=null,this._sdkKey=null,this._cacheLimit=10,this._lastModifiedStoreKey=`statsig.last_modified_time.${t}`,this._inMemoryCache=new c}attach(e,t,n){this._sdkKey=e,this._options=t}getDataSync(e){let t=e&&(0,a._normalizeUser)(e,this._options),n=this._getCacheKey(t),r=this._inMemoryCache.get(n,t);if(r&&this._getIsCacheValueValid(r))return r;let i=this._loadFromCache(n);return i&&this._getIsCacheValueValid(i)?(this._inMemoryCache.add(n,i,this._cacheLimit),this._inMemoryCache.get(n,t)):null}setData(e,t){let n=t&&(0,a._normalizeUser)(t,this._options),r=this._getCacheKey(n);this._inMemoryCache.add(r,d("Bootstrap",e,null,n),this._cacheLimit)}_getIsCacheValueValid(e){return null==e.stableID||e.stableID===s.StableID.get(this._getSdkKey())}_getDataAsyncImpl(e,t,n){return r(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());let r=null!=e?e:this.getDataSync(t),s=[this._fetchAndPrepFromNetwork(r,t,n)];return(null==n?void 0:n.timeoutMs)&&s.push(new Promise(e=>setTimeout(e,n.timeoutMs)).then(()=>(i.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(s)})}_prefetchDataImpl(e,t){return r(this,void 0,void 0,function*(){let n=e&&(0,a._normalizeUser)(e,this._options),r=this._getCacheKey(n),i=yield this._getDataAsyncImpl(null,n,t);i&&this._inMemoryCache.add(r,Object.assign(Object.assign({},i),{source:"Prefetch"}),this._cacheLimit)})}_fetchAndPrepFromNetwork(e,t,n){return r(this,void 0,void 0,function*(){var r;let a=null!=(r=null==e?void 0:e.data)?r:null,o=null!=e&&this._isCachedResultValidFor204(e,t),u=yield this._fetchFromNetwork(a,t,n,o);if(!u)return i.Log.debug("No response returned for latest value"),null;
1let c=(0,l._typedJsonParse)(u,"has_updates","Response"),_=this._getSdkKey(),h=s.StableID.get(_),g=null;if((null==c?void 0:c.has_updates)===!0)g=d("Network",u,h,t);else{if(!a||(null==c?void 0:c.has_updates)!==!1)return null;g=d("NetworkNotModified",a,h,t)}let f=this._getCacheKey(t);return this._inMemoryCache.add(f,g,this._cacheLimit),this._writeToCache(f,g),g})}_getSdkKey(){return null!=this._sdkKey?this._sdkKey:(i.Log.error(`${this._adapterName} is not attached to a Client`),"")}_loadFromCache(e){var t;let n=null==(t=o.Storage.getItem)?void 0:t.call(o.Storage,e);if(null==n)return null;let r=(0,l._typedJsonParse)(n,"source","Cached Result");return r?Object.assign(Object.assign({},r),{source:"Cache"}):null}_writeToCache(e,t){let n=JSON.stringify(t);for(let t=0;t<8;t++)try{o.Storage.setItem(e,n);break}catch(t){if(!(t instanceof Error)||!(t.toString().includes("QuotaExceededError")||t.toString().includes("QUOTA_EXCEEDED_ERR"))||this._cacheLimit<=1)throw t;this._cacheLimit=Math.ceil(this._cacheLimit/2),this._runLocalStorageCacheEviction(e,this._cacheLimit-1)}this._runLocalStorageCacheEviction(e)}_runLocalStorageCacheEviction(e,t=this._cacheLimit){var n;let r=null!=(n=(0,o._getObjectFromStorage)(this._lastModifiedStoreKey))?n:{};for(let n of(r[e]=Date.now(),_(r,t)))delete r[n],o.Storage.removeItem(n);(0,o._setObjectInStorage)(this._lastModifiedStoreKey,r)}}function d(e,t,n,r){return{source:e,data:t,receivedAt:Date.now(),stableID:n,fullUserHash:(0,a._getFullUserHash)(r)}}t.DataAdapterCore=u,t._makeDataAdapterResult=d;class c{constructor(){this._data={}}get(e,t){var n;let r=this._data[e],s=null==r?void 0:r.stableID,a=null==(n=null==t?void 0:t.customIDs)?void 0:n.stableID;return a&&s&&a!==s?(i.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):r}add(e,t,n){for(let e of _(this._data,n-1))delete this._data[e];this._data[e]=t}merge(e){this._data=Object.assign(Object.assign({},this._data),e)}}function _(e,t){let n=Object.keys(e);return n.length<=t?[]:0===t?n:n.sort((t,n)=>{let r=e[t],i=e[n];return"object"==typeof r&&"object"==typeof i?r.receivedAt-i.receivedAt:r-i}).slice(0,n.length-t)}},26950:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigEvaluationsDataAdapter=void 0;let i=n(28551),s=n(91925);class a extends i.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this._network=null,this._options=null}attach(e,t,n){super.attach(e,t,n),null!==n&&n instanceof s.default?this._network=n:this._network=new s.default(null!=t?t:{})}getDataAsync(e,t,n){return this._getDataAsyncImpl(e,(0,i._normalizeUser)(t,this._options),n)}prefetchData(e,t){return this._prefetchDataImpl(e,t)}setData(e){let t=(0,i._typedJsonParse)(e,"has_updates","data");t&&"user"in t?super.setData(e,t.user):i.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(e,t){super.setData(e,t)}_fetchFromNetwork(e,t,n,i){return r(this,void 0,void 0,function*(){var r;let s=yield null==(r=this._network)?void 0:r.fetchEvaluations(this._getSdkKey(),e,null==n?void 0:n.priority,t,i);return null!=s?s:null})}_getCacheKey(e){var t;let n=(0,i._getStorageKey)(this._getSdkKey(),e,null==(t=this._options)?void 0:t.customUserCacheKeyFunc);return`${i.DataAdapterCachePrefix}.${this._cacheSuffix}.${n}`}_isCachedResultValidFor204(e,t){return null!=e.fullUserHash&&e.fullUserHash===(0,i._getFullUserHash)(t)}}t.StatsigEvaluationsDataAdapter=a},28109:(e,t)=>{function n(e){return e.unshift("[Statsig]"),e}Object.defineProperty(t,"__esModule",{value:!0}),t.Log=t.LogLevel=void 0,t.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class r{static info(...e){r.level>=t.LogLevel.Info&&console.info("  INFO ",...n(e))}static debug(...e){r.level>=t.LogLevel.Debug&&console.debug(" DEBUG ",...n(e))}static warn(...e){r.level>=t.LogLevel.Warn&&console.warn("  WARN ",...n(e))}static error(...e){r.level>=t.LogLevel.Error&&console.error(" ERROR ",...n(e))}}t.Log=r,r.level=t.LogLevel.Warn},28446:(e,t)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t.createMemoKey=t.MemoPrefix=void 0,t.MemoPrefix={_gate:"g",_dynamicConfig:"c",_experiment:"e",_configList:"cl",_layer:"l",_paramStore:"p"};let n=new Set([]),r=new Set(["userPersistedValues"]);t.createMemoKey=function(e,t,i){let s=`${e}|${t}`;if(!i)return s;for(let e of Object.keys(i)){if(r.has(e))return;n.has(e)?s+=`|${e}=true`:s+=`|${e}=${i[e]}`}return s}},28551:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=t.Log=t.EventLogger=t.Diagnostics=void 0,n(41832);let s=n(41832),a=n(57079);Object.defineProperty(t,"Diagnostics",{enumerable:!0,get:function(){return a.Diagnostics}});let o=n(60047);Object.defineProperty(t,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}});let l=n(28109);Object.defineProperty(t,"Log",{enumerable:!0,get:function(){return l.Log}});let u=n(43749),d=n(15163);Object.defineProperty(t,"Storage",{enumerable:!0,get:function(){return d.Storage}}),i(n(41832),t),i(n(98060),t),i(n(61390),t),i(n(22619),t),i(n(57079),t),i(n(79174),t),i(n(51691),t),i(n(30703),t),i(n(58100),t),i(n(40195),t),i(n(71352),t),i(n(28109),t),i(n(28446),t),i(n(87927),t),i(n(94402),t),i(n(5440),t),i(n(31604),t),i(n(77043),t),i(n(83955),t),i(n(71074),t),i(n(47173),t),i(n(54727),t),i(n(98),t),i(n(85537),t),i(n(38587),t),i(n(20888),t),i(n(43749),t),i(n(4607),t),i(n(93167),t),i(n(16718),t),i(n(40537),t),i(n(80503),t),i(n(15163),t),i(n(50012),t),i(n(81711),t),i(n(20764),t),i(n(56730),t),i(n(13968),t),i(n(72641),t),i(n(20662),t),Object.assign((0,s._getStatsigGlobal)(),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},30703:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},31604:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},34093:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.FlushCoordinator=void 0;let i=n(91320),s=n(79650),a=n(73820),o=n(64598),l=n(40195),u=n(28109),d=n(94402),c=n(77043),_=n(71074),h=n(4607),g=n(15163),f=new Set(["network_request_timed_out_no_response","network_request_exception_no_response","event_sender_post_returned_null","event_sender_post_returned_undefined","event_sender_post_exception"]);class v{constructor(e,t,n,r,i,o,l,u,d,c){this._cooldownTimer=null,this._maxIntervalTimer=null,this._hasRunQuickFlush=!1,this._currentFlushPromise=null,this._creationTime=Date.now(),this._isShuttingDown=!1,this._storageKey=null,this._flushInterval=new a.FlushInterval,this._batchQueue=e,this._pendingEvents=t,this._onPrepareFlush=n,this._errorBoundary=c,this._sdkKey=r,this._loggingEnabled=d,this._eventSender=new s.EventSender(r,i,o,l,u)}setLoggingEnabled(e){this._loggingEnabled=e}setLogEventCompressionMode(e){this._eventSender.setLogEventCompressionMode(e)}startScheduledFlushCycle(){this._scheduleNextFlush()}stopScheduledFlushCycle(){this._clearAllTimers()}addEvent(e){this._pendingEvents.addToPendingEventsQueue(e),!this._currentFlushPromise&&this._pendingEvents.hasEventsForFullBatch()&&this.processLimitFlush()}processManualFlush(){return r(this,void 0,void 0,function*(){return this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(o.FlushTypeValues.Manual).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()}),this._currentFlushPromise})}processShutdown(){return r(this,void 0,void 0,function*(){return this._isShuttingDown=!0,this._clearAllTimers(),this._currentFlushPromise&&(yield this._currentFlushPromise),this._currentFlushPromise=this._executeFlush(o.FlushTypeValues.Shutdown).catch(e=>{u.Log.error(`Error during shutdown flush: ${e}`)}).finally(()=>{this._currentFlushPromise=null}),this._currentFlushPromise})}_executeFlush(e){return r(this,void 0,void 0,function*(){this._clearAllTimers();try{this._prepareQueueForFlush(e);let t=this._batchQueue.takeAllBatches();if(0===t.length)return;yield Promise.all(t.map(t=>this._processOneBatch(t,e)))}finally{this._isShuttingDown||this._scheduleNextFlush()}})}checkQuickFlush(){!this._hasRunQuickFlush&&(Date.now()-this._creationTime>i.EventRetryConstants.QUICK_FLUSH_WINDOW_MS||(this._hasRunQuickFlush=!0,setTimeout(()=>{this.processManualFlush().catch(e=>{u.Log.warn("Quick flush failed:",e)})},i.EventRetryConstants.QUICK_FLUSH_WINDOW_MS)))}_attemptScheduledFlush(){let e;if(this._currentFlushPromise)return void this._scheduleNextFlush();let t=this.containsAtLeastOneFullBatch(),n=this._flushInterval.hasReachedMaxInterval();if(!t&&!n)return void this._scheduleNoopPollTick();this._flushInterval.markFlushAttempt(),e=t?o.FlushTypeValues.ScheduledFullBatch:o.FlushTypeValues.ScheduledMaxTime,this._currentFlushPromise=this._processNextBatch(e).then(()=>{}).catch(e=>{u.Log.error("Error during scheduled flush:",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})}processLimitFlush(){this._flushInterval.hasCompletelyRecoveredFromBackoff()&&(this._currentFlushPromise||(this._currentFlushPromise=this._processLimitFlush
1Internal().catch(e=>{u.Log.error("Error during limit flush",e)}).finally(()=>{this._currentFlushPromise=null,this._scheduleNextFlush()})))}_processLimitFlushInternal(){return r(this,void 0,void 0,function*(){if(yield this._processNextBatch(o.FlushTypeValues.Limit))for(;this._flushInterval.hasCompletelyRecoveredFromBackoff()&&this.containsAtLeastOneFullBatch()&&(yield this._processNextBatch(o.FlushTypeValues.Limit)););})}_scheduleNextFlush(){if(this._clearAllTimers(),this._isShuttingDown)return;let e=Math.max(0,this._flushInterval.getTimeUntilNextFlush());this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,_.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e);let t=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,_.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},t)}_clearAllTimers(){null!==this._cooldownTimer&&(clearTimeout(this._cooldownTimer),this._cooldownTimer=null),null!==this._maxIntervalTimer&&(clearTimeout(this._maxIntervalTimer),this._maxIntervalTimer=null)}_scheduleNoopPollTick(){if(this._clearAllTimers(),this._isShuttingDown)return;this._cooldownTimer=setTimeout(()=>{this._cooldownTimer=null,_.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},i.EventRetryConstants.TICK_INTERVAL_MS);let e=Math.max(0,this._flushInterval.getTimeTillMaxInterval());this._maxIntervalTimer=setTimeout(()=>{this._maxIntervalTimer=null,_.StatsigSession.checkForIdleSession(this._sdkKey),this._attemptScheduledFlush()},e)}_processNextBatch(e){return r(this,void 0,void 0,function*(){this._prepareQueueForFlush(e);let t=this._batchQueue.takeNextBatch();return!!t&&this._processOneBatch(t,e)})}_processOneBatch(e,t){return r(this,void 0,void 0,function*(){if(this._loggingEnabled!==h.LoggingEnabledOption.always&&(0,c._isServerEnv)())return this._flushInterval.adjustForSuccess(),!0;let n=yield this._eventSender.sendBatch(e);return n.success?(this._flushInterval.adjustForSuccess(),!0):(this._flushInterval.adjustForFailure(),this._handleFailure(e,t,n.statusCode,n.failurePath,n.failureErrorMessage,n.failureDiagnosticBucket,n.failureDiagnosticMetadata),!1)})}_prepareQueueForFlush(e){this._onPrepareFlush();let t=this.convertPendingEventsToBatches();t>0&&(u.Log.warn(`Dropped ${t} events`),this._errorBoundary.logDroppedEvents(t,"Batch queue limit reached during batching",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:i.EventRetryConstants.MAX_PENDING_BATCHES,flushType:e,retries:"dropped before batching"}))}containsAtLeastOneFullBatch(){return this._pendingEvents.hasEventsForFullBatch()||this._batchQueue.hasFullBatch()}convertPendingEventsToBatches(){if(this._pendingEvents.isEmpty())return 0;let e=this._pendingEvents.takeAll();return this._batchQueue.createBatches(e)}_isRetryableBatch(e,t){return!!(d.RETRYABLE_CODES.has(e)||-1===e&&t&&f.has(t))}_handleFailure(e,t,n,r,s,a,l){if(t===o.FlushTypeValues.Shutdown){u.Log.warn(`${t} flush failed during shutdown. ${e.events.length} event(s) will be saved to storage for retry in next session.`),this._saveShutdownFailedEventsToStorage(e.events);return}if(!this._isRetryableBatch(n,r)){u.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped. Non-retryable error: ${n}`),this._errorBoundary.logEventRequestFailure(e.events.length,"non-retryable error",t,n,e.attempts,r,s,a,l);return}if(e.attempts>=i.EventRetryConstants.MAX_RETRY_ATTEMPTS){u.Log.warn(`${t} flush failed after ${e.attempts} attempt(s). ${e.events.length} event(s) will be dropped.`),this._errorBoundary.logEventRequestFailure(e.events.length,"max retry attempts exceeded",t,n,e.attempts,r,s,a,l);return}e.incrementAttempts();let d=this._batchQueue.requeueBatch(e);d>0&&(u.Log.warn(`Failed to requeue batch : dropped ${d} events due to full queue`),this._errorBoundary.logDroppedEvents(d,"Batch queue limit reached during requeue",{loggingInterval:this._flushInterval.getCurrentIntervalMs(),batchSize:this._batchQueue.batchSize(),maxPendingBatches:i.EventRetryConstants.MAX_PENDING_BATCHES,flushType:t,retries:e.attempts}))}loadAndRetryShutdownFailedEvents(){return r(this,void 0,void 0,function*(){let e=this._getStorageKey();try{g.Storage.isReady()||(yield g.Storage.isReadyResolver());let t=this._getShutdownFailedEventsFromStorage(e);if(0===t.length)return;u.Log.debug(`Loading ${t.length} failed shutdown event(s) from storage for retry`),g.Storage.removeItem(e),t.forEach(e
1=>{this.addEvent(e)}),yield this.processManualFlush()}catch(e){u.Log.warn("Failed to load and retry failed shutdown events:",e)}})}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.failed_shutdown_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_saveShutdownFailedEventsToStorage(e){let t=this._getStorageKey();try{let n=[...this._getShutdownFailedEventsFromStorage(t),...e];n.length>i.EventRetryConstants.MAX_LOCAL_STORAGE&&(n=n.slice(-i.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,g._setObjectInStorage)(t,n),u.Log.debug(`Saved ${e.length} failed shutdown event(s) to storage (total stored: ${n.length})`)}catch(e){u.Log.warn("Unable to save failed shutdown events to storage:",e)}}_getShutdownFailedEventsFromStorage(e){try{let t=(0,g._getObjectFromStorage)(e);if(Array.isArray(t))return t;return[]}catch(e){return[]}}}t.FlushCoordinator=v},38587:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.DataAdapterCachePrefix=void 0,t.DataAdapterCachePrefix="statsig.cached"},40195:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getSortedObject=t._DJB2Object=t._DJB2=void 0;let r=n(81711);t._DJB2=e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t&=t;return String(t>>>0)},t._DJB2Object=(e,n)=>(0,t._DJB2)(JSON.stringify((0,t._getSortedObject)(e,n))),t._getSortedObject=(e,n)=>{if(null==e)return null;let i=Object.keys(e).sort(),s={};return i.forEach(i=>{let a=e[i];if(0===n||"object"!==(0,r._typeOf)(a)){s[i]=a;return}s[i]=(0,t._getSortedObject)(a,null!=n?n-1:n)}),s}},40537:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},41832:(e,t,n)=>{var r,i,s;Object.defineProperty(t,"__esModule",{value:!0}),t._getInstance=t._getStatsigGlobalFlag=t._getStatsigGlobal=void 0;let a=n(28109);t._getStatsigGlobal=()=>{try{return"undefined"!=typeof __STATSIG__?__STATSIG__:c}catch(e){return c}},t._getStatsigGlobalFlag=e=>(0,t._getStatsigGlobal)()[e],t._getInstance=e=>{let n=(0,t._getStatsigGlobal)();return e?n.instances&&n.instances[e]:(n.instances&&Object.keys(n.instances).length>1&&a.Log.warn("Call made to Statsig global instance without an SDK key but there is more than one client instance. If you are using mulitple clients, please specify the SDK key."),n.firstInstance)};let o="__STATSIG__",l="undefined"!=typeof window?window:{},u=void 0!==n.g?n.g:{},d="undefined"!=typeof globalThis?globalThis:{},c=null!=(s=null!=(i=null!=(r=l[o])?r:u[o])?i:d[o])?s:{instance:t._getInstance};l[o]=c,u[o]=c,d[o]=c},41986:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._makeParamStoreGetter=void 0;let r=n(28551),i={disableExposureLog:!0};function s(e){return null==e||!1===e.disableExposureLog}function a(e,t){return null!=t&&!(0,r._isTypeMatch)(e,t)}t._makeParamStoreGetter=function(e,t,n){return(o,l)=>{if(null==t)return l;let u=t[o];if(null==u||null!=l&&(0,r._typeOf)(l)!==u.param_type)return l;switch(u.ref_type){case"static":return u.value;case"gate":return e.getFeatureGate(u.gate_name,s(n)?void 0:i).value?u.pass_value:u.fail_value;case"dynamic_config":let d=e.getDynamicConfig(u.config_name,s(n)?void 0:i).get(u.param_name);return a(d,l)?l:d;case"experiment":let c=e.getExperiment(u.experiment_name,s(n)?void 0:i).get(u.param_name);return a(c,l)?l:c;case"layer":let _=e.getLayer(u.layer_name,s(n)?void 0:i).get(u.param_name);return a(_,l)?l:_;default:return l}}}},43374:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(12115),i=n(28551),s=n(11306),a=n(96340);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,s.isNoopClient)(n)?(i.Log.warn(`useExperiment hook failed to find a valid Statsig client for experiment '${e}'.`),s.NoopEvaluationsClient.getExperiment(e,t)):n.getExperiment(e,t),[e,n,o,...t?Object.values(t):[]])}},43749:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigMetadataProvider=t.SDK_VERSION=void 0,t.SDK_VERSION="3.33.3";let n={sdkVersion:t.SDK_VERSION,sdkType:"js-mono"};t.StatsigMetadataProvider={get:()=>n,add:e=>{n=Object.assign(Object.assign({},n),e)}}},46024:(e,t,n)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigInternalClientFactoryAsync=void 0;let r=n(12115),i=n(28551);t.useStatsigInternalClientFactoryAsync=function(e,t){let n=(0,r.useMemo)(()=>{var n;return null!=(n=(0,i._getInstance)(t.sdkKey))?n:e(t)},[]),[s,a]=(0,r.useState)("Ready"!==n.loadingStatus);return(0,r.useMemo)(()=>{"Ready"!==n.loadingStatus&&n.initializeAsync().catch(i.Log.error).finally(()=>a(!1))},[]),{client:n,isLoading:s}}},46385:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PendingEvents=void 0;let r=n(28109);class i{constructor(e){this._pendingEvents=[],this._batchSize=e}addToPendingEventsQueue(e){this._pendingEvents.push(e),r.Log.debug("Enqueued Event:",e)}hasEventsForFullBatch(){return this._pendingEvents.length>=this._batchSize}takeAll(){let e=this._pendingEvents;return this._pendingEvents=[],e}isEmpty(){return 0===this._pendingEvents.length}}t.PendingEvents=i},47173:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._fastApproxSizeOf=void 0,t._fastApproxSizeOf=(e,t)=>{let n=[e],r=[Object.keys(e)],i=[0],s=[0],a=0,o=0;for(;;){if(i[a]<r[a].length){let e=r[a][i[a]++],o=n[a][e];if(s[a]+=e.length,o&&"object"==typeof o){n[++a]=o,r[a]=Object.keys(o),i[a]=s[a]=0;continue}if(s[a]+=(o+"").length+1,s[a]<t)continue}for(o=s[a--];a>=0&&(s[a]+=o+2)>=t;o=s[a--]);if(a<0)return o}}},48688:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(28551),i=n(9441),s=n(14186);class a{constructor(e,t){this._sdkKey=e,this._options=t,this._valuesForExternalUse=null,this._values=null,this._source="Uninitialized",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings=new Set}reset(){this._values=null,this._valuesForExternalUse=null,this._source="Loading",this._lcut=0,this._receivedAt=0,this._bootstrapMetadata=null,this._warnings.clear()}finalize(){this._values||(this._source="NoValues")}getValues(){return this._valuesForExternalUse}setValues(e,t){var n,a;if(!e)return!1;let o=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse");return null!=o&&(this._source=e.source,(null==o?void 0:o.has_updates)!==!0||(null!=(n=o.time)?n:0)<this._lcut||(this._valuesForExternalUse=(0,r._typedJsonParse)(e.data,"has_updates","EvaluationResponse"),this._lcut=o.time,this._receivedAt=e.receivedAt,"init-v2"===o.response_format?this._values=new s.V2InitializeContainer(o):this._values=new i.V1InitializeContainer(o),this._bootstrapMetadata=this._extractBootstrapMetadata(e.source,o),e.source&&o.user&&this._setWarningState(t,o),r.SDKFlags.setFlags(this._sdkKey,null!=(a=o.sdk_flags)?a:{}),!0))}getWarnings(){if(0!==this._warnings.size)return Array.from(this._warnings)}getGate(e){let t=this._values?this._values.getGate(e):null;return this._getDetailedStoreResult(t)}getConfig(e){let t=this._values?this._values.getConfig(e):null;return this._getDetailedStoreResult(t)}getConfigList(){return this._values?this._values.getConfigList():[]}getLayer(e){let t=this._values?this._values.getLayer(e):null;return this._getDetailedStoreResult(t)}getParamStore(e){let t=this._values?this._values.getParamStore(e):null;return this._getDetailedStoreResult(t)}getSource(){return this._source}getExposureMapping(){var e;return null==(e=this._values)?void 0:e.getExposureMapping()}_extractBootstrapMetadata(e,t){if("Bootstrap"!==e)return null;let n={};return t.user&&(n.user=t.user),t.sdkInfo&&(n.generatorSDKInfo=t.sdkInfo),n.lcut=t.time,n}_getDetailedStoreResult(e){return{result:e,details:this._getDetails(null==e)}}_setWarningState(e,t){var n,i,s;let a=r.StableID.get(this._sdkKey);if((null==(n=e.customIDs)?void 0:n.stableID)!==a&&((null==(i=e.customIDs)?void 0:i.stableID)||a))return void this._warnings.add("StableIDMismatch");if("user"in t){let n=t.user,i=Object.assign(Object.assign({},e),{analyticsOnlyMetadata:void 0,privateAttributes:void 0});(null==(s=this._options)?void 0:s.disableStableID)&&(i=Object.assign(Object.assign({},i),{customIDs:Object.assign(Object.assign({},i.customIDs),{stableID:void 0})}),n=Object.assign(Object.assign({},n),{customIDs:Object.assign(Object.assign({},n.customIDs),{stableID:void 0})})),(0,r._getFullUserHash)(i)!==(0,r._getFullUserHash)(n)&&this._warnings.add("Parti
1alUserMatch")}}getCurrentSourceDetails(){if("Uninitialized"===this._source||"NoValues"===this._source)return{reason:this._source};let e={reason:this._source,lcut:this._lcut,receivedAt:this._receivedAt};return this._warnings.size>0&&(e.warnings=Array.from(this._warnings)),e}_getDetails(e){var t,n;let r=this.getCurrentSourceDetails(),i=r.reason,s=null!=(t=r.warnings)?t:[];"Bootstrap"===this._source&&s.length>0&&(i+=s[0]),"Uninitialized"!==i&&"NoValues"!==i&&(i=`${i}:${e?"Unrecognized":"Recognized"}`);let a="Bootstrap"===this._source&&null!=(n=this._bootstrapMetadata)?n:void 0;return a&&(r.bootstrapMetadata=a),Object.assign(Object.assign({},r),{reason:i})}}t.default=a},50012:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._typedJsonParse=void 0;let r=n(28109);t._typedJsonParse=function(e,t,n){try{let n=JSON.parse(e);if(n&&"object"==typeof n&&t in n)return n}catch(e){}return r.Log.error(`Failed to parse ${n}`),null}},50126:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(12115),i=n(28551),s=n(11306),a=n(96340);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,s.isNoopClient)(n)?(i.Log.warn(`useFeatureGate hook failed to find a valid StatsigClient for gate '${e}'.`),s.NoopEvaluationsClient.getFeatureGate(e,t)):n.getFeatureGate(e,t),[e,n,o,...t?Object.values(t):[]])}},50191:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(12115),i=n(28551),s=n(11306),a=n(96340);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,s.isNoopClient)(n)?(i.Log.warn(`useGateValue hook failed to find a valid StatsigClient for gate '${e}'.`),s.NoopEvaluationsClient.checkGate(e,t)):n.checkGate(e,t),[e,n,o,...t?Object.values(t):[]])}},51691:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorBoundary=t.EXCEPTION_ENDPOINT=void 0;let i=n(28109),s=n(83955),a=n(43749);t.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception";let o="[Statsig] UnknownError";class l{constructor(e,t,n,r){this._sdkKey=e,this._options=t,this._emitter=n,this._lastSeenError=r,this._seen=new Set}wrap(e,t){try{(function(e){let t=new Set,n=Object.getPrototypeOf(e);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(e=>"function"==typeof(null==n?void 0:n[e])).forEach(e=>t.add(e)),n=Object.getPrototypeOf(n);return Array.from(t)})(e).forEach(n=>{let r=e[n];"$EB"in r||(e[n]=(...i)=>this._capture(t?`${t}:${n}`:n,()=>r.apply(e,i)),e[n].$EB=!0)})}catch(e){this._onError("eb:wrap",e)}}logError(e,t){this._onError(e,t)}
1logDroppedEvents(e,t,n){let r={eventCount:String(e),reason:t};n&&Object.keys(n).forEach(e=>{r[e]=String(n[e])}),this._onError("statsig::log_event_dropped_event_count",Error(t),!0,r)}logEventRequestFailure(e,t,n,r,i,s,a,o,l){let u={eventCount:String(e),flushType:n,statusCode:String(r),reason:t,retries:String(i)};s&&(u.failurePath=s),"string"==typeof a&&a.length>0&&(u.failureErrorMessage=a),"string"==typeof o&&o.length>0&&(u.failureDiagnosticBucket=o),l&&Object.keys(l).forEach(e=>{let t=l[e];t.length>0&&(u[`failureDiagnostic_${e}`]=t)}),this._onError("statsig::log_event_failed",Error(t),!0,u)}getLastSeenErrorAndReset(){let e=this._lastSeenError;return this._lastSeenError=void 0,null!=e?e:null}attachErrorIfNoneExists(e){this._lastSeenError||(this._lastSeenError=u(e))}_capture(e,t){try{let n=t();if(n&&n instanceof Promise)return n.catch(t=>this._onError(e,t));return n}catch(t){return this._onError(e,t),null}}_onError(e,n,l=!1,d){try{i.Log.warn(`Caught error in ${e}`,{error:n}),r(this,void 0,void 0,function*(){var r,i,c,_,h,g,f;let v=n||Error(o),p=v instanceof Error,m=p?v.name:"No Name",y=u(v);if(this._lastSeenError=y,!l&&this._seen.has(m))return;if(this._seen.add(m),null==(i=null==(r=this._options)?void 0:r.networkConfig)?void 0:i.preventAllNetworkTraffic){null==(c=this._emitter)||c.call(this,{name:"error",error:n,tag:e});return}let b=s.SDKType._get(this._sdkKey),S=a.StatsigMetadataProvider.get(),E=p?v.stack:function(e){try{return JSON.stringify(e)}catch(e){return o}}(v),k=Object.assign(Object.assign({tag:e,exception:m,info:E,statsigOptions:function(e){if(!e)return{};let t={};return Object.keys(e).forEach(n=>{let r=e[n];switch(typeof r){case"number":case"bigint":case"boolean":t[String(n)]=r;break;case"string":r.length<50?t[String(n)]=r:t[String(n)]="set";break;case"object":"environment"===n?t.environment=r:"networkConfig"===n?t.networkConfig=r:t[String(n)]=null!=r?"set":"unset"}}),t}(this._options)},Object.assign(Object.assign({},S),{sdkType:b})),null!=d?d:{}),C=null==(_=this._options)?void 0:_.networkConfig,w=null!=(h=null==C?void 0:C.networkOverrideFunc)?h:fetch;yield w(null!=(g=null==C?void 0:C.sdkExceptionUrl)?g:t.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this._sdkKey,"STATSIG-SDK-TYPE":String(b),"STATSIG-SDK-VERSION":String(S.sdkVersion),"Content-Type":"application/json"},body:JSON.stringify(k)}),null==(f=this._emitter)||f.call(this,{name:"error",error:n,tag:e})}).then(()=>{}).catch(()=>{})}catch(e){}}}function u(e){return e instanceof Error?e:"string"==typeof e?Error(e):Error("An unknown error occurred.")}t.ErrorBoundary=l},54646:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useClientBootstrapInit=void 0;let r=n(63943),i=n(55758);t.useClientBootstrapInit=function(e,t,n,s=null,a){return(0,i.useStatsigInternalClientFactoryBootstrap)(e=>new r.StatsigClient(e.sdkKey,e.initialUser,e.statsigOptions),{sdkKey:e,initialUser:t,initialValues:n,statsigOptions:s,useLegacyFormat:a})}},54727:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getCookieName=t.StableID=void 0;let r=n(98060),i=n(28109),s=n(77043),a=n(15163),o=n(56730),l={},u={},d={};function c(e){return`statsig.stable_id.${(0,r._getStorageKey)(e)}`}function _(e,t){let n=c(t);try{(0,a._setObjectInStorage)(n,e)}catch(e){i.Log.warn("Failed to save StableID to storage")}}function h(e,t){if(!u[t]||null==(0,s._getDocumentSafe)())return;let n=new Date;n.setFullYear(n.getFullYear()+1),document.cookie=`${g(t)}=${encodeURIComponent(e)}; expires=${n.toUTCString()}; path=/`}function g(e){return`statsig.stable_id.${(0,r._getStorageKey)(e)}`}t.StableID={cookiesEnabled:!1,randomID:Math.random().toString(36),get:e=>{if(d[e])return null;if(null!=l[e])return l[e];let t=null;return null!=(t=function(e){if(!u[e]||null==(0,s._getDocumentSafe)())return null;for(let t of document.cookie.split(";")){let[n,r]=t.trim().split("=");if(n===g(e))return decodeURIComponent(r)}return null}(e))?(l[e]=t,_(t,e)):(null==(t=function(e){let t=c(e);return(0,a._getObjectFromStorage)(t)}(e))&&(t=(0,o.getUUID)()),_(t,e),h(t,e),l[e]=t),t},setOverride:(e,t)=>{l[t]=e,_(e,t),h(e,t)}
1,_setCookiesEnabled:(e,t)=>{u[e]=t},_setDisabled:(e,t)=>{d[e]=t}},t.getCookieName=g},55758:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigInternalClientFactoryBootstrap=void 0;let r=n(12115),i=n(28551);t.useStatsigInternalClientFactoryBootstrap=function(e,t){let n=(0,r.useRef)((0,i._getInstance)(t.sdkKey));return(0,r.useMemo)(()=>{if(n.current)return n.current;let r=e(t);return n.current=r,t.useLegacyFormat?r.dataAdapter.setDataLegacy(t.initialValues,t.initialUser):r.dataAdapter.setData(t.initialValues),r.initializeSync(),r},[])}},56730:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.getUUID=void 0,t.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let e=new Date().getTime(),t="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0,n="89ab"[Math.floor(4*Math.random())];return`xxxxxxxx-xxxx-4xxx-${n}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,n=>{let r=16*Math.random();return e>0?(r=(e+r)%16|0,e=Math.floor(e/16)):(r=(t+r)%16|0,t=Math.floor(t/16)),("x"===n?r:7&r|8).toString(16)})}},57079:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Diagnostics=void 0;let n=new Map,r="start";function i(e,t,n,r){return Object.assign({key:n,action:t,step:r,timestamp:Date.now()},e)}function s(e,t){var r;let i=null!=(r=n.get(e))?r:[];i.push(t),n.set(e,i)}function a(e,t){if(t in e)return e[t]}t.Diagnostics={_getMarkers:e=>n.get(e),_markInitOverallStart:e=>{s(e,i({},r,"overall"))},_markInitOverallEnd:(e,t,n)=>{s(e,i({success:t,error:t?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:n},"end","overall"))},_markInitNetworkReqStart:(e,t)=>{s(e,i(t,r,"initialize","network_request"))},_markInitNetworkReqEnd:(e,t)=>{s(e,i(t,"end","initialize","network_request"))},_markInitProcessStart:e=>{s(e,i({},r,"initialize","process"))},_markInitProcessEnd:(e,t)=>{s(e,i(t,"end","initialize","process"))},_clearMarkers:e=>{n.delete(e)},_formatError(e){if(e&&"object"==typeof e)return{code:a(e,"code"),name:a(e,"name"),message:a(e,"message")}},_getDiagnosticsData(e,n,r,i){var s;return{success:(null==e?void 0:e.ok)===!0,statusCode:null==e?void 0:e.status,sdkRegion:null==(s=null==e?void 0:e.headers)?void 0:s.get("x-statsig-region"),isDelta:!0===r.includes('"is_delta":true')||void 0,attempt:n,error:t.Diagnostics._formatError(i)}},_enqueueDiagnosticsEvent(e,n,r,i){let s=t.Diagnostics._getMarkers(r);if(null==s||s.length<=0)return -1;let a=s[s.length-1].timestamp-s[0].timestamp;t.Diagnostics._clearMarkers(r);let o={eventName:"statsig::diagnostics",user:e,value:null,metadata:{context:"initialize",markers:s.slice(),statsigOptions:i},time:Date.now()};return n.enqueue(o),a}}},58100:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},59634:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigUser=t.useStatsigInternalClientFactoryBootstrap=t.useStatsigInternalClientFactoryAsync=t.useStatsigClient=t.useParameterStore=t.useLayer=t.useGateValue=t.useFeatureGate=t.useExperiment=t.useDynamicConfig=t.useClientBootstrapInit=t.useClientAsyncInit=t.StatsigProvider=t.StatsigContext=void 0;let s=n(28551),a=n(96340);t.StatsigContext=a.default;let o=n(74204);Object.defineProperty(t,"StatsigProvider",{enumerable:!0,get:function(){return o.StatsigProvider}});let l=n(4956);Object.defineProperty(t,"useClientAsyncInit",{enumerable:!0,get:function(){return l.useClientAsyncInit}});let u=n(54646);Object.defineProperty(t,"useClientBootstrapInit",{enumerable:!0,get:function(){return u.useClientBootstrapInit}});let d=n(71920);t.useDynamicConfig=d.default;let c=n(43374);t.useExperiment=c.default;let _=n(50126);t.useFeatureGate=_.default;let h=n(50191);t.useGateValue=h.default;let g=n(83394);t.useLayer=g.default;let f=n(21377);t.useParameterStore=f.default;let v=n(62087);Object.defineProperty(t,"useStatsigClient",{enumerable:!0,get:function(){return v.useStatsigClient}});let p=n(46024);Object.defineProperty(t,"useStatsigInternalClientFactoryAsync",{enumerable:!0,get:function(){return p.useStatsigInternalClientFactoryAsync}});let m=n(55758);Object.defineProperty(t,"useStatsigInternalClientFactoryBootstrap",{enumerable:!0,get:function(){return m.useStatsigInternalClientFactoryBootstrap}});let y=n(77123);Object.defineProperty(t,"useStatsigUser",{enumerable:!0,get:function(){return y.useStatsigUser}}),i(n(63943),t),Object.assign((0,s._getStatsigGlobal)(),{StatsigContext:a.default,StatsigProvider:o.StatsigProvider,useClientAsyncInit:l.useClientAsyncInit,useClientBootstrapInit:u.useClientBootstrapInit,useDynamicConfig:d.default,useExperiment:c.default,useFeatureGate:_.default,useGateValue:h.default,useLayer:g.default,useParameterStore:f.default,useStatsigClient:v.useStatsigClient,useStatsigInternalClientFactoryAsync:p.useStatsigInternalClientFactoryAsync,useStatsigInternalClientFactoryBootstrap:m.useStatsigInternalClientFactoryBootstrap,useStatsigUser:y.useStatsigUser})},60047:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Prom
1ise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventLogger=void 0;let i=n(83786),s=n(98060),a=n(91320),o=n(34093),l=n(40195),u=n(28109),d=n(87927),c=n(46385),_=n(77043),h=n(20888),g=n(4607),f=n(15163),v=n(20764),p=n(13968),m={};class y{static _safeFlushAndForget(e){var t;null==(t=m[e])||t.flush().catch(()=>{})}constructor(e,t,n,r,i){var s;this._sdkKey=e,this._emitter=t,this._network=n,this._options=r,this._errorBoundary=i,this._pendingEvents=null,this._batchQueue=null,this._flushCoordinator=null,this._lastExposureTimeMap={},this._nonExposedChecks={},this._isShuttingDown=!1,this._storageKey=null,this._pendingCompressionMode=null,this._loggingEnabled=null!=(s=null==r?void 0:r.loggingEnabled)?s:(null==r?void 0:r.disableLogging)===!0?g.LoggingEnabledOption.disabled:g.LoggingEnabledOption.browserOnly,(null==r?void 0:r.loggingEnabled)&&void 0!==r.disableLogging&&u.Log.warn("Detected both loggingEnabled and disableLogging options. loggingEnabled takes precedence - please remove disableLogging.");let a=null==r?void 0:r.networkConfig;this._logEventUrlConfig=new v.UrlConfiguration(d.Endpoint._rgstr,null==a?void 0:a.logEventUrl,null==a?void 0:a.api,null==a?void 0:a.logEventFallbackUrls)}setLogEventCompressionMode(e){this._flushCoordinator?this._flushCoordinator.setLogEventCompressionMode(e):this._pendingCompressionMode=e}setLoggingEnabled(e){let t="disabled"===this._loggingEnabled,n="disabled"!==e;if(this._loggingEnabled=e,this._flushCoordinator&&this._flushCoordinator.setLoggingEnabled(e),t&&n){let e=this._loadStoredEvents();u.Log.debug(`Loaded ${e.length} stored event(s) from storage`),e.length>0&&(e.forEach(e=>{this._initFlushCoordinator().addEvent(e)}),this.flush().catch(e=>{u.Log.warn("Failed to flush events after enabling logging:",e)}))}}enqueue(e){var t;if(!this._shouldLogEvent(e))return;let n=this._normalizeEvent(e);if("disabled"===this._loggingEnabled)return void this._storeEventToStorage(n);this._initFlushCoordinator().addEvent(n),null==(t=this._flushCoordinator)||t.checkQuickFlush()}incrementNonExposureCount(e){var t;let n=null!=(t=this._nonExposedChecks[e])?t:0;this._nonExposedChecks[e]=n+1}reset(){this.flush().catch(()=>{}),this._lastExposureTimeMap={}}start(){var e;let t=(0,_._isServerEnv)();if(t&&(null==(e=this._options)?void 0:e.loggingEnabled)!=="always")return;let n=this._initFlushCoordinator();m[this._sdkKey]=this,t||(0,p._subscribeToVisiblityChanged)(e=>{"background"===e?y._safeFlushAndForget(this._sdkKey):"foreground"===e&&n.startScheduledFlushCycle()}),n.loadAndRetryShutdownFailedEvents().catch(e=>{u.Log.warn("Failed to load failed shutdown events:",e)}),n.startScheduledFlushCycle()}stop(){return r(this,void 0,void 0,function*(){this._isShuttingDown=!0,this._flushCoordinator&&(yield this._flushCoordinator.processShutdown()),delete m[this._sdkKey],this._flushCoordinator=null,this._pendingEvents=null,this._batchQueue=null})}flush(){return r(this,void 0,void 0,function*(){if(this._flushCoordinator)return this._flushCoordinator.processManualFlush()})}appendAndResetNonExposedChecks(){if(0===Object.keys(this._nonExposedChecks).length)return;let e=Object.assign({},this._nonExposedChecks);this._nonExposedChecks={};let t=this._normalizeEvent({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:e}});this._flushCoordinator&&this._flushCoordinator.addEvent(t)}_shouldLogEvent(e){var t;if((null==(t=this._options)?void 0:t.loggingEnabled)!=="always"&&(0,_._isServerEnv)())return!1;if(!(0,h._isExposureEvent)(e))return!0;let n=e.user?e.user:{statsigEnvironment:void 0},r=(0,s._getUserStorageKey)(this._sdkKey,n),i=e.metadata?e.metadata:{},a=[e.eventName,r,i.gate,i.config,i.ruleID,i.allocatedExperiment,i.parameterName,String(i.isExplicitParameter),i.reason].join("|"),o=this._lastExposureTimeMap[a],l=Date.now();return(!o||!(l-o<6e5))&&(Object.keys(this._lastExposureTimeMap).length>1e3&&(this._lastExposureTimeMap={}),this._lastExposureTimeMap[a]=l,!0)}_getCurrentPageUrl(){var e;if((null==(e=this._options)?void 0:e.includeCurrentPageUrlWithEvents)!==!1)return(0,_._getCurrentPageUrlSafe)()}_getStorageKey(){return this._storageKey||(this._storageKey=`statsig.pending_events.${(0,l._DJB2)(this._sdkKey)}`),this._storageKey}_initFlushCoordinator(){var e,t;if(this._flushCoordinator)return this._flushCoordinator;let n=null!=(t=null==(e=this._options)?void 0:e.loggingBufferMaxSize)?t:a.EventRetryConstants.DEFAULT_BATCH_SIZE;return this._pendingEvents=new c.PendingEvents(n),this._batchQueue=new i.BatchQueue(n),this._flushCoordinator=new o.FlushCoordinator(this._batchQueue,this._pendingEvents,()=>this.appendAndResetNonExposedChecks(),this._sdkKey,this._network,this._emitter,this._logEventUrlConfig,this._options,this._loggingEnabled,this._errorBoundary),this._pendingCompressionMode&&(this._flushCoordinator.setLogEventCompressionMode(this._pe
1ndingCompressionMode),this._pendingCompressionMode=null),this._flushCoordinator}_storeEventToStorage(e){let t=this._getStorageKey();try{let n=this._getEventsFromStorage(t);n.push(e),n.length>a.EventRetryConstants.MAX_LOCAL_STORAGE&&(n=n.slice(-a.EventRetryConstants.MAX_LOCAL_STORAGE)),(0,f._setObjectInStorage)(t,n)}catch(e){u.Log.warn("Unable to save events to storage")}}_getEventsFromStorage(e){try{let t=(0,f._getObjectFromStorage)(e);if(Array.isArray(t))return t;return[]}catch(e){return[]}}_loadStoredEvents(){let e=this._getStorageKey(),t=this._getEventsFromStorage(e);return t.length>0&&f.Storage.removeItem(e),t}_normalizeEvent(e){e.user&&(e.user=Object.assign({},e.user),delete e.user.privateAttributes);let t={},n=this._getCurrentPageUrl();return n&&(t.statsigMetadata={currentPage:n}),Object.assign(Object.assign({},e),t)}}t.EventLogger=y},61390:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.PrecomputedEvaluationsContextHandle=void 0;let r=n(28109),i=n(77043),s=n(71074),a=n(54727);class o{constructor(e,t,n,r,i,s){this._sdkKey=e,this._getOptions=t,this._getErrorBoundary=n,this._getValues=r,this._getUser=i,this._getSdkInstanceID=s}get sdkKey(){return this._sdkKey}get options(){return this._getOptions()}get errorBoundary(){return this._getErrorBoundary()}get values(){return this._getValues()}get user(){let e=(0,i._cloneObject)("StatsigUser",this._getUser());return null==e&&(r.Log.error("Failed to clone user"),e={}),e}getSession(e=!0){return s.StatsigSession.get(this._sdkKey,e)}get stableID(){return a.StableID.get(this._sdkKey)}get sdkInstanceID(){return this._getSdkInstanceID()}toContext(e=!0){return{sdkKey:this.sdkKey,options:this.options,values:this.values,user:this.user,errorBoundary:this.errorBoundary,session:this.getSession(e),stableID:this.stableID,sdkInstanceID:this.sdkInstanceID}}}t.PrecomputedEvaluationsContextHandle=o},62087:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigClient=void 0;let r=n(12115),i=n(28551),s=n(11306),a=n(96340);t.useStatsigClient=function(){let{client:e,renderVersion:t,isLoading:n}=(0,r.useContext)(a.default),o=(0,r.useMemo)(()=>(0,s.isNoopClient)(e)?(i.Log.warn("Attempting to retrieve a StatsigClient but none was set."),s.NoopEvaluationsClient):e,[e,t]),l=[o,t],u=(0,r.useCallback)((e,t)=>o.checkGate(e,t),l),d=(0,r.useCallback)((e,t)=>o.getFeatureGate(e,t),l),c=(0,r.useCallback)((e,t)=>o.getDynamicConfig(e,t),l),_=(0,r.useCallback)((e,t)=>o.getExperiment(e,t),l),h=(0,r.useCallback)((e,t)=>o.getLayer(e,t),l),g=(0,r.useCallback)((e,t)=>o.getParameterStore(e,t),l),f=(0,r.useCallback)((e,t,n)=>"string"==typeof e?o.logEvent(e,t,n):o.logEvent(e),l);return(0,r.useMemo)(()=>({client:o,checkGate:u,getFeatureGate:d,getDynamicConfig:c,getExperiment:_,getLayer:h,getParameterStore:g,logEvent:f,isLoading:n}),[o,u,d,c,_,h,g,f,n])}},63943:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),i=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigClient=void 0;let s=n(28551),a=n(12315);t.StatsigClient=a.default,i(n(28551),t),t.default=Object.assign((0,s._getStatsigGlobal)(),{StatsigClient:a.default})},64598:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FlushTypeValues=void 0,t.FlushTypeValues={ScheduledMaxTime:"scheduled:max_time",ScheduledFullBatch:"scheduled:full_batch",Limit:"limit",Manual:"manual",Shutdown:"shutdown"}},71074:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigSession=t.SessionID=void 0;let r=n(98060),i=n(28109),s=n(15163),a=n(56730),o=n(13968),l={};function u(e){var t;let n=e.data,r=function({lastUpdate:e}){return Date.now()-e>18e5}(n)||function({startTime:e}){return Date.now()-e>144e5}(n);return r&&(e.data=_(),null==(t=null==__STATSIG__?void 0:__STATSIG__.instance(e.sdkKey))||t.$emt({name:"session_expired"})),r}function d(e){return`statsig.session_id.${(0,r._getStorageKey)(e)}`}function c(e){try{(0,s._setObjectInStorage)(e.storageKey,e.data),e.lastPersistedAt=Date.now()}catch(e){i.Log.warn("Failed to save SessionID")}}function _(){return{sessionID:(0,a.getUUID)(),startTime:Date.now(),lastUpdate:Date.now()}}(0,o._subscribeToVisiblityChanged)(e=>
1{"background"===e&&Object.values(l).forEach(e=>c(e))}),t.SessionID={get:e=>t.StatsigSession.get(e).data.sessionID},t.StatsigSession={get:(e,t=!0)=>(null==l[e]&&(l[e]=function(e){let t=d(e),n=(0,s._getObjectFromStorage)(t);return n&&n.sessionID&&n.startTime&&n.lastUpdate?{data:n,sdkKey:e,lastPersistedAt:0,storageKey:t}:{data:_(),sdkKey:e,lastPersistedAt:0,storageKey:t}}(e)),function(e,t){var n;let r=Date.now();return u(e)?c(e):t&&(e.data.lastUpdate=r,n=e,Date.now()-n.lastPersistedAt>15e3&&c(n)),e}(l[e],t)),overrideInitialSessionID:(e,t)=>{let n=Date.now(),r={data:{sessionID:e,startTime:n,lastUpdate:n},sdkKey:t,lastPersistedAt:Date.now(),storageKey:d(t)};c(r),l[t]=r},checkForIdleSession:e=>{let t=l[e];t&&u(t)&&c(t)}}},71352:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},71920:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(12115),i=n(28551),s=n(11306),a=n(96340);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,s.isNoopClient)(n)?(i.Log.warn(`useDynamicConfig hook failed to find a valid StatsigClient for dynamic config '${e}'.`),s.NoopEvaluationsClient.getDynamicConfig(e,t)):n.getDynamicConfig(e,t),[e,n,o,...t?Object.values(t):[]])}},72641:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UPDATE_DETAIL_ERROR_MESSAGES=t.createUpdateDetails=void 0,t.createUpdateDetails=(e,t,n,r,i,s)=>({duration:n,source:t,success:e,error:r,sourceUrl:i,warnings:s}),t.UPDATE_DETAIL_ERROR_MESSAGES={NO_NETWORK_DATA:"No data was returned from the network. This may be due to a network timeout if a timeout value was specified in the options or ad blocker error."}},73820:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.FlushInterval=void 0;class n{constructor(){this._currentIntervalMs=1e3,this._lastFlushAttemptTime=Date.now()}getCurrentIntervalMs(){return this._currentIntervalMs}markFlushAttempt(){this._lastFlushAttemptTime=Date.now()}getTimeSinceLastAttempt(){return Date.now()-this._lastFlushAttemptTime}hasReachedMaxInterval(){return this.getTimeSinceLastAttempt()>=6e4}getTimeTillMaxInterval(){return 6e4-this.getTimeSinceLastAttempt()}hasCompletelyRecoveredFromBackoff(){return this._currentIntervalMs<=1e3}adjustForSuccess(){let e=this._currentIntervalMs;1e3!==e&&(this._currentIntervalMs=Math.max(1e3,Math.floor(e/2)))}adjustForFailure(){let e=this._currentIntervalMs;this._currentIntervalMs=Math.min(6e4,2*e)}getTimeUntilNextFlush(){return this.getCurrentIntervalMs()-this.getTimeSinceLastAttempt()}}t.FlushInterval=n},74204:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.StatsigProvider=void 0;let r=n(95155),i=n(12115),s=n(28551),a=n(96340),o=n(4956);function l(e){let[t,n]=(0,i.useState)(0),s=(0,o.useClientAsyncInit)(e.sdkKey,e.user,e.options).client,[l,u]=(0,i.useState)(!c(s));d(s,n,u);let _=(0,i.useMemo)(()=>({renderVersion:t,client:s,isLoading:l}),[t,s,l]);return(0,r.jsx)(a.default.Provider,{value:_,children:null!=e.loadingComponent&&_.isLoading?e.loadingComponent:e.children})}function u(e){let[t,n]=(0,i.useState)(0),s=e.client,[o,l]=(0,i.useState)(!c(s));d(s,n,l);let u=(0,i.useMemo)(()=>({renderVersion:t,client:s,isLoading:o}),[t,s,o]);return(0,r.jsx)(a.default.Provider,{value:u,children:null!=e.loadingComponent&&u.isLoading?e.loadingComponent:e.children})}function d(e,t,n){(0,i.useEffect)(()=>{let r=()=>{t(e=>e+1),n(!c(e))};return s.SDKType._setBindingType("react"),e.$on("values_updated",r),()=>{e.flush().catch(e=>s.Log.error("An error occurred during flush",e)),e.off("values_updated",r)}},[e,t])}function c(e){return"isNoop"in e||"Ready"===e.loadingStatus}t.StatsigProvider=function(e){return"client"in e?(("sdkKey"in e||"user"in e)&&s.Log.warn("Both client and configuration props (sdkKey, user) were provided to StatsigProvider. The client prop will be used and the configuration props will be ignored."),(0,r.jsx)(u,Object.assign({},e))):(0,r.jsx)(l,Object.assign({},e))}},77043:(e,t,n)=>{var r=n(87358);Object.defineProperty(t,"__esModule",{value:!0}),t._cloneObject=t._getUnloadEvent=t._getCurrentPageUrlSafe=t._addDocumentEventListenerSafe=t._addWindowEventListenerSafe=t._isServerEnv=t._getDocumentSafe=t._getWindowSafe=void 0;let i=n(28109);t._getWindowSafe=()=>"undefined"!=typeof window?window:null,t._getDocumentSafe=()=>{var e;let n=(0,t._getWindowSafe)();return null!=(e=null==n?void 0:n.document)?e:null},t._isServerEnv=()=>{if(null!==(0,t._getDocumentSafe)())return!1;let e=void 0!==r&&null!=r.versions&&null!=r.versions.node;return"string"==typeof EdgeRuntime||e}
1,t._addWindowEventListenerSafe=(e,n)=>{let r=(0,t._getWindowSafe)();"function"==typeof(null==r?void 0:r.addEventListener)&&r.addEventListener(e,n)},t._addDocumentEventListenerSafe=(e,n)=>{let r=(0,t._getDocumentSafe)();"function"==typeof(null==r?void 0:r.addEventListener)&&r.addEventListener(e,n)},t._getCurrentPageUrlSafe=()=>{var e;try{return null==(e=(0,t._getWindowSafe)())?void 0:e.location.href.split(/[?#]/)[0]}catch(e){return}},t._getUnloadEvent=()=>{let e=(0,t._getWindowSafe)();return e&&"onpagehide"in e?"pagehide":"beforeunload"},t._cloneObject=(e,t)=>{try{return JSON.parse(JSON.stringify(t))}catch(t){return i.Log.error(`Failed to clone object ${e}`),null}}},77123:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.useStatsigUser=void 0;let r=n(12115),i=n(96340),s=n(62087);function a(e){return e.getContextHandle().user}t.useStatsigUser=function(){let{client:e}=(0,s.useStatsigClient)(),{renderVersion:t}=(0,r.useContext)(i.default);return{user:(0,r.useMemo)(()=>a(e),[e,t]),updateUserSync:(0,r.useCallback)(t=>("function"==typeof t&&(t=t(a(e))),e.updateUserSync(t)),[e]),updateUserAsync:(0,r.useCallback)(t=>("function"==typeof t&&(t=t(a(e))),e.updateUserAsync(t)),[e])}}},79174:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0})},79650:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.EventSender=void 0;let i=n(28109),s=n(87927),a=n(83955),o=n(43749),l=n(13968);class u{constructor(e,t,n,r,i){this._sdkKey=e,this._network=t,this._emitter=n,this._options=i,this._logEventUrlConfig=r}setLogEventCompressionMode(e){this._network.setLogEventCompressionMode(e)}sendBatch(e){return r(this,void 0,void 0,function*(){var t,n,r;let s="event_sender_unexpected_exception",a={};try{let r=(0,l._isUnloading)()&&this._network.isBeaconSupported()&&(null==(n=null==(t=this._options)?void 0:t.networkConfig)?void 0:n.networkOverrideFunc)==null;s="event_sender_pre_logs_flushed_emitter_exception",this._emitter({name:"pre_logs_flushed",events:e.events}),s=r?"event_sender_unexpected_exception":"event_sender_post_exception";let i=r?this._sendEventsViaBeacon(e,a):yield this._sendEventsViaPost(e,a);if(i.success)return s="event_sender_logs_flushed_emitter_exception",this._emitter({name:"logs_flushed",events:e.events}),i;return Object.assign(Object.assign(Object.assign({success:!1,statusCode:i.statusCode,failurePath:i.failurePath},i.failureErrorMessage?{failureErrorMessage:i.failureErrorMessage}:{}),i.failureDiagnosticBucket?{failureDiagnosticBucket:i.failureDiagnosticBucket}:{}),i.failureDiagnosticMetadata?{failureDiagnosticMetadata:i.failureDiagnosticMetadata}:{})}catch(e){return i.Log.warn("Failed to send batch:",e),Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:null!=(r=a.path)?r:s},a.errorMessage?{failureErrorMessage:a.errorMessage}:{}),a.diagnosticBucket?{failureDiagnosticBucket:a.diagnosticBucket}:{}),a.diagnosticMetadata?{failureDiagnosticMetadata:a.diagnosticMetadata}:{})}})}_sendEventsViaPost(e,t){return r(this,void 0,void 0,function*(){var n,r;let i=yield this._network.post(this._getRequestData(e),t),s=null!=(n=null==i?void 0:i.code)?n:-1;return -1===s?Object.assign(Object.assign(Object.assign({success:!1,statusCode:-1,failurePath:null!=(r=t.path)?r:void 0===i?"event_sender_post_returned_undefined":"event_sender_post_returned_null"},t.errorMessage?{failureErrorMessage:t.errorMessage}:{}),t.diagnosticBucket?{failureDiagnosticBucket:t.diagnosticBucket}:{}),t.diagnosticMetadata?{failureDiagnosticMetadata:t.diagnosticMetadata}:{}):{success:s>=200&&s<300,statusCode:s}})}_sendEventsViaBeacon(e,t){var n;let r=this._network.beacon(this._getRequestData(e),t);return Object.assign(Object.assign(Object.assign({success:r,statusCode:r?200:-1,failurePath:r?void 0:null!=(n=t.path)?n:"beacon_send_false"},!r&&t.errorMessage?{failureErrorMessage:t.errorMessage}:{}),!r&&t.diagnosticBucket?{failureDiagnosticBucket:t.diagnosticBucket}:{}),!r&&t.diagnosticMetadata?{failureDiagnosticMetadata:t.diagnosticMetadata}:{})}_getRequestData(e){return{sdkKey:this._sdkKey,data:{events:e.events},urlConfig:this._logEventUrlConfig,retries:3,preserveFailedStatusCode:!0,isCompressable:!0,params:{[s.NetworkParam.EventC
1ount]:String(e.events.length)},headers:{"statsig-event-count":String(e.events.length),"statsig-retry-count":String(e.attempts),"statsig-sdk-type":a.SDKType._get(this._sdkKey),"statsig-sdk-version":o.SDK_VERSION},credentials:"same-origin"}}}t.EventSender=u},80503:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getUnitIDFromUser=t._getFullUserHash=t._normalizeUser=void 0;let r=n(40195),i=n(28109),s=n(77043);t._normalizeUser=function(e,t,n){let r=(0,s._cloneObject)("StatsigUser",e);return null==r?(i.Log.error("Failed to clone user"),{statsigEnvironment:void 0}):(null!=t&&null!=t.environment?r.statsigEnvironment=t.environment:null!=n&&(r.statsigEnvironment={tier:n}),r)},t._getFullUserHash=function(e){return e?(0,r._DJB2Object)(e):null},t._getUnitIDFromUser=function(e,t){var n,r,i;if("string"!=typeof t)return e.userID;let s=t.toLowerCase();return"userid"!==s?null!=(r=null==(n=e.customIDs)?void 0:n[t])?r:null==(i=e.customIDs)?void 0:i[s]:e.userID}},81711:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._isTypeMatch=t._typeOf=void 0,t._typeOf=function(e){return Array.isArray(e)?"array":typeof e},t._isTypeMatch=function(e,t){let n=e=>Array.isArray(e)?"array":null===e?"null":typeof e;return n(e)===n(t)}},83394:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(12115),i=n(28551),s=n(11306),a=n(96340);t.default=function(e,t){let{client:n,renderVersion:o}=(0,r.useContext)(a.default);return(0,r.useMemo)(()=>(0,s.isNoopClient)(n)?(i.Log.warn(`useLayer hook failed to find a valid Statsig client for layer '${e}'.`),s.NoopEvaluationsClient.getLayer(e,t)):n.getLayer(e,t),[e,n,o,...t?Object.values(t):[]])}},83786:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BatchQueue=void 0;let r=n(98217),i=n(91320);class s{constructor(e=i.EventRetryConstants.DEFAULT_BATCH_SIZE){this._batches=[],this._batchSize=e}batchSize(){return this._batchSize}requeueBatch(e){return this._enqueueBatch(e)}hasFullBatch(){return this._batches.some(e=>e.events.length>=this._batchSize)}takeNextBatch(){return this._batches.shift()}takeAllBatches(){let e=this._batches;return this._batches=[],e}createBatches(e){let t=0,n=0;for(;t<e.length;){let i=e.slice(t,t+this._batchSize);n+=this._enqueueBatch(new r.EventBatch(i)),t+=this._batchSize}return n}_enqueueBatch(e){this._batches.push(e);let t=0;for(;this._batches.length>i.EventRetryConstants.MAX_PENDING_BATCHES;){let e=this._batches.shift();e&&(t+=e.events.length)}return t}}t.BatchQueue=s},83955:(e,t)=>{let n;Object.defineProperty(t,"__esModule",{value:!0}),t.SDKType=void 0;let r={};t.SDKType={_get:e=>{var t;return(null!=(t=r[e])?t:"js-mono")+(null!=n?n:"")},_setClientType(e,t){r[e]=t},_setBindingType(e){n&&"-react"!==n||(n="-"+e)}}},85537:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorTag=void 0,t.ErrorTag={NetworkError:"NetworkError"}},87927:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkParam=t.NetworkDefault=t.Endpoint=void 0,t.Endpoint={_initialize:"initialize",_rgstr:"rgstr",_download_config_specs:"download_config_specs"},t.NetworkDefault={[t.Endpoint._rgstr]:"https://prodregistryv2.org/v1",[t.Endpoint._initialize]:"https://featureassets.org/v1",[t.Endpoint._download_config_specs]:"https://api.statsigcdn.com/v1"},t.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},89596:function(e,t){var n=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._fetchTxtRecords=void 0;let r=new Uint8Array([0,0,1,0,0,1,0,0,0,0,0,0,13,102,101,97,116,117,114,101,97,115,115,101,116,115,3,111,114,103,0,0,16,0,1]),i=["i","e","d"];t._fetchTxtRecords=function(e){return n(this,void 0,void 0,function*(){let t=yield e("https://cloudflare-dns.com/dns-query",{method:"POST",headers:{"Content-Type":"application/dns-message",Accept:"application/dns-message"},body:r});if(!t.ok){let e=Error("Failed to fetch TXT records from DNS");throw e.name="DnsTxtFetchError",e}return function(e){let t=e.findIndex((t,n)=>n<200&&"="===String.fromCharCode(t)&&i.includes(String.fromCharCode(e[n-1])));if(-1===t){let e=Error("Failed to parse TXT records from DNS");throw e.name="DnsTxtParseError",e}let n="";for(let r=t-1;r<e.length;r++)n+=String.fromCharCode(e[r]);return n.split(",")}(new Uint8Array((yield t.arrayBuffer())))})}},91320:(e,t)=>
1{Object.defineProperty(t,"__esModule",{value:!0}),t.EventRetryConstants=void 0,t.EventRetryConstants={MAX_RETRY_ATTEMPTS:8,DEFAULT_BATCH_SIZE:100,MAX_PENDING_BATCHES:40,TICK_INTERVAL_MS:1e3,QUICK_FLUSH_WINDOW_MS:200,MAX_LOCAL_STORAGE:500,get MAX_QUEUED_EVENTS(){return this.DEFAULT_BATCH_SIZE*this.MAX_PENDING_BATCHES}}},91925:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});let i=n(28551),s=n(4851);class a extends i.NetworkCore{constructor(e,t){super(e,t);let n=null==e?void 0:e.networkConfig;this._option=e,this._initializeUrlConfig=new i.UrlConfiguration(i.Endpoint._initialize,null==n?void 0:n.initializeUrl,null==n?void 0:n.api,null==n?void 0:n.initializeFallbackUrls)}fetchEvaluations(e,t,n,s,a){return r(this,void 0,void 0,function*(){var r,o,l,u,d,c;let _=t?(0,i._typedJsonParse)(t,"has_updates","InitializeResponse"):null,h={user:s,hash:null!=(l=null==(o=null==(r=this._option)?void 0:r.networkConfig)?void 0:o.initializeHashAlgorithm)?l:"djb2",deltasResponseRequested:!1,full_checksum:null};if(null==_?void 0:_.has_updates){let e=(null==_?void 0:_.hash_used)!==(null!=(c=null==(d=null==(u=this._option)?void 0:u.networkConfig)?void 0:d.initializeHashAlgorithm)?c:"djb2");h=Object.assign(Object.assign({},h),{sinceTime:a&&!e?_.time:0,previousDerivedFields:"derived_fields"in _&&a?_.derived_fields:{},deltasResponseRequested:!0,full_checksum:_.full_checksum,partialUserMatchSinceTime:e?0:_.time})}return this._fetchEvaluations(e,_,h,n)})}_fetchEvaluations(e,t,n,i){return r(this,void 0,void 0,function*(){var r,a;let o=yield this.post({sdkKey:e,urlConfig:this._initializeUrlConfig,data:n,retries:2,isStatsigEncodable:!0,priority:i});if((null==o?void 0:o.code)===204)return'{"has_updates": false}';if((null==o?void 0:o.code)!==200)return null!=(r=null==o?void 0:o.body)?r:null;if((null==t?void 0:t.has_updates)!==!0||(null==(a=o.body)?void 0:a.includes('"is_delta":true'))!==!0||!0!==n.deltasResponseRequested)return o.body;let l=(0,s._resolveDeltasResponse)(t,o.body);return"string"==typeof l?l:this._fetchEvaluations(e,t,Object.assign(Object.assign(Object.assign({},n),l),{deltasResponseRequested:!1}),i)})}}t.default=a},92633:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t._isDomainFailure=t.NetworkFallbackResolver=void 0;let i=n(89596),s=n(40195),a=n(28109),o=n(15163);class l{constructor(e){var t;this._fallbackInfo=null,this._errorBoundary=null,this._dnsQueryCooldowns={},this._networkOverrideFunc=null==(t=e.networkConfig)?void 0:t.networkOverrideFunc}setErrorBoundary(e){this._errorBoundary=e}tryBumpExpiryTime(e,t){var n;let r=null==(n=this._fallbackInfo)?void 0:n[t.endpoint];r&&(r.expiryTime=Date.now()+6048e5,c(e,Object.assign(Object.assign({},this._fallbackInfo),{[t.endpoint]:r})))}getActiveFallbackUrl(e,t){var n,r;if(null!=t.customUrl&&null!=t.fallbackUrls)return null;let i=this._fallbackInfo;null==i&&(i=null!=(n=function(e){let t=d(e),n=o.Storage.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch(e){return a.Log.error("Failed to parse FallbackInfo"),null}}(e))?n:{},this._fallbackInfo=i);let s=i[t.endpoint];return!s||Date.now()>(null!=(r=s.expiryTime)?r:0)||t.getChecksum()!==s.urlConfigChecksum?(delete i[t.endpoint],this._fallbackInfo=i,c(e,this._fallbackInfo),null):s.url?s.url:null}tryFetchUpdatedFallbackInfo(e,t,n,i){return r(this,void 0,void 0,function*(){var r,s;try{if(!u(n,i))return!1;let s=null==t.customUrl&&null==t.fallbackUrls?yield this._tryFetchFallbackUrlsFromNetwork(t):t.fallbackUrls,a=this._pickNewFallbackUrl(null==(r=this._fallbackInfo)?void 0:r[t.endpoint],s);if(!a)return!1;return this._updateFallbackInfoWithNewUrl(e,t,a),!0}catch(e){return null==(s=this._errorBoundary)||s.logError("tryFetchUpdatedFallbackInfo",e),!1}})}_updateFallbackInfoWithNewUrl(e,t,n){var r,i,s;let a={urlConfigChecksum:t.getChecksum(),url:n,expiryTime:Date.now()+6048e5,previous:[]},o=t.endpoint,l=null==(r=this._fallbackInfo)?void 0:r[o];l&&a.previous.push(...l.previous),a.previous.length>10&&(a.previous=[]);let u=null==(s=null==(i=this._fallbackInfo)?void 0:i[o])?void 0:s.url;null!=u&&a.previous.push(u),this._fallbackInfo=Object.assign(Object.assign({},this._fallbackInfo),{[o]:a}),c(e,this._fallbackInfo)}_tryFetchFallbackUrlsFromNetwork(e){return r(this,void 0,void 0,function*(){var t;let n=this._dnsQueryCooldowns[e.endpoint];if(n&&Date.now()<n)return null;this._dnsQueryCooldowns[e.endpoint]=Date.now()+144e5;let r=[],s=yield(0,i._fetchTxtRecords)(null!=(t=this._networkOverrideFunc)?t:fetch),a=function(e){try{return new URL(e).pathname}catch(e){return null}}(e.defaultUrl);for(let t of s){if(!t.startsWith(e.endpointDnsKey+"="))continue;let n=t.split("=");if(n.length>1){let e=n[1];e.endsWith("/")&&(e=e.slice(0,-1)),r.push(`https://${e}${a}`)}}return r})}_pickNewFallbackUrl(e,t){var n;if(null==t)return null;let r=new Set(null!=(n=null==e?void 0:e.previous)?n:[]),i=null==e?void 0:e.url,s=null;for(let e of t){let t=e.endsWith("/")?e.slice(0,-1):e;if(!r.has(e)&&t!==i){s=t;break}}return s}}function u(e,t){var n;let r=null!=(n=null==e?void 0:e.toLowerCase())?n:"";return t||r.includes("uncaught exception")||r.includes("failed to fetch")||r.includes("networkerror when attempting to fetch resource")}function d(e){return`statsig.network_fallback.${(0,s._DJB2)(e)}`}function c(e,t){let n=d(e);if(!t||0===Object.keys(t).length)return void o.Storage.removeItem(n);o.Storage.setItem(n,JSON.stringify(t))}t.NetworkFallbackResolver=l,t._isDomainFailure=u},93167:(e,t)=>
1{Object.defineProperty(t,"__esModule",{value:!0})},94402:function(e,t,n){var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(i,s){function a(e){try{l(r.next(e))}catch(e){s(e)}}function o(e){try{l(r.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof n?t:new n(function(e){e(t)})).then(a,o)}l((r=r.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkCore=t.RETRYABLE_CODES=void 0,n(41832);let i=n(41832),s=n(57079),a=n(28109),o=n(87927),l=n(92633),u=n(20662),d=n(83955),c=n(77043),_=n(71074),h=n(54727),g=n(85537),f=n(43749),v=n(4607),p=n(13968);t.RETRYABLE_CODES=new Set([408,500,502,503,504,522,524,599]);class m{constructor(e,t){this._emitter=t,this._errorBoundary=null,this._timeout=1e4,this._netConfig={},this._options={},this._leakyBucket={},this._lastUsedInitUrl=null,e&&(this._options=e),this._options.networkConfig&&(this._netConfig=this._options.networkConfig),this._netConfig.networkTimeoutMs&&(this._timeout=this._netConfig.networkTimeoutMs),this._fallbackResolver=new l.NetworkFallbackResolver(this._options),this.setLogEventCompressionMode(this._getLogEventCompressionMode(e))}setLogEventCompressionMode(e){this._options.logEventCompressionMode=e}setErrorBoundary(e){this._errorBoundary=e,this._errorBoundary.wrap(this),this._errorBoundary.wrap(this._fallbackResolver),this._fallbackResolver.setErrorBoundary(e)}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}getLastUsedInitUrlAndReset(){let e=this._lastUsedInitUrl;return this._lastUsedInitUrl=null,e}beacon(e,t){if(!y(e))return t&&(t.path="beacon_invalid_sdk_key"),!1;let n=this._getInternalRequestArgs("POST",e),r=this._getPopulatedURL(n),i=navigator;try{let e=i.sendBeacon.bind(i)(r,n.body);return!e&&t&&(t.path="beacon_send_false"),e}catch(e){throw t&&(t.path="beacon_send_exception"),e}}post(e,t){return r(this,void 0,void 0,function*(){let n=this._getInternalRequestArgs("POST",e);return this._tryEncodeBody(n),yield this._tryToCompressBody(n),this._sendRequest(n,t)})}get(e){let t=this._getInternalRequestArgs("GET",e);return this._sendRequest(t)}_sendRequest(e,n){return r(this,void 0,void 0,function*(){var i,l,u,d,_,h,f,v,m;if(!y(e))return n&&(n.path="network_invalid_sdk_key"),null;if(this._netConfig.preventAllNetworkTraffic)return n&&(n.path="network_prevent_all_network_traffic"),null;let{method:b,body:k,retries:C,attempt:w}=e,I=e.urlConfig.endpoint;if(this._isRateLimited(I))return a.Log.warn(`Request to ${I} was blocked because you are making requests too frequently.`),n&&(n.path="network_rate_limited"),null;let D=null!=w?w:1,O=!1,P=this._getPopulatedURL(e),x=Date.now(),M=null,F=(0,p._isUnloading)();try{let t,n={method:b,body:k,headers:Object.assign({},e.headers),priority:e.priority,keepalive:F};_=e,h=D,_.urlConfig.endpoint===o.Endpoint._initialize&&s.Diagnostics._markInitNetworkReqStart(_.sdkKey,{attempt:h});let r=this._leakyBucket[I];r&&(r.lastRequestTime=Date.now(),this._leakyBucket[I]=r);let a=null!=(i=this._netConfig.networkOverrideFunc)?i:fetch;if(!(M=yield Promise.race([a(P,n).finally(()=>clearTimeout(t)),new Promise((e,n)=>{t=setTimeout(()=>{O=!0,n(Error(`Timeout of ${this._timeout}ms expired.`))},this._timeout)})])).ok){let e=yield M.text().catch(()=>"No Text"),t=Error(`NetworkError: ${P} ${e}`);throw t.name="NetworkError",t}let l=yield M.text();return E(e,M,D,l),this._fallbackResolver.tryBumpExpiryTime(e.sdkKey,e.urlConfig),{body:l,code:M.status}}catch(o){let i="string"==typeof(f=o)?f:f instanceof Error?`${f.name}: ${f.message}`:"Unknown Error",s=(v=null!=i?i:"",m=O,v.includes("Timeout")||m);if(E(e,M,D,"",o),(yield this._fallbackResolver.tryFetchUpdatedFallbackInfo(e.sdkKey,e.urlConfig,i,s))&&(e.fallbackUrl=this._fallbackResolver.getActiveFallbackUrl(e.sdkKey,e.urlConfig)),!C||D>C||!t.RETRYABLE_CODES.has(null!=(l=null==M?void 0:M.status)?l:500)){null==(u=this._emitter)||u.call(this,{name:"error",error:o,tag:g.ErrorTag.NetworkError,requestArgs:e});let t=`A networking error occurred during ${b} request to ${P}.`;if(a.Log.error(t,i,o),null==(d=this._errorBoundary)||d.attachErrorIfNoneExists(t),e.preserveFailedStatusCode&&null!=M)return{body:null,code:M.status};if(null==M&&n){n.path=s?"network_request_timed_out_no_response":"network_request_exception_no_response",i&&(n.errorMessage=i);try{let t=function(e,t,n,r){var i,s,a,o,l,u;let d=(0,c._getWindowSafe)(),_=null==d?void 0:d.document,h="undefined"!=typeof navigator?navigator:null,g=(0,p._isUnloading)(),f=h&&"boolean"==typeof h.onLine?String(h.onLine):"unknown",v=null!=(i=null==_?void 0:_.visibilityState)?i:"unknown",m=Object.keys(null!=(s=e.headers)?s:{}).length>0,y=(o=t,!(l=null==(a=null==d?void 0:d.location)?void 0:a.origin)||!o.startsWith(`${l}/`)&&!o.startsWith(`${l}?`)&&o!==l),b=null!=e.urlConfig.customUrl,E=null!=e.fallbackUrl,k=S(r,[250,1e3,5e3,1e4]),C=S((u=e.body,null==u?0:"string"==typeof u?u.length:u instanceof Uint8Array?u.byteLength:"undefined"!=typeof Blob&&u instanceof Blob?u.size:-1),[16384,65536,262144,1048576]),w="unknown_no_response";return n?w="timeout":"false"===f?w="browser_offline":g?w="page_unloading":"hidden"===v?w="page_hidden":y&&m?w="cross_origin_custom_headers_preflight_risk":b||E?w="custom_url_no_response":r<250&&(w="immediate_network_rejection"),{bucket:w,metadata:{elapsedMsBucket:k,bodySizeBucket:C,online:f,visibilityState:v,isUnloading:String(g),crossOrigin:String(y),hasCustomUrl:String(b)}}}(e,P,s,Date.now()-x);n.diagnosticBucket=t.bucket,n.diagnosticMetadata=t.metadata}catch(e){}}return null}return yield function(e){return r(this,void 0,void 0,function*(){yield new Promise(t=>setTimeout(t,Math.min(e*e*500,3e4)))})}(D),this._sendRequest(Object.assign(Object.assign({},e),{retries:C,attempt:D+1}),n)}})}_getLogEventCompressionMode(e){let t=null==e?void 0:e.logEventCompressionMode;return t||(null==e?void 0:e.disableCompression)!==!0||(t=v.LogEventCompressionMode.Disabled),t||(t=v.LogEventCompressionMode.Enabled),t}_isRateLimited(e){var t;let n=Date.now(),r=null!=(t=this._leakyBucket[e])?t:{count:0,lastRequestTime:n},i=Math.floor((n-r.lastRequestTime)*.05);return r.count=Math.max(0,r.count-i),r.count>=50||(r.count+=1,r.lastRequestTime=n,this._leakyBucket[e]=r,!1)}_getPopulatedURL(e){var t;let n=null!=(t=e.fallbackUrl)?t:e.urlConfig.getUrl();(e.urlConfig.endpoint===o.Endpoint._initialize||e.urlConfig.endpoint===o.Endpoint._download_config_specs)&&(this._lastUsedInitUrl=n);let r=Object.assign({[o.NetworkParam.SdkKey]:e.sdkKey,[o.NetworkParam.SdkType]:d.SDKType._get(e.sdkKey),[o.NetworkParam.SdkVersion]:f.SDK_VERSION,[o.NetworkParam.Time]:String(Date.now()),[o.NetworkParam.SessionID]:_.SessionID.get(e.sdkKey)},e.params),i=Object.keys(r).map(e=>`${encodeURIComponent(e)}=${encodeURIComponent(r[e])}`).join("&");return`${n}${i?`?${i}`:""}`}_tryEncodeBody(e){var t;let n=(0,c._getWindowSafe)(),r=e.body;if(e.isStatsigEncodable&&!this._options.disableStatsigEncoding&&"string"==typeof r&&null==(0,i._getStatsigGlobalFlag)("no-encode")&&(null==n?void 0:n.btoa))try{e.body=n.btoa(r).split("").reverse().join(""),e.params=Object.assign(Object.assign({},null!=(t=e.params)?t:{}),{[o.NetworkParam.StatsigEncoded]:"1"})}catch(t){a.Log.warn(`Request encoding failed for ${e.urlConfig.getUrl()}`,t)}}_tryToCompressBody(e){return r(this,void 0,void 0,function*(){var t;let n=e.body;if("string"==typeof n&&function(e,t){if(!e.isCompressable||null!=(0,i._getStatsigGlobalFlag)("no-compress")||"undefined"==typeof CompressionStream||"undefined"==typeof TextEncoder)return!1;let n=null!=e.urlConfig.customUrl||null!=e.urlConfig.fallbackUrls,r=!0===u.SDKFlags.get(e.sdkKey,"enable_log_event_compression");switch(t.logEventCompressionMode){case v.LogEventCompressionMode.Disabled:return!1;case v.LogEventCompressionMode.Enabled:if(n&&!r)return!1;return!0;case v.LogEventCompressionMode.Forced:return!0;default:return!1}}(e,this._options))try{let r,i=new TextEncoder().encode(n),s=new CompressionStream("gzip"),l=s.writable.getWriter();l.write(i).catch(a.Log.error),l.close().catch(a.Log.error);let u=s.readable.getReader(),d=[];for(;!(r=yield u.read()).done;)d.push(r.value);let c=d.reduce((e,t)=>
1e+t.length,0),_=new Uint8Array(c),h=0;for(let e of d)_.set(e,h),h+=e.length;e.body=_,e.params=Object.assign(Object.assign({},null!=(t=e.params)?t:{}),{[o.NetworkParam.IsGzipped]:"1"})}catch(t){a.Log.warn(`Request compression failed for ${e.urlConfig.getUrl()}`,t)}})}_getInternalRequestArgs(e,t){let n=this._fallbackResolver.getActiveFallbackUrl(t.sdkKey,t.urlConfig),r=Object.assign(Object.assign({},t),{method:e,fallbackUrl:n});return"data"in t&&b(r,t.data),r}}t.NetworkCore=m;let y=e=>!!e.sdkKey||(a.Log.warn("Unable to make request without an SDK key"),!1),b=(e,t)=>{let{sdkKey:n,fallbackUrl:r}=e,i=h.StableID.get(n),s=_.SessionID.get(n),a=d.SDKType._get(n);e.body=JSON.stringify(Object.assign(Object.assign({},t),{statsigMetadata:Object.assign(Object.assign({},f.StatsigMetadataProvider.get()),{stableID:i,sessionID:s,sdkType:a,fallbackUrl:r})}))};function S(e,t){if(e<0)return"unknown";for(let n of t)if(e<n)return`<${n}`;return`>=${t[t.length-1]}`}function E(e,t,n,r,i){e.urlConfig.endpoint===o.Endpoint._initialize&&s.Diagnostics._markInitNetworkReqEnd(e.sdkKey,s.Diagnostics._getDiagnosticsData(t,n,r,i))}},96340:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0});let r=n(12115),i=n(11306);t.default=(0,r.createContext)({renderVersion:0,client:i.NoopEvaluationsClient,isLoading:!0})},98060:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t._getStorageKey=t._getUserStorageKey=void 0;let r=n(40195);function i(e,t,n){var i;if(n)return n(e,t);let s=t&&t.customIDs?t.customIDs:{},a=[`uid:${null!=(i=null==t?void 0:t.userID)?i:""}`,`cids:${Object.keys(s).sort((e,t)=>e.localeCompare(t)).map(e=>`${e}-${s[e]}`).join(",")}`,`k:${e}`];return(0,r._DJB2)(a.join("|"))}t._getUserStorageKey=i,t._getStorageKey=function(e,t,n){return t?i(e,t,n):(0,r._DJB2)(`k:${e}`)}},98217:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.EventBatch=void 0;class n{constructor(e){this.attempts=0,this.createdAt=Date.now(),this.events=e}incrementAttempts(){this.attempts++}}t.EventBatch=n}}]);

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