@gengage/assistant-fe 0.1.2 → 0.1.4
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/LICENSE +4 -2
- package/README.md +30 -0
- package/dist/chat/session-persistence.d.ts +1 -1
- package/dist/chat/types.d.ts +1 -1
- package/dist/chat.iife.js.map +1 -1
- package/dist/chat.js +1 -1
- package/dist/common/api-paths.d.ts +1 -1
- package/dist/common/api-paths.d.ts.map +1 -1
- package/dist/common/index.d.ts +0 -2
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common.cjs +1 -1
- package/dist/common.cjs.map +1 -1
- package/dist/common.js +288 -520
- package/dist/common.js.map +1 -1
- package/dist/{index-CXbH-cw8.js → index-DC0Bo9EA.js} +2 -2
- package/dist/index-DC0Bo9EA.js.map +1 -0
- package/dist/index-DHfTHscz.cjs.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +24 -26
- package/dist/qna.cjs.map +1 -1
- package/dist/qna.iife.js.map +1 -1
- package/dist/qna.js +2 -2
- package/dist/qna.js.map +1 -1
- package/dist/schemas-CPkzbgia.js.map +1 -1
- package/dist/schemas-tCxs1sED.cjs.map +1 -1
- package/dist/simrel.iife.js.map +1 -1
- package/package.json +8 -2
- package/dist/common/merchant-configs.d.ts +0 -22
- package/dist/common/merchant-configs.d.ts.map +0 -1
- package/dist/index-CXbH-cw8.js.map +0 -1
package/dist/common.js
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { o as
|
|
2
|
-
import { B as
|
|
3
|
-
import { G as
|
|
4
|
-
import { V as
|
|
5
|
-
import { s as
|
|
6
|
-
import { GengageQNA as
|
|
7
|
-
import { GengageSimRel as
|
|
8
|
-
const
|
|
9
|
-
enabled:
|
|
10
|
-
}),
|
|
11
|
-
chat:
|
|
12
|
-
qna:
|
|
13
|
-
simrel:
|
|
14
|
-
}),
|
|
15
|
-
mode:
|
|
16
|
-
key:
|
|
17
|
-
headerName:
|
|
18
|
-
bodyField:
|
|
19
|
-
}), L =
|
|
20
|
-
enabled:
|
|
21
|
-
endpoint:
|
|
22
|
-
auth:
|
|
23
|
-
fireAndForget:
|
|
24
|
-
useBeacon:
|
|
25
|
-
keepaliveFetch:
|
|
26
|
-
timeoutMs:
|
|
27
|
-
maxRetries:
|
|
28
|
-
}),
|
|
29
|
-
idempotencyKey:
|
|
30
|
-
requireDomReady:
|
|
31
|
-
}), D =
|
|
1
|
+
import { o as d, s as l, U as k, _ as w, d as u, v as m, V as S, W as x, A as E } from "./schemas-CPkzbgia.js";
|
|
2
|
+
import { B as xe, X as Ee, a as Ie, z as Ae, Y as qe, b as Pe, N as Ue, Z as Re, $ as Me, c as Le, a0 as Fe, a1 as De, j as Oe, k as Be, a2 as Ne, a3 as $e, P as We, m as He, M as ze, a4 as Ge, q as Ke, p as Qe, a5 as Ve, a6 as je, r as Ye, a7 as Xe, T as Ze, h as Je, l as et, a8 as tt, g as it, Q as nt, a9 as ot, w as st, aa as at, ab as rt, ac as lt } from "./schemas-CPkzbgia.js";
|
|
3
|
+
import { G as I } from "./index-DC0Bo9EA.js";
|
|
4
|
+
import { V as dt, i as ut, r as ht } from "./index-DC0Bo9EA.js";
|
|
5
|
+
import { s as ft } from "./quantity-stepper-B8kX8GbN.js";
|
|
6
|
+
import { GengageQNA as A } from "./qna.js";
|
|
7
|
+
import { GengageSimRel as q } from "./simrel.js";
|
|
8
|
+
const f = d({
|
|
9
|
+
enabled: u().default(!0)
|
|
10
|
+
}), P = d({
|
|
11
|
+
chat: l().optional(),
|
|
12
|
+
qna: l().optional(),
|
|
13
|
+
simrel: l().optional()
|
|
14
|
+
}), U = d({}), R = w(["none", "x-api-key-header", "bearer-header", "body-api-key"]), M = d({
|
|
15
|
+
mode: R.default("none"),
|
|
16
|
+
key: l().optional(),
|
|
17
|
+
headerName: l().optional(),
|
|
18
|
+
bodyField: l().default("api_key")
|
|
19
|
+
}), L = d({
|
|
20
|
+
enabled: u().default(!0),
|
|
21
|
+
endpoint: l().default("/analytics"),
|
|
22
|
+
auth: M.default({ mode: "none", bodyField: "api_key" }),
|
|
23
|
+
fireAndForget: u().default(!0),
|
|
24
|
+
useBeacon: u().default(!0),
|
|
25
|
+
keepaliveFetch: u().default(!0),
|
|
26
|
+
timeoutMs: m().int().positive().default(4e3),
|
|
27
|
+
maxRetries: m().int().min(0).max(5).default(1)
|
|
28
|
+
}), v = "__gengageWidgetsInit", F = d({
|
|
29
|
+
idempotencyKey: l().default(v),
|
|
30
|
+
requireDomReady: u().default(!0)
|
|
31
|
+
}), D = w(["log-and-ignore", "throw", "delegate"]), O = d({
|
|
32
32
|
unknownActionPolicy: D.default("log-and-ignore"),
|
|
33
|
-
allowScriptCall:
|
|
34
|
-
}),
|
|
35
|
-
version:
|
|
36
|
-
accountId:
|
|
37
|
-
middlewareUrl:
|
|
38
|
-
locale:
|
|
39
|
-
widgets:
|
|
40
|
-
chat:
|
|
41
|
-
qna:
|
|
42
|
-
simrel:
|
|
33
|
+
allowScriptCall: u().default(!1)
|
|
34
|
+
}), _ = d({
|
|
35
|
+
version: k("1"),
|
|
36
|
+
accountId: l().min(1),
|
|
37
|
+
middlewareUrl: l().url(),
|
|
38
|
+
locale: l().optional(),
|
|
39
|
+
widgets: d({
|
|
40
|
+
chat: f.default({ enabled: !0 }),
|
|
41
|
+
qna: f.default({ enabled: !0 }),
|
|
42
|
+
simrel: f.default({ enabled: !0 })
|
|
43
43
|
}),
|
|
44
|
-
mounts:
|
|
45
|
-
transport:
|
|
44
|
+
mounts: P.default({}),
|
|
45
|
+
transport: U.default({}),
|
|
46
46
|
analytics: L.default({
|
|
47
47
|
enabled: !0,
|
|
48
48
|
endpoint: "/analytics",
|
|
@@ -53,23 +53,23 @@ const m = u({
|
|
|
53
53
|
timeoutMs: 4e3,
|
|
54
54
|
maxRetries: 1
|
|
55
55
|
}),
|
|
56
|
-
gtm:
|
|
56
|
+
gtm: F.default({
|
|
57
57
|
idempotencyKey: "__gengageWidgetsInit",
|
|
58
58
|
requireDomReady: !0
|
|
59
59
|
}),
|
|
60
|
-
actionHandling:
|
|
60
|
+
actionHandling: O.default({
|
|
61
61
|
unknownActionPolicy: "log-and-ignore",
|
|
62
62
|
allowScriptCall: !1
|
|
63
63
|
})
|
|
64
64
|
});
|
|
65
|
-
function
|
|
66
|
-
return
|
|
65
|
+
function B(e) {
|
|
66
|
+
return _.parse(e);
|
|
67
67
|
}
|
|
68
|
-
function
|
|
69
|
-
return
|
|
68
|
+
function N(e) {
|
|
69
|
+
return _.safeParse(e);
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
71
|
+
function he(e) {
|
|
72
|
+
return B({
|
|
73
73
|
version: "1",
|
|
74
74
|
accountId: e.accountId,
|
|
75
75
|
middlewareUrl: e.middlewareUrl,
|
|
@@ -81,7 +81,7 @@ function ge(e) {
|
|
|
81
81
|
}
|
|
82
82
|
});
|
|
83
83
|
}
|
|
84
|
-
const
|
|
84
|
+
const T = `${v}_overlay_`, $ = "#gengage-qna", W = "#gengage-simrel";
|
|
85
85
|
function p() {
|
|
86
86
|
const e = window;
|
|
87
87
|
return e.__gengageOverlayRegistry || (e.__gengageOverlayRegistry = {
|
|
@@ -89,29 +89,29 @@ function p() {
|
|
|
89
89
|
pending: {}
|
|
90
90
|
}), e.__gengageOverlayRegistry;
|
|
91
91
|
}
|
|
92
|
-
function
|
|
92
|
+
function H(e) {
|
|
93
93
|
const t = {
|
|
94
94
|
pageType: e.pageContext?.pageType ?? (e.sku !== void 0 ? "pdp" : "other")
|
|
95
|
-
},
|
|
96
|
-
return
|
|
95
|
+
}, i = e.pageContext;
|
|
96
|
+
return i?.sku !== void 0 && (t.sku = i.sku), i?.price !== void 0 && (t.price = i.price), i?.categoryTree !== void 0 && (t.categoryTree = i.categoryTree), i?.url !== void 0 && (t.url = i.url), i?.extra !== void 0 && (t.extra = i.extra), e.sku !== void 0 && (t.sku = e.sku), t;
|
|
97
97
|
}
|
|
98
|
-
function
|
|
99
|
-
const
|
|
98
|
+
function z(e, t) {
|
|
99
|
+
const i = {
|
|
100
100
|
...e,
|
|
101
101
|
...t,
|
|
102
102
|
pageType: t.pageType ?? e.pageType
|
|
103
103
|
};
|
|
104
|
-
return t.sku === void 0 && e.sku !== void 0 && (
|
|
104
|
+
return t.sku === void 0 && e.sku !== void 0 && (i.sku = e.sku), i;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
106
|
+
function y(e) {
|
|
107
107
|
return e instanceof HTMLElement || document.querySelector(e) ? e : null;
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
return e.idempotencyKey ?? `${
|
|
109
|
+
function C(e) {
|
|
110
|
+
return e.idempotencyKey ?? `${T}${e.accountId}`;
|
|
111
111
|
}
|
|
112
|
-
class
|
|
113
|
-
constructor(t,
|
|
114
|
-
this.options = t, this.onDestroy =
|
|
112
|
+
class G {
|
|
113
|
+
constructor(t, i) {
|
|
114
|
+
this.options = t, this.onDestroy = i, this._chat = null, this._qna = null, this._simrel = null, this._analyticsClient = null, this._destroyed = !1, this._queue = Promise.resolve(), this._warnedQnaMountMissing = !1, this._warnedSimRelMountMissing = !1, this.idempotencyKey = C(t), this.session = S(t.session), this._pageContext = H(t);
|
|
115
115
|
}
|
|
116
116
|
get chat() {
|
|
117
117
|
return this._chat;
|
|
@@ -136,25 +136,25 @@ class Q {
|
|
|
136
136
|
}
|
|
137
137
|
async updateContext(t) {
|
|
138
138
|
this._destroyed || await this._enqueue(async () => {
|
|
139
|
-
this._pageContext =
|
|
139
|
+
this._pageContext = z(this._pageContext, t), window.gengage || (window.gengage = {}), window.gengage.pageContext = this._pageContext, this._chat?.update(t), this._qna?.update(t), this._simrel?.update(t), await this._syncPdpWidgets();
|
|
140
140
|
});
|
|
141
141
|
}
|
|
142
|
-
async updateSku(t,
|
|
143
|
-
await this.updateContext({ sku: t, pageType:
|
|
142
|
+
async updateSku(t, i = "pdp") {
|
|
143
|
+
await this.updateContext({ sku: t, pageType: i });
|
|
144
144
|
}
|
|
145
145
|
destroy() {
|
|
146
146
|
this._destroyed || (this._destroyed = !0, this._chat?.destroy(), this._qna?.destroy(), this._simrel?.destroy(), this._chat = null, this._qna = null, this._simrel = null, window.gengage?.overlay === this && delete window.gengage.overlay, this.onDestroy());
|
|
147
147
|
}
|
|
148
148
|
async _initChat() {
|
|
149
149
|
if (this.options.chat?.enabled === !1) return;
|
|
150
|
-
const t = this.options.middlewareUrl,
|
|
150
|
+
const t = this.options.middlewareUrl, i = {
|
|
151
151
|
accountId: this.options.accountId,
|
|
152
152
|
middlewareUrl: t,
|
|
153
153
|
session: this.session,
|
|
154
154
|
pageContext: this._pageContext,
|
|
155
155
|
variant: this.options.chat?.variant ?? "floating"
|
|
156
156
|
};
|
|
157
|
-
this.options.theme !== void 0 && (
|
|
157
|
+
this.options.theme !== void 0 && (i.theme = this.options.theme), this.options.locale !== void 0 && (i.locale = this.options.locale), this.options.pricing !== void 0 && (i.pricing = this.options.pricing), this.options.chat?.mountTarget !== void 0 && (i.mountTarget = this.options.chat.mountTarget), this.options.chat?.launcherSvg !== void 0 && (i.launcherSvg = this.options.chat.launcherSvg), this.options.chat?.hideMobileLauncher !== void 0 && (i.hideMobileLauncher = this.options.chat.hideMobileLauncher), this.options.chat?.mobileBreakpoint !== void 0 && (i.mobileBreakpoint = this.options.chat.mobileBreakpoint), this.options.chat?.mobileInitialState !== void 0 && (i.mobileInitialState = this.options.chat.mobileInitialState), this.options.chat?.i18n !== void 0 && (i.i18n = this.options.chat.i18n), this.options.chat?.actionHandling !== void 0 && (i.actionHandling = this.options.chat.actionHandling), this.options.onScriptCall !== void 0 && (i.onScriptCall = this.options.onScriptCall), this._chat = new I(), await this._chat.init(i);
|
|
158
158
|
}
|
|
159
159
|
async _syncPdpWidgets() {
|
|
160
160
|
if (this._destroyed) return;
|
|
@@ -163,48 +163,48 @@ class Q {
|
|
|
163
163
|
this._destroyPdpWidgets();
|
|
164
164
|
return;
|
|
165
165
|
}
|
|
166
|
-
const
|
|
166
|
+
const n = this.options.middlewareUrl;
|
|
167
167
|
if (this.options.qna?.enabled !== !1) {
|
|
168
|
-
const
|
|
169
|
-
if (
|
|
168
|
+
const s = this.options.qna?.mountTarget ?? $, a = y(s);
|
|
169
|
+
if (a)
|
|
170
170
|
if (this._warnedQnaMountMissing = !1, this._qna)
|
|
171
171
|
this._qna.show(), this._qna.update({ pageType: "pdp", sku: t });
|
|
172
172
|
else {
|
|
173
|
-
const
|
|
173
|
+
const r = new A(), o = {
|
|
174
174
|
accountId: this.options.accountId,
|
|
175
|
-
middlewareUrl:
|
|
175
|
+
middlewareUrl: n,
|
|
176
176
|
session: this.session,
|
|
177
177
|
pageContext: {
|
|
178
178
|
pageType: "pdp",
|
|
179
179
|
sku: t
|
|
180
180
|
},
|
|
181
|
-
mountTarget:
|
|
181
|
+
mountTarget: a
|
|
182
182
|
};
|
|
183
|
-
this.options.theme !== void 0 && (
|
|
183
|
+
this.options.theme !== void 0 && (o.theme = this.options.theme), this.options.qna?.ctaText !== void 0 && (o.ctaText = this.options.qna.ctaText), this.options.qna?.inputPlaceholder !== void 0 && (o.inputPlaceholder = this.options.qna.inputPlaceholder), await r.init(o), this._qna = r;
|
|
184
184
|
}
|
|
185
185
|
else
|
|
186
|
-
this._qna?.destroy(), this._qna = null, this._warnedQnaMountMissing || (console.warn(`[gengage] QNA mount target not found: ${
|
|
186
|
+
this._qna?.destroy(), this._qna = null, this._warnedQnaMountMissing || (console.warn(`[gengage] QNA mount target not found: ${s}`), this._warnedQnaMountMissing = !0);
|
|
187
187
|
} else
|
|
188
188
|
this._qna?.destroy(), this._qna = null;
|
|
189
189
|
if (this.options.simrel?.enabled !== !1) {
|
|
190
|
-
const
|
|
191
|
-
if (
|
|
190
|
+
const s = this.options.simrel?.mountTarget ?? W, a = y(s);
|
|
191
|
+
if (a)
|
|
192
192
|
if (this._warnedSimRelMountMissing = !1, this._simrel)
|
|
193
193
|
this._simrel.show(), this._simrel.update({ pageType: "pdp", sku: t });
|
|
194
194
|
else {
|
|
195
|
-
const
|
|
195
|
+
const r = new q(), o = {
|
|
196
196
|
accountId: this.options.accountId,
|
|
197
|
-
middlewareUrl:
|
|
197
|
+
middlewareUrl: n,
|
|
198
198
|
session: this.session,
|
|
199
199
|
sku: t,
|
|
200
|
-
mountTarget:
|
|
200
|
+
mountTarget: a
|
|
201
201
|
};
|
|
202
|
-
this.options.theme !== void 0 && (
|
|
202
|
+
this.options.theme !== void 0 && (o.theme = this.options.theme), this.options.pricing !== void 0 && (o.pricing = this.options.pricing), this.options.simrel?.discountType !== void 0 && (o.discountType = this.options.simrel.discountType), this.options.onAddToCart !== void 0 && (o.onAddToCart = this.options.onAddToCart), this.options.onProductNavigate !== void 0 ? o.onProductNavigate = this.options.onProductNavigate : o.onProductNavigate = (c, h, g) => {
|
|
203
203
|
this._chat?.saveSession(g ?? this.session.sessionId, h), window.location.href = c;
|
|
204
|
-
}, await
|
|
204
|
+
}, await r.init(o), this._simrel = r;
|
|
205
205
|
}
|
|
206
206
|
else
|
|
207
|
-
this._simrel?.destroy(), this._simrel = null, this._warnedSimRelMountMissing || (console.warn(`[gengage] SimRel mount target not found: ${
|
|
207
|
+
this._simrel?.destroy(), this._simrel = null, this._warnedSimRelMountMissing || (console.warn(`[gengage] SimRel mount target not found: ${s}`), this._warnedSimRelMountMissing = !0);
|
|
208
208
|
} else
|
|
209
209
|
this._simrel?.destroy(), this._simrel = null;
|
|
210
210
|
}
|
|
@@ -212,32 +212,32 @@ class Q {
|
|
|
212
212
|
this._qna?.destroy(), this._simrel?.destroy(), this._qna = null, this._simrel = null;
|
|
213
213
|
}
|
|
214
214
|
_enqueue(t) {
|
|
215
|
-
const
|
|
216
|
-
return this._queue =
|
|
217
|
-
}),
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
async function
|
|
221
|
-
const t =
|
|
222
|
-
if (
|
|
223
|
-
const
|
|
224
|
-
if (
|
|
225
|
-
const
|
|
226
|
-
const
|
|
227
|
-
delete
|
|
228
|
-
}),
|
|
229
|
-
throw delete
|
|
215
|
+
const i = this._queue.then(t);
|
|
216
|
+
return this._queue = i.catch((n) => {
|
|
217
|
+
}), i;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
async function K(e) {
|
|
221
|
+
const t = C(e), i = p(), n = i.instances[t];
|
|
222
|
+
if (n) return n;
|
|
223
|
+
const s = i.pending[t];
|
|
224
|
+
if (s) return s;
|
|
225
|
+
const a = new G(e, () => {
|
|
226
|
+
const o = p();
|
|
227
|
+
delete o.instances[t], delete o.pending[t];
|
|
228
|
+
}), r = a.init().then(() => (i.instances[t] = a, delete i.pending[t], a)).catch((o) => {
|
|
229
|
+
throw delete i.pending[t], o;
|
|
230
230
|
});
|
|
231
|
-
return
|
|
231
|
+
return i.pending[t] = r, r;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function Q(e) {
|
|
234
234
|
return p().instances[e] ?? null;
|
|
235
235
|
}
|
|
236
|
-
function
|
|
237
|
-
|
|
236
|
+
function ge(e) {
|
|
237
|
+
Q(e)?.destroy();
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
return `${
|
|
239
|
+
function fe(e) {
|
|
240
|
+
return `${T}${e}`;
|
|
241
241
|
}
|
|
242
242
|
const V = {
|
|
243
243
|
enabled: !0,
|
|
@@ -249,19 +249,19 @@ const V = {
|
|
|
249
249
|
maxRetries: 1,
|
|
250
250
|
batchSize: 10,
|
|
251
251
|
flushIntervalMs: 250
|
|
252
|
-
},
|
|
252
|
+
}, j = {
|
|
253
253
|
mode: "none",
|
|
254
254
|
key: "",
|
|
255
255
|
headerName: "X-API-Key",
|
|
256
256
|
bodyField: "api_key"
|
|
257
257
|
};
|
|
258
|
-
class
|
|
258
|
+
class Y {
|
|
259
259
|
constructor(t) {
|
|
260
260
|
this.queue = [], this.flushTimer = null, this.config = {
|
|
261
261
|
...V,
|
|
262
262
|
...t,
|
|
263
263
|
auth: {
|
|
264
|
-
...
|
|
264
|
+
...j,
|
|
265
265
|
...t.auth ?? {}
|
|
266
266
|
}
|
|
267
267
|
}, this.onPageHideBound = () => {
|
|
@@ -270,8 +270,8 @@ class Z {
|
|
|
270
270
|
}
|
|
271
271
|
track(t) {
|
|
272
272
|
if (!this.config.enabled) return;
|
|
273
|
-
const
|
|
274
|
-
if (this.queue.push(
|
|
273
|
+
const i = X(t);
|
|
274
|
+
if (this.queue.push(i), this.queue.length >= this.config.batchSize) {
|
|
275
275
|
this.scheduleImmediateFlush();
|
|
276
276
|
return;
|
|
277
277
|
}
|
|
@@ -279,8 +279,8 @@ class Z {
|
|
|
279
279
|
}
|
|
280
280
|
async flush(t = {}) {
|
|
281
281
|
if (!this.config.enabled || this.queue.length === 0) return;
|
|
282
|
-
const
|
|
283
|
-
await this.sendWithRetry(
|
|
282
|
+
const i = this.queue.splice(0, this.config.batchSize), n = this.buildTransportBody(i), s = Z(this.config.endpoint, this.config.middlewareUrl), a = t.preferBeacon ?? this.config.useBeacon;
|
|
283
|
+
await this.sendWithRetry(s, n, a);
|
|
284
284
|
}
|
|
285
285
|
/** Drain the entire queue, flushing in batch-sized chunks. */
|
|
286
286
|
async flushAll(t = {}) {
|
|
@@ -299,49 +299,49 @@ class Z {
|
|
|
299
299
|
this.flushTimer && (clearTimeout(this.flushTimer), this.flushTimer = null), this.flush();
|
|
300
300
|
}
|
|
301
301
|
buildTransportBody(t) {
|
|
302
|
-
const
|
|
303
|
-
return this.config.auth.mode === "body-api-key" && this.config.auth.key && (
|
|
302
|
+
const i = { events: t };
|
|
303
|
+
return this.config.auth.mode === "body-api-key" && this.config.auth.key && (i[this.config.auth.bodyField] = this.config.auth.key), i;
|
|
304
304
|
}
|
|
305
|
-
async sendWithRetry(t,
|
|
306
|
-
let
|
|
307
|
-
for (;
|
|
308
|
-
|
|
305
|
+
async sendWithRetry(t, i, n) {
|
|
306
|
+
let s = 0;
|
|
307
|
+
for (; s <= this.config.maxRetries; ) {
|
|
308
|
+
s += 1;
|
|
309
309
|
try {
|
|
310
|
-
if (await this.send(t,
|
|
310
|
+
if (await this.send(t, i, n)) return;
|
|
311
311
|
} catch {
|
|
312
312
|
}
|
|
313
|
-
|
|
313
|
+
s <= this.config.maxRetries && await new Promise((a) => setTimeout(a, Math.min(1e3, 100 * Math.pow(2, s - 1))));
|
|
314
314
|
}
|
|
315
315
|
}
|
|
316
|
-
async send(t,
|
|
317
|
-
const
|
|
318
|
-
if (
|
|
319
|
-
const h = new Blob([
|
|
316
|
+
async send(t, i, n) {
|
|
317
|
+
const s = JSON.stringify(i);
|
|
318
|
+
if (n && this.config.useBeacon && this.config.auth.mode !== "x-api-key-header" && this.config.auth.mode !== "bearer-header" && J()) {
|
|
319
|
+
const h = new Blob([s], { type: "application/json" });
|
|
320
320
|
if (navigator.sendBeacon(t, h)) return !0;
|
|
321
321
|
}
|
|
322
322
|
if (typeof fetch > "u") return !1;
|
|
323
|
-
const
|
|
323
|
+
const r = {
|
|
324
324
|
"Content-Type": "application/json"
|
|
325
325
|
};
|
|
326
|
-
this.config.auth.mode === "x-api-key-header" && this.config.auth.key && (
|
|
327
|
-
const
|
|
326
|
+
this.config.auth.mode === "x-api-key-header" && this.config.auth.key && (r[this.config.auth.headerName] = this.config.auth.key), this.config.auth.mode === "bearer-header" && this.config.auth.key && (r.Authorization = `Bearer ${this.config.auth.key}`);
|
|
327
|
+
const o = typeof AbortController < "u" ? new AbortController() : null, c = o ? setTimeout(() => o.abort(), this.config.timeoutMs) : null;
|
|
328
328
|
try {
|
|
329
329
|
const h = {
|
|
330
330
|
method: "POST",
|
|
331
|
-
headers:
|
|
332
|
-
body:
|
|
331
|
+
headers: r,
|
|
332
|
+
body: s,
|
|
333
333
|
keepalive: this.config.keepaliveFetch && this.config.fireAndForget
|
|
334
334
|
};
|
|
335
|
-
return
|
|
335
|
+
return o && (h.signal = o.signal), (await fetch(t, h)).ok;
|
|
336
336
|
} finally {
|
|
337
337
|
c && clearTimeout(c);
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
340
|
}
|
|
341
|
-
function
|
|
342
|
-
return new
|
|
341
|
+
function pe(e) {
|
|
342
|
+
return new Y(e);
|
|
343
343
|
}
|
|
344
|
-
function
|
|
344
|
+
function X(e) {
|
|
345
345
|
const t = {
|
|
346
346
|
event_name: e.event_name,
|
|
347
347
|
event_version: e.event_version ?? "1",
|
|
@@ -353,15 +353,15 @@ function J(e) {
|
|
|
353
353
|
};
|
|
354
354
|
return e.view_id !== void 0 && (t.view_id = e.view_id), e.user_id !== void 0 && (t.user_id = e.user_id), e.widget !== void 0 && (t.widget = e.widget), e.page_type !== void 0 && (t.page_type = e.page_type), e.sku !== void 0 && (t.sku = e.sku), t;
|
|
355
355
|
}
|
|
356
|
-
function
|
|
356
|
+
function Z(e, t) {
|
|
357
357
|
if (/^https?:\/\//i.test(e)) return e;
|
|
358
|
-
const
|
|
359
|
-
return `${
|
|
358
|
+
const i = E(t), n = e.startsWith("/") ? e : `/${e}`;
|
|
359
|
+
return `${i}${n}`;
|
|
360
360
|
}
|
|
361
|
-
function
|
|
361
|
+
function J() {
|
|
362
362
|
return typeof navigator < "u" && typeof navigator.sendBeacon == "function";
|
|
363
363
|
}
|
|
364
|
-
const
|
|
364
|
+
const ee = {
|
|
365
365
|
primaryColor: "#000000",
|
|
366
366
|
primaryForeground: "#ffffff",
|
|
367
367
|
backgroundColor: "#ffffff",
|
|
@@ -386,30 +386,30 @@ const oe = {
|
|
|
386
386
|
"--gengage-qna-input-radius": "14px",
|
|
387
387
|
"--gengage-simrel-card-radius": "14px"
|
|
388
388
|
};
|
|
389
|
-
function
|
|
390
|
-
return { ...
|
|
389
|
+
function me(e) {
|
|
390
|
+
return { ...ee, ...e };
|
|
391
391
|
}
|
|
392
|
-
const
|
|
393
|
-
function
|
|
392
|
+
const b = "tr";
|
|
393
|
+
function ye(e) {
|
|
394
394
|
return {
|
|
395
395
|
ACCOUNT_ID: e.accountId,
|
|
396
396
|
MIDDLEWARE_URL: e.middlewareUrl,
|
|
397
|
-
LOCALE: e.locale ??
|
|
397
|
+
LOCALE: e.locale ?? b
|
|
398
398
|
};
|
|
399
399
|
}
|
|
400
|
-
function
|
|
401
|
-
const
|
|
400
|
+
function we(e, t = {}) {
|
|
401
|
+
const i = {
|
|
402
402
|
accountId: e.accountId,
|
|
403
403
|
middlewareUrl: e.middlewareUrl,
|
|
404
404
|
session: { sessionId: e.sessionId },
|
|
405
405
|
variant: "floating",
|
|
406
|
-
locale: e.locale ??
|
|
406
|
+
locale: e.locale ?? b,
|
|
407
407
|
...t
|
|
408
408
|
};
|
|
409
|
-
return e.theme !== void 0 && (
|
|
409
|
+
return e.theme !== void 0 && (i.theme = e.theme), i;
|
|
410
410
|
}
|
|
411
|
-
function
|
|
412
|
-
const
|
|
411
|
+
function ve(e, t = {}) {
|
|
412
|
+
const i = {
|
|
413
413
|
accountId: e.accountId,
|
|
414
414
|
middlewareUrl: e.middlewareUrl,
|
|
415
415
|
session: { sessionId: e.sessionId },
|
|
@@ -417,10 +417,10 @@ function Ce(e, t = {}) {
|
|
|
417
417
|
mountTarget: e.mountTarget,
|
|
418
418
|
...t
|
|
419
419
|
};
|
|
420
|
-
return e.theme !== void 0 && (
|
|
420
|
+
return e.theme !== void 0 && (i.theme = e.theme), i;
|
|
421
421
|
}
|
|
422
|
-
function
|
|
423
|
-
const
|
|
422
|
+
function _e(e, t = {}) {
|
|
423
|
+
const i = {
|
|
424
424
|
accountId: e.accountId,
|
|
425
425
|
middlewareUrl: e.middlewareUrl,
|
|
426
426
|
session: { sessionId: e.sessionId },
|
|
@@ -428,7 +428,7 @@ function be(e, t = {}) {
|
|
|
428
428
|
mountTarget: e.mountTarget,
|
|
429
429
|
...t
|
|
430
430
|
};
|
|
431
|
-
return e.theme !== void 0 && (
|
|
431
|
+
return e.theme !== void 0 && (i.theme = e.theme), i;
|
|
432
432
|
}
|
|
433
433
|
function Te(e, t = {}) {
|
|
434
434
|
return {
|
|
@@ -440,109 +440,109 @@ function Te(e, t = {}) {
|
|
|
440
440
|
...t
|
|
441
441
|
};
|
|
442
442
|
}
|
|
443
|
-
function
|
|
443
|
+
function te(e) {
|
|
444
444
|
try {
|
|
445
445
|
return document.querySelector(e), !0;
|
|
446
446
|
} catch {
|
|
447
447
|
return !1;
|
|
448
448
|
}
|
|
449
449
|
}
|
|
450
|
-
function
|
|
451
|
-
const
|
|
452
|
-
["qna",
|
|
453
|
-
["simrel",
|
|
454
|
-
["chat",
|
|
450
|
+
function ie(e, t) {
|
|
451
|
+
const i = [], n = e.mounts, s = [
|
|
452
|
+
["qna", n.qna],
|
|
453
|
+
["simrel", n.simrel],
|
|
454
|
+
["chat", n.chat]
|
|
455
455
|
];
|
|
456
|
-
for (const [
|
|
457
|
-
if (
|
|
458
|
-
if (!
|
|
459
|
-
|
|
456
|
+
for (const [r, o] of s)
|
|
457
|
+
if (o !== void 0) {
|
|
458
|
+
if (!te(o)) {
|
|
459
|
+
i.push({
|
|
460
460
|
code: "INVALID_SELECTOR",
|
|
461
|
-
message: `[gengage preflight] ${
|
|
461
|
+
message: `[gengage preflight] ${r} mount selector is invalid CSS: "${o}"`,
|
|
462
462
|
severity: "error"
|
|
463
463
|
});
|
|
464
464
|
continue;
|
|
465
465
|
}
|
|
466
|
-
document.querySelector(
|
|
466
|
+
document.querySelector(o) || i.push({
|
|
467
467
|
code: "MOUNT_NOT_FOUND",
|
|
468
|
-
message: `[gengage preflight] ${
|
|
468
|
+
message: `[gengage preflight] ${r} mount target not found: "${o}" — widget will skip or wait for DOM`,
|
|
469
469
|
severity: "warn"
|
|
470
470
|
});
|
|
471
471
|
}
|
|
472
|
-
const
|
|
473
|
-
if (window[
|
|
472
|
+
const a = e.gtm.idempotencyKey;
|
|
473
|
+
if (window[a] !== void 0 && i.push({
|
|
474
474
|
code: "DUPLICATE_IDEMPOTENCY",
|
|
475
|
-
message: `[gengage preflight] window["${
|
|
475
|
+
message: `[gengage preflight] window["${a}"] already exists — widgets may have already initialized`,
|
|
476
476
|
severity: "warn"
|
|
477
477
|
}), !t?.skipCspCheck) {
|
|
478
|
-
let
|
|
479
|
-
const
|
|
480
|
-
c.blockedURI && e.middlewareUrl.startsWith(c.blockedURI) && (
|
|
478
|
+
let r = !1;
|
|
479
|
+
const o = (c) => {
|
|
480
|
+
c.blockedURI && e.middlewareUrl.startsWith(c.blockedURI) && (r = !0);
|
|
481
481
|
};
|
|
482
|
-
document.addEventListener("securitypolicyviolation",
|
|
482
|
+
document.addEventListener("securitypolicyviolation", o);
|
|
483
483
|
try {
|
|
484
484
|
fetch(e.middlewareUrl, { method: "HEAD", mode: "no-cors" }).catch(() => {
|
|
485
485
|
});
|
|
486
486
|
} catch {
|
|
487
|
-
|
|
487
|
+
r = !0;
|
|
488
488
|
}
|
|
489
|
-
document.removeEventListener("securitypolicyviolation",
|
|
489
|
+
document.removeEventListener("securitypolicyviolation", o), r && i.push({
|
|
490
490
|
code: "CSP_BLOCKED",
|
|
491
491
|
message: `[gengage preflight] middleware URL may be blocked by Content-Security-Policy: "${e.middlewareUrl}". Add it to connect-src.`,
|
|
492
492
|
severity: "warn"
|
|
493
493
|
});
|
|
494
494
|
}
|
|
495
|
-
for (const
|
|
496
|
-
|
|
495
|
+
for (const r of i)
|
|
496
|
+
r.severity === "error" ? console.error(r.message) : console.warn(r.message);
|
|
497
497
|
return {
|
|
498
|
-
ok:
|
|
499
|
-
warnings:
|
|
498
|
+
ok: i.every((r) => r.severity !== "error"),
|
|
499
|
+
warnings: i
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
|
-
function
|
|
503
|
-
const t =
|
|
502
|
+
function ne(e) {
|
|
503
|
+
const t = N(e);
|
|
504
504
|
if (!t.success) {
|
|
505
|
-
const
|
|
506
|
-
throw new Error(`[gengage] Invalid runtime config: ${
|
|
505
|
+
const i = t.error.issues.map((n) => `${n.path.join(".")}: ${n.message}`).join("; ");
|
|
506
|
+
throw new Error(`[gengage] Invalid runtime config: ${i}`);
|
|
507
507
|
}
|
|
508
508
|
return t.data;
|
|
509
509
|
}
|
|
510
|
-
function
|
|
511
|
-
const
|
|
510
|
+
function oe(e, t, i) {
|
|
511
|
+
const n = {
|
|
512
512
|
accountId: e.accountId,
|
|
513
513
|
middlewareUrl: e.middlewareUrl,
|
|
514
514
|
idempotencyKey: e.gtm.idempotencyKey
|
|
515
515
|
};
|
|
516
|
-
return e.locale !== void 0 && (
|
|
516
|
+
return e.locale !== void 0 && (n.locale = e.locale), i !== void 0 && (n.pageContext = i, i.sku !== void 0 && (n.sku = i.sku)), n.chat = {
|
|
517
517
|
enabled: e.widgets.chat.enabled
|
|
518
|
-
}, e.mounts.chat !== void 0 && (
|
|
518
|
+
}, e.mounts.chat !== void 0 && (n.chat.mountTarget = e.mounts.chat), n.qna = {
|
|
519
519
|
enabled: e.widgets.qna.enabled
|
|
520
|
-
}, e.mounts.qna !== void 0 && (
|
|
520
|
+
}, e.mounts.qna !== void 0 && (n.qna.mountTarget = e.mounts.qna), n.simrel = {
|
|
521
521
|
enabled: e.widgets.simrel.enabled
|
|
522
|
-
}, e.mounts.simrel !== void 0 && (
|
|
522
|
+
}, e.mounts.simrel !== void 0 && (n.simrel.mountTarget = e.mounts.simrel), t?.onAddToCart !== void 0 && (n.onAddToCart = t.onAddToCart), t?.onProductNavigate !== void 0 && (n.onProductNavigate = t.onProductNavigate), t?.onScriptCall !== void 0 && (n.onScriptCall = t.onScriptCall), n;
|
|
523
523
|
}
|
|
524
|
-
async function
|
|
525
|
-
const t =
|
|
524
|
+
async function Ce(e) {
|
|
525
|
+
const t = ne(e.runtimeConfig);
|
|
526
526
|
if (e.preflight !== !1) {
|
|
527
|
-
const
|
|
528
|
-
if (!
|
|
529
|
-
const
|
|
530
|
-
throw new Error(`[gengage] Preflight failed: ${
|
|
527
|
+
const a = ie(t);
|
|
528
|
+
if (!a.ok) {
|
|
529
|
+
const r = a.warnings.filter((o) => o.severity === "error");
|
|
530
|
+
throw new Error(`[gengage] Preflight failed: ${r.map((o) => o.message).join("; ")}`);
|
|
531
531
|
}
|
|
532
532
|
}
|
|
533
|
-
const
|
|
533
|
+
const i = e.contextResolver?.(), n = oe(t, e.hostActions, i), s = await K(n);
|
|
534
534
|
if (e.contextResolver !== void 0) {
|
|
535
|
-
const
|
|
536
|
-
const c =
|
|
537
|
-
|
|
535
|
+
const a = e.contextResolver, r = () => {
|
|
536
|
+
const c = a();
|
|
537
|
+
s.updateContext(c);
|
|
538
538
|
};
|
|
539
|
-
window.addEventListener("gengage:context:update",
|
|
540
|
-
const
|
|
541
|
-
|
|
542
|
-
window.removeEventListener("gengage:context:update",
|
|
539
|
+
window.addEventListener("gengage:context:update", r);
|
|
540
|
+
const o = s.destroy.bind(s);
|
|
541
|
+
s.destroy = () => {
|
|
542
|
+
window.removeEventListener("gengage:context:update", r), o();
|
|
543
543
|
};
|
|
544
544
|
}
|
|
545
|
-
return
|
|
545
|
+
return s;
|
|
546
546
|
}
|
|
547
547
|
const se = [
|
|
548
548
|
{
|
|
@@ -567,338 +567,106 @@ const se = [
|
|
|
567
567
|
urlPatterns: ["/urun/", "/product/", "/p/", "/-p-", "/-pm-"]
|
|
568
568
|
}
|
|
569
569
|
];
|
|
570
|
-
function
|
|
571
|
-
const
|
|
572
|
-
if (!
|
|
573
|
-
const
|
|
574
|
-
for (const
|
|
575
|
-
if (!(
|
|
570
|
+
function ae(e, t) {
|
|
571
|
+
const i = t ?? (typeof window < "u" ? new URL(window.location.href) : null);
|
|
572
|
+
if (!i) return "other";
|
|
573
|
+
const n = e ?? se, s = i.pathname;
|
|
574
|
+
for (const a of n)
|
|
575
|
+
if (!(a.urlPatterns && !a.urlPatterns.some((o) => {
|
|
576
576
|
try {
|
|
577
|
-
return new RegExp(
|
|
577
|
+
return new RegExp(o, "i").test(s);
|
|
578
578
|
} catch {
|
|
579
579
|
return !1;
|
|
580
580
|
}
|
|
581
|
-
})) && !(
|
|
582
|
-
return
|
|
581
|
+
})) && !(a.queryParam && !i.searchParams.has(a.queryParam)) && !(a.selector && typeof document < "u" && !document.querySelector(a.selector)))
|
|
582
|
+
return a.pageType;
|
|
583
583
|
return "other";
|
|
584
584
|
}
|
|
585
|
-
function
|
|
585
|
+
function re(e) {
|
|
586
586
|
const t = e ?? (typeof window < "u" ? new URL(window.location.href) : null);
|
|
587
587
|
if (!t) return;
|
|
588
|
-
const
|
|
589
|
-
if (
|
|
590
|
-
const
|
|
591
|
-
if (
|
|
588
|
+
const i = t.pathname, n = i.match(/\/(?:p|urun|product)\/([^/?#]+)/i);
|
|
589
|
+
if (n?.[1]) return n[1];
|
|
590
|
+
const s = i.match(/-p-(\d+)/i);
|
|
591
|
+
if (s?.[1]) return s[1];
|
|
592
592
|
}
|
|
593
|
-
function
|
|
594
|
-
const t =
|
|
593
|
+
function be(e) {
|
|
594
|
+
const t = ae(e), i = { pageType: t };
|
|
595
595
|
if (t === "pdp") {
|
|
596
|
-
const
|
|
597
|
-
|
|
598
|
-
}
|
|
599
|
-
return typeof window < "u" && (o.url = window.location.href), o;
|
|
600
|
-
}
|
|
601
|
-
const l = "https://chatbe-dev.gengage.ai", I = {
|
|
602
|
-
koctascomtr: {
|
|
603
|
-
accountId: "koctascomtr",
|
|
604
|
-
locale: "tr",
|
|
605
|
-
middlewareUrl: l,
|
|
606
|
-
theme: {
|
|
607
|
-
primaryColor: "#ec6e00",
|
|
608
|
-
primaryForeground: "#ffffff",
|
|
609
|
-
backgroundColor: "#ffffff",
|
|
610
|
-
foregroundColor: "#222222",
|
|
611
|
-
borderRadius: "8px",
|
|
612
|
-
fontFamily: '"Source Sans Pro", "Helvetica Neue", Arial, sans-serif',
|
|
613
|
-
fontSize: "14px"
|
|
614
|
-
},
|
|
615
|
-
chatI18n: {
|
|
616
|
-
inputPlaceholder: "Ürün ara, soru sor",
|
|
617
|
-
poweredBy: "Koçtaş AI Asistan"
|
|
618
|
-
}
|
|
619
|
-
},
|
|
620
|
-
n11com: {
|
|
621
|
-
accountId: "n11com",
|
|
622
|
-
locale: "tr",
|
|
623
|
-
middlewareUrl: l,
|
|
624
|
-
theme: {
|
|
625
|
-
primaryColor: "#ff44ef",
|
|
626
|
-
primaryForeground: "#ffffff",
|
|
627
|
-
backgroundColor: "#ffffff",
|
|
628
|
-
foregroundColor: "#222222",
|
|
629
|
-
borderRadius: "8px",
|
|
630
|
-
fontFamily: "Arial, Helvetica, sans-serif",
|
|
631
|
-
fontSize: "14px"
|
|
632
|
-
},
|
|
633
|
-
chatI18n: {
|
|
634
|
-
inputPlaceholder: "Ne aramıştınız?",
|
|
635
|
-
poweredBy: "n11 AI Asistan"
|
|
636
|
-
}
|
|
637
|
-
},
|
|
638
|
-
hepsiburadacom: {
|
|
639
|
-
accountId: "hepsiburadacom",
|
|
640
|
-
locale: "tr",
|
|
641
|
-
middlewareUrl: l,
|
|
642
|
-
theme: {
|
|
643
|
-
primaryColor: "#ff6000",
|
|
644
|
-
primaryForeground: "#ffffff",
|
|
645
|
-
backgroundColor: "#ffffff",
|
|
646
|
-
foregroundColor: "#333333",
|
|
647
|
-
borderRadius: "8px",
|
|
648
|
-
fontFamily: '"Open Sans", Arial, sans-serif',
|
|
649
|
-
fontSize: "14px"
|
|
650
|
-
},
|
|
651
|
-
chatI18n: {
|
|
652
|
-
inputPlaceholder: "Ürün ara veya soru sor",
|
|
653
|
-
poweredBy: "Hepsiburada AI Asistan"
|
|
654
|
-
}
|
|
655
|
-
},
|
|
656
|
-
arcelikcomtr: {
|
|
657
|
-
accountId: "arcelikcomtr",
|
|
658
|
-
locale: "tr",
|
|
659
|
-
middlewareUrl: l,
|
|
660
|
-
theme: {
|
|
661
|
-
primaryColor: "#e4002b",
|
|
662
|
-
primaryForeground: "#ffffff",
|
|
663
|
-
backgroundColor: "#ffffff",
|
|
664
|
-
foregroundColor: "#222222",
|
|
665
|
-
borderRadius: "8px",
|
|
666
|
-
fontFamily: '"Arcelik Sans", "Helvetica Neue", Arial, sans-serif',
|
|
667
|
-
fontSize: "14px"
|
|
668
|
-
},
|
|
669
|
-
chatI18n: {
|
|
670
|
-
inputPlaceholder: "Size nasıl yardımcı olabilirim?",
|
|
671
|
-
poweredBy: "Arçelik AI Asistan"
|
|
672
|
-
}
|
|
673
|
-
},
|
|
674
|
-
yatasbeddingcomtr: {
|
|
675
|
-
accountId: "yatasbeddingcomtr",
|
|
676
|
-
locale: "tr",
|
|
677
|
-
middlewareUrl: l,
|
|
678
|
-
theme: {
|
|
679
|
-
primaryColor: "#c8102e",
|
|
680
|
-
primaryForeground: "#ffffff",
|
|
681
|
-
backgroundColor: "#ffffff",
|
|
682
|
-
foregroundColor: "#333333",
|
|
683
|
-
borderRadius: "8px",
|
|
684
|
-
fontFamily: '"Nunito Sans", Arial, sans-serif',
|
|
685
|
-
fontSize: "14px"
|
|
686
|
-
},
|
|
687
|
-
chatI18n: {
|
|
688
|
-
inputPlaceholder: "Yatak, baza veya ürün arayın",
|
|
689
|
-
poweredBy: "Yataş AI Asistan"
|
|
690
|
-
}
|
|
691
|
-
},
|
|
692
|
-
trendyolcom: {
|
|
693
|
-
accountId: "trendyolcom",
|
|
694
|
-
locale: "tr",
|
|
695
|
-
middlewareUrl: l,
|
|
696
|
-
theme: {
|
|
697
|
-
primaryColor: "#f27a1a",
|
|
698
|
-
primaryForeground: "#ffffff",
|
|
699
|
-
backgroundColor: "#ffffff",
|
|
700
|
-
foregroundColor: "#333333",
|
|
701
|
-
borderRadius: "6px",
|
|
702
|
-
fontFamily: '"Source Sans Pro", Arial, sans-serif',
|
|
703
|
-
fontSize: "14px"
|
|
704
|
-
},
|
|
705
|
-
chatI18n: {
|
|
706
|
-
inputPlaceholder: "Ne aramıştınız?",
|
|
707
|
-
poweredBy: "Trendyol AI Asistan"
|
|
708
|
-
}
|
|
709
|
-
},
|
|
710
|
-
boynercomtr: {
|
|
711
|
-
accountId: "boynercomtr",
|
|
712
|
-
locale: "tr",
|
|
713
|
-
middlewareUrl: l,
|
|
714
|
-
theme: {
|
|
715
|
-
primaryColor: "#000000",
|
|
716
|
-
primaryForeground: "#ffffff",
|
|
717
|
-
backgroundColor: "#ffffff",
|
|
718
|
-
foregroundColor: "#333333",
|
|
719
|
-
borderRadius: "4px",
|
|
720
|
-
fontFamily: '"Montserrat", Arial, sans-serif',
|
|
721
|
-
fontSize: "14px"
|
|
722
|
-
},
|
|
723
|
-
chatI18n: {
|
|
724
|
-
inputPlaceholder: "Moda, kozmetik veya ev ürünleri arayın",
|
|
725
|
-
poweredBy: "Boyner AI Asistan"
|
|
726
|
-
}
|
|
727
|
-
},
|
|
728
|
-
evideacom: {
|
|
729
|
-
accountId: "evideacom",
|
|
730
|
-
locale: "tr",
|
|
731
|
-
middlewareUrl: l,
|
|
732
|
-
theme: {
|
|
733
|
-
primaryColor: "#e84393",
|
|
734
|
-
primaryForeground: "#ffffff",
|
|
735
|
-
backgroundColor: "#ffffff",
|
|
736
|
-
foregroundColor: "#2d3436",
|
|
737
|
-
borderRadius: "8px",
|
|
738
|
-
fontFamily: '"Poppins", Arial, sans-serif',
|
|
739
|
-
fontSize: "14px"
|
|
740
|
-
},
|
|
741
|
-
chatI18n: {
|
|
742
|
-
inputPlaceholder: "Ev dekorasyon ürünleri arayın",
|
|
743
|
-
poweredBy: "Evidea AI Asistan"
|
|
744
|
-
}
|
|
745
|
-
},
|
|
746
|
-
aygazcomtr: {
|
|
747
|
-
accountId: "aygazcomtr",
|
|
748
|
-
locale: "tr",
|
|
749
|
-
middlewareUrl: l,
|
|
750
|
-
theme: {
|
|
751
|
-
primaryColor: "#e30613",
|
|
752
|
-
primaryForeground: "#ffffff",
|
|
753
|
-
backgroundColor: "#ffffff",
|
|
754
|
-
foregroundColor: "#333333",
|
|
755
|
-
borderRadius: "8px",
|
|
756
|
-
fontFamily: "Arial, Helvetica, sans-serif",
|
|
757
|
-
fontSize: "14px"
|
|
758
|
-
},
|
|
759
|
-
chatI18n: {
|
|
760
|
-
inputPlaceholder: "Aygaz ürünleri hakkında sorun",
|
|
761
|
-
poweredBy: "Aygaz AI Asistan"
|
|
762
|
-
}
|
|
763
|
-
},
|
|
764
|
-
otokoccomtr: {
|
|
765
|
-
accountId: "otokoccomtr",
|
|
766
|
-
locale: "tr",
|
|
767
|
-
middlewareUrl: l,
|
|
768
|
-
theme: {
|
|
769
|
-
primaryColor: "#003087",
|
|
770
|
-
primaryForeground: "#ffffff",
|
|
771
|
-
backgroundColor: "#ffffff",
|
|
772
|
-
foregroundColor: "#333333",
|
|
773
|
-
borderRadius: "8px",
|
|
774
|
-
fontFamily: '"Roboto", Arial, sans-serif',
|
|
775
|
-
fontSize: "14px"
|
|
776
|
-
},
|
|
777
|
-
chatI18n: {
|
|
778
|
-
inputPlaceholder: "Araç veya hizmet arayın",
|
|
779
|
-
poweredBy: "Otokoç AI Asistan"
|
|
780
|
-
}
|
|
781
|
-
},
|
|
782
|
-
divanpastanelericomtr: {
|
|
783
|
-
accountId: "divanpastanelericomtr",
|
|
784
|
-
locale: "tr",
|
|
785
|
-
middlewareUrl: l,
|
|
786
|
-
theme: {
|
|
787
|
-
primaryColor: "#8b1a2d",
|
|
788
|
-
primaryForeground: "#ffffff",
|
|
789
|
-
backgroundColor: "#faf8f5",
|
|
790
|
-
foregroundColor: "#3d2c2e",
|
|
791
|
-
borderRadius: "8px",
|
|
792
|
-
fontFamily: '"Georgia", serif',
|
|
793
|
-
fontSize: "14px"
|
|
794
|
-
},
|
|
795
|
-
chatI18n: {
|
|
796
|
-
inputPlaceholder: "Ürün veya mağaza arayın",
|
|
797
|
-
poweredBy: "Divan AI Asistan"
|
|
798
|
-
}
|
|
799
|
-
},
|
|
800
|
-
screwfixcom: {
|
|
801
|
-
accountId: "screwfixcom",
|
|
802
|
-
locale: "en",
|
|
803
|
-
middlewareUrl: l,
|
|
804
|
-
theme: {
|
|
805
|
-
primaryColor: "#f6a623",
|
|
806
|
-
primaryForeground: "#1a1a1a",
|
|
807
|
-
backgroundColor: "#ffffff",
|
|
808
|
-
foregroundColor: "#333333",
|
|
809
|
-
borderRadius: "4px",
|
|
810
|
-
fontFamily: '"Arial", Helvetica, sans-serif',
|
|
811
|
-
fontSize: "14px"
|
|
812
|
-
},
|
|
813
|
-
pricing: {
|
|
814
|
-
currencySymbol: "£",
|
|
815
|
-
currencyPosition: "prefix",
|
|
816
|
-
thousandsSeparator: ",",
|
|
817
|
-
decimalSeparator: "."
|
|
818
|
-
},
|
|
819
|
-
chatI18n: {
|
|
820
|
-
inputPlaceholder: "Search products or ask a question",
|
|
821
|
-
poweredBy: "Screwfix AI Assistant"
|
|
822
|
-
}
|
|
596
|
+
const n = re();
|
|
597
|
+
n && (i.sku = n);
|
|
823
598
|
}
|
|
824
|
-
|
|
825
|
-
function Ae(e) {
|
|
826
|
-
return I[e];
|
|
827
|
-
}
|
|
828
|
-
function Se() {
|
|
829
|
-
return Object.keys(I);
|
|
599
|
+
return typeof window < "u" && (i.url = window.location.href), i;
|
|
830
600
|
}
|
|
831
601
|
export {
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
602
|
+
_ as AccountRuntimeConfigSchema,
|
|
603
|
+
R as AnalyticsAuthModeSchema,
|
|
604
|
+
Y as AnalyticsClient,
|
|
605
|
+
ee as BASE_WIDGET_THEME,
|
|
606
|
+
xe as BaseWidget,
|
|
607
|
+
b as DEFAULT_CUSTOMIZATION_LOCALE,
|
|
608
|
+
Ee as DEFAULT_WIDGET_THEME_TOKENS,
|
|
839
609
|
D as UnknownActionPolicySchema,
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
610
|
+
dt as VoiceInput,
|
|
611
|
+
Ie as adaptV1Event,
|
|
612
|
+
be as autoDetectPageContext,
|
|
613
|
+
Ae as basketAddEvent,
|
|
614
|
+
qe as bootstrapSession,
|
|
615
|
+
Pe as buildChatEndpointUrl,
|
|
616
|
+
fe as buildOverlayIdempotencyKey,
|
|
617
|
+
Ue as chatHistorySnapshotEvent,
|
|
618
|
+
Re as checkoutCompleteEvent,
|
|
619
|
+
Me as checkoutStartEvent,
|
|
620
|
+
Le as consumeStream,
|
|
621
|
+
ye as createAccountIdentity,
|
|
622
|
+
pe as createAnalyticsClient,
|
|
623
|
+
he as createDefaultAccountRuntimeConfig,
|
|
854
624
|
Te as createDefaultAnalyticsConfig,
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
Ye as meteringIncrementEvent,
|
|
876
|
-
je as meteringSummaryEvent,
|
|
625
|
+
we as createFloatingChatConfig,
|
|
626
|
+
ve as createPdpQnaConfig,
|
|
627
|
+
_e as createPdpSimRelConfig,
|
|
628
|
+
Fe as defaultUnknownUISpecRenderer,
|
|
629
|
+
ge as destroyOverlayWidgets,
|
|
630
|
+
ae as detectPageType,
|
|
631
|
+
De as dismissGlobalErrorToast,
|
|
632
|
+
Oe as dispatch,
|
|
633
|
+
re as extractSkuFromUrl,
|
|
634
|
+
Be as getGlobalErrorMessage,
|
|
635
|
+
Q as getOverlayWidgets,
|
|
636
|
+
Ne as getWindowPageContext,
|
|
637
|
+
Ce as initGengageClient,
|
|
638
|
+
K as initOverlayWidgets,
|
|
639
|
+
ut as isVoiceInputSupported,
|
|
640
|
+
$e as listen,
|
|
641
|
+
We as llmUsageEvent,
|
|
642
|
+
He as mergeUISpecRegistry,
|
|
643
|
+
ze as meteringIncrementEvent,
|
|
644
|
+
Ge as meteringSummaryEvent,
|
|
877
645
|
E as normalizeMiddlewareUrl,
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
646
|
+
Ke as normalizeProductGroupingsResponse,
|
|
647
|
+
Qe as normalizeSimilarProductsResponse,
|
|
648
|
+
B as parseAccountRuntimeConfig,
|
|
649
|
+
ie as preflightDiagnostics,
|
|
650
|
+
Ve as productToNormalized,
|
|
651
|
+
je as registerGlobalErrorToastListener,
|
|
652
|
+
Ye as renderUISpecWithRegistry,
|
|
885
653
|
S as resolveSession,
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
654
|
+
ht as routeStreamAction,
|
|
655
|
+
N as safeParseAccountRuntimeConfig,
|
|
656
|
+
ft as sanitizeHtml,
|
|
657
|
+
Xe as showGlobalErrorToast,
|
|
658
|
+
Ze as streamChunkEvent,
|
|
659
|
+
Je as streamDoneEvent,
|
|
660
|
+
et as streamErrorEvent,
|
|
661
|
+
tt as streamPost,
|
|
662
|
+
it as streamStartEvent,
|
|
663
|
+
nt as streamUiSpecEvent,
|
|
664
|
+
ot as updatePageContext,
|
|
665
|
+
st as widgetHistorySnapshotEvent,
|
|
666
|
+
at as wireGADataLayer,
|
|
899
667
|
x as wireQNAToChat,
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
668
|
+
rt as wireSimilarToChat,
|
|
669
|
+
me as withBaseTheme,
|
|
670
|
+
lt as withDefaultWidgetTheme
|
|
903
671
|
};
|
|
904
672
|
//# sourceMappingURL=common.js.map
|