@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.
- package/dist/PrimeStyleTryon.d.ts +6 -0
- package/dist/api-client.d.ts +42 -1
- package/dist/clarity.d.ts +13 -0
- package/dist/{index-BiotPzcm.js → index-8lZs7T93.js} +292 -156
- package/dist/index-8lZs7T93.js.map +1 -0
- package/dist/primestyle-tryon.js +173 -94
- package/dist/primestyle-tryon.js.map +1 -1
- package/dist/react/PrimeStyleTryonInner.d.ts +1 -1
- package/dist/react/index.js +5902 -5518
- package/dist/react/index.js.map +1 -1
- package/dist/react/styles.d.ts +1 -1
- package/dist/react/types.d.ts +2 -0
- package/dist/replay.d.ts +9 -0
- package/dist/storefront/primestyle-tryon.js +737 -117
- package/dist/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/index-BiotPzcm.js.map +0 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
const f = "ps_session";
|
|
3
|
-
const
|
|
4
|
-
let
|
|
5
|
-
function
|
|
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
|
|
12
|
+
function C() {
|
|
13
13
|
if (typeof crypto < "u" && typeof crypto.randomUUID == "function")
|
|
14
14
|
return crypto.randomUUID();
|
|
15
|
-
const
|
|
16
|
-
let e =
|
|
17
|
-
for (let
|
|
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
|
|
21
|
-
if (!
|
|
20
|
+
function z() {
|
|
21
|
+
if (!w()) return I;
|
|
22
22
|
try {
|
|
23
|
-
const
|
|
24
|
-
if (!
|
|
25
|
-
const e = JSON.parse(
|
|
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
|
|
36
|
-
if (
|
|
35
|
+
function P(o) {
|
|
36
|
+
if (I = o, !!w())
|
|
37
37
|
try {
|
|
38
|
-
window.localStorage.setItem(f, JSON.stringify(
|
|
38
|
+
window.localStorage.setItem(f, JSON.stringify(o));
|
|
39
39
|
} catch {
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
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
|
|
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
|
|
52
|
-
return /ipad|tablet|(android(?!.*mobile))/.test(
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
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
|
|
78
|
+
return T(this.apiKey);
|
|
61
79
|
}
|
|
62
|
-
async submitTryOn(e,
|
|
80
|
+
async submitTryOn(e, t, a, s, r) {
|
|
63
81
|
const i = {
|
|
64
|
-
garmentImage:
|
|
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:
|
|
69
|
-
deviceHint:
|
|
86
|
+
sessionId: m(),
|
|
87
|
+
deviceHint: g()
|
|
70
88
|
};
|
|
71
|
-
if (
|
|
72
|
-
for (const
|
|
73
|
-
const
|
|
74
|
-
if (
|
|
75
|
-
const u = (Math.min(...
|
|
76
|
-
Math.round((
|
|
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
|
|
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 (!
|
|
85
|
-
const
|
|
86
|
-
throw
|
|
87
|
-
|
|
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
|
|
90
|
-
|
|
107
|
+
) : new c(
|
|
108
|
+
l.message || "Failed to submit try-on",
|
|
91
109
|
"API_ERROR"
|
|
92
110
|
);
|
|
93
111
|
}
|
|
94
|
-
return
|
|
112
|
+
return n.json();
|
|
95
113
|
}
|
|
96
114
|
async getStatus(e) {
|
|
97
|
-
const
|
|
115
|
+
const t = await fetch(`${this.baseUrl}/api/v1/tryon/status/${e}`, {
|
|
98
116
|
headers: this.headers
|
|
99
117
|
});
|
|
100
|
-
if (!
|
|
101
|
-
const a = await
|
|
102
|
-
throw new
|
|
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
|
|
125
|
+
return t.json();
|
|
108
126
|
}
|
|
109
127
|
async submitTryOnFeedback(e) {
|
|
110
|
-
const
|
|
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:
|
|
116
|
-
deviceHint:
|
|
133
|
+
sessionId: m(),
|
|
134
|
+
deviceHint: g()
|
|
117
135
|
})
|
|
118
136
|
});
|
|
119
|
-
if (!
|
|
120
|
-
const a = await
|
|
121
|
-
throw new
|
|
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
|
|
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
|
-
|
|
129
|
-
const
|
|
130
|
-
|
|
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
|
|
206
|
+
function T(o) {
|
|
134
207
|
const e = { "Content-Type": "application/json" };
|
|
135
|
-
return
|
|
208
|
+
return o && (e.Authorization = `Bearer ${o}`), e;
|
|
136
209
|
}
|
|
137
|
-
class
|
|
138
|
-
constructor(e,
|
|
139
|
-
super(e), this.name = "PrimeStyleError", this.code =
|
|
210
|
+
class c extends Error {
|
|
211
|
+
constructor(e, t) {
|
|
212
|
+
super(e), this.name = "PrimeStyleError", this.code = t;
|
|
140
213
|
}
|
|
141
214
|
}
|
|
142
|
-
class
|
|
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
|
|
150
|
-
this.emit(
|
|
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
|
|
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:
|
|
160
|
-
imageUrl:
|
|
161
|
-
error:
|
|
162
|
-
timestamp:
|
|
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,
|
|
180
|
-
return this.listeners.has(e) || this.listeners.set(e, /* @__PURE__ */ new Set()), this.listeners.get(e).add(
|
|
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(
|
|
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,
|
|
258
|
+
emit(e, t) {
|
|
186
259
|
const a = this.listeners.get(e);
|
|
187
|
-
a && a.forEach((s) => s(
|
|
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
|
|
194
|
-
function
|
|
195
|
-
const
|
|
196
|
-
return new Promise((s,
|
|
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
|
|
200
|
-
|
|
272
|
+
const n = new Image();
|
|
273
|
+
n.onload = () => {
|
|
201
274
|
try {
|
|
202
|
-
const
|
|
203
|
-
let { width:
|
|
204
|
-
(
|
|
205
|
-
const
|
|
206
|
-
if (!
|
|
207
|
-
|
|
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
|
-
|
|
211
|
-
const
|
|
212
|
-
s(
|
|
213
|
-
} catch (
|
|
214
|
-
|
|
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
|
-
},
|
|
217
|
-
}, i.onerror = () =>
|
|
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
|
|
221
|
-
return ["image/jpeg", "image/png", "image/webp", "image/avif"].includes(
|
|
293
|
+
function te(o) {
|
|
294
|
+
return ["image/jpeg", "image/png", "image/webp", "image/avif"].includes(o.type);
|
|
222
295
|
}
|
|
223
|
-
async function
|
|
296
|
+
async function re(o, e, t) {
|
|
224
297
|
try {
|
|
225
|
-
const a = typeof
|
|
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 ${
|
|
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
|
|
308
|
+
const r = await s.json();
|
|
236
309
|
return {
|
|
237
|
-
isAdult:
|
|
310
|
+
isAdult: r?.isAdult !== !1,
|
|
238
311
|
// anything other than explicit false → allow
|
|
239
|
-
confidence:
|
|
240
|
-
detectedGender:
|
|
241
|
-
reasoning: typeof
|
|
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
|
|
248
|
-
function
|
|
249
|
-
|
|
320
|
+
const p = {};
|
|
321
|
+
function k(o, e) {
|
|
322
|
+
p[o] = { ...p[o] || {}, ...e };
|
|
250
323
|
}
|
|
251
|
-
function
|
|
252
|
-
const e =
|
|
253
|
-
return (
|
|
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
|
|
328
|
+
function ie() {
|
|
256
329
|
return typeof navigator > "u" ? "en" : (navigator.language || navigator.userLanguage || "en").split("-")[0].toLowerCase();
|
|
257
330
|
}
|
|
258
|
-
const
|
|
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
|
-
],
|
|
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
|
-
},
|
|
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
|
-
],
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
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
|
-
},
|
|
2770
|
-
es:
|
|
2771
|
-
fr:
|
|
2772
|
-
de:
|
|
2773
|
-
it:
|
|
2774
|
-
pt:
|
|
2775
|
-
ja:
|
|
2776
|
-
zh:
|
|
2777
|
-
ko:
|
|
2778
|
-
ar:
|
|
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 [
|
|
2781
|
-
|
|
2914
|
+
for (const [o, e] of Object.entries(X))
|
|
2915
|
+
k(o, e);
|
|
2782
2916
|
export {
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
|
|
2788
|
-
|
|
2789
|
-
|
|
2790
|
-
|
|
2791
|
-
|
|
2792
|
-
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
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-
|
|
2935
|
+
//# sourceMappingURL=index-8lZs7T93.js.map
|