@soma-vertical-web/multi-lib 0.0.40 → 0.0.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index2.mjs CHANGED
@@ -1,35 +1,35 @@
1
1
  import * as n from "yup";
2
- import { f as oe, r as _, a as ne, b as se, d as ae, e as ie, c as ce, p as le } from "./__vite-browser-external-C4n7rb1H.mjs";
3
- import { jsxs as ue, Fragment as de, jsx as C } from "react/jsx-runtime";
4
- import { Utils as G, helpers as H } from "@soma-vertical-web/core-components";
5
- import me from "sanitize-html";
6
- const d = async (e, t = {}) => {
7
- const { method: o = "GET", body: r, headers: s = {}, priority: a = "auto", cache: i = "default" } = t;
2
+ import { R as ae, C as N, F as ie, H as ce, t as V, T as le, V as ue, W as de, X as me, n as pe, p as fe } from "./Footer-COiI-tye.mjs";
3
+ import { jsxs as Q, Fragment as G, jsx as I } from "react/jsx-runtime";
4
+ import { Utils as w, helpers as B } from "@soma-vertical-web/core-components";
5
+ import ge from "sanitize-html";
6
+ const f = async (e, t = {}) => {
7
+ const { method: o = "GET", body: r, headers: a = {}, priority: s = "auto", cache: i = "default" } = t;
8
8
  return fetch(e, {
9
9
  method: o,
10
10
  headers: {
11
- ...s,
11
+ ...a,
12
12
  Accept: "application/json",
13
13
  "Content-Type": "application/json"
14
14
  },
15
- priority: a,
15
+ priority: s,
16
16
  cache: i,
17
17
  ...r ? { body: JSON.stringify(r) } : {}
18
18
  // not body in get
19
19
  }).then((c) => c.json()).catch((c) => {
20
20
  console.error("[ERROR FETCH VTEX]", c);
21
21
  });
22
- }, O = /* @__PURE__ */ new Map();
23
- async function pe(e, t = {}) {
22
+ }, A = /* @__PURE__ */ new Map();
23
+ async function he(e, t = {}) {
24
24
  var o;
25
25
  try {
26
- const { abort: r = !1 } = t, s = new AbortController();
27
- r && (O.has(e) && ((o = O.get(e)) == null || o.abort(), O.delete(e)), O.set(e, s));
28
- const a = d(e, {
26
+ const { abort: r = !1 } = t, a = new AbortController();
27
+ r && (A.has(e) && ((o = A.get(e)) == null || o.abort(), A.delete(e)), A.set(e, a));
28
+ const s = f(e, {
29
29
  ...t,
30
- ...r ? { signal: s.signal } : {}
30
+ ...r ? { signal: a.signal } : {}
31
31
  });
32
- return r && O.delete(e), a;
32
+ return r && A.delete(e), s;
33
33
  } catch (r) {
34
34
  if (r.name === "AbortError") {
35
35
  console.log(`[REQUEST CANCELLED]: ${e}`);
@@ -38,19 +38,19 @@ async function pe(e, t = {}) {
38
38
  throw console.error(`[ERROR API]: ${r.message}`), r;
39
39
  }
40
40
  }
41
- const ge = n.object({
41
+ const Ie = n.object({
42
42
  country: n.string().length(3, "Country code must be 3 characters long").required("Country is required"),
43
43
  postalCode: n.string().nullable()
44
44
  });
45
- async function fe({ apiUrl: e, body: t, fetchOptions: o }) {
45
+ async function be({ apiUrl: e, body: t, fetchOptions: o }) {
46
46
  if (!t) {
47
47
  console.error("[ERROR FETCHING] Body is required");
48
48
  return;
49
49
  }
50
- await ge.validate(t);
51
- const { country: r, postalCode: s } = t;
52
- return await d(
53
- `${e}/api/checkout/pub/postal-code/${r}/${s}`,
50
+ await Ie.validate(t);
51
+ const { country: r, postalCode: a } = t;
52
+ return await f(
53
+ `${e}/api/checkout/pub/postal-code/${r}/${a}`,
54
54
  {
55
55
  method: "POST",
56
56
  body: t,
@@ -58,12 +58,12 @@ async function fe({ apiUrl: e, body: t, fetchOptions: o }) {
58
58
  }
59
59
  );
60
60
  }
61
- const he = n.object({
61
+ const ye = n.object({
62
62
  orderFormId: n.string().nullable(),
63
63
  sellerCode: n.string().nullable(),
64
64
  sellerName: n.string().nullable()
65
65
  });
66
- async function x({
66
+ async function J({
67
67
  apiUrl: e,
68
68
  body: t,
69
69
  fetchOptions: o
@@ -72,9 +72,9 @@ async function x({
72
72
  console.error("[ERROR FETCHING] Body is required");
73
73
  return;
74
74
  }
75
- await he.validate(t);
76
- const { orderFormId: r, sellerCode: s, sellerName: a } = t, i = s ? `${s.trim()} - ${a}` : null;
77
- return d(
75
+ await ye.validate(t);
76
+ const { orderFormId: r, sellerCode: a, sellerName: s } = t, i = a ? `${a.trim()} - ${s}` : null;
77
+ return f(
78
78
  `${e}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,
79
79
  {
80
80
  method: "POST",
@@ -85,46 +85,46 @@ async function x({
85
85
  }
86
86
  );
87
87
  }
88
- const Ie = n.object({
88
+ const ve = n.object({
89
89
  orderFormId: n.string().nullable(),
90
90
  sellerCode: n.string().nullable(),
91
91
  marketingData: n.object()
92
92
  });
93
- async function z({ apiUrl: e, body: t, fetchOptions: o }) {
93
+ async function K({ apiUrl: e, body: t, fetchOptions: o }) {
94
94
  if (!t) {
95
95
  console.error("[ERROR FETCHING] Body is required");
96
96
  return;
97
97
  }
98
- await Ie.validate(t);
99
- const { orderFormId: r, sellerCode: s, marketingData: a } = t, i = s ? {
100
- utmCampaign: s ? s.toUpperCase() : "",
101
- utmiCampaign: s ? "codigodavendedora" : "semcodigo"
98
+ await ve.validate(t);
99
+ const { orderFormId: r, sellerCode: a, marketingData: s } = t, i = a ? {
100
+ utmCampaign: a ? a.toUpperCase() : "",
101
+ utmiCampaign: a ? "codigodavendedora" : "semcodigo"
102
102
  } : {};
103
- return d(
103
+ return f(
104
104
  `${e}/api/checkout/pub/orderForm/${r}/attachments/marketingData`,
105
105
  {
106
106
  method: "POST",
107
107
  body: {
108
- ...a,
108
+ ...s,
109
109
  ...i
110
110
  },
111
111
  ...o
112
112
  }
113
113
  );
114
114
  }
115
- const be = n.object({
115
+ const Ce = n.object({
116
116
  orderFormId: n.string().nullable(),
117
117
  sellerCode: n.string().nullable(),
118
118
  sellerName: n.string().nullable()
119
119
  });
120
- async function ye({ apiUrl: e, body: t, fetchOptions: o }) {
120
+ async function Re({ apiUrl: e, body: t, fetchOptions: o }) {
121
121
  if (!t) {
122
122
  console.error("[ERROR FETCHING] Body is required");
123
123
  return;
124
124
  }
125
- await be.validate(t);
126
- const r = await x({ apiUrl: e, body: t, fetchOptions: o });
127
- return z({
125
+ await Ce.validate(t);
126
+ const r = await J({ apiUrl: e, body: t, fetchOptions: o });
127
+ return K({
128
128
  apiUrl: e,
129
129
  body: {
130
130
  ...t,
@@ -133,11 +133,11 @@ async function ye({ apiUrl: e, body: t, fetchOptions: o }) {
133
133
  fetchOptions: o
134
134
  });
135
135
  }
136
- const Ce = n.object({
136
+ const Fe = n.object({
137
137
  orderFormId: n.string().nullable(),
138
138
  coupon: n.string().nullable()
139
139
  });
140
- async function Re({
140
+ async function $e({
141
141
  apiUrl: e,
142
142
  body: t,
143
143
  fetchOptions: o
@@ -146,10 +146,10 @@ async function Re({
146
146
  console.error("[ERROR FETCHING] Body is required");
147
147
  return;
148
148
  }
149
- await Ce.validate(t);
150
- const { coupon: r = "", orderFormId: s } = t;
151
- return d(
152
- `${e}/api/checkout/pub/orderForm/${s}/coupons`,
149
+ await Fe.validate(t);
150
+ const { coupon: r = "", orderFormId: a } = t;
151
+ return f(
152
+ `${e}/api/checkout/pub/orderForm/${a}/coupons`,
153
153
  {
154
154
  method: "POST",
155
155
  body: { text: r },
@@ -157,12 +157,12 @@ async function Re({
157
157
  }
158
158
  );
159
159
  }
160
- const ve = n.object({
160
+ const Se = n.object({
161
161
  appId: n.string().required("App ID is required"),
162
162
  orderFormId: n.string().nullable(),
163
163
  key: n.array().of(n.string())
164
164
  });
165
- async function Fe({
165
+ async function Oe({
166
166
  apiUrl: e,
167
167
  body: t,
168
168
  fetchOptions: o
@@ -171,33 +171,33 @@ async function Fe({
171
171
  console.error("[ERROR FETCHING] Body is required");
172
172
  return;
173
173
  }
174
- await ve.validate(t);
175
- const { appId: r = "faststore", orderFormId: s, key: a } = t;
176
- return d(
177
- `${e}/api/checkout/pub/orderForm/${s}/customData/${r}/${a}`,
174
+ await Se.validate(t);
175
+ const { appId: r = "faststore", orderFormId: a, key: s } = t;
176
+ return f(
177
+ `${e}/api/checkout/pub/orderForm/${a}/customData/${r}/${s}`,
178
178
  {
179
179
  method: "PUT",
180
180
  ...o
181
181
  }
182
182
  );
183
183
  }
184
- const Oe = n.object().shape({
184
+ const Te = n.object().shape({
185
185
  name: n.string().required("Attachment name is required"),
186
186
  content: n.object().nullable()
187
187
  });
188
- var V;
189
- const $e = n.object().shape({
190
- attachments: (V = n.array().of(Oe)) == null ? void 0 : V.nullable(),
188
+ var x;
189
+ const Ee = n.object().shape({
190
+ attachments: (x = n.array().of(Te)) == null ? void 0 : x.nullable(),
191
191
  id: n.string().required("ID of SKU is required"),
192
192
  index: n.number().integer().nullable(),
193
193
  quantity: n.number().integer().nullable(),
194
194
  seller: n.string().required("Seller is required"),
195
195
  price: n.number().integer()
196
- }), Se = n.object({
196
+ }), qe = n.object({
197
197
  orderFormId: n.string().required("OrderFormId is required"),
198
- orderItems: n.array().of($e)
198
+ orderItems: n.array().of(Ee)
199
199
  });
200
- async function Ee({
200
+ async function Pe({
201
201
  apiUrl: e,
202
202
  body: t,
203
203
  fetchOptions: o
@@ -206,21 +206,21 @@ async function Ee({
206
206
  console.error("[ERROR FETCHING] Body is required");
207
207
  return;
208
208
  }
209
- await Se.validate(t);
210
- const { orderFormId: r, orderItems: s } = t;
211
- return d(
209
+ await qe.validate(t);
210
+ const { orderFormId: r, orderItems: a } = t;
211
+ return f(
212
212
  `${e}/api/checkout/pub/orderForm/${r}/items`,
213
213
  {
214
214
  method: "POST",
215
- body: { orderItems: s },
215
+ body: { orderItems: a },
216
216
  ...o
217
217
  }
218
218
  );
219
219
  }
220
- const Te = n.object({
220
+ const Ae = n.object({
221
221
  orderFormId: n.string().nullable()
222
222
  });
223
- async function qe({
223
+ async function ke({
224
224
  apiUrl: e,
225
225
  body: t,
226
226
  fetchOptions: o
@@ -229,9 +229,9 @@ async function qe({
229
229
  console.error("[ERROR FETCHING] Body is required");
230
230
  return;
231
231
  }
232
- await Te.validate(t);
232
+ await Ae.validate(t);
233
233
  const { orderFormId: r } = t;
234
- return d(
234
+ return f(
235
235
  `${e}/api/checkout/pub/orderForm/${r}/items/removeAll`,
236
236
  {
237
237
  method: "POST",
@@ -239,23 +239,23 @@ async function qe({
239
239
  }
240
240
  );
241
241
  }
242
- const Ae = n.object().shape({
242
+ const Ne = n.object().shape({
243
243
  name: n.string().required("Attachment name is required"),
244
244
  content: n.object().nullable()
245
245
  });
246
- var M;
247
- const Pe = n.object().shape({
248
- attachments: (M = n.array().of(Ae)) == null ? void 0 : M.nullable(),
246
+ var z;
247
+ const we = n.object().shape({
248
+ attachments: (z = n.array().of(Ne)) == null ? void 0 : z.nullable(),
249
249
  id: n.string().required("ID of SKU is required"),
250
250
  index: n.number().integer().nullable(),
251
251
  quantity: n.number().integer().nullable(),
252
252
  seller: n.string().required("Seller is required"),
253
253
  price: n.number().integer()
254
- }), Ne = n.object({
254
+ }), je = n.object({
255
255
  orderFormId: n.string().nullable(),
256
- orderItems: n.array().of(Pe)
256
+ orderItems: n.array().of(we)
257
257
  });
258
- async function je({
258
+ async function De({
259
259
  apiUrl: e,
260
260
  body: t,
261
261
  fetchOptions: o
@@ -264,21 +264,21 @@ async function je({
264
264
  console.error("[ERROR FETCHING] Body is required");
265
265
  return;
266
266
  }
267
- await Ne.validate(t);
268
- const { orderFormId: r, orderItems: s } = t;
269
- return d(
267
+ await je.validate(t);
268
+ const { orderFormId: r, orderItems: a } = t;
269
+ return f(
270
270
  `${e}/api/checkout/pub/orderForm/${r}/items/update`,
271
271
  {
272
272
  method: "POST",
273
- body: { orderItems: s },
273
+ body: { orderItems: a },
274
274
  ...o
275
275
  }
276
276
  );
277
277
  }
278
- const ke = n.object({
278
+ const He = n.object({
279
279
  orderFormId: n.string().nullable()
280
280
  });
281
- async function we({
281
+ async function _e({
282
282
  apiUrl: e,
283
283
  body: t,
284
284
  fetchOptions: o
@@ -287,9 +287,9 @@ async function we({
287
287
  console.error("[ERROR FETCHING] Body is required");
288
288
  return;
289
289
  }
290
- await ke.validate(t);
290
+ await He.validate(t);
291
291
  const { orderFormId: r } = t;
292
- return d(
292
+ return f(
293
293
  `${e}/api/checkout/pub/orderForm/${r}/messages/clear`,
294
294
  {
295
295
  method: "POST",
@@ -297,30 +297,30 @@ async function we({
297
297
  }
298
298
  );
299
299
  }
300
- const De = n.object({
300
+ const Be = n.object({
301
301
  id: n.string().nullable(),
302
302
  // id offering
303
303
  itemIndex: n.number().nullable(),
304
304
  orderFormId: n.string().nullable(),
305
305
  remove: n.boolean().nullable()
306
306
  });
307
- async function _e({ apiUrl: e, body: t, fetchOptions: o }) {
307
+ async function Ge({ apiUrl: e, body: t, fetchOptions: o }) {
308
308
  if (!t) {
309
309
  console.error("[ERROR FETCHING] Body is required");
310
310
  return;
311
311
  }
312
- await De.validate(t);
313
- const { itemIndex: r, orderFormId: s, id: a, remove: i } = t, c = i ? `/${a}/remove` : "", l = `${e}/api/checkout/pub/orderForm/${s}/items/${r}/offerings${c}`;
314
- return d(l, {
312
+ await Be.validate(t);
313
+ const { itemIndex: r, orderFormId: a, id: s, remove: i } = t, c = i ? `/${s}/remove` : "", d = `${e}/api/checkout/pub/orderForm/${a}/items/${r}/offerings${c}`;
314
+ return f(d, {
315
315
  method: "POST",
316
- body: { id: a },
316
+ body: { id: s },
317
317
  ...o
318
318
  });
319
319
  }
320
- const Ge = n.object({
320
+ const Ve = n.object({
321
321
  orderFormId: n.string().nullable()
322
322
  });
323
- async function He({
323
+ async function Le({
324
324
  apiUrl: e,
325
325
  body: t,
326
326
  fetchOptions: o,
@@ -331,13 +331,13 @@ async function He({
331
331
  console.error("[ERROR FETCHING] Body is required");
332
332
  return;
333
333
  }
334
- await Ge.validate(t);
335
- const s = new URLSearchParams({
334
+ await Ve.validate(t);
335
+ const a = new URLSearchParams({
336
336
  refreshOutdatedData: "true"
337
- }), a = t.orderFormId && ((i = r.orderFormPurchaseId) == null ? void 0 : i.value) !== t.orderFormId ? `${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(s)}` : `${e}/api/checkout/pub/orderForm`;
338
- return d(a, { method: "GET", ...o });
337
+ }), s = t.orderFormId && ((i = r.orderFormPurchaseId) == null ? void 0 : i.value) !== t.orderFormId ? `${e}/api/checkout/pub/orderForm/${t.orderFormId}?${String(a)}` : `${e}/api/checkout/pub/orderForm`;
338
+ return f(s, { method: "GET", ...o });
339
339
  }
340
- const Be = n.object({
340
+ const Ue = n.object({
341
341
  orderFormId: n.string().nullable(),
342
342
  email: n.string().email().required(),
343
343
  firstName: n.string().required(),
@@ -346,7 +346,7 @@ const Be = n.object({
346
346
  document: n.string().required(),
347
347
  phone: n.string().matches(/^\+\d{1,3}\d{10,11}$/)
348
348
  });
349
- async function Ue({
349
+ async function Me({
350
350
  apiUrl: e,
351
351
  body: t,
352
352
  fetchOptions: o
@@ -355,21 +355,21 @@ async function Ue({
355
355
  console.error("[ERROR FETCHING] Body is required");
356
356
  return;
357
357
  }
358
- await Be.validate(t);
359
- const { orderFormId: r, ...s } = t;
360
- return d(
358
+ await Ue.validate(t);
359
+ const { orderFormId: r, ...a } = t;
360
+ return f(
361
361
  `${e}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,
362
362
  {
363
363
  method: "POST",
364
- body: { ...s },
364
+ body: { ...a },
365
365
  ...o
366
366
  }
367
367
  );
368
368
  }
369
- const Le = n.object({
369
+ const xe = n.object({
370
370
  sellerCode: n.string().nullable()
371
371
  });
372
- async function Ve({
372
+ async function ze({
373
373
  apiUrl: e,
374
374
  body: t,
375
375
  fetchOptions: o
@@ -378,9 +378,9 @@ async function Ve({
378
378
  console.error("[ERROR FETCHING] Body is required");
379
379
  return;
380
380
  }
381
- await Le.validate(t);
381
+ await xe.validate(t);
382
382
  const { sellerCode: r = "" } = t;
383
- return d(
383
+ return f(
384
384
  `${e}/api/dataentities/VD/search?_fields=id,cod,name,ativo&cod=${r}`,
385
385
  {
386
386
  method: "GET",
@@ -391,12 +391,12 @@ async function Ve({
391
391
  }
392
392
  );
393
393
  }
394
- const Me = n.object().shape({
394
+ const Qe = n.object().shape({
395
395
  country: n.string().length(3, "Country code must be 3 characters long").required("Country is required"),
396
396
  orderFormId: n.string().nullable(),
397
397
  postalCode: n.string().nullable()
398
398
  });
399
- async function xe({
399
+ async function Je({
400
400
  apiUrl: e,
401
401
  body: t,
402
402
  fetchOptions: o
@@ -405,19 +405,19 @@ async function xe({
405
405
  console.error("[ERROR FETCHING] Body is required");
406
406
  return;
407
407
  }
408
- await Me.validate(t);
409
- const { country: r, orderFormId: s, postalCode: a } = t, i = a ? {
408
+ await Qe.validate(t);
409
+ const { country: r, orderFormId: a, postalCode: s } = t, i = s ? {
410
410
  address: {
411
411
  addressType: "residential",
412
- postalCode: a,
412
+ postalCode: s,
413
413
  country: r
414
414
  }
415
415
  } : {
416
416
  logisticsInfo: [],
417
417
  clearAddressIfPostalCodeNotFound: !0
418
418
  };
419
- return d(
420
- `${e}/api/checkout/pub/orderForm/${s}/attachments/shippingData`,
419
+ return f(
420
+ `${e}/api/checkout/pub/orderForm/${a}/attachments/shippingData`,
421
421
  {
422
422
  method: "POST",
423
423
  body: i,
@@ -425,7 +425,7 @@ async function xe({
425
425
  }
426
426
  );
427
427
  }
428
- const ze = n.object().shape({
428
+ const Ke = n.object().shape({
429
429
  orderFormId: n.string().nullable(),
430
430
  options: n.array().of(
431
431
  n.object().shape({
@@ -453,27 +453,27 @@ const ze = n.object().shape({
453
453
  })
454
454
  )
455
455
  });
456
- async function Qe({ apiUrl: e, body: t, fetchOptions: o }) {
456
+ async function We({ apiUrl: e, body: t, fetchOptions: o }) {
457
457
  if (!t) {
458
458
  console.error("[ERROR FETCHING] Body is required");
459
459
  return;
460
460
  }
461
- await ze.validate(t);
462
- const { orderFormId: r, options: s, selectedAddresses: a } = t;
463
- return d(
461
+ await Ke.validate(t);
462
+ const { orderFormId: r, options: a, selectedAddresses: s } = t;
463
+ return f(
464
464
  `${e}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,
465
465
  {
466
466
  method: "POST",
467
467
  body: {
468
- selectedAddresses: a,
468
+ selectedAddresses: s,
469
469
  clearAddressIfPostalCodeNotFound: !1,
470
- logisticsInfo: s
470
+ logisticsInfo: a
471
471
  },
472
472
  ...o
473
473
  }
474
474
  );
475
475
  }
476
- const Je = n.object({
476
+ const Xe = n.object({
477
477
  country: n.string().length(3, "Country code must be 3 characters long").required("Country is required"),
478
478
  postalCode: n.string().nullable(),
479
479
  geoCoordinates: n.object().shape({
@@ -481,17 +481,17 @@ const Je = n.object({
481
481
  latitude: n.number().required()
482
482
  })
483
483
  });
484
- async function Ke({ apiUrl: e, body: t, fetchOptions: o }) {
484
+ async function Ye({ apiUrl: e, body: t, fetchOptions: o }) {
485
485
  if (!t) {
486
486
  console.error("[ERROR FETCHING] Body is required");
487
487
  return;
488
488
  }
489
- await Je.validate(t);
490
- const { country: r = "", geoCoordinates: s, postalCode: a = "" } = t, i = new URLSearchParams({ country: String(r) });
491
- return a ? i.append("postalCode", a) : i.append(
489
+ await Xe.validate(t);
490
+ const { country: r = "", geoCoordinates: a, postalCode: s = "" } = t, i = new URLSearchParams({ country: String(r) });
491
+ return s ? i.append("postalCode", s) : i.append(
492
492
  "geoCoordinates",
493
- `${s == null ? void 0 : s.longitude};${s == null ? void 0 : s.latitude}`
494
- ), await d(
493
+ `${a == null ? void 0 : a.longitude};${a == null ? void 0 : a.latitude}`
494
+ ), await f(
495
495
  `${e}/api/checkout/pub/regions/?${i.toString()}`,
496
496
  {
497
497
  method: "GET",
@@ -499,22 +499,22 @@ async function Ke({ apiUrl: e, body: t, fetchOptions: o }) {
499
499
  }
500
500
  );
501
501
  }
502
- const Ye = n.object({
502
+ const Ze = n.object({
503
503
  id: n.string().required("ID of SKU is required"),
504
504
  quantity: n.number().integer().required("Quantity of item is required"),
505
505
  seller: n.string()
506
- }), We = n.object({
507
- items: n.array().of(Ye),
506
+ }), et = n.object({
507
+ items: n.array().of(Ze),
508
508
  country: n.string().length(3, "Country code must be 3 characters long").required("Country is required"),
509
509
  postalCode: n.string().nullable(),
510
510
  geoCoordinates: n.array().nullable().of(n.number()).length(2)
511
511
  });
512
- async function Xe({ apiUrl: e, body: t, fetchOptions: o }) {
512
+ async function tt({ apiUrl: e, body: t, fetchOptions: o }) {
513
513
  if (!t) {
514
514
  console.error("[ERROR FETCHING] Body is required");
515
515
  return;
516
516
  }
517
- return await We.validate(t), d(
517
+ return await et.validate(t), f(
518
518
  `${e}/api/checkout/pub/orderForms/simulation`,
519
519
  {
520
520
  method: "POST",
@@ -523,94 +523,94 @@ async function Xe({ apiUrl: e, body: t, fetchOptions: o }) {
523
523
  }
524
524
  );
525
525
  }
526
- const Ze = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
526
+ const rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
527
527
  __proto__: null,
528
- getMasterDataSellerCode: Ve,
529
- getOrderForm: He,
530
- postOrderFormAddCoupon: Re,
531
- postOrderFormAttachClientProfileData: Ue,
532
- postOrderFormAttachOrderFormData: ye,
533
- postOrderFormAttachShippingData: xe,
534
- postOrderFormAttachmentsMarketingData: z,
535
- postOrderFormAttachmentsOpenTextField: x,
536
- postOrderFormClearMessages: we,
537
- postOrderFormFreightSimulation: Xe,
538
- postOrderFormItems: Ee,
539
- postOrderFormRegion: Ke,
540
- postOrderFormRemoveAllItems: qe,
541
- postOrderFormUpdateItems: je,
542
- postOrderFormUpdateShippingData: Qe,
543
- postOrderformAddress: fe,
544
- putOrderFormCustomData: Fe,
545
- updateOrderFormOffering: _e
546
- }, Symbol.toStringTag, { value: "Module" })), et = n.object({
528
+ getMasterDataSellerCode: ze,
529
+ getOrderForm: Le,
530
+ postOrderFormAddCoupon: $e,
531
+ postOrderFormAttachClientProfileData: Me,
532
+ postOrderFormAttachOrderFormData: Re,
533
+ postOrderFormAttachShippingData: Je,
534
+ postOrderFormAttachmentsMarketingData: K,
535
+ postOrderFormAttachmentsOpenTextField: J,
536
+ postOrderFormClearMessages: _e,
537
+ postOrderFormFreightSimulation: tt,
538
+ postOrderFormItems: Pe,
539
+ postOrderFormRegion: Ye,
540
+ postOrderFormRemoveAllItems: ke,
541
+ postOrderFormUpdateItems: De,
542
+ postOrderFormUpdateShippingData: We,
543
+ postOrderformAddress: be,
544
+ putOrderFormCustomData: Oe,
545
+ updateOrderFormOffering: Ge
546
+ }, Symbol.toStringTag, { value: "Module" })), ot = n.object({
547
547
  skuId: n.string()
548
548
  });
549
- async function tt({ apiUrl: e, body: t, fetchOptions: o }) {
549
+ async function nt({ apiUrl: e, body: t, fetchOptions: o }) {
550
550
  if (!t) {
551
551
  console.error("[ERROR FETCHING] Body is required");
552
552
  return;
553
553
  }
554
- await et.validate(t);
554
+ await ot.validate(t);
555
555
  const { skuId: r } = t;
556
- return d(
556
+ return f(
557
557
  `${e}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,
558
558
  {
559
559
  ...o
560
560
  }
561
561
  );
562
562
  }
563
- const rt = n.object({
563
+ const st = n.object({
564
564
  ids: n.array().of(n.string().required("ID are required")).required("IDs are required")
565
565
  });
566
- async function ot({ apiUrl: e, body: t, fetchOptions: o }) {
566
+ async function at({ apiUrl: e, body: t, fetchOptions: o }) {
567
567
  if (!t) {
568
568
  console.error("[ERROR FETCHING] Body is required");
569
569
  return;
570
570
  }
571
- await rt.validate(t);
571
+ await st.validate(t);
572
572
  const { ids: r } = t;
573
- return d(
574
- `${e}/api/catalog_system/pub/products/search?fq=${r.map((s) => `productId:${s}`).join("&fq=")}`,
573
+ return f(
574
+ `${e}/api/catalog_system/pub/products/search?fq=${r.map((a) => `productId:${a}`).join("&fq=")}`,
575
575
  {
576
576
  ...o
577
577
  }
578
578
  );
579
579
  }
580
- const nt = n.object({
580
+ const it = n.object({
581
581
  productId: n.number().required("Product ID is required")
582
582
  });
583
- async function st({ apiUrl: e, body: t, fetchOptions: o }) {
583
+ async function ct({ apiUrl: e, body: t, fetchOptions: o }) {
584
584
  if (!t) {
585
585
  console.error("[ERROR FETCHING] Body is required");
586
586
  return;
587
587
  }
588
- await nt.validate(t);
588
+ await it.validate(t);
589
589
  const { productId: r } = t;
590
- return d(
590
+ return f(
591
591
  `${e}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,
592
592
  {
593
593
  ...o
594
594
  }
595
595
  );
596
596
  }
597
- const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
597
+ const lt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
598
598
  __proto__: null,
599
- getCatalogKitProducts: tt,
600
- getCatalogProducts: ot,
601
- getCatalogSimilars: st
602
- }, Symbol.toStringTag, { value: "Module" })), it = (e = "") => e.charAt(0).toUpperCase() + e.slice(1), B = (e, t = " ") => !e || typeof e == "string" && e.length === 0 ? e : (Array.isArray(e) ? e : e.split("-")).map(it).join(t), ct = ({ canonical: e, seo: t, slug: o }) => {
599
+ getCatalogKitProducts: nt,
600
+ getCatalogProducts: at,
601
+ getCatalogSimilars: ct
602
+ }, Symbol.toStringTag, { value: "Module" })), ut = (e = "") => e.charAt(0).toUpperCase() + e.slice(1), L = (e, t = " ") => !e || typeof e == "string" && e.length === 0 ? e : (Array.isArray(e) ? e : e.split("-")).map(ut).join(t), dt = ({ canonical: e, seo: t, slug: o }) => {
603
603
  const r = Array.isArray(o) ? o.join(", ") : o;
604
604
  return {
605
605
  id: 0,
606
- Title: `${Array.isArray(o) ? o.map((a) => B(a)).join(",") : B(o)} - ${t.title}`,
606
+ Title: `${Array.isArray(o) ? o.map((s) => L(s)).join(",") : L(o)} - ${t.title}`,
607
607
  MetaTagDescription: t.description,
608
608
  name: r,
609
609
  hasChildren: !1,
610
610
  url: e,
611
611
  children: []
612
612
  };
613
- }, lt = ({ canonical: e, category: t, previousImages: o, seo: r }) => ({
613
+ }, mt = ({ canonical: e, category: t, previousImages: o, seo: r }) => ({
614
614
  category: String(t == null ? void 0 : t.id),
615
615
  title: (t == null ? void 0 : t.Title) ?? r.title,
616
616
  description: (t == null ? void 0 : t.MetaTagDescription) ?? r.description,
@@ -621,268 +621,388 @@ const at = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
621
621
  description: (t == null ? void 0 : t.MetaTagDescription) ?? r.description,
622
622
  images: Array.isArray(o) ? [...o] : []
623
623
  }
624
- }), ut = ({ items: e, parent: t, apiUrl: o, find: r }) => {
625
- const s = e.find(
624
+ }), pt = ({ items: e, parent: t, apiUrl: o, find: r }) => {
625
+ const a = e.find(
626
626
  (i) => i.url.replace(o, "") === decodeURIComponent(t.toLowerCase())
627
627
  );
628
- return (s == null ? void 0 : s.children.find(
628
+ return (a == null ? void 0 : a.children.find(
629
629
  (i) => i.name.toLowerCase() === decodeURIComponent(String(r))
630
- )) ?? s;
631
- }, dt = (e) => {
630
+ )) ?? a;
631
+ }, ft = (e) => {
632
632
  e instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${e.message}`), console.error(e.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", e);
633
- }, mt = /* @__PURE__ */ new Set([
633
+ }, gt = /* @__PURE__ */ new Set([
634
634
  "brand",
635
635
  "category",
636
636
  "department",
637
637
  "subcategory",
638
638
  "collection",
639
639
  "cluster"
640
- ]), pt = (e) => typeof (e == null ? void 0 : e.pageType) == "string" && mt.has(e == null ? void 0 : e.pageType.toLowerCase()), gt = (e) => ({
640
+ ]), ht = (e) => typeof (e == null ? void 0 : e.pageType) == "string" && gt.has(e == null ? void 0 : e.pageType.toLowerCase()), It = (e) => ({
641
641
  collection: e.Coleção,
642
642
  categoryId: e.categoryId,
643
643
  current_collection: e["Coleção Atual"],
644
644
  items: e.items
645
- }), ft = (e, t) => e.reduce((o, r) => {
645
+ }), bt = (e, t) => e.reduce((o, r) => {
646
646
  if (r.items.filter(
647
647
  (i) => i.sellers.find((c) => c.commertialOffer.IsAvailable)
648
648
  ).length === 0 || (o == null ? void 0 : o.find((i) => (i == null ? void 0 : i.productId) === (r == null ? void 0 : r.productId))) !== void 0)
649
649
  return o;
650
- const a = r.items[0].images.find(
650
+ const s = r.items[0].images.find(
651
651
  (i) => t.includes(i.imageLabel)
652
652
  );
653
653
  return o.push({
654
654
  slug: `/${r.linkText}/p`,
655
655
  productId: r == null ? void 0 : r.productId,
656
- textureImage: (a == null ? void 0 : a.imageUrl) ?? "",
657
- textureAlt: (a == null ? void 0 : a.imageText) ?? ""
656
+ textureImage: (s == null ? void 0 : s.imageUrl) ?? "",
657
+ textureAlt: (s == null ? void 0 : s.imageText) ?? ""
658
658
  }), o;
659
- }, []), ht = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
659
+ }, []), yt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
660
660
  __proto__: null,
661
- createEmptySeoCategory: ct,
662
- createSeoCategory: lt,
663
- findCategory: ut,
664
- formattedSimilars: ft,
665
- isCollectionPageType: pt,
666
- notFindCategoryError: dt,
667
- responseAdapter: gt
661
+ createEmptySeoCategory: dt,
662
+ createSeoCategory: mt,
663
+ findCategory: pt,
664
+ formattedSimilars: bt,
665
+ isCollectionPageType: ht,
666
+ notFindCategoryError: ft,
667
+ responseAdapter: It
668
668
  }, Symbol.toStringTag, { value: "Module" }));
669
- async function It({ contentType: e, storeId: t, CMS_PROJECT_NAME: o, NextCookies: r }) {
670
- const s = await $({
669
+ async function vt({ contentType: e, storeId: t, CMS_PROJECT_NAME: o, NextCookies: r }) {
670
+ const a = await F({
671
671
  contentType: e,
672
672
  storeId: t,
673
673
  CMS_PROJECT_NAME: o,
674
674
  NextCookies: r
675
675
  });
676
- if (s.status === 200) {
677
- const a = {
676
+ if (a.status === 200) {
677
+ const s = {
678
678
  timestamp: (/* @__PURE__ */ new Date()).toISOString(),
679
679
  contentType: e,
680
- data: s.data
680
+ data: a.data
681
681
  };
682
- console.log("Resultado da chamada:", s);
682
+ console.log("Resultado da chamada:", a);
683
683
  const i = `backup-${e}-${Date.now()}.json`;
684
- return await oe.writeFile(
684
+ return await ae.writeFile(
685
685
  `./backups/${i}`,
686
- JSON.stringify(a, null, 2),
686
+ JSON.stringify(s, null, 2),
687
687
  "utf-8"
688
688
  ), { success: !0, fileName: i };
689
689
  }
690
- return { success: !1, error: s.error || "No data to backup" };
690
+ return { success: !1, error: a.error || "No data to backup" };
691
691
  }
692
- async function bt(e) {
693
- return It(e);
692
+ async function Ct(e) {
693
+ return vt(e);
694
694
  }
695
- async function yt({
695
+ async function Rt({
696
696
  contentType: e,
697
697
  documentId: t,
698
698
  versionId: o,
699
699
  storeId: r,
700
- CMS_PROJECT_NAME: s
700
+ CMS_PROJECT_NAME: a
701
701
  }) {
702
- const a = t && t.length ? `/${t}` : "", i = o && o.length ? `?versionId=${o}` : "";
702
+ const s = t && t.length ? `/${t}` : "", i = o && o.length ? `?versionId=${o}` : "";
703
703
  return fetch(
704
- `https://${r}.myvtex.com/_v/cms/api/${s}/${e}${a}${i}`,
704
+ `https://${r}.myvtex.com/_v/cms/api/${a}/${e}${s}${i}`,
705
705
  { cache: "no-cache" }
706
706
  );
707
707
  }
708
- async function Ct({
708
+ async function Ft({
709
709
  contentType: e,
710
710
  documents: t,
711
711
  NextCookies: o,
712
712
  CMS_PROJECT_NAME: r,
713
- storeId: s
713
+ storeId: a
714
714
  }) {
715
715
  var i;
716
- const a = JSON.parse(
716
+ const s = JSON.parse(
717
717
  ((i = o().get("cms_preview_data")) == null ? void 0 : i.value) ?? "{}"
718
718
  );
719
- if (a && (a == null ? void 0 : a.contentType) === e) {
720
- const c = a.documentId && a.documentId.length ? `/${a.documentId}` : "", l = a != null && a.versionId && (a != null && a.versionId.length) ? `?versionId=${a == null ? void 0 : a.versionId}` : "", p = await (await fetch(
721
- `https://${s}.myvtex.com/_v/cms/api/${r}/${e}${c}${l}`,
719
+ if (s && (s == null ? void 0 : s.contentType) === e) {
720
+ const c = s.documentId && s.documentId.length ? `/${s.documentId}` : "", d = s != null && s.versionId && (s != null && s.versionId.length) ? `?versionId=${s == null ? void 0 : s.versionId}` : "", m = await (await fetch(
721
+ `https://${a}.myvtex.com/_v/cms/api/${r}/${e}${c}${d}`,
722
722
  { cache: "no-store" }
723
- )).json(), u = t.filter(
724
- (m) => p.id !== m.documentId
723
+ )).json(), l = t.filter(
724
+ (u) => m.id !== u.documentId
725
725
  );
726
- return u.unshift(p), u;
726
+ return l.unshift(m), l;
727
727
  }
728
728
  return t;
729
729
  }
730
- async function $({
730
+ async function F({
731
731
  contentType: e,
732
732
  NextCookies: t,
733
733
  CMS_PROJECT_NAME: o,
734
734
  storeId: r
735
735
  }) {
736
- var g, p;
737
- const s = JSON.parse(
736
+ var g, m;
737
+ const a = JSON.parse(
738
738
  ((g = t().get("cms_preview_data")) == null ? void 0 : g.value) ?? "{}"
739
- ), a = [];
740
- let i = 1, c = 0, l = !0;
739
+ ), s = [];
740
+ let i = 1, c = 0, d = !0;
741
741
  try {
742
742
  do {
743
- const m = await (await fetch(
743
+ const u = await (await fetch(
744
744
  `https://${r}.myvtex.com/_v/cms/api/${o}/${e}?page=${i}`
745
745
  )).json();
746
- i === 1 && (c = m.totalItems), (p = m == null ? void 0 : m.data) != null && p.length && a.push(...m.data), l = m.hasNextPage, i++;
747
- } while (l && a.length < c);
748
- if (s.previewMode && a.length) {
749
- const u = await Ct({
746
+ i === 1 && (c = u.totalItems), (m = u == null ? void 0 : u.data) != null && m.length && s.push(...u.data), d = u.hasNextPage, i++;
747
+ } while (d && s.length < c);
748
+ if (a.previewMode && s.length) {
749
+ const l = await Ft({
750
750
  contentType: e,
751
- documents: a,
751
+ documents: s,
752
752
  NextCookies: t,
753
753
  CMS_PROJECT_NAME: o,
754
754
  storeId: r
755
755
  });
756
756
  return {
757
- status: u.length > 0 ? 200 : 404,
758
- data: u ?? []
757
+ status: l.length > 0 ? 200 : 404,
758
+ data: l ?? []
759
759
  };
760
760
  }
761
761
  return {
762
- status: a.length ? 200 : 404,
763
- data: a
762
+ status: s.length ? 200 : 404,
763
+ data: s
764
764
  };
765
- } catch (u) {
766
- return { status: "error", data: [], error: u };
765
+ } catch (l) {
766
+ return { status: "error", data: [], error: l };
767
767
  }
768
768
  }
769
- const Rt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
769
+ const $t = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
770
770
  __proto__: null,
771
- cmsBackup: bt,
772
- getCMSContentType: yt,
773
- getContentType: $
774
- }, Symbol.toStringTag, { value: "Module" })), vt = ({
771
+ cmsBackup: Ct,
772
+ getCMSContentType: Rt,
773
+ getContentType: F
774
+ }, Symbol.toStringTag, { value: "Module" })), St = ({
775
775
  slug: e,
776
776
  data: t,
777
777
  SectionZone: o,
778
778
  COMMON_PAGE_COLUMN_GAP: r
779
779
  }) => {
780
- const s = t == null ? void 0 : t.find(
781
- (p) => {
782
- var u, m, h, f;
783
- return ((m = (u = p.config) == null ? void 0 : u.responsive) == null ? void 0 : m.deviceType) === "desktop" && ((f = (h = p.config) == null ? void 0 : h.seo) == null ? void 0 : f.slug) === e;
780
+ const a = t == null ? void 0 : t.find(
781
+ (m) => {
782
+ var l, u, p, h;
783
+ return ((u = (l = m.config) == null ? void 0 : l.responsive) == null ? void 0 : u.deviceType) === "desktop" && ((h = (p = m.config) == null ? void 0 : p.seo) == null ? void 0 : h.slug) === e;
784
784
  }
785
- ), a = s == null ? void 0 : s.config.responsive.gapCustom, i = s == null ? void 0 : s.config.responsive.gapSections, c = t == null ? void 0 : t.find(
786
- (p) => {
787
- var u, m, h, f;
788
- return ((m = (u = p.config) == null ? void 0 : u.responsive) == null ? void 0 : m.deviceType) === "mobile" && ((f = (h = p.config) == null ? void 0 : h.seo) == null ? void 0 : f.slug) === e;
785
+ ), s = a == null ? void 0 : a.config.responsive.gapCustom, i = a == null ? void 0 : a.config.responsive.gapSections, c = t == null ? void 0 : t.find(
786
+ (m) => {
787
+ var l, u, p, h;
788
+ return ((u = (l = m.config) == null ? void 0 : l.responsive) == null ? void 0 : u.deviceType) === "mobile" && ((h = (p = m.config) == null ? void 0 : p.seo) == null ? void 0 : h.slug) === e;
789
789
  }
790
- ), l = c == null ? void 0 : c.config.responsive.gapCustom, g = c == null ? void 0 : c.config.responsive.gapSections;
791
- return /* @__PURE__ */ ue(de, { children: [
792
- /* @__PURE__ */ C(
793
- G.Column,
790
+ ), d = c == null ? void 0 : c.config.responsive.gapCustom, g = c == null ? void 0 : c.config.responsive.gapSections;
791
+ return /* @__PURE__ */ Q(G, { children: [
792
+ /* @__PURE__ */ I(
793
+ w.Column,
794
794
  {
795
- gap: a && i ? i : r,
796
- className: H.classNameConcat(
797
- _["responsive-desktop-flex"],
795
+ gap: s && i ? i : r,
796
+ className: B.classNameConcat(
797
+ N["responsive-desktop-flex"],
798
798
  "utils-column-modifier"
799
799
  ),
800
- children: /* @__PURE__ */ C(o, { data: (s == null ? void 0 : s.sections) ?? [] })
800
+ children: /* @__PURE__ */ I(o, { data: (a == null ? void 0 : a.sections) ?? [] })
801
801
  }
802
802
  ),
803
- /* @__PURE__ */ C(
804
- G.Column,
803
+ /* @__PURE__ */ I(
804
+ w.Column,
805
805
  {
806
- gap: l && g ? g : r,
807
- className: H.classNameConcat(
808
- _["responsive-mobile-flex"],
806
+ gap: d && g ? g : r,
807
+ className: B.classNameConcat(
808
+ N["responsive-mobile-flex"],
809
809
  "utils-column-modifier"
810
810
  ),
811
- children: /* @__PURE__ */ C(o, { data: (c == null ? void 0 : c.sections) ?? [] })
811
+ children: /* @__PURE__ */ I(o, { data: (c == null ? void 0 : c.sections) ?? [] })
812
812
  }
813
813
  )
814
814
  ] });
815
- }, Ft = async ({
815
+ }, Ot = async ({
816
816
  slug: e,
817
817
  SectionZone: t,
818
818
  COMMON_PAGE_COLUMN_GAP: o,
819
819
  ...r
820
820
  }) => {
821
- const { data: s } = await $({
821
+ const { data: a } = await F({
822
822
  contentType: "common_page",
823
823
  ...r
824
824
  });
825
- return /* @__PURE__ */ C(
826
- vt,
825
+ return /* @__PURE__ */ I(
826
+ St,
827
827
  {
828
- data: s,
828
+ data: a,
829
829
  slug: e,
830
830
  SectionZone: t,
831
831
  COMMON_PAGE_COLUMN_GAP: o
832
832
  }
833
833
  );
834
- }, Ot = async ({
834
+ }, Tt = async ({
835
+ PAYMENT_FLAGS_DICTIONARY: e,
836
+ PAYMENT_FLAGS: t,
837
+ LEGAL_INFORMATION_TEXT: o,
838
+ SectionZone: r,
839
+ ICONS: a,
840
+ ...s
841
+ }) => {
842
+ var g, m, l, u, p, h, $, C, R, S, O, T;
843
+ const { data: i } = await F({
844
+ contentType: "footer",
845
+ ...s
846
+ }), c = Array.isArray(i) && ((m = (g = i[0]) == null ? void 0 : g.name) == null ? void 0 : m.toLowerCase()) === "footer" ? i[0] : null, d = {
847
+ ...(l = c == null ? void 0 : c.paymentInfo) == null ? void 0 : l.paymentInfo,
848
+ acceptedFlags: Array.isArray(
849
+ (u = c == null ? void 0 : c.paymentInfo) == null ? void 0 : u.paymentInfo.acceptedFlags
850
+ ) ? (p = c == null ? void 0 : c.paymentInfo) == null ? void 0 : p.paymentInfo.acceptedFlags.filter((b) => !!e[b]).map(
851
+ (b) => e[b]
852
+ ) : []
853
+ };
854
+ return c ? /* @__PURE__ */ I(
855
+ ie,
856
+ {
857
+ data: { ...c },
858
+ socialInfo: (h = c.socialMedia) == null ? void 0 : h.socialMedia,
859
+ socialMedias: (C = ($ = c.socialMedia) == null ? void 0 : $.socialMedia) == null ? void 0 : C.medias,
860
+ payments: d,
861
+ adornment: {
862
+ ...(S = (R = c.supportInfo) == null ? void 0 : R.supportInfo) != null && S.content ? {
863
+ bottom: /* @__PURE__ */ I(
864
+ ce,
865
+ {
866
+ content: (T = (O = c.supportInfo) == null ? void 0 : O.supportInfo) == null ? void 0 : T.content,
867
+ CONSTANTS: {
868
+ ICONS: a,
869
+ PAYMENT_FLAGS: t,
870
+ PAYMENT_FLAGS_DICTIONARY: e
871
+ }
872
+ }
873
+ )
874
+ } : {},
875
+ ...c.sections.length ? { top: /* @__PURE__ */ I(r, { data: c.sections }) } : {}
876
+ },
877
+ LEGAL_INFORMATION_TEXT: o,
878
+ ICONS: a
879
+ }
880
+ ) : /* @__PURE__ */ I(G, {});
881
+ }, Et = async ({
835
882
  children: e,
836
883
  ClientHeaderProvider: t,
837
884
  ...o
838
885
  }) => {
839
- var a, i, c, l;
840
- const { data: r } = await $({
886
+ var s, i, c, d;
887
+ const { data: r } = await F({
841
888
  contentType: "header",
842
889
  ...o
843
- }), s = (a = r[0]) == null ? void 0 : a.sections.map((g) => g.data);
844
- return /* @__PURE__ */ C(
890
+ }), a = (s = r[0]) == null ? void 0 : s.sections.map((g) => g.data);
891
+ return /* @__PURE__ */ I(
845
892
  t,
846
893
  {
847
894
  headerData: {
848
895
  ...(i = r[0]) == null ? void 0 : i.layerConfig.config,
849
- subMenus: s ?? [],
896
+ subMenus: a ?? [],
850
897
  categories: ((c = r[0]) == null ? void 0 : c.categories.categories.items) ?? [],
851
- navigationLinks: ((l = r[0]) == null ? void 0 : l.navigationLinks.navigationLinks.items) ?? []
898
+ navigationLinks: ((d = r[0]) == null ? void 0 : d.navigationLinks.navigationLinks.items) ?? []
852
899
  },
853
900
  children: e
854
901
  }
855
902
  );
856
- }, $t = async ({
903
+ }, qt = {
904
+ "column-modifier": "_column-modifier_1tqap_1"
905
+ }, Pt = async ({
906
+ children: e,
907
+ slug: t,
908
+ SectionZone: o,
909
+ COMMON_PAGE_COLUMN_GAP_PDC: r,
910
+ ...a
911
+ }) => {
912
+ const { data: s } = await F({
913
+ contentType: "categories_page",
914
+ ...a
915
+ }), i = s.find(
916
+ (m) => {
917
+ var l, u, p;
918
+ return ((l = m.config) == null ? void 0 : l.seo.slug) === t && ((p = (u = m.config) == null ? void 0 : u.responsive) == null ? void 0 : p.deviceType) === "desktop";
919
+ }
920
+ ), c = s.find(
921
+ (m) => {
922
+ var l, u, p;
923
+ return ((l = m.config) == null ? void 0 : l.seo.slug) === t && ((p = (u = m.config) == null ? void 0 : u.responsive) == null ? void 0 : p.deviceType) === "mobile";
924
+ }
925
+ ), d = s.find(
926
+ (m) => {
927
+ var l, u, p;
928
+ return ((l = m.config) == null ? void 0 : l.seo.slug) === "default" && ((p = (u = m.config) == null ? void 0 : u.responsive) == null ? void 0 : p.deviceType) === "desktop";
929
+ }
930
+ ), g = s.find(
931
+ (m) => {
932
+ var l, u, p;
933
+ return ((l = m.config) == null ? void 0 : l.seo.slug) === "default" && ((p = (u = m.config) == null ? void 0 : u.responsive) == null ? void 0 : p.deviceType) === "mobile";
934
+ }
935
+ );
936
+ return /* @__PURE__ */ Q(G, { children: [
937
+ /* @__PURE__ */ I(
938
+ w.Column,
939
+ {
940
+ className: B.classNameConcat(
941
+ N["responsive-desktop-flex"],
942
+ qt["column-modifier"]
943
+ ),
944
+ style: {
945
+ minHeight: "100vh"
946
+ },
947
+ children: /* @__PURE__ */ I(
948
+ V,
949
+ {
950
+ data: i ?? d,
951
+ device: "desktop",
952
+ SectionZone: o,
953
+ COMMON_PAGE_COLUMN_GAP_PDC: r,
954
+ children: e
955
+ }
956
+ )
957
+ }
958
+ ),
959
+ /* @__PURE__ */ I(w.Column, { className: N["responsive-mobile-flex"], children: /* @__PURE__ */ I(
960
+ V,
961
+ {
962
+ data: c ?? g,
963
+ device: "mobile",
964
+ SectionZone: o,
965
+ COMMON_PAGE_COLUMN_GAP_PDC: r,
966
+ children: e
967
+ }
968
+ ) })
969
+ ] });
970
+ }, At = async ({
857
971
  ClientTipbarContent: e,
858
972
  ...t
859
973
  }) => {
860
- const { data: o } = await $({
974
+ const { data: o } = await F({
861
975
  contentType: "tipbar",
862
976
  ...t
863
977
  });
864
- return /* @__PURE__ */ C(e, { data: o });
865
- }, St = { CommonPageContent: Ft, HeaderContent: Ot, TipbarContent: $t }, tr = { Components: St }, Et = n.object({
978
+ return /* @__PURE__ */ I(e, { data: o });
979
+ }, kt = {
980
+ CommonPageContent: Ot,
981
+ HeaderContent: Et,
982
+ TipbarContent: At,
983
+ FooterContent: Tt,
984
+ PLPContent: Pt
985
+ }, ir = { Components: kt }, Nt = n.object({
866
986
  query: n.string()
867
987
  });
868
- async function Tt({ apiUrl: e, body: t, fetchOptions: o }) {
988
+ async function wt({ apiUrl: e, body: t, fetchOptions: o }) {
869
989
  if (!t) {
870
990
  console.error("[ERROR FETCHING] Body is required");
871
991
  return;
872
992
  }
873
- await Et.validate(t);
874
- const { query: r = "" } = t, s = new URLSearchParams({ query: r });
875
- return d(
876
- `${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
993
+ await Nt.validate(t);
994
+ const { query: r = "" } = t, a = new URLSearchParams({ query: r });
995
+ return f(
996
+ `${e}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${a.toString()}`,
877
997
  {
878
998
  ...o
879
999
  }
880
1000
  );
881
1001
  }
882
- const qt = (e, t) => me(e, t), At = (e) => ({
1002
+ const jt = (e, t) => ge(e, t), Dt = (e) => ({
883
1003
  ...e,
884
- description: e.description ? qt(e.description) : e.description
885
- }), Pt = ({
1004
+ description: e.description ? jt(e.description) : e.description
1005
+ }), Ht = ({
886
1006
  offer: e,
887
1007
  seller: t,
888
1008
  product: o
@@ -890,74 +1010,74 @@ const qt = (e, t) => me(e, t), At = (e) => ({
890
1010
  ...e,
891
1011
  product: o,
892
1012
  seller: t
893
- }), Q = (e, t) => ({
1013
+ }), W = (e, t) => ({
894
1014
  ...e,
895
- isVariantOf: At(t)
896
- }), Nt = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", T = (e) => e.AvailableQuantity > 0, U = (e) => e.spotPrice ?? 0, jt = (e) => e.Price ?? 0, J = (e, t) => T(e) && !T(t) ? -1 : !T(e) && T(t) ? 1 : U(e) - U(t), kt = (e, t) => {
1015
+ isVariantOf: Dt(t)
1016
+ }), _t = (e) => e ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", k = (e) => e.AvailableQuantity > 0, U = (e) => e.spotPrice ?? 0, Bt = (e) => e.Price ?? 0, X = (e, t) => k(e) && !k(t) ? -1 : !k(e) && k(t) ? 1 : U(e) - U(t), Gt = (e, t) => {
897
1017
  let o = 0;
898
1018
  for (let r = 1; r < e.length; r++)
899
1019
  t(e[o], e[r]) > 0 && (o = r);
900
1020
  return e[o];
901
- }, K = (e) => {
1021
+ }, Y = (e) => {
902
1022
  const t = e.flatMap(
903
- (r) => r.sellers.map((s) => ({
904
- offer: s.commertialOffer,
1023
+ (r) => r.sellers.map((a) => ({
1024
+ offer: a.commertialOffer,
905
1025
  sku: r
906
1026
  }))
907
- ), o = kt(
1027
+ ), o = Gt(
908
1028
  t,
909
- ({ offer: r }, { offer: s }) => J(r, s)
1029
+ ({ offer: r }, { offer: a }) => X(r, a)
910
1030
  );
911
1031
  return o ? o.sku : e[0];
912
- }, Y = (e) => e.map(
1032
+ }, Z = (e) => e.map(
913
1033
  ({ imageUrl: t, imageText: o, imageLabel: r }) => ({
914
1034
  alternateName: o ?? "",
915
1035
  url: t.replace("vteximg.com.br", "vtexassets.com"),
916
1036
  keywords: r
917
1037
  })
918
- ), q = {
1038
+ ), j = {
919
1039
  attachment: "ATTACHMENT",
920
1040
  specification: "SPECIFICATION",
921
1041
  attribute: "ATTRIBUTE"
922
- }, wt = (e) => ({
1042
+ }, Vt = (e) => ({
923
1043
  name: e.name,
924
1044
  value: e.content,
925
- valueReference: q.attachment
926
- }), Dt = (e) => ({
1045
+ valueReference: j.attachment
1046
+ }), Lt = (e) => ({
927
1047
  propertyID: e.id,
928
1048
  name: e.name,
929
1049
  value: e.value,
930
1050
  valueReference: {
931
- valueReference: q.attribute,
1051
+ valueReference: j.attribute,
932
1052
  visible: e.visible
933
1053
  }
934
- }), A = (e, t, o) => {
935
- const r = e.flatMap(({ name: i, values: c }) => c ? c.map((l) => ({
1054
+ }), D = (e, t, o) => {
1055
+ const r = e.flatMap(({ name: i, values: c }) => c ? c.map((d) => ({
936
1056
  name: i,
937
- value: l,
938
- valueReference: q.specification
1057
+ value: d,
1058
+ valueReference: j.specification
939
1059
  })) : {
940
1060
  name: i,
941
1061
  value: "",
942
- valueReference: q.specification
943
- }), s = Array.isArray(o) ? o.map(wt) : [], a = t ? t.map(Dt) : [];
1062
+ valueReference: j.specification
1063
+ }), a = Array.isArray(o) ? o.map(Vt) : [], s = t ? t.map(Lt) : [];
944
1064
  return [
945
1065
  ...r,
946
- ...s,
947
- ...a
1066
+ ...a,
1067
+ ...s
948
1068
  ];
949
- }, L = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", _t = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Gt = (e) => {
1069
+ }, M = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Ut = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Mt = (e) => {
950
1070
  let t = e.slice(0);
951
- for (let o = 0; o < L.length; o++)
1071
+ for (let o = 0; o < M.length; o++)
952
1072
  t = t.replace(
953
- new RegExp(L.charAt(o), "g"),
954
- _t.charAt(o)
1073
+ new RegExp(M.charAt(o), "g"),
1074
+ Ut.charAt(o)
955
1075
  );
956
1076
  return t;
957
- }, Ht = (e) => e.replace(/[·/_,:]/, "-"), W = (e) => {
1077
+ }, xt = (e) => e.replace(/[·/_,:]/, "-"), ee = (e) => {
958
1078
  const o = e.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
959
- return Ht(Gt(o)).toLowerCase();
960
- }, X = (e) => `/${e}/p`, Z = (e) => {
1079
+ return xt(Mt(o)).toLowerCase();
1080
+ }, te = (e) => `/${e}/p`, re = (e) => {
961
1081
  const t = Math.max(
962
1082
  ...e.map((r) => r.NumberOfInstallments)
963
1083
  ), o = e.find(
@@ -967,43 +1087,43 @@ const qt = (e, t) => me(e, t), At = (e) => ({
967
1087
  count: (o == null ? void 0 : o.NumberOfInstallments) ?? 0,
968
1088
  value: (o == null ? void 0 : o.Value) ?? 0
969
1089
  };
970
- }, ee = (e, t) => {
1090
+ }, oe = (e, t) => {
971
1091
  const o = {
972
1092
  price: 0,
973
1093
  listPrice: 0,
974
1094
  sellerDefault: !1
975
- }, s = e.map(
976
- (a) => Pt({
977
- offer: a.commertialOffer,
978
- seller: a,
1095
+ }, a = e.map(
1096
+ (s) => Ht({
1097
+ offer: s.commertialOffer,
1098
+ seller: s,
979
1099
  product: t
980
1100
  })
981
- ).sort(J).map((a) => (a.seller.sellerId === "1" && a.AvailableQuantity > 0 && (o.price = a.Price, o.listPrice = a.ListPrice, o.sellerDefault = !0), {
982
- availability: a.AvailableQuantity > 0,
983
- listPrice: a.ListPrice,
984
- price: jt(a),
985
- priceValidUntil: a.PriceValidUntil,
1101
+ ).sort(X).map((s) => (s.seller.sellerId === "1" && s.AvailableQuantity > 0 && (o.price = s.Price, o.listPrice = s.ListPrice, o.sellerDefault = !0), {
1102
+ availability: s.AvailableQuantity > 0,
1103
+ listPrice: s.ListPrice,
1104
+ price: Bt(s),
1105
+ priceValidUntil: s.PriceValidUntil,
986
1106
  priceCurrency: "BRL",
987
- installments: a.Installments,
988
- lowPrice: a.spotPrice,
989
- quantity: a.AvailableQuantity,
1107
+ installments: s.Installments,
1108
+ lowPrice: s.spotPrice,
1109
+ quantity: s.AvailableQuantity,
990
1110
  seller: {
991
- identifier: a.seller.sellerId
1111
+ identifier: s.seller.sellerId
992
1112
  }
993
1113
  }));
994
1114
  return {
995
- lowPrice: o.sellerDefault ? o.price : s[0].price,
996
- highPrice: o.sellerDefault ? o.listPrice : s[0].listPrice,
997
- offers: s
1115
+ lowPrice: o.sellerDefault ? o.price : a[0].price,
1116
+ highPrice: o.sellerDefault ? o.listPrice : a[0].listPrice,
1117
+ offers: a
998
1118
  };
999
- }, te = (e) => {
1000
- const { attributes: t, itemId: o, name: r, sellers: s, variations: a } = e;
1119
+ }, ne = (e) => {
1120
+ const { attributes: t, itemId: o, name: r, sellers: a, variations: s } = e;
1001
1121
  return {
1002
- additionalProperty: A(a, t, []),
1122
+ additionalProperty: D(s, t, []),
1003
1123
  name: r,
1004
1124
  offers: {
1005
- offers: s.map(({ sellerId: i, commertialOffer: c }) => ({
1006
- availability: Nt(c.AvailableQuantity > 0),
1125
+ offers: a.map(({ sellerId: i, commertialOffer: c }) => ({
1126
+ availability: _t(c.AvailableQuantity > 0),
1007
1127
  listPrice: c.ListPrice,
1008
1128
  price: c.Price,
1009
1129
  quantity: c.AvailableQuantity,
@@ -1015,193 +1135,193 @@ const qt = (e, t) => me(e, t), At = (e) => ({
1015
1135
  sku: o
1016
1136
  // slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
1017
1137
  };
1018
- }, Bt = (e) => {
1019
- var v;
1138
+ }, zt = (e) => {
1139
+ var q;
1020
1140
  const {
1021
1141
  attributes: t,
1022
1142
  referenceId: o,
1023
1143
  isVariantOf: r,
1024
- images: s,
1025
- itemId: a,
1144
+ images: a,
1145
+ itemId: s,
1026
1146
  name: i,
1027
1147
  sellers: c,
1028
- videos: l,
1148
+ videos: d,
1029
1149
  variations: g
1030
1150
  } = e, {
1031
- brand: p,
1032
- categories: u,
1033
- categoriesIds: m,
1034
- description: h,
1035
- linkText: f,
1036
- productClusters: P,
1037
- clusterHighlights: S,
1038
- productName: E,
1039
- properties: N,
1040
- productId: j
1041
- } = r, k = u.slice().reverse(), y = ee(c, e.isVariantOf), w = Z(y.offers[0].installments);
1151
+ brand: m,
1152
+ categories: l,
1153
+ categoriesIds: u,
1154
+ description: p,
1155
+ linkText: h,
1156
+ productClusters: $,
1157
+ clusterHighlights: C,
1158
+ productName: R,
1159
+ properties: S,
1160
+ productId: O
1161
+ } = r, T = l.slice().reverse(), b = oe(c, e.isVariantOf), H = re(b.offers[0].installments);
1042
1162
  return {
1043
- sku: a,
1044
- gtin: ((v = o[0]) == null ? void 0 : v.Value) ?? "",
1045
- name: E ?? i,
1046
- description: h,
1163
+ sku: s,
1164
+ gtin: ((q = o[0]) == null ? void 0 : q.Value) ?? "",
1165
+ name: R ?? i,
1166
+ description: p,
1047
1167
  releaseDate: r.releaseDate ?? "",
1048
- slug: f,
1049
- video: l[0],
1050
- categories: u,
1051
- categoriesIds: m,
1052
- id: j,
1053
- brand: { name: p, brandName: p },
1168
+ slug: h,
1169
+ video: d[0],
1170
+ categories: l,
1171
+ categoriesIds: u,
1172
+ id: O,
1173
+ brand: { name: m, brandName: m },
1054
1174
  seo: {
1055
- description: h,
1056
- title: E,
1057
- canonical: X(f)
1175
+ description: p,
1176
+ title: R,
1177
+ canonical: te(h)
1058
1178
  },
1059
1179
  cluster: {
1060
- generals: P,
1061
- highlights: S
1180
+ generals: $,
1181
+ highlights: C
1062
1182
  },
1063
- properties: N,
1064
- availability: { status: y.offers[0].availability },
1183
+ properties: S,
1184
+ availability: { status: b.offers[0].availability },
1065
1185
  breadcrumbList: {
1066
1186
  itemListElement: [
1067
- ...k.map((I, F) => {
1068
- const b = I.split("/"), R = b[b.length - 2], D = b.map(W).join("/");
1187
+ ...T.map((y, P) => {
1188
+ const v = y.split("/"), E = v[v.length - 2], _ = v.map(ee).join("/");
1069
1189
  return {
1070
- name: R,
1071
- item: D,
1072
- position: F + 1
1190
+ name: E,
1191
+ item: _,
1192
+ position: P + 1
1073
1193
  };
1074
1194
  }),
1075
1195
  {
1076
1196
  name: r.productName,
1077
- item: f,
1078
- position: u.length + 1
1197
+ item: h,
1198
+ position: l.length + 1
1079
1199
  }
1080
1200
  ],
1081
- numberOfItems: u.length
1201
+ numberOfItems: l.length
1082
1202
  },
1083
- image: Y(s),
1084
- offers: y,
1085
- additionalProperty: A(g, t, []),
1203
+ image: Z(a),
1204
+ offers: b,
1205
+ additionalProperty: D(g, t, []),
1086
1206
  isVariantOf: {
1087
1207
  productGroupID: r.productId,
1088
- hasVariant: r.items.map((I) => te(I))
1208
+ hasVariant: r.items.map((y) => ne(y))
1089
1209
  },
1090
- installments: w
1210
+ installments: H
1091
1211
  };
1092
- }, Ut = (e) => {
1093
- var v;
1212
+ }, Qt = (e) => {
1213
+ var q;
1094
1214
  const {
1095
1215
  attributes: t,
1096
1216
  referenceId: o,
1097
1217
  isVariantOf: r,
1098
- images: s,
1099
- itemId: a,
1218
+ images: a,
1219
+ itemId: s,
1100
1220
  name: i,
1101
1221
  sellers: c,
1102
- Videos: l,
1222
+ Videos: d,
1103
1223
  variations: g
1104
1224
  } = e, {
1105
- brand: p,
1106
- categories: u,
1107
- categoriesIds: m,
1108
- description: h,
1109
- linkText: f,
1110
- productClusters: P,
1111
- productName: S,
1112
- Coleção: E,
1113
- "ID Coleção": N,
1114
- productId: j
1115
- } = r, k = u.slice().reverse(), y = ee(c, e.isVariantOf), w = Z(y.offers[0].installments);
1225
+ brand: m,
1226
+ categories: l,
1227
+ categoriesIds: u,
1228
+ description: p,
1229
+ linkText: h,
1230
+ productClusters: $,
1231
+ productName: C,
1232
+ Coleção: R,
1233
+ "ID Coleção": S,
1234
+ productId: O
1235
+ } = r, T = l.slice().reverse(), b = oe(c, e.isVariantOf), H = re(b.offers[0].installments);
1116
1236
  return {
1117
- sku: a,
1118
- gtin: ((v = o[0]) == null ? void 0 : v.Value) ?? "",
1119
- name: S ?? i,
1120
- description: h,
1237
+ sku: s,
1238
+ gtin: ((q = o[0]) == null ? void 0 : q.Value) ?? "",
1239
+ name: C ?? i,
1240
+ description: p,
1121
1241
  releaseDate: r.releaseDate ?? "",
1122
- slug: f,
1123
- video: l[0],
1124
- categories: u,
1125
- categoriesIds: m,
1126
- collection: E,
1127
- collectionId: N,
1128
- id: j,
1129
- brand: { name: p, brandName: p },
1242
+ slug: h,
1243
+ video: d[0],
1244
+ categories: l,
1245
+ categoriesIds: u,
1246
+ collection: R,
1247
+ collectionId: S,
1248
+ id: O,
1249
+ brand: { name: m, brandName: m },
1130
1250
  seo: {
1131
- description: h,
1132
- title: S,
1133
- canonical: X(f)
1251
+ description: p,
1252
+ title: C,
1253
+ canonical: te(h)
1134
1254
  },
1135
1255
  cluster: {
1136
- generals: P,
1256
+ generals: $,
1137
1257
  highlights: []
1138
1258
  // TODO: add highlights
1139
1259
  },
1140
- availability: { status: y.offers[0].availability },
1260
+ availability: { status: b.offers[0].availability },
1141
1261
  breadcrumbList: {
1142
1262
  itemListElement: [
1143
- ...k.map((I, F) => {
1144
- const b = I.split("/"), R = b[b.length - 2], D = b.map(W).join("/");
1263
+ ...T.map((y, P) => {
1264
+ const v = y.split("/"), E = v[v.length - 2], _ = v.map(ee).join("/");
1145
1265
  return {
1146
- name: R,
1147
- item: D,
1148
- position: F + 1
1266
+ name: E,
1267
+ item: _,
1268
+ position: P + 1
1149
1269
  };
1150
1270
  }),
1151
1271
  {
1152
1272
  name: r.productName,
1153
- item: f,
1154
- position: u.length + 1
1273
+ item: h,
1274
+ position: l.length + 1
1155
1275
  }
1156
1276
  ],
1157
- numberOfItems: u.length
1277
+ numberOfItems: l.length
1158
1278
  },
1159
- image: Y(s),
1160
- offers: y,
1161
- additionalProperty: A(g, t, []),
1279
+ image: Z(a),
1280
+ offers: b,
1281
+ additionalProperty: D(g, t, []),
1162
1282
  isVariantOf: {
1163
1283
  productGroupID: r.productId,
1164
- hasVariant: r.items.map((I) => {
1165
- const { variations: F } = I, b = F.map((R) => ({
1166
- name: R,
1167
- values: I[R]
1284
+ hasVariant: r.items.map((y) => {
1285
+ const { variations: P } = y, v = P.map((E) => ({
1286
+ name: E,
1287
+ values: y[E]
1168
1288
  }));
1169
1289
  return {
1170
- ...te(I),
1171
- additionalProperty: A(
1172
- b,
1290
+ ...ne(y),
1291
+ additionalProperty: D(
1292
+ v,
1173
1293
  t,
1174
1294
  []
1175
1295
  )
1176
1296
  };
1177
1297
  })
1178
1298
  },
1179
- installments: w
1299
+ installments: H
1180
1300
  };
1181
- }, Lt = n.array().of(n.object({
1301
+ }, Jt = n.array().of(n.object({
1182
1302
  key: n.string().required(),
1183
1303
  value: n.string().required()
1184
1304
  })).required("Facets are required");
1185
- async function Vt({ apiUrl: e, body: t, fetchOptions: o }) {
1305
+ async function Kt({ apiUrl: e, body: t, fetchOptions: o }) {
1186
1306
  if (!t) {
1187
1307
  console.error("[ERROR FETCHING] Body is required");
1188
1308
  return;
1189
1309
  }
1190
- await Lt.validate(t);
1191
- const r = new URLSearchParams({}), s = t.map(({ key: i, value: c }) => `${i}/${c}`).join("/");
1192
- ne(t, r);
1193
- const a = `${e}/api/catalog_system/pub/products/crossselling/${s}`;
1194
- return d(a, {
1310
+ await Jt.validate(t);
1311
+ const r = new URLSearchParams({}), a = t.map(({ key: i, value: c }) => `${i}/${c}`).join("/");
1312
+ le(t, r);
1313
+ const s = `${e}/api/catalog_system/pub/products/crossselling/${a}`;
1314
+ return f(s, {
1195
1315
  cache: "no-store",
1196
1316
  ...o
1197
- }).then((i) => i.map((l) => {
1198
- const g = K(l.items);
1199
- return g && Q(g, l);
1200
- }).filter((l) => !!l).map((l) => ({
1201
- node: Ut(l)
1317
+ }).then((i) => i.map((d) => {
1318
+ const g = Y(d.items);
1319
+ return g && W(g, d);
1320
+ }).filter((d) => !!d).map((d) => ({
1321
+ node: Qt(d)
1202
1322
  })));
1203
1323
  }
1204
- const re = ({
1324
+ const se = ({
1205
1325
  apiUrl: e,
1206
1326
  body: t,
1207
1327
  fetchOptions: o,
@@ -1212,25 +1332,25 @@ const re = ({
1212
1332
  return;
1213
1333
  }
1214
1334
  const {
1215
- query: s = "",
1216
- page: a = 1,
1335
+ query: a = "",
1336
+ page: s = 1,
1217
1337
  count: i,
1218
1338
  sort: c = "",
1219
- facets: l = [],
1339
+ facets: d = [],
1220
1340
  type: g,
1221
- hideUnavailableItems: p = !0,
1222
- locale: u = ""
1223
- } = t, m = new URLSearchParams({
1224
- page: a.toString(),
1341
+ hideUnavailableItems: m = !0,
1342
+ locale: l = ""
1343
+ } = t, u = new URLSearchParams({
1344
+ page: s.toString(),
1225
1345
  count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
1226
- query: s,
1346
+ query: a,
1227
1347
  sort: c,
1228
- locale: u
1348
+ locale: l
1229
1349
  });
1230
- p !== void 0 && m.append("hideUnavailableItems", p.toString());
1231
- const h = l.map((f) => `${f.key}/${f.value}`).join("/") ?? "";
1232
- return pe(
1233
- `${e}/api/io/_v/api/intelligent-search/${g}/${h}?${m.toString()}`,
1350
+ m !== void 0 && u.append("hideUnavailableItems", m.toString());
1351
+ const p = d.map((h) => `${h.key}/${h.value}`).join("/") ?? "";
1352
+ return he(
1353
+ `${e}/api/io/_v/api/intelligent-search/${g}/${p}?${u.toString()}`,
1234
1354
  {
1235
1355
  headers: {
1236
1356
  Accept: "application/json",
@@ -1240,48 +1360,48 @@ const re = ({
1240
1360
  }
1241
1361
  );
1242
1362
  };
1243
- async function Mt({ body: e, extraData: t, ...o }) {
1363
+ async function Wt({ body: e, extraData: t, ...o }) {
1244
1364
  if (!e) {
1245
1365
  console.error("[ERROR FETCHING] Body is required");
1246
1366
  return;
1247
1367
  }
1248
- const r = await re({
1368
+ const r = await se({
1249
1369
  body: {
1250
1370
  ...e,
1251
1371
  type: "product_search"
1252
1372
  },
1253
1373
  extraData: t,
1254
1374
  ...o
1255
- }), s = (r == null ? void 0 : r.products.map((c) => {
1256
- const l = K(c.items);
1257
- return l && Q(l, c);
1375
+ }), a = (r == null ? void 0 : r.products.map((c) => {
1376
+ const d = Y(c.items);
1377
+ return d && W(d, c);
1258
1378
  }).filter((c) => !!c)) ?? [], {
1259
- pagination: a,
1379
+ pagination: s,
1260
1380
  recordsFiltered: i
1261
1381
  } = r;
1262
1382
  return {
1263
1383
  data: {
1264
1384
  pagination: {
1265
- nextPage: a.after.length > 0,
1266
- previousPage: a.before.length > 0,
1385
+ nextPage: s.after.length > 0,
1386
+ previousPage: s.before.length > 0,
1267
1387
  startCursor: "0",
1268
1388
  endCursor: i.toString(),
1269
1389
  count: i,
1270
- total: a.count
1390
+ total: s.count
1271
1391
  },
1272
- products: s.map((c, l) => ({
1273
- node: Bt(c),
1274
- cursor: l.toString()
1392
+ products: a.map((c, d) => ({
1393
+ node: zt(c),
1394
+ cursor: d.toString()
1275
1395
  }))
1276
1396
  }
1277
1397
  };
1278
1398
  }
1279
- async function xt({ body: e, extraData: t, ...o }) {
1399
+ async function Xt({ body: e, extraData: t, ...o }) {
1280
1400
  if (!e) {
1281
1401
  console.error("[ERROR FETCHING] Body is required");
1282
1402
  return;
1283
1403
  }
1284
- const r = await re({
1404
+ const r = await se({
1285
1405
  body: {
1286
1406
  ...e,
1287
1407
  type: "facets"
@@ -1292,55 +1412,55 @@ async function xt({ body: e, extraData: t, ...o }) {
1292
1412
  return !r || !r.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
1293
1413
  data: {
1294
1414
  ...r,
1295
- facets: se(r, e == null ? void 0 : e.selectedFacets, (e == null ? void 0 : e.query) ?? "")
1415
+ facets: ue(r, e == null ? void 0 : e.selectedFacets, (e == null ? void 0 : e.query) ?? "")
1296
1416
  }
1297
1417
  };
1298
1418
  }
1299
- const zt = n.object({
1419
+ const Yt = n.object({
1300
1420
  query: n.string().optional(),
1301
1421
  locale: n.string().optional()
1302
1422
  });
1303
- async function Qt({ apiUrl: e, body: t, fetchOptions: o }) {
1423
+ async function Zt({ apiUrl: e, body: t, fetchOptions: o }) {
1304
1424
  if (!t) {
1305
1425
  console.error("[ERROR FETCHING] Body is required");
1306
1426
  return;
1307
1427
  }
1308
- await zt.validate(t);
1309
- const { query: r = "", locale: s = "default_locale" } = t, a = new URLSearchParams({ query: r, locale: s });
1310
- return d(
1311
- `${e}/api/io/_v/api/intelligent-search/search_suggestions?${a.toString()}`,
1428
+ await Yt.validate(t);
1429
+ const { query: r = "", locale: a = "default_locale" } = t, s = new URLSearchParams({ query: r, locale: a });
1430
+ return f(
1431
+ `${e}/api/io/_v/api/intelligent-search/search_suggestions?${s.toString()}`,
1312
1432
  {
1313
1433
  ...o
1314
1434
  }
1315
1435
  );
1316
1436
  }
1317
- async function Jt({ apiUrl: e }) {
1318
- return d(`${e}/api/io/_v/api/intelligent-search/top_searches`);
1437
+ async function er({ apiUrl: e }) {
1438
+ return f(`${e}/api/io/_v/api/intelligent-search/top_searches`);
1319
1439
  }
1320
- const Kt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1440
+ const tr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1321
1441
  __proto__: null,
1322
- getSearchAutoCompleteSuggestions: Tt,
1323
- getSearchCrossellingProducts: Vt,
1324
- getSearchFacets: xt,
1325
- getSearchProducts: Mt,
1326
- getSearchSuggestedTerms: Qt,
1327
- getSearchTopSearchs: Jt
1328
- }, Symbol.toStringTag, { value: "Module" })), Yt = {
1329
- parseSearchState: le,
1330
- convertSearchParams: ce,
1331
- filterNonRootFacets: ie,
1332
- filterNonCategorySelected: ae
1333
- }, rr = {
1334
- checkout: Ze,
1335
- catalog: at,
1336
- cms: Rt,
1337
- search: Kt
1338
- }, or = {
1339
- catalog: ht,
1340
- search: Yt
1442
+ getSearchAutoCompleteSuggestions: wt,
1443
+ getSearchCrossellingProducts: Kt,
1444
+ getSearchFacets: Xt,
1445
+ getSearchProducts: Wt,
1446
+ getSearchSuggestedTerms: Zt,
1447
+ getSearchTopSearchs: er
1448
+ }, Symbol.toStringTag, { value: "Module" })), rr = {
1449
+ parseSearchState: fe,
1450
+ convertSearchParams: pe,
1451
+ filterNonRootFacets: me,
1452
+ filterNonCategorySelected: de
1453
+ }, cr = {
1454
+ checkout: rt,
1455
+ catalog: lt,
1456
+ cms: $t,
1457
+ search: tr
1458
+ }, lr = {
1459
+ catalog: yt,
1460
+ search: rr
1341
1461
  };
1342
1462
  export {
1343
- rr as serverAPIs,
1344
- tr as serverCMS,
1345
- or as serverHelpers
1463
+ cr as serverAPIs,
1464
+ ir as serverCMS,
1465
+ lr as serverHelpers
1346
1466
  };