@pluno/product-agent-web 0.1.113 → 0.1.115

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.
@@ -1,5 +1,5 @@
1
- import { PlunoProductAgent as Ci, getProductAgentOriginAccessErrorMessage as Ei } from "./product-agent-sdk.js";
2
- const ki = "#7c3aed", kt = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", Lt = "#2c2a1e", Gn = [253, 250, 241], $n = 3.5;
1
+ import { PlunoProductAgent as Si, getProductAgentOriginAccessErrorMessage as Ci } from "./product-agent-sdk.js";
2
+ const Ei = "#7c3aed", kt = "M547 151 C516 151 493 169 485 199 L382 606 C373 641 396 666 431 666 L523 666 C552 666 568 684 563 713 L491 1028 C486 1054 510 1067 527 1044 L894 487 C915 455 894 432 856 432 L815 432 C784 432 773 411 789 382 L904 205 C922 171 901 145 859 145 Z", Lt = "#2c2a1e", Gn = [253, 250, 241], $n = 3.5;
3
3
  function Lo(e) {
4
4
  const t = To(e);
5
5
  if (qn(pt(t), Gn) >= $n)
@@ -7,11 +7,11 @@ function Lo(e) {
7
7
  let i = pt(t);
8
8
  const o = pt(Lt);
9
9
  for (let r = 0; r < 6; r += 1)
10
- if (i = Ai(i, o, 0.22), qn(i, Gn) >= $n)
10
+ if (i = Ti(i, o, 0.22), qn(i, Gn) >= $n)
11
11
  return dn(i);
12
12
  return dn(i);
13
13
  }
14
- function Li() {
14
+ function ki() {
15
15
  let n = "M 280 120", i = !1, o = 0;
16
16
  for (let r = 150; r <= 1170; r += 62) {
17
17
  const l = (o % 3 - 1) * 18, p = i ? 280 - l : 1020 + l;
@@ -19,7 +19,7 @@ function Li() {
19
19
  }
20
20
  return n;
21
21
  }
22
- function Ti(e) {
22
+ function Li(e) {
23
23
  const t = To(e), n = cn(pt(t));
24
24
  return n > 0.86 ? {
25
25
  top: "#ffffff",
@@ -58,7 +58,7 @@ function Ti(e) {
58
58
  }
59
59
  function To(e) {
60
60
  const t = e.trim();
61
- return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : ki;
61
+ return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : Ei;
62
62
  }
63
63
  function pt(e) {
64
64
  return [
@@ -82,7 +82,7 @@ function qn(e, t) {
82
82
  const n = cn(e), i = cn(t), [o, r] = n > i ? [n, i] : [i, n];
83
83
  return (o + 0.05) / (r + 0.05);
84
84
  }
85
- function Ai(e, t, n) {
85
+ function Ti(e, t, n) {
86
86
  const i = un(n);
87
87
  return [
88
88
  e[0] + (t[0] - e[0]) * i,
@@ -91,17 +91,17 @@ function Ai(e, t, n) {
91
91
  ];
92
92
  }
93
93
  function se(e, t, n) {
94
- const [i, o, r] = Ii(pt(e));
95
- return dn(Pi(i, un(o + n), un(r + t)));
94
+ const [i, o, r] = Ai(pt(e));
95
+ return dn(Ii(i, un(o + n), un(r + t)));
96
96
  }
97
- function Ii([e, t, n]) {
97
+ function Ai([e, t, n]) {
98
98
  const i = e / 255, o = t / 255, r = n / 255, l = Math.max(i, o, r), p = Math.min(i, o, r), s = (l + p) / 2;
99
99
  if (l === p)
100
100
  return [0, 0, s];
101
101
  const c = l - p, g = s > 0.5 ? c / (2 - l - p) : c / (l + p);
102
102
  return [(l === i ? (o - r) / c + (o < r ? 6 : 0) : l === o ? (r - i) / c + 2 : (i - o) / c + 4) / 6, g, s];
103
103
  }
104
- function Pi(e, t, n) {
104
+ function Ii(e, t, n) {
105
105
  if (t === 0)
106
106
  return [n * 255, n * 255, n * 255];
107
107
  const i = n < 0.5 ? n * (1 + t) : n + t - n * t, o = 2 * n - i;
@@ -119,7 +119,7 @@ function un(e) {
119
119
  return Math.max(0, Math.min(1, e));
120
120
  }
121
121
  const Ao = "suggest_share_on_socials";
122
- function Ni(e) {
122
+ function Pi(e) {
123
123
  for (let t = e.length - 1; t >= 0; t -= 1) {
124
124
  const n = e[t];
125
125
  if (n.role !== "tool" || n.toolName !== Ao)
@@ -136,7 +136,7 @@ function Ni(e) {
136
136
  }
137
137
  return null;
138
138
  }
139
- function Ri(e) {
139
+ function Ni(e) {
140
140
  let t = 2166136261;
141
141
  for (const n of e)
142
142
  t ^= n.charCodeAt(0), t = Math.imul(t, 16777619);
@@ -150,15 +150,15 @@ function jn(e, t, n) {
150
150
  }
151
151
  return null;
152
152
  }
153
- const Mi = "https://app.pluno.ai", zi = "/api/product-agent/embed/active-users", Di = 1800, Oi = 15e3, Ui = 250, Bi = 1e3, Fi = 3e4;
154
- function Wi(e, t = {}) {
153
+ const Ri = "https://app.pluno.ai", Mi = "/api/product-agent/embed/active-users", zi = 1800, Di = 15e3, Oi = 250, Ui = 1e3, Bi = 3e4;
154
+ function Fi(e, t = {}) {
155
155
  let n = !1, i = null, o = null, r = null;
156
156
  const l = () => {
157
157
  r !== null && (window.clearInterval(r), r = null);
158
158
  }, p = (g) => {
159
159
  n || (o !== null && window.clearTimeout(o), o = window.setTimeout(() => {
160
160
  c();
161
- }, $i(g)));
161
+ }, Gi(g)));
162
162
  }, s = (g) => {
163
163
  if (l(), i === null) {
164
164
  i = g, e(g);
@@ -170,27 +170,27 @@ function Wi(e, t = {}) {
170
170
  l();
171
171
  return;
172
172
  }
173
- const y = Math.min(1, (performance.now() - m) / Di);
174
- i = Math.round(h + (g - h) * qi(y)), e(i), y >= 1 && (i = g, e(g), l());
175
- }, Ui);
173
+ const v = Math.min(1, (performance.now() - m) / zi);
174
+ i = Math.round(h + (g - h) * $i(v)), e(i), v >= 1 && (i = g, e(g), l());
175
+ }, Oi);
176
176
  }, c = async () => {
177
177
  try {
178
- const g = await Hi(t);
178
+ const g = await Wi(t);
179
179
  if (n)
180
180
  return;
181
181
  s(g.count), p(g.refreshAfterMs);
182
182
  } catch {
183
- p(Oi);
183
+ p(Di);
184
184
  }
185
185
  };
186
186
  return c(), () => {
187
187
  n = !0, o !== null && window.clearTimeout(o), l();
188
188
  };
189
189
  }
190
- async function Hi(e) {
190
+ async function Wi(e) {
191
191
  if (e.loader)
192
192
  return e.loader();
193
- const n = await (e.fetcher ?? fetch)(new URL(zi, Gi(e.backendUrl ?? Mi)).toString(), {
193
+ const n = await (e.fetcher ?? fetch)(new URL(Mi, Hi(e.backendUrl ?? Ri)).toString(), {
194
194
  cache: "no-store",
195
195
  credentials: "omit"
196
196
  });
@@ -204,16 +204,16 @@ async function Hi(e) {
204
204
  function Kn(e) {
205
205
  return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
206
206
  }
207
- function Gi(e) {
207
+ function Hi(e) {
208
208
  return e.endsWith("/") ? e : `${e}/`;
209
209
  }
210
- function $i(e) {
211
- return Math.min(Fi, Math.max(Bi, e));
210
+ function Gi(e) {
211
+ return Math.min(Bi, Math.max(Ui, e));
212
212
  }
213
- function qi(e) {
213
+ function $i(e) {
214
214
  return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
215
215
  }
216
- const ji = [
216
+ const qi = [
217
217
  "a[href]",
218
218
  "button",
219
219
  "input",
@@ -237,27 +237,27 @@ const ji = [
237
237
  ".pluno-pa-widget__message",
238
238
  ".timeline-item"
239
239
  ].join(",");
240
- function Ki(e, t, n) {
241
- return e instanceof Element ? Vi(
240
+ function ji(e, t, n) {
241
+ return e instanceof Element ? Ki(
242
242
  t,
243
243
  n,
244
- e.closest(ji) !== null
244
+ e.closest(qi) !== null
245
245
  ) : !1;
246
246
  }
247
- function Vi(e, t, n) {
247
+ function Ki(e, t, n) {
248
248
  return e === 1 && !t && !n;
249
249
  }
250
- function Yi(e, t, n) {
250
+ function Vi(e, t, n) {
251
251
  return e instanceof Node && t !== null && !t.contains(e) && !n?.contains(e);
252
252
  }
253
- function Xi(e, t = !0) {
253
+ function Yi(e, t = !0) {
254
254
  if (!e || !t || !e.isConnected || e.disabled || e.readOnly)
255
255
  return !1;
256
256
  const n = e.getRootNode();
257
257
  return (n instanceof ShadowRoot ? n.activeElement : e.ownerDocument.activeElement) === e ? !1 : (e.focus({ preventScroll: !0 }), !0);
258
258
  }
259
- const Zi = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
260
- function Ji(e) {
259
+ const Xi = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
260
+ function Zi(e) {
261
261
  let t = "", n = "", i = null;
262
262
  for (const o of e.split(new RegExp("(?<=\\n)"))) {
263
263
  if (i) {
@@ -280,7 +280,7 @@ function Ji(e) {
280
280
  }
281
281
  function Vn(e) {
282
282
  let t = "", n = 0;
283
- for (const i of e.matchAll(Zi)) {
283
+ for (const i of e.matchAll(Xi)) {
284
284
  const o = i.index ?? 0;
285
285
  t += Yn(
286
286
  e.slice(n, o)
@@ -291,16 +291,16 @@ function Vn(e) {
291
291
  function Yn(e) {
292
292
  return e.replace(
293
293
  /\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
294
- (t, n, i, o, r) => r[o - 1] === "!" || Qi(r, o) || ea(r, o, n) ? t : `[${n}](${i})`
294
+ (t, n, i, o, r) => r[o - 1] === "!" || Ji(r, o) || Qi(r, o, n) ? t : `[${n}](${i})`
295
295
  );
296
296
  }
297
- function Qi(e, t) {
297
+ function Ji(e, t) {
298
298
  let n = 0;
299
299
  for (let i = t - 1; e[i] === "\\"; i -= 1)
300
300
  n += 1;
301
301
  return n % 2 === 1;
302
302
  }
303
- function ea(e, t, n) {
303
+ function Qi(e, t, n) {
304
304
  if (n !== "x" && n !== "X")
305
305
  return !1;
306
306
  const i = e.lastIndexOf(`
@@ -309,7 +309,7 @@ function ea(e, t, n) {
309
309
  e.slice(i, t)
310
310
  );
311
311
  }
312
- const Io = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-connect", ia = "product-agent:sdk-preview-socket-send", aa = "product-agent:sdk-preview-socket-close", ra = "product-agent:sdk-preview-socket-open", la = "product-agent:sdk-preview-socket-message", sa = "product-agent:sdk-preview-socket-error", pa = "product-agent:sdk-preview-socket-closed", Xn = "product-agent:sdk-preview-socket-id", da = "data-pluno-sdk-preview-channel", Po = "data-pluno-auto-mounted", be = "__plunoProductAgentAutoMountOwner", ca = 1e4, ua = "Failed to load Pluno widget token", Zn = "Timed out loading Pluno widget token", ga = "pluno.productAgent.widgetClientId.", Jt = /* @__PURE__ */ new Set(), ha = "product-agent:preview-diagnostic", No = "pluno.productAgent.sharePromptsDisabled", ma = 3, Jn = 'dialog[open], [aria-modal="true"], [role="dialog"]', fa = 400, wa = 5e3, ba = 500, Qn = "Close the page's popup to chat", _a = "No recent chats for this page yet.", _e = {
312
+ const Io = 100, ea = 1e4, ta = 5e3, na = "product-agent:sdk-preview-socket-connect", oa = "product-agent:sdk-preview-socket-send", ia = "product-agent:sdk-preview-socket-close", aa = "product-agent:sdk-preview-socket-open", ra = "product-agent:sdk-preview-socket-message", la = "product-agent:sdk-preview-socket-error", sa = "product-agent:sdk-preview-socket-closed", Xn = "product-agent:sdk-preview-socket-id", pa = "data-pluno-sdk-preview-channel", Po = "data-pluno-auto-mounted", be = "__plunoProductAgentAutoMountOwner", da = 1e4, ca = "Failed to load Pluno widget token", Zn = "Timed out loading Pluno widget token", ua = "pluno.productAgent.widgetClientId.", Jt = /* @__PURE__ */ new Set(), ga = "product-agent:preview-diagnostic", No = "pluno.productAgent.sharePromptsDisabled", ha = 3, Jn = 'dialog[open], [aria-modal="true"], [role="dialog"]', ma = 400, fa = 5e3, wa = 500, Qn = "Close the page's popup to chat", ba = "No recent chats for this page yet.", _e = {
313
313
  launcherLabel: "Ask for anything...",
314
314
  accentColor: "#7c3aed",
315
315
  colorScheme: "light",
@@ -317,7 +317,7 @@ const Io = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-conne
317
317
  scribbleStyle: !0,
318
318
  position: "bottom-right",
319
319
  movableLauncher: !0
320
- }, xa = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', eo = "pluno-pa-scribble-font", Ro = 190, Mo = 41, to = 22, ya = 1, va = 48, vn = 420, Sa = 520, Ca = 0.24, Sn = 680, Ea = 800, ka = 0.76, N = 8, Ue = 50, zo = "http://www.w3.org/2000/svg", gn = 26, hn = 8, La = 36, mn = 16, Ta = 4, no = [
320
+ }, _a = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', eo = "pluno-pa-scribble-font", Ro = 190, Mo = 41, to = 22, xa = 1, ya = 48, vn = 420, va = 520, Sa = 0.24, Sn = 680, Ca = 800, Ea = 0.76, N = 8, Ue = 50, zo = "http://www.w3.org/2000/svg", gn = 26, hn = 8, ka = 36, mn = 16, La = 4, no = [
321
321
  {
322
322
  ellipseCx: "17.5",
323
323
  ellipseCy: "24.5",
@@ -354,12 +354,12 @@ const Io = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-conne
354
354
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
355
355
  pathStrokeWidth: "2.45"
356
356
  }
357
- ], Aa = 11, Ia = 13, fn = 4, Do = 10, Oo = 40, Pa = "movable-launcher-position-v2", Uo = "pluno-pa-widget-styles", Bo = "data-pluno-pa-widget-styles";
357
+ ], Ta = 11, Aa = 13, fn = 4, Do = 10, Oo = 40, Ia = "movable-launcher-position-v2", Uo = "pluno-pa-widget-styles", Bo = "data-pluno-pa-widget-styles";
358
358
  let oo = 0;
359
- function Na(e) {
359
+ function Pa(e) {
360
360
  return (t) => new xe(t, e);
361
361
  }
362
- async function Ra(e = {}) {
362
+ async function Na(e = {}) {
363
363
  const t = {
364
364
  layout: e.layout ?? "floating",
365
365
  mountTarget: e.mountTarget,
@@ -431,7 +431,7 @@ async function Ra(e = {}) {
431
431
  );
432
432
  const n = document.createElement("div");
433
433
  n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), n.setAttribute("data-pluno-product-agent-layout", t.layout), t.sdkPreviewChannelId && n.setAttribute(
434
- da,
434
+ pa,
435
435
  t.sdkPreviewChannelId
436
436
  );
437
437
  const i = n.attachShadow({ mode: "open" }), o = document.createElement("div");
@@ -440,7 +440,7 @@ async function Ra(e = {}) {
440
440
  t.accentColor,
441
441
  t.scribbleStyle
442
442
  );
443
- tr(
443
+ er(
444
444
  o,
445
445
  t.launcherLabel,
446
446
  r,
@@ -463,7 +463,7 @@ async function Ra(e = {}) {
463
463
  fontFamily: t.fontFamily,
464
464
  scribbleStyle: t.scribbleStyle
465
465
  });
466
- const m = t.mountTarget ?? await tl(), y = m.ownerDocument, A = o.querySelector(
466
+ const m = t.mountTarget ?? await tl(), v = m.ownerDocument, E = o.querySelector(
467
467
  ".pluno-pa-widget__launcher"
468
468
  ), O = o.querySelector(
469
469
  ".pluno-pa-widget__launcher-drag-handle"
@@ -475,7 +475,7 @@ async function Ra(e = {}) {
475
475
  ".pluno-pa-widget__scribble-spirals--panel"
476
476
  ), z = Array.from(
477
477
  o.querySelectorAll(".pluno-pa-widget__resize-handle")
478
- ), k = o.querySelector(
478
+ ), L = o.querySelector(
479
479
  ".pluno-pa-widget__close"
480
480
  ), te = o.querySelector(
481
481
  ".pluno-pa-widget__composer"
@@ -489,7 +489,7 @@ async function Ra(e = {}) {
489
489
  ".pluno-pa-widget__attachment-input"
490
490
  ), U = o.querySelector(
491
491
  ".pluno-pa-widget__attach"
492
- ), v = o.querySelector(
492
+ ), y = o.querySelector(
493
493
  ".pluno-pa-widget__input"
494
494
  ), B = o.querySelector(
495
495
  ".pluno-pa-widget__send"
@@ -519,7 +519,7 @@ async function Ra(e = {}) {
519
519
  ".pluno-pa-widget__notify-suggestion-enable"
520
520
  ), S = o.querySelector(
521
521
  ".pluno-pa-widget__notify-suggestion-later"
522
- ), L = o.querySelector(
522
+ ), T = o.querySelector(
523
523
  ".pluno-pa-widget__notify-suggestion-never"
524
524
  ), P = o.querySelector(
525
525
  ".pluno-pa-widget__tab-groups-suggestion"
@@ -528,17 +528,17 @@ async function Ra(e = {}) {
528
528
  ), ne = o.querySelector(
529
529
  ".pluno-pa-widget__tab-groups-suggestion-dismiss"
530
530
  );
531
- if (!A || !u || !w || !k || !te || !W || !Ye || !Be || !ce || !U || !v || !B || !$ || !X || !Le || !K || !ct || !Te || !ue || !ge || !M || !Xe)
531
+ if (!E || !u || !w || !L || !te || !W || !Ye || !Be || !ce || !U || !y || !B || !$ || !X || !Le || !K || !ct || !Te || !ue || !ge || !M || !Xe)
532
532
  throw new Error("Failed to mount Pluno widget");
533
533
  if (t.movableLauncher && !O)
534
534
  throw new Error("Failed to mount Pluno widget drag handle");
535
- U.hidden = !t.attachmentsEnabled, ce.disabled = !t.attachmentsEnabled, ho(u), ho(v);
536
- let b = [], E = null;
537
- const q = () => Xi(
538
- v,
535
+ U.hidden = !t.attachmentsEnabled, ce.disabled = !t.attachmentsEnabled, ho(u), ho(y);
536
+ let b = [], k = null;
537
+ const q = () => Yi(
538
+ y,
539
539
  o.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !le(t.billingStatus)
540
540
  ), Fe = () => {
541
- yr(
541
+ xr(
542
542
  Be,
543
543
  b,
544
544
  (a) => {
@@ -547,10 +547,10 @@ async function Ra(e = {}) {
547
547
  ), Fe(), D(_.getState()), j(), q();
548
548
  }
549
549
  );
550
- }, Ln = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => oi(t.tokenEndpoint) : void 0);
550
+ }, Ln = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => ni(t.tokenEndpoint) : void 0);
551
551
  if (!t.loginRequired && !t.signupRequired && !t.token && !Ln && !t.webSocketFactory)
552
552
  throw new Error("Pluno widget requires token or tokenEndpoint");
553
- const ai = window.fetch.bind(window), Pt = ol(t.clientId);
553
+ const ii = window.fetch.bind(window), Pt = ol(t.clientId);
554
554
  let _;
555
555
  try {
556
556
  const a = {
@@ -573,7 +573,7 @@ async function Ra(e = {}) {
573
573
  autoConnect: !1,
574
574
  disableNetworkCapture: !!t.sdkPreviewChannelId
575
575
  };
576
- _ = await Ci.init(a);
576
+ _ = await Si.init(a);
577
577
  } catch (a) {
578
578
  throw Pt.release(), n.remove(), a;
579
579
  }
@@ -597,9 +597,9 @@ async function Ra(e = {}) {
597
597
  Ne = { enabled: a, reason: d };
598
598
  }, ae = () => {
599
599
  ue.hidden = !0;
600
- }, ri = () => {
600
+ }, ai = () => {
601
601
  ue.hidden = !1;
602
- }, li = (a = "jump") => {
602
+ }, ri = (a = "jump") => {
603
603
  ie(!0, a), ae(), st(M, () => Ne.enabled), Re = M.scrollTop;
604
604
  }, me = () => {
605
605
  if (X.hidden = t.layout === "page" || t.loginRequired, Le.hidden = !Y, X.setAttribute("aria-expanded", String(Y)), K.classList.toggle(
@@ -613,14 +613,14 @@ async function Ra(e = {}) {
613
613
  const d = document.createElement("button");
614
614
  d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = he;
615
615
  const f = document.createElement("span");
616
- f.className = "pluno-pa-widget__history-item-title", f.textContent = Ja(a);
616
+ f.className = "pluno-pa-widget__history-item-title", f.textContent = Za(a);
617
617
  const C = document.createElement("time");
618
- C.className = "pluno-pa-widget__history-time", C.dateTime = a.lastActiveAt, C.textContent = er(
618
+ C.className = "pluno-pa-widget__history-time", C.dateTime = a.lastActiveAt, C.textContent = Qa(
619
619
  a.lastActiveAt,
620
620
  Date.now()
621
621
  );
622
622
  const I = document.createElement("small");
623
- I.className = "pluno-pa-widget__history-path", I.textContent = Qa(a), d.append(f, C, I), d.addEventListener("click", () => {
623
+ I.className = "pluno-pa-widget__history-path", I.textContent = Ja(a), d.append(f, C, I), d.addEventListener("click", () => {
624
624
  Y = !1, Je = null, me(), ie(!0, "newSession"), ae(), _.loadSession(a.id), D(_.getState()), q();
625
625
  }), K.appendChild(d);
626
626
  }
@@ -642,17 +642,17 @@ async function Ra(e = {}) {
642
642
  {
643
643
  message: d instanceof Error ? d.message : String(d)
644
644
  }
645
- ), Je = _a;
645
+ ), Je = ba;
646
646
  } finally {
647
647
  he = !1, me();
648
648
  }
649
649
  }
650
- }, si = () => {
650
+ }, li = () => {
651
651
  !Mt || he || K.scrollHeight - K.scrollTop - K.clientHeight <= 24 && An(Mt);
652
652
  }, In = () => {
653
- V || typeof document > "u" || (vo(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || y.body?.appendChild(n)));
653
+ V || typeof document > "u" || (vo(i, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || v.body?.appendChild(n)));
654
654
  }, Pn = new MutationObserver(In);
655
- Pn.observe(y.documentElement, {
655
+ Pn.observe(v.documentElement, {
656
656
  childList: !0,
657
657
  subtree: !0
658
658
  }), In();
@@ -660,7 +660,7 @@ async function Ra(e = {}) {
660
660
  const d = Tt(o, a);
661
661
  return wn(
662
662
  o,
663
- s ? Ct(s, d) : Wa(
663
+ s ? Ct(s, d) : Fa(
664
664
  o,
665
665
  t.position,
666
666
  d
@@ -668,14 +668,14 @@ async function Ra(e = {}) {
668
668
  d
669
669
  );
670
670
  }, H = () => {
671
- const a = Ka(
671
+ const a = ja(
672
672
  i,
673
673
  u,
674
- v
674
+ y
675
675
  );
676
676
  ll(t, {
677
677
  isOpen: o.classList.contains("pluno-pa-widget--open"),
678
- composerValue: v.value,
678
+ composerValue: y.value,
679
679
  focusedInput: a,
680
680
  focusedInputAt: a ? Date.now() : null,
681
681
  openToolGroupKeys: [...Nt],
@@ -690,10 +690,10 @@ async function Ra(e = {}) {
690
690
  t.onDisplayStateChange?.(a);
691
691
  }, et = (a, d = !0) => {
692
692
  if (So(t, a), a === "shown") {
693
- o.classList.remove("pluno-pa-widget--minimized"), A.removeAttribute("tabindex"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && tt(!1), d && gt("shown");
693
+ o.classList.remove("pluno-pa-widget--minimized"), E.removeAttribute("tabindex"), !o.classList.contains("pluno-pa-widget--open") && !o.classList.contains("pluno-pa-widget--closing") && tt(!1), d && gt("shown");
694
694
  return;
695
695
  }
696
- oe !== null && (window.clearTimeout(oe), oe = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), A.hidden = !1, w.hidden = !0, k.hidden = !0, A.tabIndex = 0, v.value = "", Oe(
696
+ oe !== null && (window.clearTimeout(oe), oe = null), o.classList.remove("pluno-pa-widget--open"), o.classList.remove("pluno-pa-widget--closing"), o.classList.add("pluno-pa-widget--minimized"), E.hidden = !1, w.hidden = !0, L.hidden = !0, E.tabIndex = 0, y.value = "", Oe(
697
697
  o,
698
698
  en(
699
699
  o,
@@ -702,8 +702,8 @@ async function Ra(e = {}) {
702
702
  )
703
703
  ), co(o), H(), d && gt("minimized");
704
704
  }, Me = (a, d = {}) => {
705
- ja(a, {
706
- debugVersion: Pa,
705
+ qa(a, {
706
+ debugVersion: Ia,
707
707
  launcherPosition: s,
708
708
  rootClasses: o.className,
709
709
  rootStyle: {
@@ -713,11 +713,11 @@ async function Ra(e = {}) {
713
713
  bottom: o.style.bottom
714
714
  },
715
715
  rootRect: nn(o),
716
- launcherRect: nn(A),
716
+ launcherRect: nn(E),
717
717
  panelRect: nn(w),
718
718
  viewport: ee(),
719
719
  panelHidden: w.hidden,
720
- closeHidden: k.hidden,
720
+ closeHidden: L.hidden,
721
721
  ...d
722
722
  });
723
723
  }, tt = (a = !0) => {
@@ -732,7 +732,7 @@ async function Ra(e = {}) {
732
732
  co(o);
733
733
  return;
734
734
  }
735
- qa(o, {
735
+ $a(o, {
736
736
  x: a.x - d.x,
737
737
  y: a.y - d.y
738
738
  });
@@ -779,9 +779,9 @@ async function Ra(e = {}) {
779
779
  };
780
780
  let Rn = () => {
781
781
  };
782
- window.addEventListener("resize", Nn), t.movableLauncher && O ? (tt(), Rn = Ua({
782
+ window.addEventListener("resize", Nn), t.movableLauncher && O ? (tt(), Rn = Oa({
783
783
  root: o,
784
- launcher: A,
784
+ launcher: E,
785
785
  launcherDragHandle: O,
786
786
  getPosition: () => Qe(),
787
787
  setPosition: (a) => {
@@ -801,7 +801,7 @@ async function Ra(e = {}) {
801
801
  c = !0, H(), Me("Persisted closed launcher drag position");
802
802
  }
803
803
  })) : Oe(o, null), Qt(o, g);
804
- const pi = () => {
804
+ const si = () => {
805
805
  const a = Ve(g), d = Qe();
806
806
  return {
807
807
  position: Et(
@@ -815,7 +815,7 @@ async function Ra(e = {}) {
815
815
  ),
816
816
  size: a
817
817
  };
818
- }, di = (a) => {
818
+ }, pi = (a) => {
819
819
  g = At(a.size), Qt(o, g), an(
820
820
  R,
821
821
  Dt()
@@ -830,11 +830,11 @@ async function Ra(e = {}) {
830
830
  );
831
831
  const f = Qe();
832
832
  zt(d, f);
833
- }, ci = z.length > 0 ? Ba({
833
+ }, di = z.length > 0 ? Ua({
834
834
  root: o,
835
835
  handles: z,
836
- getBounds: pi,
837
- setBounds: di,
836
+ getBounds: si,
837
+ setBounds: pi,
838
838
  persist: H
839
839
  }) : () => {
840
840
  };
@@ -866,7 +866,7 @@ async function Ra(e = {}) {
866
866
  }
867
867
  }
868
868
  }, fe = (a = "", d = !0, f = !0) => {
869
- Mn(), ot && (ot = !1, Ft()), o.classList.contains("pluno-pa-widget--open") || (h = null), oe !== null && (window.clearTimeout(oe), oe = null), et("shown", !1), w.hidden = !1, k.hidden = !1, an(
869
+ Mn(), ot && (ot = !1, Ft()), o.classList.contains("pluno-pa-widget--open") || (h = null), oe !== null && (window.clearTimeout(oe), oe = null), et("shown", !1), w.hidden = !1, L.hidden = !1, an(
870
870
  R,
871
871
  Dt()
872
872
  ), o.classList.remove("pluno-pa-widget--closing");
@@ -880,24 +880,24 @@ async function Ra(e = {}) {
880
880
  openPanelPosition: I,
881
881
  visibleLauncherPosition: C
882
882
  }), ie(!0, "open"), ae(), !d) {
883
- o.classList.add("pluno-pa-widget--open"), A.hidden = !0, a && (v.value = a, lt(v)), st(M, () => Ne.enabled), Re = M.scrollTop, f && (v.focus(), v.setSelectionRange(v.value.length, v.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0);
883
+ o.classList.add("pluno-pa-widget--open"), E.hidden = !0, a && (y.value = a, lt(y)), st(M, () => Ne.enabled), Re = M.scrollTop, f && (y.focus(), y.setSelectionRange(y.value.length, y.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0);
884
884
  return;
885
885
  }
886
886
  window.requestAnimationFrame(() => {
887
- o.classList.add("pluno-pa-widget--open"), a && (v.value = a, lt(v)), st(M, () => Ne.enabled), Re = M.scrollTop, f && (v.focus(), v.setSelectionRange(v.value.length, v.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0), oe = window.setTimeout(() => {
888
- A.hidden = !0, st(M, () => Ne.enabled), Re = M.scrollTop;
887
+ o.classList.add("pluno-pa-widget--open"), a && (y.value = a, lt(y)), st(M, () => Ne.enabled), Re = M.scrollTop, f && (y.focus(), y.setSelectionRange(y.value.length, y.value.length)), H(), gt("shown"), t.onPanelOpenChange?.(!0), oe = window.setTimeout(() => {
888
+ E.hidden = !0, st(M, () => Ne.enabled), Re = M.scrollTop;
889
889
  }, 220);
890
890
  });
891
891
  }, Ut = () => {
892
- oe !== null && (window.clearTimeout(oe), oe = null), A.hidden = !1, s && (tt(!1), Me("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), H(), t.onPanelOpenChange?.(!1), oe = window.setTimeout(() => {
893
- w.hidden = !0, k.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
892
+ oe !== null && (window.clearTimeout(oe), oe = null), E.hidden = !1, s && (tt(!1), Me("Closing launcher at stored position")), o.classList.remove("pluno-pa-widget--open"), o.classList.add("pluno-pa-widget--closing"), H(), t.onPanelOpenChange?.(!1), oe = window.setTimeout(() => {
893
+ w.hidden = !0, L.hidden = !0, h = null, o.classList.remove("pluno-pa-widget--closing");
894
894
  }, 220);
895
895
  };
896
- A.addEventListener("submit", (a) => {
896
+ E.addEventListener("submit", (a) => {
897
897
  a.preventDefault(), fe(u.value), u.value = "";
898
898
  }), O?.addEventListener("click", (a) => {
899
899
  a.preventDefault(), a.stopPropagation();
900
- }), A.addEventListener("click", (a) => {
900
+ }), E.addEventListener("click", (a) => {
901
901
  a.target === u && !O || (fe(u.value), u.value = "");
902
902
  }), u.addEventListener("focus", () => {
903
903
  fe(u.value), u.value = "";
@@ -908,7 +908,7 @@ async function Ra(e = {}) {
908
908
  fe(a), u.value = "";
909
909
  });
910
910
  let Bt = null, ht = null, ze = null;
911
- const zn = (a) => a === u || a === v, ui = (a) => {
911
+ const zn = (a) => a === u || a === y, ci = (a) => {
912
912
  if (!(a instanceof Element) || a.getRootNode() === o.getRootNode())
913
913
  return null;
914
914
  let d = a;
@@ -920,7 +920,7 @@ async function Ra(e = {}) {
920
920
  d = C instanceof ShadowRoot ? C.host : null;
921
921
  }
922
922
  return null;
923
- }, gi = (a) => {
923
+ }, ui = (a) => {
924
924
  if (!a.isConnected || !a.matches(Jn))
925
925
  return !1;
926
926
  if (!(a instanceof HTMLElement))
@@ -937,9 +937,9 @@ async function Ra(e = {}) {
937
937
  a !== null
938
938
  ), De(), a !== null ? ze = window.setInterval(() => {
939
939
  const d = We;
940
- (!d || !gi(d)) && Dn(null);
941
- }, ba) : ze !== null && (window.clearInterval(ze), ze = null, ht = null));
942
- }, hi = () => {
940
+ (!d || !ui(d)) && Dn(null);
941
+ }, wa) : ze !== null && (window.clearInterval(ze), ze = null, ht = null));
942
+ }, gi = () => {
943
943
  ze !== null && (window.clearInterval(ze), ze = null);
944
944
  };
945
945
  o.addEventListener("focusin", (a) => {
@@ -948,27 +948,27 @@ async function Ra(e = {}) {
948
948
  if (!zn(a.target) || We !== null)
949
949
  return;
950
950
  const d = Bt;
951
- if (Bt = null, d === null || Date.now() - d > fa)
951
+ if (Bt = null, d === null || Date.now() - d > ma)
952
952
  return;
953
- const f = ui(a.relatedTarget);
953
+ const f = ci(a.relatedTarget);
954
954
  if (!f)
955
955
  return;
956
956
  const C = Date.now();
957
- if (ht !== null && C - ht <= wa) {
957
+ if (ht !== null && C - ht <= fa) {
958
958
  Dn(f);
959
959
  return;
960
960
  }
961
961
  ht = C;
962
- }), A.addEventListener("keydown", (a) => {
962
+ }), E.addEventListener("keydown", (a) => {
963
963
  !o.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), fe());
964
964
  }), F?.addEventListener("pointerdown", (a) => {
965
965
  a.stopPropagation();
966
966
  }), F?.addEventListener("click", (a) => {
967
967
  a.preventDefault(), a.stopPropagation(), et("minimized");
968
- }), k.addEventListener("click", Ut), M.addEventListener("scroll", () => {
968
+ }), L.addEventListener("click", Ut), M.addEventListener("scroll", () => {
969
969
  M.scrollTop < Re - 1 && ie(!1, "userScroll"), Re = M.scrollTop;
970
970
  }), ue.addEventListener("click", () => {
971
- li();
971
+ ri();
972
972
  });
973
973
  const On = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
974
974
  ([a]) => {
@@ -981,9 +981,9 @@ async function Ra(e = {}) {
981
981
  let We = null, ot = !1;
982
982
  const re = () => ut || _.getState().status !== "connected", De = () => {
983
983
  const a = nt(), d = We !== null;
984
- u.readOnly = !1, v.readOnly = !1, u.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ot ? "New update" : t.launcherLabel, v.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : _e.launcherLabel, te.hidden = a;
984
+ u.readOnly = !1, y.readOnly = !1, u.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ot ? "New update" : t.launcherLabel, y.placeholder = d ? Qn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : _e.launcherLabel, te.hidden = a;
985
985
  }, j = () => {
986
- B.disabled = re() || le(t.billingStatus) || !_.getState().isThinking && v.value.trim().length === 0 && b.length === 0, U.disabled = nt() || re() || le(t.billingStatus);
986
+ B.disabled = re() || le(t.billingStatus) || !_.getState().isThinking && y.value.trim().length === 0 && b.length === 0, U.disabled = nt() || re() || le(t.billingStatus);
987
987
  };
988
988
  De();
989
989
  const Ft = () => {
@@ -1021,37 +1021,37 @@ async function Ra(e = {}) {
1021
1021
  }
1022
1022
  re() || le(t.billingStatus) || (ve = !0, ie(!0, "send"), ae(), b = on(
1023
1023
  _,
1024
- v,
1024
+ y,
1025
1025
  b,
1026
1026
  yt
1027
1027
  ), Fe(), j());
1028
1028
  });
1029
1029
  let it = 0;
1030
- const mi = () => {
1030
+ const hi = () => {
1031
1031
  it = 0, o.classList.remove("pluno-pa-widget--drag-over");
1032
1032
  }, Ht = (a) => {
1033
- E !== null && window.clearTimeout(E), W.textContent = a, W.hidden = !1, E = window.setTimeout(() => {
1034
- W.textContent = "", W.hidden = !0, E = null;
1033
+ k !== null && window.clearTimeout(k), W.textContent = a, W.hidden = !1, k = window.setTimeout(() => {
1034
+ W.textContent = "", W.hidden = !0, k = null;
1035
1035
  }, 3e3);
1036
- }, fi = () => {
1037
- E !== null && (window.clearTimeout(E), E = null), W.textContent = "", W.hidden = !0;
1036
+ }, mi = () => {
1037
+ k !== null && (window.clearTimeout(k), k = null), W.textContent = "", W.hidden = !0;
1038
1038
  }, Gt = async (a) => {
1039
1039
  if (!t.attachmentsEnabled || a.length === 0)
1040
1040
  return;
1041
- const d = Cr(_, a);
1042
- if (b = [...b, ...d], Fe(), fi(), j(), D(_.getState()), !o.classList.contains("pluno-pa-widget--open")) {
1041
+ const d = Sr(_, a);
1042
+ if (b = [...b, ...d], Fe(), mi(), j(), D(_.getState()), !o.classList.contains("pluno-pa-widget--open")) {
1043
1043
  fe();
1044
1044
  return;
1045
1045
  }
1046
1046
  q();
1047
- }, wi = async (a) => {
1048
- await Gt(a), !(a.length === 0 || We !== null) && v.focus();
1047
+ }, fi = async (a) => {
1048
+ await Gt(a), !(a.length === 0 || We !== null) && y.focus();
1049
1049
  };
1050
1050
  U.addEventListener("click", () => {
1051
1051
  t.loginRequired || re() || le(t.billingStatus) || ce.click();
1052
1052
  }), ce.addEventListener("change", () => {
1053
1053
  const a = Array.from(ce.files ?? []);
1054
- ce.value = "", wi(a).catch((d) => {
1054
+ ce.value = "", fi(a).catch((d) => {
1055
1055
  Ht(
1056
1056
  d instanceof Error ? d.message : "Failed to attach file"
1057
1057
  ), Z("web-sdk.widget", "Attachment failed", {
@@ -1067,7 +1067,7 @@ async function Ra(e = {}) {
1067
1067
  vt(a.dataTransfer) && (a.stopPropagation(), it = Math.max(0, it - 1), it === 0 && o.classList.remove("pluno-pa-widget--drag-over"));
1068
1068
  }), o.addEventListener("drop", (a) => {
1069
1069
  const d = a.dataTransfer;
1070
- !t.attachmentsEnabled || !vt(d) || t.loginRequired || re() || (a.preventDefault(), a.stopPropagation(), mi(), Gt(d.files).catch((f) => {
1070
+ !t.attachmentsEnabled || !vt(d) || t.loginRequired || re() || (a.preventDefault(), a.stopPropagation(), hi(), Gt(d.files).catch((f) => {
1071
1071
  Ht(
1072
1072
  f instanceof Error ? f.message : "Failed to attach file"
1073
1073
  ), Z("web-sdk.widget", "Attachment failed", {
@@ -1095,10 +1095,10 @@ async function Ra(e = {}) {
1095
1095
  }
1096
1096
  if (re())
1097
1097
  return;
1098
- const a = v.value.trim().length > 0 || b.length > 0;
1098
+ const a = y.value.trim().length > 0 || b.length > 0;
1099
1099
  ve = !0, ie(!0, "send"), ae(), b = on(
1100
1100
  _,
1101
- v,
1101
+ y,
1102
1102
  b,
1103
1103
  yt
1104
1104
  ), Fe(), j(), D(_.getState()), a && q();
@@ -1106,9 +1106,9 @@ async function Ra(e = {}) {
1106
1106
  Y = !Y, Je = null, me(), Y && Se.length === 0 && An(null), Y || q();
1107
1107
  }), ct.addEventListener("click", () => {
1108
1108
  Y = !1, me(), q();
1109
- }), K.addEventListener("scroll", si), v.addEventListener("input", () => {
1110
- lt(v), H(), j(), xi();
1111
- }), v.addEventListener("keydown", (a) => {
1109
+ }), K.addEventListener("scroll", li), y.addEventListener("input", () => {
1110
+ lt(y), H(), j(), _i();
1111
+ }), y.addEventListener("keydown", (a) => {
1112
1112
  if (!(a.key !== "Enter" || a.shiftKey)) {
1113
1113
  if (a.preventDefault(), t.loginRequired) {
1114
1114
  t.onLoginClick?.();
@@ -1116,16 +1116,16 @@ async function Ra(e = {}) {
1116
1116
  }
1117
1117
  re() || (ve = !0, ie(!0, "send"), ae(), b = on(
1118
1118
  _,
1119
- v,
1119
+ y,
1120
1120
  b,
1121
1121
  yt
1122
1122
  ), Fe(), j(), D(_.getState()));
1123
1123
  }
1124
1124
  }), o.addEventListener("click", (a) => {
1125
1125
  const d = a.target instanceof Element ? a.target : null;
1126
- d?.closest("a[href]") && H(), Y && Yi(d, Le, X) && (Y = !1, me());
1126
+ d?.closest("a[href]") && H(), Y && Vi(d, Le, X) && (Y = !1, me());
1127
1127
  const C = window.getSelection(), I = !!(C && !C.isCollapsed && C.anchorNode && o.contains(C.anchorNode));
1128
- Ki(a.target, a.detail, I) && q();
1128
+ ji(a.target, a.detail, I) && q();
1129
1129
  }), o.addEventListener("copy", (a) => {
1130
1130
  a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && o.contains(window.getSelection()?.anchorNode ?? null) && o.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
1131
1131
  "text/plain",
@@ -1144,7 +1144,7 @@ async function Ra(e = {}) {
1144
1144
  return;
1145
1145
  }
1146
1146
  a.key !== "Escape" || !Y || (Y = !1, me(), q());
1147
- }), l.composerValue && (v.value = l.composerValue, lt(v)), t.layout === "page" ? fe(v.value, !1) : p === "minimized" ? et("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && fe(v.value, !1, !1), Va(l, o, u, v);
1147
+ }), l.composerValue && (y.value = l.composerValue, lt(y)), t.layout === "page" ? fe(y.value, !1) : p === "minimized" ? et("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && fe(y.value, !1, !1), Ka(l, o, u, y);
1148
1148
  const mt = () => r;
1149
1149
  let $t = _.getState().appearance !== null, ft = null, at = null, Un = _.getState().isThinking, He = null;
1150
1150
  const rt = t.taskNotifications;
@@ -1153,7 +1153,7 @@ async function Ra(e = {}) {
1153
1153
  Ge !== null && (window.clearTimeout(Ge), Ge = null);
1154
1154
  }, wt = () => {
1155
1155
  Ae && (Ae.hidden = !0);
1156
- }, Fn = () => _.getState().assistantDraft.trim().length > 0, bi = async () => {
1156
+ }, Fn = () => _.getState().assistantDraft.trim().length > 0, wi = async () => {
1157
1157
  if (!rt || !Ae || $e || V || !_.getState().isThinking || Fn())
1158
1158
  return;
1159
1159
  let a;
@@ -1169,7 +1169,7 @@ async function Ra(e = {}) {
1169
1169
  });
1170
1170
  }), S?.addEventListener("click", () => {
1171
1171
  $e = !0, wt();
1172
- }), L?.addEventListener("click", () => {
1172
+ }), T?.addEventListener("click", () => {
1173
1173
  $e = !0, wt(), rt?.dismissForever().catch(() => {
1174
1174
  });
1175
1175
  });
@@ -1194,12 +1194,12 @@ async function Ra(e = {}) {
1194
1194
  }), _t();
1195
1195
  let je = null, Wn = () => {
1196
1196
  };
1197
- const _i = !!(t.sdkPreviewChannelId && t.referralLinkLoader), qt = /* @__PURE__ */ new Map(), jt = () => v.value.trim().length > 0 || b.length > 0, xi = () => {
1197
+ const bi = !!(t.sdkPreviewChannelId && t.referralLinkLoader), qt = /* @__PURE__ */ new Map(), jt = () => y.value.trim().length > 0 || b.length > 0, _i = () => {
1198
1198
  const a = je !== null && sn(_.getState(), jt());
1199
1199
  ge.hidden = !a, a && je !== null && Wo(ge, je);
1200
1200
  };
1201
1201
  let Ke = null;
1202
- const we = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Set(), yi = async (a) => {
1202
+ const we = /* @__PURE__ */ new Map(), xt = /* @__PURE__ */ new Set(), xi = async (a) => {
1203
1203
  if (t.integrationAuthHandler) {
1204
1204
  we.set(a.authRequestId, { status: "connecting" }), D(_.getState());
1205
1205
  try {
@@ -1213,7 +1213,7 @@ async function Ra(e = {}) {
1213
1213
  D(_.getState());
1214
1214
  }
1215
1215
  }, Kt = (a = {}) => {
1216
- ve = !0, ie(!0, "newSession"), ae(), Y = !1, me(), _.startNewSession(a), Nt.clear(), we.clear(), xt.clear(), v.value = "", b = [], Fe(), lt(v), H(), j(), v.focus(), D(_.getState());
1216
+ ve = !0, ie(!0, "newSession"), ae(), Y = !1, me(), _.startNewSession(a), Nt.clear(), we.clear(), xt.clear(), y.value = "", b = [], Fe(), lt(y), H(), j(), y.focus(), D(_.getState());
1217
1217
  }, yt = () => {
1218
1218
  t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), Kt());
1219
1219
  }, Vt = (a) => {
@@ -1224,7 +1224,7 @@ async function Ra(e = {}) {
1224
1224
  Ke || (Ke = It(
1225
1225
  "pluno-pa-widget__new-chat",
1226
1226
  "New chat",
1227
- gr(),
1227
+ ur(),
1228
1228
  !1
1229
1229
  ), Ke.addEventListener("click", () => Kt()), $.insertBefore(Ke, X));
1230
1230
  }, D = (a) => {
@@ -1258,10 +1258,10 @@ async function Ra(e = {}) {
1258
1258
  );
1259
1259
  return;
1260
1260
  }
1261
- const d = Xa(a), f = d !== Tn;
1261
+ const d = Ya(a), f = d !== Tn;
1262
1262
  Tn = d;
1263
1263
  const C = ve || Ne.enabled;
1264
- ve = !1, Pr(
1264
+ ve = !1, Ir(
1265
1265
  M,
1266
1266
  Xe,
1267
1267
  B,
@@ -1292,10 +1292,10 @@ async function Ra(e = {}) {
1292
1292
  states: we,
1293
1293
  initialStatus: t.integrationAuthStatusLoader ? "checking" : "pending",
1294
1294
  onConnect: (I) => {
1295
- yi(I);
1295
+ xi(I);
1296
1296
  }
1297
1297
  } : void 0,
1298
- _i && !Rt ? {
1298
+ bi && !Rt ? {
1299
1299
  dismissedCandidateIds: Ze,
1300
1300
  actionCandidate: ft,
1301
1301
  error: at,
@@ -1305,7 +1305,7 @@ async function Ra(e = {}) {
1305
1305
  Pe.add(I.id), H();
1306
1306
  },
1307
1307
  onReferralCopy: (I) => {
1308
- vi(I);
1308
+ yi(I);
1309
1309
  },
1310
1310
  onSocialShare: (I) => {
1311
1311
  Pe.add(I.id), Ze.add(I.id), H();
@@ -1317,7 +1317,7 @@ async function Ra(e = {}) {
1317
1317
  Rt = !0, Pe.add(I.id), Ze.add(I.id), H(), rl(t, !0), at = null, D(_.getState());
1318
1318
  }
1319
1319
  } : void 0
1320
- ), C ? (Re = M.scrollTop, ae()) : f && Za(a) && ri();
1320
+ ), C ? (Re = M.scrollTop, ae()) : f && Xa(a) && ai();
1321
1321
  }, Hn = async (a) => {
1322
1322
  if (!t.integrationAuthStatusLoader)
1323
1323
  return;
@@ -1346,21 +1346,21 @@ async function Ra(e = {}) {
1346
1346
  })
1347
1347
  );
1348
1348
  };
1349
- return Wn = Wi(
1349
+ return Wn = Fi(
1350
1350
  (a) => {
1351
1351
  je = a, !V && sn(_.getState(), jt()) && D(_.getState());
1352
1352
  },
1353
1353
  {
1354
1354
  backendUrl: t.backendUrl,
1355
- fetcher: ai,
1355
+ fetcher: ii,
1356
1356
  loader: t.activeUsersLoader
1357
1357
  }
1358
1358
  ), _.on("state", (a) => {
1359
1359
  _t();
1360
1360
  const d = Un && !a.isThinking;
1361
1361
  Un = a.isThinking, a.isThinking && !a.assistantDraft.trim() && rt && !$e && Ge === null && Ae?.hidden !== !1 && (Ge = window.setTimeout(() => {
1362
- Ge = null, bi();
1363
- }, ta)), (!a.isThinking || a.assistantDraft.trim()) && (Bn(), wt()), d && !o.classList.contains("pluno-pa-widget--open") && (ot = !0), Ft(), a.appearance ? ($t = !0, Z(
1362
+ Ge = null, wi();
1363
+ }, ea)), (!a.isThinking || a.assistantDraft.trim()) && (Bn(), wt()), d && !o.classList.contains("pluno-pa-widget--open") && (ot = !0), Ft(), a.appearance ? ($t = !0, Z(
1364
1364
  "web-sdk.widget",
1365
1365
  "Agent state supplied appearance",
1366
1366
  {
@@ -1399,7 +1399,7 @@ async function Ra(e = {}) {
1399
1399
  t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), De(), D(_.getState()), j(), d && !nt() && Wt();
1400
1400
  },
1401
1401
  openPanel: (a) => {
1402
- const d = typeof a == "string" ? a : v.value, f = typeof a == "object" ? a.focusComposer !== !1 : !0;
1402
+ const d = typeof a == "string" ? a : y.value, f = typeof a == "object" ? a.focusComposer !== !1 : !0;
1403
1403
  fe(d, !1, f);
1404
1404
  },
1405
1405
  closePanel: Ut,
@@ -1414,10 +1414,10 @@ async function Ra(e = {}) {
1414
1414
  t.morningReport = a ?? null, D(_.getState());
1415
1415
  },
1416
1416
  destroy: () => {
1417
- V || (H(), V = !0, Pn.disconnect(), On?.disconnect(), hi(), window.removeEventListener("resize", Nn), Rn(), ci(), E !== null && window.clearTimeout(E), Bn(), Wn(), _.destroy(), Pt.release(), n.remove());
1417
+ V || (H(), V = !0, Pn.disconnect(), On?.disconnect(), gi(), window.removeEventListener("resize", Nn), Rn(), di(), k !== null && window.clearTimeout(k), Bn(), Wn(), _.destroy(), Pt.release(), n.remove());
1418
1418
  }
1419
1419
  };
1420
- async function vi(a) {
1420
+ async function yi(a) {
1421
1421
  if (!ft) {
1422
1422
  ft = a, at = null, D(_.getState());
1423
1423
  try {
@@ -1426,7 +1426,7 @@ async function Ra(e = {}) {
1426
1426
  const d = await t.referralLinkLoader();
1427
1427
  if (!d)
1428
1428
  throw new Error("Pluno did not return a referral link.");
1429
- await Si(d), Pe.add(a.id), Ze.add(a.id), H();
1429
+ await vi(d), Pe.add(a.id), Ze.add(a.id), H();
1430
1430
  } catch (d) {
1431
1431
  at = d instanceof Error ? d.message : "Could not copy referral link.";
1432
1432
  } finally {
@@ -1434,7 +1434,7 @@ async function Ra(e = {}) {
1434
1434
  }
1435
1435
  }
1436
1436
  }
1437
- async function Si(a) {
1437
+ async function vi(a) {
1438
1438
  if (navigator.clipboard?.writeText)
1439
1439
  try {
1440
1440
  await navigator.clipboard.writeText(a);
@@ -1474,11 +1474,11 @@ async function Ra(e = {}) {
1474
1474
  function io(e, t) {
1475
1475
  return { accentColor: e, scribbleStyle: t };
1476
1476
  }
1477
- function Ma(e) {
1478
- const t = za(e);
1479
- return t === null ? "#fafafa" : Da(t) > 0.5 ? "#18181b" : "#fafaf9";
1477
+ function Ra(e) {
1478
+ const t = Ma(e);
1479
+ return t === null ? "#fafafa" : za(t) > 0.5 ? "#18181b" : "#fafaf9";
1480
1480
  }
1481
- function za(e) {
1481
+ function Ma(e) {
1482
1482
  const t = e.trim();
1483
1483
  return /^#[0-9a-f]{6}$/i.test(t) ? [
1484
1484
  Number.parseInt(t.slice(1, 3), 16),
@@ -1490,7 +1490,7 @@ function za(e) {
1490
1490
  Number.parseInt(t[3] + t[3], 16)
1491
1491
  ] : null;
1492
1492
  }
1493
- function Da([e, t, n]) {
1493
+ function za([e, t, n]) {
1494
1494
  const i = (o) => {
1495
1495
  const r = o / 255;
1496
1496
  return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
@@ -1508,8 +1508,8 @@ function ao(e, t, n) {
1508
1508
  const i = n.scribbleStyle ? Lo(n.accentColor) : n.accentColor;
1509
1509
  e.style.setProperty("--pluno-pa-accent", i), n.scribbleStyle ? e.style.setProperty(
1510
1510
  "--pluno-pa-accent-contrast",
1511
- Ma(i)
1512
- ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? xa : n.fontFamily, n.scribbleStyle && Oa(e.ownerDocument);
1511
+ Ra(i)
1512
+ ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? _a : n.fontFamily, n.scribbleStyle && Da(e.ownerDocument);
1513
1513
  const o = Array.from(
1514
1514
  e.querySelectorAll(".pluno-pa-widget__character")
1515
1515
  );
@@ -1521,7 +1521,7 @@ function ao(e, t, n) {
1521
1521
  )
1522
1522
  );
1523
1523
  }
1524
- function Oa(e) {
1524
+ function Da(e) {
1525
1525
  if (e.getElementById(eo))
1526
1526
  return;
1527
1527
  const t = e.createElement("style");
@@ -1533,7 +1533,7 @@ function Oa(e) {
1533
1533
  src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
1534
1534
  }`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
1535
1535
  }
1536
- function Ua({
1536
+ function Oa({
1537
1537
  root: e,
1538
1538
  launcher: t,
1539
1539
  launcherDragHandle: n,
@@ -1546,13 +1546,13 @@ function Ua({
1546
1546
  l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
1547
1547
  }, m = (w) => {
1548
1548
  e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (w.preventDefault(), w.stopPropagation(), l = w.pointerId, p = { x: w.clientX, y: w.clientY }, s = i(), c = !1, t.setPointerCapture?.(w.pointerId));
1549
- }, y = (w) => {
1549
+ }, v = (w) => {
1550
1550
  if (l !== w.pointerId || !p || !s)
1551
1551
  return;
1552
1552
  w.preventDefault();
1553
1553
  const R = w.clientX - p.x, z = w.clientY - p.y;
1554
1554
  !c && Math.hypot(R, z) < fn || (c = !0, e.classList.add("pluno-pa-widget--dragging"), o({ x: s.x + R, y: s.y + z }));
1555
- }, A = (w) => {
1555
+ }, E = (w) => {
1556
1556
  l === w.pointerId && (w.preventDefault(), w.stopPropagation(), c && (g = { x: w.clientX, y: w.clientY }, r()), h());
1557
1557
  }, O = (w) => {
1558
1558
  l === w.pointerId && (w.preventDefault(), h());
@@ -1568,14 +1568,14 @@ function Ua({
1568
1568
  if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
1569
1569
  return;
1570
1570
  const R = w.shiftKey ? Oo : Do, z = i();
1571
- let k = null;
1572
- w.key === "ArrowUp" ? k = { x: z.x, y: z.y - R } : w.key === "ArrowDown" ? k = { x: z.x, y: z.y + R } : w.key === "ArrowLeft" ? k = { x: z.x - R, y: z.y } : w.key === "ArrowRight" && (k = { x: z.x + R, y: z.y }), k && (w.preventDefault(), w.stopPropagation(), o(k), r());
1571
+ let L = null;
1572
+ w.key === "ArrowUp" ? L = { x: z.x, y: z.y - R } : w.key === "ArrowDown" ? L = { x: z.x, y: z.y + R } : w.key === "ArrowLeft" ? L = { x: z.x - R, y: z.y } : w.key === "ArrowRight" && (L = { x: z.x + R, y: z.y }), L && (w.preventDefault(), w.stopPropagation(), o(L), r());
1573
1573
  };
1574
- return t.addEventListener("pointerdown", m), t.addEventListener("pointermove", y), t.addEventListener("pointerup", A), t.addEventListener("pointercancel", O), t.addEventListener("click", u, !0), n.addEventListener("keydown", F), () => {
1575
- t.removeEventListener("pointerdown", m), t.removeEventListener("pointermove", y), t.removeEventListener("pointerup", A), t.removeEventListener("pointercancel", O), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", F);
1574
+ return t.addEventListener("pointerdown", m), t.addEventListener("pointermove", v), t.addEventListener("pointerup", E), t.addEventListener("pointercancel", O), t.addEventListener("click", u, !0), n.addEventListener("keydown", F), () => {
1575
+ t.removeEventListener("pointerdown", m), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", E), t.removeEventListener("pointercancel", O), t.removeEventListener("click", u, !0), n.removeEventListener("keydown", F);
1576
1576
  };
1577
1577
  }
1578
- function Ba({
1578
+ function Ua({
1579
1579
  root: e,
1580
1580
  handles: t,
1581
1581
  getBounds: n,
@@ -1596,20 +1596,20 @@ function Ba({
1596
1596
  !c && Math.hypot(F, w) < fn || (c = !0, e.classList.add("pluno-pa-widget--resizing"), i(
1597
1597
  lo(s, l, F, w)
1598
1598
  ));
1599
- }, y = (u) => {
1599
+ }, v = (u) => {
1600
1600
  r === u.pointerId && (u.preventDefault(), u.stopPropagation(), c && o(), g());
1601
- }, A = (u) => {
1601
+ }, E = (u) => {
1602
1602
  r === u.pointerId && (u.preventDefault(), g());
1603
1603
  }, O = (u) => {
1604
1604
  const w = u.currentTarget.dataset.resizeDirection, R = u.shiftKey ? Oo : Do, z = n();
1605
- let k = 0, te = 0;
1606
- ro(w) && (u.key === "ArrowLeft" ? k = -R : u.key === "ArrowRight" ? k = R : u.key === "ArrowUp" ? te = -R : u.key === "ArrowDown" && (te = R), !(k === 0 && te === 0) && (u.preventDefault(), u.stopPropagation(), i(lo(z, w, k, te)), o()));
1605
+ let L = 0, te = 0;
1606
+ ro(w) && (u.key === "ArrowLeft" ? L = -R : u.key === "ArrowRight" ? L = R : u.key === "ArrowUp" ? te = -R : u.key === "ArrowDown" && (te = R), !(L === 0 && te === 0) && (u.preventDefault(), u.stopPropagation(), i(lo(z, w, L, te)), o()));
1607
1607
  };
1608
1608
  for (const u of t)
1609
- u.addEventListener("pointerdown", h), u.addEventListener("pointermove", m), u.addEventListener("pointerup", y), u.addEventListener("pointercancel", A), u.addEventListener("keydown", O);
1609
+ u.addEventListener("pointerdown", h), u.addEventListener("pointermove", m), u.addEventListener("pointerup", v), u.addEventListener("pointercancel", E), u.addEventListener("keydown", O);
1610
1610
  return () => {
1611
1611
  for (const u of t)
1612
- u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", m), u.removeEventListener("pointerup", y), u.removeEventListener("pointercancel", A), u.removeEventListener("keydown", O);
1612
+ u.removeEventListener("pointerdown", h), u.removeEventListener("pointermove", m), u.removeEventListener("pointerup", v), u.removeEventListener("pointercancel", E), u.removeEventListener("keydown", O);
1613
1613
  };
1614
1614
  }
1615
1615
  function ro(e) {
@@ -1700,32 +1700,32 @@ function Tt(e, t = !0) {
1700
1700
  const i = e.getBoundingClientRect(), o = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
1701
1701
  return {
1702
1702
  width: t && o && i.width > 0 ? i.width : Math.min(Ro, n.width - 36),
1703
- height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ? va : Mo
1703
+ height: t && o && i.height > 0 ? i.height : e.classList.contains("pluno-pa-widget--scribble") ? ya : Mo
1704
1704
  };
1705
1705
  }
1706
- function Fa() {
1706
+ function Ba() {
1707
1707
  const e = ee();
1708
1708
  return {
1709
1709
  width: Math.min(
1710
1710
  Q(
1711
- e.width * Ca,
1711
+ e.width * Sa,
1712
1712
  vn,
1713
- Sa
1713
+ va
1714
1714
  ),
1715
1715
  e.width - N * 2
1716
1716
  ),
1717
1717
  height: Math.min(
1718
1718
  Q(
1719
- e.height * ka,
1719
+ e.height * Ea,
1720
1720
  Sn,
1721
- Ea
1721
+ Ca
1722
1722
  ),
1723
1723
  e.height - Ue - N
1724
1724
  )
1725
1725
  };
1726
1726
  }
1727
1727
  function Ve(e = null) {
1728
- return e ? At(e) : Fa();
1728
+ return e ? At(e) : Ba();
1729
1729
  }
1730
1730
  function At(e) {
1731
1731
  const t = ee();
@@ -1762,7 +1762,7 @@ function Qt(e, t) {
1762
1762
  const n = At(t);
1763
1763
  e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
1764
1764
  }
1765
- function Wa(e, t, n) {
1765
+ function Fa(e, t, n) {
1766
1766
  const i = Number.parseFloat(e.style.left), o = Number.parseFloat(e.style.top);
1767
1767
  if (Number.isFinite(i) && Number.isFinite(o))
1768
1768
  return { x: i, y: o };
@@ -1781,9 +1781,9 @@ function en(e, t, n) {
1781
1781
  e,
1782
1782
  Ct(t, i),
1783
1783
  i
1784
- ) : Ha(n === "bottom-left" ? "bottom-left" : "bottom-right", i, ya);
1784
+ ) : Wa(n === "bottom-left" ? "bottom-left" : "bottom-right", i, xa);
1785
1785
  }
1786
- function Ha(e, t, n) {
1786
+ function Wa(e, t, n) {
1787
1787
  const i = ee();
1788
1788
  return {
1789
1789
  x: e.endsWith("right") ? Math.max(0, i.width - t.width - n) : n,
@@ -1791,7 +1791,7 @@ function Ha(e, t, n) {
1791
1791
  };
1792
1792
  }
1793
1793
  function wn(e, t, n) {
1794
- const i = ee(), o = N + $a(e);
1794
+ const i = ee(), o = N + Ga(e);
1795
1795
  return {
1796
1796
  x: Q(
1797
1797
  t.x,
@@ -1819,19 +1819,19 @@ function Ct(e, t) {
1819
1819
  };
1820
1820
  }
1821
1821
  function po(e, t) {
1822
- const n = Ga(e, t), i = ee();
1822
+ const n = Ha(e, t), i = ee();
1823
1823
  return {
1824
1824
  anchor: n,
1825
1825
  x: n.endsWith("right") ? i.width - e.x - t.width : e.x,
1826
1826
  y: n.startsWith("bottom") ? i.height - e.y - t.height : e.y
1827
1827
  };
1828
1828
  }
1829
- function Ga(e, t) {
1829
+ function Ha(e, t) {
1830
1830
  const n = ee(), i = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = i <= n.width / 2 ? "left" : "right";
1831
1831
  return `${r}-${l}`;
1832
1832
  }
1833
- function $a(e) {
1834
- return e.classList.contains("pluno-pa-widget--scribble") ? Ia : Aa;
1833
+ function Ga(e) {
1834
+ return e.classList.contains("pluno-pa-widget--scribble") ? Aa : Ta;
1835
1835
  }
1836
1836
  function tn(e, t, n, i = null) {
1837
1837
  const o = Tt(e), r = Ve(i), l = {
@@ -1868,7 +1868,7 @@ function Oe(e, t) {
1868
1868
  }
1869
1869
  e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
1870
1870
  }
1871
- function qa(e, t) {
1871
+ function $a(e, t) {
1872
1872
  e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
1873
1873
  }
1874
1874
  function co(e) {
@@ -1902,44 +1902,42 @@ function Z(e, t, n) {
1902
1902
  details: n
1903
1903
  }, r = i.__plunoProductAgentDiagnostics__ ?? [];
1904
1904
  r.push(o), r.length > 120 && r.splice(0, r.length - 120), i.__plunoProductAgentDiagnostics__ = r, i.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
1905
- new CustomEvent(ha, { detail: o })
1905
+ new CustomEvent(ga, { detail: o })
1906
1906
  );
1907
1907
  }
1908
- function ja(e, t) {
1908
+ function qa(e, t) {
1909
1909
  Z("web-sdk.widget.position", e, t);
1910
1910
  }
1911
1911
  function on(e, t, n, i) {
1912
1912
  const o = t.value.trim();
1913
1913
  return !o && n.length === 0 ? n : (i(), t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
1914
- attachments: n.length > 0 ? n.map(Ya) : void 0
1914
+ attachments: n.length > 0 ? n.map(Va) : void 0
1915
1915
  }), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
1916
1916
  }
1917
- function Ka(e, t, n) {
1917
+ function ja(e, t, n) {
1918
1918
  const i = e.activeElement;
1919
1919
  return i === n ? "composer" : i === t ? "launcher" : null;
1920
1920
  }
1921
- function Va(e, t, n, i) {
1922
- if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > na)
1921
+ function Ka(e, t, n, i) {
1922
+ if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > ta)
1923
1923
  return;
1924
1924
  const o = e.focusedInput === "composer" ? i : n;
1925
1925
  o === i && !t.classList.contains("pluno-pa-widget--open") || o === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
1926
1926
  !o.isConnected || o.readOnly || (o.focus(), o.setSelectionRange(o.value.length, o.value.length));
1927
1927
  });
1928
1928
  }
1929
- function Ya(e) {
1929
+ function Va(e) {
1930
1930
  return e;
1931
1931
  }
1932
1932
  function lt(e) {
1933
- e.style.height = "0px";
1934
- const t = Math.max(22, Math.min(e.scrollHeight, 140));
1935
- e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
1933
+ e.style.height = "0px", e.style.height = `${e.scrollHeight}px`, e.style.overflowY = e.scrollHeight > e.clientHeight ? "auto" : "hidden";
1936
1934
  }
1937
1935
  function st(e, t = () => !0) {
1938
1936
  e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
1939
1937
  t() && (e.scrollTop = e.scrollHeight);
1940
1938
  });
1941
1939
  }
1942
- function Xa(e) {
1940
+ function Ya(e) {
1943
1941
  const t = e.messages[e.messages.length - 1];
1944
1942
  return [
1945
1943
  e.messages.length,
@@ -1950,13 +1948,13 @@ function Xa(e) {
1950
1948
  e.lastError ?? ""
1951
1949
  ].join(":");
1952
1950
  }
1953
- function Za(e) {
1951
+ function Xa(e) {
1954
1952
  return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
1955
1953
  }
1956
- function Ja(e) {
1954
+ function Za(e) {
1957
1955
  return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
1958
1956
  }
1959
- function Qa(e) {
1957
+ function Ja(e) {
1960
1958
  const t = e.currentPage;
1961
1959
  if (typeof t?.url == "string" && t.url.trim())
1962
1960
  try {
@@ -1967,7 +1965,7 @@ function Qa(e) {
1967
1965
  }
1968
1966
  return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
1969
1967
  }
1970
- function er(e, t) {
1968
+ function Qa(e, t) {
1971
1969
  const n = new Date(e).getTime();
1972
1970
  if (!Number.isFinite(n))
1973
1971
  return "now";
@@ -1983,9 +1981,9 @@ function er(e, t) {
1983
1981
  }
1984
1982
  return "now";
1985
1983
  }
1986
- function tr(e, t, n, i, o) {
1987
- e.appendChild(cr()), e.appendChild(
1988
- nr(
1984
+ function er(e, t, n, i, o) {
1985
+ e.appendChild(dr()), e.appendChild(
1986
+ tr(
1989
1987
  t,
1990
1988
  n,
1991
1989
  i,
@@ -1995,12 +1993,12 @@ function tr(e, t, n, i, o) {
1995
1993
  It(
1996
1994
  "pluno-pa-widget__close",
1997
1995
  "Close",
1998
- ur(16),
1996
+ cr(16),
1999
1997
  !0
2000
1998
  )
2001
- ), e.appendChild(or(n));
1999
+ ), e.appendChild(nr(n));
2002
2000
  }
2003
- function nr(e, t, n, i) {
2001
+ function tr(e, t, n, i) {
2004
2002
  const o = document.createElement("form");
2005
2003
  if (o.className = "pluno-pa-widget__launcher", i && o.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
2006
2004
  const s = document.createElement("button");
@@ -2028,7 +2026,7 @@ function nr(e, t, n, i) {
2028
2026
  }
2029
2027
  return o;
2030
2028
  }
2031
- function or(e) {
2029
+ function nr(e) {
2032
2030
  const t = document.createElement("section");
2033
2031
  t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
2034
2032
  Go("pluno-pa-widget__scribble-spirals--panel", 16)
@@ -2036,7 +2034,7 @@ function or(e) {
2036
2034
  const n = document.createElement("div");
2037
2035
  n.className = "pluno-pa-widget__timeline-wrap";
2038
2036
  const i = document.createElement("main");
2039
- i.className = "pluno-pa-widget__timeline", i.appendChild(sr(e));
2037
+ i.className = "pluno-pa-widget__timeline", i.appendChild(lr(e));
2040
2038
  const o = document.createElement("div");
2041
2039
  o.className = "pluno-pa-widget__timeline-bottom-sentinel", o.setAttribute("aria-hidden", "true"), i.appendChild(o), n.appendChild(i);
2042
2040
  const r = document.createElement("div");
@@ -2048,10 +2046,10 @@ function or(e) {
2048
2046
  It(
2049
2047
  "pluno-pa-widget__history",
2050
2048
  bn(),
2051
- hr(),
2049
+ gr(),
2052
2050
  !0
2053
2051
  )
2054
- ), n.appendChild(p), n.appendChild(lr()), t.appendChild(n), t.appendChild(ir()), t.appendChild(ar()), t.appendChild(rr()), t.appendChild(Ce("left", "Resize Pluno from left")), t.appendChild(
2052
+ ), n.appendChild(p), n.appendChild(rr()), t.appendChild(n), t.appendChild(or()), t.appendChild(ir()), t.appendChild(ar()), t.appendChild(Ce("left", "Resize Pluno from left")), t.appendChild(
2055
2053
  Ce("right", "Resize Pluno from right")
2056
2054
  ), t.appendChild(Ce("top", "Resize Pluno from top")), t.appendChild(
2057
2055
  Ce("bottom", "Resize Pluno from bottom")
@@ -2072,7 +2070,7 @@ function Ce(e, t) {
2072
2070
  `pluno-pa-widget__resize-handle--${e}`
2073
2071
  ].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
2074
2072
  }
2075
- function ir() {
2073
+ function or() {
2076
2074
  const e = document.createElement("div");
2077
2075
  e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
2078
2076
  const t = document.createElement("span");
@@ -2086,7 +2084,7 @@ function ir() {
2086
2084
  const r = document.createElement("button");
2087
2085
  return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(i, o, r), e.append(t, n), e;
2088
2086
  }
2089
- function ar() {
2087
+ function ir() {
2090
2088
  const e = document.createElement("div");
2091
2089
  e.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", e.hidden = !0;
2092
2090
  const t = document.createElement("span");
@@ -2098,7 +2096,7 @@ function ar() {
2098
2096
  const o = document.createElement("button");
2099
2097
  return o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", o.textContent = "Not now", n.append(i, o), e.append(t, n), e;
2100
2098
  }
2101
- function rr() {
2099
+ function ar() {
2102
2100
  const e = document.createElement("form");
2103
2101
  e.className = "pluno-pa-widget__composer";
2104
2102
  const t = document.createElement("div");
@@ -2112,7 +2110,7 @@ function rr() {
2112
2110
  const r = document.createElement("input");
2113
2111
  r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), o.appendChild(r);
2114
2112
  const l = document.createElement("button");
2115
- l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(fr()), l.appendChild(wr()), o.appendChild(l);
2113
+ l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(mr()), l.appendChild(fr()), o.appendChild(l);
2116
2114
  const p = document.createElement("textarea");
2117
2115
  p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", o.appendChild(p);
2118
2116
  const s = document.createElement("button");
@@ -2127,7 +2125,7 @@ function rr() {
2127
2125
  function bn() {
2128
2126
  return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
2129
2127
  }
2130
- function lr() {
2128
+ function rr() {
2131
2129
  const e = document.createElement("section");
2132
2130
  e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", bn());
2133
2131
  const t = document.createElement("div");
@@ -2137,7 +2135,7 @@ function lr() {
2137
2135
  const i = It(
2138
2136
  "pluno-pa-widget__history-close",
2139
2137
  "Close recent chats",
2140
- mr(),
2138
+ hr(),
2141
2139
  !1
2142
2140
  );
2143
2141
  t.append(n, i);
@@ -2146,7 +2144,7 @@ function lr() {
2146
2144
  const r = document.createElement("p");
2147
2145
  return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, o, r), e;
2148
2146
  }
2149
- function sr(e) {
2147
+ function lr(e) {
2150
2148
  const t = document.createElement("div");
2151
2149
  return t.className = "pluno-pa-widget__empty-state", t.appendChild(
2152
2150
  ke(
@@ -2174,14 +2172,14 @@ function Wo(e, t) {
2174
2172
  function ke(e, t) {
2175
2173
  const n = `pluno-pa-character-${oo}`;
2176
2174
  oo += 1;
2177
- const i = t.scribbleStyle ? dr(t.accentColor, n) : pr(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
2175
+ const i = t.scribbleStyle ? pr(t.accentColor, n) : sr(t.accentColor, n), o = e.split(/\s+/).filter(Boolean);
2178
2176
  return i.setAttribute(
2179
2177
  "class",
2180
2178
  o.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
2181
2179
  ), i.setAttribute("aria-hidden", "true"), i.setAttribute("focusable", "false"), i.removeAttribute("role"), i.removeAttribute("aria-label"), i;
2182
2180
  }
2183
- function pr(e, t) {
2184
- const n = Ti(e), i = {
2181
+ function sr(e, t) {
2182
+ const n = Li(e), i = {
2185
2183
  boltFill: `${t}-boltFill`,
2186
2184
  boltEdge: `${t}-boltEdge`,
2187
2185
  boltGlow: `${t}-boltGlow`,
@@ -2279,7 +2277,7 @@ function pr(e, t) {
2279
2277
  in2: "innerLight",
2280
2278
  mode: "screen"
2281
2279
  });
2282
- const y = x(r, "filter", {
2280
+ const v = x(r, "filter", {
2283
2281
  id: i.eyeShadow,
2284
2282
  x: "-24%",
2285
2283
  y: "-20%",
@@ -2287,14 +2285,14 @@ function pr(e, t) {
2287
2285
  height: "148%",
2288
2286
  "color-interpolation-filters": "sRGB"
2289
2287
  });
2290
- x(y, "feDropShadow", {
2288
+ x(v, "feDropShadow", {
2291
2289
  dx: "0",
2292
2290
  dy: "8",
2293
2291
  stdDeviation: "5",
2294
2292
  "flood-color": n.shadow,
2295
2293
  "flood-opacity": "0.3"
2296
2294
  });
2297
- const A = x(r, "filter", {
2295
+ const E = x(r, "filter", {
2298
2296
  id: i.pupilGloss,
2299
2297
  x: "-15%",
2300
2298
  y: "-15%",
@@ -2302,7 +2300,7 @@ function pr(e, t) {
2302
2300
  height: "130%",
2303
2301
  "color-interpolation-filters": "sRGB"
2304
2302
  });
2305
- x(A, "feDropShadow", {
2303
+ x(E, "feDropShadow", {
2306
2304
  dx: "0",
2307
2305
  dy: "3",
2308
2306
  stdDeviation: "3",
@@ -2377,7 +2375,7 @@ function pr(e, t) {
2377
2375
  i
2378
2376
  ), o;
2379
2377
  }
2380
- function dr(e, t) {
2378
+ function pr(e, t) {
2381
2379
  const n = Lo(e), i = {
2382
2380
  clip: `${t}-scribbleBoltClip`,
2383
2381
  wobble: `${t}-scribbleBoltWobble`
@@ -2408,7 +2406,7 @@ function dr(e, t) {
2408
2406
  "clip-path": J(i.clip)
2409
2407
  });
2410
2408
  return x(c, "path", {
2411
- d: Li(),
2409
+ d: ki(),
2412
2410
  fill: "none",
2413
2411
  stroke: n,
2414
2412
  "stroke-width": "56",
@@ -2443,7 +2441,7 @@ function dr(e, t) {
2443
2441
  ), o;
2444
2442
  }
2445
2443
  function Ho() {
2446
- return T("svg", {
2444
+ return A("svg", {
2447
2445
  xmlns: zo,
2448
2446
  viewBox: "0 0 1254 1254"
2449
2447
  });
@@ -2494,7 +2492,7 @@ function go(e, t, n, i, o, r, l, p) {
2494
2492
  });
2495
2493
  }
2496
2494
  function x(e, t, n = {}) {
2497
- const i = T(t, n);
2495
+ const i = A(t, n);
2498
2496
  return e.appendChild(i), i;
2499
2497
  }
2500
2498
  function G(e, t, n, i) {
@@ -2508,14 +2506,14 @@ function It(e, t, n, i) {
2508
2506
  const o = document.createElement("button");
2509
2507
  return o.type = "button", o.className = e, o.setAttribute("aria-label", t), o.title = t, o.hidden = i, o.appendChild(n), o;
2510
2508
  }
2511
- function cr() {
2512
- const e = T("svg", {
2509
+ function dr() {
2510
+ const e = A("svg", {
2513
2511
  class: "pluno-pa-widget__scribble-defs",
2514
2512
  "aria-hidden": "true",
2515
2513
  focusable: "false",
2516
2514
  width: "0",
2517
2515
  height: "0"
2518
- }), t = T("defs");
2516
+ }), t = A("defs");
2519
2517
  return t.appendChild(rn("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2520
2518
  rn("pluno-pa-scribble-wobble-2", "5", "15")
2521
2519
  ), t.appendChild(
@@ -2523,7 +2521,7 @@ function cr() {
2523
2521
  ), e.appendChild(t), e;
2524
2522
  }
2525
2523
  function Go(e, t) {
2526
- const n = T("svg", {
2524
+ const n = A("svg", {
2527
2525
  class: `pluno-pa-widget__scribble-spirals ${e}`,
2528
2526
  preserveAspectRatio: "xMidYMid meet",
2529
2527
  "aria-hidden": "true",
@@ -2538,7 +2536,7 @@ function an(e, t) {
2538
2536
  0,
2539
2537
  t - mn * 2
2540
2538
  ), i = Math.max(
2541
- Ta,
2539
+ La,
2542
2540
  Math.floor(
2543
2541
  (n - hn * 2) / gn
2544
2542
  )
@@ -2551,14 +2549,14 @@ function $o(e, t) {
2551
2549
  const n = t * gn + hn * 2;
2552
2550
  e.dataset.spiralCount = `${t}`, e.setAttribute(
2553
2551
  "viewBox",
2554
- `0 0 ${n} ${La}`
2552
+ `0 0 ${n} ${ka}`
2555
2553
  ), e.replaceChildren();
2556
2554
  for (let i = 0; i < t; i += 1) {
2557
- const o = no[i % no.length], r = T("g", {
2555
+ const o = no[i % no.length], r = A("g", {
2558
2556
  transform: `translate(${hn + i * gn} 0)`
2559
2557
  });
2560
2558
  r.appendChild(
2561
- T("ellipse", {
2559
+ A("ellipse", {
2562
2560
  cx: o.ellipseCx,
2563
2561
  cy: o.ellipseCy,
2564
2562
  rx: o.ellipseRx,
@@ -2569,7 +2567,7 @@ function $o(e, t) {
2569
2567
  opacity: "0.8"
2570
2568
  })
2571
2569
  ), r.appendChild(
2572
- T("path", {
2570
+ A("path", {
2573
2571
  d: o.path,
2574
2572
  fill: "none",
2575
2573
  stroke: "#2c2a1e",
@@ -2580,7 +2578,7 @@ function $o(e, t) {
2580
2578
  }
2581
2579
  }
2582
2580
  function rn(e, t, n) {
2583
- const i = T("filter", {
2581
+ const i = A("filter", {
2584
2582
  id: e,
2585
2583
  x: "-8%",
2586
2584
  y: "-8%",
@@ -2588,7 +2586,7 @@ function rn(e, t, n) {
2588
2586
  height: "116%"
2589
2587
  });
2590
2588
  return i.appendChild(
2591
- T("feTurbulence", {
2589
+ A("feTurbulence", {
2592
2590
  type: "fractalNoise",
2593
2591
  baseFrequency: "0.012 0.028",
2594
2592
  numOctaves: "3",
@@ -2596,7 +2594,7 @@ function rn(e, t, n) {
2596
2594
  result: "stroke-noise"
2597
2595
  })
2598
2596
  ), i.appendChild(
2599
- T("feDisplacementMap", {
2597
+ A("feDisplacementMap", {
2600
2598
  in: "SourceGraphic",
2601
2599
  in2: "stroke-noise",
2602
2600
  scale: "3.5",
@@ -2605,7 +2603,7 @@ function rn(e, t, n) {
2605
2603
  result: "warped"
2606
2604
  })
2607
2605
  ), i.appendChild(
2608
- T("feTurbulence", {
2606
+ A("feTurbulence", {
2609
2607
  type: "fractalNoise",
2610
2608
  baseFrequency: "0.7",
2611
2609
  numOctaves: "1",
@@ -2613,7 +2611,7 @@ function rn(e, t, n) {
2613
2611
  result: "ink-noise"
2614
2612
  })
2615
2613
  ), i.appendChild(
2616
- T("feDisplacementMap", {
2614
+ A("feDisplacementMap", {
2617
2615
  in: "warped",
2618
2616
  in2: "ink-noise",
2619
2617
  scale: "0.9",
@@ -2622,7 +2620,7 @@ function rn(e, t, n) {
2622
2620
  })
2623
2621
  ), i;
2624
2622
  }
2625
- function ur(e) {
2623
+ function cr(e) {
2626
2624
  const t = de(
2627
2625
  "0 0 24 24",
2628
2626
  e,
@@ -2631,9 +2629,9 @@ function ur(e) {
2631
2629
  "currentColor",
2632
2630
  "2.25"
2633
2631
  );
2634
- return t.appendChild(T("path", { d: "m6 9 6 6 6-6" })), t;
2632
+ return t.appendChild(A("path", { d: "m6 9 6 6 6-6" })), t;
2635
2633
  }
2636
- function gr() {
2634
+ function ur() {
2637
2635
  const e = de(
2638
2636
  "0 0 24 24",
2639
2637
  17,
@@ -2643,16 +2641,16 @@ function gr() {
2643
2641
  "2.25"
2644
2642
  );
2645
2643
  return e.appendChild(
2646
- T("path", {
2644
+ A("path", {
2647
2645
  d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
2648
2646
  })
2649
2647
  ), e.appendChild(
2650
- T("path", {
2648
+ A("path", {
2651
2649
  d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
2652
2650
  })
2653
2651
  ), e;
2654
2652
  }
2655
- function hr() {
2653
+ function gr() {
2656
2654
  const e = de(
2657
2655
  "0 0 24 24",
2658
2656
  17,
@@ -2661,9 +2659,9 @@ function hr() {
2661
2659
  "currentColor",
2662
2660
  "2.25"
2663
2661
  );
2664
- return e.appendChild(T("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(T("path", { d: "M3 4v5h5" })), e.appendChild(T("path", { d: "M12 7v5l3 2" })), e;
2662
+ return e.appendChild(A("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(A("path", { d: "M3 4v5h5" })), e.appendChild(A("path", { d: "M12 7v5l3 2" })), e;
2665
2663
  }
2666
- function mr() {
2664
+ function hr() {
2667
2665
  const e = de(
2668
2666
  "0 0 24 24",
2669
2667
  15,
@@ -2672,7 +2670,7 @@ function mr() {
2672
2670
  "currentColor",
2673
2671
  "2.4"
2674
2672
  );
2675
- return e.appendChild(T("path", { d: "M18 6 6 18" })), e.appendChild(T("path", { d: "m6 6 12 12" })), e;
2673
+ return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
2676
2674
  }
2677
2675
  function qo() {
2678
2676
  const e = de(
@@ -2684,10 +2682,10 @@ function qo() {
2684
2682
  "2.75"
2685
2683
  );
2686
2684
  return e.appendChild(
2687
- T("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2688
- ), e.appendChild(T("polyline", { points: "5 12 12 5 19 12" })), e;
2685
+ A("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2686
+ ), e.appendChild(A("polyline", { points: "5 12 12 5 19 12" })), e;
2689
2687
  }
2690
- function fr() {
2688
+ function mr() {
2691
2689
  const e = de(
2692
2690
  "0 0 24 24",
2693
2691
  16,
@@ -2700,18 +2698,18 @@ function fr() {
2700
2698
  "class",
2701
2699
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
2702
2700
  ), e.appendChild(
2703
- T("path", {
2701
+ A("path", {
2704
2702
  d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
2705
2703
  })
2706
2704
  ), e;
2707
2705
  }
2708
- function wr() {
2706
+ function fr() {
2709
2707
  const e = de("0 0 24 24", 19, 19, "none", "currentColor");
2710
2708
  return e.setAttribute(
2711
2709
  "class",
2712
2710
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
2713
2711
  ), e.appendChild(
2714
- T("path", {
2712
+ A("path", {
2715
2713
  d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
2716
2714
  stroke: "currentColor",
2717
2715
  "stroke-width": "2",
@@ -2720,10 +2718,10 @@ function wr() {
2720
2718
  })
2721
2719
  ), e;
2722
2720
  }
2723
- function br() {
2721
+ function wr() {
2724
2722
  const e = de("0 0 24 24", 18, 18, "currentColor");
2725
2723
  return e.appendChild(
2726
- T("rect", {
2724
+ A("rect", {
2727
2725
  x: "6",
2728
2726
  y: "6",
2729
2727
  width: "12",
@@ -2732,7 +2730,7 @@ function br() {
2732
2730
  })
2733
2731
  ), e;
2734
2732
  }
2735
- function _r() {
2733
+ function br() {
2736
2734
  const e = de(
2737
2735
  "0 0 24 24",
2738
2736
  12,
@@ -2741,9 +2739,9 @@ function _r() {
2741
2739
  "currentColor",
2742
2740
  "2.4"
2743
2741
  );
2744
- return e.appendChild(T("path", { d: "M18 6 6 18" })), e.appendChild(T("path", { d: "m6 6 12 12" })), e;
2742
+ return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
2745
2743
  }
2746
- function xr() {
2744
+ function _r() {
2747
2745
  const e = de(
2748
2746
  "0 0 24 24",
2749
2747
  13,
@@ -2753,7 +2751,7 @@ function xr() {
2753
2751
  "2.25"
2754
2752
  );
2755
2753
  return e.appendChild(
2756
- T("rect", {
2754
+ A("rect", {
2757
2755
  width: "14",
2758
2756
  height: "14",
2759
2757
  x: "8",
@@ -2762,7 +2760,7 @@ function xr() {
2762
2760
  ry: "2"
2763
2761
  })
2764
2762
  ), e.appendChild(
2765
- T("path", {
2763
+ A("path", {
2766
2764
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
2767
2765
  })
2768
2766
  ), e;
@@ -2775,9 +2773,9 @@ function de(e, t, n, i, o, r) {
2775
2773
  fill: i,
2776
2774
  "aria-hidden": "true"
2777
2775
  };
2778
- return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), T("svg", l);
2776
+ return o && (l.stroke = o, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), A("svg", l);
2779
2777
  }
2780
- function T(e, t = {}) {
2778
+ function A(e, t = {}) {
2781
2779
  const n = document.createElementNS(zo, e);
2782
2780
  for (const [i, o] of Object.entries(t))
2783
2781
  n.setAttribute(i, o);
@@ -2789,18 +2787,18 @@ function ho(e) {
2789
2787
  n.stopPropagation();
2790
2788
  });
2791
2789
  }
2792
- function yr(e, t, n) {
2790
+ function xr(e, t, n) {
2793
2791
  e.replaceChildren(), e.hidden = t.length === 0;
2794
2792
  for (const [i, o] of t.entries()) {
2795
2793
  const r = document.createElement("div");
2796
- r.className = "pluno-pa-widget__attachment", r.appendChild(vr(o));
2794
+ r.className = "pluno-pa-widget__attachment", r.appendChild(yr(o));
2797
2795
  const l = document.createElement("span");
2798
2796
  l.textContent = o.name, r.appendChild(l);
2799
2797
  const p = document.createElement("button");
2800
- p.type = "button", p.setAttribute("aria-label", `Remove ${o.name}`), p.appendChild(_r()), p.addEventListener("click", () => n(i)), r.appendChild(p), e.appendChild(r);
2798
+ p.type = "button", p.setAttribute("aria-label", `Remove ${o.name}`), p.appendChild(br()), p.addEventListener("click", () => n(i)), r.appendChild(p), e.appendChild(r);
2801
2799
  }
2802
2800
  }
2803
- function vr(e) {
2801
+ function yr(e) {
2804
2802
  const t = Cn(e), n = jo(e);
2805
2803
  if (t === "image" && n) {
2806
2804
  const i = document.createElement("img");
@@ -2821,7 +2819,7 @@ function vr(e) {
2821
2819
  }
2822
2820
  return pe(e);
2823
2821
  }
2824
- function Sr(e, t) {
2822
+ function vr(e, t) {
2825
2823
  const n = Cn(e), i = jo(e);
2826
2824
  if (n === "image" && i) {
2827
2825
  const o = document.createElement("img");
@@ -2883,13 +2881,13 @@ function mo(e) {
2883
2881
  const t = Cn(e);
2884
2882
  return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
2885
2883
  }
2886
- function Cr(e, t) {
2884
+ function Sr(e, t) {
2887
2885
  return t ? Array.from(t).map((i) => ({
2888
2886
  ...e.createLocalAttachment(i),
2889
- previewUrl: Er(i)
2887
+ previewUrl: Cr(i)
2890
2888
  })) : [];
2891
2889
  }
2892
- function Er(e) {
2890
+ function Cr(e) {
2893
2891
  return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
2894
2892
  }
2895
2893
  function vt(e) {
@@ -2901,10 +2899,10 @@ function ln(e, t, n = null) {
2901
2899
  return;
2902
2900
  }
2903
2901
  e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || En(n) ? e.appendChild(
2904
- kr(t, n)
2905
- ) : Ko(t) && e.appendChild(Lr(t));
2902
+ Er(t, n)
2903
+ ) : Ko(t) && e.appendChild(kr(t));
2906
2904
  }
2907
- function kr(e, t) {
2905
+ function Er(e, t) {
2908
2906
  const n = document.createElement("div");
2909
2907
  n.className = "pluno-pa-widget__billing-action-card";
2910
2908
  const i = e.limitExceeded || t === "limit_exceeded", o = document.createElement("strong");
@@ -2918,13 +2916,13 @@ function kr(e, t) {
2918
2916
  )
2919
2917
  ), n;
2920
2918
  }
2921
- function Lr(e) {
2919
+ function kr(e) {
2922
2920
  const t = document.createElement("div");
2923
2921
  t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
2924
2922
  const n = document.createElement("strong");
2925
2923
  n.textContent = "Credits running low", t.appendChild(n);
2926
2924
  const i = document.createElement("span");
2927
- return i.textContent = Ar(e) ?? "Credits are running low for this period.", t.appendChild(i), t.appendChild(
2925
+ return i.textContent = Tr(e) ?? "Credits are running low for this period.", t.appendChild(i), t.appendChild(
2928
2926
  Vo(
2929
2927
  e,
2930
2928
  "Upgrade",
@@ -2936,9 +2934,9 @@ function _n(e, t) {
2936
2934
  return e !== null && (le(e) || Ko(e) || En(t));
2937
2935
  }
2938
2936
  function fo(e, t, n) {
2939
- return _n(t, n) || Tr(t) ? !0 : !_n(e, n);
2937
+ return _n(t, n) || Lr(t) ? !0 : !_n(e, n);
2940
2938
  }
2941
- function Tr(e) {
2939
+ function Lr(e) {
2942
2940
  return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || le(e));
2943
2941
  }
2944
2942
  function le(e) {
@@ -2950,10 +2948,10 @@ function En(e) {
2950
2948
  function Ko(e) {
2951
2949
  return !le(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2952
2950
  }
2953
- function Ar(e) {
2954
- return e.creditsRemaining === null ? null : `${Ir(e.creditsRemaining)} credits left`;
2951
+ function Tr(e) {
2952
+ return e.creditsRemaining === null ? null : `${Ar(e.creditsRemaining)} credits left`;
2955
2953
  }
2956
- function Ir(e) {
2954
+ function Ar(e) {
2957
2955
  return new Intl.NumberFormat("en-US", {
2958
2956
  maximumFractionDigits: 0
2959
2957
  }).format(Math.ceil(e));
@@ -2982,24 +2980,24 @@ function sn(e, t) {
2982
2980
  (i) => !Xo(i)
2983
2981
  ).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
2984
2982
  }
2985
- function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
2986
- const te = Dr(r), W = Or(
2983
+ function Ir(e, t, n, i, o, r, l, p, s, c, g, h, m, v, E, O, u, F, w, R, z, L) {
2984
+ const te = zr(r), W = Dr(
2987
2985
  te.filter((S) => !Xo(S))
2988
2986
  ), Ye = e.scrollTop, Be = [], ce = /* @__PURE__ */ new Set(), U = (S) => {
2989
2987
  Be.push(S);
2990
2988
  };
2991
- ei(n, r.isThinking), o.hidden = !p, p && l !== null && Wo(o, l);
2992
- const v = W.length > 0 || !!r.assistantDraft || r.isThinking;
2993
- if (i(v), u || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2989
+ Qo(n, r.isThinking), o.hidden = !p, p && l !== null && Wo(o, l);
2990
+ const y = W.length > 0 || !!r.assistantDraft || r.isThinking;
2991
+ if (i(y), u || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2994
2992
  const S = document.createElement("div");
2995
2993
  S.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (u ? " pluno-pa-widget__empty-state--morning-report" : "");
2996
- const L = document.createElement("div");
2997
- L.className = "pluno-pa-widget__empty-hero";
2994
+ const T = document.createElement("div");
2995
+ T.className = "pluno-pa-widget__empty-hero";
2998
2996
  const P = ke(
2999
2997
  "pluno-pa-widget__character--empty",
3000
- y()
2998
+ v()
3001
2999
  );
3002
- if (L.appendChild(P), S.appendChild(L), u) {
3000
+ if (T.appendChild(P), S.appendChild(T), u) {
3003
3001
  const b = document.createElement("h2");
3004
3002
  b.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", b.textContent = u.opening, S.appendChild(b);
3005
3003
  } else
@@ -3007,18 +3005,18 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
3007
3005
  const ye = u?.prompts ?? r.starterPrompts, ne = document.createElement("div");
3008
3006
  if (ne.className = ye.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", ye.length === 0 && !r.starterPromptsLoading && ne.setAttribute("aria-hidden", "true"), ye.length > 0)
3009
3007
  for (const b of ye) {
3010
- const E = document.createElement("button");
3011
- E.type = "button", E.className = "pluno-pa-widget__starter-prompt", E.textContent = `"${b}"`, E.addEventListener("click", () => {
3012
- A(b);
3013
- }), ne.appendChild(E);
3008
+ const k = document.createElement("button");
3009
+ k.type = "button", k.className = "pluno-pa-widget__starter-prompt", k.textContent = `"${b}"`, k.addEventListener("click", () => {
3010
+ E(b);
3011
+ }), ne.appendChild(k);
3014
3012
  }
3015
3013
  else if (r.starterPromptsLoading) {
3016
3014
  const b = document.createElement("button");
3017
3015
  b.type = "button", b.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", b.disabled = !0, b.tabIndex = -1, b.textContent = "Generating example tasks...", ne.appendChild(b);
3018
3016
  } else
3019
- for (let b = 0; b < ma; b += 1) {
3020
- const E = document.createElement("button");
3021
- E.type = "button", E.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", E.disabled = !0, E.tabIndex = -1, E.textContent = "", ne.appendChild(E);
3017
+ for (let b = 0; b < ha; b += 1) {
3018
+ const k = document.createElement("button");
3019
+ k.type = "button", k.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", k.disabled = !0, k.tabIndex = -1, k.textContent = "", ne.appendChild(k);
3022
3020
  }
3023
3021
  if (S.appendChild(ne), u) {
3024
3022
  const b = document.createElement("button");
@@ -3028,33 +3026,33 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
3028
3026
  return;
3029
3027
  }
3030
3028
  let B = null, $ = null, X = [], Le = [];
3031
- const K = W.length - 1, ct = K >= 0 && xn(W[K]), Te = Ur(W);
3029
+ const K = W.length - 1, ct = K >= 0 && xn(W[K]), Te = Or(W);
3032
3030
  let ue = !1;
3033
3031
  const ge = () => {
3034
3032
  if (X.length === 0)
3035
3033
  return ue = !1, !1;
3036
3034
  const S = Te !== null && X.some(
3037
3035
  (P) => Yo(P, Te)
3038
- ), L = jr(
3036
+ ), T = qr(
3039
3037
  X,
3040
3038
  S,
3041
3039
  g,
3042
3040
  m,
3043
- y()
3041
+ v()
3044
3042
  );
3045
- return U(L), B = null, $ = L, X = [], ue = S, !0;
3043
+ return U(T), B = null, $ = T, X = [], ue = S, !0;
3046
3044
  }, M = () => {
3047
3045
  for (const S of Le)
3048
3046
  U(S), B = null, $ = S;
3049
3047
  Le = [];
3050
3048
  };
3051
3049
  for (let S = 0; S < W.length; S += 1) {
3052
- const L = W[S];
3053
- if (L.role === "tool" && L.integrationAuthRequest && z) {
3054
- const b = Nr(
3055
- L.integrationAuthRequest,
3050
+ const T = W[S];
3051
+ if (T.role === "tool" && T.integrationAuthRequest && z) {
3052
+ const b = Pr(
3053
+ T.integrationAuthRequest,
3056
3054
  z.states.get(
3057
- L.integrationAuthRequest.authRequestId
3055
+ T.integrationAuthRequest.authRequestId
3058
3056
  ) ?? {
3059
3057
  status: z.initialStatus
3060
3058
  },
@@ -3063,52 +3061,52 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
3063
3061
  Le.push(b);
3064
3062
  continue;
3065
3063
  }
3066
- if (L.role === "tool") {
3067
- X.push(L);
3064
+ if (T.role === "tool") {
3065
+ X.push(T);
3068
3066
  continue;
3069
3067
  }
3070
- if (xn(L)) {
3068
+ if (xn(T)) {
3071
3069
  if (S !== K)
3072
3070
  continue;
3073
3071
  if (ge()) {
3074
3072
  if (!ue) {
3075
- const E = dt();
3076
- U(E), B = null, $ = E;
3073
+ const k = dt();
3074
+ U(k), B = null, $ = k;
3077
3075
  }
3078
3076
  } else {
3079
- const E = yo(y());
3080
- U(E), B = null, $ = E;
3077
+ const k = yo(v());
3078
+ U(k), B = null, $ = k;
3081
3079
  }
3082
3080
  continue;
3083
3081
  }
3084
- if (L.role === "system") {
3085
- if (L.dataType === "run_error" || L.dataType === "run_status") {
3082
+ if (T.role === "system") {
3083
+ if (T.dataType === "run_error" || T.dataType === "run_status") {
3086
3084
  ge();
3087
- const b = document.createElement("div"), E = L.dataType === "run_error";
3088
- if (b.className = E ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", b.textContent = yn(
3089
- L.content
3090
- ), E && L.securitySettingsUrl) {
3085
+ const b = document.createElement("div"), k = T.dataType === "run_error";
3086
+ if (b.className = k ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", b.textContent = yn(
3087
+ T.content
3088
+ ), k && T.securitySettingsUrl) {
3091
3089
  const q = document.createElement("a");
3092
- q.className = "pluno-pa-widget__error-retry", q.href = L.securitySettingsUrl, q.target = "_blank", q.rel = "noreferrer", q.textContent = "Security settings", b.appendChild(q);
3090
+ q.className = "pluno-pa-widget__error-retry", q.href = T.securitySettingsUrl, q.target = "_blank", q.rel = "noreferrer", q.textContent = "Security settings", b.appendChild(q);
3093
3091
  }
3094
- U(b), B = E ? b : null, $ = E ? null : b, M();
3092
+ U(b), B = k ? b : null, $ = k ? null : b, M();
3095
3093
  }
3096
3094
  continue;
3097
3095
  }
3098
- L.role === "user" && M();
3099
- const P = ge(), ye = yn(L.content);
3100
- if (L.role === "assistant" && !P) {
3101
- const b = Jo(y());
3096
+ T.role === "user" && M();
3097
+ const P = ge(), ye = yn(T.content);
3098
+ if (T.role === "assistant" && !P) {
3099
+ const b = Jo(v());
3102
3100
  U(b), B = null, $ = b;
3103
3101
  }
3104
- const ne = Rr(
3105
- L,
3102
+ const ne = Nr(
3103
+ T,
3106
3104
  ye,
3107
3105
  h,
3108
3106
  ce,
3109
3107
  R
3110
3108
  );
3111
- U(ne), B = ne, $ = null, L.role === "assistant" && M();
3109
+ U(ne), B = ne, $ = null, T.role === "assistant" && M();
3112
3110
  }
3113
3111
  const Xe = ge(), Ae = W[W.length - 1]?.role === "assistant";
3114
3112
  if (r.isThinking && !Ae && !ct)
@@ -3118,14 +3116,14 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
3118
3116
  U(S), B = null, $ = S;
3119
3117
  }
3120
3118
  } else {
3121
- const S = yo(y());
3119
+ const S = yo(v());
3122
3120
  U(S), B = null, $ = S;
3123
3121
  }
3124
3122
  if (r.lastError) {
3125
3123
  const S = document.createElement("div");
3126
3124
  S.className = "pluno-pa-widget__error";
3127
- const L = document.createElement("span");
3128
- if (L.textContent = r.lastError, S.appendChild(L), r.lastErrorSecuritySettingsUrl) {
3125
+ const T = document.createElement("span");
3126
+ if (T.textContent = r.lastError, S.appendChild(T), r.lastErrorSecuritySettingsUrl) {
3129
3127
  const P = document.createElement("a");
3130
3128
  P.className = "pluno-pa-widget__error-retry", P.href = r.lastErrorSecuritySettingsUrl, P.target = "_blank", P.rel = "noreferrer", P.textContent = "Security settings", S.appendChild(P);
3131
3129
  }
@@ -3138,30 +3136,30 @@ function Pr(e, t, n, i, o, r, l, p, s, c, g, h, m, y, A, O, u, F, w, R, z, k) {
3138
3136
  }
3139
3137
  U(S), B = S, $ = null;
3140
3138
  }
3141
- const Ie = k ? k.actionCandidate ?? (r.isThinking ? null : Ni(te)) : null;
3142
- if (k && Ie && !k.dismissedCandidateIds.has(Ie.id)) {
3143
- const S = Gr(Ie, {
3144
- isActing: k.actionCandidate?.id === Ie.id,
3145
- error: k.error,
3146
- characterIconOptions: k.characterIconOptions,
3147
- socialPostRewardsUrl: k.socialPostRewardsUrl,
3148
- onReferralCopy: k.onReferralCopy,
3149
- onSocialShare: k.onSocialShare,
3150
- onDismiss: k.onDismiss,
3151
- onDisable: k.onDisable
3139
+ const Ie = L ? L.actionCandidate ?? (r.isThinking ? null : Pi(te)) : null;
3140
+ if (L && Ie && !L.dismissedCandidateIds.has(Ie.id)) {
3141
+ const S = Hr(Ie, {
3142
+ isActing: L.actionCandidate?.id === Ie.id,
3143
+ error: L.error,
3144
+ characterIconOptions: L.characterIconOptions,
3145
+ socialPostRewardsUrl: L.socialPostRewardsUrl,
3146
+ onReferralCopy: L.onReferralCopy,
3147
+ onSocialShare: L.onSocialShare,
3148
+ onDismiss: L.onDismiss,
3149
+ onDisable: L.onDisable
3152
3150
  });
3153
- U(S), k.onSeen(Ie), B = null, $ = S;
3151
+ U(S), L.onSeen(Ie), B = null, $ = S;
3154
3152
  }
3155
3153
  M(), B?.classList.add(
3156
3154
  "pluno-pa-widget__message--bottom-reserve"
3157
3155
  ), $?.classList.add(
3158
3156
  "pluno-pa-widget__bottom-reserve-compact"
3159
- ), U(t), zr(
3157
+ ), U(t), Mr(
3160
3158
  h,
3161
3159
  ce
3162
3160
  ), bo(e, Be), s ? st(e, c) : e.scrollTop = Ye;
3163
3161
  }
3164
- function Nr(e, t, n) {
3162
+ function Pr(e, t, n) {
3165
3163
  const i = document.createElement("section");
3166
3164
  i.className = "pluno-pa-widget__integration-auth-card", i.setAttribute("aria-label", `Connect ${e.appName}`);
3167
3165
  const o = document.createElement("div");
@@ -3179,25 +3177,25 @@ function Nr(e, t, n) {
3179
3177
  const s = document.createElement("button");
3180
3178
  return s.type = "button", s.className = "pluno-pa-widget__integration-auth-button", s.disabled = t.status === "checking" || t.status === "connecting" || t.status === "completed", t.status === "checking" ? s.textContent = "Checking connection..." : t.status === "connecting" ? s.textContent = "Connecting..." : t.status === "completed" ? s.textContent = "Connected" : t.status === "expired" || t.status === "cancelled" ? s.textContent = `Reconnect ${e.appName}` : t.status === "error" ? s.textContent = "Try again" : s.textContent = `Connect ${e.appName}`, s.addEventListener("click", () => n(e)), i.appendChild(s), i;
3181
3179
  }
3182
- function Rr(e, t, n, i, o) {
3183
- const r = Mr(e, t), l = r ? n.get(r) : void 0;
3180
+ function Nr(e, t, n, i, o) {
3181
+ const r = Rr(e, t), l = r ? n.get(r) : void 0;
3184
3182
  if (r && l)
3185
3183
  return l.classList.remove(
3186
3184
  "pluno-pa-widget__message--bottom-reserve"
3187
3185
  ), i.add(r), l;
3188
3186
  const p = document.createElement("div");
3189
3187
  if (p.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? (e.phase && (p.dataset.phase = e.phase), Zr(p, t)) : p.textContent = t, e.role === "user" && e.attachments?.length && p.appendChild(
3190
- Wr(
3188
+ Fr(
3191
3189
  e.attachments,
3192
3190
  o
3193
3191
  )
3194
3192
  ), e.phase !== "commentary") {
3195
3193
  const s = document.createElement("div");
3196
- s.className = "pluno-pa-widget__message-actions", s.appendChild(Hr(t)), p.appendChild(s);
3194
+ s.className = "pluno-pa-widget__message-actions", s.appendChild(Wr(t)), p.appendChild(s);
3197
3195
  }
3198
3196
  return r && (n.set(r, p), i.add(r)), p;
3199
3197
  }
3200
- function Mr(e, t) {
3198
+ function Rr(e, t) {
3201
3199
  return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
3202
3200
  id: e.id,
3203
3201
  content: t,
@@ -3215,7 +3213,7 @@ function Mr(e, t) {
3215
3213
  })
3216
3214
  });
3217
3215
  }
3218
- function zr(e, t) {
3216
+ function Mr(e, t) {
3219
3217
  for (const n of e.keys())
3220
3218
  t.has(n) || e.delete(n);
3221
3219
  }
@@ -3233,7 +3231,7 @@ function bo(e, t) {
3233
3231
  n = n.nextSibling, e.removeChild(i);
3234
3232
  }
3235
3233
  }
3236
- function Dr(e) {
3234
+ function zr(e) {
3237
3235
  if (!e.assistantDraft)
3238
3236
  return [...e.messages];
3239
3237
  const t = {
@@ -3271,26 +3269,26 @@ function Dr(e) {
3271
3269
  ...e.messages.slice(o)
3272
3270
  ];
3273
3271
  }
3274
- function Or(e) {
3272
+ function Dr(e) {
3275
3273
  return e.map(
3276
3274
  (t) => t.role === "assistant" && t.phase === "commentary" ? { ...t, role: "tool" } : t
3277
3275
  );
3278
3276
  }
3279
- function Ur(e) {
3277
+ function Or(e) {
3280
3278
  const t = [...e].reverse().find((n) => n.role === "user");
3281
3279
  for (let n = e.length - 1; n >= 0; n -= 1) {
3282
3280
  const i = e[n];
3283
3281
  if (!(i.role !== "tool" || e.slice(n + 1).some(
3284
- (r) => (Br(r) || Fr(r)) && Yo(i, r)
3282
+ (r) => (Ur(r) || Br(r)) && Yo(i, r)
3285
3283
  )) && (i.loading || i.dataType === "assistant_draft" || t && i.respondsToUserMessageId === t.id))
3286
3284
  return i;
3287
3285
  }
3288
3286
  return null;
3289
3287
  }
3290
- function Br(e) {
3288
+ function Ur(e) {
3291
3289
  return e.role === "assistant" && e.phase !== "commentary";
3292
3290
  }
3293
- function Fr(e) {
3291
+ function Br(e) {
3294
3292
  return e.role === "system" && (e.dataType === "run_error" || e.dataType === "run_status" && e.loading !== !0);
3295
3293
  }
3296
3294
  function Yo(e, t) {
@@ -3303,7 +3301,7 @@ function _o(e, t) {
3303
3301
  return !e.runId || !t.runId ? !0 : e.runId === t.runId;
3304
3302
  }
3305
3303
  function xo(e, t, n, i, o, r, l, p) {
3306
- e.replaceChildren(), ei(t, !1), t.disabled = !0, n(!1);
3304
+ e.replaceChildren(), Qo(t, !1), t.disabled = !0, n(!1);
3307
3305
  const s = document.createElement("div");
3308
3306
  s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
3309
3307
  const c = ke(
@@ -3321,23 +3319,23 @@ function xo(e, t, n, i, o, r, l, p) {
3321
3319
  }
3322
3320
  e.appendChild(s);
3323
3321
  }
3324
- function Wr(e, t) {
3322
+ function Fr(e, t) {
3325
3323
  const n = document.createElement("div");
3326
3324
  n.className = "pluno-pa-widget__message-attachments";
3327
3325
  for (const i of e)
3328
3326
  n.appendChild(
3329
- Sr(i, t)
3327
+ vr(i, t)
3330
3328
  );
3331
3329
  return n;
3332
3330
  }
3333
- function Hr(e) {
3331
+ function Wr(e) {
3334
3332
  const t = document.createElement("button");
3335
- return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(xr()), t.addEventListener("click", (n) => {
3333
+ return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(_r()), t.addEventListener("click", (n) => {
3336
3334
  n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
3337
3335
  }), t;
3338
3336
  }
3339
- function Gr(e, t) {
3340
- const n = Ri(e.id), i = document.createElement("article");
3337
+ function Hr(e, t) {
3338
+ const n = Ni(e.id), i = document.createElement("article");
3341
3339
  i.className = "pluno-pa-widget__share-prompt";
3342
3340
  const o = document.createElement("div");
3343
3341
  o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
@@ -3375,18 +3373,18 @@ function Gr(e, t) {
3375
3373
  const m = document.createElement("button");
3376
3374
  m.type = "button", m.className = "pluno-pa-widget__share-prompt-draft", m.disabled = t.isActing, m.addEventListener("click", () => {
3377
3375
  t.onReferralCopy(e);
3378
- }), t.isActing ? (m.appendChild(Qo()), m.appendChild(document.createTextNode("Copying..."))) : m.textContent = "Copy invite link", c.appendChild(m);
3376
+ }), t.isActing ? (m.appendChild(Vr()), m.appendChild(document.createTextNode("Copying..."))) : m.textContent = "Copy invite link", c.appendChild(m);
3379
3377
  } else
3380
- for (const m of $r()) {
3381
- const y = document.createElement("a");
3382
- y.className = "pluno-pa-widget__share-prompt-social", y.href = m.href, y.target = "_blank", y.rel = "noopener noreferrer", y.setAttribute("aria-label", `Open ${m.label}`), y.title = m.label, y.appendChild(qr(m.id)), y.addEventListener("click", () => t.onSocialShare(e)), c.appendChild(y);
3378
+ for (const m of Gr()) {
3379
+ const v = document.createElement("a");
3380
+ v.className = "pluno-pa-widget__share-prompt-social", v.href = m.href, v.target = "_blank", v.rel = "noopener noreferrer", v.setAttribute("aria-label", `Open ${m.label}`), v.title = m.label, v.appendChild($r(m.id)), v.addEventListener("click", () => t.onSocialShare(e)), c.appendChild(v);
3383
3381
  }
3384
3382
  const g = document.createElement("button");
3385
3383
  g.type = "button", g.className = "pluno-pa-widget__share-prompt-dismiss", g.setAttribute("aria-label", "Dismiss share prompt"), g.title = "Dismiss", g.textContent = "Dismiss", g.addEventListener("click", () => t.onDismiss(e)), c.appendChild(g), s.appendChild(c);
3386
3384
  const h = document.createElement("button");
3387
3385
  return h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => t.onDisable(e)), s.appendChild(h), o.appendChild(s), i.appendChild(o), i;
3388
3386
  }
3389
- function $r() {
3387
+ function Gr() {
3390
3388
  const e = "https://pluno.ai/browser", t = `I just used @pluno_ai to get work done directly inside my tools. Worth trying: ${e}`;
3391
3389
  return [
3392
3390
  {
@@ -3406,7 +3404,7 @@ function $r() {
3406
3404
  }
3407
3405
  ];
3408
3406
  }
3409
- function qr(e) {
3407
+ function $r(e) {
3410
3408
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3411
3409
  t.setAttribute("class", "pluno-pa-widget__share-prompt-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true");
3412
3410
  const n = (i, o) => {
@@ -3421,7 +3419,7 @@ function Xo(e) {
3421
3419
  function yn(e) {
3422
3420
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
3423
3421
  }
3424
- function jr(e, t, n, i, o) {
3422
+ function qr(e, t, n, i, o) {
3425
3423
  const r = document.createElement("article");
3426
3424
  r.className = "pluno-pa-widget__tool-group", r.classList.toggle("pluno-pa-widget__tool-group--active", t), r.title = new Date(
3427
3425
  e[e.length - 1].createdAt
@@ -3431,25 +3429,25 @@ function jr(e, t, n, i, o) {
3431
3429
  o
3432
3430
  )
3433
3431
  );
3434
- const l = Kr(e, t);
3432
+ const l = jr(e, t);
3435
3433
  if (t) {
3436
- const y = document.createElement("div");
3437
- return y.className = "pluno-pa-widget__tool-active-content", y.appendChild(dt()), y.appendChild(l), r.appendChild(y), r;
3434
+ const E = document.createElement("div");
3435
+ return E.className = "pluno-pa-widget__tool-active-content", E.appendChild(dt()), E.appendChild(l), r.appendChild(E), r;
3438
3436
  }
3439
- const p = document.createElement("details"), s = Vr(e);
3437
+ const p = document.createElement("details"), s = Kr(e);
3440
3438
  p.open = n.has(s), r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.addEventListener("toggle", () => {
3441
3439
  r.classList.toggle("pluno-pa-widget__tool-group--open", p.open), p.open ? n.add(s) : n.delete(s), i();
3442
3440
  });
3443
3441
  const c = document.createElement("summary");
3444
3442
  c.className = "pluno-pa-widget__tool-summary";
3445
- const g = [...e].reverse().find((y) => y.phase !== "commentary");
3446
- e.some(
3447
- (y) => y.phase !== "commentary" && y.loading
3448
- ) && c.appendChild(Qo());
3449
- const m = document.createElement("span");
3450
- return m.className = "pluno-pa-widget__tool-summary-title", m.textContent = g ? Zo(g.content) : "Activity", c.appendChild(m), p.appendChild(c), p.appendChild(l), r.appendChild(p), r;
3451
- }
3452
- function Kr(e, t) {
3443
+ const g = [...e].reverse().find((E) => E.phase !== "commentary"), h = e.some(
3444
+ (E) => E.phase !== "commentary" && E.loading
3445
+ ), m = document.createElement("span");
3446
+ m.className = "pluno-pa-widget__tool-summary-title";
3447
+ const v = g ? Zo(g.content) : "Activity";
3448
+ return m.textContent = v, h && (m.classList.add("pluno-pa-widget__tool-summary-title--loading"), m.dataset.loadingText = v), c.appendChild(m), p.appendChild(c), p.appendChild(l), r.appendChild(p), r;
3449
+ }
3450
+ function jr(e, t) {
3453
3451
  const n = document.createElement("div");
3454
3452
  n.className = "pluno-pa-widget__tool-lines";
3455
3453
  const i = e[e.length - 1];
@@ -3488,15 +3486,15 @@ function dt(e = "Thinking...") {
3488
3486
  const i = document.createElement("span");
3489
3487
  return i.textContent = e, t.appendChild(i), t;
3490
3488
  }
3491
- function Vr(e) {
3489
+ function Kr(e) {
3492
3490
  return `tools:${e[0]?.id ?? ""}`;
3493
3491
  }
3494
- function Qo() {
3492
+ function Vr() {
3495
3493
  const e = document.createElement("span");
3496
3494
  return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
3497
3495
  }
3498
- function ei(e, t) {
3499
- e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? br() : qo());
3496
+ function Qo(e, t) {
3497
+ e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? wr() : qo());
3500
3498
  }
3501
3499
  function pn(e) {
3502
3500
  let t = e.trim();
@@ -3531,8 +3529,8 @@ function Xr(e, t) {
3531
3529
  r.className = "pluno-pa-widget__table-scroll";
3532
3530
  const l = document.createElement("table"), p = document.createElement("thead"), s = document.createElement("tr");
3533
3531
  n.forEach((h, m) => {
3534
- const y = document.createElement("th"), A = o[m];
3535
- A && y.classList.add(`pluno-pa-widget__table-cell--${A}`), Ee(y, h), s.appendChild(y);
3532
+ const v = document.createElement("th"), E = o[m];
3533
+ E && v.classList.add(`pluno-pa-widget__table-cell--${E}`), Ee(v, h), s.appendChild(v);
3536
3534
  }), p.appendChild(s), l.appendChild(p);
3537
3535
  const c = document.createElement("tbody");
3538
3536
  let g = t + 2;
@@ -3541,15 +3539,15 @@ function Xr(e, t) {
3541
3539
  if (!h)
3542
3540
  break;
3543
3541
  const m = document.createElement("tr");
3544
- n.forEach((y, A) => {
3545
- const O = document.createElement("td"), u = o[A];
3546
- u && O.classList.add(`pluno-pa-widget__table-cell--${u}`), Ee(O, h[A] ?? ""), m.appendChild(O);
3542
+ n.forEach((v, E) => {
3543
+ const O = document.createElement("td"), u = o[E];
3544
+ u && O.classList.add(`pluno-pa-widget__table-cell--${u}`), Ee(O, h[E] ?? ""), m.appendChild(O);
3547
3545
  }), c.appendChild(m), g += 1;
3548
3546
  }
3549
3547
  return l.appendChild(c), r.appendChild(l), { element: r, nextIndex: g };
3550
3548
  }
3551
3549
  function Zr(e, t) {
3552
- const n = Ji(t).replace(/\r\n/g, `
3550
+ const n = Zi(t).replace(/\r\n/g, `
3553
3551
  `).split(`
3554
3552
  `);
3555
3553
  let i = 0;
@@ -3564,9 +3562,9 @@ function Zr(e, t) {
3564
3562
  for (i += 1; i < n.length && !/^```\s*$/.test(n[i]); )
3565
3563
  h.push(n[i]), i += 1;
3566
3564
  i += i < n.length ? 1 : 0;
3567
- const m = document.createElement("pre"), y = document.createElement("code");
3568
- y.textContent = h.join(`
3569
- `), m.appendChild(y), e.appendChild(m);
3565
+ const m = document.createElement("pre"), v = document.createElement("code");
3566
+ v.textContent = h.join(`
3567
+ `), m.appendChild(v), e.appendChild(m);
3570
3568
  continue;
3571
3569
  }
3572
3570
  const l = Xr(n, i);
@@ -4805,15 +4803,19 @@ function vo(e, t) {
4805
4803
  color: var(--pluno-pa-muted);
4806
4804
  line-height: 1.35;
4807
4805
  }
4808
- .pluno-pa-widget__tool-line-text {
4806
+ .pluno-pa-widget__tool-line-text,
4807
+ .pluno-pa-widget__tool-summary-title--loading {
4809
4808
  position: relative;
4810
4809
  display: inline-block;
4811
- width: fit-content;
4812
4810
  max-width: 100%;
4813
4811
  }
4812
+ .pluno-pa-widget__tool-line-text {
4813
+ width: fit-content;
4814
+ }
4814
4815
  /* Keep the loading sweep inside the glyphs so it reads as changing text,
4815
4816
  without adding a decorative light that competes with the activity. */
4816
- .pluno-pa-widget__tool-line-text--loading::after {
4817
+ .pluno-pa-widget__tool-line-text--loading::after,
4818
+ .pluno-pa-widget__tool-summary-title--loading::after {
4817
4819
  content: attr(data-loading-text);
4818
4820
  position: absolute;
4819
4821
  inset: 0;
@@ -4827,8 +4829,10 @@ function vo(e, t) {
4827
4829
  -webkit-mask-image: linear-gradient(
4828
4830
  90deg,
4829
4831
  transparent 0,
4830
- #000 40px,
4831
- #000 80px,
4832
+ rgba(0, 0, 0, 0.9) 28px,
4833
+ #000 48px,
4834
+ #000 72px,
4835
+ rgba(0, 0, 0, 0.9) 92px,
4832
4836
  transparent 120px
4833
4837
  );
4834
4838
  -webkit-mask-size: 120px 100%;
@@ -4837,8 +4841,10 @@ function vo(e, t) {
4837
4841
  mask-image: linear-gradient(
4838
4842
  90deg,
4839
4843
  transparent 0,
4840
- #000 40px,
4841
- #000 80px,
4844
+ rgba(0, 0, 0, 0.9) 28px,
4845
+ #000 48px,
4846
+ #000 72px,
4847
+ rgba(0, 0, 0, 0.9) 92px,
4842
4848
  transparent 120px
4843
4849
  );
4844
4850
  mask-size: 120px 100%;
@@ -4853,7 +4859,8 @@ function vo(e, t) {
4853
4859
  }
4854
4860
  }
4855
4861
  @media (prefers-reduced-motion: reduce) {
4856
- .pluno-pa-widget__tool-line-text--loading::after {
4862
+ .pluno-pa-widget__tool-line-text--loading::after,
4863
+ .pluno-pa-widget__tool-summary-title--loading::after {
4857
4864
  content: none;
4858
4865
  }
4859
4866
  }
@@ -5277,7 +5284,7 @@ function vo(e, t) {
5277
5284
  width: 100%;
5278
5285
  resize: none;
5279
5286
  min-height: 22px;
5280
- max-height: 160px;
5287
+ max-height: min(40vh, 320px);
5281
5288
  border: 0;
5282
5289
  outline: none;
5283
5290
  background: transparent;
@@ -5291,6 +5298,9 @@ function vo(e, t) {
5291
5298
  scrollbar-color: var(--pluno-pa-divider) transparent;
5292
5299
  scrollbar-width: thin;
5293
5300
  }
5301
+ :host([data-pluno-product-agent-layout="page"]) .pluno-pa-widget__input {
5302
+ max-height: min(50vh, 500px);
5303
+ }
5294
5304
  .pluno-pa-widget__input::placeholder {
5295
5305
  color: var(--pluno-pa-faint);
5296
5306
  }
@@ -6020,12 +6030,12 @@ function vo(e, t) {
6020
6030
  if (el(e, n))
6021
6031
  return;
6022
6032
  const i = e.ownerDocument.createElement("style");
6023
- i.id = Uo, i.textContent = n, e.appendChild(i), ti(e);
6033
+ i.id = Uo, i.textContent = n, e.appendChild(i), ei(e);
6024
6034
  }
6025
6035
  function Qr(e) {
6026
6036
  return e.getElementById(Uo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Bo) === "true";
6027
6037
  }
6028
- function ti(e) {
6038
+ function ei(e) {
6029
6039
  e.host instanceof HTMLElement && e.host.setAttribute(Bo, "true");
6030
6040
  }
6031
6041
  function el(e, t) {
@@ -6033,7 +6043,7 @@ function el(e, t) {
6033
6043
  return !1;
6034
6044
  try {
6035
6045
  const n = new CSSStyleSheet();
6036
- return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], ti(e), !0;
6046
+ return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], ei(e), !0;
6037
6047
  } catch {
6038
6048
  return !1;
6039
6049
  }
@@ -6049,13 +6059,13 @@ async function tl() {
6049
6059
  function kn(e) {
6050
6060
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
6051
6061
  }
6052
- function ni(e) {
6062
+ function ti(e) {
6053
6063
  return `${kn(e)}.displayState`;
6054
6064
  }
6055
6065
  function nl(e) {
6056
6066
  try {
6057
6067
  return window.sessionStorage.getItem(
6058
- ni(e)
6068
+ ti(e)
6059
6069
  ) === "minimized" ? "minimized" : "shown";
6060
6070
  } catch {
6061
6071
  return "shown";
@@ -6064,7 +6074,7 @@ function nl(e) {
6064
6074
  function So(e, t) {
6065
6075
  if (e.layout === "floating")
6066
6076
  try {
6067
- const n = ni(e);
6077
+ const n = ti(e);
6068
6078
  if (t === "minimized") {
6069
6079
  window.sessionStorage.setItem(n, t);
6070
6080
  return;
@@ -6082,7 +6092,7 @@ function ol(e) {
6082
6092
  for (; Jt.has(t); )
6083
6093
  t += 1;
6084
6094
  Jt.add(t);
6085
- const n = `${ga}${t}`;
6095
+ const n = `${ua}${t}`;
6086
6096
  let i = crypto.randomUUID();
6087
6097
  try {
6088
6098
  i = window.sessionStorage.getItem(n) ?? i, window.sessionStorage.setItem(n, i);
@@ -6177,7 +6187,7 @@ function pl(e) {
6177
6187
  const t = e;
6178
6188
  return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
6179
6189
  }
6180
- async function oi(e, t) {
6190
+ async function ni(e, t) {
6181
6191
  const n = await fetch(e, {
6182
6192
  method: "POST",
6183
6193
  credentials: "include",
@@ -6189,7 +6199,7 @@ async function oi(e, t) {
6189
6199
  ...t ? { signal: t } : {}
6190
6200
  });
6191
6201
  if (!n.ok) {
6192
- const o = await n.text(), r = Ei(o);
6202
+ const o = await n.text(), r = Ci(o);
6193
6203
  throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
6194
6204
  }
6195
6205
  const i = await n.json();
@@ -6205,7 +6215,7 @@ function dl(e) {
6205
6215
  const l = new Promise((p, s) => {
6206
6216
  const c = window.setTimeout(() => {
6207
6217
  r = !0, o.abort(), s(new Error(Zn));
6208
- }, ca);
6218
+ }, da);
6209
6219
  o.signal.addEventListener(
6210
6220
  "abort",
6211
6221
  () => window.clearTimeout(c),
@@ -6214,12 +6224,12 @@ function dl(e) {
6214
6224
  });
6215
6225
  try {
6216
6226
  const p = await Promise.race([
6217
- oi(e, o.signal),
6227
+ ni(e, o.signal),
6218
6228
  l
6219
6229
  ]);
6220
6230
  return o.abort(), p;
6221
6231
  } catch (p) {
6222
- throw o.abort(), r ? new Error(Zn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(ua);
6232
+ throw o.abort(), r ? new Error(Zn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(ca);
6223
6233
  }
6224
6234
  };
6225
6235
  return {
@@ -6256,16 +6266,16 @@ function ul(e, t) {
6256
6266
  }
6257
6267
  class xe extends EventTarget {
6258
6268
  constructor(t, n) {
6259
- super(), this.channelId = n, this.url = t, this.addPreviewListener(ra, () => {
6269
+ super(), this.channelId = n, this.url = t, this.addPreviewListener(aa, () => {
6260
6270
  this.readyState = xe.OPEN, this.dispatchEvent(new Event("open"));
6261
- }), this.addPreviewListener(la, (i) => {
6271
+ }), this.addPreviewListener(ra, (i) => {
6262
6272
  const o = i;
6263
6273
  this.dispatchEvent(
6264
6274
  new MessageEvent("message", { data: o.detail?.data ?? "" })
6265
6275
  );
6266
- }), this.addPreviewListener(sa, () => {
6276
+ }), this.addPreviewListener(la, () => {
6267
6277
  this.readyState = xe.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
6268
- }), this.addPreviewListener(pa, (i) => {
6278
+ }), this.addPreviewListener(sa, (i) => {
6269
6279
  const o = i;
6270
6280
  this.readyState = xe.CLOSED, this.dispatchEvent(
6271
6281
  new CloseEvent("close", {
@@ -6277,7 +6287,7 @@ class xe extends EventTarget {
6277
6287
  }), window.dispatchEvent(
6278
6288
  new CustomEvent(
6279
6289
  St(
6280
- oa,
6290
+ na,
6281
6291
  this.channelId
6282
6292
  ),
6283
6293
  {
@@ -6307,7 +6317,7 @@ class xe extends EventTarget {
6307
6317
  );
6308
6318
  window.dispatchEvent(
6309
6319
  new CustomEvent(
6310
- St(ia, this.channelId),
6320
+ St(oa, this.channelId),
6311
6321
  {
6312
6322
  detail: {
6313
6323
  socketId: this.socketId,
@@ -6320,7 +6330,7 @@ class xe extends EventTarget {
6320
6330
  close(t, n) {
6321
6331
  this.readyState !== xe.CLOSED && (this.readyState = xe.CLOSING, window.dispatchEvent(
6322
6332
  new CustomEvent(
6323
- St(aa, this.channelId),
6333
+ St(ia, this.channelId),
6324
6334
  {
6325
6335
  detail: { socketId: this.socketId, code: t, reason: n }
6326
6336
  }
@@ -6367,17 +6377,17 @@ function hl(e) {
6367
6377
  }
6368
6378
  function ml(e) {
6369
6379
  for (const t of hl(e))
6370
- Eo.has(t) || t.dataset.plunoAutoMount === "false" || (Eo.add(t), ii(t).catch((n) => {
6380
+ Eo.has(t) || t.dataset.plunoAutoMount === "false" || (Eo.add(t), oi(t).catch((n) => {
6371
6381
  console.error("Failed to mount Pluno widget", n);
6372
6382
  }));
6373
6383
  }
6374
- function ii(e) {
6384
+ function oi(e) {
6375
6385
  const t = window, n = t[be];
6376
6386
  if (n) {
6377
6387
  if (n.host === null)
6378
6388
  return n.mountPromise.catch(() => {
6379
6389
  const s = t[be];
6380
- return s ? s.mountPromise : ii(e);
6390
+ return s ? s.mountPromise : oi(e);
6381
6391
  });
6382
6392
  if (fl(n.host))
6383
6393
  return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
@@ -6385,12 +6395,12 @@ function ii(e) {
6385
6395
  }
6386
6396
  const i = e.dataset.plunoPreviewChannel, o = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !i && o ? dl(o) : null;
6387
6397
  let l;
6388
- const p = Ra({
6398
+ const p = Na({
6389
6399
  token: e.dataset.plunoToken,
6390
6400
  tokenProvider: r?.loadToken,
6391
6401
  tokenEndpoint: o,
6392
6402
  backendUrl: e.dataset.plunoBackendUrl,
6393
- webSocketFactory: i ? Na(i) : void 0,
6403
+ webSocketFactory: i ? Pa(i) : void 0,
6394
6404
  launcherLabel: e.dataset.plunoLauncherLabel,
6395
6405
  accentColor: e.dataset.plunoAccentColor,
6396
6406
  colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
@@ -6421,6 +6431,6 @@ function fl(e) {
6421
6431
  }
6422
6432
  ml(import.meta.url);
6423
6433
  export {
6424
- Na as createProductAgentPreviewBridgeWebSocketFactory,
6425
- Ra as mountPlunoProductAgentWidget
6434
+ Pa as createProductAgentPreviewBridgeWebSocketFactory,
6435
+ Na as mountPlunoProductAgentWidget
6426
6436
  };