@bugbug-io/cli 13.39.1 → 13.39.2

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.
@@ -0,0 +1,1092 @@
1
+ // ../../node_modules/@opentelemetry/api/build/esm/version.js
2
+ var VERSION = "1.9.1";
3
+
4
+ // ../../node_modules/@opentelemetry/api/build/esm/internal/semver.js
5
+ var re = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
6
+ function _makeCompatibilityCheck(ownVersion) {
7
+ const acceptedVersions = /* @__PURE__ */ new Set([ownVersion]);
8
+ const rejectedVersions = /* @__PURE__ */ new Set();
9
+ const myVersionMatch = ownVersion.match(re);
10
+ if (!myVersionMatch) {
11
+ return () => false;
12
+ }
13
+ const ownVersionParsed = {
14
+ major: +myVersionMatch[1],
15
+ minor: +myVersionMatch[2],
16
+ patch: +myVersionMatch[3],
17
+ prerelease: myVersionMatch[4]
18
+ };
19
+ if (ownVersionParsed.prerelease != null) {
20
+ return function isExactmatch(globalVersion) {
21
+ return globalVersion === ownVersion;
22
+ };
23
+ }
24
+ function _reject(v) {
25
+ rejectedVersions.add(v);
26
+ return false;
27
+ }
28
+ function _accept(v) {
29
+ acceptedVersions.add(v);
30
+ return true;
31
+ }
32
+ return function isCompatible2(globalVersion) {
33
+ if (acceptedVersions.has(globalVersion)) {
34
+ return true;
35
+ }
36
+ if (rejectedVersions.has(globalVersion)) {
37
+ return false;
38
+ }
39
+ const globalVersionMatch = globalVersion.match(re);
40
+ if (!globalVersionMatch) {
41
+ return _reject(globalVersion);
42
+ }
43
+ const globalVersionParsed = {
44
+ major: +globalVersionMatch[1],
45
+ minor: +globalVersionMatch[2],
46
+ patch: +globalVersionMatch[3],
47
+ prerelease: globalVersionMatch[4]
48
+ };
49
+ if (globalVersionParsed.prerelease != null) {
50
+ return _reject(globalVersion);
51
+ }
52
+ if (ownVersionParsed.major !== globalVersionParsed.major) {
53
+ return _reject(globalVersion);
54
+ }
55
+ if (ownVersionParsed.major === 0) {
56
+ if (ownVersionParsed.minor === globalVersionParsed.minor && ownVersionParsed.patch <= globalVersionParsed.patch) {
57
+ return _accept(globalVersion);
58
+ }
59
+ return _reject(globalVersion);
60
+ }
61
+ if (ownVersionParsed.minor <= globalVersionParsed.minor) {
62
+ return _accept(globalVersion);
63
+ }
64
+ return _reject(globalVersion);
65
+ };
66
+ }
67
+ var isCompatible = _makeCompatibilityCheck(VERSION);
68
+
69
+ // ../../node_modules/@opentelemetry/api/build/esm/internal/global-utils.js
70
+ var major = VERSION.split(".")[0];
71
+ var GLOBAL_OPENTELEMETRY_API_KEY = Symbol.for(`opentelemetry.js.api.${major}`);
72
+ var _global = typeof globalThis === "object" ? globalThis : typeof self === "object" ? self : typeof window === "object" ? window : typeof global === "object" ? global : {};
73
+ function registerGlobal(type, instance, diag3, allowOverride = false) {
74
+ var _a;
75
+ const api = _global[GLOBAL_OPENTELEMETRY_API_KEY] = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) !== null && _a !== void 0 ? _a : {
76
+ version: VERSION
77
+ };
78
+ if (!allowOverride && api[type]) {
79
+ const err = new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${type}`);
80
+ diag3.error(err.stack || err.message);
81
+ return false;
82
+ }
83
+ if (api.version !== VERSION) {
84
+ const err = new Error(`@opentelemetry/api: Registration of version v${api.version} for ${type} does not match previously registered API v${VERSION}`);
85
+ diag3.error(err.stack || err.message);
86
+ return false;
87
+ }
88
+ api[type] = instance;
89
+ diag3.debug(`@opentelemetry/api: Registered a global for ${type} v${VERSION}.`);
90
+ return true;
91
+ }
92
+ function getGlobal(type) {
93
+ var _a, _b;
94
+ const globalVersion = (_a = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _a === void 0 ? void 0 : _a.version;
95
+ if (!globalVersion || !isCompatible(globalVersion)) {
96
+ return;
97
+ }
98
+ return (_b = _global[GLOBAL_OPENTELEMETRY_API_KEY]) === null || _b === void 0 ? void 0 : _b[type];
99
+ }
100
+ function unregisterGlobal(type, diag3) {
101
+ diag3.debug(`@opentelemetry/api: Unregistering a global for ${type} v${VERSION}.`);
102
+ const api = _global[GLOBAL_OPENTELEMETRY_API_KEY];
103
+ if (api) {
104
+ delete api[type];
105
+ }
106
+ }
107
+
108
+ // ../../node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
109
+ var DiagComponentLogger = class {
110
+ constructor(props) {
111
+ this._namespace = props.namespace || "DiagComponentLogger";
112
+ }
113
+ debug(...args) {
114
+ return logProxy("debug", this._namespace, args);
115
+ }
116
+ error(...args) {
117
+ return logProxy("error", this._namespace, args);
118
+ }
119
+ info(...args) {
120
+ return logProxy("info", this._namespace, args);
121
+ }
122
+ warn(...args) {
123
+ return logProxy("warn", this._namespace, args);
124
+ }
125
+ verbose(...args) {
126
+ return logProxy("verbose", this._namespace, args);
127
+ }
128
+ };
129
+ function logProxy(funcName, namespace, args) {
130
+ const logger = getGlobal("diag");
131
+ if (!logger) {
132
+ return;
133
+ }
134
+ return logger[funcName](namespace, ...args);
135
+ }
136
+
137
+ // ../../node_modules/@opentelemetry/api/build/esm/diag/types.js
138
+ var DiagLogLevel;
139
+ (function(DiagLogLevel2) {
140
+ DiagLogLevel2[DiagLogLevel2["NONE"] = 0] = "NONE";
141
+ DiagLogLevel2[DiagLogLevel2["ERROR"] = 30] = "ERROR";
142
+ DiagLogLevel2[DiagLogLevel2["WARN"] = 50] = "WARN";
143
+ DiagLogLevel2[DiagLogLevel2["INFO"] = 60] = "INFO";
144
+ DiagLogLevel2[DiagLogLevel2["DEBUG"] = 70] = "DEBUG";
145
+ DiagLogLevel2[DiagLogLevel2["VERBOSE"] = 80] = "VERBOSE";
146
+ DiagLogLevel2[DiagLogLevel2["ALL"] = 9999] = "ALL";
147
+ })(DiagLogLevel || (DiagLogLevel = {}));
148
+
149
+ // ../../node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
150
+ function createLogLevelDiagLogger(maxLevel, logger) {
151
+ if (maxLevel < DiagLogLevel.NONE) {
152
+ maxLevel = DiagLogLevel.NONE;
153
+ } else if (maxLevel > DiagLogLevel.ALL) {
154
+ maxLevel = DiagLogLevel.ALL;
155
+ }
156
+ logger = logger || {};
157
+ function _filterFunc(funcName, theLevel) {
158
+ const theFunc = logger[funcName];
159
+ if (typeof theFunc === "function" && maxLevel >= theLevel) {
160
+ return theFunc.bind(logger);
161
+ }
162
+ return function() {
163
+ };
164
+ }
165
+ return {
166
+ error: _filterFunc("error", DiagLogLevel.ERROR),
167
+ warn: _filterFunc("warn", DiagLogLevel.WARN),
168
+ info: _filterFunc("info", DiagLogLevel.INFO),
169
+ debug: _filterFunc("debug", DiagLogLevel.DEBUG),
170
+ verbose: _filterFunc("verbose", DiagLogLevel.VERBOSE)
171
+ };
172
+ }
173
+
174
+ // ../../node_modules/@opentelemetry/api/build/esm/api/diag.js
175
+ var API_NAME = "diag";
176
+ var DiagAPI = class _DiagAPI {
177
+ /** Get the singleton instance of the DiagAPI API */
178
+ static instance() {
179
+ if (!this._instance) {
180
+ this._instance = new _DiagAPI();
181
+ }
182
+ return this._instance;
183
+ }
184
+ /**
185
+ * Private internal constructor
186
+ * @private
187
+ */
188
+ constructor() {
189
+ function _logProxy(funcName) {
190
+ return function(...args) {
191
+ const logger = getGlobal("diag");
192
+ if (!logger)
193
+ return;
194
+ return logger[funcName](...args);
195
+ };
196
+ }
197
+ const self2 = this;
198
+ const setLogger = (logger, optionsOrLogLevel = { logLevel: DiagLogLevel.INFO }) => {
199
+ var _a, _b, _c;
200
+ if (logger === self2) {
201
+ const err = new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
202
+ self2.error((_a = err.stack) !== null && _a !== void 0 ? _a : err.message);
203
+ return false;
204
+ }
205
+ if (typeof optionsOrLogLevel === "number") {
206
+ optionsOrLogLevel = {
207
+ logLevel: optionsOrLogLevel
208
+ };
209
+ }
210
+ const oldLogger = getGlobal("diag");
211
+ const newLogger = createLogLevelDiagLogger((_b = optionsOrLogLevel.logLevel) !== null && _b !== void 0 ? _b : DiagLogLevel.INFO, logger);
212
+ if (oldLogger && !optionsOrLogLevel.suppressOverrideMessage) {
213
+ const stack = (_c = new Error().stack) !== null && _c !== void 0 ? _c : "<failed to generate stacktrace>";
214
+ oldLogger.warn(`Current logger will be overwritten from ${stack}`);
215
+ newLogger.warn(`Current logger will overwrite one already registered from ${stack}`);
216
+ }
217
+ return registerGlobal("diag", newLogger, self2, true);
218
+ };
219
+ self2.setLogger = setLogger;
220
+ self2.disable = () => {
221
+ unregisterGlobal(API_NAME, self2);
222
+ };
223
+ self2.createComponentLogger = (options) => {
224
+ return new DiagComponentLogger(options);
225
+ };
226
+ self2.verbose = _logProxy("verbose");
227
+ self2.debug = _logProxy("debug");
228
+ self2.info = _logProxy("info");
229
+ self2.warn = _logProxy("warn");
230
+ self2.error = _logProxy("error");
231
+ }
232
+ };
233
+
234
+ // ../../node_modules/@opentelemetry/api/build/esm/diag-api.js
235
+ var diag = DiagAPI.instance();
236
+
237
+ // ../../node_modules/@opentelemetry/api/build/esm/baggage/internal/baggage-impl.js
238
+ var BaggageImpl = class _BaggageImpl {
239
+ constructor(entries) {
240
+ this._entries = entries ? new Map(entries) : /* @__PURE__ */ new Map();
241
+ }
242
+ getEntry(key) {
243
+ const entry = this._entries.get(key);
244
+ if (!entry) {
245
+ return void 0;
246
+ }
247
+ return Object.assign({}, entry);
248
+ }
249
+ getAllEntries() {
250
+ return Array.from(this._entries.entries());
251
+ }
252
+ setEntry(key, entry) {
253
+ const newBaggage = new _BaggageImpl(this._entries);
254
+ newBaggage._entries.set(key, entry);
255
+ return newBaggage;
256
+ }
257
+ removeEntry(key) {
258
+ const newBaggage = new _BaggageImpl(this._entries);
259
+ newBaggage._entries.delete(key);
260
+ return newBaggage;
261
+ }
262
+ removeEntries(...keys) {
263
+ const newBaggage = new _BaggageImpl(this._entries);
264
+ for (const key of keys) {
265
+ newBaggage._entries.delete(key);
266
+ }
267
+ return newBaggage;
268
+ }
269
+ clear() {
270
+ return new _BaggageImpl();
271
+ }
272
+ };
273
+
274
+ // ../../node_modules/@opentelemetry/api/build/esm/baggage/internal/symbol.js
275
+ var baggageEntryMetadataSymbol = Symbol("BaggageEntryMetadata");
276
+
277
+ // ../../node_modules/@opentelemetry/api/build/esm/baggage/utils.js
278
+ var diag2 = DiagAPI.instance();
279
+ function createBaggage(entries = {}) {
280
+ return new BaggageImpl(new Map(Object.entries(entries)));
281
+ }
282
+ function baggageEntryMetadataFromString(str) {
283
+ if (typeof str !== "string") {
284
+ diag2.error(`Cannot create baggage metadata from unknown type: ${typeof str}`);
285
+ str = "";
286
+ }
287
+ return {
288
+ __TYPE__: baggageEntryMetadataSymbol,
289
+ toString() {
290
+ return str;
291
+ }
292
+ };
293
+ }
294
+
295
+ // ../../node_modules/@opentelemetry/api/build/esm/context/context.js
296
+ function createContextKey(description) {
297
+ return Symbol.for(description);
298
+ }
299
+ var BaseContext = class _BaseContext {
300
+ /**
301
+ * Construct a new context which inherits values from an optional parent context.
302
+ *
303
+ * @param parentContext a context from which to inherit values
304
+ */
305
+ constructor(parentContext) {
306
+ const self2 = this;
307
+ self2._currentContext = parentContext ? new Map(parentContext) : /* @__PURE__ */ new Map();
308
+ self2.getValue = (key) => self2._currentContext.get(key);
309
+ self2.setValue = (key, value) => {
310
+ const context2 = new _BaseContext(self2._currentContext);
311
+ context2._currentContext.set(key, value);
312
+ return context2;
313
+ };
314
+ self2.deleteValue = (key) => {
315
+ const context2 = new _BaseContext(self2._currentContext);
316
+ context2._currentContext.delete(key);
317
+ return context2;
318
+ };
319
+ }
320
+ };
321
+ var ROOT_CONTEXT = new BaseContext();
322
+
323
+ // ../../node_modules/@opentelemetry/api/build/esm/metrics/NoopMeter.js
324
+ var NoopMeter = class {
325
+ constructor() {
326
+ }
327
+ /**
328
+ * @see {@link Meter.createGauge}
329
+ */
330
+ createGauge(_name, _options) {
331
+ return NOOP_GAUGE_METRIC;
332
+ }
333
+ /**
334
+ * @see {@link Meter.createHistogram}
335
+ */
336
+ createHistogram(_name, _options) {
337
+ return NOOP_HISTOGRAM_METRIC;
338
+ }
339
+ /**
340
+ * @see {@link Meter.createCounter}
341
+ */
342
+ createCounter(_name, _options) {
343
+ return NOOP_COUNTER_METRIC;
344
+ }
345
+ /**
346
+ * @see {@link Meter.createUpDownCounter}
347
+ */
348
+ createUpDownCounter(_name, _options) {
349
+ return NOOP_UP_DOWN_COUNTER_METRIC;
350
+ }
351
+ /**
352
+ * @see {@link Meter.createObservableGauge}
353
+ */
354
+ createObservableGauge(_name, _options) {
355
+ return NOOP_OBSERVABLE_GAUGE_METRIC;
356
+ }
357
+ /**
358
+ * @see {@link Meter.createObservableCounter}
359
+ */
360
+ createObservableCounter(_name, _options) {
361
+ return NOOP_OBSERVABLE_COUNTER_METRIC;
362
+ }
363
+ /**
364
+ * @see {@link Meter.createObservableUpDownCounter}
365
+ */
366
+ createObservableUpDownCounter(_name, _options) {
367
+ return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
368
+ }
369
+ /**
370
+ * @see {@link Meter.addBatchObservableCallback}
371
+ */
372
+ addBatchObservableCallback(_callback, _observables) {
373
+ }
374
+ /**
375
+ * @see {@link Meter.removeBatchObservableCallback}
376
+ */
377
+ removeBatchObservableCallback(_callback) {
378
+ }
379
+ };
380
+ var NoopMetric = class {
381
+ };
382
+ var NoopCounterMetric = class extends NoopMetric {
383
+ add(_value, _attributes) {
384
+ }
385
+ };
386
+ var NoopUpDownCounterMetric = class extends NoopMetric {
387
+ add(_value, _attributes) {
388
+ }
389
+ };
390
+ var NoopGaugeMetric = class extends NoopMetric {
391
+ record(_value, _attributes) {
392
+ }
393
+ };
394
+ var NoopHistogramMetric = class extends NoopMetric {
395
+ record(_value, _attributes) {
396
+ }
397
+ };
398
+ var NoopObservableMetric = class {
399
+ addCallback(_callback) {
400
+ }
401
+ removeCallback(_callback) {
402
+ }
403
+ };
404
+ var NoopObservableCounterMetric = class extends NoopObservableMetric {
405
+ };
406
+ var NoopObservableGaugeMetric = class extends NoopObservableMetric {
407
+ };
408
+ var NoopObservableUpDownCounterMetric = class extends NoopObservableMetric {
409
+ };
410
+ var NOOP_METER = new NoopMeter();
411
+ var NOOP_COUNTER_METRIC = new NoopCounterMetric();
412
+ var NOOP_GAUGE_METRIC = new NoopGaugeMetric();
413
+ var NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
414
+ var NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();
415
+ var NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();
416
+ var NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();
417
+ var NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();
418
+ function createNoopMeter() {
419
+ return NOOP_METER;
420
+ }
421
+
422
+ // ../../node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js
423
+ var defaultTextMapGetter = {
424
+ get(carrier, key) {
425
+ if (carrier == null) {
426
+ return void 0;
427
+ }
428
+ return carrier[key];
429
+ },
430
+ keys(carrier) {
431
+ if (carrier == null) {
432
+ return [];
433
+ }
434
+ return Object.keys(carrier);
435
+ }
436
+ };
437
+ var defaultTextMapSetter = {
438
+ set(carrier, key, value) {
439
+ if (carrier == null) {
440
+ return;
441
+ }
442
+ carrier[key] = value;
443
+ }
444
+ };
445
+
446
+ // ../../node_modules/@opentelemetry/api/build/esm/context/NoopContextManager.js
447
+ var NoopContextManager = class {
448
+ active() {
449
+ return ROOT_CONTEXT;
450
+ }
451
+ with(_context, fn, thisArg, ...args) {
452
+ return fn.call(thisArg, ...args);
453
+ }
454
+ bind(_context, target) {
455
+ return target;
456
+ }
457
+ enable() {
458
+ return this;
459
+ }
460
+ disable() {
461
+ return this;
462
+ }
463
+ };
464
+
465
+ // ../../node_modules/@opentelemetry/api/build/esm/api/context.js
466
+ var API_NAME2 = "context";
467
+ var NOOP_CONTEXT_MANAGER = new NoopContextManager();
468
+ var ContextAPI = class _ContextAPI {
469
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
470
+ constructor() {
471
+ }
472
+ /** Get the singleton instance of the Context API */
473
+ static getInstance() {
474
+ if (!this._instance) {
475
+ this._instance = new _ContextAPI();
476
+ }
477
+ return this._instance;
478
+ }
479
+ /**
480
+ * Set the current context manager.
481
+ *
482
+ * @returns true if the context manager was successfully registered, else false
483
+ */
484
+ setGlobalContextManager(contextManager) {
485
+ return registerGlobal(API_NAME2, contextManager, DiagAPI.instance());
486
+ }
487
+ /**
488
+ * Get the currently active context
489
+ */
490
+ active() {
491
+ return this._getContextManager().active();
492
+ }
493
+ /**
494
+ * Execute a function with an active context
495
+ *
496
+ * @param context context to be active during function execution
497
+ * @param fn function to execute in a context
498
+ * @param thisArg optional receiver to be used for calling fn
499
+ * @param args optional arguments forwarded to fn
500
+ */
501
+ with(context2, fn, thisArg, ...args) {
502
+ return this._getContextManager().with(context2, fn, thisArg, ...args);
503
+ }
504
+ /**
505
+ * Bind a context to a target function or event emitter
506
+ *
507
+ * @param context context to bind to the event emitter or function. Defaults to the currently active context
508
+ * @param target function or event emitter to bind
509
+ */
510
+ bind(context2, target) {
511
+ return this._getContextManager().bind(context2, target);
512
+ }
513
+ _getContextManager() {
514
+ return getGlobal(API_NAME2) || NOOP_CONTEXT_MANAGER;
515
+ }
516
+ /** Disable and remove the global context manager */
517
+ disable() {
518
+ this._getContextManager().disable();
519
+ unregisterGlobal(API_NAME2, DiagAPI.instance());
520
+ }
521
+ };
522
+
523
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/trace_flags.js
524
+ var TraceFlags;
525
+ (function(TraceFlags2) {
526
+ TraceFlags2[TraceFlags2["NONE"] = 0] = "NONE";
527
+ TraceFlags2[TraceFlags2["SAMPLED"] = 1] = "SAMPLED";
528
+ })(TraceFlags || (TraceFlags = {}));
529
+
530
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/invalid-span-constants.js
531
+ var INVALID_SPANID = "0000000000000000";
532
+ var INVALID_TRACEID = "00000000000000000000000000000000";
533
+ var INVALID_SPAN_CONTEXT = {
534
+ traceId: INVALID_TRACEID,
535
+ spanId: INVALID_SPANID,
536
+ traceFlags: TraceFlags.NONE
537
+ };
538
+
539
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/NonRecordingSpan.js
540
+ var NonRecordingSpan = class {
541
+ constructor(spanContext = INVALID_SPAN_CONTEXT) {
542
+ this._spanContext = spanContext;
543
+ }
544
+ // Returns a SpanContext.
545
+ spanContext() {
546
+ return this._spanContext;
547
+ }
548
+ // By default does nothing
549
+ setAttribute(_key, _value) {
550
+ return this;
551
+ }
552
+ // By default does nothing
553
+ setAttributes(_attributes) {
554
+ return this;
555
+ }
556
+ // By default does nothing
557
+ addEvent(_name, _attributes) {
558
+ return this;
559
+ }
560
+ addLink(_link) {
561
+ return this;
562
+ }
563
+ addLinks(_links) {
564
+ return this;
565
+ }
566
+ // By default does nothing
567
+ setStatus(_status) {
568
+ return this;
569
+ }
570
+ // By default does nothing
571
+ updateName(_name) {
572
+ return this;
573
+ }
574
+ // By default does nothing
575
+ end(_endTime) {
576
+ }
577
+ // isRecording always returns false for NonRecordingSpan.
578
+ isRecording() {
579
+ return false;
580
+ }
581
+ // By default does nothing
582
+ recordException(_exception, _time) {
583
+ }
584
+ };
585
+
586
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/context-utils.js
587
+ var SPAN_KEY = createContextKey("OpenTelemetry Context Key SPAN");
588
+ function getSpan(context2) {
589
+ return context2.getValue(SPAN_KEY) || void 0;
590
+ }
591
+ function getActiveSpan() {
592
+ return getSpan(ContextAPI.getInstance().active());
593
+ }
594
+ function setSpan(context2, span) {
595
+ return context2.setValue(SPAN_KEY, span);
596
+ }
597
+ function deleteSpan(context2) {
598
+ return context2.deleteValue(SPAN_KEY);
599
+ }
600
+ function setSpanContext(context2, spanContext) {
601
+ return setSpan(context2, new NonRecordingSpan(spanContext));
602
+ }
603
+ function getSpanContext(context2) {
604
+ var _a;
605
+ return (_a = getSpan(context2)) === null || _a === void 0 ? void 0 : _a.spanContext();
606
+ }
607
+
608
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
609
+ var isHex = new Uint8Array([
610
+ 0,
611
+ 0,
612
+ 0,
613
+ 0,
614
+ 0,
615
+ 0,
616
+ 0,
617
+ 0,
618
+ 0,
619
+ 0,
620
+ 0,
621
+ 0,
622
+ 0,
623
+ 0,
624
+ 0,
625
+ 0,
626
+ 0,
627
+ 0,
628
+ 0,
629
+ 0,
630
+ 0,
631
+ 0,
632
+ 0,
633
+ 0,
634
+ 0,
635
+ 0,
636
+ 0,
637
+ 0,
638
+ 0,
639
+ 0,
640
+ 0,
641
+ 0,
642
+ 0,
643
+ 0,
644
+ 0,
645
+ 0,
646
+ 0,
647
+ 0,
648
+ 0,
649
+ 0,
650
+ 0,
651
+ 0,
652
+ 0,
653
+ 0,
654
+ 0,
655
+ 0,
656
+ 0,
657
+ 0,
658
+ 1,
659
+ 1,
660
+ 1,
661
+ 1,
662
+ 1,
663
+ 1,
664
+ 1,
665
+ 1,
666
+ 1,
667
+ 1,
668
+ 0,
669
+ 0,
670
+ 0,
671
+ 0,
672
+ 0,
673
+ 0,
674
+ 0,
675
+ 1,
676
+ 1,
677
+ 1,
678
+ 1,
679
+ 1,
680
+ 1,
681
+ 0,
682
+ 0,
683
+ 0,
684
+ 0,
685
+ 0,
686
+ 0,
687
+ 0,
688
+ 0,
689
+ 0,
690
+ 0,
691
+ 0,
692
+ 0,
693
+ 0,
694
+ 0,
695
+ 0,
696
+ 0,
697
+ 0,
698
+ 0,
699
+ 0,
700
+ 0,
701
+ 0,
702
+ 0,
703
+ 0,
704
+ 0,
705
+ 0,
706
+ 0,
707
+ 1,
708
+ 1,
709
+ 1,
710
+ 1,
711
+ 1,
712
+ 1
713
+ ]);
714
+ function isValidHex(id, length) {
715
+ if (typeof id !== "string" || id.length !== length)
716
+ return false;
717
+ let r = 0;
718
+ for (let i = 0; i < id.length; i += 4) {
719
+ r += (isHex[id.charCodeAt(i)] | 0) + (isHex[id.charCodeAt(i + 1)] | 0) + (isHex[id.charCodeAt(i + 2)] | 0) + (isHex[id.charCodeAt(i + 3)] | 0);
720
+ }
721
+ return r === length;
722
+ }
723
+ function isValidTraceId(traceId) {
724
+ return isValidHex(traceId, 32) && traceId !== INVALID_TRACEID;
725
+ }
726
+ function isValidSpanId(spanId) {
727
+ return isValidHex(spanId, 16) && spanId !== INVALID_SPANID;
728
+ }
729
+ function isSpanContextValid(spanContext) {
730
+ return isValidTraceId(spanContext.traceId) && isValidSpanId(spanContext.spanId);
731
+ }
732
+ function wrapSpanContext(spanContext) {
733
+ return new NonRecordingSpan(spanContext);
734
+ }
735
+
736
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js
737
+ var contextApi = ContextAPI.getInstance();
738
+ var NoopTracer = class {
739
+ // startSpan starts a noop span.
740
+ startSpan(name, options, context2 = contextApi.active()) {
741
+ const root = Boolean(options === null || options === void 0 ? void 0 : options.root);
742
+ if (root) {
743
+ return new NonRecordingSpan();
744
+ }
745
+ const parentFromContext = context2 && getSpanContext(context2);
746
+ if (isSpanContext(parentFromContext) && isSpanContextValid(parentFromContext)) {
747
+ return new NonRecordingSpan(parentFromContext);
748
+ } else {
749
+ return new NonRecordingSpan();
750
+ }
751
+ }
752
+ startActiveSpan(name, arg2, arg3, arg4) {
753
+ let opts;
754
+ let ctx;
755
+ let fn;
756
+ if (arguments.length < 2) {
757
+ return;
758
+ } else if (arguments.length === 2) {
759
+ fn = arg2;
760
+ } else if (arguments.length === 3) {
761
+ opts = arg2;
762
+ fn = arg3;
763
+ } else {
764
+ opts = arg2;
765
+ ctx = arg3;
766
+ fn = arg4;
767
+ }
768
+ const parentContext = ctx !== null && ctx !== void 0 ? ctx : contextApi.active();
769
+ const span = this.startSpan(name, opts, parentContext);
770
+ const contextWithSpanSet = setSpan(parentContext, span);
771
+ return contextApi.with(contextWithSpanSet, fn, void 0, span);
772
+ }
773
+ };
774
+ function isSpanContext(spanContext) {
775
+ return spanContext !== null && typeof spanContext === "object" && "spanId" in spanContext && typeof spanContext["spanId"] === "string" && "traceId" in spanContext && typeof spanContext["traceId"] === "string" && "traceFlags" in spanContext && typeof spanContext["traceFlags"] === "number";
776
+ }
777
+
778
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js
779
+ var NOOP_TRACER = new NoopTracer();
780
+ var ProxyTracer = class {
781
+ constructor(provider, name, version, options) {
782
+ this._provider = provider;
783
+ this.name = name;
784
+ this.version = version;
785
+ this.options = options;
786
+ }
787
+ startSpan(name, options, context2) {
788
+ return this._getTracer().startSpan(name, options, context2);
789
+ }
790
+ startActiveSpan(_name, _options, _context, _fn) {
791
+ const tracer = this._getTracer();
792
+ return Reflect.apply(tracer.startActiveSpan, tracer, arguments);
793
+ }
794
+ /**
795
+ * Try to get a tracer from the proxy tracer provider.
796
+ * If the proxy tracer provider has no delegate, return a noop tracer.
797
+ */
798
+ _getTracer() {
799
+ if (this._delegate) {
800
+ return this._delegate;
801
+ }
802
+ const tracer = this._provider.getDelegateTracer(this.name, this.version, this.options);
803
+ if (!tracer) {
804
+ return NOOP_TRACER;
805
+ }
806
+ this._delegate = tracer;
807
+ return this._delegate;
808
+ }
809
+ };
810
+
811
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/NoopTracerProvider.js
812
+ var NoopTracerProvider = class {
813
+ getTracer(_name, _version, _options) {
814
+ return new NoopTracer();
815
+ }
816
+ };
817
+
818
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/ProxyTracerProvider.js
819
+ var NOOP_TRACER_PROVIDER = new NoopTracerProvider();
820
+ var ProxyTracerProvider = class {
821
+ /**
822
+ * Get a {@link ProxyTracer}
823
+ */
824
+ getTracer(name, version, options) {
825
+ var _a;
826
+ return (_a = this.getDelegateTracer(name, version, options)) !== null && _a !== void 0 ? _a : new ProxyTracer(this, name, version, options);
827
+ }
828
+ getDelegate() {
829
+ var _a;
830
+ return (_a = this._delegate) !== null && _a !== void 0 ? _a : NOOP_TRACER_PROVIDER;
831
+ }
832
+ /**
833
+ * Set the delegate tracer provider
834
+ */
835
+ setDelegate(delegate) {
836
+ this._delegate = delegate;
837
+ }
838
+ getDelegateTracer(name, version, options) {
839
+ var _a;
840
+ return (_a = this._delegate) === null || _a === void 0 ? void 0 : _a.getTracer(name, version, options);
841
+ }
842
+ };
843
+
844
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/SamplingResult.js
845
+ var SamplingDecision;
846
+ (function(SamplingDecision2) {
847
+ SamplingDecision2[SamplingDecision2["NOT_RECORD"] = 0] = "NOT_RECORD";
848
+ SamplingDecision2[SamplingDecision2["RECORD"] = 1] = "RECORD";
849
+ SamplingDecision2[SamplingDecision2["RECORD_AND_SAMPLED"] = 2] = "RECORD_AND_SAMPLED";
850
+ })(SamplingDecision || (SamplingDecision = {}));
851
+
852
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/span_kind.js
853
+ var SpanKind;
854
+ (function(SpanKind2) {
855
+ SpanKind2[SpanKind2["INTERNAL"] = 0] = "INTERNAL";
856
+ SpanKind2[SpanKind2["SERVER"] = 1] = "SERVER";
857
+ SpanKind2[SpanKind2["CLIENT"] = 2] = "CLIENT";
858
+ SpanKind2[SpanKind2["PRODUCER"] = 3] = "PRODUCER";
859
+ SpanKind2[SpanKind2["CONSUMER"] = 4] = "CONSUMER";
860
+ })(SpanKind || (SpanKind = {}));
861
+
862
+ // ../../node_modules/@opentelemetry/api/build/esm/trace/status.js
863
+ var SpanStatusCode;
864
+ (function(SpanStatusCode2) {
865
+ SpanStatusCode2[SpanStatusCode2["UNSET"] = 0] = "UNSET";
866
+ SpanStatusCode2[SpanStatusCode2["OK"] = 1] = "OK";
867
+ SpanStatusCode2[SpanStatusCode2["ERROR"] = 2] = "ERROR";
868
+ })(SpanStatusCode || (SpanStatusCode = {}));
869
+
870
+ // ../../node_modules/@opentelemetry/api/build/esm/context-api.js
871
+ var context = ContextAPI.getInstance();
872
+
873
+ // ../../node_modules/@opentelemetry/api/build/esm/metrics/NoopMeterProvider.js
874
+ var NoopMeterProvider = class {
875
+ getMeter(_name, _version, _options) {
876
+ return NOOP_METER;
877
+ }
878
+ };
879
+ var NOOP_METER_PROVIDER = new NoopMeterProvider();
880
+
881
+ // ../../node_modules/@opentelemetry/api/build/esm/api/metrics.js
882
+ var API_NAME3 = "metrics";
883
+ var MetricsAPI = class _MetricsAPI {
884
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
885
+ constructor() {
886
+ }
887
+ /** Get the singleton instance of the Metrics API */
888
+ static getInstance() {
889
+ if (!this._instance) {
890
+ this._instance = new _MetricsAPI();
891
+ }
892
+ return this._instance;
893
+ }
894
+ /**
895
+ * Set the current global meter provider.
896
+ * Returns true if the meter provider was successfully registered, else false.
897
+ */
898
+ setGlobalMeterProvider(provider) {
899
+ return registerGlobal(API_NAME3, provider, DiagAPI.instance());
900
+ }
901
+ /**
902
+ * Returns the global meter provider.
903
+ */
904
+ getMeterProvider() {
905
+ return getGlobal(API_NAME3) || NOOP_METER_PROVIDER;
906
+ }
907
+ /**
908
+ * Returns a meter from the global meter provider.
909
+ */
910
+ getMeter(name, version, options) {
911
+ return this.getMeterProvider().getMeter(name, version, options);
912
+ }
913
+ /** Remove the global meter provider */
914
+ disable() {
915
+ unregisterGlobal(API_NAME3, DiagAPI.instance());
916
+ }
917
+ };
918
+
919
+ // ../../node_modules/@opentelemetry/api/build/esm/metrics-api.js
920
+ var metrics = MetricsAPI.getInstance();
921
+
922
+ // ../../node_modules/@opentelemetry/api/build/esm/propagation/NoopTextMapPropagator.js
923
+ var NoopTextMapPropagator = class {
924
+ /** Noop inject function does nothing */
925
+ inject(_context, _carrier) {
926
+ }
927
+ /** Noop extract function does nothing and returns the input context */
928
+ extract(context2, _carrier) {
929
+ return context2;
930
+ }
931
+ fields() {
932
+ return [];
933
+ }
934
+ };
935
+
936
+ // ../../node_modules/@opentelemetry/api/build/esm/baggage/context-helpers.js
937
+ var BAGGAGE_KEY = createContextKey("OpenTelemetry Baggage Key");
938
+ function getBaggage(context2) {
939
+ return context2.getValue(BAGGAGE_KEY) || void 0;
940
+ }
941
+ function getActiveBaggage() {
942
+ return getBaggage(ContextAPI.getInstance().active());
943
+ }
944
+ function setBaggage(context2, baggage) {
945
+ return context2.setValue(BAGGAGE_KEY, baggage);
946
+ }
947
+ function deleteBaggage(context2) {
948
+ return context2.deleteValue(BAGGAGE_KEY);
949
+ }
950
+
951
+ // ../../node_modules/@opentelemetry/api/build/esm/api/propagation.js
952
+ var API_NAME4 = "propagation";
953
+ var NOOP_TEXT_MAP_PROPAGATOR = new NoopTextMapPropagator();
954
+ var PropagationAPI = class _PropagationAPI {
955
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
956
+ constructor() {
957
+ this.createBaggage = createBaggage;
958
+ this.getBaggage = getBaggage;
959
+ this.getActiveBaggage = getActiveBaggage;
960
+ this.setBaggage = setBaggage;
961
+ this.deleteBaggage = deleteBaggage;
962
+ }
963
+ /** Get the singleton instance of the Propagator API */
964
+ static getInstance() {
965
+ if (!this._instance) {
966
+ this._instance = new _PropagationAPI();
967
+ }
968
+ return this._instance;
969
+ }
970
+ /**
971
+ * Set the current propagator.
972
+ *
973
+ * @returns true if the propagator was successfully registered, else false
974
+ */
975
+ setGlobalPropagator(propagator) {
976
+ return registerGlobal(API_NAME4, propagator, DiagAPI.instance());
977
+ }
978
+ /**
979
+ * Inject context into a carrier to be propagated inter-process
980
+ *
981
+ * @param context Context carrying tracing data to inject
982
+ * @param carrier carrier to inject context into
983
+ * @param setter Function used to set values on the carrier
984
+ */
985
+ inject(context2, carrier, setter = defaultTextMapSetter) {
986
+ return this._getGlobalPropagator().inject(context2, carrier, setter);
987
+ }
988
+ /**
989
+ * Extract context from a carrier
990
+ *
991
+ * @param context Context which the newly created context will inherit from
992
+ * @param carrier Carrier to extract context from
993
+ * @param getter Function used to extract keys from a carrier
994
+ */
995
+ extract(context2, carrier, getter = defaultTextMapGetter) {
996
+ return this._getGlobalPropagator().extract(context2, carrier, getter);
997
+ }
998
+ /**
999
+ * Return a list of all fields which may be used by the propagator.
1000
+ */
1001
+ fields() {
1002
+ return this._getGlobalPropagator().fields();
1003
+ }
1004
+ /** Remove the global propagator */
1005
+ disable() {
1006
+ unregisterGlobal(API_NAME4, DiagAPI.instance());
1007
+ }
1008
+ _getGlobalPropagator() {
1009
+ return getGlobal(API_NAME4) || NOOP_TEXT_MAP_PROPAGATOR;
1010
+ }
1011
+ };
1012
+
1013
+ // ../../node_modules/@opentelemetry/api/build/esm/propagation-api.js
1014
+ var propagation = PropagationAPI.getInstance();
1015
+
1016
+ // ../../node_modules/@opentelemetry/api/build/esm/api/trace.js
1017
+ var API_NAME5 = "trace";
1018
+ var TraceAPI = class _TraceAPI {
1019
+ /** Empty private constructor prevents end users from constructing a new instance of the API */
1020
+ constructor() {
1021
+ this._proxyTracerProvider = new ProxyTracerProvider();
1022
+ this.wrapSpanContext = wrapSpanContext;
1023
+ this.isSpanContextValid = isSpanContextValid;
1024
+ this.deleteSpan = deleteSpan;
1025
+ this.getSpan = getSpan;
1026
+ this.getActiveSpan = getActiveSpan;
1027
+ this.getSpanContext = getSpanContext;
1028
+ this.setSpan = setSpan;
1029
+ this.setSpanContext = setSpanContext;
1030
+ }
1031
+ /** Get the singleton instance of the Trace API */
1032
+ static getInstance() {
1033
+ if (!this._instance) {
1034
+ this._instance = new _TraceAPI();
1035
+ }
1036
+ return this._instance;
1037
+ }
1038
+ /**
1039
+ * Set the current global tracer.
1040
+ *
1041
+ * @returns true if the tracer provider was successfully registered, else false
1042
+ */
1043
+ setGlobalTracerProvider(provider) {
1044
+ const success = registerGlobal(API_NAME5, this._proxyTracerProvider, DiagAPI.instance());
1045
+ if (success) {
1046
+ this._proxyTracerProvider.setDelegate(provider);
1047
+ }
1048
+ return success;
1049
+ }
1050
+ /**
1051
+ * Returns the global tracer provider.
1052
+ */
1053
+ getTracerProvider() {
1054
+ return getGlobal(API_NAME5) || this._proxyTracerProvider;
1055
+ }
1056
+ /**
1057
+ * Returns a tracer from the global tracer provider.
1058
+ */
1059
+ getTracer(name, version) {
1060
+ return this.getTracerProvider().getTracer(name, version);
1061
+ }
1062
+ /** Remove the global tracer provider */
1063
+ disable() {
1064
+ unregisterGlobal(API_NAME5, DiagAPI.instance());
1065
+ this._proxyTracerProvider = new ProxyTracerProvider();
1066
+ }
1067
+ };
1068
+
1069
+ // ../../node_modules/@opentelemetry/api/build/esm/trace-api.js
1070
+ var trace = TraceAPI.getInstance();
1071
+
1072
+ export {
1073
+ DiagLogLevel,
1074
+ baggageEntryMetadataFromString,
1075
+ createContextKey,
1076
+ ROOT_CONTEXT,
1077
+ createNoopMeter,
1078
+ TraceFlags,
1079
+ INVALID_TRACEID,
1080
+ INVALID_SPAN_CONTEXT,
1081
+ isValidTraceId,
1082
+ isSpanContextValid,
1083
+ SamplingDecision,
1084
+ SpanKind,
1085
+ SpanStatusCode,
1086
+ context,
1087
+ diag,
1088
+ metrics,
1089
+ propagation,
1090
+ trace
1091
+ };
1092
+ //# sourceMappingURL=chunk-BSHFIPEX.js.map