@pluno/product-agent-web 0.1.72 → 0.1.74
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/product-agent-sdk.js +6 -1
- package/dist/product-agent-widget.js +1119 -1072
- package/dist/widget.d.ts +9 -0
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { PlunoProductAgent as Jo, getProductAgentOriginAccessErrorMessage as Qo } from "./product-agent-sdk.js";
|
|
2
|
-
const ei = "#7c3aed",
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
2
|
+
const ei = "#7c3aed", ut = "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", gt = "#2c2a1e", Cn = [253, 250, 241], Sn = 3.5;
|
|
3
|
+
function no(e) {
|
|
4
|
+
const t = oo(e);
|
|
5
|
+
if (En(Ze(t), Cn) >= Sn)
|
|
6
6
|
return t;
|
|
7
|
-
let o =
|
|
8
|
-
const i =
|
|
9
|
-
for (let
|
|
10
|
-
if (o = oi(o, i, 0.22),
|
|
11
|
-
return
|
|
12
|
-
return
|
|
7
|
+
let o = Ze(t);
|
|
8
|
+
const i = Ze(gt);
|
|
9
|
+
for (let r = 0; r < 6; r += 1)
|
|
10
|
+
if (o = oi(o, i, 0.22), En(o, Cn) >= Sn)
|
|
11
|
+
return jt(o);
|
|
12
|
+
return jt(o);
|
|
13
13
|
}
|
|
14
14
|
function ti() {
|
|
15
15
|
let n = "M 280 120", o = !1, i = 0;
|
|
16
|
-
for (let
|
|
16
|
+
for (let r = 150; r <= 1170; r += 62) {
|
|
17
17
|
const l = (i % 3 - 1) * 18, p = o ? 280 - l : 1020 + l;
|
|
18
|
-
n += ` L ${p} ${
|
|
18
|
+
n += ` L ${p} ${r}`, o = !o, i += 1;
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
22
|
function ni(e) {
|
|
23
|
-
const t =
|
|
23
|
+
const t = oo(e), n = Vt(Ze(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -44,90 +44,90 @@ function ni(e) {
|
|
|
44
44
|
inner: "#4b4b4b",
|
|
45
45
|
shadow: "#000000"
|
|
46
46
|
} : {
|
|
47
|
-
top:
|
|
48
|
-
middle:
|
|
49
|
-
bottom:
|
|
50
|
-
edgeStart:
|
|
51
|
-
edgeMiddle:
|
|
52
|
-
edgeEnd:
|
|
53
|
-
glow:
|
|
54
|
-
highlight:
|
|
55
|
-
inner:
|
|
56
|
-
shadow:
|
|
47
|
+
top: oe(t, 0.28, -0.03),
|
|
48
|
+
middle: oe(t, 0.08, 0.04),
|
|
49
|
+
bottom: oe(t, -0.1, 0.02),
|
|
50
|
+
edgeStart: oe(t, 0.08, 0.08),
|
|
51
|
+
edgeMiddle: oe(t, -0.08, 0.08),
|
|
52
|
+
edgeEnd: oe(t, -0.18, 0.05),
|
|
53
|
+
glow: oe(t, 0.32, -0.12),
|
|
54
|
+
highlight: oe(t, 0.38, -0.18),
|
|
55
|
+
inner: oe(t, 0.24, -0.1),
|
|
56
|
+
shadow: oe(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function oo(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
61
|
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : ei;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
63
|
+
function Ze(e) {
|
|
64
64
|
return [
|
|
65
65
|
Number.parseInt(e.slice(1, 3), 16),
|
|
66
66
|
Number.parseInt(e.slice(3, 5), 16),
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function jt([e, t, n]) {
|
|
71
71
|
const o = (i) => Math.max(0, Math.min(255, Math.round(i))).toString(16).padStart(2, "0");
|
|
72
72
|
return `#${o(e)}${o(t)}${o(n)}`;
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function Vt([e, t, n]) {
|
|
75
75
|
const o = (i) => {
|
|
76
|
-
const
|
|
77
|
-
return
|
|
76
|
+
const r = i / 255;
|
|
77
|
+
return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
78
78
|
};
|
|
79
79
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const n =
|
|
83
|
-
return (i + 0.05) / (
|
|
81
|
+
function En(e, t) {
|
|
82
|
+
const n = Vt(e), o = Vt(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
|
+
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
85
|
function oi(e, t, n) {
|
|
86
|
-
const o =
|
|
86
|
+
const o = Kt(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
89
89
|
e[1] + (t[1] - e[1]) * o,
|
|
90
90
|
e[2] + (t[2] - e[2]) * o
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
|
-
function
|
|
94
|
-
const [o, i,
|
|
95
|
-
return
|
|
93
|
+
function oe(e, t, n) {
|
|
94
|
+
const [o, i, r] = ii(Ze(e));
|
|
95
|
+
return jt(ai(o, Kt(i + n), Kt(r + t)));
|
|
96
96
|
}
|
|
97
97
|
function ii([e, t, n]) {
|
|
98
|
-
const o = e / 255, i = t / 255,
|
|
98
|
+
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), p = Math.min(o, i, r), d = (l + p) / 2;
|
|
99
99
|
if (l === p)
|
|
100
100
|
return [0, 0, d];
|
|
101
101
|
const c = l - p, u = d > 0.5 ? c / (2 - l - p) : c / (l + p);
|
|
102
|
-
return [(l === o ? (i -
|
|
102
|
+
return [(l === o ? (i - r) / c + (i < r ? 6 : 0) : l === i ? (r - o) / c + 2 : (o - i) / c + 4) / 6, u, d];
|
|
103
103
|
}
|
|
104
104
|
function ai(e, t, n) {
|
|
105
105
|
if (t === 0)
|
|
106
106
|
return [n * 255, n * 255, n * 255];
|
|
107
107
|
const o = n < 0.5 ? n * (1 + t) : n + t - n * t, i = 2 * n - o;
|
|
108
108
|
return [
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
zt(i, o, e + 1 / 3) * 255,
|
|
110
|
+
zt(i, o, e) * 255,
|
|
111
|
+
zt(i, o, e - 1 / 3) * 255
|
|
112
112
|
];
|
|
113
113
|
}
|
|
114
|
-
function
|
|
114
|
+
function zt(e, t, n) {
|
|
115
115
|
let o = n;
|
|
116
116
|
return o < 0 && (o += 1), o > 1 && (o -= 1), o < 1 / 6 ? e + (t - e) * 6 * o : o < 1 / 2 ? t : o < 2 / 3 ? e + (t - e) * (2 / 3 - o) * 6 : e;
|
|
117
117
|
}
|
|
118
|
-
function
|
|
118
|
+
function Kt(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
121
|
+
const io = "suggest_share_on_socials";
|
|
122
122
|
function ri(e) {
|
|
123
123
|
for (let t = e.length - 1; t >= 0; t -= 1) {
|
|
124
124
|
const n = e[t];
|
|
125
|
-
if (n.role !== "tool" || n.toolName !==
|
|
125
|
+
if (n.role !== "tool" || n.toolName !== io)
|
|
126
126
|
continue;
|
|
127
|
-
const o =
|
|
127
|
+
const o = kn(e, t, "assistant");
|
|
128
128
|
if (!o)
|
|
129
129
|
return null;
|
|
130
|
-
const i =
|
|
130
|
+
const i = kn(e, o.index, "user");
|
|
131
131
|
return i ? {
|
|
132
132
|
id: `share:${n.callId ?? n.id}`,
|
|
133
133
|
userPrompt: i.content,
|
|
@@ -142,7 +142,7 @@ async function li(e) {
|
|
|
142
142
|
throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
|
|
143
143
|
await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
145
|
+
function kn(e, t, n) {
|
|
146
146
|
for (let o = t - 1; o >= 0; o -= 1) {
|
|
147
147
|
const i = e[o];
|
|
148
148
|
if (i.role === n && i.content.trim())
|
|
@@ -155,9 +155,9 @@ async function pi(e) {
|
|
|
155
155
|
}
|
|
156
156
|
const si = "https://app.pluno.ai", di = "/api/product-agent/embed/active-users", ci = 1800, ui = 15e3, gi = 250, hi = 1e3, mi = 3e4;
|
|
157
157
|
function fi(e, t = {}) {
|
|
158
|
-
let n = !1, o = null, i = null,
|
|
158
|
+
let n = !1, o = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
|
-
|
|
160
|
+
r !== null && (window.clearInterval(r), r = null);
|
|
161
161
|
}, p = (u) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
163
|
c();
|
|
@@ -168,7 +168,7 @@ function fi(e, t = {}) {
|
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
170
|
const m = o, k = performance.now();
|
|
171
|
-
|
|
171
|
+
r = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
@@ -199,12 +199,12 @@ async function wi(e) {
|
|
|
199
199
|
});
|
|
200
200
|
if (!n.ok)
|
|
201
201
|
throw new Error("Failed to load active users");
|
|
202
|
-
const o = await n.json(), i =
|
|
203
|
-
if (i === null ||
|
|
202
|
+
const o = await n.json(), i = Ln(o.count), r = Ln(o.refreshAfterMs ?? o.refresh_after_ms);
|
|
203
|
+
if (i === null || r === null)
|
|
204
204
|
throw new Error("Invalid active users response");
|
|
205
|
-
return { count: i, refreshAfterMs:
|
|
205
|
+
return { count: i, refreshAfterMs: r };
|
|
206
206
|
}
|
|
207
|
-
function
|
|
207
|
+
function Ln(e) {
|
|
208
208
|
return typeof e != "number" || !Number.isFinite(e) || e < 0 ? null : Math.round(e);
|
|
209
209
|
}
|
|
210
210
|
function bi(e) {
|
|
@@ -216,7 +216,7 @@ function _i(e) {
|
|
|
216
216
|
function xi(e) {
|
|
217
217
|
return e < 0.5 ? 4 * e * e * e : 1 - Math.pow(-2 * e + 2, 3) / 2;
|
|
218
218
|
}
|
|
219
|
-
const
|
|
219
|
+
const ao = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-connect", Si = "product-agent:sdk-preview-socket-send", Ei = "product-agent:sdk-preview-socket-close", ki = "product-agent:sdk-preview-socket-open", Li = "product-agent:sdk-preview-socket-message", Ii = "product-agent:sdk-preview-socket-error", Pi = "product-agent:sdk-preview-socket-closed", In = "product-agent:sdk-preview-socket-id", Ti = "data-pluno-sdk-preview-channel", ro = "data-pluno-auto-mounted", ce = "__plunoProductAgentAutoMountOwner", Ai = 1e4, Ni = "Failed to load Pluno widget token", Pn = "Timed out loading Pluno widget token", Ri = "pluno.productAgent.widgetClientId.", Mt = /* @__PURE__ */ new Set(), Di = "product-agent:preview-diagnostic", lo = "pluno.productAgent.sharePromptsDisabled", zi = 3, Tn = 'dialog[open], [aria-modal="true"], [role="dialog"]', Mi = 400, Oi = 5e3, Ui = 500, An = "Close the page's popup to chat", Bi = "No recent chats for this page yet.", ie = {
|
|
220
220
|
launcherLabel: "Ask for anything...",
|
|
221
221
|
accentColor: "#7c3aed",
|
|
222
222
|
colorScheme: "light",
|
|
@@ -224,7 +224,7 @@ const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-conne
|
|
|
224
224
|
scribbleStyle: !0,
|
|
225
225
|
position: "bottom-right",
|
|
226
226
|
movableLauncher: !1
|
|
227
|
-
}, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive',
|
|
227
|
+
}, Fi = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', Nn = "pluno-pa-scribble-font", po = 190, so = 41, Rn = 22, Hi = 16, Wi = 24, Gi = 1, $i = 48, an = 420, qi = 520, ji = 0.24, rn = 680, Vi = 800, Ki = 0.76, T = 8, Le = 50, co = "http://www.w3.org/2000/svg", Yt = 26, Xt = 8, Yi = 36, Zt = 16, Xi = 4, Dn = [
|
|
228
228
|
{
|
|
229
229
|
ellipseCx: "17.5",
|
|
230
230
|
ellipseCy: "24.5",
|
|
@@ -261,20 +261,20 @@ const oo = 100, yi = 1e4, vi = 5e3, Ci = "product-agent:sdk-preview-socket-conne
|
|
|
261
261
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
262
262
|
pathStrokeWidth: "2.45"
|
|
263
263
|
}
|
|
264
|
-
], Zi = 11, Ji = 13,
|
|
265
|
-
let
|
|
264
|
+
], Zi = 11, Ji = 13, Jt = 4, uo = 10, go = 40, Qi = "movable-launcher-position-v2", ho = "pluno-pa-widget-styles", mo = "data-pluno-pa-widget-styles";
|
|
265
|
+
let zn = 0;
|
|
266
266
|
function ea(e) {
|
|
267
|
-
return (t) => new
|
|
267
|
+
return (t) => new ue(t, e);
|
|
268
268
|
}
|
|
269
269
|
async function ta(e = {}) {
|
|
270
270
|
const t = {
|
|
271
|
-
launcherLabel: e.launcherLabel ??
|
|
272
|
-
accentColor: e.accentColor ??
|
|
273
|
-
colorScheme: e.colorScheme ??
|
|
274
|
-
fontFamily: e.fontFamily ??
|
|
275
|
-
scribbleStyle: e.scribbleStyle ??
|
|
276
|
-
position: e.position ??
|
|
277
|
-
movableLauncher: e.movableLauncher ??
|
|
271
|
+
launcherLabel: e.launcherLabel ?? ie.launcherLabel,
|
|
272
|
+
accentColor: e.accentColor ?? ie.accentColor,
|
|
273
|
+
colorScheme: e.colorScheme ?? ie.colorScheme,
|
|
274
|
+
fontFamily: e.fontFamily ?? ie.fontFamily,
|
|
275
|
+
scribbleStyle: e.scribbleStyle ?? ie.scribbleStyle,
|
|
276
|
+
position: e.position ?? ie.position,
|
|
277
|
+
movableLauncher: e.movableLauncher ?? ie.movableLauncher,
|
|
278
278
|
token: e.token,
|
|
279
279
|
tokenProvider: e.tokenProvider,
|
|
280
280
|
tokenEndpoint: e.tokenEndpoint,
|
|
@@ -306,9 +306,12 @@ async function ta(e = {}) {
|
|
|
306
306
|
onDisplayStateChange: e.onDisplayStateChange,
|
|
307
307
|
onPanelOpenChange: e.onPanelOpenChange,
|
|
308
308
|
showLauncherMinimizeButton: e.showLauncherMinimizeButton === !0,
|
|
309
|
+
morningReport: e.morningReport ?? null,
|
|
310
|
+
onMorningReportSnooze: e.onMorningReportSnooze,
|
|
311
|
+
onMorningReportTaskStart: e.onMorningReportTaskStart,
|
|
309
312
|
taskNotifications: e.taskNotifications
|
|
310
313
|
};
|
|
311
|
-
|
|
314
|
+
ne(
|
|
312
315
|
"web-sdk.widget",
|
|
313
316
|
"Mounting widget with merged options",
|
|
314
317
|
{
|
|
@@ -330,27 +333,27 @@ async function ta(e = {}) {
|
|
|
330
333
|
);
|
|
331
334
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
332
335
|
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
333
|
-
let
|
|
336
|
+
let r = Mn(
|
|
334
337
|
t.accentColor,
|
|
335
338
|
t.scribbleStyle
|
|
336
339
|
);
|
|
337
340
|
Sa(
|
|
338
341
|
i,
|
|
339
342
|
t.launcherLabel,
|
|
340
|
-
|
|
343
|
+
r,
|
|
341
344
|
t.movableLauncher,
|
|
342
345
|
t.showLauncherMinimizeButton
|
|
343
346
|
), o.appendChild(i);
|
|
344
347
|
const l = yr(t);
|
|
345
348
|
let p = t.movableLauncher ? l.launcherPosition : null, d = p !== null, c = l.panelSize, u = null;
|
|
346
|
-
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"),
|
|
349
|
+
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), t.initialDisplayState === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), ke(
|
|
347
350
|
i,
|
|
348
|
-
|
|
351
|
+
Ut(
|
|
349
352
|
i,
|
|
350
353
|
p,
|
|
351
354
|
t.position
|
|
352
355
|
)
|
|
353
|
-
)),
|
|
356
|
+
)), Jn(o, t.accentColor), On(i, r, {
|
|
354
357
|
accentColor: t.accentColor,
|
|
355
358
|
colorScheme: t.colorScheme,
|
|
356
359
|
fontFamily: t.fontFamily,
|
|
@@ -358,96 +361,96 @@ async function ta(e = {}) {
|
|
|
358
361
|
});
|
|
359
362
|
const m = await _r(), k = m.ownerDocument, v = i.querySelector(
|
|
360
363
|
".pluno-pa-widget__launcher"
|
|
361
|
-
),
|
|
364
|
+
), R = i.querySelector(
|
|
362
365
|
".pluno-pa-widget__launcher-drag-handle"
|
|
363
|
-
),
|
|
366
|
+
), C = i.querySelector(
|
|
364
367
|
".pluno-pa-widget__launcher-input"
|
|
365
368
|
), g = i.querySelector(
|
|
366
369
|
".pluno-pa-widget__launcher-minimize"
|
|
367
|
-
),
|
|
370
|
+
), y = i.querySelector(".pluno-pa-widget__panel"), h = i.querySelector(
|
|
368
371
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
369
372
|
), A = Array.from(
|
|
370
373
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
371
|
-
),
|
|
374
|
+
), L = i.querySelector(
|
|
372
375
|
".pluno-pa-widget__close"
|
|
373
|
-
),
|
|
376
|
+
), M = i.querySelector(
|
|
374
377
|
".pluno-pa-widget__composer"
|
|
375
|
-
),
|
|
378
|
+
), U = i.querySelector(
|
|
376
379
|
".pluno-pa-widget__attachment-error"
|
|
377
|
-
),
|
|
380
|
+
), Ie = i.querySelector(
|
|
378
381
|
".pluno-pa-widget__billing-status"
|
|
379
|
-
),
|
|
382
|
+
), H = i.querySelector(
|
|
380
383
|
".pluno-pa-widget__attachments"
|
|
381
|
-
),
|
|
384
|
+
), xe = i.querySelector(
|
|
382
385
|
".pluno-pa-widget__attachment-input"
|
|
383
|
-
),
|
|
386
|
+
), G = i.querySelector(
|
|
384
387
|
".pluno-pa-widget__attach"
|
|
385
|
-
),
|
|
388
|
+
), w = i.querySelector(
|
|
386
389
|
".pluno-pa-widget__input"
|
|
387
|
-
),
|
|
390
|
+
), J = i.querySelector(
|
|
388
391
|
".pluno-pa-widget__send"
|
|
389
|
-
),
|
|
392
|
+
), Je = i.querySelector(
|
|
390
393
|
".pluno-pa-widget__top-actions"
|
|
391
|
-
),
|
|
394
|
+
), pe = i.querySelector(
|
|
392
395
|
".pluno-pa-widget__history"
|
|
393
|
-
),
|
|
396
|
+
), Qe = i.querySelector(
|
|
394
397
|
".pluno-pa-widget__history-panel"
|
|
395
|
-
),
|
|
398
|
+
), V = i.querySelector(
|
|
396
399
|
".pluno-pa-widget__history-list"
|
|
397
|
-
),
|
|
400
|
+
), ge = i.querySelector(
|
|
398
401
|
".pluno-pa-widget__history-close"
|
|
399
|
-
),
|
|
402
|
+
), x = i.querySelector(
|
|
400
403
|
".pluno-pa-widget__history-status"
|
|
401
|
-
),
|
|
404
|
+
), D = i.querySelector(
|
|
402
405
|
".pluno-pa-widget__timeline-jump"
|
|
403
|
-
),
|
|
406
|
+
), $ = i.querySelector(
|
|
404
407
|
".pluno-pa-widget__active-users-counter"
|
|
405
|
-
),
|
|
408
|
+
), P = i.querySelector(
|
|
406
409
|
".pluno-pa-widget__timeline"
|
|
407
|
-
),
|
|
410
|
+
), j = i.querySelector(
|
|
408
411
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
409
|
-
),
|
|
412
|
+
), S = i.querySelector(
|
|
410
413
|
".pluno-pa-widget__notify-suggestion"
|
|
411
|
-
),
|
|
414
|
+
), N = i.querySelector(
|
|
412
415
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
413
|
-
),
|
|
416
|
+
), Ro = i.querySelector(
|
|
414
417
|
".pluno-pa-widget__notify-suggestion-later"
|
|
415
418
|
), Do = i.querySelector(
|
|
416
419
|
".pluno-pa-widget__notify-suggestion-never"
|
|
417
420
|
);
|
|
418
|
-
if (!v || !
|
|
421
|
+
if (!v || !C || !y || !L || !M || !U || !Ie || !H || !xe || !G || !w || !J || !Je || !pe || !Qe || !V || !ge || !x || !D || !$ || !P || !j)
|
|
419
422
|
throw new Error("Failed to mount Pluno widget");
|
|
420
|
-
if (t.movableLauncher && !
|
|
423
|
+
if (t.movableLauncher && !R)
|
|
421
424
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
422
|
-
|
|
423
|
-
let
|
|
424
|
-
const
|
|
425
|
+
$n(C), $n(w);
|
|
426
|
+
let q = [], se = null;
|
|
427
|
+
const Pe = () => {
|
|
425
428
|
Ga(
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
(
|
|
429
|
-
|
|
430
|
-
(s,
|
|
431
|
-
),
|
|
429
|
+
H,
|
|
430
|
+
q,
|
|
431
|
+
(a) => {
|
|
432
|
+
q = q.filter(
|
|
433
|
+
(s, _) => _ !== a
|
|
434
|
+
), Pe(), F(b.getState()), K();
|
|
432
435
|
}
|
|
433
436
|
);
|
|
434
|
-
},
|
|
437
|
+
}, zo = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (async () => {
|
|
435
438
|
if (!t.tokenEndpoint)
|
|
436
439
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
437
|
-
return
|
|
438
|
-
}), Mo = window.fetch.bind(window),
|
|
439
|
-
let
|
|
440
|
+
return Ao(t.tokenEndpoint);
|
|
441
|
+
}), Mo = window.fetch.bind(window), bt = xr(t.clientId);
|
|
442
|
+
let b;
|
|
440
443
|
try {
|
|
441
|
-
const
|
|
444
|
+
const a = {
|
|
442
445
|
token: t.token,
|
|
443
|
-
tokenProvider:
|
|
446
|
+
tokenProvider: zo,
|
|
444
447
|
backendUrl: t.backendUrl,
|
|
445
448
|
metadata: () => ({
|
|
446
449
|
...t.metadata ?? {},
|
|
447
|
-
...!
|
|
450
|
+
...!b.getState().sessionId && t.scribbleStyle ? { scribbleStyleStarted: !0 } : {}
|
|
448
451
|
}),
|
|
449
452
|
initialStarterPrompts: t.initialStarterPrompts,
|
|
450
|
-
clientId:
|
|
453
|
+
clientId: bt.clientId,
|
|
451
454
|
restorePersistedState: t.restorePersistedState,
|
|
452
455
|
expectedPersistedSessionId: t.expectedPersistedSessionId,
|
|
453
456
|
webSocketFactory: t.webSocketFactory,
|
|
@@ -455,11 +458,11 @@ async function ta(e = {}) {
|
|
|
455
458
|
autoConnect: t.loginRequired || t.signupRequired ? !1 : void 0,
|
|
456
459
|
disableNetworkCapture: !!t.sdkPreviewChannelId
|
|
457
460
|
};
|
|
458
|
-
|
|
459
|
-
} catch (
|
|
460
|
-
throw
|
|
461
|
+
b = await Jo.init(a);
|
|
462
|
+
} catch (a) {
|
|
463
|
+
throw bt.release(), n.remove(), a;
|
|
461
464
|
}
|
|
462
|
-
m.appendChild(n),
|
|
465
|
+
m.appendChild(n), ne(
|
|
463
466
|
"web-sdk.widget",
|
|
464
467
|
"Applied initial widget appearance",
|
|
465
468
|
{
|
|
@@ -469,56 +472,56 @@ async function ta(e = {}) {
|
|
|
469
472
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
470
473
|
}
|
|
471
474
|
);
|
|
472
|
-
const
|
|
475
|
+
const _t = new Set(l.openToolGroupKeys), Te = new Set(
|
|
473
476
|
l.seenShareCandidateIds
|
|
474
|
-
),
|
|
475
|
-
let
|
|
477
|
+
), et = new Set(Te);
|
|
478
|
+
let xt = l.sharePromptsDisabled || await vr(t), Q = null, Ae = !1, he = !1, ye = {
|
|
476
479
|
enabled: !0
|
|
477
|
-
},
|
|
478
|
-
const
|
|
479
|
-
|
|
480
|
-
},
|
|
481
|
-
|
|
482
|
-
},
|
|
483
|
-
|
|
484
|
-
},
|
|
485
|
-
|
|
486
|
-
},
|
|
487
|
-
if (
|
|
480
|
+
}, ve = 0, sn = "", me = !1, de = !1, fe = [], yt = null, Be = null;
|
|
481
|
+
const ee = (a, s) => {
|
|
482
|
+
ye = { enabled: a, reason: s };
|
|
483
|
+
}, te = () => {
|
|
484
|
+
D.hidden = !0;
|
|
485
|
+
}, Oo = () => {
|
|
486
|
+
D.hidden = !1;
|
|
487
|
+
}, Uo = (a = "jump") => {
|
|
488
|
+
ee(!0, a), te(), Xe(P, () => ye.enabled), ve = P.scrollTop;
|
|
489
|
+
}, Ce = () => {
|
|
490
|
+
if (pe.hidden = t.loginRequired, Qe.hidden = !me, pe.setAttribute("aria-expanded", String(me)), V.classList.toggle(
|
|
488
491
|
"pluno-pa-widget__history-list--center",
|
|
489
|
-
|
|
490
|
-
),
|
|
491
|
-
const
|
|
492
|
-
|
|
492
|
+
de && fe.length === 0
|
|
493
|
+
), V.replaceChildren(), de && fe.length === 0) {
|
|
494
|
+
const a = document.createElement("p");
|
|
495
|
+
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", V.appendChild(a);
|
|
493
496
|
}
|
|
494
|
-
for (const
|
|
497
|
+
for (const a of fe) {
|
|
495
498
|
const s = document.createElement("button");
|
|
496
|
-
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled =
|
|
497
|
-
const
|
|
498
|
-
|
|
499
|
-
const
|
|
500
|
-
|
|
501
|
-
|
|
499
|
+
s.type = "button", s.className = "pluno-pa-widget__history-item", s.disabled = de;
|
|
500
|
+
const _ = document.createElement("span");
|
|
501
|
+
_.className = "pluno-pa-widget__history-item-title", _.textContent = ya(a);
|
|
502
|
+
const I = document.createElement("time");
|
|
503
|
+
I.className = "pluno-pa-widget__history-time", I.dateTime = a.lastActiveAt, I.textContent = Ca(
|
|
504
|
+
a.lastActiveAt,
|
|
502
505
|
Date.now()
|
|
503
506
|
);
|
|
504
|
-
const
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
}),
|
|
508
|
-
}
|
|
509
|
-
if (
|
|
510
|
-
const
|
|
511
|
-
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
},
|
|
515
|
-
if (!
|
|
516
|
-
|
|
507
|
+
const z = document.createElement("small");
|
|
508
|
+
z.className = "pluno-pa-widget__history-path", z.textContent = va(a), s.append(_, I, z), s.addEventListener("click", () => {
|
|
509
|
+
me = !1, Be = null, Ce(), ee(!0, "newSession"), te(), b.loadSession(a.id), F(b.getState());
|
|
510
|
+
}), V.appendChild(s);
|
|
511
|
+
}
|
|
512
|
+
if (de && fe.length > 0) {
|
|
513
|
+
const a = document.createElement("p");
|
|
514
|
+
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", V.appendChild(a);
|
|
515
|
+
}
|
|
516
|
+
x.textContent = Be ?? (!de && fe.length === 0 ? "No recent chats for this page yet." : ""), x.hidden = x.textContent.length === 0;
|
|
517
|
+
}, dn = async (a) => {
|
|
518
|
+
if (!de) {
|
|
519
|
+
de = !0, Be = null, Ce();
|
|
517
520
|
try {
|
|
518
|
-
const s = await
|
|
519
|
-
|
|
521
|
+
const s = await b.listSessions({ cursor: a, limit: 20 });
|
|
522
|
+
fe = a ? [...fe, ...s.sessions] : s.sessions, yt = s.nextCursor;
|
|
520
523
|
} catch (s) {
|
|
521
|
-
|
|
524
|
+
ne(
|
|
522
525
|
"web-sdk.widget",
|
|
523
526
|
"Failed to load session history",
|
|
524
527
|
{
|
|
@@ -526,23 +529,23 @@ async function ta(e = {}) {
|
|
|
526
529
|
}
|
|
527
530
|
), Be = Bi;
|
|
528
531
|
} finally {
|
|
529
|
-
|
|
532
|
+
de = !1, Ce();
|
|
530
533
|
}
|
|
531
534
|
}
|
|
532
|
-
},
|
|
533
|
-
!
|
|
534
|
-
},
|
|
535
|
-
|
|
536
|
-
},
|
|
537
|
-
|
|
535
|
+
}, Bo = () => {
|
|
536
|
+
!yt || de || V.scrollHeight - V.scrollTop - V.clientHeight <= 24 && dn(yt);
|
|
537
|
+
}, cn = () => {
|
|
538
|
+
Ae || typeof document > "u" || (Jn(o, t.accentColor), n.isConnected || k.body?.appendChild(n));
|
|
539
|
+
}, un = new MutationObserver(cn);
|
|
540
|
+
un.observe(k.documentElement, {
|
|
538
541
|
childList: !0,
|
|
539
542
|
subtree: !0
|
|
540
|
-
}),
|
|
541
|
-
const Fe = (
|
|
542
|
-
const s =
|
|
543
|
-
return
|
|
543
|
+
}), cn();
|
|
544
|
+
const Fe = (a = !0) => {
|
|
545
|
+
const s = ht(i, a);
|
|
546
|
+
return Qt(
|
|
544
547
|
i,
|
|
545
|
-
p ?
|
|
548
|
+
p ? fo(p, s) : sa(
|
|
546
549
|
i,
|
|
547
550
|
t.position,
|
|
548
551
|
s
|
|
@@ -550,37 +553,37 @@ async function ta(e = {}) {
|
|
|
550
553
|
s
|
|
551
554
|
);
|
|
552
555
|
}, B = () => {
|
|
553
|
-
const
|
|
556
|
+
const a = fa(o, C, w);
|
|
554
557
|
Sr(t, {
|
|
555
558
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
556
|
-
composerValue:
|
|
557
|
-
focusedInput:
|
|
558
|
-
focusedInputAt:
|
|
559
|
-
openToolGroupKeys: [...
|
|
559
|
+
composerValue: w.value,
|
|
560
|
+
focusedInput: a,
|
|
561
|
+
focusedInputAt: a ? Date.now() : null,
|
|
562
|
+
openToolGroupKeys: [..._t],
|
|
560
563
|
launcherPosition: d ? p : null,
|
|
561
564
|
panelSize: c,
|
|
562
|
-
seenShareCandidateIds: [...
|
|
563
|
-
-
|
|
565
|
+
seenShareCandidateIds: [...Te].slice(
|
|
566
|
+
-ao
|
|
564
567
|
),
|
|
565
|
-
sharePromptsDisabled:
|
|
568
|
+
sharePromptsDisabled: xt
|
|
566
569
|
});
|
|
567
|
-
},
|
|
568
|
-
t.onDisplayStateChange?.(
|
|
569
|
-
}, He = (
|
|
570
|
-
if (
|
|
571
|
-
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && We(!1), s &&
|
|
570
|
+
}, tt = (a) => {
|
|
571
|
+
t.onDisplayStateChange?.(a);
|
|
572
|
+
}, He = (a, s = !0) => {
|
|
573
|
+
if (a === "shown") {
|
|
574
|
+
i.classList.remove("pluno-pa-widget--minimized"), v.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && We(!1), s && tt("shown");
|
|
572
575
|
return;
|
|
573
576
|
}
|
|
574
|
-
|
|
577
|
+
Q !== null && (window.clearTimeout(Q), Q = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), v.hidden = !1, y.hidden = !0, L.hidden = !0, v.tabIndex = 0, w.value = "", ke(
|
|
575
578
|
i,
|
|
576
|
-
|
|
579
|
+
Ut(
|
|
577
580
|
i,
|
|
578
581
|
p,
|
|
579
582
|
t.position
|
|
580
583
|
)
|
|
581
|
-
),
|
|
582
|
-
},
|
|
583
|
-
ma(
|
|
584
|
+
), Hn(i), B(), s && tt("minimized");
|
|
585
|
+
}, Se = (a, s = {}) => {
|
|
586
|
+
ma(a, {
|
|
584
587
|
debugVersion: Qi,
|
|
585
588
|
launcherPosition: p,
|
|
586
589
|
rootClasses: i.className,
|
|
@@ -590,35 +593,35 @@ async function ta(e = {}) {
|
|
|
590
593
|
right: i.style.right,
|
|
591
594
|
bottom: i.style.bottom
|
|
592
595
|
},
|
|
593
|
-
rootRect:
|
|
594
|
-
launcherRect:
|
|
595
|
-
panelRect:
|
|
596
|
-
viewport:
|
|
597
|
-
panelHidden:
|
|
598
|
-
closeHidden:
|
|
596
|
+
rootRect: Ft(i),
|
|
597
|
+
launcherRect: Ft(v),
|
|
598
|
+
panelRect: Ft(y),
|
|
599
|
+
viewport: Z(),
|
|
600
|
+
panelHidden: y.hidden,
|
|
601
|
+
closeHidden: L.hidden,
|
|
599
602
|
...s
|
|
600
603
|
});
|
|
601
|
-
}, We = (
|
|
604
|
+
}, We = (a = !0) => {
|
|
602
605
|
if (!p)
|
|
603
|
-
return
|
|
604
|
-
const s = Fe(
|
|
605
|
-
return
|
|
606
|
+
return ke(i, null), Fe(a);
|
|
607
|
+
const s = Fe(a);
|
|
608
|
+
return ke(i, s), Se("Applied stored closed launcher position", {
|
|
606
609
|
visibleLauncherPosition: s
|
|
607
610
|
}), s;
|
|
608
|
-
},
|
|
609
|
-
if (!
|
|
610
|
-
|
|
611
|
+
}, vt = (a, s) => {
|
|
612
|
+
if (!a || !s) {
|
|
613
|
+
Hn(i);
|
|
611
614
|
return;
|
|
612
615
|
}
|
|
613
616
|
ha(i, {
|
|
614
|
-
x:
|
|
615
|
-
y:
|
|
617
|
+
x: a.x - s.x,
|
|
618
|
+
y: a.y - s.y
|
|
616
619
|
});
|
|
617
|
-
},
|
|
620
|
+
}, gn = () => {
|
|
618
621
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
619
|
-
|
|
622
|
+
ke(
|
|
620
623
|
i,
|
|
621
|
-
|
|
624
|
+
Ut(
|
|
622
625
|
i,
|
|
623
626
|
p,
|
|
624
627
|
t.position
|
|
@@ -626,234 +629,234 @@ async function ta(e = {}) {
|
|
|
626
629
|
);
|
|
627
630
|
return;
|
|
628
631
|
}
|
|
629
|
-
const
|
|
632
|
+
const a = We();
|
|
630
633
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
631
|
-
|
|
632
|
-
const s =
|
|
633
|
-
|
|
634
|
+
Ot(i, c);
|
|
635
|
+
const s = Ue(c);
|
|
636
|
+
Wt(
|
|
634
637
|
h,
|
|
635
638
|
s.width
|
|
636
639
|
);
|
|
637
|
-
const
|
|
638
|
-
u ??
|
|
640
|
+
const _ = ct(
|
|
641
|
+
u ?? Bt(
|
|
639
642
|
i,
|
|
640
|
-
|
|
643
|
+
a,
|
|
641
644
|
t.position,
|
|
642
645
|
c
|
|
643
646
|
),
|
|
644
647
|
s
|
|
645
648
|
);
|
|
646
|
-
u && (u =
|
|
649
|
+
u && (u = _), vt(_, a), Se(
|
|
647
650
|
"Applied open panel position after viewport resize",
|
|
648
|
-
{ openPanelPosition:
|
|
651
|
+
{ openPanelPosition: _ }
|
|
649
652
|
);
|
|
650
|
-
} else p &&
|
|
653
|
+
} else p && Se(
|
|
651
654
|
"Applied visible launcher position after viewport resize",
|
|
652
|
-
{ visibleLauncherPosition:
|
|
655
|
+
{ visibleLauncherPosition: a }
|
|
653
656
|
);
|
|
654
657
|
};
|
|
655
|
-
let
|
|
658
|
+
let hn = () => {
|
|
656
659
|
};
|
|
657
|
-
window.addEventListener("resize",
|
|
660
|
+
window.addEventListener("resize", gn), t.movableLauncher && R ? (We(), hn = ra({
|
|
658
661
|
root: i,
|
|
659
662
|
launcher: v,
|
|
660
|
-
launcherDragHandle:
|
|
663
|
+
launcherDragHandle: R,
|
|
661
664
|
getPosition: () => Fe(),
|
|
662
|
-
setPosition: (
|
|
663
|
-
const s =
|
|
665
|
+
setPosition: (a) => {
|
|
666
|
+
const s = a, _ = ht(i), I = Qt(
|
|
664
667
|
i,
|
|
665
|
-
|
|
666
|
-
|
|
668
|
+
a,
|
|
669
|
+
_
|
|
667
670
|
);
|
|
668
671
|
p = ca(
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
),
|
|
672
|
+
I,
|
|
673
|
+
_
|
|
674
|
+
), ke(i, I), Se("Dragging closed launcher", {
|
|
672
675
|
requestedPosition: s
|
|
673
676
|
});
|
|
674
677
|
},
|
|
675
678
|
persist: () => {
|
|
676
|
-
d = !0, B(),
|
|
679
|
+
d = !0, B(), Se("Persisted closed launcher drag position");
|
|
677
680
|
}
|
|
678
|
-
})) :
|
|
679
|
-
const
|
|
680
|
-
const
|
|
681
|
+
})) : ke(i, null), Ot(i, c);
|
|
682
|
+
const Fo = () => {
|
|
683
|
+
const a = Ue(c), s = Fe();
|
|
681
684
|
return {
|
|
682
|
-
position:
|
|
683
|
-
u ??
|
|
685
|
+
position: ct(
|
|
686
|
+
u ?? Bt(
|
|
684
687
|
i,
|
|
685
688
|
s,
|
|
686
689
|
t.position,
|
|
687
690
|
c
|
|
688
691
|
),
|
|
689
|
-
|
|
692
|
+
a
|
|
690
693
|
),
|
|
691
|
-
size:
|
|
694
|
+
size: a
|
|
692
695
|
};
|
|
693
|
-
},
|
|
694
|
-
c =
|
|
696
|
+
}, Ho = (a) => {
|
|
697
|
+
c = ft(a.size), Ot(i, c), Wt(
|
|
695
698
|
h,
|
|
696
|
-
|
|
697
|
-
), u =
|
|
698
|
-
|
|
699
|
-
|
|
699
|
+
Ue(c).width
|
|
700
|
+
), u = ct(
|
|
701
|
+
a.position,
|
|
702
|
+
Ue(c)
|
|
700
703
|
);
|
|
701
704
|
const s = Fe();
|
|
702
|
-
|
|
703
|
-
},
|
|
705
|
+
vt(u, s);
|
|
706
|
+
}, Wo = A.length > 0 ? la({
|
|
704
707
|
root: i,
|
|
705
708
|
handles: A,
|
|
706
|
-
getBounds:
|
|
707
|
-
setBounds:
|
|
709
|
+
getBounds: Fo,
|
|
710
|
+
setBounds: Ho,
|
|
708
711
|
persist: B
|
|
709
712
|
}) : () => {
|
|
710
713
|
};
|
|
711
|
-
let
|
|
712
|
-
const
|
|
713
|
-
if (!(!t.billingStatusLoader ||
|
|
714
|
-
|
|
714
|
+
let Ct = !1;
|
|
715
|
+
const mn = async () => {
|
|
716
|
+
if (!(!t.billingStatusLoader || Ct)) {
|
|
717
|
+
Ct = !0;
|
|
715
718
|
try {
|
|
716
|
-
const
|
|
717
|
-
|
|
719
|
+
const a = await t.billingStatusLoader();
|
|
720
|
+
jn(
|
|
718
721
|
t.billingStatus,
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
) && (t.billingStatus =
|
|
722
|
-
|
|
722
|
+
a,
|
|
723
|
+
b.getState().lastErrorCode
|
|
724
|
+
) && (t.billingStatus = a, $t(
|
|
725
|
+
Ie,
|
|
723
726
|
t.billingStatus,
|
|
724
|
-
|
|
725
|
-
),
|
|
727
|
+
b.getState().lastErrorCode
|
|
728
|
+
), K());
|
|
726
729
|
} finally {
|
|
727
|
-
|
|
730
|
+
Ct = !1;
|
|
728
731
|
}
|
|
729
732
|
}
|
|
730
|
-
},
|
|
731
|
-
|
|
733
|
+
}, we = (a = "", s = !0) => {
|
|
734
|
+
mn(), $e && ($e = !1, kt()), i.classList.contains("pluno-pa-widget--open") || (u = null), Q !== null && (window.clearTimeout(Q), Q = null), He("shown", !1), y.hidden = !1, L.hidden = !1, Wt(
|
|
732
735
|
h,
|
|
733
|
-
|
|
736
|
+
Ue(c).width
|
|
734
737
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
735
|
-
const
|
|
738
|
+
const _ = We(), I = Bt(
|
|
736
739
|
i,
|
|
737
|
-
|
|
740
|
+
_,
|
|
738
741
|
t.position,
|
|
739
742
|
c
|
|
740
743
|
);
|
|
741
|
-
if (
|
|
742
|
-
openPanelPosition:
|
|
743
|
-
visibleLauncherPosition:
|
|
744
|
-
}),
|
|
745
|
-
i.classList.add("pluno-pa-widget--open"), v.hidden = !0,
|
|
744
|
+
if (vt(I, _), Se("Opening launcher at clamped open panel position", {
|
|
745
|
+
openPanelPosition: I,
|
|
746
|
+
visibleLauncherPosition: _
|
|
747
|
+
}), ee(!0, "open"), te(), !s) {
|
|
748
|
+
i.classList.add("pluno-pa-widget--open"), v.hidden = !0, a && (w.value = a, Ye(w)), Xe(P, () => ye.enabled), ve = P.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), tt("shown"), t.onPanelOpenChange?.(!0);
|
|
746
749
|
return;
|
|
747
750
|
}
|
|
748
751
|
window.requestAnimationFrame(() => {
|
|
749
|
-
i.classList.add("pluno-pa-widget--open"),
|
|
750
|
-
v.hidden = !0,
|
|
752
|
+
i.classList.add("pluno-pa-widget--open"), a && (w.value = a, Ye(w)), Xe(P, () => ye.enabled), ve = P.scrollTop, w.focus(), w.setSelectionRange(w.value.length, w.value.length), B(), tt("shown"), t.onPanelOpenChange?.(!0), Q = window.setTimeout(() => {
|
|
753
|
+
v.hidden = !0, Xe(P, () => ye.enabled), ve = P.scrollTop;
|
|
751
754
|
}, 220);
|
|
752
755
|
});
|
|
753
|
-
},
|
|
754
|
-
|
|
755
|
-
|
|
756
|
+
}, St = () => {
|
|
757
|
+
Q !== null && (window.clearTimeout(Q), Q = null), v.hidden = !1, p && (We(!1), Se("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), B(), t.onPanelOpenChange?.(!1), Q = window.setTimeout(() => {
|
|
758
|
+
y.hidden = !0, L.hidden = !0, u = null, i.classList.remove("pluno-pa-widget--closing");
|
|
756
759
|
}, 220);
|
|
757
760
|
};
|
|
758
|
-
v.addEventListener("submit", (
|
|
759
|
-
|
|
760
|
-
}),
|
|
761
|
-
|
|
762
|
-
}), v.addEventListener("click", (
|
|
763
|
-
|
|
764
|
-
}),
|
|
765
|
-
|
|
766
|
-
}),
|
|
767
|
-
if (!
|
|
761
|
+
v.addEventListener("submit", (a) => {
|
|
762
|
+
a.preventDefault(), we(C.value), C.value = "";
|
|
763
|
+
}), R?.addEventListener("click", (a) => {
|
|
764
|
+
a.preventDefault(), a.stopPropagation();
|
|
765
|
+
}), v.addEventListener("click", (a) => {
|
|
766
|
+
a.target === C && !R || (we(C.value), C.value = "");
|
|
767
|
+
}), C.addEventListener("focus", () => {
|
|
768
|
+
we(C.value), C.value = "";
|
|
769
|
+
}), C.addEventListener("input", () => {
|
|
770
|
+
if (!C.value)
|
|
768
771
|
return;
|
|
769
|
-
const
|
|
770
|
-
|
|
772
|
+
const a = C.value;
|
|
773
|
+
we(a), C.value = "";
|
|
771
774
|
});
|
|
772
|
-
let
|
|
773
|
-
const
|
|
774
|
-
if (!(
|
|
775
|
+
let Et = null, nt = null, Ee = null;
|
|
776
|
+
const fn = (a) => a === C || a === w, Go = (a) => {
|
|
777
|
+
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
775
778
|
return null;
|
|
776
|
-
let s =
|
|
779
|
+
let s = a;
|
|
777
780
|
for (; s; ) {
|
|
778
|
-
const
|
|
779
|
-
if (
|
|
780
|
-
return
|
|
781
|
-
const
|
|
782
|
-
s =
|
|
781
|
+
const _ = s.closest(Tn);
|
|
782
|
+
if (_)
|
|
783
|
+
return _;
|
|
784
|
+
const I = s.getRootNode();
|
|
785
|
+
s = I instanceof ShadowRoot ? I.host : null;
|
|
783
786
|
}
|
|
784
787
|
return null;
|
|
785
|
-
}, $o = (
|
|
786
|
-
if (!
|
|
788
|
+
}, $o = (a) => {
|
|
789
|
+
if (!a.isConnected || !a.matches(Tn))
|
|
787
790
|
return !1;
|
|
788
|
-
if (!(
|
|
791
|
+
if (!(a instanceof HTMLElement))
|
|
789
792
|
return !0;
|
|
790
|
-
if (
|
|
793
|
+
if (a.hidden)
|
|
791
794
|
return !1;
|
|
792
|
-
if (typeof
|
|
793
|
-
return
|
|
794
|
-
const s = window.getComputedStyle(
|
|
795
|
+
if (typeof a.checkVisibility == "function")
|
|
796
|
+
return a.checkVisibility();
|
|
797
|
+
const s = window.getComputedStyle(a);
|
|
795
798
|
return s.display !== "none" && s.visibility !== "hidden";
|
|
796
|
-
},
|
|
797
|
-
Ge !==
|
|
799
|
+
}, wn = (a) => {
|
|
800
|
+
Ge !== a && (Ge = a, i.classList.toggle("pluno-pa-widget--host-modal-conflict", a !== null), it(), a !== null ? Ee = window.setInterval(() => {
|
|
798
801
|
const s = Ge;
|
|
799
|
-
(!s || !$o(s)) &&
|
|
800
|
-
}, Ui) :
|
|
802
|
+
(!s || !$o(s)) && wn(null);
|
|
803
|
+
}, Ui) : Ee !== null && (window.clearInterval(Ee), Ee = null, nt = null));
|
|
801
804
|
}, qo = () => {
|
|
802
|
-
|
|
805
|
+
Ee !== null && (window.clearInterval(Ee), Ee = null);
|
|
803
806
|
};
|
|
804
|
-
i.addEventListener("focusin", (
|
|
805
|
-
|
|
806
|
-
}), i.addEventListener("focusout", (
|
|
807
|
-
if (!
|
|
807
|
+
i.addEventListener("focusin", (a) => {
|
|
808
|
+
fn(a.target) && (Et = Date.now(), B());
|
|
809
|
+
}), i.addEventListener("focusout", (a) => {
|
|
810
|
+
if (!fn(a.target) || Ge !== null)
|
|
808
811
|
return;
|
|
809
|
-
const s =
|
|
810
|
-
if (
|
|
812
|
+
const s = Et;
|
|
813
|
+
if (Et = null, s === null || Date.now() - s > Mi)
|
|
811
814
|
return;
|
|
812
|
-
const
|
|
813
|
-
if (!
|
|
815
|
+
const _ = Go(a.relatedTarget);
|
|
816
|
+
if (!_)
|
|
814
817
|
return;
|
|
815
|
-
const
|
|
816
|
-
if (
|
|
817
|
-
|
|
818
|
+
const I = Date.now();
|
|
819
|
+
if (nt !== null && I - nt <= Oi) {
|
|
820
|
+
wn(_);
|
|
818
821
|
return;
|
|
819
822
|
}
|
|
820
|
-
|
|
821
|
-
}), v.addEventListener("keydown", (
|
|
822
|
-
!i.classList.contains("pluno-pa-widget--minimized") ||
|
|
823
|
-
}), g?.addEventListener("pointerdown", (
|
|
824
|
-
|
|
825
|
-
}), g?.addEventListener("click", (
|
|
826
|
-
|
|
827
|
-
}),
|
|
828
|
-
|
|
829
|
-
}),
|
|
830
|
-
|
|
823
|
+
nt = I;
|
|
824
|
+
}), v.addEventListener("keydown", (a) => {
|
|
825
|
+
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), we());
|
|
826
|
+
}), g?.addEventListener("pointerdown", (a) => {
|
|
827
|
+
a.stopPropagation();
|
|
828
|
+
}), g?.addEventListener("click", (a) => {
|
|
829
|
+
a.preventDefault(), a.stopPropagation(), He("minimized");
|
|
830
|
+
}), L.addEventListener("click", St), P.addEventListener("scroll", () => {
|
|
831
|
+
P.scrollTop < ve - 1 && ee(!1, "userScroll"), ve = P.scrollTop;
|
|
832
|
+
}), D.addEventListener("click", () => {
|
|
833
|
+
Uo();
|
|
831
834
|
});
|
|
832
|
-
const
|
|
833
|
-
([
|
|
834
|
-
|
|
835
|
+
const bn = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
836
|
+
([a]) => {
|
|
837
|
+
a?.isIntersecting && (ee(!0, "bottom"), te());
|
|
835
838
|
},
|
|
836
|
-
{ root:
|
|
839
|
+
{ root: P, threshold: 0 }
|
|
837
840
|
);
|
|
838
|
-
|
|
839
|
-
const
|
|
841
|
+
bn?.observe(j);
|
|
842
|
+
const ot = () => t.loginRequired || t.signupRequired;
|
|
840
843
|
let Ge = null, $e = !1;
|
|
841
|
-
const
|
|
842
|
-
const
|
|
843
|
-
|
|
844
|
-
},
|
|
845
|
-
|
|
844
|
+
const it = () => {
|
|
845
|
+
const a = ot(), s = Ge !== null;
|
|
846
|
+
C.readOnly = a || s, w.readOnly = s, C.placeholder = s ? An : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : $e ? "New update" : t.launcherLabel, w.placeholder = s ? An : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ie.launcherLabel, M.hidden = a;
|
|
847
|
+
}, K = () => {
|
|
848
|
+
J.disabled = re(t.billingStatus) || !b.getState().isThinking && w.value.trim().length === 0 && q.length === 0, G.disabled = ot() || re(t.billingStatus);
|
|
846
849
|
};
|
|
847
|
-
|
|
848
|
-
const
|
|
849
|
-
const
|
|
850
|
-
i.classList.toggle("pluno-pa-widget--thinking",
|
|
850
|
+
it();
|
|
851
|
+
const kt = () => {
|
|
852
|
+
const a = b.getState().isThinking;
|
|
853
|
+
i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
|
|
851
854
|
"pluno-pa-widget--unread",
|
|
852
|
-
!
|
|
853
|
-
),
|
|
855
|
+
!a && $e
|
|
856
|
+
), it();
|
|
854
857
|
};
|
|
855
|
-
|
|
856
|
-
if (
|
|
858
|
+
kt(), M.addEventListener("submit", (a) => {
|
|
859
|
+
if (a.preventDefault(), t.loginRequired) {
|
|
857
860
|
t.onLoginClick?.();
|
|
858
861
|
return;
|
|
859
862
|
}
|
|
@@ -861,158 +864,158 @@ async function ta(e = {}) {
|
|
|
861
864
|
t.onSignupClick?.();
|
|
862
865
|
return;
|
|
863
866
|
}
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
),
|
|
867
|
+
re(t.billingStatus) || (he = !0, ee(!0, "send"), te(), q = Ht(
|
|
868
|
+
b,
|
|
869
|
+
w,
|
|
870
|
+
q
|
|
871
|
+
), Pe(), K());
|
|
869
872
|
});
|
|
870
873
|
let qe = 0;
|
|
871
874
|
const jo = () => {
|
|
872
875
|
qe = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
873
|
-
},
|
|
874
|
-
|
|
875
|
-
|
|
876
|
+
}, Lt = (a) => {
|
|
877
|
+
se !== null && window.clearTimeout(se), U.textContent = a, U.hidden = !1, se = window.setTimeout(() => {
|
|
878
|
+
U.textContent = "", U.hidden = !0, se = null;
|
|
876
879
|
}, 3e3);
|
|
877
880
|
}, Vo = () => {
|
|
878
|
-
|
|
879
|
-
},
|
|
880
|
-
if (
|
|
881
|
+
se !== null && (window.clearTimeout(se), se = null), U.textContent = "", U.hidden = !0;
|
|
882
|
+
}, It = async (a) => {
|
|
883
|
+
if (a.length === 0)
|
|
881
884
|
return;
|
|
882
|
-
const s = ja(
|
|
883
|
-
|
|
885
|
+
const s = ja(b, a);
|
|
886
|
+
q = [...q, ...s], Pe(), Vo(), K(), F(b.getState()), i.classList.contains("pluno-pa-widget--open") || we();
|
|
884
887
|
};
|
|
885
|
-
|
|
886
|
-
t.loginRequired ||
|
|
887
|
-
}),
|
|
888
|
-
const
|
|
889
|
-
|
|
890
|
-
|
|
888
|
+
G.addEventListener("click", () => {
|
|
889
|
+
t.loginRequired || re(t.billingStatus) || xe.click();
|
|
890
|
+
}), xe.addEventListener("change", () => {
|
|
891
|
+
const a = Array.from(xe.files ?? []);
|
|
892
|
+
xe.value = "", It(a).catch((s) => {
|
|
893
|
+
Lt(
|
|
891
894
|
s instanceof Error ? s.message : "Failed to attach file"
|
|
892
|
-
),
|
|
895
|
+
), ne("web-sdk.widget", "Attachment failed", {
|
|
893
896
|
message: s instanceof Error ? s.message : String(s)
|
|
894
897
|
});
|
|
895
898
|
});
|
|
896
|
-
}), i.addEventListener("dragenter", (
|
|
897
|
-
!
|
|
898
|
-
}), i.addEventListener("dragover", (
|
|
899
|
-
const s =
|
|
900
|
-
!
|
|
901
|
-
}), i.addEventListener("dragleave", (
|
|
902
|
-
|
|
903
|
-
}), i.addEventListener("drop", (
|
|
904
|
-
const s =
|
|
905
|
-
!
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
),
|
|
909
|
-
message:
|
|
899
|
+
}), i.addEventListener("dragenter", (a) => {
|
|
900
|
+
!pt(a.dataTransfer) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), qe += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
901
|
+
}), i.addEventListener("dragover", (a) => {
|
|
902
|
+
const s = a.dataTransfer;
|
|
903
|
+
!pt(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), s.dropEffect = "copy");
|
|
904
|
+
}), i.addEventListener("dragleave", (a) => {
|
|
905
|
+
pt(a.dataTransfer) && (a.stopPropagation(), qe = Math.max(0, qe - 1), qe === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
906
|
+
}), i.addEventListener("drop", (a) => {
|
|
907
|
+
const s = a.dataTransfer;
|
|
908
|
+
!pt(s) || t.loginRequired || (a.preventDefault(), a.stopPropagation(), jo(), It(s.files).catch((_) => {
|
|
909
|
+
Lt(
|
|
910
|
+
_ instanceof Error ? _.message : "Failed to attach file"
|
|
911
|
+
), ne("web-sdk.widget", "Attachment failed", {
|
|
912
|
+
message: _ instanceof Error ? _.message : String(_)
|
|
910
913
|
});
|
|
911
914
|
}));
|
|
912
|
-
}), i.addEventListener("paste", (
|
|
913
|
-
|
|
914
|
-
const s =
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
),
|
|
919
|
-
message:
|
|
915
|
+
}), i.addEventListener("paste", (a) => {
|
|
916
|
+
a.stopPropagation();
|
|
917
|
+
const s = a.clipboardData, _ = Array.from(s?.files ?? []);
|
|
918
|
+
_.length === 0 || t.loginRequired || (a.preventDefault(), It(_).catch((I) => {
|
|
919
|
+
Lt(
|
|
920
|
+
I instanceof Error ? I.message : "Failed to attach file"
|
|
921
|
+
), ne("web-sdk.widget", "Attachment failed", {
|
|
922
|
+
message: I instanceof Error ? I.message : String(I)
|
|
920
923
|
});
|
|
921
924
|
}));
|
|
922
|
-
}),
|
|
925
|
+
}), J.addEventListener("click", () => {
|
|
923
926
|
if (t.loginRequired) {
|
|
924
927
|
t.onLoginClick?.();
|
|
925
928
|
return;
|
|
926
929
|
}
|
|
927
|
-
if (
|
|
928
|
-
|
|
930
|
+
if (b.getState().isThinking) {
|
|
931
|
+
b.stop();
|
|
929
932
|
return;
|
|
930
933
|
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
),
|
|
936
|
-
}),
|
|
937
|
-
|
|
938
|
-
}),
|
|
939
|
-
|
|
940
|
-
}),
|
|
941
|
-
|
|
942
|
-
}),
|
|
943
|
-
if (!(
|
|
944
|
-
if (
|
|
934
|
+
he = !0, ee(!0, "send"), te(), q = Ht(
|
|
935
|
+
b,
|
|
936
|
+
w,
|
|
937
|
+
q
|
|
938
|
+
), Pe(), K(), F(b.getState());
|
|
939
|
+
}), pe.addEventListener("click", () => {
|
|
940
|
+
me = !me, Be = null, Ce(), me && fe.length === 0 && dn(null);
|
|
941
|
+
}), ge.addEventListener("click", () => {
|
|
942
|
+
me = !1, Ce();
|
|
943
|
+
}), V.addEventListener("scroll", Bo), w.addEventListener("input", () => {
|
|
944
|
+
Ye(w), B(), K(), Xo();
|
|
945
|
+
}), w.addEventListener("keydown", (a) => {
|
|
946
|
+
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
947
|
+
if (a.preventDefault(), t.loginRequired) {
|
|
945
948
|
t.onLoginClick?.();
|
|
946
949
|
return;
|
|
947
950
|
}
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
),
|
|
953
|
-
}
|
|
954
|
-
}), i.addEventListener("click", (
|
|
955
|
-
(
|
|
956
|
-
}), l.composerValue && (
|
|
957
|
-
const
|
|
958
|
-
let
|
|
951
|
+
he = !0, ee(!0, "send"), te(), q = Ht(
|
|
952
|
+
b,
|
|
953
|
+
w,
|
|
954
|
+
q
|
|
955
|
+
), Pe(), K(), F(b.getState());
|
|
956
|
+
}
|
|
957
|
+
}), i.addEventListener("click", (a) => {
|
|
958
|
+
(a.target instanceof Element ? a.target : null)?.closest("a[href]") && B();
|
|
959
|
+
}), l.composerValue && (w.value = l.composerValue, Ye(w)), t.initialDisplayState === "minimized" ? He("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && we(w.value, !1), wa(l, i, C, w);
|
|
960
|
+
const at = () => r;
|
|
961
|
+
let Pt = b.getState().appearance !== null, rt = null, je = null, Ne = null, _n = b.getState().isThinking, Re = null;
|
|
959
962
|
const Ve = t.taskNotifications;
|
|
960
|
-
let
|
|
961
|
-
const
|
|
962
|
-
|
|
963
|
-
},
|
|
964
|
-
|
|
965
|
-
},
|
|
966
|
-
if (!Ve || !
|
|
963
|
+
let De = null, ze = !1;
|
|
964
|
+
const xn = () => {
|
|
965
|
+
De !== null && (window.clearTimeout(De), De = null);
|
|
966
|
+
}, lt = () => {
|
|
967
|
+
S && (S.hidden = !0);
|
|
968
|
+
}, yn = () => b.getState().assistantDraft.trim().length > 0, Ko = async () => {
|
|
969
|
+
if (!Ve || !S || ze || Ae || !b.getState().isThinking || yn())
|
|
967
970
|
return;
|
|
968
|
-
let
|
|
971
|
+
let a;
|
|
969
972
|
try {
|
|
970
|
-
|
|
973
|
+
a = await Ve.getState();
|
|
971
974
|
} catch {
|
|
972
975
|
return;
|
|
973
976
|
}
|
|
974
|
-
|
|
977
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || yn() || ze || Ae || (S.hidden = !1);
|
|
975
978
|
};
|
|
976
|
-
|
|
977
|
-
|
|
979
|
+
N?.addEventListener("click", () => {
|
|
980
|
+
ze = !0, lt(), Ve?.enable().catch(() => {
|
|
978
981
|
});
|
|
979
|
-
}),
|
|
980
|
-
|
|
982
|
+
}), Ro?.addEventListener("click", () => {
|
|
983
|
+
ze = !0, lt();
|
|
981
984
|
}), Do?.addEventListener("click", () => {
|
|
982
|
-
|
|
985
|
+
ze = !0, lt(), Ve?.dismissForever().catch(() => {
|
|
983
986
|
});
|
|
984
987
|
});
|
|
985
|
-
let
|
|
988
|
+
let Me = null, vn = () => {
|
|
986
989
|
};
|
|
987
|
-
const Yo = !!t.socialPostDraftHandler,
|
|
988
|
-
const
|
|
989
|
-
|
|
990
|
+
const Yo = !!t.socialPostDraftHandler, Tt = /* @__PURE__ */ new Map(), At = () => w.value.trim().length > 0 || q.length > 0, Xo = () => {
|
|
991
|
+
const a = Me !== null && qt(b.getState(), At());
|
|
992
|
+
$.hidden = !a, a && Me !== null && bo($, Me);
|
|
990
993
|
};
|
|
991
|
-
let
|
|
992
|
-
const
|
|
993
|
-
|
|
994
|
-
},
|
|
995
|
-
if (!
|
|
996
|
-
|
|
994
|
+
let Oe = null;
|
|
995
|
+
const Nt = (a = {}) => {
|
|
996
|
+
he = !0, ee(!0, "newSession"), te(), me = !1, Ce(), b.startNewSession(a), _t.clear(), w.value = "", q = [], Pe(), Ye(w), B(), K(), w.focus(), F(b.getState());
|
|
997
|
+
}, Rt = (a) => {
|
|
998
|
+
if (!a) {
|
|
999
|
+
Oe?.remove(), Oe = null;
|
|
997
1000
|
return;
|
|
998
1001
|
}
|
|
999
|
-
|
|
1002
|
+
Oe || (Oe = wt(
|
|
1000
1003
|
"pluno-pa-widget__new-chat",
|
|
1001
1004
|
"New chat",
|
|
1002
|
-
|
|
1005
|
+
za(),
|
|
1003
1006
|
!1
|
|
1004
|
-
),
|
|
1005
|
-
},
|
|
1006
|
-
if (
|
|
1007
|
-
|
|
1007
|
+
), Oe.addEventListener("click", () => Nt()), Je.insertBefore(Oe, pe));
|
|
1008
|
+
}, F = (a) => {
|
|
1009
|
+
if (Ce(), pn(a.lastErrorCode) ? Re = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !re(t.billingStatus) && (Re = null), $t(
|
|
1010
|
+
Ie,
|
|
1008
1011
|
t.billingStatus,
|
|
1009
|
-
|
|
1012
|
+
Re
|
|
1010
1013
|
), t.loginRequired) {
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1014
|
+
Tt.clear(), Xn(
|
|
1015
|
+
P,
|
|
1016
|
+
J,
|
|
1017
|
+
Rt,
|
|
1018
|
+
at,
|
|
1016
1019
|
"Log in to use Pluno on this page.",
|
|
1017
1020
|
t.loginButtonLabel,
|
|
1018
1021
|
t.loginUrl,
|
|
@@ -1021,11 +1024,11 @@ async function ta(e = {}) {
|
|
|
1021
1024
|
return;
|
|
1022
1025
|
}
|
|
1023
1026
|
if (t.signupRequired) {
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1027
|
+
Tt.clear(), Xn(
|
|
1028
|
+
P,
|
|
1029
|
+
J,
|
|
1030
|
+
Rt,
|
|
1031
|
+
at,
|
|
1029
1032
|
"Complete signup to unlock your free trial credits.",
|
|
1030
1033
|
t.signupButtonLabel,
|
|
1031
1034
|
t.signupUrl,
|
|
@@ -1033,70 +1036,75 @@ async function ta(e = {}) {
|
|
|
1033
1036
|
);
|
|
1034
1037
|
return;
|
|
1035
1038
|
}
|
|
1036
|
-
const s = _a(
|
|
1037
|
-
|
|
1038
|
-
const
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
() =>
|
|
1050
|
-
|
|
1051
|
-
|
|
1039
|
+
const s = _a(a), _ = s !== sn;
|
|
1040
|
+
sn = s;
|
|
1041
|
+
const I = he || ye.enabled;
|
|
1042
|
+
he = !1, Qa(
|
|
1043
|
+
P,
|
|
1044
|
+
j,
|
|
1045
|
+
J,
|
|
1046
|
+
Rt,
|
|
1047
|
+
$,
|
|
1048
|
+
a,
|
|
1049
|
+
Me,
|
|
1050
|
+
Me !== null && qt(a, At()),
|
|
1051
|
+
I,
|
|
1052
|
+
() => ye.enabled,
|
|
1053
|
+
_t,
|
|
1054
|
+
Tt,
|
|
1052
1055
|
B,
|
|
1053
|
-
|
|
1054
|
-
(
|
|
1055
|
-
|
|
1056
|
+
at,
|
|
1057
|
+
(z) => {
|
|
1058
|
+
const Ke = t.morningReport !== null;
|
|
1059
|
+
t.morningReport = null, Ke && (t.onMorningReportTaskStart?.(), Nt()), he = !0, ee(!0, "send"), te(), b.sendMessage(z);
|
|
1056
1060
|
},
|
|
1057
1061
|
() => {
|
|
1058
|
-
|
|
1062
|
+
he = !0, ee(!0, "send"), te(), b.retryLastMessage();
|
|
1059
1063
|
},
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1064
|
+
t.morningReport,
|
|
1065
|
+
() => {
|
|
1066
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), St(), F(b.getState());
|
|
1067
|
+
},
|
|
1068
|
+
Yo && !xt ? {
|
|
1069
|
+
dismissedCandidateIds: et,
|
|
1070
|
+
draftingCandidateId: rt,
|
|
1063
1071
|
error: je,
|
|
1064
|
-
characterIconOptions:
|
|
1065
|
-
onSeen: (
|
|
1066
|
-
|
|
1072
|
+
characterIconOptions: at(),
|
|
1073
|
+
onSeen: (z) => {
|
|
1074
|
+
Te.add(z.id), B();
|
|
1067
1075
|
},
|
|
1068
|
-
onDraft: (
|
|
1069
|
-
Zo(
|
|
1076
|
+
onDraft: (z) => {
|
|
1077
|
+
Zo(z);
|
|
1070
1078
|
},
|
|
1071
|
-
onDismiss: (
|
|
1072
|
-
|
|
1079
|
+
onDismiss: (z) => {
|
|
1080
|
+
Te.add(z.id), et.add(z.id), B(), je = null, F(b.getState());
|
|
1073
1081
|
},
|
|
1074
|
-
onDisable: (
|
|
1075
|
-
|
|
1082
|
+
onDisable: (z) => {
|
|
1083
|
+
xt = !0, Te.add(z.id), et.add(z.id), B(), Cr(t, !0), je = null, F(b.getState());
|
|
1076
1084
|
}
|
|
1077
1085
|
} : void 0
|
|
1078
|
-
),
|
|
1086
|
+
), I ? (ve = P.scrollTop, te()) : _ && xa(a) && Oo();
|
|
1079
1087
|
};
|
|
1080
|
-
return
|
|
1081
|
-
(
|
|
1082
|
-
|
|
1088
|
+
return vn = fi(
|
|
1089
|
+
(a) => {
|
|
1090
|
+
Me = a, !Ae && qt(b.getState(), At()) && F(b.getState());
|
|
1083
1091
|
},
|
|
1084
1092
|
{
|
|
1085
1093
|
backendUrl: t.backendUrl,
|
|
1086
1094
|
fetcher: Mo,
|
|
1087
1095
|
loader: t.activeUsersLoader
|
|
1088
1096
|
}
|
|
1089
|
-
),
|
|
1090
|
-
const s =
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
}, yi)), (!
|
|
1097
|
+
), b.on("state", (a) => {
|
|
1098
|
+
const s = _n && !a.isThinking;
|
|
1099
|
+
_n = a.isThinking, a.isThinking && !a.assistantDraft.trim() && Ve && !ze && De === null && S?.hidden !== !1 && (De = window.setTimeout(() => {
|
|
1100
|
+
De = null, Ko();
|
|
1101
|
+
}, yi)), (!a.isThinking || a.assistantDraft.trim()) && (xn(), lt()), s && !i.classList.contains("pluno-pa-widget--open") && ($e = !0), kt(), a.appearance ? (Pt = !0, ne(
|
|
1094
1102
|
"web-sdk.widget",
|
|
1095
1103
|
"Agent state supplied appearance",
|
|
1096
1104
|
{
|
|
1097
|
-
appearance:
|
|
1105
|
+
appearance: a.appearance
|
|
1098
1106
|
}
|
|
1099
|
-
),
|
|
1107
|
+
), Dt(a.appearance, "agent.state.appearance")) : Pt && (Pt = !1, ne(
|
|
1100
1108
|
"web-sdk.widget",
|
|
1101
1109
|
"Agent state cleared appearance; reverting to configured widget options",
|
|
1102
1110
|
{
|
|
@@ -1104,96 +1112,100 @@ async function ta(e = {}) {
|
|
|
1104
1112
|
fallbackColorScheme: t.colorScheme,
|
|
1105
1113
|
fallbackFontFamily: t.fontFamily
|
|
1106
1114
|
}
|
|
1107
|
-
),
|
|
1108
|
-
}),
|
|
1109
|
-
agent:
|
|
1110
|
-
startNewChat:
|
|
1115
|
+
), Dt({}, "agent.state.appearance-cleared")), F(a), K(), s && mn();
|
|
1116
|
+
}), F(b.getState()), K(), {
|
|
1117
|
+
agent: b,
|
|
1118
|
+
startNewChat: Nt,
|
|
1111
1119
|
host: n,
|
|
1112
|
-
updateAppearance: (
|
|
1113
|
-
|
|
1120
|
+
updateAppearance: (a) => {
|
|
1121
|
+
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Dt(a, "widgetHandle.updateAppearance");
|
|
1114
1122
|
},
|
|
1115
|
-
updateBillingStatus: (
|
|
1116
|
-
const s =
|
|
1117
|
-
|
|
1123
|
+
updateBillingStatus: (a) => {
|
|
1124
|
+
const s = a ?? null;
|
|
1125
|
+
jn(
|
|
1118
1126
|
t.billingStatus,
|
|
1119
1127
|
s,
|
|
1120
|
-
|
|
1121
|
-
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !
|
|
1128
|
+
Re
|
|
1129
|
+
) && (t.billingStatus = s, t.billingStatus?.creditsUsed !== null && !re(t.billingStatus) && (Re = null), $t(
|
|
1122
1130
|
i.querySelector(".pluno-pa-widget__billing-status"),
|
|
1123
1131
|
t.billingStatus,
|
|
1124
|
-
|
|
1125
|
-
),
|
|
1132
|
+
Re
|
|
1133
|
+
), K());
|
|
1126
1134
|
},
|
|
1127
|
-
updateAuthGate: (
|
|
1128
|
-
const s =
|
|
1129
|
-
t.loginRequired =
|
|
1130
|
-
|
|
1135
|
+
updateAuthGate: (a) => {
|
|
1136
|
+
const s = ot();
|
|
1137
|
+
t.loginRequired = a.loginRequired === !0, t.signupRequired = a.signupRequired === !0, a.loginButtonLabel !== void 0 && (t.loginButtonLabel = a.loginButtonLabel), a.loginUrl !== void 0 && (t.loginUrl = a.loginUrl), a.signupButtonLabel !== void 0 && (t.signupButtonLabel = a.signupButtonLabel), a.signupUrl !== void 0 && (t.signupUrl = a.signupUrl), it(), F(b.getState()), K(), s && !ot() && b.connect().catch((_) => {
|
|
1138
|
+
ne(
|
|
1131
1139
|
"web-sdk.widget",
|
|
1132
1140
|
"Failed to connect after auth gate cleared",
|
|
1133
1141
|
{
|
|
1134
|
-
message:
|
|
1142
|
+
message: _ instanceof Error ? _.message : String(_)
|
|
1135
1143
|
}
|
|
1136
1144
|
);
|
|
1137
1145
|
});
|
|
1138
1146
|
},
|
|
1139
1147
|
openPanel: () => {
|
|
1140
|
-
|
|
1148
|
+
we(w.value, !1);
|
|
1141
1149
|
},
|
|
1142
|
-
|
|
1143
|
-
|
|
1150
|
+
closePanel: St,
|
|
1151
|
+
updateDisplayState: (a) => {
|
|
1152
|
+
if (a === "shown") {
|
|
1144
1153
|
He("shown", !1);
|
|
1145
1154
|
return;
|
|
1146
1155
|
}
|
|
1147
1156
|
He("minimized", !1);
|
|
1148
1157
|
},
|
|
1158
|
+
updateMorningReport: (a) => {
|
|
1159
|
+
t.morningReport = a ?? null, F(b.getState());
|
|
1160
|
+
},
|
|
1149
1161
|
destroy: () => {
|
|
1150
|
-
|
|
1162
|
+
Ae || (B(), Ae = !0, un.disconnect(), bn?.disconnect(), qo(), window.removeEventListener("resize", gn), hn(), Wo(), se !== null && window.clearTimeout(se), xn(), vn(), Ne?.remove(), b.destroy(), bt.release(), n.remove());
|
|
1151
1163
|
}
|
|
1152
1164
|
};
|
|
1153
|
-
async function Zo(
|
|
1154
|
-
if (!
|
|
1155
|
-
|
|
1165
|
+
async function Zo(a) {
|
|
1166
|
+
if (!rt) {
|
|
1167
|
+
rt = a.id, je = null, F(b.getState());
|
|
1156
1168
|
try {
|
|
1157
1169
|
if (!t.socialPostDraftHandler)
|
|
1158
1170
|
throw new Error("Social post drafting is not available here.");
|
|
1159
|
-
const s = await t.socialPostDraftHandler(
|
|
1171
|
+
const s = await t.socialPostDraftHandler(a);
|
|
1160
1172
|
if (!s.linkedinPost || !s.xPost)
|
|
1161
1173
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1162
|
-
|
|
1174
|
+
Te.add(a.id), et.add(a.id), B(), Ne?.remove(), Ne = lr(s, {
|
|
1163
1175
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1164
1176
|
onClose: () => {
|
|
1165
|
-
|
|
1177
|
+
Ne?.remove(), Ne = null;
|
|
1166
1178
|
}
|
|
1167
|
-
}), i.appendChild(
|
|
1179
|
+
}), i.appendChild(Ne);
|
|
1168
1180
|
} catch (s) {
|
|
1169
1181
|
je = s instanceof Error ? s.message : "Could not draft social post.";
|
|
1170
1182
|
} finally {
|
|
1171
|
-
|
|
1183
|
+
rt = null, F(b.getState());
|
|
1172
1184
|
}
|
|
1173
1185
|
}
|
|
1174
1186
|
}
|
|
1175
|
-
function
|
|
1176
|
-
const
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
),
|
|
1181
|
-
accentColor:
|
|
1182
|
-
colorScheme:
|
|
1183
|
-
fontFamily:
|
|
1184
|
-
scribbleStyle:
|
|
1185
|
-
}),
|
|
1187
|
+
function Dt(a, s) {
|
|
1188
|
+
const _ = a.accentColor ?? t.accentColor, I = a.colorScheme ?? t.colorScheme, z = a.fontFamily ?? t.fontFamily, Ke = a.scribbleStyle ?? t.scribbleStyle;
|
|
1189
|
+
r = Mn(
|
|
1190
|
+
_,
|
|
1191
|
+
Ke
|
|
1192
|
+
), On(i, r, {
|
|
1193
|
+
accentColor: _,
|
|
1194
|
+
colorScheme: I,
|
|
1195
|
+
fontFamily: z,
|
|
1196
|
+
scribbleStyle: Ke
|
|
1197
|
+
}), ne("web-sdk.widget", "Updated widget appearance", {
|
|
1186
1198
|
source: s,
|
|
1187
|
-
inputAppearance:
|
|
1188
|
-
appliedAccentColor:
|
|
1189
|
-
appliedColorScheme:
|
|
1190
|
-
appliedFontFamily:
|
|
1191
|
-
appliedScribbleStyle:
|
|
1199
|
+
inputAppearance: a,
|
|
1200
|
+
appliedAccentColor: _,
|
|
1201
|
+
appliedColorScheme: I,
|
|
1202
|
+
appliedFontFamily: z,
|
|
1203
|
+
appliedScribbleStyle: Ke,
|
|
1192
1204
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1193
1205
|
});
|
|
1194
1206
|
}
|
|
1195
1207
|
}
|
|
1196
|
-
function
|
|
1208
|
+
function Mn(e, t) {
|
|
1197
1209
|
return { accentColor: e, scribbleStyle: t };
|
|
1198
1210
|
}
|
|
1199
1211
|
function na(e) {
|
|
@@ -1214,12 +1226,12 @@ function oa(e) {
|
|
|
1214
1226
|
}
|
|
1215
1227
|
function ia([e, t, n]) {
|
|
1216
1228
|
const o = (i) => {
|
|
1217
|
-
const
|
|
1218
|
-
return
|
|
1229
|
+
const r = i / 255;
|
|
1230
|
+
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1219
1231
|
};
|
|
1220
1232
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1221
1233
|
}
|
|
1222
|
-
function
|
|
1234
|
+
function On(e, t, n) {
|
|
1223
1235
|
e.classList.toggle(
|
|
1224
1236
|
"pluno-pa-widget--dark",
|
|
1225
1237
|
n.colorScheme === "dark"
|
|
@@ -1227,7 +1239,7 @@ function Mn(e, t, n) {
|
|
|
1227
1239
|
"pluno-pa-widget--light",
|
|
1228
1240
|
n.colorScheme !== "dark"
|
|
1229
1241
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1230
|
-
const o = n.scribbleStyle ?
|
|
1242
|
+
const o = n.scribbleStyle ? no(n.accentColor) : n.accentColor;
|
|
1231
1243
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1232
1244
|
"--pluno-pa-accent-contrast",
|
|
1233
1245
|
na(o)
|
|
@@ -1235,19 +1247,19 @@ function Mn(e, t, n) {
|
|
|
1235
1247
|
const i = Array.from(
|
|
1236
1248
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1237
1249
|
);
|
|
1238
|
-
for (const
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
Array.from(
|
|
1250
|
+
for (const r of i)
|
|
1251
|
+
r.replaceWith(
|
|
1252
|
+
_e(
|
|
1253
|
+
Array.from(r.classList).join(" "),
|
|
1242
1254
|
t
|
|
1243
1255
|
)
|
|
1244
1256
|
);
|
|
1245
1257
|
}
|
|
1246
1258
|
function aa(e) {
|
|
1247
|
-
if (e.getElementById(
|
|
1259
|
+
if (e.getElementById(Nn))
|
|
1248
1260
|
return;
|
|
1249
1261
|
const t = e.createElement("style");
|
|
1250
|
-
t.id =
|
|
1262
|
+
t.id = Nn, t.textContent = `@font-face {
|
|
1251
1263
|
font-family: "Architects Daughter";
|
|
1252
1264
|
font-style: normal;
|
|
1253
1265
|
font-weight: 400;
|
|
@@ -1261,7 +1273,7 @@ function ra({
|
|
|
1261
1273
|
launcherDragHandle: n,
|
|
1262
1274
|
getPosition: o,
|
|
1263
1275
|
setPosition: i,
|
|
1264
|
-
persist:
|
|
1276
|
+
persist: r
|
|
1265
1277
|
}) {
|
|
1266
1278
|
let l = null, p = null, d = null, c = !1, u = null;
|
|
1267
1279
|
const m = () => {
|
|
@@ -1272,11 +1284,11 @@ function ra({
|
|
|
1272
1284
|
if (l !== h.pointerId || !p || !d)
|
|
1273
1285
|
return;
|
|
1274
1286
|
h.preventDefault();
|
|
1275
|
-
const A = h.clientX - p.x,
|
|
1276
|
-
!c && Math.hypot(A,
|
|
1277
|
-
},
|
|
1278
|
-
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY },
|
|
1279
|
-
},
|
|
1287
|
+
const A = h.clientX - p.x, L = h.clientY - p.y;
|
|
1288
|
+
!c && Math.hypot(A, L) < Jt || (c = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: d.x + A, y: d.y + L }));
|
|
1289
|
+
}, R = (h) => {
|
|
1290
|
+
l === h.pointerId && (h.preventDefault(), h.stopPropagation(), c && (u = { x: h.clientX, y: h.clientY }, r()), m());
|
|
1291
|
+
}, C = (h) => {
|
|
1280
1292
|
l === h.pointerId && (h.preventDefault(), m());
|
|
1281
1293
|
}, g = (h) => {
|
|
1282
1294
|
if (!u)
|
|
@@ -1284,17 +1296,17 @@ function ra({
|
|
|
1284
1296
|
const A = Math.hypot(
|
|
1285
1297
|
h.clientX - u.x,
|
|
1286
1298
|
h.clientY - u.y
|
|
1287
|
-
) <=
|
|
1299
|
+
) <= Jt;
|
|
1288
1300
|
u = null, A && (h.preventDefault(), h.stopPropagation());
|
|
1289
|
-
},
|
|
1301
|
+
}, y = (h) => {
|
|
1290
1302
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1291
1303
|
return;
|
|
1292
|
-
const A = h.shiftKey ?
|
|
1293
|
-
let
|
|
1294
|
-
h.key === "ArrowUp" ?
|
|
1304
|
+
const A = h.shiftKey ? go : uo, L = o();
|
|
1305
|
+
let M = null;
|
|
1306
|
+
h.key === "ArrowUp" ? M = { x: L.x, y: L.y - A } : h.key === "ArrowDown" ? M = { x: L.x, y: L.y + A } : h.key === "ArrowLeft" ? M = { x: L.x - A, y: L.y } : h.key === "ArrowRight" && (M = { x: L.x + A, y: L.y }), M && (h.preventDefault(), h.stopPropagation(), i(M), r());
|
|
1295
1307
|
};
|
|
1296
|
-
return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup",
|
|
1297
|
-
t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup",
|
|
1308
|
+
return t.addEventListener("pointerdown", k), t.addEventListener("pointermove", v), t.addEventListener("pointerup", R), t.addEventListener("pointercancel", C), t.addEventListener("click", g, !0), n.addEventListener("keydown", y), () => {
|
|
1309
|
+
t.removeEventListener("pointerdown", k), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", R), t.removeEventListener("pointercancel", C), t.removeEventListener("click", g, !0), n.removeEventListener("keydown", y);
|
|
1298
1310
|
};
|
|
1299
1311
|
}
|
|
1300
1312
|
function la({
|
|
@@ -1304,41 +1316,41 @@ function la({
|
|
|
1304
1316
|
setBounds: o,
|
|
1305
1317
|
persist: i
|
|
1306
1318
|
}) {
|
|
1307
|
-
let
|
|
1319
|
+
let r = null, l = null, p = null, d = null, c = !1;
|
|
1308
1320
|
const u = () => {
|
|
1309
|
-
|
|
1321
|
+
r = null, l = null, p = null, d = null, c = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1310
1322
|
}, m = (g) => {
|
|
1311
|
-
const
|
|
1312
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1323
|
+
const y = g.currentTarget, h = y.dataset.resizeDirection;
|
|
1324
|
+
!e.classList.contains("pluno-pa-widget--open") || !Un(h) || (g.preventDefault(), g.stopPropagation(), r = g.pointerId, l = h, p = { x: g.clientX, y: g.clientY }, d = n(), c = !1, y.setPointerCapture?.(g.pointerId));
|
|
1313
1325
|
}, k = (g) => {
|
|
1314
|
-
if (
|
|
1326
|
+
if (r !== g.pointerId || !l || !p || !d)
|
|
1315
1327
|
return;
|
|
1316
1328
|
g.preventDefault(), g.stopPropagation();
|
|
1317
|
-
const
|
|
1318
|
-
!c && Math.hypot(
|
|
1319
|
-
|
|
1329
|
+
const y = g.clientX - p.x, h = g.clientY - p.y;
|
|
1330
|
+
!c && Math.hypot(y, h) < Jt || (c = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1331
|
+
Bn(d, l, y, h)
|
|
1320
1332
|
));
|
|
1321
1333
|
}, v = (g) => {
|
|
1322
|
-
|
|
1323
|
-
},
|
|
1324
|
-
|
|
1325
|
-
},
|
|
1326
|
-
const h = g.currentTarget.dataset.resizeDirection, A = g.shiftKey ?
|
|
1327
|
-
let
|
|
1328
|
-
|
|
1334
|
+
r === g.pointerId && (g.preventDefault(), g.stopPropagation(), c && i(), u());
|
|
1335
|
+
}, R = (g) => {
|
|
1336
|
+
r === g.pointerId && (g.preventDefault(), u());
|
|
1337
|
+
}, C = (g) => {
|
|
1338
|
+
const h = g.currentTarget.dataset.resizeDirection, A = g.shiftKey ? go : uo, L = n();
|
|
1339
|
+
let M = 0, U = 0;
|
|
1340
|
+
Un(h) && (g.key === "ArrowLeft" ? M = -A : g.key === "ArrowRight" ? M = A : g.key === "ArrowUp" ? U = -A : g.key === "ArrowDown" && (U = A), !(M === 0 && U === 0) && (g.preventDefault(), g.stopPropagation(), o(Bn(L, h, M, U)), i()));
|
|
1329
1341
|
};
|
|
1330
1342
|
for (const g of t)
|
|
1331
|
-
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel",
|
|
1343
|
+
g.addEventListener("pointerdown", m), g.addEventListener("pointermove", k), g.addEventListener("pointerup", v), g.addEventListener("pointercancel", R), g.addEventListener("keydown", C);
|
|
1332
1344
|
return () => {
|
|
1333
1345
|
for (const g of t)
|
|
1334
|
-
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel",
|
|
1346
|
+
g.removeEventListener("pointerdown", m), g.removeEventListener("pointermove", k), g.removeEventListener("pointerup", v), g.removeEventListener("pointercancel", R), g.removeEventListener("keydown", C);
|
|
1335
1347
|
};
|
|
1336
1348
|
}
|
|
1337
|
-
function
|
|
1349
|
+
function Un(e) {
|
|
1338
1350
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1339
1351
|
}
|
|
1340
|
-
function
|
|
1341
|
-
const i =
|
|
1352
|
+
function Bn(e, t, n, o) {
|
|
1353
|
+
const i = Z(), r = Fn({
|
|
1342
1354
|
leading: e.position.x,
|
|
1343
1355
|
length: e.size.width,
|
|
1344
1356
|
delta: n,
|
|
@@ -1347,114 +1359,114 @@ function On(e, t, n, o) {
|
|
|
1347
1359
|
minLeading: T,
|
|
1348
1360
|
maxTrailing: i.width - T,
|
|
1349
1361
|
minLength: Math.min(
|
|
1350
|
-
|
|
1362
|
+
an,
|
|
1351
1363
|
i.width - T * 2
|
|
1352
1364
|
)
|
|
1353
|
-
}), l =
|
|
1365
|
+
}), l = Fn({
|
|
1354
1366
|
leading: e.position.y,
|
|
1355
1367
|
length: e.size.height,
|
|
1356
1368
|
delta: o,
|
|
1357
1369
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1358
1370
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1359
|
-
minLeading:
|
|
1371
|
+
minLeading: Le,
|
|
1360
1372
|
maxTrailing: i.height - T,
|
|
1361
1373
|
minLength: Math.min(
|
|
1362
|
-
|
|
1363
|
-
i.height -
|
|
1374
|
+
rn,
|
|
1375
|
+
i.height - Le - T
|
|
1364
1376
|
)
|
|
1365
1377
|
});
|
|
1366
1378
|
return {
|
|
1367
|
-
position: { x:
|
|
1368
|
-
size: { width:
|
|
1379
|
+
position: { x: r.leading, y: l.leading },
|
|
1380
|
+
size: { width: r.length, height: l.length }
|
|
1369
1381
|
};
|
|
1370
1382
|
}
|
|
1371
|
-
function
|
|
1383
|
+
function Fn({
|
|
1372
1384
|
leading: e,
|
|
1373
1385
|
length: t,
|
|
1374
1386
|
delta: n,
|
|
1375
1387
|
resizeLeading: o,
|
|
1376
1388
|
resizeTrailing: i,
|
|
1377
|
-
minLeading:
|
|
1389
|
+
minLeading: r,
|
|
1378
1390
|
maxTrailing: l,
|
|
1379
1391
|
minLength: p
|
|
1380
1392
|
}) {
|
|
1381
1393
|
const d = e + t;
|
|
1382
1394
|
if (o) {
|
|
1383
1395
|
const c = e + n;
|
|
1384
|
-
if (c >=
|
|
1385
|
-
const m =
|
|
1396
|
+
if (c >= r) {
|
|
1397
|
+
const m = X(c, r, d - p);
|
|
1386
1398
|
return { leading: m, length: d - m };
|
|
1387
1399
|
}
|
|
1388
|
-
const u =
|
|
1389
|
-
d +
|
|
1400
|
+
const u = X(
|
|
1401
|
+
d + r - c,
|
|
1390
1402
|
d,
|
|
1391
1403
|
l
|
|
1392
1404
|
);
|
|
1393
|
-
return { leading:
|
|
1405
|
+
return { leading: r, length: u - r };
|
|
1394
1406
|
}
|
|
1395
1407
|
if (i) {
|
|
1396
1408
|
const c = d + n;
|
|
1397
1409
|
if (c <= l) {
|
|
1398
|
-
const m =
|
|
1410
|
+
const m = X(
|
|
1399
1411
|
c,
|
|
1400
1412
|
e + p,
|
|
1401
1413
|
l
|
|
1402
1414
|
);
|
|
1403
1415
|
return { leading: e, length: m - e };
|
|
1404
1416
|
}
|
|
1405
|
-
const u =
|
|
1417
|
+
const u = X(
|
|
1406
1418
|
e - (c - l),
|
|
1407
|
-
|
|
1419
|
+
r,
|
|
1408
1420
|
e
|
|
1409
1421
|
);
|
|
1410
1422
|
return { leading: u, length: l - u };
|
|
1411
1423
|
}
|
|
1412
1424
|
return { leading: e, length: t };
|
|
1413
1425
|
}
|
|
1414
|
-
function
|
|
1415
|
-
const n =
|
|
1426
|
+
function ht(e, t = !0) {
|
|
1427
|
+
const n = Z();
|
|
1416
1428
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1417
1429
|
return e.classList.contains("pluno-pa-widget--scribble") ? {
|
|
1418
1430
|
width: Hi,
|
|
1419
1431
|
height: Wi
|
|
1420
|
-
} : { width:
|
|
1432
|
+
} : { width: Rn, height: Rn };
|
|
1421
1433
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1422
1434
|
return {
|
|
1423
|
-
width: t && i && o.width > 0 ? o.width : Math.min(
|
|
1424
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? $i :
|
|
1435
|
+
width: t && i && o.width > 0 ? o.width : Math.min(po, n.width - 36),
|
|
1436
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? $i : so
|
|
1425
1437
|
};
|
|
1426
1438
|
}
|
|
1427
1439
|
function pa() {
|
|
1428
|
-
const e =
|
|
1440
|
+
const e = Z();
|
|
1429
1441
|
return {
|
|
1430
1442
|
width: Math.min(
|
|
1431
|
-
|
|
1443
|
+
X(
|
|
1432
1444
|
e.width * ji,
|
|
1433
|
-
|
|
1445
|
+
an,
|
|
1434
1446
|
qi
|
|
1435
1447
|
),
|
|
1436
1448
|
e.width - T * 2
|
|
1437
1449
|
),
|
|
1438
1450
|
height: Math.min(
|
|
1439
|
-
|
|
1451
|
+
X(
|
|
1440
1452
|
e.height * Ki,
|
|
1441
|
-
|
|
1453
|
+
rn,
|
|
1442
1454
|
Vi
|
|
1443
1455
|
),
|
|
1444
|
-
e.height -
|
|
1456
|
+
e.height - Le - T
|
|
1445
1457
|
)
|
|
1446
1458
|
};
|
|
1447
1459
|
}
|
|
1448
|
-
function
|
|
1449
|
-
return e ?
|
|
1460
|
+
function Ue(e = null) {
|
|
1461
|
+
return e ? ft(e) : pa();
|
|
1450
1462
|
}
|
|
1451
|
-
function
|
|
1452
|
-
const t =
|
|
1463
|
+
function ft(e) {
|
|
1464
|
+
const t = Z();
|
|
1453
1465
|
return {
|
|
1454
|
-
width:
|
|
1466
|
+
width: X(
|
|
1455
1467
|
e.width,
|
|
1456
1468
|
Math.min(
|
|
1457
|
-
|
|
1469
|
+
an,
|
|
1458
1470
|
t.width - T * 2
|
|
1459
1471
|
),
|
|
1460
1472
|
Math.max(
|
|
@@ -1462,59 +1474,59 @@ function ht(e) {
|
|
|
1462
1474
|
t.width - T * 2
|
|
1463
1475
|
)
|
|
1464
1476
|
),
|
|
1465
|
-
height:
|
|
1477
|
+
height: X(
|
|
1466
1478
|
e.height,
|
|
1467
1479
|
Math.min(
|
|
1468
|
-
|
|
1469
|
-
t.height -
|
|
1480
|
+
rn,
|
|
1481
|
+
t.height - Le - T
|
|
1470
1482
|
),
|
|
1471
1483
|
Math.max(
|
|
1472
1484
|
T,
|
|
1473
|
-
t.height -
|
|
1485
|
+
t.height - Le - T
|
|
1474
1486
|
)
|
|
1475
1487
|
)
|
|
1476
1488
|
};
|
|
1477
1489
|
}
|
|
1478
|
-
function
|
|
1490
|
+
function Ot(e, t) {
|
|
1479
1491
|
if (!t) {
|
|
1480
1492
|
e.style.removeProperty("--pluno-pa-panel-width"), e.style.removeProperty("--pluno-pa-panel-height");
|
|
1481
1493
|
return;
|
|
1482
1494
|
}
|
|
1483
|
-
const n =
|
|
1495
|
+
const n = ft(t);
|
|
1484
1496
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1485
1497
|
}
|
|
1486
1498
|
function sa(e, t, n) {
|
|
1487
1499
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1488
1500
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1489
1501
|
return { x: o, y: i };
|
|
1490
|
-
const
|
|
1491
|
-
if (
|
|
1492
|
-
return { x:
|
|
1493
|
-
const l =
|
|
1502
|
+
const r = e.getBoundingClientRect();
|
|
1503
|
+
if (r.width > 0 || r.height > 0)
|
|
1504
|
+
return { x: r.left, y: r.top };
|
|
1505
|
+
const l = Z();
|
|
1494
1506
|
return {
|
|
1495
1507
|
x: t === "bottom-left" ? 26 : l.width - 26 - n.width,
|
|
1496
1508
|
y: l.height - 24 - n.height
|
|
1497
1509
|
};
|
|
1498
1510
|
}
|
|
1499
|
-
function
|
|
1500
|
-
const o =
|
|
1501
|
-
return t ?
|
|
1511
|
+
function Ut(e, t, n) {
|
|
1512
|
+
const o = ht(e, !1);
|
|
1513
|
+
return t ? Qt(
|
|
1502
1514
|
e,
|
|
1503
|
-
|
|
1515
|
+
fo(t, o),
|
|
1504
1516
|
o
|
|
1505
1517
|
) : da(n === "bottom-left" ? "bottom-left" : "bottom-right", o, Gi);
|
|
1506
1518
|
}
|
|
1507
1519
|
function da(e, t, n) {
|
|
1508
|
-
const o =
|
|
1520
|
+
const o = Z();
|
|
1509
1521
|
return {
|
|
1510
1522
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
1511
1523
|
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1512
1524
|
};
|
|
1513
1525
|
}
|
|
1514
|
-
function
|
|
1515
|
-
const o =
|
|
1526
|
+
function Qt(e, t, n) {
|
|
1527
|
+
const o = Z(), i = T + ga(e);
|
|
1516
1528
|
return {
|
|
1517
|
-
x:
|
|
1529
|
+
x: X(
|
|
1518
1530
|
t.x,
|
|
1519
1531
|
T,
|
|
1520
1532
|
Math.max(
|
|
@@ -1522,7 +1534,7 @@ function Xt(e, t, n) {
|
|
|
1522
1534
|
o.width - n.width - T
|
|
1523
1535
|
)
|
|
1524
1536
|
),
|
|
1525
|
-
y:
|
|
1537
|
+
y: X(
|
|
1526
1538
|
t.y,
|
|
1527
1539
|
i,
|
|
1528
1540
|
Math.max(
|
|
@@ -1532,15 +1544,15 @@ function Xt(e, t, n) {
|
|
|
1532
1544
|
)
|
|
1533
1545
|
};
|
|
1534
1546
|
}
|
|
1535
|
-
function
|
|
1536
|
-
const n =
|
|
1547
|
+
function fo(e, t) {
|
|
1548
|
+
const n = Z();
|
|
1537
1549
|
return {
|
|
1538
1550
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
1539
1551
|
y: e.anchor.startsWith("bottom") ? n.height - t.height - e.y : e.y
|
|
1540
1552
|
};
|
|
1541
1553
|
}
|
|
1542
1554
|
function ca(e, t) {
|
|
1543
|
-
const n = ua(e, t), o =
|
|
1555
|
+
const n = ua(e, t), o = Z();
|
|
1544
1556
|
return {
|
|
1545
1557
|
anchor: n,
|
|
1546
1558
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
@@ -1548,23 +1560,23 @@ function ca(e, t) {
|
|
|
1548
1560
|
};
|
|
1549
1561
|
}
|
|
1550
1562
|
function ua(e, t) {
|
|
1551
|
-
const n =
|
|
1552
|
-
return `${
|
|
1563
|
+
const n = Z(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1564
|
+
return `${r}-${l}`;
|
|
1553
1565
|
}
|
|
1554
1566
|
function ga(e) {
|
|
1555
1567
|
return e.classList.contains("pluno-pa-widget--scribble") ? Ji : Zi;
|
|
1556
1568
|
}
|
|
1557
|
-
function
|
|
1558
|
-
const i =
|
|
1559
|
-
x: n === "bottom-left" ? t.x : t.x + i.width -
|
|
1560
|
-
y: t.y + i.height -
|
|
1569
|
+
function Bt(e, t, n, o = null) {
|
|
1570
|
+
const i = ht(e), r = Ue(o), l = {
|
|
1571
|
+
x: n === "bottom-left" ? t.x : t.x + i.width - r.width,
|
|
1572
|
+
y: t.y + i.height - r.height
|
|
1561
1573
|
};
|
|
1562
|
-
return
|
|
1574
|
+
return ct(l, r);
|
|
1563
1575
|
}
|
|
1564
|
-
function
|
|
1565
|
-
const n =
|
|
1576
|
+
function ct(e, t) {
|
|
1577
|
+
const n = Z();
|
|
1566
1578
|
return {
|
|
1567
|
-
x:
|
|
1579
|
+
x: X(
|
|
1568
1580
|
e.x,
|
|
1569
1581
|
T,
|
|
1570
1582
|
Math.max(
|
|
@@ -1572,17 +1584,17 @@ function st(e, t) {
|
|
|
1572
1584
|
n.width - t.width - T
|
|
1573
1585
|
)
|
|
1574
1586
|
),
|
|
1575
|
-
y:
|
|
1587
|
+
y: X(
|
|
1576
1588
|
e.y,
|
|
1577
|
-
|
|
1589
|
+
Le,
|
|
1578
1590
|
Math.max(
|
|
1579
|
-
|
|
1591
|
+
Le,
|
|
1580
1592
|
n.height - t.height - T
|
|
1581
1593
|
)
|
|
1582
1594
|
)
|
|
1583
1595
|
};
|
|
1584
1596
|
}
|
|
1585
|
-
function
|
|
1597
|
+
function ke(e, t) {
|
|
1586
1598
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1587
1599
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1588
1600
|
return;
|
|
@@ -1592,16 +1604,16 @@ function Ee(e, t) {
|
|
|
1592
1604
|
function ha(e, t) {
|
|
1593
1605
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1594
1606
|
}
|
|
1595
|
-
function
|
|
1607
|
+
function Hn(e) {
|
|
1596
1608
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1597
1609
|
}
|
|
1598
|
-
function
|
|
1610
|
+
function Z() {
|
|
1599
1611
|
return {
|
|
1600
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1601
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1612
|
+
width: window.innerWidth || document.documentElement.clientWidth || po + T * 2,
|
|
1613
|
+
height: window.innerHeight || document.documentElement.clientHeight || so + T * 2
|
|
1602
1614
|
};
|
|
1603
1615
|
}
|
|
1604
|
-
function
|
|
1616
|
+
function Ft(e) {
|
|
1605
1617
|
const t = e.getBoundingClientRect();
|
|
1606
1618
|
return {
|
|
1607
1619
|
x: Math.round(t.x),
|
|
@@ -1610,10 +1622,10 @@ function Ot(e) {
|
|
|
1610
1622
|
height: Math.round(t.height)
|
|
1611
1623
|
};
|
|
1612
1624
|
}
|
|
1613
|
-
function
|
|
1625
|
+
function X(e, t, n) {
|
|
1614
1626
|
return Math.min(Math.max(e, t), n);
|
|
1615
1627
|
}
|
|
1616
|
-
function
|
|
1628
|
+
function ne(e, t, n) {
|
|
1617
1629
|
if (typeof window > "u")
|
|
1618
1630
|
return;
|
|
1619
1631
|
const o = window, i = {
|
|
@@ -1621,15 +1633,15 @@ function Q(e, t, n) {
|
|
|
1621
1633
|
source: e,
|
|
1622
1634
|
message: t,
|
|
1623
1635
|
details: n
|
|
1624
|
-
},
|
|
1625
|
-
|
|
1626
|
-
new CustomEvent(
|
|
1636
|
+
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1637
|
+
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1638
|
+
new CustomEvent(Di, { detail: i })
|
|
1627
1639
|
);
|
|
1628
1640
|
}
|
|
1629
1641
|
function ma(e, t) {
|
|
1630
|
-
|
|
1642
|
+
ne("web-sdk.widget.position", e, t);
|
|
1631
1643
|
}
|
|
1632
|
-
function
|
|
1644
|
+
function Ht(e, t, n) {
|
|
1633
1645
|
const o = t.value.trim();
|
|
1634
1646
|
return !o && n.length === 0 ? n : (t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(o, {
|
|
1635
1647
|
attachments: n.length > 0 ? n.map(ba) : void 0
|
|
@@ -1650,12 +1662,12 @@ function wa(e, t, n, o) {
|
|
|
1650
1662
|
function ba(e) {
|
|
1651
1663
|
return e;
|
|
1652
1664
|
}
|
|
1653
|
-
function
|
|
1665
|
+
function Ye(e) {
|
|
1654
1666
|
e.style.height = "0px";
|
|
1655
1667
|
const t = Math.max(22, Math.min(e.scrollHeight, 140));
|
|
1656
1668
|
e.style.height = `${t}px`, e.style.overflowY = e.scrollHeight > 140 ? "auto" : "hidden";
|
|
1657
1669
|
}
|
|
1658
|
-
function
|
|
1670
|
+
function Xe(e, t = () => !0) {
|
|
1659
1671
|
e.scrollTop = e.scrollHeight, window.requestAnimationFrame(() => {
|
|
1660
1672
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1661
1673
|
});
|
|
@@ -1697,15 +1709,15 @@ function Ca(e, t) {
|
|
|
1697
1709
|
["hour", 36e5],
|
|
1698
1710
|
["min", 6e4]
|
|
1699
1711
|
];
|
|
1700
|
-
for (const [
|
|
1712
|
+
for (const [r, l] of i)
|
|
1701
1713
|
if (o >= l) {
|
|
1702
1714
|
const p = Math.max(1, Math.floor(o / l));
|
|
1703
|
-
return
|
|
1715
|
+
return r === "min" ? `${p} min` : `${p} ${r}${p === 1 ? "" : "s"}`;
|
|
1704
1716
|
}
|
|
1705
1717
|
return "now";
|
|
1706
1718
|
}
|
|
1707
1719
|
function Sa(e, t, n, o, i) {
|
|
1708
|
-
e.appendChild(
|
|
1720
|
+
e.appendChild(Ra()), e.appendChild(
|
|
1709
1721
|
Ea(
|
|
1710
1722
|
t,
|
|
1711
1723
|
n,
|
|
@@ -1713,10 +1725,10 @@ function Sa(e, t, n, o, i) {
|
|
|
1713
1725
|
i
|
|
1714
1726
|
)
|
|
1715
1727
|
), e.appendChild(
|
|
1716
|
-
|
|
1728
|
+
wt(
|
|
1717
1729
|
"pluno-pa-widget__close",
|
|
1718
1730
|
"Close",
|
|
1719
|
-
|
|
1731
|
+
Da(16),
|
|
1720
1732
|
!0
|
|
1721
1733
|
)
|
|
1722
1734
|
), e.appendChild(ka(n));
|
|
@@ -1728,21 +1740,21 @@ function Ea(e, t, n, o) {
|
|
|
1728
1740
|
d.type = "button", d.className = "pluno-pa-widget__launcher-drag-handle", d.setAttribute("aria-label", "Move Pluno launcher"), d.title = "Move Pluno launcher", i.appendChild(d);
|
|
1729
1741
|
}
|
|
1730
1742
|
i.appendChild(
|
|
1731
|
-
|
|
1743
|
+
xo(
|
|
1732
1744
|
"pluno-pa-widget__scribble-spirals--launcher",
|
|
1733
1745
|
10
|
|
1734
1746
|
)
|
|
1735
1747
|
), i.appendChild(
|
|
1736
|
-
|
|
1748
|
+
_e(
|
|
1737
1749
|
"pluno-pa-widget__character--launcher",
|
|
1738
1750
|
t
|
|
1739
1751
|
)
|
|
1740
1752
|
);
|
|
1741
|
-
const
|
|
1742
|
-
|
|
1753
|
+
const r = document.createElement("span");
|
|
1754
|
+
r.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(r);
|
|
1743
1755
|
const l = document.createElement("input");
|
|
1744
1756
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
|
|
1745
|
-
const p =
|
|
1757
|
+
const p = mt("Working...");
|
|
1746
1758
|
if (p.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(p), o) {
|
|
1747
1759
|
const d = document.createElement("button");
|
|
1748
1760
|
d.type = "button", d.className = "pluno-pa-widget__launcher-minimize", d.textContent = "-", d.setAttribute("aria-label", "Minimize Pluno on this site"), d.title = "Minimize Pluno on this site", i.appendChild(d);
|
|
@@ -1752,7 +1764,7 @@ function Ea(e, t, n, o) {
|
|
|
1752
1764
|
function ka(e) {
|
|
1753
1765
|
const t = document.createElement("section");
|
|
1754
1766
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
1755
|
-
|
|
1767
|
+
xo("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
1756
1768
|
);
|
|
1757
1769
|
const n = document.createElement("div");
|
|
1758
1770
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
@@ -1760,33 +1772,33 @@ function ka(e) {
|
|
|
1760
1772
|
o.className = "pluno-pa-widget__timeline", o.appendChild(Ta(e));
|
|
1761
1773
|
const i = document.createElement("div");
|
|
1762
1774
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
1763
|
-
const
|
|
1764
|
-
|
|
1775
|
+
const r = document.createElement("div");
|
|
1776
|
+
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
|
|
1765
1777
|
const l = document.createElement("button");
|
|
1766
1778
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
1767
1779
|
const p = document.createElement("div");
|
|
1768
1780
|
return p.className = "pluno-pa-widget__top-actions", p.appendChild(
|
|
1769
|
-
|
|
1781
|
+
wt(
|
|
1770
1782
|
"pluno-pa-widget__history",
|
|
1771
|
-
|
|
1772
|
-
|
|
1783
|
+
en(),
|
|
1784
|
+
Ma(),
|
|
1773
1785
|
!0
|
|
1774
1786
|
)
|
|
1775
|
-
), n.appendChild(p), n.appendChild(
|
|
1776
|
-
|
|
1777
|
-
), t.appendChild(
|
|
1778
|
-
|
|
1787
|
+
), n.appendChild(p), n.appendChild(Pa()), t.appendChild(n), t.appendChild(La()), t.appendChild(Ia()), t.appendChild(be("left", "Resize Pluno from left")), t.appendChild(
|
|
1788
|
+
be("right", "Resize Pluno from right")
|
|
1789
|
+
), t.appendChild(be("top", "Resize Pluno from top")), t.appendChild(
|
|
1790
|
+
be("bottom", "Resize Pluno from bottom")
|
|
1779
1791
|
), t.appendChild(
|
|
1780
|
-
|
|
1792
|
+
be("top-left", "Resize Pluno from top left")
|
|
1781
1793
|
), t.appendChild(
|
|
1782
|
-
|
|
1794
|
+
be("top-right", "Resize Pluno from top right")
|
|
1783
1795
|
), t.appendChild(
|
|
1784
|
-
|
|
1796
|
+
be("bottom-left", "Resize Pluno from bottom left")
|
|
1785
1797
|
), t.appendChild(
|
|
1786
|
-
|
|
1798
|
+
be("bottom-right", "Resize Pluno from bottom right")
|
|
1787
1799
|
), t;
|
|
1788
1800
|
}
|
|
1789
|
-
function
|
|
1801
|
+
function be(e, t) {
|
|
1790
1802
|
const n = document.createElement("button");
|
|
1791
1803
|
return n.type = "button", n.className = [
|
|
1792
1804
|
"pluno-pa-widget__resize-handle",
|
|
@@ -1804,10 +1816,10 @@ function La() {
|
|
|
1804
1816
|
o.type = "button", o.className = "pluno-pa-widget__notify-suggestion-enable", o.textContent = "Notify me";
|
|
1805
1817
|
const i = document.createElement("button");
|
|
1806
1818
|
i.type = "button", i.className = "pluno-pa-widget__notify-suggestion-later", i.textContent = "Later";
|
|
1807
|
-
const
|
|
1808
|
-
return
|
|
1819
|
+
const r = document.createElement("button");
|
|
1820
|
+
return r.type = "button", r.className = "pluno-pa-widget__notify-suggestion-never", r.textContent = "Never", n.append(o, i, r), e.append(t, n), e;
|
|
1809
1821
|
}
|
|
1810
|
-
function
|
|
1822
|
+
function Ia() {
|
|
1811
1823
|
const e = document.createElement("form");
|
|
1812
1824
|
e.className = "pluno-pa-widget__composer";
|
|
1813
1825
|
const t = document.createElement("div");
|
|
@@ -1818,14 +1830,14 @@ function Pa() {
|
|
|
1818
1830
|
o.className = "pluno-pa-widget__attachments", o.hidden = !0, e.appendChild(o);
|
|
1819
1831
|
const i = document.createElement("div");
|
|
1820
1832
|
i.className = "pluno-pa-widget__composer-inner";
|
|
1821
|
-
const
|
|
1822
|
-
|
|
1833
|
+
const r = document.createElement("input");
|
|
1834
|
+
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
1823
1835
|
const l = document.createElement("button");
|
|
1824
1836
|
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(Ua()), l.appendChild(Ba()), i.appendChild(l);
|
|
1825
1837
|
const p = document.createElement("textarea");
|
|
1826
1838
|
p.className = "pluno-pa-widget__input", p.rows = 1, p.placeholder = "Ask for anything...", i.appendChild(p);
|
|
1827
1839
|
const d = document.createElement("button");
|
|
1828
|
-
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(
|
|
1840
|
+
d.type = "button", d.className = "pluno-pa-widget__send", d.setAttribute("aria-label", "Send"), d.appendChild(vo()), i.appendChild(d), e.appendChild(i);
|
|
1829
1841
|
const c = document.createElement("div");
|
|
1830
1842
|
c.className = "pluno-pa-widget__composer-meta";
|
|
1831
1843
|
const u = document.createElement("a");
|
|
@@ -1833,17 +1845,17 @@ function Pa() {
|
|
|
1833
1845
|
const m = document.createElement("span");
|
|
1834
1846
|
return m.className = "pluno-pa-widget__ai-disclaimer", m.textContent = "AI can make mistakes. Verify outputs.", c.appendChild(m), e.appendChild(c), e;
|
|
1835
1847
|
}
|
|
1836
|
-
function
|
|
1848
|
+
function en() {
|
|
1837
1849
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
1838
1850
|
}
|
|
1839
|
-
function
|
|
1851
|
+
function Pa() {
|
|
1840
1852
|
const e = document.createElement("section");
|
|
1841
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
1853
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", en());
|
|
1842
1854
|
const t = document.createElement("div");
|
|
1843
1855
|
t.className = "pluno-pa-widget__history-header";
|
|
1844
1856
|
const n = document.createElement("strong");
|
|
1845
|
-
n.textContent =
|
|
1846
|
-
const o =
|
|
1857
|
+
n.textContent = en();
|
|
1858
|
+
const o = wt(
|
|
1847
1859
|
"pluno-pa-widget__history-close",
|
|
1848
1860
|
"Close recent chats",
|
|
1849
1861
|
Oa(),
|
|
@@ -1852,23 +1864,23 @@ function Ia() {
|
|
|
1852
1864
|
t.append(n, o);
|
|
1853
1865
|
const i = document.createElement("div");
|
|
1854
1866
|
i.className = "pluno-pa-widget__history-list";
|
|
1855
|
-
const
|
|
1856
|
-
return
|
|
1867
|
+
const r = document.createElement("p");
|
|
1868
|
+
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
1857
1869
|
}
|
|
1858
1870
|
function Ta(e) {
|
|
1859
1871
|
const t = document.createElement("div");
|
|
1860
1872
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
1861
|
-
|
|
1873
|
+
_e(
|
|
1862
1874
|
"pluno-pa-widget__character--empty",
|
|
1863
1875
|
e
|
|
1864
1876
|
)
|
|
1865
|
-
), t.appendChild(
|
|
1877
|
+
), t.appendChild(wo()), t;
|
|
1866
1878
|
}
|
|
1867
|
-
function
|
|
1879
|
+
function wo() {
|
|
1868
1880
|
const e = document.createElement("div");
|
|
1869
1881
|
return e.className = "pluno-pa-widget__empty", e.appendChild(document.createTextNode("Hey there, I'm Pluno 👋")), e.appendChild(document.createElement("br")), e.appendChild(document.createTextNode("What do you want to do today?")), e;
|
|
1870
1882
|
}
|
|
1871
|
-
function
|
|
1883
|
+
function bo(e, t) {
|
|
1872
1884
|
e.replaceChildren(), e.setAttribute(
|
|
1873
1885
|
"aria-label",
|
|
1874
1886
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -1880,9 +1892,9 @@ function fo(e, t) {
|
|
|
1880
1892
|
)
|
|
1881
1893
|
);
|
|
1882
1894
|
}
|
|
1883
|
-
function
|
|
1884
|
-
const n = `pluno-pa-character-${
|
|
1885
|
-
|
|
1895
|
+
function _e(e, t) {
|
|
1896
|
+
const n = `pluno-pa-character-${zn}`;
|
|
1897
|
+
zn += 1;
|
|
1886
1898
|
const o = t.scribbleStyle ? Na(t.accentColor, n) : Aa(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
1887
1899
|
return o.setAttribute(
|
|
1888
1900
|
"class",
|
|
@@ -1901,7 +1913,7 @@ function Aa(e, t) {
|
|
|
1901
1913
|
eyeShadow: `${t}-eyeShadow`,
|
|
1902
1914
|
pupilGloss: `${t}-pupilGloss`,
|
|
1903
1915
|
boltClip: `${t}-boltClip`
|
|
1904
|
-
}, i =
|
|
1916
|
+
}, i = _o(), r = f(i, "defs"), l = f(r, "linearGradient", {
|
|
1905
1917
|
id: o.boltFill,
|
|
1906
1918
|
x1: "420",
|
|
1907
1919
|
y1: "180",
|
|
@@ -1910,7 +1922,7 @@ function Aa(e, t) {
|
|
|
1910
1922
|
gradientUnits: "userSpaceOnUse"
|
|
1911
1923
|
});
|
|
1912
1924
|
O(l, "0", n.top), O(l, "0.36", n.middle), O(l, "0.72", n.bottom), O(l, "1", n.bottom);
|
|
1913
|
-
const p = f(
|
|
1925
|
+
const p = f(r, "linearGradient", {
|
|
1914
1926
|
id: o.boltEdge,
|
|
1915
1927
|
x1: "470",
|
|
1916
1928
|
y1: "145",
|
|
@@ -1919,28 +1931,28 @@ function Aa(e, t) {
|
|
|
1919
1931
|
gradientUnits: "userSpaceOnUse"
|
|
1920
1932
|
});
|
|
1921
1933
|
O(p, "0", n.edgeStart), O(p, "0.32", n.edgeMiddle), O(p, "0.78", n.edgeEnd), O(p, "1", n.edgeEnd);
|
|
1922
|
-
const d = f(
|
|
1934
|
+
const d = f(r, "radialGradient", {
|
|
1923
1935
|
id: o.boltGlow,
|
|
1924
1936
|
cx: "50%",
|
|
1925
1937
|
cy: "22%",
|
|
1926
1938
|
r: "82%"
|
|
1927
1939
|
});
|
|
1928
1940
|
O(d, "0", n.glow, "0.72"), O(d, "0.5", n.middle, "0.44"), O(d, "1", n.bottom, "0");
|
|
1929
|
-
const c = f(
|
|
1941
|
+
const c = f(r, "radialGradient", {
|
|
1930
1942
|
id: o.eyeWhite,
|
|
1931
1943
|
cx: "35%",
|
|
1932
1944
|
cy: "25%",
|
|
1933
1945
|
r: "70%"
|
|
1934
1946
|
});
|
|
1935
1947
|
O(c, "0", "#ffffff"), O(c, "0.72", "#ffffff"), O(c, "1", "#e5e5e5");
|
|
1936
|
-
const u = f(
|
|
1948
|
+
const u = f(r, "radialGradient", {
|
|
1937
1949
|
id: o.pupil,
|
|
1938
1950
|
cx: "42%",
|
|
1939
1951
|
cy: "38%",
|
|
1940
1952
|
r: "65%"
|
|
1941
1953
|
});
|
|
1942
1954
|
O(u, "0", "#2a1f10"), O(u, "0.52", "#080604"), O(u, "1", "#000000");
|
|
1943
|
-
const m = f(
|
|
1955
|
+
const m = f(r, "filter", {
|
|
1944
1956
|
id: o.softDropShadow,
|
|
1945
1957
|
x: "-18%",
|
|
1946
1958
|
y: "-12%",
|
|
@@ -1955,7 +1967,7 @@ function Aa(e, t) {
|
|
|
1955
1967
|
"flood-color": n.shadow,
|
|
1956
1968
|
"flood-opacity": "0.24"
|
|
1957
1969
|
});
|
|
1958
|
-
const k = f(
|
|
1970
|
+
const k = f(r, "filter", {
|
|
1959
1971
|
id: o.innerDepth,
|
|
1960
1972
|
x: "-8%",
|
|
1961
1973
|
y: "-8%",
|
|
@@ -1988,7 +2000,7 @@ function Aa(e, t) {
|
|
|
1988
2000
|
in2: "innerLight",
|
|
1989
2001
|
mode: "screen"
|
|
1990
2002
|
});
|
|
1991
|
-
const v = f(
|
|
2003
|
+
const v = f(r, "filter", {
|
|
1992
2004
|
id: o.eyeShadow,
|
|
1993
2005
|
x: "-24%",
|
|
1994
2006
|
y: "-20%",
|
|
@@ -2003,7 +2015,7 @@ function Aa(e, t) {
|
|
|
2003
2015
|
"flood-color": n.shadow,
|
|
2004
2016
|
"flood-opacity": "0.3"
|
|
2005
2017
|
});
|
|
2006
|
-
const
|
|
2018
|
+
const R = f(r, "filter", {
|
|
2007
2019
|
id: o.pupilGloss,
|
|
2008
2020
|
x: "-15%",
|
|
2009
2021
|
y: "-15%",
|
|
@@ -2011,34 +2023,34 @@ function Aa(e, t) {
|
|
|
2011
2023
|
height: "130%",
|
|
2012
2024
|
"color-interpolation-filters": "sRGB"
|
|
2013
2025
|
});
|
|
2014
|
-
f(
|
|
2026
|
+
f(R, "feDropShadow", {
|
|
2015
2027
|
dx: "0",
|
|
2016
2028
|
dy: "3",
|
|
2017
2029
|
stdDeviation: "3",
|
|
2018
2030
|
"flood-color": "#000000",
|
|
2019
2031
|
"flood-opacity": "0.22"
|
|
2020
2032
|
});
|
|
2021
|
-
const
|
|
2022
|
-
f(
|
|
2033
|
+
const C = f(r, "clipPath", { id: o.boltClip });
|
|
2034
|
+
f(C, "path", { d: ut });
|
|
2023
2035
|
const g = f(i, "g", {
|
|
2024
|
-
filter:
|
|
2036
|
+
filter: Y(o.softDropShadow)
|
|
2025
2037
|
});
|
|
2026
2038
|
f(g, "path", {
|
|
2027
|
-
d:
|
|
2028
|
-
fill:
|
|
2039
|
+
d: ut,
|
|
2040
|
+
fill: Y(o.boltEdge)
|
|
2029
2041
|
});
|
|
2030
|
-
const
|
|
2042
|
+
const y = "M546 166 C522 166 505 180 499 204 L397 606 C390 630 406 646 432 646 L526 646 C568 646 590 672 581 712 L512 1001 C510 1010 518 1014 524 1006 L875 475 C886 458 878 449 855 449 L814 449 C764 449 745 415 769 374 L884 200 C894 181 883 161 858 161 Z";
|
|
2031
2043
|
f(g, "path", {
|
|
2032
|
-
d:
|
|
2033
|
-
fill:
|
|
2034
|
-
filter:
|
|
2044
|
+
d: y,
|
|
2045
|
+
fill: Y(o.boltFill),
|
|
2046
|
+
filter: Y(o.innerDepth)
|
|
2035
2047
|
}), f(g, "path", {
|
|
2036
|
-
d:
|
|
2037
|
-
fill:
|
|
2048
|
+
d: y,
|
|
2049
|
+
fill: Y(o.boltGlow),
|
|
2038
2050
|
opacity: "0.74"
|
|
2039
2051
|
});
|
|
2040
2052
|
const h = f(g, "g", {
|
|
2041
|
-
"clip-path":
|
|
2053
|
+
"clip-path": Y(o.boltClip),
|
|
2042
2054
|
opacity: "0.42"
|
|
2043
2055
|
});
|
|
2044
2056
|
f(h, "path", {
|
|
@@ -2063,8 +2075,8 @@ function Aa(e, t) {
|
|
|
2063
2075
|
"stroke-linecap": "round",
|
|
2064
2076
|
opacity: "0.48"
|
|
2065
2077
|
});
|
|
2066
|
-
const A = f(i, "g", { filter:
|
|
2067
|
-
return
|
|
2078
|
+
const A = f(i, "g", { filter: Y(o.eyeShadow) });
|
|
2079
|
+
return Wn(
|
|
2068
2080
|
A,
|
|
2069
2081
|
"rotate(-2 528 463)",
|
|
2070
2082
|
"528",
|
|
@@ -2074,7 +2086,7 @@ function Aa(e, t) {
|
|
|
2074
2086
|
"557",
|
|
2075
2087
|
"447",
|
|
2076
2088
|
o
|
|
2077
|
-
),
|
|
2089
|
+
), Wn(
|
|
2078
2090
|
A,
|
|
2079
2091
|
"rotate(2 717 462)",
|
|
2080
2092
|
"717",
|
|
@@ -2087,12 +2099,12 @@ function Aa(e, t) {
|
|
|
2087
2099
|
), i;
|
|
2088
2100
|
}
|
|
2089
2101
|
function Na(e, t) {
|
|
2090
|
-
const n =
|
|
2102
|
+
const n = no(e), o = {
|
|
2091
2103
|
clip: `${t}-scribbleBoltClip`,
|
|
2092
2104
|
wobble: `${t}-scribbleBoltWobble`
|
|
2093
|
-
}, i =
|
|
2094
|
-
f(l, "path", { d:
|
|
2095
|
-
const p = f(
|
|
2105
|
+
}, i = _o(), r = f(i, "defs"), l = f(r, "clipPath", { id: o.clip });
|
|
2106
|
+
f(l, "path", { d: ut });
|
|
2107
|
+
const p = f(r, "filter", {
|
|
2096
2108
|
id: o.wobble,
|
|
2097
2109
|
x: "-10%",
|
|
2098
2110
|
y: "-10%",
|
|
@@ -2113,8 +2125,8 @@ function Na(e, t) {
|
|
|
2113
2125
|
xChannelSelector: "R",
|
|
2114
2126
|
yChannelSelector: "G"
|
|
2115
2127
|
});
|
|
2116
|
-
const d = f(i, "g", { filter:
|
|
2117
|
-
"clip-path":
|
|
2128
|
+
const d = f(i, "g", { filter: Y(o.wobble) }), c = f(d, "g", {
|
|
2129
|
+
"clip-path": Y(o.clip)
|
|
2118
2130
|
});
|
|
2119
2131
|
return f(c, "path", {
|
|
2120
2132
|
d: ti(),
|
|
@@ -2126,12 +2138,12 @@ function Na(e, t) {
|
|
|
2126
2138
|
opacity: "0.9",
|
|
2127
2139
|
transform: "rotate(-14 627 600)"
|
|
2128
2140
|
}), f(d, "path", {
|
|
2129
|
-
d:
|
|
2141
|
+
d: ut,
|
|
2130
2142
|
fill: "none",
|
|
2131
|
-
stroke:
|
|
2143
|
+
stroke: gt,
|
|
2132
2144
|
"stroke-width": "18",
|
|
2133
2145
|
"stroke-linejoin": "round"
|
|
2134
|
-
}),
|
|
2146
|
+
}), Gn(
|
|
2135
2147
|
d,
|
|
2136
2148
|
"rotate(-2 528 463)",
|
|
2137
2149
|
"528",
|
|
@@ -2140,7 +2152,7 @@ function Na(e, t) {
|
|
|
2140
2152
|
"473",
|
|
2141
2153
|
"557",
|
|
2142
2154
|
"447"
|
|
2143
|
-
),
|
|
2155
|
+
), Gn(
|
|
2144
2156
|
d,
|
|
2145
2157
|
"rotate(2 717 462)",
|
|
2146
2158
|
"717",
|
|
@@ -2151,27 +2163,27 @@ function Na(e, t) {
|
|
|
2151
2163
|
"447"
|
|
2152
2164
|
), i;
|
|
2153
2165
|
}
|
|
2154
|
-
function
|
|
2166
|
+
function _o() {
|
|
2155
2167
|
return E("svg", {
|
|
2156
|
-
xmlns:
|
|
2168
|
+
xmlns: co,
|
|
2157
2169
|
viewBox: "0 0 1254 1254"
|
|
2158
2170
|
});
|
|
2159
2171
|
}
|
|
2160
|
-
function
|
|
2172
|
+
function Wn(e, t, n, o, i, r, l, p, d) {
|
|
2161
2173
|
const c = f(e, "g", { transform: t });
|
|
2162
2174
|
f(c, "ellipse", {
|
|
2163
2175
|
cx: n,
|
|
2164
2176
|
cy: o,
|
|
2165
2177
|
rx: "73",
|
|
2166
2178
|
ry: "80",
|
|
2167
|
-
fill:
|
|
2179
|
+
fill: Y(d.eyeWhite)
|
|
2168
2180
|
}), f(c, "ellipse", {
|
|
2169
2181
|
cx: i,
|
|
2170
|
-
cy:
|
|
2182
|
+
cy: r,
|
|
2171
2183
|
rx: "49",
|
|
2172
2184
|
ry: "57",
|
|
2173
|
-
fill:
|
|
2174
|
-
filter:
|
|
2185
|
+
fill: Y(d.pupil),
|
|
2186
|
+
filter: Y(d.pupilGloss)
|
|
2175
2187
|
}), f(c, "circle", {
|
|
2176
2188
|
cx: l,
|
|
2177
2189
|
cy: p,
|
|
@@ -2179,7 +2191,7 @@ function Fn(e, t, n, o, i, a, l, p, d) {
|
|
|
2179
2191
|
fill: "#ffffff"
|
|
2180
2192
|
});
|
|
2181
2193
|
}
|
|
2182
|
-
function
|
|
2194
|
+
function Gn(e, t, n, o, i, r, l, p) {
|
|
2183
2195
|
const d = f(e, "g", { transform: t });
|
|
2184
2196
|
f(d, "ellipse", {
|
|
2185
2197
|
cx: n,
|
|
@@ -2187,14 +2199,14 @@ function Hn(e, t, n, o, i, a, l, p) {
|
|
|
2187
2199
|
rx: "73",
|
|
2188
2200
|
ry: "80",
|
|
2189
2201
|
fill: "#ffffff",
|
|
2190
|
-
stroke:
|
|
2202
|
+
stroke: gt,
|
|
2191
2203
|
"stroke-width": "13"
|
|
2192
2204
|
}), f(d, "ellipse", {
|
|
2193
2205
|
cx: i,
|
|
2194
|
-
cy:
|
|
2206
|
+
cy: r,
|
|
2195
2207
|
rx: "45",
|
|
2196
2208
|
ry: "53",
|
|
2197
|
-
fill:
|
|
2209
|
+
fill: gt
|
|
2198
2210
|
}), f(d, "circle", {
|
|
2199
2211
|
cx: l,
|
|
2200
2212
|
cy: p,
|
|
@@ -2210,14 +2222,14 @@ function O(e, t, n, o) {
|
|
|
2210
2222
|
const i = { offset: t, "stop-color": n };
|
|
2211
2223
|
o !== void 0 && (i["stop-opacity"] = o), f(e, "stop", i);
|
|
2212
2224
|
}
|
|
2213
|
-
function
|
|
2225
|
+
function Y(e) {
|
|
2214
2226
|
return `url(#${e})`;
|
|
2215
2227
|
}
|
|
2216
|
-
function
|
|
2228
|
+
function wt(e, t, n, o) {
|
|
2217
2229
|
const i = document.createElement("button");
|
|
2218
2230
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2219
2231
|
}
|
|
2220
|
-
function
|
|
2232
|
+
function Ra() {
|
|
2221
2233
|
const e = E("svg", {
|
|
2222
2234
|
class: "pluno-pa-widget__scribble-defs",
|
|
2223
2235
|
"aria-hidden": "true",
|
|
@@ -2225,48 +2237,48 @@ function Da() {
|
|
|
2225
2237
|
width: "0",
|
|
2226
2238
|
height: "0"
|
|
2227
2239
|
}), t = E("defs");
|
|
2228
|
-
return t.appendChild(
|
|
2229
|
-
|
|
2240
|
+
return t.appendChild(Gt("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2241
|
+
Gt("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2230
2242
|
), t.appendChild(
|
|
2231
|
-
|
|
2243
|
+
Gt("pluno-pa-scribble-wobble-3", "9", "19")
|
|
2232
2244
|
), e.appendChild(t), e;
|
|
2233
2245
|
}
|
|
2234
|
-
function
|
|
2246
|
+
function xo(e, t) {
|
|
2235
2247
|
const n = E("svg", {
|
|
2236
2248
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2237
2249
|
preserveAspectRatio: "xMidYMid meet",
|
|
2238
2250
|
"aria-hidden": "true",
|
|
2239
2251
|
focusable: "false"
|
|
2240
2252
|
});
|
|
2241
|
-
return
|
|
2253
|
+
return yo(n, t), n;
|
|
2242
2254
|
}
|
|
2243
|
-
function
|
|
2255
|
+
function Wt(e, t) {
|
|
2244
2256
|
if (!e)
|
|
2245
2257
|
return;
|
|
2246
2258
|
const n = Math.max(
|
|
2247
2259
|
0,
|
|
2248
|
-
t -
|
|
2260
|
+
t - Zt * 2
|
|
2249
2261
|
), o = Math.max(
|
|
2250
2262
|
Xi,
|
|
2251
2263
|
Math.floor(
|
|
2252
|
-
(n -
|
|
2264
|
+
(n - Xt * 2) / Yt
|
|
2253
2265
|
)
|
|
2254
2266
|
);
|
|
2255
|
-
|
|
2267
|
+
yo(e, o);
|
|
2256
2268
|
}
|
|
2257
|
-
function
|
|
2269
|
+
function yo(e, t) {
|
|
2258
2270
|
if (e.dataset.spiralCount === `${t}`)
|
|
2259
2271
|
return;
|
|
2260
|
-
const n = t *
|
|
2272
|
+
const n = t * Yt + Xt * 2;
|
|
2261
2273
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2262
2274
|
"viewBox",
|
|
2263
2275
|
`0 0 ${n} ${Yi}`
|
|
2264
2276
|
), e.replaceChildren();
|
|
2265
2277
|
for (let o = 0; o < t; o += 1) {
|
|
2266
|
-
const i =
|
|
2267
|
-
transform: `translate(${
|
|
2278
|
+
const i = Dn[o % Dn.length], r = E("g", {
|
|
2279
|
+
transform: `translate(${Xt + o * Yt} 0)`
|
|
2268
2280
|
});
|
|
2269
|
-
|
|
2281
|
+
r.appendChild(
|
|
2270
2282
|
E("ellipse", {
|
|
2271
2283
|
cx: i.ellipseCx,
|
|
2272
2284
|
cy: i.ellipseCy,
|
|
@@ -2277,7 +2289,7 @@ function _o(e, t) {
|
|
|
2277
2289
|
"stroke-width": i.strokeWidth,
|
|
2278
2290
|
opacity: "0.8"
|
|
2279
2291
|
})
|
|
2280
|
-
),
|
|
2292
|
+
), r.appendChild(
|
|
2281
2293
|
E("path", {
|
|
2282
2294
|
d: i.path,
|
|
2283
2295
|
fill: "none",
|
|
@@ -2285,10 +2297,10 @@ function _o(e, t) {
|
|
|
2285
2297
|
"stroke-width": i.pathStrokeWidth,
|
|
2286
2298
|
"stroke-linecap": "round"
|
|
2287
2299
|
})
|
|
2288
|
-
), e.appendChild(
|
|
2300
|
+
), e.appendChild(r);
|
|
2289
2301
|
}
|
|
2290
2302
|
}
|
|
2291
|
-
function
|
|
2303
|
+
function Gt(e, t, n) {
|
|
2292
2304
|
const o = E("filter", {
|
|
2293
2305
|
id: e,
|
|
2294
2306
|
x: "-8%",
|
|
@@ -2331,8 +2343,8 @@ function Ft(e, t, n) {
|
|
|
2331
2343
|
})
|
|
2332
2344
|
), o;
|
|
2333
2345
|
}
|
|
2334
|
-
function
|
|
2335
|
-
const t =
|
|
2346
|
+
function Da(e) {
|
|
2347
|
+
const t = le(
|
|
2336
2348
|
"0 0 24 24",
|
|
2337
2349
|
e,
|
|
2338
2350
|
e,
|
|
@@ -2342,8 +2354,8 @@ function Ra(e) {
|
|
|
2342
2354
|
);
|
|
2343
2355
|
return t.appendChild(E("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2344
2356
|
}
|
|
2345
|
-
function
|
|
2346
|
-
const e =
|
|
2357
|
+
function za() {
|
|
2358
|
+
const e = le(
|
|
2347
2359
|
"0 0 24 24",
|
|
2348
2360
|
17,
|
|
2349
2361
|
17,
|
|
@@ -2361,8 +2373,8 @@ function Ma() {
|
|
|
2361
2373
|
})
|
|
2362
2374
|
), e;
|
|
2363
2375
|
}
|
|
2364
|
-
function
|
|
2365
|
-
const e =
|
|
2376
|
+
function Ma() {
|
|
2377
|
+
const e = le(
|
|
2366
2378
|
"0 0 24 24",
|
|
2367
2379
|
17,
|
|
2368
2380
|
17,
|
|
@@ -2373,7 +2385,7 @@ function za() {
|
|
|
2373
2385
|
return e.appendChild(E("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(E("path", { d: "M3 4v5h5" })), e.appendChild(E("path", { d: "M12 7v5l3 2" })), e;
|
|
2374
2386
|
}
|
|
2375
2387
|
function Oa() {
|
|
2376
|
-
const e =
|
|
2388
|
+
const e = le(
|
|
2377
2389
|
"0 0 24 24",
|
|
2378
2390
|
15,
|
|
2379
2391
|
15,
|
|
@@ -2383,8 +2395,8 @@ function Oa() {
|
|
|
2383
2395
|
);
|
|
2384
2396
|
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2385
2397
|
}
|
|
2386
|
-
function
|
|
2387
|
-
const e =
|
|
2398
|
+
function vo() {
|
|
2399
|
+
const e = le(
|
|
2388
2400
|
"0 0 24 24",
|
|
2389
2401
|
14,
|
|
2390
2402
|
14,
|
|
@@ -2397,7 +2409,7 @@ function xo() {
|
|
|
2397
2409
|
), e.appendChild(E("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2398
2410
|
}
|
|
2399
2411
|
function Ua() {
|
|
2400
|
-
const e =
|
|
2412
|
+
const e = le(
|
|
2401
2413
|
"0 0 24 24",
|
|
2402
2414
|
16,
|
|
2403
2415
|
16,
|
|
@@ -2415,7 +2427,7 @@ function Ua() {
|
|
|
2415
2427
|
), e;
|
|
2416
2428
|
}
|
|
2417
2429
|
function Ba() {
|
|
2418
|
-
const e =
|
|
2430
|
+
const e = le("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2419
2431
|
return e.setAttribute(
|
|
2420
2432
|
"class",
|
|
2421
2433
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
@@ -2430,7 +2442,7 @@ function Ba() {
|
|
|
2430
2442
|
), e;
|
|
2431
2443
|
}
|
|
2432
2444
|
function Fa() {
|
|
2433
|
-
const e =
|
|
2445
|
+
const e = le("0 0 24 24", 18, 18, "currentColor");
|
|
2434
2446
|
return e.appendChild(
|
|
2435
2447
|
E("rect", {
|
|
2436
2448
|
x: "6",
|
|
@@ -2442,7 +2454,7 @@ function Fa() {
|
|
|
2442
2454
|
), e;
|
|
2443
2455
|
}
|
|
2444
2456
|
function Ha() {
|
|
2445
|
-
const e =
|
|
2457
|
+
const e = le(
|
|
2446
2458
|
"0 0 24 24",
|
|
2447
2459
|
12,
|
|
2448
2460
|
12,
|
|
@@ -2453,7 +2465,7 @@ function Ha() {
|
|
|
2453
2465
|
return e.appendChild(E("path", { d: "M18 6 6 18" })), e.appendChild(E("path", { d: "m6 6 12 12" })), e;
|
|
2454
2466
|
}
|
|
2455
2467
|
function Wa() {
|
|
2456
|
-
const e =
|
|
2468
|
+
const e = le(
|
|
2457
2469
|
"0 0 24 24",
|
|
2458
2470
|
13,
|
|
2459
2471
|
13,
|
|
@@ -2476,7 +2488,7 @@ function Wa() {
|
|
|
2476
2488
|
})
|
|
2477
2489
|
), e;
|
|
2478
2490
|
}
|
|
2479
|
-
function
|
|
2491
|
+
function le(e, t, n, o, i, r) {
|
|
2480
2492
|
const l = {
|
|
2481
2493
|
viewBox: e,
|
|
2482
2494
|
width: String(t),
|
|
@@ -2484,15 +2496,15 @@ function ae(e, t, n, o, i, a) {
|
|
|
2484
2496
|
fill: o,
|
|
2485
2497
|
"aria-hidden": "true"
|
|
2486
2498
|
};
|
|
2487
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"),
|
|
2499
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), E("svg", l);
|
|
2488
2500
|
}
|
|
2489
2501
|
function E(e, t = {}) {
|
|
2490
|
-
const n = document.createElementNS(
|
|
2502
|
+
const n = document.createElementNS(co, e);
|
|
2491
2503
|
for (const [o, i] of Object.entries(t))
|
|
2492
2504
|
n.setAttribute(o, i);
|
|
2493
2505
|
return n;
|
|
2494
2506
|
}
|
|
2495
|
-
function
|
|
2507
|
+
function $n(e) {
|
|
2496
2508
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2497
2509
|
e.addEventListener(t, (n) => {
|
|
2498
2510
|
n.stopPropagation();
|
|
@@ -2501,62 +2513,62 @@ function Wn(e) {
|
|
|
2501
2513
|
function Ga(e, t, n) {
|
|
2502
2514
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2503
2515
|
for (const [o, i] of t.entries()) {
|
|
2504
|
-
const
|
|
2505
|
-
|
|
2516
|
+
const r = document.createElement("div");
|
|
2517
|
+
r.className = "pluno-pa-widget__attachment", r.appendChild($a(i));
|
|
2506
2518
|
const l = document.createElement("span");
|
|
2507
|
-
l.textContent = i.name,
|
|
2519
|
+
l.textContent = i.name, r.appendChild(l);
|
|
2508
2520
|
const p = document.createElement("button");
|
|
2509
|
-
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ha()), p.addEventListener("click", () => n(o)),
|
|
2521
|
+
p.type = "button", p.setAttribute("aria-label", `Remove ${i.name}`), p.appendChild(Ha()), p.addEventListener("click", () => n(o)), r.appendChild(p), e.appendChild(r);
|
|
2510
2522
|
}
|
|
2511
2523
|
}
|
|
2512
2524
|
function $a(e) {
|
|
2513
|
-
const t =
|
|
2525
|
+
const t = ln(e), n = Co(e);
|
|
2514
2526
|
if (t === "image" && n) {
|
|
2515
2527
|
const o = document.createElement("img");
|
|
2516
|
-
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(
|
|
2528
|
+
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ae(e))), o;
|
|
2517
2529
|
}
|
|
2518
2530
|
if (t === "video" && n) {
|
|
2519
2531
|
const o = document.createElement("video");
|
|
2520
|
-
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(
|
|
2532
|
+
return o.src = n, o.muted = !0, o.preload = "metadata", o.setAttribute("aria-hidden", "true"), o.addEventListener("error", () => o.replaceWith(ae(e))), o.addEventListener("stalled", () => o.replaceWith(ae(e))), o;
|
|
2521
2533
|
}
|
|
2522
|
-
return
|
|
2534
|
+
return ae(e);
|
|
2523
2535
|
}
|
|
2524
2536
|
function qa(e) {
|
|
2525
|
-
const t =
|
|
2537
|
+
const t = ln(e), n = Co(e);
|
|
2526
2538
|
if (t === "image" && n) {
|
|
2527
2539
|
const o = document.createElement("img");
|
|
2528
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(
|
|
2540
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.alt = e.name, o.addEventListener("error", () => o.replaceWith(ae(e, "message"))), o;
|
|
2529
2541
|
}
|
|
2530
2542
|
if (t === "pdf" && n) {
|
|
2531
2543
|
const o = document.createElement("object");
|
|
2532
|
-
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(
|
|
2544
|
+
return o.className = "pluno-pa-widget__message-attachment-preview pluno-pa-widget__message-attachment-preview--pdf", o.data = n, o.type = "application/pdf", o.setAttribute("aria-label", e.name), o.addEventListener("error", () => o.replaceWith(ae(e, "message"))), o.appendChild(ae(e, "message")), o;
|
|
2533
2545
|
}
|
|
2534
2546
|
if (t === "video" && n) {
|
|
2535
2547
|
const o = document.createElement("video");
|
|
2536
|
-
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(
|
|
2548
|
+
return o.className = "pluno-pa-widget__message-attachment-preview", o.src = n, o.muted = !0, o.preload = "metadata", o.addEventListener("error", () => o.replaceWith(ae(e, "message"))), o.addEventListener("stalled", () => o.replaceWith(ae(e, "message"))), o;
|
|
2537
2549
|
}
|
|
2538
|
-
return
|
|
2550
|
+
return ae(e, "message");
|
|
2539
2551
|
}
|
|
2540
|
-
function
|
|
2552
|
+
function ae(e, t = "composer") {
|
|
2541
2553
|
if (t === "composer") {
|
|
2542
|
-
const
|
|
2543
|
-
return
|
|
2554
|
+
const r = document.createElement("span");
|
|
2555
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = qn(e), r;
|
|
2544
2556
|
}
|
|
2545
2557
|
const n = document.createElement("div");
|
|
2546
2558
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2547
2559
|
const o = document.createElement("span");
|
|
2548
|
-
o.textContent =
|
|
2560
|
+
o.textContent = qn(e);
|
|
2549
2561
|
const i = document.createElement("strong");
|
|
2550
2562
|
return i.textContent = e.name, n.append(o, i), n;
|
|
2551
2563
|
}
|
|
2552
|
-
function
|
|
2564
|
+
function ln(e) {
|
|
2553
2565
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2554
2566
|
}
|
|
2555
|
-
function
|
|
2567
|
+
function Co(e) {
|
|
2556
2568
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2557
2569
|
}
|
|
2558
|
-
function
|
|
2559
|
-
const t =
|
|
2570
|
+
function qn(e) {
|
|
2571
|
+
const t = ln(e);
|
|
2560
2572
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2561
2573
|
}
|
|
2562
2574
|
function ja(e, t) {
|
|
@@ -2568,26 +2580,26 @@ function ja(e, t) {
|
|
|
2568
2580
|
function Va(e) {
|
|
2569
2581
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2570
2582
|
}
|
|
2571
|
-
function
|
|
2583
|
+
function pt(e) {
|
|
2572
2584
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2573
2585
|
}
|
|
2574
|
-
function
|
|
2575
|
-
if (!e || !
|
|
2586
|
+
function $t(e, t, n = null) {
|
|
2587
|
+
if (!e || !tn(t, n)) {
|
|
2576
2588
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2577
2589
|
return;
|
|
2578
2590
|
}
|
|
2579
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status",
|
|
2591
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", re(t) || pn(n) ? e.appendChild(
|
|
2580
2592
|
Ka(t, n)
|
|
2581
|
-
) :
|
|
2593
|
+
) : So(t) && e.appendChild(Ya(t));
|
|
2582
2594
|
}
|
|
2583
2595
|
function Ka(e, t) {
|
|
2584
2596
|
const n = document.createElement("div");
|
|
2585
2597
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2586
2598
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2587
2599
|
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2588
|
-
const
|
|
2589
|
-
return
|
|
2590
|
-
|
|
2600
|
+
const r = document.createElement("span");
|
|
2601
|
+
return r.textContent = o ? "Earn bonus credits or upgrade to keep using Pluno on this product." : e.paymentIssue ?? "Open billing to keep using Pluno.", n.appendChild(r), n.appendChild(
|
|
2602
|
+
Eo(
|
|
2591
2603
|
e,
|
|
2592
2604
|
"Upgrade plan",
|
|
2593
2605
|
"pluno-pa-widget__billing-action-card-actions"
|
|
@@ -2601,30 +2613,30 @@ function Ya(e) {
|
|
|
2601
2613
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2602
2614
|
const o = document.createElement("span");
|
|
2603
2615
|
return o.textContent = Za(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2604
|
-
|
|
2616
|
+
Eo(
|
|
2605
2617
|
e,
|
|
2606
2618
|
"Upgrade",
|
|
2607
2619
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2608
2620
|
)
|
|
2609
2621
|
), t;
|
|
2610
2622
|
}
|
|
2611
|
-
function
|
|
2612
|
-
return e !== null && (
|
|
2623
|
+
function tn(e, t) {
|
|
2624
|
+
return e !== null && (re(e) || So(e) || pn(t));
|
|
2613
2625
|
}
|
|
2614
|
-
function
|
|
2615
|
-
return
|
|
2626
|
+
function jn(e, t, n) {
|
|
2627
|
+
return tn(t, n) || Xa(t) ? !0 : !tn(e, n);
|
|
2616
2628
|
}
|
|
2617
2629
|
function Xa(e) {
|
|
2618
|
-
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null ||
|
|
2630
|
+
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || re(e));
|
|
2619
2631
|
}
|
|
2620
|
-
function
|
|
2632
|
+
function re(e) {
|
|
2621
2633
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2622
2634
|
}
|
|
2623
|
-
function
|
|
2635
|
+
function pn(e) {
|
|
2624
2636
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2625
2637
|
}
|
|
2626
|
-
function
|
|
2627
|
-
return !
|
|
2638
|
+
function So(e) {
|
|
2639
|
+
return !re(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2628
2640
|
}
|
|
2629
2641
|
function Za(e) {
|
|
2630
2642
|
return e.creditsRemaining === null ? null : `${Ja(e.creditsRemaining)} credits left`;
|
|
@@ -2634,15 +2646,15 @@ function Ja(e) {
|
|
|
2634
2646
|
maximumFractionDigits: 0
|
|
2635
2647
|
}).format(Math.ceil(e));
|
|
2636
2648
|
}
|
|
2637
|
-
function
|
|
2649
|
+
function Eo(e, t, n) {
|
|
2638
2650
|
const o = document.createElement("div");
|
|
2639
2651
|
return o.className = n, o.appendChild(
|
|
2640
|
-
|
|
2652
|
+
Vn(t, e.pricingUrl)
|
|
2641
2653
|
), o.appendChild(
|
|
2642
|
-
|
|
2654
|
+
Vn("Earn credits", e.earnCreditsUrl)
|
|
2643
2655
|
), o;
|
|
2644
2656
|
}
|
|
2645
|
-
function
|
|
2657
|
+
function Vn(e, t) {
|
|
2646
2658
|
const n = document.createElement("button");
|
|
2647
2659
|
if (n.type = "button", e === "Earn credits") {
|
|
2648
2660
|
const o = document.createElement("span");
|
|
@@ -2653,123 +2665,131 @@ function qn(e, t) {
|
|
|
2653
2665
|
t.trim().length !== 0 && window.open(t, "_blank", "noopener,noreferrer");
|
|
2654
2666
|
}), n;
|
|
2655
2667
|
}
|
|
2656
|
-
function
|
|
2668
|
+
function qt(e, t) {
|
|
2657
2669
|
return e.messages.filter(
|
|
2658
|
-
(o) => !
|
|
2670
|
+
(o) => !ko(o)
|
|
2659
2671
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2660
2672
|
}
|
|
2661
|
-
function Qa(e, t, n, o, i,
|
|
2662
|
-
const
|
|
2663
|
-
(
|
|
2664
|
-
),
|
|
2665
|
-
|
|
2673
|
+
function Qa(e, t, n, o, i, r, l, p, d, c, u, m, k, v, R, C, g, y, h) {
|
|
2674
|
+
const A = or(r), L = A.filter(
|
|
2675
|
+
(x) => !ko(x)
|
|
2676
|
+
), M = e.scrollTop, U = [], Ie = /* @__PURE__ */ new Set(), H = (x) => {
|
|
2677
|
+
U.push(x);
|
|
2666
2678
|
};
|
|
2667
|
-
|
|
2668
|
-
const
|
|
2669
|
-
if (o(
|
|
2670
|
-
const
|
|
2671
|
-
|
|
2672
|
-
const
|
|
2673
|
-
|
|
2674
|
-
const
|
|
2679
|
+
Io(n, r.isThinking), i.hidden = !p, p && l !== null && bo(i, l);
|
|
2680
|
+
const xe = L.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2681
|
+
if (o(xe), g || L.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2682
|
+
const x = document.createElement("div");
|
|
2683
|
+
x.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (g ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2684
|
+
const D = document.createElement("div");
|
|
2685
|
+
D.className = "pluno-pa-widget__empty-hero";
|
|
2686
|
+
const $ = _e(
|
|
2675
2687
|
"pluno-pa-widget__character--empty",
|
|
2676
2688
|
v()
|
|
2677
2689
|
);
|
|
2678
|
-
|
|
2679
|
-
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2690
|
+
if (D.appendChild($), x.appendChild(D), g) {
|
|
2691
|
+
const S = document.createElement("h2");
|
|
2692
|
+
S.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", S.textContent = g.opening, x.appendChild(S);
|
|
2693
|
+
} else
|
|
2694
|
+
x.appendChild(wo());
|
|
2695
|
+
const P = g?.prompts ?? r.starterPrompts, j = document.createElement("div");
|
|
2696
|
+
if (j.className = P.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", P.length === 0 && !r.starterPromptsLoading && j.setAttribute("aria-hidden", "true"), P.length > 0)
|
|
2697
|
+
for (const S of P) {
|
|
2698
|
+
const N = document.createElement("button");
|
|
2699
|
+
N.type = "button", N.className = "pluno-pa-widget__starter-prompt", N.textContent = `"${S}"`, N.addEventListener("click", () => {
|
|
2700
|
+
R(S);
|
|
2701
|
+
}), j.appendChild(N);
|
|
2686
2702
|
}
|
|
2687
|
-
else if (
|
|
2688
|
-
const
|
|
2689
|
-
|
|
2703
|
+
else if (r.starterPromptsLoading) {
|
|
2704
|
+
const S = document.createElement("button");
|
|
2705
|
+
S.type = "button", S.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", S.disabled = !0, S.tabIndex = -1, S.textContent = "Generating example tasks...", j.appendChild(S);
|
|
2690
2706
|
} else
|
|
2691
|
-
for (let
|
|
2692
|
-
const
|
|
2693
|
-
|
|
2707
|
+
for (let S = 0; S < zi; S += 1) {
|
|
2708
|
+
const N = document.createElement("button");
|
|
2709
|
+
N.type = "button", N.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", N.disabled = !0, N.tabIndex = -1, N.textContent = "", j.appendChild(N);
|
|
2694
2710
|
}
|
|
2695
|
-
|
|
2711
|
+
if (x.appendChild(j), g) {
|
|
2712
|
+
const S = document.createElement("button");
|
|
2713
|
+
S.type = "button", S.className = "pluno-pa-widget__morning-report-snooze", S.textContent = "Snooze morning report", S.addEventListener("click", y), x.appendChild(S);
|
|
2714
|
+
}
|
|
2715
|
+
m.clear(), H(x), H(t), Kn(e, U);
|
|
2696
2716
|
return;
|
|
2697
2717
|
}
|
|
2698
|
-
let
|
|
2699
|
-
const
|
|
2700
|
-
if (
|
|
2718
|
+
let G = null, w = null, J = [];
|
|
2719
|
+
const Je = L.some(nn), pe = () => {
|
|
2720
|
+
if (J.length === 0)
|
|
2701
2721
|
return !1;
|
|
2702
|
-
const
|
|
2703
|
-
|
|
2722
|
+
const x = gr(
|
|
2723
|
+
J,
|
|
2704
2724
|
u,
|
|
2705
2725
|
k,
|
|
2706
2726
|
v()
|
|
2707
2727
|
);
|
|
2708
|
-
return
|
|
2728
|
+
return H(x), G = null, w = x, J = [], !0;
|
|
2709
2729
|
};
|
|
2710
|
-
for (let
|
|
2711
|
-
const
|
|
2712
|
-
if (
|
|
2713
|
-
|
|
2730
|
+
for (let x = 0; x < L.length; x += 1) {
|
|
2731
|
+
const D = L[x];
|
|
2732
|
+
if (D.role === "tool") {
|
|
2733
|
+
J.push(D);
|
|
2714
2734
|
continue;
|
|
2715
2735
|
}
|
|
2716
|
-
if (
|
|
2717
|
-
if (
|
|
2718
|
-
const
|
|
2719
|
-
|
|
2736
|
+
if (nn(D)) {
|
|
2737
|
+
if (pe()) {
|
|
2738
|
+
const N = mt();
|
|
2739
|
+
H(N), G = null, w = N;
|
|
2720
2740
|
} else {
|
|
2721
|
-
const
|
|
2722
|
-
|
|
2741
|
+
const N = Zn(v());
|
|
2742
|
+
H(N), G = null, w = N;
|
|
2723
2743
|
}
|
|
2724
2744
|
continue;
|
|
2725
2745
|
}
|
|
2726
|
-
if (
|
|
2746
|
+
if (D.role === "system")
|
|
2727
2747
|
continue;
|
|
2728
|
-
const
|
|
2729
|
-
if (
|
|
2730
|
-
const
|
|
2731
|
-
|
|
2748
|
+
const $ = pe(), P = ur(D.content);
|
|
2749
|
+
if (D.role === "assistant" && !$) {
|
|
2750
|
+
const S = Lo(v());
|
|
2751
|
+
H(S), G = null, w = S;
|
|
2732
2752
|
}
|
|
2733
|
-
const
|
|
2734
|
-
|
|
2753
|
+
const j = er(D, P, m, Ie);
|
|
2754
|
+
H(j), G = j, w = null;
|
|
2735
2755
|
}
|
|
2736
|
-
const
|
|
2737
|
-
if (
|
|
2738
|
-
if (
|
|
2739
|
-
const
|
|
2740
|
-
|
|
2756
|
+
const Qe = pe(), V = L[L.length - 1]?.id === "assistant-draft";
|
|
2757
|
+
if (r.isThinking && !V && !Je)
|
|
2758
|
+
if (Qe) {
|
|
2759
|
+
const x = mt();
|
|
2760
|
+
H(x), G = null, w = x;
|
|
2741
2761
|
} else {
|
|
2742
|
-
const
|
|
2743
|
-
|
|
2744
|
-
}
|
|
2745
|
-
if (
|
|
2746
|
-
const
|
|
2747
|
-
|
|
2748
|
-
const
|
|
2749
|
-
if (
|
|
2750
|
-
const
|
|
2751
|
-
|
|
2752
|
-
}
|
|
2753
|
-
|
|
2762
|
+
const x = Zn(v());
|
|
2763
|
+
H(x), G = null, w = x;
|
|
2764
|
+
}
|
|
2765
|
+
if (r.lastError) {
|
|
2766
|
+
const x = document.createElement("div");
|
|
2767
|
+
x.className = "pluno-pa-widget__error";
|
|
2768
|
+
const D = document.createElement("span");
|
|
2769
|
+
if (D.textContent = r.lastError, x.appendChild(D), r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active") {
|
|
2770
|
+
const $ = document.createElement("button");
|
|
2771
|
+
$.type = "button", $.className = "pluno-pa-widget__error-retry", $.textContent = "Try again", $.addEventListener("click", C), x.appendChild($);
|
|
2772
|
+
}
|
|
2773
|
+
H(x), G = x, w = null;
|
|
2754
2774
|
}
|
|
2755
|
-
const
|
|
2756
|
-
if (
|
|
2757
|
-
const
|
|
2758
|
-
isDrafting:
|
|
2759
|
-
error:
|
|
2760
|
-
characterIconOptions:
|
|
2761
|
-
onDraft:
|
|
2762
|
-
onDismiss:
|
|
2763
|
-
onDisable:
|
|
2775
|
+
const ge = h && !r.isThinking ? ri(A) : null;
|
|
2776
|
+
if (h && ge && !h.dismissedCandidateIds.has(ge.id)) {
|
|
2777
|
+
const x = rr(ge, {
|
|
2778
|
+
isDrafting: h.draftingCandidateId === ge.id,
|
|
2779
|
+
error: h.error,
|
|
2780
|
+
characterIconOptions: h.characterIconOptions,
|
|
2781
|
+
onDraft: h.onDraft,
|
|
2782
|
+
onDismiss: h.onDismiss,
|
|
2783
|
+
onDisable: h.onDisable
|
|
2764
2784
|
});
|
|
2765
|
-
|
|
2785
|
+
H(x), h.onSeen(ge), G = null, w = x;
|
|
2766
2786
|
}
|
|
2767
|
-
|
|
2787
|
+
G?.classList.add("pluno-pa-widget__message--bottom-reserve"), w?.classList.add("pluno-pa-widget__bottom-reserve-compact"), H(t), nr(m, Ie), Kn(e, U), d ? Xe(e, c) : e.scrollTop = M;
|
|
2768
2788
|
}
|
|
2769
2789
|
function er(e, t, n, o) {
|
|
2770
|
-
const i = tr(e, t),
|
|
2771
|
-
if (i &&
|
|
2772
|
-
return
|
|
2790
|
+
const i = tr(e, t), r = i ? n.get(i) : void 0;
|
|
2791
|
+
if (i && r)
|
|
2792
|
+
return r.classList.remove("pluno-pa-widget__message--bottom-reserve"), o.add(i), r;
|
|
2773
2793
|
const l = document.createElement("div");
|
|
2774
2794
|
l.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? mr(l, t) : l.textContent = t, e.role === "user" && e.attachments?.length && l.appendChild(ir(e.attachments));
|
|
2775
2795
|
const p = document.createElement("div");
|
|
@@ -2797,7 +2817,7 @@ function nr(e, t) {
|
|
|
2797
2817
|
for (const n of e.keys())
|
|
2798
2818
|
t.has(n) || e.delete(n);
|
|
2799
2819
|
}
|
|
2800
|
-
function
|
|
2820
|
+
function Kn(e, t) {
|
|
2801
2821
|
let n = e.firstChild;
|
|
2802
2822
|
for (const o of t) {
|
|
2803
2823
|
if (o === n) {
|
|
@@ -2826,12 +2846,12 @@ function or(e) {
|
|
|
2826
2846
|
if (!t.respondsToUserMessageId)
|
|
2827
2847
|
return [...e.messages, t];
|
|
2828
2848
|
const n = e.messages.findIndex(
|
|
2829
|
-
(
|
|
2849
|
+
(r) => r.role === "user" && r.id === t.respondsToUserMessageId
|
|
2830
2850
|
);
|
|
2831
2851
|
if (n === -1)
|
|
2832
2852
|
return [...e.messages, t];
|
|
2833
2853
|
const o = e.messages.findIndex(
|
|
2834
|
-
(
|
|
2854
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && Yn(r, t) && nn(r)
|
|
2835
2855
|
);
|
|
2836
2856
|
if (o !== -1)
|
|
2837
2857
|
return [
|
|
@@ -2840,7 +2860,7 @@ function or(e) {
|
|
|
2840
2860
|
...e.messages.slice(o + 1)
|
|
2841
2861
|
];
|
|
2842
2862
|
let i = n + 1;
|
|
2843
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
2863
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && Yn(e.messages[i], t); )
|
|
2844
2864
|
i += 1;
|
|
2845
2865
|
return [
|
|
2846
2866
|
...e.messages.slice(0, i),
|
|
@@ -2848,17 +2868,17 @@ function or(e) {
|
|
|
2848
2868
|
...e.messages.slice(i)
|
|
2849
2869
|
];
|
|
2850
2870
|
}
|
|
2851
|
-
function
|
|
2871
|
+
function nn(e) {
|
|
2852
2872
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
2853
2873
|
}
|
|
2854
|
-
function
|
|
2874
|
+
function Yn(e, t) {
|
|
2855
2875
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
2856
2876
|
}
|
|
2857
|
-
function
|
|
2858
|
-
e.replaceChildren(),
|
|
2877
|
+
function Xn(e, t, n, o, i, r, l, p) {
|
|
2878
|
+
e.replaceChildren(), Io(t, !1), t.disabled = !0, n(!1);
|
|
2859
2879
|
const d = document.createElement("div");
|
|
2860
2880
|
d.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
2861
|
-
const c =
|
|
2881
|
+
const c = _e(
|
|
2862
2882
|
"pluno-pa-widget__character--empty",
|
|
2863
2883
|
o()
|
|
2864
2884
|
);
|
|
@@ -2866,10 +2886,10 @@ function Kn(e, t, n, o, i, a, l, p) {
|
|
|
2866
2886
|
const u = document.createElement("div");
|
|
2867
2887
|
if (u.className = "pluno-pa-widget__empty", u.textContent = i, d.appendChild(u), l) {
|
|
2868
2888
|
const m = document.createElement("a");
|
|
2869
|
-
m.className = "pluno-pa-widget__login", m.href = l, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent =
|
|
2889
|
+
m.className = "pluno-pa-widget__login", m.href = l, m.target = "_blank", m.rel = "noopener noreferrer", m.textContent = r, d.appendChild(m);
|
|
2870
2890
|
} else {
|
|
2871
2891
|
const m = document.createElement("button");
|
|
2872
|
-
m.type = "button", m.className = "pluno-pa-widget__login", m.textContent =
|
|
2892
|
+
m.type = "button", m.className = "pluno-pa-widget__login", m.textContent = r, m.addEventListener("click", () => p?.()), d.appendChild(m);
|
|
2873
2893
|
}
|
|
2874
2894
|
e.appendChild(d);
|
|
2875
2895
|
}
|
|
@@ -2891,15 +2911,15 @@ function rr(e, t) {
|
|
|
2891
2911
|
n.className = "pluno-pa-widget__share-prompt";
|
|
2892
2912
|
const o = document.createElement("div");
|
|
2893
2913
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
2894
|
-
|
|
2914
|
+
_e(
|
|
2895
2915
|
"pluno-pa-widget__share-prompt-icon",
|
|
2896
2916
|
t.characterIconOptions
|
|
2897
2917
|
)
|
|
2898
2918
|
);
|
|
2899
2919
|
const i = document.createElement("div");
|
|
2900
2920
|
i.className = "pluno-pa-widget__share-prompt-copy";
|
|
2901
|
-
const
|
|
2902
|
-
|
|
2921
|
+
const r = document.createElement("strong");
|
|
2922
|
+
r.textContent = "Share this win?", i.appendChild(r);
|
|
2903
2923
|
const l = document.createElement("span");
|
|
2904
2924
|
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
|
|
2905
2925
|
const u = document.createElement("span");
|
|
@@ -2913,7 +2933,7 @@ function rr(e, t) {
|
|
|
2913
2933
|
const c = document.createElement("button");
|
|
2914
2934
|
if (c.type = "button", c.disabled = t.isDrafting, c.addEventListener("click", () => {
|
|
2915
2935
|
t.onDraft(e);
|
|
2916
|
-
}), t.isDrafting ? (c.appendChild(
|
|
2936
|
+
}), t.isDrafting ? (c.appendChild(on()), c.appendChild(document.createTextNode("Drafting..."))) : c.textContent = "Draft a social post", d.appendChild(c), t.isDrafting)
|
|
2917
2937
|
p.appendChild(d);
|
|
2918
2938
|
else {
|
|
2919
2939
|
const u = document.createElement("button");
|
|
@@ -2934,8 +2954,8 @@ function lr(e, t) {
|
|
|
2934
2954
|
});
|
|
2935
2955
|
const o = document.createElement("section");
|
|
2936
2956
|
o.className = "pluno-pa-widget__share-dialog", o.setAttribute("role", "dialog"), o.setAttribute("aria-modal", "true"), o.setAttribute("aria-label", "Draft a social post");
|
|
2937
|
-
const i = document.createElement("header"),
|
|
2938
|
-
|
|
2957
|
+
const i = document.createElement("header"), r = document.createElement("strong");
|
|
2958
|
+
r.textContent = "Share this win", i.appendChild(r);
|
|
2939
2959
|
const l = document.createElement("button");
|
|
2940
2960
|
l.type = "button", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), o.appendChild(i);
|
|
2941
2961
|
const p = document.createElement("p");
|
|
@@ -2959,27 +2979,27 @@ function lr(e, t) {
|
|
|
2959
2979
|
if (c.appendChild(m), d.appendChild(c), e.screenshotDataUrl) {
|
|
2960
2980
|
const g = document.createElement("div");
|
|
2961
2981
|
g.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
2962
|
-
const
|
|
2963
|
-
|
|
2982
|
+
const y = document.createElement("img");
|
|
2983
|
+
y.src = e.screenshotDataUrl, y.alt = "Product page with Pluno open", g.appendChild(y), d.appendChild(g);
|
|
2964
2984
|
}
|
|
2965
2985
|
o.appendChild(d), o.appendChild(p);
|
|
2966
2986
|
const k = document.createElement("div");
|
|
2967
2987
|
k.className = "pluno-pa-widget__share-dialog-step";
|
|
2968
2988
|
const v = document.createElement("strong");
|
|
2969
2989
|
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", k.appendChild(v);
|
|
2970
|
-
const
|
|
2971
|
-
|
|
2972
|
-
const
|
|
2973
|
-
|
|
2990
|
+
const R = document.createElement("p");
|
|
2991
|
+
R.className = "pluno-pa-widget__share-dialog-hint", R.textContent = "Post draft opens prefilled on supported platforms.", k.appendChild(R);
|
|
2992
|
+
const C = document.createElement("footer");
|
|
2993
|
+
C.className = "pluno-pa-widget__share-dialog-platforms";
|
|
2974
2994
|
for (const g of sr(e)) {
|
|
2975
|
-
const
|
|
2976
|
-
|
|
2995
|
+
const y = document.createElement("a");
|
|
2996
|
+
y.href = g.href, y.target = "_blank", y.rel = "noopener noreferrer", y.title = g.label, y.setAttribute("aria-label", `Open ${g.label}`), y.appendChild(dr(g.id)), C.appendChild(y);
|
|
2977
2997
|
}
|
|
2978
|
-
if (k.appendChild(
|
|
2998
|
+
if (k.appendChild(C), o.appendChild(k), t.socialPostRewardsUrl) {
|
|
2979
2999
|
const g = document.createElement("div");
|
|
2980
3000
|
g.className = "pluno-pa-widget__share-dialog-step";
|
|
2981
|
-
const
|
|
2982
|
-
|
|
3001
|
+
const y = document.createElement("strong");
|
|
3002
|
+
y.className = "pluno-pa-widget__share-dialog-step-title", y.textContent = "3) Submit post to get 2000 free credits!", g.appendChild(y);
|
|
2983
3003
|
const h = document.createElement("a");
|
|
2984
3004
|
h.className = "pluno-pa-widget__share-dialog-reward-link", h.href = t.socialPostRewardsUrl, h.target = "_blank", h.rel = "noopener noreferrer", h.appendChild(document.createTextNode("Submit post URL")), h.appendChild(cr()), g.appendChild(h), o.appendChild(g);
|
|
2985
3005
|
}
|
|
@@ -3013,40 +3033,40 @@ function sr(e) {
|
|
|
3013
3033
|
}
|
|
3014
3034
|
function dr(e) {
|
|
3015
3035
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3016
|
-
return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (
|
|
3036
|
+
return t.setAttribute("class", "pluno-pa-widget__share-dialog-platform-logo"), t.setAttribute("viewBox", "0 0 32 32"), t.setAttribute("aria-hidden", "true"), e === "linkedin" ? (W(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), W(
|
|
3017
3037
|
t,
|
|
3018
3038
|
"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"
|
|
3019
|
-
),
|
|
3039
|
+
), W(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), W(
|
|
3020
3040
|
t,
|
|
3021
3041
|
"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"
|
|
3022
|
-
),
|
|
3042
|
+
), W(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (W(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), W(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), W(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (W(
|
|
3023
3043
|
t,
|
|
3024
3044
|
"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"
|
|
3025
|
-
),
|
|
3045
|
+
), W(
|
|
3026
3046
|
t,
|
|
3027
3047
|
"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",
|
|
3028
3048
|
"0.48"
|
|
3029
|
-
),
|
|
3049
|
+
), W(
|
|
3030
3050
|
t,
|
|
3031
3051
|
"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"
|
|
3032
|
-
),
|
|
3052
|
+
), W(
|
|
3033
3053
|
t,
|
|
3034
3054
|
"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"
|
|
3035
3055
|
), t);
|
|
3036
3056
|
}
|
|
3037
|
-
function
|
|
3057
|
+
function W(e, t, n) {
|
|
3038
3058
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3039
3059
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3040
3060
|
}
|
|
3041
3061
|
function cr() {
|
|
3042
3062
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3043
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
3063
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), W(e, "M14 5h5v5"), W(e, "M19 5l-8 8"), W(
|
|
3044
3064
|
e,
|
|
3045
3065
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3046
3066
|
), e;
|
|
3047
3067
|
}
|
|
3048
|
-
function
|
|
3049
|
-
return e.role === "tool" && e.toolName ===
|
|
3068
|
+
function ko(e) {
|
|
3069
|
+
return e.role === "tool" && e.toolName === io;
|
|
3050
3070
|
}
|
|
3051
3071
|
function ur(e) {
|
|
3052
3072
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
@@ -3056,45 +3076,45 @@ function gr(e, t, n, o) {
|
|
|
3056
3076
|
i.className = "pluno-pa-widget__tool-group", i.title = new Date(
|
|
3057
3077
|
e[e.length - 1].createdAt
|
|
3058
3078
|
).toLocaleString(), i.appendChild(
|
|
3059
|
-
|
|
3079
|
+
_e(
|
|
3060
3080
|
"pluno-pa-widget__character--tool-group",
|
|
3061
3081
|
o
|
|
3062
3082
|
)
|
|
3063
3083
|
);
|
|
3064
|
-
const
|
|
3065
|
-
|
|
3066
|
-
i.classList.toggle("pluno-pa-widget__tool-group--open",
|
|
3084
|
+
const r = document.createElement("details"), l = hr(e);
|
|
3085
|
+
r.open = t.has(l), i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.addEventListener("toggle", () => {
|
|
3086
|
+
i.classList.toggle("pluno-pa-widget__tool-group--open", r.open), r.open ? t.add(l) : t.delete(l), n();
|
|
3067
3087
|
});
|
|
3068
3088
|
const p = document.createElement("summary");
|
|
3069
|
-
p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(
|
|
3089
|
+
p.className = "pluno-pa-widget__tool-summary", e.some((u) => u.loading) && p.appendChild(on());
|
|
3070
3090
|
const c = document.createElement("span");
|
|
3071
|
-
if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c),
|
|
3091
|
+
if (c.className = "pluno-pa-widget__tool-summary-title", c.textContent = e[e.length - 1].content || "Run tool", p.appendChild(c), r.appendChild(p), e.length > 0) {
|
|
3072
3092
|
const u = document.createElement("div");
|
|
3073
3093
|
u.className = "pluno-pa-widget__tool-lines";
|
|
3074
3094
|
for (const m of e) {
|
|
3075
3095
|
const k = document.createElement("div");
|
|
3076
|
-
k.className = "pluno-pa-widget__tool-line", m.loading && k.appendChild(
|
|
3096
|
+
k.className = "pluno-pa-widget__tool-line", m.loading && k.appendChild(on());
|
|
3077
3097
|
const v = document.createElement("span");
|
|
3078
3098
|
v.textContent = m.content || "Run tool", k.appendChild(v), u.appendChild(k);
|
|
3079
3099
|
}
|
|
3080
|
-
|
|
3100
|
+
r.appendChild(u);
|
|
3081
3101
|
}
|
|
3082
|
-
return i.appendChild(
|
|
3102
|
+
return i.appendChild(r), i;
|
|
3083
3103
|
}
|
|
3084
|
-
function
|
|
3104
|
+
function Lo(e) {
|
|
3085
3105
|
const t = document.createElement("article");
|
|
3086
3106
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3087
|
-
|
|
3107
|
+
_e(
|
|
3088
3108
|
"pluno-pa-widget__character--tool-group",
|
|
3089
3109
|
e
|
|
3090
3110
|
)
|
|
3091
3111
|
), t;
|
|
3092
3112
|
}
|
|
3093
|
-
function
|
|
3094
|
-
const t =
|
|
3095
|
-
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(
|
|
3113
|
+
function Zn(e) {
|
|
3114
|
+
const t = Lo(e);
|
|
3115
|
+
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(mt()), t;
|
|
3096
3116
|
}
|
|
3097
|
-
function
|
|
3117
|
+
function mt(e = "Thinking...") {
|
|
3098
3118
|
const t = document.createElement("div");
|
|
3099
3119
|
t.className = "pluno-pa-widget__status";
|
|
3100
3120
|
const n = document.createElement("span");
|
|
@@ -3105,12 +3125,12 @@ function gt(e = "Thinking...") {
|
|
|
3105
3125
|
function hr(e) {
|
|
3106
3126
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3107
3127
|
}
|
|
3108
|
-
function
|
|
3128
|
+
function on() {
|
|
3109
3129
|
const e = document.createElement("span");
|
|
3110
3130
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3111
3131
|
}
|
|
3112
|
-
function
|
|
3113
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Fa() :
|
|
3132
|
+
function Io(e, t) {
|
|
3133
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? Fa() : vo());
|
|
3114
3134
|
}
|
|
3115
3135
|
function mr(e, t) {
|
|
3116
3136
|
const n = t.replace(/\r\n/g, `
|
|
@@ -3136,14 +3156,14 @@ function mr(e, t) {
|
|
|
3136
3156
|
const l = i.match(/^(#{1,3})\s+(.+)$/);
|
|
3137
3157
|
if (l) {
|
|
3138
3158
|
const c = document.createElement(`h${l[1].length + 2}`);
|
|
3139
|
-
|
|
3159
|
+
st(c, l[2]), e.appendChild(c), o += 1;
|
|
3140
3160
|
continue;
|
|
3141
3161
|
}
|
|
3142
3162
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
3143
3163
|
const c = document.createElement("ul");
|
|
3144
3164
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3145
3165
|
const u = document.createElement("li");
|
|
3146
|
-
|
|
3166
|
+
st(u, n[o].replace(/^\s*[-*+]\s+/, "")), c.appendChild(u), o += 1;
|
|
3147
3167
|
}
|
|
3148
3168
|
e.appendChild(c);
|
|
3149
3169
|
continue;
|
|
@@ -3152,7 +3172,7 @@ function mr(e, t) {
|
|
|
3152
3172
|
const c = document.createElement("ol");
|
|
3153
3173
|
for (; o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3154
3174
|
const u = document.createElement("li");
|
|
3155
|
-
|
|
3175
|
+
st(u, n[o].replace(/^\s*\d+\.\s+/, "")), c.appendChild(u), o += 1;
|
|
3156
3176
|
}
|
|
3157
3177
|
e.appendChild(c);
|
|
3158
3178
|
continue;
|
|
@@ -3162,17 +3182,17 @@ function mr(e, t) {
|
|
|
3162
3182
|
p.push(n[o]), o += 1;
|
|
3163
3183
|
const d = document.createElement("p");
|
|
3164
3184
|
p.forEach((c, u) => {
|
|
3165
|
-
u > 0 && d.appendChild(document.createElement("br")),
|
|
3185
|
+
u > 0 && d.appendChild(document.createElement("br")), st(d, c);
|
|
3166
3186
|
}), e.appendChild(d);
|
|
3167
3187
|
}
|
|
3168
3188
|
}
|
|
3169
|
-
function
|
|
3189
|
+
function st(e, t) {
|
|
3170
3190
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
3171
3191
|
let o = 0;
|
|
3172
3192
|
for (const i of t.matchAll(n)) {
|
|
3173
|
-
const
|
|
3174
|
-
|
|
3175
|
-
document.createTextNode(t.slice(o,
|
|
3193
|
+
const r = i.index ?? 0;
|
|
3194
|
+
r > o && e.appendChild(
|
|
3195
|
+
document.createTextNode(t.slice(o, r))
|
|
3176
3196
|
);
|
|
3177
3197
|
const l = i[0];
|
|
3178
3198
|
if (l.startsWith("`")) {
|
|
@@ -3192,7 +3212,7 @@ function lt(e, t) {
|
|
|
3192
3212
|
} else
|
|
3193
3213
|
e.appendChild(document.createTextNode(l));
|
|
3194
3214
|
}
|
|
3195
|
-
o =
|
|
3215
|
+
o = r + l.length;
|
|
3196
3216
|
}
|
|
3197
3217
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3198
3218
|
}
|
|
@@ -3206,7 +3226,7 @@ function fr(e) {
|
|
|
3206
3226
|
return !1;
|
|
3207
3227
|
}
|
|
3208
3228
|
}
|
|
3209
|
-
function
|
|
3229
|
+
function Jn(e, t) {
|
|
3210
3230
|
if (wr(e))
|
|
3211
3231
|
return;
|
|
3212
3232
|
const n = `
|
|
@@ -3260,7 +3280,7 @@ function Xn(e, t) {
|
|
|
3260
3280
|
--pluno-pa-accent-contrast: #fafafa;
|
|
3261
3281
|
position: fixed;
|
|
3262
3282
|
z-index: 2147483645;
|
|
3263
|
-
font-family: ${
|
|
3283
|
+
font-family: ${ie.fontFamily};
|
|
3264
3284
|
font-size: 14px;
|
|
3265
3285
|
color: var(--pluno-pa-text);
|
|
3266
3286
|
width: var(--pluno-pa-launcher-width);
|
|
@@ -4339,7 +4359,7 @@ function Xn(e, t) {
|
|
|
4339
4359
|
place-items: center;
|
|
4340
4360
|
padding: 18px;
|
|
4341
4361
|
background: rgba(24, 24, 27, 0.28);
|
|
4342
|
-
font-family: var(--pluno-pa-font, ${
|
|
4362
|
+
font-family: var(--pluno-pa-font, ${ie.fontFamily});
|
|
4343
4363
|
color: var(--pluno-pa-text);
|
|
4344
4364
|
}
|
|
4345
4365
|
.pluno-pa-widget__share-dialog {
|
|
@@ -4910,6 +4930,11 @@ function Xn(e, t) {
|
|
|
4910
4930
|
padding: 36px 4px calc(var(--pluno-pa-starter-edge-gap) - 12px);
|
|
4911
4931
|
text-align: left;
|
|
4912
4932
|
}
|
|
4933
|
+
.pluno-pa-widget__empty-state--morning-report {
|
|
4934
|
+
--pluno-pa-starter-edge-gap: 18px;
|
|
4935
|
+
margin: auto 0;
|
|
4936
|
+
padding: 12px 4px;
|
|
4937
|
+
}
|
|
4913
4938
|
.pluno-pa-widget__error-retry {
|
|
4914
4939
|
display: block;
|
|
4915
4940
|
margin-top: 6px;
|
|
@@ -4929,6 +4954,21 @@ function Xn(e, t) {
|
|
|
4929
4954
|
line-height: 1.34;
|
|
4930
4955
|
text-align: left;
|
|
4931
4956
|
}
|
|
4957
|
+
.pluno-pa-widget__morning-report-snooze {
|
|
4958
|
+
justify-self: end;
|
|
4959
|
+
margin-top: calc(var(--pluno-pa-starter-edge-gap) * -0.55);
|
|
4960
|
+
padding: 4px 8px;
|
|
4961
|
+
border: 0;
|
|
4962
|
+
background: transparent;
|
|
4963
|
+
color: var(--pluno-pa-muted);
|
|
4964
|
+
font: inherit;
|
|
4965
|
+
font-size: 12px;
|
|
4966
|
+
text-decoration: underline;
|
|
4967
|
+
cursor: pointer;
|
|
4968
|
+
}
|
|
4969
|
+
.pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__morning-report-snooze {
|
|
4970
|
+
margin-top: -6px;
|
|
4971
|
+
}
|
|
4932
4972
|
.pluno-pa-widget__empty-hero {
|
|
4933
4973
|
display: inline-flex;
|
|
4934
4974
|
align-items: center;
|
|
@@ -4989,6 +5029,9 @@ function Xn(e, t) {
|
|
|
4989
5029
|
gap: 18px;
|
|
4990
5030
|
width: min(100%, 320px);
|
|
4991
5031
|
}
|
|
5032
|
+
.pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__starter-prompts {
|
|
5033
|
+
gap: 12px;
|
|
5034
|
+
}
|
|
4992
5035
|
.pluno-pa-widget__starter-prompts--empty {
|
|
4993
5036
|
pointer-events: none;
|
|
4994
5037
|
}
|
|
@@ -5139,8 +5182,8 @@ function Xn(e, t) {
|
|
|
5139
5182
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
5140
5183
|
position: absolute;
|
|
5141
5184
|
top: -16px;
|
|
5142
|
-
left: ${
|
|
5143
|
-
width: calc(100% - ${
|
|
5185
|
+
left: ${Zt}px;
|
|
5186
|
+
width: calc(100% - ${Zt * 2}px);
|
|
5144
5187
|
height: 36px;
|
|
5145
5188
|
z-index: 3;
|
|
5146
5189
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -5184,6 +5227,10 @@ function Xn(e, t) {
|
|
|
5184
5227
|
.pluno-pa-widget--scribble .pluno-pa-widget__empty-state--starter .pluno-pa-widget__character--empty {
|
|
5185
5228
|
margin-bottom: 0;
|
|
5186
5229
|
}
|
|
5230
|
+
.pluno-pa-widget--scribble .pluno-pa-widget__empty-state--morning-report .pluno-pa-widget__character--empty {
|
|
5231
|
+
width: 96px;
|
|
5232
|
+
height: 96px;
|
|
5233
|
+
}
|
|
5187
5234
|
.pluno-pa-widget--scribble .pluno-pa-widget__character--tool-group {
|
|
5188
5235
|
width: 60px;
|
|
5189
5236
|
height: 60px;
|
|
@@ -5491,20 +5538,20 @@ function Xn(e, t) {
|
|
|
5491
5538
|
if (br(e, n))
|
|
5492
5539
|
return;
|
|
5493
5540
|
const o = e.ownerDocument.createElement("style");
|
|
5494
|
-
o.id =
|
|
5541
|
+
o.id = ho, o.textContent = n, e.appendChild(o), Po(e);
|
|
5495
5542
|
}
|
|
5496
5543
|
function wr(e) {
|
|
5497
|
-
return e.getElementById(
|
|
5544
|
+
return e.getElementById(ho) !== null || e.host instanceof HTMLElement && e.host.getAttribute(mo) === "true";
|
|
5498
5545
|
}
|
|
5499
|
-
function
|
|
5500
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
5546
|
+
function Po(e) {
|
|
5547
|
+
e.host instanceof HTMLElement && e.host.setAttribute(mo, "true");
|
|
5501
5548
|
}
|
|
5502
5549
|
function br(e, t) {
|
|
5503
5550
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
5504
5551
|
return !1;
|
|
5505
5552
|
try {
|
|
5506
5553
|
const n = new CSSStyleSheet();
|
|
5507
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
5554
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], Po(e), !0;
|
|
5508
5555
|
} catch {
|
|
5509
5556
|
return !1;
|
|
5510
5557
|
}
|
|
@@ -5517,7 +5564,7 @@ async function _r() {
|
|
|
5517
5564
|
t.observe(document.documentElement, { childList: !0 });
|
|
5518
5565
|
});
|
|
5519
5566
|
}
|
|
5520
|
-
function
|
|
5567
|
+
function To(e) {
|
|
5521
5568
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
5522
5569
|
}
|
|
5523
5570
|
function xr(e) {
|
|
@@ -5525,10 +5572,10 @@ function xr(e) {
|
|
|
5525
5572
|
return { clientId: e, release: () => {
|
|
5526
5573
|
} };
|
|
5527
5574
|
let t = 0;
|
|
5528
|
-
for (;
|
|
5575
|
+
for (; Mt.has(t); )
|
|
5529
5576
|
t += 1;
|
|
5530
|
-
|
|
5531
|
-
const n = `${
|
|
5577
|
+
Mt.add(t);
|
|
5578
|
+
const n = `${Ri}${t}`;
|
|
5532
5579
|
let o = crypto.randomUUID();
|
|
5533
5580
|
try {
|
|
5534
5581
|
o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
|
|
@@ -5538,15 +5585,15 @@ function xr(e) {
|
|
|
5538
5585
|
return {
|
|
5539
5586
|
clientId: o,
|
|
5540
5587
|
release: () => {
|
|
5541
|
-
i || (i = !0,
|
|
5588
|
+
i || (i = !0, Mt.delete(t));
|
|
5542
5589
|
}
|
|
5543
5590
|
};
|
|
5544
5591
|
}
|
|
5545
5592
|
function yr(e) {
|
|
5546
5593
|
try {
|
|
5547
|
-
const t = window.localStorage.getItem(
|
|
5594
|
+
const t = window.localStorage.getItem(To(e));
|
|
5548
5595
|
if (!t)
|
|
5549
|
-
return
|
|
5596
|
+
return Qn();
|
|
5550
5597
|
const n = JSON.parse(t);
|
|
5551
5598
|
return {
|
|
5552
5599
|
isOpen: n.isOpen === !0,
|
|
@@ -5557,19 +5604,19 @@ function yr(e) {
|
|
|
5557
5604
|
(o) => typeof o == "string"
|
|
5558
5605
|
) : [],
|
|
5559
5606
|
launcherPosition: Er(n.launcherPosition) ? n.launcherPosition : null,
|
|
5560
|
-
panelSize: kr(n.panelSize) ?
|
|
5561
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
5607
|
+
panelSize: kr(n.panelSize) ? ft(n.panelSize) : null,
|
|
5608
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-ao) : [],
|
|
5562
5609
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
5563
5610
|
};
|
|
5564
5611
|
} catch {
|
|
5565
|
-
return
|
|
5612
|
+
return Qn();
|
|
5566
5613
|
}
|
|
5567
5614
|
}
|
|
5568
5615
|
async function vr(e) {
|
|
5569
5616
|
if (e.loadSharePromptsDisabled)
|
|
5570
5617
|
return e.loadSharePromptsDisabled();
|
|
5571
5618
|
try {
|
|
5572
|
-
return window.localStorage.getItem(
|
|
5619
|
+
return window.localStorage.getItem(lo) === "true";
|
|
5573
5620
|
} catch {
|
|
5574
5621
|
return !1;
|
|
5575
5622
|
}
|
|
@@ -5583,12 +5630,12 @@ function Cr(e, t) {
|
|
|
5583
5630
|
return;
|
|
5584
5631
|
}
|
|
5585
5632
|
try {
|
|
5586
|
-
t && window.localStorage.setItem(
|
|
5633
|
+
t && window.localStorage.setItem(lo, "true");
|
|
5587
5634
|
} catch {
|
|
5588
5635
|
return;
|
|
5589
5636
|
}
|
|
5590
5637
|
}
|
|
5591
|
-
function
|
|
5638
|
+
function Qn() {
|
|
5592
5639
|
return {
|
|
5593
5640
|
isOpen: !1,
|
|
5594
5641
|
composerValue: "",
|
|
@@ -5604,7 +5651,7 @@ function Zn() {
|
|
|
5604
5651
|
function Sr(e, t) {
|
|
5605
5652
|
try {
|
|
5606
5653
|
window.localStorage.setItem(
|
|
5607
|
-
|
|
5654
|
+
To(e),
|
|
5608
5655
|
JSON.stringify(t)
|
|
5609
5656
|
);
|
|
5610
5657
|
} catch {
|
|
@@ -5623,7 +5670,7 @@ function kr(e) {
|
|
|
5623
5670
|
const t = e;
|
|
5624
5671
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
5625
5672
|
}
|
|
5626
|
-
async function
|
|
5673
|
+
async function Ao(e, t) {
|
|
5627
5674
|
const n = await fetch(e, {
|
|
5628
5675
|
method: "POST",
|
|
5629
5676
|
credentials: "include",
|
|
@@ -5635,8 +5682,8 @@ async function Io(e, t) {
|
|
|
5635
5682
|
...t ? { signal: t } : {}
|
|
5636
5683
|
});
|
|
5637
5684
|
if (!n.ok) {
|
|
5638
|
-
const i = await n.text(),
|
|
5639
|
-
throw
|
|
5685
|
+
const i = await n.text(), r = Qo(i);
|
|
5686
|
+
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
5640
5687
|
}
|
|
5641
5688
|
const o = await n.json();
|
|
5642
5689
|
if (!o.token)
|
|
@@ -5647,9 +5694,9 @@ function Lr(e) {
|
|
|
5647
5694
|
return async () => {
|
|
5648
5695
|
const t = new AbortController();
|
|
5649
5696
|
let n = !1;
|
|
5650
|
-
const o = new Promise((i,
|
|
5697
|
+
const o = new Promise((i, r) => {
|
|
5651
5698
|
const l = window.setTimeout(() => {
|
|
5652
|
-
n = !0, t.abort(),
|
|
5699
|
+
n = !0, t.abort(), r(new Error(Pn));
|
|
5653
5700
|
}, Ai);
|
|
5654
5701
|
t.signal.addEventListener(
|
|
5655
5702
|
"abort",
|
|
@@ -5659,41 +5706,41 @@ function Lr(e) {
|
|
|
5659
5706
|
});
|
|
5660
5707
|
try {
|
|
5661
5708
|
const i = await Promise.race([
|
|
5662
|
-
|
|
5709
|
+
Ao(e, t.signal),
|
|
5663
5710
|
o
|
|
5664
5711
|
]);
|
|
5665
5712
|
return t.abort(), i;
|
|
5666
5713
|
} catch (i) {
|
|
5667
|
-
throw t.abort(), n ? new Error(
|
|
5714
|
+
throw t.abort(), n ? new Error(Pn) : i instanceof Error && i.message.startsWith("Pluno widget blocked on ") ? i : new Error(Ni);
|
|
5668
5715
|
}
|
|
5669
5716
|
};
|
|
5670
5717
|
}
|
|
5671
|
-
const
|
|
5672
|
-
function
|
|
5718
|
+
const eo = /* @__PURE__ */ new WeakSet();
|
|
5719
|
+
function Ir(e) {
|
|
5673
5720
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
5674
5721
|
}
|
|
5675
|
-
function
|
|
5722
|
+
function to(e) {
|
|
5676
5723
|
const t = e.pathname.split("/");
|
|
5677
5724
|
return t[t.length - 1] ?? "";
|
|
5678
5725
|
}
|
|
5679
|
-
function
|
|
5726
|
+
function Pr(e, t) {
|
|
5680
5727
|
const n = new URL(e.src, document.baseURI);
|
|
5681
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
5728
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : to(n) === to(t);
|
|
5682
5729
|
}
|
|
5683
|
-
class
|
|
5730
|
+
class ue extends EventTarget {
|
|
5684
5731
|
constructor(t, n) {
|
|
5685
5732
|
super(), this.channelId = n, this.url = t, this.addPreviewListener(ki, () => {
|
|
5686
|
-
this.readyState =
|
|
5733
|
+
this.readyState = ue.OPEN, this.dispatchEvent(new Event("open"));
|
|
5687
5734
|
}), this.addPreviewListener(Li, (o) => {
|
|
5688
5735
|
const i = o;
|
|
5689
5736
|
this.dispatchEvent(
|
|
5690
5737
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
5691
5738
|
);
|
|
5692
|
-
}), this.addPreviewListener(
|
|
5693
|
-
this.readyState =
|
|
5694
|
-
}), this.addPreviewListener(
|
|
5739
|
+
}), this.addPreviewListener(Ii, () => {
|
|
5740
|
+
this.readyState = ue.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
5741
|
+
}), this.addPreviewListener(Pi, (o) => {
|
|
5695
5742
|
const i = o;
|
|
5696
|
-
this.readyState =
|
|
5743
|
+
this.readyState = ue.CLOSED, this.dispatchEvent(
|
|
5697
5744
|
new CloseEvent("close", {
|
|
5698
5745
|
code: i.detail?.code ?? 1e3,
|
|
5699
5746
|
reason: i.detail?.reason ?? "",
|
|
@@ -5702,7 +5749,7 @@ class de extends EventTarget {
|
|
|
5702
5749
|
), this.cleanup();
|
|
5703
5750
|
}), window.dispatchEvent(
|
|
5704
5751
|
new CustomEvent(
|
|
5705
|
-
|
|
5752
|
+
dt(
|
|
5706
5753
|
Ci,
|
|
5707
5754
|
this.channelId
|
|
5708
5755
|
),
|
|
@@ -5722,18 +5769,18 @@ class de extends EventTarget {
|
|
|
5722
5769
|
extensions = "";
|
|
5723
5770
|
binaryType = "blob";
|
|
5724
5771
|
bufferedAmount = 0;
|
|
5725
|
-
readyState =
|
|
5772
|
+
readyState = ue.CONNECTING;
|
|
5726
5773
|
socketId = Tr();
|
|
5727
5774
|
listeners = /* @__PURE__ */ new Map();
|
|
5728
5775
|
send(t) {
|
|
5729
|
-
if (this.readyState !==
|
|
5776
|
+
if (this.readyState !== ue.OPEN)
|
|
5730
5777
|
throw new DOMException(
|
|
5731
5778
|
"Pluno preview websocket is not open",
|
|
5732
5779
|
"InvalidStateError"
|
|
5733
5780
|
);
|
|
5734
5781
|
window.dispatchEvent(
|
|
5735
5782
|
new CustomEvent(
|
|
5736
|
-
|
|
5783
|
+
dt(Si, this.channelId),
|
|
5737
5784
|
{
|
|
5738
5785
|
detail: {
|
|
5739
5786
|
socketId: this.socketId,
|
|
@@ -5744,9 +5791,9 @@ class de extends EventTarget {
|
|
|
5744
5791
|
);
|
|
5745
5792
|
}
|
|
5746
5793
|
close(t, n) {
|
|
5747
|
-
this.readyState !==
|
|
5794
|
+
this.readyState !== ue.CLOSED && (this.readyState = ue.CLOSING, window.dispatchEvent(
|
|
5748
5795
|
new CustomEvent(
|
|
5749
|
-
|
|
5796
|
+
dt(Ei, this.channelId),
|
|
5750
5797
|
{
|
|
5751
5798
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
5752
5799
|
}
|
|
@@ -5754,11 +5801,11 @@ class de extends EventTarget {
|
|
|
5754
5801
|
), this.cleanup());
|
|
5755
5802
|
}
|
|
5756
5803
|
addPreviewListener(t, n) {
|
|
5757
|
-
const o =
|
|
5804
|
+
const o = dt(
|
|
5758
5805
|
t,
|
|
5759
5806
|
this.channelId
|
|
5760
|
-
), i = (
|
|
5761
|
-
|
|
5807
|
+
), i = (r) => {
|
|
5808
|
+
r.detail?.socketId === this.socketId && n(r);
|
|
5762
5809
|
};
|
|
5763
5810
|
this.listeners.set(o, i), window.addEventListener(o, i);
|
|
5764
5811
|
}
|
|
@@ -5770,14 +5817,14 @@ class de extends EventTarget {
|
|
|
5770
5817
|
}
|
|
5771
5818
|
function Tr() {
|
|
5772
5819
|
const e = window.sessionStorage.getItem(
|
|
5773
|
-
|
|
5820
|
+
In
|
|
5774
5821
|
);
|
|
5775
5822
|
if (e)
|
|
5776
5823
|
return e;
|
|
5777
5824
|
const t = crypto.randomUUID();
|
|
5778
|
-
return window.sessionStorage.setItem(
|
|
5825
|
+
return window.sessionStorage.setItem(In, t), t;
|
|
5779
5826
|
}
|
|
5780
|
-
function
|
|
5827
|
+
function dt(e, t) {
|
|
5781
5828
|
return `${e}:${t}`;
|
|
5782
5829
|
}
|
|
5783
5830
|
function Ar(e) {
|
|
@@ -5788,29 +5835,29 @@ function Ar(e) {
|
|
|
5788
5835
|
return Array.from(
|
|
5789
5836
|
document.querySelectorAll("script[type='module'][src]")
|
|
5790
5837
|
).filter(
|
|
5791
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
5838
|
+
(i) => i instanceof HTMLScriptElement && Ir(i) && Pr(i, o)
|
|
5792
5839
|
);
|
|
5793
5840
|
}
|
|
5794
5841
|
function Nr(e) {
|
|
5795
5842
|
for (const t of Ar(e))
|
|
5796
|
-
|
|
5843
|
+
eo.has(t) || t.dataset.plunoAutoMount === "false" || (eo.add(t), No(t).catch((n) => {
|
|
5797
5844
|
console.error("Failed to mount Pluno widget", n);
|
|
5798
5845
|
}));
|
|
5799
5846
|
}
|
|
5800
|
-
function
|
|
5801
|
-
const t = window, n = t[
|
|
5847
|
+
function No(e) {
|
|
5848
|
+
const t = window, n = t[ce];
|
|
5802
5849
|
if (n) {
|
|
5803
5850
|
if (n.host === null)
|
|
5804
5851
|
return n.mountPromise.catch(() => {
|
|
5805
|
-
const p = t[
|
|
5806
|
-
return p ? p.mountPromise :
|
|
5852
|
+
const p = t[ce];
|
|
5853
|
+
return p ? p.mountPromise : No(e);
|
|
5807
5854
|
});
|
|
5808
|
-
if (
|
|
5855
|
+
if (Rr(n.host))
|
|
5809
5856
|
return n.mountPromise;
|
|
5810
|
-
n.destroy?.(), delete t[
|
|
5857
|
+
n.destroy?.(), delete t[ce];
|
|
5811
5858
|
}
|
|
5812
5859
|
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint;
|
|
5813
|
-
let
|
|
5860
|
+
let r;
|
|
5814
5861
|
const l = ta({
|
|
5815
5862
|
token: e.dataset.plunoToken,
|
|
5816
5863
|
tokenProvider: !e.dataset.plunoToken && !o && i ? Lr(i) : void 0,
|
|
@@ -5824,25 +5871,25 @@ function To(e) {
|
|
|
5824
5871
|
scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
|
|
5825
5872
|
position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
5826
5873
|
}).then((p) => {
|
|
5827
|
-
if (t[
|
|
5874
|
+
if (t[ce] !== r) {
|
|
5828
5875
|
p.destroy();
|
|
5829
5876
|
return;
|
|
5830
5877
|
}
|
|
5831
5878
|
const d = p.host;
|
|
5832
|
-
d.setAttribute(
|
|
5833
|
-
t[
|
|
5879
|
+
d.setAttribute(ro, "true"), r.host = d, r.destroy = () => {
|
|
5880
|
+
t[ce] === r && delete t[ce], r.host = null, r.destroy = null, p.destroy();
|
|
5834
5881
|
};
|
|
5835
5882
|
}).catch((p) => {
|
|
5836
|
-
throw t[
|
|
5883
|
+
throw t[ce] === r && delete t[ce], p;
|
|
5837
5884
|
});
|
|
5838
|
-
return
|
|
5885
|
+
return r = {
|
|
5839
5886
|
mountPromise: l,
|
|
5840
5887
|
host: null,
|
|
5841
5888
|
destroy: null
|
|
5842
|
-
}, t[
|
|
5889
|
+
}, t[ce] = r, l;
|
|
5843
5890
|
}
|
|
5844
|
-
function
|
|
5845
|
-
return e.isConnected && e.getAttribute(
|
|
5891
|
+
function Rr(e) {
|
|
5892
|
+
return e.isConnected && e.getAttribute(ro) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
5846
5893
|
}
|
|
5847
5894
|
Nr(import.meta.url);
|
|
5848
5895
|
export {
|