@gengage/assistant-fe 0.6.1 → 0.6.3
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/adaptor/fetch-bridge.d.ts +3 -2
- package/dist/agentic/index.d.ts +1 -0
- package/dist/agentic/index.js +347 -257
- package/dist/agentic/similarity.d.ts +77 -0
- package/dist/agentic/types.d.ts +2 -0
- package/dist/agentic/worker/be-client.d.ts +2 -1
- package/dist/agentic/worker.d.ts +1 -0
- package/dist/agentic/worker.js +65 -57
- package/dist/agentic.iife.js +5 -5
- package/dist/{api-paths-C4WzXzyY.js → api-paths-Bidgft9p.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/transport.d.ts +7 -0
- package/dist/{common-DstAcheX.js → common-DWDSD8LC.js} +1 -1
- package/dist/common.js +5 -5
- package/dist/{connection-warning-Ddr91Y9x.js → connection-warning-BSO1YDm6.js} +1 -1
- package/dist/{fastIntent-XtUvISni.js → fastIntent-9jfo-OnO.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-CcA_r8pw.js → runtime-B-25I0p6.js} +3 -3
- package/dist/{runtime-C66Wp6OR.js → runtime-B-lBAc6Z.js} +3 -3
- package/dist/{runtime-DJMUL882.js → runtime-BivTyMiH.js} +3 -3
- package/dist/{simbut-B6L3fwI7.js → simbut-DytP3AWT.js} +1 -1
- package/dist/simbut.iife.js +1 -1
- package/dist/simbut.js +1 -1
- package/dist/{beauty-consulting-turn-BmPXbkQg.js → similarity-DcfZ0CKT.js} +515 -295
- package/dist/{simrel-BB4Jrr32.js → simrel-CJp2qMtU.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-B3Oq8pjs.js → widget-base-UJbh-z_5.js} +1 -1
- package/package.json +1 -1
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
function
|
|
1
|
+
function it(t) {
|
|
2
2
|
return !!t && typeof t == "object" && t.type === "rpc.result";
|
|
3
3
|
}
|
|
4
|
-
function
|
|
4
|
+
function at(t) {
|
|
5
5
|
return !!t && typeof t == "object" && t.type === "rpc.req";
|
|
6
6
|
}
|
|
7
|
-
function
|
|
7
|
+
function ie(t = self) {
|
|
8
8
|
let e = 1;
|
|
9
9
|
const n = /* @__PURE__ */ new Map();
|
|
10
10
|
return t.addEventListener("message", (r) => {
|
|
11
11
|
const o = r.data;
|
|
12
|
-
if (!
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
12
|
+
if (!it(o)) return;
|
|
13
|
+
const i = n.get(o.rpcId);
|
|
14
|
+
if (i) {
|
|
15
15
|
if (n.delete(o.rpcId), o.ok === !1) {
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
const a = typeof o.error == "object" ? o.error?.message : o.error;
|
|
17
|
+
i.reject(new Error(a || "RPC failed"));
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
|
|
20
|
+
i.resolve(o.value);
|
|
21
21
|
}
|
|
22
|
-
}), function(o,
|
|
22
|
+
}), function(o, i, a) {
|
|
23
23
|
const s = e++;
|
|
24
24
|
return t.postMessage({
|
|
25
25
|
type: "rpc.req",
|
|
26
26
|
rpcId: s,
|
|
27
27
|
method: o,
|
|
28
|
-
payload:
|
|
29
|
-
},
|
|
28
|
+
payload: i
|
|
29
|
+
}, a || []), new Promise((c, u) => {
|
|
30
30
|
n.set(s, {
|
|
31
31
|
resolve: (l) => c(l),
|
|
32
32
|
reject: u
|
|
@@ -34,19 +34,19 @@ function Bt(t = self) {
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
|
-
function
|
|
37
|
+
function ae({ worker: t, tools: e = {}, beacon: n, memory: r = sessionStorage }) {
|
|
38
38
|
t.addEventListener("message", (o) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
39
|
+
const i = o.data;
|
|
40
|
+
at(i) && st(t, i, {
|
|
41
41
|
tools: e,
|
|
42
42
|
beacon: n,
|
|
43
43
|
memory: r
|
|
44
44
|
});
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
|
-
async function
|
|
47
|
+
async function st(t, e, n) {
|
|
48
48
|
try {
|
|
49
|
-
const r = await
|
|
49
|
+
const r = await dt(e.method, e.payload, n);
|
|
50
50
|
t.postMessage({
|
|
51
51
|
type: "rpc.result",
|
|
52
52
|
rpcId: e.rpcId,
|
|
@@ -62,70 +62,70 @@ async function Y(t, e, n) {
|
|
|
62
62
|
});
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
|
-
function
|
|
65
|
+
function ct(t) {
|
|
66
66
|
if (t && typeof t == "object" && typeof t.name == "string") return t;
|
|
67
67
|
throw new Error("tool.invoke requires { name, input }");
|
|
68
68
|
}
|
|
69
|
-
function
|
|
69
|
+
function ut(t) {
|
|
70
70
|
if (t && typeof t == "object" && t.key !== void 0) return t;
|
|
71
71
|
throw new Error("memory.get requires { key }");
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function lt(t) {
|
|
74
74
|
if (t && typeof t == "object" && t.key !== void 0) return t;
|
|
75
75
|
throw new Error("memory.set requires { key }");
|
|
76
76
|
}
|
|
77
|
-
async function
|
|
77
|
+
async function dt(t, e, { tools: n, beacon: r, memory: o }) {
|
|
78
78
|
if (t === "tool.invoke") {
|
|
79
|
-
const { name:
|
|
80
|
-
if (typeof s != "function") throw new Error(`Unknown tool: ${
|
|
81
|
-
return s(
|
|
79
|
+
const { name: i, input: a } = ct(e), s = n[i];
|
|
80
|
+
if (typeof s != "function") throw new Error(`Unknown tool: ${i}`);
|
|
81
|
+
return s(a);
|
|
82
82
|
}
|
|
83
83
|
if (t === "beacon.send")
|
|
84
84
|
return r?.(e), { sent: !0 };
|
|
85
85
|
if (t === "memory.get") {
|
|
86
|
-
const { key:
|
|
87
|
-
return
|
|
86
|
+
const { key: i } = ut(e), a = o.getItem(String(i));
|
|
87
|
+
return a ? JSON.parse(a) : null;
|
|
88
88
|
}
|
|
89
89
|
if (t === "memory.set") {
|
|
90
|
-
const { key:
|
|
91
|
-
return o.setItem(String(
|
|
90
|
+
const { key: i, value: a } = lt(e);
|
|
91
|
+
return o.setItem(String(i), JSON.stringify(a ?? null)), { ok: !0 };
|
|
92
92
|
}
|
|
93
93
|
throw new Error(`Unknown RPC method: ${t}`);
|
|
94
94
|
}
|
|
95
|
-
function
|
|
95
|
+
function ft() {
|
|
96
96
|
return (/* @__PURE__ */ new Date()).toISOString();
|
|
97
97
|
}
|
|
98
|
-
function
|
|
98
|
+
function B(t) {
|
|
99
99
|
return Math.max(0, Math.round(performance.now() - t));
|
|
100
100
|
}
|
|
101
|
-
function
|
|
101
|
+
function A(t) {
|
|
102
102
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
103
103
|
}
|
|
104
|
-
function
|
|
105
|
-
const { accountId: e, locale: n = "en-GB", parentUrl: r = "", threadId: o, incomingContext:
|
|
104
|
+
function pt(t) {
|
|
105
|
+
const { accountId: e, locale: n = "en-GB", parentUrl: r = "", threadId: o, incomingContext: i } = t, a = A(i) ? i : {}, s = A(a.thread) ? a.thread : {}, c = A(a.panel) ? a.panel : {}, u = A(a.meta) ? a.meta : {}, l = G(a.messages), d = {
|
|
106
106
|
id: String(o || s.id || self.crypto.randomUUID()),
|
|
107
|
-
started_at: String(s.started_at ||
|
|
108
|
-
extensions:
|
|
109
|
-
},
|
|
107
|
+
started_at: String(s.started_at || ft()),
|
|
108
|
+
extensions: A(s.extensions) ? { ...s.extensions } : {}
|
|
109
|
+
}, p = String(u.locale || n), m = String(u.parentUrl || r || typeof self < "u" && self.location?.href || "");
|
|
110
110
|
return {
|
|
111
111
|
panel: { ...c },
|
|
112
112
|
messages: l,
|
|
113
113
|
thread: d,
|
|
114
114
|
meta: {
|
|
115
|
-
locale:
|
|
116
|
-
parentUrl:
|
|
115
|
+
locale: p,
|
|
116
|
+
parentUrl: m,
|
|
117
117
|
accountId: e
|
|
118
118
|
}
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
|
-
function
|
|
122
|
-
const n =
|
|
121
|
+
function mt(t, e) {
|
|
122
|
+
const n = G([e])[0];
|
|
123
123
|
return n ? {
|
|
124
124
|
...t,
|
|
125
125
|
messages: [...t.messages, n].slice(-50)
|
|
126
126
|
} : t;
|
|
127
127
|
}
|
|
128
|
-
function
|
|
128
|
+
function G(t) {
|
|
129
129
|
return Array.isArray(t) ? t.map((e) => {
|
|
130
130
|
const n = e?.role;
|
|
131
131
|
return {
|
|
@@ -134,28 +134,28 @@ function U(t) {
|
|
|
134
134
|
};
|
|
135
135
|
}).filter((e) => (e.role === "user" || e.role === "assistant") && !!e.content).slice(-50) : [];
|
|
136
136
|
}
|
|
137
|
-
var
|
|
138
|
-
async function
|
|
137
|
+
var yt = "gengage:agent:context:";
|
|
138
|
+
async function gt({ accountId: t, threadId: e, rpc: n }) {
|
|
139
139
|
const r = await n("memory.get", {
|
|
140
140
|
tier: "session",
|
|
141
|
-
key:
|
|
141
|
+
key: Q(t, e)
|
|
142
142
|
});
|
|
143
143
|
return r && typeof r == "object" && !Array.isArray(r) ? r : {};
|
|
144
144
|
}
|
|
145
|
-
async function
|
|
145
|
+
async function ht({ accountId: t, threadId: e, extensions: n, rpc: r }) {
|
|
146
146
|
await r("memory.set", {
|
|
147
147
|
tier: "session",
|
|
148
|
-
key:
|
|
148
|
+
key: Q(t, e),
|
|
149
149
|
value: { thread: { extensions: n } }
|
|
150
150
|
});
|
|
151
151
|
}
|
|
152
|
-
function
|
|
153
|
-
return `${
|
|
152
|
+
function Q(t, e) {
|
|
153
|
+
return `${yt}${t}:${e}`;
|
|
154
154
|
}
|
|
155
|
-
function
|
|
155
|
+
function g(t) {
|
|
156
156
|
return typeof t == "object" && t !== null && !Array.isArray(t);
|
|
157
157
|
}
|
|
158
|
-
var
|
|
158
|
+
var se = class {
|
|
159
159
|
#t = /* @__PURE__ */ new Map();
|
|
160
160
|
#e;
|
|
161
161
|
#r;
|
|
@@ -167,23 +167,23 @@ var Ut = class {
|
|
|
167
167
|
async load(t) {
|
|
168
168
|
const e = t?.meta?.threadId || t?.session_id || t?.sessionId, n = String(e || "default"), r = this.#t.get(n);
|
|
169
169
|
if (r) return r;
|
|
170
|
-
const o = await
|
|
170
|
+
const o = await gt({
|
|
171
171
|
accountId: this.#e,
|
|
172
172
|
threadId: n,
|
|
173
173
|
rpc: this.#n
|
|
174
|
-
}),
|
|
174
|
+
}), i = pt({
|
|
175
175
|
accountId: this.#e,
|
|
176
176
|
locale: t?.locale || this.#r,
|
|
177
177
|
parentUrl: this.#o,
|
|
178
178
|
threadId: n,
|
|
179
|
-
incomingContext:
|
|
179
|
+
incomingContext: kt(o, t?.context)
|
|
180
180
|
});
|
|
181
|
-
return this.#t.set(n,
|
|
181
|
+
return this.#t.set(n, i), i;
|
|
182
182
|
}
|
|
183
183
|
patch(t, e) {
|
|
184
184
|
const n = String(t || "default"), r = this.#t.get(n);
|
|
185
185
|
if (!r) return null;
|
|
186
|
-
const o =
|
|
186
|
+
const o = Y(r, typeof e == "function" ? e(r) : e);
|
|
187
187
|
return this.#t.set(n, o), o;
|
|
188
188
|
}
|
|
189
189
|
appendUserMessage(t, e) {
|
|
@@ -191,7 +191,7 @@ var Ut = class {
|
|
|
191
191
|
if (!e) return this.#t.get(n) ?? null;
|
|
192
192
|
const r = this.#t.get(n);
|
|
193
193
|
if (!r) return null;
|
|
194
|
-
const o =
|
|
194
|
+
const o = mt(r, {
|
|
195
195
|
role: "user",
|
|
196
196
|
content: e
|
|
197
197
|
});
|
|
@@ -199,7 +199,7 @@ var Ut = class {
|
|
|
199
199
|
}
|
|
200
200
|
async commit(t) {
|
|
201
201
|
const e = String(t || "default"), n = this.#t.get(e);
|
|
202
|
-
return n ? (await
|
|
202
|
+
return n ? (await ht({
|
|
203
203
|
accountId: this.#e,
|
|
204
204
|
threadId: e,
|
|
205
205
|
extensions: n.thread.extensions,
|
|
@@ -207,21 +207,21 @@ var Ut = class {
|
|
|
207
207
|
}), n) : null;
|
|
208
208
|
}
|
|
209
209
|
};
|
|
210
|
-
function
|
|
211
|
-
return !
|
|
210
|
+
function kt(t, e) {
|
|
211
|
+
return !g(t) && !g(e) ? {} : Y(g(t) ? t : {}, g(e) ? e : {});
|
|
212
212
|
}
|
|
213
|
-
function
|
|
214
|
-
if (!
|
|
215
|
-
const n = t, r = e, o =
|
|
213
|
+
function Y(t, e) {
|
|
214
|
+
if (!g(e)) return t;
|
|
215
|
+
const n = t, r = e, o = g(n.panel) ? n.panel : {}, i = g(r.panel) ? r.panel : {}, a = g(n.thread) ? n.thread : {}, s = g(r.thread) ? r.thread : {}, c = g(a.extensions) ? a.extensions : {}, u = g(s.extensions) ? s.extensions : {}, l = g(n.meta) ? n.meta : {}, d = g(r.meta) ? r.meta : {};
|
|
216
216
|
return {
|
|
217
217
|
...t,
|
|
218
218
|
...e,
|
|
219
219
|
panel: {
|
|
220
220
|
...o,
|
|
221
|
-
...
|
|
221
|
+
...i
|
|
222
222
|
},
|
|
223
223
|
thread: {
|
|
224
|
-
...
|
|
224
|
+
...a,
|
|
225
225
|
...s,
|
|
226
226
|
extensions: {
|
|
227
227
|
...c,
|
|
@@ -235,51 +235,51 @@ function D(t, e) {
|
|
|
235
235
|
messages: Array.isArray(r.messages) ? r.messages.slice(-50) : t.messages ?? []
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
|
-
function
|
|
238
|
+
function X(t) {
|
|
239
239
|
const e = String.fromCharCode(...t);
|
|
240
240
|
return btoa(e).replace(/\+/gu, "-").replace(/\//gu, "_").replace(/=+$/u, "");
|
|
241
241
|
}
|
|
242
|
-
function
|
|
243
|
-
return
|
|
242
|
+
function z(t) {
|
|
243
|
+
return X(new TextEncoder().encode(JSON.stringify(t)));
|
|
244
244
|
}
|
|
245
|
-
async function
|
|
245
|
+
async function wt({ accountId: t, devJwtSecret: e, ttlS: n = 300 }) {
|
|
246
246
|
if (!e) throw new Error("devJwtSecret is required for local agent mode.");
|
|
247
|
-
const r = Math.floor(Date.now() / 1e3), o = `${
|
|
247
|
+
const r = Math.floor(Date.now() / 1e3), o = `${z({
|
|
248
248
|
alg: "HS256",
|
|
249
249
|
typ: "JWT"
|
|
250
|
-
})}.${
|
|
250
|
+
})}.${z({
|
|
251
251
|
sub: t,
|
|
252
252
|
iat: r,
|
|
253
253
|
exp: r + n,
|
|
254
254
|
scope: "invoke",
|
|
255
255
|
jti: crypto.randomUUID?.() || `${r}-${Math.random()}`
|
|
256
|
-
})}`,
|
|
256
|
+
})}`, i = await crypto.subtle.importKey("raw", new TextEncoder().encode(e), {
|
|
257
257
|
name: "HMAC",
|
|
258
258
|
hash: "SHA-256"
|
|
259
|
-
}, !1, ["sign"]),
|
|
260
|
-
return `${o}.${
|
|
259
|
+
}, !1, ["sign"]), a = await crypto.subtle.sign("HMAC", i, new TextEncoder().encode(o));
|
|
260
|
+
return `${o}.${X(new Uint8Array(a))}`;
|
|
261
261
|
}
|
|
262
|
-
function
|
|
263
|
-
let
|
|
262
|
+
function bt({ accountId: t, devJwtSecret: e, tokenBrokerUrl: n, tokenBrokerAudience: r, refreshSkewS: o = 30, fetchImpl: i = fetch }) {
|
|
263
|
+
let a = null;
|
|
264
264
|
return async ({ signal: s, parentUrl: c } = {}) => {
|
|
265
|
-
if (e) return
|
|
265
|
+
if (e) return wt({
|
|
266
266
|
accountId: t,
|
|
267
267
|
devJwtSecret: e
|
|
268
268
|
});
|
|
269
269
|
if (!n) throw new Error("tokenBrokerUrl is required for production agent mode.");
|
|
270
270
|
const u = Math.floor(Date.now() / 1e3);
|
|
271
|
-
return
|
|
271
|
+
return a?.token && a.expiresAtS - o > u || (a = await _t({
|
|
272
272
|
accountId: t,
|
|
273
273
|
tokenBrokerUrl: n,
|
|
274
274
|
tokenBrokerAudience: r,
|
|
275
275
|
parentUrl: c,
|
|
276
276
|
signal: s,
|
|
277
|
-
fetchImpl:
|
|
278
|
-
})),
|
|
277
|
+
fetchImpl: i
|
|
278
|
+
})), a.token;
|
|
279
279
|
};
|
|
280
280
|
}
|
|
281
|
-
async function
|
|
282
|
-
const
|
|
281
|
+
async function _t({ accountId: t, tokenBrokerUrl: e, tokenBrokerAudience: n, parentUrl: r, signal: o, fetchImpl: i }) {
|
|
282
|
+
const a = await i(e, {
|
|
283
283
|
method: "POST",
|
|
284
284
|
credentials: "include",
|
|
285
285
|
headers: {
|
|
@@ -294,15 +294,15 @@ async function lt({ accountId: t, tokenBrokerUrl: e, tokenBrokerAudience: n, par
|
|
|
294
294
|
}),
|
|
295
295
|
...o ? { signal: o } : {}
|
|
296
296
|
});
|
|
297
|
-
if (!
|
|
298
|
-
const s = await
|
|
297
|
+
if (!a.ok) throw new Error(`Token broker request failed (${a.status}).`);
|
|
298
|
+
const s = await a.json(), c = s?.token || s?.jwt || s?.access_token;
|
|
299
299
|
if (!c || typeof c != "string") throw new Error("Token broker response did not include a JWT.");
|
|
300
300
|
return {
|
|
301
301
|
token: c,
|
|
302
|
-
expiresAtS:
|
|
302
|
+
expiresAtS: St(s) || xt(c) || Math.floor(Date.now() / 1e3) + 300
|
|
303
303
|
};
|
|
304
304
|
}
|
|
305
|
-
function
|
|
305
|
+
function St(t) {
|
|
306
306
|
const e = t?.expiresAtS ?? t?.expires_at_s ?? t?.expiresInS ?? t?.expires_in_s;
|
|
307
307
|
if (Number.isFinite(e)) return Number(e);
|
|
308
308
|
const n = t?.expiresIn ?? t?.expires_in;
|
|
@@ -314,7 +314,7 @@ function dt(t) {
|
|
|
314
314
|
}
|
|
315
315
|
return null;
|
|
316
316
|
}
|
|
317
|
-
function
|
|
317
|
+
function xt(t) {
|
|
318
318
|
try {
|
|
319
319
|
const [, e] = t.split(".");
|
|
320
320
|
if (!e) return null;
|
|
@@ -324,7 +324,7 @@ function pt(t) {
|
|
|
324
324
|
return null;
|
|
325
325
|
}
|
|
326
326
|
}
|
|
327
|
-
var
|
|
327
|
+
var L = {
|
|
328
328
|
unauthorized: {
|
|
329
329
|
code: "auth",
|
|
330
330
|
message: "Assistant authentication failed. Please retry."
|
|
@@ -369,28 +369,28 @@ var M = {
|
|
|
369
369
|
code: "invalid_request",
|
|
370
370
|
message: "The assistant request was too large."
|
|
371
371
|
}
|
|
372
|
-
},
|
|
372
|
+
}, Z = class extends Error {
|
|
373
373
|
constructor(t, e, n = {}) {
|
|
374
374
|
super(e), this.name = "AgentError", this.code = t, this.source = n.source || "agent", n.sourceCode && (this.sourceCode = n.sourceCode), n.detail !== void 0 && (this.detail = n.detail);
|
|
375
375
|
}
|
|
376
376
|
};
|
|
377
|
-
function
|
|
378
|
-
const e = String(t?.code || "upstream_llm"), n =
|
|
379
|
-
return new
|
|
377
|
+
function tt(t) {
|
|
378
|
+
const e = String(t?.code || "upstream_llm"), n = L[e] || L.upstream_llm;
|
|
379
|
+
return new Z(n.code, n.message, {
|
|
380
380
|
source: "be",
|
|
381
381
|
sourceCode: e,
|
|
382
382
|
detail: t?.detail
|
|
383
383
|
});
|
|
384
384
|
}
|
|
385
|
-
function
|
|
385
|
+
function Tt(t, e) {
|
|
386
386
|
const n = e?.error && typeof e.error == "object" ? e.error : {};
|
|
387
|
-
return
|
|
388
|
-
code: String(n.code ||
|
|
387
|
+
return tt({
|
|
388
|
+
code: String(n.code || At(t)),
|
|
389
389
|
detail: n.detail
|
|
390
390
|
});
|
|
391
391
|
}
|
|
392
|
-
function
|
|
393
|
-
return t instanceof
|
|
392
|
+
function ce(t) {
|
|
393
|
+
return t instanceof Z ? {
|
|
394
394
|
type: "error",
|
|
395
395
|
code: t.code,
|
|
396
396
|
message: t.message
|
|
@@ -400,73 +400,74 @@ function $t(t) {
|
|
|
400
400
|
message: "The assistant could not complete that request."
|
|
401
401
|
};
|
|
402
402
|
}
|
|
403
|
-
function
|
|
403
|
+
function At(t) {
|
|
404
404
|
return t === 401 ? "unauthorized" : t === 403 ? "forbidden" : t === 413 ? "payload_too_large" : t === 429 ? "rate_limited" : "internal";
|
|
405
405
|
}
|
|
406
|
-
async function
|
|
407
|
-
const
|
|
406
|
+
async function ue({ beUrl: t, accountId: e, devJwtSecret: n, tokenBrokerUrl: r, tokenBrokerAudience: o, jwtProvider: i, parentUrl: a, op: s, input: c, cacheTtlS: u, signal: l }) {
|
|
407
|
+
const d = {
|
|
408
408
|
method: "POST",
|
|
409
409
|
headers: {
|
|
410
|
-
authorization: `Bearer ${await (
|
|
410
|
+
authorization: `Bearer ${await (i || bt({
|
|
411
411
|
accountId: e,
|
|
412
412
|
devJwtSecret: n,
|
|
413
413
|
tokenBrokerUrl: r,
|
|
414
414
|
tokenBrokerAudience: o
|
|
415
415
|
}))({
|
|
416
|
-
...
|
|
417
|
-
...
|
|
416
|
+
...l ? { signal: l } : {},
|
|
417
|
+
...a ? { parentUrl: a } : {}
|
|
418
418
|
})}`,
|
|
419
419
|
"content-type": "application/json",
|
|
420
420
|
accept: "application/x-ndjson"
|
|
421
421
|
},
|
|
422
422
|
body: JSON.stringify({
|
|
423
423
|
op: s,
|
|
424
|
-
input: c
|
|
424
|
+
input: c,
|
|
425
|
+
...u !== void 0 ? { cache_ttl_s: u } : {}
|
|
425
426
|
}),
|
|
426
|
-
...
|
|
427
|
-
},
|
|
428
|
-
if (!
|
|
429
|
-
return
|
|
427
|
+
...l ? { signal: l } : {}
|
|
428
|
+
}, p = await fetch(`${String(t).replace(/\/+$/u, "")}/v1/invoke`, d);
|
|
429
|
+
if (!p.ok) throw Tt(p.status, await It(p));
|
|
430
|
+
return Et(p);
|
|
430
431
|
}
|
|
431
|
-
async function
|
|
432
|
+
async function It(t) {
|
|
432
433
|
try {
|
|
433
434
|
return await t.json();
|
|
434
435
|
} catch {
|
|
435
436
|
return { error: { code: t.statusText || "internal" } };
|
|
436
437
|
}
|
|
437
438
|
}
|
|
438
|
-
async function
|
|
439
|
+
async function Et(t) {
|
|
439
440
|
const e = t.body?.getReader();
|
|
440
441
|
if (!e) throw new Error("BE response body is not readable.");
|
|
441
442
|
const n = new TextDecoder();
|
|
442
443
|
let r = "";
|
|
443
444
|
const o = {};
|
|
444
445
|
for (; ; ) {
|
|
445
|
-
const { value:
|
|
446
|
+
const { value: a, done: s } = await e.read();
|
|
446
447
|
if (s) break;
|
|
447
|
-
r += n.decode(
|
|
448
|
+
r += n.decode(a, { stream: !0 });
|
|
448
449
|
let c = r.indexOf(`
|
|
449
450
|
`);
|
|
450
451
|
for (; c >= 0; ) {
|
|
451
452
|
const u = r.slice(0, c).trim();
|
|
452
|
-
r = r.slice(c + 1), u &&
|
|
453
|
+
r = r.slice(c + 1), u && q(JSON.parse(u), o), c = r.indexOf(`
|
|
453
454
|
`);
|
|
454
455
|
}
|
|
455
456
|
}
|
|
456
|
-
const
|
|
457
|
-
return
|
|
457
|
+
const i = r.trim();
|
|
458
|
+
return i && q(JSON.parse(i), o), o;
|
|
458
459
|
}
|
|
459
|
-
function
|
|
460
|
-
if (t._error) throw
|
|
460
|
+
function q(t, e) {
|
|
461
|
+
if (t._error) throw tt(t._error);
|
|
461
462
|
t._end || Object.assign(e, t);
|
|
462
463
|
}
|
|
463
|
-
function
|
|
464
|
+
function le(t = {}) {
|
|
464
465
|
return {
|
|
465
466
|
type: "metadata",
|
|
466
467
|
...t
|
|
467
468
|
};
|
|
468
469
|
}
|
|
469
|
-
function
|
|
470
|
+
function P(t, e = !1, n = {}) {
|
|
470
471
|
return {
|
|
471
472
|
type: "text_chunk",
|
|
472
473
|
content: t,
|
|
@@ -474,41 +475,41 @@ function _(t, e = !1, n = {}) {
|
|
|
474
475
|
...n
|
|
475
476
|
};
|
|
476
477
|
}
|
|
477
|
-
function
|
|
478
|
+
function jt(t) {
|
|
478
479
|
return {
|
|
479
480
|
type: "ui_spec",
|
|
480
481
|
...t
|
|
481
482
|
};
|
|
482
483
|
}
|
|
483
|
-
function
|
|
484
|
+
function de(t) {
|
|
484
485
|
return {
|
|
485
486
|
type: "action",
|
|
486
487
|
action: t
|
|
487
488
|
};
|
|
488
489
|
}
|
|
489
|
-
function
|
|
490
|
+
function Pt(t, e) {
|
|
490
491
|
return {
|
|
491
492
|
type: "error",
|
|
492
493
|
code: t,
|
|
493
494
|
message: e
|
|
494
495
|
};
|
|
495
496
|
}
|
|
496
|
-
function
|
|
497
|
+
function et() {
|
|
497
498
|
return { type: "done" };
|
|
498
499
|
}
|
|
499
|
-
function
|
|
500
|
+
function Ct(t, e) {
|
|
500
501
|
return t[e?.type || e?.action?.type || "inputText"] || t.inputText;
|
|
501
502
|
}
|
|
502
|
-
async function
|
|
503
|
-
const c = performance.now(), u = await n.load(t), l = u.thread.id, d =
|
|
503
|
+
async function fe({ request: t, accountModule: e, contextStore: n, beClient: r, toolBridge: o, emit: i, rpc: a, signal: s }) {
|
|
504
|
+
const c = performance.now(), u = await n.load(t), l = u.thread.id, d = Ft(t);
|
|
504
505
|
n.appendUserMessage(l, d);
|
|
505
|
-
const
|
|
506
|
-
if (!
|
|
507
|
-
return
|
|
506
|
+
const p = Ct(e.flows, t);
|
|
507
|
+
if (!p)
|
|
508
|
+
return i(Pt("unknown_action", `No agent flow for request type ${t?.type || "inputText"}`)), i(et()), {
|
|
508
509
|
steps: 0,
|
|
509
510
|
productSkusEmitted: []
|
|
510
511
|
};
|
|
511
|
-
const
|
|
512
|
+
const m = {
|
|
512
513
|
request: t,
|
|
513
514
|
context: n.patch(l, {}) || u,
|
|
514
515
|
bag: {},
|
|
@@ -521,121 +522,123 @@ async function Ft({ request: t, accountModule: e, contextStore: n, beClient: r,
|
|
|
521
522
|
contextStore: n,
|
|
522
523
|
beClient: r,
|
|
523
524
|
toolBridge: o,
|
|
524
|
-
emit:
|
|
525
|
-
rpc:
|
|
525
|
+
emit: i,
|
|
526
|
+
rpc: a,
|
|
526
527
|
...s ? { signal: s } : {}
|
|
527
528
|
};
|
|
528
|
-
return await
|
|
529
|
+
return await U(p, m, h), m.committed || await $(m, h), await a("beacon.send", {
|
|
529
530
|
type: "turnSummary",
|
|
530
531
|
threadId: l,
|
|
531
532
|
sessionId: t?.session_id || t?.sessionId || l,
|
|
532
|
-
accountId: e.accountId ||
|
|
533
|
-
steps:
|
|
534
|
-
totalLatencyMs:
|
|
535
|
-
productSkusEmitted: [...
|
|
533
|
+
accountId: e.accountId || m.context.meta.accountId,
|
|
534
|
+
steps: m.steps,
|
|
535
|
+
totalLatencyMs: B(c),
|
|
536
|
+
productSkusEmitted: [...m.productSkusEmitted]
|
|
536
537
|
}), {
|
|
537
|
-
steps:
|
|
538
|
-
productSkusEmitted: [...
|
|
538
|
+
steps: m.steps,
|
|
539
|
+
productSkusEmitted: [...m.productSkusEmitted]
|
|
539
540
|
};
|
|
540
541
|
}
|
|
541
|
-
async function
|
|
542
|
+
async function U(t, e, n) {
|
|
542
543
|
for (const r of t) {
|
|
543
544
|
if (n.signal?.aborted) return;
|
|
544
|
-
e.steps += 1, await
|
|
545
|
+
e.steps += 1, await Mt(r, e, n), e.context = n.contextStore.patch(e.threadId, {}) || e.context;
|
|
545
546
|
}
|
|
546
547
|
}
|
|
547
|
-
async function
|
|
548
|
-
const r =
|
|
548
|
+
async function Mt(t, e, n) {
|
|
549
|
+
const r = F(e);
|
|
549
550
|
if (t.kind === "be_op") {
|
|
550
|
-
await
|
|
551
|
+
await vt(t, e, n, r);
|
|
551
552
|
return;
|
|
552
553
|
}
|
|
553
554
|
if (t.kind === "tool") {
|
|
554
|
-
await
|
|
555
|
+
await Nt(t, e, n, r);
|
|
555
556
|
return;
|
|
556
557
|
}
|
|
557
558
|
if (t.kind === "emit") {
|
|
558
|
-
|
|
559
|
+
Ot(t, e, n);
|
|
559
560
|
return;
|
|
560
561
|
}
|
|
561
562
|
if (t.kind === "branch") {
|
|
562
|
-
await
|
|
563
|
+
await Rt(t, e, n, r);
|
|
563
564
|
return;
|
|
564
565
|
}
|
|
565
566
|
if (t.kind === "parallel") {
|
|
566
|
-
await
|
|
567
|
+
await Bt(t, e, n);
|
|
567
568
|
return;
|
|
568
569
|
}
|
|
569
570
|
if (t.kind === "refusal") {
|
|
570
|
-
await
|
|
571
|
+
await Ut(t, e, n, r);
|
|
571
572
|
return;
|
|
572
573
|
}
|
|
573
|
-
t.kind === "commit" && await
|
|
574
|
+
t.kind === "commit" && await $t(t, e, n);
|
|
574
575
|
}
|
|
575
|
-
async function
|
|
576
|
+
async function vt(t, e, n, r) {
|
|
576
577
|
const o = performance.now();
|
|
577
|
-
let
|
|
578
|
+
let i;
|
|
579
|
+
const a = E(t.cacheTtlS, r);
|
|
578
580
|
try {
|
|
579
|
-
|
|
581
|
+
i = await n.beClient.invoke({
|
|
580
582
|
op: t.op,
|
|
581
|
-
input:
|
|
583
|
+
input: E(t.input, r),
|
|
584
|
+
...a !== void 0 ? { cacheTtlS: a } : {},
|
|
582
585
|
...n.signal ? { signal: n.signal } : {}
|
|
583
586
|
});
|
|
584
|
-
} catch (
|
|
585
|
-
const
|
|
587
|
+
} catch (c) {
|
|
588
|
+
const u = c, l = String(u?.sourceCode || u?.code || "unknown"), d = {
|
|
586
589
|
type: "agentOp",
|
|
587
590
|
threadId: e.threadId,
|
|
588
591
|
sessionId: e.request?.session_id || e.request?.sessionId || e.threadId,
|
|
589
592
|
accountId: e.context.meta.accountId,
|
|
590
593
|
op: t.op,
|
|
591
594
|
status: "error",
|
|
592
|
-
latencyMs:
|
|
593
|
-
errorCode:
|
|
595
|
+
latencyMs: B(o),
|
|
596
|
+
errorCode: l
|
|
594
597
|
};
|
|
595
|
-
throw await n.rpc("beacon.send",
|
|
598
|
+
throw await n.rpc("beacon.send", d), c;
|
|
596
599
|
}
|
|
597
|
-
t.out && (e.bag[t.out] =
|
|
598
|
-
const
|
|
600
|
+
t.out && (e.bag[t.out] = i), nt(t, i, e, n.contextStore);
|
|
601
|
+
const s = {
|
|
599
602
|
type: "agentOp",
|
|
600
603
|
threadId: e.threadId,
|
|
601
604
|
sessionId: e.request?.session_id || e.request?.sessionId || e.threadId,
|
|
602
605
|
accountId: e.context.meta.accountId,
|
|
603
606
|
op: t.op,
|
|
604
607
|
status: "ok",
|
|
605
|
-
latencyMs:
|
|
608
|
+
latencyMs: B(o)
|
|
606
609
|
};
|
|
607
|
-
await n.rpc("beacon.send",
|
|
610
|
+
await n.rpc("beacon.send", s);
|
|
608
611
|
}
|
|
609
|
-
async function
|
|
610
|
-
const o = await n.toolBridge.invoke(t.name,
|
|
611
|
-
t.out && (e.bag[t.out] = o),
|
|
612
|
+
async function Nt(t, e, n, r) {
|
|
613
|
+
const o = await n.toolBridge.invoke(t.name, E(t.input, r));
|
|
614
|
+
t.out && (e.bag[t.out] = o), nt(t, o, e, n.contextStore);
|
|
612
615
|
}
|
|
613
|
-
function
|
|
614
|
-
const r = t.build(
|
|
615
|
-
|
|
616
|
+
function Ot(t, e, n) {
|
|
617
|
+
const r = t.build(F(e));
|
|
618
|
+
Dt(r, e.productSkusEmitted), n.emit(r);
|
|
616
619
|
}
|
|
617
|
-
async function
|
|
618
|
-
const o = String(
|
|
619
|
-
await
|
|
620
|
+
async function Rt(t, e, n, r) {
|
|
621
|
+
const o = String(E(t.on, r) || "default");
|
|
622
|
+
await U(t.cases[o] || t.cases.default || [], e, n);
|
|
620
623
|
}
|
|
621
|
-
async function
|
|
622
|
-
await Promise.all(t.steps.map((r) =>
|
|
624
|
+
async function Bt(t, e, n) {
|
|
625
|
+
await Promise.all(t.steps.map((r) => U(r, e, n)));
|
|
623
626
|
}
|
|
624
|
-
async function
|
|
625
|
-
n.emit(
|
|
627
|
+
async function Ut(t, e, n, r) {
|
|
628
|
+
n.emit(P(E(t.message, r), !0)), await $(e, n);
|
|
626
629
|
}
|
|
627
|
-
async function
|
|
628
|
-
await
|
|
630
|
+
async function $t(t, e, n) {
|
|
631
|
+
await $(e, n);
|
|
629
632
|
}
|
|
630
|
-
async function
|
|
631
|
-
t.committed || (t.context = await e.commit(t.threadId) || t.context, t.committed = !0, n(
|
|
633
|
+
async function $(t, { contextStore: e, emit: n }) {
|
|
634
|
+
t.committed || (t.context = await e.commit(t.threadId) || t.context, t.committed = !0, n(et()));
|
|
632
635
|
}
|
|
633
|
-
function
|
|
636
|
+
function nt(t, e, n, r) {
|
|
634
637
|
if (typeof t.patch != "function") return;
|
|
635
|
-
const o = t.patch(n.context, e,
|
|
638
|
+
const o = t.patch(n.context, e, F(n));
|
|
636
639
|
o && (n.context = r.patch(n.threadId, o) || n.context);
|
|
637
640
|
}
|
|
638
|
-
function
|
|
641
|
+
function F(t) {
|
|
639
642
|
return {
|
|
640
643
|
request: t.request,
|
|
641
644
|
context: t.context,
|
|
@@ -643,10 +646,10 @@ function j(t) {
|
|
|
643
646
|
accountConfig: t.accountConfig
|
|
644
647
|
};
|
|
645
648
|
}
|
|
646
|
-
function
|
|
649
|
+
function E(t, e) {
|
|
647
650
|
return typeof t == "function" ? t(e) : t;
|
|
648
651
|
}
|
|
649
|
-
function
|
|
652
|
+
function Ft(t) {
|
|
650
653
|
const e = t?.payload;
|
|
651
654
|
if (typeof e == "string") return e;
|
|
652
655
|
if (e && typeof e == "object" && "text" in e) {
|
|
@@ -655,16 +658,16 @@ function Tt(t) {
|
|
|
655
658
|
}
|
|
656
659
|
return typeof t?.action?.payload == "string" ? t.action.payload : typeof t?.action?.title == "string" ? t.action.title : "";
|
|
657
660
|
}
|
|
658
|
-
function
|
|
659
|
-
const n = t, r = n.spec, o = Array.isArray(r?.items) ? r.items : void 0,
|
|
660
|
-
if (Array.isArray(
|
|
661
|
-
for (const s of
|
|
661
|
+
function Dt(t, e) {
|
|
662
|
+
const n = t, r = n.spec, o = Array.isArray(r?.items) ? r.items : void 0, i = Array.isArray(n.items) ? n.items : void 0, a = o || i;
|
|
663
|
+
if (Array.isArray(a)) {
|
|
664
|
+
for (const s of a) if (s && typeof s == "object") {
|
|
662
665
|
const c = s.sku;
|
|
663
666
|
typeof c == "string" && e.add(c);
|
|
664
667
|
}
|
|
665
668
|
}
|
|
666
669
|
}
|
|
667
|
-
function
|
|
670
|
+
function pe(t) {
|
|
668
671
|
return { invoke(e, n) {
|
|
669
672
|
return t("tool.invoke", {
|
|
670
673
|
name: e,
|
|
@@ -672,39 +675,39 @@ function zt(t) {
|
|
|
672
675
|
});
|
|
673
676
|
} };
|
|
674
677
|
}
|
|
675
|
-
function
|
|
678
|
+
function rt(t) {
|
|
676
679
|
return t && typeof t == "object" && !Array.isArray(t) ? t : null;
|
|
677
680
|
}
|
|
678
|
-
function
|
|
679
|
-
const e =
|
|
681
|
+
function D(t) {
|
|
682
|
+
const e = rt(t);
|
|
680
683
|
if (!e) return null;
|
|
681
|
-
const n =
|
|
684
|
+
const n = x(e.sku, e.SKU);
|
|
682
685
|
if (!n) return null;
|
|
683
686
|
const r = {
|
|
684
687
|
sku: n,
|
|
685
|
-
name:
|
|
686
|
-
url:
|
|
687
|
-
}, o = Array.isArray(e.images) ? e.images : void 0,
|
|
688
|
-
|
|
689
|
-
const
|
|
688
|
+
name: x(e.name, e.title, e.short_name, n) || n,
|
|
689
|
+
url: x(e.url) || ""
|
|
690
|
+
}, o = Array.isArray(e.images) ? e.images : void 0, i = x(e.imageUrl, e.image_url, e.image, o?.[0]);
|
|
691
|
+
i && (r.imageUrl = i), o && o.length > 1 && (r.images = o.filter((f) => !!f).map(String));
|
|
692
|
+
const a = I(e.price_discounted), s = I(e.price), c = a || s;
|
|
690
693
|
c > 0 && (r.price = String(c));
|
|
691
|
-
const u =
|
|
694
|
+
const u = a > 0 ? s : 0;
|
|
692
695
|
u > 0 && (r.originalPrice = String(u));
|
|
693
|
-
const l =
|
|
696
|
+
const l = x(e.brand);
|
|
694
697
|
l && (r.brand = l);
|
|
695
|
-
const d =
|
|
698
|
+
const d = I(e.rating);
|
|
696
699
|
d > 0 && (r.rating = d);
|
|
697
|
-
const
|
|
698
|
-
|
|
699
|
-
const
|
|
700
|
-
|
|
700
|
+
const p = I(e.review_count) || I(e.reviewCount);
|
|
701
|
+
p > 0 && (r.reviewCount = p);
|
|
702
|
+
const m = x(e.cart_code, e.cartCode);
|
|
703
|
+
m && (r.cartCode = m), typeof e.in_stock == "boolean" && (r.inStock = e.in_stock), typeof e.inStock == "boolean" && (r.inStock = e.inStock);
|
|
701
704
|
const h = e.category_names;
|
|
702
705
|
return Array.isArray(h) && (r.categoryNames = h.map(String)), r;
|
|
703
706
|
}
|
|
704
|
-
function
|
|
705
|
-
const e =
|
|
707
|
+
function zt(t) {
|
|
708
|
+
const e = rt(t);
|
|
706
709
|
if (!e) return t;
|
|
707
|
-
const n = e.category_names, r = Array.isArray(n) ? n : void 0, o = e.images,
|
|
710
|
+
const n = e.category_names, r = Array.isArray(n) ? n : void 0, o = e.images, i = Array.isArray(o) ? o : void 0, a = {
|
|
708
711
|
sku: e.sku,
|
|
709
712
|
name: e.name || e.title,
|
|
710
713
|
url: e.url,
|
|
@@ -712,38 +715,38 @@ function vt(t) {
|
|
|
712
715
|
currency: e.price_currency || e.currency,
|
|
713
716
|
category: r?.[r.length - 1] ?? void 0,
|
|
714
717
|
category_names: r ? r.slice(0, 4) : void 0,
|
|
715
|
-
image:
|
|
718
|
+
image: i ? i[0] : e.image,
|
|
716
719
|
in_stock: e.in_stock,
|
|
717
720
|
rating: e.rating,
|
|
718
721
|
review_count: e.review_count
|
|
719
722
|
};
|
|
720
|
-
for (const s of Object.keys(
|
|
721
|
-
return
|
|
723
|
+
for (const s of Object.keys(a)) a[s] === void 0 && delete a[s];
|
|
724
|
+
return a;
|
|
722
725
|
}
|
|
723
|
-
function
|
|
724
|
-
return Array.isArray(t) ? t.map(
|
|
726
|
+
function ot(t) {
|
|
727
|
+
return Array.isArray(t) ? t.map(zt).filter((e) => !!e) : [];
|
|
725
728
|
}
|
|
726
|
-
function
|
|
729
|
+
function x(...t) {
|
|
727
730
|
for (const e of t) if (typeof e == "string" && e.trim()) return e.trim();
|
|
728
731
|
return "";
|
|
729
732
|
}
|
|
730
|
-
function
|
|
733
|
+
function I(t) {
|
|
731
734
|
const e = Number(t);
|
|
732
735
|
return Number.isFinite(e) ? e : 0;
|
|
733
736
|
}
|
|
734
|
-
function
|
|
737
|
+
function J(t) {
|
|
735
738
|
return Array.isArray(t) ? t.map(String).filter(Boolean) : typeof t == "string" && t ? [t] : [];
|
|
736
739
|
}
|
|
737
|
-
function
|
|
740
|
+
function Lt(t = []) {
|
|
738
741
|
const e = {}, n = [];
|
|
739
|
-
return (Array.isArray(t) ? t.map(
|
|
740
|
-
const
|
|
741
|
-
n.push(
|
|
742
|
-
const
|
|
742
|
+
return (Array.isArray(t) ? t.map(D).filter((r) => !!r) : []).forEach((r, o) => {
|
|
743
|
+
const i = `product-${o.toString()}`;
|
|
744
|
+
n.push(i);
|
|
745
|
+
const a = {
|
|
743
746
|
sku: r.sku,
|
|
744
747
|
product: r
|
|
745
748
|
};
|
|
746
|
-
e[
|
|
749
|
+
e[i] = {
|
|
747
750
|
type: "ProductCard",
|
|
748
751
|
props: {
|
|
749
752
|
product: r,
|
|
@@ -751,7 +754,7 @@ function Pt(t = []) {
|
|
|
751
754
|
action: {
|
|
752
755
|
title: r.name,
|
|
753
756
|
type: "launchSingleProduct",
|
|
754
|
-
payload:
|
|
757
|
+
payload: a
|
|
755
758
|
}
|
|
756
759
|
}
|
|
757
760
|
};
|
|
@@ -768,7 +771,7 @@ function Pt(t = []) {
|
|
|
768
771
|
}
|
|
769
772
|
};
|
|
770
773
|
}
|
|
771
|
-
function
|
|
774
|
+
function me(t) {
|
|
772
775
|
return {
|
|
773
776
|
widget: "chat",
|
|
774
777
|
panelHint: "panel",
|
|
@@ -776,13 +779,13 @@ function Ht(t) {
|
|
|
776
779
|
root: "root",
|
|
777
780
|
elements: { root: {
|
|
778
781
|
type: "ProductDetailsPanel",
|
|
779
|
-
props: { product:
|
|
782
|
+
props: { product: D(t) || t || {} }
|
|
780
783
|
} }
|
|
781
784
|
}
|
|
782
785
|
};
|
|
783
786
|
}
|
|
784
|
-
function
|
|
785
|
-
const e = (t.multiple_product_details || t.products || []).map(
|
|
787
|
+
function ye(t = {}) {
|
|
788
|
+
const e = (t.multiple_product_details || t.products || []).map(D).filter((r) => !!r), n = t.table || {};
|
|
786
789
|
return {
|
|
787
790
|
widget: "chat",
|
|
788
791
|
panelHint: "panel",
|
|
@@ -797,8 +800,8 @@ function Lt(t = {}) {
|
|
|
797
800
|
label: r,
|
|
798
801
|
values: Array.isArray(o) ? o.map(String) : [String(o ?? "")]
|
|
799
802
|
})),
|
|
800
|
-
highlights:
|
|
801
|
-
specialCases:
|
|
803
|
+
highlights: J(t.key_differences),
|
|
804
|
+
specialCases: J(t.special_considerations),
|
|
802
805
|
recommendedText: t.recommended_choice,
|
|
803
806
|
productActions: Object.fromEntries(e.map((r) => [r.sku, {
|
|
804
807
|
title: r.name,
|
|
@@ -813,7 +816,7 @@ function Lt(t = {}) {
|
|
|
813
816
|
}
|
|
814
817
|
};
|
|
815
818
|
}
|
|
816
|
-
function
|
|
819
|
+
function ge(t = []) {
|
|
817
820
|
return {
|
|
818
821
|
widget: "chat",
|
|
819
822
|
panelHint: "inline",
|
|
@@ -836,7 +839,7 @@ function Kt(t = []) {
|
|
|
836
839
|
}
|
|
837
840
|
};
|
|
838
841
|
}
|
|
839
|
-
function
|
|
842
|
+
function v(t) {
|
|
840
843
|
const e = t?.payload;
|
|
841
844
|
if (typeof e == "string") return e;
|
|
842
845
|
if (e && typeof e == "object" && "text" in e) {
|
|
@@ -846,53 +849,53 @@ function S(t) {
|
|
|
846
849
|
const n = t?.action;
|
|
847
850
|
return n && typeof n.payload == "string" ? n.payload : n && typeof n.title == "string" ? n.title : "";
|
|
848
851
|
}
|
|
849
|
-
function
|
|
852
|
+
function qt(t) {
|
|
850
853
|
return Object.freeze([...t]);
|
|
851
854
|
}
|
|
852
|
-
function
|
|
855
|
+
function _(t) {
|
|
853
856
|
return t && typeof t == "object" ? t : {};
|
|
854
857
|
}
|
|
855
|
-
function
|
|
858
|
+
function N(t) {
|
|
856
859
|
return t && typeof t == "object" ? t : {};
|
|
857
860
|
}
|
|
858
|
-
function
|
|
861
|
+
function K(t) {
|
|
859
862
|
return t.thread.extensions.beauty_profile;
|
|
860
863
|
}
|
|
861
|
-
var
|
|
864
|
+
var he = qt([{
|
|
862
865
|
kind: "be_op",
|
|
863
866
|
op: "beauty-consulting-turn",
|
|
864
867
|
input: ({ request: t, context: e }) => ({
|
|
865
|
-
utterance:
|
|
868
|
+
utterance: v(t),
|
|
866
869
|
prior_messages: e.messages.slice(-10),
|
|
867
|
-
profile:
|
|
868
|
-
candidate_products:
|
|
870
|
+
profile: K(e),
|
|
871
|
+
candidate_products: Kt(t),
|
|
869
872
|
locale: e.meta.locale
|
|
870
873
|
}),
|
|
871
874
|
out: "consultation",
|
|
872
|
-
patch:
|
|
875
|
+
patch: H
|
|
873
876
|
}, {
|
|
874
877
|
kind: "branch",
|
|
875
|
-
on: ({ bag: t }) =>
|
|
878
|
+
on: ({ bag: t }) => _(t.consultation).consultation_state?.stage || "answer",
|
|
876
879
|
cases: {
|
|
877
880
|
refuse: [{
|
|
878
881
|
kind: "refusal",
|
|
879
882
|
message: ({ bag: t }) => {
|
|
880
|
-
const e =
|
|
883
|
+
const e = _(t.consultation);
|
|
881
884
|
return e.refusal?.message || e.plain_text || "I cannot help with that request.";
|
|
882
885
|
}
|
|
883
886
|
}],
|
|
884
887
|
needs_more_info: [{
|
|
885
888
|
kind: "emit",
|
|
886
|
-
build: ({ bag: t }) =>
|
|
889
|
+
build: ({ bag: t }) => P(R(_(t.consultation)), !0)
|
|
887
890
|
}, { kind: "commit" }],
|
|
888
891
|
search: [
|
|
889
892
|
{
|
|
890
893
|
kind: "tool",
|
|
891
894
|
name: "search",
|
|
892
895
|
input: ({ request: t, bag: e, context: n }) => {
|
|
893
|
-
const r =
|
|
896
|
+
const r = _(e.consultation);
|
|
894
897
|
return {
|
|
895
|
-
query: r.search_params?.query ||
|
|
898
|
+
query: r.search_params?.query || v(t),
|
|
896
899
|
facets: r.search_params?.facets || {},
|
|
897
900
|
limit: 12,
|
|
898
901
|
locale: n.meta.locale
|
|
@@ -900,31 +903,31 @@ var Vt = Mt([{
|
|
|
900
903
|
},
|
|
901
904
|
out: "products",
|
|
902
905
|
patch: (t, e) => {
|
|
903
|
-
const n =
|
|
906
|
+
const n = N(e);
|
|
904
907
|
return { panel: {
|
|
905
908
|
...t.panel,
|
|
906
|
-
screen_sku_list:
|
|
909
|
+
screen_sku_list: O(n).map((r) => Jt(r)).filter((r) => !!r),
|
|
907
910
|
last_search: { query: n.query || "" }
|
|
908
911
|
} };
|
|
909
912
|
}
|
|
910
913
|
},
|
|
911
914
|
{
|
|
912
915
|
kind: "emit",
|
|
913
|
-
build: ({ bag: t }) =>
|
|
916
|
+
build: ({ bag: t }) => jt(Lt(O(N(t.products))))
|
|
914
917
|
},
|
|
915
918
|
{
|
|
916
919
|
kind: "be_op",
|
|
917
920
|
op: "beauty-consulting-turn",
|
|
918
921
|
input: ({ request: t, context: e, bag: n }) => ({
|
|
919
|
-
utterance:
|
|
922
|
+
utterance: v(t),
|
|
920
923
|
prior_messages: e.messages.slice(-10),
|
|
921
|
-
profile:
|
|
922
|
-
candidate_products:
|
|
924
|
+
profile: K(e),
|
|
925
|
+
candidate_products: ot(O(N(n.products)).slice(0, 12)),
|
|
923
926
|
locale: e.meta.locale
|
|
924
927
|
}),
|
|
925
928
|
out: "answer",
|
|
926
929
|
patch: (t, e) => {
|
|
927
|
-
const n =
|
|
930
|
+
const n = H(t, e), r = (_(e).product_mentions || []).map((o) => o.sku).filter((o) => !!o);
|
|
928
931
|
return {
|
|
929
932
|
...n || {},
|
|
930
933
|
panel: {
|
|
@@ -937,8 +940,8 @@ var Vt = Mt([{
|
|
|
937
940
|
{
|
|
938
941
|
kind: "emit",
|
|
939
942
|
build: ({ bag: t }) => {
|
|
940
|
-
const e =
|
|
941
|
-
return
|
|
943
|
+
const e = _(t.answer);
|
|
944
|
+
return P(R(e), !0, { productMentions: e.product_mentions || [] });
|
|
942
945
|
}
|
|
943
946
|
},
|
|
944
947
|
{ kind: "commit" }
|
|
@@ -946,14 +949,14 @@ var Vt = Mt([{
|
|
|
946
949
|
default: [{
|
|
947
950
|
kind: "emit",
|
|
948
951
|
build: ({ bag: t }) => {
|
|
949
|
-
const e =
|
|
950
|
-
return
|
|
952
|
+
const e = _(t.consultation);
|
|
953
|
+
return P(R(e), !0, { productMentions: e.product_mentions || [] });
|
|
951
954
|
}
|
|
952
955
|
}, { kind: "commit" }]
|
|
953
956
|
}
|
|
954
957
|
}]);
|
|
955
|
-
function
|
|
956
|
-
const n =
|
|
958
|
+
function H(t, e) {
|
|
959
|
+
const n = _(e).consultation_state?.captured_profile;
|
|
957
960
|
if (!n) return null;
|
|
958
961
|
const r = t.thread.extensions.beauty_profile && typeof t.thread.extensions.beauty_profile == "object" ? t.thread.extensions.beauty_profile : {};
|
|
959
962
|
return { thread: {
|
|
@@ -967,53 +970,270 @@ function N(t, e) {
|
|
|
967
970
|
}
|
|
968
971
|
} };
|
|
969
972
|
}
|
|
970
|
-
function
|
|
973
|
+
function O(t) {
|
|
971
974
|
return Array.isArray(t?.products) ? t.products : [];
|
|
972
975
|
}
|
|
973
|
-
function
|
|
976
|
+
function Jt(t) {
|
|
974
977
|
if (t && typeof t == "object" && "sku" in t) {
|
|
975
978
|
const e = t.sku;
|
|
976
979
|
if (typeof e == "string") return e;
|
|
977
980
|
}
|
|
978
981
|
}
|
|
979
|
-
function
|
|
982
|
+
function Kt(t) {
|
|
980
983
|
const e = t?.payload && typeof t.payload == "object" ? t.payload.products : void 0, n = t?.action?.payload && typeof t.action.payload == "object" ? t.action.payload.products : void 0, r = e || n;
|
|
981
|
-
return Array.isArray(r) ?
|
|
984
|
+
return Array.isArray(r) ? ot(r.slice(0, 12)) : void 0;
|
|
982
985
|
}
|
|
983
|
-
function
|
|
986
|
+
function R(t) {
|
|
984
987
|
return t?.answer_html || t?.plain_text || t?.refusal?.message || "I can help with beauty shopping.";
|
|
985
988
|
}
|
|
989
|
+
var W = /* @__PURE__ */ new Set([
|
|
990
|
+
"and",
|
|
991
|
+
"are",
|
|
992
|
+
"box",
|
|
993
|
+
"for",
|
|
994
|
+
"from",
|
|
995
|
+
"gift",
|
|
996
|
+
"gifts",
|
|
997
|
+
"interflora",
|
|
998
|
+
"the",
|
|
999
|
+
"with"
|
|
1000
|
+
]), Ht = {
|
|
1001
|
+
token: 0.26,
|
|
1002
|
+
keyword: 0.22,
|
|
1003
|
+
category: 0.18,
|
|
1004
|
+
facet: 0.16,
|
|
1005
|
+
color: 0.08,
|
|
1006
|
+
attribute: 0.06,
|
|
1007
|
+
price: 0.08,
|
|
1008
|
+
retrieval: 0.08
|
|
1009
|
+
}, Wt = [
|
|
1010
|
+
"amber",
|
|
1011
|
+
"beige",
|
|
1012
|
+
"black",
|
|
1013
|
+
"blue",
|
|
1014
|
+
"blush",
|
|
1015
|
+
"bronze",
|
|
1016
|
+
"brown",
|
|
1017
|
+
"cream",
|
|
1018
|
+
"gold",
|
|
1019
|
+
"green",
|
|
1020
|
+
"grey",
|
|
1021
|
+
"ivory",
|
|
1022
|
+
"lilac",
|
|
1023
|
+
"mixed",
|
|
1024
|
+
"orange",
|
|
1025
|
+
"pastel",
|
|
1026
|
+
"pink",
|
|
1027
|
+
"purple",
|
|
1028
|
+
"red",
|
|
1029
|
+
"silver",
|
|
1030
|
+
"white",
|
|
1031
|
+
"yellow"
|
|
1032
|
+
];
|
|
1033
|
+
function S(t) {
|
|
1034
|
+
return String(t ?? "").normalize("NFKD").replace(new RegExp("\\p{Diacritic}", "gu"), "").toLowerCase().replace(/[^\p{L}\p{N}]+/gu, " ").replace(/\s+/gu, " ").trim();
|
|
1035
|
+
}
|
|
1036
|
+
function k(t, e = W) {
|
|
1037
|
+
const n = e instanceof Set ? e : /* @__PURE__ */ new Set([...W, ...e]), r = /* @__PURE__ */ new Set(), o = [];
|
|
1038
|
+
for (const i of S(t).split(/\s+/u))
|
|
1039
|
+
i.length < 3 || n.has(i) || r.has(i) || (r.add(i), o.push(i));
|
|
1040
|
+
return o;
|
|
1041
|
+
}
|
|
1042
|
+
function C(t, e = {}) {
|
|
1043
|
+
if (Gt(t)) return t;
|
|
1044
|
+
const n = e.facetKeys, r = y(t.category_names ?? t.category), o = y(t.category_ids), i = Qt(t.facet_hits), a = Object.entries(i).filter(([f]) => !n || n.some((M) => S(M) === S(f))).map(([, f]) => f), s = w(t.name, t.title), c = w(t.brand), u = e.sourceKeywords ?? [], l = [
|
|
1045
|
+
s,
|
|
1046
|
+
c,
|
|
1047
|
+
...r,
|
|
1048
|
+
...a,
|
|
1049
|
+
...y(t.promotions),
|
|
1050
|
+
w(t.description),
|
|
1051
|
+
...u
|
|
1052
|
+
].join(" "), d = k(l, e.stopWords), p = w(e.sourceProductType, Zt(r, s, d), d[0]), m = b([...Xt(l, Wt), ...Object.entries(i).filter(([f]) => /colou?r/iu.test(f)).flatMap(([, f]) => k(f, e.stopWords))]), h = b([...a.flatMap((f) => k(f, e.stopWords)), ...y(t.promotions).flatMap((f) => k(f, e.stopWords))]).slice(0, 24);
|
|
1053
|
+
return {
|
|
1054
|
+
sku: w(t.sku),
|
|
1055
|
+
title: s,
|
|
1056
|
+
brand: c,
|
|
1057
|
+
productType: p,
|
|
1058
|
+
categoryNames: r,
|
|
1059
|
+
categoryIds: o,
|
|
1060
|
+
facets: i,
|
|
1061
|
+
keywords: b([...u.flatMap((f) => k(f, e.stopWords)), ...d]).slice(0, 12),
|
|
1062
|
+
tokens: d,
|
|
1063
|
+
colors: m,
|
|
1064
|
+
attributes: h,
|
|
1065
|
+
price: Yt(t)
|
|
1066
|
+
};
|
|
1067
|
+
}
|
|
1068
|
+
function ke(t, e = {}) {
|
|
1069
|
+
const n = w(t.product_type, t.productType), r = w(t.title, n, y(t.keywords).join(" ")), o = b([
|
|
1070
|
+
...y(t.keywords),
|
|
1071
|
+
...y(t.colors),
|
|
1072
|
+
...y(t.materials),
|
|
1073
|
+
...y(t.styles),
|
|
1074
|
+
...y(t.attributes)
|
|
1075
|
+
]);
|
|
1076
|
+
return C({
|
|
1077
|
+
sku: "__photo__",
|
|
1078
|
+
name: r,
|
|
1079
|
+
category_names: n ? [n] : [],
|
|
1080
|
+
facet_hits: {
|
|
1081
|
+
colors: y(t.colors).join(", "),
|
|
1082
|
+
materials: y(t.materials).join(", "),
|
|
1083
|
+
styles: y(t.styles).join(", "),
|
|
1084
|
+
attributes: y(t.attributes).join(", ")
|
|
1085
|
+
},
|
|
1086
|
+
promotions: o
|
|
1087
|
+
}, {
|
|
1088
|
+
...e,
|
|
1089
|
+
sourceProductType: n,
|
|
1090
|
+
sourceKeywords: o
|
|
1091
|
+
});
|
|
1092
|
+
}
|
|
1093
|
+
function we(t, e = {}) {
|
|
1094
|
+
const n = C(t, e);
|
|
1095
|
+
return b([
|
|
1096
|
+
...e.sourceQueries ?? [],
|
|
1097
|
+
j([
|
|
1098
|
+
n.productType,
|
|
1099
|
+
...n.colors.slice(0, 1),
|
|
1100
|
+
...n.attributes.slice(0, 2)
|
|
1101
|
+
]),
|
|
1102
|
+
j([n.productType, ...n.keywords.slice(0, 3)]),
|
|
1103
|
+
j([n.categoryNames[n.categoryNames.length - 1], ...n.keywords.slice(0, 2)]),
|
|
1104
|
+
j(n.title.split(/\s+/u).slice(0, 6)),
|
|
1105
|
+
n.productType
|
|
1106
|
+
].map((r) => r.trim()).filter(Boolean)).slice(0, e.queryLimit ?? 6);
|
|
1107
|
+
}
|
|
1108
|
+
function Vt(t, e, n = {}) {
|
|
1109
|
+
const r = {
|
|
1110
|
+
...Ht,
|
|
1111
|
+
...n.weights
|
|
1112
|
+
}, o = C(e, n), i = [], a = T(t.tokens, o.tokens), s = T(t.keywords, o.tokens), c = te(t.categoryNames, o.categoryNames) || T(V(t.categoryNames), V(o.categoryNames)), u = T(t.attributes, o.attributes), l = T(t.colors, o.colors), d = T(t.attributes, o.tokens), p = ee(t.price, o.price), m = ne(o.sku, n.hitCounts) > 0 ? 1 : 0, h = re(t, o), f = a * r.token + s * r.keyword + c * r.category + u * r.facet + l * r.color + d * r.attribute + p * r.price + m * r.retrieval, M = oe(h ? f : f * 0.35);
|
|
1113
|
+
return h && t.productType && t.productType === o.productType && i.push("same product type"), c > 0.4 && i.push("similar category"), u > 0.2 && i.push("matching product attributes"), l > 0 && i.push("matching colour"), p > 0.8 && i.push("similar price"), h || i.push("weaker product-type match"), {
|
|
1114
|
+
score: Number(M.toFixed(4)),
|
|
1115
|
+
reasons: i
|
|
1116
|
+
};
|
|
1117
|
+
}
|
|
1118
|
+
function be(t, e, n = {}) {
|
|
1119
|
+
const r = C(t, n), o = new Set([r.sku, ...n.ignoreSkus ?? []].filter(Boolean));
|
|
1120
|
+
return e.filter((i) => {
|
|
1121
|
+
const a = w(i.sku);
|
|
1122
|
+
return a && !o.has(a);
|
|
1123
|
+
}).map((i) => {
|
|
1124
|
+
const a = Vt(r, i, n);
|
|
1125
|
+
return {
|
|
1126
|
+
...i,
|
|
1127
|
+
similarity_score: a.score,
|
|
1128
|
+
similarity_reasons: a.reasons
|
|
1129
|
+
};
|
|
1130
|
+
}).sort((i, a) => a.similarity_score - i.similarity_score).slice(0, Math.max(1, Math.min(n.limit ?? 12, 100)));
|
|
1131
|
+
}
|
|
1132
|
+
function Gt(t) {
|
|
1133
|
+
return !!(t && typeof t == "object" && Array.isArray(t.tokens));
|
|
1134
|
+
}
|
|
1135
|
+
function w(...t) {
|
|
1136
|
+
for (const e of t) if (typeof e == "string" && e.trim()) return e.trim();
|
|
1137
|
+
return "";
|
|
1138
|
+
}
|
|
1139
|
+
function y(t) {
|
|
1140
|
+
return Array.isArray(t) ? t.map((e) => w(e)).filter(Boolean) : typeof t == "string" && t.trim() ? t.split(/[,;/|]+/u).map((e) => e.trim()).filter(Boolean) : [];
|
|
1141
|
+
}
|
|
1142
|
+
function Qt(t) {
|
|
1143
|
+
return !t || typeof t != "object" || Array.isArray(t) ? {} : Object.fromEntries(Object.entries(t).map(([e, n]) => [e, w(n)]).filter(([, e]) => e));
|
|
1144
|
+
}
|
|
1145
|
+
function Yt(t) {
|
|
1146
|
+
const e = Number(t.price_discounted);
|
|
1147
|
+
if (Number.isFinite(e) && e > 0) return e;
|
|
1148
|
+
const n = Number(t.price);
|
|
1149
|
+
return Number.isFinite(n) && n > 0 ? n : 0;
|
|
1150
|
+
}
|
|
1151
|
+
function b(t) {
|
|
1152
|
+
const e = /* @__PURE__ */ new Set(), n = [];
|
|
1153
|
+
for (const r of t) {
|
|
1154
|
+
const o = S(r);
|
|
1155
|
+
!o || e.has(o) || (e.add(o), n.push(o));
|
|
1156
|
+
}
|
|
1157
|
+
return n;
|
|
1158
|
+
}
|
|
1159
|
+
function Xt(t, e) {
|
|
1160
|
+
const n = ` ${S(t)} `;
|
|
1161
|
+
return e.filter((r) => n.includes(` ${S(r)} `));
|
|
1162
|
+
}
|
|
1163
|
+
function Zt(t, e, n) {
|
|
1164
|
+
const r = S(t[t.length - 1] ?? t[0] ?? "");
|
|
1165
|
+
if (r) {
|
|
1166
|
+
const o = k(r), i = new Set(k(e));
|
|
1167
|
+
return o.find((a) => i.has(a)) ?? o[0] ?? r;
|
|
1168
|
+
}
|
|
1169
|
+
return n[0] ?? "";
|
|
1170
|
+
}
|
|
1171
|
+
function j(t) {
|
|
1172
|
+
return t.map((e) => S(e)).filter(Boolean).join(" ").replace(/\s+/gu, " ").trim().slice(0, 120);
|
|
1173
|
+
}
|
|
1174
|
+
function V(t) {
|
|
1175
|
+
return t.flatMap((e) => k(e));
|
|
1176
|
+
}
|
|
1177
|
+
function T(t, e) {
|
|
1178
|
+
const n = b(t), r = new Set(b(e));
|
|
1179
|
+
return n.length === 0 || r.size === 0 ? 0 : n.filter((o) => r.has(o)).length / n.length;
|
|
1180
|
+
}
|
|
1181
|
+
function te(t, e) {
|
|
1182
|
+
const n = b(t), r = new Set(b(e));
|
|
1183
|
+
return n.length === 0 || r.size === 0 ? 0 : n.filter((o) => r.has(o)).length / n.length;
|
|
1184
|
+
}
|
|
1185
|
+
function ee(t, e) {
|
|
1186
|
+
return t <= 0 || e <= 0 ? 0 : Math.min(t, e) / Math.max(t, e);
|
|
1187
|
+
}
|
|
1188
|
+
function ne(t, e) {
|
|
1189
|
+
return !t || !e ? 0 : typeof e.get == "function" ? e.get(t) ?? 0 : e[t] ?? 0;
|
|
1190
|
+
}
|
|
1191
|
+
function re(t, e) {
|
|
1192
|
+
if (!t.productType || !e.productType || t.productType === e.productType) return !0;
|
|
1193
|
+
const n = new Set(k(t.productType)), r = /* @__PURE__ */ new Set([...k(e.productType), ...e.tokens]);
|
|
1194
|
+
return [...n].some((o) => r.has(o));
|
|
1195
|
+
}
|
|
1196
|
+
function oe(t) {
|
|
1197
|
+
return Math.max(0, Math.min(1, t));
|
|
1198
|
+
}
|
|
986
1199
|
export {
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1200
|
+
ce as A,
|
|
1201
|
+
Pt as C,
|
|
1202
|
+
ue as D,
|
|
1203
|
+
jt as E,
|
|
1204
|
+
B as F,
|
|
1205
|
+
ft as I,
|
|
1206
|
+
ie as L,
|
|
1207
|
+
bt as M,
|
|
1208
|
+
wt as N,
|
|
1209
|
+
Z as O,
|
|
1210
|
+
se as P,
|
|
1211
|
+
ae as R,
|
|
1212
|
+
et as S,
|
|
1213
|
+
P as T,
|
|
1214
|
+
ot as _,
|
|
1215
|
+
be as a,
|
|
1216
|
+
Ct as b,
|
|
1217
|
+
he as c,
|
|
1218
|
+
ge as d,
|
|
1219
|
+
ye as f,
|
|
1220
|
+
zt as g,
|
|
1221
|
+
D as h,
|
|
1222
|
+
S as i,
|
|
1223
|
+
Tt as j,
|
|
1224
|
+
tt as k,
|
|
1225
|
+
qt as l,
|
|
1226
|
+
Lt as m,
|
|
1227
|
+
C as n,
|
|
1228
|
+
Vt as o,
|
|
1229
|
+
me as p,
|
|
1230
|
+
we as r,
|
|
1231
|
+
k as s,
|
|
1232
|
+
ke as t,
|
|
1233
|
+
v as u,
|
|
1234
|
+
pe as v,
|
|
1235
|
+
le as w,
|
|
1236
|
+
de as x,
|
|
1237
|
+
fe as y,
|
|
1238
|
+
dt as z
|
|
1019
1239
|
};
|