admesh-ui-sdk 1.0.49 โ 1.0.50
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/brand-assistant.js +54 -44
- package/dist/brand-assistant.js.map +1 -1
- package/dist/components/AdMeshIntentAssistant.d.ts.map +1 -1
- package/dist/index.js +41 -31
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +406 -366
- package/dist/index.mjs.map +1 -1
- package/dist/publisher-assistant.js +57 -47
- package/dist/publisher-assistant.js.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var bo = Object.defineProperty;
|
|
2
2
|
var xo = (t, e, r) => e in t ? bo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
|
|
3
3
|
var et = (t, e, r) => xo(t, typeof e != "symbol" ? e + "" : e, r);
|
|
4
|
-
import { jsx as i, jsxs as M, Fragment as
|
|
4
|
+
import { jsx as i, jsxs as M, Fragment as ut } from "react/jsx-runtime";
|
|
5
5
|
import yo from "react-dom/client";
|
|
6
6
|
import { forwardRef as Wr, createElement as On, useRef as F, useState as ae, useCallback as le, useEffect as te, createContext as Br, useContext as Ur, useId as wo, useLayoutEffect as Vn, useMemo as Sn, Fragment as xr } from "react";
|
|
7
7
|
import { createPortal as Qn } from "react-dom";
|
|
@@ -133,7 +133,7 @@ const Ao = Wr(
|
|
|
133
133
|
* This source code is licensed under the ISC license.
|
|
134
134
|
* See the LICENSE file in the root directory of this source tree.
|
|
135
135
|
*/
|
|
136
|
-
const
|
|
136
|
+
const pt = (t, e) => {
|
|
137
137
|
const r = Wr(
|
|
138
138
|
({ className: o, ...a }, l) => On(Ao, {
|
|
139
139
|
ref: l,
|
|
@@ -157,7 +157,7 @@ const St = (t, e) => {
|
|
|
157
157
|
const Co = [
|
|
158
158
|
["path", { d: "M7 7h10v10", key: "1tivn9" }],
|
|
159
159
|
["path", { d: "M7 17 17 7", key: "1vkiza" }]
|
|
160
|
-
], Mo =
|
|
160
|
+
], Mo = pt("arrow-up-right", Co);
|
|
161
161
|
/**
|
|
162
162
|
* @license lucide-react v0.563.0 - ISC
|
|
163
163
|
*
|
|
@@ -167,14 +167,28 @@ const Co = [
|
|
|
167
167
|
const Eo = [
|
|
168
168
|
["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
|
|
169
169
|
["path", { d: "M12 19V5", key: "x0mq9r" }]
|
|
170
|
-
], Io =
|
|
170
|
+
], Io = pt("arrow-up", Eo);
|
|
171
171
|
/**
|
|
172
172
|
* @license lucide-react v0.563.0 - ISC
|
|
173
173
|
*
|
|
174
174
|
* This source code is licensed under the ISC license.
|
|
175
175
|
* See the LICENSE file in the root directory of this source tree.
|
|
176
176
|
*/
|
|
177
|
-
const To = [
|
|
177
|
+
const To = [["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }]], Ro = pt("chevron-left", To);
|
|
178
|
+
/**
|
|
179
|
+
* @license lucide-react v0.563.0 - ISC
|
|
180
|
+
*
|
|
181
|
+
* This source code is licensed under the ISC license.
|
|
182
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
183
|
+
*/
|
|
184
|
+
const Do = [["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }]], Po = pt("chevron-right", Do);
|
|
185
|
+
/**
|
|
186
|
+
* @license lucide-react v0.563.0 - ISC
|
|
187
|
+
*
|
|
188
|
+
* This source code is licensed under the ISC license.
|
|
189
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
+
*/
|
|
191
|
+
const zo = [
|
|
178
192
|
[
|
|
179
193
|
"path",
|
|
180
194
|
{
|
|
@@ -182,26 +196,26 @@ const To = [
|
|
|
182
196
|
key: "1jaruq"
|
|
183
197
|
}
|
|
184
198
|
]
|
|
185
|
-
],
|
|
199
|
+
], $o = pt("flag", zo);
|
|
186
200
|
/**
|
|
187
201
|
* @license lucide-react v0.563.0 - ISC
|
|
188
202
|
*
|
|
189
203
|
* This source code is licensed under the ISC license.
|
|
190
204
|
* See the LICENSE file in the root directory of this source tree.
|
|
191
205
|
*/
|
|
192
|
-
const
|
|
206
|
+
const No = [
|
|
193
207
|
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
194
208
|
["path", { d: "m21 3-7 7", key: "1l2asr" }],
|
|
195
209
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
196
210
|
["path", { d: "M9 21H3v-6", key: "wtvkvv" }]
|
|
197
|
-
],
|
|
211
|
+
], Lo = pt("maximize-2", No);
|
|
198
212
|
/**
|
|
199
213
|
* @license lucide-react v0.563.0 - ISC
|
|
200
214
|
*
|
|
201
215
|
* This source code is licensed under the ISC license.
|
|
202
216
|
* See the LICENSE file in the root directory of this source tree.
|
|
203
217
|
*/
|
|
204
|
-
const
|
|
218
|
+
const Fo = [
|
|
205
219
|
[
|
|
206
220
|
"path",
|
|
207
221
|
{
|
|
@@ -209,26 +223,26 @@ const zo = [
|
|
|
209
223
|
key: "18887p"
|
|
210
224
|
}
|
|
211
225
|
]
|
|
212
|
-
], Kn =
|
|
226
|
+
], Kn = pt("message-square", Fo);
|
|
213
227
|
/**
|
|
214
228
|
* @license lucide-react v0.563.0 - ISC
|
|
215
229
|
*
|
|
216
230
|
* This source code is licensed under the ISC license.
|
|
217
231
|
* See the LICENSE file in the root directory of this source tree.
|
|
218
232
|
*/
|
|
219
|
-
const
|
|
233
|
+
const Wo = [
|
|
220
234
|
["path", { d: "m14 10 7-7", key: "oa77jy" }],
|
|
221
235
|
["path", { d: "M20 10h-6V4", key: "mjg0md" }],
|
|
222
236
|
["path", { d: "m3 21 7-7", key: "tjx5ai" }],
|
|
223
237
|
["path", { d: "M4 14h6v6", key: "rmj7iw" }]
|
|
224
|
-
], wr =
|
|
238
|
+
], wr = pt("minimize-2", Wo);
|
|
225
239
|
/**
|
|
226
240
|
* @license lucide-react v0.563.0 - ISC
|
|
227
241
|
*
|
|
228
242
|
* This source code is licensed under the ISC license.
|
|
229
243
|
* See the LICENSE file in the root directory of this source tree.
|
|
230
244
|
*/
|
|
231
|
-
const
|
|
245
|
+
const Bo = [
|
|
232
246
|
[
|
|
233
247
|
"path",
|
|
234
248
|
{
|
|
@@ -237,23 +251,23 @@ const No = [
|
|
|
237
251
|
}
|
|
238
252
|
],
|
|
239
253
|
["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
|
|
240
|
-
], _r =
|
|
254
|
+
], _r = pt("send", Bo);
|
|
241
255
|
/**
|
|
242
256
|
* @license lucide-react v0.563.0 - ISC
|
|
243
257
|
*
|
|
244
258
|
* This source code is licensed under the ISC license.
|
|
245
259
|
* See the LICENSE file in the root directory of this source tree.
|
|
246
260
|
*/
|
|
247
|
-
const
|
|
261
|
+
const Uo = [
|
|
248
262
|
["rect", { width: "18", height: "18", x: "3", y: "3", rx: "2", key: "afitv7" }]
|
|
249
|
-
],
|
|
263
|
+
], Ho = pt("square", Uo);
|
|
250
264
|
/**
|
|
251
265
|
* @license lucide-react v0.563.0 - ISC
|
|
252
266
|
*
|
|
253
267
|
* This source code is licensed under the ISC license.
|
|
254
268
|
* See the LICENSE file in the root directory of this source tree.
|
|
255
269
|
*/
|
|
256
|
-
const
|
|
270
|
+
const jo = [
|
|
257
271
|
[
|
|
258
272
|
"path",
|
|
259
273
|
{
|
|
@@ -262,14 +276,14 @@ const Wo = [
|
|
|
262
276
|
}
|
|
263
277
|
],
|
|
264
278
|
["path", { d: "M17 14V2", key: "8ymqnk" }]
|
|
265
|
-
], vr =
|
|
279
|
+
], vr = pt("thumbs-down", jo);
|
|
266
280
|
/**
|
|
267
281
|
* @license lucide-react v0.563.0 - ISC
|
|
268
282
|
*
|
|
269
283
|
* This source code is licensed under the ISC license.
|
|
270
284
|
* See the LICENSE file in the root directory of this source tree.
|
|
271
285
|
*/
|
|
272
|
-
const
|
|
286
|
+
const qo = [
|
|
273
287
|
[
|
|
274
288
|
"path",
|
|
275
289
|
{
|
|
@@ -278,18 +292,18 @@ const Bo = [
|
|
|
278
292
|
}
|
|
279
293
|
],
|
|
280
294
|
["path", { d: "M7 10v12", key: "1qc93n" }]
|
|
281
|
-
], kr =
|
|
295
|
+
], kr = pt("thumbs-up", qo);
|
|
282
296
|
/**
|
|
283
297
|
* @license lucide-react v0.563.0 - ISC
|
|
284
298
|
*
|
|
285
299
|
* This source code is licensed under the ISC license.
|
|
286
300
|
* See the LICENSE file in the root directory of this source tree.
|
|
287
301
|
*/
|
|
288
|
-
const
|
|
302
|
+
const Oo = [
|
|
289
303
|
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
290
304
|
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
291
|
-
], Fn =
|
|
292
|
-
function
|
|
305
|
+
], Fn = pt("x", Oo);
|
|
306
|
+
function Vo(t, e, r) {
|
|
293
307
|
const a = t * e > 242500;
|
|
294
308
|
return { ...{
|
|
295
309
|
visibilityThreshold: a ? 0.3 : 0.5,
|
|
@@ -299,10 +313,10 @@ function Ho(t, e, r) {
|
|
|
299
313
|
isLargeAd: a
|
|
300
314
|
}, ...r };
|
|
301
315
|
}
|
|
302
|
-
function
|
|
316
|
+
function Ko(t) {
|
|
303
317
|
return t < 768 ? "mobile" : t < 1024 ? "tablet" : "desktop";
|
|
304
318
|
}
|
|
305
|
-
function
|
|
319
|
+
function Go(t) {
|
|
306
320
|
const e = t.getBoundingClientRect(), r = window.innerHeight || document.documentElement.clientHeight, o = window.innerWidth || document.documentElement.clientWidth, a = e.height, l = e.width;
|
|
307
321
|
if (a === 0 || l === 0) return 0;
|
|
308
322
|
const c = Math.max(0, e.top), x = Math.min(r, e.bottom), f = Math.max(0, e.left), y = Math.min(o, e.right), d = Math.max(0, x - c), u = Math.max(0, y - f), k = d * u, C = a * l;
|
|
@@ -312,20 +326,20 @@ function Sr() {
|
|
|
312
326
|
const t = window.innerHeight, e = document.documentElement.scrollHeight, r = window.pageYOffset || document.documentElement.scrollTop, o = e - t;
|
|
313
327
|
return o <= 0 ? 100 : Math.min(100, r / o * 100);
|
|
314
328
|
}
|
|
315
|
-
function
|
|
329
|
+
function Yo(t) {
|
|
316
330
|
const e = t.getBoundingClientRect(), r = window.pageYOffset || document.documentElement.scrollTop, o = window.pageXOffset || document.documentElement.scrollLeft;
|
|
317
331
|
return {
|
|
318
332
|
top: e.top + r,
|
|
319
333
|
left: e.left + o
|
|
320
334
|
};
|
|
321
335
|
}
|
|
322
|
-
function
|
|
323
|
-
const e = t.getBoundingClientRect(), r =
|
|
336
|
+
function Qo(t) {
|
|
337
|
+
const e = t.getBoundingClientRect(), r = Yo(t), o = window.innerWidth || document.documentElement.clientWidth, a = window.innerHeight || document.documentElement.clientHeight, l = window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
324
338
|
return {
|
|
325
339
|
pageUrl: window.location.href,
|
|
326
340
|
pageTitle: document.title,
|
|
327
341
|
referrer: document.referrer,
|
|
328
|
-
deviceType:
|
|
342
|
+
deviceType: Ko(o),
|
|
329
343
|
viewportWidth: o,
|
|
330
344
|
viewportHeight: a,
|
|
331
345
|
adWidth: e.width,
|
|
@@ -337,16 +351,16 @@ function Vo(t) {
|
|
|
337
351
|
timezone: Intl.DateTimeFormat().resolvedOptions().timeZone
|
|
338
352
|
};
|
|
339
353
|
}
|
|
340
|
-
function
|
|
354
|
+
function Xo() {
|
|
341
355
|
return `session_${Date.now()}_${Math.random().toString(36).substring(2, 11)}`;
|
|
342
356
|
}
|
|
343
|
-
function
|
|
357
|
+
function Jo(t, e, r) {
|
|
344
358
|
return t >= r.visibilityThreshold && e >= r.minimumDuration;
|
|
345
359
|
}
|
|
346
360
|
function Ar(t = /* @__PURE__ */ new Date()) {
|
|
347
361
|
return t.toISOString();
|
|
348
362
|
}
|
|
349
|
-
function
|
|
363
|
+
function Zo(t) {
|
|
350
364
|
return t.length === 0 ? 0 : t.reduce((r, o) => r + o, 0) / t.length;
|
|
351
365
|
}
|
|
352
366
|
function Cr(t, e) {
|
|
@@ -355,7 +369,7 @@ function Cr(t, e) {
|
|
|
355
369
|
r || (t(...a), r = !0, setTimeout(() => r = !1, e));
|
|
356
370
|
};
|
|
357
371
|
}
|
|
358
|
-
const
|
|
372
|
+
const ei = {
|
|
359
373
|
enabled: !0,
|
|
360
374
|
// Analytics endpoint disabled - no analytics will be sent
|
|
361
375
|
apiEndpoint: "",
|
|
@@ -370,8 +384,8 @@ const Qo = {
|
|
|
370
384
|
maxRetries: 3,
|
|
371
385
|
retryDelay: 1e3
|
|
372
386
|
};
|
|
373
|
-
let
|
|
374
|
-
function
|
|
387
|
+
let ti = ei, ni = !1;
|
|
388
|
+
function ri({
|
|
375
389
|
productId: t,
|
|
376
390
|
offerId: e,
|
|
377
391
|
agentId: r,
|
|
@@ -379,7 +393,7 @@ function Zo({
|
|
|
379
393
|
elementRef: a,
|
|
380
394
|
config: l
|
|
381
395
|
}) {
|
|
382
|
-
const c = { ...
|
|
396
|
+
const c = { ...ti, ...l }, x = F(Xo()), [f, y] = ae({
|
|
383
397
|
isVisible: !1,
|
|
384
398
|
isViewable: !1,
|
|
385
399
|
visibilityPercentage: 0,
|
|
@@ -403,8 +417,8 @@ function Zo({
|
|
|
403
417
|
}), d = F(null), u = F(null), k = F(null), C = F(null), p = F(null), v = F([]), m = F([]), h = F(null), S = le((w) => {
|
|
404
418
|
c.debug && s.log(`[AdMesh Viewability] ${w}`);
|
|
405
419
|
}, [c.debug]), R = le(async (w, N) => {
|
|
406
|
-
if (!(!c.enabled ||
|
|
407
|
-
const U =
|
|
420
|
+
if (!(!c.enabled || ni || !a.current || !d.current) && (S(`Analytics disabled - skipping event: ${w}`), c.onEvent)) {
|
|
421
|
+
const U = Qo(a.current), L = {
|
|
408
422
|
eventType: w,
|
|
409
423
|
timestamp: Ar(),
|
|
410
424
|
sessionId: x.current,
|
|
@@ -425,7 +439,7 @@ function Zo({
|
|
|
425
439
|
m.current.length !== 0 && (S("Analytics disabled - clearing batch without sending"), m.current = [], h.current && (clearTimeout(h.current), h.current = null));
|
|
426
440
|
}, [S]), I = le(Cr(() => {
|
|
427
441
|
if (!a.current) return;
|
|
428
|
-
const w =
|
|
442
|
+
const w = Go(a.current), N = Date.now(), U = new Date(f.timeMetrics.loadedAt).getTime();
|
|
429
443
|
y((L) => {
|
|
430
444
|
const z = { ...L };
|
|
431
445
|
w > 0 && v.current.push(w);
|
|
@@ -442,8 +456,8 @@ function Zo({
|
|
|
442
456
|
const W = N - u.current;
|
|
443
457
|
z.timeMetrics.totalVisibleDuration += W, u.current = N;
|
|
444
458
|
}
|
|
445
|
-
if (z.isVisible = A, z.visibilityPercentage = w, w > z.engagementMetrics.maxVisibilityPercentage && (z.engagementMetrics.maxVisibilityPercentage = w), v.current.length > 0 && (z.engagementMetrics.averageVisibilityPercentage =
|
|
446
|
-
const W = L.isViewable, V =
|
|
459
|
+
if (z.isVisible = A, z.visibilityPercentage = w, w > z.engagementMetrics.maxVisibilityPercentage && (z.engagementMetrics.maxVisibilityPercentage = w), v.current.length > 0 && (z.engagementMetrics.averageVisibilityPercentage = Zo(v.current)), d.current) {
|
|
460
|
+
const W = L.isViewable, V = Jo(
|
|
447
461
|
w,
|
|
448
462
|
z.timeMetrics.totalVisibleDuration,
|
|
449
463
|
d.current
|
|
@@ -461,7 +475,7 @@ function Zo({
|
|
|
461
475
|
return te(() => {
|
|
462
476
|
if (!a.current) return;
|
|
463
477
|
const w = a.current.getBoundingClientRect();
|
|
464
|
-
d.current =
|
|
478
|
+
d.current = Vo(w.width, w.height, c.mrcStandards), S("Initialized MRC standards"), R("ad_loaded");
|
|
465
479
|
}, [a, c.mrcStandards, S, R]), te(() => {
|
|
466
480
|
if (!c.enabled || !a.current) return;
|
|
467
481
|
const w = new IntersectionObserver(
|
|
@@ -570,7 +584,7 @@ const Cn = ({
|
|
|
570
584
|
onViewable: C,
|
|
571
585
|
onClick: p
|
|
572
586
|
}) => {
|
|
573
|
-
const v = F(null), m = F(!1), h =
|
|
587
|
+
const v = F(null), m = F(!1), h = ri({
|
|
574
588
|
productId: t,
|
|
575
589
|
offerId: e,
|
|
576
590
|
agentId: r,
|
|
@@ -622,7 +636,7 @@ const Mr = (t) => {
|
|
|
622
636
|
} catch {
|
|
623
637
|
return !1;
|
|
624
638
|
}
|
|
625
|
-
}, ln = (t) => typeof t == "string" ? t.trim() : typeof t == "number" ? String(t) : "",
|
|
639
|
+
}, ln = (t) => typeof t == "string" ? t.trim() : typeof t == "number" ? String(t) : "", kt = (t) => ln(t) || void 0, oi = (t) => t && t.trim() ? t.trim() : "", ii = (t, e) => {
|
|
626
640
|
if (t == null || t === "")
|
|
627
641
|
return "";
|
|
628
642
|
if (typeof t == "number")
|
|
@@ -648,15 +662,15 @@ const Mr = (t) => {
|
|
|
648
662
|
onStartDelegation: f,
|
|
649
663
|
onRecommendationReport: y
|
|
650
664
|
}) => {
|
|
651
|
-
var Ve, be,
|
|
665
|
+
var Ve, be, ht, Pt, zt, q, ft, Ct, Bt;
|
|
652
666
|
if (!t || t.length === 0)
|
|
653
667
|
return s.log("[AdMesh Compact Tail Ad] No recommendations provided - not rendering"), null;
|
|
654
|
-
const d = t[0], u = d == null ? void 0 : d.recommendation, k = u == null ? void 0 : u.creative, C = d == null ? void 0 : d.tracking, p = d == null ? void 0 : d.delegation, v = (d == null ? void 0 : d.recommendation_id) || "", m = (u == null ? void 0 : u.offerId) || "", h = (k == null ? void 0 : k.brand_name) || "", S = (k == null ? void 0 : k.headline) || "", R = (k == null ? void 0 : k.description) || "", G = (k == null ? void 0 : k.logo_url) || "", I = (C == null ? void 0 : C.click_url) || (k == null ? void 0 : k.landing_page_url) || "", w = (C == null ? void 0 : C.exposure_url) || "", N = (u == null ? void 0 : u.disclosure) || "Sponsored", U = (k == null ? void 0 : k.products) || [], L = U.slice(0, 4), z = U.length > 1, A = ((u == null ? void 0 : u.format) || "tail") === "bridge", W = (p == null ? void 0 : p.available) === !0, V = A && W, X = (p == null ? void 0 : p.brand_name) || h, K = "Talk to Agent", O =
|
|
668
|
+
const d = t[0], u = d == null ? void 0 : d.recommendation, k = u == null ? void 0 : u.creative, C = d == null ? void 0 : d.tracking, p = d == null ? void 0 : d.delegation, v = (d == null ? void 0 : d.recommendation_id) || "", m = (u == null ? void 0 : u.offerId) || "", h = (k == null ? void 0 : k.brand_name) || "", S = (k == null ? void 0 : k.headline) || "", R = (k == null ? void 0 : k.description) || "", G = (k == null ? void 0 : k.logo_url) || "", I = (C == null ? void 0 : C.click_url) || (k == null ? void 0 : k.landing_page_url) || "", w = (C == null ? void 0 : C.exposure_url) || "", N = (u == null ? void 0 : u.disclosure) || "Sponsored", U = (k == null ? void 0 : k.products) || [], L = U.slice(0, 4), z = U.length > 1, A = ((u == null ? void 0 : u.format) || "tail") === "bridge", W = (p == null ? void 0 : p.available) === !0, V = A && W, X = (p == null ? void 0 : p.brand_name) || h, K = "Talk to Agent", O = oi(k == null ? void 0 : k.cta_text), oe = !z && !!O && !!I;
|
|
655
669
|
if (!h && !S && !R)
|
|
656
670
|
return s.log("[AdMesh Compact Tail Ad] No valid recommendation data provided - not rendering", {
|
|
657
671
|
recommendationId: v
|
|
658
672
|
}), null;
|
|
659
|
-
const xe = S && S !== h ? S : h, de = R, ee = h.trim().toLowerCase(), Ce = xe.trim().toLowerCase(),
|
|
673
|
+
const xe = S && S !== h ? S : h, de = R, ee = h.trim().toLowerCase(), Ce = xe.trim().toLowerCase(), lt = !!h && ee !== Ce, [Te, Se] = ae(!1), [ye, ke] = ae(!1), [Ee, qe] = ae(!1), [ce, Me] = ae(null), Oe = F(null);
|
|
660
674
|
te(() => () => {
|
|
661
675
|
Oe.current && (Oe.current(!1), Oe.current = null);
|
|
662
676
|
}, []);
|
|
@@ -691,8 +705,8 @@ const Mr = (t) => {
|
|
|
691
705
|
reason: we,
|
|
692
706
|
session_id: a
|
|
693
707
|
});
|
|
694
|
-
} catch (
|
|
695
|
-
s.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:",
|
|
708
|
+
} catch (gt) {
|
|
709
|
+
s.warn("[AdMesh Compact Tail Ad] Failed to submit recommendation report:", gt);
|
|
696
710
|
}
|
|
697
711
|
}, re = () => {
|
|
698
712
|
z || !I || (Y("compact_tail_ad_card"), typeof window < "u" && window.open(I, "_blank", "noopener,noreferrer"));
|
|
@@ -720,33 +734,33 @@ const Mr = (t) => {
|
|
|
720
734
|
if (Q.preventDefault(), Q.stopPropagation(), !d || !V || (Y("compact_tail_ad_delegation_cta"), !await J()))
|
|
721
735
|
return;
|
|
722
736
|
ve();
|
|
723
|
-
const
|
|
737
|
+
const gt = p != null && p.available ? {
|
|
724
738
|
recommendation_id: d.recommendation_id,
|
|
725
|
-
brand_id:
|
|
726
|
-
brand_name:
|
|
727
|
-
mcp_endpoint:
|
|
728
|
-
eligibility_reason:
|
|
729
|
-
delegate_reason:
|
|
730
|
-
session_goal:
|
|
739
|
+
brand_id: kt(p.brand_id),
|
|
740
|
+
brand_name: kt(p.brand_name || (k == null ? void 0 : k.brand_name)),
|
|
741
|
+
mcp_endpoint: kt(p.mcp_endpoint),
|
|
742
|
+
eligibility_reason: kt(p.eligibility_reason),
|
|
743
|
+
delegate_reason: kt(p.delegate_reason),
|
|
744
|
+
session_goal: kt(p.session_goal),
|
|
731
745
|
desired_outcome_type: p.desired_outcome_type,
|
|
732
|
-
required_user_inputs: Array.isArray(p.required_user_inputs) ? p.required_user_inputs.filter((
|
|
733
|
-
required_consent_types: Array.isArray(p.required_consent_types) ? p.required_consent_types.filter((
|
|
734
|
-
success_outcome:
|
|
735
|
-
fallback_message:
|
|
736
|
-
session_mode:
|
|
737
|
-
status:
|
|
746
|
+
required_user_inputs: Array.isArray(p.required_user_inputs) ? p.required_user_inputs.filter((dt) => typeof dt == "string") : [],
|
|
747
|
+
required_consent_types: Array.isArray(p.required_consent_types) ? p.required_consent_types.filter((dt) => typeof dt == "string") : [],
|
|
748
|
+
success_outcome: kt(p.success_outcome),
|
|
749
|
+
fallback_message: kt(p.fallback_message),
|
|
750
|
+
session_mode: kt(p.session_mode),
|
|
751
|
+
status: kt(p.status),
|
|
738
752
|
capabilities: p.capabilities || [],
|
|
739
753
|
allowed_data_types: p.allowed_data_types || [],
|
|
740
754
|
consent_requirements: p.consent_requirements || [],
|
|
741
|
-
auth_model:
|
|
755
|
+
auth_model: kt(p.auth_model),
|
|
742
756
|
handoff_protocol: p.handoff_protocol && typeof p.handoff_protocol == "object" ? p.handoff_protocol : void 0,
|
|
743
757
|
supported_actions: p.supported_actions || [],
|
|
744
758
|
metadata: p.metadata && typeof p.metadata == "object" ? p.metadata : void 0,
|
|
745
759
|
platform_response: d
|
|
746
760
|
} : null;
|
|
747
|
-
if (x &&
|
|
761
|
+
if (x && gt) {
|
|
748
762
|
try {
|
|
749
|
-
await x(
|
|
763
|
+
await x(gt);
|
|
750
764
|
} finally {
|
|
751
765
|
ke(!1), Se(!1);
|
|
752
766
|
}
|
|
@@ -761,7 +775,7 @@ const Mr = (t) => {
|
|
|
761
775
|
return;
|
|
762
776
|
}
|
|
763
777
|
ke(!1), Se(!1);
|
|
764
|
-
}, [E, De] = ae(!1), Z = (e == null ? void 0 : e.mode) === "dark" || typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches, Be = (e == null ? void 0 : e.surfaceColor) || ((be = (Ve = e == null ? void 0 : e.components) == null ? void 0 : Ve.card) == null ? void 0 : be.backgroundColor) || (Z ? "#111827" : "#ffffff"), Ne = (e == null ? void 0 : e.borderColor) || ((Pt = (
|
|
778
|
+
}, [E, De] = ae(!1), Z = (e == null ? void 0 : e.mode) === "dark" || typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches, Be = (e == null ? void 0 : e.surfaceColor) || ((be = (Ve = e == null ? void 0 : e.components) == null ? void 0 : Ve.card) == null ? void 0 : be.backgroundColor) || (Z ? "#111827" : "#ffffff"), Ne = (e == null ? void 0 : e.borderColor) || ((Pt = (ht = e == null ? void 0 : e.components) == null ? void 0 : ht.card) == null ? void 0 : Pt.borderColor) || (Z ? "rgba(255, 255, 255, 0.10)" : "rgba(15, 23, 42, 0.08)"), Re = ((zt = e == null ? void 0 : e.shadows) == null ? void 0 : zt.medium) || ((ft = (q = e == null ? void 0 : e.components) == null ? void 0 : q.card) == null ? void 0 : ft.boxShadow) || (Z ? "0 8px 18px rgba(0, 0, 0, 0.28)" : "0 8px 18px rgba(15, 23, 42, 0.08)"), ze = "#2563eb", Ue = Z ? "#9ca3af" : "#6b7280", Xe = Z ? "#e5e7eb" : "#374151", tt = Z ? "#f9fafb" : "#0f172a", At = Z ? "rgba(255, 255, 255, 0.04)" : "#f8fafc", Wt = "50px", He = V || oe ? /* @__PURE__ */ M("div", { style: { display: "flex", alignItems: "center", gap: "10px", flexWrap: "wrap" }, children: [
|
|
765
779
|
V ? /* @__PURE__ */ i(
|
|
766
780
|
"button",
|
|
767
781
|
{
|
|
@@ -935,7 +949,7 @@ const Mr = (t) => {
|
|
|
935
949
|
marginBottom: "4px"
|
|
936
950
|
},
|
|
937
951
|
children: [
|
|
938
|
-
/* @__PURE__ */ i("div", { className: "admesh-compact-line-clamp-1", style: { fontSize: "11px", color: Ue }, children:
|
|
952
|
+
/* @__PURE__ */ i("div", { className: "admesh-compact-line-clamp-1", style: { fontSize: "11px", color: Ue }, children: lt ? h : "" }),
|
|
939
953
|
/* @__PURE__ */ i(
|
|
940
954
|
"span",
|
|
941
955
|
{
|
|
@@ -994,11 +1008,11 @@ const Mr = (t) => {
|
|
|
994
1008
|
paddingBottom: "2px"
|
|
995
1009
|
},
|
|
996
1010
|
children: L.map((Q) => {
|
|
997
|
-
const we = ln(Q.product_name) || "Product",
|
|
1011
|
+
const we = ln(Q.product_name) || "Product", gt = ln(Q.product_link) || ln(Q.product_url) || I || "#", dt = ii(Q.product_price, Q.product_currency), Ut = ln(Q.product_image_url), Ht = Ut && Mr(Ut) ? Ut : "", $t = gt !== "#";
|
|
998
1012
|
return /* @__PURE__ */ i(
|
|
999
1013
|
"a",
|
|
1000
1014
|
{
|
|
1001
|
-
href:
|
|
1015
|
+
href: gt,
|
|
1002
1016
|
target: $t ? "_blank" : void 0,
|
|
1003
1017
|
rel: $t ? "noopener noreferrer" : void 0,
|
|
1004
1018
|
onClick: (nn) => Y(`compact_tail_ad_product_${Q.product_id || "item"}`, nn),
|
|
@@ -1052,7 +1066,7 @@ const Mr = (t) => {
|
|
|
1052
1066
|
children: we
|
|
1053
1067
|
}
|
|
1054
1068
|
),
|
|
1055
|
-
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" }, children:
|
|
1069
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", alignItems: "center", gap: "6px", flexWrap: "wrap" }, children: dt && /* @__PURE__ */ i("span", { style: { fontSize: "12px", fontWeight: 700, color: tt }, children: dt }) })
|
|
1056
1070
|
] })
|
|
1057
1071
|
] })
|
|
1058
1072
|
},
|
|
@@ -1114,7 +1128,7 @@ const Mr = (t) => {
|
|
|
1114
1128
|
cursor: ce ? "default" : "pointer",
|
|
1115
1129
|
flexShrink: 0
|
|
1116
1130
|
},
|
|
1117
|
-
children: /* @__PURE__ */ i(
|
|
1131
|
+
children: /* @__PURE__ */ i($o, { size: 13 })
|
|
1118
1132
|
}
|
|
1119
1133
|
)
|
|
1120
1134
|
]
|
|
@@ -1262,7 +1276,7 @@ const Mr = (t) => {
|
|
|
1262
1276
|
]
|
|
1263
1277
|
}
|
|
1264
1278
|
);
|
|
1265
|
-
},
|
|
1279
|
+
}, ai = ({
|
|
1266
1280
|
recommendations: t,
|
|
1267
1281
|
theme: e,
|
|
1268
1282
|
className: r,
|
|
@@ -1311,7 +1325,7 @@ const Mr = (t) => {
|
|
|
1311
1325
|
}
|
|
1312
1326
|
);
|
|
1313
1327
|
};
|
|
1314
|
-
class
|
|
1328
|
+
class si {
|
|
1315
1329
|
constructor(e) {
|
|
1316
1330
|
et(this, "firedExposures", /* @__PURE__ */ new Set());
|
|
1317
1331
|
et(this, "debug", !1);
|
|
@@ -1454,11 +1468,11 @@ function Or() {
|
|
|
1454
1468
|
);
|
|
1455
1469
|
return t;
|
|
1456
1470
|
}
|
|
1457
|
-
function
|
|
1471
|
+
function li(t) {
|
|
1458
1472
|
const e = t.split("/").filter(Boolean), a = (e[e.length - 1] || e[e.length - 2] || "").replace(/\.[a-z0-9]+$/i, "").replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
|
|
1459
1473
|
return a ? a.replace(/\b\w/g, (l) => l.toUpperCase()) : "This page";
|
|
1460
1474
|
}
|
|
1461
|
-
function
|
|
1475
|
+
function di() {
|
|
1462
1476
|
var t;
|
|
1463
1477
|
try {
|
|
1464
1478
|
console.log("[AdMesh] Starting direct headings extraction...");
|
|
@@ -1501,7 +1515,7 @@ function ii() {
|
|
|
1501
1515
|
const p = Array.from(C.querySelectorAll("h1, h2, h3, p, li, blockquote")).map((h) => e(h.textContent || "")).filter((h) => h.length >= 24);
|
|
1502
1516
|
return (p.length > 0 ? p.join(`
|
|
1503
1517
|
`) : e(C.textContent || "")).slice(0, 6e3);
|
|
1504
|
-
}, o =
|
|
1518
|
+
}, o = li(window.location.pathname || "/"), a = e(document.title || "") || o, c = (() => {
|
|
1505
1519
|
const y = [], d = document.querySelectorAll("h1, h2, h3, h4, h5, h6");
|
|
1506
1520
|
return Array.from(d).forEach((u) => {
|
|
1507
1521
|
const k = e(u.textContent || "");
|
|
@@ -1525,14 +1539,14 @@ function ii() {
|
|
|
1525
1539
|
return console.error("[AdMesh] Error in direct headings extraction:", e), null;
|
|
1526
1540
|
}
|
|
1527
1541
|
}
|
|
1528
|
-
function
|
|
1542
|
+
function ci(t) {
|
|
1529
1543
|
return !!(t && typeof t == "object" && "recommendation_id" in t && "status" in t);
|
|
1530
1544
|
}
|
|
1531
|
-
function
|
|
1545
|
+
function mi(t) {
|
|
1532
1546
|
var o, a, l, c, x, f, y, d, u, k, C;
|
|
1533
1547
|
if (!t || typeof t != "object")
|
|
1534
1548
|
return;
|
|
1535
|
-
if (
|
|
1549
|
+
if (ci(t))
|
|
1536
1550
|
return t;
|
|
1537
1551
|
const e = t;
|
|
1538
1552
|
if (!e.recommendation_id)
|
|
@@ -1582,12 +1596,12 @@ function si(t) {
|
|
|
1582
1596
|
}
|
|
1583
1597
|
};
|
|
1584
1598
|
}
|
|
1585
|
-
function
|
|
1599
|
+
function ui(t) {
|
|
1586
1600
|
return {
|
|
1587
1601
|
...t,
|
|
1588
1602
|
suggestions: (t.suggestions || []).map((e) => ({
|
|
1589
1603
|
...e,
|
|
1590
|
-
recommendation:
|
|
1604
|
+
recommendation: mi(e.recommendation)
|
|
1591
1605
|
}))
|
|
1592
1606
|
};
|
|
1593
1607
|
}
|
|
@@ -1599,7 +1613,7 @@ function Er(t) {
|
|
|
1599
1613
|
return;
|
|
1600
1614
|
}
|
|
1601
1615
|
}
|
|
1602
|
-
async function
|
|
1616
|
+
async function pi(t, e) {
|
|
1603
1617
|
var r, o, a, l, c;
|
|
1604
1618
|
try {
|
|
1605
1619
|
console.log("[AdMesh SDK] Starting ACIE analyze-intent call...", { url: t.url });
|
|
@@ -1651,7 +1665,7 @@ async function di(t, e) {
|
|
|
1651
1665
|
errorText: S
|
|
1652
1666
|
}), new Error(`ACIE API error: ${v.status} - ${S}`);
|
|
1653
1667
|
}
|
|
1654
|
-
const m = await v.json(), h =
|
|
1668
|
+
const m = await v.json(), h = ui(m);
|
|
1655
1669
|
return console.log("[AdMesh SDK] ACIE analysis completed:", {
|
|
1656
1670
|
url: t.url,
|
|
1657
1671
|
suggestionsCount: h.suggestions.length
|
|
@@ -1660,7 +1674,7 @@ async function di(t, e) {
|
|
|
1660
1674
|
return console.error("[AdMesh SDK] Error calling ACIE analyze-intent endpoint:", x), null;
|
|
1661
1675
|
}
|
|
1662
1676
|
}
|
|
1663
|
-
async function
|
|
1677
|
+
async function hi(t, e) {
|
|
1664
1678
|
var l, c;
|
|
1665
1679
|
const r = (e.apiBaseUrl || "https://api.useadmesh.com").replace(/\/$/, ""), o = new URLSearchParams({ url: t.trim() });
|
|
1666
1680
|
(l = e.agentDisplayId) != null && l.trim() && o.set("agent_display_id", e.agentDisplayId.trim()), (c = e.publisherId) != null && c.trim() && o.set("publisher_id", e.publisherId.trim());
|
|
@@ -1677,7 +1691,7 @@ async function ci(t, e) {
|
|
|
1677
1691
|
}
|
|
1678
1692
|
return await a.json();
|
|
1679
1693
|
}
|
|
1680
|
-
function
|
|
1694
|
+
function fi() {
|
|
1681
1695
|
if (typeof window > "u")
|
|
1682
1696
|
return !1;
|
|
1683
1697
|
try {
|
|
@@ -1686,7 +1700,7 @@ function mi() {
|
|
|
1686
1700
|
return !0;
|
|
1687
1701
|
}
|
|
1688
1702
|
}
|
|
1689
|
-
function
|
|
1703
|
+
function gi() {
|
|
1690
1704
|
var t;
|
|
1691
1705
|
if (typeof window > "u")
|
|
1692
1706
|
return null;
|
|
@@ -1710,7 +1724,7 @@ function Vr(t) {
|
|
|
1710
1724
|
return !1;
|
|
1711
1725
|
}
|
|
1712
1726
|
}
|
|
1713
|
-
function
|
|
1727
|
+
function bi(t) {
|
|
1714
1728
|
try {
|
|
1715
1729
|
const e = new URL(t), r = e.pathname.split("/").filter(Boolean), a = (r[r.length - 1] || r[r.length - 2] || e.hostname).replace(/\.[a-z0-9]+$/i, "").replace(/[-_]+/g, " ").replace(/\s+/g, " ").trim();
|
|
1716
1730
|
return a ? a.replace(/\b\w/g, (l) => l.toUpperCase()) : e.hostname;
|
|
@@ -1719,7 +1733,7 @@ function pi(t) {
|
|
|
1719
1733
|
}
|
|
1720
1734
|
}
|
|
1721
1735
|
function Ir(t) {
|
|
1722
|
-
const e = new URL(t), r =
|
|
1736
|
+
const e = new URL(t), r = bi(t);
|
|
1723
1737
|
return {
|
|
1724
1738
|
title: r,
|
|
1725
1739
|
headings: [r],
|
|
@@ -1730,15 +1744,15 @@ Article topic inferred from URL path: ${r}`,
|
|
|
1730
1744
|
extracted_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1731
1745
|
};
|
|
1732
1746
|
}
|
|
1733
|
-
const
|
|
1734
|
-
function
|
|
1735
|
-
const e =
|
|
1747
|
+
const xi = 6e4, Tr = 3;
|
|
1748
|
+
function yi(t) {
|
|
1749
|
+
const e = gi();
|
|
1736
1750
|
if (e)
|
|
1737
1751
|
return e;
|
|
1738
1752
|
const r = t == null ? void 0 : t.trim();
|
|
1739
1753
|
return Vr(r) ? r : null;
|
|
1740
1754
|
}
|
|
1741
|
-
const
|
|
1755
|
+
const wi = ({
|
|
1742
1756
|
apiKey: t,
|
|
1743
1757
|
skipSdkInitialization: e = !1,
|
|
1744
1758
|
sessionId: r,
|
|
@@ -1760,19 +1774,19 @@ const gi = ({
|
|
|
1760
1774
|
/* @__PURE__ */ new Set()
|
|
1761
1775
|
), [G, I] = ae(/* @__PURE__ */ new Map()), [w, N] = ae(null), [U, L] = ae([]), [z, $] = ae(!1), [A, W] = ae(null), [V, X] = ae(!1), K = F(!1), O = F(0), oe = F(null), xe = F(null);
|
|
1762
1776
|
xe.current = w;
|
|
1763
|
-
const de = !!u || C === "ad-slot" || C === "auto" && (!!(k != null && k.trim()) ||
|
|
1777
|
+
const de = !!u || C === "ad-slot" || C === "auto" && (!!(k != null && k.trim()) || fi()), ee = le(async () => {
|
|
1764
1778
|
if (u)
|
|
1765
1779
|
return u;
|
|
1766
1780
|
if (!de)
|
|
1767
|
-
return
|
|
1768
|
-
const B =
|
|
1781
|
+
return di();
|
|
1782
|
+
const B = yi(k);
|
|
1769
1783
|
if (!B)
|
|
1770
1784
|
return s.warn("[AdMeshProvider] Ad-slot context mode requires a real article URL"), W("Article URL is required for ad-slot context"), null;
|
|
1771
1785
|
if (!t)
|
|
1772
1786
|
return s.warn("[AdMeshProvider] Cannot fetch page context: missing API key"), Ir(B);
|
|
1773
1787
|
try {
|
|
1774
1788
|
X(!0);
|
|
1775
|
-
const J = await
|
|
1789
|
+
const J = await hi(B, {
|
|
1776
1790
|
apiKey: t,
|
|
1777
1791
|
apiBaseUrl: l || "https://api.useadmesh.com",
|
|
1778
1792
|
agentDisplayId: p
|
|
@@ -1800,7 +1814,7 @@ const gi = ({
|
|
|
1800
1814
|
return [J, ...Y];
|
|
1801
1815
|
},
|
|
1802
1816
|
[]
|
|
1803
|
-
),
|
|
1817
|
+
), lt = le((B, J) => {
|
|
1804
1818
|
const Y = B.find((me) => me.is_sponsored), ie = J.filter((me) => !me.is_sponsored).slice(0, 3);
|
|
1805
1819
|
return Y ? [Y, ...ie] : ie;
|
|
1806
1820
|
}, []);
|
|
@@ -1861,7 +1875,7 @@ const gi = ({
|
|
|
1861
1875
|
articleTextLength: ((J = Y.article_text) == null ? void 0 : J.length) || 0,
|
|
1862
1876
|
domain: Y.domain
|
|
1863
1877
|
});
|
|
1864
|
-
const me = await
|
|
1878
|
+
const me = await pi(Y, {
|
|
1865
1879
|
apiKey: t,
|
|
1866
1880
|
apiBaseUrl: l || "https://api.useadmesh.com",
|
|
1867
1881
|
extension: o,
|
|
@@ -1879,7 +1893,7 @@ const gi = ({
|
|
|
1879
1893
|
};
|
|
1880
1894
|
})
|
|
1881
1895
|
}), L(
|
|
1882
|
-
(D) =>
|
|
1896
|
+
(D) => lt(D, me.suggestions || [])
|
|
1883
1897
|
)) : (s.warn("[AdMeshProvider] โ ๏ธ Intent analysis returned null"), W("Intent analysis failed"), L((D) => D.length > 0 ? (s.log("[AdMeshProvider] โน๏ธ Preserving existing suggestions after null intent analysis result"), D) : [
|
|
1884
1898
|
{
|
|
1885
1899
|
id: "fallback-1",
|
|
@@ -1902,7 +1916,7 @@ const gi = ({
|
|
|
1902
1916
|
} finally {
|
|
1903
1917
|
$(!1);
|
|
1904
1918
|
}
|
|
1905
|
-
}, [t, l, o, f,
|
|
1919
|
+
}, [t, l, o, f, lt, ee]), Se = le(
|
|
1906
1920
|
async (B) => {
|
|
1907
1921
|
var ie, me, D, re, P, ve;
|
|
1908
1922
|
if (!m || !t || !t.toLowerCase().startsWith("pub_"))
|
|
@@ -2107,7 +2121,7 @@ const gi = ({
|
|
|
2107
2121
|
s.warn("[AdMeshProvider] โ ๏ธ Failed to send delegation heartbeat:", me);
|
|
2108
2122
|
});
|
|
2109
2123
|
}
|
|
2110
|
-
},
|
|
2124
|
+
}, xi);
|
|
2111
2125
|
return () => {
|
|
2112
2126
|
window.clearInterval(Y);
|
|
2113
2127
|
};
|
|
@@ -2165,7 +2179,7 @@ const gi = ({
|
|
|
2165
2179
|
};
|
|
2166
2180
|
return /* @__PURE__ */ i(qr.Provider, { value: Oe, children: v });
|
|
2167
2181
|
};
|
|
2168
|
-
class
|
|
2182
|
+
class _i {
|
|
2169
2183
|
constructor() {
|
|
2170
2184
|
et(this, "roots", /* @__PURE__ */ new Map());
|
|
2171
2185
|
}
|
|
@@ -2189,7 +2203,7 @@ class bi {
|
|
|
2189
2203
|
const l = yo.createRoot(o);
|
|
2190
2204
|
s.log("[AdMeshRenderer] ๐ Rendering recommendations"), l.render(
|
|
2191
2205
|
/* @__PURE__ */ i(
|
|
2192
|
-
|
|
2206
|
+
wi,
|
|
2193
2207
|
{
|
|
2194
2208
|
apiKey: e.apiKey,
|
|
2195
2209
|
sessionId: e.sessionId,
|
|
@@ -2201,7 +2215,7 @@ class bi {
|
|
|
2201
2215
|
model: e.model,
|
|
2202
2216
|
messages: e.messages,
|
|
2203
2217
|
children: /* @__PURE__ */ i(
|
|
2204
|
-
|
|
2218
|
+
ai,
|
|
2205
2219
|
{
|
|
2206
2220
|
recommendations: r,
|
|
2207
2221
|
theme: e.theme,
|
|
@@ -2238,7 +2252,7 @@ class bi {
|
|
|
2238
2252
|
this.roots.clear();
|
|
2239
2253
|
}
|
|
2240
2254
|
}
|
|
2241
|
-
const
|
|
2255
|
+
const vi = (t) => {
|
|
2242
2256
|
if (typeof t != "string")
|
|
2243
2257
|
return;
|
|
2244
2258
|
const e = t.trim().toUpperCase();
|
|
@@ -2342,13 +2356,13 @@ const xi = (t) => {
|
|
|
2342
2356
|
* OPTIMIZATION: Lazy initialize renderer on first use
|
|
2343
2357
|
*/
|
|
2344
2358
|
getRenderer() {
|
|
2345
|
-
return this.renderer || (this.renderer = new
|
|
2359
|
+
return this.renderer || (this.renderer = new _i()), this.renderer;
|
|
2346
2360
|
}
|
|
2347
2361
|
/**
|
|
2348
2362
|
* OPTIMIZATION: Lazy initialize tracker on first use
|
|
2349
2363
|
*/
|
|
2350
2364
|
getTracker() {
|
|
2351
|
-
return this.tracker || (this.tracker = new
|
|
2365
|
+
return this.tracker || (this.tracker = new si({
|
|
2352
2366
|
apiKey: this.config.apiKey
|
|
2353
2367
|
})), this.tracker;
|
|
2354
2368
|
}
|
|
@@ -2486,7 +2500,7 @@ const xi = (t) => {
|
|
|
2486
2500
|
sessionId: e.sessionId,
|
|
2487
2501
|
messageId: o
|
|
2488
2502
|
}), l;
|
|
2489
|
-
const c = e.messages ? e.messages.length : 0, x = (typeof window < "u" && window.navigator, "web"), f = typeof window < "u" && window.innerWidth ? window.innerWidth < 768 ? "mobile" : window.innerWidth < 1024 ? "tablet" : "desktop" : "desktop", y =
|
|
2503
|
+
const c = e.messages ? e.messages.length : 0, x = (typeof window < "u" && window.navigator, "web"), f = typeof window < "u" && window.innerWidth ? window.innerWidth < 768 ? "mobile" : window.innerWidth < 1024 ? "tablet" : "desktop" : "desktop", y = vi((m = e.location) == null ? void 0 : m.countryCode) || "US", d = typeof window < "u" && window.location ? {
|
|
2490
2504
|
url: window.location.href,
|
|
2491
2505
|
origin: window.location.origin,
|
|
2492
2506
|
referrer: document.referrer || void 0,
|
|
@@ -3060,7 +3074,7 @@ function xn() {
|
|
|
3060
3074
|
stopDelegationSession: t.stopDelegationSession
|
|
3061
3075
|
};
|
|
3062
3076
|
}
|
|
3063
|
-
const
|
|
3077
|
+
const ki = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
3064
3078
|
"svg",
|
|
3065
3079
|
{
|
|
3066
3080
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -3078,7 +3092,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3078
3092
|
/* @__PURE__ */ i("path", { d: "M12 5v14" })
|
|
3079
3093
|
]
|
|
3080
3094
|
}
|
|
3081
|
-
),
|
|
3095
|
+
), Si = ({
|
|
3082
3096
|
recommendation: t,
|
|
3083
3097
|
theme: e,
|
|
3084
3098
|
sdk: r,
|
|
@@ -3129,7 +3143,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3129
3143
|
/* @__PURE__ */ M("div", { className: "flex flex-row items-center space-x-2", children: [
|
|
3130
3144
|
/* @__PURE__ */ i("span", { className: "text-xs text-gray-500 dark:text-gray-400 italic admesh-ad-label", children: "Ad" }),
|
|
3131
3145
|
/* @__PURE__ */ i(
|
|
3132
|
-
|
|
3146
|
+
ki,
|
|
3133
3147
|
{
|
|
3134
3148
|
size: 20,
|
|
3135
3149
|
className: "text-[#24A0ED] flex-shrink-0 admesh-plus-icon"
|
|
@@ -3177,7 +3191,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3177
3191
|
activeDelegationSession: A,
|
|
3178
3192
|
setActiveDelegationSession: W,
|
|
3179
3193
|
hasActiveDelegationSession: V
|
|
3180
|
-
} = xn(), X = (D) => !!D && D.status === "generated" && !!D.recommendation, K = a || I, [O, oe] = ae(null), [xe, de] = ae(null), [ee, Ce] = ae(!0), [
|
|
3194
|
+
} = xn(), X = (D) => !!D && D.status === "generated" && !!D.recommendation, K = a || I, [O, oe] = ae(null), [xe, de] = ae(null), [ee, Ce] = ae(!0), [lt, Te] = ae(null), Se = F(null), ye = F(!1), ke = F(!1), Ee = F(t), qe = F(e);
|
|
3181
3195
|
te(() => {
|
|
3182
3196
|
Ee.current = t, qe.current = e;
|
|
3183
3197
|
}, [t, e]), te(() => {
|
|
@@ -3473,7 +3487,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3473
3487
|
},
|
|
3474
3488
|
[r, k, m, h]
|
|
3475
3489
|
);
|
|
3476
|
-
if (!r || !o || o.trim() === "" || ee ||
|
|
3490
|
+
if (!r || !o || o.trim() === "" || ee || lt)
|
|
3477
3491
|
return null;
|
|
3478
3492
|
if (!O || !xe)
|
|
3479
3493
|
return s.log("[AdMeshRecommendations] ๐ซ Nothing to render", {
|
|
@@ -3481,7 +3495,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3481
3495
|
hasPlatformResult: !!O,
|
|
3482
3496
|
detectedFormat: xe,
|
|
3483
3497
|
isLoading: ee,
|
|
3484
|
-
hasError: !!
|
|
3498
|
+
hasError: !!lt
|
|
3485
3499
|
}), null;
|
|
3486
3500
|
s.log("[AdMeshRecommendations] ๐จ Rendering recommendation component", {
|
|
3487
3501
|
messageId: r,
|
|
@@ -3491,7 +3505,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3491
3505
|
headline: (me = (ie = O.recommendation) == null ? void 0 : ie.creative) == null ? void 0 : me.headline
|
|
3492
3506
|
});
|
|
3493
3507
|
const B = typeof document < "u" && x && (v ?? !0) ? document.getElementById(x) : null;
|
|
3494
|
-
return /* @__PURE__ */ M(
|
|
3508
|
+
return /* @__PURE__ */ M(ut, { children: [
|
|
3495
3509
|
/* @__PURE__ */ i("div", { className: "admesh-recommendations-container", style: { marginTop: "1rem" }, children: /* @__PURE__ */ i(
|
|
3496
3510
|
jr,
|
|
3497
3511
|
{
|
|
@@ -3508,7 +3522,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3508
3522
|
) }),
|
|
3509
3523
|
B && m && h ? Qn(
|
|
3510
3524
|
/* @__PURE__ */ i(
|
|
3511
|
-
|
|
3525
|
+
Si,
|
|
3512
3526
|
{
|
|
3513
3527
|
recommendation: O,
|
|
3514
3528
|
theme: U,
|
|
@@ -3520,7 +3534,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3520
3534
|
B
|
|
3521
3535
|
) : null
|
|
3522
3536
|
] });
|
|
3523
|
-
},
|
|
3537
|
+
}, Ai = ({
|
|
3524
3538
|
format: t = "tail",
|
|
3525
3539
|
onError: e,
|
|
3526
3540
|
messageId: r,
|
|
@@ -3649,16 +3663,16 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3649
3663
|
}
|
|
3650
3664
|
}
|
|
3651
3665
|
);
|
|
3652
|
-
}, Gr = Br(void 0),
|
|
3666
|
+
}, Gr = Br(void 0), aa = ({ children: t, shouldRenderFallback: e, messageId: r, sessionId: o, query: a }) => /* @__PURE__ */ i(Gr.Provider, { value: { shouldRenderFallback: e, messageId: r, sessionId: o, query: a }, children: t }), sa = () => Ur(Gr), Wn = (t) => {
|
|
3653
3667
|
try {
|
|
3654
3668
|
return new URL(t), !0;
|
|
3655
3669
|
} catch {
|
|
3656
3670
|
return !1;
|
|
3657
3671
|
}
|
|
3658
|
-
}, Rr = (t) => t && t.trim() ? t.trim() : "", Vt = (t) => typeof t == "string" ? t.trim() : typeof t == "number" ? String(t) : "",
|
|
3672
|
+
}, Rr = (t) => t && t.trim() ? t.trim() : "", Vt = (t) => typeof t == "string" ? t.trim() : typeof t == "number" ? String(t) : "", St = (t) => Vt(t) || void 0, Ci = (t, e) => {
|
|
3659
3673
|
const r = t.split(/\s+/).filter(Boolean);
|
|
3660
3674
|
return r.length <= e ? t : `${r.slice(0, e).join(" ")}...`;
|
|
3661
|
-
},
|
|
3675
|
+
}, Mi = (t, e) => {
|
|
3662
3676
|
if (t == null || t === "")
|
|
3663
3677
|
return "";
|
|
3664
3678
|
if (typeof t == "number")
|
|
@@ -3672,7 +3686,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3672
3686
|
return String(t);
|
|
3673
3687
|
}
|
|
3674
3688
|
return Vt(t);
|
|
3675
|
-
},
|
|
3689
|
+
}, Ei = (t, e, r) => {
|
|
3676
3690
|
if (t == null || t === "")
|
|
3677
3691
|
return "";
|
|
3678
3692
|
const o = (e || "percentage").trim().toLowerCase();
|
|
@@ -3705,7 +3719,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3705
3719
|
productImageFallbackBg: "#e5e7eb",
|
|
3706
3720
|
successText: "#065f46",
|
|
3707
3721
|
successBg: "#d1fae5"
|
|
3708
|
-
},
|
|
3722
|
+
}, la = ({
|
|
3709
3723
|
recommendations: t,
|
|
3710
3724
|
theme: e,
|
|
3711
3725
|
className: r = "",
|
|
@@ -3717,10 +3731,10 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3717
3731
|
onStartDelegation: f,
|
|
3718
3732
|
onPasteToInput: y
|
|
3719
3733
|
}) => {
|
|
3720
|
-
var ge, E, De, Z, Be, Ne, Re, ze, Ue, Xe, tt, At, Wt, He, Ve, be,
|
|
3734
|
+
var ge, E, De, Z, Be, Ne, Re, ze, Ue, Xe, tt, At, Wt, He, Ve, be, ht, Pt, zt, q, ft, Ct, Bt, Q, we, gt, dt, Ut, Ht, $t, nn, Kt, Mt;
|
|
3721
3735
|
if (!t || t.length === 0)
|
|
3722
3736
|
return s.log("[AdMesh Tail Ad] No recommendations provided - not rendering"), null;
|
|
3723
|
-
const d = t[0], u = ((ge = d == null ? void 0 : d.recommendation) == null ? void 0 : ge.offerId) || "", k = ((E = d == null ? void 0 : d.tracking) == null ? void 0 : E.exposure_url) || "", C = (d == null ? void 0 : d.recommendation_id) || "", p = ((Z = (De = d == null ? void 0 : d.recommendation) == null ? void 0 : De.creative) == null ? void 0 : Z.description) || "", v = ((Be = d == null ? void 0 : d.recommendation) == null ? void 0 : Be.disclosure) || "Sponsored", m = ((Re = (Ne = d == null ? void 0 : d.recommendation) == null ? void 0 : Ne.creative) == null ? void 0 : Re.brand_name) || "", h = ((Ue = (ze = d == null ? void 0 : d.recommendation) == null ? void 0 : ze.creative) == null ? void 0 : Ue.headline) || ((tt = (Xe = d == null ? void 0 : d.recommendation) == null ? void 0 : Xe.creative) == null ? void 0 : tt.brand_name) || "", S = ((Wt = (At = d == null ? void 0 : d.recommendation) == null ? void 0 : At.creative) == null ? void 0 : Wt.logo_url) || "", R = ((He = d == null ? void 0 : d.tracking) == null ? void 0 : He.click_url) || ((be = (Ve = d == null ? void 0 : d.recommendation) == null ? void 0 : Ve.creative) == null ? void 0 : be.landing_page_url) || "", G = Rr((Pt = (
|
|
3737
|
+
const d = t[0], u = ((ge = d == null ? void 0 : d.recommendation) == null ? void 0 : ge.offerId) || "", k = ((E = d == null ? void 0 : d.tracking) == null ? void 0 : E.exposure_url) || "", C = (d == null ? void 0 : d.recommendation_id) || "", p = ((Z = (De = d == null ? void 0 : d.recommendation) == null ? void 0 : De.creative) == null ? void 0 : Z.description) || "", v = ((Be = d == null ? void 0 : d.recommendation) == null ? void 0 : Be.disclosure) || "Sponsored", m = ((Re = (Ne = d == null ? void 0 : d.recommendation) == null ? void 0 : Ne.creative) == null ? void 0 : Re.brand_name) || "", h = ((Ue = (ze = d == null ? void 0 : d.recommendation) == null ? void 0 : ze.creative) == null ? void 0 : Ue.headline) || ((tt = (Xe = d == null ? void 0 : d.recommendation) == null ? void 0 : Xe.creative) == null ? void 0 : tt.brand_name) || "", S = ((Wt = (At = d == null ? void 0 : d.recommendation) == null ? void 0 : At.creative) == null ? void 0 : Wt.logo_url) || "", R = ((He = d == null ? void 0 : d.tracking) == null ? void 0 : He.click_url) || ((be = (Ve = d == null ? void 0 : d.recommendation) == null ? void 0 : Ve.creative) == null ? void 0 : be.landing_page_url) || "", G = Rr((Pt = (ht = d == null ? void 0 : d.recommendation) == null ? void 0 : ht.creative) == null ? void 0 : Pt.cta_text), I = ((q = (zt = d == null ? void 0 : d.recommendation) == null ? void 0 : zt.creative) == null ? void 0 : q.products) || [], w = I.length > 1, N = w ? I.slice(0, 4) : [], U = ((ft = d == null ? void 0 : d.recommendation) == null ? void 0 : ft.format) || "tail", L = U === "bridge", z = ((Ct = d == null ? void 0 : d.delegation) == null ? void 0 : Ct.brand_name) || m, $ = ((Bt = d == null ? void 0 : d.delegation) == null ? void 0 : Bt.available) === !0, A = L && $, W = "Talk to Agent", V = !w && !!G && !!R;
|
|
3724
3738
|
if (!m && !h && !p)
|
|
3725
3739
|
return s.log("[AdMesh Tail Ad] No valid recommendation data provided - not rendering", {
|
|
3726
3740
|
reason: "brand, headline, and description are missing",
|
|
@@ -3737,7 +3751,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3737
3751
|
sessionId: a ? "present" : "MISSING",
|
|
3738
3752
|
recommendationsCount: t.length,
|
|
3739
3753
|
clickUrl: R || "MISSING",
|
|
3740
|
-
clickUrlSource: (Q = d == null ? void 0 : d.tracking) != null && Q.click_url ? "tracking.click_url" : (
|
|
3754
|
+
clickUrlSource: (Q = d == null ? void 0 : d.tracking) != null && Q.click_url ? "tracking.click_url" : (gt = (we = d == null ? void 0 : d.recommendation) == null ? void 0 : we.creative) != null && gt.landing_page_url ? "recommendation.creative.landing_page_url" : "none",
|
|
3741
3755
|
shortDescription: p ? "present" : "MISSING",
|
|
3742
3756
|
brandName: m,
|
|
3743
3757
|
productName: h,
|
|
@@ -3771,7 +3785,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3771
3785
|
w || !R || (O("tail_ad_card"), typeof window < "u" && window.open(R, "_blank", "noopener,noreferrer"));
|
|
3772
3786
|
}, Ce = (H) => {
|
|
3773
3787
|
w || !R || (H.key === "Enter" || H.key === " ") && (H.preventDefault(), ee());
|
|
3774
|
-
}, [
|
|
3788
|
+
}, [lt, Te] = ae(!1), [Se, ye] = ae(!1), ke = F(null);
|
|
3775
3789
|
te(() => () => {
|
|
3776
3790
|
ke.current && (ke.current(!1), ke.current = null);
|
|
3777
3791
|
}, []);
|
|
@@ -3799,7 +3813,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3799
3813
|
s.error("[AdMesh Tail Ad] Error tracking delegation engagement:", H);
|
|
3800
3814
|
}
|
|
3801
3815
|
}, Me = async (H) => {
|
|
3802
|
-
var
|
|
3816
|
+
var wt, It, Gt, jt;
|
|
3803
3817
|
if (H.preventDefault(), H.stopPropagation(), !d || !A)
|
|
3804
3818
|
return;
|
|
3805
3819
|
if (O("tail_ad_delegation_cta"), !await qe()) {
|
|
@@ -3809,25 +3823,25 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3809
3823
|
ce();
|
|
3810
3824
|
const ue = d.delegation, Et = ue != null && ue.available ? {
|
|
3811
3825
|
recommendation_id: d.recommendation_id,
|
|
3812
|
-
brand_id:
|
|
3813
|
-
brand_name:
|
|
3814
|
-
ue.brand_name || ((It = (
|
|
3826
|
+
brand_id: St(ue.brand_id),
|
|
3827
|
+
brand_name: St(
|
|
3828
|
+
ue.brand_name || ((It = (wt = d.recommendation) == null ? void 0 : wt.creative) == null ? void 0 : It.brand_name)
|
|
3815
3829
|
),
|
|
3816
|
-
mcp_endpoint:
|
|
3817
|
-
eligibility_reason:
|
|
3818
|
-
delegate_reason:
|
|
3819
|
-
session_goal:
|
|
3830
|
+
mcp_endpoint: St(ue.mcp_endpoint),
|
|
3831
|
+
eligibility_reason: St(ue.eligibility_reason),
|
|
3832
|
+
delegate_reason: St(ue.delegate_reason),
|
|
3833
|
+
session_goal: St(ue.session_goal),
|
|
3820
3834
|
desired_outcome_type: ue.desired_outcome_type,
|
|
3821
|
-
required_user_inputs: Array.isArray(ue.required_user_inputs) ? ue.required_user_inputs.filter((
|
|
3822
|
-
required_consent_types: Array.isArray(ue.required_consent_types) ? ue.required_consent_types.filter((
|
|
3823
|
-
success_outcome:
|
|
3824
|
-
fallback_message:
|
|
3825
|
-
session_mode:
|
|
3826
|
-
status:
|
|
3835
|
+
required_user_inputs: Array.isArray(ue.required_user_inputs) ? ue.required_user_inputs.filter((bt) => typeof bt == "string") : [],
|
|
3836
|
+
required_consent_types: Array.isArray(ue.required_consent_types) ? ue.required_consent_types.filter((bt) => typeof bt == "string") : [],
|
|
3837
|
+
success_outcome: St(ue.success_outcome),
|
|
3838
|
+
fallback_message: St(ue.fallback_message),
|
|
3839
|
+
session_mode: St(ue.session_mode),
|
|
3840
|
+
status: St(ue.status),
|
|
3827
3841
|
capabilities: ue.capabilities || [],
|
|
3828
3842
|
allowed_data_types: ue.allowed_data_types || [],
|
|
3829
3843
|
consent_requirements: ue.consent_requirements || [],
|
|
3830
|
-
auth_model:
|
|
3844
|
+
auth_model: St(ue.auth_model),
|
|
3831
3845
|
handoff_protocol: ue.handoff_protocol && typeof ue.handoff_protocol == "object" ? ue.handoff_protocol : void 0,
|
|
3832
3846
|
supported_actions: ue.supported_actions || [],
|
|
3833
3847
|
metadata: ue.metadata && typeof ue.metadata == "object" ? ue.metadata : void 0,
|
|
@@ -3849,17 +3863,17 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3849
3863
|
}
|
|
3850
3864
|
return;
|
|
3851
3865
|
}
|
|
3852
|
-
const
|
|
3853
|
-
if (
|
|
3854
|
-
y(
|
|
3866
|
+
const ct = ((jt = (Gt = d.recommendation) == null ? void 0 : Gt.creative) == null ? void 0 : jt.follow_up_suggestion) || "";
|
|
3867
|
+
if (ct && y) {
|
|
3868
|
+
y(ct), ye(!1), Te(!1);
|
|
3855
3869
|
return;
|
|
3856
3870
|
}
|
|
3857
|
-
if (
|
|
3858
|
-
window.__admesh_setMessage(
|
|
3871
|
+
if (ct && typeof window < "u" && window.__admesh_setMessage) {
|
|
3872
|
+
window.__admesh_setMessage(ct), ye(!1), Te(!1);
|
|
3859
3873
|
return;
|
|
3860
3874
|
}
|
|
3861
3875
|
ye(!1), Te(!1);
|
|
3862
|
-
}, [Oe, B] = ae(!1), J = m ? m.charAt(0).toUpperCase() : "B", Y = _e.surface, ie = _e.border, me = (e == null ? void 0 : e.borderRadius) || ((Ut = (
|
|
3876
|
+
}, [Oe, B] = ae(!1), J = m ? m.charAt(0).toUpperCase() : "B", Y = _e.surface, ie = _e.border, me = (e == null ? void 0 : e.borderRadius) || ((Ut = (dt = e == null ? void 0 : e.components) == null ? void 0 : dt.card) == null ? void 0 : Ut.borderRadius) || "8px", D = "0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)", re = "0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)", P = ((Ht = e == null ? void 0 : e.shadows) == null ? void 0 : Ht.medium) || ((nn = ($t = e == null ? void 0 : e.components) == null ? void 0 : $t.card) == null ? void 0 : nn.boxShadow) || D, ve = ((Kt = e == null ? void 0 : e.shadows) == null ? void 0 : Kt.large) || re;
|
|
3863
3877
|
return /* @__PURE__ */ M(
|
|
3864
3878
|
Cn,
|
|
3865
3879
|
{
|
|
@@ -3988,7 +4002,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
3988
4002
|
// Allow flex item to shrink below content size
|
|
3989
4003
|
},
|
|
3990
4004
|
children: [
|
|
3991
|
-
X && !w && /* @__PURE__ */ i("div", { className: "mb-2", children: /* @__PURE__ */ i("h3", { className: "font-semibold text-base", style: { fontSize: "14px", lineHeight: 1.35, color: _e.text }, children: R && m ? /* @__PURE__ */ M(
|
|
4005
|
+
X && !w && /* @__PURE__ */ i("div", { className: "mb-2", children: /* @__PURE__ */ i("h3", { className: "font-semibold text-base", style: { fontSize: "14px", lineHeight: 1.35, color: _e.text }, children: R && m ? /* @__PURE__ */ M(ut, { children: [
|
|
3992
4006
|
/* @__PURE__ */ i(
|
|
3993
4007
|
"a",
|
|
3994
4008
|
{
|
|
@@ -4034,11 +4048,11 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
4034
4048
|
paddingRight: 0
|
|
4035
4049
|
},
|
|
4036
4050
|
children: N.map((H) => {
|
|
4037
|
-
const je = Vt(H.product_name) || "Product", ue = Vt(H.product_link) || Vt(H.product_url) || R || "#", Et =
|
|
4051
|
+
const je = Vt(H.product_name) || "Product", ue = Vt(H.product_link) || Vt(H.product_url) || R || "#", Et = Ci(Vt(H.product_description), 10), ct = Mi(H.product_price, H.product_currency), wt = Ei(
|
|
4038
4052
|
H.product_discount,
|
|
4039
4053
|
H.product_discount_type,
|
|
4040
4054
|
H.product_currency
|
|
4041
|
-
), It = Vt(H.product_image_url), Gt = S && Wn(S) ? S : "", jt = It && Wn(It) ? It : Gt,
|
|
4055
|
+
), It = Vt(H.product_image_url), Gt = S && Wn(S) ? S : "", jt = It && Wn(It) ? It : Gt, bt = Rr(H.product_cta_label), rn = ue !== "#";
|
|
4042
4056
|
return /* @__PURE__ */ i(
|
|
4043
4057
|
"a",
|
|
4044
4058
|
{
|
|
@@ -4116,15 +4130,15 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
4116
4130
|
children: Et
|
|
4117
4131
|
}
|
|
4118
4132
|
),
|
|
4119
|
-
(
|
|
4133
|
+
(ct || wt) && /* @__PURE__ */ M(
|
|
4120
4134
|
"div",
|
|
4121
4135
|
{
|
|
4122
4136
|
className: "flex items-center gap-2 flex-wrap",
|
|
4123
4137
|
style: {
|
|
4124
|
-
marginBottom:
|
|
4138
|
+
marginBottom: bt ? "6px" : 0
|
|
4125
4139
|
},
|
|
4126
4140
|
children: [
|
|
4127
|
-
|
|
4141
|
+
ct && /* @__PURE__ */ M("div", { className: "flex items-center gap-1", children: [
|
|
4128
4142
|
/* @__PURE__ */ i(
|
|
4129
4143
|
"span",
|
|
4130
4144
|
{
|
|
@@ -4145,11 +4159,11 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
4145
4159
|
fontSize: "13px",
|
|
4146
4160
|
color: _e.text
|
|
4147
4161
|
},
|
|
4148
|
-
children:
|
|
4162
|
+
children: ct
|
|
4149
4163
|
}
|
|
4150
4164
|
)
|
|
4151
4165
|
] }),
|
|
4152
|
-
|
|
4166
|
+
wt && /* @__PURE__ */ i(
|
|
4153
4167
|
"span",
|
|
4154
4168
|
{
|
|
4155
4169
|
className: "text-xs",
|
|
@@ -4161,13 +4175,13 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
4161
4175
|
padding: "2px 8px",
|
|
4162
4176
|
fontWeight: 600
|
|
4163
4177
|
},
|
|
4164
|
-
children:
|
|
4178
|
+
children: wt
|
|
4165
4179
|
}
|
|
4166
4180
|
)
|
|
4167
4181
|
]
|
|
4168
4182
|
}
|
|
4169
4183
|
),
|
|
4170
|
-
|
|
4184
|
+
bt && /* @__PURE__ */ i(
|
|
4171
4185
|
"span",
|
|
4172
4186
|
{
|
|
4173
4187
|
className: "font-medium",
|
|
@@ -4177,7 +4191,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
4177
4191
|
textDecoration: "underline",
|
|
4178
4192
|
textUnderlineOffset: "2px"
|
|
4179
4193
|
},
|
|
4180
|
-
children:
|
|
4194
|
+
children: bt
|
|
4181
4195
|
}
|
|
4182
4196
|
)
|
|
4183
4197
|
] })
|
|
@@ -4257,7 +4271,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
4257
4271
|
] }),
|
|
4258
4272
|
/* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ i("p", { className: "text-xs", style: { fontSize: "11px", color: _e.textMuted }, children: v }) })
|
|
4259
4273
|
] }),
|
|
4260
|
-
|
|
4274
|
+
lt ? /* @__PURE__ */ M(
|
|
4261
4275
|
"div",
|
|
4262
4276
|
{
|
|
4263
4277
|
style: {
|
|
@@ -4371,7 +4385,7 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
4371
4385
|
]
|
|
4372
4386
|
}
|
|
4373
4387
|
);
|
|
4374
|
-
},
|
|
4388
|
+
}, Ii = ({
|
|
4375
4389
|
recommendationId: t,
|
|
4376
4390
|
admeshLink: e,
|
|
4377
4391
|
productId: r,
|
|
@@ -4405,8 +4419,8 @@ const yi = ({ className: t, size: e = 20 }) => /* @__PURE__ */ M(
|
|
|
4405
4419
|
}
|
|
4406
4420
|
);
|
|
4407
4421
|
};
|
|
4408
|
-
|
|
4409
|
-
function
|
|
4422
|
+
Ii.displayName = "AdMeshLinkTracker";
|
|
4423
|
+
function Ti(t) {
|
|
4410
4424
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
4411
4425
|
}
|
|
4412
4426
|
var Bn = { exports: {} };
|
|
@@ -4416,7 +4430,7 @@ var Bn = { exports: {} };
|
|
|
4416
4430
|
http://jedwatson.github.io/classnames
|
|
4417
4431
|
*/
|
|
4418
4432
|
var Dr;
|
|
4419
|
-
function
|
|
4433
|
+
function Ri() {
|
|
4420
4434
|
return Dr || (Dr = 1, (function(t) {
|
|
4421
4435
|
(function() {
|
|
4422
4436
|
var e = {}.hasOwnProperty;
|
|
@@ -4448,29 +4462,29 @@ function Mi() {
|
|
|
4448
4462
|
})();
|
|
4449
4463
|
})(Bn)), Bn.exports;
|
|
4450
4464
|
}
|
|
4451
|
-
var
|
|
4452
|
-
const
|
|
4465
|
+
var Di = Ri();
|
|
4466
|
+
const Pi = /* @__PURE__ */ Ti(Di), zi = {
|
|
4453
4467
|
"Top Match": "primary",
|
|
4454
4468
|
"Free Tier": "success",
|
|
4455
4469
|
"AI Powered": "secondary",
|
|
4456
4470
|
Popular: "warning",
|
|
4457
4471
|
New: "primary",
|
|
4458
4472
|
"Trial Available": "success"
|
|
4459
|
-
},
|
|
4473
|
+
}, $i = {
|
|
4460
4474
|
"Top Match": "โ
",
|
|
4461
4475
|
"Free Tier": "โ",
|
|
4462
4476
|
"AI Powered": "โ",
|
|
4463
4477
|
Popular: "โฒ",
|
|
4464
4478
|
New: "โ",
|
|
4465
4479
|
"Trial Available": "โ"
|
|
4466
|
-
},
|
|
4480
|
+
}, Ni = ({
|
|
4467
4481
|
type: t,
|
|
4468
4482
|
variant: e,
|
|
4469
4483
|
size: r = "md",
|
|
4470
4484
|
className: o,
|
|
4471
4485
|
style: a
|
|
4472
4486
|
}) => {
|
|
4473
|
-
const l = e ||
|
|
4487
|
+
const l = e || zi[t] || "secondary", c = $i[t], x = Pi(
|
|
4474
4488
|
"admesh-component",
|
|
4475
4489
|
"admesh-badge",
|
|
4476
4490
|
`admesh-badge--${l}`,
|
|
@@ -4489,20 +4503,20 @@ const Ii = /* @__PURE__ */ Ci(Ei), Ti = {
|
|
|
4489
4503
|
}
|
|
4490
4504
|
);
|
|
4491
4505
|
};
|
|
4492
|
-
|
|
4493
|
-
const
|
|
4506
|
+
Ni.displayName = "AdMeshBadge";
|
|
4507
|
+
const st = ":not([data-admesh-ad-content], [data-admesh-ad-content] *)", Yr = `
|
|
4494
4508
|
.admesh-publisher-panel {
|
|
4495
4509
|
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
|
|
4496
4510
|
text-align: left;
|
|
4497
4511
|
line-height: 1.5;
|
|
4498
4512
|
-webkit-font-smoothing: antialiased;
|
|
4499
4513
|
}
|
|
4500
|
-
.admesh-publisher-panel *${
|
|
4514
|
+
.admesh-publisher-panel *${st}, .admesh-publisher-panel *${st}::before, .admesh-publisher-panel *${st}::after {
|
|
4501
4515
|
box-sizing: border-box;
|
|
4502
4516
|
}
|
|
4503
|
-
.admesh-publisher-panel button${
|
|
4504
|
-
.admesh-publisher-panel button${
|
|
4505
|
-
.admesh-publisher-panel button${
|
|
4517
|
+
.admesh-publisher-panel button${st}, .admesh-publisher-panel input${st} { font-family: inherit; }
|
|
4518
|
+
.admesh-publisher-panel button${st} { transition: border-color 150ms ease, background-color 150ms ease; }
|
|
4519
|
+
.admesh-publisher-panel button${st}:focus-visible, .admesh-publisher-panel a${st}:focus-visible {
|
|
4506
4520
|
outline: 2px solid var(--publisher-accent);
|
|
4507
4521
|
outline-offset: 2px;
|
|
4508
4522
|
}
|
|
@@ -4516,20 +4530,20 @@ const at = ":not([data-admesh-ad-content], [data-admesh-ad-content] *)", Yr = `
|
|
|
4516
4530
|
}
|
|
4517
4531
|
.admesh-publisher-panel .admesh-publisher-source { transition: border-color 150ms ease; }
|
|
4518
4532
|
.admesh-publisher-panel .admesh-publisher-suggestion { overflow-wrap: anywhere; }
|
|
4519
|
-
.admesh-publisher-panel input${
|
|
4520
|
-
.admesh-publisher-panel a${
|
|
4533
|
+
.admesh-publisher-panel input${st} { min-width: 0; }
|
|
4534
|
+
.admesh-publisher-panel a${st} { text-underline-offset: 3px; }
|
|
4521
4535
|
@media (prefers-reduced-motion: reduce) {
|
|
4522
|
-
.admesh-publisher-panel *${
|
|
4536
|
+
.admesh-publisher-panel *${st}, .admesh-publisher-panel *${st}::before, .admesh-publisher-panel *${st}::after {
|
|
4523
4537
|
animation: none !important;
|
|
4524
4538
|
transition: none !important;
|
|
4525
4539
|
scroll-behavior: auto !important;
|
|
4526
4540
|
}
|
|
4527
4541
|
}
|
|
4528
4542
|
@media (max-width: 767px) {
|
|
4529
|
-
.admesh-publisher-panel:not([data-compact="true"]) input${
|
|
4543
|
+
.admesh-publisher-panel:not([data-compact="true"]) input${st} { font-size: 16px !important; }
|
|
4530
4544
|
}
|
|
4531
4545
|
`;
|
|
4532
|
-
function
|
|
4546
|
+
function Li({
|
|
4533
4547
|
value: t,
|
|
4534
4548
|
onChange: e,
|
|
4535
4549
|
onSend: r,
|
|
@@ -4583,7 +4597,7 @@ function Pi({
|
|
|
4583
4597
|
}, $ = () => {
|
|
4584
4598
|
!t.trim() || y || (f(!1), r());
|
|
4585
4599
|
};
|
|
4586
|
-
return /* @__PURE__ */ M(
|
|
4600
|
+
return /* @__PURE__ */ M(ut, { children: [
|
|
4587
4601
|
/* @__PURE__ */ M(
|
|
4588
4602
|
"div",
|
|
4589
4603
|
{
|
|
@@ -4664,7 +4678,7 @@ function Pi({
|
|
|
4664
4678
|
cursor: "pointer",
|
|
4665
4679
|
opacity: !y && !t.trim() ? 0.5 : 1
|
|
4666
4680
|
},
|
|
4667
|
-
children: y ? /* @__PURE__ */ i(
|
|
4681
|
+
children: y ? /* @__PURE__ */ i(Ho, { size: 14, fill: "currentColor", "aria-hidden": "true" }) : /* @__PURE__ */ i(Io, { size: 18, "aria-hidden": "true" })
|
|
4668
4682
|
}
|
|
4669
4683
|
)
|
|
4670
4684
|
]
|
|
@@ -4744,7 +4758,7 @@ function Pi({
|
|
|
4744
4758
|
)
|
|
4745
4759
|
] });
|
|
4746
4760
|
}
|
|
4747
|
-
const Un = "admesh-ui-sdk-styles", Hn = "admesh-ui-sdk-reset",
|
|
4761
|
+
const Un = "admesh-ui-sdk-styles", Hn = "admesh-ui-sdk-reset", Fi = `
|
|
4748
4762
|
/* AdMesh UI SDK - CSS Reset & Normalization */
|
|
4749
4763
|
.admesh-component,
|
|
4750
4764
|
.admesh-component * {
|
|
@@ -4833,7 +4847,7 @@ const Un = "admesh-ui-sdk-styles", Hn = "admesh-ui-sdk-reset", zi = `
|
|
|
4833
4847
|
.admesh-component[data-admesh-theme="light"] {
|
|
4834
4848
|
color-scheme: light;
|
|
4835
4849
|
}
|
|
4836
|
-
`,
|
|
4850
|
+
`, Wi = `
|
|
4837
4851
|
/* AdMesh Core Component Styles */
|
|
4838
4852
|
|
|
4839
4853
|
.admesh-component {
|
|
@@ -5044,18 +5058,18 @@ const Un = "admesh-ui-sdk-styles", Hn = "admesh-ui-sdk-reset", zi = `
|
|
|
5044
5058
|
font-size: 0.875rem;
|
|
5045
5059
|
}
|
|
5046
5060
|
}
|
|
5047
|
-
`,
|
|
5061
|
+
`, Bi = () => {
|
|
5048
5062
|
if (!(typeof document > "u") && !(document.getElementById(Hn) && document.getElementById(Un))) {
|
|
5049
5063
|
if (!document.getElementById(Hn)) {
|
|
5050
5064
|
const t = document.createElement("style");
|
|
5051
|
-
t.id = Hn, t.textContent =
|
|
5065
|
+
t.id = Hn, t.textContent = Fi, document.head.appendChild(t);
|
|
5052
5066
|
}
|
|
5053
5067
|
if (!document.getElementById(Un)) {
|
|
5054
5068
|
const t = document.createElement("style");
|
|
5055
|
-
t.id = Un, t.textContent =
|
|
5069
|
+
t.id = Un, t.textContent = Wi, document.head.appendChild(t);
|
|
5056
5070
|
}
|
|
5057
5071
|
}
|
|
5058
|
-
},
|
|
5072
|
+
}, Ui = `
|
|
5059
5073
|
/* AdMesh UI SDK - Complete Self-Contained Styles */
|
|
5060
5074
|
|
|
5061
5075
|
/* CSS Reset for AdMesh components */
|
|
@@ -5725,13 +5739,13 @@ const Un = "admesh-ui-sdk-styles", Hn = "admesh-ui-sdk-reset", zi = `
|
|
|
5725
5739
|
}
|
|
5726
5740
|
`;
|
|
5727
5741
|
let Pr = !1;
|
|
5728
|
-
const
|
|
5742
|
+
const Hi = () => {
|
|
5729
5743
|
te(() => {
|
|
5730
5744
|
if (!Pr) {
|
|
5731
5745
|
try {
|
|
5732
|
-
|
|
5746
|
+
Bi();
|
|
5733
5747
|
const t = document.createElement("style");
|
|
5734
|
-
t.id = "admesh-ui-sdk-styles-legacy", t.textContent =
|
|
5748
|
+
t.id = "admesh-ui-sdk-styles-legacy", t.textContent = Ui, document.getElementById("admesh-ui-sdk-styles-legacy") || document.head.appendChild(t), Pr = !0;
|
|
5735
5749
|
} catch {
|
|
5736
5750
|
s.error("[AdMesh] Failed to inject styles");
|
|
5737
5751
|
}
|
|
@@ -5739,17 +5753,17 @@ const Fi = () => {
|
|
|
5739
5753
|
};
|
|
5740
5754
|
}
|
|
5741
5755
|
}, []);
|
|
5742
|
-
},
|
|
5756
|
+
}, ji = () => {
|
|
5743
5757
|
};
|
|
5744
|
-
function
|
|
5758
|
+
function qi(t) {
|
|
5745
5759
|
const e = Math.max(1, Math.round(t));
|
|
5746
5760
|
if (e < 60)
|
|
5747
5761
|
return `${e}s`;
|
|
5748
5762
|
const r = Math.floor(e / 60), o = e % 60;
|
|
5749
5763
|
return o > 0 ? `${r}m ${o}s` : `${r}m`;
|
|
5750
5764
|
}
|
|
5751
|
-
function
|
|
5752
|
-
return
|
|
5765
|
+
function Oi(t) {
|
|
5766
|
+
return qi(t / 1e3);
|
|
5753
5767
|
}
|
|
5754
5768
|
const jn = ({ content: t, theme: e, fontSize: r }) => {
|
|
5755
5769
|
const o = (p) => p.split(/(\*\*[^*]+\*\*|\[[^\]]+\]\(https?:\/\/[^)\s]+\))/g).map((m, h) => {
|
|
@@ -5982,14 +5996,14 @@ function zr(t) {
|
|
|
5982
5996
|
function tn(t) {
|
|
5983
5997
|
return t.replace(/\s+/g, " ").trim();
|
|
5984
5998
|
}
|
|
5985
|
-
function
|
|
5999
|
+
function Vi(t, e) {
|
|
5986
6000
|
const r = t.filter((c) => !(c != null && c.is_sponsored)).slice(0, 3), o = e.filter((c) => !(c != null && c.is_sponsored)).slice(0, 3), a = e.find((c) => c == null ? void 0 : c.is_sponsored);
|
|
5987
6001
|
if (!a)
|
|
5988
6002
|
return o.length ? o : r;
|
|
5989
6003
|
const l = o.length ? o : r;
|
|
5990
6004
|
return [a, ...l].slice(0, 4);
|
|
5991
6005
|
}
|
|
5992
|
-
function
|
|
6006
|
+
function Ki(t, e, r, o) {
|
|
5993
6007
|
const a = /* @__PURE__ */ new Set(), l = [], c = (C, p = "information") => {
|
|
5994
6008
|
const v = tn(C);
|
|
5995
6009
|
if (!v) return;
|
|
@@ -6021,7 +6035,7 @@ function ji(t, e, r, o) {
|
|
|
6021
6035
|
l.length >= 3 || c(C, p === 0 ? "comparison" : "information");
|
|
6022
6036
|
}), l.slice(0, 3);
|
|
6023
6037
|
}
|
|
6024
|
-
function
|
|
6038
|
+
function Gi() {
|
|
6025
6039
|
if (typeof window > "u") return "unknown";
|
|
6026
6040
|
const t = window.innerWidth;
|
|
6027
6041
|
return t < 768 ? "mobile" : t < 1024 ? "tablet" : "desktop";
|
|
@@ -6111,10 +6125,10 @@ function Lr(t) {
|
|
|
6111
6125
|
article_slug: o[o.length - 1],
|
|
6112
6126
|
page_title: document.title || void 0,
|
|
6113
6127
|
referrer: document.referrer || void 0,
|
|
6114
|
-
device_type:
|
|
6128
|
+
device_type: Gi()
|
|
6115
6129
|
};
|
|
6116
6130
|
}
|
|
6117
|
-
function
|
|
6131
|
+
function Yi(t) {
|
|
6118
6132
|
var o, a;
|
|
6119
6133
|
const e = (a = (o = t == null ? void 0 : t.recommendation) == null ? void 0 : o.creative) == null ? void 0 : a.follow_up_suggestion, r = t == null ? void 0 : t.recommendation_id;
|
|
6120
6134
|
return !e || !r ? null : {
|
|
@@ -6135,7 +6149,7 @@ function qn(t) {
|
|
|
6135
6149
|
return o === a ? 0 : o ? -1 : 1;
|
|
6136
6150
|
});
|
|
6137
6151
|
}
|
|
6138
|
-
const
|
|
6152
|
+
const Qi = {
|
|
6139
6153
|
mode: "light",
|
|
6140
6154
|
primaryColor: "#3b82f6",
|
|
6141
6155
|
secondaryColor: "#64748b",
|
|
@@ -6155,17 +6169,17 @@ const Vi = {
|
|
|
6155
6169
|
medium: "0 4px 6px -1px rgb(0 0 0 / 0.1)",
|
|
6156
6170
|
large: "0 10px 15px -3px rgb(0 0 0 / 0.1)"
|
|
6157
6171
|
}
|
|
6158
|
-
},
|
|
6172
|
+
}, Xi = {
|
|
6159
6173
|
sm: { width: "320px", height: "400px" },
|
|
6160
6174
|
md: { width: "400px", height: "500px" },
|
|
6161
6175
|
lg: { width: "480px", height: "600px" },
|
|
6162
6176
|
xl: { width: "560px", height: "700px" }
|
|
6163
|
-
},
|
|
6177
|
+
}, Ji = {
|
|
6164
6178
|
"bottom-right": { bottom: "20px", right: "20px" },
|
|
6165
6179
|
"bottom-left": { bottom: "20px", left: "20px" },
|
|
6166
6180
|
"top-right": { top: "20px", right: "20px" },
|
|
6167
6181
|
"top-left": { top: "20px", left: "20px" }
|
|
6168
|
-
},
|
|
6182
|
+
}, da = ({
|
|
6169
6183
|
theme: t,
|
|
6170
6184
|
className: e,
|
|
6171
6185
|
style: r,
|
|
@@ -6209,7 +6223,7 @@ const Vi = {
|
|
|
6209
6223
|
// New prop to only show modal when sponsored suggestions are available
|
|
6210
6224
|
variant: ee = "default",
|
|
6211
6225
|
queryHandler: Ce,
|
|
6212
|
-
suggestionsLoader:
|
|
6226
|
+
suggestionsLoader: lt,
|
|
6213
6227
|
disclaimerText: Te,
|
|
6214
6228
|
poweredByLabel: Se = "Powered by AdMesh",
|
|
6215
6229
|
subtitle: ye = "Publisher Assistant",
|
|
@@ -6227,12 +6241,12 @@ const Vi = {
|
|
|
6227
6241
|
stopDelegationSession: ve,
|
|
6228
6242
|
refreshDelegationActivity: ge
|
|
6229
6243
|
} = Or();
|
|
6230
|
-
|
|
6244
|
+
Hi(), console.log("[AdMeshIntentAssistant] Context:", {
|
|
6231
6245
|
sdk: ce,
|
|
6232
6246
|
sessionId: Me,
|
|
6233
6247
|
hasContextTheme: !!Oe
|
|
6234
6248
|
});
|
|
6235
|
-
const E = t || Oe ||
|
|
6249
|
+
const E = t || Oe || Qi, De = (E == null ? void 0 : E.mode) || "light", Z = d === "ad-slot", Be = (n = !1) => Z && !(n && u === "expand"), [Ne, Re] = ae(w || L), ze = N !== void 0, Ue = ze ? N : Ne, [Xe, tt] = ae(""), [At, Wt] = ae(!1), [He, Ve] = ae([]), [be, ht] = ae(!1), [Pt, zt] = ae(null), [q, ft] = ae(!1), [Ct, Bt] = ae(/* @__PURE__ */ new Set()), [Q, we] = ae(V || Y || []), [gt, dt] = ae(0), [Ut, Ht] = ae(0), [$t, nn] = ae({}), Kt = F(null), Mt = F(!1), H = F(null), je = F(/* @__PURE__ */ new Map()), ue = F([]), Et = F(null), ct = F(null), wt = F(null), It = F(!1), Gt = F(!1), jt = F(null), bt = F(null), rn = F(null), [dn, Xr] = ae(!1), [Mn, Jr] = ae(!1), Tt = F(null), nt = F(null), Zr = !!(B != null && B.toLowerCase().startsWith("pub_")), rt = P() && (re == null ? void 0 : re.session_id) === Me ? re : null, En = F(/* @__PURE__ */ new Set()), Jn = F(/* @__PURE__ */ new Set()), Zn = F(!1), on = Z && u === "expand" && (q || be), [yn, eo] = ae(!1);
|
|
6236
6250
|
te(() => {
|
|
6237
6251
|
if (typeof window > "u") return;
|
|
6238
6252
|
const n = window.matchMedia("(max-width: 767px)"), g = () => eo(n.matches);
|
|
@@ -6244,7 +6258,7 @@ const Vi = {
|
|
|
6244
6258
|
document.body.style.overflow = n;
|
|
6245
6259
|
};
|
|
6246
6260
|
}, [on]);
|
|
6247
|
-
const In = Z && u === "sticky" && (q || He.length > 0 || be), Nt = bn(m) ?? "100%", an = bn(h) ?? "100%", to = zr(m), er = zr(h), tr = Z && (er ?? Number.POSITIVE_INFINITY) <= 60,
|
|
6261
|
+
const In = Z && u === "sticky" && (q || He.length > 0 || be), Nt = bn(m) ?? "100%", an = bn(h) ?? "100%", to = zr(m), er = zr(h), tr = Z && (er ?? Number.POSITIVE_INFINITY) <= 60, ot = Z && (to ?? Number.POSITIVE_INFINITY) <= 360 && (er ?? Number.POSITIVE_INFINITY) <= 120, cn = le((n) => (g) => {
|
|
6248
6262
|
g ? je.current.set(n, g) : je.current.delete(n);
|
|
6249
6263
|
}, []), $e = le(
|
|
6250
6264
|
async (n, g = {}) => {
|
|
@@ -6288,7 +6302,7 @@ const Vi = {
|
|
|
6288
6302
|
type: he.type || "information",
|
|
6289
6303
|
is_sponsored: !1
|
|
6290
6304
|
} : null;
|
|
6291
|
-
}).filter((he) => !!he).slice(0, 3) :
|
|
6305
|
+
}).filter((he) => !!he).slice(0, 3) : Ki(n, g, b, _), Pe = Yi(T), Ye = Pe ? [Pe, ...pe.slice(0, 2)] : pe.slice(0, 3);
|
|
6292
6306
|
Ye.length && we(qn(Ye));
|
|
6293
6307
|
},
|
|
6294
6308
|
[]
|
|
@@ -6324,7 +6338,7 @@ const Vi = {
|
|
|
6324
6338
|
},
|
|
6325
6339
|
[]
|
|
6326
6340
|
), nr = le(() => {
|
|
6327
|
-
const n = Et.current, g =
|
|
6341
|
+
const n = Et.current, g = ct.current;
|
|
6328
6342
|
if (!n || !g) return !1;
|
|
6329
6343
|
const b = n.getBoundingClientRect(), _ = g.getBoundingClientRect(), T = Math.max(
|
|
6330
6344
|
0,
|
|
@@ -6338,7 +6352,7 @@ const Vi = {
|
|
|
6338
6352
|
nr() && (It.current = !1);
|
|
6339
6353
|
return;
|
|
6340
6354
|
}
|
|
6341
|
-
Gt.current || (n =
|
|
6355
|
+
Gt.current || (n = bt.current) == null || n.scrollIntoView({ behavior: "smooth" });
|
|
6342
6356
|
}, [He, nr]), Vn(() => {
|
|
6343
6357
|
if (!Z || on) return;
|
|
6344
6358
|
const n = jt.current;
|
|
@@ -6355,19 +6369,19 @@ const Vi = {
|
|
|
6355
6369
|
return;
|
|
6356
6370
|
}
|
|
6357
6371
|
Y && Y.length && we(
|
|
6358
|
-
(n) =>
|
|
6372
|
+
(n) => Vi(n, Y)
|
|
6359
6373
|
);
|
|
6360
6374
|
}, [V, Y]), te(() => {
|
|
6361
|
-
if (ee !== "default" || !
|
|
6375
|
+
if (ee !== "default" || !lt) return;
|
|
6362
6376
|
let n = !1;
|
|
6363
|
-
return
|
|
6377
|
+
return lt().then((g) => {
|
|
6364
6378
|
!n && Array.isArray(g) && g.length && we(g);
|
|
6365
6379
|
}).catch((g) => {
|
|
6366
6380
|
console.warn("[AdMeshIntentAssistant] Failed to load suggestions", g);
|
|
6367
6381
|
}), () => {
|
|
6368
6382
|
n = !0;
|
|
6369
6383
|
};
|
|
6370
|
-
}, [
|
|
6384
|
+
}, [lt, ee]), te(() => {
|
|
6371
6385
|
if (!be) {
|
|
6372
6386
|
Ht(0), Kt.current = null;
|
|
6373
6387
|
return;
|
|
@@ -6385,11 +6399,11 @@ const Vi = {
|
|
|
6385
6399
|
return () => window.clearInterval(g);
|
|
6386
6400
|
}, [be]), te(() => {
|
|
6387
6401
|
if (!be || ee !== "default") {
|
|
6388
|
-
|
|
6402
|
+
dt(0);
|
|
6389
6403
|
return;
|
|
6390
6404
|
}
|
|
6391
6405
|
const n = window.setInterval(() => {
|
|
6392
|
-
|
|
6406
|
+
dt((g) => Math.min(g + 1, 7));
|
|
6393
6407
|
}, 3e3);
|
|
6394
6408
|
return () => window.clearInterval(n);
|
|
6395
6409
|
}, [be, ee]), te(() => {
|
|
@@ -6417,7 +6431,7 @@ const Vi = {
|
|
|
6417
6431
|
}, [qt]), no = le(() => {
|
|
6418
6432
|
qt(!1);
|
|
6419
6433
|
}, [qt]), ro = le(() => {
|
|
6420
|
-
|
|
6434
|
+
ft((n) => !n);
|
|
6421
6435
|
}, []), or = le(async (n, g, b, _, T, j, pe) => {
|
|
6422
6436
|
var Pe, Ye, he;
|
|
6423
6437
|
if (!ce)
|
|
@@ -6470,15 +6484,15 @@ const Vi = {
|
|
|
6470
6484
|
const Fe = (he = Ie.body) == null ? void 0 : he.getReader(), Lt = new TextDecoder();
|
|
6471
6485
|
if (!Fe)
|
|
6472
6486
|
throw new Error("Response body is not readable");
|
|
6473
|
-
let Ze = "",
|
|
6487
|
+
let Ze = "", it, Ft, _t, ne, se;
|
|
6474
6488
|
return await (async () => {
|
|
6475
6489
|
try {
|
|
6476
6490
|
for (; ; ) {
|
|
6477
|
-
const { done: fe, value:
|
|
6491
|
+
const { done: fe, value: vt } = await Fe.read();
|
|
6478
6492
|
if (fe) break;
|
|
6479
|
-
const
|
|
6493
|
+
const mt = Lt.decode(vt, { stream: !0 }).split(`
|
|
6480
6494
|
`);
|
|
6481
|
-
for (const Zt of
|
|
6495
|
+
for (const Zt of mt)
|
|
6482
6496
|
if (Zt.startsWith("data: ")) {
|
|
6483
6497
|
const Ln = Zt.slice(6);
|
|
6484
6498
|
if (Ln.trim() === "[DONE]")
|
|
@@ -6489,9 +6503,9 @@ const Vi = {
|
|
|
6489
6503
|
console.warn("[AdMeshIntentAssistant] Failed to report delegation turn_completed", We);
|
|
6490
6504
|
}), {
|
|
6491
6505
|
text: Ze,
|
|
6492
|
-
source_links:
|
|
6506
|
+
source_links: it,
|
|
6493
6507
|
related_items: Ft,
|
|
6494
|
-
followup_suggestions:
|
|
6508
|
+
followup_suggestions: _t,
|
|
6495
6509
|
used_capability: ne,
|
|
6496
6510
|
response_time_ms: se
|
|
6497
6511
|
};
|
|
@@ -6504,11 +6518,11 @@ const Vi = {
|
|
|
6504
6518
|
break;
|
|
6505
6519
|
}
|
|
6506
6520
|
case "final": {
|
|
6507
|
-
Ze = We.reply || Ze,
|
|
6521
|
+
Ze = We.reply || Ze, it = Array.isArray(We.source_links) ? We.source_links : void 0, Ft = Array.isArray(We.related_items) ? We.related_items : void 0, _t = Array.isArray(We.followup_suggestions) ? We.followup_suggestions : void 0, ne = typeof We.used_capability == "string" ? We.used_capability : ne, se = typeof We.response_time_ms == "number" ? We.response_time_ms : se;
|
|
6508
6522
|
break;
|
|
6509
6523
|
}
|
|
6510
6524
|
case "followup_suggestions": {
|
|
6511
|
-
|
|
6525
|
+
_t = Array.isArray(We.followup_suggestions) ? We.followup_suggestions : _t;
|
|
6512
6526
|
break;
|
|
6513
6527
|
}
|
|
6514
6528
|
case "error":
|
|
@@ -6527,9 +6541,9 @@ const Vi = {
|
|
|
6527
6541
|
if (j != null && j.aborted)
|
|
6528
6542
|
return {
|
|
6529
6543
|
text: Ze,
|
|
6530
|
-
source_links:
|
|
6544
|
+
source_links: it,
|
|
6531
6545
|
related_items: Ft,
|
|
6532
|
-
followup_suggestions:
|
|
6546
|
+
followup_suggestions: _t,
|
|
6533
6547
|
used_capability: ne,
|
|
6534
6548
|
response_time_ms: se,
|
|
6535
6549
|
error: "aborted"
|
|
@@ -6540,9 +6554,9 @@ const Vi = {
|
|
|
6540
6554
|
}
|
|
6541
6555
|
return {
|
|
6542
6556
|
text: Ze,
|
|
6543
|
-
source_links:
|
|
6557
|
+
source_links: it,
|
|
6544
6558
|
related_items: Ft,
|
|
6545
|
-
followup_suggestions:
|
|
6559
|
+
followup_suggestions: _t,
|
|
6546
6560
|
used_capability: ne,
|
|
6547
6561
|
response_time_ms: se
|
|
6548
6562
|
};
|
|
@@ -6559,19 +6573,19 @@ const Vi = {
|
|
|
6559
6573
|
}, [ce, Me, B, J, rt, ge]), Rn = le(() => {
|
|
6560
6574
|
const n = Tt.current;
|
|
6561
6575
|
if (!n || n.signal.aborted) return;
|
|
6562
|
-
n.abort(),
|
|
6576
|
+
n.abort(), ht(!1), H.current = null, Mt.current = !1;
|
|
6563
6577
|
const g = nt.current;
|
|
6564
6578
|
g && Ve((b) => b.map(
|
|
6565
6579
|
(_) => _.id === g && !_.content.trim() ? { ..._, content: "Generation stopped." } : _
|
|
6566
6580
|
));
|
|
6567
6581
|
}, []), Yt = le(async (n) => {
|
|
6568
|
-
var he, Ie, Fe, Lt, Ze,
|
|
6582
|
+
var he, Ie, Fe, Lt, Ze, it, Ft, _t;
|
|
6569
6583
|
if (!n.trim() || be) return;
|
|
6570
6584
|
const g = typeof performance < "u" ? performance.now() : Date.now(), b = n.trim(), _ = Date.now().toString(), T = new AbortController(), j = H.current, pe = (j == null ? void 0 : j.recommendation) || null, Pe = He.filter((ne) => (ne.role === "user" || ne.role === "assistant") && ne.content.trim()).slice(-6).map((ne) => ({
|
|
6571
6585
|
role: ne.role,
|
|
6572
6586
|
content: ne.content.trim().slice(0, 1200)
|
|
6573
6587
|
}));
|
|
6574
|
-
Tt.current = T, nt.current = null,
|
|
6588
|
+
Tt.current = T, nt.current = null, wt.current = _, It.current = !0, Gt.current = !0, H.current = null, we(
|
|
6575
6589
|
(ne) => ne.some((se) => se.is_sponsored) ? ne.filter((se) => !se.is_sponsored) : ne
|
|
6576
6590
|
), zt(null);
|
|
6577
6591
|
const Ye = {
|
|
@@ -6583,7 +6597,7 @@ const Vi = {
|
|
|
6583
6597
|
if ($e("query_submitted", {
|
|
6584
6598
|
message_id: _,
|
|
6585
6599
|
query: b
|
|
6586
|
-
}), Ve((ne) => [...ne, Ye]), tt(""),
|
|
6600
|
+
}), Ve((ne) => [...ne, Ye]), tt(""), ht(!0), ee === "default" && Ce) {
|
|
6587
6601
|
try {
|
|
6588
6602
|
const ne = (Date.now() + 1).toString(), se = {
|
|
6589
6603
|
id: ne,
|
|
@@ -6594,7 +6608,7 @@ const Vi = {
|
|
|
6594
6608
|
userQuery: n,
|
|
6595
6609
|
initialRecommendation: null
|
|
6596
6610
|
};
|
|
6597
|
-
Mt.current && (Bt((
|
|
6611
|
+
Mt.current && (Bt((vt) => /* @__PURE__ */ new Set([...vt, ne])), Mt.current = !1), Ve((vt) => [...vt, se]), nt.current = ne;
|
|
6598
6612
|
const Qe = await Ce(b, {
|
|
6599
6613
|
sponsoredSuggestion: j
|
|
6600
6614
|
});
|
|
@@ -6608,15 +6622,15 @@ const Vi = {
|
|
|
6608
6622
|
hasResponseRecommendation: !!Qe.recommendation,
|
|
6609
6623
|
hasSponsoredSuggestionRecommendation: !!pe,
|
|
6610
6624
|
finalRecommendationId: fe == null ? void 0 : fe.recommendation_id
|
|
6611
|
-
}), Ve((
|
|
6612
|
-
(
|
|
6613
|
-
...
|
|
6625
|
+
}), Ve((vt) => vt.map(
|
|
6626
|
+
(at) => at.id === ne ? {
|
|
6627
|
+
...at,
|
|
6614
6628
|
content: Qe.answer,
|
|
6615
6629
|
sourceLinks: Qe.source_links,
|
|
6616
6630
|
relatedItems: Qe.related_items,
|
|
6617
6631
|
initialRecommendation: fe,
|
|
6618
6632
|
responseTimeMs: (typeof performance < "u" ? performance.now() : Date.now()) - g
|
|
6619
|
-
} :
|
|
6633
|
+
} : at
|
|
6620
6634
|
)), Tn(
|
|
6621
6635
|
b,
|
|
6622
6636
|
Qe.answer,
|
|
@@ -6656,7 +6670,7 @@ const Vi = {
|
|
|
6656
6670
|
}
|
|
6657
6671
|
}), H.current = null;
|
|
6658
6672
|
} finally {
|
|
6659
|
-
Tt.current === T && (Tt.current = null, nt.current = null,
|
|
6673
|
+
Tt.current === T && (Tt.current = null, nt.current = null, ht(!1));
|
|
6660
6674
|
}
|
|
6661
6675
|
return;
|
|
6662
6676
|
}
|
|
@@ -6674,7 +6688,7 @@ const Vi = {
|
|
|
6674
6688
|
recommendations: [],
|
|
6675
6689
|
userQuery: n
|
|
6676
6690
|
};
|
|
6677
|
-
Ve((se) => [...se, ne]), Tt.current === T && (Tt.current = null, nt.current = null,
|
|
6691
|
+
Ve((se) => [...se, ne]), Tt.current === T && (Tt.current = null, nt.current = null, ht(!1));
|
|
6678
6692
|
}, 1e3);
|
|
6679
6693
|
return;
|
|
6680
6694
|
}
|
|
@@ -6688,26 +6702,26 @@ const Vi = {
|
|
|
6688
6702
|
userQuery: n,
|
|
6689
6703
|
initialRecommendation: se
|
|
6690
6704
|
};
|
|
6691
|
-
Mt.current && (Bt((
|
|
6705
|
+
Mt.current && (Bt((at) => /* @__PURE__ */ new Set([...at, ne])), Mt.current = !1), Ve((at) => [...at, Qe]), nt.current = ne;
|
|
6692
6706
|
const fe = await or(
|
|
6693
6707
|
b,
|
|
6694
6708
|
_,
|
|
6695
6709
|
// Callback for real-time content updates
|
|
6696
|
-
(
|
|
6697
|
-
Ve((
|
|
6698
|
-
(Zt) => Zt.id === ne ? { ...Zt, content: Zt.content +
|
|
6710
|
+
(at) => {
|
|
6711
|
+
Ve((mt) => mt.map(
|
|
6712
|
+
(Zt) => Zt.id === ne ? { ...Zt, content: Zt.content + at } : Zt
|
|
6699
6713
|
));
|
|
6700
6714
|
},
|
|
6701
6715
|
() => {
|
|
6702
|
-
|
|
6716
|
+
ht(!0), dt(0);
|
|
6703
6717
|
},
|
|
6704
6718
|
se,
|
|
6705
6719
|
T.signal,
|
|
6706
6720
|
Pe
|
|
6707
6721
|
);
|
|
6708
6722
|
if (T.signal.aborted) {
|
|
6709
|
-
fe.text.trim() || Ve((
|
|
6710
|
-
(
|
|
6723
|
+
fe.text.trim() || Ve((at) => at.map(
|
|
6724
|
+
(mt) => mt.id === ne && !mt.content.trim() ? { ...mt, content: "Generation stopped." } : mt
|
|
6711
6725
|
)), $e("answer_failed", {
|
|
6712
6726
|
message_id: ne,
|
|
6713
6727
|
query: b,
|
|
@@ -6722,16 +6736,16 @@ const Vi = {
|
|
|
6722
6736
|
}), H.current = null;
|
|
6723
6737
|
return;
|
|
6724
6738
|
}
|
|
6725
|
-
const
|
|
6726
|
-
Ve((
|
|
6727
|
-
(
|
|
6728
|
-
...
|
|
6739
|
+
const vt = typeof fe.response_time_ms == "number" ? fe.response_time_ms : (typeof performance < "u" ? performance.now() : Date.now()) - g;
|
|
6740
|
+
Ve((at) => at.map(
|
|
6741
|
+
(mt) => mt.id === ne ? {
|
|
6742
|
+
...mt,
|
|
6729
6743
|
content: fe.text,
|
|
6730
6744
|
sourceLinks: fe.source_links,
|
|
6731
6745
|
relatedItems: fe.related_items,
|
|
6732
|
-
initialRecommendation:
|
|
6733
|
-
responseTimeMs:
|
|
6734
|
-
} :
|
|
6746
|
+
initialRecommendation: mt.initialRecommendation || se,
|
|
6747
|
+
responseTimeMs: vt
|
|
6748
|
+
} : mt
|
|
6735
6749
|
)), Tn(
|
|
6736
6750
|
b,
|
|
6737
6751
|
fe.text,
|
|
@@ -6743,7 +6757,7 @@ const Vi = {
|
|
|
6743
6757
|
message_id: ne,
|
|
6744
6758
|
query: b,
|
|
6745
6759
|
recommendation_id: se == null ? void 0 : se.recommendation_id,
|
|
6746
|
-
brand_name: (
|
|
6760
|
+
brand_name: (it = (Ze = se == null ? void 0 : se.recommendation) == null ? void 0 : Ze.creative) == null ? void 0 : it.brand_name,
|
|
6747
6761
|
latency_ms: (typeof performance < "u" ? performance.now() : Date.now()) - g,
|
|
6748
6762
|
status: fe.error,
|
|
6749
6763
|
metadata: {
|
|
@@ -6754,14 +6768,14 @@ const Vi = {
|
|
|
6754
6768
|
message_id: ne,
|
|
6755
6769
|
query: b,
|
|
6756
6770
|
recommendation_id: se == null ? void 0 : se.recommendation_id,
|
|
6757
|
-
brand_name: (
|
|
6771
|
+
brand_name: (_t = (Ft = se == null ? void 0 : se.recommendation) == null ? void 0 : Ft.creative) == null ? void 0 : _t.brand_name,
|
|
6758
6772
|
used_capability: fe.used_capability,
|
|
6759
|
-
latency_ms:
|
|
6773
|
+
latency_ms: vt,
|
|
6760
6774
|
status: "completed",
|
|
6761
6775
|
metadata: {
|
|
6762
6776
|
variant: ee,
|
|
6763
6777
|
source: "api_chat_assistant",
|
|
6764
|
-
response_time_ms:
|
|
6778
|
+
response_time_ms: vt
|
|
6765
6779
|
}
|
|
6766
6780
|
}), H.current = null;
|
|
6767
6781
|
} catch (ne) {
|
|
@@ -6784,7 +6798,7 @@ const Vi = {
|
|
|
6784
6798
|
}
|
|
6785
6799
|
}), H.current = null;
|
|
6786
6800
|
} finally {
|
|
6787
|
-
Tt.current === T && (Tt.current = null, nt.current = null,
|
|
6801
|
+
Tt.current === T && (Tt.current = null, nt.current = null, ht(!1));
|
|
6788
6802
|
}
|
|
6789
6803
|
}, [be, or, Ce, Tn, ce, $e, ee]), Ot = Q, wn = Sn(
|
|
6790
6804
|
() => Ot.some((n) => n == null ? void 0 : n.is_sponsored),
|
|
@@ -6837,7 +6851,7 @@ const Vi = {
|
|
|
6837
6851
|
console.error("[AdMeshIntentAssistant] Error firing sponsored suggestion engagement:", Ie);
|
|
6838
6852
|
}
|
|
6839
6853
|
}, 0) : console.log("[AdMeshIntentAssistant] โน๏ธ Not a sponsored suggestion or missing data, skipping engagement tracking");
|
|
6840
|
-
}, [Yt, Ke, ce, Me, $e]), vn =
|
|
6854
|
+
}, [Yt, Ke, ce, Me, $e]), vn = Ji[G], ir = Xi[I];
|
|
6841
6855
|
te(() => {
|
|
6842
6856
|
if (ue.current.forEach((n) => n()), ue.current = [], !(typeof window > "u" || typeof IntersectionObserver > "u"))
|
|
6843
6857
|
return Ke.forEach((n, g) => {
|
|
@@ -6865,15 +6879,15 @@ const Vi = {
|
|
|
6865
6879
|
recommendation_id: (Ye = n.recommendation) == null ? void 0 : Ye.recommendation_id,
|
|
6866
6880
|
brand_name: (Fe = (Ie = (he = n.recommendation) == null ? void 0 : he.recommendation) == null ? void 0 : Ie.creative) == null ? void 0 : Fe.brand_name
|
|
6867
6881
|
}), ce && Me && n.is_sponsored && n.recommendation) {
|
|
6868
|
-
const Ze = (Lt = n.recommendation.tracking) == null ? void 0 : Lt.followup_exposure_url,
|
|
6869
|
-
Ze &&
|
|
6882
|
+
const Ze = (Lt = n.recommendation.tracking) == null ? void 0 : Lt.followup_exposure_url, it = n.recommendation.recommendation_id;
|
|
6883
|
+
Ze && it ? (console.log("[AdMeshIntentAssistant] ๐ฏ Firing viewable sponsored suggestion exposure:", {
|
|
6870
6884
|
exposureUrl: Ze,
|
|
6871
|
-
recommendationId:
|
|
6885
|
+
recommendationId: it,
|
|
6872
6886
|
suggestionText: n.text,
|
|
6873
6887
|
sessionId: Me
|
|
6874
|
-
}), ce.fireFollowupExposure(Ze,
|
|
6888
|
+
}), ce.fireFollowupExposure(Ze, it, Me)) : console.warn("[AdMeshIntentAssistant] โ ๏ธ Missing exposure URL or recommendation ID for sponsored suggestion:", {
|
|
6875
6889
|
hasExposureUrl: !!Ze,
|
|
6876
|
-
hasRecommendationId: !!
|
|
6890
|
+
hasRecommendationId: !!it,
|
|
6877
6891
|
suggestionText: n.text
|
|
6878
6892
|
});
|
|
6879
6893
|
}
|
|
@@ -6944,7 +6958,7 @@ const Vi = {
|
|
|
6944
6958
|
"Preparing the clearest answer...",
|
|
6945
6959
|
"Finishing the response..."
|
|
6946
6960
|
], hn = (n) => {
|
|
6947
|
-
const g = (n == null ? void 0 : n.accentColor) || Rt, b = (n == null ? void 0 : n.metaColor) || cr, _ = (n == null ? void 0 : n.includeSteps) ?? ee === "default", T = `${Ut}s`, j = _ ? `${oo[
|
|
6961
|
+
const g = (n == null ? void 0 : n.accentColor) || Rt, b = (n == null ? void 0 : n.metaColor) || cr, _ = (n == null ? void 0 : n.includeSteps) ?? ee === "default", T = `${Ut}s`, j = _ ? `${oo[gt]} (${T})` : `Generating answer... ${T}`;
|
|
6948
6962
|
return /* @__PURE__ */ M(
|
|
6949
6963
|
"div",
|
|
6950
6964
|
{
|
|
@@ -7005,7 +7019,7 @@ const Vi = {
|
|
|
7005
7019
|
gap: "12px",
|
|
7006
7020
|
marginTop: "10px",
|
|
7007
7021
|
paddingTop: "10px",
|
|
7008
|
-
borderTop: `1px solid ${
|
|
7022
|
+
borderTop: `1px solid ${yt}`,
|
|
7009
7023
|
flexWrap: "wrap"
|
|
7010
7024
|
},
|
|
7011
7025
|
children: [
|
|
@@ -7051,13 +7065,17 @@ const Vi = {
|
|
|
7051
7065
|
justifyContent: "center",
|
|
7052
7066
|
width: 28,
|
|
7053
7067
|
height: 28,
|
|
7068
|
+
padding: 0,
|
|
7069
|
+
margin: 0,
|
|
7070
|
+
minWidth: 0,
|
|
7071
|
+
flexShrink: 0,
|
|
7054
7072
|
borderRadius: "6px",
|
|
7055
|
-
border: `1px solid ${
|
|
7056
|
-
background:
|
|
7073
|
+
border: `1px solid ${yt}`,
|
|
7074
|
+
background: xt,
|
|
7057
7075
|
color: _,
|
|
7058
7076
|
cursor: "pointer"
|
|
7059
7077
|
},
|
|
7060
|
-
children: /* @__PURE__ */ i(kr, { size: 14 })
|
|
7078
|
+
children: /* @__PURE__ */ i(kr, { size: 14, style: { flexShrink: 0 } })
|
|
7061
7079
|
}
|
|
7062
7080
|
),
|
|
7063
7081
|
/* @__PURE__ */ i(
|
|
@@ -7072,13 +7090,17 @@ const Vi = {
|
|
|
7072
7090
|
justifyContent: "center",
|
|
7073
7091
|
width: 28,
|
|
7074
7092
|
height: 28,
|
|
7093
|
+
padding: 0,
|
|
7094
|
+
margin: 0,
|
|
7095
|
+
minWidth: 0,
|
|
7096
|
+
flexShrink: 0,
|
|
7075
7097
|
borderRadius: "6px",
|
|
7076
|
-
border: `1px solid ${
|
|
7077
|
-
background:
|
|
7098
|
+
border: `1px solid ${yt}`,
|
|
7099
|
+
background: xt,
|
|
7078
7100
|
color: _,
|
|
7079
7101
|
cursor: "pointer"
|
|
7080
7102
|
},
|
|
7081
|
-
children: /* @__PURE__ */ i(vr, { size: 14 })
|
|
7103
|
+
children: /* @__PURE__ */ i(vr, { size: 14, style: { flexShrink: 0 } })
|
|
7082
7104
|
}
|
|
7083
7105
|
)
|
|
7084
7106
|
] })
|
|
@@ -7097,7 +7119,7 @@ const Vi = {
|
|
|
7097
7119
|
},
|
|
7098
7120
|
children: [
|
|
7099
7121
|
"Answer Completed in ",
|
|
7100
|
-
|
|
7122
|
+
Oi(n.responseTimeMs)
|
|
7101
7123
|
]
|
|
7102
7124
|
}
|
|
7103
7125
|
) : null
|
|
@@ -7124,11 +7146,11 @@ const Vi = {
|
|
|
7124
7146
|
if (_.length !== 6) return n;
|
|
7125
7147
|
const T = parseInt(_.slice(0, 2), 16), j = parseInt(_.slice(2, 4), 16), pe = parseInt(_.slice(4, 6), 16);
|
|
7126
7148
|
return `rgba(${T}, ${j}, ${pe}, ${g})`;
|
|
7127
|
-
}, Je = E.primaryColor || "#3F037F",
|
|
7149
|
+
}, Je = E.primaryColor || "#3F037F", xt = E.surfaceColor || "#ffffff", io = E.backgroundColor || "#eef2ff", yt = E.borderColor || "#e5e7eb", Ge = E.textColor || "#111827", Xt = E.textSecondaryColor || "#6b7280";
|
|
7128
7150
|
Le(Je, 0.12);
|
|
7129
7151
|
const dr = Le(Je, 0.24);
|
|
7130
7152
|
Le(Je, 0.38);
|
|
7131
|
-
const ao =
|
|
7153
|
+
const ao = xt, Rt = Je, kn = E.primaryTextColor || "#ffffff", cr = Xt, mr = ye || "Publisher Assistant", sn = ie && Ke.length === 0 && He.length === 0, Pn = xt, zn = xt, Jt = yt, ur = yt, pr = "0 16px 64px rgba(15, 23, 42, 0.14)", $n = Xt, so = Xt, lo = Rt, hr = io, co = "none", mo = "rgba(15, 23, 42, 0.18)";
|
|
7132
7154
|
function fr(n) {
|
|
7133
7155
|
return rt ? /* @__PURE__ */ M(
|
|
7134
7156
|
"div",
|
|
@@ -7330,7 +7352,7 @@ const Vi = {
|
|
|
7330
7352
|
"data-admesh-sponsored": _.is_sponsored ? "true" : void 0,
|
|
7331
7353
|
ref: cn(_.id),
|
|
7332
7354
|
onClick: () => {
|
|
7333
|
-
ee === "default" && (
|
|
7355
|
+
ee === "default" && (ft(!0), y === "floating" && qt(!0)), pn(_);
|
|
7334
7356
|
},
|
|
7335
7357
|
type: "button",
|
|
7336
7358
|
style: {
|
|
@@ -7341,8 +7363,8 @@ const Vi = {
|
|
|
7341
7363
|
width: "100%",
|
|
7342
7364
|
minWidth: 0,
|
|
7343
7365
|
borderRadius: "8px",
|
|
7344
|
-
border: `1px solid ${_.is_sponsored ? Je :
|
|
7345
|
-
background: _.is_sponsored ? Je :
|
|
7366
|
+
border: `1px solid ${_.is_sponsored ? Je : yt}`,
|
|
7367
|
+
background: _.is_sponsored ? Je : xt,
|
|
7346
7368
|
color: _.is_sponsored ? kn : Ge,
|
|
7347
7369
|
padding: n ? "8px 10px" : "10px 14px",
|
|
7348
7370
|
fontSize: n ? "12px" : "13px",
|
|
@@ -7373,7 +7395,7 @@ const Vi = {
|
|
|
7373
7395
|
_.id
|
|
7374
7396
|
))
|
|
7375
7397
|
}
|
|
7376
|
-
) : /* @__PURE__ */ M("div", { style: { display: "flex", alignItems: "center", gap: g ? "4px" :
|
|
7398
|
+
) : /* @__PURE__ */ M("div", { style: { display: "flex", alignItems: "center", gap: g ? "4px" : ot ? "5px" : n ? "6px" : "10px", flexShrink: 0 }, children: [
|
|
7377
7399
|
!g && /* @__PURE__ */ i(
|
|
7378
7400
|
"button",
|
|
7379
7401
|
{
|
|
@@ -7382,18 +7404,25 @@ const Vi = {
|
|
|
7382
7404
|
disabled: !dn,
|
|
7383
7405
|
"aria-label": "Scroll suggestions left",
|
|
7384
7406
|
style: {
|
|
7385
|
-
|
|
7386
|
-
|
|
7407
|
+
display: "inline-flex",
|
|
7408
|
+
alignItems: "center",
|
|
7409
|
+
justifyContent: "center",
|
|
7410
|
+
flexShrink: 0,
|
|
7411
|
+
padding: 0,
|
|
7412
|
+
margin: 0,
|
|
7413
|
+
minWidth: 0,
|
|
7414
|
+
width: ot ? 20 : n ? 24 : 28,
|
|
7415
|
+
height: ot ? 20 : n ? 24 : 28,
|
|
7387
7416
|
borderRadius: "6px",
|
|
7388
|
-
border: `1px solid ${
|
|
7389
|
-
background:
|
|
7417
|
+
border: `1px solid ${yt}`,
|
|
7418
|
+
background: xt,
|
|
7390
7419
|
color: "#6b7280",
|
|
7391
|
-
fontSize:
|
|
7420
|
+
fontSize: ot ? "13px" : void 0,
|
|
7392
7421
|
lineHeight: 1,
|
|
7393
7422
|
cursor: dn ? "pointer" : "default",
|
|
7394
7423
|
opacity: dn ? 1 : 0.55
|
|
7395
7424
|
},
|
|
7396
|
-
children: "
|
|
7425
|
+
children: /* @__PURE__ */ i(Ro, { size: ot ? 13 : n ? 14 : 16, style: { flexShrink: 0 }, "aria-hidden": "true" })
|
|
7397
7426
|
}
|
|
7398
7427
|
),
|
|
7399
7428
|
/* @__PURE__ */ i(
|
|
@@ -7403,7 +7432,7 @@ const Vi = {
|
|
|
7403
7432
|
onScroll: fn,
|
|
7404
7433
|
style: {
|
|
7405
7434
|
display: "flex",
|
|
7406
|
-
gap: g ? "4px" :
|
|
7435
|
+
gap: g ? "4px" : ot ? "5px" : n ? "6px" : "10px",
|
|
7407
7436
|
overflowX: "auto",
|
|
7408
7437
|
scrollbarWidth: "none",
|
|
7409
7438
|
msOverflowStyle: "none",
|
|
@@ -7416,22 +7445,22 @@ const Vi = {
|
|
|
7416
7445
|
"data-admesh-sponsored": _.is_sponsored ? "true" : void 0,
|
|
7417
7446
|
ref: cn(_.id),
|
|
7418
7447
|
onClick: () => {
|
|
7419
|
-
ee === "default" && (
|
|
7448
|
+
ee === "default" && (ft(!0), y === "floating" && qt(!0)), pn(_);
|
|
7420
7449
|
},
|
|
7421
7450
|
type: "button",
|
|
7422
7451
|
style: {
|
|
7423
7452
|
display: "inline-flex",
|
|
7424
7453
|
alignItems: "center",
|
|
7425
|
-
gap: g ? "4px" :
|
|
7454
|
+
gap: g ? "4px" : ot ? "5px" : "8px",
|
|
7426
7455
|
whiteSpace: "nowrap",
|
|
7427
7456
|
borderRadius: "6px",
|
|
7428
|
-
border: `1px solid ${_.is_sponsored ? Je :
|
|
7429
|
-
background: _.is_sponsored ? Je :
|
|
7457
|
+
border: `1px solid ${_.is_sponsored ? Je : yt}`,
|
|
7458
|
+
background: _.is_sponsored ? Je : xt,
|
|
7430
7459
|
color: _.is_sponsored ? kn : Ge,
|
|
7431
|
-
padding: g ? "4px 8px" :
|
|
7432
|
-
fontSize: g ? "10px" :
|
|
7460
|
+
padding: g ? "4px 8px" : ot ? "5px 8px" : n ? "7px 10px" : "8px 14px",
|
|
7461
|
+
fontSize: g ? "10px" : ot ? "11px" : n ? "12px" : "13px",
|
|
7433
7462
|
fontWeight: 500,
|
|
7434
|
-
lineHeight: g ? 1 :
|
|
7463
|
+
lineHeight: g ? 1 : ot ? 1.1 : void 0,
|
|
7435
7464
|
boxShadow: "none",
|
|
7436
7465
|
cursor: "pointer"
|
|
7437
7466
|
},
|
|
@@ -7452,18 +7481,25 @@ const Vi = {
|
|
|
7452
7481
|
disabled: !Mn,
|
|
7453
7482
|
"aria-label": "Scroll suggestions right",
|
|
7454
7483
|
style: {
|
|
7455
|
-
|
|
7456
|
-
|
|
7484
|
+
display: "inline-flex",
|
|
7485
|
+
alignItems: "center",
|
|
7486
|
+
justifyContent: "center",
|
|
7487
|
+
flexShrink: 0,
|
|
7488
|
+
padding: 0,
|
|
7489
|
+
margin: 0,
|
|
7490
|
+
minWidth: 0,
|
|
7491
|
+
width: ot ? 20 : n ? 24 : 28,
|
|
7492
|
+
height: ot ? 20 : n ? 24 : 28,
|
|
7457
7493
|
borderRadius: "6px",
|
|
7458
|
-
border: `1px solid ${
|
|
7459
|
-
background:
|
|
7494
|
+
border: `1px solid ${yt}`,
|
|
7495
|
+
background: xt,
|
|
7460
7496
|
color: "#6b7280",
|
|
7461
|
-
fontSize:
|
|
7497
|
+
fontSize: ot ? "13px" : void 0,
|
|
7462
7498
|
lineHeight: 1,
|
|
7463
7499
|
cursor: Mn ? "pointer" : "default",
|
|
7464
7500
|
opacity: Mn ? 1 : 0.55
|
|
7465
7501
|
},
|
|
7466
|
-
children: "
|
|
7502
|
+
children: /* @__PURE__ */ i(Po, { size: ot ? 13 : n ? 14 : 16, style: { flexShrink: 0 }, "aria-hidden": "true" })
|
|
7467
7503
|
}
|
|
7468
7504
|
)
|
|
7469
7505
|
] });
|
|
@@ -7567,8 +7603,8 @@ const Vi = {
|
|
|
7567
7603
|
borderRadius: "8px",
|
|
7568
7604
|
textDecoration: "none",
|
|
7569
7605
|
color: Ge,
|
|
7570
|
-
border: `1px solid ${
|
|
7571
|
-
background:
|
|
7606
|
+
border: `1px solid ${yt}`,
|
|
7607
|
+
background: xt,
|
|
7572
7608
|
boxShadow: "none",
|
|
7573
7609
|
flex: g ? "0 0 min(220px, calc(100% - 8px))" : "0 0 min(250px, calc(100% - 16px))",
|
|
7574
7610
|
minWidth: 0,
|
|
@@ -7629,15 +7665,15 @@ const Vi = {
|
|
|
7629
7665
|
},
|
|
7630
7666
|
children: [
|
|
7631
7667
|
He.map((b) => {
|
|
7632
|
-
const _ = b.role === "user" && b.id ===
|
|
7668
|
+
const _ = b.role === "user" && b.id === wt.current;
|
|
7633
7669
|
return /* @__PURE__ */ i(
|
|
7634
7670
|
"div",
|
|
7635
7671
|
{
|
|
7636
|
-
ref: _ ?
|
|
7672
|
+
ref: _ ? ct : void 0,
|
|
7637
7673
|
style: { marginBottom: n ? "16px" : "28px", textAlign: b.role === "user" ? "right" : "left" },
|
|
7638
7674
|
children: (() => {
|
|
7639
7675
|
const j = !!b.content.trim() || !be;
|
|
7640
|
-
return /* @__PURE__ */ i(
|
|
7676
|
+
return /* @__PURE__ */ i(ut, { children: /* @__PURE__ */ M(
|
|
7641
7677
|
"div",
|
|
7642
7678
|
{
|
|
7643
7679
|
style: {
|
|
@@ -7696,8 +7732,8 @@ const Vi = {
|
|
|
7696
7732
|
b.id
|
|
7697
7733
|
);
|
|
7698
7734
|
}),
|
|
7699
|
-
Pt && /* @__PURE__ */ i("div", { role: "alert", style: { color: Ge, fontSize: Ae.sm, border: `1px solid ${
|
|
7700
|
-
/* @__PURE__ */ i("div", { ref:
|
|
7735
|
+
Pt && /* @__PURE__ */ i("div", { role: "alert", style: { color: Ge, fontSize: Ae.sm, border: `1px solid ${yt}`, borderLeft: "3px solid #b45309", borderRadius: "6px", padding: "12px" }, children: "Unable to complete the answer. Please try again." }),
|
|
7736
|
+
/* @__PURE__ */ i("div", { ref: bt })
|
|
7701
7737
|
]
|
|
7702
7738
|
}
|
|
7703
7739
|
);
|
|
@@ -7706,14 +7742,14 @@ const Vi = {
|
|
|
7706
7742
|
let n = function(_) {
|
|
7707
7743
|
const T = $r(yn);
|
|
7708
7744
|
return Qn(
|
|
7709
|
-
/* @__PURE__ */ M(
|
|
7745
|
+
/* @__PURE__ */ M(ut, { children: [
|
|
7710
7746
|
/* @__PURE__ */ i("div", { style: b }),
|
|
7711
7747
|
/* @__PURE__ */ i("div", { style: T.shell, children: _ })
|
|
7712
7748
|
] }),
|
|
7713
7749
|
document.body
|
|
7714
7750
|
);
|
|
7715
7751
|
}, g = function(_ = !1) {
|
|
7716
|
-
const T = Be(_), j = _ || T && q, pe = !j && O === "input", Pe = T && !j && tr, Ye = j && !(Z && u === "expand" && !_ && on), he = j ? $r(yn) : null, Ie = !!(he && yn && !T), Fe = T ? Nt : he ? he.panelWidth : y === "inline" ? "100%" : "min(420px, calc(100vw - 32px))", Lt = T ? an : he ? he.panelHeight : "auto", Ze = T ? Nt : (he == null ? void 0 : he.panelMaxWidth) ?? "100%",
|
|
7752
|
+
const T = Be(_), j = _ || T && q, pe = !j && O === "input", Pe = T && !j && tr, Ye = j && !(Z && u === "expand" && !_ && on), he = j ? $r(yn) : null, Ie = !!(he && yn && !T), Fe = T ? Nt : he ? he.panelWidth : y === "inline" ? "100%" : "min(420px, calc(100vw - 32px))", Lt = T ? an : he ? he.panelHeight : "auto", Ze = T ? Nt : (he == null ? void 0 : he.panelMaxWidth) ?? "100%", it = T ? an : he == null ? void 0 : he.panelMaxHeight, Ft = c && !Pe && j;
|
|
7717
7753
|
return /* @__PURE__ */ M(
|
|
7718
7754
|
"div",
|
|
7719
7755
|
{
|
|
@@ -7725,7 +7761,7 @@ const Vi = {
|
|
|
7725
7761
|
width: Fe,
|
|
7726
7762
|
maxWidth: Ze,
|
|
7727
7763
|
height: Lt,
|
|
7728
|
-
maxHeight:
|
|
7764
|
+
maxHeight: it,
|
|
7729
7765
|
boxSizing: "border-box",
|
|
7730
7766
|
display: "flex",
|
|
7731
7767
|
flexDirection: "column",
|
|
@@ -7771,7 +7807,7 @@ const Vi = {
|
|
|
7771
7807
|
color: Rt,
|
|
7772
7808
|
overflow: "hidden"
|
|
7773
7809
|
},
|
|
7774
|
-
children: l ? /* @__PURE__ */ i("img", { src: l, alt: `${a || "Assistant"} logo`, style: { width: "100%", height: "100%", objectFit: "contain", background:
|
|
7810
|
+
children: l ? /* @__PURE__ */ i("img", { src: l, alt: `${a || "Assistant"} logo`, style: { width: "100%", height: "100%", objectFit: "contain", background: xt, padding: 4 } }) : /* @__PURE__ */ i(Kn, { size: T ? 14 : 17, strokeWidth: 1.5, "aria-hidden": "true" })
|
|
7775
7811
|
}
|
|
7776
7812
|
),
|
|
7777
7813
|
(x || f) && /* @__PURE__ */ M("div", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
|
|
@@ -7783,21 +7819,25 @@ const Vi = {
|
|
|
7783
7819
|
"button",
|
|
7784
7820
|
{
|
|
7785
7821
|
type: "button",
|
|
7786
|
-
onClick: () =>
|
|
7822
|
+
onClick: () => ft(!1),
|
|
7787
7823
|
"aria-label": "Minimize assistant",
|
|
7788
7824
|
style: {
|
|
7789
7825
|
width: 36,
|
|
7790
7826
|
height: 36,
|
|
7827
|
+
padding: 0,
|
|
7828
|
+
margin: 0,
|
|
7829
|
+
minWidth: 0,
|
|
7830
|
+
flexShrink: 0,
|
|
7791
7831
|
borderRadius: "8px",
|
|
7792
7832
|
border: `1px solid ${Jt}`,
|
|
7793
|
-
background:
|
|
7833
|
+
background: xt,
|
|
7794
7834
|
color: $n,
|
|
7795
7835
|
cursor: "pointer",
|
|
7796
7836
|
display: "flex",
|
|
7797
7837
|
alignItems: "center",
|
|
7798
7838
|
justifyContent: "center"
|
|
7799
7839
|
},
|
|
7800
|
-
children: /* @__PURE__ */ i(wr, { size: 16, strokeWidth: 1.5, "aria-hidden": "true" })
|
|
7840
|
+
children: /* @__PURE__ */ i(wr, { size: 16, strokeWidth: 1.5, style: { flexShrink: 0 }, "aria-hidden": "true" })
|
|
7801
7841
|
}
|
|
7802
7842
|
)
|
|
7803
7843
|
]
|
|
@@ -7821,18 +7861,18 @@ const Vi = {
|
|
|
7821
7861
|
children: [
|
|
7822
7862
|
fr("default"),
|
|
7823
7863
|
Ye && go(T),
|
|
7824
|
-
!pe && /* @__PURE__ */ M(
|
|
7864
|
+
!pe && /* @__PURE__ */ M(ut, { children: [
|
|
7825
7865
|
T && !j && !Pe && /* @__PURE__ */ i("div", { "aria-hidden": "true", style: { flex: "1 1 auto", minHeight: 0 } }),
|
|
7826
7866
|
T && !j && z && C && He.length === 0 && /* @__PURE__ */ i("div", { style: { fontSize: 15, fontWeight: 600, textAlign: "center" }, children: $ }),
|
|
7827
7867
|
uo(T)
|
|
7828
7868
|
] }),
|
|
7829
7869
|
(pe || !T || j || p) && /* @__PURE__ */ i(
|
|
7830
|
-
|
|
7870
|
+
Li,
|
|
7831
7871
|
{
|
|
7832
7872
|
value: Xe,
|
|
7833
7873
|
onChange: tt,
|
|
7834
7874
|
open: pe && At && !q,
|
|
7835
|
-
onOpenChange: pe ? Wt :
|
|
7875
|
+
onOpenChange: pe ? Wt : ji,
|
|
7836
7876
|
suggestions: Ke.slice(0, X),
|
|
7837
7877
|
registerSuggestion: cn,
|
|
7838
7878
|
loading: be,
|
|
@@ -7844,13 +7884,13 @@ const Vi = {
|
|
|
7844
7884
|
logoUrl: l,
|
|
7845
7885
|
title: a,
|
|
7846
7886
|
placeholder: A,
|
|
7847
|
-
colors: { accent: Rt, accentText: kn, surface: hr, text: Ge, muted: Xt, border:
|
|
7887
|
+
colors: { accent: Rt, accentText: kn, surface: hr, text: Ge, muted: Xt, border: yt },
|
|
7848
7888
|
onStop: Rn,
|
|
7849
7889
|
onSend: () => {
|
|
7850
|
-
H.current = null, Mt.current = !1,
|
|
7890
|
+
H.current = null, Mt.current = !1, ft(!0), y === "floating" && qt(!0), Yt(Xe);
|
|
7851
7891
|
},
|
|
7852
|
-
onSuggestion: (
|
|
7853
|
-
|
|
7892
|
+
onSuggestion: (_t) => {
|
|
7893
|
+
ft(!0), y === "floating" && qt(!0), pn(_t);
|
|
7854
7894
|
}
|
|
7855
7895
|
}
|
|
7856
7896
|
),
|
|
@@ -7993,11 +8033,11 @@ const Vi = {
|
|
|
7993
8033
|
style: { color: E.textColor, overscrollBehavior: "contain", WebkitOverflowScrolling: "touch" },
|
|
7994
8034
|
children: [
|
|
7995
8035
|
He.map((n) => {
|
|
7996
|
-
const g = n.role === "user" && n.id ===
|
|
8036
|
+
const g = n.role === "user" && n.id === wt.current;
|
|
7997
8037
|
return /* @__PURE__ */ i(
|
|
7998
8038
|
"div",
|
|
7999
8039
|
{
|
|
8000
|
-
ref: g ?
|
|
8040
|
+
ref: g ? ct : void 0,
|
|
8001
8041
|
className: n.role === "user" ? "text-right" : "text-left",
|
|
8002
8042
|
children: /* @__PURE__ */ i(
|
|
8003
8043
|
"div",
|
|
@@ -8008,7 +8048,7 @@ const Vi = {
|
|
|
8008
8048
|
color: n.role === "user" ? E.primaryTextColor || "#ffffff" : E.textColor,
|
|
8009
8049
|
fontSize: Ae.sm
|
|
8010
8050
|
},
|
|
8011
|
-
children: n.role === "assistant" ? n.content.trim() ? /* @__PURE__ */ M(
|
|
8051
|
+
children: n.role === "assistant" ? n.content.trim() ? /* @__PURE__ */ M(ut, { children: [
|
|
8012
8052
|
/* @__PURE__ */ i(jn, { content: n.content, theme: E, fontSize: Ae.sm }),
|
|
8013
8053
|
Dn(n, {
|
|
8014
8054
|
accentColor: E.primaryColor,
|
|
@@ -8035,7 +8075,7 @@ const Vi = {
|
|
|
8035
8075
|
includeSteps: !1
|
|
8036
8076
|
}) }),
|
|
8037
8077
|
Pt && /* @__PURE__ */ i("div", { className: "text-sm", style: { color: E.textSecondaryColor }, children: "Connection issue. Please try again." }),
|
|
8038
|
-
/* @__PURE__ */ i("div", { ref:
|
|
8078
|
+
/* @__PURE__ */ i("div", { ref: bt })
|
|
8039
8079
|
]
|
|
8040
8080
|
}
|
|
8041
8081
|
),
|
|
@@ -8198,7 +8238,7 @@ const Vi = {
|
|
|
8198
8238
|
alignItems: "center",
|
|
8199
8239
|
justifyContent: "center"
|
|
8200
8240
|
},
|
|
8201
|
-
children: q ? /* @__PURE__ */ i(wr, { size: 16, style: { color: E.textSecondaryColor } }) : /* @__PURE__ */ i(
|
|
8241
|
+
children: q ? /* @__PURE__ */ i(wr, { size: 16, style: { color: E.textSecondaryColor } }) : /* @__PURE__ */ i(Lo, { size: 16, style: { color: E.textSecondaryColor } })
|
|
8202
8242
|
}
|
|
8203
8243
|
),
|
|
8204
8244
|
/* @__PURE__ */ i(
|
|
@@ -8246,11 +8286,11 @@ const Vi = {
|
|
|
8246
8286
|
}
|
|
8247
8287
|
) }),
|
|
8248
8288
|
He.map((n) => {
|
|
8249
|
-
const g = n.role === "user" && n.id ===
|
|
8289
|
+
const g = n.role === "user" && n.id === wt.current;
|
|
8250
8290
|
return /* @__PURE__ */ M(
|
|
8251
8291
|
"div",
|
|
8252
8292
|
{
|
|
8253
|
-
ref: g ?
|
|
8293
|
+
ref: g ? ct : void 0,
|
|
8254
8294
|
className: "mb-3",
|
|
8255
8295
|
children: [
|
|
8256
8296
|
/* @__PURE__ */ i(
|
|
@@ -8265,7 +8305,7 @@ const Vi = {
|
|
|
8265
8305
|
padding: n.role === "user" ? q ? "12px 14px" : void 0 : "2px 6px 2px 2px",
|
|
8266
8306
|
boxShadow: "none"
|
|
8267
8307
|
},
|
|
8268
|
-
children: n.role === "assistant" ? n.content.trim() ? /* @__PURE__ */ M(
|
|
8308
|
+
children: n.role === "assistant" ? n.content.trim() ? /* @__PURE__ */ M(ut, { children: [
|
|
8269
8309
|
/* @__PURE__ */ i("div", { style: { fontSize: `calc(${Ae.sm} * 1.3)`, lineHeight: 1.65 }, children: /* @__PURE__ */ i(
|
|
8270
8310
|
jn,
|
|
8271
8311
|
{
|
|
@@ -8353,7 +8393,7 @@ const Vi = {
|
|
|
8353
8393
|
] })
|
|
8354
8394
|
}
|
|
8355
8395
|
) }),
|
|
8356
|
-
/* @__PURE__ */ i("div", { ref:
|
|
8396
|
+
/* @__PURE__ */ i("div", { ref: bt })
|
|
8357
8397
|
]
|
|
8358
8398
|
}
|
|
8359
8399
|
),
|
|
@@ -8491,7 +8531,7 @@ const Vi = {
|
|
|
8491
8531
|
}
|
|
8492
8532
|
) });
|
|
8493
8533
|
}, Gn = "admesh:streamingStart", Yn = "admesh:streamingComplete";
|
|
8494
|
-
function
|
|
8534
|
+
function ca(t, e) {
|
|
8495
8535
|
const r = {
|
|
8496
8536
|
messageId: t,
|
|
8497
8537
|
sessionId: e,
|
|
@@ -8502,7 +8542,7 @@ function aa(t, e) {
|
|
|
8502
8542
|
sessionId: e
|
|
8503
8543
|
});
|
|
8504
8544
|
}
|
|
8505
|
-
function
|
|
8545
|
+
function ma(t, e, r) {
|
|
8506
8546
|
const o = {
|
|
8507
8547
|
messageId: t,
|
|
8508
8548
|
sessionId: e,
|
|
@@ -8515,7 +8555,7 @@ function sa(t, e, r) {
|
|
|
8515
8555
|
metadata: r
|
|
8516
8556
|
});
|
|
8517
8557
|
}
|
|
8518
|
-
function
|
|
8558
|
+
function ua(t, e, r) {
|
|
8519
8559
|
const o = (a) => {
|
|
8520
8560
|
const l = a;
|
|
8521
8561
|
l.detail.messageId === t && l.detail.sessionId === e && (s.log("[StreamingEvents] ๐จ Received streamingStart event"), r(l.detail));
|
|
@@ -8524,7 +8564,7 @@ function la(t, e, r) {
|
|
|
8524
8564
|
window.removeEventListener(Gn, o);
|
|
8525
8565
|
};
|
|
8526
8566
|
}
|
|
8527
|
-
function
|
|
8567
|
+
function Zi(t, e, r) {
|
|
8528
8568
|
s.log("[StreamingEvents] ๐ Setting up streamingComplete listener", {
|
|
8529
8569
|
expectedMessageId: t,
|
|
8530
8570
|
expectedSessionId: e
|
|
@@ -8593,7 +8633,7 @@ const Xn = () => {
|
|
|
8593
8633
|
Array.from(e.keys()).forEach(r);
|
|
8594
8634
|
}
|
|
8595
8635
|
};
|
|
8596
|
-
},
|
|
8636
|
+
}, ea = ({
|
|
8597
8637
|
containerId: t,
|
|
8598
8638
|
messageId: e,
|
|
8599
8639
|
sessionId: r,
|
|
@@ -8661,7 +8701,7 @@ const Xn = () => {
|
|
|
8661
8701
|
recommendationsCount: l.length
|
|
8662
8702
|
});
|
|
8663
8703
|
let U = null, L = !1;
|
|
8664
|
-
const z =
|
|
8704
|
+
const z = Zi(e, r, ($) => {
|
|
8665
8705
|
s.log("[FinalLinkDetectionCheck] ๐ฏ Received streamingComplete event", {
|
|
8666
8706
|
messageId: $.messageId,
|
|
8667
8707
|
sessionId: $.sessionId,
|
|
@@ -8677,8 +8717,8 @@ const Xn = () => {
|
|
|
8677
8717
|
}, 5e3), () => {
|
|
8678
8718
|
s.log("[FinalLinkDetectionCheck] ๐งน Cleaning up listener"), U && clearTimeout(U), z();
|
|
8679
8719
|
};
|
|
8680
|
-
}, [e, r]), u ? /* @__PURE__ */ i(
|
|
8681
|
-
},
|
|
8720
|
+
}, [e, r]), u ? /* @__PURE__ */ i(ut, {}) : y ? C ? (s.log("[FinalLinkDetectionCheck] ๐ซ Links found - NOT rendering fallback"), /* @__PURE__ */ i(ut, {})) : (s.log("[FinalLinkDetectionCheck] โ
No links found - rendering fallback"), /* @__PURE__ */ i(ut, { children: f })) : /* @__PURE__ */ i(ut, {});
|
|
8721
|
+
}, pa = ({
|
|
8682
8722
|
messageId: t,
|
|
8683
8723
|
children: e,
|
|
8684
8724
|
fallbackFormat: r = "tail",
|
|
@@ -8774,7 +8814,7 @@ const Xn = () => {
|
|
|
8774
8814
|
const z = (W = (A = N[0]) == null ? void 0 : A.recommendation) == null ? void 0 : W.format, $ = z === "weave";
|
|
8775
8815
|
return te(() => {
|
|
8776
8816
|
x && $ && s.log(`[WeaveAdFormatContainer] ๐ฏ Format is "weave" (preferred: ${z}) - skipping fallback recommendations`);
|
|
8777
|
-
}, [x, $, z]), /* @__PURE__ */ M(
|
|
8817
|
+
}, [x, $, z]), /* @__PURE__ */ M(ut, { children: [
|
|
8778
8818
|
/* @__PURE__ */ i(
|
|
8779
8819
|
"div",
|
|
8780
8820
|
{
|
|
@@ -8787,7 +8827,7 @@ const Xn = () => {
|
|
|
8787
8827
|
}
|
|
8788
8828
|
),
|
|
8789
8829
|
x && !$ && /* @__PURE__ */ i(
|
|
8790
|
-
|
|
8830
|
+
ea,
|
|
8791
8831
|
{
|
|
8792
8832
|
containerId: R,
|
|
8793
8833
|
messageId: t,
|
|
@@ -8802,7 +8842,7 @@ const Xn = () => {
|
|
|
8802
8842
|
s.log("[WeaveAdFormatContainer] โ ๏ธ No links found - rendering fallback"), s.log(`[WeaveAdFormatContainer] ๐ Passing ${N.length} recommendation(s) to fallback component`), d == null || d(t, !1, "No links detected in final check"), a == null || a(), f == null || f(!0);
|
|
8803
8843
|
},
|
|
8804
8844
|
children: /* @__PURE__ */ i(
|
|
8805
|
-
|
|
8845
|
+
Ai,
|
|
8806
8846
|
{
|
|
8807
8847
|
format: r,
|
|
8808
8848
|
messageId: t,
|
|
@@ -8815,7 +8855,7 @@ const Xn = () => {
|
|
|
8815
8855
|
}
|
|
8816
8856
|
)
|
|
8817
8857
|
] });
|
|
8818
|
-
},
|
|
8858
|
+
}, ha = (t) => {
|
|
8819
8859
|
const { sdk: e, sessionId: r } = xn(), o = F(!1), a = F(0), l = F(!1), c = F(!1), x = F(null), f = F(Xn());
|
|
8820
8860
|
te(() => () => {
|
|
8821
8861
|
f.current.cleanup();
|
|
@@ -8910,41 +8950,41 @@ const Xn = () => {
|
|
|
8910
8950
|
shouldRenderFallback: !l.current && c.current,
|
|
8911
8951
|
processWeaveFormat: v
|
|
8912
8952
|
};
|
|
8913
|
-
},
|
|
8953
|
+
}, fa = "1.0.31";
|
|
8914
8954
|
export {
|
|
8915
|
-
|
|
8955
|
+
Ni as AdMeshBadge,
|
|
8916
8956
|
jr as AdMeshCompactCard,
|
|
8917
8957
|
qr as AdMeshContext,
|
|
8918
|
-
|
|
8919
|
-
|
|
8920
|
-
|
|
8921
|
-
|
|
8922
|
-
|
|
8958
|
+
Si as AdMeshFollowup,
|
|
8959
|
+
da as AdMeshIntentAssistant,
|
|
8960
|
+
ai as AdMeshLayout,
|
|
8961
|
+
Ii as AdMeshLinkTracker,
|
|
8962
|
+
wi as AdMeshProvider,
|
|
8923
8963
|
gn as AdMeshRecommendations,
|
|
8924
|
-
|
|
8964
|
+
_i as AdMeshRenderer,
|
|
8925
8965
|
An as AdMeshSDK,
|
|
8926
|
-
|
|
8927
|
-
|
|
8966
|
+
la as AdMeshTailAd,
|
|
8967
|
+
si as AdMeshTracker,
|
|
8928
8968
|
Cn as AdMeshViewabilityTracker,
|
|
8929
8969
|
Yn as STREAMING_COMPLETE_EVENT,
|
|
8930
8970
|
Gn as STREAMING_START_EVENT,
|
|
8931
|
-
|
|
8932
|
-
|
|
8933
|
-
|
|
8934
|
-
|
|
8971
|
+
fa as VERSION,
|
|
8972
|
+
pa as WeaveAdFormatContainer,
|
|
8973
|
+
aa as WeaveAdFormatProvider,
|
|
8974
|
+
Ai as WeaveFallbackRecommendations,
|
|
8935
8975
|
Kr as WeaveResponseProcessor,
|
|
8936
|
-
|
|
8976
|
+
pi as callAnalyzeIntentEndpoint,
|
|
8937
8977
|
Xn as createInlineExposureTracker,
|
|
8938
|
-
|
|
8939
|
-
|
|
8940
|
-
|
|
8941
|
-
|
|
8942
|
-
|
|
8978
|
+
ma as dispatchStreamingCompleteEvent,
|
|
8979
|
+
ca as dispatchStreamingStartEvent,
|
|
8980
|
+
di as extractHeadingsDirectly,
|
|
8981
|
+
Zi as onStreamingComplete,
|
|
8982
|
+
ua as onStreamingStart,
|
|
8943
8983
|
xn as useAdMesh,
|
|
8944
8984
|
Or as useAdMeshContext,
|
|
8945
|
-
|
|
8946
|
-
|
|
8947
|
-
|
|
8948
|
-
|
|
8985
|
+
Hi as useAdMeshStyles,
|
|
8986
|
+
ri as useViewabilityTracker,
|
|
8987
|
+
ha as useWeaveAdFormat,
|
|
8988
|
+
sa as useWeaveAdFormatContext
|
|
8949
8989
|
};
|
|
8950
8990
|
//# sourceMappingURL=index.mjs.map
|