@soma-vertical-web/multi-lib 0.0.60 → 0.0.61
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/data/helpers/product/orderSizes.d.ts +3 -0
- package/index-ASRiF3PD.js +1 -0
- package/index-BRfMTuMz.mjs +405 -0
- package/index-BzNV29ol.mjs +402 -0
- package/index-C5zOWvXN.js +1 -0
- package/index-CbOiLJQX.mjs +403 -0
- package/index-CiBRnp7U.js +1 -0
- package/index-D3ONVIla.mjs +412 -0
- package/index-DJR4CcKO.mjs +398 -0
- package/index-D__YfUie.js +1 -0
- package/index-drKDwA8_.js +1 -0
- package/index.js +9 -9
- package/index.mjs +1702 -1694
- package/layout/index.d.ts +1 -1
- package/layout/team-component/Header/index.d.ts +1 -1
- package/layout/team-component/ImageZoom/Composite/ButtonClose.d.ts +4 -0
- package/layout/team-component/ImageZoom/Composite/Common/BlurImage.d.ts +3 -0
- package/layout/team-component/ImageZoom/Composite/Desktop/ImageDesktop.d.ts +5 -0
- package/layout/team-component/ImageZoom/Composite/Desktop/ImagesThumbs.d.ts +5 -0
- package/layout/team-component/ImageZoom/Composite/Desktop/WrapperDesktop.d.ts +4 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/Carousel.d.ts +7 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/ImageMobile.d.ts +7 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/ImageZoom.d.ts +7 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/WrapperMobile.d.ts +4 -0
- package/layout/team-component/ImageZoom/Composite/Mobile/ZoomPopup.d.ts +7 -0
- package/layout/team-component/ImageZoom/ImageZoom.d.ts +7 -0
- package/layout/team-component/ImageZoom/index.d.ts +1 -0
- package/layout/team-component/Notify/Composite/Controls.d.ts +7 -0
- package/layout/team-component/Notify/Composite/Form.d.ts +7 -0
- package/layout/team-component/Notify/Composite/Loading.d.ts +7 -0
- package/layout/team-component/Notify/Composite/Selector.d.ts +7 -0
- package/layout/team-component/Notify/Composite/Status.d.ts +7 -0
- package/layout/team-component/Notify/helpers.d.ts +3 -0
- package/layout/team-component/Notify/index.d.ts +7 -0
- package/layout/team-component/Table/Composite/Head.d.ts +4 -0
- package/layout/team-component/Table/Composite/Root.d.ts +4 -0
- package/layout/team-component/Table/Composite/Rows.d.ts +4 -0
- package/layout/team-component/Table/Table.d.ts +6 -0
- package/layout/team-component/Table/index.d.ts +1 -0
- package/layout/template/PDP/Composite/BreadCrumb/index.d.ts +7 -0
- package/layout/template/PDP/Composite/Containers/Gallery.d.ts +3 -0
- package/layout/template/PDP/Composite/Containers/Main.d.ts +3 -0
- package/layout/template/PDP/Composite/Containers/PDP.d.ts +3 -0
- package/layout/template/PDP/Composite/Containers/Secondary.d.ts +3 -0
- package/layout/template/PDP/Composite/Containers/index.d.ts +6 -0
- package/layout/template/PDP/Composite/Credits/index.d.ts +7 -0
- package/layout/template/PDP/Composite/Info/Divider.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Actions/AddToCart.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Actions/AddToCartObserver.d.ts +6 -0
- package/layout/template/PDP/Composite/Info/MainContent/Actions/AddToWishlist.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Actions/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/BottomNavigation/Actions.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/BottomNavigation/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Header/index.d.ts +8 -0
- package/layout/template/PDP/Composite/Info/MainContent/Links/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Price/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/ProductMeasurements/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Root.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Similars/AccessibilityInfo.d.ts +2 -0
- package/layout/template/PDP/Composite/Info/MainContent/Similars/Items.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Similars/ToggleWrapper.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/Similars/index.d.ts +3 -0
- package/layout/template/PDP/Composite/Info/MainContent/Sizes/index.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/MainContent/SubSectionWrapper.d.ts +4 -0
- package/layout/template/PDP/Composite/Info/Root.d.ts +6 -0
- package/layout/template/PDP/Composite/Info/SecondaryContent/DescriptionsTabs.d.ts +2 -0
- package/layout/template/PDP/Composite/Info/SecondaryContent/Freight.d.ts +4 -0
- package/layout/template/QuickShop/Composite/Body.d.ts +4 -0
- package/layout/template/QuickShop/Composite/Header.d.ts +3 -0
- package/layout/template/QuickShop/Composite/Similars.d.ts +7 -0
- package/layout/template/QuickShop/index.d.ts +3 -0
- package/package.json +1 -1
- package/types/contexts/contexts/global.d.ts +1 -0
- package/types/layout/team-components/Header/index.d.ts +3 -2
- package/types/layout/team-components/Table/index.d.ts +22 -0
- package/types/layout/templates/QuickShop/index.d.ts +21 -0
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { jsxs as g, Fragment as $, jsx as f } from "react/jsx-runtime";
|
|
2
|
+
import { Utils as k } from "@soma-vertical-web/core-components";
|
|
3
|
+
const b = (e, t = !0) => Intl.NumberFormat("pt-BR", {
|
|
4
|
+
style: "currency",
|
|
5
|
+
currency: "BRL",
|
|
6
|
+
minimumFractionDigits: t ? 2 : 0
|
|
7
|
+
}).format(e), R = ({ valueInCents: e, hasFree: t, freeTaxMessage: n }) => e === 0 ? t ? n : b(0) : b(e / 100), x = (e, t) => {
|
|
8
|
+
const [n, s] = e.split(t);
|
|
9
|
+
return { name: n.trim(), size: s ? s.trim() : "" };
|
|
10
|
+
}, T = (e, t) => {
|
|
11
|
+
if (!e)
|
|
12
|
+
return {};
|
|
13
|
+
const [n, s] = e.split(t);
|
|
14
|
+
return { color: n == null ? void 0 : n.trim(), size: s == null ? void 0 : s.trim() };
|
|
15
|
+
}, C = (e, t = "tamanho") => {
|
|
16
|
+
if (e.additionalProperty) {
|
|
17
|
+
const [n] = e.additionalProperty;
|
|
18
|
+
return n != null && n.name ? n.name.toLocaleLowerCase() === t ? n.value : e.name : "";
|
|
19
|
+
}
|
|
20
|
+
return e.name;
|
|
21
|
+
}, N = (e, t) => e.replace(t, "").trim(), z = (e) => e.replace(/\//g, ""), O = ({ items: e, NAME_SPLIT_SYMBOL: t }) => {
|
|
22
|
+
const n = {
|
|
23
|
+
price: 0,
|
|
24
|
+
listPrice: 0,
|
|
25
|
+
installments: {
|
|
26
|
+
count: 0,
|
|
27
|
+
value: 0
|
|
28
|
+
}
|
|
29
|
+
}, s = (a, i) => {
|
|
30
|
+
var d;
|
|
31
|
+
i && (i.sellerId = a.sellerId, i.sellerName = a.sellerName, i.available = !0, i.isSellerDefault = a.sellerDefault);
|
|
32
|
+
const {
|
|
33
|
+
Price: l,
|
|
34
|
+
ListPrice: u,
|
|
35
|
+
PaymentOptions: { installmentOptions: _ }
|
|
36
|
+
} = a.commertialOffer;
|
|
37
|
+
n.price = l, n.listPrice = u;
|
|
38
|
+
const c = (d = _ == null ? void 0 : _[0]) == null ? void 0 : d.installments;
|
|
39
|
+
if (c) {
|
|
40
|
+
const { count: m, value: p } = c[c.length - 1];
|
|
41
|
+
n.installments = {
|
|
42
|
+
count: m,
|
|
43
|
+
value: p / 100
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
let r = !0;
|
|
48
|
+
const o = e.reduce((a, i) => {
|
|
49
|
+
var _;
|
|
50
|
+
const l = {
|
|
51
|
+
name: i.name,
|
|
52
|
+
sku: i.itemId,
|
|
53
|
+
value: ((_ = i.Tamanho) == null ? void 0 : _[0]) ?? x(i.nameComplete ?? i.name, t).size,
|
|
54
|
+
available: !1,
|
|
55
|
+
sellerId: "",
|
|
56
|
+
sellerName: "",
|
|
57
|
+
isSellerDefault: !1
|
|
58
|
+
}, u = i.sellers.filter((c) => (c.sellerDefault && c.commertialOffer.IsAvailable && (l.available = !0, s(c, l)), c.commertialOffer.IsAvailable));
|
|
59
|
+
return !l.isSellerDefault && u.length > 0 && (l.available = !0, s(u[0], {
|
|
60
|
+
...l,
|
|
61
|
+
sellerId: u[0].sellerId,
|
|
62
|
+
sellerName: u[0].sellerName
|
|
63
|
+
})), l.available === !1 && (r = !1), a.push(l), a;
|
|
64
|
+
}, []);
|
|
65
|
+
return {
|
|
66
|
+
...n,
|
|
67
|
+
sizes: o,
|
|
68
|
+
allSizesAvailable: r
|
|
69
|
+
};
|
|
70
|
+
}, P = (e) => e ? !e.offers.offers.find(({ quantity: t = 0 }) => t > 0) : !1, F = (e, t) => {
|
|
71
|
+
const n = e.find(
|
|
72
|
+
(s) => s.availability.includes("InStock") && s.quantity && s.listPrice > 0 && s.seller.identifier === t
|
|
73
|
+
);
|
|
74
|
+
return n || e.find(
|
|
75
|
+
(s) => s.availability.includes("InStock") && s.quantity && s.listPrice > 0
|
|
76
|
+
);
|
|
77
|
+
}, j = ({ images: e, TEXTURE_IMAGE: t }) => e.find((n) => t.includes(n.imageLabel)) ?? e[0], A = (e, t) => {
|
|
78
|
+
const n = /\/ids\/(\d+)\//, s = e.match(n);
|
|
79
|
+
return s ? e.replace(
|
|
80
|
+
`/${s[1]}/`,
|
|
81
|
+
`/${s[1]}-${t.width}-${t.height}/`
|
|
82
|
+
) : e;
|
|
83
|
+
}, D = (e, t) => {
|
|
84
|
+
const n = /\/ids\/(\d+)-(\d+)-(\d+)\//, s = e.match(n);
|
|
85
|
+
return s ? e.replace(
|
|
86
|
+
`/${s[1]}-${s[2]}-${s[3]}/`,
|
|
87
|
+
`/${s[1]}-${t.width}-${t.height}/`
|
|
88
|
+
) : e;
|
|
89
|
+
}, B = ({
|
|
90
|
+
images: e,
|
|
91
|
+
label: t
|
|
92
|
+
}) => {
|
|
93
|
+
const n = e.filter(
|
|
94
|
+
(s) => s.keywords === t.first || s.keywords === t.second || s.alternateName === t.first || s.alternateName === t.second
|
|
95
|
+
);
|
|
96
|
+
return n.length === 0 ? e.slice(0, 2) : n;
|
|
97
|
+
}, E = (e) => {
|
|
98
|
+
const [t, n] = e.split("/").map(Number);
|
|
99
|
+
if (Number.isNaN(t) || Number.isNaN(n))
|
|
100
|
+
throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");
|
|
101
|
+
return n / t;
|
|
102
|
+
}, L = (e, t, n) => {
|
|
103
|
+
t && (e ? (t.getAttribute("src") || (t.src = n ?? ""), t.play()) : t.pause());
|
|
104
|
+
}, ve = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
105
|
+
__proto__: null,
|
|
106
|
+
disableSKU: P,
|
|
107
|
+
formatPriceToCurrency: b,
|
|
108
|
+
freightParsePrice: R,
|
|
109
|
+
getAspectRatio: E,
|
|
110
|
+
getColorAndSizeFromSkuName: T,
|
|
111
|
+
getFirstImages: B,
|
|
112
|
+
getProductNameWithoutSku: N,
|
|
113
|
+
getSKUName: C,
|
|
114
|
+
getSkuInfos: O,
|
|
115
|
+
getThumbImage: j,
|
|
116
|
+
getValidOffer: F,
|
|
117
|
+
removeSlashes: z,
|
|
118
|
+
resizingImg: A,
|
|
119
|
+
setVideoPlay: L,
|
|
120
|
+
splitNameAndSizeFromFullName: x,
|
|
121
|
+
updatedResizedImg: D
|
|
122
|
+
}, Symbol.toStringTag, { value: "Module" })), v = "fuzzy", h = "operator", U = (e) => ({
|
|
123
|
+
isDepartment: e != null && e.length ? e[0].key === "category-1" : !1
|
|
124
|
+
}), he = (e, t) => {
|
|
125
|
+
const n = decodeURIComponent(t ?? "").slice(1).split("/");
|
|
126
|
+
return e.map((s) => {
|
|
127
|
+
if (s.key === "category-2" && s.__typename === "FacetBoolean") {
|
|
128
|
+
const r = s.values;
|
|
129
|
+
return {
|
|
130
|
+
...s,
|
|
131
|
+
values: r.filter(
|
|
132
|
+
(o) => !n.find(
|
|
133
|
+
(a) => a.toLowerCase() === o.value || a.toLowerCase() === o.name.toLowerCase()
|
|
134
|
+
)
|
|
135
|
+
)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
return s;
|
|
139
|
+
});
|
|
140
|
+
}, I = (e, t) => t ? e === "category-1" : !1, M = (e) => e.key === "operator" && (e.value === "and" || e.value === "or"), q = (e) => e.type === "TEXT", H = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), K = (e) => {
|
|
141
|
+
const { key: t, name: n, values: s } = e;
|
|
142
|
+
return {
|
|
143
|
+
__typename: "FacetBoolean",
|
|
144
|
+
key: t,
|
|
145
|
+
label: n,
|
|
146
|
+
values: s.slice().sort((r, o) => r.name.localeCompare(o.name))
|
|
147
|
+
};
|
|
148
|
+
}, V = ({ key: e, values: t }) => ({
|
|
149
|
+
__typename: "FacetRange",
|
|
150
|
+
key: e,
|
|
151
|
+
values: t
|
|
152
|
+
}), xe = (e, t, n) => {
|
|
153
|
+
if (!(e instanceof Object) || !("facets" in e))
|
|
154
|
+
return [];
|
|
155
|
+
const { facets: s = [] } = e, r = t != null && t.length ? t[0].key === "category-1" : !1;
|
|
156
|
+
return s.filter(
|
|
157
|
+
(a) => !n || !I(a.key, r)
|
|
158
|
+
).map(
|
|
159
|
+
(a) => q(a) ? K(a) : V(a)
|
|
160
|
+
);
|
|
161
|
+
}, Ie = (e, t) => {
|
|
162
|
+
const n = e.find(({ key: r }) => r === v) ?? null, s = e.find(({ key: r }) => r === h) ?? null;
|
|
163
|
+
n && H(n) && t.append(v, n.value), s && M(s) && t.append(h, s.value);
|
|
164
|
+
}, Y = (e) => e.map((t) => {
|
|
165
|
+
const [n, s] = t.split("/");
|
|
166
|
+
return { key: n, value: s };
|
|
167
|
+
}), we = (e, t) => {
|
|
168
|
+
const n = decodeURIComponent(t ?? "").slice(1).split("/"), s = e.filter(({ value: o }) => !n.includes(decodeURIComponent(o))).map((o) => ({
|
|
169
|
+
...o,
|
|
170
|
+
value: decodeURIComponent(o.value)
|
|
171
|
+
})), { isDepartment: r } = U(s);
|
|
172
|
+
return s == null ? void 0 : s.filter((o) => !I(o.key, r));
|
|
173
|
+
}, Se = ({ pathname: e, searchParams: t }, n) => {
|
|
174
|
+
const s = t.get("sort") ?? "", r = t.get("query") ?? null, o = parseInt(t.get("page") ?? "1", 10);
|
|
175
|
+
return {
|
|
176
|
+
sort: s,
|
|
177
|
+
facets: Y(n),
|
|
178
|
+
term: r,
|
|
179
|
+
base: r ? "" : e,
|
|
180
|
+
page: o
|
|
181
|
+
};
|
|
182
|
+
}, $e = (e) => {
|
|
183
|
+
const t = new URLSearchParams();
|
|
184
|
+
return Object.entries(e).forEach(([n, s]) => {
|
|
185
|
+
Array.isArray(s) ? s.forEach((r) => t.append(n, r)) : s !== void 0 && t.append(n, s);
|
|
186
|
+
}), t;
|
|
187
|
+
}, y = {
|
|
188
|
+
"responsive-mobile-flex": "_responsive-mobile-flex_t5bry_2",
|
|
189
|
+
"responsive-desktop-flex": "_responsive-desktop-flex_t5bry_13",
|
|
190
|
+
"responsive-mobile-block": "_responsive-mobile-block_t5bry_24",
|
|
191
|
+
"responsive-desktop-block": "_responsive-desktop-block_t5bry_35"
|
|
192
|
+
}, w = {}, ke = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
193
|
+
__proto__: null,
|
|
194
|
+
default: w
|
|
195
|
+
}, Symbol.toStringTag, { value: "Module" })), J = "_header_1dxfy_40", W = "_actions_1dxfy_61", G = "_breadcrumb_1dxfy_72", X = "_credits_1dxfy_87", Q = "_similars_1dxfy_139", Z = "_sizes_1dxfy_178", ee = "_measurementTable_1dxfy_194", te = "_measurementHead_1dxfy_207", ne = "_measurementRows_1dxfy_212", se = "_measurementRowsTitle_1dxfy_229", ae = "_measurementRowsText_1dxfy_241", re = "_measurementImage_1dxfy_252", oe = "_measurementImageContainer_1dxfy_255", ie = "_measurementContent_1dxfy_264", ce = "_measurementTitle_1dxfy_268", le = "_measurementClose_1dxfy_279", me = "_productref_1dxfy_344", de = "_content_1dxfy_324", ue = "_pdp_1dxfy_112", Re = {
|
|
196
|
+
"bottom-navigation": "_bottom-navigation_1dxfy_1",
|
|
197
|
+
"bottom-navigation__header": "_bottom-navigation__header_1dxfy_21",
|
|
198
|
+
header: J,
|
|
199
|
+
actions: W,
|
|
200
|
+
"add-to-cart": "_add-to-cart_1dxfy_68",
|
|
201
|
+
breadcrumb: G,
|
|
202
|
+
"breadcrumb--active": "_breadcrumb--active_1dxfy_77",
|
|
203
|
+
credits: X,
|
|
204
|
+
"gallery-carousel-modifier": "_gallery-carousel-modifier_1dxfy_92",
|
|
205
|
+
"links-wrapper": "_links-wrapper_1dxfy_122",
|
|
206
|
+
similars: Q,
|
|
207
|
+
"similars-info": "_similars-info_1dxfy_151",
|
|
208
|
+
"accessibility-info": "_accessibility-info_1dxfy_164",
|
|
209
|
+
sizes: Z,
|
|
210
|
+
"price-wrapper": "_price-wrapper_1dxfy_190",
|
|
211
|
+
measurementTable: ee,
|
|
212
|
+
measurementHead: te,
|
|
213
|
+
measurementRows: ne,
|
|
214
|
+
measurementRowsTitle: se,
|
|
215
|
+
measurementRowsText: ae,
|
|
216
|
+
measurementImage: re,
|
|
217
|
+
measurementImageContainer: oe,
|
|
218
|
+
measurementContent: ie,
|
|
219
|
+
measurementTitle: ce,
|
|
220
|
+
measurementClose: le,
|
|
221
|
+
"tabs-root-modifier": "_tabs-root-modifier_1dxfy_285",
|
|
222
|
+
"tabs-list-modifier": "_tabs-list-modifier_1dxfy_303",
|
|
223
|
+
"tabs-item-modifier": "_tabs-item-modifier_1dxfy_320",
|
|
224
|
+
"content-wrapper": "_content-wrapper_1dxfy_324",
|
|
225
|
+
productref: me,
|
|
226
|
+
"tabs-panel": "_tabs-panel_1dxfy_355",
|
|
227
|
+
"tabs-panel-exit": "_tabs-panel-exit_1dxfy_361",
|
|
228
|
+
"tabs-panel-enter": "_tabs-panel-enter_1dxfy_365",
|
|
229
|
+
content: de,
|
|
230
|
+
pdp: ue,
|
|
231
|
+
"pdp-main": "_pdp-main_1dxfy_423",
|
|
232
|
+
"pdp-main__gallery-wrapper": "_pdp-main__gallery-wrapper_1dxfy_428",
|
|
233
|
+
"pdp-main__info": "_pdp-main__info_1dxfy_445",
|
|
234
|
+
"pdp-main__info-main-content": "_pdp-main__info-main-content_1dxfy_465",
|
|
235
|
+
"pdp-main__info-subsection": "_pdp-main__info-subsection_1dxfy_465",
|
|
236
|
+
"subsection-product-info": "_subsection-product-info_1dxfy_476",
|
|
237
|
+
"subsection-similars": "_subsection-similars_1dxfy_479",
|
|
238
|
+
"subsection-sizes": "_subsection-sizes_1dxfy_482",
|
|
239
|
+
"subsection-actions": "_subsection-actions_1dxfy_485",
|
|
240
|
+
"pdp-main__info-secondary-content": "_pdp-main__info-secondary-content_1dxfy_489",
|
|
241
|
+
"sections-title": "_sections-title_1dxfy_495"
|
|
242
|
+
}, Te = ({
|
|
243
|
+
children: e,
|
|
244
|
+
data: t,
|
|
245
|
+
SectionZone: n,
|
|
246
|
+
className: s
|
|
247
|
+
}) => {
|
|
248
|
+
var _, c;
|
|
249
|
+
const r = ((_ = t == null ? void 0 : t.filter((d) => {
|
|
250
|
+
var m, p;
|
|
251
|
+
return ((p = (m = d.config) == null ? void 0 : m.responsive) == null ? void 0 : p.deviceType) === "mobile";
|
|
252
|
+
})[0]) == null ? void 0 : _.sections) || [], o = ((c = t == null ? void 0 : t.filter((d) => {
|
|
253
|
+
var m, p;
|
|
254
|
+
return ((p = (m = d.config) == null ? void 0 : m.responsive) == null ? void 0 : p.deviceType) === "desktop";
|
|
255
|
+
})[0]) == null ? void 0 : c.sections) || [], a = r.slice(0, 1), i = r.slice(1, r.length), l = o.slice(0, 1), u = o.slice(1, o.length);
|
|
256
|
+
return /* @__PURE__ */ g($, { children: [
|
|
257
|
+
/* @__PURE__ */ g("div", { className: s, children: [
|
|
258
|
+
/* @__PURE__ */ f("div", { className: y["responsive-mobile-flex"], children: /* @__PURE__ */ f(n, { data: a ?? [] }) }),
|
|
259
|
+
/* @__PURE__ */ f("div", { className: y["responsive-desktop-flex"], children: /* @__PURE__ */ f(n, { data: l ?? [] }) })
|
|
260
|
+
] }),
|
|
261
|
+
e,
|
|
262
|
+
/* @__PURE__ */ f("div", { className: y["responsive-mobile-flex"], children: /* @__PURE__ */ f(n, { data: i ?? [] }) }),
|
|
263
|
+
/* @__PURE__ */ f("div", { className: y["responsive-desktop-flex"], children: /* @__PURE__ */ f(n, { data: u ?? [] }) }),
|
|
264
|
+
/* @__PURE__ */ f(k.Divider, {})
|
|
265
|
+
] });
|
|
266
|
+
};
|
|
267
|
+
async function _e({ contentType: e, storeId: t, CMS_PROJECT_NAME: n, NextCookies: s }) {
|
|
268
|
+
const r = await S({
|
|
269
|
+
contentType: e,
|
|
270
|
+
storeId: t,
|
|
271
|
+
CMS_PROJECT_NAME: n,
|
|
272
|
+
NextCookies: s
|
|
273
|
+
});
|
|
274
|
+
if (r.status === 200) {
|
|
275
|
+
const o = {
|
|
276
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
277
|
+
contentType: e,
|
|
278
|
+
data: r.data
|
|
279
|
+
};
|
|
280
|
+
console.log("Resultado da chamada:", r);
|
|
281
|
+
const a = `backup-${e}-${Date.now()}.json`;
|
|
282
|
+
return await w.writeFile(
|
|
283
|
+
`./backups/${a}`,
|
|
284
|
+
JSON.stringify(o, null, 2),
|
|
285
|
+
"utf-8"
|
|
286
|
+
), { success: !0, fileName: a };
|
|
287
|
+
}
|
|
288
|
+
return { success: !1, error: r.error || "No data to backup" };
|
|
289
|
+
}
|
|
290
|
+
async function fe(e) {
|
|
291
|
+
return _e(e);
|
|
292
|
+
}
|
|
293
|
+
async function pe({
|
|
294
|
+
contentType: e,
|
|
295
|
+
documentId: t,
|
|
296
|
+
versionId: n,
|
|
297
|
+
storeId: s,
|
|
298
|
+
CMS_PROJECT_NAME: r
|
|
299
|
+
}) {
|
|
300
|
+
const o = t && t.length ? `/${t}` : "", a = n && n.length ? `?versionId=${n}` : "";
|
|
301
|
+
return fetch(
|
|
302
|
+
`https://${s}.myvtex.com/_v/cms/api/${r}/${e}${o}${a}`,
|
|
303
|
+
{ cache: "no-cache" }
|
|
304
|
+
);
|
|
305
|
+
}
|
|
306
|
+
async function ye({
|
|
307
|
+
contentType: e,
|
|
308
|
+
documents: t,
|
|
309
|
+
NextCookies: n,
|
|
310
|
+
previewId: s,
|
|
311
|
+
CMS_PROJECT_NAME: r,
|
|
312
|
+
storeId: o
|
|
313
|
+
}) {
|
|
314
|
+
var i;
|
|
315
|
+
const a = JSON.parse(
|
|
316
|
+
s ?? ((i = n == null ? void 0 : n().get("cms_preview_data")) == null ? void 0 : i.value) ?? "{}"
|
|
317
|
+
);
|
|
318
|
+
if (a && (a == null ? void 0 : a.contentType) === e) {
|
|
319
|
+
const l = a.documentId && a.documentId.length ? `/${a.documentId}` : "", u = a != null && a.versionId && (a != null && a.versionId.length) ? `?versionId=${a == null ? void 0 : a.versionId}` : "", c = await (await fetch(
|
|
320
|
+
`https://${o}.myvtex.com/_v/cms/api/${r}/${e}${l}${u}`,
|
|
321
|
+
{ cache: "no-store" }
|
|
322
|
+
)).json(), d = t.filter(
|
|
323
|
+
(m) => c.id !== m.documentId
|
|
324
|
+
);
|
|
325
|
+
return d.unshift(c), d;
|
|
326
|
+
}
|
|
327
|
+
return t;
|
|
328
|
+
}
|
|
329
|
+
async function S({
|
|
330
|
+
contentType: e,
|
|
331
|
+
NextCookies: t,
|
|
332
|
+
CMS_PROJECT_NAME: n,
|
|
333
|
+
storeId: s,
|
|
334
|
+
previewId: r
|
|
335
|
+
}) {
|
|
336
|
+
var _, c;
|
|
337
|
+
const o = JSON.parse(
|
|
338
|
+
r ?? ((_ = t == null ? void 0 : t().get("cms_preview_data")) == null ? void 0 : _.value) ?? "{}"
|
|
339
|
+
), a = [];
|
|
340
|
+
let i = 1, l = 0, u = !0;
|
|
341
|
+
try {
|
|
342
|
+
do {
|
|
343
|
+
const m = await (await fetch(
|
|
344
|
+
`https://${s}.myvtex.com/_v/cms/api/${n}/${e}?page=${i}`
|
|
345
|
+
)).json();
|
|
346
|
+
i === 1 && (l = m.totalItems), (c = m == null ? void 0 : m.data) != null && c.length && a.push(...m.data), u = m.hasNextPage, i++;
|
|
347
|
+
} while (u && a.length < l);
|
|
348
|
+
if (o.previewMode && a.length) {
|
|
349
|
+
const d = await ye({
|
|
350
|
+
contentType: e,
|
|
351
|
+
documents: a,
|
|
352
|
+
NextCookies: t,
|
|
353
|
+
CMS_PROJECT_NAME: n,
|
|
354
|
+
storeId: s
|
|
355
|
+
});
|
|
356
|
+
return {
|
|
357
|
+
status: d.length > 0 ? 200 : 404,
|
|
358
|
+
data: d ?? []
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
return {
|
|
362
|
+
status: a.length ? 200 : 404,
|
|
363
|
+
data: a
|
|
364
|
+
};
|
|
365
|
+
} catch (d) {
|
|
366
|
+
return { status: "error", data: [], error: d };
|
|
367
|
+
}
|
|
368
|
+
}
|
|
369
|
+
const Ce = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
370
|
+
__proto__: null,
|
|
371
|
+
cmsBackup: fe,
|
|
372
|
+
getCMSContentType: pe,
|
|
373
|
+
getContentType: S
|
|
374
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
375
|
+
export {
|
|
376
|
+
Te as S,
|
|
377
|
+
ke as _,
|
|
378
|
+
O as a,
|
|
379
|
+
j as b,
|
|
380
|
+
$e as c,
|
|
381
|
+
C as d,
|
|
382
|
+
P as e,
|
|
383
|
+
ve as f,
|
|
384
|
+
T as g,
|
|
385
|
+
b as h,
|
|
386
|
+
R as i,
|
|
387
|
+
F as j,
|
|
388
|
+
B as k,
|
|
389
|
+
L as l,
|
|
390
|
+
N as m,
|
|
391
|
+
Re as n,
|
|
392
|
+
A as o,
|
|
393
|
+
Se as p,
|
|
394
|
+
S as q,
|
|
395
|
+
y as r,
|
|
396
|
+
x as s,
|
|
397
|
+
Ie as t,
|
|
398
|
+
D as u,
|
|
399
|
+
xe as v,
|
|
400
|
+
he as w,
|
|
401
|
+
we as x,
|
|
402
|
+
Ce as y
|
|
403
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("react/jsx-runtime"),A=require("@soma-vertical-web/core-components"),g=(e,t=!0)=>Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL",minimumFractionDigits:t?2:0}).format(e),I=({valueInCents:e,hasFree:t,freeTaxMessage:n})=>e===0?t?n:g(0):g(e/100),b=(e,t)=>{const[n,s]=e.split(t);return{name:n.trim(),size:s?s.trim():""}},S=(e,t)=>{if(!e)return{};const[n,s]=e.split(t);return{color:n==null?void 0:n.trim(),size:s==null?void 0:s.trim()}},w=(e,t="tamanho")=>{if(e.additionalProperty){const[n]=e.additionalProperty;return n!=null&&n.name?n.name.toLocaleLowerCase()===t?n.value:e.name:""}return e.name},k=(e,t)=>e.replace(t,"").trim(),B=e=>e.replace(/\//g,""),$=({items:e,NAME_SPLIT_SYMBOL:t})=>{const n={price:0,listPrice:0,installments:{count:0,value:0}},s=(r,i)=>{var u;i&&(i.sellerId=r.sellerId,i.sellerName=r.sellerName,i.available=!0,i.isSellerDefault=r.sellerDefault);const{Price:l,ListPrice:d,PaymentOptions:{installmentOptions:_}}=r.commertialOffer;n.price=l,n.listPrice=d;const c=(u=_==null?void 0:_[0])==null?void 0:u.installments;if(c){const{count:m,value:p}=c[c.length-1];n.installments={count:m,value:p/100}}};let a=!0;const o=e.reduce((r,i)=>{var _;const l={name:i.name,sku:i.itemId,value:((_=i.Tamanho)==null?void 0:_[0])??b(i.nameComplete??i.name,t).size,available:!1,sellerId:"",sellerName:"",isSellerDefault:!1},d=i.sellers.filter(c=>(c.sellerDefault&&c.commertialOffer.IsAvailable&&(l.available=!0,s(c,l)),c.commertialOffer.IsAvailable));return!l.isSellerDefault&&d.length>0&&(l.available=!0,s(d[0],{...l,sellerId:d[0].sellerId,sellerName:d[0].sellerName})),l.available===!1&&(a=!1),r.push(l),r},[]);return{...n,sizes:o,allSizesAvailable:a}},C=e=>e?!e.offers.offers.find(({quantity:t=0})=>t>0):!1,N=(e,t)=>{const n=e.find(s=>s.availability.includes("InStock")&&s.quantity&&s.listPrice>0&&s.seller.identifier===t);return n||e.find(s=>s.availability.includes("InStock")&&s.quantity&&s.listPrice>0)},R=({images:e,TEXTURE_IMAGE:t})=>e.find(n=>t.includes(n.imageLabel))??e[0],T=(e,t)=>{const n=/\/ids\/(\d+)\//,s=e.match(n);return s?e.replace(`/${s[1]}/`,`/${s[1]}-${t.width}-${t.height}/`):e},P=(e,t)=>{const n=/\/ids\/(\d+)-(\d+)-(\d+)\//,s=e.match(n);return s?e.replace(`/${s[1]}-${s[2]}-${s[3]}/`,`/${s[1]}-${t.width}-${t.height}/`):e},z=({images:e,label:t})=>{const n=e.filter(s=>s.keywords===t.first||s.keywords===t.second||s.alternateName===t.first||s.alternateName===t.second);return n.length===0?e.slice(0,2):n},D=e=>{const[t,n]=e.split("/").map(Number);if(Number.isNaN(t)||Number.isNaN(n))throw new Error("[ERROR ASPECT RATIO IMAGE]: Invalid aspect ratio format");return n/t},F=(e,t,n)=>{t&&(e?(t.getAttribute("src")||(t.src=n??""),t.play()):t.pause())},U=Object.freeze(Object.defineProperty({__proto__:null,disableSKU:C,formatPriceToCurrency:g,freightParsePrice:I,getAspectRatio:D,getColorAndSizeFromSkuName:S,getFirstImages:z,getProductNameWithoutSku:k,getSKUName:w,getSkuInfos:$,getThumbImage:R,getValidOffer:N,removeSlashes:B,resizingImg:T,setVideoPlay:F,splitNameAndSizeFromFullName:b,updatedResizedImg:P},Symbol.toStringTag,{value:"Module"})),v="fuzzy",x="operator",E=e=>({isDepartment:e!=null&&e.length?e[0].key==="category-1":!1}),L=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/");return e.map(s=>{if(s.key==="category-2"&&s.__typename==="FacetBoolean"){const a=s.values;return{...s,values:a.filter(o=>!n.find(r=>r.toLowerCase()===o.value||r.toLowerCase()===o.name.toLowerCase()))}}return s})},j=(e,t)=>t?e==="category-1":!1,M=e=>e.key==="operator"&&(e.value==="and"||e.value==="or"),K=e=>e.type==="TEXT",V=e=>e.key==="fuzzy"&&(e.value==="0"||e.value==="1"||e.value==="auto"),q=e=>{const{key:t,name:n,values:s}=e;return{__typename:"FacetBoolean",key:t,label:n,values:s.slice().sort((a,o)=>a.name.localeCompare(o.name))}},H=({key:e,values:t})=>({__typename:"FacetRange",key:e,values:t}),W=(e,t,n)=>{if(!(e instanceof Object)||!("facets"in e))return[];const{facets:s=[]}=e,a=t!=null&&t.length?t[0].key==="category-1":!1;return s.filter(r=>!n||!j(r.key,a)).map(r=>K(r)?q(r):H(r))},Y=(e,t)=>{const n=e.find(({key:a})=>a===v)??null,s=e.find(({key:a})=>a===x)??null;n&&V(n)&&t.append(v,n.value),s&&M(s)&&t.append(x,s.value)},J=e=>e.map(t=>{const[n,s]=t.split("/");return{key:n,value:s}}),G=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/"),s=e.filter(({value:o})=>!n.includes(decodeURIComponent(o))).map(o=>({...o,value:decodeURIComponent(o.value)})),{isDepartment:a}=E(s);return s==null?void 0:s.filter(o=>!j(o.key,a))},X=({pathname:e,searchParams:t},n)=>{const s=t.get("sort")??"",a=t.get("query")??null,o=parseInt(t.get("page")??"1",10);return{sort:s,facets:J(n),term:a,base:a?"":e,page:o}},Q=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([n,s])=>{Array.isArray(s)?s.forEach(a=>t.append(n,a)):s!==void 0&&t.append(n,s)}),t},y={"responsive-mobile-flex":"_responsive-mobile-flex_t5bry_2","responsive-desktop-flex":"_responsive-desktop-flex_t5bry_13","responsive-mobile-block":"_responsive-mobile-block_t5bry_24","responsive-desktop-block":"_responsive-desktop-block_t5bry_35"},O={},Z=Object.freeze(Object.defineProperty({__proto__:null,default:O},Symbol.toStringTag,{value:"Module"})),ee="_header_1dxfy_40",te="_actions_1dxfy_61",ne="_breadcrumb_1dxfy_72",se="_credits_1dxfy_87",re="_similars_1dxfy_139",ae="_sizes_1dxfy_178",oe="_measurementTable_1dxfy_194",ie="_measurementHead_1dxfy_207",ce="_measurementRows_1dxfy_212",le="_measurementRowsTitle_1dxfy_229",me="_measurementRowsText_1dxfy_241",ue="_measurementImage_1dxfy_252",de="_measurementImageContainer_1dxfy_255",_e="_measurementContent_1dxfy_264",fe="_measurementTitle_1dxfy_268",pe="_measurementClose_1dxfy_279",ye="_productref_1dxfy_344",ge="_content_1dxfy_324",be={"bottom-navigation":"_bottom-navigation_1dxfy_1","bottom-navigation__header":"_bottom-navigation__header_1dxfy_21",header:ee,actions:te,"add-to-cart":"_add-to-cart_1dxfy_68",breadcrumb:ne,"breadcrumb--active":"_breadcrumb--active_1dxfy_77",credits:se,"gallery-carousel-modifier":"_gallery-carousel-modifier_1dxfy_92","links-wrapper":"_links-wrapper_1dxfy_122",similars:re,"similars-info":"_similars-info_1dxfy_151",sizes:ae,"price-wrapper":"_price-wrapper_1dxfy_190",measurementTable:oe,measurementHead:ie,measurementRows:ce,measurementRowsTitle:le,measurementRowsText:me,measurementImage:ue,measurementImageContainer:de,measurementContent:_e,measurementTitle:fe,measurementClose:pe,"tabs-root-modifier":"_tabs-root-modifier_1dxfy_285","tabs-list-modifier":"_tabs-list-modifier_1dxfy_303","tabs-item-modifier":"_tabs-item-modifier_1dxfy_320","content-wrapper":"_content-wrapper_1dxfy_324",productref:ye,"tabs-panel":"_tabs-panel_1dxfy_355","tabs-panel-exit":"_tabs-panel-exit_1dxfy_361","tabs-panel-enter":"_tabs-panel-enter_1dxfy_365",content:ge,"pdp-main__info":"_pdp-main__info_1dxfy_445","pdp-main__info-main-content":"_pdp-main__info-main-content_1dxfy_465","pdp-main__info-subsection":"_pdp-main__info-subsection_1dxfy_465","subsection-product-info":"_subsection-product-info_1dxfy_476","subsection-similars":"_subsection-similars_1dxfy_479","subsection-sizes":"_subsection-sizes_1dxfy_482","subsection-actions":"_subsection-actions_1dxfy_485","sections-title":"_sections-title_1dxfy_495"},he=({children:e,data:t,SectionZone:n,className:s})=>{var _,c;const a=((_=t==null?void 0:t.filter(u=>{var m,p;return((p=(m=u.config)==null?void 0:m.responsive)==null?void 0:p.deviceType)==="mobile"})[0])==null?void 0:_.sections)||[],o=((c=t==null?void 0:t.filter(u=>{var m,p;return((p=(m=u.config)==null?void 0:m.responsive)==null?void 0:p.deviceType)==="desktop"})[0])==null?void 0:c.sections)||[],r=a.slice(0,1),i=a.slice(1,a.length),l=o.slice(0,1),d=o.slice(1,o.length);return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:s,children:[f.jsx("div",{className:y["responsive-mobile-flex"],children:f.jsx(n,{data:r??[]})}),f.jsx("div",{className:y["responsive-desktop-flex"],children:f.jsx(n,{data:l??[]})})]}),e,f.jsx("div",{className:y["responsive-mobile-flex"],children:f.jsx(n,{data:i??[]})}),f.jsx("div",{className:y["responsive-desktop-flex"],children:f.jsx(n,{data:d??[]})}),f.jsx(A.Utils.Divider,{})]})};async function ve({contentType:e,storeId:t,CMS_PROJECT_NAME:n,NextCookies:s}){const a=await h({contentType:e,storeId:t,CMS_PROJECT_NAME:n,NextCookies:s});if(a.status===200){const o={timestamp:new Date().toISOString(),contentType:e,data:a.data};console.log("Resultado da chamada:",a);const r=`backup-${e}-${Date.now()}.json`;return await O.writeFile(`./backups/${r}`,JSON.stringify(o,null,2),"utf-8"),{success:!0,fileName:r}}return{success:!1,error:a.error||"No data to backup"}}async function xe(e){return ve(e)}async function Ie({contentType:e,documentId:t,versionId:n,storeId:s,CMS_PROJECT_NAME:a}){const o=t&&t.length?`/${t}`:"",r=n&&n.length?`?versionId=${n}`:"";return fetch(`https://${s}.myvtex.com/_v/cms/api/${a}/${e}${o}${r}`,{cache:"no-cache"})}async function Se({contentType:e,documents:t,NextCookies:n,previewId:s,CMS_PROJECT_NAME:a,storeId:o}){var i;const r=JSON.parse(s??((i=n==null?void 0:n().get("cms_preview_data"))==null?void 0:i.value)??"{}");if(r&&(r==null?void 0:r.contentType)===e){const l=r.documentId&&r.documentId.length?`/${r.documentId}`:"",d=r!=null&&r.versionId&&(r!=null&&r.versionId.length)?`?versionId=${r==null?void 0:r.versionId}`:"",c=await(await fetch(`https://${o}.myvtex.com/_v/cms/api/${a}/${e}${l}${d}`,{cache:"no-store"})).json(),u=t.filter(m=>c.id!==m.documentId);return u.unshift(c),u}return t}async function h({contentType:e,NextCookies:t,CMS_PROJECT_NAME:n,storeId:s,previewId:a}){var _,c;const o=JSON.parse(a??((_=t==null?void 0:t().get("cms_preview_data"))==null?void 0:_.value)??"{}"),r=[];let i=1,l=0,d=!0;try{do{const m=await(await fetch(`https://${s}.myvtex.com/_v/cms/api/${n}/${e}?page=${i}`)).json();i===1&&(l=m.totalItems),(c=m==null?void 0:m.data)!=null&&c.length&&r.push(...m.data),d=m.hasNextPage,i++}while(d&&r.length<l);if(o.previewMode&&r.length){const u=await Se({contentType:e,documents:r,NextCookies:t,CMS_PROJECT_NAME:n,storeId:s});return{status:u.length>0?200:404,data:u??[]}}return{status:r.length?200:404,data:r}}catch(u){return{status:"error",data:[],error:u}}}const we=Object.freeze(Object.defineProperty({__proto__:null,cmsBackup:xe,getCMSContentType:Ie,getContentType:h},Symbol.toStringTag,{value:"Module"}));exports.SearchPageScreening=he;exports.__viteBrowserExternal=Z;exports.addSearchParamsFacets=Y;exports.cms=we;exports.convertSearchParams=Q;exports.disableSKU=C;exports.filterNonCategorySelected=L;exports.filterNonRootFacets=G;exports.formatPriceToCurrency=g;exports.formattedFacets=W;exports.freightParsePrice=I;exports.getColorAndSizeFromSkuName=S;exports.getContentType=h;exports.getFirstImages=z;exports.getProductNameWithoutSku=k;exports.getSKUName=w;exports.getSkuInfos=$;exports.getThumbImage=R;exports.getValidOffer=N;exports.parseSearchState=X;exports.productHelpers=U;exports.resizingImg=T;exports.responsive=y;exports.setVideoPlay=F;exports.splitNameAndSizeFromFullName=b;exports.styles=be;exports.updatedResizedImg=P;
|