@pluno/product-agent-web 0.1.21 → 0.1.22

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,7 +1,7 @@
1
- import { PlunoProductAgent as yt } from "./product-agent-sdk.js";
2
- const vt = "#7c3aed";
3
- function Ct(t) {
4
- const e = Pt(t);
1
+ import { PlunoProductAgent as Ct } from "./product-agent-sdk.js";
2
+ const Et = "#7c3aed";
3
+ function kt(t) {
4
+ const e = Nt(t);
5
5
  return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1254 1254" role="img" aria-label="Pluno">
6
6
  <defs>
7
7
  <linearGradient id="boltFill" x1="420" y1="180" x2="790" y2="1040" gradientUnits="userSpaceOnUse">
@@ -75,23 +75,23 @@ function Ct(t) {
75
75
  </g>
76
76
  </svg>`;
77
77
  }
78
- function Et(t) {
79
- return `data:image/svg+xml,${encodeURIComponent(Ct(t))}`;
78
+ function St(t) {
79
+ return `data:image/svg+xml,${encodeURIComponent(kt(t))}`;
80
80
  }
81
- const $ = "#2c2a1e", Ae = [253, 250, 241], Ne = 3.5;
82
- function Qe(t) {
83
- const e = et(t);
84
- if (Te(X(e), Ae) >= Ne)
81
+ const H = "#2c2a1e", De = [253, 250, 241], Te = 3.5;
82
+ function et(t) {
83
+ const e = tt(t);
84
+ if (Ie(J(e), De) >= Te)
85
85
  return e;
86
- let o = X(e);
87
- const a = X($);
88
- for (let i = 0; i < 6; i += 1)
89
- if (o = At(o, a, 0.22), Te(o, Ae) >= Ne)
90
- return fe(o);
91
- return fe(o);
92
- }
93
- function kt(t) {
94
- const e = Qe(t), n = "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";
86
+ let o = J(e);
87
+ const a = J(H);
88
+ for (let r = 0; r < 6; r += 1)
89
+ if (o = Dt(o, a, 0.22), Ie(o, De) >= Te)
90
+ return be(o);
91
+ return be(o);
92
+ }
93
+ function Lt(t) {
94
+ const e = et(t), n = "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";
95
95
  return `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1254 1254" role="img" aria-label="Pluno">
96
96
  <defs>
97
97
  <clipPath id="scribbleBoltClip">
@@ -104,35 +104,35 @@ function kt(t) {
104
104
  </defs>
105
105
  <g filter="url(#scribbleBoltWobble)">
106
106
  <g clip-path="url(#scribbleBoltClip)">
107
- <path d="${Lt()}" fill="none" stroke="${e}" stroke-width="56" stroke-linecap="round" stroke-linejoin="round" opacity="0.9" transform="rotate(-14 627 600)"/>
107
+ <path d="${At()}" fill="none" stroke="${e}" stroke-width="56" stroke-linecap="round" stroke-linejoin="round" opacity="0.9" transform="rotate(-14 627 600)"/>
108
108
  </g>
109
- <path d="${n}" fill="none" stroke="${$}" stroke-width="18" stroke-linejoin="round"/>
109
+ <path d="${n}" fill="none" stroke="${H}" stroke-width="18" stroke-linejoin="round"/>
110
110
  <g transform="rotate(-2 528 463)">
111
- <ellipse cx="528" cy="463" rx="73" ry="80" fill="#ffffff" stroke="${$}" stroke-width="13"/>
112
- <ellipse cx="533" cy="473" rx="45" ry="53" fill="${$}"/>
111
+ <ellipse cx="528" cy="463" rx="73" ry="80" fill="#ffffff" stroke="${H}" stroke-width="13"/>
112
+ <ellipse cx="533" cy="473" rx="45" ry="53" fill="${H}"/>
113
113
  <circle cx="557" cy="447" r="16" fill="#ffffff"/>
114
114
  </g>
115
115
  <g transform="rotate(2 717 462)">
116
- <ellipse cx="717" cy="462" rx="73" ry="80" fill="#ffffff" stroke="${$}" stroke-width="13"/>
117
- <ellipse cx="712" cy="473" rx="45" ry="53" fill="${$}"/>
116
+ <ellipse cx="717" cy="462" rx="73" ry="80" fill="#ffffff" stroke="${H}" stroke-width="13"/>
117
+ <ellipse cx="712" cy="473" rx="45" ry="53" fill="${H}"/>
118
118
  <circle cx="728" cy="447" r="16" fill="#ffffff"/>
119
119
  </g>
120
120
  </g>
121
121
  </svg>`;
122
122
  }
123
- function St(t) {
124
- return `data:image/svg+xml,${encodeURIComponent(kt(t))}`;
123
+ function Pt(t) {
124
+ return `data:image/svg+xml,${encodeURIComponent(Lt(t))}`;
125
125
  }
126
- function Lt() {
126
+ function At() {
127
127
  let n = "M 280 120", o = !1, a = 0;
128
- for (let i = 150; i <= 1170; i += 62) {
128
+ for (let r = 150; r <= 1170; r += 62) {
129
129
  const l = (a % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
130
- n += ` L ${p} ${i}`, o = !o, a += 1;
130
+ n += ` L ${p} ${r}`, o = !o, a += 1;
131
131
  }
132
132
  return n;
133
133
  }
134
- function Pt(t) {
135
- const e = et(t), n = we(X(e));
134
+ function Nt(t) {
135
+ const e = tt(t), n = _e(J(e));
136
136
  return n > 0.86 ? {
137
137
  top: "#ffffff",
138
138
  middle: "#f6f6f6",
@@ -156,90 +156,90 @@ function Pt(t) {
156
156
  inner: "#4b4b4b",
157
157
  shadow: "#000000"
158
158
  } : {
159
- top: N(e, 0.28, -0.03),
160
- middle: N(e, 0.08, 0.04),
161
- bottom: N(e, -0.1, 0.02),
162
- edgeStart: N(e, 0.08, 0.08),
163
- edgeMiddle: N(e, -0.08, 0.08),
164
- edgeEnd: N(e, -0.18, 0.05),
165
- glow: N(e, 0.32, -0.12),
166
- highlight: N(e, 0.38, -0.18),
167
- inner: N(e, 0.24, -0.1),
168
- shadow: N(e, -0.25, -0.08)
159
+ top: D(e, 0.28, -0.03),
160
+ middle: D(e, 0.08, 0.04),
161
+ bottom: D(e, -0.1, 0.02),
162
+ edgeStart: D(e, 0.08, 0.08),
163
+ edgeMiddle: D(e, -0.08, 0.08),
164
+ edgeEnd: D(e, -0.18, 0.05),
165
+ glow: D(e, 0.32, -0.12),
166
+ highlight: D(e, 0.38, -0.18),
167
+ inner: D(e, 0.24, -0.1),
168
+ shadow: D(e, -0.25, -0.08)
169
169
  };
170
170
  }
171
- function et(t) {
171
+ function tt(t) {
172
172
  const e = t.trim();
173
- return /^#[0-9a-f]{6}$/i.test(e) ? e.toLowerCase() : /^#[0-9a-f]{3}$/i.test(e) ? `#${e.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : vt;
173
+ return /^#[0-9a-f]{6}$/i.test(e) ? e.toLowerCase() : /^#[0-9a-f]{3}$/i.test(e) ? `#${e.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : Et;
174
174
  }
175
- function X(t) {
175
+ function J(t) {
176
176
  return [
177
177
  Number.parseInt(t.slice(1, 3), 16),
178
178
  Number.parseInt(t.slice(3, 5), 16),
179
179
  Number.parseInt(t.slice(5, 7), 16)
180
180
  ];
181
181
  }
182
- function fe([t, e, n]) {
182
+ function be([t, e, n]) {
183
183
  const o = (a) => Math.max(0, Math.min(255, Math.round(a))).toString(16).padStart(2, "0");
184
184
  return `#${o(t)}${o(e)}${o(n)}`;
185
185
  }
186
- function we([t, e, n]) {
186
+ function _e([t, e, n]) {
187
187
  const o = (a) => {
188
- const i = a / 255;
189
- return i <= 0.04045 ? i / 12.92 : ((i + 0.055) / 1.055) ** 2.4;
188
+ const r = a / 255;
189
+ return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
190
190
  };
191
191
  return 0.2126 * o(t) + 0.7152 * o(e) + 0.0722 * o(n);
192
192
  }
193
- function Te(t, e) {
194
- const n = we(t), o = we(e), [a, i] = n > o ? [n, o] : [o, n];
195
- return (a + 0.05) / (i + 0.05);
193
+ function Ie(t, e) {
194
+ const n = _e(t), o = _e(e), [a, r] = n > o ? [n, o] : [o, n];
195
+ return (a + 0.05) / (r + 0.05);
196
196
  }
197
- function At(t, e, n) {
198
- const o = be(n);
197
+ function Dt(t, e, n) {
198
+ const o = xe(n);
199
199
  return [
200
200
  t[0] + (e[0] - t[0]) * o,
201
201
  t[1] + (e[1] - t[1]) * o,
202
202
  t[2] + (e[2] - t[2]) * o
203
203
  ];
204
204
  }
205
- function N(t, e, n) {
206
- const [o, a, i] = Nt(X(t));
207
- return fe(Tt(o, be(a + n), be(i + e)));
205
+ function D(t, e, n) {
206
+ const [o, a, r] = Tt(J(t));
207
+ return be(It(o, xe(a + n), xe(r + e)));
208
208
  }
209
- function Nt([t, e, n]) {
210
- const o = t / 255, a = e / 255, i = n / 255, l = Math.max(o, a, i), p = Math.min(o, a, i), s = (l + p) / 2;
209
+ function Tt([t, e, n]) {
210
+ const o = t / 255, a = e / 255, r = n / 255, l = Math.max(o, a, r), p = Math.min(o, a, r), s = (l + p) / 2;
211
211
  if (l === p)
212
212
  return [0, 0, s];
213
- const d = l - p, u = s > 0.5 ? d / (2 - l - p) : d / (l + p);
214
- return [(l === o ? (a - i) / d + (a < i ? 6 : 0) : l === a ? (i - o) / d + 2 : (o - a) / d + 4) / 6, u, s];
213
+ const g = l - p, c = s > 0.5 ? g / (2 - l - p) : g / (l + p);
214
+ return [(l === o ? (a - r) / g + (a < r ? 6 : 0) : l === a ? (r - o) / g + 2 : (o - a) / g + 4) / 6, c, s];
215
215
  }
216
- function Tt(t, e, n) {
216
+ function It(t, e, n) {
217
217
  if (e === 0)
218
218
  return [n * 255, n * 255, n * 255];
219
219
  const o = n < 0.5 ? n * (1 + e) : n + e - n * e, a = 2 * n - o;
220
220
  return [
221
- ue(a, o, t + 1 / 3) * 255,
222
- ue(a, o, t) * 255,
223
- ue(a, o, t - 1 / 3) * 255
221
+ he(a, o, t + 1 / 3) * 255,
222
+ he(a, o, t) * 255,
223
+ he(a, o, t - 1 / 3) * 255
224
224
  ];
225
225
  }
226
- function ue(t, e, n) {
226
+ function he(t, e, n) {
227
227
  let o = n;
228
228
  return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? t + (e - t) * 6 * o : o < 1 / 2 ? e : o < 2 / 3 ? t + (e - t) * (2 / 3 - o) * 6 : t;
229
229
  }
230
- function be(t) {
230
+ function xe(t) {
231
231
  return Math.max(0, Math.min(1, t));
232
232
  }
233
- const tt = "suggest_share_on_socials";
234
- function Dt(t) {
233
+ const nt = "suggest_share_on_socials";
234
+ function Mt(t) {
235
235
  for (let e = t.length - 1; e >= 0; e -= 1) {
236
236
  const n = t[e];
237
- if (n.role !== "tool" || n.toolName !== tt)
237
+ if (n.role !== "tool" || n.toolName !== nt)
238
238
  continue;
239
- const o = De(t, e, "assistant");
239
+ const o = Me(t, e, "assistant");
240
240
  if (!o)
241
241
  return null;
242
- const a = De(t, o.index, "user");
242
+ const a = Me(t, o.index, "user");
243
243
  return a ? {
244
244
  id: `share:${n.callId ?? n.id}`,
245
245
  userPrompt: a.content,
@@ -248,7 +248,13 @@ function Dt(t) {
248
248
  }
249
249
  return null;
250
250
  }
251
- function De(t, e, n) {
251
+ async function Rt(t) {
252
+ const e = await Ot(t);
253
+ if (!navigator.clipboard || typeof ClipboardItem > "u")
254
+ throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
255
+ await navigator.clipboard.write([new ClipboardItem({ [e.type || "image/png"]: e })]);
256
+ }
257
+ function Me(t, e, n) {
252
258
  for (let o = e - 1; o >= 0; o -= 1) {
253
259
  const a = t[o];
254
260
  if (a.role === n && a.content.trim())
@@ -256,7 +262,10 @@ function De(t, e, n) {
256
262
  }
257
263
  return null;
258
264
  }
259
- const nt = 100, It = "product-agent:sdk-preview-socket-connect", Rt = "product-agent:sdk-preview-socket-send", Mt = "product-agent:sdk-preview-socket-close", Ot = "product-agent:sdk-preview-socket-open", Ft = "product-agent:sdk-preview-socket-message", zt = "product-agent:sdk-preview-socket-error", Bt = "product-agent:sdk-preview-socket-closed", Ie = "product-agent:sdk-preview-socket-id", Gt = "product-agent:preview-diagnostic", ae = 10, $t = 10 * 1024 * 1024, Ut = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/webp", "image/gif", "application/pdf"]), I = {
265
+ async function Ot(t) {
266
+ return await (await fetch(t)).blob();
267
+ }
268
+ const ot = 100, Ft = "product-agent:sdk-preview-socket-connect", Bt = "product-agent:sdk-preview-socket-send", zt = "product-agent:sdk-preview-socket-close", Gt = "product-agent:sdk-preview-socket-open", $t = "product-agent:sdk-preview-socket-message", Ut = "product-agent:sdk-preview-socket-error", Wt = "product-agent:sdk-preview-socket-closed", Re = "product-agent:sdk-preview-socket-id", Ht = "product-agent:preview-diagnostic", at = "pluno.productAgent.sharePromptsDisabled", ie = 10, Vt = 10 * 1024 * 1024, jt = /* @__PURE__ */ new Set(["image/png", "image/jpeg", "image/webp", "image/gif", "application/pdf"]), M = {
260
269
  launcherLabel: "Ask for anything...",
261
270
  accentColor: "#7c3aed",
262
271
  colorScheme: "light",
@@ -264,19 +273,19 @@ const nt = 100, It = "product-agent:sdk-preview-socket-connect", Rt = "product-a
264
273
  scribbleStyle: !1,
265
274
  position: "bottom-right",
266
275
  movableLauncher: !1
267
- }, Re = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 104 36"><g><ellipse cx="17.5" cy="24.5" rx="2.4" ry="3" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.5 27 C20.5 12, 7.5 2.5, 6 18.5" fill="none" stroke="%232c2a1e" stroke-width="2.5" stroke-linecap="round"/></g><g transform="translate(26 0)"><ellipse cx="17.9" cy="24.1" rx="2.5" ry="2.8" fill="none" stroke="%232c2a1e" stroke-width="1.5" opacity="0.8"/><path d="M18.9 26.4 C21.2 13, 8.6 3.6, 6.9 17.4" fill="none" stroke="%232c2a1e" stroke-width="2.35" stroke-linecap="round"/></g><g transform="translate(52 0)"><ellipse cx="17.1" cy="24.9" rx="2.2" ry="3.1" fill="none" stroke="%232c2a1e" stroke-width="1.7" opacity="0.8"/><path d="M18.1 27.5 C19.9 10.4, 6.4 2, 5.6 19.2" fill="none" stroke="%232c2a1e" stroke-width="2.6" stroke-linecap="round"/></g><g transform="translate(78 0)"><ellipse cx="17.6" cy="24.4" rx="2.4" ry="2.9" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1" fill="none" stroke="%232c2a1e" stroke-width="2.45" stroke-linecap="round"/></g></svg>', Wt = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Me = "pluno-pa-scribble-font", ot = 190, at = 41, Ht = 48, Vt = 420, qt = 680, A = 8, Oe = 50, jt = "http://www.w3.org/2000/svg", Kt = 11, Yt = 13, Xt = 4, Zt = 10, Jt = 40, Qt = "movable-launcher-position-v2";
268
- function en(t) {
276
+ }, Oe = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 104 36"><g><ellipse cx="17.5" cy="24.5" rx="2.4" ry="3" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.5 27 C20.5 12, 7.5 2.5, 6 18.5" fill="none" stroke="%232c2a1e" stroke-width="2.5" stroke-linecap="round"/></g><g transform="translate(26 0)"><ellipse cx="17.9" cy="24.1" rx="2.5" ry="2.8" fill="none" stroke="%232c2a1e" stroke-width="1.5" opacity="0.8"/><path d="M18.9 26.4 C21.2 13, 8.6 3.6, 6.9 17.4" fill="none" stroke="%232c2a1e" stroke-width="2.35" stroke-linecap="round"/></g><g transform="translate(52 0)"><ellipse cx="17.1" cy="24.9" rx="2.2" ry="3.1" fill="none" stroke="%232c2a1e" stroke-width="1.7" opacity="0.8"/><path d="M18.1 27.5 C19.9 10.4, 6.4 2, 5.6 19.2" fill="none" stroke="%232c2a1e" stroke-width="2.6" stroke-linecap="round"/></g><g transform="translate(78 0)"><ellipse cx="17.6" cy="24.4" rx="2.4" ry="2.9" fill="none" stroke="%232c2a1e" stroke-width="1.6" opacity="0.8"/><path d="M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1" fill="none" stroke="%232c2a1e" stroke-width="2.45" stroke-linecap="round"/></g></svg>', qt = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Fe = "pluno-pa-scribble-font", rt = 190, it = 41, Kt = 48, Yt = 420, Xt = 680, N = 8, Be = 50, Zt = "http://www.w3.org/2000/svg", Jt = 11, Qt = 13, en = 4, tn = 10, nn = 40, on = "movable-launcher-position-v2";
277
+ function an(t) {
269
278
  return (e) => new R(e, t);
270
279
  }
271
- async function tn(t = {}) {
280
+ async function rn(t = {}) {
272
281
  const e = {
273
- launcherLabel: t.launcherLabel ?? I.launcherLabel,
274
- accentColor: t.accentColor ?? I.accentColor,
275
- colorScheme: t.colorScheme ?? I.colorScheme,
276
- fontFamily: t.fontFamily ?? I.fontFamily,
277
- scribbleStyle: t.scribbleStyle ?? I.scribbleStyle,
278
- position: t.position ?? I.position,
279
- movableLauncher: t.movableLauncher ?? I.movableLauncher,
282
+ launcherLabel: t.launcherLabel ?? M.launcherLabel,
283
+ accentColor: t.accentColor ?? M.accentColor,
284
+ colorScheme: t.colorScheme ?? M.colorScheme,
285
+ fontFamily: t.fontFamily ?? M.fontFamily,
286
+ scribbleStyle: t.scribbleStyle ?? M.scribbleStyle,
287
+ position: t.position ?? M.position,
288
+ movableLauncher: t.movableLauncher ?? M.movableLauncher,
280
289
  token: t.token,
281
290
  tokenProvider: t.tokenProvider,
282
291
  tokenEndpoint: t.tokenEndpoint,
@@ -287,9 +296,12 @@ async function tn(t = {}) {
287
296
  loginRequired: t.loginRequired === !0,
288
297
  loginButtonLabel: t.loginButtonLabel ?? "Log in to Pluno",
289
298
  onLoginClick: t.onLoginClick,
290
- socialPostDraftHandler: t.socialPostDraftHandler
299
+ socialPostDraftHandler: t.socialPostDraftHandler,
300
+ socialPostRewardsUrl: t.socialPostRewardsUrl,
301
+ loadSharePromptsDisabled: t.loadSharePromptsDisabled,
302
+ persistSharePromptsDisabled: t.persistSharePromptsDisabled
291
303
  };
292
- F("web-sdk.widget", "Mounting widget with merged options", {
304
+ z("web-sdk.widget", "Mounting widget with merged options", {
293
305
  accentColor: e.accentColor,
294
306
  colorScheme: e.colorScheme,
295
307
  fontFamily: e.fontFamily,
@@ -304,84 +316,85 @@ async function tn(t = {}) {
304
316
  n.className = "pluno-pa-widget-host";
305
317
  const o = n.attachShadow({ mode: "open" }), a = document.createElement("div");
306
318
  a.className = `pluno-pa-widget pluno-pa-widget--${e.position}`;
307
- let i = Fe(e.accentColor, e.scribbleStyle);
308
- dn(a, e.launcherLabel, i, e.movableLauncher), o.appendChild(a);
309
- const l = await Un(), p = l.ownerDocument;
310
- l.appendChild(n), a.classList.add(`pluno-pa-widget--${e.colorScheme}`), Xe(o, e.accentColor), ze(a, i, {
319
+ let r = ze(e.accentColor, e.scribbleStyle);
320
+ hn(a, e.launcherLabel, r, e.movableLauncher), o.appendChild(a);
321
+ const l = await Xn(), p = l.ownerDocument;
322
+ l.appendChild(n), a.classList.add(`pluno-pa-widget--${e.colorScheme}`), Xe(o, e.accentColor), Ge(a, r, {
311
323
  accentColor: e.accentColor,
312
324
  colorScheme: e.colorScheme,
313
325
  fontFamily: e.fontFamily,
314
326
  scribbleStyle: e.scribbleStyle
315
- }), F("web-sdk.widget", "Applied initial widget appearance", {
327
+ }), z("web-sdk.widget", "Applied initial widget appearance", {
316
328
  accentColor: e.accentColor,
317
329
  colorScheme: e.colorScheme,
318
330
  fontFamily: e.fontFamily,
319
331
  cssAccent: a.style.getPropertyValue("--pluno-pa-accent")
320
332
  });
321
- const s = a.querySelector(".pluno-pa-widget__launcher"), d = a.querySelector(".pluno-pa-widget__launcher-drag-handle"), u = a.querySelector(".pluno-pa-widget__launcher-input"), _ = a.querySelector(".pluno-pa-widget__panel"), w = a.querySelector(".pluno-pa-widget__close"), y = a.querySelector(".pluno-pa-widget__composer"), k = a.querySelector(".pluno-pa-widget__attachment-error"), m = a.querySelector(".pluno-pa-widget__attachments"), h = a.querySelector(".pluno-pa-widget__input"), x = a.querySelector(".pluno-pa-widget__send"), g = a.querySelector(".pluno-pa-widget__new-chat"), f = a.querySelector(".pluno-pa-widget__timeline");
322
- if (!s || !u || !_ || !w || !y || !k || !m || !h || !x || !g || !f)
333
+ const s = a.querySelector(".pluno-pa-widget__launcher"), g = a.querySelector(".pluno-pa-widget__launcher-drag-handle"), c = a.querySelector(".pluno-pa-widget__launcher-input"), b = a.querySelector(".pluno-pa-widget__panel"), _ = a.querySelector(".pluno-pa-widget__close"), x = a.querySelector(".pluno-pa-widget__composer"), y = a.querySelector(".pluno-pa-widget__attachment-error"), h = a.querySelector(".pluno-pa-widget__attachments"), d = a.querySelector(".pluno-pa-widget__input"), w = a.querySelector(".pluno-pa-widget__send"), m = a.querySelector(".pluno-pa-widget__new-chat"), f = a.querySelector(".pluno-pa-widget__timeline");
334
+ if (!s || !c || !b || !_ || !x || !y || !h || !d || !w || !m || !f)
323
335
  throw new Error("Failed to mount Pluno widget");
324
- if (e.movableLauncher && !d)
336
+ if (e.movableLauncher && !g)
325
337
  throw new Error("Failed to mount Pluno widget drag handle");
326
- We(u), We(h);
327
- let b = [], E = null;
328
- const C = () => {
329
- yn(m, b, (r) => {
330
- b = b.filter((c, L) => L !== r), C(), D();
338
+ Ve(c), Ve(d);
339
+ let v = [], k = null;
340
+ const E = () => {
341
+ kn(h, v, (i) => {
342
+ v = v.filter((u, L) => L !== i), E(), I();
331
343
  });
332
- }, H = e.loginRequired || e.token || e.webSocketFactory ? void 0 : e.tokenProvider ?? (async () => {
344
+ }, q = e.loginRequired || e.token || e.webSocketFactory ? void 0 : e.tokenProvider ?? (async () => {
333
345
  if (!e.tokenEndpoint)
334
346
  throw new Error("Pluno widget requires token or tokenEndpoint");
335
- const r = await fetch(e.tokenEndpoint, {
347
+ const i = await fetch(e.tokenEndpoint, {
336
348
  method: "POST",
337
349
  credentials: "include",
338
350
  headers: { "content-type": "application/json" },
339
351
  body: JSON.stringify({ origin: location.origin, url: location.href })
340
352
  });
341
- if (!r.ok)
353
+ if (!i.ok)
342
354
  throw new Error("Failed to load Pluno token");
343
- const c = await r.json();
344
- if (!c.token)
355
+ const u = await i.json();
356
+ if (!u.token)
345
357
  throw new Error("Pluno token endpoint did not return a token");
346
- return c.token;
358
+ return u.token;
347
359
  });
348
- let v;
349
- v = await yt.init({
360
+ let C;
361
+ C = await Ct.init({
350
362
  token: e.token,
351
- tokenProvider: H,
363
+ tokenProvider: q,
352
364
  backendUrl: e.backendUrl,
353
365
  metadata: () => ({
354
366
  ...e.metadata ?? {},
355
- ...!v.getState().sessionId && e.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
367
+ ...!C.getState().sessionId && e.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
356
368
  }),
357
369
  initialStarterPrompts: e.initialStarterPrompts,
358
370
  webSocketFactory: e.webSocketFactory,
359
371
  autoConnect: e.loginRequired ? !1 : void 0
360
372
  });
361
- const z = Wn(e), re = new Set(z.openToolGroupKeys), V = new Set(z.seenShareCandidateIds), le = new Set(V);
362
- let T = e.movableLauncher ? z.launcherPosition : null, ye = T !== null, M = null, ve = !1;
363
- const gt = () => {
364
- ve || typeof document > "u" || (Xe(o, e.accentColor), n.isConnected || p.body?.appendChild(n));
365
- }, Ce = new MutationObserver(gt);
366
- Ce.observe(p.documentElement, { childList: !0, subtree: !0 });
367
- const pe = (r = !0) => {
368
- const c = Be(a, r);
369
- return Ge(
373
+ const F = Zn(e), pe = new Set(F.openToolGroupKeys), G = new Set(F.seenShareCandidateIds), Q = new Set(G);
374
+ let se = F.sharePromptsDisabled || await Jn(e), T = e.movableLauncher ? F.launcherPosition : null, Ce = T !== null, O = null, Ee = !1;
375
+ const mt = () => {
376
+ Ee || typeof document > "u" || (Xe(o, e.accentColor), n.isConnected || p.body?.appendChild(n));
377
+ }, ke = new MutationObserver(mt);
378
+ ke.observe(p.documentElement, { childList: !0, subtree: !0 });
379
+ const de = (i = !0) => {
380
+ const u = $e(a, i);
381
+ return Ue(
370
382
  a,
371
- T ?? rn(a, e.position, c),
372
- c
383
+ T ?? dn(a, e.position, u),
384
+ u
373
385
  );
374
- }, P = () => {
375
- Hn(e, {
386
+ }, A = () => {
387
+ eo(e, {
376
388
  isOpen: a.classList.contains("pluno-pa-widget--open"),
377
- composerValue: h.value,
378
- openToolGroupKeys: [...re],
379
- launcherPosition: ye ? T : null,
380
- seenShareCandidateIds: [...V].slice(-nt)
389
+ composerValue: d.value,
390
+ openToolGroupKeys: [...pe],
391
+ launcherPosition: Ce ? T : null,
392
+ seenShareCandidateIds: [...G].slice(-ot),
393
+ sharePromptsDisabled: se
381
394
  });
382
- }, O = (r, c = {}) => {
383
- sn(r, {
384
- debugVersion: Qt,
395
+ }, B = (i, u = {}) => {
396
+ gn(i, {
397
+ debugVersion: on,
385
398
  launcherPosition: T,
386
399
  rootClasses: a.className,
387
400
  rootStyle: {
@@ -390,258 +403,262 @@ async function tn(t = {}) {
390
403
  right: a.style.right,
391
404
  bottom: a.style.bottom
392
405
  },
393
- rootRect: ge(a),
394
- launcherRect: ge(s),
395
- panelRect: ge(_),
396
- viewport: U(),
397
- panelHidden: _.hidden,
398
- closeHidden: w.hidden,
399
- ...c
406
+ rootRect: me(a),
407
+ launcherRect: me(s),
408
+ panelRect: me(b),
409
+ viewport: V(),
410
+ panelHidden: b.hidden,
411
+ closeHidden: _.hidden,
412
+ ...u
400
413
  });
401
- }, Z = (r = !0) => {
414
+ }, ee = (i = !0) => {
402
415
  if (!T)
403
- return ee(a, null), pe(r);
404
- const c = pe(r);
405
- return ee(a, c), O("Applied stored closed launcher position", { visibleLauncherPosition: c }), c;
406
- }, Ee = (r, c) => {
407
- if (!r || !c) {
408
- Ue(a);
416
+ return ne(a, null), de(i);
417
+ const u = de(i);
418
+ return ne(a, u), B("Applied stored closed launcher position", { visibleLauncherPosition: u }), u;
419
+ }, Se = (i, u) => {
420
+ if (!i || !u) {
421
+ He(a);
409
422
  return;
410
423
  }
411
- pn(a, {
412
- x: r.x - c.x,
413
- y: r.y - c.y
424
+ un(a, {
425
+ x: i.x - u.x,
426
+ y: i.y - u.y
414
427
  });
415
- }, ke = () => {
416
- const r = Z();
428
+ }, Le = () => {
429
+ const i = ee();
417
430
  if (a.classList.contains("pluno-pa-widget--open") || a.classList.contains("pluno-pa-widget--closing")) {
418
- const c = $e(r);
419
- Ee(c, r), O("Applied open panel position after viewport resize", { openPanelPosition: c });
420
- } else T && O("Applied visible launcher position after viewport resize", { visibleLauncherPosition: r });
431
+ const u = We(i);
432
+ Se(u, i), B("Applied open panel position after viewport resize", { openPanelPosition: u });
433
+ } else T && B("Applied visible launcher position after viewport resize", { visibleLauncherPosition: i });
421
434
  };
422
- let Se = () => {
435
+ let Pe = () => {
423
436
  };
424
- e.movableLauncher && d ? (Z(), window.addEventListener("resize", ke), Se = on({
437
+ e.movableLauncher && g ? (ee(), window.addEventListener("resize", Le), Pe = pn({
425
438
  root: a,
426
- launcherDragHandle: d,
427
- getPosition: () => pe(),
428
- setPosition: (r) => {
429
- const c = r;
430
- T = Ge(a, r, Be(a)), ee(a, T), O("Dragging closed launcher", { requestedPosition: c });
439
+ launcherDragHandle: g,
440
+ getPosition: () => de(),
441
+ setPosition: (i) => {
442
+ const u = i;
443
+ T = Ue(a, i, $e(a)), ne(a, T), B("Dragging closed launcher", { requestedPosition: u });
431
444
  },
432
445
  persist: () => {
433
- ye = !0, P(), O("Persisted closed launcher drag position");
446
+ Ce = !0, A(), B("Persisted closed launcher drag position");
434
447
  }
435
- })) : ee(a, null);
436
- const B = (r = "", c = !0) => {
437
- if (M !== null && (window.clearTimeout(M), M = null), _.hidden = !1, w.hidden = !1, a.classList.remove("pluno-pa-widget--closing"), e.movableLauncher) {
438
- const L = Z(), K = $e(L);
439
- Ee(K, L), O("Opening launcher at clamped open panel position", { openPanelPosition: K, visibleLauncherPosition: L });
448
+ })) : ne(a, null);
449
+ const $ = (i = "", u = !0) => {
450
+ if (O !== null && (window.clearTimeout(O), O = null), b.hidden = !1, _.hidden = !1, a.classList.remove("pluno-pa-widget--closing"), e.movableLauncher) {
451
+ const L = ee(), X = We(L);
452
+ Se(X, L), B("Opening launcher at clamped open panel position", { openPanelPosition: X, visibleLauncherPosition: L });
440
453
  } else
441
- Ue(a);
442
- if (!c) {
443
- a.classList.add("pluno-pa-widget--open"), s.hidden = !0, r && (h.value = r, Y(h)), f.scrollTop = f.scrollHeight, h.focus(), h.setSelectionRange(h.value.length, h.value.length), P();
454
+ He(a);
455
+ if (!u) {
456
+ a.classList.add("pluno-pa-widget--open"), s.hidden = !0, i && (d.value = i, Z(d)), f.scrollTop = f.scrollHeight, d.focus(), d.setSelectionRange(d.value.length, d.value.length), A();
444
457
  return;
445
458
  }
446
459
  window.requestAnimationFrame(() => {
447
- a.classList.add("pluno-pa-widget--open"), r && (h.value = r, Y(h)), f.scrollTop = f.scrollHeight, h.focus(), h.setSelectionRange(h.value.length, h.value.length), P(), M = window.setTimeout(() => {
460
+ a.classList.add("pluno-pa-widget--open"), i && (d.value = i, Z(d)), f.scrollTop = f.scrollHeight, d.focus(), d.setSelectionRange(d.value.length, d.value.length), A(), O = window.setTimeout(() => {
448
461
  s.hidden = !0, f.scrollTop = f.scrollHeight;
449
462
  }, 220);
450
463
  });
451
- }, ht = () => {
452
- M !== null && (window.clearTimeout(M), M = null), s.hidden = !1, T && (Z(!1), O("Closing launcher at stored position")), a.classList.remove("pluno-pa-widget--open"), a.classList.add("pluno-pa-widget--closing"), P(), M = window.setTimeout(() => {
453
- _.hidden = !0, w.hidden = !0, a.classList.remove("pluno-pa-widget--closing");
464
+ }, ft = () => {
465
+ O !== null && (window.clearTimeout(O), O = null), s.hidden = !1, T && (ee(!1), B("Closing launcher at stored position")), a.classList.remove("pluno-pa-widget--open"), a.classList.add("pluno-pa-widget--closing"), A(), O = window.setTimeout(() => {
466
+ b.hidden = !0, _.hidden = !0, a.classList.remove("pluno-pa-widget--closing");
454
467
  }, 220);
455
468
  };
456
- s.addEventListener("submit", (r) => {
457
- r.preventDefault(), B(u.value), u.value = "";
458
- }), d?.addEventListener("click", (r) => {
459
- r.preventDefault(), r.stopPropagation();
460
- }), s.addEventListener("click", (r) => {
461
- r.target !== u && (B(u.value), u.value = "");
462
- }), u.addEventListener("focus", () => {
463
- B(u.value), u.value = "";
464
- }), u.addEventListener("input", () => {
465
- if (!u.value)
469
+ s.addEventListener("submit", (i) => {
470
+ i.preventDefault(), $(c.value), c.value = "";
471
+ }), g?.addEventListener("click", (i) => {
472
+ i.preventDefault(), i.stopPropagation();
473
+ }), s.addEventListener("click", (i) => {
474
+ i.target !== c && ($(c.value), c.value = "");
475
+ }), c.addEventListener("focus", () => {
476
+ $(c.value), c.value = "";
477
+ }), c.addEventListener("input", () => {
478
+ if (!c.value)
466
479
  return;
467
- const r = u.value;
468
- B(r), u.value = "";
469
- }), w.addEventListener("click", ht);
470
- const D = () => {
471
- x.disabled = !v.getState().isThinking && h.value.trim().length === 0 && b.length === 0;
480
+ const i = c.value;
481
+ $(i), c.value = "";
482
+ }), _.addEventListener("click", ft);
483
+ const I = () => {
484
+ w.disabled = !C.getState().isThinking && d.value.trim().length === 0 && v.length === 0;
472
485
  };
473
- e.loginRequired && (u.readOnly = !0, u.placeholder = e.loginButtonLabel, h.placeholder = e.loginButtonLabel, y.hidden = !0), y.addEventListener("submit", (r) => {
474
- if (r.preventDefault(), e.loginRequired) {
486
+ e.loginRequired && (c.readOnly = !0, c.placeholder = e.loginButtonLabel, d.placeholder = e.loginButtonLabel, x.hidden = !0), x.addEventListener("submit", (i) => {
487
+ if (i.preventDefault(), e.loginRequired) {
475
488
  e.onLoginClick?.();
476
489
  return;
477
490
  }
478
- b = he(v, h, b), C(), D();
491
+ v = fe(C, d, v), E(), I();
479
492
  });
480
- let q = 0;
481
- const mt = () => {
482
- q = 0, a.classList.remove("pluno-pa-widget--drag-over");
483
- }, ft = (r) => {
484
- E !== null && window.clearTimeout(E), k.textContent = r, k.hidden = !1, E = window.setTimeout(() => {
485
- k.textContent = "", k.hidden = !0, E = null;
493
+ let K = 0;
494
+ const wt = () => {
495
+ K = 0, a.classList.remove("pluno-pa-widget--drag-over");
496
+ }, bt = (i) => {
497
+ k !== null && window.clearTimeout(k), y.textContent = i, y.hidden = !1, k = window.setTimeout(() => {
498
+ y.textContent = "", y.hidden = !0, k = null;
486
499
  }, 3e3);
487
- }, wt = () => {
488
- E !== null && (window.clearTimeout(E), E = null), k.textContent = "", k.hidden = !0;
489
- }, bt = async (r) => {
490
- if (r.length === 0)
500
+ }, _t = () => {
501
+ k !== null && (window.clearTimeout(k), k = null), y.textContent = "", y.hidden = !0;
502
+ }, xt = async (i) => {
503
+ if (i.length === 0)
491
504
  return;
492
- const c = await kn(r);
493
- if (b.length + c.length > ae)
494
- throw new Error(`Attach up to ${ae} files per message.`);
495
- b = [...b, ...c], C(), wt(), D();
505
+ const u = await An(i);
506
+ if (v.length + u.length > ie)
507
+ throw new Error(`Attach up to ${ie} files per message.`);
508
+ v = [...v, ...u], E(), _t(), I();
496
509
  };
497
- a.addEventListener("dragenter", (r) => {
498
- !te(r.dataTransfer) || e.loginRequired || (r.preventDefault(), r.stopPropagation(), q += 1, a.classList.add("pluno-pa-widget--drag-over"));
499
- }), a.addEventListener("dragover", (r) => {
500
- const c = r.dataTransfer;
501
- !te(c) || e.loginRequired || (r.preventDefault(), r.stopPropagation(), c.dropEffect = "copy");
502
- }), a.addEventListener("dragleave", (r) => {
503
- te(r.dataTransfer) && (r.stopPropagation(), q = Math.max(0, q - 1), q === 0 && a.classList.remove("pluno-pa-widget--drag-over"));
504
- }), a.addEventListener("drop", (r) => {
505
- const c = r.dataTransfer;
506
- !te(c) || e.loginRequired || (r.preventDefault(), r.stopPropagation(), mt(), bt(c.files).catch((L) => {
507
- ft(L instanceof Error ? L.message : "Failed to attach file"), F("web-sdk.widget", "Attachment failed", {
510
+ a.addEventListener("dragenter", (i) => {
511
+ !oe(i.dataTransfer) || e.loginRequired || (i.preventDefault(), i.stopPropagation(), K += 1, a.classList.add("pluno-pa-widget--drag-over"));
512
+ }), a.addEventListener("dragover", (i) => {
513
+ const u = i.dataTransfer;
514
+ !oe(u) || e.loginRequired || (i.preventDefault(), i.stopPropagation(), u.dropEffect = "copy");
515
+ }), a.addEventListener("dragleave", (i) => {
516
+ oe(i.dataTransfer) && (i.stopPropagation(), K = Math.max(0, K - 1), K === 0 && a.classList.remove("pluno-pa-widget--drag-over"));
517
+ }), a.addEventListener("drop", (i) => {
518
+ const u = i.dataTransfer;
519
+ !oe(u) || e.loginRequired || (i.preventDefault(), i.stopPropagation(), wt(), xt(u.files).catch((L) => {
520
+ bt(L instanceof Error ? L.message : "Failed to attach file"), z("web-sdk.widget", "Attachment failed", {
508
521
  message: L instanceof Error ? L.message : String(L)
509
522
  });
510
523
  }));
511
- }), x.addEventListener("click", () => {
524
+ }), w.addEventListener("click", () => {
512
525
  if (e.loginRequired) {
513
526
  e.onLoginClick?.();
514
527
  return;
515
528
  }
516
- if (v.getState().isThinking) {
517
- v.stop();
529
+ if (C.getState().isThinking) {
530
+ C.stop();
518
531
  return;
519
532
  }
520
- b = he(v, h, b), C(), D();
521
- }), g.addEventListener("click", () => {
522
- v.startNewSession(), re.clear(), h.value = "", b = [], C(), Y(h), P(), D(), h.focus();
523
- }), h.addEventListener("input", () => {
524
- Y(h), P(), D();
525
- }), h.addEventListener("keydown", (r) => {
526
- if (!(r.key !== "Enter" || r.shiftKey)) {
527
- if (r.preventDefault(), e.loginRequired) {
533
+ v = fe(C, d, v), E(), I();
534
+ }), m.addEventListener("click", () => {
535
+ C.startNewSession(), pe.clear(), d.value = "", v = [], E(), Z(d), A(), I(), d.focus();
536
+ }), d.addEventListener("input", () => {
537
+ Z(d), A(), I();
538
+ }), d.addEventListener("keydown", (i) => {
539
+ if (!(i.key !== "Enter" || i.shiftKey)) {
540
+ if (i.preventDefault(), e.loginRequired) {
528
541
  e.onLoginClick?.();
529
542
  return;
530
543
  }
531
- b = he(v, h, b), C(), D();
532
- }
533
- }), a.addEventListener("click", (r) => {
534
- (r.target instanceof Element ? r.target : null)?.closest("a[href]") && P();
535
- }), z.composerValue && (h.value = z.composerValue, Y(h)), z.isOpen && B(h.value, !1);
536
- const Le = () => i;
537
- let se = v.getState().appearance !== null, J = null, Q = null, G = null;
538
- const _t = !!e.socialPostDraftHandler, j = (r) => {
544
+ v = fe(C, d, v), E(), I();
545
+ }
546
+ }), a.addEventListener("click", (i) => {
547
+ (i.target instanceof Element ? i.target : null)?.closest("a[href]") && A();
548
+ }), F.composerValue && (d.value = F.composerValue, Z(d)), F.isOpen && $(d.value, !1);
549
+ const Ae = () => r;
550
+ let ce = C.getState().appearance !== null, te = null, Y = null, U = null;
551
+ const vt = !!e.socialPostDraftHandler, W = (i) => {
539
552
  if (e.loginRequired) {
540
- In(f, x, g, Le, e.loginButtonLabel, e.onLoginClick);
553
+ Fn(f, w, m, Ae, e.loginButtonLabel, e.onLoginClick);
541
554
  return;
542
555
  }
543
- Dn(
556
+ On(
544
557
  f,
545
- x,
546
- g,
547
- r,
548
- re,
549
- P,
550
- Le,
551
- (c) => {
552
- v.sendMessage(c);
558
+ w,
559
+ m,
560
+ i,
561
+ pe,
562
+ A,
563
+ Ae,
564
+ (u) => {
565
+ C.sendMessage(u);
553
566
  },
554
- _t ? {
555
- dismissedCandidateIds: le,
556
- draftingCandidateId: J,
557
- error: Q,
558
- onSeen: (c) => {
559
- V.add(c.id), P();
567
+ vt && !se ? {
568
+ dismissedCandidateIds: Q,
569
+ draftingCandidateId: te,
570
+ error: Y,
571
+ onSeen: (u) => {
572
+ G.add(u.id), A();
573
+ },
574
+ onDraft: (u) => {
575
+ yt(u);
560
576
  },
561
- onDraft: (c) => {
562
- xt(c);
577
+ onDismiss: (u) => {
578
+ G.add(u.id), Q.add(u.id), A(), Y = null, W(C.getState());
563
579
  },
564
- onDismiss: (c) => {
565
- V.add(c.id), le.add(c.id), P(), Q = null, j(v.getState());
580
+ onDisable: (u) => {
581
+ se = !0, G.add(u.id), Q.add(u.id), A(), Qn(e, !0), Y = null, W(C.getState());
566
582
  }
567
583
  } : void 0
568
584
  );
569
585
  };
570
- return v.on("state", (r) => {
571
- r.appearance ? (se = !0, F("web-sdk.widget", "Agent state supplied appearance", {
572
- appearance: r.appearance
573
- }), de(r.appearance, "agent.state.appearance")) : se && (se = !1, F("web-sdk.widget", "Agent state cleared appearance; reverting to configured widget options", {
586
+ return C.on("state", (i) => {
587
+ i.appearance ? (ce = !0, z("web-sdk.widget", "Agent state supplied appearance", {
588
+ appearance: i.appearance
589
+ }), ue(i.appearance, "agent.state.appearance")) : ce && (ce = !1, z("web-sdk.widget", "Agent state cleared appearance; reverting to configured widget options", {
574
590
  fallbackAccentColor: e.accentColor,
575
591
  fallbackColorScheme: e.colorScheme,
576
592
  fallbackFontFamily: e.fontFamily
577
- }), de({}, "agent.state.appearance-cleared")), j(r), D();
578
- }), j(v.getState()), D(), {
579
- agent: v,
580
- updateAppearance: (r) => {
581
- r.scribbleStyle !== void 0 && (e.scribbleStyle = r.scribbleStyle), de(r, "widgetHandle.updateAppearance");
593
+ }), ue({}, "agent.state.appearance-cleared")), W(i), I();
594
+ }), W(C.getState()), I(), {
595
+ agent: C,
596
+ updateAppearance: (i) => {
597
+ i.scribbleStyle !== void 0 && (e.scribbleStyle = i.scribbleStyle), ue(i, "widgetHandle.updateAppearance");
582
598
  },
583
599
  openPanel: () => {
584
- B(h.value, !1);
600
+ $(d.value, !1);
585
601
  },
586
602
  destroy: () => {
587
- ve = !0, Ce.disconnect(), e.movableLauncher && window.removeEventListener("resize", ke), Se(), E !== null && window.clearTimeout(E), G?.remove(), v.destroy(), n.remove();
603
+ Ee = !0, ke.disconnect(), e.movableLauncher && window.removeEventListener("resize", Le), Pe(), k !== null && window.clearTimeout(k), U?.remove(), C.destroy(), n.remove();
588
604
  }
589
605
  };
590
- async function xt(r) {
591
- if (!J) {
592
- J = r.id, Q = null, j(v.getState());
606
+ async function yt(i) {
607
+ if (!te) {
608
+ te = i.id, Y = null, W(C.getState());
593
609
  try {
594
610
  if (!e.socialPostDraftHandler)
595
611
  throw new Error("Social post drafting is not available here.");
596
- const c = await e.socialPostDraftHandler(r);
597
- if (!c.linkedinPost || !c.xPost)
612
+ const u = await e.socialPostDraftHandler(i);
613
+ if (!u.linkedinPost || !u.xPost)
598
614
  throw new Error("Pluno did not return a complete social post draft.");
599
- V.add(r.id), le.add(r.id), P(), G?.remove(), G = On(c, {
615
+ G.add(i.id), Q.add(i.id), A(), U?.remove(), U = Gn(u, {
616
+ socialPostRewardsUrl: e.socialPostRewardsUrl,
600
617
  onClose: () => {
601
- G?.remove(), G = null;
618
+ U?.remove(), U = null;
602
619
  }
603
- }), a.appendChild(G);
604
- } catch (c) {
605
- Q = c instanceof Error ? c.message : "Could not draft social post.";
620
+ }), a.appendChild(U);
621
+ } catch (u) {
622
+ Y = u instanceof Error ? u.message : "Could not draft social post.";
606
623
  } finally {
607
- J = null, j(v.getState());
624
+ te = null, W(C.getState());
608
625
  }
609
626
  }
610
627
  }
611
- function de(r, c) {
612
- const L = r.accentColor ?? e.accentColor, K = r.colorScheme ?? e.colorScheme, Pe = r.fontFamily ?? e.fontFamily, ce = r.scribbleStyle ?? e.scribbleStyle;
613
- i = Fe(L, ce), ze(a, i, {
628
+ function ue(i, u) {
629
+ const L = i.accentColor ?? e.accentColor, X = i.colorScheme ?? e.colorScheme, Ne = i.fontFamily ?? e.fontFamily, ge = i.scribbleStyle ?? e.scribbleStyle;
630
+ r = ze(L, ge), Ge(a, r, {
614
631
  accentColor: L,
615
- colorScheme: K,
616
- fontFamily: Pe,
617
- scribbleStyle: ce
618
- }), F("web-sdk.widget", "Updated widget appearance", {
619
- source: c,
620
- inputAppearance: r,
632
+ colorScheme: X,
633
+ fontFamily: Ne,
634
+ scribbleStyle: ge
635
+ }), z("web-sdk.widget", "Updated widget appearance", {
636
+ source: u,
637
+ inputAppearance: i,
621
638
  appliedAccentColor: L,
622
- appliedColorScheme: K,
623
- appliedFontFamily: Pe,
624
- appliedScribbleStyle: ce,
639
+ appliedColorScheme: X,
640
+ appliedFontFamily: Ne,
641
+ appliedScribbleStyle: ge,
625
642
  cssAccent: a.style.getPropertyValue("--pluno-pa-accent")
626
643
  });
627
644
  }
628
645
  }
629
- function Fe(t, e) {
630
- return e ? St(t) : Et(t);
646
+ function ze(t, e) {
647
+ return e ? Pt(t) : St(t);
631
648
  }
632
- function ze(t, e, n) {
649
+ function Ge(t, e, n) {
633
650
  t.classList.toggle("pluno-pa-widget--dark", n.colorScheme === "dark"), t.classList.toggle("pluno-pa-widget--light", n.colorScheme !== "dark"), t.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
634
- const o = n.scribbleStyle ? Qe(n.accentColor) : n.accentColor;
635
- t.style.setProperty("--pluno-pa-accent", o), t.style.fontFamily = n.scribbleStyle ? Wt : n.fontFamily, n.scribbleStyle && nn(t.ownerDocument);
651
+ const o = n.scribbleStyle ? et(n.accentColor) : n.accentColor;
652
+ t.style.setProperty("--pluno-pa-accent", o), t.style.fontFamily = n.scribbleStyle ? qt : n.fontFamily, n.scribbleStyle && ln(t.ownerDocument);
636
653
  const a = Array.from(t.querySelectorAll(".pluno-pa-widget__character"));
637
- for (const i of a)
638
- i.src = e;
654
+ for (const r of a)
655
+ r.src = e;
639
656
  }
640
- function nn(t) {
641
- if (t.getElementById(Me))
657
+ function ln(t) {
658
+ if (t.getElementById(Fe))
642
659
  return;
643
660
  const e = t.createElement("style");
644
- e.id = Me, e.textContent = `@font-face {
661
+ e.id = Fe, e.textContent = `@font-face {
645
662
  font-family: "Architects Daughter";
646
663
  font-style: normal;
647
664
  font-weight: 400;
@@ -649,107 +666,107 @@ function nn(t) {
649
666
  src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
650
667
  }`, t.head.appendChild(e), t.fonts?.load('16px "Architects Daughter"');
651
668
  }
652
- function on({
669
+ function pn({
653
670
  root: t,
654
671
  launcherDragHandle: e,
655
672
  getPosition: n,
656
673
  setPosition: o,
657
674
  persist: a
658
675
  }) {
659
- let i = null, l = null, p = null, s = !1;
660
- const d = () => {
661
- i = null, l = null, p = null, s = !1, t.classList.remove("pluno-pa-widget--dragging");
662
- }, u = (m) => {
663
- t.classList.contains("pluno-pa-widget--open") || t.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), i = m.pointerId, l = { x: m.clientX, y: m.clientY }, p = n(), s = !1, e.setPointerCapture?.(m.pointerId));
664
- }, _ = (m) => {
665
- if (i !== m.pointerId || !l || !p)
676
+ let r = null, l = null, p = null, s = !1;
677
+ const g = () => {
678
+ r = null, l = null, p = null, s = !1, t.classList.remove("pluno-pa-widget--dragging");
679
+ }, c = (h) => {
680
+ t.classList.contains("pluno-pa-widget--open") || t.classList.contains("pluno-pa-widget--closing") || (h.preventDefault(), h.stopPropagation(), r = h.pointerId, l = { x: h.clientX, y: h.clientY }, p = n(), s = !1, e.setPointerCapture?.(h.pointerId));
681
+ }, b = (h) => {
682
+ if (r !== h.pointerId || !l || !p)
666
683
  return;
667
- m.preventDefault();
668
- const h = m.clientX - l.x, x = m.clientY - l.y;
669
- !s && Math.hypot(h, x) < Xt || (s = !0, t.classList.add("pluno-pa-widget--dragging"), o({ x: p.x + h, y: p.y + x }));
670
- }, w = (m) => {
671
- i === m.pointerId && (m.preventDefault(), m.stopPropagation(), s && a(), d());
672
- }, y = (m) => {
673
- i === m.pointerId && (m.preventDefault(), d());
674
- }, k = (m) => {
684
+ h.preventDefault();
685
+ const d = h.clientX - l.x, w = h.clientY - l.y;
686
+ !s && Math.hypot(d, w) < en || (s = !0, t.classList.add("pluno-pa-widget--dragging"), o({ x: p.x + d, y: p.y + w }));
687
+ }, _ = (h) => {
688
+ r === h.pointerId && (h.preventDefault(), h.stopPropagation(), s && a(), g());
689
+ }, x = (h) => {
690
+ r === h.pointerId && (h.preventDefault(), g());
691
+ }, y = (h) => {
675
692
  if (t.classList.contains("pluno-pa-widget--open") || t.classList.contains("pluno-pa-widget--closing"))
676
693
  return;
677
- const h = m.shiftKey ? Jt : Zt, x = n();
678
- let g = null;
679
- m.key === "ArrowUp" ? g = { x: x.x, y: x.y - h } : m.key === "ArrowDown" ? g = { x: x.x, y: x.y + h } : m.key === "ArrowLeft" ? g = { x: x.x - h, y: x.y } : m.key === "ArrowRight" && (g = { x: x.x + h, y: x.y }), g && (m.preventDefault(), m.stopPropagation(), o(g), a());
694
+ const d = h.shiftKey ? nn : tn, w = n();
695
+ let m = null;
696
+ h.key === "ArrowUp" ? m = { x: w.x, y: w.y - d } : h.key === "ArrowDown" ? m = { x: w.x, y: w.y + d } : h.key === "ArrowLeft" ? m = { x: w.x - d, y: w.y } : h.key === "ArrowRight" && (m = { x: w.x + d, y: w.y }), m && (h.preventDefault(), h.stopPropagation(), o(m), a());
680
697
  };
681
- return e.addEventListener("pointerdown", u), e.addEventListener("pointermove", _), e.addEventListener("pointerup", w), e.addEventListener("pointercancel", y), e.addEventListener("keydown", k), () => {
682
- e.removeEventListener("pointerdown", u), e.removeEventListener("pointermove", _), e.removeEventListener("pointerup", w), e.removeEventListener("pointercancel", y), e.removeEventListener("keydown", k);
698
+ return e.addEventListener("pointerdown", c), e.addEventListener("pointermove", b), e.addEventListener("pointerup", _), e.addEventListener("pointercancel", x), e.addEventListener("keydown", y), () => {
699
+ e.removeEventListener("pointerdown", c), e.removeEventListener("pointermove", b), e.removeEventListener("pointerup", _), e.removeEventListener("pointercancel", x), e.removeEventListener("keydown", y);
683
700
  };
684
701
  }
685
- function Be(t, e = !0) {
686
- const n = U(), o = t.getBoundingClientRect(), a = !t.classList.contains("pluno-pa-widget--open") && !t.classList.contains("pluno-pa-widget--closing");
702
+ function $e(t, e = !0) {
703
+ const n = V(), o = t.getBoundingClientRect(), a = !t.classList.contains("pluno-pa-widget--open") && !t.classList.contains("pluno-pa-widget--closing");
687
704
  return {
688
- width: e && a && o.width > 0 ? o.width : Math.min(ot, n.width - 36),
689
- height: e && a && o.height > 0 ? o.height : t.classList.contains("pluno-pa-widget--scribble") ? Ht : at
705
+ width: e && a && o.width > 0 ? o.width : Math.min(rt, n.width - 36),
706
+ height: e && a && o.height > 0 ? o.height : t.classList.contains("pluno-pa-widget--scribble") ? Kt : it
690
707
  };
691
708
  }
692
- function an() {
693
- const t = U();
709
+ function sn() {
710
+ const t = V();
694
711
  return {
695
- width: Math.min(Vt, t.width - 28),
696
- height: Math.min(qt, t.height - 28)
712
+ width: Math.min(Yt, t.width - 28),
713
+ height: Math.min(Xt, t.height - 28)
697
714
  };
698
715
  }
699
- function rn(t, e, n) {
716
+ function dn(t, e, n) {
700
717
  const o = Number.parseFloat(t.style.left), a = Number.parseFloat(t.style.top);
701
718
  if (Number.isFinite(o) && Number.isFinite(a))
702
719
  return { x: o, y: a };
703
- const i = t.getBoundingClientRect();
704
- if (i.width > 0 || i.height > 0)
705
- return { x: i.left, y: i.top };
706
- const l = U();
720
+ const r = t.getBoundingClientRect();
721
+ if (r.width > 0 || r.height > 0)
722
+ return { x: r.left, y: r.top };
723
+ const l = V();
707
724
  return {
708
725
  x: e === "bottom-left" ? 26 : l.width - 26 - n.width,
709
726
  y: l.height - 24 - n.height
710
727
  };
711
728
  }
712
- function Ge(t, e, n) {
713
- const o = U(), a = A + ln(t);
729
+ function Ue(t, e, n) {
730
+ const o = V(), a = N + cn(t);
714
731
  return {
715
- x: ie(e.x, A, Math.max(A, o.width - n.width - A)),
716
- y: ie(e.y, a, Math.max(a, o.height - n.height - A))
732
+ x: le(e.x, N, Math.max(N, o.width - n.width - N)),
733
+ y: le(e.y, a, Math.max(a, o.height - n.height - N))
717
734
  };
718
735
  }
719
- function ln(t) {
720
- return t.classList.contains("pluno-pa-widget--scribble") ? Yt : Kt;
736
+ function cn(t) {
737
+ return t.classList.contains("pluno-pa-widget--scribble") ? Qt : Jt;
721
738
  }
722
- function $e(t) {
723
- const e = U(), n = an();
739
+ function We(t) {
740
+ const e = V(), n = sn();
724
741
  return {
725
- x: ie(t.x, A, Math.max(A, e.width - n.width - A)),
726
- y: ie(
742
+ x: le(t.x, N, Math.max(N, e.width - n.width - N)),
743
+ y: le(
727
744
  t.y,
728
- Oe,
729
- Math.max(Oe, e.height - n.height - A)
745
+ Be,
746
+ Math.max(Be, e.height - n.height - N)
730
747
  )
731
748
  };
732
749
  }
733
- function ee(t, e) {
750
+ function ne(t, e) {
734
751
  if (t.classList.toggle("pluno-pa-widget--custom-position", e !== null), !e) {
735
752
  t.style.removeProperty("left"), t.style.removeProperty("top"), t.style.removeProperty("right"), t.style.removeProperty("bottom");
736
753
  return;
737
754
  }
738
755
  t.style.left = `${e.x}px`, t.style.top = `${e.y}px`, t.style.right = "auto", t.style.bottom = "auto";
739
756
  }
740
- function pn(t, e) {
757
+ function un(t, e) {
741
758
  t.style.setProperty("--pluno-pa-panel-offset-x", `${e.x}px`), t.style.setProperty("--pluno-pa-panel-offset-y", `${e.y}px`);
742
759
  }
743
- function Ue(t) {
760
+ function He(t) {
744
761
  t.style.removeProperty("--pluno-pa-panel-offset-x"), t.style.removeProperty("--pluno-pa-panel-offset-y");
745
762
  }
746
- function U() {
763
+ function V() {
747
764
  return {
748
- width: window.innerWidth || document.documentElement.clientWidth || ot + A * 2,
749
- height: window.innerHeight || document.documentElement.clientHeight || at + A * 2
765
+ width: window.innerWidth || document.documentElement.clientWidth || rt + N * 2,
766
+ height: window.innerHeight || document.documentElement.clientHeight || it + N * 2
750
767
  };
751
768
  }
752
- function ge(t) {
769
+ function me(t) {
753
770
  const e = t.getBoundingClientRect();
754
771
  return {
755
772
  x: Math.round(e.x),
@@ -758,10 +775,10 @@ function ge(t) {
758
775
  height: Math.round(e.height)
759
776
  };
760
777
  }
761
- function ie(t, e, n) {
778
+ function le(t, e, n) {
762
779
  return Math.min(Math.max(t, e), n);
763
780
  }
764
- function F(t, e, n) {
781
+ function z(t, e, n) {
765
782
  if (typeof window > "u")
766
783
  return;
767
784
  const o = window, a = {
@@ -769,43 +786,43 @@ function F(t, e, n) {
769
786
  source: t,
770
787
  message: e,
771
788
  details: n
772
- }, i = o.__plunoProductAgentDiagnostics__ ?? [];
773
- i.push(a), i.length > 120 && i.splice(0, i.length - 120), o.__plunoProductAgentDiagnostics__ = i, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...i], window.dispatchEvent(new CustomEvent(Gt, { detail: a }));
789
+ }, r = o.__plunoProductAgentDiagnostics__ ?? [];
790
+ r.push(a), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(new CustomEvent(Ht, { detail: a }));
774
791
  }
775
- function sn(t, e) {
776
- F("web-sdk.widget.position", t, e);
792
+ function gn(t, e) {
793
+ z("web-sdk.widget.position", t, e);
777
794
  }
778
- function he(t, e, n) {
795
+ function fe(t, e, n) {
779
796
  const o = e.value.trim();
780
797
  return !o && n.length === 0 ? n : (e.value = "", e.style.height = "22px", e.style.overflowY = "hidden", t.sendMessage(o, { attachments: n.length > 0 ? n : void 0 }), e.dispatchEvent(new Event("input", { bubbles: !0 })), []);
781
798
  }
782
- function Y(t) {
799
+ function Z(t) {
783
800
  t.style.height = "0px";
784
801
  const e = Math.max(22, Math.min(t.scrollHeight, 140));
785
802
  t.style.height = `${e}px`, t.style.overflowY = t.scrollHeight > 140 ? "auto" : "hidden";
786
803
  }
787
- function dn(t, e, n, o) {
788
- t.appendChild(mn()), t.appendChild(cn(e, n, o)), t.appendChild(lt("pluno-pa-widget__close", "Close", fn(16), !0)), t.appendChild(un(n));
804
+ function hn(t, e, n, o) {
805
+ t.appendChild(_n()), t.appendChild(mn(e, n, o)), t.appendChild(st("pluno-pa-widget__close", "Close", xn(16), !0)), t.appendChild(fn(n));
789
806
  }
790
- function cn(t, e, n) {
807
+ function mn(t, e, n) {
791
808
  const o = document.createElement("form");
792
809
  if (o.className = "pluno-pa-widget__launcher", n) {
793
- const i = document.createElement("button");
794
- i.type = "button", i.className = "pluno-pa-widget__launcher-drag-handle", i.setAttribute("aria-label", "Move Pluno launcher"), i.title = "Move Pluno launcher", o.appendChild(i);
810
+ const r = document.createElement("button");
811
+ r.type = "button", r.className = "pluno-pa-widget__launcher-drag-handle", r.setAttribute("aria-label", "Move Pluno launcher"), r.title = "Move Pluno launcher", o.appendChild(r);
795
812
  }
796
- o.appendChild(rt("pluno-pa-widget__character--launcher", e));
813
+ o.appendChild(pt("pluno-pa-widget__character--launcher", e));
797
814
  const a = document.createElement("input");
798
815
  return a.className = "pluno-pa-widget__launcher-input", a.type = "text", a.placeholder = t, a.setAttribute("aria-label", t), o.appendChild(a), o;
799
816
  }
800
- function un(t) {
817
+ function fn(t) {
801
818
  const e = document.createElement("section");
802
819
  e.className = "pluno-pa-widget__panel", e.hidden = !0;
803
820
  const n = document.createElement("div");
804
821
  n.className = "pluno-pa-widget__timeline-wrap";
805
822
  const o = document.createElement("main");
806
- return o.className = "pluno-pa-widget__timeline", o.appendChild(hn(t)), n.appendChild(o), n.appendChild(lt("pluno-pa-widget__new-chat", "New chat", wn(), !0)), e.appendChild(n), e.appendChild(gn()), e;
823
+ return o.className = "pluno-pa-widget__timeline", o.appendChild(bn(t)), n.appendChild(o), n.appendChild(st("pluno-pa-widget__new-chat", "New chat", vn(), !0)), e.appendChild(n), e.appendChild(wn()), e;
807
824
  }
808
- function gn() {
825
+ function wn() {
809
826
  const t = document.createElement("form");
810
827
  t.className = "pluno-pa-widget__composer";
811
828
  const e = document.createElement("div");
@@ -816,34 +833,32 @@ function gn() {
816
833
  o.className = "pluno-pa-widget__composer-inner";
817
834
  const a = document.createElement("textarea");
818
835
  a.className = "pluno-pa-widget__input", a.rows = 1, a.placeholder = "Ask for anything...", o.appendChild(a);
819
- const i = document.createElement("button");
820
- i.type = "button", i.className = "pluno-pa-widget__send", i.setAttribute("aria-label", "Send"), i.appendChild(pt()), o.appendChild(i), t.appendChild(o);
836
+ const r = document.createElement("button");
837
+ r.type = "button", r.className = "pluno-pa-widget__send", r.setAttribute("aria-label", "Send"), r.appendChild(dt()), o.appendChild(r), t.appendChild(o);
821
838
  const l = document.createElement("div");
822
839
  l.className = "pluno-pa-widget__composer-meta";
823
840
  const p = document.createElement("a");
824
- p.className = "pluno-pa-widget__powered-by", p.href = "https://pluno.ai", p.target = "_blank", p.rel = "noopener noreferrer", p.textContent = "Powered by Pluno.ai", l.appendChild(p);
841
+ p.className = "pluno-pa-widget__powered-by", p.href = "https://pluno.ai", p.target = "_blank", p.rel = "noopener noreferrer", p.textContent = "Powered by Pluno.ai.", l.appendChild(p);
825
842
  const s = document.createElement("span");
826
- s.className = "pluno-pa-widget__composer-separator", s.textContent = "-", l.appendChild(s);
827
- const d = document.createElement("span");
828
- return d.className = "pluno-pa-widget__ai-disclaimer", d.textContent = "AI can make mistakes. Verify outputs.", l.appendChild(d), t.appendChild(l), t;
843
+ return s.className = "pluno-pa-widget__ai-disclaimer", s.textContent = "AI can make mistakes. Verify outputs.", l.appendChild(s), t.appendChild(l), t;
829
844
  }
830
- function hn(t) {
845
+ function bn(t) {
831
846
  const e = document.createElement("div");
832
- return e.className = "pluno-pa-widget__empty-state", e.appendChild(rt("pluno-pa-widget__character--empty", t)), e.appendChild(it()), e;
847
+ return e.className = "pluno-pa-widget__empty-state", e.appendChild(pt("pluno-pa-widget__character--empty", t)), e.appendChild(lt()), e;
833
848
  }
834
- function it() {
849
+ function lt() {
835
850
  const t = document.createElement("div");
836
851
  return t.className = "pluno-pa-widget__empty", t.appendChild(document.createTextNode("Hey there, I'm Pluno 👋")), t.appendChild(document.createElement("br")), t.appendChild(document.createTextNode("What do you want to do today?")), t;
837
852
  }
838
- function rt(t, e) {
853
+ function pt(t, e) {
839
854
  const n = document.createElement("img");
840
855
  return n.className = `pluno-pa-widget__character ${t}`, n.src = e, n.alt = "", n.setAttribute("aria-hidden", "true"), n;
841
856
  }
842
- function lt(t, e, n, o) {
857
+ function st(t, e, n, o) {
843
858
  const a = document.createElement("button");
844
859
  return a.type = "button", a.className = t, a.setAttribute("aria-label", e), a.title = e, a.hidden = o, a.appendChild(n), a;
845
860
  }
846
- function mn() {
861
+ function _n() {
847
862
  const t = S("svg", {
848
863
  class: "pluno-pa-widget__scribble-defs",
849
864
  "aria-hidden": "true",
@@ -851,9 +866,9 @@ function mn() {
851
866
  width: "0",
852
867
  height: "0"
853
868
  }), e = S("defs");
854
- return e.appendChild(me("pluno-pa-scribble-wobble", "2", "12")), e.appendChild(me("pluno-pa-scribble-wobble-2", "5", "15")), e.appendChild(me("pluno-pa-scribble-wobble-3", "9", "19")), t.appendChild(e), t;
869
+ return e.appendChild(we("pluno-pa-scribble-wobble", "2", "12")), e.appendChild(we("pluno-pa-scribble-wobble-2", "5", "15")), e.appendChild(we("pluno-pa-scribble-wobble-3", "9", "19")), t.appendChild(e), t;
855
870
  }
856
- function me(t, e, n) {
871
+ function we(t, e, n) {
857
872
  const o = S("filter", { id: t, x: "-8%", y: "-8%", width: "116%", height: "116%" });
858
873
  return o.appendChild(
859
874
  S("feTurbulence", {
@@ -890,31 +905,31 @@ function me(t, e, n) {
890
905
  })
891
906
  ), o;
892
907
  }
893
- function fn(t) {
894
- const e = W("0 0 24 24", t, t, "none", "currentColor", "2.25");
908
+ function xn(t) {
909
+ const e = j("0 0 24 24", t, t, "none", "currentColor", "2.25");
895
910
  return e.appendChild(S("path", { d: "m6 9 6 6 6-6" })), e;
896
911
  }
897
- function wn() {
898
- const t = W("0 0 24 24", 17, 17, "none", "currentColor", "2.25");
912
+ function vn() {
913
+ const t = j("0 0 24 24", 17, 17, "none", "currentColor", "2.25");
899
914
  return t.appendChild(S("path", { d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" })), t.appendChild(S("path", { d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z" })), t;
900
915
  }
901
- function pt() {
902
- const t = W("0 0 24 24", 14, 14, "none", "currentColor", "2.75");
916
+ function dt() {
917
+ const t = j("0 0 24 24", 14, 14, "none", "currentColor", "2.75");
903
918
  return t.appendChild(S("line", { x1: "12", y1: "19", x2: "12", y2: "5" })), t.appendChild(S("polyline", { points: "5 12 12 5 19 12" })), t;
904
919
  }
905
- function bn() {
906
- const t = W("0 0 24 24", 18, 18, "currentColor");
920
+ function yn() {
921
+ const t = j("0 0 24 24", 18, 18, "currentColor");
907
922
  return t.appendChild(S("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" })), t;
908
923
  }
909
- function _n() {
910
- const t = W("0 0 24 24", 12, 12, "none", "currentColor", "2.4");
924
+ function Cn() {
925
+ const t = j("0 0 24 24", 12, 12, "none", "currentColor", "2.4");
911
926
  return t.appendChild(S("path", { d: "M18 6 6 18" })), t.appendChild(S("path", { d: "m6 6 12 12" })), t;
912
927
  }
913
- function xn() {
914
- const t = W("0 0 24 24", 13, 13, "none", "currentColor", "2.25");
928
+ function En() {
929
+ const t = j("0 0 24 24", 13, 13, "none", "currentColor", "2.25");
915
930
  return t.appendChild(S("rect", { width: "14", height: "14", x: "8", y: "8", rx: "2", ry: "2" })), t.appendChild(S("path", { d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" })), t;
916
931
  }
917
- function W(t, e, n, o, a, i) {
932
+ function j(t, e, n, o, a, r) {
918
933
  const l = {
919
934
  viewBox: t,
920
935
  width: String(e),
@@ -922,41 +937,41 @@ function W(t, e, n, o, a, i) {
922
937
  fill: o,
923
938
  "aria-hidden": "true"
924
939
  };
925
- return a && (l.stroke = a, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), i && (l["stroke-width"] = i), S("svg", l);
940
+ return a && (l.stroke = a, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), S("svg", l);
926
941
  }
927
942
  function S(t, e = {}) {
928
- const n = document.createElementNS(jt, t);
943
+ const n = document.createElementNS(Zt, t);
929
944
  for (const [o, a] of Object.entries(e))
930
945
  n.setAttribute(o, a);
931
946
  return n;
932
947
  }
933
- function We(t) {
948
+ function Ve(t) {
934
949
  for (const e of ["keydown", "keypress", "keyup"])
935
950
  t.addEventListener(e, (n) => {
936
951
  n.stopPropagation();
937
952
  });
938
953
  }
939
- function yn(t, e, n) {
954
+ function kn(t, e, n) {
940
955
  t.replaceChildren(), t.hidden = e.length === 0;
941
956
  for (const [o, a] of e.entries()) {
942
- const i = document.createElement("div");
943
- i.className = "pluno-pa-widget__attachment", i.appendChild(vn(a));
957
+ const r = document.createElement("div");
958
+ r.className = "pluno-pa-widget__attachment", r.appendChild(Sn(a));
944
959
  const l = document.createElement("span");
945
- l.textContent = a.name, i.appendChild(l);
960
+ l.textContent = a.name, r.appendChild(l);
946
961
  const p = document.createElement("button");
947
- p.type = "button", p.setAttribute("aria-label", `Remove ${a.name}`), p.appendChild(_n()), p.addEventListener("click", () => n(o)), i.appendChild(p), t.appendChild(i);
962
+ p.type = "button", p.setAttribute("aria-label", `Remove ${a.name}`), p.appendChild(Cn()), p.addEventListener("click", () => n(o)), r.appendChild(p), t.appendChild(r);
948
963
  }
949
964
  }
950
- function vn(t) {
951
- if (st(t)) {
965
+ function Sn(t) {
966
+ if (ct(t)) {
952
967
  const n = document.createElement("img");
953
968
  return n.src = t.dataUrl, n.alt = "", n.setAttribute("aria-hidden", "true"), n;
954
969
  }
955
970
  const e = document.createElement("span");
956
971
  return e.className = "pluno-pa-widget__attachment-file", e.textContent = "PDF", e;
957
972
  }
958
- function Cn(t) {
959
- if (st(t)) {
973
+ function Ln(t) {
974
+ if (ct(t)) {
960
975
  const a = document.createElement("img");
961
976
  return a.src = t.dataUrl, a.alt = t.name, a;
962
977
  }
@@ -967,51 +982,51 @@ function Cn(t) {
967
982
  const o = document.createElement("strong");
968
983
  return o.textContent = t.name, e.append(n, o), e;
969
984
  }
970
- function st(t) {
985
+ function ct(t) {
971
986
  return t.mimeType.startsWith("image/");
972
987
  }
973
- function En(t) {
988
+ function Pn(t) {
974
989
  return t === "application/pdf" ? "document.pdf" : "image";
975
990
  }
976
- async function kn(t) {
991
+ async function An(t) {
977
992
  if (!t)
978
993
  return [];
979
994
  const e = Array.from(t);
980
- if (e.length > ae)
981
- throw new Error(`Attach up to ${ae} files per message.`);
995
+ if (e.length > ie)
996
+ throw new Error(`Attach up to ${ie} files per message.`);
982
997
  return Promise.all(
983
998
  e.map(async (n) => {
984
- const o = Sn(n);
999
+ const o = Nn(n);
985
1000
  if (!o)
986
1001
  throw new Error("Pluno supports PNG, JPEG, WebP, non-animated GIF, and PDF files.");
987
- if (n.size > $t)
1002
+ if (n.size > Vt)
988
1003
  throw new Error("Each Pluno attachment can be up to 10 MB.");
989
1004
  if (o === "image/gif") {
990
- const a = new Uint8Array(await Nn(n));
991
- if (Pn(a))
1005
+ const a = new Uint8Array(await Mn(n));
1006
+ if (Tn(a))
992
1007
  throw new Error("Pluno supports non-animated GIF images.");
993
1008
  }
994
1009
  return {
995
- name: n.name || En(o),
1010
+ name: n.name || Pn(o),
996
1011
  mimeType: o,
997
1012
  sizeBytes: n.size,
998
- dataUrl: Ln(await Tn(n), o)
1013
+ dataUrl: Dn(await Rn(n), o)
999
1014
  };
1000
1015
  })
1001
1016
  );
1002
1017
  }
1003
- function Sn(t) {
1004
- if (Ut.has(t.type))
1018
+ function Nn(t) {
1019
+ if (jt.has(t.type))
1005
1020
  return t.type;
1006
1021
  const e = t.name.toLowerCase();
1007
1022
  return e.endsWith(".png") ? "image/png" : e.endsWith(".jpg") || e.endsWith(".jpeg") ? "image/jpeg" : e.endsWith(".webp") ? "image/webp" : e.endsWith(".gif") ? "image/gif" : e.endsWith(".pdf") ? "application/pdf" : null;
1008
1023
  }
1009
- function Ln(t, e) {
1024
+ function Dn(t, e) {
1010
1025
  const n = `data:${e};base64,`;
1011
1026
  return t.startsWith(n) ? t : t.replace(/^data:[^;]*;base64,/, n);
1012
1027
  }
1013
- function Pn(t) {
1014
- if (t.length < 14 || !An(t))
1028
+ function Tn(t) {
1029
+ if (t.length < 14 || !In(t))
1015
1030
  return !1;
1016
1031
  const e = t[10];
1017
1032
  let n = 13;
@@ -1022,7 +1037,7 @@ function Pn(t) {
1022
1037
  if (n += 1, a === 59)
1023
1038
  return !1;
1024
1039
  if (a === 33) {
1025
- n += 1, n = He(t, n);
1040
+ n += 1, n = je(t, n);
1026
1041
  continue;
1027
1042
  }
1028
1043
  if (a !== 44)
@@ -1031,17 +1046,17 @@ function Pn(t) {
1031
1046
  return !0;
1032
1047
  if (n + 9 >= t.length)
1033
1048
  return !1;
1034
- const i = t[n + 8];
1035
- if (n += 9, i & 128 && (n += 3 * 2 ** ((i & 7) + 1)), n >= t.length)
1049
+ const r = t[n + 8];
1050
+ if (n += 9, r & 128 && (n += 3 * 2 ** ((r & 7) + 1)), n >= t.length)
1036
1051
  return !1;
1037
- n += 1, n = He(t, n);
1052
+ n += 1, n = je(t, n);
1038
1053
  }
1039
1054
  return !1;
1040
1055
  }
1041
- function An(t) {
1056
+ function In(t) {
1042
1057
  return t[0] === 71 && t[1] === 73 && t[2] === 70 && t[3] === 56 && (t[4] === 55 || t[4] === 57) && t[5] === 97;
1043
1058
  }
1044
- function He(t, e) {
1059
+ function je(t, e) {
1045
1060
  for (; e < t.length; ) {
1046
1061
  const n = t[e];
1047
1062
  if (e += 1, n === 0)
@@ -1050,10 +1065,10 @@ function He(t, e) {
1050
1065
  }
1051
1066
  return e;
1052
1067
  }
1053
- function te(t) {
1068
+ function oe(t) {
1054
1069
  return !!(t && Array.from(t.types).includes("Files"));
1055
1070
  }
1056
- function Nn(t) {
1071
+ function Mn(t) {
1057
1072
  return new Promise((e, n) => {
1058
1073
  const o = new FileReader();
1059
1074
  o.addEventListener("load", () => {
@@ -1067,7 +1082,7 @@ function Nn(t) {
1067
1082
  }), o.readAsArrayBuffer(t);
1068
1083
  });
1069
1084
  }
1070
- function Tn(t) {
1085
+ function Rn(t) {
1071
1086
  return new Promise((e, n) => {
1072
1087
  const o = new FileReader();
1073
1088
  o.addEventListener("load", () => {
@@ -1081,226 +1096,280 @@ function Tn(t) {
1081
1096
  }), o.readAsDataURL(t);
1082
1097
  });
1083
1098
  }
1084
- function Dn(t, e, n, o, a, i, l, p, s) {
1085
- const d = [...o.messages], u = d.filter((g) => !Fn(g));
1086
- t.replaceChildren(), ct(e, o.isThinking);
1087
- const _ = u.length > 0 || !!o.assistantDraft || o.isThinking;
1088
- if (n.hidden = !_, u.length === 0 && !o.assistantDraft && !o.lastError && !o.isThinking) {
1089
- const g = document.createElement("div");
1090
- g.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
1099
+ function On(t, e, n, o, a, r, l, p, s) {
1100
+ const g = [...o.messages], c = g.filter((m) => !Vn(m));
1101
+ t.replaceChildren(), gt(e, o.isThinking);
1102
+ const b = c.length > 0 || !!o.assistantDraft || o.isThinking;
1103
+ if (n.hidden = !b, c.length === 0 && !o.assistantDraft && !o.lastError && !o.isThinking) {
1104
+ const m = document.createElement("div");
1105
+ m.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
1091
1106
  const f = document.createElement("img");
1092
- f.className = "pluno-pa-widget__character pluno-pa-widget__character--empty", f.src = l(), f.alt = "", f.setAttribute("aria-hidden", "true"), g.appendChild(f), g.appendChild(it());
1093
- const b = document.createElement("div");
1094
- b.className = o.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", o.starterPrompts.length === 0 && b.setAttribute("aria-hidden", "true");
1095
- for (const E of o.starterPrompts) {
1096
- const C = document.createElement("button");
1097
- C.type = "button", C.className = "pluno-pa-widget__starter-prompt", C.textContent = `"${E}"`, C.addEventListener("click", () => {
1098
- p(E);
1099
- }), b.appendChild(C);
1100
- }
1101
- g.appendChild(b), t.appendChild(g);
1107
+ f.className = "pluno-pa-widget__character pluno-pa-widget__character--empty", f.src = l(), f.alt = "", f.setAttribute("aria-hidden", "true"), m.appendChild(f), m.appendChild(lt());
1108
+ const v = document.createElement("div");
1109
+ v.className = o.starterPrompts.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", o.starterPrompts.length === 0 && v.setAttribute("aria-hidden", "true");
1110
+ for (const k of o.starterPrompts) {
1111
+ const E = document.createElement("button");
1112
+ E.type = "button", E.className = "pluno-pa-widget__starter-prompt", E.textContent = `"${k}"`, E.addEventListener("click", () => {
1113
+ p(k);
1114
+ }), v.appendChild(E);
1115
+ }
1116
+ m.appendChild(v), t.appendChild(m);
1102
1117
  return;
1103
1118
  }
1104
- let w = null, y = null, k = [];
1105
- const m = () => {
1106
- if (k.length === 0)
1119
+ let _ = null, x = null, y = [];
1120
+ const h = () => {
1121
+ if (y.length === 0)
1107
1122
  return !1;
1108
- const g = zn(k, a, i, l());
1109
- return t.appendChild(g), w = null, y = g, k = [], !0;
1123
+ const m = jn(y, a, r, l());
1124
+ return t.appendChild(m), _ = null, x = m, y = [], !0;
1110
1125
  };
1111
- for (let g = 0; g < u.length; g += 1) {
1112
- const f = u[g];
1126
+ for (let m = 0; m < c.length; m += 1) {
1127
+ const f = c[m];
1113
1128
  if (f.role === "tool") {
1114
- k.push(f);
1129
+ y.push(f);
1115
1130
  continue;
1116
1131
  }
1117
1132
  if (f.role === "system")
1118
1133
  continue;
1119
- const b = m(), E = Ke(f.content);
1120
- if (f.role === "assistant" && !b) {
1121
- const v = _e(l());
1122
- t.appendChild(v), w = null, y = v;
1123
- }
1124
- const C = document.createElement("div");
1125
- C.className = `pluno-pa-widget__message pluno-pa-widget__message--${f.role}`, f.role === "assistant" ? Ye(C, E) : C.textContent = E, f.role === "user" && f.attachments?.length && C.appendChild(Rn(f.attachments));
1126
- const H = document.createElement("div");
1127
- H.className = "pluno-pa-widget__message-actions", H.appendChild(Ve(E)), C.appendChild(H), t.appendChild(C), w = C, y = null;
1134
+ const v = h(), k = Ke(f.content);
1135
+ if (f.role === "assistant" && !v) {
1136
+ const C = ve(l());
1137
+ t.appendChild(C), _ = null, x = C;
1138
+ }
1139
+ const E = document.createElement("div");
1140
+ E.className = `pluno-pa-widget__message pluno-pa-widget__message--${f.role}`, f.role === "assistant" ? Ye(E, k) : E.textContent = k, f.role === "user" && f.attachments?.length && E.appendChild(Bn(f.attachments));
1141
+ const q = document.createElement("div");
1142
+ q.className = "pluno-pa-widget__message-actions", q.appendChild(qe(k)), E.appendChild(q), t.appendChild(E), _ = E, x = null;
1128
1143
  }
1129
- const h = m();
1144
+ const d = h();
1130
1145
  if (o.assistantDraft) {
1131
- if (!h) {
1132
- const E = _e(l());
1133
- t.appendChild(E), w = null, y = E;
1134
- }
1135
- const g = Ke(o.assistantDraft), f = document.createElement("div");
1136
- f.className = "pluno-pa-widget__message pluno-pa-widget__message--assistant", Ye(f, g);
1137
- const b = document.createElement("div");
1138
- b.className = "pluno-pa-widget__message-actions", b.appendChild(Ve(g)), f.appendChild(b), t.appendChild(f), w = f, y = null;
1146
+ if (!d) {
1147
+ const k = ve(l());
1148
+ t.appendChild(k), _ = null, x = k;
1149
+ }
1150
+ const m = Ke(o.assistantDraft), f = document.createElement("div");
1151
+ f.className = "pluno-pa-widget__message pluno-pa-widget__message--assistant", Ye(f, m);
1152
+ const v = document.createElement("div");
1153
+ v.className = "pluno-pa-widget__message-actions", v.appendChild(qe(m)), f.appendChild(v), t.appendChild(f), _ = f, x = null;
1139
1154
  }
1140
1155
  if (o.isThinking && !o.assistantDraft)
1141
- if (h) {
1142
- const g = dt();
1143
- t.appendChild(g), w = null, y = g;
1156
+ if (d) {
1157
+ const m = ut();
1158
+ t.appendChild(m), _ = null, x = m;
1144
1159
  } else {
1145
- const g = Bn(l());
1146
- t.appendChild(g), w = null, y = g;
1160
+ const m = qn(l());
1161
+ t.appendChild(m), _ = null, x = m;
1147
1162
  }
1148
1163
  if (o.lastError) {
1149
- const g = document.createElement("div");
1150
- g.className = "pluno-pa-widget__error", g.textContent = o.lastError, t.appendChild(g), w = g, y = null;
1164
+ const m = document.createElement("div");
1165
+ m.className = "pluno-pa-widget__error", m.textContent = o.lastError, t.appendChild(m), _ = m, x = null;
1151
1166
  }
1152
- const x = s && !o.isThinking ? Dt(d) : null;
1153
- if (s && x && !s.dismissedCandidateIds.has(x.id)) {
1154
- const g = Mn(x, {
1155
- isDrafting: s.draftingCandidateId === x.id,
1167
+ const w = s && !o.isThinking ? Mt(g) : null;
1168
+ if (s && w && !s.dismissedCandidateIds.has(w.id)) {
1169
+ const m = zn(w, {
1170
+ isDrafting: s.draftingCandidateId === w.id,
1156
1171
  error: s.error,
1157
1172
  onDraft: s.onDraft,
1158
- onDismiss: s.onDismiss
1173
+ onDismiss: s.onDismiss,
1174
+ onDisable: s.onDisable
1159
1175
  });
1160
- t.appendChild(g), s.onSeen(x), w = null, y = g;
1176
+ t.appendChild(m), s.onSeen(w), _ = null, x = m;
1161
1177
  }
1162
- w?.classList.add("pluno-pa-widget__message--bottom-reserve"), y?.classList.add("pluno-pa-widget__bottom-reserve-compact"), t.scrollTop = t.scrollHeight;
1178
+ _?.classList.add("pluno-pa-widget__message--bottom-reserve"), x?.classList.add("pluno-pa-widget__bottom-reserve-compact"), t.scrollTop = t.scrollHeight;
1163
1179
  }
1164
- function In(t, e, n, o, a, i) {
1165
- t.replaceChildren(), ct(e, !1), e.disabled = !0, n.hidden = !0;
1180
+ function Fn(t, e, n, o, a, r) {
1181
+ t.replaceChildren(), gt(e, !1), e.disabled = !0, n.hidden = !0;
1166
1182
  const l = document.createElement("div");
1167
1183
  l.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
1168
1184
  const p = document.createElement("img");
1169
1185
  p.className = "pluno-pa-widget__character pluno-pa-widget__character--empty", p.src = o(), p.alt = "", p.setAttribute("aria-hidden", "true"), l.appendChild(p);
1170
1186
  const s = document.createElement("div");
1171
1187
  s.className = "pluno-pa-widget__empty", s.textContent = "Log in to use Pluno on this page.", l.appendChild(s);
1172
- const d = document.createElement("button");
1173
- d.type = "button", d.className = "pluno-pa-widget__login", d.textContent = a, d.addEventListener("click", () => i?.()), l.appendChild(d), t.appendChild(l);
1188
+ const g = document.createElement("button");
1189
+ g.type = "button", g.className = "pluno-pa-widget__login", g.textContent = a, g.addEventListener("click", () => r?.()), l.appendChild(g), t.appendChild(l);
1174
1190
  }
1175
- function Rn(t) {
1191
+ function Bn(t) {
1176
1192
  const e = document.createElement("div");
1177
1193
  e.className = "pluno-pa-widget__message-attachments";
1178
1194
  for (const n of t)
1179
- e.appendChild(Cn(n));
1195
+ e.appendChild(Ln(n));
1180
1196
  return e;
1181
1197
  }
1182
- function Ve(t) {
1198
+ function qe(t) {
1183
1199
  const e = document.createElement("button");
1184
- return e.type = "button", e.className = "pluno-pa-widget__message-copy", e.setAttribute("aria-label", "Copy message"), e.title = "Copy message", e.appendChild(xn()), e.addEventListener("click", (n) => {
1200
+ return e.type = "button", e.className = "pluno-pa-widget__message-copy", e.setAttribute("aria-label", "Copy message"), e.title = "Copy message", e.appendChild(En()), e.addEventListener("click", (n) => {
1185
1201
  n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(t);
1186
1202
  }), e;
1187
1203
  }
1188
- function Mn(t, e) {
1204
+ function zn(t, e) {
1189
1205
  const n = document.createElement("article");
1190
1206
  n.className = "pluno-pa-widget__share-prompt";
1191
1207
  const o = document.createElement("div");
1192
1208
  o.className = "pluno-pa-widget__share-prompt-body";
1193
1209
  const a = document.createElement("div");
1194
1210
  a.className = "pluno-pa-widget__share-prompt-copy";
1195
- const i = document.createElement("strong");
1196
- i.textContent = "Share this win?", a.appendChild(i);
1211
+ const r = document.createElement("strong");
1212
+ r.textContent = "Share this win?", a.appendChild(r);
1197
1213
  const l = document.createElement("span");
1198
- if (l.textContent = e.isDrafting ? "Drafting your social post..." : "Create LinkedIn and X copy from this session.", a.appendChild(l), e.error) {
1199
- const d = document.createElement("span");
1200
- d.className = "pluno-pa-widget__share-prompt-error", d.textContent = e.error, a.appendChild(d);
1214
+ if (l.textContent = e.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", a.appendChild(l), e.error) {
1215
+ const c = document.createElement("span");
1216
+ c.className = "pluno-pa-widget__share-prompt-error", c.textContent = e.error, a.appendChild(c);
1201
1217
  }
1202
1218
  o.appendChild(a);
1203
1219
  const p = document.createElement("div");
1204
1220
  p.className = "pluno-pa-widget__share-prompt-actions";
1205
- const s = document.createElement("button");
1206
- if (s.type = "button", s.disabled = e.isDrafting, s.addEventListener("click", () => {
1221
+ const s = document.createElement("div");
1222
+ s.className = "pluno-pa-widget__share-prompt-primary-actions";
1223
+ const g = document.createElement("button");
1224
+ if (g.type = "button", g.disabled = e.isDrafting, g.addEventListener("click", () => {
1207
1225
  e.onDraft(t);
1208
- }), e.isDrafting ? (s.appendChild(xe()), s.appendChild(document.createTextNode("Drafting..."))) : s.textContent = "Draft social post", p.appendChild(s), !e.isDrafting) {
1209
- const d = document.createElement("button");
1210
- d.type = "button", d.className = "pluno-pa-widget__share-prompt-dismiss", d.setAttribute("aria-label", "Dismiss share prompt"), d.title = "Dismiss", d.textContent = "Dismiss", d.addEventListener("click", () => {
1226
+ }), e.isDrafting ? (g.appendChild(ye()), g.appendChild(document.createTextNode("Drafting..."))) : g.textContent = "Draft a social post", s.appendChild(g), e.isDrafting)
1227
+ p.appendChild(s);
1228
+ else {
1229
+ const c = document.createElement("button");
1230
+ 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", () => {
1211
1231
  e.onDismiss(t);
1212
- }), p.appendChild(d);
1232
+ }), s.appendChild(c), p.appendChild(s);
1233
+ const b = document.createElement("button");
1234
+ b.type = "button", b.className = "pluno-pa-widget__share-prompt-disable", b.textContent = "Don't ask again", b.addEventListener("click", () => {
1235
+ e.onDisable(t);
1236
+ }), p.appendChild(b);
1213
1237
  }
1214
1238
  return o.appendChild(p), n.appendChild(o), n;
1215
1239
  }
1216
- function On(t, e) {
1240
+ function Gn(t, e) {
1217
1241
  const n = document.createElement("div");
1218
- n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (w) => {
1219
- w.target === n && e.onClose();
1242
+ n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (h) => {
1243
+ h.target === n && e.onClose();
1220
1244
  });
1221
1245
  const o = document.createElement("section");
1222
- o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft social post");
1223
- const a = document.createElement("header"), i = document.createElement("strong");
1224
- i.textContent = "Draft social post", a.appendChild(i);
1246
+ o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
1247
+ const a = document.createElement("header"), r = document.createElement("strong");
1248
+ r.textContent = "Share this win", a.appendChild(r);
1225
1249
  const l = document.createElement("button");
1226
- if (l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", e.onClose), a.appendChild(l), o.appendChild(a), t.screenshotDataUrl) {
1227
- const w = document.createElement("img");
1228
- w.className = "pluno-pa-widget__share-dialog-screenshot", w.src = t.screenshotDataUrl, w.alt = "Product page with Pluno open", o.appendChild(w);
1250
+ l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", e.onClose), a.appendChild(l), o.appendChild(a);
1251
+ const p = document.createElement("p");
1252
+ p.className = "pluno-pa-widget__share-dialog-status", p.hidden = !0;
1253
+ const s = document.createElement("div");
1254
+ s.className = "pluno-pa-widget__share-dialog-step";
1255
+ const g = document.createElement("div");
1256
+ g.className = "pluno-pa-widget__share-dialog-step-header";
1257
+ const c = document.createElement("strong");
1258
+ c.textContent = "1) Copy Screenshot", g.appendChild(c);
1259
+ const b = $n("Copy Screenshot", async () => {
1260
+ try {
1261
+ return await Rt(t.screenshotDataUrl ?? ""), p.textContent = "", p.hidden = !0, !0;
1262
+ } catch {
1263
+ return p.textContent = "Could not copy screenshot.", p.hidden = !1, !1;
1264
+ }
1265
+ });
1266
+ if (g.appendChild(b), s.appendChild(g), t.screenshotDataUrl) {
1267
+ const h = document.createElement("div");
1268
+ h.className = "pluno-pa-widget__share-dialog-screenshot";
1269
+ const d = document.createElement("img");
1270
+ d.src = t.screenshotDataUrl, d.alt = "Product page with Pluno open", h.appendChild(d), s.appendChild(h);
1229
1271
  }
1230
- const p = document.createElement("div");
1231
- p.className = "pluno-pa-widget__share-dialog-fields";
1232
- const s = qe("LinkedIn", t.linkedinPost), d = qe("X", t.xPost);
1233
- p.appendChild(s.field), p.appendChild(d.field), o.appendChild(p);
1234
- const u = document.createElement("p");
1235
- u.className = "pluno-pa-widget__share-dialog-status", u.hidden = !0, o.appendChild(u);
1236
- const _ = document.createElement("footer");
1237
- return _.appendChild(je("Copy LinkedIn", s.textarea, u)), _.appendChild(je("Copy X", d.textarea, u)), o.appendChild(_), n.appendChild(o), window.setTimeout(() => {
1238
- s.textarea.focus(), s.textarea.setSelectionRange(0, 0);
1239
- }, 0), n;
1240
- }
1241
- function qe(t, e) {
1242
- const n = document.createElement("label");
1243
- n.className = "pluno-pa-widget__share-dialog-field";
1244
- const o = document.createElement("span");
1245
- o.textContent = t, n.appendChild(o);
1246
- const a = document.createElement("textarea");
1247
- return a.value = e, a.rows = t === "LinkedIn" ? 5 : 4, n.appendChild(a), { field: n, textarea: a };
1248
- }
1249
- function je(t, e, n) {
1250
- const o = document.createElement("button");
1251
- return o.type = "button", o.textContent = t, o.addEventListener("click", () => {
1252
- navigator.clipboard.writeText(e.value).then(
1253
- () => {
1254
- n.textContent = `${t.replace("Copy ", "")} copied.`, n.hidden = !1;
1255
- },
1256
- () => {
1257
- n.textContent = "Copy failed.", n.hidden = !1;
1258
- }
1259
- );
1260
- }), o;
1272
+ o.appendChild(s), o.appendChild(p);
1273
+ const _ = document.createElement("div");
1274
+ _.className = "pluno-pa-widget__share-dialog-step";
1275
+ const x = document.createElement("strong");
1276
+ x.className = "pluno-pa-widget__share-dialog-step-title", x.textContent = "2) Share on", _.appendChild(x);
1277
+ const y = document.createElement("footer");
1278
+ y.className = "pluno-pa-widget__share-dialog-platforms";
1279
+ for (const h of Un(t)) {
1280
+ const d = document.createElement("a");
1281
+ d.href = h.href, d.target = "_blank", d.rel = "noopener noreferrer", d.title = h.label, d.setAttribute("aria-label", `Open ${h.label}`), d.appendChild(Wn(h.id)), y.appendChild(d);
1282
+ }
1283
+ if (_.appendChild(y), o.appendChild(_), e.socialPostRewardsUrl) {
1284
+ const h = document.createElement("div");
1285
+ h.className = "pluno-pa-widget__share-dialog-step";
1286
+ const d = document.createElement("strong");
1287
+ d.className = "pluno-pa-widget__share-dialog-step-title", d.textContent = "3) Submit post to get 2000 free credits!", h.appendChild(d);
1288
+ const w = document.createElement("a");
1289
+ w.className = "pluno-pa-widget__share-dialog-reward-link", w.href = e.socialPostRewardsUrl, w.target = "_blank", w.rel = "noopener noreferrer", w.appendChild(document.createTextNode("Submit post URL")), w.appendChild(Hn()), h.appendChild(w), o.appendChild(h);
1290
+ }
1291
+ return n.appendChild(o), n;
1292
+ }
1293
+ function $n(t, e) {
1294
+ const n = document.createElement("button");
1295
+ return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = t, n.addEventListener("click", async (o) => {
1296
+ o.preventDefault(), o.stopPropagation(), await e() && (n.textContent = "Copied ✓");
1297
+ }), n;
1298
+ }
1299
+ function Un(t) {
1300
+ const e = t.linkedinPost.trim(), n = t.xPost.trim();
1301
+ return [
1302
+ {
1303
+ id: "linkedin",
1304
+ label: "LinkedIn",
1305
+ href: `https://www.linkedin.com/feed/?shareActive=true&text=${encodeURIComponent(e)}`
1306
+ },
1307
+ {
1308
+ id: "x",
1309
+ label: "X",
1310
+ href: `https://twitter.com/intent/tweet?text=${encodeURIComponent(n)}`
1311
+ },
1312
+ {
1313
+ id: "instagram",
1314
+ label: "Instagram Story",
1315
+ href: "https://www.instagram.com/create/story/"
1316
+ }
1317
+ ];
1318
+ }
1319
+ function Wn(t) {
1320
+ const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1321
+ return e.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), e.setAttribute("viewBox", "0 0 32 32"), e.setAttribute("aria-hidden", "true"), t === "linkedin" ? (P(e, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), P(e, "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"), P(e, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), P(e, "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"), P(e, "M20 18c.1 2.2.1 4.7 0 7.2"), e) : t === "x" ? (P(e, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), P(e, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), P(e, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), e) : (P(e, "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"), P(e, "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", "0.48"), P(e, "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"), P(e, "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"), e);
1322
+ }
1323
+ function P(t, e, n) {
1324
+ const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
1325
+ o.setAttribute("d", e), n && o.setAttribute("opacity", n), t.appendChild(o);
1261
1326
  }
1262
- function Fn(t) {
1263
- return t.role === "tool" && t.toolName === tt;
1327
+ function Hn() {
1328
+ const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
1329
+ return t.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), t.setAttribute("viewBox", "0 0 24 24"), t.setAttribute("aria-hidden", "true"), P(t, "M14 5h5v5"), P(t, "M19 5l-8 8"), P(t, "M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"), t;
1330
+ }
1331
+ function Vn(t) {
1332
+ return t.role === "tool" && t.toolName === nt;
1264
1333
  }
1265
1334
  function Ke(t) {
1266
1335
  return t.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
1267
1336
  }
1268
- function zn(t, e, n, o) {
1337
+ function jn(t, e, n, o) {
1269
1338
  const a = document.createElement("article");
1270
1339
  a.className = "pluno-pa-widget__tool-group", a.title = new Date(t[t.length - 1].createdAt).toLocaleString();
1271
- const i = document.createElement("img");
1272
- i.className = "pluno-pa-widget__character pluno-pa-widget__character--tool-group", i.src = o, i.alt = "", i.setAttribute("aria-hidden", "true"), a.appendChild(i);
1273
- const l = document.createElement("details"), p = Gn(t);
1340
+ const r = document.createElement("img");
1341
+ r.className = "pluno-pa-widget__character pluno-pa-widget__character--tool-group", r.src = o, r.alt = "", r.setAttribute("aria-hidden", "true"), a.appendChild(r);
1342
+ const l = document.createElement("details"), p = Kn(t);
1274
1343
  l.open = e.has(p), l.addEventListener("toggle", () => {
1275
1344
  l.open ? e.add(p) : e.delete(p), n();
1276
1345
  });
1277
1346
  const s = document.createElement("summary");
1278
- s.className = "pluno-pa-widget__tool-summary", t.some((_) => _.loading) && s.appendChild(xe());
1279
- const u = document.createElement("span");
1280
- if (u.className = "pluno-pa-widget__tool-summary-title", u.textContent = t[t.length - 1].content || "Run tool", s.appendChild(u), l.appendChild(s), t.length > 0) {
1281
- const _ = document.createElement("div");
1282
- _.className = "pluno-pa-widget__tool-lines";
1283
- for (const w of t) {
1284
- const y = document.createElement("div");
1285
- y.className = "pluno-pa-widget__tool-line", w.loading && y.appendChild(xe());
1286
- const k = document.createElement("span");
1287
- k.textContent = w.content || "Run tool", y.appendChild(k), _.appendChild(y);
1288
- }
1289
- l.appendChild(_);
1347
+ s.className = "pluno-pa-widget__tool-summary", t.some((b) => b.loading) && s.appendChild(ye());
1348
+ const c = document.createElement("span");
1349
+ if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = t[t.length - 1].content || "Run tool", s.appendChild(c), l.appendChild(s), t.length > 0) {
1350
+ const b = document.createElement("div");
1351
+ b.className = "pluno-pa-widget__tool-lines";
1352
+ for (const _ of t) {
1353
+ const x = document.createElement("div");
1354
+ x.className = "pluno-pa-widget__tool-line", _.loading && x.appendChild(ye());
1355
+ const y = document.createElement("span");
1356
+ y.textContent = _.content || "Run tool", x.appendChild(y), b.appendChild(x);
1357
+ }
1358
+ l.appendChild(b);
1290
1359
  }
1291
1360
  return a.appendChild(l), a;
1292
1361
  }
1293
- function _e(t) {
1362
+ function ve(t) {
1294
1363
  const e = document.createElement("article");
1295
1364
  e.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker";
1296
1365
  const n = document.createElement("img");
1297
1366
  return n.className = "pluno-pa-widget__character pluno-pa-widget__character--tool-group", n.src = t, n.alt = "", n.setAttribute("aria-hidden", "true"), e.appendChild(n), e;
1298
1367
  }
1299
- function Bn(t) {
1300
- const e = _e(t);
1301
- return e.classList.add("pluno-pa-widget__thinking-marker"), e.appendChild(dt()), e;
1368
+ function qn(t) {
1369
+ const e = ve(t);
1370
+ return e.classList.add("pluno-pa-widget__thinking-marker"), e.appendChild(ut()), e;
1302
1371
  }
1303
- function dt() {
1372
+ function ut() {
1304
1373
  const t = document.createElement("div");
1305
1374
  t.className = "pluno-pa-widget__status";
1306
1375
  const e = document.createElement("span");
@@ -1308,15 +1377,15 @@ function dt() {
1308
1377
  const n = document.createElement("span");
1309
1378
  return n.textContent = "Thinking...", t.appendChild(n), t;
1310
1379
  }
1311
- function Gn(t) {
1380
+ function Kn(t) {
1312
1381
  return `tools:${t.map((e) => e.id).join("|")}`;
1313
1382
  }
1314
- function xe() {
1383
+ function ye() {
1315
1384
  const t = document.createElement("span");
1316
1385
  return t.className = "pluno-pa-widget__spinner", t.setAttribute("aria-hidden", "true"), t;
1317
1386
  }
1318
- function ct(t, e) {
1319
- t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ? bn() : pt());
1387
+ function gt(t, e) {
1388
+ t.setAttribute("aria-label", e ? "Stop" : "Send"), t.classList.toggle("pluno-pa-widget__send--stop", e), t.replaceChildren(e ? yn() : dt());
1320
1389
  }
1321
1390
  function Ye(t, e) {
1322
1391
  const n = e.replace(/\r\n/g, `
@@ -1330,54 +1399,54 @@ function Ye(t, e) {
1330
1399
  continue;
1331
1400
  }
1332
1401
  if (a.match(/^```(\w+)?\s*$/)) {
1333
- const d = [];
1402
+ const g = [];
1334
1403
  for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
1335
- d.push(n[o]), o += 1;
1404
+ g.push(n[o]), o += 1;
1336
1405
  o += o < n.length ? 1 : 0;
1337
- const u = document.createElement("pre"), _ = document.createElement("code");
1338
- _.textContent = d.join(`
1339
- `), u.appendChild(_), t.appendChild(u);
1406
+ const c = document.createElement("pre"), b = document.createElement("code");
1407
+ b.textContent = g.join(`
1408
+ `), c.appendChild(b), t.appendChild(c);
1340
1409
  continue;
1341
1410
  }
1342
1411
  const l = a.match(/^(#{1,3})\s+(.+)$/);
1343
1412
  if (l) {
1344
- const d = document.createElement(`h${l[1].length + 2}`);
1345
- ne(d, l[2]), t.appendChild(d), o += 1;
1413
+ const g = document.createElement(`h${l[1].length + 2}`);
1414
+ ae(g, l[2]), t.appendChild(g), o += 1;
1346
1415
  continue;
1347
1416
  }
1348
1417
  if (/^\s*[-*+]\s+/.test(a)) {
1349
- const d = document.createElement("ul");
1418
+ const g = document.createElement("ul");
1350
1419
  for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
1351
- const u = document.createElement("li");
1352
- ne(u, n[o].replace(/^\s*[-*+]\s+/, "")), d.appendChild(u), o += 1;
1420
+ const c = document.createElement("li");
1421
+ ae(c, n[o].replace(/^\s*[-*+]\s+/, "")), g.appendChild(c), o += 1;
1353
1422
  }
1354
- t.appendChild(d);
1423
+ t.appendChild(g);
1355
1424
  continue;
1356
1425
  }
1357
1426
  if (/^\s*\d+\.\s+/.test(a)) {
1358
- const d = document.createElement("ol");
1427
+ const g = document.createElement("ol");
1359
1428
  for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
1360
- const u = document.createElement("li");
1361
- ne(u, n[o].replace(/^\s*\d+\.\s+/, "")), d.appendChild(u), o += 1;
1429
+ const c = document.createElement("li");
1430
+ ae(c, n[o].replace(/^\s*\d+\.\s+/, "")), g.appendChild(c), o += 1;
1362
1431
  }
1363
- t.appendChild(d);
1432
+ t.appendChild(g);
1364
1433
  continue;
1365
1434
  }
1366
1435
  const p = [a];
1367
1436
  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]); )
1368
1437
  p.push(n[o]), o += 1;
1369
1438
  const s = document.createElement("p");
1370
- p.forEach((d, u) => {
1371
- u > 0 && s.appendChild(document.createElement("br")), ne(s, d);
1439
+ p.forEach((g, c) => {
1440
+ c > 0 && s.appendChild(document.createElement("br")), ae(s, g);
1372
1441
  }), t.appendChild(s);
1373
1442
  }
1374
1443
  }
1375
- function ne(t, e) {
1444
+ function ae(t, e) {
1376
1445
  const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
1377
1446
  let o = 0;
1378
1447
  for (const a of e.matchAll(n)) {
1379
- const i = a.index ?? 0;
1380
- i > o && t.appendChild(document.createTextNode(e.slice(o, i)));
1448
+ const r = a.index ?? 0;
1449
+ r > o && t.appendChild(document.createTextNode(e.slice(o, r)));
1381
1450
  const l = a[0];
1382
1451
  if (l.startsWith("`")) {
1383
1452
  const p = document.createElement("code");
@@ -1390,17 +1459,17 @@ function ne(t, e) {
1390
1459
  p.textContent = l.slice(1, -1), t.appendChild(p);
1391
1460
  } else {
1392
1461
  const p = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
1393
- if (p && $n(p[2])) {
1462
+ if (p && Yn(p[2])) {
1394
1463
  const s = document.createElement("a");
1395
1464
  s.href = p[2], s.target = "_top", s.rel = "noreferrer", s.textContent = p[1], t.appendChild(s);
1396
1465
  } else
1397
1466
  t.appendChild(document.createTextNode(l));
1398
1467
  }
1399
- o = i + l.length;
1468
+ o = r + l.length;
1400
1469
  }
1401
1470
  o < e.length && t.appendChild(document.createTextNode(e.slice(o)));
1402
1471
  }
1403
- function $n(t) {
1472
+ function Yn(t) {
1404
1473
  if (t.startsWith("/") || t.startsWith("#"))
1405
1474
  return !0;
1406
1475
  try {
@@ -1465,7 +1534,7 @@ function Xe(t, e) {
1465
1534
  --pluno-pa-accent-contrast: #fafafa;
1466
1535
  position: fixed;
1467
1536
  z-index: 2147483645;
1468
- font-family: ${I.fontFamily};
1537
+ font-family: ${M.fontFamily};
1469
1538
  font-size: 14px;
1470
1539
  color: var(--pluno-pa-text);
1471
1540
  width: var(--pluno-pa-launcher-width);
@@ -2104,7 +2173,13 @@ function Xe(t, e) {
2104
2173
  .pluno-pa-widget__share-prompt-actions {
2105
2174
  display: flex;
2106
2175
  align-items: center;
2107
- justify-content: flex-start;
2176
+ justify-content: space-between;
2177
+ gap: 6px;
2178
+ }
2179
+ .pluno-pa-widget__share-prompt-primary-actions {
2180
+ min-width: 0;
2181
+ display: flex;
2182
+ align-items: center;
2108
2183
  gap: 6px;
2109
2184
  }
2110
2185
  .pluno-pa-widget__share-prompt-actions button {
@@ -2137,6 +2212,22 @@ function Xe(t, e) {
2137
2212
  background: var(--pluno-pa-surface);
2138
2213
  color: var(--pluno-pa-muted);
2139
2214
  }
2215
+ .pluno-pa-widget__share-prompt-disable {
2216
+ border: 0;
2217
+ background: transparent;
2218
+ color: color-mix(in srgb, var(--pluno-pa-muted) 72%, transparent);
2219
+ padding: 0;
2220
+ font: inherit;
2221
+ font-size: 10px;
2222
+ font-weight: 500;
2223
+ line-height: 1.2;
2224
+ cursor: pointer;
2225
+ }
2226
+ .pluno-pa-widget__share-prompt-disable:hover,
2227
+ .pluno-pa-widget__share-prompt-disable:focus-visible {
2228
+ color: var(--pluno-pa-muted);
2229
+ text-decoration: underline;
2230
+ }
2140
2231
  .pluno-pa-widget__share-dialog-backdrop {
2141
2232
  position: fixed;
2142
2233
  inset: 0;
@@ -2145,21 +2236,52 @@ function Xe(t, e) {
2145
2236
  place-items: center;
2146
2237
  padding: 18px;
2147
2238
  background: rgba(24, 24, 27, 0.28);
2148
- font-family: var(--pluno-pa-font, ${I.fontFamily});
2239
+ font-family: var(--pluno-pa-font, ${M.fontFamily});
2149
2240
  color: var(--pluno-pa-text);
2150
2241
  }
2151
2242
  .pluno-pa-widget__share-dialog {
2243
+ --pluno-pa-share-paper: #fff9df;
2244
+ --pluno-pa-share-ink: #2c2a1e;
2245
+ --pluno-pa-share-muted: rgba(44, 42, 30, 0.66);
2246
+ --pluno-pa-share-rule: rgba(44, 42, 30, 0.24);
2247
+ --pluno-pa-share-highlight: color-mix(in srgb, var(--pluno-pa-accent) 22%, #fff9df);
2248
+ position: relative;
2249
+ isolation: isolate;
2152
2250
  width: min(390px, calc(100vw - 36px));
2153
2251
  max-height: min(650px, calc(100vh - 36px));
2154
2252
  display: flex;
2155
2253
  flex-direction: column;
2156
2254
  gap: 12px;
2157
- border: 1px solid var(--pluno-pa-divider);
2158
- border-radius: 12px;
2159
- background: var(--pluno-pa-bg);
2160
- box-shadow: 0 24px 70px rgba(24, 24, 27, 0.22);
2255
+ border: 2px solid transparent;
2256
+ border-radius: 31px 25px 29px 23px / 23px 33px 22px 31px;
2257
+ background:
2258
+ linear-gradient(rgba(44, 42, 30, 0.045) 1px, transparent 1px),
2259
+ linear-gradient(90deg, rgba(44, 42, 30, 0.035) 1px, transparent 1px),
2260
+ var(--pluno-pa-share-paper);
2261
+ background-size: 26px 26px, 26px 26px, auto;
2262
+ color: var(--pluno-pa-share-ink);
2263
+ font-family: "Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Segoe Print", cursive;
2264
+ transform: rotate(-0.25deg);
2265
+ box-shadow: 0 24px 58px rgba(44, 42, 30, 0.22);
2161
2266
  padding: 14px;
2162
2267
  }
2268
+ .pluno-pa-widget__share-dialog::before,
2269
+ .pluno-pa-widget__share-dialog::after {
2270
+ content: "";
2271
+ position: absolute;
2272
+ inset: -3px;
2273
+ z-index: -1;
2274
+ border: 2px solid var(--pluno-pa-share-ink);
2275
+ border-radius: inherit;
2276
+ filter: url(#pluno-pa-scribble-wobble);
2277
+ pointer-events: none;
2278
+ }
2279
+ .pluno-pa-widget__share-dialog::after {
2280
+ inset: -7px -5px -4px -6px;
2281
+ opacity: 0.42;
2282
+ transform: rotate(1.6deg);
2283
+ filter: url(#pluno-pa-scribble-wobble-2);
2284
+ }
2163
2285
  .pluno-pa-widget__share-dialog header,
2164
2286
  .pluno-pa-widget__share-dialog footer {
2165
2287
  display: flex;
@@ -2168,84 +2290,156 @@ function Xe(t, e) {
2168
2290
  gap: 10px;
2169
2291
  }
2170
2292
  .pluno-pa-widget__share-dialog header strong {
2171
- color: var(--pluno-pa-text);
2172
- font-size: 15px;
2173
- line-height: 1.2;
2293
+ color: var(--pluno-pa-share-ink);
2294
+ font-size: 18px;
2295
+ line-height: 1.1;
2174
2296
  }
2175
2297
  .pluno-pa-widget__share-dialog header button {
2176
2298
  width: 30px;
2177
2299
  height: 30px;
2178
- border: 1px solid var(--pluno-pa-divider);
2179
- border-radius: 999px;
2180
- background: var(--pluno-pa-surface);
2181
- color: var(--pluno-pa-muted);
2300
+ border: 2px solid var(--pluno-pa-share-ink);
2301
+ border-radius: 43% 57% 39% 61% / 59% 41% 58% 42%;
2302
+ background: var(--pluno-pa-share-paper);
2303
+ color: var(--pluno-pa-share-ink);
2182
2304
  cursor: pointer;
2183
2305
  }
2184
2306
  .pluno-pa-widget__share-dialog-screenshot {
2307
+ position: relative;
2308
+ overflow: hidden;
2185
2309
  width: 100%;
2310
+ aspect-ratio: 16 / 10;
2186
2311
  max-height: 180px;
2187
- object-fit: cover;
2188
- border: 1px solid var(--pluno-pa-divider);
2189
- border-radius: 8px;
2312
+ border: 2px solid var(--pluno-pa-share-rule);
2313
+ border-radius: 18px 15px 17px 13px / 14px 18px 13px 17px;
2190
2314
  background: var(--pluno-pa-surface);
2191
2315
  }
2192
- .pluno-pa-widget__share-dialog-fields {
2193
- min-height: 0;
2194
- display: grid;
2195
- gap: 10px;
2196
- overflow: auto;
2197
- }
2198
- .pluno-pa-widget__share-dialog-field {
2199
- display: grid;
2200
- gap: 6px;
2201
- min-width: 0;
2316
+ .pluno-pa-widget__share-dialog-screenshot img {
2317
+ width: 100%;
2318
+ height: 100%;
2319
+ display: block;
2320
+ object-fit: contain;
2321
+ filter: saturate(0.94) contrast(1.02);
2322
+ background: #0f0f10;
2202
2323
  }
2203
- .pluno-pa-widget__share-dialog-field span {
2204
- color: var(--pluno-pa-muted);
2205
- font-size: 12px;
2206
- font-weight: 650;
2207
- line-height: 1.2;
2324
+ .pluno-pa-widget__share-dialog-step {
2325
+ display: flex;
2326
+ flex-direction: column;
2327
+ gap: 8px;
2208
2328
  }
2209
- .pluno-pa-widget__share-dialog-field textarea {
2210
- width: 100%;
2211
- resize: vertical;
2212
- min-height: 96px;
2213
- max-height: 220px;
2214
- border: 1px solid var(--pluno-pa-divider);
2215
- border-radius: 8px;
2216
- background: var(--pluno-pa-surface);
2217
- color: var(--pluno-pa-text);
2218
- padding: 9px 10px;
2219
- font-size: 13px;
2220
- line-height: 1.45;
2221
- outline: none;
2329
+ .pluno-pa-widget__share-dialog-step-header {
2330
+ display: flex;
2331
+ align-items: center;
2332
+ justify-content: space-between;
2333
+ gap: 10px;
2222
2334
  }
2223
- .pluno-pa-widget__share-dialog-field textarea:focus {
2224
- border-color: var(--pluno-pa-accent);
2335
+ .pluno-pa-widget__share-dialog-step-header strong,
2336
+ .pluno-pa-widget__share-dialog-step-title {
2337
+ color: var(--pluno-pa-share-ink);
2338
+ font-size: 15px;
2339
+ font-weight: 750;
2340
+ line-height: 1.2;
2225
2341
  }
2226
2342
  .pluno-pa-widget__share-dialog-status {
2227
2343
  min-height: 16px;
2228
2344
  margin: -2px 0 0;
2229
- color: var(--pluno-pa-muted);
2345
+ color: var(--pluno-pa-share-muted);
2230
2346
  font-size: 12px;
2231
2347
  line-height: 1.3;
2232
2348
  }
2233
2349
  .pluno-pa-widget__share-dialog-status[hidden] {
2234
2350
  display: none;
2235
2351
  }
2236
- .pluno-pa-widget__share-dialog footer {
2237
- justify-content: flex-end;
2352
+ .pluno-pa-widget__share-dialog-copy {
2353
+ display: inline-flex;
2354
+ align-items: center;
2355
+ justify-content: center;
2356
+ min-height: 31px;
2357
+ border: 2px solid var(--pluno-pa-share-ink);
2358
+ border-radius: 41% 59% 44% 56% / 57% 43% 58% 42%;
2359
+ background: var(--pluno-pa-share-paper);
2360
+ color: var(--pluno-pa-share-ink);
2361
+ padding: 5px 10px;
2362
+ font-size: 13px;
2363
+ font-weight: 700;
2364
+ line-height: 1;
2365
+ transform: rotate(1deg);
2366
+ transition: opacity 120ms ease, transform 120ms ease;
2367
+ cursor: pointer;
2368
+ }
2369
+ .pluno-pa-widget__share-dialog-copy:hover {
2370
+ transform: translateY(0) rotate(-1deg);
2238
2371
  }
2239
- .pluno-pa-widget__share-dialog footer button {
2372
+ .pluno-pa-widget__share-dialog-platforms {
2373
+ display: grid;
2374
+ grid-template-columns: repeat(3, minmax(0, 1fr));
2375
+ gap: 10px;
2376
+ padding-inline: 10px;
2377
+ }
2378
+ .pluno-pa-widget__share-dialog-platforms a {
2379
+ display: inline-flex;
2380
+ align-items: center;
2381
+ justify-content: center;
2382
+ width: 100%;
2383
+ min-height: 44px;
2384
+ border: 2px solid var(--pluno-pa-share-ink);
2385
+ border-radius: 47% 53% 45% 55% / 55% 45% 54% 46%;
2386
+ background: var(--pluno-pa-share-highlight);
2387
+ color: var(--pluno-pa-share-ink);
2388
+ font-size: 16px;
2389
+ font-weight: 800;
2390
+ text-decoration: none;
2391
+ transform: rotate(-1.5deg);
2392
+ }
2393
+ .pluno-pa-widget__share-dialog-platform-logo {
2394
+ width: 24px;
2395
+ height: 24px;
2396
+ display: block;
2397
+ overflow: visible;
2398
+ fill: none;
2399
+ stroke: currentColor;
2400
+ stroke-linecap: round;
2401
+ stroke-linejoin: round;
2402
+ stroke-width: 2.2;
2403
+ }
2404
+ .pluno-pa-widget__share-dialog-platforms a:nth-child(even) {
2405
+ transform: rotate(1.5deg);
2406
+ }
2407
+ .pluno-pa-widget__share-dialog-platforms a:hover {
2408
+ background: var(--pluno-pa-share-paper);
2409
+ color: var(--pluno-pa-accent);
2410
+ }
2411
+ .pluno-pa-widget__share-dialog-reward-link {
2412
+ display: inline-flex;
2413
+ align-self: flex-start;
2414
+ align-items: center;
2415
+ justify-content: center;
2416
+ gap: 5px;
2240
2417
  min-height: 34px;
2241
- border: 0;
2242
- border-radius: 8px;
2243
- background: var(--pluno-pa-text);
2244
- color: var(--pluno-pa-bg);
2245
- padding: 0 12px;
2246
- font-size: 12px;
2247
- font-weight: 650;
2248
- cursor: pointer;
2418
+ border: 2px solid var(--pluno-pa-share-ink);
2419
+ border-radius: 43% 57% 45% 55% / 56% 44% 57% 43%;
2420
+ background: var(--pluno-pa-share-highlight);
2421
+ color: var(--pluno-pa-share-ink);
2422
+ padding: 6px 12px;
2423
+ font-size: 13px;
2424
+ font-weight: 800;
2425
+ line-height: 1;
2426
+ text-decoration: none;
2427
+ transform: rotate(0.8deg);
2428
+ }
2429
+ .pluno-pa-widget__share-dialog-external-icon {
2430
+ width: 13px;
2431
+ height: 13px;
2432
+ display: block;
2433
+ fill: none;
2434
+ stroke: currentColor;
2435
+ stroke-linecap: round;
2436
+ stroke-linejoin: round;
2437
+ stroke-width: 2.25;
2438
+ }
2439
+ .pluno-pa-widget__share-dialog-reward-link:hover {
2440
+ background: var(--pluno-pa-share-paper);
2441
+ color: var(--pluno-pa-accent);
2442
+ transform: rotate(-0.8deg);
2249
2443
  }
2250
2444
  .pluno-pa-widget__composer {
2251
2445
  flex: 0 0 auto;
@@ -2411,6 +2605,7 @@ function Xe(t, e) {
2411
2605
  display: flex;
2412
2606
  align-items: center;
2413
2607
  justify-content: center;
2608
+ column-gap: 0.35em;
2414
2609
  margin-top: 8px;
2415
2610
  color: var(--pluno-pa-faint);
2416
2611
  font: inherit;
@@ -2427,10 +2622,6 @@ function Xe(t, e) {
2427
2622
  .pluno-pa-widget__powered-by:hover {
2428
2623
  color: var(--pluno-pa-muted);
2429
2624
  }
2430
- .pluno-pa-widget__composer-separator {
2431
- margin: 0 5px;
2432
- color: inherit;
2433
- }
2434
2625
  .pluno-pa-widget__ai-disclaimer {
2435
2626
  color: inherit;
2436
2627
  }
@@ -2616,7 +2807,7 @@ function Xe(t, e) {
2616
2807
  right: 16px;
2617
2808
  height: 36px;
2618
2809
  z-index: 3;
2619
- background-image: url('${Re}');
2810
+ background-image: url('${Oe}');
2620
2811
  background-repeat: repeat-x;
2621
2812
  background-size: 104px 36px;
2622
2813
  filter: url(#pluno-pa-scribble-wobble-2);
@@ -2717,7 +2908,7 @@ function Xe(t, e) {
2717
2908
  .pluno-pa-widget--scribble .pluno-pa-widget__message-copy::before,
2718
2909
  .pluno-pa-widget--scribble .pluno-pa-widget__close::before,
2719
2910
  .pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-body::before,
2720
- .pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button::before {
2911
+ .pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button:not(.pluno-pa-widget__share-prompt-disable)::before {
2721
2912
  content: "";
2722
2913
  position: absolute;
2723
2914
  inset: -2px;
@@ -2741,7 +2932,7 @@ function Xe(t, e) {
2741
2932
  .pluno-pa-widget--scribble .pluno-pa-widget__new-chat::before,
2742
2933
  .pluno-pa-widget--scribble .pluno-pa-widget__message-copy::before,
2743
2934
  .pluno-pa-widget--scribble .pluno-pa-widget__close::before,
2744
- .pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button::before {
2935
+ .pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button:not(.pluno-pa-widget__share-prompt-disable)::before {
2745
2936
  background: var(--pluno-pa-bg);
2746
2937
  }
2747
2938
  .pluno-pa-widget--scribble .pluno-pa-widget__composer-inner:focus-within {
@@ -2754,14 +2945,14 @@ function Xe(t, e) {
2754
2945
  .pluno-pa-widget--scribble .pluno-pa-widget__new-chat,
2755
2946
  .pluno-pa-widget--scribble .pluno-pa-widget__message-copy,
2756
2947
  .pluno-pa-widget--scribble .pluno-pa-widget__close,
2757
- .pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button {
2948
+ .pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button:not(.pluno-pa-widget__share-prompt-disable) {
2758
2949
  border-radius: 43% 57% 39% 61% / 59% 41% 58% 42%;
2759
2950
  }
2760
2951
  .pluno-pa-widget--scribble .pluno-pa-widget__send::after,
2761
2952
  .pluno-pa-widget--scribble .pluno-pa-widget__new-chat::after,
2762
2953
  .pluno-pa-widget--scribble .pluno-pa-widget__message-copy::after,
2763
2954
  .pluno-pa-widget--scribble .pluno-pa-widget__close::after,
2764
- .pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button::after {
2955
+ .pluno-pa-widget--scribble .pluno-pa-widget__share-prompt-actions button:not(.pluno-pa-widget__share-prompt-disable)::after {
2765
2956
  content: "";
2766
2957
  position: absolute;
2767
2958
  inset: -3px;
@@ -2771,7 +2962,7 @@ function Xe(t, e) {
2771
2962
  filter: url(#pluno-pa-scribble-wobble-2);
2772
2963
  pointer-events: none;
2773
2964
  opacity: 0.6;
2774
- transform: rotate(12deg);
2965
+ transform: rotate(5deg);
2775
2966
  }
2776
2967
  .pluno-pa-widget--scribble .pluno-pa-widget__new-chat::after {
2777
2968
  transform: rotate(-10deg);
@@ -2838,7 +3029,7 @@ function Xe(t, e) {
2838
3029
  right: 12px;
2839
3030
  height: 22px;
2840
3031
  z-index: 1;
2841
- background-image: url('${Re}');
3032
+ background-image: url('${Oe}');
2842
3033
  background-repeat: repeat-x;
2843
3034
  background-size: 62px 21.5px;
2844
3035
  filter: url(#pluno-pa-scribble-wobble-2);
@@ -2852,7 +3043,7 @@ function Xe(t, e) {
2852
3043
  }
2853
3044
  `, t.appendChild(n);
2854
3045
  }
2855
- async function Un() {
3046
+ async function Xn() {
2856
3047
  return document.body ? document.body : await new Promise((t) => {
2857
3048
  const e = new MutationObserver(() => {
2858
3049
  document.body && (e.disconnect(), t(document.body));
@@ -2860,61 +3051,93 @@ async function Un() {
2860
3051
  e.observe(document.documentElement, { childList: !0 });
2861
3052
  });
2862
3053
  }
2863
- function ut(t) {
3054
+ function ht(t) {
2864
3055
  return `pluno.productAgent.widgetState.${location.origin}.${t.backendUrl ?? ""}.${t.tokenEndpoint ?? ""}.${t.position ?? ""}`;
2865
3056
  }
2866
- function Wn(t) {
3057
+ function Zn(t) {
2867
3058
  try {
2868
- const e = window.localStorage.getItem(ut(t));
3059
+ const e = window.localStorage.getItem(ht(t));
2869
3060
  if (!e)
2870
- return { isOpen: !1, composerValue: "", openToolGroupKeys: [], launcherPosition: null, seenShareCandidateIds: [] };
3061
+ return Ze();
2871
3062
  const n = JSON.parse(e);
2872
3063
  return {
2873
3064
  isOpen: n.isOpen === !0,
2874
3065
  composerValue: typeof n.composerValue == "string" ? n.composerValue : "",
2875
3066
  openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter((o) => typeof o == "string") : [],
2876
- launcherPosition: Vn(n.launcherPosition) ? n.launcherPosition : null,
2877
- seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-nt) : []
3067
+ launcherPosition: to(n.launcherPosition) ? n.launcherPosition : null,
3068
+ seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-ot) : [],
3069
+ sharePromptsDisabled: n.sharePromptsDisabled === !0
2878
3070
  };
2879
3071
  } catch {
2880
- return { isOpen: !1, composerValue: "", openToolGroupKeys: [], launcherPosition: null, seenShareCandidateIds: [] };
3072
+ return Ze();
2881
3073
  }
2882
3074
  }
2883
- function Hn(t, e) {
3075
+ async function Jn(t) {
3076
+ if (t.loadSharePromptsDisabled)
3077
+ return t.loadSharePromptsDisabled();
2884
3078
  try {
2885
- window.localStorage.setItem(ut(t), JSON.stringify(e));
3079
+ return window.localStorage.getItem(at) === "true";
3080
+ } catch {
3081
+ return !1;
3082
+ }
3083
+ }
3084
+ function Qn(t, e) {
3085
+ if (t.persistSharePromptsDisabled) {
3086
+ Promise.resolve(t.persistSharePromptsDisabled(e)).catch(() => {
3087
+ });
3088
+ return;
3089
+ }
3090
+ try {
3091
+ e && window.localStorage.setItem(at, "true");
2886
3092
  } catch {
2887
3093
  return;
2888
3094
  }
2889
3095
  }
2890
- function Vn(t) {
3096
+ function Ze() {
3097
+ return {
3098
+ isOpen: !1,
3099
+ composerValue: "",
3100
+ openToolGroupKeys: [],
3101
+ launcherPosition: null,
3102
+ seenShareCandidateIds: [],
3103
+ sharePromptsDisabled: !1
3104
+ };
3105
+ }
3106
+ function eo(t, e) {
3107
+ try {
3108
+ window.localStorage.setItem(ht(t), JSON.stringify(e));
3109
+ } catch {
3110
+ return;
3111
+ }
3112
+ }
3113
+ function to(t) {
2891
3114
  if (!t || typeof t != "object")
2892
3115
  return !1;
2893
3116
  const e = t;
2894
3117
  return Number.isFinite(e.x) && Number.isFinite(e.y);
2895
3118
  }
2896
- const Ze = /* @__PURE__ */ new WeakSet();
2897
- function qn(t) {
3119
+ const Je = /* @__PURE__ */ new WeakSet();
3120
+ function no(t) {
2898
3121
  return Object.keys(t.dataset).some((e) => e.startsWith("pluno"));
2899
3122
  }
2900
- function Je(t) {
3123
+ function Qe(t) {
2901
3124
  const e = t.pathname.split("/");
2902
3125
  return e[e.length - 1] ?? "";
2903
3126
  }
2904
- function jn(t, e) {
3127
+ function oo(t, e) {
2905
3128
  const n = new URL(t.src, document.baseURI);
2906
- return n.href === e.href || n.pathname === e.pathname ? !0 : Je(n) === Je(e);
3129
+ return n.href === e.href || n.pathname === e.pathname ? !0 : Qe(n) === Qe(e);
2907
3130
  }
2908
3131
  class R extends EventTarget {
2909
3132
  constructor(e, n) {
2910
- super(), this.channelId = n, this.url = e, this.addPreviewListener(Ot, () => {
3133
+ super(), this.channelId = n, this.url = e, this.addPreviewListener(Gt, () => {
2911
3134
  this.readyState = R.OPEN, this.dispatchEvent(new Event("open"));
2912
- }), this.addPreviewListener(Ft, (o) => {
3135
+ }), this.addPreviewListener($t, (o) => {
2913
3136
  const a = o;
2914
3137
  this.dispatchEvent(new MessageEvent("message", { data: a.detail?.data ?? "" }));
2915
- }), this.addPreviewListener(zt, () => {
3138
+ }), this.addPreviewListener(Ut, () => {
2916
3139
  this.readyState = R.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
2917
- }), this.addPreviewListener(Bt, (o) => {
3140
+ }), this.addPreviewListener(Wt, (o) => {
2918
3141
  const a = o;
2919
3142
  this.readyState = R.CLOSED, this.dispatchEvent(
2920
3143
  new CloseEvent("close", {
@@ -2924,7 +3147,7 @@ class R extends EventTarget {
2924
3147
  })
2925
3148
  ), this.cleanup();
2926
3149
  }), window.dispatchEvent(
2927
- new CustomEvent(oe(It, this.channelId), {
3150
+ new CustomEvent(re(Ft, this.channelId), {
2928
3151
  detail: { socketId: this.socketId, url: e }
2929
3152
  })
2930
3153
  );
@@ -2940,27 +3163,27 @@ class R extends EventTarget {
2940
3163
  binaryType = "blob";
2941
3164
  bufferedAmount = 0;
2942
3165
  readyState = R.CONNECTING;
2943
- socketId = Kn();
3166
+ socketId = ao();
2944
3167
  listeners = /* @__PURE__ */ new Map();
2945
3168
  send(e) {
2946
3169
  if (this.readyState !== R.OPEN)
2947
3170
  throw new DOMException("Pluno preview websocket is not open", "InvalidStateError");
2948
3171
  window.dispatchEvent(
2949
- new CustomEvent(oe(Rt, this.channelId), {
3172
+ new CustomEvent(re(Bt, this.channelId), {
2950
3173
  detail: { socketId: this.socketId, data: typeof e == "string" ? e : String(e) }
2951
3174
  })
2952
3175
  );
2953
3176
  }
2954
3177
  close(e, n) {
2955
3178
  this.readyState !== R.CLOSED && (this.readyState = R.CLOSING, window.dispatchEvent(
2956
- new CustomEvent(oe(Mt, this.channelId), {
3179
+ new CustomEvent(re(zt, this.channelId), {
2957
3180
  detail: { socketId: this.socketId, code: e, reason: n }
2958
3181
  })
2959
3182
  ), this.cleanup());
2960
3183
  }
2961
3184
  addPreviewListener(e, n) {
2962
- const o = oe(e, this.channelId), a = (i) => {
2963
- i.detail?.socketId === this.socketId && n(i);
3185
+ const o = re(e, this.channelId), a = (r) => {
3186
+ r.detail?.socketId === this.socketId && n(r);
2964
3187
  };
2965
3188
  this.listeners.set(o, a), window.addEventListener(o, a);
2966
3189
  }
@@ -2970,36 +3193,36 @@ class R extends EventTarget {
2970
3193
  this.listeners.clear();
2971
3194
  }
2972
3195
  }
2973
- function Kn() {
2974
- const t = window.sessionStorage.getItem(Ie);
3196
+ function ao() {
3197
+ const t = window.sessionStorage.getItem(Re);
2975
3198
  if (t)
2976
3199
  return t;
2977
3200
  const e = crypto.randomUUID();
2978
- return window.sessionStorage.setItem(Ie, e), e;
3201
+ return window.sessionStorage.setItem(Re, e), e;
2979
3202
  }
2980
- function oe(t, e) {
3203
+ function re(t, e) {
2981
3204
  return `${t}:${e}`;
2982
3205
  }
2983
- function Yn(t) {
3206
+ function ro(t) {
2984
3207
  const e = document.currentScript;
2985
3208
  if (e instanceof HTMLScriptElement)
2986
3209
  return [e];
2987
3210
  const n = new URL(t, document.baseURI).href, o = new URL(n);
2988
3211
  return Array.from(document.querySelectorAll("script[type='module'][src]")).filter(
2989
- (a) => a instanceof HTMLScriptElement && qn(a) && jn(a, o)
3212
+ (a) => a instanceof HTMLScriptElement && no(a) && oo(a, o)
2990
3213
  );
2991
3214
  }
2992
- function Xn(t) {
2993
- for (const e of Yn(t)) {
2994
- if (Ze.has(e) || e.dataset.plunoAutoMount === "false")
3215
+ function io(t) {
3216
+ for (const e of ro(t)) {
3217
+ if (Je.has(e) || e.dataset.plunoAutoMount === "false")
2995
3218
  continue;
2996
- Ze.add(e);
3219
+ Je.add(e);
2997
3220
  const n = e.dataset.plunoPreviewChannel;
2998
- tn({
3221
+ rn({
2999
3222
  token: e.dataset.plunoToken,
3000
3223
  tokenEndpoint: e.dataset.plunoTokenEndpoint,
3001
3224
  backendUrl: e.dataset.plunoBackendUrl,
3002
- webSocketFactory: n ? en(n) : void 0,
3225
+ webSocketFactory: n ? an(n) : void 0,
3003
3226
  launcherLabel: e.dataset.plunoLauncherLabel,
3004
3227
  accentColor: e.dataset.plunoAccentColor,
3005
3228
  colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
@@ -3011,8 +3234,8 @@ function Xn(t) {
3011
3234
  });
3012
3235
  }
3013
3236
  }
3014
- Xn(import.meta.url);
3237
+ io(import.meta.url);
3015
3238
  export {
3016
- en as createProductAgentPreviewBridgeWebSocketFactory,
3017
- tn as mountPlunoProductAgentWidget
3239
+ an as createProductAgentPreviewBridgeWebSocketFactory,
3240
+ rn as mountPlunoProductAgentWidget
3018
3241
  };