@gengage/assistant-fe 0.6.23 → 0.6.25
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/agentic/index.d.ts +1 -1
- package/dist/agentic/index.js +684 -639
- package/dist/agentic/types.d.ts +17 -2
- package/dist/agentic/worker.d.ts +1 -1
- package/dist/agentic/worker.js +294 -237
- package/dist/agentic.iife.js +8 -8
- package/dist/{api-paths-BmN07ddR.js → api-paths-C0t52SV3.js} +1 -1
- package/dist/chat-runtime.js +1 -1
- package/dist/chat.iife.js +1 -1
- package/dist/chat.js +1 -1
- package/dist/{common-sx2gD-IP.js → common-aUI01FdB.js} +1 -1
- package/dist/common.js +5 -5
- package/dist/{connection-warning-D5T4gHSM.js → connection-warning-DkdoruU2.js} +1 -1
- package/dist/{fastIntent-BFAGybCb.js → fastIntent-iu8Z5MpN.js} +1 -1
- package/dist/index.js +10 -10
- package/dist/native.iife.js +1 -1
- package/dist/qna-runtime.js +1 -1
- package/dist/qna.iife.js +1 -1
- package/dist/qna.js +1 -1
- package/dist/{route-params-5KSvTyeb.js → route-params-UDemctx_.js} +330 -313
- package/dist/{runtime-DM7DHhH9.js → runtime-Cu05VoNY.js} +3 -3
- package/dist/{runtime-BD2fW-ed.js → runtime-DGUqplEx.js} +3 -3
- package/dist/{runtime-DQ3ULuNF.js → runtime-aSV5XfKR.js} +3 -3
- package/dist/{simbut-hkt_4H97.js → simbut-S9Kviutm.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{simrel-BbkK5Bwt.js → simrel-BTn7A6VC.js} +1 -1
- package/dist/simrel-runtime.js +1 -1
- package/dist/simrel.iife.js +1 -1
- package/dist/simrel.js +2 -2
- package/dist/{widget-base-BPKfPh0N.js → widget-base-T-AFCGg6.js} +1 -1
- package/package.json +1 -1
|
@@ -58,17 +58,17 @@ function we() {
|
|
|
58
58
|
}
|
|
59
59
|
async function be(t, e, r) {
|
|
60
60
|
const n = await ft(t);
|
|
61
|
-
n && (await
|
|
61
|
+
n && (await H(n.transaction("refs", "readwrite").objectStore("refs").put(r, e)), n.close());
|
|
62
62
|
}
|
|
63
63
|
async function ke(t, e) {
|
|
64
64
|
const r = await ft(t);
|
|
65
65
|
if (!r) return;
|
|
66
|
-
const n = await
|
|
66
|
+
const n = await H(r.transaction("refs", "readonly").objectStore("refs").get(e));
|
|
67
67
|
return r.close(), n;
|
|
68
68
|
}
|
|
69
69
|
async function Ot(t, e) {
|
|
70
70
|
const r = await ft(t);
|
|
71
|
-
r && (await
|
|
71
|
+
r && (await H(r.transaction("refs", "readwrite").objectStore("refs").delete(e)), r.close());
|
|
72
72
|
}
|
|
73
73
|
async function ft(t) {
|
|
74
74
|
if (!globalThis.indexedDB) return null;
|
|
@@ -76,12 +76,12 @@ async function ft(t) {
|
|
|
76
76
|
const e = globalThis.indexedDB.open(t, 1);
|
|
77
77
|
return e.onupgradeneeded = () => {
|
|
78
78
|
e.result.createObjectStore("refs");
|
|
79
|
-
}, await
|
|
79
|
+
}, await H(e);
|
|
80
80
|
} catch {
|
|
81
81
|
return null;
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
function
|
|
84
|
+
function H(t) {
|
|
85
85
|
return new Promise((e, r) => {
|
|
86
86
|
t.onsuccess = () => e(t.result), t.onerror = () => r(t.error);
|
|
87
87
|
});
|
|
@@ -92,7 +92,7 @@ function Ae(t) {
|
|
|
92
92
|
function _e(t) {
|
|
93
93
|
return !!t && typeof t == "object" && t.type === "rpc.req";
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function Rn(t = self) {
|
|
96
96
|
let e = 1;
|
|
97
97
|
const r = /* @__PURE__ */ new Map();
|
|
98
98
|
return t.addEventListener("message", (n) => {
|
|
@@ -122,7 +122,7 @@ function Mn(t = self) {
|
|
|
122
122
|
});
|
|
123
123
|
};
|
|
124
124
|
}
|
|
125
|
-
function
|
|
125
|
+
function $n({ worker: t, tools: e = {}, beacon: r, confirmation: n, memory: o = Se(), refStore: i }) {
|
|
126
126
|
t.addEventListener("message", (a) => {
|
|
127
127
|
const s = a.data;
|
|
128
128
|
_e(s) && xe(t, s, {
|
|
@@ -152,7 +152,7 @@ async function xe(t, e, r) {
|
|
|
152
152
|
});
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
-
var et = /* @__PURE__ */ new Map(),
|
|
155
|
+
var et = /* @__PURE__ */ new Map(), Mt = null;
|
|
156
156
|
function Se() {
|
|
157
157
|
try {
|
|
158
158
|
if (typeof sessionStorage < "u") return sessionStorage;
|
|
@@ -169,17 +169,17 @@ function Se() {
|
|
|
169
169
|
};
|
|
170
170
|
}
|
|
171
171
|
function ve() {
|
|
172
|
-
return
|
|
172
|
+
return Mt ||= ge(), Mt;
|
|
173
173
|
}
|
|
174
174
|
function je(t) {
|
|
175
175
|
if (t && typeof t == "object" && typeof t.name == "string") return t;
|
|
176
176
|
throw new Error("tool.invoke requires { name, input }");
|
|
177
177
|
}
|
|
178
|
-
function
|
|
178
|
+
function Ce(t) {
|
|
179
179
|
if (t && typeof t == "object" && t.key !== void 0) return t;
|
|
180
180
|
throw new Error("memory.get requires { key }");
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Ee(t) {
|
|
183
183
|
if (t && typeof t == "object" && t.key !== void 0) return t;
|
|
184
184
|
throw new Error("memory.set requires { key }");
|
|
185
185
|
}
|
|
@@ -219,7 +219,7 @@ function Oe(t) {
|
|
|
219
219
|
const e = t.options?.ttlMs ?? t.ttlMs;
|
|
220
220
|
return typeof e == "number" && Number.isFinite(e) && e > 0 ? { ttlMs: e } : void 0;
|
|
221
221
|
}
|
|
222
|
-
async function
|
|
222
|
+
async function Me(t, e, r) {
|
|
223
223
|
if (dt(t)) {
|
|
224
224
|
const n = t.getItem(r);
|
|
225
225
|
if (!n) return null;
|
|
@@ -231,7 +231,7 @@ async function Be(t, e, r) {
|
|
|
231
231
|
}
|
|
232
232
|
return pt(t) && !mt(t) ? await t.get(e, r) ?? null : await t[e].get(r) ?? null;
|
|
233
233
|
}
|
|
234
|
-
async function
|
|
234
|
+
async function Be(t, e, r, n, o) {
|
|
235
235
|
return dt(t) ? (t.setItem(r, JSON.stringify(n ?? null)), !0) : pt(t) && !mt(t) ? await t.set(e, r, n ?? null, o) !== !1 : await t[e].set(r, n ?? null, o) !== !1;
|
|
236
236
|
}
|
|
237
237
|
async function Re(t, e, r) {
|
|
@@ -251,19 +251,19 @@ async function $e(t, e, { tools: r, beacon: n, confirmation: o, memory: i, refSt
|
|
|
251
251
|
return typeof s == "boolean" ? { confirmed: s } : s;
|
|
252
252
|
}
|
|
253
253
|
if (t === "memory.get") {
|
|
254
|
-
const { key: s, tier: c } =
|
|
255
|
-
return
|
|
254
|
+
const { key: s, tier: c } = Ce(e);
|
|
255
|
+
return Me(i, rt(c), String(s));
|
|
256
256
|
}
|
|
257
257
|
if (t === "memory.set") {
|
|
258
|
-
const s =
|
|
259
|
-
return { ok: await
|
|
258
|
+
const s = Ee(e);
|
|
259
|
+
return { ok: await Be(i, rt(s.tier), String(s.key), s.value, Oe(s)) };
|
|
260
260
|
}
|
|
261
261
|
if (t === "memory.remove") {
|
|
262
262
|
const { key: s, tier: c } = Ie(e);
|
|
263
263
|
return { ok: await Re(i, rt(c), String(s)) };
|
|
264
264
|
}
|
|
265
265
|
if (t === "ref.put") {
|
|
266
|
-
const s =
|
|
266
|
+
const s = V({
|
|
267
267
|
tools: r,
|
|
268
268
|
beacon: n,
|
|
269
269
|
confirmation: o,
|
|
@@ -272,14 +272,14 @@ async function $e(t, e, { tools: r, beacon: n, confirmation: o, memory: i, refSt
|
|
|
272
272
|
}), c = Te(e);
|
|
273
273
|
return s.put(c.value, Pe(c));
|
|
274
274
|
}
|
|
275
|
-
if (t === "ref.get") return
|
|
275
|
+
if (t === "ref.get") return V({
|
|
276
276
|
tools: r,
|
|
277
277
|
beacon: n,
|
|
278
278
|
confirmation: o,
|
|
279
279
|
memory: i,
|
|
280
280
|
refStore: a
|
|
281
281
|
}).get(e);
|
|
282
|
-
if (t === "ref.materialize") return
|
|
282
|
+
if (t === "ref.materialize") return V({
|
|
283
283
|
tools: r,
|
|
284
284
|
beacon: n,
|
|
285
285
|
confirmation: o,
|
|
@@ -287,7 +287,7 @@ async function $e(t, e, { tools: r, beacon: n, confirmation: o, memory: i, refSt
|
|
|
287
287
|
refStore: a
|
|
288
288
|
}).materialize(e);
|
|
289
289
|
if (t === "ref.remove")
|
|
290
|
-
return await
|
|
290
|
+
return await V({
|
|
291
291
|
tools: r,
|
|
292
292
|
beacon: n,
|
|
293
293
|
confirmation: o,
|
|
@@ -296,7 +296,7 @@ async function $e(t, e, { tools: r, beacon: n, confirmation: o, memory: i, refSt
|
|
|
296
296
|
}).delete(e), { ok: !0 };
|
|
297
297
|
throw new Error(`Unknown RPC method: ${t}`);
|
|
298
298
|
}
|
|
299
|
-
function
|
|
299
|
+
function V(t) {
|
|
300
300
|
const e = t.refStore || ve();
|
|
301
301
|
if (!e || typeof e.put != "function" || typeof e.get != "function") throw new Error("No ref store is configured.");
|
|
302
302
|
return e;
|
|
@@ -307,14 +307,14 @@ function Le() {
|
|
|
307
307
|
function v(t) {
|
|
308
308
|
return Math.max(0, Math.round(performance.now() - t));
|
|
309
309
|
}
|
|
310
|
-
function
|
|
310
|
+
function N(t) {
|
|
311
311
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
312
312
|
}
|
|
313
313
|
function Ne(t) {
|
|
314
|
-
const { accountId: e, locale: r = "en-GB", parentUrl: n = "", threadId: o, incomingContext: i, messageLimit: a } = t, s =
|
|
314
|
+
const { accountId: e, locale: r = "en-GB", parentUrl: n = "", threadId: o, incomingContext: i, messageLimit: a } = t, s = N(i) ? i : {}, c = N(s.thread) ? s.thread : {}, l = N(s.panel) ? s.panel : {}, u = N(s.meta) ? s.meta : {}, f = zt(s.messages, a), p = {
|
|
315
315
|
id: String(o || c.id || self.crypto.randomUUID()),
|
|
316
316
|
started_at: String(c.started_at || Le()),
|
|
317
|
-
extensions:
|
|
317
|
+
extensions: N(c.extensions) ? { ...c.extensions } : {}
|
|
318
318
|
}, m = String(u.locale || r), g = String(u.parentUrl || n || typeof self < "u" && self.location?.href || "");
|
|
319
319
|
return {
|
|
320
320
|
panel: { ...l },
|
|
@@ -331,15 +331,15 @@ function qe(t, e, r) {
|
|
|
331
331
|
const n = zt([e], r)[0];
|
|
332
332
|
return n ? {
|
|
333
333
|
...t,
|
|
334
|
-
messages:
|
|
334
|
+
messages: G([...t.messages, n], r)
|
|
335
335
|
} : t;
|
|
336
336
|
}
|
|
337
|
-
function
|
|
337
|
+
function G(t, e) {
|
|
338
338
|
const r = Fe(e);
|
|
339
339
|
return r === 1 / 0 ? [...t] : t.slice(-r);
|
|
340
340
|
}
|
|
341
341
|
function zt(t, e) {
|
|
342
|
-
return Array.isArray(t) ?
|
|
342
|
+
return Array.isArray(t) ? G(t.map((r) => {
|
|
343
343
|
const n = r?.role;
|
|
344
344
|
return {
|
|
345
345
|
role: n === "model" ? "assistant" : typeof n == "string" ? n : "",
|
|
@@ -377,7 +377,7 @@ function Dt(t, e) {
|
|
|
377
377
|
function h(t) {
|
|
378
378
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
379
379
|
}
|
|
380
|
-
var
|
|
380
|
+
var Ln = class {
|
|
381
381
|
#t = /* @__PURE__ */ new Map();
|
|
382
382
|
#r = /* @__PURE__ */ new Map();
|
|
383
383
|
#o;
|
|
@@ -409,7 +409,7 @@ var $n = class {
|
|
|
409
409
|
}
|
|
410
410
|
async load(t) {
|
|
411
411
|
this.pruneExpired();
|
|
412
|
-
const e = t?.
|
|
412
|
+
const e = t?.session_id || t?.meta?.threadId || t?.sessionId, r = String(e || "default"), n = this.#t.get(r);
|
|
413
413
|
if (n) {
|
|
414
414
|
const a = He(n, t?.context, this.#n);
|
|
415
415
|
return this.#e(r, a), a;
|
|
@@ -507,13 +507,16 @@ function Je(t, e) {
|
|
|
507
507
|
return !e || !Array.isArray(t) ? t : t.slice(-e);
|
|
508
508
|
}
|
|
509
509
|
function Ze(t, e) {
|
|
510
|
-
|
|
510
|
+
if (!h(t) && !h(e)) return {};
|
|
511
|
+
const r = h(t) ? t : {}, n = yt(r, h(e) ? e : {});
|
|
512
|
+
return h(r.panel) && (n.panel = r.panel), n;
|
|
511
513
|
}
|
|
512
514
|
function He(t, e, r) {
|
|
513
515
|
if (!h(e)) return t;
|
|
514
516
|
const n = yt(t, e, r);
|
|
515
517
|
return {
|
|
516
518
|
...n,
|
|
519
|
+
panel: t.panel,
|
|
517
520
|
thread: {
|
|
518
521
|
...n.thread,
|
|
519
522
|
id: t.thread.id,
|
|
@@ -547,22 +550,22 @@ function yt(t, e, r) {
|
|
|
547
550
|
...f,
|
|
548
551
|
...p
|
|
549
552
|
},
|
|
550
|
-
messages: Array.isArray(o.messages) ?
|
|
553
|
+
messages: Array.isArray(o.messages) ? G(o.messages, r) : t.messages ?? []
|
|
551
554
|
};
|
|
552
555
|
}
|
|
553
556
|
function Vt(t) {
|
|
554
557
|
const e = String.fromCharCode(...t);
|
|
555
558
|
return btoa(e).replace(/\+/gu, "-").replace(/\//gu, "_").replace(/=+$/u, "");
|
|
556
559
|
}
|
|
557
|
-
function
|
|
560
|
+
function Bt(t) {
|
|
558
561
|
return Vt(new TextEncoder().encode(JSON.stringify(t)));
|
|
559
562
|
}
|
|
560
563
|
async function Ge({ accountId: t, devJwtSecret: e, ttlS: r = 300 }) {
|
|
561
564
|
if (!e) throw new Error("devJwtSecret is required for local agent mode.");
|
|
562
|
-
const n = Math.floor(Date.now() / 1e3), o = `${
|
|
565
|
+
const n = Math.floor(Date.now() / 1e3), o = `${Bt({
|
|
563
566
|
alg: "HS256",
|
|
564
567
|
typ: "JWT"
|
|
565
|
-
})}.${
|
|
568
|
+
})}.${Bt({
|
|
566
569
|
sub: t,
|
|
567
570
|
iat: n,
|
|
568
571
|
exp: n + r,
|
|
@@ -704,7 +707,7 @@ function tr(t, e) {
|
|
|
704
707
|
detail: r.detail
|
|
705
708
|
});
|
|
706
709
|
}
|
|
707
|
-
function
|
|
710
|
+
function Nn(t) {
|
|
708
711
|
return t instanceof T ? {
|
|
709
712
|
type: "error",
|
|
710
713
|
code: t.code,
|
|
@@ -718,7 +721,7 @@ function Ln(t) {
|
|
|
718
721
|
function er(t) {
|
|
719
722
|
return t === 401 ? "unauthorized" : t === 403 ? "forbidden" : t === 413 ? "payload_too_large" : t === 429 ? "rate_limited" : "internal";
|
|
720
723
|
}
|
|
721
|
-
async function
|
|
724
|
+
async function qn({ beUrl: t, accountId: e, devJwtSecret: r, tokenBrokerUrl: n, tokenBrokerAudience: o, jwtProvider: i, parentUrl: a, op: s, input: c, cacheTtlS: l, cacheKey: u, browserCache: f, signal: p }) {
|
|
722
725
|
const m = await (i || Qe({
|
|
723
726
|
accountId: e,
|
|
724
727
|
devJwtSecret: r,
|
|
@@ -727,7 +730,7 @@ async function Nn({ beUrl: t, accountId: e, devJwtSecret: r, tokenBrokerUrl: n,
|
|
|
727
730
|
}))({
|
|
728
731
|
...p ? { signal: p } : {},
|
|
729
732
|
...a ? { parentUrl: a } : {}
|
|
730
|
-
}), { opDomain: g, opName: _ } = rr(s, e),
|
|
733
|
+
}), { opDomain: g, opName: _ } = rr(s, e), C = {
|
|
731
734
|
method: "POST",
|
|
732
735
|
headers: {
|
|
733
736
|
authorization: `Bearer ${m}`,
|
|
@@ -742,7 +745,7 @@ async function Nn({ beUrl: t, accountId: e, devJwtSecret: r, tokenBrokerUrl: n,
|
|
|
742
745
|
...u !== void 0 ? { cache_key: u } : {}
|
|
743
746
|
}),
|
|
744
747
|
...p ? { signal: p } : {}
|
|
745
|
-
}, P = `${String(t).replace(/\/+$/u, "")}/v1/execute`, O = f === !1 ? await fetch(P,
|
|
748
|
+
}, P = `${String(t).replace(/\/+$/u, "")}/v1/execute`, O = f === !1 ? await fetch(P, C) : await pe(P, C, typeof f == "object" ? f : {});
|
|
746
749
|
if (!O.ok) throw tr(O.status, await or(O));
|
|
747
750
|
return ir(O);
|
|
748
751
|
}
|
|
@@ -795,7 +798,7 @@ function $t(t, e) {
|
|
|
795
798
|
e[r] = n;
|
|
796
799
|
}
|
|
797
800
|
}
|
|
798
|
-
function
|
|
801
|
+
function Fn(t = {}) {
|
|
799
802
|
return {
|
|
800
803
|
type: "metadata",
|
|
801
804
|
...t
|
|
@@ -809,13 +812,13 @@ function ar(t, e = !1, r = {}) {
|
|
|
809
812
|
...r
|
|
810
813
|
};
|
|
811
814
|
}
|
|
812
|
-
function
|
|
815
|
+
function Un(t) {
|
|
813
816
|
return {
|
|
814
817
|
type: "ui_spec",
|
|
815
818
|
...t
|
|
816
819
|
};
|
|
817
820
|
}
|
|
818
|
-
function
|
|
821
|
+
function zn(t) {
|
|
819
822
|
return {
|
|
820
823
|
type: "action",
|
|
821
824
|
action: t
|
|
@@ -842,28 +845,28 @@ function gt(t, e = {}) {
|
|
|
842
845
|
if (!r) return null;
|
|
843
846
|
const n = e.catalogMapper?.(r);
|
|
844
847
|
if (n) return n;
|
|
845
|
-
const o =
|
|
848
|
+
const o = B(r.sku, r.SKU);
|
|
846
849
|
if (!o) return null;
|
|
847
850
|
const i = {
|
|
848
851
|
sku: o,
|
|
849
|
-
name:
|
|
850
|
-
url:
|
|
851
|
-
}, a = Array.isArray(r.images) ? r.images : void 0, s =
|
|
852
|
+
name: B(r.name, r.title, r.short_name, o) || o,
|
|
853
|
+
url: B(r.url) || ""
|
|
854
|
+
}, a = Array.isArray(r.images) ? r.images : void 0, s = B(r.imageUrl, r.image_url, r.image, a?.[0]);
|
|
852
855
|
s && (i.imageUrl = s), a && a.length > 1 && (i.images = a.filter((P) => !!P).map(String));
|
|
853
|
-
const c =
|
|
856
|
+
const c = q(r.price_discounted), l = q(r.price), u = c || l;
|
|
854
857
|
u > 0 && (i.price = String(u));
|
|
855
858
|
const f = c > 0 ? l : 0;
|
|
856
859
|
f > 0 && (i.originalPrice = String(f));
|
|
857
|
-
const p =
|
|
860
|
+
const p = B(r.brand);
|
|
858
861
|
p && (i.brand = p);
|
|
859
|
-
const m =
|
|
862
|
+
const m = q(r.rating);
|
|
860
863
|
m > 0 && (i.rating = m);
|
|
861
|
-
const g =
|
|
864
|
+
const g = q(r.review_count) || q(r.reviewCount);
|
|
862
865
|
g > 0 && (i.reviewCount = g);
|
|
863
|
-
const _ =
|
|
866
|
+
const _ = B(r.cart_code, r.cartCode);
|
|
864
867
|
_ && (i.cartCode = _), typeof r.in_stock == "boolean" && (i.inStock = r.in_stock), typeof r.inStock == "boolean" && (i.inStock = r.inStock);
|
|
865
|
-
const
|
|
866
|
-
return Array.isArray(
|
|
868
|
+
const C = r.category_names;
|
|
869
|
+
return Array.isArray(C) && (i.categoryNames = C.map(String)), i;
|
|
867
870
|
}
|
|
868
871
|
function ht(t) {
|
|
869
872
|
const e = Zt(t);
|
|
@@ -884,14 +887,14 @@ function ht(t) {
|
|
|
884
887
|
for (const s of Object.keys(a)) a[s] === void 0 && delete a[s];
|
|
885
888
|
return a;
|
|
886
889
|
}
|
|
887
|
-
function
|
|
890
|
+
function Dn(t) {
|
|
888
891
|
return Array.isArray(t) ? t.map(ht).filter((e) => !!e) : [];
|
|
889
892
|
}
|
|
890
|
-
function
|
|
893
|
+
function B(...t) {
|
|
891
894
|
for (const e of t) if (typeof e == "string" && e.trim()) return e.trim();
|
|
892
895
|
return "";
|
|
893
896
|
}
|
|
894
|
-
function
|
|
897
|
+
function q(t) {
|
|
895
898
|
const e = Number(t);
|
|
896
899
|
return Number.isFinite(e) ? e : 0;
|
|
897
900
|
}
|
|
@@ -901,14 +904,14 @@ function Lt(t) {
|
|
|
901
904
|
function Ht(t, e, r = {}) {
|
|
902
905
|
return `${t}:${r.version || "v2"}:${Gt(e)}`;
|
|
903
906
|
}
|
|
904
|
-
function
|
|
907
|
+
function Vn(t, e = {}) {
|
|
905
908
|
return Qt(t).map((r) => Yt(typeof r == "string" ? r : r.sku, e.locale)).filter(Boolean).filter((r, n, o) => o.indexOf(r) === n).sort((r, n) => wt(r, n, e.locale)).slice(0, e.limit || 16).join(",");
|
|
906
909
|
}
|
|
907
|
-
function
|
|
910
|
+
function Kn(t, e = {}) {
|
|
908
911
|
return Gt(Qt(t).map((r) => ur(r, e)).filter((r) => !!r).sort((r, n) => wt(String(r.sku || r.name || ""), String(n.sku || n.name || ""), e.locale)).slice(0, e.limit || 16));
|
|
909
912
|
}
|
|
910
|
-
function
|
|
911
|
-
return
|
|
913
|
+
function Jn(t, e) {
|
|
914
|
+
return E(t, e);
|
|
912
915
|
}
|
|
913
916
|
function Gt(t) {
|
|
914
917
|
let e = 2166136261;
|
|
@@ -920,49 +923,49 @@ function Gt(t) {
|
|
|
920
923
|
function ur(t, e) {
|
|
921
924
|
if (!t || typeof t != "object" || Array.isArray(t)) return null;
|
|
922
925
|
const r = t, n = e.mapProduct?.(r);
|
|
923
|
-
if (n) return
|
|
926
|
+
if (n) return U(n);
|
|
924
927
|
const o = ht(r);
|
|
925
|
-
return o && typeof o == "object" && !Array.isArray(o) ?
|
|
928
|
+
return o && typeof o == "object" && !Array.isArray(o) ? U(fr(o, e)) : null;
|
|
926
929
|
}
|
|
927
930
|
function Qt(t) {
|
|
928
931
|
return Array.isArray(t) ? t.filter((e) => typeof e == "string" || !!(e && typeof e == "object" && !Array.isArray(e))) : [];
|
|
929
932
|
}
|
|
930
933
|
function lr(t) {
|
|
931
|
-
return JSON.stringify(
|
|
934
|
+
return JSON.stringify(U(t));
|
|
932
935
|
}
|
|
933
|
-
function
|
|
934
|
-
return Array.isArray(t) ? t.map(
|
|
936
|
+
function U(t) {
|
|
937
|
+
return Array.isArray(t) ? t.map(U) : !t || typeof t != "object" ? t : Object.fromEntries(Object.entries(t).filter(([, e]) => e !== void 0).sort(([e], [r]) => e.localeCompare(r)).map(([e, r]) => [e, U(r)]));
|
|
935
938
|
}
|
|
936
939
|
function fr(t, e) {
|
|
937
940
|
return {
|
|
938
941
|
sku: Yt(t.sku, e.locale),
|
|
939
|
-
name:
|
|
940
|
-
url:
|
|
942
|
+
name: E(t.name, e.locale),
|
|
943
|
+
url: E(t.url, e.locale),
|
|
941
944
|
price: t.price,
|
|
942
|
-
currency:
|
|
943
|
-
category:
|
|
945
|
+
currency: E(t.currency, e.locale),
|
|
946
|
+
category: E(t.category, e.locale),
|
|
944
947
|
category_names: dr(t.category_names, e.locale, 16),
|
|
945
|
-
image:
|
|
948
|
+
image: E(t.image, e.locale),
|
|
946
949
|
in_stock: t.in_stock,
|
|
947
950
|
rating: t.rating,
|
|
948
951
|
review_count: t.review_count
|
|
949
952
|
};
|
|
950
953
|
}
|
|
951
954
|
function Yt(t, e) {
|
|
952
|
-
return
|
|
955
|
+
return E(t, e).toUpperCase();
|
|
953
956
|
}
|
|
954
|
-
function
|
|
957
|
+
function E(t, e) {
|
|
955
958
|
return typeof t == "string" ? t.trim().replace(/\s+/gu, " ").toLocaleLowerCase(e || void 0) : "";
|
|
956
959
|
}
|
|
957
960
|
function wt(t, e, r) {
|
|
958
961
|
return t.localeCompare(e, r, { numeric: !0 });
|
|
959
962
|
}
|
|
960
963
|
function dr(t, e, r) {
|
|
961
|
-
return Array.isArray(t) ? t.map((n) =>
|
|
964
|
+
return Array.isArray(t) ? t.map((n) => E(n, e)).filter(Boolean).sort((n, o) => wt(n, o, e)).slice(0, r) : void 0;
|
|
962
965
|
}
|
|
963
|
-
async function
|
|
964
|
-
const c = performance.now(), l = await r.load(t), u = l.thread.id, f =
|
|
965
|
-
|
|
966
|
+
async function Zn({ request: t, accountModule: e, contextStore: r, beClient: n, toolBridge: o, emit: i, rpc: a, signal: s }) {
|
|
967
|
+
const c = performance.now(), l = await r.load(t), u = l.thread.id, f = Rr(t);
|
|
968
|
+
jr(l, f) && r.appendUserMessage(u, f);
|
|
966
969
|
const p = cr(e.flows, t);
|
|
967
970
|
if (!p)
|
|
968
971
|
return i(sr("unknown_action", `No agent flow for request type ${t?.type || "inputText"}`)), i(Jt()), {
|
|
@@ -991,12 +994,12 @@ async function Jn({ request: t, accountModule: e, contextStore: r, beClient: n,
|
|
|
991
994
|
...s ? { signal: s } : {},
|
|
992
995
|
...e.trace ? { trace: e.trace } : {}
|
|
993
996
|
};
|
|
994
|
-
await j(g,
|
|
997
|
+
await j(g, F("turn:start", m));
|
|
995
998
|
try {
|
|
996
|
-
await
|
|
999
|
+
await $(p, m, g), m.committed || await bt(m, g);
|
|
997
1000
|
} catch (_) {
|
|
998
1001
|
throw await j(g, {
|
|
999
|
-
...
|
|
1002
|
+
...F("turn:error", m),
|
|
1000
1003
|
latencyMs: v(c),
|
|
1001
1004
|
errorCode: At(_)
|
|
1002
1005
|
}), _;
|
|
@@ -1010,14 +1013,14 @@ async function Jn({ request: t, accountModule: e, contextStore: r, beClient: n,
|
|
|
1010
1013
|
totalLatencyMs: v(c),
|
|
1011
1014
|
productSkusEmitted: [...m.productSkusEmitted]
|
|
1012
1015
|
}), await j(g, {
|
|
1013
|
-
...
|
|
1016
|
+
...F("turn:end", m),
|
|
1014
1017
|
latencyMs: v(c)
|
|
1015
1018
|
}), {
|
|
1016
1019
|
steps: m.steps,
|
|
1017
1020
|
productSkusEmitted: [...m.productSkusEmitted]
|
|
1018
1021
|
};
|
|
1019
1022
|
}
|
|
1020
|
-
async function
|
|
1023
|
+
async function $(t, e, r) {
|
|
1021
1024
|
for (const n of t) {
|
|
1022
1025
|
if (r.signal?.aborted || e.committed) return;
|
|
1023
1026
|
e.steps += 1;
|
|
@@ -1039,7 +1042,7 @@ async function F(t, e, r) {
|
|
|
1039
1042
|
}
|
|
1040
1043
|
}
|
|
1041
1044
|
async function pr(t, e, r) {
|
|
1042
|
-
const n =
|
|
1045
|
+
const n = R(e);
|
|
1043
1046
|
if (t.kind === "be_op") {
|
|
1044
1047
|
await mr(t, e, r, n);
|
|
1045
1048
|
return;
|
|
@@ -1064,21 +1067,25 @@ async function pr(t, e, r) {
|
|
|
1064
1067
|
await Ar(t, e, r, n);
|
|
1065
1068
|
return;
|
|
1066
1069
|
}
|
|
1070
|
+
if (t.kind === "agent_loop") {
|
|
1071
|
+
await _r(t, e, r, n);
|
|
1072
|
+
return;
|
|
1073
|
+
}
|
|
1067
1074
|
if (t.kind === "parallel") {
|
|
1068
|
-
await
|
|
1075
|
+
await xr(t, e, r);
|
|
1069
1076
|
return;
|
|
1070
1077
|
}
|
|
1071
1078
|
if (t.kind === "refusal") {
|
|
1072
|
-
await
|
|
1079
|
+
await Sr(t, e, r, n);
|
|
1073
1080
|
return;
|
|
1074
1081
|
}
|
|
1075
|
-
t.kind === "commit" && await
|
|
1082
|
+
t.kind === "commit" && await vr(t, e, r);
|
|
1076
1083
|
}
|
|
1077
1084
|
async function mr(t, e, r, n) {
|
|
1078
1085
|
const o = performance.now();
|
|
1079
1086
|
let i;
|
|
1080
1087
|
try {
|
|
1081
|
-
const s = await b(t.input, n), c = yr(t, e, s, await b(t.cache, n)), l = await b(t.cacheTtlS, n) ?? c.cacheTtlS, u = await b(t.cacheKey, n) ?? c.cacheKey, f = await b(t.browserCache, n), p =
|
|
1088
|
+
const s = await b(t.input, n), c = yr(t, e, s, await b(t.cache, n)), l = await b(t.cacheTtlS, n) ?? c.cacheTtlS, u = await b(t.cacheKey, n) ?? c.cacheKey, f = await b(t.browserCache, n), p = z(await b(t.timeoutMs, n));
|
|
1082
1089
|
await kt(t, e, r, n);
|
|
1083
1090
|
const m = p ? new AbortController() : null, g = Wt(r.signal, m?.signal);
|
|
1084
1091
|
i = await Y(r.beClient.invoke({
|
|
@@ -1104,12 +1111,12 @@ async function mr(t, e, r, n) {
|
|
|
1104
1111
|
errorCode: l
|
|
1105
1112
|
};
|
|
1106
1113
|
if (await r.rpc("beacon.send", u), t.onError) {
|
|
1107
|
-
t.errorOut && (e.bag[t.errorOut] = s), await
|
|
1114
|
+
t.errorOut && (e.bag[t.errorOut] = s), await $(t.onError, e, r);
|
|
1108
1115
|
return;
|
|
1109
1116
|
}
|
|
1110
1117
|
throw s;
|
|
1111
1118
|
}
|
|
1112
|
-
t.out && (e.bag[t.out] = i), await
|
|
1119
|
+
t.out && (e.bag[t.out] = i), await Q(t, i, e, r.contextStore);
|
|
1113
1120
|
const a = {
|
|
1114
1121
|
type: "agentOp",
|
|
1115
1122
|
threadId: e.threadId,
|
|
@@ -1123,7 +1130,7 @@ async function mr(t, e, r, n) {
|
|
|
1123
1130
|
}
|
|
1124
1131
|
function yr(t, e, r, n) {
|
|
1125
1132
|
if (!n || n.strategy !== "input-hash") return {};
|
|
1126
|
-
const o =
|
|
1133
|
+
const o = z(n.ttlS);
|
|
1127
1134
|
if (!o) return {};
|
|
1128
1135
|
const i = e.context.meta.locale, a = n.promptVersion || gr(r) || "current";
|
|
1129
1136
|
return {
|
|
@@ -1145,14 +1152,14 @@ async function hr(t, e, r, n) {
|
|
|
1145
1152
|
const o = performance.now();
|
|
1146
1153
|
try {
|
|
1147
1154
|
await kt(t, e, r, n);
|
|
1148
|
-
const i =
|
|
1155
|
+
const i = z(await b(t.timeoutMs, n)), a = await Y(r.toolBridge.invoke(t.name, await b(t.input, n)), i, () => new T("tool_timeout", "The assistant tool took too long to respond.", {
|
|
1149
1156
|
source: "tool",
|
|
1150
1157
|
sourceCode: "timeout"
|
|
1151
1158
|
}));
|
|
1152
|
-
t.out && (e.bag[t.out] = a), await
|
|
1159
|
+
t.out && (e.bag[t.out] = a), await Q(t, a, e, r.contextStore), await r.rpc("beacon.send", {
|
|
1153
1160
|
type: "agentTool",
|
|
1154
1161
|
threadId: e.threadId,
|
|
1155
|
-
sessionId:
|
|
1162
|
+
sessionId: Z(e),
|
|
1156
1163
|
accountId: e.context.meta.accountId,
|
|
1157
1164
|
tool: t.name,
|
|
1158
1165
|
status: "ok",
|
|
@@ -1163,14 +1170,14 @@ async function hr(t, e, r, n) {
|
|
|
1163
1170
|
if (await r.rpc("beacon.send", {
|
|
1164
1171
|
type: "agentTool",
|
|
1165
1172
|
threadId: e.threadId,
|
|
1166
|
-
sessionId:
|
|
1173
|
+
sessionId: Z(e),
|
|
1167
1174
|
accountId: e.context.meta.accountId,
|
|
1168
1175
|
tool: t.name,
|
|
1169
1176
|
status: "error",
|
|
1170
1177
|
latencyMs: v(o),
|
|
1171
1178
|
errorCode: String(a?.code || a?.name || "unknown")
|
|
1172
1179
|
}), t.onError) {
|
|
1173
|
-
t.errorOut && (e.bag[t.errorOut] = i), await
|
|
1180
|
+
t.errorOut && (e.bag[t.errorOut] = i), await $(t.onError, e, r);
|
|
1174
1181
|
return;
|
|
1175
1182
|
}
|
|
1176
1183
|
throw i;
|
|
@@ -1180,33 +1187,43 @@ async function wr(t, e, r, n) {
|
|
|
1180
1187
|
const o = r.adapters?.[t.name];
|
|
1181
1188
|
if (typeof o != "function") throw new Error(`Unknown flow adapter: ${t.name}`);
|
|
1182
1189
|
await kt(t, e, r, n);
|
|
1183
|
-
const i =
|
|
1190
|
+
const i = z(await b(t.timeoutMs, n)), a = await Y(o(await b(t.input, n), n), i, () => new T("adapter_timeout", "The assistant adapter took too long to respond.", {
|
|
1184
1191
|
source: "adapter",
|
|
1185
1192
|
sourceCode: "timeout"
|
|
1186
1193
|
}));
|
|
1187
|
-
t.out && (e.bag[t.out] = a), await
|
|
1194
|
+
t.out && (e.bag[t.out] = a), await Q(t, a, e, r.contextStore);
|
|
1188
1195
|
}
|
|
1189
1196
|
async function br(t, e, r) {
|
|
1190
|
-
const n = await t.build(
|
|
1191
|
-
|
|
1197
|
+
const n = await t.build(R(e));
|
|
1198
|
+
$r(n, e.productSkusEmitted), r.emit(n);
|
|
1192
1199
|
}
|
|
1193
1200
|
async function kr(t, e, r) {
|
|
1194
|
-
await
|
|
1201
|
+
await Q(t, void 0, e, r.contextStore);
|
|
1195
1202
|
}
|
|
1196
1203
|
async function Ar(t, e, r, n) {
|
|
1197
1204
|
const o = String(await b(t.on, n) || "default");
|
|
1198
|
-
await
|
|
1205
|
+
await $(t.cases[o] || t.cases.default || [], e, r);
|
|
1206
|
+
}
|
|
1207
|
+
async function _r(t, e, r, n) {
|
|
1208
|
+
if (!await t.shouldContinue(e.bag, n)) return;
|
|
1209
|
+
const o = Math.max(0, Math.floor(Number(t.maxIterations) || 0));
|
|
1210
|
+
let i = 0;
|
|
1211
|
+
for (; !r.signal?.aborted && !e.committed; ) {
|
|
1212
|
+
if (await $(t.body, e, r), r.signal?.aborted || e.committed || !await t.shouldContinue(e.bag, R(e)) || i >= o) return;
|
|
1213
|
+
const a = await t.onIterate?.(e.bag, R(e));
|
|
1214
|
+
a && typeof a == "object" && Object.assign(e.bag, a), i += 1;
|
|
1215
|
+
}
|
|
1199
1216
|
}
|
|
1200
|
-
async function
|
|
1201
|
-
const n =
|
|
1217
|
+
async function xr(t, e, r) {
|
|
1218
|
+
const n = z(await b(t.timeoutMs, R(e))), o = n ? new AbortController() : null, i = Wt(r.signal, o?.signal), a = t.steps.map((l) => {
|
|
1202
1219
|
const u = {
|
|
1203
1220
|
...e,
|
|
1204
|
-
context:
|
|
1221
|
+
context: Cr(e.context),
|
|
1205
1222
|
bag: ct(e.bag),
|
|
1206
1223
|
productSkusEmitted: new Set(e.productSkusEmitted),
|
|
1207
1224
|
committed: !1
|
|
1208
1225
|
}, f = [];
|
|
1209
|
-
return
|
|
1226
|
+
return $(l, u, {
|
|
1210
1227
|
...r,
|
|
1211
1228
|
emit: (p) => {
|
|
1212
1229
|
!i?.aborted && p.type !== "done" && f.push(p);
|
|
@@ -1238,21 +1255,21 @@ async function _r(t, e, r) {
|
|
|
1238
1255
|
}
|
|
1239
1256
|
}
|
|
1240
1257
|
}
|
|
1241
|
-
async function
|
|
1258
|
+
async function Sr(t, e, r, n) {
|
|
1242
1259
|
r.emit(ar(await b(t.message, n), !0)), await bt(e, r);
|
|
1243
1260
|
}
|
|
1244
|
-
async function
|
|
1261
|
+
async function vr(t, e, r) {
|
|
1245
1262
|
await bt(e, r);
|
|
1246
1263
|
}
|
|
1247
1264
|
async function bt(t, { contextStore: e, emit: r }) {
|
|
1248
1265
|
t.committed || (t.context = await e.commit(t.threadId) || t.context, t.committed = !0, r(Jt()));
|
|
1249
1266
|
}
|
|
1250
|
-
async function
|
|
1267
|
+
async function Q(t, e, r, n) {
|
|
1251
1268
|
if (typeof t.patch != "function") return;
|
|
1252
|
-
const o = await t.patch(r.context, e,
|
|
1269
|
+
const o = await t.patch(r.context, e, R(r));
|
|
1253
1270
|
o && (r.context = n.patch(r.threadId, o) || r.context);
|
|
1254
1271
|
}
|
|
1255
|
-
function
|
|
1272
|
+
function R(t) {
|
|
1256
1273
|
return {
|
|
1257
1274
|
request: t.request,
|
|
1258
1275
|
context: t.context,
|
|
@@ -1262,10 +1279,10 @@ function Q(t) {
|
|
|
1262
1279
|
similarityMapper: t.similarityMapper
|
|
1263
1280
|
};
|
|
1264
1281
|
}
|
|
1265
|
-
function
|
|
1282
|
+
function Z(t) {
|
|
1266
1283
|
return t.request?.session_id || t.request?.sessionId || t.threadId;
|
|
1267
1284
|
}
|
|
1268
|
-
function
|
|
1285
|
+
function jr(t, e) {
|
|
1269
1286
|
if (!e) return !1;
|
|
1270
1287
|
const r = t.messages[t.messages.length - 1];
|
|
1271
1288
|
return r?.role !== "user" || r.content !== e;
|
|
@@ -1275,7 +1292,7 @@ function Nt(t, e) {
|
|
|
1275
1292
|
for (const n of e) Object.prototype.hasOwnProperty.call(t, n) && (r[n] = t[n]);
|
|
1276
1293
|
return r;
|
|
1277
1294
|
}
|
|
1278
|
-
function
|
|
1295
|
+
function Cr(t) {
|
|
1279
1296
|
return {
|
|
1280
1297
|
...t,
|
|
1281
1298
|
panel: ct(t.panel || {}),
|
|
@@ -1293,7 +1310,7 @@ function Er(t) {
|
|
|
1293
1310
|
return t.context;
|
|
1294
1311
|
},
|
|
1295
1312
|
patch(e, r) {
|
|
1296
|
-
return t.context =
|
|
1313
|
+
return t.context = Ir(t.context, r, t.messageLimit), t.context;
|
|
1297
1314
|
},
|
|
1298
1315
|
appendUserMessage() {
|
|
1299
1316
|
return t.context;
|
|
@@ -1303,7 +1320,7 @@ function Er(t) {
|
|
|
1303
1320
|
}
|
|
1304
1321
|
};
|
|
1305
1322
|
}
|
|
1306
|
-
function
|
|
1323
|
+
function Ir(t, e, r) {
|
|
1307
1324
|
if (!e || typeof e != "object") return t;
|
|
1308
1325
|
const n = qt(t.panel, e.panel), o = qt(t.thread?.extensions || {}, e.thread?.extensions);
|
|
1309
1326
|
return {
|
|
@@ -1319,7 +1336,7 @@ function Cr(t, e, r) {
|
|
|
1319
1336
|
...t.meta || {},
|
|
1320
1337
|
...e.meta || {}
|
|
1321
1338
|
},
|
|
1322
|
-
messages: Array.isArray(e.messages) ?
|
|
1339
|
+
messages: Array.isArray(e.messages) ? G(e.messages, r) : t.messages
|
|
1323
1340
|
};
|
|
1324
1341
|
}
|
|
1325
1342
|
function qt(t, e) {
|
|
@@ -1335,8 +1352,8 @@ function ct(t) {
|
|
|
1335
1352
|
if (typeof r != "string") return Reflect.get(e, r, n);
|
|
1336
1353
|
if (Object.prototype.hasOwnProperty.call(e, r)) return e[r];
|
|
1337
1354
|
const o = t[r];
|
|
1338
|
-
if (
|
|
1339
|
-
const i =
|
|
1355
|
+
if (Tr(o)) {
|
|
1356
|
+
const i = Pr(o);
|
|
1340
1357
|
return e[r] = i, i;
|
|
1341
1358
|
}
|
|
1342
1359
|
return o;
|
|
@@ -1352,10 +1369,10 @@ function ct(t) {
|
|
|
1352
1369
|
}
|
|
1353
1370
|
});
|
|
1354
1371
|
}
|
|
1355
|
-
function
|
|
1372
|
+
function Tr(t) {
|
|
1356
1373
|
return !!(t && typeof t == "object");
|
|
1357
1374
|
}
|
|
1358
|
-
function
|
|
1375
|
+
function Pr(t) {
|
|
1359
1376
|
if (typeof structuredClone == "function") try {
|
|
1360
1377
|
return structuredClone(t);
|
|
1361
1378
|
} catch {
|
|
@@ -1369,7 +1386,7 @@ function Tr(t) {
|
|
|
1369
1386
|
async function b(t, e) {
|
|
1370
1387
|
return typeof t == "function" ? await t(e) : t;
|
|
1371
1388
|
}
|
|
1372
|
-
function
|
|
1389
|
+
function z(t) {
|
|
1373
1390
|
if (t === void 0) return;
|
|
1374
1391
|
const e = Math.floor(Number(t));
|
|
1375
1392
|
return Number.isFinite(e) && e > 0 ? e : void 0;
|
|
@@ -1398,7 +1415,7 @@ async function kt(t, e, r, n) {
|
|
|
1398
1415
|
if (!t.confirm) return;
|
|
1399
1416
|
const o = await b(t.confirm, n);
|
|
1400
1417
|
if (!o) return;
|
|
1401
|
-
const i =
|
|
1418
|
+
const i = Or(o, t, e);
|
|
1402
1419
|
await j(r, it("confirmation:start", e, t));
|
|
1403
1420
|
try {
|
|
1404
1421
|
const a = await r.rpc("confirmation.request", i), s = typeof a == "boolean" ? a : a?.confirmed === !0;
|
|
@@ -1415,17 +1432,17 @@ async function kt(t, e, r, n) {
|
|
|
1415
1432
|
}), a;
|
|
1416
1433
|
}
|
|
1417
1434
|
}
|
|
1418
|
-
function
|
|
1435
|
+
function Or(t, e, r) {
|
|
1419
1436
|
return {
|
|
1420
|
-
...
|
|
1437
|
+
...Mr(t),
|
|
1421
1438
|
accountId: r.context.meta.accountId,
|
|
1422
1439
|
threadId: r.threadId,
|
|
1423
|
-
sessionId:
|
|
1440
|
+
sessionId: Z(r),
|
|
1424
1441
|
stepKind: e.kind,
|
|
1425
1442
|
...e.kind === "be_op" ? { stepName: e.op } : { stepName: e.name }
|
|
1426
1443
|
};
|
|
1427
1444
|
}
|
|
1428
|
-
function
|
|
1445
|
+
function Mr(t) {
|
|
1429
1446
|
return typeof t == "string" ? { message: t } : t === !0 ? {} : t && typeof t == "object" ? {
|
|
1430
1447
|
...typeof t.title == "string" ? { title: t.title } : {},
|
|
1431
1448
|
...typeof t.message == "string" ? { message: t.message } : {},
|
|
@@ -1439,18 +1456,18 @@ async function j(t, e) {
|
|
|
1439
1456
|
} catch {
|
|
1440
1457
|
}
|
|
1441
1458
|
}
|
|
1442
|
-
function
|
|
1459
|
+
function F(t, e) {
|
|
1443
1460
|
return {
|
|
1444
1461
|
type: t,
|
|
1445
1462
|
accountId: e.context.meta.accountId,
|
|
1446
1463
|
threadId: e.threadId,
|
|
1447
|
-
sessionId:
|
|
1464
|
+
sessionId: Z(e)
|
|
1448
1465
|
};
|
|
1449
1466
|
}
|
|
1450
1467
|
function ot(t, e, r, n) {
|
|
1451
1468
|
const o = Xt(r);
|
|
1452
1469
|
return {
|
|
1453
|
-
...
|
|
1470
|
+
...F(t, e),
|
|
1454
1471
|
stepIndex: n,
|
|
1455
1472
|
stepKind: r.kind,
|
|
1456
1473
|
...o ? { stepName: o } : {}
|
|
@@ -1459,7 +1476,7 @@ function ot(t, e, r, n) {
|
|
|
1459
1476
|
function it(t, e, r) {
|
|
1460
1477
|
const n = Xt(r);
|
|
1461
1478
|
return {
|
|
1462
|
-
...
|
|
1479
|
+
...F(t, e),
|
|
1463
1480
|
stepKind: r.kind,
|
|
1464
1481
|
...n ? { stepName: n } : {}
|
|
1465
1482
|
};
|
|
@@ -1480,7 +1497,7 @@ function Br(t) {
|
|
|
1480
1497
|
const e = Math.floor(Number(t));
|
|
1481
1498
|
return Number.isFinite(e) && e > 0 ? e : void 0;
|
|
1482
1499
|
}
|
|
1483
|
-
function
|
|
1500
|
+
function Rr(t) {
|
|
1484
1501
|
const e = t?.payload;
|
|
1485
1502
|
if (typeof e == "string") return e;
|
|
1486
1503
|
if (e && typeof e == "object" && "text" in e) {
|
|
@@ -1489,7 +1506,7 @@ function Mr(t) {
|
|
|
1489
1506
|
}
|
|
1490
1507
|
return typeof t?.action?.payload == "string" ? t.action.payload : typeof t?.action?.title == "string" ? t.action.title : "";
|
|
1491
1508
|
}
|
|
1492
|
-
function
|
|
1509
|
+
function $r(t, e) {
|
|
1493
1510
|
const r = t, n = r.spec, o = Array.isArray(n?.items) ? n.items : void 0, i = Array.isArray(r.items) ? r.items : void 0, a = o || i;
|
|
1494
1511
|
if (Array.isArray(a)) {
|
|
1495
1512
|
for (const s of a) if (s && typeof s == "object") {
|
|
@@ -1498,7 +1515,7 @@ function Rr(t, e) {
|
|
|
1498
1515
|
}
|
|
1499
1516
|
}
|
|
1500
1517
|
}
|
|
1501
|
-
function
|
|
1518
|
+
function Hn(t) {
|
|
1502
1519
|
return { invoke(e, r) {
|
|
1503
1520
|
return t("tool.invoke", {
|
|
1504
1521
|
name: e,
|
|
@@ -1506,15 +1523,15 @@ function Zn(t) {
|
|
|
1506
1523
|
});
|
|
1507
1524
|
} };
|
|
1508
1525
|
}
|
|
1509
|
-
function
|
|
1526
|
+
function Gn(t, e = {}) {
|
|
1510
1527
|
if (!Array.isArray(t)) return [];
|
|
1511
1528
|
const r = e.maxItems ?? 8, n = e.maxFeatures ?? 8;
|
|
1512
|
-
return t.map((o) =>
|
|
1529
|
+
return t.map((o) => Lr(o, e.defaultBrand, n)).filter((o) => !!o).slice(0, r);
|
|
1513
1530
|
}
|
|
1514
|
-
function
|
|
1531
|
+
function Lr(t, e, r) {
|
|
1515
1532
|
if (!t || typeof t != "object" || Array.isArray(t)) return null;
|
|
1516
1533
|
const n = t, o = ht(n);
|
|
1517
|
-
return o ?
|
|
1534
|
+
return o ? Fr({
|
|
1518
1535
|
sku: o.sku,
|
|
1519
1536
|
name: o.name,
|
|
1520
1537
|
url: o.url,
|
|
@@ -1524,19 +1541,19 @@ function $r(t, e, r) {
|
|
|
1524
1541
|
category: o.category,
|
|
1525
1542
|
category_names: o.category_names,
|
|
1526
1543
|
brand: n.brand || e,
|
|
1527
|
-
features:
|
|
1528
|
-
specs:
|
|
1544
|
+
features: Nr(n.features, r),
|
|
1545
|
+
specs: qr(n.specs, r),
|
|
1529
1546
|
in_stock: o.in_stock
|
|
1530
1547
|
}) : null;
|
|
1531
1548
|
}
|
|
1532
|
-
function
|
|
1549
|
+
function Nr(t, e) {
|
|
1533
1550
|
return Array.isArray(t) ? t.filter(Boolean).slice(0, e) : void 0;
|
|
1534
1551
|
}
|
|
1535
|
-
function
|
|
1552
|
+
function qr(t, e) {
|
|
1536
1553
|
if (!(!t || typeof t != "object" || Array.isArray(t)))
|
|
1537
1554
|
return Object.fromEntries(Object.entries(t).filter(([, r]) => r != null).slice(0, e));
|
|
1538
1555
|
}
|
|
1539
|
-
function
|
|
1556
|
+
function Fr(t) {
|
|
1540
1557
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => e != null));
|
|
1541
1558
|
}
|
|
1542
1559
|
function te(t) {
|
|
@@ -1544,17 +1561,17 @@ function te(t) {
|
|
|
1544
1561
|
const e = t, r = Array.isArray(e.rows) ? e.rows : [];
|
|
1545
1562
|
return {
|
|
1546
1563
|
...e,
|
|
1547
|
-
rows: r.map(
|
|
1564
|
+
rows: r.map(zr).filter(Boolean)
|
|
1548
1565
|
};
|
|
1549
1566
|
}
|
|
1550
|
-
function
|
|
1567
|
+
function Ur(t, e) {
|
|
1551
1568
|
const r = Array.isArray(t) ? t.filter((s) => !!(s && typeof s == "object" && !Array.isArray(s))) : [], n = te(e), o = Array.isArray(n.columns) ? n.columns.map(String) : [];
|
|
1552
1569
|
if (!o.length) return r;
|
|
1553
1570
|
const i = new Map(r.map((s) => [String(s.sku || s.id || ""), s])), a = o.map((s) => i.get(s)).filter((s) => !!s);
|
|
1554
1571
|
return a.length ? a : r;
|
|
1555
1572
|
}
|
|
1556
|
-
function
|
|
1557
|
-
const r = te(t?.table), n =
|
|
1573
|
+
function Qn(t, e) {
|
|
1574
|
+
const r = te(t?.table), n = Ur(e, r);
|
|
1558
1575
|
return {
|
|
1559
1576
|
...t || {},
|
|
1560
1577
|
table: r,
|
|
@@ -1562,10 +1579,10 @@ function Gn(t, e) {
|
|
|
1562
1579
|
multiple_product_details: n
|
|
1563
1580
|
};
|
|
1564
1581
|
}
|
|
1565
|
-
function
|
|
1582
|
+
function zr(t) {
|
|
1566
1583
|
return !t || typeof t != "object" || Array.isArray(t) ? null : Object.fromEntries(Object.entries(t).filter(([, e]) => e !== void 0));
|
|
1567
1584
|
}
|
|
1568
|
-
function
|
|
1585
|
+
function Yn(t = [], e = {}) {
|
|
1569
1586
|
const r = {}, n = [];
|
|
1570
1587
|
return (Array.isArray(t) ? t.map((o) => gt(o, e)).filter((o) => !!o) : []).forEach((o, i) => {
|
|
1571
1588
|
const a = `product-${i.toString()}`;
|
|
@@ -1599,7 +1616,7 @@ function Qn(t = [], e = {}) {
|
|
|
1599
1616
|
}
|
|
1600
1617
|
};
|
|
1601
1618
|
}
|
|
1602
|
-
function
|
|
1619
|
+
function Wn(t, e = {}) {
|
|
1603
1620
|
return {
|
|
1604
1621
|
widget: "chat",
|
|
1605
1622
|
panelHint: "panel",
|
|
@@ -1612,8 +1629,8 @@ function Yn(t, e = {}) {
|
|
|
1612
1629
|
}
|
|
1613
1630
|
};
|
|
1614
1631
|
}
|
|
1615
|
-
function
|
|
1616
|
-
const r = (t.multiple_product_details || t.products || []).map((o) => gt(o, e)).filter((o) => !!o), n = t.table ||
|
|
1632
|
+
function Xn(t = {}, e = {}) {
|
|
1633
|
+
const r = (t.multiple_product_details || t.products || []).map((o) => gt(o, e)).filter((o) => !!o), n = t.table || Dr(t.comparison_table);
|
|
1617
1634
|
return {
|
|
1618
1635
|
widget: "chat",
|
|
1619
1636
|
panelHint: "panel",
|
|
@@ -1644,13 +1661,13 @@ function Wn(t = {}, e = {}) {
|
|
|
1644
1661
|
}
|
|
1645
1662
|
};
|
|
1646
1663
|
}
|
|
1647
|
-
function
|
|
1664
|
+
function Dr(t) {
|
|
1648
1665
|
return Array.isArray(t) ? Object.fromEntries(t.map((e) => {
|
|
1649
1666
|
const r = typeof e?.label == "string" ? e.label.trim() : "";
|
|
1650
1667
|
return r ? [r, e.values] : null;
|
|
1651
1668
|
}).filter((e) => !!e)) : {};
|
|
1652
1669
|
}
|
|
1653
|
-
function
|
|
1670
|
+
function to(t = []) {
|
|
1654
1671
|
return {
|
|
1655
1672
|
widget: "chat",
|
|
1656
1673
|
panelHint: "inline",
|
|
@@ -1673,10 +1690,10 @@ function Xn(t = []) {
|
|
|
1673
1690
|
}
|
|
1674
1691
|
};
|
|
1675
1692
|
}
|
|
1676
|
-
function
|
|
1693
|
+
function eo(t) {
|
|
1677
1694
|
return Object.freeze([...t]);
|
|
1678
1695
|
}
|
|
1679
|
-
function
|
|
1696
|
+
function Vr(t) {
|
|
1680
1697
|
const e = t?.payload;
|
|
1681
1698
|
if (typeof e == "string") return e;
|
|
1682
1699
|
if (e && typeof e == "object" && "text" in e) {
|
|
@@ -1689,7 +1706,7 @@ function Dr(t) {
|
|
|
1689
1706
|
var ee = [
|
|
1690
1707
|
{
|
|
1691
1708
|
pattern: /\bhttps?:\/\/[^\s?#]+(?:\?[^\s#]*)?/giu,
|
|
1692
|
-
replacement:
|
|
1709
|
+
replacement: Jr
|
|
1693
1710
|
},
|
|
1694
1711
|
{
|
|
1695
1712
|
pattern: /\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}\b/giu,
|
|
@@ -1716,10 +1733,10 @@ function ne(t, e = re) {
|
|
|
1716
1733
|
}
|
|
1717
1734
|
return r;
|
|
1718
1735
|
}
|
|
1719
|
-
function
|
|
1720
|
-
return ne(
|
|
1736
|
+
function Kr(t, e = re) {
|
|
1737
|
+
return ne(Vr(t), e);
|
|
1721
1738
|
}
|
|
1722
|
-
function
|
|
1739
|
+
function Jr(t) {
|
|
1723
1740
|
try {
|
|
1724
1741
|
const e = new URL(t);
|
|
1725
1742
|
return `${e.origin}${e.pathname}${e.search ? "?[query]" : ""}`;
|
|
@@ -1727,48 +1744,48 @@ function Kr(t) {
|
|
|
1727
1744
|
return "[url]";
|
|
1728
1745
|
}
|
|
1729
1746
|
}
|
|
1730
|
-
var
|
|
1747
|
+
var Zr = [
|
|
1731
1748
|
"assistantName",
|
|
1732
1749
|
"homeDomain",
|
|
1733
1750
|
"categories",
|
|
1734
1751
|
"policyTopics"
|
|
1735
|
-
],
|
|
1736
|
-
function
|
|
1737
|
-
const o =
|
|
1752
|
+
], Hr = { intent: ["searchContract", "competitorBrands"] };
|
|
1753
|
+
function ro(t, e, r, n = {}) {
|
|
1754
|
+
const o = Gr(e, r, n);
|
|
1738
1755
|
return Object.keys(o).length ? {
|
|
1739
1756
|
...t,
|
|
1740
1757
|
account_config: o
|
|
1741
1758
|
} : t;
|
|
1742
1759
|
}
|
|
1743
|
-
function
|
|
1760
|
+
function Gr(t, e, r = {}) {
|
|
1744
1761
|
if (!t) return {};
|
|
1745
|
-
const n = {}, o = r.baseKeys ||
|
|
1762
|
+
const n = {}, o = r.baseKeys || Zr;
|
|
1746
1763
|
for (const s of o) Ft(n, t, s);
|
|
1747
1764
|
const i = t[e];
|
|
1748
|
-
i && typeof i == "object" && !Array.isArray(i) && Object.assign(n,
|
|
1749
|
-
const a = r.opAllowlist ||
|
|
1765
|
+
i && typeof i == "object" && !Array.isArray(i) && Object.assign(n, Qr(i));
|
|
1766
|
+
const a = r.opAllowlist || Hr;
|
|
1750
1767
|
for (const s of a[e] || []) Ft(n, t, s);
|
|
1751
1768
|
return n;
|
|
1752
1769
|
}
|
|
1753
1770
|
function Ft(t, e, r) {
|
|
1754
1771
|
e[r] !== void 0 && (t[r] = e[r]);
|
|
1755
1772
|
}
|
|
1756
|
-
function
|
|
1773
|
+
function Qr(t) {
|
|
1757
1774
|
return Object.fromEntries(Object.entries(t).filter(([, e]) => e !== void 0));
|
|
1758
1775
|
}
|
|
1759
|
-
var
|
|
1760
|
-
function
|
|
1776
|
+
var Yr = "input-hash";
|
|
1777
|
+
function Wr({ ttlS: t, promptVersion: e = "current" } = {}) {
|
|
1761
1778
|
if (!Number.isFinite(t) || t <= 0) throw new Error("inputHashCachePolicy requires a positive ttlS");
|
|
1762
1779
|
return {
|
|
1763
|
-
strategy:
|
|
1780
|
+
strategy: Yr,
|
|
1764
1781
|
ttlS: t,
|
|
1765
1782
|
promptVersion: e
|
|
1766
1783
|
};
|
|
1767
1784
|
}
|
|
1768
|
-
function
|
|
1785
|
+
function Xr({ accountId: t = "", op: e, ttlS: r, promptVersion: n = "current", input: o, keyParts: i, locale: a } = {}) {
|
|
1769
1786
|
if (!e) throw new Error("declarativeBeOpCache requires an op");
|
|
1770
1787
|
return {
|
|
1771
|
-
cache:
|
|
1788
|
+
cache: Wr({
|
|
1772
1789
|
ttlS: r,
|
|
1773
1790
|
promptVersion: n
|
|
1774
1791
|
}),
|
|
@@ -1778,14 +1795,14 @@ function Wr({ accountId: t = "", op: e, ttlS: r, promptVersion: n = "current", i
|
|
|
1778
1795
|
locale: at(a, s) || s.context?.meta?.locale || s.locale || "",
|
|
1779
1796
|
promptVersion: n,
|
|
1780
1797
|
payload: ut(at(o, s)),
|
|
1781
|
-
...
|
|
1798
|
+
...tn(at(i, s))
|
|
1782
1799
|
})
|
|
1783
1800
|
};
|
|
1784
1801
|
}
|
|
1785
|
-
function
|
|
1802
|
+
function no(t, e = {}) {
|
|
1786
1803
|
return !t || t.kind !== "be_op" ? t : {
|
|
1787
1804
|
...t,
|
|
1788
|
-
...
|
|
1805
|
+
...Xr({
|
|
1789
1806
|
op: t.op,
|
|
1790
1807
|
ttlS: t.cacheTtlS,
|
|
1791
1808
|
input: t.input,
|
|
@@ -1799,25 +1816,25 @@ function at(t, e) {
|
|
|
1799
1816
|
function ut(t) {
|
|
1800
1817
|
return Array.isArray(t) ? t.map(ut) : !t || typeof t != "object" ? t : Object.fromEntries(Object.entries(t).filter(([, e]) => e !== void 0).sort(([e], [r]) => e.localeCompare(r)).map(([e, r]) => [e, ut(r)]));
|
|
1801
1818
|
}
|
|
1802
|
-
function
|
|
1819
|
+
function tn(t) {
|
|
1803
1820
|
return !t || typeof t != "object" || Array.isArray(t) ? {} : Object.fromEntries(Object.entries(t).filter(([, e]) => e != null));
|
|
1804
1821
|
}
|
|
1805
|
-
var
|
|
1822
|
+
var oo = Object.freeze({
|
|
1806
1823
|
FALLBACK_RESULTS: "fallback_results",
|
|
1807
1824
|
FALLBACK_NO_RESULTS: "fallback_no_results",
|
|
1808
1825
|
FALLBACK_PARTIAL: "fallback_partial",
|
|
1809
1826
|
OP_UNAVAILABLE: "op_unavailable"
|
|
1810
1827
|
});
|
|
1811
|
-
function
|
|
1828
|
+
function io(t, e = {}) {
|
|
1812
1829
|
return {
|
|
1813
1830
|
status: t,
|
|
1814
1831
|
...e
|
|
1815
1832
|
};
|
|
1816
1833
|
}
|
|
1817
|
-
function
|
|
1834
|
+
function ao(t) {
|
|
1818
1835
|
return !!(t && typeof t == "object" && typeof t.status == "string");
|
|
1819
1836
|
}
|
|
1820
|
-
function
|
|
1837
|
+
function so(t) {
|
|
1821
1838
|
return function() {
|
|
1822
1839
|
return [{
|
|
1823
1840
|
kind: "tool",
|
|
@@ -1829,10 +1846,10 @@ function ao(t) {
|
|
|
1829
1846
|
}];
|
|
1830
1847
|
};
|
|
1831
1848
|
}
|
|
1832
|
-
function
|
|
1849
|
+
function co(t) {
|
|
1833
1850
|
return !t || typeof t != "object" || Array.isArray(t) ? {} : Object.fromEntries(Object.entries(t).filter(([, e]) => e != null && e !== "" && (!Array.isArray(e) || e.length > 0)));
|
|
1834
1851
|
}
|
|
1835
|
-
function
|
|
1852
|
+
function uo(t, { screenSummary: e } = {}) {
|
|
1836
1853
|
return { panel: {
|
|
1837
1854
|
...t?.panel || {},
|
|
1838
1855
|
screen_type: "homepage",
|
|
@@ -1851,13 +1868,13 @@ function co(t, { screenSummary: e } = {}) {
|
|
|
1851
1868
|
ui_hints: null
|
|
1852
1869
|
} };
|
|
1853
1870
|
}
|
|
1854
|
-
function
|
|
1871
|
+
function en({ patterns: t, messageFilter: e, messageNormalizer: r = (o) => o, messageLimit: n = 10 } = {}) {
|
|
1855
1872
|
const o = { patterns: [...ee, ...Array.isArray(t) ? t : []] };
|
|
1856
1873
|
function i(c) {
|
|
1857
1874
|
return ne(c, o);
|
|
1858
1875
|
}
|
|
1859
1876
|
function a(c) {
|
|
1860
|
-
return
|
|
1877
|
+
return Kr(c, o);
|
|
1861
1878
|
}
|
|
1862
1879
|
function s(c = []) {
|
|
1863
1880
|
const l = (Array.isArray(c) ? c : []).filter((u) => typeof e == "function" ? e(u) : u && typeof u == "object").filter(Boolean);
|
|
@@ -1872,7 +1889,7 @@ function tn({ patterns: t, messageFilter: e, messageNormalizer: r = (o) => o, me
|
|
|
1872
1889
|
anonymizeMessages: s
|
|
1873
1890
|
};
|
|
1874
1891
|
}
|
|
1875
|
-
function
|
|
1892
|
+
function lo(t) {
|
|
1876
1893
|
return String(t || "").replace(/<script\b[\s\S]*?<\/script>/giu, " ").replace(/<style\b[\s\S]*?<\/style>/giu, " ").replace(/<[^>]+>/gu, " ").replace(/ /giu, " ").replace(/&/giu, "&").replace(/<|>/giu, " ").replace(/\s+/gu, " ").trim();
|
|
1877
1894
|
}
|
|
1878
1895
|
var k = {
|
|
@@ -1894,9 +1911,9 @@ var k = {
|
|
|
1894
1911
|
delivery: /\b(?:delivery|shipping|cargo|stock|availability|teslimat|kargo|stok|gonderim|gönderim)\b/iu,
|
|
1895
1912
|
promotion: /\b(?:campaign|promotion|discount|coupon|deal|kampanya|indirim|kupon|firsat|fırsat)\b/iu,
|
|
1896
1913
|
variant: /\b(?:variant|size|colour|color|beden|olcu|ölçü|renk|numara)\b/iu
|
|
1897
|
-
},
|
|
1898
|
-
function
|
|
1899
|
-
return (i = {}) =>
|
|
1914
|
+
}, rn = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}|\+?\d[\d\s().-]{8,}\d|\b[A-Z]{1,2}\d[A-Z\d]?\s*\d[A-Z]{2}\b|\b(?:token|session|csrf|secret)\s*[:=]\s*[\w.-]+/giu, nn = /(?:token|session|sid|auth|code|csrf|secret|key|password|passwd|phone|email|address|postcode|zip|jwt|bearer)/iu, on = /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}|\+?\d[\d\s().-]{8,}\d|[A-Z]{1,2}\d[A-Z\d]?\s*\d[A-Z]{2}|[A-Za-z0-9_-]{24,}/iu;
|
|
1915
|
+
function fo({ accountId: t, getPageType: e, getProduct: r, getProducts: n, normalizeProduct: o = (i) => i }) {
|
|
1916
|
+
return (i = {}) => an({
|
|
1900
1917
|
accountId: t,
|
|
1901
1918
|
getPageType: e,
|
|
1902
1919
|
getProduct: r,
|
|
@@ -1905,42 +1922,42 @@ function lo({ accountId: t, getPageType: e, getProduct: r, getProducts: n, norma
|
|
|
1905
1922
|
input: i
|
|
1906
1923
|
});
|
|
1907
1924
|
}
|
|
1908
|
-
function
|
|
1909
|
-
const a =
|
|
1925
|
+
function an({ accountId: t, getPageType: e, getProduct: r, getProducts: n, normalizeProduct: o = (a) => a, input: i = {} }) {
|
|
1926
|
+
const a = On(i), s = o(i.product || st(r)), c = (st(n) || []).map(o).filter(Boolean), l = w(i.sku || s?.sku || i.product?.sku), u = l ? c.find((tt) => w(tt?.sku) === l) || s : s || c[0] || null, f = un(l || u?.sku), p = Ut({
|
|
1910
1927
|
...f.product,
|
|
1911
1928
|
...u
|
|
1912
|
-
}), m = jt(
|
|
1929
|
+
}), m = jt(J(u?.features), J(u?.specs), An(u?.facet_hits), J(f.product?.features), fn(), dn(), pn()).slice(0, a.features), g = ie(W(u?.reviews), f.reviews, mn()).slice(0, a.reviews), _ = ae(xt(u?.qna), yn()).slice(0, a.qna), C = se(St(u?.sellers), gn()).slice(0, a.sellers), P = M([...u?.payment || [], ...K("payment", a)]), O = M([...u?.delivery || [], ...K("delivery", a)]), Ct = M([...u?.promotions || [], ...K("promotion", a)]), Et = ce(vt(u?.variants), hn()).slice(0, a.variants), It = wn(a.documents), Tt = le(u?.description, f.product?.description, bn("description"), K("description", {
|
|
1913
1930
|
...a,
|
|
1914
1931
|
textBlocks: 2
|
|
1915
1932
|
})[0]), Pt = c.filter((tt) => !l || w(tt?.sku) !== l).map(Ut).filter(Boolean).slice(0, a.relatedProducts);
|
|
1916
|
-
return
|
|
1933
|
+
return L({
|
|
1917
1934
|
accountId: t,
|
|
1918
1935
|
pageType: st(e) || "other",
|
|
1919
|
-
url:
|
|
1936
|
+
url: Pn(),
|
|
1920
1937
|
product: p,
|
|
1921
1938
|
description: Tt,
|
|
1922
1939
|
features: m,
|
|
1923
|
-
sellers:
|
|
1940
|
+
sellers: C,
|
|
1924
1941
|
reviews: g,
|
|
1925
1942
|
qna: _,
|
|
1926
1943
|
rating: A(u?.rating ?? f.rating),
|
|
1927
1944
|
review_count: A(u?.review_count ?? f.review_count),
|
|
1928
1945
|
payment: P,
|
|
1929
1946
|
delivery: O,
|
|
1930
|
-
promotions:
|
|
1931
|
-
variants:
|
|
1947
|
+
promotions: Ct,
|
|
1948
|
+
variants: Et,
|
|
1932
1949
|
documents: It,
|
|
1933
1950
|
related_products: Pt,
|
|
1934
|
-
capabilities:
|
|
1951
|
+
capabilities: Cn({
|
|
1935
1952
|
description: Tt,
|
|
1936
1953
|
features: m,
|
|
1937
|
-
sellers:
|
|
1954
|
+
sellers: C,
|
|
1938
1955
|
reviews: g,
|
|
1939
1956
|
qna: _,
|
|
1940
1957
|
payment: P,
|
|
1941
1958
|
delivery: O,
|
|
1942
|
-
promotions:
|
|
1943
|
-
variants:
|
|
1959
|
+
promotions: Ct,
|
|
1960
|
+
variants: Et,
|
|
1944
1961
|
documents: It,
|
|
1945
1962
|
relatedProducts: Pt
|
|
1946
1963
|
}),
|
|
@@ -1954,61 +1971,61 @@ function on({ accountId: t, getPageType: e, getProduct: r, getProducts: n, norma
|
|
|
1954
1971
|
}
|
|
1955
1972
|
});
|
|
1956
1973
|
}
|
|
1957
|
-
function
|
|
1974
|
+
function po(t, e) {
|
|
1958
1975
|
const r = Array.isArray(t) ? t.filter(Boolean) : [];
|
|
1959
1976
|
if (!e || typeof e != "object" || !r.length) return r;
|
|
1960
1977
|
const n = w(e.product?.sku);
|
|
1961
1978
|
return r.map((o, i) => {
|
|
1962
1979
|
const a = w(o?.sku);
|
|
1963
|
-
return r.length === 1 || n && a && n === a || i === 0 ?
|
|
1980
|
+
return r.length === 1 || n && a && n === a || i === 0 ? cn(o, e) : o;
|
|
1964
1981
|
});
|
|
1965
1982
|
}
|
|
1966
|
-
function
|
|
1967
|
-
return !t || typeof t != "object" ? null :
|
|
1983
|
+
function sn(t) {
|
|
1984
|
+
return !t || typeof t != "object" ? null : L({
|
|
1968
1985
|
product: t.product,
|
|
1969
1986
|
description: y(t.description, 500),
|
|
1970
|
-
features:
|
|
1971
|
-
sellers:
|
|
1972
|
-
reviews:
|
|
1973
|
-
qna:
|
|
1987
|
+
features: _n(t.features, 14),
|
|
1988
|
+
sellers: vn(t.sellers, 4),
|
|
1989
|
+
reviews: xn(t.reviews, 4),
|
|
1990
|
+
qna: Sn(t.qna, 4),
|
|
1974
1991
|
rating: t.rating,
|
|
1975
1992
|
review_count: t.review_count,
|
|
1976
1993
|
payment: I(t.payment, 5, 160),
|
|
1977
1994
|
delivery: I(t.delivery, 5, 160),
|
|
1978
1995
|
promotions: I(t.promotions, 5, 160),
|
|
1979
|
-
variants:
|
|
1996
|
+
variants: jn(t.variants, 10),
|
|
1980
1997
|
documents: I(t.documents, 5, 220),
|
|
1981
1998
|
capabilities: Array.isArray(t.capabilities) ? t.capabilities.slice(0, 12) : void 0
|
|
1982
1999
|
});
|
|
1983
2000
|
}
|
|
1984
|
-
function
|
|
1985
|
-
const n =
|
|
2001
|
+
function mo(t, e, r = {}) {
|
|
2002
|
+
const n = sn(t);
|
|
1986
2003
|
if (!n) return e;
|
|
1987
2004
|
const o = String(r.locale || "").toLowerCase().startsWith("en"), i = [], a = [n.rating ? `${n.rating}/5` : "", n.review_count ? `${n.review_count} ${o ? "reviews" : "yorum"}` : ""].filter(Boolean).join(", ");
|
|
1988
2005
|
return a && i.push(o ? `Visible rating: ${a}.` : `Görünür puan bilgisi: ${a}.`), n.reviews?.length && i.push(`${o ? "Visible review highlights" : "Görünür yorumlardan öne çıkanlar"}: ${n.reviews.map((s) => [s.star ? `${s.star}/5` : "", s.content].filter(Boolean).join(" ")).filter(Boolean).slice(0, 3).join(" | ")}.`), i.length ? (i.push(o ? "This summary only uses product review and rating fields visible in the browser." : "Bu özet yalnızca tarayıcıda görünen ürün yorumu ve puan alanlarından hazırlandı."), i.join(" ")) : e;
|
|
1989
2006
|
}
|
|
1990
|
-
function
|
|
1991
|
-
return
|
|
2007
|
+
function cn(t, e) {
|
|
2008
|
+
return L({
|
|
1992
2009
|
...t,
|
|
1993
2010
|
description: le(t.description, e.description),
|
|
1994
|
-
features: jt(
|
|
2011
|
+
features: jt(J(t.features), e.features).slice(0, 24),
|
|
1995
2012
|
specs: t.specs || (e.features?.length ? Object.fromEntries(e.features.map(En)) : void 0),
|
|
1996
2013
|
sellers: se(St(t.sellers), e.sellers),
|
|
1997
2014
|
reviews: ie(W(t.reviews), e.reviews),
|
|
1998
2015
|
qna: ae(xt(t.qna), e.qna),
|
|
1999
2016
|
rating: t.rating ?? e.rating,
|
|
2000
2017
|
review_count: t.review_count ?? e.review_count,
|
|
2001
|
-
payment:
|
|
2002
|
-
delivery:
|
|
2003
|
-
promotions:
|
|
2018
|
+
payment: M([...t.payment || [], ...e.payment || []]),
|
|
2019
|
+
delivery: M([...t.delivery || [], ...e.delivery || []]),
|
|
2020
|
+
promotions: M([...t.promotions || [], ...e.promotions || []]),
|
|
2004
2021
|
variants: ce(vt(t.variants), e.variants),
|
|
2005
|
-
documents:
|
|
2022
|
+
documents: M([...t.documents || [], ...e.documents || []])
|
|
2006
2023
|
});
|
|
2007
2024
|
}
|
|
2008
|
-
function
|
|
2025
|
+
function un(t) {
|
|
2009
2026
|
const e = [];
|
|
2010
2027
|
for (const o of x('script[type="application/ld+json"]')) {
|
|
2011
|
-
const i =
|
|
2028
|
+
const i = ln(o.textContent);
|
|
2012
2029
|
for (const a of lt(i))
|
|
2013
2030
|
String(a?.["@type"] || "").toLowerCase() === "product" && e.push(a);
|
|
2014
2031
|
}
|
|
@@ -2016,13 +2033,13 @@ function cn(t) {
|
|
|
2016
2033
|
if (!r) return {};
|
|
2017
2034
|
const n = r.aggregateRating || {};
|
|
2018
2035
|
return {
|
|
2019
|
-
product:
|
|
2036
|
+
product: L({
|
|
2020
2037
|
sku: w(r.sku || r.productID || r.mpn),
|
|
2021
2038
|
name: d(r.name),
|
|
2022
2039
|
brand: d(r.brand?.name || r.brand),
|
|
2023
2040
|
description: d(r.description),
|
|
2024
2041
|
images: I(r.image, 8, 280),
|
|
2025
|
-
url:
|
|
2042
|
+
url: D(r.url),
|
|
2026
2043
|
rating: A(n.ratingValue),
|
|
2027
2044
|
review_count: A(n.reviewCount || n.ratingCount)
|
|
2028
2045
|
}),
|
|
@@ -2034,14 +2051,14 @@ function cn(t) {
|
|
|
2034
2051
|
function lt(t) {
|
|
2035
2052
|
return Array.isArray(t) ? t.flatMap(lt) : !t || typeof t != "object" ? [] : [t, ...lt(t["@graph"])];
|
|
2036
2053
|
}
|
|
2037
|
-
function
|
|
2054
|
+
function ln(t) {
|
|
2038
2055
|
try {
|
|
2039
2056
|
return JSON.parse(String(t || ""));
|
|
2040
2057
|
} catch {
|
|
2041
2058
|
return null;
|
|
2042
2059
|
}
|
|
2043
2060
|
}
|
|
2044
|
-
function
|
|
2061
|
+
function fn() {
|
|
2045
2062
|
const t = [];
|
|
2046
2063
|
for (const e of x("table tr")) {
|
|
2047
2064
|
const r = [...e.querySelectorAll?.("th,td") || []].map((n) => d(n.textContent));
|
|
@@ -2052,7 +2069,7 @@ function ln() {
|
|
|
2052
2069
|
}
|
|
2053
2070
|
return t;
|
|
2054
2071
|
}
|
|
2055
|
-
function
|
|
2072
|
+
function dn() {
|
|
2056
2073
|
const t = [];
|
|
2057
2074
|
for (const e of x("dt")) {
|
|
2058
2075
|
const r = d(e.textContent), n = d(e.nextElementSibling?.matches?.("dd") ? e.nextElementSibling.textContent : "");
|
|
@@ -2063,10 +2080,10 @@ function fn() {
|
|
|
2063
2080
|
}
|
|
2064
2081
|
return t;
|
|
2065
2082
|
}
|
|
2066
|
-
function
|
|
2083
|
+
function pn() {
|
|
2067
2084
|
return x('[class*="spec" i], [class*="feature" i], [class*="attribute" i], li').map((t) => oe(d(t.textContent))).filter(Boolean).slice(0, k.features);
|
|
2068
2085
|
}
|
|
2069
|
-
function
|
|
2086
|
+
function mn() {
|
|
2070
2087
|
return x('[class*="review" i], [data-review], [itemprop="review"]').map((t) => {
|
|
2071
2088
|
const e = d(t.textContent);
|
|
2072
2089
|
return !e || e.length < 8 || _t.qna.test(e) ? null : {
|
|
@@ -2075,7 +2092,7 @@ function pn() {
|
|
|
2075
2092
|
};
|
|
2076
2093
|
}).filter(Boolean);
|
|
2077
2094
|
}
|
|
2078
|
-
function
|
|
2095
|
+
function yn() {
|
|
2079
2096
|
const t = x('[class*="question" i], [class*="answer" i], [data-question], [data-answer]'), e = [];
|
|
2080
2097
|
for (const r of t) {
|
|
2081
2098
|
const n = d(r.textContent);
|
|
@@ -2088,39 +2105,39 @@ function mn() {
|
|
|
2088
2105
|
}
|
|
2089
2106
|
return e;
|
|
2090
2107
|
}
|
|
2091
|
-
function
|
|
2108
|
+
function gn() {
|
|
2092
2109
|
return x('[class*="seller" i], [class*="merchant" i], [data-seller], [data-merchant]').map((t) => d(t.getAttribute?.("data-seller") || t.getAttribute?.("data-merchant") || t.textContent)).filter(Boolean).map((t) => ({ merchant: y(t, 120) }));
|
|
2093
2110
|
}
|
|
2094
|
-
function
|
|
2095
|
-
return x('[class*="variant" i] a,[class*="variant" i] button,[class*="size" i] button,[class*="color" i] button,[data-variant],[data-size],[data-color]').map((t) =>
|
|
2111
|
+
function hn() {
|
|
2112
|
+
return x('[class*="variant" i] a,[class*="variant" i] button,[class*="size" i] button,[class*="color" i] button,[data-variant],[data-size],[data-color]').map((t) => L({
|
|
2096
2113
|
name: y(fe(t), 120),
|
|
2097
2114
|
value: y(t.getAttribute?.("data-value") || t.getAttribute?.("data-size") || t.getAttribute?.("data-color"), 120),
|
|
2098
2115
|
sku: w(t.getAttribute?.("data-sku") || t.getAttribute?.("data-product-id")),
|
|
2099
|
-
url:
|
|
2116
|
+
url: D(t.getAttribute?.("href")),
|
|
2100
2117
|
in_stock: t.getAttribute?.("disabled") == null && t.getAttribute?.("aria-disabled") !== "true"
|
|
2101
2118
|
})).filter((t) => t.name || t.value || t.sku);
|
|
2102
2119
|
}
|
|
2103
|
-
function
|
|
2120
|
+
function wn(t) {
|
|
2104
2121
|
return x("a[href]").filter((e) => /\.pdf(?:$|[?#])/iu.test(e.getAttribute?.("href") || "")).map((e) => {
|
|
2105
|
-
const r = fe(e) || "PDF", n =
|
|
2122
|
+
const r = fe(e) || "PDF", n = D(e.getAttribute?.("href"));
|
|
2106
2123
|
return n ? `${r}: ${n}` : "";
|
|
2107
2124
|
}).filter(Boolean).slice(0, t);
|
|
2108
2125
|
}
|
|
2109
|
-
function
|
|
2126
|
+
function K(t, e) {
|
|
2110
2127
|
const r = _t[t];
|
|
2111
2128
|
return r ? x("section,article,div,li,p,span,button,a").map((n) => d(n.textContent)).filter((n) => n && r.test(n) && n.length <= 900).map((n) => y(n, e.textChars || k.textChars)).filter(ue()).slice(0, e.textBlocks || k.textBlocks) : [];
|
|
2112
2129
|
}
|
|
2113
|
-
function
|
|
2130
|
+
function bn(t) {
|
|
2114
2131
|
return d(document.querySelector?.(`meta[name="${t}"]`)?.getAttribute?.("content") || document.querySelector?.(`meta[property="og:${t}"]`)?.getAttribute?.("content"));
|
|
2115
2132
|
}
|
|
2116
2133
|
function x(t) {
|
|
2117
2134
|
try {
|
|
2118
|
-
return [...document.querySelectorAll?.(t) || []].filter(
|
|
2135
|
+
return [...document.querySelectorAll?.(t) || []].filter(kn);
|
|
2119
2136
|
} catch {
|
|
2120
2137
|
return [];
|
|
2121
2138
|
}
|
|
2122
2139
|
}
|
|
2123
|
-
function
|
|
2140
|
+
function kn(t) {
|
|
2124
2141
|
if (!t) return !1;
|
|
2125
2142
|
if (!t.getBoundingClientRect) return !0;
|
|
2126
2143
|
const e = t.getBoundingClientRect();
|
|
@@ -2128,7 +2145,7 @@ function bn(t) {
|
|
|
2128
2145
|
const r = window.getComputedStyle?.(t);
|
|
2129
2146
|
return !r || r.visibility !== "hidden" && r.display !== "none" && Number(r.opacity || 1) > 0;
|
|
2130
2147
|
}
|
|
2131
|
-
function
|
|
2148
|
+
function J(t) {
|
|
2132
2149
|
return t ? (Array.isArray(t) ? t : Object.entries(t).map(([e, r]) => ({
|
|
2133
2150
|
key: e,
|
|
2134
2151
|
value: r
|
|
@@ -2140,7 +2157,7 @@ function K(t) {
|
|
|
2140
2157
|
value: d(e.value || e.text || "")
|
|
2141
2158
|
}).filter((e) => e.key || e.value) : [];
|
|
2142
2159
|
}
|
|
2143
|
-
function
|
|
2160
|
+
function An(t) {
|
|
2144
2161
|
return !t || typeof t != "object" ? [] : Object.entries(t).map(([e, r]) => ({
|
|
2145
2162
|
key: d(e),
|
|
2146
2163
|
value: d(r)
|
|
@@ -2178,7 +2195,7 @@ function vt(t) {
|
|
|
2178
2195
|
name: y(e.name || e.label || e.title || "", 120),
|
|
2179
2196
|
value: y(e.value || e.size || e.color || "", 120),
|
|
2180
2197
|
sku: w(e.sku || e.code || ""),
|
|
2181
|
-
url:
|
|
2198
|
+
url: D(e.url),
|
|
2182
2199
|
in_stock: e.in_stock
|
|
2183
2200
|
})).filter((e) => e.name || e.value || e.sku || e.url);
|
|
2184
2201
|
}
|
|
@@ -2212,7 +2229,7 @@ function X(t, e) {
|
|
|
2212
2229
|
return !o.trim() || r.has(o) ? !1 : (r.add(o), !0);
|
|
2213
2230
|
});
|
|
2214
2231
|
}
|
|
2215
|
-
function
|
|
2232
|
+
function M(t) {
|
|
2216
2233
|
return I(t, 20, k.textChars);
|
|
2217
2234
|
}
|
|
2218
2235
|
function I(t, e, r) {
|
|
@@ -2225,39 +2242,39 @@ function ue() {
|
|
|
2225
2242
|
return !r || t.has(r) ? !1 : (t.add(r), !0);
|
|
2226
2243
|
};
|
|
2227
2244
|
}
|
|
2228
|
-
function
|
|
2245
|
+
function _n(t, e) {
|
|
2229
2246
|
return jt(t).slice(0, e);
|
|
2230
2247
|
}
|
|
2231
|
-
function
|
|
2248
|
+
function xn(t, e) {
|
|
2232
2249
|
return W(t).slice(0, e);
|
|
2233
2250
|
}
|
|
2234
|
-
function
|
|
2251
|
+
function Sn(t, e) {
|
|
2235
2252
|
return xt(t).slice(0, e);
|
|
2236
2253
|
}
|
|
2237
|
-
function
|
|
2254
|
+
function vn(t, e) {
|
|
2238
2255
|
return St(t).slice(0, e);
|
|
2239
2256
|
}
|
|
2240
|
-
function
|
|
2257
|
+
function jn(t, e) {
|
|
2241
2258
|
return vt(t).slice(0, e);
|
|
2242
2259
|
}
|
|
2243
2260
|
function Ut(t) {
|
|
2244
|
-
return !t || typeof t != "object" ? null :
|
|
2261
|
+
return !t || typeof t != "object" ? null : L({
|
|
2245
2262
|
sku: w(t.sku || t.id || ""),
|
|
2246
2263
|
group_id: w(t.group_id || t.groupId || ""),
|
|
2247
2264
|
name: d(t.name || t.title || ""),
|
|
2248
2265
|
brand: d(t.brand || ""),
|
|
2249
|
-
url:
|
|
2266
|
+
url: D(t.url),
|
|
2250
2267
|
images: I(t.images || t.image, 8, 280),
|
|
2251
2268
|
price: A(t.price),
|
|
2252
2269
|
price_discounted: A(t.price_discounted || t.discountedPrice),
|
|
2253
2270
|
price_text: d(t.price_text || t.priceText || ""),
|
|
2254
2271
|
price_currency: d(t.price_currency || t.currency || ""),
|
|
2255
|
-
category_ids:
|
|
2272
|
+
category_ids: In(t.category_ids || t.categoryIds, 8, 90),
|
|
2256
2273
|
category_names: I(t.category_names || t.categoryNames || t.category, 8, 140),
|
|
2257
2274
|
in_stock: t.in_stock
|
|
2258
2275
|
});
|
|
2259
2276
|
}
|
|
2260
|
-
function
|
|
2277
|
+
function Cn(t) {
|
|
2261
2278
|
return [
|
|
2262
2279
|
t.description ? "description" : "",
|
|
2263
2280
|
t.features?.length ? "features" : "",
|
|
@@ -2285,16 +2302,16 @@ function fe(t) {
|
|
|
2285
2302
|
return d(t.getAttribute?.("aria-label") || t.getAttribute?.("title") || t.getAttribute?.("alt") || t.textContent);
|
|
2286
2303
|
}
|
|
2287
2304
|
function d(t) {
|
|
2288
|
-
return String(t ?? "").replace(/<script\b[\s\S]*?<\/script>/giu, " ").replace(/<style\b[\s\S]*?<\/style>/giu, " ").replace(/<[^>]+>/gu, " ").replace(
|
|
2305
|
+
return String(t ?? "").replace(/<script\b[\s\S]*?<\/script>/giu, " ").replace(/<style\b[\s\S]*?<\/style>/giu, " ").replace(/<[^>]+>/gu, " ").replace(rn, "[redacted]").replace(/\s+/gu, " ").trim();
|
|
2289
2306
|
}
|
|
2290
2307
|
function w(t) {
|
|
2291
2308
|
const e = String(t ?? "").replace(/<script\b[\s\S]*?<\/script>/giu, " ").replace(/<style\b[\s\S]*?<\/style>/giu, " ").replace(/<[^>]+>/gu, " ").replace(/\s+/gu, " ").trim();
|
|
2292
2309
|
return !e || /[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/iu.test(e) || /\b(?:token|session|csrf|secret|password|passwd|jwt|bearer)\s*[:=]\s*[\w.-]+/iu.test(e) ? "" : e.slice(0, 120);
|
|
2293
2310
|
}
|
|
2294
|
-
function
|
|
2295
|
-
return (Array.isArray(t) ? t : t ? [t] : []).map((n) => w(n).slice(0, r)).filter(Boolean).filter(
|
|
2311
|
+
function In(t, e, r) {
|
|
2312
|
+
return (Array.isArray(t) ? t : t ? [t] : []).map((n) => w(n).slice(0, r)).filter(Boolean).filter(Tn()).slice(0, e);
|
|
2296
2313
|
}
|
|
2297
|
-
function
|
|
2314
|
+
function Tn() {
|
|
2298
2315
|
const t = /* @__PURE__ */ new Set();
|
|
2299
2316
|
return (e) => {
|
|
2300
2317
|
const r = w(e).toLocaleLowerCase("tr-TR");
|
|
@@ -2305,7 +2322,7 @@ function A(t) {
|
|
|
2305
2322
|
const e = Number(String(t ?? "").replace(",", "."));
|
|
2306
2323
|
return Number.isFinite(e) && e > 0 ? e : void 0;
|
|
2307
2324
|
}
|
|
2308
|
-
function
|
|
2325
|
+
function D(t) {
|
|
2309
2326
|
if (!t) return "";
|
|
2310
2327
|
try {
|
|
2311
2328
|
const e = new URL(t, window.location.href);
|
|
@@ -2314,7 +2331,7 @@ function z(t) {
|
|
|
2314
2331
|
return "";
|
|
2315
2332
|
}
|
|
2316
2333
|
}
|
|
2317
|
-
function
|
|
2334
|
+
function Pn() {
|
|
2318
2335
|
try {
|
|
2319
2336
|
const t = new URL(window.location.href);
|
|
2320
2337
|
return t.hash = "", de(t), `${t.origin}${t.pathname}${t.search}`;
|
|
@@ -2325,11 +2342,11 @@ function Tn() {
|
|
|
2325
2342
|
function de(t) {
|
|
2326
2343
|
for (const [e, r] of [...t.searchParams.entries()]) {
|
|
2327
2344
|
const n = String(r || "");
|
|
2328
|
-
(
|
|
2345
|
+
(nn.test(e) || on.test(n)) && t.searchParams.set(e, "redacted");
|
|
2329
2346
|
}
|
|
2330
2347
|
return t;
|
|
2331
2348
|
}
|
|
2332
|
-
function
|
|
2349
|
+
function On(t = {}) {
|
|
2333
2350
|
return {
|
|
2334
2351
|
features: S(t.maxFeatures, k.features, 40),
|
|
2335
2352
|
reviews: S(t.maxReviews, k.reviews, 12),
|
|
@@ -2353,24 +2370,24 @@ function st(t) {
|
|
|
2353
2370
|
return null;
|
|
2354
2371
|
}
|
|
2355
2372
|
}
|
|
2356
|
-
function
|
|
2373
|
+
function L(t) {
|
|
2357
2374
|
return Object.fromEntries(Object.entries(t || {}).filter(([, e]) => e != null && e !== "" && (!Array.isArray(e) || e.length)));
|
|
2358
2375
|
}
|
|
2359
|
-
var { redactPii:
|
|
2376
|
+
var { redactPii: yo, anonymousRequestText: go, anonymizeMessages: ho } = en({ patterns: [{
|
|
2360
2377
|
pattern: /\b\d{5}\b/gu,
|
|
2361
2378
|
replacement: "[postcode]"
|
|
2362
2379
|
}, {
|
|
2363
2380
|
pattern: /\b(?:adresim|adres|mahalle|sokak|cadde)\b[^,.!?\n]{8,160}/giu,
|
|
2364
2381
|
replacement: "[address]"
|
|
2365
2382
|
}] });
|
|
2366
|
-
function
|
|
2383
|
+
function Mn(t) {
|
|
2367
2384
|
return (t?.route?.flow_params && typeof t.route.flow_params == "object" ? t.route.flow_params : null) || (t?.route?.flowParams && typeof t.route.flowParams == "object" ? t.route.flowParams : null) || {};
|
|
2368
2385
|
}
|
|
2369
|
-
function
|
|
2386
|
+
function wo(t) {
|
|
2370
2387
|
return Array.isArray(t) ? t.find((e) => String(e || "").trim()) : void 0;
|
|
2371
2388
|
}
|
|
2372
|
-
function
|
|
2373
|
-
const e =
|
|
2389
|
+
function bo(t) {
|
|
2390
|
+
const e = Mn(t);
|
|
2374
2391
|
return [
|
|
2375
2392
|
...e.sku ? [e.sku] : [],
|
|
2376
2393
|
...Array.isArray(e.sku_list) ? e.sku_list : [],
|
|
@@ -2379,76 +2396,76 @@ function wo(t) {
|
|
|
2379
2396
|
].map((r) => String(r || "").trim()).filter(Boolean).filter((r, n, o) => o.indexOf(r) === n);
|
|
2380
2397
|
}
|
|
2381
2398
|
export {
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2399
|
+
Fn as $,
|
|
2400
|
+
eo as A,
|
|
2401
|
+
Zn as B,
|
|
2402
|
+
Gr as C,
|
|
2386
2403
|
ee as D,
|
|
2387
2404
|
re as E,
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2405
|
+
Ur as F,
|
|
2406
|
+
Jn as G,
|
|
2407
|
+
Kn as H,
|
|
2408
|
+
Qn as I,
|
|
2409
|
+
Dn as J,
|
|
2393
2410
|
gt as K,
|
|
2394
2411
|
te as L,
|
|
2395
|
-
|
|
2396
|
-
|
|
2412
|
+
Xn as M,
|
|
2413
|
+
Wn as N,
|
|
2397
2414
|
ne as O,
|
|
2398
|
-
|
|
2415
|
+
Yn as P,
|
|
2399
2416
|
sr as Q,
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2417
|
+
Gn as R,
|
|
2418
|
+
no as S,
|
|
2419
|
+
Kr as T,
|
|
2420
|
+
Vn as U,
|
|
2404
2421
|
Ht as V,
|
|
2405
2422
|
Gt as W,
|
|
2406
|
-
|
|
2423
|
+
zn as X,
|
|
2407
2424
|
cr as Y,
|
|
2408
2425
|
Jt as Z,
|
|
2409
|
-
|
|
2426
|
+
oo as _,
|
|
2410
2427
|
ge as _t,
|
|
2411
|
-
|
|
2412
|
-
|
|
2413
|
-
|
|
2414
|
-
|
|
2428
|
+
go as a,
|
|
2429
|
+
Nn as at,
|
|
2430
|
+
Xr as b,
|
|
2431
|
+
fo as c,
|
|
2415
2432
|
Ge as ct,
|
|
2416
|
-
|
|
2433
|
+
mo as d,
|
|
2417
2434
|
v as dt,
|
|
2418
2435
|
ar as et,
|
|
2419
|
-
|
|
2436
|
+
en as f,
|
|
2420
2437
|
Le as ft,
|
|
2421
|
-
|
|
2438
|
+
so as g,
|
|
2422
2439
|
$e as gt,
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2440
|
+
co as h,
|
|
2441
|
+
$n as ht,
|
|
2442
|
+
ho as i,
|
|
2426
2443
|
Kt as it,
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2444
|
+
to as j,
|
|
2445
|
+
Vr as k,
|
|
2446
|
+
an as l,
|
|
2447
|
+
Ln as lt,
|
|
2448
|
+
uo as m,
|
|
2432
2449
|
Se as mt,
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2450
|
+
Mn as n,
|
|
2451
|
+
qn as nt,
|
|
2452
|
+
yo as o,
|
|
2436
2453
|
tr as ot,
|
|
2437
|
-
|
|
2438
|
-
|
|
2454
|
+
lo as p,
|
|
2455
|
+
Rn as pt,
|
|
2439
2456
|
ht as q,
|
|
2440
|
-
|
|
2457
|
+
bo as r,
|
|
2441
2458
|
T as rt,
|
|
2442
|
-
|
|
2459
|
+
sn as s,
|
|
2443
2460
|
Qe as st,
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2461
|
+
wo as t,
|
|
2462
|
+
Un as tt,
|
|
2463
|
+
po as u,
|
|
2447
2464
|
Dt as ut,
|
|
2448
|
-
|
|
2465
|
+
io as v,
|
|
2449
2466
|
he as vt,
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2467
|
+
ro as w,
|
|
2468
|
+
Wr as x,
|
|
2469
|
+
ao as y,
|
|
2470
|
+
Hn as z
|
|
2454
2471
|
};
|