@primestyleai/tryon 5.10.15 → 5.10.17
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 +611 -605
- package/dist/react/index.js.map +1 -1
- package/dist/storefront/primestyle-tryon.js +13 -8
- package/package.json +1 -1
package/dist/react/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { P as an, L as _P, b as Qg, a as AP, c as Hg, A as zg, S as cg, i as pg } from "../index-DcgOUANg.js";
|
|
3
|
-
import { jsxs as P, jsx as A, Fragment as
|
|
4
|
-
import { useState as j, useRef as
|
|
3
|
+
import { jsxs as P, jsx as A, Fragment as rA } from "react/jsx-runtime";
|
|
4
|
+
import { useState as j, useRef as tA, useCallback as UA, useEffect as JA, useMemo as vf } from "react";
|
|
5
5
|
import { createPortal as lP } from "react-dom";
|
|
6
6
|
const sP = 11, TP = 12, An = 13, fn = 14, Pn = 15, nn = 16, GP = 23, YP = 24, gn = 25, Bn = 26, en = 27, on = 28, wn = 0;
|
|
7
7
|
let HP = null, BP = null;
|
|
@@ -31,11 +31,11 @@ async function rP(f) {
|
|
|
31
31
|
const n = await Fn(f), g = HP.detect(n);
|
|
32
32
|
if (!g?.landmarks?.length || g.landmarks[0].length < 25)
|
|
33
33
|
return null;
|
|
34
|
-
const e = g.landmarks[0], B = e[sP], C = e[TP], D = e[GP], 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 =
|
|
6789
|
+
const [g, e] = j(!1), B = tA(null), C = tA(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(rA, { 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(rA, { children: [
|
|
7006
7006
|
/* @__PURE__ */ P("button", { className: "ps-tryon-drawer-create", onClick: () => z(!0), children: [
|
|
7007
7007
|
"+ ",
|
|
7008
7008
|
o("Create New Profile")
|
|
@@ -7020,7 +7020,7 @@ function PB({
|
|
|
7020
7020
|
] }),
|
|
7021
7021
|
/* @__PURE__ */ A(mg, {})
|
|
7022
7022
|
] }, F.id))
|
|
7023
|
-
] }) : /* @__PURE__ */ A(
|
|
7023
|
+
] }) : /* @__PURE__ */ A(rA, { children: B.length === 0 ? /* @__PURE__ */ A("div", { className: "ps-tryon-drawer-empty", children: o("No history yet.") }) : /* @__PURE__ */ P(rA, { children: [
|
|
7024
7024
|
B.map((F, h) => /* @__PURE__ */ P("div", { className: "ps-tryon-history-item ps-tryon-history-clickable", onClick: () => i(F), children: [
|
|
7025
7025
|
/* @__PURE__ */ P("div", { className: "ps-tryon-history-images", children: [
|
|
7026
7026
|
F.productImage && /* @__PURE__ */ A("img", { src: F.productImage, alt: "", className: "ps-tryon-history-thumb" }),
|
|
@@ -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: "←" }),
|
|
@@ -7401,12 +7401,12 @@ function CB({ landmarks: f, w: n, h: g }) {
|
|
|
7401
7401
|
}
|
|
7402
7402
|
const wP = 22, bP = 27, IP = 2 * Math.PI * bP;
|
|
7403
7403
|
function iB({ t: f }) {
|
|
7404
|
-
const n =
|
|
7404
|
+
const n = tA(Date.now()), g = tA(null), e = tA(null), B = tA(null), C = tA(null);
|
|
7405
7405
|
return JA(() => {
|
|
7406
7406
|
n.current = Date.now();
|
|
7407
7407
|
const D = setInterval(() => {
|
|
7408
|
-
const 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,
|
|
@@ -7540,7 +7540,7 @@ function HB({
|
|
|
7540
7540
|
onImageLoad: W,
|
|
7541
7541
|
t
|
|
7542
7542
|
}) {
|
|
7543
|
-
const k =
|
|
7543
|
+
const k = vf(() => {
|
|
7544
7544
|
const I = [...g?.matchDetails || []];
|
|
7545
7545
|
if (g?.sections)
|
|
7546
7546
|
for (const O of Object.values(g.sections))
|
|
@@ -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
|
{
|
|
@@ -7684,7 +7684,7 @@ const zB = [
|
|
|
7684
7684
|
["rightKnee", "rightAnkle"]
|
|
7685
7685
|
], vP = 22, uP = 27, RP = 2 * Math.PI * uP;
|
|
7686
7686
|
function kn({ t: f, isActive: n }) {
|
|
7687
|
-
const g =
|
|
7687
|
+
const g = tA(null), e = tA(null), B = tA(null), C = tA(null), D = tA(null);
|
|
7688
7688
|
return JA(() => {
|
|
7689
7689
|
if (!n) {
|
|
7690
7690
|
g.current = null;
|
|
@@ -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
|
-
const
|
|
7925
|
-
return !!(
|
|
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" ? "
|
|
7924
|
+
const EA = mA.area.toLowerCase().trim();
|
|
7925
|
+
return !!(EA === T || T === "chest" && (EA.includes("bust") || EA.includes("chest")) || T === "waist" && EA.includes("waist") || T === "hips" && (EA.includes("hip") || EA === "hips"));
|
|
7926
|
+
}), 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,
|
|
@@ -8056,38 +8056,38 @@ function DP({
|
|
|
8056
8056
|
renderRaw: N = !1,
|
|
8057
8057
|
sectionFound: K
|
|
8058
8058
|
}) {
|
|
8059
|
-
const E = g?.recommendedSize || "", [BA, c] = j(null), hA = B.toLowerCase(), l = hA.includes("mm") ? "mm" : hA.includes("cm") ? "cm" : "in", y = C || l, XA = (a) => hn(a, y, l), sA = (a) => UB(a, y, l), V = I ? Object.keys(I) : [], [s, PA] = j(null), RA = D?.secResult?.recommendedSize || "", [mA,
|
|
8059
|
+
const E = g?.recommendedSize || "", [BA, c] = j(null), hA = B.toLowerCase(), l = hA.includes("mm") ? "mm" : hA.includes("cm") ? "cm" : "in", y = C || l, XA = (a) => hn(a, y, l), sA = (a) => UB(a, y, l), V = I ? Object.keys(I) : [], [s, PA] = j(null), RA = D?.secResult?.recommendedSize || "", [mA, EA] = j(null), ZA = vf(() => {
|
|
8060
8060
|
if (!D) return [];
|
|
8061
|
-
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(
|
|
8063
|
-
}, [D]), Hf =
|
|
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
|
+
}, [D]), Hf = vf(() => {
|
|
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
|
|
8075
|
-
}, [D]), m =
|
|
8074
|
+
return H;
|
|
8075
|
+
}, [D]), m = vf(() => {
|
|
8076
8076
|
const a = n.headers.findIndex((X) => /size|taglia|größe|taille/i.test(X.trim()));
|
|
8077
8077
|
if (a >= 0) return a;
|
|
8078
8078
|
for (let X = 0; X < n.headers.length; X++) {
|
|
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
|
-
}, [n]),
|
|
8084
|
-
const a = n.rows.map((X) => Uf(X, m,
|
|
8083
|
+
}, [n]), aA = n.headers[m] || "Size", TA = vf(() => {
|
|
8084
|
+
const a = n.rows.map((X) => Uf(X, m, aA)).filter(Boolean);
|
|
8085
8085
|
return [...new Set(a)];
|
|
8086
|
-
}, [n, m,
|
|
8086
|
+
}, [n, m, aA]), bA = BA || E, VA = bA === E, kA = vf(() => {
|
|
8087
8087
|
if (VA) return null;
|
|
8088
|
-
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
|
-
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA =
|
|
8090
|
+
}, [VA, g, o]), vA = s && VA && I && I[s] ? I[s] : bA, SA = vf(() => {
|
|
8091
8091
|
const a = [];
|
|
8092
8092
|
for (let X = 0; X < n.headers.length; X++) {
|
|
8093
8093
|
const nA = (n.headers[X] || "").toLowerCase();
|
|
@@ -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,27 +8128,27 @@ 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
|
-
const
|
|
8134
|
-
let gA = n.rows.find((AA) => Uf(AA, m,
|
|
8135
|
-
if (gA || (gA = n.rows.find((AA) => Uf(AA, m,
|
|
8136
|
-
const LA = Uf(AA, m,
|
|
8133
|
+
const wf = n.headers[YA], J = X.trim().toLowerCase();
|
|
8134
|
+
let gA = n.rows.find((AA) => Uf(AA, m, aA) === X);
|
|
8135
|
+
if (gA || (gA = n.rows.find((AA) => Uf(AA, m, aA).trim().toLowerCase() === J)), gA || (gA = n.rows.find((AA) => {
|
|
8136
|
+
const LA = Uf(AA, m, aA).trim().toLowerCase();
|
|
8137
8137
|
return LA.startsWith(J) || J.startsWith(LA);
|
|
8138
8138
|
})), !gA) return null;
|
|
8139
|
-
const Bf = Uf(gA, YA,
|
|
8139
|
+
const Bf = Uf(gA, YA, wf);
|
|
8140
8140
|
if (!Bf) return null;
|
|
8141
8141
|
const FA = QP(Bf), OA = SA[YA];
|
|
8142
|
-
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
|
}
|
|
8150
8150
|
return { range: Bf, ...FA };
|
|
8151
|
-
}, [n, m,
|
|
8151
|
+
}, [n, m, aA, B, SA]), iA = vf(() => {
|
|
8152
8152
|
if (N)
|
|
8153
8153
|
return (g?.matchDetails || []).map((gA) => ({
|
|
8154
8154
|
area: gA.measurement.replace(/\s*\(.*?\)\s*$/, "").trim() || gA.measurement,
|
|
@@ -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({
|
|
@@ -8170,28 +8170,28 @@ function DP({
|
|
|
8170
8170
|
});
|
|
8171
8171
|
}
|
|
8172
8172
|
if (!nA.length) return [];
|
|
8173
|
-
const
|
|
8173
|
+
const wf = new Set(X.length > 0 ? X.map((J) => J.measurement) : YA ? ["Height"] : []);
|
|
8174
8174
|
return nA.map((J) => {
|
|
8175
|
-
if (
|
|
8175
|
+
if (wf.has(J.measurement)) {
|
|
8176
8176
|
const U = e[J.measurement.toLowerCase()] || kf(J.userValue), R = mA || zA || J.chartRange;
|
|
8177
8177
|
if (!D)
|
|
8178
8178
|
return { area: J.measurement + " (" + R + ")", userNum: U, chartLabel: R, fit: "good", isLength: !0 };
|
|
8179
|
-
const G = D.section, S = G.headers.findIndex((KA) => /size|length/i.test(KA.trim())),
|
|
8179
|
+
const G = D.section, S = G.headers.findIndex((KA) => /size|length/i.test(KA.trim())), dA = G.headers.findIndex((KA) => /cm|\(cm\)|height.*cm/i.test(KA.toLowerCase())), fA = S >= 0 ? S : 0, NA = dA >= 0 ? dA : -1, $A = G.rows.find((KA) => Uf(KA, fA, G.headers[fA]) === R);
|
|
8180
8180
|
let ef = R, yA = "good";
|
|
8181
8181
|
if ($A && NA >= 0) {
|
|
8182
8182
|
const KA = Uf($A, NA, G.headers[NA]);
|
|
8183
8183
|
if (KA) {
|
|
8184
8184
|
ef = KA;
|
|
8185
|
-
const { min:
|
|
8186
|
-
if (
|
|
8187
|
-
const cA = M -
|
|
8188
|
-
if (U >=
|
|
8189
|
-
else if (U <
|
|
8190
|
-
const
|
|
8191
|
-
yA =
|
|
8185
|
+
const { min: Df, max: M } = QP(KA);
|
|
8186
|
+
if (Df > 0 && M > 0) {
|
|
8187
|
+
const cA = M - Df, pA = cA > 0 ? cA * 0.5 : Df * 0.05 || 3, tf = Math.max((M || Df) * 5e-3, 0.25);
|
|
8188
|
+
if (U >= Df - tf && U <= M + tf) yA = "good";
|
|
8189
|
+
else if (U < Df) {
|
|
8190
|
+
const Cf = Df - U;
|
|
8191
|
+
yA = Cf > pA * 2 ? "too-tight" : Cf > pA ? "tight" : "a-bit-tight";
|
|
8192
8192
|
} else {
|
|
8193
|
-
const
|
|
8194
|
-
yA =
|
|
8193
|
+
const Cf = U - M;
|
|
8194
|
+
yA = Cf > pA * 2 ? "too-loose" : Cf > pA ? "loose" : "a-bit-loose";
|
|
8195
8195
|
}
|
|
8196
8196
|
}
|
|
8197
8197
|
}
|
|
@@ -8219,11 +8219,11 @@ function DP({
|
|
|
8219
8219
|
}
|
|
8220
8220
|
return { area: J.measurement, userNum: gA, chartLabel: kP(OA), fit: q, isLength: x };
|
|
8221
8221
|
});
|
|
8222
|
-
}, [g, D, e, bA, E, ff, mA, RA, N]), nf =
|
|
8222
|
+
}, [g, D, e, bA, E, ff, mA, RA, N]), nf = iA.filter(
|
|
8223
8223
|
(a) => a.fit === "good" || a.fit === "a-bit-tight" || a.fit === "a-bit-loose"
|
|
8224
|
-
).length, xA =
|
|
8224
|
+
).length, xA = iA.length > 0 ? Math.round(nf / iA.length * 100) : 0, Ef = !N, eA = g, $ = eA?.size || E, _A = (g?.matchDetails || []).find(
|
|
8225
8225
|
(a) => /inseam|length/i.test(a.measurement) && !/neck|arm|sleeve|back|shoulder/i.test(a.measurement)
|
|
8226
|
-
), 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
|
),
|
|
@@ -8361,22 +8361,22 @@ function DP({
|
|
|
8361
8361
|
] }),
|
|
8362
8362
|
/* @__PURE__ */ A("p", { className: "ps-msd-card-note", children: o("Based on your measurements and the garment's tailoring chart.") })
|
|
8363
8363
|
] }),
|
|
8364
|
-
K !== !1 &&
|
|
8364
|
+
K !== !1 && iA.length > 0 && /* @__PURE__ */ P("div", { className: "ps-msd-blueprint", children: [
|
|
8365
8365
|
/* @__PURE__ */ A("span", { className: "ps-msd-blueprint-title", children: o("MEASUREMENT BLUEPRINT") }),
|
|
8366
8366
|
/* @__PURE__ */ A("div", { className: "ps-msd-blueprint-underline" }),
|
|
8367
|
-
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children:
|
|
8368
|
-
const zA =
|
|
8367
|
+
/* @__PURE__ */ A("div", { className: "ps-msd-rows", children: iA.map((H, oA) => {
|
|
8368
|
+
const zA = H.isLength && H.fit.includes("short") || H.fit.includes("tight"), YA = H.fit === "good" ? "ps-good" : zA ? "ps-tight" : "ps-loose", wf = X(H.area), J = String(oA + 1).padStart(2, "0");
|
|
8369
8369
|
return /* @__PURE__ */ P("div", { className: "ps-msd-row", children: [
|
|
8370
8370
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-num", children: [
|
|
8371
8371
|
J,
|
|
8372
8372
|
" ",
|
|
8373
|
-
|
|
8373
|
+
H.area.toUpperCase()
|
|
8374
8374
|
] }),
|
|
8375
|
-
|
|
8375
|
+
wf && /* @__PURE__ */ A("p", { className: "ps-msd-row-desc", children: wf }),
|
|
8376
8376
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cells", children: [
|
|
8377
8377
|
/* @__PURE__ */ P("div", { className: "ps-msd-row-cell", children: [
|
|
8378
8378
|
/* @__PURE__ */ A("span", { className: "ps-msd-cell-label", children: o("USER") }),
|
|
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: () =>
|
|
8418
|
+
className: `ps-msd-size-pill${oA ? " ps-active" : ""}`,
|
|
8419
|
+
onClick: () => EA(H === cf ? null : H),
|
|
8420
8420
|
style: { display: "flex", flexDirection: "column", alignItems: "center", lineHeight: 1.15, gap: "0.15vw" },
|
|
8421
8421
|
children: [
|
|
8422
|
-
/* @__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
|
] }),
|
|
@@ -8522,7 +8522,7 @@ function DP({
|
|
|
8522
8522
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.7vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: o("No matching size") }),
|
|
8523
8523
|
/* @__PURE__ */ A("p", { style: { fontSize: "1vw", fontWeight: 600, color: "var(--ps-text-primary)", margin: "0.8vw 0 0.5vw", lineHeight: 1.4 }, children: o("We couldn't find a size that fits for this product.") }),
|
|
8524
8524
|
/* @__PURE__ */ A("p", { style: { fontSize: "0.72vw", color: "var(--ps-text-secondary)", lineHeight: 1.55, margin: 0 }, children: o("Your measurements are outside this product's size range. You can still try it on visually below.") })
|
|
8525
|
-
] }) : /* @__PURE__ */ P(
|
|
8525
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
8526
8526
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.75vw", fontWeight: 700, color: "var(--ps-accent)", textTransform: "uppercase", letterSpacing: "0.12em" }, children: VA ? o("Recommended Size") : kA ?? o("Your Selection") }),
|
|
8527
8527
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.5vw", marginTop: "0.35vw", marginBottom: "0.4vw" }, children: [
|
|
8528
8528
|
V.length > 1 && /* @__PURE__ */ P(
|
|
@@ -8586,20 +8586,20 @@ function DP({
|
|
|
8586
8586
|
o("Match based on your silhouette profile")
|
|
8587
8587
|
] })
|
|
8588
8588
|
] }),
|
|
8589
|
-
|
|
8589
|
+
iA.length > 0 && /* @__PURE__ */ A("div", { style: { background: "white", borderRadius: "0.5vw", border: "1px solid rgba(0,0,0,0.06)", overflow: "hidden", marginBottom: "1.2vw" }, children: /* @__PURE__ */ P("table", { style: { width: "100%", borderCollapse: "collapse" }, children: [
|
|
8590
8590
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ P("tr", { children: [
|
|
8591
8591
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Measurement") }),
|
|
8592
8592
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Your Body") }),
|
|
8593
8593
|
/* @__PURE__ */ A("th", { style: { textAlign: "left", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Garment Spec") }),
|
|
8594
8594
|
/* @__PURE__ */ A("th", { style: { textAlign: "right", padding: "0.5vw 0.6vw", fontSize: "0.6vw", fontWeight: 600, color: "var(--ps-text-secondary)", textTransform: "uppercase", letterSpacing: "0.08em", borderBottom: "1px solid rgba(0,0,0,0.06)" }, children: o("Fit Result") })
|
|
8595
8595
|
] }) }),
|
|
8596
|
-
/* @__PURE__ */ A("tbody", { children:
|
|
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",
|
|
8598
|
-
return /* @__PURE__ */ P("tr", { style: { borderBottom: X <
|
|
8596
|
+
/* @__PURE__ */ A("tbody", { children: iA.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", H = a.fit === "good" ? "rgba(33,84,239,0.08)" : a.isLength ? a.fit.includes("short") || a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)" : a.fit.includes("tight") ? "rgba(220,38,38,0.08)" : "rgba(217,119,6,0.08)";
|
|
8598
|
+
return /* @__PURE__ */ P("tr", { style: { borderBottom: X < iA.length - 1 ? "1px solid rgba(0,0,0,0.04)" : "none" }, children: [
|
|
8599
8599
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", fontWeight: 500, color: "var(--ps-text-primary)" }, children: a.area }),
|
|
8600
8600
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawUserValue || "—" : isNaN(a.userNum) || a.userNum === 0 ? "—" : `${XA(a.userNum)} ${B}` }),
|
|
8601
8601
|
/* @__PURE__ */ A("td", { style: { padding: "0.55vw 0.6vw", fontSize: "0.75vw", color: "var(--ps-text-secondary)" }, children: N ? a.rawChartRange || "—" : sA(a.chartLabel) }),
|
|
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
|
] }) }),
|
|
@@ -8644,7 +8644,7 @@ function DP({
|
|
|
8644
8644
|
return /* @__PURE__ */ P(
|
|
8645
8645
|
"button",
|
|
8646
8646
|
{
|
|
8647
|
-
onClick: () =>
|
|
8647
|
+
onClick: () => EA(a === cf ? null : a),
|
|
8648
8648
|
style: {
|
|
8649
8649
|
padding: "0.35vw 0.7vw",
|
|
8650
8650
|
borderRadius: "0.35vw",
|
|
@@ -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,
|
|
@@ -8769,7 +8769,7 @@ function EB({
|
|
|
8769
8769
|
userHeightCm: BA,
|
|
8770
8770
|
t: c
|
|
8771
8771
|
}) {
|
|
8772
|
-
const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [XA, sA] = j({}), V = QP, s = UA((U, R, G) => Uf(U, R, G), []), PA =
|
|
8772
|
+
const hA = (n?.unit || D || "").toString().toLowerCase(), l = hA === "mm" ? "mm" : hA === "cm" ? "cm" : "in", y = c(l === "mm" ? "mm" : D === "cm" ? "cm" : "in"), [XA, sA] = j({}), V = QP, s = UA((U, R, G) => Uf(U, R, G), []), PA = vf(() => {
|
|
8773
8773
|
if (!g?.headers || !g?.rows) return -1;
|
|
8774
8774
|
const U = g.headers.findIndex((R) => /size|taglia|größe|taille/i.test(R.trim()));
|
|
8775
8775
|
if (U >= 0) return U;
|
|
@@ -8779,8 +8779,8 @@ function EB({
|
|
|
8779
8779
|
}
|
|
8780
8780
|
return 0;
|
|
8781
8781
|
}, [g, s]), RA = g?.headers?.[PA] || c("Size");
|
|
8782
|
-
|
|
8783
|
-
const mA =
|
|
8782
|
+
vf(() => PA < 0 || !g?.rows ? [] : g.rows.map((U) => s(U, PA, RA)).filter(Boolean), [g, PA, RA, s]);
|
|
8783
|
+
const mA = vf(() => {
|
|
8784
8784
|
if (!g?.headers || !g?.rows) return [];
|
|
8785
8785
|
const U = [];
|
|
8786
8786
|
for (let R = 0; R < g.headers.length; R++) {
|
|
@@ -8794,8 +8794,8 @@ function EB({
|
|
|
8794
8794
|
continue;
|
|
8795
8795
|
}
|
|
8796
8796
|
let S = null;
|
|
8797
|
-
for (const
|
|
8798
|
-
const fA = String(s(
|
|
8797
|
+
for (const dA of g.rows) {
|
|
8798
|
+
const fA = String(s(dA, R, g.headers[R]) || "").trim();
|
|
8799
8799
|
if (fA) {
|
|
8800
8800
|
if (/cm\b|centimeter/i.test(fA)) {
|
|
8801
8801
|
S = "cm";
|
|
@@ -8810,9 +8810,9 @@ function EB({
|
|
|
8810
8810
|
U.push(S);
|
|
8811
8811
|
}
|
|
8812
8812
|
return U;
|
|
8813
|
-
}, [g, s]),
|
|
8813
|
+
}, [g, s]), EA = UA((U, R) => {
|
|
8814
8814
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8815
|
-
const G = U.toLowerCase().trim(), S = y === "cm" || y === "",
|
|
8815
|
+
const G = U.toLowerCase().trim(), S = y === "cm" || y === "", dA = S ? "cm" : "in", fA = [];
|
|
8816
8816
|
for (let M = 0; M < g.headers.length; M++) {
|
|
8817
8817
|
const cA = (g.headers[M] || "").toLowerCase().trim();
|
|
8818
8818
|
if (cA === G) {
|
|
@@ -8823,25 +8823,25 @@ function EB({
|
|
|
8823
8823
|
(pA === G || cA.includes(G) || G.includes(pA)) && fA.push(M);
|
|
8824
8824
|
}
|
|
8825
8825
|
if (fA.length === 0) return null;
|
|
8826
|
-
let NA = fA.find((M) => mA[M] ===
|
|
8826
|
+
let NA = fA.find((M) => mA[M] === dA);
|
|
8827
8827
|
NA == null && (NA = fA[0]);
|
|
8828
8828
|
const $A = g.headers[NA], ef = g.rows.find((M) => s(M, PA, RA) === R);
|
|
8829
8829
|
if (!ef) return null;
|
|
8830
8830
|
const yA = s(ef, NA, $A);
|
|
8831
8831
|
if (!yA) return null;
|
|
8832
|
-
const KA = V(yA),
|
|
8833
|
-
if (
|
|
8832
|
+
const KA = V(yA), Df = mA[NA];
|
|
8833
|
+
if (Df === "in" && S) {
|
|
8834
8834
|
const M = (cA) => +(cA * 2.54).toFixed(1);
|
|
8835
8835
|
return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
|
|
8836
8836
|
}
|
|
8837
|
-
if (
|
|
8837
|
+
if (Df === "cm" && !S) {
|
|
8838
8838
|
const M = (cA) => +(cA / 2.54).toFixed(1);
|
|
8839
8839
|
return { range: String(M(KA.min)) + (KA.min !== KA.max ? "–" + String(M(KA.max)) : ""), min: M(KA.min), max: M(KA.max) };
|
|
8840
8840
|
}
|
|
8841
8841
|
return { range: yA, ...KA };
|
|
8842
8842
|
}, [g, PA, RA, y, s, V, mA]), ZA = n?.recommendedSize || "";
|
|
8843
|
-
|
|
8844
|
-
const [Hf, m] = j("fit"), [
|
|
8843
|
+
vf(() => n?.internationalSizes || {}, [n]);
|
|
8844
|
+
const [Hf, m] = j("fit"), [aA, TA] = j(null), [bA, VA] = j(!1), [kA, vA] = j(!1), [SA, ff] = j(!1), [iA, nf] = j(null), [xA, Ef] = j(!1), [eA, $] = j({ w: 800, h: 1200 }), _A = UA((U) => {
|
|
8845
8845
|
const R = U.currentTarget;
|
|
8846
8846
|
R.naturalWidth && R.naturalHeight && $({ w: R.naturalWidth, h: R.naturalHeight });
|
|
8847
8847
|
}, []);
|
|
@@ -8857,17 +8857,17 @@ function EB({
|
|
|
8857
8857
|
});
|
|
8858
8858
|
}, [e, t]);
|
|
8859
8859
|
const [Of, cf] = j(!1), [Mf, gf] = j(!1);
|
|
8860
|
-
|
|
8861
|
-
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X =
|
|
8860
|
+
tA(null);
|
|
8861
|
+
const [qA, GA] = j(!1), [_, uA] = j(null), [WA, a] = j(!1), X = tA(null), [nA, H] = j(null), [oA, zA] = j(!1);
|
|
8862
8862
|
JA(() => {
|
|
8863
8863
|
if (_) {
|
|
8864
8864
|
const U = URL.createObjectURL(_);
|
|
8865
|
-
return
|
|
8865
|
+
return H(U), () => URL.revokeObjectURL(U);
|
|
8866
8866
|
}
|
|
8867
|
-
|
|
8867
|
+
H(null);
|
|
8868
8868
|
}, [_]);
|
|
8869
|
-
const YA =
|
|
8870
|
-
|
|
8869
|
+
const YA = aA || ZA;
|
|
8870
|
+
vf(() => {
|
|
8871
8871
|
if (!n?.matchDetails?.length) return [];
|
|
8872
8872
|
const U = /* @__PURE__ */ new Set();
|
|
8873
8873
|
return n.matchDetails.filter((G) => {
|
|
@@ -8875,13 +8875,13 @@ function EB({
|
|
|
8875
8875
|
return U.has(S) ? !1 : (U.add(S), !0);
|
|
8876
8876
|
}).map((G) => {
|
|
8877
8877
|
const S = kf(G.userValue);
|
|
8878
|
-
let
|
|
8878
|
+
let dA = G.chartRange, fA = G.fit;
|
|
8879
8879
|
if (YA !== ZA) {
|
|
8880
|
-
const NA =
|
|
8880
|
+
const NA = EA(G.measurement, YA);
|
|
8881
8881
|
if (NA && NA.min > 0) {
|
|
8882
|
-
|
|
8883
|
-
const $A = NA.min, ef = NA.max, yA = ef - $A, KA = yA > 0 ? yA * 0.5 : $A * 0.05 || 3,
|
|
8884
|
-
if (S >= $A -
|
|
8882
|
+
dA = kP(NA.range);
|
|
8883
|
+
const $A = NA.min, ef = NA.max, yA = ef - $A, KA = yA > 0 ? yA * 0.5 : $A * 0.05 || 3, Df = Math.max((ef || $A) * 5e-3, 0.25);
|
|
8884
|
+
if (S >= $A - Df && S <= ef + Df) fA = "good";
|
|
8885
8885
|
else if (S < $A) {
|
|
8886
8886
|
const M = $A - S;
|
|
8887
8887
|
fA = M > KA * 2 ? "too-loose" : M > KA ? "loose" : "a-bit-loose";
|
|
@@ -8891,9 +8891,9 @@ function EB({
|
|
|
8891
8891
|
}
|
|
8892
8892
|
}
|
|
8893
8893
|
}
|
|
8894
|
-
return { area: G.measurement, userNum: kf(G.userValue), chartLabel:
|
|
8894
|
+
return { area: G.measurement, userNum: kf(G.userValue), chartLabel: dA, fit: fA };
|
|
8895
8895
|
});
|
|
8896
|
-
}, [n, YA, ZA,
|
|
8896
|
+
}, [n, YA, ZA, EA]), vf(() => {
|
|
8897
8897
|
if (!g?.headers || !g?.rows || PA < 0) return null;
|
|
8898
8898
|
const U = g.rows.find((G) => s(G, PA, RA) === YA);
|
|
8899
8899
|
if (!U) return null;
|
|
@@ -8901,24 +8901,24 @@ function EB({
|
|
|
8901
8901
|
for (let G = 0; G < g.headers.length; G++) {
|
|
8902
8902
|
const S = g.headers[G] || "";
|
|
8903
8903
|
if (G === PA) continue;
|
|
8904
|
-
const
|
|
8905
|
-
|
|
8904
|
+
const dA = s(U, G, S);
|
|
8905
|
+
dA && R.push({ header: S, value: dA });
|
|
8906
8906
|
}
|
|
8907
8907
|
return R;
|
|
8908
8908
|
}, [g, PA, RA, YA, s]);
|
|
8909
|
-
const
|
|
8909
|
+
const wf = !!(g?.sections && Object.keys(g.sections).length > 1), J = vf(() => n?.sections && Object.keys(n.sections).length > 0 ? Object.entries(n.sections).map(([U, R]) => {
|
|
8910
8910
|
const G = g?.sections?.[U] || Object.values(g?.sections || {}).find(
|
|
8911
|
-
(
|
|
8911
|
+
(dA) => U.toLowerCase().includes(dA.name?.toLowerCase()?.replace(/\s*(size|sizing)\s*/gi, "").trim() || "---")
|
|
8912
8912
|
) || { headers: [], rows: [], requiredFields: [] }, S = {};
|
|
8913
8913
|
if (R.matchDetails)
|
|
8914
|
-
for (const
|
|
8914
|
+
for (const dA of R.matchDetails) S[dA.measurement.toLowerCase()] = kf(dA.userValue);
|
|
8915
8915
|
return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: G, secResult: R, userMeasurements: S };
|
|
8916
|
-
}) : !
|
|
8916
|
+
}) : !wf || !g?.sections ? [] : Object.entries(g.sections).map(([U, R]) => {
|
|
8917
8917
|
const G = n?.sections?.[U] || { recommendedSize: n?.recommendedSize || "", matchDetails: [] }, S = {};
|
|
8918
8918
|
if (G.matchDetails)
|
|
8919
|
-
for (const
|
|
8919
|
+
for (const dA of G.matchDetails) S[dA.measurement.toLowerCase()] = kf(dA.userValue);
|
|
8920
8920
|
return BA && BA > 0 && !S.height && (S.height = BA), { name: U, section: R, secResult: G, userMeasurements: S };
|
|
8921
|
-
}), [
|
|
8921
|
+
}), [wf, g, n, BA]), gA = vf(() => J.filter((U) => !zn(U.name)), [J]), Bf = vf(() => J.filter((U) => zn(U.name)), [J]), FA = !!T, OA = FA && (t || f && !n), AA = !FA && f && !n, LA = !!n, Pf = !!e && !t, lA = FA ? LA && Pf : LA, x = NP(), q = v === "face" || v === "head";
|
|
8922
8922
|
n?.found;
|
|
8923
8923
|
const QA = v === "foot";
|
|
8924
8924
|
return console.log("[PS-SDK] SizeResultView render:", {
|
|
@@ -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";
|
|
@@ -8989,8 +8989,8 @@ function EB({
|
|
|
8989
8989
|
) });
|
|
8990
8990
|
})()
|
|
8991
8991
|
] }),
|
|
8992
|
-
(lA || n && !OA) && /* @__PURE__ */ P(
|
|
8993
|
-
|
|
8992
|
+
(lA || n && !OA) && /* @__PURE__ */ P(rA, { children: [
|
|
8993
|
+
wf ? O ? (
|
|
8994
8994
|
/* ── Detail view for a single section ── */
|
|
8995
8995
|
(() => {
|
|
8996
8996
|
const U = gA.find((R) => R.name === O);
|
|
@@ -9014,10 +9014,10 @@ function EB({
|
|
|
9014
9014
|
showLines: kA,
|
|
9015
9015
|
onToggleLines: q ? void 0 : () => vA(!kA),
|
|
9016
9016
|
onImageLoad: _A,
|
|
9017
|
-
overlayNode: e && xA &&
|
|
9017
|
+
overlayNode: e && xA && iA ? /* @__PURE__ */ A(
|
|
9018
9018
|
$f,
|
|
9019
9019
|
{
|
|
9020
|
-
lines:
|
|
9020
|
+
lines: iA,
|
|
9021
9021
|
fitRows: (() => {
|
|
9022
9022
|
const R = [...n?.matchDetails || []];
|
|
9023
9023
|
if (n?.sections)
|
|
@@ -9025,13 +9025,13 @@ function EB({
|
|
|
9025
9025
|
S.matchDetails && R.push(...S.matchDetails);
|
|
9026
9026
|
const G = /* @__PURE__ */ new Set();
|
|
9027
9027
|
return R.filter((S) => {
|
|
9028
|
-
const
|
|
9029
|
-
return G.has(
|
|
9028
|
+
const dA = S.measurement.toLowerCase();
|
|
9029
|
+
return G.has(dA) ? !1 : (G.add(dA), !0);
|
|
9030
9030
|
}).map((S) => ({ area: S.measurement, userNum: parseFloat(S.userValue) || 0, chartLabel: S.chartRange || "", fit: S.fit }));
|
|
9031
9031
|
})(),
|
|
9032
9032
|
show: kA,
|
|
9033
|
-
imgWidth:
|
|
9034
|
-
imgHeight:
|
|
9033
|
+
imgWidth: eA.w,
|
|
9034
|
+
imgHeight: eA.h
|
|
9035
9035
|
}
|
|
9036
9036
|
) : null,
|
|
9037
9037
|
t: c
|
|
@@ -9080,10 +9080,10 @@ function EB({
|
|
|
9080
9080
|
showLines: kA,
|
|
9081
9081
|
onToggleLines: q ? void 0 : () => vA(!kA),
|
|
9082
9082
|
onImageLoad: _A,
|
|
9083
|
-
overlayNode: e && xA &&
|
|
9083
|
+
overlayNode: e && xA && iA ? /* @__PURE__ */ A(
|
|
9084
9084
|
$f,
|
|
9085
9085
|
{
|
|
9086
|
-
lines:
|
|
9086
|
+
lines: iA,
|
|
9087
9087
|
fitRows: (() => {
|
|
9088
9088
|
const U = [...n?.matchDetails || []];
|
|
9089
9089
|
if (n?.sections)
|
|
@@ -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,12 +9108,12 @@ 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 })
|
|
9115
9115
|
] }),
|
|
9116
|
-
e && !t && xA &&
|
|
9116
|
+
e && !t && xA && iA && /* @__PURE__ */ A($f, { lines: iA, fitRows: (() => {
|
|
9117
9117
|
const U = [...n?.matchDetails || []];
|
|
9118
9118
|
if (n?.sections)
|
|
9119
9119
|
for (const G of Object.values(n.sections))
|
|
@@ -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: [
|
|
@@ -9149,8 +9149,8 @@ function EB({
|
|
|
9149
9149
|
/* @__PURE__ */ A("p", { className: "ps-tryon-v2-subtitle", children: c("Tap any section for detailed breakdown") }),
|
|
9150
9150
|
/* @__PURE__ */ A("div", { className: "ps-tryon-v2-sep" }),
|
|
9151
9151
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-cards-v2", children: gA.map(({ name: U, secResult: R }, G) => {
|
|
9152
|
-
const S = g?.sectionImages?.[U],
|
|
9153
|
-
return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${
|
|
9152
|
+
const S = g?.sectionImages?.[U], dA = G === gA.length - 1 && gA.length % 2 !== 0, fA = R;
|
|
9153
|
+
return /* @__PURE__ */ P("button", { className: `ps-tryon-sr-card-v2${dA ? " ps-full" : ""}`, onClick: () => N(U), style: { animationDelay: `${G * 0.07}s` }, children: [
|
|
9154
9154
|
/* @__PURE__ */ P("div", { className: "ps-tryon-sr-card-v2-text", children: [
|
|
9155
9155
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-label", children: U.replace(/\s*[—–-]\s*.*/g, "") }),
|
|
9156
9156
|
/* @__PURE__ */ A("span", { className: "ps-tryon-sr-card-v2-value", children: fA.found === !1 ? c("No fit") : fA.size || R.recommendedSize }),
|
|
@@ -9213,7 +9213,7 @@ function EB({
|
|
|
9213
9213
|
const U = g?.found ? { headers: g.headers || [], rows: g.rows || [], requiredFields: g.requiredFields || [] } : { headers: [], rows: [], requiredFields: [] }, R = { recommendedSize: n?.recommendedSize || "", matchDetails: n?.matchDetails || [] }, G = {};
|
|
9214
9214
|
if (n?.matchDetails)
|
|
9215
9215
|
for (const fA of n.matchDetails) G[fA.measurement.toLowerCase()] = kf(fA.userValue);
|
|
9216
|
-
const S = c("Your Fit"),
|
|
9216
|
+
const S = c("Your Fit"), dA = () => {
|
|
9217
9217
|
e || (uA(p || null), GA(!0));
|
|
9218
9218
|
};
|
|
9219
9219
|
return x ? /* @__PURE__ */ A(
|
|
@@ -9230,7 +9230,7 @@ function EB({
|
|
|
9230
9230
|
onBack: e ? E || (() => i("body-profile")) : () => i("body-profile"),
|
|
9231
9231
|
backLabel: c("Back"),
|
|
9232
9232
|
internationalSizes: n?.internationalSizes,
|
|
9233
|
-
onTryOn: e || QA ? void 0 :
|
|
9233
|
+
onTryOn: e || QA ? void 0 : dA,
|
|
9234
9234
|
continueLabel: e ? c("Continue Shopping") : void 0,
|
|
9235
9235
|
tryOnProcessing: t,
|
|
9236
9236
|
productImage: e || B,
|
|
@@ -9241,14 +9241,14 @@ function EB({
|
|
|
9241
9241
|
showLines: kA,
|
|
9242
9242
|
onToggleLines: q ? void 0 : () => vA(!kA),
|
|
9243
9243
|
onImageLoad: _A,
|
|
9244
|
-
overlayNode: e && xA &&
|
|
9244
|
+
overlayNode: e && xA && iA ? /* @__PURE__ */ A(
|
|
9245
9245
|
$f,
|
|
9246
9246
|
{
|
|
9247
|
-
lines:
|
|
9247
|
+
lines: iA,
|
|
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 &&
|
|
9259
|
+
e && xA && iA && /* @__PURE__ */ A($f, { lines: iA, fitRows: (n?.matchDetails || []).map((fA) => ({ area: fA.measurement, userNum: parseFloat(fA.userValue) || 0, chartLabel: fA.chartRange || "", fit: fA.fit })), show: kA, imgWidth: eA.w, imgHeight: eA.h }),
|
|
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") })
|
|
@@ -9276,7 +9276,7 @@ function EB({
|
|
|
9276
9276
|
onBack: e ? E || (() => i("body-profile")) : () => i("body-profile"),
|
|
9277
9277
|
backLabel: c("Back"),
|
|
9278
9278
|
internationalSizes: n?.internationalSizes,
|
|
9279
|
-
onTryOn: e || QA ? void 0 :
|
|
9279
|
+
onTryOn: e || QA ? void 0 : dA,
|
|
9280
9280
|
continueLabel: e ? c("Continue Shopping") : void 0,
|
|
9281
9281
|
tryOnProcessing: t,
|
|
9282
9282
|
t: c,
|
|
@@ -9308,7 +9308,7 @@ function EB({
|
|
|
9308
9308
|
}
|
|
9309
9309
|
}
|
|
9310
9310
|
),
|
|
9311
|
-
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ && nA ? /* @__PURE__ */ P(
|
|
9311
|
+
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: _ && nA ? /* @__PURE__ */ P(rA, { children: [
|
|
9312
9312
|
/* @__PURE__ */ A("img", { src: nA, alt: c("Your photo"), className: "ps-pm-preview-img" }),
|
|
9313
9313
|
/* @__PURE__ */ A(
|
|
9314
9314
|
"button",
|
|
@@ -9344,15 +9344,15 @@ function EB({
|
|
|
9344
9344
|
/* @__PURE__ */ A("div", { className: "ps-pm-checklist-icon", children: /* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "currentColor", width: "14", height: "14", children: /* @__PURE__ */ A("path", { d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2v6zm0-8h-2V7h2v2z" }) }) }),
|
|
9345
9345
|
/* @__PURE__ */ P("div", { className: "ps-pm-checklist-body", children: [
|
|
9346
9346
|
/* @__PURE__ */ A("div", { className: "ps-pm-checklist-title", children: c("Checklist for accuracy") }),
|
|
9347
|
-
/* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: v === "face" ? /* @__PURE__ */ P(
|
|
9347
|
+
/* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: v === "face" ? /* @__PURE__ */ P(rA, { children: [
|
|
9348
9348
|
/* @__PURE__ */ A("li", { children: c("Face the camera directly at eye level") }),
|
|
9349
9349
|
/* @__PURE__ */ A("li", { children: c("Remove any glasses you're wearing") }),
|
|
9350
9350
|
/* @__PURE__ */ A("li", { children: c("Good lighting, plain background") })
|
|
9351
|
-
] }) : v === "head" ? /* @__PURE__ */ P(
|
|
9351
|
+
] }) : v === "head" ? /* @__PURE__ */ P(rA, { children: [
|
|
9352
9352
|
/* @__PURE__ */ A("li", { children: c("Head and shoulders in frame") }),
|
|
9353
9353
|
/* @__PURE__ */ A("li", { children: c("Leave space above your head") }),
|
|
9354
9354
|
/* @__PURE__ */ A("li", { children: c("Good lighting, plain background") })
|
|
9355
|
-
] }) : /* @__PURE__ */ P(
|
|
9355
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
9356
9356
|
/* @__PURE__ */ A("li", { children: c("Form-fitting clothing is recommended") }),
|
|
9357
9357
|
/* @__PURE__ */ A("li", { children: c("Standing 2-3 meters from camera") }),
|
|
9358
9358
|
/* @__PURE__ */ A("li", { children: c("Neutral background with good lighting") })
|
|
@@ -9424,10 +9424,10 @@ function EB({
|
|
|
9424
9424
|
},
|
|
9425
9425
|
className: "ps-tryon-upload-hover",
|
|
9426
9426
|
children: [
|
|
9427
|
-
_ && nA ? /* @__PURE__ */ P(
|
|
9427
|
+
_ && nA ? /* @__PURE__ */ P(rA, { children: [
|
|
9428
9428
|
/* @__PURE__ */ A("img", { src: nA, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
9429
9429
|
/* @__PURE__ */ A("div", { className: "ps-tryon-upload-hover-overlay", style: { position: "absolute", inset: 0, display: "flex", alignItems: "center", justifyContent: "center", background: "rgba(0,0,0,0.4)", opacity: 0, transition: "opacity 0.2s", borderRadius: "0.5vw" }, children: /* @__PURE__ */ A("span", { style: { color: "#fff", fontSize: "0.8vw", fontWeight: 600 }, children: c("Click to change photo") }) })
|
|
9430
|
-
] }) : /* @__PURE__ */ P(
|
|
9430
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
9431
9431
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
9432
9432
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: c("Upload your photo") }),
|
|
9433
9433
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: c(v === "face" ? "Click or drag a close-up face photo" : v === "head" ? "Click or drag a head-and-shoulders photo" : "Click or drag a full-body photo") })
|
|
@@ -9455,7 +9455,7 @@ function EB({
|
|
|
9455
9455
|
/* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.75vw", fontWeight: 700 }, children: "✓" }),
|
|
9456
9456
|
/* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.65vw", fontWeight: 600 }, children: c("Do") })
|
|
9457
9457
|
] }),
|
|
9458
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(
|
|
9458
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(rA, { children: [
|
|
9459
9459
|
c("Face the camera directly, centered in frame"),
|
|
9460
9460
|
/* @__PURE__ */ A("br", {}),
|
|
9461
9461
|
c("Use natural, even lighting (e.g. near a window)"),
|
|
@@ -9463,7 +9463,7 @@ function EB({
|
|
|
9463
9463
|
c("Keep hair away from your face and ears"),
|
|
9464
9464
|
/* @__PURE__ */ A("br", {}),
|
|
9465
9465
|
c("Choose a plain, light background")
|
|
9466
|
-
] }) : v === "head" ? /* @__PURE__ */ P(
|
|
9466
|
+
] }) : v === "head" ? /* @__PURE__ */ P(rA, { children: [
|
|
9467
9467
|
c("Face the camera with head and shoulders in frame"),
|
|
9468
9468
|
/* @__PURE__ */ A("br", {}),
|
|
9469
9469
|
c("Leave some space above your head"),
|
|
@@ -9471,7 +9471,7 @@ function EB({
|
|
|
9471
9471
|
c("Use natural, even lighting"),
|
|
9472
9472
|
/* @__PURE__ */ A("br", {}),
|
|
9473
9473
|
c("Choose a plain, light background")
|
|
9474
|
-
] }) : /* @__PURE__ */ P(
|
|
9474
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
9475
9475
|
c("Stand facing the camera with your full body in frame"),
|
|
9476
9476
|
/* @__PURE__ */ A("br", {}),
|
|
9477
9477
|
c("Use natural or even lighting"),
|
|
@@ -9486,7 +9486,7 @@ function EB({
|
|
|
9486
9486
|
/* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.75vw", fontWeight: 700 }, children: "✗" }),
|
|
9487
9487
|
/* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.65vw", fontWeight: 600 }, children: c("Don't") })
|
|
9488
9488
|
] }),
|
|
9489
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(
|
|
9489
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: v === "face" ? /* @__PURE__ */ P(rA, { children: [
|
|
9490
9490
|
c("Don't wear sunglasses or a hat in the photo"),
|
|
9491
9491
|
/* @__PURE__ */ A("br", {}),
|
|
9492
9492
|
c("Don't tilt or turn your head"),
|
|
@@ -9494,7 +9494,7 @@ function EB({
|
|
|
9494
9494
|
c("Don't use strong backlighting or flash"),
|
|
9495
9495
|
/* @__PURE__ */ A("br", {}),
|
|
9496
9496
|
c("Don't apply filters or edits")
|
|
9497
|
-
] }) : v === "head" ? /* @__PURE__ */ P(
|
|
9497
|
+
] }) : v === "head" ? /* @__PURE__ */ P(rA, { children: [
|
|
9498
9498
|
c("Don't wear a hat in the photo"),
|
|
9499
9499
|
/* @__PURE__ */ A("br", {}),
|
|
9500
9500
|
c("Don't crop out the top of your head"),
|
|
@@ -9502,7 +9502,7 @@ function EB({
|
|
|
9502
9502
|
c("Don't use strong backlighting or flash"),
|
|
9503
9503
|
/* @__PURE__ */ A("br", {}),
|
|
9504
9504
|
c("Don't apply filters or edits")
|
|
9505
|
-
] }) : /* @__PURE__ */ P(
|
|
9505
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
9506
9506
|
c("Don't wear loose or baggy clothing"),
|
|
9507
9507
|
/* @__PURE__ */ A("br", {}),
|
|
9508
9508
|
c("Don't sit, pose, or bend"),
|
|
@@ -9542,7 +9542,7 @@ function EB({
|
|
|
9542
9542
|
/* @__PURE__ */ A("button", { className: "ps-tryon-sr-chart-close", onClick: () => VA(!1), children: "✕" })
|
|
9543
9543
|
] }),
|
|
9544
9544
|
/* @__PURE__ */ A("div", { className: "ps-tryon-sr-chart-scroll", children: g.sections && Object.keys(g.sections).length > 1 ? Object.entries(g.sections).map(([U, R]) => {
|
|
9545
|
-
const S = n?.sections?.[U]?.recommendedSize || "",
|
|
9545
|
+
const S = n?.sections?.[U]?.recommendedSize || "", dA = R.headers.findIndex(($A) => /size|taglia|größe|taille|fit|length/i.test($A.trim())), fA = dA >= 0 ? dA : 0, NA = R.headers[fA] || "Size";
|
|
9546
9546
|
return /* @__PURE__ */ P("div", { className: "ps-tryon-chart-section", children: [
|
|
9547
9547
|
/* @__PURE__ */ P("div", { className: "ps-tryon-chart-section-title", children: [
|
|
9548
9548
|
/* @__PURE__ */ A("span", { children: U }),
|
|
@@ -9556,7 +9556,7 @@ function EB({
|
|
|
9556
9556
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: R.headers.map(($A, ef) => /* @__PURE__ */ A("th", { className: ef === fA ? "ps-size-col" : "", children: $A }, ef)) }) }),
|
|
9557
9557
|
/* @__PURE__ */ A("tbody", { children: R.rows.map(($A, ef) => {
|
|
9558
9558
|
const KA = Uf($A, fA, NA) === S;
|
|
9559
|
-
return /* @__PURE__ */ A("tr", { className: KA ? "ps-active-row" : "", children: R.headers.map((
|
|
9559
|
+
return /* @__PURE__ */ A("tr", { className: KA ? "ps-active-row" : "", children: R.headers.map((Df, M) => /* @__PURE__ */ A("td", { className: M === fA ? "ps-size-col" : "", children: Uf($A, M, Df) }, M)) }, ef);
|
|
9560
9560
|
}) })
|
|
9561
9561
|
] }) })
|
|
9562
9562
|
] }, U);
|
|
@@ -9566,7 +9566,7 @@ function EB({
|
|
|
9566
9566
|
/* @__PURE__ */ A("thead", { children: /* @__PURE__ */ A("tr", { children: g.headers.map((U, R) => /* @__PURE__ */ A("th", { className: R === PA ? "ps-size-col" : "", children: U }, R)) }) }),
|
|
9567
9567
|
/* @__PURE__ */ A("tbody", { children: g.rows.map((U, R) => {
|
|
9568
9568
|
const S = s(U, PA, RA) === YA;
|
|
9569
|
-
return /* @__PURE__ */ A("tr", { className: S ? "ps-active-row" : "", children: g.headers.map((
|
|
9569
|
+
return /* @__PURE__ */ A("tr", { className: S ? "ps-active-row" : "", children: g.headers.map((dA, fA) => /* @__PURE__ */ A("td", { className: fA === PA ? "ps-size-col" : "", children: s(U, fA, dA) }, fA)) }, R);
|
|
9570
9570
|
}) })
|
|
9571
9571
|
] }) })
|
|
9572
9572
|
) : null })
|
|
@@ -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
|
-
return /* @__PURE__ */ A(
|
|
9589
|
+
return /* @__PURE__ */ A(rA, { children: f && n ? /* @__PURE__ */ P(rA, { 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)}%`);
|
|
@@ -9660,7 +9660,7 @@ function dB({
|
|
|
9660
9660
|
}, []);
|
|
9661
9661
|
return /* @__PURE__ */ P("div", { className: "ps-tryon-processing", children: [
|
|
9662
9662
|
/* @__PURE__ */ P("div", { className: "ps-tryon-processing-image-wrap", children: [
|
|
9663
|
-
f && /* @__PURE__ */ P(
|
|
9663
|
+
f && /* @__PURE__ */ P(rA, { children: [
|
|
9664
9664
|
/* @__PURE__ */ A("div", { className: "ps-tryon-processing-blur", style: { backgroundImage: `url(${f})` } }),
|
|
9665
9665
|
/* @__PURE__ */ A("img", { src: f, alt: o("Your photo"), className: "ps-tryon-processing-model" })
|
|
9666
9666
|
] }),
|
|
@@ -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,11 +9783,11 @@ 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 = tA(null);
|
|
9787
9787
|
JA(() => {
|
|
9788
9788
|
W.current && (W.current.scrollTop = 0);
|
|
9789
9789
|
}, [C, i]);
|
|
9790
|
-
const [t, k] = j(""), [u, v] = j("male"), [I, O] = j("cm"), [N, K] = j(""), [E, BA] = j(""), [c, hA] = j(""), [l, y] = j(""), [XA, sA] = j(""), [V, s] = j(""), [PA, RA] = j(null), [mA,
|
|
9790
|
+
const [t, k] = j(""), [u, v] = j("male"), [I, O] = j("cm"), [N, K] = j(""), [E, BA] = j(""), [c, hA] = j(""), [l, y] = j(""), [XA, sA] = j(""), [V, s] = j(""), [PA, RA] = j(null), [mA, EA] = j(!1), ZA = tA(null), Hf = tA(null), [m, aA] = j(!1), [TA, bA] = j(null), VA = () => {
|
|
9791
9791
|
TA === !0 && ZA.current?.click();
|
|
9792
9792
|
}, kA = async (x) => {
|
|
9793
9793
|
const q = x.target.files?.[0];
|
|
@@ -9804,31 +9804,31 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9804
9804
|
s(B("Image must be under 10MB"));
|
|
9805
9805
|
return;
|
|
9806
9806
|
}
|
|
9807
|
-
|
|
9807
|
+
EA(!0);
|
|
9808
9808
|
try {
|
|
9809
9809
|
const QA = await AP(q);
|
|
9810
9810
|
RA(QA), g?.(QA), s("");
|
|
9811
9811
|
} catch {
|
|
9812
9812
|
s(B("Failed to process image"));
|
|
9813
9813
|
} finally {
|
|
9814
|
-
|
|
9814
|
+
EA(!1);
|
|
9815
9815
|
}
|
|
9816
9816
|
}
|
|
9817
9817
|
}, vA = () => {
|
|
9818
9818
|
RA(null), g?.(null), ZA.current && (ZA.current.value = "");
|
|
9819
|
-
}, [SA, ff] = j(null), [
|
|
9819
|
+
}, [SA, ff] = j(null), [iA, nf] = j(null), [xA, Ef] = j(null), [eA, $] = j(null), [_A, Of] = j(null), [cf, Mf] = j(null), gf = ["28", "30", "32", "34", "36", "38", "40", "42", "44", "46", "48", "50", "52", "54", "56"], qA = ["AA", "A", "B", "C", "D", "DD/E", "DDD/F", "G", "H", "I", "J"], GA = u === "female", _ = GA ? MA.female : MA.male, uA = GA ? ["identity", "stomach", "seat", "hips", "bra"] : ["identity", "chest", "stomach", "seat"], WA = uA.indexOf(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;
|
|
@@ -9857,12 +9857,12 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9857
9857
|
weight: parseFloat(l),
|
|
9858
9858
|
age: parseFloat(XA),
|
|
9859
9859
|
chestProfile: SA || void 0,
|
|
9860
|
-
midsectionProfile:
|
|
9861
|
-
hipProfile: GA ?
|
|
9860
|
+
midsectionProfile: iA || void 0,
|
|
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
|
};
|
|
9865
|
-
},
|
|
9865
|
+
}, wf = () => {
|
|
9866
9866
|
const x = I === "in" ? (parseInt(E, 10) || 0) * 12 + (parseInt(c, 10) || 0) : parseFloat(N), q = parseFloat(l), QA = parseFloat(XA);
|
|
9867
9867
|
return {
|
|
9868
9868
|
name: t.trim(),
|
|
@@ -9876,12 +9876,12 @@ 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;
|
|
9883
9883
|
}
|
|
9884
|
-
if (i === "stomach" && !
|
|
9884
|
+
if (i === "stomach" && !iA) {
|
|
9885
9885
|
s(B("Please pick an option"));
|
|
9886
9886
|
return;
|
|
9887
9887
|
}
|
|
@@ -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) {
|
|
@@ -9962,14 +9962,14 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
9962
9962
|
T(!1);
|
|
9963
9963
|
return;
|
|
9964
9964
|
}
|
|
9965
|
-
const x =
|
|
9965
|
+
const x = wf();
|
|
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: [
|
|
@@ -10186,9 +10186,9 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10186
10186
|
title: B("STOMACH PROFILE"),
|
|
10187
10187
|
subtitle: B("Describe your mid-section silhouette"),
|
|
10188
10188
|
children: [
|
|
10189
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected:
|
|
10190
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected:
|
|
10191
|
-
/* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected:
|
|
10189
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.flat ?? null, label: B("FLAT"), selected: iA === "flat", onSelect: () => gA("stomach", "flat") }),
|
|
10190
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.average ?? null, label: B("AVERAGE"), selected: iA === "average", onSelect: () => gA("stomach", "average") }),
|
|
10191
|
+
/* @__PURE__ */ A(Ff, { img: _.stomach?.round ?? null, label: B("ROUND"), selected: iA === "round", onSelect: () => gA("stomach", "round") })
|
|
10192
10192
|
]
|
|
10193
10193
|
}
|
|
10194
10194
|
),
|
|
@@ -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
|
{
|
|
@@ -10345,7 +10345,7 @@ function yB({ onSave: f, onCancel: n, onPhotoPreview: g, onEstimate: e, t: B })
|
|
|
10345
10345
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-label", children: B("NAME") }),
|
|
10346
10346
|
/* @__PURE__ */ A("div", { className: "ps-bp-inline-input-group", children: /* @__PURE__ */ A("input", { ref: Hf, type: "text", className: `ps-bp-inline-input${m ? " ps-cpw-shake" : ""}`, value: t, placeholder: B("e.g. My Photo Profile"), onChange: (x) => {
|
|
10347
10347
|
k(x.target.value), s("");
|
|
10348
|
-
}, onAnimationEnd: () =>
|
|
10348
|
+
}, onAnimationEnd: () => aA(!1) }) })
|
|
10349
10349
|
] }) }),
|
|
10350
10350
|
/* @__PURE__ */ P("div", { className: "ps-cpw-photo-guide", children: [
|
|
10351
10351
|
/* @__PURE__ */ A("div", { className: "ps-cpw-photo-guide-title", children: B("HOW TO TAKE A GOOD PHOTO") }),
|
|
@@ -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,11 +10427,11 @@ 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") })
|
|
10434
|
-
] }) : F ? /* @__PURE__ */ P(
|
|
10434
|
+
] }) : F ? /* @__PURE__ */ P(rA, { children: [
|
|
10435
10435
|
/* @__PURE__ */ P("div", { style: { display: "flex", alignItems: "center", gap: "0.8vw", marginBottom: "1vw" }, children: [
|
|
10436
10436
|
/* @__PURE__ */ A("svg", { viewBox: "0 0 24 24", fill: "none", stroke: "var(--ps-accent)", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", width: "28", height: "28", children: /* @__PURE__ */ A("polyline", { points: "20 6 9 17 4 12" }) }),
|
|
10437
10437
|
/* @__PURE__ */ P("div", { children: [
|
|
@@ -10471,14 +10471,14 @@ 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",
|
|
10478
10478
|
className: "ps-cpw-next-btn",
|
|
10479
10479
|
onClick: () => {
|
|
10480
10480
|
if (!t.trim()) {
|
|
10481
|
-
|
|
10481
|
+
aA(!0), Hf.current?.focus();
|
|
10482
10482
|
return;
|
|
10483
10483
|
}
|
|
10484
10484
|
OA();
|
|
@@ -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,11 +10598,11 @@ 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:
|
|
10605
|
-
] }) : /* @__PURE__ */ P(
|
|
10604
|
+
/* @__PURE__ */ A("span", { style: { color: "var(--ps-text-muted)", fontSize: "0.7vw" }, children: r("calculating...") })
|
|
10605
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
10606
10606
|
/* @__PURE__ */ A(
|
|
10607
10607
|
"input",
|
|
10608
10608
|
{
|
|
@@ -10618,10 +10618,10 @@ function A8({
|
|
|
10618
10618
|
] }) })
|
|
10619
10619
|
] }, K.key);
|
|
10620
10620
|
}),
|
|
10621
|
-
f.gender === "female" && /* @__PURE__ */ P(
|
|
10621
|
+
f.gender === "female" && /* @__PURE__ */ P(rA, { 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(rA, { 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,11 +10851,11 @@ 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
|
}
|
|
10858
|
-
) : /* @__PURE__ */ P(
|
|
10858
|
+
) : /* @__PURE__ */ P(rA, { children: [
|
|
10859
10859
|
/* @__PURE__ */ P("div", { className: "ps-msp-header", children: [
|
|
10860
10860
|
/* @__PURE__ */ A("h2", { className: "ps-msp-title", children: T("My Sizing Profiles") }),
|
|
10861
10861
|
/* @__PURE__ */ A("p", { className: "ps-msp-subtitle", children: T("Manage your bespoke silhouettes. Switch between profiles for different fits or create a new one for specific garment types.") })
|
|
@@ -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,14 +10928,14 @@ 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, EA = 13, ZA = 100, Hf = (BA - s) / (PA - s) * 100, m = (c - RA) / (mA - RA) * 100, aA = (y - sA) / (V - sA) * 100, TA = (XA - EA) / (ZA - EA) * 100, bA = (nf) => {
|
|
10932
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 = () => {
|
|
10935
10935
|
f === "in" ? bA(c + 1) : B(String(Math.min(PA, BA + 1)));
|
|
10936
10936
|
}, kA = () => {
|
|
10937
10937
|
f === "in" ? bA(c - 1) : B(String(Math.max(s, BA - 1)));
|
|
10938
|
-
}, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA, XA + 1))),
|
|
10938
|
+
}, vA = () => z(String(Math.min(V, y + 1))), SA = () => z(String(Math.max(sA, y - 1))), ff = () => T(String(Math.min(ZA, XA + 1))), iA = () => T(String(Math.max(EA, XA - 1)));
|
|
10939
10939
|
return /* @__PURE__ */ P("div", { className: "ps-bpm-root", children: [
|
|
10940
10940
|
/* @__PURE__ */ P("div", { className: "ps-bpm-header", children: [
|
|
10941
10941
|
/* @__PURE__ */ A("h2", { className: "ps-bpm-title", children: E("Body Measurements") }),
|
|
@@ -10945,7 +10945,7 @@ function w8({
|
|
|
10945
10945
|
E("Using"),
|
|
10946
10946
|
" ",
|
|
10947
10947
|
/* @__PURE__ */ A("strong", { children: I }),
|
|
10948
|
-
O && /* @__PURE__ */ P(
|
|
10948
|
+
O && /* @__PURE__ */ P(rA, { children: [
|
|
10949
10949
|
" · ",
|
|
10950
10950
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: O, children: E("start fresh") })
|
|
10951
10951
|
] })
|
|
@@ -11027,7 +11027,7 @@ function w8({
|
|
|
11027
11027
|
step: 1,
|
|
11028
11028
|
value: y,
|
|
11029
11029
|
onChange: (nf) => z(nf.target.value),
|
|
11030
|
-
style: { "--ps-pct": `${
|
|
11030
|
+
style: { "--ps-pct": `${aA}%` }
|
|
11031
11031
|
}
|
|
11032
11032
|
),
|
|
11033
11033
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: vA, "aria-label": E("Increase"), children: /* @__PURE__ */ A(KP, {}) })
|
|
@@ -11043,13 +11043,13 @@ function w8({
|
|
|
11043
11043
|
] })
|
|
11044
11044
|
] }),
|
|
11045
11045
|
/* @__PURE__ */ P("div", { className: "ps-bpm-slider-row", children: [
|
|
11046
|
-
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick:
|
|
11046
|
+
/* @__PURE__ */ A("button", { type: "button", className: "ps-bpm-step-btn", onClick: iA, "aria-label": E("Decrease"), children: /* @__PURE__ */ A(OP, {}) }),
|
|
11047
11047
|
/* @__PURE__ */ A(
|
|
11048
11048
|
"input",
|
|
11049
11049
|
{
|
|
11050
11050
|
type: "range",
|
|
11051
11051
|
className: "ps-bpm-slider",
|
|
11052
|
-
min:
|
|
11052
|
+
min: EA,
|
|
11053
11053
|
max: ZA,
|
|
11054
11054
|
step: 1,
|
|
11055
11055
|
value: XA,
|
|
@@ -11061,7 +11061,7 @@ function w8({
|
|
|
11061
11061
|
] })
|
|
11062
11062
|
] })
|
|
11063
11063
|
] }),
|
|
11064
|
-
!N && /* @__PURE__ */ P(
|
|
11064
|
+
!N && /* @__PURE__ */ P(rA, { children: [
|
|
11065
11065
|
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: E("or") }) }),
|
|
11066
11066
|
/* @__PURE__ */ P(
|
|
11067
11067
|
"button",
|
|
@@ -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 =
|
|
11136
|
+
const T = D === "close-up", F = tA(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") }),
|
|
@@ -11149,7 +11149,7 @@ function Zn({
|
|
|
11149
11149
|
style: { display: "none" }
|
|
11150
11150
|
}
|
|
11151
11151
|
),
|
|
11152
|
-
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: h ? /* @__PURE__ */ P(
|
|
11152
|
+
/* @__PURE__ */ A("div", { className: "ps-pm-preview", children: h ? /* @__PURE__ */ P(rA, { children: [
|
|
11153
11153
|
/* @__PURE__ */ A("img", { src: f, alt: p("Your photo"), className: "ps-pm-preview-img" }),
|
|
11154
11154
|
/* @__PURE__ */ A(
|
|
11155
11155
|
"button",
|
|
@@ -11161,7 +11161,7 @@ function Zn({
|
|
|
11161
11161
|
children: /* @__PURE__ */ A(C8, {})
|
|
11162
11162
|
}
|
|
11163
11163
|
)
|
|
11164
|
-
] }) : /* @__PURE__ */ P(
|
|
11164
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
11165
11165
|
/* @__PURE__ */ P(
|
|
11166
11166
|
"button",
|
|
11167
11167
|
{
|
|
@@ -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") })
|
|
@@ -11205,11 +11205,11 @@ function Zn({
|
|
|
11205
11205
|
/* @__PURE__ */ A("div", { className: "ps-pm-checklist-icon", children: /* @__PURE__ */ A(D8, {}) }),
|
|
11206
11206
|
/* @__PURE__ */ P("div", { className: "ps-pm-checklist-body", children: [
|
|
11207
11207
|
/* @__PURE__ */ A("div", { className: "ps-pm-checklist-title", children: p("Checklist for accuracy") }),
|
|
11208
|
-
/* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: T ? /* @__PURE__ */ P(
|
|
11208
|
+
/* @__PURE__ */ A("ul", { className: "ps-pm-checklist-items", children: T ? /* @__PURE__ */ P(rA, { children: [
|
|
11209
11209
|
/* @__PURE__ */ A("li", { children: p("Face the camera directly at eye level") }),
|
|
11210
11210
|
/* @__PURE__ */ A("li", { children: p("Keep hair away from face and ears") }),
|
|
11211
11211
|
/* @__PURE__ */ A("li", { children: p("Good lighting, plain background") })
|
|
11212
|
-
] }) : /* @__PURE__ */ P(
|
|
11212
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
11213
11213
|
/* @__PURE__ */ A("li", { children: p("Form-fitting clothing is recommended") }),
|
|
11214
11214
|
/* @__PURE__ */ A("li", { children: p("Standing 2-3 meters from camera") }),
|
|
11215
11215
|
/* @__PURE__ */ A("li", { children: p("Neutral background with good lighting") })
|
|
@@ -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,
|
|
@@ -11397,11 +11397,11 @@ function z8({
|
|
|
11397
11397
|
}) {
|
|
11398
11398
|
const I = g ? r8 : t8, [O, N] = j("basics");
|
|
11399
11399
|
O === "photo" || I.indexOf(O);
|
|
11400
|
-
const K = NP(), E = Yn(B), BA = k?.height, c = k?.weight, hA = k?.age, l = k?.heightUnit === "ft" ? "in" : k?.heightUnit, y = k?.weightUnit, XA = BA != null && l === "cm" ? String(Math.round(BA)) : BA != null && (l === "in" || l === "ft") ? String(Math.round(BA * 2.54)) : e.current.height || "173", sA = BA != null && (l === "in" || l === "ft") ? Math.round(BA) : BA != null && l === "cm" ? Math.round(BA / 2.54) : null, V = sA != null ? String(Math.floor(sA / 12)) : e.current.heightFeet || "5", s = sA != null ? String(sA % 12) : e.current.heightInches || "8", PA = c != null ? String(Math.round(c)) : e.current.weight || (E ? "154" : "70"), RA = hA != null ? String(hA) : e.current.age || "30", [mA,
|
|
11400
|
+
const K = NP(), E = Yn(B), BA = k?.height, c = k?.weight, hA = k?.age, l = k?.heightUnit === "ft" ? "in" : k?.heightUnit, y = k?.weightUnit, XA = BA != null && l === "cm" ? String(Math.round(BA)) : BA != null && (l === "in" || l === "ft") ? String(Math.round(BA * 2.54)) : e.current.height || "173", sA = BA != null && (l === "in" || l === "ft") ? Math.round(BA) : BA != null && l === "cm" ? Math.round(BA / 2.54) : null, V = sA != null ? String(Math.floor(sA / 12)) : e.current.heightFeet || "5", s = sA != null ? String(sA % 12) : e.current.heightInches || "8", PA = c != null ? String(Math.round(c)) : e.current.weight || (E ? "154" : "70"), RA = hA != null ? String(hA) : e.current.age || "30", [mA, EA] = j(XA), [ZA, Hf] = j(V), [m, aA] = j(s), [TA, bA] = j(PA), [VA, kA] = j(RA), [vA, SA] = j(
|
|
11401
11401
|
l || (C === "ft" ? "in" : C || (E ? "in" : "cm"))
|
|
11402
|
-
), [ff,
|
|
11402
|
+
), [ff, iA] = 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 = tA(null), [qA, GA] = j(null), [_, uA] = j(() => sA != null ? String(Math.round(sA * 2.54)) : XA), [WA, a] = j(null), [X, nA] = j(null), [H, oA] = j(null), [zA, YA] = j(null), [wf, J] = j(""), [gA, Bf] = j(null), [FA, OA] = j(null), [AA, LA] = j(() => ["US", "UK", "AU"].includes(B) ? B === "AU" ? "UK" : B : ["FR", "ES"].includes(B) ? "FR" : ["IT"].includes(B) ? "IT" : ["JP", "CN", "KR"].includes(B) ? "JP" : "EU"), [Pf, lA] = j(!1), 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)
|
|
@@ -11454,21 +11454,21 @@ function z8({
|
|
|
11454
11454
|
} else
|
|
11455
11455
|
M = parseFloat(mA);
|
|
11456
11456
|
return { heightVal: M, weightVal: parseFloat(TA) };
|
|
11457
|
-
},
|
|
11457
|
+
}, dA = g ? "female" : "male", fA = (M) => {
|
|
11458
11458
|
const cA = I.indexOf(M);
|
|
11459
11459
|
return cA < I.length - 1 ? I[cA + 1] : "submit";
|
|
11460
11460
|
}, NA = () => {
|
|
11461
11461
|
const { heightVal: M, weightVal: cA } = S();
|
|
11462
|
-
e.current.height = String(M), e.current.weight = String(cA), e.current.gender =
|
|
11462
|
+
e.current.height = String(M), e.current.weight = String(cA), e.current.gender = dA, VA && (e.current.age = VA), D(vA), o(ff), p({
|
|
11463
11463
|
height: M,
|
|
11464
11464
|
weight: cA,
|
|
11465
11465
|
heightUnit: vA,
|
|
11466
11466
|
weightUnit: ff,
|
|
11467
|
-
gender:
|
|
11467
|
+
gender: dA,
|
|
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") {
|
|
@@ -11513,10 +11513,10 @@ function z8({
|
|
|
11513
11513
|
weight: 0,
|
|
11514
11514
|
heightUnit: vA,
|
|
11515
11515
|
weightUnit: ff,
|
|
11516
|
-
gender:
|
|
11516
|
+
gender: dA
|
|
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, dA, 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", Df = 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,24 +11561,24 @@ 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(rA, { 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: "×" })
|
|
11581
|
-
] }) : /* @__PURE__ */ P(
|
|
11581
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
11582
11582
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
11583
11583
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: v("Upload your photo") }),
|
|
11584
11584
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: v("Click or drag a full-body photo") }),
|
|
@@ -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",
|
|
@@ -11787,7 +11787,7 @@ function z8({
|
|
|
11787
11787
|
] })
|
|
11788
11788
|
] }),
|
|
11789
11789
|
/* @__PURE__ */ A("input", { ref: gf, type: "file", accept: "image/*", onChange: U, style: { display: "none" } }),
|
|
11790
|
-
K ? /* @__PURE__ */ P(
|
|
11790
|
+
K ? /* @__PURE__ */ P(rA, { children: [
|
|
11791
11791
|
/* @__PURE__ */ A("div", { className: "ps-bpm-spacer" }),
|
|
11792
11792
|
/* @__PURE__ */ P("div", { className: "ps-bpm-bottom", children: [
|
|
11793
11793
|
/* @__PURE__ */ A(
|
|
@@ -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")
|
|
@@ -11844,15 +11844,15 @@ function z8({
|
|
|
11844
11844
|
const M = () => {
|
|
11845
11845
|
if (vA === "in") {
|
|
11846
11846
|
const pA = (parseFloat(ZA) || 5) * 12 + (parseFloat(m) || 8);
|
|
11847
|
-
|
|
11847
|
+
EA(String(Math.round(pA * 2.54)));
|
|
11848
11848
|
}
|
|
11849
|
-
ff === "lbs" && TA && bA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"),
|
|
11849
|
+
ff === "lbs" && TA && bA(String(Math.round(parseFloat(TA) / 2.205))), SA("cm"), iA("kg"), D("cm"), o("kg"), z?.("cm");
|
|
11850
11850
|
}, cA = () => {
|
|
11851
11851
|
if (vA === "cm") {
|
|
11852
11852
|
const pA = parseFloat(mA) || 173, tf = Math.round(pA / 2.54);
|
|
11853
|
-
Hf(String(Math.floor(tf / 12))),
|
|
11853
|
+
Hf(String(Math.floor(tf / 12))), aA(String(tf % 12));
|
|
11854
11854
|
}
|
|
11855
|
-
ff === "kg" && TA && bA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"),
|
|
11855
|
+
ff === "kg" && TA && bA(String(Math.round(parseFloat(TA) * 2.205))), SA("in"), iA("lbs"), D("in"), o("lbs"), z?.("in");
|
|
11856
11856
|
};
|
|
11857
11857
|
return K ? /* @__PURE__ */ A(
|
|
11858
11858
|
w8,
|
|
@@ -11861,11 +11861,11 @@ function z8({
|
|
|
11861
11861
|
wUnit: ff,
|
|
11862
11862
|
isImperialMode: nf,
|
|
11863
11863
|
height: mA,
|
|
11864
|
-
setHeight:
|
|
11864
|
+
setHeight: EA,
|
|
11865
11865
|
heightFeet: ZA,
|
|
11866
11866
|
setHeightFeet: Hf,
|
|
11867
11867
|
heightInches: m,
|
|
11868
|
-
setHeightInches:
|
|
11868
|
+
setHeightInches: aA,
|
|
11869
11869
|
weight: TA,
|
|
11870
11870
|
setWeight: bA,
|
|
11871
11871
|
age: VA,
|
|
@@ -11890,7 +11890,7 @@ function z8({
|
|
|
11890
11890
|
v("Using"),
|
|
11891
11891
|
" ",
|
|
11892
11892
|
/* @__PURE__ */ A("strong", { children: W }),
|
|
11893
|
-
t && /* @__PURE__ */ P(
|
|
11893
|
+
t && /* @__PURE__ */ P(rA, { children: [
|
|
11894
11894
|
" · ",
|
|
11895
11895
|
/* @__PURE__ */ A("button", { type: "button", className: "ps-bp-profile-hint-link", onClick: t, children: v("start fresh") })
|
|
11896
11896
|
] })
|
|
@@ -11905,10 +11905,10 @@ function z8({
|
|
|
11905
11905
|
vA === "in" ? /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11906
11906
|
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "5", value: ZA, onChange: (pA) => Hf(pA.target.value), min: 3, max: 8 }),
|
|
11907
11907
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "ft" }),
|
|
11908
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: m, onChange: (pA) =>
|
|
11908
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "10", value: m, onChange: (pA) => aA(pA.target.value), min: 0, max: 11 }),
|
|
11909
11909
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "in" })
|
|
11910
11910
|
] }) : /* @__PURE__ */ P("div", { className: "ps-bp-inline-input-group", children: [
|
|
11911
|
-
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (pA) =>
|
|
11911
|
+
/* @__PURE__ */ A("input", { type: "number", className: "ps-bp-inline-input", placeholder: "173", value: mA, onChange: (pA) => EA(pA.target.value), min: 100, max: 250 }),
|
|
11912
11912
|
/* @__PURE__ */ A("span", { className: "ps-bp-inline-unit", children: "cm" })
|
|
11913
11913
|
] })
|
|
11914
11914
|
] }),
|
|
@@ -11958,7 +11958,7 @@ function z8({
|
|
|
11958
11958
|
/* @__PURE__ */ A(rf, { img: MA.male.chest.average, label: v("Average"), selected: WA === "average", onSelect: () => a("average"), onHover: () => J(v("A moderate, proportionate chest")), onLeave: () => J("") }),
|
|
11959
11959
|
/* @__PURE__ */ A(rf, { img: MA.male.chest.broad, label: v("Broad"), selected: WA === "broad", onSelect: () => a("broad"), onHover: () => J(v("A wider, more muscular chest")), onLeave: () => J("") })
|
|
11960
11960
|
] }),
|
|
11961
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
11961
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
|
|
11962
11962
|
] }, "step-chest")),
|
|
11963
11963
|
O === "midsection" && (K ? /* @__PURE__ */ A(
|
|
11964
11964
|
iP,
|
|
@@ -11982,16 +11982,16 @@ function z8({
|
|
|
11982
11982
|
"step-midsection-mobile"
|
|
11983
11983
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
11984
11984
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your midsection?") }),
|
|
11985
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(
|
|
11985
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(rA, { children: [
|
|
11986
11986
|
/* @__PURE__ */ A(rf, { img: MA.female.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () => nA("flat"), onHover: () => J(v("A flatter midsection with minimal protrusion")), onLeave: () => J("") }),
|
|
11987
11987
|
/* @__PURE__ */ A(rf, { img: MA.female.stomach.average, label: v("Average"), selected: X === "average", onSelect: () => nA("average"), onHover: () => J(v("A moderate, natural midsection shape")), onLeave: () => J("") }),
|
|
11988
11988
|
/* @__PURE__ */ A(rf, { img: MA.female.stomach.round, label: v("Full"), selected: X === "round", onSelect: () => nA("round"), onHover: () => J(v("A fuller, more rounded midsection")), onLeave: () => J("") })
|
|
11989
|
-
] }) : /* @__PURE__ */ P(
|
|
11989
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
11990
11990
|
/* @__PURE__ */ A(rf, { img: MA.male.stomach.flat, label: v("Flat"), selected: X === "flat", onSelect: () => nA("flat"), onHover: () => J(v("A flatter midsection with minimal protrusion")), onLeave: () => J("") }),
|
|
11991
11991
|
/* @__PURE__ */ A(rf, { img: MA.male.stomach.average, label: v("Average"), selected: X === "average", onSelect: () => nA("average"), onHover: () => J(v("A moderate, natural midsection shape")), onLeave: () => J("") }),
|
|
11992
11992
|
/* @__PURE__ */ A(rf, { img: MA.male.stomach.round, label: v("Full"), selected: X === "round", onSelect: () => nA("round"), onHover: () => J(v("A fuller, more rounded midsection")), onLeave: () => J("") })
|
|
11993
11993
|
] }) }),
|
|
11994
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
11994
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
|
|
11995
11995
|
] }, "step-midsection")),
|
|
11996
11996
|
O === "seat" && (K ? /* @__PURE__ */ A(
|
|
11997
11997
|
iP,
|
|
@@ -12015,16 +12015,16 @@ function z8({
|
|
|
12015
12015
|
"step-seat-mobile"
|
|
12016
12016
|
) : /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-single-q", children: [
|
|
12017
12017
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Which best describes your seat?") }),
|
|
12018
|
-
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(
|
|
12018
|
+
/* @__PURE__ */ A("div", { className: "ps-bp-shape-row ps-bp-shape-row-full", children: g ? /* @__PURE__ */ P(rA, { children: [
|
|
12019
12019
|
/* @__PURE__ */ A(rf, { img: MA.female.seat.narrow, label: v("Flat"), selected: zA === "narrow", onSelect: () => YA("narrow"), onHover: () => J(v("A flatter backside with less projection")), onLeave: () => J("") }),
|
|
12020
12020
|
/* @__PURE__ */ A(rf, { img: MA.female.seat.average, label: v("Average"), selected: zA === "average", onSelect: () => YA("average"), onHover: () => J(v("A moderate, natural backside shape")), onLeave: () => J("") }),
|
|
12021
12021
|
/* @__PURE__ */ A(rf, { img: MA.female.seat.full, label: v("Full"), selected: zA === "full", onSelect: () => YA("full"), onHover: () => J(v("A fuller, more rounded backside")), onLeave: () => J("") })
|
|
12022
|
-
] }) : /* @__PURE__ */ P(
|
|
12022
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
12023
12023
|
/* @__PURE__ */ A(rf, { img: MA.male.seat.narrow, label: v("Flat"), selected: zA === "narrow", onSelect: () => YA("narrow"), onHover: () => J(v("A flatter backside with less projection")), onLeave: () => J("") }),
|
|
12024
12024
|
/* @__PURE__ */ A(rf, { img: MA.male.seat.average, label: v("Average"), selected: zA === "average", onSelect: () => YA("average"), onHover: () => J(v("A moderate, natural backside shape")), onLeave: () => J("") }),
|
|
12025
12025
|
/* @__PURE__ */ A(rf, { img: MA.male.seat.full, label: v("Full"), selected: zA === "full", onSelect: () => YA("full"), onHover: () => J(v("A fuller, more rounded backside")), onLeave: () => J("") })
|
|
12026
12026
|
] }) }),
|
|
12027
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12027
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
|
|
12028
12028
|
] }, "step-seat")),
|
|
12029
12029
|
O === "hips" && g && (K ? /* @__PURE__ */ A(
|
|
12030
12030
|
iP,
|
|
@@ -12037,19 +12037,19 @@ 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
|
-
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children:
|
|
12052
|
+
/* @__PURE__ */ A("p", { className: "ps-bp-hover-hint", children: wf || " " })
|
|
12053
12053
|
] }, "step-hips")),
|
|
12054
12054
|
O === "bra" && g && /* @__PURE__ */ P("div", { className: "ps-bp-step ps-bp-step-enter ps-bp-bra-step", children: [
|
|
12055
12055
|
/* @__PURE__ */ A("h2", { className: "ps-bp-title", children: v("Select your bra size") }),
|
|
@@ -12125,7 +12125,7 @@ function z8({
|
|
|
12125
12125
|
q && /* @__PURE__ */ A("p", { className: "ps-bp-error", children: q })
|
|
12126
12126
|
] }, "step-bra"),
|
|
12127
12127
|
!(K && O === "basics") && (() => {
|
|
12128
|
-
const M = O === "basics" && F && !!h, cA = M ? h : $A, pA = xf(vA) ? ` (${xf(vA)})` : "", tf = M ? v("Find My Best Fit") + pA :
|
|
12128
|
+
const M = O === "basics" && F && !!h, cA = M ? h : $A, pA = xf(vA) ? ` (${xf(vA)})` : "", tf = M ? v("Find My Best Fit") + pA : Df ? v("Find My Size") + pA : v("Next");
|
|
12129
12129
|
return /* @__PURE__ */ P("div", { className: "ps-bp-nav", children: [
|
|
12130
12130
|
O !== "basics" ? /* @__PURE__ */ P("button", { className: "ps-bp-back-btn", onClick: yA, type: "button", children: [
|
|
12131
12131
|
/* @__PURE__ */ A("span", { className: "ps-bp-back-arrow", children: "←" }),
|
|
@@ -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,
|
|
@@ -12174,28 +12174,28 @@ function SP({
|
|
|
12174
12174
|
}) {
|
|
12175
12175
|
const k = e === "close-up", u = NP(), [v, I] = j("manual"), [O, N] = j(() => {
|
|
12176
12176
|
const m = {};
|
|
12177
|
-
return n.forEach((
|
|
12178
|
-
m[
|
|
12177
|
+
return n.forEach((aA) => {
|
|
12178
|
+
m[aA.key] = i.current[aA.key] || "";
|
|
12179
12179
|
}), m;
|
|
12180
|
-
}), [K, E] = j(""), BA =
|
|
12181
|
-
const
|
|
12182
|
-
if (!
|
|
12183
|
-
const TA = URL.createObjectURL(
|
|
12184
|
-
y(
|
|
12180
|
+
}), [K, E] = j(""), BA = tA(null), [c, hA] = j(null), [l, y] = j(null), [XA, sA] = j(null), [V, s] = j(null), PA = UA(async (m) => {
|
|
12181
|
+
const aA = m.target.files?.[0];
|
|
12182
|
+
if (!aA) return;
|
|
12183
|
+
const TA = URL.createObjectURL(aA);
|
|
12184
|
+
y(aA), hA(TA);
|
|
12185
12185
|
try {
|
|
12186
|
-
const bA = await AP(
|
|
12186
|
+
const bA = await AP(aA);
|
|
12187
12187
|
sA(bA);
|
|
12188
12188
|
} catch {
|
|
12189
12189
|
}
|
|
12190
12190
|
}, []), RA = UA(() => {
|
|
12191
12191
|
c && URL.revokeObjectURL(c), y(null), hA(null), sA(null);
|
|
12192
|
-
}, [c]), mA = (m,
|
|
12193
|
-
N((TA) => ({ ...TA, [m]:
|
|
12194
|
-
},
|
|
12192
|
+
}, [c]), mA = (m, aA) => {
|
|
12193
|
+
N((TA) => ({ ...TA, [m]: aA })), E("");
|
|
12194
|
+
}, EA = () => {
|
|
12195
12195
|
const m = n[0];
|
|
12196
12196
|
if (!m) return;
|
|
12197
|
-
const
|
|
12198
|
-
if (!
|
|
12197
|
+
const aA = parseFloat(O[m.key] || "");
|
|
12198
|
+
if (!aA || aA <= 0) {
|
|
12199
12199
|
E(t("Please enter your ") + t(m.label).toLowerCase());
|
|
12200
12200
|
return;
|
|
12201
12201
|
}
|
|
@@ -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
|
|
@@ -12260,7 +12260,7 @@ function SP({
|
|
|
12260
12260
|
type: "number",
|
|
12261
12261
|
className: "ps-bpm-value-input",
|
|
12262
12262
|
value: O[m.key],
|
|
12263
|
-
onChange: (
|
|
12263
|
+
onChange: (aA) => mA(m.key, aA.target.value),
|
|
12264
12264
|
placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
|
|
12265
12265
|
step: m.step ?? 0.5,
|
|
12266
12266
|
min: m.min,
|
|
@@ -12273,7 +12273,7 @@ function SP({
|
|
|
12273
12273
|
K && /* @__PURE__ */ A("p", { className: "ps-acc-error", style: { paddingTop: 8 }, children: K })
|
|
12274
12274
|
] }),
|
|
12275
12275
|
/* @__PURE__ */ A("div", { style: { flex: 1, minHeight: 16 } }),
|
|
12276
|
-
!B && /* @__PURE__ */ P(
|
|
12276
|
+
!B && /* @__PURE__ */ P(rA, { children: [
|
|
12277
12277
|
/* @__PURE__ */ A("div", { className: "ps-bpm-or", children: /* @__PURE__ */ A("span", { children: t("or") }) }),
|
|
12278
12278
|
/* @__PURE__ */ P("button", { type: "button", className: "ps-bpm-upload-link", onClick: () => I("photo"), children: [
|
|
12279
12279
|
/* @__PURE__ */ A(Un, {}),
|
|
@@ -12282,7 +12282,7 @@ function SP({
|
|
|
12282
12282
|
] })
|
|
12283
12283
|
] }),
|
|
12284
12284
|
/* @__PURE__ */ P("div", { className: "ps-bpm-bottom", children: [
|
|
12285
|
-
/* @__PURE__ */ P("button", { type: "button", className: "ps-bpm-next-btn", onClick:
|
|
12285
|
+
/* @__PURE__ */ P("button", { type: "button", className: "ps-bpm-next-btn", onClick: EA, children: [
|
|
12286
12286
|
t("Find My Size"),
|
|
12287
12287
|
xf(o) ? ` (${xf(o)})` : "",
|
|
12288
12288
|
" ",
|
|
@@ -12328,12 +12328,12 @@ function SP({
|
|
|
12328
12328
|
filter: !c && V !== !0 ? "blur(6px) saturate(0.7)" : void 0,
|
|
12329
12329
|
pointerEvents: !c && V !== !0 ? "none" : void 0
|
|
12330
12330
|
},
|
|
12331
|
-
children: c ? /* @__PURE__ */ P(
|
|
12331
|
+
children: c ? /* @__PURE__ */ P(rA, { children: [
|
|
12332
12332
|
/* @__PURE__ */ A("img", { src: c, alt: "preview", style: { width: "100%", height: "100%", objectFit: "contain" } }),
|
|
12333
12333
|
/* @__PURE__ */ A("button", { onClick: (m) => {
|
|
12334
12334
|
m.stopPropagation(), RA();
|
|
12335
12335
|
}, style: { position: "absolute", top: "0.5vw", right: "0.5vw", width: "1.4vw", height: "1.4vw", borderRadius: "50%", background: "rgba(0,0,0,0.6)", border: "none", color: "#fff", fontSize: "0.7vw", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: "×" })
|
|
12336
|
-
] }) : /* @__PURE__ */ P(
|
|
12336
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
12337
12337
|
/* @__PURE__ */ A(zP, { size: 32 }),
|
|
12338
12338
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.85vw", fontWeight: 600, color: "var(--ps-text-primary)", marginTop: "0.5vw" }, children: t(k ? "Upload close-up photo" : "Upload your photo") }),
|
|
12339
12339
|
/* @__PURE__ */ A("span", { style: { fontSize: "0.6vw", color: "var(--ps-text-muted)", marginTop: "0.2vw" }, children: t(k ? "Click or drag a close-up face photo" : "Click or drag a full-body photo") }),
|
|
@@ -12484,7 +12484,7 @@ function SP({
|
|
|
12484
12484
|
/* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.75vw", fontWeight: 700 }, children: "✓" }),
|
|
12485
12485
|
/* @__PURE__ */ A("span", { style: { color: "#1c9d4c", fontSize: "0.65vw", fontWeight: 600 }, children: t("Do") })
|
|
12486
12486
|
] }),
|
|
12487
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(
|
|
12487
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(rA, { children: [
|
|
12488
12488
|
t("Face the camera directly, centered in frame"),
|
|
12489
12489
|
/* @__PURE__ */ A("br", {}),
|
|
12490
12490
|
t("Use natural, even lighting (e.g. near a window)"),
|
|
@@ -12494,7 +12494,7 @@ function SP({
|
|
|
12494
12494
|
t("Choose a plain, light background"),
|
|
12495
12495
|
/* @__PURE__ */ A("br", {}),
|
|
12496
12496
|
t("Hold the camera at eye level")
|
|
12497
|
-
] }) : /* @__PURE__ */ P(
|
|
12497
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
12498
12498
|
t("Stand facing the camera with your full body in frame"),
|
|
12499
12499
|
/* @__PURE__ */ A("br", {}),
|
|
12500
12500
|
t("Use natural or even lighting (e.g. near a window)"),
|
|
@@ -12511,7 +12511,7 @@ function SP({
|
|
|
12511
12511
|
/* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.75vw", fontWeight: 700 }, children: "✗" }),
|
|
12512
12512
|
/* @__PURE__ */ A("span", { style: { color: "#e7000b", fontSize: "0.65vw", fontWeight: 600 }, children: t("Don't") })
|
|
12513
12513
|
] }),
|
|
12514
|
-
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(
|
|
12514
|
+
/* @__PURE__ */ A("div", { style: { fontSize: "0.58vw", color: "var(--ps-text-primary)", lineHeight: 1.8 }, children: k ? /* @__PURE__ */ P(rA, { children: [
|
|
12515
12515
|
t("Don't wear sunglasses or a hat in the photo"),
|
|
12516
12516
|
/* @__PURE__ */ A("br", {}),
|
|
12517
12517
|
t("Don't tilt or turn your head"),
|
|
@@ -12521,7 +12521,7 @@ function SP({
|
|
|
12521
12521
|
t("Don't crop out your ears or top of head"),
|
|
12522
12522
|
/* @__PURE__ */ A("br", {}),
|
|
12523
12523
|
t("Don't apply filters or heavy edits")
|
|
12524
|
-
] }) : /* @__PURE__ */ P(
|
|
12524
|
+
] }) : /* @__PURE__ */ P(rA, { children: [
|
|
12525
12525
|
t("Don't wear loose, baggy, or layered clothing"),
|
|
12526
12526
|
/* @__PURE__ */ A("br", {}),
|
|
12527
12527
|
t("Don't sit, pose, or bend your body"),
|
|
@@ -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
|
|
@@ -12595,7 +12595,7 @@ function SP({
|
|
|
12595
12595
|
type: "number",
|
|
12596
12596
|
className: "ps-bp-inline-input",
|
|
12597
12597
|
value: O[m.key],
|
|
12598
|
-
onChange: (
|
|
12598
|
+
onChange: (aA) => mA(m.key, aA.target.value),
|
|
12599
12599
|
placeholder: m.placeholder[o] || m.placeholder.cm || m.placeholder.in || "",
|
|
12600
12600
|
step: m.step ?? 0.5,
|
|
12601
12601
|
min: m.min,
|
|
@@ -12613,7 +12613,7 @@ function SP({
|
|
|
12613
12613
|
] }),
|
|
12614
12614
|
/* @__PURE__ */ P("div", { className: "ps-bp-nav", style: { marginTop: "auto" }, children: [
|
|
12615
12615
|
/* @__PURE__ */ A("div", {}),
|
|
12616
|
-
/* @__PURE__ */ P("button", { className: "ps-bp-next-btn", onClick:
|
|
12616
|
+
/* @__PURE__ */ P("button", { className: "ps-bp-next-btn", onClick: EA, type: "button", children: [
|
|
12617
12617
|
t("Find My Size"),
|
|
12618
12618
|
xf(o) ? ` (${xf(o)})` : "",
|
|
12619
12619
|
" ",
|
|
@@ -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,
|
|
@@ -12803,32 +12803,32 @@ function R8({
|
|
|
12803
12803
|
JA(() => {
|
|
12804
12804
|
o !== void 0 && K(o);
|
|
12805
12805
|
}, [o]);
|
|
12806
|
-
const E =
|
|
12806
|
+
const E = vf(() => Hg(N || void 0), [N]), BA = e ?? E("Virtual Try-On"), [c, hA] = j(!1);
|
|
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,
|
|
12810
|
+
const [l, y] = j("idle"), [XA, sA] = j(null), [V, s] = j(null), [PA, RA] = j(null), [mA, EA] = j(null), [ZA, Hf] = j(!1), [m, aA] = j(!1), [TA, bA] = j(null), [VA, kA] = j(null), [vA, SA] = j(null), [ff, iA] = j(!1), [nf, xA] = j(!1), [Ef, eA] = j(!1), [$, _A] = j(null), [Of, cf] = j(!1), Mf = tA(!1), [gf, qA] = j(Xg), GA = Yn(gf), [_, uA] = j(GA ? "in" : "cm"), [WA, a] = j(GA ? "in" : "cm"), [X, nA] = j(GA ? "lbs" : "kg");
|
|
12811
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 = tA({}), [oA, zA] = j("male"), [YA, wf] = j(0), [J, gA] = j(null), [Bf, FA] = j(!1), [OA, AA] = j(() => af("profiles", [])), [LA, Pf] = j(() => af("history", [])), [lA, x] = j(() => Kn()), [q, QA] = j(() => /* @__PURE__ */ new Set()), [U, R] = j(null), G = UA((w) => {
|
|
12816
12816
|
x(w), Tg(w);
|
|
12817
|
-
}, []), [S,
|
|
12818
|
-
}), M = UA((w,
|
|
12819
|
-
KA.current = w,
|
|
12820
|
-
}, []), cA =
|
|
12817
|
+
}, []), [S, dA] = j(!1), [fA, NA] = j(null), [$A, ef] = j(null), yA = tA(null), KA = tA(() => !1), Df = tA(() => {
|
|
12818
|
+
}), M = UA((w, Q) => {
|
|
12819
|
+
KA.current = w, Df.current = Q;
|
|
12820
|
+
}, []), cA = tA(null), pA = tA(null), tf = tA(null), Cf = tA(null), IA = tA(null), pf = tA(!1), qn = tA(null), If = tA(null), [Wn, lf] = j(null), [Vn, LP] = j(null), Jf = tA(null);
|
|
12821
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 () => {
|
|
12828
|
-
|
|
12828
|
+
Cf.current?.(), tf.current?.disconnect(), IA.current && clearInterval(IA.current);
|
|
12829
12829
|
};
|
|
12830
12830
|
}, [B]);
|
|
12831
|
-
const cP = 22, nP =
|
|
12831
|
+
const cP = 22, nP = tA(0), mf = tA(null), Nf = tA(null), Sf = tA(null), Lf = tA(null), yf = tA(null), pP = tA(null), jP = tA(""), Tf = tA(null);
|
|
12832
12832
|
JA(() => {
|
|
12833
12833
|
if (l === "processing") {
|
|
12834
12834
|
if (Tf.current) 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 });
|
|
@@ -12906,7 +12906,7 @@ function R8({
|
|
|
12906
12906
|
_A({ found: !1 });
|
|
12907
12907
|
}).finally(() => cf(!1));
|
|
12908
12908
|
}, [B, n, I]);
|
|
12909
|
-
const $n =
|
|
12909
|
+
const $n = vf(() => {
|
|
12910
12910
|
switch (l) {
|
|
12911
12911
|
case "welcome":
|
|
12912
12912
|
case "body-profile":
|
|
@@ -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,31 +12959,31 @@ 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", []));
|
|
12975
12975
|
}
|
|
12976
12976
|
},
|
|
12977
12977
|
[lA, OA, B, f, n, O, G]
|
|
12978
|
-
), UP =
|
|
12979
|
-
const
|
|
12980
|
-
if (!wA && L &&
|
|
12978
|
+
), UP = tA(null), [qf, EP] = j(null), yP = UA(async (w) => {
|
|
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",
|
|
@@ -12994,7 +12994,7 @@ function R8({
|
|
|
12994
12994
|
}
|
|
12995
12995
|
return;
|
|
12996
12996
|
}
|
|
12997
|
-
SA(null),
|
|
12997
|
+
SA(null), iA(!0), xA(wA), wA && (s(null), lf(null));
|
|
12998
12998
|
const Z = w.photoBase64;
|
|
12999
12999
|
if (Z)
|
|
13000
13000
|
try {
|
|
@@ -13017,23 +13017,23 @@ function R8({
|
|
|
13017
13017
|
}).then((d) => {
|
|
13018
13018
|
d?.raw && SA(d.raw), xA(!0);
|
|
13019
13019
|
}).catch(() => {
|
|
13020
|
-
}).finally(() =>
|
|
13020
|
+
}).finally(() => iA(!1));
|
|
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;
|
|
13029
13029
|
EP(null), yP(w);
|
|
13030
13030
|
}, [qf, yP]), fg = UA(() => {
|
|
13031
|
-
EP(null),
|
|
13032
|
-
}, []), Pg =
|
|
13031
|
+
EP(null), wf((w) => w + 1), y("body-profile");
|
|
13032
|
+
}, []), Pg = tA(() => {
|
|
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),
|
|
13036
|
+
y("idle"), sA(null), NA(null), ef(null), V && URL.revokeObjectURL(V), s(null), RA(null), EA(null), kA(null), SA(null), iA(!1), gA(null), FA(!1), dA(!1), H.current = {}, zA("male"), Yf.current = !1, Cf.current?.(), Cf.current = null, IA.current && (clearInterval(IA.current), IA.current = null), W?.();
|
|
13037
13037
|
}, [W, V]), gg = UA(() => {
|
|
13038
13038
|
if (fA) {
|
|
13039
13039
|
NA(null), yA.current && (y(yA.current), yA.current = null);
|
|
@@ -13061,7 +13061,7 @@ function R8({
|
|
|
13061
13061
|
break;
|
|
13062
13062
|
case "profiles":
|
|
13063
13063
|
if (KA.current()) {
|
|
13064
|
-
|
|
13064
|
+
Df.current();
|
|
13065
13065
|
break;
|
|
13066
13066
|
}
|
|
13067
13067
|
y(yA.current || "body-profile"), yA.current = null;
|
|
@@ -13072,44 +13072,44 @@ function R8({
|
|
|
13072
13072
|
}
|
|
13073
13073
|
}, [l, fA, TA, Gf]), Bg = l !== "idle" && l !== "processing" && l !== "result" && l !== "welcome" && l !== "body-profile" && l !== "size-result", ZP = UA((w) => {
|
|
13074
13074
|
if (!pg(w)) {
|
|
13075
|
-
|
|
13075
|
+
EA(E("Please upload a JPEG, PNG, or WebP image.")), y("error"), v?.({ message: "Invalid file type", code: "INVALID_FILE" });
|
|
13076
13076
|
return;
|
|
13077
13077
|
}
|
|
13078
13078
|
if (w.size > 10 * 1024 * 1024) {
|
|
13079
|
-
|
|
13079
|
+
EA(E("Image must be under 10MB.")), y("error"), v?.({ message: "File too large", code: "FILE_TOO_LARGE" });
|
|
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
|
});
|
|
13088
13088
|
}, [t, v]), qP = UA(() => {
|
|
13089
13089
|
sA(null), V && URL.revokeObjectURL(V), s(null);
|
|
13090
13090
|
}, [V]), Wf = UA(() => {
|
|
13091
|
-
IA.current && (clearInterval(IA.current), IA.current = null),
|
|
13091
|
+
IA.current && (clearInterval(IA.current), IA.current = null), Cf.current?.(), Cf.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
|
-
|
|
13104
|
+
pf.current = !0, Wf(), eA(!1);
|
|
13105
|
+
const Q = w.error || E("Try-on generation failed");
|
|
13106
|
+
EA(Q), y("error"), v?.({ message: Q });
|
|
13107
13107
|
}
|
|
13108
|
-
}, [u, v, Wf]), Kf =
|
|
13108
|
+
}, [u, v, Wf]), Kf = vf(() => $?.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;
|
|
@@ -13134,7 +13134,7 @@ function R8({
|
|
|
13134
13134
|
sizingUnit: L === "head" ? "cm" : "mm",
|
|
13135
13135
|
category: L,
|
|
13136
13136
|
...Object.keys(CA).length > 0 && { faceMeasurementsMm: CA, irisConfidence: 1 }
|
|
13137
|
-
},
|
|
13137
|
+
}, of = new Promise((jA) => setTimeout(jA, 4500));
|
|
13138
13138
|
try {
|
|
13139
13139
|
const jA = await fetch(`${Y}/api/v1/sizing/face-recommend`, {
|
|
13140
13140
|
method: "POST",
|
|
@@ -13143,51 +13143,51 @@ function R8({
|
|
|
13143
13143
|
});
|
|
13144
13144
|
if (jA.ok) {
|
|
13145
13145
|
const Af = await jA.json();
|
|
13146
|
-
await
|
|
13146
|
+
await of, SA(Af), u?.(Af);
|
|
13147
13147
|
} else {
|
|
13148
13148
|
const Af = await jA.text().catch(() => "");
|
|
13149
|
-
console.error("[PS-SDK] face-recommend failed:", jA.status, Af), await
|
|
13149
|
+
console.error("[PS-SDK] face-recommend failed:", jA.status, Af), await of, EA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
|
|
13150
13150
|
}
|
|
13151
13151
|
} catch (jA) {
|
|
13152
|
-
console.error("[PS-SDK] face-recommend network error:", jA), await
|
|
13152
|
+
console.error("[PS-SDK] face-recommend network error:", jA), await of, EA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
|
|
13153
13153
|
} finally {
|
|
13154
|
-
|
|
13154
|
+
iA(!1);
|
|
13155
13155
|
}
|
|
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)), iA(!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",
|
|
@@ -13216,17 +13216,17 @@ function R8({
|
|
|
13216
13216
|
);
|
|
13217
13217
|
} else {
|
|
13218
13218
|
const b = await d.text().catch(() => "");
|
|
13219
|
-
console.error("[PS-SDK] Sizing recommend failed:", d.status, b),
|
|
13219
|
+
console.error("[PS-SDK] Sizing recommend failed:", d.status, b), EA(E("Unable to get size recommendation. Please try again.")), y("error"), xA(!0);
|
|
13220
13220
|
}
|
|
13221
13221
|
} catch (d) {
|
|
13222
|
-
console.error("[PS-SDK] Sizing recommend network error:", d),
|
|
13222
|
+
console.error("[PS-SDK] Sizing recommend network error:", d), EA(E("Unable to connect to sizing service. Please try again.")), y("error"), xA(!0);
|
|
13223
13223
|
} finally {
|
|
13224
|
-
|
|
13224
|
+
iA(!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
|
-
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."),
|
|
13229
|
+
console.warn("[ps-sdk] handleQuickEstimate BAILED — apiRef is null. API key not loaded."), EA(jA), y("error"), v?.({ message: jA, code: "SDK_NOT_CONFIGURED" });
|
|
13230
13230
|
return;
|
|
13231
13231
|
}
|
|
13232
13232
|
uf(B), bf();
|
|
@@ -13239,12 +13239,12 @@ function R8({
|
|
|
13239
13239
|
}
|
|
13240
13240
|
for (const jA of Kf)
|
|
13241
13241
|
jA.required && jA.unit === "cm" && !zf.has(jA.key) && df.add(jA.key);
|
|
13242
|
-
const
|
|
13243
|
-
if (console.log("[PS-SDK] Quick estimate — dynamicFields:", Kf.map((jA) => `${jA.key}(${jA.unit},req=${jA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:",
|
|
13244
|
-
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"),
|
|
13242
|
+
const of = Array.from(df);
|
|
13243
|
+
if (console.log("[PS-SDK] Quick estimate — dynamicFields:", Kf.map((jA) => `${jA.key}(${jA.unit},req=${jA.required})`)), console.log("[PS-SDK] Quick estimate — requiredFieldKeys:", of), console.log("[PS-SDK] Quick estimate — profiles:", { chestProfile: b, midsectionProfile: HA, hipProfile: DA }), of.length === 0) {
|
|
13244
|
+
console.warn("[PS-SDK] No body measurement fields found — skipping estimation review"), kA("quick"), iA(!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"), iA(!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,
|
|
@@ -13252,19 +13252,25 @@ function R8({
|
|
|
13252
13252
|
apiUrl: B
|
|
13253
13253
|
}), !pA.current || !tf.current) {
|
|
13254
13254
|
const DA = E("SDK not configured. Please refresh and try again.");
|
|
13255
|
-
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."),
|
|
13255
|
+
console.warn("[ps-sdk] handleSnapSubmit BAILED — apiRef or sseRef is null. Check api init."), EA(DA), y("error"), v?.({ message: DA, code: "SDK_NOT_CONFIGURED" });
|
|
13256
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), iA(!0), xA(!1), y("size-result");
|
|
13262
13262
|
const L = Xf(n);
|
|
13263
13263
|
if (L === "face" || L === "head") {
|
|
13264
13264
|
LP(null);
|
|
13265
13265
|
const DA = new Promise((CA) => setTimeout(CA, 4500));
|
|
13266
13266
|
try {
|
|
13267
13267
|
const CA = await dg(wA);
|
|
13268
|
+
if (!CA) {
|
|
13269
|
+
console.warn("[ps-sdk] face detection returned no result — likely a full-body photo for a face/head product"), await DA;
|
|
13270
|
+
const of = E(L === "head" ? "We couldn't detect your head clearly. Please upload a close-up photo that shows your full head and ears." : "We couldn't detect your face clearly. Please upload a close-up selfie that shows both eyes.");
|
|
13271
|
+
EA(of), y("error"), v?.({ message: of, code: "FACE_DETECTION_FAILED" }), iA(!1);
|
|
13272
|
+
return;
|
|
13273
|
+
}
|
|
13268
13274
|
CA && LP(CA.landmarks);
|
|
13269
13275
|
const zf = {
|
|
13270
13276
|
product: { title: n, productId: O },
|
|
@@ -13274,14 +13280,14 @@ function R8({
|
|
|
13274
13280
|
bodyImage: w.photoBase64
|
|
13275
13281
|
};
|
|
13276
13282
|
CA && (zf.faceMeasurementsMm = CA.measurementsMm, zf.faceLandmarks = CA.landmarks, zf.irisConfidence = CA.irisConfidence);
|
|
13277
|
-
const df = await fetch(`${
|
|
13283
|
+
const df = await fetch(`${Q}/api/v1/sizing/face-recommend`, {
|
|
13278
13284
|
method: "POST",
|
|
13279
13285
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${Y}` },
|
|
13280
13286
|
body: JSON.stringify(zf)
|
|
13281
13287
|
});
|
|
13282
13288
|
if (df.ok) {
|
|
13283
|
-
const
|
|
13284
|
-
await DA, SA(
|
|
13289
|
+
const of = await df.json();
|
|
13290
|
+
await DA, SA(of), u?.(of), Zf(
|
|
13285
13291
|
{
|
|
13286
13292
|
gender: w.gender,
|
|
13287
13293
|
height: w.height,
|
|
@@ -13291,14 +13297,14 @@ function R8({
|
|
|
13291
13297
|
age: w.age,
|
|
13292
13298
|
bodyImage: w.photoBase64
|
|
13293
13299
|
},
|
|
13294
|
-
|
|
13300
|
+
of
|
|
13295
13301
|
);
|
|
13296
13302
|
} else
|
|
13297
13303
|
await DA, xA(!0);
|
|
13298
13304
|
} catch (CA) {
|
|
13299
13305
|
console.error("[ps-sdk] face-recommend failed:", CA), await DA, xA(!0);
|
|
13300
13306
|
}
|
|
13301
|
-
|
|
13307
|
+
iA(!1);
|
|
13302
13308
|
return;
|
|
13303
13309
|
}
|
|
13304
13310
|
If.current = null, lf(null), rP(wA).then((DA) => (If.current = DA, DA)).catch(() => null);
|
|
@@ -13329,7 +13335,7 @@ function R8({
|
|
|
13329
13335
|
};
|
|
13330
13336
|
$?.found && (HA.sizeGuide = $);
|
|
13331
13337
|
try {
|
|
13332
|
-
const DA = await fetch(`${
|
|
13338
|
+
const DA = await fetch(`${Q}/api/v1/sizing/recommend`, {
|
|
13333
13339
|
method: "POST",
|
|
13334
13340
|
headers: { "Content-Type": "application/json", Authorization: `Bearer ${Y}` },
|
|
13335
13341
|
body: JSON.stringify(HA)
|
|
@@ -13353,18 +13359,18 @@ function R8({
|
|
|
13353
13359
|
} catch {
|
|
13354
13360
|
xA(!0);
|
|
13355
13361
|
}
|
|
13356
|
-
|
|
13362
|
+
iA(!1);
|
|
13357
13363
|
}, [B, f, n, _, X, gf, $, Kf, Zf]);
|
|
13358
13364
|
UP.current = dP;
|
|
13359
13365
|
const WP = UA(async (w) => {
|
|
13360
|
-
const
|
|
13361
|
-
if (!
|
|
13366
|
+
const Q = w || XA || Jf.current;
|
|
13367
|
+
if (!Q || !pA.current || !tf.current) {
|
|
13362
13368
|
const Z = pA.current ? E("Please upload a photo first.") : E("SDK not configured. Please provide an API key.");
|
|
13363
|
-
|
|
13369
|
+
EA(Z), y("error"), v?.({ message: Z, code: "SDK_NOT_CONFIGURED" });
|
|
13364
13370
|
return;
|
|
13365
13371
|
}
|
|
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(
|
|
13372
|
+
w && w !== XA && (sA(w), Jf.current = w), pf.current = !1, eA(!0);
|
|
13373
|
+
const Y = En(Xf(n)), wA = Y === "apparel", L = (w ? null : V) || URL.createObjectURL(Q);
|
|
13368
13374
|
(w || !V) && s(L), If.current = null, lf(null), wA && (rP(L).then((Z) => {
|
|
13369
13375
|
If.current = Z;
|
|
13370
13376
|
}).catch(() => {
|
|
@@ -13373,7 +13379,7 @@ function R8({
|
|
|
13373
13379
|
}).catch(() => {
|
|
13374
13380
|
}));
|
|
13375
13381
|
try {
|
|
13376
|
-
const Z = await AP(
|
|
13382
|
+
const Z = await AP(Q);
|
|
13377
13383
|
let d;
|
|
13378
13384
|
wA && vA?.matchDetails?.length && (d = xg(vA.matchDetails, If.current));
|
|
13379
13385
|
const b = await pA.current.submitTryOn(
|
|
@@ -13387,7 +13393,7 @@ function R8({
|
|
|
13387
13393
|
silhouetteContext: Cn(vA, $)
|
|
13388
13394
|
}
|
|
13389
13395
|
);
|
|
13390
|
-
k?.(b.jobId),
|
|
13396
|
+
k?.(b.jobId), Cf.current = tf.current.onJob(b.jobId, aP);
|
|
13391
13397
|
let HA = 0;
|
|
13392
13398
|
IA.current = setInterval(async () => {
|
|
13393
13399
|
if (pf.current) {
|
|
@@ -13406,12 +13412,12 @@ function R8({
|
|
|
13406
13412
|
}, 3e3);
|
|
13407
13413
|
} catch (Z) {
|
|
13408
13414
|
const d = Z instanceof Error ? Z.message : E("Failed to start try-on"), b = Z instanceof an ? Z.code : void 0;
|
|
13409
|
-
|
|
13415
|
+
EA(d), y("error"), v?.({ message: d, code: b });
|
|
13410
13416
|
}
|
|
13411
13417
|
}, [XA, f, n, vA, k, v, aP]), og = UA(async (w) => {
|
|
13412
13418
|
if (!XA || !pA.current || !tf.current) return;
|
|
13413
|
-
|
|
13414
|
-
const
|
|
13419
|
+
aA(!0);
|
|
13420
|
+
const Q = En(Xf(n)), Y = Q === "apparel";
|
|
13415
13421
|
if (Y && If.current) {
|
|
13416
13422
|
const wA = {
|
|
13417
13423
|
chest: "chest",
|
|
@@ -13429,20 +13435,20 @@ function R8({
|
|
|
13429
13435
|
}
|
|
13430
13436
|
}
|
|
13431
13437
|
try {
|
|
13432
|
-
pf.current = !1,
|
|
13438
|
+
pf.current = !1, Cf.current?.(), IA.current && (clearInterval(IA.current), IA.current = null);
|
|
13433
13439
|
const wA = await AP(XA), L = Y ? w : void 0, Z = await pA.current.submitTryOn(
|
|
13434
13440
|
wA,
|
|
13435
13441
|
f,
|
|
13436
13442
|
L,
|
|
13437
|
-
|
|
13443
|
+
Q ?? "apparel",
|
|
13438
13444
|
{
|
|
13439
13445
|
productId: O,
|
|
13440
13446
|
productTitle: n,
|
|
13441
13447
|
silhouetteContext: Cn(vA, $)
|
|
13442
13448
|
}
|
|
13443
13449
|
);
|
|
13444
|
-
|
|
13445
|
-
b.status === "completed" && b.imageUrl ? (RA(b.imageUrl),
|
|
13450
|
+
Cf.current = tf.current.onJob(Z.jobId, (b) => {
|
|
13451
|
+
b.status === "completed" && b.imageUrl ? (RA(b.imageUrl), aA(!1), pf.current = !0, Cf.current?.(), Cf.current = null, IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (aA(!1), pf.current = !0, Cf.current?.(), Cf.current = null, IA.current && (clearInterval(IA.current), IA.current = null));
|
|
13446
13452
|
});
|
|
13447
13453
|
let d = 0;
|
|
13448
13454
|
IA.current = setInterval(async () => {
|
|
@@ -13451,17 +13457,17 @@ function R8({
|
|
|
13451
13457
|
return;
|
|
13452
13458
|
}
|
|
13453
13459
|
if (d++, d > 60) {
|
|
13454
|
-
IA.current && clearInterval(IA.current), IA.current = null,
|
|
13460
|
+
IA.current && clearInterval(IA.current), IA.current = null, aA(!1);
|
|
13455
13461
|
return;
|
|
13456
13462
|
}
|
|
13457
13463
|
try {
|
|
13458
13464
|
const b = await pA.current.getStatus(Z.jobId);
|
|
13459
|
-
b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl),
|
|
13465
|
+
b.status === "completed" && b.imageUrl ? (pf.current || (pf.current = !0, RA(b.imageUrl), aA(!1), Cf.current?.(), Cf.current = null), IA.current && (clearInterval(IA.current), IA.current = null)) : b.status === "failed" && (pf.current = !0, aA(!1), IA.current && (clearInterval(IA.current), IA.current = null));
|
|
13460
13466
|
} catch {
|
|
13461
13467
|
}
|
|
13462
13468
|
}, 3e3);
|
|
13463
13469
|
} catch {
|
|
13464
|
-
|
|
13470
|
+
aA(!1);
|
|
13465
13471
|
}
|
|
13466
13472
|
}, [XA, f, n]), wg = UA(() => {
|
|
13467
13473
|
if (PA)
|
|
@@ -13470,41 +13476,41 @@ function R8({
|
|
|
13470
13476
|
w.href = PA, w.download = `primestyle-tryon-${Date.now()}.png`, w.click();
|
|
13471
13477
|
} else
|
|
13472
13478
|
fetch(PA).then((w) => w.blob()).then((w) => {
|
|
13473
|
-
const
|
|
13474
|
-
Y.href =
|
|
13479
|
+
const Q = URL.createObjectURL(w), Y = document.createElement("a");
|
|
13480
|
+
Y.href = Q, Y.download = `primestyle-tryon-${Date.now()}.png`, Y.click(), setTimeout(() => URL.revokeObjectURL(Q), 100);
|
|
13475
13481
|
}).catch(() => window.open(PA, "_blank"));
|
|
13476
13482
|
}, [PA]), vg = UA(() => {
|
|
13477
|
-
pf.current = !1, Wf(), sA(null), V && URL.revokeObjectURL(V), s(null), RA(null),
|
|
13483
|
+
pf.current = !1, Wf(), sA(null), V && URL.revokeObjectURL(V), s(null), RA(null), EA(null), kA(null), SA(null), iA(!1), dA(!1), y("body-profile");
|
|
13478
13484
|
}, [V, Wf]), Dg = UA((w) => {
|
|
13479
|
-
const
|
|
13480
|
-
if (!
|
|
13485
|
+
const Q = OA.find((wA) => wA.id === w);
|
|
13486
|
+
if (!Q) return;
|
|
13481
13487
|
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(
|
|
13488
|
+
const Y = { gender: Q.gender || "male" };
|
|
13489
|
+
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)
|
|
13490
|
+
for (const [wA, L] of Object.entries(Q.customMeasurements))
|
|
13485
13491
|
Y[wA] = String(L);
|
|
13486
|
-
|
|
13492
|
+
H.current = Y, zA(Y.gender || "male"), Q.country && qA(Q.country), Q.sizingUnit && uA(Q.sizingUnit), Q.heightUnit && a(Q.heightUnit), Q.weightUnit && nA(Q.weightUnit), wf((wA) => wA + 1);
|
|
13487
13493
|
}, [OA]);
|
|
13488
|
-
Pg.current = Dg, UA((w,
|
|
13489
|
-
const Y = (
|
|
13494
|
+
Pg.current = Dg, UA((w, Q) => {
|
|
13495
|
+
const Y = (Q ? null : lA) || `p_${Date.now()}`, wA = {
|
|
13490
13496
|
id: Y,
|
|
13491
13497
|
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:
|
|
13498
|
+
gender: H.current.gender || "male",
|
|
13499
|
+
height: H.current.height ? parseFloat(H.current.height) : void 0,
|
|
13500
|
+
weight: H.current.weight ? parseFloat(H.current.weight) : void 0,
|
|
13501
|
+
chest: H.current.chest ? parseFloat(H.current.chest) : void 0,
|
|
13502
|
+
bust: H.current.bust ? parseFloat(H.current.bust) : void 0,
|
|
13503
|
+
waist: H.current.waist ? parseFloat(H.current.waist) : void 0,
|
|
13504
|
+
hips: H.current.hips ? parseFloat(H.current.hips) : void 0,
|
|
13505
|
+
shoulderWidth: H.current.shoulderWidth ? parseFloat(H.current.shoulderWidth) : void 0,
|
|
13506
|
+
sleeveLength: H.current.sleeveLength ? parseFloat(H.current.sleeveLength) : void 0,
|
|
13507
|
+
inseam: H.current.inseam ? parseFloat(H.current.inseam) : void 0,
|
|
13508
|
+
neckCircumference: H.current.neckCircumference ? parseFloat(H.current.neckCircumference) : void 0,
|
|
13509
|
+
footLengthCm: H.current.footLengthCm ? parseFloat(H.current.footLengthCm) : void 0,
|
|
13510
|
+
shoeEU: H.current.shoeEU,
|
|
13511
|
+
shoeUS: H.current.shoeUS,
|
|
13512
|
+
shoeUK: H.current.shoeUK,
|
|
13513
|
+
fitPreference: H.current.fitPreference,
|
|
13508
13514
|
country: gf,
|
|
13509
13515
|
sizingUnit: _,
|
|
13510
13516
|
heightUnit: WA,
|
|
@@ -13530,7 +13536,7 @@ function R8({
|
|
|
13530
13536
|
"heightFeet",
|
|
13531
13537
|
"heightInches"
|
|
13532
13538
|
]), Z = {};
|
|
13533
|
-
for (const [d, b] of Object.entries(
|
|
13539
|
+
for (const [d, b] of Object.entries(H.current))
|
|
13534
13540
|
!L.has(d) && b && !isNaN(Number(b)) && (Z[d] = parseFloat(b));
|
|
13535
13541
|
Object.keys(Z).length > 0 && (wA.customMeasurements = Z), AA((d) => {
|
|
13536
13542
|
const b = d.findIndex((HA) => HA.id === Y);
|
|
@@ -13539,7 +13545,7 @@ function R8({
|
|
|
13539
13545
|
return HA[b] = wA, HA;
|
|
13540
13546
|
}
|
|
13541
13547
|
return [...d, wA].slice(-50);
|
|
13542
|
-
}), G(Y),
|
|
13548
|
+
}), G(Y), dA(!0);
|
|
13543
13549
|
}, [lA, gf, _, WA, X]);
|
|
13544
13550
|
const VP = UA(() => {
|
|
13545
13551
|
const w = {
|
|
@@ -13564,11 +13570,11 @@ function R8({
|
|
|
13564
13570
|
date: Date.now()
|
|
13565
13571
|
};
|
|
13566
13572
|
if (lA) {
|
|
13567
|
-
const
|
|
13568
|
-
|
|
13573
|
+
const Q = OA.find((Y) => Y.id === lA);
|
|
13574
|
+
Q && (w.profileName = Q.name);
|
|
13569
13575
|
}
|
|
13570
|
-
Pf((
|
|
13571
|
-
}, [n, f, PA, vA, $, lA, OA]), Yf =
|
|
13576
|
+
Pf((Q) => [w, ...Q].slice(0, 50));
|
|
13577
|
+
}, [n, f, PA, vA, $, lA, OA]), Yf = tA(!1), gP = tA(!1);
|
|
13572
13578
|
JA(() => {
|
|
13573
13579
|
l === "size-result" && vA && !Yf.current ? (Yf.current = !0, gP.current = !1, VP()) : l === "size-result" && vA && PA && !gP.current ? (gP.current = !0, Pf((w) => w.length === 0 ? w : [{ ...w[0], resultImageUrl: PA }, ...w.slice(1)])) : l === "result" && PA && !Yf.current ? (Yf.current = !0, VP()) : (l === "welcome" || l === "body-profile") && (Yf.current = !1, gP.current = !1);
|
|
13574
13580
|
}, [l, vA, PA]);
|
|
@@ -13579,34 +13585,34 @@ function R8({
|
|
|
13579
13585
|
reasoning: w.reasoning || "",
|
|
13580
13586
|
internationalSizes: w.internationalSizes,
|
|
13581
13587
|
matchDetails: w.matchDetails
|
|
13582
|
-
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null),
|
|
13583
|
-
}, []), ig = UA((w,
|
|
13584
|
-
|
|
13588
|
+
}), w.sizeGuide && (_A(w.sizeGuide), cf(!1)), RA(w.resultImageUrl || null), iA(!1), eA(!1), bA(null), NA(null), y("size-result");
|
|
13589
|
+
}, []), ig = UA((w, Q) => {
|
|
13590
|
+
H.current[w] = Q;
|
|
13585
13591
|
}, []);
|
|
13586
|
-
|
|
13587
|
-
const
|
|
13592
|
+
vf(() => {
|
|
13593
|
+
const Q = {
|
|
13588
13594
|
US: { key: "shoeUS", labelKey: "Shoe size (US)", ph: "e.g. 10" },
|
|
13589
13595
|
UK: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" },
|
|
13590
13596
|
AU: { key: "shoeUK", labelKey: "Shoe size (UK)", ph: "e.g. 9" }
|
|
13591
13597
|
}[gf] || { key: "shoeEU", labelKey: "Shoe size (EU)", ph: "e.g. 43" };
|
|
13592
|
-
return { key:
|
|
13598
|
+
return { key: Q.key, label: E(Q.labelKey), ph: Q.ph };
|
|
13593
13599
|
}, [gf, E]);
|
|
13594
13600
|
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":
|
|
13601
|
+
"--ps-btn-bg": r.backgroundColor,
|
|
13602
|
+
"--ps-btn-color": r.textColor,
|
|
13603
|
+
"--ps-btn-radius": r.borderRadius,
|
|
13604
|
+
"--ps-btn-font-size": r.fontSize,
|
|
13605
|
+
"--ps-btn-font": r.fontFamily,
|
|
13606
|
+
"--ps-btn-font-weight": r.fontWeight,
|
|
13607
|
+
"--ps-btn-padding": r.padding,
|
|
13608
|
+
"--ps-btn-border": r.border,
|
|
13609
|
+
"--ps-btn-width": r.width,
|
|
13610
|
+
"--ps-btn-height": r.height,
|
|
13611
|
+
"--ps-btn-hover-bg": r.hoverBackgroundColor,
|
|
13612
|
+
"--ps-btn-hover-color": r.hoverTextColor,
|
|
13613
|
+
"--ps-btn-icon-size": r.iconSize,
|
|
13614
|
+
"--ps-btn-icon-color": r.iconColor,
|
|
13615
|
+
"--ps-btn-shadow": r.boxShadow,
|
|
13610
13616
|
"--ps-modal-overlay": z.overlayColor,
|
|
13611
13617
|
"--ps-modal-bg": z.backgroundColor,
|
|
13612
13618
|
"--ps-modal-color": z.textColor,
|
|
@@ -13630,8 +13636,8 @@ function R8({
|
|
|
13630
13636
|
// accentColor falls back to the trigger button background so the user's
|
|
13631
13637
|
// brand color cascades to the modal automatically without having to pass
|
|
13632
13638
|
// both buttonStyles AND modalStyles. Most consumers only set buttonStyles.
|
|
13633
|
-
"--ps-accent": z.accentColor ??
|
|
13634
|
-
"--ps-accent-hover": z.accentHoverColor ??
|
|
13639
|
+
"--ps-accent": z.accentColor ?? r.backgroundColor,
|
|
13640
|
+
"--ps-accent-hover": z.accentHoverColor ?? r.hoverBackgroundColor,
|
|
13635
13641
|
"--ps-accent-light": z.accentLightColor,
|
|
13636
13642
|
"--ps-text-primary": z.textPrimaryColor,
|
|
13637
13643
|
"--ps-text-secondary": z.textSecondaryColor,
|
|
@@ -13647,10 +13653,10 @@ function R8({
|
|
|
13647
13653
|
case "welcome":
|
|
13648
13654
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(BB, { productImage: f, setView: y, t: E }) }, "v-welcome");
|
|
13649
13655
|
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, { ...
|
|
13656
|
+
const w = Xf(n), Q = { productImage: f, productTitle: n, formRef: H, sizingUnit: _, setSizingUnit: uA, setSizingMethod: kA, setSizingLoading: iA, setView: y, submitSizing: Vf, onSnapSubmit: dP, onBack: Gf, sizeGuide: $, t: E };
|
|
13657
|
+
if (w === "foot") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(j8, { ...Q }) }, "v-foot");
|
|
13658
|
+
if (w === "head") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(a8, { ...Q }) }, "v-head");
|
|
13659
|
+
if (w === "face") return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(I8, { ...Q }) }, "v-face");
|
|
13654
13660
|
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
13661
|
return /* @__PURE__ */ A("div", { className: "ps-tryon-view-enter", children: /* @__PURE__ */ A(
|
|
13656
13662
|
z8,
|
|
@@ -13658,7 +13664,7 @@ function R8({
|
|
|
13658
13664
|
productImage: f,
|
|
13659
13665
|
productTitle: n,
|
|
13660
13666
|
isWomen: Y || L,
|
|
13661
|
-
formRef:
|
|
13667
|
+
formRef: H,
|
|
13662
13668
|
sizingCountry: gf,
|
|
13663
13669
|
heightUnit: WA,
|
|
13664
13670
|
setHeightUnit: a,
|
|
@@ -13676,10 +13682,10 @@ function R8({
|
|
|
13676
13682
|
activeProfileName: OA.find((b) => b.id === lA)?.name || null,
|
|
13677
13683
|
activeProfile: OA.find((d) => d.id === lA) || null,
|
|
13678
13684
|
onStartFresh: () => {
|
|
13679
|
-
G(null),
|
|
13685
|
+
G(null), H.current = {};
|
|
13680
13686
|
},
|
|
13681
13687
|
onComplete: (d) => {
|
|
13682
|
-
|
|
13688
|
+
H.current.gender = d.gender, d.bandSize && (H.current.bandSize = d.bandSize), d.cupSize && (H.current.cupSize = d.cupSize), eg(
|
|
13683
13689
|
d.height,
|
|
13684
13690
|
d.weight,
|
|
13685
13691
|
d.heightUnit,
|
|
@@ -13709,15 +13715,15 @@ function R8({
|
|
|
13709
13715
|
estimatedValues: J,
|
|
13710
13716
|
estimationLoading: Bf,
|
|
13711
13717
|
dynamicFields: Kf,
|
|
13712
|
-
formRef:
|
|
13713
|
-
formGender:
|
|
13718
|
+
formRef: H,
|
|
13719
|
+
formGender: oA,
|
|
13714
13720
|
formKey: YA,
|
|
13715
|
-
setFormKey:
|
|
13721
|
+
setFormKey: wf,
|
|
13716
13722
|
sizingUnit: _,
|
|
13717
13723
|
setSizingUnit: uA,
|
|
13718
13724
|
updateField: ig,
|
|
13719
13725
|
setSizingMethod: kA,
|
|
13720
|
-
setSizingLoading:
|
|
13726
|
+
setSizingLoading: iA,
|
|
13721
13727
|
setView: y,
|
|
13722
13728
|
submitSizing: Vf,
|
|
13723
13729
|
t: E
|
|
@@ -13757,10 +13763,10 @@ function R8({
|
|
|
13757
13763
|
userHeightCm: (() => {
|
|
13758
13764
|
const w = OA.find((L) => L.id === lA);
|
|
13759
13765
|
if (!w) return;
|
|
13760
|
-
const
|
|
13761
|
-
if (!
|
|
13766
|
+
const Q = w.height ?? w.heightCm;
|
|
13767
|
+
if (!Q || Q <= 0) return;
|
|
13762
13768
|
const Y = w.heightUnit, wA = vA?.unit || _;
|
|
13763
|
-
return (Y === "in" || Y === "ft") && wA !== "in" ? Math.round(
|
|
13769
|
+
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
13770
|
})(),
|
|
13765
13771
|
t: E
|
|
13766
13772
|
}
|
|
@@ -13808,25 +13814,25 @@ function R8({
|
|
|
13808
13814
|
onSelectProfile: (w) => {
|
|
13809
13815
|
G(w), y("body-profile");
|
|
13810
13816
|
},
|
|
13811
|
-
onSaveProfileMeasurements: (w,
|
|
13812
|
-
FP(w,
|
|
13817
|
+
onSaveProfileMeasurements: (w, Q, Y) => {
|
|
13818
|
+
FP(w, Q, Y ?? OA.find((wA) => wA.id === w)?.measurementsUnit ?? "cm"), AA(af("profiles", []));
|
|
13813
13819
|
},
|
|
13814
|
-
onSaveBraSize: (w,
|
|
13815
|
-
sn(w, { bandSize:
|
|
13820
|
+
onSaveBraSize: (w, Q, Y) => {
|
|
13821
|
+
sn(w, { bandSize: Q, cupSize: Y }), AA(af("profiles", []));
|
|
13816
13822
|
},
|
|
13817
13823
|
onEditProfile: (w) => {
|
|
13818
13824
|
ef(w);
|
|
13819
13825
|
},
|
|
13820
13826
|
onPhotoPreview: (w) => {
|
|
13821
13827
|
if (w) {
|
|
13822
|
-
const
|
|
13823
|
-
s(
|
|
13828
|
+
const Q = w.startsWith("data:") ? w : `data:image/jpeg;base64,${w}`;
|
|
13829
|
+
s(Q);
|
|
13824
13830
|
} else
|
|
13825
13831
|
s(null);
|
|
13826
13832
|
},
|
|
13827
13833
|
onEstimateFromPhoto: async (w) => {
|
|
13828
13834
|
try {
|
|
13829
|
-
const
|
|
13835
|
+
const Q = await eP(w.photoBase64).catch(() => null), Y = await MP({
|
|
13830
13836
|
apiUrl: B,
|
|
13831
13837
|
height: w.height > 0 ? w.height : void 0,
|
|
13832
13838
|
weight: w.weight > 0 ? w.weight : void 0,
|
|
@@ -13835,7 +13841,7 @@ function R8({
|
|
|
13835
13841
|
gender: w.gender,
|
|
13836
13842
|
age: w.age,
|
|
13837
13843
|
bodyImage: w.photoBase64,
|
|
13838
|
-
bodyLandmarks:
|
|
13844
|
+
bodyLandmarks: Q ?? void 0
|
|
13839
13845
|
});
|
|
13840
13846
|
return Y ? { estimates: Y.estimates, unit: Y.unit } : null;
|
|
13841
13847
|
} catch {
|
|
@@ -13843,34 +13849,34 @@ function R8({
|
|
|
13843
13849
|
}
|
|
13844
13850
|
},
|
|
13845
13851
|
onSaveNewProfile: async (w) => {
|
|
13846
|
-
const
|
|
13852
|
+
const Q = {
|
|
13847
13853
|
...w,
|
|
13848
13854
|
id: Date.now().toString(36) + Math.random().toString(36).slice(2, 6),
|
|
13849
13855
|
createdAt: Date.now(),
|
|
13850
13856
|
lastUsedAt: Date.now()
|
|
13851
|
-
}, Y = [
|
|
13852
|
-
sf("profiles", Y), AA(Y), G(
|
|
13853
|
-
const wA =
|
|
13854
|
-
!(!!
|
|
13857
|
+
}, Y = [Q, ...OA];
|
|
13858
|
+
sf("profiles", Y), AA(Y), G(Q.id);
|
|
13859
|
+
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;
|
|
13860
|
+
!(!!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
13861
|
apiUrl: B,
|
|
13856
13862
|
height: wA > 0 ? wA : void 0,
|
|
13857
13863
|
weight: L > 0 ? L : void 0,
|
|
13858
13864
|
heightUnit: Z,
|
|
13859
13865
|
weightUnit: d,
|
|
13860
|
-
gender:
|
|
13861
|
-
age:
|
|
13862
|
-
chestProfile:
|
|
13863
|
-
midsectionProfile:
|
|
13864
|
-
hipProfile:
|
|
13866
|
+
gender: Q.gender,
|
|
13867
|
+
age: Q.age,
|
|
13868
|
+
chestProfile: Q.chestProfile,
|
|
13869
|
+
midsectionProfile: Q.midsectionProfile,
|
|
13870
|
+
hipProfile: Q.hipProfile,
|
|
13865
13871
|
bodyImage: b,
|
|
13866
13872
|
bodyLandmarks: CA ?? void 0
|
|
13867
13873
|
})).then((CA) => {
|
|
13868
13874
|
if (CA) {
|
|
13869
|
-
if (FP(
|
|
13870
|
-
const zf = af("profiles", []), df = zf.findIndex((
|
|
13875
|
+
if (FP(Q.id, CA.estimates, CA.unit), CA.userEstimates) {
|
|
13876
|
+
const zf = af("profiles", []), df = zf.findIndex((of) => of.id === Q.id);
|
|
13871
13877
|
if (df >= 0) {
|
|
13872
|
-
const
|
|
13873
|
-
jA.height && !(
|
|
13878
|
+
const of = zf[df], jA = CA.userEstimates, Af = { ...of };
|
|
13879
|
+
jA.height && !(of.height || of.heightCm) && (Af.height = jA.height, Af.heightCm = jA.height, Af.heightUnit = "cm"), jA.weight && !(of.weight || of.weightKg) && (Af.weight = jA.weight, Af.weightKg = jA.weight, Af.weightUnit = "kg"), jA.age && !of.age && (Af.age = jA.age), zf[df] = Af, sf("profiles", zf);
|
|
13874
13880
|
}
|
|
13875
13881
|
}
|
|
13876
13882
|
AA(af("profiles", []));
|
|
@@ -13879,12 +13885,12 @@ function R8({
|
|
|
13879
13885
|
}).finally(() => {
|
|
13880
13886
|
QA((CA) => {
|
|
13881
13887
|
const zf = new Set(CA);
|
|
13882
|
-
return zf.delete(
|
|
13888
|
+
return zf.delete(Q.id), zf;
|
|
13883
13889
|
});
|
|
13884
13890
|
}));
|
|
13885
13891
|
},
|
|
13886
13892
|
onDeleteProfile: (w) => {
|
|
13887
|
-
AA((
|
|
13893
|
+
AA((Q) => Q.filter((Y) => Y.id !== w)), lA === w && G(null), sf("profiles", af("profiles", []).filter((Q) => Q.id !== w));
|
|
13888
13894
|
},
|
|
13889
13895
|
onRequestDelete: (w) => R(w),
|
|
13890
13896
|
onClose: () => y("body-profile"),
|
|
@@ -13962,8 +13968,8 @@ function R8({
|
|
|
13962
13968
|
f8,
|
|
13963
13969
|
{
|
|
13964
13970
|
onConfirm: () => {
|
|
13965
|
-
const w = U,
|
|
13966
|
-
sf("profiles",
|
|
13971
|
+
const w = U, Q = af("profiles", []).filter((Y) => Y.id !== w);
|
|
13972
|
+
sf("profiles", Q), AA(Q), lA === w && G(null), R(null);
|
|
13967
13973
|
},
|
|
13968
13974
|
onCancel: () => R(null),
|
|
13969
13975
|
t: E
|
|
@@ -14000,21 +14006,21 @@ function T8(f) {
|
|
|
14000
14006
|
function G8(f) {
|
|
14001
14007
|
const [n, g] = j(null), [e, B] = j(!0), [C, D] = j(!1), [i, o] = j(0);
|
|
14002
14008
|
return JA(() => {
|
|
14003
|
-
let
|
|
14009
|
+
let r = !1;
|
|
14004
14010
|
return B(!0), D(!1), console.log("[ps-sdk:hook] usePrimeStyleSize start", { productId: f.productId }), Gn(f).then((z) => {
|
|
14005
|
-
|
|
14011
|
+
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
14012
|
}).catch((z) => {
|
|
14007
|
-
console.log("[ps-sdk:hook] usePrimeStyleSize threw", z),
|
|
14013
|
+
console.log("[ps-sdk:hook] usePrimeStyleSize threw", z), r || g(null);
|
|
14008
14014
|
}).finally(() => {
|
|
14009
|
-
|
|
14015
|
+
r || B(!1);
|
|
14010
14016
|
}), () => {
|
|
14011
|
-
|
|
14017
|
+
r = !0;
|
|
14012
14018
|
};
|
|
14013
14019
|
}, [f.productId, f.apiUrl, f.apiKey, i]), JA(() => {
|
|
14014
14020
|
if (typeof window > "u") return;
|
|
14015
|
-
const
|
|
14016
|
-
return window.addEventListener(fP,
|
|
14017
|
-
window.removeEventListener(fP,
|
|
14021
|
+
const r = () => o((z) => z + 1);
|
|
14022
|
+
return window.addEventListener(fP, r), window.addEventListener("storage", r), () => {
|
|
14023
|
+
window.removeEventListener(fP, r), window.removeEventListener("storage", r);
|
|
14018
14024
|
};
|
|
14019
14025
|
}, []), {
|
|
14020
14026
|
recommendedSize: n?.recommendedSize ?? null,
|
|
@@ -14022,7 +14028,7 @@ function G8(f) {
|
|
|
14022
14028
|
loading: e,
|
|
14023
14029
|
noProfile: C,
|
|
14024
14030
|
result: n,
|
|
14025
|
-
refetch: () => o((
|
|
14031
|
+
refetch: () => o((r) => r + 1)
|
|
14026
14032
|
};
|
|
14027
14033
|
}
|
|
14028
14034
|
export {
|