@persona/relay 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/relay.js ADDED
@@ -0,0 +1,1966 @@
1
+ var Jr = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function cn(e) {
3
+ if (Object.prototype.hasOwnProperty.call(e, "__esModule")) return e;
4
+ var a = e.default;
5
+ if (typeof a == "function") {
6
+ var f = function l() {
7
+ var g = !1;
8
+ try {
9
+ g = this instanceof l;
10
+ } catch {
11
+ }
12
+ return g ? Reflect.construct(a, arguments, this.constructor) : a.apply(this, arguments);
13
+ };
14
+ f.prototype = a.prototype;
15
+ } else f = {};
16
+ return Object.defineProperty(f, "__esModule", { value: !0 }), Object.keys(e).forEach(function(l) {
17
+ var g = Object.getOwnPropertyDescriptor(e, l);
18
+ Object.defineProperty(f, l, g.get ? g : {
19
+ enumerable: !0,
20
+ get: function() {
21
+ return e[l];
22
+ }
23
+ });
24
+ }), f;
25
+ }
26
+ var Ue, Yr;
27
+ function be() {
28
+ return Yr || (Yr = 1, Ue = TypeError), Ue;
29
+ }
30
+ const sn = {}, pn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
31
+ __proto__: null,
32
+ default: sn
33
+ }, Symbol.toStringTag, { value: "Module" })), yn = /* @__PURE__ */ cn(pn);
34
+ var ze, Xr;
35
+ function xe() {
36
+ if (Xr) return ze;
37
+ Xr = 1;
38
+ var e = typeof Map == "function" && Map.prototype, a = Object.getOwnPropertyDescriptor && e ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, f = e && a && typeof a.get == "function" ? a.get : null, l = e && Map.prototype.forEach, g = typeof Set == "function" && Set.prototype, b = Object.getOwnPropertyDescriptor && g ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, P = g && b && typeof b.get == "function" ? b.get : null, v = g && Set.prototype.forEach, O = typeof WeakMap == "function" && WeakMap.prototype, y = O ? WeakMap.prototype.has : null, m = typeof WeakSet == "function" && WeakSet.prototype, d = m ? WeakSet.prototype.has : null, F = typeof WeakRef == "function" && WeakRef.prototype, A = F ? WeakRef.prototype.deref : null, n = Boolean.prototype.valueOf, u = Object.prototype.toString, i = Function.prototype.toString, I = String.prototype.match, w = String.prototype.slice, E = String.prototype.replace, M = String.prototype.toUpperCase, h = String.prototype.toLowerCase, R = RegExp.prototype.test, o = Array.prototype.concat, c = Array.prototype.join, p = Array.prototype.slice, S = Math.floor, _ = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, x = Object.getOwnPropertySymbols, B = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, N = typeof Symbol == "function" && typeof Symbol.iterator == "object", k = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === N || !0) ? Symbol.toStringTag : null, D = Object.prototype.propertyIsEnumerable, K = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(r) {
39
+ return r.__proto__;
40
+ } : null);
41
+ function s(r, t) {
42
+ if (r === 1 / 0 || r === -1 / 0 || r !== r || r && r > -1e3 && r < 1e3 || R.call(/e/, t))
43
+ return t;
44
+ var C = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
45
+ if (typeof r == "number") {
46
+ var L = r < 0 ? -S(-r) : S(r);
47
+ if (L !== r) {
48
+ var U = String(L), q = w.call(t, U.length + 1);
49
+ return E.call(U, C, "$&_") + "." + E.call(E.call(q, /([0-9]{3})/g, "$&_"), /_$/, "");
50
+ }
51
+ }
52
+ return E.call(t, C, "$&_");
53
+ }
54
+ var $ = yn, j = $.custom, X = H(j) ? j : null, ce = {
55
+ __proto__: null,
56
+ double: '"',
57
+ single: "'"
58
+ }, ve = {
59
+ __proto__: null,
60
+ double: /(["\\])/g,
61
+ single: /(['\\])/g
62
+ };
63
+ ze = function r(t, C, L, U) {
64
+ var q = C || {};
65
+ if (W(q, "quoteStyle") && !W(ce, q.quoteStyle))
66
+ throw new TypeError('option "quoteStyle" must be "single" or "double"');
67
+ if (W(q, "maxStringLength") && (typeof q.maxStringLength == "number" ? q.maxStringLength < 0 && q.maxStringLength !== 1 / 0 : q.maxStringLength !== null))
68
+ throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
69
+ var ue = W(q, "customInspect") ? q.customInspect : !0;
70
+ if (typeof ue != "boolean" && ue !== "symbol")
71
+ throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
72
+ if (W(q, "indent") && q.indent !== null && q.indent !== " " && !(parseInt(q.indent, 10) === q.indent && q.indent > 0))
73
+ throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
74
+ if (W(q, "numericSeparator") && typeof q.numericSeparator != "boolean")
75
+ throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
76
+ var ye = q.numericSeparator;
77
+ if (typeof t > "u")
78
+ return "undefined";
79
+ if (t === null)
80
+ return "null";
81
+ if (typeof t == "boolean")
82
+ return t ? "true" : "false";
83
+ if (typeof t == "string")
84
+ return Ur(t, q);
85
+ if (typeof t == "number") {
86
+ if (t === 0)
87
+ return 1 / 0 / t > 0 ? "0" : "-0";
88
+ var Y = String(t);
89
+ return ye ? s(t, Y) : Y;
90
+ }
91
+ if (typeof t == "bigint") {
92
+ var fe = String(t) + "n";
93
+ return ye ? s(t, fe) : fe;
94
+ }
95
+ var De = typeof q.depth > "u" ? 5 : q.depth;
96
+ if (typeof L > "u" && (L = 0), L >= De && De > 0 && typeof t == "object")
97
+ return ae(t) ? "[Array]" : "[Object]";
98
+ var we = ln(q, L);
99
+ if (typeof U > "u")
100
+ U = [];
101
+ else if (se(U, t) >= 0)
102
+ return "[Circular]";
103
+ function te(Se, _e, fn) {
104
+ if (_e && (U = p.call(U), U.push(_e)), fn) {
105
+ var Vr = {
106
+ depth: q.depth
107
+ };
108
+ return W(q, "quoteStyle") && (Vr.quoteStyle = q.quoteStyle), r(Se, Vr, L + 1, U);
109
+ }
110
+ return r(Se, q, L + 1, U);
111
+ }
112
+ if (typeof t == "function" && !oe(t)) {
113
+ var Wr = Ee(t), kr = Pe(t, te);
114
+ return "[Function" + (Wr ? ": " + Wr : " (anonymous)") + "]" + (kr.length > 0 ? " { " + c.call(kr, ", ") + " }" : "");
115
+ }
116
+ if (H(t)) {
117
+ var Gr = N ? E.call(String(t), /^(Symbol\(.*\))_[^)]*$/, "$1") : B.call(t);
118
+ return typeof t == "object" && !N ? Oe(Gr) : Gr;
119
+ }
120
+ if (nn(t)) {
121
+ for (var Ae = "<" + h.call(String(t.nodeName)), Ce = t.attributes || [], Ie = 0; Ie < Ce.length; Ie++)
122
+ Ae += " " + Ce[Ie].name + "=" + ee(ne(Ce[Ie].value), "double", q);
123
+ return Ae += ">", t.childNodes && t.childNodes.length && (Ae += "..."), Ae += "</" + h.call(String(t.nodeName)) + ">", Ae;
124
+ }
125
+ if (ae(t)) {
126
+ if (t.length === 0)
127
+ return "[]";
128
+ var $e = Pe(t, te);
129
+ return we && !on($e) ? "[" + Me($e, we) + "]" : "[ " + c.call($e, ", ") + " ]";
130
+ }
131
+ if (Q(t)) {
132
+ var Ne = Pe(t, te);
133
+ return !("cause" in Error.prototype) && "cause" in t && !D.call(t, "cause") ? "{ [" + String(t) + "] " + c.call(o.call("[cause]: " + te(t.cause), Ne), ", ") + " }" : Ne.length === 0 ? "[" + String(t) + "]" : "{ [" + String(t) + "] " + c.call(Ne, ", ") + " }";
134
+ }
135
+ if (typeof t == "object" && ue) {
136
+ if (X && typeof t[X] == "function" && $)
137
+ return $(t, { depth: De - L });
138
+ if (ue !== "symbol" && typeof t.inspect == "function")
139
+ return t.inspect();
140
+ }
141
+ if (pe(t)) {
142
+ var Hr = [];
143
+ return l && l.call(t, function(Se, _e) {
144
+ Hr.push(te(_e, t, !0) + " => " + te(Se, t));
145
+ }), zr("Map", f.call(t), Hr, we);
146
+ }
147
+ if (me(t)) {
148
+ var jr = [];
149
+ return v && v.call(t, function(Se) {
150
+ jr.push(te(Se, t));
151
+ }), zr("Set", P.call(t), jr, we);
152
+ }
153
+ if (re(t))
154
+ return qe("WeakMap");
155
+ if (ge(t))
156
+ return qe("WeakSet");
157
+ if (he(t))
158
+ return qe("WeakRef");
159
+ if (G(t))
160
+ return Oe(te(Number(t)));
161
+ if (V(t))
162
+ return Oe(te(_.call(t)));
163
+ if (z(t))
164
+ return Oe(n.call(t));
165
+ if (T(t))
166
+ return Oe(te(String(t)));
167
+ if (typeof window < "u" && t === window)
168
+ return "{ [object Window] }";
169
+ if (typeof globalThis < "u" && t === globalThis || typeof Jr < "u" && t === Jr)
170
+ return "{ [object globalThis] }";
171
+ if (!ie(t) && !oe(t)) {
172
+ var Te = Pe(t, te), Kr = K ? K(t) === Object.prototype : t instanceof Object || t.constructor === Object, Le = t instanceof Object ? "" : "null prototype", Qr = !Kr && k && Object(t) === t && k in t ? w.call(J(t), 8, -1) : Le ? "Object" : "", un = Kr || typeof t.constructor != "function" ? "" : t.constructor.name ? t.constructor.name + " " : "", Be = un + (Qr || Le ? "[" + c.call(o.call([], Qr || [], Le || []), ": ") + "] " : "");
173
+ return Te.length === 0 ? Be + "{}" : we ? Be + "{" + Me(Te, we) + "}" : Be + "{ " + c.call(Te, ", ") + " }";
174
+ }
175
+ return String(t);
176
+ };
177
+ function ee(r, t, C) {
178
+ var L = C.quoteStyle || t, U = ce[L];
179
+ return U + r + U;
180
+ }
181
+ function ne(r) {
182
+ return E.call(String(r), /"/g, "&quot;");
183
+ }
184
+ function Z(r) {
185
+ return !k || !(typeof r == "object" && (k in r || typeof r[k] < "u"));
186
+ }
187
+ function ae(r) {
188
+ return J(r) === "[object Array]" && Z(r);
189
+ }
190
+ function ie(r) {
191
+ return J(r) === "[object Date]" && Z(r);
192
+ }
193
+ function oe(r) {
194
+ return J(r) === "[object RegExp]" && Z(r);
195
+ }
196
+ function Q(r) {
197
+ return J(r) === "[object Error]" && Z(r);
198
+ }
199
+ function T(r) {
200
+ return J(r) === "[object String]" && Z(r);
201
+ }
202
+ function G(r) {
203
+ return J(r) === "[object Number]" && Z(r);
204
+ }
205
+ function z(r) {
206
+ return J(r) === "[object Boolean]" && Z(r);
207
+ }
208
+ function H(r) {
209
+ if (N)
210
+ return r && typeof r == "object" && r instanceof Symbol;
211
+ if (typeof r == "symbol")
212
+ return !0;
213
+ if (!r || typeof r != "object" || !B)
214
+ return !1;
215
+ try {
216
+ return B.call(r), !0;
217
+ } catch {
218
+ }
219
+ return !1;
220
+ }
221
+ function V(r) {
222
+ if (!r || typeof r != "object" || !_)
223
+ return !1;
224
+ try {
225
+ return _.call(r), !0;
226
+ } catch {
227
+ }
228
+ return !1;
229
+ }
230
+ var le = Object.prototype.hasOwnProperty || function(r) {
231
+ return r in this;
232
+ };
233
+ function W(r, t) {
234
+ return le.call(r, t);
235
+ }
236
+ function J(r) {
237
+ return u.call(r);
238
+ }
239
+ function Ee(r) {
240
+ if (r.name)
241
+ return r.name;
242
+ var t = I.call(i.call(r), /^function\s*([\w$]+)/);
243
+ return t ? t[1] : null;
244
+ }
245
+ function se(r, t) {
246
+ if (r.indexOf)
247
+ return r.indexOf(t);
248
+ for (var C = 0, L = r.length; C < L; C++)
249
+ if (r[C] === t)
250
+ return C;
251
+ return -1;
252
+ }
253
+ function pe(r) {
254
+ if (!f || !r || typeof r != "object")
255
+ return !1;
256
+ try {
257
+ f.call(r);
258
+ try {
259
+ P.call(r);
260
+ } catch {
261
+ return !0;
262
+ }
263
+ return r instanceof Map;
264
+ } catch {
265
+ }
266
+ return !1;
267
+ }
268
+ function re(r) {
269
+ if (!y || !r || typeof r != "object")
270
+ return !1;
271
+ try {
272
+ y.call(r, y);
273
+ try {
274
+ d.call(r, d);
275
+ } catch {
276
+ return !0;
277
+ }
278
+ return r instanceof WeakMap;
279
+ } catch {
280
+ }
281
+ return !1;
282
+ }
283
+ function he(r) {
284
+ if (!A || !r || typeof r != "object")
285
+ return !1;
286
+ try {
287
+ return A.call(r), !0;
288
+ } catch {
289
+ }
290
+ return !1;
291
+ }
292
+ function me(r) {
293
+ if (!P || !r || typeof r != "object")
294
+ return !1;
295
+ try {
296
+ P.call(r);
297
+ try {
298
+ f.call(r);
299
+ } catch {
300
+ return !0;
301
+ }
302
+ return r instanceof Set;
303
+ } catch {
304
+ }
305
+ return !1;
306
+ }
307
+ function ge(r) {
308
+ if (!d || !r || typeof r != "object")
309
+ return !1;
310
+ try {
311
+ d.call(r, d);
312
+ try {
313
+ y.call(r, y);
314
+ } catch {
315
+ return !0;
316
+ }
317
+ return r instanceof WeakSet;
318
+ } catch {
319
+ }
320
+ return !1;
321
+ }
322
+ function nn(r) {
323
+ return !r || typeof r != "object" ? !1 : typeof HTMLElement < "u" && r instanceof HTMLElement ? !0 : typeof r.nodeName == "string" && typeof r.getAttribute == "function";
324
+ }
325
+ function Ur(r, t) {
326
+ if (r.length > t.maxStringLength) {
327
+ var C = r.length - t.maxStringLength, L = "... " + C + " more character" + (C > 1 ? "s" : "");
328
+ return Ur(w.call(r, 0, t.maxStringLength), t) + L;
329
+ }
330
+ var U = ve[t.quoteStyle || "single"];
331
+ U.lastIndex = 0;
332
+ var q = E.call(E.call(r, U, "\\$1"), /[\x00-\x1f]/g, an);
333
+ return ee(q, "single", t);
334
+ }
335
+ function an(r) {
336
+ var t = r.charCodeAt(0), C = {
337
+ 8: "b",
338
+ 9: "t",
339
+ 10: "n",
340
+ 12: "f",
341
+ 13: "r"
342
+ }[t];
343
+ return C ? "\\" + C : "\\x" + (t < 16 ? "0" : "") + M.call(t.toString(16));
344
+ }
345
+ function Oe(r) {
346
+ return "Object(" + r + ")";
347
+ }
348
+ function qe(r) {
349
+ return r + " { ? }";
350
+ }
351
+ function zr(r, t, C, L) {
352
+ var U = L ? Me(C, L) : c.call(C, ", ");
353
+ return r + " (" + t + ") {" + U + "}";
354
+ }
355
+ function on(r) {
356
+ for (var t = 0; t < r.length; t++)
357
+ if (se(r[t], `
358
+ `) >= 0)
359
+ return !1;
360
+ return !0;
361
+ }
362
+ function ln(r, t) {
363
+ var C;
364
+ if (r.indent === " ")
365
+ C = " ";
366
+ else if (typeof r.indent == "number" && r.indent > 0)
367
+ C = c.call(Array(r.indent + 1), " ");
368
+ else
369
+ return null;
370
+ return {
371
+ base: C,
372
+ prev: c.call(Array(t + 1), C)
373
+ };
374
+ }
375
+ function Me(r, t) {
376
+ if (r.length === 0)
377
+ return "";
378
+ var C = `
379
+ ` + t.prev + t.base;
380
+ return C + c.call(r, "," + C) + `
381
+ ` + t.prev;
382
+ }
383
+ function Pe(r, t) {
384
+ var C = ae(r), L = [];
385
+ if (C) {
386
+ L.length = r.length;
387
+ for (var U = 0; U < r.length; U++)
388
+ L[U] = W(r, U) ? t(r[U], r) : "";
389
+ }
390
+ var q = typeof x == "function" ? x(r) : [], ue;
391
+ if (N) {
392
+ ue = {};
393
+ for (var ye = 0; ye < q.length; ye++)
394
+ ue["$" + q[ye]] = q[ye];
395
+ }
396
+ for (var Y in r)
397
+ W(r, Y) && (C && String(Number(Y)) === Y && Y < r.length || N && ue["$" + Y] instanceof Symbol || (R.call(/[^\w$]/, Y) ? L.push(t(Y, r) + ": " + t(r[Y], r)) : L.push(Y + ": " + t(r[Y], r))));
398
+ if (typeof x == "function")
399
+ for (var fe = 0; fe < q.length; fe++)
400
+ D.call(r, q[fe]) && L.push("[" + t(q[fe]) + "]: " + t(r[q[fe]], r));
401
+ return L;
402
+ }
403
+ return ze;
404
+ }
405
+ var We, Zr;
406
+ function dn() {
407
+ if (Zr) return We;
408
+ Zr = 1;
409
+ var e = /* @__PURE__ */ xe(), a = /* @__PURE__ */ be(), f = function(v, O, y) {
410
+ for (var m = v, d; (d = m.next) != null; m = d)
411
+ if (d.key === O)
412
+ return m.next = d.next, y || (d.next = /** @type {NonNullable<typeof list.next>} */
413
+ v.next, v.next = d), d;
414
+ }, l = function(v, O) {
415
+ if (v) {
416
+ var y = f(v, O);
417
+ return y && y.value;
418
+ }
419
+ }, g = function(v, O, y) {
420
+ var m = f(v, O);
421
+ m ? m.value = y : v.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
422
+ {
423
+ // eslint-disable-line no-param-reassign, no-extra-parens
424
+ key: O,
425
+ next: v.next,
426
+ value: y
427
+ };
428
+ }, b = function(v, O) {
429
+ return v ? !!f(v, O) : !1;
430
+ }, P = function(v, O) {
431
+ if (v)
432
+ return f(v, O, !0);
433
+ };
434
+ return We = function() {
435
+ var O, y = {
436
+ assert: function(m) {
437
+ if (!y.has(m))
438
+ throw new a("Side channel does not contain " + e(m));
439
+ },
440
+ delete: function(m) {
441
+ var d = O && O.next, F = P(O, m);
442
+ return F && d && d === F && (O = void 0), !!F;
443
+ },
444
+ get: function(m) {
445
+ return l(O, m);
446
+ },
447
+ has: function(m) {
448
+ return b(O, m);
449
+ },
450
+ set: function(m, d) {
451
+ O || (O = {
452
+ next: void 0
453
+ }), g(
454
+ /** @type {NonNullable<typeof $o>} */
455
+ O,
456
+ m,
457
+ d
458
+ );
459
+ }
460
+ };
461
+ return y;
462
+ }, We;
463
+ }
464
+ var ke, et;
465
+ function jt() {
466
+ return et || (et = 1, ke = Object), ke;
467
+ }
468
+ var Ge, rt;
469
+ function vn() {
470
+ return rt || (rt = 1, Ge = Error), Ge;
471
+ }
472
+ var He, tt;
473
+ function hn() {
474
+ return tt || (tt = 1, He = EvalError), He;
475
+ }
476
+ var je, nt;
477
+ function mn() {
478
+ return nt || (nt = 1, je = RangeError), je;
479
+ }
480
+ var Ke, at;
481
+ function gn() {
482
+ return at || (at = 1, Ke = ReferenceError), Ke;
483
+ }
484
+ var Qe, it;
485
+ function wn() {
486
+ return it || (it = 1, Qe = SyntaxError), Qe;
487
+ }
488
+ var Ve, ot;
489
+ function Sn() {
490
+ return ot || (ot = 1, Ve = URIError), Ve;
491
+ }
492
+ var Je, lt;
493
+ function bn() {
494
+ return lt || (lt = 1, Je = Math.abs), Je;
495
+ }
496
+ var Ye, ut;
497
+ function En() {
498
+ return ut || (ut = 1, Ye = Math.floor), Ye;
499
+ }
500
+ var Xe, ft;
501
+ function On() {
502
+ return ft || (ft = 1, Xe = Math.max), Xe;
503
+ }
504
+ var Ze, ct;
505
+ function An() {
506
+ return ct || (ct = 1, Ze = Math.min), Ze;
507
+ }
508
+ var er, st;
509
+ function Rn() {
510
+ return st || (st = 1, er = Math.pow), er;
511
+ }
512
+ var rr, pt;
513
+ function Pn() {
514
+ return pt || (pt = 1, rr = Math.round), rr;
515
+ }
516
+ var tr, yt;
517
+ function In() {
518
+ return yt || (yt = 1, tr = Number.isNaN || function(a) {
519
+ return a !== a;
520
+ }), tr;
521
+ }
522
+ var nr, dt;
523
+ function _n() {
524
+ if (dt) return nr;
525
+ dt = 1;
526
+ var e = /* @__PURE__ */ In();
527
+ return nr = function(f) {
528
+ return e(f) || f === 0 ? f : f < 0 ? -1 : 1;
529
+ }, nr;
530
+ }
531
+ var ar, vt;
532
+ function xn() {
533
+ return vt || (vt = 1, ar = Object.getOwnPropertyDescriptor), ar;
534
+ }
535
+ var ir, ht;
536
+ function Kt() {
537
+ if (ht) return ir;
538
+ ht = 1;
539
+ var e = /* @__PURE__ */ xn();
540
+ if (e)
541
+ try {
542
+ e([], "length");
543
+ } catch {
544
+ e = null;
545
+ }
546
+ return ir = e, ir;
547
+ }
548
+ var or, mt;
549
+ function Fn() {
550
+ if (mt) return or;
551
+ mt = 1;
552
+ var e = Object.defineProperty || !1;
553
+ if (e)
554
+ try {
555
+ e({}, "a", { value: 1 });
556
+ } catch {
557
+ e = !1;
558
+ }
559
+ return or = e, or;
560
+ }
561
+ var lr, gt;
562
+ function qn() {
563
+ return gt || (gt = 1, lr = function() {
564
+ if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
565
+ return !1;
566
+ if (typeof Symbol.iterator == "symbol")
567
+ return !0;
568
+ var a = {}, f = /* @__PURE__ */ Symbol("test"), l = Object(f);
569
+ if (typeof f == "string" || Object.prototype.toString.call(f) !== "[object Symbol]" || Object.prototype.toString.call(l) !== "[object Symbol]")
570
+ return !1;
571
+ var g = 42;
572
+ a[f] = g;
573
+ for (var b in a)
574
+ return !1;
575
+ if (typeof Object.keys == "function" && Object.keys(a).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(a).length !== 0)
576
+ return !1;
577
+ var P = Object.getOwnPropertySymbols(a);
578
+ if (P.length !== 1 || P[0] !== f || !Object.prototype.propertyIsEnumerable.call(a, f))
579
+ return !1;
580
+ if (typeof Object.getOwnPropertyDescriptor == "function") {
581
+ var v = (
582
+ /** @type {PropertyDescriptor} */
583
+ Object.getOwnPropertyDescriptor(a, f)
584
+ );
585
+ if (v.value !== g || v.enumerable !== !0)
586
+ return !1;
587
+ }
588
+ return !0;
589
+ }), lr;
590
+ }
591
+ var ur, wt;
592
+ function Mn() {
593
+ if (wt) return ur;
594
+ wt = 1;
595
+ var e = typeof Symbol < "u" && Symbol, a = qn();
596
+ return ur = function() {
597
+ return typeof e != "function" || typeof Symbol != "function" || typeof e("foo") != "symbol" || typeof /* @__PURE__ */ Symbol("bar") != "symbol" ? !1 : a();
598
+ }, ur;
599
+ }
600
+ var fr, St;
601
+ function Qt() {
602
+ return St || (St = 1, fr = typeof Reflect < "u" && Reflect.getPrototypeOf || null), fr;
603
+ }
604
+ var cr, bt;
605
+ function Vt() {
606
+ if (bt) return cr;
607
+ bt = 1;
608
+ var e = /* @__PURE__ */ jt();
609
+ return cr = e.getPrototypeOf || null, cr;
610
+ }
611
+ var sr, Et;
612
+ function Dn() {
613
+ if (Et) return sr;
614
+ Et = 1;
615
+ var e = "Function.prototype.bind called on incompatible ", a = Object.prototype.toString, f = Math.max, l = "[object Function]", g = function(O, y) {
616
+ for (var m = [], d = 0; d < O.length; d += 1)
617
+ m[d] = O[d];
618
+ for (var F = 0; F < y.length; F += 1)
619
+ m[F + O.length] = y[F];
620
+ return m;
621
+ }, b = function(O, y) {
622
+ for (var m = [], d = y, F = 0; d < O.length; d += 1, F += 1)
623
+ m[F] = O[d];
624
+ return m;
625
+ }, P = function(v, O) {
626
+ for (var y = "", m = 0; m < v.length; m += 1)
627
+ y += v[m], m + 1 < v.length && (y += O);
628
+ return y;
629
+ };
630
+ return sr = function(O) {
631
+ var y = this;
632
+ if (typeof y != "function" || a.apply(y) !== l)
633
+ throw new TypeError(e + y);
634
+ for (var m = b(arguments, 1), d, F = function() {
635
+ if (this instanceof d) {
636
+ var I = y.apply(
637
+ this,
638
+ g(m, arguments)
639
+ );
640
+ return Object(I) === I ? I : this;
641
+ }
642
+ return y.apply(
643
+ O,
644
+ g(m, arguments)
645
+ );
646
+ }, A = f(0, y.length - m.length), n = [], u = 0; u < A; u++)
647
+ n[u] = "$" + u;
648
+ if (d = Function("binder", "return function (" + P(n, ",") + "){ return binder.apply(this,arguments); }")(F), y.prototype) {
649
+ var i = function() {
650
+ };
651
+ i.prototype = y.prototype, d.prototype = new i(), i.prototype = null;
652
+ }
653
+ return d;
654
+ }, sr;
655
+ }
656
+ var pr, Ot;
657
+ function Fe() {
658
+ if (Ot) return pr;
659
+ Ot = 1;
660
+ var e = Dn();
661
+ return pr = Function.prototype.bind || e, pr;
662
+ }
663
+ var yr, At;
664
+ function Nr() {
665
+ return At || (At = 1, yr = Function.prototype.call), yr;
666
+ }
667
+ var dr, Rt;
668
+ function Jt() {
669
+ return Rt || (Rt = 1, dr = Function.prototype.apply), dr;
670
+ }
671
+ var vr, Pt;
672
+ function Cn() {
673
+ return Pt || (Pt = 1, vr = typeof Reflect < "u" && Reflect && Reflect.apply), vr;
674
+ }
675
+ var hr, It;
676
+ function $n() {
677
+ if (It) return hr;
678
+ It = 1;
679
+ var e = Fe(), a = Jt(), f = Nr(), l = Cn();
680
+ return hr = l || e.call(f, a), hr;
681
+ }
682
+ var mr, _t;
683
+ function Yt() {
684
+ if (_t) return mr;
685
+ _t = 1;
686
+ var e = Fe(), a = /* @__PURE__ */ be(), f = Nr(), l = $n();
687
+ return mr = function(b) {
688
+ if (b.length < 1 || typeof b[0] != "function")
689
+ throw new a("a function is required");
690
+ return l(e, f, b);
691
+ }, mr;
692
+ }
693
+ var gr, xt;
694
+ function Nn() {
695
+ if (xt) return gr;
696
+ xt = 1;
697
+ var e = Yt(), a = /* @__PURE__ */ Kt(), f;
698
+ try {
699
+ f = /** @type {{ __proto__?: typeof Array.prototype }} */
700
+ [].__proto__ === Array.prototype;
701
+ } catch (P) {
702
+ if (!P || typeof P != "object" || !("code" in P) || P.code !== "ERR_PROTO_ACCESS")
703
+ throw P;
704
+ }
705
+ var l = !!f && a && a(
706
+ Object.prototype,
707
+ /** @type {keyof typeof Object.prototype} */
708
+ "__proto__"
709
+ ), g = Object, b = g.getPrototypeOf;
710
+ return gr = l && typeof l.get == "function" ? e([l.get]) : typeof b == "function" ? (
711
+ /** @type {import('./get')} */
712
+ function(v) {
713
+ return b(v == null ? v : g(v));
714
+ }
715
+ ) : !1, gr;
716
+ }
717
+ var wr, Ft;
718
+ function Tn() {
719
+ if (Ft) return wr;
720
+ Ft = 1;
721
+ var e = Qt(), a = Vt(), f = /* @__PURE__ */ Nn();
722
+ return wr = e ? function(g) {
723
+ return e(g);
724
+ } : a ? function(g) {
725
+ if (!g || typeof g != "object" && typeof g != "function")
726
+ throw new TypeError("getProto: not an object");
727
+ return a(g);
728
+ } : f ? function(g) {
729
+ return f(g);
730
+ } : null, wr;
731
+ }
732
+ var Sr, qt;
733
+ function Ln() {
734
+ if (qt) return Sr;
735
+ qt = 1;
736
+ const e = (
737
+ /** @type {import('.').AsyncFunctionConstructor} */
738
+ (async function() {
739
+ }).constructor
740
+ );
741
+ return Sr = () => e, Sr;
742
+ }
743
+ var br, Mt;
744
+ function Bn() {
745
+ if (Mt) return br;
746
+ Mt = 1;
747
+ const e = (
748
+ /** @type {GeneratorFunctionConstructor} */
749
+ (function* () {
750
+ }).constructor
751
+ );
752
+ return br = () => e, br;
753
+ }
754
+ var Er, Dt;
755
+ function Un() {
756
+ if (Dt) return Er;
757
+ Dt = 1;
758
+ const e = (
759
+ /** @type {import('.').AsyncGeneratorFunctionConstructor} */
760
+ (async function* () {
761
+ }).constructor
762
+ );
763
+ return Er = () => e, Er;
764
+ }
765
+ var Or, Ct;
766
+ function zn() {
767
+ if (Ct) return Or;
768
+ Ct = 1;
769
+ var e = Function.prototype.call, a = Object.prototype.hasOwnProperty, f = Fe();
770
+ return Or = f.call(e, a), Or;
771
+ }
772
+ var Ar, $t;
773
+ function Tr() {
774
+ if ($t) return Ar;
775
+ $t = 1;
776
+ var e, a = /* @__PURE__ */ jt(), f = /* @__PURE__ */ vn(), l = /* @__PURE__ */ hn(), g = /* @__PURE__ */ mn(), b = /* @__PURE__ */ gn(), P = /* @__PURE__ */ wn(), v = /* @__PURE__ */ be(), O = /* @__PURE__ */ Sn(), y = /* @__PURE__ */ bn(), m = /* @__PURE__ */ En(), d = /* @__PURE__ */ On(), F = /* @__PURE__ */ An(), A = /* @__PURE__ */ Rn(), n = /* @__PURE__ */ Pn(), u = /* @__PURE__ */ _n(), i = /* @__PURE__ */ Kt(), I = /* @__PURE__ */ Fn(), w = function() {
777
+ throw new v();
778
+ }, E = i ? (function() {
779
+ try {
780
+ return arguments.callee, w;
781
+ } catch {
782
+ try {
783
+ return i(arguments, "callee").get;
784
+ } catch {
785
+ return w;
786
+ }
787
+ }
788
+ })() : w, M = Mn()(), h = Tn(), R = Vt(), o = Qt(), c = Jt(), p = Nr(), S = {}, _ = typeof Uint8Array > "u" || !h ? e : h(Uint8Array), x = {
789
+ __proto__: null,
790
+ "%AggregateError%": typeof AggregateError > "u" ? e : AggregateError,
791
+ "%Array%": Array,
792
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? e : ArrayBuffer,
793
+ "%ArrayIteratorPrototype%": M && h ? h([][Symbol.iterator]()) : e,
794
+ "%AsyncFromSyncIteratorPrototype%": e,
795
+ "%AsyncFunction%": S,
796
+ "%AsyncGenerator%": S,
797
+ "%AsyncGeneratorFunction%": S,
798
+ "%AsyncIteratorPrototype%": S,
799
+ "%Atomics%": typeof Atomics > "u" ? e : Atomics,
800
+ "%BigInt%": typeof BigInt > "u" ? e : BigInt,
801
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? e : BigInt64Array,
802
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? e : BigUint64Array,
803
+ "%Boolean%": Boolean,
804
+ "%DataView%": typeof DataView > "u" ? e : DataView,
805
+ "%Date%": Date,
806
+ "%decodeURI%": decodeURI,
807
+ "%decodeURIComponent%": decodeURIComponent,
808
+ "%encodeURI%": encodeURI,
809
+ "%encodeURIComponent%": encodeURIComponent,
810
+ "%Error%": f,
811
+ "%eval%": eval,
812
+ // eslint-disable-line no-eval
813
+ "%EvalError%": l,
814
+ "%Float16Array%": typeof Float16Array > "u" ? e : Float16Array,
815
+ "%Float32Array%": typeof Float32Array > "u" ? e : Float32Array,
816
+ "%Float64Array%": typeof Float64Array > "u" ? e : Float64Array,
817
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? e : FinalizationRegistry,
818
+ "%Function%": Function,
819
+ "%GeneratorFunction%": S,
820
+ "%Int8Array%": typeof Int8Array > "u" ? e : Int8Array,
821
+ "%Int16Array%": typeof Int16Array > "u" ? e : Int16Array,
822
+ "%Int32Array%": typeof Int32Array > "u" ? e : Int32Array,
823
+ "%isFinite%": isFinite,
824
+ "%isNaN%": isNaN,
825
+ "%IteratorPrototype%": M && h ? h(h([][Symbol.iterator]())) : e,
826
+ "%JSON%": typeof JSON == "object" ? JSON : e,
827
+ "%Map%": typeof Map > "u" ? e : Map,
828
+ "%MapIteratorPrototype%": typeof Map > "u" || !M || !h ? e : h((/* @__PURE__ */ new Map())[Symbol.iterator]()),
829
+ "%Math%": Math,
830
+ "%Number%": Number,
831
+ "%Object%": a,
832
+ "%Object.getOwnPropertyDescriptor%": i,
833
+ "%parseFloat%": parseFloat,
834
+ "%parseInt%": parseInt,
835
+ "%Promise%": typeof Promise > "u" ? e : Promise,
836
+ "%Proxy%": typeof Proxy > "u" ? e : Proxy,
837
+ "%RangeError%": g,
838
+ "%ReferenceError%": b,
839
+ "%Reflect%": typeof Reflect > "u" ? e : Reflect,
840
+ "%RegExp%": RegExp,
841
+ "%Set%": typeof Set > "u" ? e : Set,
842
+ "%SetIteratorPrototype%": typeof Set > "u" || !M || !h ? e : h((/* @__PURE__ */ new Set())[Symbol.iterator]()),
843
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? e : SharedArrayBuffer,
844
+ "%String%": String,
845
+ "%StringIteratorPrototype%": M && h ? h(""[Symbol.iterator]()) : e,
846
+ "%Symbol%": M ? Symbol : e,
847
+ "%SyntaxError%": P,
848
+ "%ThrowTypeError%": E,
849
+ "%TypedArray%": _,
850
+ "%TypeError%": v,
851
+ "%Uint8Array%": typeof Uint8Array > "u" ? e : Uint8Array,
852
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? e : Uint8ClampedArray,
853
+ "%Uint16Array%": typeof Uint16Array > "u" ? e : Uint16Array,
854
+ "%Uint32Array%": typeof Uint32Array > "u" ? e : Uint32Array,
855
+ "%URIError%": O,
856
+ "%WeakMap%": typeof WeakMap > "u" ? e : WeakMap,
857
+ "%WeakRef%": typeof WeakRef > "u" ? e : WeakRef,
858
+ "%WeakSet%": typeof WeakSet > "u" ? e : WeakSet,
859
+ "%Function.prototype.call%": p,
860
+ "%Function.prototype.apply%": c,
861
+ "%Object.defineProperty%": I,
862
+ "%Object.getPrototypeOf%": R,
863
+ "%Math.abs%": y,
864
+ "%Math.floor%": m,
865
+ "%Math.max%": d,
866
+ "%Math.min%": F,
867
+ "%Math.pow%": A,
868
+ "%Math.round%": n,
869
+ "%Math.sign%": u,
870
+ "%Reflect.getPrototypeOf%": o
871
+ };
872
+ if (h)
873
+ try {
874
+ null.error;
875
+ } catch (Q) {
876
+ var B = h(h(Q));
877
+ x["%Error.prototype%"] = B;
878
+ }
879
+ var N = Ln(), k = /* @__PURE__ */ Bn(), D = Un(), K = function Q(T) {
880
+ var G;
881
+ if (T === "%AsyncFunction%")
882
+ G = N() || void 0;
883
+ else if (T === "%GeneratorFunction%")
884
+ G = k() || void 0;
885
+ else if (T === "%AsyncGeneratorFunction%")
886
+ G = D() || void 0;
887
+ else if (T === "%AsyncGenerator%") {
888
+ var z = Q("%AsyncGeneratorFunction%");
889
+ z && (G = z.prototype);
890
+ } else if (T === "%AsyncIteratorPrototype%") {
891
+ var H = Q("%AsyncGenerator%");
892
+ H && h && (G = h(H.prototype));
893
+ }
894
+ return x[T] = G, G;
895
+ }, s = {
896
+ __proto__: null,
897
+ "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
898
+ "%ArrayPrototype%": ["Array", "prototype"],
899
+ "%ArrayProto_entries%": ["Array", "prototype", "entries"],
900
+ "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
901
+ "%ArrayProto_keys%": ["Array", "prototype", "keys"],
902
+ "%ArrayProto_values%": ["Array", "prototype", "values"],
903
+ "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
904
+ "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
905
+ "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
906
+ "%BooleanPrototype%": ["Boolean", "prototype"],
907
+ "%DataViewPrototype%": ["DataView", "prototype"],
908
+ "%DatePrototype%": ["Date", "prototype"],
909
+ "%ErrorPrototype%": ["Error", "prototype"],
910
+ "%EvalErrorPrototype%": ["EvalError", "prototype"],
911
+ "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
912
+ "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
913
+ "%FunctionPrototype%": ["Function", "prototype"],
914
+ "%Generator%": ["GeneratorFunction", "prototype"],
915
+ "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
916
+ "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
917
+ "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
918
+ "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
919
+ "%JSONParse%": ["JSON", "parse"],
920
+ "%JSONStringify%": ["JSON", "stringify"],
921
+ "%MapPrototype%": ["Map", "prototype"],
922
+ "%NumberPrototype%": ["Number", "prototype"],
923
+ "%ObjectPrototype%": ["Object", "prototype"],
924
+ "%ObjProto_toString%": ["Object", "prototype", "toString"],
925
+ "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
926
+ "%PromisePrototype%": ["Promise", "prototype"],
927
+ "%PromiseProto_then%": ["Promise", "prototype", "then"],
928
+ "%Promise_all%": ["Promise", "all"],
929
+ "%Promise_reject%": ["Promise", "reject"],
930
+ "%Promise_resolve%": ["Promise", "resolve"],
931
+ "%RangeErrorPrototype%": ["RangeError", "prototype"],
932
+ "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
933
+ "%RegExpPrototype%": ["RegExp", "prototype"],
934
+ "%SetPrototype%": ["Set", "prototype"],
935
+ "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
936
+ "%StringPrototype%": ["String", "prototype"],
937
+ "%SymbolPrototype%": ["Symbol", "prototype"],
938
+ "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
939
+ "%TypedArrayPrototype%": ["TypedArray", "prototype"],
940
+ "%TypeErrorPrototype%": ["TypeError", "prototype"],
941
+ "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
942
+ "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
943
+ "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
944
+ "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
945
+ "%URIErrorPrototype%": ["URIError", "prototype"],
946
+ "%WeakMapPrototype%": ["WeakMap", "prototype"],
947
+ "%WeakSetPrototype%": ["WeakSet", "prototype"]
948
+ }, $ = Fe(), j = /* @__PURE__ */ zn(), X = $.call(p, Array.prototype.concat), ce = $.call(c, Array.prototype.splice), ve = $.call(p, String.prototype.replace), ee = $.call(p, String.prototype.slice), ne = $.call(p, RegExp.prototype.exec), Z = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ae = /\\(\\)?/g, ie = function(T) {
949
+ var G = ee(T, 0, 1), z = ee(T, -1);
950
+ if (G === "%" && z !== "%")
951
+ throw new P("invalid intrinsic syntax, expected closing `%`");
952
+ if (z === "%" && G !== "%")
953
+ throw new P("invalid intrinsic syntax, expected opening `%`");
954
+ var H = [];
955
+ return ve(T, Z, function(V, le, W, J) {
956
+ H[H.length] = W ? ve(J, ae, "$1") : le || V;
957
+ }), H;
958
+ }, oe = function(T, G) {
959
+ var z = T, H;
960
+ if (j(s, z) && (H = s[z], z = "%" + H[0] + "%"), j(x, z)) {
961
+ var V = x[z];
962
+ if (V === S && (V = K(z)), typeof V > "u" && !G)
963
+ throw new v("intrinsic " + T + " exists, but is not available. Please file an issue!");
964
+ return {
965
+ alias: H,
966
+ name: z,
967
+ value: V
968
+ };
969
+ }
970
+ throw new P("intrinsic " + T + " does not exist!");
971
+ };
972
+ return Ar = function(T, G) {
973
+ if (typeof T != "string" || T.length === 0)
974
+ throw new v("intrinsic name must be a non-empty string");
975
+ if (arguments.length > 1 && typeof G != "boolean")
976
+ throw new v('"allowMissing" argument must be a boolean');
977
+ if (ne(/^%?[^%]*%?$/, T) === null)
978
+ throw new P("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
979
+ var z = ie(T), H = z.length > 0 ? z[0] : "", V = oe("%" + H + "%", G), le = V.name, W = V.value, J = !1, Ee = V.alias;
980
+ Ee && (H = Ee[0], ce(z, X([0, 1], Ee)));
981
+ for (var se = 1, pe = !0; se < z.length; se += 1) {
982
+ var re = z[se], he = ee(re, 0, 1), me = ee(re, -1);
983
+ if ((he === '"' || he === "'" || he === "`" || me === '"' || me === "'" || me === "`") && he !== me)
984
+ throw new P("property names with quotes must have matching quotes");
985
+ if ((re === "constructor" || !pe) && (J = !0), H += "." + re, le = "%" + H + "%", j(x, le))
986
+ W = x[le];
987
+ else if (W != null) {
988
+ if (!(re in W)) {
989
+ if (!G)
990
+ throw new v("base intrinsic for " + T + " exists, but the property is not available.");
991
+ return;
992
+ }
993
+ if (i && se + 1 >= z.length) {
994
+ var ge = i(W, re);
995
+ pe = !!ge, pe && "get" in ge && !("originalValue" in ge.get) ? W = ge.get : W = W[re];
996
+ } else
997
+ pe = j(W, re), W = W[re];
998
+ pe && !J && (x[le] = W);
999
+ }
1000
+ }
1001
+ return W;
1002
+ }, Ar;
1003
+ }
1004
+ var Rr, Nt;
1005
+ function Xt() {
1006
+ if (Nt) return Rr;
1007
+ Nt = 1;
1008
+ var e = /* @__PURE__ */ Tr(), a = Yt(), f = a([e("%String.prototype.indexOf%")]);
1009
+ return Rr = function(g, b) {
1010
+ var P = (
1011
+ /** @type {(this: unknown, ...args: unknown[]) => unknown} */
1012
+ e(g, !!b)
1013
+ );
1014
+ return typeof P == "function" && f(g, ".prototype.") > -1 ? a(
1015
+ /** @type {const} */
1016
+ [P]
1017
+ ) : P;
1018
+ }, Rr;
1019
+ }
1020
+ var Pr, Tt;
1021
+ function Zt() {
1022
+ if (Tt) return Pr;
1023
+ Tt = 1;
1024
+ var e = /* @__PURE__ */ Tr(), a = /* @__PURE__ */ Xt(), f = /* @__PURE__ */ xe(), l = /* @__PURE__ */ be(), g = e("%Map%", !0), b = a("Map.prototype.get", !0), P = a("Map.prototype.set", !0), v = a("Map.prototype.has", !0), O = a("Map.prototype.delete", !0), y = a("Map.prototype.size", !0);
1025
+ return Pr = !!g && /** @type {Exclude<import('.'), false>} */
1026
+ function() {
1027
+ var d, F = {
1028
+ assert: function(A) {
1029
+ if (!F.has(A))
1030
+ throw new l("Side channel does not contain " + f(A));
1031
+ },
1032
+ delete: function(A) {
1033
+ if (d) {
1034
+ var n = O(d, A);
1035
+ return y(d) === 0 && (d = void 0), n;
1036
+ }
1037
+ return !1;
1038
+ },
1039
+ get: function(A) {
1040
+ if (d)
1041
+ return b(d, A);
1042
+ },
1043
+ has: function(A) {
1044
+ return d ? v(d, A) : !1;
1045
+ },
1046
+ set: function(A, n) {
1047
+ d || (d = new g()), P(d, A, n);
1048
+ }
1049
+ };
1050
+ return F;
1051
+ }, Pr;
1052
+ }
1053
+ var Ir, Lt;
1054
+ function Wn() {
1055
+ if (Lt) return Ir;
1056
+ Lt = 1;
1057
+ var e = /* @__PURE__ */ Tr(), a = /* @__PURE__ */ Xt(), f = /* @__PURE__ */ xe(), l = Zt(), g = /* @__PURE__ */ be(), b = e("%WeakMap%", !0), P = a("WeakMap.prototype.get", !0), v = a("WeakMap.prototype.set", !0), O = a("WeakMap.prototype.has", !0), y = a("WeakMap.prototype.delete", !0);
1058
+ return Ir = b ? (
1059
+ /** @type {Exclude<import('.'), false>} */
1060
+ function() {
1061
+ var d, F, A = {
1062
+ assert: function(n) {
1063
+ if (!A.has(n))
1064
+ throw new g("Side channel does not contain " + f(n));
1065
+ },
1066
+ delete: function(n) {
1067
+ if (b && n && (typeof n == "object" || typeof n == "function")) {
1068
+ if (d)
1069
+ return y(d, n);
1070
+ } else if (l && F)
1071
+ return F.delete(n);
1072
+ return !1;
1073
+ },
1074
+ get: function(n) {
1075
+ return b && n && (typeof n == "object" || typeof n == "function") && d ? P(d, n) : F && F.get(n);
1076
+ },
1077
+ has: function(n) {
1078
+ return b && n && (typeof n == "object" || typeof n == "function") && d ? O(d, n) : !!F && F.has(n);
1079
+ },
1080
+ set: function(n, u) {
1081
+ b && n && (typeof n == "object" || typeof n == "function") ? (d || (d = new b()), v(d, n, u)) : l && (F || (F = l()), F.set(n, u));
1082
+ }
1083
+ };
1084
+ return A;
1085
+ }
1086
+ ) : l, Ir;
1087
+ }
1088
+ var _r, Bt;
1089
+ function en() {
1090
+ if (Bt) return _r;
1091
+ Bt = 1;
1092
+ var e = /* @__PURE__ */ be(), a = /* @__PURE__ */ xe(), f = dn(), l = Zt(), g = Wn(), b = g || l || f;
1093
+ return _r = function() {
1094
+ var v, O = {
1095
+ assert: function(y) {
1096
+ if (!O.has(y))
1097
+ throw new e("Side channel does not contain " + a(y));
1098
+ },
1099
+ delete: function(y) {
1100
+ return !!v && v.delete(y);
1101
+ },
1102
+ get: function(y) {
1103
+ return v && v.get(y);
1104
+ },
1105
+ has: function(y) {
1106
+ return !!v && v.has(y);
1107
+ },
1108
+ set: function(y, m) {
1109
+ v || (v = b()), v.set(y, m);
1110
+ }
1111
+ };
1112
+ return O;
1113
+ }, _r;
1114
+ }
1115
+ var xr, Ut;
1116
+ function Lr() {
1117
+ if (Ut) return xr;
1118
+ Ut = 1;
1119
+ var e = String.prototype.replace, a = /%20/g, f = {
1120
+ RFC1738: "RFC1738",
1121
+ RFC3986: "RFC3986"
1122
+ };
1123
+ return xr = {
1124
+ default: f.RFC3986,
1125
+ formatters: {
1126
+ RFC1738: function(l) {
1127
+ return e.call(l, a, "+");
1128
+ },
1129
+ RFC3986: function(l) {
1130
+ return String(l);
1131
+ }
1132
+ },
1133
+ RFC1738: f.RFC1738,
1134
+ RFC3986: f.RFC3986
1135
+ }, xr;
1136
+ }
1137
+ var Fr, zt;
1138
+ function rn() {
1139
+ if (zt) return Fr;
1140
+ zt = 1;
1141
+ var e = /* @__PURE__ */ Lr(), a = en(), f = Object.prototype.hasOwnProperty, l = Array.isArray, g = a(), b = function(o, c) {
1142
+ return g.set(o, c), o;
1143
+ }, P = function(o) {
1144
+ return g.has(o);
1145
+ }, v = function(o) {
1146
+ return g.get(o);
1147
+ }, O = function(o, c) {
1148
+ g.set(o, c);
1149
+ }, y = (function() {
1150
+ for (var R = [], o = 0; o < 256; ++o)
1151
+ R[R.length] = "%" + ((o < 16 ? "0" : "") + o.toString(16)).toUpperCase();
1152
+ return R;
1153
+ })(), m = function(o) {
1154
+ for (; o.length > 1; ) {
1155
+ var c = o.pop(), p = c.obj[c.prop];
1156
+ if (l(p)) {
1157
+ for (var S = [], _ = 0; _ < p.length; ++_)
1158
+ typeof p[_] < "u" && (S[S.length] = p[_]);
1159
+ c.obj[c.prop] = S;
1160
+ }
1161
+ }
1162
+ }, d = function(o, c) {
1163
+ for (var p = c && c.plainObjects ? { __proto__: null } : {}, S = 0; S < o.length; ++S)
1164
+ typeof o[S] < "u" && (p[S] = o[S]);
1165
+ return p;
1166
+ }, F = function R(o, c, p) {
1167
+ if (!c)
1168
+ return o;
1169
+ if (typeof c != "object" && typeof c != "function") {
1170
+ if (l(o)) {
1171
+ var S = o.length;
1172
+ if (p && typeof p.arrayLimit == "number" && S > p.arrayLimit)
1173
+ return b(d(o.concat(c), p), S);
1174
+ o[S] = c;
1175
+ } else if (o && typeof o == "object")
1176
+ if (P(o)) {
1177
+ var _ = v(o) + 1;
1178
+ o[_] = c, O(o, _);
1179
+ } else {
1180
+ if (p && p.strictMerge)
1181
+ return [o, c];
1182
+ (p && (p.plainObjects || p.allowPrototypes) || !f.call(Object.prototype, c)) && (o[c] = !0);
1183
+ }
1184
+ else
1185
+ return [o, c];
1186
+ return o;
1187
+ }
1188
+ if (!o || typeof o != "object") {
1189
+ if (P(c)) {
1190
+ for (var x = Object.keys(c), B = p && p.plainObjects ? { __proto__: null, 0: o } : { 0: o }, N = 0; N < x.length; N++) {
1191
+ var k = parseInt(x[N], 10);
1192
+ B[k + 1] = c[x[N]];
1193
+ }
1194
+ return b(B, v(c) + 1);
1195
+ }
1196
+ var D = [o].concat(c);
1197
+ return p && typeof p.arrayLimit == "number" && D.length > p.arrayLimit ? b(d(D, p), D.length - 1) : D;
1198
+ }
1199
+ var K = o;
1200
+ return l(o) && !l(c) && (K = d(o, p)), l(o) && l(c) ? (c.forEach(function(s, $) {
1201
+ if (f.call(o, $)) {
1202
+ var j = o[$];
1203
+ j && typeof j == "object" && s && typeof s == "object" ? o[$] = R(j, s, p) : o[o.length] = s;
1204
+ } else
1205
+ o[$] = s;
1206
+ }), o) : Object.keys(c).reduce(function(s, $) {
1207
+ var j = c[$];
1208
+ if (f.call(s, $) ? s[$] = R(s[$], j, p) : s[$] = j, P(c) && !P(s) && b(s, v(c)), P(s)) {
1209
+ var X = parseInt($, 10);
1210
+ String(X) === $ && X >= 0 && X > v(s) && O(s, X);
1211
+ }
1212
+ return s;
1213
+ }, K);
1214
+ }, A = function(o, c) {
1215
+ return Object.keys(c).reduce(function(p, S) {
1216
+ return p[S] = c[S], p;
1217
+ }, o);
1218
+ }, n = function(R, o, c) {
1219
+ var p = R.replace(/\+/g, " ");
1220
+ if (c === "iso-8859-1")
1221
+ return p.replace(/%[0-9a-f]{2}/gi, unescape);
1222
+ try {
1223
+ return decodeURIComponent(p);
1224
+ } catch {
1225
+ return p;
1226
+ }
1227
+ }, u = 1024, i = function(o, c, p, S, _) {
1228
+ if (o.length === 0)
1229
+ return o;
1230
+ var x = o;
1231
+ if (typeof o == "symbol" ? x = Symbol.prototype.toString.call(o) : typeof o != "string" && (x = String(o)), p === "iso-8859-1")
1232
+ return escape(x).replace(/%u[0-9a-f]{4}/gi, function($) {
1233
+ return "%26%23" + parseInt($.slice(2), 16) + "%3B";
1234
+ });
1235
+ for (var B = "", N = 0; N < x.length; N += u) {
1236
+ for (var k = x.length >= u ? x.slice(N, N + u) : x, D = [], K = 0; K < k.length; ++K) {
1237
+ var s = k.charCodeAt(K);
1238
+ if (s === 45 || s === 46 || s === 95 || s === 126 || s >= 48 && s <= 57 || s >= 65 && s <= 90 || s >= 97 && s <= 122 || _ === e.RFC1738 && (s === 40 || s === 41)) {
1239
+ D[D.length] = k.charAt(K);
1240
+ continue;
1241
+ }
1242
+ if (s < 128) {
1243
+ D[D.length] = y[s];
1244
+ continue;
1245
+ }
1246
+ if (s < 2048) {
1247
+ D[D.length] = y[192 | s >> 6] + y[128 | s & 63];
1248
+ continue;
1249
+ }
1250
+ if (s < 55296 || s >= 57344) {
1251
+ D[D.length] = y[224 | s >> 12] + y[128 | s >> 6 & 63] + y[128 | s & 63];
1252
+ continue;
1253
+ }
1254
+ K += 1, s = 65536 + ((s & 1023) << 10 | k.charCodeAt(K) & 1023), D[D.length] = y[240 | s >> 18] + y[128 | s >> 12 & 63] + y[128 | s >> 6 & 63] + y[128 | s & 63];
1255
+ }
1256
+ B += D.join("");
1257
+ }
1258
+ return B;
1259
+ }, I = function(o) {
1260
+ for (var c = [{ obj: { o }, prop: "o" }], p = [], S = 0; S < c.length; ++S)
1261
+ for (var _ = c[S], x = _.obj[_.prop], B = Object.keys(x), N = 0; N < B.length; ++N) {
1262
+ var k = B[N], D = x[k];
1263
+ typeof D == "object" && D !== null && p.indexOf(D) === -1 && (c[c.length] = { obj: x, prop: k }, p[p.length] = D);
1264
+ }
1265
+ return m(c), o;
1266
+ }, w = function(o) {
1267
+ return Object.prototype.toString.call(o) === "[object RegExp]";
1268
+ }, E = function(o) {
1269
+ return !o || typeof o != "object" ? !1 : !!(o.constructor && o.constructor.isBuffer && o.constructor.isBuffer(o));
1270
+ }, M = function(o, c, p, S) {
1271
+ if (P(o)) {
1272
+ var _ = v(o) + 1;
1273
+ return o[_] = c, O(o, _), o;
1274
+ }
1275
+ var x = [].concat(o, c);
1276
+ return x.length > p ? b(d(x, { plainObjects: S }), x.length - 1) : x;
1277
+ }, h = function(o, c) {
1278
+ if (l(o)) {
1279
+ for (var p = [], S = 0; S < o.length; S += 1)
1280
+ p[p.length] = c(o[S]);
1281
+ return p;
1282
+ }
1283
+ return c(o);
1284
+ };
1285
+ return Fr = {
1286
+ arrayToObject: d,
1287
+ assign: A,
1288
+ combine: M,
1289
+ compact: I,
1290
+ decode: n,
1291
+ encode: i,
1292
+ isBuffer: E,
1293
+ isOverflow: P,
1294
+ isRegExp: w,
1295
+ markOverflow: b,
1296
+ maybeMap: h,
1297
+ merge: F
1298
+ }, Fr;
1299
+ }
1300
+ var qr, Wt;
1301
+ function kn() {
1302
+ if (Wt) return qr;
1303
+ Wt = 1;
1304
+ var e = en(), a = /* @__PURE__ */ rn(), f = /* @__PURE__ */ Lr(), l = Object.prototype.hasOwnProperty, g = {
1305
+ brackets: function(i) {
1306
+ return i + "[]";
1307
+ },
1308
+ comma: "comma",
1309
+ indices: function(i, I) {
1310
+ return i + "[" + I + "]";
1311
+ },
1312
+ repeat: function(i) {
1313
+ return i;
1314
+ }
1315
+ }, b = Array.isArray, P = Array.prototype.push, v = function(u, i) {
1316
+ P.apply(u, b(i) ? i : [i]);
1317
+ }, O = Date.prototype.toISOString, y = f.default, m = {
1318
+ addQueryPrefix: !1,
1319
+ allowDots: !1,
1320
+ allowEmptyArrays: !1,
1321
+ arrayFormat: "indices",
1322
+ charset: "utf-8",
1323
+ charsetSentinel: !1,
1324
+ commaRoundTrip: !1,
1325
+ delimiter: "&",
1326
+ encode: !0,
1327
+ encodeDotInKeys: !1,
1328
+ encoder: a.encode,
1329
+ encodeValuesOnly: !1,
1330
+ filter: void 0,
1331
+ format: y,
1332
+ formatter: f.formatters[y],
1333
+ // deprecated
1334
+ indices: !1,
1335
+ serializeDate: function(i) {
1336
+ return O.call(i);
1337
+ },
1338
+ skipNulls: !1,
1339
+ strictNullHandling: !1
1340
+ }, d = function(i) {
1341
+ return typeof i == "string" || typeof i == "number" || typeof i == "boolean" || typeof i == "symbol" || typeof i == "bigint";
1342
+ }, F = {}, A = function u(i, I, w, E, M, h, R, o, c, p, S, _, x, B, N, k, D, K) {
1343
+ for (var s = i, $ = K, j = 0, X = !1; ($ = $.get(F)) !== void 0 && !X; ) {
1344
+ var ce = $.get(i);
1345
+ if (j += 1, typeof ce < "u") {
1346
+ if (ce === j)
1347
+ throw new RangeError("Cyclic object value");
1348
+ X = !0;
1349
+ }
1350
+ typeof $.get(F) > "u" && (j = 0);
1351
+ }
1352
+ if (typeof p == "function" ? s = p(I, s) : s instanceof Date ? s = x(s) : w === "comma" && b(s) && (s = a.maybeMap(s, function(V) {
1353
+ return V instanceof Date ? x(V) : V;
1354
+ })), s === null) {
1355
+ if (h)
1356
+ return c && !k ? c(I, m.encoder, D, "key", B) : I;
1357
+ s = "";
1358
+ }
1359
+ if (d(s) || a.isBuffer(s)) {
1360
+ if (c) {
1361
+ var ve = k ? I : c(I, m.encoder, D, "key", B);
1362
+ return [N(ve) + "=" + N(c(s, m.encoder, D, "value", B))];
1363
+ }
1364
+ return [N(I) + "=" + N(String(s))];
1365
+ }
1366
+ var ee = [];
1367
+ if (typeof s > "u")
1368
+ return ee;
1369
+ var ne;
1370
+ if (w === "comma" && b(s))
1371
+ k && c && (s = a.maybeMap(s, c)), ne = [{ value: s.length > 0 ? s.join(",") || null : void 0 }];
1372
+ else if (b(p))
1373
+ ne = p;
1374
+ else {
1375
+ var Z = Object.keys(s);
1376
+ ne = S ? Z.sort(S) : Z;
1377
+ }
1378
+ var ae = o ? String(I).replace(/\./g, "%2E") : String(I), ie = E && b(s) && s.length === 1 ? ae + "[]" : ae;
1379
+ if (M && b(s) && s.length === 0)
1380
+ return ie + "[]";
1381
+ for (var oe = 0; oe < ne.length; ++oe) {
1382
+ var Q = ne[oe], T = typeof Q == "object" && Q && typeof Q.value < "u" ? Q.value : s[Q];
1383
+ if (!(R && T === null)) {
1384
+ var G = _ && o ? String(Q).replace(/\./g, "%2E") : String(Q), z = b(s) ? typeof w == "function" ? w(ie, G) : ie : ie + (_ ? "." + G : "[" + G + "]");
1385
+ K.set(i, j);
1386
+ var H = e();
1387
+ H.set(F, K), v(ee, u(
1388
+ T,
1389
+ z,
1390
+ w,
1391
+ E,
1392
+ M,
1393
+ h,
1394
+ R,
1395
+ o,
1396
+ w === "comma" && k && b(s) ? null : c,
1397
+ p,
1398
+ S,
1399
+ _,
1400
+ x,
1401
+ B,
1402
+ N,
1403
+ k,
1404
+ D,
1405
+ H
1406
+ ));
1407
+ }
1408
+ }
1409
+ return ee;
1410
+ }, n = function(i) {
1411
+ if (!i)
1412
+ return m;
1413
+ if (typeof i.allowEmptyArrays < "u" && typeof i.allowEmptyArrays != "boolean")
1414
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1415
+ if (typeof i.encodeDotInKeys < "u" && typeof i.encodeDotInKeys != "boolean")
1416
+ throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
1417
+ if (i.encoder !== null && typeof i.encoder < "u" && typeof i.encoder != "function")
1418
+ throw new TypeError("Encoder has to be a function.");
1419
+ var I = i.charset || m.charset;
1420
+ if (typeof i.charset < "u" && i.charset !== "utf-8" && i.charset !== "iso-8859-1")
1421
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1422
+ var w = f.default;
1423
+ if (typeof i.format < "u") {
1424
+ if (!l.call(f.formatters, i.format))
1425
+ throw new TypeError("Unknown format option provided.");
1426
+ w = i.format;
1427
+ }
1428
+ var E = f.formatters[w], M = m.filter;
1429
+ (typeof i.filter == "function" || b(i.filter)) && (M = i.filter);
1430
+ var h;
1431
+ if (i.arrayFormat in g ? h = i.arrayFormat : "indices" in i ? h = i.indices ? "indices" : "repeat" : h = m.arrayFormat, "commaRoundTrip" in i && typeof i.commaRoundTrip != "boolean")
1432
+ throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
1433
+ var R = typeof i.allowDots > "u" ? i.encodeDotInKeys === !0 ? !0 : m.allowDots : !!i.allowDots;
1434
+ return {
1435
+ addQueryPrefix: typeof i.addQueryPrefix == "boolean" ? i.addQueryPrefix : m.addQueryPrefix,
1436
+ allowDots: R,
1437
+ allowEmptyArrays: typeof i.allowEmptyArrays == "boolean" ? !!i.allowEmptyArrays : m.allowEmptyArrays,
1438
+ arrayFormat: h,
1439
+ charset: I,
1440
+ charsetSentinel: typeof i.charsetSentinel == "boolean" ? i.charsetSentinel : m.charsetSentinel,
1441
+ commaRoundTrip: !!i.commaRoundTrip,
1442
+ delimiter: typeof i.delimiter > "u" ? m.delimiter : i.delimiter,
1443
+ encode: typeof i.encode == "boolean" ? i.encode : m.encode,
1444
+ encodeDotInKeys: typeof i.encodeDotInKeys == "boolean" ? i.encodeDotInKeys : m.encodeDotInKeys,
1445
+ encoder: typeof i.encoder == "function" ? i.encoder : m.encoder,
1446
+ encodeValuesOnly: typeof i.encodeValuesOnly == "boolean" ? i.encodeValuesOnly : m.encodeValuesOnly,
1447
+ filter: M,
1448
+ format: w,
1449
+ formatter: E,
1450
+ serializeDate: typeof i.serializeDate == "function" ? i.serializeDate : m.serializeDate,
1451
+ skipNulls: typeof i.skipNulls == "boolean" ? i.skipNulls : m.skipNulls,
1452
+ sort: typeof i.sort == "function" ? i.sort : null,
1453
+ strictNullHandling: typeof i.strictNullHandling == "boolean" ? i.strictNullHandling : m.strictNullHandling
1454
+ };
1455
+ };
1456
+ return qr = function(u, i) {
1457
+ var I = u, w = n(i), E, M;
1458
+ typeof w.filter == "function" ? (M = w.filter, I = M("", I)) : b(w.filter) && (M = w.filter, E = M);
1459
+ var h = [];
1460
+ if (typeof I != "object" || I === null)
1461
+ return "";
1462
+ var R = g[w.arrayFormat], o = R === "comma" && w.commaRoundTrip;
1463
+ E || (E = Object.keys(I)), w.sort && E.sort(w.sort);
1464
+ for (var c = e(), p = 0; p < E.length; ++p) {
1465
+ var S = E[p], _ = I[S];
1466
+ w.skipNulls && _ === null || v(h, A(
1467
+ _,
1468
+ S,
1469
+ R,
1470
+ o,
1471
+ w.allowEmptyArrays,
1472
+ w.strictNullHandling,
1473
+ w.skipNulls,
1474
+ w.encodeDotInKeys,
1475
+ w.encode ? w.encoder : null,
1476
+ w.filter,
1477
+ w.sort,
1478
+ w.allowDots,
1479
+ w.serializeDate,
1480
+ w.format,
1481
+ w.formatter,
1482
+ w.encodeValuesOnly,
1483
+ w.charset,
1484
+ c
1485
+ ));
1486
+ }
1487
+ var x = h.join(w.delimiter), B = w.addQueryPrefix === !0 ? "?" : "";
1488
+ return w.charsetSentinel && (w.charset === "iso-8859-1" ? B += "utf8=%26%2310003%3B&" : B += "utf8=%E2%9C%93&"), x.length > 0 ? B + x : "";
1489
+ }, qr;
1490
+ }
1491
+ var Mr, kt;
1492
+ function Gn() {
1493
+ if (kt) return Mr;
1494
+ kt = 1;
1495
+ var e = /* @__PURE__ */ rn(), a = Object.prototype.hasOwnProperty, f = Array.isArray, l = {
1496
+ allowDots: !1,
1497
+ allowEmptyArrays: !1,
1498
+ allowPrototypes: !1,
1499
+ allowSparse: !1,
1500
+ arrayLimit: 20,
1501
+ charset: "utf-8",
1502
+ charsetSentinel: !1,
1503
+ comma: !1,
1504
+ decodeDotInKeys: !1,
1505
+ decoder: e.decode,
1506
+ delimiter: "&",
1507
+ depth: 5,
1508
+ duplicates: "combine",
1509
+ ignoreQueryPrefix: !1,
1510
+ interpretNumericEntities: !1,
1511
+ parameterLimit: 1e3,
1512
+ parseArrays: !0,
1513
+ plainObjects: !1,
1514
+ strictDepth: !1,
1515
+ strictMerge: !0,
1516
+ strictNullHandling: !1,
1517
+ throwOnLimitExceeded: !1
1518
+ }, g = function(A) {
1519
+ return A.replace(/&#(\d+);/g, function(n, u) {
1520
+ return String.fromCharCode(parseInt(u, 10));
1521
+ });
1522
+ }, b = function(A, n, u) {
1523
+ if (A && typeof A == "string" && n.comma && A.indexOf(",") > -1)
1524
+ return A.split(",");
1525
+ if (n.throwOnLimitExceeded && u >= n.arrayLimit)
1526
+ throw new RangeError("Array limit exceeded. Only " + n.arrayLimit + " element" + (n.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1527
+ return A;
1528
+ }, P = "utf8=%26%2310003%3B", v = "utf8=%E2%9C%93", O = function(n, u) {
1529
+ var i = { __proto__: null }, I = u.ignoreQueryPrefix ? n.replace(/^\?/, "") : n;
1530
+ I = I.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1531
+ var w = u.parameterLimit === 1 / 0 ? void 0 : u.parameterLimit, E = I.split(
1532
+ u.delimiter,
1533
+ u.throwOnLimitExceeded ? w + 1 : w
1534
+ );
1535
+ if (u.throwOnLimitExceeded && E.length > w)
1536
+ throw new RangeError("Parameter limit exceeded. Only " + w + " parameter" + (w === 1 ? "" : "s") + " allowed.");
1537
+ var M = -1, h, R = u.charset;
1538
+ if (u.charsetSentinel)
1539
+ for (h = 0; h < E.length; ++h)
1540
+ E[h].indexOf("utf8=") === 0 && (E[h] === v ? R = "utf-8" : E[h] === P && (R = "iso-8859-1"), M = h, h = E.length);
1541
+ for (h = 0; h < E.length; ++h)
1542
+ if (h !== M) {
1543
+ var o = E[h], c = o.indexOf("]="), p = c === -1 ? o.indexOf("=") : c + 1, S, _;
1544
+ if (p === -1 ? (S = u.decoder(o, l.decoder, R, "key"), _ = u.strictNullHandling ? null : "") : (S = u.decoder(o.slice(0, p), l.decoder, R, "key"), S !== null && (_ = e.maybeMap(
1545
+ b(
1546
+ o.slice(p + 1),
1547
+ u,
1548
+ f(i[S]) ? i[S].length : 0
1549
+ ),
1550
+ function(B) {
1551
+ return u.decoder(B, l.decoder, R, "value");
1552
+ }
1553
+ ))), _ && u.interpretNumericEntities && R === "iso-8859-1" && (_ = g(String(_))), o.indexOf("[]=") > -1 && (_ = f(_) ? [_] : _), u.comma && f(_) && _.length > u.arrayLimit) {
1554
+ if (u.throwOnLimitExceeded)
1555
+ throw new RangeError("Array limit exceeded. Only " + u.arrayLimit + " element" + (u.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1556
+ _ = e.combine([], _, u.arrayLimit, u.plainObjects);
1557
+ }
1558
+ if (S !== null) {
1559
+ var x = a.call(i, S);
1560
+ x && (u.duplicates === "combine" || o.indexOf("[]=") > -1) ? i[S] = e.combine(
1561
+ i[S],
1562
+ _,
1563
+ u.arrayLimit,
1564
+ u.plainObjects
1565
+ ) : (!x || u.duplicates === "last") && (i[S] = _);
1566
+ }
1567
+ }
1568
+ return i;
1569
+ }, y = function(A, n, u, i) {
1570
+ var I = 0;
1571
+ if (A.length > 0 && A[A.length - 1] === "[]") {
1572
+ var w = A.slice(0, -1).join("");
1573
+ I = Array.isArray(n) && n[w] ? n[w].length : 0;
1574
+ }
1575
+ for (var E = i ? n : b(n, u, I), M = A.length - 1; M >= 0; --M) {
1576
+ var h, R = A[M];
1577
+ if (R === "[]" && u.parseArrays)
1578
+ e.isOverflow(E) ? h = E : h = u.allowEmptyArrays && (E === "" || u.strictNullHandling && E === null) ? [] : e.combine(
1579
+ [],
1580
+ E,
1581
+ u.arrayLimit,
1582
+ u.plainObjects
1583
+ );
1584
+ else {
1585
+ h = u.plainObjects ? { __proto__: null } : {};
1586
+ var o = R.charAt(0) === "[" && R.charAt(R.length - 1) === "]" ? R.slice(1, -1) : R, c = u.decodeDotInKeys ? o.replace(/%2E/g, ".") : o, p = parseInt(c, 10), S = !isNaN(p) && R !== c && String(p) === c && p >= 0 && u.parseArrays;
1587
+ if (!u.parseArrays && c === "")
1588
+ h = { 0: E };
1589
+ else if (S && p < u.arrayLimit)
1590
+ h = [], h[p] = E;
1591
+ else {
1592
+ if (S && u.throwOnLimitExceeded)
1593
+ throw new RangeError("Array limit exceeded. Only " + u.arrayLimit + " element" + (u.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1594
+ S ? (h[p] = E, e.markOverflow(h, p)) : c !== "__proto__" && (h[c] = E);
1595
+ }
1596
+ }
1597
+ E = h;
1598
+ }
1599
+ return E;
1600
+ }, m = function(n, u) {
1601
+ var i = u.allowDots ? n.replace(/\.([^.[]+)/g, "[$1]") : n;
1602
+ if (u.depth <= 0)
1603
+ return !u.plainObjects && a.call(Object.prototype, i) && !u.allowPrototypes ? void 0 : [i];
1604
+ var I = /(\[[^[\]]*])/, w = /(\[[^[\]]*])/g, E = I.exec(i), M = E ? i.slice(0, E.index) : i, h = [];
1605
+ if (M) {
1606
+ if (!u.plainObjects && a.call(Object.prototype, M) && !u.allowPrototypes)
1607
+ return;
1608
+ h[h.length] = M;
1609
+ }
1610
+ for (var R = 0; (E = w.exec(i)) !== null && R < u.depth; ) {
1611
+ R += 1;
1612
+ var o = E[1].slice(1, -1);
1613
+ if (!u.plainObjects && a.call(Object.prototype, o) && !u.allowPrototypes)
1614
+ return;
1615
+ h[h.length] = E[1];
1616
+ }
1617
+ if (E) {
1618
+ if (u.strictDepth === !0)
1619
+ throw new RangeError("Input depth exceeded depth option of " + u.depth + " and strictDepth is true");
1620
+ h[h.length] = "[" + i.slice(E.index) + "]";
1621
+ }
1622
+ return h;
1623
+ }, d = function(n, u, i, I) {
1624
+ if (n) {
1625
+ var w = m(n, i);
1626
+ if (w)
1627
+ return y(w, u, i, I);
1628
+ }
1629
+ }, F = function(n) {
1630
+ if (!n)
1631
+ return l;
1632
+ if (typeof n.allowEmptyArrays < "u" && typeof n.allowEmptyArrays != "boolean")
1633
+ throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1634
+ if (typeof n.decodeDotInKeys < "u" && typeof n.decodeDotInKeys != "boolean")
1635
+ throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
1636
+ if (n.decoder !== null && typeof n.decoder < "u" && typeof n.decoder != "function")
1637
+ throw new TypeError("Decoder has to be a function.");
1638
+ if (typeof n.charset < "u" && n.charset !== "utf-8" && n.charset !== "iso-8859-1")
1639
+ throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1640
+ if (typeof n.throwOnLimitExceeded < "u" && typeof n.throwOnLimitExceeded != "boolean")
1641
+ throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
1642
+ var u = typeof n.charset > "u" ? l.charset : n.charset, i = typeof n.duplicates > "u" ? l.duplicates : n.duplicates;
1643
+ if (i !== "combine" && i !== "first" && i !== "last")
1644
+ throw new TypeError("The duplicates option must be either combine, first, or last");
1645
+ var I = typeof n.allowDots > "u" ? n.decodeDotInKeys === !0 ? !0 : l.allowDots : !!n.allowDots;
1646
+ return {
1647
+ allowDots: I,
1648
+ allowEmptyArrays: typeof n.allowEmptyArrays == "boolean" ? !!n.allowEmptyArrays : l.allowEmptyArrays,
1649
+ allowPrototypes: typeof n.allowPrototypes == "boolean" ? n.allowPrototypes : l.allowPrototypes,
1650
+ allowSparse: typeof n.allowSparse == "boolean" ? n.allowSparse : l.allowSparse,
1651
+ arrayLimit: typeof n.arrayLimit == "number" ? n.arrayLimit : l.arrayLimit,
1652
+ charset: u,
1653
+ charsetSentinel: typeof n.charsetSentinel == "boolean" ? n.charsetSentinel : l.charsetSentinel,
1654
+ comma: typeof n.comma == "boolean" ? n.comma : l.comma,
1655
+ decodeDotInKeys: typeof n.decodeDotInKeys == "boolean" ? n.decodeDotInKeys : l.decodeDotInKeys,
1656
+ decoder: typeof n.decoder == "function" ? n.decoder : l.decoder,
1657
+ delimiter: typeof n.delimiter == "string" || e.isRegExp(n.delimiter) ? n.delimiter : l.delimiter,
1658
+ // eslint-disable-next-line no-implicit-coercion, no-extra-parens
1659
+ depth: typeof n.depth == "number" || n.depth === !1 ? +n.depth : l.depth,
1660
+ duplicates: i,
1661
+ ignoreQueryPrefix: n.ignoreQueryPrefix === !0,
1662
+ interpretNumericEntities: typeof n.interpretNumericEntities == "boolean" ? n.interpretNumericEntities : l.interpretNumericEntities,
1663
+ parameterLimit: typeof n.parameterLimit == "number" ? n.parameterLimit : l.parameterLimit,
1664
+ parseArrays: n.parseArrays !== !1,
1665
+ plainObjects: typeof n.plainObjects == "boolean" ? n.plainObjects : l.plainObjects,
1666
+ strictDepth: typeof n.strictDepth == "boolean" ? !!n.strictDepth : l.strictDepth,
1667
+ strictMerge: typeof n.strictMerge == "boolean" ? !!n.strictMerge : l.strictMerge,
1668
+ strictNullHandling: typeof n.strictNullHandling == "boolean" ? n.strictNullHandling : l.strictNullHandling,
1669
+ throwOnLimitExceeded: typeof n.throwOnLimitExceeded == "boolean" ? n.throwOnLimitExceeded : !1
1670
+ };
1671
+ };
1672
+ return Mr = function(A, n) {
1673
+ var u = F(n);
1674
+ if (A === "" || A === null || typeof A > "u")
1675
+ return u.plainObjects ? { __proto__: null } : {};
1676
+ for (var i = typeof A == "string" ? O(A, u) : A, I = u.plainObjects ? { __proto__: null } : {}, w = Object.keys(i), E = 0; E < w.length; ++E) {
1677
+ var M = w[E], h = d(M, i[M], u, typeof A == "string");
1678
+ I = e.merge(I, h, u);
1679
+ }
1680
+ return u.allowSparse === !0 ? I : e.compact(I);
1681
+ }, Mr;
1682
+ }
1683
+ var Dr, Gt;
1684
+ function Hn() {
1685
+ if (Gt) return Dr;
1686
+ Gt = 1;
1687
+ var e = /* @__PURE__ */ kn(), a = /* @__PURE__ */ Gn(), f = /* @__PURE__ */ Lr();
1688
+ return Dr = {
1689
+ formats: f,
1690
+ parse: a,
1691
+ stringify: e
1692
+ }, Dr;
1693
+ }
1694
+ var jn = /* @__PURE__ */ Hn(), de = /* @__PURE__ */ ((e) => (e.Complete = "complete", e.Error = "error", e.WidgetResize = "widget-resize", e.PopoverResize = "popover-resize", e.FullscreenResize = "fullscreen-resize", e.Expire = "expire", e))(de || {}), $r = /* @__PURE__ */ ((e) => (e.Resize = "resize", e.Destroy = "destroy", e))($r || {}), Re = /* @__PURE__ */ ((e) => (e.Development = "http://localhost:3000", e.Staging = "https://relay.withpersona-staging.com", e.Production = "https://relay.withpersona.com", e))(Re || {});
1695
+ function Kn(e) {
1696
+ try {
1697
+ const a = new URL(e);
1698
+ return a.hostname === "localhost" ? !0 : !(a.protocol !== "https:" || !a.hostname || !a.hostname.includes("."));
1699
+ } catch {
1700
+ return !1;
1701
+ }
1702
+ }
1703
+ function Br(e) {
1704
+ switch (e) {
1705
+ case "development":
1706
+ return Re.Development;
1707
+ case "staging":
1708
+ return Re.Staging;
1709
+ case "production":
1710
+ case void 0:
1711
+ case null:
1712
+ return Re.Production;
1713
+ default:
1714
+ if (typeof e == "string") {
1715
+ const a = e.startsWith("localhost") ? `http://${e}` : `https://${e}`;
1716
+ if (Kn(a))
1717
+ return a.replace(/\/$/, "");
1718
+ }
1719
+ return console.warn(
1720
+ `[PersonaRelay] Invalid host: "${e}". Expected 'development', 'staging', 'production', or a valid hostname/URL. Falling back to 'production'.`
1721
+ ), Re.Production;
1722
+ }
1723
+ }
1724
+ const Qn = "0.1.2", Vn = [
1725
+ "allow-scripts",
1726
+ // Run the widget app
1727
+ "allow-same-origin",
1728
+ // Cookies, localStorage
1729
+ "allow-popups"
1730
+ // External links
1731
+ ], Jn = [
1732
+ "allow-forms",
1733
+ "allow-modals",
1734
+ "allow-top-navigation-by-user-activation"
1735
+ ];
1736
+ function Cr(e, a, { accessToken: f, host: l, theme: g }, b = "/relay-widget") {
1737
+ if (!f)
1738
+ throw new Error("[PersonaRelay] accessToken is required to initialize the relay widget");
1739
+ const P = Br(l), v = jn.stringify(
1740
+ {
1741
+ "client-version": Qn,
1742
+ "container-id": a,
1743
+ "relay-session-access-token": f,
1744
+ theme: g
1745
+ },
1746
+ {
1747
+ addQueryPrefix: !0,
1748
+ skipNulls: !0
1749
+ }
1750
+ );
1751
+ return b === "/relay-popover" ? (e.title = "Relay popover", e.className = "relay-widget__popover-iframe", e.allow = "clipboard-write") : b === "/relay-fullscreen" ? (e.title = "Relay fullscreen", e.className = "relay-widget__fullscreen-iframe", e.allow = "camera;microphone;clipboard-write") : (e.title = "Verify via Relay", e.className = "relay-widget__iframe", e.allow = "clipboard-write"), e.setAttribute(
1752
+ "sandbox",
1753
+ Vn.concat(Jn).join(" ")
1754
+ ), e.referrerPolicy = "no-referrer", e.src = P + b + v, e;
1755
+ }
1756
+ function Ht(e) {
1757
+ if (e === "localhost" || /^\d+\.\d+\.\d+\.\d+$/.test(e))
1758
+ return e;
1759
+ const a = e.split(".");
1760
+ return a.length <= 1 ? e : a.slice(-2).join(".");
1761
+ }
1762
+ function Yn(e, {
1763
+ onComplete: a,
1764
+ onError: f,
1765
+ onExpire: l,
1766
+ onWidgetResize: g,
1767
+ onPopoverResize: b,
1768
+ onFullscreenResize: P,
1769
+ host: v
1770
+ }) {
1771
+ const O = (y) => {
1772
+ const m = Br(v ?? "production");
1773
+ if (y.origin !== "")
1774
+ try {
1775
+ const F = Ht(new URL(y.origin).host), A = Ht(new URL(m).host);
1776
+ if (F !== A)
1777
+ return;
1778
+ } catch {
1779
+ return;
1780
+ }
1781
+ if (e !== y.data.containerId)
1782
+ return;
1783
+ const d = y.data;
1784
+ switch (d.name) {
1785
+ case de.Complete:
1786
+ a?.();
1787
+ break;
1788
+ case de.Error:
1789
+ f?.(d.error);
1790
+ break;
1791
+ case de.WidgetResize:
1792
+ g?.(d.metadata);
1793
+ break;
1794
+ case de.PopoverResize:
1795
+ b?.(d.metadata);
1796
+ break;
1797
+ case de.FullscreenResize:
1798
+ P?.(d.metadata);
1799
+ break;
1800
+ case de.Expire:
1801
+ l?.();
1802
+ break;
1803
+ }
1804
+ };
1805
+ return window.addEventListener("message", O), () => {
1806
+ window.removeEventListener("message", O);
1807
+ };
1808
+ }
1809
+ function Xn() {
1810
+ return "relay-widget-" + crypto.randomUUID();
1811
+ }
1812
+ class Zn {
1813
+ constructor(a) {
1814
+ this.id = a;
1815
+ }
1816
+ /**
1817
+ * Checks if the stylesheet is currently mounted in the document.
1818
+ */
1819
+ isMounted() {
1820
+ return document.getElementById(this.id) != null;
1821
+ }
1822
+ /**
1823
+ * Mounts the stylesheet with the given CSS content.
1824
+ * Does nothing if already mounted.
1825
+ *
1826
+ * @param css - The CSS content to mount
1827
+ */
1828
+ mount(a) {
1829
+ if (document.getElementById(this.id)) {
1830
+ console.warn(`[PersonaRelay] Stylesheet ${this.id} already appended. Skipping.`);
1831
+ return;
1832
+ }
1833
+ const f = tn("style", { id: this.id }, [document.createTextNode(a)]);
1834
+ document.head.appendChild(f);
1835
+ }
1836
+ /**
1837
+ * Unmounts the stylesheet from the document.
1838
+ * Does nothing if not mounted.
1839
+ */
1840
+ unmount() {
1841
+ const a = document.getElementById(this.id);
1842
+ if (a == null) {
1843
+ console.warn(`[PersonaRelay] No stylesheet ${this.id} to remove. Skipping.`);
1844
+ return;
1845
+ }
1846
+ a.parentNode?.removeChild(a);
1847
+ }
1848
+ }
1849
+ function tn(e, a, f = []) {
1850
+ const l = document.createElement(e);
1851
+ for (let [g, b] of Object.entries(a))
1852
+ g === "className" && (g = "class"), l.setAttribute(g, b);
1853
+ for (const g of f)
1854
+ g !== !1 && (typeof g == "string" ? l.appendChild(document.createTextNode(g)) : l.appendChild(g));
1855
+ return l;
1856
+ }
1857
+ const ea = ".relay-widget__container{position:relative;width:100%;color-scheme:light dark}.relay-widget__iframe{border:none;background:transparent;display:block;width:100%;height:0px}.relay-widget__popover-iframe{border:none;background:transparent;display:block;position:absolute;bottom:100%;left:-32px;transform:translateY(28px);width:calc(100% + 64px);height:0px}.relay-widget__fullscreen-iframe{border:none;background:transparent;display:none;height:0px}.relay-widget__fullscreen-iframe--visible{display:block;position:fixed;top:0;left:0;width:100%;height:100%;z-index:2147483647}.relay-widget__scroll-locked{overflow:hidden!important}";
1858
+ class ra {
1859
+ /**
1860
+ * Creates a new Relay widget instance.
1861
+ *
1862
+ * @param container - CSS selector string or HTMLElement to mount into
1863
+ * @param options - Configuration options for the widget
1864
+ */
1865
+ constructor(a, f) {
1866
+ this.relayCSS = new Zn("relay-widget-styles"), this.resizeObserver = null, this.removeResizeListener = null, this.options = f, this.baseUrl = Br(this.options.host), this.containerParent = this.resolveContainer(a), this.containerId = Xn(), this.containerElement = tn("div", {
1867
+ class: "relay-widget__container",
1868
+ id: this.containerId
1869
+ }), this.iframeElement = document.createElement("iframe"), this.popoverIframeElement = document.createElement("iframe"), this.fullscreenIframeElement = document.createElement("iframe"), this.unsubscribeFromEvents = Yn(this.containerId, {
1870
+ onComplete: this.options.onComplete ?? null,
1871
+ onError: this.options.onError ?? null,
1872
+ onExpire: this.options.onExpire ?? null,
1873
+ onWidgetResize: (l) => this.handleWidgetResize(l),
1874
+ onPopoverResize: (l) => this.handlePopoverResize(l),
1875
+ onFullscreenResize: (l) => this.handleFullscreenResize(l),
1876
+ host: this.options.host ?? null
1877
+ }), this.containerElement.appendChild(this.iframeElement), this.containerElement.appendChild(this.popoverIframeElement), this.containerParent.appendChild(this.containerElement), document.body.appendChild(this.fullscreenIframeElement), this.relayCSS.mount(ea);
1878
+ try {
1879
+ Cr(this.iframeElement, this.containerId, this.options, "/relay-widget"), Cr(this.popoverIframeElement, this.containerId, this.options, "/relay-popover"), Cr(
1880
+ this.fullscreenIframeElement,
1881
+ this.containerId,
1882
+ this.options,
1883
+ "/relay-fullscreen"
1884
+ );
1885
+ } catch (l) {
1886
+ throw console.error("[PersonaRelay]", l), this.destroy(), l;
1887
+ }
1888
+ this.setupResizeObserver();
1889
+ }
1890
+ /**
1891
+ * Resolves the container option to an HTMLElement.
1892
+ * Accepts a CSS selector string or an HTMLElement.
1893
+ */
1894
+ resolveContainer(a) {
1895
+ if (a instanceof HTMLElement)
1896
+ return a;
1897
+ const f = document.querySelector(a);
1898
+ if (!f)
1899
+ throw new Error(`[PersonaRelay] Container element not found for selector: "${a}"`);
1900
+ return f;
1901
+ }
1902
+ /**
1903
+ * Handles widget-resize events by updating the iframe height to match the widget content.
1904
+ */
1905
+ handleWidgetResize({ height: a }) {
1906
+ this.iframeElement.style.height = `${a}px`;
1907
+ }
1908
+ /**
1909
+ * Handles popover-resize events by updating the popover iframe height.
1910
+ */
1911
+ handlePopoverResize({ height: a }) {
1912
+ const f = a > 0 ? a + 64 : 0;
1913
+ this.popoverIframeElement.style.height = `${f}px`;
1914
+ }
1915
+ /**
1916
+ * Shows or hides the fullscreen iframe as a fullscreen overlay.
1917
+ * The iframe is kept in the DOM at 0px when hidden so it continues to render and receive messages.
1918
+ */
1919
+ handleFullscreenResize({ fullscreen: a }) {
1920
+ a ? (this.lockScroll(), this.fullscreenIframeElement.classList.add("relay-widget__fullscreen-iframe--visible")) : (this.fullscreenIframeElement.classList.remove("relay-widget__fullscreen-iframe--visible"), this.unlockScroll());
1921
+ }
1922
+ /**
1923
+ * Locks page scroll when the fullscreen overlay is active.
1924
+ */
1925
+ lockScroll() {
1926
+ document.body.classList.add("relay-widget__scroll-locked");
1927
+ }
1928
+ /**
1929
+ * Unlocks page scroll when the fullscreen overlay closes.
1930
+ */
1931
+ unlockScroll() {
1932
+ document.body.classList.remove("relay-widget__scroll-locked");
1933
+ }
1934
+ /**
1935
+ * Sends the current parent container dimensions to the widget iframe.
1936
+ */
1937
+ sendResize() {
1938
+ const { clientWidth: a, clientHeight: f } = document.body, l = {
1939
+ action: $r.Resize,
1940
+ containerId: this.containerId,
1941
+ metadata: { width: a, height: f }
1942
+ };
1943
+ this.iframeElement.contentWindow?.postMessage(l, this.baseUrl), this.popoverIframeElement.contentWindow?.postMessage(l, this.baseUrl), this.fullscreenIframeElement.contentWindow?.postMessage(l, this.baseUrl);
1944
+ }
1945
+ /**
1946
+ * Observes the parent container for size changes and forwards
1947
+ * dimensions to the widget via postMessage.
1948
+ */
1949
+ setupResizeObserver() {
1950
+ this.iframeElement.addEventListener("load", () => this.sendResize(), { once: !0 });
1951
+ const a = () => this.sendResize();
1952
+ window.addEventListener("resize", a), this.removeResizeListener = () => window.removeEventListener("resize", a);
1953
+ }
1954
+ /**
1955
+ * Destroys the widget and cleans up all resources.
1956
+ * After calling this, the instance should not be used.
1957
+ */
1958
+ destroy() {
1959
+ const a = { action: $r.Destroy, metadata: {} };
1960
+ this.iframeElement.contentWindow?.postMessage(a, this.baseUrl), this.popoverIframeElement.contentWindow?.postMessage(a, this.baseUrl), this.fullscreenIframeElement.contentWindow?.postMessage(a, this.baseUrl), this.relayCSS.unmount(), this.unlockScroll(), this.resizeObserver?.disconnect(), this.resizeObserver = null, this.removeResizeListener?.(), this.removeResizeListener = null, this.containerElement.parentNode && this.containerParent.removeChild(this.containerElement), this.fullscreenIframeElement.parentNode && this.fullscreenIframeElement.parentNode.removeChild(this.fullscreenIframeElement), this.unsubscribeFromEvents();
1961
+ }
1962
+ }
1963
+ export {
1964
+ ra as default
1965
+ };
1966
+ //# sourceMappingURL=relay.js.map