@primestyleai/tryon 5.10.11 → 5.10.13
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 +496 -496
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +3 -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
3
|
import { jsxs as P, jsx as A, Fragment as tA } from "react/jsx-runtime";
|
|
4
|
-
import { useState as j, useRef as iA, useCallback as jA, useEffect as JA, useMemo as
|
|
4
|
+
import { useState as j, useRef as iA, useCallback as jA, useEffect as JA, useMemo as wf } from "react";
|
|
5
5
|
import { createPortal as lP } from "react-dom";
|
|
6
6
|
const sP = 11, TP = 12, An = 13, fn = 14, Pn = 15, nn = 16, GP = 23, YP = 24, gn = 25, Bn = 26, en = 27, on = 28, wn = 0;
|
|
7
7
|
let HP = null, BP = null;
|
|
@@ -31,10 +31,10 @@ async function rP(f) {
|
|
|
31
31
|
const n = await Fn(f), g = HP.detect(n);
|
|
32
32
|
if (!g?.landmarks?.length || g.landmarks[0].length < 25)
|
|
33
33
|
return null;
|
|
34
|
-
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], i = e[YP], o = (B.y + C.y) / 2, r = (D.y + i.y) / 2,
|
|
34
|
+
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], i = e[YP], o = (B.y + C.y) / 2, r = (D.y + i.y) / 2, z = r - o, p = o + z * 0.28, T = Math.abs(C.x - B.x), F = Math.min(B.x, C.x) - T * 0.05, h = Math.max(B.x, C.x) + T * 0.05, W = Math.abs(i.x - D.x), t = Math.min(D.x, i.x) - W * 0.15, k = Math.max(D.x, i.x) + W * 0.15, u = p + (r - p) * 0.55, v = T * 0.85, I = (B.x + C.x + D.x + i.x) / 4, O = I - v / 2, m = I + v / 2;
|
|
35
35
|
return {
|
|
36
36
|
chest: { y: p, x1: F, x2: h },
|
|
37
|
-
waist: { y: u, x1:
|
|
37
|
+
waist: { y: u, x1: O, x2: m },
|
|
38
38
|
hips: { y: r, x1: t, x2: k }
|
|
39
39
|
};
|
|
40
40
|
} catch (n) {
|
|
@@ -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 = (
|
|
137
|
+
const e = (z) => ({ x: z.x * n, y: z.y * g }), [B, C, D, i] = f.map(e), o = Math.hypot(B.x - D.x, B.y - D.y), r = Math.hypot(C.x - i.x, C.y - i.y);
|
|
138
138
|
return (o + r) / 2;
|
|
139
139
|
}
|
|
140
140
|
function Eg(f) {
|
|
@@ -166,7 +166,7 @@ function ag(f, n, g) {
|
|
|
166
166
|
const i = C > 0 ? vn / C : 0, o = (K, E) => Math.hypot(
|
|
167
167
|
(K.x - E.x) * n,
|
|
168
168
|
(K.y - E.y) * g
|
|
169
|
-
) * i, r = o(f.leftIrisCenter, f.rightIrisCenter), p = o(f.leftInnerEye, f.rightInnerEye) / 1.6, T = o(f.leftTragus, f.rightTragus), F = o(f.leftTragus, f.leftOuterEye), h = o(f.rightTragus, f.rightOuterEye), W = (F + h) / 2, t = T * 1.07, u = Math.abs((f.forehead.z ?? 0) - (f.chin.z ?? 0)) * n * i, v = Math.max(170, Math.min(210, u || 190)), I = t / 2,
|
|
169
|
+
) * i, r = o(f.leftIrisCenter, f.rightIrisCenter), p = o(f.leftInnerEye, f.rightInnerEye) / 1.6, T = o(f.leftTragus, f.rightTragus), F = o(f.leftTragus, f.leftOuterEye), h = o(f.rightTragus, f.rightOuterEye), W = (F + h) / 2, t = T * 1.07, u = Math.abs((f.forehead.z ?? 0) - (f.chin.z ?? 0)) * n * i, v = Math.max(170, Math.min(210, u || 190)), I = t / 2, O = v / 2, m = Math.PI * Math.sqrt(2 * (I * I + O * O));
|
|
170
170
|
return {
|
|
171
171
|
measurements: {
|
|
172
172
|
irisDiameter: vn,
|
|
@@ -259,7 +259,7 @@ function Cn(f, n) {
|
|
|
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
261
|
const D = n.headers, i = n.rows.slice(0, 20).map(
|
|
262
|
-
(o) => D.map((r,
|
|
262
|
+
(o) => D.map((r, z) => `${r} ${o[z] ?? "—"}`).join(", ")
|
|
263
263
|
);
|
|
264
264
|
g.sizeChartSummary = i.join(" | ");
|
|
265
265
|
}
|
|
@@ -492,7 +492,7 @@ async function Gn(f) {
|
|
|
492
492
|
return n("recommend returned no recommendedSize — bailing"), null;
|
|
493
493
|
const r = o.sections ? Object.fromEntries(
|
|
494
494
|
Object.entries(o.sections).map(([p, T]) => [p, T.recommendedSize])
|
|
495
|
-
) : void 0,
|
|
495
|
+
) : void 0, z = o.sections ? Object.fromEntries(
|
|
496
496
|
Object.entries(o.sections).map(([p, T]) => [
|
|
497
497
|
p,
|
|
498
498
|
{
|
|
@@ -512,7 +512,7 @@ async function Gn(f) {
|
|
|
512
512
|
recommendedSize: o.recommendedSize,
|
|
513
513
|
confidence: o.confidence,
|
|
514
514
|
sections: r,
|
|
515
|
-
sectionsFull:
|
|
515
|
+
sectionsFull: z,
|
|
516
516
|
recommendedLength: o.recommendedLength || void 0,
|
|
517
517
|
savedAt: Date.now()
|
|
518
518
|
}), {
|
|
@@ -6788,17 +6788,17 @@ function $g({ view: f, stepIndex: n }) {
|
|
|
6788
6788
|
function _g({ activeLocale: f, onSelect: n }) {
|
|
6789
6789
|
const [g, e] = j(!1), B = iA(null), C = iA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English", r = jA(() => {
|
|
6790
6790
|
if (!B.current) return;
|
|
6791
|
-
const
|
|
6792
|
-
i({ top:
|
|
6791
|
+
const z = B.current.getBoundingClientRect();
|
|
6792
|
+
i({ top: z.bottom + 4, right: window.innerWidth - z.right });
|
|
6793
6793
|
}, []);
|
|
6794
6794
|
return JA(() => {
|
|
6795
6795
|
if (!g) return;
|
|
6796
6796
|
r();
|
|
6797
|
-
const
|
|
6797
|
+
const z = (p) => {
|
|
6798
6798
|
B.current?.contains(p.target) || C.current?.contains(p.target) || e(!1);
|
|
6799
6799
|
};
|
|
6800
|
-
return document.addEventListener("mousedown",
|
|
6801
|
-
document.removeEventListener("mousedown",
|
|
6800
|
+
return document.addEventListener("mousedown", z), window.addEventListener("resize", r), window.addEventListener("scroll", r, !0), () => {
|
|
6801
|
+
document.removeEventListener("mousedown", z), window.removeEventListener("resize", r), window.removeEventListener("scroll", r, !0);
|
|
6802
6802
|
};
|
|
6803
6803
|
}, [g, r]), /* @__PURE__ */ P(tA, { children: [
|
|
6804
6804
|
/* @__PURE__ */ P(
|
|
@@ -6829,20 +6829,20 @@ function _g({ activeLocale: f, onSelect: n }) {
|
|
|
6829
6829
|
// dropdown is portaled later than the overlay so it stacks on top.
|
|
6830
6830
|
zIndex: 2147483647
|
|
6831
6831
|
},
|
|
6832
|
-
children: /* @__PURE__ */ A("div", { className: "ps-tryon-lang-list", children: Qg.map((
|
|
6832
|
+
children: /* @__PURE__ */ A("div", { className: "ps-tryon-lang-list", children: Qg.map((z) => /* @__PURE__ */ P(
|
|
6833
6833
|
"button",
|
|
6834
6834
|
{
|
|
6835
|
-
className: `ps-tryon-lang-item${
|
|
6835
|
+
className: `ps-tryon-lang-item${z === f ? " ps-selected" : ""}`,
|
|
6836
6836
|
onClick: () => {
|
|
6837
|
-
n(
|
|
6837
|
+
n(z), e(!1);
|
|
6838
6838
|
},
|
|
6839
6839
|
children: [
|
|
6840
|
-
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-name", children: _P[
|
|
6841
|
-
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-code", children:
|
|
6842
|
-
|
|
6840
|
+
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-name", children: _P[z] || z }),
|
|
6841
|
+
/* @__PURE__ */ A("span", { className: "ps-tryon-lang-code", children: z.toUpperCase() }),
|
|
6842
|
+
z === f && /* @__PURE__ */ A("span", { className: "ps-tryon-lang-check", children: /* @__PURE__ */ A(Ng, { size: 12 }) })
|
|
6843
6843
|
]
|
|
6844
6844
|
},
|
|
6845
|
-
|
|
6845
|
+
z
|
|
6846
6846
|
)) })
|
|
6847
6847
|
}
|
|
6848
6848
|
),
|
|
@@ -6865,7 +6865,7 @@ function un({
|
|
|
6865
6865
|
onCancel: g,
|
|
6866
6866
|
t: e
|
|
6867
6867
|
}) {
|
|
6868
|
-
const [B, C] = j(f?.name || ""), [D, i] = j(f?.gender || "male"), [o, r] = j(f?.sizingUnit || "cm"), [
|
|
6868
|
+
const [B, C] = j(f?.name || ""), [D, i] = j(f?.gender || "male"), [o, r] = j(f?.sizingUnit || "cm"), [z, p] = j(() => {
|
|
6869
6869
|
if (!f) return {};
|
|
6870
6870
|
const t = {};
|
|
6871
6871
|
for (const k of ["heightCm", "weightKg", "age"]) {
|
|
@@ -6877,7 +6877,7 @@ function un({
|
|
|
6877
6877
|
const t = [];
|
|
6878
6878
|
B.trim() || t.push(e("Profile Name"));
|
|
6879
6879
|
for (const u of T)
|
|
6880
|
-
parseFloat(
|
|
6880
|
+
parseFloat(z[u.key] || "") > 0 || t.push(e(u.label));
|
|
6881
6881
|
if (t.length > 0) {
|
|
6882
6882
|
h(e("Please fill in all fields"));
|
|
6883
6883
|
return;
|
|
@@ -6885,7 +6885,7 @@ function un({
|
|
|
6885
6885
|
h("");
|
|
6886
6886
|
const k = { name: B.trim(), gender: D, sizingUnit: o };
|
|
6887
6887
|
for (const u of T)
|
|
6888
|
-
k[u.key] = parseFloat(
|
|
6888
|
+
k[u.key] = parseFloat(z[u.key]);
|
|
6889
6889
|
n(k);
|
|
6890
6890
|
};
|
|
6891
6891
|
return /* @__PURE__ */ P("div", { className: "ps-tryon-profile-edit", children: [
|
|
@@ -6959,7 +6959,7 @@ function un({
|
|
|
6959
6959
|
type: "number",
|
|
6960
6960
|
className: "ps-tryon-sf-input",
|
|
6961
6961
|
placeholder: " ",
|
|
6962
|
-
value:
|
|
6962
|
+
value: z[t.key] || "",
|
|
6963
6963
|
onChange: (k) => {
|
|
6964
6964
|
p((u) => ({ ...u, [t.key]: k.target.value })), h("");
|
|
6965
6965
|
}
|
|
@@ -6984,7 +6984,7 @@ function PB({
|
|
|
6984
6984
|
restoreHistory: i,
|
|
6985
6985
|
t: o
|
|
6986
6986
|
}) {
|
|
6987
|
-
const [r,
|
|
6987
|
+
const [r, z] = j(!1);
|
|
6988
6988
|
if (!f) return null;
|
|
6989
6989
|
const p = (F) => !!(F.sizeGuide?.sections && Object.keys(F.sizeGuide.sections).length > 1), T = (F) => {
|
|
6990
6990
|
const h = {
|
|
@@ -6992,18 +6992,18 @@ function PB({
|
|
|
6992
6992
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
6993
6993
|
createdAt: Date.now()
|
|
6994
6994
|
};
|
|
6995
|
-
e((W) => [h, ...W]),
|
|
6995
|
+
e((W) => [h, ...W]), z(!1);
|
|
6996
6996
|
};
|
|
6997
6997
|
return /* @__PURE__ */ P("div", { className: `ps-tryon-drawer${f ? " ps-tryon-drawer-open" : ""}`, children: [
|
|
6998
6998
|
/* @__PURE__ */ P("div", { className: "ps-tryon-drawer-header", children: [
|
|
6999
6999
|
/* @__PURE__ */ A("button", { className: "ps-tryon-drawer-back", onClick: () => {
|
|
7000
|
-
|
|
7000
|
+
z(!1), n(null);
|
|
7001
7001
|
}, children: /* @__PURE__ */ A(kg, {}) }),
|
|
7002
7002
|
/* @__PURE__ */ A("span", { className: "ps-tryon-drawer-title", children: o(r ? "New Profile" : f === "profiles" ? "My Profiles" : "History") }),
|
|
7003
|
-
f === "profiles" && !r && /* @__PURE__ */ A("button", { className: "ps-tryon-drawer-add-btn", onClick: () =>
|
|
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: () =>
|
|
7006
|
-
/* @__PURE__ */ P("button", { className: "ps-tryon-drawer-create", onClick: () =>
|
|
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(tA, { children: [
|
|
7006
|
+
/* @__PURE__ */ P("button", { className: "ps-tryon-drawer-create", onClick: () => z(!0), children: [
|
|
7007
7007
|
"+ ",
|
|
7008
7008
|
o("Create New Profile")
|
|
7009
7009
|
] }),
|
|
@@ -7068,16 +7068,16 @@ function nB({
|
|
|
7068
7068
|
}, [f]), !f || typeof document > "u") return null;
|
|
7069
7069
|
const D = (o) => {
|
|
7070
7070
|
g((r) => r.map(
|
|
7071
|
-
(
|
|
7072
|
-
...
|
|
7071
|
+
(z) => z.id === f.id ? {
|
|
7072
|
+
...z,
|
|
7073
7073
|
...o,
|
|
7074
7074
|
// Keep id + createdAt + sizeHistory + measurements; bump lastEditedAt
|
|
7075
|
-
id:
|
|
7076
|
-
createdAt:
|
|
7077
|
-
sizeHistory:
|
|
7078
|
-
measurements:
|
|
7075
|
+
id: z.id,
|
|
7076
|
+
createdAt: z.createdAt,
|
|
7077
|
+
sizeHistory: z.sizeHistory,
|
|
7078
|
+
measurements: z.measurements,
|
|
7079
7079
|
lastEditedAt: Date.now()
|
|
7080
|
-
} :
|
|
7080
|
+
} : z
|
|
7081
7081
|
)), n(null);
|
|
7082
7082
|
}, i = () => n(null);
|
|
7083
7083
|
return lP(
|
|
@@ -7121,7 +7121,7 @@ function gB({
|
|
|
7121
7121
|
return `${T}'${F}"`;
|
|
7122
7122
|
}
|
|
7123
7123
|
return `${Math.round(p)} cm`;
|
|
7124
|
-
}, o = (p) => p ? `${Math.round(p)} ${C}` : "—", r = f.height ?? f.heightCm,
|
|
7124
|
+
}, o = (p) => p ? `${Math.round(p)} ${C}` : "—", r = f.height ?? f.heightCm, z = f.weight ?? f.weightKg;
|
|
7125
7125
|
return /* @__PURE__ */ A("div", { className: "ps-confirm-overlay", onClick: g, children: /* @__PURE__ */ P("div", { className: "ps-confirm-modal", onClick: (p) => p.stopPropagation(), children: [
|
|
7126
7126
|
/* @__PURE__ */ A(
|
|
7127
7127
|
"button",
|
|
@@ -7167,7 +7167,7 @@ function gB({
|
|
|
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") }),
|
|
7170
|
-
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: o(
|
|
7170
|
+
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: o(z) })
|
|
7171
7171
|
] }),
|
|
7172
7172
|
f.age ? /* @__PURE__ */ P("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7173
7173
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: e("Age") }),
|
|
@@ -7225,7 +7225,7 @@ function eB({
|
|
|
7225
7225
|
sizingUnit: i,
|
|
7226
7226
|
setSizingUnit: o,
|
|
7227
7227
|
formKey: r,
|
|
7228
|
-
setFormKey:
|
|
7228
|
+
setFormKey: z,
|
|
7229
7229
|
updateField: p,
|
|
7230
7230
|
setSizingMethod: T,
|
|
7231
7231
|
setSizingLoading: F,
|
|
@@ -7233,7 +7233,7 @@ function eB({
|
|
|
7233
7233
|
submitSizing: W,
|
|
7234
7234
|
t
|
|
7235
7235
|
}) {
|
|
7236
|
-
const k = i === "in" ? "in" : "cm", u = /* @__PURE__ */ new Set(["weight", "weightKg", "height"]), v = B.filter((
|
|
7236
|
+
const k = i === "in" ? "in" : "cm", u = /* @__PURE__ */ new Set(["weight", "weightKg", "height"]), v = B.filter((O) => O.required && O.unit === "cm" && !u.has(O.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: [
|
|
@@ -7247,13 +7247,13 @@ function eB({
|
|
|
7247
7247
|
/* @__PURE__ */ P("div", { className: "ps-bp-root", children: [
|
|
7248
7248
|
/* @__PURE__ */ A("h3", { className: "ps-bp-title", style: { fontSize: "1.1vw" }, children: t("Here's what we estimated") }),
|
|
7249
7249
|
/* @__PURE__ */ A("p", { className: "ps-bp-subtitle", children: t("Tap any value to adjust if needed") }),
|
|
7250
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-sf-fields", style: { flex: 1, overflowY: "auto" }, children: v.map((
|
|
7251
|
-
const m = g[
|
|
7250
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-sf-fields", style: { flex: 1, overflowY: "auto" }, children: v.map((O) => {
|
|
7251
|
+
const m = g[O.key], K = C.current[O.key] ? parseFloat(C.current[O.key]) : null, E = m || K;
|
|
7252
7252
|
if (!E) return null;
|
|
7253
7253
|
const gA = !m && !!K;
|
|
7254
|
-
return C.current[
|
|
7254
|
+
return C.current[O.key] || (C.current[O.key] = String(E)), /* @__PURE__ */ A("div", { className: "ps-tryon-sf-float-row", children: /* @__PURE__ */ P("div", { className: "ps-tryon-sf-float-field", children: [
|
|
7255
7255
|
/* @__PURE__ */ P("label", { className: "ps-tryon-sf-float-label", children: [
|
|
7256
|
-
t(
|
|
7256
|
+
t(O.label),
|
|
7257
7257
|
" (",
|
|
7258
7258
|
k,
|
|
7259
7259
|
") ",
|
|
@@ -7266,10 +7266,10 @@ function eB({
|
|
|
7266
7266
|
placeholder: " ",
|
|
7267
7267
|
className: "ps-tryon-sf-input",
|
|
7268
7268
|
defaultValue: E,
|
|
7269
|
-
onInput: (c) => p(
|
|
7269
|
+
onInput: (c) => p(O.key, c.target.value)
|
|
7270
7270
|
}
|
|
7271
7271
|
)
|
|
7272
|
-
] }) },
|
|
7272
|
+
] }) }, O.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: [
|
|
@@ -7407,8 +7407,8 @@ function iB({ t: f }) {
|
|
|
7407
7407
|
const D = setInterval(() => {
|
|
7408
7408
|
const i = (Date.now() - n.current) / 1e3, o = Math.min(95, i / 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
|
|
7411
|
-
B.current.textContent = i >= wP ? "•••" : `~${
|
|
7410
|
+
const z = Math.max(0, wP - Math.floor(i));
|
|
7411
|
+
B.current.textContent = i >= wP ? "•••" : `~${z}s`;
|
|
7412
7412
|
}
|
|
7413
7413
|
}, 200);
|
|
7414
7414
|
return () => clearInterval(D);
|
|
@@ -7460,7 +7460,7 @@ 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
|
-
], [
|
|
7463
|
+
], [z, p] = j({ w: 800, h: 1200 }), T = (t) => {
|
|
7464
7464
|
const k = t.currentTarget;
|
|
7465
7465
|
p({ w: k.naturalWidth || k.offsetWidth, h: k.naturalHeight || k.offsetHeight });
|
|
7466
7466
|
}, [F, h] = j(0);
|
|
@@ -7484,7 +7484,7 @@ function rn({
|
|
|
7484
7484
|
onLoad: T
|
|
7485
7485
|
}
|
|
7486
7486
|
),
|
|
7487
|
-
o && g && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(CB, { landmarks: g, w:
|
|
7487
|
+
o && g && /* @__PURE__ */ A("div", { className: "ps-msc-pose-wrap", children: /* @__PURE__ */ A(CB, { landmarks: g, w: z.w, h: z.h }) })
|
|
7488
7488
|
] }),
|
|
7489
7489
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage", children: /* @__PURE__ */ P("div", { className: "ps-msc-stage-slot", children: [
|
|
7490
7490
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: W.title }),
|
|
@@ -7532,7 +7532,7 @@ function HB({
|
|
|
7532
7532
|
tryOnProcessing: i,
|
|
7533
7533
|
resultImageUrl: o,
|
|
7534
7534
|
tryOnDone: r,
|
|
7535
|
-
onTryAgain:
|
|
7535
|
+
onTryAgain: z,
|
|
7536
7536
|
onClose: p,
|
|
7537
7537
|
overlayNode: T,
|
|
7538
7538
|
showLines: F,
|
|
@@ -7540,15 +7540,15 @@ function HB({
|
|
|
7540
7540
|
onImageLoad: W,
|
|
7541
7541
|
t
|
|
7542
7542
|
}) {
|
|
7543
|
-
const k =
|
|
7543
|
+
const k = wf(() => {
|
|
7544
7544
|
const I = [...g?.matchDetails || []];
|
|
7545
7545
|
if (g?.sections)
|
|
7546
|
-
for (const
|
|
7547
|
-
|
|
7546
|
+
for (const O of Object.values(g.sections))
|
|
7547
|
+
O.matchDetails && I.push(...O.matchDetails);
|
|
7548
7548
|
if (I.length > 0) {
|
|
7549
|
-
const
|
|
7549
|
+
const O = I.filter(
|
|
7550
7550
|
(K) => K.fit === "good" || K.fit === "a-bit-tight" || K.fit === "a-bit-loose"
|
|
7551
|
-
).length, m = Math.round(
|
|
7551
|
+
).length, m = Math.round(O / I.length * 100);
|
|
7552
7552
|
return Math.max(70, m);
|
|
7553
7553
|
}
|
|
7554
7554
|
return g?.confidence === "high" ? 96 : g?.confidence === "medium" ? 84 : 72;
|
|
@@ -7611,8 +7611,8 @@ function HB({
|
|
|
7611
7611
|
] }),
|
|
7612
7612
|
/* @__PURE__ */ A("span", { className: "ps-msr-match-label", children: t("FIT MATCH") })
|
|
7613
7613
|
] }) }),
|
|
7614
|
-
/* @__PURE__ */ A("div", { className: "ps-msr-sections", children: B.map(({ name: I, secResult:
|
|
7615
|
-
const m = I.replace(/\s*[—–-]\s*.*/g, ""), K =
|
|
7614
|
+
/* @__PURE__ */ A("div", { className: "ps-msr-sections", children: B.map(({ name: I, secResult: O }) => {
|
|
7615
|
+
const m = I.replace(/\s*[—–-]\s*.*/g, ""), K = O, E = K.found === !1 ? t("No fit") : K.size || O.recommendedSize;
|
|
7616
7616
|
return /* @__PURE__ */ P(
|
|
7617
7617
|
"button",
|
|
7618
7618
|
{
|
|
@@ -7634,7 +7634,7 @@ function HB({
|
|
|
7634
7634
|
{
|
|
7635
7635
|
type: "button",
|
|
7636
7636
|
className: "ps-msr-tryon-cta ps-secondary",
|
|
7637
|
-
onClick:
|
|
7637
|
+
onClick: z,
|
|
7638
7638
|
children: t("Try Again")
|
|
7639
7639
|
}
|
|
7640
7640
|
),
|
|
@@ -7692,8 +7692,8 @@ function kn({ t: f, isActive: n }) {
|
|
|
7692
7692
|
}
|
|
7693
7693
|
g.current = Date.now();
|
|
7694
7694
|
const i = setInterval(() => {
|
|
7695
|
-
const o = g.current || Date.now(), r = (Date.now() - o) / 1e3,
|
|
7696
|
-
if (B.current && (B.current.style.width = `${p}%`), D.current && (D.current.textContent = `${p}%`), e.current && (e.current.style.strokeDashoffset = String(RP * (1 -
|
|
7695
|
+
const o = g.current || Date.now(), r = (Date.now() - o) / 1e3, z = Math.min(95, r / vP * 100), p = Math.round(z);
|
|
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
|
}
|
|
@@ -7772,13 +7772,13 @@ function cB({
|
|
|
7772
7772
|
`fl-${r}`
|
|
7773
7773
|
)),
|
|
7774
7774
|
[f.leftIrisCenter, f.rightIrisCenter].map((i, o) => {
|
|
7775
|
-
const r = o === 0 ? f.leftIrisRing : f.rightIrisRing,
|
|
7775
|
+
const r = o === 0 ? f.leftIrisRing : f.rightIrisRing, z = r?.length ? Math.abs((r[0]?.x ?? i.x) - (r[2]?.x ?? i.x)) * e / 2 : 6;
|
|
7776
7776
|
return /* @__PURE__ */ A(
|
|
7777
7777
|
"circle",
|
|
7778
7778
|
{
|
|
7779
7779
|
cx: i.x * e,
|
|
7780
7780
|
cy: i.y * B,
|
|
7781
|
-
r: Math.max(6,
|
|
7781
|
+
r: Math.max(6, z),
|
|
7782
7782
|
fill: "none",
|
|
7783
7783
|
stroke: "rgba(255,230,120,0.95)",
|
|
7784
7784
|
strokeWidth: "2.5",
|
|
@@ -7845,13 +7845,13 @@ 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
|
-
], i = g ? D : C, o = g ? !!e : n, [r,
|
|
7848
|
+
], i = 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
|
-
|
|
7854
|
+
z((h) => Math.min(h + 1, i.length - 1));
|
|
7855
7855
|
}, g ? 2200 : 900);
|
|
7856
7856
|
return () => clearInterval(F);
|
|
7857
7857
|
}, [o, i.length, g]);
|
|
@@ -7917,13 +7917,13 @@ 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
|
-
], i = e, o = B, r = Math.max(i, o) / 500,
|
|
7920
|
+
], i = e, o = B, r = Math.max(i, o) / 500, z = Math.max(5, 3 * r), p = Math.max(7, 5 * r);
|
|
7921
7921
|
return /* @__PURE__ */ A("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${i} ${o}`, preserveAspectRatio: "xMidYMid meet", children: D.map(({ key: T, line: F, label: h }, W) => {
|
|
7922
7922
|
if (!F || typeof F.x1 != "number" || typeof F.x2 != "number" || typeof F.y != "number") return null;
|
|
7923
|
-
const t = F.x1 * i, k = F.x2 * i, u = F.y * o, v = k - t, I = v * 0.06,
|
|
7923
|
+
const t = F.x1 * i, k = F.x2 * i, u = F.y * o, v = k - t, I = v * 0.06, O = (t + k) / 2, m = n.find((mA) => {
|
|
7924
7924
|
const dA = mA.area.toLowerCase().trim();
|
|
7925
7925
|
return !!(dA === T || T === "chest" && (dA.includes("bust") || dA.includes("chest")) || T === "waist" && dA.includes("waist") || T === "hips" && (dA.includes("hip") || dA === "hips"));
|
|
7926
|
-
}), K = m ? C(m.fit) : "#2154EF", E = W * 0.35, gA = `M ${t} ${u} Q ${
|
|
7926
|
+
}), K = m ? C(m.fit) : "#2154EF", E = W * 0.35, gA = `M ${t} ${u} Q ${O} ${u + I} ${k} ${u}`, c = v * 1.05, hA = m ? m.fit === "good" ? "✓ Fit" : m.isLength ? m.fit.includes("short") || m.fit.includes("tight") ? "Short" : "Long" : m.fit.includes("tight") ? "Tight" : "Loose" : h, l = Math.round(14 * r), y = hA.length * l * 0.62, sA = i - k - 12 * r < y, V = sA ? t - 10 * r : k + 10 * r, s = sA ? "end" : "start", PA = sA ? t : k, RA = sA ? t - 6 * r : k + 6 * r;
|
|
7927
7927
|
return /* @__PURE__ */ P("g", { children: [
|
|
7928
7928
|
/* @__PURE__ */ A(
|
|
7929
7929
|
"path",
|
|
@@ -7931,7 +7931,7 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7931
7931
|
d: gA,
|
|
7932
7932
|
fill: "none",
|
|
7933
7933
|
stroke: K,
|
|
7934
|
-
strokeWidth:
|
|
7934
|
+
strokeWidth: z,
|
|
7935
7935
|
strokeLinecap: "round",
|
|
7936
7936
|
strokeDasharray: c,
|
|
7937
7937
|
strokeDashoffset: c,
|
|
@@ -8041,7 +8041,7 @@ function DP({
|
|
|
8041
8041
|
onBack: i,
|
|
8042
8042
|
t: o,
|
|
8043
8043
|
productImage: r,
|
|
8044
|
-
productTitle:
|
|
8044
|
+
productTitle: z,
|
|
8045
8045
|
isMobile: p,
|
|
8046
8046
|
isTryOnImage: T,
|
|
8047
8047
|
showLines: F,
|
|
@@ -8052,42 +8052,42 @@ function DP({
|
|
|
8052
8052
|
tryOnProcessing: u,
|
|
8053
8053
|
backLabel: v,
|
|
8054
8054
|
internationalSizes: I,
|
|
8055
|
-
continueLabel:
|
|
8055
|
+
continueLabel: O,
|
|
8056
8056
|
renderRaw: m = !1,
|
|
8057
8057
|
sectionFound: K
|
|
8058
8058
|
}) {
|
|
8059
|
-
const E = g?.recommendedSize || "", [gA, c] = j(null), hA = B.toLowerCase(), l = hA.includes("mm") ? "mm" : hA.includes("cm") ? "cm" : "in", y = C || l,
|
|
8059
|
+
const E = g?.recommendedSize || "", [gA, c] = j(null), hA = B.toLowerCase(), l = hA.includes("mm") ? "mm" : hA.includes("cm") ? "cm" : "in", y = C || l, YA = (a) => hn(a, y, l), sA = (a) => UB(a, y, l), V = I ? Object.keys(I) : [], [s, PA] = j(null), RA = D?.secResult?.recommendedSize || "", [mA, dA] = j(null), ZA = wf(() => {
|
|
8060
8060
|
if (!D) return [];
|
|
8061
|
-
const a = D.section, X = a.headers.findIndex((EA) => /size|taglia|größe|taille/i.test(EA.trim())), BA = X >= 0 ? X : 0,
|
|
8061
|
+
const a = D.section, X = a.headers.findIndex((EA) => /size|taglia|größe|taille/i.test(EA.trim())), BA = X >= 0 ? X : 0, H = a.headers[BA] || "Size", oA = a.rows.map((EA) => Uf(EA, BA, H)).filter(Boolean);
|
|
8062
8062
|
return [...new Set(oA)];
|
|
8063
|
-
}, [D]), Hf =
|
|
8063
|
+
}, [D]), Hf = wf(() => {
|
|
8064
8064
|
if (!D) return {};
|
|
8065
8065
|
const a = D.section, X = a.headers.findIndex((oA) => /size|taglia|größe|taille/i.test(oA.trim()));
|
|
8066
8066
|
if (X < 0) return {};
|
|
8067
8067
|
let BA = a.headers.findIndex((oA) => /height|altezza|hauteur|größe|tall/i.test(oA.trim()) && !/size/i.test(oA));
|
|
8068
8068
|
if (BA < 0 && (BA = a.headers.findIndex((oA, EA) => EA !== X)), BA < 0) return {};
|
|
8069
|
-
const
|
|
8069
|
+
const H = {};
|
|
8070
8070
|
for (const oA of a.rows) {
|
|
8071
|
-
const EA = Uf(oA, X, a.headers[X] || "Size"),
|
|
8072
|
-
EA &&
|
|
8071
|
+
const EA = Uf(oA, X, a.headers[X] || "Size"), uA = Uf(oA, BA, a.headers[BA] || "");
|
|
8072
|
+
EA && uA && (H[String(EA).trim()] = String(uA).trim());
|
|
8073
8073
|
}
|
|
8074
|
-
return
|
|
8075
|
-
}, [D]), J =
|
|
8074
|
+
return H;
|
|
8075
|
+
}, [D]), J = wf(() => {
|
|
8076
8076
|
const a = n.headers.findIndex((X) => /size|taglia|größe|taille/i.test(X.trim()));
|
|
8077
8077
|
if (a >= 0) return a;
|
|
8078
8078
|
for (let X = 0; X < n.headers.length; X++) {
|
|
8079
8079
|
const BA = n.headers[X];
|
|
8080
|
-
if (n.rows.some((
|
|
8080
|
+
if (n.rows.some((H) => /^(XXS|XS|S|M|L|XL|XXL|XXXL|ONE SIZE|\d{1,2})$/i.test(Uf(H, X, BA)))) return X;
|
|
8081
8081
|
}
|
|
8082
8082
|
return 0;
|
|
8083
|
-
}, [n]), UA = n.headers[J] || "Size", TA =
|
|
8083
|
+
}, [n]), UA = n.headers[J] || "Size", TA = wf(() => {
|
|
8084
8084
|
const a = n.rows.map((X) => Uf(X, J, UA)).filter(Boolean);
|
|
8085
8085
|
return [...new Set(a)];
|
|
8086
|
-
}, [n, J, UA]),
|
|
8086
|
+
}, [n, J, UA]), XA = gA || E, VA = XA === E, kA = wf(() => {
|
|
8087
8087
|
if (VA) return null;
|
|
8088
|
-
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i, BA = a.some((
|
|
8088
|
+
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i, BA = a.some((H) => X.test(H.fit || ""));
|
|
8089
8089
|
return o(BA ? "Not Recommended" : "Your Selection");
|
|
8090
|
-
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] :
|
|
8090
|
+
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : XA, SA = wf(() => {
|
|
8091
8091
|
const a = [];
|
|
8092
8092
|
for (let X = 0; X < n.headers.length; X++) {
|
|
8093
8093
|
const BA = (n.headers[X] || "").toLowerCase();
|
|
@@ -8099,25 +8099,25 @@ function DP({
|
|
|
8099
8099
|
a.push("in");
|
|
8100
8100
|
continue;
|
|
8101
8101
|
}
|
|
8102
|
-
let
|
|
8102
|
+
let H = null;
|
|
8103
8103
|
for (const oA of n.rows) {
|
|
8104
8104
|
const EA = String(Uf(oA, X, n.headers[X]) || "").trim();
|
|
8105
8105
|
if (EA) {
|
|
8106
8106
|
if (/cm\b|centimeter/i.test(EA)) {
|
|
8107
|
-
|
|
8107
|
+
H = "cm";
|
|
8108
8108
|
break;
|
|
8109
8109
|
}
|
|
8110
8110
|
if (/in\b|inch|"$/i.test(EA)) {
|
|
8111
|
-
|
|
8111
|
+
H = "in";
|
|
8112
8112
|
break;
|
|
8113
8113
|
}
|
|
8114
8114
|
}
|
|
8115
8115
|
}
|
|
8116
|
-
a.push(
|
|
8116
|
+
a.push(H);
|
|
8117
8117
|
}
|
|
8118
8118
|
return a;
|
|
8119
8119
|
}, [n]), ff = jA((a, X) => {
|
|
8120
|
-
const BA = a.toLowerCase().trim(),
|
|
8120
|
+
const BA = a.toLowerCase().trim(), H = B === "cm" || B === "", oA = H ? "cm" : "in", EA = [];
|
|
8121
8121
|
for (let AA = 0; AA < n.headers.length; AA++) {
|
|
8122
8122
|
const LA = (n.headers[AA] || "").toLowerCase().trim();
|
|
8123
8123
|
if (LA === BA) {
|
|
@@ -8128,27 +8128,27 @@ function DP({
|
|
|
8128
8128
|
(Pf === BA || LA.includes(BA) || BA.includes(Pf)) && EA.push(AA);
|
|
8129
8129
|
}
|
|
8130
8130
|
if (EA.length === 0) return null;
|
|
8131
|
-
let
|
|
8132
|
-
|
|
8133
|
-
const
|
|
8131
|
+
let uA = EA.find((AA) => SA[AA] === oA);
|
|
8132
|
+
uA == null && (uA = EA[0]);
|
|
8133
|
+
const of = n.headers[uA], N = X.trim().toLowerCase();
|
|
8134
8134
|
let nA = n.rows.find((AA) => Uf(AA, J, UA) === X);
|
|
8135
8135
|
if (nA || (nA = n.rows.find((AA) => Uf(AA, J, UA).trim().toLowerCase() === N)), nA || (nA = n.rows.find((AA) => {
|
|
8136
8136
|
const LA = Uf(AA, J, UA).trim().toLowerCase();
|
|
8137
8137
|
return LA.startsWith(N) || N.startsWith(LA);
|
|
8138
8138
|
})), !nA) return null;
|
|
8139
|
-
const Bf = Uf(nA,
|
|
8139
|
+
const Bf = Uf(nA, uA, of);
|
|
8140
8140
|
if (!Bf) return null;
|
|
8141
|
-
const FA = QP(Bf), OA = SA[
|
|
8142
|
-
if (OA === "in" &&
|
|
8141
|
+
const FA = QP(Bf), OA = SA[uA];
|
|
8142
|
+
if (OA === "in" && H) {
|
|
8143
8143
|
const AA = (LA) => +(LA * 2.54).toFixed(1);
|
|
8144
8144
|
return { range: String(AA(FA.min)) + (FA.min !== FA.max ? "–" + String(AA(FA.max)) : ""), min: AA(FA.min), max: AA(FA.max) };
|
|
8145
8145
|
}
|
|
8146
|
-
if (OA === "cm" && !
|
|
8146
|
+
if (OA === "cm" && !H) {
|
|
8147
8147
|
const AA = (LA) => +(LA / 2.54).toFixed(1);
|
|
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, J, UA, B, SA]), rA =
|
|
8151
|
+
}, [n, J, UA, B, SA]), rA = wf(() => {
|
|
8152
8152
|
if (m)
|
|
8153
8153
|
return (g?.matchDetails || []).map((nA) => ({
|
|
8154
8154
|
area: nA.measurement.replace(/\s*\(.*?\)\s*$/, "").trim() || nA.measurement,
|
|
@@ -8159,11 +8159,11 @@ function DP({
|
|
|
8159
8159
|
chartLabel: "",
|
|
8160
8160
|
isLength: !1
|
|
8161
8161
|
}));
|
|
8162
|
-
const a = g?.matchDetails || [], X = D?.secResult?.matchDetails || [], BA = [...a, ...X],
|
|
8162
|
+
const a = g?.matchDetails || [], X = D?.secResult?.matchDetails || [], BA = [...a, ...X], H = g?.length || "", oA = (g?.availableLengths?.length || 0) > 0, EA = RA || H, uA = !!(D || oA);
|
|
8163
8163
|
if (!BA.length) return [];
|
|
8164
|
-
const
|
|
8164
|
+
const of = new Set(X.length > 0 ? X.map((N) => N.measurement) : uA ? ["Height"] : []);
|
|
8165
8165
|
return BA.map((N) => {
|
|
8166
|
-
if (
|
|
8166
|
+
if (of.has(N.measurement)) {
|
|
8167
8167
|
const U = e[N.measurement.toLowerCase()] || kf(N.userValue), R = mA || EA || N.chartRange;
|
|
8168
8168
|
if (!D)
|
|
8169
8169
|
return { area: N.measurement + " (" + R + ")", userNum: U, chartLabel: R, fit: "good", isLength: !0 };
|
|
@@ -8191,14 +8191,14 @@ function DP({
|
|
|
8191
8191
|
}
|
|
8192
8192
|
const nA = e[N.measurement.toLowerCase()] || kf(N.userValue);
|
|
8193
8193
|
let { min: Bf, max: FA } = QP(N.chartRange), OA = N.chartRange;
|
|
8194
|
-
const AA = ff(N.measurement,
|
|
8194
|
+
const AA = ff(N.measurement, XA);
|
|
8195
8195
|
AA && (OA = AA.range, Bf = AA.min, FA = AA.max);
|
|
8196
|
-
const LA = FA - Bf, Pf = LA > 0 ? LA * 0.5 : Bf * 0.05 || 3, lA = N.measurement.toLowerCase(),
|
|
8196
|
+
const LA = FA - Bf, Pf = LA > 0 ? LA * 0.5 : Bf * 0.05 || 3, lA = N.measurement.toLowerCase(), x = /length|inseam|sleeve|hem|rise/.test(lA);
|
|
8197
8197
|
let q;
|
|
8198
8198
|
const QA = Math.max((FA || Bf) * 0.03, 0.5);
|
|
8199
8199
|
if (nA >= Bf - QA && nA <= FA + QA)
|
|
8200
8200
|
q = "good";
|
|
8201
|
-
else if (
|
|
8201
|
+
else if (x) {
|
|
8202
8202
|
const U = nA > FA ? nA - FA : Bf - nA;
|
|
8203
8203
|
q = (U > Pf * 2 ? "too-" : U > Pf ? "" : "a-bit-") + (nA > FA ? "short" : "long");
|
|
8204
8204
|
} else if (nA < Bf) {
|
|
@@ -8208,9 +8208,9 @@ function DP({
|
|
|
8208
8208
|
const U = nA - FA;
|
|
8209
8209
|
q = U > Pf * 2 ? "too-tight" : U > Pf ? "tight" : "a-bit-tight";
|
|
8210
8210
|
}
|
|
8211
|
-
return { area: N.measurement, userNum: nA, chartLabel: kP(OA), fit: q, isLength:
|
|
8211
|
+
return { area: N.measurement, userNum: nA, chartLabel: kP(OA), fit: q, isLength: x };
|
|
8212
8212
|
});
|
|
8213
|
-
}, [g, D, e,
|
|
8213
|
+
}, [g, D, e, XA, E, ff, mA, RA, m]), nf = rA.filter(
|
|
8214
8214
|
(a) => a.fit === "good" || a.fit === "a-bit-tight" || a.fit === "a-bit-loose"
|
|
8215
8215
|
).length, xA = rA.length > 0 ? Math.round(nf / rA.length * 100) : 0, Ef = !m, eA = g, $ = eA?.size || E, _A = (g?.matchDetails || []).find(
|
|
8216
8216
|
(a) => /inseam|length/i.test(a.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(a.measurement)
|
|
@@ -8220,18 +8220,18 @@ function DP({
|
|
|
8220
8220
|
if (a < 0) return GA.slice(0, 3);
|
|
8221
8221
|
const X = Math.max(0, Math.min(GA.length - 3, a - 1));
|
|
8222
8222
|
return GA.slice(X, X + 3);
|
|
8223
|
-
})(),
|
|
8224
|
-
if (
|
|
8225
|
-
const a =
|
|
8226
|
-
if (a < 0) return
|
|
8227
|
-
const X = Math.max(0, Math.min(
|
|
8228
|
-
return
|
|
8223
|
+
})(), bA = gf.length > 0 ? gf : ZA, WA = (() => {
|
|
8224
|
+
if (bA.length <= 3) return bA;
|
|
8225
|
+
const a = bA.indexOf(cf);
|
|
8226
|
+
if (a < 0) return bA.slice(0, 3);
|
|
8227
|
+
const X = Math.max(0, Math.min(bA.length - 3, a - 1));
|
|
8228
|
+
return bA.slice(X, X + 3);
|
|
8229
8229
|
})();
|
|
8230
8230
|
if (p) {
|
|
8231
|
-
const a = f.replace(/\s*[—–-]\s*.*/g, ""), X = (
|
|
8232
|
-
const oA =
|
|
8231
|
+
const a = f.replace(/\s*[—–-]\s*.*/g, ""), X = (H) => {
|
|
8232
|
+
const oA = H.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8233
8233
|
return oA.includes("chest") || oA.includes("bust") ? o("Full circumference at the widest point.") : oA.includes("waist") ? o("Circumference at the natural waistline.") : oA.includes("hip") ? o("Circumference at the fullest point.") : oA.includes("shoulder") ? o("Shoulder edge to shoulder edge.") : oA.includes("sleeve") || oA.includes("arm") ? o("Shoulder seam to cuff edge.") : oA.includes("neck") || oA.includes("collar") ? o("Around the base of the neck.") : oA.includes("inseam") || oA.includes("inside leg") ? o("Inner leg seam length.") : oA.includes("thigh") ? o("Circumference around the upper leg.") : oA.includes("length") || oA.includes("height") ? o("Top to bottom length.") : "";
|
|
8234
|
-
}, BA = (
|
|
8234
|
+
}, BA = (H, oA) => oA && H === "good" ? o("EDITORIAL LENGTH") : H === "good" ? o("PERFECT TENSION") : H === "a-bit-tight" ? o("SLIGHTLY TIGHT") : H === "a-bit-loose" ? o("SLIGHT EASE") : H.includes("tight") ? o("TIGHT") : H.includes("loose") ? o("LOOSE") : o("FIT");
|
|
8235
8235
|
return /* @__PURE__ */ A("div", { className: "ps-msd-root", children: /* @__PURE__ */ P("div", { className: "ps-msd-scroll", children: [
|
|
8236
8236
|
/* @__PURE__ */ P("div", { className: "ps-msd-topbar", children: [
|
|
8237
8237
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-msd-back", onClick: i, "aria-label": o("Back"), children: /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "20", height: "20", children: [
|
|
@@ -8250,7 +8250,7 @@ function DP({
|
|
|
8250
8250
|
"img",
|
|
8251
8251
|
{
|
|
8252
8252
|
src: r,
|
|
8253
|
-
alt:
|
|
8253
|
+
alt: z || "",
|
|
8254
8254
|
className: "ps-msd-image-img",
|
|
8255
8255
|
onLoad: t
|
|
8256
8256
|
}
|
|
@@ -8293,13 +8293,13 @@ function DP({
|
|
|
8293
8293
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", style: { margin: 0, lineHeight: 1.5 }, children: o("Your measurements are outside this product's size range. You can still try it on visually below.") })
|
|
8294
8294
|
] }) }),
|
|
8295
8295
|
K !== !1 && /* @__PURE__ */ P("div", { className: "ps-msd-card", children: [
|
|
8296
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: o(
|
|
8296
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-card-eyebrow", children: o(XA === $ ? "RECOMMENDED SIZE" : "TRYING SIZE") }),
|
|
8297
8297
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "10px", marginTop: "6px", marginBottom: "4px" }, children: [
|
|
8298
8298
|
V.length > 1 && /* @__PURE__ */ P(
|
|
8299
8299
|
"select",
|
|
8300
8300
|
{
|
|
8301
8301
|
value: s || "",
|
|
8302
|
-
onChange: (
|
|
8302
|
+
onChange: (H) => PA(H.target.value || null),
|
|
8303
8303
|
style: {
|
|
8304
8304
|
fontSize: "11px",
|
|
8305
8305
|
fontWeight: 600,
|
|
@@ -8316,7 +8316,7 @@ function DP({
|
|
|
8316
8316
|
"aria-label": o("Display size in country"),
|
|
8317
8317
|
children: [
|
|
8318
8318
|
/* @__PURE__ */ A("option", { value: "", children: o("Standard") }),
|
|
8319
|
-
V.map((
|
|
8319
|
+
V.map((H) => /* @__PURE__ */ A("option", { value: H, children: H }, H))
|
|
8320
8320
|
]
|
|
8321
8321
|
}
|
|
8322
8322
|
),
|
|
@@ -8355,31 +8355,31 @@ function DP({
|
|
|
8355
8355
|
K !== !1 && rA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-blueprint", children: [
|
|
8356
8356
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: o("MEASUREMENT BLUEPRINT") }),
|
|
8357
8357
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
8358
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: rA.map((
|
|
8359
|
-
const EA =
|
|
8358
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: rA.map((H, oA) => {
|
|
8359
|
+
const EA = H.isLength && H.fit.includes("short") || H.fit.includes("tight"), uA = H.fit === "good" ? "ps-good" : EA ? "ps-tight" : "ps-loose", of = X(H.area), N = String(oA + 1).padStart(2, "0");
|
|
8360
8360
|
return /* @__PURE__ */ P("div", { className: "ps-msd-row", children: [
|
|
8361
8361
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-num", children: [
|
|
8362
|
-
|
|
8362
|
+
N,
|
|
8363
8363
|
" ",
|
|
8364
|
-
|
|
8364
|
+
H.area.toUpperCase()
|
|
8365
8365
|
] }),
|
|
8366
|
-
|
|
8366
|
+
of && /* @__PURE__ */ A("p", { className: "ps-msd-row-desc", children: of }),
|
|
8367
8367
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cells", children: [
|
|
8368
8368
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell", children: [
|
|
8369
8369
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: o("USER") }),
|
|
8370
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: m ?
|
|
8370
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: m ? H.rawUserValue || "—" : isNaN(H.userNum) || H.userNum === 0 ? "—" : `${YA(H.userNum)} ${B}` })
|
|
8371
8371
|
] }),
|
|
8372
8372
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell ps-right", children: [
|
|
8373
8373
|
/* @__PURE__ */ P("span", { className: "ps-msd-cell-label", children: [
|
|
8374
8374
|
o("SIZE"),
|
|
8375
8375
|
" ",
|
|
8376
|
-
|
|
8376
|
+
XA
|
|
8377
8377
|
] }),
|
|
8378
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: m ?
|
|
8378
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: m ? H.rawChartRange || "—" : sA(H.chartLabel) })
|
|
8379
8379
|
] })
|
|
8380
8380
|
] }),
|
|
8381
|
-
/* @__PURE__ */ P("div", { className: `ps-msd-row-badge ${
|
|
8382
|
-
|
|
8381
|
+
/* @__PURE__ */ P("div", { className: `ps-msd-row-badge ${uA}`, children: [
|
|
8382
|
+
H.isLength ? Hn(H.fit, o).toUpperCase() : BA(H.fit, H.isLength),
|
|
8383
8383
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "11", height: "11", children: /* @__PURE__ */ A("path", { d: "M3 8l3.5 3.5L13 5" }) })
|
|
8384
8384
|
] })
|
|
8385
8385
|
] }, oA);
|
|
@@ -8387,34 +8387,34 @@ function DP({
|
|
|
8387
8387
|
] }),
|
|
8388
8388
|
K !== !1 && _.length > 1 && /* @__PURE__ */ P("div", { className: "ps-msd-sizes", children: [
|
|
8389
8389
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: o("TRY ANOTHER SIZE") }),
|
|
8390
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: _.map((
|
|
8390
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: _.map((H) => /* @__PURE__ */ A(
|
|
8391
8391
|
"button",
|
|
8392
8392
|
{
|
|
8393
8393
|
type: "button",
|
|
8394
|
-
className: `ps-msd-size-pill${
|
|
8395
|
-
onClick: () => c(
|
|
8396
|
-
children:
|
|
8394
|
+
className: `ps-msd-size-pill${H === XA ? " ps-active" : ""}`,
|
|
8395
|
+
onClick: () => c(H === E ? null : H),
|
|
8396
|
+
children: H
|
|
8397
8397
|
},
|
|
8398
|
-
|
|
8398
|
+
H
|
|
8399
8399
|
)) })
|
|
8400
8400
|
] }),
|
|
8401
8401
|
K !== !1 && WA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-sizes", children: [
|
|
8402
8402
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: o("LENGTH ADJUSTMENT") }),
|
|
8403
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: WA.map((
|
|
8404
|
-
const oA = String(qA ?? "").trim() === String(
|
|
8403
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: WA.map((H) => {
|
|
8404
|
+
const oA = String(qA ?? "").trim() === String(H ?? "").trim(), EA = Hf[String(H).trim()];
|
|
8405
8405
|
return /* @__PURE__ */ P(
|
|
8406
8406
|
"button",
|
|
8407
8407
|
{
|
|
8408
8408
|
type: "button",
|
|
8409
8409
|
className: `ps-msd-size-pill${oA ? " ps-active" : ""}`,
|
|
8410
|
-
onClick: () => dA(
|
|
8410
|
+
onClick: () => dA(H === cf ? null : H),
|
|
8411
8411
|
style: { display: "flex", flexDirection: "column", alignItems: "center", lineHeight: 1.15, gap: "0.15vw" },
|
|
8412
8412
|
children: [
|
|
8413
|
-
/* @__PURE__ */ A("span", { children:
|
|
8413
|
+
/* @__PURE__ */ A("span", { children: H }),
|
|
8414
8414
|
EA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: EA })
|
|
8415
8415
|
]
|
|
8416
8416
|
},
|
|
8417
|
-
|
|
8417
|
+
H
|
|
8418
8418
|
);
|
|
8419
8419
|
}) })
|
|
8420
8420
|
] }),
|
|
@@ -8492,7 +8492,7 @@ function DP({
|
|
|
8492
8492
|
gap: 6
|
|
8493
8493
|
},
|
|
8494
8494
|
children: [
|
|
8495
|
-
|
|
8495
|
+
O || o("Continue"),
|
|
8496
8496
|
" →"
|
|
8497
8497
|
]
|
|
8498
8498
|
}
|
|
@@ -8585,12 +8585,12 @@ function DP({
|
|
|
8585
8585
|
/* @__PURE__ */ A("th", { style: { textAlign: "right", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Fit Result") })
|
|
8586
8586
|
] }) }),
|
|
8587
8587
|
/* @__PURE__ */ A("tbody", { children: rA.map((a, X) => {
|
|
8588
|
-
const BA = a.fit === "good" ? "#2154EF" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "#dc2626" : "#d97706" : a.fit.includes("tight") ? "#dc2626" : "#d97706",
|
|
8588
|
+
const BA = a.fit === "good" ? "#2154EF" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "#dc2626" : "#d97706" : a.fit.includes("tight") ? "#dc2626" : "#d97706", H = a.fit === "good" ? "rgba(33,84,239,0.08)" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
8589
8589
|
return /* @__PURE__ */ P("tr", { style: { borderBottom: X < rA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
8590
8590
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: a.area }),
|
|
8591
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: m ? a.rawUserValue || "—" : isNaN(a.userNum) || a.userNum === 0 ? "—" : `${
|
|
8591
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: m ? a.rawUserValue || "—" : isNaN(a.userNum) || a.userNum === 0 ? "—" : `${YA(a.userNum)} ${B}` }),
|
|
8592
8592
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: m ? a.rawChartRange || "—" : sA(a.chartLabel) }),
|
|
8593
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: BA, background:
|
|
8593
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: BA, background: H, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: a.isLength ? Hn(a.fit, o) : jB(a.fit, o) }) })
|
|
8594
8594
|
] }, X);
|
|
8595
8595
|
}) })
|
|
8596
8596
|
] }) }),
|
|
@@ -8603,7 +8603,7 @@ function DP({
|
|
|
8603
8603
|
o("Size")
|
|
8604
8604
|
] }),
|
|
8605
8605
|
/* @__PURE__ */ A("div", { style: { display: "flex", gap: "0.3vw", flexWrap: "wrap" }, children: _.map((a) => {
|
|
8606
|
-
const X = a ===
|
|
8606
|
+
const X = a === XA;
|
|
8607
8607
|
return /* @__PURE__ */ A(
|
|
8608
8608
|
"button",
|
|
8609
8609
|
{
|
|
@@ -8723,7 +8723,7 @@ function DP({
|
|
|
8723
8723
|
onMouseEnter: (a) => a.currentTarget.style.opacity = "0.9",
|
|
8724
8724
|
onMouseLeave: (a) => a.currentTarget.style.opacity = "1",
|
|
8725
8725
|
children: [
|
|
8726
|
-
|
|
8726
|
+
O || o("Continue"),
|
|
8727
8727
|
" →"
|
|
8728
8728
|
]
|
|
8729
8729
|
}
|
|
@@ -8742,7 +8742,7 @@ function EB({
|
|
|
8742
8742
|
setView: i,
|
|
8743
8743
|
handleDownload: o,
|
|
8744
8744
|
onRetryWithFit: r,
|
|
8745
|
-
retryLoading:
|
|
8745
|
+
retryLoading: z,
|
|
8746
8746
|
selectedFile: p,
|
|
8747
8747
|
previewUrl: T,
|
|
8748
8748
|
handleFileSelect: F,
|
|
@@ -8753,14 +8753,14 @@ function EB({
|
|
|
8753
8753
|
faceLandmarks: u = null,
|
|
8754
8754
|
measurementType: v = "body",
|
|
8755
8755
|
estimationDone: I = !1,
|
|
8756
|
-
activeSection:
|
|
8756
|
+
activeSection: O,
|
|
8757
8757
|
setActiveSection: m,
|
|
8758
8758
|
onResetTryOn: K,
|
|
8759
8759
|
onClose: E,
|
|
8760
8760
|
userHeightCm: gA,
|
|
8761
8761
|
t: c
|
|
8762
8762
|
}) {
|
|
8763
|
-
const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [
|
|
8763
|
+
const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [YA, sA] = j({}), V = QP, s = jA((U, R, G) => Uf(U, R, G), []), PA = wf(() => {
|
|
8764
8764
|
if (!g?.headers || !g?.rows) return -1;
|
|
8765
8765
|
const U = g.headers.findIndex((R) => /size|taglia|größe|taille/i.test(R.trim()));
|
|
8766
8766
|
if (U >= 0) return U;
|
|
@@ -8770,8 +8770,8 @@ function EB({
|
|
|
8770
8770
|
}
|
|
8771
8771
|
return 0;
|
|
8772
8772
|
}, [g, s]), RA = g?.headers?.[PA] || c("Size");
|
|
8773
|
-
|
|
8774
|
-
const mA =
|
|
8773
|
+
wf(() => PA < 0 || !g?.rows ? [] : g.rows.map((U) => s(U, PA, RA)).filter(Boolean), [g, PA, RA, s]);
|
|
8774
|
+
const mA = wf(() => {
|
|
8775
8775
|
if (!g?.headers || !g?.rows) return [];
|
|
8776
8776
|
const U = [];
|
|
8777
8777
|
for (let R = 0; R < g.headers.length; R++) {
|
|
@@ -8831,8 +8831,8 @@ function EB({
|
|
|
8831
8831
|
}
|
|
8832
8832
|
return { range: yA, ...KA };
|
|
8833
8833
|
}, [g, PA, RA, y, s, V, mA]), ZA = n?.recommendedSize || "";
|
|
8834
|
-
|
|
8835
|
-
const [Hf, J] = j("fit"), [UA, TA] = j(null), [
|
|
8834
|
+
wf(() => n?.internationalSizes || {}, [n]);
|
|
8835
|
+
const [Hf, J] = j("fit"), [UA, TA] = j(null), [XA, VA] = j(!1), [kA, vA] = j(!1), [SA, ff] = j(!1), [rA, nf] = j(null), [xA, Ef] = j(!1), [eA, $] = j({ w: 800, h: 1200 }), _A = jA((U) => {
|
|
8836
8836
|
const R = U.currentTarget;
|
|
8837
8837
|
R.naturalWidth && R.naturalHeight && $({ w: R.naturalWidth, h: R.naturalHeight });
|
|
8838
8838
|
}, []);
|
|
@@ -8849,16 +8849,16 @@ function EB({
|
|
|
8849
8849
|
}, [e, t]);
|
|
8850
8850
|
const [Of, cf] = j(!1), [Mf, gf] = j(!1);
|
|
8851
8851
|
iA(null);
|
|
8852
|
-
const [qA, GA] = j(!1), [_,
|
|
8852
|
+
const [qA, GA] = j(!1), [_, bA] = j(null), [WA, a] = j(!1), X = iA(null), [BA, H] = j(null), [oA, EA] = j(!1);
|
|
8853
8853
|
JA(() => {
|
|
8854
8854
|
if (_) {
|
|
8855
8855
|
const U = URL.createObjectURL(_);
|
|
8856
|
-
return
|
|
8856
|
+
return H(U), () => URL.revokeObjectURL(U);
|
|
8857
8857
|
}
|
|
8858
|
-
|
|
8858
|
+
H(null);
|
|
8859
8859
|
}, [_]);
|
|
8860
|
-
const
|
|
8861
|
-
|
|
8860
|
+
const uA = UA || ZA;
|
|
8861
|
+
wf(() => {
|
|
8862
8862
|
if (!n?.matchDetails?.length) return [];
|
|
8863
8863
|
const U = /* @__PURE__ */ new Set();
|
|
8864
8864
|
return n.matchDetails.filter((G) => {
|
|
@@ -8867,8 +8867,8 @@ function EB({
|
|
|
8867
8867
|
}).map((G) => {
|
|
8868
8868
|
const S = kf(G.userValue);
|
|
8869
8869
|
let aA = G.chartRange, fA = G.fit;
|
|
8870
|
-
if (
|
|
8871
|
-
const NA = dA(G.measurement,
|
|
8870
|
+
if (uA !== ZA) {
|
|
8871
|
+
const NA = dA(G.measurement, uA);
|
|
8872
8872
|
if (NA && NA.min > 0) {
|
|
8873
8873
|
aA = kP(NA.range);
|
|
8874
8874
|
const $A = NA.min, ef = NA.max, yA = ef - $A, KA = yA > 0 ? yA * 0.5 : $A * 0.05 || 3, vf = Math.max((ef || $A) * 5e-3, 0.25);
|
|
@@ -8884,9 +8884,9 @@ function EB({
|
|
|
8884
8884
|
}
|
|
8885
8885
|
return { area: G.measurement, userNum: kf(G.userValue), chartLabel: aA, fit: fA };
|
|
8886
8886
|
});
|
|
8887
|
-
}, [n,
|
|
8887
|
+
}, [n, uA, ZA, dA]), wf(() => {
|
|
8888
8888
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8889
|
-
const U = g.rows.find((G) => s(G, PA, RA) ===
|
|
8889
|
+
const U = g.rows.find((G) => s(G, PA, RA) === uA);
|
|
8890
8890
|
if (!U) return null;
|
|
8891
8891
|
const R = [];
|
|
8892
8892
|
for (let G = 0; G < g.headers.length; G++) {
|
|
@@ -8896,20 +8896,20 @@ function EB({
|
|
|
8896
8896
|
aA && R.push({ header: S, value: aA });
|
|
8897
8897
|
}
|
|
8898
8898
|
return R;
|
|
8899
|
-
}, [g, PA, RA,
|
|
8900
|
-
const
|
|
8899
|
+
}, [g, PA, RA, uA, s]);
|
|
8900
|
+
const of = !!(g?.sections && Object.keys(g.sections).length > 1), N = wf(() => n?.sections && Object.keys(n.sections).length > 0 ? Object.entries(n.sections).map(([U, R]) => {
|
|
8901
8901
|
const G = g?.sections?.[U] || Object.values(g?.sections || {}).find(
|
|
8902
8902
|
(aA) => U.toLowerCase().includes(aA.name?.toLowerCase()?.replace(/\s*(size|sizing)\s*/gi, "").trim() || "---")
|
|
8903
8903
|
) || { headers: [], rows: [], requiredFields: [] }, S = {};
|
|
8904
8904
|
if (R.matchDetails)
|
|
8905
8905
|
for (const aA of R.matchDetails) S[aA.measurement.toLowerCase()] = kf(aA.userValue);
|
|
8906
8906
|
return gA && gA > 0 && !S.height && (S.height = gA), { name: U, section: G, secResult: R, userMeasurements: S };
|
|
8907
|
-
}) : !
|
|
8907
|
+
}) : !of || !g?.sections ? [] : Object.entries(g.sections).map(([U, R]) => {
|
|
8908
8908
|
const G = n?.sections?.[U] || { recommendedSize: n?.recommendedSize || "", matchDetails: [] }, S = {};
|
|
8909
8909
|
if (G.matchDetails)
|
|
8910
8910
|
for (const aA of G.matchDetails) S[aA.measurement.toLowerCase()] = kf(aA.userValue);
|
|
8911
8911
|
return gA && gA > 0 && !S.height && (S.height = gA), { name: U, section: R, secResult: G, userMeasurements: S };
|
|
8912
|
-
}), [
|
|
8912
|
+
}), [of, g, n, gA]), nA = wf(() => N.filter((U) => !zn(U.name)), [N]), Bf = wf(() => N.filter((U) => zn(U.name)), [N]), FA = !!T, OA = FA && (t || f && !n), AA = !FA && f && !n, LA = !!n, Pf = !!e && !t, lA = FA ? LA && Pf : LA, x = NP(), q = v === "face" || v === "head";
|
|
8913
8913
|
n?.found;
|
|
8914
8914
|
const QA = v === "foot";
|
|
8915
8915
|
return console.log("[PS-SDK] SizeResultView render:", {
|
|
@@ -8925,7 +8925,7 @@ function EB({
|
|
|
8925
8925
|
tryOnProcessing: t,
|
|
8926
8926
|
previewUrl: !!T
|
|
8927
8927
|
}), /* @__PURE__ */ P("div", { className: "ps-tryon-sr", children: [
|
|
8928
|
-
|
|
8928
|
+
x && AA && /* @__PURE__ */ A(
|
|
8929
8929
|
rn,
|
|
8930
8930
|
{
|
|
8931
8931
|
productImage: B,
|
|
@@ -8935,14 +8935,14 @@ function EB({
|
|
|
8935
8935
|
t: c
|
|
8936
8936
|
}
|
|
8937
8937
|
),
|
|
8938
|
-
!
|
|
8938
|
+
!x && AA && /* @__PURE__ */ P("div", { className: "ps-tryon-sr-split", children: [
|
|
8939
8939
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-img-col", children: /* @__PURE__ */ A("img", { src: B, alt: C, className: "ps-tryon-sr-product-img" }) }),
|
|
8940
8940
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-right-col", style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", gap: "0.8vw" }, children: [
|
|
8941
8941
|
/* @__PURE__ */ A("div", { className: "ps-tryon-size-loading-spinner" }),
|
|
8942
8942
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.8vw" }, children: c("Generating your size recommendation...") })
|
|
8943
8943
|
] })
|
|
8944
8944
|
] }),
|
|
8945
|
-
|
|
8945
|
+
x && OA && !lA && T && /* @__PURE__ */ A(
|
|
8946
8946
|
rn,
|
|
8947
8947
|
{
|
|
8948
8948
|
previewUrl: T,
|
|
@@ -8953,7 +8953,7 @@ function EB({
|
|
|
8953
8953
|
t: c
|
|
8954
8954
|
}
|
|
8955
8955
|
),
|
|
8956
|
-
!
|
|
8956
|
+
!x && OA && !lA && /* @__PURE__ */ P("div", { className: "ps-tryon-sr-split", children: [
|
|
8957
8957
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-img-col", style: { position: "relative" }, children: [
|
|
8958
8958
|
/* @__PURE__ */ A(
|
|
8959
8959
|
"img",
|
|
@@ -8981,11 +8981,11 @@ function EB({
|
|
|
8981
8981
|
})()
|
|
8982
8982
|
] }),
|
|
8983
8983
|
(lA || n && !OA) && /* @__PURE__ */ P(tA, { children: [
|
|
8984
|
-
|
|
8984
|
+
of ? O ? (
|
|
8985
8985
|
/* ── Detail view for a single section ── */
|
|
8986
8986
|
(() => {
|
|
8987
|
-
const U = nA.find((R) => R.name ===
|
|
8988
|
-
return U ?
|
|
8987
|
+
const U = nA.find((R) => R.name === O);
|
|
8988
|
+
return U ? x ? /* @__PURE__ */ A(
|
|
8989
8989
|
DP,
|
|
8990
8990
|
{
|
|
8991
8991
|
sectionName: U.name,
|
|
@@ -9044,10 +9044,10 @@ function EB({
|
|
|
9044
9044
|
internationalSizes: U.secResult?.internationalSizes,
|
|
9045
9045
|
t: c
|
|
9046
9046
|
}
|
|
9047
|
-
) }, `detail-${
|
|
9047
|
+
) }, `detail-${O}`)
|
|
9048
9048
|
] }) : null;
|
|
9049
9049
|
})()
|
|
9050
|
-
) :
|
|
9050
|
+
) : x ? (
|
|
9051
9051
|
/* ── Mobile section picker: vertical list, fit% badge, try-on CTA ── */
|
|
9052
9052
|
/* @__PURE__ */ A(
|
|
9053
9053
|
HB,
|
|
@@ -9059,13 +9059,13 @@ function EB({
|
|
|
9059
9059
|
sectionEntries: nA.map(({ name: U, secResult: R }) => ({ name: U, secResult: R })),
|
|
9060
9060
|
onSelectSection: (U) => m(U),
|
|
9061
9061
|
onTryOn: () => {
|
|
9062
|
-
|
|
9062
|
+
bA(p || null), GA(!0);
|
|
9063
9063
|
},
|
|
9064
9064
|
tryOnProcessing: t,
|
|
9065
9065
|
resultImageUrl: e,
|
|
9066
9066
|
tryOnDone: !!e && !t,
|
|
9067
9067
|
onTryAgain: () => {
|
|
9068
|
-
K?.(),
|
|
9068
|
+
K?.(), bA(p || null), GA(!0);
|
|
9069
9069
|
},
|
|
9070
9070
|
onClose: E,
|
|
9071
9071
|
showLines: kA,
|
|
@@ -9186,7 +9186,7 @@ function EB({
|
|
|
9186
9186
|
style: { marginTop: 0 },
|
|
9187
9187
|
disabled: t,
|
|
9188
9188
|
onClick: () => {
|
|
9189
|
-
|
|
9189
|
+
bA(p || null), GA(!0);
|
|
9190
9190
|
},
|
|
9191
9191
|
children: [
|
|
9192
9192
|
/* @__PURE__ */ A(hf, { size: 14 }),
|
|
@@ -9205,9 +9205,9 @@ function EB({
|
|
|
9205
9205
|
if (n?.matchDetails)
|
|
9206
9206
|
for (const fA of n.matchDetails) G[fA.measurement.toLowerCase()] = kf(fA.userValue);
|
|
9207
9207
|
const S = c("Your Fit"), aA = () => {
|
|
9208
|
-
e || (
|
|
9208
|
+
e || (bA(p || null), GA(!0));
|
|
9209
9209
|
};
|
|
9210
|
-
return
|
|
9210
|
+
return x ? /* @__PURE__ */ A(
|
|
9211
9211
|
DP,
|
|
9212
9212
|
{
|
|
9213
9213
|
sectionName: S,
|
|
@@ -9277,7 +9277,7 @@ function EB({
|
|
|
9277
9277
|
] });
|
|
9278
9278
|
})()
|
|
9279
9279
|
),
|
|
9280
|
-
qA && !QA && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children:
|
|
9280
|
+
qA && !QA && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children: x ? (
|
|
9281
9281
|
/* ── Mobile: same layout as the AI-sizing photo step
|
|
9282
9282
|
(PhotoStepMobile) — title + subtitle, large preview,
|
|
9283
9283
|
checklist card, primary CTA + RETAKE secondary. ── */
|
|
@@ -9295,7 +9295,7 @@ function EB({
|
|
|
9295
9295
|
style: { display: "none" },
|
|
9296
9296
|
onChange: (U) => {
|
|
9297
9297
|
const R = U.target.files?.[0];
|
|
9298
|
-
R &&
|
|
9298
|
+
R && bA(R);
|
|
9299
9299
|
}
|
|
9300
9300
|
}
|
|
9301
9301
|
),
|
|
@@ -9306,7 +9306,7 @@ function EB({
|
|
|
9306
9306
|
{
|
|
9307
9307
|
type: "button",
|
|
9308
9308
|
className: "ps-pm-preview-remove",
|
|
9309
|
-
onClick: () =>
|
|
9309
|
+
onClick: () => bA(null),
|
|
9310
9310
|
"aria-label": c("Remove photo"),
|
|
9311
9311
|
children: /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
9312
9312
|
/* @__PURE__ */ A("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
@@ -9378,7 +9378,7 @@ function EB({
|
|
|
9378
9378
|
type: "button",
|
|
9379
9379
|
className: "ps-pm-secondary-btn",
|
|
9380
9380
|
onClick: () => {
|
|
9381
|
-
GA(!1),
|
|
9381
|
+
GA(!1), bA(null);
|
|
9382
9382
|
},
|
|
9383
9383
|
children: c("BACK")
|
|
9384
9384
|
}
|
|
@@ -9398,7 +9398,7 @@ function EB({
|
|
|
9398
9398
|
onDrop: (U) => {
|
|
9399
9399
|
U.preventDefault(), a(!1);
|
|
9400
9400
|
const R = U.dataTransfer.files[0];
|
|
9401
|
-
R &&
|
|
9401
|
+
R && bA(R);
|
|
9402
9402
|
},
|
|
9403
9403
|
style: {
|
|
9404
9404
|
flex: 1,
|
|
@@ -9432,7 +9432,7 @@ function EB({
|
|
|
9432
9432
|
style: { display: "none" },
|
|
9433
9433
|
onChange: (U) => {
|
|
9434
9434
|
const R = U.target.files?.[0];
|
|
9435
|
-
R &&
|
|
9435
|
+
R && bA(R);
|
|
9436
9436
|
}
|
|
9437
9437
|
}
|
|
9438
9438
|
)
|
|
@@ -9527,7 +9527,7 @@ function EB({
|
|
|
9527
9527
|
] })
|
|
9528
9528
|
] })
|
|
9529
9529
|
] }) }),
|
|
9530
|
-
|
|
9530
|
+
XA && g && /* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-overlay", children: /* @__PURE__ */ P("div", { className: "ps-tryon-sr-chart-modal", children: [
|
|
9531
9531
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-chart-header", children: [
|
|
9532
9532
|
/* @__PURE__ */ A("h4", { children: c("Full Size Chart") }),
|
|
9533
9533
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => VA(!1), children: "✕" })
|
|
@@ -9556,7 +9556,7 @@ function EB({
|
|
|
9556
9556
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-table-wrap", children: /* @__PURE__ */ P("table", { className: "ps-tryon-sr-chart-table", children: [
|
|
9557
9557
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: g.headers.map((U, R) => /* @__PURE__ */ A("th", { className: R === PA ? "ps-size-col" : "", children: U }, R)) }) }),
|
|
9558
9558
|
/* @__PURE__ */ A("tbody", { children: g.rows.map((U, R) => {
|
|
9559
|
-
const S = s(U, PA, RA) ===
|
|
9559
|
+
const S = s(U, PA, RA) === uA;
|
|
9560
9560
|
return /* @__PURE__ */ A("tr", { className: S ? "ps-active-row" : "", children: g.headers.map((aA, fA) => /* @__PURE__ */ A("td", { className: fA === PA ? "ps-size-col" : "", children: s(U, fA, aA) }, fA)) }, R);
|
|
9561
9561
|
}) })
|
|
9562
9562
|
] }) })
|
|
@@ -9593,13 +9593,13 @@ function aB({
|
|
|
9593
9593
|
{
|
|
9594
9594
|
className: Qf(`ps-tryon-upload${g ? " ps-tryon-drag-over" : ""}`, o.uploadZone),
|
|
9595
9595
|
onClick: () => B.current?.click(),
|
|
9596
|
-
onDragOver: (
|
|
9597
|
-
|
|
9596
|
+
onDragOver: (z) => {
|
|
9597
|
+
z.preventDefault(), e(!0);
|
|
9598
9598
|
},
|
|
9599
9599
|
onDragLeave: () => e(!1),
|
|
9600
|
-
onDrop: (
|
|
9601
|
-
|
|
9602
|
-
const p =
|
|
9600
|
+
onDrop: (z) => {
|
|
9601
|
+
z.preventDefault(), e(!1);
|
|
9602
|
+
const p = z.dataTransfer?.files?.[0];
|
|
9603
9603
|
p && C(p);
|
|
9604
9604
|
},
|
|
9605
9605
|
children: [
|
|
@@ -9610,8 +9610,8 @@ function aB({
|
|
|
9610
9610
|
type: "file",
|
|
9611
9611
|
accept: "image/jpeg,image/png,image/webp",
|
|
9612
9612
|
style: { display: "none" },
|
|
9613
|
-
onChange: (
|
|
9614
|
-
const p =
|
|
9613
|
+
onChange: (z) => {
|
|
9614
|
+
const p = z.target.files?.[0];
|
|
9615
9615
|
p && C(p);
|
|
9616
9616
|
}
|
|
9617
9617
|
}
|
|
@@ -9637,7 +9637,7 @@ function dB({
|
|
|
9637
9637
|
}) {
|
|
9638
9638
|
const r = jA((h) => {
|
|
9639
9639
|
g.current = h, h && (h.style.width = `${Math.round(n.current)}%`);
|
|
9640
|
-
}, []),
|
|
9640
|
+
}, []), z = jA((h) => {
|
|
9641
9641
|
e.current = h, h && (h.textContent = `${Math.round(n.current)}%`);
|
|
9642
9642
|
}, []), p = jA((h) => {
|
|
9643
9643
|
B.current = h;
|
|
@@ -9686,7 +9686,7 @@ function dB({
|
|
|
9686
9686
|
/* @__PURE__ */ A("span", { ref: T, className: "ps-tryon-progress-eta", children: "~22s" })
|
|
9687
9687
|
] }),
|
|
9688
9688
|
/* @__PURE__ */ A("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ A("div", { ref: r, className: "ps-tryon-progress-bar-fill" }) }),
|
|
9689
|
-
/* @__PURE__ */ A("span", { ref:
|
|
9689
|
+
/* @__PURE__ */ A("span", { ref: z, className: "ps-tryon-progress-pct", children: "0%" })
|
|
9690
9690
|
] }),
|
|
9691
9691
|
/* @__PURE__ */ A("div", { ref: p, className: Qf("ps-tryon-processing-text", i.processingText), children: o("Preparing your image...") }),
|
|
9692
9692
|
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-processing-sub", i.processingSubText), children: o("This usually takes 15-25 seconds") })
|
|
@@ -9774,14 +9774,14 @@ function CP({
|
|
|
9774
9774
|
] }, f);
|
|
9775
9775
|
}
|
|
9776
9776
|
function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B }) {
|
|
9777
|
-
const [C, D] = j(null), [i, o] = j("identity"), [r,
|
|
9777
|
+
const [C, D] = j(null), [i, o] = j("identity"), [r, z] = j("name-photo"), [p, T] = j(!1), [F, h] = j(null), W = iA(null);
|
|
9778
9778
|
JA(() => {
|
|
9779
9779
|
W.current && (W.current.scrollTop = 0);
|
|
9780
9780
|
}, [C, i]);
|
|
9781
|
-
const [t, k] = j(""), [u, v] = j("male"), [I,
|
|
9781
|
+
const [t, k] = j(""), [u, v] = j("male"), [I, O] = j("cm"), [m, K] = j(""), [E, gA] = j(""), [c, hA] = j(""), [l, y] = j(""), [YA, sA] = j(""), [V, s] = j(""), [PA, RA] = j(null), [mA, dA] = j(!1), ZA = iA(null), Hf = iA(null), [J, UA] = j(!1), [TA, XA] = j(null), VA = () => {
|
|
9782
9782
|
TA === !0 && ZA.current?.click();
|
|
9783
|
-
}, kA = async (
|
|
9784
|
-
const q =
|
|
9783
|
+
}, kA = async (x) => {
|
|
9784
|
+
const q = x.target.files?.[0];
|
|
9785
9785
|
if (q) {
|
|
9786
9786
|
if (TA !== !0) {
|
|
9787
9787
|
s(B("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
@@ -9807,61 +9807,61 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9807
9807
|
}
|
|
9808
9808
|
}, vA = () => {
|
|
9809
9809
|
RA(null), g?.(null), ZA.current && (ZA.current.value = "");
|
|
9810
|
-
}, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], qA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], GA = u === "female", _ = GA ? MA.female : MA.male,
|
|
9810
|
+
}, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], qA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], GA = u === "female", _ = GA ? MA.female : MA.male, bA = GA ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], WA = bA.indexOf(i), a = bA.length, X = WA === a - 1, BA = () => {
|
|
9811
9811
|
if (I === "in") {
|
|
9812
|
-
const
|
|
9813
|
-
!isNaN(
|
|
9812
|
+
const x = parseInt(E, 10), q = parseInt(c, 10);
|
|
9813
|
+
!isNaN(x) && x >= 0 && !isNaN(q) && q >= 0 && K(String(Math.round((x * 12 + q) * 2.54)));
|
|
9814
9814
|
}
|
|
9815
|
-
|
|
9816
|
-
},
|
|
9815
|
+
O("cm");
|
|
9816
|
+
}, H = () => {
|
|
9817
9817
|
if (I === "cm") {
|
|
9818
|
-
const
|
|
9819
|
-
!isNaN(
|
|
9818
|
+
const x = parseFloat(m);
|
|
9819
|
+
!isNaN(x) && x > 0 && (gA(String(Math.floor(x / 2.54 / 12))), hA(String(Math.round(x / 2.54 % 12))));
|
|
9820
9820
|
}
|
|
9821
|
-
|
|
9821
|
+
O("in");
|
|
9822
9822
|
}, oA = () => {
|
|
9823
9823
|
if (!t.trim())
|
|
9824
9824
|
return s(B("Please enter a profile name")), !1;
|
|
9825
|
-
let
|
|
9825
|
+
let x;
|
|
9826
9826
|
if (I === "in") {
|
|
9827
9827
|
const U = parseInt(E, 10), R = parseInt(c, 10);
|
|
9828
|
-
|
|
9828
|
+
x = !isNaN(U) && U > 0 && !isNaN(R) && R >= 0 && R <= 11;
|
|
9829
9829
|
} else {
|
|
9830
9830
|
const U = parseFloat(m);
|
|
9831
|
-
|
|
9831
|
+
x = !isNaN(U) && U > 0;
|
|
9832
9832
|
}
|
|
9833
|
-
if (!
|
|
9833
|
+
if (!x)
|
|
9834
9834
|
return s(B("Please enter a valid height")), !1;
|
|
9835
|
-
const q = parseFloat(l), QA = parseFloat(
|
|
9835
|
+
const q = parseFloat(l), QA = parseFloat(YA);
|
|
9836
9836
|
return !q || q <= 0 ? (s(B("Please enter a valid weight")), !1) : !QA || QA <= 0 ? (s(B("Please enter a valid age")), !1) : (s(""), !0);
|
|
9837
|
-
}, EA = () => t.trim() ? (s(""), !0) : (s(B("Please enter a profile name")), !1),
|
|
9838
|
-
const
|
|
9837
|
+
}, EA = () => t.trim() ? (s(""), !0) : (s(B("Please enter a profile name")), !1), uA = () => {
|
|
9838
|
+
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(m);
|
|
9839
9839
|
return {
|
|
9840
9840
|
name: t.trim(),
|
|
9841
9841
|
gender: u,
|
|
9842
9842
|
sizingUnit: I,
|
|
9843
9843
|
heightUnit: I,
|
|
9844
9844
|
weightUnit: I === "in" ? "lbs" : "kg",
|
|
9845
|
-
heightCm:
|
|
9845
|
+
heightCm: x,
|
|
9846
9846
|
weightKg: parseFloat(l),
|
|
9847
|
-
height:
|
|
9847
|
+
height: x,
|
|
9848
9848
|
weight: parseFloat(l),
|
|
9849
|
-
age: parseFloat(
|
|
9849
|
+
age: parseFloat(YA),
|
|
9850
9850
|
chestProfile: SA || void 0,
|
|
9851
9851
|
midsectionProfile: rA || void 0,
|
|
9852
9852
|
hipProfile: GA ? eA || void 0 : xA || void 0,
|
|
9853
9853
|
bandSize: GA && _A || void 0,
|
|
9854
9854
|
cupSize: GA && cf || void 0
|
|
9855
9855
|
};
|
|
9856
|
-
},
|
|
9857
|
-
const
|
|
9856
|
+
}, of = () => {
|
|
9857
|
+
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(m), q = parseFloat(l), QA = parseFloat(YA);
|
|
9858
9858
|
return {
|
|
9859
9859
|
name: t.trim(),
|
|
9860
9860
|
gender: u,
|
|
9861
9861
|
sizingUnit: I,
|
|
9862
9862
|
heightUnit: I,
|
|
9863
9863
|
weightUnit: I === "in" ? "lbs" : "kg",
|
|
9864
|
-
...
|
|
9864
|
+
...x > 0 ? { heightCm: x, height: x } : {},
|
|
9865
9865
|
...q > 0 ? { weightKg: q, weight: q } : {},
|
|
9866
9866
|
...QA > 0 ? { age: QA } : {},
|
|
9867
9867
|
photoBase64: PA || void 0
|
|
@@ -9889,27 +9889,27 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9889
9889
|
return;
|
|
9890
9890
|
}
|
|
9891
9891
|
if (s(""), X) {
|
|
9892
|
-
f(
|
|
9892
|
+
f(uA());
|
|
9893
9893
|
return;
|
|
9894
9894
|
}
|
|
9895
|
-
o(
|
|
9895
|
+
o(bA[WA + 1]);
|
|
9896
9896
|
}
|
|
9897
|
-
}, nA = (
|
|
9898
|
-
s(""),
|
|
9899
|
-
const QA =
|
|
9897
|
+
}, nA = (x, q) => {
|
|
9898
|
+
s(""), x === "chest" ? ff(q) : x === "stomach" ? nf(q) : x === "seat" ? Ef(q) : x === "hips" && $(q);
|
|
9899
|
+
const QA = bA.indexOf(x), U = QA === a - 1;
|
|
9900
9900
|
setTimeout(() => {
|
|
9901
9901
|
if (U) {
|
|
9902
|
-
const R =
|
|
9903
|
-
|
|
9902
|
+
const R = uA();
|
|
9903
|
+
x === "chest" ? R.chestProfile = q : x === "stomach" ? R.midsectionProfile = q : (x === "seat" || x === "hips") && (R.hipProfile = q), f(R);
|
|
9904
9904
|
} else
|
|
9905
|
-
o(
|
|
9905
|
+
o(bA[QA + 1]);
|
|
9906
9906
|
}, 220);
|
|
9907
9907
|
}, Bf = () => {
|
|
9908
9908
|
if (s(""), i === "identity") {
|
|
9909
9909
|
D(null);
|
|
9910
9910
|
return;
|
|
9911
9911
|
}
|
|
9912
|
-
o(
|
|
9912
|
+
o(bA[Math.max(0, WA - 1)]);
|
|
9913
9913
|
}, FA = C === "manual" && (i === "chest" || i === "stomach" || i === "seat" || i === "hips"), OA = async () => {
|
|
9914
9914
|
if (r === "name-photo") {
|
|
9915
9915
|
if (!EA()) return;
|
|
@@ -9917,7 +9917,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9917
9917
|
s(B("Please upload a photo"));
|
|
9918
9918
|
return;
|
|
9919
9919
|
}
|
|
9920
|
-
s(""),
|
|
9920
|
+
s(""), z("details");
|
|
9921
9921
|
return;
|
|
9922
9922
|
}
|
|
9923
9923
|
if (r === "details") {
|
|
@@ -9934,8 +9934,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9934
9934
|
return;
|
|
9935
9935
|
}
|
|
9936
9936
|
}
|
|
9937
|
-
if (s(""),
|
|
9938
|
-
const q = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(m), QA = parseFloat(l), U = parseFloat(
|
|
9937
|
+
if (s(""), z("calculating"), T(!0), e && PA) {
|
|
9938
|
+
const q = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(m), QA = parseFloat(l), U = parseFloat(YA);
|
|
9939
9939
|
try {
|
|
9940
9940
|
const R = await e({
|
|
9941
9941
|
photoBase64: PA,
|
|
@@ -9953,18 +9953,18 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9953
9953
|
T(!1);
|
|
9954
9954
|
return;
|
|
9955
9955
|
}
|
|
9956
|
-
const
|
|
9957
|
-
F && (
|
|
9956
|
+
const x = of();
|
|
9957
|
+
F && (x.measurements = F, x.measurementsUnit = "cm"), f(x);
|
|
9958
9958
|
}, AA = () => {
|
|
9959
9959
|
if (s(""), r === "details") {
|
|
9960
|
-
|
|
9960
|
+
z("name-photo");
|
|
9961
9961
|
return;
|
|
9962
9962
|
}
|
|
9963
9963
|
if (r === "calculating" && !p) {
|
|
9964
|
-
|
|
9964
|
+
z("details");
|
|
9965
9965
|
return;
|
|
9966
9966
|
}
|
|
9967
|
-
D(null),
|
|
9967
|
+
D(null), z("name-photo");
|
|
9968
9968
|
}, LA = () => {
|
|
9969
9969
|
if (C === "manual") return Bf();
|
|
9970
9970
|
if (C === "image") return AA();
|
|
@@ -9972,7 +9972,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9972
9972
|
}, Pf = (() => {
|
|
9973
9973
|
if (C == null) return B("Choose a method");
|
|
9974
9974
|
if (C === "manual") {
|
|
9975
|
-
const
|
|
9975
|
+
const x = {
|
|
9976
9976
|
identity: B("Identity"),
|
|
9977
9977
|
chest: B("Chest"),
|
|
9978
9978
|
stomach: B("Stomach"),
|
|
@@ -9980,14 +9980,14 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9980
9980
|
hips: B("Hips"),
|
|
9981
9981
|
bra: B("Bra")
|
|
9982
9982
|
};
|
|
9983
|
-
return `${String(WA + 1).padStart(2, "0")} · ${
|
|
9983
|
+
return `${String(WA + 1).padStart(2, "0")} · ${x[i]}`;
|
|
9984
9984
|
}
|
|
9985
9985
|
return B("Analyze by photo");
|
|
9986
9986
|
})(), lA = (() => {
|
|
9987
9987
|
if (C == null) return 0;
|
|
9988
9988
|
if (C === "manual") return Math.round((WA + 1) / a * 100);
|
|
9989
|
-
let
|
|
9990
|
-
return t.trim() && (
|
|
9989
|
+
let x = 0;
|
|
9990
|
+
return t.trim() && (x += 50), PA && (x += 50), x;
|
|
9991
9991
|
})();
|
|
9992
9992
|
return /* @__PURE__ */ P("div", { className: "ps-cpw-root", children: [
|
|
9993
9993
|
/* @__PURE__ */ P("div", { className: "ps-cpw-step-head", children: [
|
|
@@ -10047,7 +10047,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10047
10047
|
] }),
|
|
10048
10048
|
/* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", children: [
|
|
10049
10049
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick: BA, children: "cm" }),
|
|
10050
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick:
|
|
10050
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick: H, children: "in" })
|
|
10051
10051
|
] })
|
|
10052
10052
|
] }),
|
|
10053
10053
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
@@ -10060,8 +10060,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10060
10060
|
className: "ps-bp-inline-input",
|
|
10061
10061
|
value: t,
|
|
10062
10062
|
placeholder: B("e.g. My Measurements"),
|
|
10063
|
-
onChange: (
|
|
10064
|
-
k(
|
|
10063
|
+
onChange: (x) => {
|
|
10064
|
+
k(x.target.value), s("");
|
|
10065
10065
|
}
|
|
10066
10066
|
}
|
|
10067
10067
|
) })
|
|
@@ -10077,8 +10077,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10077
10077
|
className: "ps-bp-inline-input",
|
|
10078
10078
|
value: m,
|
|
10079
10079
|
placeholder: B("e.g. 173"),
|
|
10080
|
-
onChange: (
|
|
10081
|
-
K(
|
|
10080
|
+
onChange: (x) => {
|
|
10081
|
+
K(x.target.value), s("");
|
|
10082
10082
|
}
|
|
10083
10083
|
}
|
|
10084
10084
|
),
|
|
@@ -10093,8 +10093,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10093
10093
|
style: { width: "3em" },
|
|
10094
10094
|
value: E,
|
|
10095
10095
|
placeholder: "5",
|
|
10096
|
-
onChange: (
|
|
10097
|
-
gA(
|
|
10096
|
+
onChange: (x) => {
|
|
10097
|
+
gA(x.target.value), s("");
|
|
10098
10098
|
}
|
|
10099
10099
|
}
|
|
10100
10100
|
),
|
|
@@ -10108,8 +10108,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10108
10108
|
style: { width: "3em" },
|
|
10109
10109
|
value: c,
|
|
10110
10110
|
placeholder: "8",
|
|
10111
|
-
onChange: (
|
|
10112
|
-
hA(
|
|
10111
|
+
onChange: (x) => {
|
|
10112
|
+
hA(x.target.value), s("");
|
|
10113
10113
|
}
|
|
10114
10114
|
}
|
|
10115
10115
|
),
|
|
@@ -10127,8 +10127,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10127
10127
|
className: "ps-bp-inline-input",
|
|
10128
10128
|
value: l,
|
|
10129
10129
|
placeholder: B(I === "in" ? "e.g. 154" : "e.g. 70"),
|
|
10130
|
-
onChange: (
|
|
10131
|
-
y(
|
|
10130
|
+
onChange: (x) => {
|
|
10131
|
+
y(x.target.value), s("");
|
|
10132
10132
|
}
|
|
10133
10133
|
}
|
|
10134
10134
|
),
|
|
@@ -10144,10 +10144,10 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10144
10144
|
type: "number",
|
|
10145
10145
|
inputMode: "numeric",
|
|
10146
10146
|
className: "ps-bp-inline-input",
|
|
10147
|
-
value:
|
|
10147
|
+
value: YA,
|
|
10148
10148
|
placeholder: B("e.g. 30"),
|
|
10149
|
-
onChange: (
|
|
10150
|
-
sA(
|
|
10149
|
+
onChange: (x) => {
|
|
10150
|
+
sA(x.target.value), s("");
|
|
10151
10151
|
}
|
|
10152
10152
|
}
|
|
10153
10153
|
),
|
|
@@ -10222,12 +10222,12 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10222
10222
|
{
|
|
10223
10223
|
className: "ps-cpw-input",
|
|
10224
10224
|
value: _A ?? "",
|
|
10225
|
-
onChange: (
|
|
10226
|
-
Of(
|
|
10225
|
+
onChange: (x) => {
|
|
10226
|
+
Of(x.target.value || null), s("");
|
|
10227
10227
|
},
|
|
10228
10228
|
children: [
|
|
10229
10229
|
/* @__PURE__ */ A("option", { value: "", children: B("Select") }),
|
|
10230
|
-
gf.map((
|
|
10230
|
+
gf.map((x) => /* @__PURE__ */ A("option", { value: x, children: x }, x))
|
|
10231
10231
|
]
|
|
10232
10232
|
}
|
|
10233
10233
|
)
|
|
@@ -10239,12 +10239,12 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10239
10239
|
{
|
|
10240
10240
|
className: "ps-cpw-input",
|
|
10241
10241
|
value: cf ?? "",
|
|
10242
|
-
onChange: (
|
|
10243
|
-
Mf(
|
|
10242
|
+
onChange: (x) => {
|
|
10243
|
+
Mf(x.target.value || null), s("");
|
|
10244
10244
|
},
|
|
10245
10245
|
children: [
|
|
10246
10246
|
/* @__PURE__ */ A("option", { value: "", children: B("Select") }),
|
|
10247
|
-
qA.map((
|
|
10247
|
+
qA.map((x) => /* @__PURE__ */ A("option", { value: x, children: x }, x))
|
|
10248
10248
|
]
|
|
10249
10249
|
}
|
|
10250
10250
|
)
|
|
@@ -10301,7 +10301,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10301
10301
|
type: "button",
|
|
10302
10302
|
className: "ps-cpw-age-gate-btn ps-cpw-age-gate-btn-primary",
|
|
10303
10303
|
onClick: () => {
|
|
10304
|
-
|
|
10304
|
+
XA(!0), s("");
|
|
10305
10305
|
},
|
|
10306
10306
|
children: B("Yes")
|
|
10307
10307
|
}
|
|
@@ -10311,7 +10311,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10311
10311
|
{
|
|
10312
10312
|
type: "button",
|
|
10313
10313
|
className: "ps-cpw-age-gate-btn ps-cpw-age-gate-btn-secondary",
|
|
10314
|
-
onClick: () =>
|
|
10314
|
+
onClick: () => XA(!1),
|
|
10315
10315
|
children: B("No")
|
|
10316
10316
|
}
|
|
10317
10317
|
)
|
|
@@ -10325,7 +10325,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10325
10325
|
{
|
|
10326
10326
|
type: "button",
|
|
10327
10327
|
className: "ps-cpw-age-gate-btn ps-cpw-age-gate-btn-secondary",
|
|
10328
|
-
onClick: () =>
|
|
10328
|
+
onClick: () => XA(null),
|
|
10329
10329
|
children: B("Go back")
|
|
10330
10330
|
}
|
|
10331
10331
|
)
|
|
@@ -10334,8 +10334,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10334
10334
|
/* @__PURE__ */ P("div", { className: "ps-cpw-image-right", children: [
|
|
10335
10335
|
/* @__PURE__ */ A("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: /* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10336
10336
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("NAME") }),
|
|
10337
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: Hf, type: "text", className: `ps-bp-inline-input${J ? " ps-cpw-shake" : ""}`, value: t, placeholder: B("e.g. My Photo Profile"), onChange: (
|
|
10338
|
-
k(
|
|
10337
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: Hf, type: "text", className: `ps-bp-inline-input${J ? " ps-cpw-shake" : ""}`, value: t, placeholder: B("e.g. My Photo Profile"), onChange: (x) => {
|
|
10338
|
+
k(x.target.value), s("");
|
|
10339
10339
|
}, onAnimationEnd: () => UA(!1) }) })
|
|
10340
10340
|
] }) }),
|
|
10341
10341
|
/* @__PURE__ */ P("div", { className: "ps-cpw-photo-guide", children: [
|
|
@@ -10376,23 +10376,23 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10376
10376
|
] }),
|
|
10377
10377
|
/* @__PURE__ */ A("div", { className: "ps-cpw-pill-row", style: { marginBottom: "0.8vw" }, children: /* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", children: [
|
|
10378
10378
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick: BA, children: "cm" }),
|
|
10379
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick:
|
|
10379
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick: H, children: "in" })
|
|
10380
10380
|
] }) }),
|
|
10381
10381
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
10382
10382
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10383
10383
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("HEIGHT") }),
|
|
10384
10384
|
I === "cm" ? /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10385
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: m, placeholder: B("e.g. 173"), onChange: (
|
|
10386
|
-
K(
|
|
10385
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: m, placeholder: B("e.g. 173"), onChange: (x) => {
|
|
10386
|
+
K(x.target.value), s("");
|
|
10387
10387
|
} }),
|
|
10388
10388
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
10389
10389
|
] }) : /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", style: { gap: "6px" }, children: [
|
|
10390
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: E, placeholder: "5", onChange: (
|
|
10391
|
-
gA(
|
|
10390
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: E, placeholder: "5", onChange: (x) => {
|
|
10391
|
+
gA(x.target.value), s("");
|
|
10392
10392
|
} }),
|
|
10393
10393
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
10394
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: c, placeholder: "8", onChange: (
|
|
10395
|
-
hA(
|
|
10394
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", style: { width: "3em" }, value: c, placeholder: "8", onChange: (x) => {
|
|
10395
|
+
hA(x.target.value), s("");
|
|
10396
10396
|
} }),
|
|
10397
10397
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
10398
10398
|
] })
|
|
@@ -10400,8 +10400,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10400
10400
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10401
10401
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("WEIGHT") }),
|
|
10402
10402
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10403
|
-
/* @__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: (
|
|
10404
|
-
y(
|
|
10403
|
+
/* @__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: (x) => {
|
|
10404
|
+
y(x.target.value), s("");
|
|
10405
10405
|
} }),
|
|
10406
10406
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: I === "in" ? "lbs" : "kg" })
|
|
10407
10407
|
] })
|
|
@@ -10409,8 +10409,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10409
10409
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
10410
10410
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("AGE") }),
|
|
10411
10411
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
10412
|
-
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value:
|
|
10413
|
-
sA(
|
|
10412
|
+
/* @__PURE__ */ A("input", { type: "number", inputMode: "numeric", className: "ps-bp-inline-input", value: YA, placeholder: B("e.g. 30"), onChange: (x) => {
|
|
10413
|
+
sA(x.target.value), s("");
|
|
10414
10414
|
} }),
|
|
10415
10415
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: B("years") })
|
|
10416
10416
|
] })
|
|
@@ -10441,8 +10441,8 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10441
10441
|
{ key: "inseam", label: B("INSEAM") },
|
|
10442
10442
|
{ key: "thighCircumference", label: B("THIGH") },
|
|
10443
10443
|
{ key: "footLengthCm", label: B("FOOT") }
|
|
10444
|
-
].map(({ key:
|
|
10445
|
-
const QA = F[
|
|
10444
|
+
].map(({ key: x, label: q }) => {
|
|
10445
|
+
const QA = F[x];
|
|
10446
10446
|
if (!QA || QA === 0) return null;
|
|
10447
10447
|
const U = I === "in" ? Math.round(QA / 2.54 * 10) / 10 : QA;
|
|
10448
10448
|
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: [
|
|
@@ -10452,7 +10452,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10452
10452
|
" ",
|
|
10453
10453
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", color: "var(--ps-text-muted)", fontWeight: 400 }, children: I })
|
|
10454
10454
|
] })
|
|
10455
|
-
] },
|
|
10455
|
+
] }, x);
|
|
10456
10456
|
}) })
|
|
10457
10457
|
] }) : /* @__PURE__ */ P("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", flex: 1, gap: "0.8vw" }, children: [
|
|
10458
10458
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-primary)", fontSize: "1vw", fontWeight: 600 }, children: B("Estimation could not complete") }),
|
|
@@ -10481,7 +10481,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10481
10481
|
C === "image" && r === "details" && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: OA, children: B("Calculate My Body Parts") }),
|
|
10482
10482
|
C === "image" && r === "calculating" && !p && F && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: OA, children: B("Save Profile") }),
|
|
10483
10483
|
C === "image" && r === "calculating" && !p && !F && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: () => {
|
|
10484
|
-
|
|
10484
|
+
z("details"), s("");
|
|
10485
10485
|
}, children: B("Try Again") })
|
|
10486
10486
|
] })
|
|
10487
10487
|
] });
|
|
@@ -10517,9 +10517,9 @@ function A8({
|
|
|
10517
10517
|
isEstimating: o = !1,
|
|
10518
10518
|
t: r
|
|
10519
10519
|
}) {
|
|
10520
|
-
const
|
|
10520
|
+
const z = f.gender === "female" ? VB : WB, p = f.measurements || {}, T = Object.keys(p).some((K) => p[K] != null), [F, h] = j(f.measurementsUnit || "cm"), [W, t] = j(() => {
|
|
10521
10521
|
const K = {};
|
|
10522
|
-
return
|
|
10522
|
+
return z.forEach((E) => {
|
|
10523
10523
|
const gA = p[E.key];
|
|
10524
10524
|
K[E.key] = gA != null ? String(Math.round(gA * 10) / 10) : "";
|
|
10525
10525
|
}), K;
|
|
@@ -10528,13 +10528,13 @@ function A8({
|
|
|
10528
10528
|
t((K) => {
|
|
10529
10529
|
const E = { ...K };
|
|
10530
10530
|
let gA = !1;
|
|
10531
|
-
return
|
|
10531
|
+
return z.forEach((c) => {
|
|
10532
10532
|
const hA = p[c.key];
|
|
10533
10533
|
hA != null && !K[c.key] && (E[c.key] = String(Math.round(hA * 10) / 10), gA = !0);
|
|
10534
10534
|
}), gA ? E : K;
|
|
10535
10535
|
});
|
|
10536
10536
|
}, [f.measurements, f.id]);
|
|
10537
|
-
const [k, u] = j(f.bandSize || ""), [v, I] = j(f.cupSize || ""),
|
|
10537
|
+
const [k, u] = j(f.bandSize || ""), [v, I] = j(f.cupSize || ""), O = (K) => {
|
|
10538
10538
|
K !== F && (t((E) => {
|
|
10539
10539
|
const gA = {};
|
|
10540
10540
|
for (const [c, hA] of Object.entries(E)) {
|
|
@@ -10565,7 +10565,7 @@ function A8({
|
|
|
10565
10565
|
{
|
|
10566
10566
|
type: "button",
|
|
10567
10567
|
className: `ps-cpw-pill${F === "cm" ? " ps-active" : ""}`,
|
|
10568
|
-
onClick: () =>
|
|
10568
|
+
onClick: () => O("cm"),
|
|
10569
10569
|
children: "cm"
|
|
10570
10570
|
}
|
|
10571
10571
|
),
|
|
@@ -10574,7 +10574,7 @@ function A8({
|
|
|
10574
10574
|
{
|
|
10575
10575
|
type: "button",
|
|
10576
10576
|
className: `ps-cpw-pill${F === "in" ? " ps-active" : ""}`,
|
|
10577
|
-
onClick: () =>
|
|
10577
|
+
onClick: () => O("in"),
|
|
10578
10578
|
children: "in"
|
|
10579
10579
|
}
|
|
10580
10580
|
)
|
|
@@ -10585,7 +10585,7 @@ function A8({
|
|
|
10585
10585
|
] })
|
|
10586
10586
|
] }) }),
|
|
10587
10587
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-list", children: [
|
|
10588
|
-
|
|
10588
|
+
z.map((K) => {
|
|
10589
10589
|
const E = p[K.key], gA = o && E == null && !W[K.key];
|
|
10590
10590
|
return /* @__PURE__ */ P("div", { className: `ps-pmv-measure-row${E == null ? " ps-loading" : ""}`, children: [
|
|
10591
10591
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: K.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
@@ -10694,19 +10694,19 @@ function P8({
|
|
|
10694
10694
|
t: D
|
|
10695
10695
|
}) {
|
|
10696
10696
|
const i = (() => {
|
|
10697
|
-
const
|
|
10698
|
-
if (!
|
|
10697
|
+
const z = f.height ?? f.heightCm;
|
|
10698
|
+
if (!z) return null;
|
|
10699
10699
|
if (f.heightUnit === "in" || f.heightUnit === "ft") {
|
|
10700
|
-
const p = Math.floor(
|
|
10700
|
+
const p = Math.floor(z / 12), T = Math.round(z % 12);
|
|
10701
10701
|
return `${p}'${T}"`;
|
|
10702
10702
|
}
|
|
10703
|
-
return `${Math.round(
|
|
10703
|
+
return `${Math.round(z)} cm`;
|
|
10704
10704
|
})(), o = (() => {
|
|
10705
|
-
const
|
|
10706
|
-
return
|
|
10705
|
+
const z = f.weight ?? f.weightKg;
|
|
10706
|
+
return z ? `${Math.round(z)} ${f.weightUnit || "kg"}` : null;
|
|
10707
10707
|
})(), r = (() => {
|
|
10708
|
-
const
|
|
10709
|
-
return
|
|
10708
|
+
const z = f.lastEditedAt || f.lastUsedAt || f.createdAt;
|
|
10709
|
+
return z ? new Date(z).toLocaleDateString(void 0, { month: "short", day: "numeric" }) : null;
|
|
10710
10710
|
})();
|
|
10711
10711
|
return /* @__PURE__ */ P(
|
|
10712
10712
|
"div",
|
|
@@ -10733,7 +10733,7 @@ function P8({
|
|
|
10733
10733
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children: r })
|
|
10734
10734
|
] })
|
|
10735
10735
|
] }),
|
|
10736
|
-
/* @__PURE__ */ P("div", { className: "ps-msp-card-actions", onClick: (
|
|
10736
|
+
/* @__PURE__ */ P("div", { className: "ps-msp-card-actions", onClick: (z) => z.stopPropagation(), children: [
|
|
10737
10737
|
/* @__PURE__ */ A(
|
|
10738
10738
|
"button",
|
|
10739
10739
|
{
|
|
@@ -10752,8 +10752,8 @@ function P8({
|
|
|
10752
10752
|
{
|
|
10753
10753
|
type: "button",
|
|
10754
10754
|
className: "ps-msp-card-delete",
|
|
10755
|
-
onClick: (
|
|
10756
|
-
|
|
10755
|
+
onClick: (z) => {
|
|
10756
|
+
z.stopPropagation(), B();
|
|
10757
10757
|
},
|
|
10758
10758
|
"aria-label": D("Delete"),
|
|
10759
10759
|
children: /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "14", height: "14", children: [
|
|
@@ -10788,7 +10788,7 @@ function g8({
|
|
|
10788
10788
|
onRequestDelete: i,
|
|
10789
10789
|
onClose: o,
|
|
10790
10790
|
onPhotoPreview: r,
|
|
10791
|
-
onEstimateFromPhoto:
|
|
10791
|
+
onEstimateFromPhoto: z,
|
|
10792
10792
|
estimatingProfileIds: p,
|
|
10793
10793
|
t: T,
|
|
10794
10794
|
onRegisterBackInterceptor: F
|
|
@@ -10832,9 +10832,9 @@ function g8({
|
|
|
10832
10832
|
let I = null;
|
|
10833
10833
|
if (typeof window < "u")
|
|
10834
10834
|
try {
|
|
10835
|
-
const
|
|
10836
|
-
if (
|
|
10837
|
-
const m = JSON.parse(
|
|
10835
|
+
const O = localStorage.getItem("primestyle_profiles");
|
|
10836
|
+
if (O) {
|
|
10837
|
+
const m = JSON.parse(O);
|
|
10838
10838
|
m.length > 0 && (I = m[0].id ?? null);
|
|
10839
10839
|
}
|
|
10840
10840
|
} catch {
|
|
@@ -10843,7 +10843,7 @@ function g8({
|
|
|
10843
10843
|
},
|
|
10844
10844
|
onCancel: () => W(!1),
|
|
10845
10845
|
onPhotoPreview: r,
|
|
10846
|
-
onEstimate:
|
|
10846
|
+
onEstimate: z,
|
|
10847
10847
|
t: T
|
|
10848
10848
|
}
|
|
10849
10849
|
) : /* @__PURE__ */ P(tA, { children: [
|
|
@@ -10903,7 +10903,7 @@ function w8({
|
|
|
10903
10903
|
heightInches: i,
|
|
10904
10904
|
setHeightInches: o,
|
|
10905
10905
|
weight: r,
|
|
10906
|
-
setWeight:
|
|
10906
|
+
setWeight: z,
|
|
10907
10907
|
age: p,
|
|
10908
10908
|
setAge: T,
|
|
10909
10909
|
switchToMetric: F,
|
|
@@ -10914,19 +10914,19 @@ function w8({
|
|
|
10914
10914
|
canProceed: u,
|
|
10915
10915
|
fastPathLabel: v,
|
|
10916
10916
|
activeProfileName: I,
|
|
10917
|
-
onStartFresh:
|
|
10917
|
+
onStartFresh: O,
|
|
10918
10918
|
hidePhotoOptions: m = !1,
|
|
10919
10919
|
error: K,
|
|
10920
10920
|
t: E
|
|
10921
10921
|
}) {
|
|
10922
|
-
const gA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(i) || 8), hA = Math.floor(c / 12), l = c % 12, y = parseFloat(r) || (n === "kg" ? 70 : 154),
|
|
10922
|
+
const gA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(i) || 8), hA = Math.floor(c / 12), l = c % 12, y = parseFloat(r) || (n === "kg" ? 70 : 154), YA = parseFloat(p) || 30, sA = n === "kg" ? 30 : 66, V = n === "kg" ? 200 : 440, s = 120, PA = 220, RA = 48, mA = 84, dA = 13, ZA = 100, Hf = (gA - s) / (PA - s) * 100, J = (c - RA) / (mA - RA) * 100, UA = (y - sA) / (V - sA) * 100, TA = (YA - dA) / (ZA - dA) * 100, XA = (nf) => {
|
|
10923
10923
|
const xA = Math.max(RA, Math.min(mA, nf));
|
|
10924
10924
|
D(String(Math.floor(xA / 12))), o(String(xA % 12));
|
|
10925
10925
|
}, VA = () => {
|
|
10926
|
-
f === "in" ?
|
|
10926
|
+
f === "in" ? XA(c + 1) : B(String(Math.min(PA, gA + 1)));
|
|
10927
10927
|
}, kA = () => {
|
|
10928
|
-
f === "in" ?
|
|
10929
|
-
}, vA = () =>
|
|
10928
|
+
f === "in" ? XA(c - 1) : B(String(Math.max(s, gA - 1)));
|
|
10929
|
+
}, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA, YA + 1))), rA = () => T(String(Math.max(dA, YA - 1)));
|
|
10930
10930
|
return /* @__PURE__ */ P("div", { className: "ps-bpm-root", children: [
|
|
10931
10931
|
/* @__PURE__ */ P("div", { className: "ps-bpm-header", children: [
|
|
10932
10932
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: E("Body Measurements") }),
|
|
@@ -10936,9 +10936,9 @@ function w8({
|
|
|
10936
10936
|
E("Using"),
|
|
10937
10937
|
" ",
|
|
10938
10938
|
/* @__PURE__ */ A("strong", { children: I }),
|
|
10939
|
-
|
|
10939
|
+
O && /* @__PURE__ */ P(tA, { children: [
|
|
10940
10940
|
" · ",
|
|
10941
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick:
|
|
10941
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: O, children: E("start fresh") })
|
|
10942
10942
|
] })
|
|
10943
10943
|
] }),
|
|
10944
10944
|
/* @__PURE__ */ P("div", { className: "ps-bpm-toggle", children: [
|
|
@@ -10978,7 +10978,7 @@ function w8({
|
|
|
10978
10978
|
max: mA,
|
|
10979
10979
|
step: 1,
|
|
10980
10980
|
value: c,
|
|
10981
|
-
onChange: (nf) =>
|
|
10981
|
+
onChange: (nf) => XA(parseInt(nf.target.value, 10)),
|
|
10982
10982
|
style: { "--ps-pct": `${J}%` }
|
|
10983
10983
|
}
|
|
10984
10984
|
) : /* @__PURE__ */ A(
|
|
@@ -11017,7 +11017,7 @@ function w8({
|
|
|
11017
11017
|
max: V,
|
|
11018
11018
|
step: 1,
|
|
11019
11019
|
value: y,
|
|
11020
|
-
onChange: (nf) =>
|
|
11020
|
+
onChange: (nf) => z(nf.target.value),
|
|
11021
11021
|
style: { "--ps-pct": `${UA}%` }
|
|
11022
11022
|
}
|
|
11023
11023
|
),
|
|
@@ -11028,7 +11028,7 @@ function w8({
|
|
|
11028
11028
|
/* @__PURE__ */ P("div", { className: "ps-bpm-row-top", children: [
|
|
11029
11029
|
/* @__PURE__ */ A("span", { className: "ps-bpm-label", children: E("AGE") }),
|
|
11030
11030
|
/* @__PURE__ */ P("span", { className: "ps-bpm-value-display", children: [
|
|
11031
|
-
Math.round(
|
|
11031
|
+
Math.round(YA),
|
|
11032
11032
|
" ",
|
|
11033
11033
|
E("YEARS")
|
|
11034
11034
|
] })
|
|
@@ -11043,7 +11043,7 @@ function w8({
|
|
|
11043
11043
|
min: dA,
|
|
11044
11044
|
max: ZA,
|
|
11045
11045
|
step: 1,
|
|
11046
|
-
value:
|
|
11046
|
+
value: YA,
|
|
11047
11047
|
onChange: (nf) => T(nf.target.value),
|
|
11048
11048
|
style: { "--ps-pct": `${TA}%` }
|
|
11049
11049
|
}
|
|
@@ -11121,7 +11121,7 @@ function Zn({
|
|
|
11121
11121
|
photoStepHeight: i,
|
|
11122
11122
|
onPhotoStepHeightChange: o,
|
|
11123
11123
|
ageConfirmed: r,
|
|
11124
|
-
onAgeConfirmedChange:
|
|
11124
|
+
onAgeConfirmedChange: z,
|
|
11125
11125
|
t: p
|
|
11126
11126
|
}) {
|
|
11127
11127
|
const T = D === "close-up", F = iA(null), h = !!f, W = !h && r !== !0;
|
|
@@ -11175,14 +11175,14 @@ function Zn({
|
|
|
11175
11175
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow", children: p("AGE VERIFICATION") }),
|
|
11176
11176
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: p("Is the person in this photo 18 years or older?") }),
|
|
11177
11177
|
/* @__PURE__ */ P("div", { className: "ps-pm-age-gate-actions", children: [
|
|
11178
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-primary", onClick: () =>
|
|
11179
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () =>
|
|
11178
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-primary", onClick: () => z(!0), children: p("Yes") }),
|
|
11179
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => z(!1), children: p("No") })
|
|
11180
11180
|
] })
|
|
11181
11181
|
] }) }),
|
|
11182
11182
|
r === !1 && /* @__PURE__ */ A("div", { className: "ps-pm-age-gate", role: "alert", children: /* @__PURE__ */ P("div", { className: "ps-pm-age-gate-card", children: [
|
|
11183
11183
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow ps-pm-age-gate-eyebrow-blocked", children: p("UPLOAD NOT ALLOWED") }),
|
|
11184
11184
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: p("For your safety, we cannot process photos of people under 18.") }),
|
|
11185
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () =>
|
|
11185
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => z(null), children: p("Go back") })
|
|
11186
11186
|
] }) })
|
|
11187
11187
|
] }) }),
|
|
11188
11188
|
/* @__PURE__ */ P("div", { className: "ps-pm-legal-notice", children: [
|
|
@@ -11261,7 +11261,7 @@ function iP({
|
|
|
11261
11261
|
] }),
|
|
11262
11262
|
/* @__PURE__ */ A("h2", { className: "ps-bsm-question", children: g }),
|
|
11263
11263
|
/* @__PURE__ */ A("div", { className: "ps-bsm-options-center", children: /* @__PURE__ */ A("div", { className: "ps-bsm-options", children: e.map((i, o) => {
|
|
11264
|
-
const r = B === i.value,
|
|
11264
|
+
const r = B === i.value, z = String.fromCharCode(65 + o);
|
|
11265
11265
|
return /* @__PURE__ */ P(
|
|
11266
11266
|
"button",
|
|
11267
11267
|
{
|
|
@@ -11273,7 +11273,7 @@ function iP({
|
|
|
11273
11273
|
/* @__PURE__ */ P("span", { className: "ps-bsm-card-eyebrow", children: [
|
|
11274
11274
|
D("PROFILE"),
|
|
11275
11275
|
" ",
|
|
11276
|
-
|
|
11276
|
+
z
|
|
11277
11277
|
] }),
|
|
11278
11278
|
/* @__PURE__ */ A("span", { className: "ps-bsm-card-label", children: i.label.toUpperCase() })
|
|
11279
11279
|
] }),
|
|
@@ -11375,7 +11375,7 @@ function z8({
|
|
|
11375
11375
|
weightUnit: i,
|
|
11376
11376
|
setWeightUnit: o,
|
|
11377
11377
|
sizingUnit: r,
|
|
11378
|
-
setSizingUnit:
|
|
11378
|
+
setSizingUnit: z,
|
|
11379
11379
|
onComplete: p,
|
|
11380
11380
|
onSnapSubmit: T,
|
|
11381
11381
|
hasActiveProfileWithMeasurements: F = !1,
|
|
@@ -11386,13 +11386,13 @@ function z8({
|
|
|
11386
11386
|
onBack: u,
|
|
11387
11387
|
t: v
|
|
11388
11388
|
}) {
|
|
11389
|
-
const I = g ? r8 : t8, [
|
|
11390
|
-
|
|
11391
|
-
const K = NP(), E = Yn(B), gA = k?.height, c = k?.weight, hA = k?.age, l = k?.heightUnit === "ft" ? "in" : k?.heightUnit, y = k?.weightUnit,
|
|
11389
|
+
const I = g ? r8 : t8, [O, m] = j("basics");
|
|
11390
|
+
O === "photo" || I.indexOf(O);
|
|
11391
|
+
const K = NP(), E = Yn(B), gA = k?.height, c = k?.weight, hA = k?.age, l = k?.heightUnit === "ft" ? "in" : k?.heightUnit, y = k?.weightUnit, YA = gA != null && l === "cm" ? String(Math.round(gA)) : gA != null && (l === "in" || l === "ft") ? String(Math.round(gA * 2.54)) : e.current.height || "173", sA = gA != null && (l === "in" || l === "ft") ? Math.round(gA) : gA != null && l === "cm" ? Math.round(gA / 2.54) : null, V = sA != null ? String(Math.floor(sA / 12)) : e.current.heightFeet || "5", s = sA != null ? String(sA % 12) : e.current.heightInches || "8", PA = c != null ? String(Math.round(c)) : e.current.weight || (E ? "154" : "70"), RA = hA != null ? String(hA) : e.current.age || "30", [mA, dA] = j(YA), [ZA, Hf] = j(V), [J, UA] = j(s), [TA, XA] = j(PA), [VA, kA] = j(RA), [vA, SA] = j(
|
|
11392
11392
|
l || (C === "ft" ? "in" : C || (E ? "in" : "cm"))
|
|
11393
11393
|
), [ff, rA] = j(
|
|
11394
11394
|
y || i || (E ? "lbs" : "kg")
|
|
11395
|
-
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = iA(null), [qA, GA] = j(null), [_,
|
|
11395
|
+
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = iA(null), [qA, GA] = j(null), [_, bA] = j(() => sA != null ? String(Math.round(sA * 2.54)) : YA), [WA, a] = j(null), [X, BA] = j(null), [H, oA] = j(null), [EA, uA] = j(null), [of, N] = j(""), [nA, Bf] = j(null), [FA, OA] = j(null), [AA, LA] = j(() => ["US", "UK", "AU"].includes(B) ? B === "AU" ? "UK" : B : ["FR", "ES"].includes(B) ? "FR" : ["IT"].includes(B) ? "IT" : ["JP", "CN", "KR"].includes(B) ? "JP" : "EU"), [Pf, lA] = j(!1), x = pn[AA] || pn.US, [q, QA] = j(""), U = jA(async (M) => {
|
|
11396
11396
|
const zA = M.target.files?.[0];
|
|
11397
11397
|
if (!zA) return;
|
|
11398
11398
|
if (qA !== !0) {
|
|
@@ -11459,36 +11459,36 @@ function z8({
|
|
|
11459
11459
|
age: VA ? parseInt(VA, 10) : void 0,
|
|
11460
11460
|
chestProfile: WA || void 0,
|
|
11461
11461
|
midsectionProfile: X,
|
|
11462
|
-
hipProfile:
|
|
11462
|
+
hipProfile: H,
|
|
11463
11463
|
bodyImage: _A || void 0,
|
|
11464
11464
|
bandSize: nA || void 0,
|
|
11465
11465
|
cupSize: FA || void 0
|
|
11466
11466
|
});
|
|
11467
11467
|
}, $A = jA(() => {
|
|
11468
|
-
if (
|
|
11468
|
+
if (O === "basics") {
|
|
11469
11469
|
if (!G()) return;
|
|
11470
11470
|
m(fA("basics"));
|
|
11471
|
-
} else if (
|
|
11471
|
+
} else if (O === "chest") {
|
|
11472
11472
|
if (!WA) return;
|
|
11473
11473
|
m(fA("chest"));
|
|
11474
|
-
} else if (
|
|
11474
|
+
} else if (O === "midsection") {
|
|
11475
11475
|
if (!X) return;
|
|
11476
11476
|
m(fA("midsection"));
|
|
11477
|
-
} else if (
|
|
11477
|
+
} else if (O === "seat") {
|
|
11478
11478
|
if (!EA) return;
|
|
11479
11479
|
const M = fA("seat");
|
|
11480
11480
|
M === "submit" ? NA() : m(M);
|
|
11481
|
-
} else if (
|
|
11482
|
-
if (!
|
|
11481
|
+
} else if (O === "hips") {
|
|
11482
|
+
if (!H) return;
|
|
11483
11483
|
const M = fA("hips");
|
|
11484
11484
|
M === "submit" ? NA() : m(M);
|
|
11485
|
-
} else if (
|
|
11485
|
+
} else if (O === "bra") {
|
|
11486
11486
|
if (!nA || !FA) {
|
|
11487
11487
|
QA(v("Please select both band and cup size"));
|
|
11488
11488
|
return;
|
|
11489
11489
|
}
|
|
11490
11490
|
QA(""), NA();
|
|
11491
|
-
} else if (
|
|
11491
|
+
} else if (O === "photo") {
|
|
11492
11492
|
if (!_A || !xA) {
|
|
11493
11493
|
if (F && h) {
|
|
11494
11494
|
h();
|
|
@@ -11507,20 +11507,20 @@ function z8({
|
|
|
11507
11507
|
gender: aA
|
|
11508
11508
|
});
|
|
11509
11509
|
}
|
|
11510
|
-
}, [
|
|
11510
|
+
}, [O, I, G, WA, X, H, EA, nA, FA, vA, ff, mA, ZA, J, TA, VA, _A, xA, _, e, D, o, p, T, g, aA, F, h]), ef = (M) => {
|
|
11511
11511
|
const zA = I.indexOf(M);
|
|
11512
11512
|
return zA > 0 ? I[zA - 1] : null;
|
|
11513
11513
|
}, yA = jA(() => {
|
|
11514
|
-
if (QA(""),
|
|
11514
|
+
if (QA(""), O === "basics")
|
|
11515
11515
|
u();
|
|
11516
|
-
else if (
|
|
11516
|
+
else if (O === "photo")
|
|
11517
11517
|
m("basics");
|
|
11518
11518
|
else {
|
|
11519
|
-
const M = ef(
|
|
11519
|
+
const M = ef(O);
|
|
11520
11520
|
M ? m(M) : u();
|
|
11521
11521
|
}
|
|
11522
|
-
}, [
|
|
11523
|
-
return
|
|
11522
|
+
}, [O, I, u]), KA = O === "basics" ? !0 : O === "chest" ? !!WA : O === "midsection" ? !!X : O === "seat" ? !!EA : O === "hips" ? !!H : O === "bra" ? !!(nA && FA) : O === "photo", vf = O === I[I.length - 1];
|
|
11523
|
+
return O === "photo" ? K ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
11524
11524
|
Zn,
|
|
11525
11525
|
{
|
|
11526
11526
|
photoPreview: eA,
|
|
@@ -11530,7 +11530,7 @@ function z8({
|
|
|
11530
11530
|
onSwitchToManual: () => m("basics"),
|
|
11531
11531
|
error: q,
|
|
11532
11532
|
photoStepHeight: _,
|
|
11533
|
-
onPhotoStepHeightChange:
|
|
11533
|
+
onPhotoStepHeightChange: bA,
|
|
11534
11534
|
ageConfirmed: qA,
|
|
11535
11535
|
onAgeConfirmedChange: (M) => {
|
|
11536
11536
|
GA(M), M === !0 && QA("");
|
|
@@ -11831,19 +11831,19 @@ function z8({
|
|
|
11831
11831
|
}
|
|
11832
11832
|
),
|
|
11833
11833
|
/* @__PURE__ */ P("div", { className: "ps-bp-root", children: [
|
|
11834
|
-
|
|
11834
|
+
O === "basics" && (() => {
|
|
11835
11835
|
const M = () => {
|
|
11836
11836
|
if (vA === "in") {
|
|
11837
11837
|
const cA = (parseFloat(ZA) || 5) * 12 + (parseFloat(J) || 8);
|
|
11838
11838
|
dA(String(Math.round(cA * 2.54)));
|
|
11839
11839
|
}
|
|
11840
|
-
ff === "lbs" && TA &&
|
|
11840
|
+
ff === "lbs" && TA && XA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"), rA("kg"), D("cm"), o("kg"), z?.("cm");
|
|
11841
11841
|
}, zA = () => {
|
|
11842
11842
|
if (vA === "cm") {
|
|
11843
11843
|
const cA = parseFloat(mA) || 173, tf = Math.round(cA / 2.54);
|
|
11844
11844
|
Hf(String(Math.floor(tf / 12))), UA(String(tf % 12));
|
|
11845
11845
|
}
|
|
11846
|
-
ff === "kg" && TA &&
|
|
11846
|
+
ff === "kg" && TA && XA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"), rA("lbs"), D("in"), o("lbs"), z?.("in");
|
|
11847
11847
|
};
|
|
11848
11848
|
return K ? /* @__PURE__ */ A(
|
|
11849
11849
|
w8,
|
|
@@ -11858,7 +11858,7 @@ function z8({
|
|
|
11858
11858
|
heightInches: J,
|
|
11859
11859
|
setHeightInches: UA,
|
|
11860
11860
|
weight: TA,
|
|
11861
|
-
setWeight:
|
|
11861
|
+
setWeight: XA,
|
|
11862
11862
|
age: VA,
|
|
11863
11863
|
setAge: kA,
|
|
11864
11864
|
switchToMetric: M,
|
|
@@ -11906,7 +11906,7 @@ function z8({
|
|
|
11906
11906
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
11907
11907
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: v("WEIGHT") }),
|
|
11908
11908
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11909
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: ff === "kg" ? "75" : "165", value: TA, onChange: (cA) =>
|
|
11909
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: ff === "kg" ? "75" : "165", value: TA, onChange: (cA) => XA(cA.target.value), min: ff === "kg" ? 30 : 66, max: ff === "kg" ? 300 : 660 }),
|
|
11910
11910
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: ff })
|
|
11911
11911
|
] })
|
|
11912
11912
|
] }),
|
|
@@ -11926,7 +11926,7 @@ function z8({
|
|
|
11926
11926
|
q && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: q })
|
|
11927
11927
|
] }, "step-basics");
|
|
11928
11928
|
})(),
|
|
11929
|
-
|
|
11929
|
+
O === "chest" && !g && (K ? /* @__PURE__ */ A(
|
|
11930
11930
|
iP,
|
|
11931
11931
|
{
|
|
11932
11932
|
stepNumber: I.indexOf("chest") + 1,
|
|
@@ -11949,9 +11949,9 @@ function z8({
|
|
|
11949
11949
|
/* @__PURE__ */ A(rf, { img: MA.male.chest.average, label: v("Average"), selected: WA === "average", onSelect: () => a("average"), onHover: () => N(v("A moderate, proportionate chest")), onLeave: () => N("") }),
|
|
11950
11950
|
/* @__PURE__ */ A(rf, { img: MA.male.chest.broad, label: v("Broad"), selected: WA === "broad", onSelect: () => a("broad"), onHover: () => N(v("A wider, more muscular chest")), onLeave: () => N("") })
|
|
11951
11951
|
] }),
|
|
11952
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
11952
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
11953
11953
|
] }, "step-chest")),
|
|
11954
|
-
|
|
11954
|
+
O === "midsection" && (K ? /* @__PURE__ */ A(
|
|
11955
11955
|
iP,
|
|
11956
11956
|
{
|
|
11957
11957
|
stepNumber: I.indexOf("midsection") + 1,
|
|
@@ -11982,9 +11982,9 @@ function z8({
|
|
|
11982
11982
|
/* @__PURE__ */ A(rf, { img: MA.male.stomach.average, label: v("Average"), selected: X === "average", onSelect: () => BA("average"), onHover: () => N(v("A moderate, natural midsection shape")), onLeave: () => N("") }),
|
|
11983
11983
|
/* @__PURE__ */ A(rf, { img: MA.male.stomach.round, label: v("Full"), selected: X === "round", onSelect: () => BA("round"), onHover: () => N(v("A fuller, more rounded midsection")), onLeave: () => N("") })
|
|
11984
11984
|
] }) }),
|
|
11985
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
11985
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
11986
11986
|
] }, "step-midsection")),
|
|
11987
|
-
|
|
11987
|
+
O === "seat" && (K ? /* @__PURE__ */ A(
|
|
11988
11988
|
iP,
|
|
11989
11989
|
{
|
|
11990
11990
|
stepNumber: I.indexOf("seat") + 1,
|
|
@@ -12000,24 +12000,24 @@ function z8({
|
|
|
12000
12000
|
{ value: "full", label: v("Full"), img: MA.male.seat.full }
|
|
12001
12001
|
],
|
|
12002
12002
|
selected: EA,
|
|
12003
|
-
onSelect: (M) =>
|
|
12003
|
+
onSelect: (M) => uA(M),
|
|
12004
12004
|
t: v
|
|
12005
12005
|
},
|
|
12006
12006
|
"step-seat-mobile"
|
|
12007
12007
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12008
12008
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your seat?") }),
|
|
12009
12009
|
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(tA, { children: [
|
|
12010
|
-
/* @__PURE__ */ A(rf, { img: MA.female.seat.narrow, label: v("Flat"), selected: EA === "narrow", onSelect: () =>
|
|
12011
|
-
/* @__PURE__ */ A(rf, { img: MA.female.seat.average, label: v("Average"), selected: EA === "average", onSelect: () =>
|
|
12012
|
-
/* @__PURE__ */ A(rf, { img: MA.female.seat.full, label: v("Full"), selected: EA === "full", onSelect: () =>
|
|
12010
|
+
/* @__PURE__ */ A(rf, { img: MA.female.seat.narrow, label: v("Flat"), selected: EA === "narrow", onSelect: () => uA("narrow"), onHover: () => N(v("A flatter backside with less projection")), onLeave: () => N("") }),
|
|
12011
|
+
/* @__PURE__ */ A(rf, { img: MA.female.seat.average, label: v("Average"), selected: EA === "average", onSelect: () => uA("average"), onHover: () => N(v("A moderate, natural backside shape")), onLeave: () => N("") }),
|
|
12012
|
+
/* @__PURE__ */ A(rf, { img: MA.female.seat.full, label: v("Full"), selected: EA === "full", onSelect: () => uA("full"), onHover: () => N(v("A fuller, more rounded backside")), onLeave: () => N("") })
|
|
12013
12013
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
12014
|
-
/* @__PURE__ */ A(rf, { img: MA.male.seat.narrow, label: v("Flat"), selected: EA === "narrow", onSelect: () =>
|
|
12015
|
-
/* @__PURE__ */ A(rf, { img: MA.male.seat.average, label: v("Average"), selected: EA === "average", onSelect: () =>
|
|
12016
|
-
/* @__PURE__ */ A(rf, { img: MA.male.seat.full, label: v("Full"), selected: EA === "full", onSelect: () =>
|
|
12014
|
+
/* @__PURE__ */ A(rf, { img: MA.male.seat.narrow, label: v("Flat"), selected: EA === "narrow", onSelect: () => uA("narrow"), onHover: () => N(v("A flatter backside with less projection")), onLeave: () => N("") }),
|
|
12015
|
+
/* @__PURE__ */ A(rf, { img: MA.male.seat.average, label: v("Average"), selected: EA === "average", onSelect: () => uA("average"), onHover: () => N(v("A moderate, natural backside shape")), onLeave: () => N("") }),
|
|
12016
|
+
/* @__PURE__ */ A(rf, { img: MA.male.seat.full, label: v("Full"), selected: EA === "full", onSelect: () => uA("full"), onHover: () => N(v("A fuller, more rounded backside")), onLeave: () => N("") })
|
|
12017
12017
|
] }) }),
|
|
12018
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12018
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
12019
12019
|
] }, "step-seat")),
|
|
12020
|
-
|
|
12020
|
+
O === "hips" && g && (K ? /* @__PURE__ */ A(
|
|
12021
12021
|
iP,
|
|
12022
12022
|
{
|
|
12023
12023
|
stepNumber: I.indexOf("hips") + 1,
|
|
@@ -12028,7 +12028,7 @@ function z8({
|
|
|
12028
12028
|
{ value: "average", label: v("Average"), img: MA.female.hips.average },
|
|
12029
12029
|
{ value: "full", label: v("Curvy"), img: MA.female.hips.full }
|
|
12030
12030
|
],
|
|
12031
|
-
selected:
|
|
12031
|
+
selected: H,
|
|
12032
12032
|
onSelect: (M) => oA(M),
|
|
12033
12033
|
t: v
|
|
12034
12034
|
},
|
|
@@ -12036,13 +12036,13 @@ function z8({
|
|
|
12036
12036
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12037
12037
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your hips?") }),
|
|
12038
12038
|
/* @__PURE__ */ P("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: [
|
|
12039
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.narrow, label: v("Narrow"), selected:
|
|
12040
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected:
|
|
12041
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected:
|
|
12039
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.narrow, label: v("Narrow"), selected: H === "narrow", onSelect: () => oA("narrow"), onHover: () => N(v("Hips closer to shoulder width")), onLeave: () => N("") }),
|
|
12040
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected: H === "average", onSelect: () => oA("average"), onHover: () => N(v("Hips proportionate to shoulders")), onLeave: () => N("") }),
|
|
12041
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected: H === "full", onSelect: () => oA("full"), onHover: () => N(v("Hips wider than shoulders")), onLeave: () => N("") })
|
|
12042
12042
|
] }),
|
|
12043
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12043
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
12044
12044
|
] }, "step-hips")),
|
|
12045
|
-
|
|
12045
|
+
O === "bra" && g && /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
|
|
12046
12046
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Select your bra size") }),
|
|
12047
12047
|
/* @__PURE__ */ P("div", { className: "ps-bp-bra-section", children: [
|
|
12048
12048
|
/* @__PURE__ */ P("div", { className: "ps-bp-bra-header", children: [
|
|
@@ -12089,7 +12089,7 @@ function z8({
|
|
|
12089
12089
|
] });
|
|
12090
12090
|
})()
|
|
12091
12091
|
] }),
|
|
12092
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children:
|
|
12092
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-bra-grid", children: x.map((M) => /* @__PURE__ */ A(
|
|
12093
12093
|
"button",
|
|
12094
12094
|
{
|
|
12095
12095
|
className: `ps-bp-bra-btn${nA === M ? " ps-bp-bra-btn-selected" : ""}`,
|
|
@@ -12115,10 +12115,10 @@ function z8({
|
|
|
12115
12115
|
] }),
|
|
12116
12116
|
q && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: q })
|
|
12117
12117
|
] }, "step-bra"),
|
|
12118
|
-
!(K &&
|
|
12119
|
-
const M =
|
|
12118
|
+
!(K && O === "basics") && (() => {
|
|
12119
|
+
const M = O === "basics" && F && !!h, zA = M ? h : $A, cA = xf(vA) ? ` (${xf(vA)})` : "", tf = M ? v("Find My Best Fit") + cA : vf ? v("Find My Size") + cA : v("Next");
|
|
12120
12120
|
return /* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
12121
|
-
|
|
12121
|
+
O !== "basics" ? /* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: yA, type: "button", children: [
|
|
12122
12122
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
12123
12123
|
" ",
|
|
12124
12124
|
v("Back")
|
|
@@ -12155,7 +12155,7 @@ function SP({
|
|
|
12155
12155
|
formRef: i,
|
|
12156
12156
|
sizingUnit: o,
|
|
12157
12157
|
setSizingUnit: r,
|
|
12158
|
-
setSizingMethod:
|
|
12158
|
+
setSizingMethod: z,
|
|
12159
12159
|
setSizingLoading: p,
|
|
12160
12160
|
setView: T,
|
|
12161
12161
|
submitSizing: F,
|
|
@@ -12163,19 +12163,19 @@ function SP({
|
|
|
12163
12163
|
onBack: W,
|
|
12164
12164
|
t
|
|
12165
12165
|
}) {
|
|
12166
|
-
const k = e === "close-up", u = NP(), [v, I] = j("manual"), [
|
|
12166
|
+
const k = e === "close-up", u = NP(), [v, I] = j("manual"), [O, m] = j(() => {
|
|
12167
12167
|
const J = {};
|
|
12168
12168
|
return n.forEach((UA) => {
|
|
12169
12169
|
J[UA.key] = i.current[UA.key] || "";
|
|
12170
12170
|
}), J;
|
|
12171
|
-
}), [K, E] = j(""), gA = iA(null), [c, hA] = j(null), [l, y] = j(null), [
|
|
12171
|
+
}), [K, E] = j(""), gA = iA(null), [c, hA] = j(null), [l, y] = j(null), [YA, sA] = j(null), [V, s] = j(null), PA = jA(async (J) => {
|
|
12172
12172
|
const UA = J.target.files?.[0];
|
|
12173
12173
|
if (!UA) return;
|
|
12174
12174
|
const TA = URL.createObjectURL(UA);
|
|
12175
12175
|
y(UA), hA(TA);
|
|
12176
12176
|
try {
|
|
12177
|
-
const
|
|
12178
|
-
sA(
|
|
12177
|
+
const XA = await AP(UA);
|
|
12178
|
+
sA(XA);
|
|
12179
12179
|
} catch {
|
|
12180
12180
|
}
|
|
12181
12181
|
}, []), RA = jA(() => {
|
|
@@ -12185,27 +12185,27 @@ function SP({
|
|
|
12185
12185
|
}, dA = () => {
|
|
12186
12186
|
const J = n[0];
|
|
12187
12187
|
if (!J) return;
|
|
12188
|
-
const UA = parseFloat(
|
|
12188
|
+
const UA = parseFloat(O[J.key] || "");
|
|
12189
12189
|
if (!UA || UA <= 0) {
|
|
12190
12190
|
E(t("Please enter your ") + t(J.label).toLowerCase());
|
|
12191
12191
|
return;
|
|
12192
12192
|
}
|
|
12193
12193
|
n.forEach((TA) => {
|
|
12194
|
-
const
|
|
12195
|
-
|
|
12196
|
-
}), i.current.gender = i.current.gender || "male",
|
|
12194
|
+
const XA = parseFloat(O[TA.key] || "");
|
|
12195
|
+
XA > 0 && (i.current[TA.key] = String(XA));
|
|
12196
|
+
}), i.current.gender = i.current.gender || "male", z("exact"), p(!0), T("size-result"), F("exact");
|
|
12197
12197
|
}, ZA = () => {
|
|
12198
12198
|
if (V !== !0) {
|
|
12199
12199
|
E(t("Please confirm that the person in the photo is 18 or older before uploading."));
|
|
12200
12200
|
return;
|
|
12201
12201
|
}
|
|
12202
|
-
if (!l || !
|
|
12202
|
+
if (!l || !YA) {
|
|
12203
12203
|
E(t("Please upload a photo"));
|
|
12204
12204
|
return;
|
|
12205
12205
|
}
|
|
12206
12206
|
h({
|
|
12207
12207
|
photoFile: l,
|
|
12208
|
-
photoBase64:
|
|
12208
|
+
photoBase64: YA,
|
|
12209
12209
|
height: 0,
|
|
12210
12210
|
weight: 0,
|
|
12211
12211
|
heightUnit: "cm",
|
|
@@ -12250,7 +12250,7 @@ function SP({
|
|
|
12250
12250
|
{
|
|
12251
12251
|
type: "number",
|
|
12252
12252
|
className: "ps-bpm-value-input",
|
|
12253
|
-
value:
|
|
12253
|
+
value: O[J.key],
|
|
12254
12254
|
onChange: (UA) => mA(J.key, UA.target.value),
|
|
12255
12255
|
placeholder: J.placeholder[o] || J.placeholder.cm || J.placeholder.in || "",
|
|
12256
12256
|
step: J.step ?? 0.5,
|
|
@@ -12585,7 +12585,7 @@ function SP({
|
|
|
12585
12585
|
{
|
|
12586
12586
|
type: "number",
|
|
12587
12587
|
className: "ps-bp-inline-input",
|
|
12588
|
-
value:
|
|
12588
|
+
value: O[J.key],
|
|
12589
12589
|
onChange: (UA) => mA(J.key, UA.target.value),
|
|
12590
12590
|
placeholder: J.placeholder[o] || J.placeholder.cm || J.placeholder.in || "",
|
|
12591
12591
|
step: J.step ?? 0.5,
|
|
@@ -12778,7 +12778,7 @@ function R8({
|
|
|
12778
12778
|
buttonIcon: i,
|
|
12779
12779
|
locale: o,
|
|
12780
12780
|
buttonStyles: r = {},
|
|
12781
|
-
modalStyles:
|
|
12781
|
+
modalStyles: z = {},
|
|
12782
12782
|
classNames: p = {},
|
|
12783
12783
|
className: T,
|
|
12784
12784
|
style: F,
|
|
@@ -12790,21 +12790,21 @@ function R8({
|
|
|
12790
12790
|
onError: v,
|
|
12791
12791
|
sizeGuideData: I
|
|
12792
12792
|
}) {
|
|
12793
|
-
const
|
|
12793
|
+
const O = g || f, [m, K] = j(() => o || "");
|
|
12794
12794
|
JA(() => {
|
|
12795
12795
|
o !== void 0 && K(o);
|
|
12796
12796
|
}, [o]);
|
|
12797
|
-
const E =
|
|
12797
|
+
const E = wf(() => Hg(m || void 0), [m]), gA = e ?? E("Virtual Try-On"), [c, hA] = j(!1);
|
|
12798
12798
|
JA(() => {
|
|
12799
12799
|
hA(!0);
|
|
12800
12800
|
}, []);
|
|
12801
|
-
const [l, y] = j("idle"), [
|
|
12801
|
+
const [l, y] = j("idle"), [YA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, dA] = j(null), [ZA, Hf] = j(!1), [J, UA] = j(!1), [TA, XA] = j(null), [VA, kA] = j(null), [vA, SA] = j(null), [ff, rA] = j(!1), [nf, xA] = j(!1), [Ef, eA] = j(!1), [$, _A] = j(null), [Of, cf] = j(!1), Mf = iA(!1), [gf, qA] = j(Xg), GA = Yn(gf), [_, bA] = j(GA ? "in" : "cm"), [WA, a] = j(GA ? "in" : "cm"), [X, BA] = j(GA ? "lbs" : "kg");
|
|
12802
12802
|
JA(() => {
|
|
12803
12803
|
const w = Xf(n);
|
|
12804
|
-
w === "foot" || w === "head" ?
|
|
12804
|
+
w === "foot" || w === "head" ? bA("cm") : w === "face" && bA("mm");
|
|
12805
12805
|
}, [n]);
|
|
12806
|
-
const
|
|
12807
|
-
|
|
12806
|
+
const H = iA({}), [oA, EA] = j("male"), [uA, of] = j(0), [N, nA] = j(null), [Bf, FA] = j(!1), [OA, AA] = j(() => af("profiles", [])), [LA, Pf] = j(() => af("history", [])), [lA, x] = j(() => Kn()), [q, QA] = j(() => /* @__PURE__ */ new Set()), [U, R] = j(null), G = jA((w) => {
|
|
12807
|
+
x(w), Tg(w);
|
|
12808
12808
|
}, []), [S, aA] = j(!1), [fA, NA] = j(null), [$A, ef] = j(null), yA = iA(null), KA = iA(() => !1), vf = iA(() => {
|
|
12809
12809
|
}), M = jA((w, Q) => {
|
|
12810
12810
|
KA.current = w, vf.current = Q;
|
|
@@ -12890,14 +12890,14 @@ function R8({
|
|
|
12890
12890
|
fetch(`${w}/api/v1/sizing/sizeguide`, {
|
|
12891
12891
|
method: "POST",
|
|
12892
12892
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${Q}` },
|
|
12893
|
-
body: JSON.stringify({ product: { title: n, productId:
|
|
12893
|
+
body: JSON.stringify({ product: { title: n, productId: O }, sizeGuideRaw: I })
|
|
12894
12894
|
}).then((Y) => Y.ok ? Y.json() : null).then((Y) => {
|
|
12895
12895
|
_A(Y || { found: !1 });
|
|
12896
12896
|
}).catch(() => {
|
|
12897
12897
|
_A({ found: !1 });
|
|
12898
12898
|
}).finally(() => cf(!1));
|
|
12899
12899
|
}, [B, n, I]);
|
|
12900
|
-
const $n =
|
|
12900
|
+
const $n = wf(() => {
|
|
12901
12901
|
switch (l) {
|
|
12902
12902
|
case "welcome":
|
|
12903
12903
|
case "body-profile":
|
|
@@ -12955,7 +12955,7 @@ function R8({
|
|
|
12955
12955
|
Object.entries(Q.sections).map(([Z, d]) => [Z, d.recommendedSize])
|
|
12956
12956
|
) : void 0;
|
|
12957
12957
|
Tn(Y, {
|
|
12958
|
-
productId:
|
|
12958
|
+
productId: O,
|
|
12959
12959
|
productTitle: n,
|
|
12960
12960
|
productImage: f,
|
|
12961
12961
|
recommendedSize: Q.recommendedSize,
|
|
@@ -12965,7 +12965,7 @@ function R8({
|
|
|
12965
12965
|
}), AA(af("profiles", []));
|
|
12966
12966
|
}
|
|
12967
12967
|
},
|
|
12968
|
-
[lA, OA, B, f, n,
|
|
12968
|
+
[lA, OA, B, f, n, O, G]
|
|
12969
12969
|
), UP = iA(null), [qf, EP] = j(null), yP = jA(async (w) => {
|
|
12970
12970
|
const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0, wA = !!w.measurements && Object.keys(w.measurements).length > 0, L = w.photoBase64;
|
|
12971
12971
|
if (!wA && L && Q > 0 && UP.current) {
|
|
@@ -12998,7 +12998,7 @@ function R8({
|
|
|
12998
12998
|
} catch {
|
|
12999
12999
|
}
|
|
13000
13000
|
y("size-result"), Gn({
|
|
13001
|
-
productId:
|
|
13001
|
+
productId: O,
|
|
13002
13002
|
productTitle: n,
|
|
13003
13003
|
productImage: f,
|
|
13004
13004
|
sizeGuideData: I,
|
|
@@ -13009,7 +13009,7 @@ function R8({
|
|
|
13009
13009
|
d?.raw && SA(d.raw), xA(!0);
|
|
13010
13010
|
}).catch(() => {
|
|
13011
13011
|
}).finally(() => rA(!1));
|
|
13012
|
-
}, [
|
|
13012
|
+
}, [O, n, f, I, B, V]), _n = jA(async () => {
|
|
13013
13013
|
const w = OA.find((L) => L.id === lA);
|
|
13014
13014
|
if (!w) return;
|
|
13015
13015
|
const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0;
|
|
@@ -13019,12 +13019,12 @@ function R8({
|
|
|
13019
13019
|
const w = qf;
|
|
13020
13020
|
EP(null), yP(w);
|
|
13021
13021
|
}, [qf, yP]), fg = jA(() => {
|
|
13022
|
-
EP(null),
|
|
13022
|
+
EP(null), of((w) => w + 1), y("body-profile");
|
|
13023
13023
|
}, []), Pg = iA(() => {
|
|
13024
13024
|
}), ng = jA(() => {
|
|
13025
13025
|
console.log("[ps-sdk] handleOpen fired — opening modal"), y("body-profile"), h?.();
|
|
13026
13026
|
}, [h]), Gf = jA(() => {
|
|
13027
|
-
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), nA(null), FA(!1), aA(!1),
|
|
13027
|
+
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), nA(null), FA(!1), aA(!1), H.current = {}, EA("male"), Yf.current = !1, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null), W?.();
|
|
13028
13028
|
}, [W, V]), gg = jA(() => {
|
|
13029
13029
|
if (fA) {
|
|
13030
13030
|
NA(null), yA.current && (y(yA.current), yA.current = null);
|
|
@@ -13039,7 +13039,7 @@ function R8({
|
|
|
13039
13039
|
break;
|
|
13040
13040
|
case "size-result":
|
|
13041
13041
|
if (TA) {
|
|
13042
|
-
|
|
13042
|
+
XA(null);
|
|
13043
13043
|
break;
|
|
13044
13044
|
}
|
|
13045
13045
|
y("body-profile");
|
|
@@ -13096,11 +13096,11 @@ function R8({
|
|
|
13096
13096
|
const Q = w.error || E("Try-on generation failed");
|
|
13097
13097
|
dA(Q), y("error"), v?.({ message: Q });
|
|
13098
13098
|
}
|
|
13099
|
-
}, [u, v, Wf]), Kf =
|
|
13099
|
+
}, [u, v, Wf]), Kf = wf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields : oA === "female" ? Og : Kg, [$, oA]), Vf = jA(async (w) => {
|
|
13100
13100
|
if (!cA.current) return;
|
|
13101
13101
|
const Q = w || VA, Y = uf(B), wA = bf(), L = Xf(n);
|
|
13102
13102
|
if (L === "face" || L === "head") {
|
|
13103
|
-
const d =
|
|
13103
|
+
const d = H.current, b = (pA) => {
|
|
13104
13104
|
if (!pA) return;
|
|
13105
13105
|
const Af = parseFloat(pA);
|
|
13106
13106
|
return Number.isFinite(Af) && Af > 0 ? Af : void 0;
|
|
@@ -13149,36 +13149,36 @@ function R8({
|
|
|
13149
13149
|
const Z = {
|
|
13150
13150
|
method: Q,
|
|
13151
13151
|
locale: gf,
|
|
13152
|
-
product: { title: n, productId:
|
|
13152
|
+
product: { title: n, productId: O, description: "", variants: [] }
|
|
13153
13153
|
};
|
|
13154
|
-
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(
|
|
13155
|
-
const d = { gender:
|
|
13154
|
+
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") {
|
|
13155
|
+
const d = { gender: H.current.gender || "male", sizingUnit: _ }, b = /* @__PURE__ */ new Set();
|
|
13156
13156
|
for (const HA of Kf)
|
|
13157
13157
|
HA.unit !== "size" && !["shoeEU", "shoeUS", "shoeUK"].includes(HA.key) && b.add(HA.key);
|
|
13158
13158
|
for (const HA of ["chest", "bust", "waist", "hips", "shoulderWidth", "sleeveLength", "inseam", "neckCircumference", "footLengthCm", "height", "length", "thighCircumference", "headCircumferenceCm", "faceWidthMm", "bridgeWidthMm", "templeLengthMm"])
|
|
13159
|
-
|
|
13159
|
+
H.current[HA] && b.add(HA);
|
|
13160
13160
|
console.log("[PS-SDK] numericKeys:", [...b].join(", "));
|
|
13161
13161
|
for (const HA of b) {
|
|
13162
|
-
const DA =
|
|
13162
|
+
const DA = H.current[HA];
|
|
13163
13163
|
if (!DA) continue;
|
|
13164
13164
|
const CA = parseFloat(DA);
|
|
13165
13165
|
isNaN(CA) || (d[HA] = CA);
|
|
13166
13166
|
}
|
|
13167
|
-
|
|
13167
|
+
H.current.shoeEU && (d.shoeEU = H.current.shoeEU), H.current.shoeUS && (d.shoeUS = H.current.shoeUS), H.current.shoeUK && (d.shoeUK = H.current.shoeUK), H.current.fitPreference && (d.fitPreference = H.current.fitPreference), Z.measurements = d, console.log("[PS-SDK] FINAL measurements:", JSON.stringify(d));
|
|
13168
13168
|
} else {
|
|
13169
|
-
const d = parseFloat(
|
|
13169
|
+
const d = parseFloat(H.current.height || "0"), b = parseFloat(H.current.weight || "0");
|
|
13170
13170
|
if (!d || !b) {
|
|
13171
|
-
console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(
|
|
13171
|
+
console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(H.current)), rA(!1);
|
|
13172
13172
|
return;
|
|
13173
13173
|
}
|
|
13174
13174
|
const HA = {
|
|
13175
13175
|
height: d,
|
|
13176
13176
|
weight: b,
|
|
13177
|
-
heightUnit:
|
|
13178
|
-
weightUnit:
|
|
13179
|
-
gender:
|
|
13177
|
+
heightUnit: H.current.heightUnit || WA || "cm",
|
|
13178
|
+
weightUnit: H.current.weightUnit || X || "kg",
|
|
13179
|
+
gender: H.current.gender || "male"
|
|
13180
13180
|
};
|
|
13181
|
-
|
|
13181
|
+
H.current.age && (HA.age = parseInt(H.current.age, 10)), H.current.bodyType && (HA.bodyType = H.current.bodyType), H.current.chestProfile && (HA.chestProfile = H.current.chestProfile), H.current.midsectionProfile && (HA.midsectionProfile = H.current.midsectionProfile), H.current.hipProfile && (HA.hipProfile = H.current.hipProfile), Z.quickEstimate = HA;
|
|
13182
13182
|
}
|
|
13183
13183
|
xA(!1);
|
|
13184
13184
|
try {
|
|
@@ -13235,7 +13235,7 @@ function R8({
|
|
|
13235
13235
|
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"), rA(!0), y("size-result"), Vf("quick");
|
|
13236
13236
|
return;
|
|
13237
13237
|
}
|
|
13238
|
-
|
|
13238
|
+
H.current.height = String(w), H.current.weight = String(Q), H.current.heightUnit = Y, H.current.weightUnit = wA, H.current.gender = L, Z && (H.current.age = String(Z)), d && (H.current.bodyType = d), b && (H.current.chestProfile = b), HA && (H.current.midsectionProfile = HA), DA && (H.current.hipProfile = DA), SA(null), RA(null), kA("quick"), rA(!0), y("size-result"), Vf("quick");
|
|
13239
13239
|
}, [B, Kf, $, Vf, _, X]), dP = jA(async (w) => {
|
|
13240
13240
|
if (console.log("[ps-sdk] handleSnapSubmit fired", {
|
|
13241
13241
|
hasApiRef: !!cA.current,
|
|
@@ -13258,7 +13258,7 @@ function R8({
|
|
|
13258
13258
|
const CA = await dg(wA);
|
|
13259
13259
|
CA && LP(CA.landmarks);
|
|
13260
13260
|
const zf = {
|
|
13261
|
-
product: { title: n, productId:
|
|
13261
|
+
product: { title: n, productId: O },
|
|
13262
13262
|
sizeGuide: $ ?? { found: !1 },
|
|
13263
13263
|
sizingUnit: L === "head" ? "cm" : "mm",
|
|
13264
13264
|
category: L,
|
|
@@ -13302,7 +13302,7 @@ function R8({
|
|
|
13302
13302
|
method: "photo",
|
|
13303
13303
|
locale: gf,
|
|
13304
13304
|
sizingUnit: _,
|
|
13305
|
-
product: { title: n, productId:
|
|
13305
|
+
product: { title: n, productId: O, description: "", variants: [] },
|
|
13306
13306
|
bodyImage: w.photoBase64,
|
|
13307
13307
|
// BlazePose landmarks (normalized 0–1 coordinates). The backend uses
|
|
13308
13308
|
// these to compute exact pixel distances and feed them to Gemini as
|
|
@@ -13348,13 +13348,13 @@ function R8({
|
|
|
13348
13348
|
}, [B, f, n, _, X, gf, $, Kf, Zf]);
|
|
13349
13349
|
UP.current = dP;
|
|
13350
13350
|
const WP = jA(async (w) => {
|
|
13351
|
-
const Q = w ||
|
|
13351
|
+
const Q = w || YA || Jf.current;
|
|
13352
13352
|
if (!Q || !cA.current || !tf.current) {
|
|
13353
13353
|
const Z = cA.current ? E("Please upload a photo first.") : E("SDK not configured. Please provide an API key.");
|
|
13354
13354
|
dA(Z), y("error"), v?.({ message: Z, code: "SDK_NOT_CONFIGURED" });
|
|
13355
13355
|
return;
|
|
13356
13356
|
}
|
|
13357
|
-
w && w !==
|
|
13357
|
+
w && w !== YA && (sA(w), Jf.current = w), pf.current = !1, eA(!0);
|
|
13358
13358
|
const Y = En(Xf(n)), wA = Y === "apparel", L = (w ? null : V) || URL.createObjectURL(Q);
|
|
13359
13359
|
(w || !V) && s(L), If.current = null, lf(null), wA && (rP(L).then((Z) => {
|
|
13360
13360
|
If.current = Z;
|
|
@@ -13373,7 +13373,7 @@ function R8({
|
|
|
13373
13373
|
d,
|
|
13374
13374
|
Y ?? "apparel",
|
|
13375
13375
|
{
|
|
13376
|
-
productId:
|
|
13376
|
+
productId: O,
|
|
13377
13377
|
productTitle: n,
|
|
13378
13378
|
silhouetteContext: Cn(vA, $)
|
|
13379
13379
|
}
|
|
@@ -13399,8 +13399,8 @@ function R8({
|
|
|
13399
13399
|
const d = Z instanceof Error ? Z.message : E("Failed to start try-on"), b = Z instanceof an ? Z.code : void 0;
|
|
13400
13400
|
dA(d), y("error"), v?.({ message: d, code: b });
|
|
13401
13401
|
}
|
|
13402
|
-
}, [
|
|
13403
|
-
if (!
|
|
13402
|
+
}, [YA, f, n, vA, k, v, aP]), og = jA(async (w) => {
|
|
13403
|
+
if (!YA || !cA.current || !tf.current) return;
|
|
13404
13404
|
UA(!0);
|
|
13405
13405
|
const Q = En(Xf(n)), Y = Q === "apparel";
|
|
13406
13406
|
if (Y && If.current) {
|
|
@@ -13421,13 +13421,13 @@ function R8({
|
|
|
13421
13421
|
}
|
|
13422
13422
|
try {
|
|
13423
13423
|
pf.current = !1, Df.current?.(), IA.current && (clearInterval(IA.current), IA.current = null);
|
|
13424
|
-
const wA = await AP(
|
|
13424
|
+
const wA = await AP(YA), L = Y ? w : void 0, Z = await cA.current.submitTryOn(
|
|
13425
13425
|
wA,
|
|
13426
13426
|
f,
|
|
13427
13427
|
L,
|
|
13428
13428
|
Q ?? "apparel",
|
|
13429
13429
|
{
|
|
13430
|
-
productId:
|
|
13430
|
+
productId: O,
|
|
13431
13431
|
productTitle: n,
|
|
13432
13432
|
silhouetteContext: Cn(vA, $)
|
|
13433
13433
|
}
|
|
@@ -13454,7 +13454,7 @@ function R8({
|
|
|
13454
13454
|
} catch {
|
|
13455
13455
|
UA(!1);
|
|
13456
13456
|
}
|
|
13457
|
-
}, [
|
|
13457
|
+
}, [YA, f, n]), wg = jA(() => {
|
|
13458
13458
|
if (PA)
|
|
13459
13459
|
if (PA.startsWith("data:")) {
|
|
13460
13460
|
const w = document.createElement("a");
|
|
@@ -13474,28 +13474,28 @@ function R8({
|
|
|
13474
13474
|
if ((Q.height ?? Q.heightCm) && (Y.height = String(Q.height ?? Q.heightCm)), (Q.weight ?? Q.weightKg) && (Y.weight = String(Q.weight ?? Q.weightKg)), Q.chest && (Y.chest = String(Q.chest)), Q.bust && (Y.bust = String(Q.bust)), Q.waist && (Y.waist = String(Q.waist)), Q.hips && (Y.hips = String(Q.hips)), Q.shoulderWidth && (Y.shoulderWidth = String(Q.shoulderWidth)), Q.sleeveLength && (Y.sleeveLength = String(Q.sleeveLength)), Q.inseam && (Y.inseam = String(Q.inseam)), Q.neckCircumference && (Y.neckCircumference = String(Q.neckCircumference)), Q.footLengthCm && (Y.footLengthCm = String(Q.footLengthCm)), Q.shoeEU && (Y.shoeEU = Q.shoeEU), Q.shoeUS && (Y.shoeUS = Q.shoeUS), Q.shoeUK && (Y.shoeUK = Q.shoeUK), Q.fitPreference && (Y.fitPreference = Q.fitPreference), Q.customMeasurements)
|
|
13475
13475
|
for (const [wA, L] of Object.entries(Q.customMeasurements))
|
|
13476
13476
|
Y[wA] = String(L);
|
|
13477
|
-
|
|
13477
|
+
H.current = Y, EA(Y.gender || "male"), Q.country && qA(Q.country), Q.sizingUnit && bA(Q.sizingUnit), Q.heightUnit && a(Q.heightUnit), Q.weightUnit && BA(Q.weightUnit), of((wA) => wA + 1);
|
|
13478
13478
|
}, [OA]);
|
|
13479
13479
|
Pg.current = Dg, jA((w, Q) => {
|
|
13480
13480
|
const Y = (Q ? null : lA) || `p_${Date.now()}`, wA = {
|
|
13481
13481
|
id: Y,
|
|
13482
13482
|
name: w,
|
|
13483
|
-
gender:
|
|
13484
|
-
height:
|
|
13485
|
-
weight:
|
|
13486
|
-
chest:
|
|
13487
|
-
bust:
|
|
13488
|
-
waist:
|
|
13489
|
-
hips:
|
|
13490
|
-
shoulderWidth:
|
|
13491
|
-
sleeveLength:
|
|
13492
|
-
inseam:
|
|
13493
|
-
neckCircumference:
|
|
13494
|
-
footLengthCm:
|
|
13495
|
-
shoeEU:
|
|
13496
|
-
shoeUS:
|
|
13497
|
-
shoeUK:
|
|
13498
|
-
fitPreference:
|
|
13483
|
+
gender: H.current.gender || "male",
|
|
13484
|
+
height: H.current.height ? parseFloat(H.current.height) : void 0,
|
|
13485
|
+
weight: H.current.weight ? parseFloat(H.current.weight) : void 0,
|
|
13486
|
+
chest: H.current.chest ? parseFloat(H.current.chest) : void 0,
|
|
13487
|
+
bust: H.current.bust ? parseFloat(H.current.bust) : void 0,
|
|
13488
|
+
waist: H.current.waist ? parseFloat(H.current.waist) : void 0,
|
|
13489
|
+
hips: H.current.hips ? parseFloat(H.current.hips) : void 0,
|
|
13490
|
+
shoulderWidth: H.current.shoulderWidth ? parseFloat(H.current.shoulderWidth) : void 0,
|
|
13491
|
+
sleeveLength: H.current.sleeveLength ? parseFloat(H.current.sleeveLength) : void 0,
|
|
13492
|
+
inseam: H.current.inseam ? parseFloat(H.current.inseam) : void 0,
|
|
13493
|
+
neckCircumference: H.current.neckCircumference ? parseFloat(H.current.neckCircumference) : void 0,
|
|
13494
|
+
footLengthCm: H.current.footLengthCm ? parseFloat(H.current.footLengthCm) : void 0,
|
|
13495
|
+
shoeEU: H.current.shoeEU,
|
|
13496
|
+
shoeUS: H.current.shoeUS,
|
|
13497
|
+
shoeUK: H.current.shoeUK,
|
|
13498
|
+
fitPreference: H.current.fitPreference,
|
|
13499
13499
|
country: gf,
|
|
13500
13500
|
sizingUnit: _,
|
|
13501
13501
|
heightUnit: WA,
|
|
@@ -13521,7 +13521,7 @@ function R8({
|
|
|
13521
13521
|
"heightFeet",
|
|
13522
13522
|
"heightInches"
|
|
13523
13523
|
]), Z = {};
|
|
13524
|
-
for (const [d, b] of Object.entries(
|
|
13524
|
+
for (const [d, b] of Object.entries(H.current))
|
|
13525
13525
|
!L.has(d) && b && !isNaN(Number(b)) && (Z[d] = parseFloat(b));
|
|
13526
13526
|
Object.keys(Z).length > 0 && (wA.customMeasurements = Z), AA((d) => {
|
|
13527
13527
|
const b = d.findIndex((HA) => HA.id === Y);
|
|
@@ -13570,11 +13570,11 @@ function R8({
|
|
|
13570
13570
|
reasoning: w.reasoning || "",
|
|
13571
13571
|
internationalSizes: w.internationalSizes,
|
|
13572
13572
|
matchDetails: w.matchDetails
|
|
13573
|
-
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1), eA(!1),
|
|
13573
|
+
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1), eA(!1), XA(null), NA(null), y("size-result");
|
|
13574
13574
|
}, []), ig = jA((w, Q) => {
|
|
13575
|
-
|
|
13575
|
+
H.current[w] = Q;
|
|
13576
13576
|
}, []);
|
|
13577
|
-
|
|
13577
|
+
wf(() => {
|
|
13578
13578
|
const Q = {
|
|
13579
13579
|
US: { key: "shoeUS", labelKey: "Shoe size (US)", ph: "e.g. 10" },
|
|
13580
13580
|
UK: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" },
|
|
@@ -13598,47 +13598,47 @@ function R8({
|
|
|
13598
13598
|
"--ps-btn-icon-size": r.iconSize,
|
|
13599
13599
|
"--ps-btn-icon-color": r.iconColor,
|
|
13600
13600
|
"--ps-btn-shadow": r.boxShadow,
|
|
13601
|
-
"--ps-modal-overlay":
|
|
13602
|
-
"--ps-modal-bg":
|
|
13603
|
-
"--ps-modal-color":
|
|
13604
|
-
"--ps-modal-radius":
|
|
13605
|
-
"--ps-modal-width":
|
|
13606
|
-
"--ps-modal-max-width":
|
|
13607
|
-
"--ps-modal-font":
|
|
13608
|
-
"--ps-modal-header-bg":
|
|
13609
|
-
"--ps-modal-header-color":
|
|
13610
|
-
"--ps-modal-close-color":
|
|
13611
|
-
"--ps-upload-border":
|
|
13612
|
-
"--ps-upload-bg":
|
|
13613
|
-
"--ps-upload-color":
|
|
13614
|
-
"--ps-upload-icon-color":
|
|
13615
|
-
"--ps-modal-primary-bg":
|
|
13616
|
-
"--ps-modal-primary-color":
|
|
13617
|
-
"--ps-modal-primary-radius":
|
|
13618
|
-
"--ps-loader":
|
|
13619
|
-
"--ps-result-radius":
|
|
13601
|
+
"--ps-modal-overlay": z.overlayColor,
|
|
13602
|
+
"--ps-modal-bg": z.backgroundColor,
|
|
13603
|
+
"--ps-modal-color": z.textColor,
|
|
13604
|
+
"--ps-modal-radius": z.borderRadius,
|
|
13605
|
+
"--ps-modal-width": z.width,
|
|
13606
|
+
"--ps-modal-max-width": z.maxWidth,
|
|
13607
|
+
"--ps-modal-font": z.fontFamily,
|
|
13608
|
+
"--ps-modal-header-bg": z.headerBackgroundColor,
|
|
13609
|
+
"--ps-modal-header-color": z.headerTextColor,
|
|
13610
|
+
"--ps-modal-close-color": z.closeButtonColor,
|
|
13611
|
+
"--ps-upload-border": z.uploadBorderColor,
|
|
13612
|
+
"--ps-upload-bg": z.uploadBackgroundColor,
|
|
13613
|
+
"--ps-upload-color": z.uploadTextColor,
|
|
13614
|
+
"--ps-upload-icon-color": z.uploadIconColor,
|
|
13615
|
+
"--ps-modal-primary-bg": z.primaryButtonBackgroundColor,
|
|
13616
|
+
"--ps-modal-primary-color": z.primaryButtonTextColor,
|
|
13617
|
+
"--ps-modal-primary-radius": z.primaryButtonBorderRadius,
|
|
13618
|
+
"--ps-loader": z.loaderColor,
|
|
13619
|
+
"--ps-result-radius": z.resultBorderRadius,
|
|
13620
13620
|
// New theming variables.
|
|
13621
13621
|
// accentColor falls back to the trigger button background so the user's
|
|
13622
13622
|
// brand color cascades to the modal automatically without having to pass
|
|
13623
13623
|
// both buttonStyles AND modalStyles. Most consumers only set buttonStyles.
|
|
13624
|
-
"--ps-accent":
|
|
13625
|
-
"--ps-accent-hover":
|
|
13626
|
-
"--ps-accent-light":
|
|
13627
|
-
"--ps-text-primary":
|
|
13628
|
-
"--ps-text-secondary":
|
|
13629
|
-
"--ps-text-muted":
|
|
13630
|
-
"--ps-border-color":
|
|
13631
|
-
"--ps-bg-secondary":
|
|
13632
|
-
"--ps-error-color":
|
|
13633
|
-
"--ps-success-color":
|
|
13634
|
-
"--ps-logo-height":
|
|
13624
|
+
"--ps-accent": z.accentColor ?? r.backgroundColor,
|
|
13625
|
+
"--ps-accent-hover": z.accentHoverColor ?? r.hoverBackgroundColor,
|
|
13626
|
+
"--ps-accent-light": z.accentLightColor,
|
|
13627
|
+
"--ps-text-primary": z.textPrimaryColor,
|
|
13628
|
+
"--ps-text-secondary": z.textSecondaryColor,
|
|
13629
|
+
"--ps-text-muted": z.textMutedColor,
|
|
13630
|
+
"--ps-border-color": z.borderColor,
|
|
13631
|
+
"--ps-bg-secondary": z.secondaryBackgroundColor,
|
|
13632
|
+
"--ps-error-color": z.errorColor,
|
|
13633
|
+
"--ps-success-color": z.successColor,
|
|
13634
|
+
"--ps-logo-height": z.logoHeight
|
|
13635
13635
|
}, $P = Object.fromEntries(Object.entries(tg).filter(([, w]) => w !== void 0));
|
|
13636
13636
|
function rg() {
|
|
13637
13637
|
switch (l) {
|
|
13638
13638
|
case "welcome":
|
|
13639
13639
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(BB, { productImage: f, setView: y, t: E }) }, "v-welcome");
|
|
13640
13640
|
case "body-profile": {
|
|
13641
|
-
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef:
|
|
13641
|
+
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit: bA, setSizingMethod: kA, setSizingLoading: rA, setView: y, submitSizing: Vf, onSnapSubmit: dP, onBack: Gf, sizeGuide: $, t: E };
|
|
13642
13642
|
if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...Q }) }, "v-foot");
|
|
13643
13643
|
if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...Q }) }, "v-head");
|
|
13644
13644
|
if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...Q }) }, "v-face");
|
|
@@ -13649,14 +13649,14 @@ function R8({
|
|
|
13649
13649
|
productImage: f,
|
|
13650
13650
|
productTitle: n,
|
|
13651
13651
|
isWomen: Y || L,
|
|
13652
|
-
formRef:
|
|
13652
|
+
formRef: H,
|
|
13653
13653
|
sizingCountry: gf,
|
|
13654
13654
|
heightUnit: WA,
|
|
13655
13655
|
setHeightUnit: a,
|
|
13656
13656
|
weightUnit: X,
|
|
13657
13657
|
setWeightUnit: BA,
|
|
13658
13658
|
sizingUnit: _,
|
|
13659
|
-
setSizingUnit:
|
|
13659
|
+
setSizingUnit: bA,
|
|
13660
13660
|
hasActiveProfileWithMeasurements: (() => {
|
|
13661
13661
|
const d = OA.find((DA) => DA.id === lA);
|
|
13662
13662
|
if (!d) return !1;
|
|
@@ -13667,10 +13667,10 @@ function R8({
|
|
|
13667
13667
|
activeProfileName: OA.find((b) => b.id === lA)?.name || null,
|
|
13668
13668
|
activeProfile: OA.find((d) => d.id === lA) || null,
|
|
13669
13669
|
onStartFresh: () => {
|
|
13670
|
-
G(null),
|
|
13670
|
+
G(null), H.current = {};
|
|
13671
13671
|
},
|
|
13672
13672
|
onComplete: (d) => {
|
|
13673
|
-
|
|
13673
|
+
H.current.gender = d.gender, d.bandSize && (H.current.bandSize = d.bandSize), d.cupSize && (H.current.cupSize = d.cupSize), eg(
|
|
13674
13674
|
d.height,
|
|
13675
13675
|
d.weight,
|
|
13676
13676
|
d.heightUnit,
|
|
@@ -13700,12 +13700,12 @@ function R8({
|
|
|
13700
13700
|
estimatedValues: N,
|
|
13701
13701
|
estimationLoading: Bf,
|
|
13702
13702
|
dynamicFields: Kf,
|
|
13703
|
-
formRef:
|
|
13703
|
+
formRef: H,
|
|
13704
13704
|
formGender: oA,
|
|
13705
|
-
formKey:
|
|
13706
|
-
setFormKey:
|
|
13705
|
+
formKey: uA,
|
|
13706
|
+
setFormKey: of,
|
|
13707
13707
|
sizingUnit: _,
|
|
13708
|
-
setSizingUnit:
|
|
13708
|
+
setSizingUnit: bA,
|
|
13709
13709
|
updateField: ig,
|
|
13710
13710
|
setSizingMethod: kA,
|
|
13711
13711
|
setSizingLoading: rA,
|
|
@@ -13730,7 +13730,7 @@ function R8({
|
|
|
13730
13730
|
handleDownload: wg,
|
|
13731
13731
|
onRetryWithFit: og,
|
|
13732
13732
|
retryLoading: J,
|
|
13733
|
-
selectedFile:
|
|
13733
|
+
selectedFile: YA,
|
|
13734
13734
|
previewUrl: V,
|
|
13735
13735
|
handleFileSelect: ZP,
|
|
13736
13736
|
handleRemovePreview: qP,
|
|
@@ -13740,7 +13740,7 @@ function R8({
|
|
|
13740
13740
|
faceLandmarks: Vn,
|
|
13741
13741
|
measurementType: Xf(n),
|
|
13742
13742
|
activeSection: TA,
|
|
13743
|
-
setActiveSection:
|
|
13743
|
+
setActiveSection: XA,
|
|
13744
13744
|
onResetTryOn: () => {
|
|
13745
13745
|
sA(null), V && URL.revokeObjectURL(V), s(null), RA(null);
|
|
13746
13746
|
},
|
|
@@ -13760,7 +13760,7 @@ function R8({
|
|
|
13760
13760
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
13761
13761
|
aB,
|
|
13762
13762
|
{
|
|
13763
|
-
selectedFile:
|
|
13763
|
+
selectedFile: YA,
|
|
13764
13764
|
previewUrl: V,
|
|
13765
13765
|
dragOver: ZA,
|
|
13766
13766
|
setDragOver: Hf,
|
|
@@ -13992,10 +13992,10 @@ function G8(f) {
|
|
|
13992
13992
|
const [n, g] = j(null), [e, B] = j(!0), [C, D] = j(!1), [i, o] = j(0);
|
|
13993
13993
|
return JA(() => {
|
|
13994
13994
|
let r = !1;
|
|
13995
|
-
return B(!0), D(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: f.productId }), Gn(f).then((
|
|
13996
|
-
r || (
|
|
13997
|
-
}).catch((
|
|
13998
|
-
console.log("[ps-sdk:hook] usePrimeStyleSize threw",
|
|
13995
|
+
return B(!0), D(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: f.productId }), Gn(f).then((z) => {
|
|
13996
|
+
r || (z === null ? (console.log("[ps-sdk:hook] usePrimeStyleSize → null (no profile or recommendation failed)"), D(!0), g(null)) : (console.log("[ps-sdk:hook] usePrimeStyleSize → result", { recommendedSize: z.recommendedSize, hasRaw: !!z.raw }), g(z)));
|
|
13997
|
+
}).catch((z) => {
|
|
13998
|
+
console.log("[ps-sdk:hook] usePrimeStyleSize threw", z), r || g(null);
|
|
13999
13999
|
}).finally(() => {
|
|
14000
14000
|
r || B(!1);
|
|
14001
14001
|
}), () => {
|
|
@@ -14003,7 +14003,7 @@ function G8(f) {
|
|
|
14003
14003
|
};
|
|
14004
14004
|
}, [f.productId, f.apiUrl, f.apiKey, i]), JA(() => {
|
|
14005
14005
|
if (typeof window > "u") return;
|
|
14006
|
-
const r = () => o((
|
|
14006
|
+
const r = () => o((z) => z + 1);
|
|
14007
14007
|
return window.addEventListener(fP, r), window.addEventListener("storage", r), () => {
|
|
14008
14008
|
window.removeEventListener(fP, r), window.removeEventListener("storage", r);
|
|
14009
14009
|
};
|