@primestyleai/tryon 5.10.111 → 5.10.112
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 +249 -249
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +2 -2
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -262,9 +262,9 @@ function tn(o, g, t) {
|
|
|
262
262
|
const r = Mg(o.leftIrisRing, g, t), B = Mg(o.rightIrisRing, g, t), a = (r + B) / 2;
|
|
263
263
|
let n = 1;
|
|
264
264
|
a < 8 ? n = 0.3 : Math.abs(r - B) / a > 0.3 ? n = 0.5 : Math.abs(r - B) / a > 0.15 && (n = 0.8);
|
|
265
|
-
const w = a > 0 ? Hg / a : 0, s = (
|
|
266
|
-
(
|
|
267
|
-
(
|
|
265
|
+
const w = a > 0 ? Hg / a : 0, s = (E, M) => Math.hypot(
|
|
266
|
+
(E.x - M.x) * g,
|
|
267
|
+
(E.y - M.y) * t
|
|
268
268
|
) * w, l = s(o.leftIrisCenter, o.rightIrisCenter), D = s(o.leftInnerEye, o.rightInnerEye) / 1.6, m = s(o.leftTragus, o.rightTragus), P = s(o.leftTragus, o.leftOuterEye), x = s(o.rightTragus, o.rightOuterEye), L = (P + x) / 2, G = m * 1.07, d = Math.abs((o.forehead.z ?? 0) - (o.chin.z ?? 0)) * g * w, W = Math.max(170, Math.min(210, d || 190)), V = G / 2, i = W / 2, b = Math.PI * Math.sqrt(2 * (V * V + i * i));
|
|
269
269
|
return {
|
|
270
270
|
measurements: {
|
|
@@ -8949,9 +8949,9 @@ function jn({
|
|
|
8949
8949
|
/* @__PURE__ */ A("h3", { className: "ps-bp-title", style: { fontSize: "1.1vw" }, children: G("Here's what we estimated") }),
|
|
8950
8950
|
/* @__PURE__ */ A("p", { className: "ps-bp-subtitle", children: G("Tap any value to adjust if needed") }),
|
|
8951
8951
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sf-fields", style: { flex: 1, overflowY: "auto" }, children: W.map((i) => {
|
|
8952
|
-
const b = t[i.key],
|
|
8952
|
+
const b = t[i.key], E = a.current[i.key] ? parseFloat(a.current[i.key]) : null, M = b || E;
|
|
8953
8953
|
if (!M) return null;
|
|
8954
|
-
const z = !b && !!
|
|
8954
|
+
const z = !b && !!E;
|
|
8955
8955
|
return a.current[i.key] || (a.current[i.key] = String(M)), /* @__PURE__ */ A("div", { className: "ps-tryon-sf-float-row", children: /* @__PURE__ */ e("div", { className: "ps-tryon-sf-float-field", children: [
|
|
8956
8956
|
/* @__PURE__ */ e("label", { className: "ps-tryon-sf-float-label", children: [
|
|
8957
8957
|
G(i.label),
|
|
@@ -9141,15 +9141,15 @@ function kg({
|
|
|
9141
9141
|
{ title: l("MATCHING SIZE"), desc: l("Comparing your measurements to the garment's size guide."), viewfinderText: l("MATCHING SIZE") },
|
|
9142
9142
|
{ title: l("FINALIZING RESULT"), desc: l("Almost done — preparing your recommendation."), viewfinderText: l("FINALIZING") }
|
|
9143
9143
|
], [P, x] = Q({ w: 800, h: 1200 }), L = (b) => {
|
|
9144
|
-
const
|
|
9145
|
-
x({ w:
|
|
9144
|
+
const E = b.currentTarget;
|
|
9145
|
+
x({ w: E.naturalWidth || E.offsetWidth, h: E.naturalHeight || E.offsetHeight });
|
|
9146
9146
|
}, G = 6e3, I = 1e3, d = hA(Date.now()), [W, V] = Q(0);
|
|
9147
9147
|
kA(() => {
|
|
9148
|
-
const b = (G - I) / Math.max(1, m.length - 1),
|
|
9148
|
+
const b = (G - I) / Math.max(1, m.length - 1), E = setInterval(() => {
|
|
9149
9149
|
const M = Date.now() - d.current, z = Math.min(m.length - 1, Math.floor(M / b));
|
|
9150
|
-
V((j) => j === z ? j : z), z >= m.length - 1 && clearInterval(
|
|
9150
|
+
V((j) => j === z ? j : z), z >= m.length - 1 && clearInterval(E);
|
|
9151
9151
|
}, 100);
|
|
9152
|
-
return () => clearInterval(
|
|
9152
|
+
return () => clearInterval(E);
|
|
9153
9153
|
}, [m.length]), kA(() => {
|
|
9154
9154
|
D && t && W === 0 && V(1);
|
|
9155
9155
|
}, [t]);
|
|
@@ -9230,8 +9230,8 @@ function Ar({
|
|
|
9230
9230
|
if (i.length > 0) {
|
|
9231
9231
|
const b = i.filter(
|
|
9232
9232
|
(M) => M.fit === "good" || M.fit === "a-bit-tight" || M.fit === "a-bit-loose"
|
|
9233
|
-
).length,
|
|
9234
|
-
return Math.max(70,
|
|
9233
|
+
).length, E = Math.round(b / i.length * 100);
|
|
9234
|
+
return Math.max(70, E);
|
|
9235
9235
|
}
|
|
9236
9236
|
return t?.confidence === "high" ? 96 : t?.confidence === "medium" ? 84 : 72;
|
|
9237
9237
|
}, [t]), W = l || o, V = !!l;
|
|
@@ -9293,7 +9293,7 @@ function Ar({
|
|
|
9293
9293
|
/* @__PURE__ */ A("span", { className: "ps-msr-match-label", children: I("FIT MATCH") })
|
|
9294
9294
|
] }) }),
|
|
9295
9295
|
/* @__PURE__ */ A("div", { className: "ps-msr-sections", children: B.map(({ name: i, secResult: b }) => {
|
|
9296
|
-
const
|
|
9296
|
+
const E = i.replace(/\s*[—–-]\s*.*/g, ""), M = b, z = a?.[i], j = !!z, wA = M.found === !1 ? I("No fit") : j ? z.displayLabel : M.size || b.recommendedSize, J = r?.sectionImages?.[i], ne = Zn(i), h = J || ne || null;
|
|
9297
9297
|
return /* @__PURE__ */ e(
|
|
9298
9298
|
"button",
|
|
9299
9299
|
{
|
|
@@ -9302,7 +9302,7 @@ function Ar({
|
|
|
9302
9302
|
onClick: () => n(i),
|
|
9303
9303
|
children: [
|
|
9304
9304
|
h && /* @__PURE__ */ A("img", { src: h, alt: "", className: "ps-msr-section-icon-lg" }),
|
|
9305
|
-
/* @__PURE__ */ A("span", { className: "ps-msr-section-name", children:
|
|
9305
|
+
/* @__PURE__ */ A("span", { className: "ps-msr-section-name", children: E.toUpperCase() }),
|
|
9306
9306
|
/* @__PURE__ */ A("span", { className: "ps-msr-section-size", children: wA }),
|
|
9307
9307
|
/* @__PURE__ */ A(
|
|
9308
9308
|
"span",
|
|
@@ -9685,10 +9685,10 @@ function Mo({ lines: o, fitRows: g, show: t, imgWidth: r, imgHeight: B }) {
|
|
|
9685
9685
|
if (!G || typeof G.x1 != "number" || typeof G.x2 != "number" || typeof G.y != "number") return null;
|
|
9686
9686
|
const W = Math.abs(G.x2 - G.x1);
|
|
9687
9687
|
if (f > 0 && W < f * 0.35 || W * w < 20) return null;
|
|
9688
|
-
const V = G.x1 * w, i = G.x2 * w, b = G.y * s,
|
|
9688
|
+
const V = G.x1 * w, i = G.x2 * w, b = G.y * s, E = i - V, M = E * 0.06, z = (V + i) / 2, j = g.find((Ae) => {
|
|
9689
9689
|
const MA = Ae.area.toLowerCase().trim();
|
|
9690
9690
|
return !!(MA === L || L === "chest" && (MA.includes("bust") || MA.includes("chest")) || L === "waist" && MA.includes("waist") || L === "hips" && (MA.includes("hip") || MA === "hips"));
|
|
9691
|
-
}), wA = j ? a(j.fit) : "#2154EF", J = d * 0.35, ne = `M ${V} ${b} Q ${z} ${b + M} ${i} ${b}`, h =
|
|
9691
|
+
}), wA = j ? a(j.fit) : "#2154EF", J = d * 0.35, ne = `M ${V} ${b} Q ${z} ${b + M} ${i} ${b}`, h = E * 1.05, Ce = j ? j.fit === "good" ? "✓ Fit" : j.isLength ? j.fit.includes("short") || j.fit.includes("tight") ? "Short" : "Long" : j.fit.includes("tight") ? "Tight" : "Loose" : I, oA = Math.round(14 * x), O = Ce.length * oA * 0.62, T = w - i - 12 * x < O, _ = T ? V - 10 * x : i + 10 * x, pA = T ? "end" : "start", nA = T ? V : i, jA = T ? V - 6 * x : i + 6 * x;
|
|
9692
9692
|
return /* @__PURE__ */ e("g", { children: [
|
|
9693
9693
|
/* @__PURE__ */ A(
|
|
9694
9694
|
"path",
|
|
@@ -9819,7 +9819,7 @@ function jo({
|
|
|
9819
9819
|
backLabel: V,
|
|
9820
9820
|
internationalSizes: i,
|
|
9821
9821
|
continueLabel: b,
|
|
9822
|
-
renderRaw:
|
|
9822
|
+
renderRaw: E = !1,
|
|
9823
9823
|
sectionFound: M,
|
|
9824
9824
|
allSizes: z
|
|
9825
9825
|
}) {
|
|
@@ -9909,7 +9909,7 @@ function jo({
|
|
|
9909
9909
|
}
|
|
9910
9910
|
return { range: _A, ...u };
|
|
9911
9911
|
}, [g, uA, ee, B, iA]), ve = He(() => {
|
|
9912
|
-
if (
|
|
9912
|
+
if (E)
|
|
9913
9913
|
return (t?.matchDetails || []).map((YA) => {
|
|
9914
9914
|
let xA = YA.chartRange, yA = YA.fit;
|
|
9915
9915
|
if (de !== j) {
|
|
@@ -9984,9 +9984,9 @@ function jo({
|
|
|
9984
9984
|
isLength: yA
|
|
9985
9985
|
};
|
|
9986
9986
|
});
|
|
9987
|
-
}, [t, n, r,
|
|
9987
|
+
}, [t, n, r, E, z, de]), De = ve.filter(
|
|
9988
9988
|
(H) => H.fit === "good" || H.fit === "a-bit-tight" || H.fit === "a-bit-loose"
|
|
9989
|
-
).length, me = ve.length > 0 ? Math.round(De / ve.length * 100) : 0, XA = !
|
|
9989
|
+
).length, me = ve.length > 0 ? Math.round(De / ve.length * 100) : 0, XA = !E, DA = t, mA = DA?.size || j, F = (t?.matchDetails || []).find(
|
|
9990
9990
|
(H) => /inseam|length/i.test(H.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(H.measurement)
|
|
9991
9991
|
), lA = F ? (F.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", Qe = DA?.length || jA || lA, we = DA?.availableSizes || [], Oe = DA?.availableLengths || [], ZA = Ae || Qe, tA = we.length > 0 ? we : RA, re = (() => {
|
|
9992
9992
|
if (tA.length <= 3) return tA;
|
|
@@ -10148,7 +10148,7 @@ function jo({
|
|
|
10148
10148
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-cells", children: [
|
|
10149
10149
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-cell", children: [
|
|
10150
10150
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: s("USER") }),
|
|
10151
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children:
|
|
10151
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: E ? S.rawUserValue || "" : isNaN(S.userNum) || S.userNum === 0 ? "" : `${O(S.userNum)} ${B}` })
|
|
10152
10152
|
] }),
|
|
10153
10153
|
/* @__PURE__ */ e("div", { className: "ps-msd-row-cell ps-right", children: [
|
|
10154
10154
|
/* @__PURE__ */ e("span", { className: "ps-msd-cell-label", children: [
|
|
@@ -10156,7 +10156,7 @@ function jo({
|
|
|
10156
10156
|
" ",
|
|
10157
10157
|
de
|
|
10158
10158
|
] }),
|
|
10159
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children:
|
|
10159
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: E ? S.rawChartRange || "" : T(S.chartLabel) })
|
|
10160
10160
|
] })
|
|
10161
10161
|
] }),
|
|
10162
10162
|
/* @__PURE__ */ e("div", { className: `ps-msd-row-badge ${ie}`, children: [
|
|
@@ -10381,8 +10381,8 @@ function jo({
|
|
|
10381
10381
|
const EA = H.fit === "good" ? "#2154EF" : H.isLength ? H.fit.includes("short") || H.fit.includes("tight") ? "#dc2626" : "#d97706" : H.fit.includes("tight") ? "#dc2626" : "#d97706", S = H.fit === "good" ? "rgba(33,84,239,0.08)" : H.isLength ? H.fit.includes("short") || H.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : H.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
10382
10382
|
return /* @__PURE__ */ e("tr", { style: { borderBottom: AA < ve.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
10383
10383
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: H.area }),
|
|
10384
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children:
|
|
10385
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children:
|
|
10384
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? H.rawUserValue || "" : isNaN(H.userNum) || H.userNum === 0 ? "" : `${O(H.userNum)} ${B}` }),
|
|
10385
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: E ? H.rawChartRange || "" : T(H.chartLabel) }),
|
|
10386
10386
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: EA, background: S, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: H.isLength ? Og(H.fit, s) : sr(H.fit, s) }) })
|
|
10387
10387
|
] }, AA);
|
|
10388
10388
|
}) })
|
|
@@ -10548,7 +10548,7 @@ function Br({
|
|
|
10548
10548
|
faceLandmarks: V = null,
|
|
10549
10549
|
measurementType: i = "body",
|
|
10550
10550
|
estimationDone: b = !1,
|
|
10551
|
-
activeSection:
|
|
10551
|
+
activeSection: E,
|
|
10552
10552
|
setActiveSection: M,
|
|
10553
10553
|
onResetTryOn: z,
|
|
10554
10554
|
onClose: j,
|
|
@@ -10557,28 +10557,28 @@ function Br({
|
|
|
10557
10557
|
onPendingCustomSizeChange: ne,
|
|
10558
10558
|
t: h
|
|
10559
10559
|
}) {
|
|
10560
|
-
const Ce = (g?.unit || l || "").toString().toLowerCase(), oA = Ce === "mm" ? "mm" : Ce === "cm" ? "cm" : "in", O = h(oA === "mm" ? "mm" : l === "cm" ? "cm" : "in"), [GA, T] = Q({}), _ = at, pA = bA((
|
|
10560
|
+
const Ce = (g?.unit || l || "").toString().toLowerCase(), oA = Ce === "mm" ? "mm" : Ce === "cm" ? "cm" : "in", O = h(oA === "mm" ? "mm" : l === "cm" ? "cm" : "in"), [GA, T] = Q({}), _ = at, pA = bA((v, y, K) => Re(v, y, K), []), nA = He(() => {
|
|
10561
10561
|
if (!t?.headers || !t?.rows) return -1;
|
|
10562
|
-
const
|
|
10563
|
-
if (
|
|
10562
|
+
const v = t.headers.findIndex((y) => /size|taglia|größe|taille/i.test(y.trim()));
|
|
10563
|
+
if (v >= 0) return v;
|
|
10564
10564
|
for (let y = 0; y < t.headers.length; y++) {
|
|
10565
10565
|
const K = t.headers[y];
|
|
10566
10566
|
if (t.rows.some((N) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(pA(N, y, K)))) return y;
|
|
10567
10567
|
}
|
|
10568
10568
|
return 0;
|
|
10569
10569
|
}, [t, pA]), jA = t?.headers?.[nA] || h("Size");
|
|
10570
|
-
He(() => nA < 0 || !t?.rows ? [] : t.rows.map((
|
|
10570
|
+
He(() => nA < 0 || !t?.rows ? [] : t.rows.map((v) => pA(v, nA, jA)).filter(Boolean), [t, nA, jA, pA]);
|
|
10571
10571
|
const Ae = He(() => {
|
|
10572
10572
|
if (!t?.headers || !t?.rows) return [];
|
|
10573
|
-
const
|
|
10573
|
+
const v = [];
|
|
10574
10574
|
for (let y = 0; y < t.headers.length; y++) {
|
|
10575
10575
|
const K = (t.headers[y] || "").toLowerCase();
|
|
10576
10576
|
if (/\(cm\)|centimeter/i.test(K)) {
|
|
10577
|
-
|
|
10577
|
+
v.push("cm");
|
|
10578
10578
|
continue;
|
|
10579
10579
|
}
|
|
10580
10580
|
if (/\(in\)|\(inch|inch/i.test(K)) {
|
|
10581
|
-
|
|
10581
|
+
v.push("in");
|
|
10582
10582
|
continue;
|
|
10583
10583
|
}
|
|
10584
10584
|
let N = null;
|
|
@@ -10595,12 +10595,12 @@ function Br({
|
|
|
10595
10595
|
}
|
|
10596
10596
|
}
|
|
10597
10597
|
}
|
|
10598
|
-
|
|
10598
|
+
v.push(N);
|
|
10599
10599
|
}
|
|
10600
|
-
return
|
|
10601
|
-
}, [t, pA]), MA = bA((
|
|
10600
|
+
return v;
|
|
10601
|
+
}, [t, pA]), MA = bA((v, y) => {
|
|
10602
10602
|
if (!t?.headers || !t?.rows || nA < 0) return null;
|
|
10603
|
-
const K =
|
|
10603
|
+
const K = v.toLowerCase().trim(), N = O === "cm" || O === "", cA = N ? "cm" : "in", X = [];
|
|
10604
10604
|
for (let p = 0; p < t.headers.length; p++) {
|
|
10605
10605
|
const Z = (t.headers[p] || "").toLowerCase().trim();
|
|
10606
10606
|
if (Z === K) {
|
|
@@ -10629,8 +10629,8 @@ function Br({
|
|
|
10629
10629
|
return { range: fe, ...HA };
|
|
10630
10630
|
}, [t, nA, jA, O, pA, _, Ae]), OA = g?.recommendedSize || "";
|
|
10631
10631
|
He(() => g?.internationalSizes || {}, [g]);
|
|
10632
|
-
const [he, uA] = Q("fit"), [ee, RA] = Q(null), [de, vA] = Q(!1), [TA, iA] = Q(!1), [Me, ve] = Q(!1), [De, me] = Q(null), [XA, DA] = Q(!1), [mA, F] = Q({ w: 800, h: 1200 }), lA = J ?? {}, Qe = bA((
|
|
10633
|
-
const y =
|
|
10632
|
+
const [he, uA] = Q("fit"), [ee, RA] = Q(null), [de, vA] = Q(!1), [TA, iA] = Q(!1), [Me, ve] = Q(!1), [De, me] = Q(null), [XA, DA] = Q(!1), [mA, F] = Q({ w: 800, h: 1200 }), lA = J ?? {}, Qe = bA((v) => {
|
|
10633
|
+
const y = v.currentTarget;
|
|
10634
10634
|
y.naturalWidth && y.naturalHeight && F({ w: y.naturalWidth, h: y.naturalHeight });
|
|
10635
10635
|
}, []);
|
|
10636
10636
|
kA(() => {
|
|
@@ -10638,8 +10638,8 @@ function Br({
|
|
|
10638
10638
|
me(null), DA(!1);
|
|
10639
10639
|
return;
|
|
10640
10640
|
}
|
|
10641
|
-
DA(!1), Wo(r).then((
|
|
10642
|
-
me(
|
|
10641
|
+
DA(!1), Wo(r).then((v) => {
|
|
10642
|
+
me(v), DA(!0);
|
|
10643
10643
|
}).catch(() => {
|
|
10644
10644
|
DA(!0);
|
|
10645
10645
|
});
|
|
@@ -10649,18 +10649,18 @@ function Br({
|
|
|
10649
10649
|
const [re, LA] = Q(!1), [$A, H] = Q(null), [AA, EA] = Q(!1), S = hA(null), [IA, CA] = Q(null), [ie, Ee] = Q(!1);
|
|
10650
10650
|
kA(() => {
|
|
10651
10651
|
if ($A) {
|
|
10652
|
-
const
|
|
10653
|
-
return CA(
|
|
10652
|
+
const v = URL.createObjectURL($A);
|
|
10653
|
+
return CA(v), () => URL.revokeObjectURL(v);
|
|
10654
10654
|
}
|
|
10655
10655
|
CA(null);
|
|
10656
10656
|
}, [$A]);
|
|
10657
10657
|
const oe = ee || OA;
|
|
10658
10658
|
He(() => {
|
|
10659
10659
|
if (!g?.matchDetails?.length) return [];
|
|
10660
|
-
const
|
|
10660
|
+
const v = /* @__PURE__ */ new Set();
|
|
10661
10661
|
return g.matchDetails.filter((K) => {
|
|
10662
10662
|
const N = K.measurement.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
10663
|
-
return
|
|
10663
|
+
return v.has(N) ? !1 : (v.add(N), !0);
|
|
10664
10664
|
}).map((K) => {
|
|
10665
10665
|
const N = _e(K.userValue);
|
|
10666
10666
|
let cA = K.chartRange, X = K.fit;
|
|
@@ -10683,31 +10683,31 @@ function Br({
|
|
|
10683
10683
|
});
|
|
10684
10684
|
}, [g, oe, OA, MA]), He(() => {
|
|
10685
10685
|
if (!t?.headers || !t?.rows || nA < 0) return null;
|
|
10686
|
-
const
|
|
10687
|
-
if (!
|
|
10686
|
+
const v = t.rows.find((K) => pA(K, nA, jA) === oe);
|
|
10687
|
+
if (!v) return null;
|
|
10688
10688
|
const y = [];
|
|
10689
10689
|
for (let K = 0; K < t.headers.length; K++) {
|
|
10690
10690
|
const N = t.headers[K] || "";
|
|
10691
10691
|
if (K === nA) continue;
|
|
10692
|
-
const cA = pA(
|
|
10692
|
+
const cA = pA(v, K, N);
|
|
10693
10693
|
cA && y.push({ header: N, value: cA });
|
|
10694
10694
|
}
|
|
10695
10695
|
return y;
|
|
10696
10696
|
}, [t, nA, jA, oe, pA]);
|
|
10697
10697
|
const NA = !!(t?.sections && Object.keys(t.sections).length > 1), _A = He(() => {
|
|
10698
|
-
const
|
|
10698
|
+
const v = {}, y = (K) => {
|
|
10699
10699
|
if (K)
|
|
10700
10700
|
for (const N of K) {
|
|
10701
10701
|
const cA = N.measurement.toLowerCase();
|
|
10702
|
-
if (
|
|
10702
|
+
if (v[cA] == null) {
|
|
10703
10703
|
const X = _e(N.userValue);
|
|
10704
|
-
X > 0 && (
|
|
10704
|
+
X > 0 && (v[cA] = X);
|
|
10705
10705
|
}
|
|
10706
10706
|
}
|
|
10707
10707
|
};
|
|
10708
10708
|
if (y(g?.matchDetails), g?.sections)
|
|
10709
10709
|
for (const K of Object.values(g.sections)) y(K.matchDetails);
|
|
10710
|
-
return wA && wA > 0 &&
|
|
10710
|
+
return wA && wA > 0 && v.height == null && (v.height = wA), g?.sections && Object.keys(g.sections).length > 0 ? Object.entries(g.sections).map(([K, N]) => {
|
|
10711
10711
|
const cA = K.toLowerCase();
|
|
10712
10712
|
let X = t?.sections?.[K];
|
|
10713
10713
|
if (!X && t?.sections) {
|
|
@@ -10718,7 +10718,7 @@ function Br({
|
|
|
10718
10718
|
JA && (X = JA[1]);
|
|
10719
10719
|
}
|
|
10720
10720
|
X || (X = { headers: [], rows: [], requiredFields: [] });
|
|
10721
|
-
const FA = { ...
|
|
10721
|
+
const FA = { ...v };
|
|
10722
10722
|
if (N.matchDetails)
|
|
10723
10723
|
for (const JA of N.matchDetails) {
|
|
10724
10724
|
const WA = _e(JA.userValue);
|
|
@@ -10726,7 +10726,7 @@ function Br({
|
|
|
10726
10726
|
}
|
|
10727
10727
|
return { name: K, section: X, secResult: N, userMeasurements: FA };
|
|
10728
10728
|
}) : !NA || !t?.sections ? [] : Object.entries(t.sections).map(([K, N]) => {
|
|
10729
|
-
const cA = g?.sections?.[K] || { recommendedSize: g?.recommendedSize || "", matchDetails: [] }, X = { ...
|
|
10729
|
+
const cA = g?.sections?.[K] || { recommendedSize: g?.recommendedSize || "", matchDetails: [] }, X = { ...v };
|
|
10730
10730
|
if (cA.matchDetails)
|
|
10731
10731
|
for (const FA of cA.matchDetails) {
|
|
10732
10732
|
const JA = _e(FA.userValue);
|
|
@@ -10734,13 +10734,13 @@ function Br({
|
|
|
10734
10734
|
}
|
|
10735
10735
|
return { name: K, section: N, secResult: cA, userMeasurements: X };
|
|
10736
10736
|
});
|
|
10737
|
-
}, [NA, t, g, wA]), u = He(() => _A.filter((
|
|
10737
|
+
}, [NA, t, g, wA]), u = He(() => _A.filter((v) => !Lg(v.name)), [_A]), YA = He(() => _A.filter((v) => Lg(v.name)), [_A]), xA = bA((v, y) => {
|
|
10738
10738
|
if (!y) return y;
|
|
10739
|
-
let N = ig(
|
|
10740
|
-
if (N || (N = _A.find((WA) => WA.name ===
|
|
10739
|
+
let N = ig(v, YA)?.secResult?.recommendedSize?.trim() || "";
|
|
10740
|
+
if (N || (N = _A.find((WA) => WA.name === v)?.secResult?.length?.trim() || ""), !N) return y;
|
|
10741
10741
|
const cA = N.toLowerCase();
|
|
10742
10742
|
if (/^\d/.test(N)) {
|
|
10743
|
-
const WA = /pant|trouser|inseam/i.test(
|
|
10743
|
+
const WA = /pant|trouser|inseam/i.test(v) ? "Inseam" : "Length";
|
|
10744
10744
|
return `${y} / ${WA} ${N}`;
|
|
10745
10745
|
}
|
|
10746
10746
|
if (/^x(tra)?[- ]?long/.test(cA)) return /^\d/.test(y) ? `${y}XL` : `${y} / Extra Long`;
|
|
@@ -10752,13 +10752,13 @@ function Br({
|
|
|
10752
10752
|
return `${y} / ${FA}`;
|
|
10753
10753
|
}, [YA, _A]);
|
|
10754
10754
|
He(() => {
|
|
10755
|
-
const
|
|
10756
|
-
if (!
|
|
10755
|
+
const v = wA || 0;
|
|
10756
|
+
if (!v) return "";
|
|
10757
10757
|
if (O === "in") {
|
|
10758
|
-
const y =
|
|
10758
|
+
const y = v / 2.54, K = Math.floor(y / 12), N = Math.round(y - K * 12);
|
|
10759
10759
|
return `${K}'${N}"`;
|
|
10760
10760
|
}
|
|
10761
|
-
return `${Math.round(
|
|
10761
|
+
return `${Math.round(v)} cm`;
|
|
10762
10762
|
}, [wA, O]);
|
|
10763
10763
|
const yA = !!P, q = yA && o, ge = !yA && o, le = !!g, Pe = yA ? le && (!!r && !I) : le, BA = Go(), UA = i === "face" || i === "head";
|
|
10764
10764
|
g?.found;
|
|
@@ -10824,11 +10824,11 @@ function Br({
|
|
|
10824
10824
|
i === "face" || i === "head" ? V && /* @__PURE__ */ A(nr, { landmarks: V, imgWidth: mA.w, imgHeight: mA.h }) : W && /* @__PURE__ */ A(ir, { landmarks: W, imgWidth: mA.w, imgHeight: mA.h })
|
|
10825
10825
|
] }),
|
|
10826
10826
|
(() => {
|
|
10827
|
-
const
|
|
10828
|
-
return h(
|
|
10827
|
+
const v = i === "face" || i === "head";
|
|
10828
|
+
return h(v ? i === "head" ? "Detecting head" : "Detecting face" : "Detecting body pose"), /* @__PURE__ */ A("div", { className: "ps-tryon-sr-right-col", style: { display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ A(
|
|
10829
10829
|
rr,
|
|
10830
10830
|
{
|
|
10831
|
-
category:
|
|
10831
|
+
category: v ? i : "body",
|
|
10832
10832
|
sizingDone: le,
|
|
10833
10833
|
t: h
|
|
10834
10834
|
}
|
|
@@ -10836,28 +10836,28 @@ function Br({
|
|
|
10836
10836
|
})()
|
|
10837
10837
|
] }),
|
|
10838
10838
|
(Pe || g && !q) && /* @__PURE__ */ e(eA, { children: [
|
|
10839
|
-
NA ?
|
|
10839
|
+
NA ? E ? (
|
|
10840
10840
|
/* ── Detail view for a single section ── */
|
|
10841
10841
|
(() => {
|
|
10842
|
-
const
|
|
10843
|
-
return
|
|
10842
|
+
const v = u.find((y) => y.name === E);
|
|
10843
|
+
return v ? BA ? /* @__PURE__ */ e(eA, { children: [
|
|
10844
10844
|
be && /* @__PURE__ */ A("div", { style: { padding: "0 16px" }, children: be }),
|
|
10845
10845
|
/* @__PURE__ */ A(
|
|
10846
10846
|
jo,
|
|
10847
10847
|
{
|
|
10848
|
-
sectionName:
|
|
10849
|
-
section:
|
|
10850
|
-
sectionResult:
|
|
10851
|
-
sectionFound:
|
|
10852
|
-
userMeasurements:
|
|
10848
|
+
sectionName: v.name,
|
|
10849
|
+
section: v.section,
|
|
10850
|
+
sectionResult: v.secResult,
|
|
10851
|
+
sectionFound: v.secResult?.found,
|
|
10852
|
+
userMeasurements: v.userMeasurements,
|
|
10853
10853
|
unitLbl: O,
|
|
10854
10854
|
chartUnit: oA,
|
|
10855
10855
|
lengthEntry: (() => {
|
|
10856
|
-
const y = ig(
|
|
10857
|
-
return y ||
|
|
10856
|
+
const y = ig(v.name, YA);
|
|
10857
|
+
return y || v.secResult?.availableLengths?.length > 0 && YA.find((N) => N.section.headers.some((cA) => /height|altezza|estatura|\(cm\)/i.test(cA))) || null;
|
|
10858
10858
|
})(),
|
|
10859
10859
|
onBack: () => M(null),
|
|
10860
|
-
internationalSizes:
|
|
10860
|
+
internationalSizes: v.secResult?.internationalSizes,
|
|
10861
10861
|
productImage: r || B,
|
|
10862
10862
|
productTitle: n,
|
|
10863
10863
|
isMobile: !0,
|
|
@@ -10886,7 +10886,7 @@ function Br({
|
|
|
10886
10886
|
}
|
|
10887
10887
|
) : null,
|
|
10888
10888
|
t: h,
|
|
10889
|
-
allSizes: g?.allSizes
|
|
10889
|
+
allSizes: v.secResult?.allSizes ?? g?.allSizes
|
|
10890
10890
|
}
|
|
10891
10891
|
)
|
|
10892
10892
|
] }) : /* @__PURE__ */ e("div", { className: "ps-tryon-v2", children: [
|
|
@@ -10896,24 +10896,24 @@ function Br({
|
|
|
10896
10896
|
/* @__PURE__ */ A(
|
|
10897
10897
|
jo,
|
|
10898
10898
|
{
|
|
10899
|
-
sectionName:
|
|
10900
|
-
section:
|
|
10901
|
-
sectionResult:
|
|
10902
|
-
sectionFound:
|
|
10903
|
-
userMeasurements:
|
|
10899
|
+
sectionName: v.name,
|
|
10900
|
+
section: v.section,
|
|
10901
|
+
sectionResult: v.secResult,
|
|
10902
|
+
sectionFound: v.secResult?.found,
|
|
10903
|
+
userMeasurements: v.userMeasurements,
|
|
10904
10904
|
unitLbl: O,
|
|
10905
10905
|
chartUnit: oA,
|
|
10906
10906
|
lengthEntry: (() => {
|
|
10907
|
-
const y = ig(
|
|
10908
|
-
return y ||
|
|
10907
|
+
const y = ig(v.name, YA);
|
|
10908
|
+
return y || v.secResult?.availableLengths?.length > 0 && YA.find((N) => N.section.headers.some((cA) => /height|altezza|estatura|\(cm\)/i.test(cA))) || null;
|
|
10909
10909
|
})(),
|
|
10910
10910
|
onBack: () => M(null),
|
|
10911
|
-
internationalSizes:
|
|
10911
|
+
internationalSizes: v.secResult?.internationalSizes,
|
|
10912
10912
|
t: h,
|
|
10913
|
-
allSizes: g?.allSizes
|
|
10913
|
+
allSizes: v.secResult?.allSizes ?? g?.allSizes
|
|
10914
10914
|
}
|
|
10915
10915
|
)
|
|
10916
|
-
] }, `detail-${
|
|
10916
|
+
] }, `detail-${E}`)
|
|
10917
10917
|
] }) : null;
|
|
10918
10918
|
})()
|
|
10919
10919
|
) : BA ? (
|
|
@@ -10925,12 +10925,12 @@ function Br({
|
|
|
10925
10925
|
productTitle: n,
|
|
10926
10926
|
sizingResult: g,
|
|
10927
10927
|
sizeGuide: t,
|
|
10928
|
-
sectionEntries: u.map(({ name:
|
|
10928
|
+
sectionEntries: u.map(({ name: v, secResult: y }) => {
|
|
10929
10929
|
const K = y?.size || y.recommendedSize || "";
|
|
10930
|
-
return { name:
|
|
10930
|
+
return { name: v, secResult: { ...y, recommendedSize: xA(v, K) } };
|
|
10931
10931
|
}),
|
|
10932
10932
|
pendingCustomSizes: lA,
|
|
10933
|
-
onSelectSection: (
|
|
10933
|
+
onSelectSection: (v) => M(v),
|
|
10934
10934
|
onTryOn: () => {
|
|
10935
10935
|
H(m || null), LA(!0);
|
|
10936
10936
|
},
|
|
@@ -10949,12 +10949,12 @@ function Br({
|
|
|
10949
10949
|
{
|
|
10950
10950
|
lines: De,
|
|
10951
10951
|
fitRows: (() => {
|
|
10952
|
-
const
|
|
10952
|
+
const v = [...g?.matchDetails || []];
|
|
10953
10953
|
if (g?.sections)
|
|
10954
10954
|
for (const K of Object.values(g.sections))
|
|
10955
|
-
K.matchDetails &&
|
|
10955
|
+
K.matchDetails && v.push(...K.matchDetails);
|
|
10956
10956
|
const y = /* @__PURE__ */ new Set();
|
|
10957
|
-
return
|
|
10957
|
+
return v.filter((K) => {
|
|
10958
10958
|
const N = K.measurement.toLowerCase();
|
|
10959
10959
|
return y.has(N) ? !1 : (y.add(N), !0);
|
|
10960
10960
|
}).map((K) => ({ area: K.measurement, userNum: parseFloat(K.userValue) || 0, chartLabel: K.chartRange || "", fit: K.fit }));
|
|
@@ -10975,12 +10975,12 @@ function Br({
|
|
|
10975
10975
|
I && /* @__PURE__ */ A(Yg, { tryOnStartedAt: d ?? null, t: h }),
|
|
10976
10976
|
/* @__PURE__ */ A(Gg, { active: !!I }),
|
|
10977
10977
|
r && !I && XA && De && /* @__PURE__ */ A(Mo, { lines: De, fitRows: (() => {
|
|
10978
|
-
const
|
|
10978
|
+
const v = [...g?.matchDetails || []];
|
|
10979
10979
|
if (g?.sections)
|
|
10980
10980
|
for (const K of Object.values(g.sections))
|
|
10981
|
-
K.matchDetails &&
|
|
10981
|
+
K.matchDetails && v.push(...K.matchDetails);
|
|
10982
10982
|
const y = /* @__PURE__ */ new Set();
|
|
10983
|
-
return
|
|
10983
|
+
return v.filter((K) => {
|
|
10984
10984
|
const N = K.measurement.toLowerCase();
|
|
10985
10985
|
return y.has(N) ? !1 : (y.add(N), !0);
|
|
10986
10986
|
}).map((K) => ({ area: K.measurement, userNum: parseFloat(K.userValue) || 0, chartLabel: K.chartRange || "", fit: K.fit }));
|
|
@@ -11010,13 +11010,13 @@ function Br({
|
|
|
11010
11010
|
/* @__PURE__ */ A("p", { className: "ps-tryon-v2-subtitle", children: h("Tap any section for detailed breakdown") }),
|
|
11011
11011
|
be,
|
|
11012
11012
|
/* @__PURE__ */ A("div", { className: "ps-tryon-v2-sep" }),
|
|
11013
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: u.map(({ name:
|
|
11014
|
-
const N = t?.sectionImages?.[
|
|
11015
|
-
return /* @__PURE__ */ e("button", { className: `ps-tryon-sr-card-v2${X ? " ps-full" : ""}${WA ? " ps-overridden" : ""}`, onClick: () => M(
|
|
11013
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: u.map(({ name: v, secResult: y }, K) => {
|
|
11014
|
+
const N = t?.sectionImages?.[v], cA = gr(v), X = K === u.length - 1 && u.length % 2 !== 0, FA = y, JA = lA[v], WA = !!JA, fe = WA ? JA.displayLabel : xA(v, FA.size || y.recommendedSize || "");
|
|
11015
|
+
return /* @__PURE__ */ e("button", { className: `ps-tryon-sr-card-v2${X ? " ps-full" : ""}${WA ? " ps-overridden" : ""}`, onClick: () => M(v), style: { animationDelay: `${K * 0.07}s` }, children: [
|
|
11016
11016
|
/* @__PURE__ */ e("div", { className: "ps-tryon-sr-card-v2-text", children: [
|
|
11017
11017
|
/* @__PURE__ */ e("span", { className: "ps-tryon-sr-card-v2-label", children: [
|
|
11018
11018
|
cA && /* @__PURE__ */ A("img", { src: cA, alt: "", className: "ps-tryon-sr-card-v2-label-icon" }),
|
|
11019
|
-
|
|
11019
|
+
v.replace(/\s*[—–-]\s*.*/g, "")
|
|
11020
11020
|
] }),
|
|
11021
11021
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: FA.found === !1 ? h("No fit") : (() => {
|
|
11022
11022
|
const HA = fe.indexOf(" / ");
|
|
@@ -11038,8 +11038,8 @@ function Br({
|
|
|
11038
11038
|
/* @__PURE__ */ A("span", { "aria-hidden": "true", children: "›" })
|
|
11039
11039
|
] })
|
|
11040
11040
|
] }),
|
|
11041
|
-
N && /* @__PURE__ */ A("img", { src: N, alt:
|
|
11042
|
-
] },
|
|
11041
|
+
N && /* @__PURE__ */ A("img", { src: N, alt: v, className: "ps-tryon-sr-card-v2-img" })
|
|
11042
|
+
] }, v);
|
|
11043
11043
|
}) }),
|
|
11044
11044
|
/* @__PURE__ */ e("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginTop: "0.5vw", gap: "0.5vw" }, children: [
|
|
11045
11045
|
/* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: () => f("body-profile"), type: "button", children: [
|
|
@@ -11091,7 +11091,7 @@ function Br({
|
|
|
11091
11091
|
) : (
|
|
11092
11092
|
/* ── SINGLE-PIECE — rendered via SectionDetailView for visual parity with multi-garment ── */
|
|
11093
11093
|
(() => {
|
|
11094
|
-
const
|
|
11094
|
+
const v = t?.found ? { headers: t.headers || [], rows: t.rows || [], requiredFields: t.requiredFields || [] } : { headers: [], rows: [], requiredFields: [] }, y = { recommendedSize: g?.recommendedSize || "", matchDetails: g?.matchDetails || [] }, K = {};
|
|
11095
11095
|
if (g?.matchDetails)
|
|
11096
11096
|
for (const X of g.matchDetails) K[X.measurement.toLowerCase()] = _e(X.userValue);
|
|
11097
11097
|
const N = h("Your Fit"), cA = () => {
|
|
@@ -11103,7 +11103,7 @@ function Br({
|
|
|
11103
11103
|
jo,
|
|
11104
11104
|
{
|
|
11105
11105
|
sectionName: N,
|
|
11106
|
-
section:
|
|
11106
|
+
section: v,
|
|
11107
11107
|
sectionResult: y,
|
|
11108
11108
|
sectionFound: g?.found,
|
|
11109
11109
|
userMeasurements: K,
|
|
@@ -11162,13 +11162,13 @@ function Br({
|
|
|
11162
11162
|
] }),
|
|
11163
11163
|
/* @__PURE__ */ e("div", { className: "ps-tryon-v2-panel", children: [
|
|
11164
11164
|
be,
|
|
11165
|
-
|
|
11165
|
+
E === N ? (
|
|
11166
11166
|
/* DETAIL VIEW — full size table, same as multi-garment */
|
|
11167
11167
|
/* @__PURE__ */ A(
|
|
11168
11168
|
jo,
|
|
11169
11169
|
{
|
|
11170
11170
|
sectionName: N,
|
|
11171
|
-
section:
|
|
11171
|
+
section: v,
|
|
11172
11172
|
sectionResult: y,
|
|
11173
11173
|
sectionFound: g?.found,
|
|
11174
11174
|
userMeasurements: K,
|
|
@@ -11295,7 +11295,7 @@ function Br({
|
|
|
11295
11295
|
] })
|
|
11296
11296
|
] })
|
|
11297
11297
|
)
|
|
11298
|
-
] }, `panel-single-${
|
|
11298
|
+
] }, `panel-single-${E ? "detail" : "card"}`)
|
|
11299
11299
|
] });
|
|
11300
11300
|
})()
|
|
11301
11301
|
),
|
|
@@ -11315,8 +11315,8 @@ function Br({
|
|
|
11315
11315
|
type: "file",
|
|
11316
11316
|
accept: "image/jpeg,image/png,image/webp",
|
|
11317
11317
|
style: { display: "none" },
|
|
11318
|
-
onChange: (
|
|
11319
|
-
const y =
|
|
11318
|
+
onChange: (v) => {
|
|
11319
|
+
const y = v.target.files?.[0];
|
|
11320
11320
|
y && H(y);
|
|
11321
11321
|
}
|
|
11322
11322
|
}
|
|
@@ -11413,13 +11413,13 @@ function Br({
|
|
|
11413
11413
|
"div",
|
|
11414
11414
|
{
|
|
11415
11415
|
onClick: () => S.current?.click(),
|
|
11416
|
-
onDragOver: (
|
|
11417
|
-
|
|
11416
|
+
onDragOver: (v) => {
|
|
11417
|
+
v.preventDefault(), EA(!0);
|
|
11418
11418
|
},
|
|
11419
11419
|
onDragLeave: () => EA(!1),
|
|
11420
|
-
onDrop: (
|
|
11421
|
-
|
|
11422
|
-
const y =
|
|
11420
|
+
onDrop: (v) => {
|
|
11421
|
+
v.preventDefault(), EA(!1);
|
|
11422
|
+
const y = v.dataTransfer.files[0];
|
|
11423
11423
|
y && H(y);
|
|
11424
11424
|
},
|
|
11425
11425
|
style: {
|
|
@@ -11452,8 +11452,8 @@ function Br({
|
|
|
11452
11452
|
type: "file",
|
|
11453
11453
|
accept: "image/jpeg,image/png,image/webp",
|
|
11454
11454
|
style: { display: "none" },
|
|
11455
|
-
onChange: (
|
|
11456
|
-
const y =
|
|
11455
|
+
onChange: (v) => {
|
|
11456
|
+
const y = v.target.files?.[0];
|
|
11457
11457
|
y && H(y);
|
|
11458
11458
|
}
|
|
11459
11459
|
}
|
|
@@ -11554,11 +11554,11 @@ function Br({
|
|
|
11554
11554
|
/* @__PURE__ */ A("h4", { children: h("Full Size Chart") }),
|
|
11555
11555
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => vA(!1), children: "✕" })
|
|
11556
11556
|
] }),
|
|
11557
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: t.sections && Object.keys(t.sections).length > 1 ? Object.entries(t.sections).map(([
|
|
11558
|
-
const N = g?.sections?.[
|
|
11557
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: t.sections && Object.keys(t.sections).length > 1 ? Object.entries(t.sections).map(([v, y]) => {
|
|
11558
|
+
const N = g?.sections?.[v]?.recommendedSize || "", cA = y.headers.findIndex((JA) => /size|taglia|größe|taille|fit|length/i.test(JA.trim())), X = cA >= 0 ? cA : 0, FA = y.headers[X] || "Size";
|
|
11559
11559
|
return /* @__PURE__ */ e("div", { className: "ps-tryon-chart-section", children: [
|
|
11560
11560
|
/* @__PURE__ */ e("div", { className: "ps-tryon-chart-section-title", children: [
|
|
11561
|
-
/* @__PURE__ */ A("span", { children:
|
|
11561
|
+
/* @__PURE__ */ A("span", { children: v }),
|
|
11562
11562
|
N && /* @__PURE__ */ e("span", { className: "ps-tryon-chart-section-rec", children: [
|
|
11563
11563
|
h("Your size"),
|
|
11564
11564
|
": ",
|
|
@@ -11572,14 +11572,14 @@ function Br({
|
|
|
11572
11572
|
return /* @__PURE__ */ A("tr", { className: HA ? "ps-active-row" : "", children: y.headers.map((ke, p) => /* @__PURE__ */ A("td", { className: p === X ? "ps-size-col" : "", children: Re(JA, p, ke) }, p)) }, WA);
|
|
11573
11573
|
}) })
|
|
11574
11574
|
] }) })
|
|
11575
|
-
] },
|
|
11575
|
+
] }, v);
|
|
11576
11576
|
}) : t.headers && t.rows ? (
|
|
11577
11577
|
/* Single section fallback */
|
|
11578
11578
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ e("table", { className: "ps-tryon-sr-chart-table", children: [
|
|
11579
|
-
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: t.headers.map((
|
|
11580
|
-
/* @__PURE__ */ A("tbody", { children: t.rows.map((
|
|
11581
|
-
const N = pA(
|
|
11582
|
-
return /* @__PURE__ */ A("tr", { className: N ? "ps-active-row" : "", children: t.headers.map((cA, X) => /* @__PURE__ */ A("td", { className: X === nA ? "ps-size-col" : "", children: pA(
|
|
11579
|
+
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: t.headers.map((v, y) => /* @__PURE__ */ A("th", { className: y === nA ? "ps-size-col" : "", children: v }, y)) }) }),
|
|
11580
|
+
/* @__PURE__ */ A("tbody", { children: t.rows.map((v, y) => {
|
|
11581
|
+
const N = pA(v, nA, jA) === oe;
|
|
11582
|
+
return /* @__PURE__ */ A("tr", { className: N ? "ps-active-row" : "", children: t.headers.map((cA, X) => /* @__PURE__ */ A("td", { className: X === nA ? "ps-size-col" : "", children: pA(v, X, cA) }, X)) }, y);
|
|
11583
11583
|
}) })
|
|
11584
11584
|
] }) })
|
|
11585
11585
|
) : null })
|
|
@@ -11659,22 +11659,22 @@ function zg({
|
|
|
11659
11659
|
onClearPhoto: f,
|
|
11660
11660
|
t: D
|
|
11661
11661
|
}) {
|
|
11662
|
-
const m = hA(null), P = hA(0), [x, L] = Q(!1), [G, I] = Q(!1), [d, W] = Q(""), [V, i] = Q(null), [b,
|
|
11662
|
+
const m = hA(null), P = hA(0), [x, L] = Q(!1), [G, I] = Q(!1), [d, W] = Q(""), [V, i] = Q(null), [b, E] = Q(null);
|
|
11663
11663
|
kA(() => {
|
|
11664
|
-
t || (i(null),
|
|
11664
|
+
t || (i(null), E(null));
|
|
11665
11665
|
}, [t]);
|
|
11666
11666
|
const M = async (O) => {
|
|
11667
11667
|
if (!(a || G)) {
|
|
11668
|
-
if (
|
|
11669
|
-
|
|
11668
|
+
if (E(null), i(null), r && B !== !0) {
|
|
11669
|
+
E(D("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
11670
11670
|
return;
|
|
11671
11671
|
}
|
|
11672
11672
|
if (!O.type.startsWith("image/")) {
|
|
11673
|
-
|
|
11673
|
+
E(D("Please upload an image file"));
|
|
11674
11674
|
return;
|
|
11675
11675
|
}
|
|
11676
11676
|
if (O.size > 10 * 1024 * 1024) {
|
|
11677
|
-
|
|
11677
|
+
E(D("Image must be under 10MB"));
|
|
11678
11678
|
return;
|
|
11679
11679
|
}
|
|
11680
11680
|
if (o && g) {
|
|
@@ -11713,7 +11713,7 @@ function zg({
|
|
|
11713
11713
|
const GA = O.target.files?.[0];
|
|
11714
11714
|
GA && M(GA), m.current && (m.current.value = "");
|
|
11715
11715
|
}, Ce = () => {
|
|
11716
|
-
i(null),
|
|
11716
|
+
i(null), E(null), f?.();
|
|
11717
11717
|
};
|
|
11718
11718
|
return /* @__PURE__ */ e(
|
|
11719
11719
|
"div",
|
|
@@ -12012,9 +12012,9 @@ function lr({
|
|
|
12012
12012
|
], W = (() => {
|
|
12013
12013
|
const z = m("Pair this with neutral tones for a balanced look"), j = m("Layer with a fitted base for sharper silhouette"), wA = m("Cuff once for a relaxed everyday feel");
|
|
12014
12014
|
return [z, j, wA];
|
|
12015
|
-
})(), [V, i] = Q(0), [b,
|
|
12015
|
+
})(), [V, i] = Q(0), [b, E] = Q(0);
|
|
12016
12016
|
kA(() => {
|
|
12017
|
-
const z = setInterval(() => i((wA) => (wA + 1) % d.length), 4e3), j = setInterval(() =>
|
|
12017
|
+
const z = setInterval(() => i((wA) => (wA + 1) % d.length), 4e3), j = setInterval(() => E((wA) => (wA + 1) % W.length), 5e3);
|
|
12018
12018
|
return () => {
|
|
12019
12019
|
clearInterval(z), clearInterval(j);
|
|
12020
12020
|
};
|
|
@@ -12264,7 +12264,7 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12264
12264
|
kA(() => {
|
|
12265
12265
|
I.current && (I.current.scrollTop = 0);
|
|
12266
12266
|
}, [w, l]);
|
|
12267
|
-
const [d, W] = Q(""), [V, i] = Q("male"), [b,
|
|
12267
|
+
const [d, W] = Q(""), [V, i] = Q("male"), [b, E] = Q("cm"), [M, z] = Q(""), [j, wA] = Q(""), [J, ne] = Q(""), [h, Ce] = Q(""), [oA, O] = Q(""), [GA, T] = Q(""), [_, pA] = Q(null), [nA, jA] = Q(!1), [Ae, MA] = Q(""), [OA, he] = Q(null), [uA, ee] = Q(null), [RA, de] = Q({ w: 800, h: 1200 }), [vA, TA] = Q(0), [iA, Me] = Q(!1), [ve, De] = Q(!1);
|
|
12268
12268
|
kA(() => {
|
|
12269
12269
|
if (D !== "calculating" || !_) return;
|
|
12270
12270
|
let p = !1;
|
|
@@ -12328,13 +12328,13 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12328
12328
|
const p = parseInt(j, 10), Z = parseInt(J, 10);
|
|
12329
12329
|
!isNaN(p) && p >= 0 && !isNaN(Z) && Z >= 0 && z(String(Math.round((p * 12 + Z) * 2.54)));
|
|
12330
12330
|
}
|
|
12331
|
-
|
|
12331
|
+
E("cm");
|
|
12332
12332
|
}, UA = () => {
|
|
12333
12333
|
if (b === "cm") {
|
|
12334
12334
|
const p = parseFloat(M);
|
|
12335
12335
|
!isNaN(p) && p > 0 && (wA(String(Math.floor(p / 2.54 / 12))), ne(String(Math.round(p / 2.54 % 12))));
|
|
12336
12336
|
}
|
|
12337
|
-
|
|
12337
|
+
E("in");
|
|
12338
12338
|
}, ye = () => {
|
|
12339
12339
|
if (!d.trim())
|
|
12340
12340
|
return T(n("Please enter a profile name")), !1;
|
|
@@ -12350,7 +12350,7 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12350
12350
|
return T(n("Please enter a valid height")), !1;
|
|
12351
12351
|
const Z = parseFloat(h), PA = parseFloat(oA);
|
|
12352
12352
|
return !Z || Z <= 0 ? (T(n("Please enter a valid weight")), !1) : !PA || PA <= 0 ? (T(n("Please enter a valid age")), !1) : (T(""), !0);
|
|
12353
|
-
}, be = () => d.trim() ? (T(""), !0) : (T(n("Please enter a profile name")), !1),
|
|
12353
|
+
}, be = () => d.trim() ? (T(""), !0) : (T(n("Please enter a profile name")), !1), v = () => {
|
|
12354
12354
|
const p = b === "in" ? (parseInt(j, 10) || 0) * 12 + (parseInt(J, 10) || 0) : parseFloat(M);
|
|
12355
12355
|
return {
|
|
12356
12356
|
name: d.trim(),
|
|
@@ -12408,7 +12408,7 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12408
12408
|
return;
|
|
12409
12409
|
}
|
|
12410
12410
|
if (T(""), Pe) {
|
|
12411
|
-
o(
|
|
12411
|
+
o(v());
|
|
12412
12412
|
return;
|
|
12413
12413
|
}
|
|
12414
12414
|
f(ge[le + 1]);
|
|
@@ -12418,7 +12418,7 @@ function Or({ onSave: o, onCancel: g, apiUrl: t, apiKey: r, onPhotoPreview: B, o
|
|
|
12418
12418
|
const PA = ge.indexOf(p), ae = PA === se - 1;
|
|
12419
12419
|
setTimeout(() => {
|
|
12420
12420
|
if (ae) {
|
|
12421
|
-
const qA =
|
|
12421
|
+
const qA = v();
|
|
12422
12422
|
p === "chest" ? qA.chestProfile = Z : p === "stomach" ? qA.midsectionProfile = Z : (p === "seat" || p === "hips") && (qA.hipProfile = Z), o(qA);
|
|
12423
12423
|
} else
|
|
12424
12424
|
f(ge[PA + 1]);
|
|
@@ -13520,39 +13520,39 @@ function Sr({
|
|
|
13520
13520
|
isEstimating: s = !1,
|
|
13521
13521
|
t: l
|
|
13522
13522
|
}) {
|
|
13523
|
-
const f = o.gender === "female" ? Ur : Nr, D = o.measurements || {}, m = Object.keys(D).some((
|
|
13524
|
-
const
|
|
13523
|
+
const f = o.gender === "female" ? Ur : Nr, D = o.measurements || {}, m = Object.keys(D).some((E) => D[E] != null), [P, x] = Q(o.measurementsUnit || "cm"), [L, G] = Q(() => {
|
|
13524
|
+
const E = {};
|
|
13525
13525
|
return f.forEach((M) => {
|
|
13526
13526
|
const z = D[M.key];
|
|
13527
|
-
|
|
13528
|
-
}),
|
|
13527
|
+
E[M.key] = z != null ? String(Math.round(z * 10) / 10) : "";
|
|
13528
|
+
}), E;
|
|
13529
13529
|
});
|
|
13530
13530
|
kA(() => {
|
|
13531
|
-
G((
|
|
13532
|
-
const M = { ...
|
|
13531
|
+
G((E) => {
|
|
13532
|
+
const M = { ...E };
|
|
13533
13533
|
let z = !1;
|
|
13534
13534
|
return f.forEach((j) => {
|
|
13535
13535
|
const wA = D[j.key];
|
|
13536
|
-
wA != null && !
|
|
13537
|
-
}), z ? M :
|
|
13536
|
+
wA != null && !E[j.key] && (M[j.key] = String(Math.round(wA * 10) / 10), z = !0);
|
|
13537
|
+
}), z ? M : E;
|
|
13538
13538
|
});
|
|
13539
13539
|
}, [o.measurements, o.id]);
|
|
13540
|
-
const [I, d] = Q(o.bandSize || ""), [W, V] = Q(o.cupSize || ""), i = (
|
|
13541
|
-
|
|
13540
|
+
const [I, d] = Q(o.bandSize || ""), [W, V] = Q(o.cupSize || ""), i = (E) => {
|
|
13541
|
+
E !== P && (G((M) => {
|
|
13542
13542
|
const z = {};
|
|
13543
13543
|
for (const [j, wA] of Object.entries(M)) {
|
|
13544
13544
|
const J = parseFloat(wA);
|
|
13545
|
-
!isNaN(J) && J > 0 ? z[j] = String(
|
|
13545
|
+
!isNaN(J) && J > 0 ? z[j] = String(E === "in" ? Math.round(J / 2.54 * 10) / 10 : Math.round(J * 2.54 * 10) / 10) : z[j] = wA;
|
|
13546
13546
|
}
|
|
13547
13547
|
return z;
|
|
13548
|
-
}), x(
|
|
13548
|
+
}), x(E));
|
|
13549
13549
|
}, b = () => {
|
|
13550
|
-
const
|
|
13550
|
+
const E = { ...o.measurements || {} };
|
|
13551
13551
|
for (const [M, z] of Object.entries(L)) {
|
|
13552
13552
|
const j = parseFloat(z);
|
|
13553
|
-
!isNaN(j) && j > 0 && (
|
|
13553
|
+
!isNaN(j) && j > 0 && (E[M] = j);
|
|
13554
13554
|
}
|
|
13555
|
-
r(
|
|
13555
|
+
r(E, P), o.gender === "female" && w && (I || W) && w(I, W), n();
|
|
13556
13556
|
};
|
|
13557
13557
|
return /* @__PURE__ */ e("div", { className: "ps-pmv-root", children: [
|
|
13558
13558
|
/* @__PURE__ */ e("div", { className: "ps-pmv-hero", children: [
|
|
@@ -13588,11 +13588,11 @@ function Sr({
|
|
|
13588
13588
|
] })
|
|
13589
13589
|
] }) }),
|
|
13590
13590
|
/* @__PURE__ */ e("div", { className: "ps-pmv-measure-list", children: [
|
|
13591
|
-
f.map((
|
|
13592
|
-
const M = D[
|
|
13591
|
+
f.map((E) => {
|
|
13592
|
+
const M = D[E.key], z = s && M == null && !L[E.key];
|
|
13593
13593
|
return /* @__PURE__ */ e("div", { className: `ps-pmv-measure-row${M == null ? " ps-loading" : ""}`, children: [
|
|
13594
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src:
|
|
13595
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: l(
|
|
13594
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: E.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
13595
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: l(E.label) }),
|
|
13596
13596
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: z ? /* @__PURE__ */ e("span", { style: { display: "inline-flex", alignItems: "center", gap: "0.4vw" }, children: [
|
|
13597
13597
|
/* @__PURE__ */ A("span", { className: "ps-tryon-size-loading-spinner", style: { width: "0.8vw", height: "0.8vw", borderWidth: "1.5px" } }),
|
|
13598
13598
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: l("calculating...") })
|
|
@@ -13603,14 +13603,14 @@ function Sr({
|
|
|
13603
13603
|
type: "number",
|
|
13604
13604
|
step: "0.1",
|
|
13605
13605
|
className: "ps-pmv-inline-input",
|
|
13606
|
-
value: L[
|
|
13606
|
+
value: L[E.key] ?? "",
|
|
13607
13607
|
placeholder: "—",
|
|
13608
|
-
onChange: (j) => G((wA) => ({ ...wA, [
|
|
13608
|
+
onChange: (j) => G((wA) => ({ ...wA, [E.key]: j.target.value }))
|
|
13609
13609
|
}
|
|
13610
13610
|
),
|
|
13611
13611
|
/* @__PURE__ */ A("span", { className: "ps-pmv-inline-unit", children: P })
|
|
13612
13612
|
] }) })
|
|
13613
|
-
] },
|
|
13613
|
+
] }, E.key);
|
|
13614
13614
|
}),
|
|
13615
13615
|
o.gender === "female" && /* @__PURE__ */ e(eA, { children: [
|
|
13616
13616
|
/* @__PURE__ */ e("div", { className: "ps-pmv-measure-row", children: [
|
|
@@ -13621,10 +13621,10 @@ function Sr({
|
|
|
13621
13621
|
{
|
|
13622
13622
|
className: "ps-pmv-inline-select",
|
|
13623
13623
|
value: I,
|
|
13624
|
-
onChange: (
|
|
13624
|
+
onChange: (E) => d(E.target.value),
|
|
13625
13625
|
children: [
|
|
13626
13626
|
/* @__PURE__ */ A("option", { value: "", children: "—" }),
|
|
13627
|
-
Jr.map((
|
|
13627
|
+
Jr.map((E) => /* @__PURE__ */ A("option", { value: E, children: E }, E))
|
|
13628
13628
|
]
|
|
13629
13629
|
}
|
|
13630
13630
|
) })
|
|
@@ -13637,10 +13637,10 @@ function Sr({
|
|
|
13637
13637
|
{
|
|
13638
13638
|
className: "ps-pmv-inline-select",
|
|
13639
13639
|
value: W,
|
|
13640
|
-
onChange: (
|
|
13640
|
+
onChange: (E) => V(E.target.value),
|
|
13641
13641
|
children: [
|
|
13642
13642
|
/* @__PURE__ */ A("option", { value: "", children: "—" }),
|
|
13643
|
-
Kr.map((
|
|
13643
|
+
Kr.map((E) => /* @__PURE__ */ A("option", { value: E, children: E }, E))
|
|
13644
13644
|
]
|
|
13645
13645
|
}
|
|
13646
13646
|
) })
|
|
@@ -13839,9 +13839,9 @@ function Xr({
|
|
|
13839
13839
|
let b = null;
|
|
13840
13840
|
if (typeof window < "u")
|
|
13841
13841
|
try {
|
|
13842
|
-
const
|
|
13843
|
-
if (
|
|
13844
|
-
const M = JSON.parse(
|
|
13842
|
+
const E = localStorage.getItem("primestyle_profiles");
|
|
13843
|
+
if (E) {
|
|
13844
|
+
const M = JSON.parse(E);
|
|
13845
13845
|
M.length > 0 && (b = M[0].id ?? null);
|
|
13846
13846
|
}
|
|
13847
13847
|
} catch {
|
|
@@ -13923,7 +13923,7 @@ function Zr({
|
|
|
13923
13923
|
activeProfileName: V,
|
|
13924
13924
|
onStartFresh: i,
|
|
13925
13925
|
hidePhotoOptions: b = !1,
|
|
13926
|
-
error:
|
|
13926
|
+
error: E,
|
|
13927
13927
|
t: M
|
|
13928
13928
|
}) {
|
|
13929
13929
|
const z = parseFloat(r) || 173, j = (parseFloat(a) || 5) * 12 + (parseFloat(w) || 8), wA = Math.floor(j / 12), J = j % 12, ne = parseFloat(l) || (g === "kg" ? 70 : 154), h = parseFloat(D) || 30, Ce = g === "kg" ? 30 : 66, oA = g === "kg" ? 200 : 440, O = 120, GA = 220, T = 48, _ = 84, pA = 13, nA = 100, jA = (z - O) / (GA - O) * 100, Ae = (j - T) / (_ - T) * 100, MA = (ne - Ce) / (oA - Ce) * 100, OA = (h - pA) / (nA - pA) * 100, he = (iA) => {
|
|
@@ -14075,7 +14075,7 @@ function Zr({
|
|
|
14075
14075
|
}
|
|
14076
14076
|
)
|
|
14077
14077
|
] }),
|
|
14078
|
-
|
|
14078
|
+
E && /* @__PURE__ */ A("p", { className: "ps-bpm-error", children: E }),
|
|
14079
14079
|
/* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
|
|
14080
14080
|
/* @__PURE__ */ e("div", { className: "ps-bpm-bottom", children: [
|
|
14081
14081
|
/* @__PURE__ */ A(
|
|
@@ -14542,21 +14542,21 @@ function si({
|
|
|
14542
14542
|
onBack: V,
|
|
14543
14543
|
t: i
|
|
14544
14544
|
}) {
|
|
14545
|
-
const b = t ? ni : ti, [
|
|
14546
|
-
|
|
14545
|
+
const b = t ? ni : ti, [E, M] = Q("basics");
|
|
14546
|
+
E === "photo" || b.indexOf(E);
|
|
14547
14547
|
const z = Go(), j = gt(B), wA = W?.height, J = W?.weight, ne = W?.age, h = W?.heightUnit === "ft" ? "in" : W?.heightUnit, Ce = W?.weightUnit, oA = wA != null && h === "cm" ? String(Math.round(wA)) : wA != null && (h === "in" || h === "ft") ? String(Math.round(wA * 2.54)) : r.current.height || "", O = wA != null && (h === "in" || h === "ft") ? Math.round(wA) : wA != null && h === "cm" ? Math.round(wA / 2.54) : null, GA = O != null ? String(Math.floor(O / 12)) : r.current.heightFeet || "", T = O != null ? String(O % 12) : r.current.heightInches || "", _ = J != null ? String(Math.round(J)) : r.current.weight || "", pA = ne != null ? String(ne) : r.current.age || "", [nA, jA] = Q(oA), [Ae, MA] = Q(GA), [OA, he] = Q(T), [uA, ee] = Q(_), [RA, de] = Q(pA), [vA, TA] = Q(
|
|
14548
14548
|
h || (a === "ft" ? "in" : a || (j ? "in" : "cm"))
|
|
14549
14549
|
), [iA, Me] = Q(
|
|
14550
14550
|
Ce || w || (j ? "lbs" : "kg")
|
|
14551
|
-
), ve = vA === "in" || iA === "lbs", [De, me] = Q(null), [XA, DA] = Q(null), [mA, F] = Q(null), [lA, Qe] = Q(!1), [we, Oe] = Q(""), [ZA, tA] = Q(null), re = hA(null), [LA, $A] = Q(null), [H, AA] = Q(!1), [EA, S] = Q(!1), [IA, CA] = Q(() => O != null ? String(Math.round(O * 2.54)) : oA), [ie, Ee] = Q(null), [oe, NA] = Q(null), [_A, u] = Q(null), [YA, xA] = Q(null), [yA, q] = Q(""), [ge, le] = Q(null), [se, Pe] = Q(null), [BA, UA] = Q(() => ["US", "UK", "AU"].includes(B) ? B === "AU" ? "UK" : B : ["FR", "ES"].includes(B) ? "FR" : ["IT"].includes(B) ? "IT" : ["JP", "CN", "KR"].includes(B) ? "JP" : "EU"), [ye, be] = Q(!1), [
|
|
14551
|
+
), ve = vA === "in" || iA === "lbs", [De, me] = Q(null), [XA, DA] = Q(null), [mA, F] = Q(null), [lA, Qe] = Q(!1), [we, Oe] = Q(""), [ZA, tA] = Q(null), re = hA(null), [LA, $A] = Q(null), [H, AA] = Q(!1), [EA, S] = Q(!1), [IA, CA] = Q(() => O != null ? String(Math.round(O * 2.54)) : oA), [ie, Ee] = Q(null), [oe, NA] = Q(null), [_A, u] = Q(null), [YA, xA] = Q(null), [yA, q] = Q(""), [ge, le] = Q(null), [se, Pe] = Q(null), [BA, UA] = Q(() => ["US", "UK", "AU"].includes(B) ? B === "AU" ? "UK" : B : ["FR", "ES"].includes(B) ? "FR" : ["IT"].includes(B) ? "IT" : ["JP", "CN", "KR"].includes(B) ? "JP" : "EU"), [ye, be] = Q(!1), [v, y] = Q(null), K = hA(null);
|
|
14552
14552
|
kA(() => {
|
|
14553
|
-
if (!
|
|
14553
|
+
if (!v) return;
|
|
14554
14554
|
const k = (dA) => {
|
|
14555
14555
|
const Be = K.current;
|
|
14556
14556
|
Be && !Be.contains(dA.target) && y(null);
|
|
14557
14557
|
};
|
|
14558
14558
|
return document.addEventListener("mousedown", k), () => document.removeEventListener("mousedown", k);
|
|
14559
|
-
}, [
|
|
14559
|
+
}, [v]);
|
|
14560
14560
|
const N = eo[BA] || eo.US, [cA, X] = Q(""), FA = bA(async (k) => {
|
|
14561
14561
|
const dA = k.target.files?.[0];
|
|
14562
14562
|
if (!dA) return;
|
|
@@ -14656,30 +14656,30 @@ function si({
|
|
|
14656
14656
|
} : {}
|
|
14657
14657
|
});
|
|
14658
14658
|
}, [mA, De, vA, iA, Ae, OA, nA, uA, RA, HA, t, ge, se, BA, x]), PA = bA(() => {
|
|
14659
|
-
if (
|
|
14659
|
+
if (E === "basics") {
|
|
14660
14660
|
if (!WA()) return;
|
|
14661
14661
|
M(ke("basics"));
|
|
14662
|
-
} else if (
|
|
14662
|
+
} else if (E === "chest") {
|
|
14663
14663
|
if (!ie) return;
|
|
14664
14664
|
M(ke("chest"));
|
|
14665
|
-
} else if (
|
|
14665
|
+
} else if (E === "midsection") {
|
|
14666
14666
|
if (!oe) return;
|
|
14667
14667
|
M(ke("midsection"));
|
|
14668
|
-
} else if (
|
|
14668
|
+
} else if (E === "seat") {
|
|
14669
14669
|
if (!YA) return;
|
|
14670
14670
|
const k = ke("seat");
|
|
14671
14671
|
k === "submit" ? p() : M(k);
|
|
14672
|
-
} else if (
|
|
14672
|
+
} else if (E === "hips") {
|
|
14673
14673
|
if (!_A) return;
|
|
14674
14674
|
const k = ke("hips");
|
|
14675
14675
|
k === "submit" ? p() : M(k);
|
|
14676
|
-
} else if (
|
|
14676
|
+
} else if (E === "bra") {
|
|
14677
14677
|
if (!ge || !se) {
|
|
14678
14678
|
X(i("Please select both band and cup size"));
|
|
14679
14679
|
return;
|
|
14680
14680
|
}
|
|
14681
14681
|
X(""), p();
|
|
14682
|
-
} else if (
|
|
14682
|
+
} else if (E === "photo") {
|
|
14683
14683
|
if (!mA || !De) {
|
|
14684
14684
|
if (L && G) {
|
|
14685
14685
|
G();
|
|
@@ -14697,7 +14697,7 @@ function si({
|
|
|
14697
14697
|
return;
|
|
14698
14698
|
}
|
|
14699
14699
|
Z();
|
|
14700
|
-
} else if (
|
|
14700
|
+
} else if (E === "scan-details") {
|
|
14701
14701
|
const k = vA === "in" ? parseFloat(Ae) > 0 || parseFloat(OA) > 0 : parseFloat(nA) > 0, dA = parseFloat(uA) > 0;
|
|
14702
14702
|
if (!k) {
|
|
14703
14703
|
X(i("Please enter your height"));
|
|
@@ -14717,21 +14717,21 @@ function si({
|
|
|
14717
14717
|
}
|
|
14718
14718
|
X(""), Z();
|
|
14719
14719
|
}
|
|
14720
|
-
}, [
|
|
14720
|
+
}, [E, b, WA, ie, oe, _A, YA, ge, se, vA, iA, nA, Ae, OA, uA, RA, mA, De, LA, z, t, HA, L, G, Z]), ae = (k) => {
|
|
14721
14721
|
const dA = b.indexOf(k);
|
|
14722
14722
|
return dA > 0 ? b[dA - 1] : null;
|
|
14723
14723
|
}, qA = bA(() => {
|
|
14724
|
-
if (X(""),
|
|
14724
|
+
if (X(""), E === "basics")
|
|
14725
14725
|
V();
|
|
14726
|
-
else if (
|
|
14726
|
+
else if (E === "photo")
|
|
14727
14727
|
M("basics");
|
|
14728
|
-
else if (
|
|
14728
|
+
else if (E === "scan-details")
|
|
14729
14729
|
M("photo");
|
|
14730
14730
|
else {
|
|
14731
|
-
const k = ae(
|
|
14731
|
+
const k = ae(E);
|
|
14732
14732
|
k ? M(k) : V();
|
|
14733
14733
|
}
|
|
14734
|
-
}, [
|
|
14734
|
+
}, [E, b, V]), xe = E === "basics" || E === "scan-details" ? !0 : E === "chest" ? !!ie : E === "midsection" ? !!oe : E === "seat" ? !!YA : E === "hips" ? !!_A : E === "bra" ? !!(ge && se) : E === "photo", Ie = E === b[b.length - 1], Le = () => {
|
|
14735
14735
|
if (vA === "in") {
|
|
14736
14736
|
const k = (parseFloat(Ae) || 0) * 12 + (parseFloat(OA) || 0);
|
|
14737
14737
|
k > 0 && jA(String(Math.round(k * 2.54)));
|
|
@@ -14747,7 +14747,7 @@ function si({
|
|
|
14747
14747
|
}
|
|
14748
14748
|
iA === "kg" && uA && ee(String(Math.round(parseFloat(uA) * 2.205))), TA("in"), Me("lbs"), n("in"), s("lbs"), f?.("in");
|
|
14749
14749
|
};
|
|
14750
|
-
if (
|
|
14750
|
+
if (E === "scan-details" && z)
|
|
14751
14751
|
return /* @__PURE__ */ e("div", { className: "ps-bp-wrapper", children: [
|
|
14752
14752
|
/* @__PURE__ */ e("div", { className: "ps-bp-scan-progress", children: [
|
|
14753
14753
|
/* @__PURE__ */ A(
|
|
@@ -14808,8 +14808,8 @@ function si({
|
|
|
14808
14808
|
{
|
|
14809
14809
|
value: BA,
|
|
14810
14810
|
options: Object.keys(eo),
|
|
14811
|
-
isOpen:
|
|
14812
|
-
onToggle: () => y(
|
|
14811
|
+
isOpen: v === "region",
|
|
14812
|
+
onToggle: () => y(v === "region" ? null : "region"),
|
|
14813
14813
|
onSelect: (k) => {
|
|
14814
14814
|
UA(k), le(null), Pe(null), y(null);
|
|
14815
14815
|
}
|
|
@@ -14824,8 +14824,8 @@ function si({
|
|
|
14824
14824
|
value: ge,
|
|
14825
14825
|
options: eo[BA] || eo.US,
|
|
14826
14826
|
placeholder: "—",
|
|
14827
|
-
isOpen:
|
|
14828
|
-
onToggle: () => y(
|
|
14827
|
+
isOpen: v === "band",
|
|
14828
|
+
onToggle: () => y(v === "band" ? null : "band"),
|
|
14829
14829
|
onSelect: (k) => {
|
|
14830
14830
|
le(k), y(null);
|
|
14831
14831
|
}
|
|
@@ -14841,8 +14841,8 @@ function si({
|
|
|
14841
14841
|
options: lo[BA] || lo.US,
|
|
14842
14842
|
placeholder: "—",
|
|
14843
14843
|
direction: "up",
|
|
14844
|
-
isOpen:
|
|
14845
|
-
onToggle: () => y(
|
|
14844
|
+
isOpen: v === "cup",
|
|
14845
|
+
onToggle: () => y(v === "cup" ? null : "cup"),
|
|
14846
14846
|
onSelect: (k) => {
|
|
14847
14847
|
Pe(k), y(null);
|
|
14848
14848
|
}
|
|
@@ -14867,7 +14867,7 @@ function si({
|
|
|
14867
14867
|
)
|
|
14868
14868
|
] })
|
|
14869
14869
|
] });
|
|
14870
|
-
if (
|
|
14870
|
+
if (E === "photo" || E === "scan-details") {
|
|
14871
14871
|
const k = vA === "in" ? parseFloat(Ae) > 0 || parseFloat(OA) > 0 : parseFloat(nA) > 0, dA = parseFloat(uA) > 0, Be = !!XA, ue = [];
|
|
14872
14872
|
lA && ue.push(i("Analyzing photo…")), !Be && !lA && ue.push(i("Upload a photo")), k || ue.push(i("Enter your height")), dA || ue.push(i("Enter your weight")), t && (!ge || !se) && ue.push(i("Enter your bra size"));
|
|
14873
14873
|
const We = ue.length > 0, Ue = We ? ue[0] ?? i("Analyze My Size") : i("Analyze My Size");
|
|
@@ -15327,8 +15327,8 @@ function si({
|
|
|
15327
15327
|
{
|
|
15328
15328
|
value: BA,
|
|
15329
15329
|
options: Object.keys(eo),
|
|
15330
|
-
isOpen:
|
|
15331
|
-
onToggle: () => y(
|
|
15330
|
+
isOpen: v === "region",
|
|
15331
|
+
onToggle: () => y(v === "region" ? null : "region"),
|
|
15332
15332
|
onSelect: (sA) => {
|
|
15333
15333
|
UA(sA), le(null), Pe(null), y(null);
|
|
15334
15334
|
}
|
|
@@ -15343,8 +15343,8 @@ function si({
|
|
|
15343
15343
|
value: ge,
|
|
15344
15344
|
options: eo[BA] || eo.US,
|
|
15345
15345
|
placeholder: "—",
|
|
15346
|
-
isOpen:
|
|
15347
|
-
onToggle: () => y(
|
|
15346
|
+
isOpen: v === "band",
|
|
15347
|
+
onToggle: () => y(v === "band" ? null : "band"),
|
|
15348
15348
|
onSelect: (sA) => {
|
|
15349
15349
|
le(sA), y(null);
|
|
15350
15350
|
}
|
|
@@ -15360,8 +15360,8 @@ function si({
|
|
|
15360
15360
|
options: lo[BA] || lo.US,
|
|
15361
15361
|
placeholder: "—",
|
|
15362
15362
|
direction: "up",
|
|
15363
|
-
isOpen:
|
|
15364
|
-
onToggle: () => y(
|
|
15363
|
+
isOpen: v === "cup",
|
|
15364
|
+
onToggle: () => y(v === "cup" ? null : "cup"),
|
|
15365
15365
|
onSelect: (sA) => {
|
|
15366
15366
|
Pe(sA), y(null);
|
|
15367
15367
|
}
|
|
@@ -15511,7 +15511,7 @@ function si({
|
|
|
15511
15511
|
}
|
|
15512
15512
|
),
|
|
15513
15513
|
/* @__PURE__ */ e("div", { className: "ps-bp-root", children: [
|
|
15514
|
-
|
|
15514
|
+
E === "basics" && (() => {
|
|
15515
15515
|
const k = () => {
|
|
15516
15516
|
if (vA === "in") {
|
|
15517
15517
|
const Be = (parseFloat(Ae) || 5) * 12 + (parseFloat(OA) || 8);
|
|
@@ -15614,7 +15614,7 @@ function si({
|
|
|
15614
15614
|
cA && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: cA })
|
|
15615
15615
|
] }, "step-basics");
|
|
15616
15616
|
})(),
|
|
15617
|
-
|
|
15617
|
+
E === "chest" && !t && (z ? /* @__PURE__ */ A(
|
|
15618
15618
|
To,
|
|
15619
15619
|
{
|
|
15620
15620
|
stepNumber: b.indexOf("chest") + 1,
|
|
@@ -15639,7 +15639,7 @@ function si({
|
|
|
15639
15639
|
] }),
|
|
15640
15640
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: yA || " " })
|
|
15641
15641
|
] }, "step-chest")),
|
|
15642
|
-
|
|
15642
|
+
E === "midsection" && (z ? /* @__PURE__ */ A(
|
|
15643
15643
|
To,
|
|
15644
15644
|
{
|
|
15645
15645
|
stepNumber: b.indexOf("midsection") + 1,
|
|
@@ -15672,7 +15672,7 @@ function si({
|
|
|
15672
15672
|
] }) }),
|
|
15673
15673
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: yA || " " })
|
|
15674
15674
|
] }, "step-midsection")),
|
|
15675
|
-
|
|
15675
|
+
E === "seat" && (z ? /* @__PURE__ */ A(
|
|
15676
15676
|
To,
|
|
15677
15677
|
{
|
|
15678
15678
|
stepNumber: b.indexOf("seat") + 1,
|
|
@@ -15705,7 +15705,7 @@ function si({
|
|
|
15705
15705
|
] }) }),
|
|
15706
15706
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: yA || " " })
|
|
15707
15707
|
] }, "step-seat")),
|
|
15708
|
-
|
|
15708
|
+
E === "hips" && t && (z ? /* @__PURE__ */ A(
|
|
15709
15709
|
To,
|
|
15710
15710
|
{
|
|
15711
15711
|
stepNumber: b.indexOf("hips") + 1,
|
|
@@ -15730,7 +15730,7 @@ function si({
|
|
|
15730
15730
|
] }),
|
|
15731
15731
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: yA || " " })
|
|
15732
15732
|
] }, "step-hips")),
|
|
15733
|
-
|
|
15733
|
+
E === "bra" && t && /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
|
|
15734
15734
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: i("Select your bra size") }),
|
|
15735
15735
|
/* @__PURE__ */ e("div", { className: "ps-bp-bra-section", children: [
|
|
15736
15736
|
/* @__PURE__ */ e("div", { className: "ps-bp-bra-header", children: [
|
|
@@ -15803,10 +15803,10 @@ function si({
|
|
|
15803
15803
|
] }),
|
|
15804
15804
|
cA && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: cA })
|
|
15805
15805
|
] }, "step-bra"),
|
|
15806
|
-
!(z &&
|
|
15807
|
-
const k =
|
|
15806
|
+
!(z && E === "basics") && (() => {
|
|
15807
|
+
const k = E === "basics" && L && !!G, dA = k ? G : PA, Be = Te(vA) ? ` (${Te(vA)})` : "", ue = k ? i("Find My Best Fit") + Be : Ie ? i("Find My Size") + Be : i("Next");
|
|
15808
15808
|
return /* @__PURE__ */ e("div", { className: "ps-bp-nav", children: [
|
|
15809
|
-
|
|
15809
|
+
E !== "basics" ? /* @__PURE__ */ e("button", { className: "ps-bp-back-btn", onClick: qA, type: "button", children: [
|
|
15810
15810
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
15811
15811
|
" ",
|
|
15812
15812
|
i("Back")
|
|
@@ -15853,7 +15853,7 @@ function vg({
|
|
|
15853
15853
|
apiKey: I,
|
|
15854
15854
|
t: d
|
|
15855
15855
|
}) {
|
|
15856
|
-
const W = r === "close-up", V = Go(), [i, b] = Q("manual"), [
|
|
15856
|
+
const W = r === "close-up", V = Go(), [i, b] = Q("manual"), [E, M] = Q(() => {
|
|
15857
15857
|
const F = {};
|
|
15858
15858
|
return g.forEach((lA) => {
|
|
15859
15859
|
F[lA.key] = w.current[lA.key] || "";
|
|
@@ -15883,13 +15883,13 @@ function vg({
|
|
|
15883
15883
|
}, TA = () => {
|
|
15884
15884
|
const F = g[0];
|
|
15885
15885
|
if (!F) return;
|
|
15886
|
-
const lA = parseFloat(
|
|
15886
|
+
const lA = parseFloat(E[F.key] || "");
|
|
15887
15887
|
if (!lA || lA <= 0) {
|
|
15888
15888
|
j(d("Please enter your ") + d(F.label).toLowerCase());
|
|
15889
15889
|
return;
|
|
15890
15890
|
}
|
|
15891
15891
|
g.forEach((Qe) => {
|
|
15892
|
-
const we = parseFloat(
|
|
15892
|
+
const we = parseFloat(E[Qe.key] || "");
|
|
15893
15893
|
we > 0 && (w.current[Qe.key] = String(we));
|
|
15894
15894
|
}), w.current.gender = w.current.gender || "male", f("exact"), D(!0), m("size-result"), P("exact");
|
|
15895
15895
|
}, iA = () => {
|
|
@@ -15951,7 +15951,7 @@ function vg({
|
|
|
15951
15951
|
{
|
|
15952
15952
|
type: "number",
|
|
15953
15953
|
className: "ps-bpm-value-input",
|
|
15954
|
-
value:
|
|
15954
|
+
value: E[F.key],
|
|
15955
15955
|
onChange: (lA) => vA(F.key, lA.target.value),
|
|
15956
15956
|
placeholder: F.placeholder[s] || F.placeholder.cm || F.placeholder.in || "",
|
|
15957
15957
|
step: F.step ?? 0.5,
|
|
@@ -15992,7 +15992,7 @@ function vg({
|
|
|
15992
15992
|
)
|
|
15993
15993
|
] })
|
|
15994
15994
|
] }) });
|
|
15995
|
-
const ve = g.some((F) => (parseFloat(
|
|
15995
|
+
const ve = g.some((F) => (parseFloat(E[F.key] || "") || 0) > 0), De = !!h && OA === !0 && !_, XA = _ || !De && !ve, DA = _ ? d("Analyzing photo…") : De ? d("Analyze") : `${d("Find My Size")}${Te(s) ? ` (${Te(s)})` : ""}`, mA = De ? iA : TA;
|
|
15996
15996
|
return i !== "photo" || B ? /* @__PURE__ */ e("div", { className: "ps-bp-layout", children: [
|
|
15997
15997
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", style: { position: "relative" }, children: /* @__PURE__ */ A("img", { src: a, alt: n, className: "ps-bp-image-img" }) }),
|
|
15998
15998
|
/* @__PURE__ */ A("div", { className: "ps-bp-root", children: /* @__PURE__ */ e("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
@@ -16015,7 +16015,7 @@ function vg({
|
|
|
16015
16015
|
{
|
|
16016
16016
|
type: "number",
|
|
16017
16017
|
className: "ps-bp-inline-input",
|
|
16018
|
-
value:
|
|
16018
|
+
value: E[F.key],
|
|
16019
16019
|
onChange: (lA) => vA(F.key, lA.target.value),
|
|
16020
16020
|
placeholder: F.placeholder[s] || F.placeholder.cm || F.placeholder.in || "",
|
|
16021
16021
|
step: F.step ?? 0.5,
|
|
@@ -16373,7 +16373,7 @@ function vg({
|
|
|
16373
16373
|
{
|
|
16374
16374
|
type: "number",
|
|
16375
16375
|
className: "ps-bp-inline-input",
|
|
16376
|
-
value:
|
|
16376
|
+
value: E[F.key],
|
|
16377
16377
|
onChange: (lA) => vA(F.key, lA.target.value),
|
|
16378
16378
|
placeholder: F.placeholder[s] || F.placeholder.cm || F.placeholder.in || "",
|
|
16379
16379
|
step: F.step ?? 0.5,
|
|
@@ -16714,7 +16714,7 @@ function hi({
|
|
|
16714
16714
|
onUpload: V,
|
|
16715
16715
|
onProcessing: i,
|
|
16716
16716
|
onComplete: b,
|
|
16717
|
-
onError:
|
|
16717
|
+
onError: E,
|
|
16718
16718
|
sizeGuideData: M
|
|
16719
16719
|
}) {
|
|
16720
16720
|
const z = B || o, [j, wA] = Q(() => m || "");
|
|
@@ -16755,7 +16755,7 @@ function hi({
|
|
|
16755
16755
|
const c = so(r);
|
|
16756
16756
|
c === "foot" || c === "head" ? ie("cm") : c === "face" && ie("mm");
|
|
16757
16757
|
}, [r]);
|
|
16758
|
-
const u = hA({}), [YA, xA] = Q("male"), [yA, q] = Q(0), [ge, le] = Q(null), [se, Pe] = Q(!1), [BA, UA] = Q(() => Ne("profiles", [])), [ye, be] = Q(() => Ne("history", [])), [
|
|
16758
|
+
const u = hA({}), [YA, xA] = Q("male"), [yA, q] = Q(0), [ge, le] = Q(null), [se, Pe] = Q(!1), [BA, UA] = Q(() => Ne("profiles", [])), [ye, be] = Q(() => Ne("history", [])), [v, y] = Q(() => _g()), [K, N] = Q(() => /* @__PURE__ */ new Set()), [cA, X] = Q(null), FA = bA((c) => {
|
|
16759
16759
|
y(c), Dn(c);
|
|
16760
16760
|
}, []), [JA, WA] = Q(!1), [fe, HA] = Q(null), [ke, p] = Q(null), Z = hA(null), PA = hA(() => !1), ae = hA(() => {
|
|
16761
16761
|
}), qA = bA((c, C) => {
|
|
@@ -16866,7 +16866,7 @@ function hi({
|
|
|
16866
16866
|
}
|
|
16867
16867
|
}, [oA]), Io = bA(
|
|
16868
16868
|
(c, C, U) => {
|
|
16869
|
-
let $ =
|
|
16869
|
+
let $ = v, QA = BA.find((gA) => gA.id === $);
|
|
16870
16870
|
if (!QA) {
|
|
16871
16871
|
const gA = {
|
|
16872
16872
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
@@ -16908,7 +16908,7 @@ function hi({
|
|
|
16908
16908
|
}), UA(Ne("profiles", []));
|
|
16909
16909
|
}
|
|
16910
16910
|
},
|
|
16911
|
-
[
|
|
16911
|
+
[v, BA, s, o, r, z, FA]
|
|
16912
16912
|
), eg = hA(null), [uo, og] = Q(null), Eg = bA(async (c) => {
|
|
16913
16913
|
const C = c.height ?? c.heightCm ?? 0, U = c.weight ?? c.weightKg ?? 0, $ = !!c.measurements && Object.keys(c.measurements).length > 0, QA = c.photoBase64;
|
|
16914
16914
|
if (!$ && QA && C > 0 && eg.current) {
|
|
@@ -16953,11 +16953,11 @@ function hi({
|
|
|
16953
16953
|
}).catch(() => {
|
|
16954
16954
|
}).finally(() => lA(!1));
|
|
16955
16955
|
}, [z, r, o, M, s, _]), ht = bA(async () => {
|
|
16956
|
-
const c = BA.find((QA) => QA.id ===
|
|
16956
|
+
const c = BA.find((QA) => QA.id === v);
|
|
16957
16957
|
if (!c) return;
|
|
16958
16958
|
const C = c.height ?? c.heightCm ?? 0, U = c.weight ?? c.weightKg ?? 0;
|
|
16959
16959
|
C > 0 && U > 0 && og(c);
|
|
16960
|
-
}, [BA,
|
|
16960
|
+
}, [BA, v]), vt = bA(() => {
|
|
16961
16961
|
if (!uo) return;
|
|
16962
16962
|
const c = uo;
|
|
16963
16963
|
og(null), Eg(c);
|
|
@@ -17009,11 +17009,11 @@ function hi({
|
|
|
17009
17009
|
}
|
|
17010
17010
|
}, [oA, fe, RA, ro]), Pt = oA !== "idle" && oA !== "processing" && oA !== "result" && oA !== "welcome" && oA !== "body-profile" && oA !== "size-result", gg = bA((c) => {
|
|
17011
17011
|
if (!Nt(c)) {
|
|
17012
|
-
MA(J("Please upload a JPEG, PNG, or WebP image.")), O("error"),
|
|
17012
|
+
MA(J("Please upload a JPEG, PNG, or WebP image.")), O("error"), E?.({ message: "Invalid file type", code: "INVALID_FILE" });
|
|
17013
17013
|
return;
|
|
17014
17014
|
}
|
|
17015
17015
|
if (c.size > 10 * 1024 * 1024) {
|
|
17016
|
-
MA(J("Image must be under 10MB.")), O("error"),
|
|
17016
|
+
MA(J("Image must be under 10MB.")), O("error"), E?.({ message: "File too large", code: "FILE_TOO_LARGE" });
|
|
17017
17017
|
return;
|
|
17018
17018
|
}
|
|
17019
17019
|
T(c), ze.current = c, Oo.current = null;
|
|
@@ -17022,7 +17022,7 @@ function hi({
|
|
|
17022
17022
|
ue.current = U;
|
|
17023
17023
|
}).catch(() => {
|
|
17024
17024
|
});
|
|
17025
|
-
}, [V,
|
|
17025
|
+
}, [V, E]), Ig = bA(() => {
|
|
17026
17026
|
T(null), _ && URL.revokeObjectURL(_), pA(null);
|
|
17027
17027
|
}, [_]), Bo = bA(() => {
|
|
17028
17028
|
k.current && (clearInterval(k.current), k.current = null), Xe.current?.(), Xe.current = null;
|
|
@@ -17044,9 +17044,9 @@ function hi({
|
|
|
17044
17044
|
} else if (c.status === "failed" && !dA.current) {
|
|
17045
17045
|
dA.current = !0, Bo(), ZA(!1), ee(null);
|
|
17046
17046
|
const C = c.error || J("Try-on generation failed");
|
|
17047
|
-
MA(C), O("error"),
|
|
17047
|
+
MA(C), O("error"), E?.({ message: C });
|
|
17048
17048
|
}
|
|
17049
|
-
}, [b,
|
|
17049
|
+
}, [b, E, Bo]), Ao = He(() => tA?.found && tA.requiredFields && tA.requiredFields.length > 0 ? tA.requiredFields : YA === "female" ? pn : Cn, [tA, YA]), mo = bA(async (c) => {
|
|
17050
17050
|
if (!Ie.current) return;
|
|
17051
17051
|
const C = c || me, U = je(s), $ = Se(), QA = so(r);
|
|
17052
17052
|
if (QA === "face" || QA === "head") {
|
|
@@ -17173,7 +17173,7 @@ function hi({
|
|
|
17173
17173
|
}, [s, me, EA, Ee, NA, CA, tA, r, Ao, Io]), bt = bA(async (c, C, U, $, QA, gA, Y, R, rA, KA, fA) => {
|
|
17174
17174
|
if (!Ie.current) {
|
|
17175
17175
|
const aA = J("SDK not configured. Please refresh and try again.");
|
|
17176
|
-
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), MA(aA), O("error"),
|
|
17176
|
+
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), MA(aA), O("error"), E?.({ message: aA, code: "SDK_NOT_CONFIGURED" });
|
|
17177
17177
|
return;
|
|
17178
17178
|
}
|
|
17179
17179
|
je(s), Se();
|
|
@@ -17199,7 +17199,7 @@ function hi({
|
|
|
17199
17199
|
apiUrl: s
|
|
17200
17200
|
}), !Ie.current || !Le.current) {
|
|
17201
17201
|
const fA = J("SDK not configured. Please refresh and try again.");
|
|
17202
|
-
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), MA(fA), O("error"),
|
|
17202
|
+
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), MA(fA), O("error"), E?.({ message: fA, code: "SDK_NOT_CONFIGURED" });
|
|
17203
17203
|
return;
|
|
17204
17204
|
}
|
|
17205
17205
|
const C = je(s), U = Se();
|
|
@@ -17215,7 +17215,7 @@ function hi({
|
|
|
17215
17215
|
if (!VA) {
|
|
17216
17216
|
console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await fA;
|
|
17217
17217
|
const aA = J(QA === "head" ? "We couldn't detect your head clearly. Please upload a close-up photo that shows your full head and ears." : "We couldn't detect your face clearly. Please upload a close-up selfie that shows both eyes.");
|
|
17218
|
-
MA(aA), O("error"),
|
|
17218
|
+
MA(aA), O("error"), E?.({ message: aA, code: "FACE_DETECTION_FAILED" }), lA(!1);
|
|
17219
17219
|
return;
|
|
17220
17220
|
}
|
|
17221
17221
|
VA && Ve(VA.landmarks);
|
|
@@ -17347,7 +17347,7 @@ function hi({
|
|
|
17347
17347
|
const C = c || GA || ze.current;
|
|
17348
17348
|
if (!C || !Ie.current || !Le.current) {
|
|
17349
17349
|
const gA = Ie.current ? J("Please upload a photo first.") : J("SDK not configured. Please provide an API key.");
|
|
17350
|
-
MA(gA), O("error"),
|
|
17350
|
+
MA(gA), O("error"), E?.({ message: gA, code: "SDK_NOT_CONFIGURED" });
|
|
17351
17351
|
return;
|
|
17352
17352
|
}
|
|
17353
17353
|
c && c !== GA && (T(c), ze.current = c), dA.current = !1, ZA(!0), ee(Date.now());
|
|
@@ -17445,9 +17445,9 @@ function hi({
|
|
|
17445
17445
|
}, 3e3);
|
|
17446
17446
|
} catch (gA) {
|
|
17447
17447
|
const Y = gA instanceof Error ? gA.message : J("Failed to start try-on"), R = gA instanceof Jg ? gA.code : void 0;
|
|
17448
|
-
MA(Y), O("error"),
|
|
17448
|
+
MA(Y), O("error"), E?.({ message: Y, code: R });
|
|
17449
17449
|
}
|
|
17450
|
-
}, [GA, o, r, DA, i,
|
|
17450
|
+
}, [GA, o, r, DA, i, E, tg]);
|
|
17451
17451
|
kA(() => {
|
|
17452
17452
|
if (!DA) {
|
|
17453
17453
|
Zo.current = !1;
|
|
@@ -17478,7 +17478,7 @@ function hi({
|
|
|
17478
17478
|
u.current = U, xA(U.gender || "male"), C.country && S(C.country), C.sizingUnit && ie(C.sizingUnit), C.heightUnit && oe(C.heightUnit), C.weightUnit && _A(C.weightUnit), q(($) => $ + 1);
|
|
17479
17479
|
}, [BA]);
|
|
17480
17480
|
It.current = Mt, bA((c, C) => {
|
|
17481
|
-
const U = (C ? null :
|
|
17481
|
+
const U = (C ? null : v) || `p_${Date.now()}`, $ = {
|
|
17482
17482
|
id: U,
|
|
17483
17483
|
name: c,
|
|
17484
17484
|
gender: u.current.gender || "male",
|
|
@@ -17532,7 +17532,7 @@ function hi({
|
|
|
17532
17532
|
}
|
|
17533
17533
|
return [...Y, $].slice(-50);
|
|
17534
17534
|
}), FA(U), WA(!0);
|
|
17535
|
-
}, [
|
|
17535
|
+
}, [v, EA, CA, Ee, NA]);
|
|
17536
17536
|
const ug = bA(async () => {
|
|
17537
17537
|
const c = `h_${Date.now()}`;
|
|
17538
17538
|
let C = !1;
|
|
@@ -17572,15 +17572,15 @@ function hi({
|
|
|
17572
17572
|
hasPhoto: C || void 0,
|
|
17573
17573
|
selectedSizes: gA.length ? gA : void 0
|
|
17574
17574
|
};
|
|
17575
|
-
if (
|
|
17576
|
-
const R = BA.find((rA) => rA.id ===
|
|
17575
|
+
if (v) {
|
|
17576
|
+
const R = BA.find((rA) => rA.id === v);
|
|
17577
17577
|
R && (Y.profileName = R.name);
|
|
17578
17578
|
}
|
|
17579
17579
|
be((R) => {
|
|
17580
17580
|
const rA = [Y, ...R].slice(0, 50), KA = new Set(rA.map((fA) => fA.id));
|
|
17581
17581
|
return jt(KA), rA;
|
|
17582
17582
|
});
|
|
17583
|
-
}, [r, o, nA, DA, tA,
|
|
17583
|
+
}, [r, o, nA, DA, tA, v, BA, GA]), io = hA(!1), bo = hA(!1);
|
|
17584
17584
|
kA(() => {
|
|
17585
17585
|
if (oA === "size-result" && DA && !io.current)
|
|
17586
17586
|
io.current = !0, bo.current = !1, ug().catch(() => {
|
|
@@ -17714,14 +17714,14 @@ function hi({
|
|
|
17714
17714
|
apiUrl: je(s),
|
|
17715
17715
|
apiKey: Se(),
|
|
17716
17716
|
hasActiveProfileWithMeasurements: (() => {
|
|
17717
|
-
const Y = BA.find((KA) => KA.id ===
|
|
17717
|
+
const Y = BA.find((KA) => KA.id === v);
|
|
17718
17718
|
if (!Y) return !1;
|
|
17719
17719
|
const R = Y.height ?? Y.heightCm ?? 0, rA = Y.weight ?? Y.weightKg ?? 0;
|
|
17720
17720
|
return R > 0 && rA > 0;
|
|
17721
17721
|
})(),
|
|
17722
17722
|
onUseActiveProfile: ht,
|
|
17723
|
-
activeProfileName: BA.find((R) => R.id ===
|
|
17724
|
-
activeProfile: BA.find((Y) => Y.id ===
|
|
17723
|
+
activeProfileName: BA.find((R) => R.id === v)?.name || null,
|
|
17724
|
+
activeProfile: BA.find((Y) => Y.id === v) || null,
|
|
17725
17725
|
onStartFresh: () => {
|
|
17726
17726
|
FA(null), u.current = {};
|
|
17727
17727
|
},
|
|
@@ -17744,7 +17744,7 @@ function hi({
|
|
|
17744
17744
|
onBack: ro,
|
|
17745
17745
|
t: J
|
|
17746
17746
|
},
|
|
17747
|
-
`bp-${
|
|
17747
|
+
`bp-${v || "anon"}`
|
|
17748
17748
|
) }, "v-bodyprofile");
|
|
17749
17749
|
}
|
|
17750
17750
|
case "estimation-review":
|
|
@@ -17804,7 +17804,7 @@ function hi({
|
|
|
17804
17804
|
},
|
|
17805
17805
|
onClose: ro,
|
|
17806
17806
|
userHeightCm: (() => {
|
|
17807
|
-
const c = BA.find((QA) => QA.id ===
|
|
17807
|
+
const c = BA.find((QA) => QA.id === v);
|
|
17808
17808
|
if (!c) return;
|
|
17809
17809
|
const C = c.height ?? c.heightCm;
|
|
17810
17810
|
if (!C || C <= 0) return;
|
|
@@ -17858,7 +17858,7 @@ function hi({
|
|
|
17858
17858
|
Xr,
|
|
17859
17859
|
{
|
|
17860
17860
|
profiles: BA,
|
|
17861
|
-
activeProfileId:
|
|
17861
|
+
activeProfileId: v,
|
|
17862
17862
|
estimatingProfileIds: K,
|
|
17863
17863
|
apiUrl: je(s),
|
|
17864
17864
|
apiKey: Se(),
|
|
@@ -17941,7 +17941,7 @@ function hi({
|
|
|
17941
17941
|
}));
|
|
17942
17942
|
},
|
|
17943
17943
|
onDeleteProfile: (c) => {
|
|
17944
|
-
UA((C) => C.filter((U) => U.id !== c)),
|
|
17944
|
+
UA((C) => C.filter((U) => U.id !== c)), v === c && FA(null), oo("profiles", Ne("profiles", []).filter((C) => C.id !== c));
|
|
17945
17945
|
},
|
|
17946
17946
|
onRequestDelete: (c) => X(c),
|
|
17947
17947
|
onClose: () => O("body-profile"),
|
|
@@ -18046,7 +18046,7 @@ function hi({
|
|
|
18046
18046
|
{
|
|
18047
18047
|
onConfirm: () => {
|
|
18048
18048
|
const c = cA, C = Ne("profiles", []).filter((U) => U.id !== c);
|
|
18049
|
-
oo("profiles", C), UA(C),
|
|
18049
|
+
oo("profiles", C), UA(C), v === c && FA(null), X(null);
|
|
18050
18050
|
},
|
|
18051
18051
|
onCancel: () => X(null),
|
|
18052
18052
|
t: J
|
|
@@ -18070,7 +18070,7 @@ function hi({
|
|
|
18070
18070
|
profileDetail: ke,
|
|
18071
18071
|
setProfileDetail: p,
|
|
18072
18072
|
setProfiles: UA,
|
|
18073
|
-
activeProfileId:
|
|
18073
|
+
activeProfileId: v,
|
|
18074
18074
|
setActiveProfileId: FA,
|
|
18075
18075
|
t: J
|
|
18076
18076
|
}
|