@soma-vertical-web/multi-lib 1.0.16 → 1.0.18

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.
Files changed (34) hide show
  1. package/cms/ContentTypes/LPLojas/LPLojaClientWrapper.d.ts +1 -1
  2. package/cms/ContentTypes/LPLojas/typing.d.ts +1 -0
  3. package/cms/index.d.ts +1 -1
  4. package/contexts/contexts/plp/FilterContext.d.ts +1 -1
  5. package/contexts/contexts/plp/PLPContext.d.ts +1 -1
  6. package/contexts/contexts/search/Facets.d.ts +1 -1
  7. package/contexts/contexts/search/QueryFacets.d.ts +5 -0
  8. package/contexts/contexts/search/QueryProducts.d.ts +5 -0
  9. package/contexts/contexts/search/RootTank.d.ts +9 -0
  10. package/contexts/contexts/search/Search.d.ts +1 -1
  11. package/contexts/index.d.ts +4 -4
  12. package/data/helpers/plp/index.d.ts +2 -2
  13. package/data/helpers/search/facets.d.ts +1 -0
  14. package/data/helpers/search/index.d.ts +4 -0
  15. package/data/helpers/search/search.d.ts +1 -0
  16. package/data/index.d.ts +2 -0
  17. package/index-BlwJMBFA.mjs +1890 -0
  18. package/index-dtcYsqh-.js +4 -0
  19. package/index.js +16 -16
  20. package/index.mjs +10382 -8224
  21. package/index2.js +1 -1
  22. package/index2.mjs +631 -678
  23. package/layout/index.d.ts +2 -2
  24. package/layout/template/PDC/Composite/Pagination/Pagination.d.ts +1 -1
  25. package/layout/template/PDC/PDC.d.ts +1 -1
  26. package/layout/template/PDC/index.d.ts +1 -1
  27. package/layout/template/SearchResult/Composite/Products.d.ts +7 -0
  28. package/package.json +1 -1
  29. package/server.d.ts +4 -0
  30. package/style.css +1 -1
  31. package/types/contexts/contexts/plp.d.ts +42 -8
  32. package/types/contexts/contexts/search.d.ts +28 -16
  33. package/types/layout/team-components/PLPNavigation/index.d.ts +0 -2
  34. package/types/layout/templates/PLP/index.d.ts +2 -2
package/index2.mjs CHANGED
@@ -1,65 +1,65 @@
1
1
  import { jsx as b, jsxs as N, Fragment as B } from "react/jsx-runtime";
2
- import { x as S, r as j, S as ce, y as le, z as ue, a as de, v as pe, t as me, A as fe, p as ge, o as M, B as he, C as ye, D as be, e as Ie } from "./index-Dj1bg0lu.mjs";
2
+ import { z as S, r as j, S as ce, A as le, B as ue, a as de, q as M, C as me, D as pe, E as fe, p as ge, F as he } from "./index-BlwJMBFA.mjs";
3
3
  import { Utils as D, helpers as _ } from "@soma-vertical-web/core-components";
4
4
  import * as a from "yup";
5
- import Ce from "sanitize-html";
6
- const Re = async ({
5
+ import ye from "sanitize-html";
6
+ const be = async ({
7
7
  children: t,
8
8
  ClientCartProvider: e,
9
- ...r
9
+ ...n
10
10
  }) => {
11
- const { data: n } = await S(
11
+ const { data: r } = await S(
12
12
  "mini_cart",
13
- r
13
+ n
14
14
  );
15
- return /* @__PURE__ */ b(e, { ...n ? Array.isArray(n) ? { data: n[0] } : { data: n } : {}, children: t });
16
- }, ve = ({
15
+ return /* @__PURE__ */ b(e, { ...r ? Array.isArray(r) ? { data: r[0] } : { data: r } : {}, children: t });
16
+ }, Ie = ({
17
17
  slug: t,
18
18
  data: e,
19
- SectionZone: r,
20
- COMMON_PAGE_COLUMN_GAP: n,
19
+ SectionZone: n,
20
+ COMMON_PAGE_COLUMN_GAP: r,
21
21
  identifyWhoIsFirst: s
22
22
  }) => {
23
23
  const o = e == null ? void 0 : e.find(
24
24
  (d) => {
25
- var I, f, m, y;
26
- return ((f = (I = d.config) == null ? void 0 : I.responsive) == null ? void 0 : f.deviceType) === "desktop" && ((y = (m = d.config) == null ? void 0 : m.seo) == null ? void 0 : y.slug) === t;
25
+ var C, f, p, y;
26
+ return ((f = (C = d.config) == null ? void 0 : C.responsive) == null ? void 0 : f.deviceType) === "desktop" && ((y = (p = d.config) == null ? void 0 : p.seo) == null ? void 0 : y.slug) === t;
27
27
  }
28
- ), i = o == null ? void 0 : o.config.responsive.gapCustom, u = o == null ? void 0 : o.config.responsive.gapSections, c = e == null ? void 0 : e.find(
28
+ ), i = o == null ? void 0 : o.config.responsive.gapCustom, l = o == null ? void 0 : o.config.responsive.gapSections, c = e == null ? void 0 : e.find(
29
29
  (d) => {
30
- var I, f, m, y;
31
- return ((f = (I = d.config) == null ? void 0 : I.responsive) == null ? void 0 : f.deviceType) === "mobile" && ((y = (m = d.config) == null ? void 0 : m.seo) == null ? void 0 : y.slug) === t;
30
+ var C, f, p, y;
31
+ return ((f = (C = d.config) == null ? void 0 : C.responsive) == null ? void 0 : f.deviceType) === "mobile" && ((y = (p = d.config) == null ? void 0 : p.seo) == null ? void 0 : y.slug) === t;
32
32
  }
33
- ), p = c == null ? void 0 : c.config.responsive.gapCustom, l = c == null ? void 0 : c.config.responsive.gapSections;
33
+ ), m = c == null ? void 0 : c.config.responsive.gapCustom, u = c == null ? void 0 : c.config.responsive.gapSections;
34
34
  return /* @__PURE__ */ N(B, { children: [
35
35
  /* @__PURE__ */ b(
36
36
  D.Column,
37
37
  {
38
- gap: i && u ? u : n,
38
+ gap: i && l ? l : r,
39
39
  className: _.classNameConcat(
40
40
  j["responsive-desktop-flex"],
41
41
  "utils-column-modifier"
42
42
  ),
43
- children: /* @__PURE__ */ b(r, { data: (o == null ? void 0 : o.sections) ?? [], identifyWhoIsFirst: s })
43
+ children: /* @__PURE__ */ b(n, { data: (o == null ? void 0 : o.sections) ?? [], identifyWhoIsFirst: s })
44
44
  }
45
45
  ),
46
46
  /* @__PURE__ */ b(
47
47
  D.Column,
48
48
  {
49
- gap: p && l ? l : n,
49
+ gap: m && u ? u : r,
50
50
  className: _.classNameConcat(
51
51
  j["responsive-mobile-flex"],
52
52
  "utils-column-modifier"
53
53
  ),
54
- children: /* @__PURE__ */ b(r, { data: (c == null ? void 0 : c.sections) ?? [], identifyWhoIsFirst: s })
54
+ children: /* @__PURE__ */ b(n, { data: (c == null ? void 0 : c.sections) ?? [], identifyWhoIsFirst: s })
55
55
  }
56
56
  )
57
57
  ] });
58
- }, Se = async ({
58
+ }, Ce = async ({
59
59
  slug: t,
60
60
  SectionZone: e,
61
- COMMON_PAGE_COLUMN_GAP: r,
62
- identifyWhoIsFirst: n = !1,
61
+ COMMON_PAGE_COLUMN_GAP: n,
62
+ identifyWhoIsFirst: r = !1,
63
63
  ...s
64
64
  }) => {
65
65
  const { data: o } = await S(
@@ -67,43 +67,43 @@ const Re = async ({
67
67
  s
68
68
  );
69
69
  return !o || !Array.isArray(o) || o.length === 0 ? null : /* @__PURE__ */ b(
70
- ve,
70
+ Ie,
71
71
  {
72
72
  data: o,
73
73
  slug: t,
74
74
  SectionZone: e,
75
- COMMON_PAGE_COLUMN_GAP: r,
76
- identifyWhoIsFirst: n
75
+ COMMON_PAGE_COLUMN_GAP: n,
76
+ identifyWhoIsFirst: r
77
77
  }
78
78
  );
79
- }, Ee = async ({
79
+ }, Re = async ({
80
80
  children: t,
81
81
  ClientFlagsAndTagsProvider: e,
82
- ...r
82
+ ...n
83
83
  }) => {
84
- const { data: n } = await S(
84
+ const { data: r } = await S(
85
85
  "flags_and_tags",
86
- r
86
+ n
87
87
  );
88
- return !n || !Array.isArray(n) ? null : /* @__PURE__ */ b(e, { data: n[0], children: t });
89
- }, Te = async ({
88
+ return !r || !Array.isArray(r) ? null : /* @__PURE__ */ b(e, { data: r[0], children: t });
89
+ }, ve = async ({
90
90
  className: t,
91
91
  PAYMENT_FLAGS_DICTIONARY: e,
92
- PAYMENT_FLAGS: r,
93
- LEGAL_INFORMATION_TEXT: n,
92
+ PAYMENT_FLAGS: n,
93
+ LEGAL_INFORMATION_TEXT: r,
94
94
  ICONS: s,
95
95
  SectionZone: o,
96
96
  Footer: i,
97
- FooterSupport: u,
97
+ FooterSupport: l,
98
98
  hasFooterStamps: c,
99
- ...p
99
+ ...m
100
100
  }) => {
101
- var f, m, y, C, F, O, $, g, E, R, T;
102
- const { data: l } = await S("footer", p), d = Array.isArray(l) && ((f = l[0]) == null ? void 0 : f.type) === "footer" ? l[0] : null, I = {
103
- ...(m = d == null ? void 0 : d.paymentInfo) == null ? void 0 : m.paymentInfo,
101
+ var f, p, y, I, F, O, $, g, E, R, T;
102
+ const { data: u } = await S("footer", m), d = Array.isArray(u) && ((f = u[0]) == null ? void 0 : f.type) === "footer" ? u[0] : null, C = {
103
+ ...(p = d == null ? void 0 : d.paymentInfo) == null ? void 0 : p.paymentInfo,
104
104
  acceptedFlags: Array.isArray(
105
105
  (y = d == null ? void 0 : d.paymentInfo) == null ? void 0 : y.paymentInfo.acceptedFlags
106
- ) ? (C = d == null ? void 0 : d.paymentInfo) == null ? void 0 : C.paymentInfo.acceptedFlags.filter((v) => !!e[v]).map(
106
+ ) ? (I = d == null ? void 0 : d.paymentInfo) == null ? void 0 : I.paymentInfo.acceptedFlags.filter((v) => !!e[v]).map(
107
107
  (v) => e[v]
108
108
  ) : []
109
109
  };
@@ -114,17 +114,17 @@ const Re = async ({
114
114
  data: { ...d },
115
115
  socialInfo: (F = d.socialMedia) == null ? void 0 : F.socialMedia,
116
116
  socialMedias: ($ = (O = d.socialMedia) == null ? void 0 : O.socialMedia) == null ? void 0 : $.medias,
117
- payments: I,
117
+ payments: C,
118
118
  hasFooterStamps: c,
119
119
  adornment: {
120
120
  ...(E = (g = d.supportInfo) == null ? void 0 : g.supportInfo) != null && E.content ? {
121
121
  bottom: /* @__PURE__ */ b(
122
- u,
122
+ l,
123
123
  {
124
124
  content: (T = (R = d.supportInfo) == null ? void 0 : R.supportInfo) == null ? void 0 : T.content,
125
125
  CONSTANTS: {
126
126
  ICONS: s,
127
- PAYMENT_FLAGS: r,
127
+ PAYMENT_FLAGS: n,
128
128
  PAYMENT_FLAGS_DICTIONARY: e
129
129
  }
130
130
  }
@@ -132,45 +132,45 @@ const Re = async ({
132
132
  } : {},
133
133
  ...d.sections.length ? { top: /* @__PURE__ */ b(o, { data: d.sections }) } : {}
134
134
  },
135
- LEGAL_INFORMATION_TEXT: n,
135
+ LEGAL_INFORMATION_TEXT: r,
136
136
  ICONS: s
137
137
  }
138
138
  ) : null;
139
- }, Fe = async ({
139
+ }, Se = async ({
140
140
  children: t,
141
141
  ClientHeaderProvider: e,
142
- ...r
142
+ ...n
143
143
  }) => {
144
- var o, i, u, c, p, l;
145
- const { data: n } = await S(
144
+ var o, i, l, c, m, u;
145
+ const { data: r } = await S(
146
146
  "header",
147
- r
148
- ), s = Array.isArray(n) ? n[0] : void 0;
147
+ n
148
+ ), s = Array.isArray(r) ? r[0] : void 0;
149
149
  return /* @__PURE__ */ b(
150
150
  e,
151
151
  {
152
152
  headerData: {
153
153
  ...((o = s == null ? void 0 : s.layerConfig) == null ? void 0 : o.config) ?? {},
154
154
  subMenus: ((i = s == null ? void 0 : s.sections) == null ? void 0 : i.map((d) => d.data)) ?? [],
155
- categories: ((c = (u = s == null ? void 0 : s.categories) == null ? void 0 : u.categories) == null ? void 0 : c.items) ?? [],
156
- navigationLinks: ((l = (p = s == null ? void 0 : s.navigationLinks) == null ? void 0 : p.navigationLinks) == null ? void 0 : l.items) ?? []
155
+ categories: ((c = (l = s == null ? void 0 : s.categories) == null ? void 0 : l.categories) == null ? void 0 : c.items) ?? [],
156
+ navigationLinks: ((u = (m = s == null ? void 0 : s.navigationLinks) == null ? void 0 : m.navigationLinks) == null ? void 0 : u.items) ?? []
157
157
  },
158
158
  children: t
159
159
  }
160
160
  );
161
- }, Oe = (t) => {
162
- var i, u;
163
- const e = (u = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : u.items;
161
+ }, Ee = (t) => {
162
+ var i, l;
163
+ const e = (l = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : l.items;
164
164
  if ((e == null ? void 0 : e.items.length) === 0 || t.length === 0)
165
165
  return {
166
166
  iconLabel: "",
167
167
  label: "",
168
168
  content: []
169
169
  };
170
- const r = e == null ? void 0 : e.iconLabel, n = e == null ? void 0 : e.label, s = e == null ? void 0 : e.helpButtonSize, o = e.items.map(
171
- (c, p) => ({
170
+ const n = e == null ? void 0 : e.iconLabel, r = e == null ? void 0 : e.label, s = e == null ? void 0 : e.helpButtonSize, o = e.items.map(
171
+ (c, m) => ({
172
172
  type: c.type,
173
- id: `${p.toString()}-${c.title.toLowerCase()}`,
173
+ id: `${m.toString()}-${c.title.toLowerCase()}`,
174
174
  title: c.title,
175
175
  subtitle: c.subtitle,
176
176
  description: c.description,
@@ -182,117 +182,75 @@ const Re = async ({
182
182
  })
183
183
  );
184
184
  return {
185
- iconLabel: r,
186
- label: n,
185
+ iconLabel: n,
186
+ label: r,
187
187
  helpButtonSize: s,
188
188
  content: o
189
189
  };
190
- }, $e = async ({
190
+ }, Te = async ({
191
191
  HelpButton: t,
192
192
  ICONS: e,
193
- className: r,
194
- ...n
193
+ className: n,
194
+ ...r
195
195
  }) => {
196
196
  const { data: s } = await S(
197
197
  "helpbutton",
198
- n
198
+ r
199
199
  );
200
200
  if (!s || !Array.isArray(s) || s.length === 0)
201
201
  return null;
202
- const o = Oe(s);
202
+ const o = Ee(s);
203
203
  return /* @__PURE__ */ b(
204
204
  t,
205
205
  {
206
206
  data: o,
207
207
  ICONS: e,
208
- className: r
208
+ className: n
209
209
  }
210
210
  );
211
- }, Ae = async ({
211
+ }, Fe = async ({
212
212
  SectionZone: t,
213
213
  LPCadastro: e,
214
- ...r
214
+ ...n
215
215
  }) => {
216
216
  var c;
217
- const { data: n } = await S(
217
+ const { data: r } = await S(
218
218
  "lp_cadastro",
219
- r
219
+ n
220
220
  );
221
- if (!n || !Array.isArray(n) || n.length === 0)
221
+ if (!r || !Array.isArray(r) || r.length === 0)
222
222
  return null;
223
- const [s] = n, o = (s == null ? void 0 : s.sections) || [], i = ((c = s == null ? void 0 : s.content) == null ? void 0 : c.conteúdo) || {}, u = s == null ? void 0 : s.sections;
223
+ const [s] = r, o = (s == null ? void 0 : s.sections) || [], i = ((c = s == null ? void 0 : s.content) == null ? void 0 : c.conteúdo) || {}, l = s == null ? void 0 : s.sections;
224
224
  return /* @__PURE__ */ N(B, { children: [
225
225
  /* @__PURE__ */ b(e, { sections: o, content: i }),
226
- /* @__PURE__ */ b(t, { data: u })
226
+ /* @__PURE__ */ b(t, { data: l })
227
227
  ] });
228
- }, qe = (t) => {
229
- const e = Ne(we(t));
230
- return Pe(e);
231
- }, Pe = (t) => {
232
- const e = [];
233
- for (const r in t)
234
- e.push(...t[r]);
235
- return e;
236
- }, we = (t) => !t || !Array.isArray(t) ? {} : t == null ? void 0 : t.reduce((e, r) => {
237
- if (r != null && r.cidade) {
238
- let n = e[r == null ? void 0 : r.cidade];
239
- n === void 0 && (n = e[r == null ? void 0 : r.cidade] = []), n.push(r);
240
- }
241
- return e;
242
- }, {}), Ne = (t) => {
243
- if (!t || !Object.keys(t).length)
244
- return {};
245
- const e = Object.keys(t).sort((n, s) => n.localeCompare(s)), r = {};
246
- for (const n of e)
247
- r[n] = t[n];
248
- return r;
249
- }, ke = async ({
228
+ }, Oe = async ({
250
229
  LPLOJAS_TEMPLATE_RETURN_BUTTON: t,
251
230
  ICONS: e,
252
- entity: r,
253
- showVendor: n,
231
+ entity: n,
232
+ showVendor: r,
254
233
  LPStoresClientWrapper: s,
255
234
  ...o
256
235
  }) => {
257
- var I;
258
- const { data: i } = await S("lp_lojas", o), u = Array.isArray(i) ? i : [], c = process.env.NEXT_PUBLIC_SITE_URL || "http://localhost:3000", p = await fetch(`${c}/api/master-data/search`, {
259
- method: "POST",
260
- headers: {
261
- "Content-Type": "application/json"
262
- },
263
- body: JSON.stringify({
264
- masterDataEntity: r,
265
- searchFields: {
266
- _fields: "_all"
267
- },
268
- headers: {
269
- "REST-Range": "resources=0-1000"
270
- }
271
- })
272
- });
273
- if (!p.ok)
274
- throw new Error(
275
- `[LPLojasContent] MasterData error ${p.status}`
276
- );
277
- const l = await p.json();
278
- console.log("Quantidade de lojas:", l.length);
279
- const d = (I = u[0]) == null ? void 0 : I.config.config;
236
+ var m;
237
+ const { data: i } = await S("lp_lojas", o), c = (m = (Array.isArray(i) ? i : [])[0]) == null ? void 0 : m.config.config;
280
238
  return /* @__PURE__ */ b(
281
239
  s,
282
240
  {
283
- stores: qe(l),
284
- content: d,
241
+ entity: n,
242
+ content: c,
285
243
  data: i,
286
- showVendor: n,
244
+ showVendor: r,
287
245
  ICONS: e,
288
246
  LPLOJAS_TEMPLATE_RETURN_BUTTON: t
289
247
  }
290
248
  );
291
- }, je = async ({
249
+ }, $e = async ({
292
250
  children: t,
293
251
  productId: e,
294
- COMMON_PAGE_COLUMN_GAP: r,
295
- SectionZone: n,
252
+ COMMON_PAGE_COLUMN_GAP: n,
253
+ SectionZone: r,
296
254
  PDPContentProvider: s,
297
255
  ...o
298
256
  }) => {
@@ -305,56 +263,56 @@ const Re = async ({
305
263
  {
306
264
  data: i[0],
307
265
  productId: e,
308
- COMMON_PAGE_COLUMN_GAP: r,
309
- SectionZone: n,
266
+ COMMON_PAGE_COLUMN_GAP: n,
267
+ SectionZone: r,
310
268
  children: t
311
269
  }
312
270
  );
313
- }, De = {
271
+ }, qe = {
314
272
  "column-modifier": "_column-modifier_1tqap_1"
315
- }, _e = async ({
273
+ }, Ae = async ({
316
274
  className: t,
317
275
  children: e,
318
- slug: r,
319
- SectionZone: n,
276
+ slug: n,
277
+ SectionZone: r,
320
278
  COMMON_PAGE_COLUMN_GAP_PDC: s,
321
279
  PLPContentProvider: o,
322
280
  ...i
323
281
  }) => {
324
- const { data: u } = await S(
282
+ const { data: l } = await S(
325
283
  "categories_page",
326
284
  i
327
285
  );
328
- if (!u || !Array.isArray(u))
286
+ if (!l || !Array.isArray(l))
329
287
  return null;
330
- const c = u.find(
288
+ const c = l.find(
331
289
  (f) => {
332
- var m, y, C;
333
- return ((m = f.config) == null ? void 0 : m.seo.slug) === r && ((C = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : C.deviceType) === "desktop";
290
+ var p, y, I;
291
+ return ((p = f.config) == null ? void 0 : p.seo.slug) === n && ((I = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
334
292
  }
335
- ), p = u.find(
293
+ ), m = l.find(
336
294
  (f) => {
337
- var m, y, C;
338
- return ((m = f.config) == null ? void 0 : m.seo.slug) === r && ((C = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : C.deviceType) === "mobile";
295
+ var p, y, I;
296
+ return ((p = f.config) == null ? void 0 : p.seo.slug) === n && ((I = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
339
297
  }
340
- ), l = u.find(
298
+ ), u = l.find(
341
299
  (f) => {
342
- var m, y, C;
343
- return ((m = f.config) == null ? void 0 : m.seo.slug) === "default" && ((C = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : C.deviceType) === "desktop";
300
+ var p, y, I;
301
+ return ((p = f.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
344
302
  }
345
- ), d = u.find(
303
+ ), d = l.find(
346
304
  (f) => {
347
- var m, y, C;
348
- return ((m = f.config) == null ? void 0 : m.seo.slug) === "default" && ((C = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : C.deviceType) === "mobile";
305
+ var p, y, I;
306
+ return ((p = f.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = f.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
349
307
  }
350
- ), I = Array.isArray(t) ? t : [t];
308
+ ), C = Array.isArray(t) ? t : [t];
351
309
  return /* @__PURE__ */ N(B, { children: [
352
310
  /* @__PURE__ */ b(
353
311
  D.Column,
354
312
  {
355
313
  className: _.classNameConcat(
356
314
  j["responsive-desktop-flex"],
357
- [De["column-modifier"], ...I]
315
+ [qe["column-modifier"], ...C]
358
316
  ),
359
317
  style: {
360
318
  minHeight: "100vh"
@@ -362,9 +320,9 @@ const Re = async ({
362
320
  children: /* @__PURE__ */ b(
363
321
  o,
364
322
  {
365
- data: c ?? l,
323
+ data: c ?? u,
366
324
  device: "desktop",
367
- SectionZone: n,
325
+ SectionZone: r,
368
326
  COMMON_PAGE_COLUMN_GAP_PDC: s,
369
327
  children: e
370
328
  }
@@ -374,37 +332,37 @@ const Re = async ({
374
332
  /* @__PURE__ */ b(D.Column, { className: _.classNameConcat(j["responsive-mobile-flex"], t), children: /* @__PURE__ */ b(
375
333
  o,
376
334
  {
377
- data: p ?? d,
335
+ data: m ?? d,
378
336
  device: "mobile",
379
- SectionZone: n,
337
+ SectionZone: r,
380
338
  COMMON_PAGE_COLUMN_GAP_PDC: s,
381
339
  children: e
382
340
  }
383
341
  ) })
384
342
  ] });
385
- }, Le = async ({ slug: t, ...e }) => {
386
- var i, u, c;
387
- const { data: r } = await S(
343
+ }, Pe = async ({ slug: t, ...e }) => {
344
+ var i, l, c;
345
+ const { data: n } = await S(
388
346
  "redirect_to_search",
389
347
  e
390
348
  );
391
- if (!r || !Array.isArray(r))
349
+ if (!n || !Array.isArray(n))
392
350
  return {
393
351
  slug: t,
394
352
  query: null,
395
353
  redirect: !1
396
354
  };
397
- const n = ((c = (u = (i = r[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : u.redirectToSearch) == null ? void 0 : c.paths) ?? [];
398
- if (!!!n.length)
355
+ const r = ((c = (l = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : l.redirectToSearch) == null ? void 0 : c.paths) ?? [];
356
+ if (!!!r.length)
399
357
  return {
400
358
  slug: t,
401
359
  query: null,
402
360
  redirect: !1
403
361
  };
404
- const o = n.find(
405
- (p) => {
406
- var l, d;
407
- return ((l = p.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = p.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
362
+ const o = r.find(
363
+ (m) => {
364
+ var u, d;
365
+ return ((u = m.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = m.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
408
366
  }
409
367
  );
410
368
  return o ? {
@@ -422,21 +380,21 @@ const Re = async ({
422
380
  filters: null,
423
381
  sort: null
424
382
  };
425
- }, He = async ({ slug: t, ...e }) => {
426
- var i, u, c;
427
- const { data: r } = await S(
383
+ }, we = async ({ slug: t, ...e }) => {
384
+ var i, l, c;
385
+ const { data: n } = await S(
428
386
  "redirect_to_search",
429
387
  e
430
388
  );
431
- if (!r || !Array.isArray(r))
389
+ if (!n || !Array.isArray(n))
432
390
  return null;
433
- const n = ((c = (u = (i = r[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : u.redirectToSearch) == null ? void 0 : c.paths) ?? [];
434
- if (!!!n.length)
391
+ const r = ((c = (l = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : l.redirectToSearch) == null ? void 0 : c.paths) ?? [];
392
+ if (!!!r.length)
435
393
  return null;
436
- const o = n.find(
437
- (p) => {
438
- var l, d;
439
- return ((l = p.path) == null ? void 0 : l.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = p.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
394
+ const o = r.find(
395
+ (m) => {
396
+ var u, d;
397
+ return ((u = m.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = m.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
440
398
  }
441
399
  );
442
400
  return o ? {
@@ -444,53 +402,53 @@ const Re = async ({
444
402
  title: o.pageTitle,
445
403
  description: o.pageDescription
446
404
  } : null;
447
- }, Be = async ({
405
+ }, Ne = async ({
448
406
  children: t,
449
407
  SectionZone: e,
450
- className: r,
451
- ...n
408
+ className: n,
409
+ ...r
452
410
  }) => {
453
411
  const { data: s } = await S(
454
412
  "search_page",
455
- n
413
+ r
456
414
  );
457
415
  return Array.isArray(s) && s.length > 0 ? /* @__PURE__ */ b(
458
416
  ce,
459
417
  {
460
418
  data: s,
461
419
  SectionZone: e,
462
- className: r,
420
+ className: n,
463
421
  children: t
464
422
  }
465
423
  ) : /* @__PURE__ */ b(B, { children: "children" });
466
- }, Ge = async ({
424
+ }, ke = async ({
467
425
  ClientTipbarContent: t,
468
426
  ...e
469
427
  }) => {
470
- const { data: r } = await S(
428
+ const { data: n } = await S(
471
429
  "tipbar",
472
430
  e
473
431
  );
474
- return /* @__PURE__ */ b(t, { data: r });
475
- }, Me = {
476
- CommonPageContent: Se,
477
- CartContent: Re,
478
- FlagsAndTagsContent: Ee,
479
- HeaderContent: Fe,
480
- TipbarContent: Ge,
481
- FooterContent: Te,
482
- PLPContent: _e,
483
- PDPContent: je,
484
- getRedirectData: Le,
485
- getPLPSynteticMetaData: He,
486
- SearchPageContent: Be,
487
- HelpButtonContent: $e,
488
- LPCadastroContent: Ae,
489
- LPLojasContent: ke
490
- }, Pr = { Components: Me }, h = async (t, e = {}) => {
491
- const { method: r = "GET", body: n, headers: s = {}, priority: o = "auto", cache: i = "default" } = e;
432
+ return /* @__PURE__ */ b(t, { data: n });
433
+ }, je = {
434
+ CommonPageContent: Ce,
435
+ CartContent: be,
436
+ FlagsAndTagsContent: Re,
437
+ HeaderContent: Se,
438
+ TipbarContent: ke,
439
+ FooterContent: ve,
440
+ PLPContent: Ae,
441
+ PDPContent: $e,
442
+ getRedirectData: Pe,
443
+ getPLPSynteticMetaData: we,
444
+ SearchPageContent: Ne,
445
+ HelpButtonContent: Te,
446
+ LPCadastroContent: Fe,
447
+ LPLojasContent: Oe
448
+ }, Sr = { Components: je }, h = async (t, e = {}) => {
449
+ const { method: n = "GET", body: r, headers: s = {}, priority: o = "auto", cache: i = "default" } = e;
492
450
  return fetch(t, {
493
- method: r,
451
+ method: n,
494
452
  headers: {
495
453
  ...s,
496
454
  Accept: "application/json",
@@ -498,51 +456,51 @@ const Re = async ({
498
456
  },
499
457
  priority: o,
500
458
  cache: i,
501
- ...n ? { body: JSON.stringify(n) } : {}
459
+ ...r ? { body: JSON.stringify(r) } : {}
502
460
  // not body in get
503
- }).then((u) => u.json()).catch((u) => {
504
- console.error("[ERROR FETCH VTEX]", u);
461
+ }).then((l) => l.json()).catch((l) => {
462
+ console.error("[ERROR FETCH VTEX]", l);
505
463
  });
506
464
  }, w = /* @__PURE__ */ new Map();
507
- async function Ue(t, e = {}) {
508
- var r;
465
+ async function De(t, e = {}) {
466
+ var n;
509
467
  try {
510
- const { abort: n = !1 } = e, s = new AbortController();
511
- n && (w.has(t) && ((r = w.get(t)) == null || r.abort(), w.delete(t)), w.set(t, s));
468
+ const { abort: r = !1 } = e, s = new AbortController();
469
+ r && (w.has(t) && ((n = w.get(t)) == null || n.abort(), w.delete(t)), w.set(t, s));
512
470
  const o = h(t, {
513
471
  ...e,
514
- ...n ? { signal: s.signal } : {}
472
+ ...r ? { signal: s.signal } : {}
515
473
  });
516
- return n && w.delete(t), o;
517
- } catch (n) {
518
- if (n.name === "AbortError") {
474
+ return r && w.delete(t), o;
475
+ } catch (r) {
476
+ if (r.name === "AbortError") {
519
477
  console.log(`[REQUEST CANCELLED]: ${t}`);
520
478
  return;
521
479
  }
522
- throw console.error(`[ERROR API]: ${n.message}`), n;
480
+ throw console.error(`[ERROR API]: ${r.message}`), r;
523
481
  }
524
482
  }
525
- const Ve = a.object({
483
+ const _e = a.object({
526
484
  country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
527
485
  postalCode: a.string().nullable()
528
486
  });
529
- async function ze({ apiUrl: t, body: e, fetchOptions: r }) {
487
+ async function He({ apiUrl: t, body: e, fetchOptions: n }) {
530
488
  if (!e) {
531
489
  console.error("[ERROR FETCHING] Body is required");
532
490
  return;
533
491
  }
534
- await Ve.validate(e);
535
- const { country: n, postalCode: s } = e;
492
+ await _e.validate(e);
493
+ const { country: r, postalCode: s } = e;
536
494
  return await h(
537
- `${t}/api/checkout/pub/postal-code/${n}/${s}`,
495
+ `${t}/api/checkout/pub/postal-code/${r}/${s}`,
538
496
  {
539
497
  method: "POST",
540
498
  body: e,
541
- ...r
499
+ ...n
542
500
  }
543
501
  );
544
502
  }
545
- const xe = a.object({
503
+ const Le = a.object({
546
504
  orderFormId: a.string().nullable(),
547
505
  sellerCode: a.string().nullable(),
548
506
  sellerName: a.string().nullable()
@@ -550,26 +508,26 @@ const xe = a.object({
550
508
  async function K({
551
509
  apiUrl: t,
552
510
  body: e,
553
- fetchOptions: r
511
+ fetchOptions: n
554
512
  }) {
555
513
  if (!e) {
556
514
  console.error("[ERROR FETCHING] Body is required");
557
515
  return;
558
516
  }
559
- await xe.validate(e);
560
- const { orderFormId: n, sellerCode: s, sellerName: o } = e, i = s ? `${s.trim()} - ${o}` : null;
517
+ await Le.validate(e);
518
+ const { orderFormId: r, sellerCode: s, sellerName: o } = e, i = s ? `${s.trim()} - ${o}` : null;
561
519
  return h(
562
- `${t}/api/checkout/pub/orderForm/${n}/attachments/openTextField`,
520
+ `${t}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,
563
521
  {
564
522
  method: "POST",
565
523
  body: {
566
524
  value: i
567
525
  },
568
- ...r
526
+ ...n
569
527
  }
570
528
  );
571
529
  }
572
- const Qe = a.object({
530
+ const Be = a.object({
573
531
  orderFormId: a.string().nullable(),
574
532
  sellerCode: a.string().nullable(),
575
533
  marketingData: a.object()
@@ -577,17 +535,17 @@ const Qe = a.object({
577
535
  async function J({
578
536
  apiUrl: t,
579
537
  body: e,
580
- extraData: r = {},
581
- fetchOptions: n
538
+ extraData: n = {},
539
+ fetchOptions: r
582
540
  }) {
583
541
  if (!e) {
584
542
  console.error("[ERROR FETCHING] Body is required");
585
543
  return;
586
544
  }
587
- await Qe.validate(e);
588
- const { orderFormId: s, sellerCode: o, marketingData: i } = e, u = o ? {
545
+ await Be.validate(e);
546
+ const { orderFormId: s, sellerCode: o, marketingData: i } = e, l = o ? {
589
547
  utmCampaign: o ? o.toUpperCase() : "",
590
- utmiCampaign: o ? `${r.VENDOR_CODE}` : "semcodigo"
548
+ utmiCampaign: o ? `${n.VENDOR_CODE}` : "semcodigo"
591
549
  } : {};
592
550
  return h(
593
551
  `${t}/api/checkout/pub/orderForm/${s}/attachments/marketingData`,
@@ -595,239 +553,239 @@ async function J({
595
553
  method: "POST",
596
554
  body: {
597
555
  ...i,
598
- ...u
556
+ ...l
599
557
  },
600
- ...n
558
+ ...r
601
559
  }
602
560
  );
603
561
  }
604
- const Ke = a.object({
562
+ const Ge = a.object({
605
563
  orderFormId: a.string().nullable(),
606
564
  sellerCode: a.string().nullable(),
607
565
  sellerName: a.string().nullable()
608
566
  });
609
- async function Je({ apiUrl: t, body: e, fetchOptions: r, extraData: n }) {
567
+ async function Me({ apiUrl: t, body: e, fetchOptions: n, extraData: r }) {
610
568
  if (!e) {
611
569
  console.error("[ERROR FETCHING] Body is required");
612
570
  return;
613
571
  }
614
- await Ke.validate(e);
615
- const s = await K({ apiUrl: t, body: e, fetchOptions: r });
572
+ await Ge.validate(e);
573
+ const s = await K({ apiUrl: t, body: e, fetchOptions: n });
616
574
  return J({
617
575
  apiUrl: t,
618
576
  body: {
619
577
  ...e,
620
578
  marketingData: s == null ? void 0 : s.marketingData
621
579
  },
622
- extraData: n,
623
- fetchOptions: r
580
+ extraData: r,
581
+ fetchOptions: n
624
582
  });
625
583
  }
626
- const Xe = a.object({
584
+ const Ue = a.object({
627
585
  orderFormId: a.string().nullable(),
628
586
  coupon: a.string().nullable()
629
587
  });
630
- async function Ye({
588
+ async function Ve({
631
589
  apiUrl: t,
632
590
  body: e,
633
- fetchOptions: r
591
+ fetchOptions: n
634
592
  }) {
635
593
  if (!e) {
636
594
  console.error("[ERROR FETCHING] Body is required");
637
595
  return;
638
596
  }
639
- await Xe.validate(e);
640
- const { coupon: n = "", orderFormId: s } = e;
597
+ await Ue.validate(e);
598
+ const { coupon: r = "", orderFormId: s } = e;
641
599
  return h(
642
600
  `${t}/api/checkout/pub/orderForm/${s}/coupons`,
643
601
  {
644
602
  method: "POST",
645
- body: { text: n },
646
- ...r
603
+ body: { text: r },
604
+ ...n
647
605
  }
648
606
  );
649
607
  }
650
- const We = a.object({
608
+ const ze = a.object({
651
609
  appId: a.string().required("App ID is required"),
652
610
  orderFormId: a.string().nullable(),
653
611
  key: a.array().of(a.string())
654
612
  });
655
- async function Ze({
613
+ async function xe({
656
614
  apiUrl: t,
657
615
  body: e,
658
- fetchOptions: r
616
+ fetchOptions: n
659
617
  }) {
660
618
  if (!e) {
661
619
  console.error("[ERROR FETCHING] Body is required");
662
620
  return;
663
621
  }
664
- await We.validate(e);
665
- const { appId: n = "faststore", orderFormId: s, key: o } = e;
622
+ await ze.validate(e);
623
+ const { appId: r = "faststore", orderFormId: s, key: o } = e;
666
624
  return h(
667
- `${t}/api/checkout/pub/orderForm/${s}/customData/${n}/${o}`,
625
+ `${t}/api/checkout/pub/orderForm/${s}/customData/${r}/${o}`,
668
626
  {
669
627
  method: "PUT",
670
- ...r
628
+ ...n
671
629
  }
672
630
  );
673
631
  }
674
- const et = a.object().shape({
632
+ const Qe = a.object().shape({
675
633
  name: a.string().required("Attachment name is required"),
676
634
  content: a.object().nullable()
677
635
  });
678
636
  var x;
679
- const tt = a.object().shape({
680
- attachments: (x = a.array().of(et)) == null ? void 0 : x.nullable(),
637
+ const Ke = a.object().shape({
638
+ attachments: (x = a.array().of(Qe)) == null ? void 0 : x.nullable(),
681
639
  id: a.string().required("ID of SKU is required"),
682
640
  index: a.number().integer().nullable(),
683
641
  quantity: a.number().integer().nullable(),
684
642
  seller: a.string().required("Seller is required"),
685
643
  price: a.number().integer()
686
- }), rt = a.object({
644
+ }), Je = a.object({
687
645
  orderFormId: a.string().required("OrderFormId is required"),
688
- orderItems: a.array().of(tt)
646
+ orderItems: a.array().of(Ke)
689
647
  });
690
- async function nt({
648
+ async function Ye({
691
649
  apiUrl: t,
692
650
  body: e,
693
- fetchOptions: r
651
+ fetchOptions: n
694
652
  }) {
695
653
  if (!e) {
696
654
  console.error("[ERROR FETCHING] Body is required");
697
655
  return;
698
656
  }
699
- await rt.validate(e);
700
- const { orderFormId: n, orderItems: s } = e;
657
+ await Je.validate(e);
658
+ const { orderFormId: r, orderItems: s } = e;
701
659
  return h(
702
- `${t}/api/checkout/pub/orderForm/${n}/items`,
660
+ `${t}/api/checkout/pub/orderForm/${r}/items`,
703
661
  {
704
662
  method: "POST",
705
663
  body: { orderItems: s },
706
- ...r
664
+ ...n
707
665
  }
708
666
  );
709
667
  }
710
- const at = a.object({
668
+ const We = a.object({
711
669
  orderFormId: a.string().nullable()
712
670
  });
713
- async function st({
671
+ async function Xe({
714
672
  apiUrl: t,
715
673
  body: e,
716
- fetchOptions: r
674
+ fetchOptions: n
717
675
  }) {
718
676
  if (!e) {
719
677
  console.error("[ERROR FETCHING] Body is required");
720
678
  return;
721
679
  }
722
- await at.validate(e);
723
- const { orderFormId: n } = e;
680
+ await We.validate(e);
681
+ const { orderFormId: r } = e;
724
682
  return h(
725
- `${t}/api/checkout/pub/orderForm/${n}/items/removeAll`,
683
+ `${t}/api/checkout/pub/orderForm/${r}/items/removeAll`,
726
684
  {
727
685
  method: "POST",
728
- ...r
686
+ ...n
729
687
  }
730
688
  );
731
689
  }
732
- const ot = a.object().shape({
690
+ const Ze = a.object().shape({
733
691
  name: a.string().required("Attachment name is required"),
734
692
  content: a.object().nullable()
735
693
  });
736
694
  var Q;
737
- const it = a.object().shape({
738
- attachments: (Q = a.array().of(ot)) == null ? void 0 : Q.nullable(),
695
+ const et = a.object().shape({
696
+ attachments: (Q = a.array().of(Ze)) == null ? void 0 : Q.nullable(),
739
697
  id: a.string().required("ID of SKU is required"),
740
698
  index: a.number().integer().nullable(),
741
699
  quantity: a.number().integer().nullable(),
742
700
  seller: a.string().required("Seller is required"),
743
701
  price: a.number().integer()
744
- }), ct = a.object({
702
+ }), tt = a.object({
745
703
  orderFormId: a.string().nullable(),
746
- orderItems: a.array().of(it)
704
+ orderItems: a.array().of(et)
747
705
  });
748
- async function lt({
706
+ async function rt({
749
707
  apiUrl: t,
750
708
  body: e,
751
- fetchOptions: r
709
+ fetchOptions: n
752
710
  }) {
753
711
  if (!e) {
754
712
  console.error("[ERROR FETCHING] Body is required");
755
713
  return;
756
714
  }
757
- await ct.validate(e);
758
- const { orderFormId: n, orderItems: s } = e;
715
+ await tt.validate(e);
716
+ const { orderFormId: r, orderItems: s } = e;
759
717
  return h(
760
- `${t}/api/checkout/pub/orderForm/${n}/items/update`,
718
+ `${t}/api/checkout/pub/orderForm/${r}/items/update`,
761
719
  {
762
720
  method: "POST",
763
721
  body: { orderItems: s },
764
- ...r
722
+ ...n
765
723
  }
766
724
  );
767
725
  }
768
- const ut = a.object({
726
+ const nt = a.object({
769
727
  orderFormId: a.string().nullable()
770
728
  });
771
- async function dt({
729
+ async function at({
772
730
  apiUrl: t,
773
731
  body: e,
774
- fetchOptions: r
732
+ fetchOptions: n
775
733
  }) {
776
734
  if (!e) {
777
735
  console.error("[ERROR FETCHING] Body is required");
778
736
  return;
779
737
  }
780
- await ut.validate(e);
781
- const { orderFormId: n } = e;
738
+ await nt.validate(e);
739
+ const { orderFormId: r } = e;
782
740
  return h(
783
- `${t}/api/checkout/pub/orderForm/${n}/messages/clear`,
741
+ `${t}/api/checkout/pub/orderForm/${r}/messages/clear`,
784
742
  {
785
743
  method: "POST",
786
- ...r
744
+ ...n
787
745
  }
788
746
  );
789
747
  }
790
- const pt = a.object({
748
+ const st = a.object({
791
749
  id: a.string().nullable(),
792
750
  // id offering
793
751
  itemIndex: a.number().nullable(),
794
752
  orderFormId: a.string().nullable(),
795
753
  remove: a.boolean().nullable()
796
754
  });
797
- async function mt({ apiUrl: t, body: e, fetchOptions: r }) {
755
+ async function ot({ apiUrl: t, body: e, fetchOptions: n }) {
798
756
  if (!e) {
799
757
  console.error("[ERROR FETCHING] Body is required");
800
758
  return;
801
759
  }
802
- await pt.validate(e);
803
- const { itemIndex: n, orderFormId: s, id: o, remove: i } = e, u = i ? `/${o}/remove` : "", c = `${t}/api/checkout/pub/orderForm/${s}/items/${n}/offerings${u}`;
760
+ await st.validate(e);
761
+ const { itemIndex: r, orderFormId: s, id: o, remove: i } = e, l = i ? `/${o}/remove` : "", c = `${t}/api/checkout/pub/orderForm/${s}/items/${r}/offerings${l}`;
804
762
  return h(c, {
805
763
  method: "POST",
806
764
  body: { id: o },
807
- ...r
765
+ ...n
808
766
  });
809
767
  }
810
- const ft = a.object({
768
+ const it = a.object({
811
769
  orderFormId: a.string().nullable()
812
770
  });
813
- async function gt({
771
+ async function ct({
814
772
  apiUrl: t,
815
773
  body: e,
816
- fetchOptions: r,
817
- extraData: n
774
+ fetchOptions: n,
775
+ extraData: r
818
776
  }) {
819
777
  var i;
820
778
  if (!e) {
821
779
  console.error("[ERROR FETCHING] Body is required");
822
780
  return;
823
781
  }
824
- await ft.validate(e);
782
+ await it.validate(e);
825
783
  const s = new URLSearchParams({
826
784
  refreshOutdatedData: "true"
827
- }), o = e.orderFormId && ((i = n.orderFormPurchaseId) == null ? void 0 : i.value) !== e.orderFormId ? `${t}/api/checkout/pub/orderForm/${e.orderFormId}?${String(s)}` : `${t}/api/checkout/pub/orderForm`;
828
- return h(o, { method: "GET", ...r });
785
+ }), o = e.orderFormId && ((i = r.orderFormPurchaseId) == null ? void 0 : i.value) !== e.orderFormId ? `${t}/api/checkout/pub/orderForm/${e.orderFormId}?${String(s)}` : `${t}/api/checkout/pub/orderForm`;
786
+ return h(o, { method: "GET", ...n });
829
787
  }
830
- const ht = a.object({
788
+ const lt = a.object({
831
789
  orderFormId: a.string().nullable(),
832
790
  email: a.string().email().required(),
833
791
  firstName: a.string().required(),
@@ -836,72 +794,72 @@ const ht = a.object({
836
794
  document: a.string().required(),
837
795
  phone: a.string().matches(/^\+\d{1,3}\d{10,11}$/)
838
796
  });
839
- async function yt({
797
+ async function ut({
840
798
  apiUrl: t,
841
799
  body: e,
842
- fetchOptions: r
800
+ fetchOptions: n
843
801
  }) {
844
802
  if (!e) {
845
803
  console.error("[ERROR FETCHING] Body is required");
846
804
  return;
847
805
  }
848
- await ht.validate(e);
849
- const { orderFormId: n, ...s } = e;
806
+ await lt.validate(e);
807
+ const { orderFormId: r, ...s } = e;
850
808
  return h(
851
- `${t}/api/checkout/pub/orderForm/${n}/attachments/clientProfileData`,
809
+ `${t}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,
852
810
  {
853
811
  method: "POST",
854
812
  body: { ...s },
855
- ...r
813
+ ...n
856
814
  }
857
815
  );
858
816
  }
859
- const bt = a.object({
817
+ const dt = a.object({
860
818
  sellerCode: a.string().nullable()
861
819
  });
862
- async function It({
820
+ async function mt({
863
821
  apiUrl: t,
864
822
  body: e,
865
- extraData: r,
866
- fetchOptions: n
823
+ extraData: n,
824
+ fetchOptions: r
867
825
  }) {
868
826
  if (!e) {
869
827
  console.error("[ERROR FETCHING] Body is required");
870
828
  return;
871
829
  }
872
- await bt.validate(e);
830
+ await dt.validate(e);
873
831
  const { sellerCode: s = "" } = e;
874
832
  return h(
875
- `${t}/api/dataentities/${r.ENTITIES}/search?_fields=${r.FIELDS}&${r.FILTER}=${s}`,
833
+ `${t}/api/dataentities/${n.ENTITIES}/search?_fields=${n.FIELDS}&${n.FILTER}=${s}`,
876
834
  {
877
835
  method: "GET",
878
836
  headers: {
879
837
  Accept: "application/vnd.vtex.ds.v10+json"
880
838
  },
881
- ...n
839
+ ...r
882
840
  }
883
841
  );
884
842
  }
885
- const Ct = a.object().shape({
843
+ const pt = a.object().shape({
886
844
  country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
887
845
  orderFormId: a.string().nullable(),
888
846
  postalCode: a.string().nullable()
889
847
  });
890
- async function Rt({
848
+ async function ft({
891
849
  apiUrl: t,
892
850
  body: e,
893
- fetchOptions: r
851
+ fetchOptions: n
894
852
  }) {
895
853
  if (!e) {
896
854
  console.error("[ERROR FETCHING] Body is required");
897
855
  return;
898
856
  }
899
- await Ct.validate(e);
900
- const { country: n, orderFormId: s, postalCode: o } = e, i = o ? {
857
+ await pt.validate(e);
858
+ const { country: r, orderFormId: s, postalCode: o } = e, i = o ? {
901
859
  address: {
902
860
  addressType: "residential",
903
861
  postalCode: o,
904
- country: n
862
+ country: r
905
863
  }
906
864
  } : {
907
865
  logisticsInfo: [],
@@ -912,11 +870,11 @@ async function Rt({
912
870
  {
913
871
  method: "POST",
914
872
  body: i,
915
- ...r
873
+ ...n
916
874
  }
917
875
  );
918
876
  }
919
- const vt = a.object().shape({
877
+ const gt = a.object().shape({
920
878
  orderFormId: a.string().nullable(),
921
879
  options: a.array().of(
922
880
  a.object().shape({
@@ -944,15 +902,15 @@ const vt = a.object().shape({
944
902
  })
945
903
  )
946
904
  });
947
- async function St({ apiUrl: t, body: e, fetchOptions: r }) {
905
+ async function ht({ apiUrl: t, body: e, fetchOptions: n }) {
948
906
  if (!e) {
949
907
  console.error("[ERROR FETCHING] Body is required");
950
908
  return;
951
909
  }
952
- await vt.validate(e);
953
- const { orderFormId: n, options: s, selectedAddresses: o } = e;
910
+ await gt.validate(e);
911
+ const { orderFormId: r, options: s, selectedAddresses: o } = e;
954
912
  return h(
955
- `${t}/api/checkout/pub/orderForm/${n}/attachments/shippingData`,
913
+ `${t}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,
956
914
  {
957
915
  method: "POST",
958
916
  body: {
@@ -960,11 +918,11 @@ async function St({ apiUrl: t, body: e, fetchOptions: r }) {
960
918
  clearAddressIfPostalCodeNotFound: !1,
961
919
  logisticsInfo: s
962
920
  },
963
- ...r
921
+ ...n
964
922
  }
965
923
  );
966
924
  }
967
- const Et = a.object({
925
+ const yt = a.object({
968
926
  country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
969
927
  postalCode: a.string().nullable(),
970
928
  geoCoordinates: a.object().shape({
@@ -972,13 +930,13 @@ const Et = a.object({
972
930
  latitude: a.number().required()
973
931
  })
974
932
  });
975
- async function Tt({ apiUrl: t, body: e, fetchOptions: r }) {
933
+ async function bt({ apiUrl: t, body: e, fetchOptions: n }) {
976
934
  if (!e) {
977
935
  console.error("[ERROR FETCHING] Body is required");
978
936
  return;
979
937
  }
980
- await Et.validate(e);
981
- const { country: n = "", geoCoordinates: s, postalCode: o = "" } = e, i = new URLSearchParams({ country: String(n) });
938
+ await yt.validate(e);
939
+ const { country: r = "", geoCoordinates: s, postalCode: o = "" } = e, i = new URLSearchParams({ country: String(r) });
982
940
  return o ? i.append("postalCode", o) : i.append(
983
941
  "geoCoordinates",
984
942
  `${s == null ? void 0 : s.longitude};${s == null ? void 0 : s.latitude}`
@@ -986,234 +944,234 @@ async function Tt({ apiUrl: t, body: e, fetchOptions: r }) {
986
944
  `${t}/api/checkout/pub/regions/?${i.toString()}`,
987
945
  {
988
946
  method: "GET",
989
- ...r
947
+ ...n
990
948
  }
991
949
  );
992
950
  }
993
- const Ft = a.object({
951
+ const It = a.object({
994
952
  id: a.string().required("ID of SKU is required"),
995
953
  quantity: a.number().integer().required("Quantity of item is required"),
996
954
  seller: a.string()
997
- }), Ot = a.object({
998
- items: a.array().of(Ft),
955
+ }), Ct = a.object({
956
+ items: a.array().of(It),
999
957
  country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
1000
958
  postalCode: a.string().nullable(),
1001
959
  geoCoordinates: a.array().nullable().of(a.number()).length(2)
1002
960
  });
1003
- async function $t({ apiUrl: t, body: e, fetchOptions: r }) {
961
+ async function Rt({ apiUrl: t, body: e, fetchOptions: n }) {
1004
962
  if (!e) {
1005
963
  console.error("[ERROR FETCHING] Body is required");
1006
964
  return;
1007
965
  }
1008
- return await Ot.validate(e), h(
966
+ return await Ct.validate(e), h(
1009
967
  `${t}/api/checkout/pub/orderForms/simulation`,
1010
968
  {
1011
969
  method: "POST",
1012
970
  body: e,
1013
- ...r
971
+ ...n
1014
972
  }
1015
973
  );
1016
974
  }
1017
- const At = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
975
+ const vt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1018
976
  __proto__: null,
1019
- getMasterDataSellerCode: It,
1020
- getOrderForm: gt,
1021
- postOrderFormAddCoupon: Ye,
1022
- postOrderFormAttachClientProfileData: yt,
1023
- postOrderFormAttachOrderFormData: Je,
1024
- postOrderFormAttachShippingData: Rt,
977
+ getMasterDataSellerCode: mt,
978
+ getOrderForm: ct,
979
+ postOrderFormAddCoupon: Ve,
980
+ postOrderFormAttachClientProfileData: ut,
981
+ postOrderFormAttachOrderFormData: Me,
982
+ postOrderFormAttachShippingData: ft,
1025
983
  postOrderFormAttachmentsMarketingData: J,
1026
984
  postOrderFormAttachmentsOpenTextField: K,
1027
- postOrderFormClearMessages: dt,
1028
- postOrderFormFreightSimulation: $t,
1029
- postOrderFormItems: nt,
1030
- postOrderFormRegion: Tt,
1031
- postOrderFormRemoveAllItems: st,
1032
- postOrderFormUpdateItems: lt,
1033
- postOrderFormUpdateShippingData: St,
1034
- postOrderformAddress: ze,
1035
- putOrderFormCustomData: Ze,
1036
- updateOrderFormOffering: mt
1037
- }, Symbol.toStringTag, { value: "Module" })), qt = a.object({
985
+ postOrderFormClearMessages: at,
986
+ postOrderFormFreightSimulation: Rt,
987
+ postOrderFormItems: Ye,
988
+ postOrderFormRegion: bt,
989
+ postOrderFormRemoveAllItems: Xe,
990
+ postOrderFormUpdateItems: rt,
991
+ postOrderFormUpdateShippingData: ht,
992
+ postOrderformAddress: He,
993
+ putOrderFormCustomData: xe,
994
+ updateOrderFormOffering: ot
995
+ }, Symbol.toStringTag, { value: "Module" })), St = a.object({
1038
996
  skuId: a.string()
1039
997
  });
1040
- async function Pt({ apiUrl: t, body: e, fetchOptions: r }) {
998
+ async function Et({ apiUrl: t, body: e, fetchOptions: n }) {
1041
999
  if (!e) {
1042
1000
  console.error("[ERROR FETCHING] Body is required");
1043
1001
  return;
1044
1002
  }
1045
- await qt.validate(e);
1046
- const { skuId: n } = e;
1003
+ await St.validate(e);
1004
+ const { skuId: r } = e;
1047
1005
  return h(
1048
- `${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${n}`,
1006
+ `${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,
1049
1007
  {
1050
- ...r
1008
+ ...n
1051
1009
  }
1052
1010
  );
1053
1011
  }
1054
- const wt = a.object({
1012
+ const Tt = a.object({
1055
1013
  ids: a.array().of(a.string().required("ID are required")).required("IDs are required")
1056
1014
  });
1057
- async function Nt({ apiUrl: t, body: e, fetchOptions: r }) {
1015
+ async function Ft({ apiUrl: t, body: e, fetchOptions: n }) {
1058
1016
  if (!e) {
1059
1017
  console.error("[ERROR FETCHING] Body is required");
1060
1018
  return;
1061
1019
  }
1062
- await wt.validate(e);
1063
- const { ids: n } = e;
1020
+ await Tt.validate(e);
1021
+ const { ids: r } = e;
1064
1022
  return h(
1065
- `${t}/api/catalog_system/pub/products/search?fq=${n.map((s) => `productId:${s}`).join("&fq=")}`,
1023
+ `${t}/api/catalog_system/pub/products/search?fq=${r.map((s) => `productId:${s}`).join("&fq=")}`,
1066
1024
  {
1067
- ...r
1025
+ ...n
1068
1026
  }
1069
1027
  );
1070
1028
  }
1071
- const kt = a.object({
1029
+ const Ot = a.object({
1072
1030
  productId: a.number().required("Product ID is required")
1073
1031
  });
1074
- async function jt({ apiUrl: t, body: e, fetchOptions: r }) {
1032
+ async function $t({ apiUrl: t, body: e, fetchOptions: n }) {
1075
1033
  if (!e) {
1076
1034
  console.error("[ERROR FETCHING] Body is required");
1077
1035
  return;
1078
1036
  }
1079
- await kt.validate(e);
1080
- const { productId: n } = e;
1037
+ await Ot.validate(e);
1038
+ const { productId: r } = e;
1081
1039
  return h(
1082
- `${t}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`,
1040
+ `${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,
1083
1041
  {
1084
- ...r
1042
+ ...n
1085
1043
  }
1086
1044
  );
1087
1045
  }
1088
- const Dt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1046
+ const qt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1089
1047
  __proto__: null,
1090
- getCatalogKitProducts: Pt,
1091
- getCatalogProducts: Nt,
1092
- getCatalogSimilars: jt
1093
- }, Symbol.toStringTag, { value: "Module" })), _t = a.object({
1048
+ getCatalogKitProducts: Et,
1049
+ getCatalogProducts: Ft,
1050
+ getCatalogSimilars: $t
1051
+ }, Symbol.toStringTag, { value: "Module" })), At = a.object({
1094
1052
  query: a.string()
1095
1053
  });
1096
- async function Lt({
1054
+ async function Pt({
1097
1055
  apiUrl: t,
1098
1056
  body: e,
1099
- fetchOptions: r
1057
+ fetchOptions: n
1100
1058
  }) {
1101
1059
  if (!e) {
1102
1060
  console.error("[ERROR FETCHING] Body is required");
1103
1061
  return;
1104
1062
  }
1105
- await _t.validate(e);
1106
- const { query: n = "" } = e, s = new URLSearchParams({ query: n });
1063
+ await At.validate(e);
1064
+ const { query: r = "" } = e, s = new URLSearchParams({ query: r });
1107
1065
  return h(
1108
1066
  `${t}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
1109
1067
  {
1110
- ...r
1068
+ ...n
1111
1069
  }
1112
1070
  );
1113
1071
  }
1114
- const Ht = (t, e) => Ce(t, e), Bt = (t) => ({
1072
+ const wt = (t, e) => ye(t, e), Nt = (t) => ({
1115
1073
  ...t,
1116
- description: t.description ? Ht(t.description) : t.description
1117
- }), Gt = ({
1074
+ description: t.description ? wt(t.description) : t.description
1075
+ }), kt = ({
1118
1076
  offer: t,
1119
1077
  seller: e,
1120
- product: r
1078
+ product: n
1121
1079
  }) => ({
1122
1080
  ...t,
1123
- product: r,
1081
+ product: n,
1124
1082
  seller: e
1125
- }), X = (t, e) => ({
1083
+ }), Y = (t, e) => ({
1126
1084
  ...t,
1127
- isVariantOf: Bt(e)
1128
- }), Mt = (t) => t ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", k = (t) => t.AvailableQuantity > 0, U = (t) => t.spotPrice ?? 0, Ut = (t) => t.Price ?? 0, Y = (t, e) => k(t) && !k(e) ? -1 : !k(t) && k(e) ? 1 : U(t) - U(e), Vt = (t, e) => {
1129
- let r = 0;
1130
- for (let n = 1; n < t.length; n++)
1131
- e(t[r], t[n]) > 0 && (r = n);
1132
- return t[r];
1133
- }, W = (t) => {
1085
+ isVariantOf: Nt(e)
1086
+ }), jt = (t) => t ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", k = (t) => t.AvailableQuantity > 0, U = (t) => t.spotPrice ?? 0, Dt = (t) => t.Price ?? 0, W = (t, e) => k(t) && !k(e) ? -1 : !k(t) && k(e) ? 1 : U(t) - U(e), _t = (t, e) => {
1087
+ let n = 0;
1088
+ for (let r = 1; r < t.length; r++)
1089
+ e(t[n], t[r]) > 0 && (n = r);
1090
+ return t[n];
1091
+ }, X = (t) => {
1134
1092
  const e = t.flatMap(
1135
- (n) => n.sellers.map((s) => ({
1093
+ (r) => r.sellers.map((s) => ({
1136
1094
  offer: s.commertialOffer,
1137
- sku: n
1095
+ sku: r
1138
1096
  }))
1139
- ), r = Vt(
1097
+ ), n = _t(
1140
1098
  e,
1141
- ({ offer: n }, { offer: s }) => Y(n, s)
1099
+ ({ offer: r }, { offer: s }) => W(r, s)
1142
1100
  );
1143
- return r ? r.sku : t[0];
1101
+ return n ? n.sku : t[0];
1144
1102
  }, Z = (t) => t.map(
1145
- ({ imageUrl: e, imageText: r, imageLabel: n }) => ({
1146
- alternateName: r ?? "",
1103
+ ({ imageUrl: e, imageText: n, imageLabel: r }) => ({
1104
+ alternateName: n ?? "",
1147
1105
  url: e.replace("vteximg.com.br", "vtexassets.com"),
1148
- keywords: n
1106
+ keywords: r
1149
1107
  })
1150
- ), L = {
1108
+ ), H = {
1151
1109
  attachment: "ATTACHMENT",
1152
1110
  specification: "SPECIFICATION",
1153
1111
  attribute: "ATTRIBUTE"
1154
- }, zt = (t) => ({
1112
+ }, Ht = (t) => ({
1155
1113
  name: t.name,
1156
1114
  value: t.content,
1157
- valueReference: L.attachment
1158
- }), xt = (t) => ({
1115
+ valueReference: H.attachment
1116
+ }), Lt = (t) => ({
1159
1117
  propertyID: t.id,
1160
1118
  name: t.name,
1161
1119
  value: t.value,
1162
1120
  valueReference: {
1163
- valueReference: L.attribute,
1121
+ valueReference: H.attribute,
1164
1122
  visible: t.visible
1165
1123
  }
1166
- }), H = (t, e, r) => {
1167
- const n = t.flatMap(({ name: i, values: u }) => u ? u.map((c) => ({
1124
+ }), L = (t, e, n) => {
1125
+ const r = t.flatMap(({ name: i, values: l }) => l ? l.map((c) => ({
1168
1126
  name: i,
1169
1127
  value: c,
1170
- valueReference: L.specification
1128
+ valueReference: H.specification
1171
1129
  })) : {
1172
1130
  name: i,
1173
1131
  value: "",
1174
- valueReference: L.specification
1175
- }), s = Array.isArray(r) ? r.map(zt) : [], o = e ? e.map(xt) : [];
1132
+ valueReference: H.specification
1133
+ }), s = Array.isArray(n) ? n.map(Ht) : [], o = e ? e.map(Lt) : [];
1176
1134
  return [
1177
- ...n,
1135
+ ...r,
1178
1136
  ...s,
1179
1137
  ...o
1180
1138
  ];
1181
- }, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Qt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Kt = (t) => {
1139
+ }, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Bt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Gt = (t) => {
1182
1140
  let e = t.slice(0);
1183
- for (let r = 0; r < V.length; r++)
1141
+ for (let n = 0; n < V.length; n++)
1184
1142
  e = e.replace(
1185
- new RegExp(V.charAt(r), "g"),
1186
- Qt.charAt(r)
1143
+ new RegExp(V.charAt(n), "g"),
1144
+ Bt.charAt(n)
1187
1145
  );
1188
1146
  return e;
1189
- }, Jt = (t) => t.replace(/[·/_,:]/, "-"), ee = (t) => {
1190
- const r = t.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
1191
- return Jt(Kt(r)).toLowerCase();
1147
+ }, Mt = (t) => t.replace(/[·/_,:]/, "-"), ee = (t) => {
1148
+ const n = t.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
1149
+ return Mt(Gt(n)).toLowerCase();
1192
1150
  }, te = (t) => `/${t}/p`, re = (t) => {
1193
1151
  const e = Math.max(
1194
- ...t.map((n) => n.NumberOfInstallments)
1195
- ), r = t.find(
1196
- (n) => n.NumberOfInstallments === e
1152
+ ...t.map((r) => r.NumberOfInstallments)
1153
+ ), n = t.find(
1154
+ (r) => r.NumberOfInstallments === e
1197
1155
  );
1198
1156
  return {
1199
- count: (r == null ? void 0 : r.NumberOfInstallments) ?? 0,
1200
- value: (r == null ? void 0 : r.Value) ?? 0
1157
+ count: (n == null ? void 0 : n.NumberOfInstallments) ?? 0,
1158
+ value: (n == null ? void 0 : n.Value) ?? 0
1201
1159
  };
1202
1160
  }, ne = (t, e) => {
1203
- const r = {
1161
+ const n = {
1204
1162
  price: 0,
1205
1163
  listPrice: 0,
1206
1164
  sellerDefault: !1
1207
1165
  }, s = t.map(
1208
- (o) => Gt({
1166
+ (o) => kt({
1209
1167
  offer: o.commertialOffer,
1210
1168
  seller: o,
1211
1169
  product: e
1212
1170
  })
1213
- ).sort(Y).map((o) => (o.seller.sellerId === "1" && o.AvailableQuantity > 0 && (r.price = o.Price, r.listPrice = o.ListPrice, r.sellerDefault = !0), {
1171
+ ).sort(W).map((o) => (o.seller.sellerId === "1" && o.AvailableQuantity > 0 && (n.price = o.Price, n.listPrice = o.ListPrice, n.sellerDefault = !0), {
1214
1172
  availability: o.AvailableQuantity > 0,
1215
1173
  listPrice: o.ListPrice,
1216
- price: Ut(o),
1174
+ price: Dt(o),
1217
1175
  priceValidUntil: o.PriceValidUntil,
1218
1176
  priceCurrency: "BRL",
1219
1177
  installments: o.Installments,
@@ -1224,81 +1182,81 @@ const Ht = (t, e) => Ce(t, e), Bt = (t) => ({
1224
1182
  }
1225
1183
  }));
1226
1184
  return {
1227
- lowPrice: r.sellerDefault ? r.price : s[0].price,
1228
- highPrice: r.sellerDefault ? r.listPrice : s[0].listPrice,
1185
+ lowPrice: n.sellerDefault ? n.price : s[0].price,
1186
+ highPrice: n.sellerDefault ? n.listPrice : s[0].listPrice,
1229
1187
  offers: s
1230
1188
  };
1231
1189
  }, ae = (t) => {
1232
- const { attributes: e, itemId: r, name: n, sellers: s, variations: o } = t;
1190
+ const { attributes: e, itemId: n, name: r, sellers: s, variations: o } = t;
1233
1191
  return {
1234
- additionalProperty: H(o, e, []),
1235
- name: n,
1192
+ additionalProperty: L(o, e, []),
1193
+ name: r,
1236
1194
  offers: {
1237
- offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: u }) => ({
1238
- availability: Mt(u.AvailableQuantity > 0),
1239
- listPrice: u.ListPrice,
1240
- price: u.Price,
1241
- quantity: u.AvailableQuantity,
1195
+ offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: l }) => ({
1196
+ availability: jt(l.AvailableQuantity > 0),
1197
+ listPrice: l.ListPrice,
1198
+ price: l.Price,
1199
+ quantity: l.AvailableQuantity,
1242
1200
  seller: {
1243
1201
  identifier: i
1244
1202
  }
1245
1203
  }))
1246
1204
  },
1247
- sku: r
1205
+ sku: n
1248
1206
  // slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
1249
1207
  };
1250
- }, Xt = (t) => {
1208
+ }, Ut = (t) => {
1251
1209
  var v;
1252
1210
  const {
1253
1211
  attributes: e,
1254
- referenceId: r,
1255
- isVariantOf: n,
1212
+ referenceId: n,
1213
+ isVariantOf: r,
1256
1214
  images: s,
1257
1215
  itemId: o,
1258
1216
  name: i,
1259
- sellers: u,
1217
+ sellers: l,
1260
1218
  videos: c,
1261
- variations: p
1219
+ variations: m
1262
1220
  } = t, {
1263
- brand: l,
1221
+ brand: u,
1264
1222
  categories: d,
1265
- categoriesIds: I,
1223
+ categoriesIds: C,
1266
1224
  description: f,
1267
- linkText: m,
1225
+ linkText: p,
1268
1226
  productClusters: y,
1269
- clusterHighlights: C,
1227
+ clusterHighlights: I,
1270
1228
  productName: F,
1271
1229
  properties: O,
1272
1230
  productId: $,
1273
1231
  productReference: g
1274
- } = n, E = d.slice().reverse(), R = ne(u, t.isVariantOf), T = re(R.offers[0].installments);
1232
+ } = r, E = d.slice().reverse(), R = ne(l, t.isVariantOf), T = re(R.offers[0].installments);
1275
1233
  return {
1276
1234
  sku: o,
1277
- gtin: ((v = r == null ? void 0 : r[0]) == null ? void 0 : v.Value) ?? g ?? "",
1235
+ gtin: ((v = n == null ? void 0 : n[0]) == null ? void 0 : v.Value) ?? g ?? "",
1278
1236
  name: F ?? i,
1279
1237
  description: f,
1280
- releaseDate: n.releaseDate ?? "",
1281
- slug: m,
1238
+ releaseDate: r.releaseDate ?? "",
1239
+ slug: p,
1282
1240
  video: c[0],
1283
1241
  categories: d,
1284
- categoriesIds: I,
1242
+ categoriesIds: C,
1285
1243
  id: $,
1286
- brand: { name: l, brandName: l },
1244
+ brand: { name: u, brandName: u },
1287
1245
  seo: {
1288
1246
  description: f,
1289
1247
  title: F,
1290
- canonical: te(m)
1248
+ canonical: te(p)
1291
1249
  },
1292
1250
  cluster: {
1293
1251
  generals: y,
1294
- highlights: C
1252
+ highlights: I
1295
1253
  },
1296
1254
  properties: O,
1297
1255
  availability: { status: R.offers[0].availability },
1298
1256
  breadcrumbList: {
1299
1257
  itemListElement: [
1300
- ...E.map((q, P) => {
1301
- const A = q.split("/"), G = A[A.length - 2], ie = A.map(ee).join("/");
1258
+ ...E.map((A, P) => {
1259
+ const q = A.split("/"), G = q[q.length - 2], ie = q.map(ee).join("/");
1302
1260
  return {
1303
1261
  name: G,
1304
1262
  item: ie,
@@ -1306,8 +1264,8 @@ const Ht = (t, e) => Ce(t, e), Bt = (t) => ({
1306
1264
  };
1307
1265
  }),
1308
1266
  {
1309
- name: n.productName,
1310
- item: m,
1267
+ name: r.productName,
1268
+ item: p,
1311
1269
  position: d.length + 1
1312
1270
  }
1313
1271
  ],
@@ -1315,55 +1273,55 @@ const Ht = (t, e) => Ce(t, e), Bt = (t) => ({
1315
1273
  },
1316
1274
  image: Z(s),
1317
1275
  offers: R,
1318
- additionalProperty: H(p, e, []),
1276
+ additionalProperty: L(m, e, []),
1319
1277
  isVariantOf: {
1320
- productGroupID: n.productId,
1321
- hasVariant: n.items.map((q) => ae(q))
1278
+ productGroupID: r.productId,
1279
+ hasVariant: r.items.map((A) => ae(A))
1322
1280
  },
1323
1281
  installments: T
1324
1282
  };
1325
- }, Yt = (t) => {
1283
+ }, Vt = (t) => {
1326
1284
  var T;
1327
1285
  const {
1328
1286
  attributes: e,
1329
- referenceId: r,
1330
- isVariantOf: n,
1287
+ referenceId: n,
1288
+ isVariantOf: r,
1331
1289
  images: s,
1332
1290
  itemId: o,
1333
1291
  name: i,
1334
- sellers: u,
1292
+ sellers: l,
1335
1293
  Videos: c,
1336
- variations: p
1294
+ variations: m
1337
1295
  } = t, {
1338
- brand: l,
1296
+ brand: u,
1339
1297
  categories: d,
1340
- categoriesIds: I,
1298
+ categoriesIds: C,
1341
1299
  description: f,
1342
- linkText: m,
1300
+ linkText: p,
1343
1301
  productClusters: y,
1344
- productName: C,
1302
+ productName: I,
1345
1303
  Coleção: F,
1346
1304
  "ID Coleção": O,
1347
1305
  productId: $
1348
- } = n, g = d.slice().reverse(), E = ne(u, t.isVariantOf), R = re(E.offers[0].installments);
1306
+ } = r, g = d.slice().reverse(), E = ne(l, t.isVariantOf), R = re(E.offers[0].installments);
1349
1307
  return {
1350
1308
  sku: o,
1351
- gtin: ((T = r[0]) == null ? void 0 : T.Value) ?? "",
1352
- name: C ?? i,
1309
+ gtin: ((T = n[0]) == null ? void 0 : T.Value) ?? "",
1310
+ name: I ?? i,
1353
1311
  description: f,
1354
- releaseDate: n.releaseDate ?? "",
1355
- slug: m,
1312
+ releaseDate: r.releaseDate ?? "",
1313
+ slug: p,
1356
1314
  video: c[0],
1357
1315
  categories: d,
1358
- categoriesIds: I,
1316
+ categoriesIds: C,
1359
1317
  collection: F,
1360
1318
  collectionId: O,
1361
1319
  id: $,
1362
- brand: { name: l, brandName: l },
1320
+ brand: { name: u, brandName: u },
1363
1321
  seo: {
1364
1322
  description: f,
1365
- title: C,
1366
- canonical: te(m)
1323
+ title: I,
1324
+ canonical: te(p)
1367
1325
  },
1368
1326
  cluster: {
1369
1327
  generals: y,
@@ -1373,17 +1331,17 @@ const Ht = (t, e) => Ce(t, e), Bt = (t) => ({
1373
1331
  availability: { status: E.offers[0].availability },
1374
1332
  breadcrumbList: {
1375
1333
  itemListElement: [
1376
- ...g.map((v, q) => {
1377
- const P = v.split("/"), A = P[P.length - 2], G = P.map(ee).join("/");
1334
+ ...g.map((v, A) => {
1335
+ const P = v.split("/"), q = P[P.length - 2], G = P.map(ee).join("/");
1378
1336
  return {
1379
- name: A,
1337
+ name: q,
1380
1338
  item: G,
1381
- position: q + 1
1339
+ position: A + 1
1382
1340
  };
1383
1341
  }),
1384
1342
  {
1385
- name: n.productName,
1386
- item: m,
1343
+ name: r.productName,
1344
+ item: p,
1387
1345
  position: d.length + 1
1388
1346
  }
1389
1347
  ],
@@ -1391,17 +1349,17 @@ const Ht = (t, e) => Ce(t, e), Bt = (t) => ({
1391
1349
  },
1392
1350
  image: Z(s),
1393
1351
  offers: E,
1394
- additionalProperty: H(p, e, []),
1352
+ additionalProperty: L(m, e, []),
1395
1353
  isVariantOf: {
1396
- productGroupID: n.productId,
1397
- hasVariant: n.items.map((v) => {
1398
- const { variations: q } = v, P = q.map((A) => ({
1399
- name: A,
1400
- values: v[A]
1354
+ productGroupID: r.productId,
1355
+ hasVariant: r.items.map((v) => {
1356
+ const { variations: A } = v, P = A.map((q) => ({
1357
+ name: q,
1358
+ values: v[q]
1401
1359
  }));
1402
1360
  return {
1403
1361
  ...ae(v),
1404
- additionalProperty: H(
1362
+ additionalProperty: L(
1405
1363
  P,
1406
1364
  e,
1407
1365
  []
@@ -1411,34 +1369,34 @@ const Ht = (t, e) => Ce(t, e), Bt = (t) => ({
1411
1369
  },
1412
1370
  installments: R
1413
1371
  };
1414
- }, Wt = a.array().of(a.object({
1372
+ }, zt = a.array().of(a.object({
1415
1373
  key: a.string().required(),
1416
1374
  value: a.string().required()
1417
1375
  })).required("Facets are required");
1418
- async function Zt({ apiUrl: t, body: e, fetchOptions: r }) {
1376
+ async function xt({ apiUrl: t, body: e, fetchOptions: n }) {
1419
1377
  if (!e) {
1420
1378
  console.error("[ERROR FETCHING] Body is required");
1421
1379
  return;
1422
1380
  }
1423
- await Wt.validate(e);
1424
- const n = new URLSearchParams({}), s = e.map(({ key: i, value: u }) => `${i}/${u}`).join("/");
1425
- le(e, n);
1381
+ await zt.validate(e);
1382
+ const r = new URLSearchParams({}), s = e.map(({ key: i, value: l }) => `${i}/${l}`).join("/");
1383
+ le(e, r);
1426
1384
  const o = `${t}/api/catalog_system/pub/products/crossselling/${s}`;
1427
1385
  return h(o, {
1428
1386
  cache: "no-store",
1429
- ...r
1387
+ ...n
1430
1388
  }).then((i) => i.map((c) => {
1431
- const p = W(c.items);
1432
- return p && X(p, c);
1389
+ const m = X(c.items);
1390
+ return m && Y(m, c);
1433
1391
  }).filter((c) => !!c).map((c) => ({
1434
- node: Yt(c)
1392
+ node: Vt(c)
1435
1393
  })));
1436
1394
  }
1437
1395
  const se = ({
1438
1396
  apiUrl: t,
1439
1397
  body: e,
1440
- fetchOptions: r,
1441
- extraData: n
1398
+ fetchOptions: n,
1399
+ extraData: r
1442
1400
  }) => {
1443
1401
  if (!e) {
1444
1402
  console.error("[ERROR FETCHING] Body is required");
@@ -1448,50 +1406,50 @@ const se = ({
1448
1406
  query: s = "",
1449
1407
  page: o = 1,
1450
1408
  count: i,
1451
- sort: u = "",
1409
+ sort: l = "",
1452
1410
  facets: c = [],
1453
- type: p,
1454
- hideUnavailableItems: l = !0,
1411
+ type: m,
1412
+ hideUnavailableItems: u = !0,
1455
1413
  locale: d = ""
1456
- } = e, I = new URLSearchParams({
1414
+ } = e, C = new URLSearchParams({
1457
1415
  page: o.toString(),
1458
- count: (i == null ? void 0 : i.toString()) ?? (n == null ? void 0 : n.ITEMS_PER_PAGE) ?? 24,
1416
+ count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
1459
1417
  query: s,
1460
- sort: u,
1418
+ sort: l,
1461
1419
  locale: d
1462
1420
  });
1463
- l !== void 0 && I.append("hideUnavailableItems", l.toString());
1464
- const f = c.map((m) => `${m.key}/${m.value}`).join("/") ?? "";
1465
- return Ue(
1466
- `${t}/api/io/_v/api/intelligent-search/${p}/${f}?${I.toString()}`,
1421
+ u !== void 0 && C.append("hideUnavailableItems", u.toString());
1422
+ const f = c.map((p) => `${p.key}/${p.value}`).join("/") ?? "";
1423
+ return De(
1424
+ `${t}/api/io/_v/api/intelligent-search/${m}/${f}?${C.toString()}`,
1467
1425
  {
1468
1426
  headers: {
1469
1427
  Accept: "application/json",
1470
1428
  "content-type": "application/json"
1471
1429
  },
1472
- ...r
1430
+ ...n
1473
1431
  }
1474
1432
  );
1475
1433
  };
1476
- async function er({ body: t, extraData: e, ...r }) {
1434
+ async function Qt({ body: t, extraData: e, ...n }) {
1477
1435
  if (!t) {
1478
1436
  console.error("[ERROR FETCHING] Body is required");
1479
1437
  return;
1480
1438
  }
1481
- const n = await se({
1439
+ const r = await se({
1482
1440
  body: {
1483
1441
  ...t,
1484
1442
  type: "product_search"
1485
1443
  },
1486
1444
  extraData: e,
1487
- ...r
1488
- }), s = (n == null ? void 0 : n.products.map((u) => {
1489
- const c = W(u.items);
1490
- return c && X(c, u);
1491
- }).filter((u) => !!u)) ?? [], {
1445
+ ...n
1446
+ }), s = (r == null ? void 0 : r.products.map((l) => {
1447
+ const c = X(l.items);
1448
+ return c && Y(c, l);
1449
+ }).filter((l) => !!l)) ?? [], {
1492
1450
  pagination: o,
1493
1451
  recordsFiltered: i
1494
- } = n;
1452
+ } = r;
1495
1453
  return {
1496
1454
  data: {
1497
1455
  pagination: {
@@ -1502,211 +1460,211 @@ async function er({ body: t, extraData: e, ...r }) {
1502
1460
  count: i,
1503
1461
  total: o.count
1504
1462
  },
1505
- products: s.map((u, c) => ({
1506
- node: Xt(u),
1463
+ products: s.map((l, c) => ({
1464
+ node: Ut(l),
1507
1465
  cursor: c.toString()
1508
1466
  }))
1509
1467
  }
1510
1468
  };
1511
1469
  }
1512
- async function tr({ body: t, extraData: e, ...r }) {
1470
+ async function Kt({ body: t, extraData: e, ...n }) {
1513
1471
  if (!t) {
1514
1472
  console.error("[ERROR FETCHING] Body is required");
1515
1473
  return;
1516
1474
  }
1517
- const n = await se({
1475
+ const r = await se({
1518
1476
  body: {
1519
1477
  ...t,
1520
1478
  type: "facets"
1521
1479
  },
1522
1480
  extraData: e,
1523
- ...r
1481
+ ...n
1524
1482
  });
1525
- return !n || !n.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
1483
+ return !r || !r.facets ? (console.error("[ERROR FETCHING] No facets found"), { data: { facets: [] } }) : {
1526
1484
  data: {
1527
- ...n,
1528
- facets: ue(n, t == null ? void 0 : t.selectedFacets, (t == null ? void 0 : t.query) ?? "")
1485
+ ...r,
1486
+ facets: ue(r, t == null ? void 0 : t.selectedFacets, (t == null ? void 0 : t.query) ?? "")
1529
1487
  }
1530
1488
  };
1531
1489
  }
1532
- const rr = a.object({
1490
+ const Jt = a.object({
1533
1491
  query: a.string().optional(),
1534
1492
  locale: a.string().optional()
1535
1493
  });
1536
- async function nr({ apiUrl: t, body: e, fetchOptions: r }) {
1494
+ async function Yt({ apiUrl: t, body: e, fetchOptions: n }) {
1537
1495
  if (!e) {
1538
1496
  console.error("[ERROR FETCHING] Body is required");
1539
1497
  return;
1540
1498
  }
1541
- await rr.validate(e);
1542
- const { query: n = "", locale: s = "default_locale" } = e, o = new URLSearchParams({ query: n, locale: s });
1499
+ await Jt.validate(e);
1500
+ const { query: r = "", locale: s = "default_locale" } = e, o = new URLSearchParams({ query: r, locale: s });
1543
1501
  return h(
1544
1502
  `${t}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,
1545
1503
  {
1546
- ...r
1504
+ ...n
1547
1505
  }
1548
1506
  );
1549
1507
  }
1550
- async function ar({ apiUrl: t }) {
1508
+ async function Wt({ apiUrl: t }) {
1551
1509
  return h(`${t}/api/io/_v/api/intelligent-search/top_searches`);
1552
1510
  }
1553
- const sr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1511
+ const Xt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1554
1512
  __proto__: null,
1555
- getSearchAutoCompleteSuggestions: Lt,
1556
- getSearchCrossellingProducts: Zt,
1557
- getSearchFacets: tr,
1558
- getSearchProducts: er,
1559
- getSearchSuggestedTerms: nr,
1560
- getSearchTopSearchs: ar
1561
- }, Symbol.toStringTag, { value: "Module" })), or = a.object({
1513
+ getSearchAutoCompleteSuggestions: Pt,
1514
+ getSearchCrossellingProducts: xt,
1515
+ getSearchFacets: Kt,
1516
+ getSearchProducts: Qt,
1517
+ getSearchSuggestedTerms: Yt,
1518
+ getSearchTopSearchs: Wt
1519
+ }, Symbol.toStringTag, { value: "Module" })), Zt = a.object({
1562
1520
  masterDataEntity: a.string().nonNullable(),
1563
1521
  payload: a.object().shape({}).nullable()
1564
1522
  });
1565
- async function ir({
1523
+ async function er({
1566
1524
  apiUrl: t,
1567
1525
  body: e,
1568
- fetchOptions: r
1526
+ fetchOptions: n
1569
1527
  }) {
1570
1528
  if (!e) {
1571
1529
  console.error("[ERROR FETCHING] Body is required");
1572
1530
  return;
1573
1531
  }
1574
- await or.validate(e);
1575
- const { masterDataEntity: n, payload: s } = e, o = `${t}/api/dataentities/${n}/documents`;
1532
+ await Zt.validate(e);
1533
+ const { masterDataEntity: r, payload: s } = e, o = `${t}/api/dataentities/${r}/documents`;
1576
1534
  return h(o, {
1577
1535
  method: "POST",
1578
1536
  body: {
1579
1537
  payload: s
1580
1538
  },
1581
- ...r
1539
+ ...n
1582
1540
  });
1583
1541
  }
1584
- const cr = a.object().shape({
1542
+ const tr = a.object().shape({
1585
1543
  _where: a.string().optional(),
1586
1544
  _fields: a.string().optional(),
1587
1545
  _sort: a.string().optional(),
1588
1546
  _from: a.number().integer().min(0).optional(),
1589
1547
  _to: a.number().integer().min(0).optional(),
1590
1548
  _keyword: a.string().optional()
1591
- }), lr = a.object({
1549
+ }), rr = a.object({
1592
1550
  masterDataEntity: a.string().required(),
1593
- searchFields: cr,
1551
+ searchFields: tr,
1594
1552
  headers: a.object().shape({
1595
1553
  "REST-Range": a.string().notRequired()
1596
1554
  })
1597
1555
  });
1598
- async function ur({
1556
+ async function nr({
1599
1557
  apiUrl: t,
1600
1558
  body: e,
1601
- fetchOptions: r
1559
+ fetchOptions: n
1602
1560
  }) {
1603
1561
  if (!e) {
1604
1562
  console.error("[ERROR FETCHING] Body is required");
1605
1563
  return;
1606
1564
  }
1607
- const n = new URLSearchParams();
1608
- await lr.validate(e);
1565
+ const r = new URLSearchParams();
1566
+ await rr.validate(e);
1609
1567
  const { masterDataEntity: s, searchFields: o, headers: i } = e;
1610
- o && Object.entries(o).forEach(([p, l]) => {
1611
- n.append(p, String(l));
1612
- }), "_fields" in o || n == null || n.append("_fields", "_all");
1613
- let u = [], c = null;
1568
+ o && Object.entries(o).forEach(([m, u]) => {
1569
+ r.append(m, String(u));
1570
+ }), "_fields" in o || r == null || r.append("_fields", "_all");
1571
+ let l = [], c = null;
1614
1572
  do {
1615
- c && n.set("_scroll", c);
1616
- const p = await fetch(
1617
- `${t}/api/dataentities/${s}/search?${n.toString()}`,
1573
+ c && r.set("_scroll", c);
1574
+ const m = await fetch(
1575
+ `${t}/api/dataentities/${s}/search?${r.toString()}`,
1618
1576
  {
1619
1577
  method: "GET",
1620
1578
  headers: {
1621
1579
  "REST-Range": (i == null ? void 0 : i["REST-Range"]) ?? "resources=0-100",
1622
- ...r == null ? void 0 : r.headers
1580
+ ...n == null ? void 0 : n.headers
1623
1581
  },
1624
1582
  cache: "no-store"
1625
1583
  }
1626
1584
  );
1627
- if (!p.ok)
1585
+ if (!m.ok)
1628
1586
  throw new Error(
1629
- `[MasterData] ${p.status} - ${p.statusText}`
1587
+ `[MasterData] ${m.status} - ${m.statusText}`
1630
1588
  );
1631
- const l = await p.json();
1632
- u.push(...l), c = p.headers.get("x-vtex-md-scroll");
1589
+ const u = await m.json();
1590
+ l.push(...u), c = m.headers.get("x-vtex-md-scroll");
1633
1591
  } while (c);
1634
- return u;
1592
+ return l;
1635
1593
  }
1636
- const dr = a.object({
1594
+ const ar = a.object({
1637
1595
  dataEntityName: a.string().required(),
1638
1596
  id: a.string().required(),
1639
1597
  fieldsToBeUpdated: a.object().shape({})
1640
1598
  });
1641
- async function pr({
1599
+ async function sr({
1642
1600
  apiUrl: t,
1643
1601
  body: e,
1644
- fetchOptions: r
1602
+ fetchOptions: n
1645
1603
  }) {
1646
1604
  if (!e) {
1647
1605
  console.error("[ERROR FETCHING] Body is required");
1648
1606
  return;
1649
1607
  }
1650
- await dr.validate(e);
1651
- const { dataEntityName: n, id: s, fieldsToBeUpdated: o } = e, i = `${t}/api/dataentities/${n}/documents/${s}`;
1608
+ await ar.validate(e);
1609
+ const { dataEntityName: r, id: s, fieldsToBeUpdated: o } = e, i = `${t}/api/dataentities/${r}/documents/${s}`;
1652
1610
  return h(i, {
1653
1611
  body: {
1654
1612
  fieldsToBeUpdated: o
1655
1613
  },
1656
1614
  method: "PATCH",
1657
- ...r
1615
+ ...n
1658
1616
  });
1659
1617
  }
1660
- const mr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1618
+ const or = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1661
1619
  __proto__: null,
1662
- getSearchMasterdata: ur,
1663
- patchUpdateMasterdata: pr,
1664
- postMasterdata: ir
1620
+ getSearchMasterdata: nr,
1621
+ patchUpdateMasterdata: sr,
1622
+ postMasterdata: er
1665
1623
  }, Symbol.toStringTag, { value: "Module" }));
1666
- async function fr({ body: t, apiUrl: e, extraData: r, fetchOptions: n }) {
1624
+ async function ir({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
1667
1625
  const { productIds: s } = t;
1668
1626
  if (!s)
1669
1627
  return console.error("[ERROR FETCHING] productIds is required"), [];
1670
- const { NAME_SPLIT_SYMBOL: o } = r;
1628
+ const { NAME_SPLIT_SYMBOL: o } = n;
1671
1629
  if (!o)
1672
1630
  return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
1673
- const i = s.map((l) => typeof l == "string" || typeof l == "number" ? `productId:${l}` : "").join("&fq="), u = await h(
1631
+ const i = s.map((u) => typeof u == "string" || typeof u == "number" ? `productId:${u}` : "").join("&fq="), l = await h(
1674
1632
  `${e}/api/catalog_system/pub/products/search?fq=${i}`,
1675
1633
  {
1676
- ...n
1634
+ ...r
1677
1635
  }
1678
- ), c = (l) => Object.keys(l).map((d) => ({ id: d, name: l[d] }));
1679
- return u.map((l, d) => {
1636
+ ), c = (u) => Object.keys(u).map((d) => ({ id: d, name: u[d] }));
1637
+ return l.map((u, d) => {
1680
1638
  var $;
1681
- const { installments: I, price: f, listPrice: m, sizes: y, allSizesAvailable: C } = de({ items: l.items, NAME_SPLIT_SYMBOL: o }), F = C ? !0 : y.some((g) => g.available), O = l.items[0].sellers[0].commertialOffer;
1639
+ const { installments: C, price: f, listPrice: p, sizes: y, allSizesAvailable: I } = de({ items: u.items, NAME_SPLIT_SYMBOL: o }), F = I ? !0 : y.some((g) => g.available), O = u.items[0].sellers[0].commertialOffer;
1682
1640
  return {
1683
1641
  node: {
1684
- sku: l.items[0].itemId,
1685
- gtin: l.productReference,
1686
- name: l.productName,
1687
- description: l.description,
1688
- releaseDate: l.releaseDate,
1689
- slug: l.linkText,
1690
- categories: l.categories,
1691
- categoriesIds: l.categoriesIds,
1692
- id: l.items[0].itemId,
1642
+ sku: u.items[0].itemId,
1643
+ gtin: u.productReference,
1644
+ name: u.productName,
1645
+ description: u.description,
1646
+ releaseDate: u.releaseDate,
1647
+ slug: u.linkText,
1648
+ categories: u.categories,
1649
+ categoriesIds: u.categoriesIds,
1650
+ id: u.items[0].itemId,
1693
1651
  brand: {
1694
- name: l.brand,
1695
- brandName: l.brand
1652
+ name: u.brand,
1653
+ brandName: u.brand
1696
1654
  },
1697
1655
  seo: {
1698
- description: l.description,
1699
- title: l.productName,
1700
- canonical: `/${l.linkText}/p`
1656
+ description: u.description,
1657
+ title: u.productName,
1658
+ canonical: `/${u.linkText}/p`
1701
1659
  },
1702
1660
  cluster: {
1703
- generals: c(l.productClusters),
1704
- highlights: c(l.clusterHighlights)
1661
+ generals: c(u.productClusters),
1662
+ highlights: c(u.clusterHighlights)
1705
1663
  },
1706
1664
  availability: {
1707
1665
  status: F
1708
1666
  },
1709
- image: l.items[0].images.map(
1667
+ image: u.items[0].images.map(
1710
1668
  ({
1711
1669
  imageLabel: g,
1712
1670
  imageUrl: E
@@ -1718,11 +1676,11 @@ async function fr({ body: t, apiUrl: e, extraData: r, fetchOptions: n }) {
1718
1676
  ),
1719
1677
  offers: {
1720
1678
  lowPrice: f,
1721
- highPrice: m,
1679
+ highPrice: p,
1722
1680
  offers: [
1723
1681
  {
1724
1682
  availability: F,
1725
- listPrice: m,
1683
+ listPrice: p,
1726
1684
  price: f,
1727
1685
  priceValidUntil: O.PriceValidUntil,
1728
1686
  priceCurrency: "BRL",
@@ -1730,19 +1688,19 @@ async function fr({ body: t, apiUrl: e, extraData: r, fetchOptions: n }) {
1730
1688
  lowPrice: f,
1731
1689
  quantity: O.AvailableQuantity,
1732
1690
  seller: {
1733
- identifier: l.items[0].sellers[0].sellerId
1691
+ identifier: u.items[0].sellers[0].sellerId
1734
1692
  }
1735
1693
  }
1736
1694
  ]
1737
1695
  },
1738
- additionalProperty: ($ = l == null ? void 0 : l.skuSpecifications) == null ? void 0 : $.map((g) => ({
1739
- name: l == null ? void 0 : l.skuSpecifications[0].field.name,
1696
+ additionalProperty: ($ = u == null ? void 0 : u.skuSpecifications) == null ? void 0 : $.map((g) => ({
1697
+ name: u == null ? void 0 : u.skuSpecifications[0].field.name,
1740
1698
  value: g,
1741
1699
  valueReference: "SPECIFICATION"
1742
1700
  })),
1743
1701
  isVariantOf: {
1744
- productGroupID: l.productId,
1745
- hasVariant: l.items.map((g) => {
1702
+ productGroupID: u.productId,
1703
+ hasVariant: u.items.map((g) => {
1746
1704
  var E;
1747
1705
  return {
1748
1706
  additionalProperty: g == null ? void 0 : g.variations.map(() => {
@@ -1772,122 +1730,117 @@ async function fr({ body: t, apiUrl: e, extraData: r, fetchOptions: n }) {
1772
1730
  };
1773
1731
  })
1774
1732
  },
1775
- installments: I
1733
+ installments: C
1776
1734
  },
1777
1735
  cursor: d.toString()
1778
1736
  };
1779
1737
  });
1780
1738
  }
1781
- const gr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1739
+ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1782
1740
  __proto__: null,
1783
- getWishlistProducts: fr
1784
- }, Symbol.toStringTag, { value: "Module" })), hr = (t = "") => t.charAt(0).toUpperCase() + t.slice(1), z = (t, e = " ") => !t || typeof t == "string" && t.length === 0 ? t : (Array.isArray(t) ? t : t.split("-")).map(hr).join(e), yr = ({ canonical: t, seo: e, slug: r }) => {
1785
- const n = Array.isArray(r) ? r.join(", ") : r;
1741
+ getWishlistProducts: ir
1742
+ }, Symbol.toStringTag, { value: "Module" })), lr = (t = "") => t.charAt(0).toUpperCase() + t.slice(1), z = (t, e = " ") => !t || typeof t == "string" && t.length === 0 ? t : (Array.isArray(t) ? t : t.split("-")).map(lr).join(e), ur = ({ canonical: t, seo: e, slug: n }) => {
1743
+ const r = Array.isArray(n) ? n.join(", ") : n;
1786
1744
  return {
1787
1745
  id: 0,
1788
- Title: `${Array.isArray(r) ? r.map((o) => z(o)).join(",") : z(r)} - ${e.title}`,
1746
+ Title: `${Array.isArray(n) ? n.map((o) => z(o)).join(",") : z(n)} - ${e.title}`,
1789
1747
  MetaTagDescription: e.description,
1790
- name: n,
1748
+ name: r,
1791
1749
  hasChildren: !1,
1792
1750
  url: t,
1793
1751
  children: []
1794
1752
  };
1795
- }, br = ({ canonical: t, category: e, previousImages: r, seo: n }) => ({
1753
+ }, dr = ({ canonical: t, category: e, previousImages: n, seo: r }) => ({
1796
1754
  category: String(e == null ? void 0 : e.id),
1797
- title: (e == null ? void 0 : e.Title) ?? n.title,
1798
- description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
1755
+ title: (e == null ? void 0 : e.Title) ?? r.title,
1756
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
1799
1757
  alternates: { canonical: t },
1800
1758
  openGraph: {
1801
1759
  type: "website",
1802
- title: (e == null ? void 0 : e.Title) ?? n.title,
1803
- description: (e == null ? void 0 : e.MetaTagDescription) ?? n.description,
1804
- images: Array.isArray(r) ? [...r] : []
1760
+ title: (e == null ? void 0 : e.Title) ?? r.title,
1761
+ description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
1762
+ images: Array.isArray(n) ? [...n] : []
1805
1763
  }
1806
- }), Ir = ({ items: t, parent: e, apiUrl: r, find: n }) => {
1764
+ }), mr = ({ items: t, parent: e, apiUrl: n, find: r }) => {
1807
1765
  const s = t.find(
1808
- (i) => i.url.replace(r, "") === decodeURIComponent(e.toLowerCase())
1766
+ (i) => i.url.replace(n, "") === decodeURIComponent(e.toLowerCase())
1809
1767
  );
1810
1768
  return (s == null ? void 0 : s.children.find(
1811
- (i) => i.name.toLowerCase() === decodeURIComponent(String(n))
1769
+ (i) => i.name.toLowerCase() === decodeURIComponent(String(r))
1812
1770
  )) ?? s;
1813
- }, Cr = (t) => {
1771
+ }, pr = (t) => {
1814
1772
  t instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${t.message}`), console.error(t.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", t);
1815
- }, Rr = /* @__PURE__ */ new Set([
1773
+ }, fr = /* @__PURE__ */ new Set([
1816
1774
  "brand",
1817
1775
  "category",
1818
1776
  "department",
1819
1777
  "subcategory",
1820
1778
  "collection",
1821
1779
  "cluster"
1822
- ]), vr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && Rr.has(t == null ? void 0 : t.pageType.toLowerCase()), Sr = (t) => ({
1780
+ ]), gr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && fr.has(t == null ? void 0 : t.pageType.toLowerCase()), hr = (t) => ({
1823
1781
  collection: t.Coleção,
1824
1782
  categoryId: t.categoryId,
1825
1783
  current_collection: t["Coleção Atual"],
1826
1784
  items: t.items
1827
- }), oe = (t, e) => t.reduce((r, n) => {
1828
- if (n.items.filter(
1829
- (i) => i.sellers.find((u) => u.commertialOffer.IsAvailable)
1830
- ).length === 0 || (r == null ? void 0 : r.find((i) => (i == null ? void 0 : i.productId) === (n == null ? void 0 : n.productId))) !== void 0)
1831
- return r;
1832
- const o = n.items[0].images.find(
1785
+ }), oe = (t, e) => t.reduce((n, r) => {
1786
+ if (r.items.filter(
1787
+ (i) => i.sellers.find((l) => l.commertialOffer.IsAvailable)
1788
+ ).length === 0 || (n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.productId) === (r == null ? void 0 : r.productId))) !== void 0)
1789
+ return n;
1790
+ const o = r.items[0].images.find(
1833
1791
  (i) => e.includes(i.imageLabel)
1834
1792
  );
1835
- return r.push({
1836
- slug: `/${n.linkText}/p`,
1837
- productId: n == null ? void 0 : n.productId,
1793
+ return n.push({
1794
+ slug: `/${r.linkText}/p`,
1795
+ productId: r == null ? void 0 : r.productId,
1838
1796
  textureImage: (o == null ? void 0 : o.imageUrl) ?? "",
1839
1797
  textureAlt: (o == null ? void 0 : o.imageText) ?? ""
1840
- }), r;
1841
- }, []), Er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1798
+ }), n;
1799
+ }, []), yr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
1842
1800
  __proto__: null,
1843
- createEmptySeoCategory: yr,
1844
- createSeoCategory: br,
1845
- findCategory: Ir,
1801
+ createEmptySeoCategory: ur,
1802
+ createSeoCategory: dr,
1803
+ findCategory: mr,
1846
1804
  formattedSimilars: oe,
1847
- isCollectionPageType: vr,
1848
- notFindCategoryError: Cr,
1849
- responseAdapter: Sr
1850
- }, Symbol.toStringTag, { value: "Module" })), Tr = {
1851
- parseSearchState: ge,
1852
- convertSearchParams: fe,
1853
- filterNonRootFacets: me,
1854
- filterNonCategorySelected: pe
1855
- }, Fr = async ({ children: t, apiUrl: e, productId: r, ClientItems: n, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
1856
- const u = await fetch(
1857
- `${e}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`
1858
- ).then((p) => p.json()), c = oe(u, o);
1805
+ isCollectionPageType: gr,
1806
+ notFindCategoryError: pr,
1807
+ responseAdapter: hr
1808
+ }, Symbol.toStringTag, { value: "Module" })), br = async ({ children: t, apiUrl: e, productId: n, ClientItems: r, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
1809
+ const l = await fetch(
1810
+ `${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`
1811
+ ).then((m) => m.json()), c = oe(l, o);
1859
1812
  return /* @__PURE__ */ N("div", { className: M.similars, children: [
1860
1813
  /* @__PURE__ */ N("div", { className: M["similars-info"], children: [
1861
1814
  /* @__PURE__ */ b("span", { className: M["sections-title"], children: s.product.color_title }),
1862
1815
  t
1863
1816
  ] }),
1864
- /* @__PURE__ */ b(n, { productId: r, similars: c, TOGGLE_STYLE_MODIFIER: i })
1817
+ /* @__PURE__ */ b(r, { productId: n, similars: c, TOGGLE_STYLE_MODIFIER: i })
1865
1818
  ] });
1866
- }, wr = {
1867
- checkout: At,
1868
- catalog: Dt,
1869
- cms: he,
1870
- search: sr,
1871
- masterdata: mr,
1819
+ }, Er = {
1820
+ checkout: vt,
1821
+ catalog: qt,
1822
+ cms: me,
1823
+ search: Xt,
1824
+ masterdata: or,
1872
1825
  wishlist: {
1873
- ...gr
1826
+ ...cr
1874
1827
  }
1875
- }, Nr = {
1876
- catalog: Er,
1877
- search: Tr,
1878
- product: Ie,
1828
+ }, Tr = {
1829
+ catalog: yr,
1830
+ search: he,
1831
+ product: ge,
1879
1832
  cms: {
1880
- ...be,
1881
- ...ye
1833
+ ...fe,
1834
+ ...pe
1882
1835
  }
1883
- }, kr = {
1836
+ }, Fr = {
1884
1837
  template: {
1885
- pdp: { PDPSimilars: Fr }
1838
+ pdp: { PDPSimilars: br }
1886
1839
  }
1887
1840
  };
1888
1841
  export {
1889
- wr as serverAPIs,
1890
- Pr as serverCMS,
1891
- kr as serverComponents,
1892
- Nr as serverHelpers
1842
+ Er as serverAPIs,
1843
+ Sr as serverCMS,
1844
+ Fr as serverComponents,
1845
+ Tr as serverHelpers
1893
1846
  };