@pluno/product-agent-web 0.1.109 → 0.1.111
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-widget.js +1232 -1135
- package/dist/widget.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
import { PlunoProductAgent as Si, getProductAgentOriginAccessErrorMessage as
|
|
2
|
-
const
|
|
3
|
-
function
|
|
4
|
-
const t =
|
|
5
|
-
if (
|
|
1
|
+
import { PlunoProductAgent as Si, getProductAgentOriginAccessErrorMessage as Ei } from "./product-agent-sdk.js";
|
|
2
|
+
const ki = "#7c3aed", Lt = "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", Tt = "#2c2a1e", Gn = [253, 250, 241], qn = 3.5;
|
|
3
|
+
function Lo(e) {
|
|
4
|
+
const t = To(e);
|
|
5
|
+
if (jn(dt(t), Gn) >= qn)
|
|
6
6
|
return t;
|
|
7
7
|
let o = dt(t);
|
|
8
8
|
const i = dt(Tt);
|
|
9
9
|
for (let r = 0; r < 6; r += 1)
|
|
10
|
-
if (o =
|
|
11
|
-
return
|
|
12
|
-
return
|
|
10
|
+
if (o = Ai(o, i, 0.22), jn(o, Gn) >= qn)
|
|
11
|
+
return cn(o);
|
|
12
|
+
return cn(o);
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function Li() {
|
|
15
15
|
let n = "M 280 120", o = !1, i = 0;
|
|
16
16
|
for (let r = 150; r <= 1170; r += 62) {
|
|
17
|
-
const l = (i % 3 - 1) * 18,
|
|
18
|
-
n += ` L ${
|
|
17
|
+
const l = (i % 3 - 1) * 18, s = o ? 280 - l : 1020 + l;
|
|
18
|
+
n += ` L ${s} ${r}`, o = !o, i += 1;
|
|
19
19
|
}
|
|
20
20
|
return n;
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
const t =
|
|
22
|
+
function Ti(e) {
|
|
23
|
+
const t = To(e), n = un(dt(t));
|
|
24
24
|
return n > 0.86 ? {
|
|
25
25
|
top: "#ffffff",
|
|
26
26
|
middle: "#f6f6f6",
|
|
@@ -56,9 +56,9 @@ function Li(e) {
|
|
|
56
56
|
shadow: pe(t, -0.25, -0.08)
|
|
57
57
|
};
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function To(e) {
|
|
60
60
|
const t = e.trim();
|
|
61
|
-
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` :
|
|
61
|
+
return /^#[0-9a-f]{6}$/i.test(t) ? t.toLowerCase() : /^#[0-9a-f]{3}$/i.test(t) ? `#${t.slice(1).split("").map((n) => n + n).join("").toLowerCase()}` : ki;
|
|
62
62
|
}
|
|
63
63
|
function dt(e) {
|
|
64
64
|
return [
|
|
@@ -67,23 +67,23 @@ function dt(e) {
|
|
|
67
67
|
Number.parseInt(e.slice(5, 7), 16)
|
|
68
68
|
];
|
|
69
69
|
}
|
|
70
|
-
function
|
|
70
|
+
function cn([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 un([e, t, n]) {
|
|
75
75
|
const o = (i) => {
|
|
76
76
|
const r = i / 255;
|
|
77
77
|
return r <= 0.04045 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
78
78
|
};
|
|
79
79
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
80
80
|
}
|
|
81
|
-
function
|
|
82
|
-
const n =
|
|
81
|
+
function jn(e, t) {
|
|
82
|
+
const n = un(e), o = un(t), [i, r] = n > o ? [n, o] : [o, n];
|
|
83
83
|
return (i + 0.05) / (r + 0.05);
|
|
84
84
|
}
|
|
85
|
-
function
|
|
86
|
-
const o =
|
|
85
|
+
function Ai(e, t, n) {
|
|
86
|
+
const o = gn(n);
|
|
87
87
|
return [
|
|
88
88
|
e[0] + (t[0] - e[0]) * o,
|
|
89
89
|
e[1] + (t[1] - e[1]) * o,
|
|
@@ -91,17 +91,17 @@ function Ti(e, t, n) {
|
|
|
91
91
|
];
|
|
92
92
|
}
|
|
93
93
|
function pe(e, t, n) {
|
|
94
|
-
const [o, i, r] =
|
|
95
|
-
return
|
|
94
|
+
const [o, i, r] = Pi(dt(e));
|
|
95
|
+
return cn(Ii(o, gn(i + n), gn(r + t)));
|
|
96
96
|
}
|
|
97
|
-
function
|
|
98
|
-
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r),
|
|
99
|
-
if (l ===
|
|
100
|
-
return [0, 0,
|
|
101
|
-
const
|
|
102
|
-
return [(l === o ? (i - r) /
|
|
97
|
+
function Pi([e, t, n]) {
|
|
98
|
+
const o = e / 255, i = t / 255, r = n / 255, l = Math.max(o, i, r), s = Math.min(o, i, r), p = (l + s) / 2;
|
|
99
|
+
if (l === s)
|
|
100
|
+
return [0, 0, p];
|
|
101
|
+
const u = l - s, g = p > 0.5 ? u / (2 - l - s) : u / (l + s);
|
|
102
|
+
return [(l === o ? (i - r) / u + (i < r ? 6 : 0) : l === i ? (r - o) / u + 2 : (o - i) / u + 4) / 6, g, p];
|
|
103
103
|
}
|
|
104
|
-
function
|
|
104
|
+
function Ii(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;
|
|
@@ -115,19 +115,19 @@ function Jt(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 gn(e) {
|
|
119
119
|
return Math.max(0, Math.min(1, e));
|
|
120
120
|
}
|
|
121
|
-
const
|
|
122
|
-
function
|
|
121
|
+
const Ao = "suggest_share_on_socials";
|
|
122
|
+
function Ni(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 !== Ao)
|
|
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,
|
|
@@ -136,13 +136,13 @@ function Ii(e) {
|
|
|
136
136
|
}
|
|
137
137
|
return null;
|
|
138
138
|
}
|
|
139
|
-
async function
|
|
140
|
-
const t = await
|
|
139
|
+
async function Ri(e) {
|
|
140
|
+
const t = await Di(e);
|
|
141
141
|
if (!navigator.clipboard || typeof ClipboardItem > "u")
|
|
142
142
|
throw new Error("Image copy is not supported in this browser. Download the screenshot instead.");
|
|
143
143
|
await navigator.clipboard.write([new ClipboardItem({ [t.type || "image/png"]: t })]);
|
|
144
144
|
}
|
|
145
|
-
function
|
|
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())
|
|
@@ -150,50 +150,50 @@ function jn(e, t, n) {
|
|
|
150
150
|
}
|
|
151
151
|
return null;
|
|
152
152
|
}
|
|
153
|
-
async function
|
|
153
|
+
async function Di(e) {
|
|
154
154
|
return await (await fetch(e)).blob();
|
|
155
155
|
}
|
|
156
|
-
const
|
|
157
|
-
function
|
|
156
|
+
const zi = "https://app.pluno.ai", Mi = "/api/product-agent/embed/active-users", Oi = 1800, Ui = 15e3, Bi = 250, Fi = 1e3, Wi = 3e4;
|
|
157
|
+
function Hi(e, t = {}) {
|
|
158
158
|
let n = !1, o = null, i = null, r = null;
|
|
159
159
|
const l = () => {
|
|
160
160
|
r !== null && (window.clearInterval(r), r = null);
|
|
161
|
-
},
|
|
161
|
+
}, s = (g) => {
|
|
162
162
|
n || (i !== null && window.clearTimeout(i), i = window.setTimeout(() => {
|
|
163
|
-
|
|
164
|
-
},
|
|
165
|
-
},
|
|
163
|
+
u();
|
|
164
|
+
}, qi(g)));
|
|
165
|
+
}, p = (g) => {
|
|
166
166
|
if (l(), o === null) {
|
|
167
|
-
o =
|
|
167
|
+
o = g, e(g);
|
|
168
168
|
return;
|
|
169
169
|
}
|
|
170
|
-
const h = o,
|
|
170
|
+
const h = o, x = performance.now();
|
|
171
171
|
r = window.setInterval(() => {
|
|
172
172
|
if (n) {
|
|
173
173
|
l();
|
|
174
174
|
return;
|
|
175
175
|
}
|
|
176
|
-
const
|
|
177
|
-
o = Math.round(h + (
|
|
178
|
-
},
|
|
179
|
-
},
|
|
176
|
+
const v = Math.min(1, (performance.now() - x) / Oi);
|
|
177
|
+
o = Math.round(h + (g - h) * ji(v)), e(o), v >= 1 && (o = g, e(g), l());
|
|
178
|
+
}, Bi);
|
|
179
|
+
}, u = async () => {
|
|
180
180
|
try {
|
|
181
|
-
const
|
|
181
|
+
const g = await $i(t);
|
|
182
182
|
if (n)
|
|
183
183
|
return;
|
|
184
|
-
|
|
184
|
+
p(g.count), s(g.refreshAfterMs);
|
|
185
185
|
} catch {
|
|
186
|
-
|
|
186
|
+
s(Ui);
|
|
187
187
|
}
|
|
188
188
|
};
|
|
189
|
-
return
|
|
189
|
+
return u(), () => {
|
|
190
190
|
n = !0, i !== null && window.clearTimeout(i), l();
|
|
191
191
|
};
|
|
192
192
|
}
|
|
193
|
-
async function
|
|
193
|
+
async function $i(e) {
|
|
194
194
|
if (e.loader)
|
|
195
195
|
return e.loader();
|
|
196
|
-
const n = await (e.fetcher ?? fetch)(new URL(
|
|
196
|
+
const n = await (e.fetcher ?? fetch)(new URL(Mi, Gi(e.backendUrl ?? zi)).toString(), {
|
|
197
197
|
cache: "no-store",
|
|
198
198
|
credentials: "omit"
|
|
199
199
|
});
|
|
@@ -210,13 +210,13 @@ function Vn(e) {
|
|
|
210
210
|
function Gi(e) {
|
|
211
211
|
return e.endsWith("/") ? e : `${e}/`;
|
|
212
212
|
}
|
|
213
|
-
function $i(e) {
|
|
214
|
-
return Math.min(Fi, Math.max(Bi, e));
|
|
215
|
-
}
|
|
216
213
|
function qi(e) {
|
|
214
|
+
return Math.min(Wi, Math.max(Fi, e));
|
|
215
|
+
}
|
|
216
|
+
function ji(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 Ki = [
|
|
220
220
|
"a[href]",
|
|
221
221
|
"button",
|
|
222
222
|
"input",
|
|
@@ -241,26 +241,26 @@ const ji = [
|
|
|
241
241
|
".timeline-item"
|
|
242
242
|
].join(",");
|
|
243
243
|
function Vi(e, t, n) {
|
|
244
|
-
return e instanceof Element ?
|
|
244
|
+
return e instanceof Element ? Yi(
|
|
245
245
|
t,
|
|
246
246
|
n,
|
|
247
|
-
e.closest(
|
|
247
|
+
e.closest(Ki) !== null
|
|
248
248
|
) : !1;
|
|
249
249
|
}
|
|
250
|
-
function
|
|
250
|
+
function Yi(e, t, n) {
|
|
251
251
|
return e === 1 && !t && !n;
|
|
252
252
|
}
|
|
253
|
-
function
|
|
253
|
+
function Xi(e, t, n) {
|
|
254
254
|
return e instanceof Node && t !== null && !t.contains(e) && !n?.contains(e);
|
|
255
255
|
}
|
|
256
|
-
function
|
|
256
|
+
function Zi(e, t = !0) {
|
|
257
257
|
if (!e || !t || !e.isConnected || e.disabled || e.readOnly)
|
|
258
258
|
return !1;
|
|
259
259
|
const n = e.getRootNode();
|
|
260
260
|
return (n instanceof ShadowRoot ? n.activeElement : e.ownerDocument.activeElement) === e ? !1 : (e.focus({ preventScroll: !0 }), !0);
|
|
261
261
|
}
|
|
262
|
-
const
|
|
263
|
-
function
|
|
262
|
+
const Ji = /(`+)(?!`)[\s\S]*?\1(?!`)/g;
|
|
263
|
+
function Qi(e) {
|
|
264
264
|
let t = "", n = "", o = null;
|
|
265
265
|
for (const i of e.split(new RegExp("(?<=\\n)"))) {
|
|
266
266
|
if (o) {
|
|
@@ -271,7 +271,7 @@ function Ji(e) {
|
|
|
271
271
|
}
|
|
272
272
|
const r = i.match(/^[ \t]{0,3}(`{3,}|~{3,})/);
|
|
273
273
|
if (r) {
|
|
274
|
-
t +=
|
|
274
|
+
t += Yn(n) + i, n = "", o = {
|
|
275
275
|
marker: r[1][0],
|
|
276
276
|
length: r[1].length
|
|
277
277
|
};
|
|
@@ -279,31 +279,31 @@ function Ji(e) {
|
|
|
279
279
|
}
|
|
280
280
|
n += i;
|
|
281
281
|
}
|
|
282
|
-
return t +
|
|
282
|
+
return t + Yn(n);
|
|
283
283
|
}
|
|
284
|
-
function
|
|
284
|
+
function Yn(e) {
|
|
285
285
|
let t = "", n = 0;
|
|
286
|
-
for (const o of e.matchAll(
|
|
286
|
+
for (const o of e.matchAll(Ji)) {
|
|
287
287
|
const i = o.index ?? 0;
|
|
288
|
-
t +=
|
|
288
|
+
t += Xn(
|
|
289
289
|
e.slice(n, i)
|
|
290
290
|
), t += o[0], n = i + o[0].length;
|
|
291
291
|
}
|
|
292
|
-
return t +
|
|
292
|
+
return t + Xn(e.slice(n));
|
|
293
293
|
}
|
|
294
|
-
function
|
|
294
|
+
function Xn(e) {
|
|
295
295
|
return e.replace(
|
|
296
296
|
/\[([^\]\n]*\S[^\]\n]*)\][ \t]+\(([^)\s]+)\)/g,
|
|
297
|
-
(t, n, o, i, r) => r[i - 1] === "!" ||
|
|
297
|
+
(t, n, o, i, r) => r[i - 1] === "!" || ea(r, i) || ta(r, i, n) ? t : `[${n}](${o})`
|
|
298
298
|
);
|
|
299
299
|
}
|
|
300
|
-
function
|
|
300
|
+
function ea(e, t) {
|
|
301
301
|
let n = 0;
|
|
302
302
|
for (let o = t - 1; e[o] === "\\"; o -= 1)
|
|
303
303
|
n += 1;
|
|
304
304
|
return n % 2 === 1;
|
|
305
305
|
}
|
|
306
|
-
function
|
|
306
|
+
function ta(e, t, n) {
|
|
307
307
|
if (n !== "x" && n !== "X")
|
|
308
308
|
return !1;
|
|
309
309
|
const o = e.lastIndexOf(`
|
|
@@ -312,7 +312,7 @@ function ea(e, t, n) {
|
|
|
312
312
|
e.slice(o, t)
|
|
313
313
|
);
|
|
314
314
|
}
|
|
315
|
-
const
|
|
315
|
+
const Po = 100, na = 1e4, oa = 5e3, ia = "product-agent:sdk-preview-socket-connect", aa = "product-agent:sdk-preview-socket-send", ra = "product-agent:sdk-preview-socket-close", la = "product-agent:sdk-preview-socket-open", sa = "product-agent:sdk-preview-socket-message", pa = "product-agent:sdk-preview-socket-error", da = "product-agent:sdk-preview-socket-closed", Zn = "product-agent:sdk-preview-socket-id", ca = "data-pluno-sdk-preview-channel", Io = "data-pluno-auto-mounted", xe = "__plunoProductAgentAutoMountOwner", ua = 1e4, ga = "Failed to load Pluno widget token", Jn = "Timed out loading Pluno widget token", ha = "pluno.productAgent.widgetClientId.", Qt = /* @__PURE__ */ new Set(), ma = "product-agent:preview-diagnostic", No = "pluno.productAgent.sharePromptsDisabled", fa = 3, Qn = 'dialog[open], [aria-modal="true"], [role="dialog"]', wa = 400, ba = 5e3, _a = 500, eo = "Close the page's popup to chat", xa = "No recent chats for this page yet.", de = {
|
|
316
316
|
launcherLabel: "Ask for anything...",
|
|
317
317
|
accentColor: "#7c3aed",
|
|
318
318
|
colorScheme: "light",
|
|
@@ -320,7 +320,7 @@ const Ao = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-conne
|
|
|
320
320
|
scribbleStyle: !0,
|
|
321
321
|
position: "bottom-right",
|
|
322
322
|
movableLauncher: !0
|
|
323
|
-
},
|
|
323
|
+
}, ya = '"Architects Daughter", "Bradley Hand", "Chalkboard SE", "Comic Sans MS", "Comic Sans", "Segoe Print", cursive', to = "pluno-pa-scribble-font", Ro = 190, Do = 41, no = 22, va = 1, Ca = 48, Cn = 420, Sa = 520, Ea = 0.24, Sn = 680, ka = 800, La = 0.76, R = 8, Ue = 50, zo = "http://www.w3.org/2000/svg", hn = 26, mn = 8, Ta = 36, fn = 16, Aa = 4, oo = [
|
|
324
324
|
{
|
|
325
325
|
ellipseCx: "17.5",
|
|
326
326
|
ellipseCy: "24.5",
|
|
@@ -357,12 +357,12 @@ const Ao = 100, ta = 1e4, na = 5e3, oa = "product-agent:sdk-preview-socket-conne
|
|
|
357
357
|
path: "M18.7 26.8 C21 11.2, 7.1 1.6, 6.3 18.1",
|
|
358
358
|
pathStrokeWidth: "2.45"
|
|
359
359
|
}
|
|
360
|
-
],
|
|
361
|
-
let
|
|
362
|
-
function
|
|
360
|
+
], Pa = 11, Ia = 13, wn = 4, Mo = 10, Oo = 40, Na = "movable-launcher-position-v2", Uo = "pluno-pa-widget-styles", Bo = "data-pluno-pa-widget-styles";
|
|
361
|
+
let io = 0;
|
|
362
|
+
function Ra(e) {
|
|
363
363
|
return (t) => new ye(t, e);
|
|
364
364
|
}
|
|
365
|
-
async function
|
|
365
|
+
async function Da(e = {}) {
|
|
366
366
|
const t = {
|
|
367
367
|
layout: e.layout ?? "floating",
|
|
368
368
|
mountTarget: e.mountTarget,
|
|
@@ -434,51 +434,51 @@ async function Ra(e = {}) {
|
|
|
434
434
|
);
|
|
435
435
|
const n = document.createElement("div");
|
|
436
436
|
n.className = "pluno-pa-widget-host", n.setAttribute("data-pluno-product-agent-ui", "widget"), n.setAttribute("data-pluno-product-agent-layout", t.layout), t.sdkPreviewChannelId && n.setAttribute(
|
|
437
|
-
|
|
437
|
+
ca,
|
|
438
438
|
t.sdkPreviewChannelId
|
|
439
439
|
);
|
|
440
440
|
const o = n.attachShadow({ mode: "open" }), i = document.createElement("div");
|
|
441
441
|
i.className = `pluno-pa-widget pluno-pa-widget--${t.position}`, i.classList.add(`pluno-pa-widget--layout-${t.layout}`), i.setAttribute("data-pluno-product-agent-ui-root", "widget");
|
|
442
|
-
let r =
|
|
442
|
+
let r = ao(
|
|
443
443
|
t.accentColor,
|
|
444
444
|
t.scribbleStyle
|
|
445
445
|
);
|
|
446
|
-
|
|
446
|
+
or(
|
|
447
447
|
i,
|
|
448
448
|
t.launcherLabel,
|
|
449
449
|
r,
|
|
450
450
|
t.movableLauncher,
|
|
451
451
|
t.showLauncherMinimizeButton
|
|
452
452
|
), o.appendChild(i);
|
|
453
|
-
const l =
|
|
454
|
-
|
|
455
|
-
let
|
|
456
|
-
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"),
|
|
453
|
+
const l = pl(t), s = t.layout === "floating" ? t.initialDisplayState ?? ll(t) : "shown";
|
|
454
|
+
Co(t, s);
|
|
455
|
+
let p = t.movableLauncher ? l.launcherPosition : null, u = p !== null, g = l.panelSize, h = null;
|
|
456
|
+
i.classList.add(`pluno-pa-widget--${t.colorScheme}`), t.scribbleStyle && i.classList.add("pluno-pa-widget--scribble"), s === "minimized" && (i.classList.add("pluno-pa-widget--minimized"), Oe(
|
|
457
457
|
i,
|
|
458
458
|
tn(
|
|
459
459
|
i,
|
|
460
|
-
|
|
460
|
+
p,
|
|
461
461
|
t.position
|
|
462
462
|
)
|
|
463
|
-
)),
|
|
463
|
+
)), vo(o, t.accentColor), ro(i, r, {
|
|
464
464
|
accentColor: t.accentColor,
|
|
465
465
|
colorScheme: t.colorScheme,
|
|
466
466
|
fontFamily: t.fontFamily,
|
|
467
467
|
scribbleStyle: t.scribbleStyle
|
|
468
468
|
});
|
|
469
|
-
const
|
|
469
|
+
const x = t.mountTarget ?? await rl(), v = x.ownerDocument, L = i.querySelector(
|
|
470
470
|
".pluno-pa-widget__launcher"
|
|
471
|
-
),
|
|
471
|
+
), D = i.querySelector(
|
|
472
472
|
".pluno-pa-widget__launcher-drag-handle"
|
|
473
473
|
), c = i.querySelector(
|
|
474
474
|
".pluno-pa-widget__launcher-input"
|
|
475
|
-
),
|
|
475
|
+
), E = i.querySelector(
|
|
476
476
|
".pluno-pa-widget__launcher-minimize"
|
|
477
|
-
), m = i.querySelector(".pluno-pa-widget__panel"),
|
|
477
|
+
), m = i.querySelector(".pluno-pa-widget__panel"), z = i.querySelector(
|
|
478
478
|
".pluno-pa-widget__scribble-spirals--panel"
|
|
479
|
-
),
|
|
479
|
+
), O = Array.from(
|
|
480
480
|
i.querySelectorAll(".pluno-pa-widget__resize-handle")
|
|
481
|
-
),
|
|
481
|
+
), P = i.querySelector(
|
|
482
482
|
".pluno-pa-widget__close"
|
|
483
483
|
), ne = i.querySelector(
|
|
484
484
|
".pluno-pa-widget__composer"
|
|
@@ -486,43 +486,43 @@ async function Ra(e = {}) {
|
|
|
486
486
|
".pluno-pa-widget__attachment-error"
|
|
487
487
|
), Xe = i.querySelector(
|
|
488
488
|
".pluno-pa-widget__billing-status"
|
|
489
|
-
),
|
|
489
|
+
), Be = i.querySelector(
|
|
490
490
|
".pluno-pa-widget__attachments"
|
|
491
491
|
), ge = i.querySelector(
|
|
492
492
|
".pluno-pa-widget__attachment-input"
|
|
493
493
|
), B = i.querySelector(
|
|
494
494
|
".pluno-pa-widget__attach"
|
|
495
|
-
),
|
|
495
|
+
), y = i.querySelector(
|
|
496
496
|
".pluno-pa-widget__input"
|
|
497
497
|
), F = i.querySelector(
|
|
498
498
|
".pluno-pa-widget__send"
|
|
499
|
-
),
|
|
499
|
+
), G = i.querySelector(
|
|
500
500
|
".pluno-pa-widget__top-actions"
|
|
501
501
|
), Z = i.querySelector(
|
|
502
502
|
".pluno-pa-widget__history"
|
|
503
|
-
),
|
|
503
|
+
), Te = i.querySelector(
|
|
504
504
|
".pluno-pa-widget__history-panel"
|
|
505
|
-
),
|
|
505
|
+
), V = i.querySelector(
|
|
506
506
|
".pluno-pa-widget__history-list"
|
|
507
507
|
), ut = i.querySelector(
|
|
508
508
|
".pluno-pa-widget__history-close"
|
|
509
|
-
),
|
|
509
|
+
), Ae = i.querySelector(
|
|
510
510
|
".pluno-pa-widget__history-status"
|
|
511
511
|
), he = i.querySelector(
|
|
512
512
|
".pluno-pa-widget__timeline-jump"
|
|
513
513
|
), me = i.querySelector(
|
|
514
514
|
".pluno-pa-widget__active-users-counter"
|
|
515
|
-
),
|
|
515
|
+
), M = i.querySelector(
|
|
516
516
|
".pluno-pa-widget__timeline"
|
|
517
517
|
), Ze = i.querySelector(
|
|
518
518
|
".pluno-pa-widget__timeline-bottom-sentinel"
|
|
519
|
-
), Ae = i.querySelector(
|
|
520
|
-
".pluno-pa-widget__notify-suggestion"
|
|
521
519
|
), Pe = i.querySelector(
|
|
520
|
+
".pluno-pa-widget__notify-suggestion"
|
|
521
|
+
), Ie = i.querySelector(
|
|
522
522
|
".pluno-pa-widget__notify-suggestion-enable"
|
|
523
|
-
),
|
|
523
|
+
), C = i.querySelector(
|
|
524
524
|
".pluno-pa-widget__notify-suggestion-later"
|
|
525
|
-
),
|
|
525
|
+
), T = i.querySelector(
|
|
526
526
|
".pluno-pa-widget__notify-suggestion-never"
|
|
527
527
|
), I = i.querySelector(
|
|
528
528
|
".pluno-pa-widget__tab-groups-suggestion"
|
|
@@ -531,34 +531,34 @@ async function Ra(e = {}) {
|
|
|
531
531
|
), oe = i.querySelector(
|
|
532
532
|
".pluno-pa-widget__tab-groups-suggestion-dismiss"
|
|
533
533
|
);
|
|
534
|
-
if (!
|
|
534
|
+
if (!L || !c || !m || !P || !ne || !W || !Xe || !Be || !ge || !B || !y || !F || !G || !Z || !Te || !V || !ut || !Ae || !he || !me || !M || !Ze)
|
|
535
535
|
throw new Error("Failed to mount Pluno widget");
|
|
536
|
-
if (t.movableLauncher && !
|
|
536
|
+
if (t.movableLauncher && !D)
|
|
537
537
|
throw new Error("Failed to mount Pluno widget drag handle");
|
|
538
|
-
B.hidden = !t.attachmentsEnabled, ge.disabled = !t.attachmentsEnabled,
|
|
539
|
-
let
|
|
540
|
-
const q = () =>
|
|
541
|
-
|
|
538
|
+
B.hidden = !t.attachmentsEnabled, ge.disabled = !t.attachmentsEnabled, ho(c), ho(y);
|
|
539
|
+
let w = [], k = null;
|
|
540
|
+
const q = () => Zi(
|
|
541
|
+
y,
|
|
542
542
|
i.classList.contains("pluno-pa-widget--open") && !t.loginRequired && !t.signupRequired && !se(t.billingStatus)
|
|
543
|
-
),
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
543
|
+
), Fe = () => {
|
|
544
|
+
Cr(
|
|
545
|
+
Be,
|
|
546
|
+
w,
|
|
547
547
|
(a) => {
|
|
548
|
-
|
|
549
|
-
(d,
|
|
550
|
-
),
|
|
548
|
+
w = w.filter(
|
|
549
|
+
(d, f) => f !== a
|
|
550
|
+
), Fe(), U(b.getState()), j(), q();
|
|
551
551
|
}
|
|
552
552
|
);
|
|
553
|
-
},
|
|
554
|
-
if (!t.loginRequired && !t.signupRequired && !t.token && !
|
|
553
|
+
}, Tn = t.loginRequired || t.signupRequired || t.token || t.webSocketFactory ? void 0 : t.tokenProvider ?? (t.tokenEndpoint ? async () => ii(t.tokenEndpoint) : void 0);
|
|
554
|
+
if (!t.loginRequired && !t.signupRequired && !t.token && !Tn && !t.webSocketFactory)
|
|
555
555
|
throw new Error("Pluno widget requires token or tokenEndpoint");
|
|
556
|
-
const
|
|
556
|
+
const ri = window.fetch.bind(window), Nt = sl(t.clientId);
|
|
557
557
|
let b;
|
|
558
558
|
try {
|
|
559
559
|
const a = {
|
|
560
560
|
token: t.token,
|
|
561
|
-
tokenProvider:
|
|
561
|
+
tokenProvider: Tn,
|
|
562
562
|
backendUrl: t.backendUrl,
|
|
563
563
|
metadata: () => ({
|
|
564
564
|
...t.metadata ?? {},
|
|
@@ -580,7 +580,7 @@ async function Ra(e = {}) {
|
|
|
580
580
|
} catch (a) {
|
|
581
581
|
throw Nt.release(), n.remove(), a;
|
|
582
582
|
}
|
|
583
|
-
|
|
583
|
+
x.appendChild(n), J(
|
|
584
584
|
"web-sdk.widget",
|
|
585
585
|
"Applied initial widget appearance",
|
|
586
586
|
{
|
|
@@ -590,54 +590,54 @@ async function Ra(e = {}) {
|
|
|
590
590
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
591
591
|
}
|
|
592
592
|
);
|
|
593
|
-
const Rt = new Set(l.openToolGroupKeys),
|
|
593
|
+
const Rt = new Set(l.openToolGroupKeys), We = new Set(
|
|
594
594
|
l.seenShareCandidateIds
|
|
595
|
-
), gt = new Set(
|
|
596
|
-
let Dt = l.sharePromptsDisabled || await
|
|
595
|
+
), gt = new Set(We);
|
|
596
|
+
let Dt = l.sharePromptsDisabled || await dl(t), ie = null, Y = !1, ht = !(t.loginRequired || t.signupRequired), Ce = !1, Ne = {
|
|
597
597
|
enabled: !0
|
|
598
|
-
},
|
|
598
|
+
}, Re = 0, An = "", X = !1, fe = !1, Se = [], zt = null, Je = null;
|
|
599
599
|
const ae = (a, d) => {
|
|
600
|
-
|
|
600
|
+
Ne = { enabled: a, reason: d };
|
|
601
601
|
}, re = () => {
|
|
602
602
|
he.hidden = !0;
|
|
603
|
-
},
|
|
603
|
+
}, li = () => {
|
|
604
604
|
he.hidden = !1;
|
|
605
|
-
},
|
|
606
|
-
ae(!0, a), re(), pt(
|
|
605
|
+
}, si = (a = "jump") => {
|
|
606
|
+
ae(!0, a), re(), pt(M, () => Ne.enabled), Re = M.scrollTop;
|
|
607
607
|
}, we = () => {
|
|
608
|
-
if (Z.hidden = t.layout === "page" || t.loginRequired,
|
|
608
|
+
if (Z.hidden = t.layout === "page" || t.loginRequired, Te.hidden = !X, Z.setAttribute("aria-expanded", String(X)), V.classList.toggle(
|
|
609
609
|
"pluno-pa-widget__history-list--center",
|
|
610
|
-
fe &&
|
|
611
|
-
),
|
|
610
|
+
fe && Se.length === 0
|
|
611
|
+
), V.replaceChildren(), fe && Se.length === 0) {
|
|
612
612
|
const a = document.createElement("p");
|
|
613
|
-
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...",
|
|
613
|
+
a.className = "pluno-pa-widget__history-loading", a.textContent = "Loading...", V.appendChild(a);
|
|
614
614
|
}
|
|
615
|
-
for (const a of
|
|
615
|
+
for (const a of Se) {
|
|
616
616
|
const d = document.createElement("button");
|
|
617
617
|
d.type = "button", d.className = "pluno-pa-widget__history-item", d.disabled = fe;
|
|
618
|
-
const
|
|
619
|
-
|
|
620
|
-
const
|
|
621
|
-
|
|
618
|
+
const f = document.createElement("span");
|
|
619
|
+
f.className = "pluno-pa-widget__history-item-title", f.textContent = er(a);
|
|
620
|
+
const S = document.createElement("time");
|
|
621
|
+
S.className = "pluno-pa-widget__history-time", S.dateTime = a.lastActiveAt, S.textContent = nr(
|
|
622
622
|
a.lastActiveAt,
|
|
623
623
|
Date.now()
|
|
624
624
|
);
|
|
625
625
|
const N = document.createElement("small");
|
|
626
|
-
N.className = "pluno-pa-widget__history-path", N.textContent =
|
|
627
|
-
X = !1, Je = null, we(), ae(!0, "newSession"), re(), b.loadSession(a.id),
|
|
628
|
-
}),
|
|
626
|
+
N.className = "pluno-pa-widget__history-path", N.textContent = tr(a), d.append(f, S, N), d.addEventListener("click", () => {
|
|
627
|
+
X = !1, Je = null, we(), ae(!0, "newSession"), re(), b.loadSession(a.id), U(b.getState()), q();
|
|
628
|
+
}), V.appendChild(d);
|
|
629
629
|
}
|
|
630
|
-
if (fe &&
|
|
630
|
+
if (fe && Se.length > 0) {
|
|
631
631
|
const a = document.createElement("p");
|
|
632
|
-
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...",
|
|
632
|
+
a.className = "pluno-pa-widget__history-loading pluno-pa-widget__history-loading--inline", a.textContent = "Loading...", V.appendChild(a);
|
|
633
633
|
}
|
|
634
|
-
|
|
635
|
-
},
|
|
634
|
+
Ae.textContent = Je ?? (!fe && Se.length === 0 ? "No recent chats for this page yet." : ""), Ae.hidden = Ae.textContent.length === 0;
|
|
635
|
+
}, Pn = async (a) => {
|
|
636
636
|
if (!fe) {
|
|
637
637
|
fe = !0, Je = null, we();
|
|
638
638
|
try {
|
|
639
639
|
const d = await b.listSessions({ cursor: a, limit: 20 });
|
|
640
|
-
|
|
640
|
+
Se = a ? [...Se, ...d.sessions] : d.sessions, zt = d.nextCursor;
|
|
641
641
|
} catch (d) {
|
|
642
642
|
J(
|
|
643
643
|
"web-sdk.widget",
|
|
@@ -645,69 +645,69 @@ async function Ra(e = {}) {
|
|
|
645
645
|
{
|
|
646
646
|
message: d instanceof Error ? d.message : String(d)
|
|
647
647
|
}
|
|
648
|
-
), Je =
|
|
648
|
+
), Je = xa;
|
|
649
649
|
} finally {
|
|
650
650
|
fe = !1, we();
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
},
|
|
654
|
-
!zt || fe ||
|
|
655
|
-
},
|
|
656
|
-
Y || typeof document > "u" || (
|
|
657
|
-
},
|
|
658
|
-
|
|
653
|
+
}, pi = () => {
|
|
654
|
+
!zt || fe || V.scrollHeight - V.scrollTop - V.clientHeight <= 24 && Pn(zt);
|
|
655
|
+
}, In = () => {
|
|
656
|
+
Y || typeof document > "u" || (vo(o, t.accentColor), n.isConnected || (t.mountTarget?.isConnected ? t.mountTarget.appendChild(n) : t.mountTarget || v.body?.appendChild(n)));
|
|
657
|
+
}, Nn = new MutationObserver(In);
|
|
658
|
+
Nn.observe(v.documentElement, {
|
|
659
659
|
childList: !0,
|
|
660
660
|
subtree: !0
|
|
661
|
-
}),
|
|
661
|
+
}), In();
|
|
662
662
|
const Qe = (a = !0) => {
|
|
663
663
|
const d = At(i, a);
|
|
664
|
-
return
|
|
664
|
+
return bn(
|
|
665
665
|
i,
|
|
666
|
-
|
|
666
|
+
p ? Fo(p, d) : Ha(
|
|
667
667
|
i,
|
|
668
668
|
t.position,
|
|
669
669
|
d
|
|
670
670
|
),
|
|
671
671
|
d
|
|
672
672
|
);
|
|
673
|
-
},
|
|
674
|
-
const a =
|
|
673
|
+
}, $ = () => {
|
|
674
|
+
const a = Ya(
|
|
675
675
|
o,
|
|
676
676
|
c,
|
|
677
|
-
|
|
677
|
+
y
|
|
678
678
|
);
|
|
679
|
-
|
|
679
|
+
ul(t, {
|
|
680
680
|
isOpen: i.classList.contains("pluno-pa-widget--open"),
|
|
681
|
-
composerValue:
|
|
681
|
+
composerValue: y.value,
|
|
682
682
|
focusedInput: a,
|
|
683
683
|
focusedInputAt: a ? Date.now() : null,
|
|
684
684
|
openToolGroupKeys: [...Rt],
|
|
685
|
-
launcherPosition:
|
|
686
|
-
panelSize:
|
|
687
|
-
seenShareCandidateIds: [...
|
|
688
|
-
-
|
|
685
|
+
launcherPosition: u ? p : null,
|
|
686
|
+
panelSize: g,
|
|
687
|
+
seenShareCandidateIds: [...We].slice(
|
|
688
|
+
-Po
|
|
689
689
|
),
|
|
690
690
|
sharePromptsDisabled: Dt
|
|
691
691
|
});
|
|
692
692
|
}, mt = (a) => {
|
|
693
693
|
t.onDisplayStateChange?.(a);
|
|
694
694
|
}, et = (a, d = !0) => {
|
|
695
|
-
if (
|
|
696
|
-
i.classList.remove("pluno-pa-widget--minimized"),
|
|
695
|
+
if (Co(t, a), a === "shown") {
|
|
696
|
+
i.classList.remove("pluno-pa-widget--minimized"), L.removeAttribute("tabindex"), !i.classList.contains("pluno-pa-widget--open") && !i.classList.contains("pluno-pa-widget--closing") && tt(!1), d && mt("shown");
|
|
697
697
|
return;
|
|
698
698
|
}
|
|
699
|
-
ie !== null && (window.clearTimeout(ie), ie = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"),
|
|
699
|
+
ie !== null && (window.clearTimeout(ie), ie = null), i.classList.remove("pluno-pa-widget--open"), i.classList.remove("pluno-pa-widget--closing"), i.classList.add("pluno-pa-widget--minimized"), L.hidden = !1, m.hidden = !0, P.hidden = !0, L.tabIndex = 0, y.value = "", Oe(
|
|
700
700
|
i,
|
|
701
701
|
tn(
|
|
702
702
|
i,
|
|
703
|
-
|
|
703
|
+
p,
|
|
704
704
|
t.position
|
|
705
705
|
)
|
|
706
|
-
),
|
|
707
|
-
},
|
|
706
|
+
), co(i), $(), d && mt("minimized");
|
|
707
|
+
}, De = (a, d = {}) => {
|
|
708
708
|
Va(a, {
|
|
709
|
-
debugVersion:
|
|
710
|
-
launcherPosition:
|
|
709
|
+
debugVersion: Na,
|
|
710
|
+
launcherPosition: p,
|
|
711
711
|
rootClasses: i.className,
|
|
712
712
|
rootStyle: {
|
|
713
713
|
left: i.style.left,
|
|
@@ -716,39 +716,39 @@ async function Ra(e = {}) {
|
|
|
716
716
|
bottom: i.style.bottom
|
|
717
717
|
},
|
|
718
718
|
rootRect: on(i),
|
|
719
|
-
launcherRect: on(
|
|
719
|
+
launcherRect: on(L),
|
|
720
720
|
panelRect: on(m),
|
|
721
721
|
viewport: te(),
|
|
722
722
|
panelHidden: m.hidden,
|
|
723
|
-
closeHidden:
|
|
723
|
+
closeHidden: P.hidden,
|
|
724
724
|
...d
|
|
725
725
|
});
|
|
726
726
|
}, tt = (a = !0) => {
|
|
727
|
-
if (!
|
|
728
|
-
return
|
|
727
|
+
if (!p)
|
|
728
|
+
return Oe(i, null), Qe(a);
|
|
729
729
|
const d = Qe(a);
|
|
730
|
-
return
|
|
730
|
+
return Oe(i, d), De("Applied stored closed launcher position", {
|
|
731
731
|
visibleLauncherPosition: d
|
|
732
732
|
}), d;
|
|
733
733
|
}, Mt = (a, d) => {
|
|
734
734
|
if (!a || !d) {
|
|
735
|
-
|
|
735
|
+
co(i);
|
|
736
736
|
return;
|
|
737
737
|
}
|
|
738
|
-
|
|
738
|
+
Ka(i, {
|
|
739
739
|
x: a.x - d.x,
|
|
740
740
|
y: a.y - d.y
|
|
741
741
|
});
|
|
742
742
|
}, Ot = () => {
|
|
743
|
-
const a = st(
|
|
743
|
+
const a = st(g).width;
|
|
744
744
|
return t.layout === "page" && m.getBoundingClientRect().width || a;
|
|
745
|
-
},
|
|
745
|
+
}, Rn = () => {
|
|
746
746
|
if (i.classList.contains("pluno-pa-widget--minimized")) {
|
|
747
|
-
|
|
747
|
+
Oe(
|
|
748
748
|
i,
|
|
749
749
|
tn(
|
|
750
750
|
i,
|
|
751
|
-
|
|
751
|
+
p,
|
|
752
752
|
t.position
|
|
753
753
|
)
|
|
754
754
|
);
|
|
@@ -756,95 +756,95 @@ async function Ra(e = {}) {
|
|
|
756
756
|
}
|
|
757
757
|
const a = tt();
|
|
758
758
|
if (i.classList.contains("pluno-pa-widget--open") || i.classList.contains("pluno-pa-widget--closing")) {
|
|
759
|
-
en(i,
|
|
760
|
-
const d = st(
|
|
759
|
+
en(i, g);
|
|
760
|
+
const d = st(g);
|
|
761
761
|
rn(
|
|
762
|
-
|
|
762
|
+
z,
|
|
763
763
|
Ot()
|
|
764
764
|
);
|
|
765
|
-
const
|
|
765
|
+
const f = kt(
|
|
766
766
|
h ?? nn(
|
|
767
767
|
i,
|
|
768
768
|
a,
|
|
769
769
|
t.position,
|
|
770
|
-
|
|
770
|
+
g
|
|
771
771
|
),
|
|
772
772
|
d
|
|
773
773
|
);
|
|
774
|
-
h && (h =
|
|
774
|
+
h && (h = f), Mt(f, a), De(
|
|
775
775
|
"Applied open panel position after viewport resize",
|
|
776
|
-
{ openPanelPosition:
|
|
776
|
+
{ openPanelPosition: f }
|
|
777
777
|
);
|
|
778
|
-
} else
|
|
778
|
+
} else p && De(
|
|
779
779
|
"Applied visible launcher position after viewport resize",
|
|
780
780
|
{ visibleLauncherPosition: a }
|
|
781
781
|
);
|
|
782
782
|
};
|
|
783
|
-
let
|
|
783
|
+
let Dn = () => {
|
|
784
784
|
};
|
|
785
|
-
window.addEventListener("resize",
|
|
785
|
+
window.addEventListener("resize", Rn), t.movableLauncher && D ? (tt(), Dn = Ba({
|
|
786
786
|
root: i,
|
|
787
|
-
launcher:
|
|
788
|
-
launcherDragHandle:
|
|
787
|
+
launcher: L,
|
|
788
|
+
launcherDragHandle: D,
|
|
789
789
|
getPosition: () => Qe(),
|
|
790
790
|
setPosition: (a) => {
|
|
791
|
-
const d = a,
|
|
791
|
+
const d = a, f = At(i), S = bn(
|
|
792
792
|
i,
|
|
793
793
|
a,
|
|
794
|
-
|
|
794
|
+
f
|
|
795
795
|
);
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
),
|
|
796
|
+
p = Ga(
|
|
797
|
+
S,
|
|
798
|
+
f
|
|
799
|
+
), Oe(i, S), De("Dragging closed launcher", {
|
|
800
800
|
requestedPosition: d
|
|
801
801
|
});
|
|
802
802
|
},
|
|
803
803
|
persist: () => {
|
|
804
|
-
|
|
804
|
+
u = !0, $(), De("Persisted closed launcher drag position");
|
|
805
805
|
}
|
|
806
|
-
})) :
|
|
807
|
-
const
|
|
808
|
-
const a = st(
|
|
806
|
+
})) : Oe(i, null), en(i, g);
|
|
807
|
+
const di = () => {
|
|
808
|
+
const a = st(g), d = Qe();
|
|
809
809
|
return {
|
|
810
810
|
position: kt(
|
|
811
811
|
h ?? nn(
|
|
812
812
|
i,
|
|
813
813
|
d,
|
|
814
814
|
t.position,
|
|
815
|
-
|
|
815
|
+
g
|
|
816
816
|
),
|
|
817
817
|
a
|
|
818
818
|
),
|
|
819
819
|
size: a
|
|
820
820
|
};
|
|
821
|
-
},
|
|
822
|
-
|
|
823
|
-
|
|
821
|
+
}, ci = (a) => {
|
|
822
|
+
g = Pt(a.size), en(i, g), rn(
|
|
823
|
+
z,
|
|
824
824
|
Ot()
|
|
825
825
|
), h = kt(
|
|
826
826
|
a.position,
|
|
827
|
-
st(
|
|
827
|
+
st(g)
|
|
828
828
|
);
|
|
829
829
|
const d = Qe();
|
|
830
830
|
Mt(h, d);
|
|
831
|
-
},
|
|
831
|
+
}, ui = O.length > 0 ? Fa({
|
|
832
832
|
root: i,
|
|
833
|
-
handles:
|
|
834
|
-
getBounds:
|
|
835
|
-
setBounds:
|
|
836
|
-
persist:
|
|
833
|
+
handles: O,
|
|
834
|
+
getBounds: di,
|
|
835
|
+
setBounds: ci,
|
|
836
|
+
persist: $
|
|
837
837
|
}) : () => {
|
|
838
838
|
};
|
|
839
839
|
let Ut = !1;
|
|
840
|
-
const
|
|
840
|
+
const zn = async () => {
|
|
841
841
|
if (!(!t.billingStatusLoader || Ut)) {
|
|
842
842
|
Ut = !0;
|
|
843
843
|
try {
|
|
844
844
|
const a = await t.billingStatusLoader();
|
|
845
845
|
if (Y)
|
|
846
846
|
return;
|
|
847
|
-
|
|
847
|
+
fo(
|
|
848
848
|
t.billingStatus,
|
|
849
849
|
a,
|
|
850
850
|
b.getState().lastErrorCode
|
|
@@ -863,40 +863,40 @@ async function Ra(e = {}) {
|
|
|
863
863
|
Ut = !1;
|
|
864
864
|
}
|
|
865
865
|
}
|
|
866
|
-
}, be = (a = "", d = !0,
|
|
867
|
-
|
|
868
|
-
|
|
866
|
+
}, be = (a = "", d = !0, f = !0) => {
|
|
867
|
+
zn(), ot && (ot = !1, Wt()), i.classList.contains("pluno-pa-widget--open") || (h = null), ie !== null && (window.clearTimeout(ie), ie = null), et("shown", !1), m.hidden = !1, P.hidden = !1, rn(
|
|
868
|
+
z,
|
|
869
869
|
Ot()
|
|
870
870
|
), i.classList.remove("pluno-pa-widget--closing");
|
|
871
|
-
const
|
|
871
|
+
const S = tt(), N = nn(
|
|
872
872
|
i,
|
|
873
|
-
|
|
873
|
+
S,
|
|
874
874
|
t.position,
|
|
875
|
-
|
|
875
|
+
g
|
|
876
876
|
);
|
|
877
|
-
if (Mt(N,
|
|
877
|
+
if (Mt(N, S), De("Opening launcher at clamped open panel position", {
|
|
878
878
|
openPanelPosition: N,
|
|
879
|
-
visibleLauncherPosition:
|
|
879
|
+
visibleLauncherPosition: S
|
|
880
880
|
}), ae(!0, "open"), re(), !d) {
|
|
881
|
-
i.classList.add("pluno-pa-widget--open"),
|
|
881
|
+
i.classList.add("pluno-pa-widget--open"), L.hidden = !0, a && (y.value = a, lt(y)), pt(M, () => Ne.enabled), Re = M.scrollTop, f && (y.focus(), y.setSelectionRange(y.value.length, y.value.length)), $(), mt("shown"), t.onPanelOpenChange?.(!0);
|
|
882
882
|
return;
|
|
883
883
|
}
|
|
884
884
|
window.requestAnimationFrame(() => {
|
|
885
|
-
i.classList.add("pluno-pa-widget--open"), a && (
|
|
886
|
-
|
|
885
|
+
i.classList.add("pluno-pa-widget--open"), a && (y.value = a, lt(y)), pt(M, () => Ne.enabled), Re = M.scrollTop, f && (y.focus(), y.setSelectionRange(y.value.length, y.value.length)), $(), mt("shown"), t.onPanelOpenChange?.(!0), ie = window.setTimeout(() => {
|
|
886
|
+
L.hidden = !0, pt(M, () => Ne.enabled), Re = M.scrollTop;
|
|
887
887
|
}, 220);
|
|
888
888
|
});
|
|
889
889
|
}, Bt = () => {
|
|
890
|
-
ie !== null && (window.clearTimeout(ie), ie = null),
|
|
891
|
-
m.hidden = !0,
|
|
890
|
+
ie !== null && (window.clearTimeout(ie), ie = null), L.hidden = !1, p && (tt(!1), De("Closing launcher at stored position")), i.classList.remove("pluno-pa-widget--open"), i.classList.add("pluno-pa-widget--closing"), $(), t.onPanelOpenChange?.(!1), ie = window.setTimeout(() => {
|
|
891
|
+
m.hidden = !0, P.hidden = !0, h = null, i.classList.remove("pluno-pa-widget--closing");
|
|
892
892
|
}, 220);
|
|
893
893
|
};
|
|
894
|
-
|
|
894
|
+
L.addEventListener("submit", (a) => {
|
|
895
895
|
a.preventDefault(), be(c.value), c.value = "";
|
|
896
|
-
}),
|
|
896
|
+
}), D?.addEventListener("click", (a) => {
|
|
897
897
|
a.preventDefault(), a.stopPropagation();
|
|
898
|
-
}),
|
|
899
|
-
a.target === c && !
|
|
898
|
+
}), L.addEventListener("click", (a) => {
|
|
899
|
+
a.target === c && !D || (be(c.value), c.value = "");
|
|
900
900
|
}), c.addEventListener("focus", () => {
|
|
901
901
|
be(c.value), c.value = "";
|
|
902
902
|
}), c.addEventListener("input", () => {
|
|
@@ -905,21 +905,21 @@ async function Ra(e = {}) {
|
|
|
905
905
|
const a = c.value;
|
|
906
906
|
be(a), c.value = "";
|
|
907
907
|
});
|
|
908
|
-
let Ft = null, ft = null,
|
|
909
|
-
const
|
|
908
|
+
let Ft = null, ft = null, ze = null;
|
|
909
|
+
const Mn = (a) => a === c || a === y, gi = (a) => {
|
|
910
910
|
if (!(a instanceof Element) || a.getRootNode() === i.getRootNode())
|
|
911
911
|
return null;
|
|
912
912
|
let d = a;
|
|
913
913
|
for (; d; ) {
|
|
914
|
-
const
|
|
915
|
-
if (
|
|
916
|
-
return
|
|
917
|
-
const
|
|
918
|
-
d =
|
|
914
|
+
const f = d.closest(Qn);
|
|
915
|
+
if (f)
|
|
916
|
+
return f;
|
|
917
|
+
const S = d.getRootNode();
|
|
918
|
+
d = S instanceof ShadowRoot ? S.host : null;
|
|
919
919
|
}
|
|
920
920
|
return null;
|
|
921
|
-
},
|
|
922
|
-
if (!a.isConnected || !a.matches(
|
|
921
|
+
}, hi = (a) => {
|
|
922
|
+
if (!a.isConnected || !a.matches(Qn))
|
|
923
923
|
return !1;
|
|
924
924
|
if (!(a instanceof HTMLElement))
|
|
925
925
|
return !0;
|
|
@@ -929,76 +929,76 @@ async function Ra(e = {}) {
|
|
|
929
929
|
return a.checkVisibility();
|
|
930
930
|
const d = window.getComputedStyle(a);
|
|
931
931
|
return d.display !== "none" && d.visibility !== "hidden";
|
|
932
|
-
},
|
|
933
|
-
|
|
932
|
+
}, On = (a) => {
|
|
933
|
+
He !== a && (He = a, i.classList.toggle(
|
|
934
934
|
"pluno-pa-widget--host-modal-conflict",
|
|
935
935
|
a !== null
|
|
936
|
-
),
|
|
937
|
-
const d =
|
|
938
|
-
(!d || !
|
|
939
|
-
},
|
|
940
|
-
},
|
|
941
|
-
|
|
936
|
+
), Me(), a !== null ? ze = window.setInterval(() => {
|
|
937
|
+
const d = He;
|
|
938
|
+
(!d || !hi(d)) && On(null);
|
|
939
|
+
}, _a) : ze !== null && (window.clearInterval(ze), ze = null, ft = null));
|
|
940
|
+
}, mi = () => {
|
|
941
|
+
ze !== null && (window.clearInterval(ze), ze = null);
|
|
942
942
|
};
|
|
943
943
|
i.addEventListener("focusin", (a) => {
|
|
944
|
-
|
|
944
|
+
Mn(a.target) && (Ft = Date.now(), $());
|
|
945
945
|
}), i.addEventListener("focusout", (a) => {
|
|
946
|
-
if (!
|
|
946
|
+
if (!Mn(a.target) || He !== null)
|
|
947
947
|
return;
|
|
948
948
|
const d = Ft;
|
|
949
|
-
if (Ft = null, d === null || Date.now() - d >
|
|
949
|
+
if (Ft = null, d === null || Date.now() - d > wa)
|
|
950
950
|
return;
|
|
951
|
-
const
|
|
952
|
-
if (!
|
|
951
|
+
const f = gi(a.relatedTarget);
|
|
952
|
+
if (!f)
|
|
953
953
|
return;
|
|
954
|
-
const
|
|
955
|
-
if (ft !== null &&
|
|
956
|
-
|
|
954
|
+
const S = Date.now();
|
|
955
|
+
if (ft !== null && S - ft <= ba) {
|
|
956
|
+
On(f);
|
|
957
957
|
return;
|
|
958
958
|
}
|
|
959
|
-
ft =
|
|
960
|
-
}),
|
|
959
|
+
ft = S;
|
|
960
|
+
}), L.addEventListener("keydown", (a) => {
|
|
961
961
|
!i.classList.contains("pluno-pa-widget--minimized") || a.key !== "Enter" && a.key !== " " || (a.preventDefault(), be());
|
|
962
|
-
}),
|
|
962
|
+
}), E?.addEventListener("pointerdown", (a) => {
|
|
963
963
|
a.stopPropagation();
|
|
964
|
-
}),
|
|
964
|
+
}), E?.addEventListener("click", (a) => {
|
|
965
965
|
a.preventDefault(), a.stopPropagation(), et("minimized");
|
|
966
|
-
}),
|
|
967
|
-
|
|
966
|
+
}), P.addEventListener("click", Bt), M.addEventListener("scroll", () => {
|
|
967
|
+
M.scrollTop < Re - 1 && ae(!1, "userScroll"), Re = M.scrollTop;
|
|
968
968
|
}), he.addEventListener("click", () => {
|
|
969
|
-
|
|
969
|
+
si();
|
|
970
970
|
});
|
|
971
|
-
const
|
|
971
|
+
const Un = typeof IntersectionObserver > "u" ? null : new IntersectionObserver(
|
|
972
972
|
([a]) => {
|
|
973
973
|
a?.isIntersecting && (ae(!0, "bottom"), re());
|
|
974
974
|
},
|
|
975
|
-
{ root:
|
|
975
|
+
{ root: M, threshold: 0 }
|
|
976
976
|
);
|
|
977
|
-
|
|
977
|
+
Un?.observe(Ze);
|
|
978
978
|
const nt = () => t.loginRequired || t.signupRequired;
|
|
979
|
-
let
|
|
980
|
-
const le = () => ht || b.getState().status !== "connected",
|
|
981
|
-
const a = nt(), d =
|
|
982
|
-
c.readOnly = !1,
|
|
979
|
+
let He = null, ot = !1;
|
|
980
|
+
const le = () => ht || b.getState().status !== "connected", Me = () => {
|
|
981
|
+
const a = nt(), d = He !== null;
|
|
982
|
+
c.readOnly = !1, y.readOnly = !1, c.placeholder = d ? eo : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : ot ? "New update" : t.launcherLabel, y.placeholder = d ? eo : a ? t.signupRequired ? t.signupButtonLabel : t.loginButtonLabel : de.launcherLabel, ne.hidden = a;
|
|
983
983
|
}, j = () => {
|
|
984
|
-
F.disabled = le() || se(t.billingStatus) || !b.getState().isThinking &&
|
|
984
|
+
F.disabled = le() || se(t.billingStatus) || !b.getState().isThinking && y.value.trim().length === 0 && w.length === 0, B.disabled = nt() || le() || se(t.billingStatus);
|
|
985
985
|
};
|
|
986
|
-
|
|
986
|
+
Me();
|
|
987
987
|
const Wt = () => {
|
|
988
988
|
const a = b.getState().isThinking;
|
|
989
989
|
i.classList.toggle("pluno-pa-widget--thinking", a), i.classList.toggle(
|
|
990
990
|
"pluno-pa-widget--unread",
|
|
991
991
|
!a && ot
|
|
992
|
-
),
|
|
992
|
+
), Me();
|
|
993
993
|
};
|
|
994
994
|
Wt();
|
|
995
995
|
const Ht = () => {
|
|
996
|
-
nt() || Y || (ht = !0,
|
|
996
|
+
nt() || Y || (ht = !0, Me(), j(), b.connect().then(
|
|
997
997
|
() => {
|
|
998
|
-
Y || (ht = !1,
|
|
998
|
+
Y || (ht = !1, Me(), j());
|
|
999
999
|
},
|
|
1000
1000
|
(a) => {
|
|
1001
|
-
Y || (ht = !1,
|
|
1001
|
+
Y || (ht = !1, Me(), j(), J(
|
|
1002
1002
|
"web-sdk.widget",
|
|
1003
1003
|
"Failed to connect Product Agent widget",
|
|
1004
1004
|
{
|
|
@@ -1017,69 +1017,69 @@ async function Ra(e = {}) {
|
|
|
1017
1017
|
t.onSignupClick?.();
|
|
1018
1018
|
return;
|
|
1019
1019
|
}
|
|
1020
|
-
le() || se(t.billingStatus) || (
|
|
1020
|
+
le() || se(t.billingStatus) || (Ce = !0, ae(!0, "send"), re(), w = an(
|
|
1021
1021
|
b,
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
),
|
|
1022
|
+
y,
|
|
1023
|
+
w,
|
|
1024
|
+
Ct
|
|
1025
|
+
), Fe(), j());
|
|
1026
1026
|
});
|
|
1027
1027
|
let it = 0;
|
|
1028
|
-
const
|
|
1028
|
+
const fi = () => {
|
|
1029
1029
|
it = 0, i.classList.remove("pluno-pa-widget--drag-over");
|
|
1030
|
-
},
|
|
1031
|
-
|
|
1032
|
-
W.textContent = "", W.hidden = !0,
|
|
1030
|
+
}, $t = (a) => {
|
|
1031
|
+
k !== null && window.clearTimeout(k), W.textContent = a, W.hidden = !1, k = window.setTimeout(() => {
|
|
1032
|
+
W.textContent = "", W.hidden = !0, k = null;
|
|
1033
1033
|
}, 3e3);
|
|
1034
|
-
},
|
|
1035
|
-
|
|
1036
|
-
},
|
|
1034
|
+
}, wi = () => {
|
|
1035
|
+
k !== null && (window.clearTimeout(k), k = null), W.textContent = "", W.hidden = !0;
|
|
1036
|
+
}, Gt = async (a) => {
|
|
1037
1037
|
if (!t.attachmentsEnabled || a.length === 0)
|
|
1038
1038
|
return;
|
|
1039
|
-
const d =
|
|
1040
|
-
if (
|
|
1039
|
+
const d = kr(b, a);
|
|
1040
|
+
if (w = [...w, ...d], Fe(), wi(), j(), U(b.getState()), !i.classList.contains("pluno-pa-widget--open")) {
|
|
1041
1041
|
be();
|
|
1042
1042
|
return;
|
|
1043
1043
|
}
|
|
1044
1044
|
q();
|
|
1045
|
-
},
|
|
1046
|
-
await
|
|
1045
|
+
}, bi = async (a) => {
|
|
1046
|
+
await Gt(a), !(a.length === 0 || He !== null) && y.focus();
|
|
1047
1047
|
};
|
|
1048
1048
|
B.addEventListener("click", () => {
|
|
1049
1049
|
t.loginRequired || le() || se(t.billingStatus) || ge.click();
|
|
1050
1050
|
}), ge.addEventListener("change", () => {
|
|
1051
1051
|
const a = Array.from(ge.files ?? []);
|
|
1052
|
-
ge.value = "",
|
|
1053
|
-
|
|
1052
|
+
ge.value = "", bi(a).catch((d) => {
|
|
1053
|
+
$t(
|
|
1054
1054
|
d instanceof Error ? d.message : "Failed to attach file"
|
|
1055
1055
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1056
1056
|
message: d instanceof Error ? d.message : String(d)
|
|
1057
1057
|
});
|
|
1058
1058
|
});
|
|
1059
1059
|
}), i.addEventListener("dragenter", (a) => {
|
|
1060
|
-
!t.attachmentsEnabled || !
|
|
1060
|
+
!t.attachmentsEnabled || !St(a.dataTransfer) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), it += 1, i.classList.add("pluno-pa-widget--drag-over"));
|
|
1061
1061
|
}), i.addEventListener("dragover", (a) => {
|
|
1062
1062
|
const d = a.dataTransfer;
|
|
1063
|
-
!t.attachmentsEnabled || !
|
|
1063
|
+
!t.attachmentsEnabled || !St(d) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), d.dropEffect = "copy");
|
|
1064
1064
|
}), i.addEventListener("dragleave", (a) => {
|
|
1065
|
-
|
|
1065
|
+
St(a.dataTransfer) && (a.stopPropagation(), it = Math.max(0, it - 1), it === 0 && i.classList.remove("pluno-pa-widget--drag-over"));
|
|
1066
1066
|
}), i.addEventListener("drop", (a) => {
|
|
1067
1067
|
const d = a.dataTransfer;
|
|
1068
|
-
!t.attachmentsEnabled || !
|
|
1069
|
-
|
|
1070
|
-
|
|
1068
|
+
!t.attachmentsEnabled || !St(d) || t.loginRequired || le() || (a.preventDefault(), a.stopPropagation(), fi(), Gt(d.files).catch((f) => {
|
|
1069
|
+
$t(
|
|
1070
|
+
f instanceof Error ? f.message : "Failed to attach file"
|
|
1071
1071
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1072
|
-
message:
|
|
1072
|
+
message: f instanceof Error ? f.message : String(f)
|
|
1073
1073
|
});
|
|
1074
1074
|
}));
|
|
1075
1075
|
}), i.addEventListener("paste", (a) => {
|
|
1076
1076
|
a.stopPropagation();
|
|
1077
|
-
const d = a.clipboardData,
|
|
1078
|
-
!t.attachmentsEnabled ||
|
|
1079
|
-
|
|
1080
|
-
|
|
1077
|
+
const d = a.clipboardData, f = Array.from(d?.files ?? []);
|
|
1078
|
+
!t.attachmentsEnabled || f.length === 0 || t.loginRequired || le() || (a.preventDefault(), Gt(f).catch((S) => {
|
|
1079
|
+
$t(
|
|
1080
|
+
S instanceof Error ? S.message : "Failed to attach file"
|
|
1081
1081
|
), J("web-sdk.widget", "Attachment failed", {
|
|
1082
|
-
message:
|
|
1082
|
+
message: S instanceof Error ? S.message : String(S)
|
|
1083
1083
|
});
|
|
1084
1084
|
}));
|
|
1085
1085
|
}), F.addEventListener("click", () => {
|
|
@@ -1093,36 +1093,36 @@ async function Ra(e = {}) {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
if (le())
|
|
1095
1095
|
return;
|
|
1096
|
-
const a =
|
|
1097
|
-
|
|
1096
|
+
const a = y.value.trim().length > 0 || w.length > 0;
|
|
1097
|
+
Ce = !0, ae(!0, "send"), re(), w = an(
|
|
1098
1098
|
b,
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
),
|
|
1099
|
+
y,
|
|
1100
|
+
w,
|
|
1101
|
+
Ct
|
|
1102
|
+
), Fe(), j(), U(b.getState()), a && q();
|
|
1103
1103
|
}), Z.addEventListener("click", () => {
|
|
1104
|
-
X = !X, Je = null, we(), X &&
|
|
1104
|
+
X = !X, Je = null, we(), X && Se.length === 0 && Pn(null), X || q();
|
|
1105
1105
|
}), ut.addEventListener("click", () => {
|
|
1106
1106
|
X = !1, we(), q();
|
|
1107
|
-
}),
|
|
1108
|
-
lt(
|
|
1109
|
-
}),
|
|
1107
|
+
}), V.addEventListener("scroll", pi), y.addEventListener("input", () => {
|
|
1108
|
+
lt(y), $(), j(), yi();
|
|
1109
|
+
}), y.addEventListener("keydown", (a) => {
|
|
1110
1110
|
if (!(a.key !== "Enter" || a.shiftKey)) {
|
|
1111
1111
|
if (a.preventDefault(), t.loginRequired) {
|
|
1112
1112
|
t.onLoginClick?.();
|
|
1113
1113
|
return;
|
|
1114
1114
|
}
|
|
1115
|
-
le() || (
|
|
1115
|
+
le() || (Ce = !0, ae(!0, "send"), re(), w = an(
|
|
1116
1116
|
b,
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
),
|
|
1117
|
+
y,
|
|
1118
|
+
w,
|
|
1119
|
+
Ct
|
|
1120
|
+
), Fe(), j(), U(b.getState()));
|
|
1121
1121
|
}
|
|
1122
1122
|
}), i.addEventListener("click", (a) => {
|
|
1123
1123
|
const d = a.target instanceof Element ? a.target : null;
|
|
1124
|
-
d?.closest("a[href]") &&
|
|
1125
|
-
const
|
|
1124
|
+
d?.closest("a[href]") && $(), X && Xi(d, Te, Z) && (X = !1, we());
|
|
1125
|
+
const S = window.getSelection(), N = !!(S && !S.isCollapsed && S.anchorNode && i.contains(S.anchorNode));
|
|
1126
1126
|
Vi(a.target, a.detail, N) && q();
|
|
1127
1127
|
}), i.addEventListener("copy", (a) => {
|
|
1128
1128
|
a.clipboardData && window.getSelection() && !window.getSelection()?.isCollapsed && window.getSelection()?.anchorNode && window.getSelection()?.focusNode && i.contains(window.getSelection()?.anchorNode ?? null) && i.contains(window.getSelection()?.focusNode ?? null) && window.getSelection()?.toString() && (a.clipboardData.clearData(), a.clipboardData.setData(
|
|
@@ -1142,17 +1142,17 @@ async function Ra(e = {}) {
|
|
|
1142
1142
|
return;
|
|
1143
1143
|
}
|
|
1144
1144
|
a.key !== "Escape" || !X || (X = !1, we(), q());
|
|
1145
|
-
}), l.composerValue && (
|
|
1145
|
+
}), l.composerValue && (y.value = l.composerValue, lt(y)), t.layout === "page" ? be(y.value, !1) : s === "minimized" ? et("minimized", !1) : t.initialDisplayState === void 0 && l.isOpen && be(y.value, !1, !1), Xa(l, i, c, y);
|
|
1146
1146
|
const wt = () => r;
|
|
1147
|
-
let qt = b.getState().appearance !== null, bt = null, at = null,
|
|
1147
|
+
let qt = b.getState().appearance !== null, bt = null, at = null, $e = null, Bn = b.getState().isThinking, Ge = null;
|
|
1148
1148
|
const rt = t.taskNotifications;
|
|
1149
|
-
let
|
|
1150
|
-
const
|
|
1151
|
-
|
|
1149
|
+
let qe = null, je = !1;
|
|
1150
|
+
const Fn = () => {
|
|
1151
|
+
qe !== null && (window.clearTimeout(qe), qe = null);
|
|
1152
1152
|
}, _t = () => {
|
|
1153
|
-
|
|
1154
|
-
},
|
|
1155
|
-
if (!rt || !
|
|
1153
|
+
Pe && (Pe.hidden = !0);
|
|
1154
|
+
}, Wn = () => b.getState().assistantDraft.trim().length > 0, _i = async () => {
|
|
1155
|
+
if (!rt || !Pe || je || Y || !b.getState().isThinking || Wn())
|
|
1156
1156
|
return;
|
|
1157
1157
|
let a;
|
|
1158
1158
|
try {
|
|
@@ -1160,46 +1160,46 @@ async function Ra(e = {}) {
|
|
|
1160
1160
|
} catch {
|
|
1161
1161
|
return;
|
|
1162
1162
|
}
|
|
1163
|
-
a.enabled || a.neverSuggest || !b.getState().isThinking ||
|
|
1163
|
+
a.enabled || a.neverSuggest || !b.getState().isThinking || Wn() || je || Y || (Pe.hidden = !1);
|
|
1164
1164
|
};
|
|
1165
|
-
|
|
1166
|
-
|
|
1165
|
+
Ie?.addEventListener("click", () => {
|
|
1166
|
+
je = !0, _t(), rt?.enable().catch(() => {
|
|
1167
1167
|
});
|
|
1168
|
-
}),
|
|
1169
|
-
|
|
1170
|
-
}),
|
|
1171
|
-
|
|
1168
|
+
}), C?.addEventListener("click", () => {
|
|
1169
|
+
je = !0, _t();
|
|
1170
|
+
}), T?.addEventListener("click", () => {
|
|
1171
|
+
je = !0, _t(), rt?.dismissForever().catch(() => {
|
|
1172
1172
|
});
|
|
1173
1173
|
});
|
|
1174
1174
|
const xt = t.tabGroups;
|
|
1175
|
-
let
|
|
1175
|
+
let Ke = !1;
|
|
1176
1176
|
const yt = async () => {
|
|
1177
|
-
if (!xt || !I ||
|
|
1177
|
+
if (!xt || !I || Ke || Y)
|
|
1178
1178
|
return;
|
|
1179
1179
|
const a = await xt.getState().catch(() => null);
|
|
1180
|
-
!a ||
|
|
1180
|
+
!a || Ke || Y || (I.hidden = !a.permissionNeeded);
|
|
1181
1181
|
};
|
|
1182
1182
|
ve?.addEventListener("click", () => {
|
|
1183
|
-
|
|
1183
|
+
Ke = !0, I && (I.hidden = !0), xt?.enable().catch(() => {
|
|
1184
1184
|
}).finally(() => {
|
|
1185
|
-
|
|
1185
|
+
Ke = !1, yt();
|
|
1186
1186
|
});
|
|
1187
1187
|
}), oe?.addEventListener("click", () => {
|
|
1188
|
-
|
|
1188
|
+
Ke = !0, I && (I.hidden = !0), xt?.dismiss().catch(() => {
|
|
1189
1189
|
}).finally(() => {
|
|
1190
|
-
|
|
1190
|
+
Ke = !1, yt();
|
|
1191
1191
|
});
|
|
1192
1192
|
}), yt();
|
|
1193
|
-
let Ve = null,
|
|
1193
|
+
let Ve = null, Hn = () => {
|
|
1194
1194
|
};
|
|
1195
|
-
const
|
|
1196
|
-
const a = Ve !== null && pn(b.getState(),
|
|
1197
|
-
me.hidden = !a, a && Ve !== null &&
|
|
1195
|
+
const xi = !!t.socialPostDraftHandler, jt = /* @__PURE__ */ new Map(), Kt = () => y.value.trim().length > 0 || w.length > 0, yi = () => {
|
|
1196
|
+
const a = Ve !== null && pn(b.getState(), Kt());
|
|
1197
|
+
me.hidden = !a, a && Ve !== null && Ho(me, Ve);
|
|
1198
1198
|
};
|
|
1199
|
-
let
|
|
1200
|
-
const _e = /* @__PURE__ */ new Map(), vt = /* @__PURE__ */ new Set(),
|
|
1199
|
+
let Ye = null;
|
|
1200
|
+
const _e = /* @__PURE__ */ new Map(), vt = /* @__PURE__ */ new Set(), vi = async (a) => {
|
|
1201
1201
|
if (t.integrationAuthHandler) {
|
|
1202
|
-
_e.set(a.authRequestId, { status: "connecting" }),
|
|
1202
|
+
_e.set(a.authRequestId, { status: "connecting" }), U(b.getState());
|
|
1203
1203
|
try {
|
|
1204
1204
|
await t.integrationAuthHandler(a), _e.set(a.authRequestId, { status: "completed" });
|
|
1205
1205
|
} catch (d) {
|
|
@@ -1208,31 +1208,31 @@ async function Ra(e = {}) {
|
|
|
1208
1208
|
error: d instanceof Error ? d.message : `Could not connect ${a.appName}.`
|
|
1209
1209
|
});
|
|
1210
1210
|
}
|
|
1211
|
-
|
|
1211
|
+
U(b.getState());
|
|
1212
1212
|
}
|
|
1213
|
-
},
|
|
1214
|
-
|
|
1215
|
-
},
|
|
1216
|
-
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(),
|
|
1213
|
+
}, Vt = (a = {}) => {
|
|
1214
|
+
Ce = !0, ae(!0, "newSession"), re(), X = !1, we(), b.startNewSession(a), Rt.clear(), _e.clear(), vt.clear(), y.value = "", w = [], Fe(), lt(y), $(), j(), y.focus(), U(b.getState());
|
|
1215
|
+
}, Ct = () => {
|
|
1216
|
+
t.morningReport !== null && (t.morningReport = null, t.onMorningReportTaskStart?.(), Vt());
|
|
1217
1217
|
}, Yt = (a) => {
|
|
1218
1218
|
if (!a || t.layout === "page") {
|
|
1219
|
-
|
|
1219
|
+
Ye?.remove(), Ye = null;
|
|
1220
1220
|
return;
|
|
1221
1221
|
}
|
|
1222
|
-
|
|
1222
|
+
Ye || (Ye = It(
|
|
1223
1223
|
"pluno-pa-widget__new-chat",
|
|
1224
1224
|
"New chat",
|
|
1225
|
-
|
|
1225
|
+
mr(),
|
|
1226
1226
|
!1
|
|
1227
|
-
),
|
|
1228
|
-
},
|
|
1229
|
-
if (we(),
|
|
1227
|
+
), Ye.addEventListener("click", () => Vt()), G.insertBefore(Ye, Z));
|
|
1228
|
+
}, U = (a) => {
|
|
1229
|
+
if (we(), kn(a.lastErrorCode) ? Ge = a.lastErrorCode : t.billingStatus?.creditsUsed !== null && !se(t.billingStatus) && (Ge = null), sn(
|
|
1230
1230
|
Xe,
|
|
1231
1231
|
t.billingStatus,
|
|
1232
1232
|
Ge
|
|
1233
1233
|
), t.loginRequired) {
|
|
1234
|
-
jt.clear(),
|
|
1235
|
-
|
|
1234
|
+
jt.clear(), xo(
|
|
1235
|
+
M,
|
|
1236
1236
|
F,
|
|
1237
1237
|
Yt,
|
|
1238
1238
|
wt,
|
|
@@ -1244,8 +1244,8 @@ async function Ra(e = {}) {
|
|
|
1244
1244
|
return;
|
|
1245
1245
|
}
|
|
1246
1246
|
if (t.signupRequired) {
|
|
1247
|
-
jt.clear(),
|
|
1248
|
-
|
|
1247
|
+
jt.clear(), xo(
|
|
1248
|
+
M,
|
|
1249
1249
|
F,
|
|
1250
1250
|
Yt,
|
|
1251
1251
|
wt,
|
|
@@ -1256,33 +1256,33 @@ async function Ra(e = {}) {
|
|
|
1256
1256
|
);
|
|
1257
1257
|
return;
|
|
1258
1258
|
}
|
|
1259
|
-
const d =
|
|
1260
|
-
|
|
1261
|
-
const
|
|
1262
|
-
|
|
1263
|
-
|
|
1259
|
+
const d = Ja(a), f = d !== An;
|
|
1260
|
+
An = d;
|
|
1261
|
+
const S = Ce || Ne.enabled;
|
|
1262
|
+
Ce = !1, Rr(
|
|
1263
|
+
M,
|
|
1264
1264
|
Ze,
|
|
1265
1265
|
F,
|
|
1266
1266
|
Yt,
|
|
1267
1267
|
me,
|
|
1268
1268
|
a,
|
|
1269
1269
|
Ve,
|
|
1270
|
-
Ve !== null && pn(a,
|
|
1271
|
-
|
|
1272
|
-
() =>
|
|
1270
|
+
Ve !== null && pn(a, Kt()),
|
|
1271
|
+
S,
|
|
1272
|
+
() => Ne.enabled,
|
|
1273
1273
|
Rt,
|
|
1274
1274
|
jt,
|
|
1275
|
-
|
|
1275
|
+
$,
|
|
1276
1276
|
wt,
|
|
1277
1277
|
(N) => {
|
|
1278
|
-
le() || (
|
|
1278
|
+
le() || (Ct(), Ce = !0, ae(!0, "send"), re(), b.sendMessage(N));
|
|
1279
1279
|
},
|
|
1280
1280
|
() => {
|
|
1281
|
-
|
|
1281
|
+
Ce = !0, ae(!0, "send"), re(), b.retryLastMessage();
|
|
1282
1282
|
},
|
|
1283
1283
|
t.morningReport,
|
|
1284
1284
|
() => {
|
|
1285
|
-
t.morningReport = null, t.onMorningReportSnooze?.(), Bt(),
|
|
1285
|
+
t.morningReport = null, t.onMorningReportSnooze?.(), Bt(), U(b.getState());
|
|
1286
1286
|
},
|
|
1287
1287
|
Ht,
|
|
1288
1288
|
t.attachmentPreviewUrlResolver,
|
|
@@ -1290,71 +1290,71 @@ async function Ra(e = {}) {
|
|
|
1290
1290
|
states: _e,
|
|
1291
1291
|
initialStatus: t.integrationAuthStatusLoader ? "checking" : "pending",
|
|
1292
1292
|
onConnect: (N) => {
|
|
1293
|
-
|
|
1293
|
+
vi(N);
|
|
1294
1294
|
}
|
|
1295
1295
|
} : void 0,
|
|
1296
|
-
|
|
1296
|
+
xi && !Dt ? {
|
|
1297
1297
|
dismissedCandidateIds: gt,
|
|
1298
1298
|
draftingCandidate: bt,
|
|
1299
1299
|
error: at,
|
|
1300
1300
|
characterIconOptions: wt(),
|
|
1301
1301
|
onSeen: (N) => {
|
|
1302
|
-
|
|
1302
|
+
We.add(N.id), $();
|
|
1303
1303
|
},
|
|
1304
1304
|
onDraft: (N) => {
|
|
1305
|
-
|
|
1305
|
+
Ci(N);
|
|
1306
1306
|
},
|
|
1307
1307
|
onDismiss: (N) => {
|
|
1308
|
-
|
|
1308
|
+
We.add(N.id), gt.add(N.id), $(), at = null, U(b.getState());
|
|
1309
1309
|
},
|
|
1310
1310
|
onDisable: (N) => {
|
|
1311
|
-
Dt = !0,
|
|
1311
|
+
Dt = !0, We.add(N.id), gt.add(N.id), $(), cl(t, !0), at = null, U(b.getState());
|
|
1312
1312
|
}
|
|
1313
1313
|
} : void 0
|
|
1314
|
-
),
|
|
1315
|
-
},
|
|
1314
|
+
), S ? (Re = M.scrollTop, re()) : f && Qa(a) && li();
|
|
1315
|
+
}, $n = async (a) => {
|
|
1316
1316
|
if (!t.integrationAuthStatusLoader)
|
|
1317
1317
|
return;
|
|
1318
|
-
const d = a.messages.map((
|
|
1319
|
-
(
|
|
1318
|
+
const d = a.messages.map((f) => f.integrationAuthRequest).filter(
|
|
1319
|
+
(f) => !!f
|
|
1320
1320
|
);
|
|
1321
1321
|
await Promise.all(
|
|
1322
|
-
d.map(async (
|
|
1323
|
-
if (!(_e.has(
|
|
1324
|
-
vt.add(
|
|
1322
|
+
d.map(async (f) => {
|
|
1323
|
+
if (!(_e.has(f.authRequestId) || vt.has(f.authRequestId))) {
|
|
1324
|
+
vt.add(f.authRequestId), _e.set(f.authRequestId, {
|
|
1325
1325
|
status: "checking"
|
|
1326
|
-
}),
|
|
1326
|
+
}), U(b.getState());
|
|
1327
1327
|
try {
|
|
1328
|
-
const
|
|
1329
|
-
_e.set(
|
|
1330
|
-
} catch (
|
|
1331
|
-
_e.set(
|
|
1328
|
+
const S = await t.integrationAuthStatusLoader(f);
|
|
1329
|
+
_e.set(f.authRequestId, { status: S });
|
|
1330
|
+
} catch (S) {
|
|
1331
|
+
_e.set(f.authRequestId, {
|
|
1332
1332
|
status: "error",
|
|
1333
|
-
error:
|
|
1333
|
+
error: S instanceof Error ? S.message : `Could not load ${f.appName} connection status.`
|
|
1334
1334
|
});
|
|
1335
1335
|
} finally {
|
|
1336
|
-
vt.delete(
|
|
1336
|
+
vt.delete(f.authRequestId);
|
|
1337
1337
|
}
|
|
1338
|
-
Y ||
|
|
1338
|
+
Y || U(b.getState());
|
|
1339
1339
|
}
|
|
1340
1340
|
})
|
|
1341
1341
|
);
|
|
1342
1342
|
};
|
|
1343
|
-
return
|
|
1343
|
+
return Hn = Hi(
|
|
1344
1344
|
(a) => {
|
|
1345
|
-
Ve = a, !Y && pn(b.getState(),
|
|
1345
|
+
Ve = a, !Y && pn(b.getState(), Kt()) && U(b.getState());
|
|
1346
1346
|
},
|
|
1347
1347
|
{
|
|
1348
1348
|
backendUrl: t.backendUrl,
|
|
1349
|
-
fetcher:
|
|
1349
|
+
fetcher: ri,
|
|
1350
1350
|
loader: t.activeUsersLoader
|
|
1351
1351
|
}
|
|
1352
1352
|
), b.on("state", (a) => {
|
|
1353
1353
|
yt();
|
|
1354
|
-
const d =
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
},
|
|
1354
|
+
const d = Bn && !a.isThinking;
|
|
1355
|
+
Bn = a.isThinking, a.isThinking && !a.assistantDraft.trim() && rt && !je && qe === null && Pe?.hidden !== !1 && (qe = window.setTimeout(() => {
|
|
1356
|
+
qe = null, _i();
|
|
1357
|
+
}, na)), (!a.isThinking || a.assistantDraft.trim()) && (Fn(), _t()), d && !i.classList.contains("pluno-pa-widget--open") && (ot = !0), Wt(), a.appearance ? (qt = !0, J(
|
|
1358
1358
|
"web-sdk.widget",
|
|
1359
1359
|
"Agent state supplied appearance",
|
|
1360
1360
|
{
|
|
@@ -1368,17 +1368,17 @@ async function Ra(e = {}) {
|
|
|
1368
1368
|
fallbackColorScheme: t.colorScheme,
|
|
1369
1369
|
fallbackFontFamily: t.fontFamily
|
|
1370
1370
|
}
|
|
1371
|
-
), Xt({}, "agent.state.appearance-cleared")),
|
|
1372
|
-
}),
|
|
1371
|
+
), Xt({}, "agent.state.appearance-cleared")), U(a), $n(a), j(), d && zn();
|
|
1372
|
+
}), U(b.getState()), $n(b.getState()), j(), Ht(), {
|
|
1373
1373
|
agent: b,
|
|
1374
|
-
startNewChat:
|
|
1374
|
+
startNewChat: Vt,
|
|
1375
1375
|
host: n,
|
|
1376
1376
|
updateAppearance: (a) => {
|
|
1377
1377
|
a.scribbleStyle !== void 0 && (t.scribbleStyle = a.scribbleStyle), Xt(a, "widgetHandle.updateAppearance");
|
|
1378
1378
|
},
|
|
1379
1379
|
updateBillingStatus: (a) => {
|
|
1380
1380
|
const d = a ?? null;
|
|
1381
|
-
|
|
1381
|
+
fo(
|
|
1382
1382
|
t.billingStatus,
|
|
1383
1383
|
d,
|
|
1384
1384
|
Ge
|
|
@@ -1390,10 +1390,11 @@ async function Ra(e = {}) {
|
|
|
1390
1390
|
},
|
|
1391
1391
|
updateAuthGate: (a) => {
|
|
1392
1392
|
const d = nt();
|
|
1393
|
-
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),
|
|
1393
|
+
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), Me(), U(b.getState()), j(), d && !nt() && Ht();
|
|
1394
1394
|
},
|
|
1395
1395
|
openPanel: (a) => {
|
|
1396
|
-
|
|
1396
|
+
const d = typeof a == "string" ? a : y.value, f = typeof a == "object" ? a.focusComposer !== !1 : !0;
|
|
1397
|
+
be(d, !1, f);
|
|
1397
1398
|
},
|
|
1398
1399
|
closePanel: Bt,
|
|
1399
1400
|
updateDisplayState: (a) => {
|
|
@@ -1404,63 +1405,63 @@ async function Ra(e = {}) {
|
|
|
1404
1405
|
et("minimized", !1);
|
|
1405
1406
|
},
|
|
1406
1407
|
updateMorningReport: (a) => {
|
|
1407
|
-
t.morningReport = a ?? null,
|
|
1408
|
+
t.morningReport = a ?? null, U(b.getState());
|
|
1408
1409
|
},
|
|
1409
1410
|
destroy: () => {
|
|
1410
|
-
Y || (
|
|
1411
|
+
Y || ($(), Y = !0, Nn.disconnect(), Un?.disconnect(), mi(), window.removeEventListener("resize", Rn), Dn(), ui(), k !== null && window.clearTimeout(k), Fn(), Hn(), $e?.remove(), b.destroy(), Nt.release(), n.remove());
|
|
1411
1412
|
}
|
|
1412
1413
|
};
|
|
1413
|
-
async function
|
|
1414
|
+
async function Ci(a) {
|
|
1414
1415
|
if (!bt) {
|
|
1415
|
-
bt = a, at = null,
|
|
1416
|
+
bt = a, at = null, U(b.getState());
|
|
1416
1417
|
try {
|
|
1417
1418
|
if (!t.socialPostDraftHandler)
|
|
1418
1419
|
throw new Error("Social post drafting is not available here.");
|
|
1419
1420
|
const d = await t.socialPostDraftHandler(a);
|
|
1420
1421
|
if (!d.linkedinPost || !d.xPost)
|
|
1421
1422
|
throw new Error("Pluno did not return a complete social post draft.");
|
|
1422
|
-
|
|
1423
|
+
We.add(a.id), gt.add(a.id), $(), $e?.remove(), $e = jr(d, {
|
|
1423
1424
|
socialPostRewardsUrl: t.socialPostRewardsUrl,
|
|
1424
1425
|
onClose: () => {
|
|
1425
|
-
|
|
1426
|
+
$e?.remove(), $e = null;
|
|
1426
1427
|
}
|
|
1427
|
-
}), i.appendChild(
|
|
1428
|
+
}), i.appendChild($e);
|
|
1428
1429
|
} catch (d) {
|
|
1429
1430
|
at = d instanceof Error ? d.message : "Could not draft social post.";
|
|
1430
1431
|
} finally {
|
|
1431
|
-
bt = null,
|
|
1432
|
+
bt = null, U(b.getState());
|
|
1432
1433
|
}
|
|
1433
1434
|
}
|
|
1434
1435
|
}
|
|
1435
1436
|
function Xt(a, d) {
|
|
1436
|
-
const
|
|
1437
|
-
r =
|
|
1438
|
-
|
|
1437
|
+
const f = a.accentColor ?? t.accentColor, S = a.colorScheme ?? t.colorScheme, N = a.fontFamily ?? t.fontFamily, Zt = a.scribbleStyle ?? t.scribbleStyle;
|
|
1438
|
+
r = ao(
|
|
1439
|
+
f,
|
|
1439
1440
|
Zt
|
|
1440
|
-
),
|
|
1441
|
-
accentColor:
|
|
1442
|
-
colorScheme:
|
|
1441
|
+
), ro(i, r, {
|
|
1442
|
+
accentColor: f,
|
|
1443
|
+
colorScheme: S,
|
|
1443
1444
|
fontFamily: N,
|
|
1444
1445
|
scribbleStyle: Zt
|
|
1445
1446
|
}), J("web-sdk.widget", "Updated widget appearance", {
|
|
1446
1447
|
source: d,
|
|
1447
1448
|
inputAppearance: a,
|
|
1448
|
-
appliedAccentColor:
|
|
1449
|
-
appliedColorScheme:
|
|
1449
|
+
appliedAccentColor: f,
|
|
1450
|
+
appliedColorScheme: S,
|
|
1450
1451
|
appliedFontFamily: N,
|
|
1451
1452
|
appliedScribbleStyle: Zt,
|
|
1452
1453
|
cssAccent: i.style.getPropertyValue("--pluno-pa-accent")
|
|
1453
1454
|
});
|
|
1454
1455
|
}
|
|
1455
1456
|
}
|
|
1456
|
-
function
|
|
1457
|
+
function ao(e, t) {
|
|
1457
1458
|
return { accentColor: e, scribbleStyle: t };
|
|
1458
1459
|
}
|
|
1459
|
-
function Da(e) {
|
|
1460
|
-
const t = za(e);
|
|
1461
|
-
return t === null ? "#fafafa" : Ma(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1462
|
-
}
|
|
1463
1460
|
function za(e) {
|
|
1461
|
+
const t = Ma(e);
|
|
1462
|
+
return t === null ? "#fafafa" : Oa(t) > 0.5 ? "#18181b" : "#fafaf9";
|
|
1463
|
+
}
|
|
1464
|
+
function Ma(e) {
|
|
1464
1465
|
const t = e.trim();
|
|
1465
1466
|
return /^#[0-9a-f]{6}$/i.test(t) ? [
|
|
1466
1467
|
Number.parseInt(t.slice(1, 3), 16),
|
|
@@ -1472,14 +1473,14 @@ function za(e) {
|
|
|
1472
1473
|
Number.parseInt(t[3] + t[3], 16)
|
|
1473
1474
|
] : null;
|
|
1474
1475
|
}
|
|
1475
|
-
function
|
|
1476
|
+
function Oa([e, t, n]) {
|
|
1476
1477
|
const o = (i) => {
|
|
1477
1478
|
const r = i / 255;
|
|
1478
1479
|
return r <= 0.03928 ? r / 12.92 : ((r + 0.055) / 1.055) ** 2.4;
|
|
1479
1480
|
};
|
|
1480
1481
|
return 0.2126 * o(e) + 0.7152 * o(t) + 0.0722 * o(n);
|
|
1481
1482
|
}
|
|
1482
|
-
function
|
|
1483
|
+
function ro(e, t, n) {
|
|
1483
1484
|
e.classList.toggle(
|
|
1484
1485
|
"pluno-pa-widget--dark",
|
|
1485
1486
|
n.colorScheme === "dark"
|
|
@@ -1487,27 +1488,27 @@ function ao(e, t, n) {
|
|
|
1487
1488
|
"pluno-pa-widget--light",
|
|
1488
1489
|
n.colorScheme !== "dark"
|
|
1489
1490
|
), e.classList.toggle("pluno-pa-widget--scribble", n.scribbleStyle);
|
|
1490
|
-
const o = n.scribbleStyle ?
|
|
1491
|
+
const o = n.scribbleStyle ? Lo(n.accentColor) : n.accentColor;
|
|
1491
1492
|
e.style.setProperty("--pluno-pa-accent", o), n.scribbleStyle ? e.style.setProperty(
|
|
1492
1493
|
"--pluno-pa-accent-contrast",
|
|
1493
|
-
|
|
1494
|
-
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ?
|
|
1494
|
+
za(o)
|
|
1495
|
+
) : e.style.removeProperty("--pluno-pa-accent-contrast"), e.style.fontFamily = n.scribbleStyle ? ya : n.fontFamily, n.scribbleStyle && Ua(e.ownerDocument);
|
|
1495
1496
|
const i = Array.from(
|
|
1496
1497
|
e.querySelectorAll(".pluno-pa-widget__character")
|
|
1497
1498
|
);
|
|
1498
1499
|
for (const r of i)
|
|
1499
1500
|
r.replaceWith(
|
|
1500
|
-
|
|
1501
|
+
Le(
|
|
1501
1502
|
Array.from(r.classList).join(" "),
|
|
1502
1503
|
t
|
|
1503
1504
|
)
|
|
1504
1505
|
);
|
|
1505
1506
|
}
|
|
1506
|
-
function
|
|
1507
|
-
if (e.getElementById(
|
|
1507
|
+
function Ua(e) {
|
|
1508
|
+
if (e.getElementById(to))
|
|
1508
1509
|
return;
|
|
1509
1510
|
const t = e.createElement("style");
|
|
1510
|
-
t.id =
|
|
1511
|
+
t.id = to, t.textContent = `@font-face {
|
|
1511
1512
|
font-family: "Architects Daughter";
|
|
1512
1513
|
font-style: normal;
|
|
1513
1514
|
font-weight: 400;
|
|
@@ -1515,7 +1516,7 @@ function Oa(e) {
|
|
|
1515
1516
|
src: url("https://fonts.gstatic.com/s/architectsdaughter/v20/KtkxAKiDZI_td1Lkx62xHZHDtgO_Y-bvTYlg4-7jA-U.woff2") format("woff2");
|
|
1516
1517
|
}`, e.head.appendChild(t), e.fonts?.load('16px "Architects Daughter"');
|
|
1517
1518
|
}
|
|
1518
|
-
function
|
|
1519
|
+
function Ba({
|
|
1519
1520
|
root: e,
|
|
1520
1521
|
launcher: t,
|
|
1521
1522
|
launcherDragHandle: n,
|
|
@@ -1523,82 +1524,82 @@ function Ua({
|
|
|
1523
1524
|
setPosition: i,
|
|
1524
1525
|
persist: r
|
|
1525
1526
|
}) {
|
|
1526
|
-
let l = null,
|
|
1527
|
+
let l = null, s = null, p = null, u = !1, g = null;
|
|
1527
1528
|
const h = () => {
|
|
1528
|
-
l = null,
|
|
1529
|
-
},
|
|
1530
|
-
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId,
|
|
1531
|
-
},
|
|
1532
|
-
if (l !== m.pointerId || !
|
|
1529
|
+
l = null, s = null, p = null, u = !1, e.classList.remove("pluno-pa-widget--dragging");
|
|
1530
|
+
}, x = (m) => {
|
|
1531
|
+
e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing") || (m.preventDefault(), m.stopPropagation(), l = m.pointerId, s = { x: m.clientX, y: m.clientY }, p = o(), u = !1, t.setPointerCapture?.(m.pointerId));
|
|
1532
|
+
}, v = (m) => {
|
|
1533
|
+
if (l !== m.pointerId || !s || !p)
|
|
1533
1534
|
return;
|
|
1534
1535
|
m.preventDefault();
|
|
1535
|
-
const
|
|
1536
|
-
!
|
|
1537
|
-
},
|
|
1538
|
-
l === m.pointerId && (m.preventDefault(), m.stopPropagation(),
|
|
1539
|
-
},
|
|
1536
|
+
const z = m.clientX - s.x, O = m.clientY - s.y;
|
|
1537
|
+
!u && Math.hypot(z, O) < wn || (u = !0, e.classList.add("pluno-pa-widget--dragging"), i({ x: p.x + z, y: p.y + O }));
|
|
1538
|
+
}, L = (m) => {
|
|
1539
|
+
l === m.pointerId && (m.preventDefault(), m.stopPropagation(), u && (g = { x: m.clientX, y: m.clientY }, r()), h());
|
|
1540
|
+
}, D = (m) => {
|
|
1540
1541
|
l === m.pointerId && (m.preventDefault(), h());
|
|
1541
1542
|
}, c = (m) => {
|
|
1542
|
-
if (!
|
|
1543
|
+
if (!g)
|
|
1543
1544
|
return;
|
|
1544
|
-
const
|
|
1545
|
-
m.clientX -
|
|
1546
|
-
m.clientY -
|
|
1547
|
-
) <=
|
|
1548
|
-
|
|
1549
|
-
},
|
|
1545
|
+
const z = Math.hypot(
|
|
1546
|
+
m.clientX - g.x,
|
|
1547
|
+
m.clientY - g.y
|
|
1548
|
+
) <= wn;
|
|
1549
|
+
g = null, z && (m.preventDefault(), m.stopPropagation());
|
|
1550
|
+
}, E = (m) => {
|
|
1550
1551
|
if (e.classList.contains("pluno-pa-widget--open") || e.classList.contains("pluno-pa-widget--closing"))
|
|
1551
1552
|
return;
|
|
1552
|
-
const
|
|
1553
|
-
let
|
|
1554
|
-
m.key === "ArrowUp" ?
|
|
1553
|
+
const z = m.shiftKey ? Oo : Mo, O = o();
|
|
1554
|
+
let P = null;
|
|
1555
|
+
m.key === "ArrowUp" ? P = { x: O.x, y: O.y - z } : m.key === "ArrowDown" ? P = { x: O.x, y: O.y + z } : m.key === "ArrowLeft" ? P = { x: O.x - z, y: O.y } : m.key === "ArrowRight" && (P = { x: O.x + z, y: O.y }), P && (m.preventDefault(), m.stopPropagation(), i(P), r());
|
|
1555
1556
|
};
|
|
1556
|
-
return t.addEventListener("pointerdown",
|
|
1557
|
-
t.removeEventListener("pointerdown",
|
|
1557
|
+
return t.addEventListener("pointerdown", x), t.addEventListener("pointermove", v), t.addEventListener("pointerup", L), t.addEventListener("pointercancel", D), t.addEventListener("click", c, !0), n.addEventListener("keydown", E), () => {
|
|
1558
|
+
t.removeEventListener("pointerdown", x), t.removeEventListener("pointermove", v), t.removeEventListener("pointerup", L), t.removeEventListener("pointercancel", D), t.removeEventListener("click", c, !0), n.removeEventListener("keydown", E);
|
|
1558
1559
|
};
|
|
1559
1560
|
}
|
|
1560
|
-
function
|
|
1561
|
+
function Fa({
|
|
1561
1562
|
root: e,
|
|
1562
1563
|
handles: t,
|
|
1563
1564
|
getBounds: n,
|
|
1564
1565
|
setBounds: o,
|
|
1565
1566
|
persist: i
|
|
1566
1567
|
}) {
|
|
1567
|
-
let r = null, l = null,
|
|
1568
|
-
const
|
|
1569
|
-
r = null, l = null,
|
|
1568
|
+
let r = null, l = null, s = null, p = null, u = !1;
|
|
1569
|
+
const g = () => {
|
|
1570
|
+
r = null, l = null, s = null, p = null, u = !1, e.classList.remove("pluno-pa-widget--resizing");
|
|
1570
1571
|
}, h = (c) => {
|
|
1571
|
-
const
|
|
1572
|
-
!e.classList.contains("pluno-pa-widget--open") || !
|
|
1573
|
-
},
|
|
1574
|
-
if (r !== c.pointerId || !l || !
|
|
1572
|
+
const E = c.currentTarget, m = E.dataset.resizeDirection;
|
|
1573
|
+
!e.classList.contains("pluno-pa-widget--open") || !lo(m) || (c.preventDefault(), c.stopPropagation(), r = c.pointerId, l = m, s = { x: c.clientX, y: c.clientY }, p = n(), u = !1, E.setPointerCapture?.(c.pointerId));
|
|
1574
|
+
}, x = (c) => {
|
|
1575
|
+
if (r !== c.pointerId || !l || !s || !p)
|
|
1575
1576
|
return;
|
|
1576
1577
|
c.preventDefault(), c.stopPropagation();
|
|
1577
|
-
const
|
|
1578
|
-
!
|
|
1579
|
-
|
|
1578
|
+
const E = c.clientX - s.x, m = c.clientY - s.y;
|
|
1579
|
+
!u && Math.hypot(E, m) < wn || (u = !0, e.classList.add("pluno-pa-widget--resizing"), o(
|
|
1580
|
+
so(p, l, E, m)
|
|
1580
1581
|
));
|
|
1581
|
-
},
|
|
1582
|
-
r === c.pointerId && (c.preventDefault(), c.stopPropagation(),
|
|
1583
|
-
},
|
|
1584
|
-
r === c.pointerId && (c.preventDefault(),
|
|
1585
|
-
},
|
|
1586
|
-
const m = c.currentTarget.dataset.resizeDirection,
|
|
1587
|
-
let
|
|
1588
|
-
|
|
1582
|
+
}, v = (c) => {
|
|
1583
|
+
r === c.pointerId && (c.preventDefault(), c.stopPropagation(), u && i(), g());
|
|
1584
|
+
}, L = (c) => {
|
|
1585
|
+
r === c.pointerId && (c.preventDefault(), g());
|
|
1586
|
+
}, D = (c) => {
|
|
1587
|
+
const m = c.currentTarget.dataset.resizeDirection, z = c.shiftKey ? Oo : Mo, O = n();
|
|
1588
|
+
let P = 0, ne = 0;
|
|
1589
|
+
lo(m) && (c.key === "ArrowLeft" ? P = -z : c.key === "ArrowRight" ? P = z : c.key === "ArrowUp" ? ne = -z : c.key === "ArrowDown" && (ne = z), !(P === 0 && ne === 0) && (c.preventDefault(), c.stopPropagation(), o(so(O, m, P, ne)), i()));
|
|
1589
1590
|
};
|
|
1590
1591
|
for (const c of t)
|
|
1591
|
-
c.addEventListener("pointerdown", h), c.addEventListener("pointermove",
|
|
1592
|
+
c.addEventListener("pointerdown", h), c.addEventListener("pointermove", x), c.addEventListener("pointerup", v), c.addEventListener("pointercancel", L), c.addEventListener("keydown", D);
|
|
1592
1593
|
return () => {
|
|
1593
1594
|
for (const c of t)
|
|
1594
|
-
c.removeEventListener("pointerdown", h), c.removeEventListener("pointermove",
|
|
1595
|
+
c.removeEventListener("pointerdown", h), c.removeEventListener("pointermove", x), c.removeEventListener("pointerup", v), c.removeEventListener("pointercancel", L), c.removeEventListener("keydown", D);
|
|
1595
1596
|
};
|
|
1596
1597
|
}
|
|
1597
|
-
function
|
|
1598
|
+
function lo(e) {
|
|
1598
1599
|
return e === "left" || e === "right" || e === "top" || e === "bottom" || e === "top-left" || e === "top-right" || e === "bottom-left" || e === "bottom-right";
|
|
1599
1600
|
}
|
|
1600
|
-
function
|
|
1601
|
-
const i = te(), r =
|
|
1601
|
+
function so(e, t, n, o) {
|
|
1602
|
+
const i = te(), r = po({
|
|
1602
1603
|
leading: e.position.x,
|
|
1603
1604
|
length: e.size.width,
|
|
1604
1605
|
delta: n,
|
|
@@ -1607,20 +1608,20 @@ function lo(e, t, n, o) {
|
|
|
1607
1608
|
minLeading: R,
|
|
1608
1609
|
maxTrailing: i.width - R,
|
|
1609
1610
|
minLength: Math.min(
|
|
1610
|
-
|
|
1611
|
+
Cn,
|
|
1611
1612
|
i.width - R * 2
|
|
1612
1613
|
)
|
|
1613
|
-
}), l =
|
|
1614
|
+
}), l = po({
|
|
1614
1615
|
leading: e.position.y,
|
|
1615
1616
|
length: e.size.height,
|
|
1616
1617
|
delta: o,
|
|
1617
1618
|
resizeLeading: t.startsWith("top") || t === "top",
|
|
1618
1619
|
resizeTrailing: t.startsWith("bottom") || t === "bottom",
|
|
1619
|
-
minLeading:
|
|
1620
|
+
minLeading: Ue,
|
|
1620
1621
|
maxTrailing: i.height - R,
|
|
1621
1622
|
minLength: Math.min(
|
|
1622
1623
|
Sn,
|
|
1623
|
-
i.height -
|
|
1624
|
+
i.height - Ue - R
|
|
1624
1625
|
)
|
|
1625
1626
|
});
|
|
1626
1627
|
return {
|
|
@@ -1628,7 +1629,7 @@ function lo(e, t, n, o) {
|
|
|
1628
1629
|
size: { width: r.length, height: l.length }
|
|
1629
1630
|
};
|
|
1630
1631
|
}
|
|
1631
|
-
function
|
|
1632
|
+
function po({
|
|
1632
1633
|
leading: e,
|
|
1633
1634
|
length: t,
|
|
1634
1635
|
delta: n,
|
|
@@ -1636,78 +1637,78 @@ function so({
|
|
|
1636
1637
|
resizeTrailing: i,
|
|
1637
1638
|
minLeading: r,
|
|
1638
1639
|
maxTrailing: l,
|
|
1639
|
-
minLength:
|
|
1640
|
+
minLength: s
|
|
1640
1641
|
}) {
|
|
1641
|
-
const
|
|
1642
|
+
const p = e + t;
|
|
1642
1643
|
if (o) {
|
|
1643
|
-
const
|
|
1644
|
-
if (
|
|
1644
|
+
const u = e + n;
|
|
1645
|
+
if (u >= r) {
|
|
1645
1646
|
const h = ee(
|
|
1646
|
-
|
|
1647
|
+
u,
|
|
1647
1648
|
r,
|
|
1648
|
-
|
|
1649
|
+
p - s
|
|
1649
1650
|
);
|
|
1650
|
-
return { leading: h, length:
|
|
1651
|
+
return { leading: h, length: p - h };
|
|
1651
1652
|
}
|
|
1652
|
-
const
|
|
1653
|
-
|
|
1654
|
-
|
|
1653
|
+
const g = ee(
|
|
1654
|
+
p + r - u,
|
|
1655
|
+
p,
|
|
1655
1656
|
l
|
|
1656
1657
|
);
|
|
1657
|
-
return { leading: r, length:
|
|
1658
|
+
return { leading: r, length: g - r };
|
|
1658
1659
|
}
|
|
1659
1660
|
if (i) {
|
|
1660
|
-
const
|
|
1661
|
-
if (
|
|
1661
|
+
const u = p + n;
|
|
1662
|
+
if (u <= l) {
|
|
1662
1663
|
const h = ee(
|
|
1663
|
-
|
|
1664
|
-
e +
|
|
1664
|
+
u,
|
|
1665
|
+
e + s,
|
|
1665
1666
|
l
|
|
1666
1667
|
);
|
|
1667
1668
|
return { leading: e, length: h - e };
|
|
1668
1669
|
}
|
|
1669
|
-
const
|
|
1670
|
-
e - (
|
|
1670
|
+
const g = ee(
|
|
1671
|
+
e - (u - l),
|
|
1671
1672
|
r,
|
|
1672
1673
|
e
|
|
1673
1674
|
);
|
|
1674
|
-
return { leading:
|
|
1675
|
+
return { leading: g, length: l - g };
|
|
1675
1676
|
}
|
|
1676
1677
|
return { leading: e, length: t };
|
|
1677
1678
|
}
|
|
1678
1679
|
function At(e, t = !0) {
|
|
1679
1680
|
const n = te();
|
|
1680
1681
|
if (e.classList.contains("pluno-pa-widget--minimized"))
|
|
1681
|
-
return { width:
|
|
1682
|
+
return { width: no, height: no };
|
|
1682
1683
|
const o = e.getBoundingClientRect(), i = !e.classList.contains("pluno-pa-widget--open") && !e.classList.contains("pluno-pa-widget--closing");
|
|
1683
1684
|
return {
|
|
1684
|
-
width: t && i && o.width > 0 ? o.width : Math.min(
|
|
1685
|
-
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1685
|
+
width: t && i && o.width > 0 ? o.width : Math.min(Ro, n.width - 36),
|
|
1686
|
+
height: t && i && o.height > 0 ? o.height : e.classList.contains("pluno-pa-widget--scribble") ? Ca : Do
|
|
1686
1687
|
};
|
|
1687
1688
|
}
|
|
1688
|
-
function
|
|
1689
|
+
function Wa() {
|
|
1689
1690
|
const e = te();
|
|
1690
1691
|
return {
|
|
1691
1692
|
width: Math.min(
|
|
1692
1693
|
ee(
|
|
1693
|
-
e.width *
|
|
1694
|
-
|
|
1694
|
+
e.width * Ea,
|
|
1695
|
+
Cn,
|
|
1695
1696
|
Sa
|
|
1696
1697
|
),
|
|
1697
1698
|
e.width - R * 2
|
|
1698
1699
|
),
|
|
1699
1700
|
height: Math.min(
|
|
1700
1701
|
ee(
|
|
1701
|
-
e.height *
|
|
1702
|
+
e.height * La,
|
|
1702
1703
|
Sn,
|
|
1703
|
-
|
|
1704
|
+
ka
|
|
1704
1705
|
),
|
|
1705
|
-
e.height -
|
|
1706
|
+
e.height - Ue - R
|
|
1706
1707
|
)
|
|
1707
1708
|
};
|
|
1708
1709
|
}
|
|
1709
1710
|
function st(e = null) {
|
|
1710
|
-
return e ? Pt(e) :
|
|
1711
|
+
return e ? Pt(e) : Wa();
|
|
1711
1712
|
}
|
|
1712
1713
|
function Pt(e) {
|
|
1713
1714
|
const t = te();
|
|
@@ -1715,7 +1716,7 @@ function Pt(e) {
|
|
|
1715
1716
|
width: ee(
|
|
1716
1717
|
e.width,
|
|
1717
1718
|
Math.min(
|
|
1718
|
-
|
|
1719
|
+
Cn,
|
|
1719
1720
|
t.width - R * 2
|
|
1720
1721
|
),
|
|
1721
1722
|
Math.max(
|
|
@@ -1727,11 +1728,11 @@ function Pt(e) {
|
|
|
1727
1728
|
e.height,
|
|
1728
1729
|
Math.min(
|
|
1729
1730
|
Sn,
|
|
1730
|
-
t.height -
|
|
1731
|
+
t.height - Ue - R
|
|
1731
1732
|
),
|
|
1732
1733
|
Math.max(
|
|
1733
1734
|
R,
|
|
1734
|
-
t.height -
|
|
1735
|
+
t.height - Ue - R
|
|
1735
1736
|
)
|
|
1736
1737
|
)
|
|
1737
1738
|
};
|
|
@@ -1744,7 +1745,7 @@ function en(e, t) {
|
|
|
1744
1745
|
const n = Pt(t);
|
|
1745
1746
|
e.style.setProperty("--pluno-pa-panel-width", `${n.width}px`), e.style.setProperty("--pluno-pa-panel-height", `${n.height}px`);
|
|
1746
1747
|
}
|
|
1747
|
-
function
|
|
1748
|
+
function Ha(e, t, n) {
|
|
1748
1749
|
const o = Number.parseFloat(e.style.left), i = Number.parseFloat(e.style.top);
|
|
1749
1750
|
if (Number.isFinite(o) && Number.isFinite(i))
|
|
1750
1751
|
return { x: o, y: i };
|
|
@@ -1759,21 +1760,21 @@ function Wa(e, t, n) {
|
|
|
1759
1760
|
}
|
|
1760
1761
|
function tn(e, t, n) {
|
|
1761
1762
|
const o = At(e, !1);
|
|
1762
|
-
return t ?
|
|
1763
|
+
return t ? bn(
|
|
1763
1764
|
e,
|
|
1764
|
-
|
|
1765
|
+
Fo(t, o),
|
|
1765
1766
|
o
|
|
1766
|
-
) :
|
|
1767
|
+
) : $a(n === "bottom-left" ? "bottom-left" : "bottom-right", o, va);
|
|
1767
1768
|
}
|
|
1768
|
-
function
|
|
1769
|
+
function $a(e, t, n) {
|
|
1769
1770
|
const o = te();
|
|
1770
1771
|
return {
|
|
1771
1772
|
x: e.endsWith("right") ? Math.max(0, o.width - t.width - n) : n,
|
|
1772
1773
|
y: e.startsWith("bottom") ? Math.max(0, o.height - t.height - n) : n
|
|
1773
1774
|
};
|
|
1774
1775
|
}
|
|
1775
|
-
function
|
|
1776
|
-
const o = te(), i = R +
|
|
1776
|
+
function bn(e, t, n) {
|
|
1777
|
+
const o = te(), i = R + ja(e);
|
|
1777
1778
|
return {
|
|
1778
1779
|
x: ee(
|
|
1779
1780
|
t.x,
|
|
@@ -1793,7 +1794,7 @@ function wn(e, t, n) {
|
|
|
1793
1794
|
)
|
|
1794
1795
|
};
|
|
1795
1796
|
}
|
|
1796
|
-
function
|
|
1797
|
+
function Fo(e, t) {
|
|
1797
1798
|
const n = te();
|
|
1798
1799
|
return {
|
|
1799
1800
|
x: e.anchor.endsWith("right") ? n.width - t.width - e.x : e.x,
|
|
@@ -1801,19 +1802,19 @@ function Bo(e, t) {
|
|
|
1801
1802
|
};
|
|
1802
1803
|
}
|
|
1803
1804
|
function Ga(e, t) {
|
|
1804
|
-
const n =
|
|
1805
|
+
const n = qa(e, t), o = te();
|
|
1805
1806
|
return {
|
|
1806
1807
|
anchor: n,
|
|
1807
1808
|
x: n.endsWith("right") ? o.width - e.x - t.width : e.x,
|
|
1808
1809
|
y: n.startsWith("bottom") ? o.height - e.y - t.height : e.y
|
|
1809
1810
|
};
|
|
1810
1811
|
}
|
|
1811
|
-
function
|
|
1812
|
+
function qa(e, t) {
|
|
1812
1813
|
const n = te(), o = e.x + t.width / 2, r = e.y + t.height / 2 <= n.height / 2 ? "top" : "bottom", l = o <= n.width / 2 ? "left" : "right";
|
|
1813
1814
|
return `${r}-${l}`;
|
|
1814
1815
|
}
|
|
1815
|
-
function
|
|
1816
|
-
return e.classList.contains("pluno-pa-widget--scribble") ?
|
|
1816
|
+
function ja(e) {
|
|
1817
|
+
return e.classList.contains("pluno-pa-widget--scribble") ? Ia : Pa;
|
|
1817
1818
|
}
|
|
1818
1819
|
function nn(e, t, n, o = null) {
|
|
1819
1820
|
const i = At(e), r = st(o), l = {
|
|
@@ -1835,31 +1836,31 @@ function kt(e, t) {
|
|
|
1835
1836
|
),
|
|
1836
1837
|
y: ee(
|
|
1837
1838
|
e.y,
|
|
1838
|
-
|
|
1839
|
+
Ue,
|
|
1839
1840
|
Math.max(
|
|
1840
|
-
|
|
1841
|
+
Ue,
|
|
1841
1842
|
n.height - t.height - R
|
|
1842
1843
|
)
|
|
1843
1844
|
)
|
|
1844
1845
|
};
|
|
1845
1846
|
}
|
|
1846
|
-
function
|
|
1847
|
+
function Oe(e, t) {
|
|
1847
1848
|
if (e.classList.toggle("pluno-pa-widget--custom-position", t !== null), !t) {
|
|
1848
1849
|
e.style.removeProperty("left"), e.style.removeProperty("top"), e.style.removeProperty("right"), e.style.removeProperty("bottom");
|
|
1849
1850
|
return;
|
|
1850
1851
|
}
|
|
1851
1852
|
e.style.left = `${t.x}px`, e.style.top = `${t.y}px`, e.style.right = "auto", e.style.bottom = "auto";
|
|
1852
1853
|
}
|
|
1853
|
-
function
|
|
1854
|
+
function Ka(e, t) {
|
|
1854
1855
|
e.style.setProperty("--pluno-pa-panel-offset-x", `${t.x}px`), e.style.setProperty("--pluno-pa-panel-offset-y", `${t.y}px`);
|
|
1855
1856
|
}
|
|
1856
|
-
function
|
|
1857
|
+
function co(e) {
|
|
1857
1858
|
e.style.removeProperty("--pluno-pa-panel-offset-x"), e.style.removeProperty("--pluno-pa-panel-offset-y");
|
|
1858
1859
|
}
|
|
1859
1860
|
function te() {
|
|
1860
1861
|
return {
|
|
1861
|
-
width: window.innerWidth || document.documentElement.clientWidth ||
|
|
1862
|
-
height: window.innerHeight || document.documentElement.clientHeight ||
|
|
1862
|
+
width: window.innerWidth || document.documentElement.clientWidth || Ro + R * 2,
|
|
1863
|
+
height: window.innerHeight || document.documentElement.clientHeight || Do + R * 2
|
|
1863
1864
|
};
|
|
1864
1865
|
}
|
|
1865
1866
|
function on(e) {
|
|
@@ -1884,7 +1885,7 @@ function J(e, t, n) {
|
|
|
1884
1885
|
details: n
|
|
1885
1886
|
}, r = o.__plunoProductAgentDiagnostics__ ?? [];
|
|
1886
1887
|
r.push(i), r.length > 120 && r.splice(0, r.length - 120), o.__plunoProductAgentDiagnostics__ = r, o.__PLUNO_PRODUCT_AGENT_DIAGNOSTICS__ = () => [...r], window.dispatchEvent(
|
|
1887
|
-
new CustomEvent(
|
|
1888
|
+
new CustomEvent(ma, { detail: i })
|
|
1888
1889
|
);
|
|
1889
1890
|
}
|
|
1890
1891
|
function Va(e, t) {
|
|
@@ -1893,22 +1894,22 @@ function Va(e, t) {
|
|
|
1893
1894
|
function an(e, t, n, o) {
|
|
1894
1895
|
const i = t.value.trim();
|
|
1895
1896
|
return !i && n.length === 0 ? n : (o(), t.value = "", t.style.height = "22px", t.style.overflowY = "hidden", e.sendMessage(i, {
|
|
1896
|
-
attachments: n.length > 0 ? n.map(
|
|
1897
|
+
attachments: n.length > 0 ? n.map(Za) : void 0
|
|
1897
1898
|
}), t.dispatchEvent(new Event("input", { bubbles: !0 })), []);
|
|
1898
1899
|
}
|
|
1899
|
-
function
|
|
1900
|
+
function Ya(e, t, n) {
|
|
1900
1901
|
const o = e.activeElement;
|
|
1901
1902
|
return o === n ? "composer" : o === t ? "launcher" : null;
|
|
1902
1903
|
}
|
|
1903
|
-
function
|
|
1904
|
-
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt >
|
|
1904
|
+
function Xa(e, t, n, o) {
|
|
1905
|
+
if (!e.focusedInput || !e.focusedInputAt || Date.now() - e.focusedInputAt > oa)
|
|
1905
1906
|
return;
|
|
1906
1907
|
const i = e.focusedInput === "composer" ? o : n;
|
|
1907
1908
|
i === o && !t.classList.contains("pluno-pa-widget--open") || i === n && t.classList.contains("pluno-pa-widget--open") || window.requestAnimationFrame(() => {
|
|
1908
1909
|
!i.isConnected || i.readOnly || (i.focus(), i.setSelectionRange(i.value.length, i.value.length));
|
|
1909
1910
|
});
|
|
1910
1911
|
}
|
|
1911
|
-
function
|
|
1912
|
+
function Za(e) {
|
|
1912
1913
|
return e;
|
|
1913
1914
|
}
|
|
1914
1915
|
function lt(e) {
|
|
@@ -1921,7 +1922,7 @@ function pt(e, t = () => !0) {
|
|
|
1921
1922
|
t() && (e.scrollTop = e.scrollHeight);
|
|
1922
1923
|
});
|
|
1923
1924
|
}
|
|
1924
|
-
function
|
|
1925
|
+
function Ja(e) {
|
|
1925
1926
|
const t = e.messages[e.messages.length - 1];
|
|
1926
1927
|
return [
|
|
1927
1928
|
e.messages.length,
|
|
@@ -1932,13 +1933,13 @@ function Za(e) {
|
|
|
1932
1933
|
e.lastError ?? ""
|
|
1933
1934
|
].join(":");
|
|
1934
1935
|
}
|
|
1935
|
-
function
|
|
1936
|
+
function Qa(e) {
|
|
1936
1937
|
return e.messages.length > 0 || e.assistantDraft.length > 0 || e.isThinking || !!e.lastError;
|
|
1937
1938
|
}
|
|
1938
|
-
function
|
|
1939
|
+
function er(e) {
|
|
1939
1940
|
return e.firstUserMessage?.trim() ? e.firstUserMessage : e.title?.trim() ? e.title : "Untitled chat";
|
|
1940
1941
|
}
|
|
1941
|
-
function
|
|
1942
|
+
function tr(e) {
|
|
1942
1943
|
const t = e.currentPage;
|
|
1943
1944
|
if (typeof t?.url == "string" && t.url.trim())
|
|
1944
1945
|
try {
|
|
@@ -1949,7 +1950,7 @@ function er(e) {
|
|
|
1949
1950
|
}
|
|
1950
1951
|
return typeof t?.origin == "string" && t.origin.trim() ? t.origin : "Current origin";
|
|
1951
1952
|
}
|
|
1952
|
-
function
|
|
1953
|
+
function nr(e, t) {
|
|
1953
1954
|
const n = new Date(e).getTime();
|
|
1954
1955
|
if (!Number.isFinite(n))
|
|
1955
1956
|
return "now";
|
|
@@ -1960,14 +1961,14 @@ function tr(e, t) {
|
|
|
1960
1961
|
];
|
|
1961
1962
|
for (const [r, l] of i)
|
|
1962
1963
|
if (o >= l) {
|
|
1963
|
-
const
|
|
1964
|
-
return r === "min" ? `${
|
|
1964
|
+
const s = Math.max(1, Math.floor(o / l));
|
|
1965
|
+
return r === "min" ? `${s} min` : `${s} ${r}${s === 1 ? "" : "s"}`;
|
|
1965
1966
|
}
|
|
1966
1967
|
return "now";
|
|
1967
1968
|
}
|
|
1968
|
-
function
|
|
1969
|
-
e.appendChild(
|
|
1970
|
-
|
|
1969
|
+
function or(e, t, n, o, i) {
|
|
1970
|
+
e.appendChild(gr()), e.appendChild(
|
|
1971
|
+
ir(
|
|
1971
1972
|
t,
|
|
1972
1973
|
n,
|
|
1973
1974
|
o,
|
|
@@ -1977,16 +1978,16 @@ function nr(e, t, n, o, i) {
|
|
|
1977
1978
|
It(
|
|
1978
1979
|
"pluno-pa-widget__close",
|
|
1979
1980
|
"Close",
|
|
1980
|
-
|
|
1981
|
+
hr(16),
|
|
1981
1982
|
!0
|
|
1982
1983
|
)
|
|
1983
|
-
), e.appendChild(
|
|
1984
|
+
), e.appendChild(ar(n));
|
|
1984
1985
|
}
|
|
1985
|
-
function
|
|
1986
|
+
function ir(e, t, n, o) {
|
|
1986
1987
|
const i = document.createElement("form");
|
|
1987
1988
|
if (i.className = "pluno-pa-widget__launcher", o && i.classList.add("pluno-pa-widget__launcher--minimizable"), n) {
|
|
1988
|
-
const
|
|
1989
|
-
|
|
1989
|
+
const p = document.createElement("button");
|
|
1990
|
+
p.type = "button", p.className = "pluno-pa-widget__launcher-drag-handle", p.setAttribute("aria-label", "Move Pluno launcher"), p.title = "Move Pluno launcher", i.appendChild(p);
|
|
1990
1991
|
}
|
|
1991
1992
|
i.appendChild(
|
|
1992
1993
|
Go(
|
|
@@ -1994,7 +1995,7 @@ function or(e, t, n, o) {
|
|
|
1994
1995
|
10
|
|
1995
1996
|
)
|
|
1996
1997
|
), i.appendChild(
|
|
1997
|
-
|
|
1998
|
+
Le(
|
|
1998
1999
|
"pluno-pa-widget__character--launcher",
|
|
1999
2000
|
t
|
|
2000
2001
|
)
|
|
@@ -2003,14 +2004,14 @@ function or(e, t, n, o) {
|
|
|
2003
2004
|
r.className = "pluno-pa-widget__launcher-run-indicator", i.appendChild(r);
|
|
2004
2005
|
const l = document.createElement("input");
|
|
2005
2006
|
l.className = "pluno-pa-widget__launcher-input", l.type = "text", l.placeholder = e, l.setAttribute("aria-label", e), i.appendChild(l);
|
|
2006
|
-
const
|
|
2007
|
-
if (
|
|
2008
|
-
const
|
|
2009
|
-
|
|
2007
|
+
const s = ct("Working...");
|
|
2008
|
+
if (s.classList.add("pluno-pa-widget__status--launcher"), i.appendChild(s), o) {
|
|
2009
|
+
const p = document.createElement("button");
|
|
2010
|
+
p.type = "button", p.className = "pluno-pa-widget__launcher-minimize", p.textContent = "-", p.setAttribute("aria-label", "Minimize Pluno on this site"), p.title = "Minimize Pluno on this site", i.appendChild(p);
|
|
2010
2011
|
}
|
|
2011
2012
|
return i;
|
|
2012
2013
|
}
|
|
2013
|
-
function
|
|
2014
|
+
function ar(e) {
|
|
2014
2015
|
const t = document.createElement("section");
|
|
2015
2016
|
t.className = "pluno-pa-widget__panel", t.hidden = !0, t.appendChild(
|
|
2016
2017
|
Go("pluno-pa-widget__scribble-spirals--panel", 16)
|
|
@@ -2018,22 +2019,22 @@ function ir(e) {
|
|
|
2018
2019
|
const n = document.createElement("div");
|
|
2019
2020
|
n.className = "pluno-pa-widget__timeline-wrap";
|
|
2020
2021
|
const o = document.createElement("main");
|
|
2021
|
-
o.className = "pluno-pa-widget__timeline", o.appendChild(
|
|
2022
|
+
o.className = "pluno-pa-widget__timeline", o.appendChild(dr(e));
|
|
2022
2023
|
const i = document.createElement("div");
|
|
2023
2024
|
i.className = "pluno-pa-widget__timeline-bottom-sentinel", i.setAttribute("aria-hidden", "true"), o.appendChild(i), n.appendChild(o);
|
|
2024
2025
|
const r = document.createElement("div");
|
|
2025
2026
|
r.className = "pluno-pa-widget__active-users-counter", r.hidden = !0, n.appendChild(r);
|
|
2026
2027
|
const l = document.createElement("button");
|
|
2027
2028
|
l.type = "button", l.className = "pluno-pa-widget__timeline-jump", l.textContent = "New messages ↓", l.hidden = !0, n.appendChild(l);
|
|
2028
|
-
const
|
|
2029
|
-
return
|
|
2029
|
+
const s = document.createElement("div");
|
|
2030
|
+
return s.className = "pluno-pa-widget__top-actions", s.appendChild(
|
|
2030
2031
|
It(
|
|
2031
2032
|
"pluno-pa-widget__history",
|
|
2032
|
-
|
|
2033
|
-
|
|
2033
|
+
_n(),
|
|
2034
|
+
fr(),
|
|
2034
2035
|
!0
|
|
2035
2036
|
)
|
|
2036
|
-
), n.appendChild(
|
|
2037
|
+
), n.appendChild(s), n.appendChild(pr()), t.appendChild(n), t.appendChild(rr()), t.appendChild(lr()), t.appendChild(sr()), t.appendChild(Ee("left", "Resize Pluno from left")), t.appendChild(
|
|
2037
2038
|
Ee("right", "Resize Pluno from right")
|
|
2038
2039
|
), t.appendChild(Ee("top", "Resize Pluno from top")), t.appendChild(
|
|
2039
2040
|
Ee("bottom", "Resize Pluno from bottom")
|
|
@@ -2054,7 +2055,7 @@ function Ee(e, t) {
|
|
|
2054
2055
|
`pluno-pa-widget__resize-handle--${e}`
|
|
2055
2056
|
].join(" "), n.dataset.resizeDirection = e, n.setAttribute("aria-label", t), n.title = t, n;
|
|
2056
2057
|
}
|
|
2057
|
-
function
|
|
2058
|
+
function rr() {
|
|
2058
2059
|
const e = document.createElement("div");
|
|
2059
2060
|
e.className = "pluno-pa-widget__notify-suggestion", e.hidden = !0;
|
|
2060
2061
|
const t = document.createElement("span");
|
|
@@ -2068,7 +2069,7 @@ function ar() {
|
|
|
2068
2069
|
const r = document.createElement("button");
|
|
2069
2070
|
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;
|
|
2070
2071
|
}
|
|
2071
|
-
function
|
|
2072
|
+
function lr() {
|
|
2072
2073
|
const e = document.createElement("div");
|
|
2073
2074
|
e.className = "pluno-pa-widget__notify-suggestion pluno-pa-widget__tab-groups-suggestion", e.hidden = !0;
|
|
2074
2075
|
const t = document.createElement("span");
|
|
@@ -2080,7 +2081,7 @@ function rr() {
|
|
|
2080
2081
|
const i = document.createElement("button");
|
|
2081
2082
|
return i.type = "button", i.className = "pluno-pa-widget__notify-suggestion-later pluno-pa-widget__tab-groups-suggestion-dismiss", i.textContent = "Not now", n.append(o, i), e.append(t, n), e;
|
|
2082
2083
|
}
|
|
2083
|
-
function
|
|
2084
|
+
function sr() {
|
|
2084
2085
|
const e = document.createElement("form");
|
|
2085
2086
|
e.className = "pluno-pa-widget__composer";
|
|
2086
2087
|
const t = document.createElement("div");
|
|
@@ -2094,32 +2095,32 @@ function lr() {
|
|
|
2094
2095
|
const r = document.createElement("input");
|
|
2095
2096
|
r.className = "pluno-pa-widget__attachment-input", r.type = "file", r.multiple = !0, r.tabIndex = -1, r.setAttribute("aria-hidden", "true"), i.appendChild(r);
|
|
2096
2097
|
const l = document.createElement("button");
|
|
2097
|
-
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(
|
|
2098
|
-
const
|
|
2099
|
-
|
|
2100
|
-
const
|
|
2101
|
-
|
|
2102
|
-
const
|
|
2103
|
-
|
|
2104
|
-
const
|
|
2105
|
-
|
|
2098
|
+
l.type = "button", l.className = "pluno-pa-widget__attach", l.setAttribute("aria-label", "Attach files"), l.title = "Attach files", l.appendChild(br()), l.appendChild(_r()), i.appendChild(l);
|
|
2099
|
+
const s = document.createElement("textarea");
|
|
2100
|
+
s.className = "pluno-pa-widget__input", s.rows = 1, s.placeholder = "Ask for anything...", i.appendChild(s);
|
|
2101
|
+
const p = document.createElement("button");
|
|
2102
|
+
p.type = "button", p.className = "pluno-pa-widget__send", p.setAttribute("aria-label", "Send"), p.appendChild(jo()), i.appendChild(p), e.appendChild(i);
|
|
2103
|
+
const u = document.createElement("div");
|
|
2104
|
+
u.className = "pluno-pa-widget__composer-meta";
|
|
2105
|
+
const g = document.createElement("a");
|
|
2106
|
+
g.className = "pluno-pa-widget__powered-by", g.href = "https://pluno.ai", g.target = "_blank", g.rel = "noopener noreferrer", g.textContent = "Powered by Pluno.ai.", u.appendChild(g);
|
|
2106
2107
|
const h = document.createElement("span");
|
|
2107
|
-
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.",
|
|
2108
|
+
return h.className = "pluno-pa-widget__ai-disclaimer", h.textContent = "AI can make mistakes. Verify outputs.", u.appendChild(h), e.appendChild(u), e;
|
|
2108
2109
|
}
|
|
2109
|
-
function
|
|
2110
|
+
function _n() {
|
|
2110
2111
|
return location.hostname ? `Recent chats on ${location.hostname}` : "Recent chats";
|
|
2111
2112
|
}
|
|
2112
|
-
function
|
|
2113
|
+
function pr() {
|
|
2113
2114
|
const e = document.createElement("section");
|
|
2114
|
-
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label",
|
|
2115
|
+
e.className = "pluno-pa-widget__history-panel", e.hidden = !0, e.setAttribute("aria-label", _n());
|
|
2115
2116
|
const t = document.createElement("div");
|
|
2116
2117
|
t.className = "pluno-pa-widget__history-header";
|
|
2117
2118
|
const n = document.createElement("strong");
|
|
2118
|
-
n.textContent =
|
|
2119
|
+
n.textContent = _n();
|
|
2119
2120
|
const o = It(
|
|
2120
2121
|
"pluno-pa-widget__history-close",
|
|
2121
2122
|
"Close recent chats",
|
|
2122
|
-
|
|
2123
|
+
wr(),
|
|
2123
2124
|
!1
|
|
2124
2125
|
);
|
|
2125
2126
|
t.append(n, o);
|
|
@@ -2128,20 +2129,20 @@ function sr() {
|
|
|
2128
2129
|
const r = document.createElement("p");
|
|
2129
2130
|
return r.className = "pluno-pa-widget__history-status", r.hidden = !0, e.append(t, i, r), e;
|
|
2130
2131
|
}
|
|
2131
|
-
function
|
|
2132
|
+
function dr(e) {
|
|
2132
2133
|
const t = document.createElement("div");
|
|
2133
2134
|
return t.className = "pluno-pa-widget__empty-state", t.appendChild(
|
|
2134
|
-
|
|
2135
|
+
Le(
|
|
2135
2136
|
"pluno-pa-widget__character--empty",
|
|
2136
2137
|
e
|
|
2137
2138
|
)
|
|
2138
|
-
), t.appendChild(
|
|
2139
|
+
), t.appendChild(Wo()), t;
|
|
2139
2140
|
}
|
|
2140
|
-
function
|
|
2141
|
+
function Wo() {
|
|
2141
2142
|
const e = document.createElement("div");
|
|
2142
2143
|
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;
|
|
2143
2144
|
}
|
|
2144
|
-
function
|
|
2145
|
+
function Ho(e, t) {
|
|
2145
2146
|
e.replaceChildren(), e.setAttribute(
|
|
2146
2147
|
"aria-label",
|
|
2147
2148
|
`${t.toLocaleString("en-US")} users currently active`
|
|
@@ -2153,17 +2154,17 @@ function Wo(e, t) {
|
|
|
2153
2154
|
)
|
|
2154
2155
|
);
|
|
2155
2156
|
}
|
|
2156
|
-
function
|
|
2157
|
-
const n = `pluno-pa-character-${
|
|
2158
|
-
|
|
2159
|
-
const o = t.scribbleStyle ?
|
|
2157
|
+
function Le(e, t) {
|
|
2158
|
+
const n = `pluno-pa-character-${io}`;
|
|
2159
|
+
io += 1;
|
|
2160
|
+
const o = t.scribbleStyle ? ur(t.accentColor, n) : cr(t.accentColor, n), i = e.split(/\s+/).filter(Boolean);
|
|
2160
2161
|
return o.setAttribute(
|
|
2161
2162
|
"class",
|
|
2162
2163
|
i.includes("pluno-pa-widget__character") ? e : `pluno-pa-widget__character ${e}`
|
|
2163
2164
|
), o.setAttribute("aria-hidden", "true"), o.setAttribute("focusable", "false"), o.removeAttribute("role"), o.removeAttribute("aria-label"), o;
|
|
2164
2165
|
}
|
|
2165
|
-
function
|
|
2166
|
-
const n =
|
|
2166
|
+
function cr(e, t) {
|
|
2167
|
+
const n = Ti(e), o = {
|
|
2167
2168
|
boltFill: `${t}-boltFill`,
|
|
2168
2169
|
boltEdge: `${t}-boltEdge`,
|
|
2169
2170
|
boltGlow: `${t}-boltGlow`,
|
|
@@ -2174,7 +2175,7 @@ function dr(e, t) {
|
|
|
2174
2175
|
eyeShadow: `${t}-eyeShadow`,
|
|
2175
2176
|
pupilGloss: `${t}-pupilGloss`,
|
|
2176
2177
|
boltClip: `${t}-boltClip`
|
|
2177
|
-
}, i =
|
|
2178
|
+
}, i = $o(), r = _(i, "defs"), l = _(r, "linearGradient", {
|
|
2178
2179
|
id: o.boltFill,
|
|
2179
2180
|
x1: "420",
|
|
2180
2181
|
y1: "180",
|
|
@@ -2183,7 +2184,7 @@ function dr(e, t) {
|
|
|
2183
2184
|
gradientUnits: "userSpaceOnUse"
|
|
2184
2185
|
});
|
|
2185
2186
|
H(l, "0", n.top), H(l, "0.36", n.middle), H(l, "0.72", n.bottom), H(l, "1", n.bottom);
|
|
2186
|
-
const
|
|
2187
|
+
const s = _(r, "linearGradient", {
|
|
2187
2188
|
id: o.boltEdge,
|
|
2188
2189
|
x1: "470",
|
|
2189
2190
|
y1: "145",
|
|
@@ -2191,28 +2192,28 @@ function dr(e, t) {
|
|
|
2191
2192
|
y2: "980",
|
|
2192
2193
|
gradientUnits: "userSpaceOnUse"
|
|
2193
2194
|
});
|
|
2194
|
-
H(
|
|
2195
|
-
const
|
|
2195
|
+
H(s, "0", n.edgeStart), H(s, "0.32", n.edgeMiddle), H(s, "0.78", n.edgeEnd), H(s, "1", n.edgeEnd);
|
|
2196
|
+
const p = _(r, "radialGradient", {
|
|
2196
2197
|
id: o.boltGlow,
|
|
2197
2198
|
cx: "50%",
|
|
2198
2199
|
cy: "22%",
|
|
2199
2200
|
r: "82%"
|
|
2200
2201
|
});
|
|
2201
|
-
H(
|
|
2202
|
-
const
|
|
2202
|
+
H(p, "0", n.glow, "0.72"), H(p, "0.5", n.middle, "0.44"), H(p, "1", n.bottom, "0");
|
|
2203
|
+
const u = _(r, "radialGradient", {
|
|
2203
2204
|
id: o.eyeWhite,
|
|
2204
2205
|
cx: "35%",
|
|
2205
2206
|
cy: "25%",
|
|
2206
2207
|
r: "70%"
|
|
2207
2208
|
});
|
|
2208
|
-
H(
|
|
2209
|
-
const
|
|
2209
|
+
H(u, "0", "#ffffff"), H(u, "0.72", "#ffffff"), H(u, "1", "#e5e5e5");
|
|
2210
|
+
const g = _(r, "radialGradient", {
|
|
2210
2211
|
id: o.pupil,
|
|
2211
2212
|
cx: "42%",
|
|
2212
2213
|
cy: "38%",
|
|
2213
2214
|
r: "65%"
|
|
2214
2215
|
});
|
|
2215
|
-
H(
|
|
2216
|
+
H(g, "0", "#2a1f10"), H(g, "0.52", "#080604"), H(g, "1", "#000000");
|
|
2216
2217
|
const h = _(r, "filter", {
|
|
2217
2218
|
id: o.softDropShadow,
|
|
2218
2219
|
x: "-18%",
|
|
@@ -2228,7 +2229,7 @@ function dr(e, t) {
|
|
|
2228
2229
|
"flood-color": n.shadow,
|
|
2229
2230
|
"flood-opacity": "0.24"
|
|
2230
2231
|
});
|
|
2231
|
-
const
|
|
2232
|
+
const x = _(r, "filter", {
|
|
2232
2233
|
id: o.innerDepth,
|
|
2233
2234
|
x: "-8%",
|
|
2234
2235
|
y: "-8%",
|
|
@@ -2236,32 +2237,32 @@ function dr(e, t) {
|
|
|
2236
2237
|
height: "116%",
|
|
2237
2238
|
"color-interpolation-filters": "sRGB"
|
|
2238
2239
|
});
|
|
2239
|
-
_(
|
|
2240
|
+
_(x, "feGaussianBlur", {
|
|
2240
2241
|
in: "SourceAlpha",
|
|
2241
2242
|
stdDeviation: "8",
|
|
2242
2243
|
result: "blur"
|
|
2243
|
-
}), _(
|
|
2244
|
+
}), _(x, "feOffset", {
|
|
2244
2245
|
dx: "-7",
|
|
2245
2246
|
dy: "-9",
|
|
2246
2247
|
result: "topLeft"
|
|
2247
|
-
}), _(
|
|
2248
|
+
}), _(x, "feComposite", {
|
|
2248
2249
|
in: "topLeft",
|
|
2249
2250
|
in2: "SourceAlpha",
|
|
2250
2251
|
operator: "arithmetic",
|
|
2251
2252
|
k2: "-1",
|
|
2252
2253
|
k3: "1",
|
|
2253
2254
|
result: "innerShadow"
|
|
2254
|
-
}), _(
|
|
2255
|
+
}), _(x, "feColorMatrix", {
|
|
2255
2256
|
in: "innerShadow",
|
|
2256
2257
|
type: "matrix",
|
|
2257
2258
|
values: "1 0 0 0 1 0 1 0 0 1 0 0 1 0 1 0 0 0 0.42 0",
|
|
2258
2259
|
result: "innerLight"
|
|
2259
|
-
}), _(
|
|
2260
|
+
}), _(x, "feBlend", {
|
|
2260
2261
|
in: "SourceGraphic",
|
|
2261
2262
|
in2: "innerLight",
|
|
2262
2263
|
mode: "screen"
|
|
2263
2264
|
});
|
|
2264
|
-
const
|
|
2265
|
+
const v = _(r, "filter", {
|
|
2265
2266
|
id: o.eyeShadow,
|
|
2266
2267
|
x: "-24%",
|
|
2267
2268
|
y: "-20%",
|
|
@@ -2269,14 +2270,14 @@ function dr(e, t) {
|
|
|
2269
2270
|
height: "148%",
|
|
2270
2271
|
"color-interpolation-filters": "sRGB"
|
|
2271
2272
|
});
|
|
2272
|
-
_(
|
|
2273
|
+
_(v, "feDropShadow", {
|
|
2273
2274
|
dx: "0",
|
|
2274
2275
|
dy: "8",
|
|
2275
2276
|
stdDeviation: "5",
|
|
2276
2277
|
"flood-color": n.shadow,
|
|
2277
2278
|
"flood-opacity": "0.3"
|
|
2278
2279
|
});
|
|
2279
|
-
const
|
|
2280
|
+
const L = _(r, "filter", {
|
|
2280
2281
|
id: o.pupilGloss,
|
|
2281
2282
|
x: "-15%",
|
|
2282
2283
|
y: "-15%",
|
|
@@ -2284,15 +2285,15 @@ function dr(e, t) {
|
|
|
2284
2285
|
height: "130%",
|
|
2285
2286
|
"color-interpolation-filters": "sRGB"
|
|
2286
2287
|
});
|
|
2287
|
-
_(
|
|
2288
|
+
_(L, "feDropShadow", {
|
|
2288
2289
|
dx: "0",
|
|
2289
2290
|
dy: "3",
|
|
2290
2291
|
stdDeviation: "3",
|
|
2291
2292
|
"flood-color": "#000000",
|
|
2292
2293
|
"flood-opacity": "0.22"
|
|
2293
2294
|
});
|
|
2294
|
-
const
|
|
2295
|
-
_(
|
|
2295
|
+
const D = _(r, "clipPath", { id: o.boltClip });
|
|
2296
|
+
_(D, "path", { d: Lt });
|
|
2296
2297
|
const c = _(i, "g", {
|
|
2297
2298
|
filter: Q(o.softDropShadow)
|
|
2298
2299
|
});
|
|
@@ -2300,13 +2301,13 @@ function dr(e, t) {
|
|
|
2300
2301
|
d: Lt,
|
|
2301
2302
|
fill: Q(o.boltEdge)
|
|
2302
2303
|
});
|
|
2303
|
-
const
|
|
2304
|
+
const E = "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";
|
|
2304
2305
|
_(c, "path", {
|
|
2305
|
-
d:
|
|
2306
|
+
d: E,
|
|
2306
2307
|
fill: Q(o.boltFill),
|
|
2307
2308
|
filter: Q(o.innerDepth)
|
|
2308
2309
|
}), _(c, "path", {
|
|
2309
|
-
d:
|
|
2310
|
+
d: E,
|
|
2310
2311
|
fill: Q(o.boltGlow),
|
|
2311
2312
|
opacity: "0.74"
|
|
2312
2313
|
});
|
|
@@ -2336,9 +2337,9 @@ function dr(e, t) {
|
|
|
2336
2337
|
"stroke-linecap": "round",
|
|
2337
2338
|
opacity: "0.48"
|
|
2338
2339
|
});
|
|
2339
|
-
const
|
|
2340
|
-
return
|
|
2341
|
-
|
|
2340
|
+
const z = _(i, "g", { filter: Q(o.eyeShadow) });
|
|
2341
|
+
return uo(
|
|
2342
|
+
z,
|
|
2342
2343
|
"rotate(-2 528 463)",
|
|
2343
2344
|
"528",
|
|
2344
2345
|
"463",
|
|
@@ -2347,8 +2348,8 @@ function dr(e, t) {
|
|
|
2347
2348
|
"557",
|
|
2348
2349
|
"447",
|
|
2349
2350
|
o
|
|
2350
|
-
),
|
|
2351
|
-
|
|
2351
|
+
), uo(
|
|
2352
|
+
z,
|
|
2352
2353
|
"rotate(2 717 462)",
|
|
2353
2354
|
"717",
|
|
2354
2355
|
"462",
|
|
@@ -2359,13 +2360,13 @@ function dr(e, t) {
|
|
|
2359
2360
|
o
|
|
2360
2361
|
), i;
|
|
2361
2362
|
}
|
|
2362
|
-
function
|
|
2363
|
-
const n =
|
|
2363
|
+
function ur(e, t) {
|
|
2364
|
+
const n = Lo(e), o = {
|
|
2364
2365
|
clip: `${t}-scribbleBoltClip`,
|
|
2365
2366
|
wobble: `${t}-scribbleBoltWobble`
|
|
2366
|
-
}, i =
|
|
2367
|
+
}, i = $o(), r = _(i, "defs"), l = _(r, "clipPath", { id: o.clip });
|
|
2367
2368
|
_(l, "path", { d: Lt });
|
|
2368
|
-
const
|
|
2369
|
+
const s = _(r, "filter", {
|
|
2369
2370
|
id: o.wobble,
|
|
2370
2371
|
x: "-10%",
|
|
2371
2372
|
y: "-10%",
|
|
@@ -2373,24 +2374,24 @@ function cr(e, t) {
|
|
|
2373
2374
|
height: "120%",
|
|
2374
2375
|
"color-interpolation-filters": "sRGB"
|
|
2375
2376
|
});
|
|
2376
|
-
_(
|
|
2377
|
+
_(s, "feTurbulence", {
|
|
2377
2378
|
type: "fractalNoise",
|
|
2378
2379
|
baseFrequency: "0.011",
|
|
2379
2380
|
numOctaves: "3",
|
|
2380
2381
|
seed: "7",
|
|
2381
2382
|
result: "noise"
|
|
2382
|
-
}), _(
|
|
2383
|
+
}), _(s, "feDisplacementMap", {
|
|
2383
2384
|
in: "SourceGraphic",
|
|
2384
2385
|
in2: "noise",
|
|
2385
2386
|
scale: "16",
|
|
2386
2387
|
xChannelSelector: "R",
|
|
2387
2388
|
yChannelSelector: "G"
|
|
2388
2389
|
});
|
|
2389
|
-
const
|
|
2390
|
+
const p = _(i, "g", { filter: Q(o.wobble) }), u = _(p, "g", {
|
|
2390
2391
|
"clip-path": Q(o.clip)
|
|
2391
2392
|
});
|
|
2392
|
-
return _(
|
|
2393
|
-
d:
|
|
2393
|
+
return _(u, "path", {
|
|
2394
|
+
d: Li(),
|
|
2394
2395
|
fill: "none",
|
|
2395
2396
|
stroke: n,
|
|
2396
2397
|
"stroke-width": "56",
|
|
@@ -2398,14 +2399,14 @@ function cr(e, t) {
|
|
|
2398
2399
|
"stroke-linejoin": "round",
|
|
2399
2400
|
opacity: "0.9",
|
|
2400
2401
|
transform: "rotate(-14 627 600)"
|
|
2401
|
-
}), _(
|
|
2402
|
+
}), _(p, "path", {
|
|
2402
2403
|
d: Lt,
|
|
2403
2404
|
fill: "none",
|
|
2404
2405
|
stroke: Tt,
|
|
2405
2406
|
"stroke-width": "18",
|
|
2406
2407
|
"stroke-linejoin": "round"
|
|
2407
|
-
}),
|
|
2408
|
-
|
|
2408
|
+
}), go(
|
|
2409
|
+
p,
|
|
2409
2410
|
"rotate(-2 528 463)",
|
|
2410
2411
|
"528",
|
|
2411
2412
|
"463",
|
|
@@ -2413,8 +2414,8 @@ function cr(e, t) {
|
|
|
2413
2414
|
"473",
|
|
2414
2415
|
"557",
|
|
2415
2416
|
"447"
|
|
2416
|
-
),
|
|
2417
|
-
|
|
2417
|
+
), go(
|
|
2418
|
+
p,
|
|
2418
2419
|
"rotate(2 717 462)",
|
|
2419
2420
|
"717",
|
|
2420
2421
|
"462",
|
|
@@ -2424,37 +2425,37 @@ function cr(e, t) {
|
|
|
2424
2425
|
"447"
|
|
2425
2426
|
), i;
|
|
2426
2427
|
}
|
|
2427
|
-
function
|
|
2428
|
-
return
|
|
2429
|
-
xmlns:
|
|
2428
|
+
function $o() {
|
|
2429
|
+
return A("svg", {
|
|
2430
|
+
xmlns: zo,
|
|
2430
2431
|
viewBox: "0 0 1254 1254"
|
|
2431
2432
|
});
|
|
2432
2433
|
}
|
|
2433
|
-
function
|
|
2434
|
-
const
|
|
2435
|
-
_(
|
|
2434
|
+
function uo(e, t, n, o, i, r, l, s, p) {
|
|
2435
|
+
const u = _(e, "g", { transform: t });
|
|
2436
|
+
_(u, "ellipse", {
|
|
2436
2437
|
cx: n,
|
|
2437
2438
|
cy: o,
|
|
2438
2439
|
rx: "73",
|
|
2439
2440
|
ry: "80",
|
|
2440
|
-
fill: Q(
|
|
2441
|
-
}), _(
|
|
2441
|
+
fill: Q(p.eyeWhite)
|
|
2442
|
+
}), _(u, "ellipse", {
|
|
2442
2443
|
cx: i,
|
|
2443
2444
|
cy: r,
|
|
2444
2445
|
rx: "49",
|
|
2445
2446
|
ry: "57",
|
|
2446
|
-
fill: Q(
|
|
2447
|
-
filter: Q(
|
|
2448
|
-
}), _(
|
|
2447
|
+
fill: Q(p.pupil),
|
|
2448
|
+
filter: Q(p.pupilGloss)
|
|
2449
|
+
}), _(u, "circle", {
|
|
2449
2450
|
cx: l,
|
|
2450
|
-
cy:
|
|
2451
|
+
cy: s,
|
|
2451
2452
|
r: "18",
|
|
2452
2453
|
fill: "#ffffff"
|
|
2453
2454
|
});
|
|
2454
2455
|
}
|
|
2455
|
-
function
|
|
2456
|
-
const
|
|
2457
|
-
_(
|
|
2456
|
+
function go(e, t, n, o, i, r, l, s) {
|
|
2457
|
+
const p = _(e, "g", { transform: t });
|
|
2458
|
+
_(p, "ellipse", {
|
|
2458
2459
|
cx: n,
|
|
2459
2460
|
cy: o,
|
|
2460
2461
|
rx: "73",
|
|
@@ -2462,21 +2463,21 @@ function uo(e, t, n, o, i, r, l, p) {
|
|
|
2462
2463
|
fill: "#ffffff",
|
|
2463
2464
|
stroke: Tt,
|
|
2464
2465
|
"stroke-width": "13"
|
|
2465
|
-
}), _(
|
|
2466
|
+
}), _(p, "ellipse", {
|
|
2466
2467
|
cx: i,
|
|
2467
2468
|
cy: r,
|
|
2468
2469
|
rx: "45",
|
|
2469
2470
|
ry: "53",
|
|
2470
2471
|
fill: Tt
|
|
2471
|
-
}), _(
|
|
2472
|
+
}), _(p, "circle", {
|
|
2472
2473
|
cx: l,
|
|
2473
|
-
cy:
|
|
2474
|
+
cy: s,
|
|
2474
2475
|
r: "16",
|
|
2475
2476
|
fill: "#ffffff"
|
|
2476
2477
|
});
|
|
2477
2478
|
}
|
|
2478
2479
|
function _(e, t, n = {}) {
|
|
2479
|
-
const o =
|
|
2480
|
+
const o = A(t, n);
|
|
2480
2481
|
return e.appendChild(o), o;
|
|
2481
2482
|
}
|
|
2482
2483
|
function H(e, t, n, o) {
|
|
@@ -2490,14 +2491,14 @@ function It(e, t, n, o) {
|
|
|
2490
2491
|
const i = document.createElement("button");
|
|
2491
2492
|
return i.type = "button", i.className = e, i.setAttribute("aria-label", t), i.title = t, i.hidden = o, i.appendChild(n), i;
|
|
2492
2493
|
}
|
|
2493
|
-
function
|
|
2494
|
-
const e =
|
|
2494
|
+
function gr() {
|
|
2495
|
+
const e = A("svg", {
|
|
2495
2496
|
class: "pluno-pa-widget__scribble-defs",
|
|
2496
2497
|
"aria-hidden": "true",
|
|
2497
2498
|
focusable: "false",
|
|
2498
2499
|
width: "0",
|
|
2499
2500
|
height: "0"
|
|
2500
|
-
}), t =
|
|
2501
|
+
}), t = A("defs");
|
|
2501
2502
|
return t.appendChild(ln("pluno-pa-scribble-wobble", "2", "12")), t.appendChild(
|
|
2502
2503
|
ln("pluno-pa-scribble-wobble-2", "5", "15")
|
|
2503
2504
|
), t.appendChild(
|
|
@@ -2505,42 +2506,42 @@ function ur() {
|
|
|
2505
2506
|
), e.appendChild(t), e;
|
|
2506
2507
|
}
|
|
2507
2508
|
function Go(e, t) {
|
|
2508
|
-
const n =
|
|
2509
|
+
const n = A("svg", {
|
|
2509
2510
|
class: `pluno-pa-widget__scribble-spirals ${e}`,
|
|
2510
2511
|
preserveAspectRatio: "xMidYMid meet",
|
|
2511
2512
|
"aria-hidden": "true",
|
|
2512
2513
|
focusable: "false"
|
|
2513
2514
|
});
|
|
2514
|
-
return
|
|
2515
|
+
return qo(n, t), n;
|
|
2515
2516
|
}
|
|
2516
2517
|
function rn(e, t) {
|
|
2517
2518
|
if (!e)
|
|
2518
2519
|
return;
|
|
2519
2520
|
const n = Math.max(
|
|
2520
2521
|
0,
|
|
2521
|
-
t -
|
|
2522
|
+
t - fn * 2
|
|
2522
2523
|
), o = Math.max(
|
|
2523
|
-
|
|
2524
|
+
Aa,
|
|
2524
2525
|
Math.floor(
|
|
2525
|
-
(n -
|
|
2526
|
+
(n - mn * 2) / hn
|
|
2526
2527
|
)
|
|
2527
2528
|
);
|
|
2528
|
-
|
|
2529
|
+
qo(e, o);
|
|
2529
2530
|
}
|
|
2530
|
-
function
|
|
2531
|
+
function qo(e, t) {
|
|
2531
2532
|
if (e.dataset.spiralCount === `${t}`)
|
|
2532
2533
|
return;
|
|
2533
|
-
const n = t *
|
|
2534
|
+
const n = t * hn + mn * 2;
|
|
2534
2535
|
e.dataset.spiralCount = `${t}`, e.setAttribute(
|
|
2535
2536
|
"viewBox",
|
|
2536
|
-
`0 0 ${n} ${
|
|
2537
|
+
`0 0 ${n} ${Ta}`
|
|
2537
2538
|
), e.replaceChildren();
|
|
2538
2539
|
for (let o = 0; o < t; o += 1) {
|
|
2539
|
-
const i =
|
|
2540
|
-
transform: `translate(${
|
|
2540
|
+
const i = oo[o % oo.length], r = A("g", {
|
|
2541
|
+
transform: `translate(${mn + o * hn} 0)`
|
|
2541
2542
|
});
|
|
2542
2543
|
r.appendChild(
|
|
2543
|
-
|
|
2544
|
+
A("ellipse", {
|
|
2544
2545
|
cx: i.ellipseCx,
|
|
2545
2546
|
cy: i.ellipseCy,
|
|
2546
2547
|
rx: i.ellipseRx,
|
|
@@ -2551,7 +2552,7 @@ function $o(e, t) {
|
|
|
2551
2552
|
opacity: "0.8"
|
|
2552
2553
|
})
|
|
2553
2554
|
), r.appendChild(
|
|
2554
|
-
|
|
2555
|
+
A("path", {
|
|
2555
2556
|
d: i.path,
|
|
2556
2557
|
fill: "none",
|
|
2557
2558
|
stroke: "#2c2a1e",
|
|
@@ -2562,7 +2563,7 @@ function $o(e, t) {
|
|
|
2562
2563
|
}
|
|
2563
2564
|
}
|
|
2564
2565
|
function ln(e, t, n) {
|
|
2565
|
-
const o =
|
|
2566
|
+
const o = A("filter", {
|
|
2566
2567
|
id: e,
|
|
2567
2568
|
x: "-8%",
|
|
2568
2569
|
y: "-8%",
|
|
@@ -2570,7 +2571,7 @@ function ln(e, t, n) {
|
|
|
2570
2571
|
height: "116%"
|
|
2571
2572
|
});
|
|
2572
2573
|
return o.appendChild(
|
|
2573
|
-
|
|
2574
|
+
A("feTurbulence", {
|
|
2574
2575
|
type: "fractalNoise",
|
|
2575
2576
|
baseFrequency: "0.012 0.028",
|
|
2576
2577
|
numOctaves: "3",
|
|
@@ -2578,7 +2579,7 @@ function ln(e, t, n) {
|
|
|
2578
2579
|
result: "stroke-noise"
|
|
2579
2580
|
})
|
|
2580
2581
|
), o.appendChild(
|
|
2581
|
-
|
|
2582
|
+
A("feDisplacementMap", {
|
|
2582
2583
|
in: "SourceGraphic",
|
|
2583
2584
|
in2: "stroke-noise",
|
|
2584
2585
|
scale: "3.5",
|
|
@@ -2587,7 +2588,7 @@ function ln(e, t, n) {
|
|
|
2587
2588
|
result: "warped"
|
|
2588
2589
|
})
|
|
2589
2590
|
), o.appendChild(
|
|
2590
|
-
|
|
2591
|
+
A("feTurbulence", {
|
|
2591
2592
|
type: "fractalNoise",
|
|
2592
2593
|
baseFrequency: "0.7",
|
|
2593
2594
|
numOctaves: "1",
|
|
@@ -2595,7 +2596,7 @@ function ln(e, t, n) {
|
|
|
2595
2596
|
result: "ink-noise"
|
|
2596
2597
|
})
|
|
2597
2598
|
), o.appendChild(
|
|
2598
|
-
|
|
2599
|
+
A("feDisplacementMap", {
|
|
2599
2600
|
in: "warped",
|
|
2600
2601
|
in2: "ink-noise",
|
|
2601
2602
|
scale: "0.9",
|
|
@@ -2604,7 +2605,7 @@ function ln(e, t, n) {
|
|
|
2604
2605
|
})
|
|
2605
2606
|
), o;
|
|
2606
2607
|
}
|
|
2607
|
-
function
|
|
2608
|
+
function hr(e) {
|
|
2608
2609
|
const t = ue(
|
|
2609
2610
|
"0 0 24 24",
|
|
2610
2611
|
e,
|
|
@@ -2613,9 +2614,9 @@ function gr(e) {
|
|
|
2613
2614
|
"currentColor",
|
|
2614
2615
|
"2.25"
|
|
2615
2616
|
);
|
|
2616
|
-
return t.appendChild(
|
|
2617
|
+
return t.appendChild(A("path", { d: "m6 9 6 6 6-6" })), t;
|
|
2617
2618
|
}
|
|
2618
|
-
function
|
|
2619
|
+
function mr() {
|
|
2619
2620
|
const e = ue(
|
|
2620
2621
|
"0 0 24 24",
|
|
2621
2622
|
17,
|
|
@@ -2625,16 +2626,16 @@ function hr() {
|
|
|
2625
2626
|
"2.25"
|
|
2626
2627
|
);
|
|
2627
2628
|
return e.appendChild(
|
|
2628
|
-
|
|
2629
|
+
A("path", {
|
|
2629
2630
|
d: "M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"
|
|
2630
2631
|
})
|
|
2631
2632
|
), e.appendChild(
|
|
2632
|
-
|
|
2633
|
+
A("path", {
|
|
2633
2634
|
d: "M18.4 2.6a2.1 2.1 0 0 1 3 3L12 15l-4 1 1-4Z"
|
|
2634
2635
|
})
|
|
2635
2636
|
), e;
|
|
2636
2637
|
}
|
|
2637
|
-
function
|
|
2638
|
+
function fr() {
|
|
2638
2639
|
const e = ue(
|
|
2639
2640
|
"0 0 24 24",
|
|
2640
2641
|
17,
|
|
@@ -2643,9 +2644,9 @@ function mr() {
|
|
|
2643
2644
|
"currentColor",
|
|
2644
2645
|
"2.25"
|
|
2645
2646
|
);
|
|
2646
|
-
return e.appendChild(
|
|
2647
|
+
return e.appendChild(A("path", { d: "M3 12a9 9 0 1 0 3-6.7" })), e.appendChild(A("path", { d: "M3 4v5h5" })), e.appendChild(A("path", { d: "M12 7v5l3 2" })), e;
|
|
2647
2648
|
}
|
|
2648
|
-
function
|
|
2649
|
+
function wr() {
|
|
2649
2650
|
const e = ue(
|
|
2650
2651
|
"0 0 24 24",
|
|
2651
2652
|
15,
|
|
@@ -2654,9 +2655,9 @@ function fr() {
|
|
|
2654
2655
|
"currentColor",
|
|
2655
2656
|
"2.4"
|
|
2656
2657
|
);
|
|
2657
|
-
return e.appendChild(
|
|
2658
|
+
return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
|
|
2658
2659
|
}
|
|
2659
|
-
function
|
|
2660
|
+
function jo() {
|
|
2660
2661
|
const e = ue(
|
|
2661
2662
|
"0 0 24 24",
|
|
2662
2663
|
14,
|
|
@@ -2666,10 +2667,10 @@ function qo() {
|
|
|
2666
2667
|
"2.75"
|
|
2667
2668
|
);
|
|
2668
2669
|
return e.appendChild(
|
|
2669
|
-
|
|
2670
|
-
), e.appendChild(
|
|
2670
|
+
A("line", { x1: "12", y1: "19", x2: "12", y2: "5" })
|
|
2671
|
+
), e.appendChild(A("polyline", { points: "5 12 12 5 19 12" })), e;
|
|
2671
2672
|
}
|
|
2672
|
-
function
|
|
2673
|
+
function br() {
|
|
2673
2674
|
const e = ue(
|
|
2674
2675
|
"0 0 24 24",
|
|
2675
2676
|
16,
|
|
@@ -2682,18 +2683,18 @@ function wr() {
|
|
|
2682
2683
|
"class",
|
|
2683
2684
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--standard"
|
|
2684
2685
|
), e.appendChild(
|
|
2685
|
-
|
|
2686
|
+
A("path", {
|
|
2686
2687
|
d: "m21.4 11.6-8.5 8.5a6 6 0 0 1-8.5-8.5l9.2-9.2a4 4 0 0 1 5.7 5.7l-9.2 9.2a2 2 0 0 1-2.8-2.8l8.5-8.5"
|
|
2687
2688
|
})
|
|
2688
2689
|
), e;
|
|
2689
2690
|
}
|
|
2690
|
-
function
|
|
2691
|
+
function _r() {
|
|
2691
2692
|
const e = ue("0 0 24 24", 19, 19, "none", "currentColor");
|
|
2692
2693
|
return e.setAttribute(
|
|
2693
2694
|
"class",
|
|
2694
2695
|
"pluno-pa-widget__paperclip-icon pluno-pa-widget__paperclip-icon--scribble"
|
|
2695
2696
|
), e.appendChild(
|
|
2696
|
-
|
|
2697
|
+
A("path", {
|
|
2697
2698
|
d: "M7.1 15.6 15.2 7.7c1.9-1.8 4.9.8 2.7 3.2l-8.8 8.3c-3.2 3-8-1.1-4.6-4.8l10.1-9.1",
|
|
2698
2699
|
stroke: "currentColor",
|
|
2699
2700
|
"stroke-width": "2",
|
|
@@ -2702,10 +2703,10 @@ function br() {
|
|
|
2702
2703
|
})
|
|
2703
2704
|
), e;
|
|
2704
2705
|
}
|
|
2705
|
-
function
|
|
2706
|
+
function xr() {
|
|
2706
2707
|
const e = ue("0 0 24 24", 18, 18, "currentColor");
|
|
2707
2708
|
return e.appendChild(
|
|
2708
|
-
|
|
2709
|
+
A("rect", {
|
|
2709
2710
|
x: "6",
|
|
2710
2711
|
y: "6",
|
|
2711
2712
|
width: "12",
|
|
@@ -2714,7 +2715,7 @@ function _r() {
|
|
|
2714
2715
|
})
|
|
2715
2716
|
), e;
|
|
2716
2717
|
}
|
|
2717
|
-
function
|
|
2718
|
+
function yr() {
|
|
2718
2719
|
const e = ue(
|
|
2719
2720
|
"0 0 24 24",
|
|
2720
2721
|
12,
|
|
@@ -2723,9 +2724,9 @@ function xr() {
|
|
|
2723
2724
|
"currentColor",
|
|
2724
2725
|
"2.4"
|
|
2725
2726
|
);
|
|
2726
|
-
return e.appendChild(
|
|
2727
|
+
return e.appendChild(A("path", { d: "M18 6 6 18" })), e.appendChild(A("path", { d: "m6 6 12 12" })), e;
|
|
2727
2728
|
}
|
|
2728
|
-
function
|
|
2729
|
+
function vr() {
|
|
2729
2730
|
const e = ue(
|
|
2730
2731
|
"0 0 24 24",
|
|
2731
2732
|
13,
|
|
@@ -2735,7 +2736,7 @@ function yr() {
|
|
|
2735
2736
|
"2.25"
|
|
2736
2737
|
);
|
|
2737
2738
|
return e.appendChild(
|
|
2738
|
-
|
|
2739
|
+
A("rect", {
|
|
2739
2740
|
width: "14",
|
|
2740
2741
|
height: "14",
|
|
2741
2742
|
x: "8",
|
|
@@ -2744,7 +2745,7 @@ function yr() {
|
|
|
2744
2745
|
ry: "2"
|
|
2745
2746
|
})
|
|
2746
2747
|
), e.appendChild(
|
|
2747
|
-
|
|
2748
|
+
A("path", {
|
|
2748
2749
|
d: "M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"
|
|
2749
2750
|
})
|
|
2750
2751
|
), e;
|
|
@@ -2757,33 +2758,33 @@ function ue(e, t, n, o, i, r) {
|
|
|
2757
2758
|
fill: o,
|
|
2758
2759
|
"aria-hidden": "true"
|
|
2759
2760
|
};
|
|
2760
|
-
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r),
|
|
2761
|
+
return i && (l.stroke = i, l["stroke-linecap"] = "round", l["stroke-linejoin"] = "round"), r && (l["stroke-width"] = r), A("svg", l);
|
|
2761
2762
|
}
|
|
2762
|
-
function
|
|
2763
|
-
const n = document.createElementNS(
|
|
2763
|
+
function A(e, t = {}) {
|
|
2764
|
+
const n = document.createElementNS(zo, e);
|
|
2764
2765
|
for (const [o, i] of Object.entries(t))
|
|
2765
2766
|
n.setAttribute(o, i);
|
|
2766
2767
|
return n;
|
|
2767
2768
|
}
|
|
2768
|
-
function
|
|
2769
|
+
function ho(e) {
|
|
2769
2770
|
for (const t of ["keydown", "keypress", "keyup"])
|
|
2770
2771
|
e.addEventListener(t, (n) => {
|
|
2771
2772
|
n.stopPropagation();
|
|
2772
2773
|
});
|
|
2773
2774
|
}
|
|
2774
|
-
function
|
|
2775
|
+
function Cr(e, t, n) {
|
|
2775
2776
|
e.replaceChildren(), e.hidden = t.length === 0;
|
|
2776
2777
|
for (const [o, i] of t.entries()) {
|
|
2777
2778
|
const r = document.createElement("div");
|
|
2778
2779
|
r.className = "pluno-pa-widget__attachment", r.appendChild(Sr(i));
|
|
2779
2780
|
const l = document.createElement("span");
|
|
2780
2781
|
l.textContent = i.name, r.appendChild(l);
|
|
2781
|
-
const
|
|
2782
|
-
|
|
2782
|
+
const s = document.createElement("button");
|
|
2783
|
+
s.type = "button", s.setAttribute("aria-label", `Remove ${i.name}`), s.appendChild(yr()), s.addEventListener("click", () => n(o)), r.appendChild(s), e.appendChild(r);
|
|
2783
2784
|
}
|
|
2784
2785
|
}
|
|
2785
2786
|
function Sr(e) {
|
|
2786
|
-
const t =
|
|
2787
|
+
const t = En(e), n = Ko(e);
|
|
2787
2788
|
if (t === "image" && n) {
|
|
2788
2789
|
const o = document.createElement("img");
|
|
2789
2790
|
return o.src = n, o.alt = "", o.setAttribute("aria-hidden", "true"), o.addEventListener(
|
|
@@ -2803,8 +2804,8 @@ function Sr(e) {
|
|
|
2803
2804
|
}
|
|
2804
2805
|
return ce(e);
|
|
2805
2806
|
}
|
|
2806
|
-
function
|
|
2807
|
-
const n =
|
|
2807
|
+
function Er(e, t) {
|
|
2808
|
+
const n = En(e), o = Ko(e);
|
|
2808
2809
|
if (n === "image" && o) {
|
|
2809
2810
|
const i = document.createElement("img");
|
|
2810
2811
|
i.className = "pluno-pa-widget__message-attachment-preview", i.alt = e.name;
|
|
@@ -2846,109 +2847,109 @@ function Cr(e, t) {
|
|
|
2846
2847
|
function ce(e, t = "composer") {
|
|
2847
2848
|
if (t === "composer") {
|
|
2848
2849
|
const r = document.createElement("span");
|
|
2849
|
-
return r.className = "pluno-pa-widget__attachment-file", r.textContent =
|
|
2850
|
+
return r.className = "pluno-pa-widget__attachment-file", r.textContent = mo(e), r;
|
|
2850
2851
|
}
|
|
2851
2852
|
const n = document.createElement("div");
|
|
2852
2853
|
n.className = "pluno-pa-widget__message-attachment-file";
|
|
2853
2854
|
const o = document.createElement("span");
|
|
2854
|
-
o.textContent =
|
|
2855
|
+
o.textContent = mo(e);
|
|
2855
2856
|
const i = document.createElement("strong");
|
|
2856
2857
|
return i.textContent = e.name, n.append(o, i), n;
|
|
2857
2858
|
}
|
|
2858
|
-
function
|
|
2859
|
+
function En(e) {
|
|
2859
2860
|
return e.mimeType.startsWith("image/") ? "image" : e.mimeType === "application/pdf" ? "pdf" : e.mimeType.startsWith("video/") ? "video" : "file";
|
|
2860
2861
|
}
|
|
2861
|
-
function
|
|
2862
|
+
function Ko(e) {
|
|
2862
2863
|
return "previewUrl" in e && e.previewUrl ? e.previewUrl : e.fileUrl ?? "";
|
|
2863
2864
|
}
|
|
2864
|
-
function
|
|
2865
|
-
const t =
|
|
2865
|
+
function mo(e) {
|
|
2866
|
+
const t = En(e);
|
|
2866
2867
|
return t === "image" ? "IMG" : t === "pdf" ? "PDF" : t === "video" ? "VID" : "FILE";
|
|
2867
2868
|
}
|
|
2868
|
-
function
|
|
2869
|
+
function kr(e, t) {
|
|
2869
2870
|
return t ? Array.from(t).map((o) => ({
|
|
2870
2871
|
...e.createLocalAttachment(o),
|
|
2871
|
-
previewUrl:
|
|
2872
|
+
previewUrl: Lr(o)
|
|
2872
2873
|
})) : [];
|
|
2873
2874
|
}
|
|
2874
|
-
function
|
|
2875
|
+
function Lr(e) {
|
|
2875
2876
|
return typeof URL.createObjectURL == "function" ? URL.createObjectURL(e) : void 0;
|
|
2876
2877
|
}
|
|
2877
|
-
function
|
|
2878
|
+
function St(e) {
|
|
2878
2879
|
return !!(e && Array.from(e.types).includes("Files"));
|
|
2879
2880
|
}
|
|
2880
2881
|
function sn(e, t, n = null) {
|
|
2881
|
-
if (!e || !
|
|
2882
|
+
if (!e || !xn(t, n)) {
|
|
2882
2883
|
e && (e.hidden = !0, e.replaceChildren());
|
|
2883
2884
|
return;
|
|
2884
2885
|
}
|
|
2885
|
-
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", se(t) ||
|
|
2886
|
-
|
|
2887
|
-
) : Vo(t) && e.appendChild(
|
|
2886
|
+
e.hidden = !1, e.replaceChildren(), e.className = "pluno-pa-widget__billing-status", se(t) || kn(n) ? e.appendChild(
|
|
2887
|
+
Tr(t, n)
|
|
2888
|
+
) : Vo(t) && e.appendChild(Ar(t));
|
|
2888
2889
|
}
|
|
2889
|
-
function
|
|
2890
|
+
function Tr(e, t) {
|
|
2890
2891
|
const n = document.createElement("div");
|
|
2891
2892
|
n.className = "pluno-pa-widget__billing-action-card";
|
|
2892
2893
|
const o = e.limitExceeded || t === "limit_exceeded", i = document.createElement("strong");
|
|
2893
2894
|
i.textContent = o ? "Credits used up" : "Billing needs attention", n.appendChild(i);
|
|
2894
2895
|
const r = document.createElement("span");
|
|
2895
2896
|
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(
|
|
2896
|
-
|
|
2897
|
+
Yo(
|
|
2897
2898
|
e,
|
|
2898
2899
|
"Upgrade plan",
|
|
2899
2900
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2900
2901
|
)
|
|
2901
2902
|
), n;
|
|
2902
2903
|
}
|
|
2903
|
-
function
|
|
2904
|
+
function Ar(e) {
|
|
2904
2905
|
const t = document.createElement("div");
|
|
2905
2906
|
t.className = "pluno-pa-widget__billing-action-card pluno-pa-widget__billing-action-card--low";
|
|
2906
2907
|
const n = document.createElement("strong");
|
|
2907
2908
|
n.textContent = "Credits running low", t.appendChild(n);
|
|
2908
2909
|
const o = document.createElement("span");
|
|
2909
|
-
return o.textContent =
|
|
2910
|
-
|
|
2910
|
+
return o.textContent = Ir(e) ?? "Credits are running low for this period.", t.appendChild(o), t.appendChild(
|
|
2911
|
+
Yo(
|
|
2911
2912
|
e,
|
|
2912
2913
|
"Upgrade",
|
|
2913
2914
|
"pluno-pa-widget__billing-action-card-actions"
|
|
2914
2915
|
)
|
|
2915
2916
|
), t;
|
|
2916
2917
|
}
|
|
2917
|
-
function
|
|
2918
|
-
return e !== null && (se(e) || Vo(e) ||
|
|
2918
|
+
function xn(e, t) {
|
|
2919
|
+
return e !== null && (se(e) || Vo(e) || kn(t));
|
|
2919
2920
|
}
|
|
2920
|
-
function
|
|
2921
|
-
return
|
|
2921
|
+
function fo(e, t, n) {
|
|
2922
|
+
return xn(t, n) || Pr(t) ? !0 : !xn(e, n);
|
|
2922
2923
|
}
|
|
2923
|
-
function
|
|
2924
|
+
function Pr(e) {
|
|
2924
2925
|
return e != null && (e.creditsUsed !== null || e.creditLimit !== null || e.creditsRemaining !== null || se(e));
|
|
2925
2926
|
}
|
|
2926
2927
|
function se(e) {
|
|
2927
2928
|
return e?.limitExceeded === !0 || !!e?.paymentIssue;
|
|
2928
2929
|
}
|
|
2929
|
-
function
|
|
2930
|
+
function kn(e) {
|
|
2930
2931
|
return e === "limit_exceeded" || e === "subscription_required" || e === "subscription_inactive" || e === "payment_issue" || e === "subscription_invalid" || e === "payment_required";
|
|
2931
2932
|
}
|
|
2932
2933
|
function Vo(e) {
|
|
2933
2934
|
return !se(e) && e.creditLimit !== null && e.creditLimit > 0 && e.creditsRemaining !== null && e.creditsRemaining > 0 && e.creditsRemaining / e.creditLimit <= 0.2;
|
|
2934
2935
|
}
|
|
2935
|
-
function Pr(e) {
|
|
2936
|
-
return e.creditsRemaining === null ? null : `${Ir(e.creditsRemaining)} credits left`;
|
|
2937
|
-
}
|
|
2938
2936
|
function Ir(e) {
|
|
2937
|
+
return e.creditsRemaining === null ? null : `${Nr(e.creditsRemaining)} credits left`;
|
|
2938
|
+
}
|
|
2939
|
+
function Nr(e) {
|
|
2939
2940
|
return new Intl.NumberFormat("en-US", {
|
|
2940
2941
|
maximumFractionDigits: 0
|
|
2941
2942
|
}).format(Math.ceil(e));
|
|
2942
2943
|
}
|
|
2943
|
-
function
|
|
2944
|
+
function Yo(e, t, n) {
|
|
2944
2945
|
const o = document.createElement("div");
|
|
2945
2946
|
return o.className = n, o.appendChild(
|
|
2946
|
-
|
|
2947
|
+
wo(t, e.pricingUrl)
|
|
2947
2948
|
), o.appendChild(
|
|
2948
|
-
|
|
2949
|
+
wo("Earn credits", e.earnCreditsUrl)
|
|
2949
2950
|
), o;
|
|
2950
2951
|
}
|
|
2951
|
-
function
|
|
2952
|
+
function wo(e, t) {
|
|
2952
2953
|
const n = document.createElement("button");
|
|
2953
2954
|
if (n.type = "button", e === "Earn credits") {
|
|
2954
2955
|
const o = document.createElement("span");
|
|
@@ -2961,223 +2962,223 @@ function fo(e, t) {
|
|
|
2961
2962
|
}
|
|
2962
2963
|
function pn(e, t) {
|
|
2963
2964
|
return e.messages.filter(
|
|
2964
|
-
(o) => !
|
|
2965
|
+
(o) => !Zo(o)
|
|
2965
2966
|
).length === 0 && !e.assistantDraft && !e.lastError && !e.isThinking && !t;
|
|
2966
2967
|
}
|
|
2967
|
-
function
|
|
2968
|
-
const ne =
|
|
2969
|
-
ne.filter((
|
|
2970
|
-
), Xe = e.scrollTop,
|
|
2971
|
-
|
|
2968
|
+
function Rr(e, t, n, o, i, r, l, s, p, u, g, h, x, v, L, D, c, E, m, z, O, P) {
|
|
2969
|
+
const ne = Ur(r), W = Br(
|
|
2970
|
+
ne.filter((C) => !Zo(C))
|
|
2971
|
+
), Xe = e.scrollTop, Be = [], ge = /* @__PURE__ */ new Set(), B = (C) => {
|
|
2972
|
+
Be.push(C);
|
|
2972
2973
|
};
|
|
2973
|
-
|
|
2974
|
-
const
|
|
2975
|
-
if (o(
|
|
2976
|
-
const
|
|
2977
|
-
|
|
2978
|
-
const
|
|
2979
|
-
|
|
2980
|
-
const I =
|
|
2974
|
+
ti(n, r.isThinking), i.hidden = !s, s && l !== null && Ho(i, l);
|
|
2975
|
+
const y = W.length > 0 || !!r.assistantDraft || r.isThinking;
|
|
2976
|
+
if (o(y), c || W.length === 0 && !r.assistantDraft && !r.lastError && !r.isThinking) {
|
|
2977
|
+
const C = document.createElement("div");
|
|
2978
|
+
C.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter" + (c ? " pluno-pa-widget__empty-state--morning-report" : "");
|
|
2979
|
+
const T = document.createElement("div");
|
|
2980
|
+
T.className = "pluno-pa-widget__empty-hero";
|
|
2981
|
+
const I = Le(
|
|
2981
2982
|
"pluno-pa-widget__character--empty",
|
|
2982
|
-
|
|
2983
|
+
v()
|
|
2983
2984
|
);
|
|
2984
|
-
if (
|
|
2985
|
-
const
|
|
2986
|
-
|
|
2985
|
+
if (T.appendChild(I), C.appendChild(T), c) {
|
|
2986
|
+
const w = document.createElement("h2");
|
|
2987
|
+
w.className = "pluno-pa-widget__empty pluno-pa-widget__morning-report-title", w.textContent = c.opening, C.appendChild(w);
|
|
2987
2988
|
} else
|
|
2988
|
-
|
|
2989
|
+
C.appendChild(Wo());
|
|
2989
2990
|
const ve = c?.prompts ?? r.starterPrompts, oe = document.createElement("div");
|
|
2990
2991
|
if (oe.className = ve.length > 0 ? "pluno-pa-widget__starter-prompts" : "pluno-pa-widget__starter-prompts pluno-pa-widget__starter-prompts--empty", ve.length === 0 && !r.starterPromptsLoading && oe.setAttribute("aria-hidden", "true"), ve.length > 0)
|
|
2991
|
-
for (const
|
|
2992
|
-
const
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
}), oe.appendChild(
|
|
2992
|
+
for (const w of ve) {
|
|
2993
|
+
const k = document.createElement("button");
|
|
2994
|
+
k.type = "button", k.className = "pluno-pa-widget__starter-prompt", k.textContent = `"${w}"`, k.addEventListener("click", () => {
|
|
2995
|
+
L(w);
|
|
2996
|
+
}), oe.appendChild(k);
|
|
2996
2997
|
}
|
|
2997
2998
|
else if (r.starterPromptsLoading) {
|
|
2998
|
-
const
|
|
2999
|
-
|
|
2999
|
+
const w = document.createElement("button");
|
|
3000
|
+
w.type = "button", w.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder pluno-pa-widget__starter-prompt--loading", w.disabled = !0, w.tabIndex = -1, w.textContent = "Generating example tasks...", oe.appendChild(w);
|
|
3000
3001
|
} else
|
|
3001
|
-
for (let
|
|
3002
|
-
const
|
|
3003
|
-
|
|
3002
|
+
for (let w = 0; w < fa; w += 1) {
|
|
3003
|
+
const k = document.createElement("button");
|
|
3004
|
+
k.type = "button", k.className = "pluno-pa-widget__starter-prompt pluno-pa-widget__starter-prompt--placeholder", k.disabled = !0, k.tabIndex = -1, k.textContent = "", oe.appendChild(k);
|
|
3004
3005
|
}
|
|
3005
|
-
if (
|
|
3006
|
-
const
|
|
3007
|
-
|
|
3006
|
+
if (C.appendChild(oe), c) {
|
|
3007
|
+
const w = document.createElement("button");
|
|
3008
|
+
w.type = "button", w.className = "pluno-pa-widget__morning-report-snooze", w.textContent = "Snooze morning report", w.addEventListener("click", E), C.appendChild(w);
|
|
3008
3009
|
}
|
|
3009
|
-
h.clear(), B(
|
|
3010
|
+
h.clear(), B(C), B(t), bo(e, Be);
|
|
3010
3011
|
return;
|
|
3011
3012
|
}
|
|
3012
|
-
let F = null,
|
|
3013
|
-
const
|
|
3013
|
+
let F = null, G = null, Z = [], Te = [];
|
|
3014
|
+
const V = W.length - 1, ut = V >= 0 && yn(W[V]), Ae = Fr(W);
|
|
3014
3015
|
let he = !1;
|
|
3015
3016
|
const me = () => {
|
|
3016
3017
|
if (Z.length === 0)
|
|
3017
3018
|
return he = !1, !1;
|
|
3018
|
-
const
|
|
3019
|
-
(I) =>
|
|
3020
|
-
),
|
|
3019
|
+
const C = Ae !== null && Z.some(
|
|
3020
|
+
(I) => Xo(I, Ae)
|
|
3021
|
+
), T = Zr(
|
|
3021
3022
|
Z,
|
|
3022
|
-
|
|
3023
|
-
|
|
3024
|
-
|
|
3025
|
-
|
|
3023
|
+
C,
|
|
3024
|
+
g,
|
|
3025
|
+
x,
|
|
3026
|
+
v()
|
|
3026
3027
|
);
|
|
3027
|
-
return B(
|
|
3028
|
-
},
|
|
3029
|
-
for (const
|
|
3030
|
-
B(
|
|
3031
|
-
|
|
3028
|
+
return B(T), F = null, G = T, Z = [], he = C, !0;
|
|
3029
|
+
}, M = () => {
|
|
3030
|
+
for (const C of Te)
|
|
3031
|
+
B(C), F = null, G = C;
|
|
3032
|
+
Te = [];
|
|
3032
3033
|
};
|
|
3033
|
-
for (let
|
|
3034
|
-
const
|
|
3035
|
-
if (
|
|
3036
|
-
const
|
|
3037
|
-
|
|
3038
|
-
|
|
3039
|
-
|
|
3034
|
+
for (let C = 0; C < W.length; C += 1) {
|
|
3035
|
+
const T = W[C];
|
|
3036
|
+
if (T.role === "tool" && T.integrationAuthRequest && O) {
|
|
3037
|
+
const w = Dr(
|
|
3038
|
+
T.integrationAuthRequest,
|
|
3039
|
+
O.states.get(
|
|
3040
|
+
T.integrationAuthRequest.authRequestId
|
|
3040
3041
|
) ?? {
|
|
3041
|
-
status:
|
|
3042
|
+
status: O.initialStatus
|
|
3042
3043
|
},
|
|
3043
|
-
|
|
3044
|
+
O.onConnect
|
|
3044
3045
|
);
|
|
3045
|
-
|
|
3046
|
+
Te.push(w);
|
|
3046
3047
|
continue;
|
|
3047
3048
|
}
|
|
3048
|
-
if (
|
|
3049
|
-
Z.push(
|
|
3049
|
+
if (T.role === "tool") {
|
|
3050
|
+
Z.push(T);
|
|
3050
3051
|
continue;
|
|
3051
3052
|
}
|
|
3052
|
-
if (
|
|
3053
|
-
if (
|
|
3053
|
+
if (yn(T)) {
|
|
3054
|
+
if (C !== V)
|
|
3054
3055
|
continue;
|
|
3055
3056
|
if (me()) {
|
|
3056
3057
|
if (!he) {
|
|
3057
|
-
const
|
|
3058
|
-
B(
|
|
3058
|
+
const k = ct();
|
|
3059
|
+
B(k), F = null, G = k;
|
|
3059
3060
|
}
|
|
3060
3061
|
} else {
|
|
3061
|
-
const
|
|
3062
|
-
B(
|
|
3062
|
+
const k = yo(v());
|
|
3063
|
+
B(k), F = null, G = k;
|
|
3063
3064
|
}
|
|
3064
3065
|
continue;
|
|
3065
3066
|
}
|
|
3066
|
-
if (
|
|
3067
|
-
if (
|
|
3067
|
+
if (T.role === "system") {
|
|
3068
|
+
if (T.dataType === "run_error" || T.dataType === "run_status") {
|
|
3068
3069
|
me();
|
|
3069
|
-
const
|
|
3070
|
-
if (
|
|
3071
|
-
|
|
3072
|
-
),
|
|
3070
|
+
const w = document.createElement("div"), k = T.dataType === "run_error";
|
|
3071
|
+
if (w.className = k ? "pluno-pa-widget__error" : "pluno-pa-widget__status pluno-pa-widget__run-status", w.textContent = vn(
|
|
3072
|
+
T.content
|
|
3073
|
+
), k && T.securitySettingsUrl) {
|
|
3073
3074
|
const q = document.createElement("a");
|
|
3074
|
-
q.className = "pluno-pa-widget__error-retry", q.href =
|
|
3075
|
+
q.className = "pluno-pa-widget__error-retry", q.href = T.securitySettingsUrl, q.target = "_blank", q.rel = "noreferrer", q.textContent = "Security settings", w.appendChild(q);
|
|
3075
3076
|
}
|
|
3076
|
-
B(
|
|
3077
|
+
B(w), F = k ? w : null, G = k ? null : w, M();
|
|
3077
3078
|
}
|
|
3078
3079
|
continue;
|
|
3079
3080
|
}
|
|
3080
|
-
|
|
3081
|
-
const I = me(), ve =
|
|
3082
|
-
if (
|
|
3083
|
-
const
|
|
3084
|
-
B(
|
|
3081
|
+
T.role === "user" && M();
|
|
3082
|
+
const I = me(), ve = vn(T.content);
|
|
3083
|
+
if (T.role === "assistant" && !I) {
|
|
3084
|
+
const w = Qo(v());
|
|
3085
|
+
B(w), F = null, G = w;
|
|
3085
3086
|
}
|
|
3086
|
-
const oe =
|
|
3087
|
-
|
|
3087
|
+
const oe = zr(
|
|
3088
|
+
T,
|
|
3088
3089
|
ve,
|
|
3089
3090
|
h,
|
|
3090
3091
|
ge,
|
|
3091
|
-
|
|
3092
|
+
z
|
|
3092
3093
|
);
|
|
3093
|
-
B(oe), F = oe,
|
|
3094
|
+
B(oe), F = oe, G = null, T.role === "assistant" && M();
|
|
3094
3095
|
}
|
|
3095
|
-
const Ze = me(),
|
|
3096
|
-
if (r.isThinking && !
|
|
3096
|
+
const Ze = me(), Pe = W[W.length - 1]?.role === "assistant";
|
|
3097
|
+
if (r.isThinking && !Pe && !ut)
|
|
3097
3098
|
if (Ze) {
|
|
3098
3099
|
if (!he) {
|
|
3099
|
-
const
|
|
3100
|
-
B(
|
|
3100
|
+
const C = ct();
|
|
3101
|
+
B(C), F = null, G = C;
|
|
3101
3102
|
}
|
|
3102
3103
|
} else {
|
|
3103
|
-
const
|
|
3104
|
-
B(
|
|
3104
|
+
const C = yo(v());
|
|
3105
|
+
B(C), F = null, G = C;
|
|
3105
3106
|
}
|
|
3106
3107
|
if (r.lastError) {
|
|
3107
|
-
const
|
|
3108
|
-
|
|
3109
|
-
const
|
|
3110
|
-
if (
|
|
3108
|
+
const C = document.createElement("div");
|
|
3109
|
+
C.className = "pluno-pa-widget__error";
|
|
3110
|
+
const T = document.createElement("span");
|
|
3111
|
+
if (T.textContent = r.lastError, C.appendChild(T), r.lastErrorSecuritySettingsUrl) {
|
|
3111
3112
|
const I = document.createElement("a");
|
|
3112
|
-
I.className = "pluno-pa-widget__error-retry", I.href = r.lastErrorSecuritySettingsUrl, I.target = "_blank", I.rel = "noreferrer", I.textContent = "Security settings",
|
|
3113
|
+
I.className = "pluno-pa-widget__error-retry", I.href = r.lastErrorSecuritySettingsUrl, I.target = "_blank", I.rel = "noreferrer", I.textContent = "Security settings", C.appendChild(I);
|
|
3113
3114
|
}
|
|
3114
3115
|
if (r.lastErrorCode === "run_recovery_exhausted" || r.lastErrorCode === "transient_model_error" || r.lastErrorCode === "run_still_active" || r.lastErrorCode === "connection_failed") {
|
|
3115
3116
|
const I = document.createElement("button");
|
|
3116
3117
|
I.type = "button", I.className = "pluno-pa-widget__error-retry", I.textContent = "Try again", I.addEventListener(
|
|
3117
3118
|
"click",
|
|
3118
|
-
r.lastErrorCode === "connection_failed" ? m :
|
|
3119
|
-
),
|
|
3119
|
+
r.lastErrorCode === "connection_failed" ? m : D
|
|
3120
|
+
), C.appendChild(I);
|
|
3120
3121
|
}
|
|
3121
|
-
B(
|
|
3122
|
+
B(C), F = C, G = null;
|
|
3122
3123
|
}
|
|
3123
|
-
const
|
|
3124
|
-
if (
|
|
3125
|
-
const
|
|
3126
|
-
isDrafting:
|
|
3127
|
-
error:
|
|
3128
|
-
characterIconOptions:
|
|
3129
|
-
onDraft:
|
|
3130
|
-
onDismiss:
|
|
3131
|
-
onDisable:
|
|
3124
|
+
const Ie = P ? P.draftingCandidate ?? (r.isThinking ? null : Ni(ne)) : null;
|
|
3125
|
+
if (P && Ie && !P.dismissedCandidateIds.has(Ie.id)) {
|
|
3126
|
+
const C = qr(Ie, {
|
|
3127
|
+
isDrafting: P.draftingCandidate?.id === Ie.id,
|
|
3128
|
+
error: P.error,
|
|
3129
|
+
characterIconOptions: P.characterIconOptions,
|
|
3130
|
+
onDraft: P.onDraft,
|
|
3131
|
+
onDismiss: P.onDismiss,
|
|
3132
|
+
onDisable: P.onDisable
|
|
3132
3133
|
});
|
|
3133
|
-
B(
|
|
3134
|
+
B(C), P.onSeen(Ie), F = null, G = C;
|
|
3134
3135
|
}
|
|
3135
|
-
|
|
3136
|
+
M(), F?.classList.add(
|
|
3136
3137
|
"pluno-pa-widget__message--bottom-reserve"
|
|
3137
|
-
),
|
|
3138
|
+
), G?.classList.add(
|
|
3138
3139
|
"pluno-pa-widget__bottom-reserve-compact"
|
|
3139
|
-
), B(t),
|
|
3140
|
+
), B(t), Or(
|
|
3140
3141
|
h,
|
|
3141
3142
|
ge
|
|
3142
|
-
),
|
|
3143
|
+
), bo(e, Be), p ? pt(e, u) : e.scrollTop = Xe;
|
|
3143
3144
|
}
|
|
3144
|
-
function
|
|
3145
|
+
function Dr(e, t, n) {
|
|
3145
3146
|
const o = document.createElement("section");
|
|
3146
3147
|
o.className = "pluno-pa-widget__integration-auth-card", o.setAttribute("aria-label", `Connect ${e.appName}`);
|
|
3147
3148
|
const i = document.createElement("div");
|
|
3148
3149
|
if (i.className = "pluno-pa-widget__integration-auth-header", e.appLogo) {
|
|
3149
|
-
const
|
|
3150
|
-
|
|
3150
|
+
const u = document.createElement("img");
|
|
3151
|
+
u.className = "pluno-pa-widget__integration-auth-logo", u.src = e.appLogo, u.alt = "", i.appendChild(u);
|
|
3151
3152
|
}
|
|
3152
3153
|
const r = document.createElement("div"), l = document.createElement("strong");
|
|
3153
3154
|
l.textContent = `Connect ${e.appName}`;
|
|
3154
|
-
const
|
|
3155
|
-
if (
|
|
3156
|
-
const
|
|
3157
|
-
|
|
3155
|
+
const s = document.createElement("span");
|
|
3156
|
+
if (s.textContent = "Authenticate in this browser so Pluno can continue your task.", r.append(l, s), i.appendChild(r), o.appendChild(i), t.error) {
|
|
3157
|
+
const u = document.createElement("div");
|
|
3158
|
+
u.className = "pluno-pa-widget__integration-auth-error", u.textContent = t.error, o.appendChild(u);
|
|
3158
3159
|
}
|
|
3159
|
-
const
|
|
3160
|
-
return
|
|
3160
|
+
const p = document.createElement("button");
|
|
3161
|
+
return p.type = "button", p.className = "pluno-pa-widget__integration-auth-button", p.disabled = t.status === "checking" || t.status === "connecting" || t.status === "completed", t.status === "checking" ? p.textContent = "Checking connection..." : t.status === "connecting" ? p.textContent = "Connecting..." : t.status === "completed" ? p.textContent = "Connected" : t.status === "expired" || t.status === "cancelled" ? p.textContent = `Reconnect ${e.appName}` : t.status === "error" ? p.textContent = "Try again" : p.textContent = `Connect ${e.appName}`, p.addEventListener("click", () => n(e)), o.appendChild(p), o;
|
|
3161
3162
|
}
|
|
3162
|
-
function
|
|
3163
|
-
const r =
|
|
3163
|
+
function zr(e, t, n, o, i) {
|
|
3164
|
+
const r = Mr(e, t), l = r ? n.get(r) : void 0;
|
|
3164
3165
|
if (r && l)
|
|
3165
3166
|
return l.classList.remove(
|
|
3166
3167
|
"pluno-pa-widget__message--bottom-reserve"
|
|
3167
3168
|
), o.add(r), l;
|
|
3168
|
-
const
|
|
3169
|
-
if (
|
|
3170
|
-
|
|
3169
|
+
const s = document.createElement("div");
|
|
3170
|
+
if (s.className = `pluno-pa-widget__message pluno-pa-widget__message--${e.role}`, e.role === "assistant" ? (e.phase && (s.dataset.phase = e.phase), nl(s, t)) : s.textContent = t, e.role === "user" && e.attachments?.length && s.appendChild(
|
|
3171
|
+
$r(
|
|
3171
3172
|
e.attachments,
|
|
3172
3173
|
i
|
|
3173
3174
|
)
|
|
3174
3175
|
), e.phase !== "commentary") {
|
|
3175
|
-
const
|
|
3176
|
-
|
|
3176
|
+
const p = document.createElement("div");
|
|
3177
|
+
p.className = "pluno-pa-widget__message-actions", p.appendChild(Gr(t)), s.appendChild(p);
|
|
3177
3178
|
}
|
|
3178
|
-
return r && (n.set(r,
|
|
3179
|
+
return r && (n.set(r, s), o.add(r)), s;
|
|
3179
3180
|
}
|
|
3180
|
-
function
|
|
3181
|
+
function Mr(e, t) {
|
|
3181
3182
|
return e.role !== "user" || !e.attachments?.length ? null : JSON.stringify({
|
|
3182
3183
|
id: e.id,
|
|
3183
3184
|
content: t,
|
|
@@ -3195,11 +3196,11 @@ function zr(e, t) {
|
|
|
3195
3196
|
})
|
|
3196
3197
|
});
|
|
3197
3198
|
}
|
|
3198
|
-
function
|
|
3199
|
+
function Or(e, t) {
|
|
3199
3200
|
for (const n of e.keys())
|
|
3200
3201
|
t.has(n) || e.delete(n);
|
|
3201
3202
|
}
|
|
3202
|
-
function
|
|
3203
|
+
function bo(e, t) {
|
|
3203
3204
|
let n = e.firstChild;
|
|
3204
3205
|
for (const o of t) {
|
|
3205
3206
|
if (o === n) {
|
|
@@ -3213,7 +3214,7 @@ function wo(e, t) {
|
|
|
3213
3214
|
n = n.nextSibling, e.removeChild(o);
|
|
3214
3215
|
}
|
|
3215
3216
|
}
|
|
3216
|
-
function
|
|
3217
|
+
function Ur(e) {
|
|
3217
3218
|
if (!e.assistantDraft)
|
|
3218
3219
|
return [...e.messages];
|
|
3219
3220
|
const t = {
|
|
@@ -3234,7 +3235,7 @@ function Or(e) {
|
|
|
3234
3235
|
if (n === -1)
|
|
3235
3236
|
return [...e.messages, t];
|
|
3236
3237
|
const o = e.messages.findIndex(
|
|
3237
|
-
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3238
|
+
(r, l) => l > n && r.role !== "user" && r.respondsToUserMessageId === t.respondsToUserMessageId && _o(r, t) && yn(r)
|
|
3238
3239
|
);
|
|
3239
3240
|
if (o !== -1)
|
|
3240
3241
|
return [
|
|
@@ -3243,7 +3244,7 @@ function Or(e) {
|
|
|
3243
3244
|
...e.messages.slice(o + 1)
|
|
3244
3245
|
];
|
|
3245
3246
|
let i = n + 1;
|
|
3246
|
-
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId &&
|
|
3247
|
+
for (; i < e.messages.length && e.messages[i].role !== "user" && e.messages[i].respondsToUserMessageId === t.respondsToUserMessageId && _o(e.messages[i], t); )
|
|
3247
3248
|
i += 1;
|
|
3248
3249
|
return [
|
|
3249
3250
|
...e.messages.slice(0, i),
|
|
@@ -3251,77 +3252,77 @@ function Or(e) {
|
|
|
3251
3252
|
...e.messages.slice(i)
|
|
3252
3253
|
];
|
|
3253
3254
|
}
|
|
3254
|
-
function
|
|
3255
|
+
function Br(e) {
|
|
3255
3256
|
return e.map(
|
|
3256
3257
|
(t) => t.role === "assistant" && t.phase === "commentary" ? { ...t, role: "tool" } : t
|
|
3257
3258
|
);
|
|
3258
3259
|
}
|
|
3259
|
-
function
|
|
3260
|
+
function Fr(e) {
|
|
3260
3261
|
const t = [...e].reverse().find((n) => n.role === "user");
|
|
3261
3262
|
for (let n = e.length - 1; n >= 0; n -= 1) {
|
|
3262
3263
|
const o = e[n];
|
|
3263
3264
|
if (!(o.role !== "tool" || e.slice(n + 1).some(
|
|
3264
|
-
(r) => (
|
|
3265
|
+
(r) => (Wr(r) || Hr(r)) && Xo(o, r)
|
|
3265
3266
|
)) && (o.loading || o.dataType === "assistant_draft" || t && o.respondsToUserMessageId === t.id))
|
|
3266
3267
|
return o;
|
|
3267
3268
|
}
|
|
3268
3269
|
return null;
|
|
3269
3270
|
}
|
|
3270
|
-
function
|
|
3271
|
+
function Wr(e) {
|
|
3271
3272
|
return e.role === "assistant" && e.phase !== "commentary";
|
|
3272
3273
|
}
|
|
3273
|
-
function
|
|
3274
|
+
function Hr(e) {
|
|
3274
3275
|
return e.role === "system" && (e.dataType === "run_error" || e.dataType === "run_status" && e.loading !== !0);
|
|
3275
3276
|
}
|
|
3276
|
-
function
|
|
3277
|
+
function Xo(e, t) {
|
|
3277
3278
|
return e.respondsToUserMessageId && t.respondsToUserMessageId ? e.respondsToUserMessageId === t.respondsToUserMessageId : e.runId && t.runId ? e.runId === t.runId : e.id === t.id;
|
|
3278
3279
|
}
|
|
3279
|
-
function
|
|
3280
|
+
function yn(e) {
|
|
3280
3281
|
return e.role === "system" && e.dataType === "run_status" && e.loading === !0;
|
|
3281
3282
|
}
|
|
3282
|
-
function
|
|
3283
|
+
function _o(e, t) {
|
|
3283
3284
|
return !e.runId || !t.runId ? !0 : e.runId === t.runId;
|
|
3284
3285
|
}
|
|
3285
|
-
function
|
|
3286
|
-
e.replaceChildren(),
|
|
3287
|
-
const
|
|
3288
|
-
|
|
3289
|
-
const
|
|
3286
|
+
function xo(e, t, n, o, i, r, l, s) {
|
|
3287
|
+
e.replaceChildren(), ti(t, !1), t.disabled = !0, n(!1);
|
|
3288
|
+
const p = document.createElement("div");
|
|
3289
|
+
p.className = "pluno-pa-widget__empty-state pluno-pa-widget__empty-state--starter";
|
|
3290
|
+
const u = Le(
|
|
3290
3291
|
"pluno-pa-widget__character--empty",
|
|
3291
3292
|
o()
|
|
3292
3293
|
);
|
|
3293
|
-
|
|
3294
|
-
const
|
|
3295
|
-
if (
|
|
3294
|
+
p.appendChild(u);
|
|
3295
|
+
const g = document.createElement("div");
|
|
3296
|
+
if (g.className = "pluno-pa-widget__empty", g.textContent = i, p.appendChild(g), l) {
|
|
3296
3297
|
const h = document.createElement("a");
|
|
3297
|
-
h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r,
|
|
3298
|
+
h.className = "pluno-pa-widget__login", h.href = l, h.target = "_blank", h.rel = "noopener noreferrer", h.textContent = r, p.appendChild(h);
|
|
3298
3299
|
} else {
|
|
3299
3300
|
const h = document.createElement("button");
|
|
3300
|
-
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () =>
|
|
3301
|
+
h.type = "button", h.className = "pluno-pa-widget__login", h.textContent = r, h.addEventListener("click", () => s?.()), p.appendChild(h);
|
|
3301
3302
|
}
|
|
3302
|
-
e.appendChild(
|
|
3303
|
+
e.appendChild(p);
|
|
3303
3304
|
}
|
|
3304
|
-
function
|
|
3305
|
+
function $r(e, t) {
|
|
3305
3306
|
const n = document.createElement("div");
|
|
3306
3307
|
n.className = "pluno-pa-widget__message-attachments";
|
|
3307
3308
|
for (const o of e)
|
|
3308
3309
|
n.appendChild(
|
|
3309
|
-
|
|
3310
|
+
Er(o, t)
|
|
3310
3311
|
);
|
|
3311
3312
|
return n;
|
|
3312
3313
|
}
|
|
3313
3314
|
function Gr(e) {
|
|
3314
3315
|
const t = document.createElement("button");
|
|
3315
|
-
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(
|
|
3316
|
+
return t.type = "button", t.className = "pluno-pa-widget__message-copy", t.setAttribute("aria-label", "Copy message"), t.title = "Copy message", t.appendChild(vr()), t.addEventListener("click", (n) => {
|
|
3316
3317
|
n.preventDefault(), n.stopPropagation(), navigator.clipboard.writeText(e);
|
|
3317
3318
|
}), t;
|
|
3318
3319
|
}
|
|
3319
|
-
function
|
|
3320
|
+
function qr(e, t) {
|
|
3320
3321
|
const n = document.createElement("article");
|
|
3321
3322
|
n.className = "pluno-pa-widget__share-prompt";
|
|
3322
3323
|
const o = document.createElement("div");
|
|
3323
3324
|
o.className = "pluno-pa-widget__share-prompt-body", o.appendChild(
|
|
3324
|
-
|
|
3325
|
+
Le(
|
|
3325
3326
|
"pluno-pa-widget__share-prompt-icon",
|
|
3326
3327
|
t.characterIconOptions
|
|
3327
3328
|
)
|
|
@@ -3332,32 +3333,32 @@ function $r(e, t) {
|
|
|
3332
3333
|
r.textContent = "Share this win?", i.appendChild(r);
|
|
3333
3334
|
const l = document.createElement("span");
|
|
3334
3335
|
if (l.textContent = t.isDrafting ? "Drafting social post..." : "Create a screenshot and generate a draft for a social post.", i.appendChild(l), t.error) {
|
|
3335
|
-
const
|
|
3336
|
-
|
|
3336
|
+
const g = document.createElement("span");
|
|
3337
|
+
g.className = "pluno-pa-widget__share-prompt-error", g.textContent = t.error, i.appendChild(g);
|
|
3337
3338
|
}
|
|
3338
3339
|
o.appendChild(i);
|
|
3339
|
-
const p = document.createElement("div");
|
|
3340
|
-
p.className = "pluno-pa-widget__share-prompt-actions";
|
|
3341
3340
|
const s = document.createElement("div");
|
|
3342
|
-
s.className = "pluno-pa-widget__share-prompt-
|
|
3343
|
-
const
|
|
3344
|
-
|
|
3341
|
+
s.className = "pluno-pa-widget__share-prompt-actions";
|
|
3342
|
+
const p = document.createElement("div");
|
|
3343
|
+
p.className = "pluno-pa-widget__share-prompt-primary-actions";
|
|
3344
|
+
const u = document.createElement("button");
|
|
3345
|
+
if (u.type = "button", u.className = "pluno-pa-widget__share-prompt-draft", u.disabled = t.isDrafting, u.addEventListener("click", () => {
|
|
3345
3346
|
t.onDraft(e);
|
|
3346
|
-
}), t.isDrafting ? (
|
|
3347
|
-
|
|
3347
|
+
}), t.isDrafting ? (u.appendChild(ei()), u.appendChild(document.createTextNode("Drafting..."))) : u.textContent = "Draft a social post", p.appendChild(u), t.isDrafting)
|
|
3348
|
+
s.appendChild(p);
|
|
3348
3349
|
else {
|
|
3349
|
-
const
|
|
3350
|
-
|
|
3350
|
+
const g = document.createElement("button");
|
|
3351
|
+
g.type = "button", g.className = "pluno-pa-widget__share-prompt-dismiss", g.setAttribute("aria-label", "Dismiss share prompt"), g.title = "Dismiss", g.textContent = "Dismiss", g.addEventListener("click", () => {
|
|
3351
3352
|
t.onDismiss(e);
|
|
3352
|
-
}),
|
|
3353
|
+
}), p.appendChild(g), s.appendChild(p);
|
|
3353
3354
|
const h = document.createElement("button");
|
|
3354
3355
|
h.type = "button", h.className = "pluno-pa-widget__share-prompt-disable", h.textContent = "Don't ask again", h.addEventListener("click", () => {
|
|
3355
3356
|
t.onDisable(e);
|
|
3356
|
-
}),
|
|
3357
|
+
}), s.appendChild(h);
|
|
3357
3358
|
}
|
|
3358
|
-
return o.appendChild(
|
|
3359
|
+
return o.appendChild(s), n.appendChild(o), n;
|
|
3359
3360
|
}
|
|
3360
|
-
function
|
|
3361
|
+
function jr(e, t) {
|
|
3361
3362
|
const n = document.createElement("div");
|
|
3362
3363
|
n.className = "pluno-pa-widget__share-dialog-backdrop", n.addEventListener("click", (c) => {
|
|
3363
3364
|
c.target === n && t.onClose();
|
|
@@ -3368,54 +3369,54 @@ function qr(e, t) {
|
|
|
3368
3369
|
r.textContent = "Share this win", i.appendChild(r);
|
|
3369
3370
|
const l = document.createElement("button");
|
|
3370
3371
|
l.type = "button", l.className = "pluno-pa-widget__share-dialog-close", l.setAttribute("aria-label", "Close"), l.textContent = "×", l.addEventListener("click", t.onClose), i.appendChild(l), o.appendChild(i);
|
|
3371
|
-
const
|
|
3372
|
-
|
|
3373
|
-
const
|
|
3374
|
-
|
|
3375
|
-
const
|
|
3376
|
-
|
|
3377
|
-
const
|
|
3378
|
-
|
|
3379
|
-
const h =
|
|
3372
|
+
const s = document.createElement("p");
|
|
3373
|
+
s.className = "pluno-pa-widget__share-dialog-status", s.hidden = !0;
|
|
3374
|
+
const p = document.createElement("div");
|
|
3375
|
+
p.className = "pluno-pa-widget__share-dialog-step";
|
|
3376
|
+
const u = document.createElement("div");
|
|
3377
|
+
u.className = "pluno-pa-widget__share-dialog-step-header";
|
|
3378
|
+
const g = document.createElement("strong");
|
|
3379
|
+
g.textContent = "1) Copy Screenshot", u.appendChild(g);
|
|
3380
|
+
const h = Kr(
|
|
3380
3381
|
"Copy Screenshot",
|
|
3381
3382
|
async () => {
|
|
3382
3383
|
try {
|
|
3383
|
-
return await
|
|
3384
|
+
return await Ri(e.screenshotDataUrl ?? ""), s.textContent = "", s.hidden = !0, !0;
|
|
3384
3385
|
} catch {
|
|
3385
|
-
return
|
|
3386
|
+
return s.textContent = "Could not copy screenshot.", s.hidden = !1, !1;
|
|
3386
3387
|
}
|
|
3387
3388
|
}
|
|
3388
3389
|
);
|
|
3389
|
-
if (
|
|
3390
|
+
if (u.appendChild(h), p.appendChild(u), e.screenshotDataUrl) {
|
|
3390
3391
|
const c = document.createElement("div");
|
|
3391
3392
|
c.className = "pluno-pa-widget__share-dialog-screenshot";
|
|
3392
|
-
const
|
|
3393
|
-
|
|
3393
|
+
const E = document.createElement("img");
|
|
3394
|
+
E.src = e.screenshotDataUrl, E.alt = "Product page with Pluno open", c.appendChild(E), p.appendChild(c);
|
|
3394
3395
|
}
|
|
3395
|
-
o.appendChild(
|
|
3396
|
-
const
|
|
3397
|
-
|
|
3398
|
-
const
|
|
3399
|
-
|
|
3400
|
-
const
|
|
3401
|
-
|
|
3402
|
-
const
|
|
3403
|
-
|
|
3396
|
+
o.appendChild(p), o.appendChild(s);
|
|
3397
|
+
const x = document.createElement("div");
|
|
3398
|
+
x.className = "pluno-pa-widget__share-dialog-step";
|
|
3399
|
+
const v = document.createElement("strong");
|
|
3400
|
+
v.className = "pluno-pa-widget__share-dialog-step-title", v.textContent = "2) Share on", x.appendChild(v);
|
|
3401
|
+
const L = document.createElement("p");
|
|
3402
|
+
L.className = "pluno-pa-widget__share-dialog-hint", L.textContent = "Post draft opens prefilled on supported platforms.", x.appendChild(L);
|
|
3403
|
+
const D = document.createElement("footer");
|
|
3404
|
+
D.className = "pluno-pa-widget__share-dialog-platforms";
|
|
3404
3405
|
for (const c of Vr(e)) {
|
|
3405
|
-
const
|
|
3406
|
-
|
|
3406
|
+
const E = document.createElement("a");
|
|
3407
|
+
E.href = c.href, E.target = "_blank", E.rel = "noopener noreferrer", E.title = c.label, E.setAttribute("aria-label", `Open ${c.label}`), E.appendChild(Yr(c.id)), D.appendChild(E);
|
|
3407
3408
|
}
|
|
3408
|
-
if (
|
|
3409
|
+
if (x.appendChild(D), o.appendChild(x), t.socialPostRewardsUrl) {
|
|
3409
3410
|
const c = document.createElement("div");
|
|
3410
3411
|
c.className = "pluno-pa-widget__share-dialog-step";
|
|
3411
|
-
const
|
|
3412
|
-
|
|
3412
|
+
const E = document.createElement("strong");
|
|
3413
|
+
E.className = "pluno-pa-widget__share-dialog-step-title", E.textContent = "3) Submit post to get 2000 free credits!", c.appendChild(E);
|
|
3413
3414
|
const m = document.createElement("a");
|
|
3414
|
-
m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(
|
|
3415
|
+
m.className = "pluno-pa-widget__share-dialog-reward-link", m.href = t.socialPostRewardsUrl, m.target = "_blank", m.rel = "noopener noreferrer", m.appendChild(document.createTextNode("Submit post URL")), m.appendChild(Xr()), c.appendChild(m), o.appendChild(c);
|
|
3415
3416
|
}
|
|
3416
3417
|
return n.appendChild(o), n;
|
|
3417
3418
|
}
|
|
3418
|
-
function
|
|
3419
|
+
function Kr(e, t) {
|
|
3419
3420
|
const n = document.createElement("button");
|
|
3420
3421
|
return n.type = "button", n.className = "pluno-pa-widget__share-dialog-copy", n.textContent = e, n.addEventListener("click", async (o) => {
|
|
3421
3422
|
o.preventDefault(), o.stopPropagation(), await t() && (n.textContent = "Copied ✓");
|
|
@@ -3441,75 +3442,75 @@ function Vr(e) {
|
|
|
3441
3442
|
}
|
|
3442
3443
|
];
|
|
3443
3444
|
}
|
|
3444
|
-
function
|
|
3445
|
+
function Yr(e) {
|
|
3445
3446
|
const t = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3446
|
-
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" ? (
|
|
3447
|
+
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" ? (K(t, "M6.7 13.2c.4 4.1.2 8.1.1 12.3"), K(
|
|
3447
3448
|
t,
|
|
3448
3449
|
"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"
|
|
3449
|
-
),
|
|
3450
|
+
), K(t, "M14.4 13.3c.1 3.8.1 7.8 0 11.9"), K(
|
|
3450
3451
|
t,
|
|
3451
3452
|
"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"
|
|
3452
|
-
),
|
|
3453
|
+
), K(t, "M20 18c.1 2.2.1 4.7 0 7.2"), t) : e === "x" ? (K(t, "M7.2 7.4c5.6 6.4 10.9 12.2 17.7 17.2"), K(t, "M24.4 7.2c-5.1 6.3-10.6 11.8-17 17.8"), K(t, "M9.1 8.2c5.1 5.6 9.7 10.8 15 15.5", "0.55"), t) : (K(
|
|
3453
3454
|
t,
|
|
3454
3455
|
"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"
|
|
3455
|
-
),
|
|
3456
|
+
), K(
|
|
3456
3457
|
t,
|
|
3457
3458
|
"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",
|
|
3458
3459
|
"0.48"
|
|
3459
|
-
),
|
|
3460
|
+
), K(
|
|
3460
3461
|
t,
|
|
3461
3462
|
"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"
|
|
3462
|
-
),
|
|
3463
|
+
), K(
|
|
3463
3464
|
t,
|
|
3464
3465
|
"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"
|
|
3465
3466
|
), t);
|
|
3466
3467
|
}
|
|
3467
|
-
function
|
|
3468
|
+
function K(e, t, n) {
|
|
3468
3469
|
const o = document.createElementNS("http://www.w3.org/2000/svg", "path");
|
|
3469
3470
|
o.setAttribute("d", t), n && o.setAttribute("opacity", n), e.appendChild(o);
|
|
3470
3471
|
}
|
|
3471
|
-
function
|
|
3472
|
+
function Xr() {
|
|
3472
3473
|
const e = document.createElementNS("http://www.w3.org/2000/svg", "svg");
|
|
3473
|
-
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"),
|
|
3474
|
+
return e.setAttribute("class", "pluno-pa-widget__share-dialog-external-icon"), e.setAttribute("viewBox", "0 0 24 24"), e.setAttribute("aria-hidden", "true"), K(e, "M14 5h5v5"), K(e, "M19 5l-8 8"), K(
|
|
3474
3475
|
e,
|
|
3475
3476
|
"M18 13v5a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1h5"
|
|
3476
3477
|
), e;
|
|
3477
3478
|
}
|
|
3478
|
-
function
|
|
3479
|
-
return e.role === "tool" && e.toolName ===
|
|
3479
|
+
function Zo(e) {
|
|
3480
|
+
return e.role === "tool" && e.toolName === Ao;
|
|
3480
3481
|
}
|
|
3481
|
-
function
|
|
3482
|
+
function vn(e) {
|
|
3482
3483
|
return e.replace(/\uE200[^\uE201]*(?:\uE201|$)/g, "");
|
|
3483
3484
|
}
|
|
3484
|
-
function
|
|
3485
|
+
function Zr(e, t, n, o, i) {
|
|
3485
3486
|
const r = document.createElement("article");
|
|
3486
3487
|
r.className = "pluno-pa-widget__tool-group", r.classList.toggle("pluno-pa-widget__tool-group--active", t), r.title = new Date(
|
|
3487
3488
|
e[e.length - 1].createdAt
|
|
3488
3489
|
).toLocaleString(), r.appendChild(
|
|
3489
|
-
|
|
3490
|
+
Le(
|
|
3490
3491
|
"pluno-pa-widget__character--tool-group",
|
|
3491
3492
|
i
|
|
3492
3493
|
)
|
|
3493
3494
|
);
|
|
3494
|
-
const l =
|
|
3495
|
+
const l = Jr(e, t);
|
|
3495
3496
|
if (t) {
|
|
3496
|
-
const
|
|
3497
|
-
return
|
|
3497
|
+
const v = document.createElement("div");
|
|
3498
|
+
return v.className = "pluno-pa-widget__tool-active-content", v.appendChild(ct()), v.appendChild(l), r.appendChild(v), r;
|
|
3498
3499
|
}
|
|
3499
|
-
const
|
|
3500
|
-
|
|
3501
|
-
r.classList.toggle("pluno-pa-widget__tool-group--open",
|
|
3500
|
+
const s = document.createElement("details"), p = Qr(e);
|
|
3501
|
+
s.open = n.has(p), r.classList.toggle("pluno-pa-widget__tool-group--open", s.open), s.addEventListener("toggle", () => {
|
|
3502
|
+
r.classList.toggle("pluno-pa-widget__tool-group--open", s.open), s.open ? n.add(p) : n.delete(p), o();
|
|
3502
3503
|
});
|
|
3503
|
-
const
|
|
3504
|
-
|
|
3505
|
-
const
|
|
3504
|
+
const u = document.createElement("summary");
|
|
3505
|
+
u.className = "pluno-pa-widget__tool-summary";
|
|
3506
|
+
const g = [...e].reverse().find((v) => v.phase !== "commentary");
|
|
3506
3507
|
e.some(
|
|
3507
|
-
(
|
|
3508
|
-
) &&
|
|
3509
|
-
const
|
|
3510
|
-
return
|
|
3508
|
+
(v) => v.phase !== "commentary" && v.loading
|
|
3509
|
+
) && u.appendChild(ei());
|
|
3510
|
+
const x = document.createElement("span");
|
|
3511
|
+
return x.className = "pluno-pa-widget__tool-summary-title", x.textContent = g ? Jo(g.content) : "Activity", u.appendChild(x), s.appendChild(u), s.appendChild(l), r.appendChild(s), r;
|
|
3511
3512
|
}
|
|
3512
|
-
function
|
|
3513
|
+
function Jr(e, t) {
|
|
3513
3514
|
const n = document.createElement("div");
|
|
3514
3515
|
n.className = "pluno-pa-widget__tool-lines";
|
|
3515
3516
|
const o = e[e.length - 1];
|
|
@@ -3518,26 +3519,26 @@ function Zr(e, t) {
|
|
|
3518
3519
|
r.className = "pluno-pa-widget__tool-line", r.dataset.eventType = i.phase === "commentary" ? "commentary" : "tool";
|
|
3519
3520
|
const l = document.createElement("span");
|
|
3520
3521
|
l.className = "pluno-pa-widget__tool-line-text";
|
|
3521
|
-
const
|
|
3522
|
-
t && i === o && i.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText =
|
|
3522
|
+
const s = vn(i.content) || (i.phase === "commentary" ? "" : "Run tool"), p = i.phase === "commentary" ? s : Jo(s);
|
|
3523
|
+
t && i === o && i.phase !== "commentary" && (l.classList.add("pluno-pa-widget__tool-line-text--loading"), l.dataset.loadingText = p), l.textContent = p, r.appendChild(l), n.appendChild(r);
|
|
3523
3524
|
}
|
|
3524
3525
|
return n;
|
|
3525
3526
|
}
|
|
3526
|
-
function
|
|
3527
|
+
function Jo(e) {
|
|
3527
3528
|
const t = e.trim() || "Run tool", n = t.codePointAt(0) ?? 0;
|
|
3528
3529
|
return n >= 126976 && n <= 129791 || n >= 9728 && n <= 10175 || n >= 127462 && n <= 127487 ? t : `🛠️ ${t}`;
|
|
3529
3530
|
}
|
|
3530
|
-
function
|
|
3531
|
+
function Qo(e) {
|
|
3531
3532
|
const t = document.createElement("article");
|
|
3532
3533
|
return t.className = "pluno-pa-widget__tool-group pluno-pa-widget__assistant-marker", t.appendChild(
|
|
3533
|
-
|
|
3534
|
+
Le(
|
|
3534
3535
|
"pluno-pa-widget__character--tool-group",
|
|
3535
3536
|
e
|
|
3536
3537
|
)
|
|
3537
3538
|
), t;
|
|
3538
3539
|
}
|
|
3539
|
-
function
|
|
3540
|
-
const t =
|
|
3540
|
+
function yo(e) {
|
|
3541
|
+
const t = Qo(e);
|
|
3541
3542
|
return t.classList.add("pluno-pa-widget__thinking-marker"), t.appendChild(ct()), t;
|
|
3542
3543
|
}
|
|
3543
3544
|
function ct(e = "Thinking...") {
|
|
@@ -3548,18 +3549,68 @@ function ct(e = "Thinking...") {
|
|
|
3548
3549
|
const o = document.createElement("span");
|
|
3549
3550
|
return o.textContent = e, t.appendChild(o), t;
|
|
3550
3551
|
}
|
|
3551
|
-
function
|
|
3552
|
+
function Qr(e) {
|
|
3552
3553
|
return `tools:${e[0]?.id ?? ""}`;
|
|
3553
3554
|
}
|
|
3554
|
-
function
|
|
3555
|
+
function ei() {
|
|
3555
3556
|
const e = document.createElement("span");
|
|
3556
3557
|
return e.className = "pluno-pa-widget__spinner", e.setAttribute("aria-hidden", "true"), e;
|
|
3557
3558
|
}
|
|
3558
|
-
function
|
|
3559
|
-
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ?
|
|
3559
|
+
function ti(e, t) {
|
|
3560
|
+
e.setAttribute("aria-label", t ? "Stop" : "Send"), e.classList.toggle("pluno-pa-widget__send--stop", t), e.replaceChildren(t ? xr() : jo());
|
|
3561
|
+
}
|
|
3562
|
+
function dn(e) {
|
|
3563
|
+
let t = e.trim();
|
|
3564
|
+
if (!t.includes("|"))
|
|
3565
|
+
return null;
|
|
3566
|
+
t.startsWith("|") && (t = t.slice(1)), t.endsWith("|") && !t.endsWith("\\|") && (t = t.slice(0, -1));
|
|
3567
|
+
const n = [];
|
|
3568
|
+
let o = "";
|
|
3569
|
+
for (let i = 0; i < t.length; i += 1) {
|
|
3570
|
+
const r = t[i];
|
|
3571
|
+
r === "\\" && t[i + 1] === "|" ? (o += "|", i += 1) : r === "|" ? (n.push(o.trim()), o = "") : o += r;
|
|
3572
|
+
}
|
|
3573
|
+
return n.push(o.trim()), n.length > 1 ? n : null;
|
|
3560
3574
|
}
|
|
3561
|
-
function
|
|
3562
|
-
const
|
|
3575
|
+
function el(e) {
|
|
3576
|
+
const t = e.trim();
|
|
3577
|
+
if (/^:?-{3,}:?$/.test(t))
|
|
3578
|
+
return t.startsWith(":") && t.endsWith(":") ? "center" : t.endsWith(":") ? "right" : t.startsWith(":") ? "left" : null;
|
|
3579
|
+
}
|
|
3580
|
+
function tl(e, t) {
|
|
3581
|
+
const n = dn(e[t] ?? ""), o = dn(e[t + 1] ?? "");
|
|
3582
|
+
if (!n || !o || n.length !== o.length)
|
|
3583
|
+
return null;
|
|
3584
|
+
const i = [];
|
|
3585
|
+
for (const h of o) {
|
|
3586
|
+
const x = el(h);
|
|
3587
|
+
if (x === void 0)
|
|
3588
|
+
return null;
|
|
3589
|
+
i.push(x);
|
|
3590
|
+
}
|
|
3591
|
+
const r = document.createElement("div");
|
|
3592
|
+
r.className = "pluno-pa-widget__table-scroll";
|
|
3593
|
+
const l = document.createElement("table"), s = document.createElement("thead"), p = document.createElement("tr");
|
|
3594
|
+
n.forEach((h, x) => {
|
|
3595
|
+
const v = document.createElement("th"), L = i[x];
|
|
3596
|
+
L && v.classList.add(`pluno-pa-widget__table-cell--${L}`), ke(v, h), p.appendChild(v);
|
|
3597
|
+
}), s.appendChild(p), l.appendChild(s);
|
|
3598
|
+
const u = document.createElement("tbody");
|
|
3599
|
+
let g = t + 2;
|
|
3600
|
+
for (; g < e.length && e[g].trim(); ) {
|
|
3601
|
+
const h = dn(e[g]);
|
|
3602
|
+
if (!h)
|
|
3603
|
+
break;
|
|
3604
|
+
const x = document.createElement("tr");
|
|
3605
|
+
n.forEach((v, L) => {
|
|
3606
|
+
const D = document.createElement("td"), c = i[L];
|
|
3607
|
+
c && D.classList.add(`pluno-pa-widget__table-cell--${c}`), ke(D, h[L] ?? ""), x.appendChild(D);
|
|
3608
|
+
}), u.appendChild(x), g += 1;
|
|
3609
|
+
}
|
|
3610
|
+
return l.appendChild(u), r.appendChild(l), { element: r, nextIndex: g };
|
|
3611
|
+
}
|
|
3612
|
+
function nl(e, t) {
|
|
3613
|
+
const n = Qi(t).replace(/\r\n/g, `
|
|
3563
3614
|
`).split(`
|
|
3564
3615
|
`);
|
|
3565
3616
|
let o = 0;
|
|
@@ -3570,50 +3621,55 @@ function Qr(e, t) {
|
|
|
3570
3621
|
continue;
|
|
3571
3622
|
}
|
|
3572
3623
|
if (i.match(/^```(\w+)?\s*$/)) {
|
|
3573
|
-
const
|
|
3624
|
+
const h = [];
|
|
3574
3625
|
for (o += 1; o < n.length && !/^```\s*$/.test(n[o]); )
|
|
3575
|
-
|
|
3626
|
+
h.push(n[o]), o += 1;
|
|
3576
3627
|
o += o < n.length ? 1 : 0;
|
|
3577
|
-
const
|
|
3578
|
-
|
|
3579
|
-
`),
|
|
3628
|
+
const x = document.createElement("pre"), v = document.createElement("code");
|
|
3629
|
+
v.textContent = h.join(`
|
|
3630
|
+
`), x.appendChild(v), e.appendChild(x);
|
|
3580
3631
|
continue;
|
|
3581
3632
|
}
|
|
3582
|
-
const l =
|
|
3633
|
+
const l = tl(n, o);
|
|
3583
3634
|
if (l) {
|
|
3584
|
-
|
|
3585
|
-
|
|
3635
|
+
e.appendChild(l.element), o = l.nextIndex;
|
|
3636
|
+
continue;
|
|
3637
|
+
}
|
|
3638
|
+
const s = i.match(/^(#{1,3})\s+(.+)$/);
|
|
3639
|
+
if (s) {
|
|
3640
|
+
const h = document.createElement(`h${s[1].length + 2}`);
|
|
3641
|
+
ke(h, s[2]), e.appendChild(h), o += 1;
|
|
3586
3642
|
continue;
|
|
3587
3643
|
}
|
|
3588
3644
|
if (/^\s*[-*+]\s+/.test(i)) {
|
|
3589
|
-
const
|
|
3645
|
+
const h = document.createElement("ul");
|
|
3590
3646
|
for (; o < n.length && /^\s*[-*+]\s+/.test(n[o]); ) {
|
|
3591
|
-
const
|
|
3592
|
-
|
|
3647
|
+
const x = document.createElement("li");
|
|
3648
|
+
ke(x, n[o].replace(/^\s*[-*+]\s+/, "")), h.appendChild(x), o += 1;
|
|
3593
3649
|
}
|
|
3594
|
-
e.appendChild(
|
|
3650
|
+
e.appendChild(h);
|
|
3595
3651
|
continue;
|
|
3596
3652
|
}
|
|
3597
3653
|
const p = i.match(/^\s*(\d+)\.\s+/);
|
|
3598
3654
|
if (p) {
|
|
3599
|
-
const
|
|
3600
|
-
for (
|
|
3601
|
-
const
|
|
3602
|
-
|
|
3655
|
+
const h = document.createElement("ol");
|
|
3656
|
+
for (h.start = Number(p[1]); o < n.length && /^\s*\d+\.\s+/.test(n[o]); ) {
|
|
3657
|
+
const x = document.createElement("li");
|
|
3658
|
+
ke(x, n[o].replace(/^\s*\d+\.\s+/, "")), h.appendChild(x), o += 1;
|
|
3603
3659
|
}
|
|
3604
|
-
e.appendChild(
|
|
3660
|
+
e.appendChild(h);
|
|
3605
3661
|
continue;
|
|
3606
3662
|
}
|
|
3607
|
-
const
|
|
3663
|
+
const u = [i];
|
|
3608
3664
|
for (o += 1; o < n.length && n[o].trim() && !/^```/.test(n[o]) && !/^(#{1,3})\s+/.test(n[o]) && !/^\s*[-*+]\s+/.test(n[o]) && !/^\s*\d+\.\s+/.test(n[o]); )
|
|
3609
|
-
|
|
3665
|
+
u.push(n[o]), o += 1;
|
|
3610
3666
|
const g = document.createElement("p");
|
|
3611
|
-
|
|
3612
|
-
|
|
3667
|
+
u.forEach((h, x) => {
|
|
3668
|
+
x > 0 && g.appendChild(document.createElement("br")), ke(g, h);
|
|
3613
3669
|
}), e.appendChild(g);
|
|
3614
3670
|
}
|
|
3615
3671
|
}
|
|
3616
|
-
function
|
|
3672
|
+
function ke(e, t) {
|
|
3617
3673
|
const n = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\(([^)\s]+)\))/g;
|
|
3618
3674
|
let o = 0;
|
|
3619
3675
|
for (const i of t.matchAll(n)) {
|
|
@@ -3623,19 +3679,19 @@ function Ye(e, t) {
|
|
|
3623
3679
|
);
|
|
3624
3680
|
const l = i[0];
|
|
3625
3681
|
if (l.startsWith("`")) {
|
|
3626
|
-
const
|
|
3627
|
-
|
|
3682
|
+
const s = document.createElement("code");
|
|
3683
|
+
s.textContent = l.slice(1, -1), e.appendChild(s);
|
|
3628
3684
|
} else if (l.startsWith("**")) {
|
|
3629
|
-
const
|
|
3630
|
-
|
|
3685
|
+
const s = document.createElement("strong");
|
|
3686
|
+
ke(s, l.slice(2, -2)), e.appendChild(s);
|
|
3631
3687
|
} else if (l.startsWith("*")) {
|
|
3632
|
-
const
|
|
3633
|
-
|
|
3688
|
+
const s = document.createElement("em");
|
|
3689
|
+
ke(s, l.slice(1, -1)), e.appendChild(s);
|
|
3634
3690
|
} else {
|
|
3635
|
-
const
|
|
3636
|
-
if (
|
|
3637
|
-
const
|
|
3638
|
-
|
|
3691
|
+
const s = l.match(/^\[([^\]]+)\]\(([^)\s]+)\)$/);
|
|
3692
|
+
if (s && ol(s[2])) {
|
|
3693
|
+
const p = document.createElement("a");
|
|
3694
|
+
p.href = s[2], p.target = "_top", p.rel = "noreferrer", p.textContent = s[1], e.appendChild(p);
|
|
3639
3695
|
} else
|
|
3640
3696
|
e.appendChild(document.createTextNode(l));
|
|
3641
3697
|
}
|
|
@@ -3643,7 +3699,7 @@ function Ye(e, t) {
|
|
|
3643
3699
|
}
|
|
3644
3700
|
o < t.length && e.appendChild(document.createTextNode(t.slice(o)));
|
|
3645
3701
|
}
|
|
3646
|
-
function
|
|
3702
|
+
function ol(e) {
|
|
3647
3703
|
if (e.startsWith("/") || e.startsWith("#"))
|
|
3648
3704
|
return !0;
|
|
3649
3705
|
try {
|
|
@@ -3653,8 +3709,8 @@ function el(e) {
|
|
|
3653
3709
|
return !1;
|
|
3654
3710
|
}
|
|
3655
3711
|
}
|
|
3656
|
-
function
|
|
3657
|
-
if (
|
|
3712
|
+
function vo(e, t) {
|
|
3713
|
+
if (il(e))
|
|
3658
3714
|
return;
|
|
3659
3715
|
const n = `
|
|
3660
3716
|
:host {
|
|
@@ -4384,23 +4440,27 @@ function yo(e, t) {
|
|
|
4384
4440
|
}
|
|
4385
4441
|
.pluno-pa-widget__timeline::-webkit-scrollbar,
|
|
4386
4442
|
.pluno-pa-widget__message--assistant pre::-webkit-scrollbar,
|
|
4443
|
+
.pluno-pa-widget__table-scroll::-webkit-scrollbar,
|
|
4387
4444
|
.pluno-pa-widget__input::-webkit-scrollbar {
|
|
4388
4445
|
width: 8px;
|
|
4389
4446
|
height: 8px;
|
|
4390
4447
|
}
|
|
4391
4448
|
.pluno-pa-widget__timeline::-webkit-scrollbar-track,
|
|
4392
4449
|
.pluno-pa-widget__message--assistant pre::-webkit-scrollbar-track,
|
|
4450
|
+
.pluno-pa-widget__table-scroll::-webkit-scrollbar-track,
|
|
4393
4451
|
.pluno-pa-widget__input::-webkit-scrollbar-track {
|
|
4394
4452
|
background: transparent;
|
|
4395
4453
|
}
|
|
4396
4454
|
.pluno-pa-widget__timeline::-webkit-scrollbar-thumb,
|
|
4397
4455
|
.pluno-pa-widget__message--assistant pre::-webkit-scrollbar-thumb,
|
|
4456
|
+
.pluno-pa-widget__table-scroll::-webkit-scrollbar-thumb,
|
|
4398
4457
|
.pluno-pa-widget__input::-webkit-scrollbar-thumb {
|
|
4399
4458
|
background: var(--pluno-pa-divider);
|
|
4400
4459
|
border-radius: 999px;
|
|
4401
4460
|
}
|
|
4402
4461
|
.pluno-pa-widget__timeline::-webkit-scrollbar-corner,
|
|
4403
4462
|
.pluno-pa-widget__message--assistant pre::-webkit-scrollbar-corner,
|
|
4463
|
+
.pluno-pa-widget__table-scroll::-webkit-scrollbar-corner,
|
|
4404
4464
|
.pluno-pa-widget__input::-webkit-scrollbar-corner {
|
|
4405
4465
|
background: transparent;
|
|
4406
4466
|
}
|
|
@@ -4677,6 +4737,43 @@ function yo(e, t) {
|
|
|
4677
4737
|
padding: 0;
|
|
4678
4738
|
white-space: pre-wrap;
|
|
4679
4739
|
}
|
|
4740
|
+
.pluno-pa-widget__table-scroll {
|
|
4741
|
+
width: 100%;
|
|
4742
|
+
margin: 0 0 10px;
|
|
4743
|
+
overflow-x: auto;
|
|
4744
|
+
user-select: text;
|
|
4745
|
+
scrollbar-color: var(--pluno-pa-divider) transparent;
|
|
4746
|
+
scrollbar-width: thin;
|
|
4747
|
+
}
|
|
4748
|
+
.pluno-pa-widget__table-scroll table {
|
|
4749
|
+
width: max-content;
|
|
4750
|
+
min-width: 100%;
|
|
4751
|
+
border-collapse: collapse;
|
|
4752
|
+
color: inherit;
|
|
4753
|
+
font-size: 12px;
|
|
4754
|
+
line-height: 1.4;
|
|
4755
|
+
white-space: normal;
|
|
4756
|
+
}
|
|
4757
|
+
.pluno-pa-widget__table-scroll th,
|
|
4758
|
+
.pluno-pa-widget__table-scroll td {
|
|
4759
|
+
padding: 7px 8px;
|
|
4760
|
+
border: 1px solid var(--pluno-pa-divider);
|
|
4761
|
+
text-align: left;
|
|
4762
|
+
vertical-align: top;
|
|
4763
|
+
white-space: normal;
|
|
4764
|
+
overflow-wrap: anywhere;
|
|
4765
|
+
user-select: text;
|
|
4766
|
+
}
|
|
4767
|
+
.pluno-pa-widget__table-scroll th {
|
|
4768
|
+
background: var(--pluno-pa-bubble);
|
|
4769
|
+
font-weight: 650;
|
|
4770
|
+
}
|
|
4771
|
+
.pluno-pa-widget__table-scroll .pluno-pa-widget__table-cell--center {
|
|
4772
|
+
text-align: center;
|
|
4773
|
+
}
|
|
4774
|
+
.pluno-pa-widget__table-scroll .pluno-pa-widget__table-cell--right {
|
|
4775
|
+
text-align: right;
|
|
4776
|
+
}
|
|
4680
4777
|
.pluno-pa-widget__message--assistant a {
|
|
4681
4778
|
color: var(--pluno-pa-accent);
|
|
4682
4779
|
text-decoration: none;
|
|
@@ -5772,8 +5869,8 @@ function yo(e, t) {
|
|
|
5772
5869
|
.pluno-pa-widget--scribble .pluno-pa-widget__scribble-spirals--panel {
|
|
5773
5870
|
position: absolute;
|
|
5774
5871
|
top: -16px;
|
|
5775
|
-
left: ${
|
|
5776
|
-
width: calc(100% - ${
|
|
5872
|
+
left: ${fn}px;
|
|
5873
|
+
width: calc(100% - ${fn * 2}px);
|
|
5777
5874
|
height: 36px;
|
|
5778
5875
|
z-index: 3;
|
|
5779
5876
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
@@ -6149,28 +6246,28 @@ function yo(e, t) {
|
|
|
6149
6246
|
filter: url(#pluno-pa-scribble-wobble-2);
|
|
6150
6247
|
}
|
|
6151
6248
|
`;
|
|
6152
|
-
if (
|
|
6249
|
+
if (al(e, n))
|
|
6153
6250
|
return;
|
|
6154
6251
|
const o = e.ownerDocument.createElement("style");
|
|
6155
|
-
o.id =
|
|
6252
|
+
o.id = Uo, o.textContent = n, e.appendChild(o), ni(e);
|
|
6156
6253
|
}
|
|
6157
|
-
function
|
|
6158
|
-
return e.getElementById(
|
|
6254
|
+
function il(e) {
|
|
6255
|
+
return e.getElementById(Uo) !== null || e.host instanceof HTMLElement && e.host.getAttribute(Bo) === "true";
|
|
6159
6256
|
}
|
|
6160
|
-
function
|
|
6161
|
-
e.host instanceof HTMLElement && e.host.setAttribute(
|
|
6257
|
+
function ni(e) {
|
|
6258
|
+
e.host instanceof HTMLElement && e.host.setAttribute(Bo, "true");
|
|
6162
6259
|
}
|
|
6163
|
-
function
|
|
6260
|
+
function al(e, t) {
|
|
6164
6261
|
if (typeof CSSStyleSheet > "u" || typeof CSSStyleSheet.prototype.replaceSync != "function" || !("adoptedStyleSheets" in e))
|
|
6165
6262
|
return !1;
|
|
6166
6263
|
try {
|
|
6167
6264
|
const n = new CSSStyleSheet();
|
|
6168
|
-
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n],
|
|
6265
|
+
return n.replaceSync(t), e.adoptedStyleSheets = [...e.adoptedStyleSheets, n], ni(e), !0;
|
|
6169
6266
|
} catch {
|
|
6170
6267
|
return !1;
|
|
6171
6268
|
}
|
|
6172
6269
|
}
|
|
6173
|
-
async function
|
|
6270
|
+
async function rl() {
|
|
6174
6271
|
return document.body ? document.body : await new Promise((e) => {
|
|
6175
6272
|
const t = new MutationObserver(() => {
|
|
6176
6273
|
document.body && (t.disconnect(), e(document.body));
|
|
@@ -6178,25 +6275,25 @@ async function ol() {
|
|
|
6178
6275
|
t.observe(document.documentElement, { childList: !0 });
|
|
6179
6276
|
});
|
|
6180
6277
|
}
|
|
6181
|
-
function
|
|
6278
|
+
function Ln(e) {
|
|
6182
6279
|
return `pluno.productAgent.widgetState.${location.origin}.${e.backendUrl ?? ""}.${e.tokenEndpoint ?? ""}.${e.position ?? ""}`;
|
|
6183
6280
|
}
|
|
6184
|
-
function
|
|
6185
|
-
return `${
|
|
6281
|
+
function oi(e) {
|
|
6282
|
+
return `${Ln(e)}.displayState`;
|
|
6186
6283
|
}
|
|
6187
|
-
function
|
|
6284
|
+
function ll(e) {
|
|
6188
6285
|
try {
|
|
6189
6286
|
return window.sessionStorage.getItem(
|
|
6190
|
-
|
|
6287
|
+
oi(e)
|
|
6191
6288
|
) === "minimized" ? "minimized" : "shown";
|
|
6192
6289
|
} catch {
|
|
6193
6290
|
return "shown";
|
|
6194
6291
|
}
|
|
6195
6292
|
}
|
|
6196
|
-
function
|
|
6293
|
+
function Co(e, t) {
|
|
6197
6294
|
if (e.layout === "floating")
|
|
6198
6295
|
try {
|
|
6199
|
-
const n =
|
|
6296
|
+
const n = oi(e);
|
|
6200
6297
|
if (t === "minimized") {
|
|
6201
6298
|
window.sessionStorage.setItem(n, t);
|
|
6202
6299
|
return;
|
|
@@ -6206,7 +6303,7 @@ function vo(e, t) {
|
|
|
6206
6303
|
return;
|
|
6207
6304
|
}
|
|
6208
6305
|
}
|
|
6209
|
-
function
|
|
6306
|
+
function sl(e) {
|
|
6210
6307
|
if (e)
|
|
6211
6308
|
return { clientId: e, release: () => {
|
|
6212
6309
|
} };
|
|
@@ -6214,7 +6311,7 @@ function al(e) {
|
|
|
6214
6311
|
for (; Qt.has(t); )
|
|
6215
6312
|
t += 1;
|
|
6216
6313
|
Qt.add(t);
|
|
6217
|
-
const n = `${
|
|
6314
|
+
const n = `${ha}${t}`;
|
|
6218
6315
|
let o = crypto.randomUUID();
|
|
6219
6316
|
try {
|
|
6220
6317
|
o = window.sessionStorage.getItem(n) ?? o, window.sessionStorage.setItem(n, o);
|
|
@@ -6228,9 +6325,9 @@ function al(e) {
|
|
|
6228
6325
|
}
|
|
6229
6326
|
};
|
|
6230
6327
|
}
|
|
6231
|
-
function
|
|
6328
|
+
function pl(e) {
|
|
6232
6329
|
try {
|
|
6233
|
-
const t = window.localStorage.getItem(
|
|
6330
|
+
const t = window.localStorage.getItem(Ln(e));
|
|
6234
6331
|
if (!t)
|
|
6235
6332
|
return So();
|
|
6236
6333
|
const n = JSON.parse(t);
|
|
@@ -6242,25 +6339,25 @@ function rl(e) {
|
|
|
6242
6339
|
openToolGroupKeys: Array.isArray(n.openToolGroupKeys) ? n.openToolGroupKeys.filter(
|
|
6243
6340
|
(o) => typeof o == "string"
|
|
6244
6341
|
) : [],
|
|
6245
|
-
launcherPosition:
|
|
6246
|
-
panelSize:
|
|
6247
|
-
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-
|
|
6342
|
+
launcherPosition: gl(n.launcherPosition) ? n.launcherPosition : null,
|
|
6343
|
+
panelSize: hl(n.panelSize) ? Pt(n.panelSize) : null,
|
|
6344
|
+
seenShareCandidateIds: Array.isArray(n.seenShareCandidateIds) ? n.seenShareCandidateIds.filter((o) => typeof o == "string").slice(-Po) : [],
|
|
6248
6345
|
sharePromptsDisabled: n.sharePromptsDisabled === !0
|
|
6249
6346
|
};
|
|
6250
6347
|
} catch {
|
|
6251
6348
|
return So();
|
|
6252
6349
|
}
|
|
6253
6350
|
}
|
|
6254
|
-
async function
|
|
6351
|
+
async function dl(e) {
|
|
6255
6352
|
if (e.loadSharePromptsDisabled)
|
|
6256
6353
|
return e.loadSharePromptsDisabled();
|
|
6257
6354
|
try {
|
|
6258
|
-
return window.localStorage.getItem(
|
|
6355
|
+
return window.localStorage.getItem(No) === "true";
|
|
6259
6356
|
} catch {
|
|
6260
6357
|
return !1;
|
|
6261
6358
|
}
|
|
6262
6359
|
}
|
|
6263
|
-
function
|
|
6360
|
+
function cl(e, t) {
|
|
6264
6361
|
if (e.persistSharePromptsDisabled) {
|
|
6265
6362
|
Promise.resolve(e.persistSharePromptsDisabled(t)).catch(
|
|
6266
6363
|
() => {
|
|
@@ -6269,7 +6366,7 @@ function sl(e, t) {
|
|
|
6269
6366
|
return;
|
|
6270
6367
|
}
|
|
6271
6368
|
try {
|
|
6272
|
-
t && window.localStorage.setItem(
|
|
6369
|
+
t && window.localStorage.setItem(No, "true");
|
|
6273
6370
|
} catch {
|
|
6274
6371
|
return;
|
|
6275
6372
|
}
|
|
@@ -6287,29 +6384,29 @@ function So() {
|
|
|
6287
6384
|
sharePromptsDisabled: !1
|
|
6288
6385
|
};
|
|
6289
6386
|
}
|
|
6290
|
-
function
|
|
6387
|
+
function ul(e, t) {
|
|
6291
6388
|
try {
|
|
6292
6389
|
window.localStorage.setItem(
|
|
6293
|
-
|
|
6390
|
+
Ln(e),
|
|
6294
6391
|
JSON.stringify(t)
|
|
6295
6392
|
);
|
|
6296
6393
|
} catch {
|
|
6297
6394
|
return;
|
|
6298
6395
|
}
|
|
6299
6396
|
}
|
|
6300
|
-
function
|
|
6397
|
+
function gl(e) {
|
|
6301
6398
|
if (!e || typeof e != "object")
|
|
6302
6399
|
return !1;
|
|
6303
6400
|
const t = e;
|
|
6304
6401
|
return Number.isFinite(t.x) && Number.isFinite(t.y) && (t.anchor === "top-left" || t.anchor === "top-right" || t.anchor === "bottom-left" || t.anchor === "bottom-right");
|
|
6305
6402
|
}
|
|
6306
|
-
function
|
|
6403
|
+
function hl(e) {
|
|
6307
6404
|
if (!e || typeof e != "object")
|
|
6308
6405
|
return !1;
|
|
6309
6406
|
const t = e;
|
|
6310
6407
|
return typeof t.width == "number" && Number.isFinite(t.width) && typeof t.height == "number" && Number.isFinite(t.height);
|
|
6311
6408
|
}
|
|
6312
|
-
async function
|
|
6409
|
+
async function ii(e, t) {
|
|
6313
6410
|
const n = await fetch(e, {
|
|
6314
6411
|
method: "POST",
|
|
6315
6412
|
credentials: "include",
|
|
@@ -6321,7 +6418,7 @@ async function oi(e, t) {
|
|
|
6321
6418
|
...t ? { signal: t } : {}
|
|
6322
6419
|
});
|
|
6323
6420
|
if (!n.ok) {
|
|
6324
|
-
const i = await n.text(), r =
|
|
6421
|
+
const i = await n.text(), r = Ei(i);
|
|
6325
6422
|
throw r ? (console.error(r), new Error(r)) : new Error(`Failed to load Pluno token (${n.status})`);
|
|
6326
6423
|
}
|
|
6327
6424
|
const o = await n.json();
|
|
@@ -6329,29 +6426,29 @@ async function oi(e, t) {
|
|
|
6329
6426
|
throw new Error("Pluno token endpoint did not return a token");
|
|
6330
6427
|
return o.token;
|
|
6331
6428
|
}
|
|
6332
|
-
function
|
|
6429
|
+
function ml(e) {
|
|
6333
6430
|
let t = !1, n = !1;
|
|
6334
6431
|
const o = async () => {
|
|
6335
6432
|
const i = new AbortController();
|
|
6336
6433
|
let r = !1;
|
|
6337
|
-
const l = new Promise((
|
|
6338
|
-
const
|
|
6339
|
-
r = !0, i.abort(),
|
|
6340
|
-
},
|
|
6434
|
+
const l = new Promise((s, p) => {
|
|
6435
|
+
const u = window.setTimeout(() => {
|
|
6436
|
+
r = !0, i.abort(), p(new Error(Jn));
|
|
6437
|
+
}, ua);
|
|
6341
6438
|
i.signal.addEventListener(
|
|
6342
6439
|
"abort",
|
|
6343
|
-
() => window.clearTimeout(
|
|
6440
|
+
() => window.clearTimeout(u),
|
|
6344
6441
|
{ once: !0 }
|
|
6345
6442
|
);
|
|
6346
6443
|
});
|
|
6347
6444
|
try {
|
|
6348
|
-
const
|
|
6349
|
-
|
|
6445
|
+
const s = await Promise.race([
|
|
6446
|
+
ii(e, i.signal),
|
|
6350
6447
|
l
|
|
6351
6448
|
]);
|
|
6352
|
-
return i.abort(),
|
|
6353
|
-
} catch (
|
|
6354
|
-
throw i.abort(), r ? new Error(
|
|
6449
|
+
return i.abort(), s;
|
|
6450
|
+
} catch (s) {
|
|
6451
|
+
throw i.abort(), r ? new Error(Jn) : s instanceof Error && s.message.startsWith("Pluno widget blocked on ") ? s : new Error(ga);
|
|
6355
6452
|
}
|
|
6356
6453
|
};
|
|
6357
6454
|
return {
|
|
@@ -6374,30 +6471,30 @@ function ul(e) {
|
|
|
6374
6471
|
}
|
|
6375
6472
|
};
|
|
6376
6473
|
}
|
|
6377
|
-
const
|
|
6378
|
-
function
|
|
6474
|
+
const Eo = /* @__PURE__ */ new WeakSet();
|
|
6475
|
+
function fl(e) {
|
|
6379
6476
|
return Object.keys(e.dataset).some((t) => t.startsWith("pluno"));
|
|
6380
6477
|
}
|
|
6381
|
-
function
|
|
6478
|
+
function ko(e) {
|
|
6382
6479
|
const t = e.pathname.split("/");
|
|
6383
6480
|
return t[t.length - 1] ?? "";
|
|
6384
6481
|
}
|
|
6385
|
-
function
|
|
6482
|
+
function wl(e, t) {
|
|
6386
6483
|
const n = new URL(e.src, document.baseURI);
|
|
6387
|
-
return n.href === t.href || n.pathname === t.pathname ? !0 :
|
|
6484
|
+
return n.href === t.href || n.pathname === t.pathname ? !0 : ko(n) === ko(t);
|
|
6388
6485
|
}
|
|
6389
6486
|
class ye extends EventTarget {
|
|
6390
6487
|
constructor(t, n) {
|
|
6391
|
-
super(), this.channelId = n, this.url = t, this.addPreviewListener(
|
|
6488
|
+
super(), this.channelId = n, this.url = t, this.addPreviewListener(la, () => {
|
|
6392
6489
|
this.readyState = ye.OPEN, this.dispatchEvent(new Event("open"));
|
|
6393
|
-
}), this.addPreviewListener(
|
|
6490
|
+
}), this.addPreviewListener(sa, (o) => {
|
|
6394
6491
|
const i = o;
|
|
6395
6492
|
this.dispatchEvent(
|
|
6396
6493
|
new MessageEvent("message", { data: i.detail?.data ?? "" })
|
|
6397
6494
|
);
|
|
6398
|
-
}), this.addPreviewListener(
|
|
6495
|
+
}), this.addPreviewListener(pa, () => {
|
|
6399
6496
|
this.readyState = ye.CLOSED, this.dispatchEvent(new Event("error")), this.cleanup();
|
|
6400
|
-
}), this.addPreviewListener(
|
|
6497
|
+
}), this.addPreviewListener(da, (o) => {
|
|
6401
6498
|
const i = o;
|
|
6402
6499
|
this.readyState = ye.CLOSED, this.dispatchEvent(
|
|
6403
6500
|
new CloseEvent("close", {
|
|
@@ -6409,7 +6506,7 @@ class ye extends EventTarget {
|
|
|
6409
6506
|
}), window.dispatchEvent(
|
|
6410
6507
|
new CustomEvent(
|
|
6411
6508
|
Et(
|
|
6412
|
-
|
|
6509
|
+
ia,
|
|
6413
6510
|
this.channelId
|
|
6414
6511
|
),
|
|
6415
6512
|
{
|
|
@@ -6429,7 +6526,7 @@ class ye extends EventTarget {
|
|
|
6429
6526
|
binaryType = "blob";
|
|
6430
6527
|
bufferedAmount = 0;
|
|
6431
6528
|
readyState = ye.CONNECTING;
|
|
6432
|
-
socketId =
|
|
6529
|
+
socketId = bl();
|
|
6433
6530
|
listeners = /* @__PURE__ */ new Map();
|
|
6434
6531
|
send(t) {
|
|
6435
6532
|
if (this.readyState !== ye.OPEN)
|
|
@@ -6439,7 +6536,7 @@ class ye extends EventTarget {
|
|
|
6439
6536
|
);
|
|
6440
6537
|
window.dispatchEvent(
|
|
6441
6538
|
new CustomEvent(
|
|
6442
|
-
Et(
|
|
6539
|
+
Et(aa, this.channelId),
|
|
6443
6540
|
{
|
|
6444
6541
|
detail: {
|
|
6445
6542
|
socketId: this.socketId,
|
|
@@ -6452,7 +6549,7 @@ class ye extends EventTarget {
|
|
|
6452
6549
|
close(t, n) {
|
|
6453
6550
|
this.readyState !== ye.CLOSED && (this.readyState = ye.CLOSING, window.dispatchEvent(
|
|
6454
6551
|
new CustomEvent(
|
|
6455
|
-
Et(
|
|
6552
|
+
Et(ra, this.channelId),
|
|
6456
6553
|
{
|
|
6457
6554
|
detail: { socketId: this.socketId, code: t, reason: n }
|
|
6458
6555
|
}
|
|
@@ -6474,19 +6571,19 @@ class ye extends EventTarget {
|
|
|
6474
6571
|
this.listeners.clear();
|
|
6475
6572
|
}
|
|
6476
6573
|
}
|
|
6477
|
-
function
|
|
6574
|
+
function bl() {
|
|
6478
6575
|
const e = window.sessionStorage.getItem(
|
|
6479
|
-
|
|
6576
|
+
Zn
|
|
6480
6577
|
);
|
|
6481
6578
|
if (e)
|
|
6482
6579
|
return e;
|
|
6483
6580
|
const t = crypto.randomUUID();
|
|
6484
|
-
return window.sessionStorage.setItem(
|
|
6581
|
+
return window.sessionStorage.setItem(Zn, t), t;
|
|
6485
6582
|
}
|
|
6486
6583
|
function Et(e, t) {
|
|
6487
6584
|
return `${e}:${t}`;
|
|
6488
6585
|
}
|
|
6489
|
-
function
|
|
6586
|
+
function _l(e) {
|
|
6490
6587
|
const t = document.currentScript;
|
|
6491
6588
|
if (t instanceof HTMLScriptElement)
|
|
6492
6589
|
return [t];
|
|
@@ -6494,65 +6591,65 @@ function fl(e) {
|
|
|
6494
6591
|
return Array.from(
|
|
6495
6592
|
document.querySelectorAll("script[type='module'][src]")
|
|
6496
6593
|
).filter(
|
|
6497
|
-
(i) => i instanceof HTMLScriptElement &&
|
|
6594
|
+
(i) => i instanceof HTMLScriptElement && fl(i) && wl(i, o)
|
|
6498
6595
|
);
|
|
6499
6596
|
}
|
|
6500
|
-
function
|
|
6501
|
-
for (const t of
|
|
6502
|
-
|
|
6597
|
+
function xl(e) {
|
|
6598
|
+
for (const t of _l(e))
|
|
6599
|
+
Eo.has(t) || t.dataset.plunoAutoMount === "false" || (Eo.add(t), ai(t).catch((n) => {
|
|
6503
6600
|
console.error("Failed to mount Pluno widget", n);
|
|
6504
6601
|
}));
|
|
6505
6602
|
}
|
|
6506
|
-
function
|
|
6603
|
+
function ai(e) {
|
|
6507
6604
|
const t = window, n = t[xe];
|
|
6508
6605
|
if (n) {
|
|
6509
6606
|
if (n.host === null)
|
|
6510
6607
|
return n.mountPromise.catch(() => {
|
|
6511
|
-
const
|
|
6512
|
-
return
|
|
6608
|
+
const p = t[xe];
|
|
6609
|
+
return p ? p.mountPromise : ai(e);
|
|
6513
6610
|
});
|
|
6514
|
-
if (
|
|
6611
|
+
if (yl(n.host))
|
|
6515
6612
|
return n.retryPendingTokenFailureOnce?.(), n.mountPromise;
|
|
6516
6613
|
n.destroy?.(), delete t[xe];
|
|
6517
6614
|
}
|
|
6518
|
-
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ?
|
|
6615
|
+
const o = e.dataset.plunoPreviewChannel, i = e.dataset.plunoTokenEndpoint, r = !e.dataset.plunoToken && !o && i ? ml(i) : null;
|
|
6519
6616
|
let l;
|
|
6520
|
-
const
|
|
6617
|
+
const s = Da({
|
|
6521
6618
|
token: e.dataset.plunoToken,
|
|
6522
6619
|
tokenProvider: r?.loadToken,
|
|
6523
6620
|
tokenEndpoint: i,
|
|
6524
6621
|
backendUrl: e.dataset.plunoBackendUrl,
|
|
6525
|
-
webSocketFactory: o ?
|
|
6622
|
+
webSocketFactory: o ? Ra(o) : void 0,
|
|
6526
6623
|
launcherLabel: e.dataset.plunoLauncherLabel,
|
|
6527
6624
|
accentColor: e.dataset.plunoAccentColor,
|
|
6528
6625
|
colorScheme: e.dataset.plunoColorScheme === "dark" ? "dark" : "light",
|
|
6529
6626
|
fontFamily: e.dataset.plunoFontFamily,
|
|
6530
6627
|
scribbleStyle: e.dataset.plunoScribbleStyle === void 0 ? void 0 : e.dataset.plunoScribbleStyle !== "false",
|
|
6531
6628
|
position: e.dataset.plunoPosition === "bottom-left" ? "bottom-left" : "bottom-right"
|
|
6532
|
-
}).then((
|
|
6629
|
+
}).then((p) => {
|
|
6533
6630
|
if (t[xe] !== l) {
|
|
6534
|
-
|
|
6631
|
+
p.destroy();
|
|
6535
6632
|
return;
|
|
6536
6633
|
}
|
|
6537
|
-
const
|
|
6538
|
-
|
|
6539
|
-
t[xe] === l && delete t[xe], l.host = null, l.destroy = null,
|
|
6634
|
+
const u = p.host;
|
|
6635
|
+
u.setAttribute(Io, "true"), l.host = u, l.destroy = () => {
|
|
6636
|
+
t[xe] === l && delete t[xe], l.host = null, l.destroy = null, p.destroy();
|
|
6540
6637
|
};
|
|
6541
|
-
}).catch((
|
|
6542
|
-
throw t[xe] === l && delete t[xe],
|
|
6638
|
+
}).catch((p) => {
|
|
6639
|
+
throw t[xe] === l && delete t[xe], p;
|
|
6543
6640
|
});
|
|
6544
6641
|
return l = {
|
|
6545
|
-
mountPromise:
|
|
6642
|
+
mountPromise: s,
|
|
6546
6643
|
host: null,
|
|
6547
6644
|
destroy: null,
|
|
6548
6645
|
retryPendingTokenFailureOnce: r?.retryPendingFailureOnce ?? null
|
|
6549
|
-
}, t[xe] = l,
|
|
6646
|
+
}, t[xe] = l, s;
|
|
6550
6647
|
}
|
|
6551
|
-
function
|
|
6552
|
-
return e.isConnected && e.getAttribute(
|
|
6648
|
+
function yl(e) {
|
|
6649
|
+
return e.isConnected && e.getAttribute(Io) === "true" && !!e.shadowRoot?.querySelector(".pluno-pa-widget__launcher") && !!e.shadowRoot?.querySelector(".pluno-pa-widget__panel");
|
|
6553
6650
|
}
|
|
6554
|
-
|
|
6651
|
+
xl(import.meta.url);
|
|
6555
6652
|
export {
|
|
6556
|
-
|
|
6557
|
-
|
|
6653
|
+
Ra as createProductAgentPreviewBridgeWebSocketFactory,
|
|
6654
|
+
Da as mountPlunoProductAgentWidget
|
|
6558
6655
|
};
|