@gengage/assistant-fe 0.6.27 → 0.6.28
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/agent-ui-steps-Dc4ByfZo.js +3161 -0
- package/dist/agentic/context/context-store.d.ts +25 -0
- package/dist/agentic/index.d.ts +15 -1
- package/dist/agentic/index.js +164 -150
- package/dist/agentic/types.d.ts +31 -3
- package/dist/agentic/worker/agent-ui-steps.d.ts +43 -0
- package/dist/agentic/worker/agent-ui.d.ts +44 -0
- package/dist/agentic/worker/be-client.d.ts +16 -4
- package/dist/agentic/worker/coalesce.d.ts +25 -0
- package/dist/agentic/worker/compaction.d.ts +12 -0
- package/dist/agentic/worker/pdp-hydrate.d.ts +30 -0
- package/dist/agentic/worker/tool-schema.d.ts +19 -0
- package/dist/agentic/worker.d.ts +15 -1
- package/dist/agentic/worker.js +292 -264
- package/dist/agentic.iife.js +9 -9
- package/dist/{api-paths-C9NwnH29.js → api-paths-PFiXYIey.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-Bhl1mzk2.js → common-DyAcz33-.js} +1 -1
- package/dist/common.js +5 -5
- package/dist/{connection-warning-D-0Mxk-A.js → connection-warning-nWEUv5bp.js} +1 -1
- package/dist/{fastIntent-bAlwVoje.js → fastIntent-BiHAWBIa.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/{runtime-BAFZ7iOP.js → runtime-BIA5sGno.js} +3 -3
- package/dist/{runtime-oEtmgT4U.js → runtime-BuzZUB0i.js} +3 -3
- package/dist/{runtime-CUNLK1KR.js → runtime-PHarcyNZ.js} +3 -3
- package/dist/{simbut-Dt8e5uSk.js → simbut-CiPq-niE.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{simrel-txr23_xG.js → simrel-XWtKe-OG.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-56tkaZZB.js → widget-base-DSl6thOx.js} +1 -1
- package/package.json +1 -1
- package/dist/route-params-5K4Du1Xa.js +0 -2476
package/dist/agentic/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { buildPhotoSimilarityProfile as yo, buildProductSimilarityProfile as wo, buildSimilarityQueries as vo, normalizeSimilarityText as xo, rankSimilarProducts as ko, rankSimilarProductsAsync as _o, scoreSimilarityCandidate as So, tokenizeSimilarityText as Eo } from "./algos/similarity.js";
|
|
2
|
-
import { $ as
|
|
2
|
+
import { $ as ft, A as Co, At as pt, B as Ao, C as Ro, Ct as mt, D as Po, E as Lo, Et as jo, F as No, G as Io, H as Uo, I as qo, J as Bo, K as Oo, L as Fo, M as $o, Mt as Mo, N as Do, O as Go, Ot as Oe, P as zo, Q as gt, R as Ho, S as Wo, T as Vo, Tt as Ko, U as Jo, V as Yo, W as Zo, X as Qo, Y as Xo, Z as ei, _ as ti, _t as ri, a as ni, at as oi, b as ii, bt as ai, c as si, ct as ci, d as li, dt as ui, et as di, f as fi, ft as pi, g as mi, gt as ht, h as gi, ht as hi, i as bi, it as ue, j as yi, jt as wi, k as vi, kt as bt, l as xi, lt as ki, m as _i, mt as Si, n as Ei, nt as Ti, o as Ci, ot as Ai, p as Ri, pt as Pi, q as Li, r as ji, rt as Ni, s as Ii, st as Ui, t as qi, tt as Bi, u as Oi, ut as Fi, v as $i, vt as Mi, w as Di, wt as Gi, x as yt, xt as Fe, y as zi, yt as wt, z as Hi } from "../agent-ui-steps-Dc4ByfZo.js";
|
|
3
3
|
var vt = 512, xt = 0.74;
|
|
4
4
|
function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl: o, tokenBrokerAudience: i, defaultLocale: a, tools: s = {}, beacon: c, confirmation: d, memory: f = Oe() }) {
|
|
5
5
|
let b = 1;
|
|
6
6
|
const m = /* @__PURE__ */ new Map();
|
|
7
|
-
return
|
|
7
|
+
return bt({
|
|
8
8
|
worker: t,
|
|
9
9
|
tools: s,
|
|
10
10
|
beacon: (l) => c?.({
|
|
@@ -16,7 +16,7 @@ function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
|
|
|
16
16
|
}), t.addEventListener("message", (l) => {
|
|
17
17
|
const p = l.data || {};
|
|
18
18
|
if (p.type === "activity" && p.entry) {
|
|
19
|
-
|
|
19
|
+
$e(p.entry);
|
|
20
20
|
return;
|
|
21
21
|
}
|
|
22
22
|
const g = typeof p.id == "number" ? p.id : null;
|
|
@@ -65,7 +65,7 @@ function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
if (g.addEventListener("abort", w, { once: !0 }), u) {
|
|
68
|
-
|
|
68
|
+
Me(l, u).then(k).catch((v) => {
|
|
69
69
|
m.delete(h), p.onError(v instanceof Error ? v : /* @__PURE__ */ new Error("Failed to read image attachment"));
|
|
70
70
|
});
|
|
71
71
|
return;
|
|
@@ -73,7 +73,7 @@ function kt({ accountId: e, worker: t, beUrl: r, devJwtSecret: n, tokenBrokerUrl
|
|
|
73
73
|
k(l);
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
|
-
function
|
|
76
|
+
function $e(e) {
|
|
77
77
|
const t = window;
|
|
78
78
|
(t.__GENGAGE_AGENTIC_DEBUG_RECORD__ || t.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__)?.(e);
|
|
79
79
|
}
|
|
@@ -89,15 +89,15 @@ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
|
|
|
89
89
|
beacon: c,
|
|
90
90
|
confirmation: d,
|
|
91
91
|
memory: f ?? Oe()
|
|
92
|
-
}), l =
|
|
92
|
+
}), l = gt(m), p = Fe({
|
|
93
93
|
accountId: e,
|
|
94
94
|
...n ? { devJwtSecret: n } : {},
|
|
95
95
|
...o ? { tokenBrokerUrl: o } : {},
|
|
96
96
|
...i ? { tokenBrokerAudience: i } : {}
|
|
97
97
|
});
|
|
98
98
|
return async (g, u, h, w) => {
|
|
99
|
-
const k = await
|
|
100
|
-
b ||= new
|
|
99
|
+
const k = await Me(g || {}, w);
|
|
100
|
+
b ||= new mt({
|
|
101
101
|
accountId: e,
|
|
102
102
|
locale: k?.locale || a,
|
|
103
103
|
parentUrl: window.location.href,
|
|
@@ -115,15 +115,15 @@ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
|
|
|
115
115
|
...t,
|
|
116
116
|
accountId: e,
|
|
117
117
|
trace: async (v) => {
|
|
118
|
-
|
|
118
|
+
$e({
|
|
119
119
|
kind: "flow/trace",
|
|
120
120
|
event: v
|
|
121
121
|
}), await t.trace?.(v);
|
|
122
122
|
}
|
|
123
123
|
},
|
|
124
124
|
contextStore: b,
|
|
125
|
-
beClient: { invoke({ op: v, input: T, signal: x, cacheTtlS: C, cacheKey:
|
|
126
|
-
return
|
|
125
|
+
beClient: { invoke({ op: v, input: T, signal: x, cacheTtlS: C, cacheKey: $, browserCache: z }) {
|
|
126
|
+
return ht({
|
|
127
127
|
beUrl: r,
|
|
128
128
|
accountId: e,
|
|
129
129
|
jwtProvider: p,
|
|
@@ -131,7 +131,7 @@ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
|
|
|
131
131
|
op: v,
|
|
132
132
|
input: T,
|
|
133
133
|
cacheTtlS: C,
|
|
134
|
-
cacheKey:
|
|
134
|
+
cacheKey: $,
|
|
135
135
|
browserCache: z,
|
|
136
136
|
...x ? { signal: x } : {}
|
|
137
137
|
});
|
|
@@ -142,7 +142,7 @@ function St({ accountId: e, accountModule: t, beUrl: r, devJwtSecret: n, tokenBr
|
|
|
142
142
|
signal: h
|
|
143
143
|
});
|
|
144
144
|
} catch (v) {
|
|
145
|
-
h?.aborted || (oe(u,
|
|
145
|
+
h?.aborted || (oe(u, wt(v)), u.onDone());
|
|
146
146
|
}
|
|
147
147
|
};
|
|
148
148
|
}
|
|
@@ -151,14 +151,14 @@ function Et({ accountId: e, tools: t, beacon: r, confirmation: n, memory: o }) {
|
|
|
151
151
|
...a,
|
|
152
152
|
accountId: a.accountId || e
|
|
153
153
|
});
|
|
154
|
-
return ((a, s) =>
|
|
154
|
+
return ((a, s) => pt(a, s, {
|
|
155
155
|
tools: t,
|
|
156
156
|
beacon: i,
|
|
157
157
|
confirmation: n,
|
|
158
158
|
memory: o
|
|
159
159
|
}));
|
|
160
160
|
}
|
|
161
|
-
async function
|
|
161
|
+
async function Me(e, t) {
|
|
162
162
|
if (!t || !t.type?.startsWith("image/")) return e;
|
|
163
163
|
const r = await At(t), n = {
|
|
164
164
|
...Tt(e.payload ?? e.action?.payload),
|
|
@@ -440,11 +440,11 @@ function Ot(e) {
|
|
|
440
440
|
}
|
|
441
441
|
setTimeout(r, 5e3);
|
|
442
442
|
}
|
|
443
|
-
var V = "__gengageAgentFetchBridge",
|
|
444
|
-
function
|
|
443
|
+
var V = "__gengageAgentFetchBridge", Ft = 1e3 * 60 * 60 * 24 * 14;
|
|
444
|
+
function Wi({ accountId: e, streamTransport: t, endpoints: r = {}, endpointCache: n }) {
|
|
445
445
|
if (!e) throw new Error("accountId is required.");
|
|
446
446
|
if (typeof t != "function") throw new Error("streamTransport is required.");
|
|
447
|
-
const o =
|
|
447
|
+
const o = $t(), i = `https://gengage-injector.invalid/${encodeURIComponent(e)}`, a = /* @__PURE__ */ new Set(), s = n ? Wt({
|
|
448
448
|
accountId: e,
|
|
449
449
|
endpointCache: n,
|
|
450
450
|
fetchImpl: o.originalFetch
|
|
@@ -463,11 +463,11 @@ function ji({ accountId: e, streamTransport: t, endpoints: r = {}, endpointCache
|
|
|
463
463
|
middlewareUrl: i,
|
|
464
464
|
stop() {
|
|
465
465
|
for (const d of a) o.routes.delete(d);
|
|
466
|
-
|
|
466
|
+
Mt(o);
|
|
467
467
|
}
|
|
468
468
|
};
|
|
469
469
|
}
|
|
470
|
-
function
|
|
470
|
+
function $t() {
|
|
471
471
|
const e = window, t = e[V];
|
|
472
472
|
if (t) return t;
|
|
473
473
|
const r = e.fetch.bind(e), n = {
|
|
@@ -480,7 +480,7 @@ function Mt() {
|
|
|
480
480
|
return s ? Gt(s, o, i) : r(o, i);
|
|
481
481
|
}, e.fetch = n.installedFetch, e[V] = n, n;
|
|
482
482
|
}
|
|
483
|
-
function
|
|
483
|
+
function Mt(e) {
|
|
484
484
|
if (e.routes.size > 0) return;
|
|
485
485
|
const t = window;
|
|
486
486
|
t.fetch === e.installedFetch && (t.fetch = e.originalFetch), t[V] === e && delete t[V];
|
|
@@ -620,10 +620,10 @@ function Wt({ accountId: e, endpointCache: t, fetchImpl: r }) {
|
|
|
620
620
|
accountId: e,
|
|
621
621
|
beUrl: t.beUrl,
|
|
622
622
|
...t.parentUrl ? { parentUrl: t.parentUrl } : {},
|
|
623
|
-
ttlMs: t.ttlMs ??
|
|
623
|
+
ttlMs: t.ttlMs ?? Ft,
|
|
624
624
|
policies: t.policies,
|
|
625
625
|
fetchImpl: r,
|
|
626
|
-
jwtProvider:
|
|
626
|
+
jwtProvider: Fe({
|
|
627
627
|
accountId: e,
|
|
628
628
|
...t.devJwtSecret ? { devJwtSecret: t.devJwtSecret } : {},
|
|
629
629
|
...t.tokenBrokerUrl ? { tokenBrokerUrl: t.tokenBrokerUrl } : {},
|
|
@@ -759,7 +759,7 @@ function nr(e) {
|
|
|
759
759
|
function or(e) {
|
|
760
760
|
return e !== null && (typeof e == "object" || typeof e == "function") && typeof e.then == "function";
|
|
761
761
|
}
|
|
762
|
-
function
|
|
762
|
+
function Vi({ accountId: e, beUrl: t, devJwtSecret: r, tokenBrokerUrl: n, tokenBrokerAudience: o, workerUrl: i, defaultLocale: a = "en-GB", accountModule: s, tools: c = {}, beacon: d, confirmation: f, memory: b, allowBlobWorker: m = !1, signal: l }) {
|
|
763
763
|
if (!e) throw new Error("accountId is required.");
|
|
764
764
|
if (!t) throw new Error("beUrl is required. The injector owns backend URLs; the SDK has no default.");
|
|
765
765
|
if (!i) throw new Error("workerUrl is required.");
|
|
@@ -873,7 +873,7 @@ function ar(e, t, r = "v1") {
|
|
|
873
873
|
request: t
|
|
874
874
|
})}`;
|
|
875
875
|
}
|
|
876
|
-
function
|
|
876
|
+
function Ki(e) {
|
|
877
877
|
const t = e.version || "v1", r = (n) => (o) => ({
|
|
878
878
|
partition: `${e.partitionPrefix}/${n}`,
|
|
879
879
|
key: ar(n, o, t),
|
|
@@ -885,10 +885,10 @@ function Ii(e) {
|
|
|
885
885
|
product_groupings: r("product_groupings")
|
|
886
886
|
};
|
|
887
887
|
}
|
|
888
|
-
function
|
|
888
|
+
function Ji(e) {
|
|
889
889
|
return { ...e };
|
|
890
890
|
}
|
|
891
|
-
function
|
|
891
|
+
function Yi(e, t = {}) {
|
|
892
892
|
return new Response(e.map((r) => JSON.stringify(r)).join(`
|
|
893
893
|
`) + `
|
|
894
894
|
`, {
|
|
@@ -899,7 +899,7 @@ function qi(e, t = {}) {
|
|
|
899
899
|
}
|
|
900
900
|
});
|
|
901
901
|
}
|
|
902
|
-
function
|
|
902
|
+
function Zi(e, t = {}) {
|
|
903
903
|
return new Response(JSON.stringify(e), {
|
|
904
904
|
...t,
|
|
905
905
|
headers: {
|
|
@@ -912,12 +912,12 @@ function sr(e) {
|
|
|
912
912
|
const t = (e?.chat || e?._chat)?.root || e?._chat?.root;
|
|
913
913
|
return t ? t.getRootNode?.()?.host || t : Array.from(document.querySelectorAll("*")).find((r) => r.shadowRoot?.querySelector?.(".gengage-chat-root, .gengage-chat-launcher-container"));
|
|
914
914
|
}
|
|
915
|
-
function
|
|
915
|
+
function Qi(e, t) {
|
|
916
916
|
const r = sr(e);
|
|
917
917
|
r?.style && (t ? r.style.removeProperty("display") : r.style.setProperty("display", "none", "important")), t || (e?.chat || e?._chat)?.close?.();
|
|
918
918
|
}
|
|
919
919
|
var cr = "nd_be_url";
|
|
920
|
-
function
|
|
920
|
+
function Xi(e, t) {
|
|
921
921
|
const r = lr() || e.beUrl || t;
|
|
922
922
|
if (!r) throw new Error("resolveBeUrl: backend URL is required. The injector must supply a fallback URL; the SDK has no default.");
|
|
923
923
|
return r;
|
|
@@ -940,7 +940,7 @@ var ur = [
|
|
|
940
940
|
"searchGiftOptions",
|
|
941
941
|
"similaritySearch"
|
|
942
942
|
];
|
|
943
|
-
function
|
|
943
|
+
function ea(e, t, r = {}) {
|
|
944
944
|
const n = window, o = n.gengage || (n.gengage = {}), i = o.tools || (o.tools = {});
|
|
945
945
|
i[e] = t;
|
|
946
946
|
for (const a of r.accountAliases || []) i[a] = t;
|
|
@@ -950,7 +950,7 @@ function Mi(e, t, r = {}) {
|
|
|
950
950
|
}
|
|
951
951
|
return t;
|
|
952
952
|
}
|
|
953
|
-
function
|
|
953
|
+
function ta({ getPageType: e, getProduct: t }) {
|
|
954
954
|
return () => ({
|
|
955
955
|
url: window.location.href,
|
|
956
956
|
title: document.title,
|
|
@@ -958,7 +958,7 @@ function Fi({ getPageType: e, getProduct: t }) {
|
|
|
958
958
|
product: t()
|
|
959
959
|
});
|
|
960
960
|
}
|
|
961
|
-
function
|
|
961
|
+
function ra({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getSearchCapabilities: o, getMemory: i }) {
|
|
962
962
|
return async () => ({
|
|
963
963
|
accountId: e,
|
|
964
964
|
url: window.location.href,
|
|
@@ -970,7 +970,7 @@ function Di({ accountId: e, getPageType: t, getProduct: r, getToolNames: n, getS
|
|
|
970
970
|
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
971
971
|
});
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function na({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "start", globalBaseUrlKey: n, errorLabel: o, trustedRuntimeOrigins: i } = {}) {
|
|
974
974
|
if (!e) throw new Error("accountId is required.");
|
|
975
975
|
const a = o || e, s = window, c = () => {
|
|
976
976
|
const l = s.GengageInjectorConfig || {}, p = l[e] || {};
|
|
@@ -987,8 +987,8 @@ function Gi({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "sta
|
|
|
987
987
|
}, f = (l) => {
|
|
988
988
|
if (i === !0) return l;
|
|
989
989
|
const p = new URL(l, window.location.href).origin, g = /* @__PURE__ */ new Set([window.location.origin]), u = c();
|
|
990
|
-
|
|
991
|
-
for (const h of i || [])
|
|
990
|
+
M(g, document.currentScript?.getAttribute("src")), M(g, u.assetBaseUrl), M(g, u.baseUrl), M(g, n ? s[n] : void 0);
|
|
991
|
+
for (const h of i || []) M(g, h);
|
|
992
992
|
if (!g.has(p)) throw new Error(`${a} runtime origin ${p} is not trusted.`);
|
|
993
993
|
return l;
|
|
994
994
|
}, b = s.GengageAssistantInjector || (s.GengageAssistantInjector = {}), m = b[e] || (b[e] = {});
|
|
@@ -1003,7 +1003,7 @@ function Gi({ accountId: e, runtimeFile: t = "runtime.js", startExport: r = "sta
|
|
|
1003
1003
|
throw delete m.loaderPromise, console.error(`[Gengage][${e}] runtime load failed`, l), l;
|
|
1004
1004
|
})), m.loaderPromise;
|
|
1005
1005
|
}
|
|
1006
|
-
function
|
|
1006
|
+
function M(e, t) {
|
|
1007
1007
|
if (t)
|
|
1008
1008
|
try {
|
|
1009
1009
|
const r = new URL(t, window.location.href);
|
|
@@ -1434,13 +1434,13 @@ function Or(e, t) {
|
|
|
1434
1434
|
}, Object.defineProperty(r[n], "__gengageActivityWrapped", { value: !0 }));
|
|
1435
1435
|
return r;
|
|
1436
1436
|
}
|
|
1437
|
-
function
|
|
1437
|
+
function Fr(e, t) {
|
|
1438
1438
|
return t ? (r) => (t.record({
|
|
1439
1439
|
kind: "beacon",
|
|
1440
1440
|
payload: r
|
|
1441
1441
|
}), e?.(r)) : e;
|
|
1442
1442
|
}
|
|
1443
|
-
function
|
|
1443
|
+
function $r(e, t) {
|
|
1444
1444
|
if (!t) return !1;
|
|
1445
1445
|
const r = window.GengageAssistantInjector?.[e], n = r?.streamTransport;
|
|
1446
1446
|
if (typeof n != "function" || n.__gengageActivityWrapped) return !1;
|
|
@@ -1471,7 +1471,7 @@ function Mr(e, t) {
|
|
|
1471
1471
|
title: "streamTransport wrapped"
|
|
1472
1472
|
}), !0;
|
|
1473
1473
|
}
|
|
1474
|
-
function
|
|
1474
|
+
function Mr({ accountId: e, collector: t, promptBaseUrl: r } = {}) {
|
|
1475
1475
|
if (!t || window.__GENGAGE_ACTIVITY_FETCH_PATCHED__) return;
|
|
1476
1476
|
window.__GENGAGE_ACTIVITY_FETCH_PATCHED__ = !0;
|
|
1477
1477
|
const n = window.fetch?.bind(window);
|
|
@@ -2427,7 +2427,7 @@ function O(e) {
|
|
|
2427
2427
|
function H(e) {
|
|
2428
2428
|
return String(e).replace(/[&<>"']/gu, (t) => t === "&" ? "&" : t === "<" ? "<" : t === ">" ? ">" : t === '"' ? """ : "'");
|
|
2429
2429
|
}
|
|
2430
|
-
function
|
|
2430
|
+
function oa({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
|
|
2431
2431
|
if (!Tn(e, t)) return {
|
|
2432
2432
|
enabled: !1,
|
|
2433
2433
|
tools: r,
|
|
@@ -2438,7 +2438,7 @@ function zi({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
|
|
|
2438
2438
|
}
|
|
2439
2439
|
};
|
|
2440
2440
|
const o = pr(e);
|
|
2441
|
-
return window.__GENGAGE_AGENTIC_DEBUG_RECORD__ = (i) => Re(o, i), window.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__ = (i) => Re(o, i), Qr(o),
|
|
2441
|
+
return window.__GENGAGE_AGENTIC_DEBUG_RECORD__ = (i) => Re(o, i), window.__GENGAGE_AGENTIC_DEBUG_RECORD_BE__ = (i) => Re(o, i), Qr(o), Mr({
|
|
2442
2442
|
accountId: e,
|
|
2443
2443
|
collector: o,
|
|
2444
2444
|
promptBaseUrl: t.agenticActivityPromptBaseUrl
|
|
@@ -2449,9 +2449,9 @@ function zi({ accountId: e, config: t = {}, tools: r, beacon: n } = {}) {
|
|
|
2449
2449
|
enabled: !0,
|
|
2450
2450
|
collector: o,
|
|
2451
2451
|
tools: Or(r, o),
|
|
2452
|
-
beacon:
|
|
2452
|
+
beacon: Fr(n, o),
|
|
2453
2453
|
record: (i) => o.record(i),
|
|
2454
|
-
wrapTransport: () =>
|
|
2454
|
+
wrapTransport: () => $r(e, o)
|
|
2455
2455
|
};
|
|
2456
2456
|
}
|
|
2457
2457
|
function Tn(e, t = {}) {
|
|
@@ -2520,7 +2520,7 @@ var An = [
|
|
|
2520
2520
|
"count",
|
|
2521
2521
|
"privacy"
|
|
2522
2522
|
];
|
|
2523
|
-
function
|
|
2523
|
+
function ia({ accountId: e, search: t, facetedSearch: r, similaritySearch: n, searchGiftOptions: o, filters: i = {}, resultContract: a = {}, limitations: s = [], extraTools: c = [] } = {}) {
|
|
2524
2524
|
return {
|
|
2525
2525
|
searchKeyword: async (f = {}, b = {}) => t(In(f, b)),
|
|
2526
2526
|
facetedSearch: typeof r == "function" ? (f = {}, b = {}) => r(qe(f, b)) : async (f = {}, b = {}) => t(qe(f, b)),
|
|
@@ -2618,7 +2618,7 @@ function ce(e) {
|
|
|
2618
2618
|
return Object.fromEntries(Object.entries(e || {}).filter(([, t]) => t != null && t !== "" && (!Array.isArray(t) || t.length)));
|
|
2619
2619
|
}
|
|
2620
2620
|
var qn = 15e3, Bn = "glov_agentic_iframe", On = "position:absolute;width:1px;height:1px;left:-9999px;top:-9999px;opacity:0;pointer-events:none;";
|
|
2621
|
-
function
|
|
2621
|
+
function aa({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName: r = t, sandbox: n = "allow-same-origin", timeoutMs: o = qn, hiddenStyle: i = On, messageType: a, parser: s, isBlockedDocument: c } = {}) {
|
|
2622
2622
|
const d = a || `gengage:agentic-iframe-scraper:${t}`;
|
|
2623
2623
|
function f(p, g = {}) {
|
|
2624
2624
|
const u = new URL(String(p), re());
|
|
@@ -2650,7 +2650,7 @@ function Wi({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
|
|
|
2650
2650
|
} catch {
|
|
2651
2651
|
}
|
|
2652
2652
|
return x.style && (x.style.cssText = i), new Promise((C) => {
|
|
2653
|
-
let
|
|
2653
|
+
let $ = !1;
|
|
2654
2654
|
const z = typeof v?.addEventListener == "function" && typeof v?.removeEventListener == "function", ut = v.setTimeout(() => {
|
|
2655
2655
|
ee({
|
|
2656
2656
|
attempted: !0,
|
|
@@ -2665,7 +2665,7 @@ function Wi({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
|
|
|
2665
2665
|
v.clearTimeout(ut), z && v.removeEventListener("message", ke), typeof x.remove == "function" && x.remove();
|
|
2666
2666
|
}
|
|
2667
2667
|
function ee(A) {
|
|
2668
|
-
|
|
2668
|
+
$ || ($ = !0, dt(), C(A));
|
|
2669
2669
|
}
|
|
2670
2670
|
function ke(A) {
|
|
2671
2671
|
if (A.source && x.contentWindow && A.source !== x.contentWindow) return;
|
|
@@ -2723,24 +2723,24 @@ function Wi({ markerParam: e = Bn, markerValue: t = "agentic-scraper", frameName
|
|
|
2723
2723
|
postCurrentDocument: l
|
|
2724
2724
|
};
|
|
2725
2725
|
}
|
|
2726
|
-
function
|
|
2726
|
+
function sa(e, { accountId: t, type: r = "agenticSearchFrame" } = {}) {
|
|
2727
2727
|
return e?.isScraperFrame?.() ? (t && globalThis.window && (globalThis.window.GengageAssistantInjector ||= {}, globalThis.window.GengageAssistantInjector[t] ||= { type: r }), !0) : !1;
|
|
2728
2728
|
}
|
|
2729
2729
|
function re() {
|
|
2730
2730
|
return globalThis.window?.location?.origin || globalThis.location?.origin || "https://example.invalid";
|
|
2731
2731
|
}
|
|
2732
|
-
function
|
|
2732
|
+
function ca({ rootUrl: e, successMessage: t, alreadyCurrentPageMessage: r = t, missingUrlMessage: n = "Ürün sayfasını açmak için ürün bağlantısı gerekiyor." } = {}) {
|
|
2733
2733
|
const o = new URL(e).origin;
|
|
2734
2734
|
return async function(a = {}) {
|
|
2735
|
-
const s = a.product || {}, c =
|
|
2736
|
-
return c ?
|
|
2735
|
+
const s = a.product || {}, c = Fn(a.url || a.productUrl || s.url, e, o), d = a.sku || s.sku || null;
|
|
2736
|
+
return c ? Mn(c) ? {
|
|
2737
2737
|
ok: !0,
|
|
2738
2738
|
sku: d,
|
|
2739
2739
|
url: c,
|
|
2740
2740
|
method: "already-current-page",
|
|
2741
2741
|
alreadyCurrentPage: !0,
|
|
2742
2742
|
message: r || t
|
|
2743
|
-
} : (
|
|
2743
|
+
} : ($n(c), {
|
|
2744
2744
|
ok: !0,
|
|
2745
2745
|
sku: d,
|
|
2746
2746
|
url: c,
|
|
@@ -2754,7 +2754,7 @@ function Ki({ rootUrl: e, successMessage: t, alreadyCurrentPageMessage: r = t, m
|
|
|
2754
2754
|
};
|
|
2755
2755
|
};
|
|
2756
2756
|
}
|
|
2757
|
-
function
|
|
2757
|
+
function Fn(e, t, r = new URL(t).origin) {
|
|
2758
2758
|
if (!e) return "";
|
|
2759
2759
|
try {
|
|
2760
2760
|
const n = new URL(e, t);
|
|
@@ -2763,7 +2763,7 @@ function $n(e, t, r = new URL(t).origin) {
|
|
|
2763
2763
|
return "";
|
|
2764
2764
|
}
|
|
2765
2765
|
}
|
|
2766
|
-
function
|
|
2766
|
+
function $n(e) {
|
|
2767
2767
|
if (typeof document > "u") {
|
|
2768
2768
|
window.location.href = e;
|
|
2769
2769
|
return;
|
|
@@ -2773,7 +2773,7 @@ function Mn(e) {
|
|
|
2773
2773
|
window.location.href !== e && window.location.assign(e);
|
|
2774
2774
|
}, 0);
|
|
2775
2775
|
}
|
|
2776
|
-
function
|
|
2776
|
+
function Mn(e) {
|
|
2777
2777
|
try {
|
|
2778
2778
|
const t = new URL(globalThis.window?.location?.href || "", e), r = new URL(e, t.href);
|
|
2779
2779
|
return t.hash = "", r.hash = "", t.href === r.href;
|
|
@@ -2796,7 +2796,7 @@ function Dn({ accountId: e, supplied: t = [], pageProduct: r = null, listingProd
|
|
|
2796
2796
|
limit: i
|
|
2797
2797
|
});
|
|
2798
2798
|
}
|
|
2799
|
-
function
|
|
2799
|
+
function la({ accountId: e, rootUrl: t, getProduct: r, getProducts: n, getStoredPanelProducts: o, limit: i = 4 } = {}) {
|
|
2800
2800
|
return async function(s = {}) {
|
|
2801
2801
|
return {
|
|
2802
2802
|
accountId: e,
|
|
@@ -2845,7 +2845,7 @@ var N = {
|
|
|
2845
2845
|
blog: /\b(?:blog|journal|guide|article|editorial|inspiration|rehber|makale|ilham|icerik|içerik)\b/iu,
|
|
2846
2846
|
category: /\b(?:category|collection|department|kategori|koleksiyon|reyon)\b/iu
|
|
2847
2847
|
};
|
|
2848
|
-
function
|
|
2848
|
+
function ua({ accountId: e, getPageType: t, getProduct: r, getProducts: n, normalizeProduct: o = (i) => i }) {
|
|
2849
2849
|
return {
|
|
2850
2850
|
scanSite: (i = {}) => Vn({
|
|
2851
2851
|
accountId: e,
|
|
@@ -2859,7 +2859,7 @@ function Yi({ accountId: e, getPageType: t, getProduct: r, getProducts: n, norma
|
|
|
2859
2859
|
discoverSiteContent: (i = {}) => ct(i, e),
|
|
2860
2860
|
runSiteCommand: (i = {}) => Jn(i),
|
|
2861
2861
|
describeVisualContext: (i = {}) => Yn(i, e),
|
|
2862
|
-
inspectProductSurface:
|
|
2862
|
+
inspectProductSurface: yt({
|
|
2863
2863
|
accountId: e,
|
|
2864
2864
|
getPageType: t,
|
|
2865
2865
|
getProduct: r,
|
|
@@ -2965,7 +2965,7 @@ function Zn(e) {
|
|
|
2965
2965
|
}), {
|
|
2966
2966
|
ok: !0,
|
|
2967
2967
|
command: "scroll_to_text",
|
|
2968
|
-
label:
|
|
2968
|
+
label: F(r),
|
|
2969
2969
|
message: "Scrolled to the matching page area.",
|
|
2970
2970
|
privacy: R()
|
|
2971
2971
|
}) : {
|
|
@@ -2994,7 +2994,7 @@ function Qn(e) {
|
|
|
2994
2994
|
command: "click_visible_text",
|
|
2995
2995
|
message: "No safe visible clickable control found."
|
|
2996
2996
|
};
|
|
2997
|
-
const n =
|
|
2997
|
+
const n = F(r);
|
|
2998
2998
|
return J.test(n) ? {
|
|
2999
2999
|
ok: !1,
|
|
3000
3000
|
blocked: !0,
|
|
@@ -3043,16 +3043,16 @@ function eo(e) {
|
|
|
3043
3043
|
}
|
|
3044
3044
|
function to(e) {
|
|
3045
3045
|
return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).map((t) => ({
|
|
3046
|
-
label:
|
|
3046
|
+
label: F(t),
|
|
3047
3047
|
tag: t.tagName?.toLowerCase(),
|
|
3048
3048
|
role: t.getAttribute?.("role") || null,
|
|
3049
3049
|
href: lt(t),
|
|
3050
|
-
safeClick: !J.test(
|
|
3050
|
+
safeClick: !J.test(F(t))
|
|
3051
3051
|
})).filter((t) => t.label).filter(X((t) => `${t.tag}:${t.label}:${t.href || ""}`)).slice(0, e);
|
|
3052
3052
|
}
|
|
3053
3053
|
function ro(e) {
|
|
3054
3054
|
return [...document.querySelectorAll('a[href],button,[role="button"],summary')].filter(j).map((t) => {
|
|
3055
|
-
const r =
|
|
3055
|
+
const r = F(t), n = lt(t), o = no([
|
|
3056
3056
|
r,
|
|
3057
3057
|
n,
|
|
3058
3058
|
le(t)
|
|
@@ -3118,7 +3118,7 @@ function co(e) {
|
|
|
3118
3118
|
return r;
|
|
3119
3119
|
}
|
|
3120
3120
|
function lo(e) {
|
|
3121
|
-
return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).find((t) =>
|
|
3121
|
+
return [...document.querySelectorAll('button,a,[role="button"],summary,input[type="button"],input[type="submit"]')].filter(j).find((t) => F(t).toLocaleLowerCase("tr-TR").includes(e.toLocaleLowerCase("tr-TR")));
|
|
3122
3122
|
}
|
|
3123
3123
|
function uo(e) {
|
|
3124
3124
|
const t = be(e, {
|
|
@@ -3127,7 +3127,7 @@ function uo(e) {
|
|
|
3127
3127
|
})[0];
|
|
3128
3128
|
return t ? [...document.querySelectorAll("body *")].filter(j).find((r) => _(r.textContent).includes(t.snippet.slice(0, 24))) : null;
|
|
3129
3129
|
}
|
|
3130
|
-
function
|
|
3130
|
+
function F(e) {
|
|
3131
3131
|
return e ? P(_(e.getAttribute?.("aria-label") || e.getAttribute?.("title") || e.getAttribute?.("alt") || e.value || e.textContent || "")).slice(0, 90) : "";
|
|
3132
3132
|
}
|
|
3133
3133
|
function le(e) {
|
|
@@ -3249,124 +3249,138 @@ function X(e) {
|
|
|
3249
3249
|
};
|
|
3250
3250
|
}
|
|
3251
3251
|
export {
|
|
3252
|
-
|
|
3253
|
-
|
|
3254
|
-
|
|
3255
|
-
|
|
3256
|
-
|
|
3257
|
-
|
|
3258
|
-
|
|
3259
|
-
|
|
3252
|
+
ri as AgentError,
|
|
3253
|
+
mt as ContextStore,
|
|
3254
|
+
Co as FALLBACK_STATUS,
|
|
3255
|
+
li as __resetAllCartCoalescersForTesting,
|
|
3256
|
+
xi as __resetAllPdpHydratorsForTesting,
|
|
3257
|
+
Fi as action,
|
|
3258
|
+
Zo as actionButtonsUiSpec,
|
|
3259
|
+
Bo as alignProductsToTable,
|
|
3260
|
+
Ho as anonymousRequestText,
|
|
3261
|
+
ji as applyCompactionResult,
|
|
3262
|
+
Mi as beErrorToAgentError,
|
|
3260
3263
|
vr as buildActivityVisualization,
|
|
3264
|
+
bi as buildCompactionRequest,
|
|
3265
|
+
qi as buildPdpFollowupSteps,
|
|
3261
3266
|
yo as buildPhotoSimilarityProfile,
|
|
3262
3267
|
wo as buildProductSimilarityProfile,
|
|
3263
3268
|
vo as buildSimilarityQueries,
|
|
3269
|
+
Ei as buildToolUiSteps,
|
|
3264
3270
|
Ze as canUseModuleWorker,
|
|
3265
|
-
|
|
3266
|
-
|
|
3267
|
-
|
|
3268
|
-
|
|
3269
|
-
|
|
3270
|
-
|
|
3271
|
-
|
|
3271
|
+
wt as caughtToStreamError,
|
|
3272
|
+
fi as coalesceAddToCart,
|
|
3273
|
+
qo as compactAccountConfig,
|
|
3274
|
+
ei as compactContextProducts,
|
|
3275
|
+
Go as compactObject,
|
|
3276
|
+
ii as compactProductSurfaceForLlm,
|
|
3277
|
+
Xo as comparisonResultForUi,
|
|
3278
|
+
Io as comparisonUiSpec,
|
|
3272
3279
|
fr as createActivityCollector,
|
|
3273
3280
|
Ge as createBrowserMemory,
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3281
|
+
ra as createDiagnosticsTool,
|
|
3282
|
+
Ki as createEndpointCachePolicies,
|
|
3283
|
+
Ji as createEndpointHandlers,
|
|
3284
|
+
Jo as createFlow,
|
|
3285
|
+
ia as createGssToolAliases,
|
|
3286
|
+
aa as createIframeScraper,
|
|
3280
3287
|
kt as createInjectorAdapter,
|
|
3281
|
-
|
|
3288
|
+
wi as createLocalRefStore,
|
|
3282
3289
|
St as createMainThreadInjectorAdapter,
|
|
3283
3290
|
ir as createModuleWorker,
|
|
3284
|
-
|
|
3285
|
-
|
|
3286
|
-
|
|
3287
|
-
|
|
3288
|
-
|
|
3289
|
-
|
|
3290
|
-
|
|
3291
|
-
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3291
|
+
ca as createOpenProductPageTool,
|
|
3292
|
+
Vo as createPrivacyHelpers,
|
|
3293
|
+
yt as createProductSurfaceInspector,
|
|
3294
|
+
vi as createReadPageStep,
|
|
3295
|
+
ta as createReadPageTool,
|
|
3296
|
+
la as createResolveProductsTool,
|
|
3297
|
+
ua as createSiteAwarenessTools,
|
|
3298
|
+
Do as declarativeBeOpCache,
|
|
3299
|
+
Hi as defaultPiiPatternPack,
|
|
3300
|
+
Ao as defaultPiiPatterns,
|
|
3301
|
+
ui as done,
|
|
3302
|
+
Ko as elapsedMs,
|
|
3296
3303
|
ar as endpointStableKey,
|
|
3297
|
-
|
|
3298
|
-
|
|
3304
|
+
pi as error,
|
|
3305
|
+
yi as fallbackStatus,
|
|
3299
3306
|
rn as filterActivityEntries,
|
|
3300
3307
|
_i as firstArrayValue,
|
|
3301
3308
|
vn as formatJsonHtml,
|
|
3302
3309
|
pr as getOrCreateActivityCollector,
|
|
3303
3310
|
yr as groupForEntry,
|
|
3304
3311
|
Nn as gssSearchCapabilities,
|
|
3305
|
-
|
|
3306
|
-
|
|
3307
|
-
|
|
3308
|
-
|
|
3309
|
-
|
|
3310
|
-
|
|
3311
|
-
|
|
3312
|
-
|
|
3313
|
-
|
|
3314
|
-
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3312
|
+
Po as homePanelReset,
|
|
3313
|
+
ai as httpErrorToAgentError,
|
|
3314
|
+
zo as inputHashCachePolicy,
|
|
3315
|
+
Wo as inspectProductSurface,
|
|
3316
|
+
Mr as installActivityFetchPatch,
|
|
3317
|
+
ea as installBrowserTools,
|
|
3318
|
+
Wi as installFetchTransportBridge,
|
|
3319
|
+
sa as installIframeScraperBypass,
|
|
3320
|
+
oa as installLocalAgenticActivityDebug,
|
|
3321
|
+
$o as isFallbackStatus,
|
|
3322
|
+
Mo as isRef,
|
|
3323
|
+
Zi as jsonResponse,
|
|
3324
|
+
Bi as llmCacheKey,
|
|
3325
|
+
Ro as mergeProductSurfaceEvidence,
|
|
3326
|
+
Ci as mergeRoundProducts,
|
|
3327
|
+
Pi as metadata,
|
|
3328
|
+
Vi as mountAccount,
|
|
3321
3329
|
Qr as mountActivityOverlay,
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3330
|
+
$n as navigateSameTab,
|
|
3331
|
+
Yi as ndjsonResponse,
|
|
3332
|
+
Qo as normalizeComparisonTable,
|
|
3325
3333
|
mr as normalizeEntry,
|
|
3326
|
-
|
|
3327
|
-
|
|
3334
|
+
Ai as normalizeProduct,
|
|
3335
|
+
Fn as normalizeSameOriginUrl,
|
|
3328
3336
|
xo as normalizeSimilarityText,
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3337
|
+
jo as nowIso,
|
|
3338
|
+
Lo as plainMessageContent,
|
|
3339
|
+
Oo as productDetailsUiSpec,
|
|
3340
|
+
Ti as productFactsKey,
|
|
3341
|
+
Ni as productSkuKey,
|
|
3342
|
+
Di as productSurfaceReviewText,
|
|
3343
|
+
Li as productsUiSpec,
|
|
3336
3344
|
ko as rankSimilarProducts,
|
|
3337
3345
|
_o as rankSimilarProductsAsync,
|
|
3338
3346
|
Re as recordBeDebugPayload,
|
|
3339
|
-
|
|
3340
|
-
|
|
3341
|
-
|
|
3342
|
-
|
|
3347
|
+
Yo as redactPii,
|
|
3348
|
+
Uo as requestText,
|
|
3349
|
+
Xi as resolveBeUrl,
|
|
3350
|
+
ki as resolveFlow,
|
|
3343
3351
|
Dn as resolveProductCandidates,
|
|
3344
|
-
|
|
3345
|
-
|
|
3346
|
-
|
|
3352
|
+
ti as retailAnonymizeMessages,
|
|
3353
|
+
$i as retailAnonymousRequestText,
|
|
3354
|
+
zi as retailRedactPii,
|
|
3347
3355
|
gi as routeFlowParams,
|
|
3348
|
-
|
|
3356
|
+
mi as routeSkuList,
|
|
3349
3357
|
So as scoreSimilarityCandidate,
|
|
3358
|
+
Ii as searchFollowUpPills,
|
|
3350
3359
|
hr as sectionForKind,
|
|
3351
|
-
|
|
3360
|
+
Qi as setAssistantHostVisible,
|
|
3352
3361
|
br as severityForEntry,
|
|
3362
|
+
ni as shouldCompact,
|
|
3353
3363
|
Tn as shouldInstallActivityDebug,
|
|
3364
|
+
Ri as singleFlight,
|
|
3354
3365
|
ue as stableKey,
|
|
3355
|
-
|
|
3356
|
-
|
|
3366
|
+
na as startLazyRuntimeLoader,
|
|
3367
|
+
Gi as stickyContextKey,
|
|
3357
3368
|
Y as summarizeDebugState,
|
|
3358
3369
|
ae as summarizePanelState,
|
|
3359
3370
|
Qe as summarizeUiSpec,
|
|
3360
|
-
|
|
3361
|
-
|
|
3371
|
+
Si as textChunk,
|
|
3372
|
+
oi as textKey,
|
|
3362
3373
|
Eo as tokenizeSimilarityText,
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3374
|
+
Ui as trimProductFactsCore,
|
|
3375
|
+
ci as trimProductFactsListCore,
|
|
3376
|
+
hi as uiSpec,
|
|
3366
3377
|
Gn as uniqueProductsBySku,
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3378
|
+
di as validateToolArgs,
|
|
3379
|
+
Fo as withAccountConfig,
|
|
3380
|
+
No as withDeclarativeBeOpCache,
|
|
3381
|
+
si as withSimilarsAppend,
|
|
3382
|
+
Fr as wrapActivityBeacon,
|
|
3370
3383
|
Or as wrapActivityTools,
|
|
3371
|
-
|
|
3384
|
+
$r as wrapActivityTransport,
|
|
3385
|
+
Oi as wrapResolveProductsWithPdpHydration
|
|
3372
3386
|
};
|