@primestyleai/tryon 5.10.15 → 5.10.16
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 +374 -374
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +3 -8
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -31,11 +31,11 @@ async function rP(f) {
|
|
|
31
31
|
const n = await Fn(f), g = HP.detect(n);
|
|
32
32
|
if (!g?.landmarks?.length || g.landmarks[0].length < 25)
|
|
33
33
|
return null;
|
|
34
|
-
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], i = e[YP], o = (B.y + C.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, N = I + v / 2;
|
|
35
35
|
return {
|
|
36
36
|
chest: { y: p, x1: F, x2: h },
|
|
37
37
|
waist: { y: u, x1: O, x2: N },
|
|
38
|
-
hips: { y:
|
|
38
|
+
hips: { y: r, x1: t, x2: k }
|
|
39
39
|
};
|
|
40
40
|
} catch (n) {
|
|
41
41
|
return console.error("[PS-SDK] Pose detection failed:", n), null;
|
|
@@ -134,8 +134,8 @@ function Ug(f) {
|
|
|
134
134
|
}
|
|
135
135
|
function Dn(f, n, g) {
|
|
136
136
|
if (f.length < 4) return 0;
|
|
137
|
-
const e = (z) => ({ x: z.x * n, y: z.y * g }), [B, C, D, i] = f.map(e), o = Math.hypot(B.x - D.x, B.y - D.y),
|
|
138
|
-
return (o +
|
|
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
|
+
return (o + r) / 2;
|
|
139
139
|
}
|
|
140
140
|
function Eg(f) {
|
|
141
141
|
if (f.length < 478) return null;
|
|
@@ -166,11 +166,11 @@ 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,
|
|
169
|
+
) * i, r = o(f.leftIrisCenter, f.rightIrisCenter), p = o(f.leftInnerEye, f.rightInnerEye) / 1.6, T = o(f.leftTragus, f.rightTragus), F = o(f.leftTragus, f.leftOuterEye), h = o(f.rightTragus, f.rightOuterEye), W = (F + h) / 2, t = T * 1.07, u = Math.abs((f.forehead.z ?? 0) - (f.chin.z ?? 0)) * n * i, v = Math.max(170, Math.min(210, u || 190)), I = t / 2, O = v / 2, N = Math.PI * Math.sqrt(2 * (I * I + O * O));
|
|
170
170
|
return {
|
|
171
171
|
measurements: {
|
|
172
172
|
irisDiameter: vn,
|
|
173
|
-
pd: Rf(
|
|
173
|
+
pd: Rf(r),
|
|
174
174
|
bridgeWidth: Rf(p),
|
|
175
175
|
faceWidth: Rf(T),
|
|
176
176
|
templeLengthLeft: Rf(F),
|
|
@@ -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((
|
|
262
|
+
(o) => D.map((r, z) => `${r} ${o[z] ?? "—"}`).join(", ")
|
|
263
263
|
);
|
|
264
264
|
g.sizeChartSummary = i.join(" | ");
|
|
265
265
|
}
|
|
@@ -490,7 +490,7 @@ async function Gn(f) {
|
|
|
490
490
|
}
|
|
491
491
|
if (!o || !o.recommendedSize)
|
|
492
492
|
return n("recommend returned no recommendedSize — bailing"), null;
|
|
493
|
-
const
|
|
493
|
+
const r = o.sections ? Object.fromEntries(
|
|
494
494
|
Object.entries(o.sections).map(([p, T]) => [p, T.recommendedSize])
|
|
495
495
|
) : void 0, z = o.sections ? Object.fromEntries(
|
|
496
496
|
Object.entries(o.sections).map(([p, T]) => [
|
|
@@ -511,14 +511,14 @@ async function Gn(f) {
|
|
|
511
511
|
productImage: f.productImage,
|
|
512
512
|
recommendedSize: o.recommendedSize,
|
|
513
513
|
confidence: o.confidence,
|
|
514
|
-
sections:
|
|
514
|
+
sections: r,
|
|
515
515
|
sectionsFull: z,
|
|
516
516
|
recommendedLength: o.recommendedLength || void 0,
|
|
517
517
|
savedAt: Date.now()
|
|
518
518
|
}), {
|
|
519
519
|
recommendedSize: o.recommendedSize,
|
|
520
520
|
confidence: o.confidence,
|
|
521
|
-
sections:
|
|
521
|
+
sections: r,
|
|
522
522
|
profileId: g.id,
|
|
523
523
|
fromCache: !1,
|
|
524
524
|
raw: o,
|
|
@@ -6786,21 +6786,21 @@ function $g({ view: f, stepIndex: n }) {
|
|
|
6786
6786
|
return f === "error" || f === "idle" ? null : /* @__PURE__ */ A("div", { className: "ps-tryon-dots", children: Array.from({ length: sg }, (g, e) => e + 1).map((g) => /* @__PURE__ */ A("div", { className: `ps-tryon-dot${g < n ? " ps-done" : g === n ? " ps-active" : ""}` }, g)) });
|
|
6787
6787
|
}
|
|
6788
6788
|
function _g({ activeLocale: f, onSelect: n }) {
|
|
6789
|
-
const [g, e] = j(!1), B = iA(null), C = iA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English",
|
|
6789
|
+
const [g, e] = j(!1), B = iA(null), C = iA(null), [D, i] = j({ top: 0, right: 0 }), o = _P[f] || "English", r = UA(() => {
|
|
6790
6790
|
if (!B.current) return;
|
|
6791
6791
|
const z = B.current.getBoundingClientRect();
|
|
6792
6792
|
i({ top: z.bottom + 4, right: window.innerWidth - z.right });
|
|
6793
6793
|
}, []);
|
|
6794
6794
|
return JA(() => {
|
|
6795
6795
|
if (!g) return;
|
|
6796
|
-
|
|
6796
|
+
r();
|
|
6797
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", z), window.addEventListener("resize",
|
|
6801
|
-
document.removeEventListener("mousedown", z), window.removeEventListener("resize",
|
|
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
|
-
}, [g,
|
|
6803
|
+
}, [g, r]), /* @__PURE__ */ P(tA, { children: [
|
|
6804
6804
|
/* @__PURE__ */ P(
|
|
6805
6805
|
"button",
|
|
6806
6806
|
{
|
|
@@ -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,
|
|
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"]) {
|
|
@@ -6931,7 +6931,7 @@ function un({
|
|
|
6931
6931
|
{
|
|
6932
6932
|
type: "button",
|
|
6933
6933
|
className: `ps-tryon-pe-pill-btn${o === "cm" ? " ps-active" : ""}`,
|
|
6934
|
-
onClick: () =>
|
|
6934
|
+
onClick: () => r("cm"),
|
|
6935
6935
|
children: "cm"
|
|
6936
6936
|
}
|
|
6937
6937
|
),
|
|
@@ -6940,7 +6940,7 @@ function un({
|
|
|
6940
6940
|
{
|
|
6941
6941
|
type: "button",
|
|
6942
6942
|
className: `ps-tryon-pe-pill-btn${o === "in" ? " ps-active" : ""}`,
|
|
6943
|
-
onClick: () =>
|
|
6943
|
+
onClick: () => r("in"),
|
|
6944
6944
|
children: "in"
|
|
6945
6945
|
}
|
|
6946
6946
|
)
|
|
@@ -6984,7 +6984,7 @@ function PB({
|
|
|
6984
6984
|
restoreHistory: i,
|
|
6985
6985
|
t: o
|
|
6986
6986
|
}) {
|
|
6987
|
-
const [
|
|
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 = {
|
|
@@ -6999,10 +6999,10 @@ function PB({
|
|
|
6999
6999
|
/* @__PURE__ */ A("button", { className: "ps-tryon-drawer-back", onClick: () => {
|
|
7000
7000
|
z(!1), n(null);
|
|
7001
7001
|
}, children: /* @__PURE__ */ A(kg, {}) }),
|
|
7002
|
-
/* @__PURE__ */ A("span", { className: "ps-tryon-drawer-title", children: o(
|
|
7003
|
-
f === "profiles" && !
|
|
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: () => z(!0), children: "+" })
|
|
7004
7004
|
] }),
|
|
7005
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-drawer-list", children: f === "profiles" &&
|
|
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
7006
|
/* @__PURE__ */ P("button", { className: "ps-tryon-drawer-create", onClick: () => z(!0), children: [
|
|
7007
7007
|
"+ ",
|
|
7008
7008
|
o("Create New Profile")
|
|
@@ -7067,7 +7067,7 @@ function nB({
|
|
|
7067
7067
|
};
|
|
7068
7068
|
}, [f]), !f || typeof document > "u") return null;
|
|
7069
7069
|
const D = (o) => {
|
|
7070
|
-
g((
|
|
7070
|
+
g((r) => r.map(
|
|
7071
7071
|
(z) => z.id === f.id ? {
|
|
7072
7072
|
...z,
|
|
7073
7073
|
...o,
|
|
@@ -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}` : "—",
|
|
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",
|
|
@@ -7163,7 +7163,7 @@ function gB({
|
|
|
7163
7163
|
}, children: [
|
|
7164
7164
|
/* @__PURE__ */ P("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7165
7165
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: e("Height") }),
|
|
7166
|
-
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: i(
|
|
7166
|
+
/* @__PURE__ */ A("span", { style: { fontWeight: 600 }, children: i(r) })
|
|
7167
7167
|
] }),
|
|
7168
7168
|
/* @__PURE__ */ P("li", { style: { display: "flex", justifyContent: "space-between", gap: "1vw" }, children: [
|
|
7169
7169
|
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)" }, children: e("Weight") }),
|
|
@@ -7224,7 +7224,7 @@ function eB({
|
|
|
7224
7224
|
formGender: D,
|
|
7225
7225
|
sizingUnit: i,
|
|
7226
7226
|
setSizingUnit: o,
|
|
7227
|
-
formKey:
|
|
7227
|
+
formKey: r,
|
|
7228
7228
|
setFormKey: z,
|
|
7229
7229
|
updateField: p,
|
|
7230
7230
|
setSizingMethod: T,
|
|
@@ -7270,7 +7270,7 @@ function eB({
|
|
|
7270
7270
|
}
|
|
7271
7271
|
)
|
|
7272
7272
|
] }) }, O.key);
|
|
7273
|
-
}) }, `est-${
|
|
7273
|
+
}) }, `est-${r}`),
|
|
7274
7274
|
/* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
7275
7275
|
/* @__PURE__ */ P("button", { type: "button", className: "ps-bp-back-btn", onClick: () => h("body-profile"), children: [
|
|
7276
7276
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
@@ -7405,8 +7405,8 @@ function iB({ t: f }) {
|
|
|
7405
7405
|
return JA(() => {
|
|
7406
7406
|
n.current = Date.now();
|
|
7407
7407
|
const D = setInterval(() => {
|
|
7408
|
-
const i = (Date.now() - n.current) / 1e3, o = Math.min(95, i / wP * 100),
|
|
7409
|
-
if (e.current && (e.current.style.width = `${
|
|
7408
|
+
const i = (Date.now() - n.current) / 1e3, o = Math.min(95, i / wP * 100), r = Math.round(o);
|
|
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
7410
|
const z = Math.max(0, wP - Math.floor(i));
|
|
7411
7411
|
B.current.textContent = i >= wP ? "•••" : `~${z}s`;
|
|
7412
7412
|
}
|
|
@@ -7444,7 +7444,7 @@ function rn({
|
|
|
7444
7444
|
onSwitchToManual: C,
|
|
7445
7445
|
t: D
|
|
7446
7446
|
}) {
|
|
7447
|
-
const i = f || n || "", o = !!f,
|
|
7447
|
+
const i = f || n || "", o = !!f, r = B ? [
|
|
7448
7448
|
{ title: D("GENERATING TRY-ON"), desc: D("Rendering the garment on your photo."), viewfinderText: D("GENERATING") },
|
|
7449
7449
|
{ title: D("REFINING DETAILS"), desc: D("Fine-tuning fit, drape and shadows."), viewfinderText: D("REFINING") },
|
|
7450
7450
|
{ title: D("ALMOST THERE"), desc: D("Final compositing in progress."), viewfinderText: D("COMPOSITING") },
|
|
@@ -7466,13 +7466,13 @@ function rn({
|
|
|
7466
7466
|
}, [F, h] = j(0);
|
|
7467
7467
|
JA(() => {
|
|
7468
7468
|
const k = setInterval(() => {
|
|
7469
|
-
h((u) => (u + 1) %
|
|
7469
|
+
h((u) => (u + 1) % r.length);
|
|
7470
7470
|
}, B ? 2200 : 1500);
|
|
7471
7471
|
return () => clearInterval(k);
|
|
7472
|
-
}, [
|
|
7472
|
+
}, [r.length, B]), JA(() => {
|
|
7473
7473
|
o && g && F === 0 && h(1);
|
|
7474
7474
|
}, [g]);
|
|
7475
|
-
const W =
|
|
7475
|
+
const W = r[F] ?? r[0];
|
|
7476
7476
|
return /* @__PURE__ */ P("div", { className: "ps-msc-root", children: [
|
|
7477
7477
|
/* @__PURE__ */ P("div", { className: "ps-msc-viewfinder", children: [
|
|
7478
7478
|
i && /* @__PURE__ */ A(
|
|
@@ -7531,7 +7531,7 @@ function HB({
|
|
|
7531
7531
|
onTryOn: D,
|
|
7532
7532
|
tryOnProcessing: i,
|
|
7533
7533
|
resultImageUrl: o,
|
|
7534
|
-
tryOnDone:
|
|
7534
|
+
tryOnDone: r,
|
|
7535
7535
|
onTryAgain: z,
|
|
7536
7536
|
onClose: p,
|
|
7537
7537
|
overlayNode: T,
|
|
@@ -7628,7 +7628,7 @@ function HB({
|
|
|
7628
7628
|
);
|
|
7629
7629
|
}) })
|
|
7630
7630
|
] }),
|
|
7631
|
-
/* @__PURE__ */ A("div", { className: "ps-msr-bottom", children:
|
|
7631
|
+
/* @__PURE__ */ A("div", { className: "ps-msr-bottom", children: r ? /* @__PURE__ */ P("div", { className: "ps-msr-bottom-row", children: [
|
|
7632
7632
|
/* @__PURE__ */ A(
|
|
7633
7633
|
"button",
|
|
7634
7634
|
{
|
|
@@ -7692,10 +7692,10 @@ 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(),
|
|
7695
|
+
const o = g.current || Date.now(), r = (Date.now() - o) / 1e3, z = Math.min(95, r / vP * 100), p = Math.round(z);
|
|
7696
7696
|
if (B.current && (B.current.style.width = `${p}%`), D.current && (D.current.textContent = `${p}%`), e.current && (e.current.style.strokeDashoffset = String(RP * (1 - z / 100))), C.current) {
|
|
7697
|
-
const T = Math.max(0, vP - Math.floor(
|
|
7698
|
-
C.current.textContent =
|
|
7697
|
+
const T = Math.max(0, vP - Math.floor(r));
|
|
7698
|
+
C.current.textContent = r >= vP ? "•••" : `~${T}s`;
|
|
7699
7699
|
}
|
|
7700
7700
|
}, 200);
|
|
7701
7701
|
return () => clearInterval(i);
|
|
@@ -7756,7 +7756,7 @@ function cB({
|
|
|
7756
7756
|
[f.leftMouth, f.rightMouth]
|
|
7757
7757
|
];
|
|
7758
7758
|
return /* @__PURE__ */ P("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${e} ${B}`, preserveAspectRatio: "xMidYMid meet", children: [
|
|
7759
|
-
D.map(([i, o],
|
|
7759
|
+
D.map(([i, o], r) => /* @__PURE__ */ A(
|
|
7760
7760
|
"line",
|
|
7761
7761
|
{
|
|
7762
7762
|
x1: i.x * e,
|
|
@@ -7767,12 +7767,12 @@ function cB({
|
|
|
7767
7767
|
strokeWidth: "3",
|
|
7768
7768
|
strokeLinecap: "round",
|
|
7769
7769
|
opacity: "0",
|
|
7770
|
-
style: { animation: `ps-pose-fade 0.4s ease ${
|
|
7770
|
+
style: { animation: `ps-pose-fade 0.4s ease ${r * 0.05}s forwards` }
|
|
7771
7771
|
},
|
|
7772
|
-
`fl-${
|
|
7772
|
+
`fl-${r}`
|
|
7773
7773
|
)),
|
|
7774
7774
|
[f.leftIrisCenter, f.rightIrisCenter].map((i, o) => {
|
|
7775
|
-
const
|
|
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
|
{
|
|
@@ -7788,7 +7788,7 @@ function cB({
|
|
|
7788
7788
|
`iris-${o}`
|
|
7789
7789
|
);
|
|
7790
7790
|
}),
|
|
7791
|
-
C.map(({ key: i, p: o },
|
|
7791
|
+
C.map(({ key: i, p: o }, r) => /* @__PURE__ */ P("g", { children: [
|
|
7792
7792
|
/* @__PURE__ */ A(
|
|
7793
7793
|
"circle",
|
|
7794
7794
|
{
|
|
@@ -7797,7 +7797,7 @@ function cB({
|
|
|
7797
7797
|
r: "11",
|
|
7798
7798
|
fill: "rgba(100,210,255,0.22)",
|
|
7799
7799
|
opacity: "0",
|
|
7800
|
-
style: { animation: `ps-pose-fade 0.3s ease ${
|
|
7800
|
+
style: { animation: `ps-pose-fade 0.3s ease ${r * 0.04}s forwards` }
|
|
7801
7801
|
}
|
|
7802
7802
|
),
|
|
7803
7803
|
/* @__PURE__ */ A(
|
|
@@ -7808,7 +7808,7 @@ function cB({
|
|
|
7808
7808
|
r: "6",
|
|
7809
7809
|
fill: "rgba(100,210,255,0.95)",
|
|
7810
7810
|
opacity: "0",
|
|
7811
|
-
style: { animation: `ps-pose-fade 0.3s ease ${
|
|
7811
|
+
style: { animation: `ps-pose-fade 0.3s ease ${r * 0.04}s forwards, ps-dot-pulse 1.5s ease-in-out ${0.5 + r * 0.04}s infinite` }
|
|
7812
7812
|
}
|
|
7813
7813
|
)
|
|
7814
7814
|
] }, i))
|
|
@@ -7845,7 +7845,7 @@ 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, [
|
|
7848
|
+
], i = g ? D : C, o = g ? !!e : n, [r, z] = j(0);
|
|
7849
7849
|
JA(() => {
|
|
7850
7850
|
z(0);
|
|
7851
7851
|
}, [g]), JA(() => {
|
|
@@ -7855,12 +7855,12 @@ function pB({
|
|
|
7855
7855
|
}, g ? 2200 : 900);
|
|
7856
7856
|
return () => clearInterval(F);
|
|
7857
7857
|
}, [o, i.length, g]);
|
|
7858
|
-
const p = i[
|
|
7858
|
+
const p = i[r] ?? i[0];
|
|
7859
7859
|
return /* @__PURE__ */ P("div", { className: "ps-msc-stage", style: { alignSelf: "center", marginTop: "auto", marginBottom: "auto" }, children: [
|
|
7860
7860
|
/* @__PURE__ */ P("div", { className: "ps-msc-stage-slot", children: [
|
|
7861
7861
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage-title", children: p.title }),
|
|
7862
7862
|
/* @__PURE__ */ A("div", { className: "ps-msc-stage-desc", children: p.desc })
|
|
7863
|
-
] }, `${g ? "t" : "s"}-${
|
|
7863
|
+
] }, `${g ? "t" : "s"}-${r}`),
|
|
7864
7864
|
g && /* @__PURE__ */ A(kn, { t: B, isActive: !!g })
|
|
7865
7865
|
] });
|
|
7866
7866
|
}
|
|
@@ -7868,14 +7868,14 @@ function Qn({ landmarks: f, imgWidth: n, imgHeight: g }) {
|
|
|
7868
7868
|
const e = n, B = g;
|
|
7869
7869
|
return /* @__PURE__ */ P("svg", { className: "ps-tryon-pose-overlay", viewBox: `0 0 ${e} ${B}`, preserveAspectRatio: "xMidYMid meet", children: [
|
|
7870
7870
|
zB.map(([C, D], i) => {
|
|
7871
|
-
const o = f[C],
|
|
7872
|
-
return !o || !
|
|
7871
|
+
const o = f[C], r = f[D];
|
|
7872
|
+
return !o || !r || typeof o != "object" || typeof r != "object" || typeof o.x != "number" || typeof o.y != "number" || typeof r.x != "number" || typeof r.y != "number" ? null : /* @__PURE__ */ A(
|
|
7873
7873
|
"line",
|
|
7874
7874
|
{
|
|
7875
7875
|
x1: o.x * e,
|
|
7876
7876
|
y1: o.y * B,
|
|
7877
|
-
x2:
|
|
7878
|
-
y2:
|
|
7877
|
+
x2: r.x * e,
|
|
7878
|
+
y2: r.y * B,
|
|
7879
7879
|
stroke: "rgba(100,210,255,0.5)",
|
|
7880
7880
|
strokeWidth: "4",
|
|
7881
7881
|
strokeLinecap: "round",
|
|
@@ -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,
|
|
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
7923
|
const t = F.x1 * i, k = F.x2 * i, u = F.y * o, v = k - t, I = v * 0.06, O = (t + k) / 2, N = n.find((mA) => {
|
|
7924
7924
|
const dA = mA.area.toLowerCase().trim();
|
|
7925
7925
|
return !!(dA === T || T === "chest" && (dA.includes("bust") || dA.includes("chest")) || T === "waist" && dA.includes("waist") || T === "hips" && (dA.includes("hip") || dA === "hips"));
|
|
7926
|
-
}), K = N ? C(N.fit) : "#2154EF", E = W * 0.35, BA = `M ${t} ${u} Q ${O} ${u + I} ${k} ${u}`, c = v * 1.05, hA = N ? N.fit === "good" ? "
|
|
7926
|
+
}), K = N ? C(N.fit) : "#2154EF", E = W * 0.35, BA = `M ${t} ${u} Q ${O} ${u + I} ${k} ${u}`, c = v * 1.05, hA = N ? N.fit === "good" ? "✓ Fit" : N.isLength ? N.fit.includes("short") || N.fit.includes("tight") ? "Short" : "Long" : N.fit.includes("tight") ? "Tight" : "Loose" : h, l = Math.round(14 * r), y = hA.length * l * 0.62, sA = i - k - 12 * r < y, V = sA ? t - 10 * r : k + 10 * r, s = sA ? "end" : "start", PA = sA ? t : k, RA = sA ? t - 6 * r : k + 6 * r;
|
|
7927
7927
|
return /* @__PURE__ */ P("g", { children: [
|
|
7928
7928
|
/* @__PURE__ */ A(
|
|
7929
7929
|
"path",
|
|
@@ -7969,14 +7969,14 @@ function $f({ lines: f, fitRows: n, show: g, imgWidth: e, imgHeight: B }) {
|
|
|
7969
7969
|
x2: RA,
|
|
7970
7970
|
y2: u,
|
|
7971
7971
|
stroke: K,
|
|
7972
|
-
strokeWidth: 2 *
|
|
7972
|
+
strokeWidth: 2 * r
|
|
7973
7973
|
}
|
|
7974
7974
|
),
|
|
7975
7975
|
/* @__PURE__ */ A(
|
|
7976
7976
|
"text",
|
|
7977
7977
|
{
|
|
7978
7978
|
x: V,
|
|
7979
|
-
y: u + 1 *
|
|
7979
|
+
y: u + 1 * r,
|
|
7980
7980
|
fill: K,
|
|
7981
7981
|
fontSize: l,
|
|
7982
7982
|
fontWeight: "700",
|
|
@@ -8040,7 +8040,7 @@ function DP({
|
|
|
8040
8040
|
lengthEntry: D,
|
|
8041
8041
|
onBack: i,
|
|
8042
8042
|
t: o,
|
|
8043
|
-
productImage:
|
|
8043
|
+
productImage: r,
|
|
8044
8044
|
productTitle: z,
|
|
8045
8045
|
isMobile: p,
|
|
8046
8046
|
isTryOnImage: T,
|
|
@@ -8058,26 +8058,26 @@ function DP({
|
|
|
8058
8058
|
}) {
|
|
8059
8059
|
const E = g?.recommendedSize || "", [BA, c] = j(null), hA = B.toLowerCase(), l = hA.includes("mm") ? "mm" : hA.includes("cm") ? "cm" : "in", y = C || l, XA = (a) => hn(a, y, l), sA = (a) => UB(a, y, l), V = I ? Object.keys(I) : [], [s, PA] = j(null), RA = D?.secResult?.recommendedSize || "", [mA, dA] = j(null), ZA = wf(() => {
|
|
8060
8060
|
if (!D) return [];
|
|
8061
|
-
const a = D.section, X = a.headers.findIndex((zA) => /size|taglia|größe|taille/i.test(zA.trim())), nA = X >= 0 ? X : 0,
|
|
8062
|
-
return [...new Set(
|
|
8061
|
+
const a = D.section, X = a.headers.findIndex((zA) => /size|taglia|größe|taille/i.test(zA.trim())), nA = X >= 0 ? X : 0, H = a.headers[nA] || "Size", oA = a.rows.map((zA) => Uf(zA, nA, H)).filter(Boolean);
|
|
8062
|
+
return [...new Set(oA)];
|
|
8063
8063
|
}, [D]), Hf = wf(() => {
|
|
8064
8064
|
if (!D) return {};
|
|
8065
|
-
const a = D.section, X = a.headers.findIndex((
|
|
8065
|
+
const a = D.section, X = a.headers.findIndex((oA) => /size|taglia|größe|taille/i.test(oA.trim()));
|
|
8066
8066
|
if (X < 0) return {};
|
|
8067
|
-
let nA = a.headers.findIndex((
|
|
8068
|
-
if (nA < 0 && (nA = a.headers.findIndex((
|
|
8069
|
-
const
|
|
8070
|
-
for (const
|
|
8071
|
-
const zA = Uf(
|
|
8072
|
-
zA && YA && (
|
|
8067
|
+
let nA = a.headers.findIndex((oA) => /height|altezza|hauteur|größe|tall/i.test(oA.trim()) && !/size/i.test(oA));
|
|
8068
|
+
if (nA < 0 && (nA = a.headers.findIndex((oA, zA) => zA !== X)), nA < 0) return {};
|
|
8069
|
+
const H = {};
|
|
8070
|
+
for (const oA of a.rows) {
|
|
8071
|
+
const zA = Uf(oA, X, a.headers[X] || "Size"), YA = Uf(oA, nA, a.headers[nA] || "");
|
|
8072
|
+
zA && YA && (H[String(zA).trim()] = String(YA).trim());
|
|
8073
8073
|
}
|
|
8074
|
-
return
|
|
8074
|
+
return H;
|
|
8075
8075
|
}, [D]), m = wf(() => {
|
|
8076
8076
|
const a = n.headers.findIndex((X) => /size|taglia|größe|taille/i.test(X.trim()));
|
|
8077
8077
|
if (a >= 0) return a;
|
|
8078
8078
|
for (let X = 0; X < n.headers.length; X++) {
|
|
8079
8079
|
const nA = 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, nA)))) return X;
|
|
8081
8081
|
}
|
|
8082
8082
|
return 0;
|
|
8083
8083
|
}, [n]), EA = n.headers[m] || "Size", TA = wf(() => {
|
|
@@ -8085,7 +8085,7 @@ function DP({
|
|
|
8085
8085
|
return [...new Set(a)];
|
|
8086
8086
|
}, [n, m, EA]), bA = BA || E, VA = bA === E, kA = wf(() => {
|
|
8087
8087
|
if (VA) return null;
|
|
8088
|
-
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i, nA = a.some((
|
|
8088
|
+
const a = g?.matchDetails ?? [], X = /tight|loose|large|small|very/i, nA = a.some((H) => X.test(H.fit || ""));
|
|
8089
8089
|
return o(nA ? "Not Recommended" : "Your Selection");
|
|
8090
8090
|
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA = wf(() => {
|
|
8091
8091
|
const a = [];
|
|
@@ -8099,25 +8099,25 @@ function DP({
|
|
|
8099
8099
|
a.push("in");
|
|
8100
8100
|
continue;
|
|
8101
8101
|
}
|
|
8102
|
-
let
|
|
8103
|
-
for (const
|
|
8104
|
-
const zA = String(Uf(
|
|
8102
|
+
let H = null;
|
|
8103
|
+
for (const oA of n.rows) {
|
|
8104
|
+
const zA = String(Uf(oA, X, n.headers[X]) || "").trim();
|
|
8105
8105
|
if (zA) {
|
|
8106
8106
|
if (/cm\b|centimeter/i.test(zA)) {
|
|
8107
|
-
|
|
8107
|
+
H = "cm";
|
|
8108
8108
|
break;
|
|
8109
8109
|
}
|
|
8110
8110
|
if (/in\b|inch|"$/i.test(zA)) {
|
|
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 = UA((a, X) => {
|
|
8120
|
-
const nA = a.toLowerCase().trim(),
|
|
8120
|
+
const nA = a.toLowerCase().trim(), H = B === "cm" || B === "", oA = H ? "cm" : "in", zA = [];
|
|
8121
8121
|
for (let AA = 0; AA < n.headers.length; AA++) {
|
|
8122
8122
|
const LA = (n.headers[AA] || "").toLowerCase().trim();
|
|
8123
8123
|
if (LA === nA) {
|
|
@@ -8128,7 +8128,7 @@ function DP({
|
|
|
8128
8128
|
(Pf === nA || LA.includes(nA) || nA.includes(Pf)) && zA.push(AA);
|
|
8129
8129
|
}
|
|
8130
8130
|
if (zA.length === 0) return null;
|
|
8131
|
-
let YA = zA.find((AA) => SA[AA] ===
|
|
8131
|
+
let YA = zA.find((AA) => SA[AA] === oA);
|
|
8132
8132
|
YA == null && (YA = zA[0]);
|
|
8133
8133
|
const of = n.headers[YA], J = X.trim().toLowerCase();
|
|
8134
8134
|
let gA = n.rows.find((AA) => Uf(AA, m, EA) === X);
|
|
@@ -8139,11 +8139,11 @@ function DP({
|
|
|
8139
8139
|
const Bf = Uf(gA, YA, of);
|
|
8140
8140
|
if (!Bf) return null;
|
|
8141
8141
|
const FA = QP(Bf), OA = SA[YA];
|
|
8142
|
-
if (OA === "in" &&
|
|
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
|
}
|
|
@@ -8159,7 +8159,7 @@ function DP({
|
|
|
8159
8159
|
chartLabel: "",
|
|
8160
8160
|
isLength: !1
|
|
8161
8161
|
}));
|
|
8162
|
-
const a = g?.matchDetails || [], X = D?.secResult?.matchDetails || [], nA = [...a, ...X],
|
|
8162
|
+
const a = g?.matchDetails || [], X = D?.secResult?.matchDetails || [], nA = [...a, ...X], H = g?.length || "", oA = (g?.availableLengths?.length || 0) > 0, zA = RA || H, YA = !!(D || oA);
|
|
8163
8163
|
if (YA && !X.length) {
|
|
8164
8164
|
const J = e.height || 0;
|
|
8165
8165
|
nA.push({
|
|
@@ -8221,9 +8221,9 @@ function DP({
|
|
|
8221
8221
|
});
|
|
8222
8222
|
}, [g, D, e, bA, E, ff, mA, RA, N]), nf = rA.filter(
|
|
8223
8223
|
(a) => a.fit === "good" || a.fit === "a-bit-tight" || a.fit === "a-bit-loose"
|
|
8224
|
-
).length, xA = rA.length > 0 ? Math.round(nf / rA.length * 100) : 0, Ef = !N,
|
|
8224
|
+
).length, xA = rA.length > 0 ? Math.round(nf / rA.length * 100) : 0, Ef = !N, eA = g, $ = eA?.size || E, _A = (g?.matchDetails || []).find(
|
|
8225
8225
|
(a) => /inseam|length/i.test(a.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(a.measurement)
|
|
8226
|
-
), Of = _A ? (_A.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", cf =
|
|
8226
|
+
), Of = _A ? (_A.chartRange || "").replace(/\s*(cm|in|inches)\s*/i, "").trim() : "", cf = eA?.length || RA || Of, Mf = eA?.availableSizes || [], gf = eA?.availableLengths || [], qA = mA || cf, GA = Mf.length > 0 ? Mf : TA, _ = (() => {
|
|
8227
8227
|
if (GA.length <= 3) return GA;
|
|
8228
8228
|
const a = GA.indexOf(E);
|
|
8229
8229
|
if (a < 0) return GA.slice(0, 3);
|
|
@@ -8237,10 +8237,10 @@ function DP({
|
|
|
8237
8237
|
return uA.slice(X, X + 3);
|
|
8238
8238
|
})();
|
|
8239
8239
|
if (p) {
|
|
8240
|
-
const a = f.replace(/\s*[—–-]\s*.*/g, ""), X = (
|
|
8241
|
-
const
|
|
8242
|
-
return
|
|
8243
|
-
}, nA = (
|
|
8240
|
+
const a = f.replace(/\s*[—–-]\s*.*/g, ""), X = (H) => {
|
|
8241
|
+
const oA = H.toLowerCase().replace(/\s*\(.*?\)\s*/g, "").trim();
|
|
8242
|
+
return oA.includes("chest") || oA.includes("bust") ? o("Full circumference at the widest point.") : oA.includes("waist") ? o("Circumference at the natural waistline.") : oA.includes("hip") ? o("Circumference at the fullest point.") : oA.includes("shoulder") ? o("Shoulder edge to shoulder edge.") : oA.includes("sleeve") || oA.includes("arm") ? o("Shoulder seam to cuff edge.") : oA.includes("neck") || oA.includes("collar") ? o("Around the base of the neck.") : oA.includes("inseam") || oA.includes("inside leg") ? o("Inner leg seam length.") : oA.includes("thigh") ? o("Circumference around the upper leg.") : oA.includes("length") || oA.includes("height") ? o("Top to bottom length.") : "";
|
|
8243
|
+
}, nA = (H, oA) => oA && H === "good" ? o("EDITORIAL LENGTH") : H === "good" ? o("PERFECT TENSION") : H === "a-bit-tight" ? o("SLIGHTLY TIGHT") : H === "a-bit-loose" ? o("SLIGHT EASE") : H.includes("tight") ? o("TIGHT") : H.includes("loose") ? o("LOOSE") : o("FIT");
|
|
8244
8244
|
return /* @__PURE__ */ A("div", { className: "ps-msd-root", children: /* @__PURE__ */ P("div", { className: "ps-msd-scroll", children: [
|
|
8245
8245
|
/* @__PURE__ */ P("div", { className: "ps-msd-topbar", children: [
|
|
8246
8246
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-msd-back", onClick: i, "aria-label": o("Back"), children: /* @__PURE__ */ P("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "20", height: "20", children: [
|
|
@@ -8254,11 +8254,11 @@ function DP({
|
|
|
8254
8254
|
] }),
|
|
8255
8255
|
/* @__PURE__ */ A("span", { className: "ps-msd-topbar-spacer" })
|
|
8256
8256
|
] }),
|
|
8257
|
-
|
|
8257
|
+
r && /* @__PURE__ */ P("div", { className: `ps-msd-image${T ? " ps-tryon" : ""}`, children: [
|
|
8258
8258
|
/* @__PURE__ */ A(
|
|
8259
8259
|
"img",
|
|
8260
8260
|
{
|
|
8261
|
-
src:
|
|
8261
|
+
src: r,
|
|
8262
8262
|
alt: z || "",
|
|
8263
8263
|
className: "ps-msd-image-img",
|
|
8264
8264
|
onLoad: t
|
|
@@ -8308,7 +8308,7 @@ function DP({
|
|
|
8308
8308
|
"select",
|
|
8309
8309
|
{
|
|
8310
8310
|
value: s || "",
|
|
8311
|
-
onChange: (
|
|
8311
|
+
onChange: (H) => PA(H.target.value || null),
|
|
8312
8312
|
style: {
|
|
8313
8313
|
fontSize: "11px",
|
|
8314
8314
|
fontWeight: 600,
|
|
@@ -8325,7 +8325,7 @@ function DP({
|
|
|
8325
8325
|
"aria-label": o("Display size in country"),
|
|
8326
8326
|
children: [
|
|
8327
8327
|
/* @__PURE__ */ A("option", { value: "", children: o("Standard") }),
|
|
8328
|
-
V.map((
|
|
8328
|
+
V.map((H) => /* @__PURE__ */ A("option", { value: H, children: H }, H))
|
|
8329
8329
|
]
|
|
8330
8330
|
}
|
|
8331
8331
|
),
|
|
@@ -8364,19 +8364,19 @@ function DP({
|
|
|
8364
8364
|
K !== !1 && rA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-blueprint", children: [
|
|
8365
8365
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: o("MEASUREMENT BLUEPRINT") }),
|
|
8366
8366
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
8367
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: rA.map((
|
|
8368
|
-
const zA =
|
|
8367
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: rA.map((H, oA) => {
|
|
8368
|
+
const zA = H.isLength && H.fit.includes("short") || H.fit.includes("tight"), YA = H.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose", of = X(H.area), J = String(oA + 1).padStart(2, "0");
|
|
8369
8369
|
return /* @__PURE__ */ P("div", { className: "ps-msd-row", children: [
|
|
8370
8370
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-num", children: [
|
|
8371
8371
|
J,
|
|
8372
8372
|
" ",
|
|
8373
|
-
|
|
8373
|
+
H.area.toUpperCase()
|
|
8374
8374
|
] }),
|
|
8375
8375
|
of && /* @__PURE__ */ A("p", { className: "ps-msd-row-desc", children: of }),
|
|
8376
8376
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cells", children: [
|
|
8377
8377
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell", children: [
|
|
8378
8378
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: o("USER") }),
|
|
8379
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: N ?
|
|
8379
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: N ? H.rawUserValue || "—" : isNaN(H.userNum) || H.userNum === 0 ? "—" : `${XA(H.userNum)} ${B}` })
|
|
8380
8380
|
] }),
|
|
8381
8381
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell ps-right", children: [
|
|
8382
8382
|
/* @__PURE__ */ P("span", { className: "ps-msd-cell-label", children: [
|
|
@@ -8384,46 +8384,46 @@ function DP({
|
|
|
8384
8384
|
" ",
|
|
8385
8385
|
bA
|
|
8386
8386
|
] }),
|
|
8387
|
-
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: N ?
|
|
8387
|
+
/* @__PURE__ */ A("span", { className: "ps-msd-cell-value", children: N ? H.rawChartRange || "—" : sA(H.chartLabel) })
|
|
8388
8388
|
] })
|
|
8389
8389
|
] }),
|
|
8390
8390
|
/* @__PURE__ */ P("div", { className: `ps-msd-row-badge ${YA}`, children: [
|
|
8391
|
-
|
|
8391
|
+
H.isLength ? Hn(H.fit, o).toUpperCase() : nA(H.fit, H.isLength),
|
|
8392
8392
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 16 16", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", width: "11", height: "11", children: /* @__PURE__ */ A("path", { d: "M3 8l3.5 3.5L13 5" }) })
|
|
8393
8393
|
] })
|
|
8394
|
-
] },
|
|
8394
|
+
] }, oA);
|
|
8395
8395
|
}) })
|
|
8396
8396
|
] }),
|
|
8397
8397
|
K !== !1 && _.length > 1 && /* @__PURE__ */ P("div", { className: "ps-msd-sizes", children: [
|
|
8398
8398
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: o("TRY ANOTHER SIZE") }),
|
|
8399
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: _.map((
|
|
8399
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: _.map((H) => /* @__PURE__ */ A(
|
|
8400
8400
|
"button",
|
|
8401
8401
|
{
|
|
8402
8402
|
type: "button",
|
|
8403
|
-
className: `ps-msd-size-pill${
|
|
8404
|
-
onClick: () => c(
|
|
8405
|
-
children:
|
|
8403
|
+
className: `ps-msd-size-pill${H === bA ? " ps-active" : ""}`,
|
|
8404
|
+
onClick: () => c(H === E ? null : H),
|
|
8405
|
+
children: H
|
|
8406
8406
|
},
|
|
8407
|
-
|
|
8407
|
+
H
|
|
8408
8408
|
)) })
|
|
8409
8409
|
] }),
|
|
8410
8410
|
K !== !1 && WA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-sizes", children: [
|
|
8411
8411
|
/* @__PURE__ */ A("span", { className: "ps-msd-sizes-label", children: o("LENGTH ADJUSTMENT") }),
|
|
8412
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: WA.map((
|
|
8413
|
-
const
|
|
8412
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-sizes-pills", children: WA.map((H) => {
|
|
8413
|
+
const oA = String(qA ?? "").trim() === String(H ?? "").trim(), zA = Hf[String(H).trim()];
|
|
8414
8414
|
return /* @__PURE__ */ P(
|
|
8415
8415
|
"button",
|
|
8416
8416
|
{
|
|
8417
8417
|
type: "button",
|
|
8418
|
-
className: `ps-msd-size-pill${
|
|
8419
|
-
onClick: () => dA(
|
|
8418
|
+
className: `ps-msd-size-pill${oA ? " ps-active" : ""}`,
|
|
8419
|
+
onClick: () => dA(H === cf ? null : H),
|
|
8420
8420
|
style: { display: "flex", flexDirection: "column", alignItems: "center", lineHeight: 1.15, gap: "0.15vw" },
|
|
8421
8421
|
children: [
|
|
8422
|
-
/* @__PURE__ */ A("span", { children:
|
|
8422
|
+
/* @__PURE__ */ A("span", { children: H }),
|
|
8423
8423
|
zA && /* @__PURE__ */ A("span", { style: { fontSize: "0.55vw", fontWeight: 500, opacity: 0.75 }, children: zA })
|
|
8424
8424
|
]
|
|
8425
8425
|
},
|
|
8426
|
-
|
|
8426
|
+
H
|
|
8427
8427
|
);
|
|
8428
8428
|
}) })
|
|
8429
8429
|
] }),
|
|
@@ -8594,12 +8594,12 @@ function DP({
|
|
|
8594
8594
|
/* @__PURE__ */ A("th", { style: { textAlign: "right", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Fit Result") })
|
|
8595
8595
|
] }) }),
|
|
8596
8596
|
/* @__PURE__ */ A("tbody", { children: rA.map((a, X) => {
|
|
8597
|
-
const nA = a.fit === "good" ? "#2154EF" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "#dc2626" : "#d97706" : a.fit.includes("tight") ? "#dc2626" : "#d97706",
|
|
8597
|
+
const nA = a.fit === "good" ? "#2154EF" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "#dc2626" : "#d97706" : a.fit.includes("tight") ? "#dc2626" : "#d97706", H = a.fit === "good" ? "rgba(33,84,239,0.08)" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
8598
8598
|
return /* @__PURE__ */ P("tr", { style: { borderBottom: X < rA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
8599
8599
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: a.area }),
|
|
8600
8600
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawUserValue || "—" : isNaN(a.userNum) || a.userNum === 0 ? "—" : `${XA(a.userNum)} ${B}` }),
|
|
8601
8601
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawChartRange || "—" : sA(a.chartLabel) }),
|
|
8602
|
-
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: nA, background:
|
|
8602
|
+
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", textAlign: "right" }, children: /* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", fontWeight: 600, color: nA, background: H, borderRadius: "1vw", padding: "0.15vw 0.5vw", whiteSpace: "nowrap" }, children: a.isLength ? Hn(a.fit, o) : jB(a.fit, o) }) })
|
|
8603
8603
|
] }, X);
|
|
8604
8604
|
}) })
|
|
8605
8605
|
] }) }),
|
|
@@ -8750,7 +8750,7 @@ function EB({
|
|
|
8750
8750
|
sizingUnit: D,
|
|
8751
8751
|
setView: i,
|
|
8752
8752
|
handleDownload: o,
|
|
8753
|
-
onRetryWithFit:
|
|
8753
|
+
onRetryWithFit: r,
|
|
8754
8754
|
retryLoading: z,
|
|
8755
8755
|
selectedFile: p,
|
|
8756
8756
|
previewUrl: T,
|
|
@@ -8841,7 +8841,7 @@ function EB({
|
|
|
8841
8841
|
return { range: yA, ...KA };
|
|
8842
8842
|
}, [g, PA, RA, y, s, V, mA]), ZA = n?.recommendedSize || "";
|
|
8843
8843
|
wf(() => n?.internationalSizes || {}, [n]);
|
|
8844
|
-
const [Hf, m] = j("fit"), [EA, TA] = j(null), [bA, VA] = j(!1), [kA, vA] = j(!1), [SA, ff] = j(!1), [rA, nf] = j(null), [xA, Ef] = j(!1), [
|
|
8844
|
+
const [Hf, m] = j("fit"), [EA, TA] = j(null), [bA, VA] = j(!1), [kA, vA] = j(!1), [SA, ff] = j(!1), [rA, nf] = j(null), [xA, Ef] = j(!1), [eA, $] = j({ w: 800, h: 1200 }), _A = UA((U) => {
|
|
8845
8845
|
const R = U.currentTarget;
|
|
8846
8846
|
R.naturalWidth && R.naturalHeight && $({ w: R.naturalWidth, h: R.naturalHeight });
|
|
8847
8847
|
}, []);
|
|
@@ -8858,13 +8858,13 @@ function EB({
|
|
|
8858
8858
|
}, [e, t]);
|
|
8859
8859
|
const [Of, cf] = j(!1), [Mf, gf] = j(!1);
|
|
8860
8860
|
iA(null);
|
|
8861
|
-
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = iA(null), [nA,
|
|
8861
|
+
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = iA(null), [nA, H] = j(null), [oA, zA] = j(!1);
|
|
8862
8862
|
JA(() => {
|
|
8863
8863
|
if (_) {
|
|
8864
8864
|
const U = URL.createObjectURL(_);
|
|
8865
|
-
return
|
|
8865
|
+
return H(U), () => URL.revokeObjectURL(U);
|
|
8866
8866
|
}
|
|
8867
|
-
|
|
8867
|
+
H(null);
|
|
8868
8868
|
}, [_]);
|
|
8869
8869
|
const YA = EA || ZA;
|
|
8870
8870
|
wf(() => {
|
|
@@ -8973,7 +8973,7 @@ function EB({
|
|
|
8973
8973
|
onLoad: _A
|
|
8974
8974
|
}
|
|
8975
8975
|
),
|
|
8976
|
-
v === "face" || v === "head" ? u && /* @__PURE__ */ A(cB, { landmarks: u, imgWidth:
|
|
8976
|
+
v === "face" || v === "head" ? u && /* @__PURE__ */ A(cB, { landmarks: u, imgWidth: eA.w, imgHeight: eA.h }) : k && /* @__PURE__ */ A(Qn, { landmarks: k, imgWidth: eA.w, imgHeight: eA.h })
|
|
8977
8977
|
] }),
|
|
8978
8978
|
(() => {
|
|
8979
8979
|
const U = v === "face" || v === "head";
|
|
@@ -9030,8 +9030,8 @@ function EB({
|
|
|
9030
9030
|
}).map((S) => ({ area: S.measurement, userNum: parseFloat(S.userValue) || 0, chartLabel: S.chartRange || "", fit: S.fit }));
|
|
9031
9031
|
})(),
|
|
9032
9032
|
show: kA,
|
|
9033
|
-
imgWidth:
|
|
9034
|
-
imgHeight:
|
|
9033
|
+
imgWidth: eA.w,
|
|
9034
|
+
imgHeight: eA.h
|
|
9035
9035
|
}
|
|
9036
9036
|
) : null,
|
|
9037
9037
|
t: c
|
|
@@ -9096,8 +9096,8 @@ function EB({
|
|
|
9096
9096
|
}).map((G) => ({ area: G.measurement, userNum: parseFloat(G.userValue) || 0, chartLabel: G.chartRange || "", fit: G.fit }));
|
|
9097
9097
|
})(),
|
|
9098
9098
|
show: kA,
|
|
9099
|
-
imgWidth:
|
|
9100
|
-
imgHeight:
|
|
9099
|
+
imgWidth: eA.w,
|
|
9100
|
+
imgHeight: eA.h
|
|
9101
9101
|
}
|
|
9102
9102
|
) : null,
|
|
9103
9103
|
t: c
|
|
@@ -9108,7 +9108,7 @@ function EB({
|
|
|
9108
9108
|
/* @__PURE__ */ P("div", { className: "ps-tryon-v2", children: [
|
|
9109
9109
|
/* @__PURE__ */ P("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
|
|
9110
9110
|
/* @__PURE__ */ A("img", { src: t && T ? T : e || B, alt: C, className: "ps-tryon-v2-bg-img", onLoad: _A }),
|
|
9111
|
-
t && k && /* @__PURE__ */ A(Qn, { landmarks: k, imgWidth:
|
|
9111
|
+
t && k && /* @__PURE__ */ A(Qn, { landmarks: k, imgWidth: eA.w, imgHeight: eA.h }),
|
|
9112
9112
|
t && /* @__PURE__ */ P("div", { className: "ps-tryon-v2-processing-label", children: [
|
|
9113
9113
|
/* @__PURE__ */ A("span", { children: c("Generating try-on...") }),
|
|
9114
9114
|
/* @__PURE__ */ A(kn, { t: c, isActive: !0 })
|
|
@@ -9123,7 +9123,7 @@ function EB({
|
|
|
9123
9123
|
const S = G.measurement.toLowerCase();
|
|
9124
9124
|
return R.has(S) ? !1 : (R.add(S), !0);
|
|
9125
9125
|
}).map((G) => ({ area: G.measurement, userNum: parseFloat(G.userValue) || 0, chartLabel: G.chartRange || "", fit: G.fit }));
|
|
9126
|
-
})(), show: kA, imgWidth:
|
|
9126
|
+
})(), show: kA, imgWidth: eA.w, imgHeight: eA.h }),
|
|
9127
9127
|
e && !t && /* @__PURE__ */ P("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
9128
9128
|
!q && /* @__PURE__ */ P("button", { className: "ps-tryon-sr-glass-btn", onClick: () => vA(!kA), children: [
|
|
9129
9129
|
/* @__PURE__ */ P("svg", { width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", style: { marginRight: "0.3vw" }, children: [
|
|
@@ -9247,8 +9247,8 @@ function EB({
|
|
|
9247
9247
|
lines: rA,
|
|
9248
9248
|
fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })),
|
|
9249
9249
|
show: kA,
|
|
9250
|
-
imgWidth:
|
|
9251
|
-
imgHeight:
|
|
9250
|
+
imgWidth: eA.w,
|
|
9251
|
+
imgHeight: eA.h
|
|
9252
9252
|
}
|
|
9253
9253
|
) : null,
|
|
9254
9254
|
t: c
|
|
@@ -9256,7 +9256,7 @@ function EB({
|
|
|
9256
9256
|
) : /* @__PURE__ */ P("div", { className: "ps-tryon-v2", children: [
|
|
9257
9257
|
/* @__PURE__ */ P("div", { className: "ps-tryon-v2-bg", style: { position: "relative" }, children: [
|
|
9258
9258
|
/* @__PURE__ */ A("img", { src: e || B, alt: C, className: "ps-tryon-v2-bg-img", onLoad: _A }),
|
|
9259
|
-
e && xA && rA && /* @__PURE__ */ A($f, { lines: rA, fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })), show: kA, imgWidth:
|
|
9259
|
+
e && xA && rA && /* @__PURE__ */ A($f, { lines: rA, fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })), show: kA, imgWidth: eA.w, imgHeight: eA.h }),
|
|
9260
9260
|
e && !t && /* @__PURE__ */ P("div", { style: { position: "absolute", bottom: "0.5vw", left: "0.5vw", zIndex: 3, display: "flex", flexDirection: "column", gap: "0.3vw" }, children: [
|
|
9261
9261
|
!q && /* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: () => vA(!kA), children: c(kA ? "Hide Fit" : "Show Fit") }),
|
|
9262
9262
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-glass-btn", onClick: o, children: c("Download") })
|
|
@@ -9584,16 +9584,16 @@ function aB({
|
|
|
9584
9584
|
handleRemovePreview: D,
|
|
9585
9585
|
handleTryOnSubmit: i,
|
|
9586
9586
|
cn: o,
|
|
9587
|
-
t:
|
|
9587
|
+
t: r
|
|
9588
9588
|
}) {
|
|
9589
9589
|
return /* @__PURE__ */ A(tA, { children: f && n ? /* @__PURE__ */ P(tA, { children: [
|
|
9590
9590
|
/* @__PURE__ */ P("div", { className: Qf("ps-tryon-preview", o.preview), children: [
|
|
9591
9591
|
/* @__PURE__ */ A("div", { className: "ps-tryon-preview-blur", style: { backgroundImage: `url(${n})` } }),
|
|
9592
|
-
/* @__PURE__ */ A("img", { src: n, alt:
|
|
9592
|
+
/* @__PURE__ */ A("img", { src: n, alt: r("Your photo"), className: o.previewImage }),
|
|
9593
9593
|
/* @__PURE__ */ A("button", { onClick: D, className: Qf("ps-tryon-preview-remove", o.removeButton), children: "×" })
|
|
9594
9594
|
] }),
|
|
9595
9595
|
/* @__PURE__ */ P("button", { onClick: i, className: Qf("ps-tryon-submit", o.submitButton), children: [
|
|
9596
|
-
|
|
9596
|
+
r("Try It On"),
|
|
9597
9597
|
" ",
|
|
9598
9598
|
/* @__PURE__ */ A(_f, {})
|
|
9599
9599
|
] })
|
|
@@ -9626,8 +9626,8 @@ function aB({
|
|
|
9626
9626
|
}
|
|
9627
9627
|
),
|
|
9628
9628
|
/* @__PURE__ */ A(zP, {}),
|
|
9629
|
-
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-upload-text", o.uploadText), children:
|
|
9630
|
-
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-upload-hint", o.uploadHint), children:
|
|
9629
|
+
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-upload-text", o.uploadText), children: r("Upload a full body photo") }),
|
|
9630
|
+
/* @__PURE__ */ A("p", { className: Qf("ps-tryon-upload-hint", o.uploadHint), children: r("JPEG, PNG or WebP (max 10MB)") })
|
|
9631
9631
|
]
|
|
9632
9632
|
}
|
|
9633
9633
|
) });
|
|
@@ -9644,7 +9644,7 @@ function dB({
|
|
|
9644
9644
|
cn: i,
|
|
9645
9645
|
t: o
|
|
9646
9646
|
}) {
|
|
9647
|
-
const
|
|
9647
|
+
const r = UA((h) => {
|
|
9648
9648
|
g.current = h, h && (h.style.width = `${Math.round(n.current)}%`);
|
|
9649
9649
|
}, []), z = UA((h) => {
|
|
9650
9650
|
e.current = h, h && (h.textContent = `${Math.round(n.current)}%`);
|
|
@@ -9694,7 +9694,7 @@ function dB({
|
|
|
9694
9694
|
] }),
|
|
9695
9695
|
/* @__PURE__ */ A("span", { ref: T, className: "ps-tryon-progress-eta", children: "~22s" })
|
|
9696
9696
|
] }),
|
|
9697
|
-
/* @__PURE__ */ A("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ A("div", { ref:
|
|
9697
|
+
/* @__PURE__ */ A("div", { className: "ps-tryon-progress-bar-wrap", children: /* @__PURE__ */ A("div", { ref: r, className: "ps-tryon-progress-bar-fill" }) }),
|
|
9698
9698
|
/* @__PURE__ */ A("span", { ref: z, className: "ps-tryon-progress-pct", children: "0%" })
|
|
9699
9699
|
] }),
|
|
9700
9700
|
/* @__PURE__ */ A("div", { ref: p, className: Qf("ps-tryon-processing-text", i.processingText), children: o("Preparing your image...") }),
|
|
@@ -9783,7 +9783,7 @@ function CP({
|
|
|
9783
9783
|
] }, f);
|
|
9784
9784
|
}
|
|
9785
9785
|
function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B }) {
|
|
9786
|
-
const [C, D] = j(null), [i, o] = j("identity"), [
|
|
9786
|
+
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);
|
|
9787
9787
|
JA(() => {
|
|
9788
9788
|
W.current && (W.current.scrollTop = 0);
|
|
9789
9789
|
}, [C, i]);
|
|
@@ -9816,19 +9816,19 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9816
9816
|
}
|
|
9817
9817
|
}, vA = () => {
|
|
9818
9818
|
RA(null), g?.(null), ZA.current && (ZA.current.value = "");
|
|
9819
|
-
}, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [
|
|
9819
|
+
}, [SA, ff] = j(null), [rA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], qA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], GA = u === "female", _ = GA ? MA.female : MA.male, uA = GA ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], WA = uA.indexOf(i), a = uA.length, X = WA === a - 1, nA = () => {
|
|
9820
9820
|
if (I === "in") {
|
|
9821
9821
|
const x = parseInt(E, 10), q = parseInt(c, 10);
|
|
9822
9822
|
!isNaN(x) && x >= 0 && !isNaN(q) && q >= 0 && K(String(Math.round((x * 12 + q) * 2.54)));
|
|
9823
9823
|
}
|
|
9824
9824
|
O("cm");
|
|
9825
|
-
},
|
|
9825
|
+
}, H = () => {
|
|
9826
9826
|
if (I === "cm") {
|
|
9827
9827
|
const x = parseFloat(N);
|
|
9828
9828
|
!isNaN(x) && x > 0 && (BA(String(Math.floor(x / 2.54 / 12))), hA(String(Math.round(x / 2.54 % 12))));
|
|
9829
9829
|
}
|
|
9830
9830
|
O("in");
|
|
9831
|
-
},
|
|
9831
|
+
}, oA = () => {
|
|
9832
9832
|
if (!t.trim())
|
|
9833
9833
|
return s(B("Please enter a profile name")), !1;
|
|
9834
9834
|
let x;
|
|
@@ -9858,7 +9858,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9858
9858
|
age: parseFloat(XA),
|
|
9859
9859
|
chestProfile: SA || void 0,
|
|
9860
9860
|
midsectionProfile: rA || void 0,
|
|
9861
|
-
hipProfile: GA ?
|
|
9861
|
+
hipProfile: GA ? eA || void 0 : xA || void 0,
|
|
9862
9862
|
bandSize: GA && _A || void 0,
|
|
9863
9863
|
cupSize: GA && cf || void 0
|
|
9864
9864
|
};
|
|
@@ -9876,7 +9876,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9876
9876
|
photoBase64: PA || void 0
|
|
9877
9877
|
};
|
|
9878
9878
|
}, J = () => {
|
|
9879
|
-
if (!(i === "identity" && !
|
|
9879
|
+
if (!(i === "identity" && !oA())) {
|
|
9880
9880
|
if (i === "chest" && !SA) {
|
|
9881
9881
|
s(B("Please pick an option"));
|
|
9882
9882
|
return;
|
|
@@ -9889,7 +9889,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9889
9889
|
s(B("Please pick an option"));
|
|
9890
9890
|
return;
|
|
9891
9891
|
}
|
|
9892
|
-
if (i === "hips" && !
|
|
9892
|
+
if (i === "hips" && !eA) {
|
|
9893
9893
|
s(B("Please pick an option"));
|
|
9894
9894
|
return;
|
|
9895
9895
|
}
|
|
@@ -9920,7 +9920,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9920
9920
|
}
|
|
9921
9921
|
o(uA[Math.max(0, WA - 1)]);
|
|
9922
9922
|
}, FA = C === "manual" && (i === "chest" || i === "stomach" || i === "seat" || i === "hips"), OA = async () => {
|
|
9923
|
-
if (
|
|
9923
|
+
if (r === "name-photo") {
|
|
9924
9924
|
if (!zA()) return;
|
|
9925
9925
|
if (!PA) {
|
|
9926
9926
|
s(B("Please upload a photo"));
|
|
@@ -9929,7 +9929,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9929
9929
|
s(""), z("details");
|
|
9930
9930
|
return;
|
|
9931
9931
|
}
|
|
9932
|
-
if (
|
|
9932
|
+
if (r === "details") {
|
|
9933
9933
|
if (I === "in") {
|
|
9934
9934
|
const q = parseFloat(E);
|
|
9935
9935
|
if (!q || q < 3 || q > 8) {
|
|
@@ -9965,11 +9965,11 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9965
9965
|
const x = of();
|
|
9966
9966
|
F && (x.measurements = F, x.measurementsUnit = "cm"), f(x);
|
|
9967
9967
|
}, AA = () => {
|
|
9968
|
-
if (s(""),
|
|
9968
|
+
if (s(""), r === "details") {
|
|
9969
9969
|
z("name-photo");
|
|
9970
9970
|
return;
|
|
9971
9971
|
}
|
|
9972
|
-
if (
|
|
9972
|
+
if (r === "calculating" && !p) {
|
|
9973
9973
|
z("details");
|
|
9974
9974
|
return;
|
|
9975
9975
|
}
|
|
@@ -10056,7 +10056,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10056
10056
|
] }),
|
|
10057
10057
|
/* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", children: [
|
|
10058
10058
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick: nA, children: "cm" }),
|
|
10059
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick:
|
|
10059
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick: H, children: "in" })
|
|
10060
10060
|
] })
|
|
10061
10061
|
] }),
|
|
10062
10062
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
@@ -10212,9 +10212,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10212
10212
|
title: B("HIP PROFILE"),
|
|
10213
10213
|
subtitle: B("The curvature of your hips and thighs"),
|
|
10214
10214
|
children: [
|
|
10215
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.narrow ?? null, label: B("NARROW"), selected:
|
|
10216
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.average ?? null, label: B("AVERAGE"), selected:
|
|
10217
|
-
/* @__PURE__ */ A(Ff, { img: _.hips.full ?? null, label: B("FULL"), selected:
|
|
10215
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.narrow ?? null, label: B("NARROW"), selected: eA === "narrow", onSelect: () => gA("hips", "narrow") }),
|
|
10216
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.average ?? null, label: B("AVERAGE"), selected: eA === "average", onSelect: () => gA("hips", "average") }),
|
|
10217
|
+
/* @__PURE__ */ A(Ff, { img: _.hips.full ?? null, label: B("FULL"), selected: eA === "full", onSelect: () => gA("hips", "full") })
|
|
10218
10218
|
]
|
|
10219
10219
|
}
|
|
10220
10220
|
),
|
|
@@ -10261,7 +10261,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10261
10261
|
] })
|
|
10262
10262
|
] }, "bra"),
|
|
10263
10263
|
C === "manual" && V && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: V }),
|
|
10264
|
-
C === "image" &&
|
|
10264
|
+
C === "image" && r === "name-photo" && /* @__PURE__ */ P("div", { className: "ps-cpw-image-split ps-cpw-fade-in", children: [
|
|
10265
10265
|
/* @__PURE__ */ A(
|
|
10266
10266
|
"input",
|
|
10267
10267
|
{
|
|
@@ -10378,14 +10378,14 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10378
10378
|
V && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: V })
|
|
10379
10379
|
] })
|
|
10380
10380
|
] }, "image-photo"),
|
|
10381
|
-
C === "image" &&
|
|
10381
|
+
C === "image" && r === "details" && /* @__PURE__ */ P("div", { className: "ps-cpw-fade-in", style: { padding: "1vw 1.5vw" }, children: [
|
|
10382
10382
|
/* @__PURE__ */ P("div", { className: "ps-cpw-section-head", children: [
|
|
10383
10383
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-title", children: B("Your measurements") }),
|
|
10384
10384
|
/* @__PURE__ */ A("div", { className: "ps-cpw-section-sub", children: B("Enter your details for accurate body estimation") })
|
|
10385
10385
|
] }),
|
|
10386
10386
|
/* @__PURE__ */ A("div", { className: "ps-cpw-pill-row", style: { marginBottom: "0.8vw" }, children: /* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", children: [
|
|
10387
10387
|
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "cm" ? " ps-active" : ""}`, onClick: nA, children: "cm" }),
|
|
10388
|
-
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick:
|
|
10388
|
+
/* @__PURE__ */ A("button", { type: "button", className: `ps-cpw-pill${I === "in" ? " ps-active" : ""}`, onClick: H, children: "in" })
|
|
10389
10389
|
] }) }),
|
|
10390
10390
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-fields ps-cpw-inline-fields", children: [
|
|
10391
10391
|
/* @__PURE__ */ P("div", { className: "ps-bp-inline-row", children: [
|
|
@@ -10427,7 +10427,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10427
10427
|
] }),
|
|
10428
10428
|
V && /* @__PURE__ */ A("div", { className: "ps-cpw-error", children: V })
|
|
10429
10429
|
] }, "image-details"),
|
|
10430
|
-
C === "image" &&
|
|
10430
|
+
C === "image" && r === "calculating" && /* @__PURE__ */ A("div", { className: "ps-cpw-fade-in", style: { display: "flex", flexDirection: "column", flex: 1, padding: "1.5vw 2vw", overflow: "auto" }, children: p ? /* @__PURE__ */ P("div", { style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", flex: 1, gap: "1.2vw" }, children: [
|
|
10431
10431
|
/* @__PURE__ */ A("div", { className: "ps-tryon-size-loading-spinner" }),
|
|
10432
10432
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-primary)", fontSize: "1vw", fontWeight: 600 }, children: B("Analyzing your body measurements...") }),
|
|
10433
10433
|
/* @__PURE__ */ A("p", { style: { color: "var(--ps-text-muted)", fontSize: "0.75vw" }, children: B("Using AI to estimate chest, waist, hips, shoulders, and more") })
|
|
@@ -10471,7 +10471,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10471
10471
|
/* @__PURE__ */ P("div", { className: "ps-cpw-footer", children: [
|
|
10472
10472
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-back-btn", onClick: LA, children: C == null ? B("Cancel") : `← ${B("Back")}` }),
|
|
10473
10473
|
C === "manual" && !FA && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: J, children: B(X ? "CALCULATE MY FIT" : "Continue") }),
|
|
10474
|
-
C === "image" &&
|
|
10474
|
+
C === "image" && r === "name-photo" && /* @__PURE__ */ A(
|
|
10475
10475
|
"button",
|
|
10476
10476
|
{
|
|
10477
10477
|
type: "button",
|
|
@@ -10487,9 +10487,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10487
10487
|
children: t.trim() ? B(PA ? "Continue" : "Upload a photo") : B("Add a name for this profile")
|
|
10488
10488
|
}
|
|
10489
10489
|
),
|
|
10490
|
-
C === "image" &&
|
|
10491
|
-
C === "image" &&
|
|
10492
|
-
C === "image" &&
|
|
10490
|
+
C === "image" && r === "details" && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: OA, children: B("Calculate My Body Parts") }),
|
|
10491
|
+
C === "image" && r === "calculating" && !p && F && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: OA, children: B("Save Profile") }),
|
|
10492
|
+
C === "image" && r === "calculating" && !p && !F && /* @__PURE__ */ A("button", { type: "button", className: "ps-cpw-next-btn", onClick: () => {
|
|
10493
10493
|
z("details"), s("");
|
|
10494
10494
|
}, children: B("Try Again") })
|
|
10495
10495
|
] })
|
|
@@ -10524,7 +10524,7 @@ function A8({
|
|
|
10524
10524
|
onSave: D,
|
|
10525
10525
|
onSaveBraSize: i,
|
|
10526
10526
|
isEstimating: o = !1,
|
|
10527
|
-
t:
|
|
10527
|
+
t: r
|
|
10528
10528
|
}) {
|
|
10529
10529
|
const z = f.gender === "female" ? VB : WB, p = f.measurements || {}, T = Object.keys(p).some((K) => p[K] != null), [F, h] = j(f.measurementsUnit || "cm"), [W, t] = j(() => {
|
|
10530
10530
|
const K = {};
|
|
@@ -10562,12 +10562,12 @@ function A8({
|
|
|
10562
10562
|
};
|
|
10563
10563
|
return /* @__PURE__ */ P("div", { className: "ps-pmv-root", children: [
|
|
10564
10564
|
/* @__PURE__ */ P("div", { className: "ps-pmv-hero", children: [
|
|
10565
|
-
/* @__PURE__ */ A("div", { className: "ps-pmv-hero-eyebrow", children: n ?
|
|
10565
|
+
/* @__PURE__ */ A("div", { className: "ps-pmv-hero-eyebrow", children: n ? r("ACTIVE PROFILE") : f.gender === "female" ? r("WOMEN'S FIT") : r("MEN'S FIT") }),
|
|
10566
10566
|
/* @__PURE__ */ A("h2", { className: "ps-pmv-hero-name", children: f.name })
|
|
10567
10567
|
] }),
|
|
10568
10568
|
/* @__PURE__ */ A("div", { className: "ps-pmv-data", children: /* @__PURE__ */ P("div", { className: "ps-pmv-section", children: [
|
|
10569
10569
|
/* @__PURE__ */ A("div", { className: "ps-pmv-section-head", children: /* @__PURE__ */ P("div", { className: "ps-pmv-section-title-row", children: [
|
|
10570
|
-
/* @__PURE__ */ A("div", { className: "ps-pmv-section-title", children:
|
|
10570
|
+
/* @__PURE__ */ A("div", { className: "ps-pmv-section-title", children: r("BODY MEASUREMENTS") }),
|
|
10571
10571
|
/* @__PURE__ */ P("div", { className: "ps-cpw-pill-group", style: { marginLeft: "auto" }, children: [
|
|
10572
10572
|
/* @__PURE__ */ A(
|
|
10573
10573
|
"button",
|
|
@@ -10590,7 +10590,7 @@ function A8({
|
|
|
10590
10590
|
] }),
|
|
10591
10591
|
!T && /* @__PURE__ */ P("div", { className: "ps-pmv-loading-pill", style: { marginLeft: "8px" }, children: [
|
|
10592
10592
|
/* @__PURE__ */ A("span", { className: "ps-pmv-loading-spinner" }),
|
|
10593
|
-
/* @__PURE__ */ A("span", { children:
|
|
10593
|
+
/* @__PURE__ */ A("span", { children: r("Calculating...") })
|
|
10594
10594
|
] })
|
|
10595
10595
|
] }) }),
|
|
10596
10596
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-list", children: [
|
|
@@ -10598,10 +10598,10 @@ function A8({
|
|
|
10598
10598
|
const E = p[K.key], BA = o && E == null && !W[K.key];
|
|
10599
10599
|
return /* @__PURE__ */ P("div", { className: `ps-pmv-measure-row${E == null ? " ps-loading" : ""}`, children: [
|
|
10600
10600
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon", children: /* @__PURE__ */ A("img", { src: K.iconSrc, alt: "", "aria-hidden": "true" }) }),
|
|
10601
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children:
|
|
10601
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: r(K.label) }),
|
|
10602
10602
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: BA ? /* @__PURE__ */ P("span", { style: { display: "inline-flex", alignItems: "center", gap: "0.4vw" }, children: [
|
|
10603
10603
|
/* @__PURE__ */ A("span", { className: "ps-tryon-size-loading-spinner", style: { width: "0.8vw", height: "0.8vw", borderWidth: "1.5px" } }),
|
|
10604
|
-
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children:
|
|
10604
|
+
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: r("calculating...") })
|
|
10605
10605
|
] }) : /* @__PURE__ */ P(tA, { children: [
|
|
10606
10606
|
/* @__PURE__ */ A(
|
|
10607
10607
|
"input",
|
|
@@ -10621,7 +10621,7 @@ function A8({
|
|
|
10621
10621
|
f.gender === "female" && /* @__PURE__ */ P(tA, { children: [
|
|
10622
10622
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-row", children: [
|
|
10623
10623
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon" }),
|
|
10624
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children:
|
|
10624
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: r("BAND") }),
|
|
10625
10625
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: /* @__PURE__ */ P(
|
|
10626
10626
|
"select",
|
|
10627
10627
|
{
|
|
@@ -10637,7 +10637,7 @@ function A8({
|
|
|
10637
10637
|
] }),
|
|
10638
10638
|
/* @__PURE__ */ P("div", { className: "ps-pmv-measure-row", children: [
|
|
10639
10639
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-icon" }),
|
|
10640
|
-
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children:
|
|
10640
|
+
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-label", children: r("CUP") }),
|
|
10641
10641
|
/* @__PURE__ */ A("span", { className: "ps-pmv-measure-value ps-pmv-inline-edit", children: /* @__PURE__ */ P(
|
|
10642
10642
|
"select",
|
|
10643
10643
|
{
|
|
@@ -10655,19 +10655,19 @@ function A8({
|
|
|
10655
10655
|
] })
|
|
10656
10656
|
] }) }),
|
|
10657
10657
|
/* @__PURE__ */ P("div", { className: "ps-pmv-actions", children: [
|
|
10658
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: C, children:
|
|
10658
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: C, children: r("Back") }),
|
|
10659
10659
|
/* @__PURE__ */ P("div", { className: "ps-pmv-actions-right", children: [
|
|
10660
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-delete", onClick: B, children:
|
|
10661
|
-
!n && /* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: g, children:
|
|
10660
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-delete", onClick: B, children: r("Delete") }),
|
|
10661
|
+
!n && /* @__PURE__ */ A("button", { type: "button", className: "ps-pmv-btn-secondary", onClick: g, children: r("USE THIS PROFILE") }),
|
|
10662
10662
|
/* @__PURE__ */ A(
|
|
10663
10663
|
"button",
|
|
10664
10664
|
{
|
|
10665
10665
|
type: "button",
|
|
10666
10666
|
className: "ps-pmv-btn-primary",
|
|
10667
10667
|
onClick: N,
|
|
10668
|
-
children: T ?
|
|
10668
|
+
children: T ? r("SAVE") : /* @__PURE__ */ P(tA, { children: [
|
|
10669
10669
|
/* @__PURE__ */ A("span", { className: "ps-pmv-btn-spinner" }),
|
|
10670
|
-
|
|
10670
|
+
r("CALCULATING")
|
|
10671
10671
|
] })
|
|
10672
10672
|
}
|
|
10673
10673
|
)
|
|
@@ -10713,7 +10713,7 @@ function P8({
|
|
|
10713
10713
|
})(), o = (() => {
|
|
10714
10714
|
const z = f.weight ?? f.weightKg;
|
|
10715
10715
|
return z ? `${Math.round(z)} ${f.weightUnit || "kg"}` : null;
|
|
10716
|
-
})(),
|
|
10716
|
+
})(), r = (() => {
|
|
10717
10717
|
const z = f.lastEditedAt || f.lastUsedAt || f.createdAt;
|
|
10718
10718
|
return z ? new Date(z).toLocaleDateString(void 0, { month: "short", day: "numeric" }) : null;
|
|
10719
10719
|
})();
|
|
@@ -10737,9 +10737,9 @@ function P8({
|
|
|
10737
10737
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-label", children: D("WEIGHT") }),
|
|
10738
10738
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children: o })
|
|
10739
10739
|
] }),
|
|
10740
|
-
|
|
10740
|
+
r && /* @__PURE__ */ P("div", { className: "ps-msp-meta-row", children: [
|
|
10741
10741
|
/* @__PURE__ */ A("span", { className: "ps-msp-meta-label", children: D("LAST UPDATE") }),
|
|
10742
|
-
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children:
|
|
10742
|
+
/* @__PURE__ */ A("span", { className: "ps-msp-meta-value", children: r })
|
|
10743
10743
|
] })
|
|
10744
10744
|
] }),
|
|
10745
10745
|
/* @__PURE__ */ P("div", { className: "ps-msp-card-actions", onClick: (z) => z.stopPropagation(), children: [
|
|
@@ -10796,7 +10796,7 @@ function g8({
|
|
|
10796
10796
|
onSaveBraSize: D,
|
|
10797
10797
|
onRequestDelete: i,
|
|
10798
10798
|
onClose: o,
|
|
10799
|
-
onPhotoPreview:
|
|
10799
|
+
onPhotoPreview: r,
|
|
10800
10800
|
onEstimateFromPhoto: z,
|
|
10801
10801
|
estimatingProfileIds: p,
|
|
10802
10802
|
t: T,
|
|
@@ -10851,7 +10851,7 @@ function g8({
|
|
|
10851
10851
|
W(!1), I && k(I);
|
|
10852
10852
|
},
|
|
10853
10853
|
onCancel: () => W(!1),
|
|
10854
|
-
onPhotoPreview:
|
|
10854
|
+
onPhotoPreview: r,
|
|
10855
10855
|
onEstimate: z,
|
|
10856
10856
|
t: T
|
|
10857
10857
|
}
|
|
@@ -10911,7 +10911,7 @@ function w8({
|
|
|
10911
10911
|
setHeightFeet: D,
|
|
10912
10912
|
heightInches: i,
|
|
10913
10913
|
setHeightInches: o,
|
|
10914
|
-
weight:
|
|
10914
|
+
weight: r,
|
|
10915
10915
|
setWeight: z,
|
|
10916
10916
|
age: p,
|
|
10917
10917
|
setAge: T,
|
|
@@ -10928,7 +10928,7 @@ function w8({
|
|
|
10928
10928
|
error: K,
|
|
10929
10929
|
t: E
|
|
10930
10930
|
}) {
|
|
10931
|
-
const BA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(i) || 8), hA = Math.floor(c / 12), l = c % 12, y = parseFloat(
|
|
10931
|
+
const BA = parseFloat(e) || 173, c = (parseFloat(C) || 5) * 12 + (parseFloat(i) || 8), hA = Math.floor(c / 12), l = c % 12, y = parseFloat(r) || (n === "kg" ? 70 : 154), XA = parseFloat(p) || 30, sA = n === "kg" ? 30 : 66, V = n === "kg" ? 200 : 440, s = 120, PA = 220, RA = 48, mA = 84, dA = 13, ZA = 100, Hf = (BA - s) / (PA - s) * 100, m = (c - RA) / (mA - RA) * 100, EA = (y - sA) / (V - sA) * 100, TA = (XA - dA) / (ZA - dA) * 100, bA = (nf) => {
|
|
10932
10932
|
const xA = Math.max(RA, Math.min(mA, nf));
|
|
10933
10933
|
D(String(Math.floor(xA / 12))), o(String(xA % 12));
|
|
10934
10934
|
}, VA = () => {
|
|
@@ -11129,11 +11129,11 @@ function Zn({
|
|
|
11129
11129
|
photoVariant: D = "full-body",
|
|
11130
11130
|
photoStepHeight: i,
|
|
11131
11131
|
onPhotoStepHeightChange: o,
|
|
11132
|
-
ageConfirmed:
|
|
11132
|
+
ageConfirmed: r,
|
|
11133
11133
|
onAgeConfirmedChange: z,
|
|
11134
11134
|
t: p
|
|
11135
11135
|
}) {
|
|
11136
|
-
const T = D === "close-up", F = iA(null), h = !!f, W = !h &&
|
|
11136
|
+
const T = D === "close-up", F = iA(null), h = !!f, W = !h && r !== !0;
|
|
11137
11137
|
return /* @__PURE__ */ P("div", { className: "ps-pm-root", children: [
|
|
11138
11138
|
/* @__PURE__ */ P("div", { className: "ps-pm-header", children: [
|
|
11139
11139
|
/* @__PURE__ */ A("h2", { className: "ps-pm-title", children: p(T ? "Upload a face photo or selfie" : "Review your photo") }),
|
|
@@ -11180,7 +11180,7 @@ function Zn({
|
|
|
11180
11180
|
]
|
|
11181
11181
|
}
|
|
11182
11182
|
),
|
|
11183
|
-
|
|
11183
|
+
r === null && /* @__PURE__ */ A("div", { className: "ps-pm-age-gate", role: "dialog", children: /* @__PURE__ */ P("div", { className: "ps-pm-age-gate-card", children: [
|
|
11184
11184
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow", children: p("AGE VERIFICATION") }),
|
|
11185
11185
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: p("Is the person in this photo 18 years or older?") }),
|
|
11186
11186
|
/* @__PURE__ */ P("div", { className: "ps-pm-age-gate-actions", children: [
|
|
@@ -11188,7 +11188,7 @@ function Zn({
|
|
|
11188
11188
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => z(!1), children: p("No") })
|
|
11189
11189
|
] })
|
|
11190
11190
|
] }) }),
|
|
11191
|
-
|
|
11191
|
+
r === !1 && /* @__PURE__ */ A("div", { className: "ps-pm-age-gate", role: "alert", children: /* @__PURE__ */ P("div", { className: "ps-pm-age-gate-card", children: [
|
|
11192
11192
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-eyebrow ps-pm-age-gate-eyebrow-blocked", children: p("UPLOAD NOT ALLOWED") }),
|
|
11193
11193
|
/* @__PURE__ */ A("div", { className: "ps-pm-age-gate-question", children: p("For your safety, we cannot process photos of people under 18.") }),
|
|
11194
11194
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-pm-age-gate-btn ps-pm-age-gate-btn-secondary", onClick: () => z(null), children: p("Go back") })
|
|
@@ -11270,12 +11270,12 @@ function iP({
|
|
|
11270
11270
|
] }),
|
|
11271
11271
|
/* @__PURE__ */ A("h2", { className: "ps-bsm-question", children: g }),
|
|
11272
11272
|
/* @__PURE__ */ A("div", { className: "ps-bsm-options-center", children: /* @__PURE__ */ A("div", { className: "ps-bsm-options", children: e.map((i, o) => {
|
|
11273
|
-
const
|
|
11273
|
+
const r = B === i.value, z = String.fromCharCode(65 + o);
|
|
11274
11274
|
return /* @__PURE__ */ P(
|
|
11275
11275
|
"button",
|
|
11276
11276
|
{
|
|
11277
11277
|
type: "button",
|
|
11278
|
-
className: `ps-bsm-card${
|
|
11278
|
+
className: `ps-bsm-card${r ? " ps-active" : ""}`,
|
|
11279
11279
|
onClick: () => C(i.value),
|
|
11280
11280
|
children: [
|
|
11281
11281
|
/* @__PURE__ */ P("div", { className: "ps-bsm-card-content", children: [
|
|
@@ -11383,7 +11383,7 @@ function z8({
|
|
|
11383
11383
|
setHeightUnit: D,
|
|
11384
11384
|
weightUnit: i,
|
|
11385
11385
|
setWeightUnit: o,
|
|
11386
|
-
sizingUnit:
|
|
11386
|
+
sizingUnit: r,
|
|
11387
11387
|
setSizingUnit: z,
|
|
11388
11388
|
onComplete: p,
|
|
11389
11389
|
onSnapSubmit: T,
|
|
@@ -11401,7 +11401,7 @@ function z8({
|
|
|
11401
11401
|
l || (C === "ft" ? "in" : C || (E ? "in" : "cm"))
|
|
11402
11402
|
), [ff, rA] = j(
|
|
11403
11403
|
y || i || (E ? "lbs" : "kg")
|
|
11404
|
-
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [
|
|
11404
|
+
), nf = vA === "in" || ff === "lbs", [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(!1), gf = iA(null), [qA, GA] = j(null), [_, uA] = j(() => sA != null ? String(Math.round(sA * 2.54)) : XA), [WA, a] = j(null), [X, nA] = j(null), [H, oA] = j(null), [zA, YA] = j(null), [of, J] = j(""), [gA, Bf] = j(null), [FA, OA] = j(null), [AA, LA] = j(() => ["US", "UK", "AU"].includes(B) ? B === "AU" ? "UK" : B : ["FR", "ES"].includes(B) ? "FR" : ["IT"].includes(B) ? "IT" : ["JP", "CN", "KR"].includes(B) ? "JP" : "EU"), [Pf, lA] = j(!1), x = pn[AA] || pn.US, [q, QA] = j(""), U = UA(async (M) => {
|
|
11405
11405
|
const cA = M.target.files?.[0];
|
|
11406
11406
|
if (!cA) return;
|
|
11407
11407
|
if (qA !== !0) {
|
|
@@ -11428,8 +11428,8 @@ function z8({
|
|
|
11428
11428
|
Mf(!1);
|
|
11429
11429
|
}
|
|
11430
11430
|
}, [v, qA]), R = UA(() => {
|
|
11431
|
-
|
|
11432
|
-
}, [
|
|
11431
|
+
eA && URL.revokeObjectURL(eA), Ef(null), $(null), Of(null), gf.current && (gf.current.value = "");
|
|
11432
|
+
}, [eA]), G = UA(() => {
|
|
11433
11433
|
if (vA === "in") {
|
|
11434
11434
|
const cA = parseFloat(ZA);
|
|
11435
11435
|
if (!cA || cA < 3 || cA > 8)
|
|
@@ -11468,7 +11468,7 @@ function z8({
|
|
|
11468
11468
|
age: VA ? parseInt(VA, 10) : void 0,
|
|
11469
11469
|
chestProfile: WA || void 0,
|
|
11470
11470
|
midsectionProfile: X,
|
|
11471
|
-
hipProfile:
|
|
11471
|
+
hipProfile: H,
|
|
11472
11472
|
bodyImage: _A || void 0,
|
|
11473
11473
|
bandSize: gA || void 0,
|
|
11474
11474
|
cupSize: FA || void 0
|
|
@@ -11488,7 +11488,7 @@ function z8({
|
|
|
11488
11488
|
const M = fA("seat");
|
|
11489
11489
|
M === "submit" ? NA() : N(M);
|
|
11490
11490
|
} else if (O === "hips") {
|
|
11491
|
-
if (!
|
|
11491
|
+
if (!H) return;
|
|
11492
11492
|
const M = fA("hips");
|
|
11493
11493
|
M === "submit" ? NA() : N(M);
|
|
11494
11494
|
} else if (O === "bra") {
|
|
@@ -11516,7 +11516,7 @@ function z8({
|
|
|
11516
11516
|
gender: aA
|
|
11517
11517
|
});
|
|
11518
11518
|
}
|
|
11519
|
-
}, [O, I, G, WA, X,
|
|
11519
|
+
}, [O, I, G, WA, X, H, zA, gA, FA, vA, ff, mA, ZA, m, TA, VA, _A, xA, _, e, D, o, p, T, g, aA, F, h]), ef = (M) => {
|
|
11520
11520
|
const cA = I.indexOf(M);
|
|
11521
11521
|
return cA > 0 ? I[cA - 1] : null;
|
|
11522
11522
|
}, yA = UA(() => {
|
|
@@ -11528,11 +11528,11 @@ function z8({
|
|
|
11528
11528
|
const M = ef(O);
|
|
11529
11529
|
M ? N(M) : u();
|
|
11530
11530
|
}
|
|
11531
|
-
}, [O, I, u]), KA = O === "basics" ? !0 : O === "chest" ? !!WA : O === "midsection" ? !!X : O === "seat" ? !!zA : O === "hips" ? !!
|
|
11531
|
+
}, [O, I, u]), KA = O === "basics" ? !0 : O === "chest" ? !!WA : O === "midsection" ? !!X : O === "seat" ? !!zA : O === "hips" ? !!H : O === "bra" ? !!(gA && FA) : O === "photo", vf = O === I[I.length - 1];
|
|
11532
11532
|
return O === "photo" ? K ? /* @__PURE__ */ A("div", { className: "ps-bp-wrapper", children: /* @__PURE__ */ A(
|
|
11533
11533
|
Zn,
|
|
11534
11534
|
{
|
|
11535
|
-
photoPreview:
|
|
11535
|
+
photoPreview: eA,
|
|
11536
11536
|
handlePhotoSelect: U,
|
|
11537
11537
|
handleRemovePhoto: R,
|
|
11538
11538
|
onAnalyze: $A,
|
|
@@ -11553,7 +11553,7 @@ function z8({
|
|
|
11553
11553
|
"div",
|
|
11554
11554
|
{
|
|
11555
11555
|
onClick: () => {
|
|
11556
|
-
!
|
|
11556
|
+
!eA && qA === !0 && gf.current?.click();
|
|
11557
11557
|
},
|
|
11558
11558
|
style: {
|
|
11559
11559
|
flex: 1,
|
|
@@ -11561,20 +11561,20 @@ function z8({
|
|
|
11561
11561
|
flexDirection: "column",
|
|
11562
11562
|
alignItems: "center",
|
|
11563
11563
|
justifyContent: "center",
|
|
11564
|
-
border:
|
|
11564
|
+
border: eA ? "2px solid var(--ps-accent)" : "2px dashed var(--ps-border-color)",
|
|
11565
11565
|
borderRadius: "0.5vw",
|
|
11566
|
-
cursor:
|
|
11566
|
+
cursor: eA ? "default" : qA === !0 ? "pointer" : "not-allowed",
|
|
11567
11567
|
position: "relative",
|
|
11568
11568
|
background: "var(--ps-bg-secondary)",
|
|
11569
11569
|
transition: "border-color 0.2s, filter 0.25s",
|
|
11570
11570
|
overflow: "hidden",
|
|
11571
|
-
filter: !
|
|
11572
|
-
pointerEvents: !
|
|
11573
|
-
userSelect: !
|
|
11571
|
+
filter: !eA && qA !== !0 ? "blur(6px) saturate(0.7)" : void 0,
|
|
11572
|
+
pointerEvents: !eA && qA !== !0 ? "none" : void 0,
|
|
11573
|
+
userSelect: !eA && qA !== !0 ? "none" : void 0
|
|
11574
11574
|
},
|
|
11575
|
-
"aria-hidden": !
|
|
11576
|
-
children:
|
|
11577
|
-
/* @__PURE__ */ A("img", { src:
|
|
11575
|
+
"aria-hidden": !eA && qA !== !0,
|
|
11576
|
+
children: eA ? /* @__PURE__ */ P(tA, { children: [
|
|
11577
|
+
/* @__PURE__ */ A("img", { src: eA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
11578
11578
|
/* @__PURE__ */ A("button", { onClick: (M) => {
|
|
11579
11579
|
M.stopPropagation(), R();
|
|
11580
11580
|
}, style: { position: "absolute", top: "0.5vw", right: "0.5vw", width: "1.4vw", height: "1.4vw", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "none", color: "#fff", fontSize: "0.7vw", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: "×" })
|
|
@@ -11586,7 +11586,7 @@ function z8({
|
|
|
11586
11586
|
] })
|
|
11587
11587
|
}
|
|
11588
11588
|
),
|
|
11589
|
-
!
|
|
11589
|
+
!eA && qA === null && /* @__PURE__ */ A(
|
|
11590
11590
|
"div",
|
|
11591
11591
|
{
|
|
11592
11592
|
role: "dialog",
|
|
@@ -11670,7 +11670,7 @@ function z8({
|
|
|
11670
11670
|
] })
|
|
11671
11671
|
}
|
|
11672
11672
|
),
|
|
11673
|
-
!
|
|
11673
|
+
!eA && qA === !1 && /* @__PURE__ */ A(
|
|
11674
11674
|
"div",
|
|
11675
11675
|
{
|
|
11676
11676
|
role: "alert",
|
|
@@ -11796,7 +11796,7 @@ function z8({
|
|
|
11796
11796
|
type: "button",
|
|
11797
11797
|
className: "ps-bpm-next-btn",
|
|
11798
11798
|
onClick: $A,
|
|
11799
|
-
disabled: !
|
|
11799
|
+
disabled: !eA,
|
|
11800
11800
|
children: v("Analyze My Size")
|
|
11801
11801
|
}
|
|
11802
11802
|
),
|
|
@@ -11820,7 +11820,7 @@ function z8({
|
|
|
11820
11820
|
/* @__PURE__ */ A(
|
|
11821
11821
|
"button",
|
|
11822
11822
|
{
|
|
11823
|
-
className: `ps-bp-next-btn${
|
|
11823
|
+
className: `ps-bp-next-btn${eA ? "" : " ps-bp-btn-disabled"}`,
|
|
11824
11824
|
onClick: $A,
|
|
11825
11825
|
type: "button",
|
|
11826
11826
|
children: v("Analyze My Size")
|
|
@@ -12037,17 +12037,17 @@ function z8({
|
|
|
12037
12037
|
{ value: "average", label: v("Average"), img: MA.female.hips.average },
|
|
12038
12038
|
{ value: "full", label: v("Curvy"), img: MA.female.hips.full }
|
|
12039
12039
|
],
|
|
12040
|
-
selected:
|
|
12041
|
-
onSelect: (M) =>
|
|
12040
|
+
selected: H,
|
|
12041
|
+
onSelect: (M) => oA(M),
|
|
12042
12042
|
t: v
|
|
12043
12043
|
},
|
|
12044
12044
|
"step-hips-mobile"
|
|
12045
12045
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12046
12046
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your hips?") }),
|
|
12047
12047
|
/* @__PURE__ */ P("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: [
|
|
12048
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.narrow, label: v("Narrow"), selected:
|
|
12049
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected:
|
|
12050
|
-
/* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected:
|
|
12048
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.narrow, label: v("Narrow"), selected: H === "narrow", onSelect: () => oA("narrow"), onHover: () => J(v("Hips closer to shoulder width")), onLeave: () => J("") }),
|
|
12049
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.average, label: v("Average"), selected: H === "average", onSelect: () => oA("average"), onHover: () => J(v("Hips proportionate to shoulders")), onLeave: () => J("") }),
|
|
12050
|
+
/* @__PURE__ */ A(rf, { img: MA.female.hips.full, label: v("Curvy"), selected: H === "full", onSelect: () => oA("full"), onHover: () => J(v("Hips wider than shoulders")), onLeave: () => J("") })
|
|
12051
12051
|
] }),
|
|
12052
12052
|
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: of || " " })
|
|
12053
12053
|
] }, "step-hips")),
|
|
@@ -12163,7 +12163,7 @@ function SP({
|
|
|
12163
12163
|
productTitle: D,
|
|
12164
12164
|
formRef: i,
|
|
12165
12165
|
sizingUnit: o,
|
|
12166
|
-
setSizingUnit:
|
|
12166
|
+
setSizingUnit: r,
|
|
12167
12167
|
setSizingMethod: z,
|
|
12168
12168
|
setSizingLoading: p,
|
|
12169
12169
|
setView: T,
|
|
@@ -12245,7 +12245,7 @@ function SP({
|
|
|
12245
12245
|
{
|
|
12246
12246
|
type: "button",
|
|
12247
12247
|
className: `ps-bpm-toggle-btn${o === m.value ? " ps-bpm-toggle-active" : ""}`,
|
|
12248
|
-
onClick: () =>
|
|
12248
|
+
onClick: () => r(m.value),
|
|
12249
12249
|
children: t(m.label)
|
|
12250
12250
|
},
|
|
12251
12251
|
m.value
|
|
@@ -12581,7 +12581,7 @@ function SP({
|
|
|
12581
12581
|
{
|
|
12582
12582
|
type: "button",
|
|
12583
12583
|
className: `ps-bp-system-btn${o === m.value ? " ps-bp-system-active" : ""}`,
|
|
12584
|
-
onClick: () =>
|
|
12584
|
+
onClick: () => r(m.value),
|
|
12585
12585
|
children: t(m.label)
|
|
12586
12586
|
},
|
|
12587
12587
|
m.value
|
|
@@ -12640,7 +12640,7 @@ function p8(f) {
|
|
|
12640
12640
|
const n = f?.requiredFields;
|
|
12641
12641
|
if (!n || n.length === 0) return tP;
|
|
12642
12642
|
const g = /* @__PURE__ */ new Set(["size", "country", "eu", "__skip__", "shoeEU", "shoeUS", "shoeUK", "shoeJP"]), e = (C, D) => {
|
|
12643
|
-
const i = tP.find((
|
|
12643
|
+
const i = tP.find((r) => r.key === C);
|
|
12644
12644
|
return i ? i.placeholder : /foot|length/i.test(C) || /foot|length/i.test(D) ? tP[0].placeholder : { cm: "", in: "" };
|
|
12645
12645
|
}, B = n.filter((C) => !g.has(C.key) && C.unit !== "size").map((C) => {
|
|
12646
12646
|
const D = e(C.key, C.label || "");
|
|
@@ -12786,7 +12786,7 @@ function R8({
|
|
|
12786
12786
|
showIcon: D = !0,
|
|
12787
12787
|
buttonIcon: i,
|
|
12788
12788
|
locale: o,
|
|
12789
|
-
buttonStyles:
|
|
12789
|
+
buttonStyles: r = {},
|
|
12790
12790
|
modalStyles: z = {},
|
|
12791
12791
|
classNames: p = {},
|
|
12792
12792
|
className: T,
|
|
@@ -12807,21 +12807,21 @@ function R8({
|
|
|
12807
12807
|
JA(() => {
|
|
12808
12808
|
hA(!0);
|
|
12809
12809
|
}, []);
|
|
12810
|
-
const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, dA] = j(null), [ZA, Hf] = j(!1), [m, EA] = j(!1), [TA, bA] = j(null), [VA, kA] = j(null), [vA, SA] = j(null), [ff, rA] = j(!1), [nf, xA] = j(!1), [Ef,
|
|
12810
|
+
const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, dA] = j(null), [ZA, Hf] = j(!1), [m, EA] = j(!1), [TA, bA] = j(null), [VA, kA] = j(null), [vA, SA] = j(null), [ff, rA] = j(!1), [nf, xA] = j(!1), [Ef, eA] = j(!1), [$, _A] = j(null), [Of, cf] = j(!1), Mf = iA(!1), [gf, qA] = j(Xg), GA = Yn(gf), [_, uA] = j(GA ? "in" : "cm"), [WA, a] = j(GA ? "in" : "cm"), [X, nA] = j(GA ? "lbs" : "kg");
|
|
12811
12811
|
JA(() => {
|
|
12812
12812
|
const w = Xf(n);
|
|
12813
12813
|
w === "foot" || w === "head" ? uA("cm") : w === "face" && uA("mm");
|
|
12814
12814
|
}, [n]);
|
|
12815
|
-
const
|
|
12815
|
+
const H = iA({}), [oA, zA] = j("male"), [YA, of] = j(0), [J, gA] = j(null), [Bf, FA] = j(!1), [OA, AA] = j(() => af("profiles", [])), [LA, Pf] = j(() => af("history", [])), [lA, x] = j(() => Kn()), [q, QA] = j(() => /* @__PURE__ */ new Set()), [U, R] = j(null), G = UA((w) => {
|
|
12816
12816
|
x(w), Tg(w);
|
|
12817
12817
|
}, []), [S, aA] = j(!1), [fA, NA] = j(null), [$A, ef] = j(null), yA = iA(null), KA = iA(() => !1), vf = iA(() => {
|
|
12818
|
-
}), M = UA((w,
|
|
12819
|
-
KA.current = w, vf.current =
|
|
12818
|
+
}), M = UA((w, Q) => {
|
|
12819
|
+
KA.current = w, vf.current = Q;
|
|
12820
12820
|
}, []), cA = iA(null), pA = iA(null), tf = iA(null), Df = iA(null), IA = iA(null), pf = iA(!1), qn = iA(null), If = iA(null), [Wn, lf] = j(null), [Vn, LP] = j(null), Jf = iA(null);
|
|
12821
12821
|
JA(() => {
|
|
12822
12822
|
try {
|
|
12823
|
-
const w = bf(),
|
|
12824
|
-
pA.current = new zg(w,
|
|
12823
|
+
const w = bf(), Q = uf(B);
|
|
12824
|
+
pA.current = new zg(w, Q), tf.current = new cg(pA.current.getStreamUrl());
|
|
12825
12825
|
} catch {
|
|
12826
12826
|
}
|
|
12827
12827
|
return () => {
|
|
@@ -12840,14 +12840,14 @@ function R8({
|
|
|
12840
12840
|
{ at: 50, text: E("Generating virtual try-on...") },
|
|
12841
12841
|
{ at: 75, text: E("Refining details...") },
|
|
12842
12842
|
{ at: 90, text: E("Almost there...") }
|
|
12843
|
-
],
|
|
12843
|
+
], Q = 2 * Math.PI * 27;
|
|
12844
12844
|
return Tf.current = setInterval(() => {
|
|
12845
12845
|
if (pf.current) return;
|
|
12846
12846
|
const Y = pP.current || Date.now(), wA = (Date.now() - Y) / 1e3, L = Math.min(95, wA / cP * 100);
|
|
12847
12847
|
nP.current = L;
|
|
12848
12848
|
const Z = Math.round(L);
|
|
12849
12849
|
if (mf.current && (mf.current.style.width = `${Z}%`), Nf.current && (Nf.current.textContent = `${Z}%`), yf.current) {
|
|
12850
|
-
const d =
|
|
12850
|
+
const d = Q * (1 - L / 100);
|
|
12851
12851
|
yf.current.style.strokeDashoffset = String(d);
|
|
12852
12852
|
}
|
|
12853
12853
|
if (Lf.current) {
|
|
@@ -12872,9 +12872,9 @@ function R8({
|
|
|
12872
12872
|
V && URL.revokeObjectURL(V);
|
|
12873
12873
|
}, [V]), JA(() => {
|
|
12874
12874
|
if (l !== "idle") {
|
|
12875
|
-
const w = window.scrollY,
|
|
12875
|
+
const w = window.scrollY, Q = document.body.style.overflow, Y = document.body.style.overscrollBehavior;
|
|
12876
12876
|
return document.body.style.overflow = "hidden", document.body.style.overscrollBehavior = "none", () => {
|
|
12877
|
-
document.body.style.overflow =
|
|
12877
|
+
document.body.style.overflow = Q, document.body.style.overscrollBehavior = Y, window.scrollTo(0, w);
|
|
12878
12878
|
};
|
|
12879
12879
|
}
|
|
12880
12880
|
}, [l]), JA(() => {
|
|
@@ -12895,10 +12895,10 @@ function R8({
|
|
|
12895
12895
|
return;
|
|
12896
12896
|
}
|
|
12897
12897
|
cf(!0);
|
|
12898
|
-
const w = uf(B),
|
|
12898
|
+
const w = uf(B), Q = bf();
|
|
12899
12899
|
fetch(`${w}/api/v1/sizing/sizeguide`, {
|
|
12900
12900
|
method: "POST",
|
|
12901
|
-
headers: { "Content-Type": "application/json", Authorization: `Bearer ${
|
|
12901
|
+
headers: { "Content-Type": "application/json", Authorization: `Bearer ${Q}` },
|
|
12902
12902
|
body: JSON.stringify({ product: { title: n, productId: O }, sizeGuideRaw: I })
|
|
12903
12903
|
}).then((Y) => Y.ok ? Y.json() : null).then((Y) => {
|
|
12904
12904
|
_A(Y || { found: !1 });
|
|
@@ -12922,7 +12922,7 @@ function R8({
|
|
|
12922
12922
|
return 1;
|
|
12923
12923
|
}
|
|
12924
12924
|
}, [l]), Zf = UA(
|
|
12925
|
-
(w,
|
|
12925
|
+
(w, Q) => {
|
|
12926
12926
|
let Y = lA, wA = OA.find((L) => L.id === Y);
|
|
12927
12927
|
if (!wA) {
|
|
12928
12928
|
const L = {
|
|
@@ -12959,16 +12959,16 @@ function R8({
|
|
|
12959
12959
|
}).then((L) => {
|
|
12960
12960
|
!L || !Y || (FP(Y, L.estimates, L.unit), AA(af("profiles", [])));
|
|
12961
12961
|
}).catch(() => {
|
|
12962
|
-
}).finally(() => xA(!0)),
|
|
12963
|
-
const L =
|
|
12964
|
-
Object.entries(
|
|
12962
|
+
}).finally(() => xA(!0)), Q?.recommendedSize && Y) {
|
|
12963
|
+
const L = Q.sections ? Object.fromEntries(
|
|
12964
|
+
Object.entries(Q.sections).map(([Z, d]) => [Z, d.recommendedSize])
|
|
12965
12965
|
) : void 0;
|
|
12966
12966
|
Tn(Y, {
|
|
12967
12967
|
productId: O,
|
|
12968
12968
|
productTitle: n,
|
|
12969
12969
|
productImage: f,
|
|
12970
|
-
recommendedSize:
|
|
12971
|
-
confidence:
|
|
12970
|
+
recommendedSize: Q.recommendedSize,
|
|
12971
|
+
confidence: Q.confidence,
|
|
12972
12972
|
sections: L,
|
|
12973
12973
|
savedAt: Date.now()
|
|
12974
12974
|
}), AA(af("profiles", []));
|
|
@@ -12976,14 +12976,14 @@ function R8({
|
|
|
12976
12976
|
},
|
|
12977
12977
|
[lA, OA, B, f, n, O, G]
|
|
12978
12978
|
), UP = iA(null), [qf, EP] = j(null), yP = UA(async (w) => {
|
|
12979
|
-
const
|
|
12980
|
-
if (!wA && L &&
|
|
12979
|
+
const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0, wA = !!w.measurements && Object.keys(w.measurements).length > 0, L = w.photoBase64;
|
|
12980
|
+
if (!wA && L && Q > 0 && UP.current) {
|
|
12981
12981
|
try {
|
|
12982
12982
|
const d = L.startsWith("data:") ? L : `data:image/jpeg;base64,${L}`, b = await fetch(d).then((DA) => DA.blob()), HA = new File([b], "profile-photo.jpg", { type: b.type || "image/jpeg" });
|
|
12983
12983
|
await UP.current({
|
|
12984
12984
|
photoFile: HA,
|
|
12985
12985
|
photoBase64: L,
|
|
12986
|
-
height:
|
|
12986
|
+
height: Q,
|
|
12987
12987
|
weight: Y,
|
|
12988
12988
|
heightUnit: w.heightUnit || "cm",
|
|
12989
12989
|
weightUnit: w.weightUnit || "kg",
|
|
@@ -13021,8 +13021,8 @@ function R8({
|
|
|
13021
13021
|
}, [O, n, f, I, B, V]), _n = UA(async () => {
|
|
13022
13022
|
const w = OA.find((L) => L.id === lA);
|
|
13023
13023
|
if (!w) return;
|
|
13024
|
-
const
|
|
13025
|
-
|
|
13024
|
+
const Q = w.height ?? w.heightCm ?? 0, Y = w.weight ?? w.weightKg ?? 0;
|
|
13025
|
+
Q > 0 && Y > 0 && EP(w);
|
|
13026
13026
|
}, [OA, lA]), Ag = UA(() => {
|
|
13027
13027
|
if (!qf) return;
|
|
13028
13028
|
const w = qf;
|
|
@@ -13033,7 +13033,7 @@ function R8({
|
|
|
13033
13033
|
}), ng = UA(() => {
|
|
13034
13034
|
console.log("[ps-sdk] handleOpen fired — opening modal"), y("body-profile"), h?.();
|
|
13035
13035
|
}, [h]), Gf = UA(() => {
|
|
13036
|
-
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), gA(null), FA(!1), aA(!1),
|
|
13036
|
+
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), gA(null), FA(!1), aA(!1), H.current = {}, zA("male"), Yf.current = !1, Df.current?.(), Df.current = null, IA.current && (clearInterval(IA.current), IA.current = null), W?.();
|
|
13037
13037
|
}, [W, V]), gg = UA(() => {
|
|
13038
13038
|
if (fA) {
|
|
13039
13039
|
NA(null), yA.current && (y(yA.current), yA.current = null);
|
|
@@ -13080,8 +13080,8 @@ function R8({
|
|
|
13080
13080
|
return;
|
|
13081
13081
|
}
|
|
13082
13082
|
sA(w), Jf.current = w;
|
|
13083
|
-
const
|
|
13084
|
-
s(
|
|
13083
|
+
const Q = URL.createObjectURL(w);
|
|
13084
|
+
s(Q), t?.(w), If.current = null, rP(Q).then((Y) => {
|
|
13085
13085
|
If.current = Y;
|
|
13086
13086
|
}).catch(() => {
|
|
13087
13087
|
});
|
|
@@ -13091,25 +13091,25 @@ function R8({
|
|
|
13091
13091
|
IA.current && (clearInterval(IA.current), IA.current = null), Df.current?.(), Df.current = null;
|
|
13092
13092
|
}, []), aP = UA((w) => {
|
|
13093
13093
|
if (w.status === "completed" && w.imageUrl) {
|
|
13094
|
-
if (RA((
|
|
13094
|
+
if (RA((Q) => !Q || Q.startsWith("data:") || !w.imageUrl.startsWith("data:") ? w.imageUrl : Q), !pf.current) {
|
|
13095
13095
|
if (pf.current = !0, nP.current = 100, mf.current && (mf.current.style.width = "100%"), Nf.current && (Nf.current.textContent = "100%"), yf.current && (yf.current.style.strokeDashoffset = "0"), Lf.current && (Lf.current.textContent = E("Done")), Sf.current) {
|
|
13096
|
-
const
|
|
13097
|
-
|
|
13098
|
-
|
|
13096
|
+
const Q = Sf.current;
|
|
13097
|
+
Q.style.opacity = "0", setTimeout(() => {
|
|
13098
|
+
Q.textContent = E("Complete!"), Q.style.opacity = "1";
|
|
13099
13099
|
}, 180);
|
|
13100
13100
|
}
|
|
13101
|
-
Wf(),
|
|
13101
|
+
Wf(), eA(!1), u?.({ jobId: w.galleryId, imageUrl: w.imageUrl });
|
|
13102
13102
|
}
|
|
13103
13103
|
} else if (w.status === "failed" && !pf.current) {
|
|
13104
|
-
pf.current = !0, Wf(),
|
|
13105
|
-
const
|
|
13106
|
-
dA(
|
|
13104
|
+
pf.current = !0, Wf(), eA(!1);
|
|
13105
|
+
const Q = w.error || E("Try-on generation failed");
|
|
13106
|
+
dA(Q), y("error"), v?.({ message: Q });
|
|
13107
13107
|
}
|
|
13108
|
-
}, [u, v, Wf]), Kf = wf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields :
|
|
13108
|
+
}, [u, v, Wf]), Kf = wf(() => $?.found && $.requiredFields && $.requiredFields.length > 0 ? $.requiredFields : oA === "female" ? Og : Kg, [$, oA]), Vf = UA(async (w) => {
|
|
13109
13109
|
if (!pA.current) return;
|
|
13110
|
-
const
|
|
13110
|
+
const Q = w || VA, Y = uf(B), wA = bf(), L = Xf(n);
|
|
13111
13111
|
if (L === "face" || L === "head") {
|
|
13112
|
-
const d =
|
|
13112
|
+
const d = H.current, b = (jA) => {
|
|
13113
13113
|
if (!jA) return;
|
|
13114
13114
|
const Af = parseFloat(jA);
|
|
13115
13115
|
return Number.isFinite(Af) && Af > 0 ? Af : void 0;
|
|
@@ -13156,38 +13156,38 @@ function R8({
|
|
|
13156
13156
|
return;
|
|
13157
13157
|
}
|
|
13158
13158
|
const Z = {
|
|
13159
|
-
method:
|
|
13159
|
+
method: Q,
|
|
13160
13160
|
locale: gf,
|
|
13161
13161
|
product: { title: n, productId: O, description: "", variants: [] }
|
|
13162
13162
|
};
|
|
13163
|
-
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:",
|
|
13164
|
-
const d = { gender:
|
|
13163
|
+
if ($?.found && (Z.sizeGuide = $, $.sections && (Z.sizeGuide = { ...$, sections: $.sections })), Z.sizingUnit = _, console.log("[PS-SDK] sizeGuide state:", JSON.stringify({ found: $?.found, hasHeaders: !!$?.headers, hasRows: !!$?.rows, headers: $?.headers, rowCount: $?.rows?.length, hasSections: !!$?.sections, sectionNames: $?.sections ? Object.keys($.sections) : [] })), console.log("[PS-SDK] payload.sizeGuide:", Z.sizeGuide ? "present" : "MISSING"), console.log("[PS-SDK] payload.sizeGuide row0 type:", Z.sizeGuide && Z.sizeGuide.rows?.[0] ? Array.isArray(Z.sizeGuide.rows[0]) ? "array" : typeof Z.sizeGuide.rows[0] : "none"), console.log("[PS-SDK] payload:", JSON.stringify(Z).substring(0, 1e3)), console.log("[PS-SDK] ── submitSizing START ──"), console.log("[PS-SDK] method:", Q, "| sizingUnit:", _, "| heightUnit:", WA), console.log("[PS-SDK] formRef.current (all keys):", JSON.stringify(H.current)), console.log("[PS-SDK] dynamicFields:", Kf.map((d) => `${d.key}(unit=${d.unit},req=${d.required})`).join(", ")), Q === "exact") {
|
|
13164
|
+
const d = { gender: H.current.gender || "male", sizingUnit: _ }, b = /* @__PURE__ */ new Set();
|
|
13165
13165
|
for (const HA of Kf)
|
|
13166
13166
|
HA.unit !== "size" && !["shoeEU", "shoeUS", "shoeUK"].includes(HA.key) && b.add(HA.key);
|
|
13167
13167
|
for (const HA of ["chest", "bust", "waist", "hips", "shoulderWidth", "sleeveLength", "inseam", "neckCircumference", "footLengthCm", "height", "length", "thighCircumference", "headCircumferenceCm", "faceWidthMm", "bridgeWidthMm", "templeLengthMm"])
|
|
13168
|
-
|
|
13168
|
+
H.current[HA] && b.add(HA);
|
|
13169
13169
|
console.log("[PS-SDK] numericKeys:", [...b].join(", "));
|
|
13170
13170
|
for (const HA of b) {
|
|
13171
|
-
const DA =
|
|
13171
|
+
const DA = H.current[HA];
|
|
13172
13172
|
if (!DA) continue;
|
|
13173
13173
|
const CA = parseFloat(DA);
|
|
13174
13174
|
isNaN(CA) || (d[HA] = CA);
|
|
13175
13175
|
}
|
|
13176
|
-
|
|
13176
|
+
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));
|
|
13177
13177
|
} else {
|
|
13178
|
-
const d = parseFloat(
|
|
13178
|
+
const d = parseFloat(H.current.height || "0"), b = parseFloat(H.current.weight || "0");
|
|
13179
13179
|
if (!d || !b) {
|
|
13180
|
-
console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(
|
|
13180
|
+
console.error("[PS-SDK] submitSizing ABORT — qHeight:", d, "qWeight:", b, "formRef:", JSON.stringify(H.current)), rA(!1);
|
|
13181
13181
|
return;
|
|
13182
13182
|
}
|
|
13183
13183
|
const HA = {
|
|
13184
13184
|
height: d,
|
|
13185
13185
|
weight: b,
|
|
13186
|
-
heightUnit:
|
|
13187
|
-
weightUnit:
|
|
13188
|
-
gender:
|
|
13186
|
+
heightUnit: H.current.heightUnit || WA || "cm",
|
|
13187
|
+
weightUnit: H.current.weightUnit || X || "kg",
|
|
13188
|
+
gender: H.current.gender || "male"
|
|
13189
13189
|
};
|
|
13190
|
-
|
|
13190
|
+
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;
|
|
13191
13191
|
}
|
|
13192
13192
|
xA(!1);
|
|
13193
13193
|
try {
|
|
@@ -13199,7 +13199,7 @@ function R8({
|
|
|
13199
13199
|
if (d.ok) {
|
|
13200
13200
|
const b = await d.json();
|
|
13201
13201
|
console.log("[PS-SDK] Sizing recommend RESULT:", JSON.stringify(b)), SA(b), u?.(b);
|
|
13202
|
-
const HA = Z.measurements || {}, DA = Z.quickEstimate || {}, CA =
|
|
13202
|
+
const HA = Z.measurements || {}, DA = Z.quickEstimate || {}, CA = Q === "exact" ? HA : DA;
|
|
13203
13203
|
Zf(
|
|
13204
13204
|
{
|
|
13205
13205
|
gender: CA.gender || "male",
|
|
@@ -13223,7 +13223,7 @@ function R8({
|
|
|
13223
13223
|
} finally {
|
|
13224
13224
|
rA(!1);
|
|
13225
13225
|
}
|
|
13226
|
-
}, [B, VA, gf, WA, X, _, $, n, Kf, Zf]), eg = UA(async (w,
|
|
13226
|
+
}, [B, VA, gf, WA, X, _, $, n, Kf, Zf]), eg = UA(async (w, Q, Y, wA, L, Z, d, b, HA, DA, CA) => {
|
|
13227
13227
|
if (!pA.current) {
|
|
13228
13228
|
const jA = E("SDK not configured. Please refresh and try again.");
|
|
13229
13229
|
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), dA(jA), y("error"), v?.({ message: jA, code: "SDK_NOT_CONFIGURED" });
|
|
@@ -13244,7 +13244,7 @@ function R8({
|
|
|
13244
13244
|
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"), rA(!0), y("size-result"), Vf("quick");
|
|
13245
13245
|
return;
|
|
13246
13246
|
}
|
|
13247
|
-
|
|
13247
|
+
H.current.height = String(w), H.current.weight = String(Q), H.current.heightUnit = Y, H.current.weightUnit = wA, H.current.gender = L, Z && (H.current.age = String(Z)), d && (H.current.bodyType = d), b && (H.current.chestProfile = b), HA && (H.current.midsectionProfile = HA), DA && (H.current.hipProfile = DA), SA(null), RA(null), kA("quick"), rA(!0), y("size-result"), Vf("quick");
|
|
13248
13248
|
}, [B, Kf, $, Vf, _, X]), dP = UA(async (w) => {
|
|
13249
13249
|
if (console.log("[ps-sdk] handleSnapSubmit fired", {
|
|
13250
13250
|
hasApiRef: !!pA.current,
|
|
@@ -13255,10 +13255,10 @@ function R8({
|
|
|
13255
13255
|
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), dA(DA), y("error"), v?.({ message: DA, code: "SDK_NOT_CONFIGURED" });
|
|
13256
13256
|
return;
|
|
13257
13257
|
}
|
|
13258
|
-
const
|
|
13259
|
-
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl:
|
|
13258
|
+
const Q = uf(B), Y = bf();
|
|
13259
|
+
console.log("[ps-sdk] handleSnapSubmit calling backend", { baseUrl: Q }), sA(w.photoFile), Jf.current = w.photoFile;
|
|
13260
13260
|
const wA = w.photoFile ? URL.createObjectURL(w.photoFile) : w.photoBase64.startsWith("data:") ? w.photoBase64 : `data:image/jpeg;base64,${w.photoBase64}`;
|
|
13261
|
-
s(wA), pf.current = !1,
|
|
13261
|
+
s(wA), pf.current = !1, eA(!1), SA(null), RA(null), rA(!0), xA(!1), y("size-result");
|
|
13262
13262
|
const L = Xf(n);
|
|
13263
13263
|
if (L === "face" || L === "head") {
|
|
13264
13264
|
LP(null);
|
|
@@ -13274,7 +13274,7 @@ function R8({
|
|
|
13274
13274
|
bodyImage: w.photoBase64
|
|
13275
13275
|
};
|
|
13276
13276
|
CA && (zf.faceMeasurementsMm = CA.measurementsMm, zf.faceLandmarks = CA.landmarks, zf.irisConfidence = CA.irisConfidence);
|
|
13277
|
-
const df = await fetch(`${
|
|
13277
|
+
const df = await fetch(`${Q}/api/v1/sizing/face-recommend`, {
|
|
13278
13278
|
method: "POST",
|
|
13279
13279
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${Y}` },
|
|
13280
13280
|
body: JSON.stringify(zf)
|
|
@@ -13329,7 +13329,7 @@ function R8({
|
|
|
13329
13329
|
};
|
|
13330
13330
|
$?.found && (HA.sizeGuide = $);
|
|
13331
13331
|
try {
|
|
13332
|
-
const DA = await fetch(`${
|
|
13332
|
+
const DA = await fetch(`${Q}/api/v1/sizing/recommend`, {
|
|
13333
13333
|
method: "POST",
|
|
13334
13334
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${Y}` },
|
|
13335
13335
|
body: JSON.stringify(HA)
|
|
@@ -13357,14 +13357,14 @@ function R8({
|
|
|
13357
13357
|
}, [B, f, n, _, X, gf, $, Kf, Zf]);
|
|
13358
13358
|
UP.current = dP;
|
|
13359
13359
|
const WP = UA(async (w) => {
|
|
13360
|
-
const
|
|
13361
|
-
if (!
|
|
13360
|
+
const Q = w || XA || Jf.current;
|
|
13361
|
+
if (!Q || !pA.current || !tf.current) {
|
|
13362
13362
|
const Z = pA.current ? E("Please upload a photo first.") : E("SDK not configured. Please provide an API key.");
|
|
13363
13363
|
dA(Z), y("error"), v?.({ message: Z, code: "SDK_NOT_CONFIGURED" });
|
|
13364
13364
|
return;
|
|
13365
13365
|
}
|
|
13366
|
-
w && w !== XA && (sA(w), Jf.current = w), pf.current = !1,
|
|
13367
|
-
const Y = En(Xf(n)), wA = Y === "apparel", L = (w ? null : V) || URL.createObjectURL(
|
|
13366
|
+
w && w !== XA && (sA(w), Jf.current = w), pf.current = !1, eA(!0);
|
|
13367
|
+
const Y = En(Xf(n)), wA = Y === "apparel", L = (w ? null : V) || URL.createObjectURL(Q);
|
|
13368
13368
|
(w || !V) && s(L), If.current = null, lf(null), wA && (rP(L).then((Z) => {
|
|
13369
13369
|
If.current = Z;
|
|
13370
13370
|
}).catch(() => {
|
|
@@ -13373,7 +13373,7 @@ function R8({
|
|
|
13373
13373
|
}).catch(() => {
|
|
13374
13374
|
}));
|
|
13375
13375
|
try {
|
|
13376
|
-
const Z = await AP(
|
|
13376
|
+
const Z = await AP(Q);
|
|
13377
13377
|
let d;
|
|
13378
13378
|
wA && vA?.matchDetails?.length && (d = xg(vA.matchDetails, If.current));
|
|
13379
13379
|
const b = await pA.current.submitTryOn(
|
|
@@ -13411,7 +13411,7 @@ function R8({
|
|
|
13411
13411
|
}, [XA, f, n, vA, k, v, aP]), og = UA(async (w) => {
|
|
13412
13412
|
if (!XA || !pA.current || !tf.current) return;
|
|
13413
13413
|
EA(!0);
|
|
13414
|
-
const
|
|
13414
|
+
const Q = En(Xf(n)), Y = Q === "apparel";
|
|
13415
13415
|
if (Y && If.current) {
|
|
13416
13416
|
const wA = {
|
|
13417
13417
|
chest: "chest",
|
|
@@ -13434,7 +13434,7 @@ function R8({
|
|
|
13434
13434
|
wA,
|
|
13435
13435
|
f,
|
|
13436
13436
|
L,
|
|
13437
|
-
|
|
13437
|
+
Q ?? "apparel",
|
|
13438
13438
|
{
|
|
13439
13439
|
productId: O,
|
|
13440
13440
|
productTitle: n,
|
|
@@ -13470,41 +13470,41 @@ function R8({
|
|
|
13470
13470
|
w.href = PA, w.download = `primestyle-tryon-${Date.now()}.png`, w.click();
|
|
13471
13471
|
} else
|
|
13472
13472
|
fetch(PA).then((w) => w.blob()).then((w) => {
|
|
13473
|
-
const
|
|
13474
|
-
Y.href =
|
|
13473
|
+
const Q = URL.createObjectURL(w), Y = document.createElement("a");
|
|
13474
|
+
Y.href = Q, Y.download = `primestyle-tryon-${Date.now()}.png`, Y.click(), setTimeout(() => URL.revokeObjectURL(Q), 100);
|
|
13475
13475
|
}).catch(() => window.open(PA, "_blank"));
|
|
13476
13476
|
}, [PA]), vg = UA(() => {
|
|
13477
13477
|
pf.current = !1, Wf(), sA(null), V && URL.revokeObjectURL(V), s(null), RA(null), dA(null), kA(null), SA(null), rA(!1), aA(!1), y("body-profile");
|
|
13478
13478
|
}, [V, Wf]), Dg = UA((w) => {
|
|
13479
|
-
const
|
|
13480
|
-
if (!
|
|
13479
|
+
const Q = OA.find((wA) => wA.id === w);
|
|
13480
|
+
if (!Q) return;
|
|
13481
13481
|
G(w), AA((wA) => wA.map((L) => L.id === w ? { ...L, lastUsedAt: Date.now() } : L));
|
|
13482
|
-
const Y = { gender:
|
|
13483
|
-
if ((
|
|
13484
|
-
for (const [wA, L] of Object.entries(
|
|
13482
|
+
const Y = { gender: Q.gender || "male" };
|
|
13483
|
+
if ((Q.height ?? Q.heightCm) && (Y.height = String(Q.height ?? Q.heightCm)), (Q.weight ?? Q.weightKg) && (Y.weight = String(Q.weight ?? Q.weightKg)), Q.chest && (Y.chest = String(Q.chest)), Q.bust && (Y.bust = String(Q.bust)), Q.waist && (Y.waist = String(Q.waist)), Q.hips && (Y.hips = String(Q.hips)), Q.shoulderWidth && (Y.shoulderWidth = String(Q.shoulderWidth)), Q.sleeveLength && (Y.sleeveLength = String(Q.sleeveLength)), Q.inseam && (Y.inseam = String(Q.inseam)), Q.neckCircumference && (Y.neckCircumference = String(Q.neckCircumference)), Q.footLengthCm && (Y.footLengthCm = String(Q.footLengthCm)), Q.shoeEU && (Y.shoeEU = Q.shoeEU), Q.shoeUS && (Y.shoeUS = Q.shoeUS), Q.shoeUK && (Y.shoeUK = Q.shoeUK), Q.fitPreference && (Y.fitPreference = Q.fitPreference), Q.customMeasurements)
|
|
13484
|
+
for (const [wA, L] of Object.entries(Q.customMeasurements))
|
|
13485
13485
|
Y[wA] = String(L);
|
|
13486
|
-
|
|
13486
|
+
H.current = Y, zA(Y.gender || "male"), Q.country && qA(Q.country), Q.sizingUnit && uA(Q.sizingUnit), Q.heightUnit && a(Q.heightUnit), Q.weightUnit && nA(Q.weightUnit), of((wA) => wA + 1);
|
|
13487
13487
|
}, [OA]);
|
|
13488
|
-
Pg.current = Dg, UA((w,
|
|
13489
|
-
const Y = (
|
|
13488
|
+
Pg.current = Dg, UA((w, Q) => {
|
|
13489
|
+
const Y = (Q ? null : lA) || `p_${Date.now()}`, wA = {
|
|
13490
13490
|
id: Y,
|
|
13491
13491
|
name: w,
|
|
13492
|
-
gender:
|
|
13493
|
-
height:
|
|
13494
|
-
weight:
|
|
13495
|
-
chest:
|
|
13496
|
-
bust:
|
|
13497
|
-
waist:
|
|
13498
|
-
hips:
|
|
13499
|
-
shoulderWidth:
|
|
13500
|
-
sleeveLength:
|
|
13501
|
-
inseam:
|
|
13502
|
-
neckCircumference:
|
|
13503
|
-
footLengthCm:
|
|
13504
|
-
shoeEU:
|
|
13505
|
-
shoeUS:
|
|
13506
|
-
shoeUK:
|
|
13507
|
-
fitPreference:
|
|
13492
|
+
gender: H.current.gender || "male",
|
|
13493
|
+
height: H.current.height ? parseFloat(H.current.height) : void 0,
|
|
13494
|
+
weight: H.current.weight ? parseFloat(H.current.weight) : void 0,
|
|
13495
|
+
chest: H.current.chest ? parseFloat(H.current.chest) : void 0,
|
|
13496
|
+
bust: H.current.bust ? parseFloat(H.current.bust) : void 0,
|
|
13497
|
+
waist: H.current.waist ? parseFloat(H.current.waist) : void 0,
|
|
13498
|
+
hips: H.current.hips ? parseFloat(H.current.hips) : void 0,
|
|
13499
|
+
shoulderWidth: H.current.shoulderWidth ? parseFloat(H.current.shoulderWidth) : void 0,
|
|
13500
|
+
sleeveLength: H.current.sleeveLength ? parseFloat(H.current.sleeveLength) : void 0,
|
|
13501
|
+
inseam: H.current.inseam ? parseFloat(H.current.inseam) : void 0,
|
|
13502
|
+
neckCircumference: H.current.neckCircumference ? parseFloat(H.current.neckCircumference) : void 0,
|
|
13503
|
+
footLengthCm: H.current.footLengthCm ? parseFloat(H.current.footLengthCm) : void 0,
|
|
13504
|
+
shoeEU: H.current.shoeEU,
|
|
13505
|
+
shoeUS: H.current.shoeUS,
|
|
13506
|
+
shoeUK: H.current.shoeUK,
|
|
13507
|
+
fitPreference: H.current.fitPreference,
|
|
13508
13508
|
country: gf,
|
|
13509
13509
|
sizingUnit: _,
|
|
13510
13510
|
heightUnit: WA,
|
|
@@ -13530,7 +13530,7 @@ function R8({
|
|
|
13530
13530
|
"heightFeet",
|
|
13531
13531
|
"heightInches"
|
|
13532
13532
|
]), Z = {};
|
|
13533
|
-
for (const [d, b] of Object.entries(
|
|
13533
|
+
for (const [d, b] of Object.entries(H.current))
|
|
13534
13534
|
!L.has(d) && b && !isNaN(Number(b)) && (Z[d] = parseFloat(b));
|
|
13535
13535
|
Object.keys(Z).length > 0 && (wA.customMeasurements = Z), AA((d) => {
|
|
13536
13536
|
const b = d.findIndex((HA) => HA.id === Y);
|
|
@@ -13564,10 +13564,10 @@ function R8({
|
|
|
13564
13564
|
date: Date.now()
|
|
13565
13565
|
};
|
|
13566
13566
|
if (lA) {
|
|
13567
|
-
const
|
|
13568
|
-
|
|
13567
|
+
const Q = OA.find((Y) => Y.id === lA);
|
|
13568
|
+
Q && (w.profileName = Q.name);
|
|
13569
13569
|
}
|
|
13570
|
-
Pf((
|
|
13570
|
+
Pf((Q) => [w, ...Q].slice(0, 50));
|
|
13571
13571
|
}, [n, f, PA, vA, $, lA, OA]), Yf = iA(!1), gP = iA(!1);
|
|
13572
13572
|
JA(() => {
|
|
13573
13573
|
l === "size-result" && vA && !Yf.current ? (Yf.current = !0, gP.current = !1, VP()) : l === "size-result" && vA && PA && !gP.current ? (gP.current = !0, Pf((w) => w.length === 0 ? w : [{ ...w[0], resultImageUrl: PA }, ...w.slice(1)])) : l === "result" && PA && !Yf.current ? (Yf.current = !0, VP()) : (l === "welcome" || l === "body-profile") && (Yf.current = !1, gP.current = !1);
|
|
@@ -13579,34 +13579,34 @@ function R8({
|
|
|
13579
13579
|
reasoning: w.reasoning || "",
|
|
13580
13580
|
internationalSizes: w.internationalSizes,
|
|
13581
13581
|
matchDetails: w.matchDetails
|
|
13582
|
-
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1),
|
|
13583
|
-
}, []), ig = UA((w,
|
|
13584
|
-
|
|
13582
|
+
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), rA(!1), eA(!1), bA(null), NA(null), y("size-result");
|
|
13583
|
+
}, []), ig = UA((w, Q) => {
|
|
13584
|
+
H.current[w] = Q;
|
|
13585
13585
|
}, []);
|
|
13586
13586
|
wf(() => {
|
|
13587
|
-
const
|
|
13587
|
+
const Q = {
|
|
13588
13588
|
US: { key: "shoeUS", labelKey: "Shoe size (US)", ph: "e.g. 10" },
|
|
13589
13589
|
UK: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" },
|
|
13590
13590
|
AU: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" }
|
|
13591
13591
|
}[gf] || { key: "shoeEU", labelKey: "Shoe size (EU)", ph: "e.g. 43" };
|
|
13592
|
-
return { key:
|
|
13592
|
+
return { key: Q.key, label: E(Q.labelKey), ph: Q.ph };
|
|
13593
13593
|
}, [gf, E]);
|
|
13594
13594
|
const tg = {
|
|
13595
|
-
"--ps-btn-bg":
|
|
13596
|
-
"--ps-btn-color":
|
|
13597
|
-
"--ps-btn-radius":
|
|
13598
|
-
"--ps-btn-font-size":
|
|
13599
|
-
"--ps-btn-font":
|
|
13600
|
-
"--ps-btn-font-weight":
|
|
13601
|
-
"--ps-btn-padding":
|
|
13602
|
-
"--ps-btn-border":
|
|
13603
|
-
"--ps-btn-width":
|
|
13604
|
-
"--ps-btn-height":
|
|
13605
|
-
"--ps-btn-hover-bg":
|
|
13606
|
-
"--ps-btn-hover-color":
|
|
13607
|
-
"--ps-btn-icon-size":
|
|
13608
|
-
"--ps-btn-icon-color":
|
|
13609
|
-
"--ps-btn-shadow":
|
|
13595
|
+
"--ps-btn-bg": r.backgroundColor,
|
|
13596
|
+
"--ps-btn-color": r.textColor,
|
|
13597
|
+
"--ps-btn-radius": r.borderRadius,
|
|
13598
|
+
"--ps-btn-font-size": r.fontSize,
|
|
13599
|
+
"--ps-btn-font": r.fontFamily,
|
|
13600
|
+
"--ps-btn-font-weight": r.fontWeight,
|
|
13601
|
+
"--ps-btn-padding": r.padding,
|
|
13602
|
+
"--ps-btn-border": r.border,
|
|
13603
|
+
"--ps-btn-width": r.width,
|
|
13604
|
+
"--ps-btn-height": r.height,
|
|
13605
|
+
"--ps-btn-hover-bg": r.hoverBackgroundColor,
|
|
13606
|
+
"--ps-btn-hover-color": r.hoverTextColor,
|
|
13607
|
+
"--ps-btn-icon-size": r.iconSize,
|
|
13608
|
+
"--ps-btn-icon-color": r.iconColor,
|
|
13609
|
+
"--ps-btn-shadow": r.boxShadow,
|
|
13610
13610
|
"--ps-modal-overlay": z.overlayColor,
|
|
13611
13611
|
"--ps-modal-bg": z.backgroundColor,
|
|
13612
13612
|
"--ps-modal-color": z.textColor,
|
|
@@ -13630,8 +13630,8 @@ function R8({
|
|
|
13630
13630
|
// accentColor falls back to the trigger button background so the user's
|
|
13631
13631
|
// brand color cascades to the modal automatically without having to pass
|
|
13632
13632
|
// both buttonStyles AND modalStyles. Most consumers only set buttonStyles.
|
|
13633
|
-
"--ps-accent": z.accentColor ??
|
|
13634
|
-
"--ps-accent-hover": z.accentHoverColor ??
|
|
13633
|
+
"--ps-accent": z.accentColor ?? r.backgroundColor,
|
|
13634
|
+
"--ps-accent-hover": z.accentHoverColor ?? r.hoverBackgroundColor,
|
|
13635
13635
|
"--ps-accent-light": z.accentLightColor,
|
|
13636
13636
|
"--ps-text-primary": z.textPrimaryColor,
|
|
13637
13637
|
"--ps-text-secondary": z.textSecondaryColor,
|
|
@@ -13647,10 +13647,10 @@ function R8({
|
|
|
13647
13647
|
case "welcome":
|
|
13648
13648
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(BB, { productImage: f, setView: y, t: E }) }, "v-welcome");
|
|
13649
13649
|
case "body-profile": {
|
|
13650
|
-
const w = Xf(n),
|
|
13651
|
-
if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...
|
|
13652
|
-
if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...
|
|
13653
|
-
if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...
|
|
13650
|
+
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit: uA, setSizingMethod: kA, setSizingLoading: rA, setView: y, submitSizing: Vf, onSnapSubmit: dP, onBack: Gf, sizeGuide: $, t: E };
|
|
13651
|
+
if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...Q }) }, "v-foot");
|
|
13652
|
+
if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...Q }) }, "v-head");
|
|
13653
|
+
if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...Q }) }, "v-face");
|
|
13654
13654
|
const Y = !!($?.requiredFields?.some((d) => d.key === "bust") || $?.sections && Object.values($.sections).some((d) => d.requiredFields?.some((b) => b.key === "bust"))), wA = n.toLowerCase(), L = /\b(women|woman|ladies|female|dress|skirt|blouse|bra)\b/i.test(wA);
|
|
13655
13655
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
13656
13656
|
z8,
|
|
@@ -13658,7 +13658,7 @@ function R8({
|
|
|
13658
13658
|
productImage: f,
|
|
13659
13659
|
productTitle: n,
|
|
13660
13660
|
isWomen: Y || L,
|
|
13661
|
-
formRef:
|
|
13661
|
+
formRef: H,
|
|
13662
13662
|
sizingCountry: gf,
|
|
13663
13663
|
heightUnit: WA,
|
|
13664
13664
|
setHeightUnit: a,
|
|
@@ -13676,10 +13676,10 @@ function R8({
|
|
|
13676
13676
|
activeProfileName: OA.find((b) => b.id === lA)?.name || null,
|
|
13677
13677
|
activeProfile: OA.find((d) => d.id === lA) || null,
|
|
13678
13678
|
onStartFresh: () => {
|
|
13679
|
-
G(null),
|
|
13679
|
+
G(null), H.current = {};
|
|
13680
13680
|
},
|
|
13681
13681
|
onComplete: (d) => {
|
|
13682
|
-
|
|
13682
|
+
H.current.gender = d.gender, d.bandSize && (H.current.bandSize = d.bandSize), d.cupSize && (H.current.cupSize = d.cupSize), eg(
|
|
13683
13683
|
d.height,
|
|
13684
13684
|
d.weight,
|
|
13685
13685
|
d.heightUnit,
|
|
@@ -13709,8 +13709,8 @@ function R8({
|
|
|
13709
13709
|
estimatedValues: J,
|
|
13710
13710
|
estimationLoading: Bf,
|
|
13711
13711
|
dynamicFields: Kf,
|
|
13712
|
-
formRef:
|
|
13713
|
-
formGender:
|
|
13712
|
+
formRef: H,
|
|
13713
|
+
formGender: oA,
|
|
13714
13714
|
formKey: YA,
|
|
13715
13715
|
setFormKey: of,
|
|
13716
13716
|
sizingUnit: _,
|
|
@@ -13757,10 +13757,10 @@ function R8({
|
|
|
13757
13757
|
userHeightCm: (() => {
|
|
13758
13758
|
const w = OA.find((L) => L.id === lA);
|
|
13759
13759
|
if (!w) return;
|
|
13760
|
-
const
|
|
13761
|
-
if (!
|
|
13760
|
+
const Q = w.height ?? w.heightCm;
|
|
13761
|
+
if (!Q || Q <= 0) return;
|
|
13762
13762
|
const Y = w.heightUnit, wA = vA?.unit || _;
|
|
13763
|
-
return (Y === "in" || Y === "ft") && wA !== "in" ? Math.round(
|
|
13763
|
+
return (Y === "in" || Y === "ft") && wA !== "in" ? Math.round(Q * 2.54) : (!Y || Y === "cm") && wA === "in" ? Math.round(Q / 2.54 * 10) / 10 : Q;
|
|
13764
13764
|
})(),
|
|
13765
13765
|
t: E
|
|
13766
13766
|
}
|
|
@@ -13808,25 +13808,25 @@ function R8({
|
|
|
13808
13808
|
onSelectProfile: (w) => {
|
|
13809
13809
|
G(w), y("body-profile");
|
|
13810
13810
|
},
|
|
13811
|
-
onSaveProfileMeasurements: (w,
|
|
13812
|
-
FP(w,
|
|
13811
|
+
onSaveProfileMeasurements: (w, Q, Y) => {
|
|
13812
|
+
FP(w, Q, Y ?? OA.find((wA) => wA.id === w)?.measurementsUnit ?? "cm"), AA(af("profiles", []));
|
|
13813
13813
|
},
|
|
13814
|
-
onSaveBraSize: (w,
|
|
13815
|
-
sn(w, { bandSize:
|
|
13814
|
+
onSaveBraSize: (w, Q, Y) => {
|
|
13815
|
+
sn(w, { bandSize: Q, cupSize: Y }), AA(af("profiles", []));
|
|
13816
13816
|
},
|
|
13817
13817
|
onEditProfile: (w) => {
|
|
13818
13818
|
ef(w);
|
|
13819
13819
|
},
|
|
13820
13820
|
onPhotoPreview: (w) => {
|
|
13821
13821
|
if (w) {
|
|
13822
|
-
const
|
|
13823
|
-
s(
|
|
13822
|
+
const Q = w.startsWith("data:") ? w : `data:image/jpeg;base64,${w}`;
|
|
13823
|
+
s(Q);
|
|
13824
13824
|
} else
|
|
13825
13825
|
s(null);
|
|
13826
13826
|
},
|
|
13827
13827
|
onEstimateFromPhoto: async (w) => {
|
|
13828
13828
|
try {
|
|
13829
|
-
const
|
|
13829
|
+
const Q = await eP(w.photoBase64).catch(() => null), Y = await MP({
|
|
13830
13830
|
apiUrl: B,
|
|
13831
13831
|
height: w.height > 0 ? w.height : void 0,
|
|
13832
13832
|
weight: w.weight > 0 ? w.weight : void 0,
|
|
@@ -13835,7 +13835,7 @@ function R8({
|
|
|
13835
13835
|
gender: w.gender,
|
|
13836
13836
|
age: w.age,
|
|
13837
13837
|
bodyImage: w.photoBase64,
|
|
13838
|
-
bodyLandmarks:
|
|
13838
|
+
bodyLandmarks: Q ?? void 0
|
|
13839
13839
|
});
|
|
13840
13840
|
return Y ? { estimates: Y.estimates, unit: Y.unit } : null;
|
|
13841
13841
|
} catch {
|
|
@@ -13843,31 +13843,31 @@ function R8({
|
|
|
13843
13843
|
}
|
|
13844
13844
|
},
|
|
13845
13845
|
onSaveNewProfile: async (w) => {
|
|
13846
|
-
const
|
|
13846
|
+
const Q = {
|
|
13847
13847
|
...w,
|
|
13848
13848
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
13849
13849
|
createdAt: Date.now(),
|
|
13850
13850
|
lastUsedAt: Date.now()
|
|
13851
|
-
}, Y = [
|
|
13852
|
-
sf("profiles", Y), AA(Y), G(
|
|
13853
|
-
const wA =
|
|
13854
|
-
!(!!
|
|
13851
|
+
}, Y = [Q, ...OA];
|
|
13852
|
+
sf("profiles", Y), AA(Y), G(Q.id);
|
|
13853
|
+
const wA = Q.heightCm || Q.height || 0, L = Q.weightKg || Q.weight || 0, Z = Q.sizingUnit === "in" ? "in" : "cm", d = Q.sizingUnit === "in" ? "lbs" : "kg", b = Q.photoBase64;
|
|
13854
|
+
!(!!Q.measurements && Object.keys(Q.measurements).length > 0) && (b || wA > 0 && L > 0) && (QA((CA) => new Set(CA).add(Q.id)), (b ? eP(b).catch(() => null) : Promise.resolve(null)).then((CA) => MP({
|
|
13855
13855
|
apiUrl: B,
|
|
13856
13856
|
height: wA > 0 ? wA : void 0,
|
|
13857
13857
|
weight: L > 0 ? L : void 0,
|
|
13858
13858
|
heightUnit: Z,
|
|
13859
13859
|
weightUnit: d,
|
|
13860
|
-
gender:
|
|
13861
|
-
age:
|
|
13862
|
-
chestProfile:
|
|
13863
|
-
midsectionProfile:
|
|
13864
|
-
hipProfile:
|
|
13860
|
+
gender: Q.gender,
|
|
13861
|
+
age: Q.age,
|
|
13862
|
+
chestProfile: Q.chestProfile,
|
|
13863
|
+
midsectionProfile: Q.midsectionProfile,
|
|
13864
|
+
hipProfile: Q.hipProfile,
|
|
13865
13865
|
bodyImage: b,
|
|
13866
13866
|
bodyLandmarks: CA ?? void 0
|
|
13867
13867
|
})).then((CA) => {
|
|
13868
13868
|
if (CA) {
|
|
13869
|
-
if (FP(
|
|
13870
|
-
const zf = af("profiles", []), df = zf.findIndex((Cf) => Cf.id ===
|
|
13869
|
+
if (FP(Q.id, CA.estimates, CA.unit), CA.userEstimates) {
|
|
13870
|
+
const zf = af("profiles", []), df = zf.findIndex((Cf) => Cf.id === Q.id);
|
|
13871
13871
|
if (df >= 0) {
|
|
13872
13872
|
const Cf = zf[df], jA = CA.userEstimates, Af = { ...Cf };
|
|
13873
13873
|
jA.height && !(Cf.height || Cf.heightCm) && (Af.height = jA.height, Af.heightCm = jA.height, Af.heightUnit = "cm"), jA.weight && !(Cf.weight || Cf.weightKg) && (Af.weight = jA.weight, Af.weightKg = jA.weight, Af.weightUnit = "kg"), jA.age && !Cf.age && (Af.age = jA.age), zf[df] = Af, sf("profiles", zf);
|
|
@@ -13879,12 +13879,12 @@ function R8({
|
|
|
13879
13879
|
}).finally(() => {
|
|
13880
13880
|
QA((CA) => {
|
|
13881
13881
|
const zf = new Set(CA);
|
|
13882
|
-
return zf.delete(
|
|
13882
|
+
return zf.delete(Q.id), zf;
|
|
13883
13883
|
});
|
|
13884
13884
|
}));
|
|
13885
13885
|
},
|
|
13886
13886
|
onDeleteProfile: (w) => {
|
|
13887
|
-
AA((
|
|
13887
|
+
AA((Q) => Q.filter((Y) => Y.id !== w)), lA === w && G(null), sf("profiles", af("profiles", []).filter((Q) => Q.id !== w));
|
|
13888
13888
|
},
|
|
13889
13889
|
onRequestDelete: (w) => R(w),
|
|
13890
13890
|
onClose: () => y("body-profile"),
|
|
@@ -13962,8 +13962,8 @@ function R8({
|
|
|
13962
13962
|
f8,
|
|
13963
13963
|
{
|
|
13964
13964
|
onConfirm: () => {
|
|
13965
|
-
const w = U,
|
|
13966
|
-
sf("profiles",
|
|
13965
|
+
const w = U, Q = af("profiles", []).filter((Y) => Y.id !== w);
|
|
13966
|
+
sf("profiles", Q), AA(Q), lA === w && G(null), R(null);
|
|
13967
13967
|
},
|
|
13968
13968
|
onCancel: () => R(null),
|
|
13969
13969
|
t: E
|
|
@@ -14000,21 +14000,21 @@ function T8(f) {
|
|
|
14000
14000
|
function G8(f) {
|
|
14001
14001
|
const [n, g] = j(null), [e, B] = j(!0), [C, D] = j(!1), [i, o] = j(0);
|
|
14002
14002
|
return JA(() => {
|
|
14003
|
-
let
|
|
14003
|
+
let r = !1;
|
|
14004
14004
|
return B(!0), D(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: f.productId }), Gn(f).then((z) => {
|
|
14005
|
-
|
|
14005
|
+
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)));
|
|
14006
14006
|
}).catch((z) => {
|
|
14007
|
-
console.log("[ps-sdk:hook] usePrimeStyleSize threw", z),
|
|
14007
|
+
console.log("[ps-sdk:hook] usePrimeStyleSize threw", z), r || g(null);
|
|
14008
14008
|
}).finally(() => {
|
|
14009
|
-
|
|
14009
|
+
r || B(!1);
|
|
14010
14010
|
}), () => {
|
|
14011
|
-
|
|
14011
|
+
r = !0;
|
|
14012
14012
|
};
|
|
14013
14013
|
}, [f.productId, f.apiUrl, f.apiKey, i]), JA(() => {
|
|
14014
14014
|
if (typeof window > "u") return;
|
|
14015
|
-
const
|
|
14016
|
-
return window.addEventListener(fP,
|
|
14017
|
-
window.removeEventListener(fP,
|
|
14015
|
+
const r = () => o((z) => z + 1);
|
|
14016
|
+
return window.addEventListener(fP, r), window.addEventListener("storage", r), () => {
|
|
14017
|
+
window.removeEventListener(fP, r), window.removeEventListener("storage", r);
|
|
14018
14018
|
};
|
|
14019
14019
|
}, []), {
|
|
14020
14020
|
recommendedSize: n?.recommendedSize ?? null,
|
|
@@ -14022,7 +14022,7 @@ function G8(f) {
|
|
|
14022
14022
|
loading: e,
|
|
14023
14023
|
noProfile: C,
|
|
14024
14024
|
result: n,
|
|
14025
|
-
refetch: () => o((
|
|
14025
|
+
refetch: () => o((r) => r + 1)
|
|
14026
14026
|
};
|
|
14027
14027
|
}
|
|
14028
14028
|
export {
|