@primestyleai/tryon 5.10.16 → 5.10.18
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 +726 -716
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +24 -2
- 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
|
-
import { jsxs as P, jsx as A, Fragment as
|
|
4
|
-
import { useState as j, useRef as
|
|
3
|
+
import { jsxs as P, jsx as A, Fragment as rA } from "react/jsx-runtime";
|
|
4
|
+
import { useState as j, useRef as tA, useCallback as UA, useEffect as JA, useMemo as vf } 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,11 +31,11 @@ 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],
|
|
34
|
+
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], t = e[YP], o = (B.y + C.y) / 2, r = (D.y + t.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(t.x - D.x), i = Math.min(D.x, t.x) - W * 0.15, k = Math.max(D.x, t.x) + W * 0.15, u = p + (r - p) * 0.55, v = T * 0.85, I = (B.x + C.x + D.x + t.x) / 4, K = I - v / 2, N = I + v / 2;
|
|
35
35
|
return {
|
|
36
36
|
chest: { y: p, x1: F, x2: h },
|
|
37
|
-
waist: { y: u, x1:
|
|
38
|
-
hips: { y: r, x1:
|
|
37
|
+
waist: { y: u, x1: K, x2: N },
|
|
38
|
+
hips: { y: r, x1: i, x2: k }
|
|
39
39
|
};
|
|
40
40
|
} catch (n) {
|
|
41
41
|
return console.error("[PS-SDK] Pose detection failed:", n), null;
|
|
@@ -134,7 +134,7 @@ function Ug(f) {
|
|
|
134
134
|
}
|
|
135
135
|
function Dn(f, n, g) {
|
|
136
136
|
if (f.length < 4) return 0;
|
|
137
|
-
const e = (z) => ({ x: z.x * n, y: z.y * g }), [B, C, D,
|
|
137
|
+
const e = (z) => ({ x: z.x * n, y: z.y * g }), [B, C, D, t] = f.map(e), o = Math.hypot(B.x - D.x, B.y - D.y), r = Math.hypot(C.x - t.x, C.y - t.y);
|
|
138
138
|
return (o + r) / 2;
|
|
139
139
|
}
|
|
140
140
|
function Eg(f) {
|
|
@@ -163,10 +163,10 @@ function ag(f, n, g) {
|
|
|
163
163
|
const e = Dn(f.leftIrisRing, n, g), B = Dn(f.rightIrisRing, n, g), C = (e + B) / 2;
|
|
164
164
|
let D = 1;
|
|
165
165
|
C < 8 ? D = 0.3 : Math.abs(e - B) / C > 0.3 ? D = 0.5 : Math.abs(e - B) / C > 0.15 && (D = 0.8);
|
|
166
|
-
const
|
|
167
|
-
(
|
|
168
|
-
(
|
|
169
|
-
) *
|
|
166
|
+
const t = C > 0 ? vn / C : 0, o = (x, E) => Math.hypot(
|
|
167
|
+
(x.x - E.x) * n,
|
|
168
|
+
(x.y - E.y) * g
|
|
169
|
+
) * t, 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, i = T * 1.07, u = Math.abs((f.forehead.z ?? 0) - (f.chin.z ?? 0)) * n * t, v = Math.max(170, Math.min(210, u || 190)), I = i / 2, K = v / 2, N = Math.PI * Math.sqrt(2 * (I * I + K * K));
|
|
170
170
|
return {
|
|
171
171
|
measurements: {
|
|
172
172
|
irisDiameter: vn,
|
|
@@ -176,7 +176,7 @@ function ag(f, n, g) {
|
|
|
176
176
|
templeLengthLeft: Rf(F),
|
|
177
177
|
templeLengthRight: Rf(h),
|
|
178
178
|
templeLength: Rf(W),
|
|
179
|
-
headWidth: Rf(
|
|
179
|
+
headWidth: Rf(i),
|
|
180
180
|
headDepth: Rf(v),
|
|
181
181
|
headCircumference: Rf(N)
|
|
182
182
|
},
|
|
@@ -193,8 +193,8 @@ async function dg(f) {
|
|
|
193
193
|
if (!g?.faceLandmarks?.length) return null;
|
|
194
194
|
const e = g.faceLandmarks[0], B = Eg(e);
|
|
195
195
|
if (!B) return null;
|
|
196
|
-
const C = n.naturalWidth || n.width, D = n.naturalHeight || n.height, { measurements:
|
|
197
|
-
return { landmarks: B, measurementsMm:
|
|
196
|
+
const C = n.naturalWidth || n.width, D = n.naturalHeight || n.height, { measurements: t, irisConfidence: o } = ag(B, C, D);
|
|
197
|
+
return { landmarks: B, measurementsMm: t, irisConfidence: o, imageWidth: C, imageHeight: D };
|
|
198
198
|
} catch (n) {
|
|
199
199
|
return console.error("[PS-SDK] Face detection failed:", n), null;
|
|
200
200
|
}
|
|
@@ -213,8 +213,8 @@ function Ig(f, n) {
|
|
|
213
213
|
const B = e - g, C = B > 0 ? B * 0.5 : g * 0.05 || 3;
|
|
214
214
|
if (f >= g && f <= e) return "good";
|
|
215
215
|
if (f < g) {
|
|
216
|
-
const
|
|
217
|
-
return
|
|
216
|
+
const t = g - f;
|
|
217
|
+
return t > C * 2 ? "too-loose" : t > C ? "loose" : "a-bit-loose";
|
|
218
218
|
}
|
|
219
219
|
const D = f - e;
|
|
220
220
|
return D > C * 2 ? "too-tight" : D > C ? "tight" : "a-bit-tight";
|
|
@@ -237,8 +237,8 @@ function xg(f, n) {
|
|
|
237
237
|
if (n) {
|
|
238
238
|
const D = Rg[g.measurement.toLowerCase()];
|
|
239
239
|
if (D && n[D]) {
|
|
240
|
-
const
|
|
241
|
-
C.y = Math.round(
|
|
240
|
+
const t = n[D];
|
|
241
|
+
C.y = Math.round(t.y * 1e3) / 1e3, C.x1 = Math.round(t.x1 * 1e3) / 1e3, C.x2 = Math.round(t.x2 * 1e3) / 1e3;
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
return C;
|
|
@@ -250,18 +250,18 @@ function Cn(f, n) {
|
|
|
250
250
|
f?.recommendedSize && (g.recommendedSize = f.recommendedSize);
|
|
251
251
|
const e = /* @__PURE__ */ new Set(), B = [], C = (D) => {
|
|
252
252
|
if (D)
|
|
253
|
-
for (const
|
|
254
|
-
const o =
|
|
255
|
-
e.has(o) || (e.add(o),
|
|
253
|
+
for (const t of D) {
|
|
254
|
+
const o = t.measurement.toLowerCase();
|
|
255
|
+
e.has(o) || (e.add(o), t.userValue && B.push(`${t.measurement} ${t.userValue}`));
|
|
256
256
|
}
|
|
257
257
|
};
|
|
258
258
|
if (C(f?.matchDetails), f?.sections)
|
|
259
259
|
for (const D of Object.values(f.sections)) C(D.matchDetails);
|
|
260
260
|
if (B.length && (g.userMeasurementsText = B.join(", ")), n?.headers?.length && n.rows?.length) {
|
|
261
|
-
const D = n.headers,
|
|
261
|
+
const D = n.headers, t = n.rows.slice(0, 20).map(
|
|
262
262
|
(o) => D.map((r, z) => `${r} ${o[z] ?? "—"}`).join(", ")
|
|
263
263
|
);
|
|
264
|
-
g.sizeChartSummary =
|
|
264
|
+
g.sizeChartSummary = t.join(" | ");
|
|
265
265
|
}
|
|
266
266
|
return Object.keys(g).length ? g : void 0;
|
|
267
267
|
}
|
|
@@ -336,10 +336,10 @@ function FP(f, n, g = "cm") {
|
|
|
336
336
|
return sn(f, { measurements: n, measurementsUnit: g });
|
|
337
337
|
}
|
|
338
338
|
function Tn(f, n) {
|
|
339
|
-
const g = JP(), e = g.findIndex((
|
|
339
|
+
const g = JP(), e = g.findIndex((t) => t.id === f);
|
|
340
340
|
if (e < 0) return null;
|
|
341
341
|
const B = g[e], C = (B.sizeHistory || []).filter(
|
|
342
|
-
(
|
|
342
|
+
(t) => t.productId !== n.productId
|
|
343
343
|
);
|
|
344
344
|
C.unshift(n);
|
|
345
345
|
const D = C.slice(0, 50);
|
|
@@ -463,20 +463,20 @@ async function Gn(f) {
|
|
|
463
463
|
for (const [p, T] of Object.entries(g.measurements))
|
|
464
464
|
T != null && (D[p] = T);
|
|
465
465
|
g.height != null && (D.height = g.height), g.weight != null && (D.weight = g.weight), g.heightUnit && (D.heightUnit = g.heightUnit), g.weightUnit && (D.weightUnit = g.weightUnit), g.age && (D.age = g.age), g.chestProfile && (D.chestProfile = g.chestProfile), g.midsectionProfile && (D.midsectionProfile = g.midsectionProfile), g.hipProfile && (D.hipProfile = g.hipProfile);
|
|
466
|
-
const
|
|
466
|
+
const t = {
|
|
467
467
|
method: "exact",
|
|
468
468
|
locale: g.country || "US",
|
|
469
469
|
sizingUnit: g.measurementsUnit || g.sizingUnit || "cm",
|
|
470
470
|
product: { title: f.productTitle, productId: f.productId, description: "", variants: [] },
|
|
471
471
|
measurements: D
|
|
472
472
|
};
|
|
473
|
-
C && C.found && (
|
|
473
|
+
C && C.found && (t.sizeGuide = C), n("calling /sizing/recommend", { measurements: Object.keys(D), hasSizeGuide: !!t.sizeGuide });
|
|
474
474
|
let o = null;
|
|
475
475
|
try {
|
|
476
476
|
const p = await fetch(`${B}/api/v1/sizing/recommend`, {
|
|
477
477
|
method: "POST",
|
|
478
478
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${e}` },
|
|
479
|
-
body: JSON.stringify(
|
|
479
|
+
body: JSON.stringify(t)
|
|
480
480
|
});
|
|
481
481
|
if (!p.ok)
|
|
482
482
|
return n("recommend FAILED", p.status, p.statusText), null;
|
|
@@ -6786,10 +6786,10 @@ 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 =
|
|
6789
|
+
const [g, e] = j(!1), B = tA(null), C = tA(null), [D, t] = 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
|
+
t({ top: z.bottom + 4, right: window.innerWidth - z.right });
|
|
6793
6793
|
}, []);
|
|
6794
6794
|
return JA(() => {
|
|
6795
6795
|
if (!g) return;
|
|
@@ -6800,7 +6800,7 @@ function _g({ activeLocale: f, onSelect: n }) {
|
|
|
6800
6800
|
return document.addEventListener("mousedown", z), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), () => {
|
|
6801
6801
|
document.removeEventListener("mousedown", z), window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
|
|
6802
6802
|
};
|
|
6803
|
-
}, [g, r]), /* @__PURE__ */ P(
|
|
6803
|
+
}, [g, r]), /* @__PURE__ */ P(rA, { children: [
|
|
6804
6804
|
/* @__PURE__ */ P(
|
|
6805
6805
|
"button",
|
|
6806
6806
|
{
|
|
@@ -6865,20 +6865,20 @@ function un({
|
|
|
6865
6865
|
onCancel: g,
|
|
6866
6866
|
t: e
|
|
6867
6867
|
}) {
|
|
6868
|
-
const [B, C] = j(f?.name || ""), [D,
|
|
6868
|
+
const [B, C] = j(f?.name || ""), [D, t] = j(f?.gender || "male"), [o, r] = j(f?.sizingUnit || "cm"), [z, p] = j(() => {
|
|
6869
6869
|
if (!f) return {};
|
|
6870
|
-
const
|
|
6870
|
+
const i = {};
|
|
6871
6871
|
for (const k of ["heightCm", "weightKg", "age"]) {
|
|
6872
6872
|
const u = f[k];
|
|
6873
|
-
typeof u == "number" && u > 0 && (
|
|
6873
|
+
typeof u == "number" && u > 0 && (i[k] = String(u));
|
|
6874
6874
|
}
|
|
6875
|
-
return
|
|
6875
|
+
return i;
|
|
6876
6876
|
}), T = D === "female" ? fB : AB, [F, h] = j(""), W = () => {
|
|
6877
|
-
const
|
|
6878
|
-
B.trim() ||
|
|
6877
|
+
const i = [];
|
|
6878
|
+
B.trim() || i.push(e("Profile Name"));
|
|
6879
6879
|
for (const u of T)
|
|
6880
|
-
parseFloat(z[u.key] || "") > 0 ||
|
|
6881
|
-
if (
|
|
6880
|
+
parseFloat(z[u.key] || "") > 0 || i.push(e(u.label));
|
|
6881
|
+
if (i.length > 0) {
|
|
6882
6882
|
h(e("Please fill in all fields"));
|
|
6883
6883
|
return;
|
|
6884
6884
|
}
|
|
@@ -6897,8 +6897,8 @@ function un({
|
|
|
6897
6897
|
type: "text",
|
|
6898
6898
|
className: "ps-tryon-sf-input",
|
|
6899
6899
|
value: B,
|
|
6900
|
-
onChange: (
|
|
6901
|
-
C(
|
|
6900
|
+
onChange: (i) => {
|
|
6901
|
+
C(i.target.value), h("");
|
|
6902
6902
|
},
|
|
6903
6903
|
placeholder: e("e.g. My Measurements")
|
|
6904
6904
|
}
|
|
@@ -6911,7 +6911,7 @@ function un({
|
|
|
6911
6911
|
{
|
|
6912
6912
|
type: "button",
|
|
6913
6913
|
className: `ps-tryon-pe-pill-btn${D === "male" ? " ps-active" : ""}`,
|
|
6914
|
-
onClick: () =>
|
|
6914
|
+
onClick: () => t("male"),
|
|
6915
6915
|
children: e("Male")
|
|
6916
6916
|
}
|
|
6917
6917
|
),
|
|
@@ -6920,7 +6920,7 @@ function un({
|
|
|
6920
6920
|
{
|
|
6921
6921
|
type: "button",
|
|
6922
6922
|
className: `ps-tryon-pe-pill-btn${D === "female" ? " ps-active" : ""}`,
|
|
6923
|
-
onClick: () =>
|
|
6923
|
+
onClick: () => t("female"),
|
|
6924
6924
|
children: e("Female")
|
|
6925
6925
|
}
|
|
6926
6926
|
)
|
|
@@ -6946,11 +6946,11 @@ function un({
|
|
|
6946
6946
|
)
|
|
6947
6947
|
] })
|
|
6948
6948
|
] }),
|
|
6949
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-pe-fields", children: T.map((
|
|
6949
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-pe-fields", children: T.map((i) => /* @__PURE__ */ P("div", { className: "ps-tryon-sf-float-field", children: [
|
|
6950
6950
|
/* @__PURE__ */ P("label", { className: "ps-tryon-sf-float-label", children: [
|
|
6951
|
-
e(
|
|
6951
|
+
e(i.label),
|
|
6952
6952
|
" (",
|
|
6953
|
-
o === "in" ?
|
|
6953
|
+
o === "in" ? i.imperialUnit : i.metricUnit,
|
|
6954
6954
|
")"
|
|
6955
6955
|
] }),
|
|
6956
6956
|
/* @__PURE__ */ A(
|
|
@@ -6959,13 +6959,13 @@ function un({
|
|
|
6959
6959
|
type: "number",
|
|
6960
6960
|
className: "ps-tryon-sf-input",
|
|
6961
6961
|
placeholder: " ",
|
|
6962
|
-
value: z[
|
|
6962
|
+
value: z[i.key] || "",
|
|
6963
6963
|
onChange: (k) => {
|
|
6964
|
-
p((u) => ({ ...u, [
|
|
6964
|
+
p((u) => ({ ...u, [i.key]: k.target.value })), h("");
|
|
6965
6965
|
}
|
|
6966
6966
|
}
|
|
6967
6967
|
)
|
|
6968
|
-
] },
|
|
6968
|
+
] }, i.key)) }),
|
|
6969
6969
|
F && /* @__PURE__ */ A("div", { className: "ps-tryon-pe-error", children: F }),
|
|
6970
6970
|
/* @__PURE__ */ P("div", { className: "ps-tryon-pe-actions", children: [
|
|
6971
6971
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-tryon-est-back", onClick: g, children: e("Cancel") }),
|
|
@@ -6981,7 +6981,7 @@ function PB({
|
|
|
6981
6981
|
history: B,
|
|
6982
6982
|
setHistory: C,
|
|
6983
6983
|
setProfileDetail: D,
|
|
6984
|
-
restoreHistory:
|
|
6984
|
+
restoreHistory: t,
|
|
6985
6985
|
t: o
|
|
6986
6986
|
}) {
|
|
6987
6987
|
const [r, z] = j(!1);
|
|
@@ -7002,7 +7002,7 @@ function PB({
|
|
|
7002
7002
|
/* @__PURE__ */ A("span", { className: "ps-tryon-drawer-title", children: o(r ? "New Profile" : f === "profiles" ? "My Profiles" : "History") }),
|
|
7003
7003
|
f === "profiles" && !r && /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-add-btn", onClick: () => z(!0), children: "+" })
|
|
7004
7004
|
] }),
|
|
7005
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: f === "profiles" && r ? /* @__PURE__ */ A(un, { onSave: T, onCancel: () => z(!1), t: o }) : f === "profiles" ? /* @__PURE__ */ P(
|
|
7005
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: f === "profiles" && r ? /* @__PURE__ */ A(un, { onSave: T, onCancel: () => z(!1), t: o }) : f === "profiles" ? /* @__PURE__ */ P(rA, { children: [
|
|
7006
7006
|
/* @__PURE__ */ P("button", { className: "ps-tryon-drawer-create", onClick: () => z(!0), children: [
|
|
7007
7007
|
"+ ",
|
|
7008
7008
|
o("Create New Profile")
|
|
@@ -7020,8 +7020,8 @@ function PB({
|
|
|
7020
7020
|
] }),
|
|
7021
7021
|
/* @__PURE__ */ A(mg, {})
|
|
7022
7022
|
] }, F.id))
|
|
7023
|
-
] }) : /* @__PURE__ */ A(
|
|
7024
|
-
B.map((F, h) => /* @__PURE__ */ P("div", { className: "ps-tryon-history-item ps-tryon-history-clickable", onClick: () =>
|
|
7023
|
+
] }) : /* @__PURE__ */ A(rA, { children: B.length === 0 ? /* @__PURE__ */ A("div", { className: "ps-tryon-drawer-empty", children: o("No history yet.") }) : /* @__PURE__ */ P(rA, { children: [
|
|
7024
|
+
B.map((F, h) => /* @__PURE__ */ P("div", { className: "ps-tryon-history-item ps-tryon-history-clickable", onClick: () => t(F), children: [
|
|
7025
7025
|
/* @__PURE__ */ P("div", { className: "ps-tryon-history-images", children: [
|
|
7026
7026
|
F.productImage && /* @__PURE__ */ A("img", { src: F.productImage, alt: "", className: "ps-tryon-history-thumb" }),
|
|
7027
7027
|
F.resultImageUrl && /* @__PURE__ */ A("img", { src: F.resultImageUrl, alt: "", className: "ps-tryon-history-result-img" })
|
|
@@ -7036,15 +7036,15 @@ function PB({
|
|
|
7036
7036
|
/* @__PURE__ */ A("span", { className: "ps-tryon-history-size-badge", children: F.recommendedSize }),
|
|
7037
7037
|
F.reasoning && /* @__PURE__ */ A("span", { className: "ps-tryon-history-sizing-reason", children: F.reasoning })
|
|
7038
7038
|
] }),
|
|
7039
|
-
p(F) && F.sizingResult?.sections && /* @__PURE__ */ A("div", { className: "ps-tryon-history-sections", children: Object.entries(F.sizingResult.sections).map(([W,
|
|
7039
|
+
p(F) && F.sizingResult?.sections && /* @__PURE__ */ A("div", { className: "ps-tryon-history-sections", children: Object.entries(F.sizingResult.sections).map(([W, i]) => /* @__PURE__ */ P("span", { className: "ps-tryon-history-section-chip", children: [
|
|
7040
7040
|
W,
|
|
7041
7041
|
": ",
|
|
7042
|
-
|
|
7042
|
+
i.recommendedSize
|
|
7043
7043
|
] }, W)) }),
|
|
7044
7044
|
F.resultImageUrl && /* @__PURE__ */ A("span", { className: "ps-tryon-history-tryon-badge", children: o("Try-on") })
|
|
7045
7045
|
] }),
|
|
7046
7046
|
/* @__PURE__ */ A("button", { className: "ps-tryon-history-delete", onClick: (W) => {
|
|
7047
|
-
W.stopPropagation(), C((
|
|
7047
|
+
W.stopPropagation(), C((i) => i.filter((k, u) => u !== h));
|
|
7048
7048
|
}, children: /* @__PURE__ */ A(Jg, {}) })
|
|
7049
7049
|
] }, F.id)),
|
|
7050
7050
|
/* @__PURE__ */ A("button", { className: "ps-tryon-drawer-clear", onClick: () => C([]), children: o("Clear All") })
|
|
@@ -7079,26 +7079,26 @@ function nB({
|
|
|
7079
7079
|
lastEditedAt: Date.now()
|
|
7080
7080
|
} : z
|
|
7081
7081
|
)), n(null);
|
|
7082
|
-
},
|
|
7082
|
+
}, t = () => n(null);
|
|
7083
7083
|
return lP(
|
|
7084
7084
|
/* @__PURE__ */ A(
|
|
7085
7085
|
"div",
|
|
7086
7086
|
{
|
|
7087
7087
|
className: "ps-tryon-detail-overlay",
|
|
7088
7088
|
onClick: (o) => {
|
|
7089
|
-
o.target === o.currentTarget &&
|
|
7089
|
+
o.target === o.currentTarget && t();
|
|
7090
7090
|
},
|
|
7091
7091
|
children: /* @__PURE__ */ P("div", { className: "ps-tryon-detail-modal", children: [
|
|
7092
7092
|
/* @__PURE__ */ P("div", { className: "ps-tryon-detail-header", children: [
|
|
7093
7093
|
/* @__PURE__ */ A("span", { children: C("Edit Profile") }),
|
|
7094
|
-
/* @__PURE__ */ A("button", { onClick:
|
|
7094
|
+
/* @__PURE__ */ A("button", { onClick: t, "aria-label": C("Close"), children: /* @__PURE__ */ A(Xn, { size: 18 }) })
|
|
7095
7095
|
] }),
|
|
7096
7096
|
/* @__PURE__ */ A("div", { className: "ps-tryon-detail-body", children: /* @__PURE__ */ A(
|
|
7097
7097
|
un,
|
|
7098
7098
|
{
|
|
7099
7099
|
profile: f,
|
|
7100
7100
|
onSave: D,
|
|
7101
|
-
onCancel:
|
|
7101
|
+
onCancel: t,
|
|
7102
7102
|
t: C
|
|
7103
7103
|
}
|
|
7104
7104
|
) })
|
|
@@ -7114,7 +7114,7 @@ function gB({
|
|
|
7114
7114
|
onEdit: g,
|
|
7115
7115
|
t: e
|
|
7116
7116
|
}) {
|
|
7117
|
-
const B = f.heightUnit === "in" || f.heightUnit === "ft" ? "in" : "cm", C = f.weightUnit === "lbs" ? "lbs" : "kg", D = xf(B),
|
|
7117
|
+
const B = f.heightUnit === "in" || f.heightUnit === "ft" ? "in" : "cm", C = f.weightUnit === "lbs" ? "lbs" : "kg", D = xf(B), t = (p) => {
|
|
7118
7118
|
if (!p) return "—";
|
|
7119
7119
|
if (B === "in") {
|
|
7120
7120
|
const T = Math.floor(p / 12), F = Math.round(p % 12);
|
|
@@ -7163,7 +7163,7 @@ function gB({
|
|
|
7163
7163
|
}, children: [
|
|
7164
7164
|
/* @__PURE__ */ P("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7165
7165
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: e("Height") }),
|
|
7166
|
-
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children:
|
|
7166
|
+
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: t(r) })
|
|
7167
7167
|
] }),
|
|
7168
7168
|
/* @__PURE__ */ P("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7169
7169
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: e("Weight") }),
|
|
@@ -7222,7 +7222,7 @@ function eB({
|
|
|
7222
7222
|
dynamicFields: B,
|
|
7223
7223
|
formRef: C,
|
|
7224
7224
|
formGender: D,
|
|
7225
|
-
sizingUnit:
|
|
7225
|
+
sizingUnit: t,
|
|
7226
7226
|
setSizingUnit: o,
|
|
7227
7227
|
formKey: r,
|
|
7228
7228
|
setFormKey: z,
|
|
@@ -7231,33 +7231,33 @@ function eB({
|
|
|
7231
7231
|
setSizingLoading: F,
|
|
7232
7232
|
setView: h,
|
|
7233
7233
|
submitSizing: W,
|
|
7234
|
-
t
|
|
7234
|
+
t: i
|
|
7235
7235
|
}) {
|
|
7236
|
-
const k =
|
|
7236
|
+
const k = t === "in" ? "in" : "cm", u = /* @__PURE__ */ new Set(["weight", "weightKg", "height"]), v = B.filter((K) => K.required && K.unit === "cm" && !u.has(K.key)), I = () => {
|
|
7237
7237
|
C.current.gender = D, T("exact"), F(!0), h("size-result"), W("exact");
|
|
7238
7238
|
};
|
|
7239
7239
|
return e || !g ? /* @__PURE__ */ P("div", { className: "ps-bp-layout", children: [
|
|
7240
7240
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", children: /* @__PURE__ */ A("img", { src: f, alt: n, className: "ps-bp-image-img" }) }),
|
|
7241
7241
|
/* @__PURE__ */ P("div", { className: "ps-bp-root", style: { alignItems: "center", justifyContent: "center" }, children: [
|
|
7242
7242
|
/* @__PURE__ */ A("div", { className: "ps-tryon-size-loading-spinner" }),
|
|
7243
|
-
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.8vw", marginTop: "0.6vw" }, children:
|
|
7243
|
+
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.8vw", marginTop: "0.6vw" }, children: i("Estimating your measurements...") })
|
|
7244
7244
|
] })
|
|
7245
7245
|
] }) : /* @__PURE__ */ P("div", { className: "ps-bp-layout", children: [
|
|
7246
7246
|
/* @__PURE__ */ A("div", { className: "ps-bp-image", children: /* @__PURE__ */ A("img", { src: f, alt: n, className: "ps-bp-image-img" }) }),
|
|
7247
7247
|
/* @__PURE__ */ P("div", { className: "ps-bp-root", children: [
|
|
7248
|
-
/* @__PURE__ */ A("h3", { className: "ps-bp-title", style: { fontSize: "1.1vw" }, children:
|
|
7249
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-subtitle", children:
|
|
7250
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-sf-fields", style: { flex: 1, overflowY: "auto" }, children: v.map((
|
|
7251
|
-
const N = g[
|
|
7248
|
+
/* @__PURE__ */ A("h3", { className: "ps-bp-title", style: { fontSize: "1.1vw" }, children: i("Here's what we estimated") }),
|
|
7249
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-subtitle", children: i("Tap any value to adjust if needed") }),
|
|
7250
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-sf-fields", style: { flex: 1, overflowY: "auto" }, children: v.map((K) => {
|
|
7251
|
+
const N = g[K.key], x = C.current[K.key] ? parseFloat(C.current[K.key]) : null, E = N || x;
|
|
7252
7252
|
if (!E) return null;
|
|
7253
|
-
const BA = !N && !!
|
|
7254
|
-
return C.current[
|
|
7253
|
+
const BA = !N && !!x;
|
|
7254
|
+
return C.current[K.key] || (C.current[K.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
|
+
i(K.label),
|
|
7257
7257
|
" (",
|
|
7258
7258
|
k,
|
|
7259
7259
|
") ",
|
|
7260
|
-
BA ? /* @__PURE__ */ A("span", { className: "ps-tryon-sf-entered-badge", children:
|
|
7260
|
+
BA ? /* @__PURE__ */ A("span", { className: "ps-tryon-sf-entered-badge", children: i("ENTERED") }) : /* @__PURE__ */ A("span", { className: "ps-tryon-sf-estimated-badge", children: i("ESTIMATED") })
|
|
7261
7261
|
] }),
|
|
7262
7262
|
/* @__PURE__ */ A(
|
|
7263
7263
|
"input",
|
|
@@ -7266,18 +7266,18 @@ function eB({
|
|
|
7266
7266
|
placeholder: " ",
|
|
7267
7267
|
className: "ps-tryon-sf-input",
|
|
7268
7268
|
defaultValue: E,
|
|
7269
|
-
onInput: (c) => p(
|
|
7269
|
+
onInput: (c) => p(K.key, c.target.value)
|
|
7270
7270
|
}
|
|
7271
7271
|
)
|
|
7272
|
-
] }) },
|
|
7272
|
+
] }) }, K.key);
|
|
7273
7273
|
}) }, `est-${r}`),
|
|
7274
7274
|
/* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
7275
7275
|
/* @__PURE__ */ P("button", { type: "button", className: "ps-bp-back-btn", onClick: () => h("body-profile"), children: [
|
|
7276
7276
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
7277
7277
|
" ",
|
|
7278
|
-
|
|
7278
|
+
i("Back")
|
|
7279
7279
|
] }),
|
|
7280
|
-
/* @__PURE__ */ A("button", { className: "ps-bp-next-btn", onClick: I, children:
|
|
7280
|
+
/* @__PURE__ */ A("button", { className: "ps-bp-next-btn", onClick: I, children: i("What is my size?") })
|
|
7281
7281
|
] })
|
|
7282
7282
|
] })
|
|
7283
7283
|
] });
|
|
@@ -7354,14 +7354,14 @@ function CB({ landmarks: f, w: n, h: g }) {
|
|
|
7354
7354
|
preserveAspectRatio: "xMidYMid meet",
|
|
7355
7355
|
children: [
|
|
7356
7356
|
DB.map(([e, B], C) => {
|
|
7357
|
-
const D = f[e],
|
|
7358
|
-
return !D || !
|
|
7357
|
+
const D = f[e], t = f[B];
|
|
7358
|
+
return !D || !t ? null : /* @__PURE__ */ A(
|
|
7359
7359
|
"line",
|
|
7360
7360
|
{
|
|
7361
7361
|
x1: D.x * n,
|
|
7362
7362
|
y1: D.y * g,
|
|
7363
|
-
x2:
|
|
7364
|
-
y2:
|
|
7363
|
+
x2: t.x * n,
|
|
7364
|
+
y2: t.y * g,
|
|
7365
7365
|
stroke: "rgba(100,210,255,0.9)",
|
|
7366
7366
|
strokeWidth: "4",
|
|
7367
7367
|
strokeLinecap: "round",
|
|
@@ -7401,14 +7401,14 @@ function CB({ landmarks: f, w: n, h: g }) {
|
|
|
7401
7401
|
}
|
|
7402
7402
|
const wP = 22, bP = 27, IP = 2 * Math.PI * bP;
|
|
7403
7403
|
function iB({ t: f }) {
|
|
7404
|
-
const n =
|
|
7404
|
+
const n = tA(Date.now()), g = tA(null), e = tA(null), B = tA(null), C = tA(null);
|
|
7405
7405
|
return JA(() => {
|
|
7406
7406
|
n.current = Date.now();
|
|
7407
7407
|
const D = setInterval(() => {
|
|
7408
|
-
const
|
|
7408
|
+
const t = (Date.now() - n.current) / 1e3, o = Math.min(95, t / wP * 100), r = Math.round(o);
|
|
7409
7409
|
if (e.current && (e.current.style.width = `${r}%`), C.current && (C.current.textContent = `${r}%`), g.current && (g.current.style.strokeDashoffset = String(IP * (1 - o / 100))), B.current) {
|
|
7410
|
-
const z = Math.max(0, wP - Math.floor(
|
|
7411
|
-
B.current.textContent =
|
|
7410
|
+
const z = Math.max(0, wP - Math.floor(t));
|
|
7411
|
+
B.current.textContent = t >= wP ? "•••" : `~${z}s`;
|
|
7412
7412
|
}
|
|
7413
7413
|
}, 200);
|
|
7414
7414
|
return () => clearInterval(D);
|
|
@@ -7444,7 +7444,7 @@ function rn({
|
|
|
7444
7444
|
onSwitchToManual: C,
|
|
7445
7445
|
t: D
|
|
7446
7446
|
}) {
|
|
7447
|
-
const
|
|
7447
|
+
const t = f || n || "", o = !!f, r = B ? [
|
|
7448
7448
|
{ title: D("GENERATING TRY-ON"), desc: D("Rendering the garment on your photo."), viewfinderText: D("GENERATING") },
|
|
7449
7449
|
{ title: D("REFINING DETAILS"), desc: D("Fine-tuning fit, drape and shadows."), viewfinderText: D("REFINING") },
|
|
7450
7450
|
{ title: D("ALMOST THERE"), desc: D("Final compositing in progress."), viewfinderText: D("COMPOSITING") },
|
|
@@ -7460,8 +7460,8 @@ function rn({
|
|
|
7460
7460
|
{ title: D("ESTIMATING BODY"), desc: D("Computing chest, waist, hips, sleeve and inseam from your basics."), viewfinderText: D("ESTIMATING BODY") },
|
|
7461
7461
|
{ title: D("MATCHING SIZE"), desc: D("Comparing your measurements to the garment's size guide."), viewfinderText: D("MATCHING SIZE") },
|
|
7462
7462
|
{ title: D("FINALIZING RESULT"), desc: D("Almost done — preparing your recommendation."), viewfinderText: D("FINALIZING") }
|
|
7463
|
-
], [z, p] = j({ w: 800, h: 1200 }), T = (
|
|
7464
|
-
const k =
|
|
7463
|
+
], [z, p] = j({ w: 800, h: 1200 }), T = (i) => {
|
|
7464
|
+
const k = i.currentTarget;
|
|
7465
7465
|
p({ w: k.naturalWidth || k.offsetWidth, h: k.naturalHeight || k.offsetHeight });
|
|
7466
7466
|
}, [F, h] = j(0);
|
|
7467
7467
|
JA(() => {
|
|
@@ -7475,10 +7475,10 @@ function rn({
|
|
|
7475
7475
|
const W = r[F] ?? r[0];
|
|
7476
7476
|
return /* @__PURE__ */ P("div", { className: "ps-msc-root", children: [
|
|
7477
7477
|
/* @__PURE__ */ P("div", { className: "ps-msc-viewfinder", children: [
|
|
7478
|
-
|
|
7478
|
+
t && /* @__PURE__ */ A(
|
|
7479
7479
|
"img",
|
|
7480
7480
|
{
|
|
7481
|
-
src:
|
|
7481
|
+
src: t,
|
|
7482
7482
|
alt: D("Your photo"),
|
|
7483
7483
|
className: "ps-msc-photo",
|
|
7484
7484
|
onLoad: T
|
|
@@ -7529,7 +7529,7 @@ function HB({
|
|
|
7529
7529
|
sectionEntries: B,
|
|
7530
7530
|
onSelectSection: C,
|
|
7531
7531
|
onTryOn: D,
|
|
7532
|
-
tryOnProcessing:
|
|
7532
|
+
tryOnProcessing: t,
|
|
7533
7533
|
resultImageUrl: o,
|
|
7534
7534
|
tryOnDone: r,
|
|
7535
7535
|
onTryAgain: z,
|
|
@@ -7538,24 +7538,24 @@ function HB({
|
|
|
7538
7538
|
showLines: F,
|
|
7539
7539
|
onToggleLines: h,
|
|
7540
7540
|
onImageLoad: W,
|
|
7541
|
-
t
|
|
7541
|
+
t: i
|
|
7542
7542
|
}) {
|
|
7543
|
-
const k =
|
|
7543
|
+
const k = vf(() => {
|
|
7544
7544
|
const I = [...g?.matchDetails || []];
|
|
7545
7545
|
if (g?.sections)
|
|
7546
|
-
for (const
|
|
7547
|
-
|
|
7546
|
+
for (const K of Object.values(g.sections))
|
|
7547
|
+
K.matchDetails && I.push(...K.matchDetails);
|
|
7548
7548
|
if (I.length > 0) {
|
|
7549
|
-
const
|
|
7550
|
-
(
|
|
7551
|
-
).length, N = Math.round(
|
|
7549
|
+
const K = I.filter(
|
|
7550
|
+
(x) => x.fit === "good" || x.fit === "a-bit-tight" || x.fit === "a-bit-loose"
|
|
7551
|
+
).length, N = Math.round(K / I.length * 100);
|
|
7552
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;
|
|
7556
7556
|
return /* @__PURE__ */ P("div", { className: "ps-msr-root", children: [
|
|
7557
7557
|
/* @__PURE__ */ P("div", { className: "ps-msr-scroll", children: [
|
|
7558
|
-
/* @__PURE__ */ A("div", { className: "ps-msr-eyebrow", children:
|
|
7558
|
+
/* @__PURE__ */ A("div", { className: "ps-msr-eyebrow", children: i("Sizing Profile") }),
|
|
7559
7559
|
/* @__PURE__ */ P("div", { className: "ps-msr-product", children: [
|
|
7560
7560
|
/* @__PURE__ */ P("div", { className: `ps-msr-product-img-wrap${v ? " ps-tryon" : ""}`, children: [
|
|
7561
7561
|
/* @__PURE__ */ A(
|
|
@@ -7568,7 +7568,7 @@ function HB({
|
|
|
7568
7568
|
}
|
|
7569
7569
|
),
|
|
7570
7570
|
F && T,
|
|
7571
|
-
!v && /* @__PURE__ */ A("button", { type: "button", className: "ps-msr-bookmark", "aria-label":
|
|
7571
|
+
!v && /* @__PURE__ */ A("button", { type: "button", className: "ps-msr-bookmark", "aria-label": i("Save"), children: /* @__PURE__ */ A(rB, {}) }),
|
|
7572
7572
|
v && h && /* @__PURE__ */ P(
|
|
7573
7573
|
"button",
|
|
7574
7574
|
{
|
|
@@ -7578,7 +7578,7 @@ function HB({
|
|
|
7578
7578
|
"aria-pressed": !!F,
|
|
7579
7579
|
children: [
|
|
7580
7580
|
/* @__PURE__ */ A(QB, {}),
|
|
7581
|
-
|
|
7581
|
+
i(F ? "Hide Fit" : "Show Fit")
|
|
7582
7582
|
]
|
|
7583
7583
|
}
|
|
7584
7584
|
)
|
|
@@ -7609,10 +7609,10 @@ function HB({
|
|
|
7609
7609
|
"%"
|
|
7610
7610
|
] })
|
|
7611
7611
|
] }),
|
|
7612
|
-
/* @__PURE__ */ A("span", { className: "ps-msr-match-label", children:
|
|
7612
|
+
/* @__PURE__ */ A("span", { className: "ps-msr-match-label", children: i("FIT MATCH") })
|
|
7613
7613
|
] }) }),
|
|
7614
|
-
/* @__PURE__ */ A("div", { className: "ps-msr-sections", children: B.map(({ name: I, secResult:
|
|
7615
|
-
const N = I.replace(/\s*[—–-]\s*.*/g, ""),
|
|
7614
|
+
/* @__PURE__ */ A("div", { className: "ps-msr-sections", children: B.map(({ name: I, secResult: K }) => {
|
|
7615
|
+
const N = I.replace(/\s*[—–-]\s*.*/g, ""), x = K, E = x.found === !1 ? i("No fit") : x.size || K.recommendedSize;
|
|
7616
7616
|
return /* @__PURE__ */ P(
|
|
7617
7617
|
"button",
|
|
7618
7618
|
{
|
|
@@ -7635,7 +7635,7 @@ function HB({
|
|
|
7635
7635
|
type: "button",
|
|
7636
7636
|
className: "ps-msr-tryon-cta ps-secondary",
|
|
7637
7637
|
onClick: z,
|
|
7638
|
-
children:
|
|
7638
|
+
children: i("Try Again")
|
|
7639
7639
|
}
|
|
7640
7640
|
),
|
|
7641
7641
|
/* @__PURE__ */ A(
|
|
@@ -7644,7 +7644,7 @@ function HB({
|
|
|
7644
7644
|
type: "button",
|
|
7645
7645
|
className: "ps-msr-tryon-cta",
|
|
7646
7646
|
onClick: p,
|
|
7647
|
-
children:
|
|
7647
|
+
children: i("Continue Shopping")
|
|
7648
7648
|
}
|
|
7649
7649
|
)
|
|
7650
7650
|
] }) : (
|
|
@@ -7656,10 +7656,10 @@ function HB({
|
|
|
7656
7656
|
type: "button",
|
|
7657
7657
|
className: "ps-msr-tryon-cta",
|
|
7658
7658
|
onClick: D,
|
|
7659
|
-
disabled:
|
|
7659
|
+
disabled: t,
|
|
7660
7660
|
children: [
|
|
7661
7661
|
/* @__PURE__ */ A(tB, {}),
|
|
7662
|
-
t
|
|
7662
|
+
i(t ? "Processing..." : "See how it looks on yourself")
|
|
7663
7663
|
]
|
|
7664
7664
|
}
|
|
7665
7665
|
)
|
|
@@ -7684,21 +7684,21 @@ const zB = [
|
|
|
7684
7684
|
["rightKnee", "rightAnkle"]
|
|
7685
7685
|
], vP = 22, uP = 27, RP = 2 * Math.PI * uP;
|
|
7686
7686
|
function kn({ t: f, isActive: n }) {
|
|
7687
|
-
const g =
|
|
7687
|
+
const g = tA(null), e = tA(null), B = tA(null), C = tA(null), D = tA(null);
|
|
7688
7688
|
return JA(() => {
|
|
7689
7689
|
if (!n) {
|
|
7690
7690
|
g.current = null;
|
|
7691
7691
|
return;
|
|
7692
7692
|
}
|
|
7693
7693
|
g.current = Date.now();
|
|
7694
|
-
const
|
|
7694
|
+
const t = setInterval(() => {
|
|
7695
7695
|
const o = g.current || Date.now(), r = (Date.now() - o) / 1e3, z = Math.min(95, r / vP * 100), p = Math.round(z);
|
|
7696
7696
|
if (B.current && (B.current.style.width = `${p}%`), D.current && (D.current.textContent = `${p}%`), e.current && (e.current.style.strokeDashoffset = String(RP * (1 - z / 100))), C.current) {
|
|
7697
7697
|
const T = Math.max(0, vP - Math.floor(r));
|
|
7698
7698
|
C.current.textContent = r >= vP ? "•••" : `~${T}s`;
|
|
7699
7699
|
}
|
|
7700
7700
|
}, 200);
|
|
7701
|
-
return () => clearInterval(
|
|
7701
|
+
return () => clearInterval(t);
|
|
7702
7702
|
}, [n]), n ? /* @__PURE__ */ P("div", { className: "ps-tryon-progress-wrap", children: [
|
|
7703
7703
|
/* @__PURE__ */ P("div", { className: "ps-tryon-progress-ring", children: [
|
|
7704
7704
|
/* @__PURE__ */ P("svg", { width: "64", height: "64", viewBox: "0 0 64 64", "aria-hidden": "true", children: [
|
|
@@ -7756,11 +7756,11 @@ function cB({
|
|
|
7756
7756
|
[f.leftMouth, f.rightMouth]
|
|
7757
7757
|
];
|
|
7758
7758
|
return /* @__PURE__ */ P("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${e} ${B}`, preserveAspectRatio: "xMidYMid meet", children: [
|
|
7759
|
-
D.map(([
|
|
7759
|
+
D.map(([t, o], r) => /* @__PURE__ */ A(
|
|
7760
7760
|
"line",
|
|
7761
7761
|
{
|
|
7762
|
-
x1:
|
|
7763
|
-
y1:
|
|
7762
|
+
x1: t.x * e,
|
|
7763
|
+
y1: t.y * B,
|
|
7764
7764
|
x2: o.x * e,
|
|
7765
7765
|
y2: o.y * B,
|
|
7766
7766
|
stroke: "rgba(100,210,255,0.55)",
|
|
@@ -7771,13 +7771,13 @@ function cB({
|
|
|
7771
7771
|
},
|
|
7772
7772
|
`fl-${r}`
|
|
7773
7773
|
)),
|
|
7774
|
-
[f.leftIrisCenter, f.rightIrisCenter].map((
|
|
7775
|
-
const r = o === 0 ? f.leftIrisRing : f.rightIrisRing, z = r?.length ? Math.abs((r[0]?.x ??
|
|
7774
|
+
[f.leftIrisCenter, f.rightIrisCenter].map((t, o) => {
|
|
7775
|
+
const r = o === 0 ? f.leftIrisRing : f.rightIrisRing, z = r?.length ? Math.abs((r[0]?.x ?? t.x) - (r[2]?.x ?? t.x)) * e / 2 : 6;
|
|
7776
7776
|
return /* @__PURE__ */ A(
|
|
7777
7777
|
"circle",
|
|
7778
7778
|
{
|
|
7779
|
-
cx:
|
|
7780
|
-
cy:
|
|
7779
|
+
cx: t.x * e,
|
|
7780
|
+
cy: t.y * B,
|
|
7781
7781
|
r: Math.max(6, z),
|
|
7782
7782
|
fill: "none",
|
|
7783
7783
|
stroke: "rgba(255,230,120,0.95)",
|
|
@@ -7788,7 +7788,7 @@ function cB({
|
|
|
7788
7788
|
`iris-${o}`
|
|
7789
7789
|
);
|
|
7790
7790
|
}),
|
|
7791
|
-
C.map(({ key:
|
|
7791
|
+
C.map(({ key: t, p: o }, r) => /* @__PURE__ */ P("g", { children: [
|
|
7792
7792
|
/* @__PURE__ */ A(
|
|
7793
7793
|
"circle",
|
|
7794
7794
|
{
|
|
@@ -7811,7 +7811,7 @@ function cB({
|
|
|
7811
7811
|
style: { animation: `ps-pose-fade 0.3s ease ${r * 0.04}s forwards, ps-dot-pulse 1.5s ease-in-out ${0.5 + r * 0.04}s infinite` }
|
|
7812
7812
|
}
|
|
7813
7813
|
)
|
|
7814
|
-
] },
|
|
7814
|
+
] }, t))
|
|
7815
7815
|
] });
|
|
7816
7816
|
}
|
|
7817
7817
|
function pB({
|
|
@@ -7845,17 +7845,17 @@ function pB({
|
|
|
7845
7845
|
{ title: B("REFINING DETAILS"), desc: B("Fine-tuning fit, drape and shadows.") },
|
|
7846
7846
|
{ title: B("ALMOST THERE"), desc: B("Final compositing in progress.") },
|
|
7847
7847
|
{ title: B("FINISHING TOUCHES"), desc: B("Polishing the result.") }
|
|
7848
|
-
],
|
|
7848
|
+
], t = g ? D : C, o = g ? !!e : n, [r, z] = j(0);
|
|
7849
7849
|
JA(() => {
|
|
7850
7850
|
z(0);
|
|
7851
7851
|
}, [g]), JA(() => {
|
|
7852
7852
|
if (o) return;
|
|
7853
7853
|
const F = setInterval(() => {
|
|
7854
|
-
z((h) => Math.min(h + 1,
|
|
7854
|
+
z((h) => Math.min(h + 1, t.length - 1));
|
|
7855
7855
|
}, g ? 2200 : 900);
|
|
7856
7856
|
return () => clearInterval(F);
|
|
7857
|
-
}, [o,
|
|
7858
|
-
const p =
|
|
7857
|
+
}, [o, t.length, g]);
|
|
7858
|
+
const p = t[r] ?? t[0];
|
|
7859
7859
|
return /* @__PURE__ */ P("div", { className: "ps-msc-stage", style: { alignSelf: "center", marginTop: "auto", marginBottom: "auto" }, children: [
|
|
7860
7860
|
/* @__PURE__ */ P("div", { className: "ps-msc-stage-slot", children: [
|
|
7861
7861
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: p.title }),
|
|
@@ -7867,7 +7867,7 @@ function pB({
|
|
|
7867
7867
|
function Qn({ landmarks: f, imgWidth: n, imgHeight: g }) {
|
|
7868
7868
|
const e = n, B = g;
|
|
7869
7869
|
return /* @__PURE__ */ P("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${e} ${B}`, preserveAspectRatio: "xMidYMid meet", children: [
|
|
7870
|
-
zB.map(([C, D],
|
|
7870
|
+
zB.map(([C, D], t) => {
|
|
7871
7871
|
const o = f[C], r = f[D];
|
|
7872
7872
|
return !o || !r || typeof o != "object" || typeof r != "object" || typeof o.x != "number" || typeof o.y != "number" || typeof r.x != "number" || typeof r.y != "number" ? null : /* @__PURE__ */ A(
|
|
7873
7873
|
"line",
|
|
@@ -7880,12 +7880,12 @@ function Qn({ landmarks: f, imgWidth: n, imgHeight: g }) {
|
|
|
7880
7880
|
strokeWidth: "4",
|
|
7881
7881
|
strokeLinecap: "round",
|
|
7882
7882
|
opacity: "0",
|
|
7883
|
-
style: { animation: `ps-pose-fade 0.4s ease ${
|
|
7883
|
+
style: { animation: `ps-pose-fade 0.4s ease ${t * 0.05}s forwards` }
|
|
7884
7884
|
},
|
|
7885
|
-
`l-${
|
|
7885
|
+
`l-${t}`
|
|
7886
7886
|
);
|
|
7887
7887
|
}),
|
|
7888
|
-
Object.entries(f).filter(([, C]) => C && typeof C == "object" && typeof C.x == "number" && typeof C.y == "number").map(([C, D],
|
|
7888
|
+
Object.entries(f).filter(([, C]) => C && typeof C == "object" && typeof C.x == "number" && typeof C.y == "number").map(([C, D], t) => /* @__PURE__ */ P("g", { children: [
|
|
7889
7889
|
/* @__PURE__ */ A(
|
|
7890
7890
|
"circle",
|
|
7891
7891
|
{
|
|
@@ -7894,7 +7894,7 @@ function Qn({ landmarks: f, imgWidth: n, imgHeight: g }) {
|
|
|
7894
7894
|
r: "14",
|
|
7895
7895
|
fill: "rgba(100,210,255,0.25)",
|
|
7896
7896
|
opacity: "0",
|
|
7897
|
-
style: { animation: `ps-pose-fade 0.3s ease ${
|
|
7897
|
+
style: { animation: `ps-pose-fade 0.3s ease ${t * 0.04}s forwards` }
|
|
7898
7898
|
}
|
|
7899
7899
|
),
|
|
7900
7900
|
/* @__PURE__ */ A(
|
|
@@ -7905,7 +7905,7 @@ function Qn({ landmarks: f, imgWidth: n, imgHeight: g }) {
|
|
|
7905
7905
|
r: "8",
|
|
7906
7906
|
fill: "rgba(100,210,255,0.9)",
|
|
7907
7907
|
opacity: "0",
|
|
7908
|
-
style: { animation: `ps-pose-fade 0.3s ease ${
|
|
7908
|
+
style: { animation: `ps-pose-fade 0.3s ease ${t * 0.04}s forwards, ps-dot-pulse 1.5s ease-in-out ${0.5 + t * 0.04}s infinite` }
|
|
7909
7909
|
}
|
|
7910
7910
|
)
|
|
7911
7911
|
] }, C))
|
|
@@ -7917,20 +7917,20 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7917
7917
|
{ key: "chest", line: f.chest, label: "Chest" },
|
|
7918
7918
|
{ key: "waist", line: f.waist, label: "Waist" },
|
|
7919
7919
|
{ key: "hips", line: f.hips, label: "Hips" }
|
|
7920
|
-
],
|
|
7921
|
-
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${
|
|
7920
|
+
], t = e, o = B, r = Math.max(t, o) / 500, z = Math.max(5, 3 * r), p = Math.max(7, 5 * r);
|
|
7921
|
+
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${t} ${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
|
|
7924
|
-
const
|
|
7925
|
-
return !!(
|
|
7926
|
-
}),
|
|
7923
|
+
const i = F.x1 * t, k = F.x2 * t, u = F.y * o, v = k - i, I = v * 0.06, K = (i + k) / 2, N = n.find((mA) => {
|
|
7924
|
+
const EA = mA.area.toLowerCase().trim();
|
|
7925
|
+
return !!(EA === T || T === "chest" && (EA.includes("bust") || EA.includes("chest")) || T === "waist" && EA.includes("waist") || T === "hips" && (EA.includes("hip") || EA === "hips"));
|
|
7926
|
+
}), x = N ? C(N.fit) : "#2154EF", E = W * 0.35, BA = `M ${i} ${u} Q ${K} ${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 = t - k - 12 * r < y, V = sA ? i - 10 * r : k + 10 * r, s = sA ? "end" : "start", PA = sA ? i : k, RA = sA ? i - 6 * r : k + 6 * r;
|
|
7927
7927
|
return /* @__PURE__ */ P("g", { children: [
|
|
7928
7928
|
/* @__PURE__ */ A(
|
|
7929
7929
|
"path",
|
|
7930
7930
|
{
|
|
7931
7931
|
d: BA,
|
|
7932
7932
|
fill: "none",
|
|
7933
|
-
stroke:
|
|
7933
|
+
stroke: x,
|
|
7934
7934
|
strokeWidth: z,
|
|
7935
7935
|
strokeLinecap: "round",
|
|
7936
7936
|
strokeDasharray: c,
|
|
@@ -7941,10 +7941,10 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7941
7941
|
/* @__PURE__ */ A(
|
|
7942
7942
|
"circle",
|
|
7943
7943
|
{
|
|
7944
|
-
cx:
|
|
7944
|
+
cx: i,
|
|
7945
7945
|
cy: u,
|
|
7946
7946
|
r: p,
|
|
7947
|
-
fill:
|
|
7947
|
+
fill: x,
|
|
7948
7948
|
opacity: "0",
|
|
7949
7949
|
style: { animation: `ps-pose-fade 0.3s ease ${E + 0.5}s forwards` }
|
|
7950
7950
|
}
|
|
@@ -7955,7 +7955,7 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7955
7955
|
cx: k,
|
|
7956
7956
|
cy: u,
|
|
7957
7957
|
r: p,
|
|
7958
|
-
fill:
|
|
7958
|
+
fill: x,
|
|
7959
7959
|
opacity: "0",
|
|
7960
7960
|
style: { animation: `ps-pose-fade 0.3s ease ${E + 0.5}s forwards` }
|
|
7961
7961
|
}
|
|
@@ -7968,7 +7968,7 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7968
7968
|
y1: u,
|
|
7969
7969
|
x2: RA,
|
|
7970
7970
|
y2: u,
|
|
7971
|
-
stroke:
|
|
7971
|
+
stroke: x,
|
|
7972
7972
|
strokeWidth: 2 * r
|
|
7973
7973
|
}
|
|
7974
7974
|
),
|
|
@@ -7977,7 +7977,7 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7977
7977
|
{
|
|
7978
7978
|
x: V,
|
|
7979
7979
|
y: u + 1 * r,
|
|
7980
|
-
fill:
|
|
7980
|
+
fill: x,
|
|
7981
7981
|
fontSize: l,
|
|
7982
7982
|
fontWeight: "700",
|
|
7983
7983
|
fontFamily: "system-ui, -apple-system, sans-serif",
|
|
@@ -8038,7 +8038,7 @@ function DP({
|
|
|
8038
8038
|
unitLbl: B,
|
|
8039
8039
|
chartUnit: C,
|
|
8040
8040
|
lengthEntry: D,
|
|
8041
|
-
onBack:
|
|
8041
|
+
onBack: t,
|
|
8042
8042
|
t: o,
|
|
8043
8043
|
productImage: r,
|
|
8044
8044
|
productTitle: z,
|
|
@@ -8047,20 +8047,20 @@ function DP({
|
|
|
8047
8047
|
showLines: F,
|
|
8048
8048
|
onToggleLines: h,
|
|
8049
8049
|
overlayNode: W,
|
|
8050
|
-
onImageLoad:
|
|
8050
|
+
onImageLoad: i,
|
|
8051
8051
|
onTryOn: k,
|
|
8052
8052
|
tryOnProcessing: u,
|
|
8053
8053
|
backLabel: v,
|
|
8054
8054
|
internationalSizes: I,
|
|
8055
|
-
continueLabel:
|
|
8055
|
+
continueLabel: K,
|
|
8056
8056
|
renderRaw: N = !1,
|
|
8057
|
-
sectionFound:
|
|
8057
|
+
sectionFound: x
|
|
8058
8058
|
}) {
|
|
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,
|
|
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, EA] = j(null), ZA = vf(() => {
|
|
8060
8060
|
if (!D) return [];
|
|
8061
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
|
-
}, [D]), Hf =
|
|
8063
|
+
}, [D]), Hf = vf(() => {
|
|
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 {};
|
|
@@ -8072,7 +8072,7 @@ function DP({
|
|
|
8072
8072
|
zA && YA && (H[String(zA).trim()] = String(YA).trim());
|
|
8073
8073
|
}
|
|
8074
8074
|
return H;
|
|
8075
|
-
}, [D]), m =
|
|
8075
|
+
}, [D]), m = vf(() => {
|
|
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++) {
|
|
@@ -8080,14 +8080,14 @@ function DP({
|
|
|
8080
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, m,
|
|
8083
|
+
}, [n]), aA = n.headers[m] || "Size", TA = vf(() => {
|
|
8084
|
+
const a = n.rows.map((X) => Uf(X, m, aA)).filter(Boolean);
|
|
8085
8085
|
return [...new Set(a)];
|
|
8086
|
-
}, [n, m,
|
|
8086
|
+
}, [n, m, aA]), bA = BA || E, VA = bA === E, kA = vf(() => {
|
|
8087
8087
|
if (VA) return null;
|
|
8088
8088
|
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i, nA = a.some((H) => X.test(H.fit || ""));
|
|
8089
8089
|
return o(nA ? "Not Recommended" : "Your Selection");
|
|
8090
|
-
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA =
|
|
8090
|
+
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA = vf(() => {
|
|
8091
8091
|
const a = [];
|
|
8092
8092
|
for (let X = 0; X < n.headers.length; X++) {
|
|
8093
8093
|
const nA = (n.headers[X] || "").toLowerCase();
|
|
@@ -8130,13 +8130,13 @@ function DP({
|
|
|
8130
8130
|
if (zA.length === 0) return null;
|
|
8131
8131
|
let YA = zA.find((AA) => SA[AA] === oA);
|
|
8132
8132
|
YA == null && (YA = zA[0]);
|
|
8133
|
-
const
|
|
8134
|
-
let gA = n.rows.find((AA) => Uf(AA, m,
|
|
8135
|
-
if (gA || (gA = n.rows.find((AA) => Uf(AA, m,
|
|
8136
|
-
const LA = Uf(AA, m,
|
|
8133
|
+
const wf = n.headers[YA], J = X.trim().toLowerCase();
|
|
8134
|
+
let gA = n.rows.find((AA) => Uf(AA, m, aA) === X);
|
|
8135
|
+
if (gA || (gA = n.rows.find((AA) => Uf(AA, m, aA).trim().toLowerCase() === J)), gA || (gA = n.rows.find((AA) => {
|
|
8136
|
+
const LA = Uf(AA, m, aA).trim().toLowerCase();
|
|
8137
8137
|
return LA.startsWith(J) || J.startsWith(LA);
|
|
8138
8138
|
})), !gA) return null;
|
|
8139
|
-
const Bf = Uf(gA, YA,
|
|
8139
|
+
const Bf = Uf(gA, YA, wf);
|
|
8140
8140
|
if (!Bf) return null;
|
|
8141
8141
|
const FA = QP(Bf), OA = SA[YA];
|
|
8142
8142
|
if (OA === "in" && H) {
|
|
@@ -8148,7 +8148,7 @@ 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, m,
|
|
8151
|
+
}, [n, m, aA, B, SA]), iA = vf(() => {
|
|
8152
8152
|
if (N)
|
|
8153
8153
|
return (g?.matchDetails || []).map((gA) => ({
|
|
8154
8154
|
area: gA.measurement.replace(/\s*\(.*?\)\s*$/, "").trim() || gA.measurement,
|
|
@@ -8170,28 +8170,28 @@ function DP({
|
|
|
8170
8170
|
});
|
|
8171
8171
|
}
|
|
8172
8172
|
if (!nA.length) return [];
|
|
8173
|
-
const
|
|
8173
|
+
const wf = new Set(X.length > 0 ? X.map((J) => J.measurement) : YA ? ["Height"] : []);
|
|
8174
8174
|
return nA.map((J) => {
|
|
8175
|
-
if (
|
|
8175
|
+
if (wf.has(J.measurement)) {
|
|
8176
8176
|
const U = e[J.measurement.toLowerCase()] || kf(J.userValue), R = mA || zA || J.chartRange;
|
|
8177
8177
|
if (!D)
|
|
8178
8178
|
return { area: J.measurement + " (" + R + ")", userNum: U, chartLabel: R, fit: "good", isLength: !0 };
|
|
8179
|
-
const G = D.section, S = G.headers.findIndex((KA) => /size|length/i.test(KA.trim())),
|
|
8179
|
+
const G = D.section, S = G.headers.findIndex((KA) => /size|length/i.test(KA.trim())), dA = G.headers.findIndex((KA) => /cm|\(cm\)|height.*cm/i.test(KA.toLowerCase())), fA = S >= 0 ? S : 0, NA = dA >= 0 ? dA : -1, $A = G.rows.find((KA) => Uf(KA, fA, G.headers[fA]) === R);
|
|
8180
8180
|
let ef = R, yA = "good";
|
|
8181
8181
|
if ($A && NA >= 0) {
|
|
8182
8182
|
const KA = Uf($A, NA, G.headers[NA]);
|
|
8183
8183
|
if (KA) {
|
|
8184
8184
|
ef = KA;
|
|
8185
|
-
const { min:
|
|
8186
|
-
if (
|
|
8187
|
-
const cA = M -
|
|
8188
|
-
if (U >=
|
|
8189
|
-
else if (U <
|
|
8190
|
-
const
|
|
8191
|
-
yA =
|
|
8185
|
+
const { min: Df, max: M } = QP(KA);
|
|
8186
|
+
if (Df > 0 && M > 0) {
|
|
8187
|
+
const cA = M - Df, pA = cA > 0 ? cA * 0.5 : Df * 0.05 || 3, tf = Math.max((M || Df) * 5e-3, 0.25);
|
|
8188
|
+
if (U >= Df - tf && U <= M + tf) yA = "good";
|
|
8189
|
+
else if (U < Df) {
|
|
8190
|
+
const Cf = Df - U;
|
|
8191
|
+
yA = Cf > pA * 2 ? "too-tight" : Cf > pA ? "tight" : "a-bit-tight";
|
|
8192
8192
|
} else {
|
|
8193
|
-
const
|
|
8194
|
-
yA =
|
|
8193
|
+
const Cf = U - M;
|
|
8194
|
+
yA = Cf > pA * 2 ? "too-loose" : Cf > pA ? "loose" : "a-bit-loose";
|
|
8195
8195
|
}
|
|
8196
8196
|
}
|
|
8197
8197
|
}
|
|
@@ -8202,12 +8202,12 @@ function DP({
|
|
|
8202
8202
|
let { min: Bf, max: FA } = QP(J.chartRange), OA = J.chartRange;
|
|
8203
8203
|
const AA = ff(J.measurement, bA);
|
|
8204
8204
|
AA && (OA = AA.range, Bf = AA.min, FA = AA.max);
|
|
8205
|
-
const LA = FA - Bf, Pf = LA > 0 ? LA * 0.5 : Bf * 0.05 || 3, lA = J.measurement.toLowerCase(),
|
|
8205
|
+
const LA = FA - Bf, Pf = LA > 0 ? LA * 0.5 : Bf * 0.05 || 3, lA = J.measurement.toLowerCase(), O = /length|inseam|sleeve|hem|rise/.test(lA);
|
|
8206
8206
|
let q;
|
|
8207
8207
|
const QA = Math.max((FA || Bf) * 0.03, 0.5);
|
|
8208
8208
|
if (gA >= Bf - QA && gA <= FA + QA)
|
|
8209
8209
|
q = "good";
|
|
8210
|
-
else if (
|
|
8210
|
+
else if (O) {
|
|
8211
8211
|
const U = gA > FA ? gA - FA : Bf - gA;
|
|
8212
8212
|
q = (U > Pf * 2 ? "too-" : U > Pf ? "" : "a-bit-") + (gA > FA ? "short" : "long");
|
|
8213
8213
|
} else if (gA < Bf) {
|
|
@@ -8217,11 +8217,11 @@ function DP({
|
|
|
8217
8217
|
const U = gA - FA;
|
|
8218
8218
|
q = U > Pf * 2 ? "too-tight" : U > Pf ? "tight" : "a-bit-tight";
|
|
8219
8219
|
}
|
|
8220
|
-
return { area: J.measurement, userNum: gA, chartLabel: kP(OA), fit: q, isLength:
|
|
8220
|
+
return { area: J.measurement, userNum: gA, chartLabel: kP(OA), fit: q, isLength: O };
|
|
8221
8221
|
});
|
|
8222
|
-
}, [g, D, e, bA, E, ff, mA, RA, N]), nf =
|
|
8222
|
+
}, [g, D, e, bA, E, ff, mA, RA, N]), nf = iA.filter(
|
|
8223
8223
|
(a) => a.fit === "good" || a.fit === "a-bit-tight" || a.fit === "a-bit-loose"
|
|
8224
|
-
).length, xA =
|
|
8224
|
+
).length, xA = iA.length > 0 ? Math.round(nf / iA.length * 100) : 0, Ef = !N, eA = g, $ = eA?.size || E, _A = (g?.matchDetails || []).find(
|
|
8225
8225
|
(a) => /inseam|length/i.test(a.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(a.measurement)
|
|
8226
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, _ = (() => {
|
|
8227
8227
|
if (GA.length <= 3) return GA;
|
|
@@ -8243,7 +8243,7 @@ function DP({
|
|
|
8243
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");
|
|
8244
8244
|
return /* @__PURE__ */ A("div", { className: "ps-msd-root", children: /* @__PURE__ */ P("div", { className: "ps-msd-scroll", children: [
|
|
8245
8245
|
/* @__PURE__ */ P("div", { className: "ps-msd-topbar", children: [
|
|
8246
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-msd-back", onClick:
|
|
8246
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-msd-back", onClick: t, "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: [
|
|
8247
8247
|
/* @__PURE__ */ A("line", { x1: "19", y1: "12", x2: "5", y2: "12" }),
|
|
8248
8248
|
/* @__PURE__ */ A("polyline", { points: "12 19 5 12 12 5" })
|
|
8249
8249
|
] }) }),
|
|
@@ -8261,7 +8261,7 @@ function DP({
|
|
|
8261
8261
|
src: r,
|
|
8262
8262
|
alt: z || "",
|
|
8263
8263
|
className: "ps-msd-image-img",
|
|
8264
|
-
onLoad:
|
|
8264
|
+
onLoad: i
|
|
8265
8265
|
}
|
|
8266
8266
|
),
|
|
8267
8267
|
F && W,
|
|
@@ -8284,7 +8284,7 @@ function DP({
|
|
|
8284
8284
|
}
|
|
8285
8285
|
)
|
|
8286
8286
|
] }),
|
|
8287
|
-
|
|
8287
|
+
x === !1 && /* @__PURE__ */ A("div", { style: {
|
|
8288
8288
|
flex: 1,
|
|
8289
8289
|
display: "flex",
|
|
8290
8290
|
alignItems: "center",
|
|
@@ -8301,7 +8301,7 @@ function DP({
|
|
|
8301
8301
|
/* @__PURE__ */ A("p", { style: { fontSize: "15px", fontWeight: 600, color: "var(--ps-text-primary)", margin: "10px 0 6px", lineHeight: 1.4 }, children: o("We couldn't find a size that fits for this product.") }),
|
|
8302
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.") })
|
|
8303
8303
|
] }) }),
|
|
8304
|
-
|
|
8304
|
+
x !== !1 && /* @__PURE__ */ P("div", { className: "ps-msd-card", children: [
|
|
8305
8305
|
/* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: o(bA === $ ? "RECOMMENDED SIZE" : "TRYING SIZE") }),
|
|
8306
8306
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "10px", marginTop: "6px", marginBottom: "4px" }, children: [
|
|
8307
8307
|
V.length > 1 && /* @__PURE__ */ P(
|
|
@@ -8361,18 +8361,18 @@ function DP({
|
|
|
8361
8361
|
] }),
|
|
8362
8362
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", children: o("Based on your measurements and the garment's tailoring chart.") })
|
|
8363
8363
|
] }),
|
|
8364
|
-
|
|
8364
|
+
x !== !1 && iA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-blueprint", children: [
|
|
8365
8365
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: o("MEASUREMENT BLUEPRINT") }),
|
|
8366
8366
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
8367
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children:
|
|
8368
|
-
const zA = H.isLength && H.fit.includes("short") || H.fit.includes("tight"), YA = H.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose",
|
|
8367
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: iA.map((H, oA) => {
|
|
8368
|
+
const zA = H.isLength && H.fit.includes("short") || H.fit.includes("tight"), YA = H.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose", wf = X(H.area), J = String(oA + 1).padStart(2, "0");
|
|
8369
8369
|
return /* @__PURE__ */ P("div", { className: "ps-msd-row", children: [
|
|
8370
8370
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-num", children: [
|
|
8371
8371
|
J,
|
|
8372
8372
|
" ",
|
|
8373
8373
|
H.area.toUpperCase()
|
|
8374
8374
|
] }),
|
|
8375
|
-
|
|
8375
|
+
wf && /* @__PURE__ */ A("p", { className: "ps-msd-row-desc", children: wf }),
|
|
8376
8376
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cells", children: [
|
|
8377
8377
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell", children: [
|
|
8378
8378
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: o("USER") }),
|
|
@@ -8394,7 +8394,7 @@ function DP({
|
|
|
8394
8394
|
] }, oA);
|
|
8395
8395
|
}) })
|
|
8396
8396
|
] }),
|
|
8397
|
-
|
|
8397
|
+
x !== !1 && _.length > 1 && /* @__PURE__ */ P("div", { className: "ps-msd-sizes", children: [
|
|
8398
8398
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: o("TRY ANOTHER SIZE") }),
|
|
8399
8399
|
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: _.map((H) => /* @__PURE__ */ A(
|
|
8400
8400
|
"button",
|
|
@@ -8407,7 +8407,7 @@ function DP({
|
|
|
8407
8407
|
H
|
|
8408
8408
|
)) })
|
|
8409
8409
|
] }),
|
|
8410
|
-
|
|
8410
|
+
x !== !1 && WA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-sizes", children: [
|
|
8411
8411
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: o("LENGTH ADJUSTMENT") }),
|
|
8412
8412
|
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: WA.map((H) => {
|
|
8413
8413
|
const oA = String(qA ?? "").trim() === String(H ?? "").trim(), zA = Hf[String(H).trim()];
|
|
@@ -8416,7 +8416,7 @@ function DP({
|
|
|
8416
8416
|
{
|
|
8417
8417
|
type: "button",
|
|
8418
8418
|
className: `ps-msd-size-pill${oA ? " ps-active" : ""}`,
|
|
8419
|
-
onClick: () =>
|
|
8419
|
+
onClick: () => EA(H === cf ? null : H),
|
|
8420
8420
|
style: { display: "flex", flexDirection: "column", alignItems: "center", lineHeight: 1.15, gap: "0.15vw" },
|
|
8421
8421
|
children: [
|
|
8422
8422
|
/* @__PURE__ */ A("span", { children: H }),
|
|
@@ -8427,7 +8427,7 @@ function DP({
|
|
|
8427
8427
|
);
|
|
8428
8428
|
}) })
|
|
8429
8429
|
] }),
|
|
8430
|
-
|
|
8430
|
+
x !== !1 && /* @__PURE__ */ P("p", { className: "ps-msd-footer-note", children: [
|
|
8431
8431
|
o("*Our sizing engine recommends"),
|
|
8432
8432
|
" ",
|
|
8433
8433
|
$,
|
|
@@ -8441,7 +8441,7 @@ function DP({
|
|
|
8441
8441
|
{
|
|
8442
8442
|
type: "button",
|
|
8443
8443
|
className: "ps-bp-back-btn",
|
|
8444
|
-
onClick:
|
|
8444
|
+
onClick: t,
|
|
8445
8445
|
style: { fontSize: 13, padding: "10px 6px" },
|
|
8446
8446
|
children: [
|
|
8447
8447
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
@@ -8483,7 +8483,7 @@ function DP({
|
|
|
8483
8483
|
"button",
|
|
8484
8484
|
{
|
|
8485
8485
|
type: "button",
|
|
8486
|
-
onClick:
|
|
8486
|
+
onClick: t,
|
|
8487
8487
|
style: {
|
|
8488
8488
|
flex: 1,
|
|
8489
8489
|
padding: "12px 16px",
|
|
@@ -8501,7 +8501,7 @@ function DP({
|
|
|
8501
8501
|
gap: 6
|
|
8502
8502
|
},
|
|
8503
8503
|
children: [
|
|
8504
|
-
|
|
8504
|
+
K || o("Continue"),
|
|
8505
8505
|
" →"
|
|
8506
8506
|
]
|
|
8507
8507
|
}
|
|
@@ -8510,7 +8510,7 @@ function DP({
|
|
|
8510
8510
|
] }) });
|
|
8511
8511
|
}
|
|
8512
8512
|
return /* @__PURE__ */ P("div", { className: "ps-tryon-sec-detail", style: { padding: "1.5vw", display: "flex", flexDirection: "column", height: "100%", background: "#F8F9FA" }, children: [
|
|
8513
|
-
/* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", scrollbarWidth: "thin", scrollbarColor: "rgba(0,0,0,0.04) transparent", display:
|
|
8513
|
+
/* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 0, overflowY: "auto", scrollbarWidth: "thin", scrollbarColor: "rgba(0,0,0,0.04) transparent", display: x === !1 ? "flex" : "block", alignItems: x === !1 ? "center" : void 0, justifyContent: x === !1 ? "center" : void 0 }, children: x === !1 ? /* @__PURE__ */ P("div", { style: {
|
|
8514
8514
|
background: "white",
|
|
8515
8515
|
borderRadius: "0.7vw",
|
|
8516
8516
|
border: "1px solid rgba(0,0,0,0.06)",
|
|
@@ -8522,7 +8522,7 @@ function DP({
|
|
|
8522
8522
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: o("No matching size") }),
|
|
8523
8523
|
/* @__PURE__ */ A("p", { style: { fontSize: "1vw", fontWeight: 600, color: "var(--ps-text-primary)", margin: "0.8vw 0 0.5vw", lineHeight: 1.4 }, children: o("We couldn't find a size that fits for this product.") }),
|
|
8524
8524
|
/* @__PURE__ */ A("p", { style: { fontSize: "0.72vw", color: "var(--ps-text-secondary)", lineHeight: 1.55, margin: 0 }, children: o("Your measurements are outside this product's size range. You can still try it on visually below.") })
|
|
8525
|
-
] }) : /* @__PURE__ */ P(
|
|
8525
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
8526
8526
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.75vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: VA ? o("Recommended Size") : kA ?? o("Your Selection") }),
|
|
8527
8527
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.5vw", marginTop: "0.35vw", marginBottom: "0.4vw" }, children: [
|
|
8528
8528
|
V.length > 1 && /* @__PURE__ */ P(
|
|
@@ -8586,16 +8586,16 @@ function DP({
|
|
|
8586
8586
|
o("Match based on your silhouette profile")
|
|
8587
8587
|
] })
|
|
8588
8588
|
] }),
|
|
8589
|
-
|
|
8589
|
+
iA.length > 0 && /* @__PURE__ */ A("div", { style: { background: "white", borderRadius: "0.5vw", border: "1px solid rgba(0,0,0,0.06)", overflow: "hidden", marginBottom: "1.2vw" }, children: /* @__PURE__ */ P("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
|
|
8590
8590
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ P("tr", { children: [
|
|
8591
8591
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Measurement") }),
|
|
8592
8592
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Your Body") }),
|
|
8593
8593
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Garment Spec") }),
|
|
8594
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") })
|
|
8595
8595
|
] }) }),
|
|
8596
|
-
/* @__PURE__ */ A("tbody", { children:
|
|
8596
|
+
/* @__PURE__ */ A("tbody", { children: iA.map((a, X) => {
|
|
8597
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)";
|
|
8598
|
-
return /* @__PURE__ */ P("tr", { style: { borderBottom: X <
|
|
8598
|
+
return /* @__PURE__ */ P("tr", { style: { borderBottom: X < iA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
8599
8599
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: a.area }),
|
|
8600
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
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) }),
|
|
@@ -8644,7 +8644,7 @@ function DP({
|
|
|
8644
8644
|
return /* @__PURE__ */ P(
|
|
8645
8645
|
"button",
|
|
8646
8646
|
{
|
|
8647
|
-
onClick: () =>
|
|
8647
|
+
onClick: () => EA(a === cf ? null : a),
|
|
8648
8648
|
style: {
|
|
8649
8649
|
padding: "0.35vw 0.7vw",
|
|
8650
8650
|
borderRadius: "0.35vw",
|
|
@@ -8673,7 +8673,7 @@ function DP({
|
|
|
8673
8673
|
] })
|
|
8674
8674
|
] }) }),
|
|
8675
8675
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", paddingTop: "0.6vw", borderTop: "1px solid rgba(0,0,0,0.06)", flexShrink: 0 }, children: [
|
|
8676
|
-
/* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick:
|
|
8676
|
+
/* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: t, type: "button", style: { fontSize: "0.7vw" }, children: [
|
|
8677
8677
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
8678
8678
|
" ",
|
|
8679
8679
|
v || o("Back to sections")
|
|
@@ -8713,7 +8713,7 @@ function DP({
|
|
|
8713
8713
|
) : /* @__PURE__ */ P(
|
|
8714
8714
|
"button",
|
|
8715
8715
|
{
|
|
8716
|
-
onClick:
|
|
8716
|
+
onClick: t,
|
|
8717
8717
|
style: {
|
|
8718
8718
|
padding: "0.45vw 1.2vw",
|
|
8719
8719
|
borderRadius: "0.4vw",
|
|
@@ -8732,7 +8732,7 @@ function DP({
|
|
|
8732
8732
|
onMouseEnter: (a) => a.currentTarget.style.opacity = "0.9",
|
|
8733
8733
|
onMouseLeave: (a) => a.currentTarget.style.opacity = "1",
|
|
8734
8734
|
children: [
|
|
8735
|
-
|
|
8735
|
+
K || o("Continue"),
|
|
8736
8736
|
" →"
|
|
8737
8737
|
]
|
|
8738
8738
|
}
|
|
@@ -8748,7 +8748,7 @@ function EB({
|
|
|
8748
8748
|
productImage: B,
|
|
8749
8749
|
productTitle: C,
|
|
8750
8750
|
sizingUnit: D,
|
|
8751
|
-
setView:
|
|
8751
|
+
setView: t,
|
|
8752
8752
|
handleDownload: o,
|
|
8753
8753
|
onRetryWithFit: r,
|
|
8754
8754
|
retryLoading: z,
|
|
@@ -8757,19 +8757,19 @@ function EB({
|
|
|
8757
8757
|
handleFileSelect: F,
|
|
8758
8758
|
handleRemovePreview: h,
|
|
8759
8759
|
handleTryOnSubmit: W,
|
|
8760
|
-
tryOnProcessing:
|
|
8760
|
+
tryOnProcessing: i,
|
|
8761
8761
|
bodyLandmarks: k,
|
|
8762
8762
|
faceLandmarks: u = null,
|
|
8763
8763
|
measurementType: v = "body",
|
|
8764
8764
|
estimationDone: I = !1,
|
|
8765
|
-
activeSection:
|
|
8765
|
+
activeSection: K,
|
|
8766
8766
|
setActiveSection: N,
|
|
8767
|
-
onResetTryOn:
|
|
8767
|
+
onResetTryOn: x,
|
|
8768
8768
|
onClose: E,
|
|
8769
8769
|
userHeightCm: BA,
|
|
8770
8770
|
t: c
|
|
8771
8771
|
}) {
|
|
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 =
|
|
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 = vf(() => {
|
|
8773
8773
|
if (!g?.headers || !g?.rows) return -1;
|
|
8774
8774
|
const U = g.headers.findIndex((R) => /size|taglia|größe|taille/i.test(R.trim()));
|
|
8775
8775
|
if (U >= 0) return U;
|
|
@@ -8779,8 +8779,8 @@ function EB({
|
|
|
8779
8779
|
}
|
|
8780
8780
|
return 0;
|
|
8781
8781
|
}, [g, s]), RA = g?.headers?.[PA] || c("Size");
|
|
8782
|
-
|
|
8783
|
-
const mA =
|
|
8782
|
+
vf(() => PA < 0 || !g?.rows ? [] : g.rows.map((U) => s(U, PA, RA)).filter(Boolean), [g, PA, RA, s]);
|
|
8783
|
+
const mA = vf(() => {
|
|
8784
8784
|
if (!g?.headers || !g?.rows) return [];
|
|
8785
8785
|
const U = [];
|
|
8786
8786
|
for (let R = 0; R < g.headers.length; R++) {
|
|
@@ -8794,8 +8794,8 @@ function EB({
|
|
|
8794
8794
|
continue;
|
|
8795
8795
|
}
|
|
8796
8796
|
let S = null;
|
|
8797
|
-
for (const
|
|
8798
|
-
const fA = String(s(
|
|
8797
|
+
for (const dA of g.rows) {
|
|
8798
|
+
const fA = String(s(dA, R, g.headers[R]) || "").trim();
|
|
8799
8799
|
if (fA) {
|
|
8800
8800
|
if (/cm\b|centimeter/i.test(fA)) {
|
|
8801
8801
|
S = "cm";
|
|
@@ -8810,9 +8810,9 @@ function EB({
|
|
|
8810
8810
|
U.push(S);
|
|
8811
8811
|
}
|
|
8812
8812
|
return U;
|
|
8813
|
-
}, [g, s]),
|
|
8813
|
+
}, [g, s]), EA = UA((U, R) => {
|
|
8814
8814
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8815
|
-
const G = U.toLowerCase().trim(), S = y === "cm" || y === "",
|
|
8815
|
+
const G = U.toLowerCase().trim(), S = y === "cm" || y === "", dA = S ? "cm" : "in", fA = [];
|
|
8816
8816
|
for (let M = 0; M < g.headers.length; M++) {
|
|
8817
8817
|
const cA = (g.headers[M] || "").toLowerCase().trim();
|
|
8818
8818
|
if (cA === G) {
|
|
@@ -8823,30 +8823,30 @@ function EB({
|
|
|
8823
8823
|
(pA === G || cA.includes(G) || G.includes(pA)) && fA.push(M);
|
|
8824
8824
|
}
|
|
8825
8825
|
if (fA.length === 0) return null;
|
|
8826
|
-
let NA = fA.find((M) => mA[M] ===
|
|
8826
|
+
let NA = fA.find((M) => mA[M] === dA);
|
|
8827
8827
|
NA == null && (NA = fA[0]);
|
|
8828
8828
|
const $A = g.headers[NA], ef = g.rows.find((M) => s(M, PA, RA) === R);
|
|
8829
8829
|
if (!ef) return null;
|
|
8830
8830
|
const yA = s(ef, NA, $A);
|
|
8831
8831
|
if (!yA) return null;
|
|
8832
|
-
const KA = V(yA),
|
|
8833
|
-
if (
|
|
8832
|
+
const KA = V(yA), Df = mA[NA];
|
|
8833
|
+
if (Df === "in" && S) {
|
|
8834
8834
|
const M = (cA) => +(cA * 2.54).toFixed(1);
|
|
8835
8835
|
return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
|
|
8836
8836
|
}
|
|
8837
|
-
if (
|
|
8837
|
+
if (Df === "cm" && !S) {
|
|
8838
8838
|
const M = (cA) => +(cA / 2.54).toFixed(1);
|
|
8839
8839
|
return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
|
|
8840
8840
|
}
|
|
8841
8841
|
return { range: yA, ...KA };
|
|
8842
8842
|
}, [g, PA, RA, y, s, V, mA]), ZA = n?.recommendedSize || "";
|
|
8843
|
-
|
|
8844
|
-
const [Hf, m] = j("fit"), [
|
|
8843
|
+
vf(() => n?.internationalSizes || {}, [n]);
|
|
8844
|
+
const [Hf, m] = j("fit"), [aA, TA] = j(null), [bA, VA] = j(!1), [kA, vA] = j(!1), [SA, ff] = j(!1), [iA, nf] = j(null), [xA, Ef] = j(!1), [eA, $] = j({ w: 800, h: 1200 }), _A = UA((U) => {
|
|
8845
8845
|
const R = U.currentTarget;
|
|
8846
8846
|
R.naturalWidth && R.naturalHeight && $({ w: R.naturalWidth, h: R.naturalHeight });
|
|
8847
8847
|
}, []);
|
|
8848
8848
|
JA(() => {
|
|
8849
|
-
if (!e ||
|
|
8849
|
+
if (!e || i) {
|
|
8850
8850
|
nf(null), Ef(!1);
|
|
8851
8851
|
return;
|
|
8852
8852
|
}
|
|
@@ -8855,10 +8855,10 @@ function EB({
|
|
|
8855
8855
|
}).catch(() => {
|
|
8856
8856
|
Ef(!0);
|
|
8857
8857
|
});
|
|
8858
|
-
}, [e,
|
|
8858
|
+
}, [e, i]);
|
|
8859
8859
|
const [Of, cf] = j(!1), [Mf, gf] = j(!1);
|
|
8860
|
-
|
|
8861
|
-
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X =
|
|
8860
|
+
tA(null);
|
|
8861
|
+
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = tA(null), [nA, H] = j(null), [oA, zA] = j(!1);
|
|
8862
8862
|
JA(() => {
|
|
8863
8863
|
if (_) {
|
|
8864
8864
|
const U = URL.createObjectURL(_);
|
|
@@ -8866,8 +8866,8 @@ function EB({
|
|
|
8866
8866
|
}
|
|
8867
8867
|
H(null);
|
|
8868
8868
|
}, [_]);
|
|
8869
|
-
const YA =
|
|
8870
|
-
|
|
8869
|
+
const YA = aA || ZA;
|
|
8870
|
+
vf(() => {
|
|
8871
8871
|
if (!n?.matchDetails?.length) return [];
|
|
8872
8872
|
const U = /* @__PURE__ */ new Set();
|
|
8873
8873
|
return n.matchDetails.filter((G) => {
|
|
@@ -8875,13 +8875,13 @@ function EB({
|
|
|
8875
8875
|
return U.has(S) ? !1 : (U.add(S), !0);
|
|
8876
8876
|
}).map((G) => {
|
|
8877
8877
|
const S = kf(G.userValue);
|
|
8878
|
-
let
|
|
8878
|
+
let dA = G.chartRange, fA = G.fit;
|
|
8879
8879
|
if (YA !== ZA) {
|
|
8880
|
-
const NA =
|
|
8880
|
+
const NA = EA(G.measurement, YA);
|
|
8881
8881
|
if (NA && NA.min > 0) {
|
|
8882
|
-
|
|
8883
|
-
const $A = NA.min, ef = NA.max, yA = ef - $A, KA = yA > 0 ? yA * 0.5 : $A * 0.05 || 3,
|
|
8884
|
-
if (S >= $A -
|
|
8882
|
+
dA = kP(NA.range);
|
|
8883
|
+
const $A = NA.min, ef = NA.max, yA = ef - $A, KA = yA > 0 ? yA * 0.5 : $A * 0.05 || 3, Df = Math.max((ef || $A) * 5e-3, 0.25);
|
|
8884
|
+
if (S >= $A - Df && S <= ef + Df) fA = "good";
|
|
8885
8885
|
else if (S < $A) {
|
|
8886
8886
|
const M = $A - S;
|
|
8887
8887
|
fA = M > KA * 2 ? "too-loose" : M > KA ? "loose" : "a-bit-loose";
|
|
@@ -8891,9 +8891,9 @@ function EB({
|
|
|
8891
8891
|
}
|
|
8892
8892
|
}
|
|
8893
8893
|
}
|
|
8894
|
-
return { area: G.measurement, userNum: kf(G.userValue), chartLabel:
|
|
8894
|
+
return { area: G.measurement, userNum: kf(G.userValue), chartLabel: dA, fit: fA };
|
|
8895
8895
|
});
|
|
8896
|
-
}, [n, YA, ZA,
|
|
8896
|
+
}, [n, YA, ZA, EA]), vf(() => {
|
|
8897
8897
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8898
8898
|
const U = g.rows.find((G) => s(G, PA, RA) === YA);
|
|
8899
8899
|
if (!U) return null;
|
|
@@ -8901,24 +8901,24 @@ function EB({
|
|
|
8901
8901
|
for (let G = 0; G < g.headers.length; G++) {
|
|
8902
8902
|
const S = g.headers[G] || "";
|
|
8903
8903
|
if (G === PA) continue;
|
|
8904
|
-
const
|
|
8905
|
-
|
|
8904
|
+
const dA = s(U, G, S);
|
|
8905
|
+
dA && R.push({ header: S, value: dA });
|
|
8906
8906
|
}
|
|
8907
8907
|
return R;
|
|
8908
8908
|
}, [g, PA, RA, YA, s]);
|
|
8909
|
-
const
|
|
8909
|
+
const wf = !!(g?.sections && Object.keys(g.sections).length > 1), J = vf(() => n?.sections && Object.keys(n.sections).length > 0 ? Object.entries(n.sections).map(([U, R]) => {
|
|
8910
8910
|
const G = g?.sections?.[U] || Object.values(g?.sections || {}).find(
|
|
8911
|
-
(
|
|
8911
|
+
(dA) => U.toLowerCase().includes(dA.name?.toLowerCase()?.replace(/\s*(size|sizing)\s*/gi, "").trim() || "---")
|
|
8912
8912
|
) || { headers: [], rows: [], requiredFields: [] }, S = {};
|
|
8913
8913
|
if (R.matchDetails)
|
|
8914
|
-
for (const
|
|
8914
|
+
for (const dA of R.matchDetails) S[dA.measurement.toLowerCase()] = kf(dA.userValue);
|
|
8915
8915
|
return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: G, secResult: R, userMeasurements: S };
|
|
8916
|
-
}) : !
|
|
8916
|
+
}) : !wf || !g?.sections ? [] : Object.entries(g.sections).map(([U, R]) => {
|
|
8917
8917
|
const G = n?.sections?.[U] || { recommendedSize: n?.recommendedSize || "", matchDetails: [] }, S = {};
|
|
8918
8918
|
if (G.matchDetails)
|
|
8919
|
-
for (const
|
|
8919
|
+
for (const dA of G.matchDetails) S[dA.measurement.toLowerCase()] = kf(dA.userValue);
|
|
8920
8920
|
return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: R, secResult: G, userMeasurements: S };
|
|
8921
|
-
}), [
|
|
8921
|
+
}), [wf, g, n, BA]), gA = vf(() => J.filter((U) => !zn(U.name)), [J]), Bf = vf(() => J.filter((U) => zn(U.name)), [J]), FA = !!T, OA = FA && (i || f && !n), AA = !FA && f && !n, LA = !!n, Pf = !!e && !i, lA = FA ? LA && Pf : LA, O = NP(), q = v === "face" || v === "head";
|
|
8922
8922
|
n?.found;
|
|
8923
8923
|
const QA = v === "foot";
|
|
8924
8924
|
return console.log("[PS-SDK] SizeResultView render:", {
|
|
@@ -8931,38 +8931,38 @@ function EB({
|
|
|
8931
8931
|
sizingLoading: f,
|
|
8932
8932
|
sizingResult: !!n,
|
|
8933
8933
|
resultImageUrl: !!e,
|
|
8934
|
-
tryOnProcessing:
|
|
8934
|
+
tryOnProcessing: i,
|
|
8935
8935
|
previewUrl: !!T
|
|
8936
8936
|
}), /* @__PURE__ */ P("div", { className: "ps-tryon-sr", children: [
|
|
8937
|
-
|
|
8937
|
+
O && AA && /* @__PURE__ */ A(
|
|
8938
8938
|
rn,
|
|
8939
8939
|
{
|
|
8940
8940
|
productImage: B,
|
|
8941
8941
|
bodyLandmarks: null,
|
|
8942
8942
|
sizingDone: LA,
|
|
8943
|
-
onSwitchToManual: () =>
|
|
8943
|
+
onSwitchToManual: () => t("body-profile"),
|
|
8944
8944
|
t: c
|
|
8945
8945
|
}
|
|
8946
8946
|
),
|
|
8947
|
-
!
|
|
8947
|
+
!O && AA && /* @__PURE__ */ P("div", { className: "ps-tryon-sr-split", children: [
|
|
8948
8948
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-img-col", children: /* @__PURE__ */ A("img", { src: B, alt: C, className: "ps-tryon-sr-product-img" }) }),
|
|
8949
8949
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-right-col", style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: "0.8vw" }, children: [
|
|
8950
8950
|
/* @__PURE__ */ A("div", { className: "ps-tryon-size-loading-spinner" }),
|
|
8951
8951
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.8vw" }, children: c("Generating your size recommendation...") })
|
|
8952
8952
|
] })
|
|
8953
8953
|
] }),
|
|
8954
|
-
|
|
8954
|
+
O && OA && !lA && T && /* @__PURE__ */ A(
|
|
8955
8955
|
rn,
|
|
8956
8956
|
{
|
|
8957
8957
|
previewUrl: T,
|
|
8958
8958
|
bodyLandmarks: k ?? null,
|
|
8959
8959
|
sizingDone: LA,
|
|
8960
|
-
tryOnProcessing:
|
|
8961
|
-
onSwitchToManual: () =>
|
|
8960
|
+
tryOnProcessing: i,
|
|
8961
|
+
onSwitchToManual: () => t("body-profile"),
|
|
8962
8962
|
t: c
|
|
8963
8963
|
}
|
|
8964
8964
|
),
|
|
8965
|
-
!
|
|
8965
|
+
!O && OA && !lA && /* @__PURE__ */ P("div", { className: "ps-tryon-sr-split", children: [
|
|
8966
8966
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-img-col", style: { position: "relative" }, children: [
|
|
8967
8967
|
/* @__PURE__ */ A(
|
|
8968
8968
|
"img",
|
|
@@ -8982,19 +8982,19 @@ function EB({
|
|
|
8982
8982
|
{
|
|
8983
8983
|
category: U ? v : "body",
|
|
8984
8984
|
sizingDone: LA,
|
|
8985
|
-
tryOnProcessing:
|
|
8985
|
+
tryOnProcessing: i,
|
|
8986
8986
|
tryOnDone: Pf,
|
|
8987
8987
|
t: c
|
|
8988
8988
|
}
|
|
8989
8989
|
) });
|
|
8990
8990
|
})()
|
|
8991
8991
|
] }),
|
|
8992
|
-
(lA || n && !OA) && /* @__PURE__ */ P(
|
|
8993
|
-
|
|
8992
|
+
(lA || n && !OA) && /* @__PURE__ */ P(rA, { children: [
|
|
8993
|
+
wf ? K ? (
|
|
8994
8994
|
/* ── Detail view for a single section ── */
|
|
8995
8995
|
(() => {
|
|
8996
|
-
const U = gA.find((R) => R.name ===
|
|
8997
|
-
return U ?
|
|
8996
|
+
const U = gA.find((R) => R.name === K);
|
|
8997
|
+
return U ? O ? /* @__PURE__ */ A(
|
|
8998
8998
|
DP,
|
|
8999
8999
|
{
|
|
9000
9000
|
sectionName: U.name,
|
|
@@ -9014,10 +9014,10 @@ function EB({
|
|
|
9014
9014
|
showLines: kA,
|
|
9015
9015
|
onToggleLines: q ? void 0 : () => vA(!kA),
|
|
9016
9016
|
onImageLoad: _A,
|
|
9017
|
-
overlayNode: e && xA &&
|
|
9017
|
+
overlayNode: e && xA && iA ? /* @__PURE__ */ A(
|
|
9018
9018
|
$f,
|
|
9019
9019
|
{
|
|
9020
|
-
lines:
|
|
9020
|
+
lines: iA,
|
|
9021
9021
|
fitRows: (() => {
|
|
9022
9022
|
const R = [...n?.matchDetails || []];
|
|
9023
9023
|
if (n?.sections)
|
|
@@ -9025,8 +9025,8 @@ function EB({
|
|
|
9025
9025
|
S.matchDetails && R.push(...S.matchDetails);
|
|
9026
9026
|
const G = /* @__PURE__ */ new Set();
|
|
9027
9027
|
return R.filter((S) => {
|
|
9028
|
-
const
|
|
9029
|
-
return G.has(
|
|
9028
|
+
const dA = S.measurement.toLowerCase();
|
|
9029
|
+
return G.has(dA) ? !1 : (G.add(dA), !0);
|
|
9030
9030
|
}).map((S) => ({ area: S.measurement, userNum: parseFloat(S.userValue) || 0, chartLabel: S.chartRange || "", fit: S.fit }));
|
|
9031
9031
|
})(),
|
|
9032
9032
|
show: kA,
|
|
@@ -9053,10 +9053,10 @@ function EB({
|
|
|
9053
9053
|
internationalSizes: U.secResult?.internationalSizes,
|
|
9054
9054
|
t: c
|
|
9055
9055
|
}
|
|
9056
|
-
) }, `detail-${
|
|
9056
|
+
) }, `detail-${K}`)
|
|
9057
9057
|
] }) : null;
|
|
9058
9058
|
})()
|
|
9059
|
-
) :
|
|
9059
|
+
) : O ? (
|
|
9060
9060
|
/* ── Mobile section picker: vertical list, fit% badge, try-on CTA ── */
|
|
9061
9061
|
/* @__PURE__ */ A(
|
|
9062
9062
|
HB,
|
|
@@ -9070,20 +9070,20 @@ function EB({
|
|
|
9070
9070
|
onTryOn: () => {
|
|
9071
9071
|
uA(p || null), GA(!0);
|
|
9072
9072
|
},
|
|
9073
|
-
tryOnProcessing:
|
|
9073
|
+
tryOnProcessing: i,
|
|
9074
9074
|
resultImageUrl: e,
|
|
9075
|
-
tryOnDone: !!e && !
|
|
9075
|
+
tryOnDone: !!e && !i,
|
|
9076
9076
|
onTryAgain: () => {
|
|
9077
|
-
|
|
9077
|
+
x?.(), uA(p || null), GA(!0);
|
|
9078
9078
|
},
|
|
9079
9079
|
onClose: E,
|
|
9080
9080
|
showLines: kA,
|
|
9081
9081
|
onToggleLines: q ? void 0 : () => vA(!kA),
|
|
9082
9082
|
onImageLoad: _A,
|
|
9083
|
-
overlayNode: e && xA &&
|
|
9083
|
+
overlayNode: e && xA && iA ? /* @__PURE__ */ A(
|
|
9084
9084
|
$f,
|
|
9085
9085
|
{
|
|
9086
|
-
lines:
|
|
9086
|
+
lines: iA,
|
|
9087
9087
|
fitRows: (() => {
|
|
9088
9088
|
const U = [...n?.matchDetails || []];
|
|
9089
9089
|
if (n?.sections)
|
|
@@ -9107,13 +9107,13 @@ function EB({
|
|
|
9107
9107
|
/* ── Desktop section picker: split layout — image left, image cards right ── */
|
|
9108
9108
|
/* @__PURE__ */ P("div", { className: "ps-tryon-v2", children: [
|
|
9109
9109
|
/* @__PURE__ */ P("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
|
|
9110
|
-
/* @__PURE__ */ A("img", { src:
|
|
9111
|
-
|
|
9112
|
-
|
|
9110
|
+
/* @__PURE__ */ A("img", { src: i && T ? T : e || B, alt: C, className: "ps-tryon-v2-bg-img", onLoad: _A }),
|
|
9111
|
+
i && k && /* @__PURE__ */ A(Qn, { landmarks: k, imgWidth: eA.w, imgHeight: eA.h }),
|
|
9112
|
+
i && /* @__PURE__ */ P("div", { className: "ps-tryon-v2-processing-label", children: [
|
|
9113
9113
|
/* @__PURE__ */ A("span", { children: c("Generating try-on...") }),
|
|
9114
9114
|
/* @__PURE__ */ A(kn, { t: c, isActive: !0 })
|
|
9115
9115
|
] }),
|
|
9116
|
-
e && !
|
|
9116
|
+
e && !i && xA && iA && /* @__PURE__ */ A($f, { lines: iA, fitRows: (() => {
|
|
9117
9117
|
const U = [...n?.matchDetails || []];
|
|
9118
9118
|
if (n?.sections)
|
|
9119
9119
|
for (const G of Object.values(n.sections))
|
|
@@ -9124,7 +9124,7 @@ function EB({
|
|
|
9124
9124
|
return R.has(S) ? !1 : (R.add(S), !0);
|
|
9125
9125
|
}).map((G) => ({ area: G.measurement, userNum: parseFloat(G.userValue) || 0, chartLabel: G.chartRange || "", fit: G.fit }));
|
|
9126
9126
|
})(), show: kA, imgWidth: eA.w, imgHeight: eA.h }),
|
|
9127
|
-
e && !
|
|
9127
|
+
e && !i && /* @__PURE__ */ P("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
9128
9128
|
!q && /* @__PURE__ */ P("button", { className: "ps-tryon-sr-glass-btn", onClick: () => vA(!kA), children: [
|
|
9129
9129
|
/* @__PURE__ */ P("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", style: { marginRight: "0.3vw" }, children: [
|
|
9130
9130
|
/* @__PURE__ */ A("line", { x1: "4", y1: "9", x2: "20", y2: "9" }),
|
|
@@ -9149,8 +9149,8 @@ function EB({
|
|
|
9149
9149
|
/* @__PURE__ */ A("p", { className: "ps-tryon-v2-subtitle", children: c("Tap any section for detailed breakdown") }),
|
|
9150
9150
|
/* @__PURE__ */ A("div", { className: "ps-tryon-v2-sep" }),
|
|
9151
9151
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: gA.map(({ name: U, secResult: R }, G) => {
|
|
9152
|
-
const S = g?.sectionImages?.[U],
|
|
9153
|
-
return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${
|
|
9152
|
+
const S = g?.sectionImages?.[U], dA = G === gA.length - 1 && gA.length % 2 !== 0, fA = R;
|
|
9153
|
+
return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${dA ? " ps-full" : ""}`, onClick: () => N(U), style: { animationDelay: `${G * 0.07}s` }, children: [
|
|
9154
9154
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-card-v2-text", children: [
|
|
9155
9155
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-label", children: U.replace(/\s*[—–-]\s*.*/g, "") }),
|
|
9156
9156
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: fA.found === !1 ? c("No fit") : fA.size || R.recommendedSize }),
|
|
@@ -9161,12 +9161,12 @@ function EB({
|
|
|
9161
9161
|
] }, U);
|
|
9162
9162
|
}) }),
|
|
9163
9163
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", justifyContent: "space-between", marginTop: "0.5vw", gap: "0.5vw" }, children: [
|
|
9164
|
-
/* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: () =>
|
|
9164
|
+
/* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: () => t("body-profile"), type: "button", children: [
|
|
9165
9165
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
9166
9166
|
" ",
|
|
9167
9167
|
c("Back")
|
|
9168
9168
|
] }),
|
|
9169
|
-
e && !
|
|
9169
|
+
e && !i ? /* @__PURE__ */ P(
|
|
9170
9170
|
"button",
|
|
9171
9171
|
{
|
|
9172
9172
|
className: "ps-tryon-v2-cta",
|
|
@@ -9193,14 +9193,14 @@ function EB({
|
|
|
9193
9193
|
{
|
|
9194
9194
|
className: "ps-tryon-v2-cta",
|
|
9195
9195
|
style: { marginTop: 0 },
|
|
9196
|
-
disabled:
|
|
9196
|
+
disabled: i,
|
|
9197
9197
|
onClick: () => {
|
|
9198
9198
|
uA(p || null), GA(!0);
|
|
9199
9199
|
},
|
|
9200
9200
|
children: [
|
|
9201
9201
|
/* @__PURE__ */ A(hf, { size: 14 }),
|
|
9202
9202
|
" ",
|
|
9203
|
-
c(
|
|
9203
|
+
c(i ? "Processing..." : "Try It On")
|
|
9204
9204
|
]
|
|
9205
9205
|
}
|
|
9206
9206
|
)
|
|
@@ -9213,10 +9213,10 @@ function EB({
|
|
|
9213
9213
|
const U = g?.found ? { headers: g.headers || [], rows: g.rows || [], requiredFields: g.requiredFields || [] } : { headers: [], rows: [], requiredFields: [] }, R = { recommendedSize: n?.recommendedSize || "", matchDetails: n?.matchDetails || [] }, G = {};
|
|
9214
9214
|
if (n?.matchDetails)
|
|
9215
9215
|
for (const fA of n.matchDetails) G[fA.measurement.toLowerCase()] = kf(fA.userValue);
|
|
9216
|
-
const S = c("Your Fit"),
|
|
9216
|
+
const S = c("Your Fit"), dA = () => {
|
|
9217
9217
|
e || (uA(p || null), GA(!0));
|
|
9218
9218
|
};
|
|
9219
|
-
return
|
|
9219
|
+
return O ? /* @__PURE__ */ A(
|
|
9220
9220
|
DP,
|
|
9221
9221
|
{
|
|
9222
9222
|
sectionName: S,
|
|
@@ -9227,12 +9227,14 @@ function EB({
|
|
|
9227
9227
|
unitLbl: y,
|
|
9228
9228
|
chartUnit: l,
|
|
9229
9229
|
lengthEntry: null,
|
|
9230
|
-
onBack:
|
|
9230
|
+
onBack: () => {
|
|
9231
|
+
e ? x?.() : t("body-profile");
|
|
9232
|
+
},
|
|
9231
9233
|
backLabel: c("Back"),
|
|
9232
9234
|
internationalSizes: n?.internationalSizes,
|
|
9233
|
-
onTryOn: e || QA ? void 0 :
|
|
9235
|
+
onTryOn: e || QA ? void 0 : dA,
|
|
9234
9236
|
continueLabel: e ? c("Continue Shopping") : void 0,
|
|
9235
|
-
tryOnProcessing:
|
|
9237
|
+
tryOnProcessing: i,
|
|
9236
9238
|
productImage: e || B,
|
|
9237
9239
|
productTitle: C,
|
|
9238
9240
|
isMobile: !0,
|
|
@@ -9241,10 +9243,10 @@ function EB({
|
|
|
9241
9243
|
showLines: kA,
|
|
9242
9244
|
onToggleLines: q ? void 0 : () => vA(!kA),
|
|
9243
9245
|
onImageLoad: _A,
|
|
9244
|
-
overlayNode: e && xA &&
|
|
9246
|
+
overlayNode: e && xA && iA ? /* @__PURE__ */ A(
|
|
9245
9247
|
$f,
|
|
9246
9248
|
{
|
|
9247
|
-
lines:
|
|
9249
|
+
lines: iA,
|
|
9248
9250
|
fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })),
|
|
9249
9251
|
show: kA,
|
|
9250
9252
|
imgWidth: eA.w,
|
|
@@ -9256,8 +9258,8 @@ function EB({
|
|
|
9256
9258
|
) : /* @__PURE__ */ P("div", { className: "ps-tryon-v2", children: [
|
|
9257
9259
|
/* @__PURE__ */ P("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
|
|
9258
9260
|
/* @__PURE__ */ A("img", { src: e || B, alt: C, className: "ps-tryon-v2-bg-img", onLoad: _A }),
|
|
9259
|
-
e && xA &&
|
|
9260
|
-
e && !
|
|
9261
|
+
e && xA && iA && /* @__PURE__ */ A($f, { lines: iA, fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })), show: kA, imgWidth: eA.w, imgHeight: eA.h }),
|
|
9262
|
+
e && !i && /* @__PURE__ */ P("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
9261
9263
|
!q && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => vA(!kA), children: c(kA ? "Hide Fit" : "Show Fit") }),
|
|
9262
9264
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: o, children: c("Download") })
|
|
9263
9265
|
] })
|
|
@@ -9273,12 +9275,14 @@ function EB({
|
|
|
9273
9275
|
unitLbl: y,
|
|
9274
9276
|
chartUnit: l,
|
|
9275
9277
|
lengthEntry: null,
|
|
9276
|
-
onBack:
|
|
9278
|
+
onBack: () => {
|
|
9279
|
+
e ? x?.() : t("body-profile");
|
|
9280
|
+
},
|
|
9277
9281
|
backLabel: c("Back"),
|
|
9278
9282
|
internationalSizes: n?.internationalSizes,
|
|
9279
|
-
onTryOn: e || QA ? void 0 :
|
|
9283
|
+
onTryOn: e || QA ? void 0 : dA,
|
|
9280
9284
|
continueLabel: e ? c("Continue Shopping") : void 0,
|
|
9281
|
-
tryOnProcessing:
|
|
9285
|
+
tryOnProcessing: i,
|
|
9282
9286
|
t: c,
|
|
9283
9287
|
renderRaw: q
|
|
9284
9288
|
}
|
|
@@ -9286,7 +9290,7 @@ function EB({
|
|
|
9286
9290
|
] });
|
|
9287
9291
|
})()
|
|
9288
9292
|
),
|
|
9289
|
-
qA && !QA && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children:
|
|
9293
|
+
qA && !QA && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children: O ? (
|
|
9290
9294
|
/* ── Mobile: same layout as the AI-sizing photo step
|
|
9291
9295
|
(PhotoStepMobile) — title + subtitle, large preview,
|
|
9292
9296
|
checklist card, primary CTA + RETAKE secondary. ── */
|
|
@@ -9308,7 +9312,7 @@ function EB({
|
|
|
9308
9312
|
}
|
|
9309
9313
|
}
|
|
9310
9314
|
),
|
|
9311
|
-
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ && nA ? /* @__PURE__ */ P(
|
|
9315
|
+
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ && nA ? /* @__PURE__ */ P(rA, { children: [
|
|
9312
9316
|
/* @__PURE__ */ A("img", { src: nA, alt: c("Your photo"), className: "ps-pm-preview-img" }),
|
|
9313
9317
|
/* @__PURE__ */ A(
|
|
9314
9318
|
"button",
|
|
@@ -9344,15 +9348,15 @@ function EB({
|
|
|
9344
9348
|
/* @__PURE__ */ A("div", { className: "ps-pm-checklist-icon", children: /* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "14", height: "14", children: /* @__PURE__ */ A("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }) }),
|
|
9345
9349
|
/* @__PURE__ */ P("div", { className: "ps-pm-checklist-body", children: [
|
|
9346
9350
|
/* @__PURE__ */ A("div", { className: "ps-pm-checklist-title", children: c("Checklist for accuracy") }),
|
|
9347
|
-
/* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: v === "face" ? /* @__PURE__ */ P(
|
|
9351
|
+
/* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: v === "face" ? /* @__PURE__ */ P(rA, { children: [
|
|
9348
9352
|
/* @__PURE__ */ A("li", { children: c("Face the camera directly at eye level") }),
|
|
9349
9353
|
/* @__PURE__ */ A("li", { children: c("Remove any glasses you're wearing") }),
|
|
9350
9354
|
/* @__PURE__ */ A("li", { children: c("Good lighting, plain background") })
|
|
9351
|
-
] }) : v === "head" ? /* @__PURE__ */ P(
|
|
9355
|
+
] }) : v === "head" ? /* @__PURE__ */ P(rA, { children: [
|
|
9352
9356
|
/* @__PURE__ */ A("li", { children: c("Head and shoulders in frame") }),
|
|
9353
9357
|
/* @__PURE__ */ A("li", { children: c("Leave space above your head") }),
|
|
9354
9358
|
/* @__PURE__ */ A("li", { children: c("Good lighting, plain background") })
|
|
9355
|
-
] }) : /* @__PURE__ */ P(
|
|
9359
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
9356
9360
|
/* @__PURE__ */ A("li", { children: c("Form-fitting clothing is recommended") }),
|
|
9357
9361
|
/* @__PURE__ */ A("li", { children: c("Standing 2-3 meters from camera") }),
|
|
9358
9362
|
/* @__PURE__ */ A("li", { children: c("Neutral background with good lighting") })
|
|
@@ -9424,10 +9428,10 @@ function EB({
|
|
|
9424
9428
|
},
|
|
9425
9429
|
className: "ps-tryon-upload-hover",
|
|
9426
9430
|
children: [
|
|
9427
|
-
_ && nA ? /* @__PURE__ */ P(
|
|
9431
|
+
_ && nA ? /* @__PURE__ */ P(rA, { children: [
|
|
9428
9432
|
/* @__PURE__ */ A("img", { src: nA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
9429
9433
|
/* @__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") }) })
|
|
9430
|
-
] }) : /* @__PURE__ */ P(
|
|
9434
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
9431
9435
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
9432
9436
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: c("Upload your photo") }),
|
|
9433
9437
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: c(v === "face" ? "Click or drag a close-up face photo" : v === "head" ? "Click or drag a head-and-shoulders photo" : "Click or drag a full-body photo") })
|
|
@@ -9455,7 +9459,7 @@ function EB({
|
|
|
9455
9459
|
/* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.75vw", fontWeight: 700 }, children: "✓" }),
|
|
9456
9460
|
/* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.65vw", fontWeight: 600 }, children: c("Do") })
|
|
9457
9461
|
] }),
|
|
9458
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(
|
|
9462
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(rA, { children: [
|
|
9459
9463
|
c("Face the camera directly, centered in frame"),
|
|
9460
9464
|
/* @__PURE__ */ A("br", {}),
|
|
9461
9465
|
c("Use natural, even lighting (e.g. near a window)"),
|
|
@@ -9463,7 +9467,7 @@ function EB({
|
|
|
9463
9467
|
c("Keep hair away from your face and ears"),
|
|
9464
9468
|
/* @__PURE__ */ A("br", {}),
|
|
9465
9469
|
c("Choose a plain, light background")
|
|
9466
|
-
] }) : v === "head" ? /* @__PURE__ */ P(
|
|
9470
|
+
] }) : v === "head" ? /* @__PURE__ */ P(rA, { children: [
|
|
9467
9471
|
c("Face the camera with head and shoulders in frame"),
|
|
9468
9472
|
/* @__PURE__ */ A("br", {}),
|
|
9469
9473
|
c("Leave some space above your head"),
|
|
@@ -9471,7 +9475,7 @@ function EB({
|
|
|
9471
9475
|
c("Use natural, even lighting"),
|
|
9472
9476
|
/* @__PURE__ */ A("br", {}),
|
|
9473
9477
|
c("Choose a plain, light background")
|
|
9474
|
-
] }) : /* @__PURE__ */ P(
|
|
9478
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
9475
9479
|
c("Stand facing the camera with your full body in frame"),
|
|
9476
9480
|
/* @__PURE__ */ A("br", {}),
|
|
9477
9481
|
c("Use natural or even lighting"),
|
|
@@ -9486,7 +9490,7 @@ function EB({
|
|
|
9486
9490
|
/* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.75vw", fontWeight: 700 }, children: "✗" }),
|
|
9487
9491
|
/* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.65vw", fontWeight: 600 }, children: c("Don't") })
|
|
9488
9492
|
] }),
|
|
9489
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(
|
|
9493
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(rA, { children: [
|
|
9490
9494
|
c("Don't wear sunglasses or a hat in the photo"),
|
|
9491
9495
|
/* @__PURE__ */ A("br", {}),
|
|
9492
9496
|
c("Don't tilt or turn your head"),
|
|
@@ -9494,7 +9498,7 @@ function EB({
|
|
|
9494
9498
|
c("Don't use strong backlighting or flash"),
|
|
9495
9499
|
/* @__PURE__ */ A("br", {}),
|
|
9496
9500
|
c("Don't apply filters or edits")
|
|
9497
|
-
] }) : v === "head" ? /* @__PURE__ */ P(
|
|
9501
|
+
] }) : v === "head" ? /* @__PURE__ */ P(rA, { children: [
|
|
9498
9502
|
c("Don't wear a hat in the photo"),
|
|
9499
9503
|
/* @__PURE__ */ A("br", {}),
|
|
9500
9504
|
c("Don't crop out the top of your head"),
|
|
@@ -9502,7 +9506,7 @@ function EB({
|
|
|
9502
9506
|
c("Don't use strong backlighting or flash"),
|
|
9503
9507
|
/* @__PURE__ */ A("br", {}),
|
|
9504
9508
|
c("Don't apply filters or edits")
|
|
9505
|
-
] }) : /* @__PURE__ */ P(
|
|
9509
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
9506
9510
|
c("Don't wear loose or baggy clothing"),
|
|
9507
9511
|
/* @__PURE__ */ A("br", {}),
|
|
9508
9512
|
c("Don't sit, pose, or bend"),
|
|
@@ -9542,7 +9546,7 @@ function EB({
|
|
|
9542
9546
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => VA(!1), children: "✕" })
|
|
9543
9547
|
] }),
|
|
9544
9548
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: g.sections && Object.keys(g.sections).length > 1 ? Object.entries(g.sections).map(([U, R]) => {
|
|
9545
|
-
const S = n?.sections?.[U]?.recommendedSize || "",
|
|
9549
|
+
const S = n?.sections?.[U]?.recommendedSize || "", dA = R.headers.findIndex(($A) => /size|taglia|größe|taille|fit|length/i.test($A.trim())), fA = dA >= 0 ? dA : 0, NA = R.headers[fA] || "Size";
|
|
9546
9550
|
return /* @__PURE__ */ P("div", { className: "ps-tryon-chart-section", children: [
|
|
9547
9551
|
/* @__PURE__ */ P("div", { className: "ps-tryon-chart-section-title", children: [
|
|
9548
9552
|
/* @__PURE__ */ A("span", { children: U }),
|
|
@@ -9556,7 +9560,7 @@ function EB({
|
|
|
9556
9560
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: R.headers.map(($A, ef) => /* @__PURE__ */ A("th", { className: ef === fA ? "ps-size-col" : "", children: $A }, ef)) }) }),
|
|
9557
9561
|
/* @__PURE__ */ A("tbody", { children: R.rows.map(($A, ef) => {
|
|
9558
9562
|
const KA = Uf($A, fA, NA) === S;
|
|
9559
|
-
return /* @__PURE__ */ A("tr", { className: KA ? "ps-active-row" : "", children: R.headers.map((
|
|
9563
|
+
return /* @__PURE__ */ A("tr", { className: KA ? "ps-active-row" : "", children: R.headers.map((Df, M) => /* @__PURE__ */ A("td", { className: M === fA ? "ps-size-col" : "", children: Uf($A, M, Df) }, M)) }, ef);
|
|
9560
9564
|
}) })
|
|
9561
9565
|
] }) })
|
|
9562
9566
|
] }, U);
|
|
@@ -9566,7 +9570,7 @@ function EB({
|
|
|
9566
9570
|
/* @__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)) }) }),
|
|
9567
9571
|
/* @__PURE__ */ A("tbody", { children: g.rows.map((U, R) => {
|
|
9568
9572
|
const S = s(U, PA, RA) === YA;
|
|
9569
|
-
return /* @__PURE__ */ A("tr", { className: S ? "ps-active-row" : "", children: g.headers.map((
|
|
9573
|
+
return /* @__PURE__ */ A("tr", { className: S ? "ps-active-row" : "", children: g.headers.map((dA, fA) => /* @__PURE__ */ A("td", { className: fA === PA ? "ps-size-col" : "", children: s(U, fA, dA) }, fA)) }, R);
|
|
9570
9574
|
}) })
|
|
9571
9575
|
] }) })
|
|
9572
9576
|
) : null })
|
|
@@ -9582,17 +9586,17 @@ function aB({
|
|
|
9582
9586
|
fileInputRef: B,
|
|
9583
9587
|
handleFileSelect: C,
|
|
9584
9588
|
handleRemovePreview: D,
|
|
9585
|
-
handleTryOnSubmit:
|
|
9589
|
+
handleTryOnSubmit: t,
|
|
9586
9590
|
cn: o,
|
|
9587
9591
|
t: r
|
|
9588
9592
|
}) {
|
|
9589
|
-
return /* @__PURE__ */ A(
|
|
9593
|
+
return /* @__PURE__ */ A(rA, { children: f && n ? /* @__PURE__ */ P(rA, { children: [
|
|
9590
9594
|
/* @__PURE__ */ P("div", { className: Qf("ps-tryon-preview", o.preview), children: [
|
|
9591
9595
|
/* @__PURE__ */ A("div", { className: "ps-tryon-preview-blur", style: { backgroundImage: `url(${n})` } }),
|
|
9592
9596
|
/* @__PURE__ */ A("img", { src: n, alt: r("Your photo"), className: o.previewImage }),
|
|
9593
9597
|
/* @__PURE__ */ A("button", { onClick: D, className: Qf("ps-tryon-preview-remove", o.removeButton), children: "×" })
|
|
9594
9598
|
] }),
|
|
9595
|
-
/* @__PURE__ */ P("button", { onClick:
|
|
9599
|
+
/* @__PURE__ */ P("button", { onClick: t, className: Qf("ps-tryon-submit", o.submitButton), children: [
|
|
9596
9600
|
r("Try It On"),
|
|
9597
9601
|
" ",
|
|
9598
9602
|
/* @__PURE__ */ A(_f, {})
|
|
@@ -9641,7 +9645,7 @@ function dB({
|
|
|
9641
9645
|
progressStatusRef: B,
|
|
9642
9646
|
progressEtaRef: C,
|
|
9643
9647
|
progressRingRef: D,
|
|
9644
|
-
cn:
|
|
9648
|
+
cn: t,
|
|
9645
9649
|
t: o
|
|
9646
9650
|
}) {
|
|
9647
9651
|
const r = UA((h) => {
|
|
@@ -9660,7 +9664,7 @@ function dB({
|
|
|
9660
9664
|
}, []);
|
|
9661
9665
|
return /* @__PURE__ */ P("div", { className: "ps-tryon-processing", children: [
|
|
9662
9666
|
/* @__PURE__ */ P("div", { className: "ps-tryon-processing-image-wrap", children: [
|
|
9663
|
-
f && /* @__PURE__ */ P(
|
|
9667
|
+
f && /* @__PURE__ */ P(rA, { children: [
|
|
9664
9668
|
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-blur", style: { backgroundImage: `url(${f})` } }),
|
|
9665
9669
|
/* @__PURE__ */ A("img", { src: f, alt: o("Your photo"), className: "ps-tryon-processing-model" })
|
|
9666
9670
|
] }),
|
|
@@ -9697,8 +9701,8 @@ function dB({
|
|
|
9697
9701
|
/* @__PURE__ */ A("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ A("div", { ref: r, className: "ps-tryon-progress-bar-fill" }) }),
|
|
9698
9702
|
/* @__PURE__ */ A("span", { ref: z, className: "ps-tryon-progress-pct", children: "0%" })
|
|
9699
9703
|
] }),
|
|
9700
|
-
/* @__PURE__ */ A("div", { ref: p, className: Qf("ps-tryon-processing-text",
|
|
9701
|
-
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-processing-sub",
|
|
9704
|
+
/* @__PURE__ */ A("div", { ref: p, className: Qf("ps-tryon-processing-text", t.processingText), children: o("Preparing your image...") }),
|
|
9705
|
+
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-processing-sub", t.processingSubText), children: o("This usually takes 15-25 seconds") })
|
|
9702
9706
|
] });
|
|
9703
9707
|
}
|
|
9704
9708
|
function FB({
|
|
@@ -9783,14 +9787,14 @@ function CP({
|
|
|
9783
9787
|
] }, f);
|
|
9784
9788
|
}
|
|
9785
9789
|
function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B }) {
|
|
9786
|
-
const [C, D] = j(null), [
|
|
9790
|
+
const [C, D] = j(null), [t, o] = j("identity"), [r, z] = j("name-photo"), [p, T] = j(!1), [F, h] = j(null), W = tA(null);
|
|
9787
9791
|
JA(() => {
|
|
9788
9792
|
W.current && (W.current.scrollTop = 0);
|
|
9789
|
-
}, [C,
|
|
9790
|
-
const [
|
|
9793
|
+
}, [C, t]);
|
|
9794
|
+
const [i, k] = j(""), [u, v] = j("male"), [I, K] = j("cm"), [N, x] = j(""), [E, BA] = j(""), [c, hA] = j(""), [l, y] = j(""), [XA, sA] = j(""), [V, s] = j(""), [PA, RA] = j(null), [mA, EA] = j(!1), ZA = tA(null), Hf = tA(null), [m, aA] = j(!1), [TA, bA] = j(null), VA = () => {
|
|
9791
9795
|
TA === !0 && ZA.current?.click();
|
|
9792
|
-
}, kA = async (
|
|
9793
|
-
const q =
|
|
9796
|
+
}, kA = async (O) => {
|
|
9797
|
+
const q = O.target.files?.[0];
|
|
9794
9798
|
if (q) {
|
|
9795
9799
|
if (TA !== !0) {
|
|
9796
9800
|
s(B("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
@@ -9804,96 +9808,96 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9804
9808
|
s(B("Image must be under 10MB"));
|
|
9805
9809
|
return;
|
|
9806
9810
|
}
|
|
9807
|
-
|
|
9811
|
+
EA(!0);
|
|
9808
9812
|
try {
|
|
9809
9813
|
const QA = await AP(q);
|
|
9810
9814
|
RA(QA), g?.(QA), s("");
|
|
9811
9815
|
} catch {
|
|
9812
9816
|
s(B("Failed to process image"));
|
|
9813
9817
|
} finally {
|
|
9814
|
-
|
|
9818
|
+
EA(!1);
|
|
9815
9819
|
}
|
|
9816
9820
|
}
|
|
9817
9821
|
}, vA = () => {
|
|
9818
9822
|
RA(null), g?.(null), ZA.current && (ZA.current.value = "");
|
|
9819
|
-
}, [SA, ff] = j(null), [
|
|
9823
|
+
}, [SA, ff] = j(null), [iA, 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(t), a = uA.length, X = WA === a - 1, nA = () => {
|
|
9820
9824
|
if (I === "in") {
|
|
9821
|
-
const
|
|
9822
|
-
!isNaN(
|
|
9825
|
+
const O = parseInt(E, 10), q = parseInt(c, 10);
|
|
9826
|
+
!isNaN(O) && O >= 0 && !isNaN(q) && q >= 0 && x(String(Math.round((O * 12 + q) * 2.54)));
|
|
9823
9827
|
}
|
|
9824
|
-
|
|
9828
|
+
K("cm");
|
|
9825
9829
|
}, H = () => {
|
|
9826
9830
|
if (I === "cm") {
|
|
9827
|
-
const
|
|
9828
|
-
!isNaN(
|
|
9831
|
+
const O = parseFloat(N);
|
|
9832
|
+
!isNaN(O) && O > 0 && (BA(String(Math.floor(O / 2.54 / 12))), hA(String(Math.round(O / 2.54 % 12))));
|
|
9829
9833
|
}
|
|
9830
|
-
|
|
9834
|
+
K("in");
|
|
9831
9835
|
}, oA = () => {
|
|
9832
|
-
if (!
|
|
9836
|
+
if (!i.trim())
|
|
9833
9837
|
return s(B("Please enter a profile name")), !1;
|
|
9834
|
-
let
|
|
9838
|
+
let O;
|
|
9835
9839
|
if (I === "in") {
|
|
9836
9840
|
const U = parseInt(E, 10), R = parseInt(c, 10);
|
|
9837
|
-
|
|
9841
|
+
O = !isNaN(U) && U > 0 && !isNaN(R) && R >= 0 && R <= 11;
|
|
9838
9842
|
} else {
|
|
9839
9843
|
const U = parseFloat(N);
|
|
9840
|
-
|
|
9844
|
+
O = !isNaN(U) && U > 0;
|
|
9841
9845
|
}
|
|
9842
|
-
if (!
|
|
9846
|
+
if (!O)
|
|
9843
9847
|
return s(B("Please enter a valid height")), !1;
|
|
9844
9848
|
const q = parseFloat(l), QA = parseFloat(XA);
|
|
9845
9849
|
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);
|
|
9846
|
-
}, zA = () =>
|
|
9847
|
-
const
|
|
9850
|
+
}, zA = () => i.trim() ? (s(""), !0) : (s(B("Please enter a profile name")), !1), YA = () => {
|
|
9851
|
+
const O = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N);
|
|
9848
9852
|
return {
|
|
9849
|
-
name:
|
|
9853
|
+
name: i.trim(),
|
|
9850
9854
|
gender: u,
|
|
9851
9855
|
sizingUnit: I,
|
|
9852
9856
|
heightUnit: I,
|
|
9853
9857
|
weightUnit: I === "in" ? "lbs" : "kg",
|
|
9854
|
-
heightCm:
|
|
9858
|
+
heightCm: O,
|
|
9855
9859
|
weightKg: parseFloat(l),
|
|
9856
|
-
height:
|
|
9860
|
+
height: O,
|
|
9857
9861
|
weight: parseFloat(l),
|
|
9858
9862
|
age: parseFloat(XA),
|
|
9859
9863
|
chestProfile: SA || void 0,
|
|
9860
|
-
midsectionProfile:
|
|
9864
|
+
midsectionProfile: iA || void 0,
|
|
9861
9865
|
hipProfile: GA ? eA || void 0 : xA || void 0,
|
|
9862
9866
|
bandSize: GA && _A || void 0,
|
|
9863
9867
|
cupSize: GA && cf || void 0
|
|
9864
9868
|
};
|
|
9865
|
-
},
|
|
9866
|
-
const
|
|
9869
|
+
}, wf = () => {
|
|
9870
|
+
const O = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N), q = parseFloat(l), QA = parseFloat(XA);
|
|
9867
9871
|
return {
|
|
9868
|
-
name:
|
|
9872
|
+
name: i.trim(),
|
|
9869
9873
|
gender: u,
|
|
9870
9874
|
sizingUnit: I,
|
|
9871
9875
|
heightUnit: I,
|
|
9872
9876
|
weightUnit: I === "in" ? "lbs" : "kg",
|
|
9873
|
-
...
|
|
9877
|
+
...O > 0 ? { heightCm: O, height: O } : {},
|
|
9874
9878
|
...q > 0 ? { weightKg: q, weight: q } : {},
|
|
9875
9879
|
...QA > 0 ? { age: QA } : {},
|
|
9876
9880
|
photoBase64: PA || void 0
|
|
9877
9881
|
};
|
|
9878
9882
|
}, J = () => {
|
|
9879
|
-
if (!(
|
|
9880
|
-
if (
|
|
9883
|
+
if (!(t === "identity" && !oA())) {
|
|
9884
|
+
if (t === "chest" && !SA) {
|
|
9881
9885
|
s(B("Please pick an option"));
|
|
9882
9886
|
return;
|
|
9883
9887
|
}
|
|
9884
|
-
if (
|
|
9888
|
+
if (t === "stomach" && !iA) {
|
|
9885
9889
|
s(B("Please pick an option"));
|
|
9886
9890
|
return;
|
|
9887
9891
|
}
|
|
9888
|
-
if (
|
|
9892
|
+
if (t === "seat" && !xA) {
|
|
9889
9893
|
s(B("Please pick an option"));
|
|
9890
9894
|
return;
|
|
9891
9895
|
}
|
|
9892
|
-
if (
|
|
9896
|
+
if (t === "hips" && !eA) {
|
|
9893
9897
|
s(B("Please pick an option"));
|
|
9894
9898
|
return;
|
|
9895
9899
|
}
|
|
9896
|
-
if (
|
|
9900
|
+
if (t === "bra" && (!_A || !cf)) {
|
|
9897
9901
|
s(B("Please pick band and cup size"));
|
|
9898
9902
|
return;
|
|
9899
9903
|
}
|
|
@@ -9903,23 +9907,23 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9903
9907
|
}
|
|
9904
9908
|
o(uA[WA + 1]);
|
|
9905
9909
|
}
|
|
9906
|
-
}, gA = (
|
|
9907
|
-
s(""),
|
|
9908
|
-
const QA = uA.indexOf(
|
|
9910
|
+
}, gA = (O, q) => {
|
|
9911
|
+
s(""), O === "chest" ? ff(q) : O === "stomach" ? nf(q) : O === "seat" ? Ef(q) : O === "hips" && $(q);
|
|
9912
|
+
const QA = uA.indexOf(O), U = QA === a - 1;
|
|
9909
9913
|
setTimeout(() => {
|
|
9910
9914
|
if (U) {
|
|
9911
9915
|
const R = YA();
|
|
9912
|
-
|
|
9916
|
+
O === "chest" ? R.chestProfile = q : O === "stomach" ? R.midsectionProfile = q : (O === "seat" || O === "hips") && (R.hipProfile = q), f(R);
|
|
9913
9917
|
} else
|
|
9914
9918
|
o(uA[QA + 1]);
|
|
9915
9919
|
}, 220);
|
|
9916
9920
|
}, Bf = () => {
|
|
9917
|
-
if (s(""),
|
|
9921
|
+
if (s(""), t === "identity") {
|
|
9918
9922
|
D(null);
|
|
9919
9923
|
return;
|
|
9920
9924
|
}
|
|
9921
9925
|
o(uA[Math.max(0, WA - 1)]);
|
|
9922
|
-
}, FA = C === "manual" && (
|
|
9926
|
+
}, FA = C === "manual" && (t === "chest" || t === "stomach" || t === "seat" || t === "hips"), OA = async () => {
|
|
9923
9927
|
if (r === "name-photo") {
|
|
9924
9928
|
if (!zA()) return;
|
|
9925
9929
|
if (!PA) {
|
|
@@ -9962,8 +9966,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9962
9966
|
T(!1);
|
|
9963
9967
|
return;
|
|
9964
9968
|
}
|
|
9965
|
-
const
|
|
9966
|
-
F && (
|
|
9969
|
+
const O = wf();
|
|
9970
|
+
F && (O.measurements = F, O.measurementsUnit = "cm"), f(O);
|
|
9967
9971
|
}, AA = () => {
|
|
9968
9972
|
if (s(""), r === "details") {
|
|
9969
9973
|
z("name-photo");
|
|
@@ -9981,7 +9985,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9981
9985
|
}, Pf = (() => {
|
|
9982
9986
|
if (C == null) return B("Choose a method");
|
|
9983
9987
|
if (C === "manual") {
|
|
9984
|
-
const
|
|
9988
|
+
const O = {
|
|
9985
9989
|
identity: B("Identity"),
|
|
9986
9990
|
chest: B("Chest"),
|
|
9987
9991
|
stomach: B("Stomach"),
|
|
@@ -9989,14 +9993,14 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9989
9993
|
hips: B("Hips"),
|
|
9990
9994
|
bra: B("Bra")
|
|
9991
9995
|
};
|
|
9992
|
-
return `${String(WA + 1).padStart(2, "0")} · ${
|
|
9996
|
+
return `${String(WA + 1).padStart(2, "0")} · ${O[t]}`;
|
|
9993
9997
|
}
|
|
9994
9998
|
return B("Analyze by photo");
|
|
9995
9999
|
})(), lA = (() => {
|
|
9996
10000
|
if (C == null) return 0;
|
|
9997
10001
|
if (C === "manual") return Math.round((WA + 1) / a * 100);
|
|
9998
|
-
let
|
|
9999
|
-
return
|
|
10002
|
+
let O = 0;
|
|
10003
|
+
return i.trim() && (O += 50), PA && (O += 50), O;
|
|
10000
10004
|
})();
|
|
10001
10005
|
return /* @__PURE__ */ P("div", { className: "ps-cpw-root", children: [
|
|
10002
10006
|
/* @__PURE__ */ P("div", { className: "ps-cpw-step-head", children: [
|
|
@@ -10048,7 +10052,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10048
10052
|
}
|
|
10049
10053
|
)
|
|
10050
10054
|
] }) }, "method-picker"),
|
|
10051
|
-
C === "manual" &&
|
|
10055
|
+
C === "manual" && t === "identity" && /* @__PURE__ */ P("div", { className: "ps-cpw-identity ps-cpw-fade-in", children: [
|
|
10052
10056
|
/* @__PURE__ */ P("div", { className: "ps-cpw-pill-row", children: [
|
|
10053
10057
|
/* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", children: [
|
|
10054
10058
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${u === "male" ? " ps-active" : ""}`, onClick: () => v("male"), children: B("Male") }),
|
|
@@ -10067,10 +10071,10 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10067
10071
|
{
|
|
10068
10072
|
type: "text",
|
|
10069
10073
|
className: "ps-bp-inline-input",
|
|
10070
|
-
value:
|
|
10074
|
+
value: i,
|
|
10071
10075
|
placeholder: B("e.g. My Measurements"),
|
|
10072
|
-
onChange: (
|
|
10073
|
-
k(
|
|
10076
|
+
onChange: (O) => {
|
|
10077
|
+
k(O.target.value), s("");
|
|
10074
10078
|
}
|
|
10075
10079
|
}
|
|
10076
10080
|
) })
|
|
@@ -10086,8 +10090,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10086
10090
|
className: "ps-bp-inline-input",
|
|
10087
10091
|
value: N,
|
|
10088
10092
|
placeholder: B("e.g. 173"),
|
|
10089
|
-
onChange: (
|
|
10090
|
-
|
|
10093
|
+
onChange: (O) => {
|
|
10094
|
+
x(O.target.value), s("");
|
|
10091
10095
|
}
|
|
10092
10096
|
}
|
|
10093
10097
|
),
|
|
@@ -10102,8 +10106,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10102
10106
|
style: { width: "3em" },
|
|
10103
10107
|
value: E,
|
|
10104
10108
|
placeholder: "5",
|
|
10105
|
-
onChange: (
|
|
10106
|
-
BA(
|
|
10109
|
+
onChange: (O) => {
|
|
10110
|
+
BA(O.target.value), s("");
|
|
10107
10111
|
}
|
|
10108
10112
|
}
|
|
10109
10113
|
),
|
|
@@ -10117,8 +10121,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10117
10121
|
style: { width: "3em" },
|
|
10118
10122
|
value: c,
|
|
10119
10123
|
placeholder: "8",
|
|
10120
|
-
onChange: (
|
|
10121
|
-
hA(
|
|
10124
|
+
onChange: (O) => {
|
|
10125
|
+
hA(O.target.value), s("");
|
|
10122
10126
|
}
|
|
10123
10127
|
}
|
|
10124
10128
|
),
|
|
@@ -10136,8 +10140,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10136
10140
|
className: "ps-bp-inline-input",
|
|
10137
10141
|
value: l,
|
|
10138
10142
|
placeholder: B(I === "in" ? "e.g. 154" : "e.g. 70"),
|
|
10139
|
-
onChange: (
|
|
10140
|
-
y(
|
|
10143
|
+
onChange: (O) => {
|
|
10144
|
+
y(O.target.value), s("");
|
|
10141
10145
|
}
|
|
10142
10146
|
}
|
|
10143
10147
|
),
|
|
@@ -10155,8 +10159,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10155
10159
|
className: "ps-bp-inline-input",
|
|
10156
10160
|
value: XA,
|
|
10157
10161
|
placeholder: B("e.g. 30"),
|
|
10158
|
-
onChange: (
|
|
10159
|
-
sA(
|
|
10162
|
+
onChange: (O) => {
|
|
10163
|
+
sA(O.target.value), s("");
|
|
10160
10164
|
}
|
|
10161
10165
|
}
|
|
10162
10166
|
),
|
|
@@ -10166,7 +10170,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10166
10170
|
] }),
|
|
10167
10171
|
V && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: V })
|
|
10168
10172
|
] }, "manual-identity"),
|
|
10169
|
-
C === "manual" &&
|
|
10173
|
+
C === "manual" && t === "chest" && !GA && /* @__PURE__ */ P(
|
|
10170
10174
|
CP,
|
|
10171
10175
|
{
|
|
10172
10176
|
stepKey: "chest",
|
|
@@ -10179,20 +10183,20 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10179
10183
|
]
|
|
10180
10184
|
}
|
|
10181
10185
|
),
|
|
10182
|
-
C === "manual" &&
|
|
10186
|
+
C === "manual" && t === "stomach" && /* @__PURE__ */ P(
|
|
10183
10187
|
CP,
|
|
10184
10188
|
{
|
|
10185
10189
|
stepKey: "stomach",
|
|
10186
10190
|
title: B("STOMACH PROFILE"),
|
|
10187
10191
|
subtitle: B("Describe your mid-section silhouette"),
|
|
10188
10192
|
children: [
|
|
10189
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected:
|
|
10190
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected:
|
|
10191
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected:
|
|
10193
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected: iA === "flat", onSelect: () => gA("stomach", "flat") }),
|
|
10194
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected: iA === "average", onSelect: () => gA("stomach", "average") }),
|
|
10195
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected: iA === "round", onSelect: () => gA("stomach", "round") })
|
|
10192
10196
|
]
|
|
10193
10197
|
}
|
|
10194
10198
|
),
|
|
10195
|
-
C === "manual" &&
|
|
10199
|
+
C === "manual" && t === "seat" && /* @__PURE__ */ P(
|
|
10196
10200
|
CP,
|
|
10197
10201
|
{
|
|
10198
10202
|
stepKey: "seat",
|
|
@@ -10205,7 +10209,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10205
10209
|
]
|
|
10206
10210
|
}
|
|
10207
10211
|
),
|
|
10208
|
-
C === "manual" &&
|
|
10212
|
+
C === "manual" && t === "hips" && GA && _.hips && /* @__PURE__ */ P(
|
|
10209
10213
|
CP,
|
|
10210
10214
|
{
|
|
10211
10215
|
stepKey: "hips",
|
|
@@ -10218,7 +10222,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10218
10222
|
]
|
|
10219
10223
|
}
|
|
10220
10224
|
),
|
|
10221
|
-
C === "manual" &&
|
|
10225
|
+
C === "manual" && t === "bra" && GA && /* @__PURE__ */ P("div", { className: "ps-cpw-progressive ps-cpw-fade-in", children: [
|
|
10222
10226
|
/* @__PURE__ */ P("div", { className: "ps-cpw-section-head", children: [
|
|
10223
10227
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-title", children: B("BRA SIZE") }),
|
|
10224
10228
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-sub", children: B("Helps us refine bust measurements for tops and dresses") })
|
|
@@ -10231,12 +10235,12 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10231
10235
|
{
|
|
10232
10236
|
className: "ps-cpw-input",
|
|
10233
10237
|
value: _A ?? "",
|
|
10234
|
-
onChange: (
|
|
10235
|
-
Of(
|
|
10238
|
+
onChange: (O) => {
|
|
10239
|
+
Of(O.target.value || null), s("");
|
|
10236
10240
|
},
|
|
10237
10241
|
children: [
|
|
10238
10242
|
/* @__PURE__ */ A("option", { value: "", children: B("Select") }),
|
|
10239
|
-
gf.map((
|
|
10243
|
+
gf.map((O) => /* @__PURE__ */ A("option", { value: O, children: O }, O))
|
|
10240
10244
|
]
|
|
10241
10245
|
}
|
|
10242
10246
|
)
|
|
@@ -10248,12 +10252,12 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10248
10252
|
{
|
|
10249
10253
|
className: "ps-cpw-input",
|
|
10250
10254
|
value: cf ?? "",
|
|
10251
|
-
onChange: (
|
|
10252
|
-
Mf(
|
|
10255
|
+
onChange: (O) => {
|
|
10256
|
+
Mf(O.target.value || null), s("");
|
|
10253
10257
|
},
|
|
10254
10258
|
children: [
|
|
10255
10259
|
/* @__PURE__ */ A("option", { value: "", children: B("Select") }),
|
|
10256
|
-
qA.map((
|
|
10260
|
+
qA.map((O) => /* @__PURE__ */ A("option", { value: O, children: O }, O))
|
|
10257
10261
|
]
|
|
10258
10262
|
}
|
|
10259
10263
|
)
|
|
@@ -10343,9 +10347,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10343
10347
|
/* @__PURE__ */ P("div", { className: "ps-cpw-image-right", children: [
|
|
10344
10348
|
/* @__PURE__ */ A("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: /* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10345
10349
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("NAME") }),
|
|
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:
|
|
10347
|
-
k(
|
|
10348
|
-
}, onAnimationEnd: () =>
|
|
10350
|
+
/* @__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: i, placeholder: B("e.g. My Photo Profile"), onChange: (O) => {
|
|
10351
|
+
k(O.target.value), s("");
|
|
10352
|
+
}, onAnimationEnd: () => aA(!1) }) })
|
|
10349
10353
|
] }) }),
|
|
10350
10354
|
/* @__PURE__ */ P("div", { className: "ps-cpw-photo-guide", children: [
|
|
10351
10355
|
/* @__PURE__ */ A("div", { className: "ps-cpw-photo-guide-title", children: B("HOW TO TAKE A GOOD PHOTO") }),
|
|
@@ -10391,17 +10395,17 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10391
10395
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10392
10396
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("HEIGHT") }),
|
|
10393
10397
|
I === "cm" ? /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10394
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: N, placeholder: B("e.g. 173"), onChange: (
|
|
10395
|
-
|
|
10398
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: N, placeholder: B("e.g. 173"), onChange: (O) => {
|
|
10399
|
+
x(O.target.value), s("");
|
|
10396
10400
|
} }),
|
|
10397
10401
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
10398
10402
|
] }) : /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
|
|
10399
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: E, placeholder: "5", onChange: (
|
|
10400
|
-
BA(
|
|
10403
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: E, placeholder: "5", onChange: (O) => {
|
|
10404
|
+
BA(O.target.value), s("");
|
|
10401
10405
|
} }),
|
|
10402
10406
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
10403
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: c, placeholder: "8", onChange: (
|
|
10404
|
-
hA(
|
|
10407
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: c, placeholder: "8", onChange: (O) => {
|
|
10408
|
+
hA(O.target.value), s("");
|
|
10405
10409
|
} }),
|
|
10406
10410
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
10407
10411
|
] })
|
|
@@ -10409,8 +10413,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10409
10413
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10410
10414
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("WEIGHT") }),
|
|
10411
10415
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10412
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: l, placeholder: B(I === "in" ? "e.g. 154" : "e.g. 70"), onChange: (
|
|
10413
|
-
y(
|
|
10416
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: l, placeholder: B(I === "in" ? "e.g. 154" : "e.g. 70"), onChange: (O) => {
|
|
10417
|
+
y(O.target.value), s("");
|
|
10414
10418
|
} }),
|
|
10415
10419
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: I === "in" ? "lbs" : "kg" })
|
|
10416
10420
|
] })
|
|
@@ -10418,8 +10422,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10418
10422
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10419
10423
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("AGE") }),
|
|
10420
10424
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10421
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: XA, placeholder: B("e.g. 30"), onChange: (
|
|
10422
|
-
sA(
|
|
10425
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: XA, placeholder: B("e.g. 30"), onChange: (O) => {
|
|
10426
|
+
sA(O.target.value), s("");
|
|
10423
10427
|
} }),
|
|
10424
10428
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: B("years") })
|
|
10425
10429
|
] })
|
|
@@ -10431,7 +10435,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10431
10435
|
/* @__PURE__ */ A("div", { className: "ps-tryon-size-loading-spinner" }),
|
|
10432
10436
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-primary)", fontSize: "1vw", fontWeight: 600 }, children: B("Analyzing your body measurements...") }),
|
|
10433
10437
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.75vw" }, children: B("Using AI to estimate chest, waist, hips, shoulders, and more") })
|
|
10434
|
-
] }) : F ? /* @__PURE__ */ P(
|
|
10438
|
+
] }) : F ? /* @__PURE__ */ P(rA, { children: [
|
|
10435
10439
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.8vw", marginBottom: "1vw" }, children: [
|
|
10436
10440
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "var(--ps-accent)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", width: "28", height: "28", children: /* @__PURE__ */ A("polyline", { points: "20 6 9 17 4 12" }) }),
|
|
10437
10441
|
/* @__PURE__ */ P("div", { children: [
|
|
@@ -10450,8 +10454,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10450
10454
|
{ key: "inseam", label: B("INSEAM") },
|
|
10451
10455
|
{ key: "thighCircumference", label: B("THIGH") },
|
|
10452
10456
|
{ key: "footLengthCm", label: B("FOOT") }
|
|
10453
|
-
].map(({ key:
|
|
10454
|
-
const QA = F[
|
|
10457
|
+
].map(({ key: O, label: q }) => {
|
|
10458
|
+
const QA = F[O];
|
|
10455
10459
|
if (!QA || QA === 0) return null;
|
|
10456
10460
|
const U = I === "in" ? Math.round(QA / 2.54 * 10) / 10 : QA;
|
|
10457
10461
|
return /* @__PURE__ */ P("div", { style: { background: "rgba(33,84,239,0.04)", border: "1px solid rgba(33,84,239,0.12)", borderRadius: "0.4vw", padding: "0.6vw 0.8vw" }, children: [
|
|
@@ -10461,7 +10465,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10461
10465
|
" ",
|
|
10462
10466
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", color: "var(--ps-text-muted)", fontWeight: 400 }, children: I })
|
|
10463
10467
|
] })
|
|
10464
|
-
] },
|
|
10468
|
+
] }, O);
|
|
10465
10469
|
}) })
|
|
10466
10470
|
] }) : /* @__PURE__ */ P("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", flex: 1, gap: "0.8vw" }, children: [
|
|
10467
10471
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-primary)", fontSize: "1vw", fontWeight: 600 }, children: B("Estimation could not complete") }),
|
|
@@ -10477,14 +10481,14 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10477
10481
|
type: "button",
|
|
10478
10482
|
className: "ps-cpw-next-btn",
|
|
10479
10483
|
onClick: () => {
|
|
10480
|
-
if (!
|
|
10481
|
-
|
|
10484
|
+
if (!i.trim()) {
|
|
10485
|
+
aA(!0), Hf.current?.focus();
|
|
10482
10486
|
return;
|
|
10483
10487
|
}
|
|
10484
10488
|
OA();
|
|
10485
10489
|
},
|
|
10486
|
-
disabled: !
|
|
10487
|
-
children:
|
|
10490
|
+
disabled: !i.trim() || !PA,
|
|
10491
|
+
children: i.trim() ? B(PA ? "Continue" : "Upload a photo") : B("Add a name for this profile")
|
|
10488
10492
|
}
|
|
10489
10493
|
),
|
|
10490
10494
|
C === "image" && r === "details" && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: OA, children: B("Calculate My Body Parts") }),
|
|
@@ -10522,43 +10526,43 @@ function A8({
|
|
|
10522
10526
|
onDelete: B,
|
|
10523
10527
|
onBack: C,
|
|
10524
10528
|
onSave: D,
|
|
10525
|
-
onSaveBraSize:
|
|
10529
|
+
onSaveBraSize: t,
|
|
10526
10530
|
isEstimating: o = !1,
|
|
10527
10531
|
t: r
|
|
10528
10532
|
}) {
|
|
10529
|
-
const z = f.gender === "female" ? VB : WB, p = f.measurements || {}, T = Object.keys(p).some((
|
|
10530
|
-
const
|
|
10533
|
+
const z = f.gender === "female" ? VB : WB, p = f.measurements || {}, T = Object.keys(p).some((x) => p[x] != null), [F, h] = j(f.measurementsUnit || "cm"), [W, i] = j(() => {
|
|
10534
|
+
const x = {};
|
|
10531
10535
|
return z.forEach((E) => {
|
|
10532
10536
|
const BA = p[E.key];
|
|
10533
|
-
|
|
10534
|
-
}),
|
|
10537
|
+
x[E.key] = BA != null ? String(Math.round(BA * 10) / 10) : "";
|
|
10538
|
+
}), x;
|
|
10535
10539
|
});
|
|
10536
10540
|
JA(() => {
|
|
10537
|
-
|
|
10538
|
-
const E = { ...
|
|
10541
|
+
i((x) => {
|
|
10542
|
+
const E = { ...x };
|
|
10539
10543
|
let BA = !1;
|
|
10540
10544
|
return z.forEach((c) => {
|
|
10541
10545
|
const hA = p[c.key];
|
|
10542
|
-
hA != null && !
|
|
10543
|
-
}), BA ? E :
|
|
10546
|
+
hA != null && !x[c.key] && (E[c.key] = String(Math.round(hA * 10) / 10), BA = !0);
|
|
10547
|
+
}), BA ? E : x;
|
|
10544
10548
|
});
|
|
10545
10549
|
}, [f.measurements, f.id]);
|
|
10546
|
-
const [k, u] = j(f.bandSize || ""), [v, I] = j(f.cupSize || ""),
|
|
10547
|
-
|
|
10550
|
+
const [k, u] = j(f.bandSize || ""), [v, I] = j(f.cupSize || ""), K = (x) => {
|
|
10551
|
+
x !== F && (i((E) => {
|
|
10548
10552
|
const BA = {};
|
|
10549
10553
|
for (const [c, hA] of Object.entries(E)) {
|
|
10550
10554
|
const l = parseFloat(hA);
|
|
10551
|
-
!isNaN(l) && l > 0 ? BA[c] = String(
|
|
10555
|
+
!isNaN(l) && l > 0 ? BA[c] = String(x === "in" ? Math.round(l / 2.54 * 10) / 10 : Math.round(l * 2.54 * 10) / 10) : BA[c] = hA;
|
|
10552
10556
|
}
|
|
10553
10557
|
return BA;
|
|
10554
|
-
}), h(
|
|
10558
|
+
}), h(x));
|
|
10555
10559
|
}, N = () => {
|
|
10556
|
-
const
|
|
10560
|
+
const x = { ...f.measurements || {} };
|
|
10557
10561
|
for (const [E, BA] of Object.entries(W)) {
|
|
10558
10562
|
const c = parseFloat(BA);
|
|
10559
|
-
!isNaN(c) && c > 0 && (
|
|
10563
|
+
!isNaN(c) && c > 0 && (x[E] = c);
|
|
10560
10564
|
}
|
|
10561
|
-
e(
|
|
10565
|
+
e(x, F), f.gender === "female" && t && (k || v) && t(k, v), D();
|
|
10562
10566
|
};
|
|
10563
10567
|
return /* @__PURE__ */ P("div", { className: "ps-pmv-root", children: [
|
|
10564
10568
|
/* @__PURE__ */ P("div", { className: "ps-pmv-hero", children: [
|
|
@@ -10574,7 +10578,7 @@ function A8({
|
|
|
10574
10578
|
{
|
|
10575
10579
|
type: "button",
|
|
10576
10580
|
className: `ps-cpw-pill${F === "cm" ? " ps-active" : ""}`,
|
|
10577
|
-
onClick: () =>
|
|
10581
|
+
onClick: () => K("cm"),
|
|
10578
10582
|
children: "cm"
|
|
10579
10583
|
}
|
|
10580
10584
|
),
|
|
@@ -10583,7 +10587,7 @@ function A8({
|
|
|
10583
10587
|
{
|
|
10584
10588
|
type: "button",
|
|
10585
10589
|
className: `ps-cpw-pill${F === "in" ? " ps-active" : ""}`,
|
|
10586
|
-
onClick: () =>
|
|
10590
|
+
onClick: () => K("in"),
|
|
10587
10591
|
children: "in"
|
|
10588
10592
|
}
|
|
10589
10593
|
)
|
|
@@ -10594,31 +10598,31 @@ function A8({
|
|
|
10594
10598
|
] })
|
|
10595
10599
|
] }) }),
|
|
10596
10600
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-list", children: [
|
|
10597
|
-
z.map((
|
|
10598
|
-
const E = p[
|
|
10601
|
+
z.map((x) => {
|
|
10602
|
+
const E = p[x.key], BA = o && E == null && !W[x.key];
|
|
10599
10603
|
return /* @__PURE__ */ P("div", { className: `ps-pmv-measure-row${E == null ? " ps-loading" : ""}`, children: [
|
|
10600
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src:
|
|
10601
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: r(
|
|
10604
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: x.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
10605
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: r(x.label) }),
|
|
10602
10606
|
/* @__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: [
|
|
10603
10607
|
/* @__PURE__ */ A("span", { className: "ps-tryon-size-loading-spinner", style: { width: "0.8vw", height: "0.8vw", borderWidth: "1.5px" } }),
|
|
10604
10608
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: r("calculating...") })
|
|
10605
|
-
] }) : /* @__PURE__ */ P(
|
|
10609
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
10606
10610
|
/* @__PURE__ */ A(
|
|
10607
10611
|
"input",
|
|
10608
10612
|
{
|
|
10609
10613
|
type: "number",
|
|
10610
10614
|
step: "0.1",
|
|
10611
10615
|
className: "ps-pmv-inline-input",
|
|
10612
|
-
value: W[
|
|
10616
|
+
value: W[x.key] ?? "",
|
|
10613
10617
|
placeholder: "—",
|
|
10614
|
-
onChange: (c) =>
|
|
10618
|
+
onChange: (c) => i((hA) => ({ ...hA, [x.key]: c.target.value }))
|
|
10615
10619
|
}
|
|
10616
10620
|
),
|
|
10617
10621
|
/* @__PURE__ */ A("span", { className: "ps-pmv-inline-unit", children: F })
|
|
10618
10622
|
] }) })
|
|
10619
|
-
] },
|
|
10623
|
+
] }, x.key);
|
|
10620
10624
|
}),
|
|
10621
|
-
f.gender === "female" && /* @__PURE__ */ P(
|
|
10625
|
+
f.gender === "female" && /* @__PURE__ */ P(rA, { children: [
|
|
10622
10626
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-row", children: [
|
|
10623
10627
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon" }),
|
|
10624
10628
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: r("BAND") }),
|
|
@@ -10627,10 +10631,10 @@ function A8({
|
|
|
10627
10631
|
{
|
|
10628
10632
|
className: "ps-pmv-inline-select",
|
|
10629
10633
|
value: k,
|
|
10630
|
-
onChange: (
|
|
10634
|
+
onChange: (x) => u(x.target.value),
|
|
10631
10635
|
children: [
|
|
10632
10636
|
/* @__PURE__ */ A("option", { value: "", children: "—" }),
|
|
10633
|
-
$B.map((
|
|
10637
|
+
$B.map((x) => /* @__PURE__ */ A("option", { value: x, children: x }, x))
|
|
10634
10638
|
]
|
|
10635
10639
|
}
|
|
10636
10640
|
) })
|
|
@@ -10643,10 +10647,10 @@ function A8({
|
|
|
10643
10647
|
{
|
|
10644
10648
|
className: "ps-pmv-inline-select",
|
|
10645
10649
|
value: v,
|
|
10646
|
-
onChange: (
|
|
10650
|
+
onChange: (x) => I(x.target.value),
|
|
10647
10651
|
children: [
|
|
10648
10652
|
/* @__PURE__ */ A("option", { value: "", children: "—" }),
|
|
10649
|
-
_B.map((
|
|
10653
|
+
_B.map((x) => /* @__PURE__ */ A("option", { value: x, children: x }, x))
|
|
10650
10654
|
]
|
|
10651
10655
|
}
|
|
10652
10656
|
) })
|
|
@@ -10665,7 +10669,7 @@ function A8({
|
|
|
10665
10669
|
type: "button",
|
|
10666
10670
|
className: "ps-pmv-btn-primary",
|
|
10667
10671
|
onClick: N,
|
|
10668
|
-
children: T ? r("SAVE") : /* @__PURE__ */ P(
|
|
10672
|
+
children: T ? r("SAVE") : /* @__PURE__ */ P(rA, { children: [
|
|
10669
10673
|
/* @__PURE__ */ A("span", { className: "ps-pmv-btn-spinner" }),
|
|
10670
10674
|
r("CALCULATING")
|
|
10671
10675
|
] })
|
|
@@ -10702,7 +10706,7 @@ function P8({
|
|
|
10702
10706
|
onOpenDetail: C,
|
|
10703
10707
|
t: D
|
|
10704
10708
|
}) {
|
|
10705
|
-
const
|
|
10709
|
+
const t = (() => {
|
|
10706
10710
|
const z = f.height ?? f.heightCm;
|
|
10707
10711
|
if (!z) return null;
|
|
10708
10712
|
if (f.heightUnit === "in" || f.heightUnit === "ft") {
|
|
@@ -10729,9 +10733,9 @@ function P8({
|
|
|
10729
10733
|
/* @__PURE__ */ A("div", { className: "ps-msp-card-circle", children: f.photoBase64 ? /* @__PURE__ */ A("img", { src: f.photoBase64, alt: f.name }) : /* @__PURE__ */ A(mP, { size: 32 }) }),
|
|
10730
10734
|
/* @__PURE__ */ A("div", { className: "ps-msp-card-name", children: f.name }),
|
|
10731
10735
|
/* @__PURE__ */ P("div", { className: "ps-msp-card-meta", children: [
|
|
10732
|
-
|
|
10736
|
+
t && /* @__PURE__ */ P("div", { className: "ps-msp-meta-row", children: [
|
|
10733
10737
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-label", children: D("HEIGHT") }),
|
|
10734
|
-
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children:
|
|
10738
|
+
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children: t })
|
|
10735
10739
|
] }),
|
|
10736
10740
|
o && /* @__PURE__ */ P("div", { className: "ps-msp-meta-row", children: [
|
|
10737
10741
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-label", children: D("WEIGHT") }),
|
|
@@ -10794,7 +10798,7 @@ function g8({
|
|
|
10794
10798
|
onSaveNewProfile: B,
|
|
10795
10799
|
onSaveProfileMeasurements: C,
|
|
10796
10800
|
onSaveBraSize: D,
|
|
10797
|
-
onRequestDelete:
|
|
10801
|
+
onRequestDelete: t,
|
|
10798
10802
|
onClose: o,
|
|
10799
10803
|
onPhotoPreview: r,
|
|
10800
10804
|
onEstimateFromPhoto: z,
|
|
@@ -10802,22 +10806,22 @@ function g8({
|
|
|
10802
10806
|
t: T,
|
|
10803
10807
|
onRegisterBackInterceptor: F
|
|
10804
10808
|
}) {
|
|
10805
|
-
const [h, W] = j(!1), [
|
|
10809
|
+
const [h, W] = j(!1), [i, k] = j(null), u = i && f.find((v) => v.id === i) || null;
|
|
10806
10810
|
return JA(() => {
|
|
10807
|
-
|
|
10808
|
-
}, [f,
|
|
10811
|
+
i && !f.find((v) => v.id === i) && k(null);
|
|
10812
|
+
}, [f, i]), JA(() => {
|
|
10809
10813
|
if (!F) return;
|
|
10810
|
-
F(() => h ||
|
|
10814
|
+
F(() => h || i !== null, () => {
|
|
10811
10815
|
if (h) {
|
|
10812
10816
|
W(!1);
|
|
10813
10817
|
return;
|
|
10814
10818
|
}
|
|
10815
|
-
if (
|
|
10819
|
+
if (i !== null) {
|
|
10816
10820
|
k(null);
|
|
10817
10821
|
return;
|
|
10818
10822
|
}
|
|
10819
10823
|
});
|
|
10820
|
-
}, [h,
|
|
10824
|
+
}, [h, i, F]), /* @__PURE__ */ A("div", { className: "ps-msp-root", children: /* @__PURE__ */ A("div", { className: "ps-msp-scroll", children: u ? /* @__PURE__ */ A(
|
|
10821
10825
|
A8,
|
|
10822
10826
|
{
|
|
10823
10827
|
profile: u,
|
|
@@ -10828,7 +10832,7 @@ function g8({
|
|
|
10828
10832
|
},
|
|
10829
10833
|
onSaveMeasurements: (v, I) => C(u.id, v, I),
|
|
10830
10834
|
onSaveBraSize: D ? (v, I) => D(u.id, v, I) : void 0,
|
|
10831
|
-
onDelete: () =>
|
|
10835
|
+
onDelete: () => t(u.id),
|
|
10832
10836
|
onBack: () => k(null),
|
|
10833
10837
|
onSave: () => k(null),
|
|
10834
10838
|
t: T
|
|
@@ -10841,9 +10845,9 @@ function g8({
|
|
|
10841
10845
|
let I = null;
|
|
10842
10846
|
if (typeof window < "u")
|
|
10843
10847
|
try {
|
|
10844
|
-
const
|
|
10845
|
-
if (
|
|
10846
|
-
const N = JSON.parse(
|
|
10848
|
+
const K = localStorage.getItem("primestyle_profiles");
|
|
10849
|
+
if (K) {
|
|
10850
|
+
const N = JSON.parse(K);
|
|
10847
10851
|
N.length > 0 && (I = N[0].id ?? null);
|
|
10848
10852
|
}
|
|
10849
10853
|
} catch {
|
|
@@ -10855,7 +10859,7 @@ function g8({
|
|
|
10855
10859
|
onEstimate: z,
|
|
10856
10860
|
t: T
|
|
10857
10861
|
}
|
|
10858
|
-
) : /* @__PURE__ */ P(
|
|
10862
|
+
) : /* @__PURE__ */ P(rA, { children: [
|
|
10859
10863
|
/* @__PURE__ */ P("div", { className: "ps-msp-header", children: [
|
|
10860
10864
|
/* @__PURE__ */ A("h2", { className: "ps-msp-title", children: T("My Sizing Profiles") }),
|
|
10861
10865
|
/* @__PURE__ */ A("p", { className: "ps-msp-subtitle", children: T("Manage your bespoke silhouettes. Switch between profiles for different fits or create a new one for specific garment types.") })
|
|
@@ -10869,7 +10873,7 @@ function g8({
|
|
|
10869
10873
|
isActive: v.id === n,
|
|
10870
10874
|
onSelect: () => g(v.id),
|
|
10871
10875
|
onEdit: () => k(v.id),
|
|
10872
|
-
onDelete: () =>
|
|
10876
|
+
onDelete: () => t(v.id),
|
|
10873
10877
|
onOpenDetail: () => k(v.id),
|
|
10874
10878
|
t: T
|
|
10875
10879
|
},
|
|
@@ -10909,7 +10913,7 @@ function w8({
|
|
|
10909
10913
|
setHeight: B,
|
|
10910
10914
|
heightFeet: C,
|
|
10911
10915
|
setHeightFeet: D,
|
|
10912
|
-
heightInches:
|
|
10916
|
+
heightInches: t,
|
|
10913
10917
|
setHeightInches: o,
|
|
10914
10918
|
weight: r,
|
|
10915
10919
|
setWeight: z,
|
|
@@ -10918,24 +10922,24 @@ function w8({
|
|
|
10918
10922
|
switchToMetric: F,
|
|
10919
10923
|
switchToImperial: h,
|
|
10920
10924
|
onUploadPhoto: W,
|
|
10921
|
-
onSwitchToScan:
|
|
10925
|
+
onSwitchToScan: i,
|
|
10922
10926
|
onNext: k,
|
|
10923
10927
|
canProceed: u,
|
|
10924
10928
|
fastPathLabel: v,
|
|
10925
10929
|
activeProfileName: I,
|
|
10926
|
-
onStartFresh:
|
|
10930
|
+
onStartFresh: K,
|
|
10927
10931
|
hidePhotoOptions: N = !1,
|
|
10928
|
-
error:
|
|
10932
|
+
error: x,
|
|
10929
10933
|
t: E
|
|
10930
10934
|
}) {
|
|
10931
|
-
const BA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(
|
|
10935
|
+
const BA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(t) || 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, EA = 13, ZA = 100, Hf = (BA - s) / (PA - s) * 100, m = (c - RA) / (mA - RA) * 100, aA = (y - sA) / (V - sA) * 100, TA = (XA - EA) / (ZA - EA) * 100, bA = (nf) => {
|
|
10932
10936
|
const xA = Math.max(RA, Math.min(mA, nf));
|
|
10933
10937
|
D(String(Math.floor(xA / 12))), o(String(xA % 12));
|
|
10934
10938
|
}, VA = () => {
|
|
10935
10939
|
f === "in" ? bA(c + 1) : B(String(Math.min(PA, BA + 1)));
|
|
10936
10940
|
}, kA = () => {
|
|
10937
10941
|
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))),
|
|
10942
|
+
}, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA, XA + 1))), iA = () => T(String(Math.max(EA, XA - 1)));
|
|
10939
10943
|
return /* @__PURE__ */ P("div", { className: "ps-bpm-root", children: [
|
|
10940
10944
|
/* @__PURE__ */ P("div", { className: "ps-bpm-header", children: [
|
|
10941
10945
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: E("Body Measurements") }),
|
|
@@ -10945,9 +10949,9 @@ function w8({
|
|
|
10945
10949
|
E("Using"),
|
|
10946
10950
|
" ",
|
|
10947
10951
|
/* @__PURE__ */ A("strong", { children: I }),
|
|
10948
|
-
|
|
10952
|
+
K && /* @__PURE__ */ P(rA, { children: [
|
|
10949
10953
|
" · ",
|
|
10950
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick:
|
|
10954
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: K, children: E("start fresh") })
|
|
10951
10955
|
] })
|
|
10952
10956
|
] }),
|
|
10953
10957
|
/* @__PURE__ */ P("div", { className: "ps-bpm-toggle", children: [
|
|
@@ -11027,7 +11031,7 @@ function w8({
|
|
|
11027
11031
|
step: 1,
|
|
11028
11032
|
value: y,
|
|
11029
11033
|
onChange: (nf) => z(nf.target.value),
|
|
11030
|
-
style: { "--ps-pct": `${
|
|
11034
|
+
style: { "--ps-pct": `${aA}%` }
|
|
11031
11035
|
}
|
|
11032
11036
|
),
|
|
11033
11037
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: vA, "aria-label": E("Increase"), children: /* @__PURE__ */ A(KP, {}) })
|
|
@@ -11043,13 +11047,13 @@ function w8({
|
|
|
11043
11047
|
] })
|
|
11044
11048
|
] }),
|
|
11045
11049
|
/* @__PURE__ */ P("div", { className: "ps-bpm-slider-row", children: [
|
|
11046
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick:
|
|
11050
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: iA, "aria-label": E("Decrease"), children: /* @__PURE__ */ A(OP, {}) }),
|
|
11047
11051
|
/* @__PURE__ */ A(
|
|
11048
11052
|
"input",
|
|
11049
11053
|
{
|
|
11050
11054
|
type: "range",
|
|
11051
11055
|
className: "ps-bpm-slider",
|
|
11052
|
-
min:
|
|
11056
|
+
min: EA,
|
|
11053
11057
|
max: ZA,
|
|
11054
11058
|
step: 1,
|
|
11055
11059
|
value: XA,
|
|
@@ -11061,7 +11065,7 @@ function w8({
|
|
|
11061
11065
|
] })
|
|
11062
11066
|
] })
|
|
11063
11067
|
] }),
|
|
11064
|
-
!N && /* @__PURE__ */ P(
|
|
11068
|
+
!N && /* @__PURE__ */ P(rA, { children: [
|
|
11065
11069
|
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: E("or") }) }),
|
|
11066
11070
|
/* @__PURE__ */ P(
|
|
11067
11071
|
"button",
|
|
@@ -11077,7 +11081,7 @@ function w8({
|
|
|
11077
11081
|
}
|
|
11078
11082
|
)
|
|
11079
11083
|
] }),
|
|
11080
|
-
|
|
11084
|
+
x && /* @__PURE__ */ A("p", { className: "ps-bpm-error", children: x }),
|
|
11081
11085
|
/* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
|
|
11082
11086
|
/* @__PURE__ */ P("div", { className: "ps-bpm-bottom", children: [
|
|
11083
11087
|
/* @__PURE__ */ A(
|
|
@@ -11096,7 +11100,7 @@ function w8({
|
|
|
11096
11100
|
mode: "manual",
|
|
11097
11101
|
onSwitchToManual: () => {
|
|
11098
11102
|
},
|
|
11099
|
-
onSwitchToScan:
|
|
11103
|
+
onSwitchToScan: i,
|
|
11100
11104
|
t: E
|
|
11101
11105
|
}
|
|
11102
11106
|
)
|
|
@@ -11127,13 +11131,13 @@ function Zn({
|
|
|
11127
11131
|
onSwitchToManual: B,
|
|
11128
11132
|
error: C,
|
|
11129
11133
|
photoVariant: D = "full-body",
|
|
11130
|
-
photoStepHeight:
|
|
11134
|
+
photoStepHeight: t,
|
|
11131
11135
|
onPhotoStepHeightChange: o,
|
|
11132
11136
|
ageConfirmed: r,
|
|
11133
11137
|
onAgeConfirmedChange: z,
|
|
11134
11138
|
t: p
|
|
11135
11139
|
}) {
|
|
11136
|
-
const T = D === "close-up", F =
|
|
11140
|
+
const T = D === "close-up", F = tA(null), h = !!f, W = !h && r !== !0;
|
|
11137
11141
|
return /* @__PURE__ */ P("div", { className: "ps-pm-root", children: [
|
|
11138
11142
|
/* @__PURE__ */ P("div", { className: "ps-pm-header", children: [
|
|
11139
11143
|
/* @__PURE__ */ A("h2", { className: "ps-pm-title", children: p(T ? "Upload a face photo or selfie" : "Review your photo") }),
|
|
@@ -11149,7 +11153,7 @@ function Zn({
|
|
|
11149
11153
|
style: { display: "none" }
|
|
11150
11154
|
}
|
|
11151
11155
|
),
|
|
11152
|
-
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: h ? /* @__PURE__ */ P(
|
|
11156
|
+
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: h ? /* @__PURE__ */ P(rA, { children: [
|
|
11153
11157
|
/* @__PURE__ */ A("img", { src: f, alt: p("Your photo"), className: "ps-pm-preview-img" }),
|
|
11154
11158
|
/* @__PURE__ */ A(
|
|
11155
11159
|
"button",
|
|
@@ -11161,7 +11165,7 @@ function Zn({
|
|
|
11161
11165
|
children: /* @__PURE__ */ A(C8, {})
|
|
11162
11166
|
}
|
|
11163
11167
|
)
|
|
11164
|
-
] }) : /* @__PURE__ */ P(
|
|
11168
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
11165
11169
|
/* @__PURE__ */ P(
|
|
11166
11170
|
"button",
|
|
11167
11171
|
{
|
|
@@ -11205,11 +11209,11 @@ function Zn({
|
|
|
11205
11209
|
/* @__PURE__ */ A("div", { className: "ps-pm-checklist-icon", children: /* @__PURE__ */ A(D8, {}) }),
|
|
11206
11210
|
/* @__PURE__ */ P("div", { className: "ps-pm-checklist-body", children: [
|
|
11207
11211
|
/* @__PURE__ */ A("div", { className: "ps-pm-checklist-title", children: p("Checklist for accuracy") }),
|
|
11208
|
-
/* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: T ? /* @__PURE__ */ P(
|
|
11212
|
+
/* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: T ? /* @__PURE__ */ P(rA, { children: [
|
|
11209
11213
|
/* @__PURE__ */ A("li", { children: p("Face the camera directly at eye level") }),
|
|
11210
11214
|
/* @__PURE__ */ A("li", { children: p("Keep hair away from face and ears") }),
|
|
11211
11215
|
/* @__PURE__ */ A("li", { children: p("Good lighting, plain background") })
|
|
11212
|
-
] }) : /* @__PURE__ */ P(
|
|
11216
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
11213
11217
|
/* @__PURE__ */ A("li", { children: p("Form-fitting clothing is recommended") }),
|
|
11214
11218
|
/* @__PURE__ */ A("li", { children: p("Standing 2-3 meters from camera") }),
|
|
11215
11219
|
/* @__PURE__ */ A("li", { children: p("Neutral background with good lighting") })
|
|
@@ -11269,14 +11273,14 @@ function iP({
|
|
|
11269
11273
|
String(n).padStart(2, "0")
|
|
11270
11274
|
] }),
|
|
11271
11275
|
/* @__PURE__ */ A("h2", { className: "ps-bsm-question", children: g }),
|
|
11272
|
-
/* @__PURE__ */ A("div", { className: "ps-bsm-options-center", children: /* @__PURE__ */ A("div", { className: "ps-bsm-options", children: e.map((
|
|
11273
|
-
const r = B ===
|
|
11276
|
+
/* @__PURE__ */ A("div", { className: "ps-bsm-options-center", children: /* @__PURE__ */ A("div", { className: "ps-bsm-options", children: e.map((t, o) => {
|
|
11277
|
+
const r = B === t.value, z = String.fromCharCode(65 + o);
|
|
11274
11278
|
return /* @__PURE__ */ P(
|
|
11275
11279
|
"button",
|
|
11276
11280
|
{
|
|
11277
11281
|
type: "button",
|
|
11278
11282
|
className: `ps-bsm-card${r ? " ps-active" : ""}`,
|
|
11279
|
-
onClick: () => C(
|
|
11283
|
+
onClick: () => C(t.value),
|
|
11280
11284
|
children: [
|
|
11281
11285
|
/* @__PURE__ */ P("div", { className: "ps-bsm-card-content", children: [
|
|
11282
11286
|
/* @__PURE__ */ P("span", { className: "ps-bsm-card-eyebrow", children: [
|
|
@@ -11284,12 +11288,12 @@ function iP({
|
|
|
11284
11288
|
" ",
|
|
11285
11289
|
z
|
|
11286
11290
|
] }),
|
|
11287
|
-
/* @__PURE__ */ A("span", { className: "ps-bsm-card-label", children:
|
|
11291
|
+
/* @__PURE__ */ A("span", { className: "ps-bsm-card-label", children: t.label.toUpperCase() })
|
|
11288
11292
|
] }),
|
|
11289
|
-
|
|
11293
|
+
t.img && /* @__PURE__ */ A("div", { className: "ps-bsm-card-thumb", children: /* @__PURE__ */ A("img", { src: t.img, alt: t.label }) })
|
|
11290
11294
|
]
|
|
11291
11295
|
},
|
|
11292
|
-
|
|
11296
|
+
t.value
|
|
11293
11297
|
);
|
|
11294
11298
|
}) }) })
|
|
11295
11299
|
] });
|
|
@@ -11367,8 +11371,8 @@ function H8(f, n, g) {
|
|
|
11367
11371
|
return { cm: Math.round(D), inch: Math.round(D / 2.54) };
|
|
11368
11372
|
}
|
|
11369
11373
|
if (g === "IT") {
|
|
11370
|
-
const
|
|
11371
|
-
return { cm: Math.round(
|
|
11374
|
+
const t = 60 + B * 5 + e * 2.54;
|
|
11375
|
+
return { cm: Math.round(t), inch: Math.round(t / 2.54) };
|
|
11372
11376
|
}
|
|
11373
11377
|
const C = B + e;
|
|
11374
11378
|
return { cm: Math.round(C * 2.54), inch: Math.round(C) };
|
|
@@ -11381,7 +11385,7 @@ function z8({
|
|
|
11381
11385
|
sizingCountry: B,
|
|
11382
11386
|
heightUnit: C,
|
|
11383
11387
|
setHeightUnit: D,
|
|
11384
|
-
weightUnit:
|
|
11388
|
+
weightUnit: t,
|
|
11385
11389
|
setWeightUnit: o,
|
|
11386
11390
|
sizingUnit: r,
|
|
11387
11391
|
setSizingUnit: z,
|
|
@@ -11390,18 +11394,18 @@ function z8({
|
|
|
11390
11394
|
hasActiveProfileWithMeasurements: F = !1,
|
|
11391
11395
|
onUseActiveProfile: h,
|
|
11392
11396
|
activeProfileName: W,
|
|
11393
|
-
onStartFresh:
|
|
11397
|
+
onStartFresh: i,
|
|
11394
11398
|
activeProfile: k,
|
|
11395
11399
|
onBack: u,
|
|
11396
11400
|
t: v
|
|
11397
11401
|
}) {
|
|
11398
|
-
const I = g ? r8 : t8, [
|
|
11399
|
-
|
|
11400
|
-
const
|
|
11402
|
+
const I = g ? r8 : t8, [K, N] = j("basics");
|
|
11403
|
+
K === "photo" || I.indexOf(K);
|
|
11404
|
+
const x = 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, EA] = j(XA), [ZA, Hf] = j(V), [m, aA] = j(s), [TA, bA] = j(PA), [VA, kA] = j(RA), [vA, SA] = j(
|
|
11401
11405
|
l || (C === "ft" ? "in" : C || (E ? "in" : "cm"))
|
|
11402
|
-
), [ff,
|
|
11403
|
-
y ||
|
|
11404
|
-
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf =
|
|
11406
|
+
), [ff, iA] = j(
|
|
11407
|
+
y || t || (E ? "lbs" : "kg")
|
|
11408
|
+
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = tA(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), [wf, 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), O = pn[AA] || pn.US, [q, QA] = j(""), U = UA(async (M) => {
|
|
11405
11409
|
const cA = M.target.files?.[0];
|
|
11406
11410
|
if (!cA) return;
|
|
11407
11411
|
if (qA !== !0) {
|
|
@@ -11454,17 +11458,17 @@ function z8({
|
|
|
11454
11458
|
} else
|
|
11455
11459
|
M = parseFloat(mA);
|
|
11456
11460
|
return { heightVal: M, weightVal: parseFloat(TA) };
|
|
11457
|
-
},
|
|
11461
|
+
}, dA = g ? "female" : "male", fA = (M) => {
|
|
11458
11462
|
const cA = I.indexOf(M);
|
|
11459
11463
|
return cA < I.length - 1 ? I[cA + 1] : "submit";
|
|
11460
11464
|
}, NA = () => {
|
|
11461
11465
|
const { heightVal: M, weightVal: cA } = S();
|
|
11462
|
-
e.current.height = String(M), e.current.weight = String(cA), e.current.gender =
|
|
11466
|
+
e.current.height = String(M), e.current.weight = String(cA), e.current.gender = dA, VA && (e.current.age = VA), D(vA), o(ff), p({
|
|
11463
11467
|
height: M,
|
|
11464
11468
|
weight: cA,
|
|
11465
11469
|
heightUnit: vA,
|
|
11466
11470
|
weightUnit: ff,
|
|
11467
|
-
gender:
|
|
11471
|
+
gender: dA,
|
|
11468
11472
|
age: VA ? parseInt(VA, 10) : void 0,
|
|
11469
11473
|
chestProfile: WA || void 0,
|
|
11470
11474
|
midsectionProfile: X,
|
|
@@ -11474,30 +11478,30 @@ function z8({
|
|
|
11474
11478
|
cupSize: FA || void 0
|
|
11475
11479
|
});
|
|
11476
11480
|
}, $A = UA(() => {
|
|
11477
|
-
if (
|
|
11481
|
+
if (K === "basics") {
|
|
11478
11482
|
if (!G()) return;
|
|
11479
11483
|
N(fA("basics"));
|
|
11480
|
-
} else if (
|
|
11484
|
+
} else if (K === "chest") {
|
|
11481
11485
|
if (!WA) return;
|
|
11482
11486
|
N(fA("chest"));
|
|
11483
|
-
} else if (
|
|
11487
|
+
} else if (K === "midsection") {
|
|
11484
11488
|
if (!X) return;
|
|
11485
11489
|
N(fA("midsection"));
|
|
11486
|
-
} else if (
|
|
11490
|
+
} else if (K === "seat") {
|
|
11487
11491
|
if (!zA) return;
|
|
11488
11492
|
const M = fA("seat");
|
|
11489
11493
|
M === "submit" ? NA() : N(M);
|
|
11490
|
-
} else if (
|
|
11494
|
+
} else if (K === "hips") {
|
|
11491
11495
|
if (!H) return;
|
|
11492
11496
|
const M = fA("hips");
|
|
11493
11497
|
M === "submit" ? NA() : N(M);
|
|
11494
|
-
} else if (
|
|
11498
|
+
} else if (K === "bra") {
|
|
11495
11499
|
if (!gA || !FA) {
|
|
11496
11500
|
QA(v("Please select both band and cup size"));
|
|
11497
11501
|
return;
|
|
11498
11502
|
}
|
|
11499
11503
|
QA(""), NA();
|
|
11500
|
-
} else if (
|
|
11504
|
+
} else if (K === "photo") {
|
|
11501
11505
|
if (!_A || !xA) {
|
|
11502
11506
|
if (F && h) {
|
|
11503
11507
|
h();
|
|
@@ -11513,23 +11517,23 @@ function z8({
|
|
|
11513
11517
|
weight: 0,
|
|
11514
11518
|
heightUnit: vA,
|
|
11515
11519
|
weightUnit: ff,
|
|
11516
|
-
gender:
|
|
11520
|
+
gender: dA
|
|
11517
11521
|
});
|
|
11518
11522
|
}
|
|
11519
|
-
}, [
|
|
11523
|
+
}, [K, I, G, WA, X, H, zA, gA, FA, vA, ff, mA, ZA, m, TA, VA, _A, xA, _, e, D, o, p, T, g, dA, F, h]), ef = (M) => {
|
|
11520
11524
|
const cA = I.indexOf(M);
|
|
11521
11525
|
return cA > 0 ? I[cA - 1] : null;
|
|
11522
11526
|
}, yA = UA(() => {
|
|
11523
|
-
if (QA(""),
|
|
11527
|
+
if (QA(""), K === "basics")
|
|
11524
11528
|
u();
|
|
11525
|
-
else if (
|
|
11529
|
+
else if (K === "photo")
|
|
11526
11530
|
N("basics");
|
|
11527
11531
|
else {
|
|
11528
|
-
const M = ef(
|
|
11532
|
+
const M = ef(K);
|
|
11529
11533
|
M ? N(M) : u();
|
|
11530
11534
|
}
|
|
11531
|
-
}, [
|
|
11532
|
-
return
|
|
11535
|
+
}, [K, I, u]), KA = K === "basics" ? !0 : K === "chest" ? !!WA : K === "midsection" ? !!X : K === "seat" ? !!zA : K === "hips" ? !!H : K === "bra" ? !!(gA && FA) : K === "photo", Df = K === I[I.length - 1];
|
|
11536
|
+
return K === "photo" ? x ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
11533
11537
|
Zn,
|
|
11534
11538
|
{
|
|
11535
11539
|
photoPreview: eA,
|
|
@@ -11573,12 +11577,12 @@ function z8({
|
|
|
11573
11577
|
userSelect: !eA && qA !== !0 ? "none" : void 0
|
|
11574
11578
|
},
|
|
11575
11579
|
"aria-hidden": !eA && qA !== !0,
|
|
11576
|
-
children: eA ? /* @__PURE__ */ P(
|
|
11580
|
+
children: eA ? /* @__PURE__ */ P(rA, { children: [
|
|
11577
11581
|
/* @__PURE__ */ A("img", { src: eA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
11578
11582
|
/* @__PURE__ */ A("button", { onClick: (M) => {
|
|
11579
11583
|
M.stopPropagation(), R();
|
|
11580
11584
|
}, 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: "×" })
|
|
11581
|
-
] }) : /* @__PURE__ */ P(
|
|
11585
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
11582
11586
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
11583
11587
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: v("Upload your photo") }),
|
|
11584
11588
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: v("Click or drag a full-body photo") }),
|
|
@@ -11787,7 +11791,7 @@ function z8({
|
|
|
11787
11791
|
] })
|
|
11788
11792
|
] }),
|
|
11789
11793
|
/* @__PURE__ */ A("input", { ref: gf, type: "file", accept: "image/*", onChange: U, style: { display: "none" } }),
|
|
11790
|
-
|
|
11794
|
+
x ? /* @__PURE__ */ P(rA, { children: [
|
|
11791
11795
|
/* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
|
|
11792
11796
|
/* @__PURE__ */ P("div", { className: "ps-bpm-bottom", children: [
|
|
11793
11797
|
/* @__PURE__ */ A(
|
|
@@ -11840,32 +11844,32 @@ function z8({
|
|
|
11840
11844
|
}
|
|
11841
11845
|
),
|
|
11842
11846
|
/* @__PURE__ */ P("div", { className: "ps-bp-root", children: [
|
|
11843
|
-
|
|
11847
|
+
K === "basics" && (() => {
|
|
11844
11848
|
const M = () => {
|
|
11845
11849
|
if (vA === "in") {
|
|
11846
11850
|
const pA = (parseFloat(ZA) || 5) * 12 + (parseFloat(m) || 8);
|
|
11847
|
-
|
|
11851
|
+
EA(String(Math.round(pA * 2.54)));
|
|
11848
11852
|
}
|
|
11849
|
-
ff === "lbs" && TA && bA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"),
|
|
11853
|
+
ff === "lbs" && TA && bA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"), iA("kg"), D("cm"), o("kg"), z?.("cm");
|
|
11850
11854
|
}, cA = () => {
|
|
11851
11855
|
if (vA === "cm") {
|
|
11852
11856
|
const pA = parseFloat(mA) || 173, tf = Math.round(pA / 2.54);
|
|
11853
|
-
Hf(String(Math.floor(tf / 12))),
|
|
11857
|
+
Hf(String(Math.floor(tf / 12))), aA(String(tf % 12));
|
|
11854
11858
|
}
|
|
11855
|
-
ff === "kg" && TA && bA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"),
|
|
11859
|
+
ff === "kg" && TA && bA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"), iA("lbs"), D("in"), o("lbs"), z?.("in");
|
|
11856
11860
|
};
|
|
11857
|
-
return
|
|
11861
|
+
return x ? /* @__PURE__ */ A(
|
|
11858
11862
|
w8,
|
|
11859
11863
|
{
|
|
11860
11864
|
hUnit: vA,
|
|
11861
11865
|
wUnit: ff,
|
|
11862
11866
|
isImperialMode: nf,
|
|
11863
11867
|
height: mA,
|
|
11864
|
-
setHeight:
|
|
11868
|
+
setHeight: EA,
|
|
11865
11869
|
heightFeet: ZA,
|
|
11866
11870
|
setHeightFeet: Hf,
|
|
11867
11871
|
heightInches: m,
|
|
11868
|
-
setHeightInches:
|
|
11872
|
+
setHeightInches: aA,
|
|
11869
11873
|
weight: TA,
|
|
11870
11874
|
setWeight: bA,
|
|
11871
11875
|
age: VA,
|
|
@@ -11879,7 +11883,7 @@ function z8({
|
|
|
11879
11883
|
canProceed: !0,
|
|
11880
11884
|
fastPathLabel: F ? v("Find My Best Fit") + (xf(vA) ? ` (${xf(vA)})` : "") : void 0,
|
|
11881
11885
|
activeProfileName: F ? W : null,
|
|
11882
|
-
onStartFresh:
|
|
11886
|
+
onStartFresh: i,
|
|
11883
11887
|
error: q,
|
|
11884
11888
|
t: v
|
|
11885
11889
|
},
|
|
@@ -11890,9 +11894,9 @@ function z8({
|
|
|
11890
11894
|
v("Using"),
|
|
11891
11895
|
" ",
|
|
11892
11896
|
/* @__PURE__ */ A("strong", { children: W }),
|
|
11893
|
-
|
|
11897
|
+
i && /* @__PURE__ */ P(rA, { children: [
|
|
11894
11898
|
" · ",
|
|
11895
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick:
|
|
11899
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: i, children: v("start fresh") })
|
|
11896
11900
|
] })
|
|
11897
11901
|
] }),
|
|
11898
11902
|
/* @__PURE__ */ P("div", { className: "ps-bp-system-toggle", children: [
|
|
@@ -11905,10 +11909,10 @@ function z8({
|
|
|
11905
11909
|
vA === "in" ? /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11906
11910
|
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: ZA, onChange: (pA) => Hf(pA.target.value), min: 3, max: 8 }),
|
|
11907
11911
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
11908
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: m, onChange: (pA) =>
|
|
11912
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: m, onChange: (pA) => aA(pA.target.value), min: 0, max: 11 }),
|
|
11909
11913
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
11910
11914
|
] }) : /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11911
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (pA) =>
|
|
11915
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (pA) => EA(pA.target.value), min: 100, max: 250 }),
|
|
11912
11916
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
11913
11917
|
] })
|
|
11914
11918
|
] }),
|
|
@@ -11935,7 +11939,7 @@ function z8({
|
|
|
11935
11939
|
q && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: q })
|
|
11936
11940
|
] }, "step-basics");
|
|
11937
11941
|
})(),
|
|
11938
|
-
|
|
11942
|
+
K === "chest" && !g && (x ? /* @__PURE__ */ A(
|
|
11939
11943
|
iP,
|
|
11940
11944
|
{
|
|
11941
11945
|
stepNumber: I.indexOf("chest") + 1,
|
|
@@ -11958,9 +11962,9 @@ function z8({
|
|
|
11958
11962
|
/* @__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
11963
|
/* @__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("") })
|
|
11960
11964
|
] }),
|
|
11961
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
11965
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
|
|
11962
11966
|
] }, "step-chest")),
|
|
11963
|
-
|
|
11967
|
+
K === "midsection" && (x ? /* @__PURE__ */ A(
|
|
11964
11968
|
iP,
|
|
11965
11969
|
{
|
|
11966
11970
|
stepNumber: I.indexOf("midsection") + 1,
|
|
@@ -11982,18 +11986,18 @@ function z8({
|
|
|
11982
11986
|
"step-midsection-mobile"
|
|
11983
11987
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
11984
11988
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your midsection?") }),
|
|
11985
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(
|
|
11989
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(rA, { children: [
|
|
11986
11990
|
/* @__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
11991
|
/* @__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
11992
|
/* @__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("") })
|
|
11989
|
-
] }) : /* @__PURE__ */ P(
|
|
11993
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
11990
11994
|
/* @__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
11995
|
/* @__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
11996
|
/* @__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("") })
|
|
11993
11997
|
] }) }),
|
|
11994
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
11998
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
|
|
11995
11999
|
] }, "step-midsection")),
|
|
11996
|
-
|
|
12000
|
+
K === "seat" && (x ? /* @__PURE__ */ A(
|
|
11997
12001
|
iP,
|
|
11998
12002
|
{
|
|
11999
12003
|
stepNumber: I.indexOf("seat") + 1,
|
|
@@ -12015,18 +12019,18 @@ function z8({
|
|
|
12015
12019
|
"step-seat-mobile"
|
|
12016
12020
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12017
12021
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your seat?") }),
|
|
12018
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(
|
|
12022
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(rA, { children: [
|
|
12019
12023
|
/* @__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
12024
|
/* @__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
12025
|
/* @__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("") })
|
|
12022
|
-
] }) : /* @__PURE__ */ P(
|
|
12026
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
12023
12027
|
/* @__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
12028
|
/* @__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
12029
|
/* @__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("") })
|
|
12026
12030
|
] }) }),
|
|
12027
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12031
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
|
|
12028
12032
|
] }, "step-seat")),
|
|
12029
|
-
|
|
12033
|
+
K === "hips" && g && (x ? /* @__PURE__ */ A(
|
|
12030
12034
|
iP,
|
|
12031
12035
|
{
|
|
12032
12036
|
stepNumber: I.indexOf("hips") + 1,
|
|
@@ -12049,9 +12053,9 @@ function z8({
|
|
|
12049
12053
|
/* @__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
12054
|
/* @__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("") })
|
|
12051
12055
|
] }),
|
|
12052
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12056
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
|
|
12053
12057
|
] }, "step-hips")),
|
|
12054
|
-
|
|
12058
|
+
K === "bra" && g && /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
|
|
12055
12059
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Select your bra size") }),
|
|
12056
12060
|
/* @__PURE__ */ P("div", { className: "ps-bp-bra-section", children: [
|
|
12057
12061
|
/* @__PURE__ */ P("div", { className: "ps-bp-bra-header", children: [
|
|
@@ -12098,7 +12102,7 @@ function z8({
|
|
|
12098
12102
|
] });
|
|
12099
12103
|
})()
|
|
12100
12104
|
] }),
|
|
12101
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children:
|
|
12105
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children: O.map((M) => /* @__PURE__ */ A(
|
|
12102
12106
|
"button",
|
|
12103
12107
|
{
|
|
12104
12108
|
className: `ps-bp-bra-btn${gA === M ? " ps-bp-bra-btn-selected" : ""}`,
|
|
@@ -12124,10 +12128,10 @@ function z8({
|
|
|
12124
12128
|
] }),
|
|
12125
12129
|
q && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: q })
|
|
12126
12130
|
] }, "step-bra"),
|
|
12127
|
-
!(
|
|
12128
|
-
const M =
|
|
12131
|
+
!(x && K === "basics") && (() => {
|
|
12132
|
+
const M = K === "basics" && F && !!h, cA = M ? h : $A, pA = xf(vA) ? ` (${xf(vA)})` : "", tf = M ? v("Find My Best Fit") + pA : Df ? v("Find My Size") + pA : v("Next");
|
|
12129
12133
|
return /* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
12130
|
-
|
|
12134
|
+
K !== "basics" ? /* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: yA, type: "button", children: [
|
|
12131
12135
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
12132
12136
|
" ",
|
|
12133
12137
|
v("Back")
|
|
@@ -12161,7 +12165,7 @@ function SP({
|
|
|
12161
12165
|
disablePhotoUpload: B = !1,
|
|
12162
12166
|
productImage: C,
|
|
12163
12167
|
productTitle: D,
|
|
12164
|
-
formRef:
|
|
12168
|
+
formRef: t,
|
|
12165
12169
|
sizingUnit: o,
|
|
12166
12170
|
setSizingUnit: r,
|
|
12167
12171
|
setSizingMethod: z,
|
|
@@ -12170,46 +12174,46 @@ function SP({
|
|
|
12170
12174
|
submitSizing: F,
|
|
12171
12175
|
onSnapSubmit: h,
|
|
12172
12176
|
onBack: W,
|
|
12173
|
-
t
|
|
12177
|
+
t: i
|
|
12174
12178
|
}) {
|
|
12175
|
-
const k = e === "close-up", u = NP(), [v, I] = j("manual"), [
|
|
12179
|
+
const k = e === "close-up", u = NP(), [v, I] = j("manual"), [K, N] = j(() => {
|
|
12176
12180
|
const m = {};
|
|
12177
|
-
return n.forEach((
|
|
12178
|
-
m[
|
|
12181
|
+
return n.forEach((aA) => {
|
|
12182
|
+
m[aA.key] = t.current[aA.key] || "";
|
|
12179
12183
|
}), m;
|
|
12180
|
-
}), [
|
|
12181
|
-
const
|
|
12182
|
-
if (!
|
|
12183
|
-
const TA = URL.createObjectURL(
|
|
12184
|
-
y(
|
|
12184
|
+
}), [x, E] = j(""), BA = tA(null), [c, hA] = j(null), [l, y] = j(null), [XA, sA] = j(null), [V, s] = j(null), PA = UA(async (m) => {
|
|
12185
|
+
const aA = m.target.files?.[0];
|
|
12186
|
+
if (!aA) return;
|
|
12187
|
+
const TA = URL.createObjectURL(aA);
|
|
12188
|
+
y(aA), hA(TA);
|
|
12185
12189
|
try {
|
|
12186
|
-
const bA = await AP(
|
|
12190
|
+
const bA = await AP(aA);
|
|
12187
12191
|
sA(bA);
|
|
12188
12192
|
} catch {
|
|
12189
12193
|
}
|
|
12190
12194
|
}, []), RA = UA(() => {
|
|
12191
12195
|
c && URL.revokeObjectURL(c), y(null), hA(null), sA(null);
|
|
12192
|
-
}, [c]), mA = (m,
|
|
12193
|
-
N((TA) => ({ ...TA, [m]:
|
|
12194
|
-
},
|
|
12196
|
+
}, [c]), mA = (m, aA) => {
|
|
12197
|
+
N((TA) => ({ ...TA, [m]: aA })), E("");
|
|
12198
|
+
}, EA = () => {
|
|
12195
12199
|
const m = n[0];
|
|
12196
12200
|
if (!m) return;
|
|
12197
|
-
const
|
|
12198
|
-
if (!
|
|
12199
|
-
E(
|
|
12201
|
+
const aA = parseFloat(K[m.key] || "");
|
|
12202
|
+
if (!aA || aA <= 0) {
|
|
12203
|
+
E(i("Please enter your ") + i(m.label).toLowerCase());
|
|
12200
12204
|
return;
|
|
12201
12205
|
}
|
|
12202
12206
|
n.forEach((TA) => {
|
|
12203
|
-
const bA = parseFloat(
|
|
12204
|
-
bA > 0 && (
|
|
12205
|
-
}),
|
|
12207
|
+
const bA = parseFloat(K[TA.key] || "");
|
|
12208
|
+
bA > 0 && (t.current[TA.key] = String(bA));
|
|
12209
|
+
}), t.current.gender = t.current.gender || "male", z("exact"), p(!0), T("size-result"), F("exact");
|
|
12206
12210
|
}, ZA = () => {
|
|
12207
12211
|
if (V !== !0) {
|
|
12208
|
-
E(
|
|
12212
|
+
E(i("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
12209
12213
|
return;
|
|
12210
12214
|
}
|
|
12211
12215
|
if (!l || !XA) {
|
|
12212
|
-
E(
|
|
12216
|
+
E(i("Please upload a photo"));
|
|
12213
12217
|
return;
|
|
12214
12218
|
}
|
|
12215
12219
|
h({
|
|
@@ -12219,7 +12223,7 @@ function SP({
|
|
|
12219
12223
|
weight: 0,
|
|
12220
12224
|
heightUnit: "cm",
|
|
12221
12225
|
weightUnit: "kg",
|
|
12222
|
-
gender:
|
|
12226
|
+
gender: t.current.gender || "male"
|
|
12223
12227
|
});
|
|
12224
12228
|
}, Hf = g.find((m) => m.value === o)?.label || g[0].label;
|
|
12225
12229
|
return u && v === "photo" ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
@@ -12230,37 +12234,37 @@ function SP({
|
|
|
12230
12234
|
handleRemovePhoto: RA,
|
|
12231
12235
|
onAnalyze: ZA,
|
|
12232
12236
|
onSwitchToManual: () => I("manual"),
|
|
12233
|
-
error:
|
|
12237
|
+
error: x,
|
|
12234
12238
|
photoVariant: e,
|
|
12235
12239
|
ageConfirmed: V,
|
|
12236
12240
|
onAgeConfirmedChange: (m) => {
|
|
12237
12241
|
s(m), m === !0 && E("");
|
|
12238
12242
|
},
|
|
12239
|
-
t
|
|
12243
|
+
t: i
|
|
12240
12244
|
}
|
|
12241
12245
|
) }) : u ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ P("div", { className: "ps-bpm-root", children: [
|
|
12242
|
-
/* @__PURE__ */ A("div", { className: "ps-bpm-header", children: /* @__PURE__ */ A("h2", { className: "ps-bpm-title", children:
|
|
12246
|
+
/* @__PURE__ */ A("div", { className: "ps-bpm-header", children: /* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: i(f) }) }),
|
|
12243
12247
|
/* @__PURE__ */ A("div", { className: "ps-bpm-toggle", style: { padding: "0 4%" }, children: g.map((m) => /* @__PURE__ */ A(
|
|
12244
12248
|
"button",
|
|
12245
12249
|
{
|
|
12246
12250
|
type: "button",
|
|
12247
12251
|
className: `ps-bpm-toggle-btn${o === m.value ? " ps-bpm-toggle-active" : ""}`,
|
|
12248
12252
|
onClick: () => r(m.value),
|
|
12249
|
-
children:
|
|
12253
|
+
children: i(m.label)
|
|
12250
12254
|
},
|
|
12251
12255
|
m.value
|
|
12252
12256
|
)) }),
|
|
12253
12257
|
/* @__PURE__ */ P("div", { style: { padding: "0 4%" }, children: [
|
|
12254
12258
|
n.map((m) => /* @__PURE__ */ P("div", { className: "ps-bpm-row", children: [
|
|
12255
|
-
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children:
|
|
12259
|
+
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: i(m.label).toUpperCase() }),
|
|
12256
12260
|
/* @__PURE__ */ P("div", { className: "ps-bpm-inline-group", children: [
|
|
12257
12261
|
/* @__PURE__ */ A(
|
|
12258
12262
|
"input",
|
|
12259
12263
|
{
|
|
12260
12264
|
type: "number",
|
|
12261
12265
|
className: "ps-bpm-value-input",
|
|
12262
|
-
value:
|
|
12263
|
-
onChange: (
|
|
12266
|
+
value: K[m.key],
|
|
12267
|
+
onChange: (aA) => mA(m.key, aA.target.value),
|
|
12264
12268
|
placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
|
|
12265
12269
|
step: m.step ?? 0.5,
|
|
12266
12270
|
min: m.min,
|
|
@@ -12270,20 +12274,20 @@ function SP({
|
|
|
12270
12274
|
/* @__PURE__ */ A("span", { className: "ps-bpm-unit", children: Hf.toLowerCase() })
|
|
12271
12275
|
] })
|
|
12272
12276
|
] }, m.key)),
|
|
12273
|
-
|
|
12277
|
+
x && /* @__PURE__ */ A("p", { className: "ps-acc-error", style: { paddingTop: 8 }, children: x })
|
|
12274
12278
|
] }),
|
|
12275
12279
|
/* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 16 } }),
|
|
12276
|
-
!B && /* @__PURE__ */ P(
|
|
12277
|
-
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children:
|
|
12280
|
+
!B && /* @__PURE__ */ P(rA, { children: [
|
|
12281
|
+
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: i("or") }) }),
|
|
12278
12282
|
/* @__PURE__ */ P("button", { type: "button", className: "ps-bpm-upload-link", onClick: () => I("photo"), children: [
|
|
12279
12283
|
/* @__PURE__ */ A(Un, {}),
|
|
12280
|
-
/* @__PURE__ */ A("span", { children:
|
|
12284
|
+
/* @__PURE__ */ A("span", { children: i(k ? "Upload a close-up face photo or selfie" : "Upload a photo for AI sizing") }),
|
|
12281
12285
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: /* @__PURE__ */ A("polyline", { points: "9 18 15 12 9 6" }) })
|
|
12282
12286
|
] })
|
|
12283
12287
|
] }),
|
|
12284
12288
|
/* @__PURE__ */ P("div", { className: "ps-bpm-bottom", children: [
|
|
12285
|
-
/* @__PURE__ */ P("button", { type: "button", className: "ps-bpm-next-btn", onClick:
|
|
12286
|
-
|
|
12289
|
+
/* @__PURE__ */ P("button", { type: "button", className: "ps-bpm-next-btn", onClick: EA, children: [
|
|
12290
|
+
i("Find My Size"),
|
|
12287
12291
|
xf(o) ? ` (${xf(o)})` : "",
|
|
12288
12292
|
" ",
|
|
12289
12293
|
/* @__PURE__ */ A(_f, {})
|
|
@@ -12295,7 +12299,7 @@ function SP({
|
|
|
12295
12299
|
onSwitchToManual: () => {
|
|
12296
12300
|
},
|
|
12297
12301
|
onSwitchToScan: () => I("photo"),
|
|
12298
|
-
t
|
|
12302
|
+
t: i
|
|
12299
12303
|
}
|
|
12300
12304
|
)
|
|
12301
12305
|
] })
|
|
@@ -12328,15 +12332,15 @@ function SP({
|
|
|
12328
12332
|
filter: !c && V !== !0 ? "blur(6px) saturate(0.7)" : void 0,
|
|
12329
12333
|
pointerEvents: !c && V !== !0 ? "none" : void 0
|
|
12330
12334
|
},
|
|
12331
|
-
children: c ? /* @__PURE__ */ P(
|
|
12335
|
+
children: c ? /* @__PURE__ */ P(rA, { children: [
|
|
12332
12336
|
/* @__PURE__ */ A("img", { src: c, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
12333
12337
|
/* @__PURE__ */ A("button", { onClick: (m) => {
|
|
12334
12338
|
m.stopPropagation(), RA();
|
|
12335
12339
|
}, 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: "×" })
|
|
12336
|
-
] }) : /* @__PURE__ */ P(
|
|
12340
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
12337
12341
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
12338
|
-
/* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children:
|
|
12339
|
-
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children:
|
|
12342
|
+
/* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: i(k ? "Upload close-up photo" : "Upload your photo") }),
|
|
12343
|
+
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: i(k ? "Click or drag a close-up face photo" : "Click or drag a full-body photo") }),
|
|
12340
12344
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.5vw", color: "var(--ps-text-dim)", marginTop: "0.4vw" }, children: "JPEG, PNG (max 10MB)" })
|
|
12341
12345
|
] })
|
|
12342
12346
|
}
|
|
@@ -12372,8 +12376,8 @@ function SP({
|
|
|
12372
12376
|
textAlign: "center",
|
|
12373
12377
|
gap: "0.75vw"
|
|
12374
12378
|
}, children: [
|
|
12375
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.62vw", fontWeight: 700, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--ps-accent)" }, children:
|
|
12376
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.95vw", fontWeight: 600, lineHeight: 1.35, color: "var(--ps-text-primary)" }, children:
|
|
12379
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.62vw", fontWeight: 700, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--ps-accent)" }, children: i("AGE VERIFICATION") }),
|
|
12380
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.95vw", fontWeight: 600, lineHeight: 1.35, color: "var(--ps-text-primary)" }, children: i("Is the person in this photo 18 years or older?") }),
|
|
12377
12381
|
/* @__PURE__ */ P("div", { style: { display: "flex", gap: "0.65vw", width: "100%", marginTop: "0.4vw" }, children: [
|
|
12378
12382
|
/* @__PURE__ */ A(
|
|
12379
12383
|
"button",
|
|
@@ -12394,7 +12398,7 @@ function SP({
|
|
|
12394
12398
|
fontWeight: 700,
|
|
12395
12399
|
cursor: "pointer"
|
|
12396
12400
|
},
|
|
12397
|
-
children:
|
|
12401
|
+
children: i("Yes")
|
|
12398
12402
|
}
|
|
12399
12403
|
),
|
|
12400
12404
|
/* @__PURE__ */ A(
|
|
@@ -12414,7 +12418,7 @@ function SP({
|
|
|
12414
12418
|
fontWeight: 700,
|
|
12415
12419
|
cursor: "pointer"
|
|
12416
12420
|
},
|
|
12417
|
-
children:
|
|
12421
|
+
children: i("No")
|
|
12418
12422
|
}
|
|
12419
12423
|
)
|
|
12420
12424
|
] })
|
|
@@ -12452,8 +12456,8 @@ function SP({
|
|
|
12452
12456
|
textAlign: "center",
|
|
12453
12457
|
gap: "0.75vw"
|
|
12454
12458
|
}, children: [
|
|
12455
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.62vw", fontWeight: 700, letterSpacing: "0.18em", textTransform: "uppercase", color: "#C02626" }, children:
|
|
12456
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.95vw", fontWeight: 600, lineHeight: 1.35, color: "var(--ps-text-primary)" }, children:
|
|
12459
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.62vw", fontWeight: 700, letterSpacing: "0.18em", textTransform: "uppercase", color: "#C02626" }, children: i("UPLOAD NOT ALLOWED") }),
|
|
12460
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.95vw", fontWeight: 600, lineHeight: 1.35, color: "var(--ps-text-primary)" }, children: i("For your safety, we cannot process photos of people under 18.") }),
|
|
12457
12461
|
/* @__PURE__ */ A(
|
|
12458
12462
|
"button",
|
|
12459
12463
|
{
|
|
@@ -12470,7 +12474,7 @@ function SP({
|
|
|
12470
12474
|
fontWeight: 700,
|
|
12471
12475
|
cursor: "pointer"
|
|
12472
12476
|
},
|
|
12473
|
-
children:
|
|
12477
|
+
children: i("Go back")
|
|
12474
12478
|
}
|
|
12475
12479
|
)
|
|
12476
12480
|
] })
|
|
@@ -12478,67 +12482,67 @@ function SP({
|
|
|
12478
12482
|
)
|
|
12479
12483
|
] }),
|
|
12480
12484
|
/* @__PURE__ */ P("div", { style: { flex: 1, display: "flex", flexDirection: "column", gap: "0.6vw", justifyContent: "center" }, children: [
|
|
12481
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.85vw", fontWeight: 700, color: "var(--ps-text-primary)", marginBottom: "0.3vw" }, children:
|
|
12485
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.85vw", fontWeight: 700, color: "var(--ps-text-primary)", marginBottom: "0.3vw" }, children: i("How to take the best photo") }),
|
|
12482
12486
|
/* @__PURE__ */ P("div", { style: { background: "#ddfbe7", borderRadius: "0.5vw", padding: "0.6vw 0.8vw" }, children: [
|
|
12483
12487
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.3vw", marginBottom: "0.3vw" }, children: [
|
|
12484
12488
|
/* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.75vw", fontWeight: 700 }, children: "✓" }),
|
|
12485
|
-
/* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.65vw", fontWeight: 600 }, children:
|
|
12489
|
+
/* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.65vw", fontWeight: 600 }, children: i("Do") })
|
|
12486
12490
|
] }),
|
|
12487
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(
|
|
12488
|
-
|
|
12491
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(rA, { children: [
|
|
12492
|
+
i("Face the camera directly, centered in frame"),
|
|
12489
12493
|
/* @__PURE__ */ A("br", {}),
|
|
12490
|
-
|
|
12494
|
+
i("Use natural, even lighting (e.g. near a window)"),
|
|
12491
12495
|
/* @__PURE__ */ A("br", {}),
|
|
12492
|
-
|
|
12496
|
+
i("Keep hair away from your face and ears"),
|
|
12493
12497
|
/* @__PURE__ */ A("br", {}),
|
|
12494
|
-
|
|
12498
|
+
i("Choose a plain, light background"),
|
|
12495
12499
|
/* @__PURE__ */ A("br", {}),
|
|
12496
|
-
|
|
12497
|
-
] }) : /* @__PURE__ */ P(
|
|
12498
|
-
|
|
12500
|
+
i("Hold the camera at eye level")
|
|
12501
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
12502
|
+
i("Stand facing the camera with your full body in frame"),
|
|
12499
12503
|
/* @__PURE__ */ A("br", {}),
|
|
12500
|
-
|
|
12504
|
+
i("Use natural or even lighting (e.g. near a window)"),
|
|
12501
12505
|
/* @__PURE__ */ A("br", {}),
|
|
12502
|
-
|
|
12506
|
+
i("Wear fitted, simple clothing (e.g. neutral colors)"),
|
|
12503
12507
|
/* @__PURE__ */ A("br", {}),
|
|
12504
|
-
|
|
12508
|
+
i("Choose a plain background (a light wall is ideal)"),
|
|
12505
12509
|
/* @__PURE__ */ A("br", {}),
|
|
12506
|
-
|
|
12510
|
+
i("Stand straight and still, arms relaxed by your sides")
|
|
12507
12511
|
] }) })
|
|
12508
12512
|
] }),
|
|
12509
12513
|
/* @__PURE__ */ P("div", { style: { background: "#ffe2e2", borderRadius: "0.5vw", padding: "0.6vw 0.8vw" }, children: [
|
|
12510
12514
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.3vw", marginBottom: "0.3vw" }, children: [
|
|
12511
12515
|
/* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.75vw", fontWeight: 700 }, children: "✗" }),
|
|
12512
|
-
/* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.65vw", fontWeight: 600 }, children:
|
|
12516
|
+
/* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.65vw", fontWeight: 600 }, children: i("Don't") })
|
|
12513
12517
|
] }),
|
|
12514
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(
|
|
12515
|
-
|
|
12518
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(rA, { children: [
|
|
12519
|
+
i("Don't wear sunglasses or a hat in the photo"),
|
|
12516
12520
|
/* @__PURE__ */ A("br", {}),
|
|
12517
|
-
|
|
12521
|
+
i("Don't tilt or turn your head"),
|
|
12518
12522
|
/* @__PURE__ */ A("br", {}),
|
|
12519
|
-
|
|
12523
|
+
i("Don't use strong backlighting or flash"),
|
|
12520
12524
|
/* @__PURE__ */ A("br", {}),
|
|
12521
|
-
|
|
12525
|
+
i("Don't crop out your ears or top of head"),
|
|
12522
12526
|
/* @__PURE__ */ A("br", {}),
|
|
12523
|
-
|
|
12524
|
-
] }) : /* @__PURE__ */ P(
|
|
12525
|
-
|
|
12527
|
+
i("Don't apply filters or heavy edits")
|
|
12528
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
12529
|
+
i("Don't wear loose, baggy, or layered clothing"),
|
|
12526
12530
|
/* @__PURE__ */ A("br", {}),
|
|
12527
|
-
|
|
12531
|
+
i("Don't sit, pose, or bend your body"),
|
|
12528
12532
|
/* @__PURE__ */ A("br", {}),
|
|
12529
|
-
|
|
12533
|
+
i("Don't use strong backlighting"),
|
|
12530
12534
|
/* @__PURE__ */ A("br", {}),
|
|
12531
|
-
|
|
12535
|
+
i("Don't take mirror photos or selfies"),
|
|
12532
12536
|
/* @__PURE__ */ A("br", {}),
|
|
12533
|
-
|
|
12537
|
+
i("Don't apply filters, effects, or edits")
|
|
12534
12538
|
] }) })
|
|
12535
12539
|
] }),
|
|
12536
12540
|
/* @__PURE__ */ P("div", { style: { background: "#c6e1f7", borderRadius: "0.5vw", padding: "0.6vw 0.8vw" }, children: [
|
|
12537
12541
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.3vw", marginBottom: "0.2vw" }, children: [
|
|
12538
12542
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.7vw" }, children: "💡" }),
|
|
12539
|
-
/* @__PURE__ */ A("span", { style: { color: "#3267c3", fontSize: "0.65vw", fontWeight: 600 }, children:
|
|
12543
|
+
/* @__PURE__ */ A("span", { style: { color: "#3267c3", fontSize: "0.65vw", fontWeight: 600 }, children: i("Quick Tip") })
|
|
12540
12544
|
] }),
|
|
12541
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.6 }, children:
|
|
12545
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.6 }, children: i(k ? "A clear, well-lit face photo gives the most accurate fit for eyewear and headwear." : "The simpler your photo is, the more accurate your virtual try-on results will be.") })
|
|
12542
12546
|
] }),
|
|
12543
12547
|
/* @__PURE__ */ P("div", { style: {
|
|
12544
12548
|
background: "rgba(33, 84, 239, 0.04)",
|
|
@@ -12551,22 +12555,22 @@ function SP({
|
|
|
12551
12555
|
}, children: [
|
|
12552
12556
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.35vw" }, children: [
|
|
12553
12557
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", width: "0.75vw", height: "0.75vw", fill: "none", stroke: "#2154ef", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ A("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }) }),
|
|
12554
|
-
/* @__PURE__ */ A("span", { style: { color: "#2154ef", fontSize: "0.62vw", fontWeight: 700, letterSpacing: "0.12em", textTransform: "uppercase" }, children:
|
|
12558
|
+
/* @__PURE__ */ A("span", { style: { color: "#2154ef", fontSize: "0.62vw", fontWeight: 700, letterSpacing: "0.12em", textTransform: "uppercase" }, children: i("Legal Notice") })
|
|
12555
12559
|
] }),
|
|
12556
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-secondary)", lineHeight: 1.55 }, children:
|
|
12560
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-secondary)", lineHeight: 1.55 }, children: i("Your image will be used to generate a virtual try-on preview showing how selected items may look and fit. Images are processed securely and are not stored after generation.") })
|
|
12557
12561
|
] })
|
|
12558
12562
|
] })
|
|
12559
12563
|
] }),
|
|
12560
12564
|
/* @__PURE__ */ A("input", { ref: BA, type: "file", accept: "image/*", style: { display: "none" }, onChange: PA }),
|
|
12561
|
-
|
|
12565
|
+
x && /* @__PURE__ */ A("p", { className: "ps-bp-error", style: { padding: "0 1.5vw" }, children: x }),
|
|
12562
12566
|
/* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
12563
12567
|
/* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: () => I("manual"), type: "button", children: [
|
|
12564
12568
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
12565
12569
|
" ",
|
|
12566
|
-
|
|
12570
|
+
i("Back")
|
|
12567
12571
|
] }),
|
|
12568
12572
|
/* @__PURE__ */ P("button", { className: "ps-bp-next-btn", onClick: ZA, type: "button", children: [
|
|
12569
|
-
|
|
12573
|
+
i("Analyze"),
|
|
12570
12574
|
" ",
|
|
12571
12575
|
/* @__PURE__ */ A(_f, {})
|
|
12572
12576
|
] })
|
|
@@ -12575,27 +12579,27 @@ function SP({
|
|
|
12575
12579
|
) : (
|
|
12576
12580
|
/* ── Manual step — identical structure to BodyProfileView basics step ── */
|
|
12577
12581
|
/* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter", children: [
|
|
12578
|
-
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children:
|
|
12582
|
+
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: i(f) }),
|
|
12579
12583
|
/* @__PURE__ */ A("div", { className: "ps-bp-system-toggle", children: g.map((m) => /* @__PURE__ */ A(
|
|
12580
12584
|
"button",
|
|
12581
12585
|
{
|
|
12582
12586
|
type: "button",
|
|
12583
12587
|
className: `ps-bp-system-btn${o === m.value ? " ps-bp-system-active" : ""}`,
|
|
12584
12588
|
onClick: () => r(m.value),
|
|
12585
|
-
children:
|
|
12589
|
+
children: i(m.label)
|
|
12586
12590
|
},
|
|
12587
12591
|
m.value
|
|
12588
12592
|
)) }),
|
|
12589
12593
|
/* @__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:
|
|
12594
|
+
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: i(m.label).toUpperCase() }),
|
|
12591
12595
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
12592
12596
|
/* @__PURE__ */ A(
|
|
12593
12597
|
"input",
|
|
12594
12598
|
{
|
|
12595
12599
|
type: "number",
|
|
12596
12600
|
className: "ps-bp-inline-input",
|
|
12597
|
-
value:
|
|
12598
|
-
onChange: (
|
|
12601
|
+
value: K[m.key],
|
|
12602
|
+
onChange: (aA) => mA(m.key, aA.target.value),
|
|
12599
12603
|
placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
|
|
12600
12604
|
step: m.step ?? 0.5,
|
|
12601
12605
|
min: m.min,
|
|
@@ -12605,16 +12609,16 @@ function SP({
|
|
|
12605
12609
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: Hf.toLowerCase() })
|
|
12606
12610
|
] })
|
|
12607
12611
|
] }, m.key)) }),
|
|
12608
|
-
|
|
12612
|
+
x && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: x }),
|
|
12609
12613
|
!B && /* @__PURE__ */ P("button", { className: "ps-bp-photo-cta", onClick: () => I("photo"), type: "button", children: [
|
|
12610
12614
|
/* @__PURE__ */ A(Un, {}),
|
|
12611
|
-
/* @__PURE__ */ A("span", { children:
|
|
12615
|
+
/* @__PURE__ */ A("span", { children: i(k ? "Or upload a close-up face photo or selfie" : "Or upload a photo for AI sizing") }),
|
|
12612
12616
|
/* @__PURE__ */ A("span", { className: "ps-bp-photo-cta-arrow", children: "→" })
|
|
12613
12617
|
] }),
|
|
12614
12618
|
/* @__PURE__ */ P("div", { className: "ps-bp-nav", style: { marginTop: "auto" }, children: [
|
|
12615
12619
|
/* @__PURE__ */ A("div", {}),
|
|
12616
|
-
/* @__PURE__ */ P("button", { className: "ps-bp-next-btn", onClick:
|
|
12617
|
-
|
|
12620
|
+
/* @__PURE__ */ P("button", { className: "ps-bp-next-btn", onClick: EA, type: "button", children: [
|
|
12621
|
+
i("Find My Size"),
|
|
12618
12622
|
xf(o) ? ` (${xf(o)})` : "",
|
|
12619
12623
|
" ",
|
|
12620
12624
|
/* @__PURE__ */ A(_f, {})
|
|
@@ -12640,8 +12644,8 @@ function p8(f) {
|
|
|
12640
12644
|
const n = f?.requiredFields;
|
|
12641
12645
|
if (!n || n.length === 0) return tP;
|
|
12642
12646
|
const g = /* @__PURE__ */ new Set(["size", "country", "eu", "__skip__", "shoeEU", "shoeUS", "shoeUK", "shoeJP"]), e = (C, D) => {
|
|
12643
|
-
const
|
|
12644
|
-
return
|
|
12647
|
+
const t = tP.find((r) => r.key === C);
|
|
12648
|
+
return t ? t.placeholder : /foot|length/i.test(C) || /foot|length/i.test(D) ? tP[0].placeholder : { cm: "", in: "" };
|
|
12645
12649
|
}, B = n.filter((C) => !g.has(C.key) && C.unit !== "size").map((C) => {
|
|
12646
12650
|
const D = e(C.key, C.label || "");
|
|
12647
12651
|
return {
|
|
@@ -12784,7 +12788,7 @@ function R8({
|
|
|
12784
12788
|
apiUrl: B,
|
|
12785
12789
|
showPoweredBy: C = !0,
|
|
12786
12790
|
showIcon: D = !0,
|
|
12787
|
-
buttonIcon:
|
|
12791
|
+
buttonIcon: t,
|
|
12788
12792
|
locale: o,
|
|
12789
12793
|
buttonStyles: r = {},
|
|
12790
12794
|
modalStyles: z = {},
|
|
@@ -12793,31 +12797,31 @@ function R8({
|
|
|
12793
12797
|
style: F,
|
|
12794
12798
|
onOpen: h,
|
|
12795
12799
|
onClose: W,
|
|
12796
|
-
onUpload:
|
|
12800
|
+
onUpload: i,
|
|
12797
12801
|
onProcessing: k,
|
|
12798
12802
|
onComplete: u,
|
|
12799
12803
|
onError: v,
|
|
12800
12804
|
sizeGuideData: I
|
|
12801
12805
|
}) {
|
|
12802
|
-
const
|
|
12806
|
+
const K = g || f, [N, x] = j(() => o || "");
|
|
12803
12807
|
JA(() => {
|
|
12804
|
-
o !== void 0 &&
|
|
12808
|
+
o !== void 0 && x(o);
|
|
12805
12809
|
}, [o]);
|
|
12806
|
-
const E =
|
|
12810
|
+
const E = vf(() => Hg(N || void 0), [N]), BA = e ?? E("Virtual Try-On"), [c, hA] = j(!1);
|
|
12807
12811
|
JA(() => {
|
|
12808
12812
|
hA(!0);
|
|
12809
12813
|
}, []);
|
|
12810
|
-
const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA,
|
|
12814
|
+
const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, EA] = j(null), [ZA, Hf] = j(!1), [m, aA] = j(!1), [TA, bA] = j(null), [VA, kA] = j(null), [vA, SA] = j(null), [ff, iA] = j(!1), [nf, xA] = j(!1), [Ef, eA] = j(!1), [$, _A] = j(null), [Of, cf] = j(!1), Mf = tA(!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");
|
|
12811
12815
|
JA(() => {
|
|
12812
12816
|
const w = Xf(n);
|
|
12813
12817
|
w === "foot" || w === "head" ? uA("cm") : w === "face" && uA("mm");
|
|
12814
12818
|
}, [n]);
|
|
12815
|
-
const H =
|
|
12816
|
-
|
|
12817
|
-
}, []), [S,
|
|
12819
|
+
const H = tA({}), [oA, zA] = j("male"), [YA, wf] = j(0), [J, gA] = j(null), [Bf, FA] = j(!1), [OA, AA] = j(() => af("profiles", [])), [LA, Pf] = j(() => af("history", [])), [lA, O] = j(() => Kn()), [q, QA] = j(() => /* @__PURE__ */ new Set()), [U, R] = j(null), G = UA((w) => {
|
|
12820
|
+
O(w), Tg(w);
|
|
12821
|
+
}, []), [S, dA] = j(!1), [fA, NA] = j(null), [$A, ef] = j(null), yA = tA(null), KA = tA(() => !1), Df = tA(() => {
|
|
12818
12822
|
}), M = UA((w, Q) => {
|
|
12819
|
-
KA.current = w,
|
|
12820
|
-
}, []), cA =
|
|
12823
|
+
KA.current = w, Df.current = Q;
|
|
12824
|
+
}, []), cA = tA(null), pA = tA(null), tf = tA(null), Cf = tA(null), IA = tA(null), pf = tA(!1), qn = tA(null), If = tA(null), [Wn, lf] = j(null), [Vn, LP] = j(null), Jf = tA(null);
|
|
12821
12825
|
JA(() => {
|
|
12822
12826
|
try {
|
|
12823
12827
|
const w = bf(), Q = uf(B);
|
|
@@ -12825,10 +12829,10 @@ function R8({
|
|
|
12825
12829
|
} catch {
|
|
12826
12830
|
}
|
|
12827
12831
|
return () => {
|
|
12828
|
-
|
|
12832
|
+
Cf.current?.(), tf.current?.disconnect(), IA.current && clearInterval(IA.current);
|
|
12829
12833
|
};
|
|
12830
12834
|
}, [B]);
|
|
12831
|
-
const cP = 22, nP =
|
|
12835
|
+
const cP = 22, nP = tA(0), mf = tA(null), Nf = tA(null), Sf = tA(null), Lf = tA(null), yf = tA(null), pP = tA(null), jP = tA(""), Tf = tA(null);
|
|
12832
12836
|
JA(() => {
|
|
12833
12837
|
if (l === "processing") {
|
|
12834
12838
|
if (Tf.current) return;
|
|
@@ -12899,14 +12903,14 @@ function R8({
|
|
|
12899
12903
|
fetch(`${w}/api/v1/sizing/sizeguide`, {
|
|
12900
12904
|
method: "POST",
|
|
12901
12905
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${Q}` },
|
|
12902
|
-
body: JSON.stringify({ product: { title: n, productId:
|
|
12906
|
+
body: JSON.stringify({ product: { title: n, productId: K }, sizeGuideRaw: I })
|
|
12903
12907
|
}).then((Y) => Y.ok ? Y.json() : null).then((Y) => {
|
|
12904
12908
|
_A(Y || { found: !1 });
|
|
12905
12909
|
}).catch(() => {
|
|
12906
12910
|
_A({ found: !1 });
|
|
12907
12911
|
}).finally(() => cf(!1));
|
|
12908
12912
|
}, [B, n, I]);
|
|
12909
|
-
const $n =
|
|
12913
|
+
const $n = vf(() => {
|
|
12910
12914
|
switch (l) {
|
|
12911
12915
|
case "welcome":
|
|
12912
12916
|
case "body-profile":
|
|
@@ -12964,7 +12968,7 @@ function R8({
|
|
|
12964
12968
|
Object.entries(Q.sections).map(([Z, d]) => [Z, d.recommendedSize])
|
|
12965
12969
|
) : void 0;
|
|
12966
12970
|
Tn(Y, {
|
|
12967
|
-
productId:
|
|
12971
|
+
productId: K,
|
|
12968
12972
|
productTitle: n,
|
|
12969
12973
|
productImage: f,
|
|
12970
12974
|
recommendedSize: Q.recommendedSize,
|
|
@@ -12974,8 +12978,8 @@ function R8({
|
|
|
12974
12978
|
}), AA(af("profiles", []));
|
|
12975
12979
|
}
|
|
12976
12980
|
},
|
|
12977
|
-
[lA, OA, B, f, n,
|
|
12978
|
-
), UP =
|
|
12981
|
+
[lA, OA, B, f, n, K, G]
|
|
12982
|
+
), UP = tA(null), [qf, EP] = j(null), yP = UA(async (w) => {
|
|
12979
12983
|
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;
|
|
12980
12984
|
if (!wA && L && Q > 0 && UP.current) {
|
|
12981
12985
|
try {
|
|
@@ -12994,7 +12998,7 @@ function R8({
|
|
|
12994
12998
|
}
|
|
12995
12999
|
return;
|
|
12996
13000
|
}
|
|
12997
|
-
SA(null),
|
|
13001
|
+
SA(null), iA(!0), xA(wA), wA && (s(null), lf(null));
|
|
12998
13002
|
const Z = w.photoBase64;
|
|
12999
13003
|
if (Z)
|
|
13000
13004
|
try {
|
|
@@ -13007,7 +13011,7 @@ function R8({
|
|
|
13007
13011
|
} catch {
|
|
13008
13012
|
}
|
|
13009
13013
|
y("size-result"), Gn({
|
|
13010
|
-
productId:
|
|
13014
|
+
productId: K,
|
|
13011
13015
|
productTitle: n,
|
|
13012
13016
|
productImage: f,
|
|
13013
13017
|
sizeGuideData: I,
|
|
@@ -13017,8 +13021,8 @@ function R8({
|
|
|
13017
13021
|
}).then((d) => {
|
|
13018
13022
|
d?.raw && SA(d.raw), xA(!0);
|
|
13019
13023
|
}).catch(() => {
|
|
13020
|
-
}).finally(() =>
|
|
13021
|
-
}, [
|
|
13024
|
+
}).finally(() => iA(!1));
|
|
13025
|
+
}, [K, n, f, I, B, V]), _n = UA(async () => {
|
|
13022
13026
|
const w = OA.find((L) => L.id === lA);
|
|
13023
13027
|
if (!w) return;
|
|
13024
13028
|
const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0;
|
|
@@ -13028,12 +13032,12 @@ function R8({
|
|
|
13028
13032
|
const w = qf;
|
|
13029
13033
|
EP(null), yP(w);
|
|
13030
13034
|
}, [qf, yP]), fg = UA(() => {
|
|
13031
|
-
EP(null),
|
|
13032
|
-
}, []), Pg =
|
|
13035
|
+
EP(null), wf((w) => w + 1), y("body-profile");
|
|
13036
|
+
}, []), Pg = tA(() => {
|
|
13033
13037
|
}), ng = UA(() => {
|
|
13034
13038
|
console.log("[ps-sdk] handleOpen fired — opening modal"), y("body-profile"), h?.();
|
|
13035
13039
|
}, [h]), Gf = UA(() => {
|
|
13036
|
-
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null),
|
|
13040
|
+
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), EA(null), kA(null), SA(null), iA(!1), gA(null), FA(!1), dA(!1), H.current = {}, zA("male"), Yf.current = !1, Cf.current?.(), Cf.current = null, IA.current && (clearInterval(IA.current), IA.current = null), W?.();
|
|
13037
13041
|
}, [W, V]), gg = UA(() => {
|
|
13038
13042
|
if (fA) {
|
|
13039
13043
|
NA(null), yA.current && (y(yA.current), yA.current = null);
|
|
@@ -13061,7 +13065,7 @@ function R8({
|
|
|
13061
13065
|
break;
|
|
13062
13066
|
case "profiles":
|
|
13063
13067
|
if (KA.current()) {
|
|
13064
|
-
|
|
13068
|
+
Df.current();
|
|
13065
13069
|
break;
|
|
13066
13070
|
}
|
|
13067
13071
|
y(yA.current || "body-profile"), yA.current = null;
|
|
@@ -13072,23 +13076,23 @@ function R8({
|
|
|
13072
13076
|
}
|
|
13073
13077
|
}, [l, fA, TA, Gf]), Bg = l !== "idle" && l !== "processing" && l !== "result" && l !== "welcome" && l !== "body-profile" && l !== "size-result", ZP = UA((w) => {
|
|
13074
13078
|
if (!pg(w)) {
|
|
13075
|
-
|
|
13079
|
+
EA(E("Please upload a JPEG, PNG, or WebP image.")), y("error"), v?.({ message: "Invalid file type", code: "INVALID_FILE" });
|
|
13076
13080
|
return;
|
|
13077
13081
|
}
|
|
13078
13082
|
if (w.size > 10 * 1024 * 1024) {
|
|
13079
|
-
|
|
13083
|
+
EA(E("Image must be under 10MB.")), y("error"), v?.({ message: "File too large", code: "FILE_TOO_LARGE" });
|
|
13080
13084
|
return;
|
|
13081
13085
|
}
|
|
13082
13086
|
sA(w), Jf.current = w;
|
|
13083
13087
|
const Q = URL.createObjectURL(w);
|
|
13084
|
-
s(Q),
|
|
13088
|
+
s(Q), i?.(w), If.current = null, rP(Q).then((Y) => {
|
|
13085
13089
|
If.current = Y;
|
|
13086
13090
|
}).catch(() => {
|
|
13087
13091
|
});
|
|
13088
|
-
}, [
|
|
13092
|
+
}, [i, v]), qP = UA(() => {
|
|
13089
13093
|
sA(null), V && URL.revokeObjectURL(V), s(null);
|
|
13090
13094
|
}, [V]), Wf = UA(() => {
|
|
13091
|
-
IA.current && (clearInterval(IA.current), IA.current = null),
|
|
13095
|
+
IA.current && (clearInterval(IA.current), IA.current = null), Cf.current?.(), Cf.current = null;
|
|
13092
13096
|
}, []), aP = UA((w) => {
|
|
13093
13097
|
if (w.status === "completed" && w.imageUrl) {
|
|
13094
13098
|
if (RA((Q) => !Q || Q.startsWith("data:") || !w.imageUrl.startsWith("data:") ? w.imageUrl : Q), !pf.current) {
|
|
@@ -13103,9 +13107,9 @@ function R8({
|
|
|
13103
13107
|
} else if (w.status === "failed" && !pf.current) {
|
|
13104
13108
|
pf.current = !0, Wf(), eA(!1);
|
|
13105
13109
|
const Q = w.error || E("Try-on generation failed");
|
|
13106
|
-
|
|
13110
|
+
EA(Q), y("error"), v?.({ message: Q });
|
|
13107
13111
|
}
|
|
13108
|
-
}, [u, v, Wf]), Kf =
|
|
13112
|
+
}, [u, v, Wf]), Kf = vf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields : oA === "female" ? Og : Kg, [$, oA]), Vf = UA(async (w) => {
|
|
13109
13113
|
if (!pA.current) return;
|
|
13110
13114
|
const Q = w || VA, Y = uf(B), wA = bf(), L = Xf(n);
|
|
13111
13115
|
if (L === "face" || L === "head") {
|
|
@@ -13134,7 +13138,7 @@ function R8({
|
|
|
13134
13138
|
sizingUnit: L === "head" ? "cm" : "mm",
|
|
13135
13139
|
category: L,
|
|
13136
13140
|
...Object.keys(CA).length > 0 && { faceMeasurementsMm: CA, irisConfidence: 1 }
|
|
13137
|
-
},
|
|
13141
|
+
}, of = new Promise((jA) => setTimeout(jA, 4500));
|
|
13138
13142
|
try {
|
|
13139
13143
|
const jA = await fetch(`${Y}/api/v1/sizing/face-recommend`, {
|
|
13140
13144
|
method: "POST",
|
|
@@ -13143,22 +13147,22 @@ function R8({
|
|
|
13143
13147
|
});
|
|
13144
13148
|
if (jA.ok) {
|
|
13145
13149
|
const Af = await jA.json();
|
|
13146
|
-
await
|
|
13150
|
+
await of, SA(Af), u?.(Af);
|
|
13147
13151
|
} else {
|
|
13148
13152
|
const Af = await jA.text().catch(() => "");
|
|
13149
|
-
console.error("[PS-SDK] face-recommend failed:", jA.status, Af), await
|
|
13153
|
+
console.error("[PS-SDK] face-recommend failed:", jA.status, Af), await of, EA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
|
|
13150
13154
|
}
|
|
13151
13155
|
} catch (jA) {
|
|
13152
|
-
console.error("[PS-SDK] face-recommend network error:", jA), await
|
|
13156
|
+
console.error("[PS-SDK] face-recommend network error:", jA), await of, EA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
|
|
13153
13157
|
} finally {
|
|
13154
|
-
|
|
13158
|
+
iA(!1);
|
|
13155
13159
|
}
|
|
13156
13160
|
return;
|
|
13157
13161
|
}
|
|
13158
13162
|
const Z = {
|
|
13159
13163
|
method: Q,
|
|
13160
13164
|
locale: gf,
|
|
13161
|
-
product: { title: n, productId:
|
|
13165
|
+
product: { title: n, productId: K, description: "", variants: [] }
|
|
13162
13166
|
};
|
|
13163
13167
|
if ($?.found && (Z.sizeGuide = $, $.sections && (Z.sizeGuide = { ...$, sections: $.sections })), Z.sizingUnit = _, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: $?.found, hasHeaders: !!$?.headers, hasRows: !!$?.rows, headers: $?.headers, rowCount: $?.rows?.length, hasSections: !!$?.sections, sectionNames: $?.sections ? Object.keys($.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", Z.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", Z.sizeGuide && Z.sizeGuide.rows?.[0] ? Array.isArray(Z.sizeGuide.rows[0]) ? "array" : typeof Z.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(Z).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", Q, "| sizingUnit:", _, "| heightUnit:", WA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(H.current)), console.log("[PS-SDK] dynamicFields:", Kf.map((d) => `${d.key}(unit=${d.unit},req=${d.required})`).join(", ")), Q === "exact") {
|
|
13164
13168
|
const d = { gender: H.current.gender || "male", sizingUnit: _ }, b = /* @__PURE__ */ new Set();
|
|
@@ -13177,7 +13181,7 @@ function R8({
|
|
|
13177
13181
|
} else {
|
|
13178
13182
|
const d = parseFloat(H.current.height || "0"), b = parseFloat(H.current.weight || "0");
|
|
13179
13183
|
if (!d || !b) {
|
|
13180
|
-
console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(H.current)),
|
|
13184
|
+
console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(H.current)), iA(!1);
|
|
13181
13185
|
return;
|
|
13182
13186
|
}
|
|
13183
13187
|
const HA = {
|
|
@@ -13216,17 +13220,17 @@ function R8({
|
|
|
13216
13220
|
);
|
|
13217
13221
|
} else {
|
|
13218
13222
|
const b = await d.text().catch(() => "");
|
|
13219
|
-
console.error("[PS-SDK] Sizing recommend failed:", d.status, b),
|
|
13223
|
+
console.error("[PS-SDK] Sizing recommend failed:", d.status, b), EA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
|
|
13220
13224
|
}
|
|
13221
13225
|
} catch (d) {
|
|
13222
|
-
console.error("[PS-SDK] Sizing recommend network error:", d),
|
|
13226
|
+
console.error("[PS-SDK] Sizing recommend network error:", d), EA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
|
|
13223
13227
|
} finally {
|
|
13224
|
-
|
|
13228
|
+
iA(!1);
|
|
13225
13229
|
}
|
|
13226
13230
|
}, [B, VA, gf, WA, X, _, $, n, Kf, Zf]), eg = UA(async (w, Q, Y, wA, L, Z, d, b, HA, DA, CA) => {
|
|
13227
13231
|
if (!pA.current) {
|
|
13228
13232
|
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."),
|
|
13233
|
+
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), EA(jA), y("error"), v?.({ message: jA, code: "SDK_NOT_CONFIGURED" });
|
|
13230
13234
|
return;
|
|
13231
13235
|
}
|
|
13232
13236
|
uf(B), bf();
|
|
@@ -13239,12 +13243,12 @@ function R8({
|
|
|
13239
13243
|
}
|
|
13240
13244
|
for (const jA of Kf)
|
|
13241
13245
|
jA.required && jA.unit === "cm" && !zf.has(jA.key) && df.add(jA.key);
|
|
13242
|
-
const
|
|
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:",
|
|
13244
|
-
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"),
|
|
13246
|
+
const of = Array.from(df);
|
|
13247
|
+
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:", of), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: b, midsectionProfile: HA, hipProfile: DA }), of.length === 0) {
|
|
13248
|
+
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"), iA(!0), y("size-result"), Vf("quick");
|
|
13245
13249
|
return;
|
|
13246
13250
|
}
|
|
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"),
|
|
13251
|
+
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"), iA(!0), y("size-result"), Vf("quick");
|
|
13248
13252
|
}, [B, Kf, $, Vf, _, X]), dP = UA(async (w) => {
|
|
13249
13253
|
if (console.log("[ps-sdk] handleSnapSubmit fired", {
|
|
13250
13254
|
hasApiRef: !!pA.current,
|
|
@@ -13252,22 +13256,28 @@ function R8({
|
|
|
13252
13256
|
apiUrl: B
|
|
13253
13257
|
}), !pA.current || !tf.current) {
|
|
13254
13258
|
const DA = E("SDK not configured. Please refresh and try again.");
|
|
13255
|
-
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."),
|
|
13259
|
+
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), EA(DA), y("error"), v?.({ message: DA, code: "SDK_NOT_CONFIGURED" });
|
|
13256
13260
|
return;
|
|
13257
13261
|
}
|
|
13258
13262
|
const Q = uf(B), Y = bf();
|
|
13259
13263
|
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: Q }), sA(w.photoFile), Jf.current = w.photoFile;
|
|
13260
13264
|
const wA = w.photoFile ? URL.createObjectURL(w.photoFile) : w.photoBase64.startsWith("data:") ? w.photoBase64 : `data:image/jpeg;base64,${w.photoBase64}`;
|
|
13261
|
-
s(wA), pf.current = !1, eA(!1), SA(null), RA(null),
|
|
13265
|
+
s(wA), pf.current = !1, eA(!1), SA(null), RA(null), iA(!0), xA(!1), y("size-result");
|
|
13262
13266
|
const L = Xf(n);
|
|
13263
13267
|
if (L === "face" || L === "head") {
|
|
13264
13268
|
LP(null);
|
|
13265
13269
|
const DA = new Promise((CA) => setTimeout(CA, 4500));
|
|
13266
13270
|
try {
|
|
13267
13271
|
const CA = await dg(wA);
|
|
13272
|
+
if (!CA) {
|
|
13273
|
+
console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await DA;
|
|
13274
|
+
const of = E(L === "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.");
|
|
13275
|
+
EA(of), y("error"), v?.({ message: of, code: "FACE_DETECTION_FAILED" }), iA(!1);
|
|
13276
|
+
return;
|
|
13277
|
+
}
|
|
13268
13278
|
CA && LP(CA.landmarks);
|
|
13269
13279
|
const zf = {
|
|
13270
|
-
product: { title: n, productId:
|
|
13280
|
+
product: { title: n, productId: K },
|
|
13271
13281
|
sizeGuide: $ ?? { found: !1 },
|
|
13272
13282
|
sizingUnit: L === "head" ? "cm" : "mm",
|
|
13273
13283
|
category: L,
|
|
@@ -13280,8 +13290,8 @@ function R8({
|
|
|
13280
13290
|
body: JSON.stringify(zf)
|
|
13281
13291
|
});
|
|
13282
13292
|
if (df.ok) {
|
|
13283
|
-
const
|
|
13284
|
-
await DA, SA(
|
|
13293
|
+
const of = await df.json();
|
|
13294
|
+
await DA, SA(of), u?.(of), Zf(
|
|
13285
13295
|
{
|
|
13286
13296
|
gender: w.gender,
|
|
13287
13297
|
height: w.height,
|
|
@@ -13291,14 +13301,14 @@ function R8({
|
|
|
13291
13301
|
age: w.age,
|
|
13292
13302
|
bodyImage: w.photoBase64
|
|
13293
13303
|
},
|
|
13294
|
-
|
|
13304
|
+
of
|
|
13295
13305
|
);
|
|
13296
13306
|
} else
|
|
13297
13307
|
await DA, xA(!0);
|
|
13298
13308
|
} catch (CA) {
|
|
13299
13309
|
console.error("[ps-sdk] face-recommend failed:", CA), await DA, xA(!0);
|
|
13300
13310
|
}
|
|
13301
|
-
|
|
13311
|
+
iA(!1);
|
|
13302
13312
|
return;
|
|
13303
13313
|
}
|
|
13304
13314
|
If.current = null, lf(null), rP(wA).then((DA) => (If.current = DA, DA)).catch(() => null);
|
|
@@ -13311,7 +13321,7 @@ function R8({
|
|
|
13311
13321
|
method: "photo",
|
|
13312
13322
|
locale: gf,
|
|
13313
13323
|
sizingUnit: _,
|
|
13314
|
-
product: { title: n, productId:
|
|
13324
|
+
product: { title: n, productId: K, description: "", variants: [] },
|
|
13315
13325
|
bodyImage: w.photoBase64,
|
|
13316
13326
|
// BlazePose landmarks (normalized 0–1 coordinates). The backend uses
|
|
13317
13327
|
// these to compute exact pixel distances and feed them to Gemini as
|
|
@@ -13353,14 +13363,14 @@ function R8({
|
|
|
13353
13363
|
} catch {
|
|
13354
13364
|
xA(!0);
|
|
13355
13365
|
}
|
|
13356
|
-
|
|
13366
|
+
iA(!1);
|
|
13357
13367
|
}, [B, f, n, _, X, gf, $, Kf, Zf]);
|
|
13358
13368
|
UP.current = dP;
|
|
13359
13369
|
const WP = UA(async (w) => {
|
|
13360
13370
|
const Q = w || XA || Jf.current;
|
|
13361
13371
|
if (!Q || !pA.current || !tf.current) {
|
|
13362
13372
|
const Z = pA.current ? E("Please upload a photo first.") : E("SDK not configured. Please provide an API key.");
|
|
13363
|
-
|
|
13373
|
+
EA(Z), y("error"), v?.({ message: Z, code: "SDK_NOT_CONFIGURED" });
|
|
13364
13374
|
return;
|
|
13365
13375
|
}
|
|
13366
13376
|
w && w !== XA && (sA(w), Jf.current = w), pf.current = !1, eA(!0);
|
|
@@ -13382,12 +13392,12 @@ function R8({
|
|
|
13382
13392
|
d,
|
|
13383
13393
|
Y ?? "apparel",
|
|
13384
13394
|
{
|
|
13385
|
-
productId:
|
|
13395
|
+
productId: K,
|
|
13386
13396
|
productTitle: n,
|
|
13387
13397
|
silhouetteContext: Cn(vA, $)
|
|
13388
13398
|
}
|
|
13389
13399
|
);
|
|
13390
|
-
k?.(b.jobId),
|
|
13400
|
+
k?.(b.jobId), Cf.current = tf.current.onJob(b.jobId, aP);
|
|
13391
13401
|
let HA = 0;
|
|
13392
13402
|
IA.current = setInterval(async () => {
|
|
13393
13403
|
if (pf.current) {
|
|
@@ -13406,11 +13416,11 @@ function R8({
|
|
|
13406
13416
|
}, 3e3);
|
|
13407
13417
|
} catch (Z) {
|
|
13408
13418
|
const d = Z instanceof Error ? Z.message : E("Failed to start try-on"), b = Z instanceof an ? Z.code : void 0;
|
|
13409
|
-
|
|
13419
|
+
EA(d), y("error"), v?.({ message: d, code: b });
|
|
13410
13420
|
}
|
|
13411
13421
|
}, [XA, f, n, vA, k, v, aP]), og = UA(async (w) => {
|
|
13412
13422
|
if (!XA || !pA.current || !tf.current) return;
|
|
13413
|
-
|
|
13423
|
+
aA(!0);
|
|
13414
13424
|
const Q = En(Xf(n)), Y = Q === "apparel";
|
|
13415
13425
|
if (Y && If.current) {
|
|
13416
13426
|
const wA = {
|
|
@@ -13429,20 +13439,20 @@ function R8({
|
|
|
13429
13439
|
}
|
|
13430
13440
|
}
|
|
13431
13441
|
try {
|
|
13432
|
-
pf.current = !1,
|
|
13442
|
+
pf.current = !1, Cf.current?.(), IA.current && (clearInterval(IA.current), IA.current = null);
|
|
13433
13443
|
const wA = await AP(XA), L = Y ? w : void 0, Z = await pA.current.submitTryOn(
|
|
13434
13444
|
wA,
|
|
13435
13445
|
f,
|
|
13436
13446
|
L,
|
|
13437
13447
|
Q ?? "apparel",
|
|
13438
13448
|
{
|
|
13439
|
-
productId:
|
|
13449
|
+
productId: K,
|
|
13440
13450
|
productTitle: n,
|
|
13441
13451
|
silhouetteContext: Cn(vA, $)
|
|
13442
13452
|
}
|
|
13443
13453
|
);
|
|
13444
|
-
|
|
13445
|
-
b.status === "completed" && b.imageUrl ? (RA(b.imageUrl),
|
|
13454
|
+
Cf.current = tf.current.onJob(Z.jobId, (b) => {
|
|
13455
|
+
b.status === "completed" && b.imageUrl ? (RA(b.imageUrl), aA(!1), pf.current = !0, Cf.current?.(), Cf.current = null, IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (aA(!1), pf.current = !0, Cf.current?.(), Cf.current = null, IA.current && (clearInterval(IA.current), IA.current = null));
|
|
13446
13456
|
});
|
|
13447
13457
|
let d = 0;
|
|
13448
13458
|
IA.current = setInterval(async () => {
|
|
@@ -13451,17 +13461,17 @@ function R8({
|
|
|
13451
13461
|
return;
|
|
13452
13462
|
}
|
|
13453
13463
|
if (d++, d > 60) {
|
|
13454
|
-
IA.current && clearInterval(IA.current), IA.current = null,
|
|
13464
|
+
IA.current && clearInterval(IA.current), IA.current = null, aA(!1);
|
|
13455
13465
|
return;
|
|
13456
13466
|
}
|
|
13457
13467
|
try {
|
|
13458
13468
|
const b = await pA.current.getStatus(Z.jobId);
|
|
13459
|
-
b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl),
|
|
13469
|
+
b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl), aA(!1), Cf.current?.(), Cf.current = null), IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (pf.current = !0, aA(!1), IA.current && (clearInterval(IA.current), IA.current = null));
|
|
13460
13470
|
} catch {
|
|
13461
13471
|
}
|
|
13462
13472
|
}, 3e3);
|
|
13463
13473
|
} catch {
|
|
13464
|
-
|
|
13474
|
+
aA(!1);
|
|
13465
13475
|
}
|
|
13466
13476
|
}, [XA, f, n]), wg = UA(() => {
|
|
13467
13477
|
if (PA)
|
|
@@ -13474,7 +13484,7 @@ function R8({
|
|
|
13474
13484
|
Y.href = Q, Y.download = `primestyle-tryon-${Date.now()}.png`, Y.click(), setTimeout(() => URL.revokeObjectURL(Q), 100);
|
|
13475
13485
|
}).catch(() => window.open(PA, "_blank"));
|
|
13476
13486
|
}, [PA]), vg = UA(() => {
|
|
13477
|
-
pf.current = !1, Wf(), sA(null), V && URL.revokeObjectURL(V), s(null), RA(null),
|
|
13487
|
+
pf.current = !1, Wf(), sA(null), V && URL.revokeObjectURL(V), s(null), RA(null), EA(null), kA(null), SA(null), iA(!1), dA(!1), y("body-profile");
|
|
13478
13488
|
}, [V, Wf]), Dg = UA((w) => {
|
|
13479
13489
|
const Q = OA.find((wA) => wA.id === w);
|
|
13480
13490
|
if (!Q) return;
|
|
@@ -13483,7 +13493,7 @@ function R8({
|
|
|
13483
13493
|
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)
|
|
13484
13494
|
for (const [wA, L] of Object.entries(Q.customMeasurements))
|
|
13485
13495
|
Y[wA] = String(L);
|
|
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),
|
|
13496
|
+
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), wf((wA) => wA + 1);
|
|
13487
13497
|
}, [OA]);
|
|
13488
13498
|
Pg.current = Dg, UA((w, Q) => {
|
|
13489
13499
|
const Y = (Q ? null : lA) || `p_${Date.now()}`, wA = {
|
|
@@ -13539,7 +13549,7 @@ function R8({
|
|
|
13539
13549
|
return HA[b] = wA, HA;
|
|
13540
13550
|
}
|
|
13541
13551
|
return [...d, wA].slice(-50);
|
|
13542
|
-
}), G(Y),
|
|
13552
|
+
}), G(Y), dA(!0);
|
|
13543
13553
|
}, [lA, gf, _, WA, X]);
|
|
13544
13554
|
const VP = UA(() => {
|
|
13545
13555
|
const w = {
|
|
@@ -13568,7 +13578,7 @@ function R8({
|
|
|
13568
13578
|
Q && (w.profileName = Q.name);
|
|
13569
13579
|
}
|
|
13570
13580
|
Pf((Q) => [w, ...Q].slice(0, 50));
|
|
13571
|
-
}, [n, f, PA, vA, $, lA, OA]), Yf =
|
|
13581
|
+
}, [n, f, PA, vA, $, lA, OA]), Yf = tA(!1), gP = tA(!1);
|
|
13572
13582
|
JA(() => {
|
|
13573
13583
|
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);
|
|
13574
13584
|
}, [l, vA, PA]);
|
|
@@ -13579,11 +13589,11 @@ function R8({
|
|
|
13579
13589
|
reasoning: w.reasoning || "",
|
|
13580
13590
|
internationalSizes: w.internationalSizes,
|
|
13581
13591
|
matchDetails: w.matchDetails
|
|
13582
|
-
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null),
|
|
13592
|
+
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), iA(!1), eA(!1), bA(null), NA(null), y("size-result");
|
|
13583
13593
|
}, []), ig = UA((w, Q) => {
|
|
13584
13594
|
H.current[w] = Q;
|
|
13585
13595
|
}, []);
|
|
13586
|
-
|
|
13596
|
+
vf(() => {
|
|
13587
13597
|
const Q = {
|
|
13588
13598
|
US: { key: "shoeUS", labelKey: "Shoe size (US)", ph: "e.g. 10" },
|
|
13589
13599
|
UK: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" },
|
|
@@ -13647,7 +13657,7 @@ function R8({
|
|
|
13647
13657
|
case "welcome":
|
|
13648
13658
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(BB, { productImage: f, setView: y, t: E }) }, "v-welcome");
|
|
13649
13659
|
case "body-profile": {
|
|
13650
|
-
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit: uA, setSizingMethod: kA, setSizingLoading:
|
|
13660
|
+
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit: uA, setSizingMethod: kA, setSizingLoading: iA, setView: y, submitSizing: Vf, onSnapSubmit: dP, onBack: Gf, sizeGuide: $, t: E };
|
|
13651
13661
|
if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...Q }) }, "v-foot");
|
|
13652
13662
|
if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...Q }) }, "v-head");
|
|
13653
13663
|
if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...Q }) }, "v-face");
|
|
@@ -13712,12 +13722,12 @@ function R8({
|
|
|
13712
13722
|
formRef: H,
|
|
13713
13723
|
formGender: oA,
|
|
13714
13724
|
formKey: YA,
|
|
13715
|
-
setFormKey:
|
|
13725
|
+
setFormKey: wf,
|
|
13716
13726
|
sizingUnit: _,
|
|
13717
13727
|
setSizingUnit: uA,
|
|
13718
13728
|
updateField: ig,
|
|
13719
13729
|
setSizingMethod: kA,
|
|
13720
|
-
setSizingLoading:
|
|
13730
|
+
setSizingLoading: iA,
|
|
13721
13731
|
setView: y,
|
|
13722
13732
|
submitSizing: Vf,
|
|
13723
13733
|
t: E
|
|
@@ -13867,10 +13877,10 @@ function R8({
|
|
|
13867
13877
|
})).then((CA) => {
|
|
13868
13878
|
if (CA) {
|
|
13869
13879
|
if (FP(Q.id, CA.estimates, CA.unit), CA.userEstimates) {
|
|
13870
|
-
const zf = af("profiles", []), df = zf.findIndex((
|
|
13880
|
+
const zf = af("profiles", []), df = zf.findIndex((of) => of.id === Q.id);
|
|
13871
13881
|
if (df >= 0) {
|
|
13872
|
-
const
|
|
13873
|
-
jA.height && !(
|
|
13882
|
+
const of = zf[df], jA = CA.userEstimates, Af = { ...of };
|
|
13883
|
+
jA.height && !(of.height || of.heightCm) && (Af.height = jA.height, Af.heightCm = jA.height, Af.heightUnit = "cm"), jA.weight && !(of.weight || of.weightKg) && (Af.weight = jA.weight, Af.weightKg = jA.weight, Af.weightUnit = "kg"), jA.age && !of.age && (Af.age = jA.age), zf[df] = Af, sf("profiles", zf);
|
|
13874
13884
|
}
|
|
13875
13885
|
}
|
|
13876
13886
|
AA(af("profiles", []));
|
|
@@ -13916,7 +13926,7 @@ function R8({
|
|
|
13916
13926
|
className: Qf("ps-tryon-btn", p.button),
|
|
13917
13927
|
type: "button",
|
|
13918
13928
|
children: [
|
|
13919
|
-
D !== !1 && (
|
|
13929
|
+
D !== !1 && (t || /* @__PURE__ */ A(hf, {})),
|
|
13920
13930
|
/* @__PURE__ */ A("span", { children: BA })
|
|
13921
13931
|
]
|
|
13922
13932
|
}
|
|
@@ -13924,7 +13934,7 @@ function R8({
|
|
|
13924
13934
|
l !== "idle" && typeof document < "u" && lP(
|
|
13925
13935
|
/* @__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: [
|
|
13926
13936
|
/* @__PURE__ */ P("div", { className: Qf("ps-tryon-header ps-tryon-header-minimal", p.header), children: [
|
|
13927
|
-
/* @__PURE__ */ A(_g, { activeLocale: N, onSelect:
|
|
13937
|
+
/* @__PURE__ */ A(_g, { activeLocale: N, onSelect: x }),
|
|
13928
13938
|
/* @__PURE__ */ A("button", { className: "ps-tryon-header-icon", title: E("Profiles"), onClick: () => {
|
|
13929
13939
|
fA && NA(null), l === "profiles" ? (y(yA.current || "body-profile"), yA.current = null) : (yA.current = l, y("profiles"));
|
|
13930
13940
|
}, children: /* @__PURE__ */ A(mP, {}) }),
|
|
@@ -13998,7 +14008,7 @@ function T8(f) {
|
|
|
13998
14008
|
return /* @__PURE__ */ A(R8, { ...f });
|
|
13999
14009
|
}
|
|
14000
14010
|
function G8(f) {
|
|
14001
|
-
const [n, g] = j(null), [e, B] = j(!0), [C, D] = j(!1), [
|
|
14011
|
+
const [n, g] = j(null), [e, B] = j(!0), [C, D] = j(!1), [t, o] = j(0);
|
|
14002
14012
|
return JA(() => {
|
|
14003
14013
|
let r = !1;
|
|
14004
14014
|
return B(!0), D(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: f.productId }), Gn(f).then((z) => {
|
|
@@ -14010,7 +14020,7 @@ function G8(f) {
|
|
|
14010
14020
|
}), () => {
|
|
14011
14021
|
r = !0;
|
|
14012
14022
|
};
|
|
14013
|
-
}, [f.productId, f.apiUrl, f.apiKey,
|
|
14023
|
+
}, [f.productId, f.apiUrl, f.apiKey, t]), JA(() => {
|
|
14014
14024
|
if (typeof window > "u") return;
|
|
14015
14025
|
const r = () => o((z) => z + 1);
|
|
14016
14026
|
return window.addEventListener(fP, r), window.addEventListener("storage", r), () => {
|