diff --git a/package.json b/package.json index 15b7d0c7..c86462f0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "statsig", - "version": "3.2.0", + "version": "3.3.0", "license": "MIT", "scripts": { "preinstall": "npx only-allow pnpm", diff --git a/packages/angular-bindings/package.json b/packages/angular-bindings/package.json index 72220d72..03e022dc 100644 --- a/packages/angular-bindings/package.json +++ b/packages/angular-bindings/package.json @@ -1,11 +1,11 @@ { "private": true, "name": "@statsig/angular-bindings", - "version": "3.2.0", + "version": "3.3.0", "dependencies": {}, "peerDependencies": { "@angular/core": "^17.1.0", - "@statsig/client-core": "3.2.0" + "@statsig/client-core": "3.3.0" }, "sideEffects": false } diff --git a/packages/client-core/package.json b/packages/client-core/package.json index e3eaccb8..e4ee7ad6 100644 --- a/packages/client-core/package.json +++ b/packages/client-core/package.json @@ -1,6 +1,6 @@ { "name": "@statsig/client-core", - "version": "3.2.0", + "version": "3.3.0", "dependencies": {}, "type": "commonjs", "main": "./src/index.js", diff --git a/packages/client-core/src/StatsigMetadata.ts b/packages/client-core/src/StatsigMetadata.ts index 25cf2264..5d2b477f 100644 --- a/packages/client-core/src/StatsigMetadata.ts +++ b/packages/client-core/src/StatsigMetadata.ts @@ -1,4 +1,4 @@ -export const SDK_VERSION = '3.2.0'; +export const SDK_VERSION = '3.3.0'; export type StatsigMetadata = { readonly [key: string]: string | undefined; diff --git a/packages/combo/package.json b/packages/combo/package.json index ffd0b8b7..2c1f5452 100644 --- a/packages/combo/package.json +++ b/packages/combo/package.json @@ -1,16 +1,16 @@ { "private": true, "name": "statsig-combo", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0", - "@statsig/js-client": "3.2.0", - "@statsig/js-local-overrides": "3.2.0", - "@statsig/js-on-device-eval-client": "3.2.0", - "@statsig/js-user-persisted-storage": "3.2.0", - "@statsig/session-replay": "3.2.0", - "@statsig/web-analytics": "3.2.0", - "@statsig/react-bindings": "3.2.0" + "@statsig/client-core": "3.3.0", + "@statsig/js-client": "3.3.0", + "@statsig/js-local-overrides": "3.3.0", + "@statsig/js-on-device-eval-client": "3.3.0", + "@statsig/js-user-persisted-storage": "3.3.0", + "@statsig/session-replay": "3.3.0", + "@statsig/web-analytics": "3.3.0", + "@statsig/react-bindings": "3.3.0" }, "type": "commonjs", "main": "./src/index.js", diff --git a/packages/expo-bindings-on-device-eval/package.json b/packages/expo-bindings-on-device-eval/package.json index 7561533c..73d92a01 100644 --- a/packages/expo-bindings-on-device-eval/package.json +++ b/packages/expo-bindings-on-device-eval/package.json @@ -1,11 +1,11 @@ { "name": "@statsig/expo-bindings-on-device-eval", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0", - "@statsig/js-on-device-eval-client": "3.2.0", - "@statsig/react-bindings-on-device-eval": "3.2.0", - "@statsig/react-native-core": "3.2.0" + "@statsig/client-core": "3.3.0", + "@statsig/js-on-device-eval-client": "3.3.0", + "@statsig/react-bindings-on-device-eval": "3.3.0", + "@statsig/react-native-core": "3.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0" diff --git a/packages/expo-bindings/package.json b/packages/expo-bindings/package.json index cabc3b57..7d44a49a 100644 --- a/packages/expo-bindings/package.json +++ b/packages/expo-bindings/package.json @@ -1,11 +1,11 @@ { "name": "@statsig/expo-bindings", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0", - "@statsig/js-client": "3.2.0", - "@statsig/react-bindings": "3.2.0", - "@statsig/react-native-core": "3.2.0" + "@statsig/client-core": "3.3.0", + "@statsig/js-client": "3.3.0", + "@statsig/react-bindings": "3.3.0", + "@statsig/react-native-core": "3.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0", diff --git a/packages/js-client/package.json b/packages/js-client/package.json index f442f709..1bafa97b 100644 --- a/packages/js-client/package.json +++ b/packages/js-client/package.json @@ -1,8 +1,8 @@ { "name": "@statsig/js-client", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0" + "@statsig/client-core": "3.3.0" }, "jsdelivr": "./build/statsig-js-client.min.js", "type": "commonjs", diff --git a/packages/js-local-overrides/package.json b/packages/js-local-overrides/package.json index fdf3b8ce..268b40f4 100644 --- a/packages/js-local-overrides/package.json +++ b/packages/js-local-overrides/package.json @@ -1,8 +1,8 @@ { "name": "@statsig/js-local-overrides", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0" + "@statsig/client-core": "3.3.0" }, "type": "commonjs", "main": "./src/index.js", diff --git a/packages/js-on-device-eval-client/package.json b/packages/js-on-device-eval-client/package.json index 05800aeb..e6a68988 100644 --- a/packages/js-on-device-eval-client/package.json +++ b/packages/js-on-device-eval-client/package.json @@ -1,9 +1,9 @@ { "name": "@statsig/js-on-device-eval-client", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0", - "@statsig/sha256": "3.2.0" + "@statsig/client-core": "3.3.0", + "@statsig/sha256": "3.3.0" }, "jsdelivr": "./build/statsig-js-on-device-eval-client.min.js", "type": "commonjs", diff --git a/packages/js-user-persisted-storage/package.json b/packages/js-user-persisted-storage/package.json index 8e58e2fe..3e43c8e6 100644 --- a/packages/js-user-persisted-storage/package.json +++ b/packages/js-user-persisted-storage/package.json @@ -1,8 +1,8 @@ { "name": "@statsig/js-user-persisted-storage", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0" + "@statsig/client-core": "3.3.0" }, "type": "commonjs", "main": "./src/index.js", diff --git a/packages/react-bindings-on-device-eval/package.json b/packages/react-bindings-on-device-eval/package.json index 84f6d6b5..13aea223 100644 --- a/packages/react-bindings-on-device-eval/package.json +++ b/packages/react-bindings-on-device-eval/package.json @@ -1,9 +1,9 @@ { "name": "@statsig/react-bindings-on-device-eval", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0", - "@statsig/js-on-device-eval-client": "3.2.0" + "@statsig/client-core": "3.3.0", + "@statsig/js-on-device-eval-client": "3.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0" diff --git a/packages/react-bindings/package.json b/packages/react-bindings/package.json index f1e3b4ff..9a269967 100644 --- a/packages/react-bindings/package.json +++ b/packages/react-bindings/package.json @@ -1,9 +1,9 @@ { "name": "@statsig/react-bindings", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0", - "@statsig/js-client": "3.2.0" + "@statsig/client-core": "3.3.0", + "@statsig/js-client": "3.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0" diff --git a/packages/react-native-bindings-on-device-eval/package.json b/packages/react-native-bindings-on-device-eval/package.json index 537fe1e3..df7b6606 100644 --- a/packages/react-native-bindings-on-device-eval/package.json +++ b/packages/react-native-bindings-on-device-eval/package.json @@ -1,11 +1,11 @@ { "name": "@statsig/react-native-bindings-on-device-eval", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0", - "@statsig/js-on-device-eval-client": "3.2.0", - "@statsig/react-bindings-on-device-eval": "3.2.0", - "@statsig/react-native-core": "3.2.0" + "@statsig/client-core": "3.3.0", + "@statsig/js-on-device-eval-client": "3.3.0", + "@statsig/react-bindings-on-device-eval": "3.3.0", + "@statsig/react-native-core": "3.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0" diff --git a/packages/react-native-bindings/package.json b/packages/react-native-bindings/package.json index 4d5bd0ee..952bae1f 100644 --- a/packages/react-native-bindings/package.json +++ b/packages/react-native-bindings/package.json @@ -1,11 +1,11 @@ { "name": "@statsig/react-native-bindings", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0", - "@statsig/js-client": "3.2.0", - "@statsig/react-bindings": "3.2.0", - "@statsig/react-native-core": "3.2.0" + "@statsig/client-core": "3.3.0", + "@statsig/js-client": "3.3.0", + "@statsig/react-bindings": "3.3.0", + "@statsig/react-native-core": "3.3.0" }, "peerDependencies": { "react": "^16.6.3 || ^17.0.0 || ^18.0.0", diff --git a/packages/react-native-core/package.json b/packages/react-native-core/package.json index 737135d3..3ba62c34 100644 --- a/packages/react-native-core/package.json +++ b/packages/react-native-core/package.json @@ -1,8 +1,8 @@ { "name": "@statsig/react-native-core", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0" + "@statsig/client-core": "3.3.0" }, "peerDependencies": { "react-native": "0.*", diff --git a/packages/session-replay/package.json b/packages/session-replay/package.json index 2d8f64d6..17844283 100644 --- a/packages/session-replay/package.json +++ b/packages/session-replay/package.json @@ -1,9 +1,9 @@ { "name": "@statsig/session-replay", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { "rrweb": "2.0.0-alpha.12", - "@statsig/client-core": "3.2.0" + "@statsig/client-core": "3.3.0" }, "devDependencies": { "@rrweb/types": "2.0.0-alpha.12" diff --git a/packages/sha256/package.json b/packages/sha256/package.json index 7aa79b83..ff4b0f52 100644 --- a/packages/sha256/package.json +++ b/packages/sha256/package.json @@ -1,6 +1,6 @@ { "name": "@statsig/sha256", - "version": "3.2.0", + "version": "3.3.0", "dependencies": {}, "devDependencies": { "js-sha256": "0.10.1" diff --git a/packages/sidecar/package.json b/packages/sidecar/package.json index 226a0e53..196eddae 100644 --- a/packages/sidecar/package.json +++ b/packages/sidecar/package.json @@ -1,6 +1,6 @@ { "name": "sidecar", - "version": "3.2.0", + "version": "3.3.0", "dependencies": {}, "type": "commonjs", "main": "./src/index.js", diff --git a/packages/test-helpers/package.json b/packages/test-helpers/package.json index 2af22424..fba98170 100644 --- a/packages/test-helpers/package.json +++ b/packages/test-helpers/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "statsig-test-helpers", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { "@jest/globals": "29.7.0" }, diff --git a/packages/web-analytics/package.json b/packages/web-analytics/package.json index f1163215..36e9ef58 100644 --- a/packages/web-analytics/package.json +++ b/packages/web-analytics/package.json @@ -1,9 +1,9 @@ { "name": "@statsig/web-analytics", - "version": "3.2.0", + "version": "3.3.0", "dependencies": { - "@statsig/client-core": "3.2.0", - "@statsig/js-client": "3.2.0" + "@statsig/client-core": "3.3.0", + "@statsig/js-client": "3.3.0" }, "jsdelivr": "./build/statsig-web-analytics.min.js", "type": "commonjs", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 34a1d169..6ab86b71 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1,9 +1,5 @@ lockfileVersion: '6.0' -settings: - autoInstallPeers: false - excludeLinksFromLockfile: false - overrides: braces: '>=3.0.3' express@<4.19.2: '>=4.19.2' @@ -455,145 +451,145 @@ importers: packages/combo: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core '@statsig/js-client': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-client '@statsig/js-local-overrides': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-local-overrides '@statsig/js-on-device-eval-client': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-on-device-eval-client '@statsig/js-user-persisted-storage': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-user-persisted-storage '@statsig/react-bindings': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../react-bindings '@statsig/session-replay': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../session-replay '@statsig/web-analytics': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../web-analytics packages/expo-bindings: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core '@statsig/js-client': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-client '@statsig/react-bindings': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../react-bindings '@statsig/react-native-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../react-native-core packages/expo-bindings-on-device-eval: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core '@statsig/js-on-device-eval-client': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-on-device-eval-client '@statsig/react-bindings-on-device-eval': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../react-bindings-on-device-eval '@statsig/react-native-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../react-native-core packages/js-client: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core packages/js-local-overrides: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core packages/js-on-device-eval-client: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core '@statsig/sha256': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../sha256 packages/js-user-persisted-storage: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core packages/react-bindings: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core '@statsig/js-client': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-client packages/react-bindings-on-device-eval: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core '@statsig/js-on-device-eval-client': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-on-device-eval-client packages/react-native-bindings: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core '@statsig/js-client': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-client '@statsig/react-bindings': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../react-bindings '@statsig/react-native-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../react-native-core packages/react-native-bindings-on-device-eval: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core '@statsig/js-on-device-eval-client': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-on-device-eval-client '@statsig/react-bindings-on-device-eval': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../react-bindings-on-device-eval '@statsig/react-native-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../react-native-core packages/react-native-core: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core packages/session-replay: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core rrweb: specifier: 2.0.0-alpha.12 @@ -620,10 +616,10 @@ importers: packages/web-analytics: dependencies: '@statsig/client-core': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../client-core '@statsig/js-client': - specifier: 3.2.0 + specifier: 3.3.0 version: link:../js-client packages: @@ -6091,7 +6087,6 @@ packages: - '@angular-devkit/build-angular' - '@angular-devkit/core' - '@angular-devkit/schematics' - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@schematics/angular' @@ -6128,7 +6123,6 @@ packages: dependencies: '@nx/cypress': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(cypress@13.7.0)(eslint@8.48.0)(nx@19.3.0)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6156,7 +6150,6 @@ packages: dependencies: '@nx/eslint-plugin': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(@typescript-eslint/parser@6.21.0)(eslint-config-prettier@9.1.0)(eslint@8.48.0)(nx@19.3.0)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6176,7 +6169,6 @@ packages: dependencies: '@nx/expo': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(encoding@0.1.13)(eslint@8.48.0)(nx@19.3.0)(ts-node@10.9.2)(typescript@5.3.3)(uglify-js@3.17.4) transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6216,7 +6208,6 @@ packages: dependencies: '@nx/jest': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(nx@19.3.0)(ts-node@10.9.2)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6236,7 +6227,6 @@ packages: dependencies: '@nx/js': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(nx@19.3.0)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6253,7 +6243,6 @@ packages: dependencies: '@nx/js': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(nx@19.3.0)(typescript@5.4.5) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6271,7 +6260,6 @@ packages: '@nx/next': 19.3.0(@babel/core@7.23.9)(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(eslint@8.48.0)(next@14.2.10)(nx@19.3.0)(typescript@5.3.3)(uglify-js@3.17.4) transitivePeerDependencies: - '@babel/core' - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6308,7 +6296,6 @@ packages: dependencies: '@nx/react-native': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(encoding@0.1.13)(eslint@8.48.0)(nx@19.3.0)(ts-node@10.9.2)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6334,7 +6321,6 @@ packages: dependencies: '@nx/react': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(eslint@8.48.0)(nx@19.3.0)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6355,7 +6341,6 @@ packages: '@nx/rollup': 19.3.0(@babel/core@7.23.9)(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(nx@19.3.0)(ts-node@10.9.2)(typescript@5.3.3) transitivePeerDependencies: - '@babel/core' - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6374,7 +6359,6 @@ packages: dependencies: '@nx/storybook': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(cypress@13.7.0)(eslint@8.48.0)(nx@19.3.0)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6406,7 +6390,6 @@ packages: dependencies: '@nx/web': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(nx@19.3.0)(typescript@5.3.3) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6423,7 +6406,6 @@ packages: dependencies: '@nx/webpack': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(nx@19.3.0)(typescript@5.3.3)(uglify-js@3.17.4) transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6499,7 +6481,6 @@ packages: webpack: 5.91.0(@swc/core@1.5.29)(uglify-js@3.17.4) webpack-merge: 5.10.0 transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6545,7 +6526,6 @@ packages: detect-port: 1.5.1 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6598,7 +6578,6 @@ packages: semver: 7.6.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6628,7 +6607,6 @@ packages: tslib: 2.6.2 typescript: 5.4.5 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6659,7 +6637,6 @@ packages: tsconfig-paths: 4.2.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -6713,7 +6690,6 @@ packages: tslib: 2.6.2 yargs-parser: 21.1.1 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6748,7 +6724,7 @@ packages: '@nx/workspace': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29) babel-plugin-const-enum: 1.2.0(@babel/core@7.24.0) babel-plugin-macros: 2.8.0 - babel-plugin-transform-typescript-metadata: 0.3.2(@babel/core@7.24.0) + babel-plugin-transform-typescript-metadata: 0.3.2 chalk: 4.1.2 columnify: 1.6.0 detect-port: 1.5.1 @@ -6766,7 +6742,6 @@ packages: tsconfig-paths: 4.2.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6797,7 +6772,7 @@ packages: '@nx/workspace': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29) babel-plugin-const-enum: 1.2.0(@babel/core@7.24.0) babel-plugin-macros: 2.8.0 - babel-plugin-transform-typescript-metadata: 0.3.2(@babel/core@7.24.0) + babel-plugin-transform-typescript-metadata: 0.3.2 chalk: 4.1.2 columnify: 1.6.0 detect-port: 1.5.1 @@ -6815,7 +6790,6 @@ packages: tsconfig-paths: 4.2.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6831,7 +6805,6 @@ packages: dependencies: '@nx/eslint': 19.3.0(@swc-node/register@1.9.2)(@swc/core@1.5.29)(@types/node@18.19.18)(eslint@8.48.0)(nx@19.3.0) transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -6870,7 +6843,6 @@ packages: webpack-merge: 5.10.0 transitivePeerDependencies: - '@babel/core' - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -7007,7 +6979,6 @@ packages: minimatch: 9.0.3 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -7043,7 +7014,6 @@ packages: tsconfig-paths: 4.2.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -7079,7 +7049,6 @@ packages: minimatch: 9.0.3 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -7116,7 +7085,6 @@ packages: tslib: 2.6.2 transitivePeerDependencies: - '@babel/core' - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -7142,7 +7110,6 @@ packages: semver: 7.6.0 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -7168,7 +7135,6 @@ packages: http-server: 14.1.1 tslib: 2.6.2 transitivePeerDependencies: - - '@babel/traverse' - '@swc-node/register' - '@swc/core' - '@swc/wasm' @@ -7221,7 +7187,6 @@ packages: webpack-node-externals: 3.0.0 webpack-subresource-integrity: 5.1.0(webpack@5.91.0) transitivePeerDependencies: - - '@babel/traverse' - '@parcel/css' - '@rspack/core' - '@swc-node/register' @@ -10574,16 +10539,9 @@ packages: transitivePeerDependencies: - '@babel/core' - /babel-plugin-transform-typescript-metadata@0.3.2(@babel/core@7.24.0): + /babel-plugin-transform-typescript-metadata@0.3.2: resolution: {integrity: sha512-mWEvCQTgXQf48yDqgN7CH50waTyYBeP2Lpqx4nNWab9sxEpdXVeKgfj1qYI2/TgUPQtNFZ85i3PemRtnXVYYJg==} - peerDependencies: - '@babel/core': ^7 - '@babel/traverse': ^7 - peerDependenciesMeta: - '@babel/traverse': - optional: true dependencies: - '@babel/core': 7.24.0 '@babel/helper-plugin-utils': 7.24.7 dev: true @@ -23180,3 +23138,7 @@ packages: /zone.js@0.14.6: resolution: {integrity: sha512-vyRNFqofdaHVdWAy7v3Bzmn84a1JHWSjpuTZROT/uYn8I3p2cmo7Ro9twFmYRQDPhiYOV7QLk0hhY4JJQVqS6Q==} + +settings: + autoInstallPeers: false + excludeLinksFromLockfile: false diff --git a/samples/web-minified/src/assets/statsig-js-client+session-replay+web-analytics.min.js b/samples/web-minified/src/assets/statsig-js-client+session-replay+web-analytics.min.js index 4e679c04..34d10e37 100644 --- a/samples/web-minified/src/assets/statsig-js-client+session-replay+web-analytics.min.js +++ b/samples/web-minified/src/assets/statsig-js-client+session-replay+web-analytics.min.js @@ -5,4 +5,4 @@ or you can use record.mirror to access the mirror instance during recording.`;le `;return r&&o.push("//# sourceMappingURL="+r+` `),o}function an(e,t){var r=sn(e,t),n=new Blob(r,{type:"application/javascript"});return URL.createObjectURL(n)}function ln(e,t){var r;return function(o){return r=r||an(e,t),new Worker(r,o)}}var cn=ln(function(){(function(){for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=typeof Uint8Array>"u"?[]:new Uint8Array(256),r=0;r>2],h+=e[(c[d]&3)<<4|c[d+1]>>4],h+=e[(c[d+1]&15)<<2|c[d+2]>>6],h+=e[c[d+2]&63];return p%3===2?h=h.substring(0,h.length-1)+"=":p%3===1&&(h=h.substring(0,h.length-2)+"=="),h};const o=new Map,a=new Map;async function l(s,c,d){const p=`${s}-${c}`;if("OffscreenCanvas"in globalThis){if(a.has(p))return a.get(p);const h=new OffscreenCanvas(s,c);h.getContext("2d");const m=await(await h.convertToBlob(d)).arrayBuffer(),f=n(m);return a.set(p,f),f}else return""}const i=self;i.onmessage=async function(s){if("OffscreenCanvas"in globalThis){const{id:c,bitmap:d,width:p,height:h,dataURLOptions:m}=s.data,f=l(p,h,m),u=new OffscreenCanvas(p,h);u.getContext("2d").drawImage(d,0,0),d.close();const y=await u.convertToBlob(m),S=y.type,b=await y.arrayBuffer(),g=n(b);if(!o.has(c)&&await f===g)return o.set(c,g),i.postMessage({id:c});if(o.get(c)===g)return i.postMessage({id:c});i.postMessage({id:c,type:S,base64:g,width:p,height:h}),o.set(c,g)}else return i.postMessage({id:s.data.id})}})()},null),Ft=Object.getOwnPropertySymbols,dn=Object.prototype.hasOwnProperty,un=Object.prototype.propertyIsEnumerable,pn=(e,t)=>{var r={};for(var n in e)dn.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ft)for(var n of Ft(e))t.indexOf(n)<0&&un.call(e,n)&&(r[n]=e[n]);return r},hn=(e,t,r)=>new Promise((n,o)=>{var a=s=>{try{i(r.next(s))}catch(c){o(c)}},l=s=>{try{i(r.throw(s))}catch(c){o(c)}},i=s=>s.done?n(s.value):Promise.resolve(s.value).then(a,l);i((r=r.apply(e,t)).next())});class mn{constructor(t){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.frozen=!1,this.locked=!1,this.processMutation=(s,c)=>{(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId||!this.rafStamps.invokeId)&&(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(s)||this.pendingCanvasMutations.set(s,[]),this.pendingCanvasMutations.get(s).push(c)};const{sampling:r="all",win:n,blockClass:o,blockSelector:a,recordCanvas:l,dataURLOptions:i}=t;this.mutationCb=t.mutationCb,this.mirror=t.mirror,l&&r==="all"&&this.initCanvasMutationObserver(n,o,a),l&&typeof r=="number"&&this.initCanvasFPSObserver(r,n,o,a,{dataURLOptions:i})}reset(){this.pendingCanvasMutations.clear(),this.resetObservers&&this.resetObservers()}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}initCanvasFPSObserver(t,r,n,o,a){const l=Dt(r,n,o,!0),i=new Map,s=new cn;s.onmessage=f=>{const{id:u}=f.data;if(i.set(u,!1),!("base64"in f.data))return;const{base64:y,type:S,width:b,height:g}=f.data;this.mutationCb({id:u,type:ae["2D"],commands:[{property:"clearRect",args:[0,0,b,g]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:y}],type:S}]},0,0]}]})};const c=1e3/t;let d=0,p;const h=()=>{const f=[];return r.document.querySelectorAll("canvas").forEach(u=>{F(u,n,o,!0)||f.push(u)}),f},m=f=>{if(d&&f-dhn(this,null,function*(){var y;const S=this.mirror.getId(u);if(i.get(S))return;if(i.set(S,!0),["webgl","webgl2"].includes(u.__context)){const g=u.getContext(u.__context);((y=g?.getContextAttributes())==null?void 0:y.preserveDrawingBuffer)===!1&&g.clear(g.COLOR_BUFFER_BIT)}const b=yield createImageBitmap(u);s.postMessage({id:S,bitmap:b,width:u.width,height:u.height,dataURLOptions:a.dataURLOptions},[b])})),p=requestAnimationFrame(m)};p=requestAnimationFrame(m),this.resetObservers=()=>{l(),cancelAnimationFrame(p)}}initCanvasMutationObserver(t,r,n){this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher();const o=Dt(t,r,n,!1),a=rn(this.processMutation.bind(this),t,r,n),l=on(this.processMutation.bind(this),t,r,n,this.mirror);this.resetObservers=()=>{o(),a(),l()}}startPendingCanvasMutationFlusher(){requestAnimationFrame(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const t=r=>{this.rafStamps.latestId=r,requestAnimationFrame(t)};requestAnimationFrame(t)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((t,r)=>{const n=this.mirror.getId(r);this.flushPendingCanvasMutationFor(r,n)}),requestAnimationFrame(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(t,r){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(t);if(!n||r===-1)return;const o=n.map(l=>pn(l,["type"])),{type:a}=n[0];this.mutationCb({id:r,type:a,commands:o}),this.pendingCanvasMutations.delete(t)}}class fn{constructor(t){this.trackedLinkElements=new WeakSet,this.styleMirror=new br,this.mutationCb=t.mutationCb,this.adoptedStyleSheetCb=t.adoptedStyleSheetCb}attachLinkElement(t,r){"_cssText"in r.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:r.id,attributes:r.attributes}]}),this.trackLinkElement(t)}trackLinkElement(t){this.trackedLinkElements.has(t)||(this.trackedLinkElements.add(t),this.trackStylesheetInLinkElement(t))}adoptStyleSheets(t,r){if(t.length===0)return;const n={id:r,styleIds:[]},o=[];for(const a of t){let l;this.styleMirror.has(a)?l=this.styleMirror.getId(a):(l=this.styleMirror.add(a),o.push({styleId:l,rules:Array.from(a.rules||CSSRule,(i,s)=>({rule:Ge(i),index:s}))})),n.styleIds.push(l)}o.length>0&&(n.styles=o),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(t){}}class yn{constructor(){this.nodeMap=new WeakMap,this.loop=!0,this.periodicallyClear()}periodicallyClear(){requestAnimationFrame(()=>{this.clear(),this.loop&&this.periodicallyClear()})}inOtherBuffer(t,r){const n=this.nodeMap.get(t);return n&&Array.from(n).some(o=>o!==r)}add(t,r){this.nodeMap.set(t,(this.nodeMap.get(t)||new Set).add(r))}clear(){this.nodeMap=new WeakMap}destroy(){this.loop=!1}}var gn=Object.defineProperty,Sn=Object.defineProperties,bn=Object.getOwnPropertyDescriptors,_t=Object.getOwnPropertySymbols,vn=Object.prototype.hasOwnProperty,In=Object.prototype.propertyIsEnumerable,Pt=(e,t,r)=>t in e?gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,$=(e,t)=>{for(var r in t||(t={}))vn.call(t,r)&&Pt(e,r,t[r]);if(_t)for(var r of _t(t))In.call(t,r)&&Pt(e,r,t[r]);return e},Mn=(e,t)=>Sn(e,bn(t));function N(e){return Mn($({},e),{timestamp:Me()})}let E,Ee,Ue,Re=!1;const j=Xt();function ye(e={}){const{emit:t,checkoutEveryNms:r,checkoutEveryNth:n,blockClass:o="rr-block",blockSelector:a=null,ignoreClass:l="rr-ignore",ignoreSelector:i=null,maskTextClass:s="rr-mask",maskTextSelector:c=null,inlineStylesheet:d=!0,maskAllInputs:p,maskInputOptions:h,slimDOMOptions:m,maskInputFn:f,maskTextFn:u,hooks:y,packFn:S,sampling:b={},dataURLOptions:g={},mousemoveWait:v,recordDOM:R=!0,recordCanvas:D=!1,recordCrossOriginIframes:V=!1,recordAfter:U=e.recordAfter==="DOMContentLoaded"?e.recordAfter:"load",userTriggeredOnInput:z=!1,collectFonts:B=!1,inlineImages:X=!1,plugins:k,keepIframeSrcFn:Z=()=>!1,ignoreCSSAttributes:W=new Set([]),errorHandler:J}=e;kr(J);const G=V?window.parent===window:!0;let xe=!1;if(!G)try{window.parent.document&&(xe=!1)}catch{xe=!0}if(G&&!t)throw new Error("emit function is required");v!==void 0&&b.mousemove===void 0&&(b.mousemove=v),j.reset();const je=p===!0?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,password:!0}:h!==void 0?h:{password:!0},ze=m===!0||m==="all"?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:m==="all",headMetaDescKeywords:m==="all"}:m||{};Sr();let $t,Be=0;const Wt=I=>{for(const H of k||[])H.eventProcessor&&(I=H.eventProcessor(I));return S&&!xe&&(I=S(I)),I};E=(I,H)=>{var x;if(((x=Q[0])==null?void 0:x.isFrozen())&&I.type!==C.FullSnapshot&&!(I.type===C.IncrementalSnapshot&&I.data.source===M.Mutation)&&Q.forEach(_=>_.unfreeze()),G)t?.(Wt(I),H);else if(xe){const _={type:"rrweb",event:Wt(I),origin:window.location.origin,isCheckout:H};window.parent.postMessage(_,"*")}if(I.type===C.FullSnapshot)$t=I,Be=0;else if(I.type===C.IncrementalSnapshot){if(I.data.source===M.Mutation&&I.data.isAttachIframe)return;Be++;const _=n&&Be>=n,ce=r&&I.timestamp-$t.timestamp>r;(_||ce)&&Ee(!0)}};const Le=I=>{E(N({type:C.IncrementalSnapshot,data:$({source:M.Mutation},I)}))},Ut=I=>E(N({type:C.IncrementalSnapshot,data:$({source:M.Scroll},I)})),jt=I=>E(N({type:C.IncrementalSnapshot,data:$({source:M.CanvasMutation},I)})),wn=I=>E(N({type:C.IncrementalSnapshot,data:$({source:M.AdoptedStyleSheet},I)})),ee=new fn({mutationCb:Le,adoptedStyleSheetCb:wn}),te=new Gr({mirror:j,mutationCb:Le,stylesheetManager:ee,recordCrossOriginIframes:V,wrappedEmit:E});for(const I of k||[])I.getMirror&&I.getMirror({nodeMirror:j,crossOriginIframeMirror:te.crossOriginIframeMirror,crossOriginIframeStyleMirror:te.crossOriginIframeStyleMirror});const He=new yn;Ue=new mn({recordCanvas:D,mutationCb:jt,win:window,blockClass:o,blockSelector:a,mirror:j,sampling:b.canvas,dataURLOptions:g});const Ne=new Qr({mutationCb:Le,scrollCb:Ut,bypassOptions:{blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskInputOptions:je,dataURLOptions:g,maskTextFn:u,maskInputFn:f,recordCanvas:D,inlineImages:X,sampling:b,slimDOMOptions:ze,iframeManager:te,stylesheetManager:ee,canvasManager:Ue,keepIframeSrcFn:Z,processedNodeManager:He},mirror:j});Ee=(I=!1)=>{if(!R)return;E(N({type:C.Meta,data:{href:window.location.href,width:ot(),height:nt()}}),I),ee.reset(),Ne.init(),Q.forEach(x=>x.lock());const H=yr(document,{mirror:j,blockClass:o,blockSelector:a,maskTextClass:s,maskTextSelector:c,inlineStylesheet:d,maskAllInputs:je,maskTextFn:u,slimDOM:ze,dataURLOptions:g,recordCanvas:D,inlineImages:X,onSerialize:x=>{it(x,j)&&te.addIframe(x),lt(x,j)&&ee.trackLinkElement(x),$e(x)&&Ne.addShadowRoot(x.shadowRoot,document)},onIframeLoad:(x,_)=>{te.attachIframe(x,_),Ne.observeAttachShadow(x)},onStylesheetLoad:(x,_)=>{ee.attachLinkElement(x,_)},keepIframeSrcFn:Z});if(!H)return console.warn("Failed to snapshot the document");E(N({type:C.FullSnapshot,data:{node:H,initialOffset:rt(window)}}),I),Q.forEach(x=>x.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&ee.adoptStyleSheets(document.adoptedStyleSheets,j.getId(document))};try{const I=[],H=_=>{var ce;return w(Vr)({mutationCb:Le,mousemoveCb:(T,Ve)=>E(N({type:C.IncrementalSnapshot,data:{source:Ve,positions:T}})),mouseInteractionCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.MouseInteraction},T)})),scrollCb:Ut,viewportResizeCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.ViewportResize},T)})),inputCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.Input},T)})),mediaInteractionCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.MediaInteraction},T)})),styleSheetRuleCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.StyleSheetRule},T)})),styleDeclarationCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.StyleDeclaration},T)})),canvasMutationCb:jt,fontCb:T=>E(N({type:C.IncrementalSnapshot,data:$({source:M.Font},T)})),selectionCb:T=>{E(N({type:C.IncrementalSnapshot,data:$({source:M.Selection},T)}))},customElementCb:T=>{E(N({type:C.IncrementalSnapshot,data:$({source:M.CustomElement},T)}))},blockClass:o,ignoreClass:l,ignoreSelector:i,maskTextClass:s,maskTextSelector:c,maskInputOptions:je,inlineStylesheet:d,sampling:b,recordDOM:R,recordCanvas:D,inlineImages:X,userTriggeredOnInput:z,collectFonts:B,doc:_,maskInputFn:f,maskTextFn:u,keepIframeSrcFn:Z,blockSelector:a,slimDOMOptions:ze,dataURLOptions:g,mirror:j,iframeManager:te,stylesheetManager:ee,shadowDomManager:Ne,processedNodeManager:He,canvasManager:Ue,ignoreCSSAttributes:W,plugins:((ce=k?.filter(T=>T.observer))==null?void 0:ce.map(T=>({observer:T.observer,options:T.options,callback:Ve=>E(N({type:C.Plugin,data:{plugin:T.name,payload:Ve}}))})))||[]},y)};te.addLoadListener(_=>{try{I.push(H(_.contentDocument))}catch(ce){console.warn(ce)}});const x=()=>{Ee(),I.push(H(document)),Re=!0};return document.readyState==="interactive"||document.readyState==="complete"?x():(I.push(A("DOMContentLoaded",()=>{E(N({type:C.DomContentLoaded,data:{}})),U==="DOMContentLoaded"&&x()})),I.push(A("load",()=>{E(N({type:C.Load,data:{}})),U==="load"&&x()},window))),()=>{I.forEach(_=>_()),He.destroy(),Re=!1,Or()}}catch(I){console.warn(I)}}return ye.addCustomEvent=(e,t)=>{if(!Re)throw new Error("please add custom event after start recording");E(N({type:C.Custom,data:{tag:e,payload:t}}))},ye.freezePage=()=>{Q.forEach(e=>e.freeze())},ye.takeFullSnapshot=e=>{if(!Re)throw new Error("please take full snapshot after start recording");Ee(e)},ye.mirror=j,ye}(); -!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("rrwebRecord")):"function"==typeof define&&define.amd?define(["rrwebRecord"],e):"object"==typeof exports?exports.Statsig=e(require("rrwebRecord")):t.Statsig=e(t.rrwebRecord)}(this,u=>(()=>{"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 i={3331:t=>{t.exports=u},1845:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.o=void 0,i.o=()=>__STATSIG__||l,i.i=t=>(0,i.o)()[t];i.t=t=>{var e=(0,i.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var n,s="__STATSIG__",r="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},o="undefined"!=typeof globalThis?globalThis:{};const l=null!=(n=null!=(n=null!=(n=r[s])?n:e[s])?n:o[s])?n:{instance:i.t};r[s]=l,e[s]=l,o[s]=l},2137:(t,e,i)=>{$Q(e),e.u=e.l=void 0;const s=i(1406);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=n,e.u=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},6427:(t,e)=>{$Q(e)},694:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const u=i(7512),a=i(9122),r=i(8578),o=i(4534),c=i(3401);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}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 n}attach(t,e){this.S=t,this.p=e}getDataSync(t){var t=t&&(0,r.A)(t,this.p),e=this.T(t),i=this.j.get(e,t);return i||((i=this.I(e))?(this.j.add(e,i),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,r.A)(e,this.p),i=this.T(e);this.j.add(i,h("Bootstrap",t,null,e))}M(e,i,n){return s(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(i),t=[this.D(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(u.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}k(i,n){return s(this,void 0,void 0,function*(){var t=i&&(0,r.A)(i,this.p),e=this.T(t),t=yield this.M(null,t,n);t&&this.j.add(e,$P($P({},t),{source:"Prefetch"}))})}D(r,o,l){return s(this,void 0,void 0,function*(){let t=null;r&&this.R(r,o)&&(t=r.data);var e=yield this.N(t,o,l);if(!e)return u.Log.debug("No response returned for latest value"),null;var i=(0,c.C)(e,"has_updates","Response"),n=this.P(),n=a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,o);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,o)}e=this.T(o);return this.j.add(e,s),this.G(e,s),s})}P(){return null!=this.S?this.S:(u.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=o.Storage.getItem)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){o.Storage.setItem(t,JSON.stringify(e)),this.K(t)}K(t){var e=null!=(e=(0,o.F)(this.O))?e:{},t=(e[t]=Date.now(),l(e,10));t&&(delete e[t],o.Storage.removeItem(t)),(0,o.J)(this.O,e)}};class n{constructor(){this.V={}}get(t,e){var t=this.V[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(u.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=l(this.V,9);i&&delete this.V[i],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function l(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt{$Q2(r,"__esModule",{value:!0}),r.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return $P({key:i,action:e,step:n,timestamp:Date.now()},t)}function o(t,e){var i=null!=(i=n.get(t))?i:[];i.push(e),n.set(t,i)}function e(t,e){if(e in t)return t[e]}r.Diagnostics={_n:t=>n.get(t),gn:t=>{o(t,s({},i,"overall"))},mn:(t,e,i)=>{o(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},bn:(t,e)=>{o(t,s(e,i,"initialize","network_request"))},pn:(t,e)=>{o(t,s(e,"end","initialize","network_request"))},yn:t=>{o(t,s({},i,"initialize","process"))},On:(t,e)=>{o(t,s(e,"end","initialize","process"))},jn:t=>{n.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,i,n){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===i.includes('"is_delta":true')||void 0,attempt:e,error:r.Diagnostics.Sn(n)}},Tn(t,e,i,n){var s=r.Diagnostics._n(i);null==s||s.length<=0||(r.Diagnostics.jn(i),i=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:n}),e.enqueue(i))}}},3539:(t,e)=>{$Q(e)},5542:function(t,l,e){var i=this&&this.__awaiter||$A();$Q2(l,"__esModule",{value:!0}),l.ErrorBoundary=l.EXCEPTION_ENDPOINT=void 0;const n=e(7512),u=e(5902),a=e(8e3),c=(l.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");l.ErrorBoundary=class{constructor(t,e,i){this.S=t,this.p=e,this.B=i,this.$=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.H(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.W(e,t)):i}catch(t){return this.W(e,t),null}}W(r,o){try{n.Log.warn("Caught error in "+r,{error:o});i(this,void 0,void 0,function*(){var t,e,i=o||Error(c),n=i instanceof Error,s=n?i.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:o}):(t=u.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),n=n?i.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(i),i=JSON.stringify($P({tag:r,exception:s,info:n},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(n=null==(s=this.p)?void 0:s.networkConfig)?void 0:n.networkOverrideFunc)?s:fetch)(l.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:i}),null!=(n=this.B)&&n.call(this,{name:"error",error:o})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},2922:(t,e)=>{$Q(e)},2417:(t,e)=>{$Q(e)},7770:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(2137),r=i(1406),o=i(7512),l=i(7410),u=i(6830),a=i(1637),c=i(4534),h=i(9638),d=i(2397),v={},_={Startup:"startup",GainedFocus:"gained_focus"};class f{static wi(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static Ti(t){null!=(t=v[t])&&t.ct(_.GainedFocus)}constructor(t,e,i,n){this.S=t,this.B=e,this.X=i,this.p=n,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),this.st=!0===(null==n?void 0:n.disableLogging),this.rt=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:50;e=null==n?void 0:n.networkConfig;this.ot=(0,h.ut)(null==e?void 0:e.logEventUrl,null==e?void 0:e.api,"/rgstr",l.NetworkDefault.eventsApi)}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this.ft(),this.Z.length>this.rt)&&f.wi(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}start(){(0,u.Mt)()||(v[this.S]=this,(0,d.lt)(t=>{"background"===t?f.wi(this.S):"foreground"===t&&f.Ti(this.S)}),this.ct(_.Startup),this.ht())}stop(){return n(this,void 0,void 0,function*(){this._t&&(clearInterval(this._t),this._t=null),delete v[this.S],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;this.gt(),0!==this.Z.length&&(t=this.Z,this.Z=[],yield this.bt(t))})}ft(){this.it||(this.it=!0,200f.wi(this.S),200)}dt(t){if((0,u.Mt)())return!1;if((0,a.yt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.l)(this.S,e),i=t.metadata||{},t=[t.eventName,e,i.gate,i.config,i.ruleID].join("|"),e=this.tt[t],i=Date.now();if(e&&i-e<6e4)return!1;1e3{o.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={},i=this.It(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));o.Log.debug("Enqueued Event:",i),this.Z.push(i)}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,u.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):f.wi(this.S)},t);this._t=e}}e.EventLogger=f},1406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.xt=r.Dt=r.h=void 0;const o=e(6634);r.h=e=>{let i=0;for(let t=0;t>>0)},r.Dt=(t,e)=>(0,r.h)(JSON.stringify((0,r.xt)(t,e)));r.xt=(i,n)=>{if(null==i)return null;var t=Object.keys(i).sort();const s={};return t.forEach(t=>{var e=i[t];0===n||"object"!==(0,o.kt)(e)?s[t]=e:s[t]=(0,r.xt)(e,null!=n?n-1:n)}),s}},1333:(t,e)=>{$Q(e)},7512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function i(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...i(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...i(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...i(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...i(t))}}(e.Log=n).level=e.LogLevel.Warn},7410:(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"}},7023:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(1845);const o=i(1845),b=i(8962),p=i(7512),l=i(7410),u=i(5902),a=i(6830),c=i(4143),h=i(9122),d=i(8e3),m=i(2397),y=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(n){return r(this,void 0,void 0,function*(){var t,e,i;return!!S(n)&&(t=yield this.Nt(n),e=yield this.Gt(n),(i=navigator).sendBeacon.bind(i)(e,t))})}Pt(_){var f,g;return r(this,void 0,void 0,function*(){if(!S(_))return null;if(this.Rt.preventAllNetworkTraffic)return null;var{method:e,body:i,retries:n,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),o=yield this.Gt(_);let l=null;var u=(0,m.Ut)();try{var a,c,h,d={method:e,body:i,headers:$P({},_.headers),signal:null===r||void 0===r?void 0:r.signal,priority:_.priority,keepalive:u},v=(_.isInitialize&&b.Diagnostics.bn(_.sdkKey,{attempt:s}),null!=(f=this.Rt.networkOverrideFunc)?f:fetch);if(l=yield v(o,d),clearTimeout(t),l.ok)return h=yield l.text(),_.isInitialize&&b.Diagnostics.pn(_.sdkKey,b.Diagnostics.wn(l,s,h)),{body:h,code:l.status};throw a=yield l.text().catch(()=>"No Text"),(c=new Error(`NetworkError: ${o} `+a)).name="NetworkError",c}catch(t){i=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&&b.Diagnostics.pn(_.sdkKey,b.Diagnostics.wn(l,s,"",t)),!n||nencodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return i.url+(t?"?"+t:"")})}Nt(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,i=h.StableID.get(e),n=c.SessionID.get(e),e=u.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},d.StatsigMetadataProvider.get()),{stableID:i,sessionID:n,sdkType:e})}))})}Ct(t,e){var i,n,s=(0,a.Lt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,o.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(i=s.btoa(e).split("").reverse().join(""))?i:e;return t.params=$P($P({},null!=(n=t.params)?n:{}),{[l.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return p.Log.warn("/initialize request encoding failed"),e}}};const S=t=>!!t.sdkKey||(p.Log.warn("Unable to make request without an SDK key"),!1)},1405:(t,e)=>{$Q(e)},1361:(t,e)=>{$Q(e)},5902:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={Y:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},Kt(t,e){i[t]=e},Ft(t){n&&"-react"!==n||(n="-"+t)}}},6830:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.At=n.qt=n.zt=n.Mt=n.Jt=n.Lt=void 0;n.Lt=()=>"undefined"!=typeof window?window:null,n.Jt=()=>{var t=(0,n.Lt)();return null!=(t=null==t?void 0:t.document)?t:null},n.Mt=()=>{var t;return null===(0,n.Jt)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},n.zt=(t,e)=>{var i=(0,n.Lt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.qt=(t,e)=>{var i=(0,n.Jt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)};n.At=()=>{var t;try{return null==(t=(0,n.Lt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},4143:(t,e,i)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(2137),r=i(7512),o=i(4534),l=i(8023),u=18e5,a=144e5,c={};function h(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function d(t){return"statsig.session_id."+(0,n.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=d(t);return(0,o.F)(t)}(t);var i=Date.now();e=e||{sessionID:(0,l.getUUID)(),startTime:i,lastUpdate:i};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),i=t.data,n=((function({lastUpdate:t}){return Date.now()-t>u}(i)||function({startTime:t}){return Date.now()-t>a}(i))&&(i.sessionID=(0,l.getUUID)(),i.startTime=e),i.lastUpdate=e,i),s=t.sdkKey;s=d(s);try{(0,o.J)(s,n)}catch(t){r.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=i.startTime,i=t.sdkKey,t.idleTimeoutID=h(i,u),t.ageTimeoutID=h(i,a-e),t},overrideInitialSessionID:(t,e)=>{var i;c[e]=(t=t,e=e,i=Date.now(),{data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e})}}},9122:(t,e,i)=>{$Q(e),e.StableID=void 0;const n=i(2137),s=i(7512),r=i(4534),o=i(8023),l={};function u(t){return"statsig.stable_id."+(0,n.u)(t)}function a(t,e){e=u(e);try{(0,r.J)(e,t)}catch(t){s.Log.warn("Failed to save StableID")}}e.StableID={get:e=>{if(null==l[e]){let t=function(t){t=u(t);return(0,r.F)(t)}(e);null==t&&a(t=(0,o.getUUID)(),e),l[e]=t}return l[e]},setOverride:(t,e)=>{a(l[e]=t,e)}}},1375:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(1845);const o=i(1845),l=i(5542),u=i(7770),a=i(7512),c=i(6830),h=i(4143),d=i(4534);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.xn=null,this.Vt={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&d.Storage.Bt(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),null!=n&&n.storageProvider&&d.Storage.de(n.storageProvider),this.S=t,this.p=null!=n?n:{},this.overrideAdapter=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.Ht=new u.EventLogger(t,r,i,n),this.Wt=new l.ErrorBoundary(t,n,r),this.Wt.wrap(this),this.Wt.wrap(i),this.Wt.wrap(e),this.Wt.wrap(this.Ht),this.dataAdapter=e,this.dataAdapter.attach(t,n),this.storageProvider=d.Storage,this.Yt(),s=t,r=this,(0,c.Mt)()||(i=(0,o.o)(),e=null!=(e=i.instances)?e:{},r=r,null!=e[s]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[s]=r,i.lastInstance=r,i.instances=e,__STATSIG__=i)}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Ht.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,d.Storage.Bt(t.disableStorage))}flush(){return this.Ht.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.Qt("Uninitialized",null),this.xn=null,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(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.Wt.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.Vt[i.name]&&this.Vt[i.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,i){!0===(null==i?void 0:i.disableExposureLog)?this.Ht.incrementNonExposureCount(t):this.Ht.enqueue(e)}}},2636:(t,e)=>{$Q(e)},3206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{$Q(e),e.Zt=e.te=e.ee=e.yt=void 0;const i="statsig::config_exposure",n="statsig::gate_exposure",u=(t,e,i,n,s)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:r(i,n),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===n||t===i,e.ee=(t,e)=>{return u(n,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 u(i,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,i)=>{var n,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let o="",l=null!=(n=null==s?void 0:s.undelegated_secondary_exposures)?n:[];return r&&(o=null!=(n=s.allocated_experiment_name)?n:"",l=s.secondary_exposures),u("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:i,ruleID:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)},l)};const r=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},8e3:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.2.0";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},586:(t,e)=>{$Q(e)},1098:(t,e)=>{$Q(e)},2059:(t,e,i)=>{$Q(e),e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const r=i(6634),s="default";function o(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:s,__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},o(t,e,i,n)),{get:l(null==i?void 0:i.value)})}function l(n,s){return(t,e)=>{var i=null!=(i=null==n?void 0:n[t])?i:null;return null!=i&&(null==e||(0,r.le)(i,e))?(null!=s&&s(t),i):null!=e?e:null}}e.ue=function(t,e,i){return o(t,e,i,!0===(null==i?void 0:i.value))},e.oe=n,e.re=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.se=function(t,e,i,n){return $P($P({},o(t,e,i,void 0)),{get:l(null==i?void 0:i.value,n),groupName:null!=(t=null==i?void 0:i.group_name)?t:null,__value:null!=(e=null==i?void 0:i.value)?e:{}})},e.ne=function(t,e,i,n){return $P($P($P({},t),e),{get:l(i,n)})},e.ie=l},1812:(t,e)=>{$Q(e)},8578:(t,e,i)=>{$Q(e),e.v=e.A=void 0;const n=i(1406),s=i(7512);e.A=function(t,e){try{var i=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment&&(i.statsigEnvironment=e.environment),i}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,n.Dt)(t):null}},4534:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.J=i.F=i.Storage=void 0;var n=e(7512),e=e(6830);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 o=null;try{const a=(0,e.Lt)();a&&a.localStorage&&"function"==typeof a.localStorage.getItem&&(o={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){n.Log.warn("Failed to setup localStorageProvider.")}let l=null!==o&&void 0!==o?o:r,u=l;i.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:t=>{var e=()=>u.getItem(t);try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.de(r),null;throw t}},setItem:(t,e)=>u.setItem(t,e),removeItem:t=>u.removeItem(t),getAllKeys:()=>u.getAllKeys(),de:t=>{l=t,u=t},Bt:t=>{u=t?r:l}},i.F=function(t){return t=i.Storage.getItem(t),JSON.parse(null!=t?t:"null")},i.J=function(t,e){i.Storage.setItem(t,JSON.stringify(e))}},3401:(t,e,i)=>{$Q(e),e.C=void 0;const s=i(7512);e.C=function(t,e,i){try{var n=JSON.parse(t);return"object"==typeof n&&0 in n,n}catch(t){}return s.Log.error("Failed to parse "+i),null}},6634:(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 i=t=>Array.isArray(t)?"array":typeof t;return i(t)===i(e)}},8023:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="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{$Q(e),e.ut=void 0,e.ut=function(t,e,i,n){return t||(e?""+e+i:""+n+i)}},2397:(t,e,i)=>{$Q(e),e.ve=e.lt=e.Ut=e.Ot=void 0;i=i(6830);const n="foreground",s="background",r=[];let o=n,l=!1;e.Ot=()=>o===n,e.Ut=()=>l,e.lt=t=>{r.unshift(t)};e.ve=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,i.zt)("focus",()=>{(l=!1,e.ve)(n)}),(0,i.zt)("blur",()=>(0,e.ve)(s)),(0,i.zt)("beforeunload",()=>{l=!0,(0,e.ve)(s)}),(0,i.qt)("visibilitychange",()=>{(0,e.ve)("visible"===document.visibilityState?n:s)})},6914:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,i(1845);const r=i(8962),o=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return r.Diagnostics}}),i(7770)),l=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}}),i(7512));$Q2(e,"Log",{enumerable:!0,get:function(){return l.Log}});var u=i(8e3);const a=i(4534);$Q2(e,"Storage",{enumerable:!0,get:function(){return a.Storage}}),s(i(1845),e),s(i(2137),e),s(i(6427),e),s(i(694),e),s(i(8962),e),s(i(3539),e),s(i(5542),e),s(i(2922),e),s(i(2417),e),s(i(1406),e),s(i(1333),e),s(i(7512),e),s(i(7023),e),s(i(7410),e),s(i(1405),e),s(i(1361),e),s(i(6830),e),s(i(5902),e),s(i(4143),e),s(i(9122),e),s(i(1375),e),s(i(2636),e),s(i(3206),e),s(i(1637),e),s(i(8e3),e),s(i(586),e),s(i(2059),e),s(i(1812),e),s(i(8578),e),s(i(1098),e),s(i(4534),e),s(i(3401),e),s(i(6634),e),s(i(9638),e),s(i(8023),e),s(i(2397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},2016:(t,e,i)=>{$Q(e),e.AutoInit=void 0;const v=i(6914),_=i(2018);function f(t,e){var i;return null!=(i=e.get(t))?i:e.get(t.toLowerCase())}e.AutoInit=class{static attempt(e){var t,i,n;try{var s=(0,v.Lt)(),r=(0,v.Jt)();if(s&&r&&r.currentScript){var o=r.currentScript.getAttribute("src"),l=null==(t=s.location)?void 0:t.href;if(o&&l){var u=new URL(o,l).searchParams,a=null!=(i=f("sdkKey",u))?i:f("apiKey",u);if(a){var c={},h=f("proxy",u),d=(h&&(c.networkConfig={api:h}),null==(n=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instances)?void 0:n[a]);let t=null;(t=d instanceof _.StatsigClient?d:t)||(t=new _.StatsigClient(a,function(){var t=(0,v.Lt)();if(!t)return{};let e=t.statsigUser||{};var i=(e="object"!=typeof e?{}:e).custom||{},n=e.customIDs||{};return $P($P({},e),{customIDs:$P({},n),custom:$P($P({},i),{useragent:t.navigator.userAgent,page_url:(0,v.At)()||"",language:null==(n=t.navigator)?void 0:n.language})})}(),c)).initializeAsync().catch(t=>{v.Log.error(t)}),e({sdkKey:a,client:t})}}}}catch(t){v.Log.error("AutoInit failed",t)}}}},7262:(t,e,i)=>{$Q(e),e.fe=void 0;const n=i(6914);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.fe=function(t,e){var i;return(e=(0,n.C)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.Dt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===e.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(t,e,i)=>{$Q(e);const s=i(6914);e.default=class{constructor(t){this.S=t,this._e=null,this.ge=null,this.be="Uninitialized",this.ye=0,this.me=0,this.bi=null,this.mi=new Set}reset(){this.ge=null,this._e=null,this.be="Loading",this.ye=0,this.me=0,this.bi=null}finalize(){this.ge||(this.be="NoValues")}getValues(){return this._e?(0,s.C)(this._e,"has_updates","EvaluationStoreValues"):null}setValues(t,e){var i;return!!t&&null!=(i=(0,s.C)(t.data,"has_updates","EvaluationResponse"))&&(this.be=t.source,!0===(null==i?void 0:i.has_updates)&&(this._e=t.data,this.ye=i.time,this.me=t.receivedAt,this.ge=i,this.bi=this.pi(t.source,i),t.source)&&i.user&&this.yi(e,i),!0)}getGate(t){var e;return this.pe(null==(e=this.ge)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.pe(null==(e=this.ge)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.pe(null==(e=this.ge)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.pe(null==(e=this.ge)?void 0:e.param_stores,t)}pi(t,e){return"Bootstrap"!==t?null:(t={},e.user&&(t.user=e.user),e.sdkInfo&&(t.generatorSDKInfo=e.sdkInfo),t.lcut=e.time,t)}pe(t,e){let i=null;return{result:i=t?t[e]||t[(0,s.h)(e)]:i,details:this.Se(null==i)}}yi(t,e){var i,n=s.StableID.get(this.S);(null==(i=t.customIDs)?void 0:i.stableID)!==n?this.mi.add("StableIDMismatch"):"user"in e&&(i=e.user,(0,s.v)(t)!==(0,s.v)(i))&&this.mi.add("PartialUserMatch")}getCurrentSourceDetails(){var t;return"Uninitialized"===this.be||"NoValues"===this.be?{reason:this.be}:(t={reason:this.be,lcut:this.ye,receivedAt:this.me},0{$Q(e),e.Te=void 0;const g=i(6914),b={disableExposureLog:!0};function p(t){return null==t||!1===t.disableExposureLog}function m(t,e){return null!=e&&!(0,g.le)(t,e)}e.Te=function(v,_,f){return(t,e)=>{if(null==_)return e;var i,n,s,r,o,l,u,a,c,h,d=_[t];if(null==d||null!=e&&(0,g.kt)(e)!==d.param_type)return e;switch(d.ref_type){case"static":return d.value;case"gate":return h=d,v.getFeatureGate(h.gate_name,p(f)?void 0:b).value?h.pass_value:h.fail_value;case"dynamic_config":return h=d,u=e,a=f,m(c=(l=v).getDynamicConfig(h.config_name,b).get(h.param_name),u)?u:(p(a)&&l.getDynamicConfig(h.config_name),c);case"experiment":return u=d,a=e,l=f,m(o=(c=v).getExperiment(u.experiment_name,b).get(u.param_name),a)?a:(p(l)&&c.getExperiment(u.experiment_name),o);case"layer":return o=d,n=e,s=f,m(r=(i=v).getLayer(o.layer_name,b).get(o.param_name),n)?n:(p(s)&&i.getLayer(o.layer_name).get(o.param_name),r);default:return e}}}},8198:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e);const o=i(6914),l=i(4845),u=i(8448),r=i(3583),a=i(4131);class n extends o.StatsigClientBase{static instance(t){var e=(0,o.o)().instance(t);return e instanceof n?e:(o.Log.warn((0,o.Mt)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){o.SDKType.Kt(t,"javascript-client");var n,s=new u.default(i,t=>{this.$emt(t)}),s=(super(t,null!=(n=null==i?void 0:i.dataAdapter)?n:new a.StatsigEvaluationsDataAdapter,s,i),this.we=new l.default(t),this.Ie=(0,o.A)(e,i),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const r of s)r.bind(this)}initializeSync(t){"Uninitialized"===this.loadingStatus&&(this.Ht.start(),this.updateUserSync(this.Ie,t))}initializeAsync(t){return s(this,void 0,void 0,function*(){return this.xn||(this.xn=this.Dn(t)),this.xn})}updateUserSync(t,e){this.Ae(t);t=this.dataAdapter.getDataSync(this.Ie),this.we.setValues(t,this.Ie),this.Me(t),e=null==e?void 0:e.disableBackgroundCacheRefresh;!0===e||null==e&&"Bootstrap"===(null==t?void 0:t.source)||this.xe(null!=t?t:null,this.Ie)}updateUserAsync(i,n){return s(this,void 0,void 0,function*(){this.Ae(i);var t=this.Ie,e=(o.Diagnostics.gn(this.S),this.dataAdapter.getDataSync(t));if(this.we.setValues(e,this.Ie),this.Qt("Loading",e),e=yield this.dataAdapter.getDataAsync(e,t,n),t===this.Ie){let t=!1;null!=e&&(o.Diagnostics.yn(this.S),t=this.we.setValues(e,this.Ie),o.Diagnostics.On(this.S,{success:t})),this.Me(e),t||this.$emt({name:"initialization_failure"}),o.Diagnostics.mn(this.S,t,this.we.getCurrentSourceDetails()),o.Diagnostics.Tn(this.Ie,this.Ht,this.S,this.p)}})}getContext(){return{sdkKey:this.S,options:this.p,values:this.we.getValues(),user:JSON.parse(JSON.stringify(this.Ie)),errorBoundary:this.Wt,session:o.StatsigSession.get(this.S),stableID:o.StableID.get(this.S)}}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:i,details:n}=this.we.getGate(t),n=(0,o.ue)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.ee)(this.Ie,i),e),this.$emt({name:"gate_evaluation",gate:i}),i}getDynamicConfig(t,e){var{result:i,details:n}=this.we.getConfig(t),n=(0,o.oe)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.te)(this.Ie,i),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e){var{result:i,details:n}=this.we.getConfig(t),n=(0,o.re)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.te)(this.Ie,i),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,i){var{result:t,details:n}=this.we.getLayer(e),n=(0,o.se)(e,n,t),s=null==(s=null==(t=this.overrideAdapter)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.Ie,i);const r=(0,o.ne)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{this.Xt(e,(0,o.Zt)(this.Ie,r,t),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:i,details:n}=this.we.getParamStore(t);return this.Ht.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,r.Te)(this,i,e)}}logEvent(t,e,i){this.Ht.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:i}:t),{user:this.Ie,time:Date.now()}))}Yt(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Me(null)})}Dn(t){return s(this,void 0,void 0,function*(){return o.Storage.isReady()||(yield o.Storage.isReadyResolver()),this.Ht.start(),this.updateUserAsync(this.Ie,t)})}Me(t){this.we.finalize(),this.Qt("Ready",t)}xe(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}Ae(t){this.Ht.reset(),this.we.reset(),this.Ie=(0,o.A)(t,this.p);t=null==(t=this.Ie.customIDs)?void 0:t.stableID;t&&o.StableID.setOverride(t,this.S)}}e.default=n},4131:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(6914),s=i(8448);class o extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.X=null,this.p=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.M(t,(0,n.A)(e,this.p),i)}prefetchData(t,e){return this.k(t,e)}setData(t){var e=(0,n.C)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(t,e){super.setData(t,e)}N(e,i,n){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.X)?void 0:s.fetchEvaluations(this.P(),e,null==n?void 0:n.priority,i);return null!=t?t:null})}T(t){t=(0,n.u)(this.P(),t,null==(t=this.p)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=o},2018:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.StatsigClient=void 0,i(8198));e.StatsigClient=r.default,s(i(6914),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:r.default}),e.default=__STATSIG__},8788:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.SessionReplay=e.runStatsigSessionReplay=e.StatsigSessionReplayPlugin=void 0;const s=i(6914),r=i(759);function o(t,e){new l(t,e)}e.StatsigSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="session-replay"}bind(t){o(t,this.options)}},e.runStatsigSessionReplay=o;class l{constructor(t,e){this.De=t,this.p=e,this.ke=null,this.Ee=[];var{sdkKey:e,errorBoundary:t}=t.getContext();this.Wt=t,this.Wt.wrap(this),(0,s.Mt)()||((t=(0,s.o)()).srInstances=$P($P({},t.srInstances),{[e]:this})),this.Re=this.Ne(),this.Ce=new r.SessionReplayClient,this.De.$on("pre_shutdown",()=>this.Pe()),this.De.$on("values_updated",()=>{var t;return this.Ge(null==(t=this.p)?void 0:t.forceRecording)}),this.De.on("session_expired",()=>{this.Ce.stop(),s.StatsigMetadataProvider.add({isRecordingSession:"false"}),this.Ue("session_expired"),this.Re=this.Ne()}),this.Le(),this.Ge(null==(t=this.p)?void 0:t.forceRecording)}Le(){const i=this.De.getContext()["sdkKey"];(0,s.lt)(t=>{var e=null==(e=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.srInstances)?void 0:e[i];e instanceof l&&e.Ke(t)})}forceStartRecording(){this.Ge(!0)}Ke(t){"background"===t&&(this.Ue(),this.De.flush().catch(t=>{this.Wt.logError("SR::visibility",t)}))}Fe(t,e){this.ke=e,this.Ee.push(t),2048this.Fe(t,e),null!=(e=null==(t=this.p)?void 0:t.rrwebConfig)?e:{})):this.Pe()}Pe(){this.Ce.stop(),s.StatsigMetadataProvider.add({isRecordingSession:"false"}),0!==this.Ee.length&&null!=this.ke&&this.qe()}Ue(e){0!==this.Ee.length&&null!=this.ke&&(e=(0,s.Ut)()?"is_leaving_page":e,this.Re.then(t=>this.ze(t,e)).catch(t=>{this.Wt.logError("SR::flush",t)}))}ze(t,e){var i,n=this.ke;null!==n&&0!==this.Ee.length&&(i=JSON.stringify(this.Ee),t={eventName:"statsig::session_recording",value:t,metadata:{session_start_ts:String(n.startTime),session_end_ts:String(n.endTime),clicks_captured_cumulative:String(n.clickCount),rrweb_events:i,rrweb_payload_size:String(i.length),session_replay_sdk_version:s.SDK_VERSION}},e&&(t.metadata[e]="true"),this.De.logEvent(t),this.Ee=[])}qe(){this.Re=this.Ne(),this.Ue()}Ne(){return n(this,void 0,void 0,function*(){return this.De.getContext().session.data.sessionID})}}e.SessionReplay=l},759:(t,e,i)=>{$Q(e),e.SessionReplayClient=void 0;const n=i(3331),s=i(6914);e.SessionReplayClient=class{constructor(){this.Je=null,this.Ve=null,this.Be=0}record(i,t,e){null==(0,s.Jt)()||(this.Je=null,this.Ve=null,this.Be=0,this.$e=e,this.He)||(this.He=(e=t=>{var e;null==this.Je&&(this.Je=t.timestamp),this.Ve=t.timestamp,3!==(e=t).type||2!==e.data.source||2!==e.data.type&&4!==e.data.type||this.Be++,i(t,{startTime:this.Je,endTime:this.Ve,clickCount:this.Be}),144e5{$Q(e),e.StatsigSessionReplayPlugin=e.runStatsigSessionReplay=e.SessionReplay=e.SessionReplayClient=void 0;const n=i(8788),s=($Q2(e,"SessionReplay",{enumerable:!0,get:function(){return n.SessionReplay}}),$Q2(e,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return n.StatsigSessionReplayPlugin}}),$Q2(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return n.runStatsigSessionReplay}}),i(759));$Q2(e,"SessionReplayClient",{enumerable:!0,get:function(){return s.SessionReplayClient}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{SessionReplayClient:s.SessionReplayClient,SessionReplay:n.SessionReplay,runStatsigSessionReplay:n.runStatsigSessionReplay,StatsigSessionReplayPlugin:n.StatsigSessionReplayPlugin})},4535:(t,e,i)=>{$Q(e),e.AutoCapture=e.runStatsigAutoCapture=e.StatsigAutoCapturePlugin=void 0;const c=i(6914),n=i(6325),s=i(6901);function r(t){return new o(t)}e.StatsigAutoCapturePlugin=class{constructor(){this.__plugin="auto-capture"}bind(t){r(t)}},e.runStatsigAutoCapture=r;class o{constructor(t){this.De=t,this.We=Date.now(),this.Ye=0,this.In={},this.Si=null;var{sdkKey:t,errorBoundary:e,values:i}=t.getContext(),i=(this.In=null!=(i=null==(i=null==i?void 0:i.auto_capture_settings)?void 0:i.disabled_events)?i:{},this.Wt=e,this.Wt.wrap(this),(0,c.Jt)());(0,c.Mt)()||((e=null!=(e=(__STATSIG__=(0,c.o)()).acInstances)?e:{})[t]=this,__STATSIG__.acInstances=e),"loading"===(null==i?void 0:i.readyState)?i.addEventListener("DOMContentLoaded",()=>this.Qe()):this.Qe()}Xe(){const e=(0,c.Lt)();var t,i=(0,c.Jt)();e&&i&&(t=t=>{this.Ze(t||e.event)},(0,n.ti)(i,"click",t),(0,n.ti)(i,"submit",t),(0,n.ti)(e,"error",t),(0,n.ti)(e,"beforeunload",()=>this.ei()),(0,n.ti)(e,"scroll",()=>this.ii()))}Oi(){var t=(0,c.Lt)(),e=(0,c.Jt)();t&&e&&((0,n.ti)(t,"popstate",()=>this.ji()),window.history.pushState=new Proxy(window.history.pushState,{apply:(t,e,[i,n,s])=>{t.apply(e,[i,n,s]),this.ji()}}),this.ji())}Ze(t){var e;let i=null==(e=t.type)?void 0:e.toLowerCase();"error"===i&&t instanceof ErrorEvent?this.ni(t):(e=(0,n.si)(t))&&(0,n.dt)(t,e)&&("submit"===i&&(i="form_submit"),{value:t,metadata:e}=(0,n.ri)(e),this.oi(i,t,e))}Qe(){this.Xe(),this.Oi(),this.ui(),this.ai()}ni(t){var e=(null==t?void 0:t.error)||{};let i=e;if("object"==typeof e)try{i=JSON.stringify(e)}catch(t){i="function"==typeof(null==e?void 0:e.toString)?e.toString():"Unknown Error"}this.oi("error",t.message,{message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error_str:i})}ui(){var t=this.ci();try{this.hi(t)&&this.oi("session_start",(0,n.di)(),{sessionID:t.data.sessionID},{flushImmediately:!0})}catch(t){this.Wt.logError("AC::logSession",t)}}ji(){var t=(0,n.vi)(),e=this.Si;e&&t.href===e.href||(this.Si=t,e=(0,s.fi)(t),this.oi("page_view",(0,n.di)(),e,{flushImmediately:!0,addNewSessionMetadata:!0}))}ai(){const i=(0,c.Lt)();void 0!==(null===i||void 0===i?void 0:i.performance)&&"function"==typeof i.performance.getEntriesByType&&"function"==typeof i.performance.getEntriesByName&&setTimeout(()=>{var t={},e=i.performance.getEntriesByType("navigation"),e=(e&&0{c.Log.error(t)})}catch(t){this.Wt.logError("AC::enqueue",t)}}}ii(){var t=null!=(t=null==(t=(0,c.Jt)())?void 0:t.body.scrollHeight)?t:1,e=(0,c.Lt)(),i=null!=(i=null==e?void 0:e.scrollY)?i:1,e=null!=(e=null==e?void 0:e.innerHeight)?e:1;this.Ye=Math.max(this.Ye,Math.min(100,Math.round((i+e)/t*100)))}hi(t){return Math.abs(t.data.startTime-Date.now())<1e3}ci(){return this.De.getContext().session}}e.AutoCapture=o},6325:(t,e,i)=>{$Q(e),e.gi=e.ti=e.di=e.vi=e.dt=e.si=e.ri=e.fn=void 0;const r=i(6914);function o(t){var e={};if(t){var i=null==t?void 0:t.dataset;if(i)for(const n in i)e["data-"+n]=i[n]||""}return e}function l(e){if(e){let t=e;for(;t;){var i=t.tagName.toLowerCase();if(["body","document"].includes(i))return null;if("a"===t.tagName.toLowerCase())return t;t=t.parentElement}}return null}e.fn=o,e.ri=function(t){var e=t.tagName.toLowerCase(),i={},n=(0,r.At)()||"",s=("form"===(i.tagName=e)&&(i.action=t.getAttribute("action"),i.method=null!=(s=t.getAttribute("method"))?s:"GET",i.formName=t.getAttribute("name"),i.formId=t.getAttribute("id")),["input","select","textarea"].includes(e)&&"password"!==t.getAttribute("type")&&(i.content=t.value,i.inputName=t.getAttribute("name")),l(t));return s&&(i.href=s.getAttribute("href")),"button"!==e&&!s||(i.content=(t.textContent||"").trim(),e=o(s||t),$P(i,e)),{value:n,metadata:i}},e.si=function(t){if(!t)return null;let e=t.target||t.srcElement;return e&&e instanceof Element?e=3===e.nodeType?e.parentNode||null:e:null},e.dt=function(t,e){if(!t||!e||1!==e.nodeType)return!1;var i=e.tagName.toLowerCase(),n=t.type.toLowerCase();switch(i){case"html":return!1;case"form":return"submit"===n;case"input":case"select":case"textarea":return["change"].includes(n);default:if("click"===n){if("button"===i)return!0;if(l(e))return!0}return!1}},e.vi=function(){var t=null!=(t=null==(t=null==(t=(0,r.Lt)())?void 0:t.location)?void 0:t.href)?t:"";let e;try{e=new URL(t)}catch(t){e=new URL("error:")}return e},e.di=function(){return(0,r.At)()||""},e.ti=function(t,e,i){t&&t.addEventListener&&t.addEventListener(e,i,!0)},e.gi=function(){var t=(0,r.Lt)();return t&&t.navigator&&t.navigator.connection||null}},1964:(t,e,i)=>{$Q(e),e.StatsigAutoCapturePlugin=e.runStatsigAutoCapture=e.AutoCapture=void 0;const n=i(4535);$Q2(e,"AutoCapture",{enumerable:!0,get:function(){return n.AutoCapture}}),$Q2(e,"StatsigAutoCapturePlugin",{enumerable:!0,get:function(){return n.StatsigAutoCapturePlugin}}),$Q2(e,"runStatsigAutoCapture",{enumerable:!0,get:function(){return n.runStatsigAutoCapture}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{AutoCapture:n.AutoCapture,runStatsigAutoCapture:n.runStatsigAutoCapture,StatsigAutoCapturePlugin:n.StatsigAutoCapturePlugin}),e.default=__STATSIG__},6901:(t,e,i)=>{$Q(e),e.fi=void 0;const a=i(6914);e.fi=function(t){var e=(0,a.Jt)(),i=(0,a.Lt)();if(!e||!i)return{};var n=null==i?void 0:i.navigator,s=(null==e?void 0:e.referrer)||"";let r=new URL("empty:");if(s)try{r=new URL(s||"empty:")}catch(t){}l=r,o=function(t){const e=t.hostname,i=["google","bing","yahoo","duckduckgo","baidu"].find(t=>e.includes(t+"."));return i||""}(l),l=l.searchParams.get("yahoo"===o?"p":"q")||"";var o={searchEngine:o,searchQuery:l},l=function(t){const i=t.searchParams,n={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","gclsrc","dclid","fbclid","msclkid","mc_eid","mc_cid","twclid","li_fat_id","igshid","utm_id","ttc","ttclid","ttc_id"].forEach(t=>{var e=i.get(t);e&&(n[t]=e)}),n}(t);const u={};return t.searchParams.forEach((t,e)=>{u[e]=t}),$P($P($P($P({},o),l),u),{title:(null==e?void 0:e.title)||"",locale:(null==n?void 0:n.language)||"unknown",hostname:t.hostname||"unknown",pathname:t.pathname||"unknown",referrer:s,screen_width:(null==(o=null==i?void 0:i.screen)?void 0:o.width)||"unknown",screen_height:(null==(l=null==i?void 0:i.screen)?void 0:l.height)||"unknown",viewport_width:(null==i?void 0:i.innerWidth)||"unknown",viewport_height:(null==i?void 0:i.innerHeight)||"unknown"})}}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var t={};{var e=t;const o=s(3447),l=s(1964);var r=s(2016);e.default=__STATSIG__,r.AutoInit.attempt(({client:t})=>{new o.SessionReplay(t),new l.AutoCapture(t)})}return t.default})()); \ No newline at end of file +!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("rrwebRecord")):"function"==typeof define&&define.amd?define(["rrwebRecord"],e):"object"==typeof exports?exports.Statsig=e(require("rrwebRecord")):t.Statsig=e(t.rrwebRecord)}(this,u=>(()=>{"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 i={3331:t=>{t.exports=u},1845:(t,i,e)=>{var n;$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.o=void 0;const s=e(7512);i.o=()=>__STATSIG__||u,i.i=t=>(0,i.o)()[t];i.t=t=>{var e=(0,i.o)();return t?e.instances&&e.instances[t]:(e.instances&&1{$Q(e),e.u=e.l=void 0;const s=i(1406);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=n,e.u=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},6427:(t,e)=>{$Q(e)},694:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const u=i(7512),a=i(9122),r=i(8578),o=i(4534),c=i(3401);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}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 n}attach(t,e){this.S=t,this.p=e}getDataSync(t){var t=t&&(0,r.A)(t,this.p),e=this.T(t),i=this.j.get(e,t);return i||((i=this.I(e))?(this.j.add(e,i),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,r.A)(e,this.p),i=this.T(e);this.j.add(i,h("Bootstrap",t,null,e))}M(e,i,n){return s(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(i),t=[this.D(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(u.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}k(i,n){return s(this,void 0,void 0,function*(){var t=i&&(0,r.A)(i,this.p),e=this.T(t),t=yield this.M(null,t,n);t&&this.j.add(e,$P($P({},t),{source:"Prefetch"}))})}D(r,o,l){return s(this,void 0,void 0,function*(){let t=null;r&&this.R(r,o)&&(t=r.data);var e=yield this.N(t,o,l);if(!e)return u.Log.debug("No response returned for latest value"),null;var i=(0,c.C)(e,"has_updates","Response"),n=this.P(),n=a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,o);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,o)}e=this.T(o);return this.j.add(e,s),this.G(e,s),s})}P(){return null!=this.S?this.S:(u.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=o.Storage.getItem)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){o.Storage.setItem(t,JSON.stringify(e)),this.K(t)}K(t){var e=null!=(e=(0,o.F)(this.O))?e:{},t=(e[t]=Date.now(),l(e,10));t&&(delete e[t],o.Storage.removeItem(t)),(0,o.J)(this.O,e)}};class n{constructor(){this.V={}}get(t,e){var t=this.V[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(u.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=l(this.V,9);i&&delete this.V[i],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function l(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt{$Q2(r,"__esModule",{value:!0}),r.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return $P({key:i,action:e,step:n,timestamp:Date.now()},t)}function o(t,e){var i=null!=(i=n.get(t))?i:[];i.push(e),n.set(t,i)}function e(t,e){if(e in t)return t[e]}r.Diagnostics={_n:t=>n.get(t),gn:t=>{o(t,s({},i,"overall"))},mn:(t,e,i)=>{o(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},bn:(t,e)=>{o(t,s(e,i,"initialize","network_request"))},pn:(t,e)=>{o(t,s(e,"end","initialize","network_request"))},yn:t=>{o(t,s({},i,"initialize","process"))},On:(t,e)=>{o(t,s(e,"end","initialize","process"))},jn:t=>{n.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,i,n){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===i.includes('"is_delta":true')||void 0,attempt:e,error:r.Diagnostics.Sn(n)}},Tn(t,e,i,n){var s=r.Diagnostics._n(i);null==s||s.length<=0||(r.Diagnostics.jn(i),i=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:n}),e.enqueue(i))}}},3539:(t,e)=>{$Q(e)},5542:function(t,l,e){var i=this&&this.__awaiter||$A();$Q2(l,"__esModule",{value:!0}),l.ErrorBoundary=l.EXCEPTION_ENDPOINT=void 0;const n=e(7512),u=e(5902),a=e(8e3),c=(l.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");l.ErrorBoundary=class{constructor(t,e,i){this.S=t,this.p=e,this.B=i,this.$=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.H(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.W(e,t)):i}catch(t){return this.W(e,t),null}}W(r,o){try{n.Log.warn("Caught error in "+r,{error:o});i(this,void 0,void 0,function*(){var t,e,i=o||Error(c),n=i instanceof Error,s=n?i.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:o,tag:r}):(t=u.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),n=n?i.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(i),i=JSON.stringify($P({tag:r,exception:s,info:n},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(n=null==(s=this.p)?void 0:s.networkConfig)?void 0:n.networkOverrideFunc)?s:fetch)(l.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:i}),null!=(n=this.B)&&n.call(this,{name:"error",error:o,tag:r})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},2922:(t,e)=>{$Q(e)},2417:(t,e)=>{$Q(e)},7770:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(2137),r=i(1406),o=i(7512),l=i(7410),u=i(6830),a=i(1637),c=i(4534),h=i(9638),d=i(2397),v={},_={Startup:"startup",GainedFocus:"gained_focus"};class f{static wi(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static Ti(t){null!=(t=v[t])&&t.ct(_.GainedFocus)}constructor(t,e,i,n){this.S=t,this.B=e,this.X=i,this.p=n,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),this.st=!0===(null==n?void 0:n.disableLogging),this.rt=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:50;e=null==n?void 0:n.networkConfig;this.ot=(0,h.ut)(null==e?void 0:e.logEventUrl,null==e?void 0:e.api,"/rgstr",l.NetworkDefault.eventsApi)}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this.ft(),this.Z.length>this.rt)&&f.wi(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}start(){(0,u.Mt)()||(v[this.S]=this,(0,d.lt)(t=>{"background"===t?f.wi(this.S):"foreground"===t&&f.Ti(this.S)}),this.ct(_.Startup),this.ht())}stop(){return n(this,void 0,void 0,function*(){this._t&&(clearInterval(this._t),this._t=null),delete v[this.S],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;this.gt(),0!==this.Z.length&&(t=this.Z,this.Z=[],yield this.bt(t))})}ft(){this.it||(this.it=!0,200f.wi(this.S),200)}dt(t){if((0,u.Mt)())return!1;if((0,a.yt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.l)(this.S,e),i=t.metadata||{},t=[t.eventName,e,i.gate,i.config,i.ruleID].join("|"),e=this.tt[t],i=Date.now();if(e&&i-e<6e4)return!1;1e3{o.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={},i=this.It(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));o.Log.debug("Enqueued Event:",i),this.Z.push(i)}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,u.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):f.wi(this.S)},t);this._t=e}}e.EventLogger=f},1406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.xt=r.Dt=r.h=void 0;const o=e(6634);r.h=e=>{let i=0;for(let t=0;t>>0)},r.Dt=(t,e)=>(0,r.h)(JSON.stringify((0,r.xt)(t,e)));r.xt=(i,n)=>{if(null==i)return null;var t=Object.keys(i).sort();const s={};return t.forEach(t=>{var e=i[t];0===n||"object"!==(0,o.kt)(e)?s[t]=e:s[t]=(0,r.xt)(e,null!=n?n-1:n)}),s}},1333:(t,e)=>{$Q(e)},7512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function i(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...i(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...i(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...i(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...i(t))}}(e.Log=n).level=e.LogLevel.Warn},7410:(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"}},7023:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(1845);const o=i(1845),b=i(8962),p=i(7512),l=i(7410),u=i(5902),a=i(6830),c=i(4143),h=i(9122),m=i(2636),d=i(8e3),y=i(2397),S=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(n){return r(this,void 0,void 0,function*(){var t,e,i;return!!O(n)&&(t=yield this.Nt(n),e=yield this.Gt(n),(i=navigator).sendBeacon.bind(i)(e,t))})}Pt(_){var f,g;return r(this,void 0,void 0,function*(){if(!O(_))return null;if(this.Rt.preventAllNetworkTraffic)return null;var{method:e,body:i,retries:n,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),o=yield this.Gt(_);let l=null;var u=(0,y.Ut)();try{var a,c,h,d={method:e,body:i,headers:$P({},_.headers),signal:null===r||void 0===r?void 0:r.signal,priority:_.priority,keepalive:u},v=(_.isInitialize&&b.Diagnostics.bn(_.sdkKey,{attempt:s}),null!=(f=this.Rt.networkOverrideFunc)?f:fetch);if(l=yield v(o,d),clearTimeout(t),l.ok)return h=yield l.text(),_.isInitialize&&b.Diagnostics.pn(_.sdkKey,b.Diagnostics.wn(l,s,h)),{body:h,code:l.status};throw a=yield l.text().catch(()=>"No Text"),(c=new Error(`NetworkError: ${o} `+a)).name="NetworkError",c}catch(t){i=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&&b.Diagnostics.pn(_.sdkKey,b.Diagnostics.wn(l,s,"",t)),!n||nencodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return i.url+(t?"?"+t:"")})}Nt(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,i=h.StableID.get(e),n=c.SessionID.get(e),e=u.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},d.StatsigMetadataProvider.get()),{stableID:i,sessionID:n,sdkType:e})}))})}Ct(t,e){var i,n,s=(0,a.Lt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,o.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(i=s.btoa(e).split("").reverse().join(""))?i:e;return t.params=$P($P({},null!=(n=t.params)?n:{}),{[l.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return p.Log.warn("/initialize request encoding failed"),e}}};const O=t=>!!t.sdkKey||(p.Log.warn("Unable to make request without an SDK key"),!1)},1405:(t,e)=>{$Q(e)},1361:(t,e)=>{$Q(e)},5902:(t,e)=>{$Q(e),e.SDKType=void 0;const i={};let n;e.SDKType={Y:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},Kt(t,e){i[t]=e},Ft(t){n&&"-react"!==n||(n="-"+t)}}},6830:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.At=n.qt=n.zt=n.Mt=n.Jt=n.Lt=void 0;n.Lt=()=>"undefined"!=typeof window?window:null,n.Jt=()=>{var t=(0,n.Lt)();return null!=(t=null==t?void 0:t.document)?t:null},n.Mt=()=>{var t;return null===(0,n.Jt)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},n.zt=(t,e)=>{var i=(0,n.Lt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.qt=(t,e)=>{var i=(0,n.Jt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)};n.At=()=>{var t;try{return null==(t=(0,n.Lt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},4143:(t,e,i)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(2137),r=i(7512),o=i(4534),l=i(8023),u=18e5,a=144e5,c={};function h(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function d(t){return"statsig.session_id."+(0,n.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=d(t);return(0,o.F)(t)}(t);var i=Date.now();e=e||{sessionID:(0,l.getUUID)(),startTime:i,lastUpdate:i};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),i=t.data,n=((function({lastUpdate:t}){return Date.now()-t>u}(i)||function({startTime:t}){return Date.now()-t>a}(i))&&(i.sessionID=(0,l.getUUID)(),i.startTime=e),i.lastUpdate=e,i),s=t.sdkKey;s=d(s);try{(0,o.J)(s,n)}catch(t){r.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=i.startTime,i=t.sdkKey,t.idleTimeoutID=h(i,u),t.ageTimeoutID=h(i,a-e),t},overrideInitialSessionID:(t,e)=>{var i;c[e]=(t=t,e=e,i=Date.now(),{data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e})}}},9122:(t,e,i)=>{$Q(e),e.StableID=void 0;const n=i(2137),s=i(7512),r=i(4534),o=i(8023),l={};function u(t){return"statsig.stable_id."+(0,n.u)(t)}function a(t,e){e=u(e);try{(0,r.J)(e,t)}catch(t){s.Log.warn("Failed to save StableID")}}e.StableID={get:e=>{if(null==l[e]){let t=function(t){t=u(t);return(0,r.F)(t)}(e);null==t&&a(t=(0,o.getUUID)(),e),l[e]=t}return l[e]},setOverride:(t,e)=>{a(l[e]=t,e)}}},1375:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(1845);const o=i(1845),l=i(5542),u=i(7770),a=i(7512),c=i(6830),h=i(4143),d=i(4534);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.xn=null,this.Vt={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&d.Storage.Bt(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),null!=n&&n.storageProvider&&d.Storage.de(n.storageProvider),this.S=t,this.p=null!=n?n:{},this.overrideAdapter=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.Ht=new u.EventLogger(t,r,i,n),this.Wt=new l.ErrorBoundary(t,n,r),this.Wt.wrap(this),this.Wt.wrap(i),this.Wt.wrap(e),this.Wt.wrap(this.Ht),this.dataAdapter=e,this.dataAdapter.attach(t,n),this.storageProvider=d.Storage,this.Yt(),s=t,r=this,(0,c.Mt)()||(i=(0,o.o)(),e=null!=(e=i.instances)?e:{},r=r,null!=e[s]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[s]=r,i.firstInstance||(i.firstInstance=r),i.instances=e,__STATSIG__=i)}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Ht.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,d.Storage.Bt(t.disableStorage))}flush(){return this.Ht.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.Qt("Uninitialized",null),this.xn=null,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(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.Wt.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.Vt[i.name]&&this.Vt[i.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,i){!0===(null==i?void 0:i.disableExposureLog)?this.Ht.incrementNonExposureCount(t):this.Ht.enqueue(e)}}},2636:(t,e)=>{$Q(e),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},3206:(t,e)=>{$Q(e),e.DataAdapterCachePrefix=void 0,e.DataAdapterCachePrefix="statsig.cached"},1637:(t,e)=>{$Q(e),e.Zt=e.te=e.ee=e.yt=void 0;const i="statsig::config_exposure",n="statsig::gate_exposure",u=(t,e,i,n,s)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:r(i,n),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===n||t===i,e.ee=(t,e)=>{return u(n,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 u(i,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,i)=>{var n,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let o="",l=null!=(n=null==s?void 0:s.undelegated_secondary_exposures)?n:[];return r&&(o=null!=(n=s.allocated_experiment_name)?n:"",l=s.secondary_exposures),u("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:i,ruleID:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)},l)};const r=(t,e)=>(e.reason=t.reason,t.lcut&&(e.lcut=String(t.lcut)),t.receivedAt&&(e.receivedAt=String(t.receivedAt)),e)},8e3:(t,e)=>{$Q(e),e.StatsigMetadataProvider=e.SDK_VERSION=void 0,e.SDK_VERSION="3.3.0";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},586:(t,e)=>{$Q(e)},1098:(t,e)=>{$Q(e)},2059:(t,e,i)=>{$Q(e),e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const r=i(6634),s="default";function o(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:s,__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},o(t,e,i,n)),{get:l(null==i?void 0:i.value)})}function l(n,s){return(t,e)=>{var i=null!=(i=null==n?void 0:n[t])?i:null;return null!=i&&(null==e||(0,r.le)(i,e))?(null!=s&&s(t),i):null!=e?e:null}}e.ue=function(t,e,i){return o(t,e,i,!0===(null==i?void 0:i.value))},e.oe=n,e.re=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.se=function(t,e,i,n){return $P($P({},o(t,e,i,void 0)),{get:l(null==i?void 0:i.value,n),groupName:null!=(t=null==i?void 0:i.group_name)?t:null,__value:null!=(e=null==i?void 0:i.value)?e:{}})},e.ne=function(t,e,i,n){return $P($P($P({},t),e),{get:l(i,n)})},e.ie=l},1812:(t,e)=>{$Q(e)},8578:(t,e,i)=>{$Q(e),e.v=e.A=void 0;const n=i(1406),s=i(7512);e.A=function(t,e){try{var i=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment&&(i.statsigEnvironment=e.environment),i}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,n.Dt)(t):null}},4534:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.J=i.F=i.Storage=void 0;var n=e(7512),e=e(6830);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 o=null;try{const a=(0,e.Lt)();a&&a.localStorage&&"function"==typeof a.localStorage.getItem&&(o={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){n.Log.warn("Failed to setup localStorageProvider.")}let l=null!==o&&void 0!==o?o:r,u=l;i.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:t=>{var e=()=>u.getItem(t);try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.de(r),null;throw t}},setItem:(t,e)=>u.setItem(t,e),removeItem:t=>u.removeItem(t),getAllKeys:()=>u.getAllKeys(),de:t=>{l=t,u=t},Bt:t=>{u=t?r:l}},i.F=function(t){return t=i.Storage.getItem(t),JSON.parse(null!=t?t:"null")},i.J=function(t,e){i.Storage.setItem(t,JSON.stringify(e))}},3401:(t,e,i)=>{$Q(e),e.C=void 0;const s=i(7512);e.C=function(t,e,i){try{var n=JSON.parse(t);return"object"==typeof n&&0 in n,n}catch(t){}return s.Log.error("Failed to parse "+i),null}},6634:(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 i=t=>Array.isArray(t)?"array":typeof t;return i(t)===i(e)}},8023:(t,e)=>{$Q(e),e.getUUID=void 0,e.getUUID=function(){if("undefined"!=typeof crypto&&"function"==typeof crypto.randomUUID)return crypto.randomUUID();let i=(new Date).getTime(),n="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{$Q(e),e.ut=void 0,e.ut=function(t,e,i,n){return t||(e?""+e+i:""+n+i)}},2397:(t,e,i)=>{$Q(e),e.ve=e.lt=e.Ut=e.Ot=void 0;i=i(6830);const n="foreground",s="background",r=[];let o=n,l=!1;e.Ot=()=>o===n,e.Ut=()=>l,e.lt=t=>{r.unshift(t)};e.ve=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,i.zt)("focus",()=>{(l=!1,e.ve)(n)}),(0,i.zt)("blur",()=>(0,e.ve)(s)),(0,i.zt)("beforeunload",()=>{l=!0,(0,e.ve)(s)}),(0,i.qt)("visibilitychange",()=>{(0,e.ve)("visible"===document.visibilityState?n:s)})},6914:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,i(1845);const r=i(8962),o=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return r.Diagnostics}}),i(7770)),l=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}}),i(7512));$Q2(e,"Log",{enumerable:!0,get:function(){return l.Log}});var u=i(8e3);const a=i(4534);$Q2(e,"Storage",{enumerable:!0,get:function(){return a.Storage}}),s(i(1845),e),s(i(2137),e),s(i(6427),e),s(i(694),e),s(i(8962),e),s(i(3539),e),s(i(5542),e),s(i(2922),e),s(i(2417),e),s(i(1406),e),s(i(1333),e),s(i(7512),e),s(i(7023),e),s(i(7410),e),s(i(1405),e),s(i(1361),e),s(i(6830),e),s(i(5902),e),s(i(4143),e),s(i(9122),e),s(i(1375),e),s(i(2636),e),s(i(3206),e),s(i(1637),e),s(i(8e3),e),s(i(586),e),s(i(2059),e),s(i(1812),e),s(i(8578),e),s(i(1098),e),s(i(4534),e),s(i(3401),e),s(i(6634),e),s(i(9638),e),s(i(8023),e),s(i(2397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},2016:(t,e,i)=>{$Q(e),e.AutoInit=void 0;const v=i(6914),_=i(2018);function f(t,e){var i;return null!=(i=e.get(t))?i:e.get(t.toLowerCase())}e.AutoInit=class{static attempt(e){var t,i,n;try{var s=(0,v.Lt)(),r=(0,v.Jt)();if(s&&r&&r.currentScript){var o=r.currentScript.getAttribute("src"),l=null==(t=s.location)?void 0:t.href;if(o&&l){var u=new URL(o,l).searchParams,a=null!=(i=f("sdkKey",u))?i:f("apiKey",u);if(a){var c={},h=f("proxy",u),d=(h&&(c.networkConfig={api:h}),null==(n=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instances)?void 0:n[a]);let t=null;(t=d instanceof _.StatsigClient?d:t)||(t=new _.StatsigClient(a,function(){var t=(0,v.Lt)();if(!t)return{};let e=t.statsigUser||{};var i=(e="object"!=typeof e?{}:e).custom||{},n=e.customIDs||{};return $P($P({},e),{customIDs:$P({},n),custom:$P($P({},i),{useragent:t.navigator.userAgent,page_url:(0,v.At)()||"",language:null==(n=t.navigator)?void 0:n.language})})}(),c)).initializeAsync().catch(t=>{v.Log.error(t)}),e({sdkKey:a,client:t})}}}}catch(t){v.Log.error("AutoInit failed",t)}}}},7262:(t,e,i)=>{$Q(e),e.fe=void 0;const n=i(6914);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.fe=function(t,e){var i;return(e=(0,n.C)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.Dt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===e.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},4845:(t,e,i)=>{$Q(e);const s=i(6914);e.default=class{constructor(t){this.S=t,this._e=null,this.ge=null,this.be="Uninitialized",this.ye=0,this.me=0,this.bi=null,this.mi=new Set}reset(){this.ge=null,this._e=null,this.be="Loading",this.ye=0,this.me=0,this.bi=null}finalize(){this.ge||(this.be="NoValues")}getValues(){return this._e?(0,s.C)(this._e,"has_updates","EvaluationStoreValues"):null}setValues(t,e){var i;return!!t&&null!=(i=(0,s.C)(t.data,"has_updates","EvaluationResponse"))&&(this.be=t.source,!0===(null==i?void 0:i.has_updates)&&(this._e=t.data,this.ye=i.time,this.me=t.receivedAt,this.ge=i,this.bi=this.pi(t.source,i),t.source)&&i.user&&this.yi(e,i),!0)}getGate(t){var e;return this.pe(null==(e=this.ge)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.pe(null==(e=this.ge)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.pe(null==(e=this.ge)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.pe(null==(e=this.ge)?void 0:e.param_stores,t)}pi(t,e){return"Bootstrap"!==t?null:(t={},e.user&&(t.user=e.user),e.sdkInfo&&(t.generatorSDKInfo=e.sdkInfo),t.lcut=e.time,t)}pe(t,e){let i=null;return{result:i=t?t[e]||t[(0,s.h)(e)]:i,details:this.Se(null==i)}}yi(t,e){var i,n=s.StableID.get(this.S);(null==(i=t.customIDs)?void 0:i.stableID)!==n?this.mi.add("StableIDMismatch"):"user"in e&&(i=e.user,(0,s.v)(t)!==(0,s.v)(i))&&this.mi.add("PartialUserMatch")}getCurrentSourceDetails(){var t;return"Uninitialized"===this.be||"NoValues"===this.be?{reason:this.be}:(t={reason:this.be,lcut:this.ye,receivedAt:this.me},0{$Q(e),e.Te=void 0;const g=i(6914),b={disableExposureLog:!0};function p(t){return null==t||!1===t.disableExposureLog}function m(t,e){return null!=e&&!(0,g.le)(t,e)}e.Te=function(v,_,f){return(t,e)=>{if(null==_)return e;var i,n,s,r,o,l,u,a,c,h,d=_[t];if(null==d||null!=e&&(0,g.kt)(e)!==d.param_type)return e;switch(d.ref_type){case"static":return d.value;case"gate":return h=d,v.getFeatureGate(h.gate_name,p(f)?void 0:b).value?h.pass_value:h.fail_value;case"dynamic_config":return h=d,u=e,a=f,m(c=(l=v).getDynamicConfig(h.config_name,b).get(h.param_name),u)?u:(p(a)&&l.getDynamicConfig(h.config_name),c);case"experiment":return u=d,a=e,l=f,m(o=(c=v).getExperiment(u.experiment_name,b).get(u.param_name),a)?a:(p(l)&&c.getExperiment(u.experiment_name),o);case"layer":return o=d,n=e,s=f,m(r=(i=v).getLayer(o.layer_name,b).get(o.param_name),n)?n:(p(s)&&i.getLayer(o.layer_name).get(o.param_name),r);default:return e}}}},8198:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e);const o=i(6914),l=i(4845),u=i(8448),r=i(3583),a=i(4131);class n extends o.StatsigClientBase{static instance(t){var e=(0,o.o)().instance(t);return e instanceof n?e:(o.Log.warn((0,o.Mt)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){o.SDKType.Kt(t,"javascript-client");var n,s=new u.default(i,t=>{this.$emt(t)}),s=(super(t,null!=(n=null==i?void 0:i.dataAdapter)?n:new a.StatsigEvaluationsDataAdapter,s,i),this.we=new l.default(t),this.Ie=(0,o.A)(e,i),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const r of s)r.bind(this)}initializeSync(t){"Uninitialized"===this.loadingStatus&&(this.Ht.start(),this.updateUserSync(this.Ie,t))}initializeAsync(t){return s(this,void 0,void 0,function*(){return this.xn||(this.xn=this.Dn(t)),this.xn})}updateUserSync(t,e){this.Ae(t);t=this.dataAdapter.getDataSync(this.Ie),this.we.setValues(t,this.Ie),this.Me(t),e=null==e?void 0:e.disableBackgroundCacheRefresh;!0===e||null==e&&"Bootstrap"===(null==t?void 0:t.source)||this.xe(null!=t?t:null,this.Ie)}updateUserAsync(i,n){return s(this,void 0,void 0,function*(){this.Ae(i);var t=this.Ie,e=(o.Diagnostics.gn(this.S),this.dataAdapter.getDataSync(t));if(this.we.setValues(e,this.Ie),this.Qt("Loading",e),e=yield this.dataAdapter.getDataAsync(e,t,n),t===this.Ie){let t=!1;null!=e&&(o.Diagnostics.yn(this.S),t=this.we.setValues(e,this.Ie),o.Diagnostics.On(this.S,{success:t})),this.Me(e),t||this.$emt({name:"initialization_failure"}),o.Diagnostics.mn(this.S,t,this.we.getCurrentSourceDetails()),o.Diagnostics.Tn(this.Ie,this.Ht,this.S,this.p)}})}getContext(){return{sdkKey:this.S,options:this.p,values:this.we.getValues(),user:JSON.parse(JSON.stringify(this.Ie)),errorBoundary:this.Wt,session:o.StatsigSession.get(this.S),stableID:o.StableID.get(this.S)}}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:i,details:n}=this.we.getGate(t),n=(0,o.ue)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.ee)(this.Ie,i),e),this.$emt({name:"gate_evaluation",gate:i}),i}getDynamicConfig(t,e){var{result:i,details:n}=this.we.getConfig(t),n=(0,o.oe)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.te)(this.Ie,i),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e){var{result:i,details:n}=this.we.getConfig(t),n=(0,o.re)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.te)(this.Ie,i),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,i){var{result:t,details:n}=this.we.getLayer(e),n=(0,o.se)(e,n,t),s=null==(s=null==(t=this.overrideAdapter)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.Ie,i);const r=(0,o.ne)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{this.Xt(e,(0,o.Zt)(this.Ie,r,t),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:i,details:n}=this.we.getParamStore(t);return this.Ht.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,r.Te)(this,i,e)}}logEvent(t,e,i){this.Ht.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:i}:t),{user:this.Ie,time:Date.now()}))}Yt(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Me(null)})}Dn(t){return s(this,void 0,void 0,function*(){return o.Storage.isReady()||(yield o.Storage.isReadyResolver()),this.Ht.start(),this.updateUserAsync(this.Ie,t)})}Me(t){this.we.finalize(),this.Qt("Ready",t)}xe(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}Ae(t){this.Ht.reset(),this.we.reset(),this.Ie=(0,o.A)(t,this.p);t=null==(t=this.Ie.customIDs)?void 0:t.stableID;t&&o.StableID.setOverride(t,this.S)}}e.default=n},4131:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(6914),s=i(8448);class o extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.X=null,this.p=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.M(t,(0,n.A)(e,this.p),i)}prefetchData(t,e){return this.k(t,e)}setData(t){var e=(0,n.C)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(t,e){super.setData(t,e)}N(e,i,n){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.X)?void 0:s.fetchEvaluations(this.P(),e,null==n?void 0:n.priority,i);return null!=t?t:null})}T(t){t=(0,n.u)(this.P(),t,null==(t=this.p)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=o},2018:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.StatsigClient=void 0,i(8198));e.StatsigClient=r.default,s(i(6914),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:r.default}),e.default=__STATSIG__},8788:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.SessionReplay=e.runStatsigSessionReplay=e.StatsigSessionReplayPlugin=void 0;const s=i(6914),r=i(759);function o(t,e){new l(t,e)}e.StatsigSessionReplayPlugin=class{constructor(t){this.options=t,this.__plugin="session-replay"}bind(t){o(t,this.options)}},e.runStatsigSessionReplay=o;class l{constructor(t,e){this.De=t,this.p=e,this.ke=null,this.Ee=[];var{sdkKey:e,errorBoundary:t}=t.getContext();this.Wt=t,this.Wt.wrap(this),(0,s.Mt)()||((t=(0,s.o)()).srInstances=$P($P({},t.srInstances),{[e]:this})),this.Re=this.Ne(),this.Ce=new r.SessionReplayClient,this.De.$on("pre_shutdown",()=>this.Pe()),this.De.$on("values_updated",()=>{var t;return this.Ge(null==(t=this.p)?void 0:t.forceRecording)}),this.De.on("session_expired",()=>{this.Ce.stop(),s.StatsigMetadataProvider.add({isRecordingSession:"false"}),this.Ue("session_expired"),this.Re=this.Ne()}),this.Le(),this.Ge(null==(t=this.p)?void 0:t.forceRecording)}Le(){const i=this.De.getContext()["sdkKey"];(0,s.lt)(t=>{var e=null==(e=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.srInstances)?void 0:e[i];e instanceof l&&e.Ke(t)})}forceStartRecording(){this.Ge(!0)}Ke(t){"background"===t&&(this.Ue(),this.De.flush().catch(t=>{this.Wt.logError("SR::visibility",t)}))}Fe(t,e){this.ke=e,this.Ee.push(t),2048this.Fe(t,e),null!=(e=null==(t=this.p)?void 0:t.rrwebConfig)?e:{})):this.Pe()}Pe(){this.Ce.stop(),s.StatsigMetadataProvider.add({isRecordingSession:"false"}),0!==this.Ee.length&&null!=this.ke&&this.qe()}Ue(e){0!==this.Ee.length&&null!=this.ke&&(e=(0,s.Ut)()?"is_leaving_page":e,this.Re.then(t=>this.ze(t,e)).catch(t=>{this.Wt.logError("SR::flush",t)}))}ze(t,e){var i,n=this.ke;null!==n&&0!==this.Ee.length&&(i=JSON.stringify(this.Ee),t={eventName:"statsig::session_recording",value:t,metadata:{session_start_ts:String(n.startTime),session_end_ts:String(n.endTime),clicks_captured_cumulative:String(n.clickCount),rrweb_events:i,rrweb_payload_size:String(i.length),session_replay_sdk_version:s.SDK_VERSION}},e&&(t.metadata[e]="true"),this.De.logEvent(t),this.Ee=[])}qe(){this.Re=this.Ne(),this.Ue()}Ne(){return n(this,void 0,void 0,function*(){return this.De.getContext().session.data.sessionID})}}e.SessionReplay=l},759:(t,e,i)=>{$Q(e),e.SessionReplayClient=void 0;const n=i(3331),s=i(6914);e.SessionReplayClient=class{constructor(){this.Je=null,this.Ve=null,this.Be=0}record(i,t,e){null==(0,s.Jt)()||(this.Je=null,this.Ve=null,this.Be=0,this.$e=e,this.He)||(this.He=(e=t=>{var e;null==this.Je&&(this.Je=t.timestamp),this.Ve=t.timestamp,3!==(e=t).type||2!==e.data.source||2!==e.data.type&&4!==e.data.type||this.Be++,i(t,{startTime:this.Je,endTime:this.Ve,clickCount:this.Be}),144e5{$Q(e),e.StatsigSessionReplayPlugin=e.runStatsigSessionReplay=e.SessionReplay=e.SessionReplayClient=void 0;const n=i(8788),s=($Q2(e,"SessionReplay",{enumerable:!0,get:function(){return n.SessionReplay}}),$Q2(e,"StatsigSessionReplayPlugin",{enumerable:!0,get:function(){return n.StatsigSessionReplayPlugin}}),$Q2(e,"runStatsigSessionReplay",{enumerable:!0,get:function(){return n.runStatsigSessionReplay}}),i(759));$Q2(e,"SessionReplayClient",{enumerable:!0,get:function(){return s.SessionReplayClient}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{SessionReplayClient:s.SessionReplayClient,SessionReplay:n.SessionReplay,runStatsigSessionReplay:n.runStatsigSessionReplay,StatsigSessionReplayPlugin:n.StatsigSessionReplayPlugin})},4535:(t,e,i)=>{$Q(e),e.AutoCapture=e.runStatsigAutoCapture=e.StatsigAutoCapturePlugin=void 0;const c=i(6914),n=i(6325),s=i(6901);function r(t){return new o(t)}e.StatsigAutoCapturePlugin=class{constructor(){this.__plugin="auto-capture"}bind(t){r(t)}},e.runStatsigAutoCapture=r;class o{constructor(t){this.De=t,this.We=Date.now(),this.Ye=0,this.In={},this.Si=null;var{sdkKey:t,errorBoundary:e,values:i}=t.getContext(),i=(this.In=null!=(i=null==(i=null==i?void 0:i.auto_capture_settings)?void 0:i.disabled_events)?i:{},this.Wt=e,this.Wt.wrap(this),(0,c.Jt)());(0,c.Mt)()||((e=null!=(e=(__STATSIG__=(0,c.o)()).acInstances)?e:{})[t]=this,__STATSIG__.acInstances=e),"loading"===(null==i?void 0:i.readyState)?i.addEventListener("DOMContentLoaded",()=>this.Qe()):this.Qe()}Xe(){const e=(0,c.Lt)();var t,i=(0,c.Jt)();e&&i&&(t=t=>{this.Ze(t||e.event)},(0,n.ti)(i,"click",t),(0,n.ti)(i,"submit",t),(0,n.ti)(e,"error",t),(0,n.ti)(e,"beforeunload",()=>this.ei()),(0,n.ti)(e,"scroll",()=>this.ii()))}Oi(){var t=(0,c.Lt)(),e=(0,c.Jt)();t&&e&&((0,n.ti)(t,"popstate",()=>this.ji()),window.history.pushState=new Proxy(window.history.pushState,{apply:(t,e,[i,n,s])=>{t.apply(e,[i,n,s]),this.ji()}}),this.ji())}Ze(t){var e;let i=null==(e=t.type)?void 0:e.toLowerCase();"error"===i&&t instanceof ErrorEvent?this.ni(t):(e=(0,n.si)(t))&&(0,n.dt)(t,e)&&("submit"===i&&(i="form_submit"),{value:t,metadata:e}=(0,n.ri)(e),this.oi(i,t,e))}Qe(){this.Xe(),this.Oi(),this.ui(),this.ai()}ni(t){var e=(null==t?void 0:t.error)||{};let i=e;if("object"==typeof e)try{i=JSON.stringify(e)}catch(t){i="function"==typeof(null==e?void 0:e.toString)?e.toString():"Unknown Error"}this.oi("error",t.message,{message:t.message,filename:t.filename,lineno:t.lineno,colno:t.colno,error_str:i})}ui(){var t=this.ci();try{this.hi(t)&&this.oi("session_start",(0,n.di)(),{sessionID:t.data.sessionID},{flushImmediately:!0})}catch(t){this.Wt.logError("AC::logSession",t)}}ji(){var t=(0,n.vi)(),e=this.Si;e&&t.href===e.href||(this.Si=t,e=(0,s.fi)(t),this.oi("page_view",(0,n.di)(),e,{flushImmediately:!0,addNewSessionMetadata:!0}))}ai(){const i=(0,c.Lt)();void 0!==(null===i||void 0===i?void 0:i.performance)&&"function"==typeof i.performance.getEntriesByType&&"function"==typeof i.performance.getEntriesByName&&setTimeout(()=>{var t={},e=i.performance.getEntriesByType("navigation"),e=(e&&0{c.Log.error(t)})}catch(t){this.Wt.logError("AC::enqueue",t)}}}ii(){var t=null!=(t=null==(t=(0,c.Jt)())?void 0:t.body.scrollHeight)?t:1,e=(0,c.Lt)(),i=null!=(i=null==e?void 0:e.scrollY)?i:1,e=null!=(e=null==e?void 0:e.innerHeight)?e:1;this.Ye=Math.max(this.Ye,Math.min(100,Math.round((i+e)/t*100)))}hi(t){return Math.abs(t.data.startTime-Date.now())<1e3}ci(){return this.De.getContext().session}}e.AutoCapture=o},6325:(t,e,i)=>{$Q(e),e.gi=e.ti=e.di=e.vi=e.dt=e.si=e.ri=e.fn=void 0;const r=i(6914);function o(t){var e={};if(t){var i=null==t?void 0:t.dataset;if(i)for(const n in i)e["data-"+n]=i[n]||""}return e}function l(e){if(e){let t=e;for(;t;){var i=t.tagName.toLowerCase();if(["body","document"].includes(i))return null;if("a"===t.tagName.toLowerCase())return t;t=t.parentElement}}return null}e.fn=o,e.ri=function(t){var e=t.tagName.toLowerCase(),i={},n=(0,r.At)()||"",s=("form"===(i.tagName=e)&&(i.action=t.getAttribute("action"),i.method=null!=(s=t.getAttribute("method"))?s:"GET",i.formName=t.getAttribute("name"),i.formId=t.getAttribute("id")),["input","select","textarea"].includes(e)&&"password"!==t.getAttribute("type")&&(i.content=t.value,i.inputName=t.getAttribute("name")),l(t));return s&&(i.href=s.getAttribute("href")),"button"!==e&&!s||(i.content=(t.textContent||"").trim(),e=o(s||t),$P(i,e)),{value:n,metadata:i}},e.si=function(t){if(!t)return null;let e=t.target||t.srcElement;return e&&e instanceof Element?e=3===e.nodeType?e.parentNode||null:e:null},e.dt=function(t,e){if(!t||!e||1!==e.nodeType)return!1;var i=e.tagName.toLowerCase(),n=t.type.toLowerCase();switch(i){case"html":return!1;case"form":return"submit"===n;case"input":case"select":case"textarea":return["change"].includes(n);default:if("click"===n){if("button"===i)return!0;if(l(e))return!0}return!1}},e.vi=function(){var t=null!=(t=null==(t=null==(t=(0,r.Lt)())?void 0:t.location)?void 0:t.href)?t:"";let e;try{e=new URL(t)}catch(t){e=new URL("error:")}return e},e.di=function(){return(0,r.At)()||""},e.ti=function(t,e,i){t&&t.addEventListener&&t.addEventListener(e,i,!0)},e.gi=function(){var t=(0,r.Lt)();return t&&t.navigator&&t.navigator.connection||null}},1964:(t,e,i)=>{$Q(e),e.StatsigAutoCapturePlugin=e.runStatsigAutoCapture=e.AutoCapture=void 0;const n=i(4535);$Q2(e,"AutoCapture",{enumerable:!0,get:function(){return n.AutoCapture}}),$Q2(e,"StatsigAutoCapturePlugin",{enumerable:!0,get:function(){return n.StatsigAutoCapturePlugin}}),$Q2(e,"runStatsigAutoCapture",{enumerable:!0,get:function(){return n.runStatsigAutoCapture}}),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{AutoCapture:n.AutoCapture,runStatsigAutoCapture:n.runStatsigAutoCapture,StatsigAutoCapturePlugin:n.StatsigAutoCapturePlugin}),e.default=__STATSIG__},6901:(t,e,i)=>{$Q(e),e.fi=void 0;const a=i(6914);e.fi=function(t){var e=(0,a.Jt)(),i=(0,a.Lt)();if(!e||!i)return{};var n=null==i?void 0:i.navigator,s=(null==e?void 0:e.referrer)||"";let r=new URL("empty:");if(s)try{r=new URL(s||"empty:")}catch(t){}l=r,o=function(t){const e=t.hostname,i=["google","bing","yahoo","duckduckgo","baidu"].find(t=>e.includes(t+"."));return i||""}(l),l=l.searchParams.get("yahoo"===o?"p":"q")||"";var o={searchEngine:o,searchQuery:l},l=function(t){const i=t.searchParams,n={};return["utm_source","utm_medium","utm_campaign","utm_term","utm_content","gclid","gclsrc","dclid","fbclid","msclkid","mc_eid","mc_cid","twclid","li_fat_id","igshid","utm_id","ttc","ttclid","ttc_id"].forEach(t=>{var e=i.get(t);e&&(n[t]=e)}),n}(t);const u={};return t.searchParams.forEach((t,e)=>{u[e]=t}),$P($P($P($P({},o),l),u),{title:(null==e?void 0:e.title)||"",locale:(null==n?void 0:n.language)||"unknown",hostname:t.hostname||"unknown",pathname:t.pathname||"unknown",referrer:s,screen_width:(null==(o=null==i?void 0:i.screen)?void 0:o.width)||"unknown",screen_height:(null==(l=null==i?void 0:i.screen)?void 0:l.height)||"unknown",viewport_width:(null==i?void 0:i.innerWidth)||"unknown",viewport_height:(null==i?void 0:i.innerHeight)||"unknown"})}}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[t].call(e.exports,e,e.exports,s)),e.exports}s.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}();var t={};{var e=t;const o=s(3447),l=s(1964);var r=s(2016);e.default=__STATSIG__,r.AutoInit.attempt(({client:t})=>{new o.SessionReplay(t),new l.AutoCapture(t)})}return t.default})()); \ No newline at end of file diff --git a/samples/web-minified/src/assets/statsig-js-client.min.js b/samples/web-minified/src/assets/statsig-js-client.min.js index 88011c55..ebb8417d 100644 --- a/samples/web-minified/src/assets/statsig-js-client.min.js +++ b/samples/web-minified/src/assets/statsig-js-client.min.js @@ -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 i={845:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.o=void 0,i.o=()=>__STATSIG__||u,i.i=t=>(0,i.o)()[t];i.t=t=>{var e=(0,i.o)();return t?e.instances&&e.instances[t]:e.lastInstance};var n,s="__STATSIG__",r="undefined"!=typeof window?window:{},e=void 0!==e.g?e.g:{},o="undefined"!=typeof globalThis?globalThis:{};const u=null!=(n=null!=(n=null!=(n=r[s])?n:e[s])?n:o[s])?n:{instance:i.t};r[s]=u,e[s]=u,o[s]=u},137:(t,e,i)=>{$Q(e),e.u=e.l=void 0;const s=i(406);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=n,e.u=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},427:(t,e)=>{$Q(e)},694:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const l=i(512),a=i(122),r=i(578),o=i(534),c=i(401);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}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 n}attach(t,e){this.S=t,this.p=e}getDataSync(t){var t=t&&(0,r.A)(t,this.p),e=this.T(t),i=this.j.get(e,t);return i||((i=this.I(e))?(this.j.add(e,i),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,r.A)(e,this.p),i=this.T(e);this.j.add(i,h("Bootstrap",t,null,e))}M(e,i,n){return s(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(i),t=[this.D(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(l.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}k(i,n){return s(this,void 0,void 0,function*(){var t=i&&(0,r.A)(i,this.p),e=this.T(t),t=yield this.M(null,t,n);t&&this.j.add(e,$P($P({},t),{source:"Prefetch"}))})}D(r,o,u){return s(this,void 0,void 0,function*(){let t=null;r&&this.R(r,o)&&(t=r.data);var e=yield this.N(t,o,u);if(!e)return l.Log.debug("No response returned for latest value"),null;var i=(0,c.C)(e,"has_updates","Response"),n=this.P(),n=a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,o);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,o)}e=this.T(o);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=o.Storage.getItem)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){o.Storage.setItem(t,JSON.stringify(e)),this.K(t)}K(t){var e=null!=(e=(0,o.F)(this.O))?e:{},t=(e[t]=Date.now(),u(e,10));t&&(delete e[t],o.Storage.removeItem(t)),(0,o.J)(this.O,e)}};class n{constructor(){this.V={}}get(t,e){var t=this.V[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(l.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=u(this.V,9);i&&delete this.V[i],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function u(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt{$Q2(r,"__esModule",{value:!0}),r.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return $P({key:i,action:e,step:n,timestamp:Date.now()},t)}function o(t,e){var i=null!=(i=n.get(t))?i:[];i.push(e),n.set(t,i)}function e(t,e){if(e in t)return t[e]}r.Diagnostics={_n:t=>n.get(t),gn:t=>{o(t,s({},i,"overall"))},mn:(t,e,i)=>{o(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},bn:(t,e)=>{o(t,s(e,i,"initialize","network_request"))},pn:(t,e)=>{o(t,s(e,"end","initialize","network_request"))},yn:t=>{o(t,s({},i,"initialize","process"))},On:(t,e)=>{o(t,s(e,"end","initialize","process"))},jn:t=>{n.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,i,n){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===i.includes('"is_delta":true')||void 0,attempt:e,error:r.Diagnostics.Sn(n)}},Tn(t,e,i,n){var s=r.Diagnostics._n(i);null==s||s.length<=0||(r.Diagnostics.jn(i),i=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:n}),e.enqueue(i))}}},539:(t,e)=>{$Q(e)},542:function(t,u,e){var i=this&&this.__awaiter||$A();$Q2(u,"__esModule",{value:!0}),u.ErrorBoundary=u.EXCEPTION_ENDPOINT=void 0;const n=e(512),l=e(902),a=e(0),c=(u.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");u.ErrorBoundary=class{constructor(t,e,i){this.S=t,this.p=e,this.B=i,this.$=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.H(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.W(e,t)):i}catch(t){return this.W(e,t),null}}W(r,o){try{n.Log.warn("Caught error in "+r,{error:o});i(this,void 0,void 0,function*(){var t,e,i=o||Error(c),n=i instanceof Error,s=n?i.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:o}):(t=l.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),n=n?i.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(i),i=JSON.stringify($P({tag:r,exception:s,info:n},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(n=null==(s=this.p)?void 0:s.networkConfig)?void 0:n.networkOverrideFunc)?s:fetch)(u.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:i}),null!=(n=this.B)&&n.call(this,{name:"error",error:o})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},922:(t,e)=>{$Q(e)},417:(t,e)=>{$Q(e)},770:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(137),r=i(406),o=i(512),u=i(410),l=i(830),a=i(637),c=i(534),h=i(638),d=i(397),v={},f={Startup:"startup",GainedFocus:"gained_focus"};class _{static wi(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static Ti(t){null!=(t=v[t])&&t.ct(f.GainedFocus)}constructor(t,e,i,n){this.S=t,this.B=e,this.X=i,this.p=n,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),this.st=!0===(null==n?void 0:n.disableLogging),this.rt=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:50;e=null==n?void 0:n.networkConfig;this.ot=(0,h.ut)(null==e?void 0:e.logEventUrl,null==e?void 0:e.api,"/rgstr",u.NetworkDefault.eventsApi)}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this.ft(),this.Z.length>this.rt)&&_.wi(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,d.lt)(t=>{"background"===t?_.wi(this.S):"foreground"===t&&_.Ti(this.S)}),this.ct(f.Startup),this.ht())}stop(){return n(this,void 0,void 0,function*(){this._t&&(clearInterval(this._t),this._t=null),delete v[this.S],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;this.gt(),0!==this.Z.length&&(t=this.Z,this.Z=[],yield this.bt(t))})}ft(){this.it||(this.it=!0,200_.wi(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),i=t.metadata||{},t=[t.eventName,e,i.gate,i.config,i.ruleID].join("|"),e=this.tt[t],i=Date.now();if(e&&i-e<6e4)return!1;1e3{o.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={},i=this.It(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));o.Log.debug("Enqueued Event:",i),this.Z.push(i)}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):_.wi(this.S)},t);this._t=e}}e.EventLogger=_},406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.xt=r.Dt=r.h=void 0;const o=e(634);r.h=e=>{let i=0;for(let t=0;t>>0)},r.Dt=(t,e)=>(0,r.h)(JSON.stringify((0,r.xt)(t,e)));r.xt=(i,n)=>{if(null==i)return null;var t=Object.keys(i).sort();const s={};return t.forEach(t=>{var e=i[t];0===n||"object"!==(0,o.kt)(e)?s[t]=e:s[t]=(0,r.xt)(e,null!=n?n-1:n)}),s}},333:(t,e)=>{$Q(e)},512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function i(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...i(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...i(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...i(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...i(t))}}(e.Log=n).level=e.LogLevel.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,i){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(845);const o=i(845),b=i(962),p=i(512),u=i(410),l=i(902),a=i(830),c=i(143),h=i(122),d=i(0),y=i(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(n){return r(this,void 0,void 0,function*(){var t,e,i;return!!O(n)&&(t=yield this.Nt(n),e=yield this.Gt(n),(i=navigator).sendBeacon.bind(i)(e,t))})}Pt(f){var _,g;return r(this,void 0,void 0,function*(){if(!O(f))return null;if(this.Rt.preventAllNetworkTraffic)return null;var{method:e,body:i,retries:n,attempt:s}=f,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),o=yield this.Gt(f);let u=null;var l=(0,y.Ut)();try{var a,c,h,d={method:e,body:i,headers:$P({},f.headers),signal:null===r||void 0===r?void 0:r.signal,priority:f.priority,keepalive:l},v=(f.isInitialize&&b.Diagnostics.bn(f.sdkKey,{attempt:s}),null!=(_=this.Rt.networkOverrideFunc)?_:fetch);if(u=yield v(o,d),clearTimeout(t),u.ok)return h=yield u.text(),f.isInitialize&&b.Diagnostics.pn(f.sdkKey,b.Diagnostics.wn(u,s,h)),{body:h,code:u.status};throw a=yield u.text().catch(()=>"No Text"),(c=new Error(`NetworkError: ${o} `+a)).name="NetworkError",c}catch(t){i=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 f.isInitialize&&b.Diagnostics.pn(f.sdkKey,b.Diagnostics.wn(u,s,"",t)),!n||nencodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return i.url+(t?"?"+t:"")})}Nt(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,i=h.StableID.get(e),n=c.SessionID.get(e),e=l.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},d.StatsigMetadataProvider.get()),{stableID:i,sessionID:n,sdkType:e})}))})}Ct(t,e){var i,n,s=(0,a.Lt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,o.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(i=s.btoa(e).split("").reverse().join(""))?i:e;return t.params=$P($P({},null!=(n=t.params)?n:{}),{[u.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return p.Log.warn("/initialize request encoding failed"),e}}};const O=t=>!!t.sdkKey||(p.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 i={};let n;e.SDKType={Y:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},Kt(t,e){i[t]=e},Ft(t){n&&"-react"!==n||(n="-"+t)}}},830:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.At=n.qt=n.zt=n.Mt=n.Jt=n.Lt=void 0;n.Lt=()=>"undefined"!=typeof window?window:null,n.Jt=()=>{var t=(0,n.Lt)();return null!=(t=null==t?void 0:t.document)?t:null},n.Mt=()=>{var t;return null===(0,n.Jt)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},n.zt=(t,e)=>{var i=(0,n.Lt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.qt=(t,e)=>{var i=(0,n.Jt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)};n.At=()=>{var t;try{return null==(t=(0,n.Lt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},143:(t,e,i)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(137),r=i(512),o=i(534),u=i(23),l=18e5,a=144e5,c={};function h(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function d(t){return"statsig.session_id."+(0,n.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=d(t);return(0,o.F)(t)}(t);var i=Date.now();e=e||{sessionID:(0,u.getUUID)(),startTime:i,lastUpdate:i};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),i=t.data,n=((function({lastUpdate:t}){return Date.now()-t>l}(i)||function({startTime:t}){return Date.now()-t>a}(i))&&(i.sessionID=(0,u.getUUID)(),i.startTime=e),i.lastUpdate=e,i),s=t.sdkKey;s=d(s);try{(0,o.J)(s,n)}catch(t){r.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=i.startTime,i=t.sdkKey,t.idleTimeoutID=h(i,l),t.ageTimeoutID=h(i,a-e),t},overrideInitialSessionID:(t,e)=>{var i;c[e]=(t=t,e=e,i=Date.now(),{data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e})}}},122:(t,e,i)=>{$Q(e),e.StableID=void 0;const n=i(137),s=i(512),r=i(534),o=i(23),u={};function l(t){return"statsig.stable_id."+(0,n.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==u[e]){let t=function(t){t=l(t);return(0,r.F)(t)}(e);null==t&&a(t=(0,o.getUUID)(),e),u[e]=t}return u[e]},setOverride:(t,e)=>{a(u[e]=t,e)}}},375:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(845);const o=i(845),u=i(542),l=i(770),a=i(512),c=i(830),h=i(143),d=i(534);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.xn=null,this.Vt={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&d.Storage.Bt(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),null!=n&&n.storageProvider&&d.Storage.de(n.storageProvider),this.S=t,this.p=null!=n?n:{},this.overrideAdapter=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.Ht=new l.EventLogger(t,r,i,n),this.Wt=new u.ErrorBoundary(t,n,r),this.Wt.wrap(this),this.Wt.wrap(i),this.Wt.wrap(e),this.Wt.wrap(this.Ht),this.dataAdapter=e,this.dataAdapter.attach(t,n),this.storageProvider=d.Storage,this.Yt(),s=t,r=this,(0,c.Mt)()||(i=(0,o.o)(),e=null!=(e=i.instances)?e:{},r=r,null!=e[s]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[s]=r,i.lastInstance=r,i.instances=e,__STATSIG__=i)}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Ht.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,d.Storage.Bt(t.disableStorage))}flush(){return this.Ht.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.Qt("Uninitialized",null),this.xn=null,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(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.Wt.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.Vt[i.name]&&this.Vt[i.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,i){!0===(null==i?void 0:i.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 i="statsig::config_exposure",n="statsig::gate_exposure",l=(t,e,i,n,s)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:r(i,n),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===n||t===i,e.ee=(t,e)=>{return l(n,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(i,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,i)=>{var n,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let o="",u=null!=(n=null==s?void 0:s.undelegated_secondary_exposures)?n:[];return r&&(o=null!=(n=s.allocated_experiment_name)?n:"",u=s.secondary_exposures),l("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:i,ruleID:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)},u)};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.2.0";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},586:(t,e)=>{$Q(e)},98:(t,e)=>{$Q(e)},59:(t,e,i)=>{$Q(e),e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const r=i(634),s="default";function o(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:s,__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},o(t,e,i,n)),{get:u(null==i?void 0:i.value)})}function u(n,s){return(t,e)=>{var i=null!=(i=null==n?void 0:n[t])?i:null;return null!=i&&(null==e||(0,r.le)(i,e))?(null!=s&&s(t),i):null!=e?e:null}}e.ue=function(t,e,i){return o(t,e,i,!0===(null==i?void 0:i.value))},e.oe=n,e.re=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.se=function(t,e,i,n){return $P($P({},o(t,e,i,void 0)),{get:u(null==i?void 0:i.value,n),groupName:null!=(t=null==i?void 0:i.group_name)?t:null,__value:null!=(e=null==i?void 0:i.value)?e:{}})},e.ne=function(t,e,i,n){return $P($P($P({},t),e),{get:u(i,n)})},e.ie=u},812:(t,e)=>{$Q(e)},578:(t,e,i)=>{$Q(e),e.v=e.A=void 0;const n=i(406),s=i(512);e.A=function(t,e){try{var i=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment&&(i.statsigEnvironment=e.environment),i}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,n.Dt)(t):null}},534:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.J=i.F=i.Storage=void 0;var n=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 o=null;try{const a=(0,e.Lt)();a&&a.localStorage&&"function"==typeof a.localStorage.getItem&&(o={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){n.Log.warn("Failed to setup localStorageProvider.")}let u=null!==o&&void 0!==o?o:r,l=u;i.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 i.Storage.de(r),null;throw t}},setItem:(t,e)=>l.setItem(t,e),removeItem:t=>l.removeItem(t),getAllKeys:()=>l.getAllKeys(),de:t=>{u=t,l=t},Bt:t=>{l=t?r:u}},i.F=function(t){return t=i.Storage.getItem(t),JSON.parse(null!=t?t:"null")},i.J=function(t,e){i.Storage.setItem(t,JSON.stringify(e))}},401:(t,e,i)=>{$Q(e),e.C=void 0;const s=i(512);e.C=function(t,e,i){try{var n=JSON.parse(t);return"object"==typeof n&&0 in n,n}catch(t){}return s.Log.error("Failed to parse "+i),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 i=t=>Array.isArray(t)?"array":typeof t;return i(t)===i(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 i=(new Date).getTime(),n="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{$Q(e),e.ut=void 0,e.ut=function(t,e,i,n){return t||(e?""+e+i:""+n+i)}},397:(t,e,i)=>{$Q(e),e.ve=e.lt=e.Ut=e.Ot=void 0;i=i(830);const n="foreground",s="background",r=[];let o=n,u=!1;e.Ot=()=>o===n,e.Ut=()=>u,e.lt=t=>{r.unshift(t)};e.ve=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,i.zt)("focus",()=>{(u=!1,e.ve)(n)}),(0,i.zt)("blur",()=>(0,e.ve)(s)),(0,i.zt)("beforeunload",()=>{u=!0,(0,e.ve)(s)}),(0,i.qt)("visibilitychange",()=>{(0,e.ve)("visible"===document.visibilityState?n:s)})},914:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,i(845);const r=i(962),o=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return r.Diagnostics}}),i(770)),u=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}}),i(512));$Q2(e,"Log",{enumerable:!0,get:function(){return u.Log}});var l=i(0);const a=i(534);$Q2(e,"Storage",{enumerable:!0,get:function(){return a.Storage}}),s(i(845),e),s(i(137),e),s(i(427),e),s(i(694),e),s(i(962),e),s(i(539),e),s(i(542),e),s(i(922),e),s(i(417),e),s(i(406),e),s(i(333),e),s(i(512),e),s(i(404),e),s(i(410),e),s(i(405),e),s(i(361),e),s(i(830),e),s(i(902),e),s(i(143),e),s(i(122),e),s(i(375),e),s(i(636),e),s(i(206),e),s(i(637),e),s(i(0),e),s(i(586),e),s(i(59),e),s(i(812),e),s(i(578),e),s(i(98),e),s(i(534),e),s(i(401),e),s(i(634),e),s(i(638),e),s(i(23),e),s(i(397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:u.Log,SDK_VERSION:l.SDK_VERSION})},296:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),s(i(18),e),e.default=__STATSIG__},262:(t,e,i)=>{$Q(e),e.fe=void 0;const n=i(914);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.fe=function(t,e){var i;return(e=(0,n.C)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.Dt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===e.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},226:(t,e,i)=>{$Q(e);const s=i(914);e.default=class{constructor(t){this.S=t,this._e=null,this.ge=null,this.be="Uninitialized",this.ye=0,this.me=0,this.bi=null,this.mi=new Set}reset(){this.ge=null,this._e=null,this.be="Loading",this.ye=0,this.me=0,this.bi=null}finalize(){this.ge||(this.be="NoValues")}getValues(){return this._e?(0,s.C)(this._e,"has_updates","EvaluationStoreValues"):null}setValues(t,e){var i;return!!t&&null!=(i=(0,s.C)(t.data,"has_updates","EvaluationResponse"))&&(this.be=t.source,!0===(null==i?void 0:i.has_updates)&&(this._e=t.data,this.ye=i.time,this.me=t.receivedAt,this.ge=i,this.bi=this.pi(t.source,i),t.source)&&i.user&&this.yi(e,i),!0)}getGate(t){var e;return this.pe(null==(e=this.ge)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.pe(null==(e=this.ge)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.pe(null==(e=this.ge)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.pe(null==(e=this.ge)?void 0:e.param_stores,t)}pi(t,e){return"Bootstrap"!==t?null:(t={},e.user&&(t.user=e.user),e.sdkInfo&&(t.generatorSDKInfo=e.sdkInfo),t.lcut=e.time,t)}pe(t,e){let i=null;return{result:i=t?t[e]||t[(0,s.h)(e)]:i,details:this.Se(null==i)}}yi(t,e){var i,n=s.StableID.get(this.S);(null==(i=t.customIDs)?void 0:i.stableID)!==n?this.mi.add("StableIDMismatch"):"user"in e&&(i=e.user,(0,s.v)(t)!==(0,s.v)(i))&&this.mi.add("PartialUserMatch")}getCurrentSourceDetails(){var t;return"Uninitialized"===this.be||"NoValues"===this.be?{reason:this.be}:(t={reason:this.be,lcut:this.ye,receivedAt:this.me},0{$Q(e),e.Te=void 0;const g=i(914),b={disableExposureLog:!0};function p(t){return null==t||!1===t.disableExposureLog}function y(t,e){return null!=e&&!(0,g.le)(t,e)}e.Te=function(v,f,_){return(t,e)=>{if(null==f)return e;var i,n,s,r,o,u,l,a,c,h,d=f[t];if(null==d||null!=e&&(0,g.kt)(e)!==d.param_type)return e;switch(d.ref_type){case"static":return d.value;case"gate":return h=d,v.getFeatureGate(h.gate_name,p(_)?void 0:b).value?h.pass_value:h.fail_value;case"dynamic_config":return h=d,l=e,a=_,y(c=(u=v).getDynamicConfig(h.config_name,b).get(h.param_name),l)?l:(p(a)&&u.getDynamicConfig(h.config_name),c);case"experiment":return l=d,a=e,u=_,y(o=(c=v).getExperiment(l.experiment_name,b).get(l.param_name),a)?a:(p(u)&&c.getExperiment(l.experiment_name),o);case"layer":return o=d,n=e,s=_,y(r=(i=v).getLayer(o.layer_name,b).get(o.param_name),n)?n:(p(s)&&i.getLayer(o.layer_name).get(o.param_name),r);default:return e}}}},198:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e);const o=i(914),u=i(226),l=i(448),r=i(583),a=i(131);class n extends o.StatsigClientBase{static instance(t){var e=(0,o.o)().instance(t);return e instanceof n?e:(o.Log.warn((0,o.Mt)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){o.SDKType.Kt(t,"javascript-client");var n,s=new l.default(i,t=>{this.$emt(t)}),s=(super(t,null!=(n=null==i?void 0:i.dataAdapter)?n:new a.StatsigEvaluationsDataAdapter,s,i),this.we=new u.default(t),this.Ie=(0,o.A)(e,i),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const r of s)r.bind(this)}initializeSync(t){"Uninitialized"===this.loadingStatus&&(this.Ht.start(),this.updateUserSync(this.Ie,t))}initializeAsync(t){return s(this,void 0,void 0,function*(){return this.xn||(this.xn=this.Dn(t)),this.xn})}updateUserSync(t,e){this.Ae(t);t=this.dataAdapter.getDataSync(this.Ie),this.we.setValues(t,this.Ie),this.Me(t),e=null==e?void 0:e.disableBackgroundCacheRefresh;!0===e||null==e&&"Bootstrap"===(null==t?void 0:t.source)||this.xe(null!=t?t:null,this.Ie)}updateUserAsync(i,n){return s(this,void 0,void 0,function*(){this.Ae(i);var t=this.Ie,e=(o.Diagnostics.gn(this.S),this.dataAdapter.getDataSync(t));if(this.we.setValues(e,this.Ie),this.Qt("Loading",e),e=yield this.dataAdapter.getDataAsync(e,t,n),t===this.Ie){let t=!1;null!=e&&(o.Diagnostics.yn(this.S),t=this.we.setValues(e,this.Ie),o.Diagnostics.On(this.S,{success:t})),this.Me(e),t||this.$emt({name:"initialization_failure"}),o.Diagnostics.mn(this.S,t,this.we.getCurrentSourceDetails()),o.Diagnostics.Tn(this.Ie,this.Ht,this.S,this.p)}})}getContext(){return{sdkKey:this.S,options:this.p,values:this.we.getValues(),user:JSON.parse(JSON.stringify(this.Ie)),errorBoundary:this.Wt,session:o.StatsigSession.get(this.S),stableID:o.StableID.get(this.S)}}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:i,details:n}=this.we.getGate(t),n=(0,o.ue)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.ee)(this.Ie,i),e),this.$emt({name:"gate_evaluation",gate:i}),i}getDynamicConfig(t,e){var{result:i,details:n}=this.we.getConfig(t),n=(0,o.oe)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.te)(this.Ie,i),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e){var{result:i,details:n}=this.we.getConfig(t),n=(0,o.re)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.te)(this.Ie,i),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,i){var{result:t,details:n}=this.we.getLayer(e),n=(0,o.se)(e,n,t),s=null==(s=null==(t=this.overrideAdapter)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.Ie,i);const r=(0,o.ne)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{this.Xt(e,(0,o.Zt)(this.Ie,r,t),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:i,details:n}=this.we.getParamStore(t);return this.Ht.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,r.Te)(this,i,e)}}logEvent(t,e,i){this.Ht.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:i}:t),{user:this.Ie,time:Date.now()}))}Yt(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Me(null)})}Dn(t){return s(this,void 0,void 0,function*(){return o.Storage.isReady()||(yield o.Storage.isReadyResolver()),this.Ht.start(),this.updateUserAsync(this.Ie,t)})}Me(t){this.we.finalize(),this.Qt("Ready",t)}xe(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}Ae(t){this.Ht.reset(),this.we.reset(),this.Ie=(0,o.A)(t,this.p);t=null==(t=this.Ie.customIDs)?void 0:t.stableID;t&&o.StableID.setOverride(t,this.S)}}e.default=n},131:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(914),s=i(448);class o extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.X=null,this.p=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.M(t,(0,n.A)(e,this.p),i)}prefetchData(t,e){return this.k(t,e)}setData(t){var e=(0,n.C)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(t,e){super.setData(t,e)}N(e,i,n){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.X)?void 0:s.fetchEvaluations(this.P(),e,null==n?void 0:n.priority,i);return null!=t?t:null})}T(t){t=(0,n.u)(this.P(),t,null==(t=this.p)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=o},18:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.StatsigClient=void 0,i(198));e.StatsigClient=r.default,s(i(914),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:r.default}),e.default=__STATSIG__}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[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(296).default})()); \ No newline at end of file +!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 i={845:(t,i,e)=>{var n;$Q2(i,"__esModule",{value:!0}),i.t=i.i=i.o=void 0;const s=e(512);i.o=()=>__STATSIG__||u,i.i=t=>(0,i.o)()[t];i.t=t=>{var e=(0,i.o)();return t?e.instances&&e.instances[t]:(e.instances&&1{$Q(e),e.u=e.l=void 0;const s=i(406);function n(t,e,i){if(i)return i(t,e);const n=e&&e.customIDs?e.customIDs:{};e=["uid:"+(null!=(i=null==e?void 0:e.userID)?i:""),"cids:"+Object.keys(n).sort((t,e)=>t.localeCompare(e)).map(t=>t+"-"+n[t]).join(","),"k:"+t];return(0,s.h)(e.join("|"))}e.l=n,e.u=function(t,e,i){return e?n(t,e,i):(0,s.h)("k:"+t)}},427:(t,e)=>{$Q(e)},694:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e),e.DataAdapterCore=void 0;const u=i(512),a=i(122),r=i(578),o=i(534),c=i(401);function h(t,e,i,n){return{source:t,data:e,receivedAt:Date.now(),stableID:i,fullUserHash:(0,r.v)(n)}}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 n}attach(t,e){this.S=t,this.p=e}getDataSync(t){var t=t&&(0,r.A)(t,this.p),e=this.T(t),i=this.j.get(e,t);return i||((i=this.I(e))?(this.j.add(e,i),this.j.get(e,t)):null)}setData(t,e){var e=e&&(0,r.A)(e,this.p),i=this.T(e);this.j.add(i,h("Bootstrap",t,null,e))}M(e,i,n){return s(this,void 0,void 0,function*(){o.Storage.isReady()||(yield o.Storage.isReadyResolver());var t=null!=e?e:this.getDataSync(i),t=[this.D(t,i,n)];return null!=n&&n.timeoutMs&&t.push(new Promise(t=>setTimeout(t,n.timeoutMs)).then(()=>(u.Log.debug("Fetching latest value timed out"),null))),yield Promise.race(t)})}k(i,n){return s(this,void 0,void 0,function*(){var t=i&&(0,r.A)(i,this.p),e=this.T(t),t=yield this.M(null,t,n);t&&this.j.add(e,$P($P({},t),{source:"Prefetch"}))})}D(r,o,l){return s(this,void 0,void 0,function*(){let t=null;r&&this.R(r,o)&&(t=r.data);var e=yield this.N(t,o,l);if(!e)return u.Log.debug("No response returned for latest value"),null;var i=(0,c.C)(e,"has_updates","Response"),n=this.P(),n=a.StableID.get(n);let s=null;if(!0===(null==i?void 0:i.has_updates))s=h("Network",e,n,o);else{if(!t||!1!==(null==i?void 0:i.has_updates))return null;s=h("NetworkNotModified",t,n,o)}e=this.T(o);return this.j.add(e,s),this.G(e,s),s})}P(){return null!=this.S?this.S:(u.Log.error(this._+" is not attached to a Client"),"")}I(t){var e=null==(e=o.Storage.getItem)?void 0:e.call(o.Storage,t);return null!=e&&(t=(0,c.C)(e,"source","Cached Result"))?$P($P({},t),{source:"Cache"}):null}G(t,e){o.Storage.setItem(t,JSON.stringify(e)),this.K(t)}K(t){var e=null!=(e=(0,o.F)(this.O))?e:{},t=(e[t]=Date.now(),l(e,10));t&&(delete e[t],o.Storage.removeItem(t)),(0,o.J)(this.O,e)}};class n{constructor(){this.V={}}get(t,e){var t=this.V[t],i=null==t?void 0:t.stableID,e=null==(e=null==e?void 0:e.customIDs)?void 0:e.stableID;return e&&i&&e!==i?(u.Log.warn("'StatsigUser.customIDs.stableID' mismatch"),null):t}add(t,e){var i=l(this.V,9);i&&delete this.V[i],this.V[t]=e}merge(t){this.V=$P($P({},this.V),t)}}function l(s,t){var e=Object.keys(s);return e.length<=t?null:e.reduce((t,e)=>{var i=s[t],n=s[e];return"object"==typeof i&&"object"==typeof n?n.receivedAt{$Q2(r,"__esModule",{value:!0}),r.Diagnostics=void 0;const n=new Map,i="start";function s(t,e,i,n){return $P({key:i,action:e,step:n,timestamp:Date.now()},t)}function o(t,e){var i=null!=(i=n.get(t))?i:[];i.push(e),n.set(t,i)}function e(t,e){if(e in t)return t[e]}r.Diagnostics={_n:t=>n.get(t),gn:t=>{o(t,s({},i,"overall"))},mn:(t,e,i)=>{o(t,s({success:e,error:e?void 0:{name:"InitializeError",message:"Failed to initialize"},evaluationDetails:i},"end","overall"))},bn:(t,e)=>{o(t,s(e,i,"initialize","network_request"))},pn:(t,e)=>{o(t,s(e,"end","initialize","network_request"))},yn:t=>{o(t,s({},i,"initialize","process"))},On:(t,e)=>{o(t,s(e,"end","initialize","process"))},jn:t=>{n.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,i,n){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===i.includes('"is_delta":true')||void 0,attempt:e,error:r.Diagnostics.Sn(n)}},Tn(t,e,i,n){var s=r.Diagnostics._n(i);null==s||s.length<=0||(r.Diagnostics.jn(i),i=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:n}),e.enqueue(i))}}},539:(t,e)=>{$Q(e)},542:function(t,l,e){var i=this&&this.__awaiter||$A();$Q2(l,"__esModule",{value:!0}),l.ErrorBoundary=l.EXCEPTION_ENDPOINT=void 0;const n=e(512),u=e(902),a=e(0),c=(l.EXCEPTION_ENDPOINT="https://statsigapi.net/v1/sdk_exception","[Statsig] UnknownError");l.ErrorBoundary=class{constructor(t,e,i){this.S=t,this.p=e,this.B=i,this.$=new Set}wrap(n){try{const t=n;!function(t){const e=new Set;let i=Object.getPrototypeOf(t);for(;i&&i!==Object.prototype;)Object.getOwnPropertyNames(i).filter(t=>"function"==typeof(null===i||void 0===i?void 0:i[t])).forEach(t=>e.add(t)),i=Object.getPrototypeOf(i);return Array.from(e)}(t).forEach(e=>{const i=t[e];"$EB"in i||(t[e]=(...t)=>this.H(e,()=>i.apply(n,t)),t[e].$EB=!0)})}catch(t){this.W("eb:wrap",t)}}logError(t,e){this.W(t,e)}H(e,t){try{var i=t();return i&&i instanceof Promise?i.catch(t=>this.W(e,t)):i}catch(t){return this.W(e,t),null}}W(r,o){try{n.Log.warn("Caught error in "+r,{error:o});i(this,void 0,void 0,function*(){var t,e,i=o||Error(c),n=i instanceof Error,s=n?i.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:o,tag:r}):(t=u.SDKType.Y(this.S),e=a.StatsigMetadataProvider.get(),n=n?i.stack:function(t){try{return JSON.stringify(t)}catch(t){return c}}(i),i=JSON.stringify($P({tag:r,exception:s,info:n},$P($P({},e),{sdkType:t}))),yield(null!=(s=null==(n=null==(s=this.p)?void 0:s.networkConfig)?void 0:n.networkOverrideFunc)?s:fetch)(l.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:i}),null!=(n=this.B)&&n.call(this,{name:"error",error:o,tag:r})))}).then(()=>{}).catch(()=>{})}catch(t){}}}},922:(t,e)=>{$Q(e)},417:(t,e)=>{$Q(e)},770:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.EventLogger=void 0;const s=i(137),r=i(406),o=i(512),l=i(410),u=i(830),a=i(637),c=i(534),h=i(638),d=i(397),v={},f={Startup:"startup",GainedFocus:"gained_focus"};class _{static wi(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static Ti(t){null!=(t=v[t])&&t.ct(f.GainedFocus)}constructor(t,e,i,n){this.S=t,this.B=e,this.X=i,this.p=n,this.Z=[],this.tt={},this.et={},this.it=!1,this.nt=Date.now(),this.st=!0===(null==n?void 0:n.disableLogging),this.rt=null!=(t=null==n?void 0:n.loggingBufferMaxSize)?t:50;e=null==n?void 0:n.networkConfig;this.ot=(0,h.ut)(null==e?void 0:e.logEventUrl,null==e?void 0:e.api,"/rgstr",l.NetworkDefault.eventsApi)}setLoggingDisabled(t){this.st=t}enqueue(t){this.dt(t)&&(this.vt(t),this.ft(),this.Z.length>this.rt)&&_.wi(this.S)}incrementNonExposureCount(t){var e=null!=(e=this.et[t])?e:0;this.et[t]=e+1}reset(){this.tt={}}start(){(0,u.Mt)()||(v[this.S]=this,(0,d.lt)(t=>{"background"===t?_.wi(this.S):"foreground"===t&&_.Ti(this.S)}),this.ct(f.Startup),this.ht())}stop(){return n(this,void 0,void 0,function*(){this._t&&(clearInterval(this._t),this._t=null),delete v[this.S],yield this.flush()})}flush(){return n(this,void 0,void 0,function*(){var t;this.gt(),0!==this.Z.length&&(t=this.Z,this.Z=[],yield this.bt(t))})}ft(){this.it||(this.it=!0,200_.wi(this.S),200)}dt(t){if((0,u.Mt)())return!1;if((0,a.yt)(t)){var e=t.user||{statsigEnvironment:void 0},e=(0,s.l)(this.S,e),i=t.metadata||{},t=[t.eventName,e,i.gate,i.config,i.ruleID].join("|"),e=this.tt[t],i=Date.now();if(e&&i-e<6e4)return!1;1e3{o.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={},i=this.It(),i=(i&&(e.statsigMetadata={currentPage:i}),$P($P({},t),e));o.Log.debug("Enqueued Event:",i),this.Z.push(i)}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,u.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):_.wi(this.S)},t);this._t=e}}e.EventLogger=_},406:(t,r,e)=>{$Q2(r,"__esModule",{value:!0}),r.xt=r.Dt=r.h=void 0;const o=e(634);r.h=e=>{let i=0;for(let t=0;t>>0)},r.Dt=(t,e)=>(0,r.h)(JSON.stringify((0,r.xt)(t,e)));r.xt=(i,n)=>{if(null==i)return null;var t=Object.keys(i).sort();const s={};return t.forEach(t=>{var e=i[t];0===n||"object"!==(0,o.kt)(e)?s[t]=e:s[t]=(0,r.xt)(e,null!=n?n-1:n)}),s}},333:(t,e)=>{$Q(e)},512:(t,e)=>{$Q(e),e.Log=e.LogLevel=void 0;function i(t){return t.unshift("[Statsig]"),t}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class n{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...i(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...i(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...i(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...i(t))}}(e.Log=n).level=e.LogLevel.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,i){var r=this&&this.__awaiter||$A();$Q(e),e.NetworkCore=void 0,i(845);const o=i(845),b=i(962),p=i(512),l=i(410),u=i(902),a=i(830),c=i(143),h=i(122),y=i(636),d=i(0),m=i(397),O=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(n){return r(this,void 0,void 0,function*(){var t,e,i;return!!j(n)&&(t=yield this.Nt(n),e=yield this.Gt(n),(i=navigator).sendBeacon.bind(i)(e,t))})}Pt(f){var _,g;return r(this,void 0,void 0,function*(){if(!j(f))return null;if(this.Rt.preventAllNetworkTraffic)return null;var{method:e,body:i,retries:n,attempt:s}=f,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),o=yield this.Gt(f);let l=null;var u=(0,m.Ut)();try{var a,c,h,d={method:e,body:i,headers:$P({},f.headers),signal:null===r||void 0===r?void 0:r.signal,priority:f.priority,keepalive:u},v=(f.isInitialize&&b.Diagnostics.bn(f.sdkKey,{attempt:s}),null!=(_=this.Rt.networkOverrideFunc)?_:fetch);if(l=yield v(o,d),clearTimeout(t),l.ok)return h=yield l.text(),f.isInitialize&&b.Diagnostics.pn(f.sdkKey,b.Diagnostics.wn(l,s,h)),{body:h,code:l.status};throw a=yield l.text().catch(()=>"No Text"),(c=new Error(`NetworkError: ${o} `+a)).name="NetworkError",c}catch(t){i=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 f.isInitialize&&b.Diagnostics.pn(f.sdkKey,b.Diagnostics.wn(l,s,"",t)),!n||nencodeURIComponent(t)+"="+encodeURIComponent(e[t])).join("&");return i.url+(t?"?"+t:"")})}Nt(s){return r(this,void 0,void 0,function*(){var{data:t,sdkKey:e}=s,i=h.StableID.get(e),n=c.SessionID.get(e),e=u.SDKType.Y(e);return JSON.stringify($P($P({},t),{statsigMetadata:$P($P({},d.StatsigMetadataProvider.get()),{stableID:i,sessionID:n,sdkType:e})}))})}Ct(t,e){var i,n,s=(0,a.Lt)();if(!t.isStatsigEncodable||this.p.disableStatsigEncoding||null!=(0,o.i)("no-encode")||null==s||!s.btoa)return e;try{var r=null!=(i=s.btoa(e).split("").reverse().join(""))?i:e;return t.params=$P($P({},null!=(n=t.params)?n:{}),{[l.NetworkParam.StatsigEncoded]:"1"}),r}catch(t){return p.Log.warn("/initialize request encoding failed"),e}}};const j=t=>!!t.sdkKey||(p.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 i={};let n;e.SDKType={Y:t=>{return(null!=(t=i[t])?t:"js-mono")+(null!==n&&void 0!==n?n:"")},Kt(t,e){i[t]=e},Ft(t){n&&"-react"!==n||(n="-"+t)}}},830:(t,n)=>{$Q2(n,"__esModule",{value:!0}),n.At=n.qt=n.zt=n.Mt=n.Jt=n.Lt=void 0;n.Lt=()=>"undefined"!=typeof window?window:null,n.Jt=()=>{var t=(0,n.Lt)();return null!=(t=null==t?void 0:t.document)?t:null},n.Mt=()=>{var t;return null===(0,n.Jt)()&&(t="undefined"!=typeof process&&null!=process.versions&&null!=process.versions.node,"string"==typeof EdgeRuntime||t)},n.zt=(t,e)=>{var i=(0,n.Lt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)},n.qt=(t,e)=>{var i=(0,n.Jt)();"function"==typeof(null==i?void 0:i.addEventListener)&&i.addEventListener(t,e)};n.At=()=>{var t;try{return null==(t=(0,n.Lt)())?void 0:t.location.href.split(/[?#]/)[0]}catch(t){}}},143:(t,e,i)=>{$Q(e),e.StatsigSession=e.SessionID=void 0;const n=i(137),r=i(512),o=i(534),l=i(23),u=18e5,a=144e5,c={};function h(e,t){return setTimeout(()=>{var t=null===__STATSIG__||void 0===__STATSIG__?void 0:__STATSIG__.instance(e);t&&t.$emt({name:"session_expired"})},t)}function d(t){return"statsig.session_id."+(0,n.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=d(t);return(0,o.F)(t)}(t);var i=Date.now();e=e||{sessionID:(0,l.getUUID)(),startTime:i,lastUpdate:i};return{data:e,sdkKey:t}}(t));var t=c[t],e=Date.now(),i=t.data,n=((function({lastUpdate:t}){return Date.now()-t>u}(i)||function({startTime:t}){return Date.now()-t>a}(i))&&(i.sessionID=(0,l.getUUID)(),i.startTime=e),i.lastUpdate=e,i),s=t.sdkKey;s=d(s);try{(0,o.J)(s,n)}catch(t){r.Log.warn("Failed to save SessionID")}return clearTimeout(t.idleTimeoutID),clearTimeout(t.ageTimeoutID),e-=i.startTime,i=t.sdkKey,t.idleTimeoutID=h(i,u),t.ageTimeoutID=h(i,a-e),t},overrideInitialSessionID:(t,e)=>{var i;c[e]=(t=t,e=e,i=Date.now(),{data:{sessionID:t,startTime:i,lastUpdate:i},sdkKey:e})}}},122:(t,e,i)=>{$Q(e),e.StableID=void 0;const n=i(137),s=i(512),r=i(534),o=i(23),l={};function u(t){return"statsig.stable_id."+(0,n.u)(t)}function a(t,e){e=u(e);try{(0,r.J)(e,t)}catch(t){s.Log.warn("Failed to save StableID")}}e.StableID={get:e=>{if(null==l[e]){let t=function(t){t=u(t);return(0,r.F)(t)}(e);null==t&&a(t=(0,o.getUUID)(),e),l[e]=t}return l[e]},setOverride:(t,e)=>{a(l[e]=t,e)}}},375:function(t,e,i){var n=this&&this.__awaiter||$A();$Q(e),e.StatsigClientBase=void 0,i(845);const o=i(845),l=i(542),u=i(770),a=i(512),c=i(830),h=i(143),d=i(534);e.StatsigClientBase=class{constructor(t,e,i,n){this.loadingStatus="Uninitialized",this.xn=null,this.Vt={};var s,r=this.$emt.bind(this);null!=(null==n?void 0:n.logLevel)&&(a.Log.level=n.logLevel),null!=n&&n.disableStorage&&d.Storage.Bt(!0),null!=n&&n.initialSessionID&&h.StatsigSession.overrideInitialSessionID(n.initialSessionID,t),null!=n&&n.storageProvider&&d.Storage.de(n.storageProvider),this.S=t,this.p=null!=n?n:{},this.overrideAdapter=null!=(s=null==n?void 0:n.overrideAdapter)?s:null,this.Ht=new u.EventLogger(t,r,i,n),this.Wt=new l.ErrorBoundary(t,n,r),this.Wt.wrap(this),this.Wt.wrap(i),this.Wt.wrap(e),this.Wt.wrap(this.Ht),this.dataAdapter=e,this.dataAdapter.attach(t,n),this.storageProvider=d.Storage,this.Yt(),s=t,r=this,(0,c.Mt)()||(i=(0,o.o)(),e=null!=(e=i.instances)?e:{},r=r,null!=e[s]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[s]=r,i.firstInstance||(i.firstInstance=r),i.instances=e,__STATSIG__=i)}updateRuntimeOptions(t){null!=t.disableLogging&&(this.p.disableLogging=t.disableLogging,this.Ht.setLoggingDisabled(t.disableLogging)),null!=t.disableStorage&&(this.p.disableStorage=t.disableStorage,d.Storage.Bt(t.disableStorage))}flush(){return this.Ht.flush()}shutdown(){return n(this,void 0,void 0,function*(){this.$emt({name:"pre_shutdown"}),this.Qt("Uninitialized",null),this.xn=null,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(i){var t;const e=e=>{try{e(i)}catch(t){!0===e.__isInternal?this.Wt.logError("__emit:"+i.name,t):a.Log.error("An error occurred in a StatsigClientEvent listener. This is not an issue with Statsig.",i)}};this.Vt[i.name]&&this.Vt[i.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,i){!0===(null==i?void 0:i.disableExposureLog)?this.Ht.incrementNonExposureCount(t):this.Ht.enqueue(e)}}},636:(t,e)=>{$Q(e),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},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 i="statsig::config_exposure",n="statsig::gate_exposure",u=(t,e,i,n,s)=>(i.bootstrapMetadata&&(n.bootstrapMetadata=i.bootstrapMetadata),{eventName:t,user:e,value:null,metadata:r(i,n),secondaryExposures:s,time:Date.now()});e.yt=({eventName:t})=>t===n||t===i,e.ee=(t,e)=>{return u(n,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 u(i,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,i)=>{var n,s=e.__evaluation,r=!0===(null==(r=null==s?void 0:s.explicit_parameters)?void 0:r.includes(i));let o="",l=null!=(n=null==s?void 0:s.undelegated_secondary_exposures)?n:[];return r&&(o=null!=(n=s.allocated_experiment_name)?n:"",l=s.secondary_exposures),u("statsig::layer_exposure",t,e.details,{config:e.name,parameterName:i,ruleID:e.ruleID,allocatedExperiment:o,isExplicitParameter:String(r)},l)};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.3.0";let i={sdkVersion:e.SDK_VERSION,sdkType:"js-mono"};e.StatsigMetadataProvider={get:()=>i,add:t=>{i=$P($P({},i),t)}}},586:(t,e)=>{$Q(e)},98:(t,e)=>{$Q(e)},59:(t,e,i)=>{$Q(e),e.ie=e.ne=e.se=e.re=e.oe=e.ue=void 0;const r=i(634),s="default";function o(t,e,i,n){return{name:t,details:e,ruleID:null!=(t=null==i?void 0:i.rule_id)?t:s,__evaluation:i,value:n}}function n(t,e,i){var n=null!=(n=null==i?void 0:i.value)?n:{};return $P($P({},o(t,e,i,n)),{get:l(null==i?void 0:i.value)})}function l(n,s){return(t,e)=>{var i=null!=(i=null==n?void 0:n[t])?i:null;return null!=i&&(null==e||(0,r.le)(i,e))?(null!=s&&s(t),i):null!=e?e:null}}e.ue=function(t,e,i){return o(t,e,i,!0===(null==i?void 0:i.value))},e.oe=n,e.re=function(t,e,i){return t=n(t,e,i),$P($P({},t),{groupName:null!=(e=null==i?void 0:i.group_name)?e:null})},e.se=function(t,e,i,n){return $P($P({},o(t,e,i,void 0)),{get:l(null==i?void 0:i.value,n),groupName:null!=(t=null==i?void 0:i.group_name)?t:null,__value:null!=(e=null==i?void 0:i.value)?e:{}})},e.ne=function(t,e,i,n){return $P($P($P({},t),e),{get:l(i,n)})},e.ie=l},812:(t,e)=>{$Q(e)},578:(t,e,i)=>{$Q(e),e.v=e.A=void 0;const n=i(406),s=i(512);e.A=function(t,e){try{var i=JSON.parse(JSON.stringify(t));return null!=e&&null!=e.environment&&(i.statsigEnvironment=e.environment),i}catch(t){return s.Log.error("Failed to JSON.stringify user"),{statsigEnvironment:void 0}}},e.v=function(t){return t?(0,n.Dt)(t):null}},534:(t,i,e)=>{$Q2(i,"__esModule",{value:!0}),i.J=i.F=i.Storage=void 0;var n=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 o=null;try{const a=(0,e.Lt)();a&&a.localStorage&&"function"==typeof a.localStorage.getItem&&(o={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){n.Log.warn("Failed to setup localStorageProvider.")}let l=null!==o&&void 0!==o?o:r,u=l;i.Storage={isReady:()=>u.isReady(),isReadyResolver:()=>u.isReadyResolver(),getProviderName:()=>u.getProviderName(),getItem:t=>{var e=()=>u.getItem(t);try{return e()}catch(t){if(t instanceof Error&&"SecurityError"===t.name)return i.Storage.de(r),null;throw t}},setItem:(t,e)=>u.setItem(t,e),removeItem:t=>u.removeItem(t),getAllKeys:()=>u.getAllKeys(),de:t=>{l=t,u=t},Bt:t=>{u=t?r:l}},i.F=function(t){return t=i.Storage.getItem(t),JSON.parse(null!=t?t:"null")},i.J=function(t,e){i.Storage.setItem(t,JSON.stringify(e))}},401:(t,e,i)=>{$Q(e),e.C=void 0;const s=i(512);e.C=function(t,e,i){try{var n=JSON.parse(t);return"object"==typeof n&&0 in n,n}catch(t){}return s.Log.error("Failed to parse "+i),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 i=t=>Array.isArray(t)?"array":typeof t;return i(t)===i(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 i=(new Date).getTime(),n="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{$Q(e),e.ut=void 0,e.ut=function(t,e,i,n){return t||(e?""+e+i:""+n+i)}},397:(t,e,i)=>{$Q(e),e.ve=e.lt=e.Ut=e.Ot=void 0;i=i(830);const n="foreground",s="background",r=[];let o=n,l=!1;e.Ot=()=>o===n,e.Ut=()=>l,e.lt=t=>{r.unshift(t)};e.ve=e=>{e!==o&&(o=e,r.forEach(t=>t(e)))},(0,i.zt)("focus",()=>{(l=!1,e.ve)(n)}),(0,i.zt)("blur",()=>(0,e.ve)(s)),(0,i.zt)("beforeunload",()=>{l=!0,(0,e.ve)(s)}),(0,i.qt)("visibilitychange",()=>{(0,e.ve)("visible"===document.visibilityState?n:s)})},914:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),e.Diagnostics=e.Log=e.Storage=e.EventLogger=void 0,i(845);const r=i(962),o=($Q2(e,"Diagnostics",{enumerable:!0,get:function(){return r.Diagnostics}}),i(770)),l=($Q2(e,"EventLogger",{enumerable:!0,get:function(){return o.EventLogger}}),i(512));$Q2(e,"Log",{enumerable:!0,get:function(){return l.Log}});var u=i(0);const a=i(534);$Q2(e,"Storage",{enumerable:!0,get:function(){return a.Storage}}),s(i(845),e),s(i(137),e),s(i(427),e),s(i(694),e),s(i(962),e),s(i(539),e),s(i(542),e),s(i(922),e),s(i(417),e),s(i(406),e),s(i(333),e),s(i(512),e),s(i(404),e),s(i(410),e),s(i(405),e),s(i(361),e),s(i(830),e),s(i(902),e),s(i(143),e),s(i(122),e),s(i(375),e),s(i(636),e),s(i(206),e),s(i(637),e),s(i(0),e),s(i(586),e),s(i(59),e),s(i(812),e),s(i(578),e),s(i(98),e),s(i(534),e),s(i(401),e),s(i(634),e),s(i(638),e),s(i(23),e),s(i(397),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{Log:l.Log,SDK_VERSION:u.SDK_VERSION})},296:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)};$Q(e),s(i(18),e),e.default=__STATSIG__},262:(t,e,i)=>{$Q(e),e.fe=void 0;const n=i(914);function s(t,e){null!=t&&t.forEach(t=>{delete e[t]})}e.fe=function(t,e){var i;return(e=(0,n.C)(e,"checksum","DeltasEvaluationResponse"))?(t=t,i=e,t=$P($P($P({},t),i),{feature_gates:$P($P({},t.feature_gates),i.feature_gates),layer_configs:$P($P({},t.layer_configs),i.layer_configs),dynamic_configs:$P($P({},t.dynamic_configs),i.dynamic_configs)}),s((t=i=t).deleted_gates,t.feature_gates),delete t.deleted_gates,s(i.deleted_configs,t.dynamic_configs),delete t.deleted_configs,s(i.deleted_layers,t.layer_configs),delete t.deleted_layers,i=t,(t=(0,n.Dt)({feature_gates:i.feature_gates,dynamic_configs:i.dynamic_configs,layer_configs:i.layer_configs},2))===e.checksumV2?JSON.stringify(i):{hadBadDeltaChecksum:!0,badChecksum:t,badMergedConfigs:i,badFullResponse:e.deltas_full_response}):{hadBadDeltaChecksum:!0}}},226:(t,e,i)=>{$Q(e);const s=i(914);e.default=class{constructor(t){this.S=t,this._e=null,this.ge=null,this.be="Uninitialized",this.ye=0,this.me=0,this.bi=null,this.mi=new Set}reset(){this.ge=null,this._e=null,this.be="Loading",this.ye=0,this.me=0,this.bi=null}finalize(){this.ge||(this.be="NoValues")}getValues(){return this._e?(0,s.C)(this._e,"has_updates","EvaluationStoreValues"):null}setValues(t,e){var i;return!!t&&null!=(i=(0,s.C)(t.data,"has_updates","EvaluationResponse"))&&(this.be=t.source,!0===(null==i?void 0:i.has_updates)&&(this._e=t.data,this.ye=i.time,this.me=t.receivedAt,this.ge=i,this.bi=this.pi(t.source,i),t.source)&&i.user&&this.yi(e,i),!0)}getGate(t){var e;return this.pe(null==(e=this.ge)?void 0:e.feature_gates,t)}getConfig(t){var e;return this.pe(null==(e=this.ge)?void 0:e.dynamic_configs,t)}getLayer(t){var e;return this.pe(null==(e=this.ge)?void 0:e.layer_configs,t)}getParamStore(t){var e;return this.pe(null==(e=this.ge)?void 0:e.param_stores,t)}pi(t,e){return"Bootstrap"!==t?null:(t={},e.user&&(t.user=e.user),e.sdkInfo&&(t.generatorSDKInfo=e.sdkInfo),t.lcut=e.time,t)}pe(t,e){let i=null;return{result:i=t?t[e]||t[(0,s.h)(e)]:i,details:this.Se(null==i)}}yi(t,e){var i,n=s.StableID.get(this.S);(null==(i=t.customIDs)?void 0:i.stableID)!==n?this.mi.add("StableIDMismatch"):"user"in e&&(i=e.user,(0,s.v)(t)!==(0,s.v)(i))&&this.mi.add("PartialUserMatch")}getCurrentSourceDetails(){var t;return"Uninitialized"===this.be||"NoValues"===this.be?{reason:this.be}:(t={reason:this.be,lcut:this.ye,receivedAt:this.me},0{$Q(e),e.Te=void 0;const g=i(914),b={disableExposureLog:!0};function p(t){return null==t||!1===t.disableExposureLog}function y(t,e){return null!=e&&!(0,g.le)(t,e)}e.Te=function(v,f,_){return(t,e)=>{if(null==f)return e;var i,n,s,r,o,l,u,a,c,h,d=f[t];if(null==d||null!=e&&(0,g.kt)(e)!==d.param_type)return e;switch(d.ref_type){case"static":return d.value;case"gate":return h=d,v.getFeatureGate(h.gate_name,p(_)?void 0:b).value?h.pass_value:h.fail_value;case"dynamic_config":return h=d,u=e,a=_,y(c=(l=v).getDynamicConfig(h.config_name,b).get(h.param_name),u)?u:(p(a)&&l.getDynamicConfig(h.config_name),c);case"experiment":return u=d,a=e,l=_,y(o=(c=v).getExperiment(u.experiment_name,b).get(u.param_name),a)?a:(p(l)&&c.getExperiment(u.experiment_name),o);case"layer":return o=d,n=e,s=_,y(r=(i=v).getLayer(o.layer_name,b).get(o.param_name),n)?n:(p(s)&&i.getLayer(o.layer_name).get(o.param_name),r);default:return e}}}},198:function(t,e,i){var s=this&&this.__awaiter||$A();$Q(e);const o=i(914),l=i(226),u=i(448),r=i(583),a=i(131);class n extends o.StatsigClientBase{static instance(t){var e=(0,o.o)().instance(t);return e instanceof n?e:(o.Log.warn((0,o.Mt)()?"StatsigClient.instance is not supported in server environments":"Unable to find StatsigClient instance"),new n(null!=t?t:"",{}))}constructor(t,e,i=null){o.SDKType.Kt(t,"javascript-client");var n,s=new u.default(i,t=>{this.$emt(t)}),s=(super(t,null!=(n=null==i?void 0:i.dataAdapter)?n:new a.StatsigEvaluationsDataAdapter,s,i),this.we=new l.default(t),this.Ie=(0,o.A)(e,i),null!=(n=null==i?void 0:i.plugins)?n:[]);for(const r of s)r.bind(this)}initializeSync(t){"Uninitialized"===this.loadingStatus&&(this.Ht.start(),this.updateUserSync(this.Ie,t))}initializeAsync(t){return s(this,void 0,void 0,function*(){return this.xn||(this.xn=this.Dn(t)),this.xn})}updateUserSync(t,e){this.Ae(t);t=this.dataAdapter.getDataSync(this.Ie),this.we.setValues(t,this.Ie),this.Me(t),e=null==e?void 0:e.disableBackgroundCacheRefresh;!0===e||null==e&&"Bootstrap"===(null==t?void 0:t.source)||this.xe(null!=t?t:null,this.Ie)}updateUserAsync(i,n){return s(this,void 0,void 0,function*(){this.Ae(i);var t=this.Ie,e=(o.Diagnostics.gn(this.S),this.dataAdapter.getDataSync(t));if(this.we.setValues(e,this.Ie),this.Qt("Loading",e),e=yield this.dataAdapter.getDataAsync(e,t,n),t===this.Ie){let t=!1;null!=e&&(o.Diagnostics.yn(this.S),t=this.we.setValues(e,this.Ie),o.Diagnostics.On(this.S,{success:t})),this.Me(e),t||this.$emt({name:"initialization_failure"}),o.Diagnostics.mn(this.S,t,this.we.getCurrentSourceDetails()),o.Diagnostics.Tn(this.Ie,this.Ht,this.S,this.p)}})}getContext(){return{sdkKey:this.S,options:this.p,values:this.we.getValues(),user:JSON.parse(JSON.stringify(this.Ie)),errorBoundary:this.Wt,session:o.StatsigSession.get(this.S),stableID:o.StableID.get(this.S)}}checkGate(t,e){return this.getFeatureGate(t,e).value}getFeatureGate(t,e){var{result:i,details:n}=this.we.getGate(t),n=(0,o.ue)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getGateOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.ee)(this.Ie,i),e),this.$emt({name:"gate_evaluation",gate:i}),i}getDynamicConfig(t,e){var{result:i,details:n}=this.we.getConfig(t),n=(0,o.oe)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getDynamicConfigOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.te)(this.Ie,i),e),this.$emt({name:"dynamic_config_evaluation",dynamicConfig:i}),i}getExperiment(t,e){var{result:i,details:n}=this.we.getConfig(t),n=(0,o.re)(t,n,i),s=null==(s=null==(i=this.overrideAdapter)?void 0:i.getExperimentOverride)?void 0:s.call(i,n,this.Ie,e),i=null!=s?s:n;return this.Xt(t,(0,o.te)(this.Ie,i),e),this.$emt({name:"experiment_evaluation",experiment:i}),i}getLayer(e,i){var{result:t,details:n}=this.we.getLayer(e),n=(0,o.se)(e,n,t),s=null==(s=null==(t=this.overrideAdapter)?void 0:t.getLayerOverride)?void 0:s.call(t,n,this.Ie,i);const r=(0,o.ne)(n,s,null!=(t=null==s?void 0:s.__value)?t:n.__value,t=>{this.Xt(e,(0,o.Zt)(this.Ie,r,t),i)});return this.$emt({name:"layer_evaluation",layer:r}),r}getParameterStore(t,e){var{result:i,details:n}=this.we.getParamStore(t);return this.Ht.incrementNonExposureCount(t),{name:t,details:n,__configuration:i,get:(0,r.Te)(this,i,e)}}logEvent(t,e,i){this.Ht.enqueue($P($P({},"string"==typeof t?{eventName:t,value:e,metadata:i}:t),{user:this.Ie,time:Date.now()}))}Yt(){this.$on("error",()=>{"Loading"===this.loadingStatus&&this.Me(null)})}Dn(t){return s(this,void 0,void 0,function*(){return o.Storage.isReady()||(yield o.Storage.isReadyResolver()),this.Ht.start(),this.updateUserAsync(this.Ie,t)})}Me(t){this.we.finalize(),this.Qt("Ready",t)}xe(t,e){this.dataAdapter.getDataAsync(t,e,{priority:"low"}).catch(t=>{o.Log.error("An error occurred after update.",t)})}Ae(t){this.Ht.reset(),this.we.reset(),this.Ie=(0,o.A)(t,this.p);t=null==(t=this.Ie.customIDs)?void 0:t.stableID;t&&o.StableID.setOverride(t,this.S)}}e.default=n},131:function(t,e,i){var r=this&&this.__awaiter||$A();$Q(e),e.StatsigEvaluationsDataAdapter=void 0;const n=i(914),s=i(448);class o extends n.DataAdapterCore{constructor(){super("EvaluationsDataAdapter","evaluations"),this.X=null,this.p=null}attach(t,e){super.attach(t,e),this.X=new s.default(null!=e?e:{})}getDataAsync(t,e,i){return this.M(t,(0,n.A)(e,this.p),i)}prefetchData(t,e){return this.k(t,e)}setData(t){var e=(0,n.C)(t,"has_updates","data");e&&"user"in e?super.setData(t,e.user):n.Log.error("StatsigUser not found. You may be using an older server SDK version. Please upgrade your SDK or use setDataLegacy.")}setDataLegacy(t,e){super.setData(t,e)}N(e,i,n){var s;return r(this,void 0,void 0,function*(){var t=yield null==(s=this.X)?void 0:s.fetchEvaluations(this.P(),e,null==n?void 0:n.priority,i);return null!=t?t:null})}T(t){t=(0,n.u)(this.P(),t,null==(t=this.p)?void 0:t.customUserCacheKeyFunc);return`${n.DataAdapterCachePrefix}.${this.m}.`+t}R(t,e){return null!=t.fullUserHash&&t.fullUserHash===(0,n.v)(e)}}e.StatsigEvaluationsDataAdapter=o},18:function(t,e,i){var n=this&&this.__createBinding||(Object.create?function(t,e,i,n){void 0===n&&(n=i);var s=Object.getOwnPropertyDescriptor(e,i);s&&("get"in s?e.__esModule:!s.writable&&!s.configurable)||(s={enumerable:!0,get:function(){return e[i]}}),$Q2(t,n,s)}:function(t,e,i,n){t[n=void 0===n?i:n]=e[i]}),s=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||n(e,t,i)},r=($Q(e),e.StatsigClient=void 0,i(198));e.StatsigClient=r.default,s(i(914),e),__STATSIG__=$P($P({},null!==__STATSIG__&&void 0!==__STATSIG__?__STATSIG__:{}),{StatsigClient:r.default}),e.default=__STATSIG__}},n={};function s(t){var e=n[t];return void 0!==e||(e=n[t]={exports:{}},i[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(296).default})()); \ No newline at end of file diff --git a/samples/web-minified/src/assets/statsig-js-on-device-eval-client.min.js b/samples/web-minified/src/assets/statsig-js-on-device-eval-client.min.js index 4ca9f631..6bd28bba 100644 --- a/samples/web-minified/src/assets/statsig-js-on-device-eval-client.min.js +++ b/samples/web-minified/src/assets/statsig-js-on-device-eval-client.min.js @@ -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 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{$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={},_={Startup:"startup",GainedFocus:"gained_focus"};class f{static wi(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static Ti(t){null!=(t=v[t])&&t.ct(_.GainedFocus)}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)&&f.wi(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?f.wi(this.S):"foreground"===t&&f.Ti(this.S)}),this.ct(_.Startup),this.ht())}stop(){return i(this,void 0,void 0,function*(){this._t&&(clearInterval(this._t),this._t=null),delete v[this.S],yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){var t;this.gt(),0!==this.Z.length&&(t=this.Z,this.Z=[],yield this.bt(t))})}ft(){this.it||(this.it=!0,200f.wi(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{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):f.wi(this.S)},t);this._t=e}}e.EventLogger=f},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>>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}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class i{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...n(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...n(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...n(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...n(t))}}(e.Log=i).level=e.LogLevel.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||iencodeURIComponent(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.xn=null,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),this.dataAdapter=e,this.dataAdapter.attach(t,i),this.storageProvider=h.Storage,this.Yt(),s=t,r=this,(0,c.Mt)()||(n=(0,u.o)(),e=null!=(e=n.instances)?e:{},r=r,null!=e[s]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[s]=r,n.lastInstance=r,n.instances=e,__STATSIG__=n)}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"}),this.Qt("Uninitialized",null),this.xn=null,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)=>(n.bootstrapMetadata&&(i.bootstrapMetadata=n.bootstrapMetadata),{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.2.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)},98:(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{$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(98),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{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{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{$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(String(null!=(l=null==(l=t.additionalValues)?void 0:l.salt)?l:"")+"."+(null!=(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){"Uninitialized"===this.loadingStatus&&(this.Ht.start(),this.updateSync(t))}initializeAsync(t){return i(this,void 0,void 0,function*(){return this.xn||(this.xn=this.Dn(t)),this.xn})}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)})}Dn(t){return i(this,void 0,void 0,function*(){return u.Storage.isReady()||(yield u.Storage.isReadyResolver()),this.Ht.start(),this.updateAsync(t)})}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{$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>2]|=i<>2]|=(192|i>>6)<>2]|=(224|i>>12)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>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})()); \ No newline at end of file +!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)=>{var i;$Q2(n,"__esModule",{value:!0}),n.t=n.i=n.o=void 0;const s=e(512);n.o=()=>__STATSIG__||l,n.i=t=>(0,n.o)()[t];n.t=t=>{var e=(0,n.o)();return t?e.instances&&e.instances[t]:(e.instances&&1{$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{$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,tag:r}):(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,tag:r})))}).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={},_={Startup:"startup",GainedFocus:"gained_focus"};class f{static wi(t){null!=(t=v[t])&&t.flush().catch(()=>{})}static Ti(t){null!=(t=v[t])&&t.ct(_.GainedFocus)}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)&&f.wi(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?f.wi(this.S):"foreground"===t&&f.Ti(this.S)}),this.ct(_.Startup),this.ht())}stop(){return i(this,void 0,void 0,function*(){this._t&&(clearInterval(this._t),this._t=null),delete v[this.S],yield this.flush()})}flush(){return i(this,void 0,void 0,function*(){var t;this.gt(),0!==this.Z.length&&(t=this.Z,this.Z=[],yield this.bt(t))})}ft(){this.it||(this.it=!0,200f.wi(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{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):f.wi(this.S)},t);this._t=e}}e.EventLogger=f},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>>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}e.LogLevel={None:0,Error:1,Warn:2,Info:3,Debug:4};class i{static info(...t){this.level>=e.LogLevel.Info&&console.info(" INFO ",...n(t))}static debug(...t){this.level>=e.LogLevel.Debug&&console.debug(" DEBUG ",...n(t))}static warn(...t){this.level>=e.LogLevel.Warn&&console.warn(" WARN ",...n(t))}static error(...t){this.level>=e.LogLevel.Error&&console.error(" ERROR ",...n(t))}}(e.Log=i).level=e.LogLevel.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),p=n(962),b=n(512),o=n(410),l=n(902),a=n(830),c=n(143),d=n(122),y=n(636),h=n(0),m=n(397),O=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!!j(i)&&(t=yield this.Nt(i),e=yield this.Gt(i),(n=navigator).sendBeacon.bind(n)(e,t))})}Pt(_){var f,g;return r(this,void 0,void 0,function*(){if(!j(_))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,m.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&&p.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&&p.Diagnostics.pn(_.sdkKey,p.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&&p.Diagnostics.pn(_.sdkKey,p.Diagnostics.wn(o,s,"",t)),!i||iencodeURIComponent(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 j=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.xn=null,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),this.dataAdapter=e,this.dataAdapter.attach(t,i),this.storageProvider=h.Storage,this.Yt(),s=t,r=this,(0,c.Mt)()||(n=(0,u.o)(),e=null!=(e=n.instances)?e:{},r=r,null!=e[s]&&a.Log.warn("Creating multiple Statsig clients with the same SDK key can lead to unexpected behavior. Multi-instance support requires different SDK keys."),e[s]=r,n.firstInstance||(n.firstInstance=r),n.instances=e,__STATSIG__=n)}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"}),this.Qt("Uninitialized",null),this.xn=null,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),e.ErrorTag=void 0,e.ErrorTag={NetworkError:"NetworkError"}},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)=>(n.bootstrapMetadata&&(i.bootstrapMetadata=n.bootstrapMetadata),{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.3.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)},98:(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{$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(98),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{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{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{$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(String(null!=(l=null==(l=t.additionalValues)?void 0:l.salt)?l:"")+"."+(null!=(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){"Uninitialized"===this.loadingStatus&&(this.Ht.start(),this.updateSync(t))}initializeAsync(t){return i(this,void 0,void 0,function*(){return this.xn||(this.xn=this.Dn(t)),this.xn})}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)})}Dn(t){return i(this,void 0,void 0,function*(){return u.Storage.isReady()||(yield u.Storage.isReadyResolver()),this.Ht.start(),this.updateAsync(t)})}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{$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>2]|=i<>2]|=(192|i>>6)<>2]|=(224|i>>12)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>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,g,p,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?(g=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),g=e&n,h=g^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),p=s&e,h=p^s&n^g,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^p,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})()); \ No newline at end of file