@soma-vertical-web/multi-lib-sacurai 0.0.1 → 0.0.3

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