@statsig/js-on-device-eval-client 3.0.0-beta.5 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var n={845:(t,n,e)=>{$Q2(n,"__esModule",{value:!0}),n.t=n.i=n.o=void 0,n.o=()=>__STATSIG__||o,n.i=t=>(0,n.o)()[t];n.t=t=>{var e=(0,n.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var i,s="__STATSIG__",r="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},u="undefined"!=typeof globalThis?globalThis:{};const o=null!=(i=null!=(i=null!=(i=r[s])?i:e[s])?i:u[s])?i:{instance:n.t};r[s]=o,e[s]=o,u[s]=o},137:(t,e,n)=>{$Q(e),e.u=e.l=void 0;const s=n(406);function i(t,e,n){if(n)return n(t,e);const i=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(n=null==e?void 0:e.userID)?n:""),"cids:"+Object.keys(i).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+i[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=i,e.u=function(t,e,n){return e?i(t,e,n):(0,s.h)("k:"+t)}},427:(t,e)=>{$Q(e)},694:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const a=n(512),l=n(122),r=n(578),u=n(534),c=n(401);function d(t,e,n,i){return{source:t,data:e,receivedAt:Date.now(),stableID:n,fullUserHash:(0,r.v)(i)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.m=e,this.p=null,this.S=null,this.O="statsig.last_modified_time."+e,this.j=new i}attach(t,e){this.S=t,this.p=e}getDataSync(t){var t=t&&(0,r.A)(t,this.p),e=this.T(t),n=this.j.get(e,t);return n||((n=this.I(e))?(this.j.add(e,n),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,r.A)(e,this.p),n=this.T(e);this.j.add(n,d("Bootstrap",t,null,e))}M(e,n,i){return s(this,void 0,void 0,function*(){u.Storage.isReady()||(yield u.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(n),t=[this.D(t,n,i)];return null!=i&&i.timeoutMs&&t.push(new Promise(t=>setTimeout(t,i.timeoutMs)).then(()=>(a.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}k(n,i){return s(this,void 0,void 0,function*(){var t=n&&(0,r.A)(n,this.p),e=this.T(t),t=yield this.M(null,t,i);t&&this.j.add(e,$P($P({},t),{source:"Prefetch"}))})}D(r,u,o){return s(this,void 0,void 0,function*(){let t=null;r&&this.R(r,u)&&(t=r.data);var e=yield this.N(t,u,o);if(!e)return a.Log.debug("No response returned for latest value"),null;var n=(0,c.C)(e,"has_updates","Response"),i=this.P(),i=l.StableID.get(i);let s=null;if(!0===(null==n?void 0:n.has_updates))s=d("Network",e,i,u);else{if(!t||!1!==(null==n?void 0:n.has_updates))return null;s=d("NetworkNotModified",t,i,u)}e=this.T(u);return this.j.add(e,s),this.G(e,s),s})}P(){return null!=this.S?this.S:(a.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=u.Storage.getItem)?void 0:e.call(u.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){u.Storage.setItem(t,JSON.stringify(e)),this.K(t)}K(t){var e=null!=(e=(0,u.F)(this.O))?e:{},t=(e[t]=Date.now(),o(e,10));t&&(delete e[t],u.Storage.removeItem(t)),(0,u.J)(this.O,e)}};class i{constructor(){this.V={}}get(t,e){var t=this.V[t],n=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&n&&e!==n?(a.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var n=o(this.V,9);n&&delete this.V[n],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function o(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var n=s[t],i=s[e];return"object"==typeof n&&"object"==typeof i?i.receivedAt<n.receivedAt?e:t:i<n?e:t})}},962:(t,r)=>{$Q2(r,"__esModule",{value:!0}),r.Diagnostics=void 0;const i=new Map,n="start";function s(t,e,n,i){return $P({key:n,action:e,step:i,timestamp:Date.now()},t)}function u(t,e){var n=null!=(n=i.get(t))?n:[];n.push(e),i.set(t,n)}function e(t,e){if(e in t)return t[e]}r.Diagnostics={_n:t=>i.get(t),gn:t=>{u(t,s({},n,"overall"))},mn:(t,e,n)=>{u(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:n},"end","overall"))},bn:(t,e)=>{u(t,s(e,n,"initialize","network_request"))},pn:(t,e)=>{u(t,s(e,"end","initialize","network_request"))},yn:t=>{u(t,s({},n,"initialize","process"))},On:(t,e)=>{u(t,s(e,"end","initialize","process"))},jn:t=>{i.delete(t)},Sn(t){if(t&&"object"==typeof t)return{code:e(t,"code"),name:e(t,"name"),message:e(t,"message")}},wn(t,e,n,i){return{success:!0===(null==t?void 0:t.ok),statusCode:null==t?void 0:t.status,sdkRegion:null==(t=null==t?void 0:t.headers)?void 0:t.get("x-statsig-region"),isDelta:!0===n.includes('"is_delta":true')||void 0,attempt:e,error:r.Diagnostics.Sn(i)}},Tn(t,e,n,i){var s=r.Diagnostics._n(n);null==s||s.length<=0||(r.Diagnostics.jn(n),n=function(t,e){t={eventName:"statsig::diagnostics",user:t,value:null,metadata:e,time:Date.now()};return t}(t,{context:"initialize",markers:s.slice(),statsigOptions:i}),e.enqueue(n))}}},539:(t,e)=>{$Q(e)},542:function(t,o,e){var n=this&&this.__awaiter||$A();$Q2(o,"__esModule",{value:!0}),o.ErrorBoundary=o.EXCEPTION_ENDPOINT=void 0;const i=e(512),a=e(902),l=e(0),c=(o.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");o.ErrorBoundary=class{constructor(t,e,n){this.S=t,this.p=e,this.B=n,this.$=new Set}wrap(i){try{const t=i;!function(t){const e=new Set;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(t=>"function"==typeof(null===n||void 0===n?void 0:n[t])).forEach(t=>e.add(t)),n=Object.getPrototypeOf(n);return Array.from(e)}(t).forEach(e=>{const n=t[e];"$EB"in n||(t[e]=(...t)=>this.H(e,()=>n.apply(i,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var n=t();return n&&n instanceof Promise?n.catch(t=>this.W(e,t)):n}catch(t){return this.W(e,t),null}}W(r,u){try{i.Log.warn("Caught error in "+r,{error:u});n(this,void 0,void 0,function*(){var t,e,n=u||Error(c),i=n instanceof Error,s=i?n.name:"No Name";this.$.has(s)||(this.$.add(s),null!=(t=null==(t=this.p)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.B)&&t.call(this,{name:"error",error:u}):(t=a.SDKType.Y(this.S),e=l.StatsigMetadataProvider.get(),i=i?n.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(n),n=JSON.stringify($P({tag:r,exception:s,info:i},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(i=null==(s=this.p)?void 0:s.networkConfig)?void 0:i.networkOverrideFunc)?s:fetch)(o.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.S,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:n}),null!=(i=this.B)&&i.call(this,{name:"error",error:u})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},922:(t,e)=>{$Q(e)},417:(t,e)=>{$Q(e)},770:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=n(137),r=n(406),u=n(512),o=n(410),a=n(830),l=n(637),c=n(534),d=n(257),h=n(397),v={},_=t=>{null!=(t=v[t])&&t.flush().catch(()=>{})};e.EventLogger=class{constructor(t,e,n,i){this.S=t,this.B=e,this.X=n,this.p=i,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),this.st=!0===(null==i?void 0:i.disableLogging),this.rt=null!=(t=null==i?void 0:i.loggingBufferMaxSize)?t:50;e=null==i?void 0:i.networkConfig;this.ot=(0,d.ut)(null==e?void 0:e.logEventUrl,null==e?void 0:e.api,"/rgstr",o.NetworkDefault.eventsApi)}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this.ft(),this.Z.length>this.rt)&&_(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}start(){(0,a.Mt)()||(v[this.S]=this,(0,h.lt)(t=>{"background"===t&&_(this.S)}),this.ct(),this.ht())}stop(){return i(this,void 0,void 0,function*(){this._t&&(clearInterval(this._t),this._t=null),yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){var t;if(this.gt(),0!==this.Z.length)return t=this.Z,this.Z=[],this.bt(t)})}ft(){this.it||(this.it=!0,200<Date.now()-this.nt)||setTimeout(()=>_(this.S),200)}dt(t){if((0,a.Mt)())return!1;if((0,l.yt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.l)(this.S,e),n=t.metadata||{},t=[t.eventName,e,n.gate,n.config,n.ruleID].join("|"),e=this.tt[t],n=Date.now();if(e&&n-e<6e4)return!1;1e3<Object.keys(this.tt).length&&(this.tt={}),this.tt[t]=n}return!0}bt(t){var e,n;return i(this,void 0,void 0,function*(){if(this.st)this.St(t);else try{(!(0,h.Ot)()&&this.X.isBeaconSupported()&&null==(null==(n=null==(e=this.p)?void 0:e.networkConfig)?void 0:n.networkOverrideFunc)?yield this.jt(t):yield this.Tt(t)).success?this.B({name:"logs_flushed",events:t}):this.St(t)}catch(t){u.Log.warn("Failed to flush events.")}})}Tt(e){var n;return i(this,void 0,void 0,function*(){var t=yield this.X.post(this.wt(e)),t=null!=(n=null==t?void 0:t.code)?n:-1;return{success:200<=t&&t<300}})}jt(t){return i(this,void 0,void 0,function*(){return{success:yield this.X.beacon(this.wt(t))}})}wt(t){return{sdkKey:this.S,data:{events:t},url:this.ot,retries:3,isCompressable:!0,params:{[o.NetworkParam.EventCount]:String(t.length)}}}St(t){for(;500<t.length;)t.shift();var e=this.u();try{(0,c.J)(e,t)}catch(t){u.Log.warn("Unable to save failed logs to storage")}}ct(){const e=this.u();i(this,void 0,void 0,function*(){c.Storage.isReady()||(yield c.Storage.isReadyResolver());var t=(0,c.F)(e);t&&(c.Storage.removeItem(e),yield this.bt(t))}).catch(()=>{u.Log.warn("Failed to flush stored logs")})}u(){return"statsig.failed_logs."+(0,r.h)(this.S)}vt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},n=this.It(),n=(n&&(e.statsigMetadata={currentPage:n}),$P($P({},t),e));u.Log.debug("Enqueued Event:",n),this.Z.push(n)}gt(){0!==Object.keys(this.et).length&&(this.vt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.et)}}),this.et={})}It(){var t;if(!1!==(null==(t=this.p)?void 0:t.includeCurrentPageUrlWithEvents))return(0,a.At)()}ht(){var t=null!=(t=null==(t=this.p)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{v[this.S]._t!==e?clearInterval(e):_(this.S)},t);this._t=e}}},406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.xt=r.Dt=r.h=void 0;const u=e(634);r.h=e=>{let n=0;for(let t=0;t<e.length;t++){var i=e.charCodeAt(t);n=(n<<5)-n+i,n&=n}return String(n>>>0)},r.Dt=(t,e)=>(0,r.h)(JSON.stringify((0,r.xt)(t,e)));r.xt=(n,i)=>{if(null==n)return null;var t=Object.keys(n).sort();const s={};return t.forEach(t=>{var e=n[t];0===i||"object"!==(0,u.kt)(e)?s[t]=e:s[t]=(0,r.xt)(e,null!=i?i-1:i)}),s}},333:(t,e)=>{$Q(e)},512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function n(t){return t.unshift("[Statsig]"),t}var i,s;(s=i||(e.LogLevel=i={}))[s.None=0]="None",s[s.Error=1]="Error",s[s.Warn=2]="Warn",s[s.Info=3]="Info",s[s.Debug=4]="Debug";class r{static info(...t){this.level>=i.Info&&console.info("%s"," INFO ",...n(t))}static debug(...t){this.level>=i.Debug&&console.debug("%s"," DEBUG ",...n(t))}static warn(...t){this.level>=i.Warn&&console.warn("%s"," WARN ",...n(t))}static error(...t){this.level>=i.Error&&console.error("%s"," ERROR ",...n(t))}}(e.Log=r).level=i.Warn},410:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=void 0,e.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},404:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,n(845);const u=n(845),g=n(962),b=n(512),o=n(410),a=n(902),l=n(830),c=n(143),d=n(122),h=n(0),y=n(397),m=new Set([408,500,502,503,504,522,524,599]);e.NetworkCore=class{constructor(t,e){this.B=e,this.Et=1e4,this.Rt={},this.p={},t&&(this.p=t),this.p.networkConfig&&(this.Rt=this.p.networkConfig),this.Rt.networkTimeoutMs&&(this.Et=this.Rt.networkTimeoutMs)}post(e){return r(this,void 0,void 0,function*(){let t=yield this.Nt(e);return e.isStatsigEncodable&&(t=this.Ct(e,t)),this.Pt($P({method:"POST",body:t},e))})}get(t){return this.Pt($P({method:"GET"},t))}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(i){return r(this,void 0,void 0,function*(){var t,e,n;return!!O(i)&&(t=yield this.Nt(i),e=yield this.Gt(i),(n=navigator).sendBeacon.bind(n)(e,t))})}Pt(_){var f,p;return r(this,void 0,void 0,function*(){if(!O(_))return null;if(this.Rt.preventAllNetworkTraffic)return null;var{method:e,body:n,retries:i,attempt:s}=_,s=null!=s?s:1;const r="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>null===r||void 0===r?void 0:r.abort(`Timeout of ${this.Et}ms expired.`),this.Et),u=yield this.Gt(_);let o=null;var a=(0,y.Ut)();try{var l,c,d,h={method:e,body:n,headers:$P({},_.headers),signal:null===r||void 0===r?void 0:r.signal,priority:_.priority,keepalive:a},v=(_.isInitialize&&g.Diagnostics.bn(_.sdkKey,{attempt:s}),null!=(f=this.Rt.networkOverrideFunc)?f:fetch);if(o=yield v(u,h),clearTimeout(t),o.ok)return d=yield o.text(),_.isInitialize&&g.Diagnostics.pn(_.sdkKey,g.Diagnostics.wn(o,s,d)),{body:d,code:o.status};throw l=yield o.text().catch(()=>"No Text"),(c=new Error(`NetworkError: ${u} `+l)).name="NetworkError",c}catch(t){n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(r,t);return _.isInitialize&&g.Diagnostics.pn(_.sdkKey,g.Diagnostics.wn(o,s,"",t)),!i||i<s||!m.has(null!=(p=null===o||void 0===o?void 0:o.status)?p:500)?(null!=(p=this.B)&&p.call(this,{name:"error",error:t}),b.Log.error(`A networking error occured during ${e} request to ${u}.`,n,t),null):this.Pt($P($P({},_),{retries:i,attempt:s+1}))}})}Gt(n){return r(this,void 0,void 0,function*(){const e=$P({[o.NetworkParam.SdkKey]:n.sdkKey,[o.NetworkParam.SdkType]:a.SDKType.Y(n.sdkKey),[o.NetworkParam.SdkVersion]:h.SDK_VERSION,[o.NetworkParam.Time]:String(Date.now()),[o.NetworkParam.SessionID]:yield c.SessionID.get(n.sdkKey)},n.params);var t=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return n.url+(t?"?"+t:"")})}Nt(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,n=d.StableID.get(e),i=c.SessionID.get(e),e=a.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},h.StatsigMetadataProvider.get()),{stableID:n,sessionID:i,sdkType:e})}))})}Ct(t,e){var n,i,s=(0,l.Lt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,u.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(n=s.btoa(e).split("").reverse().join(""))?n:e;return t.params=$P($P({},null!=(i=t.params)?i:{}),{[o.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return b.Log.warn("/initialize request encoding failed"),e}}};const O=t=>!!t.sdkKey||(b.Log.warn("Unable to make request without an SDK key"),!1)},405:(t,e)=>{$Q(e)},361:(t,e)=>{$Q(e)},902:(t,e)=>{$Q(e),e.SDKType=void 0;const n={};let i;e.SDKType={Y:t=>{return(null!=(t=n[t])?t:"js-mono")+(null!==i&&void 0!==i?i:"")},Kt(t,e){n[t]=e},Ft(t){i&&"-react"!==i||(i="-"+t)}}},830:(t,i)=>{$Q2(i,"__esModule",{value:!0}),i.At=i.qt=i.zt=i.Mt=i.Jt=i.Lt=void 0;i.Lt=()=>"undefined"!=typeof window?window:null,i.Jt=()=>{var t=(0,i.Lt)();return null!=(t=null==t?void 0:t.document)?t:null},i.Mt=()=>{var t;return null===(0,i.Jt)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},i.zt=(t,e)=>{var n=(0,i.Lt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)},i.qt=(t,e)=>{var n=(0,i.Jt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)};i.At=()=>{var t;try{return null==(t=(0,i.Lt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},143:(t,e,n)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const i=n(137),r=n(512),u=n(534),o=n(23),a=18e5,l=144e5,c={};function d(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function h(t){return"statsig.session_id."+(0,i.u)(t)}e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:t=>{null==c[t]&&(c[t]=function(t){let e=function(t){t=h(t);return(0,u.F)(t)}(t);var n=Date.now();e=e||{sessionID:(0,o.getUUID)(),startTime:n,lastUpdate:n};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),n=t.data,i=((function({lastUpdate:t}){return Date.now()-t>a}(n)||function({startTime:t}){return Date.now()-t>l}(n))&&(n.sessionID=(0,o.getUUID)(),n.startTime=e),n.lastUpdate=e,n),s=t.sdkKey;s=h(s);try{(0,u.J)(s,i)}catch(t){r.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=n.startTime,n=t.sdkKey,t.idleTimeoutID=d(n,a),t.ageTimeoutID=d(n,l-e),t},overrideInitialSessionID:(t,e)=>{var n;c[e]=(t=t,e=e,n=Date.now(),{data:{sessionID:t,startTime:n,lastUpdate:n},sdkKey:e})}}},122:(t,e,n)=>{$Q(e),e.StableID=void 0;const i=n(137),s=n(512),r=n(534),u=n(23),o={};function a(t){return"statsig.stable_id."+(0,i.u)(t)}function l(t,e){e=a(e);try{(0,r.J)(e,t)}catch(t){s.Log.warn("Failed to save StableID")}}e.StableID={get:e=>{if(null==o[e]){let t=function(t){t=a(t);return(0,r.F)(t)}(e);null==t&&l(t=(0,u.getUUID)(),e),o[e]=t}return o[e]},setOverride:(t,e)=>{l(o[e]=t,e)}}},375:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,n(845);const u=n(845),o=n(542),a=n(770),l=n(512),c=n(830),d=n(143),h=n(534);e.StatsigClientBase=class{constructor(t,e,n,i){this.loadingStatus="Uninitialized",this.Vt={};var s,r=this.$emt.bind(this);null!=(null==i?void 0:i.logLevel)&&(l.Log.level=i.logLevel),null!=i&&i.disableStorage&&h.Storage.Bt(!0),null!=i&&i.initialSessionID&&d.StatsigSession.overrideInitialSessionID(i.initialSessionID,t),null!=i&&i.storageProvider&&h.Storage.de(i.storageProvider),this.S=t,this.p=null!=i?i:{},this.overrideAdapter=null!=(s=null==i?void 0:i.overrideAdapter)?s:null,this.Ht=new a.EventLogger(t,r,n,i),this.Wt=new o.ErrorBoundary(t,i,r),this.Wt.wrap(this),this.Wt.wrap(n),this.Wt.wrap(e),this.Wt.wrap(this.Ht),(0,c.Mt)()||(null!=(n=null!=(r=(s=(0,u.o)()).instances)?r:{})[t]&&l.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),n[t]=this,s.lastInstance=this,s.instances=n,__STATSIG__=s),this.dataAdapter=e,this.dataAdapter.attach(t,i),this.storageProvider=h.Storage,this.Yt()}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Ht.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,h.Storage.Bt(t.disableStorage))}flush(){return this.Ht.flush()}shutdown(){return i(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),yield this.Ht.stop()})}on(t,e){this.Vt[t]||(this.Vt[t]=[]),this.Vt[t].push(e)}off(t,e){this.Vt[t]&&-1!==(e=this.Vt[t].indexOf(e))&&this.Vt[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(n){var t;const e=e=>{try{e(n)}catch(t){!0===e.__isInternal?this.Wt.logError("__emit:"+n.name,t):l.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",n)}};this.Vt[n.name]&&this.Vt[n.name].forEach(t=>e(t)),null!=(t=this.Vt["*"])&&t.forEach(e)}Qt(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}Xt(t,e,n){!0===(null==n?void 0:n.disableExposureLog)?this.Ht.incrementNonExposureCount(t):this.Ht.enqueue(e)}}},636:(t,e)=>{$Q(e)},206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},637:(t,e)=>{$Q(e),e.Zt=e.te=e.ee=e.yt=void 0;const n="statsig::config_exposure",i="statsig::gate_exposure",a=(t,e,n,i,s)=>({eventName:t,user:e,value:null,metadata:r(n,i),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===i||t===n,e.ee=(t,e)=>{return a(i,t,e.details,{gate:e.name,gateValue:String(e.value),ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])},e.te=(t,e)=>{return a(n,t,e.details,{config:e.name,ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])};e.Zt=(t,e,n)=>{var i,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(n));let u="",o=null!=(i=null==s?void 0:s.undelegated_secondary_exposures)?i:[];return r&&(u=null!=(i=s.allocated_experiment_name)?i:"",o=s.secondary_exposures),a("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:n,ruleID:e.ruleID,allocatedExperiment:u,isExplicitParameter:String(r)},o)};const r=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},0:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.0.0-beta.5";let n={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>n,add:t=>{n=$P($P({},n),t)}}},586:(t,e)=>{$Q(e)},59:(t,e,n)=>{$Q(e),e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const r=n(634),s="default";function u(t,e,n,i){return{name:t,details:e,ruleID:null!=(t=null==n?void 0:n.rule_id)?t:s,__evaluation:n,value:i}}function i(t,e,n){var i=null!=(i=null==n?void 0:n.value)?i:{};return $P($P({},u(t,e,n,i)),{get:o(null==n?void 0:n.value)})}function o(i,s){return(t,e)=>{var n=null!=(n=null==i?void 0:i[t])?n:null;return null!=n&&(null==e||(0,r.le)(n,e))?(null!=s&&s(t),n):null!=e?e:null}}e.ue=function(t,e,n){return u(t,e,n,!0===(null==n?void 0:n.value))},e.oe=i,e.re=function(t,e,n){return t=i(t,e,n),$P($P({},t),{groupName:null!=(e=null==n?void 0:n.group_name)?e:null})},e.se=function(t,e,n,i){return $P($P({},u(t,e,n,void 0)),{get:o(null==n?void 0:n.value,i),groupName:null!=(t=null==n?void 0:n.group_name)?t:null,__value:null!=(e=null==n?void 0:n.value)?e:{}})},e.ne=function(t,e,n,i){return $P($P($P({},t),e),{get:o(n,i)})},e.ie=o},812:(t,e)=>{$Q(e)},578:(t,e,n)=>{$Q(e),e.v=e.A=void 0;const i=n(406),s=n(512);e.A=function(t,e){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment&&(n.statsigEnvironment=e.environment),n}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,i.Dt)(t):null}},534:(t,n,e)=>{$Q2(n,"__esModule",{value:!0}),n.J=n.F=n.Storage=void 0;var i=e(512),e=e(830);const s={},r={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>s[t]||null,setItem:(t,e)=>{s[t]=e},removeItem:t=>{delete s[t]},getAllKeys:()=>Object.keys(s)};let u=null;try{const l=(0,e.Lt)();l&&l.localStorage&&"function"==typeof l.localStorage.getItem&&(u={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>l.localStorage.getItem(t),setItem:(t,e)=>l.localStorage.setItem(t,e),removeItem:t=>l.localStorage.removeItem(t),getAllKeys:()=>Object.keys(l.localStorage)})}catch(t){i.Log.warn("Failed to setup localStorageProvider.")}let o=null!==u&&void 0!==u?u:r,a=o;n.Storage={isReady:()=>a.isReady(),isReadyResolver:()=>a.isReadyResolver(),getProviderName:()=>a.getProviderName(),getItem:t=>{var e=()=>a.getItem(t);try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return n.Storage.de(r),null;throw t}},setItem:(t,e)=>a.setItem(t,e),removeItem:t=>a.removeItem(t),getAllKeys:()=>a.getAllKeys(),de:t=>{o=t,a=t},Bt:t=>{a=t?r:o}},n.F=function(t){return t=n.Storage.getItem(t),JSON.parse(null!=t?t:"null")},n.J=function(t,e){n.Storage.setItem(t,JSON.stringify(e))}},401:(t,e,n)=>{$Q(e),e.C=void 0;const s=n(512);e.C=function(t,e,n){try{var i=JSON.parse(t);return"object"==typeof i&&0 in i,i}catch(t){}return s.Log.error("Failed to parse "+n),null}},634:(t,e)=>{$Q(e),e.le=e.kt=void 0,e.kt=function(t){return Array.isArray(t)?"array":typeof t},e.le=function(t,e){var n=t=>Array.isArray(t)?"array":typeof t;return n(t)===n(e)}},23:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let n=(new Date).getTime(),i="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0<n?(e=(n+e)%16|0,n=Math.floor(n/16)):(e=(i+e)%16|0,i=Math.floor(i/16)),("x"===t?e:7&e|8).toString(16)})}},257:(t,e)=>{$Q(e),e.ut=void 0,e.ut=function(t,e,n,i){return t||(e?""+e+n:""+i+n)}},397:(t,e,n)=>{$Q(e),e.ve=e.lt=e.Ut=e.Ot=void 0;n=n(830);const i="foreground",s="background",r=[];let u=i,o=!1;e.Ot=()=>u===i,e.Ut=()=>o,e.lt=t=>{r.unshift(t)};e.ve=e=>{e!==u&&(u=e,r.forEach(t=>t(e)))},(0,n.zt)("focus",()=>{(o=!1,e.ve)(i)}),(0,n.zt)("blur",()=>(0,e.ve)(s)),(0,n.zt)("beforeunload",()=>{o=!0,(0,e.ve)(s)}),(0,n.qt)("visibilitychange",()=>{(0,e.ve)("visible"===document.visibilityState?i:s)})},914:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,s)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),s=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,n(845);const r=n(962),u=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return r.Diagnostics}}),n(770)),o=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return u.EventLogger}}),n(512));$Q2(e,"Log",{enumerable:!0,get:function(){return o.Log}});var a=n(0);const l=n(534);$Q2(e,"Storage",{enumerable:!0,get:function(){return l.Storage}}),s(n(845),e),s(n(137),e),s(n(427),e),s(n(694),e),s(n(962),e),s(n(539),e),s(n(542),e),s(n(922),e),s(n(417),e),s(n(406),e),s(n(333),e),s(n(512),e),s(n(404),e),s(n(410),e),s(n(405),e),s(n(361),e),s(n(830),e),s(n(902),e),s(n(143),e),s(n(122),e),s(n(375),e),s(n(636),e),s(n(206),e),s(n(637),e),s(n(0),e),s(n(586),e),s(n(59),e),s(n(812),e),s(n(578),e),s(n(534),e),s(n(401),e),s(n(634),e),s(n(257),e),s(n(23),e),s(n(397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:o.Log,SDK_VERSION:a.SDK_VERSION})},638:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,s)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),s=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),s(n(600),e),e.default=__STATSIG__},977:(t,e)=>{function o(t){return t.setUTCHours(0,0,0,0),t.getTime()}$Q(e),e.default={compareNumbers(t,e,n){if(null==t||null==e)return!1;var i=Number(t),s=Number(e);if(isNaN(i)||isNaN(s))return!1;switch(n){case"gt":return e<t;case"gte":return e<=t;case"lt":return t<e;case"lte":return t<=e;default:return!1}},compareVersions(t,e,n){if(null==t||null==e)return!1;var t=String(t),e=String(e),i=t=>{var e=t.indexOf("-");return-1!==e?t.substring(0,e):t},s=((t,e)=>{var n=t.split(".").map(t=>parseInt(t)),i=e.split(".").map(t=>parseInt(t));let s=0;for(;s<Math.max(n.length,i.length);){var r=s<n.length?n[s]:0,u=s<i.length?i[s]:0;if(r<u)return-1;if(u<r)return 1;s++}return 0})(i(t),i(e));switch(n){case"version_gt":return 0<s;case"version_gte":return 0<=s;case"version_lt":return s<0;case"version_lte":return s<=0;case"version_eq":return 0===s;case"version_neq":return 0!==s;default:return!1}},compareStringInArray(s,t,r){if(!Array.isArray(t))return!1;const u="any_case_sensitive"!==r&&"none_case_sensitive"!==r;var e=-1!==t.findIndex(t=>{var e=String(s),t=String(t),n=u?e.toLowerCase():e,i=u?t.toLowerCase():t;switch(r){case"any":case"none":case"any_case_sensitive":case"none_case_sensitive":return n===i;case"str_starts_with_any":return n.startsWith(i);case"str_ends_with_any":return n.endsWith(i);case"str_contains_any":case"str_contains_none":return n.includes(i);default:return!1}});switch(r){case"none":case"none_case_sensitive":case"str_contains_none":return!e;default:return e}},compareStringWithRegEx(t,e){try{var n=String(t);if(n.length<1e3)return new RegExp(String(e)).test(n)}catch(t){}return!1},compareTime(n,i,s){if(null==n||null==i)return!1;try{let t=new Date(String(n)),e=(isNaN(t.getTime())&&(t=new Date(Number(n))),new Date(String(i)));isNaN(e.getTime())&&(e=new Date(Number(i)));var r=t.getTime(),u=e.getTime();if(isNaN(r)||isNaN(u))return!1;switch(s){case"before":return r<u;case"after":return u<r;case"on":return o(t)===o(e);default:return!1}}catch(t){return!1}}}},577:(t,e)=>{$Q(e),e.resultToLayerEval=e.resultToConfigEval=e.resultToGateEval=e.makeEvalResult=void 0,e.makeEvalResult=function(t){return $P($P({},{unsupported:!1,bool_value:!1,rule_id:"",secondary_exposures:[],json_value:{},explicit_parameters:null,allocated_experiment_name:null,is_experiment_group:!1,group_name:null,undelegated_secondary_exposures:void 0}),t)},e.resultToGateEval=function(t,e){return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.bool_value,secondary_exposures:e.secondary_exposures}},e.resultToConfigEval=function(t,e){var n;return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.json_value,secondary_exposures:e.secondary_exposures,group:null!=(n=e.group_name)?n:"",group_name:null!=(n=e.group_name)?n:void 0,is_device_based:!1,is_experiment_active:t.isActive,is_user_in_experiment:e.is_experiment_group}},e.resultToLayerEval=function(t,e,n){return{name:t.name,rule_id:n.rule_id,value:n.json_value,secondary_exposures:n.secondary_exposures,undelegated_secondary_exposures:n.undelegated_secondary_exposures,allocated_experiment_name:null!=(t=n.allocated_experiment_name)?t:"",explicit_parameters:null!=(t=n.explicit_parameters)?t:[],group:null!=(t=n.group_name)?t:"",group_name:null!=(t=n.group_name)?t:void 0,is_device_based:!1,is_experiment_active:null==e?void 0:e.isActive,is_user_in_experiment:n.is_experiment_group}}},485:(t,e,n)=>{$Q(e);const i=n(680),c=n(977),d=n(577);function h(t,e){var n;return"string"==typeof e&&"userid"!==e.toLowerCase()?null!=(n=null==(n=t.customIDs)?void 0:n[e])?n:null==(n=null==t?void 0:t.customIDs)?void 0:n[e.toLowerCase()]:t.userID}function v(t){return(0,i.SHA256)(t).dataView().getBigUint64(0,!1)}function o(t){return null!=t&&"object"==typeof t}e.default=class{constructor(t){this.we=t}evaluateGate(t,e){var{spec:t,details:n}=this.tn("gate",t);return t?{evaluation:(0,d.resultToGateEval)(t,this.en(t,e)),details:n}:{evaluation:null,details:n}}evaluateConfig(t,e){var{spec:t,details:n}=this.tn("config",t);return t?{evaluation:(0,d.resultToConfigEval)(t,this.en(t,e)),details:n}:{evaluation:null,details:n}}evaluateLayer(t,e){var n,{spec:t,details:i}=this.tn("layer",t);return t?(n=null!=(n=null==(e=this.en(t,e))?void 0:e.allocated_experiment_name)?n:"",n=this.we.getSpecAndSourceInfo("config",n).spec,{evaluation:(0,d.resultToLayerEval)(t,n,e),details:i}):{evaluation:null,details:i}}tn(t,e){t=this.we.getSpecAndSourceInfo(t,e);return{details:this.nn(t),spec:t.spec}}nn(t){var{source:t,spec:e,lcut:n,receivedAt:i}=t;return"Uninitialized"===t||"NoValues"===t?{reason:t}:{reason:t+":"+(null==e?"Unrecognized":"Recognized"),lcut:n,receivedAt:i}}en(t,e){var n=o(t.defaultValue)?t.defaultValue:void 0;if(!t.enabled)return(0,d.makeEvalResult)({json_value:n,rule_id:"disabled"});var i=[];for(const u of t.rules){var s,r=this.rn(u,e);if(r.unsupported)return r;if(i.push(...r.secondary_exposures),r.bool_value)return this.sn(u.configDelegate,e,i)||(s=function(t,e,n){if(100===t.passPercentage)return!0;if(0===t.passPercentage)return!1;e=v(n.salt+"."+(null!=(n=t.salt)?n:t.id)+"."+(null!=(n=h(e,t.idType))?n:""));return Number(e%BigInt(1e4))<100*t.passPercentage}(u,e,t),(0,d.makeEvalResult)({rule_id:r.rule_id,bool_value:s,json_value:s?r.json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,is_experiment_group:r.is_experiment_group,group_name:r.group_name}))}return(0,d.makeEvalResult)({json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,rule_id:"default"})}rn(t,e){var n=[];let i=!0;for(const r of t.conditions){var s=this.un(r,e);if(s.unsupported)return s;n.push(...s.secondary_exposures),s.bool_value||(i=!1)}return(0,d.makeEvalResult)({rule_id:t.id,bool_value:i,json_value:o(t.returnValue)?t.returnValue:void 0,secondary_exposures:n,is_experiment_group:!0===t.isExperimentGroup,group_name:t.groupName})}un(t,e){let n=null,i=!1;var s=t.field,r=t.targetValue,u=t.idType,o=t.type;switch(o){case"public":return(0,d.makeEvalResult)({bool_value:!0});case"pass_gate":case"fail_gate":var a=String(r),a=this.ln(a,e);return(0,d.makeEvalResult)({bool_value:"fail_gate"===o?!a.bool_value:a.bool_value,secondary_exposures:a.secondary_exposures});case"multi_pass_gate":case"multi_fail_gate":return this.an(r,o,e);case"user_field":case"ip_based":case"ua_based":n=function(t,e){var n;if(null==e||"object"!=typeof t||null==t)return null;var i=t;return null!=(n=null!=(n=null!=(n=null!=(n=null!=(n=i[e])?n:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e.toLowerCase()]}(e,s);break;case"environment_field":n=function(t,e){if(null==e)return null;t=t.statsigEnvironment;if(null!=t){const n=e.toLowerCase(),i=Object.keys(t).find(t=>t.toLowerCase()===n);return void 0!==i?t[i]:void 0}}(e,s);break;case"current_time":n=Date.now();break;case"user_bucket":a=v(null!==(a=String(null!=(a=null==(a=t.additionalValues)?void 0:a.salt)?a:"")+"."+h(e,u))?a:"");n=Number(a%BigInt(1e3));break;case"unit_id":n=h(e,u);break;default:return(0,d.makeEvalResult)({unsupported:!0})}var l=t.operator;switch(l){case"gt":case"gte":case"lt":case"lte":i=c.default.compareNumbers(n,r,l);break;case"version_gt":case"version_gte":case"version_lt":case"version_lte":case"version_eq":case"version_neq":i=c.default.compareVersions(n,r,l);break;case"any":case"none":case"str_starts_with_any":case"str_ends_with_any":case"str_contains_any":case"str_contains_none":case"any_case_sensitive":case"none_case_sensitive":i=c.default.compareStringInArray(n,r,l);break;case"str_matches":i=c.default.compareStringWithRegEx(n,r);break;case"before":case"after":case"on":i=c.default.compareTime(n,r,l);break;case"eq":i=n==r;break;case"neq":i=n!=r;break;case"in_segment_list":case"not_in_segment_list":return(0,d.makeEvalResult)({unsupported:!0})}return(0,d.makeEvalResult)({bool_value:i})}sn(t,e,n){var i;return t&&(i=this.we.getSpecAndSourceInfo("config",t).spec,i)?(e=this.en(i,e),(0,d.makeEvalResult)($P($P({},e),{allocated_experiment_name:t,explicit_parameters:i.explicitParameters,secondary_exposures:n.concat(e.secondary_exposures),undelegated_secondary_exposures:n}))):null}ln(t,e){var n=[];let i=!1;var s=this.we.getSpecAndSourceInfo("gate",t)["spec"];if(s){s=this.en(s,e);if(s.unsupported)return s;i=s.bool_value,n.push(...s.secondary_exposures),n.push({gate:t,gateValue:String(i),ruleID:s.rule_id})}return(0,d.makeEvalResult)({bool_value:i,secondary_exposures:n})}an(t,e,n){if(!Array.isArray(t))return(0,d.makeEvalResult)({unsupported:!0});var i="multi_pass_gate"===e,s=[];let r=!1;for(const o of t){if("string"!=typeof o)return(0,d.makeEvalResult)({unsupported:!0});var u=this.ln(o,n);if(u.unsupported)return u;if(s.push(...u.secondary_exposures),i?!0===u.bool_value:!1===u.bool_value){r=!0;break}}return(0,d.makeEvalResult)({bool_value:r,secondary_exposures:s})}}},494:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e);const i=n(914);class r extends i.NetworkCore{constructor(t=null){super(t);t=null==t?void 0:t.networkConfig;this.cn=(0,i.ut)(null==t?void 0:t.downloadConfigSpecsUrl,null==t?void 0:t.api,"/download_config_specs",i.NetworkDefault.specsApi)}fetchConfigSpecs(e,n){var i;return s(this,void 0,void 0,function*(){var t=yield this.get({sdkKey:e,url:this.cn,priority:n});return null!=(i=null==t?void 0:t.body)?i:null})}}e.default=r},932:(t,e,n)=>{$Q(e);const i=n(914);function s(t){return(0,i.C)(t,"has_updates","DownloadConfigSpecsResponse")}e.default=class{constructor(){this._e=null,this.ge=null,this.be="Uninitialized",this.ye=0,this.me=0}getValues(){return this._e?s(this._e):null}setValuesFromDataAdapter(t){var e;t&&!0===(null==(e=s(t.data))?void 0:e.has_updates)&&(this.ye=e.time,this.me=t.receivedAt,this.be=t.source,this.ge=e,this._e=t.data)}reset(){this.ge=null,this._e=null,this.be="Loading"}finalize(){this.ge||(this.be="NoValues")}getSpecAndSourceInfo(t,e){var t=this.dn(t);return{spec:null!=(t=null==t?void 0:t.find(t=>t.name===e))?t:null,source:this.be,lcut:this.ye,receivedAt:this.me}}dn(t){var e;switch(t){case"gate":return null==(e=this.ge)?void 0:e.feature_gates;case"config":return null==(e=this.ge)?void 0:e.dynamic_configs;case"layer":return null==(e=this.ge)?void 0:e.layer_configs}}}},217:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e);const u=n(914),s=n(485),r=n(494),o=n(932),a=n(660);class l extends u.StatsigClientBase{static instance(t){var e=(0,u.o)().instance(t);return e instanceof l?e:(u.Log.warn((0,u.Mt)()?"StatsigOnDeviceEvalClient.instance is not supported in server environments":"Unable to find StatsigOnDeviceEvalClient instance"),new l(null!=t?t:""))}constructor(t,e=null){u.SDKType.Kt(t,"js-on-device-eval-client");var n=new r.default(e);super(t,null!=(t=null==e?void 0:e.dataAdapter)?t:new a.StatsigSpecsDataAdapter,n,e),this.we=new o.default,this.hn=new s.default(this.we)}initializeSync(t){this.Ht.start(),this.updateSync(t)}initializeAsync(t){return i(this,void 0,void 0,function*(){return u.Storage.isReady()||(yield u.Storage.isReadyResolver()),this.Ht.start(),this.updateAsync(t)})}updateSync(t){this.we.reset();var e=this.dataAdapter.getDataSync();this.we.setValuesFromDataAdapter(e),this.we.finalize(),this.Qt("Ready",e),null!=t&&t.disableBackgroundCacheRefresh||this.xe(e)}updateAsync(e){return i(this,void 0,void 0,function*(){this.we.reset(),this.Qt("Loading",null);var t=this.dataAdapter.getDataSync();this.we.setValuesFromDataAdapter(t),t=yield this.dataAdapter.getDataAsync(t,e),this.we.setValuesFromDataAdapter(t),this.we.finalize(),this.Qt("Ready",t)})}getContext(){return{sdkKey:this.S,options:this.p,values:this.we.getValues(),errorBoundary:this.Wt,session:u.StatsigSession.get(this.S),stableID:u.StableID.get(this.S)}}checkGate(t,e,n){return this.getFeatureGate(t,e,n).value}getFeatureGate(t,e,n){var e=(0,u.A)(e,this.p),{evaluation:i,details:s}=this.hn.evaluateGate(t,e),s=(0,u.ue)(t,s,i);return this.Xt(t,(0,u.ee)(e,s),n),this.$emt({name:"gate_evaluation",gate:s}),s}getDynamicConfig(t,e,n){var e=(0,u.A)(e,this.p),{evaluation:i,details:s}=this.hn.evaluateConfig(t,e),s=(0,u.oe)(t,s,i),r=null==(r=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:r.call(i,s,e,n),i=null!=r?r:s;return this.Xt(t,(0,u.te)(e,i),n),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e,n){var e=(0,u.A)(e,this.p),{evaluation:i,details:s}=this.hn.evaluateConfig(t,e),s=(0,u.re)(t,s,i),r=null==(r=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:r.call(i,s,e,n),i=null!=r?r:s;return this.Xt(t,(0,u.te)(e,i),n),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,t,n){const i=(0,u.A)(t,this.p);var{evaluation:t,details:s}=this.hn.evaluateLayer(e,i);const r=(0,u.se)(e,s,t,t=>{this.Xt(e,(0,u.Zt)(i,r,t),n)});return this.$emt({name:"layer_evaluation",layer:r}),r}logEvent(t,e,n,i){this.Ht.enqueue($P($P({},"string"==typeof t?{eventName:t,value:n,metadata:i}:t),{user:(0,u.A)(e,this.p),time:Date.now()}))}Yt(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Me(null)})}Me(t){this.we.finalize(),this.Qt("Ready",t)}xe(t){this.dataAdapter.getDataAsync(t,{priority:"low"}).catch(t=>{u.Log.error("An error occurred after update.",t)})}}e.default=l},660:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e),e.StatsigSpecsDataAdapter=void 0;const i=n(914),r=n(494);class u extends i.DataAdapterCore{constructor(){super("SpecsDataAdapter","specs"),this.X=null}attach(t,e){super.attach(t,e),this.X=new r.default(null!=e?e:{})}getDataAsync(t,e){return this.M(t,void 0,e)}prefetchData(t){return this.k(void 0,t)}N(t,e,n){var i;return s(this,void 0,void 0,function*(){return null!=(i=yield null==(i=this.X)?void 0:i.fetchConfigSpecs(this.P(),null==n?void 0:n.priority))?i:null})}T(){var t=(0,i.u)(this.P());return`${i.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return 0<t.data.length}}e.StatsigSpecsDataAdapter=u},600:(t,e,n)=>{$Q(e),e.StatsigSpecsDataAdapter=e.StatsigOnDeviceEvalClient=void 0;var i=n(217);e.StatsigOnDeviceEvalClient=i.default;const s=n(660);$Q2(e,"StatsigSpecsDataAdapter",{enumerable:!0,get:function(){return s.StatsigSpecsDataAdapter}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigSpecsDataAdapter:s.StatsigSpecsDataAdapter,StatsigOnDeviceEvalClient:i.default}),e.default=__STATSIG__},680:(t,e,n)=>{$Q(e),e.SHA256=void 0;const i=n(866);$Q2(e,"SHA256",{enumerable:!0,get:function(){return i.SHA256}})},866:(t,e)=>{$Q(e),e.SHA256=void 0,e.SHA256=function(t){return(new i).update(t)};const n=[-2147483648,8388608,32768,128],u=[24,16,8,0],m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];class i{constructor(){this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.lastByteIndex=-1}update(n){if(!this.finalized){if("string"!=typeof n)throw new Error('Must be of type "string"');var i;let t=0,e;for(var s=n.length,r=this.blocks;t<s;){for(this.hashed&&(this.hashed=!1,r[0]=this.block,r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),e=this.start;t<s&&e<64;++t)(i=n.charCodeAt(t))<128?r[e>>2]|=i<<u[3&e++]:(i<2048?r[e>>2]|=(192|i>>6)<<u[3&e++]:(i<55296||57344<=i?r[e>>2]|=(224|i>>12)<<u[3&e++]:(i=65536+((1023&i)<<10|1023&n.charCodeAt(++t)),r[e>>2]|=(240|i>>18)<<u[3&e++],r[e>>2]|=(128|i>>12&63)<<u[3&e++]),r[e>>2]|=(128|i>>6&63)<<u[3&e++]),r[e>>2]|=(128|63&i)<<u[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,64<=e?(this.block=r[16],this.start=e-64,this.hash(),this.hashed=!0):this.start=e}4294967295<this.bytes&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296)}return this}finalize(){var t,e;this.finalized||(this.finalized=!0,t=this.blocks,e=this.lastByteIndex,t[16]=this.block,t[e>>2]|=n[3&e],this.block=t[16],56<=e&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash())}hash(){var t=this.blocks;let e=this.h0,n=this.h1,i=this.h2,s=this.h3,r=this.h4,u=this.h5,o=this.h6,a=this.h7,l,c,d,h,v,_,f,p,g,b,y;for(l=16;l<64;++l)v=t[l-15],c=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,v=t[l-2],d=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,t[l]=t[l-16]+c+t[l-7]+d<<0;for(y=n&i,l=0;l<64;l+=4)this.first?(p=704751109,v=t[0]-210244248,a=v-1521486534<<0,s=v+143694565<<0,this.first=!1):(c=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),d=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),p=e&n,h=p^e&i^y,f=r&u^~r&o,v=a+d+f+m[l]+t[l],_=c+h,a=s+v<<0,s=v+_<<0),c=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),d=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),g=s&e,h=g^s&n^p,f=a&r^~a&u,v=o+d+f+m[l+1]+t[l+1],_=c+h,o=i+v<<0,i=v+_<<0,c=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),d=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),b=i&s,h=b^i&e^g,f=o&a^~o&r,v=u+d+f+m[l+2]+t[l+2],_=c+h,u=n+v<<0,n=v+_<<0,c=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),d=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7),y=n&i,h=y^n&s^b,f=u&o^~u&a,v=r+d+f+m[l+3]+t[l+3],_=c+h,r=e+v<<0,e=v+_<<0;this.h0=this.h0+e<<0,this.h1=this.h1+n<<0,this.h2=this.h2+i<<0,this.h3=this.h3+s<<0,this.h4=this.h4+r<<0,this.h5=this.h5+u<<0,this.h6=this.h6+o<<0,this.h7=this.h7+a<<0}arrayBuffer(){return this.vn().buffer}dataView(){return this.vn().dataView}vn(){this.finalize();var t=new ArrayBuffer(32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),e.setUint32(28,this.h7),{dataView:e,buffer:t}}}}},i={};function s(t){var e=i[t];return void 0!==e||(e=i[t]={exports:{}},n[t].call(e.exports,e,e.exports,s)),e.exports}return s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s(638).default})());
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.Statsig=e():t.Statsig=e()}(this,()=>(()=>{"use strict";var $Q=(e)=>Object.defineProperty(e,"__esModule",{value:!0});var $Q2=(a,b,c)=>Object.defineProperty(a,b,c);var $P=(a,b)=>Object.assign(a,b);var $A=()=>((t,r,u,l)=>{return new(u=u||Promise)(function(n,e){function i(t){try{s(l.next(t))}catch(t){e(t)}}function o(t){try{s(l.throw(t))}catch(t){e(t)}}function s(t){var e;t.done?n(t.value):((e=t.value)instanceof u?e:new u(function(t){t(e)})).then(i,o)}s((l=l.apply(t,r||[])).next())})});var n={845:(t,n,e)=>{$Q2(n,"__esModule",{value:!0}),n.t=n.i=n.o=void 0,n.o=()=>__STATSIG__||o,n.i=t=>(0,n.o)()[t];n.t=t=>{var e=(0,n.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var i,s="__STATSIG__",r="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},u="undefined"!=typeof globalThis?globalThis:{};const o=null!=(i=null!=(i=null!=(i=r[s])?i:e[s])?i:u[s])?i:{instance:n.t};r[s]=o,e[s]=o,u[s]=o},137:(t,e,n)=>{$Q(e),e.u=e.l=void 0;const s=n(406);function i(t,e,n){if(n)return n(t,e);const i=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(n=null==e?void 0:e.userID)?n:""),"cids:"+Object.keys(i).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+i[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=i,e.u=function(t,e,n){return e?i(t,e,n):(0,s.h)("k:"+t)}},427:(t,e)=>{$Q(e)},694:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const l=n(512),a=n(122),r=n(578),u=n(534),c=n(401);function d(t,e,n,i){return{source:t,data:e,receivedAt:Date.now(),stableID:n,fullUserHash:(0,r.v)(i)}}e.DataAdapterCore=class{constructor(t,e){this._=t,this.m=e,this.p=null,this.S=null,this.O="statsig.last_modified_time."+e,this.j=new i}attach(t,e){this.S=t,this.p=e}getDataSync(t){var t=t&&(0,r.A)(t,this.p),e=this.T(t),n=this.j.get(e,t);return n||((n=this.I(e))?(this.j.add(e,n),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,r.A)(e,this.p),n=this.T(e);this.j.add(n,d("Bootstrap",t,null,e))}M(e,n,i){return s(this,void 0,void 0,function*(){u.Storage.isReady()||(yield u.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(n),t=[this.D(t,n,i)];return null!=i&&i.timeoutMs&&t.push(new Promise(t=>setTimeout(t,i.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}k(n,i){return s(this,void 0,void 0,function*(){var t=n&&(0,r.A)(n,this.p),e=this.T(t),t=yield this.M(null,t,i);t&&this.j.add(e,$P($P({},t),{source:"Prefetch"}))})}D(r,u,o){return s(this,void 0,void 0,function*(){let t=null;r&&this.R(r,u)&&(t=r.data);var e=yield this.N(t,u,o);if(!e)return l.Log.debug("No response returned for latest value"),null;var n=(0,c.C)(e,"has_updates","Response"),i=this.P(),i=a.StableID.get(i);let s=null;if(!0===(null==n?void 0:n.has_updates))s=d("Network",e,i,u);else{if(!t||!1!==(null==n?void 0:n.has_updates))return null;s=d("NetworkNotModified",t,i,u)}e=this.T(u);return this.j.add(e,s),this.G(e,s),s})}P(){return null!=this.S?this.S:(l.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=u.Storage.getItem)?void 0:e.call(u.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){u.Storage.setItem(t,JSON.stringify(e)),this.K(t)}K(t){var e=null!=(e=(0,u.F)(this.O))?e:{},t=(e[t]=Date.now(),o(e,10));t&&(delete e[t],u.Storage.removeItem(t)),(0,u.J)(this.O,e)}};class i{constructor(){this.V={}}get(t,e){var t=this.V[t],n=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&n&&e!==n?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var n=o(this.V,9);n&&delete this.V[n],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function o(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var n=s[t],i=s[e];return"object"==typeof n&&"object"==typeof i?i.receivedAt<n.receivedAt?e:t:i<n?e:t})}},962:(t,r)=>{$Q2(r,"__esModule",{value:!0}),r.Diagnostics=void 0;const i=new Map,n="start";function s(t,e,n,i){return $P({key:n,action:e,step:i,timestamp:Date.now()},t)}function u(t,e){var n=null!=(n=i.get(t))?n:[];n.push(e),i.set(t,n)}function e(t,e){if(e in t)return t[e]}r.Diagnostics={_n:t=>i.get(t),gn:t=>{u(t,s({},n,"overall"))},mn:(t,e,n)=>{u(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:n},"end","overall"))},bn:(t,e)=>{u(t,s(e,n,"initialize","network_request"))},pn:(t,e)=>{u(t,s(e,"end","initialize","network_request"))},yn:t=>{u(t,s({},n,"initialize","process"))},On:(t,e)=>{u(t,s(e,"end","initialize","process"))},jn:t=>{i.delete(t)},Sn(t){if(t&&"object"==typeof t)return{code:e(t,"code"),name:e(t,"name"),message:e(t,"message")}},wn(t,e,n,i){return{success:!0===(null==t?void 0:t.ok),statusCode:null==t?void 0:t.status,sdkRegion:null==(t=null==t?void 0:t.headers)?void 0:t.get("x-statsig-region"),isDelta:!0===n.includes('"is_delta":true')||void 0,attempt:e,error:r.Diagnostics.Sn(i)}},Tn(t,e,n,i){var s=r.Diagnostics._n(n);null==s||s.length<=0||(r.Diagnostics.jn(n),n=function(t,e){t={eventName:"statsig::diagnostics",user:t,value:null,metadata:e,time:Date.now()};return t}(t,{context:"initialize",markers:s.slice(),statsigOptions:i}),e.enqueue(n))}}},539:(t,e)=>{$Q(e)},542:function(t,o,e){var n=this&&this.__awaiter||$A();$Q2(o,"__esModule",{value:!0}),o.ErrorBoundary=o.EXCEPTION_ENDPOINT=void 0;const i=e(512),l=e(902),a=e(0),c=(o.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");o.ErrorBoundary=class{constructor(t,e,n){this.S=t,this.p=e,this.B=n,this.$=new Set}wrap(i){try{const t=i;!function(t){const e=new Set;let n=Object.getPrototypeOf(t);for(;n&&n!==Object.prototype;)Object.getOwnPropertyNames(n).filter(t=>"function"==typeof(null===n||void 0===n?void 0:n[t])).forEach(t=>e.add(t)),n=Object.getPrototypeOf(n);return Array.from(e)}(t).forEach(e=>{const n=t[e];"$EB"in n||(t[e]=(...t)=>this.H(e,()=>n.apply(i,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var n=t();return n&&n instanceof Promise?n.catch(t=>this.W(e,t)):n}catch(t){return this.W(e,t),null}}W(r,u){try{i.Log.warn("Caught error in "+r,{error:u});n(this,void 0,void 0,function*(){var t,e,n=u||Error(c),i=n instanceof Error,s=i?n.name:"No Name";this.$.has(s)||(this.$.add(s),null!=(t=null==(t=this.p)?void 0:t.networkConfig)&&t.preventAllNetworkTraffic?null!=(t=this.B)&&t.call(this,{name:"error",error:u}):(t=l.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),i=i?n.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(n),n=JSON.stringify($P({tag:r,exception:s,info:i},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(i=null==(s=this.p)?void 0:s.networkConfig)?void 0:i.networkOverrideFunc)?s:fetch)(o.EXCEPTION_ENDPOINT,{method:"POST",headers:{"STATSIG-API-KEY":this.S,"STATSIG-SDK-TYPE":String(t),"STATSIG-SDK-VERSION":String(e.sdkVersion),"Content-Type":"application/json"},body:n}),null!=(i=this.B)&&i.call(this,{name:"error",error:u})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},922:(t,e)=>{$Q(e)},417:(t,e)=>{$Q(e)},770:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=n(137),r=n(406),u=n(512),o=n(410),l=n(830),a=n(637),c=n(534),d=n(257),h=n(397),v={},_=t=>{null!=(t=v[t])&&t.flush().catch(()=>{})};e.EventLogger=class{constructor(t,e,n,i){this.S=t,this.B=e,this.X=n,this.p=i,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),this.st=!0===(null==i?void 0:i.disableLogging),this.rt=null!=(t=null==i?void 0:i.loggingBufferMaxSize)?t:50;e=null==i?void 0:i.networkConfig;this.ot=(0,d.ut)(null==e?void 0:e.logEventUrl,null==e?void 0:e.api,"/rgstr",o.NetworkDefault.eventsApi)}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this.ft(),this.Z.length>this.rt)&&_(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}start(){(0,l.Mt)()||(v[this.S]=this,(0,h.lt)(t=>{"background"===t&&_(this.S)}),this.ct(),this.ht())}stop(){return i(this,void 0,void 0,function*(){this._t&&(clearInterval(this._t),this._t=null),yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){var t;if(this.gt(),0!==this.Z.length)return t=this.Z,this.Z=[],this.bt(t)})}ft(){this.it||(this.it=!0,200<Date.now()-this.nt)||setTimeout(()=>_(this.S),200)}dt(t){if((0,l.Mt)())return!1;if((0,a.yt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.l)(this.S,e),n=t.metadata||{},t=[t.eventName,e,n.gate,n.config,n.ruleID].join("|"),e=this.tt[t],n=Date.now();if(e&&n-e<6e4)return!1;1e3<Object.keys(this.tt).length&&(this.tt={}),this.tt[t]=n}return!0}bt(t){var e,n;return i(this,void 0,void 0,function*(){if(this.st)this.St(t);else try{(!(0,h.Ot)()&&this.X.isBeaconSupported()&&null==(null==(n=null==(e=this.p)?void 0:e.networkConfig)?void 0:n.networkOverrideFunc)?yield this.jt(t):yield this.Tt(t)).success?this.B({name:"logs_flushed",events:t}):this.St(t)}catch(t){u.Log.warn("Failed to flush events.")}})}Tt(e){var n;return i(this,void 0,void 0,function*(){var t=yield this.X.post(this.wt(e)),t=null!=(n=null==t?void 0:t.code)?n:-1;return{success:200<=t&&t<300}})}jt(t){return i(this,void 0,void 0,function*(){return{success:yield this.X.beacon(this.wt(t))}})}wt(t){return{sdkKey:this.S,data:{events:t},url:this.ot,retries:3,isCompressable:!0,params:{[o.NetworkParam.EventCount]:String(t.length)}}}St(t){for(;500<t.length;)t.shift();var e=this.u();try{(0,c.J)(e,t)}catch(t){u.Log.warn("Unable to save failed logs to storage")}}ct(){const e=this.u();i(this,void 0,void 0,function*(){c.Storage.isReady()||(yield c.Storage.isReadyResolver());var t=(0,c.F)(e);t&&(c.Storage.removeItem(e),yield this.bt(t))}).catch(()=>{u.Log.warn("Failed to flush stored logs")})}u(){return"statsig.failed_logs."+(0,r.h)(this.S)}vt(t){t.user&&(t.user=$P({},t.user),delete t.user.privateAttributes);var e={},n=this.It(),n=(n&&(e.statsigMetadata={currentPage:n}),$P($P({},t),e));u.Log.debug("Enqueued Event:",n),this.Z.push(n)}gt(){0!==Object.keys(this.et).length&&(this.vt({eventName:"statsig::non_exposed_checks",user:null,time:Date.now(),metadata:{checks:$P({},this.et)}}),this.et={})}It(){var t;if(!1!==(null==(t=this.p)?void 0:t.includeCurrentPageUrlWithEvents))return(0,l.At)()}ht(){var t=null!=(t=null==(t=this.p)?void 0:t.loggingIntervalMs)?t:1e4;const e=setInterval(()=>{v[this.S]._t!==e?clearInterval(e):_(this.S)},t);this._t=e}}},406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.xt=r.Dt=r.h=void 0;const u=e(634);r.h=e=>{let n=0;for(let t=0;t<e.length;t++){var i=e.charCodeAt(t);n=(n<<5)-n+i,n&=n}return String(n>>>0)},r.Dt=(t,e)=>(0,r.h)(JSON.stringify((0,r.xt)(t,e)));r.xt=(n,i)=>{if(null==n)return null;var t=Object.keys(n).sort();const s={};return t.forEach(t=>{var e=n[t];0===i||"object"!==(0,u.kt)(e)?s[t]=e:s[t]=(0,r.xt)(e,null!=i?i-1:i)}),s}},333:(t,e)=>{$Q(e)},512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function n(t){return t.unshift("[Statsig]"),t}var i,s;(s=i||(e.LogLevel=i={}))[s.None=0]="None",s[s.Error=1]="Error",s[s.Warn=2]="Warn",s[s.Info=3]="Info",s[s.Debug=4]="Debug";class r{static info(...t){this.level>=i.Info&&console.info("%s"," INFO ",...n(t))}static debug(...t){this.level>=i.Debug&&console.debug("%s"," DEBUG ",...n(t))}static warn(...t){this.level>=i.Warn&&console.warn("%s"," WARN ",...n(t))}static error(...t){this.level>=i.Error&&console.error("%s"," ERROR ",...n(t))}}(e.Log=r).level=i.Warn},410:(t,e)=>{$Q(e),e.NetworkParam=e.NetworkDefault=void 0,e.NetworkDefault={eventsApi:"https://prodregistryv2.org/v1",initializeApi:"https://featureassets.org/v1",specsApi:"https://assetsconfigcdn.org/v1"},e.NetworkParam={EventCount:"ec",SdkKey:"k",SdkType:"st",SdkVersion:"sv",Time:"t",SessionID:"sid",StatsigEncoded:"se",IsGzipped:"gz"}},404:function(t,e,n){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,n(845);const u=n(845),g=n(962),b=n(512),o=n(410),l=n(902),a=n(830),c=n(143),d=n(122),h=n(0),y=n(397),m=new Set([408,500,502,503,504,522,524,599]);e.NetworkCore=class{constructor(t,e){this.B=e,this.Et=1e4,this.Rt={},this.p={},t&&(this.p=t),this.p.networkConfig&&(this.Rt=this.p.networkConfig),this.Rt.networkTimeoutMs&&(this.Et=this.Rt.networkTimeoutMs)}post(e){return r(this,void 0,void 0,function*(){let t=yield this.Nt(e);return e.isStatsigEncodable&&(t=this.Ct(e,t)),this.Pt($P({method:"POST",body:t},e))})}get(t){return this.Pt($P({method:"GET"},t))}isBeaconSupported(){return"undefined"!=typeof navigator&&"function"==typeof navigator.sendBeacon}beacon(i){return r(this,void 0,void 0,function*(){var t,e,n;return!!O(i)&&(t=yield this.Nt(i),e=yield this.Gt(i),(n=navigator).sendBeacon.bind(n)(e,t))})}Pt(_){var f,p;return r(this,void 0,void 0,function*(){if(!O(_))return null;if(this.Rt.preventAllNetworkTraffic)return null;var{method:e,body:n,retries:i,attempt:s}=_,s=null!=s?s:1;const r="undefined"!=typeof AbortController?new AbortController:null;var t=setTimeout(()=>null===r||void 0===r?void 0:r.abort(`Timeout of ${this.Et}ms expired.`),this.Et),u=yield this.Gt(_);let o=null;var l=(0,y.Ut)();try{var a,c,d,h={method:e,body:n,headers:$P({},_.headers),signal:null===r||void 0===r?void 0:r.signal,priority:_.priority,keepalive:l},v=(_.isInitialize&&g.Diagnostics.bn(_.sdkKey,{attempt:s}),null!=(f=this.Rt.networkOverrideFunc)?f:fetch);if(o=yield v(u,h),clearTimeout(t),o.ok)return d=yield o.text(),_.isInitialize&&g.Diagnostics.pn(_.sdkKey,g.Diagnostics.wn(o,s,d)),{body:d,code:o.status};throw a=yield o.text().catch(()=>"No Text"),(c=new Error(`NetworkError: ${u} `+a)).name="NetworkError",c}catch(t){n=function(t,e){if(null!=t&&t.signal.aborted&&"string"==typeof t.signal.reason)return t.signal.reason;if("string"==typeof e)return e;if(e instanceof Error)return e.name+": "+e.message;return"Unknown Error"}(r,t);return _.isInitialize&&g.Diagnostics.pn(_.sdkKey,g.Diagnostics.wn(o,s,"",t)),!i||i<s||!m.has(null!=(p=null===o||void 0===o?void 0:o.status)?p:500)?(null!=(p=this.B)&&p.call(this,{name:"error",error:t}),b.Log.error(`A networking error occured during ${e} request to ${u}.`,n,t),null):this.Pt($P($P({},_),{retries:i,attempt:s+1}))}})}Gt(n){return r(this,void 0,void 0,function*(){const e=$P({[o.NetworkParam.SdkKey]:n.sdkKey,[o.NetworkParam.SdkType]:l.SDKType.Y(n.sdkKey),[o.NetworkParam.SdkVersion]:h.SDK_VERSION,[o.NetworkParam.Time]:String(Date.now()),[o.NetworkParam.SessionID]:yield c.SessionID.get(n.sdkKey)},n.params);var t=Object.keys(e).map(t=>encodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return n.url+(t?"?"+t:"")})}Nt(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,n=d.StableID.get(e),i=c.SessionID.get(e),e=l.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},h.StatsigMetadataProvider.get()),{stableID:n,sessionID:i,sdkType:e})}))})}Ct(t,e){var n,i,s=(0,a.Lt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,u.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(n=s.btoa(e).split("").reverse().join(""))?n:e;return t.params=$P($P({},null!=(i=t.params)?i:{}),{[o.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return b.Log.warn("/initialize request encoding failed"),e}}};const O=t=>!!t.sdkKey||(b.Log.warn("Unable to make request without an SDK key"),!1)},405:(t,e)=>{$Q(e)},361:(t,e)=>{$Q(e)},902:(t,e)=>{$Q(e),e.SDKType=void 0;const n={};let i;e.SDKType={Y:t=>{return(null!=(t=n[t])?t:"js-mono")+(null!==i&&void 0!==i?i:"")},Kt(t,e){n[t]=e},Ft(t){i&&"-react"!==i||(i="-"+t)}}},830:(t,i)=>{$Q2(i,"__esModule",{value:!0}),i.At=i.qt=i.zt=i.Mt=i.Jt=i.Lt=void 0;i.Lt=()=>"undefined"!=typeof window?window:null,i.Jt=()=>{var t=(0,i.Lt)();return null!=(t=null==t?void 0:t.document)?t:null},i.Mt=()=>{var t;return null===(0,i.Jt)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},i.zt=(t,e)=>{var n=(0,i.Lt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)},i.qt=(t,e)=>{var n=(0,i.Jt)();"function"==typeof(null==n?void 0:n.addEventListener)&&n.addEventListener(t,e)};i.At=()=>{var t;try{return null==(t=(0,i.Lt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},143:(t,e,n)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const i=n(137),r=n(512),u=n(534),o=n(23),l=18e5,a=144e5,c={};function d(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function h(t){return"statsig.session_id."+(0,i.u)(t)}e.SessionID={get:t=>e.StatsigSession.get(t).data.sessionID},e.StatsigSession={get:t=>{null==c[t]&&(c[t]=function(t){let e=function(t){t=h(t);return(0,u.F)(t)}(t);var n=Date.now();e=e||{sessionID:(0,o.getUUID)(),startTime:n,lastUpdate:n};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),n=t.data,i=((function({lastUpdate:t}){return Date.now()-t>l}(n)||function({startTime:t}){return Date.now()-t>a}(n))&&(n.sessionID=(0,o.getUUID)(),n.startTime=e),n.lastUpdate=e,n),s=t.sdkKey;s=h(s);try{(0,u.J)(s,i)}catch(t){r.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=n.startTime,n=t.sdkKey,t.idleTimeoutID=d(n,l),t.ageTimeoutID=d(n,a-e),t},overrideInitialSessionID:(t,e)=>{var n;c[e]=(t=t,e=e,n=Date.now(),{data:{sessionID:t,startTime:n,lastUpdate:n},sdkKey:e})}}},122:(t,e,n)=>{$Q(e),e.StableID=void 0;const i=n(137),s=n(512),r=n(534),u=n(23),o={};function l(t){return"statsig.stable_id."+(0,i.u)(t)}function a(t,e){e=l(e);try{(0,r.J)(e,t)}catch(t){s.Log.warn("Failed to save StableID")}}e.StableID={get:e=>{if(null==o[e]){let t=function(t){t=l(t);return(0,r.F)(t)}(e);null==t&&a(t=(0,u.getUUID)(),e),o[e]=t}return o[e]},setOverride:(t,e)=>{a(o[e]=t,e)}}},375:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,n(845);const u=n(845),o=n(542),l=n(770),a=n(512),c=n(830),d=n(143),h=n(534);e.StatsigClientBase=class{constructor(t,e,n,i){this.loadingStatus="Uninitialized",this.Vt={};var s,r=this.$emt.bind(this);null!=(null==i?void 0:i.logLevel)&&(a.Log.level=i.logLevel),null!=i&&i.disableStorage&&h.Storage.Bt(!0),null!=i&&i.initialSessionID&&d.StatsigSession.overrideInitialSessionID(i.initialSessionID,t),null!=i&&i.storageProvider&&h.Storage.de(i.storageProvider),this.S=t,this.p=null!=i?i:{},this.overrideAdapter=null!=(s=null==i?void 0:i.overrideAdapter)?s:null,this.Ht=new l.EventLogger(t,r,n,i),this.Wt=new o.ErrorBoundary(t,i,r),this.Wt.wrap(this),this.Wt.wrap(n),this.Wt.wrap(e),this.Wt.wrap(this.Ht),(0,c.Mt)()||(null!=(n=null!=(r=(s=(0,u.o)()).instances)?r:{})[t]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),n[t]=this,s.lastInstance=this,s.instances=n,__STATSIG__=s),this.dataAdapter=e,this.dataAdapter.attach(t,i),this.storageProvider=h.Storage,this.Yt()}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Ht.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,h.Storage.Bt(t.disableStorage))}flush(){return this.Ht.flush()}shutdown(){return i(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),yield this.Ht.stop()})}on(t,e){this.Vt[t]||(this.Vt[t]=[]),this.Vt[t].push(e)}off(t,e){this.Vt[t]&&-1!==(e=this.Vt[t].indexOf(e))&&this.Vt[t].splice(e,1)}$on(t,e){e.__isInternal=!0,this.on(t,e)}$emt(n){var t;const e=e=>{try{e(n)}catch(t){!0===e.__isInternal?this.Wt.logError("__emit:"+n.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",n)}};this.Vt[n.name]&&this.Vt[n.name].forEach(t=>e(t)),null!=(t=this.Vt["*"])&&t.forEach(e)}Qt(t,e){this.loadingStatus=t,this.$emt({name:"values_updated",status:t,values:e})}Xt(t,e,n){!0===(null==n?void 0:n.disableExposureLog)?this.Ht.incrementNonExposureCount(t):this.Ht.enqueue(e)}}},636:(t,e)=>{$Q(e)},206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},637:(t,e)=>{$Q(e),e.Zt=e.te=e.ee=e.yt=void 0;const n="statsig::config_exposure",i="statsig::gate_exposure",l=(t,e,n,i,s)=>({eventName:t,user:e,value:null,metadata:r(n,i),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===i||t===n,e.ee=(t,e)=>{return l(i,t,e.details,{gate:e.name,gateValue:String(e.value),ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])},e.te=(t,e)=>{return l(n,t,e.details,{config:e.name,ruleID:e.ruleID},null!=(e=null==(t=e.__evaluation)?void 0:t.secondary_exposures)?e:[])};e.Zt=(t,e,n)=>{var i,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(n));let u="",o=null!=(i=null==s?void 0:s.undelegated_secondary_exposures)?i:[];return r&&(u=null!=(i=s.allocated_experiment_name)?i:"",o=s.secondary_exposures),l("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:n,ruleID:e.ruleID,allocatedExperiment:u,isExplicitParameter:String(r)},o)};const r=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},0:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.0.0";let n={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>n,add:t=>{n=$P($P({},n),t)}}},586:(t,e)=>{$Q(e)},59:(t,e,n)=>{$Q(e),e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const r=n(634),s="default";function u(t,e,n,i){return{name:t,details:e,ruleID:null!=(t=null==n?void 0:n.rule_id)?t:s,__evaluation:n,value:i}}function i(t,e,n){var i=null!=(i=null==n?void 0:n.value)?i:{};return $P($P({},u(t,e,n,i)),{get:o(null==n?void 0:n.value)})}function o(i,s){return(t,e)=>{var n=null!=(n=null==i?void 0:i[t])?n:null;return null!=n&&(null==e||(0,r.le)(n,e))?(null!=s&&s(t),n):null!=e?e:null}}e.ue=function(t,e,n){return u(t,e,n,!0===(null==n?void 0:n.value))},e.oe=i,e.re=function(t,e,n){return t=i(t,e,n),$P($P({},t),{groupName:null!=(e=null==n?void 0:n.group_name)?e:null})},e.se=function(t,e,n,i){return $P($P({},u(t,e,n,void 0)),{get:o(null==n?void 0:n.value,i),groupName:null!=(t=null==n?void 0:n.group_name)?t:null,__value:null!=(e=null==n?void 0:n.value)?e:{}})},e.ne=function(t,e,n,i){return $P($P($P({},t),e),{get:o(n,i)})},e.ie=o},812:(t,e)=>{$Q(e)},578:(t,e,n)=>{$Q(e),e.v=e.A=void 0;const i=n(406),s=n(512);e.A=function(t,e){try{var n=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment&&(n.statsigEnvironment=e.environment),n}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,i.Dt)(t):null}},534:(t,n,e)=>{$Q2(n,"__esModule",{value:!0}),n.J=n.F=n.Storage=void 0;var i=e(512),e=e(830);const s={},r={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"InMemory",getItem:t=>s[t]||null,setItem:(t,e)=>{s[t]=e},removeItem:t=>{delete s[t]},getAllKeys:()=>Object.keys(s)};let u=null;try{const a=(0,e.Lt)();a&&a.localStorage&&"function"==typeof a.localStorage.getItem&&(u={isReady:()=>!0,isReadyResolver:()=>null,getProviderName:()=>"LocalStorage",getItem:t=>a.localStorage.getItem(t),setItem:(t,e)=>a.localStorage.setItem(t,e),removeItem:t=>a.localStorage.removeItem(t),getAllKeys:()=>Object.keys(a.localStorage)})}catch(t){i.Log.warn("Failed to setup localStorageProvider.")}let o=null!==u&&void 0!==u?u:r,l=o;n.Storage={isReady:()=>l.isReady(),isReadyResolver:()=>l.isReadyResolver(),getProviderName:()=>l.getProviderName(),getItem:t=>{var e=()=>l.getItem(t);try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return n.Storage.de(r),null;throw t}},setItem:(t,e)=>l.setItem(t,e),removeItem:t=>l.removeItem(t),getAllKeys:()=>l.getAllKeys(),de:t=>{o=t,l=t},Bt:t=>{l=t?r:o}},n.F=function(t){return t=n.Storage.getItem(t),JSON.parse(null!=t?t:"null")},n.J=function(t,e){n.Storage.setItem(t,JSON.stringify(e))}},401:(t,e,n)=>{$Q(e),e.C=void 0;const s=n(512);e.C=function(t,e,n){try{var i=JSON.parse(t);return"object"==typeof i&&0 in i,i}catch(t){}return s.Log.error("Failed to parse "+n),null}},634:(t,e)=>{$Q(e),e.le=e.kt=void 0,e.kt=function(t){return Array.isArray(t)?"array":typeof t},e.le=function(t,e){var n=t=>Array.isArray(t)?"array":typeof t;return n(t)===n(e)}},23:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let n=(new Date).getTime(),i="undefined"!=typeof performance&&performance.now&&1e3*performance.now()||0;return`xxxxxxxx-xxxx-4xxx-${"89ab"[Math.floor(4*Math.random())]}xxx-xxxxxxxxxxxx`.replace(/[xy]/g,t=>{let e=16*Math.random();return 0<n?(e=(n+e)%16|0,n=Math.floor(n/16)):(e=(i+e)%16|0,i=Math.floor(i/16)),("x"===t?e:7&e|8).toString(16)})}},257:(t,e)=>{$Q(e),e.ut=void 0,e.ut=function(t,e,n,i){return t||(e?""+e+n:""+i+n)}},397:(t,e,n)=>{$Q(e),e.ve=e.lt=e.Ut=e.Ot=void 0;n=n(830);const i="foreground",s="background",r=[];let u=i,o=!1;e.Ot=()=>u===i,e.Ut=()=>o,e.lt=t=>{r.unshift(t)};e.ve=e=>{e!==u&&(u=e,r.forEach(t=>t(e)))},(0,n.zt)("focus",()=>{(o=!1,e.ve)(i)}),(0,n.zt)("blur",()=>(0,e.ve)(s)),(0,n.zt)("beforeunload",()=>{o=!0,(0,e.ve)(s)}),(0,n.qt)("visibilitychange",()=>{(0,e.ve)("visible"===document.visibilityState?i:s)})},914:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,s)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),s=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,n(845);const r=n(962),u=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return r.Diagnostics}}),n(770)),o=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return u.EventLogger}}),n(512));$Q2(e,"Log",{enumerable:!0,get:function(){return o.Log}});var l=n(0);const a=n(534);$Q2(e,"Storage",{enumerable:!0,get:function(){return a.Storage}}),s(n(845),e),s(n(137),e),s(n(427),e),s(n(694),e),s(n(962),e),s(n(539),e),s(n(542),e),s(n(922),e),s(n(417),e),s(n(406),e),s(n(333),e),s(n(512),e),s(n(404),e),s(n(410),e),s(n(405),e),s(n(361),e),s(n(830),e),s(n(902),e),s(n(143),e),s(n(122),e),s(n(375),e),s(n(636),e),s(n(206),e),s(n(637),e),s(n(0),e),s(n(586),e),s(n(59),e),s(n(812),e),s(n(578),e),s(n(534),e),s(n(401),e),s(n(634),e),s(n(257),e),s(n(23),e),s(n(397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:o.Log,SDK_VERSION:l.SDK_VERSION})},638:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var s=Object.getOwnPropertyDescriptor(e,n);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[n]}}),$Q2(t,i,s)}:function(t,e,n,i){t[i=void 0===i?n:i]=e[n]}),s=this&&this.__exportStar||function(t,e){for(var n in t)"default"===n||Object.prototype.hasOwnProperty.call(e,n)||i(e,t,n)};$Q(e),s(n(600),e),e.default=__STATSIG__},977:(t,e)=>{function o(t){return t.setUTCHours(0,0,0,0),t.getTime()}$Q(e),e.default={compareNumbers(t,e,n){if(null==t||null==e)return!1;var i=Number(t),s=Number(e);if(isNaN(i)||isNaN(s))return!1;switch(n){case"gt":return e<t;case"gte":return e<=t;case"lt":return t<e;case"lte":return t<=e;default:return!1}},compareVersions(t,e,n){if(null==t||null==e)return!1;var t=String(t),e=String(e),i=t=>{var e=t.indexOf("-");return-1!==e?t.substring(0,e):t},s=((t,e)=>{var n=t.split(".").map(t=>parseInt(t)),i=e.split(".").map(t=>parseInt(t));let s=0;for(;s<Math.max(n.length,i.length);){var r=s<n.length?n[s]:0,u=s<i.length?i[s]:0;if(r<u)return-1;if(u<r)return 1;s++}return 0})(i(t),i(e));switch(n){case"version_gt":return 0<s;case"version_gte":return 0<=s;case"version_lt":return s<0;case"version_lte":return s<=0;case"version_eq":return 0===s;case"version_neq":return 0!==s;default:return!1}},compareStringInArray(s,t,r){if(!Array.isArray(t))return!1;const u="any_case_sensitive"!==r&&"none_case_sensitive"!==r;var e=-1!==t.findIndex(t=>{var e=String(s),t=String(t),n=u?e.toLowerCase():e,i=u?t.toLowerCase():t;switch(r){case"any":case"none":case"any_case_sensitive":case"none_case_sensitive":return n===i;case"str_starts_with_any":return n.startsWith(i);case"str_ends_with_any":return n.endsWith(i);case"str_contains_any":case"str_contains_none":return n.includes(i);default:return!1}});switch(r){case"none":case"none_case_sensitive":case"str_contains_none":return!e;default:return e}},compareStringWithRegEx(t,e){try{var n=String(t);if(n.length<1e3)return new RegExp(String(e)).test(n)}catch(t){}return!1},compareTime(n,i,s){if(null==n||null==i)return!1;try{let t=new Date(String(n)),e=(isNaN(t.getTime())&&(t=new Date(Number(n))),new Date(String(i)));isNaN(e.getTime())&&(e=new Date(Number(i)));var r=t.getTime(),u=e.getTime();if(isNaN(r)||isNaN(u))return!1;switch(s){case"before":return r<u;case"after":return u<r;case"on":return o(t)===o(e);default:return!1}}catch(t){return!1}}}},577:(t,e)=>{$Q(e),e.resultToLayerEval=e.resultToConfigEval=e.resultToGateEval=e.makeEvalResult=void 0,e.makeEvalResult=function(t){return $P($P({},{unsupported:!1,bool_value:!1,rule_id:"",secondary_exposures:[],json_value:{},explicit_parameters:null,allocated_experiment_name:null,is_experiment_group:!1,group_name:null,undelegated_secondary_exposures:void 0}),t)},e.resultToGateEval=function(t,e){return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.bool_value,secondary_exposures:e.secondary_exposures}},e.resultToConfigEval=function(t,e){var n;return{name:t.name,id_type:t.idType,rule_id:e.rule_id,value:e.json_value,secondary_exposures:e.secondary_exposures,group:null!=(n=e.group_name)?n:"",group_name:null!=(n=e.group_name)?n:void 0,is_device_based:!1,is_experiment_active:t.isActive,is_user_in_experiment:e.is_experiment_group}},e.resultToLayerEval=function(t,e,n){return{name:t.name,rule_id:n.rule_id,value:n.json_value,secondary_exposures:n.secondary_exposures,undelegated_secondary_exposures:n.undelegated_secondary_exposures,allocated_experiment_name:null!=(t=n.allocated_experiment_name)?t:"",explicit_parameters:null!=(t=n.explicit_parameters)?t:[],group:null!=(t=n.group_name)?t:"",group_name:null!=(t=n.group_name)?t:void 0,is_device_based:!1,is_experiment_active:null==e?void 0:e.isActive,is_user_in_experiment:n.is_experiment_group}}},485:(t,e,n)=>{$Q(e);const i=n(680),c=n(977),d=n(577);function h(t,e){var n;return"string"==typeof e&&"userid"!==e.toLowerCase()?null!=(n=null==(n=t.customIDs)?void 0:n[e])?n:null==(n=null==t?void 0:t.customIDs)?void 0:n[e.toLowerCase()]:t.userID}function v(t){return(0,i.SHA256)(t).dataView().getBigUint64(0,!1)}function o(t){return null!=t&&"object"==typeof t}e.default=class{constructor(t){this.we=t}evaluateGate(t,e){var{spec:t,details:n}=this.tn("gate",t);return t?{evaluation:(0,d.resultToGateEval)(t,this.en(t,e)),details:n}:{evaluation:null,details:n}}evaluateConfig(t,e){var{spec:t,details:n}=this.tn("config",t);return t?{evaluation:(0,d.resultToConfigEval)(t,this.en(t,e)),details:n}:{evaluation:null,details:n}}evaluateLayer(t,e){var n,{spec:t,details:i}=this.tn("layer",t);return t?(n=null!=(n=null==(e=this.en(t,e))?void 0:e.allocated_experiment_name)?n:"",n=this.we.getSpecAndSourceInfo("config",n).spec,{evaluation:(0,d.resultToLayerEval)(t,n,e),details:i}):{evaluation:null,details:i}}tn(t,e){t=this.we.getSpecAndSourceInfo(t,e);return{details:this.nn(t),spec:t.spec}}nn(t){var{source:t,spec:e,lcut:n,receivedAt:i}=t;return"Uninitialized"===t||"NoValues"===t?{reason:t}:{reason:t+":"+(null==e?"Unrecognized":"Recognized"),lcut:n,receivedAt:i}}en(t,e){var n=o(t.defaultValue)?t.defaultValue:void 0;if(!t.enabled)return(0,d.makeEvalResult)({json_value:n,rule_id:"disabled"});var i=[];for(const u of t.rules){var s,r=this.rn(u,e);if(r.unsupported)return r;if(i.push(...r.secondary_exposures),r.bool_value)return this.sn(u.configDelegate,e,i)||(s=function(t,e,n){if(100===t.passPercentage)return!0;if(0===t.passPercentage)return!1;e=v(n.salt+"."+(null!=(n=t.salt)?n:t.id)+"."+(null!=(n=h(e,t.idType))?n:""));return Number(e%BigInt(1e4))<100*t.passPercentage}(u,e,t),(0,d.makeEvalResult)({rule_id:r.rule_id,bool_value:s,json_value:s?r.json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,is_experiment_group:r.is_experiment_group,group_name:r.group_name}))}return(0,d.makeEvalResult)({json_value:n,secondary_exposures:i,undelegated_secondary_exposures:i,rule_id:"default"})}rn(t,e){var n=[];let i=!0;for(const r of t.conditions){var s=this.un(r,e);if(s.unsupported)return s;n.push(...s.secondary_exposures),s.bool_value||(i=!1)}return(0,d.makeEvalResult)({rule_id:t.id,bool_value:i,json_value:o(t.returnValue)?t.returnValue:void 0,secondary_exposures:n,is_experiment_group:!0===t.isExperimentGroup,group_name:t.groupName})}un(t,e){let n=null,i=!1;var s=t.field,r=t.targetValue,u=t.idType,o=t.type;switch(o){case"public":return(0,d.makeEvalResult)({bool_value:!0});case"pass_gate":case"fail_gate":var l=String(r),l=this.ln(l,e);return(0,d.makeEvalResult)({bool_value:"fail_gate"===o?!l.bool_value:l.bool_value,secondary_exposures:l.secondary_exposures});case"multi_pass_gate":case"multi_fail_gate":return this.an(r,o,e);case"user_field":case"ip_based":case"ua_based":n=function(t,e){var n;if(null==e||"object"!=typeof t||null==t)return null;var i=t;return null!=(n=null!=(n=null!=(n=null!=(n=null!=(n=i[e])?n:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e])?n:null==(i=null==t?void 0:t.custom)?void 0:i[e.toLowerCase()])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e])?n:null==(i=null==t?void 0:t.privateAttributes)?void 0:i[e.toLowerCase()]}(e,s);break;case"environment_field":n=function(t,e){if(null==e)return null;t=t.statsigEnvironment;if(null!=t){const n=e.toLowerCase(),i=Object.keys(t).find(t=>t.toLowerCase()===n);return void 0!==i?t[i]:void 0}}(e,s);break;case"current_time":n=Date.now();break;case"user_bucket":l=v(null!==(l=String(null!=(l=null==(l=t.additionalValues)?void 0:l.salt)?l:"")+"."+h(e,u))?l:"");n=Number(l%BigInt(1e3));break;case"unit_id":n=h(e,u);break;default:return(0,d.makeEvalResult)({unsupported:!0})}var a=t.operator;switch(a){case"gt":case"gte":case"lt":case"lte":i=c.default.compareNumbers(n,r,a);break;case"version_gt":case"version_gte":case"version_lt":case"version_lte":case"version_eq":case"version_neq":i=c.default.compareVersions(n,r,a);break;case"any":case"none":case"str_starts_with_any":case"str_ends_with_any":case"str_contains_any":case"str_contains_none":case"any_case_sensitive":case"none_case_sensitive":i=c.default.compareStringInArray(n,r,a);break;case"str_matches":i=c.default.compareStringWithRegEx(n,r);break;case"before":case"after":case"on":i=c.default.compareTime(n,r,a);break;case"eq":i=n==r;break;case"neq":i=n!=r;break;case"in_segment_list":case"not_in_segment_list":return(0,d.makeEvalResult)({unsupported:!0})}return(0,d.makeEvalResult)({bool_value:i})}sn(t,e,n){var i;return t&&(i=this.we.getSpecAndSourceInfo("config",t).spec,i)?(e=this.en(i,e),(0,d.makeEvalResult)($P($P({},e),{allocated_experiment_name:t,explicit_parameters:i.explicitParameters,secondary_exposures:n.concat(e.secondary_exposures),undelegated_secondary_exposures:n}))):null}ln(t,e){var n=[];let i=!1;var s=this.we.getSpecAndSourceInfo("gate",t)["spec"];if(s){s=this.en(s,e);if(s.unsupported)return s;i=s.bool_value,n.push(...s.secondary_exposures),n.push({gate:t,gateValue:String(i),ruleID:s.rule_id})}return(0,d.makeEvalResult)({bool_value:i,secondary_exposures:n})}an(t,e,n){if(!Array.isArray(t))return(0,d.makeEvalResult)({unsupported:!0});var i="multi_pass_gate"===e,s=[];let r=!1;for(const o of t){if("string"!=typeof o)return(0,d.makeEvalResult)({unsupported:!0});var u=this.ln(o,n);if(u.unsupported)return u;if(s.push(...u.secondary_exposures),i?!0===u.bool_value:!1===u.bool_value){r=!0;break}}return(0,d.makeEvalResult)({bool_value:r,secondary_exposures:s})}}},494:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e);const i=n(914);class r extends i.NetworkCore{constructor(t=null){super(t);t=null==t?void 0:t.networkConfig;this.cn=(0,i.ut)(null==t?void 0:t.downloadConfigSpecsUrl,null==t?void 0:t.api,"/download_config_specs",i.NetworkDefault.specsApi)}fetchConfigSpecs(e,n){var i;return s(this,void 0,void 0,function*(){var t=yield this.get({sdkKey:e,url:this.cn,priority:n});return null!=(i=null==t?void 0:t.body)?i:null})}}e.default=r},932:(t,e,n)=>{$Q(e);const i=n(914);function s(t){return(0,i.C)(t,"has_updates","DownloadConfigSpecsResponse")}e.default=class{constructor(){this._e=null,this.ge=null,this.be="Uninitialized",this.ye=0,this.me=0}getValues(){return this._e?s(this._e):null}setValuesFromDataAdapter(t){var e;t&&!0===(null==(e=s(t.data))?void 0:e.has_updates)&&(this.ye=e.time,this.me=t.receivedAt,this.be=t.source,this.ge=e,this._e=t.data)}reset(){this.ge=null,this._e=null,this.be="Loading"}finalize(){this.ge||(this.be="NoValues")}getSpecAndSourceInfo(t,e){var t=this.dn(t);return{spec:null!=(t=null==t?void 0:t.find(t=>t.name===e))?t:null,source:this.be,lcut:this.ye,receivedAt:this.me}}dn(t){var e;switch(t){case"gate":return null==(e=this.ge)?void 0:e.feature_gates;case"config":return null==(e=this.ge)?void 0:e.dynamic_configs;case"layer":return null==(e=this.ge)?void 0:e.layer_configs}}}},217:function(t,e,n){var i=this&&this.__awaiter||$A();$Q(e);const u=n(914),s=n(485),r=n(494),o=n(932),l=n(660);class a extends u.StatsigClientBase{static instance(t){var e=(0,u.o)().instance(t);return e instanceof a?e:(u.Log.warn((0,u.Mt)()?"StatsigOnDeviceEvalClient.instance is not supported in server environments":"Unable to find StatsigOnDeviceEvalClient instance"),new a(null!=t?t:""))}constructor(t,e=null){u.SDKType.Kt(t,"js-on-device-eval-client");var n=new r.default(e);super(t,null!=(t=null==e?void 0:e.dataAdapter)?t:new l.StatsigSpecsDataAdapter,n,e),this.we=new o.default,this.hn=new s.default(this.we)}initializeSync(t){this.Ht.start(),this.updateSync(t)}initializeAsync(t){return i(this,void 0,void 0,function*(){return u.Storage.isReady()||(yield u.Storage.isReadyResolver()),this.Ht.start(),this.updateAsync(t)})}updateSync(t){this.we.reset();var e=this.dataAdapter.getDataSync();this.we.setValuesFromDataAdapter(e),this.we.finalize(),this.Qt("Ready",e),null!=t&&t.disableBackgroundCacheRefresh||this.xe(e)}updateAsync(e){return i(this,void 0,void 0,function*(){this.we.reset(),this.Qt("Loading",null);var t=this.dataAdapter.getDataSync();this.we.setValuesFromDataAdapter(t),t=yield this.dataAdapter.getDataAsync(t,e),this.we.setValuesFromDataAdapter(t),this.we.finalize(),this.Qt("Ready",t)})}getContext(){return{sdkKey:this.S,options:this.p,values:this.we.getValues(),errorBoundary:this.Wt,session:u.StatsigSession.get(this.S),stableID:u.StableID.get(this.S)}}checkGate(t,e,n){return this.getFeatureGate(t,e,n).value}getFeatureGate(t,e,n){var e=(0,u.A)(e,this.p),{evaluation:i,details:s}=this.hn.evaluateGate(t,e),s=(0,u.ue)(t,s,i);return this.Xt(t,(0,u.ee)(e,s),n),this.$emt({name:"gate_evaluation",gate:s}),s}getDynamicConfig(t,e,n){var e=(0,u.A)(e,this.p),{evaluation:i,details:s}=this.hn.evaluateConfig(t,e),s=(0,u.oe)(t,s,i),r=null==(r=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:r.call(i,s,e,n),i=null!=r?r:s;return this.Xt(t,(0,u.te)(e,i),n),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e,n){var e=(0,u.A)(e,this.p),{evaluation:i,details:s}=this.hn.evaluateConfig(t,e),s=(0,u.re)(t,s,i),r=null==(r=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:r.call(i,s,e,n),i=null!=r?r:s;return this.Xt(t,(0,u.te)(e,i),n),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,t,n){const i=(0,u.A)(t,this.p);var{evaluation:t,details:s}=this.hn.evaluateLayer(e,i);const r=(0,u.se)(e,s,t,t=>{this.Xt(e,(0,u.Zt)(i,r,t),n)});return this.$emt({name:"layer_evaluation",layer:r}),r}logEvent(t,e,n,i){this.Ht.enqueue($P($P({},"string"==typeof t?{eventName:t,value:n,metadata:i}:t),{user:(0,u.A)(e,this.p),time:Date.now()}))}Yt(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Me(null)})}Me(t){this.we.finalize(),this.Qt("Ready",t)}xe(t){this.dataAdapter.getDataAsync(t,{priority:"low"}).catch(t=>{u.Log.error("An error occurred after update.",t)})}}e.default=a},660:function(t,e,n){var s=this&&this.__awaiter||$A();$Q(e),e.StatsigSpecsDataAdapter=void 0;const i=n(914),r=n(494);class u extends i.DataAdapterCore{constructor(){super("SpecsDataAdapter","specs"),this.X=null}attach(t,e){super.attach(t,e),this.X=new r.default(null!=e?e:{})}getDataAsync(t,e){return this.M(t,void 0,e)}prefetchData(t){return this.k(void 0,t)}N(t,e,n){var i;return s(this,void 0,void 0,function*(){return null!=(i=yield null==(i=this.X)?void 0:i.fetchConfigSpecs(this.P(),null==n?void 0:n.priority))?i:null})}T(){var t=(0,i.u)(this.P());return`${i.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return 0<t.data.length}}e.StatsigSpecsDataAdapter=u},600:(t,e,n)=>{$Q(e),e.StatsigSpecsDataAdapter=e.StatsigOnDeviceEvalClient=void 0;var i=n(217);e.StatsigOnDeviceEvalClient=i.default;const s=n(660);$Q2(e,"StatsigSpecsDataAdapter",{enumerable:!0,get:function(){return s.StatsigSpecsDataAdapter}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigSpecsDataAdapter:s.StatsigSpecsDataAdapter,StatsigOnDeviceEvalClient:i.default}),e.default=__STATSIG__},680:(t,e,n)=>{$Q(e),e.SHA256=void 0;const i=n(866);$Q2(e,"SHA256",{enumerable:!0,get:function(){return i.SHA256}})},866:(t,e)=>{$Q(e),e.SHA256=void 0,e.SHA256=function(t){return(new i).update(t)};const n=[-2147483648,8388608,32768,128],u=[24,16,8,0],m=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];class i{constructor(){this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225,this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.lastByteIndex=-1}update(n){if(!this.finalized){if("string"!=typeof n)throw new Error('Must be of type "string"');var i;let t=0,e;for(var s=n.length,r=this.blocks;t<s;){for(this.hashed&&(this.hashed=!1,r[0]=this.block,r[16]=r[1]=r[2]=r[3]=r[4]=r[5]=r[6]=r[7]=r[8]=r[9]=r[10]=r[11]=r[12]=r[13]=r[14]=r[15]=0),e=this.start;t<s&&e<64;++t)(i=n.charCodeAt(t))<128?r[e>>2]|=i<<u[3&e++]:(i<2048?r[e>>2]|=(192|i>>6)<<u[3&e++]:(i<55296||57344<=i?r[e>>2]|=(224|i>>12)<<u[3&e++]:(i=65536+((1023&i)<<10|1023&n.charCodeAt(++t)),r[e>>2]|=(240|i>>18)<<u[3&e++],r[e>>2]|=(128|i>>12&63)<<u[3&e++]),r[e>>2]|=(128|i>>6&63)<<u[3&e++]),r[e>>2]|=(128|63&i)<<u[3&e++]);this.lastByteIndex=e,this.bytes+=e-this.start,64<=e?(this.block=r[16],this.start=e-64,this.hash(),this.hashed=!0):this.start=e}4294967295<this.bytes&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296)}return this}finalize(){var t,e;this.finalized||(this.finalized=!0,t=this.blocks,e=this.lastByteIndex,t[16]=this.block,t[e>>2]|=n[3&e],this.block=t[16],56<=e&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash())}hash(){var t=this.blocks;let e=this.h0,n=this.h1,i=this.h2,s=this.h3,r=this.h4,u=this.h5,o=this.h6,l=this.h7,a,c,d,h,v,_,f,p,g,b,y;for(a=16;a<64;++a)v=t[a-15],c=(v>>>7|v<<25)^(v>>>18|v<<14)^v>>>3,v=t[a-2],d=(v>>>17|v<<15)^(v>>>19|v<<13)^v>>>10,t[a]=t[a-16]+c+t[a-7]+d<<0;for(y=n&i,a=0;a<64;a+=4)this.first?(p=704751109,v=t[0]-210244248,l=v-1521486534<<0,s=v+143694565<<0,this.first=!1):(c=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),d=(r>>>6|r<<26)^(r>>>11|r<<21)^(r>>>25|r<<7),p=e&n,h=p^e&i^y,f=r&u^~r&o,v=l+d+f+m[a]+t[a],_=c+h,l=s+v<<0,s=v+_<<0),c=(s>>>2|s<<30)^(s>>>13|s<<19)^(s>>>22|s<<10),d=(l>>>6|l<<26)^(l>>>11|l<<21)^(l>>>25|l<<7),g=s&e,h=g^s&n^p,f=l&r^~l&u,v=o+d+f+m[a+1]+t[a+1],_=c+h,o=i+v<<0,i=v+_<<0,c=(i>>>2|i<<30)^(i>>>13|i<<19)^(i>>>22|i<<10),d=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),b=i&s,h=b^i&e^g,f=o&l^~o&r,v=u+d+f+m[a+2]+t[a+2],_=c+h,u=n+v<<0,n=v+_<<0,c=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),d=(u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7),y=n&i,h=y^n&s^b,f=u&o^~u&l,v=r+d+f+m[a+3]+t[a+3],_=c+h,r=e+v<<0,e=v+_<<0;this.h0=this.h0+e<<0,this.h1=this.h1+n<<0,this.h2=this.h2+i<<0,this.h3=this.h3+s<<0,this.h4=this.h4+r<<0,this.h5=this.h5+u<<0,this.h6=this.h6+o<<0,this.h7=this.h7+l<<0}arrayBuffer(){return this.vn().buffer}dataView(){return this.vn().dataView}vn(){this.finalize();var t=new ArrayBuffer(32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),e.setUint32(28,this.h7),{dataView:e,buffer:t}}}}},i={};function s(t){var e=i[t];return void 0!==e||(e=i[t]={exports:{}},n[t].call(e.exports,e,e.exports,s)),e.exports}return s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),s(638).default})());
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "@statsig/js-on-device-eval-client",
3
- "version": "3.0.0-beta.5",
3
+ "version": "3.0.0",
4
4
  "dependencies": {
5
- "@statsig/client-core": "3.0.0-beta.5",
6
- "@statsig/sha256": "3.0.0-beta.5"
5
+ "@statsig/client-core": "3.0.0",
6
+ "@statsig/sha256": "3.0.0"
7
7
  },
8
8
  "jsdelivr": "./build/statsig-js-on-device-eval-client.min.js",
9
9
  "type": "commonjs",