@soma-vertical-web/multi-lib 1.0.11 → 1.0.13

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.
@@ -1,1826 +0,0 @@
1
- import { jsxs as it, Fragment as dr, jsx as P } from "react/jsx-runtime";
2
- import { Utils as mr } from "@soma-vertical-web/core-components";
3
- const He = (t, e = !0) => Intl.NumberFormat("pt-BR", {
4
- style: "currency",
5
- currency: "BRL",
6
- minimumFractionDigits: e ? 2 : 0
7
- }).format(t), vr = ({ valueInCents: t, hasFree: e, freeTaxMessage: r }) => t === 0 ? e ? r : He(0) : He(t / 100), gr = (t, e) => {
8
- const n = (t - e) * 100 / t;
9
- return Math.floor(n);
10
- }, Mt = (t, e) => {
11
- const [r, n] = t.split(e);
12
- return { name: r.trim(), size: n ? n.trim() : "" };
13
- }, hr = (t, e) => {
14
- if (!t)
15
- return {};
16
- const [r, n] = t.split(e);
17
- return { color: r == null ? void 0 : r.trim(), size: n == null ? void 0 : n.trim() };
18
- }, br = (t, e = "tamanho") => {
19
- if (t.additionalProperty) {
20
- const [r] = t.additionalProperty;
21
- return r != null && r.name ? r.name.toLocaleLowerCase() === e ? r.value : t.name : "";
22
- }
23
- return t.name;
24
- }, _r = (t, e) => t.replace(e, "").trim(), Sr = (t) => t.replace(/\//g, ""), wr = ({ items: t, NAME_SPLIT_SYMBOL: e }) => {
25
- const r = {
26
- price: 0,
27
- listPrice: 0,
28
- installments: {
29
- count: 0,
30
- value: 0
31
- }
32
- }, n = (i, c) => {
33
- var u;
34
- c && (c.sellerId = i.sellerId, c.sellerName = i.sellerName, c.available = !0, c.isSellerDefault = i.sellerDefault);
35
- const {
36
- Price: l,
37
- ListPrice: s,
38
- PaymentOptions: { installmentOptions: f }
39
- } = i.commertialOffer;
40
- r.price = l, r.listPrice = s;
41
- const p = (u = f == null ? void 0 : f[0]) == null ? void 0 : u.installments;
42
- if (p) {
43
- const { count: m, value: d } = p[p.length - 1];
44
- r.installments = {
45
- count: m,
46
- value: d / 100
47
- };
48
- }
49
- };
50
- let o = !0;
51
- const a = t.reduce((i, c) => {
52
- var f;
53
- const l = {
54
- name: c.name,
55
- sku: c.itemId,
56
- value: ((f = c.Tamanho) == null ? void 0 : f[0]) ?? Mt(c.nameComplete ?? c.name, e).size,
57
- available: !1,
58
- sellerId: "",
59
- sellerName: "",
60
- isSellerDefault: !1
61
- }, s = c.sellers.filter((p) => (p.sellerDefault && p.commertialOffer.IsAvailable && (l.available = !0, n(p, l)), p.commertialOffer.IsAvailable));
62
- return !l.isSellerDefault && s.length > 0 && (l.available = !0, n(s[0], {
63
- ...l,
64
- sellerId: s[0].sellerId,
65
- sellerName: s[0].sellerName
66
- })), l.available === !1 && (o = !1), i.push(l), i;
67
- }, []);
68
- return {
69
- ...r,
70
- sizes: a,
71
- allSizesAvailable: o
72
- };
73
- }, Ar = (t) => t ? !t.offers.offers.find(({ quantity: e = 0 }) => e > 0) : !1, Or = (t, e) => {
74
- const r = t.find(
75
- (n) => n.availability.includes("InStock") && n.quantity && n.listPrice > 0 && n.seller.identifier === e
76
- );
77
- return r || t.find(
78
- (n) => n.availability.includes("InStock") && n.quantity && n.listPrice > 0
79
- );
80
- }, xr = ({ images: t, TEXTURE_IMAGE: e }) => t.find((r) => e.includes(r.imageLabel)) ?? t[0], Er = (t, e) => {
81
- const r = /\/ids\/(\d+)\//, n = t.match(r);
82
- return n ? t.replace(
83
- `/${n[1]}/`,
84
- `/${n[1]}-${e.width}-${e.height}/`
85
- ) : t;
86
- }, Pr = (t, e) => {
87
- const r = /\/ids\/(\d+)-(\d+)-(\d+)\//, n = t.match(r);
88
- return n ? t.replace(
89
- `/${n[1]}-${n[2]}-${n[3]}/`,
90
- `/${n[1]}-${e.width}-${e.height}/`
91
- ) : t;
92
- }, $r = ({
93
- images: t,
94
- label: e
95
- }) => {
96
- const r = t.filter(
97
- (n) => n.keywords === e.first || n.keywords === e.second || n.alternateName === e.first || n.alternateName === e.second
98
- );
99
- return r.length === 0 ? t.slice(0, 2) : r;
100
- }, Ir = (t) => {
101
- const [e, r] = t.split("/").map(Number);
102
- if (Number.isNaN(e) || Number.isNaN(r))
103
- throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");
104
- return r / e;
105
- }, Rr = (t, e, r) => {
106
- e && (t ? (e.getAttribute("src") || (e.src = r ?? ""), e.play()) : e.pause());
107
- }, mi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
108
- __proto__: null,
109
- disableSKU: Ar,
110
- formatPriceToCurrency: He,
111
- freightParsePrice: vr,
112
- getAspectRatio: Ir,
113
- getColorAndSizeFromSkuName: hr,
114
- getDiscountPercent: gr,
115
- getFirstImages: $r,
116
- getProductNameWithoutSku: _r,
117
- getSKUName: br,
118
- getSkuInfos: wr,
119
- getThumbImage: xr,
120
- getValidOffer: Or,
121
- removeSlashes: Sr,
122
- resizingImg: Er,
123
- setVideoPlay: Rr,
124
- splitNameAndSizeFromFullName: Mt,
125
- updatedResizedImg: Pr
126
- }, Symbol.toStringTag, { value: "Module" })), lt = "fuzzy", ct = "operator", Dr = (t) => ({
127
- isDepartment: t != null && t.length ? t[0].key === "category-1" : !1
128
- }), vi = (t, e) => {
129
- const r = decodeURIComponent(e ?? "").slice(1).split("/");
130
- return t.map((n) => {
131
- if (n.key === "category-2" && n.__typename === "FacetBoolean") {
132
- const o = n.values;
133
- return {
134
- ...n,
135
- values: o.filter(
136
- (a) => !r.find(
137
- (i) => i.toLowerCase() === a.value || i.toLowerCase() === a.name.toLowerCase()
138
- )
139
- )
140
- };
141
- }
142
- return n;
143
- });
144
- }, Bt = (t, e) => e ? t === "category-1" : !1, Tr = (t) => t.key === "operator" && (t.value === "and" || t.value === "or"), Fr = (t) => t.type === "TEXT", Nr = (t) => t.key === "fuzzy" && (t.value === "0" || t.value === "1" || t.value === "auto"), Cr = (t) => {
145
- const { key: e, name: r, values: n } = t;
146
- return {
147
- __typename: "FacetBoolean",
148
- key: e,
149
- label: r,
150
- values: n.slice().sort((o, a) => o.name.localeCompare(a.name))
151
- };
152
- }, Mr = ({ key: t, values: e }) => ({
153
- __typename: "FacetRange",
154
- key: t,
155
- values: e
156
- }), gi = (t, e, r) => {
157
- if (!(t instanceof Object) || !("facets" in t))
158
- return [];
159
- const { facets: n = [] } = t, o = e != null && e.length ? e[0].key === "category-1" : !1;
160
- return n.filter(
161
- (i) => !r || !Bt(i.key, o)
162
- ).map(
163
- (i) => Fr(i) ? Cr(i) : Mr(i)
164
- );
165
- }, hi = (t, e) => {
166
- const r = t.find(({ key: o }) => o === lt) ?? null, n = t.find(({ key: o }) => o === ct) ?? null;
167
- r && Nr(r) && e.append(lt, r.value), n && Tr(n) && e.append(ct, n.value);
168
- }, Br = (t) => t.map((e) => {
169
- const [r, n] = e.split("/");
170
- return { key: r, value: n };
171
- }), bi = (t, e) => {
172
- const r = decodeURIComponent(e ?? "").slice(1).split("/"), n = t.filter(({ value: a }) => !r.includes(decodeURIComponent(a))).map((a) => ({
173
- ...a,
174
- value: decodeURIComponent(a.value)
175
- })), { isDepartment: o } = Dr(n);
176
- return n == null ? void 0 : n.filter((a) => !Bt(a.key, o));
177
- }, _i = ({ pathname: t, searchParams: e }, r) => {
178
- const n = e.get("sort") ?? "", o = e.get("query") ?? null, a = parseInt(e.get("page") ?? "1", 10);
179
- return {
180
- sort: n,
181
- facets: Br(r),
182
- term: o,
183
- base: o ? "" : t,
184
- page: a
185
- };
186
- }, Si = (t) => {
187
- const e = new URLSearchParams();
188
- return Object.entries(t).forEach(([r, n]) => {
189
- Array.isArray(n) ? n.forEach((o) => e.append(r, o)) : n !== void 0 && e.append(r, n);
190
- }), e;
191
- }, wi = (t, e, r = 24, n = 1, o) => {
192
- const a = `/search?query=${e ?? ""}&count=${r}&page=${n}${o ? `&sort=${o.replace("_", ":")}` : ""}`;
193
- t.push(a);
194
- };
195
- var ft = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
196
- function kr(t) {
197
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
198
- }
199
- function Lr(t) {
200
- if (t.__esModule) return t;
201
- var e = t.default;
202
- if (typeof e == "function") {
203
- var r = function n() {
204
- return this instanceof n ? Reflect.construct(e, arguments, this.constructor) : e.apply(this, arguments);
205
- };
206
- r.prototype = e.prototype;
207
- } else r = {};
208
- return Object.defineProperty(r, "__esModule", { value: !0 }), Object.keys(t).forEach(function(n) {
209
- var o = Object.getOwnPropertyDescriptor(t, n);
210
- Object.defineProperty(r, n, o.get ? o : {
211
- enumerable: !0,
212
- get: function() {
213
- return t[n];
214
- }
215
- });
216
- }), r;
217
- }
218
- const ue = {
219
- "responsive-mobile-flex": "_responsive-mobile-flex_1e0ai_1",
220
- "responsive-desktop-flex": "_responsive-desktop-flex_1e0ai_15",
221
- "responsive-mobile-block": "_responsive-mobile-block_1e0ai_30",
222
- "responsive-desktop-block": "_responsive-desktop-block_1e0ai_41"
223
- }, Ur = "_header_mpbx7_57", Wr = "_actions_mpbx7_131", zr = "_breadcrumb_mpbx7_142", qr = "_credits_mpbx7_157", Gr = "_pdplinks_mpbx7_185", Hr = "_similars_mpbx7_212", jr = "_sizes_mpbx7_251", Kr = "_measurementTable_mpbx7_267", Vr = "_measurementHead_mpbx7_280", Qr = "_measurementRows_mpbx7_285", Jr = "_measurementRowsTitle_mpbx7_302", Yr = "_measurementRowsText_mpbx7_314", Xr = "_measurementImage_mpbx7_325", Zr = "_measurementImageContainer_mpbx7_328", en = "_measurementContent_mpbx7_337", tn = "_measurementTitle_mpbx7_341", rn = "_measurementClose_mpbx7_352", nn = "_productref_mpbx7_417", on = "_slideOut_mpbx7_1", an = "_slideIn_mpbx7_1", ln = "_content_mpbx7_397", cn = "_pdp_mpbx7_185", fn = "_divider_mpbx7_580", Ai = {
224
- "bottom-navigation": "_bottom-navigation_mpbx7_1",
225
- "bottom-navigation__credits-modifier": "_bottom-navigation__credits-modifier_mpbx7_18",
226
- "bottom-navigation__header": "_bottom-navigation__header_mpbx7_21",
227
- "bottom-navigation__header-content": "_bottom-navigation__header-content_mpbx7_26",
228
- "golden-tag-content": "_golden-tag-content_mpbx7_45",
229
- "bottom-navigation__price-and-promo": "_bottom-navigation__price-and-promo_mpbx7_48",
230
- header: Ur,
231
- "golden-tag": "_golden-tag_mpbx7_45",
232
- "golden-tag-video": "_golden-tag-video_mpbx7_86",
233
- "golden-tag-content-text": "_golden-tag-content-text_mpbx7_105",
234
- actions: Wr,
235
- "add-to-cart": "_add-to-cart_mpbx7_138",
236
- breadcrumb: zr,
237
- "breadcrumb--active": "_breadcrumb--active_mpbx7_147",
238
- credits: qr,
239
- "gallery-carousel-modifier": "_gallery-carousel-modifier_mpbx7_162",
240
- pdplinks: Gr,
241
- "links-wrapper": "_links-wrapper_mpbx7_195",
242
- similars: Hr,
243
- "similars-info": "_similars-info_mpbx7_224",
244
- "toggle-style-modifier": "_toggle-style-modifier_mpbx7_233",
245
- "accessibility-info": "_accessibility-info_mpbx7_237",
246
- sizes: jr,
247
- "price-wrapper": "_price-wrapper_mpbx7_263",
248
- measurementTable: Kr,
249
- measurementHead: Vr,
250
- measurementRows: Qr,
251
- measurementRowsTitle: Jr,
252
- measurementRowsText: Yr,
253
- measurementImage: Xr,
254
- measurementImageContainer: Zr,
255
- measurementContent: en,
256
- measurementTitle: tn,
257
- measurementClose: rn,
258
- "tabs-root-modifier": "_tabs-root-modifier_mpbx7_358",
259
- "tabs-list-modifier": "_tabs-list-modifier_mpbx7_376",
260
- "tabs-item-modifier": "_tabs-item-modifier_mpbx7_393",
261
- "content-wrapper": "_content-wrapper_mpbx7_397",
262
- productref: nn,
263
- "tabs-panel": "_tabs-panel_mpbx7_428",
264
- "tabs-panel-exit": "_tabs-panel-exit_mpbx7_434",
265
- slideOut: on,
266
- "tabs-panel-enter": "_tabs-panel-enter_mpbx7_438",
267
- slideIn: an,
268
- content: ln,
269
- pdp: cn,
270
- "pdp-main": "_pdp-main_mpbx7_496",
271
- "pdp-main__gallery-wrapper": "_pdp-main__gallery-wrapper_mpbx7_501",
272
- "pdp-main__info": "_pdp-main__info_mpbx7_518",
273
- "pdp-main__info-main-content": "_pdp-main__info-main-content_mpbx7_538",
274
- "pdp-main__info-subsection": "_pdp-main__info-subsection_mpbx7_538",
275
- "subsection-product-info": "_subsection-product-info_mpbx7_549",
276
- "subsection-similars": "_subsection-similars_mpbx7_552",
277
- "subsection-sizes": "_subsection-sizes_mpbx7_555",
278
- "subsection-actions": "_subsection-actions_mpbx7_558",
279
- "pdp-main__info-secondary-content": "_pdp-main__info-secondary-content_mpbx7_562",
280
- "sections-title": "_sections-title_mpbx7_568",
281
- divider: fn,
282
- "breadcrumbs-desktop": "_breadcrumbs-desktop_mpbx7_585",
283
- "breadcrumbs-mobile": "_breadcrumbs-mobile_mpbx7_594"
284
- }, Oi = ({
285
- children: t,
286
- data: e,
287
- SectionZone: r,
288
- className: n
289
- }) => {
290
- var f, p;
291
- const o = ((f = e == null ? void 0 : e.filter((u) => {
292
- var m, d;
293
- return ((d = (m = u.config) == null ? void 0 : m.responsive) == null ? void 0 : d.deviceType) === "mobile";
294
- })[0]) == null ? void 0 : f.sections) || [], a = ((p = e == null ? void 0 : e.filter((u) => {
295
- var m, d;
296
- return ((d = (m = u.config) == null ? void 0 : m.responsive) == null ? void 0 : d.deviceType) === "desktop";
297
- })[0]) == null ? void 0 : p.sections) || [], i = o.slice(0, 1), c = o.slice(1, o.length), l = a.slice(0, 1), s = a.slice(1, a.length);
298
- return /* @__PURE__ */ it(dr, { children: [
299
- /* @__PURE__ */ it("div", { className: n, children: [
300
- /* @__PURE__ */ P("div", { className: ue["responsive-mobile-flex"], children: /* @__PURE__ */ P(r, { data: i ?? [] }) }),
301
- /* @__PURE__ */ P("div", { className: ue["responsive-desktop-flex"], children: /* @__PURE__ */ P(r, { data: l ?? [] }) })
302
- ] }),
303
- t,
304
- /* @__PURE__ */ P("div", { className: ue["responsive-mobile-flex"], children: /* @__PURE__ */ P(r, { data: c ?? [] }) }),
305
- /* @__PURE__ */ P("div", { className: ue["responsive-desktop-flex"], children: /* @__PURE__ */ P(r, { data: s ?? [] }) }),
306
- /* @__PURE__ */ P(mr.Divider, {})
307
- ] });
308
- };
309
- var J = TypeError;
310
- const un = {}, sn = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
311
- __proto__: null,
312
- default: un
313
- }, Symbol.toStringTag, { value: "Module" })), pn = /* @__PURE__ */ Lr(sn);
314
- var Xe = typeof Map == "function" && Map.prototype, Pe = Object.getOwnPropertyDescriptor && Xe ? Object.getOwnPropertyDescriptor(Map.prototype, "size") : null, ve = Xe && Pe && typeof Pe.get == "function" ? Pe.get : null, ut = Xe && Map.prototype.forEach, Ze = typeof Set == "function" && Set.prototype, $e = Object.getOwnPropertyDescriptor && Ze ? Object.getOwnPropertyDescriptor(Set.prototype, "size") : null, ge = Ze && $e && typeof $e.get == "function" ? $e.get : null, st = Ze && Set.prototype.forEach, yn = typeof WeakMap == "function" && WeakMap.prototype, ee = yn ? WeakMap.prototype.has : null, dn = typeof WeakSet == "function" && WeakSet.prototype, te = dn ? WeakSet.prototype.has : null, mn = typeof WeakRef == "function" && WeakRef.prototype, pt = mn ? WeakRef.prototype.deref : null, vn = Boolean.prototype.valueOf, gn = Object.prototype.toString, hn = Function.prototype.toString, bn = String.prototype.match, et = String.prototype.slice, N = String.prototype.replace, _n = String.prototype.toUpperCase, yt = String.prototype.toLowerCase, kt = RegExp.prototype.test, dt = Array.prototype.concat, x = Array.prototype.join, Sn = Array.prototype.slice, mt = Math.floor, je = typeof BigInt == "function" ? BigInt.prototype.valueOf : null, Ie = Object.getOwnPropertySymbols, Ke = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? Symbol.prototype.toString : null, V = typeof Symbol == "function" && typeof Symbol.iterator == "object", re = typeof Symbol == "function" && Symbol.toStringTag && (typeof Symbol.toStringTag === V || !0) ? Symbol.toStringTag : null, Lt = Object.prototype.propertyIsEnumerable, vt = (typeof Reflect == "function" ? Reflect.getPrototypeOf : Object.getPrototypeOf) || ([].__proto__ === Array.prototype ? function(t) {
315
- return t.__proto__;
316
- } : null);
317
- function gt(t, e) {
318
- if (t === 1 / 0 || t === -1 / 0 || t !== t || t && t > -1e3 && t < 1e3 || kt.call(/e/, e))
319
- return e;
320
- var r = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;
321
- if (typeof t == "number") {
322
- var n = t < 0 ? -mt(-t) : mt(t);
323
- if (n !== t) {
324
- var o = String(n), a = et.call(e, o.length + 1);
325
- return N.call(o, r, "$&_") + "." + N.call(N.call(a, /([0-9]{3})/g, "$&_"), /_$/, "");
326
- }
327
- }
328
- return N.call(e, r, "$&_");
329
- }
330
- var Ve = pn, ht = Ve.custom, bt = zt(ht) ? ht : null, Ut = {
331
- __proto__: null,
332
- double: '"',
333
- single: "'"
334
- }, wn = {
335
- __proto__: null,
336
- double: /(["\\])/g,
337
- single: /(['\\])/g
338
- }, _e = function t(e, r, n, o) {
339
- var a = r || {};
340
- if ($(a, "quoteStyle") && !$(Ut, a.quoteStyle))
341
- throw new TypeError('option "quoteStyle" must be "single" or "double"');
342
- if ($(a, "maxStringLength") && (typeof a.maxStringLength == "number" ? a.maxStringLength < 0 && a.maxStringLength !== 1 / 0 : a.maxStringLength !== null))
343
- throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');
344
- var i = $(a, "customInspect") ? a.customInspect : !0;
345
- if (typeof i != "boolean" && i !== "symbol")
346
- throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");
347
- if ($(a, "indent") && a.indent !== null && a.indent !== " " && !(parseInt(a.indent, 10) === a.indent && a.indent > 0))
348
- throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');
349
- if ($(a, "numericSeparator") && typeof a.numericSeparator != "boolean")
350
- throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');
351
- var c = a.numericSeparator;
352
- if (typeof e > "u")
353
- return "undefined";
354
- if (e === null)
355
- return "null";
356
- if (typeof e == "boolean")
357
- return e ? "true" : "false";
358
- if (typeof e == "string")
359
- return Gt(e, a);
360
- if (typeof e == "number") {
361
- if (e === 0)
362
- return 1 / 0 / e > 0 ? "0" : "-0";
363
- var l = String(e);
364
- return c ? gt(e, l) : l;
365
- }
366
- if (typeof e == "bigint") {
367
- var s = String(e) + "n";
368
- return c ? gt(e, s) : s;
369
- }
370
- var f = typeof a.depth > "u" ? 5 : a.depth;
371
- if (typeof n > "u" && (n = 0), n >= f && f > 0 && typeof e == "object")
372
- return Qe(e) ? "[Array]" : "[Object]";
373
- var p = Un(a, n);
374
- if (typeof o > "u")
375
- o = [];
376
- else if (qt(o, e) >= 0)
377
- return "[Circular]";
378
- function u(w, F, E) {
379
- if (F && (o = Sn.call(o), o.push(F)), E) {
380
- var X = {
381
- depth: a.depth
382
- };
383
- return $(a, "quoteStyle") && (X.quoteStyle = a.quoteStyle), t(w, X, n + 1, o);
384
- }
385
- return t(w, a, n + 1, o);
386
- }
387
- if (typeof e == "function" && !_t(e)) {
388
- var m = Dn(e), d = se(e, u);
389
- return "[Function" + (m ? ": " + m : " (anonymous)") + "]" + (d.length > 0 ? " { " + x.call(d, ", ") + " }" : "");
390
- }
391
- if (zt(e)) {
392
- var _ = V ? N.call(String(e), /^(Symbol\(.*\))_[^)]*$/, "$1") : Ke.call(e);
393
- return typeof e == "object" && !V ? Z(_) : _;
394
- }
395
- if (Bn(e)) {
396
- for (var S = "<" + yt.call(String(e.nodeName)), I = e.attributes || [], R = 0; R < I.length; R++)
397
- S += " " + I[R].name + "=" + Wt(An(I[R].value), "double", a);
398
- return S += ">", e.childNodes && e.childNodes.length && (S += "..."), S += "</" + yt.call(String(e.nodeName)) + ">", S;
399
- }
400
- if (Qe(e)) {
401
- if (e.length === 0)
402
- return "[]";
403
- var v = se(e, u);
404
- return p && !Ln(v) ? "[" + Je(v, p) + "]" : "[ " + x.call(v, ", ") + " ]";
405
- }
406
- if (xn(e)) {
407
- var D = se(e, u);
408
- return !("cause" in Error.prototype) && "cause" in e && !Lt.call(e, "cause") ? "{ [" + String(e) + "] " + x.call(dt.call("[cause]: " + u(e.cause), D), ", ") + " }" : D.length === 0 ? "[" + String(e) + "]" : "{ [" + String(e) + "] " + x.call(D, ", ") + " }";
409
- }
410
- if (typeof e == "object" && i) {
411
- if (bt && typeof e[bt] == "function" && Ve)
412
- return Ve(e, { depth: f - n });
413
- if (i !== "symbol" && typeof e.inspect == "function")
414
- return e.inspect();
415
- }
416
- if (Tn(e)) {
417
- var M = [];
418
- return ut && ut.call(e, function(w, F) {
419
- M.push(u(F, e, !0) + " => " + u(w, e));
420
- }), St("Map", ve.call(e), M, p);
421
- }
422
- if (Cn(e)) {
423
- var Y = [];
424
- return st && st.call(e, function(w) {
425
- Y.push(u(w, e));
426
- }), St("Set", ge.call(e), Y, p);
427
- }
428
- if (Fn(e))
429
- return Re("WeakMap");
430
- if (Mn(e))
431
- return Re("WeakSet");
432
- if (Nn(e))
433
- return Re("WeakRef");
434
- if (Pn(e))
435
- return Z(u(Number(e)));
436
- if (In(e))
437
- return Z(u(je.call(e)));
438
- if ($n(e))
439
- return Z(vn.call(e));
440
- if (En(e))
441
- return Z(u(String(e)));
442
- if (typeof window < "u" && e === window)
443
- return "{ [object Window] }";
444
- if (typeof globalThis < "u" && e === globalThis || typeof ft < "u" && e === ft)
445
- return "{ [object globalThis] }";
446
- if (!On(e) && !_t(e)) {
447
- var z = se(e, u), ce = vt ? vt(e) === Object.prototype : e instanceof Object || e.constructor === Object, B = e instanceof Object ? "" : "null prototype", T = !ce && re && Object(e) === e && re in e ? et.call(C(e), 8, -1) : B ? "Object" : "", fe = ce || typeof e.constructor != "function" ? "" : e.constructor.name ? e.constructor.name + " " : "", q = fe + (T || B ? "[" + x.call(dt.call([], T || [], B || []), ": ") + "] " : "");
448
- return z.length === 0 ? q + "{}" : p ? q + "{" + Je(z, p) + "}" : q + "{ " + x.call(z, ", ") + " }";
449
- }
450
- return String(e);
451
- };
452
- function Wt(t, e, r) {
453
- var n = r.quoteStyle || e, o = Ut[n];
454
- return o + t + o;
455
- }
456
- function An(t) {
457
- return N.call(String(t), /"/g, "&quot;");
458
- }
459
- function W(t) {
460
- return !re || !(typeof t == "object" && (re in t || typeof t[re] < "u"));
461
- }
462
- function Qe(t) {
463
- return C(t) === "[object Array]" && W(t);
464
- }
465
- function On(t) {
466
- return C(t) === "[object Date]" && W(t);
467
- }
468
- function _t(t) {
469
- return C(t) === "[object RegExp]" && W(t);
470
- }
471
- function xn(t) {
472
- return C(t) === "[object Error]" && W(t);
473
- }
474
- function En(t) {
475
- return C(t) === "[object String]" && W(t);
476
- }
477
- function Pn(t) {
478
- return C(t) === "[object Number]" && W(t);
479
- }
480
- function $n(t) {
481
- return C(t) === "[object Boolean]" && W(t);
482
- }
483
- function zt(t) {
484
- if (V)
485
- return t && typeof t == "object" && t instanceof Symbol;
486
- if (typeof t == "symbol")
487
- return !0;
488
- if (!t || typeof t != "object" || !Ke)
489
- return !1;
490
- try {
491
- return Ke.call(t), !0;
492
- } catch {
493
- }
494
- return !1;
495
- }
496
- function In(t) {
497
- if (!t || typeof t != "object" || !je)
498
- return !1;
499
- try {
500
- return je.call(t), !0;
501
- } catch {
502
- }
503
- return !1;
504
- }
505
- var Rn = Object.prototype.hasOwnProperty || function(t) {
506
- return t in this;
507
- };
508
- function $(t, e) {
509
- return Rn.call(t, e);
510
- }
511
- function C(t) {
512
- return gn.call(t);
513
- }
514
- function Dn(t) {
515
- if (t.name)
516
- return t.name;
517
- var e = bn.call(hn.call(t), /^function\s*([\w$]+)/);
518
- return e ? e[1] : null;
519
- }
520
- function qt(t, e) {
521
- if (t.indexOf)
522
- return t.indexOf(e);
523
- for (var r = 0, n = t.length; r < n; r++)
524
- if (t[r] === e)
525
- return r;
526
- return -1;
527
- }
528
- function Tn(t) {
529
- if (!ve || !t || typeof t != "object")
530
- return !1;
531
- try {
532
- ve.call(t);
533
- try {
534
- ge.call(t);
535
- } catch {
536
- return !0;
537
- }
538
- return t instanceof Map;
539
- } catch {
540
- }
541
- return !1;
542
- }
543
- function Fn(t) {
544
- if (!ee || !t || typeof t != "object")
545
- return !1;
546
- try {
547
- ee.call(t, ee);
548
- try {
549
- te.call(t, te);
550
- } catch {
551
- return !0;
552
- }
553
- return t instanceof WeakMap;
554
- } catch {
555
- }
556
- return !1;
557
- }
558
- function Nn(t) {
559
- if (!pt || !t || typeof t != "object")
560
- return !1;
561
- try {
562
- return pt.call(t), !0;
563
- } catch {
564
- }
565
- return !1;
566
- }
567
- function Cn(t) {
568
- if (!ge || !t || typeof t != "object")
569
- return !1;
570
- try {
571
- ge.call(t);
572
- try {
573
- ve.call(t);
574
- } catch {
575
- return !0;
576
- }
577
- return t instanceof Set;
578
- } catch {
579
- }
580
- return !1;
581
- }
582
- function Mn(t) {
583
- if (!te || !t || typeof t != "object")
584
- return !1;
585
- try {
586
- te.call(t, te);
587
- try {
588
- ee.call(t, ee);
589
- } catch {
590
- return !0;
591
- }
592
- return t instanceof WeakSet;
593
- } catch {
594
- }
595
- return !1;
596
- }
597
- function Bn(t) {
598
- return !t || typeof t != "object" ? !1 : typeof HTMLElement < "u" && t instanceof HTMLElement ? !0 : typeof t.nodeName == "string" && typeof t.getAttribute == "function";
599
- }
600
- function Gt(t, e) {
601
- if (t.length > e.maxStringLength) {
602
- var r = t.length - e.maxStringLength, n = "... " + r + " more character" + (r > 1 ? "s" : "");
603
- return Gt(et.call(t, 0, e.maxStringLength), e) + n;
604
- }
605
- var o = wn[e.quoteStyle || "single"];
606
- o.lastIndex = 0;
607
- var a = N.call(N.call(t, o, "\\$1"), /[\x00-\x1f]/g, kn);
608
- return Wt(a, "single", e);
609
- }
610
- function kn(t) {
611
- var e = t.charCodeAt(0), r = {
612
- 8: "b",
613
- 9: "t",
614
- 10: "n",
615
- 12: "f",
616
- 13: "r"
617
- }[e];
618
- return r ? "\\" + r : "\\x" + (e < 16 ? "0" : "") + _n.call(e.toString(16));
619
- }
620
- function Z(t) {
621
- return "Object(" + t + ")";
622
- }
623
- function Re(t) {
624
- return t + " { ? }";
625
- }
626
- function St(t, e, r, n) {
627
- var o = n ? Je(r, n) : x.call(r, ", ");
628
- return t + " (" + e + ") {" + o + "}";
629
- }
630
- function Ln(t) {
631
- for (var e = 0; e < t.length; e++)
632
- if (qt(t[e], `
633
- `) >= 0)
634
- return !1;
635
- return !0;
636
- }
637
- function Un(t, e) {
638
- var r;
639
- if (t.indent === " ")
640
- r = " ";
641
- else if (typeof t.indent == "number" && t.indent > 0)
642
- r = x.call(Array(t.indent + 1), " ");
643
- else
644
- return null;
645
- return {
646
- base: r,
647
- prev: x.call(Array(e + 1), r)
648
- };
649
- }
650
- function Je(t, e) {
651
- if (t.length === 0)
652
- return "";
653
- var r = `
654
- ` + e.prev + e.base;
655
- return r + x.call(t, "," + r) + `
656
- ` + e.prev;
657
- }
658
- function se(t, e) {
659
- var r = Qe(t), n = [];
660
- if (r) {
661
- n.length = t.length;
662
- for (var o = 0; o < t.length; o++)
663
- n[o] = $(t, o) ? e(t[o], t) : "";
664
- }
665
- var a = typeof Ie == "function" ? Ie(t) : [], i;
666
- if (V) {
667
- i = {};
668
- for (var c = 0; c < a.length; c++)
669
- i["$" + a[c]] = a[c];
670
- }
671
- for (var l in t)
672
- $(t, l) && (r && String(Number(l)) === l && l < t.length || V && i["$" + l] instanceof Symbol || (kt.call(/[^\w$]/, l) ? n.push(e(l, t) + ": " + e(t[l], t)) : n.push(l + ": " + e(t[l], t))));
673
- if (typeof Ie == "function")
674
- for (var s = 0; s < a.length; s++)
675
- Lt.call(t, a[s]) && n.push("[" + e(a[s]) + "]: " + e(t[a[s]], t));
676
- return n;
677
- }
678
- var Wn = _e, zn = J, Se = function(t, e, r) {
679
- for (var n = t, o; (o = n.next) != null; n = o)
680
- if (o.key === e)
681
- return n.next = o.next, r || (o.next = /** @type {NonNullable<typeof list.next>} */
682
- t.next, t.next = o), o;
683
- }, qn = function(t, e) {
684
- if (t) {
685
- var r = Se(t, e);
686
- return r && r.value;
687
- }
688
- }, Gn = function(t, e, r) {
689
- var n = Se(t, e);
690
- n ? n.value = r : t.next = /** @type {import('./list.d.ts').ListNode<typeof value, typeof key>} */
691
- {
692
- // eslint-disable-line no-param-reassign, no-extra-parens
693
- key: e,
694
- next: t.next,
695
- value: r
696
- };
697
- }, Hn = function(t, e) {
698
- return t ? !!Se(t, e) : !1;
699
- }, jn = function(t, e) {
700
- if (t)
701
- return Se(t, e, !0);
702
- }, Kn = function() {
703
- var e, r = {
704
- assert: function(n) {
705
- if (!r.has(n))
706
- throw new zn("Side channel does not contain " + Wn(n));
707
- },
708
- delete: function(n) {
709
- var o = e && e.next, a = jn(e, n);
710
- return a && o && o === a && (e = void 0), !!a;
711
- },
712
- get: function(n) {
713
- return qn(e, n);
714
- },
715
- has: function(n) {
716
- return Hn(e, n);
717
- },
718
- set: function(n, o) {
719
- e || (e = {
720
- next: void 0
721
- }), Gn(
722
- /** @type {NonNullable<typeof $o>} */
723
- e,
724
- n,
725
- o
726
- );
727
- }
728
- };
729
- return r;
730
- }, Ht = Object, Vn = Error, Qn = EvalError, Jn = RangeError, Yn = ReferenceError, Xn = SyntaxError, Zn = URIError, eo = Math.abs, to = Math.floor, ro = Math.max, no = Math.min, oo = Math.pow, ao = Math.round, io = Number.isNaN || function(e) {
731
- return e !== e;
732
- }, lo = io, co = function(e) {
733
- return lo(e) || e === 0 ? e : e < 0 ? -1 : 1;
734
- }, fo = Object.getOwnPropertyDescriptor, ye = fo;
735
- if (ye)
736
- try {
737
- ye([], "length");
738
- } catch {
739
- ye = null;
740
- }
741
- var jt = ye, de = Object.defineProperty || !1;
742
- if (de)
743
- try {
744
- de({}, "a", { value: 1 });
745
- } catch {
746
- de = !1;
747
- }
748
- var uo = de, De, wt;
749
- function so() {
750
- return wt || (wt = 1, De = function() {
751
- if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
752
- return !1;
753
- if (typeof Symbol.iterator == "symbol")
754
- return !0;
755
- var e = {}, r = Symbol("test"), n = Object(r);
756
- if (typeof r == "string" || Object.prototype.toString.call(r) !== "[object Symbol]" || Object.prototype.toString.call(n) !== "[object Symbol]")
757
- return !1;
758
- var o = 42;
759
- e[r] = o;
760
- for (var a in e)
761
- return !1;
762
- if (typeof Object.keys == "function" && Object.keys(e).length !== 0 || typeof Object.getOwnPropertyNames == "function" && Object.getOwnPropertyNames(e).length !== 0)
763
- return !1;
764
- var i = Object.getOwnPropertySymbols(e);
765
- if (i.length !== 1 || i[0] !== r || !Object.prototype.propertyIsEnumerable.call(e, r))
766
- return !1;
767
- if (typeof Object.getOwnPropertyDescriptor == "function") {
768
- var c = (
769
- /** @type {PropertyDescriptor} */
770
- Object.getOwnPropertyDescriptor(e, r)
771
- );
772
- if (c.value !== o || c.enumerable !== !0)
773
- return !1;
774
- }
775
- return !0;
776
- }), De;
777
- }
778
- var Te, At;
779
- function po() {
780
- if (At) return Te;
781
- At = 1;
782
- var t = typeof Symbol < "u" && Symbol, e = so();
783
- return Te = function() {
784
- return typeof t != "function" || typeof Symbol != "function" || typeof t("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : e();
785
- }, Te;
786
- }
787
- var Fe, Ot;
788
- function Kt() {
789
- return Ot || (Ot = 1, Fe = typeof Reflect < "u" && Reflect.getPrototypeOf || null), Fe;
790
- }
791
- var Ne, xt;
792
- function Vt() {
793
- if (xt) return Ne;
794
- xt = 1;
795
- var t = Ht;
796
- return Ne = t.getPrototypeOf || null, Ne;
797
- }
798
- var yo = "Function.prototype.bind called on incompatible ", mo = Object.prototype.toString, vo = Math.max, go = "[object Function]", Et = function(e, r) {
799
- for (var n = [], o = 0; o < e.length; o += 1)
800
- n[o] = e[o];
801
- for (var a = 0; a < r.length; a += 1)
802
- n[a + e.length] = r[a];
803
- return n;
804
- }, ho = function(e, r) {
805
- for (var n = [], o = r, a = 0; o < e.length; o += 1, a += 1)
806
- n[a] = e[o];
807
- return n;
808
- }, bo = function(t, e) {
809
- for (var r = "", n = 0; n < t.length; n += 1)
810
- r += t[n], n + 1 < t.length && (r += e);
811
- return r;
812
- }, _o = function(e) {
813
- var r = this;
814
- if (typeof r != "function" || mo.apply(r) !== go)
815
- throw new TypeError(yo + r);
816
- for (var n = ho(arguments, 1), o, a = function() {
817
- if (this instanceof o) {
818
- var f = r.apply(
819
- this,
820
- Et(n, arguments)
821
- );
822
- return Object(f) === f ? f : this;
823
- }
824
- return r.apply(
825
- e,
826
- Et(n, arguments)
827
- );
828
- }, i = vo(0, r.length - n.length), c = [], l = 0; l < i; l++)
829
- c[l] = "$" + l;
830
- if (o = Function("binder", "return function (" + bo(c, ",") + "){ return binder.apply(this,arguments); }")(a), r.prototype) {
831
- var s = function() {
832
- };
833
- s.prototype = r.prototype, o.prototype = new s(), s.prototype = null;
834
- }
835
- return o;
836
- }, So = _o, we = Function.prototype.bind || So, tt = Function.prototype.call, Ce, Pt;
837
- function Qt() {
838
- return Pt || (Pt = 1, Ce = Function.prototype.apply), Ce;
839
- }
840
- var wo = typeof Reflect < "u" && Reflect && Reflect.apply, Ao = we, Oo = Qt(), xo = tt, Eo = wo, Po = Eo || Ao.call(xo, Oo), $o = we, Io = J, Ro = tt, Do = Po, Jt = function(e) {
841
- if (e.length < 1 || typeof e[0] != "function")
842
- throw new Io("a function is required");
843
- return Do($o, Ro, e);
844
- }, Me, $t;
845
- function To() {
846
- if ($t) return Me;
847
- $t = 1;
848
- var t = Jt, e = jt, r;
849
- try {
850
- r = /** @type {{ __proto__?: typeof Array.prototype }} */
851
- [].__proto__ === Array.prototype;
852
- } catch (i) {
853
- if (!i || typeof i != "object" || !("code" in i) || i.code !== "ERR_PROTO_ACCESS")
854
- throw i;
855
- }
856
- var n = !!r && e && e(
857
- Object.prototype,
858
- /** @type {keyof typeof Object.prototype} */
859
- "__proto__"
860
- ), o = Object, a = o.getPrototypeOf;
861
- return Me = n && typeof n.get == "function" ? t([n.get]) : typeof a == "function" ? (
862
- /** @type {import('./get')} */
863
- function(c) {
864
- return a(c == null ? c : o(c));
865
- }
866
- ) : !1, Me;
867
- }
868
- var Be, It;
869
- function Fo() {
870
- if (It) return Be;
871
- It = 1;
872
- var t = Kt(), e = Vt(), r = To();
873
- return Be = t ? function(o) {
874
- return t(o);
875
- } : e ? function(o) {
876
- if (!o || typeof o != "object" && typeof o != "function")
877
- throw new TypeError("getProto: not an object");
878
- return e(o);
879
- } : r ? function(o) {
880
- return r(o);
881
- } : null, Be;
882
- }
883
- var ke, Rt;
884
- function No() {
885
- if (Rt) return ke;
886
- Rt = 1;
887
- var t = Function.prototype.call, e = Object.prototype.hasOwnProperty, r = we;
888
- return ke = r.call(t, e), ke;
889
- }
890
- var y, Co = Ht, Mo = Vn, Bo = Qn, ko = Jn, Lo = Yn, Q = Xn, K = J, Uo = Zn, Wo = eo, zo = to, qo = ro, Go = no, Ho = oo, jo = ao, Ko = co, Yt = Function, Le = function(t) {
891
- try {
892
- return Yt('"use strict"; return (' + t + ").constructor;")();
893
- } catch {
894
- }
895
- }, oe = jt, Vo = uo, Ue = function() {
896
- throw new K();
897
- }, Qo = oe ? function() {
898
- try {
899
- return arguments.callee, Ue;
900
- } catch {
901
- try {
902
- return oe(arguments, "callee").get;
903
- } catch {
904
- return Ue;
905
- }
906
- }
907
- }() : Ue, G = po()(), b = Fo(), Jo = Vt(), Yo = Kt(), Xt = Qt(), ae = tt, j = {}, Xo = typeof Uint8Array > "u" || !b ? y : b(Uint8Array), L = {
908
- __proto__: null,
909
- "%AggregateError%": typeof AggregateError > "u" ? y : AggregateError,
910
- "%Array%": Array,
911
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? y : ArrayBuffer,
912
- "%ArrayIteratorPrototype%": G && b ? b([][Symbol.iterator]()) : y,
913
- "%AsyncFromSyncIteratorPrototype%": y,
914
- "%AsyncFunction%": j,
915
- "%AsyncGenerator%": j,
916
- "%AsyncGeneratorFunction%": j,
917
- "%AsyncIteratorPrototype%": j,
918
- "%Atomics%": typeof Atomics > "u" ? y : Atomics,
919
- "%BigInt%": typeof BigInt > "u" ? y : BigInt,
920
- "%BigInt64Array%": typeof BigInt64Array > "u" ? y : BigInt64Array,
921
- "%BigUint64Array%": typeof BigUint64Array > "u" ? y : BigUint64Array,
922
- "%Boolean%": Boolean,
923
- "%DataView%": typeof DataView > "u" ? y : DataView,
924
- "%Date%": Date,
925
- "%decodeURI%": decodeURI,
926
- "%decodeURIComponent%": decodeURIComponent,
927
- "%encodeURI%": encodeURI,
928
- "%encodeURIComponent%": encodeURIComponent,
929
- "%Error%": Mo,
930
- "%eval%": eval,
931
- // eslint-disable-line no-eval
932
- "%EvalError%": Bo,
933
- "%Float16Array%": typeof Float16Array > "u" ? y : Float16Array,
934
- "%Float32Array%": typeof Float32Array > "u" ? y : Float32Array,
935
- "%Float64Array%": typeof Float64Array > "u" ? y : Float64Array,
936
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? y : FinalizationRegistry,
937
- "%Function%": Yt,
938
- "%GeneratorFunction%": j,
939
- "%Int8Array%": typeof Int8Array > "u" ? y : Int8Array,
940
- "%Int16Array%": typeof Int16Array > "u" ? y : Int16Array,
941
- "%Int32Array%": typeof Int32Array > "u" ? y : Int32Array,
942
- "%isFinite%": isFinite,
943
- "%isNaN%": isNaN,
944
- "%IteratorPrototype%": G && b ? b(b([][Symbol.iterator]())) : y,
945
- "%JSON%": typeof JSON == "object" ? JSON : y,
946
- "%Map%": typeof Map > "u" ? y : Map,
947
- "%MapIteratorPrototype%": typeof Map > "u" || !G || !b ? y : b((/* @__PURE__ */ new Map())[Symbol.iterator]()),
948
- "%Math%": Math,
949
- "%Number%": Number,
950
- "%Object%": Co,
951
- "%Object.getOwnPropertyDescriptor%": oe,
952
- "%parseFloat%": parseFloat,
953
- "%parseInt%": parseInt,
954
- "%Promise%": typeof Promise > "u" ? y : Promise,
955
- "%Proxy%": typeof Proxy > "u" ? y : Proxy,
956
- "%RangeError%": ko,
957
- "%ReferenceError%": Lo,
958
- "%Reflect%": typeof Reflect > "u" ? y : Reflect,
959
- "%RegExp%": RegExp,
960
- "%Set%": typeof Set > "u" ? y : Set,
961
- "%SetIteratorPrototype%": typeof Set > "u" || !G || !b ? y : b((/* @__PURE__ */ new Set())[Symbol.iterator]()),
962
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? y : SharedArrayBuffer,
963
- "%String%": String,
964
- "%StringIteratorPrototype%": G && b ? b(""[Symbol.iterator]()) : y,
965
- "%Symbol%": G ? Symbol : y,
966
- "%SyntaxError%": Q,
967
- "%ThrowTypeError%": Qo,
968
- "%TypedArray%": Xo,
969
- "%TypeError%": K,
970
- "%Uint8Array%": typeof Uint8Array > "u" ? y : Uint8Array,
971
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? y : Uint8ClampedArray,
972
- "%Uint16Array%": typeof Uint16Array > "u" ? y : Uint16Array,
973
- "%Uint32Array%": typeof Uint32Array > "u" ? y : Uint32Array,
974
- "%URIError%": Uo,
975
- "%WeakMap%": typeof WeakMap > "u" ? y : WeakMap,
976
- "%WeakRef%": typeof WeakRef > "u" ? y : WeakRef,
977
- "%WeakSet%": typeof WeakSet > "u" ? y : WeakSet,
978
- "%Function.prototype.call%": ae,
979
- "%Function.prototype.apply%": Xt,
980
- "%Object.defineProperty%": Vo,
981
- "%Object.getPrototypeOf%": Jo,
982
- "%Math.abs%": Wo,
983
- "%Math.floor%": zo,
984
- "%Math.max%": qo,
985
- "%Math.min%": Go,
986
- "%Math.pow%": Ho,
987
- "%Math.round%": jo,
988
- "%Math.sign%": Ko,
989
- "%Reflect.getPrototypeOf%": Yo
990
- };
991
- if (b)
992
- try {
993
- null.error;
994
- } catch (t) {
995
- var Zo = b(b(t));
996
- L["%Error.prototype%"] = Zo;
997
- }
998
- var ea = function t(e) {
999
- var r;
1000
- if (e === "%AsyncFunction%")
1001
- r = Le("async function () {}");
1002
- else if (e === "%GeneratorFunction%")
1003
- r = Le("function* () {}");
1004
- else if (e === "%AsyncGeneratorFunction%")
1005
- r = Le("async function* () {}");
1006
- else if (e === "%AsyncGenerator%") {
1007
- var n = t("%AsyncGeneratorFunction%");
1008
- n && (r = n.prototype);
1009
- } else if (e === "%AsyncIteratorPrototype%") {
1010
- var o = t("%AsyncGenerator%");
1011
- o && b && (r = b(o.prototype));
1012
- }
1013
- return L[e] = r, r;
1014
- }, Dt = {
1015
- __proto__: null,
1016
- "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
1017
- "%ArrayPrototype%": ["Array", "prototype"],
1018
- "%ArrayProto_entries%": ["Array", "prototype", "entries"],
1019
- "%ArrayProto_forEach%": ["Array", "prototype", "forEach"],
1020
- "%ArrayProto_keys%": ["Array", "prototype", "keys"],
1021
- "%ArrayProto_values%": ["Array", "prototype", "values"],
1022
- "%AsyncFunctionPrototype%": ["AsyncFunction", "prototype"],
1023
- "%AsyncGenerator%": ["AsyncGeneratorFunction", "prototype"],
1024
- "%AsyncGeneratorPrototype%": ["AsyncGeneratorFunction", "prototype", "prototype"],
1025
- "%BooleanPrototype%": ["Boolean", "prototype"],
1026
- "%DataViewPrototype%": ["DataView", "prototype"],
1027
- "%DatePrototype%": ["Date", "prototype"],
1028
- "%ErrorPrototype%": ["Error", "prototype"],
1029
- "%EvalErrorPrototype%": ["EvalError", "prototype"],
1030
- "%Float32ArrayPrototype%": ["Float32Array", "prototype"],
1031
- "%Float64ArrayPrototype%": ["Float64Array", "prototype"],
1032
- "%FunctionPrototype%": ["Function", "prototype"],
1033
- "%Generator%": ["GeneratorFunction", "prototype"],
1034
- "%GeneratorPrototype%": ["GeneratorFunction", "prototype", "prototype"],
1035
- "%Int8ArrayPrototype%": ["Int8Array", "prototype"],
1036
- "%Int16ArrayPrototype%": ["Int16Array", "prototype"],
1037
- "%Int32ArrayPrototype%": ["Int32Array", "prototype"],
1038
- "%JSONParse%": ["JSON", "parse"],
1039
- "%JSONStringify%": ["JSON", "stringify"],
1040
- "%MapPrototype%": ["Map", "prototype"],
1041
- "%NumberPrototype%": ["Number", "prototype"],
1042
- "%ObjectPrototype%": ["Object", "prototype"],
1043
- "%ObjProto_toString%": ["Object", "prototype", "toString"],
1044
- "%ObjProto_valueOf%": ["Object", "prototype", "valueOf"],
1045
- "%PromisePrototype%": ["Promise", "prototype"],
1046
- "%PromiseProto_then%": ["Promise", "prototype", "then"],
1047
- "%Promise_all%": ["Promise", "all"],
1048
- "%Promise_reject%": ["Promise", "reject"],
1049
- "%Promise_resolve%": ["Promise", "resolve"],
1050
- "%RangeErrorPrototype%": ["RangeError", "prototype"],
1051
- "%ReferenceErrorPrototype%": ["ReferenceError", "prototype"],
1052
- "%RegExpPrototype%": ["RegExp", "prototype"],
1053
- "%SetPrototype%": ["Set", "prototype"],
1054
- "%SharedArrayBufferPrototype%": ["SharedArrayBuffer", "prototype"],
1055
- "%StringPrototype%": ["String", "prototype"],
1056
- "%SymbolPrototype%": ["Symbol", "prototype"],
1057
- "%SyntaxErrorPrototype%": ["SyntaxError", "prototype"],
1058
- "%TypedArrayPrototype%": ["TypedArray", "prototype"],
1059
- "%TypeErrorPrototype%": ["TypeError", "prototype"],
1060
- "%Uint8ArrayPrototype%": ["Uint8Array", "prototype"],
1061
- "%Uint8ClampedArrayPrototype%": ["Uint8ClampedArray", "prototype"],
1062
- "%Uint16ArrayPrototype%": ["Uint16Array", "prototype"],
1063
- "%Uint32ArrayPrototype%": ["Uint32Array", "prototype"],
1064
- "%URIErrorPrototype%": ["URIError", "prototype"],
1065
- "%WeakMapPrototype%": ["WeakMap", "prototype"],
1066
- "%WeakSetPrototype%": ["WeakSet", "prototype"]
1067
- }, ie = we, he = No(), ta = ie.call(ae, Array.prototype.concat), ra = ie.call(Xt, Array.prototype.splice), Tt = ie.call(ae, String.prototype.replace), be = ie.call(ae, String.prototype.slice), na = ie.call(ae, RegExp.prototype.exec), oa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, aa = /\\(\\)?/g, ia = function(e) {
1068
- var r = be(e, 0, 1), n = be(e, -1);
1069
- if (r === "%" && n !== "%")
1070
- throw new Q("invalid intrinsic syntax, expected closing `%`");
1071
- if (n === "%" && r !== "%")
1072
- throw new Q("invalid intrinsic syntax, expected opening `%`");
1073
- var o = [];
1074
- return Tt(e, oa, function(a, i, c, l) {
1075
- o[o.length] = c ? Tt(l, aa, "$1") : i || a;
1076
- }), o;
1077
- }, la = function(e, r) {
1078
- var n = e, o;
1079
- if (he(Dt, n) && (o = Dt[n], n = "%" + o[0] + "%"), he(L, n)) {
1080
- var a = L[n];
1081
- if (a === j && (a = ea(n)), typeof a > "u" && !r)
1082
- throw new K("intrinsic " + e + " exists, but is not available. Please file an issue!");
1083
- return {
1084
- alias: o,
1085
- name: n,
1086
- value: a
1087
- };
1088
- }
1089
- throw new Q("intrinsic " + e + " does not exist!");
1090
- }, rt = function(e, r) {
1091
- if (typeof e != "string" || e.length === 0)
1092
- throw new K("intrinsic name must be a non-empty string");
1093
- if (arguments.length > 1 && typeof r != "boolean")
1094
- throw new K('"allowMissing" argument must be a boolean');
1095
- if (na(/^%?[^%]*%?$/, e) === null)
1096
- throw new Q("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
1097
- var n = ia(e), o = n.length > 0 ? n[0] : "", a = la("%" + o + "%", r), i = a.name, c = a.value, l = !1, s = a.alias;
1098
- s && (o = s[0], ra(n, ta([0, 1], s)));
1099
- for (var f = 1, p = !0; f < n.length; f += 1) {
1100
- var u = n[f], m = be(u, 0, 1), d = be(u, -1);
1101
- if ((m === '"' || m === "'" || m === "`" || d === '"' || d === "'" || d === "`") && m !== d)
1102
- throw new Q("property names with quotes must have matching quotes");
1103
- if ((u === "constructor" || !p) && (l = !0), o += "." + u, i = "%" + o + "%", he(L, i))
1104
- c = L[i];
1105
- else if (c != null) {
1106
- if (!(u in c)) {
1107
- if (!r)
1108
- throw new K("base intrinsic for " + e + " exists, but the property is not available.");
1109
- return;
1110
- }
1111
- if (oe && f + 1 >= n.length) {
1112
- var _ = oe(c, u);
1113
- p = !!_, p && "get" in _ && !("originalValue" in _.get) ? c = _.get : c = c[u];
1114
- } else
1115
- p = he(c, u), c = c[u];
1116
- p && !l && (L[i] = c);
1117
- }
1118
- }
1119
- return c;
1120
- }, Zt = rt, er = Jt, ca = er([Zt("%String.prototype.indexOf%")]), tr = function(e, r) {
1121
- var n = (
1122
- /** @type {(this: unknown, ...args: unknown[]) => unknown} */
1123
- Zt(e, !!r)
1124
- );
1125
- return typeof n == "function" && ca(e, ".prototype.") > -1 ? er(
1126
- /** @type {const} */
1127
- [n]
1128
- ) : n;
1129
- }, fa = rt, le = tr, ua = _e, sa = J, Ft = fa("%Map%", !0), pa = le("Map.prototype.get", !0), ya = le("Map.prototype.set", !0), da = le("Map.prototype.has", !0), ma = le("Map.prototype.delete", !0), va = le("Map.prototype.size", !0), rr = !!Ft && /** @type {Exclude<import('.'), false>} */
1130
- function() {
1131
- var e, r = {
1132
- assert: function(n) {
1133
- if (!r.has(n))
1134
- throw new sa("Side channel does not contain " + ua(n));
1135
- },
1136
- delete: function(n) {
1137
- if (e) {
1138
- var o = ma(e, n);
1139
- return va(e) === 0 && (e = void 0), o;
1140
- }
1141
- return !1;
1142
- },
1143
- get: function(n) {
1144
- if (e)
1145
- return pa(e, n);
1146
- },
1147
- has: function(n) {
1148
- return e ? da(e, n) : !1;
1149
- },
1150
- set: function(n, o) {
1151
- e || (e = new Ft()), ya(e, n, o);
1152
- }
1153
- };
1154
- return r;
1155
- }, ga = rt, Ae = tr, ha = _e, pe = rr, ba = J, H = ga("%WeakMap%", !0), _a = Ae("WeakMap.prototype.get", !0), Sa = Ae("WeakMap.prototype.set", !0), wa = Ae("WeakMap.prototype.has", !0), Aa = Ae("WeakMap.prototype.delete", !0), Oa = H ? (
1156
- /** @type {Exclude<import('.'), false>} */
1157
- function() {
1158
- var e, r, n = {
1159
- assert: function(o) {
1160
- if (!n.has(o))
1161
- throw new ba("Side channel does not contain " + ha(o));
1162
- },
1163
- delete: function(o) {
1164
- if (H && o && (typeof o == "object" || typeof o == "function")) {
1165
- if (e)
1166
- return Aa(e, o);
1167
- } else if (pe && r)
1168
- return r.delete(o);
1169
- return !1;
1170
- },
1171
- get: function(o) {
1172
- return H && o && (typeof o == "object" || typeof o == "function") && e ? _a(e, o) : r && r.get(o);
1173
- },
1174
- has: function(o) {
1175
- return H && o && (typeof o == "object" || typeof o == "function") && e ? wa(e, o) : !!r && r.has(o);
1176
- },
1177
- set: function(o, a) {
1178
- H && o && (typeof o == "object" || typeof o == "function") ? (e || (e = new H()), Sa(e, o, a)) : pe && (r || (r = pe()), r.set(o, a));
1179
- }
1180
- };
1181
- return n;
1182
- }
1183
- ) : pe, xa = J, Ea = _e, Pa = Kn, $a = rr, Ia = Oa, Ra = Ia || $a || Pa, Da = function() {
1184
- var e, r = {
1185
- assert: function(n) {
1186
- if (!r.has(n))
1187
- throw new xa("Side channel does not contain " + Ea(n));
1188
- },
1189
- delete: function(n) {
1190
- return !!e && e.delete(n);
1191
- },
1192
- get: function(n) {
1193
- return e && e.get(n);
1194
- },
1195
- has: function(n) {
1196
- return !!e && e.has(n);
1197
- },
1198
- set: function(n, o) {
1199
- e || (e = Ra()), e.set(n, o);
1200
- }
1201
- };
1202
- return r;
1203
- }, Ta = String.prototype.replace, Fa = /%20/g, We = {
1204
- RFC1738: "RFC1738",
1205
- RFC3986: "RFC3986"
1206
- }, nt = {
1207
- default: We.RFC3986,
1208
- formatters: {
1209
- RFC1738: function(t) {
1210
- return Ta.call(t, Fa, "+");
1211
- },
1212
- RFC3986: function(t) {
1213
- return String(t);
1214
- }
1215
- },
1216
- RFC1738: We.RFC1738,
1217
- RFC3986: We.RFC3986
1218
- }, Na = nt, ze = Object.prototype.hasOwnProperty, k = Array.isArray, A = function() {
1219
- for (var t = [], e = 0; e < 256; ++e)
1220
- t.push("%" + ((e < 16 ? "0" : "") + e.toString(16)).toUpperCase());
1221
- return t;
1222
- }(), Ca = function(e) {
1223
- for (; e.length > 1; ) {
1224
- var r = e.pop(), n = r.obj[r.prop];
1225
- if (k(n)) {
1226
- for (var o = [], a = 0; a < n.length; ++a)
1227
- typeof n[a] < "u" && o.push(n[a]);
1228
- r.obj[r.prop] = o;
1229
- }
1230
- }
1231
- }, nr = function(e, r) {
1232
- for (var n = r && r.plainObjects ? { __proto__: null } : {}, o = 0; o < e.length; ++o)
1233
- typeof e[o] < "u" && (n[o] = e[o]);
1234
- return n;
1235
- }, Ma = function t(e, r, n) {
1236
- if (!r)
1237
- return e;
1238
- if (typeof r != "object" && typeof r != "function") {
1239
- if (k(e))
1240
- e.push(r);
1241
- else if (e && typeof e == "object")
1242
- (n && (n.plainObjects || n.allowPrototypes) || !ze.call(Object.prototype, r)) && (e[r] = !0);
1243
- else
1244
- return [e, r];
1245
- return e;
1246
- }
1247
- if (!e || typeof e != "object")
1248
- return [e].concat(r);
1249
- var o = e;
1250
- return k(e) && !k(r) && (o = nr(e, n)), k(e) && k(r) ? (r.forEach(function(a, i) {
1251
- if (ze.call(e, i)) {
1252
- var c = e[i];
1253
- c && typeof c == "object" && a && typeof a == "object" ? e[i] = t(c, a, n) : e.push(a);
1254
- } else
1255
- e[i] = a;
1256
- }), e) : Object.keys(r).reduce(function(a, i) {
1257
- var c = r[i];
1258
- return ze.call(a, i) ? a[i] = t(a[i], c, n) : a[i] = c, a;
1259
- }, o);
1260
- }, Ba = function(e, r) {
1261
- return Object.keys(r).reduce(function(n, o) {
1262
- return n[o] = r[o], n;
1263
- }, e);
1264
- }, ka = function(t, e, r) {
1265
- var n = t.replace(/\+/g, " ");
1266
- if (r === "iso-8859-1")
1267
- return n.replace(/%[0-9a-f]{2}/gi, unescape);
1268
- try {
1269
- return decodeURIComponent(n);
1270
- } catch {
1271
- return n;
1272
- }
1273
- }, qe = 1024, La = function(e, r, n, o, a) {
1274
- if (e.length === 0)
1275
- return e;
1276
- var i = e;
1277
- if (typeof e == "symbol" ? i = Symbol.prototype.toString.call(e) : typeof e != "string" && (i = String(e)), n === "iso-8859-1")
1278
- return escape(i).replace(/%u[0-9a-f]{4}/gi, function(m) {
1279
- return "%26%23" + parseInt(m.slice(2), 16) + "%3B";
1280
- });
1281
- for (var c = "", l = 0; l < i.length; l += qe) {
1282
- for (var s = i.length >= qe ? i.slice(l, l + qe) : i, f = [], p = 0; p < s.length; ++p) {
1283
- var u = s.charCodeAt(p);
1284
- if (u === 45 || u === 46 || u === 95 || u === 126 || u >= 48 && u <= 57 || u >= 65 && u <= 90 || u >= 97 && u <= 122 || a === Na.RFC1738 && (u === 40 || u === 41)) {
1285
- f[f.length] = s.charAt(p);
1286
- continue;
1287
- }
1288
- if (u < 128) {
1289
- f[f.length] = A[u];
1290
- continue;
1291
- }
1292
- if (u < 2048) {
1293
- f[f.length] = A[192 | u >> 6] + A[128 | u & 63];
1294
- continue;
1295
- }
1296
- if (u < 55296 || u >= 57344) {
1297
- f[f.length] = A[224 | u >> 12] + A[128 | u >> 6 & 63] + A[128 | u & 63];
1298
- continue;
1299
- }
1300
- p += 1, u = 65536 + ((u & 1023) << 10 | s.charCodeAt(p) & 1023), f[f.length] = A[240 | u >> 18] + A[128 | u >> 12 & 63] + A[128 | u >> 6 & 63] + A[128 | u & 63];
1301
- }
1302
- c += f.join("");
1303
- }
1304
- return c;
1305
- }, Ua = function(e) {
1306
- for (var r = [{ obj: { o: e }, prop: "o" }], n = [], o = 0; o < r.length; ++o)
1307
- for (var a = r[o], i = a.obj[a.prop], c = Object.keys(i), l = 0; l < c.length; ++l) {
1308
- var s = c[l], f = i[s];
1309
- typeof f == "object" && f !== null && n.indexOf(f) === -1 && (r.push({ obj: i, prop: s }), n.push(f));
1310
- }
1311
- return Ca(r), e;
1312
- }, Wa = function(e) {
1313
- return Object.prototype.toString.call(e) === "[object RegExp]";
1314
- }, za = function(e) {
1315
- return !e || typeof e != "object" ? !1 : !!(e.constructor && e.constructor.isBuffer && e.constructor.isBuffer(e));
1316
- }, qa = function(e, r) {
1317
- return [].concat(e, r);
1318
- }, Ga = function(e, r) {
1319
- if (k(e)) {
1320
- for (var n = [], o = 0; o < e.length; o += 1)
1321
- n.push(r(e[o]));
1322
- return n;
1323
- }
1324
- return r(e);
1325
- }, or = {
1326
- arrayToObject: nr,
1327
- assign: Ba,
1328
- combine: qa,
1329
- compact: Ua,
1330
- decode: ka,
1331
- encode: La,
1332
- isBuffer: za,
1333
- isRegExp: Wa,
1334
- maybeMap: Ga,
1335
- merge: Ma
1336
- }, ar = Da, me = or, ne = nt, Ha = Object.prototype.hasOwnProperty, ir = {
1337
- brackets: function(e) {
1338
- return e + "[]";
1339
- },
1340
- comma: "comma",
1341
- indices: function(e, r) {
1342
- return e + "[" + r + "]";
1343
- },
1344
- repeat: function(e) {
1345
- return e;
1346
- }
1347
- }, O = Array.isArray, ja = Array.prototype.push, lr = function(t, e) {
1348
- ja.apply(t, O(e) ? e : [e]);
1349
- }, Ka = Date.prototype.toISOString, Nt = ne.default, h = {
1350
- addQueryPrefix: !1,
1351
- allowDots: !1,
1352
- allowEmptyArrays: !1,
1353
- arrayFormat: "indices",
1354
- charset: "utf-8",
1355
- charsetSentinel: !1,
1356
- commaRoundTrip: !1,
1357
- delimiter: "&",
1358
- encode: !0,
1359
- encodeDotInKeys: !1,
1360
- encoder: me.encode,
1361
- encodeValuesOnly: !1,
1362
- filter: void 0,
1363
- format: Nt,
1364
- formatter: ne.formatters[Nt],
1365
- // deprecated
1366
- indices: !1,
1367
- serializeDate: function(e) {
1368
- return Ka.call(e);
1369
- },
1370
- skipNulls: !1,
1371
- strictNullHandling: !1
1372
- }, Va = function(e) {
1373
- return typeof e == "string" || typeof e == "number" || typeof e == "boolean" || typeof e == "symbol" || typeof e == "bigint";
1374
- }, Ge = {}, Qa = function t(e, r, n, o, a, i, c, l, s, f, p, u, m, d, _, S, I, R) {
1375
- for (var v = e, D = R, M = 0, Y = !1; (D = D.get(Ge)) !== void 0 && !Y; ) {
1376
- var z = D.get(e);
1377
- if (M += 1, typeof z < "u") {
1378
- if (z === M)
1379
- throw new RangeError("Cyclic object value");
1380
- Y = !0;
1381
- }
1382
- typeof D.get(Ge) > "u" && (M = 0);
1383
- }
1384
- if (typeof f == "function" ? v = f(r, v) : v instanceof Date ? v = m(v) : n === "comma" && O(v) && (v = me.maybeMap(v, function(Ee) {
1385
- return Ee instanceof Date ? m(Ee) : Ee;
1386
- })), v === null) {
1387
- if (i)
1388
- return s && !S ? s(r, h.encoder, I, "key", d) : r;
1389
- v = "";
1390
- }
1391
- if (Va(v) || me.isBuffer(v)) {
1392
- if (s) {
1393
- var ce = S ? r : s(r, h.encoder, I, "key", d);
1394
- return [_(ce) + "=" + _(s(v, h.encoder, I, "value", d))];
1395
- }
1396
- return [_(r) + "=" + _(String(v))];
1397
- }
1398
- var B = [];
1399
- if (typeof v > "u")
1400
- return B;
1401
- var T;
1402
- if (n === "comma" && O(v))
1403
- S && s && (v = me.maybeMap(v, s)), T = [{ value: v.length > 0 ? v.join(",") || null : void 0 }];
1404
- else if (O(f))
1405
- T = f;
1406
- else {
1407
- var fe = Object.keys(v);
1408
- T = p ? fe.sort(p) : fe;
1409
- }
1410
- var q = l ? String(r).replace(/\./g, "%2E") : String(r), w = o && O(v) && v.length === 1 ? q + "[]" : q;
1411
- if (a && O(v) && v.length === 0)
1412
- return w + "[]";
1413
- for (var F = 0; F < T.length; ++F) {
1414
- var E = T[F], X = typeof E == "object" && E && typeof E.value < "u" ? E.value : v[E];
1415
- if (!(c && X === null)) {
1416
- var xe = u && l ? String(E).replace(/\./g, "%2E") : String(E), yr = O(v) ? typeof n == "function" ? n(w, xe) : w : w + (u ? "." + xe : "[" + xe + "]");
1417
- R.set(e, M);
1418
- var at = ar();
1419
- at.set(Ge, R), lr(B, t(
1420
- X,
1421
- yr,
1422
- n,
1423
- o,
1424
- a,
1425
- i,
1426
- c,
1427
- l,
1428
- n === "comma" && S && O(v) ? null : s,
1429
- f,
1430
- p,
1431
- u,
1432
- m,
1433
- d,
1434
- _,
1435
- S,
1436
- I,
1437
- at
1438
- ));
1439
- }
1440
- }
1441
- return B;
1442
- }, Ja = function(e) {
1443
- if (!e)
1444
- return h;
1445
- if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
1446
- throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1447
- if (typeof e.encodeDotInKeys < "u" && typeof e.encodeDotInKeys != "boolean")
1448
- throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");
1449
- if (e.encoder !== null && typeof e.encoder < "u" && typeof e.encoder != "function")
1450
- throw new TypeError("Encoder has to be a function.");
1451
- var r = e.charset || h.charset;
1452
- if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
1453
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1454
- var n = ne.default;
1455
- if (typeof e.format < "u") {
1456
- if (!Ha.call(ne.formatters, e.format))
1457
- throw new TypeError("Unknown format option provided.");
1458
- n = e.format;
1459
- }
1460
- var o = ne.formatters[n], a = h.filter;
1461
- (typeof e.filter == "function" || O(e.filter)) && (a = e.filter);
1462
- var i;
1463
- if (e.arrayFormat in ir ? i = e.arrayFormat : "indices" in e ? i = e.indices ? "indices" : "repeat" : i = h.arrayFormat, "commaRoundTrip" in e && typeof e.commaRoundTrip != "boolean")
1464
- throw new TypeError("`commaRoundTrip` must be a boolean, or absent");
1465
- var c = typeof e.allowDots > "u" ? e.encodeDotInKeys === !0 ? !0 : h.allowDots : !!e.allowDots;
1466
- return {
1467
- addQueryPrefix: typeof e.addQueryPrefix == "boolean" ? e.addQueryPrefix : h.addQueryPrefix,
1468
- allowDots: c,
1469
- allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : h.allowEmptyArrays,
1470
- arrayFormat: i,
1471
- charset: r,
1472
- charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : h.charsetSentinel,
1473
- commaRoundTrip: !!e.commaRoundTrip,
1474
- delimiter: typeof e.delimiter > "u" ? h.delimiter : e.delimiter,
1475
- encode: typeof e.encode == "boolean" ? e.encode : h.encode,
1476
- encodeDotInKeys: typeof e.encodeDotInKeys == "boolean" ? e.encodeDotInKeys : h.encodeDotInKeys,
1477
- encoder: typeof e.encoder == "function" ? e.encoder : h.encoder,
1478
- encodeValuesOnly: typeof e.encodeValuesOnly == "boolean" ? e.encodeValuesOnly : h.encodeValuesOnly,
1479
- filter: a,
1480
- format: n,
1481
- formatter: o,
1482
- serializeDate: typeof e.serializeDate == "function" ? e.serializeDate : h.serializeDate,
1483
- skipNulls: typeof e.skipNulls == "boolean" ? e.skipNulls : h.skipNulls,
1484
- sort: typeof e.sort == "function" ? e.sort : null,
1485
- strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : h.strictNullHandling
1486
- };
1487
- }, Ya = function(t, e) {
1488
- var r = t, n = Ja(e), o, a;
1489
- typeof n.filter == "function" ? (a = n.filter, r = a("", r)) : O(n.filter) && (a = n.filter, o = a);
1490
- var i = [];
1491
- if (typeof r != "object" || r === null)
1492
- return "";
1493
- var c = ir[n.arrayFormat], l = c === "comma" && n.commaRoundTrip;
1494
- o || (o = Object.keys(r)), n.sort && o.sort(n.sort);
1495
- for (var s = ar(), f = 0; f < o.length; ++f) {
1496
- var p = o[f], u = r[p];
1497
- n.skipNulls && u === null || lr(i, Qa(
1498
- u,
1499
- p,
1500
- c,
1501
- l,
1502
- n.allowEmptyArrays,
1503
- n.strictNullHandling,
1504
- n.skipNulls,
1505
- n.encodeDotInKeys,
1506
- n.encode ? n.encoder : null,
1507
- n.filter,
1508
- n.sort,
1509
- n.allowDots,
1510
- n.serializeDate,
1511
- n.format,
1512
- n.formatter,
1513
- n.encodeValuesOnly,
1514
- n.charset,
1515
- s
1516
- ));
1517
- }
1518
- var m = i.join(n.delimiter), d = n.addQueryPrefix === !0 ? "?" : "";
1519
- return n.charsetSentinel && (n.charset === "iso-8859-1" ? d += "utf8=%26%2310003%3B&" : d += "utf8=%E2%9C%93&"), m.length > 0 ? d + m : "";
1520
- }, U = or, Ye = Object.prototype.hasOwnProperty, Ct = Array.isArray, g = {
1521
- allowDots: !1,
1522
- allowEmptyArrays: !1,
1523
- allowPrototypes: !1,
1524
- allowSparse: !1,
1525
- arrayLimit: 20,
1526
- charset: "utf-8",
1527
- charsetSentinel: !1,
1528
- comma: !1,
1529
- decodeDotInKeys: !1,
1530
- decoder: U.decode,
1531
- delimiter: "&",
1532
- depth: 5,
1533
- duplicates: "combine",
1534
- ignoreQueryPrefix: !1,
1535
- interpretNumericEntities: !1,
1536
- parameterLimit: 1e3,
1537
- parseArrays: !0,
1538
- plainObjects: !1,
1539
- strictDepth: !1,
1540
- strictNullHandling: !1,
1541
- throwOnLimitExceeded: !1
1542
- }, Xa = function(t) {
1543
- return t.replace(/&#(\d+);/g, function(e, r) {
1544
- return String.fromCharCode(parseInt(r, 10));
1545
- });
1546
- }, cr = function(t, e, r) {
1547
- if (t && typeof t == "string" && e.comma && t.indexOf(",") > -1)
1548
- return t.split(",");
1549
- if (e.throwOnLimitExceeded && r >= e.arrayLimit)
1550
- throw new RangeError("Array limit exceeded. Only " + e.arrayLimit + " element" + (e.arrayLimit === 1 ? "" : "s") + " allowed in an array.");
1551
- return t;
1552
- }, Za = "utf8=%26%2310003%3B", ei = "utf8=%E2%9C%93", ti = function(e, r) {
1553
- var n = { __proto__: null }, o = r.ignoreQueryPrefix ? e.replace(/^\?/, "") : e;
1554
- o = o.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
1555
- var a = r.parameterLimit === 1 / 0 ? void 0 : r.parameterLimit, i = o.split(
1556
- r.delimiter,
1557
- r.throwOnLimitExceeded ? a + 1 : a
1558
- );
1559
- if (r.throwOnLimitExceeded && i.length > a)
1560
- throw new RangeError("Parameter limit exceeded. Only " + a + " parameter" + (a === 1 ? "" : "s") + " allowed.");
1561
- var c = -1, l, s = r.charset;
1562
- if (r.charsetSentinel)
1563
- for (l = 0; l < i.length; ++l)
1564
- i[l].indexOf("utf8=") === 0 && (i[l] === ei ? s = "utf-8" : i[l] === Za && (s = "iso-8859-1"), c = l, l = i.length);
1565
- for (l = 0; l < i.length; ++l)
1566
- if (l !== c) {
1567
- var f = i[l], p = f.indexOf("]="), u = p === -1 ? f.indexOf("=") : p + 1, m, d;
1568
- u === -1 ? (m = r.decoder(f, g.decoder, s, "key"), d = r.strictNullHandling ? null : "") : (m = r.decoder(f.slice(0, u), g.decoder, s, "key"), d = U.maybeMap(
1569
- cr(
1570
- f.slice(u + 1),
1571
- r,
1572
- Ct(n[m]) ? n[m].length : 0
1573
- ),
1574
- function(S) {
1575
- return r.decoder(S, g.decoder, s, "value");
1576
- }
1577
- )), d && r.interpretNumericEntities && s === "iso-8859-1" && (d = Xa(String(d))), f.indexOf("[]=") > -1 && (d = Ct(d) ? [d] : d);
1578
- var _ = Ye.call(n, m);
1579
- _ && r.duplicates === "combine" ? n[m] = U.combine(n[m], d) : (!_ || r.duplicates === "last") && (n[m] = d);
1580
- }
1581
- return n;
1582
- }, ri = function(t, e, r, n) {
1583
- var o = 0;
1584
- if (t.length > 0 && t[t.length - 1] === "[]") {
1585
- var a = t.slice(0, -1).join("");
1586
- o = Array.isArray(e) && e[a] ? e[a].length : 0;
1587
- }
1588
- for (var i = n ? e : cr(e, r, o), c = t.length - 1; c >= 0; --c) {
1589
- var l, s = t[c];
1590
- if (s === "[]" && r.parseArrays)
1591
- l = r.allowEmptyArrays && (i === "" || r.strictNullHandling && i === null) ? [] : U.combine([], i);
1592
- else {
1593
- l = r.plainObjects ? { __proto__: null } : {};
1594
- var f = s.charAt(0) === "[" && s.charAt(s.length - 1) === "]" ? s.slice(1, -1) : s, p = r.decodeDotInKeys ? f.replace(/%2E/g, ".") : f, u = parseInt(p, 10);
1595
- !r.parseArrays && p === "" ? l = { 0: i } : !isNaN(u) && s !== p && String(u) === p && u >= 0 && r.parseArrays && u <= r.arrayLimit ? (l = [], l[u] = i) : p !== "__proto__" && (l[p] = i);
1596
- }
1597
- i = l;
1598
- }
1599
- return i;
1600
- }, ni = function(e, r, n, o) {
1601
- if (e) {
1602
- var a = n.allowDots ? e.replace(/\.([^.[]+)/g, "[$1]") : e, i = /(\[[^[\]]*])/, c = /(\[[^[\]]*])/g, l = n.depth > 0 && i.exec(a), s = l ? a.slice(0, l.index) : a, f = [];
1603
- if (s) {
1604
- if (!n.plainObjects && Ye.call(Object.prototype, s) && !n.allowPrototypes)
1605
- return;
1606
- f.push(s);
1607
- }
1608
- for (var p = 0; n.depth > 0 && (l = c.exec(a)) !== null && p < n.depth; ) {
1609
- if (p += 1, !n.plainObjects && Ye.call(Object.prototype, l[1].slice(1, -1)) && !n.allowPrototypes)
1610
- return;
1611
- f.push(l[1]);
1612
- }
1613
- if (l) {
1614
- if (n.strictDepth === !0)
1615
- throw new RangeError("Input depth exceeded depth option of " + n.depth + " and strictDepth is true");
1616
- f.push("[" + a.slice(l.index) + "]");
1617
- }
1618
- return ri(f, r, n, o);
1619
- }
1620
- }, oi = function(e) {
1621
- if (!e)
1622
- return g;
1623
- if (typeof e.allowEmptyArrays < "u" && typeof e.allowEmptyArrays != "boolean")
1624
- throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
1625
- if (typeof e.decodeDotInKeys < "u" && typeof e.decodeDotInKeys != "boolean")
1626
- throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");
1627
- if (e.decoder !== null && typeof e.decoder < "u" && typeof e.decoder != "function")
1628
- throw new TypeError("Decoder has to be a function.");
1629
- if (typeof e.charset < "u" && e.charset !== "utf-8" && e.charset !== "iso-8859-1")
1630
- throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");
1631
- if (typeof e.throwOnLimitExceeded < "u" && typeof e.throwOnLimitExceeded != "boolean")
1632
- throw new TypeError("`throwOnLimitExceeded` option must be a boolean");
1633
- var r = typeof e.charset > "u" ? g.charset : e.charset, n = typeof e.duplicates > "u" ? g.duplicates : e.duplicates;
1634
- if (n !== "combine" && n !== "first" && n !== "last")
1635
- throw new TypeError("The duplicates option must be either combine, first, or last");
1636
- var o = typeof e.allowDots > "u" ? e.decodeDotInKeys === !0 ? !0 : g.allowDots : !!e.allowDots;
1637
- return {
1638
- allowDots: o,
1639
- allowEmptyArrays: typeof e.allowEmptyArrays == "boolean" ? !!e.allowEmptyArrays : g.allowEmptyArrays,
1640
- allowPrototypes: typeof e.allowPrototypes == "boolean" ? e.allowPrototypes : g.allowPrototypes,
1641
- allowSparse: typeof e.allowSparse == "boolean" ? e.allowSparse : g.allowSparse,
1642
- arrayLimit: typeof e.arrayLimit == "number" ? e.arrayLimit : g.arrayLimit,
1643
- charset: r,
1644
- charsetSentinel: typeof e.charsetSentinel == "boolean" ? e.charsetSentinel : g.charsetSentinel,
1645
- comma: typeof e.comma == "boolean" ? e.comma : g.comma,
1646
- decodeDotInKeys: typeof e.decodeDotInKeys == "boolean" ? e.decodeDotInKeys : g.decodeDotInKeys,
1647
- decoder: typeof e.decoder == "function" ? e.decoder : g.decoder,
1648
- delimiter: typeof e.delimiter == "string" || U.isRegExp(e.delimiter) ? e.delimiter : g.delimiter,
1649
- // eslint-disable-next-line no-implicit-coercion, no-extra-parens
1650
- depth: typeof e.depth == "number" || e.depth === !1 ? +e.depth : g.depth,
1651
- duplicates: n,
1652
- ignoreQueryPrefix: e.ignoreQueryPrefix === !0,
1653
- interpretNumericEntities: typeof e.interpretNumericEntities == "boolean" ? e.interpretNumericEntities : g.interpretNumericEntities,
1654
- parameterLimit: typeof e.parameterLimit == "number" ? e.parameterLimit : g.parameterLimit,
1655
- parseArrays: e.parseArrays !== !1,
1656
- plainObjects: typeof e.plainObjects == "boolean" ? e.plainObjects : g.plainObjects,
1657
- strictDepth: typeof e.strictDepth == "boolean" ? !!e.strictDepth : g.strictDepth,
1658
- strictNullHandling: typeof e.strictNullHandling == "boolean" ? e.strictNullHandling : g.strictNullHandling,
1659
- throwOnLimitExceeded: typeof e.throwOnLimitExceeded == "boolean" ? e.throwOnLimitExceeded : !1
1660
- };
1661
- }, ai = function(t, e) {
1662
- var r = oi(e);
1663
- if (t === "" || t === null || typeof t > "u")
1664
- return r.plainObjects ? { __proto__: null } : {};
1665
- for (var n = typeof t == "string" ? ti(t, r) : t, o = r.plainObjects ? { __proto__: null } : {}, a = Object.keys(n), i = 0; i < a.length; ++i) {
1666
- var c = a[i], l = ni(c, n[c], r, typeof t == "string");
1667
- o = U.merge(o, l, r);
1668
- }
1669
- return r.allowSparse === !0 ? o : U.compact(o);
1670
- }, ii = Ya, li = ai, ci = nt, fi = {
1671
- formats: ci,
1672
- parse: li,
1673
- stringify: ii
1674
- };
1675
- const ui = /* @__PURE__ */ kr(fi);
1676
- async function Oe(t, e = {}, r) {
1677
- const { cms: n = "cms" } = e;
1678
- return fetch(`${t.href}?${ui.stringify(e)}`, {
1679
- method: "GET",
1680
- cache: r ? "no-store" : "default",
1681
- headers: {
1682
- Accept: "application/json",
1683
- "Content-Type": "application/json",
1684
- "strapi-encode-source-maps": n === "strapi" && r ? "true" : "false"
1685
- // strapi
1686
- }
1687
- });
1688
- }
1689
- function ot(t, e) {
1690
- return !(e != null && e.cms) || (e == null ? void 0 : e.cms) === "vtex" ? `https://${e == null ? void 0 : e.storeId}.myvtex.com/_v/cms/api/${e == null ? void 0 : e.name}/${t}` : String(
1691
- new URL(`api/${t}`, process.env.NEXT_PUBLIC_API_URL)
1692
- );
1693
- }
1694
- function fr(t) {
1695
- return Array.isArray(t) && t.length > 0 ? t[0] : Array.isArray(t) ? null : t;
1696
- }
1697
- async function ur(t, e = [], r = {}) {
1698
- var n;
1699
- if ((r == null ? void 0 : r.contentType) === t) {
1700
- const o = (r == null ? void 0 : r.previewMode) === "true", a = (r == null ? void 0 : r.documentId) ?? "", i = a && ((n = String(a)) != null && n.length) ? `/${r.documentId}` : "", c = new URL(ot(`${t}${i}`, r)), l = await Oe(c, r, o);
1701
- if (!l.ok)
1702
- return console.error(`[Error fetching preview data]: ${t} - status: ${l.statusText}`), [];
1703
- const s = await l.json(), f = e.findIndex((p) => p.documentId === s.id);
1704
- return f !== -1 ? (e[f] = s, [...e]) : [s, ...e];
1705
- }
1706
- return e;
1707
- }
1708
- const xi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1709
- __proto__: null,
1710
- createUrl: ot,
1711
- fetchCMS: Oe,
1712
- mergePreviewDocument: ur,
1713
- spreadStrapiData: fr
1714
- }, Symbol.toStringTag, { value: "Module" }));
1715
- async function sr(t, e = {}, r) {
1716
- const n = !!(e != null && e.previewMode), o = await Oe(t, e, n);
1717
- if (!o.ok)
1718
- return console.log(
1719
- `Failed to fetch Strapi (url=${String(t)}, status=${o.status})`
1720
- ), { status: 404, data: [], error: String(o.status) };
1721
- const { data: a } = await o.json();
1722
- return a ? {
1723
- status: 200,
1724
- data: r ? fr(a) : a
1725
- } : { status: 404, data: [], error: "No data found" };
1726
- }
1727
- async function pr(t, e, r = {}) {
1728
- const n = (r == null ? void 0 : r.previewId) ?? "", o = (r == null ? void 0 : r.previewMode) === "true", a = { ...r, versionId: n }, i = [];
1729
- let c = 1, l = 0, s = !0;
1730
- try {
1731
- do {
1732
- const f = await Oe(e, { ...a, page: c }, o).then((p) => p.json()).catch((p) => (console.error("Error fetching VTEX CMS data:", p), console.error("Error URL:", e.toString()), null));
1733
- c === 1 && (l = f.totalItems), Array.isArray(f == null ? void 0 : f.data) && i.push(...f.data), s = !!(f != null && f.hasNextPage), c++;
1734
- } while (s && i.length < l);
1735
- if (o && i.length > 0) {
1736
- if (!t || !n)
1737
- throw new Error(
1738
- "contentType and previewId are required for preview mode in vtexCMSData"
1739
- );
1740
- const f = await ur(
1741
- t,
1742
- i,
1743
- a
1744
- );
1745
- return {
1746
- status: f.length > 0 ? 200 : 404,
1747
- data: f
1748
- };
1749
- }
1750
- return {
1751
- status: i.length ? 200 : 404,
1752
- data: i
1753
- };
1754
- } catch (f) {
1755
- return {
1756
- status: 500,
1757
- data: [],
1758
- error: f instanceof Error ? f.message : String(f)
1759
- };
1760
- }
1761
- }
1762
- const Ei = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1763
- __proto__: null,
1764
- strapiCMSData: sr,
1765
- vtexCMSData: pr
1766
- }, Symbol.toStringTag, { value: "Module" }));
1767
- async function si({
1768
- contentType: t,
1769
- documentId: e,
1770
- versionId: r,
1771
- storeId: n,
1772
- CMS_PROJECT_NAME: o
1773
- }) {
1774
- const a = e && e.length ? `/${e}` : "", i = r && r.length ? `?versionId=${r}` : "";
1775
- return fetch(
1776
- `https://${n}.myvtex.com/_v/cms/api/${o}/${t}${a}${i}`,
1777
- { cache: "no-cache" }
1778
- );
1779
- }
1780
- async function pi(t, e = {}, r) {
1781
- const { cms: n = "vtex" } = e ?? {};
1782
- try {
1783
- const o = new URL(ot(t, e));
1784
- return n !== "vtex" ? sr(o, e, r) : pr(t, o, e);
1785
- } catch (o) {
1786
- return console.error(`[Fetch ContentType Error CMS ${n}]`, o), r ? { status: 400, data: null } : { status: 200, data: [] };
1787
- }
1788
- }
1789
- const Pi = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1790
- __proto__: null,
1791
- fetchContentType: pi,
1792
- getCMSContentType: si
1793
- }, Symbol.toStringTag, { value: "Module" }));
1794
- export {
1795
- Si as A,
1796
- Pi as B,
1797
- xi as C,
1798
- Ei as D,
1799
- Oi as S,
1800
- wr as a,
1801
- xr as b,
1802
- br as c,
1803
- Ar as d,
1804
- mi as e,
1805
- He as f,
1806
- hr as g,
1807
- vr as h,
1808
- Or as i,
1809
- kr as j,
1810
- gr as k,
1811
- $r as l,
1812
- Rr as m,
1813
- _r as n,
1814
- Ai as o,
1815
- _i as p,
1816
- Er as q,
1817
- ue as r,
1818
- Mt as s,
1819
- bi as t,
1820
- Pr as u,
1821
- vi as v,
1822
- wi as w,
1823
- pi as x,
1824
- hi as y,
1825
- gi as z
1826
- };