@soma-vertical-web/multi-lib 0.0.53 → 0.0.55

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