@primestyleai/tryon 5.10.186 → 5.10.188

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.
@@ -3,6 +3,8 @@ export interface TryOnContext {
3
3
  /** Storefront product the customer is currently viewing — shown in analytics. */
4
4
  productId?: string;
5
5
  productTitle?: string;
6
+ productCategory?: string;
7
+ productSubcategory?: string;
6
8
  productFitType?: string;
7
9
  productType?: string;
8
10
  productTags?: string[];
@@ -32,19 +32,19 @@ function T() {
32
32
  return null;
33
33
  }
34
34
  }
35
- function p(t) {
35
+ function g(t) {
36
36
  if (S = t, !!E())
37
37
  try {
38
38
  window.localStorage.setItem(y, JSON.stringify(t));
39
39
  } catch {
40
40
  }
41
41
  }
42
- function g() {
42
+ function p() {
43
43
  const t = Date.now(), e = T();
44
44
  if (e && t - e.lastSeenAt < 2592e6)
45
- return t - e.lastSeenAt > 5 * 60 * 1e3 && p({ ...e, lastSeenAt: t }), e.id;
45
+ return t - e.lastSeenAt > 5 * 60 * 1e3 && g({ ...e, lastSeenAt: t }), e.id;
46
46
  const o = { id: A(), issuedAt: t, lastSeenAt: t };
47
- return p(o), o.id;
47
+ return g(o), o.id;
48
48
  }
49
49
  function f() {
50
50
  if (typeof navigator > "u") return null;
@@ -57,7 +57,7 @@ class W {
57
57
  this.apiKey = e || void 0, this.baseUrl = (o || I).replace(/\/+$/, "");
58
58
  }
59
59
  get headers() {
60
- return v(this.apiKey);
60
+ return w(this.apiKey);
61
61
  }
62
62
  async submitTryOn(e, o, a, s, r) {
63
63
  const i = {
@@ -65,10 +65,10 @@ class W {
65
65
  // Attribution fields — backend logs these into the TryOnEvent collection
66
66
  // so non-technical operators can answer "which products are being tried on
67
67
  // and by how many customers". Safe fallbacks when absent.
68
- sessionId: g(),
68
+ sessionId: p(),
69
69
  deviceHint: f()
70
70
  };
71
- if (r?.modelImageId && (i.modelImageId = r.modelImageId), e && (i.modelImage = e), a && a.length > 0 && (i.fitInfo = a), s && s !== "apparel" && (i.category = s), r?.productId && (i.productId = r.productId), r?.productTitle && (i.productTitle = r.productTitle), r?.productFitType && (i.productFitType = r.productFitType), r?.productType && (i.productType = r.productType), r?.productTags?.length && (i.productTags = r.productTags), r?.productDescription && (i.productDescription = r.productDescription), r?.productMaterial && (i.productMaterial = r.productMaterial), r?.silhouetteContext && (i.silhouetteContext = r.silhouetteContext), r?.editFromPrevious && (i.editFromPrevious = !0), a && a.length > 0)
71
+ if (r?.modelImageId && (i.modelImageId = r.modelImageId), e && (i.modelImage = e), a && a.length > 0 && (i.fitInfo = a), s && s !== "apparel" && (i.category = s), r?.productId && (i.productId = r.productId), r?.productTitle && (i.productTitle = r.productTitle), r?.productCategory && (i.productCategory = r.productCategory), r?.productSubcategory && (i.productSubcategory = r.productSubcategory), r?.productFitType && (i.productFitType = r.productFitType), r?.productType && (i.productType = r.productType), r?.productTags?.length && (i.productTags = r.productTags), r?.productDescription && (i.productDescription = r.productDescription), r?.productMaterial && (i.productMaterial = r.productMaterial), r?.silhouetteContext && (i.silhouetteContext = r.silhouetteContext), r?.editFromPrevious && (i.editFromPrevious = !0), a && a.length > 0)
72
72
  for (const n of a) {
73
73
  const l = (n.garmentRange || "").replace(/[^\d.\-–]/g, " ").trim().split(/[\s\-–]+/).filter(Boolean).map(Number).filter((u) => !isNaN(u));
74
74
  if (l.length && n.userValue != null) {
@@ -112,7 +112,7 @@ class W {
112
112
  headers: this.headers,
113
113
  body: JSON.stringify({
114
114
  ...e,
115
- sessionId: g(),
115
+ sessionId: p(),
116
116
  deviceHint: f()
117
117
  })
118
118
  });
@@ -130,7 +130,7 @@ class W {
130
130
  return this.apiKey ? `${e}?key=${encodeURIComponent(this.apiKey)}` : e;
131
131
  }
132
132
  }
133
- function v(t) {
133
+ function w(t) {
134
134
  const e = { "Content-Type": "application/json" };
135
135
  return t && (e.Authorization = `Bearer ${t}`), e;
136
136
  }
@@ -190,9 +190,9 @@ class Y {
190
190
  this.reconnectTimer && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null), this.eventSource && (this.eventSource.close(), this.eventSource = null), this.listeners.clear(), this.reconnectAttempts = 0;
191
191
  }
192
192
  }
193
- const w = 512, C = 0.65;
194
- function U(t, e = {}) {
195
- const o = e.maxDimension ?? w, a = e.quality ?? C;
193
+ const v = 512, C = 0.65;
194
+ function z(t, e = {}) {
195
+ const o = e.maxDimension ?? v, a = e.quality ?? C;
196
196
  return new Promise((s, r) => {
197
197
  const i = new FileReader();
198
198
  i.onload = () => {
@@ -220,9 +220,9 @@ function U(t, e = {}) {
220
220
  function F(t) {
221
221
  return ["image/jpeg", "image/png", "image/webp", "image/avif"].includes(t.type);
222
222
  }
223
- async function j(t, e, o) {
223
+ async function K(t, e, o) {
224
224
  try {
225
- const a = typeof t == "string" ? t : await U(t, { maxDimension: 384, quality: 0.6 }), s = await fetch(`${e}/api/v1/sizing/age-check`, {
225
+ const a = typeof t == "string" ? t : await z(t, { maxDimension: 384, quality: 0.6 }), s = await fetch(`${e}/api/v1/sizing/age-check`, {
226
226
  method: "POST",
227
227
  headers: {
228
228
  "Content-Type": "application/json",
@@ -245,14 +245,14 @@ async function j(t, e, o) {
245
245
  }
246
246
  }
247
247
  const c = {};
248
- function z(t, e) {
248
+ function U(t, e) {
249
249
  c[t] = { ...c[t] || {}, ...e };
250
250
  }
251
- function K(t) {
251
+ function V(t) {
252
252
  const e = t?.toLowerCase().split("-")[0] || "en";
253
253
  return (o) => e === "en" || !c[e] ? o : c[e][o] ?? o;
254
254
  }
255
- function V() {
255
+ function j() {
256
256
  return typeof navigator > "u" ? "en" : (navigator.language || navigator.userLanguage || "en").split("-")[0].toLowerCase();
257
257
  }
258
258
  const J = [
@@ -277,14 +277,14 @@ const J = [
277
277
  zh: "中文",
278
278
  ko: "한국어",
279
279
  ar: "العربية"
280
- }, x = [
280
+ }, Z = [
281
281
  "Virtual Try-On",
282
282
  "Find Your Size & See It On You",
283
283
  "See Your Fit",
284
284
  "Your fit basics are saved",
285
285
  "Add one profile photo to reuse your measurements across PrimeStyleAI products.",
286
286
  "Complete Profile",
287
- "Get the perfect fit, then try it on virtually",
287
+ "Check your size, then try it on virtually",
288
288
  "Get Your Size",
289
289
  "Instant fit recommendation",
290
290
  "Try It On",
@@ -318,7 +318,7 @@ const J = [
318
318
  "Size guide",
319
319
  "Your fit",
320
320
  "Your measure",
321
- "perfect fit",
321
+ "within range",
322
322
  "within range",
323
323
  "too tight",
324
324
  "tight",
@@ -432,8 +432,8 @@ const J = [
432
432
  "Loose",
433
433
  "Short",
434
434
  "Long",
435
- "Perfect",
436
- "Perfect fit",
435
+ "Recommended",
436
+ "Within range",
437
437
  "Within range",
438
438
  "WITHIN RANGE",
439
439
  "✓ Fit",
@@ -442,7 +442,7 @@ const J = [
442
442
  "loose",
443
443
  "short",
444
444
  "long",
445
- "perfect fit",
445
+ "within range",
446
446
  "within range",
447
447
  "too tight",
448
448
  "a bit tight",
@@ -467,7 +467,7 @@ const J = [
467
467
  "Virtual Try-On": "Probador Virtual",
468
468
  "Find Your Size & See It On You": "Encuentra tu talla y pruébatelo",
469
469
  "See Your Fit": "Ver tu ajuste",
470
- "Get the perfect fit, then try it on virtually": "Encuentra el ajuste perfecto y pruébatelo virtualmente",
470
+ "Check your size, then try it on virtually": "Comprueba tu talla y pruébatelo virtualmente",
471
471
  "Get Your Size": "Tu talla",
472
472
  "Instant fit recommendation": "Recomendación de ajuste instantánea",
473
473
  "Try It On": "Pruébatelo",
@@ -502,8 +502,9 @@ const J = [
502
502
  "Edit measurements": "Editar medidas",
503
503
  "Size guide": "Guía de tallas",
504
504
  "Your fit": "Tu ajuste",
505
+ "Your Size Recommendation": "Tu recomendación de talla",
505
506
  "Your measure": "Tu medida",
506
- "perfect fit": "ajuste perfecto",
507
+ "within range": "dentro del rango",
507
508
  "too tight": "demasiado ajustado",
508
509
  tight: "ajustado",
509
510
  "a bit tight": "un poco ajustado",
@@ -723,7 +724,7 @@ const J = [
723
724
  "Virtual Try-On": "Essayage Virtuel",
724
725
  "Find Your Size & See It On You": "Trouvez votre taille et essayez-le",
725
726
  "See Your Fit": "Voir votre ajustement",
726
- "Get the perfect fit, then try it on virtually": "Trouvez la coupe parfaite, puis essayez-le virtuellement",
727
+ "Check your size, then try it on virtually": "Vérifiez votre taille, puis essayez-le virtuellement",
727
728
  "Get Your Size": "Votre taille",
728
729
  "Instant fit recommendation": "Recommandation de coupe instantanée",
729
730
  "Try It On": "Essayer",
@@ -758,8 +759,9 @@ const J = [
758
759
  "Edit measurements": "Modifier les mesures",
759
760
  "Size guide": "Guide des tailles",
760
761
  "Your fit": "Votre coupe",
762
+ "Your Size Recommendation": "Votre recommandation de taille",
761
763
  "Your measure": "Votre mesure",
762
- "perfect fit": "coupe parfaite",
764
+ "within range": "dans la plage",
763
765
  "too tight": "trop serré",
764
766
  tight: "serré",
765
767
  "a bit tight": "un peu serré",
@@ -979,7 +981,7 @@ const J = [
979
981
  "Virtual Try-On": "Virtuelle Anprobe",
980
982
  "Find Your Size & See It On You": "Finden Sie Ihre Größe und probieren Sie es an",
981
983
  "See Your Fit": "Ihre Passform ansehen",
982
- "Get the perfect fit, then try it on virtually": "Finden Sie die perfekte Passform und probieren Sie es virtuell an",
984
+ "Check your size, then try it on virtually": "Prüfen Sie Ihre Größe und probieren Sie es virtuell an",
983
985
  "Get Your Size": "Ihre Größe",
984
986
  "Instant fit recommendation": "Sofortige Passformempfehlung",
985
987
  "Try It On": "Anprobieren",
@@ -1014,8 +1016,9 @@ const J = [
1014
1016
  "Edit measurements": "Maße bearbeiten",
1015
1017
  "Size guide": "Größentabelle",
1016
1018
  "Your fit": "Ihre Passform",
1019
+ "Your Size Recommendation": "Ihre Größenempfehlung",
1017
1020
  "Your measure": "Ihr Maß",
1018
- "perfect fit": "perfekte Passform",
1021
+ "within range": "im Bereich",
1019
1022
  "too tight": "zu eng",
1020
1023
  tight: "eng",
1021
1024
  "a bit tight": "etwas eng",
@@ -1235,7 +1238,7 @@ const J = [
1235
1238
  "Virtual Try-On": "Prova Virtuale",
1236
1239
  "Find Your Size & See It On You": "Trova la tua taglia e provalo",
1237
1240
  "See Your Fit": "Vedi la vestibilità",
1238
- "Get the perfect fit, then try it on virtually": "Trova la vestibilità perfetta, poi provalo virtualmente",
1241
+ "Check your size, then try it on virtually": "Controlla la tua taglia, poi provalo virtualmente",
1239
1242
  "Get Your Size": "La tua taglia",
1240
1243
  "Instant fit recommendation": "Raccomandazione vestibilità istantanea",
1241
1244
  "Try It On": "Provalo",
@@ -1270,8 +1273,9 @@ const J = [
1270
1273
  "Edit measurements": "Modifica misure",
1271
1274
  "Size guide": "Guida alle taglie",
1272
1275
  "Your fit": "La tua vestibilità",
1276
+ "Your Size Recommendation": "La tua taglia consigliata",
1273
1277
  "Your measure": "La tua misura",
1274
- "perfect fit": "vestibilità perfetta",
1278
+ "within range": "entro l'intervallo",
1275
1279
  "too tight": "troppo stretto",
1276
1280
  tight: "stretto",
1277
1281
  "a bit tight": "un po' stretto",
@@ -1491,7 +1495,7 @@ const J = [
1491
1495
  "Virtual Try-On": "Provador Virtual",
1492
1496
  "Find Your Size & See It On You": "Encontre seu tamanho e experimente",
1493
1497
  "See Your Fit": "Veja seu ajuste",
1494
- "Get the perfect fit, then try it on virtually": "Encontre o caimento perfeito e experimente virtualmente",
1498
+ "Check your size, then try it on virtually": "Confira seu tamanho e experimente virtualmente",
1495
1499
  "Get Your Size": "Seu tamanho",
1496
1500
  "Instant fit recommendation": "Recomendação de caimento instantânea",
1497
1501
  "Try It On": "Experimentar",
@@ -1526,8 +1530,9 @@ const J = [
1526
1530
  "Edit measurements": "Editar medidas",
1527
1531
  "Size guide": "Guia de tamanhos",
1528
1532
  "Your fit": "Seu caimento",
1533
+ "Your Size Recommendation": "Sua recomendação de tamanho",
1529
1534
  "Your measure": "Sua medida",
1530
- "perfect fit": "caimento perfeito",
1535
+ "within range": "dentro da faixa",
1531
1536
  "too tight": "muito apertado",
1532
1537
  tight: "apertado",
1533
1538
  "a bit tight": "um pouco apertado",
@@ -1747,7 +1752,7 @@ const J = [
1747
1752
  "Virtual Try-On": "バーチャル試着",
1748
1753
  "Find Your Size & See It On You": "あなたのサイズを見つけて試着",
1749
1754
  "See Your Fit": "フィット感を見る",
1750
- "Get the perfect fit, then try it on virtually": "最適なフィットを見つけて、バーチャルで試着しましょう",
1755
+ "Check your size, then try it on virtually": "サイズを確認して、バーチャルで試着しましょう",
1751
1756
  "Get Your Size": "サイズを確認",
1752
1757
  "Instant fit recommendation": "瞬時にフィット提案",
1753
1758
  "Try It On": "試着する",
@@ -1782,8 +1787,9 @@ const J = [
1782
1787
  "Edit measurements": "寸法を編集",
1783
1788
  "Size guide": "サイズガイド",
1784
1789
  "Your fit": "あなたのフィット",
1790
+ "Your Size Recommendation": "サイズのおすすめ",
1785
1791
  "Your measure": "あなたの寸法",
1786
- "perfect fit": "ぴったり",
1792
+ "within range": "範囲内",
1787
1793
  "too tight": "きつすぎる",
1788
1794
  tight: "きつい",
1789
1795
  "a bit tight": "少しきつい",
@@ -2003,7 +2009,7 @@ const J = [
2003
2009
  "Virtual Try-On": "虚拟试穿",
2004
2010
  "Find Your Size & See It On You": "找到你的尺码并试穿",
2005
2011
  "See Your Fit": "查看合身效果",
2006
- "Get the perfect fit, then try it on virtually": "找到最佳合身度,然后虚拟试穿",
2012
+ "Check your size, then try it on virtually": "确认尺码,然后虚拟试穿",
2007
2013
  "Get Your Size": "获取尺码",
2008
2014
  "Instant fit recommendation": "即时合身推荐",
2009
2015
  "Try It On": "试穿",
@@ -2038,8 +2044,9 @@ const J = [
2038
2044
  "Edit measurements": "编辑尺寸",
2039
2045
  "Size guide": "尺码指南",
2040
2046
  "Your fit": "你的合身度",
2047
+ "Your Size Recommendation": "你的尺码建议",
2041
2048
  "Your measure": "你的尺寸",
2042
- "perfect fit": "完美合身",
2049
+ "within range": "在范围内",
2043
2050
  "too tight": "太紧",
2044
2051
  tight: "偏紧",
2045
2052
  "a bit tight": "略紧",
@@ -2259,7 +2266,7 @@ const J = [
2259
2266
  "Virtual Try-On": "가상 피팅",
2260
2267
  "Find Your Size & See It On You": "사이즈를 찾고 입어보세요",
2261
2268
  "See Your Fit": "핏 확인하기",
2262
- "Get the perfect fit, then try it on virtually": "완벽한 핏을 찾고 가상으로 입어보세요",
2269
+ "Check your size, then try it on virtually": "사이즈를 확인하고 가상으로 입어보세요",
2263
2270
  "Get Your Size": "사이즈 확인",
2264
2271
  "Instant fit recommendation": "즉시 핏 추천",
2265
2272
  "Try It On": "입어보기",
@@ -2294,8 +2301,9 @@ const J = [
2294
2301
  "Edit measurements": "치수 수정",
2295
2302
  "Size guide": "사이즈 가이드",
2296
2303
  "Your fit": "나의 핏",
2304
+ "Your Size Recommendation": "사이즈 추천",
2297
2305
  "Your measure": "내 치수",
2298
- "perfect fit": "완벽한 ",
2306
+ "within range": "범위 ",
2299
2307
  "too tight": "너무 타이트",
2300
2308
  tight: "타이트",
2301
2309
  "a bit tight": "약간 타이트",
@@ -2515,7 +2523,7 @@ const J = [
2515
2523
  "Virtual Try-On": "تجربة افتراضية",
2516
2524
  "Find Your Size & See It On You": "اعثر على مقاسك وجرّبه",
2517
2525
  "See Your Fit": "شاهد الملاءمة",
2518
- "Get the perfect fit, then try it on virtually": "اعثر على المقاس المثالي ثم جرّبه افتراضياً",
2526
+ "Check your size, then try it on virtually": "تحقق من مقاسك ثم جرّبه افتراضياً",
2519
2527
  "Get Your Size": "مقاسك",
2520
2528
  "Instant fit recommendation": "توصية فورية بالمقاس",
2521
2529
  "Try It On": "جرّبه",
@@ -2550,8 +2558,9 @@ const J = [
2550
2558
  "Edit measurements": "تعديل القياسات",
2551
2559
  "Size guide": "دليل المقاسات",
2552
2560
  "Your fit": "ملاءمتك",
2561
+ "Your Size Recommendation": "توصية المقاس",
2553
2562
  "Your measure": "قياسك",
2554
- "perfect fit": "مقاس مثالي",
2563
+ "within range": "ضمن النطاق",
2555
2564
  "too tight": "ضيق جداً",
2556
2565
  tight: "ضيق",
2557
2566
  "a bit tight": "ضيق قليلاً",
@@ -2779,22 +2788,22 @@ const J = [
2779
2788
  ar: G
2780
2789
  };
2781
2790
  for (const [t, e] of Object.entries(O))
2782
- z(t, e);
2791
+ U(t, e);
2783
2792
  export {
2784
2793
  W as A,
2785
2794
  q as L,
2786
2795
  h as P,
2787
2796
  Y as S,
2788
- x as T,
2789
- U as a,
2797
+ Z as T,
2798
+ z as a,
2790
2799
  J as b,
2791
- K as c,
2792
- j as d,
2793
- V as e,
2800
+ V as c,
2801
+ K as d,
2802
+ j as e,
2794
2803
  f,
2795
- g,
2804
+ p as g,
2796
2805
  F as i,
2797
- v as j,
2798
- z as r
2806
+ w as j,
2807
+ U as r
2799
2808
  };
2800
- //# sourceMappingURL=index-CYT0nGWX.js.map
2809
+ //# sourceMappingURL=index-BduSFARG.js.map