@primestyleai/tryon 5.10.13 → 5.10.14
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 +492 -483
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +9 -0
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { P as an, L as _P, b as Qg, a as AP, c as Hg, A as zg, S as cg, i as pg } from "../index-DcgOUANg.js";
|
|
3
3
|
import { jsxs as P, jsx as A, Fragment as tA } from "react/jsx-runtime";
|
|
4
|
-
import { useState as j, useRef as iA, useCallback as
|
|
4
|
+
import { useState as j, useRef as iA, useCallback as UA, useEffect as JA, useMemo as wf } from "react";
|
|
5
5
|
import { createPortal as lP } from "react-dom";
|
|
6
6
|
const sP = 11, TP = 12, An = 13, fn = 14, Pn = 15, nn = 16, GP = 23, YP = 24, gn = 25, Bn = 26, en = 27, on = 28, wn = 0;
|
|
7
7
|
let HP = null, BP = null;
|
|
@@ -31,10 +31,10 @@ async function rP(f) {
|
|
|
31
31
|
const n = await Fn(f), g = HP.detect(n);
|
|
32
32
|
if (!g?.landmarks?.length || g.landmarks[0].length < 25)
|
|
33
33
|
return null;
|
|
34
|
-
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], i = e[YP], o = (B.y + C.y) / 2, r = (D.y + i.y) / 2, z = r - o, p = o + z * 0.28, T = Math.abs(C.x - B.x), F = Math.min(B.x, C.x) - T * 0.05, h = Math.max(B.x, C.x) + T * 0.05, W = Math.abs(i.x - D.x), t = Math.min(D.x, i.x) - W * 0.15, k = Math.max(D.x, i.x) + W * 0.15, u = p + (r - p) * 0.55, v = T * 0.85, I = (B.x + C.x + D.x + i.x) / 4, O = I - v / 2,
|
|
34
|
+
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], i = e[YP], o = (B.y + C.y) / 2, r = (D.y + i.y) / 2, z = r - o, p = o + z * 0.28, T = Math.abs(C.x - B.x), F = Math.min(B.x, C.x) - T * 0.05, h = Math.max(B.x, C.x) + T * 0.05, W = Math.abs(i.x - D.x), t = Math.min(D.x, i.x) - W * 0.15, k = Math.max(D.x, i.x) + W * 0.15, u = p + (r - p) * 0.55, v = T * 0.85, I = (B.x + C.x + D.x + i.x) / 4, O = I - v / 2, N = I + v / 2;
|
|
35
35
|
return {
|
|
36
36
|
chest: { y: p, x1: F, x2: h },
|
|
37
|
-
waist: { y: u, x1: O, x2:
|
|
37
|
+
waist: { y: u, x1: O, x2: N },
|
|
38
38
|
hips: { y: r, x1: t, x2: k }
|
|
39
39
|
};
|
|
40
40
|
} catch (n) {
|
|
@@ -166,7 +166,7 @@ function ag(f, n, g) {
|
|
|
166
166
|
const i = C > 0 ? vn / C : 0, o = (K, E) => Math.hypot(
|
|
167
167
|
(K.x - E.x) * n,
|
|
168
168
|
(K.y - E.y) * g
|
|
169
|
-
) * i, r = o(f.leftIrisCenter, f.rightIrisCenter), p = o(f.leftInnerEye, f.rightInnerEye) / 1.6, T = o(f.leftTragus, f.rightTragus), F = o(f.leftTragus, f.leftOuterEye), h = o(f.rightTragus, f.rightOuterEye), W = (F + h) / 2, t = T * 1.07, u = Math.abs((f.forehead.z ?? 0) - (f.chin.z ?? 0)) * n * i, v = Math.max(170, Math.min(210, u || 190)), I = t / 2, O = v / 2,
|
|
169
|
+
) * i, r = o(f.leftIrisCenter, f.rightIrisCenter), p = o(f.leftInnerEye, f.rightInnerEye) / 1.6, T = o(f.leftTragus, f.rightTragus), F = o(f.leftTragus, f.leftOuterEye), h = o(f.rightTragus, f.rightOuterEye), W = (F + h) / 2, t = T * 1.07, u = Math.abs((f.forehead.z ?? 0) - (f.chin.z ?? 0)) * n * i, v = Math.max(170, Math.min(210, u || 190)), I = t / 2, O = v / 2, N = Math.PI * Math.sqrt(2 * (I * I + O * O));
|
|
170
170
|
return {
|
|
171
171
|
measurements: {
|
|
172
172
|
irisDiameter: vn,
|
|
@@ -178,7 +178,7 @@ function ag(f, n, g) {
|
|
|
178
178
|
templeLength: Rf(W),
|
|
179
179
|
headWidth: Rf(t),
|
|
180
180
|
headDepth: Rf(v),
|
|
181
|
-
headCircumference: Rf(
|
|
181
|
+
headCircumference: Rf(N)
|
|
182
182
|
},
|
|
183
183
|
irisConfidence: D
|
|
184
184
|
};
|
|
@@ -6786,7 +6786,7 @@ function $g({ view: f, stepIndex: n }) {
|
|
|
6786
6786
|
return f === "error" || f === "idle" ? null : /* @__PURE__ */ A("div", { className: "ps-tryon-dots", children: Array.from({ length: sg }, (g, e) => e + 1).map((g) => /* @__PURE__ */ A("div", { className: `ps-tryon-dot${g < n ? " ps-done" : g === n ? " ps-active" : ""}` }, g)) });
|
|
6787
6787
|
}
|
|
6788
6788
|
function _g({ activeLocale: f, onSelect: n }) {
|
|
6789
|
-
const [g, e] = j(!1), B = iA(null), C = iA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English", r =
|
|
6789
|
+
const [g, e] = j(!1), B = iA(null), C = iA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English", r = UA(() => {
|
|
6790
6790
|
if (!B.current) return;
|
|
6791
6791
|
const z = B.current.getBoundingClientRect();
|
|
6792
6792
|
i({ top: z.bottom + 4, right: window.innerWidth - z.right });
|
|
@@ -7248,16 +7248,16 @@ function eB({
|
|
|
7248
7248
|
/* @__PURE__ */ A("h3", { className: "ps-bp-title", style: { fontSize: "1.1vw" }, children: t("Here's what we estimated") }),
|
|
7249
7249
|
/* @__PURE__ */ A("p", { className: "ps-bp-subtitle", children: t("Tap any value to adjust if needed") }),
|
|
7250
7250
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sf-fields", style: { flex: 1, overflowY: "auto" }, children: v.map((O) => {
|
|
7251
|
-
const
|
|
7251
|
+
const N = g[O.key], K = C.current[O.key] ? parseFloat(C.current[O.key]) : null, E = N || K;
|
|
7252
7252
|
if (!E) return null;
|
|
7253
|
-
const
|
|
7253
|
+
const BA = !N && !!K;
|
|
7254
7254
|
return C.current[O.key] || (C.current[O.key] = String(E)), /* @__PURE__ */ A("div", { className: "ps-tryon-sf-float-row", children: /* @__PURE__ */ P("div", { className: "ps-tryon-sf-float-field", children: [
|
|
7255
7255
|
/* @__PURE__ */ P("label", { className: "ps-tryon-sf-float-label", children: [
|
|
7256
7256
|
t(O.label),
|
|
7257
7257
|
" (",
|
|
7258
7258
|
k,
|
|
7259
7259
|
") ",
|
|
7260
|
-
|
|
7260
|
+
BA ? /* @__PURE__ */ A("span", { className: "ps-tryon-sf-entered-badge", children: t("ENTERED") }) : /* @__PURE__ */ A("span", { className: "ps-tryon-sf-estimated-badge", children: t("ESTIMATED") })
|
|
7261
7261
|
] }),
|
|
7262
7262
|
/* @__PURE__ */ A(
|
|
7263
7263
|
"input",
|
|
@@ -7548,8 +7548,8 @@ function HB({
|
|
|
7548
7548
|
if (I.length > 0) {
|
|
7549
7549
|
const O = I.filter(
|
|
7550
7550
|
(K) => K.fit === "good" || K.fit === "a-bit-tight" || K.fit === "a-bit-loose"
|
|
7551
|
-
).length,
|
|
7552
|
-
return Math.max(70,
|
|
7551
|
+
).length, N = Math.round(O / I.length * 100);
|
|
7552
|
+
return Math.max(70, N);
|
|
7553
7553
|
}
|
|
7554
7554
|
return g?.confidence === "high" ? 96 : g?.confidence === "medium" ? 84 : 72;
|
|
7555
7555
|
}, [g]), u = o || f, v = !!o;
|
|
@@ -7612,7 +7612,7 @@ function HB({
|
|
|
7612
7612
|
/* @__PURE__ */ A("span", { className: "ps-msr-match-label", children: t("FIT MATCH") })
|
|
7613
7613
|
] }) }),
|
|
7614
7614
|
/* @__PURE__ */ A("div", { className: "ps-msr-sections", children: B.map(({ name: I, secResult: O }) => {
|
|
7615
|
-
const
|
|
7615
|
+
const N = I.replace(/\s*[—–-]\s*.*/g, ""), K = O, E = K.found === !1 ? t("No fit") : K.size || O.recommendedSize;
|
|
7616
7616
|
return /* @__PURE__ */ P(
|
|
7617
7617
|
"button",
|
|
7618
7618
|
{
|
|
@@ -7620,7 +7620,7 @@ function HB({
|
|
|
7620
7620
|
className: "ps-msr-section-card",
|
|
7621
7621
|
onClick: () => C(I),
|
|
7622
7622
|
children: [
|
|
7623
|
-
/* @__PURE__ */ A("span", { className: "ps-msr-section-name", children:
|
|
7623
|
+
/* @__PURE__ */ A("span", { className: "ps-msr-section-name", children: N.toUpperCase() }),
|
|
7624
7624
|
/* @__PURE__ */ A("span", { className: "ps-msr-section-size", children: E })
|
|
7625
7625
|
]
|
|
7626
7626
|
},
|
|
@@ -7920,15 +7920,15 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7920
7920
|
], i = e, o = B, r = Math.max(i, o) / 500, z = Math.max(5, 3 * r), p = Math.max(7, 5 * r);
|
|
7921
7921
|
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${i} ${o}`, preserveAspectRatio: "xMidYMid meet", children: D.map(({ key: T, line: F, label: h }, W) => {
|
|
7922
7922
|
if (!F || typeof F.x1 != "number" || typeof F.x2 != "number" || typeof F.y != "number") return null;
|
|
7923
|
-
const t = F.x1 * i, k = F.x2 * i, u = F.y * o, v = k - t, I = v * 0.06, O = (t + k) / 2,
|
|
7923
|
+
const t = F.x1 * i, k = F.x2 * i, u = F.y * o, v = k - t, I = v * 0.06, O = (t + k) / 2, N = n.find((mA) => {
|
|
7924
7924
|
const dA = mA.area.toLowerCase().trim();
|
|
7925
7925
|
return !!(dA === T || T === "chest" && (dA.includes("bust") || dA.includes("chest")) || T === "waist" && dA.includes("waist") || T === "hips" && (dA.includes("hip") || dA === "hips"));
|
|
7926
|
-
}), K =
|
|
7926
|
+
}), K = N ? C(N.fit) : "#2154EF", E = W * 0.35, BA = `M ${t} ${u} Q ${O} ${u + I} ${k} ${u}`, c = v * 1.05, hA = N ? N.fit === "good" ? "✓ Fit" : N.isLength ? N.fit.includes("short") || N.fit.includes("tight") ? "Short" : "Long" : N.fit.includes("tight") ? "Tight" : "Loose" : h, l = Math.round(14 * r), y = hA.length * l * 0.62, sA = i - k - 12 * r < y, V = sA ? t - 10 * r : k + 10 * r, s = sA ? "end" : "start", PA = sA ? t : k, RA = sA ? t - 6 * r : k + 6 * r;
|
|
7927
7927
|
return /* @__PURE__ */ P("g", { children: [
|
|
7928
7928
|
/* @__PURE__ */ A(
|
|
7929
7929
|
"path",
|
|
7930
7930
|
{
|
|
7931
|
-
d:
|
|
7931
|
+
d: BA,
|
|
7932
7932
|
fill: "none",
|
|
7933
7933
|
stroke: K,
|
|
7934
7934
|
strokeWidth: z,
|
|
@@ -8053,61 +8053,61 @@ function DP({
|
|
|
8053
8053
|
backLabel: v,
|
|
8054
8054
|
internationalSizes: I,
|
|
8055
8055
|
continueLabel: O,
|
|
8056
|
-
renderRaw:
|
|
8056
|
+
renderRaw: N = !1,
|
|
8057
8057
|
sectionFound: K
|
|
8058
8058
|
}) {
|
|
8059
|
-
const E = g?.recommendedSize || "", [
|
|
8059
|
+
const E = g?.recommendedSize || "", [BA, c] = j(null), hA = B.toLowerCase(), l = hA.includes("mm") ? "mm" : hA.includes("cm") ? "cm" : "in", y = C || l, XA = (a) => hn(a, y, l), sA = (a) => UB(a, y, l), V = I ? Object.keys(I) : [], [s, PA] = j(null), RA = D?.secResult?.recommendedSize || "", [mA, dA] = j(null), ZA = wf(() => {
|
|
8060
8060
|
if (!D) return [];
|
|
8061
|
-
const a = D.section, X = a.headers.findIndex((
|
|
8061
|
+
const a = D.section, X = a.headers.findIndex((zA) => /size|taglia|größe|taille/i.test(zA.trim())), nA = X >= 0 ? X : 0, H = a.headers[nA] || "Size", oA = a.rows.map((zA) => Uf(zA, nA, H)).filter(Boolean);
|
|
8062
8062
|
return [...new Set(oA)];
|
|
8063
8063
|
}, [D]), Hf = wf(() => {
|
|
8064
8064
|
if (!D) return {};
|
|
8065
8065
|
const a = D.section, X = a.headers.findIndex((oA) => /size|taglia|größe|taille/i.test(oA.trim()));
|
|
8066
8066
|
if (X < 0) return {};
|
|
8067
|
-
let
|
|
8068
|
-
if (
|
|
8067
|
+
let nA = a.headers.findIndex((oA) => /height|altezza|hauteur|größe|tall/i.test(oA.trim()) && !/size/i.test(oA));
|
|
8068
|
+
if (nA < 0 && (nA = a.headers.findIndex((oA, zA) => zA !== X)), nA < 0) return {};
|
|
8069
8069
|
const H = {};
|
|
8070
8070
|
for (const oA of a.rows) {
|
|
8071
|
-
const
|
|
8072
|
-
|
|
8071
|
+
const zA = Uf(oA, X, a.headers[X] || "Size"), YA = Uf(oA, nA, a.headers[nA] || "");
|
|
8072
|
+
zA && YA && (H[String(zA).trim()] = String(YA).trim());
|
|
8073
8073
|
}
|
|
8074
8074
|
return H;
|
|
8075
|
-
}, [D]),
|
|
8075
|
+
}, [D]), m = wf(() => {
|
|
8076
8076
|
const a = n.headers.findIndex((X) => /size|taglia|größe|taille/i.test(X.trim()));
|
|
8077
8077
|
if (a >= 0) return a;
|
|
8078
8078
|
for (let X = 0; X < n.headers.length; X++) {
|
|
8079
|
-
const
|
|
8080
|
-
if (n.rows.some((H) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Uf(H, X,
|
|
8079
|
+
const nA = n.headers[X];
|
|
8080
|
+
if (n.rows.some((H) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Uf(H, X, nA)))) return X;
|
|
8081
8081
|
}
|
|
8082
8082
|
return 0;
|
|
8083
|
-
}, [n]),
|
|
8084
|
-
const a = n.rows.map((X) => Uf(X,
|
|
8083
|
+
}, [n]), EA = n.headers[m] || "Size", TA = wf(() => {
|
|
8084
|
+
const a = n.rows.map((X) => Uf(X, m, EA)).filter(Boolean);
|
|
8085
8085
|
return [...new Set(a)];
|
|
8086
|
-
}, [n,
|
|
8086
|
+
}, [n, m, EA]), bA = BA || E, VA = bA === E, kA = wf(() => {
|
|
8087
8087
|
if (VA) return null;
|
|
8088
|
-
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i,
|
|
8089
|
-
return o(
|
|
8090
|
-
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] :
|
|
8088
|
+
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i, nA = a.some((H) => X.test(H.fit || ""));
|
|
8089
|
+
return o(nA ? "Not Recommended" : "Your Selection");
|
|
8090
|
+
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA = wf(() => {
|
|
8091
8091
|
const a = [];
|
|
8092
8092
|
for (let X = 0; X < n.headers.length; X++) {
|
|
8093
|
-
const
|
|
8094
|
-
if (/\(cm\)|centimeter/i.test(
|
|
8093
|
+
const nA = (n.headers[X] || "").toLowerCase();
|
|
8094
|
+
if (/\(cm\)|centimeter/i.test(nA)) {
|
|
8095
8095
|
a.push("cm");
|
|
8096
8096
|
continue;
|
|
8097
8097
|
}
|
|
8098
|
-
if (/\(in\)|\(inch|inch/i.test(
|
|
8098
|
+
if (/\(in\)|\(inch|inch/i.test(nA)) {
|
|
8099
8099
|
a.push("in");
|
|
8100
8100
|
continue;
|
|
8101
8101
|
}
|
|
8102
8102
|
let H = null;
|
|
8103
8103
|
for (const oA of n.rows) {
|
|
8104
|
-
const
|
|
8105
|
-
if (
|
|
8106
|
-
if (/cm\b|centimeter/i.test(
|
|
8104
|
+
const zA = String(Uf(oA, X, n.headers[X]) || "").trim();
|
|
8105
|
+
if (zA) {
|
|
8106
|
+
if (/cm\b|centimeter/i.test(zA)) {
|
|
8107
8107
|
H = "cm";
|
|
8108
8108
|
break;
|
|
8109
8109
|
}
|
|
8110
|
-
if (/in\b|inch|"$/i.test(
|
|
8110
|
+
if (/in\b|inch|"$/i.test(zA)) {
|
|
8111
8111
|
H = "in";
|
|
8112
8112
|
break;
|
|
8113
8113
|
}
|
|
@@ -8116,29 +8116,29 @@ function DP({
|
|
|
8116
8116
|
a.push(H);
|
|
8117
8117
|
}
|
|
8118
8118
|
return a;
|
|
8119
|
-
}, [n]), ff =
|
|
8120
|
-
const
|
|
8119
|
+
}, [n]), ff = UA((a, X) => {
|
|
8120
|
+
const nA = a.toLowerCase().trim(), H = B === "cm" || B === "", oA = H ? "cm" : "in", zA = [];
|
|
8121
8121
|
for (let AA = 0; AA < n.headers.length; AA++) {
|
|
8122
8122
|
const LA = (n.headers[AA] || "").toLowerCase().trim();
|
|
8123
|
-
if (LA ===
|
|
8124
|
-
|
|
8123
|
+
if (LA === nA) {
|
|
8124
|
+
zA.push(AA);
|
|
8125
8125
|
continue;
|
|
8126
8126
|
}
|
|
8127
8127
|
const Pf = LA.replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8128
|
-
(Pf ===
|
|
8128
|
+
(Pf === nA || LA.includes(nA) || nA.includes(Pf)) && zA.push(AA);
|
|
8129
8129
|
}
|
|
8130
|
-
if (
|
|
8131
|
-
let
|
|
8132
|
-
|
|
8133
|
-
const of = n.headers[
|
|
8134
|
-
let
|
|
8135
|
-
if (
|
|
8136
|
-
const LA = Uf(AA,
|
|
8137
|
-
return LA.startsWith(
|
|
8138
|
-
})), !
|
|
8139
|
-
const Bf = Uf(
|
|
8130
|
+
if (zA.length === 0) return null;
|
|
8131
|
+
let YA = zA.find((AA) => SA[AA] === oA);
|
|
8132
|
+
YA == null && (YA = zA[0]);
|
|
8133
|
+
const of = n.headers[YA], J = X.trim().toLowerCase();
|
|
8134
|
+
let gA = n.rows.find((AA) => Uf(AA, m, EA) === X);
|
|
8135
|
+
if (gA || (gA = n.rows.find((AA) => Uf(AA, m, EA).trim().toLowerCase() === J)), gA || (gA = n.rows.find((AA) => {
|
|
8136
|
+
const LA = Uf(AA, m, EA).trim().toLowerCase();
|
|
8137
|
+
return LA.startsWith(J) || J.startsWith(LA);
|
|
8138
|
+
})), !gA) return null;
|
|
8139
|
+
const Bf = Uf(gA, YA, of);
|
|
8140
8140
|
if (!Bf) return null;
|
|
8141
|
-
const FA = QP(Bf), OA = SA[
|
|
8141
|
+
const FA = QP(Bf), OA = SA[YA];
|
|
8142
8142
|
if (OA === "in" && H) {
|
|
8143
8143
|
const AA = (LA) => +(LA * 2.54).toFixed(1);
|
|
8144
8144
|
return { range: String(AA(FA.min)) + (FA.min !== FA.max ? "–" + String(AA(FA.max)) : ""), min: AA(FA.min), max: AA(FA.max) };
|
|
@@ -8148,25 +8148,34 @@ function DP({
|
|
|
8148
8148
|
return { range: String(AA(FA.min)) + (FA.min !== FA.max ? "–" + String(AA(FA.max)) : ""), min: AA(FA.min), max: AA(FA.max) };
|
|
8149
8149
|
}
|
|
8150
8150
|
return { range: Bf, ...FA };
|
|
8151
|
-
}, [n,
|
|
8152
|
-
if (
|
|
8153
|
-
return (g?.matchDetails || []).map((
|
|
8154
|
-
area:
|
|
8155
|
-
rawUserValue:
|
|
8156
|
-
rawChartRange:
|
|
8157
|
-
fit:
|
|
8151
|
+
}, [n, m, EA, B, SA]), rA = wf(() => {
|
|
8152
|
+
if (N)
|
|
8153
|
+
return (g?.matchDetails || []).map((gA) => ({
|
|
8154
|
+
area: gA.measurement.replace(/\s*\(.*?\)\s*$/, "").trim() || gA.measurement,
|
|
8155
|
+
rawUserValue: gA.userValue,
|
|
8156
|
+
rawChartRange: gA.chartRange,
|
|
8157
|
+
fit: gA.fit,
|
|
8158
8158
|
userNum: 0,
|
|
8159
8159
|
chartLabel: "",
|
|
8160
8160
|
isLength: !1
|
|
8161
8161
|
}));
|
|
8162
|
-
const a = g?.matchDetails || [], X = D?.secResult?.matchDetails || [],
|
|
8163
|
-
if (!
|
|
8164
|
-
|
|
8165
|
-
|
|
8166
|
-
|
|
8167
|
-
|
|
8162
|
+
const a = g?.matchDetails || [], X = D?.secResult?.matchDetails || [], nA = [...a, ...X], H = g?.length || "", oA = (g?.availableLengths?.length || 0) > 0, zA = RA || H, YA = !!(D || oA);
|
|
8163
|
+
if (YA && !X.length) {
|
|
8164
|
+
const J = e.height || 0;
|
|
8165
|
+
nA.push({
|
|
8166
|
+
measurement: "Height",
|
|
8167
|
+
userValue: J ? String(J) : "",
|
|
8168
|
+
chartRange: zA || "",
|
|
8169
|
+
fit: "good"
|
|
8170
|
+
});
|
|
8171
|
+
}
|
|
8172
|
+
if (!nA.length) return [];
|
|
8173
|
+
const of = new Set(X.length > 0 ? X.map((J) => J.measurement) : YA ? ["Height"] : []);
|
|
8174
|
+
return nA.map((J) => {
|
|
8175
|
+
if (of.has(J.measurement)) {
|
|
8176
|
+
const U = e[J.measurement.toLowerCase()] || kf(J.userValue), R = mA || zA || J.chartRange;
|
|
8168
8177
|
if (!D)
|
|
8169
|
-
return { area:
|
|
8178
|
+
return { area: J.measurement + " (" + R + ")", userNum: U, chartLabel: R, fit: "good", isLength: !0 };
|
|
8170
8179
|
const G = D.section, S = G.headers.findIndex((KA) => /size|length/i.test(KA.trim())), aA = G.headers.findIndex((KA) => /cm|\(cm\)|height.*cm/i.test(KA.toLowerCase())), fA = S >= 0 ? S : 0, NA = aA >= 0 ? aA : -1, $A = G.rows.find((KA) => Uf(KA, fA, G.headers[fA]) === R);
|
|
8171
8180
|
let ef = R, yA = "good";
|
|
8172
8181
|
if ($A && NA >= 0) {
|
|
@@ -8175,44 +8184,44 @@ function DP({
|
|
|
8175
8184
|
ef = KA;
|
|
8176
8185
|
const { min: vf, max: M } = QP(KA);
|
|
8177
8186
|
if (vf > 0 && M > 0) {
|
|
8178
|
-
const
|
|
8187
|
+
const cA = M - vf, pA = cA > 0 ? cA * 0.5 : vf * 0.05 || 3, tf = Math.max((M || vf) * 5e-3, 0.25);
|
|
8179
8188
|
if (U >= vf - tf && U <= M + tf) yA = "good";
|
|
8180
8189
|
else if (U < vf) {
|
|
8181
8190
|
const Df = vf - U;
|
|
8182
|
-
yA = Df >
|
|
8191
|
+
yA = Df > pA * 2 ? "too-tight" : Df > pA ? "tight" : "a-bit-tight";
|
|
8183
8192
|
} else {
|
|
8184
8193
|
const Df = U - M;
|
|
8185
|
-
yA = Df >
|
|
8194
|
+
yA = Df > pA * 2 ? "too-loose" : Df > pA ? "loose" : "a-bit-loose";
|
|
8186
8195
|
}
|
|
8187
8196
|
}
|
|
8188
8197
|
}
|
|
8189
8198
|
}
|
|
8190
|
-
return { area:
|
|
8199
|
+
return { area: J.measurement + " (" + R + ")", userNum: U, chartLabel: kP(ef), fit: yA, isLength: !0 };
|
|
8191
8200
|
}
|
|
8192
|
-
const
|
|
8193
|
-
let { min: Bf, max: FA } = QP(
|
|
8194
|
-
const AA = ff(
|
|
8201
|
+
const gA = e[J.measurement.toLowerCase()] || kf(J.userValue);
|
|
8202
|
+
let { min: Bf, max: FA } = QP(J.chartRange), OA = J.chartRange;
|
|
8203
|
+
const AA = ff(J.measurement, bA);
|
|
8195
8204
|
AA && (OA = AA.range, Bf = AA.min, FA = AA.max);
|
|
8196
|
-
const LA = FA - Bf, Pf = LA > 0 ? LA * 0.5 : Bf * 0.05 || 3, lA =
|
|
8205
|
+
const LA = FA - Bf, Pf = LA > 0 ? LA * 0.5 : Bf * 0.05 || 3, lA = J.measurement.toLowerCase(), x = /length|inseam|sleeve|hem|rise/.test(lA);
|
|
8197
8206
|
let q;
|
|
8198
8207
|
const QA = Math.max((FA || Bf) * 0.03, 0.5);
|
|
8199
|
-
if (
|
|
8208
|
+
if (gA >= Bf - QA && gA <= FA + QA)
|
|
8200
8209
|
q = "good";
|
|
8201
8210
|
else if (x) {
|
|
8202
|
-
const U =
|
|
8203
|
-
q = (U > Pf * 2 ? "too-" : U > Pf ? "" : "a-bit-") + (
|
|
8204
|
-
} else if (
|
|
8205
|
-
const U = Bf -
|
|
8211
|
+
const U = gA > FA ? gA - FA : Bf - gA;
|
|
8212
|
+
q = (U > Pf * 2 ? "too-" : U > Pf ? "" : "a-bit-") + (gA > FA ? "short" : "long");
|
|
8213
|
+
} else if (gA < Bf) {
|
|
8214
|
+
const U = Bf - gA;
|
|
8206
8215
|
q = U > Pf * 2 ? "too-loose" : U > Pf ? "loose" : "a-bit-loose";
|
|
8207
8216
|
} else {
|
|
8208
|
-
const U =
|
|
8217
|
+
const U = gA - FA;
|
|
8209
8218
|
q = U > Pf * 2 ? "too-tight" : U > Pf ? "tight" : "a-bit-tight";
|
|
8210
8219
|
}
|
|
8211
|
-
return { area:
|
|
8220
|
+
return { area: J.measurement, userNum: gA, chartLabel: kP(OA), fit: q, isLength: x };
|
|
8212
8221
|
});
|
|
8213
|
-
}, [g, D, e,
|
|
8222
|
+
}, [g, D, e, bA, E, ff, mA, RA, N]), nf = rA.filter(
|
|
8214
8223
|
(a) => a.fit === "good" || a.fit === "a-bit-tight" || a.fit === "a-bit-loose"
|
|
8215
|
-
).length, xA = rA.length > 0 ? Math.round(nf / rA.length * 100) : 0, Ef = !
|
|
8224
|
+
).length, xA = rA.length > 0 ? Math.round(nf / rA.length * 100) : 0, Ef = !N, eA = g, $ = eA?.size || E, _A = (g?.matchDetails || []).find(
|
|
8216
8225
|
(a) => /inseam|length/i.test(a.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(a.measurement)
|
|
8217
8226
|
), Of = _A ? (_A.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", cf = eA?.length || RA || Of, Mf = eA?.availableSizes || [], gf = eA?.availableLengths || [], qA = mA || cf, GA = Mf.length > 0 ? Mf : TA, _ = (() => {
|
|
8218
8227
|
if (GA.length <= 3) return GA;
|
|
@@ -8220,18 +8229,18 @@ function DP({
|
|
|
8220
8229
|
if (a < 0) return GA.slice(0, 3);
|
|
8221
8230
|
const X = Math.max(0, Math.min(GA.length - 3, a - 1));
|
|
8222
8231
|
return GA.slice(X, X + 3);
|
|
8223
|
-
})(),
|
|
8224
|
-
if (
|
|
8225
|
-
const a =
|
|
8226
|
-
if (a < 0) return
|
|
8227
|
-
const X = Math.max(0, Math.min(
|
|
8228
|
-
return
|
|
8232
|
+
})(), uA = gf.length > 0 ? gf : ZA, WA = (() => {
|
|
8233
|
+
if (uA.length <= 3) return uA;
|
|
8234
|
+
const a = uA.indexOf(cf);
|
|
8235
|
+
if (a < 0) return uA.slice(0, 3);
|
|
8236
|
+
const X = Math.max(0, Math.min(uA.length - 3, a - 1));
|
|
8237
|
+
return uA.slice(X, X + 3);
|
|
8229
8238
|
})();
|
|
8230
8239
|
if (p) {
|
|
8231
8240
|
const a = f.replace(/\s*[—–-]\s*.*/g, ""), X = (H) => {
|
|
8232
8241
|
const oA = H.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8233
8242
|
return oA.includes("chest") || oA.includes("bust") ? o("Full circumference at the widest point.") : oA.includes("waist") ? o("Circumference at the natural waistline.") : oA.includes("hip") ? o("Circumference at the fullest point.") : oA.includes("shoulder") ? o("Shoulder edge to shoulder edge.") : oA.includes("sleeve") || oA.includes("arm") ? o("Shoulder seam to cuff edge.") : oA.includes("neck") || oA.includes("collar") ? o("Around the base of the neck.") : oA.includes("inseam") || oA.includes("inside leg") ? o("Inner leg seam length.") : oA.includes("thigh") ? o("Circumference around the upper leg.") : oA.includes("length") || oA.includes("height") ? o("Top to bottom length.") : "";
|
|
8234
|
-
},
|
|
8243
|
+
}, nA = (H, oA) => oA && H === "good" ? o("EDITORIAL LENGTH") : H === "good" ? o("PERFECT TENSION") : H === "a-bit-tight" ? o("SLIGHTLY TIGHT") : H === "a-bit-loose" ? o("SLIGHT EASE") : H.includes("tight") ? o("TIGHT") : H.includes("loose") ? o("LOOSE") : o("FIT");
|
|
8235
8244
|
return /* @__PURE__ */ A("div", { className: "ps-msd-root", children: /* @__PURE__ */ P("div", { className: "ps-msd-scroll", children: [
|
|
8236
8245
|
/* @__PURE__ */ P("div", { className: "ps-msd-topbar", children: [
|
|
8237
8246
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-msd-back", onClick: i, "aria-label": o("Back"), children: /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "20", height: "20", children: [
|
|
@@ -8293,7 +8302,7 @@ function DP({
|
|
|
8293
8302
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", style: { margin: 0, lineHeight: 1.5 }, children: o("Your measurements are outside this product's size range. You can still try it on visually below.") })
|
|
8294
8303
|
] }) }),
|
|
8295
8304
|
K !== !1 && /* @__PURE__ */ P("div", { className: "ps-msd-card", children: [
|
|
8296
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: o(
|
|
8305
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: o(bA === $ ? "RECOMMENDED SIZE" : "TRYING SIZE") }),
|
|
8297
8306
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "10px", marginTop: "6px", marginBottom: "4px" }, children: [
|
|
8298
8307
|
V.length > 1 && /* @__PURE__ */ P(
|
|
8299
8308
|
"select",
|
|
@@ -8356,10 +8365,10 @@ function DP({
|
|
|
8356
8365
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: o("MEASUREMENT BLUEPRINT") }),
|
|
8357
8366
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
8358
8367
|
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: rA.map((H, oA) => {
|
|
8359
|
-
const
|
|
8368
|
+
const zA = H.isLength && H.fit.includes("short") || H.fit.includes("tight"), YA = H.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose", of = X(H.area), J = String(oA + 1).padStart(2, "0");
|
|
8360
8369
|
return /* @__PURE__ */ P("div", { className: "ps-msd-row", children: [
|
|
8361
8370
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-num", children: [
|
|
8362
|
-
|
|
8371
|
+
J,
|
|
8363
8372
|
" ",
|
|
8364
8373
|
H.area.toUpperCase()
|
|
8365
8374
|
] }),
|
|
@@ -8367,19 +8376,19 @@ function DP({
|
|
|
8367
8376
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cells", children: [
|
|
8368
8377
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell", children: [
|
|
8369
8378
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: o("USER") }),
|
|
8370
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children:
|
|
8379
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: N ? H.rawUserValue || "—" : isNaN(H.userNum) || H.userNum === 0 ? "—" : `${XA(H.userNum)} ${B}` })
|
|
8371
8380
|
] }),
|
|
8372
8381
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell ps-right", children: [
|
|
8373
8382
|
/* @__PURE__ */ P("span", { className: "ps-msd-cell-label", children: [
|
|
8374
8383
|
o("SIZE"),
|
|
8375
8384
|
" ",
|
|
8376
|
-
|
|
8385
|
+
bA
|
|
8377
8386
|
] }),
|
|
8378
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children:
|
|
8387
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: N ? H.rawChartRange || "—" : sA(H.chartLabel) })
|
|
8379
8388
|
] })
|
|
8380
8389
|
] }),
|
|
8381
|
-
/* @__PURE__ */ P("div", { className: `ps-msd-row-badge ${
|
|
8382
|
-
H.isLength ? Hn(H.fit, o).toUpperCase() :
|
|
8390
|
+
/* @__PURE__ */ P("div", { className: `ps-msd-row-badge ${YA}`, children: [
|
|
8391
|
+
H.isLength ? Hn(H.fit, o).toUpperCase() : nA(H.fit, H.isLength),
|
|
8383
8392
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "11", height: "11", children: /* @__PURE__ */ A("path", { d: "M3 8l3.5 3.5L13 5" }) })
|
|
8384
8393
|
] })
|
|
8385
8394
|
] }, oA);
|
|
@@ -8391,7 +8400,7 @@ function DP({
|
|
|
8391
8400
|
"button",
|
|
8392
8401
|
{
|
|
8393
8402
|
type: "button",
|
|
8394
|
-
className: `ps-msd-size-pill${H ===
|
|
8403
|
+
className: `ps-msd-size-pill${H === bA ? " ps-active" : ""}`,
|
|
8395
8404
|
onClick: () => c(H === E ? null : H),
|
|
8396
8405
|
children: H
|
|
8397
8406
|
},
|
|
@@ -8401,7 +8410,7 @@ function DP({
|
|
|
8401
8410
|
K !== !1 && WA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-sizes", children: [
|
|
8402
8411
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: o("LENGTH ADJUSTMENT") }),
|
|
8403
8412
|
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: WA.map((H) => {
|
|
8404
|
-
const oA = String(qA ?? "").trim() === String(H ?? "").trim(),
|
|
8413
|
+
const oA = String(qA ?? "").trim() === String(H ?? "").trim(), zA = Hf[String(H).trim()];
|
|
8405
8414
|
return /* @__PURE__ */ P(
|
|
8406
8415
|
"button",
|
|
8407
8416
|
{
|
|
@@ -8411,7 +8420,7 @@ function DP({
|
|
|
8411
8420
|
style: { display: "flex", flexDirection: "column", alignItems: "center", lineHeight: 1.15, gap: "0.15vw" },
|
|
8412
8421
|
children: [
|
|
8413
8422
|
/* @__PURE__ */ A("span", { children: H }),
|
|
8414
|
-
|
|
8423
|
+
zA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: zA })
|
|
8415
8424
|
]
|
|
8416
8425
|
},
|
|
8417
8426
|
H
|
|
@@ -8552,10 +8561,10 @@ function DP({
|
|
|
8552
8561
|
}, children: [
|
|
8553
8562
|
/* @__PURE__ */ A("span", { style: { fontSize: "3.5vw", fontWeight: 300, color: "var(--ps-text-primary)", lineHeight: 1, letterSpacing: "-0.02em" }, children: vA }),
|
|
8554
8563
|
qA && (() => {
|
|
8555
|
-
const a = /^\d+(\.\d+)?$/.test(String(qA).trim()), X = (f || "").toLowerCase(),
|
|
8564
|
+
const a = /^\d+(\.\d+)?$/.test(String(qA).trim()), X = (f || "").toLowerCase(), nA = a ? /pant|trouser|inseam/.test(X) ? o("Inseam") : o("Length") : null;
|
|
8556
8565
|
return /* @__PURE__ */ P("span", { style: { fontSize: "1.4vw", fontWeight: 400, color: "var(--ps-text-secondary)", display: "inline-flex", alignItems: "baseline", gap: "0.25vw" }, children: [
|
|
8557
8566
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.9vw", fontWeight: 600, color: "var(--ps-text-muted)", letterSpacing: "0.02em" }, children: "/" }),
|
|
8558
|
-
|
|
8567
|
+
nA && /* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 600, color: "var(--ps-text-muted)", textTransform: "uppercase", letterSpacing: "0.08em" }, children: nA }),
|
|
8559
8568
|
/* @__PURE__ */ A("span", { children: qA })
|
|
8560
8569
|
] });
|
|
8561
8570
|
})(),
|
|
@@ -8585,12 +8594,12 @@ function DP({
|
|
|
8585
8594
|
/* @__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: o("Fit Result") })
|
|
8586
8595
|
] }) }),
|
|
8587
8596
|
/* @__PURE__ */ A("tbody", { children: rA.map((a, X) => {
|
|
8588
|
-
const
|
|
8597
|
+
const nA = a.fit === "good" ? "#2154EF" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "#dc2626" : "#d97706" : a.fit.includes("tight") ? "#dc2626" : "#d97706", H = a.fit === "good" ? "rgba(33,84,239,0.08)" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
8589
8598
|
return /* @__PURE__ */ P("tr", { style: { borderBottom: X < rA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
8590
8599
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: a.area }),
|
|
8591
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children:
|
|
8592
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children:
|
|
8593
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color:
|
|
8600
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawUserValue || "—" : isNaN(a.userNum) || a.userNum === 0 ? "—" : `${XA(a.userNum)} ${B}` }),
|
|
8601
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawChartRange || "—" : sA(a.chartLabel) }),
|
|
8602
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: nA, background: H, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: a.isLength ? Hn(a.fit, o) : jB(a.fit, o) }) })
|
|
8594
8603
|
] }, X);
|
|
8595
8604
|
}) })
|
|
8596
8605
|
] }) }),
|
|
@@ -8603,7 +8612,7 @@ function DP({
|
|
|
8603
8612
|
o("Size")
|
|
8604
8613
|
] }),
|
|
8605
8614
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: _.map((a) => {
|
|
8606
|
-
const X = a ===
|
|
8615
|
+
const X = a === bA;
|
|
8607
8616
|
return /* @__PURE__ */ A(
|
|
8608
8617
|
"button",
|
|
8609
8618
|
{
|
|
@@ -8631,7 +8640,7 @@ function DP({
|
|
|
8631
8640
|
WA.length > 0 && /* @__PURE__ */ P("div", { style: { marginBottom: "0.8vw", marginTop: "0.4vw" }, children: [
|
|
8632
8641
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 700, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.1em", display: "block", marginBottom: "0.4vw" }, children: o("Length Adjustment") }),
|
|
8633
8642
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: WA.map((a) => {
|
|
8634
|
-
const X = String(qA ?? "").trim() === String(a ?? "").trim(),
|
|
8643
|
+
const X = String(qA ?? "").trim() === String(a ?? "").trim(), nA = Hf[String(a).trim()];
|
|
8635
8644
|
return /* @__PURE__ */ P(
|
|
8636
8645
|
"button",
|
|
8637
8646
|
{
|
|
@@ -8655,7 +8664,7 @@ function DP({
|
|
|
8655
8664
|
},
|
|
8656
8665
|
children: [
|
|
8657
8666
|
/* @__PURE__ */ A("span", { children: a }),
|
|
8658
|
-
|
|
8667
|
+
nA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: nA })
|
|
8659
8668
|
]
|
|
8660
8669
|
},
|
|
8661
8670
|
a
|
|
@@ -8754,13 +8763,13 @@ function EB({
|
|
|
8754
8763
|
measurementType: v = "body",
|
|
8755
8764
|
estimationDone: I = !1,
|
|
8756
8765
|
activeSection: O,
|
|
8757
|
-
setActiveSection:
|
|
8766
|
+
setActiveSection: N,
|
|
8758
8767
|
onResetTryOn: K,
|
|
8759
8768
|
onClose: E,
|
|
8760
|
-
userHeightCm:
|
|
8769
|
+
userHeightCm: BA,
|
|
8761
8770
|
t: c
|
|
8762
8771
|
}) {
|
|
8763
|
-
const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [
|
|
8772
|
+
const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [XA, sA] = j({}), V = QP, s = UA((U, R, G) => Uf(U, R, G), []), PA = wf(() => {
|
|
8764
8773
|
if (!g?.headers || !g?.rows) return -1;
|
|
8765
8774
|
const U = g.headers.findIndex((R) => /size|taglia|größe|taille/i.test(R.trim()));
|
|
8766
8775
|
if (U >= 0) return U;
|
|
@@ -8801,17 +8810,17 @@ function EB({
|
|
|
8801
8810
|
U.push(S);
|
|
8802
8811
|
}
|
|
8803
8812
|
return U;
|
|
8804
|
-
}, [g, s]), dA =
|
|
8813
|
+
}, [g, s]), dA = UA((U, R) => {
|
|
8805
8814
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8806
8815
|
const G = U.toLowerCase().trim(), S = y === "cm" || y === "", aA = S ? "cm" : "in", fA = [];
|
|
8807
8816
|
for (let M = 0; M < g.headers.length; M++) {
|
|
8808
|
-
const
|
|
8809
|
-
if (
|
|
8817
|
+
const cA = (g.headers[M] || "").toLowerCase().trim();
|
|
8818
|
+
if (cA === G) {
|
|
8810
8819
|
fA.push(M);
|
|
8811
8820
|
continue;
|
|
8812
8821
|
}
|
|
8813
|
-
const
|
|
8814
|
-
(
|
|
8822
|
+
const pA = cA.replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8823
|
+
(pA === G || cA.includes(G) || G.includes(pA)) && fA.push(M);
|
|
8815
8824
|
}
|
|
8816
8825
|
if (fA.length === 0) return null;
|
|
8817
8826
|
let NA = fA.find((M) => mA[M] === aA);
|
|
@@ -8822,17 +8831,17 @@ function EB({
|
|
|
8822
8831
|
if (!yA) return null;
|
|
8823
8832
|
const KA = V(yA), vf = mA[NA];
|
|
8824
8833
|
if (vf === "in" && S) {
|
|
8825
|
-
const M = (
|
|
8834
|
+
const M = (cA) => +(cA * 2.54).toFixed(1);
|
|
8826
8835
|
return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
|
|
8827
8836
|
}
|
|
8828
8837
|
if (vf === "cm" && !S) {
|
|
8829
|
-
const M = (
|
|
8838
|
+
const M = (cA) => +(cA / 2.54).toFixed(1);
|
|
8830
8839
|
return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
|
|
8831
8840
|
}
|
|
8832
8841
|
return { range: yA, ...KA };
|
|
8833
8842
|
}, [g, PA, RA, y, s, V, mA]), ZA = n?.recommendedSize || "";
|
|
8834
8843
|
wf(() => n?.internationalSizes || {}, [n]);
|
|
8835
|
-
const [Hf,
|
|
8844
|
+
const [Hf, m] = j("fit"), [EA, TA] = j(null), [bA, VA] = j(!1), [kA, vA] = j(!1), [SA, ff] = j(!1), [rA, nf] = j(null), [xA, Ef] = j(!1), [eA, $] = j({ w: 800, h: 1200 }), _A = UA((U) => {
|
|
8836
8845
|
const R = U.currentTarget;
|
|
8837
8846
|
R.naturalWidth && R.naturalHeight && $({ w: R.naturalWidth, h: R.naturalHeight });
|
|
8838
8847
|
}, []);
|
|
@@ -8849,7 +8858,7 @@ function EB({
|
|
|
8849
8858
|
}, [e, t]);
|
|
8850
8859
|
const [Of, cf] = j(!1), [Mf, gf] = j(!1);
|
|
8851
8860
|
iA(null);
|
|
8852
|
-
const [qA, GA] = j(!1), [_,
|
|
8861
|
+
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = iA(null), [nA, H] = j(null), [oA, zA] = j(!1);
|
|
8853
8862
|
JA(() => {
|
|
8854
8863
|
if (_) {
|
|
8855
8864
|
const U = URL.createObjectURL(_);
|
|
@@ -8857,7 +8866,7 @@ function EB({
|
|
|
8857
8866
|
}
|
|
8858
8867
|
H(null);
|
|
8859
8868
|
}, [_]);
|
|
8860
|
-
const
|
|
8869
|
+
const YA = EA || ZA;
|
|
8861
8870
|
wf(() => {
|
|
8862
8871
|
if (!n?.matchDetails?.length) return [];
|
|
8863
8872
|
const U = /* @__PURE__ */ new Set();
|
|
@@ -8867,8 +8876,8 @@ function EB({
|
|
|
8867
8876
|
}).map((G) => {
|
|
8868
8877
|
const S = kf(G.userValue);
|
|
8869
8878
|
let aA = G.chartRange, fA = G.fit;
|
|
8870
|
-
if (
|
|
8871
|
-
const NA = dA(G.measurement,
|
|
8879
|
+
if (YA !== ZA) {
|
|
8880
|
+
const NA = dA(G.measurement, YA);
|
|
8872
8881
|
if (NA && NA.min > 0) {
|
|
8873
8882
|
aA = kP(NA.range);
|
|
8874
8883
|
const $A = NA.min, ef = NA.max, yA = ef - $A, KA = yA > 0 ? yA * 0.5 : $A * 0.05 || 3, vf = Math.max((ef || $A) * 5e-3, 0.25);
|
|
@@ -8884,9 +8893,9 @@ function EB({
|
|
|
8884
8893
|
}
|
|
8885
8894
|
return { area: G.measurement, userNum: kf(G.userValue), chartLabel: aA, fit: fA };
|
|
8886
8895
|
});
|
|
8887
|
-
}, [n,
|
|
8896
|
+
}, [n, YA, ZA, dA]), wf(() => {
|
|
8888
8897
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8889
|
-
const U = g.rows.find((G) => s(G, PA, RA) ===
|
|
8898
|
+
const U = g.rows.find((G) => s(G, PA, RA) === YA);
|
|
8890
8899
|
if (!U) return null;
|
|
8891
8900
|
const R = [];
|
|
8892
8901
|
for (let G = 0; G < g.headers.length; G++) {
|
|
@@ -8896,20 +8905,20 @@ function EB({
|
|
|
8896
8905
|
aA && R.push({ header: S, value: aA });
|
|
8897
8906
|
}
|
|
8898
8907
|
return R;
|
|
8899
|
-
}, [g, PA, RA,
|
|
8900
|
-
const of = !!(g?.sections && Object.keys(g.sections).length > 1),
|
|
8908
|
+
}, [g, PA, RA, YA, s]);
|
|
8909
|
+
const of = !!(g?.sections && Object.keys(g.sections).length > 1), J = wf(() => n?.sections && Object.keys(n.sections).length > 0 ? Object.entries(n.sections).map(([U, R]) => {
|
|
8901
8910
|
const G = g?.sections?.[U] || Object.values(g?.sections || {}).find(
|
|
8902
8911
|
(aA) => U.toLowerCase().includes(aA.name?.toLowerCase()?.replace(/\s*(size|sizing)\s*/gi, "").trim() || "---")
|
|
8903
8912
|
) || { headers: [], rows: [], requiredFields: [] }, S = {};
|
|
8904
8913
|
if (R.matchDetails)
|
|
8905
8914
|
for (const aA of R.matchDetails) S[aA.measurement.toLowerCase()] = kf(aA.userValue);
|
|
8906
|
-
return
|
|
8915
|
+
return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: G, secResult: R, userMeasurements: S };
|
|
8907
8916
|
}) : !of || !g?.sections ? [] : Object.entries(g.sections).map(([U, R]) => {
|
|
8908
8917
|
const G = n?.sections?.[U] || { recommendedSize: n?.recommendedSize || "", matchDetails: [] }, S = {};
|
|
8909
8918
|
if (G.matchDetails)
|
|
8910
8919
|
for (const aA of G.matchDetails) S[aA.measurement.toLowerCase()] = kf(aA.userValue);
|
|
8911
|
-
return
|
|
8912
|
-
}), [of, g, n,
|
|
8920
|
+
return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: R, secResult: G, userMeasurements: S };
|
|
8921
|
+
}), [of, g, n, BA]), gA = wf(() => J.filter((U) => !zn(U.name)), [J]), Bf = wf(() => J.filter((U) => zn(U.name)), [J]), FA = !!T, OA = FA && (t || f && !n), AA = !FA && f && !n, LA = !!n, Pf = !!e && !t, lA = FA ? LA && Pf : LA, x = NP(), q = v === "face" || v === "head";
|
|
8913
8922
|
n?.found;
|
|
8914
8923
|
const QA = v === "foot";
|
|
8915
8924
|
return console.log("[PS-SDK] SizeResultView render:", {
|
|
@@ -8984,7 +8993,7 @@ function EB({
|
|
|
8984
8993
|
of ? O ? (
|
|
8985
8994
|
/* ── Detail view for a single section ── */
|
|
8986
8995
|
(() => {
|
|
8987
|
-
const U =
|
|
8996
|
+
const U = gA.find((R) => R.name === O);
|
|
8988
8997
|
return U ? x ? /* @__PURE__ */ A(
|
|
8989
8998
|
DP,
|
|
8990
8999
|
{
|
|
@@ -8996,7 +9005,7 @@ function EB({
|
|
|
8996
9005
|
unitLbl: y,
|
|
8997
9006
|
chartUnit: l,
|
|
8998
9007
|
lengthEntry: cn(U.name, Bf),
|
|
8999
|
-
onBack: () =>
|
|
9008
|
+
onBack: () => N(null),
|
|
9000
9009
|
internationalSizes: U.secResult?.internationalSizes,
|
|
9001
9010
|
productImage: e || B,
|
|
9002
9011
|
productTitle: C,
|
|
@@ -9040,7 +9049,7 @@ function EB({
|
|
|
9040
9049
|
unitLbl: y,
|
|
9041
9050
|
chartUnit: l,
|
|
9042
9051
|
lengthEntry: cn(U.name, Bf),
|
|
9043
|
-
onBack: () =>
|
|
9052
|
+
onBack: () => N(null),
|
|
9044
9053
|
internationalSizes: U.secResult?.internationalSizes,
|
|
9045
9054
|
t: c
|
|
9046
9055
|
}
|
|
@@ -9056,16 +9065,16 @@ function EB({
|
|
|
9056
9065
|
productTitle: C,
|
|
9057
9066
|
sizingResult: n,
|
|
9058
9067
|
sizeGuide: g,
|
|
9059
|
-
sectionEntries:
|
|
9060
|
-
onSelectSection: (U) =>
|
|
9068
|
+
sectionEntries: gA.map(({ name: U, secResult: R }) => ({ name: U, secResult: R })),
|
|
9069
|
+
onSelectSection: (U) => N(U),
|
|
9061
9070
|
onTryOn: () => {
|
|
9062
|
-
|
|
9071
|
+
uA(p || null), GA(!0);
|
|
9063
9072
|
},
|
|
9064
9073
|
tryOnProcessing: t,
|
|
9065
9074
|
resultImageUrl: e,
|
|
9066
9075
|
tryOnDone: !!e && !t,
|
|
9067
9076
|
onTryAgain: () => {
|
|
9068
|
-
K?.(),
|
|
9077
|
+
K?.(), uA(p || null), GA(!0);
|
|
9069
9078
|
},
|
|
9070
9079
|
onClose: E,
|
|
9071
9080
|
showLines: kA,
|
|
@@ -9139,9 +9148,9 @@ function EB({
|
|
|
9139
9148
|
/* @__PURE__ */ A("h3", { className: "ps-tryon-v2-title", children: c("Your Perfect Fit") }),
|
|
9140
9149
|
/* @__PURE__ */ A("p", { className: "ps-tryon-v2-subtitle", children: c("Tap any section for detailed breakdown") }),
|
|
9141
9150
|
/* @__PURE__ */ A("div", { className: "ps-tryon-v2-sep" }),
|
|
9142
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children:
|
|
9143
|
-
const S = g?.sectionImages?.[U], aA = G ===
|
|
9144
|
-
return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${aA ? " ps-full" : ""}`, onClick: () =>
|
|
9151
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: gA.map(({ name: U, secResult: R }, G) => {
|
|
9152
|
+
const S = g?.sectionImages?.[U], aA = G === gA.length - 1 && gA.length % 2 !== 0, fA = R;
|
|
9153
|
+
return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${aA ? " ps-full" : ""}`, onClick: () => N(U), style: { animationDelay: `${G * 0.07}s` }, children: [
|
|
9145
9154
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-card-v2-text", children: [
|
|
9146
9155
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-label", children: U.replace(/\s*[—–-]\s*.*/g, "") }),
|
|
9147
9156
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: fA.found === !1 ? c("No fit") : fA.size || R.recommendedSize }),
|
|
@@ -9186,7 +9195,7 @@ function EB({
|
|
|
9186
9195
|
style: { marginTop: 0 },
|
|
9187
9196
|
disabled: t,
|
|
9188
9197
|
onClick: () => {
|
|
9189
|
-
|
|
9198
|
+
uA(p || null), GA(!0);
|
|
9190
9199
|
},
|
|
9191
9200
|
children: [
|
|
9192
9201
|
/* @__PURE__ */ A(hf, { size: 14 }),
|
|
@@ -9205,7 +9214,7 @@ function EB({
|
|
|
9205
9214
|
if (n?.matchDetails)
|
|
9206
9215
|
for (const fA of n.matchDetails) G[fA.measurement.toLowerCase()] = kf(fA.userValue);
|
|
9207
9216
|
const S = c("Your Fit"), aA = () => {
|
|
9208
|
-
e || (
|
|
9217
|
+
e || (uA(p || null), GA(!0));
|
|
9209
9218
|
};
|
|
9210
9219
|
return x ? /* @__PURE__ */ A(
|
|
9211
9220
|
DP,
|
|
@@ -9295,18 +9304,18 @@ function EB({
|
|
|
9295
9304
|
style: { display: "none" },
|
|
9296
9305
|
onChange: (U) => {
|
|
9297
9306
|
const R = U.target.files?.[0];
|
|
9298
|
-
R &&
|
|
9307
|
+
R && uA(R);
|
|
9299
9308
|
}
|
|
9300
9309
|
}
|
|
9301
9310
|
),
|
|
9302
|
-
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ &&
|
|
9303
|
-
/* @__PURE__ */ A("img", { src:
|
|
9311
|
+
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ && nA ? /* @__PURE__ */ P(tA, { children: [
|
|
9312
|
+
/* @__PURE__ */ A("img", { src: nA, alt: c("Your photo"), className: "ps-pm-preview-img" }),
|
|
9304
9313
|
/* @__PURE__ */ A(
|
|
9305
9314
|
"button",
|
|
9306
9315
|
{
|
|
9307
9316
|
type: "button",
|
|
9308
9317
|
className: "ps-pm-preview-remove",
|
|
9309
|
-
onClick: () =>
|
|
9318
|
+
onClick: () => uA(null),
|
|
9310
9319
|
"aria-label": c("Remove photo"),
|
|
9311
9320
|
children: /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
9312
9321
|
/* @__PURE__ */ A("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
@@ -9378,7 +9387,7 @@ function EB({
|
|
|
9378
9387
|
type: "button",
|
|
9379
9388
|
className: "ps-pm-secondary-btn",
|
|
9380
9389
|
onClick: () => {
|
|
9381
|
-
GA(!1),
|
|
9390
|
+
GA(!1), uA(null);
|
|
9382
9391
|
},
|
|
9383
9392
|
children: c("BACK")
|
|
9384
9393
|
}
|
|
@@ -9398,7 +9407,7 @@ function EB({
|
|
|
9398
9407
|
onDrop: (U) => {
|
|
9399
9408
|
U.preventDefault(), a(!1);
|
|
9400
9409
|
const R = U.dataTransfer.files[0];
|
|
9401
|
-
R &&
|
|
9410
|
+
R && uA(R);
|
|
9402
9411
|
},
|
|
9403
9412
|
style: {
|
|
9404
9413
|
flex: 1,
|
|
@@ -9415,8 +9424,8 @@ function EB({
|
|
|
9415
9424
|
},
|
|
9416
9425
|
className: "ps-tryon-upload-hover",
|
|
9417
9426
|
children: [
|
|
9418
|
-
_ &&
|
|
9419
|
-
/* @__PURE__ */ A("img", { src:
|
|
9427
|
+
_ && nA ? /* @__PURE__ */ P(tA, { children: [
|
|
9428
|
+
/* @__PURE__ */ A("img", { src: nA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
9420
9429
|
/* @__PURE__ */ A("div", { className: "ps-tryon-upload-hover-overlay", style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(0,0,0,0.4)", opacity: 0, transition: "opacity 0.2s", borderRadius: "0.5vw" }, children: /* @__PURE__ */ A("span", { style: { color: "#fff", fontSize: "0.8vw", fontWeight: 600 }, children: c("Click to change photo") }) })
|
|
9421
9430
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
9422
9431
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
@@ -9432,7 +9441,7 @@ function EB({
|
|
|
9432
9441
|
style: { display: "none" },
|
|
9433
9442
|
onChange: (U) => {
|
|
9434
9443
|
const R = U.target.files?.[0];
|
|
9435
|
-
R &&
|
|
9444
|
+
R && uA(R);
|
|
9436
9445
|
}
|
|
9437
9446
|
}
|
|
9438
9447
|
)
|
|
@@ -9527,7 +9536,7 @@ function EB({
|
|
|
9527
9536
|
] })
|
|
9528
9537
|
] })
|
|
9529
9538
|
] }) }),
|
|
9530
|
-
|
|
9539
|
+
bA && g && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children: /* @__PURE__ */ P("div", { className: "ps-tryon-sr-chart-modal", children: [
|
|
9531
9540
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-chart-header", children: [
|
|
9532
9541
|
/* @__PURE__ */ A("h4", { children: c("Full Size Chart") }),
|
|
9533
9542
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => VA(!1), children: "✕" })
|
|
@@ -9556,7 +9565,7 @@ function EB({
|
|
|
9556
9565
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ P("table", { className: "ps-tryon-sr-chart-table", children: [
|
|
9557
9566
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: g.headers.map((U, R) => /* @__PURE__ */ A("th", { className: R === PA ? "ps-size-col" : "", children: U }, R)) }) }),
|
|
9558
9567
|
/* @__PURE__ */ A("tbody", { children: g.rows.map((U, R) => {
|
|
9559
|
-
const S = s(U, PA, RA) ===
|
|
9568
|
+
const S = s(U, PA, RA) === YA;
|
|
9560
9569
|
return /* @__PURE__ */ A("tr", { className: S ? "ps-active-row" : "", children: g.headers.map((aA, fA) => /* @__PURE__ */ A("td", { className: fA === PA ? "ps-size-col" : "", children: s(U, fA, aA) }, fA)) }, R);
|
|
9561
9570
|
}) })
|
|
9562
9571
|
] }) })
|
|
@@ -9635,15 +9644,15 @@ function dB({
|
|
|
9635
9644
|
cn: i,
|
|
9636
9645
|
t: o
|
|
9637
9646
|
}) {
|
|
9638
|
-
const r =
|
|
9647
|
+
const r = UA((h) => {
|
|
9639
9648
|
g.current = h, h && (h.style.width = `${Math.round(n.current)}%`);
|
|
9640
|
-
}, []), z =
|
|
9649
|
+
}, []), z = UA((h) => {
|
|
9641
9650
|
e.current = h, h && (h.textContent = `${Math.round(n.current)}%`);
|
|
9642
|
-
}, []), p =
|
|
9651
|
+
}, []), p = UA((h) => {
|
|
9643
9652
|
B.current = h;
|
|
9644
|
-
}, []), T =
|
|
9653
|
+
}, []), T = UA((h) => {
|
|
9645
9654
|
C.current = h;
|
|
9646
|
-
}, []), F =
|
|
9655
|
+
}, []), F = UA((h) => {
|
|
9647
9656
|
if (D.current = h, h) {
|
|
9648
9657
|
const W = xP * (1 - Math.round(n.current) / 100);
|
|
9649
9658
|
h.style.strokeDashoffset = String(W);
|
|
@@ -9778,7 +9787,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9778
9787
|
JA(() => {
|
|
9779
9788
|
W.current && (W.current.scrollTop = 0);
|
|
9780
9789
|
}, [C, i]);
|
|
9781
|
-
const [t, k] = j(""), [u, v] = j("male"), [I, O] = j("cm"), [
|
|
9790
|
+
const [t, k] = j(""), [u, v] = j("male"), [I, O] = j("cm"), [N, K] = j(""), [E, BA] = j(""), [c, hA] = j(""), [l, y] = j(""), [XA, sA] = j(""), [V, s] = j(""), [PA, RA] = j(null), [mA, dA] = j(!1), ZA = iA(null), Hf = iA(null), [m, EA] = j(!1), [TA, bA] = j(null), VA = () => {
|
|
9782
9791
|
TA === !0 && ZA.current?.click();
|
|
9783
9792
|
}, kA = async (x) => {
|
|
9784
9793
|
const q = x.target.files?.[0];
|
|
@@ -9807,7 +9816,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9807
9816
|
}
|
|
9808
9817
|
}, vA = () => {
|
|
9809
9818
|
RA(null), g?.(null), ZA.current && (ZA.current.value = "");
|
|
9810
|
-
}, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], qA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], GA = u === "female", _ = GA ? MA.female : MA.male,
|
|
9819
|
+
}, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], qA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], GA = u === "female", _ = GA ? MA.female : MA.male, uA = GA ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], WA = uA.indexOf(i), a = uA.length, X = WA === a - 1, nA = () => {
|
|
9811
9820
|
if (I === "in") {
|
|
9812
9821
|
const x = parseInt(E, 10), q = parseInt(c, 10);
|
|
9813
9822
|
!isNaN(x) && x >= 0 && !isNaN(q) && q >= 0 && K(String(Math.round((x * 12 + q) * 2.54)));
|
|
@@ -9815,8 +9824,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9815
9824
|
O("cm");
|
|
9816
9825
|
}, H = () => {
|
|
9817
9826
|
if (I === "cm") {
|
|
9818
|
-
const x = parseFloat(
|
|
9819
|
-
!isNaN(x) && x > 0 && (
|
|
9827
|
+
const x = parseFloat(N);
|
|
9828
|
+
!isNaN(x) && x > 0 && (BA(String(Math.floor(x / 2.54 / 12))), hA(String(Math.round(x / 2.54 % 12))));
|
|
9820
9829
|
}
|
|
9821
9830
|
O("in");
|
|
9822
9831
|
}, oA = () => {
|
|
@@ -9827,15 +9836,15 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9827
9836
|
const U = parseInt(E, 10), R = parseInt(c, 10);
|
|
9828
9837
|
x = !isNaN(U) && U > 0 && !isNaN(R) && R >= 0 && R <= 11;
|
|
9829
9838
|
} else {
|
|
9830
|
-
const U = parseFloat(
|
|
9839
|
+
const U = parseFloat(N);
|
|
9831
9840
|
x = !isNaN(U) && U > 0;
|
|
9832
9841
|
}
|
|
9833
9842
|
if (!x)
|
|
9834
9843
|
return s(B("Please enter a valid height")), !1;
|
|
9835
|
-
const q = parseFloat(l), QA = parseFloat(
|
|
9844
|
+
const q = parseFloat(l), QA = parseFloat(XA);
|
|
9836
9845
|
return !q || q <= 0 ? (s(B("Please enter a valid weight")), !1) : !QA || QA <= 0 ? (s(B("Please enter a valid age")), !1) : (s(""), !0);
|
|
9837
|
-
},
|
|
9838
|
-
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(
|
|
9846
|
+
}, zA = () => t.trim() ? (s(""), !0) : (s(B("Please enter a profile name")), !1), YA = () => {
|
|
9847
|
+
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N);
|
|
9839
9848
|
return {
|
|
9840
9849
|
name: t.trim(),
|
|
9841
9850
|
gender: u,
|
|
@@ -9846,7 +9855,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9846
9855
|
weightKg: parseFloat(l),
|
|
9847
9856
|
height: x,
|
|
9848
9857
|
weight: parseFloat(l),
|
|
9849
|
-
age: parseFloat(
|
|
9858
|
+
age: parseFloat(XA),
|
|
9850
9859
|
chestProfile: SA || void 0,
|
|
9851
9860
|
midsectionProfile: rA || void 0,
|
|
9852
9861
|
hipProfile: GA ? eA || void 0 : xA || void 0,
|
|
@@ -9854,7 +9863,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9854
9863
|
cupSize: GA && cf || void 0
|
|
9855
9864
|
};
|
|
9856
9865
|
}, of = () => {
|
|
9857
|
-
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(
|
|
9866
|
+
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N), q = parseFloat(l), QA = parseFloat(XA);
|
|
9858
9867
|
return {
|
|
9859
9868
|
name: t.trim(),
|
|
9860
9869
|
gender: u,
|
|
@@ -9866,7 +9875,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9866
9875
|
...QA > 0 ? { age: QA } : {},
|
|
9867
9876
|
photoBase64: PA || void 0
|
|
9868
9877
|
};
|
|
9869
|
-
},
|
|
9878
|
+
}, J = () => {
|
|
9870
9879
|
if (!(i === "identity" && !oA())) {
|
|
9871
9880
|
if (i === "chest" && !SA) {
|
|
9872
9881
|
s(B("Please pick an option"));
|
|
@@ -9889,30 +9898,30 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9889
9898
|
return;
|
|
9890
9899
|
}
|
|
9891
9900
|
if (s(""), X) {
|
|
9892
|
-
f(
|
|
9901
|
+
f(YA());
|
|
9893
9902
|
return;
|
|
9894
9903
|
}
|
|
9895
|
-
o(
|
|
9904
|
+
o(uA[WA + 1]);
|
|
9896
9905
|
}
|
|
9897
|
-
},
|
|
9906
|
+
}, gA = (x, q) => {
|
|
9898
9907
|
s(""), x === "chest" ? ff(q) : x === "stomach" ? nf(q) : x === "seat" ? Ef(q) : x === "hips" && $(q);
|
|
9899
|
-
const QA =
|
|
9908
|
+
const QA = uA.indexOf(x), U = QA === a - 1;
|
|
9900
9909
|
setTimeout(() => {
|
|
9901
9910
|
if (U) {
|
|
9902
|
-
const R =
|
|
9911
|
+
const R = YA();
|
|
9903
9912
|
x === "chest" ? R.chestProfile = q : x === "stomach" ? R.midsectionProfile = q : (x === "seat" || x === "hips") && (R.hipProfile = q), f(R);
|
|
9904
9913
|
} else
|
|
9905
|
-
o(
|
|
9914
|
+
o(uA[QA + 1]);
|
|
9906
9915
|
}, 220);
|
|
9907
9916
|
}, Bf = () => {
|
|
9908
9917
|
if (s(""), i === "identity") {
|
|
9909
9918
|
D(null);
|
|
9910
9919
|
return;
|
|
9911
9920
|
}
|
|
9912
|
-
o(
|
|
9921
|
+
o(uA[Math.max(0, WA - 1)]);
|
|
9913
9922
|
}, FA = C === "manual" && (i === "chest" || i === "stomach" || i === "seat" || i === "hips"), OA = async () => {
|
|
9914
9923
|
if (r === "name-photo") {
|
|
9915
|
-
if (!
|
|
9924
|
+
if (!zA()) return;
|
|
9916
9925
|
if (!PA) {
|
|
9917
9926
|
s(B("Please upload a photo"));
|
|
9918
9927
|
return;
|
|
@@ -9928,14 +9937,14 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9928
9937
|
return;
|
|
9929
9938
|
}
|
|
9930
9939
|
} else {
|
|
9931
|
-
const q = parseFloat(
|
|
9940
|
+
const q = parseFloat(N);
|
|
9932
9941
|
if (!q || q < 100 || q > 250) {
|
|
9933
9942
|
s(B("Please enter a valid height"));
|
|
9934
9943
|
return;
|
|
9935
9944
|
}
|
|
9936
9945
|
}
|
|
9937
9946
|
if (s(""), z("calculating"), T(!0), e && PA) {
|
|
9938
|
-
const q = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(
|
|
9947
|
+
const q = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N), QA = parseFloat(l), U = parseFloat(XA);
|
|
9939
9948
|
try {
|
|
9940
9949
|
const R = await e({
|
|
9941
9950
|
photoBase64: PA,
|
|
@@ -10046,7 +10055,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10046
10055
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${u === "female" ? " ps-active" : ""}`, onClick: () => v("female"), children: B("Female") })
|
|
10047
10056
|
] }),
|
|
10048
10057
|
/* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", children: [
|
|
10049
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick:
|
|
10058
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick: nA, children: "cm" }),
|
|
10050
10059
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick: H, children: "in" })
|
|
10051
10060
|
] })
|
|
10052
10061
|
] }),
|
|
@@ -10075,7 +10084,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10075
10084
|
type: "number",
|
|
10076
10085
|
inputMode: "numeric",
|
|
10077
10086
|
className: "ps-bp-inline-input",
|
|
10078
|
-
value:
|
|
10087
|
+
value: N,
|
|
10079
10088
|
placeholder: B("e.g. 173"),
|
|
10080
10089
|
onChange: (x) => {
|
|
10081
10090
|
K(x.target.value), s("");
|
|
@@ -10094,7 +10103,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10094
10103
|
value: E,
|
|
10095
10104
|
placeholder: "5",
|
|
10096
10105
|
onChange: (x) => {
|
|
10097
|
-
|
|
10106
|
+
BA(x.target.value), s("");
|
|
10098
10107
|
}
|
|
10099
10108
|
}
|
|
10100
10109
|
),
|
|
@@ -10144,7 +10153,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10144
10153
|
type: "number",
|
|
10145
10154
|
inputMode: "numeric",
|
|
10146
10155
|
className: "ps-bp-inline-input",
|
|
10147
|
-
value:
|
|
10156
|
+
value: XA,
|
|
10148
10157
|
placeholder: B("e.g. 30"),
|
|
10149
10158
|
onChange: (x) => {
|
|
10150
10159
|
sA(x.target.value), s("");
|
|
@@ -10164,9 +10173,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10164
10173
|
title: B("CHEST PROFILE"),
|
|
10165
10174
|
subtitle: B("Select the profile that best matches your chest breadth"),
|
|
10166
10175
|
children: [
|
|
10167
|
-
/* @__PURE__ */ A(Ff, { img: _.chest?.narrow ?? null, label: B("NARROW"), selected: SA === "narrow", onSelect: () =>
|
|
10168
|
-
/* @__PURE__ */ A(Ff, { img: _.chest?.average ?? null, label: B("AVERAGE"), selected: SA === "average", onSelect: () =>
|
|
10169
|
-
/* @__PURE__ */ A(Ff, { img: _.chest?.broad ?? null, label: B("BROAD"), selected: SA === "broad", onSelect: () =>
|
|
10176
|
+
/* @__PURE__ */ A(Ff, { img: _.chest?.narrow ?? null, label: B("NARROW"), selected: SA === "narrow", onSelect: () => gA("chest", "narrow") }),
|
|
10177
|
+
/* @__PURE__ */ A(Ff, { img: _.chest?.average ?? null, label: B("AVERAGE"), selected: SA === "average", onSelect: () => gA("chest", "average") }),
|
|
10178
|
+
/* @__PURE__ */ A(Ff, { img: _.chest?.broad ?? null, label: B("BROAD"), selected: SA === "broad", onSelect: () => gA("chest", "broad") })
|
|
10170
10179
|
]
|
|
10171
10180
|
}
|
|
10172
10181
|
),
|
|
@@ -10177,9 +10186,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10177
10186
|
title: B("STOMACH PROFILE"),
|
|
10178
10187
|
subtitle: B("Describe your mid-section silhouette"),
|
|
10179
10188
|
children: [
|
|
10180
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected: rA === "flat", onSelect: () =>
|
|
10181
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected: rA === "average", onSelect: () =>
|
|
10182
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected: rA === "round", onSelect: () =>
|
|
10189
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected: rA === "flat", onSelect: () => gA("stomach", "flat") }),
|
|
10190
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected: rA === "average", onSelect: () => gA("stomach", "average") }),
|
|
10191
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected: rA === "round", onSelect: () => gA("stomach", "round") })
|
|
10183
10192
|
]
|
|
10184
10193
|
}
|
|
10185
10194
|
),
|
|
@@ -10190,9 +10199,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10190
10199
|
title: B("BACK & SEAT"),
|
|
10191
10200
|
subtitle: B("The curvature of your lower spine and seat profile"),
|
|
10192
10201
|
children: [
|
|
10193
|
-
/* @__PURE__ */ A(Ff, { img: _.seat?.narrow ?? null, label: B("STRAIGHT"), selected: xA === "narrow", onSelect: () =>
|
|
10194
|
-
/* @__PURE__ */ A(Ff, { img: _.seat?.average ?? null, label: B("CURVED"), selected: xA === "average", onSelect: () =>
|
|
10195
|
-
/* @__PURE__ */ A(Ff, { img: _.seat?.full ?? null, label: B("DEEP"), selected: xA === "full", onSelect: () =>
|
|
10202
|
+
/* @__PURE__ */ A(Ff, { img: _.seat?.narrow ?? null, label: B("STRAIGHT"), selected: xA === "narrow", onSelect: () => gA("seat", "narrow") }),
|
|
10203
|
+
/* @__PURE__ */ A(Ff, { img: _.seat?.average ?? null, label: B("CURVED"), selected: xA === "average", onSelect: () => gA("seat", "average") }),
|
|
10204
|
+
/* @__PURE__ */ A(Ff, { img: _.seat?.full ?? null, label: B("DEEP"), selected: xA === "full", onSelect: () => gA("seat", "full") })
|
|
10196
10205
|
]
|
|
10197
10206
|
}
|
|
10198
10207
|
),
|
|
@@ -10203,9 +10212,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10203
10212
|
title: B("HIP PROFILE"),
|
|
10204
10213
|
subtitle: B("The curvature of your hips and thighs"),
|
|
10205
10214
|
children: [
|
|
10206
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.narrow ?? null, label: B("NARROW"), selected: eA === "narrow", onSelect: () =>
|
|
10207
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.average ?? null, label: B("AVERAGE"), selected: eA === "average", onSelect: () =>
|
|
10208
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.full ?? null, label: B("FULL"), selected: eA === "full", onSelect: () =>
|
|
10215
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.narrow ?? null, label: B("NARROW"), selected: eA === "narrow", onSelect: () => gA("hips", "narrow") }),
|
|
10216
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.average ?? null, label: B("AVERAGE"), selected: eA === "average", onSelect: () => gA("hips", "average") }),
|
|
10217
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.full ?? null, label: B("FULL"), selected: eA === "full", onSelect: () => gA("hips", "full") })
|
|
10209
10218
|
]
|
|
10210
10219
|
}
|
|
10211
10220
|
),
|
|
@@ -10301,7 +10310,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10301
10310
|
type: "button",
|
|
10302
10311
|
className: "ps-cpw-age-gate-btn ps-cpw-age-gate-btn-primary",
|
|
10303
10312
|
onClick: () => {
|
|
10304
|
-
|
|
10313
|
+
bA(!0), s("");
|
|
10305
10314
|
},
|
|
10306
10315
|
children: B("Yes")
|
|
10307
10316
|
}
|
|
@@ -10311,7 +10320,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10311
10320
|
{
|
|
10312
10321
|
type: "button",
|
|
10313
10322
|
className: "ps-cpw-age-gate-btn ps-cpw-age-gate-btn-secondary",
|
|
10314
|
-
onClick: () =>
|
|
10323
|
+
onClick: () => bA(!1),
|
|
10315
10324
|
children: B("No")
|
|
10316
10325
|
}
|
|
10317
10326
|
)
|
|
@@ -10325,7 +10334,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10325
10334
|
{
|
|
10326
10335
|
type: "button",
|
|
10327
10336
|
className: "ps-cpw-age-gate-btn ps-cpw-age-gate-btn-secondary",
|
|
10328
|
-
onClick: () =>
|
|
10337
|
+
onClick: () => bA(null),
|
|
10329
10338
|
children: B("Go back")
|
|
10330
10339
|
}
|
|
10331
10340
|
)
|
|
@@ -10334,9 +10343,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10334
10343
|
/* @__PURE__ */ P("div", { className: "ps-cpw-image-right", children: [
|
|
10335
10344
|
/* @__PURE__ */ A("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: /* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10336
10345
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("NAME") }),
|
|
10337
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: Hf, type: "text", className: `ps-bp-inline-input${
|
|
10346
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: Hf, type: "text", className: `ps-bp-inline-input${m ? " ps-cpw-shake" : ""}`, value: t, placeholder: B("e.g. My Photo Profile"), onChange: (x) => {
|
|
10338
10347
|
k(x.target.value), s("");
|
|
10339
|
-
}, onAnimationEnd: () =>
|
|
10348
|
+
}, onAnimationEnd: () => EA(!1) }) })
|
|
10340
10349
|
] }) }),
|
|
10341
10350
|
/* @__PURE__ */ P("div", { className: "ps-cpw-photo-guide", children: [
|
|
10342
10351
|
/* @__PURE__ */ A("div", { className: "ps-cpw-photo-guide-title", children: B("HOW TO TAKE A GOOD PHOTO") }),
|
|
@@ -10375,20 +10384,20 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10375
10384
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-sub", children: B("Enter your details for accurate body estimation") })
|
|
10376
10385
|
] }),
|
|
10377
10386
|
/* @__PURE__ */ A("div", { className: "ps-cpw-pill-row", style: { marginBottom: "0.8vw" }, children: /* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", children: [
|
|
10378
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick:
|
|
10387
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick: nA, children: "cm" }),
|
|
10379
10388
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick: H, children: "in" })
|
|
10380
10389
|
] }) }),
|
|
10381
10390
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
10382
10391
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10383
10392
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("HEIGHT") }),
|
|
10384
10393
|
I === "cm" ? /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10385
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
10394
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: N, placeholder: B("e.g. 173"), onChange: (x) => {
|
|
10386
10395
|
K(x.target.value), s("");
|
|
10387
10396
|
} }),
|
|
10388
10397
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
10389
10398
|
] }) : /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
|
|
10390
10399
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: E, placeholder: "5", onChange: (x) => {
|
|
10391
|
-
|
|
10400
|
+
BA(x.target.value), s("");
|
|
10392
10401
|
} }),
|
|
10393
10402
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
10394
10403
|
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: c, placeholder: "8", onChange: (x) => {
|
|
@@ -10409,7 +10418,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10409
10418
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10410
10419
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("AGE") }),
|
|
10411
10420
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10412
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
10421
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: XA, placeholder: B("e.g. 30"), onChange: (x) => {
|
|
10413
10422
|
sA(x.target.value), s("");
|
|
10414
10423
|
} }),
|
|
10415
10424
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: B("years") })
|
|
@@ -10461,7 +10470,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10461
10470
|
] }),
|
|
10462
10471
|
/* @__PURE__ */ P("div", { className: "ps-cpw-footer", children: [
|
|
10463
10472
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-back-btn", onClick: LA, children: C == null ? B("Cancel") : `← ${B("Back")}` }),
|
|
10464
|
-
C === "manual" && !FA && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick:
|
|
10473
|
+
C === "manual" && !FA && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: J, children: B(X ? "CALCULATE MY FIT" : "Continue") }),
|
|
10465
10474
|
C === "image" && r === "name-photo" && /* @__PURE__ */ A(
|
|
10466
10475
|
"button",
|
|
10467
10476
|
{
|
|
@@ -10469,7 +10478,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10469
10478
|
className: "ps-cpw-next-btn",
|
|
10470
10479
|
onClick: () => {
|
|
10471
10480
|
if (!t.trim()) {
|
|
10472
|
-
|
|
10481
|
+
EA(!0), Hf.current?.focus();
|
|
10473
10482
|
return;
|
|
10474
10483
|
}
|
|
10475
10484
|
OA();
|
|
@@ -10520,33 +10529,33 @@ function A8({
|
|
|
10520
10529
|
const z = f.gender === "female" ? VB : WB, p = f.measurements || {}, T = Object.keys(p).some((K) => p[K] != null), [F, h] = j(f.measurementsUnit || "cm"), [W, t] = j(() => {
|
|
10521
10530
|
const K = {};
|
|
10522
10531
|
return z.forEach((E) => {
|
|
10523
|
-
const
|
|
10524
|
-
K[E.key] =
|
|
10532
|
+
const BA = p[E.key];
|
|
10533
|
+
K[E.key] = BA != null ? String(Math.round(BA * 10) / 10) : "";
|
|
10525
10534
|
}), K;
|
|
10526
10535
|
});
|
|
10527
10536
|
JA(() => {
|
|
10528
10537
|
t((K) => {
|
|
10529
10538
|
const E = { ...K };
|
|
10530
|
-
let
|
|
10539
|
+
let BA = !1;
|
|
10531
10540
|
return z.forEach((c) => {
|
|
10532
10541
|
const hA = p[c.key];
|
|
10533
|
-
hA != null && !K[c.key] && (E[c.key] = String(Math.round(hA * 10) / 10),
|
|
10534
|
-
}),
|
|
10542
|
+
hA != null && !K[c.key] && (E[c.key] = String(Math.round(hA * 10) / 10), BA = !0);
|
|
10543
|
+
}), BA ? E : K;
|
|
10535
10544
|
});
|
|
10536
10545
|
}, [f.measurements, f.id]);
|
|
10537
10546
|
const [k, u] = j(f.bandSize || ""), [v, I] = j(f.cupSize || ""), O = (K) => {
|
|
10538
10547
|
K !== F && (t((E) => {
|
|
10539
|
-
const
|
|
10548
|
+
const BA = {};
|
|
10540
10549
|
for (const [c, hA] of Object.entries(E)) {
|
|
10541
10550
|
const l = parseFloat(hA);
|
|
10542
|
-
!isNaN(l) && l > 0 ?
|
|
10551
|
+
!isNaN(l) && l > 0 ? BA[c] = String(K === "in" ? Math.round(l / 2.54 * 10) / 10 : Math.round(l * 2.54 * 10) / 10) : BA[c] = hA;
|
|
10543
10552
|
}
|
|
10544
|
-
return
|
|
10553
|
+
return BA;
|
|
10545
10554
|
}), h(K));
|
|
10546
|
-
},
|
|
10555
|
+
}, N = () => {
|
|
10547
10556
|
const K = { ...f.measurements || {} };
|
|
10548
|
-
for (const [E,
|
|
10549
|
-
const c = parseFloat(
|
|
10557
|
+
for (const [E, BA] of Object.entries(W)) {
|
|
10558
|
+
const c = parseFloat(BA);
|
|
10550
10559
|
!isNaN(c) && c > 0 && (K[E] = c);
|
|
10551
10560
|
}
|
|
10552
10561
|
e(K, F), f.gender === "female" && i && (k || v) && i(k, v), D();
|
|
@@ -10586,11 +10595,11 @@ function A8({
|
|
|
10586
10595
|
] }) }),
|
|
10587
10596
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-list", children: [
|
|
10588
10597
|
z.map((K) => {
|
|
10589
|
-
const E = p[K.key],
|
|
10598
|
+
const E = p[K.key], BA = o && E == null && !W[K.key];
|
|
10590
10599
|
return /* @__PURE__ */ P("div", { className: `ps-pmv-measure-row${E == null ? " ps-loading" : ""}`, children: [
|
|
10591
10600
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: K.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
10592
10601
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: r(K.label) }),
|
|
10593
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children:
|
|
10602
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: BA ? /* @__PURE__ */ P("span", { style: { display: "inline-flex", alignItems: "center", gap: "0.4vw" }, children: [
|
|
10594
10603
|
/* @__PURE__ */ A("span", { className: "ps-tryon-size-loading-spinner", style: { width: "0.8vw", height: "0.8vw", borderWidth: "1.5px" } }),
|
|
10595
10604
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: r("calculating...") })
|
|
10596
10605
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
@@ -10655,7 +10664,7 @@ function A8({
|
|
|
10655
10664
|
{
|
|
10656
10665
|
type: "button",
|
|
10657
10666
|
className: "ps-pmv-btn-primary",
|
|
10658
|
-
onClick:
|
|
10667
|
+
onClick: N,
|
|
10659
10668
|
children: T ? r("SAVE") : /* @__PURE__ */ P(tA, { children: [
|
|
10660
10669
|
/* @__PURE__ */ A("span", { className: "ps-pmv-btn-spinner" }),
|
|
10661
10670
|
r("CALCULATING")
|
|
@@ -10834,8 +10843,8 @@ function g8({
|
|
|
10834
10843
|
try {
|
|
10835
10844
|
const O = localStorage.getItem("primestyle_profiles");
|
|
10836
10845
|
if (O) {
|
|
10837
|
-
const
|
|
10838
|
-
|
|
10846
|
+
const N = JSON.parse(O);
|
|
10847
|
+
N.length > 0 && (I = N[0].id ?? null);
|
|
10839
10848
|
}
|
|
10840
10849
|
} catch {
|
|
10841
10850
|
}
|
|
@@ -10915,18 +10924,18 @@ function w8({
|
|
|
10915
10924
|
fastPathLabel: v,
|
|
10916
10925
|
activeProfileName: I,
|
|
10917
10926
|
onStartFresh: O,
|
|
10918
|
-
hidePhotoOptions:
|
|
10927
|
+
hidePhotoOptions: N = !1,
|
|
10919
10928
|
error: K,
|
|
10920
10929
|
t: E
|
|
10921
10930
|
}) {
|
|
10922
|
-
const
|
|
10931
|
+
const BA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(i) || 8), hA = Math.floor(c / 12), l = c % 12, y = parseFloat(r) || (n === "kg" ? 70 : 154), XA = parseFloat(p) || 30, sA = n === "kg" ? 30 : 66, V = n === "kg" ? 200 : 440, s = 120, PA = 220, RA = 48, mA = 84, dA = 13, ZA = 100, Hf = (BA - s) / (PA - s) * 100, m = (c - RA) / (mA - RA) * 100, EA = (y - sA) / (V - sA) * 100, TA = (XA - dA) / (ZA - dA) * 100, bA = (nf) => {
|
|
10923
10932
|
const xA = Math.max(RA, Math.min(mA, nf));
|
|
10924
10933
|
D(String(Math.floor(xA / 12))), o(String(xA % 12));
|
|
10925
10934
|
}, VA = () => {
|
|
10926
|
-
f === "in" ?
|
|
10935
|
+
f === "in" ? bA(c + 1) : B(String(Math.min(PA, BA + 1)));
|
|
10927
10936
|
}, kA = () => {
|
|
10928
|
-
f === "in" ?
|
|
10929
|
-
}, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA,
|
|
10937
|
+
f === "in" ? bA(c - 1) : B(String(Math.max(s, BA - 1)));
|
|
10938
|
+
}, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA, XA + 1))), rA = () => T(String(Math.max(dA, XA - 1)));
|
|
10930
10939
|
return /* @__PURE__ */ P("div", { className: "ps-bpm-root", children: [
|
|
10931
10940
|
/* @__PURE__ */ P("div", { className: "ps-bpm-header", children: [
|
|
10932
10941
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: E("Body Measurements") }),
|
|
@@ -10965,7 +10974,7 @@ function w8({
|
|
|
10965
10974
|
/* @__PURE__ */ P("div", { className: "ps-bpm-row", children: [
|
|
10966
10975
|
/* @__PURE__ */ P("div", { className: "ps-bpm-row-top", children: [
|
|
10967
10976
|
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: E("HEIGHT") }),
|
|
10968
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-value-display", children: f === "in" ? `${hA}ft ${l}in` : `${Math.round(
|
|
10977
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-value-display", children: f === "in" ? `${hA}ft ${l}in` : `${Math.round(BA)} cm` })
|
|
10969
10978
|
] }),
|
|
10970
10979
|
/* @__PURE__ */ P("div", { className: "ps-bpm-slider-row", children: [
|
|
10971
10980
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: kA, "aria-label": E("Decrease"), children: /* @__PURE__ */ A(OP, {}) }),
|
|
@@ -10978,8 +10987,8 @@ function w8({
|
|
|
10978
10987
|
max: mA,
|
|
10979
10988
|
step: 1,
|
|
10980
10989
|
value: c,
|
|
10981
|
-
onChange: (nf) =>
|
|
10982
|
-
style: { "--ps-pct": `${
|
|
10990
|
+
onChange: (nf) => bA(parseInt(nf.target.value, 10)),
|
|
10991
|
+
style: { "--ps-pct": `${m}%` }
|
|
10983
10992
|
}
|
|
10984
10993
|
) : /* @__PURE__ */ A(
|
|
10985
10994
|
"input",
|
|
@@ -10989,7 +10998,7 @@ function w8({
|
|
|
10989
10998
|
min: s,
|
|
10990
10999
|
max: PA,
|
|
10991
11000
|
step: 1,
|
|
10992
|
-
value:
|
|
11001
|
+
value: BA,
|
|
10993
11002
|
onChange: (nf) => B(nf.target.value),
|
|
10994
11003
|
style: { "--ps-pct": `${Hf}%` }
|
|
10995
11004
|
}
|
|
@@ -11018,7 +11027,7 @@ function w8({
|
|
|
11018
11027
|
step: 1,
|
|
11019
11028
|
value: y,
|
|
11020
11029
|
onChange: (nf) => z(nf.target.value),
|
|
11021
|
-
style: { "--ps-pct": `${
|
|
11030
|
+
style: { "--ps-pct": `${EA}%` }
|
|
11022
11031
|
}
|
|
11023
11032
|
),
|
|
11024
11033
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: vA, "aria-label": E("Increase"), children: /* @__PURE__ */ A(KP, {}) })
|
|
@@ -11028,7 +11037,7 @@ function w8({
|
|
|
11028
11037
|
/* @__PURE__ */ P("div", { className: "ps-bpm-row-top", children: [
|
|
11029
11038
|
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: E("AGE") }),
|
|
11030
11039
|
/* @__PURE__ */ P("span", { className: "ps-bpm-value-display", children: [
|
|
11031
|
-
Math.round(
|
|
11040
|
+
Math.round(XA),
|
|
11032
11041
|
" ",
|
|
11033
11042
|
E("YEARS")
|
|
11034
11043
|
] })
|
|
@@ -11043,7 +11052,7 @@ function w8({
|
|
|
11043
11052
|
min: dA,
|
|
11044
11053
|
max: ZA,
|
|
11045
11054
|
step: 1,
|
|
11046
|
-
value:
|
|
11055
|
+
value: XA,
|
|
11047
11056
|
onChange: (nf) => T(nf.target.value),
|
|
11048
11057
|
style: { "--ps-pct": `${TA}%` }
|
|
11049
11058
|
}
|
|
@@ -11052,7 +11061,7 @@ function w8({
|
|
|
11052
11061
|
] })
|
|
11053
11062
|
] })
|
|
11054
11063
|
] }),
|
|
11055
|
-
!
|
|
11064
|
+
!N && /* @__PURE__ */ P(tA, { children: [
|
|
11056
11065
|
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: E("or") }) }),
|
|
11057
11066
|
/* @__PURE__ */ P(
|
|
11058
11067
|
"button",
|
|
@@ -11081,7 +11090,7 @@ function w8({
|
|
|
11081
11090
|
children: v || E("Next")
|
|
11082
11091
|
}
|
|
11083
11092
|
),
|
|
11084
|
-
!
|
|
11093
|
+
!N && /* @__PURE__ */ A(
|
|
11085
11094
|
PP,
|
|
11086
11095
|
{
|
|
11087
11096
|
mode: "manual",
|
|
@@ -11386,48 +11395,48 @@ function z8({
|
|
|
11386
11395
|
onBack: u,
|
|
11387
11396
|
t: v
|
|
11388
11397
|
}) {
|
|
11389
|
-
const I = g ? r8 : t8, [O,
|
|
11398
|
+
const I = g ? r8 : t8, [O, N] = j("basics");
|
|
11390
11399
|
O === "photo" || I.indexOf(O);
|
|
11391
|
-
const K = NP(), E = Yn(B),
|
|
11400
|
+
const K = NP(), E = Yn(B), BA = k?.height, c = k?.weight, hA = k?.age, l = k?.heightUnit === "ft" ? "in" : k?.heightUnit, y = k?.weightUnit, XA = BA != null && l === "cm" ? String(Math.round(BA)) : BA != null && (l === "in" || l === "ft") ? String(Math.round(BA * 2.54)) : e.current.height || "173", sA = BA != null && (l === "in" || l === "ft") ? Math.round(BA) : BA != null && l === "cm" ? Math.round(BA / 2.54) : null, V = sA != null ? String(Math.floor(sA / 12)) : e.current.heightFeet || "5", s = sA != null ? String(sA % 12) : e.current.heightInches || "8", PA = c != null ? String(Math.round(c)) : e.current.weight || (E ? "154" : "70"), RA = hA != null ? String(hA) : e.current.age || "30", [mA, dA] = j(XA), [ZA, Hf] = j(V), [m, EA] = j(s), [TA, bA] = j(PA), [VA, kA] = j(RA), [vA, SA] = j(
|
|
11392
11401
|
l || (C === "ft" ? "in" : C || (E ? "in" : "cm"))
|
|
11393
11402
|
), [ff, rA] = j(
|
|
11394
11403
|
y || i || (E ? "lbs" : "kg")
|
|
11395
|
-
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = iA(null), [qA, GA] = j(null), [_,
|
|
11396
|
-
const
|
|
11397
|
-
if (!
|
|
11404
|
+
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = iA(null), [qA, GA] = j(null), [_, uA] = j(() => sA != null ? String(Math.round(sA * 2.54)) : XA), [WA, a] = j(null), [X, nA] = j(null), [H, oA] = j(null), [zA, YA] = j(null), [of, J] = j(""), [gA, Bf] = j(null), [FA, OA] = j(null), [AA, LA] = j(() => ["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"), [Pf, lA] = j(!1), x = pn[AA] || pn.US, [q, QA] = j(""), U = UA(async (M) => {
|
|
11405
|
+
const cA = M.target.files?.[0];
|
|
11406
|
+
if (!cA) return;
|
|
11398
11407
|
if (qA !== !0) {
|
|
11399
11408
|
QA(v("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
11400
11409
|
return;
|
|
11401
11410
|
}
|
|
11402
|
-
if (!
|
|
11411
|
+
if (!cA.type.startsWith("image/")) {
|
|
11403
11412
|
QA(v("Please upload an image file"));
|
|
11404
11413
|
return;
|
|
11405
11414
|
}
|
|
11406
|
-
if (
|
|
11415
|
+
if (cA.size > 10 * 1024 * 1024) {
|
|
11407
11416
|
QA(v("Image must be under 10MB"));
|
|
11408
11417
|
return;
|
|
11409
11418
|
}
|
|
11410
|
-
QA(""), Mf(!0), Ef(
|
|
11411
|
-
const
|
|
11412
|
-
$(
|
|
11419
|
+
QA(""), Mf(!0), Ef(cA);
|
|
11420
|
+
const pA = URL.createObjectURL(cA);
|
|
11421
|
+
$(pA);
|
|
11413
11422
|
try {
|
|
11414
|
-
const tf = await AP(
|
|
11423
|
+
const tf = await AP(cA);
|
|
11415
11424
|
Of(tf);
|
|
11416
11425
|
} catch {
|
|
11417
11426
|
QA(v("Failed to process image")), $(null);
|
|
11418
11427
|
} finally {
|
|
11419
11428
|
Mf(!1);
|
|
11420
11429
|
}
|
|
11421
|
-
}, [v, qA]), R =
|
|
11430
|
+
}, [v, qA]), R = UA(() => {
|
|
11422
11431
|
eA && URL.revokeObjectURL(eA), Ef(null), $(null), Of(null), gf.current && (gf.current.value = "");
|
|
11423
|
-
}, [eA]), G =
|
|
11432
|
+
}, [eA]), G = UA(() => {
|
|
11424
11433
|
if (vA === "in") {
|
|
11425
|
-
const
|
|
11426
|
-
if (!
|
|
11434
|
+
const cA = parseFloat(ZA);
|
|
11435
|
+
if (!cA || cA < 3 || cA > 8)
|
|
11427
11436
|
return QA(v("Please enter a valid height")), !1;
|
|
11428
11437
|
} else {
|
|
11429
|
-
const
|
|
11430
|
-
if (!
|
|
11438
|
+
const cA = parseFloat(mA);
|
|
11439
|
+
if (!cA || cA < 100 || cA > 250)
|
|
11431
11440
|
return QA(v("Please enter a valid height (100-250 cm)")), !1;
|
|
11432
11441
|
}
|
|
11433
11442
|
const M = parseFloat(TA);
|
|
@@ -11440,19 +11449,19 @@ function z8({
|
|
|
11440
11449
|
}, [vA, ff, mA, ZA, TA, v]), S = () => {
|
|
11441
11450
|
let M;
|
|
11442
11451
|
if (vA === "in") {
|
|
11443
|
-
const
|
|
11444
|
-
M =
|
|
11452
|
+
const cA = parseFloat(ZA) || 0, pA = parseFloat(m) || 0;
|
|
11453
|
+
M = cA * 12 + pA;
|
|
11445
11454
|
} else
|
|
11446
11455
|
M = parseFloat(mA);
|
|
11447
11456
|
return { heightVal: M, weightVal: parseFloat(TA) };
|
|
11448
11457
|
}, aA = g ? "female" : "male", fA = (M) => {
|
|
11449
|
-
const
|
|
11450
|
-
return
|
|
11458
|
+
const cA = I.indexOf(M);
|
|
11459
|
+
return cA < I.length - 1 ? I[cA + 1] : "submit";
|
|
11451
11460
|
}, NA = () => {
|
|
11452
|
-
const { heightVal: M, weightVal:
|
|
11453
|
-
e.current.height = String(M), e.current.weight = String(
|
|
11461
|
+
const { heightVal: M, weightVal: cA } = S();
|
|
11462
|
+
e.current.height = String(M), e.current.weight = String(cA), e.current.gender = aA, VA && (e.current.age = VA), D(vA), o(ff), p({
|
|
11454
11463
|
height: M,
|
|
11455
|
-
weight:
|
|
11464
|
+
weight: cA,
|
|
11456
11465
|
heightUnit: vA,
|
|
11457
11466
|
weightUnit: ff,
|
|
11458
11467
|
gender: aA,
|
|
@@ -11461,29 +11470,29 @@ function z8({
|
|
|
11461
11470
|
midsectionProfile: X,
|
|
11462
11471
|
hipProfile: H,
|
|
11463
11472
|
bodyImage: _A || void 0,
|
|
11464
|
-
bandSize:
|
|
11473
|
+
bandSize: gA || void 0,
|
|
11465
11474
|
cupSize: FA || void 0
|
|
11466
11475
|
});
|
|
11467
|
-
}, $A =
|
|
11476
|
+
}, $A = UA(() => {
|
|
11468
11477
|
if (O === "basics") {
|
|
11469
11478
|
if (!G()) return;
|
|
11470
|
-
|
|
11479
|
+
N(fA("basics"));
|
|
11471
11480
|
} else if (O === "chest") {
|
|
11472
11481
|
if (!WA) return;
|
|
11473
|
-
|
|
11482
|
+
N(fA("chest"));
|
|
11474
11483
|
} else if (O === "midsection") {
|
|
11475
11484
|
if (!X) return;
|
|
11476
|
-
|
|
11485
|
+
N(fA("midsection"));
|
|
11477
11486
|
} else if (O === "seat") {
|
|
11478
|
-
if (!
|
|
11487
|
+
if (!zA) return;
|
|
11479
11488
|
const M = fA("seat");
|
|
11480
|
-
M === "submit" ? NA() :
|
|
11489
|
+
M === "submit" ? NA() : N(M);
|
|
11481
11490
|
} else if (O === "hips") {
|
|
11482
11491
|
if (!H) return;
|
|
11483
11492
|
const M = fA("hips");
|
|
11484
|
-
M === "submit" ? NA() :
|
|
11493
|
+
M === "submit" ? NA() : N(M);
|
|
11485
11494
|
} else if (O === "bra") {
|
|
11486
|
-
if (!
|
|
11495
|
+
if (!gA || !FA) {
|
|
11487
11496
|
QA(v("Please select both band and cup size"));
|
|
11488
11497
|
return;
|
|
11489
11498
|
}
|
|
@@ -11507,19 +11516,19 @@ function z8({
|
|
|
11507
11516
|
gender: aA
|
|
11508
11517
|
});
|
|
11509
11518
|
}
|
|
11510
|
-
}, [O, I, G, WA, X, H,
|
|
11511
|
-
const
|
|
11512
|
-
return
|
|
11513
|
-
}, yA =
|
|
11519
|
+
}, [O, I, G, WA, X, H, zA, gA, FA, vA, ff, mA, ZA, m, TA, VA, _A, xA, _, e, D, o, p, T, g, aA, F, h]), ef = (M) => {
|
|
11520
|
+
const cA = I.indexOf(M);
|
|
11521
|
+
return cA > 0 ? I[cA - 1] : null;
|
|
11522
|
+
}, yA = UA(() => {
|
|
11514
11523
|
if (QA(""), O === "basics")
|
|
11515
11524
|
u();
|
|
11516
11525
|
else if (O === "photo")
|
|
11517
|
-
|
|
11526
|
+
N("basics");
|
|
11518
11527
|
else {
|
|
11519
11528
|
const M = ef(O);
|
|
11520
|
-
M ?
|
|
11529
|
+
M ? N(M) : u();
|
|
11521
11530
|
}
|
|
11522
|
-
}, [O, I, u]), KA = O === "basics" ? !0 : O === "chest" ? !!WA : O === "midsection" ? !!X : O === "seat" ? !!
|
|
11531
|
+
}, [O, I, u]), KA = O === "basics" ? !0 : O === "chest" ? !!WA : O === "midsection" ? !!X : O === "seat" ? !!zA : O === "hips" ? !!H : O === "bra" ? !!(gA && FA) : O === "photo", vf = O === I[I.length - 1];
|
|
11523
11532
|
return O === "photo" ? K ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
11524
11533
|
Zn,
|
|
11525
11534
|
{
|
|
@@ -11527,10 +11536,10 @@ function z8({
|
|
|
11527
11536
|
handlePhotoSelect: U,
|
|
11528
11537
|
handleRemovePhoto: R,
|
|
11529
11538
|
onAnalyze: $A,
|
|
11530
|
-
onSwitchToManual: () =>
|
|
11539
|
+
onSwitchToManual: () => N("basics"),
|
|
11531
11540
|
error: q,
|
|
11532
11541
|
photoStepHeight: _,
|
|
11533
|
-
onPhotoStepHeightChange:
|
|
11542
|
+
onPhotoStepHeightChange: uA,
|
|
11534
11543
|
ageConfirmed: qA,
|
|
11535
11544
|
onAgeConfirmedChange: (M) => {
|
|
11536
11545
|
GA(M), M === !0 && QA("");
|
|
@@ -11795,7 +11804,7 @@ function z8({
|
|
|
11795
11804
|
PP,
|
|
11796
11805
|
{
|
|
11797
11806
|
mode: "scan",
|
|
11798
|
-
onSwitchToManual: () =>
|
|
11807
|
+
onSwitchToManual: () => N("basics"),
|
|
11799
11808
|
onSwitchToScan: () => {
|
|
11800
11809
|
},
|
|
11801
11810
|
t: v
|
|
@@ -11834,16 +11843,16 @@ function z8({
|
|
|
11834
11843
|
O === "basics" && (() => {
|
|
11835
11844
|
const M = () => {
|
|
11836
11845
|
if (vA === "in") {
|
|
11837
|
-
const
|
|
11838
|
-
dA(String(Math.round(
|
|
11846
|
+
const pA = (parseFloat(ZA) || 5) * 12 + (parseFloat(m) || 8);
|
|
11847
|
+
dA(String(Math.round(pA * 2.54)));
|
|
11839
11848
|
}
|
|
11840
|
-
ff === "lbs" && TA &&
|
|
11841
|
-
},
|
|
11849
|
+
ff === "lbs" && TA && bA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"), rA("kg"), D("cm"), o("kg"), z?.("cm");
|
|
11850
|
+
}, cA = () => {
|
|
11842
11851
|
if (vA === "cm") {
|
|
11843
|
-
const
|
|
11844
|
-
Hf(String(Math.floor(tf / 12))),
|
|
11852
|
+
const pA = parseFloat(mA) || 173, tf = Math.round(pA / 2.54);
|
|
11853
|
+
Hf(String(Math.floor(tf / 12))), EA(String(tf % 12));
|
|
11845
11854
|
}
|
|
11846
|
-
ff === "kg" && TA &&
|
|
11855
|
+
ff === "kg" && TA && bA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"), rA("lbs"), D("in"), o("lbs"), z?.("in");
|
|
11847
11856
|
};
|
|
11848
11857
|
return K ? /* @__PURE__ */ A(
|
|
11849
11858
|
w8,
|
|
@@ -11855,16 +11864,16 @@ function z8({
|
|
|
11855
11864
|
setHeight: dA,
|
|
11856
11865
|
heightFeet: ZA,
|
|
11857
11866
|
setHeightFeet: Hf,
|
|
11858
|
-
heightInches:
|
|
11859
|
-
setHeightInches:
|
|
11867
|
+
heightInches: m,
|
|
11868
|
+
setHeightInches: EA,
|
|
11860
11869
|
weight: TA,
|
|
11861
|
-
setWeight:
|
|
11870
|
+
setWeight: bA,
|
|
11862
11871
|
age: VA,
|
|
11863
11872
|
setAge: kA,
|
|
11864
11873
|
switchToMetric: M,
|
|
11865
|
-
switchToImperial:
|
|
11866
|
-
onUploadPhoto: () =>
|
|
11867
|
-
onSwitchToScan: () =>
|
|
11874
|
+
switchToImperial: cA,
|
|
11875
|
+
onUploadPhoto: () => N("photo"),
|
|
11876
|
+
onSwitchToScan: () => N("photo"),
|
|
11868
11877
|
hidePhotoOptions: F,
|
|
11869
11878
|
onNext: F && h ? h : $A,
|
|
11870
11879
|
canProceed: !0,
|
|
@@ -11888,37 +11897,37 @@ function z8({
|
|
|
11888
11897
|
] }),
|
|
11889
11898
|
/* @__PURE__ */ P("div", { className: "ps-bp-system-toggle", children: [
|
|
11890
11899
|
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${nf ? "" : " ps-bp-system-active"}`, onClick: M, type: "button", children: v("Metric") }),
|
|
11891
|
-
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${nf ? " ps-bp-system-active" : ""}`, onClick:
|
|
11900
|
+
/* @__PURE__ */ A("button", { className: `ps-bp-system-btn${nf ? " ps-bp-system-active" : ""}`, onClick: cA, type: "button", children: v("Imperial") })
|
|
11892
11901
|
] }),
|
|
11893
11902
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-fields", children: [
|
|
11894
11903
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
11895
11904
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("HEIGHT") }),
|
|
11896
11905
|
vA === "in" ? /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11897
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: ZA, onChange: (
|
|
11906
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: ZA, onChange: (pA) => Hf(pA.target.value), min: 3, max: 8 }),
|
|
11898
11907
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
11899
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value:
|
|
11908
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: m, onChange: (pA) => EA(pA.target.value), min: 0, max: 11 }),
|
|
11900
11909
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
11901
11910
|
] }) : /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11902
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (
|
|
11911
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (pA) => dA(pA.target.value), min: 100, max: 250 }),
|
|
11903
11912
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
11904
11913
|
] })
|
|
11905
11914
|
] }),
|
|
11906
11915
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
11907
11916
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("WEIGHT") }),
|
|
11908
11917
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11909
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: ff === "kg" ? "75" : "165", value: TA, onChange: (
|
|
11918
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: ff === "kg" ? "75" : "165", value: TA, onChange: (pA) => bA(pA.target.value), min: ff === "kg" ? 30 : 66, max: ff === "kg" ? 300 : 660 }),
|
|
11910
11919
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: ff })
|
|
11911
11920
|
] })
|
|
11912
11921
|
] }),
|
|
11913
11922
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
11914
11923
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("AGE") }),
|
|
11915
11924
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11916
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: VA, onChange: (
|
|
11925
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "30", value: VA, onChange: (pA) => kA(pA.target.value), min: 13, max: 100 }),
|
|
11917
11926
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: v("years") })
|
|
11918
11927
|
] })
|
|
11919
11928
|
] })
|
|
11920
11929
|
] }),
|
|
11921
|
-
/* @__PURE__ */ P("button", { className: "ps-bp-photo-cta", onClick: () =>
|
|
11930
|
+
/* @__PURE__ */ P("button", { className: "ps-bp-photo-cta", onClick: () => N("photo"), type: "button", children: [
|
|
11922
11931
|
/* @__PURE__ */ A(i8, {}),
|
|
11923
11932
|
/* @__PURE__ */ A("span", { children: v("Or upload a photo for AI sizing") }),
|
|
11924
11933
|
/* @__PURE__ */ A("span", { className: "ps-bp-photo-cta-arrow", children: "→" })
|
|
@@ -11945,9 +11954,9 @@ function z8({
|
|
|
11945
11954
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
11946
11955
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your chest?") }),
|
|
11947
11956
|
/* @__PURE__ */ P("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: [
|
|
11948
|
-
/* @__PURE__ */ A(rf, { img: MA.male.chest.narrow, label: v("Narrow"), selected: WA === "narrow", onSelect: () => a("narrow"), onHover: () =>
|
|
11949
|
-
/* @__PURE__ */ A(rf, { img: MA.male.chest.average, label: v("Average"), selected: WA === "average", onSelect: () => a("average"), onHover: () =>
|
|
11950
|
-
/* @__PURE__ */ A(rf, { img: MA.male.chest.broad, label: v("Broad"), selected: WA === "broad", onSelect: () => a("broad"), onHover: () =>
|
|
11957
|
+
/* @__PURE__ */ A(rf, { img: MA.male.chest.narrow, label: v("Narrow"), selected: WA === "narrow", onSelect: () => a("narrow"), onHover: () => J(v("A slimmer, narrower chest build")), onLeave: () => J("") }),
|
|
11958
|
+
/* @__PURE__ */ A(rf, { img: MA.male.chest.average, label: v("Average"), selected: WA === "average", onSelect: () => a("average"), onHover: () => J(v("A moderate, proportionate chest")), onLeave: () => J("") }),
|
|
11959
|
+
/* @__PURE__ */ A(rf, { img: MA.male.chest.broad, label: v("Broad"), selected: WA === "broad", onSelect: () => a("broad"), onHover: () => J(v("A wider, more muscular chest")), onLeave: () => J("") })
|
|
11951
11960
|
] }),
|
|
11952
11961
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
11953
11962
|
] }, "step-chest")),
|
|
@@ -11967,20 +11976,20 @@ function z8({
|
|
|
11967
11976
|
{ value: "round", label: v("Full"), img: MA.male.stomach.round }
|
|
11968
11977
|
],
|
|
11969
11978
|
selected: X,
|
|
11970
|
-
onSelect: (M) =>
|
|
11979
|
+
onSelect: (M) => nA(M),
|
|
11971
11980
|
t: v
|
|
11972
11981
|
},
|
|
11973
11982
|
"step-midsection-mobile"
|
|
11974
11983
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
11975
11984
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your midsection?") }),
|
|
11976
11985
|
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(tA, { children: [
|
|
11977
|
-
/* @__PURE__ */ A(rf, { img: MA.female.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () =>
|
|
11978
|
-
/* @__PURE__ */ A(rf, { img: MA.female.stomach.average, label: v("Average"), selected: X === "average", onSelect: () =>
|
|
11979
|
-
/* @__PURE__ */ A(rf, { img: MA.female.stomach.round, label: v("Full"), selected: X === "round", onSelect: () =>
|
|
11986
|
+
/* @__PURE__ */ A(rf, { img: MA.female.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () => nA("flat"), onHover: () => J(v("A flatter midsection with minimal protrusion")), onLeave: () => J("") }),
|
|
11987
|
+
/* @__PURE__ */ A(rf, { img: MA.female.stomach.average, label: v("Average"), selected: X === "average", onSelect: () => nA("average"), onHover: () => J(v("A moderate, natural midsection shape")), onLeave: () => J("") }),
|
|
11988
|
+
/* @__PURE__ */ A(rf, { img: MA.female.stomach.round, label: v("Full"), selected: X === "round", onSelect: () => nA("round"), onHover: () => J(v("A fuller, more rounded midsection")), onLeave: () => J("") })
|
|
11980
11989
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
11981
|
-
/* @__PURE__ */ A(rf, { img: MA.male.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () =>
|
|
11982
|
-
/* @__PURE__ */ A(rf, { img: MA.male.stomach.average, label: v("Average"), selected: X === "average", onSelect: () =>
|
|
11983
|
-
/* @__PURE__ */ A(rf, { img: MA.male.stomach.round, label: v("Full"), selected: X === "round", onSelect: () =>
|
|
11990
|
+
/* @__PURE__ */ A(rf, { img: MA.male.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () => nA("flat"), onHover: () => J(v("A flatter midsection with minimal protrusion")), onLeave: () => J("") }),
|
|
11991
|
+
/* @__PURE__ */ A(rf, { img: MA.male.stomach.average, label: v("Average"), selected: X === "average", onSelect: () => nA("average"), onHover: () => J(v("A moderate, natural midsection shape")), onLeave: () => J("") }),
|
|
11992
|
+
/* @__PURE__ */ A(rf, { img: MA.male.stomach.round, label: v("Full"), selected: X === "round", onSelect: () => nA("round"), onHover: () => J(v("A fuller, more rounded midsection")), onLeave: () => J("") })
|
|
11984
11993
|
] }) }),
|
|
11985
11994
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
11986
11995
|
] }, "step-midsection")),
|
|
@@ -11999,21 +12008,21 @@ function z8({
|
|
|
11999
12008
|
{ value: "average", label: v("Average"), img: MA.male.seat.average },
|
|
12000
12009
|
{ value: "full", label: v("Full"), img: MA.male.seat.full }
|
|
12001
12010
|
],
|
|
12002
|
-
selected:
|
|
12003
|
-
onSelect: (M) =>
|
|
12011
|
+
selected: zA,
|
|
12012
|
+
onSelect: (M) => YA(M),
|
|
12004
12013
|
t: v
|
|
12005
12014
|
},
|
|
12006
12015
|
"step-seat-mobile"
|
|
12007
12016
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12008
12017
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your seat?") }),
|
|
12009
12018
|
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(tA, { children: [
|
|
12010
|
-
/* @__PURE__ */ A(rf, { img: MA.female.seat.narrow, label: v("Flat"), selected:
|
|
12011
|
-
/* @__PURE__ */ A(rf, { img: MA.female.seat.average, label: v("Average"), selected:
|
|
12012
|
-
/* @__PURE__ */ A(rf, { img: MA.female.seat.full, label: v("Full"), selected:
|
|
12019
|
+
/* @__PURE__ */ A(rf, { img: MA.female.seat.narrow, label: v("Flat"), selected: zA === "narrow", onSelect: () => YA("narrow"), onHover: () => J(v("A flatter backside with less projection")), onLeave: () => J("") }),
|
|
12020
|
+
/* @__PURE__ */ A(rf, { img: MA.female.seat.average, label: v("Average"), selected: zA === "average", onSelect: () => YA("average"), onHover: () => J(v("A moderate, natural backside shape")), onLeave: () => J("") }),
|
|
12021
|
+
/* @__PURE__ */ A(rf, { img: MA.female.seat.full, label: v("Full"), selected: zA === "full", onSelect: () => YA("full"), onHover: () => J(v("A fuller, more rounded backside")), onLeave: () => J("") })
|
|
12013
12022
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
12014
|
-
/* @__PURE__ */ A(rf, { img: MA.male.seat.narrow, label: v("Flat"), selected:
|
|
12015
|
-
/* @__PURE__ */ A(rf, { img: MA.male.seat.average, label: v("Average"), selected:
|
|
12016
|
-
/* @__PURE__ */ A(rf, { img: MA.male.seat.full, label: v("Full"), selected:
|
|
12023
|
+
/* @__PURE__ */ A(rf, { img: MA.male.seat.narrow, label: v("Flat"), selected: zA === "narrow", onSelect: () => YA("narrow"), onHover: () => J(v("A flatter backside with less projection")), onLeave: () => J("") }),
|
|
12024
|
+
/* @__PURE__ */ A(rf, { img: MA.male.seat.average, label: v("Average"), selected: zA === "average", onSelect: () => YA("average"), onHover: () => J(v("A moderate, natural backside shape")), onLeave: () => J("") }),
|
|
12025
|
+
/* @__PURE__ */ A(rf, { img: MA.male.seat.full, label: v("Full"), selected: zA === "full", onSelect: () => YA("full"), onHover: () => J(v("A fuller, more rounded backside")), onLeave: () => J("") })
|
|
12017
12026
|
] }) }),
|
|
12018
12027
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
12019
12028
|
] }, "step-seat")),
|
|
@@ -12036,9 +12045,9 @@ function z8({
|
|
|
12036
12045
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12037
12046
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your hips?") }),
|
|
12038
12047
|
/* @__PURE__ */ P("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: [
|
|
12039
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.narrow, label: v("Narrow"), selected: H === "narrow", onSelect: () => oA("narrow"), onHover: () =>
|
|
12040
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected: H === "average", onSelect: () => oA("average"), onHover: () =>
|
|
12041
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected: H === "full", onSelect: () => oA("full"), onHover: () =>
|
|
12048
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.narrow, label: v("Narrow"), selected: H === "narrow", onSelect: () => oA("narrow"), onHover: () => J(v("Hips closer to shoulder width")), onLeave: () => J("") }),
|
|
12049
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected: H === "average", onSelect: () => oA("average"), onHover: () => J(v("Hips proportionate to shoulders")), onLeave: () => J("") }),
|
|
12050
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected: H === "full", onSelect: () => oA("full"), onHover: () => J(v("Hips wider than shoulders")), onLeave: () => J("") })
|
|
12042
12051
|
] }),
|
|
12043
12052
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
12044
12053
|
] }, "step-hips")),
|
|
@@ -12074,11 +12083,11 @@ function z8({
|
|
|
12074
12083
|
M
|
|
12075
12084
|
)) })
|
|
12076
12085
|
] }),
|
|
12077
|
-
|
|
12078
|
-
const M = H8(
|
|
12086
|
+
gA && FA && (() => {
|
|
12087
|
+
const M = H8(gA, FA, AA);
|
|
12079
12088
|
return /* @__PURE__ */ P("span", { className: "ps-bp-bra-inline-result", children: [
|
|
12080
12089
|
/* @__PURE__ */ P("strong", { children: [
|
|
12081
|
-
|
|
12090
|
+
gA,
|
|
12082
12091
|
FA
|
|
12083
12092
|
] }),
|
|
12084
12093
|
M && /* @__PURE__ */ P("span", { children: [
|
|
@@ -12092,7 +12101,7 @@ function z8({
|
|
|
12092
12101
|
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children: x.map((M) => /* @__PURE__ */ A(
|
|
12093
12102
|
"button",
|
|
12094
12103
|
{
|
|
12095
|
-
className: `ps-bp-bra-btn${
|
|
12104
|
+
className: `ps-bp-bra-btn${gA === M ? " ps-bp-bra-btn-selected" : ""}`,
|
|
12096
12105
|
onClick: () => Bf(M),
|
|
12097
12106
|
type: "button",
|
|
12098
12107
|
children: M
|
|
@@ -12116,7 +12125,7 @@ function z8({
|
|
|
12116
12125
|
q && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: q })
|
|
12117
12126
|
] }, "step-bra"),
|
|
12118
12127
|
!(K && O === "basics") && (() => {
|
|
12119
|
-
const M = O === "basics" && F && !!h,
|
|
12128
|
+
const M = O === "basics" && F && !!h, cA = M ? h : $A, pA = xf(vA) ? ` (${xf(vA)})` : "", tf = M ? v("Find My Best Fit") + pA : vf ? v("Find My Size") + pA : v("Next");
|
|
12120
12129
|
return /* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
12121
12130
|
O !== "basics" ? /* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: yA, type: "button", children: [
|
|
12122
12131
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
@@ -12127,7 +12136,7 @@ function z8({
|
|
|
12127
12136
|
"button",
|
|
12128
12137
|
{
|
|
12129
12138
|
className: `ps-bp-next-btn${!M && !KA ? " ps-bp-btn-disabled" : ""}`,
|
|
12130
|
-
onClick:
|
|
12139
|
+
onClick: cA,
|
|
12131
12140
|
disabled: !M && !KA,
|
|
12132
12141
|
type: "button",
|
|
12133
12142
|
children: tf
|
|
@@ -12163,56 +12172,56 @@ function SP({
|
|
|
12163
12172
|
onBack: W,
|
|
12164
12173
|
t
|
|
12165
12174
|
}) {
|
|
12166
|
-
const k = e === "close-up", u = NP(), [v, I] = j("manual"), [O,
|
|
12167
|
-
const
|
|
12168
|
-
return n.forEach((
|
|
12169
|
-
|
|
12170
|
-
}),
|
|
12171
|
-
}), [K, E] = j(""),
|
|
12172
|
-
const
|
|
12173
|
-
if (!
|
|
12174
|
-
const TA = URL.createObjectURL(
|
|
12175
|
-
y(
|
|
12175
|
+
const k = e === "close-up", u = NP(), [v, I] = j("manual"), [O, N] = j(() => {
|
|
12176
|
+
const m = {};
|
|
12177
|
+
return n.forEach((EA) => {
|
|
12178
|
+
m[EA.key] = i.current[EA.key] || "";
|
|
12179
|
+
}), m;
|
|
12180
|
+
}), [K, E] = j(""), BA = iA(null), [c, hA] = j(null), [l, y] = j(null), [XA, sA] = j(null), [V, s] = j(null), PA = UA(async (m) => {
|
|
12181
|
+
const EA = m.target.files?.[0];
|
|
12182
|
+
if (!EA) return;
|
|
12183
|
+
const TA = URL.createObjectURL(EA);
|
|
12184
|
+
y(EA), hA(TA);
|
|
12176
12185
|
try {
|
|
12177
|
-
const
|
|
12178
|
-
sA(
|
|
12186
|
+
const bA = await AP(EA);
|
|
12187
|
+
sA(bA);
|
|
12179
12188
|
} catch {
|
|
12180
12189
|
}
|
|
12181
|
-
}, []), RA =
|
|
12190
|
+
}, []), RA = UA(() => {
|
|
12182
12191
|
c && URL.revokeObjectURL(c), y(null), hA(null), sA(null);
|
|
12183
|
-
}, [c]), mA = (
|
|
12184
|
-
|
|
12192
|
+
}, [c]), mA = (m, EA) => {
|
|
12193
|
+
N((TA) => ({ ...TA, [m]: EA })), E("");
|
|
12185
12194
|
}, dA = () => {
|
|
12186
|
-
const
|
|
12187
|
-
if (!
|
|
12188
|
-
const
|
|
12189
|
-
if (!
|
|
12190
|
-
E(t("Please enter your ") + t(
|
|
12195
|
+
const m = n[0];
|
|
12196
|
+
if (!m) return;
|
|
12197
|
+
const EA = parseFloat(O[m.key] || "");
|
|
12198
|
+
if (!EA || EA <= 0) {
|
|
12199
|
+
E(t("Please enter your ") + t(m.label).toLowerCase());
|
|
12191
12200
|
return;
|
|
12192
12201
|
}
|
|
12193
12202
|
n.forEach((TA) => {
|
|
12194
|
-
const
|
|
12195
|
-
|
|
12203
|
+
const bA = parseFloat(O[TA.key] || "");
|
|
12204
|
+
bA > 0 && (i.current[TA.key] = String(bA));
|
|
12196
12205
|
}), i.current.gender = i.current.gender || "male", z("exact"), p(!0), T("size-result"), F("exact");
|
|
12197
12206
|
}, ZA = () => {
|
|
12198
12207
|
if (V !== !0) {
|
|
12199
12208
|
E(t("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
12200
12209
|
return;
|
|
12201
12210
|
}
|
|
12202
|
-
if (!l || !
|
|
12211
|
+
if (!l || !XA) {
|
|
12203
12212
|
E(t("Please upload a photo"));
|
|
12204
12213
|
return;
|
|
12205
12214
|
}
|
|
12206
12215
|
h({
|
|
12207
12216
|
photoFile: l,
|
|
12208
|
-
photoBase64:
|
|
12217
|
+
photoBase64: XA,
|
|
12209
12218
|
height: 0,
|
|
12210
12219
|
weight: 0,
|
|
12211
12220
|
heightUnit: "cm",
|
|
12212
12221
|
weightUnit: "kg",
|
|
12213
12222
|
gender: i.current.gender || "male"
|
|
12214
12223
|
});
|
|
12215
|
-
}, Hf = g.find((
|
|
12224
|
+
}, Hf = g.find((m) => m.value === o)?.label || g[0].label;
|
|
12216
12225
|
return u && v === "photo" ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
12217
12226
|
Zn,
|
|
12218
12227
|
{
|
|
@@ -12224,43 +12233,43 @@ function SP({
|
|
|
12224
12233
|
error: K,
|
|
12225
12234
|
photoVariant: e,
|
|
12226
12235
|
ageConfirmed: V,
|
|
12227
|
-
onAgeConfirmedChange: (
|
|
12228
|
-
s(
|
|
12236
|
+
onAgeConfirmedChange: (m) => {
|
|
12237
|
+
s(m), m === !0 && E("");
|
|
12229
12238
|
},
|
|
12230
12239
|
t
|
|
12231
12240
|
}
|
|
12232
12241
|
) }) : u ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ P("div", { className: "ps-bpm-root", children: [
|
|
12233
12242
|
/* @__PURE__ */ A("div", { className: "ps-bpm-header", children: /* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: t(f) }) }),
|
|
12234
|
-
/* @__PURE__ */ A("div", { className: "ps-bpm-toggle", style: { padding: "0 4%" }, children: g.map((
|
|
12243
|
+
/* @__PURE__ */ A("div", { className: "ps-bpm-toggle", style: { padding: "0 4%" }, children: g.map((m) => /* @__PURE__ */ A(
|
|
12235
12244
|
"button",
|
|
12236
12245
|
{
|
|
12237
12246
|
type: "button",
|
|
12238
|
-
className: `ps-bpm-toggle-btn${o ===
|
|
12239
|
-
onClick: () => r(
|
|
12240
|
-
children: t(
|
|
12247
|
+
className: `ps-bpm-toggle-btn${o === m.value ? " ps-bpm-toggle-active" : ""}`,
|
|
12248
|
+
onClick: () => r(m.value),
|
|
12249
|
+
children: t(m.label)
|
|
12241
12250
|
},
|
|
12242
|
-
|
|
12251
|
+
m.value
|
|
12243
12252
|
)) }),
|
|
12244
12253
|
/* @__PURE__ */ P("div", { style: { padding: "0 4%" }, children: [
|
|
12245
|
-
n.map((
|
|
12246
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: t(
|
|
12254
|
+
n.map((m) => /* @__PURE__ */ P("div", { className: "ps-bpm-row", children: [
|
|
12255
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: t(m.label).toUpperCase() }),
|
|
12247
12256
|
/* @__PURE__ */ P("div", { className: "ps-bpm-inline-group", children: [
|
|
12248
12257
|
/* @__PURE__ */ A(
|
|
12249
12258
|
"input",
|
|
12250
12259
|
{
|
|
12251
12260
|
type: "number",
|
|
12252
12261
|
className: "ps-bpm-value-input",
|
|
12253
|
-
value: O[
|
|
12254
|
-
onChange: (
|
|
12255
|
-
placeholder:
|
|
12256
|
-
step:
|
|
12257
|
-
min:
|
|
12258
|
-
max:
|
|
12262
|
+
value: O[m.key],
|
|
12263
|
+
onChange: (EA) => mA(m.key, EA.target.value),
|
|
12264
|
+
placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
|
|
12265
|
+
step: m.step ?? 0.5,
|
|
12266
|
+
min: m.min,
|
|
12267
|
+
max: m.max
|
|
12259
12268
|
}
|
|
12260
12269
|
),
|
|
12261
12270
|
/* @__PURE__ */ A("span", { className: "ps-bpm-unit", children: Hf.toLowerCase() })
|
|
12262
12271
|
] })
|
|
12263
|
-
] },
|
|
12272
|
+
] }, m.key)),
|
|
12264
12273
|
K && /* @__PURE__ */ A("p", { className: "ps-acc-error", style: { paddingTop: 8 }, children: K })
|
|
12265
12274
|
] }),
|
|
12266
12275
|
/* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 16 } }),
|
|
@@ -12301,7 +12310,7 @@ function SP({
|
|
|
12301
12310
|
"div",
|
|
12302
12311
|
{
|
|
12303
12312
|
onClick: () => {
|
|
12304
|
-
!c && V === !0 &&
|
|
12313
|
+
!c && V === !0 && BA.current?.click();
|
|
12305
12314
|
},
|
|
12306
12315
|
style: {
|
|
12307
12316
|
flex: 1,
|
|
@@ -12321,8 +12330,8 @@ function SP({
|
|
|
12321
12330
|
},
|
|
12322
12331
|
children: c ? /* @__PURE__ */ P(tA, { children: [
|
|
12323
12332
|
/* @__PURE__ */ A("img", { src: c, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
12324
|
-
/* @__PURE__ */ A("button", { onClick: (
|
|
12325
|
-
|
|
12333
|
+
/* @__PURE__ */ A("button", { onClick: (m) => {
|
|
12334
|
+
m.stopPropagation(), RA();
|
|
12326
12335
|
}, style: { position: "absolute", top: "0.5vw", right: "0.5vw", width: "1.4vw", height: "1.4vw", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "none", color: "#fff", fontSize: "0.7vw", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: "×" })
|
|
12327
12336
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
12328
12337
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
@@ -12548,7 +12557,7 @@ function SP({
|
|
|
12548
12557
|
] })
|
|
12549
12558
|
] })
|
|
12550
12559
|
] }),
|
|
12551
|
-
/* @__PURE__ */ A("input", { ref:
|
|
12560
|
+
/* @__PURE__ */ A("input", { ref: BA, type: "file", accept: "image/*", style: { display: "none" }, onChange: PA }),
|
|
12552
12561
|
K && /* @__PURE__ */ A("p", { className: "ps-bp-error", style: { padding: "0 1.5vw" }, children: K }),
|
|
12553
12562
|
/* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
12554
12563
|
/* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: () => I("manual"), type: "button", children: [
|
|
@@ -12567,35 +12576,35 @@ function SP({
|
|
|
12567
12576
|
/* ── Manual step — identical structure to BodyProfileView basics step ── */
|
|
12568
12577
|
/* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
12569
12578
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: t(f) }),
|
|
12570
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-system-toggle", children: g.map((
|
|
12579
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-system-toggle", children: g.map((m) => /* @__PURE__ */ A(
|
|
12571
12580
|
"button",
|
|
12572
12581
|
{
|
|
12573
12582
|
type: "button",
|
|
12574
|
-
className: `ps-bp-system-btn${o ===
|
|
12575
|
-
onClick: () => r(
|
|
12576
|
-
children: t(
|
|
12583
|
+
className: `ps-bp-system-btn${o === m.value ? " ps-bp-system-active" : ""}`,
|
|
12584
|
+
onClick: () => r(m.value),
|
|
12585
|
+
children: t(m.label)
|
|
12577
12586
|
},
|
|
12578
|
-
|
|
12587
|
+
m.value
|
|
12579
12588
|
)) }),
|
|
12580
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-inline-fields", children: n.map((
|
|
12581
|
-
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: t(
|
|
12589
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-inline-fields", children: n.map((m) => /* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
12590
|
+
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: t(m.label).toUpperCase() }),
|
|
12582
12591
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
12583
12592
|
/* @__PURE__ */ A(
|
|
12584
12593
|
"input",
|
|
12585
12594
|
{
|
|
12586
12595
|
type: "number",
|
|
12587
12596
|
className: "ps-bp-inline-input",
|
|
12588
|
-
value: O[
|
|
12589
|
-
onChange: (
|
|
12590
|
-
placeholder:
|
|
12591
|
-
step:
|
|
12592
|
-
min:
|
|
12593
|
-
max:
|
|
12597
|
+
value: O[m.key],
|
|
12598
|
+
onChange: (EA) => mA(m.key, EA.target.value),
|
|
12599
|
+
placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
|
|
12600
|
+
step: m.step ?? 0.5,
|
|
12601
|
+
min: m.min,
|
|
12602
|
+
max: m.max
|
|
12594
12603
|
}
|
|
12595
12604
|
),
|
|
12596
12605
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: Hf.toLowerCase() })
|
|
12597
12606
|
] })
|
|
12598
|
-
] },
|
|
12607
|
+
] }, m.key)) }),
|
|
12599
12608
|
K && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: K }),
|
|
12600
12609
|
!B && /* @__PURE__ */ P("button", { className: "ps-bp-photo-cta", onClick: () => I("photo"), type: "button", children: [
|
|
12601
12610
|
/* @__PURE__ */ A(Un, {}),
|
|
@@ -12790,29 +12799,29 @@ function R8({
|
|
|
12790
12799
|
onError: v,
|
|
12791
12800
|
sizeGuideData: I
|
|
12792
12801
|
}) {
|
|
12793
|
-
const O = g || f, [
|
|
12802
|
+
const O = g || f, [N, K] = j(() => o || "");
|
|
12794
12803
|
JA(() => {
|
|
12795
12804
|
o !== void 0 && K(o);
|
|
12796
12805
|
}, [o]);
|
|
12797
|
-
const E = wf(() => Hg(
|
|
12806
|
+
const E = wf(() => Hg(N || void 0), [N]), BA = e ?? E("Virtual Try-On"), [c, hA] = j(!1);
|
|
12798
12807
|
JA(() => {
|
|
12799
12808
|
hA(!0);
|
|
12800
12809
|
}, []);
|
|
12801
|
-
const [l, y] = j("idle"), [
|
|
12810
|
+
const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, dA] = j(null), [ZA, Hf] = j(!1), [m, EA] = j(!1), [TA, bA] = j(null), [VA, kA] = j(null), [vA, SA] = j(null), [ff, rA] = j(!1), [nf, xA] = j(!1), [Ef, eA] = j(!1), [$, _A] = j(null), [Of, cf] = j(!1), Mf = iA(!1), [gf, qA] = j(Xg), GA = Yn(gf), [_, uA] = j(GA ? "in" : "cm"), [WA, a] = j(GA ? "in" : "cm"), [X, nA] = j(GA ? "lbs" : "kg");
|
|
12802
12811
|
JA(() => {
|
|
12803
12812
|
const w = Xf(n);
|
|
12804
|
-
w === "foot" || w === "head" ?
|
|
12813
|
+
w === "foot" || w === "head" ? uA("cm") : w === "face" && uA("mm");
|
|
12805
12814
|
}, [n]);
|
|
12806
|
-
const H = iA({}), [oA,
|
|
12815
|
+
const H = iA({}), [oA, zA] = j("male"), [YA, of] = j(0), [J, gA] = j(null), [Bf, FA] = j(!1), [OA, AA] = j(() => af("profiles", [])), [LA, Pf] = j(() => af("history", [])), [lA, x] = j(() => Kn()), [q, QA] = j(() => /* @__PURE__ */ new Set()), [U, R] = j(null), G = UA((w) => {
|
|
12807
12816
|
x(w), Tg(w);
|
|
12808
12817
|
}, []), [S, aA] = j(!1), [fA, NA] = j(null), [$A, ef] = j(null), yA = iA(null), KA = iA(() => !1), vf = iA(() => {
|
|
12809
|
-
}), M =
|
|
12818
|
+
}), M = UA((w, Q) => {
|
|
12810
12819
|
KA.current = w, vf.current = Q;
|
|
12811
|
-
}, []),
|
|
12820
|
+
}, []), cA = iA(null), pA = iA(null), tf = iA(null), Df = iA(null), IA = iA(null), pf = iA(!1), qn = iA(null), If = iA(null), [Wn, lf] = j(null), [Vn, LP] = j(null), Jf = iA(null);
|
|
12812
12821
|
JA(() => {
|
|
12813
12822
|
try {
|
|
12814
12823
|
const w = bf(), Q = uf(B);
|
|
12815
|
-
|
|
12824
|
+
pA.current = new zg(w, Q), tf.current = new cg(pA.current.getStreamUrl());
|
|
12816
12825
|
} catch {
|
|
12817
12826
|
}
|
|
12818
12827
|
return () => {
|
|
@@ -12881,7 +12890,7 @@ function R8({
|
|
|
12881
12890
|
_A({ found: !1 });
|
|
12882
12891
|
return;
|
|
12883
12892
|
}
|
|
12884
|
-
if (!
|
|
12893
|
+
if (!pA.current) {
|
|
12885
12894
|
_A({ found: !1 });
|
|
12886
12895
|
return;
|
|
12887
12896
|
}
|
|
@@ -12912,7 +12921,7 @@ function R8({
|
|
|
12912
12921
|
default:
|
|
12913
12922
|
return 1;
|
|
12914
12923
|
}
|
|
12915
|
-
}, [l]), Zf =
|
|
12924
|
+
}, [l]), Zf = UA(
|
|
12916
12925
|
(w, Q) => {
|
|
12917
12926
|
let Y = lA, wA = OA.find((L) => L.id === Y);
|
|
12918
12927
|
if (!wA) {
|
|
@@ -12966,7 +12975,7 @@ function R8({
|
|
|
12966
12975
|
}
|
|
12967
12976
|
},
|
|
12968
12977
|
[lA, OA, B, f, n, O, G]
|
|
12969
|
-
), UP = iA(null), [qf, EP] = j(null), yP =
|
|
12978
|
+
), UP = iA(null), [qf, EP] = j(null), yP = UA(async (w) => {
|
|
12970
12979
|
const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0, wA = !!w.measurements && Object.keys(w.measurements).length > 0, L = w.photoBase64;
|
|
12971
12980
|
if (!wA && L && Q > 0 && UP.current) {
|
|
12972
12981
|
try {
|
|
@@ -13009,23 +13018,23 @@ function R8({
|
|
|
13009
13018
|
d?.raw && SA(d.raw), xA(!0);
|
|
13010
13019
|
}).catch(() => {
|
|
13011
13020
|
}).finally(() => rA(!1));
|
|
13012
|
-
}, [O, n, f, I, B, V]), _n =
|
|
13021
|
+
}, [O, n, f, I, B, V]), _n = UA(async () => {
|
|
13013
13022
|
const w = OA.find((L) => L.id === lA);
|
|
13014
13023
|
if (!w) return;
|
|
13015
13024
|
const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0;
|
|
13016
13025
|
Q > 0 && Y > 0 && EP(w);
|
|
13017
|
-
}, [OA, lA]), Ag =
|
|
13026
|
+
}, [OA, lA]), Ag = UA(() => {
|
|
13018
13027
|
if (!qf) return;
|
|
13019
13028
|
const w = qf;
|
|
13020
13029
|
EP(null), yP(w);
|
|
13021
|
-
}, [qf, yP]), fg =
|
|
13030
|
+
}, [qf, yP]), fg = UA(() => {
|
|
13022
13031
|
EP(null), of((w) => w + 1), y("body-profile");
|
|
13023
13032
|
}, []), Pg = iA(() => {
|
|
13024
|
-
}), ng =
|
|
13033
|
+
}), ng = UA(() => {
|
|
13025
13034
|
console.log("[ps-sdk] handleOpen fired — opening modal"), y("body-profile"), h?.();
|
|
13026
|
-
}, [h]), Gf =
|
|
13027
|
-
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1),
|
|
13028
|
-
}, [W, V]), gg =
|
|
13035
|
+
}, [h]), Gf = UA(() => {
|
|
13036
|
+
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), gA(null), FA(!1), aA(!1), H.current = {}, zA("male"), Yf.current = !1, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null), W?.();
|
|
13037
|
+
}, [W, V]), gg = UA(() => {
|
|
13029
13038
|
if (fA) {
|
|
13030
13039
|
NA(null), yA.current && (y(yA.current), yA.current = null);
|
|
13031
13040
|
return;
|
|
@@ -13039,7 +13048,7 @@ function R8({
|
|
|
13039
13048
|
break;
|
|
13040
13049
|
case "size-result":
|
|
13041
13050
|
if (TA) {
|
|
13042
|
-
|
|
13051
|
+
bA(null);
|
|
13043
13052
|
break;
|
|
13044
13053
|
}
|
|
13045
13054
|
y("body-profile");
|
|
@@ -13061,7 +13070,7 @@ function R8({
|
|
|
13061
13070
|
Gf();
|
|
13062
13071
|
break;
|
|
13063
13072
|
}
|
|
13064
|
-
}, [l, fA, TA, Gf]), Bg = l !== "idle" && l !== "processing" && l !== "result" && l !== "welcome" && l !== "body-profile" && l !== "size-result", ZP =
|
|
13073
|
+
}, [l, fA, TA, Gf]), Bg = l !== "idle" && l !== "processing" && l !== "result" && l !== "welcome" && l !== "body-profile" && l !== "size-result", ZP = UA((w) => {
|
|
13065
13074
|
if (!pg(w)) {
|
|
13066
13075
|
dA(E("Please upload a JPEG, PNG, or WebP image.")), y("error"), v?.({ message: "Invalid file type", code: "INVALID_FILE" });
|
|
13067
13076
|
return;
|
|
@@ -13076,11 +13085,11 @@ function R8({
|
|
|
13076
13085
|
If.current = Y;
|
|
13077
13086
|
}).catch(() => {
|
|
13078
13087
|
});
|
|
13079
|
-
}, [t, v]), qP =
|
|
13088
|
+
}, [t, v]), qP = UA(() => {
|
|
13080
13089
|
sA(null), V && URL.revokeObjectURL(V), s(null);
|
|
13081
|
-
}, [V]), Wf =
|
|
13090
|
+
}, [V]), Wf = UA(() => {
|
|
13082
13091
|
IA.current && (clearInterval(IA.current), IA.current = null), Df.current?.(), Df.current = null;
|
|
13083
|
-
}, []), aP =
|
|
13092
|
+
}, []), aP = UA((w) => {
|
|
13084
13093
|
if (w.status === "completed" && w.imageUrl) {
|
|
13085
13094
|
if (RA((Q) => !Q || Q.startsWith("data:") || !w.imageUrl.startsWith("data:") ? w.imageUrl : Q), !pf.current) {
|
|
13086
13095
|
if (pf.current = !0, nP.current = 100, mf.current && (mf.current.style.width = "100%"), Nf.current && (Nf.current.textContent = "100%"), yf.current && (yf.current.style.strokeDashoffset = "0"), Lf.current && (Lf.current.textContent = E("Done")), Sf.current) {
|
|
@@ -13096,17 +13105,17 @@ function R8({
|
|
|
13096
13105
|
const Q = w.error || E("Try-on generation failed");
|
|
13097
13106
|
dA(Q), y("error"), v?.({ message: Q });
|
|
13098
13107
|
}
|
|
13099
|
-
}, [u, v, Wf]), Kf = wf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields : oA === "female" ? Og : Kg, [$, oA]), Vf =
|
|
13100
|
-
if (!
|
|
13108
|
+
}, [u, v, Wf]), Kf = wf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields : oA === "female" ? Og : Kg, [$, oA]), Vf = UA(async (w) => {
|
|
13109
|
+
if (!pA.current) return;
|
|
13101
13110
|
const Q = w || VA, Y = uf(B), wA = bf(), L = Xf(n);
|
|
13102
13111
|
if (L === "face" || L === "head") {
|
|
13103
|
-
const d = H.current, b = (
|
|
13104
|
-
if (!
|
|
13105
|
-
const Af = parseFloat(
|
|
13112
|
+
const d = H.current, b = (jA) => {
|
|
13113
|
+
if (!jA) return;
|
|
13114
|
+
const Af = parseFloat(jA);
|
|
13106
13115
|
return Number.isFinite(Af) && Af > 0 ? Af : void 0;
|
|
13107
|
-
}, HA = d.sizingUnit || _ || (L === "head" ? "cm" : "mm"), DA = (
|
|
13108
|
-
if (
|
|
13109
|
-
return HA === "mm" ?
|
|
13116
|
+
}, HA = d.sizingUnit || _ || (L === "head" ? "cm" : "mm"), DA = (jA) => {
|
|
13117
|
+
if (jA != null)
|
|
13118
|
+
return HA === "mm" ? jA : HA === "cm" ? jA * 10 : HA === "in" ? jA * 25.4 : jA;
|
|
13110
13119
|
}, CA = {}, zf = {
|
|
13111
13120
|
bridgeWidth: DA(b(d.bridgeWidth)),
|
|
13112
13121
|
templeLength: DA(b(d.templeLength) ?? b(d.armLength)),
|
|
@@ -13118,29 +13127,29 @@ function R8({
|
|
|
13118
13127
|
headCircumference: DA(b(d.headCircumference)),
|
|
13119
13128
|
headWidth: DA(b(d.headWidth))
|
|
13120
13129
|
};
|
|
13121
|
-
for (const [
|
|
13130
|
+
for (const [jA, Af] of Object.entries(zf)) typeof Af == "number" && (CA[jA] = Af);
|
|
13122
13131
|
const df = {
|
|
13123
13132
|
product: { title: n, productId: g },
|
|
13124
13133
|
sizeGuide: $?.found ? $ : { found: !1 },
|
|
13125
13134
|
sizingUnit: L === "head" ? "cm" : "mm",
|
|
13126
13135
|
category: L,
|
|
13127
13136
|
...Object.keys(CA).length > 0 && { faceMeasurementsMm: CA, irisConfidence: 1 }
|
|
13128
|
-
}, Cf = new Promise((
|
|
13137
|
+
}, Cf = new Promise((jA) => setTimeout(jA, 4500));
|
|
13129
13138
|
try {
|
|
13130
|
-
const
|
|
13139
|
+
const jA = await fetch(`${Y}/api/v1/sizing/face-recommend`, {
|
|
13131
13140
|
method: "POST",
|
|
13132
13141
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${wA}` },
|
|
13133
13142
|
body: JSON.stringify(df)
|
|
13134
13143
|
});
|
|
13135
|
-
if (
|
|
13136
|
-
const Af = await
|
|
13144
|
+
if (jA.ok) {
|
|
13145
|
+
const Af = await jA.json();
|
|
13137
13146
|
await Cf, SA(Af), u?.(Af);
|
|
13138
13147
|
} else {
|
|
13139
|
-
const Af = await
|
|
13140
|
-
console.error("[PS-SDK] face-recommend failed:",
|
|
13148
|
+
const Af = await jA.text().catch(() => "");
|
|
13149
|
+
console.error("[PS-SDK] face-recommend failed:", jA.status, Af), await Cf, dA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
|
|
13141
13150
|
}
|
|
13142
|
-
} catch (
|
|
13143
|
-
console.error("[PS-SDK] face-recommend network error:",
|
|
13151
|
+
} catch (jA) {
|
|
13152
|
+
console.error("[PS-SDK] face-recommend network error:", jA), await Cf, dA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
|
|
13144
13153
|
} finally {
|
|
13145
13154
|
rA(!1);
|
|
13146
13155
|
}
|
|
@@ -13214,34 +13223,34 @@ function R8({
|
|
|
13214
13223
|
} finally {
|
|
13215
13224
|
rA(!1);
|
|
13216
13225
|
}
|
|
13217
|
-
}, [B, VA, gf, WA, X, _, $, n, Kf, Zf]), eg =
|
|
13218
|
-
if (!
|
|
13219
|
-
const
|
|
13220
|
-
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), dA(
|
|
13226
|
+
}, [B, VA, gf, WA, X, _, $, n, Kf, Zf]), eg = UA(async (w, Q, Y, wA, L, Z, d, b, HA, DA, CA) => {
|
|
13227
|
+
if (!pA.current) {
|
|
13228
|
+
const jA = E("SDK not configured. Please refresh and try again.");
|
|
13229
|
+
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), dA(jA), y("error"), v?.({ message: jA, code: "SDK_NOT_CONFIGURED" });
|
|
13221
13230
|
return;
|
|
13222
13231
|
}
|
|
13223
13232
|
uf(B), bf();
|
|
13224
13233
|
const zf = /* @__PURE__ */ new Set(["weight", "weightKg", "height", "heightCm"]), df = /* @__PURE__ */ new Set();
|
|
13225
13234
|
if ($?.sections) {
|
|
13226
|
-
for (const
|
|
13227
|
-
if (
|
|
13228
|
-
for (const Af of
|
|
13235
|
+
for (const jA of Object.values($.sections))
|
|
13236
|
+
if (jA.requiredFields)
|
|
13237
|
+
for (const Af of jA.requiredFields)
|
|
13229
13238
|
Af.required && Af.unit === "cm" && !zf.has(Af.key) && df.add(Af.key);
|
|
13230
13239
|
}
|
|
13231
|
-
for (const
|
|
13232
|
-
|
|
13240
|
+
for (const jA of Kf)
|
|
13241
|
+
jA.required && jA.unit === "cm" && !zf.has(jA.key) && df.add(jA.key);
|
|
13233
13242
|
const Cf = Array.from(df);
|
|
13234
|
-
if (console.log("[PS-SDK] Quick estimate — dynamicFields:", Kf.map((
|
|
13243
|
+
if (console.log("[PS-SDK] Quick estimate — dynamicFields:", Kf.map((jA) => `${jA.key}(${jA.unit},req=${jA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", Cf), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: b, midsectionProfile: HA, hipProfile: DA }), Cf.length === 0) {
|
|
13235
13244
|
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"), rA(!0), y("size-result"), Vf("quick");
|
|
13236
13245
|
return;
|
|
13237
13246
|
}
|
|
13238
13247
|
H.current.height = String(w), H.current.weight = String(Q), H.current.heightUnit = Y, H.current.weightUnit = wA, H.current.gender = L, Z && (H.current.age = String(Z)), d && (H.current.bodyType = d), b && (H.current.chestProfile = b), HA && (H.current.midsectionProfile = HA), DA && (H.current.hipProfile = DA), SA(null), RA(null), kA("quick"), rA(!0), y("size-result"), Vf("quick");
|
|
13239
|
-
}, [B, Kf, $, Vf, _, X]), dP =
|
|
13248
|
+
}, [B, Kf, $, Vf, _, X]), dP = UA(async (w) => {
|
|
13240
13249
|
if (console.log("[ps-sdk] handleSnapSubmit fired", {
|
|
13241
|
-
hasApiRef: !!
|
|
13250
|
+
hasApiRef: !!pA.current,
|
|
13242
13251
|
hasSseRef: !!tf.current,
|
|
13243
13252
|
apiUrl: B
|
|
13244
|
-
}), !
|
|
13253
|
+
}), !pA.current || !tf.current) {
|
|
13245
13254
|
const DA = E("SDK not configured. Please refresh and try again.");
|
|
13246
13255
|
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), dA(DA), y("error"), v?.({ message: DA, code: "SDK_NOT_CONFIGURED" });
|
|
13247
13256
|
return;
|
|
@@ -13347,14 +13356,14 @@ function R8({
|
|
|
13347
13356
|
rA(!1);
|
|
13348
13357
|
}, [B, f, n, _, X, gf, $, Kf, Zf]);
|
|
13349
13358
|
UP.current = dP;
|
|
13350
|
-
const WP =
|
|
13351
|
-
const Q = w ||
|
|
13352
|
-
if (!Q || !
|
|
13353
|
-
const Z =
|
|
13359
|
+
const WP = UA(async (w) => {
|
|
13360
|
+
const Q = w || XA || Jf.current;
|
|
13361
|
+
if (!Q || !pA.current || !tf.current) {
|
|
13362
|
+
const Z = pA.current ? E("Please upload a photo first.") : E("SDK not configured. Please provide an API key.");
|
|
13354
13363
|
dA(Z), y("error"), v?.({ message: Z, code: "SDK_NOT_CONFIGURED" });
|
|
13355
13364
|
return;
|
|
13356
13365
|
}
|
|
13357
|
-
w && w !==
|
|
13366
|
+
w && w !== XA && (sA(w), Jf.current = w), pf.current = !1, eA(!0);
|
|
13358
13367
|
const Y = En(Xf(n)), wA = Y === "apparel", L = (w ? null : V) || URL.createObjectURL(Q);
|
|
13359
13368
|
(w || !V) && s(L), If.current = null, lf(null), wA && (rP(L).then((Z) => {
|
|
13360
13369
|
If.current = Z;
|
|
@@ -13367,7 +13376,7 @@ function R8({
|
|
|
13367
13376
|
const Z = await AP(Q);
|
|
13368
13377
|
let d;
|
|
13369
13378
|
wA && vA?.matchDetails?.length && (d = xg(vA.matchDetails, If.current));
|
|
13370
|
-
const b = await
|
|
13379
|
+
const b = await pA.current.submitTryOn(
|
|
13371
13380
|
Z,
|
|
13372
13381
|
f,
|
|
13373
13382
|
d,
|
|
@@ -13390,7 +13399,7 @@ function R8({
|
|
|
13390
13399
|
return;
|
|
13391
13400
|
}
|
|
13392
13401
|
try {
|
|
13393
|
-
const DA = await
|
|
13402
|
+
const DA = await pA.current.getStatus(b.jobId);
|
|
13394
13403
|
(DA.status === "completed" || DA.status === "failed") && aP({ galleryId: b.jobId, status: DA.status, imageUrl: DA.imageUrl, error: DA.status === "failed" ? DA.message : null, timestamp: Date.now() });
|
|
13395
13404
|
} catch {
|
|
13396
13405
|
}
|
|
@@ -13399,9 +13408,9 @@ function R8({
|
|
|
13399
13408
|
const d = Z instanceof Error ? Z.message : E("Failed to start try-on"), b = Z instanceof an ? Z.code : void 0;
|
|
13400
13409
|
dA(d), y("error"), v?.({ message: d, code: b });
|
|
13401
13410
|
}
|
|
13402
|
-
}, [
|
|
13403
|
-
if (!
|
|
13404
|
-
|
|
13411
|
+
}, [XA, f, n, vA, k, v, aP]), og = UA(async (w) => {
|
|
13412
|
+
if (!XA || !pA.current || !tf.current) return;
|
|
13413
|
+
EA(!0);
|
|
13405
13414
|
const Q = En(Xf(n)), Y = Q === "apparel";
|
|
13406
13415
|
if (Y && If.current) {
|
|
13407
13416
|
const wA = {
|
|
@@ -13421,7 +13430,7 @@ function R8({
|
|
|
13421
13430
|
}
|
|
13422
13431
|
try {
|
|
13423
13432
|
pf.current = !1, Df.current?.(), IA.current && (clearInterval(IA.current), IA.current = null);
|
|
13424
|
-
const wA = await AP(
|
|
13433
|
+
const wA = await AP(XA), L = Y ? w : void 0, Z = await pA.current.submitTryOn(
|
|
13425
13434
|
wA,
|
|
13426
13435
|
f,
|
|
13427
13436
|
L,
|
|
@@ -13433,7 +13442,7 @@ function R8({
|
|
|
13433
13442
|
}
|
|
13434
13443
|
);
|
|
13435
13444
|
Df.current = tf.current.onJob(Z.jobId, (b) => {
|
|
13436
|
-
b.status === "completed" && b.imageUrl ? (RA(b.imageUrl),
|
|
13445
|
+
b.status === "completed" && b.imageUrl ? (RA(b.imageUrl), EA(!1), pf.current = !0, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (EA(!1), pf.current = !0, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null));
|
|
13437
13446
|
});
|
|
13438
13447
|
let d = 0;
|
|
13439
13448
|
IA.current = setInterval(async () => {
|
|
@@ -13442,19 +13451,19 @@ function R8({
|
|
|
13442
13451
|
return;
|
|
13443
13452
|
}
|
|
13444
13453
|
if (d++, d > 60) {
|
|
13445
|
-
IA.current && clearInterval(IA.current), IA.current = null,
|
|
13454
|
+
IA.current && clearInterval(IA.current), IA.current = null, EA(!1);
|
|
13446
13455
|
return;
|
|
13447
13456
|
}
|
|
13448
13457
|
try {
|
|
13449
|
-
const b = await
|
|
13450
|
-
b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl),
|
|
13458
|
+
const b = await pA.current.getStatus(Z.jobId);
|
|
13459
|
+
b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl), EA(!1), Df.current?.(), Df.current = null), IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (pf.current = !0, EA(!1), IA.current && (clearInterval(IA.current), IA.current = null));
|
|
13451
13460
|
} catch {
|
|
13452
13461
|
}
|
|
13453
13462
|
}, 3e3);
|
|
13454
13463
|
} catch {
|
|
13455
|
-
|
|
13464
|
+
EA(!1);
|
|
13456
13465
|
}
|
|
13457
|
-
}, [
|
|
13466
|
+
}, [XA, f, n]), wg = UA(() => {
|
|
13458
13467
|
if (PA)
|
|
13459
13468
|
if (PA.startsWith("data:")) {
|
|
13460
13469
|
const w = document.createElement("a");
|
|
@@ -13464,9 +13473,9 @@ function R8({
|
|
|
13464
13473
|
const Q = URL.createObjectURL(w), Y = document.createElement("a");
|
|
13465
13474
|
Y.href = Q, Y.download = `primestyle-tryon-${Date.now()}.png`, Y.click(), setTimeout(() => URL.revokeObjectURL(Q), 100);
|
|
13466
13475
|
}).catch(() => window.open(PA, "_blank"));
|
|
13467
|
-
}, [PA]), vg =
|
|
13476
|
+
}, [PA]), vg = UA(() => {
|
|
13468
13477
|
pf.current = !1, Wf(), sA(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), aA(!1), y("body-profile");
|
|
13469
|
-
}, [V, Wf]), Dg =
|
|
13478
|
+
}, [V, Wf]), Dg = UA((w) => {
|
|
13470
13479
|
const Q = OA.find((wA) => wA.id === w);
|
|
13471
13480
|
if (!Q) return;
|
|
13472
13481
|
G(w), AA((wA) => wA.map((L) => L.id === w ? { ...L, lastUsedAt: Date.now() } : L));
|
|
@@ -13474,9 +13483,9 @@ function R8({
|
|
|
13474
13483
|
if ((Q.height ?? Q.heightCm) && (Y.height = String(Q.height ?? Q.heightCm)), (Q.weight ?? Q.weightKg) && (Y.weight = String(Q.weight ?? Q.weightKg)), Q.chest && (Y.chest = String(Q.chest)), Q.bust && (Y.bust = String(Q.bust)), Q.waist && (Y.waist = String(Q.waist)), Q.hips && (Y.hips = String(Q.hips)), Q.shoulderWidth && (Y.shoulderWidth = String(Q.shoulderWidth)), Q.sleeveLength && (Y.sleeveLength = String(Q.sleeveLength)), Q.inseam && (Y.inseam = String(Q.inseam)), Q.neckCircumference && (Y.neckCircumference = String(Q.neckCircumference)), Q.footLengthCm && (Y.footLengthCm = String(Q.footLengthCm)), Q.shoeEU && (Y.shoeEU = Q.shoeEU), Q.shoeUS && (Y.shoeUS = Q.shoeUS), Q.shoeUK && (Y.shoeUK = Q.shoeUK), Q.fitPreference && (Y.fitPreference = Q.fitPreference), Q.customMeasurements)
|
|
13475
13484
|
for (const [wA, L] of Object.entries(Q.customMeasurements))
|
|
13476
13485
|
Y[wA] = String(L);
|
|
13477
|
-
H.current = Y,
|
|
13486
|
+
H.current = Y, zA(Y.gender || "male"), Q.country && qA(Q.country), Q.sizingUnit && uA(Q.sizingUnit), Q.heightUnit && a(Q.heightUnit), Q.weightUnit && nA(Q.weightUnit), of((wA) => wA + 1);
|
|
13478
13487
|
}, [OA]);
|
|
13479
|
-
Pg.current = Dg,
|
|
13488
|
+
Pg.current = Dg, UA((w, Q) => {
|
|
13480
13489
|
const Y = (Q ? null : lA) || `p_${Date.now()}`, wA = {
|
|
13481
13490
|
id: Y,
|
|
13482
13491
|
name: w,
|
|
@@ -13532,7 +13541,7 @@ function R8({
|
|
|
13532
13541
|
return [...d, wA].slice(-50);
|
|
13533
13542
|
}), G(Y), aA(!0);
|
|
13534
13543
|
}, [lA, gf, _, WA, X]);
|
|
13535
|
-
const VP =
|
|
13544
|
+
const VP = UA(() => {
|
|
13536
13545
|
const w = {
|
|
13537
13546
|
id: `h_${Date.now()}`,
|
|
13538
13547
|
productTitle: n,
|
|
@@ -13563,15 +13572,15 @@ function R8({
|
|
|
13563
13572
|
JA(() => {
|
|
13564
13573
|
l === "size-result" && vA && !Yf.current ? (Yf.current = !0, gP.current = !1, VP()) : l === "size-result" && vA && PA && !gP.current ? (gP.current = !0, Pf((w) => w.length === 0 ? w : [{ ...w[0], resultImageUrl: PA }, ...w.slice(1)])) : l === "result" && PA && !Yf.current ? (Yf.current = !0, VP()) : (l === "welcome" || l === "body-profile") && (Yf.current = !1, gP.current = !1);
|
|
13565
13574
|
}, [l, vA, PA]);
|
|
13566
|
-
const Cg =
|
|
13575
|
+
const Cg = UA((w) => {
|
|
13567
13576
|
Yf.current = !0, w.sizingResult ? SA(w.sizingResult) : w.recommendedSize && SA({
|
|
13568
13577
|
recommendedSize: w.recommendedSize,
|
|
13569
13578
|
confidence: w.confidence || "high",
|
|
13570
13579
|
reasoning: w.reasoning || "",
|
|
13571
13580
|
internationalSizes: w.internationalSizes,
|
|
13572
13581
|
matchDetails: w.matchDetails
|
|
13573
|
-
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1), eA(!1),
|
|
13574
|
-
}, []), ig =
|
|
13582
|
+
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1), eA(!1), bA(null), NA(null), y("size-result");
|
|
13583
|
+
}, []), ig = UA((w, Q) => {
|
|
13575
13584
|
H.current[w] = Q;
|
|
13576
13585
|
}, []);
|
|
13577
13586
|
wf(() => {
|
|
@@ -13638,7 +13647,7 @@ function R8({
|
|
|
13638
13647
|
case "welcome":
|
|
13639
13648
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(BB, { productImage: f, setView: y, t: E }) }, "v-welcome");
|
|
13640
13649
|
case "body-profile": {
|
|
13641
|
-
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit:
|
|
13650
|
+
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit: uA, setSizingMethod: kA, setSizingLoading: rA, setView: y, submitSizing: Vf, onSnapSubmit: dP, onBack: Gf, sizeGuide: $, t: E };
|
|
13642
13651
|
if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...Q }) }, "v-foot");
|
|
13643
13652
|
if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...Q }) }, "v-head");
|
|
13644
13653
|
if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...Q }) }, "v-face");
|
|
@@ -13654,9 +13663,9 @@ function R8({
|
|
|
13654
13663
|
heightUnit: WA,
|
|
13655
13664
|
setHeightUnit: a,
|
|
13656
13665
|
weightUnit: X,
|
|
13657
|
-
setWeightUnit:
|
|
13666
|
+
setWeightUnit: nA,
|
|
13658
13667
|
sizingUnit: _,
|
|
13659
|
-
setSizingUnit:
|
|
13668
|
+
setSizingUnit: uA,
|
|
13660
13669
|
hasActiveProfileWithMeasurements: (() => {
|
|
13661
13670
|
const d = OA.find((DA) => DA.id === lA);
|
|
13662
13671
|
if (!d) return !1;
|
|
@@ -13697,15 +13706,15 @@ function R8({
|
|
|
13697
13706
|
{
|
|
13698
13707
|
productImage: f,
|
|
13699
13708
|
productTitle: n,
|
|
13700
|
-
estimatedValues:
|
|
13709
|
+
estimatedValues: J,
|
|
13701
13710
|
estimationLoading: Bf,
|
|
13702
13711
|
dynamicFields: Kf,
|
|
13703
13712
|
formRef: H,
|
|
13704
13713
|
formGender: oA,
|
|
13705
|
-
formKey:
|
|
13714
|
+
formKey: YA,
|
|
13706
13715
|
setFormKey: of,
|
|
13707
13716
|
sizingUnit: _,
|
|
13708
|
-
setSizingUnit:
|
|
13717
|
+
setSizingUnit: uA,
|
|
13709
13718
|
updateField: ig,
|
|
13710
13719
|
setSizingMethod: kA,
|
|
13711
13720
|
setSizingLoading: rA,
|
|
@@ -13729,8 +13738,8 @@ function R8({
|
|
|
13729
13738
|
setView: y,
|
|
13730
13739
|
handleDownload: wg,
|
|
13731
13740
|
onRetryWithFit: og,
|
|
13732
|
-
retryLoading:
|
|
13733
|
-
selectedFile:
|
|
13741
|
+
retryLoading: m,
|
|
13742
|
+
selectedFile: XA,
|
|
13734
13743
|
previewUrl: V,
|
|
13735
13744
|
handleFileSelect: ZP,
|
|
13736
13745
|
handleRemovePreview: qP,
|
|
@@ -13740,7 +13749,7 @@ function R8({
|
|
|
13740
13749
|
faceLandmarks: Vn,
|
|
13741
13750
|
measurementType: Xf(n),
|
|
13742
13751
|
activeSection: TA,
|
|
13743
|
-
setActiveSection:
|
|
13752
|
+
setActiveSection: bA,
|
|
13744
13753
|
onResetTryOn: () => {
|
|
13745
13754
|
sA(null), V && URL.revokeObjectURL(V), s(null), RA(null);
|
|
13746
13755
|
},
|
|
@@ -13760,11 +13769,11 @@ function R8({
|
|
|
13760
13769
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
13761
13770
|
aB,
|
|
13762
13771
|
{
|
|
13763
|
-
selectedFile:
|
|
13772
|
+
selectedFile: XA,
|
|
13764
13773
|
previewUrl: V,
|
|
13765
13774
|
dragOver: ZA,
|
|
13766
13775
|
setDragOver: Hf,
|
|
13767
|
-
fileInputRef:
|
|
13776
|
+
fileInputRef: cA,
|
|
13768
13777
|
handleFileSelect: ZP,
|
|
13769
13778
|
handleRemovePreview: qP,
|
|
13770
13779
|
handleTryOnSubmit: WP,
|
|
@@ -13860,8 +13869,8 @@ function R8({
|
|
|
13860
13869
|
if (FP(Q.id, CA.estimates, CA.unit), CA.userEstimates) {
|
|
13861
13870
|
const zf = af("profiles", []), df = zf.findIndex((Cf) => Cf.id === Q.id);
|
|
13862
13871
|
if (df >= 0) {
|
|
13863
|
-
const Cf = zf[df],
|
|
13864
|
-
|
|
13872
|
+
const Cf = zf[df], jA = CA.userEstimates, Af = { ...Cf };
|
|
13873
|
+
jA.height && !(Cf.height || Cf.heightCm) && (Af.height = jA.height, Af.heightCm = jA.height, Af.heightUnit = "cm"), jA.weight && !(Cf.weight || Cf.weightKg) && (Af.weight = jA.weight, Af.weightKg = jA.weight, Af.weightUnit = "kg"), jA.age && !Cf.age && (Af.age = jA.age), zf[df] = Af, sf("profiles", zf);
|
|
13865
13874
|
}
|
|
13866
13875
|
}
|
|
13867
13876
|
AA(af("profiles", []));
|
|
@@ -13908,14 +13917,14 @@ function R8({
|
|
|
13908
13917
|
type: "button",
|
|
13909
13918
|
children: [
|
|
13910
13919
|
D !== !1 && (i || /* @__PURE__ */ A(hf, {})),
|
|
13911
|
-
/* @__PURE__ */ A("span", { children:
|
|
13920
|
+
/* @__PURE__ */ A("span", { children: BA })
|
|
13912
13921
|
]
|
|
13913
13922
|
}
|
|
13914
13923
|
),
|
|
13915
13924
|
l !== "idle" && typeof document < "u" && lP(
|
|
13916
13925
|
/* @__PURE__ */ A("div", { className: Qf("ps-tryon-overlay", p.overlay), style: $P, "data-ps-tryon-portal": !0, children: /* @__PURE__ */ P("div", { className: Qf(`ps-tryon-modal${l === "result" && PA && vA || l === "size-result" || l === "estimation-review" || l === "body-profile" || l === "profiles" ? " ps-tryon-modal-wide" : ""}`, p.modal), onClick: (w) => w.stopPropagation(), children: [
|
|
13917
13926
|
/* @__PURE__ */ P("div", { className: Qf("ps-tryon-header ps-tryon-header-minimal", p.header), children: [
|
|
13918
|
-
/* @__PURE__ */ A(_g, { activeLocale:
|
|
13927
|
+
/* @__PURE__ */ A(_g, { activeLocale: N, onSelect: K }),
|
|
13919
13928
|
/* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: E("Profiles"), onClick: () => {
|
|
13920
13929
|
fA && NA(null), l === "profiles" ? (y(yA.current || "body-profile"), yA.current = null) : (yA.current = l, y("profiles"));
|
|
13921
13930
|
}, children: /* @__PURE__ */ A(mP, {}) }),
|