@soma-vertical-web/multi-lib 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cms/ContentTypes/Footer/Footer.d.ts +1 -1
- package/cms/Sections/Banner/Composite/Content.d.ts +1 -1
- package/cms/Sections/ProductCarousel/ProductCarousel.d.ts +2 -2
- package/cms/index.d.ts +2 -2
- package/cms/server.d.ts +1 -1
- package/contexts/hooks/useOperations.d.ts +1 -1
- package/index-4WXjd-uR.js +4 -0
- package/index-4tOP7lCS.js +4 -0
- package/index-ByhWQJ9Z.mjs +1844 -0
- package/index-CCvTne7y.mjs +1826 -0
- package/index.js +13 -13
- package/index.mjs +3952 -3828
- package/index2.js +1 -1
- package/index2.mjs +407 -404
- package/layout/index.d.ts +3 -3
- package/layout/team-component/BackToTop/BackToTop.d.ts +1 -1
- package/layout/team-component/Footer/Footer.d.ts +1 -1
- package/layout/team-component/ProductList/Composite/Card/Actions.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/Composite/Sku.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/Composite/Style.d.ts +1 -1
- package/layout/template/MiniCart/Composite/Card/index.d.ts +2 -2
- package/layout/template/PDC/Composite/Grid/Banners.d.ts +1 -1
- package/layout/template/PDC/Composite/InfiniteScroller/Banners/Banners.d.ts +1 -1
- package/layout/template/SearchModal/Composite/Recommendations.d.ts +4 -2
- package/layout/template/SearchModal/SearchModal.d.ts +1 -1
- package/package.json +1 -1
- package/server.d.ts +16 -0
- package/style.css +1 -1
- package/types/cms/ContentTypes/Footer/index.d.ts +1 -0
- package/types/cms/Sections/BannerCarousel/index.d.ts +2 -1
- package/types/cms/Sections/SectionZone/index.d.ts +1 -0
- package/types/layout/team-components/BackToTop/index.d.ts +1 -0
- package/types/layout/templates/PLP/index.d.ts +2 -2
- package/types/layout/templates/SearchModal/index.d.ts +1 -2
package/index2.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as b, jsxs as N, Fragment as L } from "react/jsx-runtime";
|
|
2
|
-
import { x as E, 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,
|
|
2
|
+
import { x as E, 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-ByhWQJ9Z.mjs";
|
|
3
3
|
import { Utils as D, helpers as _ } from "@soma-vertical-web/core-components";
|
|
4
4
|
import * as a from "yup";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import Ce from "sanitize-html";
|
|
6
|
+
const Re = async ({
|
|
7
7
|
children: t,
|
|
8
8
|
ClientCartProvider: e,
|
|
9
9
|
...n
|
|
@@ -13,7 +13,7 @@ const Ie = async ({
|
|
|
13
13
|
n
|
|
14
14
|
);
|
|
15
15
|
return /* @__PURE__ */ b(e, { ...r ? Array.isArray(r) ? { data: r[0] } : { data: r } : {}, children: t });
|
|
16
|
-
},
|
|
16
|
+
}, ve = ({
|
|
17
17
|
slug: t,
|
|
18
18
|
data: e,
|
|
19
19
|
SectionZone: n,
|
|
@@ -22,20 +22,20 @@ const Ie = async ({
|
|
|
22
22
|
}) => {
|
|
23
23
|
const o = e == null ? void 0 : e.find(
|
|
24
24
|
(d) => {
|
|
25
|
-
var C,
|
|
26
|
-
return ((
|
|
25
|
+
var C, m, p, y;
|
|
26
|
+
return ((m = (C = d.config) == null ? void 0 : C.responsive) == null ? void 0 : m.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,
|
|
28
|
+
), i = o == null ? void 0 : o.config.responsive.gapCustom, c = o == null ? void 0 : o.config.responsive.gapSections, l = e == null ? void 0 : e.find(
|
|
29
29
|
(d) => {
|
|
30
|
-
var C,
|
|
31
|
-
return ((
|
|
30
|
+
var C, m, p, y;
|
|
31
|
+
return ((m = (C = d.config) == null ? void 0 : C.responsive) == null ? void 0 : m.deviceType) === "mobile" && ((y = (p = d.config) == null ? void 0 : p.seo) == null ? void 0 : y.slug) === t;
|
|
32
32
|
}
|
|
33
|
-
),
|
|
33
|
+
), f = l == null ? void 0 : l.config.responsive.gapCustom, u = l == null ? void 0 : l.config.responsive.gapSections;
|
|
34
34
|
return /* @__PURE__ */ N(L, { children: [
|
|
35
35
|
/* @__PURE__ */ b(
|
|
36
36
|
D.Column,
|
|
37
37
|
{
|
|
38
|
-
gap: i &&
|
|
38
|
+
gap: i && c ? c : r,
|
|
39
39
|
className: _.classNameConcat(
|
|
40
40
|
j["responsive-desktop-flex"],
|
|
41
41
|
"utils-column-modifier"
|
|
@@ -46,16 +46,16 @@ const Ie = async ({
|
|
|
46
46
|
/* @__PURE__ */ b(
|
|
47
47
|
D.Column,
|
|
48
48
|
{
|
|
49
|
-
gap:
|
|
49
|
+
gap: f && u ? u : r,
|
|
50
50
|
className: _.classNameConcat(
|
|
51
51
|
j["responsive-mobile-flex"],
|
|
52
52
|
"utils-column-modifier"
|
|
53
53
|
),
|
|
54
|
-
children: /* @__PURE__ */ b(n, { data: (
|
|
54
|
+
children: /* @__PURE__ */ b(n, { data: (l == null ? void 0 : l.sections) ?? [], identifyWhoIsFirst: s })
|
|
55
55
|
}
|
|
56
56
|
)
|
|
57
57
|
] });
|
|
58
|
-
},
|
|
58
|
+
}, Se = async ({
|
|
59
59
|
slug: t,
|
|
60
60
|
SectionZone: e,
|
|
61
61
|
COMMON_PAGE_COLUMN_GAP: n,
|
|
@@ -67,7 +67,7 @@ const Ie = async ({
|
|
|
67
67
|
s
|
|
68
68
|
);
|
|
69
69
|
return !o || !Array.isArray(o) || o.length === 0 ? null : /* @__PURE__ */ b(
|
|
70
|
-
|
|
70
|
+
ve,
|
|
71
71
|
{
|
|
72
72
|
data: o,
|
|
73
73
|
slug: t,
|
|
@@ -76,7 +76,7 @@ const Ie = async ({
|
|
|
76
76
|
identifyWhoIsFirst: r
|
|
77
77
|
}
|
|
78
78
|
);
|
|
79
|
-
},
|
|
79
|
+
}, Ee = async ({
|
|
80
80
|
children: t,
|
|
81
81
|
ClientFlagsAndTagsProvider: e,
|
|
82
82
|
...n
|
|
@@ -86,7 +86,7 @@ const Ie = async ({
|
|
|
86
86
|
n
|
|
87
87
|
);
|
|
88
88
|
return !r || !Array.isArray(r) ? null : /* @__PURE__ */ b(e, { data: r[0], children: t });
|
|
89
|
-
},
|
|
89
|
+
}, Te = async ({
|
|
90
90
|
className: t,
|
|
91
91
|
PAYMENT_FLAGS_DICTIONARY: e,
|
|
92
92
|
PAYMENT_FLAGS: n,
|
|
@@ -94,35 +94,34 @@ const Ie = async ({
|
|
|
94
94
|
ICONS: s,
|
|
95
95
|
SectionZone: o,
|
|
96
96
|
Footer: i,
|
|
97
|
-
FooterSupport:
|
|
98
|
-
|
|
97
|
+
FooterSupport: c,
|
|
98
|
+
hasFooterStamps: l,
|
|
99
|
+
...f
|
|
99
100
|
}) => {
|
|
100
|
-
var
|
|
101
|
-
const { data:
|
|
102
|
-
|
|
103
|
-
u
|
|
104
|
-
), c = Array.isArray(m) && ((C = m[0]) == null ? void 0 : C.type) === "footer" ? m[0] : null, d = {
|
|
105
|
-
...(f = c == null ? void 0 : c.paymentInfo) == null ? void 0 : f.paymentInfo,
|
|
101
|
+
var m, p, y, I, F, O, $, g, S, R, T;
|
|
102
|
+
const { data: u } = await E("footer", f), d = Array.isArray(u) && ((m = u[0]) == null ? void 0 : m.type) === "footer" ? u[0] : null, C = {
|
|
103
|
+
...(p = d == null ? void 0 : d.paymentInfo) == null ? void 0 : p.paymentInfo,
|
|
106
104
|
acceptedFlags: Array.isArray(
|
|
107
|
-
(
|
|
108
|
-
) ? (
|
|
109
|
-
(
|
|
105
|
+
(y = d == null ? void 0 : d.paymentInfo) == null ? void 0 : y.paymentInfo.acceptedFlags
|
|
106
|
+
) ? (I = d == null ? void 0 : d.paymentInfo) == null ? void 0 : I.paymentInfo.acceptedFlags.filter((v) => !!e[v]).map(
|
|
107
|
+
(v) => e[v]
|
|
110
108
|
) : []
|
|
111
109
|
};
|
|
112
|
-
return
|
|
110
|
+
return d ? /* @__PURE__ */ b(
|
|
113
111
|
i,
|
|
114
112
|
{
|
|
115
113
|
className: t,
|
|
116
|
-
data: { ...
|
|
117
|
-
socialInfo: (
|
|
118
|
-
socialMedias: (
|
|
119
|
-
payments:
|
|
114
|
+
data: { ...d },
|
|
115
|
+
socialInfo: (F = d.socialMedia) == null ? void 0 : F.socialMedia,
|
|
116
|
+
socialMedias: ($ = (O = d.socialMedia) == null ? void 0 : O.socialMedia) == null ? void 0 : $.medias,
|
|
117
|
+
payments: C,
|
|
118
|
+
hasFooterStamps: l,
|
|
120
119
|
adornment: {
|
|
121
|
-
...(
|
|
120
|
+
...(S = (g = d.supportInfo) == null ? void 0 : g.supportInfo) != null && S.content ? {
|
|
122
121
|
bottom: /* @__PURE__ */ b(
|
|
123
|
-
|
|
122
|
+
c,
|
|
124
123
|
{
|
|
125
|
-
content: (
|
|
124
|
+
content: (T = (R = d.supportInfo) == null ? void 0 : R.supportInfo) == null ? void 0 : T.content,
|
|
126
125
|
CONSTANTS: {
|
|
127
126
|
ICONS: s,
|
|
128
127
|
PAYMENT_FLAGS: n,
|
|
@@ -131,18 +130,18 @@ const Ie = async ({
|
|
|
131
130
|
}
|
|
132
131
|
)
|
|
133
132
|
} : {},
|
|
134
|
-
...
|
|
133
|
+
...d.sections.length ? { top: /* @__PURE__ */ b(o, { data: d.sections }) } : {}
|
|
135
134
|
},
|
|
136
135
|
LEGAL_INFORMATION_TEXT: r,
|
|
137
136
|
ICONS: s
|
|
138
137
|
}
|
|
139
138
|
) : null;
|
|
140
|
-
},
|
|
139
|
+
}, Fe = async ({
|
|
141
140
|
children: t,
|
|
142
141
|
ClientHeaderProvider: e,
|
|
143
142
|
...n
|
|
144
143
|
}) => {
|
|
145
|
-
var o, i,
|
|
144
|
+
var o, i, c, l, f, u;
|
|
146
145
|
const { data: r } = await E(
|
|
147
146
|
"header",
|
|
148
147
|
n
|
|
@@ -153,15 +152,15 @@ const Ie = async ({
|
|
|
153
152
|
headerData: {
|
|
154
153
|
...((o = s == null ? void 0 : s.layerConfig) == null ? void 0 : o.config) ?? {},
|
|
155
154
|
subMenus: ((i = s == null ? void 0 : s.sections) == null ? void 0 : i.map((d) => d.data)) ?? [],
|
|
156
|
-
categories: ((
|
|
157
|
-
navigationLinks: ((
|
|
155
|
+
categories: ((l = (c = s == null ? void 0 : s.categories) == null ? void 0 : c.categories) == null ? void 0 : l.items) ?? [],
|
|
156
|
+
navigationLinks: ((u = (f = s == null ? void 0 : s.navigationLinks) == null ? void 0 : f.navigationLinks) == null ? void 0 : u.items) ?? []
|
|
158
157
|
},
|
|
159
158
|
children: t
|
|
160
159
|
}
|
|
161
160
|
);
|
|
162
|
-
},
|
|
163
|
-
var i,
|
|
164
|
-
const e = (
|
|
161
|
+
}, Oe = (t) => {
|
|
162
|
+
var i, c;
|
|
163
|
+
const e = (c = (i = t[0]) == null ? void 0 : i.items) == null ? void 0 : c.items;
|
|
165
164
|
if ((e == null ? void 0 : e.items.length) === 0 || t.length === 0)
|
|
166
165
|
return {
|
|
167
166
|
iconLabel: "",
|
|
@@ -169,17 +168,17 @@ const Ie = async ({
|
|
|
169
168
|
content: []
|
|
170
169
|
};
|
|
171
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(
|
|
172
|
-
(
|
|
173
|
-
type:
|
|
174
|
-
id: `${
|
|
175
|
-
title:
|
|
176
|
-
subtitle:
|
|
177
|
-
description:
|
|
178
|
-
buttonLabel:
|
|
179
|
-
buttonHref:
|
|
180
|
-
buttonMode:
|
|
181
|
-
buttonSize:
|
|
182
|
-
buttonIcon:
|
|
171
|
+
(l, f) => ({
|
|
172
|
+
type: l.type,
|
|
173
|
+
id: `${f.toString()}-${l.title.toLowerCase()}`,
|
|
174
|
+
title: l.title,
|
|
175
|
+
subtitle: l.subtitle,
|
|
176
|
+
description: l.description,
|
|
177
|
+
buttonLabel: l.buttonLabel,
|
|
178
|
+
buttonHref: l.buttonHref,
|
|
179
|
+
buttonMode: l.buttonMode,
|
|
180
|
+
buttonSize: l.buttonSize,
|
|
181
|
+
buttonIcon: l.buttonIcon
|
|
183
182
|
})
|
|
184
183
|
);
|
|
185
184
|
return {
|
|
@@ -188,7 +187,7 @@ const Ie = async ({
|
|
|
188
187
|
helpButtonSize: s,
|
|
189
188
|
content: o
|
|
190
189
|
};
|
|
191
|
-
},
|
|
190
|
+
}, $e = async ({
|
|
192
191
|
HelpButton: t,
|
|
193
192
|
ICONS: e,
|
|
194
193
|
className: n,
|
|
@@ -200,7 +199,7 @@ const Ie = async ({
|
|
|
200
199
|
);
|
|
201
200
|
if (!s || !Array.isArray(s) || s.length === 0)
|
|
202
201
|
return null;
|
|
203
|
-
const o =
|
|
202
|
+
const o = Oe(s);
|
|
204
203
|
return /* @__PURE__ */ b(
|
|
205
204
|
t,
|
|
206
205
|
{
|
|
@@ -209,24 +208,24 @@ const Ie = async ({
|
|
|
209
208
|
className: n
|
|
210
209
|
}
|
|
211
210
|
);
|
|
212
|
-
},
|
|
211
|
+
}, qe = async ({
|
|
213
212
|
SectionZone: t,
|
|
214
213
|
LPCadastro: e,
|
|
215
214
|
...n
|
|
216
215
|
}) => {
|
|
217
|
-
var
|
|
216
|
+
var l;
|
|
218
217
|
const { data: r } = await E(
|
|
219
218
|
"lp_cadastro",
|
|
220
219
|
n
|
|
221
220
|
);
|
|
222
221
|
if (!r || !Array.isArray(r) || r.length === 0)
|
|
223
222
|
return null;
|
|
224
|
-
const [s] = r, o = (s == null ? void 0 : s.sections) || [], i = ((
|
|
223
|
+
const [s] = r, o = (s == null ? void 0 : s.sections) || [], i = ((l = s == null ? void 0 : s.content) == null ? void 0 : l.conteúdo) || {}, c = s == null ? void 0 : s.sections;
|
|
225
224
|
return /* @__PURE__ */ N(L, { children: [
|
|
226
225
|
/* @__PURE__ */ b(e, { sections: o, content: i }),
|
|
227
|
-
/* @__PURE__ */ b(t, { data:
|
|
226
|
+
/* @__PURE__ */ b(t, { data: c })
|
|
228
227
|
] });
|
|
229
|
-
},
|
|
228
|
+
}, Ae = async ({
|
|
230
229
|
children: t,
|
|
231
230
|
productId: e,
|
|
232
231
|
COMMON_PAGE_COLUMN_GAP: n,
|
|
@@ -248,9 +247,9 @@ const Ie = async ({
|
|
|
248
247
|
children: t
|
|
249
248
|
}
|
|
250
249
|
);
|
|
251
|
-
},
|
|
250
|
+
}, Pe = {
|
|
252
251
|
"column-modifier": "_column-modifier_1tqap_1"
|
|
253
|
-
},
|
|
252
|
+
}, we = async ({
|
|
254
253
|
className: t,
|
|
255
254
|
children: e,
|
|
256
255
|
slug: n,
|
|
@@ -259,31 +258,31 @@ const Ie = async ({
|
|
|
259
258
|
PLPContentProvider: o,
|
|
260
259
|
...i
|
|
261
260
|
}) => {
|
|
262
|
-
const { data:
|
|
261
|
+
const { data: c } = await E(
|
|
263
262
|
"categories_page",
|
|
264
263
|
i
|
|
265
264
|
);
|
|
266
|
-
if (!
|
|
265
|
+
if (!c || !Array.isArray(c))
|
|
267
266
|
return null;
|
|
268
|
-
const
|
|
269
|
-
(
|
|
267
|
+
const l = c.find(
|
|
268
|
+
(m) => {
|
|
270
269
|
var p, y, I;
|
|
271
|
-
return ((p =
|
|
270
|
+
return ((p = m.config) == null ? void 0 : p.seo.slug) === n && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
|
|
272
271
|
}
|
|
273
|
-
),
|
|
274
|
-
(
|
|
272
|
+
), f = c.find(
|
|
273
|
+
(m) => {
|
|
275
274
|
var p, y, I;
|
|
276
|
-
return ((p =
|
|
275
|
+
return ((p = m.config) == null ? void 0 : p.seo.slug) === n && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
|
|
277
276
|
}
|
|
278
|
-
),
|
|
279
|
-
(
|
|
277
|
+
), u = c.find(
|
|
278
|
+
(m) => {
|
|
280
279
|
var p, y, I;
|
|
281
|
-
return ((p =
|
|
280
|
+
return ((p = m.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "desktop";
|
|
282
281
|
}
|
|
283
|
-
), d =
|
|
284
|
-
(
|
|
282
|
+
), d = c.find(
|
|
283
|
+
(m) => {
|
|
285
284
|
var p, y, I;
|
|
286
|
-
return ((p =
|
|
285
|
+
return ((p = m.config) == null ? void 0 : p.seo.slug) === "default" && ((I = (y = m.config) == null ? void 0 : y.responsive) == null ? void 0 : I.deviceType) === "mobile";
|
|
287
286
|
}
|
|
288
287
|
), C = Array.isArray(t) ? t : [t];
|
|
289
288
|
return /* @__PURE__ */ N(L, { children: [
|
|
@@ -292,7 +291,7 @@ const Ie = async ({
|
|
|
292
291
|
{
|
|
293
292
|
className: _.classNameConcat(
|
|
294
293
|
j["responsive-desktop-flex"],
|
|
295
|
-
[
|
|
294
|
+
[Pe["column-modifier"], ...C]
|
|
296
295
|
),
|
|
297
296
|
style: {
|
|
298
297
|
minHeight: "100vh"
|
|
@@ -300,7 +299,7 @@ const Ie = async ({
|
|
|
300
299
|
children: /* @__PURE__ */ b(
|
|
301
300
|
o,
|
|
302
301
|
{
|
|
303
|
-
data:
|
|
302
|
+
data: l ?? u,
|
|
304
303
|
device: "desktop",
|
|
305
304
|
SectionZone: r,
|
|
306
305
|
COMMON_PAGE_COLUMN_GAP_PDC: s,
|
|
@@ -312,7 +311,7 @@ const Ie = async ({
|
|
|
312
311
|
/* @__PURE__ */ b(D.Column, { className: _.classNameConcat(j["responsive-mobile-flex"], t), children: /* @__PURE__ */ b(
|
|
313
312
|
o,
|
|
314
313
|
{
|
|
315
|
-
data:
|
|
314
|
+
data: f ?? d,
|
|
316
315
|
device: "mobile",
|
|
317
316
|
SectionZone: r,
|
|
318
317
|
COMMON_PAGE_COLUMN_GAP_PDC: s,
|
|
@@ -320,8 +319,8 @@ const Ie = async ({
|
|
|
320
319
|
}
|
|
321
320
|
) })
|
|
322
321
|
] });
|
|
323
|
-
},
|
|
324
|
-
var i,
|
|
322
|
+
}, Ne = async ({ slug: t, ...e }) => {
|
|
323
|
+
var i, c, l;
|
|
325
324
|
const { data: n } = await E(
|
|
326
325
|
"redirect_to_search",
|
|
327
326
|
e
|
|
@@ -332,7 +331,7 @@ const Ie = async ({
|
|
|
332
331
|
query: null,
|
|
333
332
|
redirect: !1
|
|
334
333
|
};
|
|
335
|
-
const r = ((
|
|
334
|
+
const r = ((l = (c = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : l.paths) ?? [];
|
|
336
335
|
if (!!!r.length)
|
|
337
336
|
return {
|
|
338
337
|
slug: t,
|
|
@@ -340,9 +339,9 @@ const Ie = async ({
|
|
|
340
339
|
redirect: !1
|
|
341
340
|
};
|
|
342
341
|
const o = r.find(
|
|
343
|
-
(
|
|
344
|
-
var
|
|
345
|
-
return ((
|
|
342
|
+
(f) => {
|
|
343
|
+
var u, d;
|
|
344
|
+
return ((u = f.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = f.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
|
|
346
345
|
}
|
|
347
346
|
);
|
|
348
347
|
return o ? {
|
|
@@ -360,21 +359,21 @@ const Ie = async ({
|
|
|
360
359
|
filters: null,
|
|
361
360
|
sort: null
|
|
362
361
|
};
|
|
363
|
-
},
|
|
364
|
-
var i,
|
|
362
|
+
}, ke = async ({ slug: t, ...e }) => {
|
|
363
|
+
var i, c, l;
|
|
365
364
|
const { data: n } = await E(
|
|
366
365
|
"redirect_to_search",
|
|
367
366
|
e
|
|
368
367
|
);
|
|
369
368
|
if (!n || !Array.isArray(n))
|
|
370
369
|
return null;
|
|
371
|
-
const r = ((
|
|
370
|
+
const r = ((l = (c = (i = n[0]) == null ? void 0 : i.redirectToSearch) == null ? void 0 : c.redirectToSearch) == null ? void 0 : l.paths) ?? [];
|
|
372
371
|
if (!!!r.length)
|
|
373
372
|
return null;
|
|
374
373
|
const o = r.find(
|
|
375
|
-
(
|
|
376
|
-
var
|
|
377
|
-
return ((
|
|
374
|
+
(f) => {
|
|
375
|
+
var u, d;
|
|
376
|
+
return ((u = f.path) == null ? void 0 : u.replace(/\//g, "-").toLowerCase()) === t.replace(/\//g, "-").toLowerCase() || ((d = f.path) == null ? void 0 : d.replace(/\//g, "-").toLowerCase()) === `/${t}`.replace(/\//g, "-").toLowerCase();
|
|
378
377
|
}
|
|
379
378
|
);
|
|
380
379
|
return o ? {
|
|
@@ -382,7 +381,7 @@ const Ie = async ({
|
|
|
382
381
|
title: o.pageTitle,
|
|
383
382
|
description: o.pageDescription
|
|
384
383
|
} : null;
|
|
385
|
-
},
|
|
384
|
+
}, je = async ({
|
|
386
385
|
children: t,
|
|
387
386
|
SectionZone: e,
|
|
388
387
|
className: n,
|
|
@@ -401,7 +400,7 @@ const Ie = async ({
|
|
|
401
400
|
children: t
|
|
402
401
|
}
|
|
403
402
|
) : /* @__PURE__ */ b(L, { children: "children" });
|
|
404
|
-
},
|
|
403
|
+
}, De = async ({
|
|
405
404
|
ClientTipbarContent: t,
|
|
406
405
|
...e
|
|
407
406
|
}) => {
|
|
@@ -410,21 +409,21 @@ const Ie = async ({
|
|
|
410
409
|
e
|
|
411
410
|
);
|
|
412
411
|
return /* @__PURE__ */ b(t, { data: n });
|
|
413
|
-
},
|
|
414
|
-
CommonPageContent:
|
|
415
|
-
CartContent:
|
|
416
|
-
FlagsAndTagsContent:
|
|
417
|
-
HeaderContent:
|
|
418
|
-
TipbarContent:
|
|
419
|
-
FooterContent:
|
|
420
|
-
PLPContent:
|
|
421
|
-
PDPContent:
|
|
422
|
-
getRedirectData:
|
|
423
|
-
getPLPSynteticMetaData:
|
|
424
|
-
SearchPageContent:
|
|
425
|
-
HelpButtonContent:
|
|
426
|
-
LPCadastroContent:
|
|
427
|
-
},
|
|
412
|
+
}, _e = {
|
|
413
|
+
CommonPageContent: Se,
|
|
414
|
+
CartContent: Re,
|
|
415
|
+
FlagsAndTagsContent: Ee,
|
|
416
|
+
HeaderContent: Fe,
|
|
417
|
+
TipbarContent: De,
|
|
418
|
+
FooterContent: Te,
|
|
419
|
+
PLPContent: we,
|
|
420
|
+
PDPContent: Ae,
|
|
421
|
+
getRedirectData: Ne,
|
|
422
|
+
getPLPSynteticMetaData: ke,
|
|
423
|
+
SearchPageContent: je,
|
|
424
|
+
HelpButtonContent: $e,
|
|
425
|
+
LPCadastroContent: qe
|
|
426
|
+
}, Fr = { Components: _e }, h = async (t, e = {}) => {
|
|
428
427
|
const { method: n = "GET", body: r, headers: s = {}, priority: o = "auto", cache: i = "default" } = e;
|
|
429
428
|
return fetch(t, {
|
|
430
429
|
method: n,
|
|
@@ -437,11 +436,11 @@ const Ie = async ({
|
|
|
437
436
|
cache: i,
|
|
438
437
|
...r ? { body: JSON.stringify(r) } : {}
|
|
439
438
|
// not body in get
|
|
440
|
-
}).then((
|
|
441
|
-
console.error("[ERROR FETCH VTEX]",
|
|
439
|
+
}).then((c) => c.json()).catch((c) => {
|
|
440
|
+
console.error("[ERROR FETCH VTEX]", c);
|
|
442
441
|
});
|
|
443
442
|
}, w = /* @__PURE__ */ new Map();
|
|
444
|
-
async function
|
|
443
|
+
async function He(t, e = {}) {
|
|
445
444
|
var n;
|
|
446
445
|
try {
|
|
447
446
|
const { abort: r = !1 } = e, s = new AbortController();
|
|
@@ -459,16 +458,16 @@ async function De(t, e = {}) {
|
|
|
459
458
|
throw console.error(`[ERROR API]: ${r.message}`), r;
|
|
460
459
|
}
|
|
461
460
|
}
|
|
462
|
-
const
|
|
461
|
+
const Be = a.object({
|
|
463
462
|
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
464
463
|
postalCode: a.string().nullable()
|
|
465
464
|
});
|
|
466
|
-
async function
|
|
465
|
+
async function Le({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
467
466
|
if (!e) {
|
|
468
467
|
console.error("[ERROR FETCHING] Body is required");
|
|
469
468
|
return;
|
|
470
469
|
}
|
|
471
|
-
await
|
|
470
|
+
await Be.validate(e);
|
|
472
471
|
const { country: r, postalCode: s } = e;
|
|
473
472
|
return await h(
|
|
474
473
|
`${t}/api/checkout/pub/postal-code/${r}/${s}`,
|
|
@@ -479,7 +478,7 @@ async function He({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
479
478
|
}
|
|
480
479
|
);
|
|
481
480
|
}
|
|
482
|
-
const
|
|
481
|
+
const Ge = a.object({
|
|
483
482
|
orderFormId: a.string().nullable(),
|
|
484
483
|
sellerCode: a.string().nullable(),
|
|
485
484
|
sellerName: a.string().nullable()
|
|
@@ -493,7 +492,7 @@ async function K({
|
|
|
493
492
|
console.error("[ERROR FETCHING] Body is required");
|
|
494
493
|
return;
|
|
495
494
|
}
|
|
496
|
-
await
|
|
495
|
+
await Ge.validate(e);
|
|
497
496
|
const { orderFormId: r, sellerCode: s, sellerName: o } = e, i = s ? `${s.trim()} - ${o}` : null;
|
|
498
497
|
return h(
|
|
499
498
|
`${t}/api/checkout/pub/orderForm/${r}/attachments/openTextField`,
|
|
@@ -506,7 +505,7 @@ async function K({
|
|
|
506
505
|
}
|
|
507
506
|
);
|
|
508
507
|
}
|
|
509
|
-
const
|
|
508
|
+
const Me = a.object({
|
|
510
509
|
orderFormId: a.string().nullable(),
|
|
511
510
|
sellerCode: a.string().nullable(),
|
|
512
511
|
marketingData: a.object()
|
|
@@ -521,8 +520,8 @@ async function J({
|
|
|
521
520
|
console.error("[ERROR FETCHING] Body is required");
|
|
522
521
|
return;
|
|
523
522
|
}
|
|
524
|
-
await
|
|
525
|
-
const { orderFormId: s, sellerCode: o, marketingData: i } = e,
|
|
523
|
+
await Me.validate(e);
|
|
524
|
+
const { orderFormId: s, sellerCode: o, marketingData: i } = e, c = o ? {
|
|
526
525
|
utmCampaign: o ? o.toUpperCase() : "",
|
|
527
526
|
utmiCampaign: o ? `${n.VENDOR_CODE}` : "semcodigo"
|
|
528
527
|
} : {};
|
|
@@ -532,23 +531,23 @@ async function J({
|
|
|
532
531
|
method: "POST",
|
|
533
532
|
body: {
|
|
534
533
|
...i,
|
|
535
|
-
...
|
|
534
|
+
...c
|
|
536
535
|
},
|
|
537
536
|
...r
|
|
538
537
|
}
|
|
539
538
|
);
|
|
540
539
|
}
|
|
541
|
-
const
|
|
540
|
+
const Ue = a.object({
|
|
542
541
|
orderFormId: a.string().nullable(),
|
|
543
542
|
sellerCode: a.string().nullable(),
|
|
544
543
|
sellerName: a.string().nullable()
|
|
545
544
|
});
|
|
546
|
-
async function
|
|
545
|
+
async function Ve({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
547
546
|
if (!e) {
|
|
548
547
|
console.error("[ERROR FETCHING] Body is required");
|
|
549
548
|
return;
|
|
550
549
|
}
|
|
551
|
-
await
|
|
550
|
+
await Ue.validate(e);
|
|
552
551
|
const r = await K({ apiUrl: t, body: e, fetchOptions: n });
|
|
553
552
|
return J({
|
|
554
553
|
apiUrl: t,
|
|
@@ -559,11 +558,11 @@ async function Me({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
559
558
|
fetchOptions: n
|
|
560
559
|
});
|
|
561
560
|
}
|
|
562
|
-
const
|
|
561
|
+
const ze = a.object({
|
|
563
562
|
orderFormId: a.string().nullable(),
|
|
564
563
|
coupon: a.string().nullable()
|
|
565
564
|
});
|
|
566
|
-
async function
|
|
565
|
+
async function xe({
|
|
567
566
|
apiUrl: t,
|
|
568
567
|
body: e,
|
|
569
568
|
fetchOptions: n
|
|
@@ -572,7 +571,7 @@ async function Ve({
|
|
|
572
571
|
console.error("[ERROR FETCHING] Body is required");
|
|
573
572
|
return;
|
|
574
573
|
}
|
|
575
|
-
await
|
|
574
|
+
await ze.validate(e);
|
|
576
575
|
const { coupon: r = "", orderFormId: s } = e;
|
|
577
576
|
return h(
|
|
578
577
|
`${t}/api/checkout/pub/orderForm/${s}/coupons`,
|
|
@@ -583,12 +582,12 @@ async function Ve({
|
|
|
583
582
|
}
|
|
584
583
|
);
|
|
585
584
|
}
|
|
586
|
-
const
|
|
585
|
+
const Qe = a.object({
|
|
587
586
|
appId: a.string().required("App ID is required"),
|
|
588
587
|
orderFormId: a.string().nullable(),
|
|
589
588
|
key: a.array().of(a.string())
|
|
590
589
|
});
|
|
591
|
-
async function
|
|
590
|
+
async function Ke({
|
|
592
591
|
apiUrl: t,
|
|
593
592
|
body: e,
|
|
594
593
|
fetchOptions: n
|
|
@@ -597,7 +596,7 @@ async function xe({
|
|
|
597
596
|
console.error("[ERROR FETCHING] Body is required");
|
|
598
597
|
return;
|
|
599
598
|
}
|
|
600
|
-
await
|
|
599
|
+
await Qe.validate(e);
|
|
601
600
|
const { appId: r = "faststore", orderFormId: s, key: o } = e;
|
|
602
601
|
return h(
|
|
603
602
|
`${t}/api/checkout/pub/orderForm/${s}/customData/${r}/${o}`,
|
|
@@ -607,23 +606,23 @@ async function xe({
|
|
|
607
606
|
}
|
|
608
607
|
);
|
|
609
608
|
}
|
|
610
|
-
const
|
|
609
|
+
const Je = a.object().shape({
|
|
611
610
|
name: a.string().required("Attachment name is required"),
|
|
612
611
|
content: a.object().nullable()
|
|
613
612
|
});
|
|
614
613
|
var x;
|
|
615
|
-
const
|
|
616
|
-
attachments: (x = a.array().of(
|
|
614
|
+
const Ye = a.object().shape({
|
|
615
|
+
attachments: (x = a.array().of(Je)) == null ? void 0 : x.nullable(),
|
|
617
616
|
id: a.string().required("ID of SKU is required"),
|
|
618
617
|
index: a.number().integer().nullable(),
|
|
619
618
|
quantity: a.number().integer().nullable(),
|
|
620
619
|
seller: a.string().required("Seller is required"),
|
|
621
620
|
price: a.number().integer()
|
|
622
|
-
}),
|
|
621
|
+
}), We = a.object({
|
|
623
622
|
orderFormId: a.string().required("OrderFormId is required"),
|
|
624
|
-
orderItems: a.array().of(
|
|
623
|
+
orderItems: a.array().of(Ye)
|
|
625
624
|
});
|
|
626
|
-
async function
|
|
625
|
+
async function Xe({
|
|
627
626
|
apiUrl: t,
|
|
628
627
|
body: e,
|
|
629
628
|
fetchOptions: n
|
|
@@ -632,7 +631,7 @@ async function Ye({
|
|
|
632
631
|
console.error("[ERROR FETCHING] Body is required");
|
|
633
632
|
return;
|
|
634
633
|
}
|
|
635
|
-
await
|
|
634
|
+
await We.validate(e);
|
|
636
635
|
const { orderFormId: r, orderItems: s } = e;
|
|
637
636
|
return h(
|
|
638
637
|
`${t}/api/checkout/pub/orderForm/${r}/items`,
|
|
@@ -643,10 +642,10 @@ async function Ye({
|
|
|
643
642
|
}
|
|
644
643
|
);
|
|
645
644
|
}
|
|
646
|
-
const
|
|
645
|
+
const Ze = a.object({
|
|
647
646
|
orderFormId: a.string().nullable()
|
|
648
647
|
});
|
|
649
|
-
async function
|
|
648
|
+
async function et({
|
|
650
649
|
apiUrl: t,
|
|
651
650
|
body: e,
|
|
652
651
|
fetchOptions: n
|
|
@@ -655,7 +654,7 @@ async function Xe({
|
|
|
655
654
|
console.error("[ERROR FETCHING] Body is required");
|
|
656
655
|
return;
|
|
657
656
|
}
|
|
658
|
-
await
|
|
657
|
+
await Ze.validate(e);
|
|
659
658
|
const { orderFormId: r } = e;
|
|
660
659
|
return h(
|
|
661
660
|
`${t}/api/checkout/pub/orderForm/${r}/items/removeAll`,
|
|
@@ -665,23 +664,23 @@ async function Xe({
|
|
|
665
664
|
}
|
|
666
665
|
);
|
|
667
666
|
}
|
|
668
|
-
const
|
|
667
|
+
const tt = a.object().shape({
|
|
669
668
|
name: a.string().required("Attachment name is required"),
|
|
670
669
|
content: a.object().nullable()
|
|
671
670
|
});
|
|
672
671
|
var Q;
|
|
673
|
-
const
|
|
674
|
-
attachments: (Q = a.array().of(
|
|
672
|
+
const rt = a.object().shape({
|
|
673
|
+
attachments: (Q = a.array().of(tt)) == null ? void 0 : Q.nullable(),
|
|
675
674
|
id: a.string().required("ID of SKU is required"),
|
|
676
675
|
index: a.number().integer().nullable(),
|
|
677
676
|
quantity: a.number().integer().nullable(),
|
|
678
677
|
seller: a.string().required("Seller is required"),
|
|
679
678
|
price: a.number().integer()
|
|
680
|
-
}),
|
|
679
|
+
}), nt = a.object({
|
|
681
680
|
orderFormId: a.string().nullable(),
|
|
682
|
-
orderItems: a.array().of(
|
|
681
|
+
orderItems: a.array().of(rt)
|
|
683
682
|
});
|
|
684
|
-
async function
|
|
683
|
+
async function at({
|
|
685
684
|
apiUrl: t,
|
|
686
685
|
body: e,
|
|
687
686
|
fetchOptions: n
|
|
@@ -690,7 +689,7 @@ async function rt({
|
|
|
690
689
|
console.error("[ERROR FETCHING] Body is required");
|
|
691
690
|
return;
|
|
692
691
|
}
|
|
693
|
-
await
|
|
692
|
+
await nt.validate(e);
|
|
694
693
|
const { orderFormId: r, orderItems: s } = e;
|
|
695
694
|
return h(
|
|
696
695
|
`${t}/api/checkout/pub/orderForm/${r}/items/update`,
|
|
@@ -701,10 +700,10 @@ async function rt({
|
|
|
701
700
|
}
|
|
702
701
|
);
|
|
703
702
|
}
|
|
704
|
-
const
|
|
703
|
+
const st = a.object({
|
|
705
704
|
orderFormId: a.string().nullable()
|
|
706
705
|
});
|
|
707
|
-
async function
|
|
706
|
+
async function ot({
|
|
708
707
|
apiUrl: t,
|
|
709
708
|
body: e,
|
|
710
709
|
fetchOptions: n
|
|
@@ -713,7 +712,7 @@ async function at({
|
|
|
713
712
|
console.error("[ERROR FETCHING] Body is required");
|
|
714
713
|
return;
|
|
715
714
|
}
|
|
716
|
-
await
|
|
715
|
+
await st.validate(e);
|
|
717
716
|
const { orderFormId: r } = e;
|
|
718
717
|
return h(
|
|
719
718
|
`${t}/api/checkout/pub/orderForm/${r}/messages/clear`,
|
|
@@ -723,30 +722,30 @@ async function at({
|
|
|
723
722
|
}
|
|
724
723
|
);
|
|
725
724
|
}
|
|
726
|
-
const
|
|
725
|
+
const it = a.object({
|
|
727
726
|
id: a.string().nullable(),
|
|
728
727
|
// id offering
|
|
729
728
|
itemIndex: a.number().nullable(),
|
|
730
729
|
orderFormId: a.string().nullable(),
|
|
731
730
|
remove: a.boolean().nullable()
|
|
732
731
|
});
|
|
733
|
-
async function
|
|
732
|
+
async function ct({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
734
733
|
if (!e) {
|
|
735
734
|
console.error("[ERROR FETCHING] Body is required");
|
|
736
735
|
return;
|
|
737
736
|
}
|
|
738
|
-
await
|
|
739
|
-
const { itemIndex: r, orderFormId: s, id: o, remove: i } = e,
|
|
740
|
-
return h(
|
|
737
|
+
await it.validate(e);
|
|
738
|
+
const { itemIndex: r, orderFormId: s, id: o, remove: i } = e, c = i ? `/${o}/remove` : "", l = `${t}/api/checkout/pub/orderForm/${s}/items/${r}/offerings${c}`;
|
|
739
|
+
return h(l, {
|
|
741
740
|
method: "POST",
|
|
742
741
|
body: { id: o },
|
|
743
742
|
...n
|
|
744
743
|
});
|
|
745
744
|
}
|
|
746
|
-
const
|
|
745
|
+
const lt = a.object({
|
|
747
746
|
orderFormId: a.string().nullable()
|
|
748
747
|
});
|
|
749
|
-
async function
|
|
748
|
+
async function ut({
|
|
750
749
|
apiUrl: t,
|
|
751
750
|
body: e,
|
|
752
751
|
fetchOptions: n,
|
|
@@ -757,13 +756,13 @@ async function ct({
|
|
|
757
756
|
console.error("[ERROR FETCHING] Body is required");
|
|
758
757
|
return;
|
|
759
758
|
}
|
|
760
|
-
await
|
|
759
|
+
await lt.validate(e);
|
|
761
760
|
const s = new URLSearchParams({
|
|
762
761
|
refreshOutdatedData: "true"
|
|
763
762
|
}), 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`;
|
|
764
763
|
return h(o, { method: "GET", ...n });
|
|
765
764
|
}
|
|
766
|
-
const
|
|
765
|
+
const dt = a.object({
|
|
767
766
|
orderFormId: a.string().nullable(),
|
|
768
767
|
email: a.string().email().required(),
|
|
769
768
|
firstName: a.string().required(),
|
|
@@ -772,7 +771,7 @@ const lt = a.object({
|
|
|
772
771
|
document: a.string().required(),
|
|
773
772
|
phone: a.string().matches(/^\+\d{1,3}\d{10,11}$/)
|
|
774
773
|
});
|
|
775
|
-
async function
|
|
774
|
+
async function pt({
|
|
776
775
|
apiUrl: t,
|
|
777
776
|
body: e,
|
|
778
777
|
fetchOptions: n
|
|
@@ -781,7 +780,7 @@ async function ut({
|
|
|
781
780
|
console.error("[ERROR FETCHING] Body is required");
|
|
782
781
|
return;
|
|
783
782
|
}
|
|
784
|
-
await
|
|
783
|
+
await dt.validate(e);
|
|
785
784
|
const { orderFormId: r, ...s } = e;
|
|
786
785
|
return h(
|
|
787
786
|
`${t}/api/checkout/pub/orderForm/${r}/attachments/clientProfileData`,
|
|
@@ -792,10 +791,10 @@ async function ut({
|
|
|
792
791
|
}
|
|
793
792
|
);
|
|
794
793
|
}
|
|
795
|
-
const
|
|
794
|
+
const mt = a.object({
|
|
796
795
|
sellerCode: a.string().nullable()
|
|
797
796
|
});
|
|
798
|
-
async function
|
|
797
|
+
async function ft({
|
|
799
798
|
apiUrl: t,
|
|
800
799
|
body: e,
|
|
801
800
|
extraData: n,
|
|
@@ -805,7 +804,7 @@ async function pt({
|
|
|
805
804
|
console.error("[ERROR FETCHING] Body is required");
|
|
806
805
|
return;
|
|
807
806
|
}
|
|
808
|
-
await
|
|
807
|
+
await mt.validate(e);
|
|
809
808
|
const { sellerCode: s = "" } = e;
|
|
810
809
|
return h(
|
|
811
810
|
`${t}/api/dataentities/${n.ENTITIES}/search?_fields=${n.FIELDS}&${n.FILTER}=${s}`,
|
|
@@ -818,12 +817,12 @@ async function pt({
|
|
|
818
817
|
}
|
|
819
818
|
);
|
|
820
819
|
}
|
|
821
|
-
const
|
|
820
|
+
const gt = a.object().shape({
|
|
822
821
|
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
823
822
|
orderFormId: a.string().nullable(),
|
|
824
823
|
postalCode: a.string().nullable()
|
|
825
824
|
});
|
|
826
|
-
async function
|
|
825
|
+
async function ht({
|
|
827
826
|
apiUrl: t,
|
|
828
827
|
body: e,
|
|
829
828
|
fetchOptions: n
|
|
@@ -832,7 +831,7 @@ async function ft({
|
|
|
832
831
|
console.error("[ERROR FETCHING] Body is required");
|
|
833
832
|
return;
|
|
834
833
|
}
|
|
835
|
-
await
|
|
834
|
+
await gt.validate(e);
|
|
836
835
|
const { country: r, orderFormId: s, postalCode: o } = e, i = o ? {
|
|
837
836
|
address: {
|
|
838
837
|
addressType: "residential",
|
|
@@ -852,7 +851,7 @@ async function ft({
|
|
|
852
851
|
}
|
|
853
852
|
);
|
|
854
853
|
}
|
|
855
|
-
const
|
|
854
|
+
const yt = a.object().shape({
|
|
856
855
|
orderFormId: a.string().nullable(),
|
|
857
856
|
options: a.array().of(
|
|
858
857
|
a.object().shape({
|
|
@@ -880,12 +879,12 @@ const gt = a.object().shape({
|
|
|
880
879
|
})
|
|
881
880
|
)
|
|
882
881
|
});
|
|
883
|
-
async function
|
|
882
|
+
async function bt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
884
883
|
if (!e) {
|
|
885
884
|
console.error("[ERROR FETCHING] Body is required");
|
|
886
885
|
return;
|
|
887
886
|
}
|
|
888
|
-
await
|
|
887
|
+
await yt.validate(e);
|
|
889
888
|
const { orderFormId: r, options: s, selectedAddresses: o } = e;
|
|
890
889
|
return h(
|
|
891
890
|
`${t}/api/checkout/pub/orderForm/${r}/attachments/shippingData`,
|
|
@@ -900,7 +899,7 @@ async function ht({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
900
899
|
}
|
|
901
900
|
);
|
|
902
901
|
}
|
|
903
|
-
const
|
|
902
|
+
const It = a.object({
|
|
904
903
|
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
905
904
|
postalCode: a.string().nullable(),
|
|
906
905
|
geoCoordinates: a.object().shape({
|
|
@@ -908,12 +907,12 @@ const yt = a.object({
|
|
|
908
907
|
latitude: a.number().required()
|
|
909
908
|
})
|
|
910
909
|
});
|
|
911
|
-
async function
|
|
910
|
+
async function Ct({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
912
911
|
if (!e) {
|
|
913
912
|
console.error("[ERROR FETCHING] Body is required");
|
|
914
913
|
return;
|
|
915
914
|
}
|
|
916
|
-
await
|
|
915
|
+
await It.validate(e);
|
|
917
916
|
const { country: r = "", geoCoordinates: s, postalCode: o = "" } = e, i = new URLSearchParams({ country: String(r) });
|
|
918
917
|
return o ? i.append("postalCode", o) : i.append(
|
|
919
918
|
"geoCoordinates",
|
|
@@ -926,22 +925,22 @@ async function bt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
926
925
|
}
|
|
927
926
|
);
|
|
928
927
|
}
|
|
929
|
-
const
|
|
928
|
+
const Rt = a.object({
|
|
930
929
|
id: a.string().required("ID of SKU is required"),
|
|
931
930
|
quantity: a.number().integer().required("Quantity of item is required"),
|
|
932
931
|
seller: a.string()
|
|
933
|
-
}),
|
|
934
|
-
items: a.array().of(
|
|
932
|
+
}), vt = a.object({
|
|
933
|
+
items: a.array().of(Rt),
|
|
935
934
|
country: a.string().length(3, "Country code must be 3 characters long").required("Country is required"),
|
|
936
935
|
postalCode: a.string().nullable(),
|
|
937
936
|
geoCoordinates: a.array().nullable().of(a.number()).length(2)
|
|
938
937
|
});
|
|
939
|
-
async function
|
|
938
|
+
async function St({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
940
939
|
if (!e) {
|
|
941
940
|
console.error("[ERROR FETCHING] Body is required");
|
|
942
941
|
return;
|
|
943
942
|
}
|
|
944
|
-
return await
|
|
943
|
+
return await vt.validate(e), h(
|
|
945
944
|
`${t}/api/checkout/pub/orderForms/simulation`,
|
|
946
945
|
{
|
|
947
946
|
method: "POST",
|
|
@@ -950,35 +949,35 @@ async function Rt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
950
949
|
}
|
|
951
950
|
);
|
|
952
951
|
}
|
|
953
|
-
const
|
|
952
|
+
const Et = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
954
953
|
__proto__: null,
|
|
955
|
-
getMasterDataSellerCode:
|
|
956
|
-
getOrderForm:
|
|
957
|
-
postOrderFormAddCoupon:
|
|
958
|
-
postOrderFormAttachClientProfileData:
|
|
959
|
-
postOrderFormAttachOrderFormData:
|
|
960
|
-
postOrderFormAttachShippingData:
|
|
954
|
+
getMasterDataSellerCode: ft,
|
|
955
|
+
getOrderForm: ut,
|
|
956
|
+
postOrderFormAddCoupon: xe,
|
|
957
|
+
postOrderFormAttachClientProfileData: pt,
|
|
958
|
+
postOrderFormAttachOrderFormData: Ve,
|
|
959
|
+
postOrderFormAttachShippingData: ht,
|
|
961
960
|
postOrderFormAttachmentsMarketingData: J,
|
|
962
961
|
postOrderFormAttachmentsOpenTextField: K,
|
|
963
|
-
postOrderFormClearMessages:
|
|
964
|
-
postOrderFormFreightSimulation:
|
|
965
|
-
postOrderFormItems:
|
|
966
|
-
postOrderFormRegion:
|
|
967
|
-
postOrderFormRemoveAllItems:
|
|
968
|
-
postOrderFormUpdateItems:
|
|
969
|
-
postOrderFormUpdateShippingData:
|
|
970
|
-
postOrderformAddress:
|
|
971
|
-
putOrderFormCustomData:
|
|
972
|
-
updateOrderFormOffering:
|
|
973
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
962
|
+
postOrderFormClearMessages: ot,
|
|
963
|
+
postOrderFormFreightSimulation: St,
|
|
964
|
+
postOrderFormItems: Xe,
|
|
965
|
+
postOrderFormRegion: Ct,
|
|
966
|
+
postOrderFormRemoveAllItems: et,
|
|
967
|
+
postOrderFormUpdateItems: at,
|
|
968
|
+
postOrderFormUpdateShippingData: bt,
|
|
969
|
+
postOrderformAddress: Le,
|
|
970
|
+
putOrderFormCustomData: Ke,
|
|
971
|
+
updateOrderFormOffering: ct
|
|
972
|
+
}, Symbol.toStringTag, { value: "Module" })), Tt = a.object({
|
|
974
973
|
skuId: a.string()
|
|
975
974
|
});
|
|
976
|
-
async function
|
|
975
|
+
async function Ft({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
977
976
|
if (!e) {
|
|
978
977
|
console.error("[ERROR FETCHING] Body is required");
|
|
979
978
|
return;
|
|
980
979
|
}
|
|
981
|
-
await
|
|
980
|
+
await Tt.validate(e);
|
|
982
981
|
const { skuId: r } = e;
|
|
983
982
|
return h(
|
|
984
983
|
`${t}/api/catalog/pvt/stockkeepingunitkit?parentSkuId=${r}`,
|
|
@@ -987,15 +986,15 @@ async function Et({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
987
986
|
}
|
|
988
987
|
);
|
|
989
988
|
}
|
|
990
|
-
const
|
|
989
|
+
const Ot = a.object({
|
|
991
990
|
ids: a.array().of(a.string().required("ID are required")).required("IDs are required")
|
|
992
991
|
});
|
|
993
|
-
async function
|
|
992
|
+
async function $t({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
994
993
|
if (!e) {
|
|
995
994
|
console.error("[ERROR FETCHING] Body is required");
|
|
996
995
|
return;
|
|
997
996
|
}
|
|
998
|
-
await
|
|
997
|
+
await Ot.validate(e);
|
|
999
998
|
const { ids: r } = e;
|
|
1000
999
|
return h(
|
|
1001
1000
|
`${t}/api/catalog_system/pub/products/search?fq=${r.map((s) => `productId:${s}`).join("&fq=")}`,
|
|
@@ -1004,15 +1003,15 @@ async function Ft({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
1004
1003
|
}
|
|
1005
1004
|
);
|
|
1006
1005
|
}
|
|
1007
|
-
const
|
|
1006
|
+
const qt = a.object({
|
|
1008
1007
|
productId: a.number().required("Product ID is required")
|
|
1009
1008
|
});
|
|
1010
|
-
async function
|
|
1009
|
+
async function At({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1011
1010
|
if (!e) {
|
|
1012
1011
|
console.error("[ERROR FETCHING] Body is required");
|
|
1013
1012
|
return;
|
|
1014
1013
|
}
|
|
1015
|
-
await
|
|
1014
|
+
await qt.validate(e);
|
|
1016
1015
|
const { productId: r } = e;
|
|
1017
1016
|
return h(
|
|
1018
1017
|
`${t}/api/catalog_system/pub/products/crossselling/similars/${r.toString()}`,
|
|
@@ -1021,15 +1020,15 @@ async function $t({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
1021
1020
|
}
|
|
1022
1021
|
);
|
|
1023
1022
|
}
|
|
1024
|
-
const
|
|
1023
|
+
const Pt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1025
1024
|
__proto__: null,
|
|
1026
|
-
getCatalogKitProducts:
|
|
1027
|
-
getCatalogProducts:
|
|
1028
|
-
getCatalogSimilars:
|
|
1029
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1025
|
+
getCatalogKitProducts: Ft,
|
|
1026
|
+
getCatalogProducts: $t,
|
|
1027
|
+
getCatalogSimilars: At
|
|
1028
|
+
}, Symbol.toStringTag, { value: "Module" })), wt = a.object({
|
|
1030
1029
|
query: a.string()
|
|
1031
1030
|
});
|
|
1032
|
-
async function
|
|
1031
|
+
async function Nt({
|
|
1033
1032
|
apiUrl: t,
|
|
1034
1033
|
body: e,
|
|
1035
1034
|
fetchOptions: n
|
|
@@ -1038,7 +1037,7 @@ async function Pt({
|
|
|
1038
1037
|
console.error("[ERROR FETCHING] Body is required");
|
|
1039
1038
|
return;
|
|
1040
1039
|
}
|
|
1041
|
-
await
|
|
1040
|
+
await wt.validate(e);
|
|
1042
1041
|
const { query: r = "" } = e, s = new URLSearchParams({ query: r });
|
|
1043
1042
|
return h(
|
|
1044
1043
|
`${t}/api/io/_v/api/intelligent-search/autocomplete_suggestions?${s.toString()}`,
|
|
@@ -1047,10 +1046,10 @@ async function Pt({
|
|
|
1047
1046
|
}
|
|
1048
1047
|
);
|
|
1049
1048
|
}
|
|
1050
|
-
const
|
|
1049
|
+
const kt = (t, e) => Ce(t, e), jt = (t) => ({
|
|
1051
1050
|
...t,
|
|
1052
|
-
description: t.description ?
|
|
1053
|
-
}),
|
|
1051
|
+
description: t.description ? kt(t.description) : t.description
|
|
1052
|
+
}), Dt = ({
|
|
1054
1053
|
offer: t,
|
|
1055
1054
|
seller: e,
|
|
1056
1055
|
product: n
|
|
@@ -1060,8 +1059,8 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1060
1059
|
seller: e
|
|
1061
1060
|
}), Y = (t, e) => ({
|
|
1062
1061
|
...t,
|
|
1063
|
-
isVariantOf:
|
|
1064
|
-
}),
|
|
1062
|
+
isVariantOf: jt(e)
|
|
1063
|
+
}), _t = (t) => t ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", k = (t) => t.AvailableQuantity > 0, U = (t) => t.spotPrice ?? 0, Ht = (t) => t.Price ?? 0, W = (t, e) => k(t) && !k(e) ? -1 : !k(t) && k(e) ? 1 : U(t) - U(e), Bt = (t, e) => {
|
|
1065
1064
|
let n = 0;
|
|
1066
1065
|
for (let r = 1; r < t.length; r++)
|
|
1067
1066
|
e(t[n], t[r]) > 0 && (n = r);
|
|
@@ -1072,7 +1071,7 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1072
1071
|
offer: s.commertialOffer,
|
|
1073
1072
|
sku: r
|
|
1074
1073
|
}))
|
|
1075
|
-
), n =
|
|
1074
|
+
), n = Bt(
|
|
1076
1075
|
e,
|
|
1077
1076
|
({ offer: r }, { offer: s }) => W(r, s)
|
|
1078
1077
|
);
|
|
@@ -1087,11 +1086,11 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1087
1086
|
attachment: "ATTACHMENT",
|
|
1088
1087
|
specification: "SPECIFICATION",
|
|
1089
1088
|
attribute: "ATTRIBUTE"
|
|
1090
|
-
},
|
|
1089
|
+
}, Lt = (t) => ({
|
|
1091
1090
|
name: t.name,
|
|
1092
1091
|
value: t.content,
|
|
1093
1092
|
valueReference: H.attachment
|
|
1094
|
-
}),
|
|
1093
|
+
}), Gt = (t) => ({
|
|
1095
1094
|
propertyID: t.id,
|
|
1096
1095
|
name: t.name,
|
|
1097
1096
|
value: t.value,
|
|
@@ -1100,31 +1099,31 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1100
1099
|
visible: t.visible
|
|
1101
1100
|
}
|
|
1102
1101
|
}), B = (t, e, n) => {
|
|
1103
|
-
const r = t.flatMap(({ name: i, values:
|
|
1102
|
+
const r = t.flatMap(({ name: i, values: c }) => c ? c.map((l) => ({
|
|
1104
1103
|
name: i,
|
|
1105
|
-
value:
|
|
1104
|
+
value: l,
|
|
1106
1105
|
valueReference: H.specification
|
|
1107
1106
|
})) : {
|
|
1108
1107
|
name: i,
|
|
1109
1108
|
value: "",
|
|
1110
1109
|
valueReference: H.specification
|
|
1111
|
-
}), s = Array.isArray(n) ? n.map(
|
|
1110
|
+
}), s = Array.isArray(n) ? n.map(Lt) : [], o = e ? e.map(Gt) : [];
|
|
1112
1111
|
return [
|
|
1113
1112
|
...r,
|
|
1114
1113
|
...s,
|
|
1115
1114
|
...o
|
|
1116
1115
|
];
|
|
1117
|
-
}, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a",
|
|
1116
|
+
}, V = "ÁÄÂÀÃÅČÇĆĎÉĚËÈÊẼĔȆÍÌÎÏŇÑÓÖÒÔÕØŘŔŠŤÚŮÜÙÛÝŸŽáäâàãåčçćďéěëèêẽĕȇíìîïňñóöòôõøðřŕšťúůüùûýÿžþÞĐđ߯a", Mt = "AAAAAACCCDEEEEEEEEIIIINNOOOOOORRSTUUUUUYYZaaaaaacccdeeeeeeeeiiiinnooooooorrstuuuuuyyzbBDdBAa", Ut = (t) => {
|
|
1118
1117
|
let e = t.slice(0);
|
|
1119
1118
|
for (let n = 0; n < V.length; n++)
|
|
1120
1119
|
e = e.replace(
|
|
1121
1120
|
new RegExp(V.charAt(n), "g"),
|
|
1122
|
-
|
|
1121
|
+
Mt.charAt(n)
|
|
1123
1122
|
);
|
|
1124
1123
|
return e;
|
|
1125
|
-
},
|
|
1124
|
+
}, Vt = (t) => t.replace(/[·/_,:]/, "-"), ee = (t) => {
|
|
1126
1125
|
const n = t.replace(/,/g, "").replace(/[*+~.()'"!:@&\[\]`/ %$#?{}|><=_^]/g, "-");
|
|
1127
|
-
return
|
|
1126
|
+
return Vt(Ut(n)).toLowerCase();
|
|
1128
1127
|
}, te = (t) => `/${t}/p`, re = (t) => {
|
|
1129
1128
|
const e = Math.max(
|
|
1130
1129
|
...t.map((r) => r.NumberOfInstallments)
|
|
@@ -1141,7 +1140,7 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1141
1140
|
listPrice: 0,
|
|
1142
1141
|
sellerDefault: !1
|
|
1143
1142
|
}, s = t.map(
|
|
1144
|
-
(o) =>
|
|
1143
|
+
(o) => Dt({
|
|
1145
1144
|
offer: o.commertialOffer,
|
|
1146
1145
|
seller: o,
|
|
1147
1146
|
product: e
|
|
@@ -1149,7 +1148,7 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1149
1148
|
).sort(W).map((o) => (o.seller.sellerId === "1" && o.AvailableQuantity > 0 && (n.price = o.Price, n.listPrice = o.ListPrice, n.sellerDefault = !0), {
|
|
1150
1149
|
availability: o.AvailableQuantity > 0,
|
|
1151
1150
|
listPrice: o.ListPrice,
|
|
1152
|
-
price:
|
|
1151
|
+
price: Ht(o),
|
|
1153
1152
|
priceValidUntil: o.PriceValidUntil,
|
|
1154
1153
|
priceCurrency: "BRL",
|
|
1155
1154
|
installments: o.Installments,
|
|
@@ -1170,11 +1169,11 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1170
1169
|
additionalProperty: B(o, e, []),
|
|
1171
1170
|
name: r,
|
|
1172
1171
|
offers: {
|
|
1173
|
-
offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer:
|
|
1174
|
-
availability:
|
|
1175
|
-
listPrice:
|
|
1176
|
-
price:
|
|
1177
|
-
quantity:
|
|
1172
|
+
offers: s == null ? void 0 : s.map(({ sellerId: i, commertialOffer: c }) => ({
|
|
1173
|
+
availability: _t(c.AvailableQuantity > 0),
|
|
1174
|
+
listPrice: c.ListPrice,
|
|
1175
|
+
price: c.Price,
|
|
1176
|
+
quantity: c.AvailableQuantity,
|
|
1178
1177
|
seller: {
|
|
1179
1178
|
identifier: i
|
|
1180
1179
|
}
|
|
@@ -1183,8 +1182,8 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1183
1182
|
sku: n
|
|
1184
1183
|
// slug: getSlug('', itemId), // getSlug('', itemId) que tipo de slug é esse?
|
|
1185
1184
|
};
|
|
1186
|
-
},
|
|
1187
|
-
var
|
|
1185
|
+
}, zt = (t) => {
|
|
1186
|
+
var v;
|
|
1188
1187
|
const {
|
|
1189
1188
|
attributes: e,
|
|
1190
1189
|
referenceId: n,
|
|
@@ -1192,14 +1191,14 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1192
1191
|
images: s,
|
|
1193
1192
|
itemId: o,
|
|
1194
1193
|
name: i,
|
|
1195
|
-
sellers:
|
|
1196
|
-
videos:
|
|
1197
|
-
variations:
|
|
1194
|
+
sellers: c,
|
|
1195
|
+
videos: l,
|
|
1196
|
+
variations: f
|
|
1198
1197
|
} = t, {
|
|
1199
|
-
brand:
|
|
1198
|
+
brand: u,
|
|
1200
1199
|
categories: d,
|
|
1201
1200
|
categoriesIds: C,
|
|
1202
|
-
description:
|
|
1201
|
+
description: m,
|
|
1203
1202
|
linkText: p,
|
|
1204
1203
|
productClusters: y,
|
|
1205
1204
|
clusterHighlights: I,
|
|
@@ -1207,21 +1206,21 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1207
1206
|
properties: O,
|
|
1208
1207
|
productId: $,
|
|
1209
1208
|
productReference: g
|
|
1210
|
-
} = r,
|
|
1209
|
+
} = r, S = d.slice().reverse(), R = ne(c, t.isVariantOf), T = re(R.offers[0].installments);
|
|
1211
1210
|
return {
|
|
1212
1211
|
sku: o,
|
|
1213
|
-
gtin: ((
|
|
1212
|
+
gtin: ((v = n == null ? void 0 : n[0]) == null ? void 0 : v.Value) ?? g ?? "",
|
|
1214
1213
|
name: F ?? i,
|
|
1215
|
-
description:
|
|
1214
|
+
description: m,
|
|
1216
1215
|
releaseDate: r.releaseDate ?? "",
|
|
1217
1216
|
slug: p,
|
|
1218
|
-
video:
|
|
1217
|
+
video: l[0],
|
|
1219
1218
|
categories: d,
|
|
1220
1219
|
categoriesIds: C,
|
|
1221
1220
|
id: $,
|
|
1222
|
-
brand: { name:
|
|
1221
|
+
brand: { name: u, brandName: u },
|
|
1223
1222
|
seo: {
|
|
1224
|
-
description:
|
|
1223
|
+
description: m,
|
|
1225
1224
|
title: F,
|
|
1226
1225
|
canonical: te(p)
|
|
1227
1226
|
},
|
|
@@ -1233,7 +1232,7 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1233
1232
|
availability: { status: R.offers[0].availability },
|
|
1234
1233
|
breadcrumbList: {
|
|
1235
1234
|
itemListElement: [
|
|
1236
|
-
...
|
|
1235
|
+
...S.map((A, P) => {
|
|
1237
1236
|
const q = A.split("/"), G = q[q.length - 2], ie = q.map(ee).join("/");
|
|
1238
1237
|
return {
|
|
1239
1238
|
name: G,
|
|
@@ -1251,15 +1250,15 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1251
1250
|
},
|
|
1252
1251
|
image: Z(s),
|
|
1253
1252
|
offers: R,
|
|
1254
|
-
additionalProperty: B(
|
|
1253
|
+
additionalProperty: B(f, e, []),
|
|
1255
1254
|
isVariantOf: {
|
|
1256
1255
|
productGroupID: r.productId,
|
|
1257
1256
|
hasVariant: r.items.map((A) => ae(A))
|
|
1258
1257
|
},
|
|
1259
|
-
installments:
|
|
1258
|
+
installments: T
|
|
1260
1259
|
};
|
|
1261
|
-
},
|
|
1262
|
-
var
|
|
1260
|
+
}, xt = (t) => {
|
|
1261
|
+
var T;
|
|
1263
1262
|
const {
|
|
1264
1263
|
attributes: e,
|
|
1265
1264
|
referenceId: n,
|
|
@@ -1267,37 +1266,37 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1267
1266
|
images: s,
|
|
1268
1267
|
itemId: o,
|
|
1269
1268
|
name: i,
|
|
1270
|
-
sellers:
|
|
1271
|
-
Videos:
|
|
1272
|
-
variations:
|
|
1269
|
+
sellers: c,
|
|
1270
|
+
Videos: l,
|
|
1271
|
+
variations: f
|
|
1273
1272
|
} = t, {
|
|
1274
|
-
brand:
|
|
1273
|
+
brand: u,
|
|
1275
1274
|
categories: d,
|
|
1276
1275
|
categoriesIds: C,
|
|
1277
|
-
description:
|
|
1276
|
+
description: m,
|
|
1278
1277
|
linkText: p,
|
|
1279
1278
|
productClusters: y,
|
|
1280
1279
|
productName: I,
|
|
1281
1280
|
Coleção: F,
|
|
1282
1281
|
"ID Coleção": O,
|
|
1283
1282
|
productId: $
|
|
1284
|
-
} = r, g = d.slice().reverse(),
|
|
1283
|
+
} = r, g = d.slice().reverse(), S = ne(c, t.isVariantOf), R = re(S.offers[0].installments);
|
|
1285
1284
|
return {
|
|
1286
1285
|
sku: o,
|
|
1287
|
-
gtin: ((
|
|
1286
|
+
gtin: ((T = n[0]) == null ? void 0 : T.Value) ?? "",
|
|
1288
1287
|
name: I ?? i,
|
|
1289
|
-
description:
|
|
1288
|
+
description: m,
|
|
1290
1289
|
releaseDate: r.releaseDate ?? "",
|
|
1291
1290
|
slug: p,
|
|
1292
|
-
video:
|
|
1291
|
+
video: l[0],
|
|
1293
1292
|
categories: d,
|
|
1294
1293
|
categoriesIds: C,
|
|
1295
1294
|
collection: F,
|
|
1296
1295
|
collectionId: O,
|
|
1297
1296
|
id: $,
|
|
1298
|
-
brand: { name:
|
|
1297
|
+
brand: { name: u, brandName: u },
|
|
1299
1298
|
seo: {
|
|
1300
|
-
description:
|
|
1299
|
+
description: m,
|
|
1301
1300
|
title: I,
|
|
1302
1301
|
canonical: te(p)
|
|
1303
1302
|
},
|
|
@@ -1306,11 +1305,11 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1306
1305
|
highlights: []
|
|
1307
1306
|
// TODO: add highlights
|
|
1308
1307
|
},
|
|
1309
|
-
availability: { status:
|
|
1308
|
+
availability: { status: S.offers[0].availability },
|
|
1310
1309
|
breadcrumbList: {
|
|
1311
1310
|
itemListElement: [
|
|
1312
|
-
...g.map((
|
|
1313
|
-
const P =
|
|
1311
|
+
...g.map((v, A) => {
|
|
1312
|
+
const P = v.split("/"), q = P[P.length - 2], G = P.map(ee).join("/");
|
|
1314
1313
|
return {
|
|
1315
1314
|
name: q,
|
|
1316
1315
|
item: G,
|
|
@@ -1326,17 +1325,17 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1326
1325
|
numberOfItems: d.length
|
|
1327
1326
|
},
|
|
1328
1327
|
image: Z(s),
|
|
1329
|
-
offers:
|
|
1330
|
-
additionalProperty: B(
|
|
1328
|
+
offers: S,
|
|
1329
|
+
additionalProperty: B(f, e, []),
|
|
1331
1330
|
isVariantOf: {
|
|
1332
1331
|
productGroupID: r.productId,
|
|
1333
|
-
hasVariant: r.items.map((
|
|
1334
|
-
const { variations: A } =
|
|
1332
|
+
hasVariant: r.items.map((v) => {
|
|
1333
|
+
const { variations: A } = v, P = A.map((q) => ({
|
|
1335
1334
|
name: q,
|
|
1336
|
-
values:
|
|
1335
|
+
values: v[q]
|
|
1337
1336
|
}));
|
|
1338
1337
|
return {
|
|
1339
|
-
...ae(
|
|
1338
|
+
...ae(v),
|
|
1340
1339
|
additionalProperty: B(
|
|
1341
1340
|
P,
|
|
1342
1341
|
e,
|
|
@@ -1347,27 +1346,27 @@ const wt = (t, e) => be(t, e), Nt = (t) => ({
|
|
|
1347
1346
|
},
|
|
1348
1347
|
installments: R
|
|
1349
1348
|
};
|
|
1350
|
-
},
|
|
1349
|
+
}, Qt = a.array().of(a.object({
|
|
1351
1350
|
key: a.string().required(),
|
|
1352
1351
|
value: a.string().required()
|
|
1353
1352
|
})).required("Facets are required");
|
|
1354
|
-
async function
|
|
1353
|
+
async function Kt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1355
1354
|
if (!e) {
|
|
1356
1355
|
console.error("[ERROR FETCHING] Body is required");
|
|
1357
1356
|
return;
|
|
1358
1357
|
}
|
|
1359
|
-
await
|
|
1360
|
-
const r = new URLSearchParams({}), s = e.map(({ key: i, value:
|
|
1358
|
+
await Qt.validate(e);
|
|
1359
|
+
const r = new URLSearchParams({}), s = e.map(({ key: i, value: c }) => `${i}/${c}`).join("/");
|
|
1361
1360
|
le(e, r);
|
|
1362
1361
|
const o = `${t}/api/catalog_system/pub/products/crossselling/${s}`;
|
|
1363
1362
|
return h(o, {
|
|
1364
1363
|
cache: "no-store",
|
|
1365
1364
|
...n
|
|
1366
|
-
}).then((i) => i.map((
|
|
1367
|
-
const
|
|
1368
|
-
return
|
|
1369
|
-
}).filter((
|
|
1370
|
-
node:
|
|
1365
|
+
}).then((i) => i.map((l) => {
|
|
1366
|
+
const f = X(l.items);
|
|
1367
|
+
return f && Y(f, l);
|
|
1368
|
+
}).filter((l) => !!l).map((l) => ({
|
|
1369
|
+
node: xt(l)
|
|
1371
1370
|
})));
|
|
1372
1371
|
}
|
|
1373
1372
|
const se = ({
|
|
@@ -1384,22 +1383,22 @@ const se = ({
|
|
|
1384
1383
|
query: s = "",
|
|
1385
1384
|
page: o = 1,
|
|
1386
1385
|
count: i,
|
|
1387
|
-
sort:
|
|
1388
|
-
facets:
|
|
1389
|
-
type:
|
|
1390
|
-
hideUnavailableItems:
|
|
1386
|
+
sort: c = "",
|
|
1387
|
+
facets: l = [],
|
|
1388
|
+
type: f,
|
|
1389
|
+
hideUnavailableItems: u = !0,
|
|
1391
1390
|
locale: d = ""
|
|
1392
1391
|
} = e, C = new URLSearchParams({
|
|
1393
1392
|
page: o.toString(),
|
|
1394
1393
|
count: (i == null ? void 0 : i.toString()) ?? (r == null ? void 0 : r.ITEMS_PER_PAGE) ?? 24,
|
|
1395
1394
|
query: s,
|
|
1396
|
-
sort:
|
|
1395
|
+
sort: c,
|
|
1397
1396
|
locale: d
|
|
1398
1397
|
});
|
|
1399
|
-
|
|
1400
|
-
const
|
|
1401
|
-
return
|
|
1402
|
-
`${t}/api/io/_v/api/intelligent-search/${
|
|
1398
|
+
u !== void 0 && C.append("hideUnavailableItems", u.toString());
|
|
1399
|
+
const m = l.map((p) => `${p.key}/${p.value}`).join("/") ?? "";
|
|
1400
|
+
return He(
|
|
1401
|
+
`${t}/api/io/_v/api/intelligent-search/${f}/${m}?${C.toString()}`,
|
|
1403
1402
|
{
|
|
1404
1403
|
headers: {
|
|
1405
1404
|
Accept: "application/json",
|
|
@@ -1409,7 +1408,7 @@ const se = ({
|
|
|
1409
1408
|
}
|
|
1410
1409
|
);
|
|
1411
1410
|
};
|
|
1412
|
-
async function
|
|
1411
|
+
async function Jt({ body: t, extraData: e, ...n }) {
|
|
1413
1412
|
if (!t) {
|
|
1414
1413
|
console.error("[ERROR FETCHING] Body is required");
|
|
1415
1414
|
return;
|
|
@@ -1421,10 +1420,10 @@ async function Qt({ body: t, extraData: e, ...n }) {
|
|
|
1421
1420
|
},
|
|
1422
1421
|
extraData: e,
|
|
1423
1422
|
...n
|
|
1424
|
-
}), s = (r == null ? void 0 : r.products.map((
|
|
1425
|
-
const
|
|
1426
|
-
return
|
|
1427
|
-
}).filter((
|
|
1423
|
+
}), s = (r == null ? void 0 : r.products.map((c) => {
|
|
1424
|
+
const l = X(c.items);
|
|
1425
|
+
return l && Y(l, c);
|
|
1426
|
+
}).filter((c) => !!c)) ?? [], {
|
|
1428
1427
|
pagination: o,
|
|
1429
1428
|
recordsFiltered: i
|
|
1430
1429
|
} = r;
|
|
@@ -1438,14 +1437,14 @@ async function Qt({ body: t, extraData: e, ...n }) {
|
|
|
1438
1437
|
count: i,
|
|
1439
1438
|
total: o.count
|
|
1440
1439
|
},
|
|
1441
|
-
products: s.map((
|
|
1442
|
-
node:
|
|
1443
|
-
cursor:
|
|
1440
|
+
products: s.map((c, l) => ({
|
|
1441
|
+
node: zt(c),
|
|
1442
|
+
cursor: l.toString()
|
|
1444
1443
|
}))
|
|
1445
1444
|
}
|
|
1446
1445
|
};
|
|
1447
1446
|
}
|
|
1448
|
-
async function
|
|
1447
|
+
async function Yt({ body: t, extraData: e, ...n }) {
|
|
1449
1448
|
if (!t) {
|
|
1450
1449
|
console.error("[ERROR FETCHING] Body is required");
|
|
1451
1450
|
return;
|
|
@@ -1465,16 +1464,16 @@ async function Kt({ body: t, extraData: e, ...n }) {
|
|
|
1465
1464
|
}
|
|
1466
1465
|
};
|
|
1467
1466
|
}
|
|
1468
|
-
const
|
|
1467
|
+
const Wt = a.object({
|
|
1469
1468
|
query: a.string().optional(),
|
|
1470
1469
|
locale: a.string().optional()
|
|
1471
1470
|
});
|
|
1472
|
-
async function
|
|
1471
|
+
async function Xt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
1473
1472
|
if (!e) {
|
|
1474
1473
|
console.error("[ERROR FETCHING] Body is required");
|
|
1475
1474
|
return;
|
|
1476
1475
|
}
|
|
1477
|
-
await
|
|
1476
|
+
await Wt.validate(e);
|
|
1478
1477
|
const { query: r = "", locale: s = "default_locale" } = e, o = new URLSearchParams({ query: r, locale: s });
|
|
1479
1478
|
return h(
|
|
1480
1479
|
`${t}/api/io/_v/api/intelligent-search/search_suggestions?${o.toString()}`,
|
|
@@ -1483,22 +1482,22 @@ async function Yt({ apiUrl: t, body: e, fetchOptions: n }) {
|
|
|
1483
1482
|
}
|
|
1484
1483
|
);
|
|
1485
1484
|
}
|
|
1486
|
-
async function
|
|
1485
|
+
async function Zt({ apiUrl: t }) {
|
|
1487
1486
|
return h(`${t}/api/io/_v/api/intelligent-search/top_searches`);
|
|
1488
1487
|
}
|
|
1489
|
-
const
|
|
1488
|
+
const er = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1490
1489
|
__proto__: null,
|
|
1491
|
-
getSearchAutoCompleteSuggestions:
|
|
1492
|
-
getSearchCrossellingProducts:
|
|
1493
|
-
getSearchFacets:
|
|
1494
|
-
getSearchProducts:
|
|
1495
|
-
getSearchSuggestedTerms:
|
|
1496
|
-
getSearchTopSearchs:
|
|
1497
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1490
|
+
getSearchAutoCompleteSuggestions: Nt,
|
|
1491
|
+
getSearchCrossellingProducts: Kt,
|
|
1492
|
+
getSearchFacets: Yt,
|
|
1493
|
+
getSearchProducts: Jt,
|
|
1494
|
+
getSearchSuggestedTerms: Xt,
|
|
1495
|
+
getSearchTopSearchs: Zt
|
|
1496
|
+
}, Symbol.toStringTag, { value: "Module" })), tr = a.object({
|
|
1498
1497
|
masterDataEntity: a.string().nonNullable(),
|
|
1499
1498
|
payload: a.object().shape({}).nullable()
|
|
1500
1499
|
});
|
|
1501
|
-
async function
|
|
1500
|
+
async function rr({
|
|
1502
1501
|
apiUrl: t,
|
|
1503
1502
|
body: e,
|
|
1504
1503
|
fetchOptions: n
|
|
@@ -1507,7 +1506,7 @@ async function er({
|
|
|
1507
1506
|
console.error("[ERROR FETCHING] Body is required");
|
|
1508
1507
|
return;
|
|
1509
1508
|
}
|
|
1510
|
-
await
|
|
1509
|
+
await tr.validate(e);
|
|
1511
1510
|
const { masterDataEntity: r, payload: s } = e, o = `${t}/api/dataentities/${r}/documents`;
|
|
1512
1511
|
return h(o, {
|
|
1513
1512
|
method: "POST",
|
|
@@ -1517,21 +1516,21 @@ async function er({
|
|
|
1517
1516
|
...n
|
|
1518
1517
|
});
|
|
1519
1518
|
}
|
|
1520
|
-
const
|
|
1519
|
+
const nr = a.object().shape({
|
|
1521
1520
|
_where: a.string().optional(),
|
|
1522
1521
|
_fields: a.string().optional(),
|
|
1523
1522
|
_sort: a.string().optional(),
|
|
1524
1523
|
_from: a.number().integer().min(0).optional(),
|
|
1525
1524
|
_to: a.number().integer().min(0).optional(),
|
|
1526
1525
|
_keyword: a.string().optional()
|
|
1527
|
-
}),
|
|
1526
|
+
}), ar = a.object({
|
|
1528
1527
|
masterDataEntity: a.string().required(),
|
|
1529
|
-
searchFields:
|
|
1528
|
+
searchFields: nr,
|
|
1530
1529
|
headers: a.object().shape({
|
|
1531
1530
|
"REST-Range": a.string().notRequired()
|
|
1532
1531
|
})
|
|
1533
1532
|
});
|
|
1534
|
-
async function
|
|
1533
|
+
async function sr({
|
|
1535
1534
|
apiUrl: t,
|
|
1536
1535
|
body: e,
|
|
1537
1536
|
fetchOptions: n
|
|
@@ -1541,13 +1540,13 @@ async function nr({
|
|
|
1541
1540
|
return;
|
|
1542
1541
|
}
|
|
1543
1542
|
const r = new URLSearchParams();
|
|
1544
|
-
await
|
|
1543
|
+
await ar.validate(e);
|
|
1545
1544
|
const { masterDataEntity: s, searchFields: o, headers: i } = e;
|
|
1546
|
-
o && Object.entries(o).forEach(([
|
|
1547
|
-
r.append(
|
|
1545
|
+
o && Object.entries(o).forEach(([l, f]) => {
|
|
1546
|
+
r.append(l, String(f));
|
|
1548
1547
|
}), "_fields" in o || r == null || r.append("_fields", "_all");
|
|
1549
|
-
const
|
|
1550
|
-
return h(
|
|
1548
|
+
const c = `${t}/api/dataentities/${s}/search?${r.toString()}`;
|
|
1549
|
+
return h(c, {
|
|
1551
1550
|
headers: {
|
|
1552
1551
|
"REST-Range": i["REST-Range"] ?? "resources=0-20"
|
|
1553
1552
|
},
|
|
@@ -1555,12 +1554,12 @@ async function nr({
|
|
|
1555
1554
|
...n
|
|
1556
1555
|
});
|
|
1557
1556
|
}
|
|
1558
|
-
const
|
|
1557
|
+
const or = a.object({
|
|
1559
1558
|
dataEntityName: a.string().required(),
|
|
1560
1559
|
id: a.string().required(),
|
|
1561
1560
|
fieldsToBeUpdated: a.object().shape({})
|
|
1562
1561
|
});
|
|
1563
|
-
async function
|
|
1562
|
+
async function ir({
|
|
1564
1563
|
apiUrl: t,
|
|
1565
1564
|
body: e,
|
|
1566
1565
|
fetchOptions: n
|
|
@@ -1569,7 +1568,7 @@ async function sr({
|
|
|
1569
1568
|
console.error("[ERROR FETCHING] Body is required");
|
|
1570
1569
|
return;
|
|
1571
1570
|
}
|
|
1572
|
-
await
|
|
1571
|
+
await or.validate(e);
|
|
1573
1572
|
const { dataEntityName: r, id: s, fieldsToBeUpdated: o } = e, i = `${t}/api/dataentities/${r}/documents/${s}`;
|
|
1574
1573
|
return h(i, {
|
|
1575
1574
|
body: {
|
|
@@ -1579,112 +1578,112 @@ async function sr({
|
|
|
1579
1578
|
...n
|
|
1580
1579
|
});
|
|
1581
1580
|
}
|
|
1582
|
-
const
|
|
1581
|
+
const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1583
1582
|
__proto__: null,
|
|
1584
|
-
getSearchMasterdata:
|
|
1585
|
-
patchUpdateMasterdata:
|
|
1586
|
-
postMasterdata:
|
|
1583
|
+
getSearchMasterdata: sr,
|
|
1584
|
+
patchUpdateMasterdata: ir,
|
|
1585
|
+
postMasterdata: rr
|
|
1587
1586
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
1588
|
-
async function
|
|
1587
|
+
async function lr({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
1589
1588
|
const { productIds: s } = t;
|
|
1590
1589
|
if (!s)
|
|
1591
1590
|
return console.error("[ERROR FETCHING] productIds is required"), [];
|
|
1592
1591
|
const { NAME_SPLIT_SYMBOL: o } = n;
|
|
1593
1592
|
if (!o)
|
|
1594
1593
|
return console.error("[ERROR FETCHING] NAME_SPLIT_SYMBOL is required"), [];
|
|
1595
|
-
const i = s.map((
|
|
1594
|
+
const i = s.map((u) => typeof u == "string" || typeof u == "number" ? `productId:${u}` : "").join("&fq="), c = await h(
|
|
1596
1595
|
`${e}/api/catalog_system/pub/products/search?fq=${i}`,
|
|
1597
1596
|
{
|
|
1598
1597
|
...r
|
|
1599
1598
|
}
|
|
1600
|
-
),
|
|
1601
|
-
return
|
|
1599
|
+
), l = (u) => Object.keys(u).map((d) => ({ id: d, name: u[d] }));
|
|
1600
|
+
return c.map((u, d) => {
|
|
1602
1601
|
var $;
|
|
1603
|
-
const { installments: C, price:
|
|
1602
|
+
const { installments: C, price: m, 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;
|
|
1604
1603
|
return {
|
|
1605
1604
|
node: {
|
|
1606
|
-
sku:
|
|
1607
|
-
gtin:
|
|
1608
|
-
name:
|
|
1609
|
-
description:
|
|
1610
|
-
releaseDate:
|
|
1611
|
-
slug:
|
|
1612
|
-
categories:
|
|
1613
|
-
categoriesIds:
|
|
1614
|
-
id:
|
|
1605
|
+
sku: u.items[0].itemId,
|
|
1606
|
+
gtin: u.productReference,
|
|
1607
|
+
name: u.productName,
|
|
1608
|
+
description: u.description,
|
|
1609
|
+
releaseDate: u.releaseDate,
|
|
1610
|
+
slug: u.linkText,
|
|
1611
|
+
categories: u.categories,
|
|
1612
|
+
categoriesIds: u.categoriesIds,
|
|
1613
|
+
id: u.items[0].itemId,
|
|
1615
1614
|
brand: {
|
|
1616
|
-
name:
|
|
1617
|
-
brandName:
|
|
1615
|
+
name: u.brand,
|
|
1616
|
+
brandName: u.brand
|
|
1618
1617
|
},
|
|
1619
1618
|
seo: {
|
|
1620
|
-
description:
|
|
1621
|
-
title:
|
|
1622
|
-
canonical: `/${
|
|
1619
|
+
description: u.description,
|
|
1620
|
+
title: u.productName,
|
|
1621
|
+
canonical: `/${u.linkText}/p`
|
|
1623
1622
|
},
|
|
1624
1623
|
cluster: {
|
|
1625
|
-
generals: u
|
|
1626
|
-
highlights: u
|
|
1624
|
+
generals: l(u.productClusters),
|
|
1625
|
+
highlights: l(u.clusterHighlights)
|
|
1627
1626
|
},
|
|
1628
1627
|
availability: {
|
|
1629
1628
|
status: F
|
|
1630
1629
|
},
|
|
1631
|
-
image:
|
|
1630
|
+
image: u.items[0].images.map(
|
|
1632
1631
|
({
|
|
1633
1632
|
imageLabel: g,
|
|
1634
|
-
imageUrl:
|
|
1633
|
+
imageUrl: S
|
|
1635
1634
|
}) => ({
|
|
1636
1635
|
alternateName: g,
|
|
1637
|
-
url:
|
|
1636
|
+
url: S,
|
|
1638
1637
|
keywords: g
|
|
1639
1638
|
})
|
|
1640
1639
|
),
|
|
1641
1640
|
offers: {
|
|
1642
|
-
lowPrice:
|
|
1641
|
+
lowPrice: m,
|
|
1643
1642
|
highPrice: p,
|
|
1644
1643
|
offers: [
|
|
1645
1644
|
{
|
|
1646
1645
|
availability: F,
|
|
1647
1646
|
listPrice: p,
|
|
1648
|
-
price:
|
|
1647
|
+
price: m,
|
|
1649
1648
|
priceValidUntil: O.PriceValidUntil,
|
|
1650
1649
|
priceCurrency: "BRL",
|
|
1651
1650
|
installments: O.Installments,
|
|
1652
|
-
lowPrice:
|
|
1651
|
+
lowPrice: m,
|
|
1653
1652
|
quantity: O.AvailableQuantity,
|
|
1654
1653
|
seller: {
|
|
1655
|
-
identifier:
|
|
1654
|
+
identifier: u.items[0].sellers[0].sellerId
|
|
1656
1655
|
}
|
|
1657
1656
|
}
|
|
1658
1657
|
]
|
|
1659
1658
|
},
|
|
1660
|
-
additionalProperty: ($ =
|
|
1661
|
-
name:
|
|
1659
|
+
additionalProperty: ($ = u == null ? void 0 : u.skuSpecifications) == null ? void 0 : $.map((g) => ({
|
|
1660
|
+
name: u == null ? void 0 : u.skuSpecifications[0].field.name,
|
|
1662
1661
|
value: g,
|
|
1663
1662
|
valueReference: "SPECIFICATION"
|
|
1664
1663
|
})),
|
|
1665
1664
|
isVariantOf: {
|
|
1666
|
-
productGroupID:
|
|
1667
|
-
hasVariant:
|
|
1668
|
-
var
|
|
1665
|
+
productGroupID: u.productId,
|
|
1666
|
+
hasVariant: u.items.map((g) => {
|
|
1667
|
+
var S;
|
|
1669
1668
|
return {
|
|
1670
1669
|
additionalProperty: g == null ? void 0 : g.variations.map(() => {
|
|
1671
|
-
var R,
|
|
1670
|
+
var R, T, v;
|
|
1672
1671
|
return {
|
|
1673
1672
|
name: (R = g == null ? void 0 : g.variations) == null ? void 0 : R[0],
|
|
1674
|
-
value: (
|
|
1673
|
+
value: (v = g == null ? void 0 : g[(T = g == null ? void 0 : g.variations) == null ? void 0 : T[0]]) == null ? void 0 : v[0],
|
|
1675
1674
|
valueReference: "SPECIFICATION"
|
|
1676
1675
|
};
|
|
1677
1676
|
}),
|
|
1678
1677
|
name: g.name,
|
|
1679
1678
|
offers: {
|
|
1680
|
-
offers: (
|
|
1681
|
-
({ commertialOffer: R, sellerId:
|
|
1679
|
+
offers: (S = g.sellers) == null ? void 0 : S.map(
|
|
1680
|
+
({ commertialOffer: R, sellerId: T }) => ({
|
|
1682
1681
|
availability: "https://schema.org/InStock",
|
|
1683
1682
|
listPrice: R.ListPrice,
|
|
1684
1683
|
price: R.Price,
|
|
1685
1684
|
quantity: R.AvailableQuantity,
|
|
1686
1685
|
seller: {
|
|
1687
|
-
identifier:
|
|
1686
|
+
identifier: T
|
|
1688
1687
|
}
|
|
1689
1688
|
})
|
|
1690
1689
|
)
|
|
@@ -1700,10 +1699,10 @@ async function ir({ body: t, apiUrl: e, extraData: n, fetchOptions: r }) {
|
|
|
1700
1699
|
};
|
|
1701
1700
|
});
|
|
1702
1701
|
}
|
|
1703
|
-
const
|
|
1702
|
+
const ur = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1704
1703
|
__proto__: null,
|
|
1705
|
-
getWishlistProducts:
|
|
1706
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1704
|
+
getWishlistProducts: lr
|
|
1705
|
+
}, Symbol.toStringTag, { value: "Module" })), dr = (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(dr).join(e), pr = ({ canonical: t, seo: e, slug: n }) => {
|
|
1707
1706
|
const r = Array.isArray(n) ? n.join(", ") : n;
|
|
1708
1707
|
return {
|
|
1709
1708
|
id: 0,
|
|
@@ -1714,7 +1713,7 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1714
1713
|
url: t,
|
|
1715
1714
|
children: []
|
|
1716
1715
|
};
|
|
1717
|
-
},
|
|
1716
|
+
}, mr = ({ canonical: t, category: e, previousImages: n, seo: r }) => ({
|
|
1718
1717
|
category: String(e == null ? void 0 : e.id),
|
|
1719
1718
|
title: (e == null ? void 0 : e.Title) ?? r.title,
|
|
1720
1719
|
description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
|
|
@@ -1725,30 +1724,30 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1725
1724
|
description: (e == null ? void 0 : e.MetaTagDescription) ?? r.description,
|
|
1726
1725
|
images: Array.isArray(n) ? [...n] : []
|
|
1727
1726
|
}
|
|
1728
|
-
}),
|
|
1727
|
+
}), fr = ({ items: t, parent: e, apiUrl: n, find: r }) => {
|
|
1729
1728
|
const s = t.find(
|
|
1730
1729
|
(i) => i.url.replace(n, "") === decodeURIComponent(e.toLowerCase())
|
|
1731
1730
|
);
|
|
1732
1731
|
return (s == null ? void 0 : s.children.find(
|
|
1733
1732
|
(i) => i.name.toLowerCase() === decodeURIComponent(String(r))
|
|
1734
1733
|
)) ?? s;
|
|
1735
|
-
},
|
|
1734
|
+
}, gr = (t) => {
|
|
1736
1735
|
t instanceof Error ? (console.error(`[ERROR CATEGORY INFO]: ${t.message}`), console.error(t.stack)) : console.error("[ERROR CATEGORY INFO]: Unknown error", t);
|
|
1737
|
-
},
|
|
1736
|
+
}, hr = /* @__PURE__ */ new Set([
|
|
1738
1737
|
"brand",
|
|
1739
1738
|
"category",
|
|
1740
1739
|
"department",
|
|
1741
1740
|
"subcategory",
|
|
1742
1741
|
"collection",
|
|
1743
1742
|
"cluster"
|
|
1744
|
-
]),
|
|
1743
|
+
]), yr = (t) => typeof (t == null ? void 0 : t.pageType) == "string" && hr.has(t == null ? void 0 : t.pageType.toLowerCase()), br = (t) => ({
|
|
1745
1744
|
collection: t.Coleção,
|
|
1746
1745
|
categoryId: t.categoryId,
|
|
1747
1746
|
current_collection: t["Coleção Atual"],
|
|
1748
1747
|
items: t.items
|
|
1749
1748
|
}), oe = (t, e) => t.reduce((n, r) => {
|
|
1750
1749
|
if (r.items.filter(
|
|
1751
|
-
(i) => i.sellers.find((
|
|
1750
|
+
(i) => i.sellers.find((c) => c.commertialOffer.IsAvailable)
|
|
1752
1751
|
).length === 0 || (n == null ? void 0 : n.find((i) => (i == null ? void 0 : i.productId) === (r == null ? void 0 : r.productId))) !== void 0)
|
|
1753
1752
|
return n;
|
|
1754
1753
|
const o = r.items[0].images.find(
|
|
@@ -1760,52 +1759,56 @@ const cr = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
1760
1759
|
textureImage: (o == null ? void 0 : o.imageUrl) ?? "",
|
|
1761
1760
|
textureAlt: (o == null ? void 0 : o.imageText) ?? ""
|
|
1762
1761
|
}), n;
|
|
1763
|
-
}, []),
|
|
1762
|
+
}, []), Ir = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
1764
1763
|
__proto__: null,
|
|
1765
|
-
createEmptySeoCategory:
|
|
1766
|
-
createSeoCategory:
|
|
1767
|
-
findCategory:
|
|
1764
|
+
createEmptySeoCategory: pr,
|
|
1765
|
+
createSeoCategory: mr,
|
|
1766
|
+
findCategory: fr,
|
|
1768
1767
|
formattedSimilars: oe,
|
|
1769
|
-
isCollectionPageType:
|
|
1770
|
-
notFindCategoryError:
|
|
1771
|
-
responseAdapter:
|
|
1772
|
-
}, Symbol.toStringTag, { value: "Module" })),
|
|
1768
|
+
isCollectionPageType: yr,
|
|
1769
|
+
notFindCategoryError: gr,
|
|
1770
|
+
responseAdapter: br
|
|
1771
|
+
}, Symbol.toStringTag, { value: "Module" })), Cr = {
|
|
1773
1772
|
parseSearchState: ge,
|
|
1774
1773
|
convertSearchParams: fe,
|
|
1775
1774
|
filterNonRootFacets: me,
|
|
1776
1775
|
filterNonCategorySelected: pe
|
|
1777
|
-
},
|
|
1778
|
-
const
|
|
1776
|
+
}, Rr = async ({ children: t, apiUrl: e, productId: n, ClientItems: r, PDP_INFO: s, TEXTURE_IMAGE: o, TOGGLE_STYLE_MODIFIER: i }) => {
|
|
1777
|
+
const c = await fetch(
|
|
1779
1778
|
`${e}/api/catalog_system/pub/products/crossselling/similars/${n.toString()}`
|
|
1780
|
-
).then((
|
|
1779
|
+
).then((f) => f.json()), l = oe(c, o);
|
|
1781
1780
|
return /* @__PURE__ */ N("div", { className: M.similars, children: [
|
|
1782
1781
|
/* @__PURE__ */ N("div", { className: M["similars-info"], children: [
|
|
1783
1782
|
/* @__PURE__ */ b("span", { className: M["sections-title"], children: s.product.color_title }),
|
|
1784
1783
|
t
|
|
1785
1784
|
] }),
|
|
1786
|
-
/* @__PURE__ */ b(r, { productId: n, similars:
|
|
1785
|
+
/* @__PURE__ */ b(r, { productId: n, similars: l, TOGGLE_STYLE_MODIFIER: i })
|
|
1787
1786
|
] });
|
|
1788
|
-
},
|
|
1789
|
-
checkout:
|
|
1790
|
-
catalog:
|
|
1787
|
+
}, Or = {
|
|
1788
|
+
checkout: Et,
|
|
1789
|
+
catalog: Pt,
|
|
1791
1790
|
cms: he,
|
|
1792
|
-
search:
|
|
1793
|
-
masterdata:
|
|
1791
|
+
search: er,
|
|
1792
|
+
masterdata: cr,
|
|
1794
1793
|
wishlist: {
|
|
1795
|
-
...
|
|
1794
|
+
...ur
|
|
1796
1795
|
}
|
|
1797
|
-
},
|
|
1798
|
-
catalog:
|
|
1799
|
-
search:
|
|
1800
|
-
product:
|
|
1801
|
-
|
|
1796
|
+
}, $r = {
|
|
1797
|
+
catalog: Ir,
|
|
1798
|
+
search: Cr,
|
|
1799
|
+
product: Ie,
|
|
1800
|
+
cms: {
|
|
1801
|
+
...be,
|
|
1802
|
+
...ye
|
|
1803
|
+
}
|
|
1804
|
+
}, qr = {
|
|
1802
1805
|
template: {
|
|
1803
|
-
pdp: { PDPSimilars:
|
|
1806
|
+
pdp: { PDPSimilars: Rr }
|
|
1804
1807
|
}
|
|
1805
1808
|
};
|
|
1806
1809
|
export {
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1810
|
+
Or as serverAPIs,
|
|
1811
|
+
Fr as serverCMS,
|
|
1812
|
+
qr as serverComponents,
|
|
1813
|
+
$r as serverHelpers
|
|
1811
1814
|
};
|