@8wave/ai-elements 0.103.0-beta.4 → 0.103.0-beta.5

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,3272 @@
1
+ //#region ../../node_modules/.pnpm/@opentelemetry+semantic-conventions@1.43.0/node_modules/@opentelemetry/semantic-conventions/build/esm/stable_attributes.js
2
+ var e = "error.type", t = "exception.message", n = "exception.type", r = "service.name", i = "telemetry.sdk.language", a = "webjs", o = "telemetry.sdk.name", s = "telemetry.sdk.version", c = "url.full", l = "1.9.1", u = /^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;
3
+ function ee(e) {
4
+ let t = /* @__PURE__ */ new Set([e]), n = /* @__PURE__ */ new Set(), r = e.match(u);
5
+ if (!r) return () => !1;
6
+ let i = {
7
+ major: +r[1],
8
+ minor: +r[2],
9
+ patch: +r[3],
10
+ prerelease: r[4]
11
+ };
12
+ if (i.prerelease != null) return function(t) {
13
+ return t === e;
14
+ };
15
+ function a(e) {
16
+ return n.add(e), !1;
17
+ }
18
+ function o(e) {
19
+ return t.add(e), !0;
20
+ }
21
+ return function(e) {
22
+ if (t.has(e)) return !0;
23
+ if (n.has(e)) return !1;
24
+ let r = e.match(u);
25
+ if (!r) return a(e);
26
+ let s = {
27
+ major: +r[1],
28
+ minor: +r[2],
29
+ patch: +r[3],
30
+ prerelease: r[4]
31
+ };
32
+ return s.prerelease != null || i.major !== s.major ? a(e) : i.major === 0 ? i.minor === s.minor && i.patch <= s.patch ? o(e) : a(e) : i.minor <= s.minor ? o(e) : a(e);
33
+ };
34
+ }
35
+ var d = ee(l), te = l.split(".")[0], f = Symbol.for(`opentelemetry.js.api.${te}`), p = typeof globalThis == "object" ? globalThis : typeof self == "object" ? self : typeof window == "object" ? window : typeof global == "object" ? global : {};
36
+ function m(e, t, n, r = !1) {
37
+ let i = p[f] = p[f] ?? { version: l };
38
+ if (!r && i[e]) {
39
+ let t = /* @__PURE__ */ Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);
40
+ return n.error(t.stack || t.message), !1;
41
+ }
42
+ if (i.version !== "1.9.1") {
43
+ let t = /* @__PURE__ */ Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${l}`);
44
+ return n.error(t.stack || t.message), !1;
45
+ }
46
+ return i[e] = t, n.debug(`@opentelemetry/api: Registered a global for ${e} v${l}.`), !0;
47
+ }
48
+ function h(e) {
49
+ let t = p[f]?.version;
50
+ if (!(!t || !d(t))) return p[f]?.[e];
51
+ }
52
+ function g(e, t) {
53
+ t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${l}.`);
54
+ let n = p[f];
55
+ n && delete n[e];
56
+ }
57
+ //#endregion
58
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/ComponentLogger.js
59
+ var ne = class {
60
+ constructor(e) {
61
+ this._namespace = e.namespace || "DiagComponentLogger";
62
+ }
63
+ debug(...e) {
64
+ return _("debug", this._namespace, e);
65
+ }
66
+ error(...e) {
67
+ return _("error", this._namespace, e);
68
+ }
69
+ info(...e) {
70
+ return _("info", this._namespace, e);
71
+ }
72
+ warn(...e) {
73
+ return _("warn", this._namespace, e);
74
+ }
75
+ verbose(...e) {
76
+ return _("verbose", this._namespace, e);
77
+ }
78
+ };
79
+ function _(e, t, n) {
80
+ let r = h("diag");
81
+ if (r) return r[e](t, ...n);
82
+ }
83
+ //#endregion
84
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/types.js
85
+ var v;
86
+ (function(e) {
87
+ e[e.NONE = 0] = "NONE", e[e.ERROR = 30] = "ERROR", e[e.WARN = 50] = "WARN", e[e.INFO = 60] = "INFO", e[e.DEBUG = 70] = "DEBUG", e[e.VERBOSE = 80] = "VERBOSE", e[e.ALL = 9999] = "ALL";
88
+ })(v ||= {});
89
+ //#endregion
90
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/diag/internal/logLevelLogger.js
91
+ function re(e, t) {
92
+ e < v.NONE ? e = v.NONE : e > v.ALL && (e = v.ALL), t ||= {};
93
+ function n(n, r) {
94
+ let i = t[n];
95
+ return typeof i == "function" && e >= r ? i.bind(t) : function() {};
96
+ }
97
+ return {
98
+ error: n("error", v.ERROR),
99
+ warn: n("warn", v.WARN),
100
+ info: n("info", v.INFO),
101
+ debug: n("debug", v.DEBUG),
102
+ verbose: n("verbose", v.VERBOSE)
103
+ };
104
+ }
105
+ //#endregion
106
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/diag.js
107
+ var ie = "diag", y = class e {
108
+ static instance() {
109
+ return this._instance ||= new e(), this._instance;
110
+ }
111
+ constructor() {
112
+ function e(e) {
113
+ return function(...t) {
114
+ let n = h("diag");
115
+ if (n) return n[e](...t);
116
+ };
117
+ }
118
+ let t = this;
119
+ t.setLogger = (e, n = { logLevel: v.INFO }) => {
120
+ if (e === t) {
121
+ let e = /* @__PURE__ */ Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");
122
+ return t.error(e.stack ?? e.message), !1;
123
+ }
124
+ typeof n == "number" && (n = { logLevel: n });
125
+ let r = h("diag"), i = re(n.logLevel ?? v.INFO, e);
126
+ if (r && !n.suppressOverrideMessage) {
127
+ let e = (/* @__PURE__ */ Error()).stack ?? "<failed to generate stacktrace>";
128
+ r.warn(`Current logger will be overwritten from ${e}`), i.warn(`Current logger will overwrite one already registered from ${e}`);
129
+ }
130
+ return m("diag", i, t, !0);
131
+ }, t.disable = () => {
132
+ g(ie, t);
133
+ }, t.createComponentLogger = (e) => new ne(e), t.verbose = e("verbose"), t.debug = e("debug"), t.info = e("info"), t.warn = e("warn"), t.error = e("error");
134
+ }
135
+ }, ae = class e {
136
+ constructor(e) {
137
+ this._entries = e ? new Map(e) : /* @__PURE__ */ new Map();
138
+ }
139
+ getEntry(e) {
140
+ let t = this._entries.get(e);
141
+ if (t) return Object.assign({}, t);
142
+ }
143
+ getAllEntries() {
144
+ return Array.from(this._entries.entries());
145
+ }
146
+ setEntry(t, n) {
147
+ let r = new e(this._entries);
148
+ return r._entries.set(t, n), r;
149
+ }
150
+ removeEntry(t) {
151
+ let n = new e(this._entries);
152
+ return n._entries.delete(t), n;
153
+ }
154
+ removeEntries(...t) {
155
+ let n = new e(this._entries);
156
+ for (let e of t) n._entries.delete(e);
157
+ return n;
158
+ }
159
+ clear() {
160
+ return new e();
161
+ }
162
+ }, oe = Symbol("BaggageEntryMetadata"), se = y.instance();
163
+ function ce(e = {}) {
164
+ return new ae(new Map(Object.entries(e)));
165
+ }
166
+ function le(e) {
167
+ return typeof e != "string" && (se.error(`Cannot create baggage metadata from unknown type: ${typeof e}`), e = ""), {
168
+ __TYPE__: oe,
169
+ toString() {
170
+ return e;
171
+ }
172
+ };
173
+ }
174
+ //#endregion
175
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context/context.js
176
+ function ue(e) {
177
+ return Symbol.for(e);
178
+ }
179
+ var b = new class e {
180
+ constructor(t) {
181
+ let n = this;
182
+ n._currentContext = t ? new Map(t) : /* @__PURE__ */ new Map(), n.getValue = (e) => n._currentContext.get(e), n.setValue = (t, r) => {
183
+ let i = new e(n._currentContext);
184
+ return i._currentContext.set(t, r), i;
185
+ }, n.deleteValue = (t) => {
186
+ let r = new e(n._currentContext);
187
+ return r._currentContext.delete(t), r;
188
+ };
189
+ }
190
+ }(), de = class {
191
+ constructor() {}
192
+ createGauge(e, t) {
193
+ return Ce;
194
+ }
195
+ createHistogram(e, t) {
196
+ return we;
197
+ }
198
+ createCounter(e, t) {
199
+ return Se;
200
+ }
201
+ createUpDownCounter(e, t) {
202
+ return Te;
203
+ }
204
+ createObservableGauge(e, t) {
205
+ return De;
206
+ }
207
+ createObservableCounter(e, t) {
208
+ return Ee;
209
+ }
210
+ createObservableUpDownCounter(e, t) {
211
+ return Oe;
212
+ }
213
+ addBatchObservableCallback(e, t) {}
214
+ removeBatchObservableCallback(e) {}
215
+ }, fe = class {}, pe = class extends fe {
216
+ add(e, t) {}
217
+ }, me = class extends fe {
218
+ add(e, t) {}
219
+ }, he = class extends fe {
220
+ record(e, t) {}
221
+ }, ge = class extends fe {
222
+ record(e, t) {}
223
+ }, _e = class {
224
+ addCallback(e) {}
225
+ removeCallback(e) {}
226
+ }, ve = class extends _e {}, ye = class extends _e {}, be = class extends _e {}, xe = new de(), Se = new pe(), Ce = new he(), we = new ge(), Te = new me(), Ee = new ve(), De = new ye(), Oe = new be();
227
+ function ke() {
228
+ return xe;
229
+ }
230
+ //#endregion
231
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/propagation/TextMapPropagator.js
232
+ var Ae = {
233
+ get(e, t) {
234
+ if (e != null) return e[t];
235
+ },
236
+ keys(e) {
237
+ return e == null ? [] : Object.keys(e);
238
+ }
239
+ }, je = { set(e, t, n) {
240
+ e != null && (e[t] = n);
241
+ } }, Me = class {
242
+ active() {
243
+ return b;
244
+ }
245
+ with(e, t, n, ...r) {
246
+ return t.call(n, ...r);
247
+ }
248
+ bind(e, t) {
249
+ return t;
250
+ }
251
+ enable() {
252
+ return this;
253
+ }
254
+ disable() {
255
+ return this;
256
+ }
257
+ }, Ne = "context", Pe = new Me(), x = class e {
258
+ constructor() {}
259
+ static getInstance() {
260
+ return this._instance ||= new e(), this._instance;
261
+ }
262
+ setGlobalContextManager(e) {
263
+ return m(Ne, e, y.instance());
264
+ }
265
+ active() {
266
+ return this._getContextManager().active();
267
+ }
268
+ with(e, t, n, ...r) {
269
+ return this._getContextManager().with(e, t, n, ...r);
270
+ }
271
+ bind(e, t) {
272
+ return this._getContextManager().bind(e, t);
273
+ }
274
+ _getContextManager() {
275
+ return h(Ne) || Pe;
276
+ }
277
+ disable() {
278
+ this._getContextManager().disable(), g(Ne, y.instance());
279
+ }
280
+ }, S;
281
+ (function(e) {
282
+ e[e.NONE = 0] = "NONE", e[e.SAMPLED = 1] = "SAMPLED";
283
+ })(S ||= {});
284
+ var Fe = {
285
+ traceId: "00000000000000000000000000000000",
286
+ spanId: "0000000000000000",
287
+ traceFlags: S.NONE
288
+ }, C = class {
289
+ constructor(e = Fe) {
290
+ this._spanContext = e;
291
+ }
292
+ spanContext() {
293
+ return this._spanContext;
294
+ }
295
+ setAttribute(e, t) {
296
+ return this;
297
+ }
298
+ setAttributes(e) {
299
+ return this;
300
+ }
301
+ addEvent(e, t) {
302
+ return this;
303
+ }
304
+ addLink(e) {
305
+ return this;
306
+ }
307
+ addLinks(e) {
308
+ return this;
309
+ }
310
+ setStatus(e) {
311
+ return this;
312
+ }
313
+ updateName(e) {
314
+ return this;
315
+ }
316
+ end(e) {}
317
+ isRecording() {
318
+ return !1;
319
+ }
320
+ recordException(e, t) {}
321
+ }, Ie = ue("OpenTelemetry Context Key SPAN");
322
+ function Le(e) {
323
+ return e.getValue(Ie) || void 0;
324
+ }
325
+ function Re() {
326
+ return Le(x.getInstance().active());
327
+ }
328
+ function ze(e, t) {
329
+ return e.setValue(Ie, t);
330
+ }
331
+ function Be(e) {
332
+ return e.deleteValue(Ie);
333
+ }
334
+ function Ve(e, t) {
335
+ return ze(e, new C(t));
336
+ }
337
+ function He(e) {
338
+ return Le(e)?.spanContext();
339
+ }
340
+ //#endregion
341
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/spancontext-utils.js
342
+ var Ue = new Uint8Array([
343
+ 0,
344
+ 0,
345
+ 0,
346
+ 0,
347
+ 0,
348
+ 0,
349
+ 0,
350
+ 0,
351
+ 0,
352
+ 0,
353
+ 0,
354
+ 0,
355
+ 0,
356
+ 0,
357
+ 0,
358
+ 0,
359
+ 0,
360
+ 0,
361
+ 0,
362
+ 0,
363
+ 0,
364
+ 0,
365
+ 0,
366
+ 0,
367
+ 0,
368
+ 0,
369
+ 0,
370
+ 0,
371
+ 0,
372
+ 0,
373
+ 0,
374
+ 0,
375
+ 0,
376
+ 0,
377
+ 0,
378
+ 0,
379
+ 0,
380
+ 0,
381
+ 0,
382
+ 0,
383
+ 0,
384
+ 0,
385
+ 0,
386
+ 0,
387
+ 0,
388
+ 0,
389
+ 0,
390
+ 0,
391
+ 1,
392
+ 1,
393
+ 1,
394
+ 1,
395
+ 1,
396
+ 1,
397
+ 1,
398
+ 1,
399
+ 1,
400
+ 1,
401
+ 0,
402
+ 0,
403
+ 0,
404
+ 0,
405
+ 0,
406
+ 0,
407
+ 0,
408
+ 1,
409
+ 1,
410
+ 1,
411
+ 1,
412
+ 1,
413
+ 1,
414
+ 0,
415
+ 0,
416
+ 0,
417
+ 0,
418
+ 0,
419
+ 0,
420
+ 0,
421
+ 0,
422
+ 0,
423
+ 0,
424
+ 0,
425
+ 0,
426
+ 0,
427
+ 0,
428
+ 0,
429
+ 0,
430
+ 0,
431
+ 0,
432
+ 0,
433
+ 0,
434
+ 0,
435
+ 0,
436
+ 0,
437
+ 0,
438
+ 0,
439
+ 0,
440
+ 1,
441
+ 1,
442
+ 1,
443
+ 1,
444
+ 1,
445
+ 1
446
+ ]);
447
+ function We(e, t) {
448
+ if (typeof e != "string" || e.length !== t) return !1;
449
+ let n = 0;
450
+ for (let t = 0; t < e.length; t += 4) n += (Ue[e.charCodeAt(t)] | 0) + (Ue[e.charCodeAt(t + 1)] | 0) + (Ue[e.charCodeAt(t + 2)] | 0) + (Ue[e.charCodeAt(t + 3)] | 0);
451
+ return n === t;
452
+ }
453
+ function Ge(e) {
454
+ return We(e, 32) && e !== "00000000000000000000000000000000";
455
+ }
456
+ function Ke(e) {
457
+ return We(e, 16) && e !== "0000000000000000";
458
+ }
459
+ function qe(e) {
460
+ return Ge(e.traceId) && Ke(e.spanId);
461
+ }
462
+ function Je(e) {
463
+ return new C(e);
464
+ }
465
+ //#endregion
466
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/NoopTracer.js
467
+ var Ye = x.getInstance(), Xe = class {
468
+ startSpan(e, t, n = Ye.active()) {
469
+ if (t?.root) return new C();
470
+ let r = n && He(n);
471
+ return Ze(r) && qe(r) ? new C(r) : new C();
472
+ }
473
+ startActiveSpan(e, t, n, r) {
474
+ let i, a, o;
475
+ if (arguments.length < 2) return;
476
+ arguments.length === 2 ? o = t : arguments.length === 3 ? (i = t, o = n) : (i = t, a = n, o = r);
477
+ let s = a ?? Ye.active(), c = this.startSpan(e, i, s), l = ze(s, c);
478
+ return Ye.with(l, o, void 0, c);
479
+ }
480
+ };
481
+ function Ze(e) {
482
+ return typeof e == "object" && !!e && "spanId" in e && typeof e.spanId == "string" && "traceId" in e && typeof e.traceId == "string" && "traceFlags" in e && typeof e.traceFlags == "number";
483
+ }
484
+ //#endregion
485
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/ProxyTracer.js
486
+ var Qe = new Xe(), $e = class {
487
+ constructor(e, t, n, r) {
488
+ this._provider = e, this.name = t, this.version = n, this.options = r;
489
+ }
490
+ startSpan(e, t, n) {
491
+ return this._getTracer().startSpan(e, t, n);
492
+ }
493
+ startActiveSpan(e, t, n, r) {
494
+ let i = this._getTracer();
495
+ return Reflect.apply(i.startActiveSpan, i, arguments);
496
+ }
497
+ _getTracer() {
498
+ if (this._delegate) return this._delegate;
499
+ let e = this._provider.getDelegateTracer(this.name, this.version, this.options);
500
+ return e ? (this._delegate = e, this._delegate) : Qe;
501
+ }
502
+ }, et = new class {
503
+ getTracer(e, t, n) {
504
+ return new Xe();
505
+ }
506
+ }(), tt = class {
507
+ getTracer(e, t, n) {
508
+ return this.getDelegateTracer(e, t, n) ?? new $e(this, e, t, n);
509
+ }
510
+ getDelegate() {
511
+ return this._delegate ?? et;
512
+ }
513
+ setDelegate(e) {
514
+ this._delegate = e;
515
+ }
516
+ getDelegateTracer(e, t, n) {
517
+ return this._delegate?.getTracer(e, t, n);
518
+ }
519
+ }, nt;
520
+ (function(e) {
521
+ e[e.NOT_RECORD = 0] = "NOT_RECORD", e[e.RECORD = 1] = "RECORD", e[e.RECORD_AND_SAMPLED = 2] = "RECORD_AND_SAMPLED";
522
+ })(nt ||= {});
523
+ //#endregion
524
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/span_kind.js
525
+ var rt;
526
+ (function(e) {
527
+ e[e.INTERNAL = 0] = "INTERNAL", e[e.SERVER = 1] = "SERVER", e[e.CLIENT = 2] = "CLIENT", e[e.PRODUCER = 3] = "PRODUCER", e[e.CONSUMER = 4] = "CONSUMER";
528
+ })(rt ||= {});
529
+ //#endregion
530
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/trace/status.js
531
+ var w;
532
+ (function(e) {
533
+ e[e.UNSET = 0] = "UNSET", e[e.OK = 1] = "OK", e[e.ERROR = 2] = "ERROR";
534
+ })(w ||= {});
535
+ //#endregion
536
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/context-api.js
537
+ var T = x.getInstance(), E = y.instance(), it = new class {
538
+ getMeter(e, t, n) {
539
+ return xe;
540
+ }
541
+ }(), at = "metrics", ot = class e {
542
+ constructor() {}
543
+ static getInstance() {
544
+ return this._instance ||= new e(), this._instance;
545
+ }
546
+ setGlobalMeterProvider(e) {
547
+ return m(at, e, y.instance());
548
+ }
549
+ getMeterProvider() {
550
+ return h(at) || it;
551
+ }
552
+ getMeter(e, t, n) {
553
+ return this.getMeterProvider().getMeter(e, t, n);
554
+ }
555
+ disable() {
556
+ g(at, y.instance());
557
+ }
558
+ }.getInstance(), st = class {
559
+ inject(e, t) {}
560
+ extract(e, t) {
561
+ return e;
562
+ }
563
+ fields() {
564
+ return [];
565
+ }
566
+ }, ct = ue("OpenTelemetry Baggage Key");
567
+ function lt(e) {
568
+ return e.getValue(ct) || void 0;
569
+ }
570
+ function ut() {
571
+ return lt(x.getInstance().active());
572
+ }
573
+ function dt(e, t) {
574
+ return e.setValue(ct, t);
575
+ }
576
+ function ft(e) {
577
+ return e.deleteValue(ct);
578
+ }
579
+ //#endregion
580
+ //#region ../../node_modules/.pnpm/@opentelemetry+api@1.9.1/node_modules/@opentelemetry/api/build/esm/api/propagation.js
581
+ var pt = "propagation", mt = new st(), D = class e {
582
+ constructor() {
583
+ this.createBaggage = ce, this.getBaggage = lt, this.getActiveBaggage = ut, this.setBaggage = dt, this.deleteBaggage = ft;
584
+ }
585
+ static getInstance() {
586
+ return this._instance ||= new e(), this._instance;
587
+ }
588
+ setGlobalPropagator(e) {
589
+ return m(pt, e, y.instance());
590
+ }
591
+ inject(e, t, n = je) {
592
+ return this._getGlobalPropagator().inject(e, t, n);
593
+ }
594
+ extract(e, t, n = Ae) {
595
+ return this._getGlobalPropagator().extract(e, t, n);
596
+ }
597
+ fields() {
598
+ return this._getGlobalPropagator().fields();
599
+ }
600
+ disable() {
601
+ g(pt, y.instance());
602
+ }
603
+ _getGlobalPropagator() {
604
+ return h(pt) || mt;
605
+ }
606
+ }.getInstance(), ht = "trace", O = class e {
607
+ constructor() {
608
+ this._proxyTracerProvider = new tt(), this.wrapSpanContext = Je, this.isSpanContextValid = qe, this.deleteSpan = Be, this.getSpan = Le, this.getActiveSpan = Re, this.getSpanContext = He, this.setSpan = ze, this.setSpanContext = Ve;
609
+ }
610
+ static getInstance() {
611
+ return this._instance ||= new e(), this._instance;
612
+ }
613
+ setGlobalTracerProvider(e) {
614
+ let t = m(ht, this._proxyTracerProvider, y.instance());
615
+ return t && this._proxyTracerProvider.setDelegate(e), t;
616
+ }
617
+ getTracerProvider() {
618
+ return h(ht) || this._proxyTracerProvider;
619
+ }
620
+ getTracer(e, t) {
621
+ return this.getTracerProvider().getTracer(e, t);
622
+ }
623
+ disable() {
624
+ g(ht, y.instance()), this._proxyTracerProvider = new tt();
625
+ }
626
+ }.getInstance(), gt = ue("OpenTelemetry SDK Context Key SUPPRESS_TRACING");
627
+ function _t(e) {
628
+ return e.setValue(gt, !0);
629
+ }
630
+ function vt(e) {
631
+ return e.getValue(gt) === !0;
632
+ }
633
+ //#endregion
634
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/baggage/constants.js
635
+ var yt = "baggage", bt = 4096;
636
+ //#endregion
637
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/baggage/utils.js
638
+ function xt(e) {
639
+ return e.reduce((e, t) => {
640
+ let n = `${e}${e === "" ? "" : ","}${t}`;
641
+ return n.length > 8192 ? e : n;
642
+ }, "");
643
+ }
644
+ function St(e) {
645
+ return e.getAllEntries().map(([e, t]) => {
646
+ let n = `${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;
647
+ return t.metadata !== void 0 && (n += ";" + t.metadata.toString()), n;
648
+ });
649
+ }
650
+ function Ct(e) {
651
+ if (!e) return;
652
+ let t = e.indexOf(";"), n = t === -1 ? e : e.substring(0, t), r = n.indexOf("=");
653
+ if (r <= 0) return;
654
+ let i = n.substring(0, r).trim(), a = n.substring(r + 1).trim();
655
+ if (!i || !a) return;
656
+ let o, s;
657
+ try {
658
+ o = decodeURIComponent(i), s = decodeURIComponent(a);
659
+ } catch {
660
+ return;
661
+ }
662
+ let c;
663
+ return t !== -1 && t < e.length - 1 && (c = le(e.substring(t + 1))), {
664
+ key: o,
665
+ value: s,
666
+ metadata: c
667
+ };
668
+ }
669
+ function wt(e, t, n, r) {
670
+ let i = 0;
671
+ for (; i < e.length && n < 180;) {
672
+ let a = e.indexOf(",", i), o = a === -1 ? e.length : a, s = o - i;
673
+ if (s <= 4096) {
674
+ let a = Ct(e.substring(i, o));
675
+ if (a) {
676
+ let e = (n === 0 ? 0 : 1) + s;
677
+ if (r + e > 8192) break;
678
+ t[a.key] = a.metadata ? {
679
+ value: a.value,
680
+ metadata: a.metadata
681
+ } : { value: a.value }, n++, r += e;
682
+ }
683
+ }
684
+ if (a === -1) break;
685
+ i = a + 1;
686
+ }
687
+ return [n, r];
688
+ }
689
+ //#endregion
690
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/baggage/propagation/W3CBaggagePropagator.js
691
+ var Tt = class {
692
+ inject(e, t, n) {
693
+ let r = D.getBaggage(e);
694
+ if (!r || vt(e)) return;
695
+ let i = xt(St(r).filter((e) => e.length <= bt).slice(0, 180));
696
+ i.length > 0 && n.set(t, yt, i);
697
+ }
698
+ extract(e, t, n) {
699
+ let r = n.get(t, yt);
700
+ if (!r) return e;
701
+ let i = {}, a = 0, o = 0;
702
+ if (Array.isArray(r)) for (let e = 0; e < r.length; e++) [a, o] = wt(r[e], i, a, o);
703
+ else [a] = wt(r, i, a, o);
704
+ return a === 0 ? e : D.setBaggage(e, D.createBaggage(i));
705
+ }
706
+ fields() {
707
+ return [yt];
708
+ }
709
+ };
710
+ //#endregion
711
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/attributes.js
712
+ function k(e) {
713
+ let t = {};
714
+ if (typeof e != "object" || !e) return t;
715
+ for (let n in e) {
716
+ if (!Object.prototype.hasOwnProperty.call(e, n)) continue;
717
+ if (!Et(n)) {
718
+ E.warn(`Invalid attribute key: ${n}`);
719
+ continue;
720
+ }
721
+ let r = e[n];
722
+ if (!Dt(r)) {
723
+ E.warn(`Invalid attribute value set for key: ${n}`);
724
+ continue;
725
+ }
726
+ t[n] = Array.isArray(r) ? r.slice() : r;
727
+ }
728
+ return t;
729
+ }
730
+ function Et(e) {
731
+ return typeof e == "string" && e !== "";
732
+ }
733
+ function Dt(e) {
734
+ return e == null ? !0 : Array.isArray(e) ? Ot(e) : kt(typeof e);
735
+ }
736
+ function Ot(e) {
737
+ let t;
738
+ for (let n of e) {
739
+ if (n == null) continue;
740
+ let e = typeof n;
741
+ if (e !== t) {
742
+ if (!t) {
743
+ if (kt(e)) {
744
+ t = e;
745
+ continue;
746
+ }
747
+ return !1;
748
+ }
749
+ return !1;
750
+ }
751
+ }
752
+ return !0;
753
+ }
754
+ function kt(e) {
755
+ switch (e) {
756
+ case "number":
757
+ case "boolean":
758
+ case "string": return !0;
759
+ }
760
+ return !1;
761
+ }
762
+ //#endregion
763
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/logging-error-handler.js
764
+ function At() {
765
+ return (e) => {
766
+ E.error(jt(e));
767
+ };
768
+ }
769
+ function jt(e) {
770
+ return typeof e == "string" ? e : JSON.stringify(Mt(e));
771
+ }
772
+ function Mt(e) {
773
+ let t = {}, n = e;
774
+ for (; n !== null;) Object.getOwnPropertyNames(n).forEach((e) => {
775
+ if (t[e]) return;
776
+ let r = n[e];
777
+ r && (t[e] = String(r));
778
+ }), n = Object.getPrototypeOf(n);
779
+ return t;
780
+ }
781
+ //#endregion
782
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/common/global-error-handler.js
783
+ var Nt = At();
784
+ function A(e) {
785
+ try {
786
+ Nt(e);
787
+ } catch {}
788
+ }
789
+ //#endregion
790
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/version.js
791
+ var Pt = "2.10.0", Ft = "process.runtime.name", It = {
792
+ [o]: "opentelemetry",
793
+ [Ft]: "browser",
794
+ [i]: a,
795
+ [s]: Pt
796
+ }, j = performance, Lt = 9, Rt = 10 ** 6, zt = 10 ** Lt;
797
+ function M(e) {
798
+ let t = e / 1e3;
799
+ return [Math.trunc(t), Math.round(e % 1e3 * Rt)];
800
+ }
801
+ function N(e) {
802
+ return Wt(M(j.timeOrigin), M(typeof e == "number" ? e : j.now()));
803
+ }
804
+ function P(e) {
805
+ if (Ht(e)) return e;
806
+ if (typeof e == "number") return e < j.timeOrigin / 2 ? N(e) : M(e);
807
+ if (e instanceof Date) return M(e.getTime());
808
+ throw TypeError("Invalid input type");
809
+ }
810
+ function Bt(e, t) {
811
+ let n = t[0] - e[0], r = t[1] - e[1];
812
+ return r < 0 && (--n, r += zt), [n, r];
813
+ }
814
+ function F(e) {
815
+ return e[0] * zt + e[1];
816
+ }
817
+ function Vt(e) {
818
+ return e[0] * 1e3 + e[1] / 1e6;
819
+ }
820
+ function Ht(e) {
821
+ return Array.isArray(e) && e.length === 2 && typeof e[0] == "number" && typeof e[1] == "number";
822
+ }
823
+ function Ut(e) {
824
+ return Ht(e) || typeof e == "number" || e instanceof Date;
825
+ }
826
+ function Wt(e, t) {
827
+ let n = [e[0] + t[0], e[1] + t[1]];
828
+ return n[1] >= zt && (n[1] -= zt, n[0] += 1), n;
829
+ }
830
+ //#endregion
831
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/ExportResult.js
832
+ var I;
833
+ (function(e) {
834
+ e[e.SUCCESS = 0] = "SUCCESS", e[e.FAILED = 1] = "FAILED";
835
+ })(I ||= {});
836
+ //#endregion
837
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/propagation/composite.js
838
+ var Gt = class {
839
+ _propagators;
840
+ _fields;
841
+ constructor(e = {}) {
842
+ this._propagators = e.propagators ?? [];
843
+ let t = /* @__PURE__ */ new Set();
844
+ for (let e of this._propagators) {
845
+ let n = typeof e.fields == "function" ? e.fields() : [];
846
+ for (let e of n) t.add(e);
847
+ }
848
+ this._fields = Array.from(t);
849
+ }
850
+ inject(e, t, n) {
851
+ for (let r of this._propagators) try {
852
+ r.inject(e, t, n);
853
+ } catch (e) {
854
+ E.warn(`Failed to inject with ${r.constructor.name}. Err: ${e.message}`);
855
+ }
856
+ }
857
+ extract(e, t, n) {
858
+ return this._propagators.reduce((e, r) => {
859
+ try {
860
+ return r.extract(e, t, n);
861
+ } catch (e) {
862
+ E.warn(`Failed to extract with ${r.constructor.name}. Err: ${e.message}`);
863
+ }
864
+ return e;
865
+ }, e);
866
+ }
867
+ fields() {
868
+ return this._fields.slice();
869
+ }
870
+ }, Kt = "[_0-9a-z-*/]", qt = RegExp(`^(?:${`[a-z]${Kt}{0,255}`}|${`[a-z0-9]${Kt}{0,240}@[a-z]${Kt}{0,13}`})$`), Jt = /^[ -~]{0,255}[!-~]$/, Yt = /,|=/;
871
+ function Xt(e) {
872
+ return qt.test(e);
873
+ }
874
+ function Zt(e) {
875
+ return Jt.test(e) && !Yt.test(e);
876
+ }
877
+ //#endregion
878
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/trace/TraceState.js
879
+ var Qt = 32, $t = 512, en = ",", tn = "=", nn = class e {
880
+ _length;
881
+ _rawTraceState;
882
+ _internalState;
883
+ constructor(e) {
884
+ this._rawTraceState = typeof e == "string" ? e : "", this._length = this._rawTraceState.length;
885
+ }
886
+ set(e, t) {
887
+ if (!Xt(e) || !Zt(t)) return this;
888
+ let n = this._getState(), r = n.get(e), i = this._length;
889
+ if (i += typeof r == "string" ? t.length - r.length : e.length + t.length + (n.size > 0 ? 2 : 1), i > $t) return this;
890
+ let a = new Map(n);
891
+ return a.delete(e), a.set(e, t), this._fromState(a, i);
892
+ }
893
+ unset(e) {
894
+ let t = this._getState(), n = t.get(e);
895
+ if (typeof n != "string") return this;
896
+ let r = this._length - (e.length + n.length + 1);
897
+ t.size > 1 && --r;
898
+ let i = new Map(t);
899
+ return i.delete(e), this._fromState(i, r);
900
+ }
901
+ get(e) {
902
+ return this._getState().get(e);
903
+ }
904
+ serialize() {
905
+ let e = "", t = 0;
906
+ for (let n of this._getState()) t > 0 && (e = en + e), e = `${n[0]}${tn}${n[1]}` + e, t++;
907
+ return e;
908
+ }
909
+ _getState() {
910
+ if (this._internalState) return this._internalState;
911
+ let e = this._rawTraceState.split(en), t = /* @__PURE__ */ new Map(), n = 0;
912
+ for (let r of e) {
913
+ let e = r.trim(), i = e.indexOf(tn);
914
+ if (i === -1) continue;
915
+ let a = e.slice(0, i), o = e.slice(i + 1);
916
+ if (!Xt(a) || !Zt(o)) continue;
917
+ let s = n + e.length + +(t.size > 0);
918
+ if (!(s > $t) && (t.set(a, o), n = s, t.size >= Qt)) break;
919
+ }
920
+ return this._length = n, this._internalState = new Map(Array.from(t.entries()).reverse()), this._internalState;
921
+ }
922
+ _fromState(t, n) {
923
+ let r = Object.create(e.prototype);
924
+ return r._internalState = t, r._length = n, r;
925
+ }
926
+ }, rn = "traceparent", an = "tracestate", on = "00", sn = /* @__PURE__ */ RegExp("^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$");
927
+ function cn(e) {
928
+ let t = sn.exec(e);
929
+ return !t || t[1] === "00" && t[5] ? null : {
930
+ traceId: t[2],
931
+ spanId: t[3],
932
+ traceFlags: parseInt(t[4], 16)
933
+ };
934
+ }
935
+ var ln = class {
936
+ inject(e, t, n) {
937
+ let r = O.getSpanContext(e);
938
+ if (!r || vt(e) || !qe(r)) return;
939
+ let i = `${on}-${r.traceId}-${r.spanId}-0${Number(r.traceFlags || S.NONE).toString(16)}`;
940
+ n.set(t, rn, i), r.traceState && n.set(t, an, r.traceState.serialize());
941
+ }
942
+ extract(e, t, n) {
943
+ let r = n.get(t, rn);
944
+ if (!r) return e;
945
+ let i = Array.isArray(r) ? r[0] : r;
946
+ if (typeof i != "string") return e;
947
+ let a = cn(i);
948
+ if (!a) return e;
949
+ a.isRemote = !0;
950
+ let o = n.get(t, an);
951
+ if (o) {
952
+ let e = Array.isArray(o) ? o.join(",") : o;
953
+ a.traceState = new nn(typeof e == "string" ? e : void 0);
954
+ }
955
+ return O.setSpanContext(e, a);
956
+ }
957
+ fields() {
958
+ return [rn, an];
959
+ }
960
+ }, un = "[object Object]", dn = "[object Null]", fn = "[object Undefined]", pn = Function.prototype.toString, mn = pn.call(Object), hn = Object.getPrototypeOf, gn = Object.prototype, _n = gn.hasOwnProperty, L = Symbol ? Symbol.toStringTag : void 0, vn = gn.toString;
961
+ function yn(e) {
962
+ if (!bn(e) || xn(e) !== un) return !1;
963
+ let t = hn(e);
964
+ if (t === null) return !0;
965
+ let n = _n.call(t, "constructor") && t.constructor;
966
+ return typeof n == "function" && n instanceof n && pn.call(n) === mn;
967
+ }
968
+ function bn(e) {
969
+ return typeof e == "object" && !!e;
970
+ }
971
+ function xn(e) {
972
+ return e == null ? e === void 0 ? fn : dn : L && L in Object(e) ? Sn(e) : Cn(e);
973
+ }
974
+ function Sn(e) {
975
+ let t = _n.call(e, L), n = e[L], r = !1;
976
+ try {
977
+ e[L] = void 0, r = !0;
978
+ } catch {}
979
+ let i = vn.call(e);
980
+ return r && (t ? e[L] = n : delete e[L]), i;
981
+ }
982
+ function Cn(e) {
983
+ return vn.call(e);
984
+ }
985
+ //#endregion
986
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/merge.js
987
+ var wn = 20;
988
+ function Tn(...e) {
989
+ let t = e.shift(), n = /* @__PURE__ */ new WeakMap();
990
+ for (; e.length > 0;) t = Dn(t, e.shift(), 0, n);
991
+ return t;
992
+ }
993
+ function En(e) {
994
+ return kn(e) ? e.slice() : e;
995
+ }
996
+ function Dn(e, t, n = 0, r) {
997
+ let i;
998
+ if (!(n > wn)) {
999
+ if (n++, jn(e) || jn(t) || An(t)) i = En(t);
1000
+ else if (kn(e)) {
1001
+ if (i = e.slice(), kn(t)) for (let e = 0, n = t.length; e < n; e++) i.push(En(t[e]));
1002
+ else if (R(t)) {
1003
+ let e = Object.keys(t);
1004
+ for (let n = 0, r = e.length; n < r; n++) {
1005
+ let r = e[n];
1006
+ r !== "__proto__" && r !== "constructor" && r !== "prototype" && (i[r] = En(t[r]));
1007
+ }
1008
+ }
1009
+ } else if (R(e)) {
1010
+ if (R(t)) {
1011
+ if (!Mn(e, t)) return t;
1012
+ i = Object.assign({}, e);
1013
+ let a = Object.keys(t);
1014
+ for (let o = 0, s = a.length; o < s; o++) {
1015
+ let s = a[o];
1016
+ if (s === "__proto__" || s === "constructor" || s === "prototype") continue;
1017
+ let c = t[s];
1018
+ if (jn(c)) c === void 0 ? delete i[s] : i[s] = c;
1019
+ else {
1020
+ let a = i[s], o = c;
1021
+ if (On(e, s, r) || On(t, s, r)) delete i[s];
1022
+ else {
1023
+ if (R(a) && R(o)) {
1024
+ let n = r.get(a) || [], i = r.get(o) || [];
1025
+ n.push({
1026
+ obj: e,
1027
+ key: s
1028
+ }), i.push({
1029
+ obj: t,
1030
+ key: s
1031
+ }), r.set(a, n), r.set(o, i);
1032
+ }
1033
+ i[s] = Dn(i[s], c, n, r);
1034
+ }
1035
+ }
1036
+ }
1037
+ } else i = t;
1038
+ }
1039
+ return i;
1040
+ }
1041
+ }
1042
+ function On(e, t, n) {
1043
+ let r = n.get(e[t]) || [];
1044
+ for (let n = 0, i = r.length; n < i; n++) {
1045
+ let i = r[n];
1046
+ if (i.key === t && i.obj === e) return !0;
1047
+ }
1048
+ return !1;
1049
+ }
1050
+ function kn(e) {
1051
+ return Array.isArray(e);
1052
+ }
1053
+ function An(e) {
1054
+ return typeof e == "function";
1055
+ }
1056
+ function R(e) {
1057
+ return !jn(e) && !kn(e) && !An(e) && typeof e == "object";
1058
+ }
1059
+ function jn(e) {
1060
+ return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || e === void 0 || e instanceof Date || e instanceof RegExp || e === null;
1061
+ }
1062
+ function Mn(e, t) {
1063
+ return !(!yn(e) || !yn(t));
1064
+ }
1065
+ //#endregion
1066
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/url.js
1067
+ function Nn(e, t) {
1068
+ return typeof t == "string" ? e === t : !!e.match(t);
1069
+ }
1070
+ function Pn(e, t) {
1071
+ if (!t) return !1;
1072
+ for (let n of t) if (Nn(e, n)) return !0;
1073
+ return !1;
1074
+ }
1075
+ //#endregion
1076
+ //#region ../../node_modules/.pnpm/@opentelemetry+core@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/core/build/esm/utils/promise.js
1077
+ var Fn = class {
1078
+ _promise;
1079
+ _resolve;
1080
+ _reject;
1081
+ constructor() {
1082
+ this._promise = new Promise((e, t) => {
1083
+ this._resolve = e, this._reject = t;
1084
+ });
1085
+ }
1086
+ get promise() {
1087
+ return this._promise;
1088
+ }
1089
+ resolve(e) {
1090
+ this._resolve(e);
1091
+ }
1092
+ reject(e) {
1093
+ this._reject(e);
1094
+ }
1095
+ }, In = class {
1096
+ _isCalled = !1;
1097
+ _deferred = new Fn();
1098
+ _callback;
1099
+ _that;
1100
+ constructor(e, t) {
1101
+ this._callback = e, this._that = t;
1102
+ }
1103
+ get isCalled() {
1104
+ return this._isCalled;
1105
+ }
1106
+ get promise() {
1107
+ return this._deferred.promise;
1108
+ }
1109
+ call(...e) {
1110
+ if (!this._isCalled) {
1111
+ this._isCalled = !0;
1112
+ try {
1113
+ Promise.resolve(this._callback.call(this._that, ...e)).then((e) => this._deferred.resolve(e), (e) => this._deferred.reject(e));
1114
+ } catch (e) {
1115
+ this._deferred.reject(e);
1116
+ }
1117
+ }
1118
+ return this._deferred.promise;
1119
+ }
1120
+ }, Ln;
1121
+ function Rn() {
1122
+ if (Ln === void 0) try {
1123
+ let e = globalThis.process.argv0;
1124
+ Ln = e ? `unknown_service:${e}` : "unknown_service";
1125
+ } catch {
1126
+ Ln = "unknown_service";
1127
+ }
1128
+ return Ln;
1129
+ }
1130
+ //#endregion
1131
+ //#region ../../node_modules/.pnpm/@opentelemetry+resources@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/resources/build/esm/utils.js
1132
+ var z = (e) => typeof e == "object" && !!e && typeof e.then == "function", zn = class e {
1133
+ _rawAttributes;
1134
+ _asyncAttributesPending = !1;
1135
+ _schemaUrl;
1136
+ _memoizedAttributes;
1137
+ static FromAttributeList(t, n) {
1138
+ let r = new e({}, n);
1139
+ return r._rawAttributes = Hn(t), r._asyncAttributesPending = t.filter(([e, t]) => z(t)).length > 0, r;
1140
+ }
1141
+ constructor(e, t) {
1142
+ let n = e.attributes ?? {};
1143
+ this._rawAttributes = Object.entries(n).map(([e, t]) => (z(t) && (this._asyncAttributesPending = !0), [e, t])), this._rawAttributes = Hn(this._rawAttributes), this._schemaUrl = Un(t?.schemaUrl);
1144
+ }
1145
+ get asyncAttributesPending() {
1146
+ return this._asyncAttributesPending;
1147
+ }
1148
+ async waitForAsyncAttributes() {
1149
+ if (this.asyncAttributesPending) {
1150
+ for (let e = 0; e < this._rawAttributes.length; e++) {
1151
+ let [t, n] = this._rawAttributes[e];
1152
+ this._rawAttributes[e] = [t, z(n) ? await n : n];
1153
+ }
1154
+ this._asyncAttributesPending = !1;
1155
+ }
1156
+ }
1157
+ get attributes() {
1158
+ if (this.asyncAttributesPending && E.error("Accessing resource attributes before async attributes settled"), this._memoizedAttributes) return this._memoizedAttributes;
1159
+ let e = {};
1160
+ for (let [t, n] of this._rawAttributes) {
1161
+ if (z(n)) {
1162
+ E.debug(`Unsettled resource attribute ${t} skipped`);
1163
+ continue;
1164
+ }
1165
+ n != null && (e[t] ??= n);
1166
+ }
1167
+ return this._asyncAttributesPending || (this._memoizedAttributes = e), e;
1168
+ }
1169
+ getRawAttributes() {
1170
+ return this._rawAttributes;
1171
+ }
1172
+ get schemaUrl() {
1173
+ return this._schemaUrl;
1174
+ }
1175
+ merge(t) {
1176
+ if (t == null) return this;
1177
+ let n = Wn(this, t), r = n ? { schemaUrl: n } : void 0;
1178
+ return e.FromAttributeList([...t.getRawAttributes(), ...this.getRawAttributes()], r);
1179
+ }
1180
+ };
1181
+ function Bn(e, t) {
1182
+ return zn.FromAttributeList(Object.entries(e), t);
1183
+ }
1184
+ function Vn() {
1185
+ return Bn({
1186
+ [r]: Rn(),
1187
+ [i]: It[i],
1188
+ [o]: It[o],
1189
+ [s]: It[s]
1190
+ });
1191
+ }
1192
+ function Hn(e) {
1193
+ return e.map(([e, t]) => z(t) ? [e, t.catch((t) => {
1194
+ E.debug("promise rejection for resource attribute: %s - %s", e, t);
1195
+ })] : [e, t]);
1196
+ }
1197
+ function Un(e) {
1198
+ if (typeof e == "string" || e === void 0) return e;
1199
+ E.warn("Schema URL must be string or undefined, got %s. Schema URL will be ignored.", e);
1200
+ }
1201
+ function Wn(e, t) {
1202
+ let n = e?.schemaUrl, r = t?.schemaUrl, i = n === void 0 || n === "", a = r === void 0 || r === "";
1203
+ if (i) return r;
1204
+ if (a || n === r) return n;
1205
+ E.warn("Schema URL merge conflict: old resource has \"%s\", updating resource has \"%s\". Resulting resource will have undefined Schema URL.", n, r);
1206
+ }
1207
+ //#endregion
1208
+ //#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/esm/enums.js
1209
+ var Gn = "exception", Kn = Symbol.for("nodejs.util.inspect.custom");
1210
+ function qn(e) {
1211
+ let t = {};
1212
+ for (let [n, r] of e.getRawAttributes()) typeof r?.then != "function" && r != null && (t[n] ??= r);
1213
+ return t;
1214
+ }
1215
+ function Jn(e, t, n, r, i) {
1216
+ if (typeof n == "number" && n < 0) {
1217
+ let t = `[${e}]`;
1218
+ return r?.stylize ? r.stylize(t, "special") : t;
1219
+ }
1220
+ return typeof i != "function" || !r ? t : `${e} ${i(t, {
1221
+ ...r,
1222
+ depth: r.depth == null ? r.depth : r.depth - 1
1223
+ })}`;
1224
+ }
1225
+ //#endregion
1226
+ //#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/esm/Span.js
1227
+ var Yn = class {
1228
+ _spanContext;
1229
+ kind;
1230
+ parentSpanContext;
1231
+ attributes = {};
1232
+ links = [];
1233
+ events = [];
1234
+ startTime;
1235
+ resource;
1236
+ instrumentationScope;
1237
+ _droppedAttributesCount = 0;
1238
+ _droppedEventsCount = 0;
1239
+ _droppedLinksCount = 0;
1240
+ _attributesCount = 0;
1241
+ name;
1242
+ status = { code: w.UNSET };
1243
+ endTime = [0, 0];
1244
+ _ended = !1;
1245
+ _duration = [-1, -1];
1246
+ _spanProcessor;
1247
+ _spanLimits;
1248
+ _attributeValueLengthLimit;
1249
+ _recordEndMetrics;
1250
+ _performanceStartTime;
1251
+ _performanceOffset;
1252
+ _startTimeProvided;
1253
+ constructor(e) {
1254
+ let t = Date.now();
1255
+ if (this._spanContext = e.spanContext, this._performanceStartTime = j.now(), this._performanceOffset = t - (this._performanceStartTime + j.timeOrigin), this._startTimeProvided = e.startTime != null, this._spanLimits = e.spanLimits, this._attributeValueLengthLimit = this._spanLimits.attributeValueLengthLimit ?? 0, this._spanProcessor = e.spanProcessor, this.name = e.name, this.parentSpanContext = e.parentSpanContext, this.kind = e.kind, e.links) for (let t of e.links) this.addLink(t);
1256
+ this.startTime = this._getTime(e.startTime ?? t), this.resource = e.resource, this.instrumentationScope = e.scope, this._recordEndMetrics = e.recordEndMetrics, e.attributes != null && this.setAttributes(e.attributes), this._spanProcessor.onStart(this, e.context);
1257
+ }
1258
+ spanContext() {
1259
+ return this._spanContext;
1260
+ }
1261
+ setAttribute(e, t) {
1262
+ if (t == null || this._isSpanEnded()) return this;
1263
+ if (e.length === 0) return E.warn(`Invalid attribute key: ${e}`), this;
1264
+ if (!Dt(t)) return E.warn(`Invalid attribute value set for key: ${e}`), this;
1265
+ let { attributeCountLimit: n } = this._spanLimits, r = !Object.prototype.hasOwnProperty.call(this.attributes, e);
1266
+ return n !== void 0 && this._attributesCount >= n && r ? (this._droppedAttributesCount++, this) : (this.attributes[e] = this._truncateToSize(t), r && this._attributesCount++, this);
1267
+ }
1268
+ setAttributes(e) {
1269
+ for (let t in e) Object.prototype.hasOwnProperty.call(e, t) && this.setAttribute(t, e[t]);
1270
+ return this;
1271
+ }
1272
+ addEvent(e, t, n) {
1273
+ if (this._isSpanEnded()) return this;
1274
+ let { eventCountLimit: r } = this._spanLimits;
1275
+ if (r === 0) return E.warn("No events allowed."), this._droppedEventsCount++, this;
1276
+ r !== void 0 && this.events.length >= r && (this._droppedEventsCount === 0 && E.debug("Dropping extra events."), this.events.shift(), this._droppedEventsCount++), Ut(t) && (Ut(n) || (n = t), t = void 0);
1277
+ let i = k(t), { attributePerEventCountLimit: a } = this._spanLimits, o = {}, s = 0, c = 0;
1278
+ for (let e in i) {
1279
+ if (!Object.prototype.hasOwnProperty.call(i, e)) continue;
1280
+ let t = i[e];
1281
+ if (a !== void 0 && c >= a) {
1282
+ s++;
1283
+ continue;
1284
+ }
1285
+ o[e] = this._truncateToSize(t), c++;
1286
+ }
1287
+ return this.events.push({
1288
+ name: e,
1289
+ attributes: o,
1290
+ time: this._getTime(n),
1291
+ droppedAttributesCount: s
1292
+ }), this;
1293
+ }
1294
+ addLink(e) {
1295
+ if (this._isSpanEnded()) return this;
1296
+ let { linkCountLimit: t } = this._spanLimits;
1297
+ if (t === 0) return this._droppedLinksCount++, this;
1298
+ t !== void 0 && this.links.length >= t && (this._droppedLinksCount === 0 && E.debug("Dropping extra links."), this.links.shift(), this._droppedLinksCount++);
1299
+ let { attributePerLinkCountLimit: n } = this._spanLimits, r = k(e.attributes), i = {}, a = 0, o = 0;
1300
+ for (let e in r) {
1301
+ if (!Object.prototype.hasOwnProperty.call(r, e)) continue;
1302
+ let t = r[e];
1303
+ if (n !== void 0 && o >= n) {
1304
+ a++;
1305
+ continue;
1306
+ }
1307
+ i[e] = this._truncateToSize(t), o++;
1308
+ }
1309
+ let s = { context: e.context };
1310
+ return o > 0 && (s.attributes = i), a > 0 && (s.droppedAttributesCount = a), this.links.push(s), this;
1311
+ }
1312
+ addLinks(e) {
1313
+ for (let t of e) this.addLink(t);
1314
+ return this;
1315
+ }
1316
+ setStatus(e) {
1317
+ if (this._isSpanEnded() || e.code === w.UNSET || this.status.code === w.OK) return this;
1318
+ let t = { code: e.code };
1319
+ return e.code === w.ERROR && (typeof e.message == "string" ? t.message = e.message : e.message != null && E.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`)), this.status = t, this;
1320
+ }
1321
+ updateName(e) {
1322
+ return this._isSpanEnded() || (this.name = e), this;
1323
+ }
1324
+ end(e) {
1325
+ if (this._isSpanEnded()) {
1326
+ E.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);
1327
+ return;
1328
+ }
1329
+ this.endTime = this._getTime(e), this._duration = Bt(this.startTime, this.endTime), this._duration[0] < 0 && (E.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.", this.startTime, this.endTime), this.endTime = this.startTime.slice(), this._duration = [0, 0]), this._droppedEventsCount > 0 && E.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`), this._droppedLinksCount > 0 && E.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`), this._spanProcessor.onEnding && this._spanProcessor.onEnding(this), this._recordEndMetrics?.(), this._ended = !0, this._spanProcessor.onEnd(this);
1330
+ }
1331
+ _getTime(e) {
1332
+ if (typeof e == "number" && e <= j.now()) return N(e + this._performanceOffset);
1333
+ if (typeof e == "number") return M(e);
1334
+ if (e instanceof Date) return M(e.getTime());
1335
+ if (Ht(e)) return e;
1336
+ if (this._startTimeProvided) return M(Date.now());
1337
+ let t = j.now() - this._performanceStartTime;
1338
+ return Wt(this.startTime, M(t));
1339
+ }
1340
+ isRecording() {
1341
+ return this._ended === !1;
1342
+ }
1343
+ recordException(e, r) {
1344
+ let i = {};
1345
+ typeof e == "string" ? i[t] = e : e && (e.code ? i[n] = e.code.toString() : e.name && (i[n] = e.name), e.message && (i[t] = e.message), e.stack && (i["exception.stacktrace"] = e.stack)), i["exception.type"] || i["exception.message"] ? this.addEvent(Gn, i, r) : E.warn(`Failed to record an exception ${e}`);
1346
+ }
1347
+ get duration() {
1348
+ return this._duration;
1349
+ }
1350
+ get ended() {
1351
+ return this._ended;
1352
+ }
1353
+ get droppedAttributesCount() {
1354
+ return this._droppedAttributesCount;
1355
+ }
1356
+ get droppedEventsCount() {
1357
+ return this._droppedEventsCount;
1358
+ }
1359
+ get droppedLinksCount() {
1360
+ return this._droppedLinksCount;
1361
+ }
1362
+ _isSpanEnded() {
1363
+ if (this._ended) {
1364
+ let e = /* @__PURE__ */ Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);
1365
+ E.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`, e);
1366
+ }
1367
+ return this._ended;
1368
+ }
1369
+ _truncateToLimitUtil(e, t) {
1370
+ return e.length <= t ? e : e.substring(0, t);
1371
+ }
1372
+ _truncateToSize(e) {
1373
+ let t = this._attributeValueLengthLimit;
1374
+ return t <= 0 ? (E.warn(`Attribute value limit must be positive, got ${t}`), e) : typeof e == "string" ? this._truncateToLimitUtil(e, t) : Array.isArray(e) ? e.map((e) => typeof e == "string" ? this._truncateToLimitUtil(e, t) : e) : e;
1375
+ }
1376
+ [Kn](e, t, n) {
1377
+ return Jn("SpanImpl", {
1378
+ name: this.name,
1379
+ kind: this.kind,
1380
+ spanContext: this._spanContext,
1381
+ parentSpanContext: this.parentSpanContext,
1382
+ status: this.status,
1383
+ startTime: this.startTime,
1384
+ endTime: this.endTime,
1385
+ duration: this._duration,
1386
+ ended: this._ended,
1387
+ attributes: this.attributes,
1388
+ events: this.events,
1389
+ links: this.links,
1390
+ droppedAttributesCount: this._droppedAttributesCount,
1391
+ droppedEventsCount: this._droppedEventsCount,
1392
+ droppedLinksCount: this._droppedLinksCount,
1393
+ instrumentationScope: this.instrumentationScope,
1394
+ resource: { attributes: qn(this.resource) }
1395
+ }, e, t, n);
1396
+ }
1397
+ }, B;
1398
+ (function(e) {
1399
+ e[e.NOT_RECORD = 0] = "NOT_RECORD", e[e.RECORD = 1] = "RECORD", e[e.RECORD_AND_SAMPLED = 2] = "RECORD_AND_SAMPLED";
1400
+ })(B ||= {});
1401
+ //#endregion
1402
+ //#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/esm/semconv.js
1403
+ var Xn = "otel.component.name", Zn = "otel.component.type", Qn = "otel.span.parent.origin", $n = "otel.span.sampling_result", er = "otel.sdk.processor.span.processed", tr = "otel.sdk.processor.span.queue.capacity", nr = "otel.sdk.processor.span.queue.size", rr = "otel.sdk.span.live", ir = "otel.sdk.span.started", ar = "batching_span_processor", or = class {
1404
+ startedSpans;
1405
+ liveSpans;
1406
+ constructor(e) {
1407
+ this.startedSpans = e.createCounter(ir, {
1408
+ unit: "{span}",
1409
+ description: "The number of created spans."
1410
+ }), this.liveSpans = e.createUpDownCounter(rr, {
1411
+ unit: "{span}",
1412
+ description: "The number of currently live spans."
1413
+ });
1414
+ }
1415
+ startSpan(e, t) {
1416
+ let n = cr(t);
1417
+ if (this.startedSpans.add(1, {
1418
+ [Qn]: sr(e),
1419
+ [$n]: n
1420
+ }), t === B.NOT_RECORD) return () => {};
1421
+ let r = { [$n]: n };
1422
+ return this.liveSpans.add(1, r), () => {
1423
+ this.liveSpans.add(-1, r);
1424
+ };
1425
+ }
1426
+ };
1427
+ function sr(e) {
1428
+ return e ? e.isRemote ? "remote" : "local" : "none";
1429
+ }
1430
+ function cr(e) {
1431
+ switch (e) {
1432
+ case B.RECORD_AND_SAMPLED: return "RECORD_AND_SAMPLE";
1433
+ case B.RECORD: return "RECORD_ONLY";
1434
+ case B.NOT_RECORD: return "DROP";
1435
+ }
1436
+ }
1437
+ //#endregion
1438
+ //#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace/build/esm/version.js
1439
+ var lr = "2.10.0", ur = class {
1440
+ _sampler;
1441
+ _spanLimits;
1442
+ _idGenerator;
1443
+ instrumentationScope;
1444
+ _resource;
1445
+ _spanProcessor;
1446
+ _tracerMetrics;
1447
+ constructor(e, t) {
1448
+ this.instrumentationScope = e, this._sampler = t.sampler, this._spanLimits = t.spanLimits, this._resource = t.resource, this._idGenerator = t.idGenerator, this._spanProcessor = t.spanProcessor;
1449
+ let n = t.meterProvider.getMeter("@opentelemetry/sdk-trace", lr);
1450
+ this._tracerMetrics = new or(n);
1451
+ }
1452
+ startSpan(e, t = {}, n = T.active()) {
1453
+ t.root && (n = O.deleteSpan(n));
1454
+ let r = O.getSpan(n);
1455
+ if (vt(n)) return E.debug("Instrumentation suppressed, returning Noop Span"), O.wrapSpanContext(Fe);
1456
+ let i = r?.spanContext(), a = this._idGenerator.generateSpanId(), o, s, c;
1457
+ !i || !O.isSpanContextValid(i) ? s = this._idGenerator.generateTraceId() : (s = i.traceId, c = i.traceState, o = i);
1458
+ let l = t.kind ?? rt.INTERNAL, u = (t.links ?? []).map((e) => ({
1459
+ context: e.context,
1460
+ attributes: k(e.attributes)
1461
+ })), ee = k(t.attributes), d = this._sampler.shouldSample(n, s, e, l, ee, u), te = this._tracerMetrics.startSpan(i, d.decision);
1462
+ c = d.traceState ?? c;
1463
+ let f = d.decision === nt.RECORD_AND_SAMPLED ? S.SAMPLED : S.NONE, p = {
1464
+ traceId: s,
1465
+ spanId: a,
1466
+ traceFlags: f,
1467
+ traceState: c
1468
+ };
1469
+ if (d.decision === nt.NOT_RECORD) return E.debug("Recording is off, propagating context in a non-recording span"), O.wrapSpanContext(p);
1470
+ let m = k(Object.assign(ee, d.attributes));
1471
+ return new Yn({
1472
+ resource: this._resource,
1473
+ scope: this.instrumentationScope,
1474
+ context: n,
1475
+ spanContext: p,
1476
+ name: e,
1477
+ kind: l,
1478
+ links: u,
1479
+ parentSpanContext: o,
1480
+ attributes: m,
1481
+ startTime: t.startTime,
1482
+ spanProcessor: this._spanProcessor,
1483
+ spanLimits: this._spanLimits,
1484
+ recordEndMetrics: te
1485
+ });
1486
+ }
1487
+ startActiveSpan(e, t, n, r) {
1488
+ let i, a, o;
1489
+ if (arguments.length < 2) return;
1490
+ arguments.length === 2 ? o = t : arguments.length === 3 ? (i = t, o = n) : (i = t, a = n, o = r);
1491
+ let s = a ?? T.active(), c = this.startSpan(e, i, s), l = O.setSpan(s, c);
1492
+ return T.with(l, o, void 0, c);
1493
+ }
1494
+ [Kn](e, t, n) {
1495
+ return Jn("Tracer", {
1496
+ instrumentationScope: this.instrumentationScope,
1497
+ resource: { attributes: qn(this._resource) },
1498
+ spanLimits: this._spanLimits
1499
+ }, e, t, n);
1500
+ }
1501
+ }, dr = class {
1502
+ _spanProcessors;
1503
+ constructor(e) {
1504
+ this._spanProcessors = e;
1505
+ }
1506
+ forceFlush() {
1507
+ let e = [];
1508
+ for (let t of this._spanProcessors) e.push(t.forceFlush());
1509
+ return new Promise((t) => {
1510
+ Promise.all(e).then(() => {
1511
+ t();
1512
+ }).catch((e) => {
1513
+ A(e || /* @__PURE__ */ Error("MultiSpanProcessor: forceFlush failed")), t();
1514
+ });
1515
+ });
1516
+ }
1517
+ onStart(e, t) {
1518
+ for (let n of this._spanProcessors) n.onStart(e, t);
1519
+ }
1520
+ onEnding(e) {
1521
+ for (let t of this._spanProcessors) t.onEnding && t.onEnding(e);
1522
+ }
1523
+ onEnd(e) {
1524
+ for (let t of this._spanProcessors) t.onEnd(e);
1525
+ }
1526
+ shutdown() {
1527
+ let e = [];
1528
+ for (let t of this._spanProcessors) e.push(t.shutdown());
1529
+ return new Promise((t, n) => {
1530
+ Promise.all(e).then(() => {
1531
+ t();
1532
+ }, n);
1533
+ });
1534
+ }
1535
+ }, fr = class {
1536
+ shouldSample() {
1537
+ return { decision: B.NOT_RECORD };
1538
+ }
1539
+ toString() {
1540
+ return "AlwaysOffSampler";
1541
+ }
1542
+ }, V = class {
1543
+ shouldSample() {
1544
+ return { decision: B.RECORD_AND_SAMPLED };
1545
+ }
1546
+ toString() {
1547
+ return "AlwaysOnSampler";
1548
+ }
1549
+ }, H = class {
1550
+ _root;
1551
+ _remoteParentSampled;
1552
+ _remoteParentNotSampled;
1553
+ _localParentSampled;
1554
+ _localParentNotSampled;
1555
+ constructor(e) {
1556
+ this._root = e.root, this._root ||= (A(/* @__PURE__ */ Error("ParentBasedSampler must have a root sampler configured")), new V()), this._remoteParentSampled = e.remoteParentSampled ?? new V(), this._remoteParentNotSampled = e.remoteParentNotSampled ?? new fr(), this._localParentSampled = e.localParentSampled ?? new V(), this._localParentNotSampled = e.localParentNotSampled ?? new fr();
1557
+ }
1558
+ shouldSample(e, t, n, r, i, a) {
1559
+ let o = O.getSpanContext(e);
1560
+ return !o || !qe(o) ? this._root.shouldSample(e, t, n, r, i, a) : o.isRemote ? o.traceFlags & S.SAMPLED ? this._remoteParentSampled.shouldSample(e, t, n, r, i, a) : this._remoteParentNotSampled.shouldSample(e, t, n, r, i, a) : o.traceFlags & S.SAMPLED ? this._localParentSampled.shouldSample(e, t, n, r, i, a) : this._localParentNotSampled.shouldSample(e, t, n, r, i, a);
1561
+ }
1562
+ toString() {
1563
+ return `ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`;
1564
+ }
1565
+ }, pr = /* @__PURE__ */ new Map(), mr = class {
1566
+ processedSpans;
1567
+ queueSize;
1568
+ queueSizeCallback;
1569
+ standardAttrs;
1570
+ droppedAttrs;
1571
+ constructor(t, n, r) {
1572
+ let i = pr.get(t) ?? 0;
1573
+ if (pr.set(t, i + 1), this.standardAttrs = {
1574
+ [Zn]: t,
1575
+ [Xn]: `${t}/${i}`
1576
+ }, this.droppedAttrs = {
1577
+ ...this.standardAttrs,
1578
+ [e]: "queue_full"
1579
+ }, this.processedSpans = n.createCounter(er, {
1580
+ unit: "{span}",
1581
+ description: "The number of spans for which the processing has finished, either successful or failed."
1582
+ }), r) {
1583
+ let { capacity: e, getQueueSize: t } = r;
1584
+ n.createUpDownCounter(tr, {
1585
+ unit: "{span}",
1586
+ description: "The maximum number of spans the queue of a given instance of an SDK span processor can hold."
1587
+ }).add(e, this.standardAttrs), this.queueSize = n.createObservableUpDownCounter(nr, {
1588
+ unit: "{span}",
1589
+ description: "The number of spans in the queue of a given instance of an SDK span processor."
1590
+ }), this.queueSizeCallback = (e) => e.observe(t(), this.standardAttrs), this.queueSize.addCallback(this.queueSizeCallback);
1591
+ }
1592
+ }
1593
+ dropSpans(e) {
1594
+ this.processedSpans.add(e, this.droppedAttrs);
1595
+ }
1596
+ finishSpans(t, n) {
1597
+ if (!n) {
1598
+ this.processedSpans.add(t, this.standardAttrs);
1599
+ return;
1600
+ }
1601
+ let r = {
1602
+ ...this.standardAttrs,
1603
+ [e]: n.name
1604
+ };
1605
+ this.processedSpans.add(t, r);
1606
+ }
1607
+ shutdown() {
1608
+ this.queueSize && this.queueSizeCallback && this.queueSize.removeCallback(this.queueSizeCallback);
1609
+ }
1610
+ }, hr = class {
1611
+ _maxExportBatchSize;
1612
+ _maxQueueSize;
1613
+ _scheduledDelayMillis;
1614
+ _exportTimeoutMillis;
1615
+ _exporter;
1616
+ _metrics;
1617
+ _isExporting = !1;
1618
+ _finishedSpans = [];
1619
+ _timer;
1620
+ _shutdownOnce;
1621
+ _droppedSpansCount = 0;
1622
+ constructor(e) {
1623
+ this._exporter = e.exporter, this._maxExportBatchSize = e.maxExportBatchSize ?? 512, this._maxQueueSize = e.maxQueueSize ?? 2048, this._scheduledDelayMillis = e.scheduledDelayMillis ?? 5e3, this._exportTimeoutMillis = e.exportTimeoutMillis ?? 3e4, this._shutdownOnce = new In(this._shutdown, this), this._maxExportBatchSize > this._maxQueueSize && (E.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"), this._maxExportBatchSize = this._maxQueueSize);
1624
+ let t = e.selfObsMeterProvider ? e.selfObsMeterProvider.getMeter("@opentelemetry/sdk-trace") : ke();
1625
+ this._metrics = new mr(ar, t, {
1626
+ capacity: this._maxQueueSize,
1627
+ getQueueSize: () => this._finishedSpans.length
1628
+ });
1629
+ }
1630
+ forceFlush() {
1631
+ return this._shutdownOnce.isCalled ? this._shutdownOnce.promise : this._flushAll();
1632
+ }
1633
+ onStart(e, t) {}
1634
+ onEnd(e) {
1635
+ this._shutdownOnce.isCalled || (e.spanContext().traceFlags & S.SAMPLED) !== 0 && this._addToBuffer(e);
1636
+ }
1637
+ shutdown() {
1638
+ return this._shutdownOnce.call();
1639
+ }
1640
+ _shutdown() {
1641
+ return Promise.resolve().then(() => this.onShutdown()).then(() => this._flushAll()).then(() => (this._metrics.shutdown(), this._exporter.shutdown()));
1642
+ }
1643
+ _addToBuffer(e) {
1644
+ if (this._finishedSpans.length >= this._maxQueueSize) {
1645
+ this._droppedSpansCount === 0 && E.debug("maxQueueSize reached, dropping spans"), this._droppedSpansCount++, this._metrics.dropSpans(1);
1646
+ return;
1647
+ }
1648
+ this._droppedSpansCount > 0 && (E.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`), this._droppedSpansCount = 0), this._finishedSpans.push(e), this._maybeStartTimer();
1649
+ }
1650
+ _flushAll() {
1651
+ return new Promise((e, t) => {
1652
+ let n = [], r = Math.ceil(this._finishedSpans.length / this._maxExportBatchSize);
1653
+ for (let e = 0, t = r; e < t; e++) n.push(this._flushOneBatch());
1654
+ Promise.all(n).then(() => {
1655
+ e();
1656
+ }).catch(t);
1657
+ });
1658
+ }
1659
+ _flushOneBatch() {
1660
+ return this._clearTimer(), this._finishedSpans.length === 0 ? Promise.resolve() : new Promise((e, t) => {
1661
+ let n = setTimeout(() => {
1662
+ t(/* @__PURE__ */ Error("Timeout"));
1663
+ }, this._exportTimeoutMillis);
1664
+ T.with(_t(T.active()), () => {
1665
+ let r;
1666
+ this._finishedSpans.length <= this._maxExportBatchSize ? (r = this._finishedSpans, this._finishedSpans = []) : r = this._finishedSpans.splice(0, this._maxExportBatchSize);
1667
+ let i = () => this._exporter.export(r, (i) => {
1668
+ clearTimeout(n), this._metrics.finishSpans(r.length, i.error), i.code === I.SUCCESS ? e() : t(i.error ?? /* @__PURE__ */ Error("BatchSpanProcessor: span export failed"));
1669
+ }), a = null;
1670
+ for (let e = 0, t = r.length; e < t; e++) {
1671
+ let t = r[e];
1672
+ t.resource.asyncAttributesPending && t.resource.waitForAsyncAttributes && (a ??= [], a.push(t.resource.waitForAsyncAttributes()));
1673
+ }
1674
+ a === null ? i() : Promise.all(a).then(i, (e) => {
1675
+ A(e), t(e);
1676
+ });
1677
+ });
1678
+ });
1679
+ }
1680
+ _maybeStartTimer() {
1681
+ if (this._isExporting) return;
1682
+ let e = () => {
1683
+ this._isExporting = !0, this._flushOneBatch().finally(() => {
1684
+ this._isExporting = !1, this._finishedSpans.length > 0 && (this._clearTimer(), this._maybeStartTimer());
1685
+ }).catch((e) => {
1686
+ this._isExporting = !1, A(e);
1687
+ });
1688
+ };
1689
+ if (this._finishedSpans.length >= this._maxExportBatchSize) return e();
1690
+ this._timer === void 0 && (this._timer = setTimeout(() => e(), this._scheduledDelayMillis), typeof this._timer != "number" && this._timer.unref());
1691
+ }
1692
+ _clearTimer() {
1693
+ this._timer !== void 0 && (clearTimeout(this._timer), this._timer = void 0);
1694
+ }
1695
+ }, gr = class extends hr {
1696
+ _visibilityChangeListener;
1697
+ _pageHideListener;
1698
+ constructor(e) {
1699
+ super(e), this.onInit(e);
1700
+ }
1701
+ onInit(e) {
1702
+ e.disableAutoFlushOnDocumentHide !== !0 && typeof document < "u" && (this._visibilityChangeListener = () => {
1703
+ document.visibilityState === "hidden" && this.forceFlush().catch((e) => {
1704
+ A(e);
1705
+ });
1706
+ }, this._pageHideListener = () => {
1707
+ this.forceFlush().catch((e) => {
1708
+ A(e);
1709
+ });
1710
+ }, document.addEventListener("visibilitychange", this._visibilityChangeListener), document.addEventListener("pagehide", this._pageHideListener));
1711
+ }
1712
+ onShutdown() {
1713
+ typeof document < "u" && (this._visibilityChangeListener && document.removeEventListener("visibilitychange", this._visibilityChangeListener), this._pageHideListener && document.removeEventListener("pagehide", this._pageHideListener));
1714
+ }
1715
+ }, _r = 16, vr = 8, yr = new Uint8Array(_r), br = new Uint8Array(vr), xr = Array.from({ length: 256 }, (e, t) => t.toString(16).padStart(2, "0"));
1716
+ function Sr(e) {
1717
+ for (let t = 0; t < e.length; t++) e[t] = Math.random() * 256 >>> 0;
1718
+ for (let t = 0; t < e.length; t++) if (e[t] > 0) return;
1719
+ e[e.length - 1] = 1;
1720
+ }
1721
+ function Cr(e) {
1722
+ let t = "";
1723
+ for (let n = 0; n < e.length; n++) t += xr[e[n]];
1724
+ return t;
1725
+ }
1726
+ var wr = class {
1727
+ generateTraceId() {
1728
+ return Sr(yr), Cr(yr);
1729
+ }
1730
+ generateSpanId() {
1731
+ return Sr(br), Cr(br);
1732
+ }
1733
+ }, U;
1734
+ (function(e) {
1735
+ e[e.resolved = 0] = "resolved", e[e.timeout = 1] = "timeout", e[e.error = 2] = "error", e[e.unresolved = 3] = "unresolved";
1736
+ })(U ||= {});
1737
+ var Tr = class {
1738
+ _resource;
1739
+ _activeSpanProcessor;
1740
+ _forceFlushTimeoutMillis;
1741
+ _tracerOptions;
1742
+ _tracers = /* @__PURE__ */ new Map();
1743
+ constructor(e = {}) {
1744
+ this._forceFlushTimeoutMillis = e.forceFlushTimeoutMillis ?? 3e4, this._resource = e.resource ?? Vn();
1745
+ let t = e.spanProcessors ?? [];
1746
+ this._activeSpanProcessor = new dr(t), this._tracerOptions = {
1747
+ resource: this._resource,
1748
+ sampler: e.sampler ?? new H({ root: new V() }),
1749
+ spanLimits: {
1750
+ attributeCountLimit: e.spanLimits?.attributeCountLimit ?? 128,
1751
+ attributeValueLengthLimit: e.spanLimits?.attributeValueLengthLimit ?? Infinity,
1752
+ eventCountLimit: e.spanLimits?.eventCountLimit ?? 128,
1753
+ linkCountLimit: e.spanLimits?.linkCountLimit ?? 128,
1754
+ attributePerEventCountLimit: e.spanLimits?.attributePerEventCountLimit ?? 128,
1755
+ attributePerLinkCountLimit: e.spanLimits?.attributePerLinkCountLimit ?? 128
1756
+ },
1757
+ idGenerator: e.idGenerator || new wr(),
1758
+ spanProcessor: this._activeSpanProcessor,
1759
+ meterProvider: e.meterProvider ?? { getMeter() {
1760
+ return ke();
1761
+ } }
1762
+ };
1763
+ }
1764
+ getTracer(e, t, n) {
1765
+ let r = `${e}@${t || ""}:${n?.schemaUrl || ""}`;
1766
+ return this._tracers.has(r) || this._tracers.set(r, new ur({
1767
+ name: e,
1768
+ version: t,
1769
+ schemaUrl: n?.schemaUrl
1770
+ }, this._tracerOptions)), this._tracers.get(r);
1771
+ }
1772
+ forceFlush() {
1773
+ let e = this._forceFlushTimeoutMillis, t = this._activeSpanProcessor._spanProcessors.map((t) => new Promise((n) => {
1774
+ let r, i = setTimeout(() => {
1775
+ n(/* @__PURE__ */ Error(`Span processor did not completed within timeout period of ${e} ms`)), r = U.timeout;
1776
+ }, e);
1777
+ t.forceFlush().then(() => {
1778
+ clearTimeout(i), r !== U.timeout && (r = U.resolved, n(r));
1779
+ }).catch((e) => {
1780
+ clearTimeout(i), r = U.error, n(e);
1781
+ });
1782
+ }));
1783
+ return new Promise((e, n) => {
1784
+ Promise.all(t).then((t) => {
1785
+ let r = t.filter((e) => e !== U.resolved);
1786
+ r.length > 0 ? n(r) : e();
1787
+ }).catch((e) => n([e]));
1788
+ });
1789
+ }
1790
+ shutdown() {
1791
+ return this._activeSpanProcessor.shutdown();
1792
+ }
1793
+ [Kn](e, t, n) {
1794
+ let r = this._activeSpanProcessor._spanProcessors;
1795
+ return Jn("TracerProvider", {
1796
+ resource: { attributes: qn(this._resource) },
1797
+ tracers: Array.from(this._tracers.keys()),
1798
+ spanProcessors: r.map((e) => e.constructor?.name ?? "SpanProcessor")
1799
+ }, e, t, n);
1800
+ }
1801
+ }, Er = class {
1802
+ _ratio;
1803
+ _upperBound;
1804
+ constructor(e = 0) {
1805
+ this._ratio = this._normalize(e), this._upperBound = this._ratio === 1 ? 4294967296 : Math.floor(this._ratio * 4294967295);
1806
+ }
1807
+ shouldSample(e, t) {
1808
+ return { decision: Ge(t) && this._accumulate(t) < this._upperBound ? B.RECORD_AND_SAMPLED : B.NOT_RECORD };
1809
+ }
1810
+ toString() {
1811
+ return `TraceIdRatioBased{${this._ratio}}`;
1812
+ }
1813
+ _normalize(e) {
1814
+ return typeof e != "number" || isNaN(e) ? 0 : e >= 1 ? 1 : e <= 0 ? 0 : e;
1815
+ }
1816
+ _accumulate(e) {
1817
+ let t = 0;
1818
+ for (let n = 0; n < 32; n += 8) {
1819
+ let r = 0;
1820
+ for (let t = 0; t < 8; t++) {
1821
+ let i = e.charCodeAt(n + t), a = i < 58 ? i - 48 : i < 71 ? i - 55 : i - 87;
1822
+ r = r << 4 | a;
1823
+ }
1824
+ t = (t ^ r) >>> 0;
1825
+ }
1826
+ return t;
1827
+ }
1828
+ }, W;
1829
+ (function(e) {
1830
+ e.AlwaysOff = "always_off", e.AlwaysOn = "always_on", e.ParentBasedAlwaysOff = "parentbased_always_off", e.ParentBasedAlwaysOn = "parentbased_always_on", e.ParentBasedTraceIdRatio = "parentbased_traceidratio", e.TraceIdRatio = "traceidratio";
1831
+ })(W ||= {});
1832
+ var Dr = 1;
1833
+ function Or() {
1834
+ return {
1835
+ sampler: kr(),
1836
+ forceFlushTimeoutMillis: 3e4,
1837
+ generalLimits: {
1838
+ attributeValueLengthLimit: Infinity,
1839
+ attributeCountLimit: 128
1840
+ },
1841
+ spanLimits: {
1842
+ attributeValueLengthLimit: Infinity,
1843
+ attributeCountLimit: 128,
1844
+ linkCountLimit: 128,
1845
+ eventCountLimit: 128,
1846
+ attributePerEventCountLimit: 128,
1847
+ attributePerLinkCountLimit: 128
1848
+ }
1849
+ };
1850
+ }
1851
+ function kr() {
1852
+ let e = W.ParentBasedAlwaysOn;
1853
+ switch (e) {
1854
+ case W.AlwaysOn: return new V();
1855
+ case W.AlwaysOff: return new fr();
1856
+ case W.ParentBasedAlwaysOn: return new H({ root: new V() });
1857
+ case W.ParentBasedAlwaysOff: return new H({ root: new fr() });
1858
+ case W.TraceIdRatio: return new Er(Ar());
1859
+ case W.ParentBasedTraceIdRatio: return new H({ root: new Er(Ar()) });
1860
+ default: return E.error(`OTEL_TRACES_SAMPLER value "${e}" invalid, defaulting to "${W.ParentBasedAlwaysOn}".`), new H({ root: new V() });
1861
+ }
1862
+ }
1863
+ function Ar() {
1864
+ return E.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Dr}.`), Dr;
1865
+ }
1866
+ function jr(e) {
1867
+ let t = Object.assign({}, e.spanLimits);
1868
+ return t.attributeCountLimit = e.spanLimits?.attributeCountLimit ?? e.generalLimits?.attributeCountLimit ?? void 0 ?? void 0 ?? 128, t.attributeValueLengthLimit = e.spanLimits?.attributeValueLengthLimit ?? e.generalLimits?.attributeValueLengthLimit ?? void 0 ?? void 0 ?? Infinity, Object.assign({}, e, { spanLimits: t });
1869
+ }
1870
+ //#endregion
1871
+ //#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-base@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-base/build/esm/BasicTracerProvider-shim.js
1872
+ var Mr = class extends Tr {
1873
+ constructor(e = {}) {
1874
+ let t = Tn({}, Or(), jr(e));
1875
+ delete t.generalLimits, super(t);
1876
+ }
1877
+ }, Nr = class extends gr {
1878
+ constructor(e, t) {
1879
+ t ||= {};
1880
+ for (let [e, n] of [
1881
+ ["maxExportBatchSize", "OTEL_BSP_MAX_EXPORT_BATCH_SIZE"],
1882
+ ["maxQueueSize", "OTEL_BSP_MAX_QUEUE_SIZE"],
1883
+ ["scheduledDelayMillis", "OTEL_BSP_SCHEDULE_DELAY"],
1884
+ ["exportTimeoutMillis", "OTEL_BSP_EXPORT_TIMEOUT"]
1885
+ ]) t[e];
1886
+ super({
1887
+ exporter: e,
1888
+ ...t
1889
+ });
1890
+ }
1891
+ }, Pr = class {
1892
+ _enabled = !1;
1893
+ _currentContext = b;
1894
+ _bindFunction(e = b, t) {
1895
+ let n = this, r = function(...r) {
1896
+ return n.with(e, () => t.apply(this, r));
1897
+ };
1898
+ return Object.defineProperty(r, "length", {
1899
+ enumerable: !1,
1900
+ configurable: !0,
1901
+ writable: !1,
1902
+ value: t.length
1903
+ }), r;
1904
+ }
1905
+ active() {
1906
+ return this._currentContext;
1907
+ }
1908
+ bind(e, t) {
1909
+ return e === void 0 && (e = this.active()), typeof t == "function" ? this._bindFunction(e, t) : t;
1910
+ }
1911
+ disable() {
1912
+ return this._currentContext = b, this._enabled = !1, this;
1913
+ }
1914
+ enable() {
1915
+ return this._enabled ? this : (this._enabled = !0, this._currentContext = b, this);
1916
+ }
1917
+ with(e, t, n, ...r) {
1918
+ let i = this._currentContext;
1919
+ this._currentContext = e || b;
1920
+ try {
1921
+ return t.call(n, ...r);
1922
+ } finally {
1923
+ this._currentContext = i;
1924
+ }
1925
+ }
1926
+ };
1927
+ //#endregion
1928
+ //#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-web@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-web/build/esm/WebTracerProvider.js
1929
+ function Fr(e) {
1930
+ if (e !== null) {
1931
+ if (e === void 0) {
1932
+ let e = new Pr();
1933
+ e.enable(), T.setGlobalContextManager(e);
1934
+ return;
1935
+ }
1936
+ e.enable(), T.setGlobalContextManager(e);
1937
+ }
1938
+ }
1939
+ function Ir(e) {
1940
+ if (e !== null) {
1941
+ if (e === void 0) {
1942
+ D.setGlobalPropagator(new Gt({ propagators: [new ln(), new Tt()] }));
1943
+ return;
1944
+ }
1945
+ D.setGlobalPropagator(e);
1946
+ }
1947
+ }
1948
+ var Lr = class extends Mr {
1949
+ constructor(e = {}) {
1950
+ super(e);
1951
+ }
1952
+ register(e = {}) {
1953
+ O.setGlobalTracerProvider(this), Ir(e.propagator), Fr(e.contextManager);
1954
+ }
1955
+ }, G;
1956
+ (function(e) {
1957
+ e.CONNECT_END = "connectEnd", e.CONNECT_START = "connectStart", e.DECODED_BODY_SIZE = "decodedBodySize", e.DOM_COMPLETE = "domComplete", e.DOM_CONTENT_LOADED_EVENT_END = "domContentLoadedEventEnd", e.DOM_CONTENT_LOADED_EVENT_START = "domContentLoadedEventStart", e.DOM_INTERACTIVE = "domInteractive", e.DOMAIN_LOOKUP_END = "domainLookupEnd", e.DOMAIN_LOOKUP_START = "domainLookupStart", e.ENCODED_BODY_SIZE = "encodedBodySize", e.FETCH_START = "fetchStart", e.LOAD_EVENT_END = "loadEventEnd", e.LOAD_EVENT_START = "loadEventStart", e.NAVIGATION_START = "navigationStart", e.REDIRECT_END = "redirectEnd", e.REDIRECT_START = "redirectStart", e.REQUEST_START = "requestStart", e.RESPONSE_END = "responseEnd", e.RESPONSE_START = "responseStart", e.SECURE_CONNECTION_START = "secureConnectionStart", e.START_TIME = "startTime", e.UNLOAD_EVENT_END = "unloadEventEnd", e.UNLOAD_EVENT_START = "unloadEventStart";
1958
+ })(G ||= {});
1959
+ //#endregion
1960
+ //#region ../../node_modules/.pnpm/@opentelemetry+sdk-trace-web@2.10.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/sdk-trace-web/build/esm/semconv.js
1961
+ var Rr = "http.response_content_length", zr = "http.response_content_length_uncompressed", Br;
1962
+ function Vr() {
1963
+ return Br ||= document.createElement("a"), Br;
1964
+ }
1965
+ function K(e, t) {
1966
+ return t in e;
1967
+ }
1968
+ function q(e, t, n, r = !0) {
1969
+ if (K(n, t) && typeof n[t] == "number" && !(r && n[t] === 0)) return e.addEvent(t, n[t]);
1970
+ }
1971
+ function Hr(e, t, n = !1, r, i) {
1972
+ if (r === void 0 && (r = t[G.START_TIME] !== 0), n || (q(e, G.FETCH_START, t, r), q(e, G.DOMAIN_LOOKUP_START, t, r), q(e, G.DOMAIN_LOOKUP_END, t, r), q(e, G.CONNECT_START, t, r), q(e, G.SECURE_CONNECTION_START, t, r), q(e, G.CONNECT_END, t, r), q(e, G.REQUEST_START, t, r), q(e, G.RESPONSE_START, t, r), q(e, G.RESPONSE_END, t, r)), !i) {
1973
+ let n = t[G.ENCODED_BODY_SIZE];
1974
+ n !== void 0 && e.setAttribute(Rr, n);
1975
+ let r = t[G.DECODED_BODY_SIZE];
1976
+ r !== void 0 && n !== r && e.setAttribute(zr, r);
1977
+ }
1978
+ }
1979
+ function Ur(e) {
1980
+ return e.slice().sort((e, t) => {
1981
+ let n = e[G.FETCH_START], r = t[G.FETCH_START];
1982
+ return n > r ? 1 : n < r ? -1 : 0;
1983
+ });
1984
+ }
1985
+ function Wr() {
1986
+ return typeof location < "u" ? location.origin : void 0;
1987
+ }
1988
+ function Gr(e, t, n, r, i = /* @__PURE__ */ new WeakSet(), a) {
1989
+ let o = Jr(e);
1990
+ e = o.toString();
1991
+ let s = qr(e, t, n, r, i, a);
1992
+ if (s.length === 0) return { mainRequest: void 0 };
1993
+ if (s.length === 1) return { mainRequest: s[0] };
1994
+ let c = Ur(s);
1995
+ if (o.origin !== Wr() && c.length > 1) {
1996
+ let e = c[0], t = Kr(c, e[G.RESPONSE_END], n), r = e[G.RESPONSE_END];
1997
+ return t[G.FETCH_START] < r && (t = e, e = void 0), {
1998
+ corsPreFlightRequest: e,
1999
+ mainRequest: t
2000
+ };
2001
+ }
2002
+ return { mainRequest: s[0] };
2003
+ }
2004
+ function Kr(e, t, n) {
2005
+ let r = F(n), i = F(P(t)), a = e[1], o, s = e.length;
2006
+ for (let t = 1; t < s; t++) {
2007
+ let n = e[t], s = F(P(n[G.FETCH_START])), c = r - F(P(n[G.RESPONSE_END]));
2008
+ s >= i && (!o || c < o) && (o = c, a = n);
2009
+ }
2010
+ return a;
2011
+ }
2012
+ function qr(e, t, n, r, i, a) {
2013
+ let o = F(t), s = F(n), c = r.filter((t) => {
2014
+ let n = F(P(t[G.FETCH_START])), r = F(P(t[G.RESPONSE_END]));
2015
+ return t.initiatorType.toLowerCase() === (a || "xmlhttprequest") && t.name === e && n >= o && r <= s;
2016
+ });
2017
+ return c.length > 0 && (c = c.filter((e) => !i.has(e))), c;
2018
+ }
2019
+ function Jr(e) {
2020
+ if (typeof URL == "function") return new URL(e, typeof document < "u" ? document.baseURI : typeof location < "u" ? location.href : void 0);
2021
+ let t = Vr();
2022
+ return t.href = e, t;
2023
+ }
2024
+ function Yr(e, t) {
2025
+ let n = t || [];
2026
+ return (typeof n == "string" || n instanceof RegExp) && (n = [n]), Jr(e).origin === Wr() || n.some((t) => Nn(e, t));
2027
+ }
2028
+ //#endregion
2029
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/OTLPExporterBase.js
2030
+ var Xr = class {
2031
+ _delegate;
2032
+ constructor(e) {
2033
+ this._delegate = e;
2034
+ }
2035
+ export(e, t) {
2036
+ this._delegate.export(e, t);
2037
+ }
2038
+ forceFlush() {
2039
+ return this._delegate.forceFlush();
2040
+ }
2041
+ shutdown() {
2042
+ return this._delegate.shutdown();
2043
+ }
2044
+ setMetrics(e) {
2045
+ this._delegate.setMetrics(e);
2046
+ }
2047
+ }, Zr = class extends Error {
2048
+ code;
2049
+ name = "OTLPExporterError";
2050
+ data;
2051
+ constructor(e, t, n) {
2052
+ super(e), this.data = n, this.code = t;
2053
+ }
2054
+ };
2055
+ //#endregion
2056
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/shared-configuration.js
2057
+ function Qr(e) {
2058
+ if (Number.isFinite(e) && e > 0) return e;
2059
+ throw Error(`Configuration: timeoutMillis is invalid, expected number greater than 0 (actual: '${e}')`);
2060
+ }
2061
+ function $r(e) {
2062
+ if (e != null) return async () => e;
2063
+ }
2064
+ function ei(e, t, n) {
2065
+ return {
2066
+ timeoutMillis: Qr(e.timeoutMillis ?? t.timeoutMillis ?? n.timeoutMillis),
2067
+ concurrencyLimit: e.concurrencyLimit ?? t.concurrencyLimit ?? n.concurrencyLimit,
2068
+ compression: e.compression ?? t.compression ?? n.compression
2069
+ };
2070
+ }
2071
+ function ti() {
2072
+ return {
2073
+ timeoutMillis: 1e4,
2074
+ concurrencyLimit: 30,
2075
+ compression: "none"
2076
+ };
2077
+ }
2078
+ //#endregion
2079
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/bounded-queue-export-promise-handler.js
2080
+ var ni = class {
2081
+ _concurrencyLimit;
2082
+ _sendingPromises = [];
2083
+ constructor(e) {
2084
+ this._concurrencyLimit = e;
2085
+ }
2086
+ pushPromise(e) {
2087
+ if (this.hasReachedLimit()) throw Error("Concurrency Limit reached");
2088
+ this._sendingPromises.push(e);
2089
+ let t = () => {
2090
+ let t = this._sendingPromises.indexOf(e);
2091
+ this._sendingPromises.splice(t, 1);
2092
+ };
2093
+ e.then(t, t);
2094
+ }
2095
+ hasReachedLimit() {
2096
+ return this._sendingPromises.length >= this._concurrencyLimit;
2097
+ }
2098
+ async awaitAll() {
2099
+ await Promise.all(this._sendingPromises);
2100
+ }
2101
+ };
2102
+ function ri(e) {
2103
+ return new ni(e.concurrencyLimit);
2104
+ }
2105
+ //#endregion
2106
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/logging-response-handler.js
2107
+ function ii(e) {
2108
+ return Object.prototype.hasOwnProperty.call(e, "partialSuccess");
2109
+ }
2110
+ function ai() {
2111
+ return { handleResponse(e) {
2112
+ e == null || !ii(e) || e.partialSuccess == null || Object.keys(e.partialSuccess).length === 0 || E.warn("Received Partial Success response:", JSON.stringify(e.partialSuccess));
2113
+ } };
2114
+ }
2115
+ //#endregion
2116
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-export-delegate.js
2117
+ var oi = class {
2118
+ _metrics;
2119
+ _diagLogger;
2120
+ _transport;
2121
+ _serializer;
2122
+ _responseHandler;
2123
+ _promiseQueue;
2124
+ _timeout;
2125
+ constructor(e, t, n, r, i, a) {
2126
+ this._transport = e, this._serializer = t, this._responseHandler = n, this._promiseQueue = r, this._timeout = a, this._diagLogger = E.createComponentLogger({ namespace: "OTLPExportDelegate" }), this._metrics = i;
2127
+ }
2128
+ export(e, t) {
2129
+ if (this._diagLogger.debug("items to be sent", e), this._promiseQueue.hasReachedLimit()) {
2130
+ t({
2131
+ code: I.FAILED,
2132
+ error: /* @__PURE__ */ Error("Concurrent export limit reached")
2133
+ });
2134
+ return;
2135
+ }
2136
+ let n = this._serializer.serializeRequest(e);
2137
+ if (n == null) {
2138
+ t({
2139
+ code: I.FAILED,
2140
+ error: /* @__PURE__ */ Error("Nothing to send")
2141
+ });
2142
+ return;
2143
+ }
2144
+ let r = this._metrics.startExport(e);
2145
+ this._promiseQueue.pushPromise(this._transport.send(n, this._timeout).then((e) => {
2146
+ if (e.status === "success") {
2147
+ if (r(void 0), e.data != null) try {
2148
+ this._responseHandler.handleResponse(this._serializer.deserializeResponse(e.data));
2149
+ } catch (t) {
2150
+ this._diagLogger.warn("Export succeeded but could not deserialize response - is the response specification compliant?", t, e.data);
2151
+ }
2152
+ t({ code: I.SUCCESS });
2153
+ return;
2154
+ }
2155
+ if (e.status === "failure" && e.error) {
2156
+ r(e.error), t({
2157
+ code: I.FAILED,
2158
+ error: e.error
2159
+ });
2160
+ return;
2161
+ }
2162
+ e.status === "retryable" ? (r("export_max_retries"), t({
2163
+ code: I.FAILED,
2164
+ error: e.error ?? new Zr("Export failed with retryable status")
2165
+ })) : (r("export_failed"), t({
2166
+ code: I.FAILED,
2167
+ error: new Zr("Export failed with unknown error")
2168
+ }));
2169
+ }, (e) => {
2170
+ r(e), t({
2171
+ code: I.FAILED,
2172
+ error: e
2173
+ });
2174
+ }));
2175
+ }
2176
+ forceFlush() {
2177
+ return this._promiseQueue.awaitAll();
2178
+ }
2179
+ setMetrics(e) {
2180
+ this._metrics = e;
2181
+ }
2182
+ async shutdown() {
2183
+ this._diagLogger.debug("shutdown started"), await this.forceFlush(), this._transport.shutdown();
2184
+ }
2185
+ };
2186
+ function si(e, t) {
2187
+ return new oi(e.transport, e.serializer, ai(), e.promiseHandler, e.metrics, t.timeout);
2188
+ }
2189
+ //#endregion
2190
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-network-export-delegate.js
2191
+ function ci(e, t, n, r) {
2192
+ return si({
2193
+ transport: r,
2194
+ serializer: t,
2195
+ promiseHandler: ri(e),
2196
+ metrics: n
2197
+ }, { timeout: e.timeoutMillis });
2198
+ }
2199
+ //#endregion
2200
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/semconv.js
2201
+ var li = "http.response.status_code", ui = "otel.component.name", di = "otel.component.type", fi = "server.address", pi = "server.port", mi = "error.type", hi = "0.221.0", gi = /* @__PURE__ */ new Map(), _i = class {
2202
+ inflight;
2203
+ exported;
2204
+ duration;
2205
+ standardAttrs;
2206
+ responseAttributesFromError;
2207
+ helper;
2208
+ constructor(e) {
2209
+ let { componentType: t, metricsHelper: n, meterProvider: r, url: i, responseAttributesFromError: a } = e;
2210
+ this.responseAttributesFromError = a;
2211
+ let o = r ? r.getMeter("@opentelemetry/otlp-exporter", hi) : ke(), s = gi.get(t) ?? 0;
2212
+ if (gi.set(t, s + 1), this.standardAttrs = {
2213
+ [di]: t,
2214
+ [ui]: `${t}/${s}`
2215
+ }, i) {
2216
+ let e = i;
2217
+ i.includes("://") || (e = `http://${i}`);
2218
+ try {
2219
+ let t = new URL(e);
2220
+ this.standardAttrs[fi] = t.hostname;
2221
+ let n;
2222
+ t.port ? n = Number(t.port) : t.protocol === "http:" ? n = 80 : t.protocol === "https:" && (n = 443), typeof n == "number" && (this.standardAttrs[pi] = n);
2223
+ } catch {}
2224
+ }
2225
+ this.helper = n, this.inflight = o.createUpDownCounter(`otel.sdk.exporter.${this.helper.name}.inflight`, {
2226
+ unit: `{${this.helper.name}}`,
2227
+ description: `The number of ${this.helper.name}s which were passed to the exporter, but that have not been exported yet (neither successful, nor failed).`
2228
+ }), this.exported = o.createCounter(`otel.sdk.exporter.${this.helper.name}.exported`, {
2229
+ unit: `{${this.helper.name}}`,
2230
+ description: `The number of ${this.helper.name}s for which the export has finished, either successful or failed.`
2231
+ }), this.duration = o.createHistogram("otel.sdk.exporter.operation.duration", {
2232
+ unit: "s",
2233
+ description: "The duration of exporting a batch of telemetry records.",
2234
+ advice: { explicitBucketBoundaries: [] }
2235
+ });
2236
+ }
2237
+ startExport(e) {
2238
+ let t = this.helper.countItems(e), n = N();
2239
+ return this.inflight.add(t, this.standardAttrs), (e) => {
2240
+ let r = N();
2241
+ this.inflight.add(-t, this.standardAttrs);
2242
+ let i = e ? {
2243
+ ...this.standardAttrs,
2244
+ [mi]: e instanceof Error ? e.name : "export_failed"
2245
+ } : this.standardAttrs;
2246
+ this.exported.add(t, i);
2247
+ let a = {
2248
+ ...i,
2249
+ ...this.responseAttributesFromError(e)
2250
+ }, o = Vt(Bt(n, r)) / 1e3;
2251
+ this.duration.record(o, a);
2252
+ };
2253
+ }
2254
+ }, vi = {
2255
+ name: "span",
2256
+ countItems: (e) => e.length
2257
+ }, yi = class {
2258
+ emit(e) {}
2259
+ enabled() {
2260
+ return !1;
2261
+ }
2262
+ }, bi = new yi(), xi = Symbol.for("io.opentelemetry.js.api.logs"), J = globalThis;
2263
+ function Si(e, t, n) {
2264
+ return (r) => r === e ? t : n;
2265
+ }
2266
+ var Ci = new class {
2267
+ getLogger(e, t, n) {
2268
+ return new yi();
2269
+ }
2270
+ }(), wi = class {
2271
+ constructor(e, t, n, r) {
2272
+ this._provider = e, this.name = t, this.version = n, this.options = r;
2273
+ }
2274
+ emit(e) {
2275
+ this._getLogger().emit(e);
2276
+ }
2277
+ enabled(e) {
2278
+ return this._getLogger().enabled(e);
2279
+ }
2280
+ _getLogger() {
2281
+ if (this._delegate) return this._delegate;
2282
+ let e = this._provider._getDelegateLogger(this.name, this.version, this.options);
2283
+ return e ? (this._delegate = e, this._delegate) : bi;
2284
+ }
2285
+ }, Ti = class {
2286
+ getLogger(e, t, n) {
2287
+ return this._getDelegateLogger(e, t, n) ?? new wi(this, e, t, n);
2288
+ }
2289
+ _getDelegate() {
2290
+ return this._delegate ?? Ci;
2291
+ }
2292
+ _setDelegate(e) {
2293
+ this._delegate = e;
2294
+ }
2295
+ _getDelegateLogger(e, t, n) {
2296
+ return this._delegate?.getLogger(e, t, n);
2297
+ }
2298
+ }, Ei = class e {
2299
+ constructor() {
2300
+ this._proxyLoggerProvider = new Ti();
2301
+ }
2302
+ static getInstance() {
2303
+ return this._instance ||= new e(), this._instance;
2304
+ }
2305
+ setGlobalLoggerProvider(e) {
2306
+ return J[xi] ? this.getLoggerProvider() : (J[xi] = Si(1, e, Ci), this._proxyLoggerProvider._setDelegate(e), e);
2307
+ }
2308
+ getLoggerProvider() {
2309
+ return J[xi]?.call(J, 1) ?? this._proxyLoggerProvider;
2310
+ }
2311
+ getLogger(e, t, n) {
2312
+ return this.getLoggerProvider().getLogger(e, t, n);
2313
+ }
2314
+ disable() {
2315
+ delete J[xi], this._proxyLoggerProvider = new Ti();
2316
+ }
2317
+ }.getInstance();
2318
+ //#endregion
2319
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/common/internal.js
2320
+ function Di(e, t) {
2321
+ let n = {
2322
+ attributes: Y(e.attributes, t),
2323
+ droppedAttributesCount: 0
2324
+ }, r = e.schemaUrl;
2325
+ return r && r !== "" && (n.schemaUrl = r), n;
2326
+ }
2327
+ function Oi(e, t) {
2328
+ let n = {
2329
+ name: e.name,
2330
+ version: e.version
2331
+ };
2332
+ return e.attributes && Object.keys(e.attributes).length > 0 && (n.attributes = Y(e.attributes, t), n.droppedAttributesCount = e.droppedAttributesCount ?? 0), n;
2333
+ }
2334
+ function Y(e, t) {
2335
+ return Object.keys(e).map((n) => ki(n, e[n], t));
2336
+ }
2337
+ function ki(e, t, n) {
2338
+ return {
2339
+ key: e,
2340
+ value: Ai(t, n)
2341
+ };
2342
+ }
2343
+ function Ai(e, t) {
2344
+ let n = typeof e;
2345
+ if (n === "string") return { stringValue: e };
2346
+ if (n === "number") return Number.isInteger(e) ? { intValue: e } : { doubleValue: e };
2347
+ if (n === "boolean") return { boolValue: e };
2348
+ if (e instanceof Uint8Array) return { bytesValue: t.encodeUint8Array(e) };
2349
+ if (Array.isArray(e)) {
2350
+ let n = Array(e.length);
2351
+ for (let r = 0; r < e.length; r++) n[r] = Ai(e[r], t);
2352
+ return { arrayValue: { values: n } };
2353
+ }
2354
+ if (n === "object" && e != null) {
2355
+ let n = Object.keys(e), r = Array(n.length);
2356
+ for (let i = 0; i < n.length; i++) r[i] = {
2357
+ key: n[i],
2358
+ value: Ai(e[n[i]], t)
2359
+ };
2360
+ return { kvlistValue: { values: r } };
2361
+ }
2362
+ return {};
2363
+ }
2364
+ //#endregion
2365
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/common/utils.js
2366
+ function ji(e) {
2367
+ let t = BigInt(1e9);
2368
+ return BigInt(Math.trunc(e[0])) * t + BigInt(Math.trunc(e[1]));
2369
+ }
2370
+ function Mi(e) {
2371
+ return ji(e).toString();
2372
+ }
2373
+ var Ni = typeof BigInt < "u" ? Mi : F;
2374
+ function Pi(e) {
2375
+ return e;
2376
+ }
2377
+ var Fi = {
2378
+ encodeHrTime: Ni,
2379
+ encodeSpanContext: Pi,
2380
+ encodeOptionalSpanContext: Pi,
2381
+ encodeUint8Array: (e) => {
2382
+ if (typeof Buffer < "u") return Buffer.from(e).toString("base64");
2383
+ let t = Array(e.length);
2384
+ for (let n = 0; n < e.length; n++) t[n] = String.fromCharCode(e[n]);
2385
+ return btoa(t.join(""));
2386
+ }
2387
+ }, Ii = 256, Li = 512;
2388
+ function Ri(e, t) {
2389
+ let n = e & 255 | Ii;
2390
+ return t && (n |= Li), n;
2391
+ }
2392
+ function zi(e, t) {
2393
+ let n = e.spanContext(), r = e.status, i = e.parentSpanContext?.spanId ? t.encodeSpanContext(e.parentSpanContext?.spanId) : void 0;
2394
+ return {
2395
+ traceId: t.encodeSpanContext(n.traceId),
2396
+ spanId: t.encodeSpanContext(n.spanId),
2397
+ parentSpanId: i,
2398
+ traceState: n.traceState?.serialize(),
2399
+ name: e.name,
2400
+ kind: e.kind == null ? 0 : e.kind + 1,
2401
+ startTimeUnixNano: t.encodeHrTime(e.startTime),
2402
+ endTimeUnixNano: t.encodeHrTime(e.endTime),
2403
+ attributes: Y(e.attributes, t),
2404
+ droppedAttributesCount: e.droppedAttributesCount,
2405
+ events: e.events.map((e) => Vi(e, t)),
2406
+ droppedEventsCount: e.droppedEventsCount,
2407
+ status: {
2408
+ code: r.code,
2409
+ message: r.message
2410
+ },
2411
+ links: e.links.map((e) => Bi(e, t)),
2412
+ droppedLinksCount: e.droppedLinksCount,
2413
+ flags: Ri(n.traceFlags, e.parentSpanContext?.isRemote)
2414
+ };
2415
+ }
2416
+ function Bi(e, t) {
2417
+ return {
2418
+ attributes: e.attributes ? Y(e.attributes, t) : [],
2419
+ spanId: t.encodeSpanContext(e.context.spanId),
2420
+ traceId: t.encodeSpanContext(e.context.traceId),
2421
+ traceState: e.context.traceState?.serialize(),
2422
+ droppedAttributesCount: e.droppedAttributesCount || 0,
2423
+ flags: Ri(e.context.traceFlags, e.context.isRemote)
2424
+ };
2425
+ }
2426
+ function Vi(e, t) {
2427
+ return {
2428
+ attributes: e.attributes ? Y(e.attributes, t) : [],
2429
+ name: e.name,
2430
+ timeUnixNano: t.encodeHrTime(e.time),
2431
+ droppedAttributesCount: e.droppedAttributesCount || 0
2432
+ };
2433
+ }
2434
+ function Hi(e, t) {
2435
+ return { resourceSpans: Wi(e, t) };
2436
+ }
2437
+ function Ui(e) {
2438
+ let t = /* @__PURE__ */ new Map();
2439
+ for (let n of e) {
2440
+ let e = t.get(n.resource);
2441
+ e || (e = /* @__PURE__ */ new Map(), t.set(n.resource, e));
2442
+ let r = `${n.instrumentationScope.name}@${n.instrumentationScope.version || ""}:${n.instrumentationScope.schemaUrl || ""}`, i = e.get(r);
2443
+ i || (i = [], e.set(r, i)), i.push(n);
2444
+ }
2445
+ return t;
2446
+ }
2447
+ function Wi(e, t) {
2448
+ let n = Ui(e), r = [], i = n.entries(), a = i.next();
2449
+ for (; !a.done;) {
2450
+ let [e, n] = a.value, o = [], s = n.values(), c = s.next();
2451
+ for (; !c.done;) {
2452
+ let e = c.value;
2453
+ if (e.length > 0) {
2454
+ let n = e.map((e) => zi(e, t));
2455
+ o.push({
2456
+ scope: Oi(e[0].instrumentationScope, t),
2457
+ spans: n,
2458
+ schemaUrl: e[0].instrumentationScope.schemaUrl
2459
+ });
2460
+ }
2461
+ c = s.next();
2462
+ }
2463
+ let l = Di(e, t), u = {
2464
+ resource: l,
2465
+ scopeSpans: o,
2466
+ schemaUrl: l.schemaUrl
2467
+ };
2468
+ r.push(u), a = i.next();
2469
+ }
2470
+ return r;
2471
+ }
2472
+ //#endregion
2473
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-transformer@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-transformer/build/esm/trace/json/trace.js
2474
+ var Gi = {
2475
+ serializeRequest: (e) => {
2476
+ let t = Hi(e, Fi);
2477
+ return new TextEncoder().encode(JSON.stringify(t));
2478
+ },
2479
+ deserializeResponse: (e) => {
2480
+ if (e.length === 0) return {};
2481
+ let t = new TextDecoder();
2482
+ try {
2483
+ return JSON.parse(t.decode(e));
2484
+ } catch (e) {
2485
+ return E.warn(`Failed to parse trace export response: ${e.message}. Returning empty response`), {};
2486
+ }
2487
+ }
2488
+ }, Ki = 5, qi = 1e3, Ji = 5e3, Yi = 1.5, Xi = .2;
2489
+ function Zi() {
2490
+ return 2 * Xi * Math.random() - Xi;
2491
+ }
2492
+ var Qi = class {
2493
+ _transport;
2494
+ constructor(e) {
2495
+ this._transport = e;
2496
+ }
2497
+ retry(e, t, n) {
2498
+ return new Promise((r, i) => {
2499
+ setTimeout(() => {
2500
+ this._transport.send(e, t).then(r, i);
2501
+ }, n);
2502
+ });
2503
+ }
2504
+ async send(e, t) {
2505
+ let n = Ki, r = qi, i = Date.now() + t, a = await this._transport.send(e, t);
2506
+ for (; a.status === "retryable" && n > 0;) {
2507
+ n--;
2508
+ let t = Math.max(Math.min(r * (1 + Zi()), Ji), 0);
2509
+ r *= Yi;
2510
+ let o = a.retryInMillis ?? t, s = i - Date.now();
2511
+ if (o > s) return E.info(`Export retry time ${Math.round(o)}ms exceeds remaining timeout ${Math.round(s)}ms, not retrying further.`), a;
2512
+ E.verbose(`Scheduling export retry in ${Math.round(o)}ms`), a = await this.retry(e, s, o);
2513
+ }
2514
+ return a.status === "success" ? E.verbose(`Export succeeded after ${Ki - n} retry attempts.`) : a.status === "retryable" ? E.info(`Export failed after maximum retry attempts (${Ki}).`) : E.info(`Export failed with non-retryable error: ${a.error}`), a;
2515
+ }
2516
+ shutdown() {
2517
+ return this._transport.shutdown();
2518
+ }
2519
+ };
2520
+ function $i(e) {
2521
+ return new Qi(e.transport);
2522
+ }
2523
+ //#endregion
2524
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/is-export-retryable.js
2525
+ function ea(e) {
2526
+ return e === 429 || e === 502 || e === 503 || e === 504;
2527
+ }
2528
+ function ta(e) {
2529
+ if (e == null) return;
2530
+ let t = Number.parseInt(e, 10);
2531
+ if (Number.isInteger(t)) return t > 0 ? t * 1e3 : -1;
2532
+ let n = new Date(e).getTime() - Date.now();
2533
+ return n >= 0 ? n : 0;
2534
+ }
2535
+ //#endregion
2536
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/transport/fetch-transport.js
2537
+ var na = 61440, ra = 9, ia = 0, aa = 0, oa = class {
2538
+ _parameters;
2539
+ constructor(e) {
2540
+ this._parameters = e;
2541
+ }
2542
+ async send(e, t) {
2543
+ let n = new AbortController(), r = setTimeout(() => n.abort(), t), i = globalThis.fetch;
2544
+ typeof i.__original == "function" && (i = i.__original);
2545
+ let a = e.byteLength, o = ia + a > na, s = !o && !(aa >= ra);
2546
+ if (s) ia += a, aa++;
2547
+ else {
2548
+ let e = o ? "size limit" : "count limit";
2549
+ E.debug(`keepalive disabled: ${(a / 1024).toFixed(1)}KB payload, ${aa} pending (${e})`);
2550
+ }
2551
+ try {
2552
+ let t = new URL(this._parameters.url), r = await i(t.href, {
2553
+ method: "POST",
2554
+ headers: await this._parameters.headers(),
2555
+ body: e,
2556
+ signal: n.signal,
2557
+ keepalive: s,
2558
+ mode: globalThis.location ? globalThis.location.origin === t.origin ? "same-origin" : "cors" : "no-cors"
2559
+ });
2560
+ return r.status >= 200 && r.status <= 299 ? (E.debug(`export response success (status: ${r.status})`), { status: "success" }) : ea(r.status) ? (E.warn(`export response retryable (status: ${r.status})`), {
2561
+ status: "retryable",
2562
+ retryInMillis: ta(r.headers.get("Retry-After"))
2563
+ }) : (E.error(`export response failure (status: ${r.status})`), {
2564
+ status: "failure",
2565
+ error: /* @__PURE__ */ Error(`Fetch request failed with non-retryable status ${r.status}`)
2566
+ });
2567
+ } catch (e) {
2568
+ return ca(e) ? (E.warn(`export request retryable (network error: ${e})`), {
2569
+ status: "retryable",
2570
+ error: Error("Fetch request encountered a network error", { cause: e })
2571
+ }) : (E.error(`export request failure (error: ${e})`), {
2572
+ status: "failure",
2573
+ error: Error("Fetch request errored", { cause: e })
2574
+ });
2575
+ } finally {
2576
+ clearTimeout(r), s && (ia -= a, aa--);
2577
+ }
2578
+ }
2579
+ shutdown() {}
2580
+ };
2581
+ function sa(e) {
2582
+ return new oa(e);
2583
+ }
2584
+ function ca(e) {
2585
+ return e instanceof TypeError && !e.cause;
2586
+ }
2587
+ //#endregion
2588
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/otlp-browser-http-export-delegate.js
2589
+ function la(e, t, n) {
2590
+ return ci(e, t, n, $i({ transport: sa(e) }));
2591
+ }
2592
+ //#endregion
2593
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/util.js
2594
+ function ua(e) {
2595
+ let t = {};
2596
+ return Object.entries(e ?? {}).forEach(([e, n]) => {
2597
+ n === void 0 ? E.warn(`Header "${e}" has invalid value (${n}) and will be ignored`) : t[e] = String(n);
2598
+ }), t;
2599
+ }
2600
+ //#endregion
2601
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/otlp-http-configuration.js
2602
+ function da(e, t, n) {
2603
+ return async () => {
2604
+ let r = { ...await n() }, i = {};
2605
+ return t != null && Object.assign(i, await t()), e != null && Object.assign(i, ua(await e())), Object.assign(i, r);
2606
+ };
2607
+ }
2608
+ function fa(e) {
2609
+ if (e != null) try {
2610
+ let t = globalThis.location?.href;
2611
+ return new URL(e, t).href;
2612
+ } catch {
2613
+ throw Error(`Configuration: Could not parse user-provided export URL: '${e}'`);
2614
+ }
2615
+ }
2616
+ function pa(e, t, n) {
2617
+ return {
2618
+ ...ei(e, t, n),
2619
+ headers: da(e.headers, t.headers, n.headers),
2620
+ url: fa(e.url) ?? t.url ?? n.url
2621
+ };
2622
+ }
2623
+ function ma(e, t) {
2624
+ return {
2625
+ ...ti(),
2626
+ headers: async () => e,
2627
+ url: "http://localhost:4318/" + t
2628
+ };
2629
+ }
2630
+ //#endregion
2631
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-http-options.js
2632
+ function ha(e) {
2633
+ return typeof e.headers == "function" ? e.headers : $r(e.headers);
2634
+ }
2635
+ //#endregion
2636
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/convert-legacy-browser-http-options.js
2637
+ function ga(e, t, n) {
2638
+ return pa({
2639
+ url: e.url,
2640
+ timeoutMillis: e.timeoutMillis,
2641
+ headers: ha(e),
2642
+ concurrencyLimit: e.concurrencyLimit
2643
+ }, {}, ma(n, t));
2644
+ }
2645
+ //#endregion
2646
+ //#region ../../node_modules/.pnpm/@opentelemetry+otlp-exporter-base@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/otlp-exporter-base/build/esm/configuration/create-legacy-browser-delegate.js
2647
+ function _a(e, t, n, r) {
2648
+ return new _i({
2649
+ componentType: e,
2650
+ metricsHelper: t,
2651
+ url: n,
2652
+ meterProvider: r,
2653
+ responseAttributesFromError: (e) => {
2654
+ if (!e) return { [li]: 200 };
2655
+ if (!(e instanceof Error)) return {};
2656
+ if (e.message.startsWith("Fetch request failed with non-retryable status ")) {
2657
+ let t = e.message.substring(47);
2658
+ return { [li]: Number(t) };
2659
+ }
2660
+ return {};
2661
+ }
2662
+ });
2663
+ }
2664
+ function va(e, t, n, r, i, a, o) {
2665
+ let s = ga(e, a, o);
2666
+ return la(s, t, _a(n, r, s.url, e.selfObsMeterProvider));
2667
+ }
2668
+ //#endregion
2669
+ //#region ../../node_modules/.pnpm/@opentelemetry+exporter-trace-otlp-http@0.221.0_@opentelemetry+api@1.9.1/node_modules/@opentelemetry/exporter-trace-otlp-http/build/esm/semconv.js
2670
+ var ya = "otlp_http_span_exporter", ba = class extends Xr {
2671
+ constructor(e = {}) {
2672
+ super(va(e, Gi, ya, vi, e.selfObsMeterProvider, "v1/traces", { "Content-Type": "application/json" }));
2673
+ }
2674
+ }, X = console.error.bind(console);
2675
+ function Z(e, t, n) {
2676
+ let r = !!e[t] && Object.prototype.propertyIsEnumerable.call(e, t);
2677
+ Object.defineProperty(e, t, {
2678
+ configurable: !0,
2679
+ enumerable: r,
2680
+ writable: !0,
2681
+ value: n
2682
+ });
2683
+ }
2684
+ var xa = (e, t, n) => {
2685
+ if (!e || !e[t]) {
2686
+ X("no original function " + String(t) + " to wrap");
2687
+ return;
2688
+ }
2689
+ if (!n) {
2690
+ X("no wrapper function"), X((/* @__PURE__ */ Error()).stack);
2691
+ return;
2692
+ }
2693
+ let r = e[t];
2694
+ if (typeof r != "function" || typeof n != "function") {
2695
+ X("original object and wrapper must be functions");
2696
+ return;
2697
+ }
2698
+ let i = n(r, t);
2699
+ return Z(i, "__original", r), Z(i, "__unwrap", () => {
2700
+ e[t] === i && Z(e, t, r);
2701
+ }), Z(i, "__wrapped", !0), Z(e, t, i), i;
2702
+ }, Sa = (e, t, n) => {
2703
+ if (e) Array.isArray(e) || (e = [e]);
2704
+ else {
2705
+ X("must provide one or more modules to patch"), X((/* @__PURE__ */ Error()).stack);
2706
+ return;
2707
+ }
2708
+ if (!(t && Array.isArray(t))) {
2709
+ X("must provide one or more functions to wrap on modules");
2710
+ return;
2711
+ }
2712
+ e.forEach((e) => {
2713
+ t.forEach((t) => {
2714
+ xa(e, t, n);
2715
+ });
2716
+ });
2717
+ }, Ca = (e, t) => {
2718
+ if (!e || !e[t]) {
2719
+ X("no function to unwrap."), X((/* @__PURE__ */ Error()).stack);
2720
+ return;
2721
+ }
2722
+ let n = e[t];
2723
+ if (!n.__unwrap) X("no original to unwrap to -- has " + String(t) + " already been unwrapped?");
2724
+ else {
2725
+ n.__unwrap();
2726
+ return;
2727
+ }
2728
+ }, wa = (e, t) => {
2729
+ if (e) Array.isArray(e) || (e = [e]);
2730
+ else {
2731
+ X("must provide one or more modules to patch"), X((/* @__PURE__ */ Error()).stack);
2732
+ return;
2733
+ }
2734
+ if (!(t && Array.isArray(t))) {
2735
+ X("must provide one or more functions to unwrap on modules");
2736
+ return;
2737
+ }
2738
+ e.forEach((e) => {
2739
+ t.forEach((t) => {
2740
+ Ca(e, t);
2741
+ });
2742
+ });
2743
+ }, Ta = class {
2744
+ _config = {};
2745
+ _tracer;
2746
+ _meter;
2747
+ _logger;
2748
+ _diag;
2749
+ instrumentationName;
2750
+ instrumentationVersion;
2751
+ constructor(e, t, n) {
2752
+ this.instrumentationName = e, this.instrumentationVersion = t, this.setConfig(n), this._diag = E.createComponentLogger({ namespace: e }), this._tracer = O.getTracer(e, t), this._meter = ot.getMeter(e, t), this._logger = Ei.getLogger(e, t), this._updateMetricInstruments();
2753
+ }
2754
+ _wrap = xa;
2755
+ _unwrap = Ca;
2756
+ _massWrap = Sa;
2757
+ _massUnwrap = wa;
2758
+ get meter() {
2759
+ return this._meter;
2760
+ }
2761
+ setMeterProvider(e) {
2762
+ this._meter = e.getMeter(this.instrumentationName, this.instrumentationVersion), this._updateMetricInstruments();
2763
+ }
2764
+ get logger() {
2765
+ return this._logger;
2766
+ }
2767
+ setLoggerProvider(e) {
2768
+ this._logger = e.getLogger(this.instrumentationName, this.instrumentationVersion);
2769
+ }
2770
+ getModuleDefinitions() {
2771
+ let e = this.init() ?? [];
2772
+ return Array.isArray(e) ? e : [e];
2773
+ }
2774
+ _updateMetricInstruments() {}
2775
+ getConfig() {
2776
+ return this._config;
2777
+ }
2778
+ setConfig(e) {
2779
+ this._config = {
2780
+ enabled: !0,
2781
+ ...e
2782
+ };
2783
+ }
2784
+ setTracerProvider(e) {
2785
+ this._tracer = e.getTracer(this.instrumentationName, this.instrumentationVersion);
2786
+ }
2787
+ get tracer() {
2788
+ return this._tracer;
2789
+ }
2790
+ _runSpanCustomizationHook(e, t, n, r) {
2791
+ if (e) try {
2792
+ e(n, r);
2793
+ } catch (e) {
2794
+ this._diag.error("Error running span customization hook due to exception in handler", { triggerName: t }, e);
2795
+ }
2796
+ }
2797
+ }, Ea = class extends Ta {
2798
+ constructor(e, t, n) {
2799
+ super(e, t, n), this._config.enabled && this.enable();
2800
+ }
2801
+ };
2802
+ //#endregion
2803
+ //#region ../../node_modules/.pnpm/@opentelemetry+instrumentation@0.221.0_@opentelemetry+api@1.9.1_supports-color@10.2.2/node_modules/@opentelemetry/instrumentation/build/esm/utils.js
2804
+ function Q(e, t, n) {
2805
+ let r, i;
2806
+ try {
2807
+ i = e();
2808
+ } catch (e) {
2809
+ r = e;
2810
+ } finally {
2811
+ if (t(r, i), r && !n) throw r;
2812
+ return i;
2813
+ }
2814
+ }
2815
+ //#endregion
2816
+ //#region ../../node_modules/.pnpm/@opentelemetry+instrumentation-fetch@0.221.0_@opentelemetry+api@1.9.1_supports-color@10.2.2/node_modules/@opentelemetry/instrumentation-fetch/build/esm/semconv.js
2817
+ var Da = "http.request.body.size", Oa = E.createComponentLogger({ namespace: "@opentelemetry/opentelemetry-instrumentation-fetch/utils" });
2818
+ function ka(...e) {
2819
+ if (e[0] instanceof URL || typeof e[0] == "string") {
2820
+ let t = e[1];
2821
+ if (!t?.body) return Promise.resolve();
2822
+ if (t.body instanceof ReadableStream) {
2823
+ let { body: e, length: n } = Aa(t.body);
2824
+ return t.body = e, n;
2825
+ }
2826
+ return Promise.resolve(Ma(t.body));
2827
+ }
2828
+ {
2829
+ let t = e[0];
2830
+ return t?.body ? t.clone().text().then((e) => Pa(e)) : Promise.resolve();
2831
+ }
2832
+ }
2833
+ function Aa(e) {
2834
+ if (!e.pipeThrough) return Oa.warn("Platform has ReadableStream but not pipeThrough!"), {
2835
+ body: e,
2836
+ length: Promise.resolve(void 0)
2837
+ };
2838
+ let t = 0, n, r = new Promise((e) => {
2839
+ n = e;
2840
+ }), i = new TransformStream({
2841
+ start() {},
2842
+ async transform(e, n) {
2843
+ let r = await e;
2844
+ t += r.byteLength, n.enqueue(e);
2845
+ },
2846
+ flush() {
2847
+ n(t);
2848
+ }
2849
+ });
2850
+ return {
2851
+ body: e.pipeThrough(i),
2852
+ length: r
2853
+ };
2854
+ }
2855
+ function ja(e) {
2856
+ return typeof Document < "u" && e instanceof Document;
2857
+ }
2858
+ function Ma(e) {
2859
+ if (ja(e)) return new XMLSerializer().serializeToString(document).length;
2860
+ if (typeof e == "string") return Pa(e);
2861
+ if (e instanceof Blob) return e.size;
2862
+ if (e instanceof FormData) return Fa(e);
2863
+ if (e instanceof URLSearchParams) return Pa(e.toString());
2864
+ if (e.byteLength !== void 0) return e.byteLength;
2865
+ Oa.warn("unknown body type");
2866
+ }
2867
+ var Na = new TextEncoder();
2868
+ function Pa(e) {
2869
+ return Na.encode(e).byteLength;
2870
+ }
2871
+ function Fa(e) {
2872
+ let t = 0;
2873
+ for (let [n, r] of e.entries()) t += n.length, r instanceof Blob ? t += r.size : t += r.length;
2874
+ return t;
2875
+ }
2876
+ function Ia(e) {
2877
+ let t = za(), n = e.toUpperCase();
2878
+ return n in t ? n : "_OTHER";
2879
+ }
2880
+ var La = {
2881
+ CONNECT: !0,
2882
+ DELETE: !0,
2883
+ GET: !0,
2884
+ HEAD: !0,
2885
+ OPTIONS: !0,
2886
+ PATCH: !0,
2887
+ POST: !0,
2888
+ PUT: !0,
2889
+ TRACE: !0,
2890
+ QUERY: !0
2891
+ }, Ra;
2892
+ function za() {
2893
+ return Ra === void 0 && (Ra = La), Ra;
2894
+ }
2895
+ var Ba = {
2896
+ "https:": "443",
2897
+ "http:": "80"
2898
+ };
2899
+ function Va(e) {
2900
+ let t = Number(e.port || Ba[e.protocol]);
2901
+ if (t && !isNaN(t)) return t;
2902
+ }
2903
+ //#endregion
2904
+ //#region ../../node_modules/.pnpm/@opentelemetry+instrumentation-fetch@0.221.0_@opentelemetry+api@1.9.1_supports-color@10.2.2/node_modules/@opentelemetry/instrumentation-fetch/build/esm/version.js
2905
+ var Ha = "0.221.0", Ua = 300, Wa = typeof PerformanceObserver < "u", Ga = class extends Ea {
2906
+ component = "fetch";
2907
+ version = Ha;
2908
+ moduleName = this.component;
2909
+ _usedResources = /* @__PURE__ */ new WeakSet();
2910
+ _tasksCount = 0;
2911
+ constructor(e = {}) {
2912
+ super("@opentelemetry/instrumentation-fetch", Ha, e);
2913
+ }
2914
+ init() {}
2915
+ _addChildSpan(e, t) {
2916
+ let n = this.tracer.startSpan("CORS Preflight", { startTime: t[G.FETCH_START] }, O.setSpan(T.active(), e));
2917
+ Hr(n, t, this.getConfig().ignoreNetworkEvents, void 0, !0), n.end(t[G.RESPONSE_END]);
2918
+ }
2919
+ _addFinalSpanAttributes(e, t) {
2920
+ let n = Jr(t.url);
2921
+ e.setAttribute("http.response.status_code", t.status), e.setAttribute("server.address", n.hostname);
2922
+ let r = Va(n);
2923
+ r && e.setAttribute("server.port", r);
2924
+ }
2925
+ _addHeaders(e, t) {
2926
+ if (!Yr(t, this.getConfig().propagateTraceHeaderCorsUrls)) {
2927
+ let e = {};
2928
+ D.inject(T.active(), e), Object.keys(e).length > 0 && this._diag.debug("headers inject skipped due to CORS policy");
2929
+ return;
2930
+ }
2931
+ if (e instanceof Request) D.inject(T.active(), e.headers, { set: (e, t, n) => e.set(t, typeof n == "string" ? n : String(n)) });
2932
+ else {
2933
+ let t = new Headers(e.headers);
2934
+ D.inject(T.active(), t, { set: (e, t, n) => e.set(t, typeof n == "string" ? n : String(n)) }), e.headers = t;
2935
+ }
2936
+ }
2937
+ _clearResources() {
2938
+ this._tasksCount === 0 && this.getConfig().clearTimingResources && (performance.clearResourceTimings(), this._usedResources = /* @__PURE__ */ new WeakSet());
2939
+ }
2940
+ _createSpan(e, t = {}) {
2941
+ if (Pn(e, this.getConfig().ignoreUrls)) {
2942
+ this._diag.debug("ignoring span as url matches ignored url");
2943
+ return;
2944
+ }
2945
+ let n = {}, r = t.method, i = Ia(t.method || "GET"), a = i;
2946
+ return n["http.request.method"] = i, i !== r && (n["http.request.method_original"] = r), n[c] = e, this.tracer.startSpan(a, {
2947
+ kind: rt.CLIENT,
2948
+ attributes: n
2949
+ });
2950
+ }
2951
+ _findResourceAndAddNetworkEvents(e, t, n) {
2952
+ let r = t.entries;
2953
+ if (!r.length) {
2954
+ if (!performance.getEntriesByType) return;
2955
+ r = performance.getEntriesByType("resource");
2956
+ }
2957
+ let i = Gr(t.spanUrl, t.startTime, n, r, this._usedResources, "fetch");
2958
+ if (i.mainRequest) {
2959
+ let t = i.mainRequest;
2960
+ this._markResourceAsUsed(t);
2961
+ let n = i.corsPreFlightRequest;
2962
+ n && (this._addChildSpan(e, n), this._markResourceAsUsed(n)), Hr(e, t, this.getConfig().ignoreNetworkEvents, void 0, !0);
2963
+ }
2964
+ }
2965
+ _markResourceAsUsed(e) {
2966
+ this._usedResources.add(e);
2967
+ }
2968
+ _endSpan(t, n, r) {
2969
+ let i = M(Date.now()), a = N();
2970
+ this._addFinalSpanAttributes(t, r), r.status >= 400 && (t.setStatus({ code: w.ERROR }), t.setAttribute(e, String(r.status))), setTimeout(() => {
2971
+ n.observer?.disconnect(), this._findResourceAndAddNetworkEvents(t, n, a), this._tasksCount--, this._clearResources(), t.end(i);
2972
+ }, Ua);
2973
+ }
2974
+ _patchConstructor() {
2975
+ return (e) => {
2976
+ let t = this;
2977
+ return function(...n) {
2978
+ if (!t._isEnabled) return e.apply(this, n);
2979
+ let r = this, i = Jr(n[0] instanceof Request ? n[0].url : String(n[0])).href, a;
2980
+ a = n[0] instanceof Request ? n[1] == null ? n[0] : new Request(n[0], n[1]) : n[1] || {};
2981
+ let o = t._createSpan(i, a);
2982
+ if (!o) return e.apply(this, n);
2983
+ let s = t._prepareSpanData(i);
2984
+ t.getConfig().measureRequestSize && ka(...n).then((e) => {
2985
+ e && o.setAttribute(Da, e);
2986
+ }).catch((e) => {
2987
+ t._diag.warn("getFetchBodyLength", e);
2988
+ });
2989
+ function c(e, n) {
2990
+ t._applyAttributesAfterFetch(e, a, n), t._endSpan(e, s, {
2991
+ status: n.status || 0,
2992
+ statusText: n.message,
2993
+ url: i
2994
+ });
2995
+ }
2996
+ function l(e, n) {
2997
+ t._applyAttributesAfterFetch(e, a, n), n.status >= 200 && n.status < 400 ? t._endSpan(e, s, n) : t._endSpan(e, s, {
2998
+ status: n.status,
2999
+ statusText: n.statusText,
3000
+ url: i
3001
+ });
3002
+ }
3003
+ function u(e, n) {
3004
+ try {
3005
+ let t = n.clone().body;
3006
+ if (t) {
3007
+ let r = t.getReader(), i = () => {
3008
+ r.read().then(({ done: t }) => {
3009
+ t ? l(e, n) : i();
3010
+ }, (t) => {
3011
+ c(e, t);
3012
+ });
3013
+ };
3014
+ i();
3015
+ } else l(e, n);
3016
+ } catch (n) {
3017
+ t._diag.error("Failed to read fetch response body", n), t._endSpan(e, s, {
3018
+ status: 0,
3019
+ url: i
3020
+ });
3021
+ }
3022
+ return n;
3023
+ }
3024
+ function ee(e, n) {
3025
+ try {
3026
+ c(e, n);
3027
+ } catch (r) {
3028
+ t._diag.error("Failed to end span on fetch error", r), t._endSpan(e, s, {
3029
+ status: n.status || 0,
3030
+ url: i
3031
+ });
3032
+ }
3033
+ throw n;
3034
+ }
3035
+ return T.with(O.setSpan(T.active(), o), () => (t._callRequestHook(o, a), t._addHeaders(a, i), t._tasksCount++, e.apply(r, a instanceof Request ? [a] : [i, a]).then(u.bind(r, o), ee.bind(r, o))));
3036
+ };
3037
+ };
3038
+ }
3039
+ _applyAttributesAfterFetch(e, t, n) {
3040
+ let r = this.getConfig().applyCustomAttributesOnSpan;
3041
+ r && Q(() => r(e, t, n), (e) => {
3042
+ e && this._diag.error("applyCustomAttributesOnSpan", e);
3043
+ }, !0);
3044
+ }
3045
+ _callRequestHook(e, t) {
3046
+ let n = this.getConfig().requestHook;
3047
+ n && Q(() => n(e, t), (e) => {
3048
+ e && this._diag.error("requestHook", e);
3049
+ }, !0);
3050
+ }
3051
+ _prepareSpanData(e) {
3052
+ let t = N(), n = [];
3053
+ if (typeof PerformanceObserver != "function") return {
3054
+ entries: n,
3055
+ startTime: t,
3056
+ spanUrl: e
3057
+ };
3058
+ let r = new PerformanceObserver((t) => {
3059
+ t.getEntries().forEach((t) => {
3060
+ t.initiatorType === "fetch" && t.name === e && n.push(t);
3061
+ });
3062
+ });
3063
+ return r.observe({ entryTypes: ["resource"] }), {
3064
+ entries: n,
3065
+ observer: r,
3066
+ startTime: t,
3067
+ spanUrl: e
3068
+ };
3069
+ }
3070
+ enable() {
3071
+ if (!Wa) {
3072
+ this._diag.warn("this instrumentation is intended for web usage only, it does not instrument server-side fetch()");
3073
+ return;
3074
+ }
3075
+ if (!this._isEnabled) {
3076
+ if (this._isFetchPatched) {
3077
+ this._diag.debug("fetch constructor already patched"), this._isEnabled = !0;
3078
+ return;
3079
+ }
3080
+ try {
3081
+ this._wrap(globalThis, "fetch", this._patchConstructor()), this._isFetchPatched = !0, this._isEnabled = !0;
3082
+ } catch (e) {
3083
+ this._diag.warn("Failed to patch globalThis.fetch; instrumentation will not be enabled. Another script may have locked globalThis.fetch via Object.defineProperty.", e);
3084
+ }
3085
+ }
3086
+ }
3087
+ disable() {
3088
+ Wa && this._isEnabled && (this._isEnabled = !1, this._usedResources = /* @__PURE__ */ new WeakSet());
3089
+ }
3090
+ }, $;
3091
+ (function(e) {
3092
+ e.DOCUMENT_LOAD = "documentLoad", e.DOCUMENT_FETCH = "documentFetch", e.RESOURCE_FETCH = "resourceFetch";
3093
+ })($ ||= {});
3094
+ //#endregion
3095
+ //#region ../../node_modules/.pnpm/@opentelemetry+instrumentation-document-load@0.66.0_@opentelemetry+api@1.9.1_supports-color@10.2.2/node_modules/@opentelemetry/instrumentation-document-load/build/esm/version.js
3096
+ var Ka = "0.66.0", qa = "@opentelemetry/instrumentation-document-load", Ja;
3097
+ (function(e) {
3098
+ e.FIRST_PAINT = "firstPaint", e.FIRST_CONTENTFUL_PAINT = "firstContentfulPaint";
3099
+ })(Ja ||= {});
3100
+ //#endregion
3101
+ //#region ../../node_modules/.pnpm/@opentelemetry+instrumentation-document-load@0.66.0_@opentelemetry+api@1.9.1_supports-color@10.2.2/node_modules/@opentelemetry/instrumentation-document-load/build/esm/utils.js
3102
+ var Ya = () => {
3103
+ let e = {}, t = j.getEntriesByType?.("navigation")[0];
3104
+ if (t) Object.values(G).forEach((n) => {
3105
+ if (K(t, n)) {
3106
+ let r = t[n];
3107
+ typeof r == "number" && (e[n] = r);
3108
+ }
3109
+ });
3110
+ else {
3111
+ let t = j.timing;
3112
+ t && Object.values(G).forEach((n) => {
3113
+ if (K(t, n)) {
3114
+ let r = t[n];
3115
+ typeof r == "number" && (e[n] = r);
3116
+ }
3117
+ });
3118
+ }
3119
+ return e;
3120
+ }, Xa = {
3121
+ "first-paint": Ja.FIRST_PAINT,
3122
+ "first-contentful-paint": Ja.FIRST_CONTENTFUL_PAINT
3123
+ }, Za = (e) => {
3124
+ let t = j.getEntriesByType?.("paint");
3125
+ t && t.forEach(({ name: t, startTime: n }) => {
3126
+ K(Xa, t) && e.addEvent(Xa[t], n);
3127
+ });
3128
+ }, Qa = class extends Ea {
3129
+ component = "document-load";
3130
+ version = "1";
3131
+ moduleName = this.component;
3132
+ constructor(e = {}) {
3133
+ super(qa, Ka, e);
3134
+ }
3135
+ init() {}
3136
+ _onDocumentLoaded() {
3137
+ window.setTimeout(() => {
3138
+ this._collectPerformance();
3139
+ });
3140
+ }
3141
+ _addResourcesSpans(e) {
3142
+ let t = j.getEntriesByType?.("resource");
3143
+ t && t.forEach((t) => {
3144
+ this._initResourceSpan(t, e);
3145
+ });
3146
+ }
3147
+ _collectPerformance() {
3148
+ let e = Array.from(document.getElementsByTagName("meta")).find((e) => e.getAttribute("name") === rn), t = Ya(), n = e && e.content || "";
3149
+ T.with(D.extract(b, { traceparent: n }), () => {
3150
+ let e = this._startSpan($.DOCUMENT_LOAD, G.FETCH_START, t);
3151
+ e && (T.with(O.setSpan(T.active(), e), () => {
3152
+ let e = this._startSpan($.DOCUMENT_FETCH, G.FETCH_START, t);
3153
+ e && (e.setAttribute(c, location.href), T.with(O.setSpan(T.active(), e), () => {
3154
+ Hr(e, t, this.getConfig().ignoreNetworkEvents), this._addCustomAttributesOnSpan(e, this.getConfig().applyCustomAttributesOnSpan?.documentFetch), this._endSpan(e, G.RESPONSE_END, t);
3155
+ }));
3156
+ }), e.setAttribute(c, location.href), e.setAttribute("user_agent.original", navigator.userAgent), this._addResourcesSpans(e), this.getConfig().ignoreNetworkEvents || (q(e, G.FETCH_START, t), q(e, G.UNLOAD_EVENT_START, t), q(e, G.UNLOAD_EVENT_END, t), q(e, G.DOM_INTERACTIVE, t), q(e, G.DOM_CONTENT_LOADED_EVENT_START, t), q(e, G.DOM_CONTENT_LOADED_EVENT_END, t), q(e, G.DOM_COMPLETE, t), q(e, G.LOAD_EVENT_START, t), q(e, G.LOAD_EVENT_END, t)), this.getConfig().ignorePerformancePaintEvents || Za(e), this._addCustomAttributesOnSpan(e, this.getConfig().applyCustomAttributesOnSpan?.documentLoad), this._endSpan(e, G.LOAD_EVENT_END, t));
3157
+ });
3158
+ }
3159
+ _endSpan(e, t, n) {
3160
+ e && (K(n, t) ? e.end(n[t]) : e.end());
3161
+ }
3162
+ _initResourceSpan(e, t) {
3163
+ let n = this._startSpan($.RESOURCE_FETCH, G.FETCH_START, e, t);
3164
+ n && (n.setAttribute(c, e.name), Hr(n, e, this.getConfig().ignoreNetworkEvents), this._addCustomAttributesOnResourceSpan(n, e, this.getConfig().applyCustomAttributesOnSpan?.resourceFetch), this._endSpan(n, G.RESPONSE_END, e));
3165
+ }
3166
+ _startSpan(e, t, n, r) {
3167
+ if (K(n, t) && typeof n[t] == "number") return this.tracer.startSpan(e, { startTime: n[t] }, r ? O.setSpan(T.active(), r) : void 0);
3168
+ }
3169
+ _waitForPageLoad() {
3170
+ window.document.readyState === "complete" ? this._onDocumentLoaded() : (this._onDocumentLoaded = this._onDocumentLoaded.bind(this), window.addEventListener("load", this._onDocumentLoaded));
3171
+ }
3172
+ _addCustomAttributesOnSpan(e, t) {
3173
+ t && Q(() => t(e), (e) => {
3174
+ e && this._diag.error("addCustomAttributesOnSpan", e);
3175
+ }, !0);
3176
+ }
3177
+ _addCustomAttributesOnResourceSpan(e, t, n) {
3178
+ n && Q(() => n(e, t), (e) => {
3179
+ e && this._diag.error("addCustomAttributesOnResourceSpan", e);
3180
+ }, !0);
3181
+ }
3182
+ enable() {
3183
+ window.removeEventListener("load", this._onDocumentLoaded), this._waitForPageLoad();
3184
+ }
3185
+ disable() {
3186
+ window.removeEventListener("load", this._onDocumentLoaded);
3187
+ }
3188
+ }, $a = {
3189
+ development: 1,
3190
+ staging: .5,
3191
+ production: .2
3192
+ };
3193
+ function eo(e) {
3194
+ let t = typeof process < "u" ? process.env.OTEL_SAMPLING_RATE : void 0;
3195
+ if (t !== void 0) {
3196
+ let e = Number(t);
3197
+ return Number.isFinite(e) ? Math.max(0, Math.min(1, e)) : 1;
3198
+ }
3199
+ return $a[e.toLowerCase()] ?? 1;
3200
+ }
3201
+ //#endregion
3202
+ //#region ../../packages/telemetry/src/utils.ts
3203
+ function to(e, t, n) {
3204
+ return Promise.race([Promise.resolve(e).then(() => {}), new Promise((e) => {
3205
+ setTimeout(() => {
3206
+ console.warn(`[telemetry] ${n} timed out after ${t}ms — proceeding without confirmation`), e();
3207
+ }, t);
3208
+ })]);
3209
+ }
3210
+ //#endregion
3211
+ //#region ../../packages/telemetry/src/browser.ts
3212
+ var no = !1;
3213
+ function ro(e) {
3214
+ if (no) return;
3215
+ no = !0;
3216
+ let t = () => {
3217
+ to(e(), 2e3, "browser flush");
3218
+ };
3219
+ window.addEventListener("pagehide", t), window.addEventListener("beforeunload", t), document.addEventListener("visibilitychange", () => {
3220
+ document.visibilityState === "hidden" && t();
3221
+ });
3222
+ }
3223
+ function io(e) {
3224
+ return e?.enabled === !1 ? null : {
3225
+ serviceName: e?.serviceName ?? "frontend",
3226
+ environment: e?.environment ?? "development",
3227
+ exporterEndpoint: e?.exporterEndpoint ?? "http://localhost:4318",
3228
+ samplingRate: eo(e?.environment ?? "development"),
3229
+ otlpHeaders: e?.otlpHeaders ?? {},
3230
+ signozApiKey: e?.signozApiKey ?? "",
3231
+ logLevel: e?.logLevel ?? "info",
3232
+ propagateCorsUrls: e?.propagateCorsUrls
3233
+ };
3234
+ }
3235
+ function ao(e) {
3236
+ let t = io(e);
3237
+ if (!t) return {
3238
+ shutdown: async () => {},
3239
+ flush: async () => {}
3240
+ };
3241
+ let n = new Lr({
3242
+ resource: Bn({
3243
+ [r]: t.serviceName,
3244
+ "deployment.environment": t.environment,
3245
+ "service.version": "0.0.0"
3246
+ }),
3247
+ spanProcessors: [new Nr(new ba({
3248
+ url: `${t.exporterEndpoint}/v1/traces`,
3249
+ headers: t.otlpHeaders
3250
+ }))]
3251
+ });
3252
+ return n.register(), D.setGlobalPropagator(new ln()), new Ga({ propagateTraceHeaderCorsUrls: t.propagateCorsUrls ? [t.propagateCorsUrls] : [] }).enable(), new Qa().enable(), ro(() => n.forceFlush()), {
3253
+ shutdown: async () => {
3254
+ try {
3255
+ await to(n.shutdown(), 1e4, "browser shutdown");
3256
+ } catch (e) {
3257
+ console.error("[telemetry-browser] Error during shutdown", e);
3258
+ }
3259
+ },
3260
+ flush: async () => {
3261
+ try {
3262
+ await to(n.forceFlush(), 1e4, "browser flush");
3263
+ } catch (e) {
3264
+ console.error("[telemetry-browser] Error during flush", e);
3265
+ }
3266
+ }
3267
+ };
3268
+ }
3269
+ //#endregion
3270
+ export { ao as initializeTelemetryBrowser };
3271
+
3272
+ //# sourceMappingURL=browser-DuzNfJq0.js.map