@primestyleai/tryon 5.10.111 → 5.10.113

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