@pluno/product-agent-web 0.1.82 → 0.1.84

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,17 +1,17 @@
1
- import { PlunoProductAgent as ti, getProductAgentOriginAccessErrorMessage as ni } from "./product-agent-sdk.js";
2
- const oi = "#7c3aed", ft = "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", wt = "#2c2a1e", Tn = [253, 250, 241], In = 3.5;
3
- function po(e) {
4
- const t = so(e);
5
- if (An(nt(t), Tn) >= In)
1
+ import { PlunoProductAgent as ai, getProductAgentOriginAccessErrorMessage as ri } from "./product-agent-sdk.js";
2
+ const li = "#7c3aed", ft = "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", wt = "#2c2a1e", In = [253, 250, 241], An = 3.5;
3
+ function go(e) {
4
+ const t = ho(e);
5
+ if (Nn(nt(t), In) >= An)
6
6
  return t;
7
7
  let o = nt(t);
8
8
  const i = nt(wt);
9
9
  for (let r = 0; r < 6; r += 1)
10
- if (o = ri(o, i, 0.22), An(o, Tn) >= In)
11
- return Zt(o);
12
- return Zt(o);
10
+ if (o = di(o, i, 0.22), Nn(o, In) >= An)
11
+ return Jt(o);
12
+ return Jt(o);
13
13
  }
14
- function ii() {
14
+ function pi() {
15
15
  let n = "M 280 120", o = !1, i = 0;
16
16
  for (let r = 150; r <= 1170; r += 62) {
17
17
  const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
@@ -19,8 +19,8 @@ function ii() {
19
19
  }
20
20
  return n;
21
21
  }
22
- function ai(e) {
23
- const t = so(e), n = Jt(nt(t));
22
+ function si(e) {
23
+ const t = ho(e), n = Qt(nt(t));
24
24
  return n > 0.86 ? {
25
25
  top: "#ffffff",
26
26
  middle: "#f6f6f6",
@@ -44,21 +44,21 @@ function ai(e) {
44
44
  inner: "#4b4b4b",
45
45
  shadow: "#000000"
46
46
  } : {
47
- top: ie(t, 0.28, -0.03),
48
- middle: ie(t, 0.08, 0.04),
49
- bottom: ie(t, -0.1, 0.02),
50
- edgeStart: ie(t, 0.08, 0.08),
51
- edgeMiddle: ie(t, -0.08, 0.08),
52
- edgeEnd: ie(t, -0.18, 0.05),
53
- glow: ie(t, 0.32, -0.12),
54
- highlight: ie(t, 0.38, -0.18),
55
- inner: ie(t, 0.24, -0.1),
56
- shadow: ie(t, -0.25, -0.08)
47
+ top: ae(t, 0.28, -0.03),
48
+ middle: ae(t, 0.08, 0.04),
49
+ bottom: ae(t, -0.1, 0.02),
50
+ edgeStart: ae(t, 0.08, 0.08),
51
+ edgeMiddle: ae(t, -0.08, 0.08),
52
+ edgeEnd: ae(t, -0.18, 0.05),
53
+ glow: ae(t, 0.32, -0.12),
54
+ highlight: ae(t, 0.38, -0.18),
55
+ inner: ae(t, 0.24, -0.1),
56
+ shadow: ae(t, -0.25, -0.08)
57
57
  };
58
58
  }
59
- function so(e) {
59
+ function ho(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()}` : oi;
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()}` : li;
62
62
  }
63
63
  function nt(e) {
64
64
  return [
@@ -67,67 +67,67 @@ function nt(e) {
67
67
  Number.parseInt(e.slice(5, 7), 16)
68
68
  ];
69
69
  }
70
- function Zt([e, t, n]) {
70
+ function Jt([e, t, n]) {
71
71
  const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
72
72
  return `#${o(e)}${o(t)}${o(n)}`;
73
73
  }
74
- function Jt([e, t, n]) {
74
+ function Qt([e, t, n]) {
75
75
  const o = (i) => {
76
76
  const r = i / 255;
77
77
  return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
78
78
  };
79
79
  return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
80
80
  }
81
- function An(e, t) {
82
- const n = Jt(e), o = Jt(t), [i, r] = n > o ? [n, o] : [o, n];
81
+ function Nn(e, t) {
82
+ const n = Qt(e), o = Qt(t), [i, r] = n > o ? [n, o] : [o, n];
83
83
  return (i + 0.05) / (r + 0.05);
84
84
  }
85
- function ri(e, t, n) {
86
- const o = Qt(n);
85
+ function di(e, t, n) {
86
+ const o = en(n);
87
87
  return [
88
88
  e[0] + (t[0] - e[0]) * o,
89
89
  e[1] + (t[1] - e[1]) * o,
90
90
  e[2] + (t[2] - e[2]) * o
91
91
  ];
92
92
  }
93
- function ie(e, t, n) {
94
- const [o, i, r] = li(nt(e));
95
- return Zt(pi(o, Qt(i + n), Qt(r + t)));
93
+ function ae(e, t, n) {
94
+ const [o, i, r] = ci(nt(e));
95
+ return Jt(ui(o, en(i + n), en(r + t)));
96
96
  }
97
- function li([e, t, n]) {
97
+ function ci([e, t, n]) {
98
98
  const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), s = (l + p) / 2;
99
99
  if (l === p)
100
100
  return [0, 0, s];
101
- const c = l - p, u = s > 0.5 ? c / (2 - l - p) : c / (l + p);
102
- return [(l === o ? (i - r) / c + (i < r ? 6 : 0) : l === i ? (r - o) / c + 2 : (o - i) / c + 4) / 6, u, s];
101
+ const u = l - p, c = s > 0.5 ? u / (2 - l - p) : u / (l + p);
102
+ return [(l === o ? (i - r) / u + (i < r ? 6 : 0) : l === i ? (r - o) / u + 2 : (o - i) / u + 4) / 6, c, s];
103
103
  }
104
- function pi(e, t, n) {
104
+ function ui(e, t, n) {
105
105
  if (t === 0)
106
106
  return [n * 255, n * 255, n * 255];
107
107
  const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
108
108
  return [
109
- Ft(i, o, e + 1 / 3) * 255,
110
- Ft(i, o, e) * 255,
111
- Ft(i, o, e - 1 / 3) * 255
109
+ Ht(i, o, e + 1 / 3) * 255,
110
+ Ht(i, o, e) * 255,
111
+ Ht(i, o, e - 1 / 3) * 255
112
112
  ];
113
113
  }
114
- function Ft(e, t, n) {
114
+ function Ht(e, t, n) {
115
115
  let o = n;
116
116
  return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? e + (t - e) * 6 * o : o < 1 / 2 ? t : o < 2 / 3 ? e + (t - e) * (2 / 3 - o) * 6 : e;
117
117
  }
118
- function Qt(e) {
118
+ function en(e) {
119
119
  return Math.max(0, Math.min(1, e));
120
120
  }
121
- const co = "suggest_share_on_socials";
122
- function si(e) {
121
+ const mo = "suggest_share_on_socials";
122
+ function gi(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 !== co)
125
+ if (n.role !== "tool" || n.toolName !== mo)
126
126
  continue;
127
- const o = Nn(e, t, "assistant");
127
+ const o = Rn(e, t, "assistant");
128
128
  if (!o)
129
129
  return null;
130
- const i = Nn(e, o.index, "user");
130
+ const i = Rn(e, o.index, "user");
131
131
  return i ? {
132
132
  id: `share:${n.callId ?? n.id}`,
133
133
  userPrompt: i.content,
@@ -136,13 +136,13 @@ function si(e) {
136
136
  }
137
137
  return null;
138
138
  }
139
- async function di(e) {
140
- const t = await ci(e);
139
+ async function hi(e) {
140
+ const t = await mi(e);
141
141
  if (!navigator.clipboard || typeof ClipboardItem > "u")
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 Nn(e, t, n) {
145
+ function Rn(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())
@@ -150,73 +150,126 @@ function Nn(e, t, n) {
150
150
  }
151
151
  return null;
152
152
  }
153
- async function ci(e) {
153
+ async function mi(e) {
154
154
  return await (await fetch(e)).blob();
155
155
  }
156
- const ui = "https://app.pluno.ai", gi = "/api/product-agent/embed/active-users", hi = 1800, mi = 15e3, fi = 250, wi = 1e3, bi = 3e4;
157
- function _i(e, t = {}) {
156
+ const fi = "https://app.pluno.ai", wi = "/api/product-agent/embed/active-users", bi = 1800, _i = 15e3, xi = 250, yi = 1e3, vi = 3e4;
157
+ function Ci(e, t = {}) {
158
158
  let n = !1, o = null, i = null, r = null;
159
159
  const l = () => {
160
160
  r !== null && (window.clearInterval(r), r = null);
161
- }, p = (u) => {
161
+ }, p = (c) => {
162
162
  n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
163
- c();
164
- }, vi(u)));
165
- }, s = (u) => {
163
+ u();
164
+ }, ki(c)));
165
+ }, s = (c) => {
166
166
  if (l(), o === null) {
167
- o = u, e(u);
167
+ o = c, e(c);
168
168
  return;
169
169
  }
170
- const m = o, L = performance.now();
170
+ const h = o, k = performance.now();
171
171
  r = window.setInterval(() => {
172
172
  if (n) {
173
173
  l();
174
174
  return;
175
175
  }
176
- const v = Math.min(1, (performance.now() - L) / hi);
177
- o = Math.round(m + (u - m) * Ci(v)), e(o), v >= 1 && (o = u, e(u), l());
178
- }, fi);
179
- }, c = async () => {
176
+ const v = Math.min(1, (performance.now() - k) / bi);
177
+ o = Math.round(h + (c - h) * Li(v)), e(o), v >= 1 && (o = c, e(c), l());
178
+ }, xi);
179
+ }, u = async () => {
180
180
  try {
181
- const u = await xi(t);
181
+ const c = await Si(t);
182
182
  if (n)
183
183
  return;
184
- s(u.count), p(u.refreshAfterMs);
184
+ s(c.count), p(c.refreshAfterMs);
185
185
  } catch {
186
- p(mi);
186
+ p(_i);
187
187
  }
188
188
  };
189
- return c(), () => {
189
+ return u(), () => {
190
190
  n = !0, i !== null && window.clearTimeout(i), l();
191
191
  };
192
192
  }
193
- async function xi(e) {
193
+ async function Si(e) {
194
194
  if (e.loader)
195
195
  return e.loader();
196
- const n = await (e.fetcher ?? fetch)(new URL(gi, yi(e.backendUrl ?? ui)).toString(), {
196
+ const n = await (e.fetcher ?? fetch)(new URL(wi, Ei(e.backendUrl ?? fi)).toString(), {
197
197
  cache: "no-store",
198
198
  credentials: "omit"
199
199
  });
200
200
  if (!n.ok)
201
201
  throw new Error("Failed to load active users");
202
- const o = await n.json(), i = Rn(o.count), r = Rn(o.refreshAfterMs ?? o.refresh_after_ms);
202
+ const o = await n.json(), i = Dn(o.count), r = Dn(o.refreshAfterMs ?? o.refresh_after_ms);
203
203
  if (i === null || r === null)
204
204
  throw new Error("Invalid active users response");
205
205
  return { count: i, refreshAfterMs: r };
206
206
  }
207
- function Rn(e) {
207
+ function Dn(e) {
208
208
  return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
209
209
  }
210
- function yi(e) {
210
+ function Ei(e) {
211
211
  return e.endsWith("/") ? e : `${e}/`;
212
212
  }
213
- function vi(e) {
214
- return Math.min(bi, Math.max(wi, e));
213
+ function ki(e) {
214
+ return Math.min(vi, Math.max(yi, e));
215
215
  }
216
- function Ci(e) {
216
+ function Li(e) {
217
217
  return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
218
218
  }
219
- const uo = 100, Si = 1e4, Ei = 5e3, ki = "product-agent:sdk-preview-socket-connect", Li = "product-agent:sdk-preview-socket-send", Pi = "product-agent:sdk-preview-socket-close", Ti = "product-agent:sdk-preview-socket-open", Ii = "product-agent:sdk-preview-socket-message", Ai = "product-agent:sdk-preview-socket-error", Ni = "product-agent:sdk-preview-socket-closed", Dn = "product-agent:sdk-preview-socket-id", Ri = "data-pluno-sdk-preview-channel", go = "data-pluno-auto-mounted", ge = "__plunoProductAgentAutoMountOwner", Di = 1e4, Mi = "Failed to load Pluno widget token", Mn = "Timed out loading Pluno widget token", zi = "pluno.productAgent.widgetClientId.", Ht = /* @__PURE__ */ new Set(), Oi = "product-agent:preview-diagnostic", ho = "pluno.productAgent.sharePromptsDisabled", Ui = 3, zn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Bi = 400, Fi = 5e3, Hi = 500, On = "Close the page's popup to chat", Wi = "No recent chats for this page yet.", ae = {
219
+ const Ti = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
220
+ function Pi(e) {
221
+ let t = "", n = "", o = null;
222
+ for (const i of e.split(new RegExp("(?<=\\n)"))) {
223
+ if (o) {
224
+ t += i;
225
+ const l = i.replace(/\r?\n$/, "").match(/^[ \t]{0,3}(`+|~+)[ \t]*$/);
226
+ l?.[1][0] === o.marker && l[1].length >= o.length && (o = null);
227
+ continue;
228
+ }
229
+ const r = i.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
230
+ if (r) {
231
+ t += zn(n) + i, n = "", o = {
232
+ marker: r[1][0],
233
+ length: r[1].length
234
+ };
235
+ continue;
236
+ }
237
+ n += i;
238
+ }
239
+ return t + zn(n);
240
+ }
241
+ function zn(e) {
242
+ let t = "", n = 0;
243
+ for (const o of e.matchAll(Ti)) {
244
+ const i = o.index ?? 0;
245
+ t += Mn(
246
+ e.slice(n, i)
247
+ ), t += o[0], n = i + o[0].length;
248
+ }
249
+ return t + Mn(e.slice(n));
250
+ }
251
+ function Mn(e) {
252
+ return e.replace(
253
+ /\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
254
+ (t, n, o, i, r) => r[i - 1] === "!" || Ii(r, i) || Ai(r, i, n) ? t : `[${n}](${o})`
255
+ );
256
+ }
257
+ function Ii(e, t) {
258
+ let n = 0;
259
+ for (let o = t - 1; e[o] === "\\"; o -= 1)
260
+ n += 1;
261
+ return n % 2 === 1;
262
+ }
263
+ function Ai(e, t, n) {
264
+ if (n !== "x" && n !== "X")
265
+ return !1;
266
+ const o = e.lastIndexOf(`
267
+ `, t - 1) + 1;
268
+ return /^[ \t]*(?:>[ \t]*)*(?:[-*+]|\d+[.)])[ \t]+$/.test(
269
+ e.slice(o, t)
270
+ );
271
+ }
272
+ const fo = 100, Ni = 1e4, Ri = 5e3, Di = "product-agent:sdk-preview-socket-connect", zi = "product-agent:sdk-preview-socket-send", Mi = "product-agent:sdk-preview-socket-close", Oi = "product-agent:sdk-preview-socket-open", Ui = "product-agent:sdk-preview-socket-message", Bi = "product-agent:sdk-preview-socket-error", Fi = "product-agent:sdk-preview-socket-closed", On = "product-agent:sdk-preview-socket-id", Hi = "data-pluno-sdk-preview-channel", wo = "data-pluno-auto-mounted", he = "__plunoProductAgentAutoMountOwner", Wi = 1e4, $i = "Failed to load Pluno widget token", Un = "Timed out loading Pluno widget token", Gi = "pluno.productAgent.widgetClientId.", Wt = /* @__PURE__ */ new Set(), qi = "product-agent:preview-diagnostic", bo = "pluno.productAgent.sharePromptsDisabled", ji = 3, Bn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Vi = 400, Ki = 5e3, Yi = 500, Fn = "Close the page's popup to chat", Xi = "No recent chats for this page yet.", re = {
220
273
  launcherLabel: "Ask for anything...",
221
274
  accentColor: "#7c3aed",
222
275
  colorScheme: "light",
@@ -224,7 +277,7 @@ const uo = 100, Si = 1e4, Ei = 5e3, ki = "product-agent:sdk-preview-socket-conne
224
277
  scribbleStyle: !0,
225
278
  position: "bottom-right",
226
279
  movableLauncher: !0
227
- }, Gi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Un = "pluno-pa-scribble-font", mo = 190, fo = 41, Bn = 22, $i = 16, qi = 24, ji = 1, Vi = 48, dn = 420, Ki = 520, Yi = 0.24, cn = 680, Xi = 800, Zi = 0.76, A = 8, Ie = 50, wo = "http://www.w3.org/2000/svg", en = 26, tn = 8, Ji = 36, nn = 16, Qi = 4, Fn = [
280
+ }, Zi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Hn = "pluno-pa-scribble-font", _o = 190, xo = 41, Wn = 22, Ji = 16, Qi = 24, ea = 1, ta = 48, cn = 420, na = 520, oa = 0.24, un = 680, ia = 800, aa = 0.76, A = 8, Ie = 50, yo = "http://www.w3.org/2000/svg", tn = 26, nn = 8, ra = 36, on = 16, la = 4, $n = [
228
281
  {
229
282
  ellipseCx: "17.5",
230
283
  ellipseCy: "24.5",
@@ -261,20 +314,22 @@ const uo = 100, Si = 1e4, Ei = 5e3, ki = "product-agent:sdk-preview-socket-conne
261
314
  path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
262
315
  pathStrokeWidth: "2.45"
263
316
  }
264
- ], ea = 11, ta = 13, on = 4, bo = 10, _o = 40, na = "movable-launcher-position-v2", xo = "pluno-pa-widget-styles", yo = "data-pluno-pa-widget-styles";
265
- let Hn = 0;
266
- function oa(e) {
267
- return (t) => new he(t, e);
317
+ ], pa = 11, sa = 13, an = 4, vo = 10, Co = 40, da = "movable-launcher-position-v2", So = "pluno-pa-widget-styles", Eo = "data-pluno-pa-widget-styles";
318
+ let Gn = 0;
319
+ function ca(e) {
320
+ return (t) => new me(t, e);
268
321
  }
269
- async function ia(e = {}) {
322
+ async function ua(e = {}) {
270
323
  const t = {
271
- launcherLabel: e.launcherLabel ?? ae.launcherLabel,
272
- accentColor: e.accentColor ?? ae.accentColor,
273
- colorScheme: e.colorScheme ?? ae.colorScheme,
274
- fontFamily: e.fontFamily ?? ae.fontFamily,
275
- scribbleStyle: e.scribbleStyle ?? ae.scribbleStyle,
276
- position: e.position ?? ae.position,
277
- movableLauncher: e.movableLauncher ?? ae.movableLauncher,
324
+ layout: e.layout ?? "floating",
325
+ mountTarget: e.mountTarget,
326
+ launcherLabel: e.launcherLabel ?? re.launcherLabel,
327
+ accentColor: e.accentColor ?? re.accentColor,
328
+ colorScheme: e.colorScheme ?? re.colorScheme,
329
+ fontFamily: e.fontFamily ?? re.fontFamily,
330
+ scribbleStyle: e.scribbleStyle ?? re.scribbleStyle,
331
+ position: e.position ?? re.position,
332
+ movableLauncher: e.movableLauncher ?? re.movableLauncher,
278
333
  token: e.token,
279
334
  tokenProvider: e.tokenProvider,
280
335
  tokenEndpoint: e.tokenEndpoint,
@@ -284,8 +339,10 @@ async function ia(e = {}) {
284
339
  clientId: e.clientId,
285
340
  restorePersistedState: e.restorePersistedState,
286
341
  expectedPersistedSessionId: e.expectedPersistedSessionId,
342
+ keepRunsActiveOnSessionNavigation: e.keepRunsActiveOnSessionNavigation === !0,
287
343
  webSocketFactory: e.webSocketFactory,
288
344
  prepareAttachmentUpload: e.prepareAttachmentUpload,
345
+ attachmentsEnabled: e.attachmentsEnabled !== !1,
289
346
  loginRequired: e.loginRequired === !0,
290
347
  loginButtonLabel: e.loginButtonLabel ?? "Log in to Pluno",
291
348
  loginUrl: e.loginUrl,
@@ -311,7 +368,7 @@ async function ia(e = {}) {
311
368
  onMorningReportTaskStart: e.onMorningReportTaskStart,
312
369
  taskNotifications: e.taskNotifications
313
370
  };
314
- ne(
371
+ Y(
315
372
  "web-sdk.widget",
316
373
  "Mounting widget with merged options",
317
374
  {
@@ -327,49 +384,49 @@ async function ia(e = {}) {
327
384
  }
328
385
  );
329
386
  const n = document.createElement("div");
330
- n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), t.sdkPreviewChannelId && n.setAttribute(
331
- Ri,
387
+ 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(
388
+ Hi,
332
389
  t.sdkPreviewChannelId
333
390
  );
334
391
  const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
335
- i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
336
- let r = Wn(
392
+ i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.classList.add(`pluno-pa-widget--layout-${t.layout}`), i.setAttribute("data-pluno-product-agent-ui-root", "widget");
393
+ let r = qn(
337
394
  t.accentColor,
338
395
  t.scribbleStyle
339
396
  );
340
- La(
397
+ za(
341
398
  i,
342
399
  t.launcherLabel,
343
400
  r,
344
401
  t.movableLauncher,
345
402
  t.showLauncherMinimizeButton
346
403
  ), o.appendChild(i);
347
- const l = Sr(t);
348
- let p = t.movableLauncher ? l.launcherPosition : null, s = p !== null, c = l.panelSize, u = null;
349
- i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), Te(
404
+ const l = Ar(t);
405
+ let p = t.movableLauncher ? l.launcherPosition : null, s = p !== null, u = l.panelSize, c = null;
406
+ i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), Pe(
350
407
  i,
351
408
  Gt(
352
409
  i,
353
410
  p,
354
411
  t.position
355
412
  )
356
- )), io(o, t.accentColor), Gn(i, r, {
413
+ )), po(o, t.accentColor), jn(i, r, {
357
414
  accentColor: t.accentColor,
358
415
  colorScheme: t.colorScheme,
359
416
  fontFamily: t.fontFamily,
360
417
  scribbleStyle: t.scribbleStyle
361
418
  });
362
- const m = await vr(), L = m.ownerDocument, v = i.querySelector(
419
+ const h = t.mountTarget ?? await Pr(), k = h.ownerDocument, v = i.querySelector(
363
420
  ".pluno-pa-widget__launcher"
364
- ), D = i.querySelector(
421
+ ), z = i.querySelector(
365
422
  ".pluno-pa-widget__launcher-drag-handle"
366
- ), C = i.querySelector(
423
+ ), S = i.querySelector(
367
424
  ".pluno-pa-widget__launcher-input"
368
425
  ), g = i.querySelector(
369
426
  ".pluno-pa-widget__launcher-minimize"
370
- ), y = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
427
+ ), y = i.querySelector(".pluno-pa-widget__panel"), m = i.querySelector(
371
428
  ".pluno-pa-widget__scribble-spirals--panel"
372
- ), E = Array.from(
429
+ ), L = Array.from(
373
430
  i.querySelectorAll(".pluno-pa-widget__resize-handle")
374
431
  ), N = i.querySelector(
375
432
  ".pluno-pa-widget__close"
@@ -381,68 +438,68 @@ async function ia(e = {}) {
381
438
  ".pluno-pa-widget__billing-status"
382
439
  ), He = i.querySelector(
383
440
  ".pluno-pa-widget__attachments"
384
- ), M = i.querySelector(
441
+ ), R = i.querySelector(
385
442
  ".pluno-pa-widget__attachment-input"
386
- ), We = i.querySelector(
443
+ ), Ae = i.querySelector(
387
444
  ".pluno-pa-widget__attach"
388
- ), w = i.querySelector(
445
+ ), f = i.querySelector(
389
446
  ".pluno-pa-widget__input"
390
- ), O = i.querySelector(
447
+ ), M = i.querySelector(
391
448
  ".pluno-pa-widget__send"
392
449
  ), ve = i.querySelector(
393
450
  ".pluno-pa-widget__top-actions"
394
- ), se = i.querySelector(
451
+ ), de = i.querySelector(
395
452
  ".pluno-pa-widget__history"
396
453
  ), ot = i.querySelector(
397
454
  ".pluno-pa-widget__history-panel"
398
- ), $ = i.querySelector(
455
+ ), H = i.querySelector(
399
456
  ".pluno-pa-widget__history-list"
400
457
  ), it = i.querySelector(
401
458
  ".pluno-pa-widget__history-close"
402
- ), Ae = i.querySelector(
459
+ ), Ne = i.querySelector(
403
460
  ".pluno-pa-widget__history-status"
404
461
  ), oe = i.querySelector(
405
462
  ".pluno-pa-widget__timeline-jump"
406
463
  ), x = i.querySelector(
407
464
  ".pluno-pa-widget__active-users-counter"
408
- ), S = i.querySelector(
465
+ ), C = i.querySelector(
409
466
  ".pluno-pa-widget__timeline"
410
467
  ), j = i.querySelector(
411
468
  ".pluno-pa-widget__timeline-bottom-sentinel"
412
469
  ), V = i.querySelector(
413
470
  ".pluno-pa-widget__notify-suggestion"
414
- ), J = i.querySelector(
471
+ ), Q = i.querySelector(
415
472
  ".pluno-pa-widget__notify-suggestion-enable"
416
- ), P = i.querySelector(
473
+ ), E = i.querySelector(
417
474
  ".pluno-pa-widget__notify-suggestion-later"
418
- ), R = i.querySelector(
475
+ ), D = i.querySelector(
419
476
  ".pluno-pa-widget__notify-suggestion-never"
420
477
  );
421
- if (!v || !C || !y || !N || !I || !G || !ye || !He || !M || !We || !w || !O || !ve || !se || !ot || !$ || !it || !Ae || !oe || !x || !S || !j)
478
+ if (!v || !S || !y || !N || !I || !G || !ye || !He || !R || !Ae || !f || !M || !ve || !de || !ot || !H || !it || !Ne || !oe || !x || !C || !j)
422
479
  throw new Error("Failed to mount Pluno widget");
423
- if (t.movableLauncher && !D)
480
+ if (t.movableLauncher && !z)
424
481
  throw new Error("Failed to mount Pluno widget drag handle");
425
- Xn(C), Xn(w);
426
- let q = [], de = null;
427
- const Ne = () => {
428
- ja(
482
+ Ae.hidden = !t.attachmentsEnabled, R.disabled = !t.attachmentsEnabled, Qn(S), Qn(f);
483
+ let q = [], ce = null;
484
+ const Re = () => {
485
+ er(
429
486
  He,
430
487
  q,
431
488
  (a) => {
432
489
  q = q.filter(
433
490
  (d, _) => _ !== a
434
- ), Ne(), F(b.getState()), H();
491
+ ), Re(), F(b.getState()), W();
435
492
  }
436
493
  );
437
- }, hn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => Oo(t.tokenEndpoint) : void 0);
438
- if (!t.loginRequired && !t.signupRequired && !t.token && !hn && !t.webSocketFactory)
494
+ }, mn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => Ho(t.tokenEndpoint) : void 0);
495
+ if (!t.loginRequired && !t.signupRequired && !t.token && !mn && !t.webSocketFactory)
439
496
  throw new Error("Pluno widget requires token or tokenEndpoint");
440
- const Bo = window.fetch.bind(window), vt = Cr(t.clientId);
497
+ const $o = window.fetch.bind(window), vt = Ir(t.clientId);
441
498
  let b;
442
499
  try {
443
500
  const a = {
444
501
  token: t.token,
445
- tokenProvider: hn,
502
+ tokenProvider: mn,
446
503
  backendUrl: t.backendUrl,
447
504
  metadata: () => ({
448
505
  ...t.metadata ?? {},
@@ -452,6 +509,7 @@ async function ia(e = {}) {
452
509
  clientId: vt.clientId,
453
510
  restorePersistedState: t.restorePersistedState,
454
511
  expectedPersistedSessionId: t.expectedPersistedSessionId,
512
+ keepRunsActiveOnSessionNavigation: t.keepRunsActiveOnSessionNavigation,
455
513
  webSocketFactory: t.webSocketFactory,
456
514
  prepareAttachmentUpload: t.prepareAttachmentUpload,
457
515
  // The launcher is useful before a customer token endpoint responds. The widget owns connection
@@ -459,11 +517,11 @@ async function ia(e = {}) {
459
517
  autoConnect: !1,
460
518
  disableNetworkCapture: !!t.sdkPreviewChannelId
461
519
  };
462
- b = await ti.init(a);
520
+ b = await ai.init(a);
463
521
  } catch (a) {
464
522
  throw vt.release(), n.remove(), a;
465
523
  }
466
- m.appendChild(n), ne(
524
+ h.appendChild(n), Y(
467
525
  "web-sdk.widget",
468
526
  "Applied initial widget appearance",
469
527
  {
@@ -473,80 +531,80 @@ async function ia(e = {}) {
473
531
  cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
474
532
  }
475
533
  );
476
- const Ct = new Set(l.openToolGroupKeys), Re = new Set(
534
+ const Ct = new Set(l.openToolGroupKeys), De = new Set(
477
535
  l.seenShareCandidateIds
478
- ), at = new Set(Re);
479
- let St = l.sharePromptsDisabled || await Er(t), Q = null, ce = !1, rt = !(t.loginRequired || t.signupRequired), me = !1, Ce = {
536
+ ), at = new Set(De);
537
+ let St = l.sharePromptsDisabled || await Nr(t), ee = null, ie = !1, rt = !(t.loginRequired || t.signupRequired), fe = !1, Ce = {
480
538
  enabled: !0
481
- }, Se = 0, mn = "", fe = !1, ue = !1, we = [], Et = null, Ge = null;
482
- const ee = (a, d) => {
539
+ }, Se = 0, fn = "", we = !1, ue = !1, be = [], Et = null, We = null;
540
+ const te = (a, d) => {
483
541
  Ce = { enabled: a, reason: d };
484
- }, te = () => {
542
+ }, ne = () => {
485
543
  oe.hidden = !0;
486
- }, Fo = () => {
544
+ }, Go = () => {
487
545
  oe.hidden = !1;
488
- }, Ho = (a = "jump") => {
489
- ee(!0, a), te(), tt(S, () => Ce.enabled), Se = S.scrollTop;
546
+ }, qo = (a = "jump") => {
547
+ te(!0, a), ne(), tt(C, () => Ce.enabled), Se = C.scrollTop;
490
548
  }, Ee = () => {
491
- if (se.hidden = t.loginRequired, ot.hidden = !fe, se.setAttribute("aria-expanded", String(fe)), $.classList.toggle(
549
+ if (de.hidden = t.layout === "page" || t.loginRequired, ot.hidden = !we, de.setAttribute("aria-expanded", String(we)), H.classList.toggle(
492
550
  "pluno-pa-widget__history-list--center",
493
- ue && we.length === 0
494
- ), $.replaceChildren(), ue && we.length === 0) {
551
+ ue && be.length === 0
552
+ ), H.replaceChildren(), ue && be.length === 0) {
495
553
  const a = document.createElement("p");
496
- a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", $.appendChild(a);
554
+ a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", H.appendChild(a);
497
555
  }
498
- for (const a of we) {
556
+ for (const a of be) {
499
557
  const d = document.createElement("button");
500
558
  d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = ue;
501
559
  const _ = document.createElement("span");
502
- _.className = "pluno-pa-widget__history-item-title", _.textContent = Sa(a);
503
- const T = document.createElement("time");
504
- T.className = "pluno-pa-widget__history-time", T.dateTime = a.lastActiveAt, T.textContent = ka(
560
+ _.className = "pluno-pa-widget__history-item-title", _.textContent = Na(a);
561
+ const P = document.createElement("time");
562
+ P.className = "pluno-pa-widget__history-time", P.dateTime = a.lastActiveAt, P.textContent = Da(
505
563
  a.lastActiveAt,
506
564
  Date.now()
507
565
  );
508
- const z = document.createElement("small");
509
- z.className = "pluno-pa-widget__history-path", z.textContent = Ea(a), d.append(_, T, z), d.addEventListener("click", () => {
510
- fe = !1, Ge = null, Ee(), ee(!0, "newSession"), te(), b.loadSession(a.id), F(b.getState());
511
- }), $.appendChild(d);
566
+ const O = document.createElement("small");
567
+ O.className = "pluno-pa-widget__history-path", O.textContent = Ra(a), d.append(_, P, O), d.addEventListener("click", () => {
568
+ we = !1, We = null, Ee(), te(!0, "newSession"), ne(), b.loadSession(a.id), F(b.getState());
569
+ }), H.appendChild(d);
512
570
  }
513
- if (ue && we.length > 0) {
571
+ if (ue && be.length > 0) {
514
572
  const a = document.createElement("p");
515
- a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", $.appendChild(a);
573
+ a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", H.appendChild(a);
516
574
  }
517
- Ae.textContent = Ge ?? (!ue && we.length === 0 ? "No recent chats for this page yet." : ""), Ae.hidden = Ae.textContent.length === 0;
518
- }, fn = async (a) => {
575
+ Ne.textContent = We ?? (!ue && be.length === 0 ? "No recent chats for this page yet." : ""), Ne.hidden = Ne.textContent.length === 0;
576
+ }, wn = async (a) => {
519
577
  if (!ue) {
520
- ue = !0, Ge = null, Ee();
578
+ ue = !0, We = null, Ee();
521
579
  try {
522
580
  const d = await b.listSessions({ cursor: a, limit: 20 });
523
- we = a ? [...we, ...d.sessions] : d.sessions, Et = d.nextCursor;
581
+ be = a ? [...be, ...d.sessions] : d.sessions, Et = d.nextCursor;
524
582
  } catch (d) {
525
- ne(
583
+ Y(
526
584
  "web-sdk.widget",
527
585
  "Failed to load session history",
528
586
  {
529
587
  message: d instanceof Error ? d.message : String(d)
530
588
  }
531
- ), Ge = Wi;
589
+ ), We = Xi;
532
590
  } finally {
533
591
  ue = !1, Ee();
534
592
  }
535
593
  }
536
- }, Wo = () => {
537
- !Et || ue || $.scrollHeight - $.scrollTop - $.clientHeight <= 24 && fn(Et);
538
- }, wn = () => {
539
- ce || typeof document > "u" || (io(o, t.accentColor), n.isConnected || L.body?.appendChild(n));
540
- }, bn = new MutationObserver(wn);
541
- bn.observe(L.documentElement, {
594
+ }, jo = () => {
595
+ !Et || ue || H.scrollHeight - H.scrollTop - H.clientHeight <= 24 && wn(Et);
596
+ }, bn = () => {
597
+ ie || typeof document > "u" || (po(o, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || k.body?.appendChild(n)));
598
+ }, _n = new MutationObserver(bn);
599
+ _n.observe(k.documentElement, {
542
600
  childList: !0,
543
601
  subtree: !0
544
- }), wn();
602
+ }), bn();
545
603
  const $e = (a = !0) => {
546
604
  const d = bt(i, a);
547
- return an(
605
+ return rn(
548
606
  i,
549
- p ? vo(p, d) : ua(
607
+ p ? ko(p, d) : xa(
550
608
  i,
551
609
  t.position,
552
610
  d
@@ -554,38 +612,38 @@ async function ia(e = {}) {
554
612
  d
555
613
  );
556
614
  }, B = () => {
557
- const a = _a(o, C, w);
558
- Lr(t, {
615
+ const a = La(o, S, f);
616
+ Dr(t, {
559
617
  isOpen: i.classList.contains("pluno-pa-widget--open"),
560
- composerValue: w.value,
618
+ composerValue: f.value,
561
619
  focusedInput: a,
562
620
  focusedInputAt: a ? Date.now() : null,
563
621
  openToolGroupKeys: [...Ct],
564
622
  launcherPosition: s ? p : null,
565
- panelSize: c,
566
- seenShareCandidateIds: [...Re].slice(
567
- -uo
623
+ panelSize: u,
624
+ seenShareCandidateIds: [...De].slice(
625
+ -fo
568
626
  ),
569
627
  sharePromptsDisabled: St
570
628
  });
571
629
  }, lt = (a) => {
572
630
  t.onDisplayStateChange?.(a);
573
- }, qe = (a, d = !0) => {
631
+ }, Ge = (a, d = !0) => {
574
632
  if (a === "shown") {
575
- i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && je(!1), d && lt("shown");
633
+ i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && qe(!1), d && lt("shown");
576
634
  return;
577
635
  }
578
- Q !== null && (window.clearTimeout(Q), Q = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, y.hidden = !0, N.hidden = !0, v.tabIndex = 0, w.value = "", Te(
636
+ ee !== null && (window.clearTimeout(ee), ee = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, y.hidden = !0, N.hidden = !0, v.tabIndex = 0, f.value = "", Pe(
579
637
  i,
580
638
  Gt(
581
639
  i,
582
640
  p,
583
641
  t.position
584
642
  )
585
- ), Vn(i), B(), d && lt("minimized");
643
+ ), Xn(i), B(), d && lt("minimized");
586
644
  }, ke = (a, d = {}) => {
587
- ba(a, {
588
- debugVersion: na,
645
+ ka(a, {
646
+ debugVersion: da,
589
647
  launcherPosition: p,
590
648
  rootClasses: i.className,
591
649
  rootStyle: {
@@ -594,33 +652,36 @@ async function ia(e = {}) {
594
652
  right: i.style.right,
595
653
  bottom: i.style.bottom
596
654
  },
597
- rootRect: qt(i),
598
- launcherRect: qt(v),
599
- panelRect: qt(y),
600
- viewport: Z(),
655
+ rootRect: jt(i),
656
+ launcherRect: jt(v),
657
+ panelRect: jt(y),
658
+ viewport: J(),
601
659
  panelHidden: y.hidden,
602
660
  closeHidden: N.hidden,
603
661
  ...d
604
662
  });
605
- }, je = (a = !0) => {
663
+ }, qe = (a = !0) => {
606
664
  if (!p)
607
- return Te(i, null), $e(a);
665
+ return Pe(i, null), $e(a);
608
666
  const d = $e(a);
609
- return Te(i, d), ke("Applied stored closed launcher position", {
667
+ return Pe(i, d), ke("Applied stored closed launcher position", {
610
668
  visibleLauncherPosition: d
611
669
  }), d;
612
670
  }, kt = (a, d) => {
613
671
  if (!a || !d) {
614
- Vn(i);
672
+ Xn(i);
615
673
  return;
616
674
  }
617
- wa(i, {
675
+ Ea(i, {
618
676
  x: a.x - d.x,
619
677
  y: a.y - d.y
620
678
  });
621
- }, _n = () => {
679
+ }, Lt = () => {
680
+ const a = et(u).width;
681
+ return t.layout === "page" && y.getBoundingClientRect().width || a;
682
+ }, xn = () => {
622
683
  if (i.classList.contains("pluno-pa-widget--minimized")) {
623
- Te(
684
+ Pe(
624
685
  i,
625
686
  Gt(
626
687
  i,
@@ -630,24 +691,24 @@ async function ia(e = {}) {
630
691
  );
631
692
  return;
632
693
  }
633
- const a = je();
694
+ const a = qe();
634
695
  if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
635
- Wt(i, c);
636
- const d = Fe(c);
637
- Vt(
638
- h,
639
- d.width
696
+ $t(i, u);
697
+ const d = et(u);
698
+ Kt(
699
+ m,
700
+ Lt()
640
701
  );
641
702
  const _ = mt(
642
- u ?? $t(
703
+ c ?? qt(
643
704
  i,
644
705
  a,
645
706
  t.position,
646
- c
707
+ u
647
708
  ),
648
709
  d
649
710
  );
650
- u && (u = _), kt(_, a), ke(
711
+ c && (c = _), kt(_, a), ke(
651
712
  "Applied open panel position after viewport resize",
652
713
  { openPanelPosition: _ }
653
714
  );
@@ -656,138 +717,146 @@ async function ia(e = {}) {
656
717
  { visibleLauncherPosition: a }
657
718
  );
658
719
  };
659
- let xn = () => {
720
+ let yn = () => {
660
721
  };
661
- window.addEventListener("resize", _n), t.movableLauncher && D ? (je(), xn = sa({
722
+ window.addEventListener("resize", xn), t.movableLauncher && z ? (qe(), yn = wa({
662
723
  root: i,
663
724
  launcher: v,
664
- launcherDragHandle: D,
725
+ launcherDragHandle: z,
665
726
  getPosition: () => $e(),
666
727
  setPosition: (a) => {
667
- const d = a, _ = bt(i), T = an(
728
+ const d = a, _ = bt(i), P = rn(
668
729
  i,
669
730
  a,
670
731
  _
671
732
  );
672
- p = ha(
673
- T,
733
+ p = va(
734
+ P,
674
735
  _
675
- ), Te(i, T), ke("Dragging closed launcher", {
736
+ ), Pe(i, P), ke("Dragging closed launcher", {
676
737
  requestedPosition: d
677
738
  });
678
739
  },
679
740
  persist: () => {
680
741
  s = !0, B(), ke("Persisted closed launcher drag position");
681
742
  }
682
- })) : Te(i, null), Wt(i, c);
683
- const Go = () => {
684
- const a = Fe(c), d = $e();
743
+ })) : Pe(i, null), $t(i, u);
744
+ const Vo = () => {
745
+ const a = et(u), d = $e();
685
746
  return {
686
747
  position: mt(
687
- u ?? $t(
748
+ c ?? qt(
688
749
  i,
689
750
  d,
690
751
  t.position,
691
- c
752
+ u
692
753
  ),
693
754
  a
694
755
  ),
695
756
  size: a
696
757
  };
697
- }, $o = (a) => {
698
- c = xt(a.size), Wt(i, c), Vt(
699
- h,
700
- Fe(c).width
701
- ), u = mt(
758
+ }, Ko = (a) => {
759
+ u = xt(a.size), $t(i, u), Kt(
760
+ m,
761
+ Lt()
762
+ ), c = mt(
702
763
  a.position,
703
- Fe(c)
764
+ et(u)
704
765
  );
705
766
  const d = $e();
706
- kt(u, d);
707
- }, qo = E.length > 0 ? da({
767
+ kt(c, d);
768
+ }, Yo = L.length > 0 ? ba({
708
769
  root: i,
709
- handles: E,
710
- getBounds: Go,
711
- setBounds: $o,
770
+ handles: L,
771
+ getBounds: Vo,
772
+ setBounds: Ko,
712
773
  persist: B
713
774
  }) : () => {
714
775
  };
715
- let Lt = !1;
716
- const yn = async () => {
717
- if (!(!t.billingStatusLoader || Lt)) {
718
- Lt = !0;
776
+ let Tt = !1;
777
+ const vn = async () => {
778
+ if (!(!t.billingStatusLoader || Tt)) {
779
+ Tt = !0;
719
780
  try {
720
781
  const a = await t.billingStatusLoader();
721
- Jn(
782
+ if (ie)
783
+ return;
784
+ to(
722
785
  t.billingStatus,
723
786
  a,
724
787
  b.getState().lastErrorCode
725
- ) && (t.billingStatus = a, Yt(
788
+ ) && (t.billingStatus = a, Xt(
726
789
  ye,
727
790
  t.billingStatus,
728
791
  b.getState().lastErrorCode
729
- ), H());
792
+ ), W());
793
+ } catch (a) {
794
+ Y(
795
+ "web-sdk.widget",
796
+ "Failed to refresh billing status",
797
+ { message: a instanceof Error ? a.message : String(a) }
798
+ );
730
799
  } finally {
731
- Lt = !1;
800
+ Tt = !1;
732
801
  }
733
802
  }
734
- }, be = (a = "", d = !0) => {
735
- yn(), Ye && (Ye = !1, It()), i.classList.contains("pluno-pa-widget--open") || (u = null), Q !== null && (window.clearTimeout(Q), Q = null), qe("shown", !1), y.hidden = !1, N.hidden = !1, Vt(
736
- h,
737
- Fe(c).width
803
+ }, ge = (a = "", d = !0) => {
804
+ vn(), Ke && (Ke = !1, At()), i.classList.contains("pluno-pa-widget--open") || (c = null), ee !== null && (window.clearTimeout(ee), ee = null), Ge("shown", !1), y.hidden = !1, N.hidden = !1, Kt(
805
+ m,
806
+ Lt()
738
807
  ), i.classList.remove("pluno-pa-widget--closing");
739
- const _ = je(), T = $t(
808
+ const _ = qe(), P = qt(
740
809
  i,
741
810
  _,
742
811
  t.position,
743
- c
812
+ u
744
813
  );
745
- if (kt(T, _), ke("Opening launcher at clamped open panel position", {
746
- openPanelPosition: T,
814
+ if (kt(P, _), ke("Opening launcher at clamped open panel position", {
815
+ openPanelPosition: P,
747
816
  visibleLauncherPosition: _
748
- }), ee(!0, "open"), te(), !d) {
749
- i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (w.value = a, et(w)), tt(S, () => Ce.enabled), Se = S.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), lt("shown"), t.onPanelOpenChange?.(!0);
817
+ }), te(!0, "open"), ne(), !d) {
818
+ i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (f.value = a, Qe(f)), tt(C, () => Ce.enabled), Se = C.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), B(), lt("shown"), t.onPanelOpenChange?.(!0);
750
819
  return;
751
820
  }
752
821
  window.requestAnimationFrame(() => {
753
- i.classList.add("pluno-pa-widget--open"), a && (w.value = a, et(w)), tt(S, () => Ce.enabled), Se = S.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), lt("shown"), t.onPanelOpenChange?.(!0), Q = window.setTimeout(() => {
754
- v.hidden = !0, tt(S, () => Ce.enabled), Se = S.scrollTop;
822
+ i.classList.add("pluno-pa-widget--open"), a && (f.value = a, Qe(f)), tt(C, () => Ce.enabled), Se = C.scrollTop, f.focus(), f.setSelectionRange(f.value.length, f.value.length), B(), lt("shown"), t.onPanelOpenChange?.(!0), ee = window.setTimeout(() => {
823
+ v.hidden = !0, tt(C, () => Ce.enabled), Se = C.scrollTop;
755
824
  }, 220);
756
825
  });
757
826
  }, Pt = () => {
758
- Q !== null && (window.clearTimeout(Q), Q = null), v.hidden = !1, p && (je(!1), ke("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Q = window.setTimeout(() => {
759
- y.hidden = !0, N.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
827
+ ee !== null && (window.clearTimeout(ee), ee = null), v.hidden = !1, p && (qe(!1), ke("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), ee = window.setTimeout(() => {
828
+ y.hidden = !0, N.hidden = !0, c = null, i.classList.remove("pluno-pa-widget--closing");
760
829
  }, 220);
761
830
  };
762
831
  v.addEventListener("submit", (a) => {
763
- a.preventDefault(), be(C.value), C.value = "";
764
- }), D?.addEventListener("click", (a) => {
832
+ a.preventDefault(), ge(S.value), S.value = "";
833
+ }), z?.addEventListener("click", (a) => {
765
834
  a.preventDefault(), a.stopPropagation();
766
835
  }), v.addEventListener("click", (a) => {
767
- a.target === C && !D || (be(C.value), C.value = "");
768
- }), C.addEventListener("focus", () => {
769
- be(C.value), C.value = "";
770
- }), C.addEventListener("input", () => {
771
- if (!C.value)
836
+ a.target === S && !z || (ge(S.value), S.value = "");
837
+ }), S.addEventListener("focus", () => {
838
+ ge(S.value), S.value = "";
839
+ }), S.addEventListener("input", () => {
840
+ if (!S.value)
772
841
  return;
773
- const a = C.value;
774
- be(a), C.value = "";
842
+ const a = S.value;
843
+ ge(a), S.value = "";
775
844
  });
776
- let Tt = null, pt = null, Le = null;
777
- const vn = (a) => a === C || a === w, jo = (a) => {
845
+ let It = null, pt = null, Le = null;
846
+ const Cn = (a) => a === S || a === f, Xo = (a) => {
778
847
  if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
779
848
  return null;
780
849
  let d = a;
781
850
  for (; d; ) {
782
- const _ = d.closest(zn);
851
+ const _ = d.closest(Bn);
783
852
  if (_)
784
853
  return _;
785
- const T = d.getRootNode();
786
- d = T instanceof ShadowRoot ? T.host : null;
854
+ const P = d.getRootNode();
855
+ d = P instanceof ShadowRoot ? P.host : null;
787
856
  }
788
857
  return null;
789
- }, Vo = (a) => {
790
- if (!a.isConnected || !a.matches(zn))
858
+ }, Zo = (a) => {
859
+ if (!a.isConnected || !a.matches(Bn))
791
860
  return !1;
792
861
  if (!(a instanceof HTMLElement))
793
862
  return !0;
@@ -797,73 +866,73 @@ async function ia(e = {}) {
797
866
  return a.checkVisibility();
798
867
  const d = window.getComputedStyle(a);
799
868
  return d.display !== "none" && d.visibility !== "hidden";
800
- }, Cn = (a) => {
801
- Ke !== a && (Ke = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Pe(), a !== null ? Le = window.setInterval(() => {
802
- const d = Ke;
803
- (!d || !Vo(d)) && Cn(null);
804
- }, Hi) : Le !== null && (window.clearInterval(Le), Le = null, pt = null));
805
- }, Ko = () => {
869
+ }, Sn = (a) => {
870
+ Ve !== a && (Ve = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), Te(), a !== null ? Le = window.setInterval(() => {
871
+ const d = Ve;
872
+ (!d || !Zo(d)) && Sn(null);
873
+ }, Yi) : Le !== null && (window.clearInterval(Le), Le = null, pt = null));
874
+ }, Jo = () => {
806
875
  Le !== null && (window.clearInterval(Le), Le = null);
807
876
  };
808
877
  i.addEventListener("focusin", (a) => {
809
- vn(a.target) && (Tt = Date.now(), B());
878
+ Cn(a.target) && (It = Date.now(), B());
810
879
  }), i.addEventListener("focusout", (a) => {
811
- if (!vn(a.target) || Ke !== null)
880
+ if (!Cn(a.target) || Ve !== null)
812
881
  return;
813
- const d = Tt;
814
- if (Tt = null, d === null || Date.now() - d > Bi)
882
+ const d = It;
883
+ if (It = null, d === null || Date.now() - d > Vi)
815
884
  return;
816
- const _ = jo(a.relatedTarget);
885
+ const _ = Xo(a.relatedTarget);
817
886
  if (!_)
818
887
  return;
819
- const T = Date.now();
820
- if (pt !== null && T - pt <= Fi) {
821
- Cn(_);
888
+ const P = Date.now();
889
+ if (pt !== null && P - pt <= Ki) {
890
+ Sn(_);
822
891
  return;
823
892
  }
824
- pt = T;
893
+ pt = P;
825
894
  }), v.addEventListener("keydown", (a) => {
826
- !i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), be());
895
+ !i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), ge());
827
896
  }), g?.addEventListener("pointerdown", (a) => {
828
897
  a.stopPropagation();
829
898
  }), g?.addEventListener("click", (a) => {
830
- a.preventDefault(), a.stopPropagation(), qe("minimized");
831
- }), N.addEventListener("click", Pt), S.addEventListener("scroll", () => {
832
- S.scrollTop < Se - 1 && ee(!1, "userScroll"), Se = S.scrollTop;
899
+ a.preventDefault(), a.stopPropagation(), Ge("minimized");
900
+ }), N.addEventListener("click", Pt), C.addEventListener("scroll", () => {
901
+ C.scrollTop < Se - 1 && te(!1, "userScroll"), Se = C.scrollTop;
833
902
  }), oe.addEventListener("click", () => {
834
- Ho();
903
+ qo();
835
904
  });
836
- const Sn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
905
+ const En = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
837
906
  ([a]) => {
838
- a?.isIntersecting && (ee(!0, "bottom"), te());
907
+ a?.isIntersecting && (te(!0, "bottom"), ne());
839
908
  },
840
- { root: S, threshold: 0 }
909
+ { root: C, threshold: 0 }
841
910
  );
842
- Sn?.observe(j);
843
- const Ve = () => t.loginRequired || t.signupRequired;
844
- let Ke = null, Ye = !1;
845
- const K = () => rt || b.getState().status !== "connected", Pe = () => {
846
- const a = Ve(), d = Ke !== null, _ = !a && K();
847
- C.readOnly = a || d || _, w.readOnly = d || _, C.placeholder = d ? On : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ye ? "New update" : t.launcherLabel, w.placeholder = d ? On : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ae.launcherLabel, I.hidden = a;
848
- }, H = () => {
849
- O.disabled = K() || le(t.billingStatus) || !b.getState().isThinking && w.value.trim().length === 0 && q.length === 0, We.disabled = Ve() || K() || le(t.billingStatus);
911
+ En?.observe(j);
912
+ const je = () => t.loginRequired || t.signupRequired;
913
+ let Ve = null, Ke = !1;
914
+ const K = () => rt || b.getState().status !== "connected", Te = () => {
915
+ const a = je(), d = Ve !== null, _ = !a && K();
916
+ S.readOnly = a || d || _, f.readOnly = d || _, S.placeholder = d ? Fn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : Ke ? "New update" : t.launcherLabel, f.placeholder = d ? Fn : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : re.launcherLabel, I.hidden = a;
917
+ }, W = () => {
918
+ M.disabled = K() || pe(t.billingStatus) || !b.getState().isThinking && f.value.trim().length === 0 && q.length === 0, Ae.disabled = je() || K() || pe(t.billingStatus);
850
919
  };
851
- Pe();
852
- const It = () => {
920
+ Te();
921
+ const At = () => {
853
922
  const a = b.getState().isThinking;
854
923
  i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
855
924
  "pluno-pa-widget--unread",
856
- !a && Ye
857
- ), Pe();
925
+ !a && Ke
926
+ ), Te();
858
927
  };
859
- It();
860
- const At = () => {
861
- Ve() || ce || (rt = !0, Pe(), H(), b.connect().then(
928
+ At();
929
+ const Nt = () => {
930
+ je() || ie || (rt = !0, Te(), W(), b.connect().then(
862
931
  () => {
863
- ce || (rt = !1, Pe(), H());
932
+ ie || (rt = !1, Te(), W());
864
933
  },
865
934
  (a) => {
866
- ce || (rt = !1, Pe(), H(), ne(
935
+ ie || (rt = !1, Te(), W(), Y(
867
936
  "web-sdk.widget",
868
937
  "Failed to connect Product Agent widget",
869
938
  {
@@ -882,65 +951,65 @@ async function ia(e = {}) {
882
951
  t.onSignupClick?.();
883
952
  return;
884
953
  }
885
- K() || le(t.billingStatus) || (me = !0, ee(!0, "send"), te(), q = jt(
954
+ K() || pe(t.billingStatus) || (fe = !0, te(!0, "send"), ne(), q = Vt(
886
955
  b,
887
- w,
956
+ f,
888
957
  q
889
- ), Ne(), H());
958
+ ), Re(), W());
890
959
  });
891
- let Xe = 0;
892
- const Yo = () => {
893
- Xe = 0, i.classList.remove("pluno-pa-widget--drag-over");
894
- }, Nt = (a) => {
895
- de !== null && window.clearTimeout(de), G.textContent = a, G.hidden = !1, de = window.setTimeout(() => {
896
- G.textContent = "", G.hidden = !0, de = null;
960
+ let Ye = 0;
961
+ const Qo = () => {
962
+ Ye = 0, i.classList.remove("pluno-pa-widget--drag-over");
963
+ }, Rt = (a) => {
964
+ ce !== null && window.clearTimeout(ce), G.textContent = a, G.hidden = !1, ce = window.setTimeout(() => {
965
+ G.textContent = "", G.hidden = !0, ce = null;
897
966
  }, 3e3);
898
- }, Xo = () => {
899
- de !== null && (window.clearTimeout(de), de = null), G.textContent = "", G.hidden = !0;
900
- }, Rt = async (a) => {
901
- if (a.length === 0)
967
+ }, ei = () => {
968
+ ce !== null && (window.clearTimeout(ce), ce = null), G.textContent = "", G.hidden = !0;
969
+ }, Dt = async (a) => {
970
+ if (!t.attachmentsEnabled || a.length === 0)
902
971
  return;
903
- const d = Ya(b, a);
904
- q = [...q, ...d], Ne(), Xo(), H(), F(b.getState()), i.classList.contains("pluno-pa-widget--open") || be();
972
+ const d = or(b, a);
973
+ q = [...q, ...d], Re(), ei(), W(), F(b.getState()), i.classList.contains("pluno-pa-widget--open") || ge();
905
974
  };
906
- We.addEventListener("click", () => {
907
- t.loginRequired || K() || le(t.billingStatus) || M.click();
908
- }), M.addEventListener("change", () => {
909
- const a = Array.from(M.files ?? []);
910
- M.value = "", Rt(a).catch((d) => {
911
- Nt(
975
+ Ae.addEventListener("click", () => {
976
+ t.loginRequired || K() || pe(t.billingStatus) || R.click();
977
+ }), R.addEventListener("change", () => {
978
+ const a = Array.from(R.files ?? []);
979
+ R.value = "", Dt(a).catch((d) => {
980
+ Rt(
912
981
  d instanceof Error ? d.message : "Failed to attach file"
913
- ), ne("web-sdk.widget", "Attachment failed", {
982
+ ), Y("web-sdk.widget", "Attachment failed", {
914
983
  message: d instanceof Error ? d.message : String(d)
915
984
  });
916
985
  });
917
986
  }), i.addEventListener("dragenter", (a) => {
918
- !ut(a.dataTransfer) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Xe += 1, i.classList.add("pluno-pa-widget--drag-over"));
987
+ !t.attachmentsEnabled || !ut(a.dataTransfer) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Ye += 1, i.classList.add("pluno-pa-widget--drag-over"));
919
988
  }), i.addEventListener("dragover", (a) => {
920
989
  const d = a.dataTransfer;
921
- !ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
990
+ !t.attachmentsEnabled || !ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
922
991
  }), i.addEventListener("dragleave", (a) => {
923
- ut(a.dataTransfer) && (a.stopPropagation(), Xe = Math.max(0, Xe - 1), Xe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
992
+ ut(a.dataTransfer) && (a.stopPropagation(), Ye = Math.max(0, Ye - 1), Ye === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
924
993
  }), i.addEventListener("drop", (a) => {
925
994
  const d = a.dataTransfer;
926
- !ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Yo(), Rt(d.files).catch((_) => {
927
- Nt(
995
+ !t.attachmentsEnabled || !ut(d) || t.loginRequired || K() || (a.preventDefault(), a.stopPropagation(), Qo(), Dt(d.files).catch((_) => {
996
+ Rt(
928
997
  _ instanceof Error ? _.message : "Failed to attach file"
929
- ), ne("web-sdk.widget", "Attachment failed", {
998
+ ), Y("web-sdk.widget", "Attachment failed", {
930
999
  message: _ instanceof Error ? _.message : String(_)
931
1000
  });
932
1001
  }));
933
1002
  }), i.addEventListener("paste", (a) => {
934
1003
  a.stopPropagation();
935
1004
  const d = a.clipboardData, _ = Array.from(d?.files ?? []);
936
- _.length === 0 || t.loginRequired || K() || (a.preventDefault(), Rt(_).catch((T) => {
937
- Nt(
938
- T instanceof Error ? T.message : "Failed to attach file"
939
- ), ne("web-sdk.widget", "Attachment failed", {
940
- message: T instanceof Error ? T.message : String(T)
1005
+ !t.attachmentsEnabled || _.length === 0 || t.loginRequired || K() || (a.preventDefault(), Dt(_).catch((P) => {
1006
+ Rt(
1007
+ P instanceof Error ? P.message : "Failed to attach file"
1008
+ ), Y("web-sdk.widget", "Attachment failed", {
1009
+ message: P instanceof Error ? P.message : String(P)
941
1010
  });
942
1011
  }));
943
- }), O.addEventListener("click", () => {
1012
+ }), M.addEventListener("click", () => {
944
1013
  if (t.loginRequired) {
945
1014
  t.onLoginClick?.();
946
1015
  return;
@@ -949,90 +1018,90 @@ async function ia(e = {}) {
949
1018
  b.stop();
950
1019
  return;
951
1020
  }
952
- K() || (me = !0, ee(!0, "send"), te(), q = jt(
1021
+ K() || (fe = !0, te(!0, "send"), ne(), q = Vt(
953
1022
  b,
954
- w,
1023
+ f,
955
1024
  q
956
- ), Ne(), H(), F(b.getState()));
957
- }), se.addEventListener("click", () => {
958
- fe = !fe, Ge = null, Ee(), fe && we.length === 0 && fn(null);
1025
+ ), Re(), W(), F(b.getState()));
1026
+ }), de.addEventListener("click", () => {
1027
+ we = !we, We = null, Ee(), we && be.length === 0 && wn(null);
959
1028
  }), it.addEventListener("click", () => {
960
- fe = !1, Ee();
961
- }), $.addEventListener("scroll", Wo), w.addEventListener("input", () => {
962
- et(w), B(), H(), Qo();
963
- }), w.addEventListener("keydown", (a) => {
1029
+ we = !1, Ee();
1030
+ }), H.addEventListener("scroll", jo), f.addEventListener("input", () => {
1031
+ Qe(f), B(), W(), oi();
1032
+ }), f.addEventListener("keydown", (a) => {
964
1033
  if (!(a.key !== "Enter" || a.shiftKey)) {
965
1034
  if (a.preventDefault(), t.loginRequired) {
966
1035
  t.onLoginClick?.();
967
1036
  return;
968
1037
  }
969
- K() || (me = !0, ee(!0, "send"), te(), q = jt(
1038
+ K() || (fe = !0, te(!0, "send"), ne(), q = Vt(
970
1039
  b,
971
- w,
1040
+ f,
972
1041
  q
973
- ), Ne(), H(), F(b.getState()));
1042
+ ), Re(), W(), F(b.getState()));
974
1043
  }
975
1044
  }), i.addEventListener("click", (a) => {
976
1045
  (a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
977
- }), l.composerValue && (w.value = l.composerValue, et(w)), t.initialDisplayState === "minimized" ? qe("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && be(w.value, !1), xa(l, i, C, w);
1046
+ }), l.composerValue && (f.value = l.composerValue, Qe(f)), t.layout === "page" ? ge(f.value, !1) : t.initialDisplayState === "minimized" ? Ge("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && ge(f.value, !1), Ta(l, i, S, f);
978
1047
  const st = () => r;
979
- let Dt = b.getState().appearance !== null, dt = null, Ze = null, De = null, En = b.getState().isThinking, Me = null;
980
- const Je = t.taskNotifications;
981
- let ze = null, Oe = !1;
982
- const kn = () => {
983
- ze !== null && (window.clearTimeout(ze), ze = null);
1048
+ let zt = b.getState().appearance !== null, dt = null, Xe = null, ze = null, kn = b.getState().isThinking, Me = null;
1049
+ const Ze = t.taskNotifications;
1050
+ let Oe = null, Ue = !1;
1051
+ const Ln = () => {
1052
+ Oe !== null && (window.clearTimeout(Oe), Oe = null);
984
1053
  }, ct = () => {
985
1054
  V && (V.hidden = !0);
986
- }, Ln = () => b.getState().assistantDraft.trim().length > 0, Zo = async () => {
987
- if (!Je || !V || Oe || ce || !b.getState().isThinking || Ln())
1055
+ }, Tn = () => b.getState().assistantDraft.trim().length > 0, ti = async () => {
1056
+ if (!Ze || !V || Ue || ie || !b.getState().isThinking || Tn())
988
1057
  return;
989
1058
  let a;
990
1059
  try {
991
- a = await Je.getState();
1060
+ a = await Ze.getState();
992
1061
  } catch {
993
1062
  return;
994
1063
  }
995
- a.enabled || a.neverSuggest || !b.getState().isThinking || Ln() || Oe || ce || (V.hidden = !1);
1064
+ a.enabled || a.neverSuggest || !b.getState().isThinking || Tn() || Ue || ie || (V.hidden = !1);
996
1065
  };
997
- J?.addEventListener("click", () => {
998
- Oe = !0, ct(), Je?.enable().catch(() => {
1066
+ Q?.addEventListener("click", () => {
1067
+ Ue = !0, ct(), Ze?.enable().catch(() => {
999
1068
  });
1000
- }), P?.addEventListener("click", () => {
1001
- Oe = !0, ct();
1002
- }), R?.addEventListener("click", () => {
1003
- Oe = !0, ct(), Je?.dismissForever().catch(() => {
1069
+ }), E?.addEventListener("click", () => {
1070
+ Ue = !0, ct();
1071
+ }), D?.addEventListener("click", () => {
1072
+ Ue = !0, ct(), Ze?.dismissForever().catch(() => {
1004
1073
  });
1005
1074
  });
1006
- let Ue = null, Pn = () => {
1075
+ let Be = null, Pn = () => {
1007
1076
  };
1008
- const Jo = !!t.socialPostDraftHandler, Mt = /* @__PURE__ */ new Map(), zt = () => w.value.trim().length > 0 || q.length > 0, Qo = () => {
1009
- const a = Ue !== null && Xt(b.getState(), zt());
1010
- x.hidden = !a, a && Ue !== null && So(x, Ue);
1077
+ const ni = !!t.socialPostDraftHandler, Mt = /* @__PURE__ */ new Map(), Ot = () => f.value.trim().length > 0 || q.length > 0, oi = () => {
1078
+ const a = Be !== null && Zt(b.getState(), Ot());
1079
+ x.hidden = !a, a && Be !== null && To(x, Be);
1011
1080
  };
1012
- let Be = null;
1013
- const Ot = (a = {}) => {
1014
- me = !0, ee(!0, "newSession"), te(), fe = !1, Ee(), b.startNewSession(a), Ct.clear(), w.value = "", q = [], Ne(), et(w), B(), H(), w.focus(), F(b.getState());
1015
- }, Ut = (a) => {
1016
- if (!a) {
1017
- Be?.remove(), Be = null;
1081
+ let Fe = null;
1082
+ const Ut = (a = {}) => {
1083
+ fe = !0, te(!0, "newSession"), ne(), we = !1, Ee(), b.startNewSession(a), Ct.clear(), f.value = "", q = [], Re(), Qe(f), B(), W(), f.focus(), F(b.getState());
1084
+ }, Bt = (a) => {
1085
+ if (!a || t.layout === "page") {
1086
+ Fe?.remove(), Fe = null;
1018
1087
  return;
1019
1088
  }
1020
- Be || (Be = yt(
1089
+ Fe || (Fe = yt(
1021
1090
  "pluno-pa-widget__new-chat",
1022
1091
  "New chat",
1023
- Ua(),
1092
+ ja(),
1024
1093
  !1
1025
- ), Be.addEventListener("click", () => Ot()), ve.insertBefore(Be, se));
1094
+ ), Fe.addEventListener("click", () => Ut()), ve.insertBefore(Fe, de));
1026
1095
  }, F = (a) => {
1027
- if (Ee(), gn(a.lastErrorCode) ? Me = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (Me = null), Yt(
1096
+ if (Ee(), hn(a.lastErrorCode) ? Me = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (Me = null), Xt(
1028
1097
  ye,
1029
1098
  t.billingStatus,
1030
1099
  Me
1031
1100
  ), t.loginRequired) {
1032
- Mt.clear(), no(
1033
- S,
1034
- O,
1035
- Ut,
1101
+ Mt.clear(), ao(
1102
+ C,
1103
+ M,
1104
+ Bt,
1036
1105
  st,
1037
1106
  "Log in to use Pluno on this page.",
1038
1107
  t.loginButtonLabel,
@@ -1042,10 +1111,10 @@ async function ia(e = {}) {
1042
1111
  return;
1043
1112
  }
1044
1113
  if (t.signupRequired) {
1045
- Mt.clear(), no(
1046
- S,
1047
- O,
1048
- Ut,
1114
+ Mt.clear(), ao(
1115
+ C,
1116
+ M,
1117
+ Bt,
1049
1118
  st,
1050
1119
  "Complete signup to unlock your free trial credits.",
1051
1120
  t.signupButtonLabel,
@@ -1054,78 +1123,78 @@ async function ia(e = {}) {
1054
1123
  );
1055
1124
  return;
1056
1125
  }
1057
- const d = va(a), _ = d !== mn;
1058
- mn = d;
1059
- const T = me || Ce.enabled;
1060
- me = !1, nr(
1061
- S,
1126
+ const d = Ia(a), _ = d !== fn;
1127
+ fn = d;
1128
+ const P = fe || Ce.enabled;
1129
+ fe = !1, dr(
1130
+ C,
1062
1131
  j,
1063
- O,
1064
- Ut,
1132
+ M,
1133
+ Bt,
1065
1134
  x,
1066
1135
  a,
1067
- Ue,
1068
- Ue !== null && Xt(a, zt()),
1069
- T,
1136
+ Be,
1137
+ Be !== null && Zt(a, Ot()),
1138
+ P,
1070
1139
  () => Ce.enabled,
1071
1140
  Ct,
1072
1141
  Mt,
1073
1142
  B,
1074
1143
  st,
1075
- (z) => {
1144
+ (O) => {
1076
1145
  if (K())
1077
1146
  return;
1078
- const Qe = t.morningReport !== null;
1079
- t.morningReport = null, Qe && (t.onMorningReportTaskStart?.(), Ot()), me = !0, ee(!0, "send"), te(), b.sendMessage(z);
1147
+ const Je = t.morningReport !== null;
1148
+ t.morningReport = null, Je && (t.onMorningReportTaskStart?.(), Ut()), fe = !0, te(!0, "send"), ne(), b.sendMessage(O);
1080
1149
  },
1081
1150
  () => {
1082
- me = !0, ee(!0, "send"), te(), b.retryLastMessage();
1151
+ fe = !0, te(!0, "send"), ne(), b.retryLastMessage();
1083
1152
  },
1084
1153
  t.morningReport,
1085
1154
  () => {
1086
1155
  t.morningReport = null, t.onMorningReportSnooze?.(), Pt(), F(b.getState());
1087
1156
  },
1088
- At,
1089
- Jo && !St ? {
1157
+ Nt,
1158
+ ni && !St ? {
1090
1159
  dismissedCandidateIds: at,
1091
1160
  draftingCandidateId: dt,
1092
- error: Ze,
1161
+ error: Xe,
1093
1162
  characterIconOptions: st(),
1094
- onSeen: (z) => {
1095
- Re.add(z.id), B();
1163
+ onSeen: (O) => {
1164
+ De.add(O.id), B();
1096
1165
  },
1097
- onDraft: (z) => {
1098
- ei(z);
1166
+ onDraft: (O) => {
1167
+ ii(O);
1099
1168
  },
1100
- onDismiss: (z) => {
1101
- Re.add(z.id), at.add(z.id), B(), Ze = null, F(b.getState());
1169
+ onDismiss: (O) => {
1170
+ De.add(O.id), at.add(O.id), B(), Xe = null, F(b.getState());
1102
1171
  },
1103
- onDisable: (z) => {
1104
- St = !0, Re.add(z.id), at.add(z.id), B(), kr(t, !0), Ze = null, F(b.getState());
1172
+ onDisable: (O) => {
1173
+ St = !0, De.add(O.id), at.add(O.id), B(), Rr(t, !0), Xe = null, F(b.getState());
1105
1174
  }
1106
1175
  } : void 0
1107
- ), T ? (Se = S.scrollTop, te()) : _ && Ca(a) && Fo();
1176
+ ), P ? (Se = C.scrollTop, ne()) : _ && Aa(a) && Go();
1108
1177
  };
1109
- return Pn = _i(
1178
+ return Pn = Ci(
1110
1179
  (a) => {
1111
- Ue = a, !ce && Xt(b.getState(), zt()) && F(b.getState());
1180
+ Be = a, !ie && Zt(b.getState(), Ot()) && F(b.getState());
1112
1181
  },
1113
1182
  {
1114
1183
  backendUrl: t.backendUrl,
1115
- fetcher: Bo,
1184
+ fetcher: $o,
1116
1185
  loader: t.activeUsersLoader
1117
1186
  }
1118
1187
  ), b.on("state", (a) => {
1119
- const d = En && !a.isThinking;
1120
- En = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Je && !Oe && ze === null && V?.hidden !== !1 && (ze = window.setTimeout(() => {
1121
- ze = null, Zo();
1122
- }, Si)), (!a.isThinking || a.assistantDraft.trim()) && (kn(), ct()), d && !i.classList.contains("pluno-pa-widget--open") && (Ye = !0), It(), a.appearance ? (Dt = !0, ne(
1188
+ const d = kn && !a.isThinking;
1189
+ kn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Ze && !Ue && Oe === null && V?.hidden !== !1 && (Oe = window.setTimeout(() => {
1190
+ Oe = null, ti();
1191
+ }, Ni)), (!a.isThinking || a.assistantDraft.trim()) && (Ln(), ct()), d && !i.classList.contains("pluno-pa-widget--open") && (Ke = !0), At(), a.appearance ? (zt = !0, Y(
1123
1192
  "web-sdk.widget",
1124
1193
  "Agent state supplied appearance",
1125
1194
  {
1126
1195
  appearance: a.appearance
1127
1196
  }
1128
- ), Bt(a.appearance, "agent.state.appearance")) : Dt && (Dt = !1, ne(
1197
+ ), Ft(a.appearance, "agent.state.appearance")) : zt && (zt = !1, Y(
1129
1198
  "web-sdk.widget",
1130
1199
  "Agent state cleared appearance; reverting to configured widget options",
1131
1200
  {
@@ -1133,99 +1202,99 @@ async function ia(e = {}) {
1133
1202
  fallbackColorScheme: t.colorScheme,
1134
1203
  fallbackFontFamily: t.fontFamily
1135
1204
  }
1136
- ), Bt({}, "agent.state.appearance-cleared")), F(a), H(), d && yn();
1137
- }), F(b.getState()), H(), At(), {
1205
+ ), Ft({}, "agent.state.appearance-cleared")), F(a), W(), d && vn();
1206
+ }), F(b.getState()), W(), Nt(), {
1138
1207
  agent: b,
1139
- startNewChat: Ot,
1208
+ startNewChat: Ut,
1140
1209
  host: n,
1141
1210
  updateAppearance: (a) => {
1142
- a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Bt(a, "widgetHandle.updateAppearance");
1211
+ a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Ft(a, "widgetHandle.updateAppearance");
1143
1212
  },
1144
1213
  updateBillingStatus: (a) => {
1145
1214
  const d = a ?? null;
1146
- Jn(
1215
+ to(
1147
1216
  t.billingStatus,
1148
1217
  d,
1149
1218
  Me
1150
- ) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !le(t.billingStatus) && (Me = null), Yt(
1219
+ ) && (t.billingStatus = d, t.billingStatus?.creditsUsed !== null && !pe(t.billingStatus) && (Me = null), Xt(
1151
1220
  i.querySelector(".pluno-pa-widget__billing-status"),
1152
1221
  t.billingStatus,
1153
1222
  Me
1154
- ), H());
1223
+ ), W());
1155
1224
  },
1156
1225
  updateAuthGate: (a) => {
1157
- const d = Ve();
1158
- 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), Pe(), F(b.getState()), H(), d && !Ve() && At();
1226
+ const d = je();
1227
+ 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), Te(), F(b.getState()), W(), d && !je() && Nt();
1159
1228
  },
1160
1229
  openPanel: () => {
1161
- be(w.value, !1);
1230
+ ge(f.value, !1);
1162
1231
  },
1163
1232
  closePanel: Pt,
1164
1233
  updateDisplayState: (a) => {
1165
1234
  if (a === "shown") {
1166
- qe("shown", !1);
1235
+ Ge("shown", !1);
1167
1236
  return;
1168
1237
  }
1169
- qe("minimized", !1);
1238
+ Ge("minimized", !1);
1170
1239
  },
1171
1240
  updateMorningReport: (a) => {
1172
1241
  t.morningReport = a ?? null, F(b.getState());
1173
1242
  },
1174
1243
  destroy: () => {
1175
- ce || (B(), ce = !0, bn.disconnect(), Sn?.disconnect(), Ko(), window.removeEventListener("resize", _n), xn(), qo(), de !== null && window.clearTimeout(de), kn(), Pn(), De?.remove(), b.destroy(), vt.release(), n.remove());
1244
+ ie || (B(), ie = !0, _n.disconnect(), En?.disconnect(), Jo(), window.removeEventListener("resize", xn), yn(), Yo(), ce !== null && window.clearTimeout(ce), Ln(), Pn(), ze?.remove(), b.destroy(), vt.release(), n.remove());
1176
1245
  }
1177
1246
  };
1178
- async function ei(a) {
1247
+ async function ii(a) {
1179
1248
  if (!dt) {
1180
- dt = a.id, Ze = null, F(b.getState());
1249
+ dt = a.id, Xe = null, F(b.getState());
1181
1250
  try {
1182
1251
  if (!t.socialPostDraftHandler)
1183
1252
  throw new Error("Social post drafting is not available here.");
1184
1253
  const d = await t.socialPostDraftHandler(a);
1185
1254
  if (!d.linkedinPost || !d.xPost)
1186
1255
  throw new Error("Pluno did not return a complete social post draft.");
1187
- Re.add(a.id), at.add(a.id), B(), De?.remove(), De = dr(d, {
1256
+ De.add(a.id), at.add(a.id), B(), ze?.remove(), ze = br(d, {
1188
1257
  socialPostRewardsUrl: t.socialPostRewardsUrl,
1189
1258
  onClose: () => {
1190
- De?.remove(), De = null;
1259
+ ze?.remove(), ze = null;
1191
1260
  }
1192
- }), i.appendChild(De);
1261
+ }), i.appendChild(ze);
1193
1262
  } catch (d) {
1194
- Ze = d instanceof Error ? d.message : "Could not draft social post.";
1263
+ Xe = d instanceof Error ? d.message : "Could not draft social post.";
1195
1264
  } finally {
1196
1265
  dt = null, F(b.getState());
1197
1266
  }
1198
1267
  }
1199
1268
  }
1200
- function Bt(a, d) {
1201
- const _ = a.accentColor ?? t.accentColor, T = a.colorScheme ?? t.colorScheme, z = a.fontFamily ?? t.fontFamily, Qe = a.scribbleStyle ?? t.scribbleStyle;
1202
- r = Wn(
1269
+ function Ft(a, d) {
1270
+ const _ = a.accentColor ?? t.accentColor, P = a.colorScheme ?? t.colorScheme, O = a.fontFamily ?? t.fontFamily, Je = a.scribbleStyle ?? t.scribbleStyle;
1271
+ r = qn(
1203
1272
  _,
1204
- Qe
1205
- ), Gn(i, r, {
1273
+ Je
1274
+ ), jn(i, r, {
1206
1275
  accentColor: _,
1207
- colorScheme: T,
1208
- fontFamily: z,
1209
- scribbleStyle: Qe
1210
- }), ne("web-sdk.widget", "Updated widget appearance", {
1276
+ colorScheme: P,
1277
+ fontFamily: O,
1278
+ scribbleStyle: Je
1279
+ }), Y("web-sdk.widget", "Updated widget appearance", {
1211
1280
  source: d,
1212
1281
  inputAppearance: a,
1213
1282
  appliedAccentColor: _,
1214
- appliedColorScheme: T,
1215
- appliedFontFamily: z,
1216
- appliedScribbleStyle: Qe,
1283
+ appliedColorScheme: P,
1284
+ appliedFontFamily: O,
1285
+ appliedScribbleStyle: Je,
1217
1286
  cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
1218
1287
  });
1219
1288
  }
1220
1289
  }
1221
- function Wn(e, t) {
1290
+ function qn(e, t) {
1222
1291
  return { accentColor: e, scribbleStyle: t };
1223
1292
  }
1224
- function aa(e) {
1225
- const t = ra(e);
1226
- return t === null ? "#fafafa" : la(t) > 0.5 ? "#18181b" : "#fafaf9";
1293
+ function ga(e) {
1294
+ const t = ha(e);
1295
+ return t === null ? "#fafafa" : ma(t) > 0.5 ? "#18181b" : "#fafaf9";
1227
1296
  }
1228
- function ra(e) {
1297
+ function ha(e) {
1229
1298
  const t = e.trim();
1230
1299
  return /^#[0-9a-f]{6}$/i.test(t) ? [
1231
1300
  Number.parseInt(t.slice(1, 3), 16),
@@ -1237,14 +1306,14 @@ function ra(e) {
1237
1306
  Number.parseInt(t[3] + t[3], 16)
1238
1307
  ] : null;
1239
1308
  }
1240
- function la([e, t, n]) {
1309
+ function ma([e, t, n]) {
1241
1310
  const o = (i) => {
1242
1311
  const r = i / 255;
1243
1312
  return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
1244
1313
  };
1245
1314
  return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
1246
1315
  }
1247
- function Gn(e, t, n) {
1316
+ function jn(e, t, n) {
1248
1317
  e.classList.toggle(
1249
1318
  "pluno-pa-widget--dark",
1250
1319
  n.colorScheme === "dark"
@@ -1252,11 +1321,11 @@ function Gn(e, t, n) {
1252
1321
  "pluno-pa-widget--light",
1253
1322
  n.colorScheme !== "dark"
1254
1323
  ), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
1255
- const o = n.scribbleStyle ? po(n.accentColor) : n.accentColor;
1324
+ const o = n.scribbleStyle ? go(n.accentColor) : n.accentColor;
1256
1325
  e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
1257
1326
  "--pluno-pa-accent-contrast",
1258
- aa(o)
1259
- ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Gi : n.fontFamily, n.scribbleStyle && pa(e.ownerDocument);
1327
+ ga(o)
1328
+ ) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? Zi : n.fontFamily, n.scribbleStyle && fa(e.ownerDocument);
1260
1329
  const i = Array.from(
1261
1330
  e.querySelectorAll(".pluno-pa-widget__character")
1262
1331
  );
@@ -1268,11 +1337,11 @@ function Gn(e, t, n) {
1268
1337
  )
1269
1338
  );
1270
1339
  }
1271
- function pa(e) {
1272
- if (e.getElementById(Un))
1340
+ function fa(e) {
1341
+ if (e.getElementById(Hn))
1273
1342
  return;
1274
1343
  const t = e.createElement("style");
1275
- t.id = Un, t.textContent = `@font-face {
1344
+ t.id = Hn, t.textContent = `@font-face {
1276
1345
  font-family: "Architects Daughter";
1277
1346
  font-style: normal;
1278
1347
  font-weight: 400;
@@ -1280,7 +1349,7 @@ function pa(e) {
1280
1349
  src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
1281
1350
  }`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
1282
1351
  }
1283
- function sa({
1352
+ function wa({
1284
1353
  root: e,
1285
1354
  launcher: t,
1286
1355
  launcherDragHandle: n,
@@ -1288,82 +1357,82 @@ function sa({
1288
1357
  setPosition: i,
1289
1358
  persist: r
1290
1359
  }) {
1291
- let l = null, p = null, s = null, c = !1, u = null;
1292
- const m = () => {
1293
- l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--dragging");
1294
- }, L = (h) => {
1295
- e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), l = h.pointerId, p = { x: h.clientX, y: h.clientY }, s = o(), c = !1, t.setPointerCapture?.(h.pointerId));
1296
- }, v = (h) => {
1297
- if (l !== h.pointerId || !p || !s)
1360
+ let l = null, p = null, s = null, u = !1, c = null;
1361
+ const h = () => {
1362
+ l = null, p = null, s = null, u = !1, e.classList.remove("pluno-pa-widget--dragging");
1363
+ }, k = (m) => {
1364
+ e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId, p = { x: m.clientX, y: m.clientY }, s = o(), u = !1, t.setPointerCapture?.(m.pointerId));
1365
+ }, v = (m) => {
1366
+ if (l !== m.pointerId || !p || !s)
1298
1367
  return;
1299
- h.preventDefault();
1300
- const E = h.clientX - p.x, N = h.clientY - p.y;
1301
- !c && Math.hypot(E, N) < on || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: s.x + E, y: s.y + N }));
1302
- }, D = (h) => {
1303
- l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
1304
- }, C = (h) => {
1305
- l === h.pointerId && (h.preventDefault(), m());
1306
- }, g = (h) => {
1307
- if (!u)
1368
+ m.preventDefault();
1369
+ const L = m.clientX - p.x, N = m.clientY - p.y;
1370
+ !u && Math.hypot(L, N) < an || (u = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: s.x + L, y: s.y + N }));
1371
+ }, z = (m) => {
1372
+ l === m.pointerId && (m.preventDefault(), m.stopPropagation(), u && (c = { x: m.clientX, y: m.clientY }, r()), h());
1373
+ }, S = (m) => {
1374
+ l === m.pointerId && (m.preventDefault(), h());
1375
+ }, g = (m) => {
1376
+ if (!c)
1308
1377
  return;
1309
- const E = Math.hypot(
1310
- h.clientX - u.x,
1311
- h.clientY - u.y
1312
- ) <= on;
1313
- u = null, E && (h.preventDefault(), h.stopPropagation());
1314
- }, y = (h) => {
1378
+ const L = Math.hypot(
1379
+ m.clientX - c.x,
1380
+ m.clientY - c.y
1381
+ ) <= an;
1382
+ c = null, L && (m.preventDefault(), m.stopPropagation());
1383
+ }, y = (m) => {
1315
1384
  if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
1316
1385
  return;
1317
- const E = h.shiftKey ? _o : bo, N = o();
1386
+ const L = m.shiftKey ? Co : vo, N = o();
1318
1387
  let I = null;
1319
- h.key === "ArrowUp" ? I = { x: N.x, y: N.y - E } : h.key === "ArrowDown" ? I = { x: N.x, y: N.y + E } : h.key === "ArrowLeft" ? I = { x: N.x - E, y: N.y } : h.key === "ArrowRight" && (I = { x: N.x + E, y: N.y }), I && (h.preventDefault(), h.stopPropagation(), i(I), r());
1388
+ m.key === "ArrowUp" ? I = { x: N.x, y: N.y - L } : m.key === "ArrowDown" ? I = { x: N.x, y: N.y + L } : m.key === "ArrowLeft" ? I = { x: N.x - L, y: N.y } : m.key === "ArrowRight" && (I = { x: N.x + L, y: N.y }), I && (m.preventDefault(), m.stopPropagation(), i(I), r());
1320
1389
  };
1321
- return t.addEventListener("pointerdown", L), t.addEventListener("pointermove", v), t.addEventListener("pointerup", D), t.addEventListener("pointercancel", C), t.addEventListener("click", g, !0), n.addEventListener("keydown", y), () => {
1322
- t.removeEventListener("pointerdown", L), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", D), t.removeEventListener("pointercancel", C), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", y);
1390
+ return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", z), t.addEventListener("pointercancel", S), t.addEventListener("click", g, !0), n.addEventListener("keydown", y), () => {
1391
+ t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", z), t.removeEventListener("pointercancel", S), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", y);
1323
1392
  };
1324
1393
  }
1325
- function da({
1394
+ function ba({
1326
1395
  root: e,
1327
1396
  handles: t,
1328
1397
  getBounds: n,
1329
1398
  setBounds: o,
1330
1399
  persist: i
1331
1400
  }) {
1332
- let r = null, l = null, p = null, s = null, c = !1;
1333
- const u = () => {
1334
- r = null, l = null, p = null, s = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
1335
- }, m = (g) => {
1336
- const y = g.currentTarget, h = y.dataset.resizeDirection;
1337
- !e.classList.contains("pluno-pa-widget--open") || !$n(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, s = n(), c = !1, y.setPointerCapture?.(g.pointerId));
1338
- }, L = (g) => {
1401
+ let r = null, l = null, p = null, s = null, u = !1;
1402
+ const c = () => {
1403
+ r = null, l = null, p = null, s = null, u = !1, e.classList.remove("pluno-pa-widget--resizing");
1404
+ }, h = (g) => {
1405
+ const y = g.currentTarget, m = y.dataset.resizeDirection;
1406
+ !e.classList.contains("pluno-pa-widget--open") || !Vn(m) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = m, p = { x: g.clientX, y: g.clientY }, s = n(), u = !1, y.setPointerCapture?.(g.pointerId));
1407
+ }, k = (g) => {
1339
1408
  if (r !== g.pointerId || !l || !p || !s)
1340
1409
  return;
1341
1410
  g.preventDefault(), g.stopPropagation();
1342
- const y = g.clientX - p.x, h = g.clientY - p.y;
1343
- !c && Math.hypot(y, h) < on || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
1344
- qn(s, l, y, h)
1411
+ const y = g.clientX - p.x, m = g.clientY - p.y;
1412
+ !u && Math.hypot(y, m) < an || (u = !0, e.classList.add("pluno-pa-widget--resizing"), o(
1413
+ Kn(s, l, y, m)
1345
1414
  ));
1346
1415
  }, v = (g) => {
1347
- r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
1348
- }, D = (g) => {
1349
- r === g.pointerId && (g.preventDefault(), u());
1350
- }, C = (g) => {
1351
- const h = g.currentTarget.dataset.resizeDirection, E = g.shiftKey ? _o : bo, N = n();
1416
+ r === g.pointerId && (g.preventDefault(), g.stopPropagation(), u && i(), c());
1417
+ }, z = (g) => {
1418
+ r === g.pointerId && (g.preventDefault(), c());
1419
+ }, S = (g) => {
1420
+ const m = g.currentTarget.dataset.resizeDirection, L = g.shiftKey ? Co : vo, N = n();
1352
1421
  let I = 0, G = 0;
1353
- $n(h) && (g.key === "ArrowLeft" ? I = -E : g.key === "ArrowRight" ? I = E : g.key === "ArrowUp" ? G = -E : g.key === "ArrowDown" && (G = E), !(I === 0 && G === 0) && (g.preventDefault(), g.stopPropagation(), o(qn(N, h, I, G)), i()));
1422
+ Vn(m) && (g.key === "ArrowLeft" ? I = -L : g.key === "ArrowRight" ? I = L : g.key === "ArrowUp" ? G = -L : g.key === "ArrowDown" && (G = L), !(I === 0 && G === 0) && (g.preventDefault(), g.stopPropagation(), o(Kn(N, m, I, G)), i()));
1354
1423
  };
1355
1424
  for (const g of t)
1356
- g.addEventListener("pointerdown", m), g.addEventListener("pointermove", L), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", D), g.addEventListener("keydown", C);
1425
+ g.addEventListener("pointerdown", h), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", z), g.addEventListener("keydown", S);
1357
1426
  return () => {
1358
1427
  for (const g of t)
1359
- g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", L), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", D), g.removeEventListener("keydown", C);
1428
+ g.removeEventListener("pointerdown", h), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", z), g.removeEventListener("keydown", S);
1360
1429
  };
1361
1430
  }
1362
- function $n(e) {
1431
+ function Vn(e) {
1363
1432
  return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
1364
1433
  }
1365
- function qn(e, t, n, o) {
1366
- const i = Z(), r = jn({
1434
+ function Kn(e, t, n, o) {
1435
+ const i = J(), r = Yn({
1367
1436
  leading: e.position.x,
1368
1437
  length: e.size.width,
1369
1438
  delta: n,
@@ -1372,10 +1441,10 @@ function qn(e, t, n, o) {
1372
1441
  minLeading: A,
1373
1442
  maxTrailing: i.width - A,
1374
1443
  minLength: Math.min(
1375
- dn,
1444
+ cn,
1376
1445
  i.width - A * 2
1377
1446
  )
1378
- }), l = jn({
1447
+ }), l = Yn({
1379
1448
  leading: e.position.y,
1380
1449
  length: e.size.height,
1381
1450
  delta: o,
@@ -1384,7 +1453,7 @@ function qn(e, t, n, o) {
1384
1453
  minLeading: Ie,
1385
1454
  maxTrailing: i.height - A,
1386
1455
  minLength: Math.min(
1387
- cn,
1456
+ un,
1388
1457
  i.height - Ie - A
1389
1458
  )
1390
1459
  });
@@ -1393,7 +1462,7 @@ function qn(e, t, n, o) {
1393
1462
  size: { width: r.length, height: l.length }
1394
1463
  };
1395
1464
  }
1396
- function jn({
1465
+ function Yn({
1397
1466
  leading: e,
1398
1467
  length: t,
1399
1468
  delta: n,
@@ -1405,81 +1474,81 @@ function jn({
1405
1474
  }) {
1406
1475
  const s = e + t;
1407
1476
  if (o) {
1408
- const c = e + n;
1409
- if (c >= r) {
1410
- const m = X(c, r, s - p);
1411
- return { leading: m, length: s - m };
1477
+ const u = e + n;
1478
+ if (u >= r) {
1479
+ const h = Z(u, r, s - p);
1480
+ return { leading: h, length: s - h };
1412
1481
  }
1413
- const u = X(
1414
- s + r - c,
1482
+ const c = Z(
1483
+ s + r - u,
1415
1484
  s,
1416
1485
  l
1417
1486
  );
1418
- return { leading: r, length: u - r };
1487
+ return { leading: r, length: c - r };
1419
1488
  }
1420
1489
  if (i) {
1421
- const c = s + n;
1422
- if (c <= l) {
1423
- const m = X(
1424
- c,
1490
+ const u = s + n;
1491
+ if (u <= l) {
1492
+ const h = Z(
1493
+ u,
1425
1494
  e + p,
1426
1495
  l
1427
1496
  );
1428
- return { leading: e, length: m - e };
1497
+ return { leading: e, length: h - e };
1429
1498
  }
1430
- const u = X(
1431
- e - (c - l),
1499
+ const c = Z(
1500
+ e - (u - l),
1432
1501
  r,
1433
1502
  e
1434
1503
  );
1435
- return { leading: u, length: l - u };
1504
+ return { leading: c, length: l - c };
1436
1505
  }
1437
1506
  return { leading: e, length: t };
1438
1507
  }
1439
1508
  function bt(e, t = !0) {
1440
- const n = Z();
1509
+ const n = J();
1441
1510
  if (e.classList.contains("pluno-pa-widget--minimized"))
1442
1511
  return e.classList.contains("pluno-pa-widget--scribble") ? {
1443
- width: $i,
1444
- height: qi
1445
- } : { width: Bn, height: Bn };
1512
+ width: Ji,
1513
+ height: Qi
1514
+ } : { width: Wn, height: Wn };
1446
1515
  const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
1447
1516
  return {
1448
- width: t && i && o.width > 0 ? o.width : Math.min(mo, n.width - 36),
1449
- height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Vi : fo
1517
+ width: t && i && o.width > 0 ? o.width : Math.min(_o, n.width - 36),
1518
+ height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? ta : xo
1450
1519
  };
1451
1520
  }
1452
- function ca() {
1453
- const e = Z();
1521
+ function _a() {
1522
+ const e = J();
1454
1523
  return {
1455
1524
  width: Math.min(
1456
- X(
1457
- e.width * Yi,
1458
- dn,
1459
- Ki
1525
+ Z(
1526
+ e.width * oa,
1527
+ cn,
1528
+ na
1460
1529
  ),
1461
1530
  e.width - A * 2
1462
1531
  ),
1463
1532
  height: Math.min(
1464
- X(
1465
- e.height * Zi,
1466
- cn,
1467
- Xi
1533
+ Z(
1534
+ e.height * aa,
1535
+ un,
1536
+ ia
1468
1537
  ),
1469
1538
  e.height - Ie - A
1470
1539
  )
1471
1540
  };
1472
1541
  }
1473
- function Fe(e = null) {
1474
- return e ? xt(e) : ca();
1542
+ function et(e = null) {
1543
+ return e ? xt(e) : _a();
1475
1544
  }
1476
1545
  function xt(e) {
1477
- const t = Z();
1546
+ const t = J();
1478
1547
  return {
1479
- width: X(
1548
+ width: Z(
1480
1549
  e.width,
1481
1550
  Math.min(
1482
- dn,
1551
+ cn,
1483
1552
  t.width - A * 2
1484
1553
  ),
1485
1554
  Math.max(
@@ -1487,10 +1556,10 @@ function xt(e) {
1487
1556
  t.width - A * 2
1488
1557
  )
1489
1558
  ),
1490
- height: X(
1559
+ height: Z(
1491
1560
  e.height,
1492
1561
  Math.min(
1493
- cn,
1562
+ un,
1494
1563
  t.height - Ie - A
1495
1564
  ),
1496
1565
  Math.max(
@@ -1500,7 +1569,7 @@ function xt(e) {
1500
1569
  )
1501
1570
  };
1502
1571
  }
1503
- function Wt(e, t) {
1572
+ function $t(e, t) {
1504
1573
  if (!t) {
1505
1574
  e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
1506
1575
  return;
@@ -1508,14 +1577,14 @@ function Wt(e, t) {
1508
1577
  const n = xt(t);
1509
1578
  e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
1510
1579
  }
1511
- function ua(e, t, n) {
1580
+ function xa(e, t, n) {
1512
1581
  const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
1513
1582
  if (Number.isFinite(o) && Number.isFinite(i))
1514
1583
  return { x: o, y: i };
1515
1584
  const r = e.getBoundingClientRect();
1516
1585
  if (r.width > 0 || r.height > 0)
1517
1586
  return { x: r.left, y: r.top };
1518
- const l = Z();
1587
+ const l = J();
1519
1588
  return {
1520
1589
  x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
1521
1590
  y: l.height - 24 - n.height
@@ -1523,23 +1592,23 @@ function ua(e, t, n) {
1523
1592
  }
1524
1593
  function Gt(e, t, n) {
1525
1594
  const o = bt(e, !1);
1526
- return t ? an(
1595
+ return t ? rn(
1527
1596
  e,
1528
- vo(t, o),
1597
+ ko(t, o),
1529
1598
  o
1530
- ) : ga(n === "bottom-left" ? "bottom-left" : "bottom-right", o, ji);
1599
+ ) : ya(n === "bottom-left" ? "bottom-left" : "bottom-right", o, ea);
1531
1600
  }
1532
- function ga(e, t, n) {
1533
- const o = Z();
1601
+ function ya(e, t, n) {
1602
+ const o = J();
1534
1603
  return {
1535
1604
  x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
1536
1605
  y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
1537
1606
  };
1538
1607
  }
1539
- function an(e, t, n) {
1540
- const o = Z(), i = A + fa(e);
1608
+ function rn(e, t, n) {
1609
+ const o = J(), i = A + Sa(e);
1541
1610
  return {
1542
- x: X(
1611
+ x: Z(
1543
1612
  t.x,
1544
1613
  A,
1545
1614
  Math.max(
@@ -1547,7 +1616,7 @@ function an(e, t, n) {
1547
1616
  o.width - n.width - A
1548
1617
  )
1549
1618
  ),
1550
- y: X(
1619
+ y: Z(
1551
1620
  t.y,
1552
1621
  i,
1553
1622
  Math.max(
@@ -1557,39 +1626,39 @@ function an(e, t, n) {
1557
1626
  )
1558
1627
  };
1559
1628
  }
1560
- function vo(e, t) {
1561
- const n = Z();
1629
+ function ko(e, t) {
1630
+ const n = J();
1562
1631
  return {
1563
1632
  x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
1564
1633
  y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
1565
1634
  };
1566
1635
  }
1567
- function ha(e, t) {
1568
- const n = ma(e, t), o = Z();
1636
+ function va(e, t) {
1637
+ const n = Ca(e, t), o = J();
1569
1638
  return {
1570
1639
  anchor: n,
1571
1640
  x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
1572
1641
  y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
1573
1642
  };
1574
1643
  }
1575
- function ma(e, t) {
1576
- const n = Z(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
1644
+ function Ca(e, t) {
1645
+ const n = J(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
1577
1646
  return `${r}-${l}`;
1578
1647
  }
1579
- function fa(e) {
1580
- return e.classList.contains("pluno-pa-widget--scribble") ? ta : ea;
1648
+ function Sa(e) {
1649
+ return e.classList.contains("pluno-pa-widget--scribble") ? sa : pa;
1581
1650
  }
1582
- function $t(e, t, n, o = null) {
1583
- const i = bt(e), r = Fe(o), l = {
1651
+ function qt(e, t, n, o = null) {
1652
+ const i = bt(e), r = et(o), l = {
1584
1653
  x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
1585
1654
  y: t.y + i.height - r.height
1586
1655
  };
1587
1656
  return mt(l, r);
1588
1657
  }
1589
1658
  function mt(e, t) {
1590
- const n = Z();
1659
+ const n = J();
1591
1660
  return {
1592
- x: X(
1661
+ x: Z(
1593
1662
  e.x,
1594
1663
  A,
1595
1664
  Math.max(
@@ -1597,7 +1666,7 @@ function mt(e, t) {
1597
1666
  n.width - t.width - A
1598
1667
  )
1599
1668
  ),
1600
- y: X(
1669
+ y: Z(
1601
1670
  e.y,
1602
1671
  Ie,
1603
1672
  Math.max(
@@ -1607,26 +1676,26 @@ function mt(e, t) {
1607
1676
  )
1608
1677
  };
1609
1678
  }
1610
- function Te(e, t) {
1679
+ function Pe(e, t) {
1611
1680
  if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
1612
1681
  e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
1613
1682
  return;
1614
1683
  }
1615
1684
  e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
1616
1685
  }
1617
- function wa(e, t) {
1686
+ function Ea(e, t) {
1618
1687
  e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
1619
1688
  }
1620
- function Vn(e) {
1689
+ function Xn(e) {
1621
1690
  e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
1622
1691
  }
1623
- function Z() {
1692
+ function J() {
1624
1693
  return {
1625
- width: window.innerWidth || document.documentElement.clientWidth || mo + A * 2,
1626
- height: window.innerHeight || document.documentElement.clientHeight || fo + A * 2
1694
+ width: window.innerWidth || document.documentElement.clientWidth || _o + A * 2,
1695
+ height: window.innerHeight || document.documentElement.clientHeight || xo + A * 2
1627
1696
  };
1628
1697
  }
1629
- function qt(e) {
1698
+ function jt(e) {
1630
1699
  const t = e.getBoundingClientRect();
1631
1700
  return {
1632
1701
  x: Math.round(t.x),
@@ -1635,10 +1704,10 @@ function qt(e) {
1635
1704
  height: Math.round(t.height)
1636
1705
  };
1637
1706
  }
1638
- function X(e, t, n) {
1707
+ function Z(e, t, n) {
1639
1708
  return Math.min(Math.max(e, t), n);
1640
1709
  }
1641
- function ne(e, t, n) {
1710
+ function Y(e, t, n) {
1642
1711
  if (typeof window > "u")
1643
1712
  return;
1644
1713
  const o = window, i = {
@@ -1648,34 +1717,34 @@ function ne(e, t, n) {
1648
1717
  details: n
1649
1718
  }, r = o.__plunoProductAgentDiagnostics__ ?? [];
1650
1719
  r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
1651
- new CustomEvent(Oi, { detail: i })
1720
+ new CustomEvent(qi, { detail: i })
1652
1721
  );
1653
1722
  }
1654
- function ba(e, t) {
1655
- ne("web-sdk.widget.position", e, t);
1723
+ function ka(e, t) {
1724
+ Y("web-sdk.widget.position", e, t);
1656
1725
  }
1657
- function jt(e, t, n) {
1726
+ function Vt(e, t, n) {
1658
1727
  const o = t.value.trim();
1659
1728
  return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
1660
- attachments: n.length > 0 ? n.map(ya) : void 0
1729
+ attachments: n.length > 0 ? n.map(Pa) : void 0
1661
1730
  }), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
1662
1731
  }
1663
- function _a(e, t, n) {
1732
+ function La(e, t, n) {
1664
1733
  const o = e.activeElement;
1665
1734
  return o === n ? "composer" : o === t ? "launcher" : null;
1666
1735
  }
1667
- function xa(e, t, n, o) {
1668
- if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > Ei)
1736
+ function Ta(e, t, n, o) {
1737
+ if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > Ri)
1669
1738
  return;
1670
1739
  const i = e.focusedInput === "composer" ? o : n;
1671
1740
  i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
1672
1741
  !i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
1673
1742
  });
1674
1743
  }
1675
- function ya(e) {
1744
+ function Pa(e) {
1676
1745
  return e;
1677
1746
  }
1678
- function et(e) {
1747
+ function Qe(e) {
1679
1748
  e.style.height = "0px";
1680
1749
  const t = Math.max(22, Math.min(e.scrollHeight, 140));
1681
1750
  e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
@@ -1685,7 +1754,7 @@ function tt(e, t = () => !0) {
1685
1754
  t() && (e.scrollTop = e.scrollHeight);
1686
1755
  });
1687
1756
  }
1688
- function va(e) {
1757
+ function Ia(e) {
1689
1758
  const t = e.messages[e.messages.length - 1];
1690
1759
  return [
1691
1760
  e.messages.length,
@@ -1696,13 +1765,13 @@ function va(e) {
1696
1765
  e.lastError ?? ""
1697
1766
  ].join(":");
1698
1767
  }
1699
- function Ca(e) {
1768
+ function Aa(e) {
1700
1769
  return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
1701
1770
  }
1702
- function Sa(e) {
1771
+ function Na(e) {
1703
1772
  return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
1704
1773
  }
1705
- function Ea(e) {
1774
+ function Ra(e) {
1706
1775
  const t = e.currentPage;
1707
1776
  if (typeof t?.url == "string" && t.url.trim())
1708
1777
  try {
@@ -1713,7 +1782,7 @@ function Ea(e) {
1713
1782
  }
1714
1783
  return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
1715
1784
  }
1716
- function ka(e, t) {
1785
+ function Da(e, t) {
1717
1786
  const n = new Date(e).getTime();
1718
1787
  if (!Number.isFinite(n))
1719
1788
  return "now";
@@ -1729,9 +1798,9 @@ function ka(e, t) {
1729
1798
  }
1730
1799
  return "now";
1731
1800
  }
1732
- function La(e, t, n, o, i) {
1733
- e.appendChild(za()), e.appendChild(
1734
- Pa(
1801
+ function za(e, t, n, o, i) {
1802
+ e.appendChild(Ga()), e.appendChild(
1803
+ Ma(
1735
1804
  t,
1736
1805
  n,
1737
1806
  o,
@@ -1741,19 +1810,19 @@ function La(e, t, n, o, i) {
1741
1810
  yt(
1742
1811
  "pluno-pa-widget__close",
1743
1812
  "Close",
1744
- Oa(16),
1813
+ qa(16),
1745
1814
  !0
1746
1815
  )
1747
- ), e.appendChild(Ta(n));
1816
+ ), e.appendChild(Oa(n));
1748
1817
  }
1749
- function Pa(e, t, n, o) {
1818
+ function Ma(e, t, n, o) {
1750
1819
  const i = document.createElement("form");
1751
1820
  if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
1752
1821
  const s = document.createElement("button");
1753
1822
  s.type = "button", s.className = "pluno-pa-widget__launcher-drag-handle", s.setAttribute("aria-label", "Move Pluno launcher"), s.title = "Move Pluno launcher", i.appendChild(s);
1754
1823
  }
1755
1824
  i.appendChild(
1756
- ko(
1825
+ Io(
1757
1826
  "pluno-pa-widget__scribble-spirals--launcher",
1758
1827
  10
1759
1828
  )
@@ -1774,15 +1843,15 @@ function Pa(e, t, n, o) {
1774
1843
  }
1775
1844
  return i;
1776
1845
  }
1777
- function Ta(e) {
1846
+ function Oa(e) {
1778
1847
  const t = document.createElement("section");
1779
1848
  t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
1780
- ko("pluno-pa-widget__scribble-spirals--panel", 16)
1849
+ Io("pluno-pa-widget__scribble-spirals--panel", 16)
1781
1850
  );
1782
1851
  const n = document.createElement("div");
1783
1852
  n.className = "pluno-pa-widget__timeline-wrap";
1784
1853
  const o = document.createElement("main");
1785
- o.className = "pluno-pa-widget__timeline", o.appendChild(Ra(e));
1854
+ o.className = "pluno-pa-widget__timeline", o.appendChild(Ha(e));
1786
1855
  const i = document.createElement("div");
1787
1856
  i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
1788
1857
  const r = document.createElement("div");
@@ -1793,11 +1862,11 @@ function Ta(e) {
1793
1862
  return p.className = "pluno-pa-widget__top-actions", p.appendChild(
1794
1863
  yt(
1795
1864
  "pluno-pa-widget__history",
1796
- rn(),
1797
- Ba(),
1865
+ ln(),
1866
+ Va(),
1798
1867
  !0
1799
1868
  )
1800
- ), n.appendChild(p), n.appendChild(Na()), t.appendChild(n), t.appendChild(Ia()), t.appendChild(Aa()), t.appendChild(_e("left", "Resize Pluno from left")), t.appendChild(
1869
+ ), n.appendChild(p), n.appendChild(Fa()), t.appendChild(n), t.appendChild(Ua()), t.appendChild(Ba()), t.appendChild(_e("left", "Resize Pluno from left")), t.appendChild(
1801
1870
  _e("right", "Resize Pluno from right")
1802
1871
  ), t.appendChild(_e("top", "Resize Pluno from top")), t.appendChild(
1803
1872
  _e("bottom", "Resize Pluno from bottom")
@@ -1818,7 +1887,7 @@ function _e(e, t) {
1818
1887
  `pluno-pa-widget__resize-handle--${e}`
1819
1888
  ].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
1820
1889
  }
1821
- function Ia() {
1890
+ function Ua() {
1822
1891
  const e = document.createElement("div");
1823
1892
  e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
1824
1893
  const t = document.createElement("span");
@@ -1832,7 +1901,7 @@ function Ia() {
1832
1901
  const r = document.createElement("button");
1833
1902
  return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
1834
1903
  }
1835
- function Aa() {
1904
+ function Ba() {
1836
1905
  const e = document.createElement("form");
1837
1906
  e.className = "pluno-pa-widget__composer";
1838
1907
  const t = document.createElement("div");
@@ -1846,32 +1915,32 @@ function Aa() {
1846
1915
  const r = document.createElement("input");
1847
1916
  r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
1848
1917
  const l = document.createElement("button");
1849
- l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Ha()), l.appendChild(Wa()), i.appendChild(l);
1918
+ l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Ya()), l.appendChild(Xa()), i.appendChild(l);
1850
1919
  const p = document.createElement("textarea");
1851
1920
  p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
1852
1921
  const s = document.createElement("button");
1853
- s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(Po()), i.appendChild(s), e.appendChild(i);
1854
- const c = document.createElement("div");
1855
- c.className = "pluno-pa-widget__composer-meta";
1856
- const u = document.createElement("a");
1857
- u.className = "pluno-pa-widget__powered-by", u.href = "https://pluno.ai", u.target = "_blank", u.rel = "noopener noreferrer", u.textContent = "Powered by Pluno.ai.", c.appendChild(u);
1858
- const m = document.createElement("span");
1859
- return m.className = "pluno-pa-widget__ai-disclaimer", m.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(m), e.appendChild(c), e;
1922
+ s.type = "button", s.className = "pluno-pa-widget__send", s.setAttribute("aria-label", "Send"), s.appendChild(No()), i.appendChild(s), e.appendChild(i);
1923
+ const u = document.createElement("div");
1924
+ u.className = "pluno-pa-widget__composer-meta";
1925
+ const c = document.createElement("a");
1926
+ c.className = "pluno-pa-widget__powered-by", c.href = "https://pluno.ai", c.target = "_blank", c.rel = "noopener noreferrer", c.textContent = "Powered by Pluno.ai.", u.appendChild(c);
1927
+ const h = document.createElement("span");
1928
+ return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", u.appendChild(h), e.appendChild(u), e;
1860
1929
  }
1861
- function rn() {
1930
+ function ln() {
1862
1931
  return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
1863
1932
  }
1864
- function Na() {
1933
+ function Fa() {
1865
1934
  const e = document.createElement("section");
1866
- e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", rn());
1935
+ e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", ln());
1867
1936
  const t = document.createElement("div");
1868
1937
  t.className = "pluno-pa-widget__history-header";
1869
1938
  const n = document.createElement("strong");
1870
- n.textContent = rn();
1939
+ n.textContent = ln();
1871
1940
  const o = yt(
1872
1941
  "pluno-pa-widget__history-close",
1873
1942
  "Close recent chats",
1874
- Fa(),
1943
+ Ka(),
1875
1944
  !1
1876
1945
  );
1877
1946
  t.append(n, o);
@@ -1880,20 +1949,20 @@ function Na() {
1880
1949
  const r = document.createElement("p");
1881
1950
  return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
1882
1951
  }
1883
- function Ra(e) {
1952
+ function Ha(e) {
1884
1953
  const t = document.createElement("div");
1885
1954
  return t.className = "pluno-pa-widget__empty-state", t.appendChild(
1886
1955
  xe(
1887
1956
  "pluno-pa-widget__character--empty",
1888
1957
  e
1889
1958
  )
1890
- ), t.appendChild(Co()), t;
1959
+ ), t.appendChild(Lo()), t;
1891
1960
  }
1892
- function Co() {
1961
+ function Lo() {
1893
1962
  const e = document.createElement("div");
1894
1963
  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;
1895
1964
  }
1896
- function So(e, t) {
1965
+ function To(e, t) {
1897
1966
  e.replaceChildren(), e.setAttribute(
1898
1967
  "aria-label",
1899
1968
  `${t.toLocaleString("en-US")} users currently active`
@@ -1906,16 +1975,16 @@ function So(e, t) {
1906
1975
  );
1907
1976
  }
1908
1977
  function xe(e, t) {
1909
- const n = `pluno-pa-character-${Hn}`;
1910
- Hn += 1;
1911
- const o = t.scribbleStyle ? Ma(t.accentColor, n) : Da(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
1978
+ const n = `pluno-pa-character-${Gn}`;
1979
+ Gn += 1;
1980
+ const o = t.scribbleStyle ? $a(t.accentColor, n) : Wa(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
1912
1981
  return o.setAttribute(
1913
1982
  "class",
1914
1983
  i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
1915
1984
  ), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
1916
1985
  }
1917
- function Da(e, t) {
1918
- const n = ai(e), o = {
1986
+ function Wa(e, t) {
1987
+ const n = si(e), o = {
1919
1988
  boltFill: `${t}-boltFill`,
1920
1989
  boltEdge: `${t}-boltEdge`,
1921
1990
  boltGlow: `${t}-boltGlow`,
@@ -1926,7 +1995,7 @@ function Da(e, t) {
1926
1995
  eyeShadow: `${t}-eyeShadow`,
1927
1996
  pupilGloss: `${t}-pupilGloss`,
1928
1997
  boltClip: `${t}-boltClip`
1929
- }, i = Eo(), r = f(i, "defs"), l = f(r, "linearGradient", {
1998
+ }, i = Po(), r = w(i, "defs"), l = w(r, "linearGradient", {
1930
1999
  id: o.boltFill,
1931
2000
  x1: "420",
1932
2001
  y1: "180",
@@ -1935,7 +2004,7 @@ function Da(e, t) {
1935
2004
  gradientUnits: "userSpaceOnUse"
1936
2005
  });
1937
2006
  U(l, "0", n.top), U(l, "0.36", n.middle), U(l, "0.72", n.bottom), U(l, "1", n.bottom);
1938
- const p = f(r, "linearGradient", {
2007
+ const p = w(r, "linearGradient", {
1939
2008
  id: o.boltEdge,
1940
2009
  x1: "470",
1941
2010
  y1: "145",
@@ -1944,28 +2013,28 @@ function Da(e, t) {
1944
2013
  gradientUnits: "userSpaceOnUse"
1945
2014
  });
1946
2015
  U(p, "0", n.edgeStart), U(p, "0.32", n.edgeMiddle), U(p, "0.78", n.edgeEnd), U(p, "1", n.edgeEnd);
1947
- const s = f(r, "radialGradient", {
2016
+ const s = w(r, "radialGradient", {
1948
2017
  id: o.boltGlow,
1949
2018
  cx: "50%",
1950
2019
  cy: "22%",
1951
2020
  r: "82%"
1952
2021
  });
1953
2022
  U(s, "0", n.glow, "0.72"), U(s, "0.5", n.middle, "0.44"), U(s, "1", n.bottom, "0");
1954
- const c = f(r, "radialGradient", {
2023
+ const u = w(r, "radialGradient", {
1955
2024
  id: o.eyeWhite,
1956
2025
  cx: "35%",
1957
2026
  cy: "25%",
1958
2027
  r: "70%"
1959
2028
  });
1960
- U(c, "0", "#ffffff"), U(c, "0.72", "#ffffff"), U(c, "1", "#e5e5e5");
1961
- const u = f(r, "radialGradient", {
2029
+ U(u, "0", "#ffffff"), U(u, "0.72", "#ffffff"), U(u, "1", "#e5e5e5");
2030
+ const c = w(r, "radialGradient", {
1962
2031
  id: o.pupil,
1963
2032
  cx: "42%",
1964
2033
  cy: "38%",
1965
2034
  r: "65%"
1966
2035
  });
1967
- U(u, "0", "#2a1f10"), U(u, "0.52", "#080604"), U(u, "1", "#000000");
1968
- const m = f(r, "filter", {
2036
+ U(c, "0", "#2a1f10"), U(c, "0.52", "#080604"), U(c, "1", "#000000");
2037
+ const h = w(r, "filter", {
1969
2038
  id: o.softDropShadow,
1970
2039
  x: "-18%",
1971
2040
  y: "-12%",
@@ -1973,14 +2042,14 @@ function Da(e, t) {
1973
2042
  height: "136%",
1974
2043
  "color-interpolation-filters": "sRGB"
1975
2044
  });
1976
- f(m, "feDropShadow", {
2045
+ w(h, "feDropShadow", {
1977
2046
  dx: "0",
1978
2047
  dy: "12",
1979
2048
  stdDeviation: "18",
1980
2049
  "flood-color": n.shadow,
1981
2050
  "flood-opacity": "0.24"
1982
2051
  });
1983
- const L = f(r, "filter", {
2052
+ const k = w(r, "filter", {
1984
2053
  id: o.innerDepth,
1985
2054
  x: "-8%",
1986
2055
  y: "-8%",
@@ -1988,32 +2057,32 @@ function Da(e, t) {
1988
2057
  height: "116%",
1989
2058
  "color-interpolation-filters": "sRGB"
1990
2059
  });
1991
- f(L, "feGaussianBlur", {
2060
+ w(k, "feGaussianBlur", {
1992
2061
  in: "SourceAlpha",
1993
2062
  stdDeviation: "8",
1994
2063
  result: "blur"
1995
- }), f(L, "feOffset", {
2064
+ }), w(k, "feOffset", {
1996
2065
  dx: "-7",
1997
2066
  dy: "-9",
1998
2067
  result: "topLeft"
1999
- }), f(L, "feComposite", {
2068
+ }), w(k, "feComposite", {
2000
2069
  in: "topLeft",
2001
2070
  in2: "SourceAlpha",
2002
2071
  operator: "arithmetic",
2003
2072
  k2: "-1",
2004
2073
  k3: "1",
2005
2074
  result: "innerShadow"
2006
- }), f(L, "feColorMatrix", {
2075
+ }), w(k, "feColorMatrix", {
2007
2076
  in: "innerShadow",
2008
2077
  type: "matrix",
2009
2078
  values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
2010
2079
  result: "innerLight"
2011
- }), f(L, "feBlend", {
2080
+ }), w(k, "feBlend", {
2012
2081
  in: "SourceGraphic",
2013
2082
  in2: "innerLight",
2014
2083
  mode: "screen"
2015
2084
  });
2016
- const v = f(r, "filter", {
2085
+ const v = w(r, "filter", {
2017
2086
  id: o.eyeShadow,
2018
2087
  x: "-24%",
2019
2088
  y: "-20%",
@@ -2021,14 +2090,14 @@ function Da(e, t) {
2021
2090
  height: "148%",
2022
2091
  "color-interpolation-filters": "sRGB"
2023
2092
  });
2024
- f(v, "feDropShadow", {
2093
+ w(v, "feDropShadow", {
2025
2094
  dx: "0",
2026
2095
  dy: "8",
2027
2096
  stdDeviation: "5",
2028
2097
  "flood-color": n.shadow,
2029
2098
  "flood-opacity": "0.3"
2030
2099
  });
2031
- const D = f(r, "filter", {
2100
+ const z = w(r, "filter", {
2032
2101
  id: o.pupilGloss,
2033
2102
  x: "-15%",
2034
2103
  y: "-15%",
@@ -2036,51 +2105,51 @@ function Da(e, t) {
2036
2105
  height: "130%",
2037
2106
  "color-interpolation-filters": "sRGB"
2038
2107
  });
2039
- f(D, "feDropShadow", {
2108
+ w(z, "feDropShadow", {
2040
2109
  dx: "0",
2041
2110
  dy: "3",
2042
2111
  stdDeviation: "3",
2043
2112
  "flood-color": "#000000",
2044
2113
  "flood-opacity": "0.22"
2045
2114
  });
2046
- const C = f(r, "clipPath", { id: o.boltClip });
2047
- f(C, "path", { d: ft });
2048
- const g = f(i, "g", {
2049
- filter: Y(o.softDropShadow)
2115
+ const S = w(r, "clipPath", { id: o.boltClip });
2116
+ w(S, "path", { d: ft });
2117
+ const g = w(i, "g", {
2118
+ filter: X(o.softDropShadow)
2050
2119
  });
2051
- f(g, "path", {
2120
+ w(g, "path", {
2052
2121
  d: ft,
2053
- fill: Y(o.boltEdge)
2122
+ fill: X(o.boltEdge)
2054
2123
  });
2055
2124
  const y = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
2056
- f(g, "path", {
2125
+ w(g, "path", {
2057
2126
  d: y,
2058
- fill: Y(o.boltFill),
2059
- filter: Y(o.innerDepth)
2060
- }), f(g, "path", {
2127
+ fill: X(o.boltFill),
2128
+ filter: X(o.innerDepth)
2129
+ }), w(g, "path", {
2061
2130
  d: y,
2062
- fill: Y(o.boltGlow),
2131
+ fill: X(o.boltGlow),
2063
2132
  opacity: "0.74"
2064
2133
  });
2065
- const h = f(g, "g", {
2066
- "clip-path": Y(o.boltClip),
2134
+ const m = w(g, "g", {
2135
+ "clip-path": X(o.boltClip),
2067
2136
  opacity: "0.42"
2068
2137
  });
2069
- f(h, "path", {
2138
+ w(m, "path", {
2070
2139
  d: "M523 181 C505 189 496 206 489 232 L400 594 C397 606 400 619 411 626",
2071
2140
  fill: "none",
2072
2141
  stroke: n.highlight,
2073
2142
  "stroke-width": "22",
2074
2143
  "stroke-linecap": "round",
2075
2144
  opacity: "0.65"
2076
- }), f(h, "path", {
2145
+ }), w(m, "path", {
2077
2146
  d: "M556 685 L501 994",
2078
2147
  fill: "none",
2079
2148
  stroke: n.highlight,
2080
2149
  "stroke-width": "20",
2081
2150
  "stroke-linecap": "round",
2082
2151
  opacity: "0.55"
2083
- }), f(h, "path", {
2152
+ }), w(m, "path", {
2084
2153
  d: "M858 160 C882 166 893 181 883 204",
2085
2154
  fill: "none",
2086
2155
  stroke: n.inner,
@@ -2088,9 +2157,9 @@ function Da(e, t) {
2088
2157
  "stroke-linecap": "round",
2089
2158
  opacity: "0.48"
2090
2159
  });
2091
- const E = f(i, "g", { filter: Y(o.eyeShadow) });
2092
- return Kn(
2093
- E,
2160
+ const L = w(i, "g", { filter: X(o.eyeShadow) });
2161
+ return Zn(
2162
+ L,
2094
2163
  "rotate(-2 528 463)",
2095
2164
  "528",
2096
2165
  "463",
@@ -2099,8 +2168,8 @@ function Da(e, t) {
2099
2168
  "557",
2100
2169
  "447",
2101
2170
  o
2102
- ), Kn(
2103
- E,
2171
+ ), Zn(
2172
+ L,
2104
2173
  "rotate(2 717 462)",
2105
2174
  "717",
2106
2175
  "462",
@@ -2111,13 +2180,13 @@ function Da(e, t) {
2111
2180
  o
2112
2181
  ), i;
2113
2182
  }
2114
- function Ma(e, t) {
2115
- const n = po(e), o = {
2183
+ function $a(e, t) {
2184
+ const n = go(e), o = {
2116
2185
  clip: `${t}-scribbleBoltClip`,
2117
2186
  wobble: `${t}-scribbleBoltWobble`
2118
- }, i = Eo(), r = f(i, "defs"), l = f(r, "clipPath", { id: o.clip });
2119
- f(l, "path", { d: ft });
2120
- const p = f(r, "filter", {
2187
+ }, i = Po(), r = w(i, "defs"), l = w(r, "clipPath", { id: o.clip });
2188
+ w(l, "path", { d: ft });
2189
+ const p = w(r, "filter", {
2121
2190
  id: o.wobble,
2122
2191
  x: "-10%",
2123
2192
  y: "-10%",
@@ -2125,24 +2194,24 @@ function Ma(e, t) {
2125
2194
  height: "120%",
2126
2195
  "color-interpolation-filters": "sRGB"
2127
2196
  });
2128
- f(p, "feTurbulence", {
2197
+ w(p, "feTurbulence", {
2129
2198
  type: "fractalNoise",
2130
2199
  baseFrequency: "0.011",
2131
2200
  numOctaves: "3",
2132
2201
  seed: "7",
2133
2202
  result: "noise"
2134
- }), f(p, "feDisplacementMap", {
2203
+ }), w(p, "feDisplacementMap", {
2135
2204
  in: "SourceGraphic",
2136
2205
  in2: "noise",
2137
2206
  scale: "16",
2138
2207
  xChannelSelector: "R",
2139
2208
  yChannelSelector: "G"
2140
2209
  });
2141
- const s = f(i, "g", { filter: Y(o.wobble) }), c = f(s, "g", {
2142
- "clip-path": Y(o.clip)
2210
+ const s = w(i, "g", { filter: X(o.wobble) }), u = w(s, "g", {
2211
+ "clip-path": X(o.clip)
2143
2212
  });
2144
- return f(c, "path", {
2145
- d: ii(),
2213
+ return w(u, "path", {
2214
+ d: pi(),
2146
2215
  fill: "none",
2147
2216
  stroke: n,
2148
2217
  "stroke-width": "56",
@@ -2150,13 +2219,13 @@ function Ma(e, t) {
2150
2219
  "stroke-linejoin": "round",
2151
2220
  opacity: "0.9",
2152
2221
  transform: "rotate(-14 627 600)"
2153
- }), f(s, "path", {
2222
+ }), w(s, "path", {
2154
2223
  d: ft,
2155
2224
  fill: "none",
2156
2225
  stroke: wt,
2157
2226
  "stroke-width": "18",
2158
2227
  "stroke-linejoin": "round"
2159
- }), Yn(
2228
+ }), Jn(
2160
2229
  s,
2161
2230
  "rotate(-2 528 463)",
2162
2231
  "528",
@@ -2165,7 +2234,7 @@ function Ma(e, t) {
2165
2234
  "473",
2166
2235
  "557",
2167
2236
  "447"
2168
- ), Yn(
2237
+ ), Jn(
2169
2238
  s,
2170
2239
  "rotate(2 717 462)",
2171
2240
  "717",
@@ -2176,37 +2245,37 @@ function Ma(e, t) {
2176
2245
  "447"
2177
2246
  ), i;
2178
2247
  }
2179
- function Eo() {
2180
- return k("svg", {
2181
- xmlns: wo,
2248
+ function Po() {
2249
+ return T("svg", {
2250
+ xmlns: yo,
2182
2251
  viewBox: "0 0 1254 1254"
2183
2252
  });
2184
2253
  }
2185
- function Kn(e, t, n, o, i, r, l, p, s) {
2186
- const c = f(e, "g", { transform: t });
2187
- f(c, "ellipse", {
2254
+ function Zn(e, t, n, o, i, r, l, p, s) {
2255
+ const u = w(e, "g", { transform: t });
2256
+ w(u, "ellipse", {
2188
2257
  cx: n,
2189
2258
  cy: o,
2190
2259
  rx: "73",
2191
2260
  ry: "80",
2192
- fill: Y(s.eyeWhite)
2193
- }), f(c, "ellipse", {
2261
+ fill: X(s.eyeWhite)
2262
+ }), w(u, "ellipse", {
2194
2263
  cx: i,
2195
2264
  cy: r,
2196
2265
  rx: "49",
2197
2266
  ry: "57",
2198
- fill: Y(s.pupil),
2199
- filter: Y(s.pupilGloss)
2200
- }), f(c, "circle", {
2267
+ fill: X(s.pupil),
2268
+ filter: X(s.pupilGloss)
2269
+ }), w(u, "circle", {
2201
2270
  cx: l,
2202
2271
  cy: p,
2203
2272
  r: "18",
2204
2273
  fill: "#ffffff"
2205
2274
  });
2206
2275
  }
2207
- function Yn(e, t, n, o, i, r, l, p) {
2208
- const s = f(e, "g", { transform: t });
2209
- f(s, "ellipse", {
2276
+ function Jn(e, t, n, o, i, r, l, p) {
2277
+ const s = w(e, "g", { transform: t });
2278
+ w(s, "ellipse", {
2210
2279
  cx: n,
2211
2280
  cy: o,
2212
2281
  rx: "73",
@@ -2214,85 +2283,85 @@ function Yn(e, t, n, o, i, r, l, p) {
2214
2283
  fill: "#ffffff",
2215
2284
  stroke: wt,
2216
2285
  "stroke-width": "13"
2217
- }), f(s, "ellipse", {
2286
+ }), w(s, "ellipse", {
2218
2287
  cx: i,
2219
2288
  cy: r,
2220
2289
  rx: "45",
2221
2290
  ry: "53",
2222
2291
  fill: wt
2223
- }), f(s, "circle", {
2292
+ }), w(s, "circle", {
2224
2293
  cx: l,
2225
2294
  cy: p,
2226
2295
  r: "16",
2227
2296
  fill: "#ffffff"
2228
2297
  });
2229
2298
  }
2230
- function f(e, t, n = {}) {
2231
- const o = k(t, n);
2299
+ function w(e, t, n = {}) {
2300
+ const o = T(t, n);
2232
2301
  return e.appendChild(o), o;
2233
2302
  }
2234
2303
  function U(e, t, n, o) {
2235
2304
  const i = { offset: t, "stop-color": n };
2236
- o !== void 0 && (i["stop-opacity"] = o), f(e, "stop", i);
2305
+ o !== void 0 && (i["stop-opacity"] = o), w(e, "stop", i);
2237
2306
  }
2238
- function Y(e) {
2307
+ function X(e) {
2239
2308
  return `url(#${e})`;
2240
2309
  }
2241
2310
  function yt(e, t, n, o) {
2242
2311
  const i = document.createElement("button");
2243
2312
  return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
2244
2313
  }
2245
- function za() {
2246
- const e = k("svg", {
2314
+ function Ga() {
2315
+ const e = T("svg", {
2247
2316
  class: "pluno-pa-widget__scribble-defs",
2248
2317
  "aria-hidden": "true",
2249
2318
  focusable: "false",
2250
2319
  width: "0",
2251
2320
  height: "0"
2252
- }), t = k("defs");
2253
- return t.appendChild(Kt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2254
- Kt("pluno-pa-scribble-wobble-2", "5", "15")
2321
+ }), t = T("defs");
2322
+ return t.appendChild(Yt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
2323
+ Yt("pluno-pa-scribble-wobble-2", "5", "15")
2255
2324
  ), t.appendChild(
2256
- Kt("pluno-pa-scribble-wobble-3", "9", "19")
2325
+ Yt("pluno-pa-scribble-wobble-3", "9", "19")
2257
2326
  ), e.appendChild(t), e;
2258
2327
  }
2259
- function ko(e, t) {
2260
- const n = k("svg", {
2328
+ function Io(e, t) {
2329
+ const n = T("svg", {
2261
2330
  class: `pluno-pa-widget__scribble-spirals ${e}`,
2262
2331
  preserveAspectRatio: "xMidYMid meet",
2263
2332
  "aria-hidden": "true",
2264
2333
  focusable: "false"
2265
2334
  });
2266
- return Lo(n, t), n;
2335
+ return Ao(n, t), n;
2267
2336
  }
2268
- function Vt(e, t) {
2337
+ function Kt(e, t) {
2269
2338
  if (!e)
2270
2339
  return;
2271
2340
  const n = Math.max(
2272
2341
  0,
2273
- t - nn * 2
2342
+ t - on * 2
2274
2343
  ), o = Math.max(
2275
- Qi,
2344
+ la,
2276
2345
  Math.floor(
2277
- (n - tn * 2) / en
2346
+ (n - nn * 2) / tn
2278
2347
  )
2279
2348
  );
2280
- Lo(e, o);
2349
+ Ao(e, o);
2281
2350
  }
2282
- function Lo(e, t) {
2351
+ function Ao(e, t) {
2283
2352
  if (e.dataset.spiralCount === `${t}`)
2284
2353
  return;
2285
- const n = t * en + tn * 2;
2354
+ const n = t * tn + nn * 2;
2286
2355
  e.dataset.spiralCount = `${t}`, e.setAttribute(
2287
2356
  "viewBox",
2288
- `0 0 ${n} ${Ji}`
2357
+ `0 0 ${n} ${ra}`
2289
2358
  ), e.replaceChildren();
2290
2359
  for (let o = 0; o < t; o += 1) {
2291
- const i = Fn[o % Fn.length], r = k("g", {
2292
- transform: `translate(${tn + o * en} 0)`
2360
+ const i = $n[o % $n.length], r = T("g", {
2361
+ transform: `translate(${nn + o * tn} 0)`
2293
2362
  });
2294
2363
  r.appendChild(
2295
- k("ellipse", {
2364
+ T("ellipse", {
2296
2365
  cx: i.ellipseCx,
2297
2366
  cy: i.ellipseCy,
2298
2367
  rx: i.ellipseRx,
@@ -2303,7 +2372,7 @@ function Lo(e, t) {
2303
2372
  opacity: "0.8"
2304
2373
  })
2305
2374
  ), r.appendChild(
2306
- k("path", {
2375
+ T("path", {
2307
2376
  d: i.path,
2308
2377
  fill: "none",
2309
2378
  stroke: "#2c2a1e",
@@ -2313,8 +2382,8 @@ function Lo(e, t) {
2313
2382
  ), e.appendChild(r);
2314
2383
  }
2315
2384
  }
2316
- function Kt(e, t, n) {
2317
- const o = k("filter", {
2385
+ function Yt(e, t, n) {
2386
+ const o = T("filter", {
2318
2387
  id: e,
2319
2388
  x: "-8%",
2320
2389
  y: "-8%",
@@ -2322,7 +2391,7 @@ function Kt(e, t, n) {
2322
2391
  height: "116%"
2323
2392
  });
2324
2393
  return o.appendChild(
2325
- k("feTurbulence", {
2394
+ T("feTurbulence", {
2326
2395
  type: "fractalNoise",
2327
2396
  baseFrequency: "0.012 0.028",
2328
2397
  numOctaves: "3",
@@ -2330,7 +2399,7 @@ function Kt(e, t, n) {
2330
2399
  result: "stroke-noise"
2331
2400
  })
2332
2401
  ), o.appendChild(
2333
- k("feDisplacementMap", {
2402
+ T("feDisplacementMap", {
2334
2403
  in: "SourceGraphic",
2335
2404
  in2: "stroke-noise",
2336
2405
  scale: "3.5",
@@ -2339,7 +2408,7 @@ function Kt(e, t, n) {
2339
2408
  result: "warped"
2340
2409
  })
2341
2410
  ), o.appendChild(
2342
- k("feTurbulence", {
2411
+ T("feTurbulence", {
2343
2412
  type: "fractalNoise",
2344
2413
  baseFrequency: "0.7",
2345
2414
  numOctaves: "1",
@@ -2347,7 +2416,7 @@ function Kt(e, t, n) {
2347
2416
  result: "ink-noise"
2348
2417
  })
2349
2418
  ), o.appendChild(
2350
- k("feDisplacementMap", {
2419
+ T("feDisplacementMap", {
2351
2420
  in: "warped",
2352
2421
  in2: "ink-noise",
2353
2422
  scale: "0.9",
@@ -2356,8 +2425,8 @@ function Kt(e, t, n) {
2356
2425
  })
2357
2426
  ), o;
2358
2427
  }
2359
- function Oa(e) {
2360
- const t = pe(
2428
+ function qa(e) {
2429
+ const t = se(
2361
2430
  "0 0 24 24",
2362
2431
  e,
2363
2432
  e,
@@ -2365,10 +2434,10 @@ function Oa(e) {
2365
2434
  "currentColor",
2366
2435
  "2.25"
2367
2436
  );
2368
- return t.appendChild(k("path", { d: "m6 9 6 6 6-6" })), t;
2437
+ return t.appendChild(T("path", { d: "m6 9 6 6 6-6" })), t;
2369
2438
  }
2370
- function Ua() {
2371
- const e = pe(
2439
+ function ja() {
2440
+ const e = se(
2372
2441
  "0 0 24 24",
2373
2442
  17,
2374
2443
  17,
@@ -2377,17 +2446,17 @@ function Ua() {
2377
2446
  "2.25"
2378
2447
  );
2379
2448
  return e.appendChild(
2380
- k("path", {
2449
+ T("path", {
2381
2450
  d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
2382
2451
  })
2383
2452
  ), e.appendChild(
2384
- k("path", {
2453
+ T("path", {
2385
2454
  d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
2386
2455
  })
2387
2456
  ), e;
2388
2457
  }
2389
- function Ba() {
2390
- const e = pe(
2458
+ function Va() {
2459
+ const e = se(
2391
2460
  "0 0 24 24",
2392
2461
  17,
2393
2462
  17,
@@ -2395,10 +2464,10 @@ function Ba() {
2395
2464
  "currentColor",
2396
2465
  "2.25"
2397
2466
  );
2398
- return e.appendChild(k("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(k("path", { d: "M3 4v5h5" })), e.appendChild(k("path", { d: "M12 7v5l3 2" })), e;
2467
+ 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;
2399
2468
  }
2400
- function Fa() {
2401
- const e = pe(
2469
+ function Ka() {
2470
+ const e = se(
2402
2471
  "0 0 24 24",
2403
2472
  15,
2404
2473
  15,
@@ -2406,10 +2475,10 @@ function Fa() {
2406
2475
  "currentColor",
2407
2476
  "2.4"
2408
2477
  );
2409
- return e.appendChild(k("path", { d: "M18 6 6 18" })), e.appendChild(k("path", { d: "m6 6 12 12" })), e;
2478
+ return e.appendChild(T("path", { d: "M18 6 6 18" })), e.appendChild(T("path", { d: "m6 6 12 12" })), e;
2410
2479
  }
2411
- function Po() {
2412
- const e = pe(
2480
+ function No() {
2481
+ const e = se(
2413
2482
  "0 0 24 24",
2414
2483
  14,
2415
2484
  14,
@@ -2418,11 +2487,11 @@ function Po() {
2418
2487
  "2.75"
2419
2488
  );
2420
2489
  return e.appendChild(
2421
- k("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2422
- ), e.appendChild(k("polyline", { points: "5 12 12 5 19 12" })), e;
2490
+ T("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
2491
+ ), e.appendChild(T("polyline", { points: "5 12 12 5 19 12" })), e;
2423
2492
  }
2424
- function Ha() {
2425
- const e = pe(
2493
+ function Ya() {
2494
+ const e = se(
2426
2495
  "0 0 24 24",
2427
2496
  16,
2428
2497
  16,
@@ -2434,18 +2503,18 @@ function Ha() {
2434
2503
  "class",
2435
2504
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
2436
2505
  ), e.appendChild(
2437
- k("path", {
2506
+ T("path", {
2438
2507
  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"
2439
2508
  })
2440
2509
  ), e;
2441
2510
  }
2442
- function Wa() {
2443
- const e = pe("0 0 24 24", 19, 19, "none", "currentColor");
2511
+ function Xa() {
2512
+ const e = se("0 0 24 24", 19, 19, "none", "currentColor");
2444
2513
  return e.setAttribute(
2445
2514
  "class",
2446
2515
  "pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
2447
2516
  ), e.appendChild(
2448
- k("path", {
2517
+ T("path", {
2449
2518
  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",
2450
2519
  stroke: "currentColor",
2451
2520
  "stroke-width": "2",
@@ -2454,10 +2523,10 @@ function Wa() {
2454
2523
  })
2455
2524
  ), e;
2456
2525
  }
2457
- function Ga() {
2458
- const e = pe("0 0 24 24", 18, 18, "currentColor");
2526
+ function Za() {
2527
+ const e = se("0 0 24 24", 18, 18, "currentColor");
2459
2528
  return e.appendChild(
2460
- k("rect", {
2529
+ T("rect", {
2461
2530
  x: "6",
2462
2531
  y: "6",
2463
2532
  width: "12",
@@ -2466,8 +2535,8 @@ function Ga() {
2466
2535
  })
2467
2536
  ), e;
2468
2537
  }
2469
- function $a() {
2470
- const e = pe(
2538
+ function Ja() {
2539
+ const e = se(
2471
2540
  "0 0 24 24",
2472
2541
  12,
2473
2542
  12,
@@ -2475,10 +2544,10 @@ function $a() {
2475
2544
  "currentColor",
2476
2545
  "2.4"
2477
2546
  );
2478
- return e.appendChild(k("path", { d: "M18 6 6 18" })), e.appendChild(k("path", { d: "m6 6 12 12" })), e;
2547
+ return e.appendChild(T("path", { d: "M18 6 6 18" })), e.appendChild(T("path", { d: "m6 6 12 12" })), e;
2479
2548
  }
2480
- function qa() {
2481
- const e = pe(
2549
+ function Qa() {
2550
+ const e = se(
2482
2551
  "0 0 24 24",
2483
2552
  13,
2484
2553
  13,
@@ -2487,7 +2556,7 @@ function qa() {
2487
2556
  "2.25"
2488
2557
  );
2489
2558
  return e.appendChild(
2490
- k("rect", {
2559
+ T("rect", {
2491
2560
  width: "14",
2492
2561
  height: "14",
2493
2562
  x: "8",
@@ -2496,12 +2565,12 @@ function qa() {
2496
2565
  ry: "2"
2497
2566
  })
2498
2567
  ), e.appendChild(
2499
- k("path", {
2568
+ T("path", {
2500
2569
  d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
2501
2570
  })
2502
2571
  ), e;
2503
2572
  }
2504
- function pe(e, t, n, o, i, r) {
2573
+ function se(e, t, n, o, i, r) {
2505
2574
  const l = {
2506
2575
  viewBox: e,
2507
2576
  width: String(t),
@@ -2509,165 +2578,165 @@ function pe(e, t, n, o, i, r) {
2509
2578
  fill: o,
2510
2579
  "aria-hidden": "true"
2511
2580
  };
2512
- return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), k("svg", l);
2581
+ return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), T("svg", l);
2513
2582
  }
2514
- function k(e, t = {}) {
2515
- const n = document.createElementNS(wo, e);
2583
+ function T(e, t = {}) {
2584
+ const n = document.createElementNS(yo, e);
2516
2585
  for (const [o, i] of Object.entries(t))
2517
2586
  n.setAttribute(o, i);
2518
2587
  return n;
2519
2588
  }
2520
- function Xn(e) {
2589
+ function Qn(e) {
2521
2590
  for (const t of ["keydown", "keypress", "keyup"])
2522
2591
  e.addEventListener(t, (n) => {
2523
2592
  n.stopPropagation();
2524
2593
  });
2525
2594
  }
2526
- function ja(e, t, n) {
2595
+ function er(e, t, n) {
2527
2596
  e.replaceChildren(), e.hidden = t.length === 0;
2528
2597
  for (const [o, i] of t.entries()) {
2529
2598
  const r = document.createElement("div");
2530
- r.className = "pluno-pa-widget__attachment", r.appendChild(Va(i));
2599
+ r.className = "pluno-pa-widget__attachment", r.appendChild(tr(i));
2531
2600
  const l = document.createElement("span");
2532
2601
  l.textContent = i.name, r.appendChild(l);
2533
2602
  const p = document.createElement("button");
2534
- p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild($a()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
2603
+ p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ja()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
2535
2604
  }
2536
2605
  }
2537
- function Va(e) {
2538
- const t = un(e), n = To(e);
2606
+ function tr(e) {
2607
+ const t = gn(e), n = Ro(e);
2539
2608
  if (t === "image" && n) {
2540
2609
  const o = document.createElement("img");
2541
- return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(re(e))), o;
2610
+ return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(le(e))), o;
2542
2611
  }
2543
2612
  if (t === "video" && n) {
2544
2613
  const o = document.createElement("video");
2545
- return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(re(e))), o.addEventListener("stalled", () => o.replaceWith(re(e))), o;
2614
+ return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(le(e))), o.addEventListener("stalled", () => o.replaceWith(le(e))), o;
2546
2615
  }
2547
- return re(e);
2616
+ return le(e);
2548
2617
  }
2549
- function Ka(e) {
2550
- const t = un(e), n = To(e);
2618
+ function nr(e) {
2619
+ const t = gn(e), n = Ro(e);
2551
2620
  if (t === "image" && n) {
2552
2621
  const o = document.createElement("img");
2553
- return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(re(e, "message"))), o;
2622
+ return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(le(e, "message"))), o;
2554
2623
  }
2555
2624
  if (t === "pdf" && n) {
2556
2625
  const o = document.createElement("object");
2557
- return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(re(e, "message"))), o.appendChild(re(e, "message")), o;
2626
+ return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(le(e, "message"))), o.appendChild(le(e, "message")), o;
2558
2627
  }
2559
2628
  if (t === "video" && n) {
2560
2629
  const o = document.createElement("video");
2561
- return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(re(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(re(e, "message"))), o;
2630
+ return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(le(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(le(e, "message"))), o;
2562
2631
  }
2563
- return re(e, "message");
2632
+ return le(e, "message");
2564
2633
  }
2565
- function re(e, t = "composer") {
2634
+ function le(e, t = "composer") {
2566
2635
  if (t === "composer") {
2567
2636
  const r = document.createElement("span");
2568
- return r.className = "pluno-pa-widget__attachment-file", r.textContent = Zn(e), r;
2637
+ return r.className = "pluno-pa-widget__attachment-file", r.textContent = eo(e), r;
2569
2638
  }
2570
2639
  const n = document.createElement("div");
2571
2640
  n.className = "pluno-pa-widget__message-attachment-file";
2572
2641
  const o = document.createElement("span");
2573
- o.textContent = Zn(e);
2642
+ o.textContent = eo(e);
2574
2643
  const i = document.createElement("strong");
2575
2644
  return i.textContent = e.name, n.append(o, i), n;
2576
2645
  }
2577
- function un(e) {
2646
+ function gn(e) {
2578
2647
  return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
2579
2648
  }
2580
- function To(e) {
2649
+ function Ro(e) {
2581
2650
  return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
2582
2651
  }
2583
- function Zn(e) {
2584
- const t = un(e);
2652
+ function eo(e) {
2653
+ const t = gn(e);
2585
2654
  return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
2586
2655
  }
2587
- function Ya(e, t) {
2656
+ function or(e, t) {
2588
2657
  return t ? Array.from(t).map((o) => ({
2589
2658
  ...e.createLocalAttachment(o),
2590
- previewUrl: Xa(o)
2659
+ previewUrl: ir(o)
2591
2660
  })) : [];
2592
2661
  }
2593
- function Xa(e) {
2662
+ function ir(e) {
2594
2663
  return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
2595
2664
  }
2596
2665
  function ut(e) {
2597
2666
  return !!(e && Array.from(e.types).includes("Files"));
2598
2667
  }
2599
- function Yt(e, t, n = null) {
2600
- if (!e || !ln(t, n)) {
2668
+ function Xt(e, t, n = null) {
2669
+ if (!e || !pn(t, n)) {
2601
2670
  e && (e.hidden = !0, e.replaceChildren());
2602
2671
  return;
2603
2672
  }
2604
- e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", le(t) || gn(n) ? e.appendChild(
2605
- Za(t, n)
2606
- ) : Io(t) && e.appendChild(Ja(t));
2673
+ e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", pe(t) || hn(n) ? e.appendChild(
2674
+ ar(t, n)
2675
+ ) : Do(t) && e.appendChild(rr(t));
2607
2676
  }
2608
- function Za(e, t) {
2677
+ function ar(e, t) {
2609
2678
  const n = document.createElement("div");
2610
2679
  n.className = "pluno-pa-widget__billing-action-card";
2611
2680
  const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
2612
2681
  i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
2613
2682
  const r = document.createElement("span");
2614
2683
  return r.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
2615
- Ao(
2684
+ zo(
2616
2685
  e,
2617
2686
  "Upgrade plan",
2618
2687
  "pluno-pa-widget__billing-action-card-actions"
2619
2688
  )
2620
2689
  ), n;
2621
2690
  }
2622
- function Ja(e) {
2691
+ function rr(e) {
2623
2692
  const t = document.createElement("div");
2624
2693
  t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
2625
2694
  const n = document.createElement("strong");
2626
2695
  n.textContent = "Credits running low", t.appendChild(n);
2627
2696
  const o = document.createElement("span");
2628
- return o.textContent = er(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
2629
- Ao(
2697
+ return o.textContent = pr(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
2698
+ zo(
2630
2699
  e,
2631
2700
  "Upgrade",
2632
2701
  "pluno-pa-widget__billing-action-card-actions"
2633
2702
  )
2634
2703
  ), t;
2635
2704
  }
2636
- function ln(e, t) {
2637
- return e !== null && (le(e) || Io(e) || gn(t));
2705
+ function pn(e, t) {
2706
+ return e !== null && (pe(e) || Do(e) || hn(t));
2638
2707
  }
2639
- function Jn(e, t, n) {
2640
- return ln(t, n) || Qa(t) ? !0 : !ln(e, n);
2708
+ function to(e, t, n) {
2709
+ return pn(t, n) || lr(t) ? !0 : !pn(e, n);
2641
2710
  }
2642
- function Qa(e) {
2643
- return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || le(e));
2711
+ function lr(e) {
2712
+ return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || pe(e));
2644
2713
  }
2645
- function le(e) {
2714
+ function pe(e) {
2646
2715
  return e?.limitExceeded === !0 || !!e?.paymentIssue;
2647
2716
  }
2648
- function gn(e) {
2717
+ function hn(e) {
2649
2718
  return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
2650
2719
  }
2651
- function Io(e) {
2652
- return !le(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2720
+ function Do(e) {
2721
+ return !pe(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
2653
2722
  }
2654
- function er(e) {
2655
- return e.creditsRemaining === null ? null : `${tr(e.creditsRemaining)} credits left`;
2723
+ function pr(e) {
2724
+ return e.creditsRemaining === null ? null : `${sr(e.creditsRemaining)} credits left`;
2656
2725
  }
2657
- function tr(e) {
2726
+ function sr(e) {
2658
2727
  return new Intl.NumberFormat("en-US", {
2659
2728
  maximumFractionDigits: 0
2660
2729
  }).format(Math.ceil(e));
2661
2730
  }
2662
- function Ao(e, t, n) {
2731
+ function zo(e, t, n) {
2663
2732
  const o = document.createElement("div");
2664
2733
  return o.className = n, o.appendChild(
2665
- Qn(t, e.pricingUrl)
2734
+ no(t, e.pricingUrl)
2666
2735
  ), o.appendChild(
2667
- Qn("Earn credits", e.earnCreditsUrl)
2736
+ no("Earn credits", e.earnCreditsUrl)
2668
2737
  ), o;
2669
2738
  }
2670
- function Qn(e, t) {
2739
+ function no(e, t) {
2671
2740
  const n = document.createElement("button");
2672
2741
  if (n.type = "button", e === "Earn credits") {
2673
2742
  const o = document.createElement("span");
@@ -2678,142 +2747,148 @@ function Qn(e, t) {
2678
2747
  t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
2679
2748
  }), n;
2680
2749
  }
2681
- function Xt(e, t) {
2750
+ function Zt(e, t) {
2682
2751
  return e.messages.filter(
2683
- (o) => !No(o)
2752
+ (o) => !Mo(o)
2684
2753
  ).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
2685
2754
  }
2686
- function nr(e, t, n, o, i, r, l, p, s, c, u, m, L, v, D, C, g, y, h, E) {
2687
- const N = rr(r), I = N.filter(
2688
- (x) => !No(x)
2689
- ), G = e.scrollTop, ye = [], He = /* @__PURE__ */ new Set(), M = (x) => {
2755
+ function dr(e, t, n, o, i, r, l, p, s, u, c, h, k, v, z, S, g, y, m, L) {
2756
+ const N = hr(r), I = N.filter(
2757
+ (x) => !Mo(x)
2758
+ ), G = e.scrollTop, ye = [], He = /* @__PURE__ */ new Set(), R = (x) => {
2690
2759
  ye.push(x);
2691
2760
  };
2692
- Do(n, r.isThinking), i.hidden = !p, p && l !== null && So(i, l);
2693
- const We = I.length > 0 || !!r.assistantDraft || r.isThinking;
2694
- if (o(We), g || I.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2761
+ Uo(n, r.isThinking), i.hidden = !p, p && l !== null && To(i, l);
2762
+ const Ae = I.length > 0 || !!r.assistantDraft || r.isThinking;
2763
+ if (o(Ae), g || I.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
2695
2764
  const x = document.createElement("div");
2696
2765
  x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (g ? " pluno-pa-widget__empty-state--morning-report" : "");
2697
- const S = document.createElement("div");
2698
- S.className = "pluno-pa-widget__empty-hero";
2766
+ const C = document.createElement("div");
2767
+ C.className = "pluno-pa-widget__empty-hero";
2699
2768
  const j = xe(
2700
2769
  "pluno-pa-widget__character--empty",
2701
2770
  v()
2702
2771
  );
2703
- if (S.appendChild(j), x.appendChild(S), g) {
2704
- const P = document.createElement("h2");
2705
- P.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", P.textContent = g.opening, x.appendChild(P);
2772
+ if (C.appendChild(j), x.appendChild(C), g) {
2773
+ const E = document.createElement("h2");
2774
+ E.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", E.textContent = g.opening, x.appendChild(E);
2706
2775
  } else
2707
- x.appendChild(Co());
2708
- const V = g?.prompts ?? r.starterPrompts, J = document.createElement("div");
2709
- if (J.className = V.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", V.length === 0 && !r.starterPromptsLoading && J.setAttribute("aria-hidden", "true"), V.length > 0)
2710
- for (const P of V) {
2711
- const R = document.createElement("button");
2712
- R.type = "button", R.className = "pluno-pa-widget__starter-prompt", R.textContent = `"${P}"`, R.addEventListener("click", () => {
2713
- D(P);
2714
- }), J.appendChild(R);
2776
+ x.appendChild(Lo());
2777
+ const V = g?.prompts ?? r.starterPrompts, Q = document.createElement("div");
2778
+ if (Q.className = V.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", V.length === 0 && !r.starterPromptsLoading && Q.setAttribute("aria-hidden", "true"), V.length > 0)
2779
+ for (const E of V) {
2780
+ const D = document.createElement("button");
2781
+ D.type = "button", D.className = "pluno-pa-widget__starter-prompt", D.textContent = `"${E}"`, D.addEventListener("click", () => {
2782
+ z(E);
2783
+ }), Q.appendChild(D);
2715
2784
  }
2716
2785
  else if (r.starterPromptsLoading) {
2717
- const P = document.createElement("button");
2718
- P.type = "button", P.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", P.disabled = !0, P.tabIndex = -1, P.textContent = "Generating example tasks...", J.appendChild(P);
2786
+ const E = document.createElement("button");
2787
+ E.type = "button", E.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", E.disabled = !0, E.tabIndex = -1, E.textContent = "Generating example tasks...", Q.appendChild(E);
2719
2788
  } else
2720
- for (let P = 0; P < Ui; P += 1) {
2721
- const R = document.createElement("button");
2722
- R.type = "button", R.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", R.disabled = !0, R.tabIndex = -1, R.textContent = "", J.appendChild(R);
2789
+ for (let E = 0; E < ji; E += 1) {
2790
+ const D = document.createElement("button");
2791
+ 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);
2723
2792
  }
2724
- if (x.appendChild(J), g) {
2725
- const P = document.createElement("button");
2726
- P.type = "button", P.className = "pluno-pa-widget__morning-report-snooze", P.textContent = "Snooze morning report", P.addEventListener("click", y), x.appendChild(P);
2793
+ if (x.appendChild(Q), g) {
2794
+ const E = document.createElement("button");
2795
+ E.type = "button", E.className = "pluno-pa-widget__morning-report-snooze", E.textContent = "Snooze morning report", E.addEventListener("click", y), x.appendChild(E);
2727
2796
  }
2728
- m.clear(), M(x), M(t), eo(e, ye);
2797
+ h.clear(), R(x), R(t), oo(e, ye);
2729
2798
  return;
2730
2799
  }
2731
- let w = null, O = null, ve = [];
2732
- const se = I.length - 1, ot = se >= 0 && pn(I[se]), $ = () => {
2800
+ let f = null, M = null, ve = [];
2801
+ const de = I.length - 1, ot = de >= 0 && sn(I[de]), H = () => {
2733
2802
  if (ve.length === 0)
2734
2803
  return !1;
2735
- const x = fr(
2804
+ const x = Cr(
2736
2805
  ve,
2737
- u,
2738
- L,
2806
+ c,
2807
+ k,
2739
2808
  v()
2740
2809
  );
2741
- return M(x), w = null, O = x, ve = [], !0;
2810
+ return R(x), f = null, M = x, ve = [], !0;
2742
2811
  };
2743
2812
  for (let x = 0; x < I.length; x += 1) {
2744
- const S = I[x];
2745
- if (S.role === "tool") {
2746
- ve.push(S);
2813
+ const C = I[x];
2814
+ if (C.role === "tool") {
2815
+ ve.push(C);
2747
2816
  continue;
2748
2817
  }
2749
- if (pn(S)) {
2750
- if (x !== se)
2818
+ if (sn(C)) {
2819
+ if (x !== de)
2751
2820
  continue;
2752
- if ($()) {
2753
- const R = _t();
2754
- M(R), w = null, O = R;
2821
+ if (H()) {
2822
+ const D = _t();
2823
+ R(D), f = null, M = D;
2755
2824
  } else {
2756
- const R = oo(v());
2757
- M(R), w = null, O = R;
2825
+ const D = lo(v());
2826
+ R(D), f = null, M = D;
2758
2827
  }
2759
2828
  continue;
2760
2829
  }
2761
- if (S.role === "system")
2830
+ if (C.role === "system") {
2831
+ if (C.dataType === "run_error" || C.dataType === "run_status") {
2832
+ H();
2833
+ const E = document.createElement("div");
2834
+ E.className = "pluno-pa-widget__error", E.textContent = ro(C.content), R(E), f = E, M = null;
2835
+ }
2762
2836
  continue;
2763
- const j = $(), V = mr(S.content);
2764
- if (S.role === "assistant" && !j) {
2765
- const P = Ro(v());
2766
- M(P), w = null, O = P;
2767
2837
  }
2768
- const J = or(S, V, m, He);
2769
- M(J), w = J, O = null;
2838
+ const j = H(), V = ro(C.content);
2839
+ if (C.role === "assistant" && !j) {
2840
+ const E = Oo(v());
2841
+ R(E), f = null, M = E;
2842
+ }
2843
+ const Q = cr(C, V, h, He);
2844
+ R(Q), f = Q, M = null;
2770
2845
  }
2771
- const it = $(), Ae = I[I.length - 1]?.id === "assistant-draft";
2772
- if (r.isThinking && !Ae && !ot)
2846
+ const it = H(), Ne = I[I.length - 1]?.id === "assistant-draft";
2847
+ if (r.isThinking && !Ne && !ot)
2773
2848
  if (it) {
2774
2849
  const x = _t();
2775
- M(x), w = null, O = x;
2850
+ R(x), f = null, M = x;
2776
2851
  } else {
2777
- const x = oo(v());
2778
- M(x), w = null, O = x;
2852
+ const x = lo(v());
2853
+ R(x), f = null, M = x;
2779
2854
  }
2780
2855
  if (r.lastError) {
2781
2856
  const x = document.createElement("div");
2782
2857
  x.className = "pluno-pa-widget__error";
2783
- const S = document.createElement("span");
2784
- if (S.textContent = r.lastError, x.appendChild(S), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
2858
+ const C = document.createElement("span");
2859
+ if (C.textContent = r.lastError, x.appendChild(C), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
2785
2860
  const j = document.createElement("button");
2786
2861
  j.type = "button", j.className = "pluno-pa-widget__error-retry", j.textContent = "Try again", j.addEventListener(
2787
2862
  "click",
2788
- r.lastErrorCode === "connection_failed" ? h : C
2863
+ r.lastErrorCode === "connection_failed" ? m : S
2789
2864
  ), x.appendChild(j);
2790
2865
  }
2791
- M(x), w = x, O = null;
2866
+ R(x), f = x, M = null;
2792
2867
  }
2793
- const oe = E && !r.isThinking ? si(N) : null;
2794
- if (E && oe && !E.dismissedCandidateIds.has(oe.id)) {
2795
- const x = sr(oe, {
2796
- isDrafting: E.draftingCandidateId === oe.id,
2797
- error: E.error,
2798
- characterIconOptions: E.characterIconOptions,
2799
- onDraft: E.onDraft,
2800
- onDismiss: E.onDismiss,
2801
- onDisable: E.onDisable
2868
+ const oe = L && !r.isThinking ? gi(N) : null;
2869
+ if (L && oe && !L.dismissedCandidateIds.has(oe.id)) {
2870
+ const x = wr(oe, {
2871
+ isDrafting: L.draftingCandidateId === oe.id,
2872
+ error: L.error,
2873
+ characterIconOptions: L.characterIconOptions,
2874
+ onDraft: L.onDraft,
2875
+ onDismiss: L.onDismiss,
2876
+ onDisable: L.onDisable
2802
2877
  });
2803
- M(x), E.onSeen(oe), w = null, O = x;
2878
+ R(x), L.onSeen(oe), f = null, M = x;
2804
2879
  }
2805
- w?.classList.add("pluno-pa-widget__message--bottom-reserve"), O?.classList.add("pluno-pa-widget__bottom-reserve-compact"), M(t), ar(m, He), eo(e, ye), s ? tt(e, c) : e.scrollTop = G;
2880
+ f?.classList.add("pluno-pa-widget__message--bottom-reserve"), M?.classList.add("pluno-pa-widget__bottom-reserve-compact"), R(t), gr(h, He), oo(e, ye), s ? tt(e, u) : e.scrollTop = G;
2806
2881
  }
2807
- function or(e, t, n, o) {
2808
- const i = ir(e, t), r = i ? n.get(i) : void 0;
2882
+ function cr(e, t, n, o) {
2883
+ const i = ur(e, t), r = i ? n.get(i) : void 0;
2809
2884
  if (i && r)
2810
2885
  return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
2811
2886
  const l = document.createElement("div");
2812
- l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? br(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(lr(e.attachments));
2887
+ l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? Er(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(mr(e.attachments));
2813
2888
  const p = document.createElement("div");
2814
- return p.className = "pluno-pa-widget__message-actions", p.appendChild(pr(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
2889
+ return p.className = "pluno-pa-widget__message-actions", p.appendChild(fr(t)), l.appendChild(p), i && (n.set(i, l), o.add(i)), l;
2815
2890
  }
2816
- function ir(e, t) {
2891
+ function ur(e, t) {
2817
2892
  return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
2818
2893
  id: e.id,
2819
2894
  content: t,
@@ -2831,11 +2906,11 @@ function ir(e, t) {
2831
2906
  })
2832
2907
  });
2833
2908
  }
2834
- function ar(e, t) {
2909
+ function gr(e, t) {
2835
2910
  for (const n of e.keys())
2836
2911
  t.has(n) || e.delete(n);
2837
2912
  }
2838
- function eo(e, t) {
2913
+ function oo(e, t) {
2839
2914
  let n = e.firstChild;
2840
2915
  for (const o of t) {
2841
2916
  if (o === n) {
@@ -2849,7 +2924,7 @@ function eo(e, t) {
2849
2924
  n = n.nextSibling, e.removeChild(o);
2850
2925
  }
2851
2926
  }
2852
- function rr(e) {
2927
+ function hr(e) {
2853
2928
  if (!e.assistantDraft)
2854
2929
  return [...e.messages];
2855
2930
  const t = {
@@ -2869,7 +2944,7 @@ function rr(e) {
2869
2944
  if (n === -1)
2870
2945
  return [...e.messages, t];
2871
2946
  const o = e.messages.findIndex(
2872
- (r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && to(r, t) && pn(r)
2947
+ (r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && io(r, t) && sn(r)
2873
2948
  );
2874
2949
  if (o !== -1)
2875
2950
  return [
@@ -2878,7 +2953,7 @@ function rr(e) {
2878
2953
  ...e.messages.slice(o + 1)
2879
2954
  ];
2880
2955
  let i = n + 1;
2881
- for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && to(e.messages[i], t); )
2956
+ for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && io(e.messages[i], t); )
2882
2957
  i += 1;
2883
2958
  return [
2884
2959
  ...e.messages.slice(0, i),
@@ -2886,45 +2961,45 @@ function rr(e) {
2886
2961
  ...e.messages.slice(i)
2887
2962
  ];
2888
2963
  }
2889
- function pn(e) {
2964
+ function sn(e) {
2890
2965
  return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
2891
2966
  }
2892
- function to(e, t) {
2967
+ function io(e, t) {
2893
2968
  return !e.runId || !t.runId ? !0 : e.runId === t.runId;
2894
2969
  }
2895
- function no(e, t, n, o, i, r, l, p) {
2896
- e.replaceChildren(), Do(t, !1), t.disabled = !0, n(!1);
2970
+ function ao(e, t, n, o, i, r, l, p) {
2971
+ e.replaceChildren(), Uo(t, !1), t.disabled = !0, n(!1);
2897
2972
  const s = document.createElement("div");
2898
2973
  s.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
2899
- const c = xe(
2974
+ const u = xe(
2900
2975
  "pluno-pa-widget__character--empty",
2901
2976
  o()
2902
2977
  );
2903
- s.appendChild(c);
2904
- const u = document.createElement("div");
2905
- if (u.className = "pluno-pa-widget__empty", u.textContent = i, s.appendChild(u), l) {
2906
- const m = document.createElement("a");
2907
- m.className = "pluno-pa-widget__login", m.href = l, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = r, s.appendChild(m);
2978
+ s.appendChild(u);
2979
+ const c = document.createElement("div");
2980
+ if (c.className = "pluno-pa-widget__empty", c.textContent = i, s.appendChild(c), l) {
2981
+ const h = document.createElement("a");
2982
+ h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, s.appendChild(h);
2908
2983
  } else {
2909
- const m = document.createElement("button");
2910
- m.type = "button", m.className = "pluno-pa-widget__login", m.textContent = r, m.addEventListener("click", () => p?.()), s.appendChild(m);
2984
+ const h = document.createElement("button");
2985
+ h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => p?.()), s.appendChild(h);
2911
2986
  }
2912
2987
  e.appendChild(s);
2913
2988
  }
2914
- function lr(e) {
2989
+ function mr(e) {
2915
2990
  const t = document.createElement("div");
2916
2991
  t.className = "pluno-pa-widget__message-attachments";
2917
2992
  for (const n of e)
2918
- t.appendChild(Ka(n));
2993
+ t.appendChild(nr(n));
2919
2994
  return t;
2920
2995
  }
2921
- function pr(e) {
2996
+ function fr(e) {
2922
2997
  const t = document.createElement("button");
2923
- return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(qa()), t.addEventListener("click", (n) => {
2998
+ return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(Qa()), t.addEventListener("click", (n) => {
2924
2999
  n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
2925
3000
  }), t;
2926
3001
  }
2927
- function sr(e, t) {
3002
+ function wr(e, t) {
2928
3003
  const n = document.createElement("article");
2929
3004
  n.className = "pluno-pa-widget__share-prompt";
2930
3005
  const o = document.createElement("div");
@@ -2940,32 +3015,32 @@ function sr(e, t) {
2940
3015
  r.textContent = "Share this win?", i.appendChild(r);
2941
3016
  const l = document.createElement("span");
2942
3017
  if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
2943
- const u = document.createElement("span");
2944
- u.className = "pluno-pa-widget__share-prompt-error", u.textContent = t.error, i.appendChild(u);
3018
+ const c = document.createElement("span");
3019
+ c.className = "pluno-pa-widget__share-prompt-error", c.textContent = t.error, i.appendChild(c);
2945
3020
  }
2946
3021
  o.appendChild(i);
2947
3022
  const p = document.createElement("div");
2948
3023
  p.className = "pluno-pa-widget__share-prompt-actions";
2949
3024
  const s = document.createElement("div");
2950
3025
  s.className = "pluno-pa-widget__share-prompt-primary-actions";
2951
- const c = document.createElement("button");
2952
- if (c.type = "button", c.disabled = t.isDrafting, c.addEventListener("click", () => {
3026
+ const u = document.createElement("button");
3027
+ if (u.type = "button", u.disabled = t.isDrafting, u.addEventListener("click", () => {
2953
3028
  t.onDraft(e);
2954
- }), t.isDrafting ? (c.appendChild(sn()), c.appendChild(document.createTextNode("Drafting..."))) : c.textContent = "Draft a social post", s.appendChild(c), t.isDrafting)
3029
+ }), t.isDrafting ? (u.appendChild(dn()), u.appendChild(document.createTextNode("Drafting..."))) : u.textContent = "Draft a social post", s.appendChild(u), t.isDrafting)
2955
3030
  p.appendChild(s);
2956
3031
  else {
2957
- const u = document.createElement("button");
2958
- u.type = "button", u.className = "pluno-pa-widget__share-prompt-dismiss", u.setAttribute("aria-label", "Dismiss share prompt"), u.title = "Dismiss", u.textContent = "Dismiss", u.addEventListener("click", () => {
3032
+ const c = document.createElement("button");
3033
+ c.type = "button", c.className = "pluno-pa-widget__share-prompt-dismiss", c.setAttribute("aria-label", "Dismiss share prompt"), c.title = "Dismiss", c.textContent = "Dismiss", c.addEventListener("click", () => {
2959
3034
  t.onDismiss(e);
2960
- }), s.appendChild(u), p.appendChild(s);
2961
- const m = document.createElement("button");
2962
- m.type = "button", m.className = "pluno-pa-widget__share-prompt-disable", m.textContent = "Don't ask again", m.addEventListener("click", () => {
3035
+ }), s.appendChild(c), p.appendChild(s);
3036
+ const h = document.createElement("button");
3037
+ h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => {
2963
3038
  t.onDisable(e);
2964
- }), p.appendChild(m);
3039
+ }), p.appendChild(h);
2965
3040
  }
2966
3041
  return o.appendChild(p), n.appendChild(o), n;
2967
3042
  }
2968
- function dr(e, t) {
3043
+ function br(e, t) {
2969
3044
  const n = document.createElement("div");
2970
3045
  n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (g) => {
2971
3046
  g.target === n && t.onClose();
@@ -2980,56 +3055,56 @@ function dr(e, t) {
2980
3055
  p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
2981
3056
  const s = document.createElement("div");
2982
3057
  s.className = "pluno-pa-widget__share-dialog-step";
2983
- const c = document.createElement("div");
2984
- c.className = "pluno-pa-widget__share-dialog-step-header";
2985
- const u = document.createElement("strong");
2986
- u.textContent = "1) Copy Screenshot", c.appendChild(u);
2987
- const m = cr(
3058
+ const u = document.createElement("div");
3059
+ u.className = "pluno-pa-widget__share-dialog-step-header";
3060
+ const c = document.createElement("strong");
3061
+ c.textContent = "1) Copy Screenshot", u.appendChild(c);
3062
+ const h = _r(
2988
3063
  "Copy Screenshot",
2989
3064
  async () => {
2990
3065
  try {
2991
- return await di(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
3066
+ return await hi(e.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
2992
3067
  } catch {
2993
3068
  return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
2994
3069
  }
2995
3070
  }
2996
3071
  );
2997
- if (c.appendChild(m), s.appendChild(c), e.screenshotDataUrl) {
3072
+ if (u.appendChild(h), s.appendChild(u), e.screenshotDataUrl) {
2998
3073
  const g = document.createElement("div");
2999
3074
  g.className = "pluno-pa-widget__share-dialog-screenshot";
3000
3075
  const y = document.createElement("img");
3001
3076
  y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", g.appendChild(y), s.appendChild(g);
3002
3077
  }
3003
3078
  o.appendChild(s), o.appendChild(p);
3004
- const L = document.createElement("div");
3005
- L.className = "pluno-pa-widget__share-dialog-step";
3079
+ const k = document.createElement("div");
3080
+ k.className = "pluno-pa-widget__share-dialog-step";
3006
3081
  const v = document.createElement("strong");
3007
- v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", L.appendChild(v);
3008
- const D = document.createElement("p");
3009
- D.className = "pluno-pa-widget__share-dialog-hint", D.textContent = "Post draft opens prefilled on supported platforms.", L.appendChild(D);
3010
- const C = document.createElement("footer");
3011
- C.className = "pluno-pa-widget__share-dialog-platforms";
3012
- for (const g of ur(e)) {
3082
+ v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
3083
+ const z = document.createElement("p");
3084
+ z.className = "pluno-pa-widget__share-dialog-hint", z.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(z);
3085
+ const S = document.createElement("footer");
3086
+ S.className = "pluno-pa-widget__share-dialog-platforms";
3087
+ for (const g of xr(e)) {
3013
3088
  const y = document.createElement("a");
3014
- y.href = g.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = g.label, y.setAttribute("aria-label", `Open ${g.label}`), y.appendChild(gr(g.id)), C.appendChild(y);
3089
+ y.href = g.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = g.label, y.setAttribute("aria-label", `Open ${g.label}`), y.appendChild(yr(g.id)), S.appendChild(y);
3015
3090
  }
3016
- if (L.appendChild(C), o.appendChild(L), t.socialPostRewardsUrl) {
3091
+ if (k.appendChild(S), o.appendChild(k), t.socialPostRewardsUrl) {
3017
3092
  const g = document.createElement("div");
3018
3093
  g.className = "pluno-pa-widget__share-dialog-step";
3019
3094
  const y = document.createElement("strong");
3020
3095
  y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(y);
3021
- const h = document.createElement("a");
3022
- h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(hr()), g.appendChild(h), o.appendChild(g);
3096
+ const m = document.createElement("a");
3097
+ m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(vr()), g.appendChild(m), o.appendChild(g);
3023
3098
  }
3024
3099
  return n.appendChild(o), n;
3025
3100
  }
3026
- function cr(e, t) {
3101
+ function _r(e, t) {
3027
3102
  const n = document.createElement("button");
3028
3103
  return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
3029
3104
  o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
3030
3105
  }), n;
3031
3106
  }
3032
- function ur(e) {
3107
+ function xr(e) {
3033
3108
  const t = e.linkedinPost.trim(), n = e.xPost.trim();
3034
3109
  return [
3035
3110
  {
@@ -3049,47 +3124,47 @@ function ur(e) {
3049
3124
  }
3050
3125
  ];
3051
3126
  }
3052
- function gr(e) {
3127
+ function yr(e) {
3053
3128
  const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3054
- return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (W(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), W(
3129
+ return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? ($(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), $(
3055
3130
  t,
3056
3131
  "M6.4 6.9c.6-.5 1.6-.5 2.1.1.7.7.5 1.8-.2 2.3-.8.5-1.9.2-2.3-.6-.2-.6 0-1.3.4-1.8Z"
3057
- ), W(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), W(
3132
+ ), $(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), $(
3058
3133
  t,
3059
3134
  "M14.8 16.2c1.2-2 3-3.1 5.1-2.9 3.4.3 4.8 2.7 4.8 6.2 0 1.9-.1 3.8-.1 5.8"
3060
- ), W(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (W(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), W(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), W(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (W(
3135
+ ), $(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? ($(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), $(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), $(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : ($(
3061
3136
  t,
3062
3137
  "M10.2 6.4c3.8-.3 8-.3 11.6.1 2.5.3 3.8 1.8 4 4 .4 3.3.4 7.4 0 10.9-.3 2.4-1.7 3.8-4 4.1-3.8.4-8.2.4-11.8 0-2.3-.3-3.7-1.8-4-4.1-.4-3.5-.3-7.8.1-11.1.2-2.2 1.8-3.6 4.1-3.9Z"
3063
- ), W(
3138
+ ), $(
3064
3139
  t,
3065
3140
  "M11 7.3c3.4-.4 7.1-.4 10.2.1 2 .3 3.1 1.4 3.4 3.2.4 3 .4 6.6.1 9.9-.3 2.2-1.3 3.3-3.3 3.7-3.2.5-7.2.5-10.5.1",
3066
3141
  "0.48"
3067
- ), W(
3142
+ ), $(
3068
3143
  t,
3069
3144
  "M12.1 16.1c.1-2.4 1.8-4.1 4-4.2 2.4-.1 4.2 1.6 4.3 4 .1 2.3-1.6 4.1-3.9 4.2-2.6.2-4.3-1.5-4.4-4Z"
3070
- ), W(
3145
+ ), $(
3071
3146
  t,
3072
3147
  "M22 10.7c.3-.1.7 0 .9.3.2.4.1.8-.2 1-.4.2-.8.1-1-.2-.2-.4-.1-.8.3-1.1Z"
3073
3148
  ), t);
3074
3149
  }
3075
- function W(e, t, n) {
3150
+ function $(e, t, n) {
3076
3151
  const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
3077
3152
  o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
3078
3153
  }
3079
- function hr() {
3154
+ function vr() {
3080
3155
  const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
3081
- return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), W(e, "M14 5h5v5"), W(e, "M19 5l-8 8"), W(
3156
+ return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), $(e, "M14 5h5v5"), $(e, "M19 5l-8 8"), $(
3082
3157
  e,
3083
3158
  "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
3084
3159
  ), e;
3085
3160
  }
3086
- function No(e) {
3087
- return e.role === "tool" && e.toolName === co;
3161
+ function Mo(e) {
3162
+ return e.role === "tool" && e.toolName === mo;
3088
3163
  }
3089
- function mr(e) {
3164
+ function ro(e) {
3090
3165
  return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
3091
3166
  }
3092
- function fr(e, t, n, o) {
3167
+ function Cr(e, t, n, o) {
3093
3168
  const i = document.createElement("article");
3094
3169
  i.className = "pluno-pa-widget__tool-group", i.title = new Date(
3095
3170
  e[e.length - 1].createdAt
@@ -3099,27 +3174,27 @@ function fr(e, t, n, o) {
3099
3174
  o
3100
3175
  )
3101
3176
  );
3102
- const r = document.createElement("details"), l = wr(e);
3177
+ const r = document.createElement("details"), l = Sr(e);
3103
3178
  r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
3104
3179
  i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
3105
3180
  });
3106
3181
  const p = document.createElement("summary");
3107
- p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(sn());
3108
- const c = document.createElement("span");
3109
- if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c), r.appendChild(p), e.length > 0) {
3110
- const u = document.createElement("div");
3111
- u.className = "pluno-pa-widget__tool-lines";
3112
- for (const m of e) {
3113
- const L = document.createElement("div");
3114
- L.className = "pluno-pa-widget__tool-line", m.loading && L.appendChild(sn());
3182
+ p.className = "pluno-pa-widget__tool-summary", e.some((c) => c.loading) && p.appendChild(dn());
3183
+ const u = document.createElement("span");
3184
+ if (u.className = "pluno-pa-widget__tool-summary-title", u.textContent = e[e.length - 1].content || "Run tool", p.appendChild(u), r.appendChild(p), e.length > 0) {
3185
+ const c = document.createElement("div");
3186
+ c.className = "pluno-pa-widget__tool-lines";
3187
+ for (const h of e) {
3188
+ const k = document.createElement("div");
3189
+ k.className = "pluno-pa-widget__tool-line", h.loading && k.appendChild(dn());
3115
3190
  const v = document.createElement("span");
3116
- v.textContent = m.content || "Run tool", L.appendChild(v), u.appendChild(L);
3191
+ v.textContent = h.content || "Run tool", k.appendChild(v), c.appendChild(k);
3117
3192
  }
3118
- r.appendChild(u);
3193
+ r.appendChild(c);
3119
3194
  }
3120
3195
  return i.appendChild(r), i;
3121
3196
  }
3122
- function Ro(e) {
3197
+ function Oo(e) {
3123
3198
  const t = document.createElement("article");
3124
3199
  return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
3125
3200
  xe(
@@ -3128,8 +3203,8 @@ function Ro(e) {
3128
3203
  )
3129
3204
  ), t;
3130
3205
  }
3131
- function oo(e) {
3132
- const t = Ro(e);
3206
+ function lo(e) {
3207
+ const t = Oo(e);
3133
3208
  return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(_t()), t;
3134
3209
  }
3135
3210
  function _t(e = "Thinking...") {
@@ -3140,18 +3215,18 @@ function _t(e = "Thinking...") {
3140
3215
  const o = document.createElement("span");
3141
3216
  return o.textContent = e, t.appendChild(o), t;
3142
3217
  }
3143
- function wr(e) {
3218
+ function Sr(e) {
3144
3219
  return `tools:${e[0]?.id ?? ""}`;
3145
3220
  }
3146
- function sn() {
3221
+ function dn() {
3147
3222
  const e = document.createElement("span");
3148
3223
  return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
3149
3224
  }
3150
- function Do(e, t) {
3151
- e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Ga() : Po());
3225
+ function Uo(e, t) {
3226
+ e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Za() : No());
3152
3227
  }
3153
- function br(e, t) {
3154
- const n = t.replace(/\r\n/g, `
3228
+ function Er(e, t) {
3229
+ const n = Pi(t).replace(/\r\n/g, `
3155
3230
  `).split(`
3156
3231
  `);
3157
3232
  let o = 0;
@@ -3166,9 +3241,9 @@ function br(e, t) {
3166
3241
  for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
3167
3242
  c.push(n[o]), o += 1;
3168
3243
  o += o < n.length ? 1 : 0;
3169
- const u = document.createElement("pre"), m = document.createElement("code");
3170
- m.textContent = c.join(`
3171
- `), u.appendChild(m), e.appendChild(u);
3244
+ const h = document.createElement("pre"), k = document.createElement("code");
3245
+ k.textContent = c.join(`
3246
+ `), h.appendChild(k), e.appendChild(h);
3172
3247
  continue;
3173
3248
  }
3174
3249
  const l = i.match(/^(#{1,3})\s+(.+)$/);
@@ -3180,28 +3255,29 @@ function br(e, t) {
3180
3255
  if (/^\s*[-*+]\s+/.test(i)) {
3181
3256
  const c = document.createElement("ul");
3182
3257
  for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
3183
- const u = document.createElement("li");
3184
- gt(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
3258
+ const h = document.createElement("li");
3259
+ gt(h, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(h), o += 1;
3185
3260
  }
3186
3261
  e.appendChild(c);
3187
3262
  continue;
3188
3263
  }
3189
- if (/^\s*\d+\.\s+/.test(i)) {
3264
+ const p = i.match(/^\s*(\d+)\.\s+/);
3265
+ if (p) {
3190
3266
  const c = document.createElement("ol");
3191
- for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
3192
- const u = document.createElement("li");
3193
- gt(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
3267
+ for (c.start = Number(p[1]); o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
3268
+ const h = document.createElement("li");
3269
+ gt(h, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(h), o += 1;
3194
3270
  }
3195
3271
  e.appendChild(c);
3196
3272
  continue;
3197
3273
  }
3198
- const p = [i];
3274
+ const s = [i];
3199
3275
  for (o += 1; o < n.length && n[o].trim() && !/^```/.test(n[o]) && !/^(#{1,3})\s+/.test(n[o]) && !/^\s*[-*+]\s+/.test(n[o]) && !/^\s*\d+\.\s+/.test(n[o]); )
3200
- p.push(n[o]), o += 1;
3201
- const s = document.createElement("p");
3202
- p.forEach((c, u) => {
3203
- u > 0 && s.appendChild(document.createElement("br")), gt(s, c);
3204
- }), e.appendChild(s);
3276
+ s.push(n[o]), o += 1;
3277
+ const u = document.createElement("p");
3278
+ s.forEach((c, h) => {
3279
+ h > 0 && u.appendChild(document.createElement("br")), gt(u, c);
3280
+ }), e.appendChild(u);
3205
3281
  }
3206
3282
  }
3207
3283
  function gt(e, t) {
@@ -3224,7 +3300,7 @@ function gt(e, t) {
3224
3300
  p.textContent = l.slice(1, -1), e.appendChild(p);
3225
3301
  } else {
3226
3302
  const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
3227
- if (p && _r(p[2])) {
3303
+ if (p && kr(p[2])) {
3228
3304
  const s = document.createElement("a");
3229
3305
  s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], e.appendChild(s);
3230
3306
  } else
@@ -3234,7 +3310,7 @@ function gt(e, t) {
3234
3310
  }
3235
3311
  o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
3236
3312
  }
3237
- function _r(e) {
3313
+ function kr(e) {
3238
3314
  if (e.startsWith("/") || e.startsWith("#"))
3239
3315
  return !0;
3240
3316
  try {
@@ -3244,14 +3320,20 @@ function _r(e) {
3244
3320
  return !1;
3245
3321
  }
3246
3322
  }
3247
- function io(e, t) {
3248
- if (xr(e))
3323
+ function po(e, t) {
3324
+ if (Lr(e))
3249
3325
  return;
3250
3326
  const n = `
3251
3327
  :host {
3252
3328
  all: initial;
3253
3329
  color-scheme: light;
3254
3330
  }
3331
+ :host([data-pluno-product-agent-layout="page"]) {
3332
+ display: block;
3333
+ width: 100%;
3334
+ height: 100%;
3335
+ min-height: 0;
3336
+ }
3255
3337
  *,
3256
3338
  *::before,
3257
3339
  *::after {
@@ -3298,7 +3380,7 @@ function io(e, t) {
3298
3380
  --pluno-pa-accent-contrast: #fafafa;
3299
3381
  position: fixed;
3300
3382
  z-index: 2147483645;
3301
- font-family: ${ae.fontFamily};
3383
+ font-family: ${re.fontFamily};
3302
3384
  font-size: 14px;
3303
3385
  color: var(--pluno-pa-text);
3304
3386
  width: var(--pluno-pa-launcher-width);
@@ -3316,6 +3398,30 @@ function io(e, t) {
3316
3398
  --pluno-pa-accent-soft: rgba(245, 245, 244, 0.22);
3317
3399
  --pluno-pa-accent-contrast: #18181b;
3318
3400
  }
3401
+ .pluno-pa-widget--layout-page {
3402
+ position: relative !important;
3403
+ inset: auto !important;
3404
+ width: 100%;
3405
+ height: 100%;
3406
+ min-height: 0;
3407
+ --pluno-pa-panel-width: 100%;
3408
+ --pluno-pa-panel-height: 100%;
3409
+ --pluno-pa-panel-offset-x: 0px;
3410
+ --pluno-pa-panel-offset-y: 0px;
3411
+ }
3412
+ .pluno-pa-widget--layout-page .pluno-pa-widget__launcher,
3413
+ .pluno-pa-widget--layout-page .pluno-pa-widget__close,
3414
+ .pluno-pa-widget--layout-page .pluno-pa-widget__resize-handle {
3415
+ display: none !important;
3416
+ }
3417
+ .pluno-pa-widget--layout-page .pluno-pa-widget__panel {
3418
+ inset: 0 !important;
3419
+ width: 100% !important;
3420
+ height: 100% !important;
3421
+ border-radius: 18px;
3422
+ opacity: 1;
3423
+ transform: none;
3424
+ }
3319
3425
  .pluno-pa-widget [hidden] {
3320
3426
  display: none !important;
3321
3427
  }
@@ -4142,6 +4248,9 @@ function io(e, t) {
4142
4248
  line-height: 1.35;
4143
4249
  font-weight: 650;
4144
4250
  }
4251
+ .pluno-pa-widget__message--assistant strong {
4252
+ font-weight: 1000;
4253
+ }
4145
4254
  .pluno-pa-widget__message--assistant ul,
4146
4255
  .pluno-pa-widget__message--assistant ol {
4147
4256
  padding-left: 20px;
@@ -4377,7 +4486,7 @@ function io(e, t) {
4377
4486
  place-items: center;
4378
4487
  padding: 18px;
4379
4488
  background: rgba(24, 24, 27, 0.28);
4380
- font-family: var(--pluno-pa-font, ${ae.fontFamily});
4489
+ font-family: var(--pluno-pa-font, ${re.fontFamily});
4381
4490
  color: var(--pluno-pa-text);
4382
4491
  }
4383
4492
  .pluno-pa-widget__share-dialog {
@@ -5045,7 +5154,8 @@ function io(e, t) {
5045
5154
  .pluno-pa-widget__starter-prompts {
5046
5155
  display: grid;
5047
5156
  gap: 18px;
5048
- width: min(100%, 320px);
5157
+ /* Personalized tasks should use the available chat width instead of wrapping against an arbitrary cap. */
5158
+ width: 100%;
5049
5159
  }
5050
5160
  .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompts {
5051
5161
  gap: 12px;
@@ -5200,8 +5310,8 @@ function io(e, t) {
5200
5310
  .pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
5201
5311
  position: absolute;
5202
5312
  top: -16px;
5203
- left: ${nn}px;
5204
- width: calc(100% - ${nn * 2}px);
5313
+ left: ${on}px;
5314
+ width: calc(100% - ${on * 2}px);
5205
5315
  height: 36px;
5206
5316
  z-index: 3;
5207
5317
  filter: url(#pluno-pa-scribble-wobble-2);
@@ -5219,6 +5329,11 @@ function io(e, t) {
5219
5329
  .pluno-pa-widget--scribble .pluno-pa-widget__message--assistant pre {
5220
5330
  font-family: inherit;
5221
5331
  }
5332
+ /* Architects Daughter only ships one weight, so a small stroke makes
5333
+ markdown bold visibly heavier instead of relying on synthetic weight. */
5334
+ .pluno-pa-widget--scribble .pluno-pa-widget__message--assistant strong {
5335
+ -webkit-text-stroke: 0.45px currentColor;
5336
+ }
5222
5337
  .pluno-pa-widget--scribble .pluno-pa-widget__message {
5223
5338
  font-size: 17px;
5224
5339
  }
@@ -5553,28 +5668,28 @@ function io(e, t) {
5553
5668
  filter: url(#pluno-pa-scribble-wobble-2);
5554
5669
  }
5555
5670
  `;
5556
- if (yr(e, n))
5671
+ if (Tr(e, n))
5557
5672
  return;
5558
5673
  const o = e.ownerDocument.createElement("style");
5559
- o.id = xo, o.textContent = n, e.appendChild(o), Mo(e);
5674
+ o.id = So, o.textContent = n, e.appendChild(o), Bo(e);
5560
5675
  }
5561
- function xr(e) {
5562
- return e.getElementById(xo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(yo) === "true";
5676
+ function Lr(e) {
5677
+ return e.getElementById(So) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Eo) === "true";
5563
5678
  }
5564
- function Mo(e) {
5565
- e.host instanceof HTMLElement && e.host.setAttribute(yo, "true");
5679
+ function Bo(e) {
5680
+ e.host instanceof HTMLElement && e.host.setAttribute(Eo, "true");
5566
5681
  }
5567
- function yr(e, t) {
5682
+ function Tr(e, t) {
5568
5683
  if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
5569
5684
  return !1;
5570
5685
  try {
5571
5686
  const n = new CSSStyleSheet();
5572
- return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Mo(e), !0;
5687
+ return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Bo(e), !0;
5573
5688
  } catch {
5574
5689
  return !1;
5575
5690
  }
5576
5691
  }
5577
- async function vr() {
5692
+ async function Pr() {
5578
5693
  return document.body ? document.body : await new Promise((e) => {
5579
5694
  const t = new MutationObserver(() => {
5580
5695
  document.body && (t.disconnect(), e(document.body));
@@ -5582,18 +5697,18 @@ async function vr() {
5582
5697
  t.observe(document.documentElement, { childList: !0 });
5583
5698
  });
5584
5699
  }
5585
- function zo(e) {
5700
+ function Fo(e) {
5586
5701
  return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
5587
5702
  }
5588
- function Cr(e) {
5703
+ function Ir(e) {
5589
5704
  if (e)
5590
5705
  return { clientId: e, release: () => {
5591
5706
  } };
5592
5707
  let t = 0;
5593
- for (; Ht.has(t); )
5708
+ for (; Wt.has(t); )
5594
5709
  t += 1;
5595
- Ht.add(t);
5596
- const n = `${zi}${t}`;
5710
+ Wt.add(t);
5711
+ const n = `${Gi}${t}`;
5597
5712
  let o = crypto.randomUUID();
5598
5713
  try {
5599
5714
  o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
@@ -5603,15 +5718,15 @@ function Cr(e) {
5603
5718
  return {
5604
5719
  clientId: o,
5605
5720
  release: () => {
5606
- i || (i = !0, Ht.delete(t));
5721
+ i || (i = !0, Wt.delete(t));
5607
5722
  }
5608
5723
  };
5609
5724
  }
5610
- function Sr(e) {
5725
+ function Ar(e) {
5611
5726
  try {
5612
- const t = window.localStorage.getItem(zo(e));
5727
+ const t = window.localStorage.getItem(Fo(e));
5613
5728
  if (!t)
5614
- return ao();
5729
+ return so();
5615
5730
  const n = JSON.parse(t);
5616
5731
  return {
5617
5732
  isOpen: n.isOpen === !0,
@@ -5621,25 +5736,25 @@ function Sr(e) {
5621
5736
  openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
5622
5737
  (o) => typeof o == "string"
5623
5738
  ) : [],
5624
- launcherPosition: Pr(n.launcherPosition) ? n.launcherPosition : null,
5625
- panelSize: Tr(n.panelSize) ? xt(n.panelSize) : null,
5626
- seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-uo) : [],
5739
+ launcherPosition: zr(n.launcherPosition) ? n.launcherPosition : null,
5740
+ panelSize: Mr(n.panelSize) ? xt(n.panelSize) : null,
5741
+ seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-fo) : [],
5627
5742
  sharePromptsDisabled: n.sharePromptsDisabled === !0
5628
5743
  };
5629
5744
  } catch {
5630
- return ao();
5745
+ return so();
5631
5746
  }
5632
5747
  }
5633
- async function Er(e) {
5748
+ async function Nr(e) {
5634
5749
  if (e.loadSharePromptsDisabled)
5635
5750
  return e.loadSharePromptsDisabled();
5636
5751
  try {
5637
- return window.localStorage.getItem(ho) === "true";
5752
+ return window.localStorage.getItem(bo) === "true";
5638
5753
  } catch {
5639
5754
  return !1;
5640
5755
  }
5641
5756
  }
5642
- function kr(e, t) {
5757
+ function Rr(e, t) {
5643
5758
  if (e.persistSharePromptsDisabled) {
5644
5759
  Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
5645
5760
  () => {
@@ -5648,12 +5763,12 @@ function kr(e, t) {
5648
5763
  return;
5649
5764
  }
5650
5765
  try {
5651
- t && window.localStorage.setItem(ho, "true");
5766
+ t && window.localStorage.setItem(bo, "true");
5652
5767
  } catch {
5653
5768
  return;
5654
5769
  }
5655
5770
  }
5656
- function ao() {
5771
+ function so() {
5657
5772
  return {
5658
5773
  isOpen: !1,
5659
5774
  composerValue: "",
@@ -5666,29 +5781,29 @@ function ao() {
5666
5781
  sharePromptsDisabled: !1
5667
5782
  };
5668
5783
  }
5669
- function Lr(e, t) {
5784
+ function Dr(e, t) {
5670
5785
  try {
5671
5786
  window.localStorage.setItem(
5672
- zo(e),
5787
+ Fo(e),
5673
5788
  JSON.stringify(t)
5674
5789
  );
5675
5790
  } catch {
5676
5791
  return;
5677
5792
  }
5678
5793
  }
5679
- function Pr(e) {
5794
+ function zr(e) {
5680
5795
  if (!e || typeof e != "object")
5681
5796
  return !1;
5682
5797
  const t = e;
5683
5798
  return Number.isFinite(t.x) && Number.isFinite(t.y) && (t.anchor === "top-left" || t.anchor === "top-right" || t.anchor === "bottom-left" || t.anchor === "bottom-right");
5684
5799
  }
5685
- function Tr(e) {
5800
+ function Mr(e) {
5686
5801
  if (!e || typeof e != "object")
5687
5802
  return !1;
5688
5803
  const t = e;
5689
5804
  return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
5690
5805
  }
5691
- async function Oo(e, t) {
5806
+ async function Ho(e, t) {
5692
5807
  const n = await fetch(e, {
5693
5808
  method: "POST",
5694
5809
  credentials: "include",
@@ -5700,7 +5815,7 @@ async function Oo(e, t) {
5700
5815
  ...t ? { signal: t } : {}
5701
5816
  });
5702
5817
  if (!n.ok) {
5703
- const i = await n.text(), r = ni(i);
5818
+ const i = await n.text(), r = ri(i);
5704
5819
  throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
5705
5820
  }
5706
5821
  const o = await n.json();
@@ -5708,29 +5823,29 @@ async function Oo(e, t) {
5708
5823
  throw new Error("Pluno token endpoint did not return a token");
5709
5824
  return o.token;
5710
5825
  }
5711
- function Ir(e) {
5826
+ function Or(e) {
5712
5827
  let t = !1, n = !1;
5713
5828
  const o = async () => {
5714
5829
  const i = new AbortController();
5715
5830
  let r = !1;
5716
5831
  const l = new Promise((p, s) => {
5717
- const c = window.setTimeout(() => {
5718
- r = !0, i.abort(), s(new Error(Mn));
5719
- }, Di);
5832
+ const u = window.setTimeout(() => {
5833
+ r = !0, i.abort(), s(new Error(Un));
5834
+ }, Wi);
5720
5835
  i.signal.addEventListener(
5721
5836
  "abort",
5722
- () => window.clearTimeout(c),
5837
+ () => window.clearTimeout(u),
5723
5838
  { once: !0 }
5724
5839
  );
5725
5840
  });
5726
5841
  try {
5727
5842
  const p = await Promise.race([
5728
- Oo(e, i.signal),
5843
+ Ho(e, i.signal),
5729
5844
  l
5730
5845
  ]);
5731
5846
  return i.abort(), p;
5732
5847
  } catch (p) {
5733
- throw i.abort(), r ? new Error(Mn) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error(Mi);
5848
+ throw i.abort(), r ? new Error(Un) : p instanceof Error && p.message.startsWith("Pluno widget blocked on ") ? p : new Error($i);
5734
5849
  }
5735
5850
  };
5736
5851
  return {
@@ -5753,32 +5868,32 @@ function Ir(e) {
5753
5868
  }
5754
5869
  };
5755
5870
  }
5756
- const ro = /* @__PURE__ */ new WeakSet();
5757
- function Ar(e) {
5871
+ const co = /* @__PURE__ */ new WeakSet();
5872
+ function Ur(e) {
5758
5873
  return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
5759
5874
  }
5760
- function lo(e) {
5875
+ function uo(e) {
5761
5876
  const t = e.pathname.split("/");
5762
5877
  return t[t.length - 1] ?? "";
5763
5878
  }
5764
- function Nr(e, t) {
5879
+ function Br(e, t) {
5765
5880
  const n = new URL(e.src, document.baseURI);
5766
- return n.href === t.href || n.pathname === t.pathname ? !0 : lo(n) === lo(t);
5881
+ return n.href === t.href || n.pathname === t.pathname ? !0 : uo(n) === uo(t);
5767
5882
  }
5768
- class he extends EventTarget {
5883
+ class me extends EventTarget {
5769
5884
  constructor(t, n) {
5770
- super(), this.channelId = n, this.url = t, this.addPreviewListener(Ti, () => {
5771
- this.readyState = he.OPEN, this.dispatchEvent(new Event("open"));
5772
- }), this.addPreviewListener(Ii, (o) => {
5885
+ super(), this.channelId = n, this.url = t, this.addPreviewListener(Oi, () => {
5886
+ this.readyState = me.OPEN, this.dispatchEvent(new Event("open"));
5887
+ }), this.addPreviewListener(Ui, (o) => {
5773
5888
  const i = o;
5774
5889
  this.dispatchEvent(
5775
5890
  new MessageEvent("message", { data: i.detail?.data ?? "" })
5776
5891
  );
5777
- }), this.addPreviewListener(Ai, () => {
5778
- this.readyState = he.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
5779
- }), this.addPreviewListener(Ni, (o) => {
5892
+ }), this.addPreviewListener(Bi, () => {
5893
+ this.readyState = me.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
5894
+ }), this.addPreviewListener(Fi, (o) => {
5780
5895
  const i = o;
5781
- this.readyState = he.CLOSED, this.dispatchEvent(
5896
+ this.readyState = me.CLOSED, this.dispatchEvent(
5782
5897
  new CloseEvent("close", {
5783
5898
  code: i.detail?.code ?? 1e3,
5784
5899
  reason: i.detail?.reason ?? "",
@@ -5788,7 +5903,7 @@ class he extends EventTarget {
5788
5903
  }), window.dispatchEvent(
5789
5904
  new CustomEvent(
5790
5905
  ht(
5791
- ki,
5906
+ Di,
5792
5907
  this.channelId
5793
5908
  ),
5794
5909
  {
@@ -5807,18 +5922,18 @@ class he extends EventTarget {
5807
5922
  extensions = "";
5808
5923
  binaryType = "blob";
5809
5924
  bufferedAmount = 0;
5810
- readyState = he.CONNECTING;
5811
- socketId = Rr();
5925
+ readyState = me.CONNECTING;
5926
+ socketId = Fr();
5812
5927
  listeners = /* @__PURE__ */ new Map();
5813
5928
  send(t) {
5814
- if (this.readyState !== he.OPEN)
5929
+ if (this.readyState !== me.OPEN)
5815
5930
  throw new DOMException(
5816
5931
  "Pluno preview websocket is not open",
5817
5932
  "InvalidStateError"
5818
5933
  );
5819
5934
  window.dispatchEvent(
5820
5935
  new CustomEvent(
5821
- ht(Li, this.channelId),
5936
+ ht(zi, this.channelId),
5822
5937
  {
5823
5938
  detail: {
5824
5939
  socketId: this.socketId,
@@ -5829,9 +5944,9 @@ class he extends EventTarget {
5829
5944
  );
5830
5945
  }
5831
5946
  close(t, n) {
5832
- this.readyState !== he.CLOSED && (this.readyState = he.CLOSING, window.dispatchEvent(
5947
+ this.readyState !== me.CLOSED && (this.readyState = me.CLOSING, window.dispatchEvent(
5833
5948
  new CustomEvent(
5834
- ht(Pi, this.channelId),
5949
+ ht(Mi, this.channelId),
5835
5950
  {
5836
5951
  detail: { socketId: this.socketId, code: t, reason: n }
5837
5952
  }
@@ -5853,19 +5968,19 @@ class he extends EventTarget {
5853
5968
  this.listeners.clear();
5854
5969
  }
5855
5970
  }
5856
- function Rr() {
5971
+ function Fr() {
5857
5972
  const e = window.sessionStorage.getItem(
5858
- Dn
5973
+ On
5859
5974
  );
5860
5975
  if (e)
5861
5976
  return e;
5862
5977
  const t = crypto.randomUUID();
5863
- return window.sessionStorage.setItem(Dn, t), t;
5978
+ return window.sessionStorage.setItem(On, t), t;
5864
5979
  }
5865
5980
  function ht(e, t) {
5866
5981
  return `${e}:${t}`;
5867
5982
  }
5868
- function Dr(e) {
5983
+ function Hr(e) {
5869
5984
  const t = document.currentScript;
5870
5985
  if (t instanceof HTMLScriptElement)
5871
5986
  return [t];
@@ -5873,35 +5988,35 @@ function Dr(e) {
5873
5988
  return Array.from(
5874
5989
  document.querySelectorAll("script[type='module'][src]")
5875
5990
  ).filter(
5876
- (i) => i instanceof HTMLScriptElement && Ar(i) && Nr(i, o)
5991
+ (i) => i instanceof HTMLScriptElement && Ur(i) && Br(i, o)
5877
5992
  );
5878
5993
  }
5879
- function Mr(e) {
5880
- for (const t of Dr(e))
5881
- ro.has(t) || t.dataset.plunoAutoMount === "false" || (ro.add(t), Uo(t).catch((n) => {
5994
+ function Wr(e) {
5995
+ for (const t of Hr(e))
5996
+ co.has(t) || t.dataset.plunoAutoMount === "false" || (co.add(t), Wo(t).catch((n) => {
5882
5997
  console.error("Failed to mount Pluno widget", n);
5883
5998
  }));
5884
5999
  }
5885
- function Uo(e) {
5886
- const t = window, n = t[ge];
6000
+ function Wo(e) {
6001
+ const t = window, n = t[he];
5887
6002
  if (n) {
5888
6003
  if (n.host === null)
5889
6004
  return n.mountPromise.catch(() => {
5890
- const s = t[ge];
5891
- return s ? s.mountPromise : Uo(e);
6005
+ const s = t[he];
6006
+ return s ? s.mountPromise : Wo(e);
5892
6007
  });
5893
- if (zr(n.host))
6008
+ if ($r(n.host))
5894
6009
  return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
5895
- n.destroy?.(), delete t[ge];
6010
+ n.destroy?.(), delete t[he];
5896
6011
  }
5897
- const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? Ir(i) : null;
6012
+ const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? Or(i) : null;
5898
6013
  let l;
5899
- const p = ia({
6014
+ const p = ua({
5900
6015
  token: e.dataset.plunoToken,
5901
6016
  tokenProvider: r?.loadToken,
5902
6017
  tokenEndpoint: i,
5903
6018
  backendUrl: e.dataset.plunoBackendUrl,
5904
- webSocketFactory: o ? oa(o) : void 0,
6019
+ webSocketFactory: o ? ca(o) : void 0,
5905
6020
  launcherLabel: e.dataset.plunoLauncherLabel,
5906
6021
  accentColor: e.dataset.plunoAccentColor,
5907
6022
  colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
@@ -5909,29 +6024,29 @@ function Uo(e) {
5909
6024
  scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
5910
6025
  position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
5911
6026
  }).then((s) => {
5912
- if (t[ge] !== l) {
6027
+ if (t[he] !== l) {
5913
6028
  s.destroy();
5914
6029
  return;
5915
6030
  }
5916
- const c = s.host;
5917
- c.setAttribute(go, "true"), l.host = c, l.destroy = () => {
5918
- t[ge] === l && delete t[ge], l.host = null, l.destroy = null, s.destroy();
6031
+ const u = s.host;
6032
+ u.setAttribute(wo, "true"), l.host = u, l.destroy = () => {
6033
+ t[he] === l && delete t[he], l.host = null, l.destroy = null, s.destroy();
5919
6034
  };
5920
6035
  }).catch((s) => {
5921
- throw t[ge] === l && delete t[ge], s;
6036
+ throw t[he] === l && delete t[he], s;
5922
6037
  });
5923
6038
  return l = {
5924
6039
  mountPromise: p,
5925
6040
  host: null,
5926
6041
  destroy: null,
5927
6042
  retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
5928
- }, t[ge] = l, p;
6043
+ }, t[he] = l, p;
5929
6044
  }
5930
- function zr(e) {
5931
- return e.isConnected && e.getAttribute(go) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
6045
+ function $r(e) {
6046
+ return e.isConnected && e.getAttribute(wo) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
5932
6047
  }
5933
- Mr(import.meta.url);
6048
+ Wr(import.meta.url);
5934
6049
  export {
5935
- oa as createProductAgentPreviewBridgeWebSocketFactory,
5936
- ia as mountPlunoProductAgentWidget
6050
+ ca as createProductAgentPreviewBridgeWebSocketFactory,
6051
+ ua as mountPlunoProductAgentWidget
5937
6052
  };