@pluno/product-agent-web 0.1.68 → 0.1.70

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,13 +1,13 @@
1
1
  import { PlunoProductAgent as Jo, getProductAgentOriginAccessErrorMessage as Qo } from "./product-agent-sdk.js";
2
- const ei = "#7c3aed", st = "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", dt = "#2c2a1e", xn = [253, 250, 241], yn = 3.5;
3
- function Qn(e) {
4
- const t = eo(e);
5
- if (vn(Ye(t), xn) >= yn)
2
+ const ei = "#7c3aed", st = "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", dt = "#2c2a1e", yn = [253, 250, 241], vn = 3.5;
3
+ function eo(e) {
4
+ const t = to(e);
5
+ if (Cn(Ye(t), yn) >= vn)
6
6
  return t;
7
7
  let o = Ye(t);
8
8
  const i = Ye(dt);
9
9
  for (let a = 0; a < 6; a += 1)
10
- if (o = oi(o, i, 0.22), vn(o, xn) >= yn)
10
+ if (o = oi(o, i, 0.22), Cn(o, yn) >= vn)
11
11
  return Gt(o);
12
12
  return Gt(o);
13
13
  }
@@ -20,7 +20,7 @@ function ti() {
20
20
  return n;
21
21
  }
22
22
  function ni(e) {
23
- const t = eo(e), n = $t(Ye(t));
23
+ const t = to(e), n = $t(Ye(t));
24
24
  return n > 0.86 ? {
25
25
  top: "#ffffff",
26
26
  middle: "#f6f6f6",
@@ -56,7 +56,7 @@ function ni(e) {
56
56
  shadow: ne(t, -0.25, -0.08)
57
57
  };
58
58
  }
59
- function eo(e) {
59
+ function to(e) {
60
60
  const t = e.trim();
61
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
  }
@@ -78,7 +78,7 @@ function $t([e, t, n]) {
78
78
  };
79
79
  return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
80
80
  }
81
- function vn(e, t) {
81
+ function Cn(e, t) {
82
82
  const n = $t(e), o = $t(t), [i, a] = n > o ? [n, o] : [o, n];
83
83
  return (i + 0.05) / (a + 0.05);
84
84
  }
@@ -118,16 +118,16 @@ function Nt(e, t, n) {
118
118
  function qt(e) {
119
119
  return Math.max(0, Math.min(1, e));
120
120
  }
121
- const to = "suggest_share_on_socials";
121
+ const no = "suggest_share_on_socials";
122
122
  function ri(e) {
123
123
  for (let t = e.length - 1; t >= 0; t -= 1) {
124
124
  const n = e[t];
125
- if (n.role !== "tool" || n.toolName !== to)
125
+ if (n.role !== "tool" || n.toolName !== no)
126
126
  continue;
127
- const o = Cn(e, t, "assistant");
127
+ const o = Sn(e, t, "assistant");
128
128
  if (!o)
129
129
  return null;
130
- const i = Cn(e, o.index, "user");
130
+ const i = Sn(e, o.index, "user");
131
131
  return i ? {
132
132
  id: `share:${n.callId ?? n.id}`,
133
133
  userPrompt: i.content,
@@ -142,7 +142,7 @@ async function li(e) {
142
142
  throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
143
143
  await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
144
144
  }
145
- function Cn(e, t, n) {
145
+ function Sn(e, t, n) {
146
146
  for (let o = t - 1; o >= 0; o -= 1) {
147
147
  const i = e[o];
148
148
  if (i.role === n && i.content.trim())
@@ -199,12 +199,12 @@ async function wi(e) {
199
199
  });
200
200
  if (!n.ok)
201
201
  throw new Error("Failed to load active users");
202
- const o = await n.json(), i = Sn(o.count), a = Sn(o.refreshAfterMs ?? o.refresh_after_ms);
202
+ const o = await n.json(), i = En(o.count), a = En(o.refreshAfterMs ?? o.refresh_after_ms);
203
203
  if (i === null || a === null)
204
204
  throw new Error("Invalid active users response");
205
205
  return { count: i, refreshAfterMs: a };
206
206
  }
207
- function Sn(e) {
207
+ function En(e) {
208
208
  return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
209
209
  }
210
210
  function bi(e) {
@@ -216,7 +216,7 @@ function _i(e) {
216
216
  function xi(e) {
217
217
  return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
218
218
  }
219
- const no = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-connect", Si = "product-agent:sdk-preview-socket-send", Ei = "product-agent:sdk-preview-socket-close", ki = "product-agent:sdk-preview-socket-open", Li = "product-agent:sdk-preview-socket-message", Pi = "product-agent:sdk-preview-socket-error", Ii = "product-agent:sdk-preview-socket-closed", En = "product-agent:sdk-preview-socket-id", Ti = "data-pluno-sdk-preview-channel", oo = "data-pluno-auto-mounted", se = "__plunoProductAgentAutoMountOwner", Ai = 1e4, Ni = "Failed to load Pluno widget token", kn = "Timed out loading Pluno widget token", Di = "pluno.productAgent.widgetClientId.", Dt = /* @__PURE__ */ new Set(), Ri = "product-agent:preview-diagnostic", io = "pluno.productAgent.sharePromptsDisabled", zi = 3, Ln = 'dialog[open], [aria-modal="true"], [role="dialog"]', Mi = 400, Oi = 5e3, Ui = 500, Pn = "Close the page's popup to chat", Bi = "No recent chats for this page yet.", oe = {
219
+ const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-connect", Si = "product-agent:sdk-preview-socket-send", Ei = "product-agent:sdk-preview-socket-close", ki = "product-agent:sdk-preview-socket-open", Li = "product-agent:sdk-preview-socket-message", Pi = "product-agent:sdk-preview-socket-error", Ii = "product-agent:sdk-preview-socket-closed", kn = "product-agent:sdk-preview-socket-id", Ti = "data-pluno-sdk-preview-channel", io = "data-pluno-auto-mounted", se = "__plunoProductAgentAutoMountOwner", Ai = 1e4, Ni = "Failed to load Pluno widget token", Ln = "Timed out loading Pluno widget token", Di = "pluno.productAgent.widgetClientId.", Dt = /* @__PURE__ */ new Set(), Ri = "product-agent:preview-diagnostic", ao = "pluno.productAgent.sharePromptsDisabled", zi = 3, Pn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Mi = 400, Oi = 5e3, Ui = 500, In = "Close the page's popup to chat", Bi = "No recent chats for this page yet.", oe = {
220
220
  launcherLabel: "Ask for anything...",
221
221
  accentColor: "#7c3aed",
222
222
  colorScheme: "light",
@@ -224,7 +224,7 @@ const no = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-conne
224
224
  scribbleStyle: !0,
225
225
  position: "bottom-right",
226
226
  movableLauncher: !1
227
- }, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', In = "pluno-pa-scribble-font", ao = 190, ro = 41, Tn = 22, Hi = 16, Wi = 24, Gi = 1, $i = 48, tn = 420, qi = 520, ji = 0.24, nn = 680, Vi = 800, Ki = 0.76, I = 8, Se = 50, lo = "http://www.w3.org/2000/svg", jt = 26, Vt = 8, Yi = 36, Kt = 16, Xi = 4, An = [
227
+ }, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Tn = "pluno-pa-scribble-font", ro = 190, lo = 41, An = 22, Hi = 16, Wi = 24, Gi = 1, $i = 48, tn = 420, qi = 520, ji = 0.24, nn = 680, Vi = 800, Ki = 0.76, I = 8, Se = 50, po = "http://www.w3.org/2000/svg", jt = 26, Vt = 8, Yi = 36, Kt = 16, Xi = 4, Nn = [
228
228
  {
229
229
  ellipseCx: "17.5",
230
230
  ellipseCy: "24.5",
@@ -261,8 +261,8 @@ const no = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-conne
261
261
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
262
262
  pathStrokeWidth: "2.45"
263
263
  }
264
- ], Zi = 11, Ji = 13, Yt = 4, po = 10, so = 40, Qi = "movable-launcher-position-v2", co = "pluno-pa-widget-styles", uo = "data-pluno-pa-widget-styles";
265
- let Nn = 0;
264
+ ], Zi = 11, Ji = 13, Yt = 4, so = 10, co = 40, Qi = "movable-launcher-position-v2", uo = "pluno-pa-widget-styles", go = "data-pluno-pa-widget-styles";
265
+ let Dn = 0;
266
266
  function ea(e) {
267
267
  return (t) => new de(t, e);
268
268
  }
@@ -330,7 +330,7 @@ async function ta(e = {}) {
330
330
  );
331
331
  const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
332
332
  i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
333
- let a = Dn(
333
+ let a = Rn(
334
334
  t.accentColor,
335
335
  t.scribbleStyle
336
336
  );
@@ -350,7 +350,7 @@ async function ta(e = {}) {
350
350
  p,
351
351
  t.position
352
352
  )
353
- )), Yn(o, t.accentColor), Rn(i, a, {
353
+ )), Xn(o, t.accentColor), zn(i, a, {
354
354
  accentColor: t.accentColor,
355
355
  colorScheme: t.colorScheme,
356
356
  fontFamily: t.fontFamily,
@@ -408,18 +408,18 @@ async function ta(e = {}) {
408
408
  ".pluno-pa-widget__timeline-bottom-sentinel"
409
409
  ), Oe = i.querySelector(
410
410
  ".pluno-pa-widget__notify-suggestion"
411
- ), To = i.querySelector(
412
- ".pluno-pa-widget__notify-suggestion-enable"
413
411
  ), Ao = i.querySelector(
414
- ".pluno-pa-widget__notify-suggestion-later"
412
+ ".pluno-pa-widget__notify-suggestion-enable"
415
413
  ), No = i.querySelector(
414
+ ".pluno-pa-widget__notify-suggestion-later"
415
+ ), Do = i.querySelector(
416
416
  ".pluno-pa-widget__notify-suggestion-never"
417
417
  );
418
418
  if (!v || !b || !w || !T || !k || !F || !H || !$ || !Q || !Me || !x || !ce || !Xe || !X || !C || !N || !Ee || !q || !R || !D || !A || !mt)
419
419
  throw new Error("Failed to mount Pluno widget");
420
420
  if (t.movableLauncher && !z)
421
421
  throw new Error("Failed to mount Pluno widget drag handle");
422
- Hn(b), Hn(x);
422
+ Wn(b), Wn(x);
423
423
  let W = [], le = null;
424
424
  const ke = () => {
425
425
  Ga(
@@ -431,16 +431,16 @@ async function ta(e = {}) {
431
431
  ), ke(), G(y.getState()), j();
432
432
  }
433
433
  );
434
- }, Do = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
434
+ }, Ro = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
435
435
  if (!t.tokenEndpoint)
436
436
  throw new Error("Pluno widget requires token or tokenEndpoint");
437
- return Po(t.tokenEndpoint);
438
- }), Ro = window.fetch.bind(window), ft = xr(t.clientId);
437
+ return Io(t.tokenEndpoint);
438
+ }), zo = window.fetch.bind(window), ft = xr(t.clientId);
439
439
  let y;
440
440
  try {
441
441
  const r = {
442
442
  token: t.token,
443
- tokenProvider: Do,
443
+ tokenProvider: Ro,
444
444
  backendUrl: t.backendUrl,
445
445
  metadata: () => ({
446
446
  ...t.metadata ?? {},
@@ -479,9 +479,9 @@ async function ta(e = {}) {
479
479
  be = { enabled: r, reason: s };
480
480
  }, te = () => {
481
481
  R.hidden = !0;
482
- }, zo = () => {
482
+ }, Mo = () => {
483
483
  R.hidden = !1;
484
- }, Mo = (r = "jump") => {
484
+ }, Oo = (r = "jump") => {
485
485
  ee(!0, r), te(), Ke(A, () => be.enabled), _e = A.scrollTop;
486
486
  }, xe = () => {
487
487
  if (X.hidden = t.loginRequired, C.hidden = !ue, X.setAttribute("aria-expanded", String(ue)), N.classList.toggle(
@@ -529,10 +529,10 @@ async function ta(e = {}) {
529
529
  pe = !1, xe();
530
530
  }
531
531
  }
532
- }, Oo = () => {
532
+ }, Uo = () => {
533
533
  !_t || pe || N.scrollHeight - N.scrollTop - N.clientHeight <= 24 && ln(_t);
534
534
  }, pn = () => {
535
- Pe || typeof document > "u" || (Yn(o, t.accentColor), n.isConnected || E.body?.appendChild(n));
535
+ Pe || typeof document > "u" || (Xn(o, t.accentColor), n.isConnected || E.body?.appendChild(n));
536
536
  }, sn = new MutationObserver(pn);
537
537
  sn.observe(E.documentElement, {
538
538
  childList: !0,
@@ -542,7 +542,7 @@ async function ta(e = {}) {
542
542
  const s = ct(i, r);
543
543
  return Xt(
544
544
  i,
545
- p ? go(p, s) : sa(
545
+ p ? ho(p, s) : sa(
546
546
  i,
547
547
  t.position,
548
548
  s
@@ -560,7 +560,7 @@ async function ta(e = {}) {
560
560
  launcherPosition: d ? p : null,
561
561
  panelSize: c,
562
562
  seenShareCandidateIds: [...Le].slice(
563
- -no
563
+ -oo
564
564
  ),
565
565
  sharePromptsDisabled: bt
566
566
  });
@@ -578,7 +578,7 @@ async function ta(e = {}) {
578
578
  p,
579
579
  t.position
580
580
  )
581
- ), Un(i), U(), s && Je("minimized");
581
+ ), Bn(i), U(), s && Je("minimized");
582
582
  }, ye = (r, s = {}) => {
583
583
  ma(r, {
584
584
  debugVersion: Qi,
@@ -607,7 +607,7 @@ async function ta(e = {}) {
607
607
  }), s;
608
608
  }, xt = (r, s) => {
609
609
  if (!r || !s) {
610
- Un(i);
610
+ Bn(i);
611
611
  return;
612
612
  }
613
613
  ha(i, {
@@ -676,7 +676,7 @@ async function ta(e = {}) {
676
676
  d = !0, U(), ye("Persisted closed launcher drag position");
677
677
  }
678
678
  })) : Ce(i, null), Rt(i, c);
679
- const Uo = () => {
679
+ const Bo = () => {
680
680
  const r = ze(c), s = Be();
681
681
  return {
682
682
  position: pt(
@@ -690,7 +690,7 @@ async function ta(e = {}) {
690
690
  ),
691
691
  size: r
692
692
  };
693
- }, Bo = (r) => {
693
+ }, Fo = (r) => {
694
694
  c = gt(r.size), Rt(i, c), Bt(
695
695
  h,
696
696
  ze(c).width
@@ -700,11 +700,11 @@ async function ta(e = {}) {
700
700
  );
701
701
  const s = Be();
702
702
  xt(u, s);
703
- }, Fo = P.length > 0 ? la({
703
+ }, Ho = P.length > 0 ? la({
704
704
  root: i,
705
705
  handles: P,
706
- getBounds: Uo,
707
- setBounds: Bo,
706
+ getBounds: Bo,
707
+ setBounds: Fo,
708
708
  persist: U
709
709
  }) : () => {
710
710
  };
@@ -714,7 +714,7 @@ async function ta(e = {}) {
714
714
  yt = !0;
715
715
  try {
716
716
  const r = await t.billingStatusLoader();
717
- Gn(
717
+ $n(
718
718
  t.billingStatus,
719
719
  r,
720
720
  y.getState().lastErrorCode
@@ -750,7 +750,7 @@ async function ta(e = {}) {
750
750
  v.hidden = !0, Ke(A, () => be.enabled), _e = A.scrollTop;
751
751
  }, 220);
752
752
  });
753
- }, Ho = () => {
753
+ }, Wo = () => {
754
754
  Z !== null && (window.clearTimeout(Z), Z = null), v.hidden = !1, p && (He(!1), ye("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), U(), t.onPanelOpenChange?.(!1), Z = window.setTimeout(() => {
755
755
  w.hidden = !0, T.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
756
756
  }, 220);
@@ -770,20 +770,20 @@ async function ta(e = {}) {
770
770
  he(r), b.value = "";
771
771
  });
772
772
  let vt = null, Qe = null, ve = null;
773
- const gn = (r) => r === b || r === x, Wo = (r) => {
773
+ const gn = (r) => r === b || r === x, Go = (r) => {
774
774
  if (!(r instanceof Element) || r.getRootNode() === i.getRootNode())
775
775
  return null;
776
776
  let s = r;
777
777
  for (; s; ) {
778
- const _ = s.closest(Ln);
778
+ const _ = s.closest(Pn);
779
779
  if (_)
780
780
  return _;
781
781
  const L = s.getRootNode();
782
782
  s = L instanceof ShadowRoot ? L.host : null;
783
783
  }
784
784
  return null;
785
- }, Go = (r) => {
786
- if (!r.isConnected || !r.matches(Ln))
785
+ }, $o = (r) => {
786
+ if (!r.isConnected || !r.matches(Pn))
787
787
  return !1;
788
788
  if (!(r instanceof HTMLElement))
789
789
  return !0;
@@ -796,9 +796,9 @@ async function ta(e = {}) {
796
796
  }, hn = (r) => {
797
797
  We !== r && (We = r, i.classList.toggle("pluno-pa-widget--host-modal-conflict", r !== null), tt(), r !== null ? ve = window.setInterval(() => {
798
798
  const s = We;
799
- (!s || !Go(s)) && hn(null);
799
+ (!s || !$o(s)) && hn(null);
800
800
  }, Ui) : ve !== null && (window.clearInterval(ve), ve = null, Qe = null));
801
- }, $o = () => {
801
+ }, qo = () => {
802
802
  ve !== null && (window.clearInterval(ve), ve = null);
803
803
  };
804
804
  i.addEventListener("focusin", (r) => {
@@ -809,7 +809,7 @@ async function ta(e = {}) {
809
809
  const s = vt;
810
810
  if (vt = null, s === null || Date.now() - s > Mi)
811
811
  return;
812
- const _ = Wo(r.relatedTarget);
812
+ const _ = Go(r.relatedTarget);
813
813
  if (!_)
814
814
  return;
815
815
  const L = Date.now();
@@ -824,10 +824,10 @@ async function ta(e = {}) {
824
824
  r.stopPropagation();
825
825
  }), g?.addEventListener("click", (r) => {
826
826
  r.preventDefault(), r.stopPropagation(), Fe("minimized");
827
- }), T.addEventListener("click", Ho), A.addEventListener("scroll", () => {
827
+ }), T.addEventListener("click", Wo), A.addEventListener("scroll", () => {
828
828
  A.scrollTop < _e - 1 && ee(!1, "userScroll"), _e = A.scrollTop;
829
829
  }), R.addEventListener("click", () => {
830
- Mo();
830
+ Oo();
831
831
  });
832
832
  const mn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
833
833
  ([r]) => {
@@ -840,7 +840,7 @@ async function ta(e = {}) {
840
840
  let We = null, Ge = !1;
841
841
  const tt = () => {
842
842
  const r = et(), s = We !== null;
843
- b.readOnly = r || s, x.readOnly = s, b.placeholder = s ? Pn : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ge ? "New update" : t.launcherLabel, x.placeholder = s ? Pn : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : oe.launcherLabel, k.hidden = r;
843
+ b.readOnly = r || s, x.readOnly = s, b.placeholder = s ? In : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ge ? "New update" : t.launcherLabel, x.placeholder = s ? In : r ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : oe.launcherLabel, k.hidden = r;
844
844
  }, j = () => {
845
845
  ce.disabled = ae(t.billingStatus) || !y.getState().isThinking && x.value.trim().length === 0 && W.length === 0, Me.disabled = et() || ae(t.billingStatus);
846
846
  };
@@ -868,19 +868,19 @@ async function ta(e = {}) {
868
868
  ), ke(), j());
869
869
  });
870
870
  let $e = 0;
871
- const qo = () => {
871
+ const jo = () => {
872
872
  $e = 0, i.classList.remove("pluno-pa-widget--drag-over");
873
873
  }, St = (r) => {
874
874
  le !== null && window.clearTimeout(le), F.textContent = r, F.hidden = !1, le = window.setTimeout(() => {
875
875
  F.textContent = "", F.hidden = !0, le = null;
876
876
  }, 3e3);
877
- }, jo = () => {
877
+ }, Vo = () => {
878
878
  le !== null && (window.clearTimeout(le), le = null), F.textContent = "", F.hidden = !0;
879
879
  }, Et = async (r) => {
880
880
  if (r.length === 0)
881
881
  return;
882
882
  const s = ja(y, r);
883
- W = [...W, ...s], ke(), jo(), j(), G(y.getState()), i.classList.contains("pluno-pa-widget--open") || he();
883
+ W = [...W, ...s], ke(), Vo(), j(), G(y.getState()), i.classList.contains("pluno-pa-widget--open") || he();
884
884
  };
885
885
  Me.addEventListener("click", () => {
886
886
  t.loginRequired || ae(t.billingStatus) || Q.click();
@@ -902,7 +902,7 @@ async function ta(e = {}) {
902
902
  at(r.dataTransfer) && (r.stopPropagation(), $e = Math.max(0, $e - 1), $e === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
903
903
  }), i.addEventListener("drop", (r) => {
904
904
  const s = r.dataTransfer;
905
- !at(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), qo(), Et(s.files).catch((_) => {
905
+ !at(s) || t.loginRequired || (r.preventDefault(), r.stopPropagation(), jo(), Et(s.files).catch((_) => {
906
906
  St(
907
907
  _ instanceof Error ? _.message : "Failed to attach file"
908
908
  ), J("web-sdk.widget", "Attachment failed", {
@@ -936,8 +936,8 @@ async function ta(e = {}) {
936
936
  ue = !ue, Ue = null, xe(), ue && ge.length === 0 && ln(null);
937
937
  }), Ee.addEventListener("click", () => {
938
938
  ue = !1, xe();
939
- }), N.addEventListener("scroll", Oo), x.addEventListener("input", () => {
940
- Ve(x), U(), j(), Yo();
939
+ }), N.addEventListener("scroll", Uo), x.addEventListener("input", () => {
940
+ Ve(x), U(), j(), Xo();
941
941
  }), x.addEventListener("keydown", (r) => {
942
942
  if (!(r.key !== "Enter" || r.shiftKey)) {
943
943
  if (r.preventDefault(), t.loginRequired) {
@@ -961,7 +961,7 @@ async function ta(e = {}) {
961
961
  Ae !== null && (window.clearTimeout(Ae), Ae = null);
962
962
  }, it = () => {
963
963
  Oe && (Oe.hidden = !0);
964
- }, bn = () => y.getState().assistantDraft.trim().length > 0, Vo = async () => {
964
+ }, bn = () => y.getState().assistantDraft.trim().length > 0, Ko = async () => {
965
965
  if (!je || !Oe || Ne || Pe || !y.getState().isThinking || bn())
966
966
  return;
967
967
  let r;
@@ -972,24 +972,24 @@ async function ta(e = {}) {
972
972
  }
973
973
  r.enabled || r.neverSuggest || !y.getState().isThinking || bn() || Ne || Pe || (Oe.hidden = !1);
974
974
  };
975
- To?.addEventListener("click", () => {
975
+ Ao?.addEventListener("click", () => {
976
976
  Ne = !0, it(), je?.enable().catch(() => {
977
977
  });
978
- }), Ao?.addEventListener("click", () => {
979
- Ne = !0, it();
980
978
  }), No?.addEventListener("click", () => {
979
+ Ne = !0, it();
980
+ }), Do?.addEventListener("click", () => {
981
981
  Ne = !0, it(), je?.dismissForever().catch(() => {
982
982
  });
983
983
  });
984
984
  let De = null, _n = () => {
985
985
  };
986
- const Ko = !!t.socialPostDraftHandler, Lt = /* @__PURE__ */ new Map(), Pt = () => x.value.trim().length > 0 || W.length > 0, Yo = () => {
986
+ const Yo = !!t.socialPostDraftHandler, Lt = /* @__PURE__ */ new Map(), Pt = () => x.value.trim().length > 0 || W.length > 0, Xo = () => {
987
987
  const r = De !== null && Wt(y.getState(), Pt());
988
- D.hidden = !r, r && De !== null && mo(D, De);
988
+ D.hidden = !r, r && De !== null && fo(D, De);
989
989
  };
990
990
  let Re = null;
991
- const Xo = () => {
992
- we = !0, ee(!0, "newSession"), te(), ue = !1, xe(), y.startNewSession(), wt.clear(), x.value = "", W = [], ke(), Ve(x), U(), j(), x.focus(), G(y.getState());
991
+ const xn = (r = {}) => {
992
+ we = !0, ee(!0, "newSession"), te(), ue = !1, xe(), y.startNewSession(r), wt.clear(), x.value = "", W = [], ke(), Ve(x), U(), j(), x.focus(), G(y.getState());
993
993
  }, It = (r) => {
994
994
  if (!r) {
995
995
  Re?.remove(), Re = null;
@@ -1000,14 +1000,14 @@ async function ta(e = {}) {
1000
1000
  "New chat",
1001
1001
  za(),
1002
1002
  !1
1003
- ), Re.addEventListener("click", Xo), Xe.insertBefore(Re, X));
1003
+ ), Re.addEventListener("click", () => xn()), Xe.insertBefore(Re, X));
1004
1004
  }, G = (r) => {
1005
1005
  if (xe(), an(r.lastErrorCode) ? Te = r.lastErrorCode : t.billingStatus?.creditsUsed !== null && !ae(t.billingStatus) && (Te = null), Ht(
1006
1006
  H,
1007
1007
  t.billingStatus,
1008
1008
  Te
1009
1009
  ), t.loginRequired) {
1010
- Lt.clear(), Vn(
1010
+ Lt.clear(), Kn(
1011
1011
  A,
1012
1012
  ce,
1013
1013
  It,
@@ -1020,7 +1020,7 @@ async function ta(e = {}) {
1020
1020
  return;
1021
1021
  }
1022
1022
  if (t.signupRequired) {
1023
- Lt.clear(), Vn(
1023
+ Lt.clear(), Kn(
1024
1024
  A,
1025
1025
  ce,
1026
1026
  It,
@@ -1053,7 +1053,7 @@ async function ta(e = {}) {
1053
1053
  (M) => {
1054
1054
  we = !0, ee(!0, "send"), te(), y.sendMessage(M);
1055
1055
  },
1056
- Ko && !bt ? {
1056
+ Yo && !bt ? {
1057
1057
  dismissedCandidateIds: Ze,
1058
1058
  draftingCandidateId: ot,
1059
1059
  error: qe,
@@ -1071,7 +1071,7 @@ async function ta(e = {}) {
1071
1071
  bt = !0, Le.add(M.id), Ze.add(M.id), U(), Cr(t, !0), qe = null, G(y.getState());
1072
1072
  }
1073
1073
  } : void 0
1074
- ), L ? (_e = A.scrollTop, te()) : _ && xa(r) && zo();
1074
+ ), L ? (_e = A.scrollTop, te()) : _ && xa(r) && Mo();
1075
1075
  };
1076
1076
  return _n = fi(
1077
1077
  (r) => {
@@ -1079,13 +1079,13 @@ async function ta(e = {}) {
1079
1079
  },
1080
1080
  {
1081
1081
  backendUrl: t.backendUrl,
1082
- fetcher: Ro,
1082
+ fetcher: zo,
1083
1083
  loader: t.activeUsersLoader
1084
1084
  }
1085
1085
  ), y.on("state", (r) => {
1086
1086
  const s = fn && !r.isThinking;
1087
1087
  fn = r.isThinking, r.isThinking && !r.assistantDraft.trim() && je && !Ne && Ae === null && Oe?.hidden !== !1 && (Ae = window.setTimeout(() => {
1088
- Ae = null, Vo();
1088
+ Ae = null, Ko();
1089
1089
  }, yi)), (!r.isThinking || r.assistantDraft.trim()) && (wn(), it()), s && !i.classList.contains("pluno-pa-widget--open") && (Ge = !0), Ct(), r.appearance ? (kt = !0, J(
1090
1090
  "web-sdk.widget",
1091
1091
  "Agent state supplied appearance",
@@ -1103,13 +1103,14 @@ async function ta(e = {}) {
1103
1103
  ), Tt({}, "agent.state.appearance-cleared")), G(r), j(), s && un();
1104
1104
  }), G(y.getState()), j(), {
1105
1105
  agent: y,
1106
+ startNewChat: xn,
1106
1107
  host: n,
1107
1108
  updateAppearance: (r) => {
1108
1109
  r.scribbleStyle !== void 0 && (t.scribbleStyle = r.scribbleStyle), Tt(r, "widgetHandle.updateAppearance");
1109
1110
  },
1110
1111
  updateBillingStatus: (r) => {
1111
1112
  const s = r ?? null;
1112
- Gn(
1113
+ $n(
1113
1114
  t.billingStatus,
1114
1115
  s,
1115
1116
  Te
@@ -1142,7 +1143,7 @@ async function ta(e = {}) {
1142
1143
  Fe("minimized", !1);
1143
1144
  },
1144
1145
  destroy: () => {
1145
- Pe || (U(), Pe = !0, sn.disconnect(), mn?.disconnect(), $o(), window.removeEventListener("resize", dn), cn(), Fo(), le !== null && window.clearTimeout(le), wn(), _n(), Ie?.remove(), y.destroy(), ft.release(), n.remove());
1146
+ Pe || (U(), Pe = !0, sn.disconnect(), mn?.disconnect(), qo(), window.removeEventListener("resize", dn), cn(), Ho(), le !== null && window.clearTimeout(le), wn(), _n(), Ie?.remove(), y.destroy(), ft.release(), n.remove());
1146
1147
  }
1147
1148
  };
1148
1149
  async function Zo(r) {
@@ -1169,10 +1170,10 @@ async function ta(e = {}) {
1169
1170
  }
1170
1171
  function Tt(r, s) {
1171
1172
  const _ = r.accentColor ?? t.accentColor, L = r.colorScheme ?? t.colorScheme, M = r.fontFamily ?? t.fontFamily, At = r.scribbleStyle ?? t.scribbleStyle;
1172
- a = Dn(
1173
+ a = Rn(
1173
1174
  _,
1174
1175
  At
1175
- ), Rn(i, a, {
1176
+ ), zn(i, a, {
1176
1177
  accentColor: _,
1177
1178
  colorScheme: L,
1178
1179
  fontFamily: M,
@@ -1188,7 +1189,7 @@ async function ta(e = {}) {
1188
1189
  });
1189
1190
  }
1190
1191
  }
1191
- function Dn(e, t) {
1192
+ function Rn(e, t) {
1192
1193
  return { accentColor: e, scribbleStyle: t };
1193
1194
  }
1194
1195
  function na(e) {
@@ -1214,7 +1215,7 @@ function ia([e, t, n]) {
1214
1215
  };
1215
1216
  return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
1216
1217
  }
1217
- function Rn(e, t, n) {
1218
+ function zn(e, t, n) {
1218
1219
  e.classList.toggle(
1219
1220
  "pluno-pa-widget--dark",
1220
1221
  n.colorScheme === "dark"
@@ -1222,7 +1223,7 @@ function Rn(e, t, n) {
1222
1223
  "pluno-pa-widget--light",
1223
1224
  n.colorScheme !== "dark"
1224
1225
  ), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
1225
- const o = n.scribbleStyle ? Qn(n.accentColor) : n.accentColor;
1226
+ const o = n.scribbleStyle ? eo(n.accentColor) : n.accentColor;
1226
1227
  e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
1227
1228
  "--pluno-pa-accent-contrast",
1228
1229
  na(o)
@@ -1239,10 +1240,10 @@ function Rn(e, t, n) {
1239
1240
  );
1240
1241
  }
1241
1242
  function aa(e) {
1242
- if (e.getElementById(In))
1243
+ if (e.getElementById(Tn))
1243
1244
  return;
1244
1245
  const t = e.createElement("style");
1245
- t.id = In, t.textContent = `@font-face {
1246
+ t.id = Tn, t.textContent = `@font-face {
1246
1247
  font-family: "Architects Daughter";
1247
1248
  font-style: normal;
1248
1249
  font-weight: 400;
@@ -1284,7 +1285,7 @@ function ra({
1284
1285
  }, w = (h) => {
1285
1286
  if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
1286
1287
  return;
1287
- const P = h.shiftKey ? so : po, T = o();
1288
+ const P = h.shiftKey ? co : so, T = o();
1288
1289
  let k = null;
1289
1290
  h.key === "ArrowUp" ? k = { x: T.x, y: T.y - P } : h.key === "ArrowDown" ? k = { x: T.x, y: T.y + P } : h.key === "ArrowLeft" ? k = { x: T.x - P, y: T.y } : h.key === "ArrowRight" && (k = { x: T.x + P, y: T.y }), k && (h.preventDefault(), h.stopPropagation(), i(k), a());
1290
1291
  };
@@ -1304,23 +1305,23 @@ function la({
1304
1305
  a = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
1305
1306
  }, m = (g) => {
1306
1307
  const w = g.currentTarget, h = w.dataset.resizeDirection;
1307
- !e.classList.contains("pluno-pa-widget--open") || !zn(h) || (g.preventDefault(), g.stopPropagation(), a = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, w.setPointerCapture?.(g.pointerId));
1308
+ !e.classList.contains("pluno-pa-widget--open") || !Mn(h) || (g.preventDefault(), g.stopPropagation(), a = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, w.setPointerCapture?.(g.pointerId));
1308
1309
  }, E = (g) => {
1309
1310
  if (a !== g.pointerId || !l || !p || !d)
1310
1311
  return;
1311
1312
  g.preventDefault(), g.stopPropagation();
1312
1313
  const w = g.clientX - p.x, h = g.clientY - p.y;
1313
1314
  !c && Math.hypot(w, h) < Yt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
1314
- Mn(d, l, w, h)
1315
+ On(d, l, w, h)
1315
1316
  ));
1316
1317
  }, v = (g) => {
1317
1318
  a === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
1318
1319
  }, z = (g) => {
1319
1320
  a === g.pointerId && (g.preventDefault(), u());
1320
1321
  }, b = (g) => {
1321
- const h = g.currentTarget.dataset.resizeDirection, P = g.shiftKey ? so : po, T = n();
1322
+ const h = g.currentTarget.dataset.resizeDirection, P = g.shiftKey ? co : so, T = n();
1322
1323
  let k = 0, F = 0;
1323
- zn(h) && (g.key === "ArrowLeft" ? k = -P : g.key === "ArrowRight" ? k = P : g.key === "ArrowUp" ? F = -P : g.key === "ArrowDown" && (F = P), !(k === 0 && F === 0) && (g.preventDefault(), g.stopPropagation(), o(Mn(T, h, k, F)), i()));
1324
+ Mn(h) && (g.key === "ArrowLeft" ? k = -P : g.key === "ArrowRight" ? k = P : g.key === "ArrowUp" ? F = -P : g.key === "ArrowDown" && (F = P), !(k === 0 && F === 0) && (g.preventDefault(), g.stopPropagation(), o(On(T, h, k, F)), i()));
1324
1325
  };
1325
1326
  for (const g of t)
1326
1327
  g.addEventListener("pointerdown", m), g.addEventListener("pointermove", E), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", z), g.addEventListener("keydown", b);
@@ -1329,11 +1330,11 @@ function la({
1329
1330
  g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", E), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", z), g.removeEventListener("keydown", b);
1330
1331
  };
1331
1332
  }
1332
- function zn(e) {
1333
+ function Mn(e) {
1333
1334
  return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
1334
1335
  }
1335
- function Mn(e, t, n, o) {
1336
- const i = Y(), a = On({
1336
+ function On(e, t, n, o) {
1337
+ const i = Y(), a = Un({
1337
1338
  leading: e.position.x,
1338
1339
  length: e.size.width,
1339
1340
  delta: n,
@@ -1345,7 +1346,7 @@ function Mn(e, t, n, o) {
1345
1346
  tn,
1346
1347
  i.width - I * 2
1347
1348
  )
1348
- }), l = On({
1349
+ }), l = Un({
1349
1350
  leading: e.position.y,
1350
1351
  length: e.size.height,
1351
1352
  delta: o,
@@ -1363,7 +1364,7 @@ function Mn(e, t, n, o) {
1363
1364
  size: { width: a.length, height: l.length }
1364
1365
  };
1365
1366
  }
1366
- function On({
1367
+ function Un({
1367
1368
  leading: e,
1368
1369
  length: t,
1369
1370
  delta: n,
@@ -1412,11 +1413,11 @@ function ct(e, t = !0) {
1412
1413
  return e.classList.contains("pluno-pa-widget--scribble") ? {
1413
1414
  width: Hi,
1414
1415
  height: Wi
1415
- } : { width: Tn, height: Tn };
1416
+ } : { width: An, height: An };
1416
1417
  const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
1417
1418
  return {
1418
- width: t && i && o.width > 0 ? o.width : Math.min(ao, n.width - 36),
1419
- height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? $i : ro
1419
+ width: t && i && o.width > 0 ? o.width : Math.min(ro, n.width - 36),
1420
+ height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? $i : lo
1420
1421
  };
1421
1422
  }
1422
1423
  function pa() {
@@ -1495,7 +1496,7 @@ function zt(e, t, n) {
1495
1496
  const o = ct(e, !1);
1496
1497
  return t ? Xt(
1497
1498
  e,
1498
- go(t, o),
1499
+ ho(t, o),
1499
1500
  o
1500
1501
  ) : da(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Gi);
1501
1502
  }
@@ -1527,7 +1528,7 @@ function Xt(e, t, n) {
1527
1528
  )
1528
1529
  };
1529
1530
  }
1530
- function go(e, t) {
1531
+ function ho(e, t) {
1531
1532
  const n = Y();
1532
1533
  return {
1533
1534
  x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
@@ -1587,13 +1588,13 @@ function Ce(e, t) {
1587
1588
  function ha(e, t) {
1588
1589
  e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
1589
1590
  }
1590
- function Un(e) {
1591
+ function Bn(e) {
1591
1592
  e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
1592
1593
  }
1593
1594
  function Y() {
1594
1595
  return {
1595
- width: window.innerWidth || document.documentElement.clientWidth || ao + I * 2,
1596
- height: window.innerHeight || document.documentElement.clientHeight || ro + I * 2
1596
+ width: window.innerWidth || document.documentElement.clientWidth || ro + I * 2,
1597
+ height: window.innerHeight || document.documentElement.clientHeight || lo + I * 2
1597
1598
  };
1598
1599
  }
1599
1600
  function Ot(e) {
@@ -1723,7 +1724,7 @@ function Ea(e, t, n, o) {
1723
1724
  d.type = "button", d.className = "pluno-pa-widget__launcher-drag-handle", d.setAttribute("aria-label", "Move Pluno launcher"), d.title = "Move Pluno launcher", i.appendChild(d);
1724
1725
  }
1725
1726
  i.appendChild(
1726
- wo(
1727
+ bo(
1727
1728
  "pluno-pa-widget__scribble-spirals--launcher",
1728
1729
  10
1729
1730
  )
@@ -1747,7 +1748,7 @@ function Ea(e, t, n, o) {
1747
1748
  function ka(e) {
1748
1749
  const t = document.createElement("section");
1749
1750
  t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
1750
- wo("pluno-pa-widget__scribble-spirals--panel", 16)
1751
+ bo("pluno-pa-widget__scribble-spirals--panel", 16)
1751
1752
  );
1752
1753
  const n = document.createElement("div");
1753
1754
  n.className = "pluno-pa-widget__timeline-wrap";
@@ -1820,7 +1821,7 @@ function Pa() {
1820
1821
  const p = document.createElement("textarea");
1821
1822
  p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
1822
1823
  const d = document.createElement("button");
1823
- d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(_o()), i.appendChild(d), e.appendChild(i);
1824
+ d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(xo()), i.appendChild(d), e.appendChild(i);
1824
1825
  const c = document.createElement("div");
1825
1826
  c.className = "pluno-pa-widget__composer-meta";
1826
1827
  const u = document.createElement("a");
@@ -1857,13 +1858,13 @@ function Ta(e) {
1857
1858
  "pluno-pa-widget__character--empty",
1858
1859
  e
1859
1860
  )
1860
- ), t.appendChild(ho()), t;
1861
+ ), t.appendChild(mo()), t;
1861
1862
  }
1862
- function ho() {
1863
+ function mo() {
1863
1864
  const e = document.createElement("div");
1864
1865
  return e.className = "pluno-pa-widget__empty", e.appendChild(document.createTextNode("Hey there, I'm Pluno 👋")), e.appendChild(document.createElement("br")), e.appendChild(document.createTextNode("What do you want to do today?")), e;
1865
1866
  }
1866
- function mo(e, t) {
1867
+ function fo(e, t) {
1867
1868
  e.replaceChildren(), e.setAttribute(
1868
1869
  "aria-label",
1869
1870
  `${t.toLocaleString("en-US")} users currently active`
@@ -1876,8 +1877,8 @@ function mo(e, t) {
1876
1877
  );
1877
1878
  }
1878
1879
  function fe(e, t) {
1879
- const n = `pluno-pa-character-${Nn}`;
1880
- Nn += 1;
1880
+ const n = `pluno-pa-character-${Dn}`;
1881
+ Dn += 1;
1881
1882
  const o = t.scribbleStyle ? Na(t.accentColor, n) : Aa(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
1882
1883
  return o.setAttribute(
1883
1884
  "class",
@@ -1896,7 +1897,7 @@ function Aa(e, t) {
1896
1897
  eyeShadow: `${t}-eyeShadow`,
1897
1898
  pupilGloss: `${t}-pupilGloss`,
1898
1899
  boltClip: `${t}-boltClip`
1899
- }, i = fo(), a = f(i, "defs"), l = f(a, "linearGradient", {
1900
+ }, i = wo(), a = f(i, "defs"), l = f(a, "linearGradient", {
1900
1901
  id: o.boltFill,
1901
1902
  x1: "420",
1902
1903
  y1: "180",
@@ -2059,7 +2060,7 @@ function Aa(e, t) {
2059
2060
  opacity: "0.48"
2060
2061
  });
2061
2062
  const P = f(i, "g", { filter: V(o.eyeShadow) });
2062
- return Bn(
2063
+ return Fn(
2063
2064
  P,
2064
2065
  "rotate(-2 528 463)",
2065
2066
  "528",
@@ -2069,7 +2070,7 @@ function Aa(e, t) {
2069
2070
  "557",
2070
2071
  "447",
2071
2072
  o
2072
- ), Bn(
2073
+ ), Fn(
2073
2074
  P,
2074
2075
  "rotate(2 717 462)",
2075
2076
  "717",
@@ -2082,10 +2083,10 @@ function Aa(e, t) {
2082
2083
  ), i;
2083
2084
  }
2084
2085
  function Na(e, t) {
2085
- const n = Qn(e), o = {
2086
+ const n = eo(e), o = {
2086
2087
  clip: `${t}-scribbleBoltClip`,
2087
2088
  wobble: `${t}-scribbleBoltWobble`
2088
- }, i = fo(), a = f(i, "defs"), l = f(a, "clipPath", { id: o.clip });
2089
+ }, i = wo(), a = f(i, "defs"), l = f(a, "clipPath", { id: o.clip });
2089
2090
  f(l, "path", { d: st });
2090
2091
  const p = f(a, "filter", {
2091
2092
  id: o.wobble,
@@ -2126,7 +2127,7 @@ function Na(e, t) {
2126
2127
  stroke: dt,
2127
2128
  "stroke-width": "18",
2128
2129
  "stroke-linejoin": "round"
2129
- }), Fn(
2130
+ }), Hn(
2130
2131
  d,
2131
2132
  "rotate(-2 528 463)",
2132
2133
  "528",
@@ -2135,7 +2136,7 @@ function Na(e, t) {
2135
2136
  "473",
2136
2137
  "557",
2137
2138
  "447"
2138
- ), Fn(
2139
+ ), Hn(
2139
2140
  d,
2140
2141
  "rotate(2 717 462)",
2141
2142
  "717",
@@ -2146,13 +2147,13 @@ function Na(e, t) {
2146
2147
  "447"
2147
2148
  ), i;
2148
2149
  }
2149
- function fo() {
2150
+ function wo() {
2150
2151
  return S("svg", {
2151
- xmlns: lo,
2152
+ xmlns: po,
2152
2153
  viewBox: "0 0 1254 1254"
2153
2154
  });
2154
2155
  }
2155
- function Bn(e, t, n, o, i, a, l, p, d) {
2156
+ function Fn(e, t, n, o, i, a, l, p, d) {
2156
2157
  const c = f(e, "g", { transform: t });
2157
2158
  f(c, "ellipse", {
2158
2159
  cx: n,
@@ -2174,7 +2175,7 @@ function Bn(e, t, n, o, i, a, l, p, d) {
2174
2175
  fill: "#ffffff"
2175
2176
  });
2176
2177
  }
2177
- function Fn(e, t, n, o, i, a, l, p) {
2178
+ function Hn(e, t, n, o, i, a, l, p) {
2178
2179
  const d = f(e, "g", { transform: t });
2179
2180
  f(d, "ellipse", {
2180
2181
  cx: n,
@@ -2226,14 +2227,14 @@ function Da() {
2226
2227
  Ft("pluno-pa-scribble-wobble-3", "9", "19")
2227
2228
  ), e.appendChild(t), e;
2228
2229
  }
2229
- function wo(e, t) {
2230
+ function bo(e, t) {
2230
2231
  const n = S("svg", {
2231
2232
  class: `pluno-pa-widget__scribble-spirals ${e}`,
2232
2233
  preserveAspectRatio: "xMidYMid meet",
2233
2234
  "aria-hidden": "true",
2234
2235
  focusable: "false"
2235
2236
  });
2236
- return bo(n, t), n;
2237
+ return _o(n, t), n;
2237
2238
  }
2238
2239
  function Bt(e, t) {
2239
2240
  if (!e)
@@ -2247,9 +2248,9 @@ function Bt(e, t) {
2247
2248
  (n - Vt * 2) / jt
2248
2249
  )
2249
2250
  );
2250
- bo(e, o);
2251
+ _o(e, o);
2251
2252
  }
2252
- function bo(e, t) {
2253
+ function _o(e, t) {
2253
2254
  if (e.dataset.spiralCount === `${t}`)
2254
2255
  return;
2255
2256
  const n = t * jt + Vt * 2;
@@ -2258,7 +2259,7 @@ function bo(e, t) {
2258
2259
  `0 0 ${n} ${Yi}`
2259
2260
  ), e.replaceChildren();
2260
2261
  for (let o = 0; o < t; o += 1) {
2261
- const i = An[o % An.length], a = S("g", {
2262
+ const i = Nn[o % Nn.length], a = S("g", {
2262
2263
  transform: `translate(${Vt + o * jt} 0)`
2263
2264
  });
2264
2265
  a.appendChild(
@@ -2378,7 +2379,7 @@ function Oa() {
2378
2379
  );
2379
2380
  return e.appendChild(S("path", { d: "M18 6 6 18" })), e.appendChild(S("path", { d: "m6 6 12 12" })), e;
2380
2381
  }
2381
- function _o() {
2382
+ function xo() {
2382
2383
  const e = re(
2383
2384
  "0 0 24 24",
2384
2385
  14,
@@ -2482,12 +2483,12 @@ function re(e, t, n, o, i, a) {
2482
2483
  return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), a && (l["stroke-width"] = a), S("svg", l);
2483
2484
  }
2484
2485
  function S(e, t = {}) {
2485
- const n = document.createElementNS(lo, e);
2486
+ const n = document.createElementNS(po, e);
2486
2487
  for (const [o, i] of Object.entries(t))
2487
2488
  n.setAttribute(o, i);
2488
2489
  return n;
2489
2490
  }
2490
- function Hn(e) {
2491
+ function Wn(e) {
2491
2492
  for (const t of ["keydown", "keypress", "keyup"])
2492
2493
  e.addEventListener(t, (n) => {
2493
2494
  n.stopPropagation();
@@ -2505,7 +2506,7 @@ function Ga(e, t, n) {
2505
2506
  }
2506
2507
  }
2507
2508
  function $a(e) {
2508
- const t = on(e), n = xo(e);
2509
+ const t = on(e), n = yo(e);
2509
2510
  if (t === "image" && n) {
2510
2511
  const o = document.createElement("img");
2511
2512
  return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ie(e))), o;
@@ -2517,7 +2518,7 @@ function $a(e) {
2517
2518
  return ie(e);
2518
2519
  }
2519
2520
  function qa(e) {
2520
- const t = on(e), n = xo(e);
2521
+ const t = on(e), n = yo(e);
2521
2522
  if (t === "image" && n) {
2522
2523
  const o = document.createElement("img");
2523
2524
  return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(ie(e, "message"))), o;
@@ -2535,22 +2536,22 @@ function qa(e) {
2535
2536
  function ie(e, t = "composer") {
2536
2537
  if (t === "composer") {
2537
2538
  const a = document.createElement("span");
2538
- return a.className = "pluno-pa-widget__attachment-file", a.textContent = Wn(e), a;
2539
+ return a.className = "pluno-pa-widget__attachment-file", a.textContent = Gn(e), a;
2539
2540
  }
2540
2541
  const n = document.createElement("div");
2541
2542
  n.className = "pluno-pa-widget__message-attachment-file";
2542
2543
  const o = document.createElement("span");
2543
- o.textContent = Wn(e);
2544
+ o.textContent = Gn(e);
2544
2545
  const i = document.createElement("strong");
2545
2546
  return i.textContent = e.name, n.append(o, i), n;
2546
2547
  }
2547
2548
  function on(e) {
2548
2549
  return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
2549
2550
  }
2550
- function xo(e) {
2551
+ function yo(e) {
2551
2552
  return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
2552
2553
  }
2553
- function Wn(e) {
2554
+ function Gn(e) {
2554
2555
  const t = on(e);
2555
2556
  return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
2556
2557
  }
@@ -2573,7 +2574,7 @@ function Ht(e, t, n = null) {
2573
2574
  }
2574
2575
  e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", ae(t) || an(n) ? e.appendChild(
2575
2576
  Ka(t, n)
2576
- ) : yo(t) && e.appendChild(Ya(t));
2577
+ ) : vo(t) && e.appendChild(Ya(t));
2577
2578
  }
2578
2579
  function Ka(e, t) {
2579
2580
  const n = document.createElement("div");
@@ -2582,7 +2583,7 @@ function Ka(e, t) {
2582
2583
  i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
2583
2584
  const a = document.createElement("span");
2584
2585
  return a.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(a), n.appendChild(
2585
- vo(
2586
+ Co(
2586
2587
  e,
2587
2588
  "Upgrade plan",
2588
2589
  "pluno-pa-widget__billing-action-card-actions"
@@ -2596,7 +2597,7 @@ function Ya(e) {
2596
2597
  n.textContent = "Credits running low", t.appendChild(n);
2597
2598
  const o = document.createElement("span");
2598
2599
  return o.textContent = Za(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
2599
- vo(
2600
+ Co(
2600
2601
  e,
2601
2602
  "Upgrade",
2602
2603
  "pluno-pa-widget__billing-action-card-actions"
@@ -2604,9 +2605,9 @@ function Ya(e) {
2604
2605
  ), t;
2605
2606
  }
2606
2607
  function Jt(e, t) {
2607
- return e !== null && (ae(e) || yo(e) || an(t));
2608
+ return e !== null && (ae(e) || vo(e) || an(t));
2608
2609
  }
2609
- function Gn(e, t, n) {
2610
+ function $n(e, t, n) {
2610
2611
  return Jt(t, n) || Xa(t) ? !0 : !Jt(e, n);
2611
2612
  }
2612
2613
  function Xa(e) {
@@ -2618,7 +2619,7 @@ function ae(e) {
2618
2619
  function an(e) {
2619
2620
  return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
2620
2621
  }
2621
- function yo(e) {
2622
+ function vo(e) {
2622
2623
  return !ae(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2623
2624
  }
2624
2625
  function Za(e) {
@@ -2629,15 +2630,15 @@ function Ja(e) {
2629
2630
  maximumFractionDigits: 0
2630
2631
  }).format(Math.ceil(e));
2631
2632
  }
2632
- function vo(e, t, n) {
2633
+ function Co(e, t, n) {
2633
2634
  const o = document.createElement("div");
2634
2635
  return o.className = n, o.appendChild(
2635
- $n(t, e.pricingUrl)
2636
+ qn(t, e.pricingUrl)
2636
2637
  ), o.appendChild(
2637
- $n("Earn credits", e.earnCreditsUrl)
2638
+ qn("Earn credits", e.earnCreditsUrl)
2638
2639
  ), o;
2639
2640
  }
2640
- function $n(e, t) {
2641
+ function qn(e, t) {
2641
2642
  const n = document.createElement("button");
2642
2643
  if (n.type = "button", e === "Earn credits") {
2643
2644
  const o = document.createElement("span");
@@ -2650,16 +2651,16 @@ function $n(e, t) {
2650
2651
  }
2651
2652
  function Wt(e, t) {
2652
2653
  return e.messages.filter(
2653
- (o) => !Co(o)
2654
+ (o) => !So(o)
2654
2655
  ).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
2655
2656
  }
2656
2657
  function Qa(e, t, n, o, i, a, l, p, d, c, u, m, E, v, z, b) {
2657
2658
  const g = or(a), w = g.filter(
2658
- (C) => !Co(C)
2659
+ (C) => !So(C)
2659
2660
  ), h = e.scrollTop, P = [], T = /* @__PURE__ */ new Set(), k = (C) => {
2660
2661
  P.push(C);
2661
2662
  };
2662
- Eo(n, a.isThinking), i.hidden = !p, p && l !== null && mo(i, l);
2663
+ ko(n, a.isThinking), i.hidden = !p, p && l !== null && fo(i, l);
2663
2664
  const F = w.length > 0 || !!a.assistantDraft || a.isThinking;
2664
2665
  if (o(F), w.length === 0 && !a.assistantDraft && !a.lastError && !a.isThinking) {
2665
2666
  const C = document.createElement("div");
@@ -2670,7 +2671,7 @@ function Qa(e, t, n, o, i, a, l, p, d, c, u, m, E, v, z, b) {
2670
2671
  "pluno-pa-widget__character--empty",
2671
2672
  v()
2672
2673
  );
2673
- N.appendChild(Ee), C.appendChild(N), C.appendChild(ho());
2674
+ N.appendChild(Ee), C.appendChild(N), C.appendChild(mo());
2674
2675
  const q = document.createElement("div");
2675
2676
  if (q.className = a.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", a.starterPrompts.length === 0 && !a.starterPromptsLoading && q.setAttribute("aria-hidden", "true"), a.starterPrompts.length > 0)
2676
2677
  for (const R of a.starterPrompts) {
@@ -2687,7 +2688,7 @@ function Qa(e, t, n, o, i, a, l, p, d, c, u, m, E, v, z, b) {
2687
2688
  const D = document.createElement("button");
2688
2689
  D.type = "button", D.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", D.disabled = !0, D.tabIndex = -1, D.textContent = "", q.appendChild(D);
2689
2690
  }
2690
- C.appendChild(q), m.clear(), k(C), k(t), qn(e, P);
2691
+ C.appendChild(q), m.clear(), k(C), k(t), jn(e, P);
2691
2692
  return;
2692
2693
  }
2693
2694
  let H = null, $ = null, Q = [];
@@ -2713,7 +2714,7 @@ function Qa(e, t, n, o, i, a, l, p, d, c, u, m, E, v, z, b) {
2713
2714
  const A = ut();
2714
2715
  k(A), H = null, $ = A;
2715
2716
  } else {
2716
- const A = Kn(v());
2717
+ const A = Yn(v());
2717
2718
  k(A), H = null, $ = A;
2718
2719
  }
2719
2720
  continue;
@@ -2722,7 +2723,7 @@ function Qa(e, t, n, o, i, a, l, p, d, c, u, m, E, v, z, b) {
2722
2723
  continue;
2723
2724
  const Ee = x(), q = ur(N.content);
2724
2725
  if (N.role === "assistant" && !Ee) {
2725
- const D = So(v());
2726
+ const D = Eo(v());
2726
2727
  k(D), H = null, $ = D;
2727
2728
  }
2728
2729
  const R = er(N, q, m, T);
@@ -2734,7 +2735,7 @@ function Qa(e, t, n, o, i, a, l, p, d, c, u, m, E, v, z, b) {
2734
2735
  const C = ut();
2735
2736
  k(C), H = null, $ = C;
2736
2737
  } else {
2737
- const C = Kn(v());
2738
+ const C = Yn(v());
2738
2739
  k(C), H = null, $ = C;
2739
2740
  }
2740
2741
  if (a.lastError) {
@@ -2753,7 +2754,7 @@ function Qa(e, t, n, o, i, a, l, p, d, c, u, m, E, v, z, b) {
2753
2754
  });
2754
2755
  k(C), b.onSeen(X), H = null, $ = C;
2755
2756
  }
2756
- H?.classList.add("pluno-pa-widget__message--bottom-reserve"), $?.classList.add("pluno-pa-widget__bottom-reserve-compact"), k(t), nr(m, T), qn(e, P), d ? Ke(e, c) : e.scrollTop = h;
2757
+ H?.classList.add("pluno-pa-widget__message--bottom-reserve"), $?.classList.add("pluno-pa-widget__bottom-reserve-compact"), k(t), nr(m, T), jn(e, P), d ? Ke(e, c) : e.scrollTop = h;
2757
2758
  }
2758
2759
  function er(e, t, n, o) {
2759
2760
  const i = tr(e, t), a = i ? n.get(i) : void 0;
@@ -2786,7 +2787,7 @@ function nr(e, t) {
2786
2787
  for (const n of e.keys())
2787
2788
  t.has(n) || e.delete(n);
2788
2789
  }
2789
- function qn(e, t) {
2790
+ function jn(e, t) {
2790
2791
  let n = e.firstChild;
2791
2792
  for (const o of t) {
2792
2793
  if (o === n) {
@@ -2820,7 +2821,7 @@ function or(e) {
2820
2821
  if (n === -1)
2821
2822
  return [...e.messages, t];
2822
2823
  const o = e.messages.findIndex(
2823
- (a, l) => l > n && a.role !== "user" && a.respondsToUserMessageId === t.respondsToUserMessageId && jn(a, t) && Qt(a)
2824
+ (a, l) => l > n && a.role !== "user" && a.respondsToUserMessageId === t.respondsToUserMessageId && Vn(a, t) && Qt(a)
2824
2825
  );
2825
2826
  if (o !== -1)
2826
2827
  return [
@@ -2829,7 +2830,7 @@ function or(e) {
2829
2830
  ...e.messages.slice(o + 1)
2830
2831
  ];
2831
2832
  let i = n + 1;
2832
- for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && jn(e.messages[i], t); )
2833
+ for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && Vn(e.messages[i], t); )
2833
2834
  i += 1;
2834
2835
  return [
2835
2836
  ...e.messages.slice(0, i),
@@ -2840,11 +2841,11 @@ function or(e) {
2840
2841
  function Qt(e) {
2841
2842
  return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
2842
2843
  }
2843
- function jn(e, t) {
2844
+ function Vn(e, t) {
2844
2845
  return !e.runId || !t.runId ? !0 : e.runId === t.runId;
2845
2846
  }
2846
- function Vn(e, t, n, o, i, a, l, p) {
2847
- e.replaceChildren(), Eo(t, !1), t.disabled = !0, n(!1);
2847
+ function Kn(e, t, n, o, i, a, l, p) {
2848
+ e.replaceChildren(), ko(t, !1), t.disabled = !0, n(!1);
2848
2849
  const d = document.createElement("div");
2849
2850
  d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
2850
2851
  const c = fe(
@@ -3034,8 +3035,8 @@ function cr() {
3034
3035
  "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
3035
3036
  ), e;
3036
3037
  }
3037
- function Co(e) {
3038
- return e.role === "tool" && e.toolName === to;
3038
+ function So(e) {
3039
+ return e.role === "tool" && e.toolName === no;
3039
3040
  }
3040
3041
  function ur(e) {
3041
3042
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
@@ -3070,7 +3071,7 @@ function gr(e, t, n, o) {
3070
3071
  }
3071
3072
  return i.appendChild(a), i;
3072
3073
  }
3073
- function So(e) {
3074
+ function Eo(e) {
3074
3075
  const t = document.createElement("article");
3075
3076
  return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
3076
3077
  fe(
@@ -3079,8 +3080,8 @@ function So(e) {
3079
3080
  )
3080
3081
  ), t;
3081
3082
  }
3082
- function Kn(e) {
3083
- const t = So(e);
3083
+ function Yn(e) {
3084
+ const t = Eo(e);
3084
3085
  return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(ut()), t;
3085
3086
  }
3086
3087
  function ut(e = "Thinking...") {
@@ -3098,8 +3099,8 @@ function en() {
3098
3099
  const e = document.createElement("span");
3099
3100
  return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
3100
3101
  }
3101
- function Eo(e, t) {
3102
- e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Fa() : _o());
3102
+ function ko(e, t) {
3103
+ e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Fa() : xo());
3103
3104
  }
3104
3105
  function mr(e, t) {
3105
3106
  const n = t.replace(/\r\n/g, `
@@ -3195,7 +3196,7 @@ function fr(e) {
3195
3196
  return !1;
3196
3197
  }
3197
3198
  }
3198
- function Yn(e, t) {
3199
+ function Xn(e, t) {
3199
3200
  if (wr(e))
3200
3201
  return;
3201
3202
  const n = `
@@ -5468,20 +5469,20 @@ function Yn(e, t) {
5468
5469
  if (br(e, n))
5469
5470
  return;
5470
5471
  const o = e.ownerDocument.createElement("style");
5471
- o.id = co, o.textContent = n, e.appendChild(o), ko(e);
5472
+ o.id = uo, o.textContent = n, e.appendChild(o), Lo(e);
5472
5473
  }
5473
5474
  function wr(e) {
5474
- return e.getElementById(co) !== null || e.host instanceof HTMLElement && e.host.getAttribute(uo) === "true";
5475
+ return e.getElementById(uo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(go) === "true";
5475
5476
  }
5476
- function ko(e) {
5477
- e.host instanceof HTMLElement && e.host.setAttribute(uo, "true");
5477
+ function Lo(e) {
5478
+ e.host instanceof HTMLElement && e.host.setAttribute(go, "true");
5478
5479
  }
5479
5480
  function br(e, t) {
5480
5481
  if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
5481
5482
  return !1;
5482
5483
  try {
5483
5484
  const n = new CSSStyleSheet();
5484
- return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], ko(e), !0;
5485
+ return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Lo(e), !0;
5485
5486
  } catch {
5486
5487
  return !1;
5487
5488
  }
@@ -5494,7 +5495,7 @@ async function _r() {
5494
5495
  t.observe(document.documentElement, { childList: !0 });
5495
5496
  });
5496
5497
  }
5497
- function Lo(e) {
5498
+ function Po(e) {
5498
5499
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
5499
5500
  }
5500
5501
  function xr(e) {
@@ -5521,9 +5522,9 @@ function xr(e) {
5521
5522
  }
5522
5523
  function yr(e) {
5523
5524
  try {
5524
- const t = window.localStorage.getItem(Lo(e));
5525
+ const t = window.localStorage.getItem(Po(e));
5525
5526
  if (!t)
5526
- return Xn();
5527
+ return Zn();
5527
5528
  const n = JSON.parse(t);
5528
5529
  return {
5529
5530
  isOpen: n.isOpen === !0,
@@ -5535,18 +5536,18 @@ function yr(e) {
5535
5536
  ) : [],
5536
5537
  launcherPosition: Er(n.launcherPosition) ? n.launcherPosition : null,
5537
5538
  panelSize: kr(n.panelSize) ? gt(n.panelSize) : null,
5538
- seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-no) : [],
5539
+ seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-oo) : [],
5539
5540
  sharePromptsDisabled: n.sharePromptsDisabled === !0
5540
5541
  };
5541
5542
  } catch {
5542
- return Xn();
5543
+ return Zn();
5543
5544
  }
5544
5545
  }
5545
5546
  async function vr(e) {
5546
5547
  if (e.loadSharePromptsDisabled)
5547
5548
  return e.loadSharePromptsDisabled();
5548
5549
  try {
5549
- return window.localStorage.getItem(io) === "true";
5550
+ return window.localStorage.getItem(ao) === "true";
5550
5551
  } catch {
5551
5552
  return !1;
5552
5553
  }
@@ -5560,12 +5561,12 @@ function Cr(e, t) {
5560
5561
  return;
5561
5562
  }
5562
5563
  try {
5563
- t && window.localStorage.setItem(io, "true");
5564
+ t && window.localStorage.setItem(ao, "true");
5564
5565
  } catch {
5565
5566
  return;
5566
5567
  }
5567
5568
  }
5568
- function Xn() {
5569
+ function Zn() {
5569
5570
  return {
5570
5571
  isOpen: !1,
5571
5572
  composerValue: "",
@@ -5581,7 +5582,7 @@ function Xn() {
5581
5582
  function Sr(e, t) {
5582
5583
  try {
5583
5584
  window.localStorage.setItem(
5584
- Lo(e),
5585
+ Po(e),
5585
5586
  JSON.stringify(t)
5586
5587
  );
5587
5588
  } catch {
@@ -5600,7 +5601,7 @@ function kr(e) {
5600
5601
  const t = e;
5601
5602
  return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
5602
5603
  }
5603
- async function Po(e, t) {
5604
+ async function Io(e, t) {
5604
5605
  const n = await fetch(e, {
5605
5606
  method: "POST",
5606
5607
  credentials: "include",
@@ -5626,7 +5627,7 @@ function Lr(e) {
5626
5627
  let n = !1;
5627
5628
  const o = new Promise((i, a) => {
5628
5629
  const l = window.setTimeout(() => {
5629
- n = !0, t.abort(), a(new Error(kn));
5630
+ n = !0, t.abort(), a(new Error(Ln));
5630
5631
  }, Ai);
5631
5632
  t.signal.addEventListener(
5632
5633
  "abort",
@@ -5636,26 +5637,26 @@ function Lr(e) {
5636
5637
  });
5637
5638
  try {
5638
5639
  const i = await Promise.race([
5639
- Po(e, t.signal),
5640
+ Io(e, t.signal),
5640
5641
  o
5641
5642
  ]);
5642
5643
  return t.abort(), i;
5643
5644
  } catch (i) {
5644
- throw t.abort(), n ? new Error(kn) : i instanceof Error && i.message.startsWith("Pluno widget blocked on ") ? i : new Error(Ni);
5645
+ throw t.abort(), n ? new Error(Ln) : i instanceof Error && i.message.startsWith("Pluno widget blocked on ") ? i : new Error(Ni);
5645
5646
  }
5646
5647
  };
5647
5648
  }
5648
- const Zn = /* @__PURE__ */ new WeakSet();
5649
+ const Jn = /* @__PURE__ */ new WeakSet();
5649
5650
  function Pr(e) {
5650
5651
  return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
5651
5652
  }
5652
- function Jn(e) {
5653
+ function Qn(e) {
5653
5654
  const t = e.pathname.split("/");
5654
5655
  return t[t.length - 1] ?? "";
5655
5656
  }
5656
5657
  function Ir(e, t) {
5657
5658
  const n = new URL(e.src, document.baseURI);
5658
- return n.href === t.href || n.pathname === t.pathname ? !0 : Jn(n) === Jn(t);
5659
+ return n.href === t.href || n.pathname === t.pathname ? !0 : Qn(n) === Qn(t);
5659
5660
  }
5660
5661
  class de extends EventTarget {
5661
5662
  constructor(t, n) {
@@ -5747,12 +5748,12 @@ class de extends EventTarget {
5747
5748
  }
5748
5749
  function Tr() {
5749
5750
  const e = window.sessionStorage.getItem(
5750
- En
5751
+ kn
5751
5752
  );
5752
5753
  if (e)
5753
5754
  return e;
5754
5755
  const t = crypto.randomUUID();
5755
- return window.sessionStorage.setItem(En, t), t;
5756
+ return window.sessionStorage.setItem(kn, t), t;
5756
5757
  }
5757
5758
  function lt(e, t) {
5758
5759
  return `${e}:${t}`;
@@ -5770,17 +5771,17 @@ function Ar(e) {
5770
5771
  }
5771
5772
  function Nr(e) {
5772
5773
  for (const t of Ar(e))
5773
- Zn.has(t) || t.dataset.plunoAutoMount === "false" || (Zn.add(t), Io(t).catch((n) => {
5774
+ Jn.has(t) || t.dataset.plunoAutoMount === "false" || (Jn.add(t), To(t).catch((n) => {
5774
5775
  console.error("Failed to mount Pluno widget", n);
5775
5776
  }));
5776
5777
  }
5777
- function Io(e) {
5778
+ function To(e) {
5778
5779
  const t = window, n = t[se];
5779
5780
  if (n) {
5780
5781
  if (n.host === null)
5781
5782
  return n.mountPromise.catch(() => {
5782
5783
  const p = t[se];
5783
- return p ? p.mountPromise : Io(e);
5784
+ return p ? p.mountPromise : To(e);
5784
5785
  });
5785
5786
  if (Dr(n.host))
5786
5787
  return n.mountPromise;
@@ -5806,7 +5807,7 @@ function Io(e) {
5806
5807
  return;
5807
5808
  }
5808
5809
  const d = p.host;
5809
- d.setAttribute(oo, "true"), a.host = d, a.destroy = () => {
5810
+ d.setAttribute(io, "true"), a.host = d, a.destroy = () => {
5810
5811
  t[se] === a && delete t[se], a.host = null, a.destroy = null, p.destroy();
5811
5812
  };
5812
5813
  }).catch((p) => {
@@ -5819,7 +5820,7 @@ function Io(e) {
5819
5820
  }, t[se] = a, l;
5820
5821
  }
5821
5822
  function Dr(e) {
5822
- return e.isConnected && e.getAttribute(oo) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
5823
+ return e.isConnected && e.getAttribute(io) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
5823
5824
  }
5824
5825
  Nr(import.meta.url);
5825
5826
  export {