dd-trace 6.20.1 → 6.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ci/diagnose.js +9 -14
- package/ci/init.js +1 -2
- package/ci/test-optimization-validation/ci-discovery.js +9 -4
- package/ci/test-optimization-validation/executable.js +1 -5
- package/ci/test-optimization-validation/framework-adapters/cypress.js +1 -4
- package/ci/test-optimization-validation/framework-adapters/vitest.js +1 -1
- package/ci/test-optimization-validation/generated-files.js +6 -4
- package/ci/test-optimization-validation/generated-test-contract.js +7 -3
- package/ci/test-optimization-validation/manifest-scaffold.js +7 -2
- package/ci/test-optimization-validation/manifest-schema.js +6 -7
- package/ci/test-optimization-validation/report-writer.js +6 -2
- package/ci/test-optimization-validation/runner-command.js +2 -4
- package/ci/test-optimization-validation/runner-contract.js +1 -2
- package/ci/test-optimization-validation/scenarios/auto-test-retries.js +1 -15
- package/ci/vitest-no-worker-init-setup.mjs +10 -7
- package/index.d.ts +116 -17
- package/initialize.mjs +1 -3
- package/openfeature/rules-based.d.ts +11 -0
- package/openfeature/rules-based.js +7 -0
- package/package.json +13 -11
- package/packages/datadog-core/src/storage.js +16 -0
- package/packages/datadog-esbuild/index.js +18 -12
- package/packages/datadog-instrumentations/src/aerospike.js +3 -3
- package/packages/datadog-instrumentations/src/ai.js +3 -3
- package/packages/datadog-instrumentations/src/aws-durable-execution-sdk-js.js +0 -6
- package/packages/datadog-instrumentations/src/aws-sdk.js +21 -13
- package/packages/datadog-instrumentations/src/cassandra-driver.js +25 -20
- package/packages/datadog-instrumentations/src/claude-agent-sdk.js +9 -23
- package/packages/datadog-instrumentations/src/cucumber.js +48 -33
- package/packages/datadog-instrumentations/src/elasticsearch.js +1 -5
- package/packages/datadog-instrumentations/src/electron.js +6 -6
- package/packages/datadog-instrumentations/src/fastify.js +13 -4
- package/packages/datadog-instrumentations/src/fs.js +2 -2
- package/packages/datadog-instrumentations/src/google-cloud-pubsub.js +9 -5
- package/packages/datadog-instrumentations/src/grpc/client.js +2 -0
- package/packages/datadog-instrumentations/src/helpers/bundler-register.js +2 -2
- package/packages/datadog-instrumentations/src/helpers/check-require-cache.js +1 -2
- package/packages/datadog-instrumentations/src/helpers/instrument.js +1 -1
- package/packages/datadog-instrumentations/src/helpers/register.js +36 -1
- package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +2 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentation-registry.js +87 -6
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql-jit.js +5 -6
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/postgres.js +48 -31
- package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +64 -11
- package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +1 -0
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms/postgres.js +42 -4
- package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +7 -10
- package/packages/datadog-instrumentations/src/ioredis.js +7 -5
- package/packages/datadog-instrumentations/src/iovalkey.js +7 -5
- package/packages/datadog-instrumentations/src/jest.js +122 -11
- package/packages/datadog-instrumentations/src/knex.js +9 -5
- package/packages/datadog-instrumentations/src/mariadb-bundle.js +3 -3
- package/packages/datadog-instrumentations/src/mocha/common.js +20 -8
- package/packages/datadog-instrumentations/src/mocha/main.js +140 -43
- package/packages/datadog-instrumentations/src/mocha/utils.js +127 -38
- package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +61 -34
- package/packages/datadog-instrumentations/src/mocha/worker.js +7 -5
- package/packages/datadog-instrumentations/src/mongodb-core.js +3 -3
- package/packages/datadog-instrumentations/src/mongoose.js +3 -3
- package/packages/datadog-instrumentations/src/nova-sonic/audio.js +173 -0
- package/packages/datadog-instrumentations/src/nova-sonic/index.js +209 -0
- package/packages/datadog-instrumentations/src/nova-sonic/session.js +483 -0
- package/packages/datadog-instrumentations/src/openai-realtime/index.js +18 -6
- package/packages/datadog-instrumentations/src/openai-realtime/session.js +1 -1
- package/packages/datadog-instrumentations/src/openai.js +7 -0
- package/packages/datadog-instrumentations/src/pino.js +5 -6
- package/packages/datadog-instrumentations/src/playwright.js +3 -0
- package/packages/datadog-instrumentations/src/redis.js +27 -13
- package/packages/datadog-instrumentations/src/router.js +30 -0
- package/packages/datadog-instrumentations/src/rum-browser-scripts.js +2 -6
- package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +7 -5
- package/packages/datadog-instrumentations/src/vitest-main.js +9 -17
- package/packages/datadog-instrumentations/src/vitest-util.js +2 -2
- package/packages/datadog-instrumentations/src/vitest-worker.js +1 -2
- package/packages/datadog-instrumentations/src/vitest.js +2 -2
- package/packages/datadog-instrumentations/src/webdriverio.js +118 -21
- package/packages/datadog-instrumentations/src/ws.js +1 -4
- package/packages/datadog-plugin-amqplib/src/client.js +1 -2
- package/packages/datadog-plugin-avsc/src/schema_iterator.js +1 -5
- package/packages/datadog-plugin-aws-durable-execution-sdk-js/src/handler.js +1 -2
- package/packages/datadog-plugin-aws-sdk/src/base.js +5 -8
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/index.js +18 -0
- package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/sonic.js +45 -0
- package/packages/datadog-plugin-aws-sdk/src/services/kinesis.js +9 -3
- package/packages/datadog-plugin-aws-sdk/src/services/sqs.js +2 -5
- package/packages/datadog-plugin-azure-durable-functions/src/index.js +5 -4
- package/packages/datadog-plugin-azure-functions/src/index.js +5 -3
- package/packages/datadog-plugin-claude-agent-sdk/src/index.js +0 -2
- package/packages/datadog-plugin-cypress/src/cypress-plugin.js +18 -5
- package/packages/datadog-plugin-cypress/src/index.js +6 -6
- package/packages/datadog-plugin-cypress/src/source-map-utils.js +1 -2
- package/packages/datadog-plugin-cypress/src/support.js +1 -4
- package/packages/datadog-plugin-express/src/code_origin.js +1 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/consumer.js +2 -2
- package/packages/datadog-plugin-google-cloud-pubsub/src/producer.js +1 -2
- package/packages/datadog-plugin-graphql/src/execute.js +5 -5
- package/packages/datadog-plugin-grpc/src/util.js +1 -2
- package/packages/datadog-plugin-kafkajs/src/producer.js +1 -2
- package/packages/datadog-plugin-mocha/src/index.js +223 -39
- package/packages/datadog-plugin-mocha/src/webdriverio-video.js +453 -0
- package/packages/datadog-plugin-mongodb-core/src/query.js +8 -5
- package/packages/datadog-plugin-next/src/index.js +1 -2
- package/packages/datadog-plugin-openai/src/tracing.js +5 -2
- package/packages/datadog-plugin-openai-agents/src/integration.js +6 -2
- package/packages/datadog-plugin-openai-agents/src/processor.js +2 -4
- package/packages/datadog-plugin-postgres/src/index.js +24 -0
- package/packages/datadog-plugin-protobufjs/src/schema_iterator.js +1 -5
- package/packages/datadog-plugin-rhea/src/consumer.js +1 -4
- package/packages/datadog-plugin-vitest/src/index.js +5 -2
- package/packages/datadog-shimmer/src/shimmer.js +5 -4
- package/packages/datadog-webpack/index.js +55 -43
- package/packages/datadog-webpack/src/loader.js +56 -8
- package/packages/dd-trace/src/aiguard/integrations/vercel-ai.js +2 -4
- package/packages/dd-trace/src/aiguard/messages/utils.js +1 -2
- package/packages/dd-trace/src/aiguard/redaction.js +8 -2
- package/packages/dd-trace/src/appsec/api_security/normalized-route.js +3 -2
- package/packages/dd-trace/src/appsec/api_security/sampler.js +2 -6
- package/packages/dd-trace/src/appsec/downstream_requests.js +1 -9
- package/packages/dd-trace/src/appsec/handlers/http-request.js +3 -9
- package/packages/dd-trace/src/appsec/handlers/http-response.js +7 -2
- package/packages/dd-trace/src/appsec/iast/analyzers/path-traversal-analyzer.js +4 -3
- package/packages/dd-trace/src/appsec/iast/analyzers/set-cookies-header-interceptor.js +1 -4
- package/packages/dd-trace/src/appsec/iast/taint-tracking/operations-taint-object.js +7 -1
- package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +1 -3
- package/packages/dd-trace/src/appsec/iast/taint-tracking/rewriter-esm.mjs +1 -3
- package/packages/dd-trace/src/appsec/iast/telemetry/iast-metric.js +1 -6
- package/packages/dd-trace/src/appsec/lambda.js +1 -3
- package/packages/dd-trace/src/appsec/rasp/fs-plugin.js +37 -27
- package/packages/dd-trace/src/appsec/rasp/lfi.js +9 -5
- package/packages/dd-trace/src/appsec/reporter.js +21 -1
- package/packages/dd-trace/src/appsec/stack_trace.js +1 -2
- package/packages/dd-trace/src/ci-visibility/dynamic-atr-retries.js +3 -6
- package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/msgpack-to-json.js +1 -1
- package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +13 -7
- package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +1 -2
- package/packages/dd-trace/src/ci-visibility/exporters/test-worker/index.js +2 -8
- package/packages/dd-trace/src/ci-visibility/resolve-runfile-path.js +54 -0
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache-schema.js +5 -8
- package/packages/dd-trace/src/ci-visibility/test-optimization-http-cache.js +2 -53
- package/packages/dd-trace/src/config/config-types.d.ts +2 -2
- package/packages/dd-trace/src/config/defaults.js +5 -5
- package/packages/dd-trace/src/config/generated-config-types.d.ts +8 -0
- package/packages/dd-trace/src/config/helper.js +34 -3
- package/packages/dd-trace/src/config/index.js +10 -9
- package/packages/dd-trace/src/config/normalize-service.js +1 -1
- package/packages/dd-trace/src/config/parsers.js +2 -2
- package/packages/dd-trace/src/config/supported-configurations.json +35 -0
- package/packages/dd-trace/src/datastreams/processor.js +3 -2
- package/packages/dd-trace/src/datastreams/schemas/schema_builder.js +1 -4
- package/packages/dd-trace/src/debugger/constants.js +1 -0
- package/packages/dd-trace/src/debugger/devtools_client/index.js +5 -3
- package/packages/dd-trace/src/debugger/devtools_client/remote_config.js +17 -12
- package/packages/dd-trace/src/debugger/devtools_client/send.js +7 -2
- package/packages/dd-trace/src/debugger/devtools_client/status.js +1 -0
- package/packages/dd-trace/src/debugger/devtools_client/worker-error.js +21 -0
- package/packages/dd-trace/src/debugger/guardrail-metrics.js +2 -2
- package/packages/dd-trace/src/debugger/index.js +24 -2
- package/packages/dd-trace/src/debugger/probe_sampler.js +108 -11
- package/packages/dd-trace/src/dogstatsd.js +1 -1
- package/packages/dd-trace/src/encode/tags-processors.js +2 -2
- package/packages/dd-trace/src/exporters/common/request.js +2 -5
- package/packages/dd-trace/src/exporters/common/url.js +1 -1
- package/packages/dd-trace/src/id.js +15 -5
- package/packages/dd-trace/src/lambda/handler.js +179 -19
- package/packages/dd-trace/src/lambda/index.js +15 -1
- package/packages/dd-trace/src/lambda/runtime/patch.js +34 -7
- package/packages/dd-trace/src/llmobs/agent-manifest.js +296 -0
- package/packages/dd-trace/src/llmobs/audio-utils.js +3 -2
- package/packages/dd-trace/src/llmobs/constants/tags.js +13 -0
- package/packages/dd-trace/src/llmobs/experiments/experiment.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/anthropic/index.js +15 -0
- package/packages/dd-trace/src/llmobs/plugins/genai/util.js +1 -2
- package/packages/dd-trace/src/llmobs/plugins/langchain/handlers/chat_model.js +1 -3
- package/packages/dd-trace/src/llmobs/plugins/langgraph/index.js +1 -1
- package/packages/dd-trace/src/llmobs/plugins/nova-sonic.js +92 -0
- package/packages/dd-trace/src/llmobs/plugins/openai/index.js +56 -2
- package/packages/dd-trace/src/llmobs/plugins/openai/utils.js +38 -0
- package/packages/dd-trace/src/llmobs/prompts/manager.js +5 -7
- package/packages/dd-trace/src/llmobs/prompts/prompt.js +1 -1
- package/packages/dd-trace/src/llmobs/sdk.js +23 -6
- package/packages/dd-trace/src/llmobs/span_processor.js +18 -8
- package/packages/dd-trace/src/llmobs/tagger.js +56 -3
- package/packages/dd-trace/src/llmobs/util.js +1 -2
- package/packages/dd-trace/src/llmobs/writers/base.js +7 -6
- package/packages/dd-trace/src/llmobs/writers/util.js +3 -1
- package/packages/dd-trace/src/log/log.js +1 -5
- package/packages/dd-trace/src/openfeature/agentless_configuration_source.js +30 -1
- package/packages/dd-trace/src/openfeature/configuration_source.js +17 -2
- package/packages/dd-trace/src/openfeature/debug-logging-hook.js +25 -0
- package/packages/dd-trace/src/openfeature/evaluation-telemetry-opt-out-hook.js +51 -0
- package/packages/dd-trace/src/openfeature/flagging_provider.js +59 -3
- package/packages/dd-trace/src/openfeature/remote_config.js +9 -0
- package/packages/dd-trace/src/openfeature/writers/util.js +43 -4
- package/packages/dd-trace/src/opentelemetry/logs/otlp_transformer.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/otlp_transformer.js +1 -1
- package/packages/dd-trace/src/opentelemetry/metrics/periodic_metric_reader.js +1 -2
- package/packages/dd-trace/src/opentelemetry/otlp/common.proto +1 -1
- package/packages/dd-trace/src/opentelemetry/resource-attributes.js +1 -1
- package/packages/dd-trace/src/opentelemetry/trace/otlp_transformer.js +6 -23
- package/packages/dd-trace/src/opentracing/propagation/text_map.js +53 -13
- package/packages/dd-trace/src/otel-sampling.js +4 -5
- package/packages/dd-trace/src/otel-thread-ctx.js +81 -15
- package/packages/dd-trace/src/plugins/database.js +7 -16
- package/packages/dd-trace/src/plugins/util/git.js +9 -25
- package/packages/dd-trace/src/plugins/util/inferred_proxy.js +1 -5
- package/packages/dd-trace/src/plugins/util/test.js +48 -4
- package/packages/dd-trace/src/priority_sampler.js +1 -2
- package/packages/dd-trace/src/profiling/profiler.js +4 -6
- package/packages/dd-trace/src/profiling/profilers/wall.js +4 -10
- package/packages/dd-trace/src/proxy.js +3 -2
- package/packages/dd-trace/src/ritm.js +4 -2
- package/packages/dd-trace/src/serverless.js +10 -0
- package/packages/dd-trace/src/span_processor.js +13 -17
- package/packages/dd-trace/src/storage-channels.js +112 -46
- package/packages/dd-trace/src/telemetry/endpoints.js +1 -3
- package/packages/dd-trace/src/util.js +29 -0
- package/packages/dd-trace/src/web-tags-cache.js +6 -2
- package/vendor/dist/@datadog/openfeature-node-server/index.js +1 -1
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/LICENSE +201 -0
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/index.d.ts +925 -0
- package/vendor/dist/@datadog/openfeature-node-server/rules-based/index.js +1 -0
- package/vendor/dist/@datadog/sketches-js/index.js +1 -1
- package/vendor/dist/protobufjs/index.js +1 -1
- package/vendor/dist/protobufjs/minimal/index.js +1 -1
- package/vendor/dist/shell-quote/index.js +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={"./@datadog/flagging-core/cjs/cache/abstract-assignment-cache.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AbstractAssignmentCache=void 0,t.assignmentCacheKeyToString=assignmentCacheKeyToString,t.assignmentCacheValueToString=assignmentCacheValueToString;let a=r("./@datadog/flagging-core/cjs/obfuscation.js");function assignmentCacheKeyToString(e){let t={flag:{key:e.flag.key},subject:{id:e.subject.id,attributes:e.subject.attributes}};return(0,a.getMD5Hash)(JSON.stringify(t))}function assignmentCacheValueToString(e){return(0,a.getMD5Hash)(JSON.stringify(e))}let AbstractAssignmentCache=class AbstractAssignmentCache{constructor(e){this.delegate=e}init(){return Promise.resolve()}has(e){return this.get(e)===assignmentCacheValueToString(e)}get(e){return this.delegate.get(assignmentCacheKeyToString(e))}set(e){this.delegate.set(assignmentCacheKeyToString(e),assignmentCacheValueToString(e))}entries(){return this.delegate.entries()}clear(){this.delegate.clear()}};t.AbstractAssignmentCache=AbstractAssignmentCache},"./@datadog/flagging-core/cjs/cache/index.js"(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r("./@datadog/flagging-core/cjs/cache/abstract-assignment-cache.js"),t),n(r("./@datadog/flagging-core/cjs/cache/lru-in-memory-assignment-cache.js"),t),n(r("./@datadog/flagging-core/cjs/cache/non-expiring-in-memory-cache-assignment.js"),t)},"./@datadog/flagging-core/cjs/cache/lru-cache.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUCache=void 0;let LRUCache=class LRUCache{constructor(e){this.capacity=e,this.cache=new Map}entries(){return this.cache.entries()}clear(){this.cache.clear()}delete(e){return this.cache.delete(e)}keys(){return this.cache.keys()}values(){return this.cache.values()}has(e){return this.cache.has(e)}get(e){if(!this.has(e))return;let t=this.cache.get(e);return void 0!==t&&(this.delete(e),this.cache.set(e,t)),t}set(e,t){if(0===this.capacity)return this;if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){let e=this.cache.keys().next().value;e&&this.delete(e)}return this.cache.set(e,t),this}};t.LRUCache=LRUCache},"./@datadog/flagging-core/cjs/cache/lru-in-memory-assignment-cache.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.LRUInMemoryAssignmentCache=void 0;let a=r("./@datadog/flagging-core/cjs/cache/abstract-assignment-cache.js"),n=r("./@datadog/flagging-core/cjs/cache/lru-cache.js");let LRUInMemoryAssignmentCache=class LRUInMemoryAssignmentCache extends a.AbstractAssignmentCache{constructor(e){super(new n.LRUCache(e))}};t.LRUInMemoryAssignmentCache=LRUInMemoryAssignmentCache},"./@datadog/flagging-core/cjs/cache/non-expiring-in-memory-cache-assignment.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NonExpiringInMemoryAssignmentCache=void 0;let a=r("./@datadog/flagging-core/cjs/cache/abstract-assignment-cache.js");let NonExpiringInMemoryAssignmentCache=class NonExpiringInMemoryAssignmentCache extends a.AbstractAssignmentCache{constructor(e=new Map){super(e)}};t.NonExpiringInMemoryAssignmentCache=NonExpiringInMemoryAssignmentCache},"./@datadog/flagging-core/cjs/configuration/configuration.js"(e,t){"use strict";function configMatchesContext(e,t){if(!(null==e?void 0:e.precomputed))return!1;let r=e.precomputed.context;return!r||contextsEqual(r,t)}function contextsEqual(e,t){return objectsEqual(e,t)}function objectsEqual(e,t){let r=Object.keys(e).sort(),a=Object.keys(t).sort();if(r.length!==a.length)return!1;for(let n=0;n<r.length;n++)if(r[n]!==a[n]||!valuesEqual(e[r[n]],t[a[n]]))return!1;return!0}function isRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function valuesEqual(e,t){return e===t||null!=e&&null!=t&&typeof e==typeof t&&(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((e,r)=>valuesEqual(e,t[r])):!!(isRecord(e)&&isRecord(t))&&objectsEqual(e,t))}Object.defineProperty(t,"__esModule",{value:!0}),t.configMatchesContext=configMatchesContext},"./@datadog/flagging-core/cjs/configuration/exposureEvent.js"(e,t){"use strict";function createExposureEvent(e,t){var r,a,n;if(!(null==(r=t.flagMetadata)?void 0:r.doLog))return;let i=null==(a=t.flagMetadata)?void 0:a.allocationKey,o=t.variant;if(!i||!o)return;let{targetingKey:s="",...u}=e,l=null==(n=t.flagMetadata)?void 0:n.__dd_split_serial_id;return{allocation:{key:i},flag:{key:t.flagKey},variant:{key:o},..."number"==typeof l?{serial_id:l}:{},subject:{id:s,attributes:u}}}Object.defineProperty(t,"__esModule",{value:!0}),t.createExposureEvent=createExposureEvent},"./@datadog/flagging-core/cjs/configuration/exposureEvent.types.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"./@datadog/flagging-core/cjs/configuration/flagEvaluationAggregator.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FlagEvaluationAggregator=void 0;let a=r("./@datadog/flagging-core/cjs/obfuscation.js"),n=r("./@datadog/flagging-core/cjs/time.js"),i=r("./@datadog/flagging-core/cjs/configuration/flagEvaluationEvent.js");let FlagEvaluationAggregator=class FlagEvaluationAggregator{constructor(e,t){this.aggregatedData=new Map,this.flushInterval=e,this.onFlush=t}start(){this.intervalId=setInterval(()=>{this.flush()},this.flushInterval)}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.flush()}addEvaluation(e,t,r){var a,n;let i=this.createAggregationKeyString(e,t,r),o=getEvaluationTimestamp(t),s=this.aggregatedData.get(i);if(s)s.count++,s.lastEvaluation=o,r&&(s.error=r);else{let s=isRuntimeDefaultUsed(t),u=null==(a=t.flagMetadata)?void 0:a.allocationKey,l=null==(n=t.flagMetadata)?void 0:n.targetingRuleKey,{targetingKey:c,...g}=e;this.aggregatedData.set(i,{flagKey:t.flagKey,variantKey:t.variant,allocationKey:u,targetingRuleKey:l,targetingKey:c,targetingContext:g,count:1,firstEvaluation:o,lastEvaluation:o,runtimeDefaultUsed:s,error:r})}}flush(){if(0===this.aggregatedData.size)return;let e=(0,n.timeStampNow)(),t=Array.from(this.aggregatedData.values()).map(t=>(0,i.createFlagEvaluationEvent)(t,e));this.aggregatedData.clear(),this.onFlush(t)}createAggregationKeyString(e,t,r){var n,i;let o=null==(n=t.flagMetadata)?void 0:n.allocationKey,s=null==(i=t.flagMetadata)?void 0:i.targetingRuleKey,{targetingKey:u,...l}=e;return(0,a.getMD5Hash)(JSON.stringify({flagKey:t.flagKey,variant:t.variant||"",allocationKey:o||"",targetingRuleKey:s||"",targetingKey:u||"",targetingContext:l,error:r||""}))}};function getEvaluationTimestamp(e){var t;let r=null==(t=e.flagMetadata)?void 0:t.__dd_eval_timestamp_ms;return Number.isFinite(r)?r:(0,n.timeStampNow)()}function isRuntimeDefaultUsed(e){return null==e.variant}t.FlagEvaluationAggregator=FlagEvaluationAggregator},"./@datadog/flagging-core/cjs/configuration/flagEvaluationEvent.js"(e,t){"use strict";function createFlagEvaluationEvent(e,t){let r={flag:{key:e.flagKey},first_evaluation:e.firstEvaluation,last_evaluation:e.lastEvaluation,evaluation_count:e.count,runtime_default_used:e.runtimeDefaultUsed,timestamp:t};return null!=e.targetingKey&&(r.targeting_key=e.targetingKey),e.error&&(r.error={message:e.error}),e.variantKey&&(r.variant={key:e.variantKey}),e.allocationKey&&(r.allocation={key:e.allocationKey}),e.targetingRuleKey&&(r.targeting_rule={key:e.targetingRuleKey}),e.targetingContext&&Object.keys(e.targetingContext).length>0&&(r.context={evaluation:e.targetingContext}),r}Object.defineProperty(t,"__esModule",{value:!0}),t.createFlagEvaluationEvent=createFlagEvaluationEvent},"./@datadog/flagging-core/cjs/configuration/flagEvaluationEvent.types.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},"./@datadog/flagging-core/cjs/configuration/index.js"(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.parsePrecomputedConfigurationResponse=t.configurationToString=t.configurationFromString=void 0,n(r("./@datadog/flagging-core/cjs/configuration/configuration.js"),t),n(r("./@datadog/flagging-core/cjs/configuration/exposureEvent.js"),t),n(r("./@datadog/flagging-core/cjs/configuration/exposureEvent.types.js"),t),n(r("./@datadog/flagging-core/cjs/configuration/flagEvaluationAggregator.js"),t),n(r("./@datadog/flagging-core/cjs/configuration/flagEvaluationEvent.js"),t),n(r("./@datadog/flagging-core/cjs/configuration/flagEvaluationEvent.types.js"),t),n(r("./@datadog/flagging-core/cjs/configuration/precomputed-context.js"),t);var i=r("./@datadog/flagging-core/cjs/configuration/precomputed-wire.js");Object.defineProperty(t,"configurationFromString",{enumerable:!0,get:function(){return i.configurationFromPrecomputedString}}),Object.defineProperty(t,"configurationToString",{enumerable:!0,get:function(){return i.configurationToPrecomputedString}});var o=r("./@datadog/flagging-core/cjs/configuration/wire-validation.js");Object.defineProperty(t,"parsePrecomputedConfigurationResponse",{enumerable:!0,get:function(){return o.parsePrecomputedConfigurationResponse}})},"./@datadog/flagging-core/cjs/configuration/precomputed-context.js"(e,t){"use strict";function isDate(e){if(null===e||"object"!=typeof e)return!1;try{return Date.prototype.getTime.call(e),!0}catch(e){return!1}}function cloneContextValue(e){return isDate(e)?new Date(Date.prototype.getTime.call(e)):Array.isArray(e)?e.map(cloneContextValue):null!==e&&"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[e,cloneContextValue(t)])):e}function cloneEvaluationContext(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,cloneContextValue(t)]))}function getPrecomputedContext(e){var t;let r=null==(t=e.precomputed)?void 0:t.context;return void 0===r?void 0:cloneEvaluationContext(r)}Object.defineProperty(t,"__esModule",{value:!0}),t.getPrecomputedContext=getPrecomputedContext},"./@datadog/flagging-core/cjs/configuration/precomputed-wire.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.configurationFromPrecomputedString=configurationFromPrecomputedString,t.configurationToPrecomputedString=configurationToPrecomputedString,t.precomputedConfigurationFromWire=precomputedConfigurationFromWire,t.precomputedConfigurationToWire=precomputedConfigurationToWire;let a=r("./@datadog/flagging-core/cjs/configuration/wire-types.js"),n=r("./@datadog/flagging-core/cjs/configuration/wire-validation.js");function configurationFromPrecomputedString(e){let t=(0,a.parseConfigurationWire)(e);return t?precomputedConfigurationFromWire(t):{configurationError:a.INVALID_CONFIGURATION_WIRE_ERROR}}function configurationToPrecomputedString(e){return JSON.stringify(precomputedConfigurationToWire(e))}function precomputedConfigurationFromWire(e){if(void 0===e.precomputed)return{};if(!(0,n.isPrecomputedWireEntry)(e.precomputed))return{precomputedError:"Invalid precomputed configuration wire entry"};let{precomputed:t}=e,r=(0,a.decodeSafely)(()=>(0,n.parsePrecomputedConfigurationResponse)(JSON.parse(t.response)));return r?"error"in r?{precomputedError:r.error}:{precomputed:{...t,...r}}:{precomputedError:"Precomputed configuration response is not valid JSON"}}function precomputedConfigurationToWire(e){let t={version:1};if(!e.precomputed)return t;let{context:r,response:a,fetchedAt:n,etag:i}=e.precomputed;return t.precomputed={context:r,response:JSON.stringify(a),fetchedAt:n,etag:i},t}},"./@datadog/flagging-core/cjs/configuration/prepared-rules-response.js"(e,t){"use strict";function prepareRulesResponse(e){return e.evaluationRegexCache&&e.evaluationJsonCache||Object.defineProperties(e,{evaluationRegexCache:{value:new Map},evaluationJsonCache:{value:new Map}}),e}Object.defineProperty(t,"__esModule",{value:!0}),t.prepareRulesResponse=prepareRulesResponse},"./@datadog/flagging-core/cjs/configuration/wire-types.js"(e,t){"use strict";function parseConfigurationWire(e){let t;try{t=JSON.parse(e)}catch(e){return}if("object"==typeof t&&null!==t&&"version"in t&&1===t.version)return t}function decodeSafely(e){try{return e()}catch(e){return}}Object.defineProperty(t,"__esModule",{value:!0}),t.INVALID_CONFIGURATION_WIRE_ERROR=void 0,t.parseConfigurationWire=parseConfigurationWire,t.decodeSafely=decodeSafely,t.INVALID_CONFIGURATION_WIRE_ERROR="Invalid flags configuration wire format"},"./@datadog/flagging-core/cjs/configuration/wire-validation.js"(e,t){"use strict";function isWireEntry(e){return isRecord(e)&&"string"==typeof e.response&&(void 0===e.fetchedAt||"number"==typeof e.fetchedAt&&Number.isFinite(e.fetchedAt))&&(void 0===e.etag||"string"==typeof e.etag)}function isPrecomputedWireEntry(e){return isWireEntry(e)&&(!("context"in e)||isEvaluationContext(e.context))}function parsePrecomputedConfigurationResponse(e){if(!isRecord(e))return{error:"Precomputed configuration response must be an object"};if(!isRecord(e.data))return{error:"Precomputed configuration response is missing data"};if(!isRecord(e.data.attributes))return{error:"Precomputed configuration response is missing attributes"};let{createdAt:t,flags:r}=e.data.attributes;if("string"!=typeof t&&("number"!=typeof t||!Number.isFinite(t)))return{error:"Precomputed configuration createdAt is invalid"};if(!isRecord(r))return{error:"Precomputed configuration flags must be an object"};let a=[];for(let[e,t]of Object.entries(r))isPrecomputedFlag(t)||a.push([e,"Invalid precomputed flag configuration"]);return{response:e,...a.length>0?{flagErrors:Object.fromEntries(a)}:{}}}function isEvaluationContext(e){return isRecord(e)&&(void 0===e.targetingKey||"string"==typeof e.targetingKey)&&Object.values(e).every(isJsonValue)}function isPrecomputedFlag(e){if(!isRecord(e)||"string"!=typeof e.allocationKey||"string"!=typeof e.variationKey||"string"!=typeof e.variationType||"string"!=typeof e.reason||"boolean"!=typeof e.doLog)return!1;let t=e.variationType;return"STRING"===t||"string"===t?"string"==typeof e.variationValue:"BOOLEAN"===t||"boolean"===t?"boolean"==typeof e.variationValue:["NUMBER","NUMERIC","INTEGER","number","integer","float"].includes(t)?"number"==typeof e.variationValue&&Number.isFinite(e.variationValue):("OBJECT"===t||"JSON"===t||"object"===t)&&"object"==typeof e.variationValue&&null!==e.variationValue&&isJsonValue(e.variationValue)}function isJsonValue(e){return null===e||"string"==typeof e||"boolean"==typeof e||("number"==typeof e?Number.isFinite(e):Array.isArray(e)?e.every(isJsonValue):isRecord(e)&&Object.values(e).every(isJsonValue))}function isRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}Object.defineProperty(t,"__esModule",{value:!0}),t.isWireEntry=isWireEntry,t.isPrecomputedWireEntry=isPrecomputedWireEntry,t.parsePrecomputedConfigurationResponse=parsePrecomputedConfigurationResponse},"./@datadog/flagging-core/cjs/evaluation/condition-helpers.js"(e,t){"use strict";function compileRegex(e){let t=e.match(/^\(\?([imsu]+)\)/),r=t?[...new Set(t[1])].join(""):"";return new RegExp((t?e.slice(t[0].length):e).replace(/\[:alnum:\]/g,"A-Za-z0-9"),r)}function coerceToString(e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e)return String(e);if("object"==typeof e&&null!==e&&!Array.isArray(e))try{if(e.toString!==Object.prototype.toString)return String(e)}catch(e){}}function coerceToNumber(e){return"number"==typeof e?e:"string"==typeof e&&/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e)?Number(e):void 0}Object.defineProperty(t,"__esModule",{value:!0}),t.compileRegex=compileRegex,t.coerceToString=coerceToString,t.coerceToNumber=coerceToNumber},"./@datadog/flagging-core/cjs/evaluation/errors.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InvalidContextError=t.FlagConfigurationError=t.TargetingKeyMissingError=void 0;let TargetingKeyMissingError=class TargetingKeyMissingError extends Error{constructor(){super("Targeting key is required for split evaluation"),this.name="TargetingKeyMissingError"}};t.TargetingKeyMissingError=TargetingKeyMissingError;let FlagConfigurationError=class FlagConfigurationError extends Error{constructor(e){super(e),this.name="FlagConfigurationError"}};t.FlagConfigurationError=FlagConfigurationError;let InvalidContextError=class InvalidContextError extends Error{constructor(){super("Evaluation context is missing a required partition attribute"),this.name="InvalidContextError"}};t.InvalidContextError=InvalidContextError},"./@datadog/flagging-core/cjs/evaluation/evaluateForSubject.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateForSubject=evaluateForSubject,t.containsMatchingRule=containsMatchingRule;let a=r("./@datadog/flagging-core/cjs/time.js"),n=r("./@datadog/flagging-core/cjs/evaluation/errors.js"),i=r("./@datadog/flagging-core/cjs/evaluation/evaluationMetadata.js"),o=r("./@datadog/flagging-core/cjs/evaluation/matchesShard.js"),s=r("./@datadog/flagging-core/cjs/evaluation/rules.js"),u=r("./@datadog/flagging-core/cjs/evaluation/ufc-v1.js");function evaluateForSubject(e,t,r,n,o,s,l=(0,a.timeStampNow)()){var c;if(!isValidFlag(e))return s.debug("returning default assignment because flag configuration is invalid",{flagKey:isRecord(e)&&"string"==typeof e.key?e.key:void 0,subjectKey:r}),{value:o,reason:"ERROR",errorCode:"PARSE_ERROR",flagMetadata:(0,i.createEvaluationTimestampMetadata)(l)};if(!e.enabled)return s.debug("returning default assignment because flag is disabled",{flagKey:e.key,subjectKey:r}),{value:o,reason:"DISABLED",flagMetadata:(0,i.createEvaluationTimestampMetadata)(l)};if(!validateTypeMatch(t,e.variationType))return s.debug("variant value type mismatch, returning default value",{flagKey:e.key,subjectKey:r,expectedType:t,variantType:e.variationType}),{value:o,reason:"ERROR",errorCode:"TYPE_MISMATCH",flagMetadata:(0,i.createEvaluationTimestampMetadata)(l)};let g=new Date(l);for(let t of e.allocations){if(t.startAt&&g<new Date(t.startAt)){s.debug("allocation before start date",{flagKey:e.key,subjectKey:r,allocationKey:t.key,startAt:t.startAt});continue}if(t.endAt&&g>=new Date(t.endAt)){s.debug("allocation after end date",{flagKey:e.key,subjectKey:r,allocationKey:t.key,endAt:t.endAt});continue}if(!containsMatchingRule(t.rules,n,s))continue;let a=selectSplitUsingSharding(t.splits,r,e.key,s);if(a){let n=e.variations[a.variationKey];if(n){s.debug("evaluated a flag",{flagKey:e.key,subjectKey:r,assignment:n.value});let o=(null==(c=t.rules)?void 0:c.length)?"TARGETING_MATCH":a.shards.length?"SPLIT":t.startAt||t.endAt?"DEFAULT":"STATIC";return{value:n.value,reason:o,variant:n.key,flagMetadata:{...(0,i.createEvaluationTimestampMetadata)(l),__dd_allocation_key:t.key,__dd_do_log:!!t.doLog,__dd_split_serial_id:a.serialId,allocationKey:t.key,variationType:(0,u.variantTypeToFlagValueType)(e.variationType),doLog:!!t.doLog}}}}else s.debug("no matching split found for subject",{flagKey:e.key,subjectKey:r,allocationKey:t.key})}return s.debug("returning default assignment because no allocation matched",{flagKey:e.key,subjectKey:r}),{value:o,reason:"DEFAULT",flagMetadata:(0,i.createEvaluationTimestampMetadata)(l)}}function validateTypeMatch(e,t){if("boolean"===e)return"BOOLEAN"===t;if("string"===e)return"STRING"===t;if("number"===e)return"INTEGER"===t||"NUMERIC"===t;if("object"===e)return"JSON"===t;throw Error(`Invalid expected type: ${e}`)}function isValidFlag(e){if(!isRecord(e)||"string"!=typeof e.key||"boolean"!=typeof e.enabled||!isVariantType(e.variationType)||!isRecord(e.variations)||!Array.isArray(e.allocations))return!1;let t=e.variationType,r=e.variations;return!!Object.entries(r).every(([e,r])=>isRecord(r)&&r.key===e&&isValidVariationValue(t,r.value))&&e.allocations.every(e=>isRecord(e)&&Array.isArray(e.splits)&&e.splits.every(e=>isRecord(e)&&"string"==typeof e.variationKey&&Object.prototype.hasOwnProperty.call(r,e.variationKey)&&Array.isArray(e.shards)&&e.shards.every(isValidShard))&&(void 0===e.rules||Array.isArray(e.rules)&&e.rules.every(e=>(0,s.isValidRule)(e))))}function isRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function isVariantType(e){return"BOOLEAN"===e||"INTEGER"===e||"NUMERIC"===e||"STRING"===e||"JSON"===e}function isValidVariationValue(e,t){switch(e){case"BOOLEAN":return"boolean"==typeof t;case"INTEGER":return"number"==typeof t&&Number.isSafeInteger(t);case"NUMERIC":return"number"==typeof t&&Number.isFinite(t);case"STRING":return"string"==typeof t;case"JSON":return"object"==typeof t&&null!==t}}function isValidShard(e){return!!isRecord(e)&&"string"==typeof e.salt&&!!Number.isInteger(e.totalShards)&&!(e.totalShards<=0)&&!(e.totalShards>0xffffffff)&&!!Array.isArray(e.ranges)&&e.ranges.every(t=>isRecord(t)&&Number.isInteger(t.start)&&Number.isInteger(t.end)&&t.start>=0&&t.end>=t.start&&t.end<=e.totalShards)}function containsMatchingRule(e,t,r){return null==e||!e.length||(r.debug("evaluating rules",{rules:JSON.stringify(e),subjectAttributes:t}),e.some(e=>(0,s.matchesRule)(e,t)))}function selectSplitUsingSharding(e,t,r,a){if(!e||0===e.length)return null;for(let i of e)if(a.debug("evaluating split sharding",{flagKey:r,subjectKey:t,variationKey:i.variationKey,shards:i.shards}),i.shards.every(e=>{if(null==t)throw new n.TargetingKeyMissingError;let s=(0,o.matchesShard)(e,t);return a.debug("shard match result",{flagKey:r,subjectKey:t,variationKey:i.variationKey,shard:e,matches:s}),s}))return a.debug("subject matches split",{flagKey:r,subjectKey:t,variationKey:i.variationKey}),i;return a.debug("subject matches no splits",{flagKey:r,subjectKey:t}),null}},"./@datadog/flagging-core/cjs/evaluation/evaluateProtobufConfiguration.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluateProtobufConfiguration=evaluateProtobufConfiguration;let a=r("./@datadog/flagging-core/cjs/time.js"),n=r("./@datadog/flagging-core/cjs/utf8.js"),i=r("./@datadog/flagging-core/cjs/evaluation/condition-helpers.js"),o=r("./@datadog/flagging-core/cjs/evaluation/errors.js"),s=r("./@datadog/flagging-core/cjs/evaluation/evaluationMetadata.js"),u=r("./@datadog/flagging-core/cjs/evaluation/getOwnProperty.js"),l=r("./@datadog/flagging-core/cjs/evaluation/semver.js"),c=r("./@datadog/flagging-core/cjs/evaluation/sha256.js"),g=r("./@datadog/flagging-core/cjs/evaluation/sharders.js");function evaluateProtobufConfiguration(e,t,r,n,i,l,c=(0,a.timeStampNow)()){let{targetingKey:g}=i,d=(0,u.getOwnProperty)(e.flags,r);if(!d)return l.debug("returning default value because flag is not found",{flagKey:r,targetingKey:g}),{value:n,reason:"ERROR",errorCode:"FLAG_NOT_FOUND",flagMetadata:(0,s.createEvaluationTimestampMetadata)(c)};try{if(d.minimumFeatureLevel>0)throw new o.FlagConfigurationError("Flag requires an unsupported feature level");let a=variationTypeToFlagValueType(d.variationType);if(t!==a)return l.debug("variant value type mismatch, returning default value",{flagKey:r,targetingKey:g,expectedType:t,variantType:d.variationType}),{value:n,reason:"ERROR",errorCode:"TYPE_MISMATCH",flagMetadata:(0,s.createEvaluationTimestampMetadata)(c)};let u=new Map;for(let t of d.allocations){if(!matchesCondition(t.targetingConditionIndex,e,i,u))continue;let a=computePartitionKey(t,e,i,c),n=t.splits.find(e=>matchesSplit(e,a));if(!n)continue;let o=atIndex(d.variations,n.variationIndex,"split variation"),f=atIndex(e.strings,o.keyStringIndex,"variation key"),p=variationValue(d,o.value,e);return l.debug("evaluated a flag",{flagKey:r,targetingKey:g,assignment:p}),{value:p,reason:resolutionReason(n),variant:f,flagMetadata:{...(0,s.createEvaluationTimestampMetadata)(c),__dd_allocation_key:t.key,__dd_do_log:t.logExposureEvent,__dd_split_serial_id:n.serialId,allocationKey:t.key,variationType:variationTypeToFlagValueType(d.variationType),doLog:t.logExposureEvent}}}}catch(e){if(e instanceof o.FlagConfigurationError)return l.error("returning default value because flag configuration is invalid",{flagKey:r,targetingKey:g,error:e.message}),{value:n,reason:"ERROR",errorCode:"PARSE_ERROR",errorMessage:e.message,flagMetadata:(0,s.createEvaluationTimestampMetadata)(c)};if(e instanceof o.TargetingKeyMissingError)return{value:n,reason:"ERROR",errorCode:"TARGETING_KEY_MISSING",flagMetadata:(0,s.createEvaluationTimestampMetadata)(c)};if(e instanceof o.InvalidContextError)return{value:n,reason:"ERROR",errorCode:"INVALID_CONTEXT",flagMetadata:(0,s.createEvaluationTimestampMetadata)(c)};return l.error("Error evaluating flag",{error:e}),{value:n,reason:"ERROR",errorCode:"GENERAL",flagMetadata:(0,s.createEvaluationTimestampMetadata)(c)}}return l.debug("returning default assignment because no allocation matched",{flagKey:r,targetingKey:g}),{value:n,reason:"DEFAULT",flagMetadata:(0,s.createEvaluationTimestampMetadata)(c)}}function matchesCondition(e,t,r,a){let n;if(void 0===e)return!0;let i=a.get(e);if(void 0!==i)return i;let s=atIndex(t.conditions,e,"condition");return n="all"===s.kind.case?s.kind.value.conditionIndexes.every(n=>{if(n>=e)throw new o.FlagConfigurationError("Condition must only reference preceding conditions");return matchesCondition(n,t,r,a)}):"any"===s.kind.case?s.kind.value.conditionIndexes.some(n=>{if(n>=e)throw new o.FlagConfigurationError("Condition must only reference preceding conditions");return matchesCondition(n,t,r,a)}):matchesLeafCondition(s,t,r),a.set(e,n),n}function matchesLeafCondition(e,t,r){let a=e.kind;if(void 0===a.case||"all"===a.case||"any"===a.case)throw new o.FlagConfigurationError("Unsupported condition");let s=attributeValueAt(t,a.value.attributeIndex,r);if("attributePresence"===a.case)return a.value.expectNull?null==s:null!=s;if(null==s)return!1;if("numeric"===a.case){let e=a.value.comparand;if(Number.isNaN(e))throw new o.FlagConfigurationError("Invalid numeric comparator");let t=(0,i.coerceToNumber)(s);if(void 0===t)return!1;let r=a.value.comparator;if(1===r)return t<e;if(2===r)return t<=e;if(3===r)return t>e;if(4===r)return t>=e;throw new o.FlagConfigurationError("Unsupported numeric comparator")}if("regex"===a.case){let e=(0,i.coerceToString)(s);if(void 0===e)return!1;let r=compiledRegexAt(t,a.value.regexIndex).test(e);return a.value.negate?!r:r}if("stringMembership"===a.case){let e=(0,i.coerceToString)(s);if(void 0===e)return!1;let r=containsInternedString(a.value.stringIndexes,e,t.strings);return a.value.negate?!r:r}if("sha256Membership"===a.case){let e=(0,i.coerceToString)(s);if(void 0===e)return!1;let t=containsBytes(a.value.sha256,saltedSha256(a.value.salt,(0,n.encodeUtf8)(e)));return a.value.negate?!t:t}if("version"===a.case){let e=versionAt(t.versions,a.value.versionIndex);if("string"!=typeof s)return!1;let r=(0,l.parseVersion)(s);if(!r)return!1;let n=(0,l.compareVersions)(r,e),i=a.value.comparator;if(1===i)return 0===n;if(2===i)return 0!==n;if(3===i)return n<0;if(4===i)return n<=0;if(5===i)return n>0;if(6===i)return n>=0;throw new o.FlagConfigurationError("Unsupported version comparator")}if("stringComparison"===a.case){let e,r=(0,i.coerceToString)(s);if(void 0===r)return!1;let n=atIndex(t.strings,a.value.stringIndex,"condition string"),u=a.value.comparator;if(1===u)e=r.startsWith(n);else if(2===u)e=r.endsWith(n);else if(3===u)e=r.includes(n);else throw new o.FlagConfigurationError("Unsupported string comparator");return a.value.negate?!e:e}if("sha256StringComparison"===a.case){let e=(0,i.coerceToString)(s);if(void 0===e)return!1;let t=extractUtf8Bytes((0,n.encodeUtf8)(e),a.value.length,a.value.comparator),r=void 0!==t&&0===compareBytes(saltedSha256(a.value.salt,t),a.value.sha256);return a.value.negate?!r:r}throw new o.FlagConfigurationError("Unsupported condition")}function versionAt(e,t){let r=atIndex(e,t,"version");if(!(0,l.isParsedVersion)(r))throw new o.FlagConfigurationError("Invalid version comparator");return r}function saltedSha256(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),(0,c.sha256)(r)}function extractUtf8Bytes(e,t,r){let a;if(1===r)a=0;else if(2===r)a=e.length-t;else throw new o.FlagConfigurationError("Unsupported SHA-256 string comparator");if(t>e.length)return;let n=a+t;if(isUtf8Boundary(e,a)&&isUtf8Boundary(e,n))return e.subarray(a,n)}function isUtf8Boundary(e,t){return 0===t||t===e.length||(192&e[t])!=128}function compiledRegexAt(e,t){let r=e.evaluationRegexCache,a=r.get(t);if(null===a)throw new o.FlagConfigurationError("Invalid regular expression");if(a)return a;let n=atIndex(e.regexes,t,"regex");try{let e=(0,i.compileRegex)(n);return r.set(t,e),e}catch(e){throw r.set(t,null),new o.FlagConfigurationError("Invalid regular expression")}}function computePartitionKey(e,t,r,a){let n=[];for(let s of e.partitionKey)if("time"===s.kind.case)n.push(a);else if("shardMd5"===s.kind.case){let e=atIndex(t.attributes,s.kind.value.attributeIndex,"partition attribute"),a=attributeValue(e,t,r);if(null==a){if("targetingKey"===e.kind.case)throw new o.TargetingKeyMissingError;throw new o.InvalidContextError}let u=safeInteger(s.kind.value.totalShards,"Total shards");if(u<=0)throw new o.FlagConfigurationError("Total shards must be positive");let l=(0,i.coerceToString)(a);if(void 0===l)throw new o.InvalidContextError;n.push(new g.MD5Sharder().getShard(`${s.kind.value.salt}${l}`,u))}else throw new o.FlagConfigurationError("Unsupported partition key");return n}function attributeValueAt(e,t,r){return attributeValue(atIndex(e.attributes,t,"condition attribute"),e,r)}function attributeValue(e,t,r){if("targetingKey"===e.kind.case)return r.targetingKey;if("attributePath"!==e.kind.case)throw new o.FlagConfigurationError("Unsupported attribute reference");let{segments:a}=e.kind.value;if(0===a.length||"objectKeyStringIndex"!==a[0].kind.case)throw new o.FlagConfigurationError("Invalid attribute path");let n=r;for(let e of a)if("objectKeyStringIndex"===e.kind.case){if(!isContextObject(n))return;let r=atIndex(t.strings,e.kind.value,"attribute path");n=(0,u.getOwnProperty)(n,r)}else if("arrayIndex"===e.kind.case){if(!Array.isArray(n))return;n=Object.prototype.hasOwnProperty.call(n,e.kind.value)?n[e.kind.value]:void 0}else throw new o.FlagConfigurationError("Invalid attribute path");return n}function isContextObject(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!(e instanceof Date)}function matchesSplit(e,t){if(e.ranges.length!==t.length)throw new o.FlagConfigurationError("Invalid split");return t.every((t,r)=>{let a=atIndex(e.ranges,r,"partition range");return(void 0===a.from||t>=a.from)&&(void 0===a.to||t<a.to)})}function variationValue(e,t,r){let a=variationValueCase(e.variationType);if(t.case!==a)throw new o.FlagConfigurationError("Variation value does not match flag variation type");if("stringValueIndex"===t.case)return atIndex(r.strings,t.value,"string variation value");if("integerValue"===t.case)return safeInteger(t.value,"Integer variation value");if("numericValue"===t.case){if(!Number.isFinite(t.value))throw new o.FlagConfigurationError("Numeric variation value is not finite");return t.value}if("booleanValue"===t.case)return t.value;if("jsonStringIndex"===t.case)return jsonValueAt(r,t.value);throw new o.FlagConfigurationError("Variation value is missing")}function resolutionReason(e){let t=e.reason;return 1===t?"TARGETING_MATCH":2===t?"SPLIT":3===t?"STATIC":4===t?"DEFAULT":"UNKNOWN"}function variationTypeToFlagValueType(e){if(4===e)return"boolean";if(1===e)return"string";if(2===e||3===e)return"number";if(5===e)return"object";throw new o.FlagConfigurationError("Unsupported variation type")}function variationValueCase(e){if(1===e)return"stringValueIndex";if(2===e)return"integerValue";if(3===e)return"numericValue";if(4===e)return"booleanValue";if(5===e)return"jsonStringIndex";throw new o.FlagConfigurationError("Unsupported variation type")}function containsInternedString(e,t,r){return e.some(e=>atIndex(r,e,"condition string")===t)}function safeInteger(e,t){let r=Number(e);if(!Number.isSafeInteger(r)||String(r)!==String(e))throw new o.FlagConfigurationError(`${t} cannot be represented safely as a JavaScript number`);return r}function atIndex(e,t,r){let a=e[t];if(void 0===a)throw new o.FlagConfigurationError(`Invalid ${r} index`);return a}function jsonValueAt(e,t){let r=e.evaluationJsonCache,a=r.get(t);if(a&&!a.valid)throw new o.FlagConfigurationError("JSON variation value is invalid");if(a)return a.value;let n=atIndex(e.jsonStrings,t,"JSON variation value");try{let e=JSON.parse(n);if("number"==typeof e&&!Number.isFinite(e))throw Error();return r.set(t,{valid:!0,value:e}),e}catch(e){throw r.set(t,{valid:!1}),new o.FlagConfigurationError("JSON variation value is invalid")}}function containsBytes(e,t){return e.some(e=>0===compareBytes(e,t))}function compareBytes(e,t){for(let r=0;r<Math.min(e.length,t.length);r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return e.length===t.length?0:e.length<t.length?-1:1}},"./@datadog/flagging-core/cjs/evaluation/evaluation.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluate=evaluate,t.getFlagsConfigurationError=getFlagsConfigurationError,t.evaluateRulesBasedConfiguration=evaluateRulesBasedConfiguration;let a=r("./@datadog/flagging-core/cjs/configuration/index.js"),n=r("./@datadog/flagging-core/cjs/configuration/prepared-rules-response.js"),i=r("./@datadog/flagging-core/cjs/time.js"),o=r("./@datadog/flagging-core/cjs/evaluation/errors.js"),s=r("./@datadog/flagging-core/cjs/evaluation/evaluateForSubject.js"),u=r("./@datadog/flagging-core/cjs/evaluation/evaluateProtobufConfiguration.js"),l=r("./@datadog/flagging-core/cjs/evaluation/evaluationMetadata.js"),c=r("./@datadog/flagging-core/cjs/evaluation/precomputed-evaluation.js"),g={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}};function evaluate(e,t,r,a,n,i=g){let o=selectFlagsConfiguration(e,n);if("precomputed"===o.kind)return(0,c.evaluatePrecomputedConfiguration)(e,t,r,a,n);if("rules"===o.kind)return evaluateRulesBasedConfiguration(o.configuration.response,t,r,a,n,i);let{error:s}=o;return{value:a,reason:"ERROR",errorCode:s.errorCode,...void 0===s.errorMessage?{}:{errorMessage:s.errorMessage}}}function getFlagsConfigurationError(e,t){let r=selectFlagsConfiguration(e,t);return"error"===r.kind?r.error:void 0}function selectFlagsConfiguration(e,t){var r,n;if(void 0===e)return{kind:"error",error:{errorCode:"PROVIDER_NOT_READY",errorMessage:"No flags configuration has been set"}};if(e.precomputed&&(0,a.configMatchesContext)(e,t))return{kind:"precomputed",configuration:e.precomputed};if(e.rules)return{kind:"rules",configuration:e.rules};let i=null!=(n=null!=(r=e.configurationError)?r:e.rulesError)?n:e.precomputedError;return void 0!==i?{kind:"error",error:{errorCode:"PARSE_ERROR",errorMessage:i}}:e.precomputed?{kind:"error",error:{errorCode:"INVALID_CONTEXT",errorMessage:"Precomputed flags configuration does not match the current context"}}:{kind:"error",error:{errorCode:"PARSE_ERROR",errorMessage:"Flags configuration contains no usable capability"}}}function evaluateRulesBasedConfiguration(e,t,r,a,n,o){let s,u=(0,i.timeStampNow)(),c=(null==e?void 0:e.observeFullEvaluationData)===!0,g=(0,l.createEvaluationMetadata)(u,c);try{s=evaluateRules(e,t,r,a,n,o,u)}catch(e){o.error("Error evaluating flag",{error:e}),s={value:a,reason:"ERROR",errorCode:"GENERAL"}}return{...s,flagMetadata:{...s.flagMetadata,...g}}}function evaluateRules(e,t,r,a,i,c,g){if(!e)return{value:a,reason:"ERROR",errorCode:"PROVIDER_NOT_READY",flagMetadata:(0,l.createEvaluationTimestampMetadata)(g)};if(isProtobufConfiguration(e))return(0,u.evaluateProtobufConfiguration)((0,n.prepareRulesResponse)(e),t,r,a,i,c,g);let{targetingKey:d,...f}=i,p={...null!=d?{id:d}:{},...f};if(!Object.prototype.hasOwnProperty.call(e.flags,r))return c.debug("returning default value because flag is not found",{flagKey:r,subjectKey:d}),{value:a,reason:"ERROR",errorCode:"FLAG_NOT_FOUND",flagMetadata:(0,l.createEvaluationTimestampMetadata)(g)};let v=e.flags[r];try{return(0,s.evaluateForSubject)(v,t,d,p,a,c,g)}catch(e){if(e instanceof o.TargetingKeyMissingError)return{value:a,reason:"ERROR",errorCode:"TARGETING_KEY_MISSING",flagMetadata:(0,l.createEvaluationTimestampMetadata)(g)};return c.error("Error evaluating flag",{error:e}),{value:a,reason:"ERROR",errorCode:"GENERAL",flagMetadata:(0,l.createEvaluationTimestampMetadata)(g)}}}function isProtobufConfiguration(e){return"$typeName"in e&&"datadog.ffe.flagging.ufc.v1.FlagsConfiguration"===e.$typeName}},"./@datadog/flagging-core/cjs/evaluation/evaluationMetadata.js"(e,t){"use strict";function createEvaluationMetadata(e,t){return{__dd_eval_timestamp_ms:e,__dd_observe_full_evaluation_data:!0===t}}function createEvaluationTimestampMetadata(e){return{__dd_eval_timestamp_ms:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.createEvaluationMetadata=createEvaluationMetadata,t.createEvaluationTimestampMetadata=createEvaluationTimestampMetadata},"./@datadog/flagging-core/cjs/evaluation/getOwnProperty.js"(e,t){"use strict";function getOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}Object.defineProperty(t,"__esModule",{value:!0}),t.getOwnProperty=getOwnProperty},"./@datadog/flagging-core/cjs/evaluation/index.js"(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r("./@datadog/flagging-core/cjs/evaluation/errors.js"),t),n(r("./@datadog/flagging-core/cjs/evaluation/evaluateForSubject.js"),t),n(r("./@datadog/flagging-core/cjs/evaluation/evaluation.js"),t),n(r("./@datadog/flagging-core/cjs/evaluation/evaluationMetadata.js"),t),n(r("./@datadog/flagging-core/cjs/evaluation/matchesShard.js"),t),n(r("./@datadog/flagging-core/cjs/evaluation/precomputed-evaluation.js"),t),n(r("./@datadog/flagging-core/cjs/evaluation/rules.js"),t),n(r("./@datadog/flagging-core/cjs/evaluation/sharders.js"),t),n(r("./@datadog/flagging-core/cjs/evaluation/ufc-v1.js"),t)},"./@datadog/flagging-core/cjs/evaluation/matchesShard.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.matchesShard=matchesShard;let a=r("./@datadog/flagging-core/cjs/evaluation/sharders.js");function matchesShard(e,t,r){let n=(null!=r?r:new a.MD5Sharder).getShard(hashKey(e.salt,t),e.totalShards);return e.ranges.some(e=>isInShardRange(n,e))}function isInShardRange(e,t){return t.start<=e&&e<t.end}function hashKey(e,t){return`${e}-${t}`}},"./@datadog/flagging-core/cjs/evaluation/precomputed-evaluation.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluatePrecomputedConfiguration=evaluatePrecomputedConfiguration;let a=r("./@datadog/flagging-core/cjs/configuration/index.js"),n=r("./@datadog/flagging-core/cjs/evaluation/getOwnProperty.js");function evaluatePrecomputedConfiguration(e,t,r,a,n){let i=selectPrecomputedFlagsConfiguration(e,n);if("precomputed"===i.kind)return evaluatePrecomputedFlag(i.configuration,t,r,a);let{error:o}=i;return{value:a,reason:"ERROR",errorCode:o.errorCode,...void 0===o.errorMessage?{}:{errorMessage:o.errorMessage}}}function selectPrecomputedFlagsConfiguration(e,t){var r,n;if(void 0===e)return{kind:"error",error:{errorCode:"PROVIDER_NOT_READY",errorMessage:"No flags configuration has been set"}};if(e.precomputed&&(0,a.configMatchesContext)(e,t))return{kind:"precomputed",configuration:e.precomputed};let i=null!=(n=null!=(r=e.configurationError)?r:e.precomputedError)?n:e.rulesError;return void 0!==i?{kind:"error",error:{errorCode:"PARSE_ERROR",errorMessage:i}}:e.precomputed?{kind:"error",error:{errorCode:"INVALID_CONTEXT",errorMessage:"Precomputed flags configuration does not match the current context"}}:{kind:"error",error:{errorCode:"PARSE_ERROR",errorMessage:"Flags configuration contains no usable capability"}}}function evaluatePrecomputedFlag(e,t,r,a){let i=e.flagErrors?(0,n.getOwnProperty)(e.flagErrors,r):void 0;if(i)return{value:a,reason:"ERROR",errorCode:"PARSE_ERROR",errorMessage:i};let o=(0,n.getOwnProperty)(e.response.data.attributes.flags,r);return o?o.variationType&&variationTypeToOpenFeature(o.variationType)!==t?{value:a,reason:"ERROR",errorCode:"TYPE_MISMATCH"}:{value:o.variationValue,variant:o.variationKey,flagMetadata:{allocationKey:o.allocationKey,variationType:o.variationType,doLog:o.doLog,..."number"==typeof o.serialId?{__dd_split_serial_id:o.serialId}:{}},reason:o.reason}:{value:a,reason:"ERROR",errorCode:"FLAG_NOT_FOUND"}}function variationTypeToOpenFeature(e){return({string:"string",boolean:"boolean",number:"number",integer:"number",float:"number",object:"object",BOOLEAN:"boolean",STRING:"string",NUMERIC:"number",INTEGER:"number",JSON:"object"})[e]||e.toLowerCase()}},"./@datadog/flagging-core/cjs/evaluation/rules.js"(e,t,r){"use strict";var a,n;Object.defineProperty(t,"__esModule",{value:!0}),t.OperatorType=void 0,t.isValidRule=isValidRule,t.matchesRule=matchesRule;let i=r("./@datadog/flagging-core/cjs/evaluation/condition-helpers.js"),o=r("./@datadog/flagging-core/cjs/evaluation/semver.js");(n=a||(t.OperatorType=a={})).MATCHES="MATCHES",n.NOT_MATCHES="NOT_MATCHES",n.GTE="GTE",n.GT="GT",n.LTE="LTE",n.LT="LT",n.ONE_OF="ONE_OF",n.NOT_ONE_OF="NOT_ONE_OF",n.IS_NULL="IS_NULL",n.SEMVER_EQ="SEMVER_EQ",n.SEMVER_NEQ="SEMVER_NEQ",n.SEMVER_LT="SEMVER_LT",n.SEMVER_LTE="SEMVER_LTE",n.SEMVER_GT="SEMVER_GT",n.SEMVER_GTE="SEMVER_GTE";let s=new Set(Object.values(a));function isValidRule(e){return!!isRecord(e)&&!!Array.isArray(e.conditions)&&e.conditions.every(e=>{if(!isRecord(e)||"string"!=typeof e.attribute||"string"!=typeof e.operator||!s.has(e.operator))return!1;if(isNumericOperator(e.operator))return"number"==typeof e.value&&Number.isFinite(e.value);if(e.operator===a.ONE_OF||e.operator===a.NOT_ONE_OF)return Array.isArray(e.value)&&e.value.every(e=>"string"==typeof e);if(e.operator===a.IS_NULL)return"boolean"==typeof e.value;if(isSemVerOperator(e.operator))return null!==(0,o.parseSemver)(e.value);if("string"!=typeof e.value)return!1;try{return(0,i.compileRegex)(e.value),!0}catch(e){return!1}})}function matchesRule(e,t){return!evaluateRuleConditions(t,e.conditions).includes(!1)}function evaluateRuleConditions(e,t){return t.map(t=>evaluateCondition(e,t))}function evaluateCondition(e,t){let r=e[t.attribute];if(t.operator===a.IS_NULL)return t.value?null==r:null!=r;if(null!=r)switch(t.operator){case a.GTE:case a.GT:case a.LTE:case a.LT:return compareNumber(r,t.value,(e,r)=>t.operator===a.GTE?e>=r:t.operator===a.GT?e>r:t.operator===a.LTE?e<=r:e<r);case a.MATCHES:{let e=(0,i.coerceToString)(r);if(void 0===e)return!1;return(0,i.compileRegex)(t.value).test(e)}case a.NOT_MATCHES:{let e=(0,i.coerceToString)(r);if(void 0===e)return!1;return!(0,i.compileRegex)(t.value).test(e)}case a.ONE_OF:{var n;let e=(0,i.coerceToString)(r);return void 0!==e&&(n=e,t.value.includes(n))}case a.NOT_ONE_OF:{let e=(0,i.coerceToString)(r);return void 0!==e&&isNotOneOf(e,t.value)}case a.SEMVER_EQ:case a.SEMVER_NEQ:case a.SEMVER_LT:case a.SEMVER_LTE:case a.SEMVER_GT:case a.SEMVER_GTE:return evaluateSemverCondition(r,t.value,t.operator)}return!1}function isRecord(e){return"object"==typeof e&&null!==e}function isNumericOperator(e){return e===a.GTE||e===a.GT||e===a.LTE||e===a.LT}function isSemVerOperator(e){return e===a.SEMVER_EQ||e===a.SEMVER_NEQ||e===a.SEMVER_GTE||e===a.SEMVER_GT||e===a.SEMVER_LTE||e===a.SEMVER_LT}function evaluateSemverCondition(e,t,r){if("string"!=typeof e)return!1;let n=(0,o.parseSemver)(e),i=(0,o.parseSemver)(t);if(!n||!i)return!1;let s=(0,o.compareSemver)(n,i);switch(r){case a.SEMVER_EQ:return 0===s;case a.SEMVER_NEQ:return 0!==s;case a.SEMVER_LT:return s<0;case a.SEMVER_LTE:return s<=0;case a.SEMVER_GT:return s>0;case a.SEMVER_GTE:return s>=0}}function isNotOneOf(e,t){return!t.includes(e)}function compareNumber(e,t,r){let a=(0,i.coerceToNumber)(e),n=(0,i.coerceToNumber)(t);return void 0!==a&&void 0!==n&&r(a,n)}},"./@datadog/flagging-core/cjs/evaluation/semver.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseVersion=parseVersion,t.isParsedVersion=isParsedVersion,t.compareVersions=compareVersions,t.parseSemver=parseSemver,t.compareSemver=compareSemver;let r="18446744073709551615",a=/^((?:0|[1-9]\d*)(?:\.(?:0|[1-9]\d*))*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;function parseVersion(e){if("string"!=typeof e)return null;let t=a.exec(e);return t?{components:t[1].split("."),prerelease:t[2]?t[2].split("."):[]}:null}function isParsedVersion(e){return e.components.length>0&&e.components.every(e=>/^(?:0|[1-9]\d*)$/.test(e))&&e.prerelease.every(e=>/^[0-9A-Za-z-]+$/.test(e)&&(!/^\d+$/.test(e)||"0"===e||!e.startsWith("0")))}function compareVersions(e,t){var r,a;let n=Math.max(e.components.length,t.components.length);for(let i=0;i<n;i++){let n=compareNumericStrings(null!=(r=e.components[i])?r:"0",null!=(a=t.components[i])?a:"0");if(0!==n)return n}return compareVersionPrerelease(e.prerelease,t.prerelease)}function parseSemver(e){if("string"!=typeof e||0===e.length)return null;let t=e.length;for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);if(45===a||43===a){t=r;break}}let r=parseCoreParts(e.slice(0,t));if(null===r)return null;let a={parts:r,prerelease:""},n=e.slice(t);if(""===n)return a;if("-"===n[0]){let e=(n=n.slice(1)).indexOf("+");if(-1===e)return isValidSemverIdentifiers(n,!1)?{...a,prerelease:n}:null;let t=n.slice(0,e);if(!isValidSemverIdentifiers(t,!1))return null;a.prerelease=t,n=n.slice(e+1)}else{if("+"!==n[0])return null;n=n.slice(1)}return isValidSemverIdentifiers(n,!0)?a:null}function compareSemver(e,t){let r=Math.max(e.parts.length,t.parts.length);for(let a=0;a<r;a++){let r=compareNumericStrings(a<e.parts.length?e.parts[a]:"0",a<t.parts.length?t.parts[a]:"0");if(0!==r)return r}return compareSemverPrerelease(e.prerelease,t.prerelease)}function parseCoreParts(e){if(0===e.length)return null;let t=e.split(".");if(t.length<1)return null;let r=[];for(let e of t){let t=parseCoreIdentifier(e);if(null===t)return null;r.push(t)}return r}function parseCoreIdentifier(e){if(0===e.length||!isAsciiDigit(e.charCodeAt(0)))return null;if("0"===e[0])return 1===e.length?"0":null;for(let t=1;t<e.length;t++)if(!isAsciiDigit(e.charCodeAt(t)))return null;return e.length>r.length||e.length===r.length&&e>r?null:e}function isValidSemverIdentifiers(e,t){let r=0,a=!0;for(let n=0;n<=e.length;n++){if(n===e.length||"."===e[n]){if(n===r||!t&&a&&n-r>1&&"0"===e[r])return!1;r=n+1,a=!0;continue}let i=e.charCodeAt(n);if(!isAsciiAlphanumeric(i)&&"-"!==e[n])return!1;isAsciiDigit(i)||(a=!1)}return!0}function compareSemverPrerelease(e,t){if(e===t)return 0;if(""===e)return 1;if(""===t)return -1;let r=e,a=t;for(;;){let[e,t]=nextSemverIdentifier(r),[n,i]=nextSemverIdentifier(a),o=compareSemverIdentifier(e,n);if(0!==o)return o;if(""===t||""===i){if(""===t&&""===i)return 0;return""===t?-1:1}r=t.slice(1),a=i.slice(1)}}function compareVersionPrerelease(e,t){if(0===e.length||0===t.length)return e.length===t.length?0:0===e.length?1:-1;let r=Math.min(e.length,t.length);for(let a=0;a<r;a++){let r=compareSemverIdentifier(e[a],t[a]);if(0!==r)return r}return e.length===t.length?0:e.length<t.length?-1:1}function nextSemverIdentifier(e){let t=e.indexOf(".");return -1===t?[e,""]:[e.slice(0,t),e.slice(t)]}function compareSemverIdentifier(e,t){let r=isSemverNumericIdentifier(e),a=isSemverNumericIdentifier(t);return r&&a?compareNumericStrings(e,t):r?-1:a?1:compareAsciiStrings(e,t)}function isSemverNumericIdentifier(e){for(let t=0;t<e.length;t++)if(!isAsciiDigit(e.charCodeAt(t)))return!1;return!0}function compareNumericStrings(e,t){return e.length!==t.length?e.length<t.length?-1:1:compareAsciiStrings(e,t)}function compareAsciiStrings(e,t){let r=Math.min(e.length,t.length);for(let a=0;a<r;a++){let r=e.charCodeAt(a),n=t.charCodeAt(a);if(r!==n)return r<n?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function isAsciiDigit(e){return e>=48&&e<=57}function isAsciiAlphanumeric(e){return isAsciiDigit(e)||e>=65&&e<=90||e>=97&&e<=122}},"./@datadog/flagging-core/cjs/evaluation/sha256.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha256=sha256,t.sha256Hex=sha256Hex;let r=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],a=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2];function sha256(e){let t=64*Math.ceil((e.length+9)/64),n=new Uint8Array(t);n.set(e),n[e.length]=128;let i=8*e.length,o=new DataView(n.buffer);o.setUint32(t-8,Math.floor(i/0x100000000),!1),o.setUint32(t-4,i>>>0,!1);let s=[...r],u=new Uint32Array(64);for(let e=0;e<t;e+=64){for(let t=0;t<16;t++)u[t]=o.getUint32(e+4*t,!1);for(let e=16;e<64;e++){let t=u[e-15],r=u[e-2],a=rotateRight(t,7)^rotateRight(t,18)^t>>>3,n=rotateRight(r,17)^rotateRight(r,19)^r>>>10;u[e]=u[e-16]+a+u[e-7]+n>>>0}let[t,r,n,i,l,c,g,d]=s;for(let e=0;e<64;e++){let o=d+(rotateRight(l,6)^rotateRight(l,11)^rotateRight(l,25))+(l&c^~l&g)+a[e]+u[e]>>>0,s=(rotateRight(t,2)^rotateRight(t,13)^rotateRight(t,22))+(t&r^t&n^r&n)>>>0;d=g,g=c,c=l,l=i+o>>>0,i=n,n=r,r=t,t=o+s>>>0}s[0]=s[0]+t>>>0,s[1]=s[1]+r>>>0,s[2]=s[2]+n>>>0,s[3]=s[3]+i>>>0,s[4]=s[4]+l>>>0,s[5]=s[5]+c>>>0,s[6]=s[6]+g>>>0,s[7]=s[7]+d>>>0}let l=new Uint8Array(32),c=new DataView(l.buffer);return s.forEach((e,t)=>{c.setUint32(4*t,e,!1)}),l}function sha256Hex(e){return[...sha256(e)].map(e=>e.toString(16).padStart(2,"0")).join("")}function rotateRight(e,t){return e>>>t|e<<32-t}},"./@datadog/flagging-core/cjs/evaluation/sharders.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DeterministicSharder=t.MD5Sharder=t.Sharder=void 0;let a=r("./@datadog/flagging-core/cjs/obfuscation.js");let Sharder=class Sharder{};t.Sharder=Sharder;let MD5Sharder=class MD5Sharder extends Sharder{getShard(e,t){return parseInt((0,a.getMD5Hash)(e).slice(0,8),16)%t}};t.MD5Sharder=MD5Sharder;let DeterministicSharder=class DeterministicSharder extends Sharder{constructor(e){super(),this.lookup=e}getShard(e,t){var r;return null!=(r=this.lookup[e])?r:0}};t.DeterministicSharder=DeterministicSharder},"./@datadog/flagging-core/cjs/evaluation/ufc-v1.js"(e,t){"use strict";function variantTypeToFlagValueType(e){if("BOOLEAN"===e)return"boolean";if("STRING"===e)return"string";if("INTEGER"===e||"NUMERIC"===e)return"number";if("JSON"===e)return"object";throw Error(`Cannot convert variant type to flag value type: ${e}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.variantTypeToFlagValueType=variantTypeToFlagValueType},"./@datadog/flagging-core/cjs/index.js"(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r("./@datadog/flagging-core/cjs/cache/index.js"),t),n(r("./@datadog/flagging-core/cjs/configuration/index.js"),t),n(r("./@datadog/flagging-core/cjs/evaluation/index.js"),t),n(r("./@datadog/flagging-core/cjs/obfuscation.js"),t),n(r("./@datadog/flagging-core/cjs/time.js"),t)},"./@datadog/flagging-core/cjs/obfuscation.js"(e,t,r){"use strict";var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getMD5Hash=getMD5Hash,t.buildStorageKeySuffix=buildStorageKeySuffix;let n=a(r("./spark-md5/spark-md5.js"));function getMD5Hash(e,t=""){return new n.default().append(t).append(e).end()}function buildStorageKeySuffix(e){return getMD5Hash(e).slice(0,16)}},"./@datadog/flagging-core/cjs/time.js"(e,t){"use strict";function timeStampNow(){return new Date().getTime()}Object.defineProperty(t,"__esModule",{value:!0}),t.timeStampNow=timeStampNow},"./@datadog/flagging-core/cjs/utf8.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.encodeUtf8=encodeUtf8;let r=getUsableTextEncoder();function encodeUtf8(e){return r?r.encode(e):encodeUtf8Fallback(e)}function getUsableTextEncoder(){try{let e=new globalThis.TextEncoder;return 0===e.encode("").length?e:void 0}catch(e){return}}function encodeUtf8Fallback(e){let t=[];for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);if(a>=55296&&a<=56319){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=65536+(a-55296<<10)+(t-56320),r++):a=65533}else a>=56320&&a<=57343&&(a=65533);a<=127?t.push(a):a<=2047?t.push(192|a>>6,128|63&a):a<=65535?t.push(224|a>>12,128|a>>6&63,128|63&a):t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a)}return new Uint8Array(t)}},"./@datadog/openfeature-node-server/cjs/configuration/evaluation.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.evaluate=void 0;var a=r("./@datadog/flagging-core/cjs/index.js");Object.defineProperty(t,"evaluate",{enumerable:!0,get:function(){return a.evaluateRulesBasedConfiguration}})},"./@datadog/openfeature-node-server/cjs/index.js"(e,t,r){"use strict";var a=this&&this.__createBinding||(Object.create?function(e,t,r,a){void 0===a&&(a=r);var n=Object.getOwnPropertyDescriptor(t,r);(!n||("get"in n?!t.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,a,n)}:function(e,t,r,a){void 0===a&&(a=r),e[a]=t[r]}),n=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||a(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),n(r("./@datadog/openfeature-node-server/cjs/provider.js"),t)},"./@datadog/openfeature-node-server/cjs/initialization-controller.js"(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InitializationController=void 0;let InitializationController=class InitializationController{constructor(e,t){this.promise=Promise.race([new Promise((e,t)=>{this.resolve=()=>{this.cleanup(),e()},this.reject=e=>{this.cleanup(),t(e)}}),new Promise(()=>{var r,a;this.timeoutId=setTimeout(()=>{t()},e),null==(a=(r=this.timeoutId).unref)||a.call(r)})])}async wait(){try{await this.promise}finally{this.cleanup()}}complete(){this.resolve&&this.resolve()}fail(e){this.reject&&this.reject(e)}isInitializing(){return void 0!==this.resolve}cleanup(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.resolve=void 0,this.reject=void 0}};t.InitializationController=InitializationController},"./@datadog/openfeature-node-server/cjs/provider-event-emitter.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.NodeProviderEventEmitter=void 0;let a=r("node:events");let NodeProviderEventEmitter=class NodeProviderEventEmitter{constructor(){this.eventEmitter=new a.EventEmitter,this.handlers=new Map}emit(e,t){this.eventEmitter.emit(e,t)}addHandler(e,t){var r,a;let asyncHandler=async e=>{try{await t(e)}catch(e){this.logHandlerError(e)}},n=null!=(r=this.handlers.get(e))?r:new Map,i=null!=(a=n.get(t))?a:[];i.push(asyncHandler),n.set(t,i),this.handlers.set(e,n),this.eventEmitter.on(e,asyncHandler)}removeHandler(e,t){let r=this.handlers.get(e),a=null==r?void 0:r.get(t),n=null==a?void 0:a.pop();n&&this.eventEmitter.removeListener(e,n),(null==a?void 0:a.length)===0&&(null==r||r.delete(t)),(null==r?void 0:r.size)===0&&this.handlers.delete(e)}removeAllHandlers(e){if(e){this.eventEmitter.removeAllListeners(e),this.handlers.delete(e);return}this.eventEmitter.removeAllListeners(),this.handlers.clear()}getHandlers(e){return this.eventEmitter.listeners(e)}setLogger(e){return this.logger=e,this}logHandlerError(e){var t;try{null==(t=this.logger)||t.error("Error running event handler:",e)}catch(e){}}};t.NodeProviderEventEmitter=NodeProviderEventEmitter},"./@datadog/openfeature-node-server/cjs/provider.js"(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DatadogNodeServerProvider=void 0;let a=r("./@datadog/flagging-core/cjs/index.js"),n=r("./@datadog/openfeature-node-server/cjs/configuration/evaluation.js"),i=r("./@datadog/openfeature-node-server/cjs/initialization-controller.js"),o=r("./@datadog/openfeature-node-server/cjs/provider-event-emitter.js");let DatadogNodeServerProvider=class DatadogNodeServerProvider{constructor(e){this.options=e,this.metadata={name:"datadog-node-server"},this.runsOn="server",this.hooks=[],this.events=new o.NodeProviderEventEmitter,this.exposureCache=new a.LRUInMemoryAssignmentCache(5e4)}getConfiguration(){return this.configuration}setConfiguration(e){var t,r,a;let n=null==(t=this.configuration)?void 0:t.createdAt,i=!!this.configuration;if(i&&this.configuration!==e){this.events.emit("PROVIDER_CONFIGURATION_CHANGED"),n!==(null==e?void 0:e.createdAt)&&(null==(r=this.exposureCache)||r.clear()),this.configuration=e;return}this.configuration=e,(null==(a=this.initController)?void 0:a.isInitializing())?this.initController.complete():i||this.events.emit("PROVIDER_READY")}setError(e){var t;(null==(t=this.initController)?void 0:t.isInitializing())?this.initController.fail(e):this.events.emit("PROVIDER_ERROR",{error:e})}async initialize(){var e,t;if(this.configuration)return;let r=null!=(e=this.options.initializationTimeoutMs)?e:3e4;this.initController=new i.InitializationController(r,()=>this.setError(Error(`Initialization timeout after ${r}ms`))),await this.initController.wait(),await (null==(t=this.exposureCache)?void 0:t.init())}async resolveBooleanEvaluation(e,t,r,a){let i=(0,n.evaluate)(this.configuration,"boolean",e,t,r,a);return this.handleExposure(e,r,i),i}async resolveStringEvaluation(e,t,r,a){let i=(0,n.evaluate)(this.configuration,"string",e,t,r,a);return this.handleExposure(e,r,i),i}async resolveNumberEvaluation(e,t,r,a){let i=(0,n.evaluate)(this.configuration,"number",e,t,r,a);return this.handleExposure(e,r,i),i}async resolveObjectEvaluation(e,t,r,a){let i=(0,n.evaluate)(this.configuration,"object",e,t,r,a);return this.handleExposure(e,r,i),i}handleExposure(e,t,r){var n,i,o;let s=(0,a.timeStampNow)(),u={...r,flagKey:e,flagMetadata:null!=(n=r.flagMetadata)?n:{}},l=(0,a.createExposureEvent)(t,u);!l||(null==(i=this.exposureCache)?void 0:i.has(l))||this.options.exposureChannel.hasSubscribers&&(this.options.exposureChannel.publish({...l,timestamp:s}),null==(o=this.exposureCache)||o.set(l))}};t.DatadogNodeServerProvider=DatadogNodeServerProvider},"./spark-md5/spark-md5.js"(e){e.exports=function(){"use strict";var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function md5cycle(e,t){var r=e[0],a=e[1],n=e[2],i=e[3];r+=(a&n|~a&i)+t[0]-0x28955b88|0,i+=((r=(r<<7|r>>>25)+a|0)&a|~r&n)+t[1]-0x173848aa|0,n+=((i=(i<<12|i>>>20)+r|0)&r|~i&a)+t[2]+0x242070db|0,a+=((n=(n<<17|n>>>15)+i|0)&i|~n&r)+t[3]-0x3e423112|0,r+=((a=(a<<22|a>>>10)+n|0)&n|~a&i)+t[4]-0xa83f051|0,i+=((r=(r<<7|r>>>25)+a|0)&a|~r&n)+t[5]+0x4787c62a|0,n+=((i=(i<<12|i>>>20)+r|0)&r|~i&a)+t[6]-0x57cfb9ed|0,a+=((n=(n<<17|n>>>15)+i|0)&i|~n&r)+t[7]-0x2b96aff|0,r+=((a=(a<<22|a>>>10)+n|0)&n|~a&i)+t[8]+0x698098d8|0,i+=((r=(r<<7|r>>>25)+a|0)&a|~r&n)+t[9]-0x74bb0851|0,n+=((i=(i<<12|i>>>20)+r|0)&r|~i&a)+t[10]-42063|0,a+=((n=(n<<17|n>>>15)+i|0)&i|~n&r)+t[11]-0x76a32842|0,r+=((a=(a<<22|a>>>10)+n|0)&n|~a&i)+t[12]+0x6b901122|0,i+=((r=(r<<7|r>>>25)+a|0)&a|~r&n)+t[13]-0x2678e6d|0,n+=((i=(i<<12|i>>>20)+r|0)&r|~i&a)+t[14]-0x5986bc72|0,a+=((n=(n<<17|n>>>15)+i|0)&i|~n&r)+t[15]+0x49b40821|0,r+=((a=(a<<22|a>>>10)+n|0)&i|n&~i)+t[1]-0x9e1da9e|0,i+=((r=(r<<5|r>>>27)+a|0)&n|a&~n)+t[6]-0x3fbf4cc0|0,n+=((i=(i<<9|i>>>23)+r|0)&a|r&~a)+t[11]+0x265e5a51|0,a+=((n=(n<<14|n>>>18)+i|0)&r|i&~r)+t[0]-0x16493856|0,r+=((a=(a<<20|a>>>12)+n|0)&i|n&~i)+t[5]-0x29d0efa3|0,i+=((r=(r<<5|r>>>27)+a|0)&n|a&~n)+t[10]+0x2441453|0,n+=((i=(i<<9|i>>>23)+r|0)&a|r&~a)+t[15]-0x275e197f|0,a+=((n=(n<<14|n>>>18)+i|0)&r|i&~r)+t[4]-0x182c0438|0,r+=((a=(a<<20|a>>>12)+n|0)&i|n&~i)+t[9]+0x21e1cde6|0,i+=((r=(r<<5|r>>>27)+a|0)&n|a&~n)+t[14]-0x3cc8f82a|0,n+=((i=(i<<9|i>>>23)+r|0)&a|r&~a)+t[3]-0xb2af279|0,a+=((n=(n<<14|n>>>18)+i|0)&r|i&~r)+t[8]+0x455a14ed|0,r+=((a=(a<<20|a>>>12)+n|0)&i|n&~i)+t[13]-0x561c16fb|0,i+=((r=(r<<5|r>>>27)+a|0)&n|a&~n)+t[2]-0x3105c08|0,n+=((i=(i<<9|i>>>23)+r|0)&a|r&~a)+t[7]+0x676f02d9|0,a+=((n=(n<<14|n>>>18)+i|0)&r|i&~r)+t[12]-0x72d5b376|0,r+=((a=(a<<20|a>>>12)+n|0)^n^i)+t[5]-378558|0,i+=((r=(r<<4|r>>>28)+a|0)^a^n)+t[8]-0x788e097f|0,n+=((i=(i<<11|i>>>21)+r|0)^r^a)+t[11]+0x6d9d6122|0,a+=((n=(n<<16|n>>>16)+i|0)^i^r)+t[14]-0x21ac7f4|0,r+=((a=(a<<23|a>>>9)+n|0)^n^i)+t[1]-0x5b4115bc|0,i+=((r=(r<<4|r>>>28)+a|0)^a^n)+t[4]+0x4bdecfa9|0,n+=((i=(i<<11|i>>>21)+r|0)^r^a)+t[7]-0x944b4a0|0,a+=((n=(n<<16|n>>>16)+i|0)^i^r)+t[10]-0x41404390|0,r+=((a=(a<<23|a>>>9)+n|0)^n^i)+t[13]+0x289b7ec6|0,i+=((r=(r<<4|r>>>28)+a|0)^a^n)+t[0]-0x155ed806|0,n+=((i=(i<<11|i>>>21)+r|0)^r^a)+t[3]-0x2b10cf7b|0,a+=((n=(n<<16|n>>>16)+i|0)^i^r)+t[6]+0x4881d05|0,r+=((a=(a<<23|a>>>9)+n|0)^n^i)+t[9]-0x262b2fc7|0,i+=((r=(r<<4|r>>>28)+a|0)^a^n)+t[12]-0x1924661b|0,n+=((i=(i<<11|i>>>21)+r|0)^r^a)+t[15]+0x1fa27cf8|0,a+=((n=(n<<16|n>>>16)+i|0)^i^r)+t[2]-0x3b53a99b|0,a=(a<<23|a>>>9)+n|0,r+=(n^(a|~i))+t[0]-0xbd6ddbc|0,r=(r<<6|r>>>26)+a|0,i+=(a^(r|~n))+t[7]+0x432aff97|0,i=(i<<10|i>>>22)+r|0,n+=(r^(i|~a))+t[14]-0x546bdc59|0,n=(n<<15|n>>>17)+i|0,a+=(i^(n|~r))+t[5]-0x36c5fc7|0,a=(a<<21|a>>>11)+n|0,r+=(n^(a|~i))+t[12]+0x655b59c3|0,r=(r<<6|r>>>26)+a|0,i+=(a^(r|~n))+t[3]-0x70f3336e|0,i=(i<<10|i>>>22)+r|0,n+=(r^(i|~a))+t[10]-1051523|0,n=(n<<15|n>>>17)+i|0,a+=(i^(n|~r))+t[1]-0x7a7ba22f|0,a=(a<<21|a>>>11)+n|0,r+=(n^(a|~i))+t[8]+0x6fa87e4f|0,r=(r<<6|r>>>26)+a|0,i+=(a^(r|~n))+t[15]-0x1d31920|0,i=(i<<10|i>>>22)+r|0,n+=(r^(i|~a))+t[6]-0x5cfebcec|0,n=(n<<15|n>>>17)+i|0,a+=(i^(n|~r))+t[13]+0x4e0811a1|0,a=(a<<21|a>>>11)+n|0,r+=(n^(a|~i))+t[4]-0x8ac817e|0,r=(r<<6|r>>>26)+a|0,i+=(a^(r|~n))+t[11]-0x42c50dcb|0,i=(i<<10|i>>>22)+r|0,n+=(r^(i|~a))+t[2]+0x2ad7d2bb|0,n=(n<<15|n>>>17)+i|0,a+=(i^(n|~r))+t[9]-0x14792c6f|0,a=(a<<21|a>>>11)+n|0,e[0]=r+e[0]|0,e[1]=a+e[1]|0,e[2]=n+e[2]|0,e[3]=i+e[3]|0}function md5blk(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function md5blk_array(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function md51(e){var t,r,a,n,i,o,s=e.length,u=[0x67452301,-0x10325477,-0x67452302,0x10325476];for(t=64;t<=s;t+=64)md5cycle(u,md5blk(e.substring(t-64,t)));for(r=(e=e.substring(t-64)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<r;t+=1)a[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(md5cycle(u,a),t=0;t<16;t+=1)a[t]=0;return i=parseInt((n=(n=8*s).toString(16).match(/(.*?)(.{0,8})$/))[2],16),o=parseInt(n[1],16)||0,a[14]=i,a[15]=o,md5cycle(u,a),u}function md51_array(e){var t,r,a,n,i,o,s=e.length,u=[0x67452301,-0x10325477,-0x67452302,0x10325476];for(t=64;t<=s;t+=64)md5cycle(u,md5blk_array(e.subarray(t-64,t)));for(r=(e=t-64<s?e.subarray(t-64):new Uint8Array(0)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<r;t+=1)a[t>>2]|=e[t]<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(md5cycle(u,a),t=0;t<16;t+=1)a[t]=0;return i=parseInt((n=(n=8*s).toString(16).match(/(.*?)(.{0,8})$/))[2],16),o=parseInt(n[1],16)||0,a[14]=i,a[15]=o,md5cycle(u,a),u}function rhex(t){var r,a="";for(r=0;r<4;r+=1)a+=e[t>>8*r+4&15]+e[t>>8*r&15];return a}function hex(e){var t;for(t=0;t<e.length;t+=1)e[t]=rhex(e[t]);return e.join("")}function toUtf8(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function utf8Str2ArrayBuffer(e,t){var r,a=e.length,n=new ArrayBuffer(a),i=new Uint8Array(n);for(r=0;r<a;r+=1)i[r]=e.charCodeAt(r);return t?i:n}function arrayBuffer2Utf8Str(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function concatenateArrayBuffers(e,t,r){var a=new Uint8Array(e.byteLength+t.byteLength);return a.set(new Uint8Array(e)),a.set(new Uint8Array(t),e.byteLength),r?a:a.buffer}function hexToBinaryString(e){var t,r=[],a=e.length;for(t=0;t<a-1;t+=2)r.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,r)}function SparkMD5(){this.reset()}return hex(md51("hello")),"u">typeof ArrayBuffer&&!ArrayBuffer.prototype.slice&&function(){function clamp(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(e,t){var r,a,n,i,o=this.byteLength,s=clamp(e,o),u=o;return(void 0!==t&&(u=clamp(t,o)),s>u)?new ArrayBuffer(0):(n=new Uint8Array(a=new ArrayBuffer(r=u-s)),i=new Uint8Array(this,s,r),n.set(i),a)}}(),SparkMD5.prototype.append=function(e){return this.appendBinary(toUtf8(e)),this},SparkMD5.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,r=this._buff.length;for(t=64;t<=r;t+=64)md5cycle(this._hash,md5blk(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},SparkMD5.prototype.end=function(e){var t,r,a=this._buff,n=a.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<n;t+=1)i[t>>2]|=a.charCodeAt(t)<<(t%4<<3);return this._finish(i,n),r=hex(this._hash),e&&(r=hexToBinaryString(r)),this.reset(),r},SparkMD5.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[0x67452301,-0x10325477,-0x67452302,0x10325476],this},SparkMD5.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},SparkMD5.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},SparkMD5.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},SparkMD5.prototype._finish=function(e,t){var r,a,n,i=t;if(e[i>>2]|=128<<(i%4<<3),i>55)for(md5cycle(this._hash,e),i=0;i<16;i+=1)e[i]=0;a=parseInt((r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/))[2],16),n=parseInt(r[1],16)||0,e[14]=a,e[15]=n,md5cycle(this._hash,e)},SparkMD5.hash=function(e,t){return SparkMD5.hashBinary(toUtf8(e),t)},SparkMD5.hashBinary=function(e,t){var r=hex(md51(e));return t?hexToBinaryString(r):r},SparkMD5.ArrayBuffer=function(){this.reset()},SparkMD5.ArrayBuffer.prototype.append=function(e){var t,r=concatenateArrayBuffers(this._buff.buffer,e,!0),a=r.length;for(this._length+=e.byteLength,t=64;t<=a;t+=64)md5cycle(this._hash,md5blk_array(r.subarray(t-64,t)));return this._buff=new Uint8Array(t-64<a?r.buffer.slice(t-64):0),this},SparkMD5.ArrayBuffer.prototype.end=function(e){var t,r,a=this._buff,n=a.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<n;t+=1)i[t>>2]|=a[t]<<(t%4<<3);return this._finish(i,n),r=hex(this._hash),e&&(r=hexToBinaryString(r)),this.reset(),r},SparkMD5.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[0x67452301,-0x10325477,-0x67452302,0x10325476],this},SparkMD5.ArrayBuffer.prototype.getState=function(){var e=SparkMD5.prototype.getState.call(this);return e.buff=arrayBuffer2Utf8Str(e.buff),e},SparkMD5.ArrayBuffer.prototype.setState=function(e){return e.buff=utf8Str2ArrayBuffer(e.buff,!0),SparkMD5.prototype.setState.call(this,e)},SparkMD5.ArrayBuffer.prototype.destroy=SparkMD5.prototype.destroy,SparkMD5.ArrayBuffer.prototype._finish=SparkMD5.prototype._finish,SparkMD5.ArrayBuffer.hash=function(e,t){var r=hex(md51_array(new Uint8Array(e)));return t?hexToBinaryString(r):r},SparkMD5}()},"node:events"(e){"use strict";e.exports=require("node:events")}},t={};function __webpack_require__(r){var a=t[r];if(void 0!==a)return a.exports;var n=t[r]={exports:{}};return e[r].call(n.exports,n,n.exports,__webpack_require__),n.exports}var r=__webpack_require__("./@datadog/openfeature-node-server/cjs/index.js");module.exports=r})();
|
|
1
|
+
(()=>{var e={"./spark-md5/spark-md5.js"(e){e.exports=function(){"use strict";var e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f"];function md5cycle(e,t){var r=e[0],a=e[1],n=e[2],i=e[3];r+=(a&n|~a&i)+t[0]-0x28955b88|0,i+=((r=(r<<7|r>>>25)+a|0)&a|~r&n)+t[1]-0x173848aa|0,n+=((i=(i<<12|i>>>20)+r|0)&r|~i&a)+t[2]+0x242070db|0,a+=((n=(n<<17|n>>>15)+i|0)&i|~n&r)+t[3]-0x3e423112|0,r+=((a=(a<<22|a>>>10)+n|0)&n|~a&i)+t[4]-0xa83f051|0,i+=((r=(r<<7|r>>>25)+a|0)&a|~r&n)+t[5]+0x4787c62a|0,n+=((i=(i<<12|i>>>20)+r|0)&r|~i&a)+t[6]-0x57cfb9ed|0,a+=((n=(n<<17|n>>>15)+i|0)&i|~n&r)+t[7]-0x2b96aff|0,r+=((a=(a<<22|a>>>10)+n|0)&n|~a&i)+t[8]+0x698098d8|0,i+=((r=(r<<7|r>>>25)+a|0)&a|~r&n)+t[9]-0x74bb0851|0,n+=((i=(i<<12|i>>>20)+r|0)&r|~i&a)+t[10]-42063|0,a+=((n=(n<<17|n>>>15)+i|0)&i|~n&r)+t[11]-0x76a32842|0,r+=((a=(a<<22|a>>>10)+n|0)&n|~a&i)+t[12]+0x6b901122|0,i+=((r=(r<<7|r>>>25)+a|0)&a|~r&n)+t[13]-0x2678e6d|0,n+=((i=(i<<12|i>>>20)+r|0)&r|~i&a)+t[14]-0x5986bc72|0,a+=((n=(n<<17|n>>>15)+i|0)&i|~n&r)+t[15]+0x49b40821|0,r+=((a=(a<<22|a>>>10)+n|0)&i|n&~i)+t[1]-0x9e1da9e|0,i+=((r=(r<<5|r>>>27)+a|0)&n|a&~n)+t[6]-0x3fbf4cc0|0,n+=((i=(i<<9|i>>>23)+r|0)&a|r&~a)+t[11]+0x265e5a51|0,a+=((n=(n<<14|n>>>18)+i|0)&r|i&~r)+t[0]-0x16493856|0,r+=((a=(a<<20|a>>>12)+n|0)&i|n&~i)+t[5]-0x29d0efa3|0,i+=((r=(r<<5|r>>>27)+a|0)&n|a&~n)+t[10]+0x2441453|0,n+=((i=(i<<9|i>>>23)+r|0)&a|r&~a)+t[15]-0x275e197f|0,a+=((n=(n<<14|n>>>18)+i|0)&r|i&~r)+t[4]-0x182c0438|0,r+=((a=(a<<20|a>>>12)+n|0)&i|n&~i)+t[9]+0x21e1cde6|0,i+=((r=(r<<5|r>>>27)+a|0)&n|a&~n)+t[14]-0x3cc8f82a|0,n+=((i=(i<<9|i>>>23)+r|0)&a|r&~a)+t[3]-0xb2af279|0,a+=((n=(n<<14|n>>>18)+i|0)&r|i&~r)+t[8]+0x455a14ed|0,r+=((a=(a<<20|a>>>12)+n|0)&i|n&~i)+t[13]-0x561c16fb|0,i+=((r=(r<<5|r>>>27)+a|0)&n|a&~n)+t[2]-0x3105c08|0,n+=((i=(i<<9|i>>>23)+r|0)&a|r&~a)+t[7]+0x676f02d9|0,a+=((n=(n<<14|n>>>18)+i|0)&r|i&~r)+t[12]-0x72d5b376|0,r+=((a=(a<<20|a>>>12)+n|0)^n^i)+t[5]-378558|0,i+=((r=(r<<4|r>>>28)+a|0)^a^n)+t[8]-0x788e097f|0,n+=((i=(i<<11|i>>>21)+r|0)^r^a)+t[11]+0x6d9d6122|0,a+=((n=(n<<16|n>>>16)+i|0)^i^r)+t[14]-0x21ac7f4|0,r+=((a=(a<<23|a>>>9)+n|0)^n^i)+t[1]-0x5b4115bc|0,i+=((r=(r<<4|r>>>28)+a|0)^a^n)+t[4]+0x4bdecfa9|0,n+=((i=(i<<11|i>>>21)+r|0)^r^a)+t[7]-0x944b4a0|0,a+=((n=(n<<16|n>>>16)+i|0)^i^r)+t[10]-0x41404390|0,r+=((a=(a<<23|a>>>9)+n|0)^n^i)+t[13]+0x289b7ec6|0,i+=((r=(r<<4|r>>>28)+a|0)^a^n)+t[0]-0x155ed806|0,n+=((i=(i<<11|i>>>21)+r|0)^r^a)+t[3]-0x2b10cf7b|0,a+=((n=(n<<16|n>>>16)+i|0)^i^r)+t[6]+0x4881d05|0,r+=((a=(a<<23|a>>>9)+n|0)^n^i)+t[9]-0x262b2fc7|0,i+=((r=(r<<4|r>>>28)+a|0)^a^n)+t[12]-0x1924661b|0,n+=((i=(i<<11|i>>>21)+r|0)^r^a)+t[15]+0x1fa27cf8|0,a+=((n=(n<<16|n>>>16)+i|0)^i^r)+t[2]-0x3b53a99b|0,a=(a<<23|a>>>9)+n|0,r+=(n^(a|~i))+t[0]-0xbd6ddbc|0,r=(r<<6|r>>>26)+a|0,i+=(a^(r|~n))+t[7]+0x432aff97|0,i=(i<<10|i>>>22)+r|0,n+=(r^(i|~a))+t[14]-0x546bdc59|0,n=(n<<15|n>>>17)+i|0,a+=(i^(n|~r))+t[5]-0x36c5fc7|0,a=(a<<21|a>>>11)+n|0,r+=(n^(a|~i))+t[12]+0x655b59c3|0,r=(r<<6|r>>>26)+a|0,i+=(a^(r|~n))+t[3]-0x70f3336e|0,i=(i<<10|i>>>22)+r|0,n+=(r^(i|~a))+t[10]-1051523|0,n=(n<<15|n>>>17)+i|0,a+=(i^(n|~r))+t[1]-0x7a7ba22f|0,a=(a<<21|a>>>11)+n|0,r+=(n^(a|~i))+t[8]+0x6fa87e4f|0,r=(r<<6|r>>>26)+a|0,i+=(a^(r|~n))+t[15]-0x1d31920|0,i=(i<<10|i>>>22)+r|0,n+=(r^(i|~a))+t[6]-0x5cfebcec|0,n=(n<<15|n>>>17)+i|0,a+=(i^(n|~r))+t[13]+0x4e0811a1|0,a=(a<<21|a>>>11)+n|0,r+=(n^(a|~i))+t[4]-0x8ac817e|0,r=(r<<6|r>>>26)+a|0,i+=(a^(r|~n))+t[11]-0x42c50dcb|0,i=(i<<10|i>>>22)+r|0,n+=(r^(i|~a))+t[2]+0x2ad7d2bb|0,n=(n<<15|n>>>17)+i|0,a+=(i^(n|~r))+t[9]-0x14792c6f|0,a=(a<<21|a>>>11)+n|0,e[0]=r+e[0]|0,e[1]=a+e[1]|0,e[2]=n+e[2]|0,e[3]=i+e[3]|0}function md5blk(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function md5blk_array(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e[t]+(e[t+1]<<8)+(e[t+2]<<16)+(e[t+3]<<24);return r}function md51(e){var t,r,a,n,i,o,s=e.length,l=[0x67452301,-0x10325477,-0x67452302,0x10325476];for(t=64;t<=s;t+=64)md5cycle(l,md5blk(e.substring(t-64,t)));for(r=(e=e.substring(t-64)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<r;t+=1)a[t>>2]|=e.charCodeAt(t)<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(md5cycle(l,a),t=0;t<16;t+=1)a[t]=0;return i=parseInt((n=(n=8*s).toString(16).match(/(.*?)(.{0,8})$/))[2],16),o=parseInt(n[1],16)||0,a[14]=i,a[15]=o,md5cycle(l,a),l}function md51_array(e){var t,r,a,n,i,o,s=e.length,l=[0x67452301,-0x10325477,-0x67452302,0x10325476];for(t=64;t<=s;t+=64)md5cycle(l,md5blk_array(e.subarray(t-64,t)));for(r=(e=t-64<s?e.subarray(t-64):new Uint8Array(0)).length,a=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t=0;t<r;t+=1)a[t>>2]|=e[t]<<(t%4<<3);if(a[t>>2]|=128<<(t%4<<3),t>55)for(md5cycle(l,a),t=0;t<16;t+=1)a[t]=0;return i=parseInt((n=(n=8*s).toString(16).match(/(.*?)(.{0,8})$/))[2],16),o=parseInt(n[1],16)||0,a[14]=i,a[15]=o,md5cycle(l,a),l}function rhex(t){var r,a="";for(r=0;r<4;r+=1)a+=e[t>>8*r+4&15]+e[t>>8*r&15];return a}function hex(e){var t;for(t=0;t<e.length;t+=1)e[t]=rhex(e[t]);return e.join("")}function toUtf8(e){return/[\u0080-\uFFFF]/.test(e)&&(e=unescape(encodeURIComponent(e))),e}function utf8Str2ArrayBuffer(e,t){var r,a=e.length,n=new ArrayBuffer(a),i=new Uint8Array(n);for(r=0;r<a;r+=1)i[r]=e.charCodeAt(r);return t?i:n}function arrayBuffer2Utf8Str(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function concatenateArrayBuffers(e,t,r){var a=new Uint8Array(e.byteLength+t.byteLength);return a.set(new Uint8Array(e)),a.set(new Uint8Array(t),e.byteLength),r?a:a.buffer}function hexToBinaryString(e){var t,r=[],a=e.length;for(t=0;t<a-1;t+=2)r.push(parseInt(e.substr(t,2),16));return String.fromCharCode.apply(String,r)}function SparkMD5(){this.reset()}return hex(md51("hello")),"u">typeof ArrayBuffer&&!ArrayBuffer.prototype.slice&&function(){function clamp(e,t){return(e=0|e||0)<0?Math.max(e+t,0):Math.min(e,t)}ArrayBuffer.prototype.slice=function(e,t){var r,a,n,i,o=this.byteLength,s=clamp(e,o),l=o;return(void 0!==t&&(l=clamp(t,o)),s>l)?new ArrayBuffer(0):(n=new Uint8Array(a=new ArrayBuffer(r=l-s)),i=new Uint8Array(this,s,r),n.set(i),a)}}(),SparkMD5.prototype.append=function(e){return this.appendBinary(toUtf8(e)),this},SparkMD5.prototype.appendBinary=function(e){this._buff+=e,this._length+=e.length;var t,r=this._buff.length;for(t=64;t<=r;t+=64)md5cycle(this._hash,md5blk(this._buff.substring(t-64,t)));return this._buff=this._buff.substring(t-64),this},SparkMD5.prototype.end=function(e){var t,r,a=this._buff,n=a.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<n;t+=1)i[t>>2]|=a.charCodeAt(t)<<(t%4<<3);return this._finish(i,n),r=hex(this._hash),e&&(r=hexToBinaryString(r)),this.reset(),r},SparkMD5.prototype.reset=function(){return this._buff="",this._length=0,this._hash=[0x67452301,-0x10325477,-0x67452302,0x10325476],this},SparkMD5.prototype.getState=function(){return{buff:this._buff,length:this._length,hash:this._hash.slice()}},SparkMD5.prototype.setState=function(e){return this._buff=e.buff,this._length=e.length,this._hash=e.hash,this},SparkMD5.prototype.destroy=function(){delete this._hash,delete this._buff,delete this._length},SparkMD5.prototype._finish=function(e,t){var r,a,n,i=t;if(e[i>>2]|=128<<(i%4<<3),i>55)for(md5cycle(this._hash,e),i=0;i<16;i+=1)e[i]=0;a=parseInt((r=(r=8*this._length).toString(16).match(/(.*?)(.{0,8})$/))[2],16),n=parseInt(r[1],16)||0,e[14]=a,e[15]=n,md5cycle(this._hash,e)},SparkMD5.hash=function(e,t){return SparkMD5.hashBinary(toUtf8(e),t)},SparkMD5.hashBinary=function(e,t){var r=hex(md51(e));return t?hexToBinaryString(r):r},SparkMD5.ArrayBuffer=function(){this.reset()},SparkMD5.ArrayBuffer.prototype.append=function(e){var t,r=concatenateArrayBuffers(this._buff.buffer,e,!0),a=r.length;for(this._length+=e.byteLength,t=64;t<=a;t+=64)md5cycle(this._hash,md5blk_array(r.subarray(t-64,t)));return this._buff=new Uint8Array(t-64<a?r.buffer.slice(t-64):0),this},SparkMD5.ArrayBuffer.prototype.end=function(e){var t,r,a=this._buff,n=a.length,i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t<n;t+=1)i[t>>2]|=a[t]<<(t%4<<3);return this._finish(i,n),r=hex(this._hash),e&&(r=hexToBinaryString(r)),this.reset(),r},SparkMD5.ArrayBuffer.prototype.reset=function(){return this._buff=new Uint8Array(0),this._length=0,this._hash=[0x67452301,-0x10325477,-0x67452302,0x10325476],this},SparkMD5.ArrayBuffer.prototype.getState=function(){var e=SparkMD5.prototype.getState.call(this);return e.buff=arrayBuffer2Utf8Str(e.buff),e},SparkMD5.ArrayBuffer.prototype.setState=function(e){return e.buff=utf8Str2ArrayBuffer(e.buff,!0),SparkMD5.prototype.setState.call(this,e)},SparkMD5.ArrayBuffer.prototype.destroy=SparkMD5.prototype.destroy,SparkMD5.ArrayBuffer.prototype._finish=SparkMD5.prototype._finish,SparkMD5.ArrayBuffer.hash=function(e,t){var r=hex(md51_array(new Uint8Array(e)));return t?hexToBinaryString(r):r},SparkMD5}()}},t={};function __webpack_require__(r){var a=t[r];if(void 0!==a)return a.exports;var n=t[r]={exports:{}};return e[r](n,n.exports,__webpack_require__),n.exports}__webpack_require__.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return __webpack_require__.d(t,{a:t}),t},__webpack_require__.d=(e,t)=>{for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),__webpack_require__.r=e=>{"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};(()=>{"use strict";__webpack_require__.r(r),__webpack_require__.d(r,{DatadogNodeServerProvider:()=>DatadogNodeServerProvider});var e,t,a=__webpack_require__("./spark-md5/spark-md5.js"),n=__webpack_require__.n(a);function getMD5Hash(e,t=""){return new(n())().append(t).append(e).end()}function assignmentCacheKeyToString(e){return getMD5Hash(JSON.stringify({flag:{key:e.flag.key},subject:{id:e.subject.id,attributes:e.subject.attributes}}))}function assignmentCacheValueToString(e){return getMD5Hash(JSON.stringify(e))}let AbstractAssignmentCache=class AbstractAssignmentCache{constructor(e){this.delegate=e}init(){return Promise.resolve()}has(e){return this.get(e)===assignmentCacheValueToString(e)}get(e){return this.delegate.get(assignmentCacheKeyToString(e))}set(e){this.delegate.set(assignmentCacheKeyToString(e),assignmentCacheValueToString(e))}entries(){return this.delegate.entries()}clear(){this.delegate.clear()}};let LRUCache=class LRUCache{constructor(e){this.capacity=e,this.cache=new Map}entries(){return this.cache.entries()}clear(){this.cache.clear()}delete(e){return this.cache.delete(e)}keys(){return this.cache.keys()}values(){return this.cache.values()}has(e){return this.cache.has(e)}get(e){if(!this.has(e))return;let t=this.cache.get(e);return void 0!==t&&(this.delete(e),this.cache.set(e,t)),t}set(e,t){if(0===this.capacity)return this;if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.capacity){let e=this.cache.keys().next().value;e&&this.delete(e)}return this.cache.set(e,t),this}};let LRUInMemoryAssignmentCache=class LRUInMemoryAssignmentCache extends AbstractAssignmentCache{constructor(e){super(new LRUCache(e))}};function timeStampNow(){return new Date().getTime()}function createExposureEvent(e,t){var r,a,n;if(!(null==(r=t.flagMetadata)?void 0:r.doLog))return;let i=null==(a=t.flagMetadata)?void 0:a.allocationKey,o=t.variant;if(!i||!o)return;let{targetingKey:s="",...l}=e,u=null==(n=t.flagMetadata)?void 0:n.__dd_split_serial_id;return{allocation:{key:i},flag:{key:t.flagKey},variant:{key:o},..."number"==typeof u?{serial_id:u}:{},subject:{id:s,attributes:l}}}function prepareRulesResponse(e){return e.evaluationRegexCache&&e.evaluationJsonCache||Object.defineProperties(e,{evaluationRegexCache:{value:new Map},evaluationJsonCache:{value:new Map}}),e}let TargetingKeyMissingError=class TargetingKeyMissingError extends Error{constructor(){super("Targeting key is required for split evaluation"),this.name="TargetingKeyMissingError"}};let FlagConfigurationError=class FlagConfigurationError extends Error{constructor(e){super(e),this.name="FlagConfigurationError"}};let InvalidContextError=class InvalidContextError extends Error{constructor(){super("Evaluation context is missing a required partition attribute"),this.name="InvalidContextError"}};function createEvaluationMetadata(e,t){return{__dd_eval_timestamp_ms:e,__dd_observe_full_evaluation_data:!0===t}}function createEvaluationTimestampMetadata(e){return{__dd_eval_timestamp_ms:e}}let Sharder=class Sharder{};let MD5Sharder=class MD5Sharder extends Sharder{getShard(e,t){return parseInt(getMD5Hash(e).slice(0,8),16)%t}};function matchesShard(e,t,r){let a=(null!=r?r:new MD5Sharder).getShard(hashKey(e.salt,t),e.totalShards);return e.ranges.some(e=>isInShardRange(a,e))}function isInShardRange(e,t){return t.start<=e&&e<t.end}function hashKey(e,t){return`${e}-${t}`}function compileRegex(e){let t=e.match(/^\(\?([imsu]+)\)/),r=t?[...new Set(t[1])].join(""):"";return new RegExp((t?e.slice(t[0].length):e).replace(/\[:alnum:\]/g,"A-Za-z0-9"),r)}function coerceToString(e){if("string"==typeof e||"number"==typeof e||"boolean"==typeof e||"bigint"==typeof e)return String(e);if("object"==typeof e&&null!==e&&!Array.isArray(e))try{if(e.toString!==Object.prototype.toString)return String(e)}catch(e){}}function coerceToNumber(e){return"number"==typeof e?e:"string"==typeof e&&/^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?$/.test(e)?Number(e):void 0}let i="18446744073709551615",o=/^((?:0|[1-9]\d*)(?:\.(?:0|[1-9]\d*))*)(?:-((?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*)(?:\.(?:0|[1-9]\d*|\d*[A-Za-z-][0-9A-Za-z-]*))*))?(?:\+[0-9A-Za-z-]+(?:\.[0-9A-Za-z-]+)*)?$/;function parseVersion(e){if("string"!=typeof e)return null;let t=o.exec(e);return t?{components:t[1].split("."),prerelease:t[2]?t[2].split("."):[]}:null}function isParsedVersion(e){return e.components.length>0&&e.components.every(e=>/^(?:0|[1-9]\d*)$/.test(e))&&e.prerelease.every(e=>/^[0-9A-Za-z-]+$/.test(e)&&(!/^\d+$/.test(e)||"0"===e||!e.startsWith("0")))}function compareVersions(e,t){var r,a;let n=Math.max(e.components.length,t.components.length);for(let i=0;i<n;i++){let n=compareNumericStrings(null!=(r=e.components[i])?r:"0",null!=(a=t.components[i])?a:"0");if(0!==n)return n}return compareVersionPrerelease(e.prerelease,t.prerelease)}function parseSemver(e){if("string"!=typeof e||0===e.length)return null;let t=e.length;for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);if(45===a||43===a){t=r;break}}let r=parseCoreParts(e.slice(0,t));if(null===r)return null;let a={parts:r,prerelease:""},n=e.slice(t);if(""===n)return a;if("-"===n[0]){let e=(n=n.slice(1)).indexOf("+");if(-1===e)return isValidSemverIdentifiers(n,!1)?{...a,prerelease:n}:null;let t=n.slice(0,e);if(!isValidSemverIdentifiers(t,!1))return null;a.prerelease=t,n=n.slice(e+1)}else{if("+"!==n[0])return null;n=n.slice(1)}return isValidSemverIdentifiers(n,!0)?a:null}function compareSemver(e,t){let r=Math.max(e.parts.length,t.parts.length);for(let a=0;a<r;a++){let r=compareNumericStrings(a<e.parts.length?e.parts[a]:"0",a<t.parts.length?t.parts[a]:"0");if(0!==r)return r}return compareSemverPrerelease(e.prerelease,t.prerelease)}function parseCoreParts(e){if(0===e.length)return null;let t=e.split(".");if(t.length<1)return null;let r=[];for(let e of t){let t=parseCoreIdentifier(e);if(null===t)return null;r.push(t)}return r}function parseCoreIdentifier(e){if(0===e.length||!isAsciiDigit(e.charCodeAt(0)))return null;if("0"===e[0])return 1===e.length?"0":null;for(let t=1;t<e.length;t++)if(!isAsciiDigit(e.charCodeAt(t)))return null;return e.length>i.length||e.length===i.length&&e>i?null:e}function isValidSemverIdentifiers(e,t){let r=0,a=!0;for(let n=0;n<=e.length;n++){if(n===e.length||"."===e[n]){if(n===r||!t&&a&&n-r>1&&"0"===e[r])return!1;r=n+1,a=!0;continue}let i=e.charCodeAt(n);if(!isAsciiAlphanumeric(i)&&"-"!==e[n])return!1;isAsciiDigit(i)||(a=!1)}return!0}function compareSemverPrerelease(e,t){if(e===t)return 0;if(""===e)return 1;if(""===t)return -1;let r=e,a=t;for(;;){let[e,t]=nextSemverIdentifier(r),[n,i]=nextSemverIdentifier(a),o=compareSemverIdentifier(e,n);if(0!==o)return o;if(""===t||""===i){if(""===t&&""===i)return 0;return""===t?-1:1}r=t.slice(1),a=i.slice(1)}}function compareVersionPrerelease(e,t){if(0===e.length||0===t.length)return e.length===t.length?0:0===e.length?1:-1;let r=Math.min(e.length,t.length);for(let a=0;a<r;a++){let r=compareSemverIdentifier(e[a],t[a]);if(0!==r)return r}return e.length===t.length?0:e.length<t.length?-1:1}function nextSemverIdentifier(e){let t=e.indexOf(".");return -1===t?[e,""]:[e.slice(0,t),e.slice(t)]}function compareSemverIdentifier(e,t){let r=isSemverNumericIdentifier(e),a=isSemverNumericIdentifier(t);return r&&a?compareNumericStrings(e,t):r?-1:a?1:compareAsciiStrings(e,t)}function isSemverNumericIdentifier(e){for(let t=0;t<e.length;t++)if(!isAsciiDigit(e.charCodeAt(t)))return!1;return!0}function compareNumericStrings(e,t){return e.length!==t.length?e.length<t.length?-1:1:compareAsciiStrings(e,t)}function compareAsciiStrings(e,t){let r=Math.min(e.length,t.length);for(let a=0;a<r;a++){let r=e.charCodeAt(a),n=t.charCodeAt(a);if(r!==n)return r<n?-1:1}return e.length===t.length?0:e.length<t.length?-1:1}function isAsciiDigit(e){return e>=48&&e<=57}function isAsciiAlphanumeric(e){return isAsciiDigit(e)||e>=65&&e<=90||e>=97&&e<=122}(e=t||(t={})).MATCHES="MATCHES",e.NOT_MATCHES="NOT_MATCHES",e.GTE="GTE",e.GT="GT",e.LTE="LTE",e.LT="LT",e.ONE_OF="ONE_OF",e.NOT_ONE_OF="NOT_ONE_OF",e.IS_NULL="IS_NULL",e.SEMVER_EQ="SEMVER_EQ",e.SEMVER_NEQ="SEMVER_NEQ",e.SEMVER_LT="SEMVER_LT",e.SEMVER_LTE="SEMVER_LTE",e.SEMVER_GT="SEMVER_GT",e.SEMVER_GTE="SEMVER_GTE";let s=new Set(Object.values(t));function isValidRule(e){return!!isRecord(e)&&!!Array.isArray(e.conditions)&&e.conditions.every(e=>{if(!isRecord(e)||"string"!=typeof e.attribute||"string"!=typeof e.operator||!s.has(e.operator))return!1;if(isNumericOperator(e.operator))return"number"==typeof e.value&&Number.isFinite(e.value);if(e.operator===t.ONE_OF||e.operator===t.NOT_ONE_OF)return Array.isArray(e.value)&&e.value.every(e=>"string"==typeof e);if(e.operator===t.IS_NULL)return"boolean"==typeof e.value;if(isSemVerOperator(e.operator))return null!==parseSemver(e.value);if("string"!=typeof e.value)return!1;try{return compileRegex(e.value),!0}catch(e){return!1}})}function matchesRule(e,t){return!evaluateRuleConditions(t,e.conditions).includes(!1)}function evaluateRuleConditions(e,t){return t.map(t=>evaluateCondition(e,t))}function evaluateCondition(e,r){let a=e[r.attribute];if(r.operator===t.IS_NULL)return r.value?null==a:null!=a;if(null!=a)switch(r.operator){case t.GTE:case t.GT:case t.LTE:case t.LT:return compareNumber(a,r.value,(e,a)=>r.operator===t.GTE?e>=a:r.operator===t.GT?e>a:r.operator===t.LTE?e<=a:e<a);case t.MATCHES:{let e=coerceToString(a);if(void 0===e)return!1;return compileRegex(r.value).test(e)}case t.NOT_MATCHES:{let e=coerceToString(a);if(void 0===e)return!1;return!compileRegex(r.value).test(e)}case t.ONE_OF:{var n;let e=coerceToString(a);return void 0!==e&&(n=e,r.value.includes(n))}case t.NOT_ONE_OF:{let e=coerceToString(a);return void 0!==e&&isNotOneOf(e,r.value)}case t.SEMVER_EQ:case t.SEMVER_NEQ:case t.SEMVER_LT:case t.SEMVER_LTE:case t.SEMVER_GT:case t.SEMVER_GTE:return evaluateSemverCondition(a,r.value,r.operator)}return!1}function isRecord(e){return"object"==typeof e&&null!==e}function isNumericOperator(e){return e===t.GTE||e===t.GT||e===t.LTE||e===t.LT}function isSemVerOperator(e){return e===t.SEMVER_EQ||e===t.SEMVER_NEQ||e===t.SEMVER_GTE||e===t.SEMVER_GT||e===t.SEMVER_LTE||e===t.SEMVER_LT}function evaluateSemverCondition(e,r,a){if("string"!=typeof e)return!1;let n=parseSemver(e),i=parseSemver(r);if(!n||!i)return!1;let o=compareSemver(n,i);switch(a){case t.SEMVER_EQ:return 0===o;case t.SEMVER_NEQ:return 0!==o;case t.SEMVER_LT:return o<0;case t.SEMVER_LTE:return o<=0;case t.SEMVER_GT:return o>0;case t.SEMVER_GTE:return o>=0}}function isNotOneOf(e,t){return!t.includes(e)}function compareNumber(e,t,r){let a=coerceToNumber(e),n=coerceToNumber(t);return void 0!==a&&void 0!==n&&r(a,n)}function variantTypeToFlagValueType(e){if("BOOLEAN"===e)return"boolean";if("STRING"===e)return"string";if("INTEGER"===e||"NUMERIC"===e)return"number";if("JSON"===e)return"object";throw Error(`Cannot convert variant type to flag value type: ${e}`)}function evaluateForSubject(e,t,r,a,n,i,o=timeStampNow()){var s;if(!isValidFlag(e))return i.debug("returning default assignment because flag configuration is invalid",{flagKey:evaluateForSubject_isRecord(e)&&"string"==typeof e.key?e.key:void 0,subjectKey:r}),{value:n,reason:"ERROR",errorCode:"PARSE_ERROR",flagMetadata:createEvaluationTimestampMetadata(o)};if(!e.enabled)return i.debug("returning default assignment because flag is disabled",{flagKey:e.key,subjectKey:r}),{value:n,reason:"DISABLED",flagMetadata:createEvaluationTimestampMetadata(o)};if(!validateTypeMatch(t,e.variationType))return i.debug("variant value type mismatch, returning default value",{flagKey:e.key,subjectKey:r,expectedType:t,variantType:e.variationType}),{value:n,reason:"ERROR",errorCode:"TYPE_MISMATCH",flagMetadata:createEvaluationTimestampMetadata(o)};let l=new Date(o);for(let t of e.allocations){if(t.startAt&&l<new Date(t.startAt)){i.debug("allocation before start date",{flagKey:e.key,subjectKey:r,allocationKey:t.key,startAt:t.startAt});continue}if(t.endAt&&l>=new Date(t.endAt)){i.debug("allocation after end date",{flagKey:e.key,subjectKey:r,allocationKey:t.key,endAt:t.endAt});continue}if(!containsMatchingRule(t.rules,a,i))continue;let n=selectSplitUsingSharding(t.splits,r,e.key,i);if(n){let a=e.variations[n.variationKey];if(a){i.debug("evaluated a flag",{flagKey:e.key,subjectKey:r,assignment:a.value});let l=(null==(s=t.rules)?void 0:s.length)?"TARGETING_MATCH":n.shards.length?"SPLIT":t.startAt||t.endAt?"DEFAULT":"STATIC";return{value:a.value,reason:l,variant:a.key,flagMetadata:{...createEvaluationTimestampMetadata(o),__dd_allocation_key:t.key,__dd_do_log:!!t.doLog,__dd_split_serial_id:n.serialId,allocationKey:t.key,variationType:variantTypeToFlagValueType(e.variationType),doLog:!!t.doLog}}}}else i.debug("no matching split found for subject",{flagKey:e.key,subjectKey:r,allocationKey:t.key})}return i.debug("returning default assignment because no allocation matched",{flagKey:e.key,subjectKey:r}),{value:n,reason:"DEFAULT",flagMetadata:createEvaluationTimestampMetadata(o)}}function validateTypeMatch(e,t){if("boolean"===e)return"BOOLEAN"===t;if("string"===e)return"STRING"===t;if("number"===e)return"INTEGER"===t||"NUMERIC"===t;if("object"===e)return"JSON"===t;throw Error(`Invalid expected type: ${e}`)}function isValidFlag(e){if(!evaluateForSubject_isRecord(e)||"string"!=typeof e.key||"boolean"!=typeof e.enabled||!isVariantType(e.variationType)||!evaluateForSubject_isRecord(e.variations)||!Array.isArray(e.allocations))return!1;let t=e.variationType,r=e.variations;return!!Object.entries(r).every(([e,r])=>evaluateForSubject_isRecord(r)&&r.key===e&&isValidVariationValue(t,r.value))&&e.allocations.every(e=>evaluateForSubject_isRecord(e)&&Array.isArray(e.splits)&&e.splits.every(e=>evaluateForSubject_isRecord(e)&&"string"==typeof e.variationKey&&Object.prototype.hasOwnProperty.call(r,e.variationKey)&&Array.isArray(e.shards)&&e.shards.every(isValidShard))&&(void 0===e.rules||Array.isArray(e.rules)&&e.rules.every(e=>isValidRule(e))))}function evaluateForSubject_isRecord(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}function isVariantType(e){return"BOOLEAN"===e||"INTEGER"===e||"NUMERIC"===e||"STRING"===e||"JSON"===e}function isValidVariationValue(e,t){switch(e){case"BOOLEAN":return"boolean"==typeof t;case"INTEGER":return"number"==typeof t&&Number.isSafeInteger(t);case"NUMERIC":return"number"==typeof t&&Number.isFinite(t);case"STRING":return"string"==typeof t;case"JSON":return"object"==typeof t&&null!==t}}function isValidShard(e){return!!evaluateForSubject_isRecord(e)&&"string"==typeof e.salt&&!!Number.isInteger(e.totalShards)&&!(e.totalShards<=0)&&!(e.totalShards>0xffffffff)&&!!Array.isArray(e.ranges)&&e.ranges.every(t=>evaluateForSubject_isRecord(t)&&Number.isInteger(t.start)&&Number.isInteger(t.end)&&t.start>=0&&t.end>=t.start&&t.end<=e.totalShards)}function containsMatchingRule(e,t,r){return null==e||!e.length||(r.debug("evaluating rules",{rules:JSON.stringify(e),subjectAttributes:t}),e.some(e=>matchesRule(e,t)))}function selectSplitUsingSharding(e,t,r,a){if(!e||0===e.length)return null;for(let n of e)if(a.debug("evaluating split sharding",{flagKey:r,subjectKey:t,variationKey:n.variationKey,shards:n.shards}),n.shards.every(e=>{if(null==t)throw new TargetingKeyMissingError;let i=matchesShard(e,t);return a.debug("shard match result",{flagKey:r,subjectKey:t,variationKey:n.variationKey,shard:e,matches:i}),i}))return a.debug("subject matches split",{flagKey:r,subjectKey:t,variationKey:n.variationKey}),n;return a.debug("subject matches no splits",{flagKey:r,subjectKey:t}),null}let l=getUsableTextEncoder();function encodeUtf8(e){return l?l.encode(e):encodeUtf8Fallback(e)}function getUsableTextEncoder(){try{let e=new globalThis.TextEncoder;return 0===e.encode("").length?e:void 0}catch(e){return}}function encodeUtf8Fallback(e){let t=[];for(let r=0;r<e.length;r++){let a=e.charCodeAt(r);if(a>=55296&&a<=56319){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=65536+(a-55296<<10)+(t-56320),r++):a=65533}else a>=56320&&a<=57343&&(a=65533);a<=127?t.push(a):a<=2047?t.push(192|a>>6,128|63&a):a<=65535?t.push(224|a>>12,128|a>>6&63,128|63&a):t.push(240|a>>18,128|a>>12&63,128|a>>6&63,128|63&a)}return new Uint8Array(t)}function getOwnProperty(e,t){return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0}let u=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],c=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2];function sha256(e){let t=64*Math.ceil((e.length+9)/64),r=new Uint8Array(t);r.set(e),r[e.length]=128;let a=8*e.length,n=new DataView(r.buffer);n.setUint32(t-8,Math.floor(a/0x100000000),!1),n.setUint32(t-4,a>>>0,!1);let i=[...u],o=new Uint32Array(64);for(let e=0;e<t;e+=64){for(let t=0;t<16;t++)o[t]=n.getUint32(e+4*t,!1);for(let e=16;e<64;e++){let t=o[e-15],r=o[e-2],a=rotateRight(t,7)^rotateRight(t,18)^t>>>3,n=rotateRight(r,17)^rotateRight(r,19)^r>>>10;o[e]=o[e-16]+a+o[e-7]+n>>>0}let[t,r,a,s,l,u,f,d]=i;for(let e=0;e<64;e++){let n=d+(rotateRight(l,6)^rotateRight(l,11)^rotateRight(l,25))+(l&u^~l&f)+c[e]+o[e]>>>0,i=(rotateRight(t,2)^rotateRight(t,13)^rotateRight(t,22))+(t&r^t&a^r&a)>>>0;d=f,f=u,u=l,l=s+n>>>0,s=a,a=r,r=t,t=n+i>>>0}i[0]=i[0]+t>>>0,i[1]=i[1]+r>>>0,i[2]=i[2]+a>>>0,i[3]=i[3]+s>>>0,i[4]=i[4]+l>>>0,i[5]=i[5]+u>>>0,i[6]=i[6]+f>>>0,i[7]=i[7]+d>>>0}let s=new Uint8Array(32),l=new DataView(s.buffer);return i.forEach((e,t)=>{l.setUint32(4*t,e,!1)}),s}function rotateRight(e,t){return e>>>t|e<<32-t}function evaluateProtobufConfiguration(e,t,r,a,n,i,o=timeStampNow()){let{targetingKey:s}=n,l=getOwnProperty(e.flags,r);if(!l)return i.debug("returning default value because flag is not found",{flagKey:r,targetingKey:s}),{value:a,reason:"ERROR",errorCode:"FLAG_NOT_FOUND",flagMetadata:createEvaluationTimestampMetadata(o)};try{if(l.minimumFeatureLevel>0)throw new FlagConfigurationError("Flag requires an unsupported feature level");let u=variationTypeToFlagValueType(l.variationType);if(t!==u)return i.debug("variant value type mismatch, returning default value",{flagKey:r,targetingKey:s,expectedType:t,variantType:l.variationType}),{value:a,reason:"ERROR",errorCode:"TYPE_MISMATCH",flagMetadata:createEvaluationTimestampMetadata(o)};let c=new Map;for(let t of l.allocations){if(!matchesCondition(t.targetingConditionIndex,e,n,c))continue;let a=computePartitionKey(t,e,n,o),u=t.splits.find(e=>matchesSplit(e,a));if(!u)continue;let f=atIndex(l.variations,u.variationIndex,"split variation"),d=atIndex(e.strings,f.keyStringIndex,"variation key"),g=variationValue(l,f.value,e);return i.debug("evaluated a flag",{flagKey:r,targetingKey:s,assignment:g}),{value:g,reason:resolutionReason(u),variant:d,flagMetadata:{...createEvaluationTimestampMetadata(o),__dd_allocation_key:t.key,__dd_do_log:t.logExposureEvent,__dd_split_serial_id:u.serialId,allocationKey:t.key,variationType:variationTypeToFlagValueType(l.variationType),doLog:t.logExposureEvent}}}}catch(e){if(e instanceof FlagConfigurationError)return i.error("returning default value because flag configuration is invalid",{flagKey:r,targetingKey:s,error:e.message}),{value:a,reason:"ERROR",errorCode:"PARSE_ERROR",errorMessage:e.message,flagMetadata:createEvaluationTimestampMetadata(o)};if(e instanceof TargetingKeyMissingError)return{value:a,reason:"ERROR",errorCode:"TARGETING_KEY_MISSING",flagMetadata:createEvaluationTimestampMetadata(o)};if(e instanceof InvalidContextError)return{value:a,reason:"ERROR",errorCode:"INVALID_CONTEXT",flagMetadata:createEvaluationTimestampMetadata(o)};return i.error("Error evaluating flag",{error:e}),{value:a,reason:"ERROR",errorCode:"GENERAL",flagMetadata:createEvaluationTimestampMetadata(o)}}return i.debug("returning default assignment because no allocation matched",{flagKey:r,targetingKey:s}),{value:a,reason:"DEFAULT",flagMetadata:createEvaluationTimestampMetadata(o)}}function matchesCondition(e,t,r,a){let n;if(void 0===e)return!0;let i=a.get(e);if(void 0!==i)return i;let o=atIndex(t.conditions,e,"condition");return n="all"===o.kind.case?o.kind.value.conditionIndexes.every(n=>{if(n>=e)throw new FlagConfigurationError("Condition must only reference preceding conditions");return matchesCondition(n,t,r,a)}):"any"===o.kind.case?o.kind.value.conditionIndexes.some(n=>{if(n>=e)throw new FlagConfigurationError("Condition must only reference preceding conditions");return matchesCondition(n,t,r,a)}):matchesLeafCondition(o,t,r),a.set(e,n),n}function matchesLeafCondition(e,t,r){let a=e.kind;if(void 0===a.case||"all"===a.case||"any"===a.case)throw new FlagConfigurationError("Unsupported condition");let n=attributeValueAt(t,a.value.attributeIndex,r);if("attributePresence"===a.case)return a.value.expectNull?null==n:null!=n;if(null==n)return!1;if("numeric"===a.case){let e=a.value.comparand;if(Number.isNaN(e))throw new FlagConfigurationError("Invalid numeric comparator");let t=coerceToNumber(n);if(void 0===t)return!1;let r=a.value.comparator;if(1===r)return t<e;if(2===r)return t<=e;if(3===r)return t>e;if(4===r)return t>=e;throw new FlagConfigurationError("Unsupported numeric comparator")}if("regex"===a.case){let e=coerceToString(n);if(void 0===e)return!1;let r=compiledRegexAt(t,a.value.regexIndex).test(e);return a.value.negate?!r:r}if("stringMembership"===a.case){let e=coerceToString(n);if(void 0===e)return!1;let r=containsInternedString(a.value.stringIndexes,e,t.strings);return a.value.negate?!r:r}if("sha256Membership"===a.case){let e=coerceToString(n);if(void 0===e)return!1;let t=containsBytes(a.value.sha256,saltedSha256(a.value.salt,encodeUtf8(e)));return a.value.negate?!t:t}if("version"===a.case){let e=versionAt(t.versions,a.value.versionIndex);if("string"!=typeof n)return!1;let r=parseVersion(n);if(!r)return!1;let i=compareVersions(r,e),o=a.value.comparator;if(1===o)return 0===i;if(2===o)return 0!==i;if(3===o)return i<0;if(4===o)return i<=0;if(5===o)return i>0;if(6===o)return i>=0;throw new FlagConfigurationError("Unsupported version comparator")}if("stringComparison"===a.case){let e,r=coerceToString(n);if(void 0===r)return!1;let i=atIndex(t.strings,a.value.stringIndex,"condition string"),o=a.value.comparator;if(1===o)e=r.startsWith(i);else if(2===o)e=r.endsWith(i);else if(3===o)e=r.includes(i);else throw new FlagConfigurationError("Unsupported string comparator");return a.value.negate?!e:e}if("sha256StringComparison"===a.case){let e=coerceToString(n);if(void 0===e)return!1;let t=extractUtf8Bytes(encodeUtf8(e),a.value.length,a.value.comparator),r=void 0!==t&&0===compareBytes(saltedSha256(a.value.salt,t),a.value.sha256);return a.value.negate?!r:r}throw new FlagConfigurationError("Unsupported condition")}function versionAt(e,t){let r=atIndex(e,t,"version");if(!isParsedVersion(r))throw new FlagConfigurationError("Invalid version comparator");return r}function saltedSha256(e,t){let r=new Uint8Array(e.length+t.length);return r.set(e),r.set(t,e.length),sha256(r)}function extractUtf8Bytes(e,t,r){let a;if(1===r)a=0;else if(2===r)a=e.length-t;else throw new FlagConfigurationError("Unsupported SHA-256 string comparator");if(t>e.length)return;let n=a+t;if(isUtf8Boundary(e,a)&&isUtf8Boundary(e,n))return e.subarray(a,n)}function isUtf8Boundary(e,t){return 0===t||t===e.length||(192&e[t])!=128}function compiledRegexAt(e,t){let r=e.evaluationRegexCache,a=r.get(t);if(null===a)throw new FlagConfigurationError("Invalid regular expression");if(a)return a;let n=atIndex(e.regexes,t,"regex");try{let e=compileRegex(n);return r.set(t,e),e}catch(e){throw r.set(t,null),new FlagConfigurationError("Invalid regular expression")}}function computePartitionKey(e,t,r,a){let n=[];for(let i of e.partitionKey)if("time"===i.kind.case)n.push(a);else if("shardMd5"===i.kind.case){let e=atIndex(t.attributes,i.kind.value.attributeIndex,"partition attribute"),a=evaluateProtobufConfiguration_attributeValue(e,t,r);if(null==a){if("targetingKey"===e.kind.case)throw new TargetingKeyMissingError;throw new InvalidContextError}let o=safeInteger(i.kind.value.totalShards,"Total shards");if(o<=0)throw new FlagConfigurationError("Total shards must be positive");let s=coerceToString(a);if(void 0===s)throw new InvalidContextError;n.push(new MD5Sharder().getShard(`${i.kind.value.salt}${s}`,o))}else throw new FlagConfigurationError("Unsupported partition key");return n}function attributeValueAt(e,t,r){return evaluateProtobufConfiguration_attributeValue(atIndex(e.attributes,t,"condition attribute"),e,r)}function evaluateProtobufConfiguration_attributeValue(e,t,r){if("targetingKey"===e.kind.case)return r.targetingKey;if("attributePath"!==e.kind.case)throw new FlagConfigurationError("Unsupported attribute reference");let{segments:a}=e.kind.value;if(0===a.length||"objectKeyStringIndex"!==a[0].kind.case)throw new FlagConfigurationError("Invalid attribute path");let n=r;for(let e of a)if("objectKeyStringIndex"===e.kind.case){if(!isContextObject(n))return;n=getOwnProperty(n,atIndex(t.strings,e.kind.value,"attribute path"))}else if("arrayIndex"===e.kind.case){if(!Array.isArray(n))return;n=Object.prototype.hasOwnProperty.call(n,e.kind.value)?n[e.kind.value]:void 0}else throw new FlagConfigurationError("Invalid attribute path");return n}function isContextObject(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)&&!(e instanceof Date)}function matchesSplit(e,t){if(e.ranges.length!==t.length)throw new FlagConfigurationError("Invalid split");return t.every((t,r)=>{let a=atIndex(e.ranges,r,"partition range");return(void 0===a.from||t>=a.from)&&(void 0===a.to||t<a.to)})}function variationValue(e,t,r){let a=variationValueCase(e.variationType);if(t.case!==a)throw new FlagConfigurationError("Variation value does not match flag variation type");if("stringValueIndex"===t.case)return atIndex(r.strings,t.value,"string variation value");if("integerValue"===t.case)return safeInteger(t.value,"Integer variation value");if("numericValue"===t.case){if(!Number.isFinite(t.value))throw new FlagConfigurationError("Numeric variation value is not finite");return t.value}if("booleanValue"===t.case)return t.value;if("jsonStringIndex"===t.case)return jsonValueAt(r,t.value);throw new FlagConfigurationError("Variation value is missing")}function resolutionReason(e){let t=e.reason;return 1===t?"TARGETING_MATCH":2===t?"SPLIT":3===t?"STATIC":4===t?"DEFAULT":"UNKNOWN"}function variationTypeToFlagValueType(e){if(4===e)return"boolean";if(1===e)return"string";if(2===e||3===e)return"number";if(5===e)return"object";throw new FlagConfigurationError("Unsupported variation type")}function variationValueCase(e){if(1===e)return"stringValueIndex";if(2===e)return"integerValue";if(3===e)return"numericValue";if(4===e)return"booleanValue";if(5===e)return"jsonStringIndex";throw new FlagConfigurationError("Unsupported variation type")}function containsInternedString(e,t,r){return e.some(e=>atIndex(r,e,"condition string")===t)}function safeInteger(e,t){let r=Number(e);if(!Number.isSafeInteger(r)||String(r)!==String(e))throw new FlagConfigurationError(`${t} cannot be represented safely as a JavaScript number`);return r}function atIndex(e,t,r){let a=e[t];if(void 0===a)throw new FlagConfigurationError(`Invalid ${r} index`);return a}function jsonValueAt(e,t){let r=e.evaluationJsonCache,a=r.get(t);if(a&&!a.valid)throw new FlagConfigurationError("JSON variation value is invalid");if(a)return a.value;let n=atIndex(e.jsonStrings,t,"JSON variation value");try{let e=JSON.parse(n);if("number"==typeof e&&!Number.isFinite(e))throw Error();return r.set(t,{valid:!0,value:e}),e}catch(e){throw r.set(t,{valid:!1}),new FlagConfigurationError("JSON variation value is invalid")}}function containsBytes(e,t){return e.some(e=>0===compareBytes(e,t))}function compareBytes(e,t){for(let r=0;r<Math.min(e.length,t.length);r++)if(e[r]!==t[r])return e[r]<t[r]?-1:1;return e.length===t.length?0:e.length<t.length?-1:1}function evaluateRulesBasedConfiguration(e,t,r,a,n,i){let o,s=timeStampNow(),l=createEvaluationMetadata(s,(null==e?void 0:e.observeFullEvaluationData)===!0);try{o=evaluateRules(e,t,r,a,n,i,s)}catch(e){i.error("Error evaluating flag",{error:e}),o={value:a,reason:"ERROR",errorCode:"GENERAL"}}return{...o,flagMetadata:{...o.flagMetadata,...l}}}function evaluateRules(e,t,r,a,n,i,o){if(!e)return{value:a,reason:"ERROR",errorCode:"PROVIDER_NOT_READY",flagMetadata:createEvaluationTimestampMetadata(o)};if(isProtobufConfiguration(e))return evaluateProtobufConfiguration(prepareRulesResponse(e),t,r,a,n,i,o);let{targetingKey:s,...l}=n,u={...null!=s?{id:s}:{},...l};if(!Object.prototype.hasOwnProperty.call(e.flags,r))return i.debug("returning default value because flag is not found",{flagKey:r,subjectKey:s}),{value:a,reason:"ERROR",errorCode:"FLAG_NOT_FOUND",flagMetadata:createEvaluationTimestampMetadata(o)};let c=e.flags[r];try{return evaluateForSubject(c,t,s,u,a,i,o)}catch(e){if(e instanceof TargetingKeyMissingError)return{value:a,reason:"ERROR",errorCode:"TARGETING_KEY_MISSING",flagMetadata:createEvaluationTimestampMetadata(o)};return i.error("Error evaluating flag",{error:e}),{value:a,reason:"ERROR",errorCode:"GENERAL",flagMetadata:createEvaluationTimestampMetadata(o)}}}function isProtobufConfiguration(e){return"$typeName"in e&&"datadog.ffe.flagging.ufc.v1.FlagsConfiguration"===e.$typeName}let InitializationController=class InitializationController{constructor(e,t){this.promise=Promise.race([new Promise((e,t)=>{this.resolve=()=>{this.cleanup(),e()},this.reject=e=>{this.cleanup(),t(e)}}),new Promise(()=>{var r,a;this.timeoutId=setTimeout(()=>{t()},e),null==(a=(r=this.timeoutId).unref)||a.call(r)})])}async wait(){try{await this.promise}finally{this.cleanup()}}complete(){this.resolve&&this.resolve()}fail(e){this.reject&&this.reject(e)}isInitializing(){return void 0!==this.resolve}cleanup(){this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=void 0),this.resolve=void 0,this.reject=void 0}};let f=require("node:events");let NodeProviderEventEmitter=class NodeProviderEventEmitter{constructor(){this.eventEmitter=new f.EventEmitter,this.handlers=new Map}emit(e,t){this.eventEmitter.emit(e,t)}addHandler(e,t){var r,a;let asyncHandler=async e=>{try{await t(e)}catch(e){this.logHandlerError(e)}},n=null!=(r=this.handlers.get(e))?r:new Map,i=null!=(a=n.get(t))?a:[];i.push(asyncHandler),n.set(t,i),this.handlers.set(e,n),this.eventEmitter.on(e,asyncHandler)}removeHandler(e,t){let r=this.handlers.get(e),a=null==r?void 0:r.get(t),n=null==a?void 0:a.pop();n&&this.eventEmitter.removeListener(e,n),(null==a?void 0:a.length)===0&&(null==r||r.delete(t)),(null==r?void 0:r.size)===0&&this.handlers.delete(e)}removeAllHandlers(e){if(e){this.eventEmitter.removeAllListeners(e),this.handlers.delete(e);return}this.eventEmitter.removeAllListeners(),this.handlers.clear()}getHandlers(e){return this.eventEmitter.listeners(e)}setLogger(e){return this.logger=e,this}logHandlerError(e){var t;try{null==(t=this.logger)||t.error("Error running event handler:",e)}catch(e){}}};let DatadogNodeServerProvider=class DatadogNodeServerProvider{constructor(e){this.options=e,this.metadata={name:"datadog-node-server"},this.runsOn="server",this.hooks=[],this.events=new NodeProviderEventEmitter,this.exposureCache=new LRUInMemoryAssignmentCache(5e4)}getConfiguration(){return this.configuration}setConfiguration(e){var t,r,a;let n=null==(t=this.configuration)?void 0:t.createdAt,i=!!this.configuration;if(i&&this.configuration!==e){this.events.emit("PROVIDER_CONFIGURATION_CHANGED"),n!==(null==e?void 0:e.createdAt)&&(null==(r=this.exposureCache)||r.clear()),this.configuration=e;return}this.configuration=e,(null==(a=this.initController)?void 0:a.isInitializing())?this.initController.complete():i||this.events.emit("PROVIDER_READY")}setError(e){var t;(null==(t=this.initController)?void 0:t.isInitializing())?this.initController.fail(e):this.events.emit("PROVIDER_ERROR",{error:e})}async initialize(){var e,t;if(this.configuration)return;let r=null!=(e=this.options.initializationTimeoutMs)?e:3e4;this.initController=new InitializationController(r,()=>this.setError(Error(`Initialization timeout after ${r}ms`))),await this.initController.wait(),await (null==(t=this.exposureCache)?void 0:t.init())}async resolveBooleanEvaluation(e,t,r,a){let n=evaluateRulesBasedConfiguration(this.configuration,"boolean",e,t,r,a);return this.handleExposure(e,r,n),n}async resolveStringEvaluation(e,t,r,a){let n=evaluateRulesBasedConfiguration(this.configuration,"string",e,t,r,a);return this.handleExposure(e,r,n),n}async resolveNumberEvaluation(e,t,r,a){let n=evaluateRulesBasedConfiguration(this.configuration,"number",e,t,r,a);return this.handleExposure(e,r,n),n}async resolveObjectEvaluation(e,t,r,a){let n=evaluateRulesBasedConfiguration(this.configuration,"object",e,t,r,a);return this.handleExposure(e,r,n),n}handleExposure(e,t,r){var a,n,i;let o=timeStampNow(),s=createExposureEvent(t,{...r,flagKey:e,flagMetadata:null!=(a=r.flagMetadata)?a:{}});!s||(null==(n=this.exposureCache)?void 0:n.has(s))||this.options.exposureChannel.hasSubscribers&&(this.options.exposureChannel.publish({...s,timestamp:o}),null==(i=this.exposureCache)||i.set(s))}}})(),module.exports=r})();
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2025-present Datadog, Inc.
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|