@primestyleai/tryon 5.10.194 → 5.10.196

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,28 +1,28 @@
1
1
  "use client";
2
2
  const f = "ps_session";
3
- const A = "ps_mem_";
4
- let S = null;
5
- function E() {
3
+ const U = "ps_mem_";
4
+ let I = null;
5
+ function w() {
6
6
  try {
7
7
  return typeof window < "u" && typeof window.localStorage < "u";
8
8
  } catch {
9
9
  return !1;
10
10
  }
11
11
  }
12
- function P() {
12
+ function C() {
13
13
  if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
14
14
  return crypto.randomUUID();
15
- const r = "0123456789abcdef";
16
- let e = A;
17
- for (let o = 0; o < 32; o++) e += r[Math.floor(Math.random() * 16)];
15
+ const o = "0123456789abcdef";
16
+ let e = U;
17
+ for (let t = 0; t < 32; t++) e += o[Math.floor(Math.random() * 16)];
18
18
  return e;
19
19
  }
20
- function T() {
21
- if (!E()) return S;
20
+ function z() {
21
+ if (!w()) return I;
22
22
  try {
23
- const r = window.localStorage.getItem(f);
24
- if (!r) return null;
25
- const e = JSON.parse(r);
23
+ const o = window.localStorage.getItem(f);
24
+ if (!o) return null;
25
+ const e = JSON.parse(o);
26
26
  return typeof e.id != "string" || typeof e.issuedAt != "number" ? null : {
27
27
  id: e.id,
28
28
  issuedAt: e.issuedAt,
@@ -32,134 +32,207 @@ function T() {
32
32
  return null;
33
33
  }
34
34
  }
35
- function g(r) {
36
- if (S = r, !!E())
35
+ function P(o) {
36
+ if (I = o, !!w())
37
37
  try {
38
- window.localStorage.setItem(f, JSON.stringify(r));
38
+ window.localStorage.setItem(f, JSON.stringify(o));
39
39
  } catch {
40
40
  }
41
41
  }
42
- function p() {
43
- const r = Date.now(), e = T();
44
- if (e && r - e.lastSeenAt < 2592e6)
45
- return r - e.lastSeenAt > 5 * 60 * 1e3 && g({ ...e, lastSeenAt: r }), e.id;
46
- const o = { id: P(), issuedAt: r, lastSeenAt: r };
47
- return g(o), o.id;
42
+ function A(o) {
43
+ if (!(typeof window > "u"))
44
+ try {
45
+ const e = window.clarity;
46
+ typeof e == "function" && e("set", f, o);
47
+ } catch {
48
+ }
48
49
  }
49
- function y() {
50
+ function m() {
51
+ const o = Date.now(), e = z();
52
+ if (e && o - e.lastSeenAt < 2592e6)
53
+ return o - e.lastSeenAt > 5 * 60 * 1e3 && P({ ...e, lastSeenAt: o }), A(e.id), e.id;
54
+ const t = { id: C(), issuedAt: o, lastSeenAt: o };
55
+ return P(t), A(t.id), t.id;
56
+ }
57
+ function g() {
50
58
  if (typeof navigator > "u") return null;
51
- const r = (navigator.userAgent || "").toLowerCase();
52
- return /ipad|tablet|(android(?!.*mobile))/.test(r) ? "tablet" : /mobile|android|iphone|ipod|blackberry|iemobile|opera mini/.test(r) ? "mobile" : "desktop";
59
+ const o = (navigator.userAgent || "").toLowerCase();
60
+ return /ipad|tablet|(android(?!.*mobile))/.test(o) ? "tablet" : /mobile|android|iphone|ipod|blackberry|iemobile|opera mini/.test(o) ? "mobile" : "desktop";
61
+ }
62
+ const D = "http://localhost:4000";
63
+ function G(o) {
64
+ return /\/apps\/primestyle(?:\/|$)/.test(o) || /\/api\/proxy(?:\/|$)/.test(o);
65
+ }
66
+ function B() {
67
+ if (typeof window > "u") return null;
68
+ const o = window;
69
+ if (o.Shopify?.shop) return o.Shopify.shop;
70
+ const e = window.location.hostname;
71
+ return e.endsWith(".myshopify.com") ? e : null;
53
72
  }
54
- const I = "http://localhost:4000";
55
- class O {
56
- constructor(e, o) {
57
- this.apiKey = e || void 0, this.baseUrl = (o || I).replace(/\/+$/, "");
73
+ class ee {
74
+ constructor(e, t) {
75
+ this.apiKey = e || void 0, this.baseUrl = (t || D).replace(/\/+$/, "");
58
76
  }
59
77
  get headers() {
60
- return w(this.apiKey);
78
+ return T(this.apiKey);
61
79
  }
62
- async submitTryOn(e, o, a, s, t) {
80
+ async submitTryOn(e, t, a, s, r) {
63
81
  const i = {
64
- garmentImage: o,
82
+ garmentImage: t,
65
83
  // Attribution fields — backend logs these into the TryOnEvent collection
66
84
  // so non-technical operators can answer "which products are being tried on
67
85
  // and by how many customers". Safe fallbacks when absent.
68
- sessionId: p(),
69
- deviceHint: y()
86
+ sessionId: m(),
87
+ deviceHint: g()
70
88
  };
71
- if (t?.modelImageId && (i.modelImageId = t.modelImageId), e && (i.modelImage = e), a && a.length > 0 && (i.fitInfo = a), s && s !== "apparel" && (i.category = s), t?.productId && (i.productId = t.productId), t?.productTitle && (i.productTitle = t.productTitle), t?.productCategory && (i.productCategory = t.productCategory), t?.productSubcategory && (i.productSubcategory = t.productSubcategory), t?.productFitType && (i.productFitType = t.productFitType), t?.productType && (i.productType = t.productType), t?.productTags?.length && (i.productTags = t.productTags), t?.productDescription && (i.productDescription = t.productDescription), t?.productMaterial && (i.productMaterial = t.productMaterial), t?.garmentDetailImage && t.garmentDetailImage !== o && (i.garmentDetailImage = t.garmentDetailImage), t?.silhouetteContext && (i.silhouetteContext = t.silhouetteContext), t?.editFromPrevious && (i.editFromPrevious = !0), a && a.length > 0)
72
- for (const n of a) {
73
- const l = (n.garmentRange || "").replace(/[^\d.\-–]/g, " ").trim().split(/[\s\-–]+/).filter(Boolean).map(Number).filter((u) => !isNaN(u));
74
- if (l.length && n.userValue != null) {
75
- const u = (Math.min(...l) + Math.max(...l)) / 2;
76
- Math.round((n.userValue - u) * 10) / 10;
89
+ 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?.garmentDetailImage && r.garmentDetailImage !== t && (i.garmentDetailImage = r.garmentDetailImage), r?.silhouetteContext && (i.silhouetteContext = r.silhouetteContext), r?.editFromPrevious && (i.editFromPrevious = !0), a && a.length > 0)
90
+ for (const l of a) {
91
+ const d = (l.garmentRange || "").replace(/[^\d.\-–]/g, " ").trim().split(/[\s\-–]+/).filter(Boolean).map(Number).filter((u) => !isNaN(u));
92
+ if (d.length && l.userValue != null) {
93
+ const u = (Math.min(...d) + Math.max(...d)) / 2;
94
+ Math.round((l.userValue - u) * 10) / 10;
77
95
  }
78
96
  }
79
- const d = await fetch(`${this.baseUrl}/api/v1/tryon`, {
97
+ const n = await fetch(`${this.baseUrl}/api/v1/tryon`, {
80
98
  method: "POST",
81
99
  headers: this.headers,
82
100
  body: JSON.stringify(i)
83
101
  });
84
- if (!d.ok) {
85
- const n = await d.json().catch(() => ({}));
86
- throw d.status === 402 ? new h(
87
- n.message || "Insufficient try-ons",
102
+ if (!n.ok) {
103
+ const l = await n.json().catch(() => ({}));
104
+ throw n.status === 402 ? new c(
105
+ l.message || "Insufficient try-ons",
88
106
  "INSUFFICIENT_BALANCE"
89
- ) : new h(
90
- n.message || "Failed to submit try-on",
107
+ ) : new c(
108
+ l.message || "Failed to submit try-on",
91
109
  "API_ERROR"
92
110
  );
93
111
  }
94
- return d.json();
112
+ return n.json();
95
113
  }
96
114
  async getStatus(e) {
97
- const o = await fetch(`${this.baseUrl}/api/v1/tryon/status/${e}`, {
115
+ const t = await fetch(`${this.baseUrl}/api/v1/tryon/status/${e}`, {
98
116
  headers: this.headers
99
117
  });
100
- if (!o.ok) {
101
- const a = await o.json().catch(() => ({}));
102
- throw new h(
118
+ if (!t.ok) {
119
+ const a = await t.json().catch(() => ({}));
120
+ throw new c(
103
121
  a.message || "Failed to get status",
104
122
  "API_ERROR"
105
123
  );
106
124
  }
107
- return o.json();
125
+ return t.json();
108
126
  }
109
127
  async submitTryOnFeedback(e) {
110
- const o = await fetch(`${this.baseUrl}/api/v1/tryon/feedback`, {
128
+ const t = await fetch(`${this.baseUrl}/api/v1/tryon/feedback`, {
111
129
  method: "POST",
112
130
  headers: this.headers,
113
131
  body: JSON.stringify({
114
132
  ...e,
115
- sessionId: p(),
116
- deviceHint: y()
133
+ sessionId: m(),
134
+ deviceHint: g()
117
135
  })
118
136
  });
119
- if (!o.ok) {
120
- const a = await o.json().catch(() => ({}));
121
- throw new h(
137
+ if (!t.ok) {
138
+ const a = await t.json().catch(() => ({}));
139
+ throw new c(
122
140
  a.message || "Failed to submit try-on feedback",
123
141
  "API_ERROR"
124
142
  );
125
143
  }
126
- return o.json();
144
+ return t.json();
145
+ }
146
+ async reportEvent(e) {
147
+ const t = await fetch(`${this.baseUrl}/api/v1/tryon/event`, {
148
+ method: "POST",
149
+ headers: this.headers,
150
+ keepalive: !0,
151
+ body: JSON.stringify({
152
+ ...e,
153
+ sessionId: m(),
154
+ deviceHint: g()
155
+ })
156
+ });
157
+ if (!t.ok) {
158
+ const a = await t.json().catch(() => ({}));
159
+ throw new c(
160
+ a.message || "Failed to report SDK event",
161
+ "EVENT_REPORT_FAILED"
162
+ );
163
+ }
164
+ return t.json();
127
165
  }
128
- getStreamUrl() {
129
- const e = `${this.baseUrl}/api/v1/tryon/stream`;
130
- return this.apiKey ? `${e}?key=${encodeURIComponent(this.apiKey)}` : e;
166
+ async reportClientError(e) {
167
+ const t = await fetch(`${this.baseUrl}/api/v1/tryon/client-error`, {
168
+ method: "POST",
169
+ headers: this.headers,
170
+ keepalive: !0,
171
+ body: JSON.stringify({
172
+ ...e,
173
+ sessionId: m(),
174
+ deviceHint: g()
175
+ })
176
+ });
177
+ if (!t.ok) {
178
+ const a = await t.json().catch(() => ({}));
179
+ throw new c(
180
+ a.message || "Failed to report SDK client error",
181
+ "CLIENT_ERROR_REPORT_FAILED"
182
+ );
183
+ }
184
+ return t.json();
185
+ }
186
+ async reportReplayChunk(e) {
187
+ const t = G(this.baseUrl), a = t ? B() : null, s = t && a ? `${this.baseUrl}/events/replay` : `${this.baseUrl}/api/v1/tryon/replay`, r = t && a ? T() : this.headers, i = t && a ? { shopDomain: a, ...e } : e, n = await fetch(s, {
188
+ method: "POST",
189
+ headers: r,
190
+ body: JSON.stringify(i)
191
+ });
192
+ if (!n.ok) {
193
+ const l = await n.json().catch(() => ({}));
194
+ throw new c(
195
+ l.message || "Failed to report SDK replay",
196
+ "REPLAY_REPORT_FAILED"
197
+ );
198
+ }
199
+ return n.json();
200
+ }
201
+ getStreamUrl(e) {
202
+ const t = e ? `/api/v1/tryon/stream/${encodeURIComponent(e)}` : "/api/v1/tryon/stream", a = `${this.baseUrl}${t}`;
203
+ return this.apiKey ? `${a}?key=${encodeURIComponent(this.apiKey)}` : a;
131
204
  }
132
205
  }
133
- function w(r) {
206
+ function T(o) {
134
207
  const e = { "Content-Type": "application/json" };
135
- return r && (e.Authorization = `Bearer ${r}`), e;
208
+ return o && (e.Authorization = `Bearer ${o}`), e;
136
209
  }
137
- class h extends Error {
138
- constructor(e, o) {
139
- super(e), this.name = "PrimeStyleError", this.code = o;
210
+ class c extends Error {
211
+ constructor(e, t) {
212
+ super(e), this.name = "PrimeStyleError", this.code = t;
140
213
  }
141
214
  }
142
- class Y {
215
+ class oe {
143
216
  constructor(e) {
144
217
  this.eventSource = null, this.listeners = /* @__PURE__ */ new Map(), this.reconnectTimer = null, this.reconnectAttempts = 0, this.maxReconnectAttempts = 5, this.streamUrl = e;
145
218
  }
146
219
  connect() {
147
220
  this.eventSource || (this.eventSource = new EventSource(this.streamUrl), this.eventSource.addEventListener("vto-update", (e) => {
148
221
  try {
149
- const o = JSON.parse(e.data);
150
- this.emit(o.galleryId, o);
222
+ const t = JSON.parse(e.data);
223
+ this.emit(t.galleryId, t);
151
224
  } catch {
152
225
  }
153
226
  }), this.eventSource.onmessage = (e) => {
154
227
  try {
155
- const o = JSON.parse(e.data), a = this.listeners.keys().next().value, s = o.galleryId || o.jobId || a;
228
+ const t = JSON.parse(e.data), a = this.listeners.keys().next().value, s = t.galleryId || t.jobId || a;
156
229
  if (!s) return;
157
230
  this.emit(s, {
158
231
  galleryId: s,
159
- status: o.status,
160
- imageUrl: o.imageUrl ?? null,
161
- error: o.error ?? null,
162
- timestamp: o.timestamp ?? Date.now()
232
+ status: t.status,
233
+ imageUrl: t.imageUrl ?? null,
234
+ error: t.error ?? null,
235
+ timestamp: t.timestamp ?? Date.now()
163
236
  });
164
237
  } catch {
165
238
  }
@@ -176,86 +249,86 @@ class Y {
176
249
  this.connect();
177
250
  }, e);
178
251
  }
179
- onJob(e, o) {
180
- return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(o), this.eventSource || this.connect(), () => {
252
+ onJob(e, t) {
253
+ return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(t), this.eventSource || this.connect(), () => {
181
254
  const a = this.listeners.get(e);
182
- a && (a.delete(o), a.size === 0 && this.listeners.delete(e)), this.listeners.size === 0 && this.disconnect();
255
+ a && (a.delete(t), a.size === 0 && this.listeners.delete(e)), this.listeners.size === 0 && this.disconnect();
183
256
  };
184
257
  }
185
- emit(e, o) {
258
+ emit(e, t) {
186
259
  const a = this.listeners.get(e);
187
- a && a.forEach((s) => s(o));
260
+ a && a.forEach((s) => s(t));
188
261
  }
189
262
  disconnect() {
190
263
  this.reconnectTimer && (clearTimeout(this.reconnectTimer), this.reconnectTimer = null), this.eventSource && (this.eventSource.close(), this.eventSource = null), this.listeners.clear(), this.reconnectAttempts = 0;
191
264
  }
192
265
  }
193
- const v = 512, U = 0.65;
194
- function C(r, e = {}) {
195
- const o = e.maxDimension ?? v, a = e.quality ?? U;
196
- return new Promise((s, t) => {
266
+ const N = 512, H = 0.65;
267
+ function M(o, e = {}) {
268
+ const t = e.maxDimension ?? N, a = e.quality ?? H;
269
+ return new Promise((s, r) => {
197
270
  const i = new FileReader();
198
271
  i.onload = () => {
199
- const d = new Image();
200
- d.onload = () => {
272
+ const n = new Image();
273
+ n.onload = () => {
201
274
  try {
202
- const n = document.createElement("canvas");
203
- let { width: l, height: u } = d;
204
- (l > o || u > o) && (l > u ? (u = Math.round(u * o / l), l = o) : (l = Math.round(l * o / u), u = o)), n.width = l, n.height = u;
205
- const m = n.getContext("2d");
206
- if (!m) {
207
- t(new Error("Canvas context not available"));
275
+ const l = document.createElement("canvas");
276
+ let { width: d, height: u } = n;
277
+ (d > t || u > t) && (d > u ? (u = Math.round(u * t / d), d = t) : (d = Math.round(d * t / u), u = t)), l.width = d, l.height = u;
278
+ const b = l.getContext("2d");
279
+ if (!b) {
280
+ r(new Error("Canvas context not available"));
208
281
  return;
209
282
  }
210
- m.drawImage(d, 0, 0, l, u);
211
- const b = n.toDataURL("image/jpeg", a);
212
- s(b);
213
- } catch (n) {
214
- t(n);
283
+ b.drawImage(n, 0, 0, d, u);
284
+ const v = l.toDataURL("image/jpeg", a);
285
+ s(v);
286
+ } catch (l) {
287
+ r(l);
215
288
  }
216
- }, d.onerror = () => t(new Error("Failed to load image")), d.src = i.result;
217
- }, i.onerror = () => t(new Error("Failed to read file")), i.readAsDataURL(r);
289
+ }, n.onerror = () => r(new Error("Failed to load image")), n.src = i.result;
290
+ }, i.onerror = () => r(new Error("Failed to read file")), i.readAsDataURL(o);
218
291
  });
219
292
  }
220
- function F(r) {
221
- return ["image/jpeg", "image/png", "image/webp", "image/avif"].includes(r.type);
293
+ function te(o) {
294
+ return ["image/jpeg", "image/png", "image/webp", "image/avif"].includes(o.type);
222
295
  }
223
- async function V(r, e, o) {
296
+ async function re(o, e, t) {
224
297
  try {
225
- const a = typeof r == "string" ? r : await C(r, { maxDimension: 384, quality: 0.6 }), s = await fetch(`${e}/api/v1/sizing/age-check`, {
298
+ const a = typeof o == "string" ? o : await M(o, { maxDimension: 384, quality: 0.6 }), s = await fetch(`${e}/api/v1/sizing/age-check`, {
226
299
  method: "POST",
227
300
  headers: {
228
301
  "Content-Type": "application/json",
229
- Authorization: `Bearer ${o}`
302
+ Authorization: `Bearer ${t}`
230
303
  },
231
304
  body: JSON.stringify({ bodyImage: a })
232
305
  });
233
306
  if (!s.ok)
234
307
  return { isAdult: !0, confidence: "low" };
235
- const t = await s.json();
308
+ const r = await s.json();
236
309
  return {
237
- isAdult: t?.isAdult !== !1,
310
+ isAdult: r?.isAdult !== !1,
238
311
  // anything other than explicit false → allow
239
- confidence: t?.confidence === "high" ? "high" : "low",
240
- detectedGender: t?.detectedGender === "male" || t?.detectedGender === "female" || t?.detectedGender === "unknown" ? t.detectedGender : void 0,
241
- reasoning: typeof t?.reasoning == "string" ? t.reasoning : void 0
312
+ confidence: r?.confidence === "high" ? "high" : "low",
313
+ detectedGender: r?.detectedGender === "male" || r?.detectedGender === "female" || r?.detectedGender === "unknown" ? r.detectedGender : void 0,
314
+ reasoning: typeof r?.reasoning == "string" ? r.reasoning : void 0
242
315
  };
243
316
  } catch {
244
317
  return { isAdult: !0, confidence: "low" };
245
318
  }
246
319
  }
247
- const c = {};
248
- function z(r, e) {
249
- c[r] = { ...c[r] || {}, ...e };
320
+ const p = {};
321
+ function k(o, e) {
322
+ p[o] = { ...p[o] || {}, ...e };
250
323
  }
251
- function K(r) {
252
- const e = r?.toLowerCase().split("-")[0] || "en";
253
- return (o) => e === "en" || !c[e] ? o : c[e][o] ?? o;
324
+ function ae(o) {
325
+ const e = o?.toLowerCase().split("-")[0] || "en";
326
+ return (t) => e === "en" || !p[e] ? t : p[e][t] ?? t;
254
327
  }
255
- function j() {
328
+ function ie() {
256
329
  return typeof navigator > "u" ? "en" : (navigator.language || navigator.userLanguage || "en").split("-")[0].toLowerCase();
257
330
  }
258
- const J = [
331
+ const se = [
259
332
  "en",
260
333
  "es",
261
334
  "fr",
@@ -266,7 +339,7 @@ const J = [
266
339
  "zh",
267
340
  "ko",
268
341
  "ar"
269
- ], q = {
342
+ ], ne = {
270
343
  en: "English",
271
344
  es: "Español",
272
345
  fr: "Français",
@@ -277,7 +350,7 @@ const J = [
277
350
  zh: "中文",
278
351
  ko: "한국어",
279
352
  ar: "العربية"
280
- }, Z = [
353
+ }, le = [
281
354
  "Virtual Try-On",
282
355
  "Find Your Size & See It On You",
283
356
  "See Your Fit",
@@ -471,7 +544,68 @@ const J = [
471
544
  // ── Photo step — profile photo preload pill ──
472
545
  "Loaded from profile",
473
546
  "Clear"
474
- ], D = {
547
+ ], L = "ps-clarity-script", R = "wwb75cfm2z";
548
+ let y = null;
549
+ function S(o) {
550
+ const e = String(o || "").trim();
551
+ return e && /^[a-z0-9]+$/i.test(e) ? e : null;
552
+ }
553
+ function W() {
554
+ let o = "";
555
+ try {
556
+ o = process.env.NEXT_PUBLIC_PRIMESTYLE_CLARITY_PROJECT_ID ?? "";
557
+ } catch {
558
+ }
559
+ if (!o)
560
+ try {
561
+ o = process.env.NEXT_PUBLIC_CLARITY_PROJECT_ID ?? "";
562
+ } catch {
563
+ }
564
+ return S(o);
565
+ }
566
+ function O() {
567
+ if (typeof window > "u") return null;
568
+ const o = window;
569
+ return S(o.PrimeStyleAIClarityProjectId || o.PRIMESTYLE_CLARITY_PROJECT_ID);
570
+ }
571
+ function Y(o) {
572
+ return S(o) || O() || W() || R;
573
+ }
574
+ function E() {
575
+ if (typeof window > "u") return null;
576
+ const o = window.clarity;
577
+ return typeof o == "function" ? o : null;
578
+ }
579
+ function F(o) {
580
+ if (typeof window > "u" || typeof document > "u") return null;
581
+ const e = `${L}-${o}`;
582
+ return document.getElementById(e) || ((t, a, s, r, i) => {
583
+ t[s] = t[s] || function(...d) {
584
+ const u = t[s];
585
+ (u.q = u.q || []).push(d);
586
+ };
587
+ const n = a.createElement(r), l = a.getElementsByTagName(r)[0];
588
+ n.id = e, n.async = !0, n.src = "https://www.clarity.ms/tag/" + i, l?.parentNode?.insertBefore(n, l);
589
+ })(window, document, "clarity", "script", o), E();
590
+ }
591
+ function h(o, e) {
592
+ const t = E();
593
+ if (!(!t || e === void 0 || e === null || e === ""))
594
+ try {
595
+ t("set", o, String(e).slice(0, 512));
596
+ } catch {
597
+ }
598
+ }
599
+ function j(o = {}) {
600
+ const e = m();
601
+ h("ps_session", e), h("ps_sdk_session", e), h("ps_product_id", o.productId || void 0), h("ps_product_title", o.productTitle || void 0), h("ps_product_url", o.productUrl || void 0), h("ps_sdk_view", o.view || void 0), h("ps_tryon_job_id", o.jobId || void 0), h("ps_source", o.source || void 0);
602
+ }
603
+ function ue(o = {}) {
604
+ if (typeof window > "u" || typeof document > "u") return !1;
605
+ const e = Y(o.projectId);
606
+ return y = y || e, F(y), E() ? (j(o), !0) : !1;
607
+ }
608
+ const K = {
475
609
  "Virtual Try-On": "Probador Virtual",
476
610
  "Find Your Size & See It On You": "Encuentra tu talla y pruébatelo",
477
611
  "See Your Fit": "Ver tu ajuste",
@@ -726,7 +860,7 @@ const J = [
726
860
  // ── Photo step — profile photo preload pill ──
727
861
  "Loaded from profile": "Cargada del perfil",
728
862
  Clear: "Borrar"
729
- }, G = {
863
+ }, V = {
730
864
  "Virtual Try-On": "Essayage Virtuel",
731
865
  "Find Your Size & See It On You": "Trouvez votre taille et essayez-le",
732
866
  "See Your Fit": "Voir votre ajustement",
@@ -981,7 +1115,7 @@ const J = [
981
1115
  // ── Photo step — profile photo preload pill ──
982
1116
  "Loaded from profile": "Chargée depuis le profil",
983
1117
  Clear: "Effacer"
984
- }, B = {
1118
+ }, J = {
985
1119
  "Virtual Try-On": "Virtuelle Anprobe",
986
1120
  "Find Your Size & See It On You": "Finden Sie Ihre Größe und probieren Sie es an",
987
1121
  "See Your Fit": "Ihre Passform ansehen",
@@ -1236,7 +1370,7 @@ const J = [
1236
1370
  // ── Photo step — profile photo preload pill ──
1237
1371
  "Loaded from profile": "Aus Profil geladen",
1238
1372
  Clear: "Löschen"
1239
- }, H = {
1373
+ }, q = {
1240
1374
  "Virtual Try-On": "Prova Virtuale",
1241
1375
  "Find Your Size & See It On You": "Trova la tua taglia e provalo",
1242
1376
  "See Your Fit": "Vedi la vestibilità",
@@ -1491,7 +1625,7 @@ const J = [
1491
1625
  // ── Photo step — profile photo preload pill ──
1492
1626
  "Loaded from profile": "Caricata dal profilo",
1493
1627
  Clear: "Cancella"
1494
- }, M = {
1628
+ }, _ = {
1495
1629
  "Virtual Try-On": "Provador Virtual",
1496
1630
  "Find Your Size & See It On You": "Encontre seu tamanho e experimente",
1497
1631
  "See Your Fit": "Veja seu ajuste",
@@ -1746,7 +1880,7 @@ const J = [
1746
1880
  // ── Photo step — profile photo preload pill ──
1747
1881
  "Loaded from profile": "Carregada do perfil",
1748
1882
  Clear: "Limpar"
1749
- }, N = {
1883
+ }, Z = {
1750
1884
  "Virtual Try-On": "バーチャル試着",
1751
1885
  "Find Your Size & See It On You": "あなたのサイズを見つけて試着",
1752
1886
  "See Your Fit": "フィット感を見る",
@@ -2001,7 +2135,7 @@ const J = [
2001
2135
  // ── Photo step — profile photo preload pill ──
2002
2136
  "Loaded from profile": "プロフィールから読み込み",
2003
2137
  Clear: "クリア"
2004
- }, k = {
2138
+ }, x = {
2005
2139
  "Virtual Try-On": "虚拟试穿",
2006
2140
  "Find Your Size & See It On You": "找到你的尺码并试穿",
2007
2141
  "See Your Fit": "查看合身效果",
@@ -2256,7 +2390,7 @@ const J = [
2256
2390
  // ── Photo step — profile photo preload pill ──
2257
2391
  "Loaded from profile": "已从个人资料加载",
2258
2392
  Clear: "清除"
2259
- }, L = {
2393
+ }, Q = {
2260
2394
  "Virtual Try-On": "가상 피팅",
2261
2395
  "Find Your Size & See It On You": "사이즈를 찾고 입어보세요",
2262
2396
  "See Your Fit": "핏 확인하기",
@@ -2511,7 +2645,7 @@ const J = [
2511
2645
  // ── Photo step — profile photo preload pill ──
2512
2646
  "Loaded from profile": "프로필에서 불러옴",
2513
2647
  Clear: "지우기"
2514
- }, R = {
2648
+ }, $ = {
2515
2649
  "Virtual Try-On": "تجربة افتراضية",
2516
2650
  "Find Your Size & See It On You": "اعثر على مقاسك وجرّبه",
2517
2651
  "See Your Fit": "شاهد الملاءمة",
@@ -2766,34 +2900,36 @@ const J = [
2766
2900
  // ── Photo step — profile photo preload pill ──
2767
2901
  "Loaded from profile": "تم التحميل من الملف الشخصي",
2768
2902
  Clear: "مسح"
2769
- }, W = {
2770
- es: D,
2771
- fr: G,
2772
- de: B,
2773
- it: H,
2774
- pt: M,
2775
- ja: N,
2776
- zh: k,
2777
- ko: L,
2778
- ar: R
2903
+ }, X = {
2904
+ es: K,
2905
+ fr: V,
2906
+ de: J,
2907
+ it: q,
2908
+ pt: _,
2909
+ ja: Z,
2910
+ zh: x,
2911
+ ko: Q,
2912
+ ar: $
2779
2913
  };
2780
- for (const [r, e] of Object.entries(W))
2781
- z(r, e);
2914
+ for (const [o, e] of Object.entries(X))
2915
+ k(o, e);
2782
2916
  export {
2783
- O as A,
2784
- q as L,
2785
- h as P,
2786
- Y as S,
2787
- Z as T,
2788
- C as a,
2789
- J as b,
2790
- K as c,
2791
- V as d,
2792
- j as e,
2793
- y as f,
2794
- p as g,
2795
- F as i,
2796
- w as j,
2797
- z as r
2917
+ ee as A,
2918
+ ne as L,
2919
+ c as P,
2920
+ oe as S,
2921
+ le as T,
2922
+ M as a,
2923
+ se as b,
2924
+ ae as c,
2925
+ re as d,
2926
+ ie as e,
2927
+ g as f,
2928
+ m as g,
2929
+ te as i,
2930
+ T as j,
2931
+ k as r,
2932
+ ue as s,
2933
+ j as t
2798
2934
  };
2799
- //# sourceMappingURL=index-BiotPzcm.js.map
2935
+ //# sourceMappingURL=index-8lZs7T93.js.map