@soma-vertical-web/multi-lib 1.0.26 → 1.0.27

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