dd-trace 5.124.0 → 5.126.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.
Files changed (208) hide show
  1. package/LICENSE-3rdparty.csv +3 -1
  2. package/ci/init.js +8 -3
  3. package/ci/test-optimization-validation/ci-package-scripts.js +2 -2
  4. package/ci/test-optimization-validation/ci-remediation.js +6 -6
  5. package/ci/test-optimization-validation/command-blocker.js +7 -5
  6. package/ci/test-optimization-validation/framework-adapters/cucumber.js +1 -1
  7. package/ci/test-optimization-validation/framework-adapters/vitest.js +3 -3
  8. package/ci/test-optimization-validation/package-check.js +1 -1
  9. package/ci/test-optimization-validation/report-writer.js +7 -5
  10. package/ci/vitest-no-worker-init-runner-setup.mjs +8 -0
  11. package/ci/vitest-no-worker-init-setup.mjs +13 -13
  12. package/ci/vitest-no-worker-init-v5-setup.mjs +4 -0
  13. package/index.d.ts +8 -0
  14. package/package.json +13 -10
  15. package/packages/datadog-esbuild/index.js +3 -1
  16. package/packages/datadog-instrumentations/src/cypress-config.js +19 -17
  17. package/packages/datadog-instrumentations/src/fs.js +24 -20
  18. package/packages/datadog-instrumentations/src/google-cloud-vertexai.js +2 -2
  19. package/packages/datadog-instrumentations/src/graphql.js +16 -16
  20. package/packages/datadog-instrumentations/src/helpers/graphql-jit-runtime.js +504 -0
  21. package/packages/datadog-instrumentations/src/helpers/hooks.js +2 -0
  22. package/packages/datadog-instrumentations/src/helpers/pool-acquire.js +265 -0
  23. package/packages/datadog-instrumentations/src/helpers/rewriter/compiler.js +1 -2
  24. package/packages/datadog-instrumentations/src/helpers/rewriter/index.js +95 -30
  25. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/ai.js +0 -25
  26. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql-jit.js +83 -0
  27. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/graphql.js +85 -1
  28. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/index.js +1 -0
  29. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/mercurius.js +30 -12
  30. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/playwright.js +14 -5
  31. package/packages/datadog-instrumentations/src/helpers/rewriter/instrumentations/webdriverio.js +251 -0
  32. package/packages/datadog-instrumentations/src/helpers/rewriter/targets.json +11 -1
  33. package/packages/datadog-instrumentations/src/helpers/rewriter/transforms.js +562 -27
  34. package/packages/datadog-instrumentations/src/jest.js +166 -45
  35. package/packages/datadog-instrumentations/src/knex.js +76 -0
  36. package/packages/datadog-instrumentations/src/mariadb.js +6 -0
  37. package/packages/datadog-instrumentations/src/mocha/common.js +59 -2
  38. package/packages/datadog-instrumentations/src/mocha/main.js +66 -20
  39. package/packages/datadog-instrumentations/src/mocha/utils.js +2 -1
  40. package/packages/datadog-instrumentations/src/mocha/webdriverio-protocol.js +98 -0
  41. package/packages/datadog-instrumentations/src/mocha/worker.js +12 -8
  42. package/packages/datadog-instrumentations/src/net.js +14 -17
  43. package/packages/datadog-instrumentations/src/next.js +212 -62
  44. package/packages/datadog-instrumentations/src/openai.js +42 -40
  45. package/packages/datadog-instrumentations/src/pg.js +15 -0
  46. package/packages/datadog-instrumentations/src/playwright.js +113 -13
  47. package/packages/datadog-instrumentations/src/rum-browser-scripts.js +40 -0
  48. package/packages/datadog-instrumentations/src/sequelize.js +94 -2
  49. package/packages/datadog-instrumentations/src/undici.js +53 -4
  50. package/packages/datadog-instrumentations/src/vitest-main-no-worker-init.js +37 -3
  51. package/packages/datadog-instrumentations/src/vitest-main.js +92 -9
  52. package/packages/datadog-instrumentations/src/vitest-worker.js +71 -14
  53. package/packages/datadog-instrumentations/src/webdriverio.js +965 -6
  54. package/packages/datadog-plugin-amqp10/src/consumer.js +3 -1
  55. package/packages/datadog-plugin-amqp10/src/producer.js +3 -1
  56. package/packages/datadog-plugin-amqp10/src/util.js +2 -1
  57. package/packages/datadog-plugin-avsc/src/schema_iterator.js +6 -1
  58. package/packages/datadog-plugin-aws-sdk/src/services/bedrockruntime/utils.js +16 -5
  59. package/packages/datadog-plugin-cassandra-driver/src/index.js +8 -3
  60. package/packages/datadog-plugin-cucumber/src/index.js +0 -2
  61. package/packages/datadog-plugin-cypress/src/cypress-plugin.js +262 -48
  62. package/packages/datadog-plugin-google-cloud-pubsub/src/client.js +4 -1
  63. package/packages/datadog-plugin-graphql/src/execute.js +998 -196
  64. package/packages/datadog-plugin-graphql/src/index.js +27 -7
  65. package/packages/datadog-plugin-graphql/src/jit.js +136 -0
  66. package/packages/datadog-plugin-graphql/src/request.js +18 -27
  67. package/packages/datadog-plugin-graphql/src/resolve-error.js +108 -0
  68. package/packages/datadog-plugin-graphql/src/tools/signature.js +1 -2
  69. package/packages/datadog-plugin-graphql/src/tools/transforms.js +45 -3
  70. package/packages/datadog-plugin-graphql/src/utils.js +208 -120
  71. package/packages/datadog-plugin-graphql/src/validate.js +10 -23
  72. package/packages/datadog-plugin-jest/src/index.js +0 -6
  73. package/packages/datadog-plugin-langchain/src/tracing.js +7 -0
  74. package/packages/datadog-plugin-mocha/src/index.js +403 -75
  75. package/packages/datadog-plugin-mongodb-core/src/query.js +6 -0
  76. package/packages/datadog-plugin-mysql/src/index.js +41 -15
  77. package/packages/datadog-plugin-net/src/tcp.js +3 -1
  78. package/packages/datadog-plugin-next/src/index.js +63 -29
  79. package/packages/datadog-plugin-playwright/src/index.js +167 -27
  80. package/packages/datadog-plugin-undici/src/index.js +27 -41
  81. package/packages/datadog-plugin-vitest/src/index.js +6 -12
  82. package/packages/dd-trace/src/aiguard/evaluation.js +2 -1
  83. package/packages/dd-trace/src/aiguard/messages/anthropic.js +8 -1
  84. package/packages/dd-trace/src/aiguard/messages/openai.js +8 -1
  85. package/packages/dd-trace/src/aiguard/messages/vercel-ai.js +20 -6
  86. package/packages/dd-trace/src/appsec/api_security/index.js +23 -6
  87. package/packages/dd-trace/src/appsec/api_security/sampler.js +99 -40
  88. package/packages/dd-trace/src/appsec/graphql.js +6 -2
  89. package/packages/dd-trace/src/appsec/iast/taint-tracking/plugin.js +3 -3
  90. package/packages/dd-trace/src/appsec/iast/taint-tracking/taint-tracking-impl.js +2 -1
  91. package/packages/dd-trace/src/appsec/iast/telemetry/span-tags.js +8 -2
  92. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/command-sensitive-analyzer.js +3 -1
  93. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/sql-sensitive-analyzer.js +531 -95
  94. package/packages/dd-trace/src/appsec/iast/vulnerabilities-formatter/evidence-redaction/sensitive-analyzers/url-sensitive-analyzer.js +1 -1
  95. package/packages/dd-trace/src/appsec/lambda.js +44 -26
  96. package/packages/dd-trace/src/ci-visibility/encode/json-encoder.js +32 -2
  97. package/packages/dd-trace/src/ci-visibility/exporters/agent-proxy/index.js +8 -8
  98. package/packages/dd-trace/src/ci-visibility/exporters/agentless/coverage-writer.js +6 -4
  99. package/packages/dd-trace/src/ci-visibility/exporters/agentless/di-logs-writer.js +20 -4
  100. package/packages/dd-trace/src/ci-visibility/exporters/agentless/request-tracker.js +5 -173
  101. package/packages/dd-trace/src/ci-visibility/exporters/agentless/writer.js +7 -6
  102. package/packages/dd-trace/src/ci-visibility/exporters/agents.js +54 -0
  103. package/packages/dd-trace/src/ci-visibility/exporters/ci-validation/writer.js +1 -2
  104. package/packages/dd-trace/src/ci-visibility/exporters/ci-visibility-exporter.js +394 -225
  105. package/packages/dd-trace/src/ci-visibility/exporters/limits.js +9 -0
  106. package/packages/dd-trace/src/ci-visibility/exporters/request.js +323 -31
  107. package/packages/dd-trace/src/ci-visibility/exporters/settings-cache-key.js +42 -0
  108. package/packages/dd-trace/src/ci-visibility/final-flush.js +2 -1
  109. package/packages/dd-trace/src/ci-visibility/requests/fs-cache.js +57 -18
  110. package/packages/dd-trace/src/ci-visibility/requests/get-library-configuration.js +0 -3
  111. package/packages/dd-trace/src/ci-visibility/requests/request.js +11 -0
  112. package/packages/dd-trace/src/ci-visibility/requests/upload-test-screenshot.js +164 -71
  113. package/packages/dd-trace/src/ci-visibility/requests/video-request.js +180 -0
  114. package/packages/dd-trace/src/ci-visibility/telemetry.js +10 -7
  115. package/packages/dd-trace/src/ci-visibility/test-video.js +61 -0
  116. package/packages/dd-trace/src/config/generated-config-types.d.ts +4 -0
  117. package/packages/dd-trace/src/config/index.js +73 -13
  118. package/packages/dd-trace/src/config/parsers.js +11 -1
  119. package/packages/dd-trace/src/config/stable.js +3 -3
  120. package/packages/dd-trace/src/config/supported-configurations.json +22 -2
  121. package/packages/dd-trace/src/crashtracking/crashtracker.js +82 -18
  122. package/packages/dd-trace/src/debugger/config.js +12 -1
  123. package/packages/dd-trace/src/debugger/constants.js +1 -0
  124. package/packages/dd-trace/src/debugger/devtools_client/breakpoints.js +2 -1
  125. package/packages/dd-trace/src/debugger/devtools_client/request-options.js +28 -0
  126. package/packages/dd-trace/src/debugger/devtools_client/send.js +7 -40
  127. package/packages/dd-trace/src/debugger/devtools_client/status.js +11 -6
  128. package/packages/dd-trace/src/debugger/devtools_client/tags.js +41 -0
  129. package/packages/dd-trace/src/debugger/index.js +23 -3
  130. package/packages/dd-trace/src/dogstatsd.js +510 -76
  131. package/packages/dd-trace/src/encode/0.4-cross-payload.js +170 -0
  132. package/packages/dd-trace/src/encode/0.4.js +5 -5
  133. package/packages/dd-trace/src/encode/agentless-ci-visibility.js +9 -8
  134. package/packages/dd-trace/src/evp_proxy/direct.js +3 -25
  135. package/packages/dd-trace/src/exporters/agent/index.js +2 -1
  136. package/packages/dd-trace/src/exporters/agent/writer.js +24 -7
  137. package/packages/dd-trace/src/exporters/agentless/index.js +7 -9
  138. package/packages/dd-trace/src/exporters/agentless/writer.js +103 -119
  139. package/packages/dd-trace/src/exporters/common/agents.js +28 -6
  140. package/packages/dd-trace/src/exporters/common/buffering-exporter.js +2 -2
  141. package/packages/dd-trace/src/exporters/common/final-flush-request-tracker.js +191 -0
  142. package/packages/dd-trace/src/exporters/common/proxy.js +52 -0
  143. package/packages/dd-trace/src/exporters/common/request.js +42 -14
  144. package/packages/dd-trace/src/exporters/common/url.js +40 -1
  145. package/packages/dd-trace/src/exporters/common/writer.js +9 -7
  146. package/packages/dd-trace/src/flush.js +6 -3
  147. package/packages/dd-trace/src/id.js +14 -0
  148. package/packages/dd-trace/src/index.js +5 -2
  149. package/packages/dd-trace/src/llmobs/experiments/dataset.js +2 -1
  150. package/packages/dd-trace/src/llmobs/index.js +32 -32
  151. package/packages/dd-trace/src/llmobs/plugins/ai/ddTelemetry.js +22 -71
  152. package/packages/dd-trace/src/llmobs/plugins/ai/vercelTelemetry.js +23 -13
  153. package/packages/dd-trace/src/llmobs/plugins/langchain/index.js +7 -0
  154. package/packages/dd-trace/src/llmobs/util.js +0 -33
  155. package/packages/dd-trace/src/llmobs/writers/base.js +49 -32
  156. package/packages/dd-trace/src/log/index.js +7 -1
  157. package/packages/dd-trace/src/{ci-visibility/log-submission → log-submission}/log-submission-plugin.js +48 -19
  158. package/packages/dd-trace/src/openfeature/writers/base.js +14 -12
  159. package/packages/dd-trace/src/openfeature/writers/util.js +1 -1
  160. package/packages/dd-trace/src/opentelemetry/logs/index.js +5 -24
  161. package/packages/dd-trace/src/opentelemetry/logs/otlp_http_log_exporter.js +14 -4
  162. package/packages/dd-trace/src/opentelemetry/metrics/index.js +15 -22
  163. package/packages/dd-trace/src/opentelemetry/metrics/otlp_http_metric_exporter.js +14 -4
  164. package/packages/dd-trace/src/opentelemetry/metrics/otlp_span_stats_exporter.js +10 -0
  165. package/packages/dd-trace/src/opentelemetry/otlp/otlp_http_exporter_base.js +5 -0
  166. package/packages/dd-trace/src/opentelemetry/otlp/otlp_transformer_base.js +19 -4
  167. package/packages/dd-trace/src/opentelemetry/resource-attributes.js +55 -0
  168. package/packages/dd-trace/src/opentelemetry/trace/index.js +6 -1
  169. package/packages/dd-trace/src/opentelemetry/trace/otlp_http_trace_exporter.js +10 -0
  170. package/packages/dd-trace/src/opentracing/propagation/text_map.js +101 -20
  171. package/packages/dd-trace/src/payload-tagging/index.js +2 -1
  172. package/packages/dd-trace/src/plugins/ci_plugin.js +1 -6
  173. package/packages/dd-trace/src/plugins/tracing.js +12 -10
  174. package/packages/dd-trace/src/plugins/util/ci.js +3 -1
  175. package/packages/dd-trace/src/plugins/util/inferred_proxy.js +16 -15
  176. package/packages/dd-trace/src/plugins/util/test.js +83 -20
  177. package/packages/dd-trace/src/plugins/util/url.js +2 -2
  178. package/packages/dd-trace/src/plugins/util/web.js +4 -9
  179. package/packages/dd-trace/src/priority_sampler.js +4 -0
  180. package/packages/dd-trace/src/profiling/config.js +1 -0
  181. package/packages/dd-trace/src/profiling/oom.js +7 -2
  182. package/packages/dd-trace/src/profiling/profiler.js +23 -13
  183. package/packages/dd-trace/src/profiling/profilers/space.js +38 -11
  184. package/packages/dd-trace/src/profiling/webspan-utils.js +7 -4
  185. package/packages/dd-trace/src/proxy.js +75 -5
  186. package/packages/dd-trace/src/remote_config/index.js +319 -101
  187. package/packages/dd-trace/src/remote_config/scheduler.js +37 -12
  188. package/packages/dd-trace/src/runtime_metrics/client.js +37 -8
  189. package/packages/dd-trace/src/runtime_metrics/otlp_runtime_metrics.js +5 -1
  190. package/packages/dd-trace/src/runtime_metrics/runtime_metrics.js +5 -1
  191. package/packages/dd-trace/src/sampling_rule.js +39 -10
  192. package/packages/dd-trace/src/serverless/telemetry-delivery-tracker.js +4 -8
  193. package/packages/dd-trace/src/serverless/vercel.js +53 -20
  194. package/packages/dd-trace/src/serverless.js +10 -3
  195. package/packages/dd-trace/src/service-naming/schemas/util.js +1 -1
  196. package/packages/dd-trace/src/span_processor.js +18 -3
  197. package/packages/dd-trace/src/span_stats.js +24 -28
  198. package/packages/dd-trace/src/startup-log.js +3 -2
  199. package/packages/dd-trace/src/telemetry/agentless-url.js +28 -0
  200. package/packages/dd-trace/src/telemetry/send-data.js +23 -20
  201. package/packages/dd-trace/src/telemetry/session-propagation.js +3 -2
  202. package/packages/dd-trace/src/tracer.js +4 -5
  203. package/packages/dd-trace/src/tracer_metadata.js +11 -3
  204. package/vendor/dist/@datadog/sketches-js/index.js +1 -1
  205. package/vendor/dist/protobufjs/index.js +1 -1
  206. package/vendor/dist/protobufjs/minimal/index.js +1 -1
  207. package/packages/datadog-instrumentations/src/playwright-browser-scripts.js +0 -27
  208. package/packages/dd-trace/src/encode/agentless-json.js +0 -210
@@ -2,6 +2,7 @@
2
2
 
3
3
  const request = require('../exporters/common/request')
4
4
  const log = require('../log')
5
+ const getAgentlessTelemetryUrl = require('./agentless-url')
5
6
 
6
7
  /**
7
8
  * @typedef {Record<string, unknown>} TelemetryPayloadObject
@@ -69,14 +70,16 @@ const log = require('../log')
69
70
  */
70
71
 
71
72
  let agentTelemetry = true
73
+ let getTestOptimizationAgent
72
74
 
73
75
  /**
74
76
  * @param {import('../config/config-base')} config
75
77
  * @param {TelemetryApplication} application
76
78
  * @param {TelemetryRequestType} reqType
79
+ * @param {string} [apiKey]
77
80
  * @returns {Record<string, string>}
78
81
  */
79
- function getHeaders (config, application, reqType) {
82
+ function getHeaders (config, application, reqType, apiKey) {
80
83
  const headers = {
81
84
  'DD-Client-Library-Language': application.language_name,
82
85
  'DD-Client-Library-Version': application.tracer_version,
@@ -92,22 +95,12 @@ function getHeaders (config, application, reqType) {
92
95
  if (debug) {
93
96
  headers['dd-telemetry-debug-enabled'] = 'true'
94
97
  }
95
- if (config.DD_API_KEY) {
96
- headers['dd-api-key'] = config.DD_API_KEY
98
+ if (apiKey) {
99
+ headers['dd-api-key'] = apiKey
97
100
  }
98
101
  return headers
99
102
  }
100
103
 
101
- /**
102
- * @param {string | undefined} site
103
- */
104
- function getAgentlessTelemetryEndpoint (site) {
105
- if (site === 'datad0g.com') { // staging
106
- return 'https://all-http-intake.logs.datad0g.com'
107
- }
108
- return `https://instrumentation-telemetry-intake.${site}`
109
- }
110
-
111
104
  let seqId = 0
112
105
 
113
106
  /**
@@ -144,10 +137,18 @@ function sendData (config, application, host, reqType, payload = {}, cb = () =>
144
137
  let url = config.url
145
138
 
146
139
  const isCiVisibilityAgentlessMode = isCiVisibility && testOptimization.DD_CIVISIBILITY_AGENTLESS_ENABLED
140
+ const isApmTracingAgentlessMode = config.experimental?.exporter === 'agentless'
141
+ const isAgentlessMode = isCiVisibilityAgentlessMode || isApmTracingAgentlessMode
142
+
143
+ if (isCiVisibility && getTestOptimizationAgent === undefined) {
144
+ ({ getAgent: getTestOptimizationAgent } = require('../ci-visibility/exporters/agents'))
145
+ }
147
146
 
148
- if (isCiVisibilityAgentlessMode) {
147
+ if (isAgentlessMode) {
149
148
  try {
150
- url = testOptimization.DD_CIVISIBILITY_AGENTLESS_URL ?? new URL(getAgentlessTelemetryEndpoint(config.site))
149
+ url = isCiVisibilityAgentlessMode
150
+ ? testOptimization.DD_CIVISIBILITY_AGENTLESS_URL ?? getAgentlessTelemetryUrl(config.site)
151
+ : getAgentlessTelemetryUrl(config.site)
151
152
  } catch (err) {
152
153
  log.error('Telemetry endpoint url is invalid', err)
153
154
  // No point to do the request if the URL is invalid
@@ -160,9 +161,10 @@ function sendData (config, application, host, reqType, payload = {}, cb = () =>
160
161
  hostname,
161
162
  port,
162
163
  method: 'POST',
163
- path: isCiVisibilityAgentlessMode ? '/api/v2/apmtelemetry' : '/telemetry/proxy/api/v2/apmtelemetry',
164
- headers: getHeaders(config, application, reqType),
164
+ path: isAgentlessMode ? '/api/v2/apmtelemetry' : '/telemetry/proxy/api/v2/apmtelemetry',
165
+ headers: getHeaders(config, application, reqType, isAgentlessMode ? config.DD_API_KEY : undefined),
165
166
  }
167
+ if (isCiVisibility) options.agent = getTestOptimizationAgent(url)
166
168
 
167
169
  const data = JSON.stringify({
168
170
  api_version: 'v2',
@@ -177,7 +179,7 @@ function sendData (config, application, host, reqType, payload = {}, cb = () =>
177
179
  })
178
180
 
179
181
  request(data, options, (error) => {
180
- if (error && config.DD_API_KEY && config.site) {
182
+ if (!isAgentlessMode && error && config.DD_API_KEY && config.site) {
181
183
  if (agentTelemetry) {
182
184
  log.warn('Agent telemetry failed, started agentless telemetry')
183
185
  agentTelemetry = false
@@ -185,7 +187,7 @@ function sendData (config, application, host, reqType, payload = {}, cb = () =>
185
187
  // figure out which data center to send to
186
188
  let backendUrl
187
189
  try {
188
- backendUrl = new URL(getAgentlessTelemetryEndpoint(config.site))
190
+ backendUrl = getAgentlessTelemetryUrl(config.site)
189
191
  } catch {
190
192
  log.error('Invalid Telemetry URL')
191
193
  return
@@ -197,6 +199,7 @@ function sendData (config, application, host, reqType, payload = {}, cb = () =>
197
199
  headers: backendHeader,
198
200
  path: '/api/v2/apmtelemetry',
199
201
  }
202
+ if (isCiVisibility) backendOptions.agent = getTestOptimizationAgent(backendUrl)
200
203
  request(data, backendOptions, (error) => {
201
204
  if (error) {
202
205
  log.error('Error sending telemetry data', error)
@@ -204,7 +207,7 @@ function sendData (config, application, host, reqType, payload = {}, cb = () =>
204
207
  })
205
208
  }
206
209
 
207
- if (!error && !agentTelemetry) {
210
+ if (!isAgentlessMode && !error && !agentTelemetry) {
208
211
  agentTelemetry = true
209
212
  log.info('Started agent telemetry')
210
213
  }
@@ -4,13 +4,14 @@ const dc = /** @type {typeof import('diagnostics_channel')} */ (require('dc-poly
4
4
  const childProcessChannel = dc.tracingChannel('datadog:child_process:execution')
5
5
 
6
6
  let subscribed = false
7
- let runtimeId
7
+ let savedConfig
8
8
 
9
9
  function isOptionsObject (value) {
10
10
  return value != null && typeof value === 'object' && !Array.isArray(value) && value
11
11
  }
12
12
 
13
13
  function getEnvWithRuntimeId (env) {
14
+ const runtimeId = savedConfig.DD_ROOT_JS_SESSION_ID || savedConfig.tags['runtime-id']
14
15
  // eslint-disable-next-line eslint-rules/eslint-process-env
15
16
  return { ...(env ?? process.env), DD_ROOT_JS_SESSION_ID: runtimeId }
16
17
  }
@@ -43,7 +44,7 @@ function start (config) {
43
44
  if (!config.telemetry.DD_INSTRUMENTATION_TELEMETRY_ENABLED || subscribed) return
44
45
  subscribed = true
45
46
 
46
- runtimeId = config.DD_ROOT_JS_SESSION_ID || config.tags['runtime-id']
47
+ savedConfig = config
47
48
 
48
49
  childProcessChannel.subscribe(
49
50
  /** @type {import('diagnostics_channel').TracingChannelSubscribers<object>} */ ({ start: onChildProcessStart })
@@ -43,13 +43,10 @@ class DatadogTracer extends Tracer {
43
43
 
44
44
  if (!IS_SERVERLESS) {
45
45
  const storeConfig = require('./tracer_metadata')
46
- // Keep a reference to the handle, to keep the memfd alive in memory.
47
- // It is read by the service discovery feature.
48
46
  const metadata = storeConfig(config)
49
47
  if (metadata === undefined) {
50
48
  log.warn('Could not store tracer configuration for service discovery')
51
49
  }
52
- this._inmem_cfg = metadata
53
50
  }
54
51
  }
55
52
 
@@ -180,8 +177,10 @@ class DatadogTracer extends Tracer {
180
177
  if (!this._enableGetRumData) {
181
178
  return ''
182
179
  }
183
- const span = this.scope().active().context()
184
- const traceId = span.toTraceId()
180
+ const span = this.scope().active()
181
+ if (!span) return ''
182
+
183
+ const traceId = span.context().toTraceId()
185
184
  const traceTime = Date.now()
186
185
  return `\
187
186
  <meta name="dd-trace-id" content="${traceId}" />\
@@ -2,11 +2,18 @@
2
2
 
3
3
  const tracerVersion = require('../../../version').VERSION
4
4
 
5
+ // Service discovery reads this metadata after tracer initialization; retaining the handle keeps
6
+ // the backing memfd open for the process lifetime.
7
+ let metadataHandle
8
+
9
+ /**
10
+ * @param {import('./config/config-base')} config
11
+ */
5
12
  function storeConfig (config) {
6
13
  try {
7
14
  // Load binding first to not import other modules if it throws
8
- const libdatadog = require('@datadog/libdatadog')
9
- const processDiscovery = libdatadog.maybeLoad('process-discovery')
15
+ const libdatadogExtras = require('@datadog/libdatadog-extras')
16
+ const processDiscovery = libdatadogExtras.maybeLoad('process-discovery')
10
17
  if (processDiscovery === undefined) {
11
18
  return
12
19
  }
@@ -42,7 +49,8 @@ function storeConfig (config) {
42
49
  threadlocalMetadata
43
50
  )
44
51
 
45
- return processDiscovery.storeMetadata(metadata)
52
+ metadataHandle = processDiscovery.storeMetadata(metadata)
53
+ return metadataHandle
46
54
  } catch {
47
55
  // Either libdatadog or process-discovery is unavailable.
48
56
  }
@@ -1 +1 @@
1
- (()=>{var t={"./@datadog/sketches-js/dist/ddsketch/DDSketch.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.LogCollapsingHighestDenseDDSketch=e.LogCollapsingLowestDenseDDSketch=e.DDSketch=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/store/index.js"),s=i("./@datadog/sketches-js/dist/ddsketch/mapping/index.js"),u=function(){function BaseDDSketch(t){var e=t.mapping,i=t.store,r=t.negativeStore,n=t.zeroCount;this.mapping=e,this.store=i,this.negativeStore=r,this.zeroCount=n,this.count=this.negativeStore.count+this.zeroCount+this.store.count,this.min=1/0,this.max=-1/0,this.sum=0}return BaseDDSketch.prototype.accept=function(t,e){if(void 0===e&&(e=1),e<=0)throw Error("Weight must be a positive number");if(t>this.mapping.minPossible){var i=this.mapping.key(t);this.store.add(i,e)}else if(t<-this.mapping.minPossible){var i=this.mapping.key(-t);this.negativeStore.add(i,e)}else this.zeroCount+=e;this.count+=e,this.sum+=t*e,t<this.min&&(this.min=t),t>this.max&&(this.max=t)},BaseDDSketch.prototype.getValueAtQuantile=function(t){if(t<0||t>1||0===this.count)return NaN;var e=t*(this.count-1),i=0;if(e<this.negativeStore.count){var r=this.negativeStore.count-e-1,n=this.negativeStore.keyAtRank(r,!1);i=-this.mapping.value(n)}else{if(e<this.zeroCount+this.negativeStore.count)return 0;var n=this.store.keyAtRank(e-this.zeroCount-this.negativeStore.count);i=this.mapping.value(n)}return i},BaseDDSketch.prototype.merge=function(t){if(!this.mergeable(t))throw Error("Cannot merge two DDSketches with different `relativeAccuracy` parameters");if(0!==t.count){if(0===this.count)return void this._copy(t);this.store.merge(t.store),this.zeroCount+=t.zeroCount,this.count+=t.count,this.sum+=t.sum,t.min<this.min&&(this.min=t.min),t.max>this.max&&(this.max=t.max)}},BaseDDSketch.prototype.mergeable=function(t){return this.mapping.gamma===t.mapping.gamma},BaseDDSketch.prototype._copy=function(t){this.store.copy(t.store),this.negativeStore.copy(t.negativeStore),this.zeroCount=t.zeroCount,this.min=t.min,this.max=t.max,this.count=t.count,this.sum=t.sum},BaseDDSketch.prototype.toProto=function(){var t=i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").DDSketch,e=t.create({mapping:this.mapping.toProto(),positiveValues:this.store.toProto(),negativeValues:this.negativeStore.toProto(),zeroCount:this.zeroCount});return t.encode(e).finish()},BaseDDSketch.fromProto=function(t){var e=i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").DDSketch.decode(t);return new BaseDDSketch({mapping:s.KeyMapping.fromProto(e.mapping),store:o.DenseStore.fromProto(e.positiveValues),negativeStore:o.DenseStore.fromProto(e.negativeValues),zeroCount:e.zeroCount})},BaseDDSketch}(),a={relativeAccuracy:.01};e.DDSketch=function(t){function DDSketch(e){var i=(void 0===e?a:e).relativeAccuracy,r=new s.LogarithmicMapping(void 0===i?.01:i),n=new o.DenseStore,u=new o.DenseStore;return t.call(this,{mapping:r,store:n,negativeStore:u,zeroCount:0})||this}return n(DDSketch,t),DDSketch}(u),e.LogCollapsingLowestDenseDDSketch=function(t){function LogCollapsingLowestDenseDDSketch(e){var i=void 0===e?a:e,r=i.relativeAccuracy,n=i.binLimit,u=void 0===n?2048:n,h=new s.LogarithmicMapping(void 0===r?.01:r),f=new o.CollapsingLowestDenseStore(u),p=new o.CollapsingLowestDenseStore(u);return t.call(this,{mapping:h,store:f,negativeStore:p,zeroCount:0})||this}return n(LogCollapsingLowestDenseDDSketch,t),LogCollapsingLowestDenseDDSketch}(u),e.LogCollapsingHighestDenseDDSketch=function(t){function LogCollapsingHighestDenseDDSketch(e){var i=void 0===e?a:e,r=i.relativeAccuracy,n=i.binLimit,u=void 0===n?2048:n,h=new s.LogarithmicMapping(void 0===r?.01:r),f=new o.CollapsingHighestDenseStore(u),p=new o.CollapsingHighestDenseStore(u);return t.call(this,{mapping:h,store:f,negativeStore:p,zeroCount:0})||this}return n(LogCollapsingHighestDenseDDSketch,t),LogCollapsingHighestDenseDDSketch}(u)},"./@datadog/sketches-js/dist/ddsketch/index.js"(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i("./@datadog/sketches-js/dist/ddsketch/DDSketch.js"),e)},"./@datadog/sketches-js/dist/ddsketch/mapping/CubicallyInterpolatedMapping.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.CubicallyInterpolatedMapping=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"),s=i("./@datadog/sketches-js/dist/ddsketch/math.js");e.CubicallyInterpolatedMapping=function(t){function CubicallyInterpolatedMapping(e,i){void 0===i&&(i=0);var r=t.call(this,e,i)||this;return r.A=6/35,r.B=-.6,r.C=10/7,r._multiplier/=r.C,r}return n(CubicallyInterpolatedMapping,t),CubicallyInterpolatedMapping.prototype._cubicLog2Approx=function(t){var e=(0,s.frexp)(t),i=e[0],r=e[1],n=2*i-1;return((this.A*n+this.B)*n+this.C)*n+(r-1)},CubicallyInterpolatedMapping.prototype._cubicExp2Approx=function(t){var e=Math.floor(t),i=this.B*this.B-3*this.A*this.C,r=2*this.B*this.B*this.B-9*this.A*this.B*this.C-27*this.A*this.A*(t-e),n=Math.cbrt((r-Math.sqrt(r*r-4*i*i*i))/2),o=-(this.B+n+i/n)/(3*this.A)+1;return(0,s.ldexp)(o/2,e+1)},CubicallyInterpolatedMapping.prototype._logGamma=function(t){return this._cubicLog2Approx(t)*this._multiplier},CubicallyInterpolatedMapping.prototype._powGamma=function(t){return this._cubicExp2Approx(t/this._multiplier)},CubicallyInterpolatedMapping.prototype._protoInterpolation=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.CUBIC},CubicallyInterpolatedMapping}(o.KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyMapping=void 0;var r=i("./@datadog/sketches-js/dist/ddsketch/mapping/index.js"),n=Number.MAX_VALUE;e.KeyMapping=function(){function KeyMapping(t,e){if(void 0===e&&(e=0),t<=0||t>=1)throw Error("Relative accuracy must be between 0 and 1 when initializing a KeyMapping");this.relativeAccuracy=t,this._offset=e;var i=2*t/(1-t);this.gamma=1+i,this._multiplier=1/Math.log1p(i),this.minPossible=11125369292536007e-324*this.gamma,this.maxPossible=n/this.gamma}return KeyMapping.fromGammaOffset=function(t,e){return new this((t-1)/(t+1),e)},KeyMapping.prototype.key=function(t){return Math.ceil(this._logGamma(t))+this._offset},KeyMapping.prototype.value=function(t){return this._powGamma(t-this._offset)*(2/(1+this.gamma))},KeyMapping.prototype.toProto=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.create({gamma:this.gamma,indexOffset:this._offset,interpolation:this._protoInterpolation()})},KeyMapping.fromProto=function(t){if(!t||null==t.gamma||null==t.indexOffset)throw Error("Failed to decode mapping from protobuf");var e=i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation,n=t.interpolation,o=t.gamma,s=t.indexOffset;switch(n){case e.NONE:return r.LogarithmicMapping.fromGammaOffset(o,s);case e.LINEAR:return r.LinearlyInterpolatedMapping.fromGammaOffset(o,s);case e.CUBIC:return r.CubicallyInterpolatedMapping.fromGammaOffset(o,s);default:throw Error("Unrecognized mapping when decoding from protobuf")}},KeyMapping.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},KeyMapping.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},KeyMapping.prototype._protoInterpolation=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.NONE},KeyMapping}()},"./@datadog/sketches-js/dist/ddsketch/mapping/LinearlyInterpolatedMapping.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.LinearlyInterpolatedMapping=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"),s=i("./@datadog/sketches-js/dist/ddsketch/math.js");e.LinearlyInterpolatedMapping=function(t){function LinearlyInterpolatedMapping(e,i){return void 0===i&&(i=0),t.call(this,e,i)||this}return n(LinearlyInterpolatedMapping,t),LinearlyInterpolatedMapping.prototype._log2Approx=function(t){var e=(0,s.frexp)(t);return 2*e[0]-1+(e[1]-1)},LinearlyInterpolatedMapping.prototype._exp2Approx=function(t){var e=Math.floor(t)+1;return(0,s.ldexp)((t-e+2)/2,e)},LinearlyInterpolatedMapping.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},LinearlyInterpolatedMapping.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},LinearlyInterpolatedMapping.prototype._protoInterpolation=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.LINEAR},LinearlyInterpolatedMapping}(o.KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/LogarithmicMapping.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.LogarithmicMapping=void 0,e.LogarithmicMapping=function(t){function LogarithmicMapping(e,i){void 0===i&&(i=0);var r=t.call(this,e,i)||this;return r._multiplier*=Math.log(2),r}return n(LogarithmicMapping,t),LogarithmicMapping.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},LogarithmicMapping.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},LogarithmicMapping.prototype._protoInterpolation=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.NONE},LogarithmicMapping}(i("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js").KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/index.js"(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CubicallyInterpolatedMapping=e.LinearlyInterpolatedMapping=e.LogarithmicMapping=e.KeyMapping=void 0;var r=i("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js");Object.defineProperty(e,"KeyMapping",{enumerable:!0,get:function(){return r.KeyMapping}});var n=i("./@datadog/sketches-js/dist/ddsketch/mapping/LogarithmicMapping.js");Object.defineProperty(e,"LogarithmicMapping",{enumerable:!0,get:function(){return n.LogarithmicMapping}});var o=i("./@datadog/sketches-js/dist/ddsketch/mapping/LinearlyInterpolatedMapping.js");Object.defineProperty(e,"LinearlyInterpolatedMapping",{enumerable:!0,get:function(){return o.LinearlyInterpolatedMapping}});var s=i("./@datadog/sketches-js/dist/ddsketch/mapping/CubicallyInterpolatedMapping.js");Object.defineProperty(e,"CubicallyInterpolatedMapping",{enumerable:!0,get:function(){return s.CubicallyInterpolatedMapping}})},"./@datadog/sketches-js/dist/ddsketch/math.js"(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ldexp=e.frexp=void 0,e.frexp=function(t){if(0===t||!Number.isFinite(t))return[t,0];for(var e=Math.abs(t),i=Math.max(-1023,Math.floor(Math.log2(e))+1),r=e*Math.pow(2,-i);r<.5;)r*=2,i--;for(;r>=1;)r*=.5,i++;return t<0&&(r=-r),[r,i]},e.ldexp=function(t,e){for(var i=Math.min(3,Math.ceil(Math.abs(e)/1023)),r=t,n=0;n<i;n++)r*=Math.pow(2,Math.floor((e+n)/i));return r}},"./@datadog/sketches-js/dist/ddsketch/proto/compiled.js"(t,e,i){"use strict";var r=i("./protobufjs/minimal.js"),n=r.Reader,o=r.Writer,s=r.util,u=r.roots.default||(r.roots.default={});u.DDSketch=function(){function DDSketch(t){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return DDSketch.prototype.mapping=null,DDSketch.prototype.positiveValues=null,DDSketch.prototype.negativeValues=null,DDSketch.prototype.zeroCount=0,DDSketch.create=function(t){return new DDSketch(t)},DDSketch.encode=function(t,e){return e||(e=o.create()),null!=t.mapping&&Object.hasOwnProperty.call(t,"mapping")&&u.IndexMapping.encode(t.mapping,e.uint32(10).fork()).ldelim(),null!=t.positiveValues&&Object.hasOwnProperty.call(t,"positiveValues")&&u.Store.encode(t.positiveValues,e.uint32(18).fork()).ldelim(),null!=t.negativeValues&&Object.hasOwnProperty.call(t,"negativeValues")&&u.Store.encode(t.negativeValues,e.uint32(26).fork()).ldelim(),null!=t.zeroCount&&Object.hasOwnProperty.call(t,"zeroCount")&&e.uint32(33).double(t.zeroCount),e},DDSketch.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},DDSketch.decode=function(t,e){t instanceof n||(t=n.create(t));for(var i=void 0===e?t.len:t.pos+e,r=new u.DDSketch;t.pos<i;){var o=t.uint32();switch(o>>>3){case 1:r.mapping=u.IndexMapping.decode(t,t.uint32());break;case 2:r.positiveValues=u.Store.decode(t,t.uint32());break;case 3:r.negativeValues=u.Store.decode(t,t.uint32());break;case 4:r.zeroCount=t.double();break;default:t.skipType(7&o)}}return r},DDSketch.decodeDelimited=function(t){return t instanceof n||(t=new n(t)),this.decode(t,t.uint32())},DDSketch.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.mapping&&t.hasOwnProperty("mapping")){var e=u.IndexMapping.verify(t.mapping);if(e)return"mapping."+e}if(null!=t.positiveValues&&t.hasOwnProperty("positiveValues")){var e=u.Store.verify(t.positiveValues);if(e)return"positiveValues."+e}if(null!=t.negativeValues&&t.hasOwnProperty("negativeValues")){var e=u.Store.verify(t.negativeValues);if(e)return"negativeValues."+e}return null!=t.zeroCount&&t.hasOwnProperty("zeroCount")&&"number"!=typeof t.zeroCount?"zeroCount: number expected":null},DDSketch.fromObject=function(t){if(t instanceof u.DDSketch)return t;var e=new u.DDSketch;if(null!=t.mapping){if("object"!=typeof t.mapping)throw TypeError(".DDSketch.mapping: object expected");e.mapping=u.IndexMapping.fromObject(t.mapping)}if(null!=t.positiveValues){if("object"!=typeof t.positiveValues)throw TypeError(".DDSketch.positiveValues: object expected");e.positiveValues=u.Store.fromObject(t.positiveValues)}if(null!=t.negativeValues){if("object"!=typeof t.negativeValues)throw TypeError(".DDSketch.negativeValues: object expected");e.negativeValues=u.Store.fromObject(t.negativeValues)}return null!=t.zeroCount&&(e.zeroCount=Number(t.zeroCount)),e},DDSketch.toObject=function(t,e){e||(e={});var i={};return e.defaults&&(i.mapping=null,i.positiveValues=null,i.negativeValues=null,i.zeroCount=0),null!=t.mapping&&t.hasOwnProperty("mapping")&&(i.mapping=u.IndexMapping.toObject(t.mapping,e)),null!=t.positiveValues&&t.hasOwnProperty("positiveValues")&&(i.positiveValues=u.Store.toObject(t.positiveValues,e)),null!=t.negativeValues&&t.hasOwnProperty("negativeValues")&&(i.negativeValues=u.Store.toObject(t.negativeValues,e)),null!=t.zeroCount&&t.hasOwnProperty("zeroCount")&&(i.zeroCount=e.json&&!isFinite(t.zeroCount)?String(t.zeroCount):t.zeroCount),i},DDSketch.prototype.toJSON=function(){return this.constructor.toObject(this,r.util.toJSONOptions)},DDSketch}(),u.IndexMapping=function(){var t,e;function IndexMapping(t){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return IndexMapping.prototype.gamma=0,IndexMapping.prototype.indexOffset=0,IndexMapping.prototype.interpolation=0,IndexMapping.create=function(t){return new IndexMapping(t)},IndexMapping.encode=function(t,e){return e||(e=o.create()),null!=t.gamma&&Object.hasOwnProperty.call(t,"gamma")&&e.uint32(9).double(t.gamma),null!=t.indexOffset&&Object.hasOwnProperty.call(t,"indexOffset")&&e.uint32(17).double(t.indexOffset),null!=t.interpolation&&Object.hasOwnProperty.call(t,"interpolation")&&e.uint32(24).int32(t.interpolation),e},IndexMapping.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},IndexMapping.decode=function(t,e){t instanceof n||(t=n.create(t));for(var i=void 0===e?t.len:t.pos+e,r=new u.IndexMapping;t.pos<i;){var o=t.uint32();switch(o>>>3){case 1:r.gamma=t.double();break;case 2:r.indexOffset=t.double();break;case 3:r.interpolation=t.int32();break;default:t.skipType(7&o)}}return r},IndexMapping.decodeDelimited=function(t){return t instanceof n||(t=new n(t)),this.decode(t,t.uint32())},IndexMapping.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.gamma&&t.hasOwnProperty("gamma")&&"number"!=typeof t.gamma)return"gamma: number expected";if(null!=t.indexOffset&&t.hasOwnProperty("indexOffset")&&"number"!=typeof t.indexOffset)return"indexOffset: number expected";if(null!=t.interpolation&&t.hasOwnProperty("interpolation"))switch(t.interpolation){default:return"interpolation: enum value expected";case 0:case 1:case 2:case 3:}return null},IndexMapping.fromObject=function(t){if(t instanceof u.IndexMapping)return t;var e=new u.IndexMapping;switch(null!=t.gamma&&(e.gamma=Number(t.gamma)),null!=t.indexOffset&&(e.indexOffset=Number(t.indexOffset)),t.interpolation){case"NONE":case 0:e.interpolation=0;break;case"LINEAR":case 1:e.interpolation=1;break;case"QUADRATIC":case 2:e.interpolation=2;break;case"CUBIC":case 3:e.interpolation=3}return e},IndexMapping.toObject=function(t,e){e||(e={});var i={};return e.defaults&&(i.gamma=0,i.indexOffset=0,i.interpolation=e.enums===String?"NONE":0),null!=t.gamma&&t.hasOwnProperty("gamma")&&(i.gamma=e.json&&!isFinite(t.gamma)?String(t.gamma):t.gamma),null!=t.indexOffset&&t.hasOwnProperty("indexOffset")&&(i.indexOffset=e.json&&!isFinite(t.indexOffset)?String(t.indexOffset):t.indexOffset),null!=t.interpolation&&t.hasOwnProperty("interpolation")&&(i.interpolation=e.enums===String?u.IndexMapping.Interpolation[t.interpolation]:t.interpolation),i},IndexMapping.prototype.toJSON=function(){return this.constructor.toObject(this,r.util.toJSONOptions)},(e=Object.create(t={}))[t[0]="NONE"]=0,e[t[1]="LINEAR"]=1,e[t[2]="QUADRATIC"]=2,e[t[3]="CUBIC"]=3,IndexMapping.Interpolation=e,IndexMapping}(),u.Store=function(){function Store(t){if(this.binCounts={},this.contiguousBinCounts=[],t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return Store.prototype.binCounts=s.emptyObject,Store.prototype.contiguousBinCounts=s.emptyArray,Store.prototype.contiguousBinIndexOffset=0,Store.create=function(t){return new Store(t)},Store.encode=function(t,e){if(e||(e=o.create()),null!=t.binCounts&&Object.hasOwnProperty.call(t,"binCounts"))for(var i=Object.keys(t.binCounts),r=0;r<i.length;++r)e.uint32(10).fork().uint32(8).sint32(i[r]).uint32(17).double(t.binCounts[i[r]]).ldelim();if(null!=t.contiguousBinCounts&&t.contiguousBinCounts.length){e.uint32(18).fork();for(var r=0;r<t.contiguousBinCounts.length;++r)e.double(t.contiguousBinCounts[r]);e.ldelim()}return null!=t.contiguousBinIndexOffset&&Object.hasOwnProperty.call(t,"contiguousBinIndexOffset")&&e.uint32(24).sint32(t.contiguousBinIndexOffset),e},Store.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},Store.decode=function(t,e){t instanceof n||(t=n.create(t));for(var i,r,o=void 0===e?t.len:t.pos+e,a=new u.Store;t.pos<o;){var h=t.uint32();switch(h>>>3){case 1:a.binCounts===s.emptyObject&&(a.binCounts={});var f=t.uint32()+t.pos;for(i=0,r=0;t.pos<f;){var p=t.uint32();switch(p>>>3){case 1:i=t.sint32();break;case 2:r=t.double();break;default:t.skipType(7&p)}}a.binCounts[i]=r;break;case 2:if(a.contiguousBinCounts&&a.contiguousBinCounts.length||(a.contiguousBinCounts=[]),(7&h)==2)for(var f=t.uint32()+t.pos;t.pos<f;)a.contiguousBinCounts.push(t.double());else a.contiguousBinCounts.push(t.double());break;case 3:a.contiguousBinIndexOffset=t.sint32();break;default:t.skipType(7&h)}}return a},Store.decodeDelimited=function(t){return t instanceof n||(t=new n(t)),this.decode(t,t.uint32())},Store.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.binCounts&&t.hasOwnProperty("binCounts")){if(!s.isObject(t.binCounts))return"binCounts: object expected";for(var e=Object.keys(t.binCounts),i=0;i<e.length;++i){if(!s.key32Re.test(e[i]))return"binCounts: integer key{k:sint32} expected";if("number"!=typeof t.binCounts[e[i]])return"binCounts: number{k:sint32} expected"}}if(null!=t.contiguousBinCounts&&t.hasOwnProperty("contiguousBinCounts")){if(!Array.isArray(t.contiguousBinCounts))return"contiguousBinCounts: array expected";for(var i=0;i<t.contiguousBinCounts.length;++i)if("number"!=typeof t.contiguousBinCounts[i])return"contiguousBinCounts: number[] expected"}return null!=t.contiguousBinIndexOffset&&t.hasOwnProperty("contiguousBinIndexOffset")&&!s.isInteger(t.contiguousBinIndexOffset)?"contiguousBinIndexOffset: integer expected":null},Store.fromObject=function(t){if(t instanceof u.Store)return t;var e=new u.Store;if(t.binCounts){if("object"!=typeof t.binCounts)throw TypeError(".Store.binCounts: object expected");e.binCounts={};for(var i=Object.keys(t.binCounts),r=0;r<i.length;++r)e.binCounts[i[r]]=Number(t.binCounts[i[r]])}if(t.contiguousBinCounts){if(!Array.isArray(t.contiguousBinCounts))throw TypeError(".Store.contiguousBinCounts: array expected");e.contiguousBinCounts=[];for(var r=0;r<t.contiguousBinCounts.length;++r)e.contiguousBinCounts[r]=Number(t.contiguousBinCounts[r])}return null!=t.contiguousBinIndexOffset&&(e.contiguousBinIndexOffset=0|t.contiguousBinIndexOffset),e},Store.toObject=function(t,e){e||(e={});var i,r={};if((e.arrays||e.defaults)&&(r.contiguousBinCounts=[]),(e.objects||e.defaults)&&(r.binCounts={}),e.defaults&&(r.contiguousBinIndexOffset=0),t.binCounts&&(i=Object.keys(t.binCounts)).length){r.binCounts={};for(var n=0;n<i.length;++n)r.binCounts[i[n]]=e.json&&!isFinite(t.binCounts[i[n]])?String(t.binCounts[i[n]]):t.binCounts[i[n]]}if(t.contiguousBinCounts&&t.contiguousBinCounts.length){r.contiguousBinCounts=[];for(var n=0;n<t.contiguousBinCounts.length;++n)r.contiguousBinCounts[n]=e.json&&!isFinite(t.contiguousBinCounts[n])?String(t.contiguousBinCounts[n]):t.contiguousBinCounts[n]}return null!=t.contiguousBinIndexOffset&&t.hasOwnProperty("contiguousBinIndexOffset")&&(r.contiguousBinIndexOffset=t.contiguousBinIndexOffset),r},Store.prototype.toJSON=function(){return this.constructor.toObject(this,r.util.toJSONOptions)},Store}(),t.exports=u},"./@datadog/sketches-js/dist/ddsketch/store/CollapsingHighestDenseStore.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingHighestDenseStore=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"),s=i("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.CollapsingHighestDenseStore=function(t){function CollapsingHighestDenseStore(e,i){var r=t.call(this,i)||this;return r.binLimit=e,r.isCollapsed=!1,r}return n(CollapsingHighestDenseStore,t),CollapsingHighestDenseStore.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.maxKey-t.offset+1,i=Math.max(this.maxKey+1,t.minKey)-t.offset;if(e>i){var r=(0,s.sumOfRange)(t.bins,i,e);this.bins[this.length()-1]+=r}else i=e;for(var n=t.minKey;n<i+t.offset;n++)this.bins[n-this.offset]+=t.bins[n-t.offset];this.count+=t.count}},CollapsingHighestDenseStore.prototype.copy=function(e){t.prototype.copy.call(this,e),this.isCollapsed=e.isCollapsed},CollapsingHighestDenseStore.prototype._getNewLength=function(t,e){return Math.min(this.chunkSize*Math.ceil((e-t+1)/this.chunkSize),this.binLimit)},CollapsingHighestDenseStore.prototype._adjust=function(t,e){if(e-t+1>this.length())if((e=t+this.length()+1)<=this.minKey)this.offset=t,this.maxKey=e,this.bins.fill(0),this.bins[this.length()-1]=this.count;else{var i=this.offset-t;if(i>0){var r=e-this.offset+1,n=this.maxKey-this.offset+1,o=(0,s.sumOfRange)(this.bins,r,n);this.bins.fill(0,r,n),this.bins[r-1]+=o,this.maxKey=e,this._shiftBins(i)}else this.maxKey=e,this._shiftBins(i);this.minKey=t,this.isCollapsed=!0}else this._centerBins(t,e),this.minKey=t,this.maxKey=e},CollapsingHighestDenseStore.prototype._getIndex=function(t){if(t<this.minKey){if(this.isCollapsed||(this._extendRange(t),this.isCollapsed))return this.length()-1}else t>this.maxKey&&this._extendRange(t);return t-this.offset},CollapsingHighestDenseStore}(o.DenseStore)},"./@datadog/sketches-js/dist/ddsketch/store/CollapsingLowestDenseStore.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingLowestDenseStore=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"),s=i("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.CollapsingLowestDenseStore=function(t){function CollapsingLowestDenseStore(e,i){var r=t.call(this,i)||this;return r.binLimit=e,r.isCollapsed=!1,r}return n(CollapsingLowestDenseStore,t),CollapsingLowestDenseStore.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.minKey-t.offset,i=Math.min(this.minKey,t.maxKey+1)-t.offset;if(i>e){var r=(0,s.sumOfRange)(t.bins,e,i);this.bins[0]+=r}else i=e;for(var n=i+t.offset;n<t.maxKey+1;n++)this.bins[n-this.offset]+=t.bins[n-t.offset];this.count+=t.count}},CollapsingLowestDenseStore.prototype.copy=function(e){t.prototype.copy.call(this,e),this.isCollapsed=e.isCollapsed},CollapsingLowestDenseStore.prototype._getNewLength=function(t,e){return Math.min(this.chunkSize*Math.ceil((e-t+1)/this.chunkSize),this.binLimit)},CollapsingLowestDenseStore.prototype._adjust=function(t,e){if(e-t+1>this.length()){if((t=e-this.length()+1)>=this.maxKey)this.offset=t,this.minKey=t,this.bins.fill(0),this.bins[0]=this.count;else{var i=this.offset-t;if(i<0){var r=this.minKey-this.offset,n=t-this.offset,o=(0,s.sumOfRange)(this.bins,r,n);this.bins.fill(0,r,n),this.bins[n]+=o,this.minKey=t,this._shiftBins(i)}else this.minKey=t,this._shiftBins(i)}this.maxKey=e,this.isCollapsed=!0}else this._centerBins(t,e),this.minKey=t,this.maxKey=e},CollapsingLowestDenseStore.prototype._getIndex=function(t){if(t<this.minKey){if(this.isCollapsed||(this._extendRange(t),this.isCollapsed))return 0}else t>this.maxKey&&this._extendRange(t);return t-this.offset},CollapsingLowestDenseStore}(o.DenseStore)},"./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"(t,e,i){"use strict";var r=this&&this.__spreadArray||function(t,e,i){if(i||2==arguments.length)for(var r,n=0,o=e.length;n<o;n++)!r&&n in e||(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.DenseStore=void 0;var n=i("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.DenseStore=function(){function DenseStore(t){void 0===t&&(t=128),this.chunkSize=t,this.bins=[],this.count=0,this.minKey=1/0,this.maxKey=-1/0,this.offset=0}return DenseStore.prototype.add=function(t,e){void 0===e&&(e=1);var i=this._getIndex(t);this.bins[i]+=e,this.count+=e},DenseStore.prototype.keyAtRank=function(t,e){void 0===e&&(e=!0);for(var i=0,r=0;r<this.length();r++)if(i+=this.bins[r],e&&i>t||!e&&i>=t+1)return r+this.offset;return this.maxKey},DenseStore.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.minKey-t.offset,i=Math.min(this.minKey,t.maxKey+1)-t.offset;if(i>e){var r=(0,n.sumOfRange)(t.bins,e,i);this.bins[0]+=r}else i=e;for(var o=i+t.offset;o<t.maxKey+1;o++)this.bins[o-this.offset]+=t.bins[o-t.offset];this.count+=t.count}},DenseStore.prototype.copy=function(t){this.bins=r([],t.bins,!0),this.count=t.count,this.minKey=t.minKey,this.maxKey=t.maxKey,this.offset=t.offset},DenseStore.prototype.length=function(){return this.bins.length},DenseStore.prototype._getNewLength=function(t,e){return this.chunkSize*Math.ceil((e-t+1)/this.chunkSize)},DenseStore.prototype._adjust=function(t,e){this._centerBins(t,e),this.minKey=t,this.maxKey=e},DenseStore.prototype._shiftBins=function(t){var e,i;t>0?(this.bins=this.bins.slice(0,-t),(e=this.bins).unshift.apply(e,Array(t).fill(0))):(this.bins=this.bins.slice(Math.abs(t)),(i=this.bins).push.apply(i,Array(Math.abs(t)).fill(0))),this.offset-=t},DenseStore.prototype._centerBins=function(t,e){var i=t+Math.floor((e-t+1)/2);this._shiftBins(Math.floor(this.offset+this.length()/2)-i)},DenseStore.prototype._extendRange=function(t,e){e=e||t;var i,r=Math.min(t,e,this.minKey),n=Math.max(t,e,this.maxKey);if(0===this.length())this.bins=Array(this._getNewLength(r,n)).fill(0),this.offset=r,this._adjust(r,n);else if(r>=this.minKey&&n<this.offset+this.length())this.minKey=r,this.maxKey=n;else{var o=this._getNewLength(r,n);o>this.length()&&(i=this.bins).push.apply(i,Array(o-this.length()).fill(0)),this._adjust(r,n)}},DenseStore.prototype._getIndex=function(t){return t<this.minKey?this._extendRange(t):t>this.maxKey&&this._extendRange(t),t-this.offset},DenseStore.prototype.toProto=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").Store.create({contiguousBinCounts:this.bins,contiguousBinIndexOffset:this.offset})},DenseStore.fromProto=function(t){if(!t||null==t.contiguousBinCounts||null==t.contiguousBinIndexOffset)throw Error("Failed to decode store from protobuf");var e=new this,i=t.contiguousBinIndexOffset;e.offset=i;for(var r=0,n=t.contiguousBinCounts;r<n.length;r++){var o=n[r];e.add(i,o),i+=1}return e},DenseStore}()},"./@datadog/sketches-js/dist/ddsketch/store/index.js"(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingHighestDenseStore=e.CollapsingLowestDenseStore=e.DenseStore=void 0;var r=i("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js");Object.defineProperty(e,"DenseStore",{enumerable:!0,get:function(){return r.DenseStore}});var n=i("./@datadog/sketches-js/dist/ddsketch/store/CollapsingLowestDenseStore.js");Object.defineProperty(e,"CollapsingLowestDenseStore",{enumerable:!0,get:function(){return n.CollapsingLowestDenseStore}});var o=i("./@datadog/sketches-js/dist/ddsketch/store/CollapsingHighestDenseStore.js");Object.defineProperty(e,"CollapsingHighestDenseStore",{enumerable:!0,get:function(){return o.CollapsingHighestDenseStore}})},"./@datadog/sketches-js/dist/ddsketch/store/util.js"(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfRange=void 0,e.sumOfRange=function(t,e,i){for(var r=0,n=e;n<=i;n++)r+=t[n];return r}},"./@datadog/sketches-js/dist/index.js"(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i("./@datadog/sketches-js/dist/ddsketch/index.js"),e)},"./long/umd/index.js"(t,e){!function(i,r){function preferDefault(t){return t.default||t}"function"==typeof define&&define.amd?define([],function(){var t={};return r(t),preferDefault(t)}):(r(e),t.exports=preferDefault(e))}("u">typeof globalThis?globalThis:"u">typeof self&&self,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Long(t,e,i){this.low=0|t,this.high=0|e,this.unsigned=!!i}function isLong(t){return!0===(t&&t.__isLong__)}function ctz32(t){var e=Math.clz32(t&-t);return t?31-e:e}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0}),Long.isLong=isLong;var i={},r={};function fromInt(t,e){var n,o,s;if(e)return(t>>>=0,(s=0<=t&&t<256)&&(o=r[t]))?o:(n=fromBits(t,0,!0),s&&(r[t]=n),n);return(t|=0,(s=-128<=t&&t<128)&&(o=i[t]))?o:(n=fromBits(t,t<0?-1:0,!1),s&&(i[t]=n),n)}function fromNumber(t,e){if(isNaN(t))return e?f:h;if(e){if(t<0)return f;if(t>=s)return d}else{if(t<=-u)return m;if(t+1>=u)return g}return t<0?fromNumber(-t,e).neg():fromBits(t%o|0,t/o|0,e)}function fromBits(t,e,i){return new Long(t,e,i)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var n=Math.pow;function fromString(t,e,i){if(0===t.length)throw Error("empty string");if("number"==typeof e?(i=e,e=!1):e=!!e,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e?f:h;if((i=i||10)<2||36<i)throw RangeError("radix");if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return fromString(t.substring(1),e,i).neg();for(var r,o=fromNumber(n(i,8)),s=h,u=0;u<t.length;u+=8){var a=Math.min(8,t.length-u),p=parseInt(t.substring(u,u+a),i);if(a<8){var l=fromNumber(n(i,a));s=s.mul(l).add(fromNumber(p))}else s=(s=s.mul(o)).add(fromNumber(p))}return s.unsigned=e,s}function fromValue(t,e){return"number"==typeof t?fromNumber(t,e):"string"==typeof t?fromString(t,e):fromBits(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}Long.fromString=fromString,Long.fromValue=fromValue;var o=0x100000000,s=0xffffffffffffffff,u=0x8000000000000000,a=fromInt(0x1000000),h=fromInt(0);Long.ZERO=h;var f=fromInt(0,!0);Long.UZERO=f;var p=fromInt(1);Long.ONE=p;var l=fromInt(1,!0);Long.UONE=l;var c=fromInt(-1);Long.NEG_ONE=c;var g=fromBits(-1,0x7fffffff,!1);Long.MAX_VALUE=g;var d=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=d;var m=fromBits(0,-0x80000000,!1);Long.MIN_VALUE=m;var y=Long.prototype;y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},y.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(!this.eq(m))return"-"+this.neg().toString(t);else{var e=fromNumber(t),i=this.div(e),r=i.mul(e).sub(this);return i.toString(t)+r.toInt().toString(t)}for(var o=fromNumber(n(t,6),this.unsigned),s=this,u="";;){var a=s.div(o),h=(s.sub(a.mul(o)).toInt()>>>0).toString(t);if((s=a).isZero())return h+u;for(;h.length<6;)h="0"+h;u=""+h+u}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){if(this.isNegative())return this.eq(m)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&(t&1<<e)==0;e--);return 0!=this.high?e+33:e+1},y.isSafeInteger=function(){var t=this.high>>21;return!t||!this.unsigned&&-1===t&&(0!==this.low||-2097152!==this.high)},y.isZero=function(){return 0===this.high&&0===this.low},y.eqz=y.isZero,y.isNegative=function(){return!this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return(1&this.low)==1},y.isEven=function(){return(1&this.low)==0},y.equals=function(t){return isLong(t)||(t=fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},y.eq=y.equals,y.notEquals=function(t){return!this.eq(t)},y.neq=y.notEquals,y.ne=y.notEquals,y.lessThan=function(t){return 0>this.comp(t)},y.lt=y.lessThan,y.lessThanOrEqual=function(t){return 0>=this.comp(t)},y.lte=y.lessThanOrEqual,y.le=y.lessThanOrEqual,y.greaterThan=function(t){return this.comp(t)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(t){return this.comp(t)>=0},y.gte=y.greaterThanOrEqual,y.ge=y.greaterThanOrEqual,y.compare=function(t){if(isLong(t)||(t=fromValue(t)),this.eq(t))return 0;var e=this.isNegative(),i=t.isNegative();return e&&!i?-1:!e&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return!this.unsigned&&this.eq(m)?m:this.not().add(p)},y.neg=y.negate,y.add=function(t){isLong(t)||(t=fromValue(t));var e,i,r=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,u=t.high>>>16,a=65535&t.high,h=t.low>>>16,f=65535&t.low,p=0,l=0;return e=0+((i=0+(s+f))>>>16),i&=65535,e+=o+h,l+=e>>>16,e&=65535,l+=n+a,p+=l>>>16,l&=65535,p+=r+u,fromBits(e<<16|i,(p&=65535)<<16|l,this.unsigned)},y.subtract=function(t){return isLong(t)||(t=fromValue(t)),this.add(t.neg())},y.sub=y.subtract,y.multiply=function(t){if(this.isZero())return this;if(isLong(t)||(t=fromValue(t)),e)return fromBits(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return this.unsigned?f:h;if(this.eq(m))return t.isOdd()?m:h;if(t.eq(m))return this.isOdd()?m:h;if(this.isNegative())if(t.isNegative())return this.neg().mul(t.neg());else return this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(a)&&t.lt(a))return fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var i,r,n=this.high>>>16,o=65535&this.high,s=this.low>>>16,u=65535&this.low,p=t.high>>>16,l=65535&t.high,c=t.low>>>16,g=65535&t.low,d=0,y=0;return i=0+((r=0+u*g)>>>16),r&=65535,i+=s*g,y+=i>>>16,i&=65535,i+=u*c,y+=i>>>16,i&=65535,y+=o*g,d+=y>>>16,y&=65535,y+=s*c,d+=y>>>16,y&=65535,y+=u*l,d+=y>>>16,y&=65535,d+=n*g+o*c+s*l+u*p,fromBits(i<<16|r,(d&=65535)<<16|y,this.unsigned)},y.mul=y.multiply,y.divide=function(t){if(isLong(t)||(t=fromValue(t)),t.isZero())throw Error("division by zero");if(e){var i,r,o;return this.unsigned||-0x80000000!==this.high||-1!==t.low||-1!==t.high?fromBits((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this}if(this.isZero())return this.unsigned?f:h;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return f;if(t.gt(this.shru(1)))return l;o=f}else{if(this.eq(m))if(t.eq(p)||t.eq(c))return m;else return t.eq(m)?p:(i=this.shr(1).div(t).shl(1)).eq(h)?t.isNegative()?p:c:(r=this.sub(t.mul(i)),o=i.add(r.div(t)));if(t.eq(m))return this.unsigned?f:h;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=h}for(r=this;r.gte(t);){for(var s=Math.ceil(Math.log(i=Math.max(1,Math.floor(r.toNumber()/t.toNumber())))/Math.LN2),u=s<=48?1:n(2,s-48),a=fromNumber(i),g=a.mul(t);g.isNegative()||g.gt(r);)i-=u,g=(a=fromNumber(i,this.unsigned)).mul(t);a.isZero()&&(a=p),o=o.add(a),r=r.sub(g)}return o},y.div=y.divide,y.modulo=function(t){return(isLong(t)||(t=fromValue(t)),e)?fromBits((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},y.mod=y.modulo,y.rem=y.modulo,y.not=function(){return fromBits(~this.low,~this.high,this.unsigned)},y.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},y.clz=y.countLeadingZeros,y.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32},y.ctz=y.countTrailingZeros,y.and=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low&t.low,this.high&t.high,this.unsigned)},y.or=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low|t.low,this.high|t.high,this.unsigned)},y.xor=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low^t.low,this.high^t.high,this.unsigned)},y.shiftLeft=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):fromBits(0,this.low<<t-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):32===t?fromBits(this.high,0,this.unsigned):fromBits(this.high>>>t-32,0,this.unsigned)},y.shru=y.shiftRightUnsigned,y.shr_u=y.shiftRightUnsigned,y.rotateLeft=function(t){var e;return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:32===t?fromBits(this.high,this.low,this.unsigned):t<32?(e=32-t,fromBits(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)):(t-=32,e=32-t,fromBits(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned))},y.rotl=y.rotateLeft,y.rotateRight=function(t){var e;return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:32===t?fromBits(this.high,this.low,this.unsigned):t<32?(e=32-t,fromBits(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned)):(t-=32,e=32-t,fromBits(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned))},y.rotr=y.rotateRight,y.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)},y.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},y.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},Long.fromBytes=function(t,e,i){return i?Long.fromBytesLE(t,e):Long.fromBytesBE(t,e)},Long.fromBytesLE=function(t,e){return new Long(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},Long.fromBytesBE=function(t,e){return new Long(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)},"function"==typeof BigInt&&(Long.fromBigInt=function(t,e){return fromBits(Number(BigInt.asIntN(32,t)),Number(BigInt.asIntN(32,t>>BigInt(32))),e)},Long.fromValue=function(t,e){return"bigint"==typeof t?Long.fromBigInt(t,e):fromValue(t,e)},y.toBigInt=function(){var t=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|t}),t.default=Long})},"./protobufjs/minimal.js"(t,e,i){"use strict";t.exports=i("./protobufjs/src/index-minimal.js")},"./protobufjs/src/index-minimal.js"(t,e,i){"use strict";function configure(){e.util.LongBits._configure(e.util.Long),e.Writer._configure(e.BufferWriter),e.Reader._configure(e.BufferReader)}e.build="minimal",e.Writer=i("./protobufjs/src/writer.js"),e.BufferWriter=i("./protobufjs/src/writer_buffer.js"),e.Reader=i("./protobufjs/src/reader.js"),e.BufferReader=i("./protobufjs/src/reader_buffer.js"),e.util=i("./protobufjs/src/util/minimal.js"),e.rpc=i("./protobufjs/src/rpc.js"),e.roots=i("./protobufjs/src/roots.js"),e.configure=configure,configure()},"./protobufjs/src/reader.js"(t,e,i){"use strict";t.exports=Reader;var r,n=i("./protobufjs/src/util/minimal.js"),o=n.LongBits,s=n.utf8;function indexOutOfRange(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Reader(t){this.buf=t,this.pos=0,this.len=t.length,this.view=null,this.discardUnknown=Reader.discardUnknown}function create_array(t){if(Array.isArray(t)&&(t=new Uint8Array(t)),t instanceof Uint8Array)return new Reader(t);throw Error("illegal buffer")}var create=function(){return n.Buffer?function(t){return(Reader.create=function(t){return n.Buffer.isBuffer(t)?new r(t):create_array(t)})(t)}:create_array};function readLongVarint(){var t=new o(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<4&&!(this.pos>=this.len);++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;throw indexOutOfRange(this)}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw indexOutOfRange(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function readFixed32_end(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new o(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}function getLazyView(t,e,i){var r=t.view;if(r||e<i)return r;var n=t.buf;return t.view=new DataView(n.buffer,n.byteOffset,n.byteLength)}Reader.create=create(),Reader.prototype.raw=function(t,e){return this.buf.subarray(t,e)},Reader.prototype.uint32=function(){var t=this.buf,e=this.pos,i=(127&t[e])>>>0;if(t[e++]<128||(i=(i|(127&t[e])<<7)>>>0,t[e++]<128)||(i=(i|(127&t[e])<<14)>>>0,t[e++]<128)||(i=(i|(127&t[e])<<21)>>>0,t[e++]<128)||(i=(i|(15&t[e])<<28)>>>0,t[e++]<128))return this.pos=e,i;for(var r=0;r<5;++r){if(e>=this.len)throw this.pos=e,indexOutOfRange(this);if(t[e++]<128)return this.pos=e,i}throw this.pos=e,Error("invalid varint encoding")},Reader.prototype.tag=function(){var t=this.buf,e=this.pos,i=(127&t[e])>>>0;if(t[e++]<128||(i=(i|(127&t[e])<<7)>>>0,t[e++]<128)||(i=(i|(127&t[e])<<14)>>>0,t[e++]<128)||(i=(i|(127&t[e])<<21)>>>0,t[e++]<128))return this.pos=e,i;if(i=(i|(15&t[e])<<28)>>>0,t[e]<128&&(112&t[e])==0)return this.pos=e+1,i;throw this.pos=e+1,Error("invalid tag encoding")},Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)},Reader.prototype.bool=function(){for(var t,e=!1,i=0;i<10;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(127&(t=this.buf[this.pos++])&&(e=!0),t<128)return e}throw Error("invalid varint encoding")},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},Reader.prototype.uint32s=function(t){void 0===t&&(t=[]);for(var e,i=this.uint32()+this.pos,r=this.buf,n=this.pos;n<i;)(e=r[n++])<128?t.push(e):(this.pos=n-1,t.push(this.uint32()),n=this.pos);return this.pos=n,t},Reader.prototype.int32s=function(t){void 0===t&&(t=[]);for(var e,i=this.uint32()+this.pos,r=this.buf,n=this.pos;n<i;)(e=r[n++])<128?t.push(e):(this.pos=n-1,t.push(this.int32()),n=this.pos);return this.pos=n,t},Reader.prototype.sint32s=function(t){void 0===t&&(t=[]);for(var e=this.uint32()+this.pos;this.pos<e;)t.push(this.sint32());return t},Reader.prototype.bools=function(t){void 0===t&&(t=[]);for(var e,i=this.uint32()+this.pos,r=this.buf,n=this.pos;n<i;)(e=r[n++])<128?t.push(0!==e):(this.pos=n-1,t.push(this.bool()),n=this.pos);return this.pos=n,t},Reader.prototype.fixed32s=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e;if(i>this.len)throw indexOutOfRange(this,e);var r=e>>>2,n=t.length,o=this.pos;t.length=n+r;var s=getLazyView(this,r,128);if(s)for(var u=0;u<r;++u,o+=4)t[n++]=s.getUint32(o,!0);else for(var a=this.buf,h=0;h<r;++h,o+=4)t[n++]=readFixed32_end(a,o+4);if(this.pos=o,o!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.sfixed32s=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e;if(i>this.len)throw indexOutOfRange(this,e);var r=e>>>2,n=t.length,o=this.pos;t.length=n+r;var s=getLazyView(this,r,128);if(s)for(var u=0;u<r;++u,o+=4)t[n++]=s.getInt32(o,!0);else for(var a=this.buf,h=0;h<r;++h,o+=4)t[n++]=0|readFixed32_end(a,o+4);if(this.pos=o,o!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.floats=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e;if(i>this.len)throw indexOutOfRange(this,e);var r=e>>>2,o=t.length,s=this.pos;t.length=o+r;var u=getLazyView(this,r,8);if(u)for(var a=0;a<r;++a,s+=4)t[o++]=u.getFloat32(s,!0);else for(var h=this.buf,f=0;f<r;++f,s+=4)t[o++]=n.float.readFloatLE(h,s);if(this.pos=s,s!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.doubles=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e;if(i>this.len)throw indexOutOfRange(this,e);var r=e>>>3,o=t.length,s=this.pos;t.length=o+r;var u=getLazyView(this,r,8);if(u)for(var a=0;a<r;++a,s+=8)t[o++]=u.getFloat64(s,!0);else for(var h=this.buf,f=0;f<r;++f,s+=8)t[o++]=n.float.readDoubleLE(h,s);if(this.pos=s,s!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.uint64s=function(t){void 0===t&&(t=[]);for(var e=this.uint32()+this.pos;this.pos<e;)t.push(this.uint64());return t},Reader.prototype.int64s=function(t){void 0===t&&(t=[]);for(var e=this.uint32()+this.pos;this.pos<e;)t.push(this.int64());return t},Reader.prototype.sint64s=function(t){void 0===t&&(t=[]);for(var e=this.uint32()+this.pos;this.pos<e;)t.push(this.sint64());return t},Reader.prototype.fixed64s=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e,r=t.length;if(i>this.len)throw indexOutOfRange(this,e);var n=e>>>3;t.length=r+n;for(var o=0;o<n;++o)t[r++]=this.fixed64();if(this.pos!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.sfixed64s=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e,r=t.length;if(i>this.len)throw indexOutOfRange(this,e);var n=e>>>3;t.length=r+n;for(var o=0;o<n;++o)t[r++]=this.sfixed64();if(this.pos!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.bytes=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,this.raw(e,i)},Reader.prototype.string=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,s.read(this.buf,e,i)},Reader.prototype.stringVerify=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,s.readStrict(this.buf,e,i)},Reader.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(128&this.buf[this.pos++]);return this},Reader.recursionLimit=n.recursionLimit,Reader.discardUnknown=!0,Reader.prototype.skipType=function(t,e,i){if(void 0===e&&(e=0),e>Reader.recursionLimit)throw Error("max depth exceeded");if(0===i)throw Error("illegal tag: field number 0");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var r=this.tag(),n=r>>>3;if(t=7&r,!n)throw Error("illegal tag: field number 0");if(4===t){if(void 0!==i&&n!==i)throw Error("invalid end group tag");break}this.skipType(t,e+1,n)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},Reader._configure=function(t){r=t,Reader.create=create(),r._configure();var e=n.Long?"toLong":"toNumber";n.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[e](!1)},uint64:function(){return readLongVarint.call(this)[e](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[e](!1)},fixed64:function(){return readFixed64.call(this)[e](!0)},sfixed64:function(){return readFixed64.call(this)[e](!1)}})}},"./protobufjs/src/reader_buffer.js"(t,e,i){"use strict";t.exports=BufferReader;var r=i("./protobufjs/src/reader.js");BufferReader.prototype=Object.create(r.prototype,{constructor:{value:BufferReader,writable:!0,enumerable:!1,configurable:!0}});var n=i("./protobufjs/src/util/minimal.js");function BufferReader(t){r.call(this,t)}BufferReader._configure=function(){n.Buffer&&(BufferReader.prototype._slice=n.Buffer.prototype.slice)},BufferReader.prototype.raw=function(t,e){return this._slice.call(this.buf,t,e)},BufferReader.prototype.string=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw RangeError("index out of range: "+this.pos+" + "+t+" > "+this.len);return this.pos=i,this.buf.utf8Slice?this.buf.utf8Slice(e,i):this.buf.toString("utf-8",e,i)},BufferReader._configure()},"./protobufjs/src/roots.js"(t){"use strict";t.exports=Object.create(null)},"./protobufjs/src/rpc.js"(t,e,i){"use strict";e.Service=i("./protobufjs/src/rpc/service.js")},"./protobufjs/src/rpc/service.js"(t,e,i){"use strict";t.exports=Service;var r=i("./protobufjs/src/util/minimal.js");function Service(t,e,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!i}Service.prototype=Object.create(r.EventEmitter.prototype,{constructor:{value:Service,writable:!0,enumerable:!1,configurable:!0}}),Service.prototype.rpcCall=function rpcCall(t,e,i,n,o){if(!n)throw TypeError("request must be specified");var s=this;if(!o)return r.asPromise(rpcCall,s,t,e,i,n);if(!s.rpcImpl)return void setTimeout(function(){o(Error("already ended"))},0);try{return s.rpcImpl(t,e[s.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,r){if(e)return s.emit("error",e,t),o(e);if(null===r)return void s.end(!0);if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),o(e)}return s.emit("data",r,t),o(null,r)})}catch(e){s.emit("error",e,t),setTimeout(function(){o(e)},0);return}},Service.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},"./protobufjs/src/util/aspromise.js"(t){"use strict";t.exports=function asPromise(t,e){for(var i=Array(arguments.length-1),r=0,n=2,o=!0;n<arguments.length;)i[r++]=arguments[n++];return new Promise(function(n,s){i[r]=function(t){if(o)if(o=!1,t)s(t);else{for(var e=Array(arguments.length-1),i=0;i<e.length;)e[i++]=arguments[i];n.apply(null,e)}};try{t.apply(e||null,i)}catch(t){o&&(o=!1,s(t))}})}},"./protobufjs/src/util/base64.js"(t,e){"use strict";e.length=function(t){var e=t.length;if(!e)return 0;for(;e>0&&"="===t.charAt(e-1);)--e;return Math.floor(3*e/4)};for(var i=Array(64),r=Array(123),n=0;n<64;)r[i[n]=n<26?n+65:n<52?n+71:n<62?n-4:n-59|43]=n++;r[45]=62,r[95]=63,e.encode=function(t,e,r){for(var n,o=null,s=[],u=0,a=0;e<r;){var h=t[e++];switch(a){case 0:s[u++]=i[h>>2],n=(3&h)<<4,a=1;break;case 1:s[u++]=i[n|h>>4],n=(15&h)<<2,a=2;break;case 2:s[u++]=i[n|h>>6],s[u++]=i[63&h],a=0}u>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),u=0)}return(a&&(s[u++]=i[n],s[u++]=61,1===a&&(s[u++]=61)),o)?(u&&o.push(String.fromCharCode.apply(String,s.slice(0,u))),o.join("")):String.fromCharCode.apply(String,s.slice(0,u))};var o="invalid encoding";e.decode=function(t,e,i){for(var n,s=i,u=0,a=0;a<t.length;){var h=t.charCodeAt(a++);if(61===h&&u>1)break;if(void 0===(h=r[h]))throw Error(o);switch(u){case 0:n=h,u=1;break;case 1:e[i++]=n<<2|(48&h)>>4,n=h,u=2;break;case 2:e[i++]=(15&n)<<4|(60&h)>>2,n=h,u=3;break;case 3:e[i++]=(3&n)<<6|h,u=0}}if(1===u)throw Error(o);return i-s};var s=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,u=/[-_]/,a=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;e.test=function(t){return s.test(t)||u.test(t)&&a.test(t)}},"./protobufjs/src/util/eventemitter.js"(t){"use strict";function EventEmitter(){this._listeners=Object.create(null)}t.exports=EventEmitter,EventEmitter.prototype.on=function(t,e,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:i||this}),this},EventEmitter.prototype.off=function(t,e){if(void 0===t)this._listeners=Object.create(null);else if(void 0===e)this._listeners[t]=[];else{var i=this._listeners[t];if(!i)return this;for(var r=0;r<i.length;)i[r].fn===e?i.splice(r,1):++r}return this},EventEmitter.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var i=[],r=1;r<arguments.length;)i.push(arguments[r++]);for(r=0;r<e.length;)e[r].fn.apply(e[r++].ctx,i)}return this}},"./protobufjs/src/util/float.js"(t){"use strict";function factory(t){if("u">typeof Float32Array)!function(){var e=new Float32Array([-0]),i=new Uint8Array(e.buffer),r=128===i[3];function writeFloat_f32_cpy(t,r,n){e[0]=t,r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2],r[n+3]=i[3]}function writeFloat_f32_rev(t,r,n){e[0]=t,r[n]=i[3],r[n+1]=i[2],r[n+2]=i[1],r[n+3]=i[0]}function readFloat_f32_cpy(t,r){return i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],e[0]}function readFloat_f32_rev(t,r){return i[3]=t[r],i[2]=t[r+1],i[1]=t[r+2],i[0]=t[r+3],e[0]}t.writeFloatLE=r?writeFloat_f32_cpy:writeFloat_f32_rev,t.writeFloatBE=r?writeFloat_f32_rev:writeFloat_f32_cpy,t.readFloatLE=r?readFloat_f32_cpy:readFloat_f32_rev,t.readFloatBE=r?readFloat_f32_rev:readFloat_f32_cpy}();else{function writeFloat_ieee754(t,e,i,r){var n=+(e<0);if(n&&(e=-e),0===e)t(1/e>0?0:0x80000000,i,r);else if(isNaN(e))t(0x7fc00000,i,r);else if(e>34028234663852886e22)t((n<<31|0x7f800000)>>>0,i,r);else if(e<11754943508222875e-54)t((n<<31|Math.round(e/1401298464324817e-60))>>>0,i,r);else{var o=Math.floor(Math.log(e)/Math.LN2),s=8388607&Math.round(e*Math.pow(2,-o)*8388608);t((n<<31|o+127<<23|s)>>>0,i,r)}}function readFloat_ieee754(t,e,i){var r=t(e,i),n=(r>>31)*2+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:1/0*n:0===o?1401298464324817e-60*n*s:n*Math.pow(2,o-150)*(s+8388608)}t.writeFloatLE=writeFloat_ieee754.bind(null,writeUintLE),t.writeFloatBE=writeFloat_ieee754.bind(null,writeUintBE),t.readFloatLE=readFloat_ieee754.bind(null,readUintLE),t.readFloatBE=readFloat_ieee754.bind(null,readUintBE)}if("u">typeof Float64Array)!function(){var e=new Float64Array([-0]),i=new Uint8Array(e.buffer),r=128===i[7];function writeDouble_f64_cpy(t,r,n){e[0]=t,r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2],r[n+3]=i[3],r[n+4]=i[4],r[n+5]=i[5],r[n+6]=i[6],r[n+7]=i[7]}function writeDouble_f64_rev(t,r,n){e[0]=t,r[n]=i[7],r[n+1]=i[6],r[n+2]=i[5],r[n+3]=i[4],r[n+4]=i[3],r[n+5]=i[2],r[n+6]=i[1],r[n+7]=i[0]}function readDouble_f64_cpy(t,r){return i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],e[0]}function readDouble_f64_rev(t,r){return i[7]=t[r],i[6]=t[r+1],i[5]=t[r+2],i[4]=t[r+3],i[3]=t[r+4],i[2]=t[r+5],i[1]=t[r+6],i[0]=t[r+7],e[0]}t.writeDoubleLE=r?writeDouble_f64_cpy:writeDouble_f64_rev,t.writeDoubleBE=r?writeDouble_f64_rev:writeDouble_f64_cpy,t.readDoubleLE=r?readDouble_f64_cpy:readDouble_f64_rev,t.readDoubleBE=r?readDouble_f64_rev:readDouble_f64_cpy}();else{function writeDouble_ieee754(t,e,i,r,n,o){var s,u=+(r<0);if(u&&(r=-r),0===r)t(0,n,o+e),t(1/r>0?0:0x80000000,n,o+i);else if(isNaN(r))t(0,n,o+e),t(0x7ff80000,n,o+i);else if(r>17976931348623157e292)t(0,n,o+e),t((u<<31|0x7ff00000)>>>0,n,o+i);else if(r<22250738585072014e-324)t((s=r/5e-324)>>>0,n,o+e),t((u<<31|s/0x100000000)>>>0,n,o+i);else{var a=Math.floor(Math.log(r)/Math.LN2);1024===a&&(a=1023),t(0x10000000000000*(s=r*Math.pow(2,-a))>>>0,n,o+e),t((u<<31|a+1023<<20|1048576*s&1048575)>>>0,n,o+i)}}function readDouble_ieee754(t,e,i,r,n){var o=t(r,n+e),s=t(r,n+i),u=(s>>31)*2+1,a=s>>>20&2047,h=0x100000000*(1048575&s)+o;return 2047===a?h?NaN:1/0*u:0===a?5e-324*u*h:u*Math.pow(2,a-1075)*(h+0x10000000000000)}t.writeDoubleLE=writeDouble_ieee754.bind(null,writeUintLE,0,4),t.writeDoubleBE=writeDouble_ieee754.bind(null,writeUintBE,4,0),t.readDoubleLE=readDouble_ieee754.bind(null,readUintLE,0,4),t.readDoubleBE=readDouble_ieee754.bind(null,readUintBE,4,0)}return t}function writeUintLE(t,e,i){e[i]=255&t,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}function writeUintBE(t,e,i){e[i]=t>>>24,e[i+1]=t>>>16&255,e[i+2]=t>>>8&255,e[i+3]=255&t}function readUintLE(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function readUintBE(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=factory(factory)},"./protobufjs/src/util/longbits.js"(t){"use strict";function LongBits(t,e){this.lo=t>>>0,this.hi=e>>>0}t.exports=LongBits;var e,i=LongBits.zero=new LongBits(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var r=LongBits.zeroHash="\0\0\0\0\0\0\0\0";LongBits.fromNumber=function(t){if(0===t)return i;var e=t<0;e&&(t=-t);var r=t>>>0,n=(t-r)/0x100000000>>>0;return e&&(n=~n>>>0,r=~r>>>0,++r>0xffffffff&&(r=0,++n>0xffffffff&&(n=0))),new LongBits(r,n)},LongBits.from=function(t){if("number"==typeof t)return LongBits.fromNumber(t);if("string"==typeof t||t instanceof String)if(!e)return LongBits.fromNumber(parseInt(t,10));else t=e.fromString(t);return t.low||t.high?new LongBits(t.low>>>0,t.high>>>0):i},LongBits.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=~this.lo+1>>>0,i=~this.hi>>>0;return e||(i=i+1>>>0),-(e+0x100000000*i)}return this.lo+0x100000000*this.hi},LongBits.prototype.toLong=function(t){return e?new e(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var n=String.prototype.charCodeAt;LongBits.fromHash=function(t){return t===r?i:new LongBits((n.call(t,0)|n.call(t,1)<<8|n.call(t,2)<<16|n.call(t,3)<<24)>>>0,(n.call(t,4)|n.call(t,5)<<8|n.call(t,6)<<16|n.call(t,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},LongBits.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},LongBits.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:i<128?9:10},LongBits._configure=function(t){e=t}},"./protobufjs/src/util/minimal.js"(t,e,i){"use strict";function isUnsafeProperty(t){return"__proto__"===t||"prototype"===t||"constructor"===t}function merge(t){var e="boolean"==typeof arguments[arguments.length-1],i=e?arguments.length-1:arguments.length;e=e&&arguments[arguments.length-1];for(var r=1;r<i;++r){var n=arguments[r];if(n)for(var o=Object.keys(n),s=0;s<o.length;++s)isUnsafeProperty(o[s])||e&&Object.prototype.hasOwnProperty.call(t,o[s])&&void 0!==t[o[s]]||(t[o[s]]=n[o[s]])}return t}function newError(t){function CustomError(t,e){if(!(this instanceof CustomError))return new CustomError(t,e);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,CustomError):Object.defineProperty(this,"stack",{value:Error().stack||""}),e&&merge(this,e)}return CustomError.prototype=Object.create(Error.prototype,{constructor:{value:CustomError,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),CustomError}e.asPromise=i("./protobufjs/src/util/aspromise.js"),e.base64=i("./protobufjs/src/util/base64.js"),e.EventEmitter=i("./protobufjs/src/util/eventemitter.js"),e.float=i("./protobufjs/src/util/float.js"),e.utf8=i("./protobufjs/src/util/utf8.js"),e.pool=i("./protobufjs/src/util/pool.js"),e.LongBits=i("./protobufjs/src/util/longbits.js"),e.isUnsafeProperty=isUnsafeProperty,e.isNode=!!("u">typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),e.global=e.isNode&&global||"u">typeof window&&window||"u">typeof self&&self||"u">typeof globalThis&&globalThis||this,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},e.isString=function(t){return"string"==typeof t||t instanceof String},e.isObject=function(t){return t&&"object"==typeof t},e.isset=e.isSet=function(t,e){var i=t[e];return!!(null!=i&&Object.hasOwnProperty.call(t,e))&&("object"!=typeof i||(Array.isArray(i)?i.length:Object.keys(i).length)>0)},e.Buffer=function(){try{var t=e.global.Buffer;return t.prototype.utf8Write||e.isNode?t:null}catch(t){return null}}(),e.newBuffer=function(t){var i=e.Buffer;return"number"==typeof t?i?i.allocUnsafe(t):new Uint8Array(t):i?i.from(t):new Uint8Array(t)},e.rawField=function(t,i,r){var n=[],o=t<<3|i;for(o>>>=0;o>127;)n.push(127&o|128),o>>>=7;n.push(o);for(var s=0;s<r.length;++s)n.push(r[s]);return e.newBuffer(n)},e.Array=Uint8Array,e.Long=e.global.dcodeIO&&e.global.dcodeIO.Long||e.global.Long||function(){try{var t=i("./long/umd/index.js");return t&&t.isLong?t:null}catch(t){return null}}(),e.key2Re=/^(?:true|false|0|1)$/,e.key32Re=/^-?(?:0|[1-9][0-9]*)$/,e.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,e.longToHash=function(t){return t?e.LongBits.from(t).toHash():e.LongBits.zeroHash},e.longFromHash=function(t,i){var r=e.LongBits.fromHash(t);return e.Long?e.Long.fromBits(r.lo,r.hi,i):r.toNumber(!!i)},e.longFromKey=function(t,i){return e.key64Re.test(t)&&!e.key32Re.test(t)?e.longFromHash(t,i):t},e.boolFromKey=function(t){return"true"===t||"1"===t},e.merge=merge,e.nestingLimit=32,e.recursionLimit=100,e.makeProp=function(t,e,i){Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:void 0===i||i,configurable:!0,writable:!0})},e.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},e.newError=newError,e.ProtocolError=newError("ProtocolError"),e.oneOfGetter=function(t){for(var e={},i=0;i<t.length;++i)e[t[i]]=1;return function(){for(var t=Object.keys(this),i=t.length-1;i>-1;--i)if(1===e[t[i]]&&void 0!==this[t[i]]&&null!==this[t[i]])return t[i]}},e.oneOfSetter=function(t){return function(e){for(var i=0;i<t.length;++i)t[i]!==e&&delete this[t[i]]}},e.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},"./protobufjs/src/util/pool.js"(t){"use strict";t.exports=function pool(t,e,i){var r=i||8192,n=r>>>1,o=null,s=r;return function(i){if(i<1||i>n)return t(i);s+i>r&&(o=t(r),s=0);var u=e.call(o,s,s+=i);return 7&s&&(s=(7|s)+1),u}}},"./protobufjs/src/util/utf8.js"(t,e){"use strict";var i,r=new TextDecoder("utf-8",{ignoreBOM:!0});try{i=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch(t){i=r}function utf8_read_decoder(t,e,i,r){var n=0===i&&r===e.length?e:e.subarray(i,r);return t.decode(n)}e.length=function(t){for(var e=0,i=0,r=0;r<t.length;++r)(i=t.charCodeAt(r))<128?e+=1:i<2048?e+=2:(64512&i)==55296&&(64512&t.charCodeAt(r+1))==56320?(++r,e+=4):e+=3;return e},e.read=function(t,e,i){if(i-e<1)return"";if(i-e>=64)return utf8_read_decoder(r,t,e,i);for(var n,o,s,u,a,h,f,p,l="",c=e;c+7<i;c+=8){if(n=t[c],o=t[c+1],s=t[c+2],u=t[c+3],a=t[c+4],h=t[c+5],(n|o|s|u|a|h|(f=t[c+6])|(p=t[c+7]))&128)return l+utf8_read_decoder(r,t,c,i);l+=String.fromCharCode(n,o,s,u,a,h,f,p)}for(;c<i;++c){if(128&(n=t[c]))return l+utf8_read_decoder(r,t,c,i);l+=String.fromCharCode(n)}return l},e.readStrict=function(t,e,r){if(r-e<1)return"";if(r-e>=64)return utf8_read_decoder(i,t,e,r);for(var n,o,s,u,a,h,f,p,l="",c=e;c+7<r;c+=8){if(n=t[c],o=t[c+1],s=t[c+2],u=t[c+3],a=t[c+4],h=t[c+5],(n|o|s|u|a|h|(f=t[c+6])|(p=t[c+7]))&128)return l+utf8_read_decoder(i,t,c,r);l+=String.fromCharCode(n,o,s,u,a,h,f,p)}for(;c<r;++c){if(128&(n=t[c]))return l+utf8_read_decoder(i,t,c,r);l+=String.fromCharCode(n)}return l},e.write=function(t,e,i){for(var r,n,o=i,s=0;s<t.length;++s)(r=t.charCodeAt(s))<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:((64512&r)==55296&&(64512&(n=t.charCodeAt(s+1)))==56320?(r=65536+((1023&r)<<10)+(1023&n),++s,e[i++]=r>>18|240,e[i++]=r>>12&63|128):e[i++]=r>>12|224,e[i++]=r>>6&63|128),e[i++]=63&r|128);return i-o}},"./protobufjs/src/writer.js"(t,e,i){"use strict";t.exports=Writer;var r,n=i("./protobufjs/src/util/minimal.js"),o=n.LongBits,s=n.base64,u=n.utf8;function Writer(){this.pos=0,this.buf=this.constructor.alloc(Writer.initialBufferSize),this.view=null,this.states=null}Writer.initialBufferSize=128,Object.defineProperty(Writer.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var create=function(){return n.Buffer?function(){return(Writer.create=function(){return new r})()}:function(){return new Writer}};function sizeVarint32(t){return t<128?1:t<16384?2:t<2097152?3:t<0x10000000?4:5}function writeStringAscii(t,e,i){for(var r=0;r<t.length;)e[i++]=t.charCodeAt(r++)}function writeVarint32(t,e,i){for(;t>127;)e[i++]=127&t|128,t>>>=7;return e[i]=t,i+1}function writeVarint64(t,e,i){for(var r=t.lo,n=t.hi;n;)e[i++]=127&r|128,r=(r>>>7|n<<25)>>>0,n>>>=7;for(;r>127;)e[i++]=127&r|128,r>>>=7;return e[i]=r,i+1}function writeFixed32(t,e,i){e[i]=255&t,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}function getLazyView(t,e,i){var r=t.view;if(r||e<i)return r;var n=t.buf;return t.view=new DataView(n.buffer,n.byteOffset,n.byteLength)}Writer.create=create(),Writer.alloc=function(t){return new Uint8Array(t)},Writer.alloc=n.pool(Writer.alloc,Uint8Array.prototype.subarray),Writer.prototype._reserve=function(t){var e=this.pos+t;if(e>this.buf.length){var i=this.buf.length<<1;i<e&&(i=e);var r=this.constructor.alloc(i);r.set(this.buf.subarray(0,this.pos),0),this.buf=r,this.view=null}},Writer.prototype.uint32=function(t){t>>>=0,this._reserve(5);var e=this.pos;return this.pos=writeVarint32(t,this.buf,e),this},Writer.prototype.int32=function(t){return(t|=0)<0?(this._reserve(10),writeVarint64(o.fromNumber(t),this.buf,this.pos),this.pos+=10,this):this.uint32(t)},Writer.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},Writer.prototype.uint64=function(t){var e=o.from(t);this._reserve(10);var i=this.pos;return this.pos=writeVarint64(e,this.buf,i),this},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(t){var e=o.from(t).zzEncode();this._reserve(10);var i=this.pos;return this.pos=writeVarint64(e,this.buf,i),this},Writer.prototype.bool=function(t){return this._reserve(1),this.buf[this.pos++]=+!!t,this},Writer.prototype.fixed32=function(t){return this._reserve(4),writeFixed32(t>>>0,this.buf,this.pos),this.pos+=4,this},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(t){var e=o.from(t);return this._reserve(8),writeFixed32(e.lo,this.buf,this.pos),writeFixed32(e.hi,this.buf,this.pos+4),this.pos+=8,this},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(t){return this._reserve(4),n.float.writeFloatLE(t,this.buf,this.pos),this.pos+=4,this},Writer.prototype.double=function(t){return this._reserve(8),n.float.writeDoubleLE(t,this.buf,this.pos),this.pos+=8,this},Writer.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._reserve(1),this.buf[this.pos++]=0,this;if(n.isString(t)){var i=Writer.alloc(e=s.length(t));s.decode(t,i,0),t=i}return this.uint32(e),this._reserve(e),this.buf.set(t,this.pos),this.pos+=e,this},Writer.prototype.raw=function(t){var e=t.length>>>0;return e&&(this._reserve(e),this.buf.set(t,this.pos),this.pos+=e),this},Writer.prototype._delim=function(t,e){var i=sizeVarint32(e);return i>1&&this.buf.copyWithin(t+i,t+1,t+1+e),writeVarint32(e,this.buf,t),this.pos=t+i+e,this},Writer.prototype.string=function(t){var e=t.length;if(!e)return this._reserve(1),this.buf[this.pos++]=0,this;if(e<128){this._reserve(3*e+5);var i=this.pos;return this._delim(i,u.write(t,this.buf,i+1))}var r=u.length(t);return this.uint32(r),this._reserve(r),r===t.length?writeStringAscii(t,this.buf,this.pos):u.write(t,this.buf,this.pos),this.pos+=r,this},Writer.prototype.uint32s=function(t){var e=t.length;this._reserve(5*e+5);for(var i=this.buf,r=this.pos,n=r+1,o=0;o<e;++o)n=writeVarint32(t[o]>>>0,i,n);return this._delim(r,n-r-1)},Writer.prototype.int32s=function(t){var e=t.length;this._reserve(10*e+5);for(var i,r=this.buf,n=this.pos,s=n+1,u=0;u<e;++u)s=(i=0|t[u])<0?writeVarint64(o.fromNumber(i),r,s):writeVarint32(i,r,s);return this._delim(n,s-n-1)},Writer.prototype.sint32s=function(t){var e=t.length;this._reserve(5*e+5);for(var i=this.buf,r=this.pos,n=r+1,o=0;o<e;++o)n=writeVarint32((t[o]<<1^t[o]>>31)>>>0,i,n);return this._delim(r,n-r-1)},Writer.prototype.uint64s=function(t){var e=t.length;this._reserve(10*e+5);for(var i=this.buf,r=this.pos,n=r+1,s=0;s<e;++s)n=writeVarint64(o.from(t[s]),i,n);return this._delim(r,n-r-1)},Writer.prototype.int64s=Writer.prototype.uint64s,Writer.prototype.sint64s=function(t){var e=t.length;this._reserve(10*e+5);for(var i=this.buf,r=this.pos,n=r+1,s=0;s<e;++s)n=writeVarint64(o.from(t[s]).zzEncode(),i,n);return this._delim(r,n-r-1)},Writer.prototype.bools=function(t){var e=t.length;this.uint32(e),this._reserve(e);for(var i=this.buf,r=this.pos,n=0;n<e;++n)i[r++]=+!!t[n];return this.pos+=e,this},Writer.prototype.fixed32s=function(t){var e=t.length,i=4*e;this.uint32(i),this._reserve(i);var r,n=this.pos,o=getLazyView(this,e,128);if(o)for(r=0;r<e;++r)o.setUint32(n,t[r]>>>0,!0),n+=4;else{var s=this.buf;for(r=0;r<e;++r)writeFixed32(t[r]>>>0,s,n),n+=4}return this.pos+=i,this},Writer.prototype.sfixed32s=Writer.prototype.fixed32s,Writer.prototype.fixed64s=function(t){var e=t.length,i=8*e;this.uint32(i),this._reserve(i);var r,n,s=this.pos,u=getLazyView(this,e,128);if(u)for(r=0;r<e;++r)n=o.from(t[r]),u.setUint32(s,n.lo,!0),u.setUint32(s+4,n.hi,!0),s+=8;else{var a=this.buf;for(r=0;r<e;++r)writeFixed32((n=o.from(t[r])).lo,a,s),writeFixed32(n.hi,a,s+4),s+=8}return this.pos+=i,this},Writer.prototype.sfixed64s=Writer.prototype.fixed64s,Writer.prototype.floats=function(t){var e=t.length,i=4*e;this.uint32(i),this._reserve(i);var r,o=this.pos,s=getLazyView(this,e,16);if(s)for(r=0;r<e;++r)s.setFloat32(o,t[r],!0),o+=4;else{var u=this.buf;for(r=0;r<e;++r)n.float.writeFloatLE(t[r],u,o),o+=4}return this.pos+=i,this},Writer.prototype.doubles=function(t){var e=t.length,i=8*e;this.uint32(i),this._reserve(i);var r,o=this.pos,s=getLazyView(this,e,16);if(s)for(r=0;r<e;++r)s.setFloat64(o,t[r],!0),o+=8;else{var u=this.buf;for(r=0;r<e;++r)n.float.writeDoubleLE(t[r],u,o),o+=8}return this.pos+=i,this},Writer.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},Writer.prototype.reset=function(){var t=this.states;return t&&t.length?this.pos=t.pop():this.pos=0,this},Writer.prototype.ldelim=function(){var t,e,i=this.states;if(i&&i.length){var r=i.pop();(e=sizeVarint32(t=this.pos-r-1))>1?(this._reserve(e-1),this.buf.copyWithin(r+e,r+1,r+1+t),this.pos+=e-1,writeVarint32(t,this.buf,r)):this.buf[r]=t}else e=sizeVarint32(t=this.pos),this._reserve(e),this.buf.copyWithin(e,0,t),writeVarint32(t,this.buf,0),this.pos+=e;return this},Writer.prototype.finish=function(t){if(t)return this.buf.subarray(0,this.pos);var e=this.constructor.alloc(this.pos);return e.set(this.buf.subarray(0,this.pos),0),e},Writer.prototype.finishInto=function(t,e){return void 0===e&&(e=0),t.set(this.buf.subarray(0,this.pos),e),t},Writer._configure=function(t){r=t,Writer.create=create(),r._configure()}},"./protobufjs/src/writer_buffer.js"(t,e,i){"use strict";t.exports=BufferWriter;var r,n=i("./protobufjs/src/writer.js");BufferWriter.prototype=Object.create(n.prototype,{constructor:{value:BufferWriter,writable:!0,enumerable:!1,configurable:!0}});var o=i("./protobufjs/src/util/minimal.js");function BufferWriter(){n.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=o.Buffer&&o.Buffer.allocUnsafe,r=o.Buffer&&o.Buffer.prototype.utf8Write?function(t,e,i){return e.utf8Write(t,i)}:function(t,e,i){return e.write(t,i)}},BufferWriter.prototype.bytes=function(t){o.isString(t)&&(t=o.Buffer.from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&(this._reserve(e),this.buf.set(t,this.pos),this.pos+=e),this},BufferWriter.prototype.string=function(t){var e=t.length;if(!e)return this._reserve(1),this.buf[this.pos++]=0,this;if(e<128){this._reserve(3*e+5);var i=this.pos,n=this.buf;return this._delim(i,e<40?o.utf8.write(t,n,i+1):r(t,n,i+1))}var s=o.Buffer.byteLength(t);return this.uint32(s),this._reserve(s),r(t,this.buf,this.pos),this.pos+=s,this},BufferWriter._configure()}},e={};function __webpack_require__(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={exports:{}};return t[i].call(n.exports,n,n.exports,__webpack_require__),n.exports}var i=__webpack_require__("./@datadog/sketches-js/dist/index.js");module.exports=i})();
1
+ (()=>{var t={"./@datadog/sketches-js/dist/ddsketch/DDSketch.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.LogCollapsingHighestDenseDDSketch=e.LogCollapsingLowestDenseDDSketch=e.DDSketch=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/store/index.js"),s=i("./@datadog/sketches-js/dist/ddsketch/mapping/index.js"),u=function(){function BaseDDSketch(t){var e=t.mapping,i=t.store,r=t.negativeStore,n=t.zeroCount;this.mapping=e,this.store=i,this.negativeStore=r,this.zeroCount=n,this.count=this.negativeStore.count+this.zeroCount+this.store.count,this.min=1/0,this.max=-1/0,this.sum=0}return BaseDDSketch.prototype.accept=function(t,e){if(void 0===e&&(e=1),e<=0)throw Error("Weight must be a positive number");if(t>this.mapping.minPossible){var i=this.mapping.key(t);this.store.add(i,e)}else if(t<-this.mapping.minPossible){var i=this.mapping.key(-t);this.negativeStore.add(i,e)}else this.zeroCount+=e;this.count+=e,this.sum+=t*e,t<this.min&&(this.min=t),t>this.max&&(this.max=t)},BaseDDSketch.prototype.getValueAtQuantile=function(t){if(t<0||t>1||0===this.count)return NaN;var e=t*(this.count-1),i=0;if(e<this.negativeStore.count){var r=this.negativeStore.count-e-1,n=this.negativeStore.keyAtRank(r,!1);i=-this.mapping.value(n)}else{if(e<this.zeroCount+this.negativeStore.count)return 0;var n=this.store.keyAtRank(e-this.zeroCount-this.negativeStore.count);i=this.mapping.value(n)}return i},BaseDDSketch.prototype.merge=function(t){if(!this.mergeable(t))throw Error("Cannot merge two DDSketches with different `relativeAccuracy` parameters");if(0!==t.count){if(0===this.count)return void this._copy(t);this.store.merge(t.store),this.zeroCount+=t.zeroCount,this.count+=t.count,this.sum+=t.sum,t.min<this.min&&(this.min=t.min),t.max>this.max&&(this.max=t.max)}},BaseDDSketch.prototype.mergeable=function(t){return this.mapping.gamma===t.mapping.gamma},BaseDDSketch.prototype._copy=function(t){this.store.copy(t.store),this.negativeStore.copy(t.negativeStore),this.zeroCount=t.zeroCount,this.min=t.min,this.max=t.max,this.count=t.count,this.sum=t.sum},BaseDDSketch.prototype.toProto=function(){var t=i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").DDSketch,e=t.create({mapping:this.mapping.toProto(),positiveValues:this.store.toProto(),negativeValues:this.negativeStore.toProto(),zeroCount:this.zeroCount});return t.encode(e).finish()},BaseDDSketch.fromProto=function(t){var e=i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").DDSketch.decode(t);return new BaseDDSketch({mapping:s.KeyMapping.fromProto(e.mapping),store:o.DenseStore.fromProto(e.positiveValues),negativeStore:o.DenseStore.fromProto(e.negativeValues),zeroCount:e.zeroCount})},BaseDDSketch}(),a={relativeAccuracy:.01};e.DDSketch=function(t){function DDSketch(e){var i=(void 0===e?a:e).relativeAccuracy,r=new s.LogarithmicMapping(void 0===i?.01:i),n=new o.DenseStore,u=new o.DenseStore;return t.call(this,{mapping:r,store:n,negativeStore:u,zeroCount:0})||this}return n(DDSketch,t),DDSketch}(u),e.LogCollapsingLowestDenseDDSketch=function(t){function LogCollapsingLowestDenseDDSketch(e){var i=void 0===e?a:e,r=i.relativeAccuracy,n=i.binLimit,u=void 0===n?2048:n,h=new s.LogarithmicMapping(void 0===r?.01:r),f=new o.CollapsingLowestDenseStore(u),p=new o.CollapsingLowestDenseStore(u);return t.call(this,{mapping:h,store:f,negativeStore:p,zeroCount:0})||this}return n(LogCollapsingLowestDenseDDSketch,t),LogCollapsingLowestDenseDDSketch}(u),e.LogCollapsingHighestDenseDDSketch=function(t){function LogCollapsingHighestDenseDDSketch(e){var i=void 0===e?a:e,r=i.relativeAccuracy,n=i.binLimit,u=void 0===n?2048:n,h=new s.LogarithmicMapping(void 0===r?.01:r),f=new o.CollapsingHighestDenseStore(u),p=new o.CollapsingHighestDenseStore(u);return t.call(this,{mapping:h,store:f,negativeStore:p,zeroCount:0})||this}return n(LogCollapsingHighestDenseDDSketch,t),LogCollapsingHighestDenseDDSketch}(u)},"./@datadog/sketches-js/dist/ddsketch/index.js"(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i("./@datadog/sketches-js/dist/ddsketch/DDSketch.js"),e)},"./@datadog/sketches-js/dist/ddsketch/mapping/CubicallyInterpolatedMapping.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.CubicallyInterpolatedMapping=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"),s=i("./@datadog/sketches-js/dist/ddsketch/math.js");e.CubicallyInterpolatedMapping=function(t){function CubicallyInterpolatedMapping(e,i){void 0===i&&(i=0);var r=t.call(this,e,i)||this;return r.A=6/35,r.B=-.6,r.C=10/7,r._multiplier/=r.C,r}return n(CubicallyInterpolatedMapping,t),CubicallyInterpolatedMapping.prototype._cubicLog2Approx=function(t){var e=(0,s.frexp)(t),i=e[0],r=e[1],n=2*i-1;return((this.A*n+this.B)*n+this.C)*n+(r-1)},CubicallyInterpolatedMapping.prototype._cubicExp2Approx=function(t){var e=Math.floor(t),i=this.B*this.B-3*this.A*this.C,r=2*this.B*this.B*this.B-9*this.A*this.B*this.C-27*this.A*this.A*(t-e),n=Math.cbrt((r-Math.sqrt(r*r-4*i*i*i))/2),o=-(this.B+n+i/n)/(3*this.A)+1;return(0,s.ldexp)(o/2,e+1)},CubicallyInterpolatedMapping.prototype._logGamma=function(t){return this._cubicLog2Approx(t)*this._multiplier},CubicallyInterpolatedMapping.prototype._powGamma=function(t){return this._cubicExp2Approx(t/this._multiplier)},CubicallyInterpolatedMapping.prototype._protoInterpolation=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.CUBIC},CubicallyInterpolatedMapping}(o.KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.KeyMapping=void 0;var r=i("./@datadog/sketches-js/dist/ddsketch/mapping/index.js"),n=Number.MAX_VALUE;e.KeyMapping=function(){function KeyMapping(t,e){if(void 0===e&&(e=0),t<=0||t>=1)throw Error("Relative accuracy must be between 0 and 1 when initializing a KeyMapping");this.relativeAccuracy=t,this._offset=e;var i=2*t/(1-t);this.gamma=1+i,this._multiplier=1/Math.log1p(i),this.minPossible=11125369292536007e-324*this.gamma,this.maxPossible=n/this.gamma}return KeyMapping.fromGammaOffset=function(t,e){return new this((t-1)/(t+1),e)},KeyMapping.prototype.key=function(t){return Math.ceil(this._logGamma(t))+this._offset},KeyMapping.prototype.value=function(t){return this._powGamma(t-this._offset)*(2/(1+this.gamma))},KeyMapping.prototype.toProto=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.create({gamma:this.gamma,indexOffset:this._offset,interpolation:this._protoInterpolation()})},KeyMapping.fromProto=function(t){if(!t||null==t.gamma||null==t.indexOffset)throw Error("Failed to decode mapping from protobuf");var e=i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation,n=t.interpolation,o=t.gamma,s=t.indexOffset;switch(n){case e.NONE:return r.LogarithmicMapping.fromGammaOffset(o,s);case e.LINEAR:return r.LinearlyInterpolatedMapping.fromGammaOffset(o,s);case e.CUBIC:return r.CubicallyInterpolatedMapping.fromGammaOffset(o,s);default:throw Error("Unrecognized mapping when decoding from protobuf")}},KeyMapping.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},KeyMapping.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},KeyMapping.prototype._protoInterpolation=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.NONE},KeyMapping}()},"./@datadog/sketches-js/dist/ddsketch/mapping/LinearlyInterpolatedMapping.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.LinearlyInterpolatedMapping=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js"),s=i("./@datadog/sketches-js/dist/ddsketch/math.js");e.LinearlyInterpolatedMapping=function(t){function LinearlyInterpolatedMapping(e,i){return void 0===i&&(i=0),t.call(this,e,i)||this}return n(LinearlyInterpolatedMapping,t),LinearlyInterpolatedMapping.prototype._log2Approx=function(t){var e=(0,s.frexp)(t);return 2*e[0]-1+(e[1]-1)},LinearlyInterpolatedMapping.prototype._exp2Approx=function(t){var e=Math.floor(t)+1;return(0,s.ldexp)((t-e+2)/2,e)},LinearlyInterpolatedMapping.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},LinearlyInterpolatedMapping.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},LinearlyInterpolatedMapping.prototype._protoInterpolation=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.LINEAR},LinearlyInterpolatedMapping}(o.KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/LogarithmicMapping.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.LogarithmicMapping=void 0,e.LogarithmicMapping=function(t){function LogarithmicMapping(e,i){void 0===i&&(i=0);var r=t.call(this,e,i)||this;return r._multiplier*=Math.log(2),r}return n(LogarithmicMapping,t),LogarithmicMapping.prototype._logGamma=function(t){return Math.log2(t)*this._multiplier},LogarithmicMapping.prototype._powGamma=function(t){return Math.pow(2,t/this._multiplier)},LogarithmicMapping.prototype._protoInterpolation=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").IndexMapping.Interpolation.NONE},LogarithmicMapping}(i("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js").KeyMapping)},"./@datadog/sketches-js/dist/ddsketch/mapping/index.js"(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CubicallyInterpolatedMapping=e.LinearlyInterpolatedMapping=e.LogarithmicMapping=e.KeyMapping=void 0;var r=i("./@datadog/sketches-js/dist/ddsketch/mapping/KeyMapping.js");Object.defineProperty(e,"KeyMapping",{enumerable:!0,get:function(){return r.KeyMapping}});var n=i("./@datadog/sketches-js/dist/ddsketch/mapping/LogarithmicMapping.js");Object.defineProperty(e,"LogarithmicMapping",{enumerable:!0,get:function(){return n.LogarithmicMapping}});var o=i("./@datadog/sketches-js/dist/ddsketch/mapping/LinearlyInterpolatedMapping.js");Object.defineProperty(e,"LinearlyInterpolatedMapping",{enumerable:!0,get:function(){return o.LinearlyInterpolatedMapping}});var s=i("./@datadog/sketches-js/dist/ddsketch/mapping/CubicallyInterpolatedMapping.js");Object.defineProperty(e,"CubicallyInterpolatedMapping",{enumerable:!0,get:function(){return s.CubicallyInterpolatedMapping}})},"./@datadog/sketches-js/dist/ddsketch/math.js"(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ldexp=e.frexp=void 0,e.frexp=function(t){if(0===t||!Number.isFinite(t))return[t,0];for(var e=Math.abs(t),i=Math.max(-1023,Math.floor(Math.log2(e))+1),r=e*Math.pow(2,-i);r<.5;)r*=2,i--;for(;r>=1;)r*=.5,i++;return t<0&&(r=-r),[r,i]},e.ldexp=function(t,e){for(var i=Math.min(3,Math.ceil(Math.abs(e)/1023)),r=t,n=0;n<i;n++)r*=Math.pow(2,Math.floor((e+n)/i));return r}},"./@datadog/sketches-js/dist/ddsketch/proto/compiled.js"(t,e,i){"use strict";var r=i("./protobufjs/minimal.js"),n=r.Reader,o=r.Writer,s=r.util,u=r.roots.default||(r.roots.default={});u.DDSketch=function(){function DDSketch(t){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return DDSketch.prototype.mapping=null,DDSketch.prototype.positiveValues=null,DDSketch.prototype.negativeValues=null,DDSketch.prototype.zeroCount=0,DDSketch.create=function(t){return new DDSketch(t)},DDSketch.encode=function(t,e){return e||(e=o.create()),null!=t.mapping&&Object.hasOwnProperty.call(t,"mapping")&&u.IndexMapping.encode(t.mapping,e.uint32(10).fork()).ldelim(),null!=t.positiveValues&&Object.hasOwnProperty.call(t,"positiveValues")&&u.Store.encode(t.positiveValues,e.uint32(18).fork()).ldelim(),null!=t.negativeValues&&Object.hasOwnProperty.call(t,"negativeValues")&&u.Store.encode(t.negativeValues,e.uint32(26).fork()).ldelim(),null!=t.zeroCount&&Object.hasOwnProperty.call(t,"zeroCount")&&e.uint32(33).double(t.zeroCount),e},DDSketch.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},DDSketch.decode=function(t,e){t instanceof n||(t=n.create(t));for(var i=void 0===e?t.len:t.pos+e,r=new u.DDSketch;t.pos<i;){var o=t.uint32();switch(o>>>3){case 1:r.mapping=u.IndexMapping.decode(t,t.uint32());break;case 2:r.positiveValues=u.Store.decode(t,t.uint32());break;case 3:r.negativeValues=u.Store.decode(t,t.uint32());break;case 4:r.zeroCount=t.double();break;default:t.skipType(7&o)}}return r},DDSketch.decodeDelimited=function(t){return t instanceof n||(t=new n(t)),this.decode(t,t.uint32())},DDSketch.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.mapping&&t.hasOwnProperty("mapping")){var e=u.IndexMapping.verify(t.mapping);if(e)return"mapping."+e}if(null!=t.positiveValues&&t.hasOwnProperty("positiveValues")){var e=u.Store.verify(t.positiveValues);if(e)return"positiveValues."+e}if(null!=t.negativeValues&&t.hasOwnProperty("negativeValues")){var e=u.Store.verify(t.negativeValues);if(e)return"negativeValues."+e}return null!=t.zeroCount&&t.hasOwnProperty("zeroCount")&&"number"!=typeof t.zeroCount?"zeroCount: number expected":null},DDSketch.fromObject=function(t){if(t instanceof u.DDSketch)return t;var e=new u.DDSketch;if(null!=t.mapping){if("object"!=typeof t.mapping)throw TypeError(".DDSketch.mapping: object expected");e.mapping=u.IndexMapping.fromObject(t.mapping)}if(null!=t.positiveValues){if("object"!=typeof t.positiveValues)throw TypeError(".DDSketch.positiveValues: object expected");e.positiveValues=u.Store.fromObject(t.positiveValues)}if(null!=t.negativeValues){if("object"!=typeof t.negativeValues)throw TypeError(".DDSketch.negativeValues: object expected");e.negativeValues=u.Store.fromObject(t.negativeValues)}return null!=t.zeroCount&&(e.zeroCount=Number(t.zeroCount)),e},DDSketch.toObject=function(t,e){e||(e={});var i={};return e.defaults&&(i.mapping=null,i.positiveValues=null,i.negativeValues=null,i.zeroCount=0),null!=t.mapping&&t.hasOwnProperty("mapping")&&(i.mapping=u.IndexMapping.toObject(t.mapping,e)),null!=t.positiveValues&&t.hasOwnProperty("positiveValues")&&(i.positiveValues=u.Store.toObject(t.positiveValues,e)),null!=t.negativeValues&&t.hasOwnProperty("negativeValues")&&(i.negativeValues=u.Store.toObject(t.negativeValues,e)),null!=t.zeroCount&&t.hasOwnProperty("zeroCount")&&(i.zeroCount=e.json&&!isFinite(t.zeroCount)?String(t.zeroCount):t.zeroCount),i},DDSketch.prototype.toJSON=function(){return this.constructor.toObject(this,r.util.toJSONOptions)},DDSketch}(),u.IndexMapping=function(){var t,e;function IndexMapping(t){if(t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return IndexMapping.prototype.gamma=0,IndexMapping.prototype.indexOffset=0,IndexMapping.prototype.interpolation=0,IndexMapping.create=function(t){return new IndexMapping(t)},IndexMapping.encode=function(t,e){return e||(e=o.create()),null!=t.gamma&&Object.hasOwnProperty.call(t,"gamma")&&e.uint32(9).double(t.gamma),null!=t.indexOffset&&Object.hasOwnProperty.call(t,"indexOffset")&&e.uint32(17).double(t.indexOffset),null!=t.interpolation&&Object.hasOwnProperty.call(t,"interpolation")&&e.uint32(24).int32(t.interpolation),e},IndexMapping.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},IndexMapping.decode=function(t,e){t instanceof n||(t=n.create(t));for(var i=void 0===e?t.len:t.pos+e,r=new u.IndexMapping;t.pos<i;){var o=t.uint32();switch(o>>>3){case 1:r.gamma=t.double();break;case 2:r.indexOffset=t.double();break;case 3:r.interpolation=t.int32();break;default:t.skipType(7&o)}}return r},IndexMapping.decodeDelimited=function(t){return t instanceof n||(t=new n(t)),this.decode(t,t.uint32())},IndexMapping.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.gamma&&t.hasOwnProperty("gamma")&&"number"!=typeof t.gamma)return"gamma: number expected";if(null!=t.indexOffset&&t.hasOwnProperty("indexOffset")&&"number"!=typeof t.indexOffset)return"indexOffset: number expected";if(null!=t.interpolation&&t.hasOwnProperty("interpolation"))switch(t.interpolation){default:return"interpolation: enum value expected";case 0:case 1:case 2:case 3:}return null},IndexMapping.fromObject=function(t){if(t instanceof u.IndexMapping)return t;var e=new u.IndexMapping;switch(null!=t.gamma&&(e.gamma=Number(t.gamma)),null!=t.indexOffset&&(e.indexOffset=Number(t.indexOffset)),t.interpolation){case"NONE":case 0:e.interpolation=0;break;case"LINEAR":case 1:e.interpolation=1;break;case"QUADRATIC":case 2:e.interpolation=2;break;case"CUBIC":case 3:e.interpolation=3}return e},IndexMapping.toObject=function(t,e){e||(e={});var i={};return e.defaults&&(i.gamma=0,i.indexOffset=0,i.interpolation=e.enums===String?"NONE":0),null!=t.gamma&&t.hasOwnProperty("gamma")&&(i.gamma=e.json&&!isFinite(t.gamma)?String(t.gamma):t.gamma),null!=t.indexOffset&&t.hasOwnProperty("indexOffset")&&(i.indexOffset=e.json&&!isFinite(t.indexOffset)?String(t.indexOffset):t.indexOffset),null!=t.interpolation&&t.hasOwnProperty("interpolation")&&(i.interpolation=e.enums===String?u.IndexMapping.Interpolation[t.interpolation]:t.interpolation),i},IndexMapping.prototype.toJSON=function(){return this.constructor.toObject(this,r.util.toJSONOptions)},(e=Object.create(t={}))[t[0]="NONE"]=0,e[t[1]="LINEAR"]=1,e[t[2]="QUADRATIC"]=2,e[t[3]="CUBIC"]=3,IndexMapping.Interpolation=e,IndexMapping}(),u.Store=function(){function Store(t){if(this.binCounts={},this.contiguousBinCounts=[],t)for(var e=Object.keys(t),i=0;i<e.length;++i)null!=t[e[i]]&&(this[e[i]]=t[e[i]])}return Store.prototype.binCounts=s.emptyObject,Store.prototype.contiguousBinCounts=s.emptyArray,Store.prototype.contiguousBinIndexOffset=0,Store.create=function(t){return new Store(t)},Store.encode=function(t,e){if(e||(e=o.create()),null!=t.binCounts&&Object.hasOwnProperty.call(t,"binCounts"))for(var i=Object.keys(t.binCounts),r=0;r<i.length;++r)e.uint32(10).fork().uint32(8).sint32(i[r]).uint32(17).double(t.binCounts[i[r]]).ldelim();if(null!=t.contiguousBinCounts&&t.contiguousBinCounts.length){e.uint32(18).fork();for(var r=0;r<t.contiguousBinCounts.length;++r)e.double(t.contiguousBinCounts[r]);e.ldelim()}return null!=t.contiguousBinIndexOffset&&Object.hasOwnProperty.call(t,"contiguousBinIndexOffset")&&e.uint32(24).sint32(t.contiguousBinIndexOffset),e},Store.encodeDelimited=function(t,e){return this.encode(t,e).ldelim()},Store.decode=function(t,e){t instanceof n||(t=n.create(t));for(var i,r,o=void 0===e?t.len:t.pos+e,a=new u.Store;t.pos<o;){var h=t.uint32();switch(h>>>3){case 1:a.binCounts===s.emptyObject&&(a.binCounts={});var f=t.uint32()+t.pos;for(i=0,r=0;t.pos<f;){var p=t.uint32();switch(p>>>3){case 1:i=t.sint32();break;case 2:r=t.double();break;default:t.skipType(7&p)}}a.binCounts[i]=r;break;case 2:if(a.contiguousBinCounts&&a.contiguousBinCounts.length||(a.contiguousBinCounts=[]),(7&h)==2)for(var f=t.uint32()+t.pos;t.pos<f;)a.contiguousBinCounts.push(t.double());else a.contiguousBinCounts.push(t.double());break;case 3:a.contiguousBinIndexOffset=t.sint32();break;default:t.skipType(7&h)}}return a},Store.decodeDelimited=function(t){return t instanceof n||(t=new n(t)),this.decode(t,t.uint32())},Store.verify=function(t){if("object"!=typeof t||null===t)return"object expected";if(null!=t.binCounts&&t.hasOwnProperty("binCounts")){if(!s.isObject(t.binCounts))return"binCounts: object expected";for(var e=Object.keys(t.binCounts),i=0;i<e.length;++i){if(!s.key32Re.test(e[i]))return"binCounts: integer key{k:sint32} expected";if("number"!=typeof t.binCounts[e[i]])return"binCounts: number{k:sint32} expected"}}if(null!=t.contiguousBinCounts&&t.hasOwnProperty("contiguousBinCounts")){if(!Array.isArray(t.contiguousBinCounts))return"contiguousBinCounts: array expected";for(var i=0;i<t.contiguousBinCounts.length;++i)if("number"!=typeof t.contiguousBinCounts[i])return"contiguousBinCounts: number[] expected"}return null!=t.contiguousBinIndexOffset&&t.hasOwnProperty("contiguousBinIndexOffset")&&!s.isInteger(t.contiguousBinIndexOffset)?"contiguousBinIndexOffset: integer expected":null},Store.fromObject=function(t){if(t instanceof u.Store)return t;var e=new u.Store;if(t.binCounts){if("object"!=typeof t.binCounts)throw TypeError(".Store.binCounts: object expected");e.binCounts={};for(var i=Object.keys(t.binCounts),r=0;r<i.length;++r)e.binCounts[i[r]]=Number(t.binCounts[i[r]])}if(t.contiguousBinCounts){if(!Array.isArray(t.contiguousBinCounts))throw TypeError(".Store.contiguousBinCounts: array expected");e.contiguousBinCounts=[];for(var r=0;r<t.contiguousBinCounts.length;++r)e.contiguousBinCounts[r]=Number(t.contiguousBinCounts[r])}return null!=t.contiguousBinIndexOffset&&(e.contiguousBinIndexOffset=0|t.contiguousBinIndexOffset),e},Store.toObject=function(t,e){e||(e={});var i,r={};if((e.arrays||e.defaults)&&(r.contiguousBinCounts=[]),(e.objects||e.defaults)&&(r.binCounts={}),e.defaults&&(r.contiguousBinIndexOffset=0),t.binCounts&&(i=Object.keys(t.binCounts)).length){r.binCounts={};for(var n=0;n<i.length;++n)r.binCounts[i[n]]=e.json&&!isFinite(t.binCounts[i[n]])?String(t.binCounts[i[n]]):t.binCounts[i[n]]}if(t.contiguousBinCounts&&t.contiguousBinCounts.length){r.contiguousBinCounts=[];for(var n=0;n<t.contiguousBinCounts.length;++n)r.contiguousBinCounts[n]=e.json&&!isFinite(t.contiguousBinCounts[n])?String(t.contiguousBinCounts[n]):t.contiguousBinCounts[n]}return null!=t.contiguousBinIndexOffset&&t.hasOwnProperty("contiguousBinIndexOffset")&&(r.contiguousBinIndexOffset=t.contiguousBinIndexOffset),r},Store.prototype.toJSON=function(){return this.constructor.toObject(this,r.util.toJSONOptions)},Store}(),t.exports=u},"./@datadog/sketches-js/dist/ddsketch/store/CollapsingHighestDenseStore.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingHighestDenseStore=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"),s=i("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.CollapsingHighestDenseStore=function(t){function CollapsingHighestDenseStore(e,i){var r=t.call(this,i)||this;return r.binLimit=e,r.isCollapsed=!1,r}return n(CollapsingHighestDenseStore,t),CollapsingHighestDenseStore.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.maxKey-t.offset+1,i=Math.max(this.maxKey+1,t.minKey)-t.offset;if(e>i){var r=(0,s.sumOfRange)(t.bins,i,e);this.bins[this.length()-1]+=r}else i=e;for(var n=t.minKey;n<i+t.offset;n++)this.bins[n-this.offset]+=t.bins[n-t.offset];this.count+=t.count}},CollapsingHighestDenseStore.prototype.copy=function(e){t.prototype.copy.call(this,e),this.isCollapsed=e.isCollapsed},CollapsingHighestDenseStore.prototype._getNewLength=function(t,e){return Math.min(this.chunkSize*Math.ceil((e-t+1)/this.chunkSize),this.binLimit)},CollapsingHighestDenseStore.prototype._adjust=function(t,e){if(e-t+1>this.length())if((e=t+this.length()+1)<=this.minKey)this.offset=t,this.maxKey=e,this.bins.fill(0),this.bins[this.length()-1]=this.count;else{var i=this.offset-t;if(i>0){var r=e-this.offset+1,n=this.maxKey-this.offset+1,o=(0,s.sumOfRange)(this.bins,r,n);this.bins.fill(0,r,n),this.bins[r-1]+=o,this.maxKey=e,this._shiftBins(i)}else this.maxKey=e,this._shiftBins(i);this.minKey=t,this.isCollapsed=!0}else this._centerBins(t,e),this.minKey=t,this.maxKey=e},CollapsingHighestDenseStore.prototype._getIndex=function(t){if(t<this.minKey){if(this.isCollapsed||(this._extendRange(t),this.isCollapsed))return this.length()-1}else t>this.maxKey&&this._extendRange(t);return t-this.offset},CollapsingHighestDenseStore}(o.DenseStore)},"./@datadog/sketches-js/dist/ddsketch/store/CollapsingLowestDenseStore.js"(t,e,i){"use strict";var r,n=this&&this.__extends||(r=function(t,e){return(r=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function __(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(__.prototype=e.prototype,new __)});Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingLowestDenseStore=void 0;var o=i("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"),s=i("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.CollapsingLowestDenseStore=function(t){function CollapsingLowestDenseStore(e,i){var r=t.call(this,i)||this;return r.binLimit=e,r.isCollapsed=!1,r}return n(CollapsingLowestDenseStore,t),CollapsingLowestDenseStore.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.minKey-t.offset,i=Math.min(this.minKey,t.maxKey+1)-t.offset;if(i>e){var r=(0,s.sumOfRange)(t.bins,e,i);this.bins[0]+=r}else i=e;for(var n=i+t.offset;n<t.maxKey+1;n++)this.bins[n-this.offset]+=t.bins[n-t.offset];this.count+=t.count}},CollapsingLowestDenseStore.prototype.copy=function(e){t.prototype.copy.call(this,e),this.isCollapsed=e.isCollapsed},CollapsingLowestDenseStore.prototype._getNewLength=function(t,e){return Math.min(this.chunkSize*Math.ceil((e-t+1)/this.chunkSize),this.binLimit)},CollapsingLowestDenseStore.prototype._adjust=function(t,e){if(e-t+1>this.length()){if((t=e-this.length()+1)>=this.maxKey)this.offset=t,this.minKey=t,this.bins.fill(0),this.bins[0]=this.count;else{var i=this.offset-t;if(i<0){var r=this.minKey-this.offset,n=t-this.offset,o=(0,s.sumOfRange)(this.bins,r,n);this.bins.fill(0,r,n),this.bins[n]+=o,this.minKey=t,this._shiftBins(i)}else this.minKey=t,this._shiftBins(i)}this.maxKey=e,this.isCollapsed=!0}else this._centerBins(t,e),this.minKey=t,this.maxKey=e},CollapsingLowestDenseStore.prototype._getIndex=function(t){if(t<this.minKey){if(this.isCollapsed||(this._extendRange(t),this.isCollapsed))return 0}else t>this.maxKey&&this._extendRange(t);return t-this.offset},CollapsingLowestDenseStore}(o.DenseStore)},"./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js"(t,e,i){"use strict";var r=this&&this.__spreadArray||function(t,e,i){if(i||2==arguments.length)for(var r,n=0,o=e.length;n<o;n++)!r&&n in e||(r||(r=Array.prototype.slice.call(e,0,n)),r[n]=e[n]);return t.concat(r||Array.prototype.slice.call(e))};Object.defineProperty(e,"__esModule",{value:!0}),e.DenseStore=void 0;var n=i("./@datadog/sketches-js/dist/ddsketch/store/util.js");e.DenseStore=function(){function DenseStore(t){void 0===t&&(t=128),this.chunkSize=t,this.bins=[],this.count=0,this.minKey=1/0,this.maxKey=-1/0,this.offset=0}return DenseStore.prototype.add=function(t,e){void 0===e&&(e=1);var i=this._getIndex(t);this.bins[i]+=e,this.count+=e},DenseStore.prototype.keyAtRank=function(t,e){void 0===e&&(e=!0);for(var i=0,r=0;r<this.length();r++)if(i+=this.bins[r],e&&i>t||!e&&i>=t+1)return r+this.offset;return this.maxKey},DenseStore.prototype.merge=function(t){if(0!==t.count){if(0===this.count)return void this.copy(t);(t.minKey<this.minKey||t.maxKey>this.maxKey)&&this._extendRange(t.minKey,t.maxKey);var e=t.minKey-t.offset,i=Math.min(this.minKey,t.maxKey+1)-t.offset;if(i>e){var r=(0,n.sumOfRange)(t.bins,e,i);this.bins[0]+=r}else i=e;for(var o=i+t.offset;o<t.maxKey+1;o++)this.bins[o-this.offset]+=t.bins[o-t.offset];this.count+=t.count}},DenseStore.prototype.copy=function(t){this.bins=r([],t.bins,!0),this.count=t.count,this.minKey=t.minKey,this.maxKey=t.maxKey,this.offset=t.offset},DenseStore.prototype.length=function(){return this.bins.length},DenseStore.prototype._getNewLength=function(t,e){return this.chunkSize*Math.ceil((e-t+1)/this.chunkSize)},DenseStore.prototype._adjust=function(t,e){this._centerBins(t,e),this.minKey=t,this.maxKey=e},DenseStore.prototype._shiftBins=function(t){var e,i;t>0?(this.bins=this.bins.slice(0,-t),(e=this.bins).unshift.apply(e,Array(t).fill(0))):(this.bins=this.bins.slice(Math.abs(t)),(i=this.bins).push.apply(i,Array(Math.abs(t)).fill(0))),this.offset-=t},DenseStore.prototype._centerBins=function(t,e){var i=t+Math.floor((e-t+1)/2);this._shiftBins(Math.floor(this.offset+this.length()/2)-i)},DenseStore.prototype._extendRange=function(t,e){e=e||t;var i,r=Math.min(t,e,this.minKey),n=Math.max(t,e,this.maxKey);if(0===this.length())this.bins=Array(this._getNewLength(r,n)).fill(0),this.offset=r,this._adjust(r,n);else if(r>=this.minKey&&n<this.offset+this.length())this.minKey=r,this.maxKey=n;else{var o=this._getNewLength(r,n);o>this.length()&&(i=this.bins).push.apply(i,Array(o-this.length()).fill(0)),this._adjust(r,n)}},DenseStore.prototype._getIndex=function(t){return t<this.minKey?this._extendRange(t):t>this.maxKey&&this._extendRange(t),t-this.offset},DenseStore.prototype.toProto=function(){return i("./@datadog/sketches-js/dist/ddsketch/proto/compiled.js").Store.create({contiguousBinCounts:this.bins,contiguousBinIndexOffset:this.offset})},DenseStore.fromProto=function(t){if(!t||null==t.contiguousBinCounts||null==t.contiguousBinIndexOffset)throw Error("Failed to decode store from protobuf");var e=new this,i=t.contiguousBinIndexOffset;e.offset=i;for(var r=0,n=t.contiguousBinCounts;r<n.length;r++){var o=n[r];e.add(i,o),i+=1}return e},DenseStore}()},"./@datadog/sketches-js/dist/ddsketch/store/index.js"(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CollapsingHighestDenseStore=e.CollapsingLowestDenseStore=e.DenseStore=void 0;var r=i("./@datadog/sketches-js/dist/ddsketch/store/DenseStore.js");Object.defineProperty(e,"DenseStore",{enumerable:!0,get:function(){return r.DenseStore}});var n=i("./@datadog/sketches-js/dist/ddsketch/store/CollapsingLowestDenseStore.js");Object.defineProperty(e,"CollapsingLowestDenseStore",{enumerable:!0,get:function(){return n.CollapsingLowestDenseStore}});var o=i("./@datadog/sketches-js/dist/ddsketch/store/CollapsingHighestDenseStore.js");Object.defineProperty(e,"CollapsingHighestDenseStore",{enumerable:!0,get:function(){return o.CollapsingHighestDenseStore}})},"./@datadog/sketches-js/dist/ddsketch/store/util.js"(t,e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.sumOfRange=void 0,e.sumOfRange=function(t,e,i){for(var r=0,n=e;n<=i;n++)r+=t[n];return r}},"./@datadog/sketches-js/dist/index.js"(t,e,i){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,i,r){void 0===r&&(r=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[i]}}),Object.defineProperty(t,r,n)}:function(t,e,i,r){void 0===r&&(r=i),t[r]=e[i]}),n=this&&this.__exportStar||function(t,e){for(var i in t)"default"===i||Object.prototype.hasOwnProperty.call(e,i)||r(e,t,i)};Object.defineProperty(e,"__esModule",{value:!0}),n(i("./@datadog/sketches-js/dist/ddsketch/index.js"),e)},"./long/umd/index.js"(t,e){!function(i,r){function preferDefault(t){return t.default||t}"function"==typeof define&&define.amd?define([],function(){var t={};return r(t),preferDefault(t)}):(r(e),t.exports=preferDefault(e))}("u">typeof globalThis?globalThis:"u">typeof self&&self,function(t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=null;try{e=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}function Long(t,e,i){this.low=0|t,this.high=0|e,this.unsigned=!!i}function isLong(t){return!0===(t&&t.__isLong__)}function ctz32(t){var e=Math.clz32(t&-t);return t?31-e:e}Long.prototype.__isLong__,Object.defineProperty(Long.prototype,"__isLong__",{value:!0}),Long.isLong=isLong;var i={},r={};function fromInt(t,e){var n,o,s;if(e)return(t>>>=0,(s=0<=t&&t<256)&&(o=r[t]))?o:(n=fromBits(t,0,!0),s&&(r[t]=n),n);return(t|=0,(s=-128<=t&&t<128)&&(o=i[t]))?o:(n=fromBits(t,t<0?-1:0,!1),s&&(i[t]=n),n)}function fromNumber(t,e){if(isNaN(t))return e?f:h;if(e){if(t<0)return f;if(t>=s)return d}else{if(t<=-u)return m;if(t+1>=u)return g}return t<0?fromNumber(-t,e).neg():fromBits(t%o|0,t/o|0,e)}function fromBits(t,e,i){return new Long(t,e,i)}Long.fromInt=fromInt,Long.fromNumber=fromNumber,Long.fromBits=fromBits;var n=Math.pow;function fromString(t,e,i){if(0===t.length)throw Error("empty string");if("number"==typeof e?(i=e,e=!1):e=!!e,"NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e?f:h;if((i=i||10)<2||36<i)throw RangeError("radix");if((r=t.indexOf("-"))>0)throw Error("interior hyphen");if(0===r)return fromString(t.substring(1),e,i).neg();for(var r,o=fromNumber(n(i,8)),s=h,u=0;u<t.length;u+=8){var a=Math.min(8,t.length-u),p=parseInt(t.substring(u,u+a),i);if(a<8){var l=fromNumber(n(i,a));s=s.mul(l).add(fromNumber(p))}else s=(s=s.mul(o)).add(fromNumber(p))}return s.unsigned=e,s}function fromValue(t,e){return"number"==typeof t?fromNumber(t,e):"string"==typeof t?fromString(t,e):fromBits(t.low,t.high,"boolean"==typeof e?e:t.unsigned)}Long.fromString=fromString,Long.fromValue=fromValue;var o=0x100000000,s=0xffffffffffffffff,u=0x8000000000000000,a=fromInt(0x1000000),h=fromInt(0);Long.ZERO=h;var f=fromInt(0,!0);Long.UZERO=f;var p=fromInt(1);Long.ONE=p;var l=fromInt(1,!0);Long.UONE=l;var c=fromInt(-1);Long.NEG_ONE=c;var g=fromBits(-1,0x7fffffff,!1);Long.MAX_VALUE=g;var d=fromBits(-1,-1,!0);Long.MAX_UNSIGNED_VALUE=d;var m=fromBits(0,-0x80000000,!1);Long.MIN_VALUE=m;var y=Long.prototype;y.toInt=function(){return this.unsigned?this.low>>>0:this.low},y.toNumber=function(){return this.unsigned?(this.high>>>0)*o+(this.low>>>0):this.high*o+(this.low>>>0)},y.toString=function(t){if((t=t||10)<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(!this.eq(m))return"-"+this.neg().toString(t);else{var e=fromNumber(t),i=this.div(e),r=i.mul(e).sub(this);return i.toString(t)+r.toInt().toString(t)}for(var o=fromNumber(n(t,6),this.unsigned),s=this,u="";;){var a=s.div(o),h=(s.sub(a.mul(o)).toInt()>>>0).toString(t);if((s=a).isZero())return h+u;for(;h.length<6;)h="0"+h;u=""+h+u}},y.getHighBits=function(){return this.high},y.getHighBitsUnsigned=function(){return this.high>>>0},y.getLowBits=function(){return this.low},y.getLowBitsUnsigned=function(){return this.low>>>0},y.getNumBitsAbs=function(){if(this.isNegative())return this.eq(m)?64:this.neg().getNumBitsAbs();for(var t=0!=this.high?this.high:this.low,e=31;e>0&&(t&1<<e)==0;e--);return 0!=this.high?e+33:e+1},y.isSafeInteger=function(){var t=this.high>>21;return!t||!this.unsigned&&-1===t&&(0!==this.low||-2097152!==this.high)},y.isZero=function(){return 0===this.high&&0===this.low},y.eqz=y.isZero,y.isNegative=function(){return!this.unsigned&&this.high<0},y.isPositive=function(){return this.unsigned||this.high>=0},y.isOdd=function(){return(1&this.low)==1},y.isEven=function(){return(1&this.low)==0},y.equals=function(t){return isLong(t)||(t=fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},y.eq=y.equals,y.notEquals=function(t){return!this.eq(t)},y.neq=y.notEquals,y.ne=y.notEquals,y.lessThan=function(t){return 0>this.comp(t)},y.lt=y.lessThan,y.lessThanOrEqual=function(t){return 0>=this.comp(t)},y.lte=y.lessThanOrEqual,y.le=y.lessThanOrEqual,y.greaterThan=function(t){return this.comp(t)>0},y.gt=y.greaterThan,y.greaterThanOrEqual=function(t){return this.comp(t)>=0},y.gte=y.greaterThanOrEqual,y.ge=y.greaterThanOrEqual,y.compare=function(t){if(isLong(t)||(t=fromValue(t)),this.eq(t))return 0;var e=this.isNegative(),i=t.isNegative();return e&&!i?-1:!e&&i?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},y.comp=y.compare,y.negate=function(){return!this.unsigned&&this.eq(m)?m:this.not().add(p)},y.neg=y.negate,y.add=function(t){isLong(t)||(t=fromValue(t));var e,i,r=this.high>>>16,n=65535&this.high,o=this.low>>>16,s=65535&this.low,u=t.high>>>16,a=65535&t.high,h=t.low>>>16,f=65535&t.low,p=0,l=0;return e=0+((i=0+(s+f))>>>16),i&=65535,e+=o+h,l+=e>>>16,e&=65535,l+=n+a,p+=l>>>16,l&=65535,p+=r+u,fromBits(e<<16|i,(p&=65535)<<16|l,this.unsigned)},y.subtract=function(t){return isLong(t)||(t=fromValue(t)),this.add(t.neg())},y.sub=y.subtract,y.multiply=function(t){if(this.isZero())return this;if(isLong(t)||(t=fromValue(t)),e)return fromBits(e.mul(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned);if(t.isZero())return this.unsigned?f:h;if(this.eq(m))return t.isOdd()?m:h;if(t.eq(m))return this.isOdd()?m:h;if(this.isNegative())if(t.isNegative())return this.neg().mul(t.neg());else return this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(a)&&t.lt(a))return fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var i,r,n=this.high>>>16,o=65535&this.high,s=this.low>>>16,u=65535&this.low,p=t.high>>>16,l=65535&t.high,c=t.low>>>16,g=65535&t.low,d=0,y=0;return i=0+((r=0+u*g)>>>16),r&=65535,i+=s*g,y+=i>>>16,i&=65535,i+=u*c,y+=i>>>16,i&=65535,y+=o*g,d+=y>>>16,y&=65535,y+=s*c,d+=y>>>16,y&=65535,y+=u*l,d+=y>>>16,y&=65535,d+=n*g+o*c+s*l+u*p,fromBits(i<<16|r,(d&=65535)<<16|y,this.unsigned)},y.mul=y.multiply,y.divide=function(t){if(isLong(t)||(t=fromValue(t)),t.isZero())throw Error("division by zero");if(e){var i,r,o;return this.unsigned||-0x80000000!==this.high||-1!==t.low||-1!==t.high?fromBits((this.unsigned?e.div_u:e.div_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this}if(this.isZero())return this.unsigned?f:h;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return f;if(t.gt(this.shru(1)))return l;o=f}else{if(this.eq(m))if(t.eq(p)||t.eq(c))return m;else return t.eq(m)?p:(i=this.shr(1).div(t).shl(1)).eq(h)?t.isNegative()?p:c:(r=this.sub(t.mul(i)),o=i.add(r.div(t)));if(t.eq(m))return this.unsigned?f:h;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=h}for(r=this;r.gte(t);){for(var s=Math.ceil(Math.log(i=Math.max(1,Math.floor(r.toNumber()/t.toNumber())))/Math.LN2),u=s<=48?1:n(2,s-48),a=fromNumber(i),g=a.mul(t);g.isNegative()||g.gt(r);)i-=u,g=(a=fromNumber(i,this.unsigned)).mul(t);a.isZero()&&(a=p),o=o.add(a),r=r.sub(g)}return o},y.div=y.divide,y.modulo=function(t){return(isLong(t)||(t=fromValue(t)),e)?fromBits((this.unsigned?e.rem_u:e.rem_s)(this.low,this.high,t.low,t.high),e.get_high(),this.unsigned):this.sub(this.div(t).mul(t))},y.mod=y.modulo,y.rem=y.modulo,y.not=function(){return fromBits(~this.low,~this.high,this.unsigned)},y.countLeadingZeros=function(){return this.high?Math.clz32(this.high):Math.clz32(this.low)+32},y.clz=y.countLeadingZeros,y.countTrailingZeros=function(){return this.low?ctz32(this.low):ctz32(this.high)+32},y.ctz=y.countTrailingZeros,y.and=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low&t.low,this.high&t.high,this.unsigned)},y.or=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low|t.low,this.high|t.high,this.unsigned)},y.xor=function(t){return isLong(t)||(t=fromValue(t)),fromBits(this.low^t.low,this.high^t.high,this.unsigned)},y.shiftLeft=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):fromBits(0,this.low<<t-32,this.unsigned)},y.shl=y.shiftLeft,y.shiftRight=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},y.shr=y.shiftRight,y.shiftRightUnsigned=function(t){return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:t<32?fromBits(this.low>>>t|this.high<<32-t,this.high>>>t,this.unsigned):32===t?fromBits(this.high,0,this.unsigned):fromBits(this.high>>>t-32,0,this.unsigned)},y.shru=y.shiftRightUnsigned,y.shr_u=y.shiftRightUnsigned,y.rotateLeft=function(t){var e;return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:32===t?fromBits(this.high,this.low,this.unsigned):t<32?(e=32-t,fromBits(this.low<<t|this.high>>>e,this.high<<t|this.low>>>e,this.unsigned)):(t-=32,e=32-t,fromBits(this.high<<t|this.low>>>e,this.low<<t|this.high>>>e,this.unsigned))},y.rotl=y.rotateLeft,y.rotateRight=function(t){var e;return(isLong(t)&&(t=t.toInt()),0==(t&=63))?this:32===t?fromBits(this.high,this.low,this.unsigned):t<32?(e=32-t,fromBits(this.high<<e|this.low>>>t,this.low<<e|this.high>>>t,this.unsigned)):(t-=32,e=32-t,fromBits(this.low<<e|this.high>>>t,this.high<<e|this.low>>>t,this.unsigned))},y.rotr=y.rotateRight,y.toSigned=function(){return this.unsigned?fromBits(this.low,this.high,!1):this},y.toUnsigned=function(){return this.unsigned?this:fromBits(this.low,this.high,!0)},y.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},y.toBytesLE=function(){var t=this.high,e=this.low;return[255&e,e>>>8&255,e>>>16&255,e>>>24,255&t,t>>>8&255,t>>>16&255,t>>>24]},y.toBytesBE=function(){var t=this.high,e=this.low;return[t>>>24,t>>>16&255,t>>>8&255,255&t,e>>>24,e>>>16&255,e>>>8&255,255&e]},Long.fromBytes=function(t,e,i){return i?Long.fromBytesLE(t,e):Long.fromBytesBE(t,e)},Long.fromBytesLE=function(t,e){return new Long(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,e)},Long.fromBytesBE=function(t,e){return new Long(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],e)},"function"==typeof BigInt&&(Long.fromBigInt=function(t,e){return fromBits(Number(BigInt.asIntN(32,t)),Number(BigInt.asIntN(32,t>>BigInt(32))),e)},Long.fromValue=function(t,e){return"bigint"==typeof t?Long.fromBigInt(t,e):fromValue(t,e)},y.toBigInt=function(){var t=BigInt(this.low>>>0);return BigInt(this.unsigned?this.high>>>0:this.high)<<BigInt(32)|t}),t.default=Long})},"./protobufjs/minimal.js"(t,e,i){"use strict";t.exports=i("./protobufjs/src/index-minimal.js")},"./protobufjs/src/index-minimal.js"(t,e,i){"use strict";function configure(){e.util.LongBits._configure(e.util.Long),e.Writer._configure(e.BufferWriter),e.Reader._configure(e.BufferReader)}e.build="minimal",e.Writer=i("./protobufjs/src/writer.js"),e.BufferWriter=i("./protobufjs/src/writer_buffer.js"),e.Reader=i("./protobufjs/src/reader.js"),e.BufferReader=i("./protobufjs/src/reader_buffer.js"),e.util=i("./protobufjs/src/util/minimal.js"),e.rpc=i("./protobufjs/src/rpc.js"),e.roots=i("./protobufjs/src/roots.js"),e.configure=configure,configure()},"./protobufjs/src/reader.js"(t,e,i){"use strict";t.exports=Reader;var r,n=i("./protobufjs/src/util/minimal.js"),o=n.LongBits,s=n.utf8;function indexOutOfRange(t,e){return RangeError("index out of range: "+t.pos+" + "+(e||1)+" > "+t.len)}function Reader(t){this.buf=t,this.pos=0,this.len=t.length,this.view=null,this.discardUnknown=Reader.discardUnknown}function create_array(t){if(Array.isArray(t)&&(t=new Uint8Array(t)),t instanceof Uint8Array)return new Reader(t);throw Error("illegal buffer")}var create=function(){return n.Buffer?function(t){return(Reader.create=function(t){return n.Buffer.isBuffer(t)?new r(t):create_array(t)})(t)}:create_array};function readVarint32NearEnd(t){for(var e=0,i=0;i<4&&!(t.pos>=t.len);++i){var r=t.buf[t.pos++];if(e=(e|(127&r)<<7*i)>>>0,r<128)return e}throw indexOutOfRange(t)}function readLongVarint(){var t=new o(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;if(t.lo=(t.lo|(127&this.buf[this.pos])<<28)>>>0,t.hi=(t.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return t;e=0}else{for(;e<4&&!(this.pos>=this.len);++e)if(t.lo=(t.lo|(127&this.buf[this.pos])<<7*e)>>>0,this.buf[this.pos++]<128)return t;throw indexOutOfRange(this)}if(this.len-this.pos>4){for(;e<5;++e)if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}else for(;e<5;++e){if(this.pos>=this.len)throw indexOutOfRange(this);if(t.hi=(t.hi|(127&this.buf[this.pos])<<7*e+3)>>>0,this.buf[this.pos++]<128)return t}throw Error("invalid varint encoding")}function readFixed32_end(t,e){return(t[e-4]|t[e-3]<<8|t[e-2]<<16|t[e-1]<<24)>>>0}function readFixed64(){if(this.pos+8>this.len)throw indexOutOfRange(this,8);return new o(readFixed32_end(this.buf,this.pos+=4),readFixed32_end(this.buf,this.pos+=4))}function getLazyView(t,e,i){var r=t.view;if(r||e<i)return r;var n=t.buf;return t.view=new DataView(n.buffer,n.byteOffset,n.byteLength)}Reader.create=create(),Reader.prototype.raw=function(t,e){return this.buf.subarray(t,e)},Reader.prototype.uint32=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw indexOutOfRange(this);if(this.buf[this.pos]>=128)return readVarint32NearEnd(this)}var t=this.buf,e=this.pos,i=(127&t[e])>>>0;if(t[e++]<128||(i=(i|(127&t[e])<<7)>>>0,t[e++]<128)||(i=(i|(127&t[e])<<14)>>>0,t[e++]<128)||(i=(i|(127&t[e])<<21)>>>0,t[e++]<128)||(i=(i|(15&t[e])<<28)>>>0,t[e++]<128))return this.pos=e,i;for(var r=0;r<5;++r){if(e>=this.len)throw this.pos=e,indexOutOfRange(this);if(t[e++]<128)return this.pos=e,i}throw this.pos=e,Error("invalid varint encoding")},Reader.prototype.tag=function(){if(this.len-this.pos<5){if(this.pos>=this.len)throw indexOutOfRange(this);if(this.buf[this.pos]>=128)return readVarint32NearEnd(this)}var t=this.buf,e=this.pos,i=(127&t[e])>>>0;if(t[e++]<128||(i=(i|(127&t[e])<<7)>>>0,t[e++]<128)||(i=(i|(127&t[e])<<14)>>>0,t[e++]<128)||(i=(i|(127&t[e])<<21)>>>0,t[e++]<128))return this.pos=e,i;if(i=(i|(15&t[e])<<28)>>>0,t[e]<128&&(112&t[e])==0)return this.pos=e+1,i;throw this.pos=e+1,Error("invalid tag encoding")},Reader.prototype.int32=function(){return 0|this.uint32()},Reader.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(1&t)},Reader.prototype.bool=function(){for(var t,e=!1,i=0;i<10;++i){if(this.pos>=this.len)throw indexOutOfRange(this);if(127&(t=this.buf[this.pos++])&&(e=!0),t<128)return e}throw Error("invalid varint encoding")},Reader.prototype.fixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.sfixed32=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);return 0|readFixed32_end(this.buf,this.pos+=4)},Reader.prototype.float=function(){if(this.pos+4>this.len)throw indexOutOfRange(this,4);var t=n.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t},Reader.prototype.double=function(){if(this.pos+8>this.len)throw indexOutOfRange(this,4);var t=n.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t},Reader.prototype.uint32s=function(t){void 0===t&&(t=[]);var e,i=this.uint32()+this.pos,r=this.len,n=this.buf,o=this.pos;if(i>r)throw indexOutOfRange(this,i-this.pos);for(this.len=i;o<i;)(e=n[o++])<128?t.push(e):(this.pos=o-1,t.push(this.uint32()),o=this.pos);if(this.pos=o,o!==i)throw RangeError("index out of range");return this.len=r,t},Reader.prototype.int32s=function(t){void 0===t&&(t=[]);var e,i=this.uint32()+this.pos,r=this.len,n=this.buf,o=this.pos;if(i>r)throw indexOutOfRange(this,i-this.pos);for(this.len=i;o<i;)(e=n[o++])<128?t.push(e):(this.pos=o-1,t.push(this.int32()),o=this.pos);if(this.pos=o,o!==i)throw RangeError("index out of range");return this.len=r,t},Reader.prototype.sint32s=function(t){void 0===t&&(t=[]);var e=this.uint32()+this.pos,i=this.len;if(e>i)throw indexOutOfRange(this,e-this.pos);for(this.len=e;this.pos<e;)t.push(this.sint32());if(this.pos!==e)throw RangeError("index out of range");return this.len=i,t},Reader.prototype.bools=function(t){void 0===t&&(t=[]);var e,i=this.uint32()+this.pos,r=this.len,n=this.buf,o=this.pos;if(i>r)throw indexOutOfRange(this,i-this.pos);for(this.len=i;o<i;)(e=n[o++])<128?t.push(0!==e):(this.pos=o-1,t.push(this.bool()),o=this.pos);if(this.pos=o,o!==i)throw RangeError("index out of range");return this.len=r,t},Reader.prototype.fixed32s=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e;if(i>this.len)throw indexOutOfRange(this,e);var r=e>>>2,n=t.length,o=this.pos;t.length=n+r;var s=getLazyView(this,r,128);if(s)for(var u=0;u<r;++u,o+=4)t[n++]=s.getUint32(o,!0);else for(var a=this.buf,h=0;h<r;++h,o+=4)t[n++]=readFixed32_end(a,o+4);if(this.pos=o,o!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.sfixed32s=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e;if(i>this.len)throw indexOutOfRange(this,e);var r=e>>>2,n=t.length,o=this.pos;t.length=n+r;var s=getLazyView(this,r,128);if(s)for(var u=0;u<r;++u,o+=4)t[n++]=s.getInt32(o,!0);else for(var a=this.buf,h=0;h<r;++h,o+=4)t[n++]=0|readFixed32_end(a,o+4);if(this.pos=o,o!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.floats=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e;if(i>this.len)throw indexOutOfRange(this,e);var r=e>>>2,o=t.length,s=this.pos;t.length=o+r;var u=getLazyView(this,r,8);if(u)for(var a=0;a<r;++a,s+=4)t[o++]=u.getFloat32(s,!0);else for(var h=this.buf,f=0;f<r;++f,s+=4)t[o++]=n.float.readFloatLE(h,s);if(this.pos=s,s!==i)throw indexOutOfRange(this,4);return t},Reader.prototype.doubles=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e;if(i>this.len)throw indexOutOfRange(this,e);var r=e>>>3,o=t.length,s=this.pos;t.length=o+r;var u=getLazyView(this,r,8);if(u)for(var a=0;a<r;++a,s+=8)t[o++]=u.getFloat64(s,!0);else for(var h=this.buf,f=0;f<r;++f,s+=8)t[o++]=n.float.readDoubleLE(h,s);if(this.pos=s,s!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.uint64s=function(t){void 0===t&&(t=[]);var e=this.uint32()+this.pos,i=this.len;if(e>i)throw indexOutOfRange(this,e-this.pos);for(this.len=e;this.pos<e;)t.push(this.uint64());if(this.pos!==e)throw RangeError("index out of range");return this.len=i,t},Reader.prototype.int64s=function(t){void 0===t&&(t=[]);var e=this.uint32()+this.pos,i=this.len;if(e>i)throw indexOutOfRange(this,e-this.pos);for(this.len=e;this.pos<e;)t.push(this.int64());if(this.pos!==e)throw RangeError("index out of range");return this.len=i,t},Reader.prototype.sint64s=function(t){void 0===t&&(t=[]);var e=this.uint32()+this.pos,i=this.len;if(e>i)throw indexOutOfRange(this,e-this.pos);for(this.len=e;this.pos<e;)t.push(this.sint64());if(this.pos!==e)throw RangeError("index out of range");return this.len=i,t},Reader.prototype.fixed64s=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e,r=t.length;if(i>this.len)throw indexOutOfRange(this,e);var n=e>>>3;t.length=r+n;for(var o=0;o<n;++o)t[r++]=this.fixed64();if(this.pos!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.sfixed64s=function(t){void 0===t&&(t=[]);var e=this.uint32(),i=this.pos+e,r=t.length;if(i>this.len)throw indexOutOfRange(this,e);var n=e>>>3;t.length=r+n;for(var o=0;o<n;++o)t[r++]=this.sfixed64();if(this.pos!==i)throw indexOutOfRange(this,8);return t},Reader.prototype.bytes=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,this.raw(e,i)},Reader.prototype.string=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,s.read(this.buf,e,i)},Reader.prototype.stringVerify=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw indexOutOfRange(this,t);return this.pos=i,s.readStrict(this.buf,e,i)},Reader.prototype.skip=function(t){if("number"==typeof t){if(this.pos+t>this.len)throw indexOutOfRange(this,t);this.pos+=t}else do if(this.pos>=this.len)throw indexOutOfRange(this);while(128&this.buf[this.pos++]);return this},Reader.recursionLimit=n.recursionLimit,Reader.discardUnknown=!0,Reader.prototype.skipType=function(t,e,i){if(void 0===e&&(e=0),e>Reader.recursionLimit)throw Error("max depth exceeded");if(0===i)throw Error("illegal tag: field number 0");switch(t){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;;){var r=this.tag(),n=r>>>3;if(t=7&r,!n)throw Error("illegal tag: field number 0");if(4===t){if(void 0!==i&&n!==i)throw Error("invalid end group tag");break}this.skipType(t,e+1,n)}break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+t+" at offset "+this.pos)}return this},Reader._configure=function(t){r=t,Reader.create=create(),r._configure();var e=n.Long?"toLong":"toNumber";n.merge(Reader.prototype,{int64:function(){return readLongVarint.call(this)[e](!1)},uint64:function(){return readLongVarint.call(this)[e](!0)},sint64:function(){return readLongVarint.call(this).zzDecode()[e](!1)},fixed64:function(){return readFixed64.call(this)[e](!0)},sfixed64:function(){return readFixed64.call(this)[e](!1)}})}},"./protobufjs/src/reader_buffer.js"(t,e,i){"use strict";t.exports=BufferReader;var r=i("./protobufjs/src/reader.js");BufferReader.prototype=Object.create(r.prototype,{constructor:{value:BufferReader,writable:!0,enumerable:!1,configurable:!0}});var n=i("./protobufjs/src/util/minimal.js");function BufferReader(t){r.call(this,t)}BufferReader._configure=function(){n.Buffer&&(BufferReader.prototype._slice=n.Buffer.prototype.slice)},BufferReader.prototype.raw=function(t,e){return this._slice.call(this.buf,t,e)},BufferReader.prototype.string=function(){var t=this.uint32(),e=this.pos,i=this.pos+t;if(i>this.len)throw RangeError("index out of range: "+this.pos+" + "+t+" > "+this.len);return this.pos=i,this.buf.utf8Slice?this.buf.utf8Slice(e,i):this.buf.toString("utf-8",e,i)},BufferReader._configure()},"./protobufjs/src/roots.js"(t){"use strict";t.exports=Object.create(null)},"./protobufjs/src/rpc.js"(t,e,i){"use strict";e.Service=i("./protobufjs/src/rpc/service.js")},"./protobufjs/src/rpc/service.js"(t,e,i){"use strict";t.exports=Service;var r=i("./protobufjs/src/util/minimal.js");function Service(t,e,i){if("function"!=typeof t)throw TypeError("rpcImpl must be a function");r.EventEmitter.call(this),this.rpcImpl=t,this.requestDelimited=!!e,this.responseDelimited=!!i}Service.prototype=Object.create(r.EventEmitter.prototype,{constructor:{value:Service,writable:!0,enumerable:!1,configurable:!0}}),Service.prototype.rpcCall=function rpcCall(t,e,i,n,o){if(!n)throw TypeError("request must be specified");var s=this;if(!o)return r.asPromise(rpcCall,s,t,e,i,n);if(!s.rpcImpl)return void setTimeout(function(){o(Error("already ended"))},0);try{return s.rpcImpl(t,e[s.requestDelimited?"encodeDelimited":"encode"](n).finish(),function(e,r){if(e)return s.emit("error",e,t),o(e);if(null===r)return void s.end(!0);if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),o(e)}return s.emit("data",r,t),o(null,r)})}catch(e){s.emit("error",e,t),setTimeout(function(){o(e)},0);return}},Service.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},"./protobufjs/src/util/aspromise.js"(t){"use strict";t.exports=function asPromise(t,e){for(var i=Array(arguments.length-1),r=0,n=2,o=!0;n<arguments.length;)i[r++]=arguments[n++];return new Promise(function(n,s){i[r]=function(t){if(o)if(o=!1,t)s(t);else{for(var e=Array(arguments.length-1),i=0;i<e.length;)e[i++]=arguments[i];n.apply(null,e)}};try{t.apply(e||null,i)}catch(t){o&&(o=!1,s(t))}})}},"./protobufjs/src/util/base64.js"(t,e){"use strict";e.length=function(t){var e=t.length;if(!e)return 0;for(;e>0&&"="===t.charAt(e-1);)--e;return Math.floor(3*e/4)};for(var i=Array(64),r=Array(123),n=0;n<64;)r[i[n]=n<26?n+65:n<52?n+71:n<62?n-4:n-59|43]=n++;r[45]=62,r[95]=63,e.encode=function(t,e,r){for(var n,o=null,s=[],u=0,a=0;e<r;){var h=t[e++];switch(a){case 0:s[u++]=i[h>>2],n=(3&h)<<4,a=1;break;case 1:s[u++]=i[n|h>>4],n=(15&h)<<2,a=2;break;case 2:s[u++]=i[n|h>>6],s[u++]=i[63&h],a=0}u>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,s)),u=0)}return(a&&(s[u++]=i[n],s[u++]=61,1===a&&(s[u++]=61)),o)?(u&&o.push(String.fromCharCode.apply(String,s.slice(0,u))),o.join("")):String.fromCharCode.apply(String,s.slice(0,u))};var o="invalid encoding";e.decode=function(t,e,i){for(var n,s=i,u=0,a=0;a<t.length;){var h=t.charCodeAt(a++);if(61===h&&u>1)break;if(void 0===(h=r[h]))throw Error(o);switch(u){case 0:n=h,u=1;break;case 1:e[i++]=n<<2|(48&h)>>4,n=h,u=2;break;case 2:e[i++]=(15&n)<<4|(60&h)>>2,n=h,u=3;break;case 3:e[i++]=(3&n)<<6|h,u=0}}if(1===u)throw Error(o);return i-s};var s=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,u=/[-_]/,a=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}(?:==)?|[A-Za-z0-9_-]{3}=?)?$/;e.test=function(t){return s.test(t)||u.test(t)&&a.test(t)}},"./protobufjs/src/util/eventemitter.js"(t){"use strict";function EventEmitter(){this._listeners=Object.create(null)}t.exports=EventEmitter,EventEmitter.prototype.on=function(t,e,i){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:i||this}),this},EventEmitter.prototype.off=function(t,e){if(void 0===t)this._listeners=Object.create(null);else if(void 0===e)this._listeners[t]=[];else{var i=this._listeners[t];if(!i)return this;for(var r=0;r<i.length;)i[r].fn===e?i.splice(r,1):++r}return this},EventEmitter.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var i=[],r=1;r<arguments.length;)i.push(arguments[r++]);for(r=0;r<e.length;)e[r].fn.apply(e[r++].ctx,i)}return this}},"./protobufjs/src/util/float.js"(t){"use strict";function factory(t){if("u">typeof Float32Array)!function(){var e=new Float32Array([-0]),i=new Uint8Array(e.buffer),r=128===i[3];function writeFloat_f32_cpy(t,r,n){e[0]=t,r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2],r[n+3]=i[3]}function writeFloat_f32_rev(t,r,n){e[0]=t,r[n]=i[3],r[n+1]=i[2],r[n+2]=i[1],r[n+3]=i[0]}function readFloat_f32_cpy(t,r){return i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],e[0]}function readFloat_f32_rev(t,r){return i[3]=t[r],i[2]=t[r+1],i[1]=t[r+2],i[0]=t[r+3],e[0]}t.writeFloatLE=r?writeFloat_f32_cpy:writeFloat_f32_rev,t.writeFloatBE=r?writeFloat_f32_rev:writeFloat_f32_cpy,t.readFloatLE=r?readFloat_f32_cpy:readFloat_f32_rev,t.readFloatBE=r?readFloat_f32_rev:readFloat_f32_cpy}();else{function writeFloat_ieee754(t,e,i,r){var n=+(e<0);if(n&&(e=-e),0===e)t(1/e>0?0:0x80000000,i,r);else if(isNaN(e))t(0x7fc00000,i,r);else if(e>34028234663852886e22)t((n<<31|0x7f800000)>>>0,i,r);else if(e<11754943508222875e-54)t((n<<31|Math.round(e/1401298464324817e-60))>>>0,i,r);else{var o=Math.floor(Math.log(e)/Math.LN2),s=8388607&Math.round(e*Math.pow(2,-o)*8388608);t((n<<31|o+127<<23|s)>>>0,i,r)}}function readFloat_ieee754(t,e,i){var r=t(e,i),n=(r>>31)*2+1,o=r>>>23&255,s=8388607&r;return 255===o?s?NaN:1/0*n:0===o?1401298464324817e-60*n*s:n*Math.pow(2,o-150)*(s+8388608)}t.writeFloatLE=writeFloat_ieee754.bind(null,writeUintLE),t.writeFloatBE=writeFloat_ieee754.bind(null,writeUintBE),t.readFloatLE=readFloat_ieee754.bind(null,readUintLE),t.readFloatBE=readFloat_ieee754.bind(null,readUintBE)}if("u">typeof Float64Array)!function(){var e=new Float64Array([-0]),i=new Uint8Array(e.buffer),r=128===i[7];function writeDouble_f64_cpy(t,r,n){e[0]=t,r[n]=i[0],r[n+1]=i[1],r[n+2]=i[2],r[n+3]=i[3],r[n+4]=i[4],r[n+5]=i[5],r[n+6]=i[6],r[n+7]=i[7]}function writeDouble_f64_rev(t,r,n){e[0]=t,r[n]=i[7],r[n+1]=i[6],r[n+2]=i[5],r[n+3]=i[4],r[n+4]=i[3],r[n+5]=i[2],r[n+6]=i[1],r[n+7]=i[0]}function readDouble_f64_cpy(t,r){return i[0]=t[r],i[1]=t[r+1],i[2]=t[r+2],i[3]=t[r+3],i[4]=t[r+4],i[5]=t[r+5],i[6]=t[r+6],i[7]=t[r+7],e[0]}function readDouble_f64_rev(t,r){return i[7]=t[r],i[6]=t[r+1],i[5]=t[r+2],i[4]=t[r+3],i[3]=t[r+4],i[2]=t[r+5],i[1]=t[r+6],i[0]=t[r+7],e[0]}t.writeDoubleLE=r?writeDouble_f64_cpy:writeDouble_f64_rev,t.writeDoubleBE=r?writeDouble_f64_rev:writeDouble_f64_cpy,t.readDoubleLE=r?readDouble_f64_cpy:readDouble_f64_rev,t.readDoubleBE=r?readDouble_f64_rev:readDouble_f64_cpy}();else{function writeDouble_ieee754(t,e,i,r,n,o){var s,u=+(r<0);if(u&&(r=-r),0===r)t(0,n,o+e),t(1/r>0?0:0x80000000,n,o+i);else if(isNaN(r))t(0,n,o+e),t(0x7ff80000,n,o+i);else if(r>17976931348623157e292)t(0,n,o+e),t((u<<31|0x7ff00000)>>>0,n,o+i);else if(r<22250738585072014e-324)t((s=r/5e-324)>>>0,n,o+e),t((u<<31|s/0x100000000)>>>0,n,o+i);else{var a=Math.floor(Math.log(r)/Math.LN2);1024===a&&(a=1023),t(0x10000000000000*(s=r*Math.pow(2,-a))>>>0,n,o+e),t((u<<31|a+1023<<20|1048576*s&1048575)>>>0,n,o+i)}}function readDouble_ieee754(t,e,i,r,n){var o=t(r,n+e),s=t(r,n+i),u=(s>>31)*2+1,a=s>>>20&2047,h=0x100000000*(1048575&s)+o;return 2047===a?h?NaN:1/0*u:0===a?5e-324*u*h:u*Math.pow(2,a-1075)*(h+0x10000000000000)}t.writeDoubleLE=writeDouble_ieee754.bind(null,writeUintLE,0,4),t.writeDoubleBE=writeDouble_ieee754.bind(null,writeUintBE,4,0),t.readDoubleLE=readDouble_ieee754.bind(null,readUintLE,0,4),t.readDoubleBE=readDouble_ieee754.bind(null,readUintBE,4,0)}return t}function writeUintLE(t,e,i){e[i]=255&t,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}function writeUintBE(t,e,i){e[i]=t>>>24,e[i+1]=t>>>16&255,e[i+2]=t>>>8&255,e[i+3]=255&t}function readUintLE(t,e){return(t[e]|t[e+1]<<8|t[e+2]<<16|t[e+3]<<24)>>>0}function readUintBE(t,e){return(t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3])>>>0}t.exports=factory(factory)},"./protobufjs/src/util/longbits.js"(t){"use strict";function LongBits(t,e){this.lo=t>>>0,this.hi=e>>>0}t.exports=LongBits;var e,i=LongBits.zero=new LongBits(0,0);i.toNumber=function(){return 0},i.zzEncode=i.zzDecode=function(){return this},i.length=function(){return 1};var r=LongBits.zeroHash="\0\0\0\0\0\0\0\0";LongBits.fromNumber=function(t){if(0===t)return i;var e=t<0;e&&(t=-t);var r=t>>>0,n=(t-r)/0x100000000>>>0;return e&&(n=~n>>>0,r=~r>>>0,++r>0xffffffff&&(r=0,++n>0xffffffff&&(n=0))),new LongBits(r,n)},LongBits.from=function(t){if("number"==typeof t)return LongBits.fromNumber(t);if("string"==typeof t||t instanceof String)if(!e)return LongBits.fromNumber(parseInt(t,10));else t=e.fromString(t);return t.low||t.high?new LongBits(t.low>>>0,t.high>>>0):i},LongBits.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=~this.lo+1>>>0,i=~this.hi>>>0;return e||(i=i+1>>>0),-(e+0x100000000*i)}return this.lo+0x100000000*this.hi},LongBits.prototype.toLong=function(t){return e?new e(0|this.lo,0|this.hi,!!t):{low:0|this.lo,high:0|this.hi,unsigned:!!t}};var n=String.prototype.charCodeAt;LongBits.fromHash=function(t){return t===r?i:new LongBits((n.call(t,0)|n.call(t,1)<<8|n.call(t,2)<<16|n.call(t,3)<<24)>>>0,(n.call(t,4)|n.call(t,5)<<8|n.call(t,6)<<16|n.call(t,7)<<24)>>>0)},LongBits.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},LongBits.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this},LongBits.prototype.zzDecode=function(){var t=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this},LongBits.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,i=this.hi>>>24;return 0===i?0===e?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:i<128?9:10},LongBits._configure=function(t){e=t}},"./protobufjs/src/util/minimal.js"(t,e,i){"use strict";function isUnsafeProperty(t){return"__proto__"===t||"prototype"===t||"constructor"===t}function merge(t){var e="boolean"==typeof arguments[arguments.length-1],i=e?arguments.length-1:arguments.length;e=e&&arguments[arguments.length-1];for(var r=1;r<i;++r){var n=arguments[r];if(n)for(var o=Object.keys(n),s=0;s<o.length;++s)isUnsafeProperty(o[s])||e&&Object.prototype.hasOwnProperty.call(t,o[s])&&void 0!==t[o[s]]||(t[o[s]]=n[o[s]])}return t}function newError(t){function CustomError(t,e){if(!(this instanceof CustomError))return new CustomError(t,e);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,CustomError):Object.defineProperty(this,"stack",{value:Error().stack||""}),e&&merge(this,e)}return CustomError.prototype=Object.create(Error.prototype,{constructor:{value:CustomError,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return t},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),CustomError}e.asPromise=i("./protobufjs/src/util/aspromise.js"),e.base64=i("./protobufjs/src/util/base64.js"),e.EventEmitter=i("./protobufjs/src/util/eventemitter.js"),e.float=i("./protobufjs/src/util/float.js"),e.utf8=i("./protobufjs/src/util/utf8.js"),e.pool=i("./protobufjs/src/util/pool.js"),e.LongBits=i("./protobufjs/src/util/longbits.js"),e.isUnsafeProperty=isUnsafeProperty,e.isNode=!!("u">typeof global&&global&&global.process&&global.process.versions&&global.process.versions.node),e.global=e.isNode&&global||"u">typeof window&&window||"u">typeof self&&self||"u">typeof globalThis&&globalThis||this,e.emptyArray=Object.freeze?Object.freeze([]):[],e.emptyObject=Object.freeze?Object.freeze({}):{},e.isInteger=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t},e.isString=function(t){return"string"==typeof t||t instanceof String},e.isObject=function(t){return t&&"object"==typeof t},e.isset=e.isSet=function(t,e){var i=t[e];return!!(null!=i&&Object.hasOwnProperty.call(t,e))&&("object"!=typeof i||(Array.isArray(i)?i.length:Object.keys(i).length)>0)},e.Buffer=function(){try{var t=e.global.Buffer;return t.prototype.utf8Write||e.isNode?t:null}catch(t){return null}}(),e.newBuffer=function(t){var i=e.Buffer;return"number"==typeof t?i?i.allocUnsafe(t):new Uint8Array(t):i?i.from(t):new Uint8Array(t)},e.rawField=function(t,i,r){var n=[],o=t<<3|i;for(o>>>=0;o>127;)n.push(127&o|128),o>>>=7;n.push(o);for(var s=0;s<r.length;++s)n.push(r[s]);return e.newBuffer(n)},e.Array=Uint8Array,e.Long=e.global.dcodeIO&&e.global.dcodeIO.Long||e.global.Long||function(){try{var t=i("./long/umd/index.js");return t&&t.isLong?t:null}catch(t){return null}}(),e.key2Re=/^(?:true|false|0|1)$/,e.key32Re=/^-?(?:0|[1-9][0-9]*)$/,e.key64Re=/^(?:[\x00-\xff]{8}|-?(?:0|[1-9][0-9]*))$/,e.longToHash=function(t){return t?e.LongBits.from(t).toHash():e.LongBits.zeroHash},e.longFromHash=function(t,i){var r=e.LongBits.fromHash(t);return e.Long?e.Long.fromBits(r.lo,r.hi,i):r.toNumber(!!i)},e.longFromKey=function(t,i){return e.key64Re.test(t)&&!e.key32Re.test(t)?e.longFromHash(t,i):t},e.boolFromKey=function(t){return"true"===t||"1"===t},e.merge=merge,e.nestingLimit=32,e.recursionLimit=100,e.makeProp=function(t,e,i){Object.prototype.hasOwnProperty.call(t,e)||Object.defineProperty(t,e,{enumerable:void 0===i||i,configurable:!0,writable:!0})},e.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)},e.newError=newError,e.ProtocolError=newError("ProtocolError"),e.oneOfGetter=function(t){for(var e={},i=0;i<t.length;++i)e[t[i]]=1;return function(){for(var t=Object.keys(this),i=t.length-1;i>-1;--i)if(1===e[t[i]]&&void 0!==this[t[i]]&&null!==this[t[i]])return t[i]}},e.oneOfSetter=function(t){return function(e){for(var i=0;i<t.length;++i)t[i]!==e&&delete this[t[i]]}},e.toJSONOptions={longs:String,enums:String,bytes:String,json:!0}},"./protobufjs/src/util/pool.js"(t){"use strict";t.exports=function pool(t,e,i){var r=i||8192,n=r>>>1,o=null,s=r;return function(i){if(i<1||i>n)return t(i);s+i>r&&(o=t(r),s=0);var u=e.call(o,s,s+=i);return 7&s&&(s=(7|s)+1),u}}},"./protobufjs/src/util/utf8.js"(t,e){"use strict";var i,r=new TextDecoder("utf-8",{ignoreBOM:!0});try{i=new TextDecoder("utf-8",{fatal:!0,ignoreBOM:!0})}catch(t){i=r}function utf8_read_decoder(t,e,i,r){var n=0===i&&r===e.length?e:e.subarray(i,r);return t.decode(n)}e.length=function(t){for(var e=0,i=0,r=0;r<t.length;++r)(i=t.charCodeAt(r))<128?e+=1:i<2048?e+=2:(64512&i)==55296&&(64512&t.charCodeAt(r+1))==56320?(++r,e+=4):e+=3;return e},e.read=function(t,e,i){if(i-e<1)return"";if(i-e>=64)return utf8_read_decoder(r,t,e,i);for(var n,o,s,u,a,h,f,p,l="",c=e;c+7<i;c+=8){if(n=t[c],o=t[c+1],s=t[c+2],u=t[c+3],a=t[c+4],h=t[c+5],(n|o|s|u|a|h|(f=t[c+6])|(p=t[c+7]))&128)return l+utf8_read_decoder(r,t,c,i);l+=String.fromCharCode(n,o,s,u,a,h,f,p)}for(;c<i;++c){if(128&(n=t[c]))return l+utf8_read_decoder(r,t,c,i);l+=String.fromCharCode(n)}return l},e.readStrict=function(t,e,r){if(r-e<1)return"";if(r-e>=64)return utf8_read_decoder(i,t,e,r);for(var n,o,s,u,a,h,f,p,l="",c=e;c+7<r;c+=8){if(n=t[c],o=t[c+1],s=t[c+2],u=t[c+3],a=t[c+4],h=t[c+5],(n|o|s|u|a|h|(f=t[c+6])|(p=t[c+7]))&128)return l+utf8_read_decoder(i,t,c,r);l+=String.fromCharCode(n,o,s,u,a,h,f,p)}for(;c<r;++c){if(128&(n=t[c]))return l+utf8_read_decoder(i,t,c,r);l+=String.fromCharCode(n)}return l},e.write=function(t,e,i){for(var r,n,o=i,s=0;s<t.length;++s)(r=t.charCodeAt(s))<128?e[i++]=r:(r<2048?e[i++]=r>>6|192:((64512&r)==55296&&(64512&(n=t.charCodeAt(s+1)))==56320?(r=65536+((1023&r)<<10)+(1023&n),++s,e[i++]=r>>18|240,e[i++]=r>>12&63|128):e[i++]=r>>12|224,e[i++]=r>>6&63|128),e[i++]=63&r|128);return i-o}},"./protobufjs/src/writer.js"(t,e,i){"use strict";t.exports=Writer;var r,n=i("./protobufjs/src/util/minimal.js"),o=n.LongBits,s=n.base64,u=n.utf8;function Writer(){this.pos=0,this.buf=this.constructor.alloc(Writer.initialBufferSize),this.view=null,this.states=null}Writer.initialBufferSize=128,Object.defineProperty(Writer.prototype,"len",{configurable:!0,enumerable:!0,get:function(){return this.pos}});var create=function(){return n.Buffer?function(){return(Writer.create=function(){return new r})()}:function(){return new Writer}};function sizeVarint32(t){return t<128?1:t<16384?2:t<2097152?3:t<0x10000000?4:5}function writeStringAscii(t,e,i){for(var r=0;r<t.length;)e[i++]=t.charCodeAt(r++)}function writeVarint32(t,e,i){for(;t>127;)e[i++]=127&t|128,t>>>=7;return e[i]=t,i+1}function writeVarint64(t,e,i){for(var r=t.lo,n=t.hi;n;)e[i++]=127&r|128,r=(r>>>7|n<<25)>>>0,n>>>=7;for(;r>127;)e[i++]=127&r|128,r>>>=7;return e[i]=r,i+1}function writeFixed32(t,e,i){e[i]=255&t,e[i+1]=t>>>8&255,e[i+2]=t>>>16&255,e[i+3]=t>>>24}function getLazyView(t,e,i){var r=t.view;if(r||e<i)return r;var n=t.buf;return t.view=new DataView(n.buffer,n.byteOffset,n.byteLength)}Writer.create=create(),Writer.alloc=function(t){return new Uint8Array(t)},Writer.alloc=n.pool(Writer.alloc,Uint8Array.prototype.subarray),Writer.prototype._reserve=function(t){var e=this.pos+t;if(e>this.buf.length){var i=this.buf.length<<1;i<e&&(i=e);var r=this.constructor.alloc(i);r.set(this.buf.subarray(0,this.pos),0),this.buf=r,this.view=null}},Writer.prototype.uint32=function(t){t>>>=0,this._reserve(5);var e=this.pos;return this.pos=writeVarint32(t,this.buf,e),this},Writer.prototype.int32=function(t){return(t|=0)<0?(this._reserve(10),writeVarint64(o.fromNumber(t),this.buf,this.pos),this.pos+=10,this):this.uint32(t)},Writer.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)},Writer.prototype.uint64=function(t){var e=o.from(t);this._reserve(10);var i=this.pos;return this.pos=writeVarint64(e,this.buf,i),this},Writer.prototype.int64=Writer.prototype.uint64,Writer.prototype.sint64=function(t){var e=o.from(t).zzEncode();this._reserve(10);var i=this.pos;return this.pos=writeVarint64(e,this.buf,i),this},Writer.prototype.bool=function(t){return this._reserve(1),this.buf[this.pos++]=+!!t,this},Writer.prototype.fixed32=function(t){return this._reserve(4),writeFixed32(t>>>0,this.buf,this.pos),this.pos+=4,this},Writer.prototype.sfixed32=Writer.prototype.fixed32,Writer.prototype.fixed64=function(t){var e=o.from(t);return this._reserve(8),writeFixed32(e.lo,this.buf,this.pos),writeFixed32(e.hi,this.buf,this.pos+4),this.pos+=8,this},Writer.prototype.sfixed64=Writer.prototype.fixed64,Writer.prototype.float=function(t){return this._reserve(4),n.float.writeFloatLE(t,this.buf,this.pos),this.pos+=4,this},Writer.prototype.double=function(t){return this._reserve(8),n.float.writeDoubleLE(t,this.buf,this.pos),this.pos+=8,this},Writer.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._reserve(1),this.buf[this.pos++]=0,this;if(n.isString(t)){var i=Writer.alloc(e=s.length(t));s.decode(t,i,0),t=i}return this.uint32(e),this._reserve(e),this.buf.set(t,this.pos),this.pos+=e,this},Writer.prototype.raw=function(t){var e=t.length>>>0;return e&&(this._reserve(e),this.buf.set(t,this.pos),this.pos+=e),this},Writer.prototype._delim=function(t,e){var i=sizeVarint32(e);return i>1&&this.buf.copyWithin(t+i,t+1,t+1+e),writeVarint32(e,this.buf,t),this.pos=t+i+e,this},Writer.prototype.string=function(t){var e=t.length;if(!e)return this._reserve(1),this.buf[this.pos++]=0,this;if(e<128){this._reserve(3*e+5);var i=this.pos;return this._delim(i,u.write(t,this.buf,i+1))}var r=u.length(t);return this.uint32(r),this._reserve(r),r===t.length?writeStringAscii(t,this.buf,this.pos):u.write(t,this.buf,this.pos),this.pos+=r,this},Writer.prototype.uint32s=function(t){var e=t.length;this._reserve(5*e+5);for(var i=this.buf,r=this.pos,n=r+1,o=0;o<e;++o)n=writeVarint32(t[o]>>>0,i,n);return this._delim(r,n-r-1)},Writer.prototype.int32s=function(t){var e=t.length;this._reserve(10*e+5);for(var i,r=this.buf,n=this.pos,s=n+1,u=0;u<e;++u)s=(i=0|t[u])<0?writeVarint64(o.fromNumber(i),r,s):writeVarint32(i,r,s);return this._delim(n,s-n-1)},Writer.prototype.sint32s=function(t){var e=t.length;this._reserve(5*e+5);for(var i=this.buf,r=this.pos,n=r+1,o=0;o<e;++o)n=writeVarint32((t[o]<<1^t[o]>>31)>>>0,i,n);return this._delim(r,n-r-1)},Writer.prototype.uint64s=function(t){var e=t.length;this._reserve(10*e+5);for(var i=this.buf,r=this.pos,n=r+1,s=0;s<e;++s)n=writeVarint64(o.from(t[s]),i,n);return this._delim(r,n-r-1)},Writer.prototype.int64s=Writer.prototype.uint64s,Writer.prototype.sint64s=function(t){var e=t.length;this._reserve(10*e+5);for(var i=this.buf,r=this.pos,n=r+1,s=0;s<e;++s)n=writeVarint64(o.from(t[s]).zzEncode(),i,n);return this._delim(r,n-r-1)},Writer.prototype.bools=function(t){var e=t.length;this.uint32(e),this._reserve(e);for(var i=this.buf,r=this.pos,n=0;n<e;++n)i[r++]=+!!t[n];return this.pos+=e,this},Writer.prototype.fixed32s=function(t){var e=t.length,i=4*e;this.uint32(i),this._reserve(i);var r,n=this.pos,o=getLazyView(this,e,128);if(o)for(r=0;r<e;++r)o.setUint32(n,t[r]>>>0,!0),n+=4;else{var s=this.buf;for(r=0;r<e;++r)writeFixed32(t[r]>>>0,s,n),n+=4}return this.pos+=i,this},Writer.prototype.sfixed32s=Writer.prototype.fixed32s,Writer.prototype.fixed64s=function(t){var e=t.length,i=8*e;this.uint32(i),this._reserve(i);var r,n,s=this.pos,u=getLazyView(this,e,128);if(u)for(r=0;r<e;++r)n=o.from(t[r]),u.setUint32(s,n.lo,!0),u.setUint32(s+4,n.hi,!0),s+=8;else{var a=this.buf;for(r=0;r<e;++r)writeFixed32((n=o.from(t[r])).lo,a,s),writeFixed32(n.hi,a,s+4),s+=8}return this.pos+=i,this},Writer.prototype.sfixed64s=Writer.prototype.fixed64s,Writer.prototype.floats=function(t){var e=t.length,i=4*e;this.uint32(i),this._reserve(i);var r,o=this.pos,s=getLazyView(this,e,16);if(s)for(r=0;r<e;++r)s.setFloat32(o,t[r],!0),o+=4;else{var u=this.buf;for(r=0;r<e;++r)n.float.writeFloatLE(t[r],u,o),o+=4}return this.pos+=i,this},Writer.prototype.doubles=function(t){var e=t.length,i=8*e;this.uint32(i),this._reserve(i);var r,o=this.pos,s=getLazyView(this,e,16);if(s)for(r=0;r<e;++r)s.setFloat64(o,t[r],!0),o+=8;else{var u=this.buf;for(r=0;r<e;++r)n.float.writeDoubleLE(t[r],u,o),o+=8}return this.pos+=i,this},Writer.prototype.fork=function(){return this._reserve(1),(this.states||(this.states=[])).push(this.pos),this.pos+=1,this},Writer.prototype.reset=function(){var t=this.states;return t&&t.length?this.pos=t.pop():this.pos=0,this},Writer.prototype.ldelim=function(){var t,e,i=this.states;if(i&&i.length){var r=i.pop();(e=sizeVarint32(t=this.pos-r-1))>1?(this._reserve(e-1),this.buf.copyWithin(r+e,r+1,r+1+t),this.pos+=e-1,writeVarint32(t,this.buf,r)):this.buf[r]=t}else e=sizeVarint32(t=this.pos),this._reserve(e),this.buf.copyWithin(e,0,t),writeVarint32(t,this.buf,0),this.pos+=e;return this},Writer.prototype.finish=function(t){if(t)return this.buf.subarray(0,this.pos);var e=this.constructor.alloc(this.pos);return e.set(this.buf.subarray(0,this.pos),0),e},Writer.prototype.finishInto=function(t,e){return void 0===e&&(e=0),t.set(this.buf.subarray(0,this.pos),e),t},Writer._configure=function(t){r=t,Writer.create=create(),r._configure()}},"./protobufjs/src/writer_buffer.js"(t,e,i){"use strict";t.exports=BufferWriter;var r,n=i("./protobufjs/src/writer.js");BufferWriter.prototype=Object.create(n.prototype,{constructor:{value:BufferWriter,writable:!0,enumerable:!1,configurable:!0}});var o=i("./protobufjs/src/util/minimal.js");function BufferWriter(){n.call(this)}BufferWriter._configure=function(){BufferWriter.alloc=o.Buffer&&o.Buffer.allocUnsafe,r=o.Buffer&&o.Buffer.prototype.utf8Write?function(t,e,i){return e.utf8Write(t,i)}:function(t,e,i){return e.write(t,i)}},BufferWriter.prototype.bytes=function(t){o.isString(t)&&(t=o.Buffer.from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&(this._reserve(e),this.buf.set(t,this.pos),this.pos+=e),this},BufferWriter.prototype.string=function(t){var e=t.length;if(!e)return this._reserve(1),this.buf[this.pos++]=0,this;if(e<128){this._reserve(3*e+5);var i=this.pos,n=this.buf;return this._delim(i,e<40?o.utf8.write(t,n,i+1):r(t,n,i+1))}var s=o.Buffer.byteLength(t);return this.uint32(s),this._reserve(s),r(t,this.buf,this.pos),this.pos+=s,this},BufferWriter._configure()}},e={};function __webpack_require__(i){var r=e[i];if(void 0!==r)return r.exports;var n=e[i]={exports:{}};return t[i].call(n.exports,n,n.exports,__webpack_require__),n.exports}var i=__webpack_require__("./@datadog/sketches-js/dist/index.js");module.exports=i})();