@soma-vertical-web/multi-lib 0.0.69 → 0.0.70
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/contexts/contexts/header/HeaderCategoryContext.d.ts +7 -0
- package/contexts/contexts/header/MenuMobileContext.d.ts +5 -4
- package/contexts/index.d.ts +2 -2
- package/index.js +17 -17
- package/index.mjs +4837 -4881
- package/layout/index.d.ts +2 -2
- package/layout/team-component/Header/Composite/HeaderDesktopWrapper.d.ts +5 -1
- package/layout/team-component/Header/Composite/HeaderMobileWrapper.d.ts +6 -1
- package/layout/team-component/Header/index.d.ts +1 -1
- package/layout/team-component/Menu/Composite/Mobile/Body/Body.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/Banner.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/Category.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/List.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/SubCategory.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/Title.d.ts +7 -0
- package/layout/team-component/Menu/Composite/Mobile/Body/Category/index.d.ts +22 -0
- package/layout/team-component/Menu/Composite/Mobile/{Body/SubMenu/SubMenu.d.ts → Header/Header.d.ts} +2 -2
- package/layout/team-component/Menu/Composite/Mobile/MenuRoot.d.ts +4 -7
- package/layout/team-component/Menu/Composite/Mobile/Navigation/{NavigationBarItem.d.ts → BarItem.d.ts} +1 -1
- package/layout/team-component/Menu/MenuMobile.d.ts +7 -8
- package/layout/team-component/UserMenu/Composite/Menu.d.ts +1 -1
- package/layout/team-component/UserMenu/UserMenu.d.ts +1 -1
- package/layout/team-component/UserMenu/index.d.ts +3 -1
- package/package.json +1 -1
- package/style.css +1 -1
- package/types/cms/ContentTypes/Header/index.d.ts +9 -1
- package/types/constants.d.ts +12 -14
- package/types/layout/team-components/Header/index.d.ts +9 -1
- package/types/layout/team-components/Menu/Mobile/Body/Category/index.d.ts +23 -0
- package/types/layout/team-components/Menu/Mobile/Body/index.d.ts +3 -0
- package/types/layout/team-components/Menu/Mobile/index.d.ts +10 -1
- package/types/layout/team-components/UserMenu/index.d.ts +10 -7
- package/Footer-93X9fl_J.mjs +0 -7055
- package/Footer-BjB3blIh.mjs +0 -6956
- package/Footer-By1Gk2Ku.mjs +0 -7050
- package/Footer-COiI-tye.mjs +0 -7049
- package/Footer-CZqTxkCn.js +0 -41
- package/Footer-D3zDoa2N.mjs +0 -6961
- package/Footer-DfAuGt3s.js +0 -41
- package/Footer-TLfR7lta.js +0 -41
- package/Footer-okPVOqRy.js +0 -41
- package/Footer-rMb9FYog.js +0 -41
- package/SearchPageScreening-BIyp1dAW.mjs +0 -112
- package/SearchPageScreening-gO7dG13l.js +0 -1
- package/__vite-browser-external-B8mGO3z6.js +0 -1
- package/__vite-browser-external-BYRIRx8p.mjs +0 -8
- package/__vite-browser-external-C4n7rb1H.mjs +0 -85
- package/__vite-browser-external-Cjz79hOw.js +0 -1
- package/__vite-browser-external-CpdIDx9o.mjs +0 -79
- package/__vite-browser-external-DDWPeg5L.js +0 -1
- package/cms/ContentTypes/CommonPage/index.d.ts +0 -2
- package/cms/ContentTypes/FlagsAndTags/index.d.ts +0 -1
- package/cms/ContentTypes/PLP/PLPContentContext.d.ts +0 -4
- package/cms/ContentTypes/Search/SearchContentScreening.d.ts +0 -3
- package/cms/ContentTypes/index.d.ts +0 -6
- package/data/actions/masterDataServices.d.ts +0 -5
- package/data/api/user/index.d.ts +0 -3
- package/data/helpers/search/policy.d.ts +0 -3
- package/data/helpers/search/product/utils/index.d.ts +0 -8
- package/data/helpers/search/region.d.ts +0 -3
- package/index-ASRiF3PD.js +0 -1
- package/index-BJzBUeMp.js +0 -1
- package/index-BR5lPUsH.js +0 -1
- package/index-BRfMTuMz.mjs +0 -405
- package/index-BYY2x6mQ.js +0 -1
- package/index-Ba7fQCkk.js +0 -1
- package/index-BzNV29ol.mjs +0 -402
- package/index-C3QT-3iu.mjs +0 -355
- package/index-C5zOWvXN.js +0 -1
- package/index-CbOiLJQX.mjs +0 -403
- package/index-CiBRnp7U.js +0 -1
- package/index-CiMxj6Pg.mjs +0 -412
- package/index-CkcBCfzG.js +0 -1
- package/index-CuKKHhKx.mjs +0 -355
- package/index-D3ONVIla.mjs +0 -412
- package/index-DD12Nl4r.mjs +0 -412
- package/index-DJR4CcKO.mjs +0 -398
- package/index-DJeLEsRl.js +0 -1
- package/index-DKnolQoT.mjs +0 -412
- package/index-DYpuW0tu.mjs +0 -354
- package/index-D__YfUie.js +0 -1
- package/index-DfnS9D5I.mjs +0 -354
- package/index-Do5eAlCL.mjs +0 -219
- package/index-VkanwPXK.mjs +0 -221
- package/index-WV5Gjz3i.js +0 -1
- package/index-catAI5a3.mjs +0 -258
- package/index-drKDwA8_.js +0 -1
- package/layout/team-component/Menu/Composite/Mobile/Body/MenuBody.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Body/MenuCategories.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Body/MenuCategoriesWrapper.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Body/SubMenu/SubMenuItem.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Body/SubMenu/SubMenuSubCategory.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Header/MenuHeaderContainer.d.ts +0 -5
- package/layout/team-component/Menu/Composite/Mobile/Header/MenuHeaderNavLinks.d.ts +0 -7
- package/layout/team-component/Menu/Composite/Mobile/Header/MenuHeaderWrapper.d.ts +0 -7
- package/types/data/actions/index.d.ts +0 -27
- package/types/layout/team-components/PDCNavigation/intex.d.ts +0 -9
- package/types/layout/team-components/ProductList/Composite/Card/index.d.ts +0 -9
- package/types/utils.d.ts +0 -3
- /package/layout/team-component/Menu/Composite/Mobile/Navigation/{NavigationBar.d.ts → Bar.d.ts} +0 -0
package/index-VkanwPXK.mjs
DELETED
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { jsxs as y, Fragment as I, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { Utils as S } from "@soma-vertical-web/core-components";
|
|
3
|
-
const h = "fuzzy", b = "operator", w = (e) => ({
|
|
4
|
-
isDepartment: e != null && e.length ? e[0].key === "category-1" : !1
|
|
5
|
-
}), M = (e, t) => {
|
|
6
|
-
const s = decodeURIComponent(t ?? "").slice(1).split("/");
|
|
7
|
-
return e.map((o) => {
|
|
8
|
-
if (o.key === "category-2" && o.__typename === "FacetBoolean") {
|
|
9
|
-
const r = o.values;
|
|
10
|
-
return {
|
|
11
|
-
...o,
|
|
12
|
-
values: r.filter(
|
|
13
|
-
(a) => !s.find(
|
|
14
|
-
(n) => n.toLowerCase() === a.value || n.toLowerCase() === a.name.toLowerCase()
|
|
15
|
-
)
|
|
16
|
-
)
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
return o;
|
|
20
|
-
});
|
|
21
|
-
}, _ = (e, t) => t ? e === "category-1" : !1, O = (e) => e.key === "operator" && (e.value === "and" || e.value === "or"), R = (e) => e.type === "TEXT", j = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), z = (e) => {
|
|
22
|
-
const { key: t, name: s, values: o } = e;
|
|
23
|
-
return {
|
|
24
|
-
__typename: "FacetBoolean",
|
|
25
|
-
key: t,
|
|
26
|
-
label: s,
|
|
27
|
-
values: o.slice().sort((r, a) => r.name.localeCompare(a.name))
|
|
28
|
-
};
|
|
29
|
-
}, F = ({ key: e, values: t }) => ({
|
|
30
|
-
__typename: "FacetRange",
|
|
31
|
-
key: e,
|
|
32
|
-
values: t
|
|
33
|
-
}), L = (e, t, s) => {
|
|
34
|
-
if (!(e instanceof Object) || !("facets" in e))
|
|
35
|
-
return [];
|
|
36
|
-
const { facets: o = [] } = e, r = t != null && t.length ? t[0].key === "category-1" : !1;
|
|
37
|
-
return o.filter(
|
|
38
|
-
(n) => !s || !_(n.key, r)
|
|
39
|
-
).map(
|
|
40
|
-
(n) => R(n) ? z(n) : F(n)
|
|
41
|
-
);
|
|
42
|
-
}, N = (e, t) => {
|
|
43
|
-
const s = e.find(({ key: r }) => r === h) ?? null, o = e.find(({ key: r }) => r === b) ?? null;
|
|
44
|
-
s && j(s) && t.append(h, s.value), o && O(o) && t.append(b, o.value);
|
|
45
|
-
}, C = (e) => e.map((t) => {
|
|
46
|
-
const [s, o] = t.split("/");
|
|
47
|
-
return { key: s, value: o };
|
|
48
|
-
}), Y = (e, t) => {
|
|
49
|
-
const s = decodeURIComponent(t ?? "").slice(1).split("/"), o = e.filter(({ value: a }) => !s.includes(decodeURIComponent(a))).map((a) => ({
|
|
50
|
-
...a,
|
|
51
|
-
value: decodeURIComponent(a.value)
|
|
52
|
-
})), { isDepartment: r } = w(o);
|
|
53
|
-
return o == null ? void 0 : o.filter((a) => !_(a.key, r));
|
|
54
|
-
}, A = ({ pathname: e, searchParams: t }, s) => {
|
|
55
|
-
const o = t.get("sort") ?? "", r = t.get("query") ?? null, a = parseInt(t.get("page") ?? "1", 10);
|
|
56
|
-
return {
|
|
57
|
-
sort: o,
|
|
58
|
-
facets: C(s),
|
|
59
|
-
term: r,
|
|
60
|
-
base: r ? "" : e,
|
|
61
|
-
page: a
|
|
62
|
-
};
|
|
63
|
-
}, J = (e) => {
|
|
64
|
-
const t = new URLSearchParams();
|
|
65
|
-
return Object.entries(e).forEach(([s, o]) => {
|
|
66
|
-
Array.isArray(o) ? o.forEach((r) => t.append(s, r)) : o !== void 0 && t.append(s, o);
|
|
67
|
-
}), t;
|
|
68
|
-
}, v = {
|
|
69
|
-
"responsive-mobile-flex": "_responsive-mobile-flex_t5bry_2",
|
|
70
|
-
"responsive-desktop-flex": "_responsive-desktop-flex_t5bry_13",
|
|
71
|
-
"responsive-mobile-block": "_responsive-mobile-block_t5bry_24",
|
|
72
|
-
"responsive-desktop-block": "_responsive-desktop-block_t5bry_35"
|
|
73
|
-
}, $ = {}, K = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
74
|
-
__proto__: null,
|
|
75
|
-
default: $
|
|
76
|
-
}, Symbol.toStringTag, { value: "Module" })), V = ({
|
|
77
|
-
children: e,
|
|
78
|
-
data: t,
|
|
79
|
-
SectionZone: s,
|
|
80
|
-
className: o
|
|
81
|
-
}) => {
|
|
82
|
-
var f, u;
|
|
83
|
-
const r = ((f = t == null ? void 0 : t.filter((l) => {
|
|
84
|
-
var c, g;
|
|
85
|
-
return ((g = (c = l.config) == null ? void 0 : c.responsive) == null ? void 0 : g.deviceType) === "mobile";
|
|
86
|
-
})[0]) == null ? void 0 : f.sections) || [], a = ((u = t == null ? void 0 : t.filter((l) => {
|
|
87
|
-
var c, g;
|
|
88
|
-
return ((g = (c = l.config) == null ? void 0 : c.responsive) == null ? void 0 : g.deviceType) === "desktop";
|
|
89
|
-
})[0]) == null ? void 0 : u.sections) || [], n = r.slice(0, 1), p = r.slice(1, r.length), d = a.slice(0, 1), m = a.slice(1, a.length);
|
|
90
|
-
return /* @__PURE__ */ y(I, { children: [
|
|
91
|
-
/* @__PURE__ */ y("div", { className: o, children: [
|
|
92
|
-
/* @__PURE__ */ i("div", { className: v["responsive-mobile-flex"], children: /* @__PURE__ */ i(s, { data: n ?? [] }) }),
|
|
93
|
-
/* @__PURE__ */ i("div", { className: v["responsive-desktop-flex"], children: /* @__PURE__ */ i(s, { data: d ?? [] }) })
|
|
94
|
-
] }),
|
|
95
|
-
e,
|
|
96
|
-
/* @__PURE__ */ i("div", { className: v["responsive-mobile-flex"], children: /* @__PURE__ */ i(s, { data: p ?? [] }) }),
|
|
97
|
-
/* @__PURE__ */ i("div", { className: v["responsive-desktop-flex"], children: /* @__PURE__ */ i(s, { data: m ?? [] }) }),
|
|
98
|
-
/* @__PURE__ */ i(S.Divider, {})
|
|
99
|
-
] });
|
|
100
|
-
};
|
|
101
|
-
async function x({ contentType: e, storeId: t, CMS_PROJECT_NAME: s, NextCookies: o }) {
|
|
102
|
-
const r = await k({
|
|
103
|
-
contentType: e,
|
|
104
|
-
storeId: t,
|
|
105
|
-
CMS_PROJECT_NAME: s,
|
|
106
|
-
NextCookies: o
|
|
107
|
-
});
|
|
108
|
-
if (r.status === 200) {
|
|
109
|
-
const a = {
|
|
110
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
111
|
-
contentType: e,
|
|
112
|
-
data: r.data
|
|
113
|
-
};
|
|
114
|
-
console.log("Resultado da chamada:", r);
|
|
115
|
-
const n = `backup-${e}-${Date.now()}.json`;
|
|
116
|
-
return await $.writeFile(
|
|
117
|
-
`./backups/${n}`,
|
|
118
|
-
JSON.stringify(a, null, 2),
|
|
119
|
-
"utf-8"
|
|
120
|
-
), { success: !0, fileName: n };
|
|
121
|
-
}
|
|
122
|
-
return { success: !1, error: r.error || "No data to backup" };
|
|
123
|
-
}
|
|
124
|
-
async function B(e) {
|
|
125
|
-
return x(e);
|
|
126
|
-
}
|
|
127
|
-
async function T({
|
|
128
|
-
contentType: e,
|
|
129
|
-
documentId: t,
|
|
130
|
-
versionId: s,
|
|
131
|
-
storeId: o,
|
|
132
|
-
CMS_PROJECT_NAME: r
|
|
133
|
-
}) {
|
|
134
|
-
const a = t && t.length ? `/${t}` : "", n = s && s.length ? `?versionId=${s}` : "";
|
|
135
|
-
return fetch(
|
|
136
|
-
`https://${o}.myvtex.com/_v/cms/api/${r}/${e}${a}${n}`,
|
|
137
|
-
{ cache: "no-cache" }
|
|
138
|
-
);
|
|
139
|
-
}
|
|
140
|
-
async function U({
|
|
141
|
-
contentType: e,
|
|
142
|
-
documents: t,
|
|
143
|
-
NextCookies: s,
|
|
144
|
-
previewId: o,
|
|
145
|
-
CMS_PROJECT_NAME: r,
|
|
146
|
-
storeId: a
|
|
147
|
-
}) {
|
|
148
|
-
var p;
|
|
149
|
-
const n = JSON.parse(
|
|
150
|
-
o ?? ((p = s == null ? void 0 : s().get("cms_preview_data")) == null ? void 0 : p.value) ?? "{}"
|
|
151
|
-
);
|
|
152
|
-
if (n && (n == null ? void 0 : n.contentType) === e) {
|
|
153
|
-
const d = n.documentId && n.documentId.length ? `/${n.documentId}` : "", m = n != null && n.versionId && (n != null && n.versionId.length) ? `?versionId=${n == null ? void 0 : n.versionId}` : "", u = await (await fetch(
|
|
154
|
-
`https://${a}.myvtex.com/_v/cms/api/${r}/${e}${d}${m}`,
|
|
155
|
-
{ cache: "no-store" }
|
|
156
|
-
)).json(), l = t.filter(
|
|
157
|
-
(c) => u.id !== c.documentId
|
|
158
|
-
);
|
|
159
|
-
return l.unshift(u), l;
|
|
160
|
-
}
|
|
161
|
-
return t;
|
|
162
|
-
}
|
|
163
|
-
async function k({
|
|
164
|
-
contentType: e,
|
|
165
|
-
NextCookies: t,
|
|
166
|
-
CMS_PROJECT_NAME: s,
|
|
167
|
-
storeId: o,
|
|
168
|
-
previewId: r
|
|
169
|
-
}) {
|
|
170
|
-
var f, u;
|
|
171
|
-
const a = JSON.parse(
|
|
172
|
-
r ?? ((f = t == null ? void 0 : t().get("cms_preview_data")) == null ? void 0 : f.value) ?? "{}"
|
|
173
|
-
), n = [];
|
|
174
|
-
let p = 1, d = 0, m = !0;
|
|
175
|
-
try {
|
|
176
|
-
do {
|
|
177
|
-
const c = await (await fetch(
|
|
178
|
-
`https://${o}.myvtex.com/_v/cms/api/${s}/${e}?page=${p}`
|
|
179
|
-
)).json();
|
|
180
|
-
p === 1 && (d = c.totalItems), (u = c == null ? void 0 : c.data) != null && u.length && n.push(...c.data), m = c.hasNextPage, p++;
|
|
181
|
-
} while (m && n.length < d);
|
|
182
|
-
if (a.previewMode && n.length) {
|
|
183
|
-
const l = await U({
|
|
184
|
-
contentType: e,
|
|
185
|
-
documents: n,
|
|
186
|
-
NextCookies: t,
|
|
187
|
-
CMS_PROJECT_NAME: s,
|
|
188
|
-
storeId: o
|
|
189
|
-
});
|
|
190
|
-
return {
|
|
191
|
-
status: l.length > 0 ? 200 : 404,
|
|
192
|
-
data: l ?? []
|
|
193
|
-
};
|
|
194
|
-
}
|
|
195
|
-
return {
|
|
196
|
-
status: n.length ? 200 : 404,
|
|
197
|
-
data: n
|
|
198
|
-
};
|
|
199
|
-
} catch (l) {
|
|
200
|
-
return { status: "error", data: [], error: l };
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
const q = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
204
|
-
__proto__: null,
|
|
205
|
-
cmsBackup: B,
|
|
206
|
-
getCMSContentType: T,
|
|
207
|
-
getContentType: k
|
|
208
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
209
|
-
export {
|
|
210
|
-
V as S,
|
|
211
|
-
K as _,
|
|
212
|
-
N as a,
|
|
213
|
-
M as b,
|
|
214
|
-
J as c,
|
|
215
|
-
Y as d,
|
|
216
|
-
q as e,
|
|
217
|
-
L as f,
|
|
218
|
-
k as g,
|
|
219
|
-
A as p,
|
|
220
|
-
v as r
|
|
221
|
-
};
|
package/index-WV5Gjz3i.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const f=require("react/jsx-runtime"),T=require("@soma-vertical-web/core-components"),v=(e,t=!0)=>Intl.NumberFormat("pt-BR",{style:"currency",currency:"BRL",minimumFractionDigits:t?2:0}).format(e),_=({valueInCents:e,hasFree:t,freeTaxMessage:n})=>e===0?t?n:v(0):v(e/100),y=(e,t)=>{const[n,r]=e.split(t);return{name:n.trim(),size:r?r.trim():""}},$=(e,t)=>{if(!e)return{};const[n,r]=e.split(t);return{color:n==null?void 0:n.trim(),size:r==null?void 0:r.trim()}},k=(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},A=(e,t)=>e.replace(t,"").trim(),B=e=>e.replace(/\//g,""),N=({items:e,NAME_SPLIT_SYMBOL:t})=>{const n={price:0,listPrice:0,installments:{count:0,value:0}},r=(s,i)=>{var m;i&&(i.sellerId=s.sellerId,i.sellerName=s.sellerName,i.available=!0,i.isSellerDefault=s.sellerDefault);const{Price:l,ListPrice:d,PaymentOptions:{installmentOptions:p}}=s.commertialOffer;n.price=l,n.listPrice=d;const c=(m=p==null?void 0:p[0])==null?void 0:m.installments;if(c){const{count:u,value:g}=c[c.length-1];n.installments={count:u,value:g/100}}};let o=!0;const a=e.reduce((s,i)=>{var p;const l={name:i.name,sku:i.itemId,value:((p=i.Tamanho)==null?void 0:p[0])??y(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,r(c,l)),c.commertialOffer.IsAvailable));return!l.isSellerDefault&&d.length>0&&(l.available=!0,r(d[0],{...l,sellerId:d[0].sellerId,sellerName:d[0].sellerName})),l.available===!1&&(o=!1),s.push(l),s},[]);return{...n,sizes:a,allSizesAvailable:o}},P=e=>e?!e.offers.offers.find(({quantity:t=0})=>t>0):!1,w=(e,t)=>{const n=e.find(r=>r.availability.includes("InStock")&&r.quantity&&r.listPrice>0&&r.seller.identifier===t);return n||e.find(r=>r.availability.includes("InStock")&&r.quantity&&r.listPrice>0)},F=({images:e,TEXTURE_IMAGE:t})=>e.find(n=>t.includes(n.imageLabel))??e[0],j=(e,t)=>{const n=/\/ids\/(\d+)\//,r=e.match(n);return r?e.replace(`/${r[1]}/`,`/${r[1]}-${t.width}-${t.height}/`):e},O=(e,t)=>{const n=/\/ids\/(\d+)-(\d+)-(\d+)\//,r=e.match(n);return r?e.replace(`/${r[1]}-${r[2]}-${r[3]}/`,`/${r[1]}-${t.width}-${t.height}/`):e},x=({images:e,label:t})=>{const n=e.filter(r=>r.keywords===t.first||r.keywords===t.second||r.alternateName===t.first||r.alternateName===t.second);return n.length===0?[e[0]]: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},C=(e,t,n)=>{t&&(e?(t.getAttribute("src")||(t.src=n??""),t.play()):t.pause())},U=Object.freeze(Object.defineProperty({__proto__:null,disableSKU:P,formatPriceToCurrency:v,freightParsePrice:_,getAspectRatio:D,getColorAndSizeFromSkuName:$,getFirstImages:x,getProductNameWithoutSku:A,getSKUName:k,getSkuInfos:N,getThumbImage:F,getValidOffer:w,removeSlashes:B,resizingImg:j,setVideoPlay:C,splitNameAndSizeFromFullName:y,updatedResizedImg:O},Symbol.toStringTag,{value:"Module"})),S="fuzzy",I="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(r=>{if(r.key==="category-2"&&r.__typename==="FacetBoolean"){const o=r.values;return{...r,values:o.filter(a=>!n.find(s=>s.toLowerCase()===a.value||s.toLowerCase()===a.name.toLowerCase()))}}return r})},R=(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:r}=e;return{__typename:"FacetBoolean",key:t,label:n,values:r.slice().sort((o,a)=>o.name.localeCompare(a.name))}},Y=({key:e,values:t})=>({__typename:"FacetRange",key:e,values:t}),H=(e,t,n)=>{if(!(e instanceof Object)||!("facets"in e))return[];const{facets:r=[]}=e,o=t!=null&&t.length?t[0].key==="category-1":!1;return r.filter(s=>!n||!R(s.key,o)).map(s=>K(s)?q(s):Y(s))},J=(e,t)=>{const n=e.find(({key:o})=>o===S)??null,r=e.find(({key:o})=>o===I)??null;n&&V(n)&&t.append(S,n.value),r&&M(r)&&t.append(I,r.value)},W=e=>e.map(t=>{const[n,r]=t.split("/");return{key:n,value:r}}),G=(e,t)=>{const n=decodeURIComponent(t??"").slice(1).split("/"),r=e.filter(({value:a})=>!n.includes(decodeURIComponent(a))).map(a=>({...a,value:decodeURIComponent(a.value)})),{isDepartment:o}=E(r);return r==null?void 0:r.filter(a=>!R(a.key,o))},X=({pathname:e,searchParams:t},n)=>{const r=t.get("sort")??"",o=t.get("query")??null,a=parseInt(t.get("page")??"1",10);return{sort:r,facets:W(n),term:o,base:o?"":e,page:a}},Q=e=>{const t=new URLSearchParams;return Object.entries(e).forEach(([n,r])=>{Array.isArray(r)?r.forEach(o=>t.append(n,o)):r!==void 0&&t.append(n,r)}),t},h={"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"},z={},Z=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"})),ee=({children:e,data:t,SectionZone:n,className:r})=>{var p,c;const o=((p=t==null?void 0:t.filter(m=>{var u,g;return((g=(u=m.config)==null?void 0:u.responsive)==null?void 0:g.deviceType)==="mobile"})[0])==null?void 0:p.sections)||[],a=((c=t==null?void 0:t.filter(m=>{var u,g;return((g=(u=m.config)==null?void 0:u.responsive)==null?void 0:g.deviceType)==="desktop"})[0])==null?void 0:c.sections)||[],s=o.slice(0,1),i=o.slice(1,o.length),l=a.slice(0,1),d=a.slice(1,a.length);return f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:r,children:[f.jsx("div",{className:h["responsive-mobile-flex"],children:f.jsx(n,{data:s??[]})}),f.jsx("div",{className:h["responsive-desktop-flex"],children:f.jsx(n,{data:l??[]})})]}),e,f.jsx("div",{className:h["responsive-mobile-flex"],children:f.jsx(n,{data:i??[]})}),f.jsx("div",{className:h["responsive-desktop-flex"],children:f.jsx(n,{data:d??[]})}),f.jsx(T.Utils.Divider,{})]})};async function te({contentType:e,storeId:t,CMS_PROJECT_NAME:n,NextCookies:r}){const o=await b({contentType:e,storeId:t,CMS_PROJECT_NAME:n,NextCookies:r});if(o.status===200){const a={timestamp:new Date().toISOString(),contentType:e,data:o.data};console.log("Resultado da chamada:",o);const s=`backup-${e}-${Date.now()}.json`;return await z.writeFile(`./backups/${s}`,JSON.stringify(a,null,2),"utf-8"),{success:!0,fileName:s}}return{success:!1,error:o.error||"No data to backup"}}async function ne(e){return te(e)}async function re({contentType:e,documentId:t,versionId:n,storeId:r,CMS_PROJECT_NAME:o}){const a=t&&t.length?`/${t}`:"",s=n&&n.length?`?versionId=${n}`:"";return fetch(`https://${r}.myvtex.com/_v/cms/api/${o}/${e}${a}${s}`,{cache:"no-cache"})}async function se({contentType:e,documents:t,NextCookies:n,previewId:r,CMS_PROJECT_NAME:o,storeId:a}){var i;const s=JSON.parse(r??((i=n==null?void 0:n().get("cms_preview_data"))==null?void 0:i.value)??"{}");if(s&&(s==null?void 0:s.contentType)===e){const l=s.documentId&&s.documentId.length?`/${s.documentId}`:"",d=s!=null&&s.versionId&&(s!=null&&s.versionId.length)?`?versionId=${s==null?void 0:s.versionId}`:"",c=await(await fetch(`https://${a}.myvtex.com/_v/cms/api/${o}/${e}${l}${d}`,{cache:"no-store"})).json(),m=t.filter(u=>c.id!==u.documentId);return m.unshift(c),m}return t}async function b({contentType:e,NextCookies:t,CMS_PROJECT_NAME:n,storeId:r,previewId:o}){var p,c;const a=JSON.parse(o??((p=t==null?void 0:t().get("cms_preview_data"))==null?void 0:p.value)??"{}"),s=[];let i=1,l=0,d=!0;try{do{const u=await(await fetch(`https://${r}.myvtex.com/_v/cms/api/${n}/${e}?page=${i}`)).json();i===1&&(l=u.totalItems),(c=u==null?void 0:u.data)!=null&&c.length&&s.push(...u.data),d=u.hasNextPage,i++}while(d&&s.length<l);if(a.previewMode&&s.length){const m=await se({contentType:e,documents:s,NextCookies:t,CMS_PROJECT_NAME:n,storeId:r});return{status:m.length>0?200:404,data:m??[]}}return{status:s.length?200:404,data:s}}catch(m){return{status:"error",data:[],error:m}}}const oe=Object.freeze(Object.defineProperty({__proto__:null,cmsBackup:ne,getCMSContentType:re,getContentType:b},Symbol.toStringTag,{value:"Module"}));exports.SearchPageScreening=ee;exports.__viteBrowserExternal=Z;exports.addSearchParamsFacets=J;exports.cms=oe;exports.convertSearchParams=Q;exports.disableSKU=P;exports.filterNonCategorySelected=L;exports.filterNonRootFacets=G;exports.formatPriceToCurrency=v;exports.formattedFacets=H;exports.freightParsePrice=_;exports.getColorAndSizeFromSkuName=$;exports.getContentType=b;exports.getFirstImages=x;exports.getSKUName=k;exports.getSkuInfos=N;exports.getThumbImage=F;exports.getValidOffer=w;exports.parseSearchState=X;exports.productHelpers=U;exports.resizingImg=j;exports.responsive=h;exports.setVideoPlay=C;exports.splitNameAndSizeFromFullName=y;exports.updatedResizedImg=O;
|
package/index-catAI5a3.mjs
DELETED
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
import { jsxs as v, Fragment as R, jsx as p } from "react/jsx-runtime";
|
|
2
|
-
import { Utils as w } from "@soma-vertical-web/core-components";
|
|
3
|
-
const b = "fuzzy", _ = "operator", S = (e) => ({
|
|
4
|
-
isDepartment: e != null && e.length ? e[0].key === "category-1" : !1
|
|
5
|
-
}), M = (e, t) => {
|
|
6
|
-
const s = decodeURIComponent(t ?? "").slice(1).split("/");
|
|
7
|
-
return e.map((o) => {
|
|
8
|
-
if (o.key === "category-2" && o.__typename === "FacetBoolean") {
|
|
9
|
-
const r = o.values;
|
|
10
|
-
return {
|
|
11
|
-
...o,
|
|
12
|
-
values: r.filter(
|
|
13
|
-
(a) => !s.find(
|
|
14
|
-
(n) => n.toLowerCase() === a.value || n.toLowerCase() === a.name.toLowerCase()
|
|
15
|
-
)
|
|
16
|
-
)
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
return o;
|
|
20
|
-
});
|
|
21
|
-
}, $ = (e, t) => t ? e === "category-1" : !1, C = (e) => e.key === "operator" && (e.value === "and" || e.value === "or"), E = (e) => e.type === "TEXT", O = (e) => e.key === "fuzzy" && (e.value === "0" || e.value === "1" || e.value === "auto"), j = (e) => {
|
|
22
|
-
const { key: t, name: s, values: o } = e;
|
|
23
|
-
return {
|
|
24
|
-
__typename: "FacetBoolean",
|
|
25
|
-
key: t,
|
|
26
|
-
label: s,
|
|
27
|
-
values: o.slice().sort((r, a) => r.name.localeCompare(a.name))
|
|
28
|
-
};
|
|
29
|
-
}, T = ({ key: e, values: t }) => ({
|
|
30
|
-
__typename: "FacetRange",
|
|
31
|
-
key: e,
|
|
32
|
-
values: t
|
|
33
|
-
}), N = (e, t, s) => {
|
|
34
|
-
if (!(e instanceof Object) || !("facets" in e))
|
|
35
|
-
return [];
|
|
36
|
-
const { facets: o = [] } = e, r = t != null && t.length ? t[0].key === "category-1" : !1;
|
|
37
|
-
return o.filter(
|
|
38
|
-
(n) => !s || !$(n.key, r)
|
|
39
|
-
).map(
|
|
40
|
-
(n) => E(n) ? j(n) : T(n)
|
|
41
|
-
);
|
|
42
|
-
}, V = (e, t) => {
|
|
43
|
-
const s = e.find(({ key: r }) => r === b) ?? null, o = e.find(({ key: r }) => r === _) ?? null;
|
|
44
|
-
s && O(s) && t.append(b, s.value), o && C(o) && t.append(_, o.value);
|
|
45
|
-
}, F = (e) => e.map((t) => {
|
|
46
|
-
const [s, o] = t.split("/");
|
|
47
|
-
return { key: s, value: o };
|
|
48
|
-
}), J = (e, t) => {
|
|
49
|
-
const s = decodeURIComponent(t ?? "").slice(1).split("/"), o = e.filter(({ value: a }) => !s.includes(decodeURIComponent(a))).map((a) => ({
|
|
50
|
-
...a,
|
|
51
|
-
value: decodeURIComponent(a.value)
|
|
52
|
-
})), { isDepartment: r } = S(o);
|
|
53
|
-
return o == null ? void 0 : o.filter((a) => !$(a.key, r));
|
|
54
|
-
}, Y = ({ pathname: e, searchParams: t }, s) => {
|
|
55
|
-
const o = t.get("sort") ?? "", r = t.get("query") ?? null, a = parseInt(t.get("page") ?? "1", 10);
|
|
56
|
-
return {
|
|
57
|
-
sort: o,
|
|
58
|
-
facets: F(s),
|
|
59
|
-
term: r,
|
|
60
|
-
base: r ? "" : e,
|
|
61
|
-
page: a
|
|
62
|
-
};
|
|
63
|
-
}, K = (e) => {
|
|
64
|
-
const t = new URLSearchParams();
|
|
65
|
-
return Object.entries(e).forEach(([s, o]) => {
|
|
66
|
-
Array.isArray(o) ? o.forEach((r) => t.append(s, r)) : o !== void 0 && t.append(s, o);
|
|
67
|
-
}), t;
|
|
68
|
-
}, x = async (e, t = {}) => {
|
|
69
|
-
const { method: s = "GET", body: o, headers: r = {}, priority: a = "auto", cache: n = "default" } = t;
|
|
70
|
-
return fetch(e, {
|
|
71
|
-
method: s,
|
|
72
|
-
headers: {
|
|
73
|
-
...r,
|
|
74
|
-
Accept: "application/json",
|
|
75
|
-
"Content-Type": "application/json"
|
|
76
|
-
},
|
|
77
|
-
priority: a,
|
|
78
|
-
cache: n,
|
|
79
|
-
...o ? { body: JSON.stringify(o) } : {}
|
|
80
|
-
// not body in get
|
|
81
|
-
}).then((i) => i.json()).catch((i) => {
|
|
82
|
-
console.error("[ERROR FETCH VTEX]", i);
|
|
83
|
-
});
|
|
84
|
-
}, h = /* @__PURE__ */ new Map();
|
|
85
|
-
async function P(e, t = {}) {
|
|
86
|
-
var s;
|
|
87
|
-
try {
|
|
88
|
-
const { abort: o = !1 } = t, r = new AbortController();
|
|
89
|
-
o && (h.has(e) && ((s = h.get(e)) == null || s.abort(), h.delete(e)), h.set(e, r));
|
|
90
|
-
const a = x(e, {
|
|
91
|
-
...t,
|
|
92
|
-
...o ? { signal: r.signal } : {}
|
|
93
|
-
});
|
|
94
|
-
return o && h.delete(e), a;
|
|
95
|
-
} catch (o) {
|
|
96
|
-
if (o.name === "AbortError") {
|
|
97
|
-
console.log(`[REQUEST CANCELLED]: ${e}`);
|
|
98
|
-
return;
|
|
99
|
-
}
|
|
100
|
-
throw console.error(`[ERROR API]: ${o.message}`), o;
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
const y = {
|
|
104
|
-
"responsive-mobile-flex": "_responsive-mobile-flex_t5bry_2",
|
|
105
|
-
"responsive-desktop-flex": "_responsive-desktop-flex_t5bry_13",
|
|
106
|
-
"responsive-mobile-block": "_responsive-mobile-block_t5bry_24",
|
|
107
|
-
"responsive-desktop-block": "_responsive-desktop-block_t5bry_35"
|
|
108
|
-
}, k = {}, X = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
109
|
-
__proto__: null,
|
|
110
|
-
default: k
|
|
111
|
-
}, Symbol.toStringTag, { value: "Module" })), q = ({
|
|
112
|
-
children: e,
|
|
113
|
-
data: t,
|
|
114
|
-
SectionZone: s,
|
|
115
|
-
className: o
|
|
116
|
-
}) => {
|
|
117
|
-
var m, u;
|
|
118
|
-
const r = ((m = t == null ? void 0 : t.filter((l) => {
|
|
119
|
-
var c, g;
|
|
120
|
-
return ((g = (c = l.config) == null ? void 0 : c.responsive) == null ? void 0 : g.deviceType) === "mobile";
|
|
121
|
-
})[0]) == null ? void 0 : m.sections) || [], a = ((u = t == null ? void 0 : t.filter((l) => {
|
|
122
|
-
var c, g;
|
|
123
|
-
return ((g = (c = l.config) == null ? void 0 : c.responsive) == null ? void 0 : g.deviceType) === "desktop";
|
|
124
|
-
})[0]) == null ? void 0 : u.sections) || [], n = r.slice(0, 1), i = r.slice(1, r.length), d = a.slice(0, 1), f = a.slice(1, a.length);
|
|
125
|
-
return /* @__PURE__ */ v(R, { children: [
|
|
126
|
-
/* @__PURE__ */ v("div", { className: o, children: [
|
|
127
|
-
/* @__PURE__ */ p("div", { className: y["responsive-mobile-flex"], children: /* @__PURE__ */ p(s, { data: n ?? [] }) }),
|
|
128
|
-
/* @__PURE__ */ p("div", { className: y["responsive-desktop-flex"], children: /* @__PURE__ */ p(s, { data: d ?? [] }) })
|
|
129
|
-
] }),
|
|
130
|
-
e,
|
|
131
|
-
/* @__PURE__ */ p("div", { className: y["responsive-mobile-flex"], children: /* @__PURE__ */ p(s, { data: i ?? [] }) }),
|
|
132
|
-
/* @__PURE__ */ p("div", { className: y["responsive-desktop-flex"], children: /* @__PURE__ */ p(s, { data: f ?? [] }) }),
|
|
133
|
-
/* @__PURE__ */ p(w.Divider, {})
|
|
134
|
-
] });
|
|
135
|
-
};
|
|
136
|
-
async function z({ contentType: e, storeId: t, CMS_PROJECT_NAME: s, NextCookies: o }) {
|
|
137
|
-
const r = await I({
|
|
138
|
-
contentType: e,
|
|
139
|
-
storeId: t,
|
|
140
|
-
CMS_PROJECT_NAME: s,
|
|
141
|
-
NextCookies: o
|
|
142
|
-
});
|
|
143
|
-
if (r.status === 200) {
|
|
144
|
-
const a = {
|
|
145
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
146
|
-
contentType: e,
|
|
147
|
-
data: r.data
|
|
148
|
-
};
|
|
149
|
-
console.log("Resultado da chamada:", r);
|
|
150
|
-
const n = `backup-${e}-${Date.now()}.json`;
|
|
151
|
-
return await k.writeFile(
|
|
152
|
-
`./backups/${n}`,
|
|
153
|
-
JSON.stringify(a, null, 2),
|
|
154
|
-
"utf-8"
|
|
155
|
-
), { success: !0, fileName: n };
|
|
156
|
-
}
|
|
157
|
-
return { success: !1, error: r.error || "No data to backup" };
|
|
158
|
-
}
|
|
159
|
-
async function A(e) {
|
|
160
|
-
return z(e);
|
|
161
|
-
}
|
|
162
|
-
async function B({
|
|
163
|
-
contentType: e,
|
|
164
|
-
documentId: t,
|
|
165
|
-
versionId: s,
|
|
166
|
-
storeId: o,
|
|
167
|
-
CMS_PROJECT_NAME: r
|
|
168
|
-
}) {
|
|
169
|
-
const a = t && t.length ? `/${t}` : "", n = s && s.length ? `?versionId=${s}` : "";
|
|
170
|
-
return fetch(
|
|
171
|
-
`https://${o}.myvtex.com/_v/cms/api/${r}/${e}${a}${n}`,
|
|
172
|
-
{ cache: "no-cache" }
|
|
173
|
-
);
|
|
174
|
-
}
|
|
175
|
-
async function U({
|
|
176
|
-
contentType: e,
|
|
177
|
-
documents: t,
|
|
178
|
-
NextCookies: s,
|
|
179
|
-
previewId: o,
|
|
180
|
-
CMS_PROJECT_NAME: r,
|
|
181
|
-
storeId: a
|
|
182
|
-
}) {
|
|
183
|
-
var i;
|
|
184
|
-
const n = JSON.parse(
|
|
185
|
-
o ?? ((i = s == null ? void 0 : s().get("cms_preview_data")) == null ? void 0 : i.value) ?? "{}"
|
|
186
|
-
);
|
|
187
|
-
if (n && (n == null ? void 0 : n.contentType) === e) {
|
|
188
|
-
const d = n.documentId && n.documentId.length ? `/${n.documentId}` : "", f = n != null && n.versionId && (n != null && n.versionId.length) ? `?versionId=${n == null ? void 0 : n.versionId}` : "", u = await (await fetch(
|
|
189
|
-
`https://${a}.myvtex.com/_v/cms/api/${r}/${e}${d}${f}`,
|
|
190
|
-
{ cache: "no-store" }
|
|
191
|
-
)).json(), l = t.filter(
|
|
192
|
-
(c) => u.id !== c.documentId
|
|
193
|
-
);
|
|
194
|
-
return l.unshift(u), l;
|
|
195
|
-
}
|
|
196
|
-
return t;
|
|
197
|
-
}
|
|
198
|
-
async function I({
|
|
199
|
-
contentType: e,
|
|
200
|
-
NextCookies: t,
|
|
201
|
-
CMS_PROJECT_NAME: s,
|
|
202
|
-
storeId: o,
|
|
203
|
-
previewId: r
|
|
204
|
-
}) {
|
|
205
|
-
var m, u;
|
|
206
|
-
const a = JSON.parse(
|
|
207
|
-
r ?? ((m = t == null ? void 0 : t().get("cms_preview_data")) == null ? void 0 : m.value) ?? "{}"
|
|
208
|
-
), n = [];
|
|
209
|
-
let i = 1, d = 0, f = !0;
|
|
210
|
-
try {
|
|
211
|
-
do {
|
|
212
|
-
const c = await (await fetch(
|
|
213
|
-
`https://${o}.myvtex.com/_v/cms/api/${s}/${e}?page=${i}`
|
|
214
|
-
)).json();
|
|
215
|
-
i === 1 && (d = c.totalItems), (u = c == null ? void 0 : c.data) != null && u.length && n.push(...c.data), f = c.hasNextPage, i++;
|
|
216
|
-
} while (f && n.length < d);
|
|
217
|
-
if (a.previewMode && n.length) {
|
|
218
|
-
const l = await U({
|
|
219
|
-
contentType: e,
|
|
220
|
-
documents: n,
|
|
221
|
-
NextCookies: t,
|
|
222
|
-
CMS_PROJECT_NAME: s,
|
|
223
|
-
storeId: o
|
|
224
|
-
});
|
|
225
|
-
return {
|
|
226
|
-
status: l.length > 0 ? 200 : 404,
|
|
227
|
-
data: l ?? []
|
|
228
|
-
};
|
|
229
|
-
}
|
|
230
|
-
return {
|
|
231
|
-
status: n.length ? 200 : 404,
|
|
232
|
-
data: n
|
|
233
|
-
};
|
|
234
|
-
} catch (l) {
|
|
235
|
-
return { status: "error", data: [], error: l };
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
const G = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
239
|
-
__proto__: null,
|
|
240
|
-
cmsBackup: A,
|
|
241
|
-
getCMSContentType: B,
|
|
242
|
-
getContentType: I
|
|
243
|
-
}, Symbol.toStringTag, { value: "Module" }));
|
|
244
|
-
export {
|
|
245
|
-
q as S,
|
|
246
|
-
X as _,
|
|
247
|
-
V as a,
|
|
248
|
-
P as b,
|
|
249
|
-
K as c,
|
|
250
|
-
N as d,
|
|
251
|
-
M as e,
|
|
252
|
-
x as f,
|
|
253
|
-
I as g,
|
|
254
|
-
J as h,
|
|
255
|
-
G as i,
|
|
256
|
-
Y as p,
|
|
257
|
-
y as r
|
|
258
|
-
};
|
package/index-drKDwA8_.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
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 d;i&&(i.sellerId=r.sellerId,i.sellerName=r.sellerName,i.available=!0,i.isSellerDefault=r.sellerDefault);const{Price:l,ListPrice:u,PaymentOptions:{installmentOptions:_}}=r.commertialOffer;n.price=l,n.listPrice=u;const c=(d=_==null?void 0:_[0])==null?void 0:d.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},u=i.sellers.filter(c=>(c.sellerDefault&&c.commertialOffer.IsAvailable&&(l.available=!0,s(c,l)),c.commertialOffer.IsAvailable));return!l.isSellerDefault&&u.length>0&&(l.available=!0,s(u[0],{...l,sellerId:u[0].sellerId,sellerName:u[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",de="_measurementImage_1dxfy_252",ue="_measurementImageContainer_1dxfy_255",_e="_measurementContent_1dxfy_264",fe="_measurementTitle_1dxfy_268",pe="_measurementClose_1dxfy_279",ye="_productref_1dxfy_344",ge="_content_1dxfy_324",be="_pdp_1dxfy_112",he={"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:de,measurementImageContainer:ue,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:be,"pdp-main":"_pdp-main_1dxfy_423","pdp-main__gallery-wrapper":"_pdp-main__gallery-wrapper_1dxfy_428","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","pdp-main__info-secondary-content":"_pdp-main__info-secondary-content_1dxfy_489","sections-title":"_sections-title_1dxfy_495"},ve=({children:e,data:t,SectionZone:n,className:s})=>{var _,c;const a=((_=t==null?void 0:t.filter(d=>{var m,p;return((p=(m=d.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(d=>{var m,p;return((p=(m=d.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),u=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:u??[]})}),f.jsx(A.Utils.Divider,{})]})};async function xe({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 Ie(e){return xe(e)}async function Se({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 we({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}`:"",u=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}${u}`,{cache:"no-store"})).json(),d=t.filter(m=>c.id!==m.documentId);return d.unshift(c),d}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,u=!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),u=m.hasNextPage,i++}while(u&&r.length<l);if(o.previewMode&&r.length){const d=await we({contentType:e,documents:r,NextCookies:t,CMS_PROJECT_NAME:n,storeId:s});return{status:d.length>0?200:404,data:d??[]}}return{status:r.length?200:404,data:r}}catch(d){return{status:"error",data:[],error:d}}}const ke=Object.freeze(Object.defineProperty({__proto__:null,cmsBackup:Ie,getCMSContentType:Se,getContentType:h},Symbol.toStringTag,{value:"Module"}));exports.SearchPageScreening=ve;exports.__viteBrowserExternal=Z;exports.addSearchParamsFacets=Y;exports.cms=ke;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=he;exports.updatedResizedImg=P;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MenuCategoriesProps } from '../../../../../../types/layout/team-components/Menu/Mobile';
|
|
2
|
-
|
|
3
|
-
declare const MenuCategories: {
|
|
4
|
-
({ children, mobileBannerAlt, mobileBannerSrc, onClick, textColor, ...props }: MenuCategoriesProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
7
|
-
export default MenuCategories;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MenuCategoriesWrapperProps } from '../../../../../../types/layout/team-components/Menu/Mobile';
|
|
2
|
-
|
|
3
|
-
declare const MenuCategoriesWrapper: {
|
|
4
|
-
({ children, link, }: MenuCategoriesWrapperProps): string | number | bigint | boolean | Iterable<import('react').ReactNode> | Promise<string | number | bigint | boolean | import('react').ReactPortal | import('react').ReactElement<unknown, string | import('react').JSXElementConstructor<any>> | Iterable<import('react').ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
7
|
-
export default MenuCategoriesWrapper;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { SubMenuSubCategoryProps } from '../../../../../../../types/layout/team-components/Menu/Mobile';
|
|
2
|
-
|
|
3
|
-
declare const SubMenuSubCategory: {
|
|
4
|
-
({ subcategory, submenuLabel, }: SubMenuSubCategoryProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
7
|
-
export default SubMenuSubCategory;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MenuHeaderNavLinksProps } from '../../../../../../types/layout/team-components/Menu/Mobile';
|
|
2
|
-
|
|
3
|
-
declare const MenuHeaderNavLinks: {
|
|
4
|
-
({ navigationLinks }: MenuHeaderNavLinksProps): import("react/jsx-runtime").JSX.Element | null;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
7
|
-
export default MenuHeaderNavLinks;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { MenuHeaderWrapperProps } from '../../../../../../types/layout/team-components/Menu/Mobile';
|
|
2
|
-
|
|
3
|
-
declare const MenuHeaderWrapper: {
|
|
4
|
-
({ title, subtitle }: MenuHeaderWrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
7
|
-
export default MenuHeaderWrapper;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { IntRange } from '../../utils';
|
|
2
|
-
import { FetchFunctionsProps, FetchOptions } from '../api';
|
|
3
|
-
|
|
4
|
-
type searchResourcesRange = IntRange<1, 101>;
|
|
5
|
-
export interface PayloadProps {
|
|
6
|
-
[key: string]: FormDataEntryValue;
|
|
7
|
-
}
|
|
8
|
-
type MasterDataQueryParams = '_fields' | '_schema' | '_sort' | '_where' | '_keyword' | '_limit' | '_offset' | '_from';
|
|
9
|
-
export interface GetMasterDataDocumentsProps<T extends string> extends FetchFunctionsProps<undefined> {
|
|
10
|
-
searchFields?: {
|
|
11
|
-
[key in MasterDataQueryParams | T]?: string;
|
|
12
|
-
};
|
|
13
|
-
masterDataEntity: string;
|
|
14
|
-
fieldsToReturn?: string[];
|
|
15
|
-
headersRequests?: Record<string, string>;
|
|
16
|
-
retrieveAllSubsequentPages?: boolean;
|
|
17
|
-
resourcesLength?: searchResourcesRange;
|
|
18
|
-
}
|
|
19
|
-
export interface PostDocumentProps extends FetchFunctionsProps<PayloadProps> {
|
|
20
|
-
masterDataEntity: string;
|
|
21
|
-
fetchOptions?: FetchOptions;
|
|
22
|
-
}
|
|
23
|
-
export interface UpdateDocumentProps extends FetchFunctionsProps<PayloadProps> {
|
|
24
|
-
masterDataEntity: string;
|
|
25
|
-
documentId: string;
|
|
26
|
-
}
|
|
27
|
-
export {};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { HTMLAttributes } from 'react';
|
|
2
|
-
|
|
3
|
-
export interface BreadCrumbItemLinkProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
-
isLast?: boolean;
|
|
5
|
-
href?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
}
|
|
8
|
-
export type ContentProps = HTMLAttributes<HTMLDivElement>;
|
|
9
|
-
export type RootProps = HTMLAttributes<HTMLDivElement>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { MutableRefObject } from 'react';
|
|
2
|
-
import { SizeSkuItemProps } from '../../../ProductCard/Selectors';
|
|
3
|
-
|
|
4
|
-
export interface CardProps {
|
|
5
|
-
parent: MutableRefObject<null>;
|
|
6
|
-
productId: string;
|
|
7
|
-
setNotify: SizeSkuItemProps['setNotify'];
|
|
8
|
-
isKit?: boolean;
|
|
9
|
-
}
|
package/types/utils.d.ts
DELETED
/package/layout/team-component/Menu/Composite/Mobile/Navigation/{NavigationBar.d.ts → Bar.d.ts}
RENAMED
|
File without changes
|