@primestyleai/tryon 5.10.119 → 5.10.122
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/dist/react/index.js +113 -101
- package/dist/react/index.js.map +1 -1
- package/dist/react/styles.d.ts +1 -1
- package/dist/storefront/primestyle-tryon.js +17 -5
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1537,7 +1537,7 @@ const Mn = `
|
|
|
1537
1537
|
padding: 0.1vw 0.5vw;
|
|
1538
1538
|
}
|
|
1539
1539
|
.ps-tryon-sr-card-v2-rec-pill {
|
|
1540
|
-
align-self:
|
|
1540
|
+
align-self: center;
|
|
1541
1541
|
font-size: 0.55vw; font-weight: 700; color: var(--ps-accent);
|
|
1542
1542
|
text-transform: uppercase; letter-spacing: 0.08em;
|
|
1543
1543
|
background: rgba(33, 84, 239, 0.10);
|
|
@@ -3571,11 +3571,20 @@ const Mn = `
|
|
|
3571
3571
|
.ps-tryon-history-meta { font-size: 0.57vw; color: var(--ps-text-muted); margin-top: 3px; }
|
|
3572
3572
|
.ps-tryon-history-sizing { display: flex; align-items: center; gap: 0.42vw; margin-top: 0.31vw; }
|
|
3573
3573
|
.ps-tryon-history-sizing-reason { font-size: 0.57vw; color: var(--ps-text-secondary); flex: 1; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
3574
|
+
/* History badge — auto-grows for long combined-variant labels
|
|
3575
|
+
("MISSY 12 / Standard"). Stays circular for short labels (S, M, L,
|
|
3576
|
+
2-digit numerics) via min-width = min-height. Long labels stretch
|
|
3577
|
+
into a rounded pill. */
|
|
3574
3578
|
.ps-tryon-history-size-badge {
|
|
3575
|
-
flex-shrink: 0;
|
|
3576
|
-
|
|
3579
|
+
flex-shrink: 0;
|
|
3580
|
+
min-width: 2.08vw; height: 2.08vw;
|
|
3581
|
+
padding: 0 0.6vw;
|
|
3582
|
+
border-radius: 999px;
|
|
3583
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
3577
3584
|
background: linear-gradient(135deg, var(--ps-accent), var(--ps-accent-light));
|
|
3578
3585
|
color: #fff; font-size: 0.68vw; font-weight: 700;
|
|
3586
|
+
white-space: nowrap; line-height: 1;
|
|
3587
|
+
max-width: 100%; overflow: hidden; text-overflow: ellipsis;
|
|
3579
3588
|
}
|
|
3580
3589
|
.ps-tryon-history-result-img { width: 3.33vw; height: 4.17vw; border-radius: 0.52vw; object-fit: contain; background: var(--ps-modal-bg, #FFFFFF); flex-shrink: 0; border: 2px solid var(--ps-accent); }
|
|
3581
3590
|
.ps-tryon-history-delete {
|
|
@@ -9868,7 +9877,7 @@ function Wo({
|
|
|
9868
9877
|
const x = t?.matchDetails ?? [], V = /tight|loose|large|small|very/i, KA = x.some((j) => V.test(j.fit || ""));
|
|
9869
9878
|
return s(KA ? "Not Recommended" : "Your Selection");
|
|
9870
9879
|
}, [EA, t, s]);
|
|
9871
|
-
const
|
|
9880
|
+
const Ie = FA && EA && i && i[FA] ? i[FA] : fe, $ = xe(() => {
|
|
9872
9881
|
const x = [];
|
|
9873
9882
|
for (let V = 0; V < g.headers.length; V++) {
|
|
9874
9883
|
const KA = (g.headers[V] || "").toLowerCase();
|
|
@@ -9897,7 +9906,7 @@ function Wo({
|
|
|
9897
9906
|
x.push(j);
|
|
9898
9907
|
}
|
|
9899
9908
|
return x;
|
|
9900
|
-
}, [g]),
|
|
9909
|
+
}, [g]), ue = mA((x, V) => {
|
|
9901
9910
|
const KA = x.toLowerCase().trim(), j = B === "cm" || B === "", lA = j ? "cm" : "in", zA = [];
|
|
9902
9911
|
for (let P = 0; P < g.headers.length; P++) {
|
|
9903
9912
|
const bA = (g.headers[P] || "").toLowerCase().trim();
|
|
@@ -9929,12 +9938,12 @@ function Wo({
|
|
|
9929
9938
|
return { range: String(P(gA.min)) + (gA.min !== gA.max ? "–" + String(P(gA.max)) : ""), min: P(gA.min), max: P(gA.max) };
|
|
9930
9939
|
}
|
|
9931
9940
|
return { range: pe, ...gA };
|
|
9932
|
-
}, [g, uA, ie, B, $]),
|
|
9941
|
+
}, [g, uA, ie, B, $]), me = xe(() => {
|
|
9933
9942
|
if (h)
|
|
9934
9943
|
return (t?.matchDetails || []).map((NA) => {
|
|
9935
9944
|
let P = NA.chartRange, bA = NA.fit;
|
|
9936
9945
|
if (fe !== S) {
|
|
9937
|
-
const AA =
|
|
9946
|
+
const AA = ue(NA.measurement, fe);
|
|
9938
9947
|
if (AA && (AA.min > 0 || AA.max > 0)) {
|
|
9939
9948
|
const Ae = (NA.chartRange.match(/[a-zA-Z]+\s*$/) || [""])[0];
|
|
9940
9949
|
P = AA.range + (Ae ? ` ${Ae.trim()}` : "");
|
|
@@ -10005,11 +10014,11 @@ function Wo({
|
|
|
10005
10014
|
isLength: bA
|
|
10006
10015
|
};
|
|
10007
10016
|
});
|
|
10008
|
-
}, [t, n, r, h, z, fe]), ye =
|
|
10017
|
+
}, [t, n, r, h, z, fe]), ye = me.filter(
|
|
10009
10018
|
(x) => x.fit === "good" || x.fit === "a-bit-tight" || x.fit === "a-bit-loose"
|
|
10010
|
-
).length, se =
|
|
10019
|
+
).length, se = me.length > 0 ? Math.round(ye / me.length * 100) : 0, ee = !h, pA = t, WA = pA?.size || S, H = (t?.matchDetails || []).find(
|
|
10011
10020
|
(x) => /inseam|length/i.test(x.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(x.measurement)
|
|
10012
|
-
), fA = H ? (H.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", he = pA?.length || kA || fA,
|
|
10021
|
+
), fA = H ? (H.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", he = pA?.length || kA || fA, Pe = pA?.availableSizes || [], Je = pA?.availableLengths || [], GA = RA || he, He = Pe.length > 0 ? Pe : TA, oe = (() => {
|
|
10013
10022
|
if (He.length <= 3) return He;
|
|
10014
10023
|
const x = He.indexOf(S);
|
|
10015
10024
|
if (x < 0) return He.slice(0, 3);
|
|
@@ -10132,8 +10141,8 @@ function Wo({
|
|
|
10132
10141
|
padding: "4px 12px"
|
|
10133
10142
|
}, children: [
|
|
10134
10143
|
/* @__PURE__ */ e("span", { className: "ps-msd-card-size", children: [
|
|
10135
|
-
|
|
10136
|
-
!FA && GA && !
|
|
10144
|
+
Ie,
|
|
10145
|
+
!FA && GA && !Ie.includes(" / ") ? ` / ${GA}` : ""
|
|
10137
10146
|
] }),
|
|
10138
10147
|
GA && /* @__PURE__ */ A("span", { className: "ps-msd-card-size-meta", children: GA }),
|
|
10139
10148
|
FA && EA && /* @__PURE__ */ e("span", { className: "ps-msd-card-size-meta", style: { fontSize: "11px", opacity: 0.7 }, children: [
|
|
@@ -10154,10 +10163,10 @@ function Wo({
|
|
|
10154
10163
|
] }),
|
|
10155
10164
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", children: s("Based on your measurements and the garment's tailoring chart.") })
|
|
10156
10165
|
] }),
|
|
10157
|
-
F !== !1 &&
|
|
10166
|
+
F !== !1 && me.length > 0 && /* @__PURE__ */ e("div", { className: "ps-msd-blueprint", children: [
|
|
10158
10167
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: s("MEASUREMENT BLUEPRINT") }),
|
|
10159
10168
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
10160
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children:
|
|
10169
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: me.map((j, lA) => {
|
|
10161
10170
|
const zA = j.isLength && j.fit.includes("short") || j.fit.includes("tight"), we = j.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose", VA = V(j.area), le = String(lA + 1).padStart(2, "0");
|
|
10162
10171
|
return /* @__PURE__ */ e("div", { className: "ps-msd-row", children: [
|
|
10163
10172
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-num", children: [
|
|
@@ -10364,8 +10373,11 @@ function Wo({
|
|
|
10364
10373
|
borderRadius: "0.5vw",
|
|
10365
10374
|
padding: "0.2vw 0.7vw"
|
|
10366
10375
|
}, children: [
|
|
10367
|
-
|
|
10368
|
-
|
|
10376
|
+
(() => {
|
|
10377
|
+
const x = (Ie || "").length > 12;
|
|
10378
|
+
return /* @__PURE__ */ A("span", { style: { fontSize: x ? "1.6vw" : "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: Ie });
|
|
10379
|
+
})(),
|
|
10380
|
+
GA && !Ie.includes(" / ") && (() => {
|
|
10369
10381
|
const x = /^\d+(\.\d+)?$/.test(String(GA).trim()), V = (o || "").toLowerCase(), KA = x ? /pant|trouser|inseam/.test(V) ? s("Inseam") : s("Length") : null;
|
|
10370
10382
|
return /* @__PURE__ */ e("span", { style: { fontSize: "1.4vw", fontWeight: 400, color: "var(--ps-text-secondary)", display: "inline-flex", alignItems: "baseline", gap: "0.25vw" }, children: [
|
|
10371
10383
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.9vw", fontWeight: 600, color: "var(--ps-text-muted)", letterSpacing: "0.02em" }, children: "/" }),
|
|
@@ -10391,16 +10403,16 @@ function Wo({
|
|
|
10391
10403
|
s("Match based on your silhouette profile")
|
|
10392
10404
|
] })
|
|
10393
10405
|
] }),
|
|
10394
|
-
|
|
10406
|
+
me.length > 0 && /* @__PURE__ */ A("div", { style: { background: "white", borderRadius: "0.5vw", border: "1px solid rgba(0,0,0,0.06)", overflow: "hidden", marginBottom: "1.2vw" }, children: /* @__PURE__ */ e("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
|
|
10395
10407
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ e("tr", { children: [
|
|
10396
10408
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: s("Measurement") }),
|
|
10397
10409
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: s("Your Body") }),
|
|
10398
10410
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: s("Garment Spec") }),
|
|
10399
10411
|
/* @__PURE__ */ A("th", { style: { textAlign: "right", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: s("Fit Result") })
|
|
10400
10412
|
] }) }),
|
|
10401
|
-
/* @__PURE__ */ A("tbody", { children:
|
|
10413
|
+
/* @__PURE__ */ A("tbody", { children: me.map((x, V) => {
|
|
10402
10414
|
const KA = x.fit === "good" ? "#2154EF" : x.isLength ? x.fit.includes("short") || x.fit.includes("tight") ? "#dc2626" : "#d97706" : x.fit.includes("tight") ? "#dc2626" : "#d97706", j = x.fit === "good" ? "rgba(33,84,239,0.08)" : x.isLength ? x.fit.includes("short") || x.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : x.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
10403
|
-
return /* @__PURE__ */ e("tr", { style: { borderBottom: V <
|
|
10415
|
+
return /* @__PURE__ */ e("tr", { style: { borderBottom: V < me.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
10404
10416
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: x.area }),
|
|
10405
10417
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: h ? x.rawUserValue || "" : isNaN(x.userNum) || x.userNum === 0 ? "" : `${O(x.userNum)} ${B}` }),
|
|
10406
10418
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: h ? x.rawChartRange || "" : T(x.chartLabel) }),
|
|
@@ -10651,7 +10663,7 @@ function lr({
|
|
|
10651
10663
|
return { range: ve, ...YA };
|
|
10652
10664
|
}, [t, kA, RA, hA, sA, FA, PA]), de = g?.recommendedSize || "";
|
|
10653
10665
|
xe(() => g?.internationalSizes || {}, [g]);
|
|
10654
|
-
const [uA, ie] = Q("fit"), [TA, fe] = Q(null), [EA,
|
|
10666
|
+
const [uA, ie] = Q("fit"), [TA, fe] = Q(null), [EA, Ie] = Q(!1), [$, ue] = Q(!1), [me, ye] = Q(!1), [se, ee] = Q(null), [pA, WA] = Q(!1), [H, fA] = Q({ w: 800, h: 1200 }), he = K ?? {}, Pe = mA((m) => {
|
|
10655
10667
|
const y = m.currentTarget;
|
|
10656
10668
|
y.naturalWidth && y.naturalHeight && fA({ w: y.naturalWidth, h: y.naturalHeight });
|
|
10657
10669
|
}, []);
|
|
@@ -10840,7 +10852,7 @@ function lr({
|
|
|
10840
10852
|
src: u || B,
|
|
10841
10853
|
alt: n,
|
|
10842
10854
|
className: "ps-tryon-sr-product-img",
|
|
10843
|
-
onLoad:
|
|
10855
|
+
onLoad: Pe
|
|
10844
10856
|
}
|
|
10845
10857
|
),
|
|
10846
10858
|
i === "face" || i === "head" ? q && /* @__PURE__ */ A(sr, { landmarks: q, imgWidth: H.w, imgHeight: H.h }) : W && /* @__PURE__ */ A(Br, { landmarks: W, imgWidth: H.w, imgHeight: H.h })
|
|
@@ -10885,8 +10897,8 @@ function lr({
|
|
|
10885
10897
|
isMobile: !0,
|
|
10886
10898
|
isTryOnImage: !!r,
|
|
10887
10899
|
showLines: $,
|
|
10888
|
-
onToggleLines: qA ? void 0 : () =>
|
|
10889
|
-
onImageLoad:
|
|
10900
|
+
onToggleLines: qA ? void 0 : () => ue(!$),
|
|
10901
|
+
onImageLoad: Pe,
|
|
10890
10902
|
overlayNode: r && pA && se ? /* @__PURE__ */ A(
|
|
10891
10903
|
Fo,
|
|
10892
10904
|
{
|
|
@@ -10964,8 +10976,8 @@ function lr({
|
|
|
10964
10976
|
},
|
|
10965
10977
|
onClose: S,
|
|
10966
10978
|
showLines: $,
|
|
10967
|
-
onToggleLines: qA ? void 0 : () =>
|
|
10968
|
-
onImageLoad:
|
|
10979
|
+
onToggleLines: qA ? void 0 : () => ue(!$),
|
|
10980
|
+
onImageLoad: Pe,
|
|
10969
10981
|
overlayNode: r && pA && se ? /* @__PURE__ */ A(
|
|
10970
10982
|
Fo,
|
|
10971
10983
|
{
|
|
@@ -10993,7 +11005,7 @@ function lr({
|
|
|
10993
11005
|
/* ── Desktop section picker: split layout — image left, image cards right ── */
|
|
10994
11006
|
/* @__PURE__ */ e("div", { className: "ps-tryon-v2", children: [
|
|
10995
11007
|
/* @__PURE__ */ e("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
|
|
10996
|
-
/* @__PURE__ */ A("img", { src: v && u ? u : r || B, alt: n, className: "ps-tryon-v2-bg-img", onLoad:
|
|
11008
|
+
/* @__PURE__ */ A("img", { src: v && u ? u : r || B, alt: n, className: "ps-tryon-v2-bg-img", onLoad: Pe }),
|
|
10997
11009
|
v && /* @__PURE__ */ A(Og, { tryOnStartedAt: d ?? null, t: E }),
|
|
10998
11010
|
/* @__PURE__ */ A(zg, { active: !!v }),
|
|
10999
11011
|
r && !v && pA && se && /* @__PURE__ */ A(Fo, { lines: se, fitRows: (() => {
|
|
@@ -11008,7 +11020,7 @@ function lr({
|
|
|
11008
11020
|
}).map((N) => ({ area: N.measurement, userNum: parseFloat(N.userValue) || 0, chartLabel: N.chartRange || "", fit: N.fit }));
|
|
11009
11021
|
})(), show: $, imgWidth: H.w, imgHeight: H.h }),
|
|
11010
11022
|
r && !v && /* @__PURE__ */ e("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
11011
|
-
!qA && /* @__PURE__ */ e("button", { className: "ps-tryon-sr-glass-btn", onClick: () =>
|
|
11023
|
+
!qA && /* @__PURE__ */ e("button", { className: "ps-tryon-sr-glass-btn", onClick: () => ue(!$), children: [
|
|
11012
11024
|
/* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", style: { marginRight: "0.3vw" }, children: [
|
|
11013
11025
|
/* @__PURE__ */ A("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
11014
11026
|
/* @__PURE__ */ A("line", { x1: "4", y1: "15", x2: "20", y2: "15" }),
|
|
@@ -11148,8 +11160,8 @@ function lr({
|
|
|
11148
11160
|
allSizes: g?.allSizes,
|
|
11149
11161
|
isTryOnImage: !!r,
|
|
11150
11162
|
showLines: $,
|
|
11151
|
-
onToggleLines: qA ? void 0 : () =>
|
|
11152
|
-
onImageLoad:
|
|
11163
|
+
onToggleLines: qA ? void 0 : () => ue(!$),
|
|
11164
|
+
onImageLoad: Pe,
|
|
11153
11165
|
overlayNode: r && pA && se ? /* @__PURE__ */ A(
|
|
11154
11166
|
Fo,
|
|
11155
11167
|
{
|
|
@@ -11171,14 +11183,14 @@ function lr({
|
|
|
11171
11183
|
src: v && u ? u : r || B,
|
|
11172
11184
|
alt: n,
|
|
11173
11185
|
className: "ps-tryon-v2-bg-img",
|
|
11174
|
-
onLoad:
|
|
11186
|
+
onLoad: Pe
|
|
11175
11187
|
}
|
|
11176
11188
|
),
|
|
11177
11189
|
v && /* @__PURE__ */ A(Og, { tryOnStartedAt: d ?? null, t: E }),
|
|
11178
11190
|
/* @__PURE__ */ A(zg, { active: !!v }),
|
|
11179
11191
|
r && !v && pA && se && /* @__PURE__ */ A(Fo, { lines: se, fitRows: (g?.matchDetails || []).map((nA) => ({ area: nA.measurement, userNum: parseFloat(nA.userValue) || 0, chartLabel: nA.chartRange || "", fit: nA.fit })), show: $, imgWidth: H.w, imgHeight: H.h }),
|
|
11180
11192
|
r && !v && /* @__PURE__ */ e("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
11181
|
-
!qA && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () =>
|
|
11193
|
+
!qA && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => ue(!$), children: E($ ? "Hide Fit" : "Show Fit") }),
|
|
11182
11194
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: C, children: E("Download") })
|
|
11183
11195
|
] })
|
|
11184
11196
|
] }),
|
|
@@ -11577,7 +11589,7 @@ function lr({
|
|
|
11577
11589
|
EA && t && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children: /* @__PURE__ */ e("div", { className: "ps-tryon-sr-chart-modal", children: [
|
|
11578
11590
|
/* @__PURE__ */ e("div", { className: "ps-tryon-sr-chart-header", children: [
|
|
11579
11591
|
/* @__PURE__ */ A("h4", { children: E("Full Size Chart") }),
|
|
11580
|
-
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () =>
|
|
11592
|
+
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => Ie(!1), children: "✕" })
|
|
11581
11593
|
] }),
|
|
11582
11594
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: t.sections && Object.keys(t.sections).length > 1 ? Object.entries(t.sections).map(([m, y]) => {
|
|
11583
11595
|
const J = g?.sections?.[m]?.recommendedSize || "", _ = y.headers.findIndex((IA) => /size|taglia|größe|taille|fit|length/i.test(IA.trim())), nA = _ >= 0 ? _ : 0, ZA = y.headers[nA] || "Size";
|
|
@@ -12289,7 +12301,7 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12289
12301
|
MA(() => {
|
|
12290
12302
|
v.current && (v.current.scrollTop = 0);
|
|
12291
12303
|
}, [w, l]);
|
|
12292
|
-
const [d, W] = Q(""), [q, i] = Q("male"), [b, h] = Q("cm"), [F, z] = Q(""), [S, wA] = Q(""), [K, re] = Q(""), [yA, E] = Q(""), [iA, O] = Q(""), [hA, T] = Q(""), [tA, FA] = Q(null), [sA, kA] = Q(!1), [RA, PA] = Q(""), [UA, de] = Q(null), [uA, ie] = Q(null), [TA, fe] = Q({ w: 800, h: 1200 }), [EA,
|
|
12304
|
+
const [d, W] = Q(""), [q, i] = Q("male"), [b, h] = Q("cm"), [F, z] = Q(""), [S, wA] = Q(""), [K, re] = Q(""), [yA, E] = Q(""), [iA, O] = Q(""), [hA, T] = Q(""), [tA, FA] = Q(null), [sA, kA] = Q(!1), [RA, PA] = Q(""), [UA, de] = Q(null), [uA, ie] = Q(null), [TA, fe] = Q({ w: 800, h: 1200 }), [EA, Ie] = Q(0), [$, ue] = Q(!1), [me, ye] = Q(!1);
|
|
12293
12305
|
MA(() => {
|
|
12294
12306
|
if (C !== "calculating" || !tA) return;
|
|
12295
12307
|
let f = !1;
|
|
@@ -12301,12 +12313,12 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12301
12313
|
};
|
|
12302
12314
|
}, [C, tA]), MA(() => {
|
|
12303
12315
|
if (C !== "calculating" || !u) return;
|
|
12304
|
-
const f = setInterval(() =>
|
|
12316
|
+
const f = setInterval(() => Ie((X) => X + 1), 1500);
|
|
12305
12317
|
return () => clearInterval(f);
|
|
12306
12318
|
}, [C, u]);
|
|
12307
12319
|
const se = QA(null), ee = QA(null), [pA, WA] = Q(!1), [H, fA] = Q(null), he = () => {
|
|
12308
12320
|
H === !0 && se.current?.click();
|
|
12309
|
-
},
|
|
12321
|
+
}, Pe = async (f) => {
|
|
12310
12322
|
const X = f.target.files?.[0];
|
|
12311
12323
|
if (X) {
|
|
12312
12324
|
if (H !== !0) {
|
|
@@ -12329,8 +12341,8 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12329
12341
|
de(Ge);
|
|
12330
12342
|
return;
|
|
12331
12343
|
}
|
|
12332
|
-
const
|
|
12333
|
-
FA(
|
|
12344
|
+
const be = await xA;
|
|
12345
|
+
FA(be), de(null), B?.(be);
|
|
12334
12346
|
} catch {
|
|
12335
12347
|
T(n("Failed to process image"));
|
|
12336
12348
|
} finally {
|
|
@@ -12794,7 +12806,7 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12794
12806
|
type: "file",
|
|
12795
12807
|
accept: "image/jpeg,image/png,image/webp,image/avif",
|
|
12796
12808
|
style: { display: "none" },
|
|
12797
|
-
onChange:
|
|
12809
|
+
onChange: Pe
|
|
12798
12810
|
}
|
|
12799
12811
|
),
|
|
12800
12812
|
/* @__PURE__ */ A("div", { style: { flex: 1, display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ e(
|
|
@@ -12829,11 +12841,11 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12829
12841
|
flexDirection: "column",
|
|
12830
12842
|
alignItems: "center",
|
|
12831
12843
|
justifyContent: "center",
|
|
12832
|
-
border: tA ? "2px solid var(--ps-accent)" : H === !0 &&
|
|
12844
|
+
border: tA ? "2px solid var(--ps-accent)" : H === !0 && me ? "2px dashed var(--ps-accent)" : "2px dashed var(--ps-border-color)",
|
|
12833
12845
|
borderRadius: "0.5vw",
|
|
12834
12846
|
cursor: tA ? "default" : H === !0 ? "pointer" : "default",
|
|
12835
12847
|
position: "relative",
|
|
12836
|
-
background: tA ? "var(--ps-bg-secondary)" : H === !0 &&
|
|
12848
|
+
background: tA ? "var(--ps-bg-secondary)" : H === !0 && me ? "rgba(33,84,239,0.04)" : H === null ? "rgba(0,0,0,0.025)" : "var(--ps-bg-secondary)",
|
|
12837
12849
|
transition: "border-color 0.18s, background 0.18s",
|
|
12838
12850
|
overflow: "hidden"
|
|
12839
12851
|
},
|
|
@@ -13060,7 +13072,7 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
13060
13072
|
"button",
|
|
13061
13073
|
{
|
|
13062
13074
|
type: "button",
|
|
13063
|
-
onClick: () =>
|
|
13075
|
+
onClick: () => ue((f) => !f),
|
|
13064
13076
|
"aria-label": n("How to take a good photo"),
|
|
13065
13077
|
title: n("How to take a good photo"),
|
|
13066
13078
|
style: {
|
|
@@ -13249,7 +13261,7 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
13249
13261
|
"button",
|
|
13250
13262
|
{
|
|
13251
13263
|
type: "button",
|
|
13252
|
-
onClick: () =>
|
|
13264
|
+
onClick: () => ue(!1),
|
|
13253
13265
|
"aria-label": n("Close"),
|
|
13254
13266
|
style: { width: "1.4vw", height: "1.4vw", borderRadius: "50%", background: "transparent", border: "none", color: "var(--ps-text-muted)", cursor: "pointer", fontSize: "1vw", lineHeight: 1 },
|
|
13255
13267
|
children: "×"
|
|
@@ -13411,7 +13423,7 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
13411
13423
|
style: { position: "absolute", inset: 0, width: "100%", height: "100%", pointerEvents: "none" },
|
|
13412
13424
|
"aria-hidden": "true",
|
|
13413
13425
|
children: [
|
|
13414
|
-
CA.map(([xA, $A],
|
|
13426
|
+
CA.map(([xA, $A], be) => {
|
|
13415
13427
|
const Ge = uA[xA], $e = uA[$A];
|
|
13416
13428
|
return !Ge || !$e ? null : /* @__PURE__ */ A(
|
|
13417
13429
|
"line",
|
|
@@ -13424,14 +13436,14 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
13424
13436
|
strokeWidth: Math.max(3, TA.w / 180),
|
|
13425
13437
|
strokeLinecap: "round"
|
|
13426
13438
|
},
|
|
13427
|
-
`l-${
|
|
13439
|
+
`l-${be}`
|
|
13428
13440
|
);
|
|
13429
13441
|
}),
|
|
13430
13442
|
Object.entries(uA).map(([xA, $A]) => {
|
|
13431
|
-
const
|
|
13443
|
+
const be = $A;
|
|
13432
13444
|
return /* @__PURE__ */ e("g", { children: [
|
|
13433
|
-
/* @__PURE__ */ A("circle", { cx:
|
|
13434
|
-
/* @__PURE__ */ A("circle", { cx:
|
|
13445
|
+
/* @__PURE__ */ A("circle", { cx: be.x * TA.w, cy: be.y * TA.h, r: Math.max(7, TA.w / 75), fill: "rgba(100,210,255,0.25)" }),
|
|
13446
|
+
/* @__PURE__ */ A("circle", { cx: be.x * TA.w, cy: be.y * TA.h, r: Math.max(4, TA.w / 120), fill: "rgba(100,210,255,0.95)" })
|
|
13435
13447
|
] }, xA);
|
|
13436
13448
|
})
|
|
13437
13449
|
]
|
|
@@ -13465,9 +13477,9 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
13465
13477
|
{ key: "thighCircumference", label: n("THIGH") },
|
|
13466
13478
|
{ key: "footLengthCm", label: n("FOOT") }
|
|
13467
13479
|
].map(({ key: xA, label: $A }) => {
|
|
13468
|
-
const
|
|
13469
|
-
if (!
|
|
13470
|
-
const Ge = b === "in" ? Math.round(
|
|
13480
|
+
const be = G[xA] ?? (xA === "bust" ? G.chest : xA === "chest" ? G.bust : void 0);
|
|
13481
|
+
if (!be || be === 0) return null;
|
|
13482
|
+
const Ge = b === "in" ? Math.round(be / 2.54 * 10) / 10 : be;
|
|
13471
13483
|
return /* @__PURE__ */ e("div", { style: { background: "rgba(33,84,239,0.04)", border: "1px solid rgba(33,84,239,0.12)", borderRadius: "0.4vw", padding: "0.6vw 0.8vw" }, children: [
|
|
13472
13484
|
/* @__PURE__ */ A("div", { style: { fontSize: "0.6vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", marginBottom: "0.2vw" }, children: $A }),
|
|
13473
13485
|
/* @__PURE__ */ e("div", { style: { fontSize: "1vw", fontWeight: 600, color: "var(--ps-text-primary)" }, children: [
|
|
@@ -13487,7 +13499,7 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
13487
13499
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-back-btn", onClick: IA, children: w == null ? n("Cancel") : `← ${n("Back")}` }),
|
|
13488
13500
|
w === "manual" && !_ && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: y, children: n(Me ? "CALCULATE MY FIT" : "Continue") }),
|
|
13489
13501
|
w === "image" && C === "name-photo" && (() => {
|
|
13490
|
-
const f = b === "in" ? parseFloat(S) > 0 || parseFloat(K) > 0 : parseFloat(F) > 0, X = parseFloat(yA) > 0, CA = !!d.trim(), xA = !!tA, $A = sA,
|
|
13502
|
+
const f = b === "in" ? parseFloat(S) > 0 || parseFloat(K) > 0 : parseFloat(F) > 0, X = parseFloat(yA) > 0, CA = !!d.trim(), xA = !!tA, $A = sA, be = n($A ? "Analyzing photo…" : xA ? CA ? f ? X ? "Calculate My Body Parts" : "Enter your weight" : "Enter your height" : "Add a name for this profile" : "Upload a photo"), Ge = $A || !xA || !CA || !f || !X;
|
|
13491
13503
|
return /* @__PURE__ */ A(
|
|
13492
13504
|
"button",
|
|
13493
13505
|
{
|
|
@@ -13501,8 +13513,8 @@ function Nr({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
13501
13513
|
nA();
|
|
13502
13514
|
},
|
|
13503
13515
|
disabled: Ge,
|
|
13504
|
-
title: Ge ?
|
|
13505
|
-
children:
|
|
13516
|
+
title: Ge ? be : void 0,
|
|
13517
|
+
children: be
|
|
13506
13518
|
}
|
|
13507
13519
|
);
|
|
13508
13520
|
})(),
|
|
@@ -13952,13 +13964,13 @@ function Ai({
|
|
|
13952
13964
|
t: F
|
|
13953
13965
|
}) {
|
|
13954
13966
|
const z = parseFloat(r) || 173, S = (parseFloat(a) || 5) * 12 + (parseFloat(w) || 8), wA = Math.floor(S / 12), K = S % 12, re = parseFloat(l) || (g === "kg" ? 70 : 154), yA = parseFloat(C) || 30, E = g === "kg" ? 30 : 66, iA = g === "kg" ? 200 : 440, O = 120, hA = 220, T = 48, tA = 84, FA = 13, sA = 100, kA = (z - O) / (hA - O) * 100, RA = (S - T) / (tA - T) * 100, PA = (re - E) / (iA - E) * 100, UA = (yA - FA) / (sA - FA) * 100, de = ($) => {
|
|
13955
|
-
const
|
|
13956
|
-
n(String(Math.floor(
|
|
13967
|
+
const ue = Math.max(T, Math.min(tA, $));
|
|
13968
|
+
n(String(Math.floor(ue / 12))), s(String(ue % 12));
|
|
13957
13969
|
}, uA = () => {
|
|
13958
13970
|
o === "in" ? de(S + 1) : B(String(Math.min(hA, z + 1)));
|
|
13959
13971
|
}, ie = () => {
|
|
13960
13972
|
o === "in" ? de(S - 1) : B(String(Math.max(O, z - 1)));
|
|
13961
|
-
}, TA = () => D(String(Math.min(iA, re + 1))), fe = () => D(String(Math.max(E, re - 1))), EA = () => I(String(Math.min(sA, yA + 1))),
|
|
13973
|
+
}, TA = () => D(String(Math.min(iA, re + 1))), fe = () => D(String(Math.max(E, re - 1))), EA = () => I(String(Math.min(sA, yA + 1))), Ie = () => I(String(Math.max(FA, yA - 1)));
|
|
13962
13974
|
return /* @__PURE__ */ e("div", { className: "ps-bpm-root", children: [
|
|
13963
13975
|
/* @__PURE__ */ e("div", { className: "ps-bpm-header", children: [
|
|
13964
13976
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: F("Body Measurements") }),
|
|
@@ -14066,7 +14078,7 @@ function Ai({
|
|
|
14066
14078
|
] })
|
|
14067
14079
|
] }),
|
|
14068
14080
|
/* @__PURE__ */ e("div", { className: "ps-bpm-slider-row", children: [
|
|
14069
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick:
|
|
14081
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: Ie, "aria-label": F("Decrease"), children: /* @__PURE__ */ A(pg, {}) }),
|
|
14070
14082
|
/* @__PURE__ */ A(
|
|
14071
14083
|
"input",
|
|
14072
14084
|
{
|
|
@@ -14569,11 +14581,11 @@ function ci({
|
|
|
14569
14581
|
}) {
|
|
14570
14582
|
const b = t ? si : ii, [h, F] = Q("photo");
|
|
14571
14583
|
h === "photo" || b.indexOf(h);
|
|
14572
|
-
const z = Oo(), S = rt(B), wA = W?.height, K = W?.weight, re = W?.age, yA = W?.heightUnit === "ft" ? "in" : W?.heightUnit, E = W?.weightUnit, iA = wA != null && yA === "cm" ? String(Math.round(wA)) : wA != null && (yA === "in" || yA === "ft") ? String(Math.round(wA * 2.54)) : r.current.height || "", O = wA != null && (yA === "in" || yA === "ft") ? Math.round(wA) : wA != null && yA === "cm" ? Math.round(wA / 2.54) : null, hA = O != null ? String(Math.floor(O / 12)) : r.current.heightFeet || "", T = O != null ? String(O % 12) : r.current.heightInches || "", tA = K != null ? String(Math.round(K)) : r.current.weight || "", FA = re != null ? String(re) : r.current.age || "", [sA, kA] = Q(iA), [RA, PA] = Q(hA), [UA, de] = Q(T), [uA, ie] = Q(tA), [TA, fe] = Q(FA), [EA,
|
|
14584
|
+
const z = Oo(), S = rt(B), wA = W?.height, K = W?.weight, re = W?.age, yA = W?.heightUnit === "ft" ? "in" : W?.heightUnit, E = W?.weightUnit, iA = wA != null && yA === "cm" ? String(Math.round(wA)) : wA != null && (yA === "in" || yA === "ft") ? String(Math.round(wA * 2.54)) : r.current.height || "", O = wA != null && (yA === "in" || yA === "ft") ? Math.round(wA) : wA != null && yA === "cm" ? Math.round(wA / 2.54) : null, hA = O != null ? String(Math.floor(O / 12)) : r.current.heightFeet || "", T = O != null ? String(O % 12) : r.current.heightInches || "", tA = K != null ? String(Math.round(K)) : r.current.weight || "", FA = re != null ? String(re) : r.current.age || "", [sA, kA] = Q(iA), [RA, PA] = Q(hA), [UA, de] = Q(T), [uA, ie] = Q(tA), [TA, fe] = Q(FA), [EA, Ie] = Q(
|
|
14573
14585
|
yA || (a === "ft" ? "in" : a || (S ? "in" : "cm"))
|
|
14574
|
-
), [$,
|
|
14586
|
+
), [$, ue] = Q(
|
|
14575
14587
|
E || w || (S ? "lbs" : "kg")
|
|
14576
|
-
),
|
|
14588
|
+
), me = EA === "in" || $ === "lbs", [ye, se] = Q(null), [ee, pA] = Q(null), [WA, H] = Q(null), [fA, he] = Q(!1), [Pe, Je] = Q(""), [GA, He] = Q(null), oe = QA(null), [Z, ae] = Q(null), [x, V] = Q(!1), [KA, j] = Q(!1), [lA, zA] = Q(() => O != null ? String(Math.round(O * 2.54)) : iA), [we, VA] = Q(null), [le, LA] = Q(null), [pe, gA] = Q(null), [NA, P] = Q(null), [bA, AA] = Q(""), [Ae, De] = Q(null), [XA, Me] = Q(null), [Qe, ge] = Q(() => ["US", "UK", "AU"].includes(B) ? B === "AU" ? "UK" : B : ["FR", "ES"].includes(B) ? "FR" : ["IT"].includes(B) ? "IT" : ["JP", "CN", "KR"].includes(B) ? "JP" : "EU"), [qA, Be] = Q(!1), [Ce, m] = Q(null), y = QA(null);
|
|
14577
14589
|
MA(() => {
|
|
14578
14590
|
if (!Ce) return;
|
|
14579
14591
|
const U = (vA) => {
|
|
@@ -14756,12 +14768,12 @@ function ci({
|
|
|
14756
14768
|
const U = xA(h);
|
|
14757
14769
|
U ? F(U) : q();
|
|
14758
14770
|
}
|
|
14759
|
-
}, [h, b, q]),
|
|
14771
|
+
}, [h, b, q]), be = h === "basics" || h === "scan-details" ? !0 : h === "chest" ? !!we : h === "midsection" ? !!le : h === "seat" ? !!NA : h === "hips" ? !!pe : h === "bra" ? !!(Ae && XA) : h === "photo", Ge = h === b[b.length - 1], $e = () => {
|
|
14760
14772
|
if (EA === "in") {
|
|
14761
14773
|
const U = (parseFloat(RA) || 0) * 12 + (parseFloat(UA) || 0);
|
|
14762
14774
|
U > 0 && kA(String(Math.round(U * 2.54)));
|
|
14763
14775
|
}
|
|
14764
|
-
$ === "lbs" && uA && ie(String(Math.round(parseFloat(uA) / 2.205))),
|
|
14776
|
+
$ === "lbs" && uA && ie(String(Math.round(parseFloat(uA) / 2.205))), Ie("cm"), ue("kg"), n("cm"), s("kg"), D?.("cm");
|
|
14765
14777
|
}, Le = () => {
|
|
14766
14778
|
if (EA === "cm") {
|
|
14767
14779
|
const U = parseFloat(sA);
|
|
@@ -14770,7 +14782,7 @@ function ci({
|
|
|
14770
14782
|
PA(String(Math.floor(vA / 12))), de(String(vA % 12));
|
|
14771
14783
|
}
|
|
14772
14784
|
}
|
|
14773
|
-
$ === "kg" && uA && ie(String(Math.round(parseFloat(uA) * 2.205))),
|
|
14785
|
+
$ === "kg" && uA && ie(String(Math.round(parseFloat(uA) * 2.205))), Ie("in"), ue("lbs"), n("in"), s("lbs"), D?.("in");
|
|
14774
14786
|
};
|
|
14775
14787
|
if (h === "scan-details" && z)
|
|
14776
14788
|
return /* @__PURE__ */ e("div", { className: "ps-bp-wrapper", children: [
|
|
@@ -14802,8 +14814,8 @@ function ci({
|
|
|
14802
14814
|
/* @__PURE__ */ A("h2", { className: "ps-bp-scan-details-title", children: i("Your body details") }),
|
|
14803
14815
|
/* @__PURE__ */ A("p", { className: "ps-bp-scan-details-sub", children: i("These calibrate the AI — all required.") }),
|
|
14804
14816
|
/* @__PURE__ */ e("div", { className: "ps-bp-system-toggle", children: [
|
|
14805
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${
|
|
14806
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${
|
|
14817
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${me ? "" : " ps-bp-system-active"}`, onClick: $e, type: "button", children: i("Metric") }),
|
|
14818
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${me ? " ps-bp-system-active" : ""}`, onClick: Le, type: "button", children: i("Imperial") })
|
|
14807
14819
|
] }),
|
|
14808
14820
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-fields", children: [
|
|
14809
14821
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
@@ -14943,7 +14955,7 @@ function ci({
|
|
|
14943
14955
|
primaryLabel: i("Continue"),
|
|
14944
14956
|
compactAgeGate: !0,
|
|
14945
14957
|
photoProcessing: fA,
|
|
14946
|
-
photoStatus:
|
|
14958
|
+
photoStatus: Pe,
|
|
14947
14959
|
photoRejection: GA,
|
|
14948
14960
|
onClearRejection: () => He(null),
|
|
14949
14961
|
t: i
|
|
@@ -15059,7 +15071,7 @@ function ci({
|
|
|
15059
15071
|
children: [
|
|
15060
15072
|
fA && /* @__PURE__ */ e("div", { className: "ps-bp-photo-overlay", onClick: (BA) => BA.stopPropagation(), children: [
|
|
15061
15073
|
/* @__PURE__ */ A("div", { className: "ps-bp-photo-overlay-spinner", "aria-hidden": "true" }),
|
|
15062
|
-
/* @__PURE__ */ A("span", { className: "ps-bp-photo-overlay-label", children:
|
|
15074
|
+
/* @__PURE__ */ A("span", { className: "ps-bp-photo-overlay-label", children: Pe || i("Analyzing photo…") })
|
|
15063
15075
|
] }),
|
|
15064
15076
|
ee ? /* @__PURE__ */ e(oA, { children: [
|
|
15065
15077
|
/* @__PURE__ */ A("img", { src: ee, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
@@ -15321,8 +15333,8 @@ function ci({
|
|
|
15321
15333
|
/* @__PURE__ */ A("p", { style: { margin: "0.2vw 0 0", fontSize: "0.65vw", color: "var(--ps-text-muted)" }, children: i("These calibrate the AI — all required.") })
|
|
15322
15334
|
] }),
|
|
15323
15335
|
/* @__PURE__ */ e("div", { className: "ps-bp-system-toggle", style: { alignSelf: "center", marginTop: "1.2vw" }, children: [
|
|
15324
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${
|
|
15325
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${
|
|
15336
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${me ? "" : " ps-bp-system-active"}`, onClick: $e, type: "button", children: i("Metric") }),
|
|
15337
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${me ? " ps-bp-system-active" : ""}`, onClick: Le, type: "button", children: i("Imperial") })
|
|
15326
15338
|
] }),
|
|
15327
15339
|
/* @__PURE__ */ A("div", { style: { marginTop: "auto", marginBottom: "auto" }, children: /* @__PURE__ */ e("div", { className: "ps-bp-inline-fields", children: [
|
|
15328
15340
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
@@ -15557,20 +15569,20 @@ function ci({
|
|
|
15557
15569
|
const HA = (parseFloat(RA) || 5) * 12 + (parseFloat(UA) || 8);
|
|
15558
15570
|
kA(String(Math.round(HA * 2.54)));
|
|
15559
15571
|
}
|
|
15560
|
-
$ === "lbs" && uA && ie(String(Math.round(parseFloat(uA) / 2.205))),
|
|
15572
|
+
$ === "lbs" && uA && ie(String(Math.round(parseFloat(uA) / 2.205))), Ie("cm"), ue("kg"), n("cm"), s("kg"), D?.("cm");
|
|
15561
15573
|
}, vA = () => {
|
|
15562
15574
|
if (EA === "cm") {
|
|
15563
15575
|
const HA = parseFloat(sA) || 173, Ee = Math.round(HA / 2.54);
|
|
15564
15576
|
PA(String(Math.floor(Ee / 12))), de(String(Ee % 12));
|
|
15565
15577
|
}
|
|
15566
|
-
$ === "kg" && uA && ie(String(Math.round(parseFloat(uA) * 2.205))),
|
|
15578
|
+
$ === "kg" && uA && ie(String(Math.round(parseFloat(uA) * 2.205))), Ie("in"), ue("lbs"), n("in"), s("lbs"), D?.("in");
|
|
15567
15579
|
};
|
|
15568
15580
|
return z ? /* @__PURE__ */ A(
|
|
15569
15581
|
Ai,
|
|
15570
15582
|
{
|
|
15571
15583
|
hUnit: EA,
|
|
15572
15584
|
wUnit: $,
|
|
15573
|
-
isImperialMode:
|
|
15585
|
+
isImperialMode: me,
|
|
15574
15586
|
height: sA,
|
|
15575
15587
|
setHeight: kA,
|
|
15576
15588
|
heightFeet: RA,
|
|
@@ -15607,8 +15619,8 @@ function ci({
|
|
|
15607
15619
|
] })
|
|
15608
15620
|
] }),
|
|
15609
15621
|
/* @__PURE__ */ e("div", { className: "ps-bp-system-toggle", children: [
|
|
15610
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${
|
|
15611
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${
|
|
15622
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${me ? "" : " ps-bp-system-active"}`, onClick: U, type: "button", children: i("Metric") }),
|
|
15623
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${me ? " ps-bp-system-active" : ""}`, onClick: vA, type: "button", children: i("Imperial") })
|
|
15612
15624
|
] }),
|
|
15613
15625
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-fields", children: [
|
|
15614
15626
|
/* @__PURE__ */ e("div", { className: "ps-bp-inline-row", children: [
|
|
@@ -15854,9 +15866,9 @@ function ci({
|
|
|
15854
15866
|
/* @__PURE__ */ A(
|
|
15855
15867
|
"button",
|
|
15856
15868
|
{
|
|
15857
|
-
className: `ps-bp-next-btn${!U && !
|
|
15869
|
+
className: `ps-bp-next-btn${!U && !be ? " ps-bp-btn-disabled" : ""}`,
|
|
15858
15870
|
onClick: vA,
|
|
15859
|
-
disabled: !U && !
|
|
15871
|
+
disabled: !U && !be,
|
|
15860
15872
|
type: "button",
|
|
15861
15873
|
children: Ee
|
|
15862
15874
|
}
|
|
@@ -15904,7 +15916,7 @@ function ug({
|
|
|
15904
15916
|
const he = URL.createObjectURL(fA);
|
|
15905
15917
|
E(fA), re(he), FA(!0), kA("Analyzing photo…");
|
|
15906
15918
|
try {
|
|
15907
|
-
const
|
|
15919
|
+
const Pe = Y && v ? Ag(fA, Y, v) : Promise.resolve({ isAdult: !0, confidence: "low" }), Je = Do(fA, W ? { maxDimension: 1536, quality: 0.85 } : {}), GA = await Pe;
|
|
15908
15920
|
if (!GA.isAdult) {
|
|
15909
15921
|
const oe = GA.reasoning?.trim() || d("This photo appears to be of a minor. Please upload a photo of someone 18 or older.");
|
|
15910
15922
|
PA(oe), E(null), re(null);
|
|
@@ -15920,7 +15932,7 @@ function ug({
|
|
|
15920
15932
|
K && URL.revokeObjectURL(K), E(null), re(null), O(null);
|
|
15921
15933
|
}, [K]), EA = (H, fA) => {
|
|
15922
15934
|
F((he) => ({ ...he, [H]: fA })), S("");
|
|
15923
|
-
},
|
|
15935
|
+
}, Ie = () => {
|
|
15924
15936
|
const H = g[0];
|
|
15925
15937
|
if (!H) return;
|
|
15926
15938
|
const fA = parseFloat(h[H.key] || "");
|
|
@@ -15929,8 +15941,8 @@ function ug({
|
|
|
15929
15941
|
return;
|
|
15930
15942
|
}
|
|
15931
15943
|
g.forEach((he) => {
|
|
15932
|
-
const
|
|
15933
|
-
|
|
15944
|
+
const Pe = parseFloat(h[he.key] || "");
|
|
15945
|
+
Pe > 0 && (w.current[he.key] = String(Pe));
|
|
15934
15946
|
}), w.current.gender = w.current.gender || "male", D("exact"), C(!0), I("size-result"), u("exact");
|
|
15935
15947
|
}, $ = () => {
|
|
15936
15948
|
if (UA !== !0) {
|
|
@@ -15950,7 +15962,7 @@ function ug({
|
|
|
15950
15962
|
weightUnit: "kg",
|
|
15951
15963
|
gender: w.current.gender || "male"
|
|
15952
15964
|
});
|
|
15953
|
-
},
|
|
15965
|
+
}, ue = t.find((H) => H.value === s)?.label || t[0].label;
|
|
15954
15966
|
if (q && i === "photo")
|
|
15955
15967
|
return /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
15956
15968
|
vt,
|
|
@@ -15999,7 +16011,7 @@ function ug({
|
|
|
15999
16011
|
max: H.max
|
|
16000
16012
|
}
|
|
16001
16013
|
),
|
|
16002
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-unit", children:
|
|
16014
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-unit", children: ue.toLowerCase() })
|
|
16003
16015
|
] })
|
|
16004
16016
|
] }, H.key)),
|
|
16005
16017
|
z && /* @__PURE__ */ A("p", { className: "ps-acc-error", style: { paddingTop: 8 }, children: z })
|
|
@@ -16014,7 +16026,7 @@ function ug({
|
|
|
16014
16026
|
] })
|
|
16015
16027
|
] }),
|
|
16016
16028
|
/* @__PURE__ */ e("div", { className: "ps-bpm-bottom", children: [
|
|
16017
|
-
/* @__PURE__ */ e("button", { type: "button", className: "ps-bpm-next-btn", onClick:
|
|
16029
|
+
/* @__PURE__ */ e("button", { type: "button", className: "ps-bpm-next-btn", onClick: Ie, children: [
|
|
16018
16030
|
d("Find My Size"),
|
|
16019
16031
|
Xe(s) ? ` (${Xe(s)})` : "",
|
|
16020
16032
|
" ",
|
|
@@ -16032,7 +16044,7 @@ function ug({
|
|
|
16032
16044
|
)
|
|
16033
16045
|
] })
|
|
16034
16046
|
] }) });
|
|
16035
|
-
const
|
|
16047
|
+
const me = g.some((H) => (parseFloat(h[H.key] || "") || 0) > 0), ye = !!yA && UA === !0 && !tA, ee = tA || !ye && !me, pA = tA ? d("Analyzing photo…") : ye ? d("Analyze") : `${d("Find My Size")}${Xe(s) ? ` (${Xe(s)})` : ""}`, WA = ye ? $ : Ie;
|
|
16036
16048
|
return i !== "photo" || B ? /* @__PURE__ */ e("div", { className: "ps-bp-layout", children: [
|
|
16037
16049
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", style: { position: "relative" }, children: /* @__PURE__ */ A("img", { src: a, alt: n, className: "ps-bp-image-img" }) }),
|
|
16038
16050
|
/* @__PURE__ */ A("div", { className: "ps-bp-root", children: /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
@@ -16063,7 +16075,7 @@ function ug({
|
|
|
16063
16075
|
max: H.max
|
|
16064
16076
|
}
|
|
16065
16077
|
),
|
|
16066
|
-
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children:
|
|
16078
|
+
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: ue.toLowerCase() })
|
|
16067
16079
|
] })
|
|
16068
16080
|
] }, H.key)) }),
|
|
16069
16081
|
z && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: z }),
|
|
@@ -16074,7 +16086,7 @@ function ug({
|
|
|
16074
16086
|
] }),
|
|
16075
16087
|
/* @__PURE__ */ e("div", { className: "ps-bp-nav", style: { marginTop: "auto" }, children: [
|
|
16076
16088
|
/* @__PURE__ */ A("div", {}),
|
|
16077
|
-
/* @__PURE__ */ e("button", { className: "ps-bp-next-btn", onClick:
|
|
16089
|
+
/* @__PURE__ */ e("button", { className: "ps-bp-next-btn", onClick: Ie, type: "button", children: [
|
|
16078
16090
|
d("Find My Size"),
|
|
16079
16091
|
Xe(s) ? ` (${Xe(s)})` : "",
|
|
16080
16092
|
" ",
|
|
@@ -16421,7 +16433,7 @@ function ug({
|
|
|
16421
16433
|
max: H.max
|
|
16422
16434
|
}
|
|
16423
16435
|
),
|
|
16424
|
-
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children:
|
|
16436
|
+
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: ue.toLowerCase() })
|
|
16425
16437
|
] })
|
|
16426
16438
|
] }, H.key)) })
|
|
16427
16439
|
] })
|
|
@@ -16765,28 +16777,28 @@ function Ii({
|
|
|
16765
16777
|
MA(() => {
|
|
16766
16778
|
E(!0);
|
|
16767
16779
|
}, []);
|
|
16768
|
-
const [iA, O] = Q("idle"), [hA, T] = Q(null), [tA, FA] = Q(null), [sA, kA] = Q(null), [RA, PA] = Q(null), [UA, de] = Q(!1), [uA, ie] = Q(null), [TA, fe] = Q(null), [EA,
|
|
16780
|
+
const [iA, O] = Q("idle"), [hA, T] = Q(null), [tA, FA] = Q(null), [sA, kA] = Q(null), [RA, PA] = Q(null), [UA, de] = Q(!1), [uA, ie] = Q(null), [TA, fe] = Q(null), [EA, Ie] = Q({}), $ = QA({});
|
|
16769
16781
|
MA(() => {
|
|
16770
16782
|
$.current = EA;
|
|
16771
16783
|
}, [EA]);
|
|
16772
|
-
const
|
|
16784
|
+
const ue = QA(null), me = QA(null), ye = QA(null);
|
|
16773
16785
|
mA((c, p) => {
|
|
16774
|
-
|
|
16786
|
+
Ie((L) => {
|
|
16775
16787
|
const eA = { ...L };
|
|
16776
16788
|
return p === null ? delete eA[c] : eA[c] = { ...p, sectionName: c }, $.current = eA, eA;
|
|
16777
16789
|
});
|
|
16778
16790
|
}, []);
|
|
16779
|
-
const [se, ee] = Q(null), [pA, WA] = Q(null), [H, fA] = Q(!1), [he,
|
|
16791
|
+
const [se, ee] = Q(null), [pA, WA] = Q(null), [H, fA] = Q(!1), [he, Pe] = Q(!1);
|
|
16780
16792
|
MA(() => {
|
|
16781
16793
|
pA?.recommendedSize && (console.log("[ps-sdk:reset] new sizingResult — clearing all section overrides", {
|
|
16782
16794
|
recommendedSize: pA.recommendedSize
|
|
16783
|
-
}),
|
|
16795
|
+
}), Ie({}));
|
|
16784
16796
|
}, [pA?.recommendedSize]);
|
|
16785
16797
|
const [Je, GA] = Q(!1), [He, oe] = Q(!1), [Z, ae] = Q(null), x = QA(!1);
|
|
16786
16798
|
MA(() => {
|
|
16787
|
-
|
|
16799
|
+
ue.current = pA;
|
|
16788
16800
|
}, [pA]), MA(() => {
|
|
16789
|
-
|
|
16801
|
+
me.current = Z;
|
|
16790
16802
|
}, [Z]), MA(() => {
|
|
16791
16803
|
ye.current = sA;
|
|
16792
16804
|
}, [sA]);
|
|
@@ -16797,9 +16809,9 @@ function Ii({
|
|
|
16797
16809
|
}, [r]);
|
|
16798
16810
|
const P = QA({}), [bA, AA] = Q("male"), [Ae, De] = Q(0), [XA, Me] = Q(null), [Qe, ge] = Q(!1), [qA, Be] = Q(() => Ue("profiles", [])), [Ce, m] = Q(() => Ue("history", [])), [y, N] = Q(() => ot()), [J, _] = Q(() => /* @__PURE__ */ new Set()), [nA, ZA] = Q(null), IA = mA((c) => {
|
|
16799
16811
|
N(c), hn(c);
|
|
16800
|
-
}, []), [ce, ve] = Q(!1), [YA, f] = Q(null), [X, CA] = Q(null), xA = QA(null), $A = QA(() => !1),
|
|
16812
|
+
}, []), [ce, ve] = Q(!1), [YA, f] = Q(null), [X, CA] = Q(null), xA = QA(null), $A = QA(() => !1), be = QA(() => {
|
|
16801
16813
|
}), Ge = mA((c, p) => {
|
|
16802
|
-
$A.current = c,
|
|
16814
|
+
$A.current = c, be.current = p;
|
|
16803
16815
|
}, []), $e = QA(null), Le = QA(null), U = QA(null), vA = QA(null), HA = QA(null), Ee = QA(!1), _e = QA(null), Ne = QA(null), [BA, Ke] = Q(null), [zo, No] = Q(null), We = QA(null), Uo = QA(null), Jo = QA(!1), fo = QA(null);
|
|
16804
16816
|
MA(() => {
|
|
16805
16817
|
try {
|
|
@@ -17023,7 +17035,7 @@ function Ii({
|
|
|
17023
17035
|
}), bt = mA(() => {
|
|
17024
17036
|
console.log("[ps-sdk] handleOpen fired — opening modal"), O("body-profile"), d?.();
|
|
17025
17037
|
}, [d]), ro = mA(() => {
|
|
17026
|
-
O("idle"), T(null), f(null), CA(null), tA && URL.revokeObjectURL(tA), FA(null), kA(null), PA(null), ee(null), WA(null), fA(!1), Me(null), ge(!1),
|
|
17038
|
+
O("idle"), T(null), f(null), CA(null), tA && URL.revokeObjectURL(tA), FA(null), kA(null), PA(null), ee(null), WA(null), fA(!1), Me(null), ge(!1), Pe(!1), ve(!1), P.current = {}, AA("male"), io.current = !1, vA.current?.(), vA.current = null, HA.current && (clearInterval(HA.current), HA.current = null), W?.();
|
|
17027
17039
|
}, [W, tA]), xt = mA(() => {
|
|
17028
17040
|
if (YA) {
|
|
17029
17041
|
f(null), xA.current && (O(xA.current), xA.current = null);
|
|
@@ -17054,7 +17066,7 @@ function Ii({
|
|
|
17054
17066
|
break;
|
|
17055
17067
|
case "profiles":
|
|
17056
17068
|
if ($A.current()) {
|
|
17057
|
-
|
|
17069
|
+
be.current();
|
|
17058
17070
|
break;
|
|
17059
17071
|
}
|
|
17060
17072
|
O(xA.current || "body-profile"), xA.current = null;
|
|
@@ -17700,7 +17712,7 @@ function Ii({
|
|
|
17700
17712
|
selectedLength: L.selectedLength,
|
|
17701
17713
|
displayLabel: L.displayLabel
|
|
17702
17714
|
};
|
|
17703
|
-
|
|
17715
|
+
Ie(p), $.current = p;
|
|
17704
17716
|
}
|
|
17705
17717
|
fA(!1), oe(!1), ie(null), fe(null), f(null), O("size-result");
|
|
17706
17718
|
}, []), Gt = mA((c, p) => {
|
|
@@ -17804,7 +17816,7 @@ function Ii({
|
|
|
17804
17816
|
IA(null), P.current = {};
|
|
17805
17817
|
},
|
|
17806
17818
|
onComplete: (k) => {
|
|
17807
|
-
P.current.gender = k.gender, k.bandSize && (P.current.bandSize = k.bandSize), k.cupSize && (P.current.cupSize = k.cupSize),
|
|
17819
|
+
P.current.gender = k.gender, k.bandSize && (P.current.bandSize = k.bandSize), k.cupSize && (P.current.cupSize = k.cupSize), Pe(!!k.bodyImage), Mt(
|
|
17808
17820
|
k.height,
|
|
17809
17821
|
k.weight,
|
|
17810
17822
|
k.heightUnit,
|
|
@@ -17819,7 +17831,7 @@ function Ii({
|
|
|
17819
17831
|
);
|
|
17820
17832
|
},
|
|
17821
17833
|
onSnapSubmit: (k) => {
|
|
17822
|
-
|
|
17834
|
+
Pe(!0), sg(k);
|
|
17823
17835
|
},
|
|
17824
17836
|
onBack: ro,
|
|
17825
17837
|
t: K
|